@kne/form-creator 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +623 -0
- package/dist/index.css +268 -13
- package/dist/index.css.map +1 -1
- package/dist/index.js +548 -76
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +551 -77
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createContext, useContext, useRef, useCallback, useEffect, useState, us
|
|
|
5
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';
|
|
6
6
|
import { createWithIntlProvider, useIntl } from '@kne/react-intl';
|
|
7
7
|
import { useIsMobile, RESPONSIVE_BOUNDARY_CLASS } from '@kne/responsive-utils';
|
|
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 } from '@ant-design/icons';
|
|
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';
|
|
9
9
|
import { hooks, Input, TextArea, InputNumber, Select, RadioGroup, CheckboxGroup, RadioGroupOther, CheckboxGroupOther, Switch, Checkbox, DatePicker, useFormContext, Slider, RULES, SubmitButton, ResetButton, CancelButton, preset as preset$1 } from '@kne/react-form-antd';
|
|
10
10
|
import SelectList, { SelectTableList, SelectTree, SelectCascader } from '@kne/super-select';
|
|
11
11
|
import { SelectFunction, SelectIndustry, SelectAddress } from '@kne/super-select-plus';
|
|
@@ -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-field":"kne-form-creator_0Lanz","schema-content-field-block":"kne-form-creator_TQd-w","schema-content-field-label":"kne-form-creator_czEK3","schema-content-field-value":"kne-form-creator_YFKTK","schema-content-file-list":"kne-form-creator_UGdXA","schema-content-file":"kne-form-creator_75EtE","schema-content-file-image":"kne-form-creator_P-be6","schema-content-file-name":"kne-form-creator_NXpTS","add-block-btn":"kne-form-creator_16Zre","add-inline-btn":"kne-form-creator_iCYdB","ant-btn-disabled":"kne-form-creator_LdGtv","block-list":"kne-form-creator_wK5eK","block-section":"kne-form-creator_15IiK","block-kind-formInfo":"kne-form-creator_D0hoK","block-kind-list":"kne-form-creator_JdPhy","block-kind-tableList":"kne-form-creator_gzd64","block-kind-editableList":"kne-form-creator_JzwrQ","block-kind-multiField":"kne-form-creator_t0iOJ","block-kind-matrixScale":"kne-form-creator_CFlQv","matrix-scale-editor-title":"kne-form-creator_Zo1Rz","block-kind-steps":"kne-form-creator_QNF9W","step-section":"kne-form-creator_22ajp","block-section-header":"kne-form-creator_wS4rL","block-header-meta":"kne-form-creator_PQiYV","block-title":"kne-form-creator_wSVJf","block-collapse-btn":"kne-form-creator_Ufp-W","is-expanded":"kne-form-creator_OjfBl","drag-handle":"kne-form-creator_7GuXk","more-btn":"kne-form-creator_paWIZ","drag-handle-action":"kne-form-creator_lhTrX","sortable-ghost":"kne-form-creator_7ZIH8","sortable-drag":"kne-form-creator_dxhFH","action-group":"kne-form-creator_773yo","hover-reveal":"kne-form-creator_S234h","block-summary":"kne-form-creator_GzeW8","block-summary-type":"kne-form-creator_0iyhP","block-header-actions":"kne-form-creator_Ue-nT","block-body":"kne-form-creator_je1H0","item-blocks-section":"kne-form-creator_wq4bT","nested-block-list":"kne-form-creator_4NWH4","block-section-nested":"kne-form-creator_mUKom","add-field-dropdown":"kne-form-creator_9JS0d","add-field-dropdown-item":"kne-form-creator_Ql1z3","add-field-dropdown-item-icon":"kne-form-creator_ZHB5O","add-field-dropdown-item-desc":"kne-form-creator_dcsOS","add-field-dropdown-divider":"kne-form-creator_CUK0H","add-field-dropdown-label":"kne-form-creator_bPJ-2","section-toolbar":"kne-form-creator_LUO8S","section-toolbar-label":"kne-form-creator_7KQ79","field-list":"kne-form-creator_-B7WZ","step-list":"kne-form-creator_kc1pH","step-section-header":"kne-form-creator_wkhEX","step-section-title":"kne-form-creator_NBinE","step-index":"kne-form-creator_CCKZZ","step-section-text":"kne-form-creator_hRFew","step-section-count":"kne-form-creator_G6Quc","step-section-actions":"kne-form-creator_es-FC","field-row":"kne-form-creator_XMkdt","field-row-index":"kne-form-creator_a-cDo","has-handle":"kne-form-creator_vbTgK","field-row-index-num":"kne-form-creator_e4yEp","field-row-main":"kne-form-creator_ftlwp","field-row-label":"kne-form-creator_XAxbE","inline-empty":"kne-form-creator_yP-RF","hover-reveal-active":"kne-form-creator_AE-6r","action-btn":"kne-form-creator_mLgqh","add-block-dropdown":"kne-form-creator_vmS-e","add-block-option":"kne-form-creator_gjg2Y","add-block-option-icon":"kne-form-creator_qh1hh","add-block-option-text":"kne-form-creator_G8iJO","add-block-option-title":"kne-form-creator_ETSvm","add-block-option-desc":"kne-form-creator_O0C3l","field-empty":"kne-form-creator_Nmpfl","field-label-tips-icon":"kne-form-creator_0VVaO","preview-header":"kne-form-creator_c4BT0","preview-title":"kne-form-creator_fPkK4","preview-body":"kne-form-creator_6JntQ","schema-form":"kne-form-creator_MxCWP","schema-body":"kne-form-creator_q9ydz","schema-actions":"kne-form-creator_Y4eEH","schema-actions-inner":"kne-form-creator_FT9Zf","choice-block":"kne-form-creator_RllJe","choice-selector":"kne-form-creator_5A1eM","choice-panels":"kne-form-creator_IO0MY","choice-panels-empty":"kne-form-creator_T0nND","choice-option-panel":"kne-form-creator_FQixN","choice-option-panel-title":"kne-form-creator_ofRo2","choice-option-summary":"kne-form-creator_pksH8","property-modal":"kne-form-creator_wRSZC","editor-intro":"kne-form-creator_uOGOq","field-editor-form":"kne-form-creator_PGPHL","editor-toggles":"kne-form-creator_Dfyhx","options-editor":"kne-form-creator_AK4yO","columns-editor":"kne-form-creator_DQW1N","table-rows-editor":"kne-form-creator_-meJG","is-plain":"kne-form-creator_IiViE","form-actions-editor":"kne-form-creator_fchMy","form-actions-switch-field":"kne-form-creator_6JE9x","form-actions-align-group":"kne-form-creator_51ZsV","form-actions-gap-slider":"kne-form-creator_Gq0bk","editor-section":"kne-form-creator_jJy85","section-divider":"kne-form-creator_zA7L-","rule-editor":"kne-form-creator_bAlGU","super-select-props":"kne-form-creator_Iawhh","field-props-editor":"kne-form-creator_Gabf2","prop-row":"kne-form-creator_7K54P","prop-label":"kne-form-creator_HAAyH","options-item":"kne-form-creator_dnOd2","table-row-card":"kne-form-creator_cwCYp","tree-options-editor":"kne-form-creator_s3nHO","tree-options-list":"kne-form-creator_Djs-E","tree-option-node":"kne-form-creator_XAcut","tree-option-row":"kne-form-creator_4K4Rj","tree-option-fields":"kne-form-creator_-4cjc","tree-option-actions":"kne-form-creator_IjCNI","tree-option-children":"kne-form-creator_pVPGJ","tree-add-sibling":"kne-form-creator_bl46P","rule-checkbox-group":"kne-form-creator_tDgVP","rule-len-row":"kne-form-creator_ATsae","rule-len-input":"kne-form-creator_jY4Ld","rule-len-sep":"kne-form-creator_jBDC8","options-list":"kne-form-creator_GUBNS","options-row":"kne-form-creator_uohD0","options-header":"kne-form-creator_As4L6","options-locale-text":"kne-form-creator_7-99l","options-header-label":"kne-form-creator_UhnVH","options-header-value":"kne-form-creator_2c35V","options-header-description":"kne-form-creator_ibWvX","icon-square-btn-sm":"kne-form-creator_GAh-t","options-header-action":"kne-form-creator_nTN1E","visible-when-editor":"kne-form-creator_ttGnB","visible-when-hint":"kne-form-creator_hPtdv","visible-when-list":"kne-form-creator_aoAt6","visible-when-row":"kne-form-creator_phRgr","visible-when-row-main":"kne-form-creator_l-J7d","visible-when-field":"kne-form-creator_YRh5W","visible-when-operator":"kne-form-creator_DIqFq","visible-when-value":"kne-form-creator_CHcia","visible-when-regex":"kne-form-creator_lKpVo","visible-when-flags":"kne-form-creator_Ps-cu","visible-when-regex-tester":"kne-form-creator_Wf4eG","options-tip":"kne-form-creator_vrTmK","icon-square-btn":"kne-form-creator_DZjCf","locale-text":"kne-form-creator_hMXkE","is-compact":"kne-form-creator_jBFpL","locale-text-item":"kne-form-creator_NqCQD","locale-text-prefix":"kne-form-creator_BQl2X","locale-text-tag":"kne-form-creator_65OWA","
|
|
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"};
|
|
22
22
|
|
|
23
23
|
function _extends() {
|
|
24
24
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -3313,7 +3313,8 @@ const pickFieldProps = (field, definition) => {
|
|
|
3313
3313
|
return {
|
|
3314
3314
|
inline: props.inline !== false,
|
|
3315
3315
|
modern: !!props.modern,
|
|
3316
|
-
|
|
3316
|
+
// 编辑器用 choiceBlock,避免与字段布局 field.block(占满整行)同名冲突
|
|
3317
|
+
choiceBlock: !!props.block,
|
|
3317
3318
|
indexType: props.indexType === 'number' || props.indexType === 'check' ? props.indexType : 'letter',
|
|
3318
3319
|
otherLabel: ((_props$otherOption = props.otherOption) == null ? void 0 : _props$otherOption.label) || '',
|
|
3319
3320
|
otherPlaceholder: ((_props$otherProps = props.otherProps) == null ? void 0 : _props$otherProps.placeholder) || ''
|
|
@@ -3326,7 +3327,7 @@ const pickFieldProps = (field, definition) => {
|
|
|
3326
3327
|
}
|
|
3327
3328
|
};
|
|
3328
3329
|
const applyFieldProps = (props, values, definition) => {
|
|
3329
|
-
var _values$rows, _definition$propsSche2;
|
|
3330
|
+
var _values$rows, _values$choiceBlock, _definition$propsSche2;
|
|
3330
3331
|
const type = definition.type;
|
|
3331
3332
|
switch (type) {
|
|
3332
3333
|
case 'Input':
|
|
@@ -3396,7 +3397,8 @@ const applyFieldProps = (props, values, definition) => {
|
|
|
3396
3397
|
// 始终落盘布尔值,避免 Checkbox 未勾选时字段缺失被当成默认横向
|
|
3397
3398
|
props.inline = values.inline !== false;
|
|
3398
3399
|
props.modern = !!values.modern;
|
|
3399
|
-
props.block
|
|
3400
|
+
// schema 仍写 props.block;编辑器表单字段名为 choiceBlock
|
|
3401
|
+
props.block = !!((_values$choiceBlock = values.choiceBlock) != null ? _values$choiceBlock : values.block);
|
|
3400
3402
|
if (values.modern && (values.indexType === 'number' || values.indexType === 'check')) {
|
|
3401
3403
|
props.indexType = values.indexType;
|
|
3402
3404
|
} else {
|
|
@@ -5296,6 +5298,11 @@ const BlockConfigFields = ({
|
|
|
5296
5298
|
value
|
|
5297
5299
|
}))
|
|
5298
5300
|
}, "stepsStyle"), borderedCheckbox, /*#__PURE__*/jsx(Checkbox, {
|
|
5301
|
+
name: "showIndex",
|
|
5302
|
+
children: formatMessage({
|
|
5303
|
+
id: 'blockShowIndex'
|
|
5304
|
+
})
|
|
5305
|
+
}, "showIndex"), /*#__PURE__*/jsx(Checkbox, {
|
|
5299
5306
|
name: "autoStep",
|
|
5300
5307
|
children: formatMessage({
|
|
5301
5308
|
id: 'blockAutoStep'
|
|
@@ -6544,11 +6551,11 @@ const buildBuiltinList = (type, formatMessage) => {
|
|
|
6544
6551
|
id: 'propChoiceModern'
|
|
6545
6552
|
})
|
|
6546
6553
|
}, "modern"), /*#__PURE__*/jsx(Checkbox, {
|
|
6547
|
-
name: "
|
|
6554
|
+
name: "choiceBlock",
|
|
6548
6555
|
children: formatMessage({
|
|
6549
6556
|
id: 'propChoiceBlock'
|
|
6550
6557
|
})
|
|
6551
|
-
}, "
|
|
6558
|
+
}, "choiceBlock"), /*#__PURE__*/jsx(Select, {
|
|
6552
6559
|
name: "indexType",
|
|
6553
6560
|
label: formatMessage({
|
|
6554
6561
|
id: 'propChoiceIndexType'
|
|
@@ -8143,6 +8150,160 @@ const createLocalizedRules = formatMessage => {
|
|
|
8143
8150
|
return rules;
|
|
8144
8151
|
};
|
|
8145
8152
|
|
|
8153
|
+
/**
|
|
8154
|
+
* showIndex 连续编号(同一作用域内含子模块字段,不从 1 重起)。
|
|
8155
|
+
*
|
|
8156
|
+
* 作用域根:
|
|
8157
|
+
* - formInfo.showIndex === true
|
|
8158
|
+
* - steps 上 showIndex(或 step.showIndex 覆盖)时,**每一步**各自从 1 起
|
|
8159
|
+
*
|
|
8160
|
+
* 规则:
|
|
8161
|
+
* - 作用域内 DFS:自身 list 字段 → 子 blocks / itemBlocks,连续 1,2,3…
|
|
8162
|
+
* - 嵌套 formInfo / object / choice 继续父级计数,不重起
|
|
8163
|
+
* - choice:各 option 从同一起点编号;计数按「字段数最多的 option」推进,避免切换选项影响后续序号
|
|
8164
|
+
* - list / tableList / editableList:只给「单条模板」编号(每行数字相同),与填写态 List 复用同一套字段节点一致
|
|
8165
|
+
* - matrixScale / multiField / 嵌套 steps:不占题干序号
|
|
8166
|
+
*/
|
|
8167
|
+
|
|
8168
|
+
const isIndexableField = field => !!(field && !field.hidden && field.name && field.id);
|
|
8169
|
+
const createIndexCounter = (start = 0) => ({
|
|
8170
|
+
value: start,
|
|
8171
|
+
take() {
|
|
8172
|
+
this.value += 1;
|
|
8173
|
+
return this.value;
|
|
8174
|
+
},
|
|
8175
|
+
peek() {
|
|
8176
|
+
return this.value;
|
|
8177
|
+
}
|
|
8178
|
+
});
|
|
8179
|
+
const assignFields = (fields, counter, map) => {
|
|
8180
|
+
(fields || []).forEach(field => {
|
|
8181
|
+
if (!isIndexableField(field)) {
|
|
8182
|
+
return;
|
|
8183
|
+
}
|
|
8184
|
+
map.set(field.id, counter.take());
|
|
8185
|
+
});
|
|
8186
|
+
};
|
|
8187
|
+
const assignBlock = (block, counter, map) => {
|
|
8188
|
+
if (!block || !block.kind) {
|
|
8189
|
+
return;
|
|
8190
|
+
}
|
|
8191
|
+
switch (block.kind) {
|
|
8192
|
+
case 'formInfo':
|
|
8193
|
+
case 'object':
|
|
8194
|
+
{
|
|
8195
|
+
assignFields(block.list, counter, map);
|
|
8196
|
+
(block.blocks || []).forEach(child => assignBlock(child, counter, map));
|
|
8197
|
+
break;
|
|
8198
|
+
}
|
|
8199
|
+
case 'choice':
|
|
8200
|
+
{
|
|
8201
|
+
const start = counter.peek();
|
|
8202
|
+
let maxEnd = start;
|
|
8203
|
+
(block.options || []).forEach(option => {
|
|
8204
|
+
const optionCounter = createIndexCounter(start);
|
|
8205
|
+
assignFields(option.list, optionCounter, map);
|
|
8206
|
+
(option.blocks || []).forEach(child => assignBlock(child, optionCounter, map));
|
|
8207
|
+
maxEnd = Math.max(maxEnd, optionCounter.peek());
|
|
8208
|
+
});
|
|
8209
|
+
counter.value = maxEnd;
|
|
8210
|
+
break;
|
|
8211
|
+
}
|
|
8212
|
+
case 'list':
|
|
8213
|
+
case 'tableList':
|
|
8214
|
+
case 'editableList':
|
|
8215
|
+
{
|
|
8216
|
+
assignFields(block.list, counter, map);
|
|
8217
|
+
(block.itemBlocks || []).forEach(child => assignBlock(child, counter, map));
|
|
8218
|
+
break;
|
|
8219
|
+
}
|
|
8220
|
+
}
|
|
8221
|
+
};
|
|
8222
|
+
|
|
8223
|
+
/**
|
|
8224
|
+
* 为作用域根(formInfo / object / step 的 { list, blocks })生成 fieldId → 1-based 序号。
|
|
8225
|
+
* @param {object} root
|
|
8226
|
+
* @param {{ enabled?: boolean }} [options]
|
|
8227
|
+
* @returns {Map<string, number>}
|
|
8228
|
+
*/
|
|
8229
|
+
const buildFieldIndexMap = (root, {
|
|
8230
|
+
enabled: _enabled = false
|
|
8231
|
+
} = {}) => {
|
|
8232
|
+
const map = new Map();
|
|
8233
|
+
if (!_enabled || !root) {
|
|
8234
|
+
return map;
|
|
8235
|
+
}
|
|
8236
|
+
const counter = createIndexCounter(0);
|
|
8237
|
+
if (root.kind === 'formInfo' || root.kind === 'object') {
|
|
8238
|
+
assignBlock(root, counter, map);
|
|
8239
|
+
return map;
|
|
8240
|
+
}
|
|
8241
|
+
// step 或其它 { list, blocks } 容器
|
|
8242
|
+
assignFields(root.list, counter, map);
|
|
8243
|
+
(root.blocks || []).forEach(child => assignBlock(child, counter, map));
|
|
8244
|
+
return map;
|
|
8245
|
+
};
|
|
8246
|
+
|
|
8247
|
+
/**
|
|
8248
|
+
* 进入子块时的序号上下文:父级已启用则继续同一 map;
|
|
8249
|
+
* 否则仅 formInfo/object 在 showIndex 时新建作用域(steps 按 step 单独建,见 resolveStepIndexContext)。
|
|
8250
|
+
*/
|
|
8251
|
+
const resolveIndexContext = (block, parentCtx = {}) => {
|
|
8252
|
+
if (parentCtx.indexMap) {
|
|
8253
|
+
return {
|
|
8254
|
+
indexMap: parentCtx.indexMap,
|
|
8255
|
+
indexEnabled: true
|
|
8256
|
+
};
|
|
8257
|
+
}
|
|
8258
|
+
if (!block || !block.showIndex) {
|
|
8259
|
+
return {
|
|
8260
|
+
indexMap: null,
|
|
8261
|
+
indexEnabled: false
|
|
8262
|
+
};
|
|
8263
|
+
}
|
|
8264
|
+
if (block.kind !== 'formInfo' && block.kind !== 'object') {
|
|
8265
|
+
return {
|
|
8266
|
+
indexMap: null,
|
|
8267
|
+
indexEnabled: false
|
|
8268
|
+
};
|
|
8269
|
+
}
|
|
8270
|
+
return {
|
|
8271
|
+
indexMap: buildFieldIndexMap(block, {
|
|
8272
|
+
enabled: true
|
|
8273
|
+
}),
|
|
8274
|
+
indexEnabled: true
|
|
8275
|
+
};
|
|
8276
|
+
};
|
|
8277
|
+
const resolveStepIndexContext = (step, blockShowIndex) => {
|
|
8278
|
+
const enabled = step && step.showIndex != null ? !!step.showIndex : !!blockShowIndex;
|
|
8279
|
+
if (!enabled) {
|
|
8280
|
+
return {
|
|
8281
|
+
indexMap: null,
|
|
8282
|
+
indexEnabled: false
|
|
8283
|
+
};
|
|
8284
|
+
}
|
|
8285
|
+
const indexMap = buildFieldIndexMap(step, {
|
|
8286
|
+
enabled: true
|
|
8287
|
+
});
|
|
8288
|
+
return {
|
|
8289
|
+
indexMap,
|
|
8290
|
+
indexEnabled: true
|
|
8291
|
+
};
|
|
8292
|
+
};
|
|
8293
|
+
const fieldDisplayIndex = (indexMap, field) => {
|
|
8294
|
+
if (!indexMap || !field || !field.id) {
|
|
8295
|
+
return null;
|
|
8296
|
+
}
|
|
8297
|
+
const value = indexMap.get(field.id);
|
|
8298
|
+
return value == null ? null : value;
|
|
8299
|
+
};
|
|
8300
|
+
const blockHasIndexedFields = (block, indexMap) => {
|
|
8301
|
+
if (!indexMap || !block) {
|
|
8302
|
+
return false;
|
|
8303
|
+
}
|
|
8304
|
+
return (block.list || []).some(field => field && indexMap.has(field.id));
|
|
8305
|
+
};
|
|
8306
|
+
|
|
8146
8307
|
const buildLabelTips = tips => {
|
|
8147
8308
|
if (tips == null || !String(tips).trim()) {
|
|
8148
8309
|
return undefined;
|
|
@@ -8162,14 +8323,16 @@ const buildFieldLabel = field => {
|
|
|
8162
8323
|
const base = (field == null ? void 0 : field.label) != null && String(field.label).trim() ? String(field.label).trim() : (field == null ? void 0 : field.name) || '';
|
|
8163
8324
|
return base || undefined;
|
|
8164
8325
|
};
|
|
8165
|
-
|
|
8326
|
+
|
|
8327
|
+
/** displayIndex 为 1-based 连续序号 */
|
|
8328
|
+
const buildIndexedLabelRender = displayIndex => {
|
|
8166
8329
|
return ({
|
|
8167
8330
|
label
|
|
8168
8331
|
}) => {
|
|
8169
8332
|
const text = label != null ? String(label).replace(/\u200b/g, '') : '';
|
|
8170
8333
|
return /*#__PURE__*/createElement(Fragment$1, null, /*#__PURE__*/createElement('span', {
|
|
8171
8334
|
className: style['field-label-index']
|
|
8172
|
-
}, `${
|
|
8335
|
+
}, `${displayIndex}.`), text ? /*#__PURE__*/createElement('span', {
|
|
8173
8336
|
className: style['field-label-main']
|
|
8174
8337
|
}, text) : null);
|
|
8175
8338
|
};
|
|
@@ -8177,8 +8340,8 @@ const buildIndexedLabelRender = index => {
|
|
|
8177
8340
|
const renderFieldEntries = (fields = [], preview = false, {
|
|
8178
8341
|
namePrefix,
|
|
8179
8342
|
locale,
|
|
8180
|
-
|
|
8181
|
-
} = {}) => (fields || []).filter(field => !field.hidden).map(
|
|
8343
|
+
indexMap: _indexMap = null
|
|
8344
|
+
} = {}) => (fields || []).filter(field => !field.hidden).map(field => {
|
|
8182
8345
|
var _props$options;
|
|
8183
8346
|
const Component = getFieldComponent(field.type, field);
|
|
8184
8347
|
if (!Component) {
|
|
@@ -8194,12 +8357,18 @@ const renderFieldEntries = (fields = [], preview = false, {
|
|
|
8194
8357
|
}
|
|
8195
8358
|
delete props.range;
|
|
8196
8359
|
|
|
8197
|
-
// 选择组:
|
|
8198
|
-
//
|
|
8360
|
+
// 选择组:inline 仅编辑器用;props.block(块级选项)经 isBlock 透传。
|
|
8361
|
+
// form-info / react-form-plus 会吃掉布局用 block,并把 isBlock remap 为控件 block。
|
|
8362
|
+
// 未开块级选项且 inline=false 时沿用旧纵向兜底。
|
|
8199
8363
|
if (field.type === 'RadioGroup' || field.type === 'CheckboxGroup' || field.type === 'RadioGroupOther' || field.type === 'CheckboxGroupOther') {
|
|
8200
8364
|
const optionsInline = props.inline !== false;
|
|
8365
|
+
const choiceBlock = !!props.block;
|
|
8201
8366
|
delete props.inline;
|
|
8202
|
-
|
|
8367
|
+
delete props.block;
|
|
8368
|
+
if (choiceBlock) {
|
|
8369
|
+
props.isBlock = true;
|
|
8370
|
+
}
|
|
8371
|
+
if (!choiceBlock && !optionsInline) {
|
|
8203
8372
|
if (field.type === 'RadioGroup' || field.type === 'RadioGroupOther') {
|
|
8204
8373
|
props.vertical = true;
|
|
8205
8374
|
}
|
|
@@ -8213,14 +8382,16 @@ const renderFieldEntries = (fields = [], preview = false, {
|
|
|
8213
8382
|
locale
|
|
8214
8383
|
} : {};
|
|
8215
8384
|
const label = buildFieldLabel(field);
|
|
8385
|
+
const displayIndex = fieldDisplayIndex(_indexMap, field);
|
|
8216
8386
|
const element = /*#__PURE__*/createElement(Component, _extends({
|
|
8217
8387
|
key: field.id,
|
|
8218
8388
|
name: fieldName,
|
|
8219
|
-
label:
|
|
8220
|
-
},
|
|
8221
|
-
labelRender: buildIndexedLabelRender(
|
|
8389
|
+
label: displayIndex != null ? label || '\u200b' : label
|
|
8390
|
+
}, displayIndex != null ? {
|
|
8391
|
+
labelRender: buildIndexedLabelRender(displayIndex)
|
|
8222
8392
|
} : null, {
|
|
8223
8393
|
rule: field.rule || undefined,
|
|
8394
|
+
// 仅布局「占满整行」;块级选项样式走上方 isBlock,避免被 form-plus 剥掉后失效
|
|
8224
8395
|
block: field.block || undefined
|
|
8225
8396
|
}, props, localeProps, {
|
|
8226
8397
|
labelTips: buildLabelTips(field.tips),
|
|
@@ -8289,16 +8460,21 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8289
8460
|
if (!block || depth > MAX_BLOCK_DEPTH) {
|
|
8290
8461
|
return null;
|
|
8291
8462
|
}
|
|
8463
|
+
const indexCtx = resolveIndexContext(block, ctx);
|
|
8292
8464
|
const nextCtx = _extends({}, ctx, {
|
|
8293
8465
|
depth: depth + 1,
|
|
8294
|
-
asListItem: false
|
|
8466
|
+
asListItem: false,
|
|
8467
|
+
indexMap: indexCtx.indexMap,
|
|
8468
|
+
indexEnabled: indexCtx.indexEnabled
|
|
8295
8469
|
});
|
|
8296
8470
|
const fieldRenderOpts = {
|
|
8297
|
-
locale
|
|
8471
|
+
locale,
|
|
8472
|
+
indexMap: indexCtx.indexMap
|
|
8298
8473
|
};
|
|
8299
8474
|
const bordered = isMobile ? false : block.bordered || undefined;
|
|
8300
8475
|
// 仅 FormInfo/object 吃列表项 Part 样式;List 等交给 form-info nestDepth
|
|
8301
8476
|
const listItemPartProps = asListItem && isFormInfoLikeBlock(block.kind) ? nestedListItemPartProps : null;
|
|
8477
|
+
const indexClassName = blockHasIndexedFields(block, indexCtx.indexMap) ? style['form-info-show-index'] : null;
|
|
8302
8478
|
const renderChildBlocks = (blocks = [], childCtx = nextCtx) => (blocks || []).map(child => renderBlockElement(child, preview, childCtx)).filter(Boolean);
|
|
8303
8479
|
|
|
8304
8480
|
/** list.itemBlocks:object/formInfo 走 asListItem;嵌套 list 等保持 nestDepth 链路 */
|
|
@@ -8311,10 +8487,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8311
8487
|
switch (block.kind) {
|
|
8312
8488
|
case 'formInfo':
|
|
8313
8489
|
{
|
|
8314
|
-
const
|
|
8315
|
-
const entries = renderFieldEntries(block.list, preview, _extends({}, fieldRenderOpts, {
|
|
8316
|
-
showIndex
|
|
8317
|
-
}));
|
|
8490
|
+
const entries = renderFieldEntries(block.list, preview, fieldRenderOpts);
|
|
8318
8491
|
const nested = renderChildBlocks(block.blocks || [], nextCtx).map(node => withBlockLayout(node, true));
|
|
8319
8492
|
return withBlockLayout(createFieldsFormInfo(_extends({
|
|
8320
8493
|
key: block.id,
|
|
@@ -8324,7 +8497,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8324
8497
|
gap: block.gap,
|
|
8325
8498
|
bordered
|
|
8326
8499
|
}, listItemPartProps || {}, {
|
|
8327
|
-
className: resolvePartRootClassName(depth,
|
|
8500
|
+
className: resolvePartRootClassName(depth, indexClassName)
|
|
8328
8501
|
}), entries, nested, knownNames), asListItem);
|
|
8329
8502
|
}
|
|
8330
8503
|
case 'object':
|
|
@@ -8341,7 +8514,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8341
8514
|
gap: block.gap,
|
|
8342
8515
|
bordered
|
|
8343
8516
|
}, listItemPartProps || {}, {
|
|
8344
|
-
className: resolvePartRootClassName(depth)
|
|
8517
|
+
className: resolvePartRootClassName(depth, indexClassName)
|
|
8345
8518
|
}), entries, nested, knownNames), asListItem);
|
|
8346
8519
|
}
|
|
8347
8520
|
case 'list':
|
|
@@ -8354,7 +8527,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8354
8527
|
title: block.title || undefined,
|
|
8355
8528
|
important: block.important || undefined,
|
|
8356
8529
|
bordered,
|
|
8357
|
-
className: resolvePartRootClassName(depth),
|
|
8530
|
+
className: resolvePartRootClassName(depth, indexClassName),
|
|
8358
8531
|
maxLength: block.maxLength,
|
|
8359
8532
|
minLength: block.minLength
|
|
8360
8533
|
}, block.addText ? {
|
|
@@ -8380,7 +8553,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8380
8553
|
} : {}, {
|
|
8381
8554
|
list: fields
|
|
8382
8555
|
}, listItemPartProps || {}, {
|
|
8383
|
-
className: resolvePartRootClassName(depth)
|
|
8556
|
+
className: resolvePartRootClassName(depth, indexClassName)
|
|
8384
8557
|
})), asListItem);
|
|
8385
8558
|
}
|
|
8386
8559
|
case 'editableList':
|
|
@@ -8392,7 +8565,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8392
8565
|
name: block.name,
|
|
8393
8566
|
title: block.title || undefined,
|
|
8394
8567
|
bordered,
|
|
8395
|
-
className: resolvePartRootClassName(depth),
|
|
8568
|
+
className: resolvePartRootClassName(depth, indexClassName),
|
|
8396
8569
|
column: block.column,
|
|
8397
8570
|
maxLength: block.maxLength,
|
|
8398
8571
|
minLength: block.minLength
|
|
@@ -8451,7 +8624,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8451
8624
|
case 'steps':
|
|
8452
8625
|
{
|
|
8453
8626
|
const isFocusSteps = block.stepsStyle === 'focus';
|
|
8454
|
-
//
|
|
8627
|
+
// 每步独立作用域;步内嵌套子模块连续编号
|
|
8455
8628
|
const blockShowIndex = !!block.showIndex;
|
|
8456
8629
|
return withBlockLayout(/*#__PURE__*/createElement(isFocusSteps ? FocusSteps$1 : Steps, _extends({
|
|
8457
8630
|
key: block.id,
|
|
@@ -8465,14 +8638,19 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8465
8638
|
prevIcon: /*#__PURE__*/createElement(ArrowLeftOutlined),
|
|
8466
8639
|
nextIcon: /*#__PURE__*/createElement(ArrowRightOutlined),
|
|
8467
8640
|
items: (block.items || []).map(step => {
|
|
8468
|
-
const
|
|
8469
|
-
const
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8641
|
+
const stepIndexCtx = resolveStepIndexContext(step, blockShowIndex);
|
|
8642
|
+
const stepCtx = _extends({}, nextCtx, {
|
|
8643
|
+
indexMap: stepIndexCtx.indexMap,
|
|
8644
|
+
indexEnabled: stepIndexCtx.indexEnabled
|
|
8645
|
+
});
|
|
8646
|
+
const entries = renderFieldEntries(step.list, preview, {
|
|
8647
|
+
locale,
|
|
8648
|
+
indexMap: stepIndexCtx.indexMap
|
|
8649
|
+
});
|
|
8650
|
+
const nested = renderChildBlocks(step.blocks || [], stepCtx);
|
|
8473
8651
|
const fieldNames = [...(step.list || []).filter(field => field && !field.hidden && field.name).map(field => field.name), ...collectBlockFieldNames(step.blocks || [])];
|
|
8474
8652
|
const hasConditional = entries.some(entry => entry.visibleWhen);
|
|
8475
|
-
const
|
|
8653
|
+
const stepIndexClassName = stepIndexCtx.indexEnabled ? style['form-info-show-index'] : null;
|
|
8476
8654
|
if (nested.length || hasConditional) {
|
|
8477
8655
|
return {
|
|
8478
8656
|
key: step.id,
|
|
@@ -8486,7 +8664,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8486
8664
|
key: `${step.id}-fields`,
|
|
8487
8665
|
column: step.column,
|
|
8488
8666
|
gap: block.gap,
|
|
8489
|
-
className:
|
|
8667
|
+
className: stepIndexClassName
|
|
8490
8668
|
}, entries, [], knownNames) : null, ...nested)
|
|
8491
8669
|
};
|
|
8492
8670
|
}
|
|
@@ -8496,7 +8674,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8496
8674
|
column: step.column,
|
|
8497
8675
|
gap: block.gap,
|
|
8498
8676
|
list: entries.map(entry => entry.element),
|
|
8499
|
-
className:
|
|
8677
|
+
className: stepIndexClassName,
|
|
8500
8678
|
fieldNames
|
|
8501
8679
|
};
|
|
8502
8680
|
})
|
|
@@ -8513,11 +8691,16 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
8513
8691
|
renderOptionContent: option => {
|
|
8514
8692
|
const nodes = [];
|
|
8515
8693
|
if ((option.list || []).length) {
|
|
8694
|
+
const optionIndexClassName = (option.list || []).some(field => fieldDisplayIndex(indexCtx.indexMap, field) != null) ? style['form-info-show-index'] : null;
|
|
8516
8695
|
nodes.push(createFieldsFormInfo({
|
|
8517
8696
|
key: `${option.id}-fields`,
|
|
8518
8697
|
column: block.column || 2,
|
|
8519
|
-
gap: block.gap
|
|
8520
|
-
|
|
8698
|
+
gap: block.gap,
|
|
8699
|
+
className: optionIndexClassName
|
|
8700
|
+
}, renderFieldEntries(option.list, preview, {
|
|
8701
|
+
locale,
|
|
8702
|
+
indexMap: indexCtx.indexMap
|
|
8703
|
+
}), [], knownNames));
|
|
8521
8704
|
}
|
|
8522
8705
|
nodes.push(...renderChildBlocks(option.blocks || [], nextCtx));
|
|
8523
8706
|
return nodes.filter(Boolean);
|
|
@@ -10207,6 +10390,217 @@ const schemaToDataSchema = (schema, options = {}) => {
|
|
|
10207
10390
|
return root;
|
|
10208
10391
|
};
|
|
10209
10392
|
|
|
10393
|
+
const isMatrixChoiceSelected = (cellValue, optionValue) => {
|
|
10394
|
+
if (Array.isArray(cellValue)) {
|
|
10395
|
+
return cellValue.some(item => item === optionValue || item && typeof item === 'object' && (item.value === optionValue || item.id === optionValue));
|
|
10396
|
+
}
|
|
10397
|
+
if (cellValue && typeof cellValue === 'object') {
|
|
10398
|
+
return cellValue.value === optionValue || cellValue.id === optionValue;
|
|
10399
|
+
}
|
|
10400
|
+
return cellValue === optionValue;
|
|
10401
|
+
};
|
|
10402
|
+
|
|
10403
|
+
/** 只读矩阵:对齐填写态 MatrixScale 的表头 + 行列网格,而不是摊成普通字段列表 */
|
|
10404
|
+
const renderMatrixScaleContent = (block, matrixData, formatMessage, isMobile) => {
|
|
10405
|
+
const layout = block.layout === 'columns' || block.layout === 'field' ? block.layout : 'options';
|
|
10406
|
+
const fieldType = block.fieldType || 'RadioGroup';
|
|
10407
|
+
const rows = (block.rows || []).filter(row => row && row.name != null && String(row.name).trim());
|
|
10408
|
+
if (!rows.length) {
|
|
10409
|
+
return null;
|
|
10410
|
+
}
|
|
10411
|
+
const emptyText = formatMessage({
|
|
10412
|
+
id: 'schemaContentEmptyValue'
|
|
10413
|
+
});
|
|
10414
|
+
const rowTitle = block.rowTitle || '';
|
|
10415
|
+
if (layout === 'options') {
|
|
10416
|
+
const options = (block.options || []).filter(option => option && (option.value != null || option.label != null));
|
|
10417
|
+
const optionCount = Math.max(options.length, 1);
|
|
10418
|
+
const formatRowValue = rowValue => formatFieldValue({
|
|
10419
|
+
type: fieldType,
|
|
10420
|
+
props: {
|
|
10421
|
+
options: block.options || []
|
|
10422
|
+
}
|
|
10423
|
+
}, rowValue, formatMessage) || emptyText;
|
|
10424
|
+
if (isMobile || !options.length) {
|
|
10425
|
+
return /*#__PURE__*/jsx("div", {
|
|
10426
|
+
className: [style['schema-content-matrix'], style['is-mobile']].join(' '),
|
|
10427
|
+
children: rows.map(row => {
|
|
10428
|
+
const rowName = String(row.name).trim();
|
|
10429
|
+
return /*#__PURE__*/jsxs("div", {
|
|
10430
|
+
className: style['schema-content-matrix-mobile-row'],
|
|
10431
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10432
|
+
className: style['schema-content-matrix-mobile-label'],
|
|
10433
|
+
children: row.label || rowName
|
|
10434
|
+
}), /*#__PURE__*/jsx("div", {
|
|
10435
|
+
className: style['schema-content-matrix-mobile-value'],
|
|
10436
|
+
children: formatRowValue(matrixData == null ? void 0 : matrixData[rowName])
|
|
10437
|
+
})]
|
|
10438
|
+
}, rowName);
|
|
10439
|
+
})
|
|
10440
|
+
});
|
|
10441
|
+
}
|
|
10442
|
+
return /*#__PURE__*/jsx("div", {
|
|
10443
|
+
className: [style['schema-content-matrix'], style['is-choice']].join(' '),
|
|
10444
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
10445
|
+
className: style['schema-content-matrix-inner'],
|
|
10446
|
+
style: {
|
|
10447
|
+
'--matrix-scale-option-count': optionCount
|
|
10448
|
+
},
|
|
10449
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
10450
|
+
className: style['schema-content-matrix-header'],
|
|
10451
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10452
|
+
className: style['schema-content-matrix-row-title'],
|
|
10453
|
+
children: rowTitle
|
|
10454
|
+
}), options.map(option => {
|
|
10455
|
+
var _option$label;
|
|
10456
|
+
return /*#__PURE__*/jsx("div", {
|
|
10457
|
+
className: style['schema-content-matrix-option-title'],
|
|
10458
|
+
children: (_option$label = option.label) != null ? _option$label : String(option.value)
|
|
10459
|
+
}, String(option.value));
|
|
10460
|
+
})]
|
|
10461
|
+
}), rows.map(row => {
|
|
10462
|
+
const rowName = String(row.name).trim();
|
|
10463
|
+
const rowValue = matrixData == null ? void 0 : matrixData[rowName];
|
|
10464
|
+
return /*#__PURE__*/jsxs("div", {
|
|
10465
|
+
className: style['schema-content-matrix-row'],
|
|
10466
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10467
|
+
className: style['schema-content-matrix-row-label'],
|
|
10468
|
+
children: row.label || rowName
|
|
10469
|
+
}), options.map(option => {
|
|
10470
|
+
const selected = isMatrixChoiceSelected(rowValue, option.value);
|
|
10471
|
+
return /*#__PURE__*/jsx("div", {
|
|
10472
|
+
className: [style['schema-content-matrix-cell'], selected ? style['is-selected'] : null].filter(Boolean).join(' '),
|
|
10473
|
+
children: selected ? /*#__PURE__*/jsx(CheckOutlined, {}) : null
|
|
10474
|
+
}, String(option.value));
|
|
10475
|
+
})]
|
|
10476
|
+
}, rowName);
|
|
10477
|
+
})]
|
|
10478
|
+
})
|
|
10479
|
+
});
|
|
10480
|
+
}
|
|
10481
|
+
if (layout === 'columns') {
|
|
10482
|
+
const columns = (block.columns || []).filter(column => column && column.name != null && String(column.name).trim());
|
|
10483
|
+
const optionCount = Math.max(columns.length, 1);
|
|
10484
|
+
const formatCell = value => formatFieldValue({
|
|
10485
|
+
type: fieldType,
|
|
10486
|
+
props: {}
|
|
10487
|
+
}, value, formatMessage) || emptyText;
|
|
10488
|
+
if (isMobile || !columns.length) {
|
|
10489
|
+
return /*#__PURE__*/jsx("div", {
|
|
10490
|
+
className: [style['schema-content-matrix'], style['is-mobile']].join(' '),
|
|
10491
|
+
children: rows.map(row => {
|
|
10492
|
+
const rowName = String(row.name).trim();
|
|
10493
|
+
const rowData = (matrixData == null ? void 0 : matrixData[rowName]) || {};
|
|
10494
|
+
return /*#__PURE__*/jsxs("div", {
|
|
10495
|
+
className: style['schema-content-matrix-mobile-row'],
|
|
10496
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10497
|
+
className: style['schema-content-matrix-mobile-label'],
|
|
10498
|
+
children: row.label || rowName
|
|
10499
|
+
}), columns.length ? columns.map(column => {
|
|
10500
|
+
const columnName = String(column.name).trim();
|
|
10501
|
+
return /*#__PURE__*/jsxs("div", {
|
|
10502
|
+
className: style['schema-content-matrix-mobile-cell'],
|
|
10503
|
+
children: [/*#__PURE__*/jsxs("span", {
|
|
10504
|
+
className: style['schema-content-matrix-mobile-cell-label'],
|
|
10505
|
+
children: [column.label || columnName, "\uFF1A"]
|
|
10506
|
+
}), /*#__PURE__*/jsx("span", {
|
|
10507
|
+
children: formatCell(rowData == null ? void 0 : rowData[columnName])
|
|
10508
|
+
})]
|
|
10509
|
+
}, columnName);
|
|
10510
|
+
}) : null]
|
|
10511
|
+
}, rowName);
|
|
10512
|
+
})
|
|
10513
|
+
});
|
|
10514
|
+
}
|
|
10515
|
+
return /*#__PURE__*/jsx("div", {
|
|
10516
|
+
className: style['schema-content-matrix'],
|
|
10517
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
10518
|
+
className: style['schema-content-matrix-inner'],
|
|
10519
|
+
style: {
|
|
10520
|
+
'--matrix-scale-option-count': optionCount
|
|
10521
|
+
},
|
|
10522
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
10523
|
+
className: style['schema-content-matrix-header'],
|
|
10524
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10525
|
+
className: style['schema-content-matrix-row-title'],
|
|
10526
|
+
children: rowTitle
|
|
10527
|
+
}), columns.map(column => /*#__PURE__*/jsx("div", {
|
|
10528
|
+
className: style['schema-content-matrix-option-title'],
|
|
10529
|
+
children: column.label || String(column.name)
|
|
10530
|
+
}, String(column.name)))]
|
|
10531
|
+
}), rows.map(row => {
|
|
10532
|
+
const rowName = String(row.name).trim();
|
|
10533
|
+
const rowData = (matrixData == null ? void 0 : matrixData[rowName]) || {};
|
|
10534
|
+
return /*#__PURE__*/jsxs("div", {
|
|
10535
|
+
className: [style['schema-content-matrix-row'], style['is-cells']].join(' '),
|
|
10536
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10537
|
+
className: style['schema-content-matrix-row-label'],
|
|
10538
|
+
children: row.label || rowName
|
|
10539
|
+
}), columns.map(column => {
|
|
10540
|
+
const columnName = String(column.name).trim();
|
|
10541
|
+
return /*#__PURE__*/jsx("div", {
|
|
10542
|
+
className: style['schema-content-matrix-cell'],
|
|
10543
|
+
children: formatCell(rowData == null ? void 0 : rowData[columnName])
|
|
10544
|
+
}, columnName);
|
|
10545
|
+
})]
|
|
10546
|
+
}, rowName);
|
|
10547
|
+
})]
|
|
10548
|
+
})
|
|
10549
|
+
});
|
|
10550
|
+
}
|
|
10551
|
+
|
|
10552
|
+
// field:每行一个值,仍保留行标题列的矩阵观感
|
|
10553
|
+
return /*#__PURE__*/jsx("div", {
|
|
10554
|
+
className: [style['schema-content-matrix'], isMobile ? style['is-mobile'] : null].filter(Boolean).join(' '),
|
|
10555
|
+
children: isMobile ? rows.map(row => {
|
|
10556
|
+
const rowName = String(row.name).trim();
|
|
10557
|
+
const text = formatFieldValue({
|
|
10558
|
+
type: fieldType,
|
|
10559
|
+
props: {}
|
|
10560
|
+
}, matrixData == null ? void 0 : matrixData[rowName], formatMessage) || emptyText;
|
|
10561
|
+
return /*#__PURE__*/jsxs("div", {
|
|
10562
|
+
className: style['schema-content-matrix-mobile-row'],
|
|
10563
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10564
|
+
className: style['schema-content-matrix-mobile-label'],
|
|
10565
|
+
children: row.label || rowName
|
|
10566
|
+
}), /*#__PURE__*/jsx("div", {
|
|
10567
|
+
className: style['schema-content-matrix-mobile-value'],
|
|
10568
|
+
children: text
|
|
10569
|
+
})]
|
|
10570
|
+
}, rowName);
|
|
10571
|
+
}) : /*#__PURE__*/jsxs("div", {
|
|
10572
|
+
className: style['schema-content-matrix-inner'],
|
|
10573
|
+
style: {
|
|
10574
|
+
'--matrix-scale-option-count': 1
|
|
10575
|
+
},
|
|
10576
|
+
children: [rowTitle ? /*#__PURE__*/jsxs("div", {
|
|
10577
|
+
className: style['schema-content-matrix-header'],
|
|
10578
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10579
|
+
className: style['schema-content-matrix-row-title'],
|
|
10580
|
+
children: rowTitle
|
|
10581
|
+
}), /*#__PURE__*/jsx("div", {
|
|
10582
|
+
className: style['schema-content-matrix-option-title']
|
|
10583
|
+
})]
|
|
10584
|
+
}) : null, rows.map(row => {
|
|
10585
|
+
const rowName = String(row.name).trim();
|
|
10586
|
+
const text = formatFieldValue({
|
|
10587
|
+
type: fieldType,
|
|
10588
|
+
props: {}
|
|
10589
|
+
}, matrixData == null ? void 0 : matrixData[rowName], formatMessage) || emptyText;
|
|
10590
|
+
return /*#__PURE__*/jsxs("div", {
|
|
10591
|
+
className: [style['schema-content-matrix-row'], style['is-cells']].join(' '),
|
|
10592
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10593
|
+
className: style['schema-content-matrix-row-label'],
|
|
10594
|
+
children: row.label || rowName
|
|
10595
|
+
}), /*#__PURE__*/jsx("div", {
|
|
10596
|
+
className: style['schema-content-matrix-cell'],
|
|
10597
|
+
children: text
|
|
10598
|
+
})]
|
|
10599
|
+
}, rowName);
|
|
10600
|
+
})]
|
|
10601
|
+
})
|
|
10602
|
+
});
|
|
10603
|
+
};
|
|
10210
10604
|
const getByPath = (data, path) => {
|
|
10211
10605
|
if (data == null || path == null || path === '') {
|
|
10212
10606
|
return data;
|
|
@@ -10232,12 +10626,13 @@ const formatFieldValue = (field, value, formatMessage) => formatFieldDisplayValu
|
|
|
10232
10626
|
* 改为 label 在上、值在下,避免窄栏(如弹窗双栏预览)被撑乱。
|
|
10233
10627
|
*/
|
|
10234
10628
|
const renderFieldsContent = (fields, data, formatMessage, column, {
|
|
10235
|
-
|
|
10629
|
+
indexMap: _indexMap = null,
|
|
10236
10630
|
isFieldVisible
|
|
10237
10631
|
} = {}) => {
|
|
10238
|
-
const list = (fields || []).filter(field => field && !field.hidden && field.name && (!isFieldVisible || isFieldVisible(field))).map(
|
|
10632
|
+
const list = (fields || []).filter(field => field && !field.hidden && field.name && (!isFieldVisible || isFieldVisible(field))).map(field => {
|
|
10239
10633
|
const baseLabel = field.label || field.name;
|
|
10240
|
-
const
|
|
10634
|
+
const displayIndex = fieldDisplayIndex(_indexMap, field);
|
|
10635
|
+
const label = displayIndex != null ? `${displayIndex}. ${baseLabel}` : baseLabel;
|
|
10241
10636
|
return {
|
|
10242
10637
|
label,
|
|
10243
10638
|
content: formatFieldValue(field, getByPath(data, field.name), formatMessage),
|
|
@@ -10285,8 +10680,9 @@ const resolveListItemTitle = (block, item, index, formatMessage) => {
|
|
|
10285
10680
|
// ignore bad itemTitle
|
|
10286
10681
|
}
|
|
10287
10682
|
}
|
|
10288
|
-
|
|
10289
|
-
|
|
10683
|
+
// 只有列表自身没有字段、首个子块即项头时才借用其标题;否则会把「时间窗口」等子块标题误当成项标题
|
|
10684
|
+
const head = (block.list || []).length ? null : (block.itemBlocks || [])[0];
|
|
10685
|
+
if (head && (head.title || head.label)) {
|
|
10290
10686
|
return {
|
|
10291
10687
|
title: head.title || head.label,
|
|
10292
10688
|
titleFromItemBlockId: head.id
|
|
@@ -10311,8 +10707,11 @@ const renderBlock = (block, data, ctx) => {
|
|
|
10311
10707
|
if (!block || depth > MAX_BLOCK_DEPTH) {
|
|
10312
10708
|
return null;
|
|
10313
10709
|
}
|
|
10710
|
+
const indexCtx = resolveIndexContext(block, ctx);
|
|
10314
10711
|
const nextCtx = _extends({}, ctx, {
|
|
10315
|
-
depth: depth + 1
|
|
10712
|
+
depth: depth + 1,
|
|
10713
|
+
indexMap: indexCtx.indexMap,
|
|
10714
|
+
indexEnabled: indexCtx.indexEnabled
|
|
10316
10715
|
});
|
|
10317
10716
|
const bordered = isMobile ? false : block.bordered || undefined;
|
|
10318
10717
|
const partProps = {
|
|
@@ -10322,14 +10721,15 @@ const renderBlock = (block, data, ctx) => {
|
|
|
10322
10721
|
bordered,
|
|
10323
10722
|
className: depth === 0 ? InfoPage.partRootClassName : undefined
|
|
10324
10723
|
};
|
|
10724
|
+
const fieldIndexOpts = {
|
|
10725
|
+
indexMap: indexCtx.indexMap,
|
|
10726
|
+
isFieldVisible
|
|
10727
|
+
};
|
|
10325
10728
|
switch (block.kind) {
|
|
10326
10729
|
case 'formInfo':
|
|
10327
10730
|
{
|
|
10328
10731
|
return /*#__PURE__*/jsxs(InfoPage.Part, _extends({}, partProps, {
|
|
10329
|
-
children: [renderFieldsContent(block.list, data, formatMessage, block.column,
|
|
10330
|
-
showIndex: !!block.showIndex,
|
|
10331
|
-
isFieldVisible
|
|
10332
|
-
}), renderBlockList(block.blocks, data, nextCtx)]
|
|
10732
|
+
children: [renderFieldsContent(block.list, data, formatMessage, block.column, fieldIndexOpts), renderBlockList(block.blocks, data, nextCtx)]
|
|
10333
10733
|
}));
|
|
10334
10734
|
}
|
|
10335
10735
|
case 'object':
|
|
@@ -10337,9 +10737,7 @@ const renderBlock = (block, data, ctx) => {
|
|
|
10337
10737
|
const name = block.name != null && String(block.name).trim() ? String(block.name).trim() : '';
|
|
10338
10738
|
const nestedData = name ? getByPath(data, name) || {} : data;
|
|
10339
10739
|
return /*#__PURE__*/jsxs(InfoPage.Part, _extends({}, partProps, {
|
|
10340
|
-
children: [renderFieldsContent(block.list, nestedData, formatMessage, block.column,
|
|
10341
|
-
isFieldVisible
|
|
10342
|
-
}), renderBlockList(block.blocks, nestedData, nextCtx)]
|
|
10740
|
+
children: [renderFieldsContent(block.list, nestedData, formatMessage, block.column, fieldIndexOpts), renderBlockList(block.blocks, nestedData, nextCtx)]
|
|
10343
10741
|
}));
|
|
10344
10742
|
}
|
|
10345
10743
|
case 'list':
|
|
@@ -10350,20 +10748,26 @@ const renderBlock = (block, data, ctx) => {
|
|
|
10350
10748
|
const items = name ? getByPath(data, name) : null;
|
|
10351
10749
|
const rows = Array.isArray(items) ? items : [];
|
|
10352
10750
|
return /*#__PURE__*/jsx(InfoPage.Part, _extends({}, partProps, {
|
|
10353
|
-
children: rows.length ?
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10751
|
+
children: rows.length ? /*#__PURE__*/jsx("div", {
|
|
10752
|
+
className: style['schema-content-list-items'],
|
|
10753
|
+
children: rows.map((item, index) => {
|
|
10754
|
+
const {
|
|
10755
|
+
title: itemTitle,
|
|
10756
|
+
titleFromItemBlockId
|
|
10757
|
+
} = resolveListItemTitle(block, item || {}, index, formatMessage);
|
|
10758
|
+
// 标题已提到列表项头部,原 itemBlock 只剩字段:去掉边框,避免留下无标题空框
|
|
10759
|
+
const itemBlocks = supportsItemBlocks(block.kind) && titleFromItemBlockId ? (block.itemBlocks || []).map(child => child && child.id === titleFromItemBlockId ? _extends({}, child, {
|
|
10760
|
+
title: undefined,
|
|
10761
|
+
label: undefined,
|
|
10762
|
+
bordered: false
|
|
10763
|
+
}) : child) : block.itemBlocks;
|
|
10764
|
+
return /*#__PURE__*/jsxs(InfoPage.Part, {
|
|
10765
|
+
className: style['schema-content-list-item'],
|
|
10766
|
+
title: itemTitle,
|
|
10767
|
+
bordered: false,
|
|
10768
|
+
children: [renderFieldsContent(block.list, item || {}, formatMessage, 2, fieldIndexOpts), supportsItemBlocks(block.kind) ? renderBlockList(itemBlocks, item || {}, nextCtx) : null]
|
|
10769
|
+
}, `${block.id}-${index}`);
|
|
10770
|
+
})
|
|
10367
10771
|
}) : formatMessage({
|
|
10368
10772
|
id: 'schemaContentEmptyValue'
|
|
10369
10773
|
})
|
|
@@ -10398,16 +10802,88 @@ const renderBlock = (block, data, ctx) => {
|
|
|
10398
10802
|
})
|
|
10399
10803
|
}));
|
|
10400
10804
|
}
|
|
10805
|
+
case 'matrixScale':
|
|
10806
|
+
{
|
|
10807
|
+
const name = block.name != null && String(block.name).trim() ? String(block.name).trim() : '';
|
|
10808
|
+
if (!name) {
|
|
10809
|
+
return null;
|
|
10810
|
+
}
|
|
10811
|
+
const matrixData = getByPath(data, name) || {};
|
|
10812
|
+
const content = renderMatrixScaleContent(block, matrixData, formatMessage, isMobile);
|
|
10813
|
+
const title = block.title || block.label || undefined;
|
|
10814
|
+
// 矩阵表头已展示 rowTitle,Part 副标题不再重复挂它
|
|
10815
|
+
const subtitle = block.subtitle || undefined;
|
|
10816
|
+
if (!content && !title && !subtitle) {
|
|
10817
|
+
return null;
|
|
10818
|
+
}
|
|
10819
|
+
return /*#__PURE__*/jsx(InfoPage.Part, _extends({}, partProps, {
|
|
10820
|
+
title: title,
|
|
10821
|
+
subtitle: subtitle,
|
|
10822
|
+
children: content
|
|
10823
|
+
}));
|
|
10824
|
+
}
|
|
10401
10825
|
case 'steps':
|
|
10402
10826
|
{
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10827
|
+
const items = block.items || [];
|
|
10828
|
+
const total = items.length;
|
|
10829
|
+
const isFocus = block.stepsStyle === 'focus';
|
|
10830
|
+
const blockShowIndex = !!block.showIndex;
|
|
10831
|
+
return /*#__PURE__*/jsx("div", {
|
|
10832
|
+
className: style['schema-content-steps'],
|
|
10833
|
+
children: items.map((step, index) => {
|
|
10834
|
+
const stepTitle = step.title || formatMessage({
|
|
10835
|
+
id: 'untitledStep'
|
|
10836
|
+
}, {
|
|
10837
|
+
index: index + 1
|
|
10838
|
+
});
|
|
10839
|
+
const stepIndexCtx = resolveStepIndexContext(step, blockShowIndex);
|
|
10840
|
+
const stepCtx = _extends({}, nextCtx, {
|
|
10841
|
+
indexMap: stepIndexCtx.indexMap,
|
|
10842
|
+
indexEnabled: stepIndexCtx.indexEnabled
|
|
10843
|
+
});
|
|
10844
|
+
const body = /*#__PURE__*/jsxs(Fragment, {
|
|
10845
|
+
children: [renderFieldsContent(step.list, data, formatMessage, step.column || 1, {
|
|
10846
|
+
indexMap: stepIndexCtx.indexMap,
|
|
10847
|
+
isFieldVisible
|
|
10848
|
+
}), renderBlockList(step.blocks, data, stepCtx)]
|
|
10849
|
+
});
|
|
10850
|
+
if (isFocus) {
|
|
10851
|
+
return /*#__PURE__*/jsxs("section", {
|
|
10852
|
+
className: style['schema-content-step'],
|
|
10853
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
10854
|
+
className: style['steps-focus-header'],
|
|
10855
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
10856
|
+
className: style['steps-focus-meta'],
|
|
10857
|
+
children: /*#__PURE__*/jsxs("span", {
|
|
10858
|
+
className: style['steps-focus-count'],
|
|
10859
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
10860
|
+
className: style['steps-focus-count-current'],
|
|
10861
|
+
children: String(index + 1).padStart(2, '0')
|
|
10862
|
+
}), /*#__PURE__*/jsxs("span", {
|
|
10863
|
+
className: style['steps-focus-count-total'],
|
|
10864
|
+
children: ["/ ", String(total).padStart(2, '0')]
|
|
10865
|
+
})]
|
|
10866
|
+
})
|
|
10867
|
+
}), /*#__PURE__*/jsx("div", {
|
|
10868
|
+
className: style['steps-focus-title'],
|
|
10869
|
+
children: stepTitle
|
|
10870
|
+
}), step.subtitle ? /*#__PURE__*/jsx("div", {
|
|
10871
|
+
className: style['schema-content-step-subtitle'],
|
|
10872
|
+
children: step.subtitle
|
|
10873
|
+
}) : null]
|
|
10874
|
+
}), /*#__PURE__*/jsx("div", {
|
|
10875
|
+
className: style['schema-content-step-body'],
|
|
10876
|
+
children: body
|
|
10877
|
+
})]
|
|
10878
|
+
}, step.id || index);
|
|
10879
|
+
}
|
|
10880
|
+
return /*#__PURE__*/jsx(InfoPage.Part, {
|
|
10881
|
+
title: stepTitle,
|
|
10882
|
+
subtitle: step.subtitle || undefined,
|
|
10883
|
+
bordered: bordered,
|
|
10884
|
+
children: body
|
|
10885
|
+
}, step.id || index);
|
|
10886
|
+
})
|
|
10411
10887
|
}, block.id);
|
|
10412
10888
|
}
|
|
10413
10889
|
case 'choice':
|
|
@@ -10421,9 +10897,7 @@ const renderBlock = (block, data, ctx) => {
|
|
|
10421
10897
|
children: visibleOptions.map(option => /*#__PURE__*/jsxs(InfoPage.Part, {
|
|
10422
10898
|
title: option.title || undefined,
|
|
10423
10899
|
bordered: false,
|
|
10424
|
-
children: [renderFieldsContent(option.list, data, formatMessage, block.column,
|
|
10425
|
-
isFieldVisible
|
|
10426
|
-
}), renderBlockList(option.blocks, data, nextCtx)]
|
|
10900
|
+
children: [renderFieldsContent(option.list, data, formatMessage, block.column, fieldIndexOpts), renderBlockList(option.blocks, data, nextCtx)]
|
|
10427
10901
|
}, option.id))
|
|
10428
10902
|
}));
|
|
10429
10903
|
}
|