PromucFlow_constructor/app/client/src/widgets/DropdownWidget.tsx
Nikhil Nandagopal 5f6aeb55f8 added new control types
removed alert from widget list
added property config values
added input validator
2019-09-19 16:59:24 +05:30

31 lines
771 B
TypeScript

import React from "react";
import BaseWidget, { WidgetProps, WidgetState } from "./BaseWidget";
import { WidgetType } from "../constants/WidgetConstants";
import { ActionPayload } from "../constants/ActionConstants";
class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
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 WidgetProps {
placeholderText?: string;
label?: string;
type: SelectionType;
options?: DropdownOption[];
onOptionSelected?: ActionPayload[];
}
export default DropdownWidget;