@kne/form-creator 0.1.18 → 0.1.19
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/README.md +74 -2
- package/dist/index.css +79 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +222 -59
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +236 -62
- package/dist/index.modern.js.map +1 -1
- package/dist/locale/en-US.js +4 -2
- package/dist/locale/en-US.js.map +1 -1
- package/dist/locale/en-US.modern.js +4 -2
- package/dist/locale/en-US.modern.js.map +1 -1
- package/dist/locale/zh-CN.js +4 -2
- package/dist/locale/zh-CN.js.map +1 -1
- package/dist/locale/zh-CN.modern.js +4 -2
- package/dist/locale/zh-CN.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var SelectList__default = /*#__PURE__*/_interopDefaultLegacy(SelectList);
|
|
|
23
23
|
var FormInfo__default = /*#__PURE__*/_interopDefaultLegacy(FormInfo);
|
|
24
24
|
var InfoPage__default = /*#__PURE__*/_interopDefaultLegacy(InfoPage);
|
|
25
25
|
|
|
26
|
-
var style = {"kne-responsive-boundary":"kne-form-creator_gh14z","kne-responsive-scroll":"kne-form-creator_Kfn6L","form-creator":"kne-form-creator_Xrjrk","editor-pane":"kne-form-creator_Skfuv","preview-pane":"kne-form-creator_v4Lsp","editor-header":"kne-form-creator_WaSS-","block-list-panel":"kne-form-creator_lx8An","form-actions-setting-btn":"kne-form-creator_NekU2","panel-toolbar":"kne-form-creator_t0WxZ","panel-toolbar-extra":"kne-form-creator_O22ZM","schema-content":"kne-form-creator_9bWOD","schema-content-file-list":"kne-form-creator_UGdXA","schema-content-file":"kne-form-creator_75EtE","schema-content-file-image":"kne-form-creator_P-be6","schema-content-file-name":"kne-form-creator_NXpTS","add-block-btn":"kne-form-creator_16Zre","add-inline-btn":"kne-form-creator_iCYdB","ant-btn-disabled":"kne-form-creator_LdGtv","block-list":"kne-form-creator_wK5eK","block-section":"kne-form-creator_15IiK","block-kind-formInfo":"kne-form-creator_D0hoK","block-kind-list":"kne-form-creator_JdPhy","block-kind-tableList":"kne-form-creator_gzd64","block-kind-multiField":"kne-form-creator_t0iOJ","block-kind-steps":"kne-form-creator_QNF9W","step-section":"kne-form-creator_22ajp","block-section-header":"kne-form-creator_wS4rL","block-header-left":"kne-form-creator_t4awC","block-title":"kne-form-creator_wSVJf","block-summary":"kne-form-creator_GzeW8","block-header-actions":"kne-form-creator_Ue-nT","block-body":"kne-form-creator_je1H0","item-blocks-section":"kne-form-creator_wq4bT","nested-block-list":"kne-form-creator_4NWH4","block-section-nested":"kne-form-creator_mUKom","add-field-dropdown":"kne-form-creator_9JS0d","add-field-dropdown-item":"kne-form-creator_Ql1z3","add-field-dropdown-item-icon":"kne-form-creator_ZHB5O","add-field-dropdown-item-desc":"kne-form-creator_dcsOS","add-field-dropdown-divider":"kne-form-creator_CUK0H","add-field-dropdown-label":"kne-form-creator_bPJ-2","section-toolbar":"kne-form-creator_LUO8S","section-toolbar-label":"kne-form-creator_7KQ79","field-list":"kne-form-creator_-B7WZ","step-list":"kne-form-creator_kc1pH","step-section-header":"kne-form-creator_wkhEX","step-section-title":"kne-form-creator_NBinE","step-section-actions":"kne-form-creator_es-FC","step-index":"kne-form-creator_CCKZZ","field-row":"kne-form-creator_XMkdt","field-row-index":"kne-form-creator_a-cDo","field-row-main":"kne-form-creator_ftlwp","inline-empty":"kne-form-creator_yP-RF","action-group":"kne-form-creator_773yo","hover-reveal":"kne-form-creator_S234h","hover-reveal-active":"kne-form-creator_AE-6r","action-btn":"kne-form-creator_mLgqh","add-block-dropdown":"kne-form-creator_vmS-e","add-block-option":"kne-form-creator_gjg2Y","add-block-option-icon":"kne-form-creator_qh1hh","add-block-option-text":"kne-form-creator_G8iJO","add-block-option-title":"kne-form-creator_ETSvm","add-block-option-desc":"kne-form-creator_O0C3l","field-empty":"kne-form-creator_Nmpfl","field-label-tips-icon":"kne-form-creator_0VVaO","preview-header":"kne-form-creator_c4BT0","preview-title":"kne-form-creator_fPkK4","preview-body":"kne-form-creator_6JntQ","schema-form":"kne-form-creator_MxCWP","schema-body":"kne-form-creator_q9ydz","schema-actions":"kne-form-creator_Y4eEH","schema-actions-inner":"kne-form-creator_FT9Zf","choice-block":"kne-form-creator_RllJe","choice-selector":"kne-form-creator_5A1eM","choice-panels":"kne-form-creator_IO0MY","choice-panels-empty":"kne-form-creator_T0nND","choice-option-panel":"kne-form-creator_FQixN","choice-option-panel-title":"kne-form-creator_ofRo2","choice-option-summary":"kne-form-creator_pksH8","field-editor-form":"kne-form-creator_PGPHL","form-actions-editor":"kne-form-creator_fchMy","form-actions-switch-field":"kne-form-creator_6JE9x","form-actions-layout-panel":"kne-form-creator_rtm9D","form-actions-align-group":"kne-form-creator_51ZsV","form-actions-layout-title":"kne-form-creator_hFeiC","form-actions-gap-slider":"kne-form-creator_Gq0bk","editor-section":"kne-form-creator_jJy85","section-divider":"kne-form-creator_zA7L-","rule-editor":"kne-form-creator_bAlGU","options-editor":"kne-form-creator_AK4yO","super-select-props":"kne-form-creator_Iawhh","field-props-editor":"kne-form-creator_Gabf2","columns-editor":"kne-form-creator_DQW1N","prop-row":"kne-form-creator_7K54P","prop-label":"kne-form-creator_HAAyH","options-item":"kne-form-creator_dnOd2","table-row-card":"kne-form-creator_cwCYp","tree-options-editor":"kne-form-creator_s3nHO","tree-options-list":"kne-form-creator_Djs-E","tree-option-node":"kne-form-creator_XAcut","tree-option-row":"kne-form-creator_4K4Rj","tree-option-fields":"kne-form-creator_-4cjc","tree-option-actions":"kne-form-creator_IjCNI","tree-option-children":"kne-form-creator_pVPGJ","tree-add-sibling":"kne-form-creator_bl46P","rule-checkbox-group":"kne-form-creator_tDgVP","rule-len-row":"kne-form-creator_ATsae","rule-len-input":"kne-form-creator_jY4Ld","rule-len-sep":"kne-form-creator_jBDC8","options-list":"kne-form-creator_GUBNS","options-row":"kne-form-creator_uohD0","options-tip":"kne-form-creator_vrTmK","icon-square-btn":"kne-form-creator_DZjCf","icon-square-btn-sm":"kne-form-creator_GAh-t","is-mobile":"kne-form-creator_LtgJz"};
|
|
26
|
+
var style = {"kne-responsive-boundary":"kne-form-creator_gh14z","kne-responsive-scroll":"kne-form-creator_Kfn6L","option-group-stack":"kne-form-creator_TgBT-","form-info-show-index":"kne-form-creator_rqCos","field-label-index":"kne-form-creator_MLY0O","field-label-main":"kne-form-creator_UOUb4","form-creator":"kne-form-creator_Xrjrk","editor-pane":"kne-form-creator_Skfuv","preview-pane":"kne-form-creator_v4Lsp","editor-header":"kne-form-creator_WaSS-","block-list-panel":"kne-form-creator_lx8An","form-actions-setting-btn":"kne-form-creator_NekU2","panel-toolbar":"kne-form-creator_t0WxZ","panel-toolbar-extra":"kne-form-creator_O22ZM","schema-content":"kne-form-creator_9bWOD","schema-content-fields":"kne-form-creator_EmRDV","schema-content-field":"kne-form-creator_0Lanz","schema-content-field-block":"kne-form-creator_TQd-w","schema-content-field-label":"kne-form-creator_czEK3","schema-content-field-value":"kne-form-creator_YFKTK","schema-content-file-list":"kne-form-creator_UGdXA","schema-content-file":"kne-form-creator_75EtE","schema-content-file-image":"kne-form-creator_P-be6","schema-content-file-name":"kne-form-creator_NXpTS","add-block-btn":"kne-form-creator_16Zre","add-inline-btn":"kne-form-creator_iCYdB","ant-btn-disabled":"kne-form-creator_LdGtv","block-list":"kne-form-creator_wK5eK","block-section":"kne-form-creator_15IiK","block-kind-formInfo":"kne-form-creator_D0hoK","block-kind-list":"kne-form-creator_JdPhy","block-kind-tableList":"kne-form-creator_gzd64","block-kind-multiField":"kne-form-creator_t0iOJ","block-kind-steps":"kne-form-creator_QNF9W","step-section":"kne-form-creator_22ajp","block-section-header":"kne-form-creator_wS4rL","block-header-left":"kne-form-creator_t4awC","block-title":"kne-form-creator_wSVJf","block-summary":"kne-form-creator_GzeW8","block-header-actions":"kne-form-creator_Ue-nT","block-body":"kne-form-creator_je1H0","item-blocks-section":"kne-form-creator_wq4bT","nested-block-list":"kne-form-creator_4NWH4","block-section-nested":"kne-form-creator_mUKom","add-field-dropdown":"kne-form-creator_9JS0d","add-field-dropdown-item":"kne-form-creator_Ql1z3","add-field-dropdown-item-icon":"kne-form-creator_ZHB5O","add-field-dropdown-item-desc":"kne-form-creator_dcsOS","add-field-dropdown-divider":"kne-form-creator_CUK0H","add-field-dropdown-label":"kne-form-creator_bPJ-2","section-toolbar":"kne-form-creator_LUO8S","section-toolbar-label":"kne-form-creator_7KQ79","field-list":"kne-form-creator_-B7WZ","step-list":"kne-form-creator_kc1pH","step-section-header":"kne-form-creator_wkhEX","step-section-title":"kne-form-creator_NBinE","step-section-actions":"kne-form-creator_es-FC","step-index":"kne-form-creator_CCKZZ","field-row":"kne-form-creator_XMkdt","field-row-index":"kne-form-creator_a-cDo","field-row-main":"kne-form-creator_ftlwp","inline-empty":"kne-form-creator_yP-RF","action-group":"kne-form-creator_773yo","hover-reveal":"kne-form-creator_S234h","hover-reveal-active":"kne-form-creator_AE-6r","action-btn":"kne-form-creator_mLgqh","add-block-dropdown":"kne-form-creator_vmS-e","add-block-option":"kne-form-creator_gjg2Y","add-block-option-icon":"kne-form-creator_qh1hh","add-block-option-text":"kne-form-creator_G8iJO","add-block-option-title":"kne-form-creator_ETSvm","add-block-option-desc":"kne-form-creator_O0C3l","field-empty":"kne-form-creator_Nmpfl","field-label-tips-icon":"kne-form-creator_0VVaO","preview-header":"kne-form-creator_c4BT0","preview-title":"kne-form-creator_fPkK4","preview-body":"kne-form-creator_6JntQ","schema-form":"kne-form-creator_MxCWP","schema-body":"kne-form-creator_q9ydz","schema-actions":"kne-form-creator_Y4eEH","schema-actions-inner":"kne-form-creator_FT9Zf","choice-block":"kne-form-creator_RllJe","choice-selector":"kne-form-creator_5A1eM","choice-panels":"kne-form-creator_IO0MY","choice-panels-empty":"kne-form-creator_T0nND","choice-option-panel":"kne-form-creator_FQixN","choice-option-panel-title":"kne-form-creator_ofRo2","choice-option-summary":"kne-form-creator_pksH8","field-editor-form":"kne-form-creator_PGPHL","form-actions-editor":"kne-form-creator_fchMy","form-actions-switch-field":"kne-form-creator_6JE9x","form-actions-layout-panel":"kne-form-creator_rtm9D","form-actions-align-group":"kne-form-creator_51ZsV","form-actions-layout-title":"kne-form-creator_hFeiC","form-actions-gap-slider":"kne-form-creator_Gq0bk","editor-section":"kne-form-creator_jJy85","section-divider":"kne-form-creator_zA7L-","rule-editor":"kne-form-creator_bAlGU","options-editor":"kne-form-creator_AK4yO","super-select-props":"kne-form-creator_Iawhh","field-props-editor":"kne-form-creator_Gabf2","columns-editor":"kne-form-creator_DQW1N","prop-row":"kne-form-creator_7K54P","prop-label":"kne-form-creator_HAAyH","options-item":"kne-form-creator_dnOd2","table-row-card":"kne-form-creator_cwCYp","tree-options-editor":"kne-form-creator_s3nHO","tree-options-list":"kne-form-creator_Djs-E","tree-option-node":"kne-form-creator_XAcut","tree-option-row":"kne-form-creator_4K4Rj","tree-option-fields":"kne-form-creator_-4cjc","tree-option-actions":"kne-form-creator_IjCNI","tree-option-children":"kne-form-creator_pVPGJ","tree-add-sibling":"kne-form-creator_bl46P","rule-checkbox-group":"kne-form-creator_tDgVP","rule-len-row":"kne-form-creator_ATsae","rule-len-input":"kne-form-creator_jY4Ld","rule-len-sep":"kne-form-creator_jBDC8","options-list":"kne-form-creator_GUBNS","options-row":"kne-form-creator_uohD0","options-tip":"kne-form-creator_vrTmK","icon-square-btn":"kne-form-creator_DZjCf","icon-square-btn-sm":"kne-form-creator_GAh-t","is-mobile":"kne-form-creator_LtgJz"};
|
|
27
27
|
|
|
28
28
|
const locale$1 = {
|
|
29
29
|
addField: '添加填写项',
|
|
@@ -89,6 +89,7 @@ const locale$1 = {
|
|
|
89
89
|
blockNameRequired: '请填写保存用的名称',
|
|
90
90
|
blockGap: '间距',
|
|
91
91
|
blockBordered: '显示边框',
|
|
92
|
+
blockShowIndex: '展示题目序号',
|
|
92
93
|
blockImportant: '突出显示',
|
|
93
94
|
blockAddText: '添加按钮文案',
|
|
94
95
|
blockAddTextPlaceholder: '例如:添加一条工作经历',
|
|
@@ -177,8 +178,8 @@ const locale$1 = {
|
|
|
177
178
|
optionDescPlaceholder: '补充说明(可选)',
|
|
178
179
|
addOption: '添加一个选项',
|
|
179
180
|
builtinDataHint: '该类型自带数据,无需手动配置选项',
|
|
180
|
-
optionsEditorHint: '
|
|
181
|
-
optionsTreeEditorHint: '
|
|
181
|
+
optionsEditorHint: '显示文字默认同步到对应值,可自行修改;保存时会去掉首尾空格',
|
|
182
|
+
optionsTreeEditorHint: '显示文字默认同步到对应值,可自行修改;点「添加子级」挂下级,左侧竖线表示层级',
|
|
182
183
|
addChildOption: '添加子级',
|
|
183
184
|
fieldColumns: '表格有哪些列',
|
|
184
185
|
columnTitlePlaceholder: '列标题,例如:姓名',
|
|
@@ -230,6 +231,7 @@ const locale$1 = {
|
|
|
230
231
|
propSwitchOffText: '关闭时显示的文字',
|
|
231
232
|
propSwitchOnTextHint: '例如:开',
|
|
232
233
|
propSwitchOffTextHint: '例如:关',
|
|
234
|
+
propOptionsInline: '选项单行显示',
|
|
233
235
|
ruleLen: '长度限制',
|
|
234
236
|
ruleLenRange: '长度范围',
|
|
235
237
|
ruleLenMin: '最少字数',
|
|
@@ -313,6 +315,7 @@ const locale = {
|
|
|
313
315
|
blockNameRequired: 'Please enter a save name',
|
|
314
316
|
blockGap: 'Spacing',
|
|
315
317
|
blockBordered: 'Show Border',
|
|
318
|
+
blockShowIndex: 'Show question numbers',
|
|
316
319
|
blockImportant: 'Highlight',
|
|
317
320
|
blockAddText: 'Add Button Label',
|
|
318
321
|
blockAddTextPlaceholder: 'e.g. Add Work Experience',
|
|
@@ -401,8 +404,8 @@ const locale = {
|
|
|
401
404
|
optionDescPlaceholder: 'Description (optional)',
|
|
402
405
|
addOption: 'Add Option',
|
|
403
406
|
builtinDataHint: 'This type comes with built-in data, no manual options needed',
|
|
404
|
-
optionsEditorHint: '
|
|
405
|
-
optionsTreeEditorHint: '
|
|
407
|
+
optionsEditorHint: 'Display text syncs to value by default; you can edit value anytime. Leading/trailing spaces are trimmed on save',
|
|
408
|
+
optionsTreeEditorHint: 'Display text syncs to value by default; use “Add Child” for nesting; the left line shows hierarchy',
|
|
406
409
|
addChildOption: 'Add Child',
|
|
407
410
|
fieldColumns: 'Table Columns',
|
|
408
411
|
columnTitlePlaceholder: 'Column title, e.g. Name',
|
|
@@ -454,6 +457,7 @@ const locale = {
|
|
|
454
457
|
propSwitchOffText: 'Text when off',
|
|
455
458
|
propSwitchOnTextHint: 'e.g. On',
|
|
456
459
|
propSwitchOffTextHint: 'e.g. Off',
|
|
460
|
+
propOptionsInline: 'Options in a single row',
|
|
457
461
|
ruleLen: 'Length Limit',
|
|
458
462
|
ruleLenRange: 'Length Range',
|
|
459
463
|
ruleLenMin: 'Min',
|
|
@@ -606,6 +610,7 @@ const createBlock = function (kind, overrides) {
|
|
|
606
610
|
gap: 24,
|
|
607
611
|
bordered: false,
|
|
608
612
|
important: false,
|
|
613
|
+
showIndex: false,
|
|
609
614
|
name: needsName ? createDataKey(kind === 'object' ? 'obj' : 'block') : '',
|
|
610
615
|
label: '',
|
|
611
616
|
addText: '',
|
|
@@ -1318,6 +1323,7 @@ const blockToFormValues = block => ({
|
|
|
1318
1323
|
gap: block.gap ?? 24,
|
|
1319
1324
|
bordered: !!block.bordered,
|
|
1320
1325
|
important: !!block.important,
|
|
1326
|
+
showIndex: !!block.showIndex,
|
|
1321
1327
|
name: block.name || '',
|
|
1322
1328
|
label: block.label || '',
|
|
1323
1329
|
addText: block.addText || '',
|
|
@@ -1344,6 +1350,7 @@ const formValuesToBlock = function (values, existingBlock) {
|
|
|
1344
1350
|
gap: values.gap ?? 24,
|
|
1345
1351
|
bordered: !!values.bordered,
|
|
1346
1352
|
important: !!values.important,
|
|
1353
|
+
showIndex: !!values.showIndex,
|
|
1347
1354
|
name: values.name,
|
|
1348
1355
|
label: values.label,
|
|
1349
1356
|
addText: values.addText || undefined,
|
|
@@ -1761,18 +1768,22 @@ defineField('RadioGroup', {
|
|
|
1761
1768
|
labelId: 'FieldTypeRadioGroup',
|
|
1762
1769
|
component: reactFormAntd.RadioGroup,
|
|
1763
1770
|
defaultProps: {
|
|
1764
|
-
options: []
|
|
1771
|
+
options: [],
|
|
1772
|
+
inline: true
|
|
1765
1773
|
},
|
|
1766
1774
|
hasOptions: true,
|
|
1775
|
+
hasFieldProps: true,
|
|
1767
1776
|
valueSchema: stringWithEnumSchema
|
|
1768
1777
|
});
|
|
1769
1778
|
defineField('CheckboxGroup', {
|
|
1770
1779
|
labelId: 'FieldTypeCheckboxGroup',
|
|
1771
1780
|
component: reactFormAntd.CheckboxGroup,
|
|
1772
1781
|
defaultProps: {
|
|
1773
|
-
options: []
|
|
1782
|
+
options: [],
|
|
1783
|
+
inline: true
|
|
1774
1784
|
},
|
|
1775
1785
|
hasOptions: true,
|
|
1786
|
+
hasFieldProps: true,
|
|
1776
1787
|
valueSchema: field => {
|
|
1777
1788
|
const items = {
|
|
1778
1789
|
type: 'string'
|
|
@@ -2142,16 +2153,21 @@ const normalizeOptions = function (options, _temp) {
|
|
|
2142
2153
|
}
|
|
2143
2154
|
const columnNames = (columns || []).map(item => item?.name).filter(Boolean);
|
|
2144
2155
|
return options.map(item => {
|
|
2156
|
+
const label = String(item?.label ?? '').trim();
|
|
2157
|
+
let value = String(item?.value ?? '').trim();
|
|
2158
|
+
if (!value && label) {
|
|
2159
|
+
value = label;
|
|
2160
|
+
}
|
|
2145
2161
|
const next = {
|
|
2146
|
-
label
|
|
2147
|
-
value
|
|
2148
|
-
description: item?.description ?? ''
|
|
2162
|
+
label,
|
|
2163
|
+
value,
|
|
2164
|
+
description: String(item?.description ?? '').trim()
|
|
2149
2165
|
};
|
|
2150
2166
|
columnNames.forEach(name => {
|
|
2151
2167
|
next[name] = item?.[name] ?? '';
|
|
2152
2168
|
});
|
|
2153
2169
|
if (!String(next.label).trim() && columnNames[0] && String(next[columnNames[0]] || '').trim()) {
|
|
2154
|
-
next.label = String(next[columnNames[0]]);
|
|
2170
|
+
next.label = String(next[columnNames[0]]).trim();
|
|
2155
2171
|
}
|
|
2156
2172
|
if (!String(next.value).trim() && String(next.label).trim()) {
|
|
2157
2173
|
next.value = next.label;
|
|
@@ -2303,6 +2319,11 @@ const pickFieldProps = (field, definition) => {
|
|
|
2303
2319
|
checkedChildren: props.checkedChildren || '',
|
|
2304
2320
|
unCheckedChildren: props.unCheckedChildren || ''
|
|
2305
2321
|
};
|
|
2322
|
+
case 'RadioGroup':
|
|
2323
|
+
case 'CheckboxGroup':
|
|
2324
|
+
return {
|
|
2325
|
+
inline: props.inline !== false
|
|
2326
|
+
};
|
|
2306
2327
|
default:
|
|
2307
2328
|
if (definition?.propsSchema?.length) {
|
|
2308
2329
|
return pickFromPropsSchema(props, definition.propsSchema, definition.defaultProps || {});
|
|
@@ -2369,6 +2390,11 @@ const applyFieldProps = (props, values, definition) => {
|
|
|
2369
2390
|
setOptionalString(props, 'checkedChildren', values.checkedChildren);
|
|
2370
2391
|
setOptionalString(props, 'unCheckedChildren', values.unCheckedChildren);
|
|
2371
2392
|
break;
|
|
2393
|
+
case 'RadioGroup':
|
|
2394
|
+
case 'CheckboxGroup':
|
|
2395
|
+
// 始终落盘布尔值,避免 Checkbox 未勾选时字段缺失被当成默认单行
|
|
2396
|
+
props.inline = values.inline !== false;
|
|
2397
|
+
break;
|
|
2372
2398
|
default:
|
|
2373
2399
|
if (definition?.propsSchema?.length) {
|
|
2374
2400
|
applyFromPropsSchema(props, values, definition.propsSchema);
|
|
@@ -3299,7 +3325,12 @@ const BlockConfigFields = _ref => {
|
|
|
3299
3325
|
children: formatMessage({
|
|
3300
3326
|
id: 'blockBordered'
|
|
3301
3327
|
})
|
|
3302
|
-
}, "bordered"), kind === '
|
|
3328
|
+
}, "bordered"), kind === 'formInfo' ? /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
|
|
3329
|
+
name: "showIndex",
|
|
3330
|
+
children: formatMessage({
|
|
3331
|
+
id: 'blockShowIndex'
|
|
3332
|
+
})
|
|
3333
|
+
}, "showIndex") : null, kind === 'list' ? /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
|
|
3303
3334
|
name: "important",
|
|
3304
3335
|
children: formatMessage({
|
|
3305
3336
|
id: 'blockImportant'
|
|
@@ -3382,20 +3413,26 @@ const BlockConfigFields = _ref => {
|
|
|
3382
3413
|
} = _ref3;
|
|
3383
3414
|
return openApi?.data?.mode === 'multiple';
|
|
3384
3415
|
}
|
|
3385
|
-
}, "maxLength"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.
|
|
3416
|
+
}, "maxLength"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
|
|
3417
|
+
name: "selectorInData",
|
|
3418
|
+
children: formatMessage({
|
|
3419
|
+
id: 'choiceSelectorInData'
|
|
3420
|
+
})
|
|
3421
|
+
}, "selectorInData"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Input, {
|
|
3386
3422
|
name: "selectorName",
|
|
3387
3423
|
label: formatMessage({
|
|
3388
3424
|
id: 'choiceSelectorName'
|
|
3389
3425
|
}),
|
|
3390
3426
|
placeholder: formatMessage({
|
|
3391
3427
|
id: 'choiceSelectorNamePlaceholder'
|
|
3392
|
-
})
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3428
|
+
}),
|
|
3429
|
+
display: _ref4 => {
|
|
3430
|
+
let {
|
|
3431
|
+
openApi
|
|
3432
|
+
} = _ref4;
|
|
3433
|
+
return openApi?.data?.selectorInData !== false;
|
|
3434
|
+
}
|
|
3435
|
+
}, "selectorName"));
|
|
3399
3436
|
}
|
|
3400
3437
|
if (kind === 'multiField') {
|
|
3401
3438
|
list.push(/*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Input, {
|
|
@@ -3474,14 +3511,14 @@ const BlockConfigFields = _ref => {
|
|
|
3474
3511
|
})
|
|
3475
3512
|
});
|
|
3476
3513
|
};
|
|
3477
|
-
const BlockEditorModal =
|
|
3514
|
+
const BlockEditorModal = _ref5 => {
|
|
3478
3515
|
let {
|
|
3479
3516
|
open,
|
|
3480
3517
|
block,
|
|
3481
3518
|
onCancel,
|
|
3482
3519
|
onSave,
|
|
3483
3520
|
renderModal
|
|
3484
|
-
} =
|
|
3521
|
+
} = _ref5;
|
|
3485
3522
|
const {
|
|
3486
3523
|
formatMessage
|
|
3487
3524
|
} = reactIntl.useIntl();
|
|
@@ -3720,6 +3757,31 @@ const EMPTY_OPTION = () => ({
|
|
|
3720
3757
|
label: '',
|
|
3721
3758
|
value: ''
|
|
3722
3759
|
});
|
|
3760
|
+
|
|
3761
|
+
/** value 为空或仍等于当前 label 时视为联动中,改 label 会同步 value */
|
|
3762
|
+
const isOptionValueLinked = (label, value) => {
|
|
3763
|
+
const labelText = label == null ? '' : String(label);
|
|
3764
|
+
const valueText = value == null ? '' : String(value);
|
|
3765
|
+
return valueText === '' || valueText === labelText;
|
|
3766
|
+
};
|
|
3767
|
+
const patchOptionLabelChange = (item, nextLabel) => {
|
|
3768
|
+
const patch = {
|
|
3769
|
+
label: nextLabel
|
|
3770
|
+
};
|
|
3771
|
+
if (isOptionValueLinked(item.label, item.value)) {
|
|
3772
|
+
patch.value = nextLabel;
|
|
3773
|
+
}
|
|
3774
|
+
return patch;
|
|
3775
|
+
};
|
|
3776
|
+
const trimOptionLabelValue = item => {
|
|
3777
|
+
const label = String(item?.label ?? '').trim();
|
|
3778
|
+
const rawValue = String(item?.value ?? '').trim();
|
|
3779
|
+
const linked = isOptionValueLinked(item?.label, item?.value) || rawValue === '' || rawValue === label;
|
|
3780
|
+
return {
|
|
3781
|
+
label,
|
|
3782
|
+
value: linked ? label : rawValue
|
|
3783
|
+
};
|
|
3784
|
+
};
|
|
3723
3785
|
const createEmptyTableRow = columns => {
|
|
3724
3786
|
const row = {
|
|
3725
3787
|
label: '',
|
|
@@ -3767,9 +3829,8 @@ const FlatOptionRows = ({
|
|
|
3767
3829
|
placeholder: formatMessage({
|
|
3768
3830
|
id: 'optionLabelPlaceholder'
|
|
3769
3831
|
}),
|
|
3770
|
-
onChange: event => updateItem(index,
|
|
3771
|
-
|
|
3772
|
-
})
|
|
3832
|
+
onChange: event => updateItem(index, patchOptionLabelChange(item, event.target.value)),
|
|
3833
|
+
onBlur: () => updateItem(index, trimOptionLabelValue(item))
|
|
3773
3834
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
3774
3835
|
value: item.value,
|
|
3775
3836
|
placeholder: formatMessage({
|
|
@@ -3777,6 +3838,9 @@ const FlatOptionRows = ({
|
|
|
3777
3838
|
}),
|
|
3778
3839
|
onChange: event => updateItem(index, {
|
|
3779
3840
|
value: event.target.value
|
|
3841
|
+
}),
|
|
3842
|
+
onBlur: () => updateItem(index, {
|
|
3843
|
+
value: String(item.value ?? '').trim()
|
|
3780
3844
|
})
|
|
3781
3845
|
}), allowDescription ? /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
3782
3846
|
value: item.description || '',
|
|
@@ -3785,6 +3849,9 @@ const FlatOptionRows = ({
|
|
|
3785
3849
|
}),
|
|
3786
3850
|
onChange: event => updateItem(index, {
|
|
3787
3851
|
description: event.target.value
|
|
3852
|
+
}),
|
|
3853
|
+
onBlur: () => updateItem(index, {
|
|
3854
|
+
description: String(item.description ?? '').trim()
|
|
3788
3855
|
})
|
|
3789
3856
|
}) : null, /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
3790
3857
|
type: "text",
|
|
@@ -3861,9 +3928,8 @@ const TreeOptionNode = ({
|
|
|
3861
3928
|
placeholder: formatMessage({
|
|
3862
3929
|
id: 'optionLabelPlaceholder'
|
|
3863
3930
|
}),
|
|
3864
|
-
onChange: e => updateSelf(
|
|
3865
|
-
|
|
3866
|
-
})
|
|
3931
|
+
onChange: e => updateSelf(patchOptionLabelChange(item, e.target.value)),
|
|
3932
|
+
onBlur: () => updateSelf(trimOptionLabelValue(item))
|
|
3867
3933
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
3868
3934
|
value: item.value,
|
|
3869
3935
|
placeholder: formatMessage({
|
|
@@ -3871,6 +3937,9 @@ const TreeOptionNode = ({
|
|
|
3871
3937
|
}),
|
|
3872
3938
|
onChange: e => updateSelf({
|
|
3873
3939
|
value: e.target.value
|
|
3940
|
+
}),
|
|
3941
|
+
onBlur: () => updateSelf({
|
|
3942
|
+
value: String(item.value ?? '').trim()
|
|
3874
3943
|
})
|
|
3875
3944
|
}), allowDescription ? /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
3876
3945
|
value: item.description || '',
|
|
@@ -3879,6 +3948,9 @@ const TreeOptionNode = ({
|
|
|
3879
3948
|
}),
|
|
3880
3949
|
onChange: e => updateSelf({
|
|
3881
3950
|
description: e.target.value
|
|
3951
|
+
}),
|
|
3952
|
+
onBlur: () => updateSelf({
|
|
3953
|
+
description: String(item.description ?? '').trim()
|
|
3882
3954
|
})
|
|
3883
3955
|
}) : null]
|
|
3884
3956
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -4356,7 +4428,7 @@ const SuperSelectPropsEditor = ({
|
|
|
4356
4428
|
};
|
|
4357
4429
|
var SuperSelectPropsEditor$1 = SuperSelectPropsEditor;
|
|
4358
4430
|
|
|
4359
|
-
const BUILTIN_PROP_TYPES = ['Input', 'TextArea', 'InputNumber', 'Select', 'DatePicker', 'Switch'];
|
|
4431
|
+
const BUILTIN_PROP_TYPES = ['Input', 'TextArea', 'InputNumber', 'Select', 'DatePicker', 'Switch', 'RadioGroup', 'CheckboxGroup'];
|
|
4360
4432
|
const buildPropsSchemaList = (schema, formatMessage) => (schema || []).filter(item => item?.name).map(item => {
|
|
4361
4433
|
if (item.type === 'boolean') {
|
|
4362
4434
|
return /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
|
|
@@ -4584,6 +4656,14 @@ const buildBuiltinList = (type, formatMessage) => {
|
|
|
4584
4656
|
id: 'propSwitchOffTextHint'
|
|
4585
4657
|
})
|
|
4586
4658
|
}, "unCheckedChildren")];
|
|
4659
|
+
case 'RadioGroup':
|
|
4660
|
+
case 'CheckboxGroup':
|
|
4661
|
+
return [/*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
|
|
4662
|
+
name: "inline",
|
|
4663
|
+
children: formatMessage({
|
|
4664
|
+
id: 'propOptionsInline'
|
|
4665
|
+
})
|
|
4666
|
+
}, "inline")];
|
|
4587
4667
|
default:
|
|
4588
4668
|
return [];
|
|
4589
4669
|
}
|
|
@@ -5184,29 +5264,32 @@ const buildMultipleHint = (formatMessage, minLength, maxLength) => {
|
|
|
5184
5264
|
* 外层用 InfoPage.Part 的 title 展示标题。
|
|
5185
5265
|
*/
|
|
5186
5266
|
const ChoiceBlock = ({
|
|
5187
|
-
|
|
5267
|
+
schemaBlock,
|
|
5268
|
+
block: blockProp,
|
|
5188
5269
|
preview = false,
|
|
5189
5270
|
isMobile = false,
|
|
5190
5271
|
isPartRoot = false,
|
|
5191
5272
|
formatMessage,
|
|
5192
5273
|
renderOptionContent
|
|
5193
5274
|
}) => {
|
|
5194
|
-
|
|
5195
|
-
const
|
|
5196
|
-
const
|
|
5275
|
+
// schema 配置用 schemaBlock;兼容旧 prop 名 block(且忽略 withBlockLayout 写入的 boolean true)
|
|
5276
|
+
const block = schemaBlock && typeof schemaBlock === 'object' ? schemaBlock : blockProp && typeof blockProp === 'object' ? blockProp : null;
|
|
5277
|
+
const mode = block?.mode === 'multiple' ? 'multiple' : 'single';
|
|
5278
|
+
const selectorName = block ? resolveSelectorName(block) : '';
|
|
5279
|
+
const options = react.useMemo(() => block && Array.isArray(block.options) ? block.options : [], [block]);
|
|
5197
5280
|
const {
|
|
5198
5281
|
formData,
|
|
5199
5282
|
openApi
|
|
5200
5283
|
} = reactFormAntd.useFormContext() || {};
|
|
5201
|
-
const titleText = block
|
|
5284
|
+
const titleText = block?.title != null ? String(block.title).trim() : '';
|
|
5202
5285
|
const title = titleText || (formatMessage ? formatMessage({
|
|
5203
5286
|
id: 'choiceAreaTitle'
|
|
5204
5287
|
}) : '请选择');
|
|
5205
|
-
const bordered = isMobile ? false : block
|
|
5288
|
+
const bordered = isMobile ? false : block?.bordered || undefined;
|
|
5206
5289
|
const {
|
|
5207
5290
|
minLength,
|
|
5208
5291
|
maxLength
|
|
5209
|
-
} = mode === 'multiple' ? resolveSelectLimits(block) : {};
|
|
5292
|
+
} = mode === 'multiple' && block ? resolveSelectLimits(block) : {};
|
|
5210
5293
|
const firstOptionId = options[0] != null ? String(options[0].id) : undefined;
|
|
5211
5294
|
const rawValue = getByPath$1(formData || {}, selectorName);
|
|
5212
5295
|
// 仅随 selector 值变化;勿依赖整个 formData,否则清空未选支字段会触发 options 重算 → CheckboxGroup 死循环
|
|
@@ -5332,6 +5415,9 @@ const ChoiceBlock = ({
|
|
|
5332
5415
|
const modeHint = mode === 'multiple' ? buildMultipleHint(formatMessage, minLength, maxLength) : formatMessage ? formatMessage({
|
|
5333
5416
|
id: 'choiceModeHintSingle'
|
|
5334
5417
|
}) : '请选择其中一项';
|
|
5418
|
+
if (!block) {
|
|
5419
|
+
return null;
|
|
5420
|
+
}
|
|
5335
5421
|
return /*#__PURE__*/react.createElement(InfoPage__default["default"].Part, {
|
|
5336
5422
|
title,
|
|
5337
5423
|
subtitle: modeHint,
|
|
@@ -5365,15 +5451,33 @@ const resolvePartRootClassName = function (depth) {
|
|
|
5365
5451
|
const names = [depth === 0 ? InfoPage__default["default"].partRootClassName : null, ...[].slice.call(arguments, 1)].filter(Boolean);
|
|
5366
5452
|
return names.length ? names.join(' ') : undefined;
|
|
5367
5453
|
};
|
|
5454
|
+
const buildFieldLabel = field => {
|
|
5455
|
+
const base = field?.label != null && String(field.label).trim() ? String(field.label).trim() : field?.name || '';
|
|
5456
|
+
return base || undefined;
|
|
5457
|
+
};
|
|
5458
|
+
const buildIndexedLabelRender = index => {
|
|
5459
|
+
return _ref => {
|
|
5460
|
+
let {
|
|
5461
|
+
label
|
|
5462
|
+
} = _ref;
|
|
5463
|
+
const text = label != null ? String(label).replace(/\u200b/g, '') : '';
|
|
5464
|
+
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement('span', {
|
|
5465
|
+
className: style['field-label-index']
|
|
5466
|
+
}, `${index + 1}.`), text ? /*#__PURE__*/react.createElement('span', {
|
|
5467
|
+
className: style['field-label-main']
|
|
5468
|
+
}, text) : null);
|
|
5469
|
+
};
|
|
5470
|
+
};
|
|
5368
5471
|
const renderFieldElements = function (fields, preview, _temp) {
|
|
5369
5472
|
if (fields === void 0) {
|
|
5370
5473
|
fields = [];
|
|
5371
5474
|
}
|
|
5372
5475
|
let {
|
|
5373
5476
|
namePrefix,
|
|
5374
|
-
locale
|
|
5477
|
+
locale,
|
|
5478
|
+
showIndex = false
|
|
5375
5479
|
} = _temp === void 0 ? {} : _temp;
|
|
5376
|
-
return fields.filter(field => !field.hidden).map(field => {
|
|
5480
|
+
return fields.filter(field => !field.hidden).map((field, index) => {
|
|
5377
5481
|
const Component = getFieldComponent(field.type, field);
|
|
5378
5482
|
if (!Component) {
|
|
5379
5483
|
return null;
|
|
@@ -5390,16 +5494,32 @@ const renderFieldElements = function (fields, preview, _temp) {
|
|
|
5390
5494
|
delete props.placeholder;
|
|
5391
5495
|
}
|
|
5392
5496
|
delete props.range;
|
|
5497
|
+
|
|
5498
|
+
// Radio/Checkbox 选项布局:inline=false 纵向;Radio 用 antd vertical,Checkbox 用样式兜底
|
|
5499
|
+
if (field.type === 'RadioGroup' || field.type === 'CheckboxGroup') {
|
|
5500
|
+
const optionsInline = props.inline !== false;
|
|
5501
|
+
delete props.inline;
|
|
5502
|
+
if (!optionsInline) {
|
|
5503
|
+
if (field.type === 'RadioGroup') {
|
|
5504
|
+
props.vertical = true;
|
|
5505
|
+
}
|
|
5506
|
+
props.className = [props.className, style['option-group-stack']].filter(Boolean).join(' ');
|
|
5507
|
+
}
|
|
5508
|
+
}
|
|
5393
5509
|
const description = field.description != null && String(field.description).trim() ? field.description : undefined;
|
|
5394
5510
|
const fieldName = namePrefix && field.name ? `${namePrefix}.${field.name}` : field.name;
|
|
5395
5511
|
// 显式传 locale,避免 Global 仍为 zh-CN 时 react-form-antd withLocale 盖掉父级英文
|
|
5396
5512
|
const localeProps = locale ? {
|
|
5397
5513
|
locale
|
|
5398
5514
|
} : {};
|
|
5515
|
+
const label = buildFieldLabel(field);
|
|
5399
5516
|
return /*#__PURE__*/react.createElement(Component, {
|
|
5400
5517
|
key: field.id,
|
|
5401
5518
|
name: fieldName,
|
|
5402
|
-
label:
|
|
5519
|
+
label: showIndex ? label || '\u200b' : label,
|
|
5520
|
+
...(showIndex ? {
|
|
5521
|
+
labelRender: buildIndexedLabelRender(index)
|
|
5522
|
+
} : null),
|
|
5403
5523
|
rule: field.rule || undefined,
|
|
5404
5524
|
block: field.block || undefined,
|
|
5405
5525
|
...props,
|
|
@@ -5413,6 +5533,10 @@ const withBlockLayout = (element, forceBlock) => {
|
|
|
5413
5533
|
if (!element || !forceBlock) {
|
|
5414
5534
|
return element;
|
|
5415
5535
|
}
|
|
5536
|
+
// FormInfo / List 等用 block 表示整行占位;勿覆盖 ChoiceBlock 的 schemaBlock
|
|
5537
|
+
if (element.type === ChoiceBlock$1 || element.props?.schemaBlock) {
|
|
5538
|
+
return element;
|
|
5539
|
+
}
|
|
5416
5540
|
return /*#__PURE__*/react.createElement(element.type, {
|
|
5417
5541
|
...element.props,
|
|
5418
5542
|
key: element.key,
|
|
@@ -5489,7 +5613,11 @@ const renderBlockElement = function (block, preview, ctx) {
|
|
|
5489
5613
|
switch (block.kind) {
|
|
5490
5614
|
case 'formInfo':
|
|
5491
5615
|
{
|
|
5492
|
-
const
|
|
5616
|
+
const showIndex = !!block.showIndex;
|
|
5617
|
+
const fields = renderFieldElements(block.list, preview, {
|
|
5618
|
+
...fieldRenderOpts,
|
|
5619
|
+
showIndex
|
|
5620
|
+
});
|
|
5493
5621
|
const nested = renderChildBlocks(block.blocks || [], nextCtx).map(node => withBlockLayout(node, true));
|
|
5494
5622
|
return withBlockLayout(/*#__PURE__*/react.createElement(FormInfo__default["default"], {
|
|
5495
5623
|
key: block.id,
|
|
@@ -5500,7 +5628,7 @@ const renderBlockElement = function (block, preview, ctx) {
|
|
|
5500
5628
|
bordered,
|
|
5501
5629
|
list: [...fields, ...nested],
|
|
5502
5630
|
...(listItemPartProps || {}),
|
|
5503
|
-
className: resolvePartRootClassName(depth)
|
|
5631
|
+
className: resolvePartRootClassName(depth, showIndex ? style['form-info-show-index'] : null)
|
|
5504
5632
|
}), asListItem);
|
|
5505
5633
|
}
|
|
5506
5634
|
case 'object':
|
|
@@ -5624,7 +5752,7 @@ const renderBlockElement = function (block, preview, ctx) {
|
|
|
5624
5752
|
case 'choice':
|
|
5625
5753
|
return withBlockLayout(/*#__PURE__*/react.createElement(ChoiceBlock$1, {
|
|
5626
5754
|
key: block.id,
|
|
5627
|
-
block,
|
|
5755
|
+
schemaBlock: block,
|
|
5628
5756
|
preview,
|
|
5629
5757
|
isMobile,
|
|
5630
5758
|
isPartRoot: depth === 0,
|
|
@@ -7246,18 +7374,43 @@ const resolveChoiceSelectorName = block => {
|
|
|
7246
7374
|
const formatFieldValue = (field, value, formatMessage) => formatFieldDisplayValue(field, value, {
|
|
7247
7375
|
formatMessage
|
|
7248
7376
|
});
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7377
|
+
|
|
7378
|
+
/**
|
|
7379
|
+
* 问卷题干往往很长:不用 InfoPage Content 的横向 label 列宽对齐(minWidth),
|
|
7380
|
+
* 改为 label 在上、值在下,避免窄栏(如弹窗双栏预览)被撑乱。
|
|
7381
|
+
*/
|
|
7382
|
+
const renderFieldsContent = function (fields, data, formatMessage, column, _temp) {
|
|
7383
|
+
let {
|
|
7384
|
+
showIndex = false
|
|
7385
|
+
} = _temp === void 0 ? {} : _temp;
|
|
7386
|
+
const list = (fields || []).filter(field => field && !field.hidden && field.name).map((field, index) => {
|
|
7387
|
+
const baseLabel = field.label || field.name;
|
|
7388
|
+
const label = showIndex ? `${index + 1}. ${baseLabel}` : baseLabel;
|
|
7389
|
+
return {
|
|
7390
|
+
label,
|
|
7391
|
+
content: formatFieldValue(field, getByPath(data, field.name), formatMessage),
|
|
7392
|
+
block: field.block === true
|
|
7393
|
+
};
|
|
7394
|
+
});
|
|
7255
7395
|
if (!list.length) {
|
|
7256
7396
|
return null;
|
|
7257
7397
|
}
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7398
|
+
const cols = Math.max(1, Number(column) || 2);
|
|
7399
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7400
|
+
className: style['schema-content-fields'],
|
|
7401
|
+
style: {
|
|
7402
|
+
'--schema-content-cols': cols
|
|
7403
|
+
},
|
|
7404
|
+
children: list.map((item, index) => /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7405
|
+
className: [style['schema-content-field'], item.block ? style['schema-content-field-block'] : null].filter(Boolean).join(' '),
|
|
7406
|
+
children: [item.label ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7407
|
+
className: style['schema-content-field-label'],
|
|
7408
|
+
children: [item.label, "\uFF1A"]
|
|
7409
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7410
|
+
className: style['schema-content-field-value'],
|
|
7411
|
+
children: item.content
|
|
7412
|
+
})]
|
|
7413
|
+
}, index))
|
|
7261
7414
|
});
|
|
7262
7415
|
};
|
|
7263
7416
|
const renderBlockList = (blocks, data, ctx) => (blocks || []).map(block => renderBlock(block, data, ctx)).filter(Boolean);
|
|
@@ -7287,7 +7440,9 @@ const renderBlock = (block, data, ctx) => {
|
|
|
7287
7440
|
{
|
|
7288
7441
|
return /*#__PURE__*/jsxRuntime.jsxs(InfoPage__default["default"].Part, {
|
|
7289
7442
|
...partProps,
|
|
7290
|
-
children: [renderFieldsContent(block.list, data, formatMessage, block.column
|
|
7443
|
+
children: [renderFieldsContent(block.list, data, formatMessage, block.column, {
|
|
7444
|
+
showIndex: !!block.showIndex
|
|
7445
|
+
}), renderBlockList(block.blocks, data, nextCtx)]
|
|
7291
7446
|
});
|
|
7292
7447
|
}
|
|
7293
7448
|
case 'object':
|
|
@@ -7332,13 +7487,21 @@ const renderBlock = (block, data, ctx) => {
|
|
|
7332
7487
|
const content = Array.isArray(values) ? values.map(item => formatFieldValue(itemField, item, formatMessage)).join('、') : formatFieldValue(itemField, values, formatMessage);
|
|
7333
7488
|
return /*#__PURE__*/jsxRuntime.jsx(InfoPage__default["default"].Part, {
|
|
7334
7489
|
...partProps,
|
|
7335
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7490
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7491
|
+
className: style['schema-content-fields'],
|
|
7492
|
+
style: {
|
|
7493
|
+
'--schema-content-cols': 1
|
|
7494
|
+
},
|
|
7495
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7496
|
+
className: [style['schema-content-field'], style['schema-content-field-block']].join(' '),
|
|
7497
|
+
children: [block.label || block.name ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7498
|
+
className: style['schema-content-field-label'],
|
|
7499
|
+
children: (block.label || block.name) + ':'
|
|
7500
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7501
|
+
className: style['schema-content-field-value'],
|
|
7502
|
+
children: content
|
|
7503
|
+
})]
|
|
7504
|
+
})
|
|
7342
7505
|
})
|
|
7343
7506
|
});
|
|
7344
7507
|
}
|