2020-06-04 13:49:22 +00:00
|
|
|
import { WidgetType } from "constants/WidgetConstants";
|
|
|
|
|
|
|
|
|
|
const FIELD_VALUES: Record<
|
|
|
|
|
WidgetType | "API_ACTION",
|
|
|
|
|
Record<string, string>
|
|
|
|
|
> = {
|
|
|
|
|
API_ACTION: {
|
|
|
|
|
body: "JSON",
|
|
|
|
|
params: "string",
|
|
|
|
|
headers: "string",
|
|
|
|
|
path: "string",
|
|
|
|
|
},
|
|
|
|
|
CANVAS_WIDGET: {},
|
|
|
|
|
ICON_WIDGET: {},
|
2020-10-21 04:25:32 +00:00
|
|
|
SKELETON_WIDGET: {},
|
2021-04-27 07:16:54 +00:00
|
|
|
TABS_MIGRATOR_WIDGET: {},
|
2020-06-04 13:49:22 +00:00
|
|
|
CONTAINER_WIDGET: {
|
|
|
|
|
backgroundColor: "string",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
},
|
|
|
|
|
DATE_PICKER_WIDGET: {
|
2021-02-02 14:42:49 +00:00
|
|
|
defaultDate: "string", //TODO:Vicky validate this property
|
2020-06-04 13:49:22 +00:00
|
|
|
isRequired: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
isDisabled: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onDateSelected: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
2021-02-23 12:35:09 +00:00
|
|
|
DATE_PICKER_WIDGET2: {
|
2021-03-24 12:12:24 +00:00
|
|
|
defaultDate: "string | null", //TODO:Vicky validate this property
|
2021-02-23 12:35:09 +00:00
|
|
|
isRequired: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
isDisabled: "boolean",
|
|
|
|
|
// onDateSelected: "Function Call",
|
|
|
|
|
},
|
2020-06-04 13:49:22 +00:00
|
|
|
TABLE_WIDGET: {
|
|
|
|
|
tableData: "Array<Object>",
|
|
|
|
|
serverSidePaginationEnabled: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
exportPDF: "boolean",
|
|
|
|
|
exportExcel: "boolean",
|
|
|
|
|
exportCsv: "boolean",
|
2020-11-20 07:43:39 +00:00
|
|
|
defaultSelectedRow: "string",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onRowSelected: "Function Call",
|
|
|
|
|
// onPageChange: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
2020-09-26 12:59:33 +00:00
|
|
|
VIDEO_WIDGET: {
|
|
|
|
|
url: "string",
|
|
|
|
|
autoPlay: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
},
|
2020-06-04 13:49:22 +00:00
|
|
|
IMAGE_WIDGET: {
|
|
|
|
|
image: "string",
|
|
|
|
|
defaultImage: "string",
|
|
|
|
|
isVisible: "boolean",
|
2020-10-29 11:14:39 +00:00
|
|
|
maxZoomLevel: "number",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
|
|
|
|
RADIO_GROUP_WIDGET: {
|
|
|
|
|
options: "Array<{ label: string, value: string }>",
|
|
|
|
|
defaultOptionValue: "string",
|
|
|
|
|
isRequired: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onSelectionChange: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
|
|
|
|
TABS_WIDGET: {
|
|
|
|
|
selectedTab: "string",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
},
|
|
|
|
|
CHART_WIDGET: {
|
|
|
|
|
chartName: "string",
|
2021-03-24 22:05:04 +00:00
|
|
|
chartType:
|
|
|
|
|
"LINE_CHART | BAR_CHART | PIE_CHART | COLUMN_CHART | AREA_CHART | CUSTOM_FUSION_CHART",
|
2020-06-04 13:49:22 +00:00
|
|
|
xAxisName: "string",
|
|
|
|
|
yAxisName: "string",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
},
|
|
|
|
|
MODAL_WIDGET: {
|
|
|
|
|
canOutsideClickClose: "boolean",
|
|
|
|
|
size: "MODAL_LARGE | MODAL_SMALL",
|
|
|
|
|
},
|
|
|
|
|
INPUT_WIDGET: {
|
|
|
|
|
inputType: "string",
|
|
|
|
|
placeholderText: "string",
|
|
|
|
|
defaultText: "string",
|
|
|
|
|
regex: "string",
|
|
|
|
|
errorMessage: "string",
|
|
|
|
|
isRequired: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
isDisabled: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onTextChanged: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
|
|
|
|
DROP_DOWN_WIDGET: {
|
|
|
|
|
label: "string",
|
|
|
|
|
selectionType: "SINGLE_SELECT | MULTI_SELECT",
|
|
|
|
|
options: "Array<{ label: string, value: string }>",
|
|
|
|
|
defaultOptionValue: "string",
|
|
|
|
|
isRequired: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onOptionChange: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
|
|
|
|
FORM_BUTTON_WIDGET: {
|
|
|
|
|
text: "string",
|
|
|
|
|
buttonStyle: "PRIMARY_BUTTON | SECONDARY_BUTTON | DANGER_BUTTON",
|
|
|
|
|
disabledWhenInvalid: "boolean",
|
|
|
|
|
resetFormOnClick: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onClick: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
|
|
|
|
MAP_WIDGET: {
|
2021-01-19 07:29:15 +00:00
|
|
|
mapCenter: "{ lat: number, long: number }",
|
2020-06-04 13:49:22 +00:00
|
|
|
defaultMarkers: "Array<{ lat: number, long: number }>",
|
|
|
|
|
enableSearch: "boolean",
|
|
|
|
|
enablePickLocation: "boolean",
|
|
|
|
|
enableCreateMarker: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onMarkerClick: "Function Call",
|
|
|
|
|
// onCreateMarker: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
|
|
|
|
BUTTON_WIDGET: {
|
|
|
|
|
text: "string",
|
|
|
|
|
buttonStyle: "PRIMARY_BUTTON | SECONDARY_BUTTON | DANGER_BUTTON",
|
|
|
|
|
isVisible: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onClick: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
|
|
|
|
RICH_TEXT_EDITOR_WIDGET: {
|
|
|
|
|
defaultText: "string",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
isDisabled: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onTextChange: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
|
|
|
|
FILE_PICKER_WIDGET: {
|
|
|
|
|
label: "string",
|
|
|
|
|
maxNumFiles: "number",
|
|
|
|
|
maxFileSize: "number",
|
|
|
|
|
|
|
|
|
|
allowedFileTypes: "Array<string>",
|
|
|
|
|
isRequired: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onFilesSelected: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
|
|
|
|
CHECKBOX_WIDGET: {
|
|
|
|
|
label: "string",
|
|
|
|
|
defaultCheckedState: "boolean",
|
|
|
|
|
isRequired: "boolean",
|
|
|
|
|
isDisabled: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
2020-07-07 08:49:22 +00:00
|
|
|
// onCheckChange: "Function Call",
|
2020-06-04 13:49:22 +00:00
|
|
|
},
|
2021-02-16 12:15:17 +00:00
|
|
|
SWITCH_WIDGET: {
|
|
|
|
|
label: "string",
|
|
|
|
|
defaultSwitchState: "boolean",
|
|
|
|
|
isDisabled: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
alignWidget: "LEFT | RIGHT",
|
|
|
|
|
// onChange: "Function Call",
|
|
|
|
|
},
|
2020-06-04 13:49:22 +00:00
|
|
|
FORM_WIDGET: {
|
|
|
|
|
backgroundColor: "string",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
},
|
|
|
|
|
TEXT_WIDGET: {
|
|
|
|
|
text: "string",
|
|
|
|
|
textAlign: "LEFT | CENTER | RIGHT",
|
|
|
|
|
textStyle: "HEADING | LABEL | BODY",
|
|
|
|
|
shouldScroll: "boolean",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
},
|
2021-04-23 05:43:13 +00:00
|
|
|
LIST_WIDGET: {
|
2021-06-18 07:42:57 +00:00
|
|
|
listData: "Array<Object>",
|
2021-04-23 05:43:13 +00:00
|
|
|
isVisible: "boolean",
|
|
|
|
|
gridGap: "number",
|
|
|
|
|
},
|
2021-07-02 09:55:50 +00:00
|
|
|
RATE_WIDGET: {
|
|
|
|
|
maxCount: "number",
|
|
|
|
|
defaultRate: "number",
|
|
|
|
|
activeColor: "string",
|
|
|
|
|
inactiveColor: "string",
|
|
|
|
|
size: "RATE_SMALL | RATE_MEDIUM | RATE_LARGE",
|
|
|
|
|
tooltips: "Array<string>",
|
|
|
|
|
isVisible: "boolean",
|
|
|
|
|
isDisabled: "boolean",
|
|
|
|
|
},
|
2021-06-09 09:39:17 +00:00
|
|
|
IFRAME_WIDGET: {
|
|
|
|
|
source: "string",
|
|
|
|
|
title: "string",
|
2021-06-21 10:48:00 +00:00
|
|
|
borderOpacity: "number",
|
|
|
|
|
borderWidth: "number",
|
2021-06-09 09:39:17 +00:00
|
|
|
},
|
2020-06-04 13:49:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default FIELD_VALUES;
|