@kne/form-creator 0.1.18 → 0.1.20
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 +85 -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.modern.js
CHANGED
|
@@ -14,10 +14,10 @@ import '@kne/super-select-plus/dist/index.css';
|
|
|
14
14
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
15
15
|
import FormInfo, { FormModal, Form, Steps, MultiField, TableList, List } from '@kne/form-info';
|
|
16
16
|
import { ButtonFooter } from '@kne/button-group';
|
|
17
|
-
import InfoPage
|
|
17
|
+
import InfoPage from '@kne/info-page';
|
|
18
18
|
import { createWithRemoteLoader } from '@kne/remote-loader';
|
|
19
19
|
|
|
20
|
-
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"};
|
|
20
|
+
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"};
|
|
21
21
|
|
|
22
22
|
function _extends() {
|
|
23
23
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -102,6 +102,7 @@ const locale$1 = {
|
|
|
102
102
|
blockNameRequired: '请填写保存用的名称',
|
|
103
103
|
blockGap: '间距',
|
|
104
104
|
blockBordered: '显示边框',
|
|
105
|
+
blockShowIndex: '展示题目序号',
|
|
105
106
|
blockImportant: '突出显示',
|
|
106
107
|
blockAddText: '添加按钮文案',
|
|
107
108
|
blockAddTextPlaceholder: '例如:添加一条工作经历',
|
|
@@ -190,8 +191,8 @@ const locale$1 = {
|
|
|
190
191
|
optionDescPlaceholder: '补充说明(可选)',
|
|
191
192
|
addOption: '添加一个选项',
|
|
192
193
|
builtinDataHint: '该类型自带数据,无需手动配置选项',
|
|
193
|
-
optionsEditorHint: '
|
|
194
|
-
optionsTreeEditorHint: '
|
|
194
|
+
optionsEditorHint: '显示文字默认同步到对应值,可自行修改;保存时会去掉首尾空格',
|
|
195
|
+
optionsTreeEditorHint: '显示文字默认同步到对应值,可自行修改;点「添加子级」挂下级,左侧竖线表示层级',
|
|
195
196
|
addChildOption: '添加子级',
|
|
196
197
|
fieldColumns: '表格有哪些列',
|
|
197
198
|
columnTitlePlaceholder: '列标题,例如:姓名',
|
|
@@ -243,6 +244,7 @@ const locale$1 = {
|
|
|
243
244
|
propSwitchOffText: '关闭时显示的文字',
|
|
244
245
|
propSwitchOnTextHint: '例如:开',
|
|
245
246
|
propSwitchOffTextHint: '例如:关',
|
|
247
|
+
propOptionsInline: '选项单行显示',
|
|
246
248
|
ruleLen: '长度限制',
|
|
247
249
|
ruleLenRange: '长度范围',
|
|
248
250
|
ruleLenMin: '最少字数',
|
|
@@ -326,6 +328,7 @@ const locale = {
|
|
|
326
328
|
blockNameRequired: 'Please enter a save name',
|
|
327
329
|
blockGap: 'Spacing',
|
|
328
330
|
blockBordered: 'Show Border',
|
|
331
|
+
blockShowIndex: 'Show question numbers',
|
|
329
332
|
blockImportant: 'Highlight',
|
|
330
333
|
blockAddText: 'Add Button Label',
|
|
331
334
|
blockAddTextPlaceholder: 'e.g. Add Work Experience',
|
|
@@ -414,8 +417,8 @@ const locale = {
|
|
|
414
417
|
optionDescPlaceholder: 'Description (optional)',
|
|
415
418
|
addOption: 'Add Option',
|
|
416
419
|
builtinDataHint: 'This type comes with built-in data, no manual options needed',
|
|
417
|
-
optionsEditorHint: '
|
|
418
|
-
optionsTreeEditorHint: '
|
|
420
|
+
optionsEditorHint: 'Display text syncs to value by default; you can edit value anytime. Leading/trailing spaces are trimmed on save',
|
|
421
|
+
optionsTreeEditorHint: 'Display text syncs to value by default; use “Add Child” for nesting; the left line shows hierarchy',
|
|
419
422
|
addChildOption: 'Add Child',
|
|
420
423
|
fieldColumns: 'Table Columns',
|
|
421
424
|
columnTitlePlaceholder: 'Column title, e.g. Name',
|
|
@@ -467,6 +470,7 @@ const locale = {
|
|
|
467
470
|
propSwitchOffText: 'Text when off',
|
|
468
471
|
propSwitchOnTextHint: 'e.g. On',
|
|
469
472
|
propSwitchOffTextHint: 'e.g. Off',
|
|
473
|
+
propOptionsInline: 'Options in a single row',
|
|
470
474
|
ruleLen: 'Length Limit',
|
|
471
475
|
ruleLenRange: 'Length Range',
|
|
472
476
|
ruleLenMin: 'Min',
|
|
@@ -582,6 +586,7 @@ const createBlock = (kind, overrides = {}) => {
|
|
|
582
586
|
gap: 24,
|
|
583
587
|
bordered: false,
|
|
584
588
|
important: false,
|
|
589
|
+
showIndex: false,
|
|
585
590
|
name: needsName ? createDataKey(kind === 'object' ? 'obj' : 'block') : '',
|
|
586
591
|
label: '',
|
|
587
592
|
addText: '',
|
|
@@ -1219,6 +1224,7 @@ const blockToFormValues = block => {
|
|
|
1219
1224
|
gap: (_block$gap = block.gap) != null ? _block$gap : 24,
|
|
1220
1225
|
bordered: !!block.bordered,
|
|
1221
1226
|
important: !!block.important,
|
|
1227
|
+
showIndex: !!block.showIndex,
|
|
1222
1228
|
name: block.name || '',
|
|
1223
1229
|
label: block.label || '',
|
|
1224
1230
|
addText: block.addText || '',
|
|
@@ -1243,6 +1249,7 @@ const formValuesToBlock = (values, existingBlock = {}) => {
|
|
|
1243
1249
|
gap: (_values$gap = values.gap) != null ? _values$gap : 24,
|
|
1244
1250
|
bordered: !!values.bordered,
|
|
1245
1251
|
important: !!values.important,
|
|
1252
|
+
showIndex: !!values.showIndex,
|
|
1246
1253
|
name: values.name,
|
|
1247
1254
|
label: values.label,
|
|
1248
1255
|
addText: values.addText || undefined,
|
|
@@ -1647,18 +1654,22 @@ defineField('RadioGroup', {
|
|
|
1647
1654
|
labelId: 'FieldTypeRadioGroup',
|
|
1648
1655
|
component: RadioGroup,
|
|
1649
1656
|
defaultProps: {
|
|
1650
|
-
options: []
|
|
1657
|
+
options: [],
|
|
1658
|
+
inline: true
|
|
1651
1659
|
},
|
|
1652
1660
|
hasOptions: true,
|
|
1661
|
+
hasFieldProps: true,
|
|
1653
1662
|
valueSchema: stringWithEnumSchema
|
|
1654
1663
|
});
|
|
1655
1664
|
defineField('CheckboxGroup', {
|
|
1656
1665
|
labelId: 'FieldTypeCheckboxGroup',
|
|
1657
1666
|
component: CheckboxGroup,
|
|
1658
1667
|
defaultProps: {
|
|
1659
|
-
options: []
|
|
1668
|
+
options: [],
|
|
1669
|
+
inline: true
|
|
1660
1670
|
},
|
|
1661
1671
|
hasOptions: true,
|
|
1672
|
+
hasFieldProps: true,
|
|
1662
1673
|
valueSchema: field => {
|
|
1663
1674
|
const items = {
|
|
1664
1675
|
type: 'string'
|
|
@@ -2008,17 +2019,22 @@ const normalizeOptions = (options, {
|
|
|
2008
2019
|
const columnNames = (_columns || []).map(item => item == null ? void 0 : item.name).filter(Boolean);
|
|
2009
2020
|
return options.map(item => {
|
|
2010
2021
|
var _item$label, _item$value, _item$description;
|
|
2022
|
+
const label = String((_item$label = item == null ? void 0 : item.label) != null ? _item$label : '').trim();
|
|
2023
|
+
let value = String((_item$value = item == null ? void 0 : item.value) != null ? _item$value : '').trim();
|
|
2024
|
+
if (!value && label) {
|
|
2025
|
+
value = label;
|
|
2026
|
+
}
|
|
2011
2027
|
const next = {
|
|
2012
|
-
label
|
|
2013
|
-
value
|
|
2014
|
-
description: (_item$description = item == null ? void 0 : item.description) != null ? _item$description : ''
|
|
2028
|
+
label,
|
|
2029
|
+
value,
|
|
2030
|
+
description: String((_item$description = item == null ? void 0 : item.description) != null ? _item$description : '').trim()
|
|
2015
2031
|
};
|
|
2016
2032
|
columnNames.forEach(name => {
|
|
2017
2033
|
var _item$name;
|
|
2018
2034
|
next[name] = (_item$name = item == null ? void 0 : item[name]) != null ? _item$name : '';
|
|
2019
2035
|
});
|
|
2020
2036
|
if (!String(next.label).trim() && columnNames[0] && String(next[columnNames[0]] || '').trim()) {
|
|
2021
|
-
next.label = String(next[columnNames[0]]);
|
|
2037
|
+
next.label = String(next[columnNames[0]]).trim();
|
|
2022
2038
|
}
|
|
2023
2039
|
if (!String(next.value).trim() && String(next.label).trim()) {
|
|
2024
2040
|
next.value = next.label;
|
|
@@ -2173,6 +2189,11 @@ const pickFieldProps = (field, definition) => {
|
|
|
2173
2189
|
checkedChildren: props.checkedChildren || '',
|
|
2174
2190
|
unCheckedChildren: props.unCheckedChildren || ''
|
|
2175
2191
|
};
|
|
2192
|
+
case 'RadioGroup':
|
|
2193
|
+
case 'CheckboxGroup':
|
|
2194
|
+
return {
|
|
2195
|
+
inline: props.inline !== false
|
|
2196
|
+
};
|
|
2176
2197
|
default:
|
|
2177
2198
|
if (definition != null && (_definition$propsSche = definition.propsSchema) != null && _definition$propsSche.length) {
|
|
2178
2199
|
return pickFromPropsSchema(props, definition.propsSchema, definition.defaultProps || {});
|
|
@@ -2240,6 +2261,11 @@ const applyFieldProps = (props, values, definition) => {
|
|
|
2240
2261
|
setOptionalString(props, 'checkedChildren', values.checkedChildren);
|
|
2241
2262
|
setOptionalString(props, 'unCheckedChildren', values.unCheckedChildren);
|
|
2242
2263
|
break;
|
|
2264
|
+
case 'RadioGroup':
|
|
2265
|
+
case 'CheckboxGroup':
|
|
2266
|
+
// 始终落盘布尔值,避免 Checkbox 未勾选时字段缺失被当成默认单行
|
|
2267
|
+
props.inline = values.inline !== false;
|
|
2268
|
+
break;
|
|
2243
2269
|
default:
|
|
2244
2270
|
if (definition != null && (_definition$propsSche2 = definition.propsSchema) != null && _definition$propsSche2.length) {
|
|
2245
2271
|
applyFromPropsSchema(props, values, definition.propsSchema);
|
|
@@ -3161,7 +3187,12 @@ const BlockConfigFields = ({
|
|
|
3161
3187
|
children: formatMessage({
|
|
3162
3188
|
id: 'blockBordered'
|
|
3163
3189
|
})
|
|
3164
|
-
}, "bordered"), kind === '
|
|
3190
|
+
}, "bordered"), kind === 'formInfo' ? /*#__PURE__*/jsx(Checkbox, {
|
|
3191
|
+
name: "showIndex",
|
|
3192
|
+
children: formatMessage({
|
|
3193
|
+
id: 'blockShowIndex'
|
|
3194
|
+
})
|
|
3195
|
+
}, "showIndex") : null, kind === 'list' ? /*#__PURE__*/jsx(Checkbox, {
|
|
3165
3196
|
name: "important",
|
|
3166
3197
|
children: formatMessage({
|
|
3167
3198
|
id: 'blockImportant'
|
|
@@ -3244,20 +3275,26 @@ const BlockConfigFields = ({
|
|
|
3244
3275
|
var _openApi$data2;
|
|
3245
3276
|
return (openApi == null || (_openApi$data2 = openApi.data) == null ? void 0 : _openApi$data2.mode) === 'multiple';
|
|
3246
3277
|
}
|
|
3247
|
-
}, "maxLength"), /*#__PURE__*/jsx(
|
|
3278
|
+
}, "maxLength"), /*#__PURE__*/jsx(Checkbox, {
|
|
3279
|
+
name: "selectorInData",
|
|
3280
|
+
children: formatMessage({
|
|
3281
|
+
id: 'choiceSelectorInData'
|
|
3282
|
+
})
|
|
3283
|
+
}, "selectorInData"), /*#__PURE__*/jsx(Input, {
|
|
3248
3284
|
name: "selectorName",
|
|
3249
3285
|
label: formatMessage({
|
|
3250
3286
|
id: 'choiceSelectorName'
|
|
3251
3287
|
}),
|
|
3252
3288
|
placeholder: formatMessage({
|
|
3253
3289
|
id: 'choiceSelectorNamePlaceholder'
|
|
3254
|
-
})
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3290
|
+
}),
|
|
3291
|
+
display: ({
|
|
3292
|
+
openApi
|
|
3293
|
+
}) => {
|
|
3294
|
+
var _openApi$data3;
|
|
3295
|
+
return (openApi == null || (_openApi$data3 = openApi.data) == null ? void 0 : _openApi$data3.selectorInData) !== false;
|
|
3296
|
+
}
|
|
3297
|
+
}, "selectorName"));
|
|
3261
3298
|
}
|
|
3262
3299
|
if (kind === 'multiField') {
|
|
3263
3300
|
list.push(/*#__PURE__*/jsx(Input, {
|
|
@@ -3580,6 +3617,32 @@ const EMPTY_OPTION = () => ({
|
|
|
3580
3617
|
label: '',
|
|
3581
3618
|
value: ''
|
|
3582
3619
|
});
|
|
3620
|
+
|
|
3621
|
+
/** value 为空或仍等于当前 label 时视为联动中,改 label 会同步 value */
|
|
3622
|
+
const isOptionValueLinked = (label, value) => {
|
|
3623
|
+
const labelText = label == null ? '' : String(label);
|
|
3624
|
+
const valueText = value == null ? '' : String(value);
|
|
3625
|
+
return valueText === '' || valueText === labelText;
|
|
3626
|
+
};
|
|
3627
|
+
const patchOptionLabelChange = (item, nextLabel) => {
|
|
3628
|
+
const patch = {
|
|
3629
|
+
label: nextLabel
|
|
3630
|
+
};
|
|
3631
|
+
if (isOptionValueLinked(item.label, item.value)) {
|
|
3632
|
+
patch.value = nextLabel;
|
|
3633
|
+
}
|
|
3634
|
+
return patch;
|
|
3635
|
+
};
|
|
3636
|
+
const trimOptionLabelValue = item => {
|
|
3637
|
+
var _item$label, _item$value;
|
|
3638
|
+
const label = String((_item$label = item == null ? void 0 : item.label) != null ? _item$label : '').trim();
|
|
3639
|
+
const rawValue = String((_item$value = item == null ? void 0 : item.value) != null ? _item$value : '').trim();
|
|
3640
|
+
const linked = isOptionValueLinked(item == null ? void 0 : item.label, item == null ? void 0 : item.value) || rawValue === '' || rawValue === label;
|
|
3641
|
+
return {
|
|
3642
|
+
label,
|
|
3643
|
+
value: linked ? label : rawValue
|
|
3644
|
+
};
|
|
3645
|
+
};
|
|
3583
3646
|
const createEmptyTableRow = columns => {
|
|
3584
3647
|
const row = {
|
|
3585
3648
|
label: '',
|
|
@@ -3623,9 +3686,8 @@ const FlatOptionRows = ({
|
|
|
3623
3686
|
placeholder: formatMessage({
|
|
3624
3687
|
id: 'optionLabelPlaceholder'
|
|
3625
3688
|
}),
|
|
3626
|
-
onChange: event => updateItem(index,
|
|
3627
|
-
|
|
3628
|
-
})
|
|
3689
|
+
onChange: event => updateItem(index, patchOptionLabelChange(item, event.target.value)),
|
|
3690
|
+
onBlur: () => updateItem(index, trimOptionLabelValue(item))
|
|
3629
3691
|
}), /*#__PURE__*/jsx(Input$1, {
|
|
3630
3692
|
value: item.value,
|
|
3631
3693
|
placeholder: formatMessage({
|
|
@@ -3633,7 +3695,13 @@ const FlatOptionRows = ({
|
|
|
3633
3695
|
}),
|
|
3634
3696
|
onChange: event => updateItem(index, {
|
|
3635
3697
|
value: event.target.value
|
|
3636
|
-
})
|
|
3698
|
+
}),
|
|
3699
|
+
onBlur: () => {
|
|
3700
|
+
var _item$value2;
|
|
3701
|
+
return updateItem(index, {
|
|
3702
|
+
value: String((_item$value2 = item.value) != null ? _item$value2 : '').trim()
|
|
3703
|
+
});
|
|
3704
|
+
}
|
|
3637
3705
|
}), allowDescription ? /*#__PURE__*/jsx(Input$1, {
|
|
3638
3706
|
value: item.description || '',
|
|
3639
3707
|
placeholder: formatMessage({
|
|
@@ -3641,7 +3709,13 @@ const FlatOptionRows = ({
|
|
|
3641
3709
|
}),
|
|
3642
3710
|
onChange: event => updateItem(index, {
|
|
3643
3711
|
description: event.target.value
|
|
3644
|
-
})
|
|
3712
|
+
}),
|
|
3713
|
+
onBlur: () => {
|
|
3714
|
+
var _item$description;
|
|
3715
|
+
return updateItem(index, {
|
|
3716
|
+
description: String((_item$description = item.description) != null ? _item$description : '').trim()
|
|
3717
|
+
});
|
|
3718
|
+
}
|
|
3645
3719
|
}) : null, /*#__PURE__*/jsx(Button, {
|
|
3646
3720
|
type: "text",
|
|
3647
3721
|
danger: true,
|
|
@@ -3714,9 +3788,8 @@ const TreeOptionNode = ({
|
|
|
3714
3788
|
placeholder: formatMessage({
|
|
3715
3789
|
id: 'optionLabelPlaceholder'
|
|
3716
3790
|
}),
|
|
3717
|
-
onChange: e => updateSelf(
|
|
3718
|
-
|
|
3719
|
-
})
|
|
3791
|
+
onChange: e => updateSelf(patchOptionLabelChange(item, e.target.value)),
|
|
3792
|
+
onBlur: () => updateSelf(trimOptionLabelValue(item))
|
|
3720
3793
|
}), /*#__PURE__*/jsx(Input$1, {
|
|
3721
3794
|
value: item.value,
|
|
3722
3795
|
placeholder: formatMessage({
|
|
@@ -3724,7 +3797,13 @@ const TreeOptionNode = ({
|
|
|
3724
3797
|
}),
|
|
3725
3798
|
onChange: e => updateSelf({
|
|
3726
3799
|
value: e.target.value
|
|
3727
|
-
})
|
|
3800
|
+
}),
|
|
3801
|
+
onBlur: () => {
|
|
3802
|
+
var _item$value3;
|
|
3803
|
+
return updateSelf({
|
|
3804
|
+
value: String((_item$value3 = item.value) != null ? _item$value3 : '').trim()
|
|
3805
|
+
});
|
|
3806
|
+
}
|
|
3728
3807
|
}), allowDescription ? /*#__PURE__*/jsx(Input$1, {
|
|
3729
3808
|
value: item.description || '',
|
|
3730
3809
|
placeholder: formatMessage({
|
|
@@ -3732,7 +3811,13 @@ const TreeOptionNode = ({
|
|
|
3732
3811
|
}),
|
|
3733
3812
|
onChange: e => updateSelf({
|
|
3734
3813
|
description: e.target.value
|
|
3735
|
-
})
|
|
3814
|
+
}),
|
|
3815
|
+
onBlur: () => {
|
|
3816
|
+
var _item$description2;
|
|
3817
|
+
return updateSelf({
|
|
3818
|
+
description: String((_item$description2 = item.description) != null ? _item$description2 : '').trim()
|
|
3819
|
+
});
|
|
3820
|
+
}
|
|
3736
3821
|
}) : null]
|
|
3737
3822
|
}), /*#__PURE__*/jsxs("div", {
|
|
3738
3823
|
className: style['tree-option-actions'],
|
|
@@ -4210,7 +4295,7 @@ const SuperSelectPropsEditor = ({
|
|
|
4210
4295
|
};
|
|
4211
4296
|
var SuperSelectPropsEditor$1 = SuperSelectPropsEditor;
|
|
4212
4297
|
|
|
4213
|
-
const BUILTIN_PROP_TYPES = ['Input', 'TextArea', 'InputNumber', 'Select', 'DatePicker', 'Switch'];
|
|
4298
|
+
const BUILTIN_PROP_TYPES = ['Input', 'TextArea', 'InputNumber', 'Select', 'DatePicker', 'Switch', 'RadioGroup', 'CheckboxGroup'];
|
|
4214
4299
|
const buildPropsSchemaList = (schema, formatMessage) => (schema || []).filter(item => item == null ? void 0 : item.name).map(item => {
|
|
4215
4300
|
if (item.type === 'boolean') {
|
|
4216
4301
|
return /*#__PURE__*/jsx(Checkbox, {
|
|
@@ -4441,6 +4526,14 @@ const buildBuiltinList = (type, formatMessage) => {
|
|
|
4441
4526
|
id: 'propSwitchOffTextHint'
|
|
4442
4527
|
})
|
|
4443
4528
|
}, "unCheckedChildren")];
|
|
4529
|
+
case 'RadioGroup':
|
|
4530
|
+
case 'CheckboxGroup':
|
|
4531
|
+
return [/*#__PURE__*/jsx(Checkbox, {
|
|
4532
|
+
name: "inline",
|
|
4533
|
+
children: formatMessage({
|
|
4534
|
+
id: 'propOptionsInline'
|
|
4535
|
+
})
|
|
4536
|
+
}, "inline")];
|
|
4444
4537
|
default:
|
|
4445
4538
|
return [];
|
|
4446
4539
|
}
|
|
@@ -5031,29 +5124,32 @@ const buildMultipleHint = (formatMessage, minLength, maxLength) => {
|
|
|
5031
5124
|
* 外层用 InfoPage.Part 的 title 展示标题。
|
|
5032
5125
|
*/
|
|
5033
5126
|
const ChoiceBlock = ({
|
|
5034
|
-
|
|
5127
|
+
schemaBlock,
|
|
5128
|
+
block: blockProp,
|
|
5035
5129
|
preview: _preview = false,
|
|
5036
5130
|
isMobile: _isMobile = false,
|
|
5037
5131
|
isPartRoot: _isPartRoot = false,
|
|
5038
5132
|
formatMessage,
|
|
5039
5133
|
renderOptionContent
|
|
5040
5134
|
}) => {
|
|
5041
|
-
|
|
5042
|
-
const
|
|
5043
|
-
const
|
|
5135
|
+
// schema 配置用 schemaBlock;兼容旧 prop 名 block(且忽略 withBlockLayout 写入的 boolean true)
|
|
5136
|
+
const block = schemaBlock && typeof schemaBlock === 'object' ? schemaBlock : blockProp && typeof blockProp === 'object' ? blockProp : null;
|
|
5137
|
+
const mode = (block == null ? void 0 : block.mode) === 'multiple' ? 'multiple' : 'single';
|
|
5138
|
+
const selectorName = block ? resolveSelectorName(block) : '';
|
|
5139
|
+
const options = useMemo(() => block && Array.isArray(block.options) ? block.options : [], [block]);
|
|
5044
5140
|
const {
|
|
5045
5141
|
formData,
|
|
5046
5142
|
openApi
|
|
5047
5143
|
} = useFormContext() || {};
|
|
5048
|
-
const titleText = block.title != null ? String(block.title).trim() : '';
|
|
5144
|
+
const titleText = (block == null ? void 0 : block.title) != null ? String(block.title).trim() : '';
|
|
5049
5145
|
const title = titleText || (formatMessage ? formatMessage({
|
|
5050
5146
|
id: 'choiceAreaTitle'
|
|
5051
5147
|
}) : '请选择');
|
|
5052
|
-
const bordered = _isMobile ? false : block.bordered || undefined;
|
|
5148
|
+
const bordered = _isMobile ? false : (block == null ? void 0 : block.bordered) || undefined;
|
|
5053
5149
|
const {
|
|
5054
5150
|
minLength,
|
|
5055
5151
|
maxLength
|
|
5056
|
-
} = mode === 'multiple' ? resolveSelectLimits(block) : {};
|
|
5152
|
+
} = mode === 'multiple' && block ? resolveSelectLimits(block) : {};
|
|
5057
5153
|
const firstOptionId = options[0] != null ? String(options[0].id) : undefined;
|
|
5058
5154
|
const rawValue = getByPath$1(formData || {}, selectorName);
|
|
5059
5155
|
// 仅随 selector 值变化;勿依赖整个 formData,否则清空未选支字段会触发 options 重算 → CheckboxGroup 死循环
|
|
@@ -5176,6 +5272,9 @@ const ChoiceBlock = ({
|
|
|
5176
5272
|
const modeHint = mode === 'multiple' ? buildMultipleHint(formatMessage, minLength, maxLength) : formatMessage ? formatMessage({
|
|
5177
5273
|
id: 'choiceModeHintSingle'
|
|
5178
5274
|
}) : '请选择其中一项';
|
|
5275
|
+
if (!block) {
|
|
5276
|
+
return null;
|
|
5277
|
+
}
|
|
5179
5278
|
return /*#__PURE__*/createElement(InfoPage.Part, {
|
|
5180
5279
|
title,
|
|
5181
5280
|
subtitle: modeHint,
|
|
@@ -5209,10 +5308,27 @@ const resolvePartRootClassName = (depth, ...extra) => {
|
|
|
5209
5308
|
const names = [depth === 0 ? InfoPage.partRootClassName : null, ...extra].filter(Boolean);
|
|
5210
5309
|
return names.length ? names.join(' ') : undefined;
|
|
5211
5310
|
};
|
|
5311
|
+
const buildFieldLabel = field => {
|
|
5312
|
+
const base = (field == null ? void 0 : field.label) != null && String(field.label).trim() ? String(field.label).trim() : (field == null ? void 0 : field.name) || '';
|
|
5313
|
+
return base || undefined;
|
|
5314
|
+
};
|
|
5315
|
+
const buildIndexedLabelRender = index => {
|
|
5316
|
+
return ({
|
|
5317
|
+
label
|
|
5318
|
+
}) => {
|
|
5319
|
+
const text = label != null ? String(label).replace(/\u200b/g, '') : '';
|
|
5320
|
+
return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement('span', {
|
|
5321
|
+
className: style['field-label-index']
|
|
5322
|
+
}, `${index + 1}.`), text ? /*#__PURE__*/createElement('span', {
|
|
5323
|
+
className: style['field-label-main']
|
|
5324
|
+
}, text) : null);
|
|
5325
|
+
};
|
|
5326
|
+
};
|
|
5212
5327
|
const renderFieldElements = (fields = [], preview = false, {
|
|
5213
5328
|
namePrefix,
|
|
5214
|
-
locale
|
|
5215
|
-
|
|
5329
|
+
locale,
|
|
5330
|
+
showIndex: _showIndex = false
|
|
5331
|
+
} = {}) => fields.filter(field => !field.hidden).map((field, index) => {
|
|
5216
5332
|
var _props$options;
|
|
5217
5333
|
const Component = getFieldComponent(field.type, field);
|
|
5218
5334
|
if (!Component) {
|
|
@@ -5227,16 +5343,32 @@ const renderFieldElements = (fields = [], preview = false, {
|
|
|
5227
5343
|
delete props.placeholder;
|
|
5228
5344
|
}
|
|
5229
5345
|
delete props.range;
|
|
5346
|
+
|
|
5347
|
+
// Radio/Checkbox 选项布局:inline=false 纵向;Radio 用 antd vertical,Checkbox 用样式兜底
|
|
5348
|
+
if (field.type === 'RadioGroup' || field.type === 'CheckboxGroup') {
|
|
5349
|
+
const optionsInline = props.inline !== false;
|
|
5350
|
+
delete props.inline;
|
|
5351
|
+
if (!optionsInline) {
|
|
5352
|
+
if (field.type === 'RadioGroup') {
|
|
5353
|
+
props.vertical = true;
|
|
5354
|
+
}
|
|
5355
|
+
props.className = [props.className, style['option-group-stack']].filter(Boolean).join(' ');
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5230
5358
|
const description = field.description != null && String(field.description).trim() ? field.description : undefined;
|
|
5231
5359
|
const fieldName = namePrefix && field.name ? `${namePrefix}.${field.name}` : field.name;
|
|
5232
5360
|
// 显式传 locale,避免 Global 仍为 zh-CN 时 react-form-antd withLocale 盖掉父级英文
|
|
5233
5361
|
const localeProps = locale ? {
|
|
5234
5362
|
locale
|
|
5235
5363
|
} : {};
|
|
5364
|
+
const label = buildFieldLabel(field);
|
|
5236
5365
|
return /*#__PURE__*/createElement(Component, _extends({
|
|
5237
5366
|
key: field.id,
|
|
5238
5367
|
name: fieldName,
|
|
5239
|
-
label:
|
|
5368
|
+
label: _showIndex ? label || '\u200b' : label
|
|
5369
|
+
}, _showIndex ? {
|
|
5370
|
+
labelRender: buildIndexedLabelRender(index)
|
|
5371
|
+
} : null, {
|
|
5240
5372
|
rule: field.rule || undefined,
|
|
5241
5373
|
block: field.block || undefined
|
|
5242
5374
|
}, props, localeProps, {
|
|
@@ -5245,9 +5377,14 @@ const renderFieldElements = (fields = [], preview = false, {
|
|
|
5245
5377
|
}));
|
|
5246
5378
|
}).filter(Boolean);
|
|
5247
5379
|
const withBlockLayout = (element, forceBlock) => {
|
|
5380
|
+
var _element$props;
|
|
5248
5381
|
if (!element || !forceBlock) {
|
|
5249
5382
|
return element;
|
|
5250
5383
|
}
|
|
5384
|
+
// FormInfo / List 等用 block 表示整行占位;勿覆盖 ChoiceBlock 的 schemaBlock
|
|
5385
|
+
if (element.type === ChoiceBlock$1 || (_element$props = element.props) != null && _element$props.schemaBlock) {
|
|
5386
|
+
return element;
|
|
5387
|
+
}
|
|
5251
5388
|
return /*#__PURE__*/createElement(element.type, _extends({}, element.props, {
|
|
5252
5389
|
key: element.key,
|
|
5253
5390
|
block: true
|
|
@@ -5302,7 +5439,10 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
5302
5439
|
switch (block.kind) {
|
|
5303
5440
|
case 'formInfo':
|
|
5304
5441
|
{
|
|
5305
|
-
const
|
|
5442
|
+
const showIndex = !!block.showIndex;
|
|
5443
|
+
const fields = renderFieldElements(block.list, preview, _extends({}, fieldRenderOpts, {
|
|
5444
|
+
showIndex
|
|
5445
|
+
}));
|
|
5306
5446
|
const nested = renderChildBlocks(block.blocks || [], nextCtx).map(node => withBlockLayout(node, true));
|
|
5307
5447
|
return withBlockLayout(/*#__PURE__*/createElement(FormInfo, _extends({
|
|
5308
5448
|
key: block.id,
|
|
@@ -5313,7 +5453,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
5313
5453
|
bordered,
|
|
5314
5454
|
list: [...fields, ...nested]
|
|
5315
5455
|
}, listItemPartProps || {}, {
|
|
5316
|
-
className: resolvePartRootClassName(depth)
|
|
5456
|
+
className: resolvePartRootClassName(depth, showIndex ? style['form-info-show-index'] : null)
|
|
5317
5457
|
})), asListItem);
|
|
5318
5458
|
}
|
|
5319
5459
|
case 'object':
|
|
@@ -5434,7 +5574,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
5434
5574
|
case 'choice':
|
|
5435
5575
|
return withBlockLayout(/*#__PURE__*/createElement(ChoiceBlock$1, {
|
|
5436
5576
|
key: block.id,
|
|
5437
|
-
block,
|
|
5577
|
+
schemaBlock: block,
|
|
5438
5578
|
preview,
|
|
5439
5579
|
isMobile,
|
|
5440
5580
|
isPartRoot: depth === 0,
|
|
@@ -6985,18 +7125,42 @@ const resolveChoiceSelectorName = block => {
|
|
|
6985
7125
|
const formatFieldValue = (field, value, formatMessage) => formatFieldDisplayValue(field, value, {
|
|
6986
7126
|
formatMessage
|
|
6987
7127
|
});
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
7128
|
+
|
|
7129
|
+
/**
|
|
7130
|
+
* 问卷题干往往很长:不用 InfoPage Content 的横向 label 列宽对齐(minWidth),
|
|
7131
|
+
* 改为 label 在上、值在下,避免窄栏(如弹窗双栏预览)被撑乱。
|
|
7132
|
+
*/
|
|
7133
|
+
const renderFieldsContent = (fields, data, formatMessage, column, {
|
|
7134
|
+
showIndex: _showIndex = false
|
|
7135
|
+
} = {}) => {
|
|
7136
|
+
const list = (fields || []).filter(field => field && !field.hidden && field.name).map((field, index) => {
|
|
7137
|
+
const baseLabel = field.label || field.name;
|
|
7138
|
+
const label = _showIndex ? `${index + 1}. ${baseLabel}` : baseLabel;
|
|
7139
|
+
return {
|
|
7140
|
+
label,
|
|
7141
|
+
content: formatFieldValue(field, getByPath(data, field.name), formatMessage),
|
|
7142
|
+
block: field.block === true
|
|
7143
|
+
};
|
|
7144
|
+
});
|
|
6994
7145
|
if (!list.length) {
|
|
6995
7146
|
return null;
|
|
6996
7147
|
}
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7148
|
+
const cols = Math.max(1, Number(column) || 2);
|
|
7149
|
+
return /*#__PURE__*/jsx("div", {
|
|
7150
|
+
className: style['schema-content-fields'],
|
|
7151
|
+
style: {
|
|
7152
|
+
'--schema-content-cols': cols
|
|
7153
|
+
},
|
|
7154
|
+
children: list.map((item, index) => /*#__PURE__*/jsxs("div", {
|
|
7155
|
+
className: [style['schema-content-field'], item.block ? style['schema-content-field-block'] : null].filter(Boolean).join(' '),
|
|
7156
|
+
children: [item.label ? /*#__PURE__*/jsxs("div", {
|
|
7157
|
+
className: style['schema-content-field-label'],
|
|
7158
|
+
children: [item.label, "\uFF1A"]
|
|
7159
|
+
}) : null, /*#__PURE__*/jsx("div", {
|
|
7160
|
+
className: style['schema-content-field-value'],
|
|
7161
|
+
children: item.content
|
|
7162
|
+
})]
|
|
7163
|
+
}, index))
|
|
7000
7164
|
});
|
|
7001
7165
|
};
|
|
7002
7166
|
const renderBlockList = (blocks, data, ctx) => (blocks || []).map(block => renderBlock(block, data, ctx)).filter(Boolean);
|
|
@@ -7024,7 +7188,9 @@ const renderBlock = (block, data, ctx) => {
|
|
|
7024
7188
|
case 'formInfo':
|
|
7025
7189
|
{
|
|
7026
7190
|
return /*#__PURE__*/jsxs(InfoPage.Part, _extends({}, partProps, {
|
|
7027
|
-
children: [renderFieldsContent(block.list, data, formatMessage, block.column
|
|
7191
|
+
children: [renderFieldsContent(block.list, data, formatMessage, block.column, {
|
|
7192
|
+
showIndex: !!block.showIndex
|
|
7193
|
+
}), renderBlockList(block.blocks, data, nextCtx)]
|
|
7028
7194
|
}));
|
|
7029
7195
|
}
|
|
7030
7196
|
case 'object':
|
|
@@ -7066,13 +7232,21 @@ const renderBlock = (block, data, ctx) => {
|
|
|
7066
7232
|
};
|
|
7067
7233
|
const content = Array.isArray(values) ? values.map(item => formatFieldValue(itemField, item, formatMessage)).join('、') : formatFieldValue(itemField, values, formatMessage);
|
|
7068
7234
|
return /*#__PURE__*/jsx(InfoPage.Part, _extends({}, partProps, {
|
|
7069
|
-
children: /*#__PURE__*/jsx(
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7235
|
+
children: /*#__PURE__*/jsx("div", {
|
|
7236
|
+
className: style['schema-content-fields'],
|
|
7237
|
+
style: {
|
|
7238
|
+
'--schema-content-cols': 1
|
|
7239
|
+
},
|
|
7240
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
7241
|
+
className: [style['schema-content-field'], style['schema-content-field-block']].join(' '),
|
|
7242
|
+
children: [block.label || block.name ? /*#__PURE__*/jsx("div", {
|
|
7243
|
+
className: style['schema-content-field-label'],
|
|
7244
|
+
children: (block.label || block.name) + ':'
|
|
7245
|
+
}) : null, /*#__PURE__*/jsx("div", {
|
|
7246
|
+
className: style['schema-content-field-value'],
|
|
7247
|
+
children: content
|
|
7248
|
+
})]
|
|
7249
|
+
})
|
|
7076
7250
|
})
|
|
7077
7251
|
}));
|
|
7078
7252
|
}
|