@next-libs/visual-builder 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"brick-visualization.js","names":["Required","ItemModeType"],"sources":["../../../src/interfaces/brick-visualization.ts"],"sourcesContent":["import { FormInstance } from \"antd/lib/form\";\n\nexport type FormItemType =\n | boolean\n | string\n | string[]\n | number\n | Record<string, any>;\n\nexport enum Required {\n True = \"true\",\n False = \"false\",\n}\n\nexport enum ItemModeType {\n Normal = \"normal\",\n Advanced = \"advanced\",\n}\n\nexport interface PropertyType {\n type: FormItemType;\n name: string;\n editor?: {\n model?: string;\n };\n required?: Required;\n description?: string;\n default?: string;\n group?: string;\n groupI18N?: Record<string, { [language: string]: string }>;\n}\n\nexport interface UnionPropertyType extends PropertyType {\n mode?: ItemModeType;\n value?: any;\n jsonSchema?: Record<string, any>;\n schemaRef?: string;\n}\n\nexport type BrickProperties = Record<string, any>;\n\nexport interface visualFormUtils extends Partial<FormInstance> {\n resetPropertyFields: (\n typeList: PropertyType[],\n properties: BrickProperties\n ) => void;\n getCurTypeList: () => UnionPropertyType[];\n}\n"],"mappings":";;;;;;IASYA,QAAQ;AAAA;AAAA,WAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,wBAARA,QAAQ;AAAA,IAKRC,YAAY;AAAA;AAAA,WAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,4BAAZA,YAAY"}
1
+ {"version":3,"file":"brick-visualization.js","names":["Required","ItemModeType"],"sources":["../../../src/interfaces/brick-visualization.ts"],"sourcesContent":["import { FormInstance } from \"antd/lib/form\";\n\nexport type FormItemType =\n | boolean\n | string\n | string[]\n | number\n | Record<string, any>;\n\nexport enum Required {\n True = \"true\",\n False = \"false\",\n}\n\nexport enum ItemModeType {\n Normal = \"normal\",\n Advanced = \"advanced\",\n}\n\nexport interface PropertyType {\n type: FormItemType;\n name: string;\n editor?: {\n model?: string;\n };\n required?: Required;\n description?: string;\n default?: string;\n group?: string;\n groupI18N?: Record<string, { [language: string]: string }>;\n enums?: string;\n}\n\nexport interface UnionPropertyType extends PropertyType {\n mode?: ItemModeType;\n value?: any;\n jsonSchema?: Record<string, any>;\n schemaRef?: string;\n}\n\nexport type BrickProperties = Record<string, any>;\n\nexport interface visualFormUtils extends Partial<FormInstance> {\n resetPropertyFields: (\n typeList: PropertyType[],\n properties: BrickProperties\n ) => void;\n getCurTypeList: () => UnionPropertyType[];\n}\n"],"mappings":";;;;;;IASYA,QAAQ;AAAA;AAAA,WAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,wBAARA,QAAQ;AAAA,IAKRC,YAAY;AAAA;AAAA,WAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,4BAAZA,YAAY"}
@@ -355,13 +355,12 @@ function LegacyVisualPropertyForm(props, ref) {
355
355
  }));
356
356
  };
357
357
  const getFormItem = item => {
358
- const type = item.type;
359
358
  // todo(sailor): update unit text
360
- if (/true|false/.test(type)) {
359
+ if (/true|false/.test(item.type)) {
361
360
  return renderBooleanItem(item);
362
361
  }
363
- if (type.indexOf("|") > 0) {
364
- const emunList = type.replace(/"|'/g, "").split("|");
362
+ if (item.enums) {
363
+ const emunList = item.enums.replace(/"|'/g, "").split("|");
365
364
  return renderEnumItem(item, emunList);
366
365
  }
367
366
  switch (item.type) {
@@ -405,9 +404,10 @@ function LegacyVisualPropertyForm(props, ref) {
405
404
  image: theme === "dark-v2" ? /*#__PURE__*/_react.default.createElement(_emptyDark.ReactComponent, null) : _antd.Empty.PRESENTED_IMAGE_SIMPLE,
406
405
  imageStyle: emptyConfig === null || emptyConfig === void 0 ? void 0 : emptyConfig.imageStyle
407
406
  }) : /*#__PURE__*/_react.default.createElement(_antd.Form, {
407
+ className: _VisualPropertyFormModule.default.visualPropertyForm,
408
408
  name: "propertyForm",
409
409
  layout: "horizontal",
410
- labelAlign: "left",
410
+ labelAlign: "right",
411
411
  labelCol: {
412
412
  style: {
413
413
  minWidth: "120px"
@@ -1 +1 @@
1
- {"version":3,"file":"VisualPropertyForm.js","names":["ButtonTypeEmun","LegacyVisualPropertyForm","props","ref","theme","useCurrentTheme","projectId","labelIcon","propertyTypeList","brickProperties","brickInfo","emptyConfig","hiddenPropsCategory","menuSettingClick","childMountPointList","form","Form","useForm","typeList","setTypeList","useState","mergeProperties","useImperativeHandle","validateFields","resetPropertyFields","properties","restValue","resetFields","getCurTypeList","map","item","pick","useEffect","newTypeList","newValue","calculateValue","setFieldsValue","handleLabelClick","name","selected","find","index","findIndex","nextMode","mode","ItemModeType","Advanced","Normal","value","supportMenuType","includes","type","matchNoramlMenuValue","isNil","yamlStringify","update","$splice","renderLabel","hideIcon","description","styles","iconContainer","advanced","normal","renderEditorItem","required","Required","True","jsonSchema","schemaRef","editor","model","renderStringItem","message","renderBooleanItem","renderInputNumberItem","renderStringListItem","renderIconItem","renderCodeEditorItem","renderColorItem","renderMenuItem","renderGeneralOptipns","renderFormItem","label","disabled","onValuesChange","renderCustomColumn","dataIndex","key","title","useChildren","filter","startsWith","endsWith","inputValue","option","children","toUpperCase","indexOf","renderCustomButtons","id","text","tooltip","eventName","buttonType","hide","isDivider","isDropdown","renderEnumItem","enumList","getFormItem","test","emunList","replace","split","renderOthersItem","OTHER_FORM_ITEM_FIELD","Infinity","isEmpty","empty","Empty","PRESENTED_IMAGE_SIMPLE","imageStyle","style","minWidth","panelContainer","groupByType","category","list","upperFirst","otherPanel","VisualPropertyForm","React","forwardRef"],"sources":["../../../src/visual-property-form/VisualPropertyForm.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useState } from \"react\";\nimport {\n Form,\n Input,\n InputNumber,\n Select,\n Tooltip,\n Collapse,\n Empty,\n Switch,\n AutoComplete,\n} from \"antd\";\nimport { EmptyProps } from \"antd/lib/empty\";\nimport { useCurrentTheme } from \"@next-core/brick-kit\";\nimport { MenuIcon } from \"@next-core/brick-types\";\nimport { GeneralIcon } from \"@next-libs/basic-components\";\nimport update from \"immutability-helper\";\nimport { isNil, pick, upperFirst, isEmpty } from \"lodash\";\nimport styles from \"./VisualPropertyForm.module.css\";\nimport { FormProps } from \"antd/lib/form\";\nimport { CodeEditorFormItem } from \"./components/CodeEditor/CodeEditorFormItem\";\nimport { IconSelectFormItem } from \"./components/IconSelect/IconSelectFormItem\";\nimport { ColorEditorItem } from \"./components/ColorEditor/ColorEditorItem\";\nimport { MenuEditorItem } from \"./components/MenuEditor/MenuEditorItem\";\nimport { ListEditor } from \"./components/ListEditor/ListEditor\";\nimport { ReactComponent as DarkEmpty } from \"./images/empty-dark.svg\";\nimport {\n mergeProperties,\n calculateValue,\n groupByType,\n yamlStringify,\n} from \"./processor\";\nimport { OTHER_FORM_ITEM_FIELD, supportMenuType } from \"./constant\";\nimport { matchNoramlMenuValue } from \"./processor\";\nimport {\n PropertyType,\n BrickProperties,\n visualFormUtils,\n ItemModeType,\n UnionPropertyType,\n Required,\n} from \"../interfaces\";\n\nconst ButtonTypeEmun = [\n \"link\",\n \"default\",\n \"primary\",\n \"ghost\",\n \"dashed\",\n \"icon\",\n \"text\",\n];\n\nexport type CustomColumn = {\n dataIndex: string;\n title: string;\n useChildren?: string;\n [k: string]: any;\n};\n\nexport type GeneralOptionProps = {\n label: string;\n value: string;\n disabled?: boolean;\n};\n\nexport type CustomButtonProps = {\n id: string;\n buttonType: string;\n eventName: string;\n text: string;\n tooltip: string;\n icon: MenuIcon;\n hide: boolean;\n disabled: boolean;\n isDivider: boolean;\n isDropdown: boolean;\n};\nexport interface VisualPropertyFormProps {\n projectId?: string;\n propertyTypeList: PropertyType[];\n labelIcon: {\n normal?: MenuIcon;\n advanced?: MenuIcon;\n };\n brickProperties: BrickProperties;\n onValuesChange?: FormProps[\"onValuesChange\"];\n brickInfo?: {\n type: \"brick\" | \"provider\" | \"template\";\n };\n emptyConfig?: EmptyProps;\n menuSettingClick?: () => void;\n hiddenPropsCategory?: boolean;\n childMountPointList?: string[];\n}\n\nexport function LegacyVisualPropertyForm(\n props: VisualPropertyFormProps,\n ref: React.Ref<visualFormUtils>\n): React.ReactElement {\n const theme = useCurrentTheme();\n const {\n projectId,\n labelIcon,\n propertyTypeList,\n brickProperties,\n brickInfo,\n emptyConfig,\n hiddenPropsCategory,\n menuSettingClick,\n childMountPointList,\n } = props;\n const [form] = Form.useForm();\n const [typeList, setTypeList] = useState<UnionPropertyType[]>(\n mergeProperties(propertyTypeList, brickProperties)\n );\n\n useImperativeHandle(ref, () => ({\n validateFields: form.validateFields,\n resetPropertyFields: (\n typeList: PropertyType[],\n properties: BrickProperties\n ) => {\n const restValue = mergeProperties(typeList, properties);\n setTypeList(restValue);\n form.resetFields();\n },\n getCurTypeList: (): UnionPropertyType[] => {\n return typeList?.map((item) => pick(item, [\"name\", \"type\", \"mode\"]));\n },\n }));\n\n useEffect(() => {\n const newTypeList = mergeProperties(propertyTypeList, brickProperties);\n setTypeList(newTypeList);\n\n const newValue = calculateValue(\n propertyTypeList,\n brickProperties,\n newTypeList\n );\n form.setFieldsValue(newValue);\n }, [propertyTypeList, brickProperties]);\n\n const handleLabelClick = (name: string): void => {\n const selected = typeList.find((item) => item.name === name);\n const index = typeList.findIndex((item) => item.name === name);\n const nextMode =\n selected.mode === ItemModeType.Advanced\n ? ItemModeType.Normal\n : ItemModeType.Advanced;\n\n let value = selected.value;\n if (nextMode === ItemModeType.Normal) {\n if (supportMenuType.includes(selected.type as string)) {\n value = matchNoramlMenuValue(value);\n }\n } else if (isNil(selected.value)) {\n value = \"\";\n } else {\n value = yamlStringify(selected.value);\n }\n form.setFieldsValue({\n [name]: value,\n });\n const newTypeList = update(typeList, {\n $splice: [[index, 1, { ...selected, mode: nextMode }]],\n });\n setTypeList(newTypeList);\n };\n\n const renderLabel = (\n item: UnionPropertyType,\n hideIcon?: boolean\n ): React.ReactElement => {\n return (\n <span>\n <Tooltip title={item.description}>{item.name}</Tooltip>{\" \"}\n {!hideIcon && labelIcon && (\n <span\n className={styles.iconContainer}\n onClick={() => handleLabelClick(item.name)}\n >\n <GeneralIcon\n icon={\n item.mode === ItemModeType.Advanced\n ? labelIcon?.advanced\n : labelIcon.normal\n }\n />\n </span>\n )}\n </span>\n );\n };\n\n const renderEditorItem = (\n item: UnionPropertyType,\n hideIcon?: boolean\n ): React.ReactElement => {\n return (\n <CodeEditorFormItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, hideIcon) as any}\n required={item.required === Required.True}\n theme={theme === \"dark-v2\" ? \"monokai\" : \"tomorrow\"}\n jsonSchema={item?.jsonSchema}\n schemaRef={item?.schemaRef}\n mode={item?.editor?.model || \"brick_next_yaml\"}\n />\n );\n };\n\n const renderStringItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Input />\n </Form.Item>\n );\n };\n\n const renderBooleanItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Switch />\n </Form.Item>\n );\n };\n\n const renderInputNumberItem = (\n item: UnionPropertyType\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <InputNumber />\n </Form.Item>\n );\n };\n\n const renderStringListItem = (\n item: UnionPropertyType\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Select mode=\"tags\" />\n </Form.Item>\n );\n };\n\n const renderIconItem = (item: UnionPropertyType): React.ReactElement => {\n return (\n <IconSelectFormItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, true) as any}\n required={item.required === Required.True}\n />\n );\n };\n\n const renderCodeEditorItem = (item: PropertyType): React.ReactElement => {\n return renderEditorItem(item, true);\n };\n\n const renderColorItem = (item: PropertyType): React.ReactElement => {\n return (\n <ColorEditorItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, true)}\n required={item.required === Required.True}\n />\n );\n };\n\n const renderMenuItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <MenuEditorItem\n projectId={projectId}\n key={item.name}\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n menuSettingClick={menuSettingClick}\n />\n );\n };\n\n const renderGeneralOptipns = (\n item: UnionPropertyType\n ): React.ReactElement => {\n const renderFormItem = (item: GeneralOptionProps): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"label\" label=\"label\">\n <Input defaultValue={item.label} />\n </Form.Item>\n <Form.Item name=\"value\" label=\"value\">\n <Input defaultValue={item.value} />\n </Form.Item>\n <Form.Item name=\"disabled\" label=\"disabled\">\n <Switch checked={item.disabled} />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"label\"\n renderFormItem={renderFormItem}\n getDefaultItem={(value: any) => ({\n label: value,\n value: value,\n })}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderCustomColumn = (item: UnionPropertyType): React.ReactElement => {\n const renderFormItem = (item: CustomColumn): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"dataIndex\" label=\"dataIndex\">\n <Input defaultValue={item.dataIndex} />\n </Form.Item>\n <Form.Item name=\"key\" label=\"key\">\n <Input defaultValue={item.key} />\n </Form.Item>\n <Form.Item name=\"title\" label=\"title\">\n <Input defaultValue={item.title} />\n </Form.Item>\n <Form.Item\n name=\"useChildren\"\n label=\"useChildren\"\n tooltip=\"useBrick代替用法,数据来源于子插槽名称,并且插槽名称必须使用'[]'包裹\"\n >\n <AutoComplete\n defaultValue={item.useChildren}\n dataSource={(childMountPointList ?? []).filter(\n (item) => item.startsWith(\"[\") && item.endsWith(\"]\")\n )}\n filterOption={(inputValue, option) =>\n option.props.children\n .toUpperCase()\n .indexOf(inputValue.toUpperCase()) !== -1\n }\n />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"title\"\n getDefaultItem={(value: any) => ({\n dataIndex: value,\n title: value,\n key: value,\n })}\n renderFormItem={renderFormItem}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderCustomButtons = (item: UnionPropertyType): React.ReactElement => {\n const renderFormItem = (item: CustomButtonProps): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"id\" label=\"id\">\n <Input defaultValue={item.id} />\n </Form.Item>\n <Form.Item name=\"text\" label=\"text\">\n <Input defaultValue={item.text} />\n </Form.Item>\n <Form.Item name=\"tooltip\" label=\"tooltip\">\n <Input defaultValue={item.tooltip} />\n </Form.Item>\n <Form.Item name=\"eventName\" label=\"eventName\">\n <Input defaultValue={item.eventName} />\n </Form.Item>\n <IconSelectFormItem name=\"icon\" label=\"icon\" />\n <Form.Item name=\"buttonType\" label=\"buttonType\">\n <Select defaultValue={item.buttonType}>\n {ButtonTypeEmun.map((item) => (\n <Select.Option key={item} value={item}>\n {item}\n </Select.Option>\n ))}\n </Select>\n </Form.Item>\n <Form.Item name=\"hide\" label=\"hide\">\n <Switch checked={item.hide} />\n </Form.Item>\n <Form.Item name=\"disabled\" label=\"disabled\">\n <Switch checked={item.disabled} />\n </Form.Item>\n <Form.Item name=\"isDivider\" label=\"isDivider\">\n <Switch checked={item.isDivider} />\n </Form.Item>\n <Form.Item name=\"isDropdown\" label=\"isDropdown\">\n <Switch checked={item.isDropdown} />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"text\"\n renderFormItem={renderFormItem}\n getDefaultItem={(value: any) => ({\n text: value,\n })}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderEnumItem = (\n item: UnionPropertyType,\n enumList: string[]\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Select\n options={enumList.map((item) => ({ label: item, value: item }))}\n />\n </Form.Item>\n );\n };\n\n const getFormItem = (item: PropertyType): React.ReactElement => {\n const type = item.type as string;\n // todo(sailor): update unit text\n if (/true|false/.test(type as string)) {\n return renderBooleanItem(item);\n }\n if ((type as string).indexOf(\"|\") > 0) {\n const emunList = (type as string).replace(/\"|'/g, \"\").split(\"|\");\n return renderEnumItem(item, emunList);\n }\n switch (item.type) {\n case \"string\":\n return renderStringItem(item);\n case \"string[]\":\n return renderStringListItem(item);\n case \"number\":\n return renderInputNumberItem(item);\n case \"boolean\":\n return renderBooleanItem(item);\n case \"MenuIcon\":\n return renderIconItem(item);\n case \"Color\":\n return renderColorItem(item);\n case \"Menu\":\n case \"SidebarSubMenu\":\n return renderMenuItem(item);\n // todo(sailor): update unit text\n case \"GeneralOption[]\":\n return renderGeneralOptipns(item);\n case \"CustomColumn[]\":\n return renderCustomColumn(item);\n case \"CustomButton[]\":\n return renderCustomButtons(item);\n default:\n return renderCodeEditorItem(item);\n }\n };\n\n const renderOthersItem = (): React.ReactElement => {\n return (\n <CodeEditorFormItem\n name={OTHER_FORM_ITEM_FIELD}\n label={\n brickInfo?.type === \"template\" ? \"other params\" : \"other properties\"\n }\n mode=\"brick_next_yaml\"\n maxLines={Infinity}\n />\n );\n };\n\n return isEmpty(typeList) ? (\n <Empty\n className={styles.empty}\n description={emptyConfig?.description}\n image={theme === \"dark-v2\" ? <DarkEmpty /> : Empty.PRESENTED_IMAGE_SIMPLE}\n imageStyle={emptyConfig?.imageStyle}\n />\n ) : (\n <Form\n name=\"propertyForm\"\n layout=\"horizontal\"\n labelAlign=\"left\"\n labelCol={{\n style: {\n minWidth: \"120px\",\n },\n }}\n form={form}\n onValuesChange={props.onValuesChange}\n initialValues={calculateValue(\n propertyTypeList,\n brickProperties,\n typeList\n )}\n >\n {!hiddenPropsCategory ? (\n <Collapse ghost defaultActiveKey=\"0\" className={styles.panelContainer}>\n {groupByType(typeList)?.map(([category, list], index) => {\n return (\n <Collapse.Panel\n header={upperFirst(category)}\n key={index}\n forceRender={true}\n >\n {list.map((item) => getFormItem(item))}\n </Collapse.Panel>\n );\n })}\n\n <Collapse.Panel\n className={styles.otherPanel}\n forceRender={true}\n header={upperFirst(OTHER_FORM_ITEM_FIELD)}\n key={OTHER_FORM_ITEM_FIELD}\n >\n {renderOthersItem()}\n </Collapse.Panel>\n </Collapse>\n ) : (\n <>\n {typeList?.map((item) => {\n return getFormItem(item);\n })}\n <div className={styles.otherPanel}>{renderOthersItem()}</div>\n </>\n )}\n </Form>\n );\n}\n\nexport const VisualPropertyForm = React.forwardRef(LegacyVisualPropertyForm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AAS,EAAE8B,iCAAM,CAACsE;EAAW,GAAEf,gBAAgB,EAAE,CAAO,CAEhE,CAEJ;AACH;AAEO,MAAMgB,kBAAkB,gBAAGC,cAAK,CAACC,UAAU,CAACpI,wBAAwB,CAAC;AAAC"}
1
+ {"version":3,"file":"VisualPropertyForm.js","names":["ButtonTypeEmun","LegacyVisualPropertyForm","props","ref","theme","useCurrentTheme","projectId","labelIcon","propertyTypeList","brickProperties","brickInfo","emptyConfig","hiddenPropsCategory","menuSettingClick","childMountPointList","form","Form","useForm","typeList","setTypeList","useState","mergeProperties","useImperativeHandle","validateFields","resetPropertyFields","properties","restValue","resetFields","getCurTypeList","map","item","pick","useEffect","newTypeList","newValue","calculateValue","setFieldsValue","handleLabelClick","name","selected","find","index","findIndex","nextMode","mode","ItemModeType","Advanced","Normal","value","supportMenuType","includes","type","matchNoramlMenuValue","isNil","yamlStringify","update","$splice","renderLabel","hideIcon","description","styles","iconContainer","advanced","normal","renderEditorItem","required","Required","True","jsonSchema","schemaRef","editor","model","renderStringItem","message","renderBooleanItem","renderInputNumberItem","renderStringListItem","renderIconItem","renderCodeEditorItem","renderColorItem","renderMenuItem","renderGeneralOptipns","renderFormItem","label","disabled","onValuesChange","renderCustomColumn","dataIndex","key","title","useChildren","filter","startsWith","endsWith","inputValue","option","children","toUpperCase","indexOf","renderCustomButtons","id","text","tooltip","eventName","buttonType","hide","isDivider","isDropdown","renderEnumItem","enumList","getFormItem","test","enums","emunList","replace","split","renderOthersItem","OTHER_FORM_ITEM_FIELD","Infinity","isEmpty","empty","Empty","PRESENTED_IMAGE_SIMPLE","imageStyle","visualPropertyForm","style","minWidth","panelContainer","groupByType","category","list","upperFirst","otherPanel","VisualPropertyForm","React","forwardRef"],"sources":["../../../src/visual-property-form/VisualPropertyForm.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useState } from \"react\";\nimport {\n Form,\n Input,\n InputNumber,\n Select,\n Tooltip,\n Collapse,\n Empty,\n Switch,\n AutoComplete,\n} from \"antd\";\nimport { EmptyProps } from \"antd/lib/empty\";\nimport { useCurrentTheme } from \"@next-core/brick-kit\";\nimport { MenuIcon } from \"@next-core/brick-types\";\nimport { GeneralIcon } from \"@next-libs/basic-components\";\nimport update from \"immutability-helper\";\nimport { isNil, pick, upperFirst, isEmpty } from \"lodash\";\nimport styles from \"./VisualPropertyForm.module.css\";\nimport { FormProps } from \"antd/lib/form\";\nimport { CodeEditorFormItem } from \"./components/CodeEditor/CodeEditorFormItem\";\nimport { IconSelectFormItem } from \"./components/IconSelect/IconSelectFormItem\";\nimport { ColorEditorItem } from \"./components/ColorEditor/ColorEditorItem\";\nimport { MenuEditorItem } from \"./components/MenuEditor/MenuEditorItem\";\nimport { ListEditor } from \"./components/ListEditor/ListEditor\";\nimport { ReactComponent as DarkEmpty } from \"./images/empty-dark.svg\";\nimport {\n mergeProperties,\n calculateValue,\n groupByType,\n yamlStringify,\n} from \"./processor\";\nimport { OTHER_FORM_ITEM_FIELD, supportMenuType } from \"./constant\";\nimport { matchNoramlMenuValue } from \"./processor\";\nimport {\n PropertyType,\n BrickProperties,\n visualFormUtils,\n ItemModeType,\n UnionPropertyType,\n Required,\n} from \"../interfaces\";\n\nconst ButtonTypeEmun = [\n \"link\",\n \"default\",\n \"primary\",\n \"ghost\",\n \"dashed\",\n \"icon\",\n \"text\",\n];\n\nexport type CustomColumn = {\n dataIndex: string;\n title: string;\n useChildren?: string;\n [k: string]: any;\n};\n\nexport type GeneralOptionProps = {\n label: string;\n value: string;\n disabled?: boolean;\n};\n\nexport type CustomButtonProps = {\n id: string;\n buttonType: string;\n eventName: string;\n text: string;\n tooltip: string;\n icon: MenuIcon;\n hide: boolean;\n disabled: boolean;\n isDivider: boolean;\n isDropdown: boolean;\n};\nexport interface VisualPropertyFormProps {\n projectId?: string;\n propertyTypeList: PropertyType[];\n labelIcon: {\n normal?: MenuIcon;\n advanced?: MenuIcon;\n };\n brickProperties: BrickProperties;\n onValuesChange?: FormProps[\"onValuesChange\"];\n brickInfo?: {\n type: \"brick\" | \"provider\" | \"template\";\n };\n emptyConfig?: EmptyProps;\n menuSettingClick?: () => void;\n hiddenPropsCategory?: boolean;\n childMountPointList?: string[];\n}\n\nexport function LegacyVisualPropertyForm(\n props: VisualPropertyFormProps,\n ref: React.Ref<visualFormUtils>\n): React.ReactElement {\n const theme = useCurrentTheme();\n const {\n projectId,\n labelIcon,\n propertyTypeList,\n brickProperties,\n brickInfo,\n emptyConfig,\n hiddenPropsCategory,\n menuSettingClick,\n childMountPointList,\n } = props;\n const [form] = Form.useForm();\n const [typeList, setTypeList] = useState<UnionPropertyType[]>(\n mergeProperties(propertyTypeList, brickProperties)\n );\n\n useImperativeHandle(ref, () => ({\n validateFields: form.validateFields,\n resetPropertyFields: (\n typeList: PropertyType[],\n properties: BrickProperties\n ) => {\n const restValue = mergeProperties(typeList, properties);\n setTypeList(restValue);\n form.resetFields();\n },\n getCurTypeList: (): UnionPropertyType[] => {\n return typeList?.map((item) => pick(item, [\"name\", \"type\", \"mode\"]));\n },\n }));\n\n useEffect(() => {\n const newTypeList = mergeProperties(propertyTypeList, brickProperties);\n setTypeList(newTypeList);\n\n const newValue = calculateValue(\n propertyTypeList,\n brickProperties,\n newTypeList\n );\n form.setFieldsValue(newValue);\n }, [propertyTypeList, brickProperties]);\n\n const handleLabelClick = (name: string): void => {\n const selected = typeList.find((item) => item.name === name);\n const index = typeList.findIndex((item) => item.name === name);\n const nextMode =\n selected.mode === ItemModeType.Advanced\n ? ItemModeType.Normal\n : ItemModeType.Advanced;\n\n let value = selected.value;\n if (nextMode === ItemModeType.Normal) {\n if (supportMenuType.includes(selected.type as string)) {\n value = matchNoramlMenuValue(value);\n }\n } else if (isNil(selected.value)) {\n value = \"\";\n } else {\n value = yamlStringify(selected.value);\n }\n form.setFieldsValue({\n [name]: value,\n });\n const newTypeList = update(typeList, {\n $splice: [[index, 1, { ...selected, mode: nextMode }]],\n });\n setTypeList(newTypeList);\n };\n\n const renderLabel = (\n item: UnionPropertyType,\n hideIcon?: boolean\n ): React.ReactElement => {\n return (\n <span>\n <Tooltip title={item.description}>{item.name}</Tooltip>{\" \"}\n {!hideIcon && labelIcon && (\n <span\n className={styles.iconContainer}\n onClick={() => handleLabelClick(item.name)}\n >\n <GeneralIcon\n icon={\n item.mode === ItemModeType.Advanced\n ? labelIcon?.advanced\n : labelIcon.normal\n }\n />\n </span>\n )}\n </span>\n );\n };\n\n const renderEditorItem = (\n item: UnionPropertyType,\n hideIcon?: boolean\n ): React.ReactElement => {\n return (\n <CodeEditorFormItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, hideIcon) as any}\n required={item.required === Required.True}\n theme={theme === \"dark-v2\" ? \"monokai\" : \"tomorrow\"}\n jsonSchema={item?.jsonSchema}\n schemaRef={item?.schemaRef}\n mode={item?.editor?.model || \"brick_next_yaml\"}\n />\n );\n };\n\n const renderStringItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Input />\n </Form.Item>\n );\n };\n\n const renderBooleanItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Switch />\n </Form.Item>\n );\n };\n\n const renderInputNumberItem = (\n item: UnionPropertyType\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <InputNumber />\n </Form.Item>\n );\n };\n\n const renderStringListItem = (\n item: UnionPropertyType\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Select mode=\"tags\" />\n </Form.Item>\n );\n };\n\n const renderIconItem = (item: UnionPropertyType): React.ReactElement => {\n return (\n <IconSelectFormItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, true) as any}\n required={item.required === Required.True}\n />\n );\n };\n\n const renderCodeEditorItem = (item: PropertyType): React.ReactElement => {\n return renderEditorItem(item, true);\n };\n\n const renderColorItem = (item: PropertyType): React.ReactElement => {\n return (\n <ColorEditorItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, true)}\n required={item.required === Required.True}\n />\n );\n };\n\n const renderMenuItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <MenuEditorItem\n projectId={projectId}\n key={item.name}\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n menuSettingClick={menuSettingClick}\n />\n );\n };\n\n const renderGeneralOptipns = (\n item: UnionPropertyType\n ): React.ReactElement => {\n const renderFormItem = (item: GeneralOptionProps): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"label\" label=\"label\">\n <Input defaultValue={item.label} />\n </Form.Item>\n <Form.Item name=\"value\" label=\"value\">\n <Input defaultValue={item.value} />\n </Form.Item>\n <Form.Item name=\"disabled\" label=\"disabled\">\n <Switch checked={item.disabled} />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"label\"\n renderFormItem={renderFormItem}\n getDefaultItem={(value: any) => ({\n label: value,\n value: value,\n })}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderCustomColumn = (item: UnionPropertyType): React.ReactElement => {\n const renderFormItem = (item: CustomColumn): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"dataIndex\" label=\"dataIndex\">\n <Input defaultValue={item.dataIndex} />\n </Form.Item>\n <Form.Item name=\"key\" label=\"key\">\n <Input defaultValue={item.key} />\n </Form.Item>\n <Form.Item name=\"title\" label=\"title\">\n <Input defaultValue={item.title} />\n </Form.Item>\n <Form.Item\n name=\"useChildren\"\n label=\"useChildren\"\n tooltip=\"useBrick代替用法,数据来源于子插槽名称,并且插槽名称必须使用'[]'包裹\"\n >\n <AutoComplete\n defaultValue={item.useChildren}\n dataSource={(childMountPointList ?? []).filter(\n (item) => item.startsWith(\"[\") && item.endsWith(\"]\")\n )}\n filterOption={(inputValue, option) =>\n option.props.children\n .toUpperCase()\n .indexOf(inputValue.toUpperCase()) !== -1\n }\n />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"title\"\n getDefaultItem={(value: any) => ({\n dataIndex: value,\n title: value,\n key: value,\n })}\n renderFormItem={renderFormItem}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderCustomButtons = (item: UnionPropertyType): React.ReactElement => {\n const renderFormItem = (item: CustomButtonProps): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"id\" label=\"id\">\n <Input defaultValue={item.id} />\n </Form.Item>\n <Form.Item name=\"text\" label=\"text\">\n <Input defaultValue={item.text} />\n </Form.Item>\n <Form.Item name=\"tooltip\" label=\"tooltip\">\n <Input defaultValue={item.tooltip} />\n </Form.Item>\n <Form.Item name=\"eventName\" label=\"eventName\">\n <Input defaultValue={item.eventName} />\n </Form.Item>\n <IconSelectFormItem name=\"icon\" label=\"icon\" />\n <Form.Item name=\"buttonType\" label=\"buttonType\">\n <Select defaultValue={item.buttonType}>\n {ButtonTypeEmun.map((item) => (\n <Select.Option key={item} value={item}>\n {item}\n </Select.Option>\n ))}\n </Select>\n </Form.Item>\n <Form.Item name=\"hide\" label=\"hide\">\n <Switch checked={item.hide} />\n </Form.Item>\n <Form.Item name=\"disabled\" label=\"disabled\">\n <Switch checked={item.disabled} />\n </Form.Item>\n <Form.Item name=\"isDivider\" label=\"isDivider\">\n <Switch checked={item.isDivider} />\n </Form.Item>\n <Form.Item name=\"isDropdown\" label=\"isDropdown\">\n <Switch checked={item.isDropdown} />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"text\"\n renderFormItem={renderFormItem}\n getDefaultItem={(value: any) => ({\n text: value,\n })}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderEnumItem = (\n item: UnionPropertyType,\n enumList: string[]\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Select\n options={enumList.map((item) => ({ label: item, value: item }))}\n />\n </Form.Item>\n );\n };\n\n const getFormItem = (item: PropertyType): React.ReactElement => {\n // todo(sailor): update unit text\n if (/true|false/.test(item.type as string)) {\n return renderBooleanItem(item);\n }\n if (item.enums) {\n const emunList = (item.enums as string).replace(/\"|'/g, \"\").split(\"|\");\n return renderEnumItem(item, emunList);\n }\n switch (item.type) {\n case \"string\":\n return renderStringItem(item);\n case \"string[]\":\n return renderStringListItem(item);\n case \"number\":\n return renderInputNumberItem(item);\n case \"boolean\":\n return renderBooleanItem(item);\n case \"MenuIcon\":\n return renderIconItem(item);\n case \"Color\":\n return renderColorItem(item);\n case \"Menu\":\n case \"SidebarSubMenu\":\n return renderMenuItem(item);\n // todo(sailor): update unit text\n case \"GeneralOption[]\":\n return renderGeneralOptipns(item);\n case \"CustomColumn[]\":\n return renderCustomColumn(item);\n case \"CustomButton[]\":\n return renderCustomButtons(item);\n default:\n return renderCodeEditorItem(item);\n }\n };\n\n const renderOthersItem = (): React.ReactElement => {\n return (\n <CodeEditorFormItem\n name={OTHER_FORM_ITEM_FIELD}\n label={\n brickInfo?.type === \"template\" ? \"other params\" : \"other properties\"\n }\n mode=\"brick_next_yaml\"\n maxLines={Infinity}\n />\n );\n };\n\n return isEmpty(typeList) ? (\n <Empty\n className={styles.empty}\n description={emptyConfig?.description}\n image={theme === \"dark-v2\" ? <DarkEmpty /> : Empty.PRESENTED_IMAGE_SIMPLE}\n imageStyle={emptyConfig?.imageStyle}\n />\n ) : (\n <Form\n className={styles.visualPropertyForm}\n name=\"propertyForm\"\n layout=\"horizontal\"\n labelAlign=\"right\"\n labelCol={{\n style: {\n minWidth: \"120px\",\n },\n }}\n form={form}\n onValuesChange={props.onValuesChange}\n initialValues={calculateValue(\n propertyTypeList,\n brickProperties,\n typeList\n )}\n >\n {!hiddenPropsCategory ? (\n <Collapse ghost defaultActiveKey=\"0\" className={styles.panelContainer}>\n {groupByType(typeList)?.map(([category, list], index) => {\n return (\n <Collapse.Panel\n header={upperFirst(category)}\n key={index}\n forceRender={true}\n >\n {list.map((item) => getFormItem(item))}\n </Collapse.Panel>\n );\n })}\n\n <Collapse.Panel\n className={styles.otherPanel}\n forceRender={true}\n header={upperFirst(OTHER_FORM_ITEM_FIELD)}\n key={OTHER_FORM_ITEM_FIELD}\n >\n {renderOthersItem()}\n </Collapse.Panel>\n </Collapse>\n ) : (\n <>\n {typeList?.map((item) => {\n return getFormItem(item);\n })}\n <div className={styles.otherPanel}>{renderOthersItem()}</div>\n </>\n )}\n </Form>\n );\n}\n\nexport const VisualPropertyForm = React.forwardRef(LegacyVisualPropertyForm);\n"],"mappings":";;;;;;;;;AAAA;AACA;AAYA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AAEA;AASA,MAAMA,cAAc,GAAG,CACrB,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,EACN,MAAM,CACP;AA6CM,SAASC,wBAAwB,CACtCC,KAA8B,EAC9BC,GAA+B,EACX;EAAA;EACpB,MAAMC,KAAK,GAAG,IAAAC,yBAAe,GAAE;EAC/B,MAAM;IACJC,SAAS;IACTC,SAAS;IACTC,gBAAgB;IAChBC,eAAe;IACfC,SAAS;IACTC,WAAW;IACXC,mBAAmB;IACnBC,gBAAgB;IAChBC;EACF,CAAC,GAAGZ,KAAK;EACT,MAAM,CAACa,IAAI,CAAC,GAAGC,UAAI,CAACC,OAAO,EAAE;EAC7B,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EACtC,IAAAC,0BAAe,EAACb,gBAAgB,EAAEC,eAAe,CAAC,CACnD;EAED,IAAAa,0BAAmB,EAACnB,GAAG,EAAE,OAAO;IAC9BoB,cAAc,EAAER,IAAI,CAACQ,cAAc;IACnCC,mBAAmB,EAAE,CACnBN,QAAwB,EACxBO,UAA2B,KACxB;MACH,MAAMC,SAAS,GAAG,IAAAL,0BAAe,EAACH,QAAQ,EAAEO,UAAU,CAAC;MACvDN,WAAW,CAACO,SAAS,CAAC;MACtBX,IAAI,CAACY,WAAW,EAAE;IACpB,CAAC;IACDC,cAAc,EAAE,MAA2B;MACzC,OAAOV,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEW,GAAG,CAAEC,IAAI,IAAK,IAAAC,YAAI,EAACD,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtE;EACF,CAAC,CAAC,CAAC;EAEH,IAA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AAC;EAC1B,CAAC,CAAC,eACF;IAAK,SAAS,EAAE8B,iCAAM,CAACwE;EAAW,GAAEhB,gBAAgB,EAAE,CAAO,CAEhE,CAEJ;AACH;AAEO,MAAMiB,kBAAkB,gBAAGC,cAAK,CAACC,UAAU,CAACtI,wBAAwB,CAAC;AAAC"}
@@ -114,16 +114,9 @@ function ListEditor({
114
114
  message: `请输入${name}`
115
115
  }]
116
116
  }, /*#__PURE__*/_react.default.createElement("div", {
117
- className: _ListEditorModule.default.listTitle
118
- }, /*#__PURE__*/_react.default.createElement("span", null, "List"), /*#__PURE__*/_react.default.createElement("span", {
119
- className: _ListEditorModule.default.listActionContainer
120
- }, /*#__PURE__*/_react.default.createElement("span", {
121
- onClick: () => {
122
- setList([]);
123
- onChange([]);
124
- }
125
- }, "Clear"), /*#__PURE__*/_react.default.createElement("span", {
126
- className: _ListEditorModule.default.listAddItem,
117
+ className: _ListEditorModule.default.listContent
118
+ }, renderListContent), /*#__PURE__*/_react.default.createElement("span", {
119
+ className: _ListEditorModule.default.addListItem,
127
120
  onClick: handleAddListItem
128
121
  }, /*#__PURE__*/_react.default.createElement(_basicComponents.GeneralIcon, {
129
122
  icon: {
@@ -135,8 +128,6 @@ function ListEditor({
135
128
  style: {
136
129
  marginRight: "4px"
137
130
  }
138
- }), "Add"))), /*#__PURE__*/_react.default.createElement("div", {
139
- className: _ListEditorModule.default.listContent
140
- }, renderListContent)));
131
+ }), "\u6DFB\u52A0")));
141
132
  }
142
133
  //# sourceMappingURL=ListEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListEditor.js","names":["COLUMN_KEY","Symbol","for","key","ListEditor","name","label","value","required","listItemKey","getDefaultItem","renderFormItem","onChange","list","setList","useState","map","item","handleRemoveItem","useCallback","e","stopPropagation","newList","filter","handleAddListItem","defaultValue","length","concat","renderListForm","handleOnValuesChange","changeValues","style","minWidth","renderListContent","useMemo","styles","listContent","index","zIndex","listItem","lib","category","icon","color","padding","border","borderRadius","listEmptyItem","listContainer","message","listTitle","listActionContainer","listAddItem","marginRight"],"sources":["../../../../../src/visual-property-form/components/ListEditor/ListEditor.tsx"],"sourcesContent":["import React, { useState, useCallback, useMemo } from \"react\";\nimport { GeneralIcon } from \"@next-libs/basic-components\";\nimport { Form, Popover } from \"antd\";\nimport styles from \"./ListEditor.module.css\";\n\nconst COLUMN_KEY = Symbol.for(\"column_key\");\n\ninterface ListEditor {\n name?: string;\n label?: string | React.ReactElement;\n value?: any[];\n required?: boolean;\n listItemKey: string;\n getDefaultItem: (data: any) => Record<string, any>;\n renderFormItem?: (data: any) => React.ReactElement;\n onChange?: (data: any) => void;\n}\n\nlet key = 0;\n\nexport function ListEditor({\n name,\n label,\n value,\n required,\n listItemKey,\n getDefaultItem,\n renderFormItem,\n onChange,\n}: ListEditor): React.ReactElement {\n const [list, setList] = useState<any[]>(\n (value ?? []).map((item) => ({\n ...item,\n [COLUMN_KEY]: ++key,\n }))\n );\n\n const handleRemoveItem = useCallback(\n (e: React.MouseEvent, item: any): void => {\n e.stopPropagation();\n const key = item[COLUMN_KEY];\n const newList = list.filter((item) => item[COLUMN_KEY] !== key);\n setList(newList);\n onChange(newList);\n },\n [list, onChange]\n );\n\n const handleAddListItem = (): void => {\n key++;\n const defaultValue = `newItem(${list.length})`;\n const newList = list.concat([\n { ...getDefaultItem(defaultValue), [COLUMN_KEY]: key },\n ]);\n setList(newList);\n onChange?.(newList);\n };\n\n const renderListForm = useCallback(\n (item: any): React.ReactElement => {\n const handleOnValuesChange = (changeValues: any): void => {\n const key = item[COLUMN_KEY];\n const newList = list.map((item) => {\n if (item[COLUMN_KEY] === key) {\n item = {\n ...item,\n ...changeValues,\n };\n }\n return item;\n });\n setList(newList);\n onChange?.(newList);\n };\n return (\n <Form\n layout=\"horizontal\"\n labelAlign=\"left\"\n labelCol={{\n style: {\n minWidth: \"112px\",\n },\n }}\n onValuesChange={handleOnValuesChange}\n >\n {renderFormItem(item)}\n </Form>\n );\n },\n [list, onChange, renderFormItem]\n );\n\n const renderListContent = useMemo((): React.ReactElement => {\n return (\n <div className={styles.listContent}>\n {list.length ? (\n list.map((item, index) => {\n return (\n <Popover\n key={index}\n overlayStyle={{\n zIndex: 999,\n }}\n content={renderListForm(item)}\n title=\"Detail\"\n trigger=\"click\"\n placement=\"left\"\n >\n <div className={styles.listItem}>\n <span>{item[listItemKey]}</span>\n <span onClick={(e) => handleRemoveItem(e, item)}>\n <GeneralIcon\n icon={{\n lib: \"easyops\",\n category: \"assets-inventory\",\n icon: \"out\",\n color: \"red\",\n }}\n style={{\n padding: \"2px\",\n border: \"1px solid\",\n borderRadius: \"50%\",\n }}\n />\n </span>\n </div>\n </Popover>\n );\n })\n ) : (\n <div className={styles.listEmptyItem}>No data</div>\n )}\n </div>\n );\n }, [list, renderListForm, listItemKey, handleRemoveItem]);\n\n return (\n <div className={styles.listContainer}>\n <Form.Item\n key={name}\n name={name}\n label={label}\n rules={[{ required: required, message: `请输入${name}` }]}\n >\n <div className={styles.listTitle}>\n <span>List</span>\n <span className={styles.listActionContainer}>\n <span\n onClick={() => {\n setList([]);\n onChange([]);\n }}\n >\n Clear\n </span>\n <span className={styles.listAddItem} onClick={handleAddListItem}>\n <GeneralIcon\n icon={{\n lib: \"easyops\",\n category: \"assets-inventory\",\n icon: \"xin\",\n color: \"blue\",\n }}\n style={{\n marginRight: \"4px\",\n }}\n />\n Add\n </span>\n </span>\n </div>\n <div className={styles.listContent}>{renderListContent}</div>\n </Form.Item>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AAEA,MAAMA,UAAU,GAAGC,MAAM,CAACC,GAAG,CAAC,YAAY,CAAC;AAa3C,IAAIC,GAAG,GAAG,CAAC;AAEJ,SAASC,UAAU,CAAC;EACzBC,IAAI;EACJC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,WAAW;EACXC,cAAc;EACdC,cAAc;EACdC;AACU,CAAC,EAAsB;EACjC,MAAM,CAACC,IAAI,EAAEC,OAAO,C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C,OAAO,EAAE,KAAK;UACdC,MAAM,EAAE,WAAW;UACnBC,YAAY,EAAE;QAChB;MAAE,EACF,CACG,CACH,CACE;IAEd,CAAC,CAAC,gBAEF;MAAK,SAAS,EAAEX,yBAAM,CAACY;IAAc,aACtC,CACG;EAEV,CAAC,EAAE,CAAClC,IAAI,EAAEe,cAAc,EAAEnB,WAAW,EAAES,gBAAgB,CAAC,CAAC;EAEzD,oBACE;IAAK,SAAS,EAAEiB,yBAAM,CAACa;EAAc,gBACnC,6BAAC,UAAI,CAAC,IAAI;IACR,GAAG,EAAE3C,IAAK;IACV,IAAI,EAAEA,IAAK;IACX,KAAK,EAAEC,KAAM;IACb,KAAK,EAAE,CAAC;MAAEE,QAAQ,EAAEA,QAAQ;MAAEyC,OAAO,EAAG,MAAK5C,IAAK;IAAE,CAAC;EAAE,gBAEvD;IAAK,SAAS,EAAE8B,yBAAM,CAACe;EAAU,gBAC/B,kDAAiB,eACjB;IAAM,SAAS,EAAEf,yBAAM,CAACgB;EAAoB,gBAC1C;IACE,OAAO,EAAE,MAAM;MACbrC,OAAO,CAAC,EAAE,CAAC;MACXF,QAAQ,CAAC,EAAE,CAAC;IACd;EAAE,WAGG,eACP;IAAM,SAAS,EAAEuB,yBAAM,CAACiB,WAAY;IAAC,OAAO,EAAE5B;EAAkB,gBAC9D,6BAAC,4BAAW;IACV,IAAI,EAAE;MACJgB,GAAG,EAAE,SAAS;MACdC,QAAQ,EAAE,kBAAkB;MAC5BC,IAAI,EAAE,KAAK;MACXC,KAAK,EAAE;IACT,CAAE;IACF,KAAK,EAAE;MACLU,WAAW,EAAE;IACf;EAAE,EACF,QAEG,CACF,CACH,eACN;IAAK,SAAS,EAAElB,yBAAM,CAACC;EAAY,GAAEH,iBAAiB,CAAO,CACnD,CACR;AAEV"}
1
+ {"version":3,"file":"ListEditor.js","names":["COLUMN_KEY","Symbol","for","key","ListEditor","name","label","value","required","listItemKey","getDefaultItem","renderFormItem","onChange","list","setList","useState","map","item","handleRemoveItem","useCallback","e","stopPropagation","newList","filter","handleAddListItem","defaultValue","length","concat","renderListForm","handleOnValuesChange","changeValues","style","minWidth","renderListContent","useMemo","styles","listContent","index","zIndex","listItem","lib","category","icon","color","padding","border","borderRadius","listEmptyItem","listContainer","message","addListItem","marginRight"],"sources":["../../../../../src/visual-property-form/components/ListEditor/ListEditor.tsx"],"sourcesContent":["import React, { useState, useCallback, useMemo } from \"react\";\nimport { GeneralIcon } from \"@next-libs/basic-components\";\nimport { Form, Popover } from \"antd\";\nimport styles from \"./ListEditor.module.css\";\n\nconst COLUMN_KEY = Symbol.for(\"column_key\");\n\ninterface ListEditor {\n name?: string;\n label?: string | React.ReactElement;\n value?: any[];\n required?: boolean;\n listItemKey: string;\n getDefaultItem: (data: any) => Record<string, any>;\n renderFormItem?: (data: any) => React.ReactElement;\n onChange?: (data: any) => void;\n}\n\nlet key = 0;\n\nexport function ListEditor({\n name,\n label,\n value,\n required,\n listItemKey,\n getDefaultItem,\n renderFormItem,\n onChange,\n}: ListEditor): React.ReactElement {\n const [list, setList] = useState<any[]>(\n (value ?? []).map((item) => ({\n ...item,\n [COLUMN_KEY]: ++key,\n }))\n );\n\n const handleRemoveItem = useCallback(\n (e: React.MouseEvent, item: any): void => {\n e.stopPropagation();\n const key = item[COLUMN_KEY];\n const newList = list.filter((item) => item[COLUMN_KEY] !== key);\n setList(newList);\n onChange(newList);\n },\n [list, onChange]\n );\n\n const handleAddListItem = (): void => {\n key++;\n const defaultValue = `newItem(${list.length})`;\n const newList = list.concat([\n { ...getDefaultItem(defaultValue), [COLUMN_KEY]: key },\n ]);\n setList(newList);\n onChange?.(newList);\n };\n\n const renderListForm = useCallback(\n (item: any): React.ReactElement => {\n const handleOnValuesChange = (changeValues: any): void => {\n const key = item[COLUMN_KEY];\n const newList = list.map((item) => {\n if (item[COLUMN_KEY] === key) {\n item = {\n ...item,\n ...changeValues,\n };\n }\n return item;\n });\n setList(newList);\n onChange?.(newList);\n };\n return (\n <Form\n layout=\"horizontal\"\n labelAlign=\"left\"\n labelCol={{\n style: {\n minWidth: \"112px\",\n },\n }}\n onValuesChange={handleOnValuesChange}\n >\n {renderFormItem(item)}\n </Form>\n );\n },\n [list, onChange, renderFormItem]\n );\n\n const renderListContent = useMemo((): React.ReactElement => {\n return (\n <div className={styles.listContent}>\n {list.length ? (\n list.map((item, index) => {\n return (\n <Popover\n key={index}\n overlayStyle={{\n zIndex: 999,\n }}\n content={renderListForm(item)}\n title=\"Detail\"\n trigger=\"click\"\n placement=\"left\"\n >\n <div className={styles.listItem}>\n <span>{item[listItemKey]}</span>\n <span onClick={(e) => handleRemoveItem(e, item)}>\n <GeneralIcon\n icon={{\n lib: \"easyops\",\n category: \"assets-inventory\",\n icon: \"out\",\n color: \"red\",\n }}\n style={{\n padding: \"2px\",\n border: \"1px solid\",\n borderRadius: \"50%\",\n }}\n />\n </span>\n </div>\n </Popover>\n );\n })\n ) : (\n <div className={styles.listEmptyItem}>No data</div>\n )}\n </div>\n );\n }, [list, renderListForm, listItemKey, handleRemoveItem]);\n\n return (\n <div className={styles.listContainer}>\n <Form.Item\n key={name}\n name={name}\n label={label}\n rules={[{ required: required, message: `请输入${name}` }]}\n >\n <div className={styles.listContent}>{renderListContent}</div>\n <span className={styles.addListItem} onClick={handleAddListItem}>\n <GeneralIcon\n icon={{\n lib: \"easyops\",\n category: \"assets-inventory\",\n icon: \"xin\",\n color: \"blue\",\n }}\n style={{\n marginRight: \"4px\",\n }}\n />\n 添加\n </span>\n </Form.Item>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AAEA,MAAMA,UAAU,GAAGC,MAAM,CAACC,GAAG,CAAC,YAAY,CAAC;AAa3C,IAAIC,GAAG,GAAG,CAAC;AAEJ,SAASC,UAAU,CAAC;EACzBC,IAAI;EACJC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,WAAW;EACXC,cAAc;EACdC,cAAc;EACdC;AACU,CAAC,EAAsB;EACjC,MAAM,CAAC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E;QACF,KAAK,EAAE;UACLC,OAAO,EAAE,KAAK;UACdC,MAAM,EAAE,WAAW;UACnBC,YAAY,EAAE;QAChB;MAAE,EACF,CACG,CACH,CACE;IAEd,CAAC,CAAC,gBAEF;MAAK,SAAS,EAAEX,yBAAM,CAACY;IAAc,aACtC,CACG;EAEV,CAAC,EAAE,CAAClC,IAAI,EAAEe,cAAc,EAAEnB,WAAW,EAAES,gBAAgB,CAAC,CAAC;EAEzD,oBACE;IAAK,SAAS,EAAEiB,yBAAM,CAACa;EAAc,gBACnC,6BAAC,UAAI,CAAC,IAAI;IACR,GAAG,EAAE3C,IAAK;IACV,IAAI,EAAEA,IAAK;IACX,KAAK,EAAEC,KAAM;IACb,KAAK,EAAE,CAAC;MAAEE,QAAQ,EAAEA,QAAQ;MAAEyC,OAAO,EAAG,MAAK5C,IAAK;IAAE,CAAC;EAAE,gBAEvD;IAAK,SAAS,EAAE8B,yBAAM,CAACC;EAAY,GAAEH,iBAAiB,CAAO,eAC7D;IAAM,SAAS,EAAEE,yBAAM,CAACe,WAAY;IAAC,OAAO,EAAE1B;EAAkB,gBAC9D,6BAAC,4BAAW;IACV,IAAI,EAAE;MACJgB,GAAG,EAAE,SAAS;MACdC,QAAQ,EAAE,kBAAkB;MAC5BC,IAAI,EAAE,KAAK;MACXC,KAAK,EAAE;IACT,CAAE;IACF,KAAK,EAAE;MACLQ,WAAW,EAAE;IACf;EAAE,EACF,iBAEG,CACG,CACR;AAEV"}
@@ -1 +1 @@
1
- {"version":3,"file":"brick-visualization.js","names":["Required","ItemModeType"],"sources":["../../../src/interfaces/brick-visualization.ts"],"sourcesContent":["import { FormInstance } from \"antd/lib/form\";\n\nexport type FormItemType =\n | boolean\n | string\n | string[]\n | number\n | Record<string, any>;\n\nexport enum Required {\n True = \"true\",\n False = \"false\",\n}\n\nexport enum ItemModeType {\n Normal = \"normal\",\n Advanced = \"advanced\",\n}\n\nexport interface PropertyType {\n type: FormItemType;\n name: string;\n editor?: {\n model?: string;\n };\n required?: Required;\n description?: string;\n default?: string;\n group?: string;\n groupI18N?: Record<string, { [language: string]: string }>;\n}\n\nexport interface UnionPropertyType extends PropertyType {\n mode?: ItemModeType;\n value?: any;\n jsonSchema?: Record<string, any>;\n schemaRef?: string;\n}\n\nexport type BrickProperties = Record<string, any>;\n\nexport interface visualFormUtils extends Partial<FormInstance> {\n resetPropertyFields: (\n typeList: PropertyType[],\n properties: BrickProperties\n ) => void;\n getCurTypeList: () => UnionPropertyType[];\n}\n"],"mappings":"AASA,WAAYA,QAAQ;AAGnB,WAHWA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,KAARA,QAAQ;AAKpB,WAAYC,YAAY;AAGvB,WAHWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY"}
1
+ {"version":3,"file":"brick-visualization.js","names":["Required","ItemModeType"],"sources":["../../../src/interfaces/brick-visualization.ts"],"sourcesContent":["import { FormInstance } from \"antd/lib/form\";\n\nexport type FormItemType =\n | boolean\n | string\n | string[]\n | number\n | Record<string, any>;\n\nexport enum Required {\n True = \"true\",\n False = \"false\",\n}\n\nexport enum ItemModeType {\n Normal = \"normal\",\n Advanced = \"advanced\",\n}\n\nexport interface PropertyType {\n type: FormItemType;\n name: string;\n editor?: {\n model?: string;\n };\n required?: Required;\n description?: string;\n default?: string;\n group?: string;\n groupI18N?: Record<string, { [language: string]: string }>;\n enums?: string;\n}\n\nexport interface UnionPropertyType extends PropertyType {\n mode?: ItemModeType;\n value?: any;\n jsonSchema?: Record<string, any>;\n schemaRef?: string;\n}\n\nexport type BrickProperties = Record<string, any>;\n\nexport interface visualFormUtils extends Partial<FormInstance> {\n resetPropertyFields: (\n typeList: PropertyType[],\n properties: BrickProperties\n ) => void;\n getCurTypeList: () => UnionPropertyType[];\n}\n"],"mappings":"AASA,WAAYA,QAAQ;AAGnB,WAHWA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,KAARA,QAAQ;AAKpB,WAAYC,YAAY;AAGvB,WAHWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY"}
@@ -347,13 +347,12 @@ export function LegacyVisualPropertyForm(props, ref) {
347
347
  }));
348
348
  };
349
349
  var getFormItem = item => {
350
- var type = item.type;
351
350
  // todo(sailor): update unit text
352
- if (/true|false/.test(type)) {
351
+ if (/true|false/.test(item.type)) {
353
352
  return renderBooleanItem(item);
354
353
  }
355
- if (type.indexOf("|") > 0) {
356
- var emunList = type.replace(/"|'/g, "").split("|");
354
+ if (item.enums) {
355
+ var emunList = item.enums.replace(/"|'/g, "").split("|");
357
356
  return renderEnumItem(item, emunList);
358
357
  }
359
358
  switch (item.type) {
@@ -397,9 +396,10 @@ export function LegacyVisualPropertyForm(props, ref) {
397
396
  image: theme === "dark-v2" ? /*#__PURE__*/React.createElement(DarkEmpty, null) : Empty.PRESENTED_IMAGE_SIMPLE,
398
397
  imageStyle: emptyConfig === null || emptyConfig === void 0 ? void 0 : emptyConfig.imageStyle
399
398
  }) : /*#__PURE__*/React.createElement(Form, {
399
+ className: styles.visualPropertyForm,
400
400
  name: "propertyForm",
401
401
  layout: "horizontal",
402
- labelAlign: "left",
402
+ labelAlign: "right",
403
403
  labelCol: {
404
404
  style: {
405
405
  minWidth: "120px"
@@ -1 +1 @@
1
- {"version":3,"file":"VisualPropertyForm.js","names":["React","useEffect","useImperativeHandle","useState","Form","Input","InputNumber","Select","Tooltip","Collapse","Empty","Switch","AutoComplete","useCurrentTheme","GeneralIcon","update","isNil","pick","upperFirst","isEmpty","styles","CodeEditorFormItem","IconSelectFormItem","ColorEditorItem","MenuEditorItem","ListEditor","ReactComponent","DarkEmpty","mergeProperties","calculateValue","groupByType","yamlStringify","OTHER_FORM_ITEM_FIELD","supportMenuType","matchNoramlMenuValue","ItemModeType","Required","ButtonTypeEmun","LegacyVisualPropertyForm","props","ref","theme","projectId","labelIcon","propertyTypeList","brickProperties","brickInfo","emptyConfig","hiddenPropsCategory","menuSettingClick","childMountPointList","form","useForm","typeList","setTypeList","validateFields","resetPropertyFields","properties","restValue","resetFields","getCurTypeList","map","item","newTypeList","newValue","setFieldsValue","handleLabelClick","name","selected","find","index","findIndex","nextMode","mode","Advanced","Normal","value","includes","type","$splice","renderLabel","hideIcon","description","iconContainer","advanced","normal","renderEditorItem","required","True","jsonSchema","schemaRef","editor","model","renderStringItem","message","renderBooleanItem","renderInputNumberItem","renderStringListItem","renderIconItem","renderCodeEditorItem","renderColorItem","renderMenuItem","renderGeneralOptipns","renderFormItem","label","disabled","onValuesChange","renderCustomColumn","dataIndex","key","title","useChildren","filter","startsWith","endsWith","inputValue","option","children","toUpperCase","indexOf","renderCustomButtons","id","text","tooltip","eventName","buttonType","hide","isDivider","isDropdown","renderEnumItem","enumList","getFormItem","test","emunList","replace","split","renderOthersItem","Infinity","empty","PRESENTED_IMAGE_SIMPLE","imageStyle","style","minWidth","panelContainer","category","list","otherPanel","VisualPropertyForm","forwardRef"],"sources":["../../../src/visual-property-form/VisualPropertyForm.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useState } from \"react\";\nimport {\n Form,\n Input,\n InputNumber,\n Select,\n Tooltip,\n Collapse,\n Empty,\n Switch,\n AutoComplete,\n} from \"antd\";\nimport { EmptyProps } from \"antd/lib/empty\";\nimport { useCurrentTheme } from \"@next-core/brick-kit\";\nimport { MenuIcon } from \"@next-core/brick-types\";\nimport { GeneralIcon } from \"@next-libs/basic-components\";\nimport update from \"immutability-helper\";\nimport { isNil, pick, upperFirst, isEmpty } from \"lodash\";\nimport styles from \"./VisualPropertyForm.module.css\";\nimport { FormProps } from \"antd/lib/form\";\nimport { CodeEditorFormItem } from \"./components/CodeEditor/CodeEditorFormItem\";\nimport { IconSelectFormItem } from \"./components/IconSelect/IconSelectFormItem\";\nimport { ColorEditorItem } from \"./components/ColorEditor/ColorEditorItem\";\nimport { MenuEditorItem } from \"./components/MenuEditor/MenuEditorItem\";\nimport { ListEditor } from \"./components/ListEditor/ListEditor\";\nimport { ReactComponent as DarkEmpty } from \"./images/empty-dark.svg\";\nimport {\n mergeProperties,\n calculateValue,\n groupByType,\n yamlStringify,\n} from \"./processor\";\nimport { OTHER_FORM_ITEM_FIELD, supportMenuType } from \"./constant\";\nimport { matchNoramlMenuValue } from \"./processor\";\nimport {\n PropertyType,\n BrickProperties,\n visualFormUtils,\n ItemModeType,\n UnionPropertyType,\n Required,\n} from \"../interfaces\";\n\nconst ButtonTypeEmun = [\n \"link\",\n \"default\",\n \"primary\",\n \"ghost\",\n \"dashed\",\n \"icon\",\n \"text\",\n];\n\nexport type CustomColumn = {\n dataIndex: string;\n title: string;\n useChildren?: string;\n [k: string]: any;\n};\n\nexport type GeneralOptionProps = {\n label: string;\n value: string;\n disabled?: boolean;\n};\n\nexport type CustomButtonProps = {\n id: string;\n buttonType: string;\n eventName: string;\n text: string;\n tooltip: string;\n icon: MenuIcon;\n hide: boolean;\n disabled: boolean;\n isDivider: boolean;\n isDropdown: boolean;\n};\nexport interface VisualPropertyFormProps {\n projectId?: string;\n propertyTypeList: PropertyType[];\n labelIcon: {\n normal?: MenuIcon;\n advanced?: MenuIcon;\n };\n brickProperties: BrickProperties;\n onValuesChange?: FormProps[\"onValuesChange\"];\n brickInfo?: {\n type: \"brick\" | \"provider\" | \"template\";\n };\n emptyConfig?: EmptyProps;\n menuSettingClick?: () => void;\n hiddenPropsCategory?: boolean;\n childMountPointList?: string[];\n}\n\nexport function LegacyVisualPropertyForm(\n props: VisualPropertyFormProps,\n ref: React.Ref<visualFormUtils>\n): React.ReactElement {\n const theme = useCurrentTheme();\n const {\n projectId,\n labelIcon,\n propertyTypeList,\n brickProperties,\n brickInfo,\n emptyConfig,\n hiddenPropsCategory,\n menuSettingClick,\n childMountPointList,\n } = props;\n const [form] = Form.useForm();\n const [typeList, setTypeList] = useState<UnionPropertyType[]>(\n mergeProperties(propertyTypeList, brickProperties)\n );\n\n useImperativeHandle(ref, () => ({\n validateFields: form.validateFields,\n resetPropertyFields: (\n typeList: PropertyType[],\n properties: BrickProperties\n ) => {\n const restValue = mergeProperties(typeList, properties);\n setTypeList(restValue);\n form.resetFields();\n },\n getCurTypeList: (): UnionPropertyType[] => {\n return typeList?.map((item) => pick(item, [\"name\", \"type\", \"mode\"]));\n },\n }));\n\n useEffect(() => {\n const newTypeList = mergeProperties(propertyTypeList, brickProperties);\n setTypeList(newTypeList);\n\n const newValue = calculateValue(\n propertyTypeList,\n brickProperties,\n newTypeList\n );\n form.setFieldsValue(newValue);\n }, [propertyTypeList, brickProperties]);\n\n const handleLabelClick = (name: string): void => {\n const selected = typeList.find((item) => item.name === name);\n const index = typeList.findIndex((item) => item.name === name);\n const nextMode =\n selected.mode === ItemModeType.Advanced\n ? ItemModeType.Normal\n : ItemModeType.Advanced;\n\n let value = selected.value;\n if (nextMode === ItemModeType.Normal) {\n if (supportMenuType.includes(selected.type as string)) {\n value = matchNoramlMenuValue(value);\n }\n } else if (isNil(selected.value)) {\n value = \"\";\n } else {\n value = yamlStringify(selected.value);\n }\n form.setFieldsValue({\n [name]: value,\n });\n const newTypeList = update(typeList, {\n $splice: [[index, 1, { ...selected, mode: nextMode }]],\n });\n setTypeList(newTypeList);\n };\n\n const renderLabel = (\n item: UnionPropertyType,\n hideIcon?: boolean\n ): React.ReactElement => {\n return (\n <span>\n <Tooltip title={item.description}>{item.name}</Tooltip>{\" \"}\n {!hideIcon && labelIcon && (\n <span\n className={styles.iconContainer}\n onClick={() => handleLabelClick(item.name)}\n >\n <GeneralIcon\n icon={\n item.mode === ItemModeType.Advanced\n ? labelIcon?.advanced\n : labelIcon.normal\n }\n />\n </span>\n )}\n </span>\n );\n };\n\n const renderEditorItem = (\n item: UnionPropertyType,\n hideIcon?: boolean\n ): React.ReactElement => {\n return (\n <CodeEditorFormItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, hideIcon) as any}\n required={item.required === Required.True}\n theme={theme === \"dark-v2\" ? \"monokai\" : \"tomorrow\"}\n jsonSchema={item?.jsonSchema}\n schemaRef={item?.schemaRef}\n mode={item?.editor?.model || \"brick_next_yaml\"}\n />\n );\n };\n\n const renderStringItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Input />\n </Form.Item>\n );\n };\n\n const renderBooleanItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Switch />\n </Form.Item>\n );\n };\n\n const renderInputNumberItem = (\n item: UnionPropertyType\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <InputNumber />\n </Form.Item>\n );\n };\n\n const renderStringListItem = (\n item: UnionPropertyType\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Select mode=\"tags\" />\n </Form.Item>\n );\n };\n\n const renderIconItem = (item: UnionPropertyType): React.ReactElement => {\n return (\n <IconSelectFormItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, true) as any}\n required={item.required === Required.True}\n />\n );\n };\n\n const renderCodeEditorItem = (item: PropertyType): React.ReactElement => {\n return renderEditorItem(item, true);\n };\n\n const renderColorItem = (item: PropertyType): React.ReactElement => {\n return (\n <ColorEditorItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, true)}\n required={item.required === Required.True}\n />\n );\n };\n\n const renderMenuItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <MenuEditorItem\n projectId={projectId}\n key={item.name}\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n menuSettingClick={menuSettingClick}\n />\n );\n };\n\n const renderGeneralOptipns = (\n item: UnionPropertyType\n ): React.ReactElement => {\n const renderFormItem = (item: GeneralOptionProps): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"label\" label=\"label\">\n <Input defaultValue={item.label} />\n </Form.Item>\n <Form.Item name=\"value\" label=\"value\">\n <Input defaultValue={item.value} />\n </Form.Item>\n <Form.Item name=\"disabled\" label=\"disabled\">\n <Switch checked={item.disabled} />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"label\"\n renderFormItem={renderFormItem}\n getDefaultItem={(value: any) => ({\n label: value,\n value: value,\n })}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderCustomColumn = (item: UnionPropertyType): React.ReactElement => {\n const renderFormItem = (item: CustomColumn): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"dataIndex\" label=\"dataIndex\">\n <Input defaultValue={item.dataIndex} />\n </Form.Item>\n <Form.Item name=\"key\" label=\"key\">\n <Input defaultValue={item.key} />\n </Form.Item>\n <Form.Item name=\"title\" label=\"title\">\n <Input defaultValue={item.title} />\n </Form.Item>\n <Form.Item\n name=\"useChildren\"\n label=\"useChildren\"\n tooltip=\"useBrick代替用法,数据来源于子插槽名称,并且插槽名称必须使用'[]'包裹\"\n >\n <AutoComplete\n defaultValue={item.useChildren}\n dataSource={(childMountPointList ?? []).filter(\n (item) => item.startsWith(\"[\") && item.endsWith(\"]\")\n )}\n filterOption={(inputValue, option) =>\n option.props.children\n .toUpperCase()\n .indexOf(inputValue.toUpperCase()) !== -1\n }\n />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"title\"\n getDefaultItem={(value: any) => ({\n dataIndex: value,\n title: value,\n key: value,\n })}\n renderFormItem={renderFormItem}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderCustomButtons = (item: UnionPropertyType): React.ReactElement => {\n const renderFormItem = (item: CustomButtonProps): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"id\" label=\"id\">\n <Input defaultValue={item.id} />\n </Form.Item>\n <Form.Item name=\"text\" label=\"text\">\n <Input defaultValue={item.text} />\n </Form.Item>\n <Form.Item name=\"tooltip\" label=\"tooltip\">\n <Input defaultValue={item.tooltip} />\n </Form.Item>\n <Form.Item name=\"eventName\" label=\"eventName\">\n <Input defaultValue={item.eventName} />\n </Form.Item>\n <IconSelectFormItem name=\"icon\" label=\"icon\" />\n <Form.Item name=\"buttonType\" label=\"buttonType\">\n <Select defaultValue={item.buttonType}>\n {ButtonTypeEmun.map((item) => (\n <Select.Option key={item} value={item}>\n {item}\n </Select.Option>\n ))}\n </Select>\n </Form.Item>\n <Form.Item name=\"hide\" label=\"hide\">\n <Switch checked={item.hide} />\n </Form.Item>\n <Form.Item name=\"disabled\" label=\"disabled\">\n <Switch checked={item.disabled} />\n </Form.Item>\n <Form.Item name=\"isDivider\" label=\"isDivider\">\n <Switch checked={item.isDivider} />\n </Form.Item>\n <Form.Item name=\"isDropdown\" label=\"isDropdown\">\n <Switch checked={item.isDropdown} />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"text\"\n renderFormItem={renderFormItem}\n getDefaultItem={(value: any) => ({\n text: value,\n })}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderEnumItem = (\n item: UnionPropertyType,\n enumList: string[]\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Select\n options={enumList.map((item) => ({ label: item, value: item }))}\n />\n </Form.Item>\n );\n };\n\n const getFormItem = (item: PropertyType): React.ReactElement => {\n const type = item.type as string;\n // todo(sailor): update unit text\n if (/true|false/.test(type as string)) {\n return renderBooleanItem(item);\n }\n if ((type as string).indexOf(\"|\") > 0) {\n const emunList = (type as string).replace(/\"|'/g, \"\").split(\"|\");\n return renderEnumItem(item, emunList);\n }\n switch (item.type) {\n case \"string\":\n return renderStringItem(item);\n case \"string[]\":\n return renderStringListItem(item);\n case \"number\":\n return renderInputNumberItem(item);\n case \"boolean\":\n return renderBooleanItem(item);\n case \"MenuIcon\":\n return renderIconItem(item);\n case \"Color\":\n return renderColorItem(item);\n case \"Menu\":\n case \"SidebarSubMenu\":\n return renderMenuItem(item);\n // todo(sailor): update unit text\n case \"GeneralOption[]\":\n return renderGeneralOptipns(item);\n case \"CustomColumn[]\":\n return renderCustomColumn(item);\n case \"CustomButton[]\":\n return renderCustomButtons(item);\n default:\n return renderCodeEditorItem(item);\n }\n };\n\n const renderOthersItem = (): React.ReactElement => {\n return (\n <CodeEditorFormItem\n name={OTHER_FORM_ITEM_FIELD}\n label={\n brickInfo?.type === \"template\" ? \"other params\" : \"other properties\"\n }\n mode=\"brick_next_yaml\"\n maxLines={Infinity}\n />\n );\n };\n\n return isEmpty(typeList) ? (\n <Empty\n className={styles.empty}\n description={emptyConfig?.description}\n image={theme === \"dark-v2\" ? <DarkEmpty /> : Empty.PRESENTED_IMAGE_SIMPLE}\n imageStyle={emptyConfig?.imageStyle}\n />\n ) : (\n <Form\n name=\"propertyForm\"\n layout=\"horizontal\"\n labelAlign=\"left\"\n labelCol={{\n style: {\n minWidth: \"120px\",\n },\n }}\n form={form}\n onValuesChange={props.onValuesChange}\n initialValues={calculateValue(\n propertyTypeList,\n brickProperties,\n typeList\n )}\n >\n {!hiddenPropsCategory ? (\n <Collapse ghost defaultActiveKey=\"0\" className={styles.panelContainer}>\n {groupByType(typeList)?.map(([category, list], index) => {\n return (\n <Collapse.Panel\n header={upperFirst(category)}\n key={index}\n forceRender={true}\n >\n {list.map((item) => getFormItem(item))}\n </Collapse.Panel>\n );\n })}\n\n <Collapse.Panel\n className={styles.otherPanel}\n forceRender={true}\n header={upperFirst(OTHER_FORM_ITEM_FIELD)}\n key={OTHER_FORM_ITEM_FIELD}\n >\n {renderOthersItem()}\n </Collapse.Panel>\n </Collapse>\n ) : (\n <>\n {typeList?.map((item) => {\n return getFormItem(item);\n })}\n <div className={styles.otherPanel}>{renderOthersItem()}</div>\n </>\n )}\n </Form>\n );\n}\n\nexport const VisualPropertyForm = React.forwardRef(LegacyVisualPropertyForm);\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,mBAAmB,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SACEC,IAAI,EACJC,KAAK,EACLC,WAAW,EACXC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,KAAK,EACLC,MAAM,EACNC,YAAY,QACP,MAAM;AAEb,SAASC,eAAe,QAAQ,sBAAsB;AAEtD,SAASC,WAAW,QAAQ,6BAA6B;AACzD,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,KAAK,EAAEC,IAAI,EAAEC,UAAU,EAAEC,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,GAE1BwG,gBAAgB,EAAE,CACJ,CACR,gBAEX,0CACGnF,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEQ,GAAG,CAAEC,IAAI,IAAK;IACvB,OAAOqE,WAAW,CAACrE,IAAI,CAAC;EAC1B,CAAC,CAAC,eACF;IAAK,SAAS,EAAE1C,MAAM,CAAC8H;EAAW,GAAEV,gBAAgB,EAAE,CAAO,CAEhE,CAEJ;AACH;AAEA,OAAO,IAAMW,kBAAkB,gBAAGnJ,KAAK,CAACoJ,UAAU,CAAC9G,wBAAwB,CAAC"}
1
+ {"version":3,"file":"VisualPropertyForm.js","names":["React","useEffect","useImperativeHandle","useState","Form","Input","InputNumber","Select","Tooltip","Collapse","Empty","Switch","AutoComplete","useCurrentTheme","GeneralIcon","update","isNil","pick","upperFirst","isEmpty","styles","CodeEditorFormItem","IconSelectFormItem","ColorEditorItem","MenuEditorItem","ListEditor","ReactComponent","DarkEmpty","mergeProperties","calculateValue","groupByType","yamlStringify","OTHER_FORM_ITEM_FIELD","supportMenuType","matchNoramlMenuValue","ItemModeType","Required","ButtonTypeEmun","LegacyVisualPropertyForm","props","ref","theme","projectId","labelIcon","propertyTypeList","brickProperties","brickInfo","emptyConfig","hiddenPropsCategory","menuSettingClick","childMountPointList","form","useForm","typeList","setTypeList","validateFields","resetPropertyFields","properties","restValue","resetFields","getCurTypeList","map","item","newTypeList","newValue","setFieldsValue","handleLabelClick","name","selected","find","index","findIndex","nextMode","mode","Advanced","Normal","value","includes","type","$splice","renderLabel","hideIcon","description","iconContainer","advanced","normal","renderEditorItem","required","True","jsonSchema","schemaRef","editor","model","renderStringItem","message","renderBooleanItem","renderInputNumberItem","renderStringListItem","renderIconItem","renderCodeEditorItem","renderColorItem","renderMenuItem","renderGeneralOptipns","renderFormItem","label","disabled","onValuesChange","renderCustomColumn","dataIndex","key","title","useChildren","filter","startsWith","endsWith","inputValue","option","children","toUpperCase","indexOf","renderCustomButtons","id","text","tooltip","eventName","buttonType","hide","isDivider","isDropdown","renderEnumItem","enumList","getFormItem","test","enums","emunList","replace","split","renderOthersItem","Infinity","empty","PRESENTED_IMAGE_SIMPLE","imageStyle","visualPropertyForm","style","minWidth","panelContainer","category","list","otherPanel","VisualPropertyForm","forwardRef"],"sources":["../../../src/visual-property-form/VisualPropertyForm.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useState } from \"react\";\nimport {\n Form,\n Input,\n InputNumber,\n Select,\n Tooltip,\n Collapse,\n Empty,\n Switch,\n AutoComplete,\n} from \"antd\";\nimport { EmptyProps } from \"antd/lib/empty\";\nimport { useCurrentTheme } from \"@next-core/brick-kit\";\nimport { MenuIcon } from \"@next-core/brick-types\";\nimport { GeneralIcon } from \"@next-libs/basic-components\";\nimport update from \"immutability-helper\";\nimport { isNil, pick, upperFirst, isEmpty } from \"lodash\";\nimport styles from \"./VisualPropertyForm.module.css\";\nimport { FormProps } from \"antd/lib/form\";\nimport { CodeEditorFormItem } from \"./components/CodeEditor/CodeEditorFormItem\";\nimport { IconSelectFormItem } from \"./components/IconSelect/IconSelectFormItem\";\nimport { ColorEditorItem } from \"./components/ColorEditor/ColorEditorItem\";\nimport { MenuEditorItem } from \"./components/MenuEditor/MenuEditorItem\";\nimport { ListEditor } from \"./components/ListEditor/ListEditor\";\nimport { ReactComponent as DarkEmpty } from \"./images/empty-dark.svg\";\nimport {\n mergeProperties,\n calculateValue,\n groupByType,\n yamlStringify,\n} from \"./processor\";\nimport { OTHER_FORM_ITEM_FIELD, supportMenuType } from \"./constant\";\nimport { matchNoramlMenuValue } from \"./processor\";\nimport {\n PropertyType,\n BrickProperties,\n visualFormUtils,\n ItemModeType,\n UnionPropertyType,\n Required,\n} from \"../interfaces\";\n\nconst ButtonTypeEmun = [\n \"link\",\n \"default\",\n \"primary\",\n \"ghost\",\n \"dashed\",\n \"icon\",\n \"text\",\n];\n\nexport type CustomColumn = {\n dataIndex: string;\n title: string;\n useChildren?: string;\n [k: string]: any;\n};\n\nexport type GeneralOptionProps = {\n label: string;\n value: string;\n disabled?: boolean;\n};\n\nexport type CustomButtonProps = {\n id: string;\n buttonType: string;\n eventName: string;\n text: string;\n tooltip: string;\n icon: MenuIcon;\n hide: boolean;\n disabled: boolean;\n isDivider: boolean;\n isDropdown: boolean;\n};\nexport interface VisualPropertyFormProps {\n projectId?: string;\n propertyTypeList: PropertyType[];\n labelIcon: {\n normal?: MenuIcon;\n advanced?: MenuIcon;\n };\n brickProperties: BrickProperties;\n onValuesChange?: FormProps[\"onValuesChange\"];\n brickInfo?: {\n type: \"brick\" | \"provider\" | \"template\";\n };\n emptyConfig?: EmptyProps;\n menuSettingClick?: () => void;\n hiddenPropsCategory?: boolean;\n childMountPointList?: string[];\n}\n\nexport function LegacyVisualPropertyForm(\n props: VisualPropertyFormProps,\n ref: React.Ref<visualFormUtils>\n): React.ReactElement {\n const theme = useCurrentTheme();\n const {\n projectId,\n labelIcon,\n propertyTypeList,\n brickProperties,\n brickInfo,\n emptyConfig,\n hiddenPropsCategory,\n menuSettingClick,\n childMountPointList,\n } = props;\n const [form] = Form.useForm();\n const [typeList, setTypeList] = useState<UnionPropertyType[]>(\n mergeProperties(propertyTypeList, brickProperties)\n );\n\n useImperativeHandle(ref, () => ({\n validateFields: form.validateFields,\n resetPropertyFields: (\n typeList: PropertyType[],\n properties: BrickProperties\n ) => {\n const restValue = mergeProperties(typeList, properties);\n setTypeList(restValue);\n form.resetFields();\n },\n getCurTypeList: (): UnionPropertyType[] => {\n return typeList?.map((item) => pick(item, [\"name\", \"type\", \"mode\"]));\n },\n }));\n\n useEffect(() => {\n const newTypeList = mergeProperties(propertyTypeList, brickProperties);\n setTypeList(newTypeList);\n\n const newValue = calculateValue(\n propertyTypeList,\n brickProperties,\n newTypeList\n );\n form.setFieldsValue(newValue);\n }, [propertyTypeList, brickProperties]);\n\n const handleLabelClick = (name: string): void => {\n const selected = typeList.find((item) => item.name === name);\n const index = typeList.findIndex((item) => item.name === name);\n const nextMode =\n selected.mode === ItemModeType.Advanced\n ? ItemModeType.Normal\n : ItemModeType.Advanced;\n\n let value = selected.value;\n if (nextMode === ItemModeType.Normal) {\n if (supportMenuType.includes(selected.type as string)) {\n value = matchNoramlMenuValue(value);\n }\n } else if (isNil(selected.value)) {\n value = \"\";\n } else {\n value = yamlStringify(selected.value);\n }\n form.setFieldsValue({\n [name]: value,\n });\n const newTypeList = update(typeList, {\n $splice: [[index, 1, { ...selected, mode: nextMode }]],\n });\n setTypeList(newTypeList);\n };\n\n const renderLabel = (\n item: UnionPropertyType,\n hideIcon?: boolean\n ): React.ReactElement => {\n return (\n <span>\n <Tooltip title={item.description}>{item.name}</Tooltip>{\" \"}\n {!hideIcon && labelIcon && (\n <span\n className={styles.iconContainer}\n onClick={() => handleLabelClick(item.name)}\n >\n <GeneralIcon\n icon={\n item.mode === ItemModeType.Advanced\n ? labelIcon?.advanced\n : labelIcon.normal\n }\n />\n </span>\n )}\n </span>\n );\n };\n\n const renderEditorItem = (\n item: UnionPropertyType,\n hideIcon?: boolean\n ): React.ReactElement => {\n return (\n <CodeEditorFormItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, hideIcon) as any}\n required={item.required === Required.True}\n theme={theme === \"dark-v2\" ? \"monokai\" : \"tomorrow\"}\n jsonSchema={item?.jsonSchema}\n schemaRef={item?.schemaRef}\n mode={item?.editor?.model || \"brick_next_yaml\"}\n />\n );\n };\n\n const renderStringItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Input />\n </Form.Item>\n );\n };\n\n const renderBooleanItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Switch />\n </Form.Item>\n );\n };\n\n const renderInputNumberItem = (\n item: UnionPropertyType\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <InputNumber />\n </Form.Item>\n );\n };\n\n const renderStringListItem = (\n item: UnionPropertyType\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Select mode=\"tags\" />\n </Form.Item>\n );\n };\n\n const renderIconItem = (item: UnionPropertyType): React.ReactElement => {\n return (\n <IconSelectFormItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, true) as any}\n required={item.required === Required.True}\n />\n );\n };\n\n const renderCodeEditorItem = (item: PropertyType): React.ReactElement => {\n return renderEditorItem(item, true);\n };\n\n const renderColorItem = (item: PropertyType): React.ReactElement => {\n return (\n <ColorEditorItem\n key={item.name}\n name={item.name}\n label={renderLabel(item, true)}\n required={item.required === Required.True}\n />\n );\n };\n\n const renderMenuItem = (item: UnionPropertyType): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <MenuEditorItem\n projectId={projectId}\n key={item.name}\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n menuSettingClick={menuSettingClick}\n />\n );\n };\n\n const renderGeneralOptipns = (\n item: UnionPropertyType\n ): React.ReactElement => {\n const renderFormItem = (item: GeneralOptionProps): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"label\" label=\"label\">\n <Input defaultValue={item.label} />\n </Form.Item>\n <Form.Item name=\"value\" label=\"value\">\n <Input defaultValue={item.value} />\n </Form.Item>\n <Form.Item name=\"disabled\" label=\"disabled\">\n <Switch checked={item.disabled} />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"label\"\n renderFormItem={renderFormItem}\n getDefaultItem={(value: any) => ({\n label: value,\n value: value,\n })}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderCustomColumn = (item: UnionPropertyType): React.ReactElement => {\n const renderFormItem = (item: CustomColumn): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"dataIndex\" label=\"dataIndex\">\n <Input defaultValue={item.dataIndex} />\n </Form.Item>\n <Form.Item name=\"key\" label=\"key\">\n <Input defaultValue={item.key} />\n </Form.Item>\n <Form.Item name=\"title\" label=\"title\">\n <Input defaultValue={item.title} />\n </Form.Item>\n <Form.Item\n name=\"useChildren\"\n label=\"useChildren\"\n tooltip=\"useBrick代替用法,数据来源于子插槽名称,并且插槽名称必须使用'[]'包裹\"\n >\n <AutoComplete\n defaultValue={item.useChildren}\n dataSource={(childMountPointList ?? []).filter(\n (item) => item.startsWith(\"[\") && item.endsWith(\"]\")\n )}\n filterOption={(inputValue, option) =>\n option.props.children\n .toUpperCase()\n .indexOf(inputValue.toUpperCase()) !== -1\n }\n />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"title\"\n getDefaultItem={(value: any) => ({\n dataIndex: value,\n title: value,\n key: value,\n })}\n renderFormItem={renderFormItem}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderCustomButtons = (item: UnionPropertyType): React.ReactElement => {\n const renderFormItem = (item: CustomButtonProps): React.ReactElement => {\n return (\n <>\n <Form.Item name=\"id\" label=\"id\">\n <Input defaultValue={item.id} />\n </Form.Item>\n <Form.Item name=\"text\" label=\"text\">\n <Input defaultValue={item.text} />\n </Form.Item>\n <Form.Item name=\"tooltip\" label=\"tooltip\">\n <Input defaultValue={item.tooltip} />\n </Form.Item>\n <Form.Item name=\"eventName\" label=\"eventName\">\n <Input defaultValue={item.eventName} />\n </Form.Item>\n <IconSelectFormItem name=\"icon\" label=\"icon\" />\n <Form.Item name=\"buttonType\" label=\"buttonType\">\n <Select defaultValue={item.buttonType}>\n {ButtonTypeEmun.map((item) => (\n <Select.Option key={item} value={item}>\n {item}\n </Select.Option>\n ))}\n </Select>\n </Form.Item>\n <Form.Item name=\"hide\" label=\"hide\">\n <Switch checked={item.hide} />\n </Form.Item>\n <Form.Item name=\"disabled\" label=\"disabled\">\n <Switch checked={item.disabled} />\n </Form.Item>\n <Form.Item name=\"isDivider\" label=\"isDivider\">\n <Switch checked={item.isDivider} />\n </Form.Item>\n <Form.Item name=\"isDropdown\" label=\"isDropdown\">\n <Switch checked={item.isDropdown} />\n </Form.Item>\n </>\n );\n };\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <ListEditor\n name={item.name}\n label={renderLabel(item)}\n required={item.required === Required.True}\n value={brickProperties[item.name]}\n listItemKey=\"text\"\n renderFormItem={renderFormItem}\n getDefaultItem={(value: any) => ({\n text: value,\n })}\n onChange={(value) => {\n form.setFieldsValue({\n [item.name]: value,\n });\n props.onValuesChange(value, value);\n }}\n />\n );\n };\n\n const renderEnumItem = (\n item: UnionPropertyType,\n enumList: string[]\n ): React.ReactElement => {\n return item.mode === ItemModeType.Advanced ? (\n renderEditorItem(item)\n ) : (\n <Form.Item\n key={item.name}\n label={renderLabel(item)}\n name={item.name}\n rules={[\n {\n required: item.required === Required.True,\n message: `请输入${item.name}`,\n },\n ]}\n >\n <Select\n options={enumList.map((item) => ({ label: item, value: item }))}\n />\n </Form.Item>\n );\n };\n\n const getFormItem = (item: PropertyType): React.ReactElement => {\n // todo(sailor): update unit text\n if (/true|false/.test(item.type as string)) {\n return renderBooleanItem(item);\n }\n if (item.enums) {\n const emunList = (item.enums as string).replace(/\"|'/g, \"\").split(\"|\");\n return renderEnumItem(item, emunList);\n }\n switch (item.type) {\n case \"string\":\n return renderStringItem(item);\n case \"string[]\":\n return renderStringListItem(item);\n case \"number\":\n return renderInputNumberItem(item);\n case \"boolean\":\n return renderBooleanItem(item);\n case \"MenuIcon\":\n return renderIconItem(item);\n case \"Color\":\n return renderColorItem(item);\n case \"Menu\":\n case \"SidebarSubMenu\":\n return renderMenuItem(item);\n // todo(sailor): update unit text\n case \"GeneralOption[]\":\n return renderGeneralOptipns(item);\n case \"CustomColumn[]\":\n return renderCustomColumn(item);\n case \"CustomButton[]\":\n return renderCustomButtons(item);\n default:\n return renderCodeEditorItem(item);\n }\n };\n\n const renderOthersItem = (): React.ReactElement => {\n return (\n <CodeEditorFormItem\n name={OTHER_FORM_ITEM_FIELD}\n label={\n brickInfo?.type === \"template\" ? \"other params\" : \"other properties\"\n }\n mode=\"brick_next_yaml\"\n maxLines={Infinity}\n />\n );\n };\n\n return isEmpty(typeList) ? (\n <Empty\n className={styles.empty}\n description={emptyConfig?.description}\n image={theme === \"dark-v2\" ? <DarkEmpty /> : Empty.PRESENTED_IMAGE_SIMPLE}\n imageStyle={emptyConfig?.imageStyle}\n />\n ) : (\n <Form\n className={styles.visualPropertyForm}\n name=\"propertyForm\"\n layout=\"horizontal\"\n labelAlign=\"right\"\n labelCol={{\n style: {\n minWidth: \"120px\",\n },\n }}\n form={form}\n onValuesChange={props.onValuesChange}\n initialValues={calculateValue(\n propertyTypeList,\n brickProperties,\n typeList\n )}\n >\n {!hiddenPropsCategory ? (\n <Collapse ghost defaultActiveKey=\"0\" className={styles.panelContainer}>\n {groupByType(typeList)?.map(([category, list], index) => {\n return (\n <Collapse.Panel\n header={upperFirst(category)}\n key={index}\n forceRender={true}\n >\n {list.map((item) => getFormItem(item))}\n </Collapse.Panel>\n );\n })}\n\n <Collapse.Panel\n className={styles.otherPanel}\n forceRender={true}\n header={upperFirst(OTHER_FORM_ITEM_FIELD)}\n key={OTHER_FORM_ITEM_FIELD}\n >\n {renderOthersItem()}\n </Collapse.Panel>\n </Collapse>\n ) : (\n <>\n {typeList?.map((item) => {\n return getFormItem(item);\n })}\n <div className={styles.otherPanel}>{renderOthersItem()}</div>\n </>\n )}\n </Form>\n );\n}\n\nexport const VisualPropertyForm = React.forwardRef(LegacyVisualPropertyForm);\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,mBAAmB,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SACEC,IAAI,EACJC,KAAK,EACLC,WAAW,EACXC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,KAAK,EACLC,MAAM,EACNC,YAAY,QACP,MAAM;AAEb,SAASC,eAAe,QAAQ,sBAAsB;AAEtD,SAASC,WAAW,QAAQ,6BAA6B;AACzD,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,KAAK,EAAEC,IAAI,EAAEC,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AACzD,OAAOC,MAAM,MAAM,iCAAiC;AAEpD,SAASC,kBAAkB,QAAQ,4CAA4C;AAC/E,SAASC,kBAAkB,QAAQ,4CAA4C;AAC/E,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,cAAc,QAAQ,wCAAwC;AACvE,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,SAASC,cAAc,IAAIC,SAAS,QAAQ,yBAAyB;AACrE,SACEC,eAAe,EACfC,cAAc,EACdC,WAAW,EACXC,aAAa,QACR,aAAa;AACpB,SAASC,qBAAqB,EAAEC,eAAe,QAAQ,YAAY;AACnE,SAASC,oBAAoB,QAAQ,aAAa;AAClD,SAIEC,YAAY,EAEZC,QAAQ,QACH,eAAe;AAEtB,IAAMC,cAAc,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> :global(.ant-collapse-item) {
7
13
  > :global(.ant-collapse-header) {
@@ -103,16 +103,9 @@ export function ListEditor(_ref) {
103
103
  message: "\u8BF7\u8F93\u5165".concat(name)
104
104
  }]
105
105
  }, /*#__PURE__*/React.createElement("div", {
106
- className: styles.listTitle
107
- }, /*#__PURE__*/React.createElement("span", null, "List"), /*#__PURE__*/React.createElement("span", {
108
- className: styles.listActionContainer
109
- }, /*#__PURE__*/React.createElement("span", {
110
- onClick: () => {
111
- setList([]);
112
- onChange([]);
113
- }
114
- }, "Clear"), /*#__PURE__*/React.createElement("span", {
115
- className: styles.listAddItem,
106
+ className: styles.listContent
107
+ }, renderListContent), /*#__PURE__*/React.createElement("span", {
108
+ className: styles.addListItem,
116
109
  onClick: handleAddListItem
117
110
  }, /*#__PURE__*/React.createElement(GeneralIcon, {
118
111
  icon: {
@@ -124,8 +117,6 @@ export function ListEditor(_ref) {
124
117
  style: {
125
118
  marginRight: "4px"
126
119
  }
127
- }), "Add"))), /*#__PURE__*/React.createElement("div", {
128
- className: styles.listContent
129
- }, renderListContent)));
120
+ }), "\u6DFB\u52A0")));
130
121
  }
131
122
  //# sourceMappingURL=ListEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListEditor.js","names":["React","useState","useCallback","useMemo","GeneralIcon","Form","Popover","styles","COLUMN_KEY","Symbol","for","key","ListEditor","name","label","value","required","listItemKey","getDefaultItem","renderFormItem","onChange","list","setList","map","item","handleRemoveItem","e","stopPropagation","newList","filter","handleAddListItem","defaultValue","length","concat","renderListForm","handleOnValuesChange","changeValues","style","minWidth","renderListContent","listContent","index","zIndex","listItem","lib","category","icon","color","padding","border","borderRadius","listEmptyItem","listContainer","message","listTitle","listActionContainer","listAddItem","marginRight"],"sources":["../../../../../src/visual-property-form/components/ListEditor/ListEditor.tsx"],"sourcesContent":["import React, { useState, useCallback, useMemo } from \"react\";\nimport { GeneralIcon } from \"@next-libs/basic-components\";\nimport { Form, Popover } from \"antd\";\nimport styles from \"./ListEditor.module.css\";\n\nconst COLUMN_KEY = Symbol.for(\"column_key\");\n\ninterface ListEditor {\n name?: string;\n label?: string | React.ReactElement;\n value?: any[];\n required?: boolean;\n listItemKey: string;\n getDefaultItem: (data: any) => Record<string, any>;\n renderFormItem?: (data: any) => React.ReactElement;\n onChange?: (data: any) => void;\n}\n\nlet key = 0;\n\nexport function ListEditor({\n name,\n label,\n value,\n required,\n listItemKey,\n getDefaultItem,\n renderFormItem,\n onChange,\n}: ListEditor): React.ReactElement {\n const [list, setList] = useState<any[]>(\n (value ?? []).map((item) => ({\n ...item,\n [COLUMN_KEY]: ++key,\n }))\n );\n\n const handleRemoveItem = useCallback(\n (e: React.MouseEvent, item: any): void => {\n e.stopPropagation();\n const key = item[COLUMN_KEY];\n const newList = list.filter((item) => item[COLUMN_KEY] !== key);\n setList(newList);\n onChange(newList);\n },\n [list, onChange]\n );\n\n const handleAddListItem = (): void => {\n key++;\n const defaultValue = `newItem(${list.length})`;\n const newList = list.concat([\n { ...getDefaultItem(defaultValue), [COLUMN_KEY]: key },\n ]);\n setList(newList);\n onChange?.(newList);\n };\n\n const renderListForm = useCallback(\n (item: any): React.ReactElement => {\n const handleOnValuesChange = (changeValues: any): void => {\n const key = item[COLUMN_KEY];\n const newList = list.map((item) => {\n if (item[COLUMN_KEY] === key) {\n item = {\n ...item,\n ...changeValues,\n };\n }\n return item;\n });\n setList(newList);\n onChange?.(newList);\n };\n return (\n <Form\n layout=\"horizontal\"\n labelAlign=\"left\"\n labelCol={{\n style: {\n minWidth: \"112px\",\n },\n }}\n onValuesChange={handleOnValuesChange}\n >\n {renderFormItem(item)}\n </Form>\n );\n },\n [list, onChange, renderFormItem]\n );\n\n const renderListContent = useMemo((): React.ReactElement => {\n return (\n <div className={styles.listContent}>\n {list.length ? (\n list.map((item, index) => {\n return (\n <Popover\n key={index}\n overlayStyle={{\n zIndex: 999,\n }}\n content={renderListForm(item)}\n title=\"Detail\"\n trigger=\"click\"\n placement=\"left\"\n >\n <div className={styles.listItem}>\n <span>{item[listItemKey]}</span>\n <span onClick={(e) => handleRemoveItem(e, item)}>\n <GeneralIcon\n icon={{\n lib: \"easyops\",\n category: \"assets-inventory\",\n icon: \"out\",\n color: \"red\",\n }}\n style={{\n padding: \"2px\",\n border: \"1px solid\",\n borderRadius: \"50%\",\n }}\n />\n </span>\n </div>\n </Popover>\n );\n })\n ) : (\n <div className={styles.listEmptyItem}>No data</div>\n )}\n </div>\n );\n }, [list, renderListForm, listItemKey, handleRemoveItem]);\n\n return (\n <div className={styles.listContainer}>\n <Form.Item\n key={name}\n name={name}\n label={label}\n rules={[{ required: required, message: `请输入${name}` }]}\n >\n <div className={styles.listTitle}>\n <span>List</span>\n <span className={styles.listActionContainer}>\n <span\n onClick={() => {\n setList([]);\n onChange([]);\n }}\n >\n Clear\n </span>\n <span className={styles.listAddItem} onClick={handleAddListItem}>\n <GeneralIcon\n icon={{\n lib: \"easyops\",\n category: \"assets-inventory\",\n icon: \"xin\",\n color: \"blue\",\n }}\n style={{\n marginRight: \"4px\",\n }}\n />\n Add\n </span>\n </span>\n </div>\n <div className={styles.listContent}>{renderListContent}</div>\n </Form.Item>\n </div>\n );\n}\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC7D,SAASC,WAAW,QAAQ,6BAA6B;AACzD,SAASC,IAAI,EAAEC,OAAO,QAAQ,MAAM;AACpC,OAAOC,MAAM,MAAM,yBAAyB;AAE5C,IAAMC,UAAU,GAAGC,MAAM,CAACC,GAAG,CAAC,YAAY,CAAC;AAa3C,IAAIC,GAAG,GAAG,CAAC;AAEX,OAAO,SAASC,UAAU,OASS;EAAA,IATR;IACzBC,IAAI;IACJC,KAAK;IACLC,KAAK;IACLC,QAAQ;IACRC,WAAW;IACXC,cAAc;IACdC,cAAc;IACdC;EACU,CAAC;EACX,IAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGrB,QAAQ,CAC9B,CAAC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AAC,gBAEF;MAAK,SAAS,EAAE3C,MAAM,CAAC4C;IAAc,aACtC,CACG;EAEV,CAAC,EAAE,CAAC9B,IAAI,EAAEa,cAAc,EAAEjB,WAAW,EAAEQ,gBAAgB,CAAC,CAAC;EAEzD,oBACE;IAAK,SAAS,EAAElB,MAAM,CAAC6C;EAAc,gBACnC,oBAAC,IAAI,CAAC,IAAI;IACR,GAAG,EAAEvC,IAAK;IACV,IAAI,EAAEA,IAAK;IACX,KAAK,EAAEC,KAAM;IACb,KAAK,EAAE,CAAC;MAAEE,QAAQ,EAAEA,QAAQ;MAAEqC,OAAO,8BAAQxC,IAAI;IAAG,CAAC;EAAE,gBAEvD;IAAK,SAAS,EAAEN,MAAM,CAAC+C;EAAU,gBAC/B,yCAAiB,eACjB;IAAM,SAAS,EAAE/C,MAAM,CAACgD;EAAoB,gBAC1C;IACE,OAAO,EAAE,MAAM;MACbjC,OAAO,CAAC,EAAE,CAAC;MACXF,QAAQ,CAAC,EAAE,CAAC;IACd;EAAE,WAGG,eACP;IAAM,SAAS,EAAEb,MAAM,CAACiD,WAAY;IAAC,OAAO,EAAE1B;EAAkB,gBAC9D,oBAAC,WAAW;IACV,IAAI,EAAE;MACJc,GAAG,EAAE,SAAS;MACdC,QAAQ,EAAE,kBAAkB;MAC5BC,IAAI,EAAE,KAAK;MACXC,KAAK,EAAE;IACT,CAAE;IACF,KAAK,EAAE;MACLU,WAAW,EAAE;IACf;EAAE,EACF,QAEG,CACF,CACH,eACN;IAAK,SAAS,EAAElD,MAAM,CAACiC;EAAY,GAAED,iBAAiB,CAAO,CACnD,CACR;AAEV"}
1
+ {"version":3,"file":"ListEditor.js","names":["React","useState","useCallback","useMemo","GeneralIcon","Form","Popover","styles","COLUMN_KEY","Symbol","for","key","ListEditor","name","label","value","required","listItemKey","getDefaultItem","renderFormItem","onChange","list","setList","map","item","handleRemoveItem","e","stopPropagation","newList","filter","handleAddListItem","defaultValue","length","concat","renderListForm","handleOnValuesChange","changeValues","style","minWidth","renderListContent","listContent","index","zIndex","listItem","lib","category","icon","color","padding","border","borderRadius","listEmptyItem","listContainer","message","addListItem","marginRight"],"sources":["../../../../../src/visual-property-form/components/ListEditor/ListEditor.tsx"],"sourcesContent":["import React, { useState, useCallback, useMemo } from \"react\";\nimport { GeneralIcon } from \"@next-libs/basic-components\";\nimport { Form, Popover } from \"antd\";\nimport styles from \"./ListEditor.module.css\";\n\nconst COLUMN_KEY = Symbol.for(\"column_key\");\n\ninterface ListEditor {\n name?: string;\n label?: string | React.ReactElement;\n value?: any[];\n required?: boolean;\n listItemKey: string;\n getDefaultItem: (data: any) => Record<string, any>;\n renderFormItem?: (data: any) => React.ReactElement;\n onChange?: (data: any) => void;\n}\n\nlet key = 0;\n\nexport function ListEditor({\n name,\n label,\n value,\n required,\n listItemKey,\n getDefaultItem,\n renderFormItem,\n onChange,\n}: ListEditor): React.ReactElement {\n const [list, setList] = useState<any[]>(\n (value ?? []).map((item) => ({\n ...item,\n [COLUMN_KEY]: ++key,\n }))\n );\n\n const handleRemoveItem = useCallback(\n (e: React.MouseEvent, item: any): void => {\n e.stopPropagation();\n const key = item[COLUMN_KEY];\n const newList = list.filter((item) => item[COLUMN_KEY] !== key);\n setList(newList);\n onChange(newList);\n },\n [list, onChange]\n );\n\n const handleAddListItem = (): void => {\n key++;\n const defaultValue = `newItem(${list.length})`;\n const newList = list.concat([\n { ...getDefaultItem(defaultValue), [COLUMN_KEY]: key },\n ]);\n setList(newList);\n onChange?.(newList);\n };\n\n const renderListForm = useCallback(\n (item: any): React.ReactElement => {\n const handleOnValuesChange = (changeValues: any): void => {\n const key = item[COLUMN_KEY];\n const newList = list.map((item) => {\n if (item[COLUMN_KEY] === key) {\n item = {\n ...item,\n ...changeValues,\n };\n }\n return item;\n });\n setList(newList);\n onChange?.(newList);\n };\n return (\n <Form\n layout=\"horizontal\"\n labelAlign=\"left\"\n labelCol={{\n style: {\n minWidth: \"112px\",\n },\n }}\n onValuesChange={handleOnValuesChange}\n >\n {renderFormItem(item)}\n </Form>\n );\n },\n [list, onChange, renderFormItem]\n );\n\n const renderListContent = useMemo((): React.ReactElement => {\n return (\n <div className={styles.listContent}>\n {list.length ? (\n list.map((item, index) => {\n return (\n <Popover\n key={index}\n overlayStyle={{\n zIndex: 999,\n }}\n content={renderListForm(item)}\n title=\"Detail\"\n trigger=\"click\"\n placement=\"left\"\n >\n <div className={styles.listItem}>\n <span>{item[listItemKey]}</span>\n <span onClick={(e) => handleRemoveItem(e, item)}>\n <GeneralIcon\n icon={{\n lib: \"easyops\",\n category: \"assets-inventory\",\n icon: \"out\",\n color: \"red\",\n }}\n style={{\n padding: \"2px\",\n border: \"1px solid\",\n borderRadius: \"50%\",\n }}\n />\n </span>\n </div>\n </Popover>\n );\n })\n ) : (\n <div className={styles.listEmptyItem}>No data</div>\n )}\n </div>\n );\n }, [list, renderListForm, listItemKey, handleRemoveItem]);\n\n return (\n <div className={styles.listContainer}>\n <Form.Item\n key={name}\n name={name}\n label={label}\n rules={[{ required: required, message: `请输入${name}` }]}\n >\n <div className={styles.listContent}>{renderListContent}</div>\n <span className={styles.addListItem} onClick={handleAddListItem}>\n <GeneralIcon\n icon={{\n lib: \"easyops\",\n category: \"assets-inventory\",\n icon: \"xin\",\n color: \"blue\",\n }}\n style={{\n marginRight: \"4px\",\n }}\n />\n 添加\n </span>\n </Form.Item>\n </div>\n );\n}\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC7D,SAASC,WAAW,QAAQ,6BAA6B;AACzD,SAASC,IAAI,EAAEC,OAAO,QAAQ,MAAM;AACpC,OAAOC,MAAM,MAAM,yBAAyB;AAE5C,IAAMC,UAAU,GAAGC,MAAM,CAACC,GAAG,CAAC,YAAY,CAAC;AAa3C,IAAIC,GAAG,GAAG,CAAC;AAEX,OAAO,SAASC,UAAU,OASS;EAAA,IATR;IACzBC,IAAI;IACJC,KAAK;IACLC,KAAK;IACLC,QA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F,KAAK,EAAE;UACLC,OAAO,EAAE,KAAK;UACdC,MAAM,EAAE,WAAW;UACnBC,YAAY,EAAE;QAChB;MAAE,EACF,CACG,CACH,CACE;IAEd,CAAC,CAAC,gBAEF;MAAK,SAAS,EAAE3C,MAAM,CAAC4C;IAAc,aACtC,CACG;EAEV,CAAC,EAAE,CAAC9B,IAAI,EAAEa,cAAc,EAAEjB,WAAW,EAAEQ,gBAAgB,CAAC,CAAC;EAEzD,oBACE;IAAK,SAAS,EAAElB,MAAM,CAAC6C;EAAc,gBACnC,oBAAC,IAAI,CAAC,IAAI;IACR,GAAG,EAAEvC,IAAK;IACV,IAAI,EAAEA,IAAK;IACX,KAAK,EAAEC,KAAM;IACb,KAAK,EAAE,CAAC;MAAEE,QAAQ,EAAEA,QAAQ;MAAEqC,OAAO,8BAAQxC,IAAI;IAAG,CAAC;EAAE,gBAEvD;IAAK,SAAS,EAAEN,MAAM,CAACiC;EAAY,GAAED,iBAAiB,CAAO,eAC7D;IAAM,SAAS,EAAEhC,MAAM,CAAC+C,WAAY;IAAC,OAAO,EAAExB;EAAkB,gBAC9D,oBAAC,WAAW;IACV,IAAI,EAAE;MACJc,GAAG,EAAE,SAAS;MACdC,QAAQ,EAAE,kBAAkB;MAC5BC,IAAI,EAAE,KAAK;MACXC,KAAK,EAAE;IACT,CAAE;IACF,KAAK,EAAE;MACLQ,WAAW,EAAE;IACf;EAAE,EACF,iBAEG,CACG,CACR;AAEV"}
@@ -3,18 +3,6 @@
3
3
  align-items: "center";
4
4
  }
5
5
 
6
- .listTitle {
7
- display: flex;
8
- justify-content: space-between;
9
- padding: 0 6px;
10
- border-radius: 6px 6px 0 0;
11
- outline-width: 1px;
12
- outline-style: solid;
13
- outline-offset: -1px;
14
- outline-color: var(--antd-input-border-color);
15
- background: rgba(0, 0, 0, 0.25);
16
- }
17
-
18
6
  .listActionContainer {
19
7
  display: flex;
20
8
  }
@@ -49,7 +37,21 @@
49
37
  outline-color: var(--antd-input-border-color);
50
38
  }
51
39
 
52
- .listItem:hover {
40
+ .addListItem {
41
+ display: flex;
42
+ justify-content: center;
43
+ align-items: center;
44
+ margin-top: 4px;
45
+ padding: 0px 20px;
46
+ outline-width: 1px;
47
+ outline-style: solid;
48
+ outline-offset: -1px;
49
+ outline-color: var(--antd-input-border-color);
50
+ border-radius: 4px;
51
+ }
52
+
53
+ .listItem:hover,
54
+ .addListItem:hover {
53
55
  cursor: pointer;
54
56
  background: rgba(0, 0, 0, 0.5);
55
57
  }
@@ -21,6 +21,7 @@ export interface PropertyType {
21
21
  groupI18N?: Record<string, {
22
22
  [language: string]: string;
23
23
  }>;
24
+ enums?: string;
24
25
  }
25
26
  export interface UnionPropertyType extends PropertyType {
26
27
  mode?: ItemModeType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-libs/visual-builder",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "https://github.com/easyops-cn/next-libs/tree/master/libs/visual-builder",
6
6
  "license": "GPL-3.0",
@@ -30,10 +30,10 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@next-libs/basic-components": "^5.2.0",
33
- "@next-libs/code-editor-components": "^4.8.0",
33
+ "@next-libs/code-editor-components": "^4.8.1",
34
34
  "@next-libs/forms": "^3.3.6",
35
35
  "@types/react-color": "^3.0.6",
36
36
  "react-color": "^2.19.3"
37
37
  },
38
- "gitHead": "7d101962654225064f40462a1be8db1128a476b1"
38
+ "gitHead": "4b992c73af9eb29949fd7f3eb71df462480e456c"
39
39
  }