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

31 lines
767 B
TypeScript
Raw Normal View History

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