PromucFlow_constructor/app/client/src/widgets/DropdownWidget.tsx

34 lines
778 B
TypeScript
Raw Normal View History

2019-09-12 08:11:25 +00:00
import React from "react";
import BaseWidget, { IWidgetProps, IWidgetState } from "./BaseWidget";
import { WidgetType } from "../constants/WidgetConstants";
2019-09-12 12:19:46 +00:00
import { ActionPayload } from '../constants/ActionConstants';
2019-09-12 08:11:25 +00:00
class DropdownWidget extends BaseWidget<DropdownWidgetProps, IWidgetState> {
getPageView() {
return (
<div/>
);
}
getWidgetType(): WidgetType {
return "DROP_DOWN_WIDGET";
}
}
export type SelectionType = "SINGLE_SELECT" | "MULTI_SELECT>"
export interface DropdownOption {
label: string
value: string
}
export interface DropdownWidgetProps extends IWidgetProps {
placeholder?: string;
label?: string
type: SelectionType
options?: DropdownOption[]
2019-09-12 12:19:46 +00:00
onOptionSelected?: ActionPayload[]
2019-09-12 08:11:25 +00:00
}
export default DropdownWidget;