@kne/form-creator 0.1.31 → 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.
@@ -2,7 +2,7 @@ import '@kne/form-info/dist/index.css';
2
2
  import '@kne/info-page/dist/index.css';
3
3
  import '@kne/button-group/dist/index.css';
4
4
  import { createContext, useContext, useRef, useCallback, useEffect, useState, useMemo, createElement, Fragment as Fragment$1 } from 'react';
5
- import { Button, Input as Input$1, Space, Tag, Tooltip, Typography, Flex, Dropdown, Empty, message, Checkbox as Checkbox$1, InputNumber as InputNumber$1, Card, Switch as Switch$1, Radio, Select as Select$1 } from 'antd';
5
+ import { Button, Input as Input$1, Space, Tag, Tooltip, Typography, Flex, InputNumber as InputNumber$1, Dropdown, Empty, message, Checkbox as Checkbox$1, Card, Switch as Switch$1, Radio, Select as Select$1 } from 'antd';
6
6
  import { createWithIntlProvider, useIntl } from '@kne/react-intl';
7
7
  import { useIsMobile, RESPONSIVE_BOUNDARY_CLASS } from '@kne/responsive-utils';
8
8
  import { FormOutlined, FontSizeOutlined, AlignLeftOutlined, NumberOutlined, DownSquareOutlined, CheckCircleOutlined, CheckSquareOutlined, AppstoreOutlined, ApartmentOutlined, ShopOutlined, EnvironmentOutlined, SwapOutlined, CalendarOutlined, HolderOutlined, LockOutlined, EyeInvisibleOutlined, BranchesOutlined, WarningOutlined, ColumnWidthOutlined, ArrowUpOutlined, ArrowDownOutlined, EditOutlined, DeleteOutlined, PlusOutlined, SettingOutlined, RightOutlined, UnorderedListOutlined, TableOutlined, ProfileOutlined, ClusterOutlined, PartitionOutlined, BorderOuterOutlined, OrderedListOutlined, SelectOutlined, ArrowLeftOutlined, ArrowRightOutlined, QuestionCircleOutlined, CheckOutlined } from '@ant-design/icons';
@@ -18,7 +18,7 @@ import FormInfo, { FormModal, Steps, validateFieldsByName, Form, MatrixScale, Mu
18
18
  import InfoPage from '@kne/info-page';
19
19
  import { createWithRemoteLoader } from '@kne/remote-loader';
20
20
 
21
- 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"};
21
+ 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"};
22
22
 
23
23
  function _extends() {
24
24
  return _extends = Object.assign ? Object.assign.bind() : function (n) {
@@ -140,15 +140,15 @@ const locale$1 = {
140
140
  multiFieldEditorHint: '同类多值模块会根据你选择的填写项类型,自动生成可增减的多个输入框。',
141
141
  matrixScaleRowTitle: '行标题列名',
142
142
  matrixScaleRowTitlePlaceholder: '例如:活动',
143
- matrixScaleLayout: '矩阵布局',
143
+ matrixScaleRowTitleWidth: '问题列最小宽度(px)',
144
144
  matrixScaleLayout_options: '选项矩阵',
145
145
  matrixScaleLayout_columns: '单元格矩阵',
146
146
  matrixScaleLayout_field: '每行一个字段',
147
147
  matrixScaleRequired: '每行(每格)必填',
148
148
  matrixScaleSummary: '{type} · {layout} · {rows} 行',
149
- matrixScaleEditorHint_options: '配置行题目与量表选项;预览中每行是同一个选择字段。',
150
- matrixScaleEditorHint_columns: '配置行题目与列字段;每个格子是同一个填写项类型(如数字、评分)。',
151
- matrixScaleEditorHint_field: '只配置行题目;每行右侧放一个填写项(不传列)。',
149
+ matrixScaleEditorHint_options: '填写项为单选/多选:量表选项即表头各列,每行选一个(或多个)。',
150
+ matrixScaleEditorHint_columns: '每个格子是一个填写项;删光列则变为每行一个填写项。',
151
+ matrixScaleEditorHint_field: '当前每行一个填写项;添加列后变为每格一个填写项。',
152
152
  matrixScaleRowsTitle: '行配置',
153
153
  matrixScaleRowsHint: '左侧为行标题,右侧为保存用的名称',
154
154
  matrixScaleRowLabelPlaceholder: '例如:工作/学习',
@@ -156,9 +156,17 @@ const locale$1 = {
156
156
  matrixScaleOptionsTitle: '量表选项(列)',
157
157
  matrixScaleColumnsTitle: '列配置',
158
158
  matrixScaleColumnsHint: '左侧为列标题,右侧为保存用的名称',
159
+ matrixScaleColumnLayoutHint: '「比例」控制相对宽度(如 1:2:1);「最小宽」为该列最小宽度(单位 px,可选);横向滚动时行标题列固定并带阴影',
160
+ matrixScaleColumnSpan: '列显示比例',
161
+ matrixScaleColumnSpanShort: '比例',
162
+ matrixScaleColumnMin: '列最小宽度',
163
+ matrixScaleColumnMinShort: '最小宽',
164
+ matrixScaleColumnMinUnit: 'px',
159
165
  matrixScaleColumnLabelPlaceholder: '例如:周一',
160
166
  matrixScaleColumnNamePlaceholder: '例如:mon',
161
167
  matrixScaleAddRow: '添加一行',
168
+ matrixScaleAddColumn: '添加一列',
169
+ matrixScaleColumnsOptionalHint: '可选;「比例」控制相对宽度,「最小宽」单位为 px',
162
170
  stepListTitle: '步骤列表',
163
171
  addStep: '添加步骤',
164
172
  editStep: '编辑步骤',
@@ -502,15 +510,15 @@ const locale = {
502
510
  multiFieldEditorHint: 'This section auto-generates repeatable inputs based on the field type you choose.',
503
511
  matrixScaleRowTitle: 'Row header title',
504
512
  matrixScaleRowTitlePlaceholder: 'e.g. Activity',
505
- matrixScaleLayout: 'Matrix layout',
513
+ matrixScaleRowTitleWidth: 'Question column min width (px)',
506
514
  matrixScaleLayout_options: 'Option matrix',
507
515
  matrixScaleLayout_columns: 'Cell matrix',
508
516
  matrixScaleLayout_field: 'One field per row',
509
517
  matrixScaleRequired: 'Required for each row/cell',
510
518
  matrixScaleSummary: '{type} · {layout} · {rows} rows',
511
- matrixScaleEditorHint_options: 'Configure row labels and scale options; each row uses the same choice field.',
512
- matrixScaleEditorHint_columns: 'Configure rows and columns; each cell uses the same field type (e.g. number, rate).',
513
- matrixScaleEditorHint_field: 'Configure row labels only; each row shows one field without columns.',
519
+ matrixScaleEditorHint_options: 'Field type is radio/checkbox: scale options become the header columns.',
520
+ matrixScaleEditorHint_columns: 'Each cell is one field; remove all columns to get one field per row.',
521
+ matrixScaleEditorHint_field: 'One field per row; add columns to get one field per cell.',
514
522
  matrixScaleRowsTitle: 'Rows',
515
523
  matrixScaleRowsHint: 'Left is the row label; right is the data key',
516
524
  matrixScaleRowLabelPlaceholder: 'e.g. Work / Study',
@@ -518,9 +526,17 @@ const locale = {
518
526
  matrixScaleOptionsTitle: 'Scale options (columns)',
519
527
  matrixScaleColumnsTitle: 'Columns',
520
528
  matrixScaleColumnsHint: 'Left is the column label; right is the data key',
529
+ matrixScaleColumnLayoutHint: '“Span” sets relative width (e.g. 1:2:1); “Min width” is optional, unit px; row title stays sticky with a scroll shadow',
530
+ matrixScaleColumnSpan: 'Column span ratio',
531
+ matrixScaleColumnSpanShort: 'Span',
532
+ matrixScaleColumnMin: 'Column min width',
533
+ matrixScaleColumnMinShort: 'Min width',
534
+ matrixScaleColumnMinUnit: 'px',
521
535
  matrixScaleColumnLabelPlaceholder: 'e.g. Monday',
522
536
  matrixScaleColumnNamePlaceholder: 'e.g. mon',
523
537
  matrixScaleAddRow: 'Add row',
538
+ matrixScaleAddColumn: 'Add column',
539
+ matrixScaleColumnsOptionalHint: 'Optional; “Span” sets relative width, “Min width” unit is px',
524
540
  stepListTitle: 'Steps',
525
541
  addStep: 'Add Step',
526
542
  editStep: 'Edit Step',
@@ -895,6 +911,49 @@ const createEmptyColumn = () => ({
895
911
  name: createDataKey('col'),
896
912
  width: undefined
897
913
  });
914
+
915
+ /** 选项作为矩阵列的填写项类型(RadioGroup/CheckboxGroup 在 MatrixScale 里隐藏选项文案,只留圆点/方框) */
916
+ const MATRIX_CHOICE_FIELD_TYPES = ['RadioGroup', 'CheckboxGroup'];
917
+ const hasMatrixColumns = columns => Array.isArray(columns) && columns.some(column => column && String(column.name || '').trim());
918
+
919
+ /**
920
+ * 矩阵结构由填写项类型推断,不单独配置:
921
+ * - 单选/多选 → options(选项作列)
922
+ * - 其他类型且配了列 → columns(每格一个填写项)
923
+ * - 其他类型未配列 → field(每行一个填写项)
924
+ */
925
+ const resolveMatrixLayout = block => {
926
+ if (MATRIX_CHOICE_FIELD_TYPES.includes((block == null ? void 0 : block.fieldType) || 'RadioGroup')) {
927
+ return 'options';
928
+ }
929
+ return hasMatrixColumns(block == null ? void 0 : block.columns) ? 'columns' : 'field';
930
+ };
931
+
932
+ /** 矩阵列/选项显示比例(span,兼容 ratio);默认 1 不落盘。可选 width 定宽 */
933
+ const pickMatrixColumnLayout = item => {
934
+ var _item$span;
935
+ const layout = {};
936
+ if ((item == null ? void 0 : item.width) != null && item.width !== '') {
937
+ const width = Number(item.width);
938
+ if (!Number.isNaN(width) && width > 0) {
939
+ layout.width = width;
940
+ }
941
+ }
942
+ const spanRaw = (_item$span = item == null ? void 0 : item.span) != null ? _item$span : item == null ? void 0 : item.ratio;
943
+ if (spanRaw != null && spanRaw !== '' && Number(spanRaw) !== 1) {
944
+ const span = Number(spanRaw);
945
+ if (!Number.isNaN(span) && span > 0) {
946
+ layout.span = span;
947
+ }
948
+ }
949
+ if ((item == null ? void 0 : item.min) != null && item.min !== '' && layout.width == null) {
950
+ const min = Number(item.min);
951
+ if (!Number.isNaN(min) && min > 0) {
952
+ layout.min = min;
953
+ }
954
+ }
955
+ return layout;
956
+ };
898
957
  const defaultSchema = () => ({
899
958
  title: '',
900
959
  subtitle: '',
@@ -1033,7 +1092,7 @@ const createBlock = (kind, overrides = {}) => {
1033
1092
  label: '',
1034
1093
  value: ''
1035
1094
  }],
1036
- columns: undefined
1095
+ columns: []
1037
1096
  }, overrides);
1038
1097
  }
1039
1098
  if (kind === 'choice') {
@@ -1153,14 +1212,18 @@ const normalizeBlock = (block, depth = 0) => {
1153
1212
  return normalized;
1154
1213
  }
1155
1214
  if (kind === 'matrixScale') {
1156
- const layout = block.layout === 'columns' || block.layout === 'field' ? block.layout : 'options';
1157
1215
  normalized.list = undefined;
1158
1216
  normalized.items = undefined;
1159
1217
  normalized.itemBlocks = undefined;
1160
1218
  normalized.blocks = undefined;
1161
- normalized.layout = layout;
1162
1219
  normalized.fieldType = block.fieldType || 'RadioGroup';
1163
1220
  normalized.rowTitle = block.rowTitle != null ? block.rowTitle : '';
1221
+ const rowTitleWidth = block.rowTitleWidth != null && block.rowTitleWidth !== '' ? Number(block.rowTitleWidth) : undefined;
1222
+ if (rowTitleWidth && rowTitleWidth !== 160) {
1223
+ normalized.rowTitleWidth = rowTitleWidth;
1224
+ } else {
1225
+ delete normalized.rowTitleWidth;
1226
+ }
1164
1227
  normalized.rule = block.rule != null ? block.rule : '';
1165
1228
  // 保留编辑器侧的 _key:MatrixScaleEditor 用它做行 key;normalize 若剥掉会触发 ensureKeys→onChange 死循环(React #185)
1166
1229
  const keepKey = item => item != null && item._key ? {
@@ -1179,33 +1242,27 @@ const normalizeBlock = (block, depth = 0) => {
1179
1242
  name: createDataKey('row')
1180
1243
  }];
1181
1244
  }
1182
- if (layout === 'options') {
1183
- normalized.options = Array.isArray(block.options) ? block.options.map(option => {
1184
- var _option$label, _option$value;
1185
- return _extends({}, option, keepKey(option), {
1186
- label: (_option$label = option == null ? void 0 : option.label) != null ? _option$label : '',
1187
- value: (_option$value = option == null ? void 0 : option.value) != null ? _option$value : ''
1188
- });
1189
- }) : [];
1190
- normalized.columns = undefined;
1191
- } else if (layout === 'columns') {
1192
- normalized.columns = Array.isArray(block.columns) ? block.columns.map(column => {
1193
- var _ref, _column$label;
1194
- return _extends({}, keepKey(column), {
1195
- label: (_ref = (_column$label = column == null ? void 0 : column.label) != null ? _column$label : column == null ? void 0 : column.title) != null ? _ref : '',
1196
- name: String((column == null ? void 0 : column.name) || '').trim() || createDataKey('col')
1197
- });
1198
- }).filter(column => String(column.label || '').trim() || String(column.name || '').trim()) : [];
1199
- if (!normalized.columns.length) {
1200
- normalized.columns = [{
1201
- label: '',
1202
- name: createDataKey('col')
1203
- }];
1204
- }
1205
- normalized.options = undefined;
1206
- } else {
1207
- normalized.options = undefined;
1208
- normalized.columns = undefined;
1245
+ // options / columns 都保留:切换填写项类型时不丢另一边已填的配置
1246
+ normalized.options = Array.isArray(block.options) ? block.options.map(option => {
1247
+ var _option$label, _option$value;
1248
+ return _extends({}, keepKey(option), {
1249
+ label: (_option$label = option == null ? void 0 : option.label) != null ? _option$label : '',
1250
+ value: (_option$value = option == null ? void 0 : option.value) != null ? _option$value : ''
1251
+ }, pickMatrixColumnLayout(option));
1252
+ }) : [];
1253
+ normalized.columns = Array.isArray(block.columns) ? block.columns.map(column => {
1254
+ var _ref, _column$label;
1255
+ return _extends({}, keepKey(column), {
1256
+ label: (_ref = (_column$label = column == null ? void 0 : column.label) != null ? _column$label : column == null ? void 0 : column.title) != null ? _ref : '',
1257
+ name: String((column == null ? void 0 : column.name) || '').trim() || createDataKey('col')
1258
+ }, pickMatrixColumnLayout(column));
1259
+ }) : [];
1260
+ normalized.layout = resolveMatrixLayout(normalized);
1261
+ if (normalized.layout === 'options' && !normalized.options.length) {
1262
+ normalized.options = [{
1263
+ label: '',
1264
+ value: ''
1265
+ }];
1209
1266
  }
1210
1267
  return normalized;
1211
1268
  }
@@ -1724,9 +1781,6 @@ const BLOCK_KINDS = {
1724
1781
  /** editableList 添加按钮位置,与 @kne/form-info EditableList addPosition 一致 */
1725
1782
  const ADD_POSITIONS = ['bottom', 'top', 'both'];
1726
1783
 
1727
- /** matrixScale 布局:options 选项组矩阵 / columns 单元格矩阵 / field 每行一个字段 */
1728
- const MATRIX_LAYOUTS = ['options', 'columns', 'field'];
1729
-
1730
1784
  /** steps 导航样式:default 为 antd 完整步骤条;focus 突出当前步骤标题,其余收成序号 */
1731
1785
  const STEPS_STYLES = ['default', 'focus'];
1732
1786
  const getBlockKindOptions = formatMessage => Object.entries(BLOCK_KINDS).map(([value, config]) => ({
@@ -1737,7 +1791,7 @@ const getBlockKindOptions = formatMessage => Object.entries(BLOCK_KINDS).map(([v
1737
1791
  }));
1738
1792
  const getBlockDefinition = kind => BLOCK_KINDS[kind];
1739
1793
  const blockToFormValues = block => {
1740
- var _block$column, _block$gap, _block$maxLength, _block$minLength;
1794
+ var _block$column, _block$gap, _block$maxLength, _block$minLength, _block$rowTitleWidth;
1741
1795
  return {
1742
1796
  kind: block.kind,
1743
1797
  title: block.title || '',
@@ -1754,8 +1808,8 @@ const blockToFormValues = block => {
1754
1808
  minLength: (_block$minLength = block.minLength) != null ? _block$minLength : null,
1755
1809
  addPosition: ADD_POSITIONS.includes(block.addPosition) ? block.addPosition : 'bottom',
1756
1810
  fieldType: block.fieldType || (block.kind === 'matrixScale' ? 'RadioGroup' : 'Input'),
1757
- layout: MATRIX_LAYOUTS.includes(block.layout) ? block.layout : 'options',
1758
1811
  rowTitle: block.rowTitle || '',
1812
+ rowTitleWidth: (_block$rowTitleWidth = block.rowTitleWidth) != null ? _block$rowTitleWidth : null,
1759
1813
  required: typeof block.rule === 'string' && block.rule.split(' ').includes('REQ'),
1760
1814
  autoStep: block.autoStep !== false,
1761
1815
  stepsStyle: STEPS_STYLES.includes(block.stepsStyle) ? block.stepsStyle : 'default',
@@ -1791,29 +1845,21 @@ const formValuesToBlock = (values, existingBlock = {}) => {
1791
1845
  selectorInData: values.selectorInData !== false
1792
1846
  });
1793
1847
  if (kind === 'matrixScale') {
1794
- const layout = MATRIX_LAYOUTS.includes(values.layout) ? values.layout : 'options';
1795
- next.layout = layout;
1796
1848
  next.rowTitle = values.rowTitle || undefined;
1849
+ next.rowTitleWidth = values.rowTitleWidth != null && values.rowTitleWidth !== '' ? Number(values.rowTitleWidth) : undefined;
1850
+ if (next.rowTitleWidth === 160 || !next.rowTitleWidth) {
1851
+ delete next.rowTitleWidth;
1852
+ }
1797
1853
  next.rule = values.required ? 'REQ' : undefined;
1798
- if (layout === 'options') {
1799
- next.columns = undefined;
1800
- if (!Array.isArray(next.options) || !next.options.length) {
1801
- next.options = [{
1802
- label: '',
1803
- value: ''
1804
- }];
1805
- }
1806
- } else if (layout === 'columns') {
1807
- next.options = undefined;
1808
- if (!Array.isArray(next.columns) || !next.columns.length) {
1809
- next.columns = [{
1810
- label: '',
1811
- name: createDataKey('col')
1812
- }];
1813
- }
1814
- } else {
1815
- next.options = undefined;
1816
- next.columns = undefined;
1854
+ // 不清空 options / columns:切回原类型时配置还在
1855
+ next.options = Array.isArray(next.options) ? next.options : [];
1856
+ next.columns = Array.isArray(next.columns) ? next.columns : [];
1857
+ next.layout = resolveMatrixLayout(next);
1858
+ if (next.layout === 'options' && !next.options.length) {
1859
+ next.options = [{
1860
+ label: '',
1861
+ value: ''
1862
+ }];
1817
1863
  }
1818
1864
  if (!Array.isArray(next.rows) || !next.rows.length) {
1819
1865
  next.rows = [{
@@ -3313,7 +3359,8 @@ const pickFieldProps = (field, definition) => {
3313
3359
  return {
3314
3360
  inline: props.inline !== false,
3315
3361
  modern: !!props.modern,
3316
- block: !!props.block,
3362
+ // 编辑器用 choiceBlock,避免与字段布局 field.block(占满整行)同名冲突
3363
+ choiceBlock: !!props.block,
3317
3364
  indexType: props.indexType === 'number' || props.indexType === 'check' ? props.indexType : 'letter',
3318
3365
  otherLabel: ((_props$otherOption = props.otherOption) == null ? void 0 : _props$otherOption.label) || '',
3319
3366
  otherPlaceholder: ((_props$otherProps = props.otherProps) == null ? void 0 : _props$otherProps.placeholder) || ''
@@ -3326,7 +3373,7 @@ const pickFieldProps = (field, definition) => {
3326
3373
  }
3327
3374
  };
3328
3375
  const applyFieldProps = (props, values, definition) => {
3329
- var _values$rows, _definition$propsSche2;
3376
+ var _values$rows, _values$choiceBlock, _definition$propsSche2;
3330
3377
  const type = definition.type;
3331
3378
  switch (type) {
3332
3379
  case 'Input':
@@ -3396,7 +3443,8 @@ const applyFieldProps = (props, values, definition) => {
3396
3443
  // 始终落盘布尔值,避免 Checkbox 未勾选时字段缺失被当成默认横向
3397
3444
  props.inline = values.inline !== false;
3398
3445
  props.modern = !!values.modern;
3399
- props.block = !!values.block;
3446
+ // schema 仍写 props.block;编辑器表单字段名为 choiceBlock
3447
+ props.block = !!((_values$choiceBlock = values.choiceBlock) != null ? _values$choiceBlock : values.block);
3400
3448
  if (values.modern && (values.indexType === 'number' || values.indexType === 'check')) {
3401
3449
  props.indexType = values.indexType;
3402
3450
  } else {
@@ -3902,17 +3950,35 @@ const createEmptyMatrixRow = () => ({
3902
3950
  const createEmptyMatrixColumn = () => ({
3903
3951
  _key: createColKey(),
3904
3952
  label: '',
3905
- name: createDataKey('col')
3953
+ name: createDataKey('col'),
3954
+ span: 1
3906
3955
  });
3907
3956
  const createEmptyMatrixOption = () => ({
3908
3957
  _key: createOptKey(),
3909
3958
  label: '',
3910
- value: ''
3959
+ value: '',
3960
+ span: 1
3911
3961
  });
3912
3962
  const ensureKeys = (list = [], createKey) => list.map(item => _extends({}, item, {
3913
3963
  _key: item._key || createKey()
3914
3964
  }));
3915
3965
  const hasMissingKey = (list = []) => list.some(item => !(item != null && item._key));
3966
+ const getItemSpan = item => {
3967
+ var _item$span;
3968
+ const raw = (_item$span = item == null ? void 0 : item.span) != null ? _item$span : item == null ? void 0 : item.ratio;
3969
+ if (raw == null || raw === '') {
3970
+ return 1;
3971
+ }
3972
+ const n = Number(raw);
3973
+ return !Number.isNaN(n) && n > 0 ? n : 1;
3974
+ };
3975
+ const getItemMin = item => {
3976
+ if ((item == null ? void 0 : item.min) == null || item.min === '') {
3977
+ return null;
3978
+ }
3979
+ const n = Number(item.min);
3980
+ return !Number.isNaN(n) && n > 0 ? n : null;
3981
+ };
3916
3982
 
3917
3983
  /** 勿在此用 FormInfo:模块列不在 Form 内,FormInfo→FieldList 会读不到 openApiRef */
3918
3984
  const EditorSection = ({
@@ -3931,6 +3997,59 @@ const EditorSection = ({
3931
3997
  children: tip
3932
3998
  }) : null]
3933
3999
  });
4000
+
4001
+ /** 列比例 + 最小宽:与 table-view 一致,写入 span / min */
4002
+ const ColumnLayoutInputs = ({
4003
+ item,
4004
+ onPatch,
4005
+ formatMessage
4006
+ }) => /*#__PURE__*/jsxs(Fragment, {
4007
+ children: [/*#__PURE__*/jsx(InputNumber$1, {
4008
+ className: style['matrix-scale-span-input'],
4009
+ min: 1,
4010
+ max: 24,
4011
+ precision: 0,
4012
+ value: getItemSpan(item),
4013
+ prefix: /*#__PURE__*/jsx("span", {
4014
+ className: style['matrix-scale-input-affix'],
4015
+ children: formatMessage({
4016
+ id: 'matrixScaleColumnSpanShort'
4017
+ })
4018
+ }),
4019
+ title: formatMessage({
4020
+ id: 'matrixScaleColumnSpan'
4021
+ }),
4022
+ onChange: value => onPatch({
4023
+ span: value == null || value < 1 ? 1 : value,
4024
+ ratio: undefined
4025
+ })
4026
+ }), /*#__PURE__*/jsx(InputNumber$1, {
4027
+ className: style['matrix-scale-min-input'],
4028
+ min: 40,
4029
+ max: 800,
4030
+ precision: 0,
4031
+ value: getItemMin(item),
4032
+ prefix: /*#__PURE__*/jsx("span", {
4033
+ className: style['matrix-scale-input-affix'],
4034
+ children: formatMessage({
4035
+ id: 'matrixScaleColumnMinShort'
4036
+ })
4037
+ }),
4038
+ suffix: /*#__PURE__*/jsx("span", {
4039
+ className: style['matrix-scale-input-affix'],
4040
+ children: formatMessage({
4041
+ id: 'matrixScaleColumnMinUnit'
4042
+ })
4043
+ }),
4044
+ title: formatMessage({
4045
+ id: 'matrixScaleColumnMin'
4046
+ }),
4047
+ placeholder: "\u2014",
4048
+ onChange: value => onPatch({
4049
+ min: value == null || value < 1 ? undefined : value
4050
+ })
4051
+ })]
4052
+ });
3934
4053
  const LabelNameRows = ({
3935
4054
  title,
3936
4055
  tip,
@@ -3940,18 +4059,24 @@ const LabelNameRows = ({
3940
4059
  createKey,
3941
4060
  labelPlaceholder,
3942
4061
  namePlaceholder,
3943
- addText
4062
+ addText,
4063
+ withColumnLayout,
4064
+ allowEmpty
3944
4065
  }) => {
3945
- // 只展示已落盘数据;缺 key / 空列表由 effect 补齐,避免每次 render 新建临时项导致丢焦点
4066
+ const {
4067
+ formatMessage
4068
+ } = useIntl();
3946
4069
  useEffect(() => {
3947
4070
  if (!list.length) {
3948
- onChange([createEmpty()]);
4071
+ if (!allowEmpty) {
4072
+ onChange([createEmpty()]);
4073
+ }
3949
4074
  return;
3950
4075
  }
3951
4076
  if (hasMissingKey(list)) {
3952
4077
  onChange(ensureKeys(list, createKey));
3953
4078
  }
3954
- }, [list, onChange, createEmpty, createKey]);
4079
+ }, [list, onChange, createEmpty, createKey, allowEmpty]);
3955
4080
  const rows = list.length ? list : [];
3956
4081
  const updateItem = (index, patch) => {
3957
4082
  onChange(rows.map((item, itemIndex) => itemIndex === index ? _extends({}, item, patch) : item));
@@ -3963,8 +4088,9 @@ const LabelNameRows = ({
3963
4088
  className: style['options-list'],
3964
4089
  children: rows.map((item, index) => /*#__PURE__*/jsxs(Flex, {
3965
4090
  gap: 8,
4091
+ wrap: "wrap",
3966
4092
  align: "start",
3967
- className: style['options-row'],
4093
+ className: [style['options-row'], style['matrix-scale-options-row'], withColumnLayout ? style['has-column-layout'] : null].filter(Boolean).join(' '),
3968
4094
  children: [/*#__PURE__*/jsx(Input$1, {
3969
4095
  value: item.label || '',
3970
4096
  placeholder: labelPlaceholder,
@@ -3977,15 +4103,19 @@ const LabelNameRows = ({
3977
4103
  onChange: e => updateItem(index, {
3978
4104
  name: e.target.value
3979
4105
  })
3980
- }), /*#__PURE__*/jsx(Button, {
4106
+ }), withColumnLayout ? /*#__PURE__*/jsx(ColumnLayoutInputs, {
4107
+ item: item,
4108
+ onPatch: patch => updateItem(index, patch),
4109
+ formatMessage: formatMessage
4110
+ }) : null, /*#__PURE__*/jsx(Button, {
3981
4111
  type: "text",
3982
4112
  danger: true,
3983
4113
  className: style['icon-square-btn-sm'],
3984
4114
  icon: /*#__PURE__*/jsx(DeleteOutlined, {}),
3985
- disabled: rows.length <= 1,
4115
+ disabled: !allowEmpty && rows.length <= 1,
3986
4116
  onClick: () => {
3987
4117
  const next = rows.filter((_, i) => i !== index);
3988
- onChange(next.length ? next : [createEmpty()]);
4118
+ onChange(next.length || allowEmpty ? next : [createEmpty()]);
3989
4119
  }
3990
4120
  })]
3991
4121
  }, item._key || `row-${index}`))
@@ -4022,12 +4152,16 @@ const MatrixOptionsEditor = ({
4022
4152
  title: formatMessage({
4023
4153
  id: 'matrixScaleOptionsTitle'
4024
4154
  }),
4155
+ tip: formatMessage({
4156
+ id: 'matrixScaleColumnLayoutHint'
4157
+ }),
4025
4158
  children: [/*#__PURE__*/jsx("div", {
4026
4159
  className: style['options-list'],
4027
4160
  children: rows.map((item, index) => /*#__PURE__*/jsxs(Flex, {
4028
4161
  gap: 8,
4162
+ wrap: "wrap",
4029
4163
  align: "start",
4030
- className: style['options-row'],
4164
+ className: `${style['options-row']} ${style['matrix-scale-options-row']} ${style['has-column-layout']}`,
4031
4165
  children: [/*#__PURE__*/jsx(Input$1, {
4032
4166
  value: item.label || '',
4033
4167
  placeholder: formatMessage({
@@ -4051,6 +4185,10 @@ const MatrixOptionsEditor = ({
4051
4185
  onChange: e => updateItem(index, {
4052
4186
  value: e.target.value
4053
4187
  })
4188
+ }), /*#__PURE__*/jsx(ColumnLayoutInputs, {
4189
+ item: item,
4190
+ onPatch: patch => updateItem(index, patch),
4191
+ formatMessage: formatMessage
4054
4192
  }), /*#__PURE__*/jsx(Button, {
4055
4193
  type: "text",
4056
4194
  danger: true,
@@ -4081,13 +4219,11 @@ const MatrixScaleEditor = ({
4081
4219
  const {
4082
4220
  formatMessage
4083
4221
  } = useIntl();
4084
- const layout = block.layout === 'columns' || block.layout === 'field' ? block.layout : 'options';
4222
+ const layout = resolveMatrixLayout(block);
4085
4223
  const blockRef = useRef(block);
4086
4224
  blockRef.current = block;
4087
4225
  const onChangeRef = useRef(onChange);
4088
4226
  onChangeRef.current = onChange;
4089
-
4090
- // 用 ref 保持回调稳定,避免输入时子组件 useEffect 反复触发
4091
4227
  const handleRowsChange = useCallback(rows => onChangeRef.current(_extends({}, blockRef.current, {
4092
4228
  rows
4093
4229
  })), []);
@@ -4128,12 +4264,12 @@ const MatrixScaleEditor = ({
4128
4264
  }), layout === 'options' ? /*#__PURE__*/jsx(MatrixOptionsEditor, {
4129
4265
  value: block.options || [],
4130
4266
  onChange: handleOptionsChange
4131
- }) : null, layout === 'columns' ? /*#__PURE__*/jsx(LabelNameRows, {
4267
+ }) : /*#__PURE__*/jsx(LabelNameRows, {
4132
4268
  title: formatMessage({
4133
4269
  id: 'matrixScaleColumnsTitle'
4134
4270
  }),
4135
4271
  tip: formatMessage({
4136
- id: 'matrixScaleColumnsHint'
4272
+ id: 'matrixScaleColumnsOptionalHint'
4137
4273
  }),
4138
4274
  list: block.columns || [],
4139
4275
  onChange: handleColumnsChange,
@@ -4146,9 +4282,11 @@ const MatrixScaleEditor = ({
4146
4282
  id: 'matrixScaleColumnNamePlaceholder'
4147
4283
  }),
4148
4284
  addText: formatMessage({
4149
- id: 'matrixScaleAddRow'
4150
- })
4151
- }) : null]
4285
+ id: 'matrixScaleAddColumn'
4286
+ }),
4287
+ withColumnLayout: true,
4288
+ allowEmpty: true
4289
+ })]
4152
4290
  });
4153
4291
  };
4154
4292
  var MatrixScaleEditor$1 = MatrixScaleEditor;
@@ -4811,7 +4949,7 @@ const BlockListPanel = ({
4811
4949
  const supportsBlocks = block.kind === 'formInfo' || block.kind === 'object';
4812
4950
  const supportsChildModules = supportsItemBlocks$1 || supportsBlocks;
4813
4951
  const nestCount = supportsItemBlocks$1 ? ((_block$itemBlocks = block.itemBlocks) == null ? void 0 : _block$itemBlocks.length) || 0 : ((_block$blocks = block.blocks) == null ? void 0 : _block$blocks.length) || 0;
4814
- const matrixLayout = block.layout === 'columns' || block.layout === 'field' ? block.layout : 'options';
4952
+ const matrixLayout = resolveMatrixLayout(block);
4815
4953
  const summary = block.kind === 'steps' ? formatMessage({
4816
4954
  id: 'stepCount'
4817
4955
  }, {
@@ -5261,26 +5399,22 @@ const BlockConfigFields = ({
5261
5399
  placeholder: formatMessage({
5262
5400
  id: 'matrixScaleRowTitlePlaceholder'
5263
5401
  })
5264
- }, "rowTitle"), fieldTypeSelect);
5402
+ }, "rowTitle"), /*#__PURE__*/jsx(InputNumber, {
5403
+ name: "rowTitleWidth",
5404
+ label: formatMessage({
5405
+ id: 'matrixScaleRowTitleWidth'
5406
+ }),
5407
+ min: 80,
5408
+ max: 640,
5409
+ placeholder: "160"
5410
+ }, "rowTitleWidth"), fieldTypeSelect);
5265
5411
  add('rule', /*#__PURE__*/jsx(Checkbox, {
5266
5412
  name: "required",
5267
5413
  children: formatMessage({
5268
5414
  id: 'matrixScaleRequired'
5269
5415
  })
5270
5416
  }, "required"));
5271
- add('layout', /*#__PURE__*/jsx(Select, {
5272
- name: "layout",
5273
- label: formatMessage({
5274
- id: 'matrixScaleLayout'
5275
- }),
5276
- rule: "REQ",
5277
- options: MATRIX_LAYOUTS.map(value => ({
5278
- label: formatMessage({
5279
- id: `matrixScaleLayout_${value}`
5280
- }),
5281
- value
5282
- }))
5283
- }, "layout"), borderedCheckbox);
5417
+ add('layout', borderedCheckbox);
5284
5418
  }
5285
5419
  if (kind === 'steps') {
5286
5420
  add('basic', titleInput(), subtitleInput);
@@ -6549,11 +6683,11 @@ const buildBuiltinList = (type, formatMessage) => {
6549
6683
  id: 'propChoiceModern'
6550
6684
  })
6551
6685
  }, "modern"), /*#__PURE__*/jsx(Checkbox, {
6552
- name: "block",
6686
+ name: "choiceBlock",
6553
6687
  children: formatMessage({
6554
6688
  id: 'propChoiceBlock'
6555
6689
  })
6556
- }, "block"), /*#__PURE__*/jsx(Select, {
6690
+ }, "choiceBlock"), /*#__PURE__*/jsx(Select, {
6557
6691
  name: "indexType",
6558
6692
  label: formatMessage({
6559
6693
  id: 'propChoiceIndexType'
@@ -8355,12 +8489,18 @@ const renderFieldEntries = (fields = [], preview = false, {
8355
8489
  }
8356
8490
  delete props.range;
8357
8491
 
8358
- // 选择组:form-creator 的 inline 仅编辑器用;渲染时删掉。block/modern 交给 react-form-antd;
8359
- // 未开 block 且 inline=false 时沿用旧纵向兜底
8492
+ // 选择组:inline 仅编辑器用;props.block(块级选项)经 isBlock 透传。
8493
+ // form-info / react-form-plus 会吃掉布局用 block,并把 isBlock remap 为控件 block。
8494
+ // 未开块级选项且 inline=false 时沿用旧纵向兜底。
8360
8495
  if (field.type === 'RadioGroup' || field.type === 'CheckboxGroup' || field.type === 'RadioGroupOther' || field.type === 'CheckboxGroupOther') {
8361
8496
  const optionsInline = props.inline !== false;
8497
+ const choiceBlock = !!props.block;
8362
8498
  delete props.inline;
8363
- if (!props.block && !optionsInline) {
8499
+ delete props.block;
8500
+ if (choiceBlock) {
8501
+ props.isBlock = true;
8502
+ }
8503
+ if (!choiceBlock && !optionsInline) {
8364
8504
  if (field.type === 'RadioGroup' || field.type === 'RadioGroupOther') {
8365
8505
  props.vertical = true;
8366
8506
  }
@@ -8383,6 +8523,7 @@ const renderFieldEntries = (fields = [], preview = false, {
8383
8523
  labelRender: buildIndexedLabelRender(displayIndex)
8384
8524
  } : null, {
8385
8525
  rule: field.rule || undefined,
8526
+ // 仅布局「占满整行」;块级选项样式走上方 isBlock,避免被 form-plus 剥掉后失效
8386
8527
  block: field.block || undefined
8387
8528
  }, props, localeProps, {
8388
8529
  labelTips: buildLabelTips(field.tips),
@@ -8592,12 +8733,15 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
8592
8733
  if (!FieldComponent) {
8593
8734
  return null;
8594
8735
  }
8595
- const layout = block.layout === 'columns' || block.layout === 'field' ? block.layout : 'options';
8736
+ const layout = resolveMatrixLayout(block);
8596
8737
  return withBlockLayout(/*#__PURE__*/createElement(MatrixScale, _extends({
8597
8738
  key: block.id,
8598
8739
  name: block.name,
8599
8740
  title: block.title || undefined,
8600
- rowTitle: block.rowTitle || undefined,
8741
+ rowTitle: block.rowTitle || undefined
8742
+ }, block.rowTitleWidth != null && block.rowTitleWidth !== '' ? {
8743
+ rowTitleWidth: block.rowTitleWidth
8744
+ } : null, {
8601
8745
  bordered,
8602
8746
  field: FieldComponent,
8603
8747
  rule: block.rule || undefined,
@@ -10187,7 +10331,7 @@ const walkBlock = (block, layer, depth = 0, ctx = {}) => {
10187
10331
  if (!name) {
10188
10332
  return;
10189
10333
  }
10190
- const layout = block.layout === 'columns' || block.layout === 'field' ? block.layout : 'options';
10334
+ const layout = resolveMatrixLayout(block);
10191
10335
  const fieldType = block.fieldType || 'RadioGroup';
10192
10336
  const required = typeof block.rule === 'string' && block.rule.split(' ').includes('REQ');
10193
10337
  const properties = {};
@@ -10393,7 +10537,7 @@ const isMatrixChoiceSelected = (cellValue, optionValue) => {
10393
10537
 
10394
10538
  /** 只读矩阵:对齐填写态 MatrixScale 的表头 + 行列网格,而不是摊成普通字段列表 */
10395
10539
  const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) => {
10396
- const layout = block.layout === 'columns' || block.layout === 'field' ? block.layout : 'options';
10540
+ const layout = resolveMatrixLayout(block);
10397
10541
  const fieldType = block.fieldType || 'RadioGroup';
10398
10542
  const rows = (block.rows || []).filter(row => row && row.name != null && String(row.name).trim());
10399
10543
  if (!rows.length) {
@@ -10403,6 +10547,13 @@ const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) =>
10403
10547
  id: 'schemaContentEmptyValue'
10404
10548
  });
10405
10549
  const rowTitle = block.rowTitle || '';
10550
+ const rowTitleWidthPx = (() => {
10551
+ const n = Number(block.rowTitleWidth);
10552
+ return !Number.isNaN(n) && n > 0 ? n : 160;
10553
+ })();
10554
+ const matrixTitleStyle = {
10555
+ '--matrix-scale-title-width': `${rowTitleWidthPx}px`
10556
+ };
10406
10557
  if (layout === 'options') {
10407
10558
  const options = (block.options || []).filter(option => option && (option.value != null || option.label != null));
10408
10559
  const optionCount = Math.max(options.length, 1);
@@ -10434,9 +10585,9 @@ const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) =>
10434
10585
  className: [style['schema-content-matrix'], style['is-choice']].join(' '),
10435
10586
  children: /*#__PURE__*/jsxs("div", {
10436
10587
  className: style['schema-content-matrix-inner'],
10437
- style: {
10588
+ style: _extends({}, matrixTitleStyle, {
10438
10589
  '--matrix-scale-option-count': optionCount
10439
- },
10590
+ }),
10440
10591
  children: [/*#__PURE__*/jsxs("div", {
10441
10592
  className: style['schema-content-matrix-header'],
10442
10593
  children: [/*#__PURE__*/jsx("div", {
@@ -10507,9 +10658,9 @@ const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) =>
10507
10658
  className: style['schema-content-matrix'],
10508
10659
  children: /*#__PURE__*/jsxs("div", {
10509
10660
  className: style['schema-content-matrix-inner'],
10510
- style: {
10661
+ style: _extends({}, matrixTitleStyle, {
10511
10662
  '--matrix-scale-option-count': optionCount
10512
- },
10663
+ }),
10513
10664
  children: [/*#__PURE__*/jsxs("div", {
10514
10665
  className: style['schema-content-matrix-header'],
10515
10666
  children: [/*#__PURE__*/jsx("div", {
@@ -10561,9 +10712,9 @@ const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) =>
10561
10712
  }, rowName);
10562
10713
  }) : /*#__PURE__*/jsxs("div", {
10563
10714
  className: style['schema-content-matrix-inner'],
10564
- style: {
10715
+ style: _extends({}, matrixTitleStyle, {
10565
10716
  '--matrix-scale-option-count': 1
10566
- },
10717
+ }),
10567
10718
  children: [rowTitle ? /*#__PURE__*/jsxs("div", {
10568
10719
  className: style['schema-content-matrix-header'],
10569
10720
  children: [/*#__PURE__*/jsx("div", {