@kne/form-creator 0.1.30 → 0.1.32

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/index.js CHANGED
@@ -25,7 +25,7 @@ var ButtonGroup__default = /*#__PURE__*/_interopDefaultLegacy(ButtonGroup);
25
25
  var FormInfo__default = /*#__PURE__*/_interopDefaultLegacy(FormInfo);
26
26
  var InfoPage__default = /*#__PURE__*/_interopDefaultLegacy(InfoPage);
27
27
 
28
- 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-editableList":"kne-form-creator_JzwrQ","block-kind-multiField":"kne-form-creator_t0iOJ","block-kind-matrixScale":"kne-form-creator_CFlQv","matrix-scale-editor-title":"kne-form-creator_Zo1Rz","block-kind-steps":"kne-form-creator_QNF9W","step-section":"kne-form-creator_22ajp","block-section-header":"kne-form-creator_wS4rL","block-header-meta":"kne-form-creator_PQiYV","block-title":"kne-form-creator_wSVJf","block-collapse-btn":"kne-form-creator_Ufp-W","is-expanded":"kne-form-creator_OjfBl","drag-handle":"kne-form-creator_7GuXk","more-btn":"kne-form-creator_paWIZ","drag-handle-action":"kne-form-creator_lhTrX","sortable-ghost":"kne-form-creator_7ZIH8","sortable-drag":"kne-form-creator_dxhFH","action-group":"kne-form-creator_773yo","hover-reveal":"kne-form-creator_S234h","block-summary":"kne-form-creator_GzeW8","block-summary-type":"kne-form-creator_0iyhP","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-index":"kne-form-creator_CCKZZ","step-section-text":"kne-form-creator_hRFew","step-section-count":"kne-form-creator_G6Quc","step-section-actions":"kne-form-creator_es-FC","field-row":"kne-form-creator_XMkdt","field-row-index":"kne-form-creator_a-cDo","has-handle":"kne-form-creator_vbTgK","field-row-index-num":"kne-form-creator_e4yEp","field-row-main":"kne-form-creator_ftlwp","field-row-label":"kne-form-creator_XAxbE","inline-empty":"kne-form-creator_yP-RF","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","property-modal":"kne-form-creator_wRSZC","editor-intro":"kne-form-creator_uOGOq","field-editor-form":"kne-form-creator_PGPHL","editor-toggles":"kne-form-creator_Dfyhx","options-editor":"kne-form-creator_AK4yO","columns-editor":"kne-form-creator_DQW1N","table-rows-editor":"kne-form-creator_-meJG","is-plain":"kne-form-creator_IiViE","form-actions-editor":"kne-form-creator_fchMy","form-actions-switch-field":"kne-form-creator_6JE9x","form-actions-align-group":"kne-form-creator_51ZsV","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","super-select-props":"kne-form-creator_Iawhh","field-props-editor":"kne-form-creator_Gabf2","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-header":"kne-form-creator_As4L6","options-locale-text":"kne-form-creator_7-99l","options-header-label":"kne-form-creator_UhnVH","options-header-value":"kne-form-creator_2c35V","options-header-description":"kne-form-creator_ibWvX","icon-square-btn-sm":"kne-form-creator_GAh-t","options-header-action":"kne-form-creator_nTN1E","visible-when-editor":"kne-form-creator_ttGnB","visible-when-hint":"kne-form-creator_hPtdv","visible-when-list":"kne-form-creator_aoAt6","visible-when-row":"kne-form-creator_phRgr","visible-when-row-main":"kne-form-creator_l-J7d","visible-when-field":"kne-form-creator_YRh5W","visible-when-operator":"kne-form-creator_DIqFq","visible-when-value":"kne-form-creator_CHcia","visible-when-regex":"kne-form-creator_lKpVo","visible-when-flags":"kne-form-creator_Ps-cu","visible-when-regex-tester":"kne-form-creator_Wf4eG","options-tip":"kne-form-creator_vrTmK","icon-square-btn":"kne-form-creator_DZjCf","locale-text":"kne-form-creator_hMXkE","is-compact":"kne-form-creator_jBFpL","locale-text-item":"kne-form-creator_NqCQD","locale-text-prefix":"kne-form-creator_BQl2X","locale-text-tag":"kne-form-creator_65OWA","is-mobile":"kne-form-creator_LtgJz","add-inline-btn-icon":"kne-form-creator_jbBze","steps-focus":"kne-form-creator_BzrAJ","steps-focus-header":"kne-form-creator_fF02T","steps-focus-meta":"kne-form-creator_4Q3Nt","steps-focus-count":"kne-form-creator_-vGec","steps-focus-count-current":"kne-form-creator_vXk2o","steps-focus-count-total":"kne-form-creator_bpGjx","steps-focus-next":"kne-form-creator_a2ZfJ","steps-focus-title":"kne-form-creator_Q5bvO","steps-focus-track":"kne-form-creator_Cdvj5","steps-focus-segment":"kne-form-creator_4z3t0","is-done":"kne-form-creator_nBNzi","is-current":"kne-form-creator_a8lqo","steps-focus-actions":"kne-form-creator_NgZBR","steps-focus-actions-side":"kne-form-creator_ynPls","is-end":"kne-form-creator_syD91","steps-focus-prev":"kne-form-creator_5NtBV","steps-focus-next-btn":"kne-form-creator_1mMAJ","steps-focus-next-btn-icon":"kne-form-creator_OQvek","steps-focus-done-hint":"kne-form-creator_b0T7j"};
28
+ 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-list-items":"kne-form-creator_Xpl6K","_":"kne-form-creator_jWWXR","schema-content-list-item":"kne-form-creator_dBG5B","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","schema-content-matrix":"kne-form-creator_Wj4Oi","schema-content-matrix-inner":"kne-form-creator_g0-ex","schema-content-matrix-header":"kne-form-creator_6Ew-1","schema-content-matrix-row-title":"kne-form-creator_QQ9-w","schema-content-matrix-option-title":"kne-form-creator_OuEl1","is-choice":"kne-form-creator_xnHgj","schema-content-matrix-row":"kne-form-creator_fFwMK","schema-content-matrix-row-label":"kne-form-creator_W09sG","schema-content-matrix-cell":"kne-form-creator_T3bcF","is-cells":"kne-form-creator_buqr3","is-selected":"kne-form-creator_NadyF","is-mobile":"kne-form-creator_LtgJz","schema-content-matrix-mobile-row":"kne-form-creator_MCWtM","schema-content-matrix-mobile-label":"kne-form-creator_CSjHH","schema-content-matrix-mobile-value":"kne-form-creator_qtvEn","schema-content-matrix-mobile-cell":"kne-form-creator_G-a37","schema-content-matrix-mobile-cell-label":"kne-form-creator_Mjuwi","schema-content-steps":"kne-form-creator_WUBdi","schema-content-step":"kne-form-creator_WJ8b8","schema-content-step-body":"kne-form-creator_JH8KR","schema-content-step-subtitle":"kne-form-creator_jfPgO","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-editableList":"kne-form-creator_JzwrQ","block-kind-multiField":"kne-form-creator_t0iOJ","block-kind-matrixScale":"kne-form-creator_CFlQv","matrix-scale-editor-title":"kne-form-creator_Zo1Rz","block-kind-steps":"kne-form-creator_QNF9W","step-section":"kne-form-creator_22ajp","block-section-header":"kne-form-creator_wS4rL","block-header-meta":"kne-form-creator_PQiYV","block-title":"kne-form-creator_wSVJf","block-collapse-btn":"kne-form-creator_Ufp-W","is-expanded":"kne-form-creator_OjfBl","drag-handle":"kne-form-creator_7GuXk","more-btn":"kne-form-creator_paWIZ","drag-handle-action":"kne-form-creator_lhTrX","sortable-ghost":"kne-form-creator_7ZIH8","sortable-drag":"kne-form-creator_dxhFH","action-group":"kne-form-creator_773yo","hover-reveal":"kne-form-creator_S234h","block-summary":"kne-form-creator_GzeW8","block-summary-type":"kne-form-creator_0iyhP","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-index":"kne-form-creator_CCKZZ","step-section-text":"kne-form-creator_hRFew","step-section-count":"kne-form-creator_G6Quc","step-section-actions":"kne-form-creator_es-FC","field-row":"kne-form-creator_XMkdt","field-row-index":"kne-form-creator_a-cDo","has-handle":"kne-form-creator_vbTgK","field-row-index-num":"kne-form-creator_e4yEp","field-row-main":"kne-form-creator_ftlwp","field-row-label":"kne-form-creator_XAxbE","inline-empty":"kne-form-creator_yP-RF","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","property-modal":"kne-form-creator_wRSZC","editor-intro":"kne-form-creator_uOGOq","field-editor-form":"kne-form-creator_PGPHL","editor-toggles":"kne-form-creator_Dfyhx","options-editor":"kne-form-creator_AK4yO","columns-editor":"kne-form-creator_DQW1N","table-rows-editor":"kne-form-creator_-meJG","is-plain":"kne-form-creator_IiViE","form-actions-editor":"kne-form-creator_fchMy","form-actions-switch-field":"kne-form-creator_6JE9x","form-actions-align-group":"kne-form-creator_51ZsV","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","super-select-props":"kne-form-creator_Iawhh","field-props-editor":"kne-form-creator_Gabf2","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-header":"kne-form-creator_As4L6","options-locale-text":"kne-form-creator_7-99l","options-header-label":"kne-form-creator_UhnVH","options-header-value":"kne-form-creator_2c35V","options-header-description":"kne-form-creator_ibWvX","icon-square-btn-sm":"kne-form-creator_GAh-t","options-header-action":"kne-form-creator_nTN1E","visible-when-editor":"kne-form-creator_ttGnB","visible-when-hint":"kne-form-creator_hPtdv","visible-when-list":"kne-form-creator_aoAt6","visible-when-row":"kne-form-creator_phRgr","visible-when-row-main":"kne-form-creator_l-J7d","visible-when-field":"kne-form-creator_YRh5W","visible-when-operator":"kne-form-creator_DIqFq","visible-when-value":"kne-form-creator_CHcia","visible-when-regex":"kne-form-creator_lKpVo","visible-when-flags":"kne-form-creator_Ps-cu","visible-when-regex-tester":"kne-form-creator_Wf4eG","options-tip":"kne-form-creator_vrTmK","icon-square-btn":"kne-form-creator_DZjCf","locale-text":"kne-form-creator_hMXkE","is-compact":"kne-form-creator_jBFpL","locale-text-item":"kne-form-creator_NqCQD","locale-text-prefix":"kne-form-creator_BQl2X","locale-text-tag":"kne-form-creator_65OWA","add-inline-btn-icon":"kne-form-creator_jbBze","steps-focus":"kne-form-creator_BzrAJ","steps-focus-header":"kne-form-creator_fF02T","steps-focus-meta":"kne-form-creator_4Q3Nt","steps-focus-count":"kne-form-creator_-vGec","steps-focus-count-current":"kne-form-creator_vXk2o","steps-focus-count-total":"kne-form-creator_bpGjx","steps-focus-next":"kne-form-creator_a2ZfJ","steps-focus-title":"kne-form-creator_Q5bvO","steps-focus-track":"kne-form-creator_Cdvj5","steps-focus-segment":"kne-form-creator_4z3t0","is-done":"kne-form-creator_nBNzi","is-current":"kne-form-creator_a8lqo","steps-focus-actions":"kne-form-creator_NgZBR","steps-focus-actions-side":"kne-form-creator_ynPls","is-end":"kne-form-creator_syD91","steps-focus-prev":"kne-form-creator_5NtBV","steps-focus-next-btn":"kne-form-creator_1mMAJ","steps-focus-next-btn-icon":"kne-form-creator_OQvek","steps-focus-done-hint":"kne-form-creator_b0T7j"};
29
29
 
30
30
  const locale$1 = {
31
31
  addField: '添加填写项',
@@ -3348,7 +3348,8 @@ const pickFieldProps = (field, definition) => {
3348
3348
  return {
3349
3349
  inline: props.inline !== false,
3350
3350
  modern: !!props.modern,
3351
- block: !!props.block,
3351
+ // 编辑器用 choiceBlock,避免与字段布局 field.block(占满整行)同名冲突
3352
+ choiceBlock: !!props.block,
3352
3353
  indexType: props.indexType === 'number' || props.indexType === 'check' ? props.indexType : 'letter',
3353
3354
  otherLabel: props.otherOption?.label || '',
3354
3355
  otherPlaceholder: props.otherProps?.placeholder || ''
@@ -3430,7 +3431,8 @@ const applyFieldProps = (props, values, definition) => {
3430
3431
  // 始终落盘布尔值,避免 Checkbox 未勾选时字段缺失被当成默认横向
3431
3432
  props.inline = values.inline !== false;
3432
3433
  props.modern = !!values.modern;
3433
- props.block = !!values.block;
3434
+ // schema 仍写 props.block;编辑器表单字段名为 choiceBlock
3435
+ props.block = !!(values.choiceBlock ?? values.block);
3434
3436
  if (values.modern && (values.indexType === 'number' || values.indexType === 'check')) {
3435
3437
  props.indexType = values.indexType;
3436
3438
  } else {
@@ -5328,6 +5330,11 @@ const BlockConfigFields = ({
5328
5330
  value
5329
5331
  }))
5330
5332
  }, "stepsStyle"), borderedCheckbox, /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
5333
+ name: "showIndex",
5334
+ children: formatMessage({
5335
+ id: 'blockShowIndex'
5336
+ })
5337
+ }, "showIndex"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
5331
5338
  name: "autoStep",
5332
5339
  children: formatMessage({
5333
5340
  id: 'blockAutoStep'
@@ -6571,11 +6578,11 @@ const buildBuiltinList = (type, formatMessage) => {
6571
6578
  id: 'propChoiceModern'
6572
6579
  })
6573
6580
  }, "modern"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
6574
- name: "block",
6581
+ name: "choiceBlock",
6575
6582
  children: formatMessage({
6576
6583
  id: 'propChoiceBlock'
6577
6584
  })
6578
- }, "block"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Select, {
6585
+ }, "choiceBlock"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Select, {
6579
6586
  name: "indexType",
6580
6587
  label: formatMessage({
6581
6588
  id: 'propChoiceIndexType'
@@ -8181,6 +8188,160 @@ const createLocalizedRules = formatMessage => {
8181
8188
  return rules;
8182
8189
  };
8183
8190
 
8191
+ /**
8192
+ * showIndex 连续编号(同一作用域内含子模块字段,不从 1 重起)。
8193
+ *
8194
+ * 作用域根:
8195
+ * - formInfo.showIndex === true
8196
+ * - steps 上 showIndex(或 step.showIndex 覆盖)时,**每一步**各自从 1 起
8197
+ *
8198
+ * 规则:
8199
+ * - 作用域内 DFS:自身 list 字段 → 子 blocks / itemBlocks,连续 1,2,3…
8200
+ * - 嵌套 formInfo / object / choice 继续父级计数,不重起
8201
+ * - choice:各 option 从同一起点编号;计数按「字段数最多的 option」推进,避免切换选项影响后续序号
8202
+ * - list / tableList / editableList:只给「单条模板」编号(每行数字相同),与填写态 List 复用同一套字段节点一致
8203
+ * - matrixScale / multiField / 嵌套 steps:不占题干序号
8204
+ */
8205
+
8206
+ const isIndexableField = field => !!(field && !field.hidden && field.name && field.id);
8207
+ const createIndexCounter = (start = 0) => ({
8208
+ value: start,
8209
+ take() {
8210
+ this.value += 1;
8211
+ return this.value;
8212
+ },
8213
+ peek() {
8214
+ return this.value;
8215
+ }
8216
+ });
8217
+ const assignFields = (fields, counter, map) => {
8218
+ (fields || []).forEach(field => {
8219
+ if (!isIndexableField(field)) {
8220
+ return;
8221
+ }
8222
+ map.set(field.id, counter.take());
8223
+ });
8224
+ };
8225
+ const assignBlock = (block, counter, map) => {
8226
+ if (!block || !block.kind) {
8227
+ return;
8228
+ }
8229
+ switch (block.kind) {
8230
+ case 'formInfo':
8231
+ case 'object':
8232
+ {
8233
+ assignFields(block.list, counter, map);
8234
+ (block.blocks || []).forEach(child => assignBlock(child, counter, map));
8235
+ break;
8236
+ }
8237
+ case 'choice':
8238
+ {
8239
+ const start = counter.peek();
8240
+ let maxEnd = start;
8241
+ (block.options || []).forEach(option => {
8242
+ const optionCounter = createIndexCounter(start);
8243
+ assignFields(option.list, optionCounter, map);
8244
+ (option.blocks || []).forEach(child => assignBlock(child, optionCounter, map));
8245
+ maxEnd = Math.max(maxEnd, optionCounter.peek());
8246
+ });
8247
+ counter.value = maxEnd;
8248
+ break;
8249
+ }
8250
+ case 'list':
8251
+ case 'tableList':
8252
+ case 'editableList':
8253
+ {
8254
+ assignFields(block.list, counter, map);
8255
+ (block.itemBlocks || []).forEach(child => assignBlock(child, counter, map));
8256
+ break;
8257
+ }
8258
+ }
8259
+ };
8260
+
8261
+ /**
8262
+ * 为作用域根(formInfo / object / step 的 { list, blocks })生成 fieldId → 1-based 序号。
8263
+ * @param {object} root
8264
+ * @param {{ enabled?: boolean }} [options]
8265
+ * @returns {Map<string, number>}
8266
+ */
8267
+ const buildFieldIndexMap = (root, {
8268
+ enabled = false
8269
+ } = {}) => {
8270
+ const map = new Map();
8271
+ if (!enabled || !root) {
8272
+ return map;
8273
+ }
8274
+ const counter = createIndexCounter(0);
8275
+ if (root.kind === 'formInfo' || root.kind === 'object') {
8276
+ assignBlock(root, counter, map);
8277
+ return map;
8278
+ }
8279
+ // step 或其它 { list, blocks } 容器
8280
+ assignFields(root.list, counter, map);
8281
+ (root.blocks || []).forEach(child => assignBlock(child, counter, map));
8282
+ return map;
8283
+ };
8284
+
8285
+ /**
8286
+ * 进入子块时的序号上下文:父级已启用则继续同一 map;
8287
+ * 否则仅 formInfo/object 在 showIndex 时新建作用域(steps 按 step 单独建,见 resolveStepIndexContext)。
8288
+ */
8289
+ const resolveIndexContext = (block, parentCtx = {}) => {
8290
+ if (parentCtx.indexMap) {
8291
+ return {
8292
+ indexMap: parentCtx.indexMap,
8293
+ indexEnabled: true
8294
+ };
8295
+ }
8296
+ if (!block || !block.showIndex) {
8297
+ return {
8298
+ indexMap: null,
8299
+ indexEnabled: false
8300
+ };
8301
+ }
8302
+ if (block.kind !== 'formInfo' && block.kind !== 'object') {
8303
+ return {
8304
+ indexMap: null,
8305
+ indexEnabled: false
8306
+ };
8307
+ }
8308
+ return {
8309
+ indexMap: buildFieldIndexMap(block, {
8310
+ enabled: true
8311
+ }),
8312
+ indexEnabled: true
8313
+ };
8314
+ };
8315
+ const resolveStepIndexContext = (step, blockShowIndex) => {
8316
+ const enabled = step && step.showIndex != null ? !!step.showIndex : !!blockShowIndex;
8317
+ if (!enabled) {
8318
+ return {
8319
+ indexMap: null,
8320
+ indexEnabled: false
8321
+ };
8322
+ }
8323
+ const indexMap = buildFieldIndexMap(step, {
8324
+ enabled: true
8325
+ });
8326
+ return {
8327
+ indexMap,
8328
+ indexEnabled: true
8329
+ };
8330
+ };
8331
+ const fieldDisplayIndex = (indexMap, field) => {
8332
+ if (!indexMap || !field || !field.id) {
8333
+ return null;
8334
+ }
8335
+ const value = indexMap.get(field.id);
8336
+ return value == null ? null : value;
8337
+ };
8338
+ const blockHasIndexedFields = (block, indexMap) => {
8339
+ if (!indexMap || !block) {
8340
+ return false;
8341
+ }
8342
+ return (block.list || []).some(field => field && indexMap.has(field.id));
8343
+ };
8344
+
8184
8345
  const buildLabelTips = tips => {
8185
8346
  if (tips == null || !String(tips).trim()) {
8186
8347
  return undefined;
@@ -8200,14 +8361,16 @@ const buildFieldLabel = field => {
8200
8361
  const base = field?.label != null && String(field.label).trim() ? String(field.label).trim() : field?.name || '';
8201
8362
  return base || undefined;
8202
8363
  };
8203
- const buildIndexedLabelRender = index => {
8364
+
8365
+ /** displayIndex 为 1-based 连续序号 */
8366
+ const buildIndexedLabelRender = displayIndex => {
8204
8367
  return ({
8205
8368
  label
8206
8369
  }) => {
8207
8370
  const text = label != null ? String(label).replace(/\u200b/g, '') : '';
8208
8371
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement('span', {
8209
8372
  className: style['field-label-index']
8210
- }, `${index + 1}.`), text ? /*#__PURE__*/react.createElement('span', {
8373
+ }, `${displayIndex}.`), text ? /*#__PURE__*/react.createElement('span', {
8211
8374
  className: style['field-label-main']
8212
8375
  }, text) : null);
8213
8376
  };
@@ -8215,8 +8378,8 @@ const buildIndexedLabelRender = index => {
8215
8378
  const renderFieldEntries = (fields = [], preview = false, {
8216
8379
  namePrefix,
8217
8380
  locale,
8218
- showIndex = false
8219
- } = {}) => (fields || []).filter(field => !field.hidden).map((field, index) => {
8381
+ indexMap = null
8382
+ } = {}) => (fields || []).filter(field => !field.hidden).map(field => {
8220
8383
  const Component = getFieldComponent(field.type, field);
8221
8384
  if (!Component) {
8222
8385
  return null;
@@ -8234,12 +8397,18 @@ const renderFieldEntries = (fields = [], preview = false, {
8234
8397
  }
8235
8398
  delete props.range;
8236
8399
 
8237
- // 选择组:form-creator 的 inline 仅编辑器用;渲染时删掉。block/modern 交给 react-form-antd;
8238
- // 未开 block 且 inline=false 时沿用旧纵向兜底
8400
+ // 选择组:inline 仅编辑器用;props.block(块级选项)经 isBlock 透传。
8401
+ // form-info / react-form-plus 会吃掉布局用 block,并把 isBlock remap 为控件 block。
8402
+ // 未开块级选项且 inline=false 时沿用旧纵向兜底。
8239
8403
  if (field.type === 'RadioGroup' || field.type === 'CheckboxGroup' || field.type === 'RadioGroupOther' || field.type === 'CheckboxGroupOther') {
8240
8404
  const optionsInline = props.inline !== false;
8405
+ const choiceBlock = !!props.block;
8241
8406
  delete props.inline;
8242
- if (!props.block && !optionsInline) {
8407
+ delete props.block;
8408
+ if (choiceBlock) {
8409
+ props.isBlock = true;
8410
+ }
8411
+ if (!choiceBlock && !optionsInline) {
8243
8412
  if (field.type === 'RadioGroup' || field.type === 'RadioGroupOther') {
8244
8413
  props.vertical = true;
8245
8414
  }
@@ -8253,14 +8422,16 @@ const renderFieldEntries = (fields = [], preview = false, {
8253
8422
  locale
8254
8423
  } : {};
8255
8424
  const label = buildFieldLabel(field);
8425
+ const displayIndex = fieldDisplayIndex(indexMap, field);
8256
8426
  const element = /*#__PURE__*/react.createElement(Component, {
8257
8427
  key: field.id,
8258
8428
  name: fieldName,
8259
- label: showIndex ? label || '\u200b' : label,
8260
- ...(showIndex ? {
8261
- labelRender: buildIndexedLabelRender(index)
8429
+ label: displayIndex != null ? label || '\u200b' : label,
8430
+ ...(displayIndex != null ? {
8431
+ labelRender: buildIndexedLabelRender(displayIndex)
8262
8432
  } : null),
8263
8433
  rule: field.rule || undefined,
8434
+ // 仅布局「占满整行」;块级选项样式走上方 isBlock,避免被 form-plus 剥掉后失效
8264
8435
  block: field.block || undefined,
8265
8436
  ...props,
8266
8437
  ...localeProps,
@@ -8332,17 +8503,22 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8332
8503
  if (!block || depth > MAX_BLOCK_DEPTH) {
8333
8504
  return null;
8334
8505
  }
8506
+ const indexCtx = resolveIndexContext(block, ctx);
8335
8507
  const nextCtx = {
8336
8508
  ...ctx,
8337
8509
  depth: depth + 1,
8338
- asListItem: false
8510
+ asListItem: false,
8511
+ indexMap: indexCtx.indexMap,
8512
+ indexEnabled: indexCtx.indexEnabled
8339
8513
  };
8340
8514
  const fieldRenderOpts = {
8341
- locale
8515
+ locale,
8516
+ indexMap: indexCtx.indexMap
8342
8517
  };
8343
8518
  const bordered = isMobile ? false : block.bordered || undefined;
8344
8519
  // 仅 FormInfo/object 吃列表项 Part 样式;List 等交给 form-info nestDepth
8345
8520
  const listItemPartProps = asListItem && isFormInfoLikeBlock(block.kind) ? nestedListItemPartProps : null;
8521
+ const indexClassName = blockHasIndexedFields(block, indexCtx.indexMap) ? style['form-info-show-index'] : null;
8346
8522
  const renderChildBlocks = (blocks = [], childCtx = nextCtx) => (blocks || []).map(child => renderBlockElement(child, preview, childCtx)).filter(Boolean);
8347
8523
 
8348
8524
  /** list.itemBlocks:object/formInfo 走 asListItem;嵌套 list 等保持 nestDepth 链路 */
@@ -8356,11 +8532,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8356
8532
  switch (block.kind) {
8357
8533
  case 'formInfo':
8358
8534
  {
8359
- const showIndex = !!block.showIndex;
8360
- const entries = renderFieldEntries(block.list, preview, {
8361
- ...fieldRenderOpts,
8362
- showIndex
8363
- });
8535
+ const entries = renderFieldEntries(block.list, preview, fieldRenderOpts);
8364
8536
  const nested = renderChildBlocks(block.blocks || [], nextCtx).map(node => withBlockLayout(node, true));
8365
8537
  return withBlockLayout(createFieldsFormInfo({
8366
8538
  key: block.id,
@@ -8370,7 +8542,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8370
8542
  gap: block.gap,
8371
8543
  bordered,
8372
8544
  ...(listItemPartProps || {}),
8373
- className: resolvePartRootClassName(depth, showIndex ? style['form-info-show-index'] : null)
8545
+ className: resolvePartRootClassName(depth, indexClassName)
8374
8546
  }, entries, nested, knownNames), asListItem);
8375
8547
  }
8376
8548
  case 'object':
@@ -8388,7 +8560,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8388
8560
  gap: block.gap,
8389
8561
  bordered,
8390
8562
  ...(listItemPartProps || {}),
8391
- className: resolvePartRootClassName(depth)
8563
+ className: resolvePartRootClassName(depth, indexClassName)
8392
8564
  }, entries, nested, knownNames), asListItem);
8393
8565
  }
8394
8566
  case 'list':
@@ -8401,7 +8573,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8401
8573
  title: block.title || undefined,
8402
8574
  important: block.important || undefined,
8403
8575
  bordered,
8404
- className: resolvePartRootClassName(depth),
8576
+ className: resolvePartRootClassName(depth, indexClassName),
8405
8577
  maxLength: block.maxLength,
8406
8578
  minLength: block.minLength,
8407
8579
  ...(block.addText ? {
@@ -8428,7 +8600,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8428
8600
  } : {}),
8429
8601
  list: fields,
8430
8602
  ...(listItemPartProps || {}),
8431
- className: resolvePartRootClassName(depth)
8603
+ className: resolvePartRootClassName(depth, indexClassName)
8432
8604
  }), asListItem);
8433
8605
  }
8434
8606
  case 'editableList':
@@ -8440,7 +8612,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8440
8612
  name: block.name,
8441
8613
  title: block.title || undefined,
8442
8614
  bordered,
8443
- className: resolvePartRootClassName(depth),
8615
+ className: resolvePartRootClassName(depth, indexClassName),
8444
8616
  column: block.column,
8445
8617
  maxLength: block.maxLength,
8446
8618
  minLength: block.minLength,
@@ -8505,7 +8677,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8505
8677
  case 'steps':
8506
8678
  {
8507
8679
  const isFocusSteps = block.stepsStyle === 'focus';
8508
- // 与 formInfo 一致:block.showIndex(或 step 上覆盖)时给题干加序号
8680
+ // 每步独立作用域;步内嵌套子模块连续编号
8509
8681
  const blockShowIndex = !!block.showIndex;
8510
8682
  return withBlockLayout(/*#__PURE__*/react.createElement(isFocusSteps ? FocusSteps$1 : FormInfo.Steps, {
8511
8683
  key: block.id,
@@ -8519,15 +8691,20 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8519
8691
  prevIcon: /*#__PURE__*/react.createElement(icons.ArrowLeftOutlined),
8520
8692
  nextIcon: /*#__PURE__*/react.createElement(icons.ArrowRightOutlined),
8521
8693
  items: (block.items || []).map(step => {
8522
- const showIndex = step.showIndex != null ? !!step.showIndex : blockShowIndex;
8694
+ const stepIndexCtx = resolveStepIndexContext(step, blockShowIndex);
8695
+ const stepCtx = {
8696
+ ...nextCtx,
8697
+ indexMap: stepIndexCtx.indexMap,
8698
+ indexEnabled: stepIndexCtx.indexEnabled
8699
+ };
8523
8700
  const entries = renderFieldEntries(step.list, preview, {
8524
- ...fieldRenderOpts,
8525
- showIndex
8701
+ locale,
8702
+ indexMap: stepIndexCtx.indexMap
8526
8703
  });
8527
- const nested = renderChildBlocks(step.blocks || [], nextCtx);
8704
+ const nested = renderChildBlocks(step.blocks || [], stepCtx);
8528
8705
  const fieldNames = [...(step.list || []).filter(field => field && !field.hidden && field.name).map(field => field.name), ...collectBlockFieldNames(step.blocks || [])];
8529
8706
  const hasConditional = entries.some(entry => entry.visibleWhen);
8530
- const indexClassName = showIndex ? style['form-info-show-index'] : null;
8707
+ const stepIndexClassName = stepIndexCtx.indexEnabled ? style['form-info-show-index'] : null;
8531
8708
  if (nested.length || hasConditional) {
8532
8709
  return {
8533
8710
  key: step.id,
@@ -8541,7 +8718,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8541
8718
  key: `${step.id}-fields`,
8542
8719
  column: step.column,
8543
8720
  gap: block.gap,
8544
- className: indexClassName
8721
+ className: stepIndexClassName
8545
8722
  }, entries, [], knownNames) : null, ...nested)
8546
8723
  };
8547
8724
  }
@@ -8551,7 +8728,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8551
8728
  column: step.column,
8552
8729
  gap: block.gap,
8553
8730
  list: entries.map(entry => entry.element),
8554
- className: indexClassName,
8731
+ className: stepIndexClassName,
8555
8732
  fieldNames
8556
8733
  };
8557
8734
  })
@@ -8568,11 +8745,16 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8568
8745
  renderOptionContent: option => {
8569
8746
  const nodes = [];
8570
8747
  if ((option.list || []).length) {
8748
+ const optionIndexClassName = (option.list || []).some(field => fieldDisplayIndex(indexCtx.indexMap, field) != null) ? style['form-info-show-index'] : null;
8571
8749
  nodes.push(createFieldsFormInfo({
8572
8750
  key: `${option.id}-fields`,
8573
8751
  column: block.column || 2,
8574
- gap: block.gap
8575
- }, renderFieldEntries(option.list, preview), [], knownNames));
8752
+ gap: block.gap,
8753
+ className: optionIndexClassName
8754
+ }, renderFieldEntries(option.list, preview, {
8755
+ locale,
8756
+ indexMap: indexCtx.indexMap
8757
+ }), [], knownNames));
8576
8758
  }
8577
8759
  nodes.push(...renderChildBlocks(option.blocks || [], nextCtx));
8578
8760
  return nodes.filter(Boolean);
@@ -10306,6 +10488,214 @@ const schemaToDataSchema = (schema, options = {}) => {
10306
10488
  return root;
10307
10489
  };
10308
10490
 
10491
+ const isMatrixChoiceSelected = (cellValue, optionValue) => {
10492
+ if (Array.isArray(cellValue)) {
10493
+ return cellValue.some(item => item === optionValue || item && typeof item === 'object' && (item.value === optionValue || item.id === optionValue));
10494
+ }
10495
+ if (cellValue && typeof cellValue === 'object') {
10496
+ return cellValue.value === optionValue || cellValue.id === optionValue;
10497
+ }
10498
+ return cellValue === optionValue;
10499
+ };
10500
+
10501
+ /** 只读矩阵:对齐填写态 MatrixScale 的表头 + 行列网格,而不是摊成普通字段列表 */
10502
+ const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) => {
10503
+ const layout = block.layout === 'columns' || block.layout === 'field' ? block.layout : 'options';
10504
+ const fieldType = block.fieldType || 'RadioGroup';
10505
+ const rows = (block.rows || []).filter(row => row && row.name != null && String(row.name).trim());
10506
+ if (!rows.length) {
10507
+ return null;
10508
+ }
10509
+ const emptyText = formatMessage({
10510
+ id: 'schemaContentEmptyValue'
10511
+ });
10512
+ const rowTitle = block.rowTitle || '';
10513
+ if (layout === 'options') {
10514
+ const options = (block.options || []).filter(option => option && (option.value != null || option.label != null));
10515
+ const optionCount = Math.max(options.length, 1);
10516
+ const formatRowValue = rowValue => formatFieldValue({
10517
+ type: fieldType,
10518
+ props: {
10519
+ options: block.options || []
10520
+ }
10521
+ }, rowValue, formatMessage) || emptyText;
10522
+ if (isMobile || !options.length) {
10523
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
10524
+ className: [style['schema-content-matrix'], style['is-mobile']].join(' '),
10525
+ children: rows.map(row => {
10526
+ const rowName = String(row.name).trim();
10527
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
10528
+ className: style['schema-content-matrix-mobile-row'],
10529
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10530
+ className: style['schema-content-matrix-mobile-label'],
10531
+ children: row.label || rowName
10532
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
10533
+ className: style['schema-content-matrix-mobile-value'],
10534
+ children: formatRowValue(matrixData?.[rowName])
10535
+ })]
10536
+ }, rowName);
10537
+ })
10538
+ });
10539
+ }
10540
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
10541
+ className: [style['schema-content-matrix'], style['is-choice']].join(' '),
10542
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
10543
+ className: style['schema-content-matrix-inner'],
10544
+ style: {
10545
+ '--matrix-scale-option-count': optionCount
10546
+ },
10547
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
10548
+ className: style['schema-content-matrix-header'],
10549
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10550
+ className: style['schema-content-matrix-row-title'],
10551
+ children: rowTitle
10552
+ }), options.map(option => /*#__PURE__*/jsxRuntime.jsx("div", {
10553
+ className: style['schema-content-matrix-option-title'],
10554
+ children: option.label ?? String(option.value)
10555
+ }, String(option.value)))]
10556
+ }), rows.map(row => {
10557
+ const rowName = String(row.name).trim();
10558
+ const rowValue = matrixData?.[rowName];
10559
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
10560
+ className: style['schema-content-matrix-row'],
10561
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10562
+ className: style['schema-content-matrix-row-label'],
10563
+ children: row.label || rowName
10564
+ }), options.map(option => {
10565
+ const selected = isMatrixChoiceSelected(rowValue, option.value);
10566
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
10567
+ className: [style['schema-content-matrix-cell'], selected ? style['is-selected'] : null].filter(Boolean).join(' '),
10568
+ children: selected ? /*#__PURE__*/jsxRuntime.jsx(icons.CheckOutlined, {}) : null
10569
+ }, String(option.value));
10570
+ })]
10571
+ }, rowName);
10572
+ })]
10573
+ })
10574
+ });
10575
+ }
10576
+ if (layout === 'columns') {
10577
+ const columns = (block.columns || []).filter(column => column && column.name != null && String(column.name).trim());
10578
+ const optionCount = Math.max(columns.length, 1);
10579
+ const formatCell = value => formatFieldValue({
10580
+ type: fieldType,
10581
+ props: {}
10582
+ }, value, formatMessage) || emptyText;
10583
+ if (isMobile || !columns.length) {
10584
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
10585
+ className: [style['schema-content-matrix'], style['is-mobile']].join(' '),
10586
+ children: rows.map(row => {
10587
+ const rowName = String(row.name).trim();
10588
+ const rowData = matrixData?.[rowName] || {};
10589
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
10590
+ className: style['schema-content-matrix-mobile-row'],
10591
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10592
+ className: style['schema-content-matrix-mobile-label'],
10593
+ children: row.label || rowName
10594
+ }), columns.length ? columns.map(column => {
10595
+ const columnName = String(column.name).trim();
10596
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
10597
+ className: style['schema-content-matrix-mobile-cell'],
10598
+ children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
10599
+ className: style['schema-content-matrix-mobile-cell-label'],
10600
+ children: [column.label || columnName, "\uFF1A"]
10601
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
10602
+ children: formatCell(rowData?.[columnName])
10603
+ })]
10604
+ }, columnName);
10605
+ }) : null]
10606
+ }, rowName);
10607
+ })
10608
+ });
10609
+ }
10610
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
10611
+ className: style['schema-content-matrix'],
10612
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
10613
+ className: style['schema-content-matrix-inner'],
10614
+ style: {
10615
+ '--matrix-scale-option-count': optionCount
10616
+ },
10617
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
10618
+ className: style['schema-content-matrix-header'],
10619
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10620
+ className: style['schema-content-matrix-row-title'],
10621
+ children: rowTitle
10622
+ }), columns.map(column => /*#__PURE__*/jsxRuntime.jsx("div", {
10623
+ className: style['schema-content-matrix-option-title'],
10624
+ children: column.label || String(column.name)
10625
+ }, String(column.name)))]
10626
+ }), rows.map(row => {
10627
+ const rowName = String(row.name).trim();
10628
+ const rowData = matrixData?.[rowName] || {};
10629
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
10630
+ className: [style['schema-content-matrix-row'], style['is-cells']].join(' '),
10631
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10632
+ className: style['schema-content-matrix-row-label'],
10633
+ children: row.label || rowName
10634
+ }), columns.map(column => {
10635
+ const columnName = String(column.name).trim();
10636
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
10637
+ className: style['schema-content-matrix-cell'],
10638
+ children: formatCell(rowData?.[columnName])
10639
+ }, columnName);
10640
+ })]
10641
+ }, rowName);
10642
+ })]
10643
+ })
10644
+ });
10645
+ }
10646
+
10647
+ // field:每行一个值,仍保留行标题列的矩阵观感
10648
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
10649
+ className: [style['schema-content-matrix'], isMobile ? style['is-mobile'] : null].filter(Boolean).join(' '),
10650
+ children: isMobile ? rows.map(row => {
10651
+ const rowName = String(row.name).trim();
10652
+ const text = formatFieldValue({
10653
+ type: fieldType,
10654
+ props: {}
10655
+ }, matrixData?.[rowName], formatMessage) || emptyText;
10656
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
10657
+ className: style['schema-content-matrix-mobile-row'],
10658
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10659
+ className: style['schema-content-matrix-mobile-label'],
10660
+ children: row.label || rowName
10661
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
10662
+ className: style['schema-content-matrix-mobile-value'],
10663
+ children: text
10664
+ })]
10665
+ }, rowName);
10666
+ }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
10667
+ className: style['schema-content-matrix-inner'],
10668
+ style: {
10669
+ '--matrix-scale-option-count': 1
10670
+ },
10671
+ children: [rowTitle ? /*#__PURE__*/jsxRuntime.jsxs("div", {
10672
+ className: style['schema-content-matrix-header'],
10673
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10674
+ className: style['schema-content-matrix-row-title'],
10675
+ children: rowTitle
10676
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
10677
+ className: style['schema-content-matrix-option-title']
10678
+ })]
10679
+ }) : null, rows.map(row => {
10680
+ const rowName = String(row.name).trim();
10681
+ const text = formatFieldValue({
10682
+ type: fieldType,
10683
+ props: {}
10684
+ }, matrixData?.[rowName], formatMessage) || emptyText;
10685
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
10686
+ className: [style['schema-content-matrix-row'], style['is-cells']].join(' '),
10687
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10688
+ className: style['schema-content-matrix-row-label'],
10689
+ children: row.label || rowName
10690
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
10691
+ className: style['schema-content-matrix-cell'],
10692
+ children: text
10693
+ })]
10694
+ }, rowName);
10695
+ })]
10696
+ })
10697
+ });
10698
+ };
10309
10699
  const getByPath = (data, path) => {
10310
10700
  if (data == null || path == null || path === '') {
10311
10701
  return data;
@@ -10330,12 +10720,13 @@ const formatFieldValue = (field, value, formatMessage) => formatFieldDisplayValu
10330
10720
  * 改为 label 在上、值在下,避免窄栏(如弹窗双栏预览)被撑乱。
10331
10721
  */
10332
10722
  const renderFieldsContent = (fields, data, formatMessage, column, {
10333
- showIndex = false,
10723
+ indexMap = null,
10334
10724
  isFieldVisible
10335
10725
  } = {}) => {
10336
- const list = (fields || []).filter(field => field && !field.hidden && field.name && (!isFieldVisible || isFieldVisible(field))).map((field, index) => {
10726
+ const list = (fields || []).filter(field => field && !field.hidden && field.name && (!isFieldVisible || isFieldVisible(field))).map(field => {
10337
10727
  const baseLabel = field.label || field.name;
10338
- const label = showIndex ? `${index + 1}. ${baseLabel}` : baseLabel;
10728
+ const displayIndex = fieldDisplayIndex(indexMap, field);
10729
+ const label = displayIndex != null ? `${displayIndex}. ${baseLabel}` : baseLabel;
10339
10730
  return {
10340
10731
  label,
10341
10732
  content: formatFieldValue(field, getByPath(data, field.name), formatMessage),
@@ -10383,8 +10774,9 @@ const resolveListItemTitle = (block, item, index, formatMessage) => {
10383
10774
  // ignore bad itemTitle
10384
10775
  }
10385
10776
  }
10386
- const head = (block.itemBlocks || []).find(child => child && (child.title || child.label));
10387
- if (head) {
10777
+ // 只有列表自身没有字段、首个子块即项头时才借用其标题;否则会把「时间窗口」等子块标题误当成项标题
10778
+ const head = (block.list || []).length ? null : (block.itemBlocks || [])[0];
10779
+ if (head && (head.title || head.label)) {
10388
10780
  return {
10389
10781
  title: head.title || head.label,
10390
10782
  titleFromItemBlockId: head.id
@@ -10409,9 +10801,12 @@ const renderBlock = (block, data, ctx) => {
10409
10801
  if (!block || depth > MAX_BLOCK_DEPTH) {
10410
10802
  return null;
10411
10803
  }
10804
+ const indexCtx = resolveIndexContext(block, ctx);
10412
10805
  const nextCtx = {
10413
10806
  ...ctx,
10414
- depth: depth + 1
10807
+ depth: depth + 1,
10808
+ indexMap: indexCtx.indexMap,
10809
+ indexEnabled: indexCtx.indexEnabled
10415
10810
  };
10416
10811
  const bordered = isMobile ? false : block.bordered || undefined;
10417
10812
  const partProps = {
@@ -10421,15 +10816,16 @@ const renderBlock = (block, data, ctx) => {
10421
10816
  bordered,
10422
10817
  className: depth === 0 ? InfoPage__default["default"].partRootClassName : undefined
10423
10818
  };
10819
+ const fieldIndexOpts = {
10820
+ indexMap: indexCtx.indexMap,
10821
+ isFieldVisible
10822
+ };
10424
10823
  switch (block.kind) {
10425
10824
  case 'formInfo':
10426
10825
  {
10427
10826
  return /*#__PURE__*/jsxRuntime.jsxs(InfoPage__default["default"].Part, {
10428
10827
  ...partProps,
10429
- children: [renderFieldsContent(block.list, data, formatMessage, block.column, {
10430
- showIndex: !!block.showIndex,
10431
- isFieldVisible
10432
- }), renderBlockList(block.blocks, data, nextCtx)]
10828
+ children: [renderFieldsContent(block.list, data, formatMessage, block.column, fieldIndexOpts), renderBlockList(block.blocks, data, nextCtx)]
10433
10829
  });
10434
10830
  }
10435
10831
  case 'object':
@@ -10438,9 +10834,7 @@ const renderBlock = (block, data, ctx) => {
10438
10834
  const nestedData = name ? getByPath(data, name) || {} : data;
10439
10835
  return /*#__PURE__*/jsxRuntime.jsxs(InfoPage__default["default"].Part, {
10440
10836
  ...partProps,
10441
- children: [renderFieldsContent(block.list, nestedData, formatMessage, block.column, {
10442
- isFieldVisible
10443
- }), renderBlockList(block.blocks, nestedData, nextCtx)]
10837
+ children: [renderFieldsContent(block.list, nestedData, formatMessage, block.column, fieldIndexOpts), renderBlockList(block.blocks, nestedData, nextCtx)]
10444
10838
  });
10445
10839
  }
10446
10840
  case 'list':
@@ -10452,21 +10846,27 @@ const renderBlock = (block, data, ctx) => {
10452
10846
  const rows = Array.isArray(items) ? items : [];
10453
10847
  return /*#__PURE__*/jsxRuntime.jsx(InfoPage__default["default"].Part, {
10454
10848
  ...partProps,
10455
- children: rows.length ? rows.map((item, index) => {
10456
- const {
10457
- title: itemTitle,
10458
- titleFromItemBlockId
10459
- } = resolveListItemTitle(block, item || {}, index, formatMessage);
10460
- const itemBlocks = supportsItemBlocks(block.kind) && titleFromItemBlockId ? (block.itemBlocks || []).map(child => child && child.id === titleFromItemBlockId ? {
10461
- ...child,
10462
- title: undefined,
10463
- label: undefined
10464
- } : child) : block.itemBlocks;
10465
- return /*#__PURE__*/jsxRuntime.jsxs(InfoPage__default["default"].Part, {
10466
- title: itemTitle,
10467
- bordered: false,
10468
- children: [renderFieldsContent(block.list, item || {}, formatMessage, 2), supportsItemBlocks(block.kind) ? renderBlockList(itemBlocks, item || {}, nextCtx) : null]
10469
- }, `${block.id}-${index}`);
10849
+ children: rows.length ? /*#__PURE__*/jsxRuntime.jsx("div", {
10850
+ className: style['schema-content-list-items'],
10851
+ children: rows.map((item, index) => {
10852
+ const {
10853
+ title: itemTitle,
10854
+ titleFromItemBlockId
10855
+ } = resolveListItemTitle(block, item || {}, index, formatMessage);
10856
+ // 标题已提到列表项头部,原 itemBlock 只剩字段:去掉边框,避免留下无标题空框
10857
+ const itemBlocks = supportsItemBlocks(block.kind) && titleFromItemBlockId ? (block.itemBlocks || []).map(child => child && child.id === titleFromItemBlockId ? {
10858
+ ...child,
10859
+ title: undefined,
10860
+ label: undefined,
10861
+ bordered: false
10862
+ } : child) : block.itemBlocks;
10863
+ return /*#__PURE__*/jsxRuntime.jsxs(InfoPage__default["default"].Part, {
10864
+ className: style['schema-content-list-item'],
10865
+ title: itemTitle,
10866
+ bordered: false,
10867
+ children: [renderFieldsContent(block.list, item || {}, formatMessage, 2, fieldIndexOpts), supportsItemBlocks(block.kind) ? renderBlockList(itemBlocks, item || {}, nextCtx) : null]
10868
+ }, `${block.id}-${index}`);
10869
+ })
10470
10870
  }) : formatMessage({
10471
10871
  id: 'schemaContentEmptyValue'
10472
10872
  })
@@ -10502,16 +10902,90 @@ const renderBlock = (block, data, ctx) => {
10502
10902
  })
10503
10903
  });
10504
10904
  }
10905
+ case 'matrixScale':
10906
+ {
10907
+ const name = block.name != null && String(block.name).trim() ? String(block.name).trim() : '';
10908
+ if (!name) {
10909
+ return null;
10910
+ }
10911
+ const matrixData = getByPath(data, name) || {};
10912
+ const content = renderMatrixScaleContent(block, matrixData, formatMessage, isMobile);
10913
+ const title = block.title || block.label || undefined;
10914
+ // 矩阵表头已展示 rowTitle,Part 副标题不再重复挂它
10915
+ const subtitle = block.subtitle || undefined;
10916
+ if (!content && !title && !subtitle) {
10917
+ return null;
10918
+ }
10919
+ return /*#__PURE__*/jsxRuntime.jsx(InfoPage__default["default"].Part, {
10920
+ ...partProps,
10921
+ title: title,
10922
+ subtitle: subtitle,
10923
+ children: content
10924
+ });
10925
+ }
10505
10926
  case 'steps':
10506
10927
  {
10507
- return /*#__PURE__*/jsxRuntime.jsx(react.Fragment, {
10508
- children: (block.items || []).map(step => /*#__PURE__*/jsxRuntime.jsxs(InfoPage__default["default"].Part, {
10509
- title: step.title || undefined,
10510
- bordered: bordered,
10511
- children: [renderFieldsContent(step.list, data, formatMessage, step.column || 2, {
10512
- isFieldVisible
10513
- }), renderBlockList(step.blocks, data, nextCtx)]
10514
- }, step.id))
10928
+ const items = block.items || [];
10929
+ const total = items.length;
10930
+ const isFocus = block.stepsStyle === 'focus';
10931
+ const blockShowIndex = !!block.showIndex;
10932
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
10933
+ className: style['schema-content-steps'],
10934
+ children: items.map((step, index) => {
10935
+ const stepTitle = step.title || formatMessage({
10936
+ id: 'untitledStep'
10937
+ }, {
10938
+ index: index + 1
10939
+ });
10940
+ const stepIndexCtx = resolveStepIndexContext(step, blockShowIndex);
10941
+ const stepCtx = {
10942
+ ...nextCtx,
10943
+ indexMap: stepIndexCtx.indexMap,
10944
+ indexEnabled: stepIndexCtx.indexEnabled
10945
+ };
10946
+ const body = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
10947
+ children: [renderFieldsContent(step.list, data, formatMessage, step.column || 1, {
10948
+ indexMap: stepIndexCtx.indexMap,
10949
+ isFieldVisible
10950
+ }), renderBlockList(step.blocks, data, stepCtx)]
10951
+ });
10952
+ if (isFocus) {
10953
+ return /*#__PURE__*/jsxRuntime.jsxs("section", {
10954
+ className: style['schema-content-step'],
10955
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
10956
+ className: style['steps-focus-header'],
10957
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
10958
+ className: style['steps-focus-meta'],
10959
+ children: /*#__PURE__*/jsxRuntime.jsxs("span", {
10960
+ className: style['steps-focus-count'],
10961
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
10962
+ className: style['steps-focus-count-current'],
10963
+ children: String(index + 1).padStart(2, '0')
10964
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
10965
+ className: style['steps-focus-count-total'],
10966
+ children: ["/ ", String(total).padStart(2, '0')]
10967
+ })]
10968
+ })
10969
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
10970
+ className: style['steps-focus-title'],
10971
+ children: stepTitle
10972
+ }), step.subtitle ? /*#__PURE__*/jsxRuntime.jsx("div", {
10973
+ className: style['schema-content-step-subtitle'],
10974
+ children: step.subtitle
10975
+ }) : null]
10976
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
10977
+ className: style['schema-content-step-body'],
10978
+ children: body
10979
+ })]
10980
+ }, step.id || index);
10981
+ }
10982
+ return /*#__PURE__*/jsxRuntime.jsx(InfoPage__default["default"].Part, {
10983
+ title: stepTitle,
10984
+ subtitle: step.subtitle || undefined,
10985
+ bordered: bordered,
10986
+ children: body
10987
+ }, step.id || index);
10988
+ })
10515
10989
  }, block.id);
10516
10990
  }
10517
10991
  case 'choice':
@@ -10526,9 +11000,7 @@ const renderBlock = (block, data, ctx) => {
10526
11000
  children: visibleOptions.map(option => /*#__PURE__*/jsxRuntime.jsxs(InfoPage__default["default"].Part, {
10527
11001
  title: option.title || undefined,
10528
11002
  bordered: false,
10529
- children: [renderFieldsContent(option.list, data, formatMessage, block.column, {
10530
- isFieldVisible
10531
- }), renderBlockList(option.blocks, data, nextCtx)]
11003
+ children: [renderFieldsContent(option.list, data, formatMessage, block.column, fieldIndexOpts), renderBlockList(option.blocks, data, nextCtx)]
10532
11004
  }, option.id))
10533
11005
  });
10534
11006
  }