@kne/form-creator 0.1.32 → 0.1.34
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 +1 -1
- package/dist/index.css +52 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +242 -98
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +252 -110
- package/dist/index.modern.js.map +1 -1
- package/dist/locale/en-US.js +12 -4
- package/dist/locale/en-US.js.map +1 -1
- package/dist/locale/en-US.modern.js +12 -4
- package/dist/locale/en-US.modern.js.map +1 -1
- package/dist/locale/zh-CN.js +12 -4
- package/dist/locale/zh-CN.js.map +1 -1
- package/dist/locale/zh-CN.modern.js +12 -4
- package/dist/locale/zh-CN.modern.js.map +1 -1
- package/package.json +1 -1
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-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-
|
|
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-span-input":"kne-form-creator_7flo9","matrix-scale-min-input":"kne-form-creator_iZaOM","matrix-scale-input-affix":"kne-form-creator_5ROXL","matrix-scale-options-row":"kne-form-creator_HRx5W","options-list":"kne-form-creator_GUBNS","icon-square-btn-sm":"kne-form-creator_GAh-t","has-column-layout":"kne-form-creator_f4F8Q","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-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","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: '添加填写项',
|
|
@@ -128,15 +128,15 @@ const locale$1 = {
|
|
|
128
128
|
multiFieldEditorHint: '同类多值模块会根据你选择的填写项类型,自动生成可增减的多个输入框。',
|
|
129
129
|
matrixScaleRowTitle: '行标题列名',
|
|
130
130
|
matrixScaleRowTitlePlaceholder: '例如:活动',
|
|
131
|
-
|
|
131
|
+
matrixScaleRowTitleWidth: '问题列最小宽度(px)',
|
|
132
132
|
matrixScaleLayout_options: '选项矩阵',
|
|
133
133
|
matrixScaleLayout_columns: '单元格矩阵',
|
|
134
134
|
matrixScaleLayout_field: '每行一个字段',
|
|
135
135
|
matrixScaleRequired: '每行(每格)必填',
|
|
136
136
|
matrixScaleSummary: '{type} · {layout} · {rows} 行',
|
|
137
|
-
matrixScaleEditorHint_options: '
|
|
138
|
-
matrixScaleEditorHint_columns: '
|
|
139
|
-
matrixScaleEditorHint_field: '
|
|
137
|
+
matrixScaleEditorHint_options: '填写项为单选/多选:量表选项即表头各列,每行选一个(或多个)。',
|
|
138
|
+
matrixScaleEditorHint_columns: '每个格子是一个填写项;删光列则变为每行一个填写项。',
|
|
139
|
+
matrixScaleEditorHint_field: '当前每行一个填写项;添加列后变为每格一个填写项。',
|
|
140
140
|
matrixScaleRowsTitle: '行配置',
|
|
141
141
|
matrixScaleRowsHint: '左侧为行标题,右侧为保存用的名称',
|
|
142
142
|
matrixScaleRowLabelPlaceholder: '例如:工作/学习',
|
|
@@ -144,9 +144,17 @@ const locale$1 = {
|
|
|
144
144
|
matrixScaleOptionsTitle: '量表选项(列)',
|
|
145
145
|
matrixScaleColumnsTitle: '列配置',
|
|
146
146
|
matrixScaleColumnsHint: '左侧为列标题,右侧为保存用的名称',
|
|
147
|
+
matrixScaleColumnLayoutHint: '「比例」控制相对宽度(如 1:2:1);「最小宽」为该列最小宽度(单位 px,可选);横向滚动时行标题列固定并带阴影',
|
|
148
|
+
matrixScaleColumnSpan: '列显示比例',
|
|
149
|
+
matrixScaleColumnSpanShort: '比例',
|
|
150
|
+
matrixScaleColumnMin: '列最小宽度',
|
|
151
|
+
matrixScaleColumnMinShort: '最小宽',
|
|
152
|
+
matrixScaleColumnMinUnit: 'px',
|
|
147
153
|
matrixScaleColumnLabelPlaceholder: '例如:周一',
|
|
148
154
|
matrixScaleColumnNamePlaceholder: '例如:mon',
|
|
149
155
|
matrixScaleAddRow: '添加一行',
|
|
156
|
+
matrixScaleAddColumn: '添加一列',
|
|
157
|
+
matrixScaleColumnsOptionalHint: '可选;「比例」控制相对宽度,「最小宽」单位为 px',
|
|
150
158
|
stepListTitle: '步骤列表',
|
|
151
159
|
addStep: '添加步骤',
|
|
152
160
|
editStep: '编辑步骤',
|
|
@@ -490,15 +498,15 @@ const locale = {
|
|
|
490
498
|
multiFieldEditorHint: 'This section auto-generates repeatable inputs based on the field type you choose.',
|
|
491
499
|
matrixScaleRowTitle: 'Row header title',
|
|
492
500
|
matrixScaleRowTitlePlaceholder: 'e.g. Activity',
|
|
493
|
-
|
|
501
|
+
matrixScaleRowTitleWidth: 'Question column min width (px)',
|
|
494
502
|
matrixScaleLayout_options: 'Option matrix',
|
|
495
503
|
matrixScaleLayout_columns: 'Cell matrix',
|
|
496
504
|
matrixScaleLayout_field: 'One field per row',
|
|
497
505
|
matrixScaleRequired: 'Required for each row/cell',
|
|
498
506
|
matrixScaleSummary: '{type} · {layout} · {rows} rows',
|
|
499
|
-
matrixScaleEditorHint_options: '
|
|
500
|
-
matrixScaleEditorHint_columns: '
|
|
501
|
-
matrixScaleEditorHint_field: '
|
|
507
|
+
matrixScaleEditorHint_options: 'Field type is radio/checkbox: scale options become the header columns.',
|
|
508
|
+
matrixScaleEditorHint_columns: 'Each cell is one field; remove all columns to get one field per row.',
|
|
509
|
+
matrixScaleEditorHint_field: 'One field per row; add columns to get one field per cell.',
|
|
502
510
|
matrixScaleRowsTitle: 'Rows',
|
|
503
511
|
matrixScaleRowsHint: 'Left is the row label; right is the data key',
|
|
504
512
|
matrixScaleRowLabelPlaceholder: 'e.g. Work / Study',
|
|
@@ -506,9 +514,17 @@ const locale = {
|
|
|
506
514
|
matrixScaleOptionsTitle: 'Scale options (columns)',
|
|
507
515
|
matrixScaleColumnsTitle: 'Columns',
|
|
508
516
|
matrixScaleColumnsHint: 'Left is the column label; right is the data key',
|
|
517
|
+
matrixScaleColumnLayoutHint: '“Span” sets relative width (e.g. 1:2:1); “Min width” is optional, unit px; row title stays sticky with a scroll shadow',
|
|
518
|
+
matrixScaleColumnSpan: 'Column span ratio',
|
|
519
|
+
matrixScaleColumnSpanShort: 'Span',
|
|
520
|
+
matrixScaleColumnMin: 'Column min width',
|
|
521
|
+
matrixScaleColumnMinShort: 'Min width',
|
|
522
|
+
matrixScaleColumnMinUnit: 'px',
|
|
509
523
|
matrixScaleColumnLabelPlaceholder: 'e.g. Monday',
|
|
510
524
|
matrixScaleColumnNamePlaceholder: 'e.g. mon',
|
|
511
525
|
matrixScaleAddRow: 'Add row',
|
|
526
|
+
matrixScaleAddColumn: 'Add column',
|
|
527
|
+
matrixScaleColumnsOptionalHint: 'Optional; “Span” sets relative width, “Min width” unit is px',
|
|
512
528
|
stepListTitle: 'Steps',
|
|
513
529
|
addStep: 'Add Step',
|
|
514
530
|
editStep: 'Edit Step',
|
|
@@ -885,6 +901,48 @@ const createEmptyColumn = () => ({
|
|
|
885
901
|
name: createDataKey('col'),
|
|
886
902
|
width: undefined
|
|
887
903
|
});
|
|
904
|
+
|
|
905
|
+
/** 选项作为矩阵列的填写项类型(RadioGroup/CheckboxGroup 在 MatrixScale 里隐藏选项文案,只留圆点/方框) */
|
|
906
|
+
const MATRIX_CHOICE_FIELD_TYPES = ['RadioGroup', 'CheckboxGroup'];
|
|
907
|
+
const hasMatrixColumns = columns => Array.isArray(columns) && columns.some(column => column && String(column.name || '').trim());
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* 矩阵结构由填写项类型推断,不单独配置:
|
|
911
|
+
* - 单选/多选 → options(选项作列)
|
|
912
|
+
* - 其他类型且配了列 → columns(每格一个填写项)
|
|
913
|
+
* - 其他类型未配列 → field(每行一个填写项)
|
|
914
|
+
*/
|
|
915
|
+
const resolveMatrixLayout = block => {
|
|
916
|
+
if (MATRIX_CHOICE_FIELD_TYPES.includes(block?.fieldType || 'RadioGroup')) {
|
|
917
|
+
return 'options';
|
|
918
|
+
}
|
|
919
|
+
return hasMatrixColumns(block?.columns) ? 'columns' : 'field';
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
/** 矩阵列/选项显示比例(span,兼容 ratio);默认 1 不落盘。可选 width 定宽 */
|
|
923
|
+
const pickMatrixColumnLayout = item => {
|
|
924
|
+
const layout = {};
|
|
925
|
+
if (item?.width != null && item.width !== '') {
|
|
926
|
+
const width = Number(item.width);
|
|
927
|
+
if (!Number.isNaN(width) && width > 0) {
|
|
928
|
+
layout.width = width;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
const spanRaw = item?.span ?? item?.ratio;
|
|
932
|
+
if (spanRaw != null && spanRaw !== '' && Number(spanRaw) !== 1) {
|
|
933
|
+
const span = Number(spanRaw);
|
|
934
|
+
if (!Number.isNaN(span) && span > 0) {
|
|
935
|
+
layout.span = span;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
if (item?.min != null && item.min !== '' && layout.width == null) {
|
|
939
|
+
const min = Number(item.min);
|
|
940
|
+
if (!Number.isNaN(min) && min > 0) {
|
|
941
|
+
layout.min = min;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
return layout;
|
|
945
|
+
};
|
|
888
946
|
const defaultSchema = () => ({
|
|
889
947
|
title: '',
|
|
890
948
|
subtitle: '',
|
|
@@ -1041,7 +1099,7 @@ const createBlock = (kind, overrides = {}) => {
|
|
|
1041
1099
|
label: '',
|
|
1042
1100
|
value: ''
|
|
1043
1101
|
}],
|
|
1044
|
-
columns:
|
|
1102
|
+
columns: [],
|
|
1045
1103
|
...overrides
|
|
1046
1104
|
};
|
|
1047
1105
|
}
|
|
@@ -1184,14 +1242,18 @@ const normalizeBlock = (block, depth = 0) => {
|
|
|
1184
1242
|
return normalized;
|
|
1185
1243
|
}
|
|
1186
1244
|
if (kind === 'matrixScale') {
|
|
1187
|
-
const layout = block.layout === 'columns' || block.layout === 'field' ? block.layout : 'options';
|
|
1188
1245
|
normalized.list = undefined;
|
|
1189
1246
|
normalized.items = undefined;
|
|
1190
1247
|
normalized.itemBlocks = undefined;
|
|
1191
1248
|
normalized.blocks = undefined;
|
|
1192
|
-
normalized.layout = layout;
|
|
1193
1249
|
normalized.fieldType = block.fieldType || 'RadioGroup';
|
|
1194
1250
|
normalized.rowTitle = block.rowTitle != null ? block.rowTitle : '';
|
|
1251
|
+
const rowTitleWidth = block.rowTitleWidth != null && block.rowTitleWidth !== '' ? Number(block.rowTitleWidth) : undefined;
|
|
1252
|
+
if (rowTitleWidth && rowTitleWidth !== 160) {
|
|
1253
|
+
normalized.rowTitleWidth = rowTitleWidth;
|
|
1254
|
+
} else {
|
|
1255
|
+
delete normalized.rowTitleWidth;
|
|
1256
|
+
}
|
|
1195
1257
|
normalized.rule = block.rule != null ? block.rule : '';
|
|
1196
1258
|
// 保留编辑器侧的 _key:MatrixScaleEditor 用它做行 key;normalize 若剥掉会触发 ensureKeys→onChange 死循环(React #185)
|
|
1197
1259
|
const keepKey = item => item?._key ? {
|
|
@@ -1208,30 +1270,25 @@ const normalizeBlock = (block, depth = 0) => {
|
|
|
1208
1270
|
name: createDataKey('row')
|
|
1209
1271
|
}];
|
|
1210
1272
|
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
}
|
|
1231
|
-
normalized.options = undefined;
|
|
1232
|
-
} else {
|
|
1233
|
-
normalized.options = undefined;
|
|
1234
|
-
normalized.columns = undefined;
|
|
1273
|
+
// options / columns 都保留:切换填写项类型时不丢另一边已填的配置
|
|
1274
|
+
normalized.options = Array.isArray(block.options) ? block.options.map(option => ({
|
|
1275
|
+
...keepKey(option),
|
|
1276
|
+
label: option?.label ?? '',
|
|
1277
|
+
value: option?.value ?? '',
|
|
1278
|
+
...pickMatrixColumnLayout(option)
|
|
1279
|
+
})) : [];
|
|
1280
|
+
normalized.columns = Array.isArray(block.columns) ? block.columns.map(column => ({
|
|
1281
|
+
...keepKey(column),
|
|
1282
|
+
label: column?.label ?? column?.title ?? '',
|
|
1283
|
+
name: String(column?.name || '').trim() || createDataKey('col'),
|
|
1284
|
+
...pickMatrixColumnLayout(column)
|
|
1285
|
+
})) : [];
|
|
1286
|
+
normalized.layout = resolveMatrixLayout(normalized);
|
|
1287
|
+
if (normalized.layout === 'options' && !normalized.options.length) {
|
|
1288
|
+
normalized.options = [{
|
|
1289
|
+
label: '',
|
|
1290
|
+
value: ''
|
|
1291
|
+
}];
|
|
1235
1292
|
}
|
|
1236
1293
|
return normalized;
|
|
1237
1294
|
}
|
|
@@ -1765,9 +1822,6 @@ const BLOCK_KINDS = {
|
|
|
1765
1822
|
/** editableList 添加按钮位置,与 @kne/form-info EditableList addPosition 一致 */
|
|
1766
1823
|
const ADD_POSITIONS = ['bottom', 'top', 'both'];
|
|
1767
1824
|
|
|
1768
|
-
/** matrixScale 布局:options 选项组矩阵 / columns 单元格矩阵 / field 每行一个字段 */
|
|
1769
|
-
const MATRIX_LAYOUTS = ['options', 'columns', 'field'];
|
|
1770
|
-
|
|
1771
1825
|
/** steps 导航样式:default 为 antd 完整步骤条;focus 突出当前步骤标题,其余收成序号 */
|
|
1772
1826
|
const STEPS_STYLES = ['default', 'focus'];
|
|
1773
1827
|
const getBlockKindOptions = formatMessage => Object.entries(BLOCK_KINDS).map(([value, config]) => ({
|
|
@@ -1793,8 +1847,8 @@ const blockToFormValues = block => ({
|
|
|
1793
1847
|
minLength: block.minLength ?? null,
|
|
1794
1848
|
addPosition: ADD_POSITIONS.includes(block.addPosition) ? block.addPosition : 'bottom',
|
|
1795
1849
|
fieldType: block.fieldType || (block.kind === 'matrixScale' ? 'RadioGroup' : 'Input'),
|
|
1796
|
-
layout: MATRIX_LAYOUTS.includes(block.layout) ? block.layout : 'options',
|
|
1797
1850
|
rowTitle: block.rowTitle || '',
|
|
1851
|
+
rowTitleWidth: block.rowTitleWidth ?? null,
|
|
1798
1852
|
required: typeof block.rule === 'string' && block.rule.split(' ').includes('REQ'),
|
|
1799
1853
|
autoStep: block.autoStep !== false,
|
|
1800
1854
|
stepsStyle: STEPS_STYLES.includes(block.stepsStyle) ? block.stepsStyle : 'default',
|
|
@@ -1829,29 +1883,21 @@ const formValuesToBlock = (values, existingBlock = {}) => {
|
|
|
1829
1883
|
selectorInData: values.selectorInData !== false
|
|
1830
1884
|
};
|
|
1831
1885
|
if (kind === 'matrixScale') {
|
|
1832
|
-
const layout = MATRIX_LAYOUTS.includes(values.layout) ? values.layout : 'options';
|
|
1833
|
-
next.layout = layout;
|
|
1834
1886
|
next.rowTitle = values.rowTitle || undefined;
|
|
1887
|
+
next.rowTitleWidth = values.rowTitleWidth != null && values.rowTitleWidth !== '' ? Number(values.rowTitleWidth) : undefined;
|
|
1888
|
+
if (next.rowTitleWidth === 160 || !next.rowTitleWidth) {
|
|
1889
|
+
delete next.rowTitleWidth;
|
|
1890
|
+
}
|
|
1835
1891
|
next.rule = values.required ? 'REQ' : undefined;
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
next.options = undefined;
|
|
1846
|
-
if (!Array.isArray(next.columns) || !next.columns.length) {
|
|
1847
|
-
next.columns = [{
|
|
1848
|
-
label: '',
|
|
1849
|
-
name: createDataKey('col')
|
|
1850
|
-
}];
|
|
1851
|
-
}
|
|
1852
|
-
} else {
|
|
1853
|
-
next.options = undefined;
|
|
1854
|
-
next.columns = undefined;
|
|
1892
|
+
// 不清空 options / columns:切回原类型时配置还在
|
|
1893
|
+
next.options = Array.isArray(next.options) ? next.options : [];
|
|
1894
|
+
next.columns = Array.isArray(next.columns) ? next.columns : [];
|
|
1895
|
+
next.layout = resolveMatrixLayout(next);
|
|
1896
|
+
if (next.layout === 'options' && !next.options.length) {
|
|
1897
|
+
next.options = [{
|
|
1898
|
+
label: '',
|
|
1899
|
+
value: ''
|
|
1900
|
+
}];
|
|
1855
1901
|
}
|
|
1856
1902
|
if (!Array.isArray(next.rows) || !next.rows.length) {
|
|
1857
1903
|
next.rows = [{
|
|
@@ -3943,18 +3989,35 @@ const createEmptyMatrixRow = () => ({
|
|
|
3943
3989
|
const createEmptyMatrixColumn = () => ({
|
|
3944
3990
|
_key: createColKey(),
|
|
3945
3991
|
label: '',
|
|
3946
|
-
name: createDataKey('col')
|
|
3992
|
+
name: createDataKey('col'),
|
|
3993
|
+
span: 1
|
|
3947
3994
|
});
|
|
3948
3995
|
const createEmptyMatrixOption = () => ({
|
|
3949
3996
|
_key: createOptKey(),
|
|
3950
3997
|
label: '',
|
|
3951
|
-
value: ''
|
|
3998
|
+
value: '',
|
|
3999
|
+
span: 1
|
|
3952
4000
|
});
|
|
3953
4001
|
const ensureKeys = (list = [], createKey) => list.map(item => ({
|
|
3954
4002
|
...item,
|
|
3955
4003
|
_key: item._key || createKey()
|
|
3956
4004
|
}));
|
|
3957
4005
|
const hasMissingKey = (list = []) => list.some(item => !item?._key);
|
|
4006
|
+
const getItemSpan = item => {
|
|
4007
|
+
const raw = item?.span ?? item?.ratio;
|
|
4008
|
+
if (raw == null || raw === '') {
|
|
4009
|
+
return 1;
|
|
4010
|
+
}
|
|
4011
|
+
const n = Number(raw);
|
|
4012
|
+
return !Number.isNaN(n) && n > 0 ? n : 1;
|
|
4013
|
+
};
|
|
4014
|
+
const getItemMin = item => {
|
|
4015
|
+
if (item?.min == null || item.min === '') {
|
|
4016
|
+
return null;
|
|
4017
|
+
}
|
|
4018
|
+
const n = Number(item.min);
|
|
4019
|
+
return !Number.isNaN(n) && n > 0 ? n : null;
|
|
4020
|
+
};
|
|
3958
4021
|
|
|
3959
4022
|
/** 勿在此用 FormInfo:模块列不在 Form 内,FormInfo→FieldList 会读不到 openApiRef */
|
|
3960
4023
|
const EditorSection = ({
|
|
@@ -3973,6 +4036,59 @@ const EditorSection = ({
|
|
|
3973
4036
|
children: tip
|
|
3974
4037
|
}) : null]
|
|
3975
4038
|
});
|
|
4039
|
+
|
|
4040
|
+
/** 列比例 + 最小宽:与 table-view 一致,写入 span / min */
|
|
4041
|
+
const ColumnLayoutInputs = ({
|
|
4042
|
+
item,
|
|
4043
|
+
onPatch,
|
|
4044
|
+
formatMessage
|
|
4045
|
+
}) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4046
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
4047
|
+
className: style['matrix-scale-span-input'],
|
|
4048
|
+
min: 1,
|
|
4049
|
+
max: 24,
|
|
4050
|
+
precision: 0,
|
|
4051
|
+
value: getItemSpan(item),
|
|
4052
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4053
|
+
className: style['matrix-scale-input-affix'],
|
|
4054
|
+
children: formatMessage({
|
|
4055
|
+
id: 'matrixScaleColumnSpanShort'
|
|
4056
|
+
})
|
|
4057
|
+
}),
|
|
4058
|
+
title: formatMessage({
|
|
4059
|
+
id: 'matrixScaleColumnSpan'
|
|
4060
|
+
}),
|
|
4061
|
+
onChange: value => onPatch({
|
|
4062
|
+
span: value == null || value < 1 ? 1 : value,
|
|
4063
|
+
ratio: undefined
|
|
4064
|
+
})
|
|
4065
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
4066
|
+
className: style['matrix-scale-min-input'],
|
|
4067
|
+
min: 40,
|
|
4068
|
+
max: 800,
|
|
4069
|
+
precision: 0,
|
|
4070
|
+
value: getItemMin(item),
|
|
4071
|
+
prefix: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4072
|
+
className: style['matrix-scale-input-affix'],
|
|
4073
|
+
children: formatMessage({
|
|
4074
|
+
id: 'matrixScaleColumnMinShort'
|
|
4075
|
+
})
|
|
4076
|
+
}),
|
|
4077
|
+
suffix: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4078
|
+
className: style['matrix-scale-input-affix'],
|
|
4079
|
+
children: formatMessage({
|
|
4080
|
+
id: 'matrixScaleColumnMinUnit'
|
|
4081
|
+
})
|
|
4082
|
+
}),
|
|
4083
|
+
title: formatMessage({
|
|
4084
|
+
id: 'matrixScaleColumnMin'
|
|
4085
|
+
}),
|
|
4086
|
+
placeholder: "\u2014",
|
|
4087
|
+
onChange: value => onPatch({
|
|
4088
|
+
min: value == null || value < 1 ? undefined : value
|
|
4089
|
+
})
|
|
4090
|
+
})]
|
|
4091
|
+
});
|
|
3976
4092
|
const LabelNameRows = ({
|
|
3977
4093
|
title,
|
|
3978
4094
|
tip,
|
|
@@ -3982,18 +4098,24 @@ const LabelNameRows = ({
|
|
|
3982
4098
|
createKey,
|
|
3983
4099
|
labelPlaceholder,
|
|
3984
4100
|
namePlaceholder,
|
|
3985
|
-
addText
|
|
4101
|
+
addText,
|
|
4102
|
+
withColumnLayout,
|
|
4103
|
+
allowEmpty
|
|
3986
4104
|
}) => {
|
|
3987
|
-
|
|
4105
|
+
const {
|
|
4106
|
+
formatMessage
|
|
4107
|
+
} = reactIntl.useIntl();
|
|
3988
4108
|
react.useEffect(() => {
|
|
3989
4109
|
if (!list.length) {
|
|
3990
|
-
|
|
4110
|
+
if (!allowEmpty) {
|
|
4111
|
+
onChange([createEmpty()]);
|
|
4112
|
+
}
|
|
3991
4113
|
return;
|
|
3992
4114
|
}
|
|
3993
4115
|
if (hasMissingKey(list)) {
|
|
3994
4116
|
onChange(ensureKeys(list, createKey));
|
|
3995
4117
|
}
|
|
3996
|
-
}, [list, onChange, createEmpty, createKey]);
|
|
4118
|
+
}, [list, onChange, createEmpty, createKey, allowEmpty]);
|
|
3997
4119
|
const rows = list.length ? list : [];
|
|
3998
4120
|
const updateItem = (index, patch) => {
|
|
3999
4121
|
onChange(rows.map((item, itemIndex) => itemIndex === index ? {
|
|
@@ -4008,8 +4130,9 @@ const LabelNameRows = ({
|
|
|
4008
4130
|
className: style['options-list'],
|
|
4009
4131
|
children: rows.map((item, index) => /*#__PURE__*/jsxRuntime.jsxs(antd.Flex, {
|
|
4010
4132
|
gap: 8,
|
|
4133
|
+
wrap: "wrap",
|
|
4011
4134
|
align: "start",
|
|
4012
|
-
className: style['options-row'],
|
|
4135
|
+
className: [style['options-row'], style['matrix-scale-options-row'], withColumnLayout ? style['has-column-layout'] : null].filter(Boolean).join(' '),
|
|
4013
4136
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
4014
4137
|
value: item.label || '',
|
|
4015
4138
|
placeholder: labelPlaceholder,
|
|
@@ -4022,15 +4145,19 @@ const LabelNameRows = ({
|
|
|
4022
4145
|
onChange: e => updateItem(index, {
|
|
4023
4146
|
name: e.target.value
|
|
4024
4147
|
})
|
|
4025
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
4148
|
+
}), withColumnLayout ? /*#__PURE__*/jsxRuntime.jsx(ColumnLayoutInputs, {
|
|
4149
|
+
item: item,
|
|
4150
|
+
onPatch: patch => updateItem(index, patch),
|
|
4151
|
+
formatMessage: formatMessage
|
|
4152
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
4026
4153
|
type: "text",
|
|
4027
4154
|
danger: true,
|
|
4028
4155
|
className: style['icon-square-btn-sm'],
|
|
4029
4156
|
icon: /*#__PURE__*/jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
4030
|
-
disabled: rows.length <= 1,
|
|
4157
|
+
disabled: !allowEmpty && rows.length <= 1,
|
|
4031
4158
|
onClick: () => {
|
|
4032
4159
|
const next = rows.filter((_, i) => i !== index);
|
|
4033
|
-
onChange(next.length ? next : [createEmpty()]);
|
|
4160
|
+
onChange(next.length || allowEmpty ? next : [createEmpty()]);
|
|
4034
4161
|
}
|
|
4035
4162
|
})]
|
|
4036
4163
|
}, item._key || `row-${index}`))
|
|
@@ -4070,12 +4197,16 @@ const MatrixOptionsEditor = ({
|
|
|
4070
4197
|
title: formatMessage({
|
|
4071
4198
|
id: 'matrixScaleOptionsTitle'
|
|
4072
4199
|
}),
|
|
4200
|
+
tip: formatMessage({
|
|
4201
|
+
id: 'matrixScaleColumnLayoutHint'
|
|
4202
|
+
}),
|
|
4073
4203
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4074
4204
|
className: style['options-list'],
|
|
4075
4205
|
children: rows.map((item, index) => /*#__PURE__*/jsxRuntime.jsxs(antd.Flex, {
|
|
4076
4206
|
gap: 8,
|
|
4207
|
+
wrap: "wrap",
|
|
4077
4208
|
align: "start",
|
|
4078
|
-
className: style['options-row']
|
|
4209
|
+
className: `${style['options-row']} ${style['matrix-scale-options-row']} ${style['has-column-layout']}`,
|
|
4079
4210
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
4080
4211
|
value: item.label || '',
|
|
4081
4212
|
placeholder: formatMessage({
|
|
@@ -4099,6 +4230,10 @@ const MatrixOptionsEditor = ({
|
|
|
4099
4230
|
onChange: e => updateItem(index, {
|
|
4100
4231
|
value: e.target.value
|
|
4101
4232
|
})
|
|
4233
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ColumnLayoutInputs, {
|
|
4234
|
+
item: item,
|
|
4235
|
+
onPatch: patch => updateItem(index, patch),
|
|
4236
|
+
formatMessage: formatMessage
|
|
4102
4237
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
4103
4238
|
type: "text",
|
|
4104
4239
|
danger: true,
|
|
@@ -4129,13 +4264,11 @@ const MatrixScaleEditor = ({
|
|
|
4129
4264
|
const {
|
|
4130
4265
|
formatMessage
|
|
4131
4266
|
} = reactIntl.useIntl();
|
|
4132
|
-
const layout = block
|
|
4267
|
+
const layout = resolveMatrixLayout(block);
|
|
4133
4268
|
const blockRef = react.useRef(block);
|
|
4134
4269
|
blockRef.current = block;
|
|
4135
4270
|
const onChangeRef = react.useRef(onChange);
|
|
4136
4271
|
onChangeRef.current = onChange;
|
|
4137
|
-
|
|
4138
|
-
// 用 ref 保持回调稳定,避免输入时子组件 useEffect 反复触发
|
|
4139
4272
|
const handleRowsChange = react.useCallback(rows => onChangeRef.current({
|
|
4140
4273
|
...blockRef.current,
|
|
4141
4274
|
rows
|
|
@@ -4179,12 +4312,12 @@ const MatrixScaleEditor = ({
|
|
|
4179
4312
|
}), layout === 'options' ? /*#__PURE__*/jsxRuntime.jsx(MatrixOptionsEditor, {
|
|
4180
4313
|
value: block.options || [],
|
|
4181
4314
|
onChange: handleOptionsChange
|
|
4182
|
-
}) :
|
|
4315
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(LabelNameRows, {
|
|
4183
4316
|
title: formatMessage({
|
|
4184
4317
|
id: 'matrixScaleColumnsTitle'
|
|
4185
4318
|
}),
|
|
4186
4319
|
tip: formatMessage({
|
|
4187
|
-
id: '
|
|
4320
|
+
id: 'matrixScaleColumnsOptionalHint'
|
|
4188
4321
|
}),
|
|
4189
4322
|
list: block.columns || [],
|
|
4190
4323
|
onChange: handleColumnsChange,
|
|
@@ -4197,9 +4330,11 @@ const MatrixScaleEditor = ({
|
|
|
4197
4330
|
id: 'matrixScaleColumnNamePlaceholder'
|
|
4198
4331
|
}),
|
|
4199
4332
|
addText: formatMessage({
|
|
4200
|
-
id: '
|
|
4201
|
-
})
|
|
4202
|
-
|
|
4333
|
+
id: 'matrixScaleAddColumn'
|
|
4334
|
+
}),
|
|
4335
|
+
withColumnLayout: true,
|
|
4336
|
+
allowEmpty: true
|
|
4337
|
+
})]
|
|
4203
4338
|
});
|
|
4204
4339
|
};
|
|
4205
4340
|
var MatrixScaleEditor$1 = MatrixScaleEditor;
|
|
@@ -4852,7 +4987,7 @@ const BlockListPanel = ({
|
|
|
4852
4987
|
const supportsBlocks = block.kind === 'formInfo' || block.kind === 'object';
|
|
4853
4988
|
const supportsChildModules = supportsItemBlocks$1 || supportsBlocks;
|
|
4854
4989
|
const nestCount = supportsItemBlocks$1 ? block.itemBlocks?.length || 0 : block.blocks?.length || 0;
|
|
4855
|
-
const matrixLayout = block
|
|
4990
|
+
const matrixLayout = resolveMatrixLayout(block);
|
|
4856
4991
|
const summary = block.kind === 'steps' ? formatMessage({
|
|
4857
4992
|
id: 'stepCount'
|
|
4858
4993
|
}, {
|
|
@@ -5295,26 +5430,22 @@ const BlockConfigFields = ({
|
|
|
5295
5430
|
placeholder: formatMessage({
|
|
5296
5431
|
id: 'matrixScaleRowTitlePlaceholder'
|
|
5297
5432
|
})
|
|
5298
|
-
}, "rowTitle"),
|
|
5433
|
+
}, "rowTitle"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.InputNumber, {
|
|
5434
|
+
name: "rowTitleWidth",
|
|
5435
|
+
label: formatMessage({
|
|
5436
|
+
id: 'matrixScaleRowTitleWidth'
|
|
5437
|
+
}),
|
|
5438
|
+
min: 80,
|
|
5439
|
+
max: 640,
|
|
5440
|
+
placeholder: "160"
|
|
5441
|
+
}, "rowTitleWidth"), fieldTypeSelect);
|
|
5299
5442
|
add('rule', /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
|
|
5300
5443
|
name: "required",
|
|
5301
5444
|
children: formatMessage({
|
|
5302
5445
|
id: 'matrixScaleRequired'
|
|
5303
5446
|
})
|
|
5304
5447
|
}, "required"));
|
|
5305
|
-
add('layout',
|
|
5306
|
-
name: "layout",
|
|
5307
|
-
label: formatMessage({
|
|
5308
|
-
id: 'matrixScaleLayout'
|
|
5309
|
-
}),
|
|
5310
|
-
rule: "REQ",
|
|
5311
|
-
options: MATRIX_LAYOUTS.map(value => ({
|
|
5312
|
-
label: formatMessage({
|
|
5313
|
-
id: `matrixScaleLayout_${value}`
|
|
5314
|
-
}),
|
|
5315
|
-
value
|
|
5316
|
-
}))
|
|
5317
|
-
}, "layout"), borderedCheckbox);
|
|
5448
|
+
add('layout', borderedCheckbox);
|
|
5318
5449
|
}
|
|
5319
5450
|
if (kind === 'steps') {
|
|
5320
5451
|
add('basic', titleInput(), subtitleInput);
|
|
@@ -8651,12 +8782,15 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8651
8782
|
if (!FieldComponent) {
|
|
8652
8783
|
return null;
|
|
8653
8784
|
}
|
|
8654
|
-
const layout = block
|
|
8785
|
+
const layout = resolveMatrixLayout(block);
|
|
8655
8786
|
return withBlockLayout(/*#__PURE__*/react.createElement(FormInfo.MatrixScale, {
|
|
8656
8787
|
key: block.id,
|
|
8657
8788
|
name: block.name,
|
|
8658
8789
|
title: block.title || undefined,
|
|
8659
8790
|
rowTitle: block.rowTitle || undefined,
|
|
8791
|
+
...(block.rowTitleWidth != null && block.rowTitleWidth !== '' ? {
|
|
8792
|
+
rowTitleWidth: block.rowTitleWidth
|
|
8793
|
+
} : null),
|
|
8660
8794
|
bordered,
|
|
8661
8795
|
field: FieldComponent,
|
|
8662
8796
|
rule: block.rule || undefined,
|
|
@@ -10292,7 +10426,7 @@ const walkBlock = (block, layer, depth = 0, ctx = {}) => {
|
|
|
10292
10426
|
if (!name) {
|
|
10293
10427
|
return;
|
|
10294
10428
|
}
|
|
10295
|
-
const layout = block
|
|
10429
|
+
const layout = resolveMatrixLayout(block);
|
|
10296
10430
|
const fieldType = block.fieldType || 'RadioGroup';
|
|
10297
10431
|
const required = typeof block.rule === 'string' && block.rule.split(' ').includes('REQ');
|
|
10298
10432
|
const properties = {};
|
|
@@ -10500,7 +10634,7 @@ const isMatrixChoiceSelected = (cellValue, optionValue) => {
|
|
|
10500
10634
|
|
|
10501
10635
|
/** 只读矩阵:对齐填写态 MatrixScale 的表头 + 行列网格,而不是摊成普通字段列表 */
|
|
10502
10636
|
const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) => {
|
|
10503
|
-
const layout = block
|
|
10637
|
+
const layout = resolveMatrixLayout(block);
|
|
10504
10638
|
const fieldType = block.fieldType || 'RadioGroup';
|
|
10505
10639
|
const rows = (block.rows || []).filter(row => row && row.name != null && String(row.name).trim());
|
|
10506
10640
|
if (!rows.length) {
|
|
@@ -10510,6 +10644,13 @@ const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) =>
|
|
|
10510
10644
|
id: 'schemaContentEmptyValue'
|
|
10511
10645
|
});
|
|
10512
10646
|
const rowTitle = block.rowTitle || '';
|
|
10647
|
+
const rowTitleWidthPx = (() => {
|
|
10648
|
+
const n = Number(block.rowTitleWidth);
|
|
10649
|
+
return !Number.isNaN(n) && n > 0 ? n : 160;
|
|
10650
|
+
})();
|
|
10651
|
+
const matrixTitleStyle = {
|
|
10652
|
+
'--matrix-scale-title-width': `${rowTitleWidthPx}px`
|
|
10653
|
+
};
|
|
10513
10654
|
if (layout === 'options') {
|
|
10514
10655
|
const options = (block.options || []).filter(option => option && (option.value != null || option.label != null));
|
|
10515
10656
|
const optionCount = Math.max(options.length, 1);
|
|
@@ -10542,6 +10683,7 @@ const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) =>
|
|
|
10542
10683
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
10543
10684
|
className: style['schema-content-matrix-inner'],
|
|
10544
10685
|
style: {
|
|
10686
|
+
...matrixTitleStyle,
|
|
10545
10687
|
'--matrix-scale-option-count': optionCount
|
|
10546
10688
|
},
|
|
10547
10689
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -10612,6 +10754,7 @@ const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) =>
|
|
|
10612
10754
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
10613
10755
|
className: style['schema-content-matrix-inner'],
|
|
10614
10756
|
style: {
|
|
10757
|
+
...matrixTitleStyle,
|
|
10615
10758
|
'--matrix-scale-option-count': optionCount
|
|
10616
10759
|
},
|
|
10617
10760
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -10666,6 +10809,7 @@ const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) =>
|
|
|
10666
10809
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
10667
10810
|
className: style['schema-content-matrix-inner'],
|
|
10668
10811
|
style: {
|
|
10812
|
+
...matrixTitleStyle,
|
|
10669
10813
|
'--matrix-scale-option-count': 1
|
|
10670
10814
|
},
|
|
10671
10815
|
children: [rowTitle ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|