@next-libs/visual-builder 1.4.1 → 1.5.1
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.
- package/dist/cjs/interfaces/brick-visualization.js.map +1 -1
- package/dist/cjs/visual-property-form/VisualPropertyForm.js +88 -26
- package/dist/cjs/visual-property-form/VisualPropertyForm.js.map +1 -1
- package/dist/cjs/visual-property-form/components/CodeEditor/CodeEditorFormItem.js +5 -2
- package/dist/cjs/visual-property-form/components/CodeEditor/CodeEditorFormItem.js.map +1 -1
- package/dist/cjs/visual-property-form/components/ListEditor/ListEditor.js +6 -0
- package/dist/cjs/visual-property-form/components/ListEditor/ListEditor.js.map +1 -1
- package/dist/cjs/visual-property-form/components/MenuEditor/MenuEditorItem.js +1 -1
- package/dist/cjs/visual-property-form/components/MenuEditor/MenuEditorItem.js.map +1 -1
- package/dist/cjs/visual-property-form/processor.js +29 -11
- package/dist/cjs/visual-property-form/processor.js.map +1 -1
- package/dist/esm/interfaces/brick-visualization.js.map +1 -1
- package/dist/esm/visual-property-form/VisualPropertyForm.js +87 -29
- package/dist/esm/visual-property-form/VisualPropertyForm.js.map +1 -1
- package/dist/esm/visual-property-form/VisualPropertyForm.module.css +15 -4
- package/dist/esm/visual-property-form/components/CodeEditor/CodeEditorFormItem.js +5 -2
- package/dist/esm/visual-property-form/components/CodeEditor/CodeEditorFormItem.js.map +1 -1
- package/dist/esm/visual-property-form/components/ListEditor/ListEditor.js +6 -1
- package/dist/esm/visual-property-form/components/ListEditor/ListEditor.js.map +1 -1
- package/dist/esm/visual-property-form/components/MenuEditor/MenuEditorItem.js +1 -1
- package/dist/esm/visual-property-form/components/MenuEditor/MenuEditorItem.js.map +1 -1
- package/dist/esm/visual-property-form/processor.js +27 -10
- package/dist/esm/visual-property-form/processor.js.map +1 -1
- package/dist/types/interfaces/brick-visualization.d.ts +1 -0
- package/dist/types/visual-property-form/VisualPropertyForm.d.ts +2 -1
- package/dist/types/visual-property-form/processor.d.ts +1 -0
- package/package.json +2 -2
|
@@ -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 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"}
|
|
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 modeValueMap?: Record<string, any>;\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"}
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.LegacyVisualPropertyForm = LegacyVisualPropertyForm;
|
|
9
9
|
exports.VisualPropertyForm = void 0;
|
|
10
|
+
exports.typeMatched = typeMatched;
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _antd = require("antd");
|
|
12
13
|
var _brickKit = require("@next-core/brick-kit");
|
|
@@ -24,8 +25,14 @@ var _processor = require("./processor");
|
|
|
24
25
|
var _constant = require("./constant");
|
|
25
26
|
var _interfaces = require("../interfaces");
|
|
26
27
|
const ButtonTypeEmun = ["link", "default", "primary", "ghost", "dashed", "icon", "text"];
|
|
28
|
+
function typeMatched(actualValue, selectedValue) {
|
|
29
|
+
if (typeof actualValue === selectedValue.type) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
// TODO: 补充更多的类型检查,例如 enum 等
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
27
35
|
function LegacyVisualPropertyForm(props, ref) {
|
|
28
|
-
var _groupByType;
|
|
29
36
|
const theme = (0, _brickKit.useCurrentTheme)();
|
|
30
37
|
const {
|
|
31
38
|
projectId,
|
|
@@ -49,30 +56,58 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
49
56
|
},
|
|
50
57
|
getCurTypeList: () => {
|
|
51
58
|
return typeList === null || typeList === void 0 ? void 0 : typeList.map(item => (0, _lodash.pick)(item, ["name", "type", "mode"]));
|
|
52
|
-
}
|
|
59
|
+
},
|
|
60
|
+
getFieldsValue: form.getFieldsValue
|
|
53
61
|
}));
|
|
54
62
|
(0, _react.useEffect)(() => {
|
|
55
63
|
const newTypeList = (0, _processor.mergeProperties)(propertyTypeList, brickProperties);
|
|
56
64
|
setTypeList(newTypeList);
|
|
57
65
|
const newValue = (0, _processor.calculateValue)(propertyTypeList, brickProperties, newTypeList);
|
|
66
|
+
form.resetFields();
|
|
58
67
|
form.setFieldsValue(newValue);
|
|
59
68
|
}, [propertyTypeList, brickProperties]);
|
|
60
69
|
const handleLabelClick = name => {
|
|
61
70
|
const selected = typeList.find(item => item.name === name);
|
|
62
71
|
const index = typeList.findIndex(item => item.name === name);
|
|
63
72
|
const nextMode = selected.mode === _interfaces.ItemModeType.Advanced ? _interfaces.ItemModeType.Normal : _interfaces.ItemModeType.Advanced;
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
selected.value = form.getFieldValue(selected.name);
|
|
74
|
+
// 记录切换前的模式下的值
|
|
75
|
+
selected.modeValueMap = {
|
|
76
|
+
...selected.modeValueMap,
|
|
77
|
+
...{
|
|
78
|
+
[selected.mode]: selected.value
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
// let value = cloneDeep(selected.value);
|
|
82
|
+
if (!(0, _lodash.isNil)(selected.modeValueMap[nextMode])) {
|
|
83
|
+
// 切换后的模式原本有值时,则用原本的值
|
|
84
|
+
selected.value = selected.modeValueMap[nextMode];
|
|
85
|
+
} else if (nextMode === _interfaces.ItemModeType.Normal) {
|
|
86
|
+
// 切换到普通模式没有值时可以根据高级模式来更新值
|
|
66
87
|
if (_constant.supportMenuType.includes(selected.type)) {
|
|
67
|
-
value = (0, _processor.matchNoramlMenuValue)(value);
|
|
88
|
+
selected.value = (0, _processor.matchNoramlMenuValue)(selected.value);
|
|
89
|
+
} else if (_constant.supportBasicType.includes(selected.type)) {
|
|
90
|
+
// yaml解析后检查下类型,不符合属性类型就不更新了
|
|
91
|
+
const parsedValue = (0, _processor.yaml)(selected.value);
|
|
92
|
+
if (typeMatched(parsedValue, selected)) {
|
|
93
|
+
selected.value = parsedValue;
|
|
94
|
+
} else {
|
|
95
|
+
selected.value = undefined;
|
|
96
|
+
}
|
|
68
97
|
}
|
|
69
|
-
} else if ((0, _lodash.isNil)(selected.value)) {
|
|
70
|
-
value = "";
|
|
71
98
|
} else {
|
|
72
|
-
|
|
99
|
+
// 切换到高级模式没有值时可以根据普通模式来更新值
|
|
100
|
+
if ((0, _lodash.isNil)(selected.value)) {
|
|
101
|
+
selected.value = "";
|
|
102
|
+
} else if ((0, _lodash.isString)(selected.value)) {
|
|
103
|
+
// do nothing
|
|
104
|
+
} else {
|
|
105
|
+
selected.value = (0, _processor.yamlStringify)(selected.value);
|
|
106
|
+
}
|
|
73
107
|
}
|
|
108
|
+
selected.modeValueMap[nextMode] = selected.value;
|
|
74
109
|
form.setFieldsValue({
|
|
75
|
-
[name]: value
|
|
110
|
+
[name]: selected.value
|
|
76
111
|
});
|
|
77
112
|
const newTypeList = (0, _immutabilityHelper.default)(typeList, {
|
|
78
113
|
$splice: [[index, 1, {
|
|
@@ -102,7 +137,18 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
102
137
|
theme: theme === "dark-v2" ? "monokai" : "tomorrow",
|
|
103
138
|
jsonSchema: item === null || item === void 0 ? void 0 : item.jsonSchema,
|
|
104
139
|
schemaRef: item === null || item === void 0 ? void 0 : item.schemaRef,
|
|
105
|
-
mode: (item === null || item === void 0 ? void 0 : (_item$editor = item.editor) === null || _item$editor === void 0 ? void 0 : _item$editor.model) || "brick_next_yaml"
|
|
140
|
+
mode: (item === null || item === void 0 ? void 0 : (_item$editor = item.editor) === null || _item$editor === void 0 ? void 0 : _item$editor.model) || "brick_next_yaml",
|
|
141
|
+
showLineNumbers: true,
|
|
142
|
+
showGutter: true,
|
|
143
|
+
labelCol: {
|
|
144
|
+
span: 24,
|
|
145
|
+
style: {
|
|
146
|
+
padding: 0
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
wrapperCol: {
|
|
150
|
+
span: 24
|
|
151
|
+
}
|
|
106
152
|
});
|
|
107
153
|
};
|
|
108
154
|
const renderStringItem = item => {
|
|
@@ -124,8 +170,11 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
124
170
|
rules: [{
|
|
125
171
|
required: item.required === _interfaces.Required.True,
|
|
126
172
|
message: `请输入${item.name}`
|
|
127
|
-
}]
|
|
128
|
-
|
|
173
|
+
}],
|
|
174
|
+
valuePropName: "checked"
|
|
175
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Switch, {
|
|
176
|
+
defaultChecked: props.brickProperties[item.name]
|
|
177
|
+
}));
|
|
129
178
|
};
|
|
130
179
|
const renderInputNumberItem = item => {
|
|
131
180
|
return item.mode === _interfaces.ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
@@ -211,10 +260,11 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
211
260
|
value: value
|
|
212
261
|
}),
|
|
213
262
|
onChange: value => {
|
|
214
|
-
|
|
263
|
+
const changeValue = {
|
|
215
264
|
[item.name]: value
|
|
216
|
-
}
|
|
217
|
-
|
|
265
|
+
};
|
|
266
|
+
form.setFieldsValue(changeValue);
|
|
267
|
+
props.onValuesChange(changeValue, form.getFieldsValue());
|
|
218
268
|
}
|
|
219
269
|
});
|
|
220
270
|
};
|
|
@@ -258,10 +308,11 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
258
308
|
}),
|
|
259
309
|
renderFormItem: renderFormItem,
|
|
260
310
|
onChange: value => {
|
|
261
|
-
|
|
311
|
+
const changeValue = {
|
|
262
312
|
[item.name]: value
|
|
263
|
-
}
|
|
264
|
-
|
|
313
|
+
};
|
|
314
|
+
form.setFieldsValue(changeValue);
|
|
315
|
+
props.onValuesChange(changeValue, form.getFieldsValue());
|
|
265
316
|
}
|
|
266
317
|
});
|
|
267
318
|
};
|
|
@@ -331,10 +382,11 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
331
382
|
text: value
|
|
332
383
|
}),
|
|
333
384
|
onChange: value => {
|
|
334
|
-
|
|
385
|
+
const changeValue = {
|
|
335
386
|
[item.name]: value
|
|
336
|
-
}
|
|
337
|
-
|
|
387
|
+
};
|
|
388
|
+
form.setFieldsValue(changeValue);
|
|
389
|
+
props.onValuesChange(changeValue, form.getFieldsValue());
|
|
338
390
|
}
|
|
339
391
|
});
|
|
340
392
|
};
|
|
@@ -398,6 +450,9 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
398
450
|
maxLines: Infinity
|
|
399
451
|
});
|
|
400
452
|
};
|
|
453
|
+
const gorupList = _react.default.useMemo(() => {
|
|
454
|
+
return (0, _processor.groupByType)(typeList);
|
|
455
|
+
}, [typeList]);
|
|
401
456
|
return (0, _lodash.isEmpty)(typeList) ? /*#__PURE__*/_react.default.createElement(_antd.Empty, {
|
|
402
457
|
className: _VisualPropertyFormModule.default.empty,
|
|
403
458
|
description: emptyConfig === null || emptyConfig === void 0 ? void 0 : emptyConfig.description,
|
|
@@ -407,20 +462,27 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
407
462
|
className: _VisualPropertyFormModule.default.visualPropertyForm,
|
|
408
463
|
name: "propertyForm",
|
|
409
464
|
layout: "horizontal",
|
|
410
|
-
labelAlign: "
|
|
465
|
+
labelAlign: "left",
|
|
411
466
|
labelCol: {
|
|
467
|
+
span: 8,
|
|
412
468
|
style: {
|
|
413
469
|
minWidth: "120px"
|
|
414
470
|
}
|
|
415
471
|
},
|
|
472
|
+
wrapperCol: {
|
|
473
|
+
span: 16
|
|
474
|
+
},
|
|
475
|
+
size: "small",
|
|
416
476
|
form: form,
|
|
417
477
|
onValuesChange: props.onValuesChange,
|
|
418
|
-
initialValues: (0, _processor.calculateValue)(propertyTypeList, brickProperties, typeList)
|
|
478
|
+
initialValues: (0, _processor.calculateValue)(propertyTypeList, brickProperties, typeList),
|
|
479
|
+
colon: false
|
|
419
480
|
}, !hiddenPropsCategory ? /*#__PURE__*/_react.default.createElement(_antd.Collapse, {
|
|
420
481
|
ghost: true,
|
|
421
|
-
defaultActiveKey:
|
|
422
|
-
className: _VisualPropertyFormModule.default.panelContainer
|
|
423
|
-
|
|
482
|
+
defaultActiveKey: gorupList.map((_, index) => String(index)),
|
|
483
|
+
className: _VisualPropertyFormModule.default.panelContainer,
|
|
484
|
+
expandIconPosition: "left"
|
|
485
|
+
}, gorupList === null || gorupList === void 0 ? void 0 : gorupList.map(([category, list], index) => {
|
|
424
486
|
return /*#__PURE__*/_react.default.createElement(_antd.Collapse.Panel, {
|
|
425
487
|
header: (0, _lodash.upperFirst)(category),
|
|
426
488
|
key: index,
|
|
@@ -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","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,0BAA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BAAC,cAAQ,CAAC,KAAK;MACb,MAAM,EAAE,IAAA0F,kBAAU,EAACF,QAAQ,CAAE;MAC7B,GAAG,EAAExF,KAAM;MACX,WAAW,EAAE;IAAK,GAEjByF,IAAI,CAACrG,GAAG,CAAEC,IAAI,IAAKgF,WAAW,CAAChF,IAAI,CAAC,CAAC,CACvB;EAErB,CAAC,CAAC,eAEF,6BAAC,cAAQ,CAAC,KAAK;IACb,SAAS,EAAE8B,iCAAM,CAACwE,UAAW;IAC7B,WAAW,EAAE,IAAK;IAClB,MAAM,EAAE,IAAAD,kBAAU,EAACd,+BAAqB,CAAE;IAC1C,GAAG,EAAEA;EAAsB,GAE1BD,gBAAgB,EAAE,CACJ,CACR,gBAEX,4DACGlG,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEW,GAAG,CAAEC,IAAI,IAAK;IACvB,OAAOgF,WAAW,CAAChF,IAAI,CAAC;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"}
|
|
1
|
+
{"version":3,"file":"VisualPropertyForm.js","names":["ButtonTypeEmun","typeMatched","actualValue","selectedValue","type","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","getFieldsValue","useEffect","newTypeList","newValue","calculateValue","setFieldsValue","handleLabelClick","name","selected","find","index","findIndex","nextMode","mode","ItemModeType","Advanced","Normal","value","getFieldValue","modeValueMap","isNil","supportMenuType","includes","matchNoramlMenuValue","supportBasicType","parsedValue","yaml","undefined","isString","yamlStringify","update","$splice","renderLabel","hideIcon","description","styles","iconContainer","advanced","normal","renderEditorItem","required","Required","True","jsonSchema","schemaRef","editor","model","span","style","padding","renderStringItem","message","renderBooleanItem","renderInputNumberItem","renderStringListItem","renderIconItem","renderCodeEditorItem","renderColorItem","renderMenuItem","renderGeneralOptipns","renderFormItem","label","disabled","changeValue","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","gorupList","React","useMemo","groupByType","isEmpty","empty","Empty","PRESENTED_IMAGE_SIMPLE","imageStyle","visualPropertyForm","minWidth","_","String","panelContainer","category","list","upperFirst","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 _, {\n isNil,\n pick,\n upperFirst,\n isEmpty,\n cloneDeep,\n isString,\n} 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 yaml,\n} from \"./processor\";\nimport {\n OTHER_FORM_ITEM_FIELD,\n supportBasicType,\n supportMenuType,\n} 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 typeMatched(\n actualValue: any,\n selectedValue: UnionPropertyType\n): boolean {\n if (typeof actualValue === (selectedValue.type as string)) {\n return true;\n }\n // TODO: 补充更多的类型检查,例如 enum 等\n return false;\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 getFieldsValue: form.getFieldsValue,\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.resetFields();\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 selected.value = form.getFieldValue(selected.name);\n // 记录切换前的模式下的值\n selected.modeValueMap = {\n ...selected.modeValueMap,\n ...{ [selected.mode]: selected.value },\n };\n // let value = cloneDeep(selected.value);\n if (!isNil(selected.modeValueMap[nextMode])) {\n // 切换后的模式原本有值时,则用原本的值\n selected.value = selected.modeValueMap[nextMode];\n } else if (nextMode === ItemModeType.Normal) {\n // 切换到普通模式没有值时可以根据高级模式来更新值\n if (supportMenuType.includes(selected.type as string)) {\n selected.value = matchNoramlMenuValue(selected.value);\n } else if (supportBasicType.includes(selected.type as string)) {\n // yaml解析后检查下类型,不符合属性类型就不更新了\n const parsedValue = yaml(selected.value);\n if (typeMatched(parsedValue, selected)) {\n selected.value = parsedValue;\n } else {\n selected.value = undefined;\n }\n }\n } else {\n // 切换到高级模式没有值时可以根据普通模式来更新值\n if (isNil(selected.value)) {\n selected.value = \"\";\n } else if (isString(selected.value)) {\n // do nothing\n } else {\n selected.value = yamlStringify(selected.value);\n }\n }\n selected.modeValueMap[nextMode] = selected.value;\n form.setFieldsValue({\n [name]: selected.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 showLineNumbers={true}\n showGutter={true}\n labelCol={{\n span: 24,\n style: {\n padding: 0,\n },\n }}\n wrapperCol={{\n span: 24,\n }}\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 valuePropName=\"checked\"\n >\n <Switch defaultChecked={props.brickProperties[item.name]} />\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 const changeValue = {\n [item.name]: value,\n };\n form.setFieldsValue(changeValue);\n props.onValuesChange(changeValue, form.getFieldsValue());\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 const changeValue = {\n [item.name]: value,\n };\n form.setFieldsValue(changeValue);\n props.onValuesChange(changeValue, form.getFieldsValue());\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 const changeValue = {\n [item.name]: value,\n };\n form.setFieldsValue(changeValue);\n props.onValuesChange(changeValue, form.getFieldsValue());\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 const gorupList = React.useMemo(() => {\n return groupByType(typeList);\n }, [typeList]);\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=\"left\"\n labelCol={{\n span: 8,\n style: {\n minWidth: \"120px\",\n },\n }}\n wrapperCol={{ span: 16 }}\n size=\"small\"\n form={form}\n onValuesChange={props.onValuesChange}\n initialValues={calculateValue(\n propertyTypeList,\n brickProperties,\n typeList\n )}\n colon={false}\n >\n {!hiddenPropsCategory ? (\n <Collapse\n ghost\n defaultActiveKey={gorupList.map((_, index) => String(index))}\n className={styles.panelContainer}\n expandIconPosition=\"left\"\n >\n {gorupList?.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;AAQA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AAMA;AASA,MAAMA,cAAc,GAAG,CACrB,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,EACN,MAAM,CACP;AA6CM,SAASC,WAAW,CACzBC,WAAgB,EAChBC,aAAgC,EACvB;EACT,IAAI,OAAOD,WAAW,KAAMC,aAAa,CAACC,IAAe,EAAE;IACzD,OAAO,IAAI;EACb;EACA;EACA,OAAO,KAAK;AACd;AACO,SAASC,wBAAwB,CACtCC,KAA8B,EAC9BC,GAA+B,EACX;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;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AEW,GAAG,CAAEC,IAAI,IAAK;IACvB,OAAO2F,WAAW,CAAC3F,IAAI,CAAC;EAC1B,CAAC,CAAC,eACF;IAAK,SAAS,EAAEqC,iCAAM,CAACgF;EAAW,GAAEpB,gBAAgB,EAAE,CAAO,CAEhE,CAEJ;AACH;AAEO,MAAMqB,kBAAkB,gBAAGjB,cAAK,CAACkB,UAAU,CAACpJ,wBAAwB,CAAC;AAAC"}
|
|
@@ -30,6 +30,8 @@ function CodeEditorFormItem(props) {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
33
|
+
labelCol: props.labelCol,
|
|
34
|
+
wrapperCol: props.wrapperCol,
|
|
33
35
|
key: props.name,
|
|
34
36
|
name: props.name,
|
|
35
37
|
label: props.label,
|
|
@@ -41,10 +43,11 @@ function CodeEditorFormItem(props) {
|
|
|
41
43
|
}]
|
|
42
44
|
}, /*#__PURE__*/_react.default.createElement(_codeEditorComponents.CodeEditorItem, (0, _extends2.default)({
|
|
43
45
|
tabSize: 2,
|
|
44
|
-
minLines:
|
|
46
|
+
minLines: 3,
|
|
45
47
|
maxLines: 12,
|
|
46
48
|
printMargin: false,
|
|
47
|
-
showLineNumbers:
|
|
49
|
+
showLineNumbers: props.showLineNumbers,
|
|
50
|
+
showGutter: props.showGutter,
|
|
48
51
|
showCopyButton: true,
|
|
49
52
|
showExpandButton: true,
|
|
50
53
|
theme: "tomorrow",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditorFormItem.js","names":["CodeEditorFormItem","props","name","label","rest","hasError","setHasError","useState","handleValidate","err","error","some","validatorFn","Promise","resolve","reject","required","message","validator"],"sources":["../../../../../src/visual-property-form/components/CodeEditor/CodeEditorFormItem.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { some } from \"lodash\";\nimport { Form } from \"antd\";\nimport { FormItemWrapperProps } from \"@next-libs/forms\";\nimport {\n CodeEditorProps,\n CodeEditorItem,\n Error,\n} from \"@next-libs/code-editor-components\";\n\ninterface CodeEditorItemProps extends CodeEditorProps, FormItemWrapperProps {}\n\nexport function CodeEditorFormItem(\n props: CodeEditorItemProps\n): React.ReactElement {\n const { name, label, ...rest } = props;\n const [hasError, setHasError] = useState(false);\n\n const handleValidate = (err: Error[\"err\"]): void => {\n const error = some(err, [\"type\", \"error\"]);\n setHasError(error);\n };\n\n const validatorFn = async () => {\n if (!hasError) {\n return Promise.resolve();\n } else {\n return Promise.reject(\"请填写正确的 yaml 语法\");\n }\n };\n\n return (\n <Form.Item\n key={props.name}\n name={props.name}\n label={props.label}\n rules={[\n { required: props.required, message: `请输入${props.name}` },\n { validator: validatorFn },\n ]}\n >\n <CodeEditorItem\n tabSize={2}\n minLines={
|
|
1
|
+
{"version":3,"file":"CodeEditorFormItem.js","names":["CodeEditorFormItem","props","name","label","rest","hasError","setHasError","useState","handleValidate","err","error","some","validatorFn","Promise","resolve","reject","labelCol","wrapperCol","required","message","validator","showLineNumbers","showGutter"],"sources":["../../../../../src/visual-property-form/components/CodeEditor/CodeEditorFormItem.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { some } from \"lodash\";\nimport { Form } from \"antd\";\nimport { FormItemWrapperProps } from \"@next-libs/forms\";\nimport {\n CodeEditorProps,\n CodeEditorItem,\n Error,\n} from \"@next-libs/code-editor-components\";\n\ninterface CodeEditorItemProps extends CodeEditorProps, FormItemWrapperProps {}\n\nexport function CodeEditorFormItem(\n props: CodeEditorItemProps\n): React.ReactElement {\n const { name, label, ...rest } = props;\n const [hasError, setHasError] = useState(false);\n\n const handleValidate = (err: Error[\"err\"]): void => {\n const error = some(err, [\"type\", \"error\"]);\n setHasError(error);\n };\n\n const validatorFn = async () => {\n if (!hasError) {\n return Promise.resolve();\n } else {\n return Promise.reject(\"请填写正确的 yaml 语法\");\n }\n };\n\n return (\n <Form.Item\n labelCol={props.labelCol}\n wrapperCol={props.wrapperCol}\n key={props.name}\n name={props.name}\n label={props.label}\n rules={[\n { required: props.required, message: `请输入${props.name}` },\n { validator: validatorFn },\n ]}\n >\n <CodeEditorItem\n tabSize={2}\n minLines={3}\n maxLines={12}\n printMargin={false}\n showLineNumbers={props.showLineNumbers}\n showGutter={props.showGutter}\n showCopyButton={true}\n showExpandButton={true}\n theme=\"tomorrow\"\n enableLiveAutocompletion={true}\n onValidate={handleValidate}\n {...rest}\n ></CodeEditorItem>\n </Form.Item>\n );\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AAEA;AAQO,SAASA,kBAAkB,CAChCC,KAA0B,EACN;EACpB,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAE,GAAGC;EAAK,CAAC,GAAGH,KAAK;EACtC,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE/C,MAAMC,cAAc,GAAIC,GAAiB,IAAW;IAClD,MAAMC,KAAK,GAAG,IAAAC,YAAI,EAACF,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1CH,WAAW,CAACI,KAAK,CAAC;EACpB,CAAC;EAED,MAAME,WAAW,GAAG,YAAY;IAC9B,IAAI,CAACP,QAAQ,EAAE;MACb,OAAOQ,OAAO,CAACC,OAAO,EAAE;IAC1B,CAAC,MAAM;MACL,OAAOD,OAAO,CAACE,MAAM,CAAC,gBAAgB,CAAC;IACzC;EACF,CAAC;EAED,oBACE,6BAAC,UAAI,CAAC,IAAI;IACR,QAAQ,EAAEd,KAAK,CAACe,QAAS;IACzB,UAAU,EAAEf,KAAK,CAACgB,UAAW;IAC7B,GAAG,EAAEhB,KAAK,CAACC,IAAK;IAChB,IAAI,EAAED,KAAK,CAACC,IAAK;IACjB,KAAK,EAAED,KAAK,CAACE,KAAM;IACnB,KAAK,EAAE,CACL;MAAEe,QAAQ,EAAEjB,KAAK,CAACiB,QAAQ;MAAEC,OAAO,EAAG,MAAKlB,KAAK,CAACC,IAAK;IAAE,CAAC,EACzD;MAAEkB,SAAS,EAAER;IAAY,CAAC;EAC1B,gBAEF,6BAAC,oCAAc;IACb,OAAO,EAAE,CAAE;IACX,QAAQ,EAAE,CAAE;IACZ,QAAQ,EAAE,EAAG;IACb,WAAW,EAAE,KAAM;IACnB,eAAe,EAAEX,KAAK,CAACoB,eAAgB;IACvC,UAAU,EAAEpB,KAAK,CAACqB,UAAW;IAC7B,cAAc,EAAE,IAAK;IACrB,gBAAgB,EAAE,IAAK;IACvB,KAAK,EAAC,UAAU;IAChB,wBAAwB,EAAE,IAAK;IAC/B,UAAU,EAAEd;EAAe,GACvBJ,IAAI,EACQ,CACR;AAEhB"}
|
|
@@ -26,6 +26,12 @@ function ListEditor({
|
|
|
26
26
|
...item,
|
|
27
27
|
[COLUMN_KEY]: ++key
|
|
28
28
|
})));
|
|
29
|
+
(0, _react.useEffect)(() => {
|
|
30
|
+
setList((value !== null && value !== void 0 ? value : []).map(item => ({
|
|
31
|
+
...item,
|
|
32
|
+
[COLUMN_KEY]: ++key
|
|
33
|
+
})));
|
|
34
|
+
}, [value]);
|
|
29
35
|
const handleRemoveItem = (0, _react.useCallback)((e, item) => {
|
|
30
36
|
e.stopPropagation();
|
|
31
37
|
const key = item[COLUMN_KEY];
|
|
@@ -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","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,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAG,IAAAC,eAAQ,EAC9B,CAACR,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,EAAES,GAAG,CAAEC,IAAI,KAAM;IAC3B,GAAGA,IAAI;IACP,CAACjB,UAAU,GAAG,EAAEG;EAClB,CAAC,CAAC,CAAC,CACJ;EAED,
|
|
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","useEffect","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, useEffect, 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 useEffect(() => {\n setList(\n (value ?? []).map((item) => ({\n ...item,\n [COLUMN_KEY]: ++key,\n }))\n );\n }, [value]);\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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F,KAAK,EAAE;MACLQ,WAAW,EAAE;IACf;EAAE,EACF,iBAEG,CACG,CACR;AAEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuEditorItem.js","names":["MenuEditorItem","props","options","setOptions","useState","getMenu","result","InstanceApi_getDetail","projectId","fields","menus","map","item","value","menuId","label","handleMenuSettingClick","menuSettingClick","useEffect","display","alignItems","name","required","message","width","input","option","toLocaleLowerCase","indexOf","fontSize","
|
|
1
|
+
{"version":3,"file":"MenuEditorItem.js","names":["MenuEditorItem","props","options","setOptions","useState","getMenu","result","InstanceApi_getDetail","projectId","fields","menus","map","item","value","menuId","label","handleMenuSettingClick","menuSettingClick","useEffect","display","alignItems","name","required","message","width","input","option","toLocaleLowerCase","indexOf","fontSize","marginBottom","marginLeft","cursor","category","color","icon","lib"],"sources":["../../../../../src/visual-property-form/components/MenuEditor/MenuEditorItem.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport { Form, Select, Tooltip } from \"antd\";\nimport { GeneralIcon } from \"@next-libs/basic-components\";\nimport { InstanceApi_getDetail } from \"@next-sdk/cmdb-sdk\";\n\ninterface MenuEditorItemProps {\n name?: string;\n label?: string | React.ReactElement;\n value?: string;\n required?: boolean;\n projectId?: string;\n menuSettingClick?: () => void;\n}\n\nexport function MenuEditorItem(props: MenuEditorItemProps): React.ReactElement {\n const [options, setOptions] = useState([]);\n\n const getMenu = async () => {\n const result = await InstanceApi_getDetail(\n \"PROJECT_MICRO_APP\",\n props.projectId,\n {\n fields: \"menus.menuId\",\n }\n );\n\n const options = result.menus.map((item: Record<string, any>) => ({\n value: item.menuId,\n label: item.menuId,\n }));\n setOptions(options);\n };\n\n const handleMenuSettingClick = () => {\n props.menuSettingClick();\n };\n\n useEffect(() => {\n if (props.projectId) {\n getMenu();\n }\n }, []);\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <Form.Item\n key={props.name}\n name={props.name}\n label={props.label}\n rules={[{ required: props.required, message: `请输入${props.name}` }]}\n >\n <Select\n style={{\n width: \"300px\",\n }}\n options={options}\n showSearch\n allowClear\n placeholder=\"Select a menu id\"\n filterOption={(input, option) =>\n (option.label as string)\n .toLocaleLowerCase()\n .indexOf(input.toLocaleLowerCase()) >= 0 ||\n (option.value as string)\n .toLocaleLowerCase()\n .indexOf(input.toLocaleLowerCase()) >= 0\n }\n />\n </Form.Item>\n <div\n style={{\n fontSize: \"18px\",\n marginBottom: \"8px\",\n marginLeft: \"10px\",\n cursor: \"pointer\",\n display: \"inline-block\",\n }}\n >\n <Tooltip title=\"配置菜单数据\">\n {\" \"}\n <GeneralIcon\n icon={{\n category: \"app\",\n color: \"blue\",\n icon: \"launchpad-setting\",\n lib: \"easyops\",\n }}\n onClick={handleMenuSettingClick}\n />\n </Tooltip>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AAWO,SAASA,cAAc,CAACC,KAA0B,EAAsB;EAC7E,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAAC,EAAE,CAAC;EAE1C,MAAMC,OAAO,GAAG,YAAY;IAC1B,MAAMC,MAAM,GAAG,MAAM,IAAAC,8BAAqB,EACxC,mBAAmB,EACnBN,KAAK,CAACO,SAAS,EACf;MACEC,MAAM,EAAE;IACV,CAAC,CACF;IAED,MAAMP,OAAO,GAAGI,MAAM,CAACI,KAAK,CAACC,GAAG,CAAEC,IAAyB,KAAM;MAC/DC,KAAK,EAAED,IAAI,CAACE,MAAM;MAClBC,KAAK,EAAEH,IAAI,CAACE;IACd,CAAC,CAAC,CAAC;IACHX,UAAU,CAACD,OAAO,CAAC;EACrB,CAAC;EAED,MAAMc,sBAAsB,GAAG,MAAM;IACnCf,KAAK,CAACgB,gBAAgB,EAAE;EAC1B,CAAC;EAED,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIjB,KAAK,CAACO,SAAS,EAAE;MACnBH,OAAO,EAAE;IACX;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