@next-libs/visual-builder 1.2.23 → 1.3.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.
- package/dist/cjs/visual-property-form/VisualPropertyForm.js +202 -7
- package/dist/cjs/visual-property-form/VisualPropertyForm.js.map +1 -1
- package/dist/cjs/visual-property-form/components/ListEditor/ListEditor.js +141 -0
- package/dist/cjs/visual-property-form/components/ListEditor/ListEditor.js.map +1 -0
- package/dist/esm/visual-property-form/VisualPropertyForm.js +203 -8
- package/dist/esm/visual-property-form/VisualPropertyForm.js.map +1 -1
- package/dist/esm/visual-property-form/components/ListEditor/ListEditor.js +130 -0
- package/dist/esm/visual-property-form/components/ListEditor/ListEditor.js.map +1 -0
- package/dist/esm/visual-property-form/components/ListEditor/ListEditor.module.css +55 -0
- package/dist/types/visual-property-form/VisualPropertyForm.d.ts +24 -0
- package/dist/types/visual-property-form/components/ListEditor/ListEditor.d.ts +13 -0
- package/package.json +2 -2
|
@@ -18,10 +18,12 @@ var _CodeEditorFormItem = require("./components/CodeEditor/CodeEditorFormItem");
|
|
|
18
18
|
var _IconSelectFormItem = require("./components/IconSelect/IconSelectFormItem");
|
|
19
19
|
var _ColorEditorItem = require("./components/ColorEditor/ColorEditorItem");
|
|
20
20
|
var _MenuEditorItem = require("./components/MenuEditor/MenuEditorItem");
|
|
21
|
+
var _ListEditor = require("./components/ListEditor/ListEditor");
|
|
21
22
|
var _emptyDark = require("./images/empty-dark.svg");
|
|
22
23
|
var _processor = require("./processor");
|
|
23
24
|
var _constant = require("./constant");
|
|
24
25
|
var _interfaces = require("../interfaces");
|
|
26
|
+
const ButtonTypeEmun = ["link", "default", "primary", "ghost", "dashed", "icon", "text"];
|
|
25
27
|
function LegacyVisualPropertyForm(props, ref) {
|
|
26
28
|
var _groupByType;
|
|
27
29
|
const theme = (0, _brickKit.useCurrentTheme)();
|
|
@@ -33,7 +35,8 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
33
35
|
brickInfo,
|
|
34
36
|
emptyConfig,
|
|
35
37
|
hiddenPropsCategory,
|
|
36
|
-
menuSettingClick
|
|
38
|
+
menuSettingClick,
|
|
39
|
+
childMountPointList
|
|
37
40
|
} = props;
|
|
38
41
|
const [form] = _antd.Form.useForm();
|
|
39
42
|
const [typeList, setTypeList] = (0, _react.useState)((0, _processor.mergeProperties)(propertyTypeList, brickProperties));
|
|
@@ -122,11 +125,7 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
122
125
|
required: item.required === _interfaces.Required.True,
|
|
123
126
|
message: `请输入${item.name}`
|
|
124
127
|
}]
|
|
125
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.
|
|
126
|
-
value: true
|
|
127
|
-
}, "true"), /*#__PURE__*/_react.default.createElement(_antd.Radio, {
|
|
128
|
-
value: false
|
|
129
|
-
}, "false")));
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Switch, null));
|
|
130
129
|
};
|
|
131
130
|
const renderInputNumberItem = item => {
|
|
132
131
|
return item.mode === _interfaces.ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
@@ -181,7 +180,190 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
181
180
|
menuSettingClick: menuSettingClick
|
|
182
181
|
});
|
|
183
182
|
};
|
|
183
|
+
const renderGeneralOptipns = item => {
|
|
184
|
+
const renderFormItem = item => {
|
|
185
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
186
|
+
name: "label",
|
|
187
|
+
label: "label"
|
|
188
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
189
|
+
defaultValue: item.label
|
|
190
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
191
|
+
name: "value",
|
|
192
|
+
label: "value"
|
|
193
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
194
|
+
defaultValue: item.value
|
|
195
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
196
|
+
name: "disabled",
|
|
197
|
+
label: "disabled"
|
|
198
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Switch, {
|
|
199
|
+
checked: item.disabled
|
|
200
|
+
})));
|
|
201
|
+
};
|
|
202
|
+
return item.mode === _interfaces.ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/_react.default.createElement(_ListEditor.ListEditor, {
|
|
203
|
+
name: item.name,
|
|
204
|
+
label: renderLabel(item),
|
|
205
|
+
required: item.required === _interfaces.Required.True,
|
|
206
|
+
value: brickProperties[item.name],
|
|
207
|
+
listItemKey: "label",
|
|
208
|
+
renderFormItem: renderFormItem,
|
|
209
|
+
getDefaultItem: value => ({
|
|
210
|
+
label: value,
|
|
211
|
+
value: value
|
|
212
|
+
}),
|
|
213
|
+
onChange: value => {
|
|
214
|
+
form.setFieldsValue({
|
|
215
|
+
[item.name]: value
|
|
216
|
+
});
|
|
217
|
+
props.onValuesChange(value, value);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
const renderCustomColumn = item => {
|
|
222
|
+
const renderFormItem = item => {
|
|
223
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
224
|
+
name: "dataIndex",
|
|
225
|
+
label: "dataIndex"
|
|
226
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
227
|
+
defaultValue: item.dataIndex
|
|
228
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
229
|
+
name: "key",
|
|
230
|
+
label: "key"
|
|
231
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
232
|
+
defaultValue: item.key
|
|
233
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
234
|
+
name: "title",
|
|
235
|
+
label: "title"
|
|
236
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
237
|
+
defaultValue: item.title
|
|
238
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
239
|
+
name: "useChildren",
|
|
240
|
+
label: "useChildren",
|
|
241
|
+
tooltip: "useBrick\u4EE3\u66FF\u7528\u6CD5,\u6570\u636E\u6765\u6E90\u4E8E\u5B50\u63D2\u69FD\u540D\u79F0,\u5E76\u4E14\u63D2\u69FD\u540D\u79F0\u5FC5\u987B\u4F7F\u7528'[]'\u5305\u88F9"
|
|
242
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.AutoComplete, {
|
|
243
|
+
defaultValue: item.useChildren,
|
|
244
|
+
dataSource: (childMountPointList !== null && childMountPointList !== void 0 ? childMountPointList : []).filter(item => item.startsWith("[") && item.endsWith("]")),
|
|
245
|
+
filterOption: (inputValue, option) => option.props.children.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
|
|
246
|
+
})));
|
|
247
|
+
};
|
|
248
|
+
return item.mode === _interfaces.ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/_react.default.createElement(_ListEditor.ListEditor, {
|
|
249
|
+
name: item.name,
|
|
250
|
+
label: renderLabel(item),
|
|
251
|
+
required: item.required === _interfaces.Required.True,
|
|
252
|
+
value: brickProperties[item.name],
|
|
253
|
+
listItemKey: "title",
|
|
254
|
+
getDefaultItem: value => ({
|
|
255
|
+
dataIndex: value,
|
|
256
|
+
title: value,
|
|
257
|
+
key: value
|
|
258
|
+
}),
|
|
259
|
+
renderFormItem: renderFormItem,
|
|
260
|
+
onChange: value => {
|
|
261
|
+
form.setFieldsValue({
|
|
262
|
+
[item.name]: value
|
|
263
|
+
});
|
|
264
|
+
props.onValuesChange(value, value);
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
const renderCustomButtons = item => {
|
|
269
|
+
const renderFormItem = item => {
|
|
270
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
271
|
+
name: "id",
|
|
272
|
+
label: "id"
|
|
273
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
274
|
+
defaultValue: item.id
|
|
275
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
276
|
+
name: "text",
|
|
277
|
+
label: "text"
|
|
278
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
279
|
+
defaultValue: item.text
|
|
280
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
281
|
+
name: "tooltip",
|
|
282
|
+
label: "tooltip"
|
|
283
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
284
|
+
defaultValue: item.tooltip
|
|
285
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
286
|
+
name: "eventName",
|
|
287
|
+
label: "eventName"
|
|
288
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
289
|
+
defaultValue: item.eventName
|
|
290
|
+
})), /*#__PURE__*/_react.default.createElement(_IconSelectFormItem.IconSelectFormItem, {
|
|
291
|
+
name: "icon",
|
|
292
|
+
label: "icon"
|
|
293
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
294
|
+
name: "buttonType",
|
|
295
|
+
label: "buttonType"
|
|
296
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Select, {
|
|
297
|
+
defaultValue: item.buttonType
|
|
298
|
+
}, ButtonTypeEmun.map(item => /*#__PURE__*/_react.default.createElement(_antd.Select.Option, {
|
|
299
|
+
key: item,
|
|
300
|
+
value: item
|
|
301
|
+
}, item)))), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
302
|
+
name: "hide",
|
|
303
|
+
label: "hide"
|
|
304
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Switch, {
|
|
305
|
+
checked: item.hide
|
|
306
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
307
|
+
name: "disabled",
|
|
308
|
+
label: "disabled"
|
|
309
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Switch, {
|
|
310
|
+
checked: item.disabled
|
|
311
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
312
|
+
name: "isDivider",
|
|
313
|
+
label: "isDivider"
|
|
314
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Switch, {
|
|
315
|
+
checked: item.isDivider
|
|
316
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
317
|
+
name: "isDropdown",
|
|
318
|
+
label: "isDropdown"
|
|
319
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Switch, {
|
|
320
|
+
checked: item.isDropdown
|
|
321
|
+
})));
|
|
322
|
+
};
|
|
323
|
+
return item.mode === _interfaces.ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/_react.default.createElement(_ListEditor.ListEditor, {
|
|
324
|
+
name: item.name,
|
|
325
|
+
label: renderLabel(item),
|
|
326
|
+
required: item.required === _interfaces.Required.True,
|
|
327
|
+
value: brickProperties[item.name],
|
|
328
|
+
listItemKey: "text",
|
|
329
|
+
renderFormItem: renderFormItem,
|
|
330
|
+
getDefaultItem: value => ({
|
|
331
|
+
text: value
|
|
332
|
+
}),
|
|
333
|
+
onChange: value => {
|
|
334
|
+
form.setFieldsValue({
|
|
335
|
+
[item.name]: value
|
|
336
|
+
});
|
|
337
|
+
props.onValuesChange(value, value);
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
const renderEnumItem = (item, enumList) => {
|
|
342
|
+
return item.mode === _interfaces.ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
343
|
+
key: item.name,
|
|
344
|
+
label: renderLabel(item),
|
|
345
|
+
name: item.name,
|
|
346
|
+
rules: [{
|
|
347
|
+
required: item.required === _interfaces.Required.True,
|
|
348
|
+
message: `请输入${item.name}`
|
|
349
|
+
}]
|
|
350
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Select, {
|
|
351
|
+
options: enumList.map(item => ({
|
|
352
|
+
label: item,
|
|
353
|
+
value: item
|
|
354
|
+
}))
|
|
355
|
+
}));
|
|
356
|
+
};
|
|
184
357
|
const getFormItem = item => {
|
|
358
|
+
const type = item.type;
|
|
359
|
+
// todo(sailor): update unit text
|
|
360
|
+
if (/true|false/.test(type)) {
|
|
361
|
+
return renderBooleanItem(item);
|
|
362
|
+
}
|
|
363
|
+
if (type.indexOf("|") > 0) {
|
|
364
|
+
const emunList = type.replace(/"|'/g, "").split("|");
|
|
365
|
+
return renderEnumItem(item, emunList);
|
|
366
|
+
}
|
|
185
367
|
switch (item.type) {
|
|
186
368
|
case "string":
|
|
187
369
|
return renderStringItem(item);
|
|
@@ -198,6 +380,13 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
198
380
|
case "Menu":
|
|
199
381
|
case "SidebarSubMenu":
|
|
200
382
|
return renderMenuItem(item);
|
|
383
|
+
// todo(sailor): update unit text
|
|
384
|
+
case "GeneralOption[]":
|
|
385
|
+
return renderGeneralOptipns(item);
|
|
386
|
+
case "CustomColumn[]":
|
|
387
|
+
return renderCustomColumn(item);
|
|
388
|
+
case "CustomButton[]":
|
|
389
|
+
return renderCustomButtons(item);
|
|
201
390
|
default:
|
|
202
391
|
return renderCodeEditorItem(item);
|
|
203
392
|
}
|
|
@@ -217,7 +406,13 @@ function LegacyVisualPropertyForm(props, ref) {
|
|
|
217
406
|
imageStyle: emptyConfig === null || emptyConfig === void 0 ? void 0 : emptyConfig.imageStyle
|
|
218
407
|
}) : /*#__PURE__*/_react.default.createElement(_antd.Form, {
|
|
219
408
|
name: "propertyForm",
|
|
220
|
-
layout: "
|
|
409
|
+
layout: "horizontal",
|
|
410
|
+
labelAlign: "left",
|
|
411
|
+
labelCol: {
|
|
412
|
+
style: {
|
|
413
|
+
minWidth: "120px"
|
|
414
|
+
}
|
|
415
|
+
},
|
|
221
416
|
form: form,
|
|
222
417
|
onValuesChange: props.onValuesChange,
|
|
223
418
|
initialValues: (0, _processor.calculateValue)(propertyTypeList, brickProperties, typeList)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisualPropertyForm.js","names":["LegacyVisualPropertyForm","props","ref","theme","useCurrentTheme","projectId","labelIcon","propertyTypeList","brickProperties","brickInfo","emptyConfig","hiddenPropsCategory","menuSettingClick","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","getFormItem","renderOthersItem","OTHER_FORM_ITEM_FIELD","Infinity","isEmpty","empty","Empty","PRESENTED_IMAGE_SIMPLE","imageStyle","onValuesChange","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 Radio,\n Select,\n Tooltip,\n Collapse,\n Empty,\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 { 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\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}\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 } = 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 <Radio.Group>\n <Radio value={true}>true</Radio>\n <Radio value={false}>false</Radio>\n </Radio.Group>\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 getFormItem = (item: PropertyType): React.ReactElement => {\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 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=\"vertical\"\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;AAWA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAMA;AAEA;AA0BO,SAASA,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;EACF,CAAC,GAAGX,KAAK;EACT,MAAM,CAACY,IAAI,CAAC,GAAGC,UAAI,CAACC,OAAO,EAAE;EAC7B,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EACtC,IAAAC,0BAAe,EAACZ,gBAAgB,EAAEC,eAAe,CAAC,CACnD;EAED,IAAAY,0BAAmB,EAAClB,GAAG,EAAE,OAAO;IAC9BmB,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,IAAAE,gBAAS,EAAC,MAAM;IACd,MAAMC,WAAW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uBW,GAAG,CAAC,CAAC,CAACgE,QAAQ,EAAEC,IAAI,CAAC,EAAErD,KAAK,KAAK;IACvD,oBACE,6BAAC,cAAQ,CAAC,KAAK;MACb,MAAM,EAAE,IAAAsD,kBAAU,EAACF,QAAQ,CAAE;MAC7B,GAAG,EAAEpD,KAAM;MACX,WAAW,EAAE;IAAK,GAEjBqD,IAAI,CAACjE,GAAG,CAAEC,IAAI,IAAKmD,WAAW,CAACnD,IAAI,CAAC,CAAC,CACvB;EAErB,CAAC,CAAC,eAEF,6BAAC,cAAQ,CAAC,KAAK;IACb,SAAS,EAAE8B,iCAAM,CAACoC,UAAW;IAC7B,WAAW,EAAE,IAAK;IAClB,MAAM,EAAE,IAAAD,kBAAU,EAACZ,+BAAqB,CAAE;IAC1C,GAAG,EAAEA;EAAsB,GAE1BD,gBAAgB,EAAE,CACJ,CACR,gBAEX,4DACGhE,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEW,GAAG,CAAEC,IAAI,IAAK;IACvB,OAAOmD,WAAW,CAACnD,IAAI,CAAC;EAC1B,CAAC,CAAC,eACF;IAAK,SAAS,EAAE8B,iCAAM,CAACoC;EAAW,GAAEd,gBAAgB,EAAE,CAAO,CAEhE,CAEJ;AACH;AAEO,MAAMe,kBAAkB,gBAAGC,cAAK,CAACC,UAAU,CAACjG,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","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);\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,IA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E,IAAAC,sBAAW,EAAC5G,QAAQ,CAAC,iDAArB,aAAuBW,GAAG,CAAC,CAAC,CAACkG,QAAQ,EAAEC,IAAI,CAAC,EAAEvF,KAAK,KAAK;IACvD,oBACE,6BAAC,cAAQ,CAAC,KAAK;MACb,MAAM,EAAE,IAAAwF,kBAAU,EAACF,QAAQ,CAAE;MAC7B,GAAG,EAAEtF,KAAM;MACX,WAAW,EAAE;IAAK,GAEjBuF,IAAI,CAACnG,GAAG,CAAEC,IAAI,IAAKgF,WAAW,CAAChF,IAAI,CAAC,CAAC,CACvB;EAErB,CAAC,CAAC,eAEF,6BAAC,cAAQ,CAAC,KAAK;IACb,SAAS,EAAE8B,iCAAM,CAACsE,UAAW;IAC7B,WAAW,EAAE,IAAK;IAClB,MAAM,EAAE,IAAAD,kBAAU,EAACb,+BAAqB,CAAE;IAC1C,GAAG,EAAEA;EAAsB,GAE1BD,gBAAgB,EAAE,CACJ,CACR,gBAEX,4DACGjG,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEW,GAAG,CAAEC,IAAI,IAAK;IACvB,OAAOgF,WAAW,CAAChF,IAAI,CAAC;EAC1B,CAAC,CAAC,eACF;IAAK,SAAS,EAAE8B,iCAAM,CAACsE;EAAW,GAAEf,gBAAgB,EAAE,CAAO,CAEhE,CAEJ;AACH;AAEO,MAAMgB,kBAAkB,gBAAGC,cAAK,CAACC,UAAU,CAACpI,wBAAwB,CAAC;AAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ListEditor = ListEditor;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _basicComponents = require("@next-libs/basic-components");
|
|
11
|
+
var _antd = require("antd");
|
|
12
|
+
var _ListEditorModule = _interopRequireDefault(require("./ListEditor.module.css"));
|
|
13
|
+
const COLUMN_KEY = Symbol.for("column_key");
|
|
14
|
+
let key = 0;
|
|
15
|
+
function ListEditor({
|
|
16
|
+
name,
|
|
17
|
+
label,
|
|
18
|
+
value,
|
|
19
|
+
required,
|
|
20
|
+
listItemKey,
|
|
21
|
+
getDefaultItem,
|
|
22
|
+
renderFormItem,
|
|
23
|
+
onChange
|
|
24
|
+
}) {
|
|
25
|
+
const [list, setList] = (0, _react.useState)((value !== null && value !== void 0 ? value : []).map(item => ({
|
|
26
|
+
...item,
|
|
27
|
+
[COLUMN_KEY]: ++key
|
|
28
|
+
})));
|
|
29
|
+
const handleRemoveItem = (0, _react.useCallback)((e, item) => {
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
const key = item[COLUMN_KEY];
|
|
32
|
+
const newList = list.filter(item => item[COLUMN_KEY] !== key);
|
|
33
|
+
setList(newList);
|
|
34
|
+
}, [list]);
|
|
35
|
+
const handleAddListItem = () => {
|
|
36
|
+
key++;
|
|
37
|
+
const defaultValue = `newItem(${list.length})`;
|
|
38
|
+
const newColumn = list.concat([{
|
|
39
|
+
...getDefaultItem(defaultValue),
|
|
40
|
+
[COLUMN_KEY]: key
|
|
41
|
+
}]);
|
|
42
|
+
setList(newColumn);
|
|
43
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newColumn);
|
|
44
|
+
};
|
|
45
|
+
const renderListForm = (0, _react.useCallback)(item => {
|
|
46
|
+
const handleOnValuesChange = changeValues => {
|
|
47
|
+
const key = item[COLUMN_KEY];
|
|
48
|
+
const newList = list.map(item => {
|
|
49
|
+
if (item[COLUMN_KEY] === key) {
|
|
50
|
+
item = {
|
|
51
|
+
...item,
|
|
52
|
+
...changeValues
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return item;
|
|
56
|
+
});
|
|
57
|
+
setList(newList);
|
|
58
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newList);
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Form, {
|
|
61
|
+
layout: "horizontal",
|
|
62
|
+
labelAlign: "left",
|
|
63
|
+
labelCol: {
|
|
64
|
+
style: {
|
|
65
|
+
minWidth: "112px"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
onValuesChange: handleOnValuesChange
|
|
69
|
+
}, renderFormItem(item));
|
|
70
|
+
}, [list, onChange, renderFormItem]);
|
|
71
|
+
const renderListContent = (0, _react.useMemo)(() => {
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
+
className: _ListEditorModule.default.listContent
|
|
74
|
+
}, list.length ? list.map((item, index) => {
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Popover, {
|
|
76
|
+
key: index,
|
|
77
|
+
overlayStyle: {
|
|
78
|
+
zIndex: 999
|
|
79
|
+
},
|
|
80
|
+
content: renderListForm(item),
|
|
81
|
+
title: "Detail",
|
|
82
|
+
trigger: "click",
|
|
83
|
+
placement: "left"
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
className: _ListEditorModule.default.listItem
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, item[listItemKey]), /*#__PURE__*/_react.default.createElement("span", {
|
|
87
|
+
onClick: e => handleRemoveItem(e, item)
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement(_basicComponents.GeneralIcon, {
|
|
89
|
+
icon: {
|
|
90
|
+
lib: "easyops",
|
|
91
|
+
category: "assets-inventory",
|
|
92
|
+
icon: "out",
|
|
93
|
+
color: "red"
|
|
94
|
+
},
|
|
95
|
+
style: {
|
|
96
|
+
padding: "2px",
|
|
97
|
+
border: "1px solid",
|
|
98
|
+
borderRadius: "50%"
|
|
99
|
+
}
|
|
100
|
+
}))));
|
|
101
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
+
className: _ListEditorModule.default.listEmptyItem
|
|
103
|
+
}, "No data"));
|
|
104
|
+
}, [list, renderListForm, listItemKey, handleRemoveItem]);
|
|
105
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
106
|
+
className: _ListEditorModule.default.listContainer
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
108
|
+
key: name,
|
|
109
|
+
name: name,
|
|
110
|
+
label: label,
|
|
111
|
+
rules: [{
|
|
112
|
+
required: required,
|
|
113
|
+
message: `请输入${name}`
|
|
114
|
+
}]
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
+
className: _ListEditorModule.default.listTitle
|
|
117
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, "List"), /*#__PURE__*/_react.default.createElement("span", {
|
|
118
|
+
className: _ListEditorModule.default.listActionContainer
|
|
119
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
120
|
+
onClick: () => {
|
|
121
|
+
setList([]);
|
|
122
|
+
onChange([]);
|
|
123
|
+
}
|
|
124
|
+
}, "Clear"), /*#__PURE__*/_react.default.createElement("span", {
|
|
125
|
+
className: _ListEditorModule.default.listAddItem,
|
|
126
|
+
onClick: handleAddListItem
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement(_basicComponents.GeneralIcon, {
|
|
128
|
+
icon: {
|
|
129
|
+
lib: "easyops",
|
|
130
|
+
category: "assets-inventory",
|
|
131
|
+
icon: "xin",
|
|
132
|
+
color: "blue"
|
|
133
|
+
},
|
|
134
|
+
style: {
|
|
135
|
+
marginRight: "4px"
|
|
136
|
+
}
|
|
137
|
+
}), "Add"))), /*#__PURE__*/_react.default.createElement("div", {
|
|
138
|
+
className: _ListEditorModule.default.listContent
|
|
139
|
+
}, renderListContent)));
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=ListEditor.js.map
|
|
@@ -0,0 +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","newColumn","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 },\n [list]\n );\n\n const handleAddListItem = (): void => {\n key++;\n const defaultValue = `newItem(${list.length})`;\n const newColumn = list.concat([\n { ...getDefaultItem(defaultValue), [COLUMN_KEY]: key },\n ]);\n setList(newColumn);\n onChange?.(newColumn);\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,CA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,EAAElB,yBAAM,CAACC;EAAY,GAAEH,iBAAiB,CAAO,CACnD,CACR;AAEV"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
2
|
import React, { useEffect, useImperativeHandle, useState } from "react";
|
|
3
|
-
import { Form, Input, InputNumber,
|
|
3
|
+
import { Form, Input, InputNumber, Select, Tooltip, Collapse, Empty, Switch, AutoComplete } from "antd";
|
|
4
4
|
import { useCurrentTheme } from "@next-core/brick-kit";
|
|
5
5
|
import { GeneralIcon } from "@next-libs/basic-components";
|
|
6
6
|
import update from "immutability-helper";
|
|
@@ -10,11 +10,13 @@ import { CodeEditorFormItem } from "./components/CodeEditor/CodeEditorFormItem";
|
|
|
10
10
|
import { IconSelectFormItem } from "./components/IconSelect/IconSelectFormItem";
|
|
11
11
|
import { ColorEditorItem } from "./components/ColorEditor/ColorEditorItem";
|
|
12
12
|
import { MenuEditorItem } from "./components/MenuEditor/MenuEditorItem";
|
|
13
|
+
import { ListEditor } from "./components/ListEditor/ListEditor";
|
|
13
14
|
import { ReactComponent as DarkEmpty } from "./images/empty-dark.svg";
|
|
14
15
|
import { mergeProperties, calculateValue, groupByType, yamlStringify } from "./processor";
|
|
15
16
|
import { OTHER_FORM_ITEM_FIELD, supportMenuType } from "./constant";
|
|
16
17
|
import { matchNoramlMenuValue } from "./processor";
|
|
17
18
|
import { ItemModeType, Required } from "../interfaces";
|
|
19
|
+
var ButtonTypeEmun = ["link", "default", "primary", "ghost", "dashed", "icon", "text"];
|
|
18
20
|
export function LegacyVisualPropertyForm(props, ref) {
|
|
19
21
|
var _groupByType;
|
|
20
22
|
var theme = useCurrentTheme();
|
|
@@ -26,7 +28,8 @@ export function LegacyVisualPropertyForm(props, ref) {
|
|
|
26
28
|
brickInfo,
|
|
27
29
|
emptyConfig,
|
|
28
30
|
hiddenPropsCategory,
|
|
29
|
-
menuSettingClick
|
|
31
|
+
menuSettingClick,
|
|
32
|
+
childMountPointList
|
|
30
33
|
} = props;
|
|
31
34
|
var [form] = Form.useForm();
|
|
32
35
|
var [typeList, setTypeList] = useState(mergeProperties(propertyTypeList, brickProperties));
|
|
@@ -114,11 +117,7 @@ export function LegacyVisualPropertyForm(props, ref) {
|
|
|
114
117
|
required: item.required === Required.True,
|
|
115
118
|
message: "\u8BF7\u8F93\u5165".concat(item.name)
|
|
116
119
|
}]
|
|
117
|
-
}, /*#__PURE__*/React.createElement(
|
|
118
|
-
value: true
|
|
119
|
-
}, "true"), /*#__PURE__*/React.createElement(Radio, {
|
|
120
|
-
value: false
|
|
121
|
-
}, "false")));
|
|
120
|
+
}, /*#__PURE__*/React.createElement(Switch, null));
|
|
122
121
|
};
|
|
123
122
|
var renderInputNumberItem = item => {
|
|
124
123
|
return item.mode === ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -173,7 +172,190 @@ export function LegacyVisualPropertyForm(props, ref) {
|
|
|
173
172
|
menuSettingClick: menuSettingClick
|
|
174
173
|
});
|
|
175
174
|
};
|
|
175
|
+
var renderGeneralOptipns = item => {
|
|
176
|
+
var renderFormItem = item => {
|
|
177
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
178
|
+
name: "label",
|
|
179
|
+
label: "label"
|
|
180
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
181
|
+
defaultValue: item.label
|
|
182
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
183
|
+
name: "value",
|
|
184
|
+
label: "value"
|
|
185
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
186
|
+
defaultValue: item.value
|
|
187
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
188
|
+
name: "disabled",
|
|
189
|
+
label: "disabled"
|
|
190
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
191
|
+
checked: item.disabled
|
|
192
|
+
})));
|
|
193
|
+
};
|
|
194
|
+
return item.mode === ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/React.createElement(ListEditor, {
|
|
195
|
+
name: item.name,
|
|
196
|
+
label: renderLabel(item),
|
|
197
|
+
required: item.required === Required.True,
|
|
198
|
+
value: brickProperties[item.name],
|
|
199
|
+
listItemKey: "label",
|
|
200
|
+
renderFormItem: renderFormItem,
|
|
201
|
+
getDefaultItem: value => ({
|
|
202
|
+
label: value,
|
|
203
|
+
value: value
|
|
204
|
+
}),
|
|
205
|
+
onChange: value => {
|
|
206
|
+
form.setFieldsValue({
|
|
207
|
+
[item.name]: value
|
|
208
|
+
});
|
|
209
|
+
props.onValuesChange(value, value);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
var renderCustomColumn = item => {
|
|
214
|
+
var renderFormItem = item => {
|
|
215
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
216
|
+
name: "dataIndex",
|
|
217
|
+
label: "dataIndex"
|
|
218
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
219
|
+
defaultValue: item.dataIndex
|
|
220
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
221
|
+
name: "key",
|
|
222
|
+
label: "key"
|
|
223
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
224
|
+
defaultValue: item.key
|
|
225
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
226
|
+
name: "title",
|
|
227
|
+
label: "title"
|
|
228
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
229
|
+
defaultValue: item.title
|
|
230
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
231
|
+
name: "useChildren",
|
|
232
|
+
label: "useChildren",
|
|
233
|
+
tooltip: "useBrick\u4EE3\u66FF\u7528\u6CD5,\u6570\u636E\u6765\u6E90\u4E8E\u5B50\u63D2\u69FD\u540D\u79F0,\u5E76\u4E14\u63D2\u69FD\u540D\u79F0\u5FC5\u987B\u4F7F\u7528'[]'\u5305\u88F9"
|
|
234
|
+
}, /*#__PURE__*/React.createElement(AutoComplete, {
|
|
235
|
+
defaultValue: item.useChildren,
|
|
236
|
+
dataSource: (childMountPointList !== null && childMountPointList !== void 0 ? childMountPointList : []).filter(item => item.startsWith("[") && item.endsWith("]")),
|
|
237
|
+
filterOption: (inputValue, option) => option.props.children.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
|
|
238
|
+
})));
|
|
239
|
+
};
|
|
240
|
+
return item.mode === ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/React.createElement(ListEditor, {
|
|
241
|
+
name: item.name,
|
|
242
|
+
label: renderLabel(item),
|
|
243
|
+
required: item.required === Required.True,
|
|
244
|
+
value: brickProperties[item.name],
|
|
245
|
+
listItemKey: "title",
|
|
246
|
+
getDefaultItem: value => ({
|
|
247
|
+
dataIndex: value,
|
|
248
|
+
title: value,
|
|
249
|
+
key: value
|
|
250
|
+
}),
|
|
251
|
+
renderFormItem: renderFormItem,
|
|
252
|
+
onChange: value => {
|
|
253
|
+
form.setFieldsValue({
|
|
254
|
+
[item.name]: value
|
|
255
|
+
});
|
|
256
|
+
props.onValuesChange(value, value);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
var renderCustomButtons = item => {
|
|
261
|
+
var renderFormItem = item => {
|
|
262
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
263
|
+
name: "id",
|
|
264
|
+
label: "id"
|
|
265
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
266
|
+
defaultValue: item.id
|
|
267
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
268
|
+
name: "text",
|
|
269
|
+
label: "text"
|
|
270
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
271
|
+
defaultValue: item.text
|
|
272
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
273
|
+
name: "tooltip",
|
|
274
|
+
label: "tooltip"
|
|
275
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
276
|
+
defaultValue: item.tooltip
|
|
277
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
278
|
+
name: "eventName",
|
|
279
|
+
label: "eventName"
|
|
280
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
281
|
+
defaultValue: item.eventName
|
|
282
|
+
})), /*#__PURE__*/React.createElement(IconSelectFormItem, {
|
|
283
|
+
name: "icon",
|
|
284
|
+
label: "icon"
|
|
285
|
+
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
286
|
+
name: "buttonType",
|
|
287
|
+
label: "buttonType"
|
|
288
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
289
|
+
defaultValue: item.buttonType
|
|
290
|
+
}, ButtonTypeEmun.map(item => /*#__PURE__*/React.createElement(Select.Option, {
|
|
291
|
+
key: item,
|
|
292
|
+
value: item
|
|
293
|
+
}, item)))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
294
|
+
name: "hide",
|
|
295
|
+
label: "hide"
|
|
296
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
297
|
+
checked: item.hide
|
|
298
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
299
|
+
name: "disabled",
|
|
300
|
+
label: "disabled"
|
|
301
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
302
|
+
checked: item.disabled
|
|
303
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
304
|
+
name: "isDivider",
|
|
305
|
+
label: "isDivider"
|
|
306
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
307
|
+
checked: item.isDivider
|
|
308
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
309
|
+
name: "isDropdown",
|
|
310
|
+
label: "isDropdown"
|
|
311
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
312
|
+
checked: item.isDropdown
|
|
313
|
+
})));
|
|
314
|
+
};
|
|
315
|
+
return item.mode === ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/React.createElement(ListEditor, {
|
|
316
|
+
name: item.name,
|
|
317
|
+
label: renderLabel(item),
|
|
318
|
+
required: item.required === Required.True,
|
|
319
|
+
value: brickProperties[item.name],
|
|
320
|
+
listItemKey: "text",
|
|
321
|
+
renderFormItem: renderFormItem,
|
|
322
|
+
getDefaultItem: value => ({
|
|
323
|
+
text: value
|
|
324
|
+
}),
|
|
325
|
+
onChange: value => {
|
|
326
|
+
form.setFieldsValue({
|
|
327
|
+
[item.name]: value
|
|
328
|
+
});
|
|
329
|
+
props.onValuesChange(value, value);
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
var renderEnumItem = (item, enumList) => {
|
|
334
|
+
return item.mode === ItemModeType.Advanced ? renderEditorItem(item) : /*#__PURE__*/React.createElement(Form.Item, {
|
|
335
|
+
key: item.name,
|
|
336
|
+
label: renderLabel(item),
|
|
337
|
+
name: item.name,
|
|
338
|
+
rules: [{
|
|
339
|
+
required: item.required === Required.True,
|
|
340
|
+
message: "\u8BF7\u8F93\u5165".concat(item.name)
|
|
341
|
+
}]
|
|
342
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
343
|
+
options: enumList.map(item => ({
|
|
344
|
+
label: item,
|
|
345
|
+
value: item
|
|
346
|
+
}))
|
|
347
|
+
}));
|
|
348
|
+
};
|
|
176
349
|
var getFormItem = item => {
|
|
350
|
+
var type = item.type;
|
|
351
|
+
// todo(sailor): update unit text
|
|
352
|
+
if (/true|false/.test(type)) {
|
|
353
|
+
return renderBooleanItem(item);
|
|
354
|
+
}
|
|
355
|
+
if (type.indexOf("|") > 0) {
|
|
356
|
+
var emunList = type.replace(/"|'/g, "").split("|");
|
|
357
|
+
return renderEnumItem(item, emunList);
|
|
358
|
+
}
|
|
177
359
|
switch (item.type) {
|
|
178
360
|
case "string":
|
|
179
361
|
return renderStringItem(item);
|
|
@@ -190,6 +372,13 @@ export function LegacyVisualPropertyForm(props, ref) {
|
|
|
190
372
|
case "Menu":
|
|
191
373
|
case "SidebarSubMenu":
|
|
192
374
|
return renderMenuItem(item);
|
|
375
|
+
// todo(sailor): update unit text
|
|
376
|
+
case "GeneralOption[]":
|
|
377
|
+
return renderGeneralOptipns(item);
|
|
378
|
+
case "CustomColumn[]":
|
|
379
|
+
return renderCustomColumn(item);
|
|
380
|
+
case "CustomButton[]":
|
|
381
|
+
return renderCustomButtons(item);
|
|
193
382
|
default:
|
|
194
383
|
return renderCodeEditorItem(item);
|
|
195
384
|
}
|
|
@@ -209,7 +398,13 @@ export function LegacyVisualPropertyForm(props, ref) {
|
|
|
209
398
|
imageStyle: emptyConfig === null || emptyConfig === void 0 ? void 0 : emptyConfig.imageStyle
|
|
210
399
|
}) : /*#__PURE__*/React.createElement(Form, {
|
|
211
400
|
name: "propertyForm",
|
|
212
|
-
layout: "
|
|
401
|
+
layout: "horizontal",
|
|
402
|
+
labelAlign: "left",
|
|
403
|
+
labelCol: {
|
|
404
|
+
style: {
|
|
405
|
+
minWidth: "120px"
|
|
406
|
+
}
|
|
407
|
+
},
|
|
213
408
|
form: form,
|
|
214
409
|
onValuesChange: props.onValuesChange,
|
|
215
410
|
initialValues: calculateValue(propertyTypeList, brickProperties, typeList)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisualPropertyForm.js","names":["React","useEffect","useImperativeHandle","useState","Form","Input","InputNumber","Radio","Select","Tooltip","Collapse","Empty","useCurrentTheme","GeneralIcon","update","isNil","pick","upperFirst","isEmpty","styles","CodeEditorFormItem","IconSelectFormItem","ColorEditorItem","MenuEditorItem","ReactComponent","DarkEmpty","mergeProperties","calculateValue","groupByType","yamlStringify","OTHER_FORM_ITEM_FIELD","supportMenuType","matchNoramlMenuValue","ItemModeType","Required","LegacyVisualPropertyForm","props","ref","theme","projectId","labelIcon","propertyTypeList","brickProperties","brickInfo","emptyConfig","hiddenPropsCategory","menuSettingClick","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","getFormItem","renderOthersItem","Infinity","empty","PRESENTED_IMAGE_SIMPLE","imageStyle","onValuesChange","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 Radio,\n Select,\n Tooltip,\n Collapse,\n Empty,\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 { 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\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}\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 } = 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 <Radio.Group>\n <Radio value={true}>true</Radio>\n <Radio value={false}>false</Radio>\n </Radio.Group>\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 getFormItem = (item: PropertyType): React.ReactElement => {\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 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=\"vertical\"\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,KAAK,EACLC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,KAAK,QACA,MAAM;AAEb,SAASC,eAAe,QAAQ,sBAAsB;AAEtD,SAASC,WAAW,QAAQ,6BAA6B;AACzD,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,KAAK,EAAEC,IAAI,EAAEC,UAA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;EAAe,mBACnE7E,WAAW,CAACqB,QAAQ,CAAC,iDAArB,aAAuBQ,GAAG,CAAC,OAAmBS,KAAK,KAAK;IAAA,IAA5B,CAACwC,QAAQ,EAAEC,IAAI,CAAC;IAC3C,oBACE,oBAAC,QAAQ,CAAC,KAAK;MACb,MAAM,EAAE1F,UAAU,CAACyF,QAAQ,CAAE;MAC7B,GAAG,EAAExC,KAAM;MACX,WAAW,EAAE;IAAK,GAEjByC,IAAI,CAAClD,GAAG,CAAEC,IAAI,IAAKwC,WAAW,CAACxC,IAAI,CAAC,CAAC,CACvB;EAErB,CAAC,CAAC,eAEF,oBAAC,QAAQ,CAAC,KAAK;IACb,SAAS,EAAEvC,MAAM,CAACyF,UAAW;IAC7B,WAAW,EAAE,IAAK;IAClB,MAAM,EAAE3F,UAAU,CAACa,qBAAqB,CAAE;IAC1C,GAAG,EAAEA;EAAsB,GAE1BqE,gBAAgB,EAAE,CACJ,CACR,gBAEX,0CACGlD,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEQ,GAAG,CAAEC,IAAI,IAAK;IACvB,OAAOwC,WAAW,CAACxC,IAAI,CAAC;EAC1B,CAAC,CAAC,eACF;IAAK,SAAS,EAAEvC,MAAM,CAACyF;EAAW,GAAET,gBAAgB,EAAE,CAAO,CAEhE,CAEJ;AACH;AAEA,OAAO,IAAMU,kBAAkB,gBAAG7G,KAAK,CAAC8G,UAAU,CAAC3E,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","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;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AAU,CAACc,qBAAqB,CAAE;IAC1C,GAAG,EAAEA;EAAsB,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"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import React, { useState, useCallback, useMemo } from "react";
|
|
3
|
+
import { GeneralIcon } from "@next-libs/basic-components";
|
|
4
|
+
import { Form, Popover } from "antd";
|
|
5
|
+
import styles from "./ListEditor.module.css";
|
|
6
|
+
var COLUMN_KEY = Symbol.for("column_key");
|
|
7
|
+
var key = 0;
|
|
8
|
+
export function ListEditor(_ref) {
|
|
9
|
+
var {
|
|
10
|
+
name,
|
|
11
|
+
label,
|
|
12
|
+
value,
|
|
13
|
+
required,
|
|
14
|
+
listItemKey,
|
|
15
|
+
getDefaultItem,
|
|
16
|
+
renderFormItem,
|
|
17
|
+
onChange
|
|
18
|
+
} = _ref;
|
|
19
|
+
var [list, setList] = useState((value !== null && value !== void 0 ? value : []).map(item => _objectSpread(_objectSpread({}, item), {}, {
|
|
20
|
+
[COLUMN_KEY]: ++key
|
|
21
|
+
})));
|
|
22
|
+
var handleRemoveItem = useCallback((e, item) => {
|
|
23
|
+
e.stopPropagation();
|
|
24
|
+
var key = item[COLUMN_KEY];
|
|
25
|
+
var newList = list.filter(item => item[COLUMN_KEY] !== key);
|
|
26
|
+
setList(newList);
|
|
27
|
+
}, [list]);
|
|
28
|
+
var handleAddListItem = () => {
|
|
29
|
+
key++;
|
|
30
|
+
var defaultValue = "newItem(".concat(list.length, ")");
|
|
31
|
+
var newColumn = list.concat([_objectSpread(_objectSpread({}, getDefaultItem(defaultValue)), {}, {
|
|
32
|
+
[COLUMN_KEY]: key
|
|
33
|
+
})]);
|
|
34
|
+
setList(newColumn);
|
|
35
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newColumn);
|
|
36
|
+
};
|
|
37
|
+
var renderListForm = useCallback(item => {
|
|
38
|
+
var handleOnValuesChange = changeValues => {
|
|
39
|
+
var key = item[COLUMN_KEY];
|
|
40
|
+
var newList = list.map(item => {
|
|
41
|
+
if (item[COLUMN_KEY] === key) {
|
|
42
|
+
item = _objectSpread(_objectSpread({}, item), changeValues);
|
|
43
|
+
}
|
|
44
|
+
return item;
|
|
45
|
+
});
|
|
46
|
+
setList(newList);
|
|
47
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newList);
|
|
48
|
+
};
|
|
49
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
50
|
+
layout: "horizontal",
|
|
51
|
+
labelAlign: "left",
|
|
52
|
+
labelCol: {
|
|
53
|
+
style: {
|
|
54
|
+
minWidth: "112px"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
onValuesChange: handleOnValuesChange
|
|
58
|
+
}, renderFormItem(item));
|
|
59
|
+
}, [list, onChange, renderFormItem]);
|
|
60
|
+
var renderListContent = useMemo(() => {
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: styles.listContent
|
|
63
|
+
}, list.length ? list.map((item, index) => {
|
|
64
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
65
|
+
key: index,
|
|
66
|
+
overlayStyle: {
|
|
67
|
+
zIndex: 999
|
|
68
|
+
},
|
|
69
|
+
content: renderListForm(item),
|
|
70
|
+
title: "Detail",
|
|
71
|
+
trigger: "click",
|
|
72
|
+
placement: "left"
|
|
73
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: styles.listItem
|
|
75
|
+
}, /*#__PURE__*/React.createElement("span", null, item[listItemKey]), /*#__PURE__*/React.createElement("span", {
|
|
76
|
+
onClick: e => handleRemoveItem(e, item)
|
|
77
|
+
}, /*#__PURE__*/React.createElement(GeneralIcon, {
|
|
78
|
+
icon: {
|
|
79
|
+
lib: "easyops",
|
|
80
|
+
category: "assets-inventory",
|
|
81
|
+
icon: "out",
|
|
82
|
+
color: "red"
|
|
83
|
+
},
|
|
84
|
+
style: {
|
|
85
|
+
padding: "2px",
|
|
86
|
+
border: "1px solid",
|
|
87
|
+
borderRadius: "50%"
|
|
88
|
+
}
|
|
89
|
+
}))));
|
|
90
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: styles.listEmptyItem
|
|
92
|
+
}, "No data"));
|
|
93
|
+
}, [list, renderListForm, listItemKey, handleRemoveItem]);
|
|
94
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: styles.listContainer
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
97
|
+
key: name,
|
|
98
|
+
name: name,
|
|
99
|
+
label: label,
|
|
100
|
+
rules: [{
|
|
101
|
+
required: required,
|
|
102
|
+
message: "\u8BF7\u8F93\u5165".concat(name)
|
|
103
|
+
}]
|
|
104
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: styles.listTitle
|
|
106
|
+
}, /*#__PURE__*/React.createElement("span", null, "List"), /*#__PURE__*/React.createElement("span", {
|
|
107
|
+
className: styles.listActionContainer
|
|
108
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
109
|
+
onClick: () => {
|
|
110
|
+
setList([]);
|
|
111
|
+
onChange([]);
|
|
112
|
+
}
|
|
113
|
+
}, "Clear"), /*#__PURE__*/React.createElement("span", {
|
|
114
|
+
className: styles.listAddItem,
|
|
115
|
+
onClick: handleAddListItem
|
|
116
|
+
}, /*#__PURE__*/React.createElement(GeneralIcon, {
|
|
117
|
+
icon: {
|
|
118
|
+
lib: "easyops",
|
|
119
|
+
category: "assets-inventory",
|
|
120
|
+
icon: "xin",
|
|
121
|
+
color: "blue"
|
|
122
|
+
},
|
|
123
|
+
style: {
|
|
124
|
+
marginRight: "4px"
|
|
125
|
+
}
|
|
126
|
+
}), "Add"))), /*#__PURE__*/React.createElement("div", {
|
|
127
|
+
className: styles.listContent
|
|
128
|
+
}, renderListContent)));
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=ListEditor.js.map
|
|
@@ -0,0 +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","newColumn","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 },\n [list]\n );\n\n const handleAddListItem = (): void => {\n key++;\n const defaultValue = `newItem(${list.length})`;\n const newColumn = list.concat([\n { ...getDefaultItem(defaultValue), [COLUMN_KEY]: key },\n ]);\n setList(newColumn);\n onChange?.(newColumn);\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,CAACc,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,EAAEQ,GAAG,CAAEC,IAAI,oCAClBA,IAAI;IACP,CAAChB,UAAU,GAAG,EAAEG;EAAG,EACnB,CAAC,CACJ;EAED,IAAMc,gBAAgB,GAAGvB,WAAW,CAClC,CAACwB,CAAmB,EAAEF,IAAS,KAAW;IACxCE,CAAC,CAACC,eAAe,EAAE;IACnB,IAAMhB,GAAG,GAAGa,IAAI,CAAChB,UAAU,CAAC;IAC5B,IAAMoB,OAAO,GAAGP,IAAI,CAACQ,MAAM,CAAEL,IAAI,IAAKA,IAAI,CAAChB,UAAU,CAAC,KAAKG,GAAG,CAAC;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,yCAAiB,eACjB;IAAM,SAAS,EAAEhD,MAAM,CAACiD;EAAoB,gBAC1C;IACE,OAAO,EAAE,MAAM;MACblC,OAAO,CAAC,EAAE,CAAC;MACXF,QAAQ,CAAC,EAAE,CAAC;IACd;EAAE,WAGG,eACP;IAAM,SAAS,EAAEb,MAAM,CAACkD,WAAY;IAAC,OAAO,EAAE3B;EAAkB,gBAC9D,oBAAC,WAAW;IACV,IAAI,EAAE;MACJe,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,EAAEnD,MAAM,CAACkC;EAAY,GAAED,iBAAiB,CAAO,CACnD,CACR;AAEV"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.listContainer {
|
|
2
|
+
display: "flex";
|
|
3
|
+
align-items: "center";
|
|
4
|
+
}
|
|
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
|
+
.listActionContainer {
|
|
19
|
+
display: flex;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.listActionContainer > span {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.listAddItem {
|
|
27
|
+
text-align: center;
|
|
28
|
+
margin-left: 8px;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
color: var(--theme-blue-color);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.listEmptyItem {
|
|
35
|
+
text-align: center;
|
|
36
|
+
outline-width: 1px;
|
|
37
|
+
outline-style: solid;
|
|
38
|
+
outline-offset: -1px;
|
|
39
|
+
outline-color: var(--antd-input-border-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.listItem {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
padding: 0 20px;
|
|
46
|
+
outline-width: 1px;
|
|
47
|
+
outline-style: solid;
|
|
48
|
+
outline-offset: -1px;
|
|
49
|
+
outline-color: var(--antd-input-border-color);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.listItem:hover {
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
background: rgba(0, 0, 0, 0.5);
|
|
55
|
+
}
|
|
@@ -3,6 +3,29 @@ import { EmptyProps } from "antd/lib/empty";
|
|
|
3
3
|
import { MenuIcon } from "@next-core/brick-types";
|
|
4
4
|
import { FormProps } from "antd/lib/form";
|
|
5
5
|
import { PropertyType, BrickProperties, visualFormUtils } from "../interfaces";
|
|
6
|
+
export declare type CustomColumn = {
|
|
7
|
+
dataIndex: string;
|
|
8
|
+
title: string;
|
|
9
|
+
useChildren?: string;
|
|
10
|
+
[k: string]: any;
|
|
11
|
+
};
|
|
12
|
+
export declare type GeneralOptionProps = {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare type CustomButtonProps = {
|
|
18
|
+
id: string;
|
|
19
|
+
buttonType: string;
|
|
20
|
+
eventName: string;
|
|
21
|
+
text: string;
|
|
22
|
+
tooltip: string;
|
|
23
|
+
icon: MenuIcon;
|
|
24
|
+
hide: boolean;
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
isDivider: boolean;
|
|
27
|
+
isDropdown: boolean;
|
|
28
|
+
};
|
|
6
29
|
export interface VisualPropertyFormProps {
|
|
7
30
|
projectId?: string;
|
|
8
31
|
propertyTypeList: PropertyType[];
|
|
@@ -18,6 +41,7 @@ export interface VisualPropertyFormProps {
|
|
|
18
41
|
emptyConfig?: EmptyProps;
|
|
19
42
|
menuSettingClick?: () => void;
|
|
20
43
|
hiddenPropsCategory?: boolean;
|
|
44
|
+
childMountPointList?: string[];
|
|
21
45
|
}
|
|
22
46
|
export declare function LegacyVisualPropertyForm(props: VisualPropertyFormProps, ref: React.Ref<visualFormUtils>): React.ReactElement;
|
|
23
47
|
export declare const VisualPropertyForm: React.ForwardRefExoticComponent<VisualPropertyFormProps & React.RefAttributes<visualFormUtils>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ListEditor {
|
|
3
|
+
name?: string;
|
|
4
|
+
label?: string | React.ReactElement;
|
|
5
|
+
value?: any[];
|
|
6
|
+
required?: boolean;
|
|
7
|
+
listItemKey: string;
|
|
8
|
+
getDefaultItem: (data: any) => Record<string, any>;
|
|
9
|
+
renderFormItem?: (data: any) => React.ReactElement;
|
|
10
|
+
onChange?: (data: any) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function ListEditor({ name, label, value, required, listItemKey, getDefaultItem, renderFormItem, onChange, }: ListEditor): React.ReactElement;
|
|
13
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-libs/visual-builder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.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",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"@types/react-color": "^3.0.6",
|
|
36
36
|
"react-color": "^2.19.3"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "b87814b2c11469b8a720c2745893b2d6847cae1d"
|
|
39
39
|
}
|