2022-10-27 10:02:12 +00:00
|
|
|
import { LabelPosition } from "components/constants";
|
2023-03-04 07:25:54 +00:00
|
|
|
import { FILL_WIDGET_MIN_WIDTH } from "constants/minWidthConstants";
|
2023-04-07 13:51:35 +00:00
|
|
|
import { ResponsiveBehavior } from "utils/autoLayout/constants";
|
2022-11-24 18:40:06 +00:00
|
|
|
import { DynamicHeight } from "utils/WidgetFeatures";
|
2023-03-04 07:25:54 +00:00
|
|
|
import { CONFIG as BaseConfig } from "widgets/BaseInputWidget";
|
2023-04-07 13:51:35 +00:00
|
|
|
import type { BaseInputWidgetProps } from "widgets/BaseInputWidget/widget";
|
|
|
|
|
|
2023-03-04 07:25:54 +00:00
|
|
|
import IconSVG from "./icon.svg";
|
|
|
|
|
import Widget from "./widget";
|
2022-01-18 07:52:24 +00:00
|
|
|
|
|
|
|
|
export const CONFIG = {
|
2022-11-23 09:48:23 +00:00
|
|
|
features: {
|
2022-11-24 18:40:06 +00:00
|
|
|
dynamicHeight: {
|
|
|
|
|
sectionIndex: 3,
|
|
|
|
|
defaultValue: DynamicHeight.FIXED,
|
|
|
|
|
active: true,
|
|
|
|
|
},
|
2022-11-23 09:48:23 +00:00
|
|
|
},
|
2022-01-18 07:52:24 +00:00
|
|
|
type: Widget.getWidgetType(),
|
|
|
|
|
name: "Input",
|
|
|
|
|
iconSVG: IconSVG,
|
|
|
|
|
needsMeta: true,
|
2022-06-17 03:12:47 +00:00
|
|
|
searchTags: ["form", "text input", "number", "textarea"],
|
2022-01-18 07:52:24 +00:00
|
|
|
defaults: {
|
|
|
|
|
...BaseConfig.defaults,
|
2022-10-27 10:02:12 +00:00
|
|
|
rows: 7,
|
|
|
|
|
labelPosition: LabelPosition.Top,
|
2022-01-18 07:52:24 +00:00
|
|
|
inputType: "TEXT",
|
|
|
|
|
widgetName: "Input",
|
|
|
|
|
version: 2,
|
2022-12-21 17:07:15 +00:00
|
|
|
showStepArrows: false,
|
2023-04-07 13:51:35 +00:00
|
|
|
responsiveBehavior: ResponsiveBehavior.Fill,
|
2023-03-04 07:25:54 +00:00
|
|
|
minWidth: FILL_WIDGET_MIN_WIDTH,
|
2022-01-18 07:52:24 +00:00
|
|
|
},
|
|
|
|
|
properties: {
|
|
|
|
|
derived: Widget.getDerivedPropertiesMap(),
|
|
|
|
|
default: Widget.getDefaultPropertiesMap(),
|
|
|
|
|
meta: Widget.getMetaPropertiesMap(),
|
|
|
|
|
config: Widget.getPropertyPaneConfig(),
|
2022-08-11 11:20:09 +00:00
|
|
|
contentConfig: Widget.getPropertyPaneContentConfig(),
|
|
|
|
|
styleConfig: Widget.getPropertyPaneStyleConfig(),
|
2022-11-28 04:44:31 +00:00
|
|
|
stylesheetConfig: Widget.getStylesheetConfig(),
|
2023-04-14 06:27:49 +00:00
|
|
|
autocompleteDefinitions: Widget.getAutocompleteDefinitions(),
|
2022-01-18 07:52:24 +00:00
|
|
|
},
|
2023-04-07 13:51:35 +00:00
|
|
|
autoLayout: {
|
|
|
|
|
disabledPropsDefaults: {
|
|
|
|
|
labelPosition: LabelPosition.Top,
|
|
|
|
|
labelTextSize: "0.875rem",
|
|
|
|
|
},
|
|
|
|
|
autoDimension: (props: BaseInputWidgetProps) => ({
|
|
|
|
|
height: props.inputType !== "MULTI_LINE_TEXT",
|
|
|
|
|
}),
|
|
|
|
|
defaults: {
|
|
|
|
|
rows: 7,
|
|
|
|
|
},
|
|
|
|
|
widgetSize: [
|
|
|
|
|
{
|
|
|
|
|
viewportMinWidth: 0,
|
|
|
|
|
configuration: () => {
|
|
|
|
|
return {
|
|
|
|
|
minWidth: "120px",
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
disableResizeHandles: (props: BaseInputWidgetProps) => ({
|
|
|
|
|
vertical: props.inputType !== "MULTI_LINE_TEXT",
|
|
|
|
|
}),
|
|
|
|
|
},
|
2022-01-18 07:52:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Widget;
|