@cozeloop/components 0.0.2 → 0.0.3
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/.eslintcache +1 -0
- package/.rush/temp/shrinkwrap-deps.json +770 -0
- package/OWNERS +5 -0
- package/README.md +82 -1
- package/config/rush-project.json +8 -0
- package/dist/es/index.css +661 -0
- package/dist/es/index.js +6044 -65
- package/dist/es/static/svg/select.svg +1 -0
- package/dist/lib/base-search-select/base-search-form-select.d.ts +3 -0
- package/dist/lib/base-search-select/base-search-form-select.js +6 -0
- package/dist/lib/base-search-select/base-search-form-select.js.map +1 -0
- package/dist/lib/base-search-select/base-search-select.d.ts +9 -0
- package/dist/lib/base-search-select/base-search-select.js +127 -0
- package/dist/lib/base-search-select/base-search-select.js.map +1 -0
- package/dist/lib/base-search-select/index.d.ts +3 -0
- package/dist/lib/base-search-select/index.js +3 -0
- package/dist/lib/base-search-select/index.js.map +1 -0
- package/dist/lib/base-search-select/types.d.ts +13 -0
- package/dist/lib/base-search-select/types.js +2 -0
- package/dist/lib/base-search-select/types.js.map +1 -0
- package/dist/lib/base-search-select/utils.d.ts +8 -0
- package/dist/lib/base-search-select/utils.js +48 -0
- package/dist/lib/base-search-select/utils.js.map +1 -0
- package/dist/lib/basic-card/index.d.ts +7 -0
- package/dist/lib/basic-card/index.js +4 -0
- package/dist/lib/basic-card/index.js.map +1 -0
- package/dist/lib/card-pane/index.d.ts +5 -0
- package/dist/lib/card-pane/index.js +9 -0
- package/dist/lib/card-pane/index.js.map +1 -0
- package/dist/lib/chip-select/index.d.ts +2 -0
- package/dist/lib/chip-select/index.js +6 -0
- package/dist/lib/chip-select/index.js.map +1 -0
- package/dist/lib/code-editor/index.d.ts +3 -0
- package/dist/lib/code-editor/index.js +7 -0
- package/dist/lib/code-editor/index.js.map +1 -0
- package/dist/lib/code-usage/index.d.ts +14 -0
- package/dist/lib/code-usage/index.js +31 -0
- package/dist/lib/code-usage/index.js.map +1 -0
- package/dist/lib/codemirror-editor/code-editor.d.ts +2 -0
- package/dist/lib/codemirror-editor/code-editor.js +108 -0
- package/dist/lib/codemirror-editor/code-editor.js.map +1 -0
- package/dist/lib/codemirror-editor/index.d.ts +4 -0
- package/dist/lib/codemirror-editor/index.js +5 -0
- package/dist/lib/codemirror-editor/index.js.map +1 -0
- package/dist/lib/codemirror-editor/json-editor.d.ts +19 -0
- package/dist/lib/codemirror-editor/json-editor.js +97 -0
- package/dist/lib/codemirror-editor/json-editor.js.map +1 -0
- package/dist/lib/codemirror-editor/raw-text-editor.d.ts +11 -0
- package/dist/lib/codemirror-editor/raw-text-editor.js +32 -0
- package/dist/lib/codemirror-editor/raw-text-editor.js.map +1 -0
- package/dist/lib/codemirror-editor/text-editor.d.ts +2 -0
- package/dist/lib/codemirror-editor/text-editor.js +44 -0
- package/dist/lib/codemirror-editor/text-editor.js.map +1 -0
- package/dist/lib/codemirror-editor/themes/coze-dark.d.ts +1 -0
- package/dist/lib/codemirror-editor/themes/coze-dark.js +113 -0
- package/dist/lib/codemirror-editor/themes/coze-dark.js.map +1 -0
- package/dist/lib/codemirror-editor/themes/coze-light.d.ts +1 -0
- package/dist/lib/codemirror-editor/themes/coze-light.js +119 -0
- package/dist/lib/codemirror-editor/themes/coze-light.js.map +1 -0
- package/dist/lib/collapse-card/index.d.ts +13 -0
- package/dist/lib/collapse-card/index.js +31 -0
- package/dist/lib/collapse-card/index.js.map +1 -0
- package/dist/lib/collapsible-card/index.d.ts +13 -0
- package/dist/lib/collapsible-card/index.js +12 -78
- package/dist/lib/collapsible-card/index.js.map +1 -0
- package/dist/{types → lib}/column-manage-storage/index.d.ts +6 -6
- package/dist/lib/column-manage-storage/index.js +43 -93
- package/dist/lib/column-manage-storage/index.js.map +1 -0
- package/dist/lib/columns-select/index.d.ts +19 -0
- package/dist/lib/columns-select/index.js +73 -237
- package/dist/lib/columns-select/index.js.map +1 -0
- package/dist/lib/edit-icon-button/index.d.ts +8 -0
- package/dist/lib/edit-icon-button/index.js +13 -0
- package/dist/lib/edit-icon-button/index.js.map +1 -0
- package/dist/lib/footer-actions/index.d.ts +15 -0
- package/dist/lib/footer-actions/index.js +9 -0
- package/dist/lib/footer-actions/index.js.map +1 -0
- package/dist/{types → lib}/hooks/use-infinite-scroll.d.ts +12 -12
- package/dist/lib/hooks/use-infinite-scroll.js +130 -192
- package/dist/lib/hooks/use-infinite-scroll.js.map +1 -0
- package/dist/lib/hooks/use-mouse-down-offset.d.ts +9 -0
- package/dist/lib/hooks/use-mouse-down-offset.js +38 -64
- package/dist/lib/hooks/use-mouse-down-offset.js.map +1 -0
- package/dist/lib/hooks/use-unsave-leave-warning.d.ts +12 -0
- package/dist/lib/hooks/use-unsave-leave-warning.js +33 -0
- package/dist/lib/hooks/use-unsave-leave-warning.js.map +1 -0
- package/dist/lib/id-render/icon-button-container.d.ts +8 -0
- package/dist/lib/id-render/icon-button-container.js +7 -88
- package/dist/lib/id-render/icon-button-container.js.map +1 -0
- package/dist/lib/id-render/index.d.ts +7 -0
- package/dist/lib/id-render/index.js +20 -111
- package/dist/lib/id-render/index.js.map +1 -0
- package/dist/lib/index-controller/record-navigation.d.ts +6 -0
- package/dist/lib/index-controller/record-navigation.js +9 -0
- package/dist/lib/index-controller/record-navigation.js.map +1 -0
- package/dist/lib/index-controller/use-item-index-controller.d.ts +47 -0
- package/dist/lib/index-controller/use-item-index-controller.js +123 -0
- package/dist/lib/index-controller/use-item-index-controller.js.map +1 -0
- package/dist/lib/index.d.ts +70 -0
- package/dist/lib/index.js +76 -110
- package/dist/lib/index.js.map +1 -0
- package/dist/{types → lib}/infinite-scroll-table/index.d.ts +6 -6
- package/dist/lib/infinite-scroll-table/index.js +31 -123
- package/dist/lib/infinite-scroll-table/index.js.map +1 -0
- package/dist/lib/info-tooltip/index.d.ts +9 -0
- package/dist/lib/info-tooltip/index.js +9 -0
- package/dist/lib/info-tooltip/index.js.map +1 -0
- package/dist/lib/input-components/radio-button.d.ts +14 -0
- package/dist/lib/input-components/radio-button.js +21 -0
- package/dist/lib/input-components/radio-button.js.map +1 -0
- package/dist/lib/input-slider/index.d.ts +15 -0
- package/dist/lib/input-slider/index.js +73 -146
- package/dist/lib/input-slider/index.js.map +1 -0
- package/dist/lib/input-with-count/index.d.ts +2 -0
- package/dist/lib/input-with-count/index.js +7 -0
- package/dist/lib/input-with-count/index.js.map +1 -0
- package/dist/lib/jump-button/jump-icon-button.d.ts +4 -0
- package/dist/lib/jump-button/jump-icon-button.js +7 -0
- package/dist/lib/jump-button/jump-icon-button.js.map +1 -0
- package/dist/{types → lib}/large-txt-render/index.d.ts +2 -2
- package/dist/lib/large-txt-render/index.js +24 -60
- package/dist/lib/large-txt-render/index.js.map +1 -0
- package/dist/lib/layout/content.d.ts +7 -0
- package/dist/lib/layout/content.js +5 -0
- package/dist/lib/layout/content.js.map +1 -0
- package/dist/lib/layout/header.d.ts +7 -0
- package/dist/lib/layout/header.js +6 -0
- package/dist/lib/layout/header.js.map +1 -0
- package/dist/lib/layout/index.d.ts +12 -0
- package/dist/lib/layout/index.js +9 -0
- package/dist/lib/layout/index.js.map +1 -0
- package/dist/lib/layout/tabs.d.ts +6 -0
- package/dist/lib/layout/tabs.js +10 -0
- package/dist/lib/layout/tabs.js.map +1 -0
- package/dist/lib/lazy-load-component/index.d.ts +5 -0
- package/dist/lib/lazy-load-component/index.js +42 -0
- package/dist/lib/lazy-load-component/index.js.map +1 -0
- package/dist/lib/logic-editor/index.d.ts +3 -0
- package/dist/lib/logic-editor/index.js +3 -0
- package/dist/lib/logic-editor/index.js.map +1 -0
- package/dist/lib/logic-editor/logic-editor.d.ts +17 -0
- package/dist/lib/logic-editor/logic-editor.js +69 -0
- package/dist/lib/logic-editor/logic-editor.js.map +1 -0
- package/dist/lib/logic-editor/logic-left-render.d.ts +3 -0
- package/dist/lib/logic-editor/logic-left-render.js +60 -0
- package/dist/lib/logic-editor/logic-left-render.js.map +1 -0
- package/dist/lib/logic-editor/logic-operator-render.d.ts +3 -0
- package/dist/lib/logic-editor/logic-operator-render.js +29 -0
- package/dist/lib/logic-editor/logic-operator-render.js.map +1 -0
- package/dist/lib/logic-editor/logic-right-render.d.ts +3 -0
- package/dist/lib/logic-editor/logic-right-render.js +25 -0
- package/dist/lib/logic-editor/logic-right-render.js.map +1 -0
- package/dist/lib/logic-editor/logic-types.d.ts +49 -0
- package/dist/lib/logic-editor/logic-types.js +136 -0
- package/dist/lib/logic-editor/logic-types.js.map +1 -0
- package/dist/lib/logic-editor/utils.d.ts +2 -0
- package/dist/lib/logic-editor/utils.js +18 -0
- package/dist/lib/logic-editor/utils.js.map +1 -0
- package/dist/lib/logic-expr/consts.d.ts +2 -0
- package/dist/lib/logic-expr/consts.js +5 -0
- package/dist/lib/logic-expr/consts.js.map +1 -0
- package/dist/lib/logic-expr/expr-group-render.d.ts +2 -0
- package/dist/lib/logic-expr/expr-group-render.js +61 -0
- package/dist/lib/logic-expr/expr-group-render.js.map +1 -0
- package/dist/lib/logic-expr/expr-render.d.ts +2 -0
- package/dist/lib/logic-expr/expr-render.js +85 -0
- package/dist/lib/logic-expr/expr-render.js.map +1 -0
- package/dist/lib/logic-expr/index.d.ts +2 -0
- package/dist/lib/logic-expr/index.js +2 -0
- package/dist/lib/logic-expr/index.js.map +1 -0
- package/dist/lib/logic-expr/logic-expr.d.ts +2 -0
- package/dist/lib/logic-expr/logic-expr.js +187 -0
- package/dist/lib/logic-expr/logic-expr.js.map +1 -0
- package/dist/lib/logic-expr/logic-not.d.ts +10 -0
- package/dist/lib/logic-expr/logic-not.js +21 -0
- package/dist/lib/logic-expr/logic-not.js.map +1 -0
- package/dist/lib/logic-expr/logic-toggle.d.ts +12 -0
- package/dist/lib/logic-expr/logic-toggle.js +33 -0
- package/dist/lib/logic-expr/logic-toggle.js.map +1 -0
- package/dist/lib/logic-expr/types.d.ts +79 -0
- package/dist/lib/logic-expr/types.js +2 -0
- package/dist/lib/logic-expr/types.js.map +1 -0
- package/dist/lib/loop-radio-group/index.d.ts +2 -0
- package/dist/lib/loop-radio-group/index.js +7 -0
- package/dist/lib/loop-radio-group/index.js.map +1 -0
- package/dist/lib/multi-part-editor/components/image-item-renderer.d.ts +14 -0
- package/dist/lib/multi-part-editor/components/image-item-renderer.js +57 -0
- package/dist/lib/multi-part-editor/components/image-item-renderer.js.map +1 -0
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.d.ts +10 -0
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js +25 -0
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js.map +1 -0
- package/dist/lib/multi-part-editor/components/url-input-modal.d.ts +14 -0
- package/dist/lib/multi-part-editor/components/url-input-modal.js +150 -0
- package/dist/lib/multi-part-editor/components/url-input-modal.js.map +1 -0
- package/dist/lib/multi-part-editor/components/video-item-renderer.d.ts +14 -0
- package/dist/lib/multi-part-editor/components/video-item-renderer.js +57 -0
- package/dist/lib/multi-part-editor/components/video-item-renderer.js.map +1 -0
- package/dist/lib/multi-part-editor/index.d.ts +3 -0
- package/dist/lib/multi-part-editor/index.js +300 -0
- package/dist/lib/multi-part-editor/index.js.map +1 -0
- package/dist/lib/multi-part-editor/multi-part-render.d.ts +10 -0
- package/dist/lib/multi-part-editor/multi-part-render.js +40 -0
- package/dist/lib/multi-part-editor/multi-part-render.js.map +1 -0
- package/dist/lib/multi-part-editor/type.d.ts +81 -0
- package/dist/lib/multi-part-editor/type.js +25 -0
- package/dist/lib/multi-part-editor/type.js.map +1 -0
- package/dist/lib/multi-part-editor/upload-button.d.ts +23 -0
- package/dist/lib/multi-part-editor/upload-button.js +103 -0
- package/dist/lib/multi-part-editor/upload-button.js.map +1 -0
- package/dist/lib/multi-part-editor/utils.d.ts +16 -0
- package/dist/lib/multi-part-editor/utils.js +43 -0
- package/dist/lib/multi-part-editor/utils.js.map +1 -0
- package/dist/lib/open-detail-button/index.d.ts +6 -0
- package/dist/lib/open-detail-button/index.js +11 -0
- package/dist/lib/open-detail-button/index.js.map +1 -0
- package/dist/lib/page-content/index.d.ts +20 -0
- package/dist/lib/page-content/index.js +17 -130
- package/dist/lib/page-content/index.js.map +1 -0
- package/dist/lib/primary-page/index.d.ts +1 -0
- package/dist/lib/primary-page/index.js +2 -28
- package/dist/lib/primary-page/index.js.map +1 -0
- package/dist/lib/primary-page/primary-header.d.ts +13 -0
- package/dist/lib/primary-page/primary-header.js +4 -72
- package/dist/lib/primary-page/primary-header.js.map +1 -0
- package/dist/lib/primary-title/index.d.ts +6 -0
- package/dist/lib/primary-title/index.js +8 -0
- package/dist/lib/primary-title/index.js.map +1 -0
- package/dist/lib/provider/index.d.ts +18 -0
- package/dist/lib/provider/index.js +43 -0
- package/dist/lib/provider/index.js.map +1 -0
- package/dist/lib/resizable-side-sheet/index.d.ts +10 -0
- package/dist/lib/resizable-side-sheet/index.js +32 -0
- package/dist/lib/resizable-side-sheet/index.js.map +1 -0
- package/dist/{types → lib}/resize-sidesheet/index.d.ts +4 -3
- package/dist/lib/resize-sidesheet/index.js +15 -129
- package/dist/lib/resize-sidesheet/index.js.map +1 -0
- package/dist/lib/resize-sidesheet/use-drag.d.ts +11 -0
- package/dist/lib/resize-sidesheet/use-drag.js +26 -51
- package/dist/lib/resize-sidesheet/use-drag.js.map +1 -0
- package/dist/lib/schema-editor/index.d.ts +11 -0
- package/dist/lib/schema-editor/index.js +5 -0
- package/dist/lib/schema-editor/index.js.map +1 -0
- package/dist/lib/search-form/index.d.ts +15 -0
- package/dist/lib/search-form/index.js +77 -0
- package/dist/lib/search-form/index.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js +19 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js +39 -0
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/base-input.d.ts +8 -0
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js +32 -0
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/description-field.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js +13 -0
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/error-list.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js +14 -0
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/field-error.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js +16 -0
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/field.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/tmpls/field.js +21 -0
- package/dist/lib/semi-schema-form/components/tmpls/field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.d.ts +11 -0
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js +29 -0
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/index.d.ts +2 -0
- package/dist/lib/semi-schema-form/components/tmpls/index.js +31 -0
- package/dist/lib/semi-schema-form/components/tmpls/index.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/object-field.d.ts +8 -0
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js +81 -0
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/submit.d.ts +4 -0
- package/dist/lib/semi-schema-form/components/tmpls/submit.js +13 -0
- package/dist/lib/semi-schema-form/components/tmpls/submit.js.map +1 -0
- package/dist/lib/semi-schema-form/components/tmpls/title-field.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js +12 -0
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/checkbox.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js +26 -0
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js +27 -0
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/index.d.ts +2 -0
- package/dist/lib/semi-schema-form/components/widgets/index.js +15 -0
- package/dist/lib/semi-schema-form/components/widgets/index.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/radio.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/radio.js +27 -0
- package/dist/lib/semi-schema-form/components/widgets/radio.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/range.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/range.js +26 -0
- package/dist/lib/semi-schema-form/components/widgets/range.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/select.d.ts +7 -0
- package/dist/lib/semi-schema-form/components/widgets/select.js +44 -0
- package/dist/lib/semi-schema-form/components/widgets/select.js.map +1 -0
- package/dist/lib/semi-schema-form/components/widgets/textarea.d.ts +6 -0
- package/dist/lib/semi-schema-form/components/widgets/textarea.js +18 -0
- package/dist/lib/semi-schema-form/components/widgets/textarea.js.map +1 -0
- package/dist/lib/semi-schema-form/index.d.ts +4 -0
- package/dist/lib/semi-schema-form/index.js +9 -0
- package/dist/lib/semi-schema-form/index.js.map +1 -0
- package/dist/lib/sentinel-form/enum.d.ts +8 -0
- package/dist/lib/sentinel-form/enum.js +15 -0
- package/dist/lib/sentinel-form/enum.js.map +1 -0
- package/dist/lib/sentinel-form/index.d.ts +20 -0
- package/dist/lib/sentinel-form/index.js +289 -0
- package/dist/lib/sentinel-form/index.js.map +1 -0
- package/dist/lib/step-nav/index.d.ts +12 -0
- package/dist/lib/step-nav/index.js +13 -0
- package/dist/lib/step-nav/index.js.map +1 -0
- package/dist/{types → lib}/table/index.d.ts +1 -1
- package/dist/lib/table/index.js +6 -88
- package/dist/lib/table/index.js.map +1 -0
- package/dist/lib/table/sort-icon.d.ts +8 -0
- package/dist/lib/table/sort-icon.js +25 -132
- package/dist/lib/table/sort-icon.js.map +1 -0
- package/dist/lib/table/table-with-pagination.d.ts +21 -0
- package/dist/lib/table/table-with-pagination.js +71 -143
- package/dist/lib/table/table-with-pagination.js.map +1 -0
- package/dist/lib/table/table-without-pagniation.d.ts +6 -0
- package/dist/lib/table/table-without-pagniation.js +36 -107
- package/dist/lib/table/table-without-pagniation.js.map +1 -0
- package/dist/lib/table-batch-operate/table-batch-operation.d.ts +9 -0
- package/dist/lib/table-batch-operate/table-batch-operation.js +14 -0
- package/dist/lib/table-batch-operate/table-batch-operation.js.map +1 -0
- package/dist/lib/table-batch-operate/use-batch-operate.d.ts +30 -0
- package/dist/lib/table-batch-operate/use-batch-operate.js +71 -0
- package/dist/lib/table-batch-operate/use-batch-operate.js.map +1 -0
- package/dist/lib/table-col-actions/index.d.ts +22 -0
- package/dist/lib/table-col-actions/index.js +34 -122
- package/dist/lib/table-col-actions/index.js.map +1 -0
- package/dist/lib/table-cols-config/index.d.ts +11 -0
- package/dist/lib/table-cols-config/index.js +57 -0
- package/dist/lib/table-cols-config/index.js.map +1 -0
- package/dist/lib/table-cols-config/type.d.ts +6 -0
- package/dist/lib/table-cols-config/type.js +2 -0
- package/dist/lib/table-cols-config/type.js.map +1 -0
- package/dist/lib/table-cols-config/use-hidden-col-keys.d.ts +5 -0
- package/dist/lib/table-cols-config/use-hidden-col-keys.js +32 -0
- package/dist/lib/table-cols-config/use-hidden-col-keys.js.map +1 -0
- package/dist/lib/table-cols-config/util.d.ts +3 -0
- package/dist/lib/table-cols-config/util.js +39 -0
- package/dist/lib/table-cols-config/util.js.map +1 -0
- package/dist/lib/table-empty/index.d.ts +2 -0
- package/dist/lib/table-empty/index.js +10 -0
- package/dist/lib/table-empty/index.js.map +1 -0
- package/dist/lib/table-header/index.d.ts +14 -0
- package/dist/lib/table-header/index.js +10 -95
- package/dist/lib/table-header/index.js.map +1 -0
- package/dist/{types → lib}/tabs/index.d.ts +1 -1
- package/dist/lib/tabs/index.js +9 -74
- package/dist/lib/tabs/index.js.map +1 -0
- package/dist/lib/text-area-pro/index.d.ts +6 -0
- package/dist/lib/text-area-pro/index.js +10 -0
- package/dist/lib/text-area-pro/index.js.map +1 -0
- package/dist/lib/text-with-copy/index.d.ts +14 -0
- package/dist/lib/text-with-copy/index.js +23 -104
- package/dist/lib/text-with-copy/index.js.map +1 -0
- package/dist/lib/title-with-sub/index.d.ts +7 -0
- package/dist/lib/title-with-sub/index.js +6 -0
- package/dist/lib/title-with-sub/index.js.map +1 -0
- package/dist/lib/tooltip-when-disabled/index.d.ts +6 -0
- package/dist/lib/tooltip-when-disabled/index.js +9 -0
- package/dist/lib/tooltip-when-disabled/index.js.map +1 -0
- package/dist/lib/tooltip-with-disabled/index.d.ts +5 -0
- package/dist/lib/tooltip-with-disabled/index.js +7 -69
- package/dist/lib/tooltip-with-disabled/index.js.map +1 -0
- package/dist/lib/tsconfig.build.tsbuildinfo +1 -0
- package/dist/lib/upload/index.d.ts +9 -0
- package/dist/lib/upload/index.js +25 -0
- package/dist/lib/upload/index.js.map +1 -0
- package/dist/lib/user-profile/index.d.ts +9 -0
- package/dist/lib/user-profile/index.js +21 -0
- package/dist/lib/user-profile/index.js.map +1 -0
- package/dist/lib/utils/basic.d.ts +2 -0
- package/dist/lib/utils/basic.js +27 -76
- package/dist/lib/utils/basic.js.map +1 -0
- package/dist/lib/version-list/version-descriptions.d.ts +15 -0
- package/dist/lib/version-list/version-descriptions.js +14 -0
- package/dist/lib/version-list/version-descriptions.js.map +1 -0
- package/dist/lib/version-list/version-item.d.ts +9 -0
- package/dist/lib/version-list/version-item.js +6 -0
- package/dist/lib/version-list/version-item.js.map +1 -0
- package/dist/lib/version-list/version-list.d.ts +11 -0
- package/dist/lib/version-list/version-list.js +11 -0
- package/dist/lib/version-list/version-list.js.map +1 -0
- package/dist/lib/version-list/version-switch-panel.d.ts +5 -0
- package/dist/lib/version-list/version-switch-panel.js +10 -0
- package/dist/lib/version-list/version-switch-panel.js.map +1 -0
- package/eslint.config.js +7 -0
- package/package.json +29 -25
- package/rslib.config.js +7 -0
- package/script/publish.js +146 -0
- package/src/base-search-select/base-search-form-select.tsx +10 -0
- package/src/base-search-select/base-search-select.tsx +200 -0
- package/src/base-search-select/index.module.less +16 -0
- package/src/base-search-select/index.tsx +3 -0
- package/src/base-search-select/types.ts +16 -0
- package/src/base-search-select/utils.ts +78 -0
- package/src/basic-card/index.tsx +23 -0
- package/src/card-pane/index.module.less +14 -0
- package/src/card-pane/index.tsx +25 -0
- package/src/chip-select/index.module.less +17 -0
- package/src/chip-select/index.tsx +7 -0
- package/src/code-editor/index.tsx +9 -0
- package/src/code-usage/code-item.module.less +32 -0
- package/src/code-usage/index.tsx +91 -0
- package/src/codemirror-editor/code-editor.tsx +139 -0
- package/src/codemirror-editor/index.ts +4 -0
- package/src/codemirror-editor/json-editor.tsx +183 -0
- package/src/codemirror-editor/raw-text-editor.tsx +68 -0
- package/src/codemirror-editor/text-editor.tsx +58 -0
- package/src/codemirror-editor/themes/coze-dark.ts +116 -0
- package/src/codemirror-editor/themes/coze-light.ts +122 -0
- package/src/collapse-card/index.module.less +27 -0
- package/src/collapse-card/index.tsx +93 -0
- package/src/collapsible-card/index.module.less +63 -0
- package/src/collapsible-card/index.tsx +57 -0
- package/src/column-manage-storage/index.tsx +64 -0
- package/src/columns-select/index.tsx +244 -0
- package/src/edit-icon-button/index.tsx +36 -0
- package/src/footer-actions/index.tsx +33 -0
- package/src/hooks/use-infinite-scroll.ts +183 -0
- package/src/hooks/use-mouse-down-offset.ts +50 -0
- package/src/hooks/use-unsave-leave-warning.ts +49 -0
- package/src/id-render/icon-button-container.tsx +37 -0
- package/src/id-render/index.tsx +64 -0
- package/src/index-controller/record-navigation.tsx +57 -0
- package/src/index-controller/use-item-index-controller.ts +197 -0
- package/src/index.ts +208 -0
- package/src/infinite-scroll-table/index.tsx +99 -0
- package/src/info-tooltip/index.tsx +41 -0
- package/src/input-components/radio-button.tsx +63 -0
- package/src/input-slider/index.module.less +30 -0
- package/src/input-slider/index.tsx +161 -0
- package/src/input-with-count/index.tsx +31 -0
- package/src/jump-button/jump-icon-button.tsx +12 -0
- package/src/large-txt-render/index.tsx +46 -0
- package/src/layout/content.tsx +28 -0
- package/src/layout/header.tsx +15 -0
- package/src/layout/index.module.less +28 -0
- package/src/layout/index.tsx +9 -0
- package/src/layout/tabs.tsx +11 -0
- package/src/lazy-load-component/index.tsx +55 -0
- package/src/logic-editor/index.ts +3 -0
- package/src/logic-editor/logic-editor.module.less +13 -0
- package/src/logic-editor/logic-editor.tsx +200 -0
- package/src/logic-editor/logic-left-render.tsx +100 -0
- package/src/logic-editor/logic-operator-render.tsx +54 -0
- package/src/logic-editor/logic-right-render.tsx +51 -0
- package/src/logic-editor/logic-types.tsx +238 -0
- package/src/logic-editor/utils.ts +22 -0
- package/src/logic-expr/assets/select.svg +1 -0
- package/src/logic-expr/consts.ts +6 -0
- package/src/logic-expr/expr-group-render.tsx +238 -0
- package/src/logic-expr/expr-render.tsx +226 -0
- package/src/logic-expr/index.module.less +252 -0
- package/src/logic-expr/index.ts +13 -0
- package/src/logic-expr/logic-expr.tsx +261 -0
- package/src/logic-expr/logic-not.tsx +46 -0
- package/src/logic-expr/logic-toggle.tsx +96 -0
- package/src/logic-expr/types.ts +95 -0
- package/src/loop-radio-group/index.tsx +16 -0
- package/src/multi-part-editor/components/image-item-renderer.tsx +134 -0
- package/src/multi-part-editor/components/index.module.less +21 -0
- package/src/multi-part-editor/components/multipart-item-renderer.tsx +74 -0
- package/src/multi-part-editor/components/url-input-modal.tsx +317 -0
- package/src/multi-part-editor/components/video-item-renderer.tsx +145 -0
- package/src/multi-part-editor/index.module.less +8 -0
- package/src/multi-part-editor/index.tsx +571 -0
- package/src/multi-part-editor/multi-part-render.tsx +87 -0
- package/src/multi-part-editor/type.tsx +103 -0
- package/src/multi-part-editor/upload-button.tsx +256 -0
- package/src/multi-part-editor/utils.ts +64 -0
- package/src/open-detail-button/index.tsx +30 -0
- package/src/page-content/index.tsx +99 -0
- package/src/primary-page/index.tsx +1 -0
- package/src/primary-page/primary-header.tsx +64 -0
- package/src/primary-title/index.module.less +14 -0
- package/src/primary-title/index.tsx +18 -0
- package/src/provider/index.tsx +89 -0
- package/src/resizable-side-sheet/index.tsx +69 -0
- package/src/resize-sidesheet/index.module.less +14 -0
- package/src/resize-sidesheet/index.tsx +68 -0
- package/src/resize-sidesheet/use-drag.ts +43 -0
- package/src/schema-editor/index.tsx +52 -0
- package/src/search-form/index.tsx +134 -0
- package/src/semi-schema-form/components/tmpls/array-field-item.tsx +97 -0
- package/src/semi-schema-form/components/tmpls/array-field.tsx +127 -0
- package/src/semi-schema-form/components/tmpls/base-input.tsx +126 -0
- package/src/semi-schema-form/components/tmpls/description-field.tsx +23 -0
- package/src/semi-schema-form/components/tmpls/error-list.tsx +44 -0
- package/src/semi-schema-form/components/tmpls/field-error.tsx +33 -0
- package/src/semi-schema-form/components/tmpls/field.tsx +54 -0
- package/src/semi-schema-form/components/tmpls/icon-button.tsx +112 -0
- package/src/semi-schema-form/components/tmpls/index.ts +39 -0
- package/src/semi-schema-form/components/tmpls/object-field.tsx +173 -0
- package/src/semi-schema-form/components/tmpls/submit.tsx +31 -0
- package/src/semi-schema-form/components/tmpls/title-field.tsx +30 -0
- package/src/semi-schema-form/components/widgets/checkbox.tsx +67 -0
- package/src/semi-schema-form/components/widgets/checkboxs.tsx +100 -0
- package/src/semi-schema-form/components/widgets/index.ts +17 -0
- package/src/semi-schema-form/components/widgets/radio.tsx +105 -0
- package/src/semi-schema-form/components/widgets/range.tsx +73 -0
- package/src/semi-schema-form/components/widgets/select.tsx +108 -0
- package/src/semi-schema-form/components/widgets/textarea.tsx +63 -0
- package/src/semi-schema-form/index.tsx +14 -0
- package/src/sentinel-form/enum.ts +16 -0
- package/src/sentinel-form/index.tsx +382 -0
- package/src/step-nav/index.module.less +45 -0
- package/src/step-nav/index.tsx +53 -0
- package/src/table/index.module.less +144 -0
- package/src/table/index.tsx +18 -0
- package/src/table/sort-icon.tsx +73 -0
- package/src/table/table-with-pagination.tsx +150 -0
- package/src/table/table-without-pagniation.tsx +66 -0
- package/src/table-batch-operate/table-batch-operation.tsx +47 -0
- package/src/table-batch-operate/use-batch-operate.ts +111 -0
- package/src/table-col-actions/index.module.less +8 -0
- package/src/table-col-actions/index.tsx +149 -0
- package/src/table-cols-config/index.module.less +34 -0
- package/src/table-cols-config/index.tsx +171 -0
- package/src/table-cols-config/type.ts +12 -0
- package/src/table-cols-config/use-hidden-col-keys.ts +53 -0
- package/src/table-cols-config/util.ts +56 -0
- package/src/table-empty/index.tsx +23 -0
- package/src/table-header/index.module.less +7 -0
- package/src/table-header/index.tsx +70 -0
- package/src/tabs/index.module.less +48 -0
- package/src/tabs/index.tsx +9 -0
- package/src/text-area-pro/index.module.less +5 -0
- package/src/text-area-pro/index.tsx +49 -0
- package/src/text-with-copy/index.tsx +95 -0
- package/src/title-with-sub/index.tsx +27 -0
- package/src/tooltip-when-disabled/index.tsx +23 -0
- package/src/tooltip-with-disabled/index.tsx +17 -0
- package/src/types.d.ts +24 -0
- package/src/upload/index.ts +39 -0
- package/src/user-profile/index.tsx +49 -0
- package/src/utils/basic.ts +29 -0
- package/src/version-list/index.module.less +16 -0
- package/src/version-list/version-descriptions.tsx +80 -0
- package/src/version-list/version-item.tsx +30 -0
- package/src/version-list/version-list.tsx +59 -0
- package/src/version-list/version-switch-panel.tsx +31 -0
- package/tailwind.config.ts +6 -0
- package/tsconfig.build.json +44 -0
- package/tsconfig.json +17 -0
- package/tsconfig.misc.json +28 -0
- package/vitest.config.mts +7 -0
- package/dist/es/collapsible-card/index.js +0 -45
- package/dist/es/collapsible-card/index.module.js +0 -5
- package/dist/es/collapsible-card/index_module.css +0 -48
- package/dist/es/column-manage-storage/index.js +0 -73
- package/dist/es/columns-select/index.js +0 -219
- package/dist/es/hooks/use-infinite-scroll.js +0 -178
- package/dist/es/hooks/use-mouse-down-offset.js +0 -41
- package/dist/es/id-render/icon-button-container.js +0 -61
- package/dist/es/id-render/index.js +0 -78
- package/dist/es/infinite-scroll-table/index.js +0 -98
- package/dist/es/input-slider/index.js +0 -123
- package/dist/es/input-slider/index.module.js +0 -5
- package/dist/es/input-slider/index_module.css +0 -21
- package/dist/es/large-txt-render/index.js +0 -38
- package/dist/es/page-content/index.js +0 -108
- package/dist/es/primary-page/index.js +0 -4
- package/dist/es/primary-page/primary-header.js +0 -38
- package/dist/es/resize-sidesheet/index.js +0 -100
- package/dist/es/resize-sidesheet/index.module.js +0 -5
- package/dist/es/resize-sidesheet/index_module.css +0 -9
- package/dist/es/resize-sidesheet/use-drag.js +0 -31
- package/dist/es/table/index.js +0 -56
- package/dist/es/table/index.module.js +0 -5
- package/dist/es/table/index_module.css +0 -90
- package/dist/es/table/sort-icon.js +0 -105
- package/dist/es/table/table-with-pagination.js +0 -112
- package/dist/es/table/table-without-pagniation.js +0 -74
- package/dist/es/table-col-actions/index.js +0 -103
- package/dist/es/table-header/index.js +0 -68
- package/dist/es/table-header/index.module.js +0 -5
- package/dist/es/table-header/index_module.css +0 -3
- package/dist/es/tabs/index.js +0 -42
- package/dist/es/tabs/index.module.js +0 -5
- package/dist/es/tabs/index_module.css +0 -37
- package/dist/es/text-with-copy/index.js +0 -71
- package/dist/es/tooltip-with-disabled/index.js +0 -49
- package/dist/es/utils/basic.js +0 -44
- package/dist/es/utils/rect.js +0 -37
- package/dist/lib/collapsible-card/index.module.js +0 -25
- package/dist/lib/collapsible-card/index_module.css +0 -48
- package/dist/lib/input-slider/index.module.js +0 -25
- package/dist/lib/input-slider/index_module.css +0 -21
- package/dist/lib/resize-sidesheet/index.module.js +0 -25
- package/dist/lib/resize-sidesheet/index_module.css +0 -9
- package/dist/lib/table/index.module.js +0 -25
- package/dist/lib/table/index_module.css +0 -90
- package/dist/lib/table-header/index.module.js +0 -25
- package/dist/lib/table-header/index_module.css +0 -3
- package/dist/lib/tabs/index.module.js +0 -25
- package/dist/lib/tabs/index_module.css +0 -37
- package/dist/lib/utils/rect.js +0 -65
- package/dist/types/collapsible-card/index.d.ts +0 -22
- package/dist/types/columns-select/index.d.ts +0 -29
- package/dist/types/hooks/use-mouse-down-offset.d.ts +0 -9
- package/dist/types/id-render/icon-button-container.d.ts +0 -12
- package/dist/types/id-render/index.d.ts +0 -13
- package/dist/types/index.d.ts +0 -19
- package/dist/types/input-slider/index.d.ts +0 -14
- package/dist/types/page-content/index.d.ts +0 -36
- package/dist/types/primary-page/index.d.ts +0 -1
- package/dist/types/primary-page/primary-header.d.ts +0 -17
- package/dist/types/resize-sidesheet/use-drag.d.ts +0 -10
- package/dist/types/table/sort-icon.d.ts +0 -13
- package/dist/types/table/table-with-pagination.d.ts +0 -14
- package/dist/types/table/table-without-pagniation.d.ts +0 -8
- package/dist/types/table-col-actions/index.d.ts +0 -21
- package/dist/types/table-header/index.d.ts +0 -20
- package/dist/types/text-with-copy/index.d.ts +0 -24
- package/dist/types/tooltip-with-disabled/index.d.ts +0 -9
- package/dist/types/utils/basic.d.ts +0 -1
- package/dist/types/utils/rect.d.ts +0 -10
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
/* eslint-disable max-lines-per-function */
|
|
3
|
+
/* eslint-disable security/detect-object-injection */
|
|
4
|
+
/* eslint-disable @coze-arch/max-line-per-function -- 监控逻辑较多,函数较长,后续可拆分 */
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-explicit-any -- 表单组件需要处理任意类型的表单数据与第三方库接口 */
|
|
6
|
+
import {
|
|
7
|
+
forwardRef,
|
|
8
|
+
useCallback,
|
|
9
|
+
useImperativeHandle,
|
|
10
|
+
useMemo,
|
|
11
|
+
useRef,
|
|
12
|
+
useState,
|
|
13
|
+
useEffect,
|
|
14
|
+
} from 'react';
|
|
15
|
+
import type { Ref } from 'react';
|
|
16
|
+
|
|
17
|
+
import { nanoid } from 'nanoid';
|
|
18
|
+
import { debounce } from 'lodash-es';
|
|
19
|
+
import dayjs from 'dayjs';
|
|
20
|
+
import { useDebounceFn } from 'ahooks';
|
|
21
|
+
import { type BaseFormProps, Form, type FormApi } from '@coze-arch/coze-design';
|
|
22
|
+
|
|
23
|
+
import { useReportEvent } from '../provider';
|
|
24
|
+
import { EventNames } from './enum';
|
|
25
|
+
|
|
26
|
+
export interface SentinelFormProps<T extends Record<string, any>>
|
|
27
|
+
extends BaseFormProps<any> {
|
|
28
|
+
/**
|
|
29
|
+
* 表单ID,用于快速定位该表单的用户,命名规范:[业务模块]-[业务名称]-[表单名称]
|
|
30
|
+
* 示例:数据引擎-AIDP-表单创建
|
|
31
|
+
*/
|
|
32
|
+
formID: string;
|
|
33
|
+
// 用 T 强化对外体验,内部传递给实际 Form 时再做浅断言
|
|
34
|
+
onSubmit?: (values: T, e?: React.FormEvent<HTMLFormElement>) => void;
|
|
35
|
+
onValueChange?: (values: T, changed: Partial<T>) => void;
|
|
36
|
+
}
|
|
37
|
+
// 为外部可拿到的 ref 形态定义类型
|
|
38
|
+
export type SentinelFormRef<T extends Record<string, any>> = Form<T> & {
|
|
39
|
+
submitLog?: (isInterfaceError?: boolean, error?: any) => Promise<void>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type SentinelFormApi<T extends Record<string, any>> = FormApi<T> & {
|
|
43
|
+
submitLog?: (isInterfaceError?: boolean, error?: any) => Promise<void>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const SentinelFormInner = <T extends Record<string, any>>(
|
|
47
|
+
{
|
|
48
|
+
formID,
|
|
49
|
+
children,
|
|
50
|
+
onValueChange,
|
|
51
|
+
onSubmit,
|
|
52
|
+
getFormApi,
|
|
53
|
+
...props
|
|
54
|
+
}: SentinelFormProps<T>,
|
|
55
|
+
ref: Ref<SentinelFormRef<T>>,
|
|
56
|
+
) => {
|
|
57
|
+
const sendEvent = useReportEvent();
|
|
58
|
+
const sessionID = useMemo(() => nanoid(), []);
|
|
59
|
+
const formRef = useRef<any>(null);
|
|
60
|
+
const instanceRef = useRef<any>(null);
|
|
61
|
+
const startTimeRef = useRef(0);
|
|
62
|
+
const interfaceErrorCount = useRef(0);
|
|
63
|
+
const validateErrorCount = useRef(0);
|
|
64
|
+
const firstValidateSuccess = useRef(true);
|
|
65
|
+
const noOperation = useRef(true);
|
|
66
|
+
const noSubmit = useRef(true);
|
|
67
|
+
const submitSuccess = useRef(false);
|
|
68
|
+
|
|
69
|
+
const validateErrorLog = debounce((error: any) => {
|
|
70
|
+
firstValidateSuccess.current = false;
|
|
71
|
+
validateErrorCount.current = validateErrorCount.current + 1;
|
|
72
|
+
|
|
73
|
+
const validateErrorTime = Date.now();
|
|
74
|
+
const errorKeys = Object.keys(error) || [];
|
|
75
|
+
sendEvent(EventNames.LOOP_FORM_FIELD_VALIDATE_ERROR, {
|
|
76
|
+
form_id: formID,
|
|
77
|
+
session_id: sessionID,
|
|
78
|
+
form_item_error_count: errorKeys.length,
|
|
79
|
+
form_item_error_detail: JSON.stringify(error || {}),
|
|
80
|
+
time: validateErrorTime,
|
|
81
|
+
time_str: dayjs(validateErrorTime).format('YYYY-MM-DD HH:mm:ss'),
|
|
82
|
+
});
|
|
83
|
+
}, 500);
|
|
84
|
+
|
|
85
|
+
// 提交日志:仅用于接口错误统计与成功上报,不处理校验错误
|
|
86
|
+
const submitLog = useCallback(
|
|
87
|
+
async (isInterfaceError?: boolean, error?: any) => {
|
|
88
|
+
noSubmit.current = false;
|
|
89
|
+
if (isInterfaceError) {
|
|
90
|
+
firstValidateSuccess.current = false;
|
|
91
|
+
interfaceErrorCount.current = interfaceErrorCount.current + 1;
|
|
92
|
+
sendEvent?.(EventNames.LOOP_FORM_SUBMIT_INTERFACE_ERROR, {
|
|
93
|
+
form_id: formID,
|
|
94
|
+
session_id: sessionID,
|
|
95
|
+
form_interface_error_detail: JSON.stringify(error || {}),
|
|
96
|
+
time: Date.now(),
|
|
97
|
+
time_str: dayjs(Date.now()).format('YYYY-MM-DD HH:mm:ss'),
|
|
98
|
+
});
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const values = await formRef?.current?.formApi?.getValues();
|
|
103
|
+
submitSuccess.current = true;
|
|
104
|
+
const formItemShow = Object.keys(values);
|
|
105
|
+
const formItemFilled = formItemShow.filter(key => values[key]);
|
|
106
|
+
const successTime = Date.now();
|
|
107
|
+
sendEvent?.(EventNames.LOOP_FORM_SUBMIT_SUCCESS, {
|
|
108
|
+
form_id: formID,
|
|
109
|
+
session_id: sessionID,
|
|
110
|
+
// 完成耗时
|
|
111
|
+
form_complete_consume_time: Date.now() - startTimeRef.current,
|
|
112
|
+
// 接口报错次数,需要计算
|
|
113
|
+
form_interface_error: interfaceErrorCount.current,
|
|
114
|
+
// 一次点击成功次数 pv
|
|
115
|
+
form_once_success_submit:
|
|
116
|
+
interfaceErrorCount.current === 0 && firstValidateSuccess.current,
|
|
117
|
+
// 表单填写项
|
|
118
|
+
form_item_filled: JSON.stringify(formItemFilled),
|
|
119
|
+
// 表单展现项
|
|
120
|
+
form_item_show: JSON.stringify(formItemShow),
|
|
121
|
+
// 表单项使用率
|
|
122
|
+
form_item_used_percent: formItemFilled.length / formItemShow.length,
|
|
123
|
+
form_values: JSON.stringify(values),
|
|
124
|
+
time: successTime,
|
|
125
|
+
time_str: dayjs(successTime).format('YYYY-MM-DD HH:mm:ss'),
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
[formID, sessionID],
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
// 劫持 validate,确保任何方式获取到的 formApi 都会命中被包装的 validate
|
|
132
|
+
const hijackValidate = useCallback(
|
|
133
|
+
(instance: any) => {
|
|
134
|
+
if (!instance) {
|
|
135
|
+
return instance;
|
|
136
|
+
}
|
|
137
|
+
const FLAG = '__validateHijacked__';
|
|
138
|
+
if (instance[FLAG]) {
|
|
139
|
+
return instance;
|
|
140
|
+
}
|
|
141
|
+
const originalValidate =
|
|
142
|
+
typeof instance.validate === 'function'
|
|
143
|
+
? instance.validate.bind(instance)
|
|
144
|
+
: null;
|
|
145
|
+
if (originalValidate) {
|
|
146
|
+
instance.validate = (...args: any[]) => {
|
|
147
|
+
try {
|
|
148
|
+
const maybePromise = originalValidate(...args);
|
|
149
|
+
return Promise.resolve(maybePromise).catch(err => {
|
|
150
|
+
// 校验失败:直接上报校验错误,不触发 submitLog
|
|
151
|
+
validateErrorLog(err);
|
|
152
|
+
throw err;
|
|
153
|
+
});
|
|
154
|
+
} catch (err) {
|
|
155
|
+
validateErrorLog(err);
|
|
156
|
+
throw err;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
instance[FLAG] = true;
|
|
160
|
+
}
|
|
161
|
+
if (!instance?.submitLog) {
|
|
162
|
+
instance.submitLog = submitLog;
|
|
163
|
+
}
|
|
164
|
+
return instance;
|
|
165
|
+
},
|
|
166
|
+
[submitLog],
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
const operationTimelineRef = useRef({});
|
|
170
|
+
// 关闭标签页/浏览器上报所需:保证拿到最新的 formID/sessionID 与避免重复上报
|
|
171
|
+
const formIdRef = useRef<string>(formID);
|
|
172
|
+
const sessionIdRef = useRef<string>(sessionID);
|
|
173
|
+
const flushedRef = useRef(false);
|
|
174
|
+
|
|
175
|
+
useEffect(() => {
|
|
176
|
+
formIdRef.current = formID;
|
|
177
|
+
}, [formID]);
|
|
178
|
+
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
sessionIdRef.current = sessionID;
|
|
181
|
+
}, [sessionID]);
|
|
182
|
+
|
|
183
|
+
// 空闲状态相关
|
|
184
|
+
const [isIdle, setIsIdle] = useState(false);
|
|
185
|
+
const [idleStartTime, setIdleStartTime] = useState<number | null>(null);
|
|
186
|
+
const IDLE_THRESHOLD = 5000; // 空闲阈值,单位毫秒(5秒)
|
|
187
|
+
const IDLE_CHECK_INTERVAL = 1000; // 空闲检查间隔,单位毫秒(1秒)
|
|
188
|
+
// 记录最后一次用户活跃时间
|
|
189
|
+
const [lastActiveTime, setLastActiveTime] = useState(Date.now());
|
|
190
|
+
|
|
191
|
+
const handleValueChange = changedValues => {
|
|
192
|
+
noOperation.current = false;
|
|
193
|
+
for (const key in changedValues) {
|
|
194
|
+
if (Object.prototype.hasOwnProperty.call(changedValues, key)) {
|
|
195
|
+
const currentTime = Date.now();
|
|
196
|
+
setLastActiveTime(currentTime); // 更新最后活跃时间
|
|
197
|
+
|
|
198
|
+
if (!operationTimelineRef.current[key]) {
|
|
199
|
+
// 首次操作该字段,初始化操作记录
|
|
200
|
+
operationTimelineRef.current = {
|
|
201
|
+
...operationTimelineRef.current,
|
|
202
|
+
[key]: [
|
|
203
|
+
{
|
|
204
|
+
startTime: currentTime,
|
|
205
|
+
startTimeStr: dayjs(currentTime).format('YYYY-MM-DD HH:mm:ss'),
|
|
206
|
+
endTime: currentTime,
|
|
207
|
+
endTimeStr: dayjs(currentTime).format('YYYY-MM-DD HH:mm:ss'),
|
|
208
|
+
duration: 0,
|
|
209
|
+
idleTime: 0, // 初始无效空闲时间为0
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
};
|
|
213
|
+
} else {
|
|
214
|
+
const lastOperation =
|
|
215
|
+
operationTimelineRef.current[key][
|
|
216
|
+
operationTimelineRef.current[key].length - 1
|
|
217
|
+
];
|
|
218
|
+
const totalDurationSinceLast = currentTime - lastOperation.startTime; // 本次操作从上次开始到现在的总时长
|
|
219
|
+
let idleTimeDeducted = 0;
|
|
220
|
+
|
|
221
|
+
if (isIdle && idleStartTime !== null) {
|
|
222
|
+
// 如果之前处于空闲状态,扣除这段空闲时间
|
|
223
|
+
idleTimeDeducted = currentTime - idleStartTime;
|
|
224
|
+
setIsIdle(false); // 重置空闲状态
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const effectiveDuration = totalDurationSinceLast - idleTimeDeducted;
|
|
228
|
+
const newOperation = {
|
|
229
|
+
startTime: currentTime,
|
|
230
|
+
startTimeStr: dayjs(currentTime).format('YYYY-MM-DD HH:mm:ss'),
|
|
231
|
+
endTime: currentTime,
|
|
232
|
+
endTimeStr: dayjs(currentTime).format('YYYY-MM-DD HH:mm:ss'),
|
|
233
|
+
duration: effectiveDuration,
|
|
234
|
+
idleTime: idleTimeDeducted,
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// 更新操作时间轴,添加新的操作记录
|
|
238
|
+
operationTimelineRef.current = {
|
|
239
|
+
...operationTimelineRef.current,
|
|
240
|
+
[key]: [...operationTimelineRef.current[key], newOperation],
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
const onFormClose = () => {
|
|
248
|
+
const closeTime = Date.now();
|
|
249
|
+
sendEvent?.(EventNames.LOOP_FORM_CLOSE, {
|
|
250
|
+
form_id: formIdRef.current,
|
|
251
|
+
session_id: sessionIdRef.current,
|
|
252
|
+
// 无表单操作 pv
|
|
253
|
+
form_no_operation: noOperation.current,
|
|
254
|
+
// 有表单操作,无表单提交操作次数 pv
|
|
255
|
+
form_operation_no_submit: !noOperation.current && noSubmit.current,
|
|
256
|
+
// 表单是否提交成功
|
|
257
|
+
form_operation_submit_success: submitSuccess.current,
|
|
258
|
+
// 接口报错次数, 需要计算
|
|
259
|
+
form_request_error_times: interfaceErrorCount.current,
|
|
260
|
+
// 表单项报错次数
|
|
261
|
+
form_item_error_times: validateErrorCount.current,
|
|
262
|
+
time: closeTime,
|
|
263
|
+
time_str: dayjs(closeTime).format('YYYY-MM-DD HH:mm:ss'),
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
const onFormCloseDobounce = useDebounceFn(onFormClose, { wait: 200 });
|
|
267
|
+
|
|
268
|
+
const onValuesChange = (values: any, changedValues: any) => {
|
|
269
|
+
handleValueChange(changedValues);
|
|
270
|
+
onValueChange?.(values as T, changedValues as Partial<T>);
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
useEffect(() => {
|
|
274
|
+
if (sessionID && formID) {
|
|
275
|
+
startTimeRef.current = Date.now();
|
|
276
|
+
}
|
|
277
|
+
}, [formID, sessionID]);
|
|
278
|
+
|
|
279
|
+
// 定时检测用户是否进入空闲状态
|
|
280
|
+
useEffect(() => {
|
|
281
|
+
const idleChecker = setInterval(() => {
|
|
282
|
+
if (!isIdle && Date.now() - lastActiveTime > IDLE_THRESHOLD) {
|
|
283
|
+
setIsIdle(true);
|
|
284
|
+
setIdleStartTime(Date.now());
|
|
285
|
+
}
|
|
286
|
+
}, IDLE_CHECK_INTERVAL); // 每秒检查一次
|
|
287
|
+
|
|
288
|
+
return () => clearInterval(idleChecker);
|
|
289
|
+
}, [isIdle, lastActiveTime]);
|
|
290
|
+
|
|
291
|
+
// 初始化: 进入表单时间
|
|
292
|
+
useEffect(() => {
|
|
293
|
+
if (sessionID && formID) {
|
|
294
|
+
const initTime = Date.now();
|
|
295
|
+
sendEvent?.(EventNames.INIT_LOOP_FORM, {
|
|
296
|
+
form_id: formID,
|
|
297
|
+
session_id: sessionID,
|
|
298
|
+
time: initTime,
|
|
299
|
+
time_str: dayjs(initTime).format('YYYY-MM-DD HH:mm:ss'),
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return () => {
|
|
304
|
+
if (formID && sessionID && !flushedRef.current) {
|
|
305
|
+
flushedRef.current = true;
|
|
306
|
+
sendEvent?.(EventNames.LOOP_FORM_FIELD_CHANGE_TIMELINE, {
|
|
307
|
+
form_id: formID,
|
|
308
|
+
session_id: sessionID,
|
|
309
|
+
time_line: JSON.stringify(operationTimelineRef.current),
|
|
310
|
+
});
|
|
311
|
+
onFormCloseDobounce.run();
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
}, [formID, sessionID]);
|
|
315
|
+
|
|
316
|
+
// 关注页面关闭(tab 关闭/浏览器退出/导航离开等),不处理页面隐藏
|
|
317
|
+
useEffect(() => {
|
|
318
|
+
const flushOnClose = () => {
|
|
319
|
+
if (flushedRef.current) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const fid = formIdRef.current;
|
|
323
|
+
const sid = sessionIdRef.current;
|
|
324
|
+
if (!fid || !sid) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
flushedRef.current = true;
|
|
328
|
+
|
|
329
|
+
sendEvent?.(EventNames.LOOP_FORM_FIELD_CHANGE_TIMELINE, {
|
|
330
|
+
form_id: fid,
|
|
331
|
+
session_id: sid,
|
|
332
|
+
time_line: JSON.stringify(operationTimelineRef.current),
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
onFormCloseDobounce.run();
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// 仅监听会导致页面真正卸载的事件
|
|
339
|
+
window.addEventListener('pagehide', flushOnClose);
|
|
340
|
+
window.addEventListener('beforeunload', flushOnClose);
|
|
341
|
+
|
|
342
|
+
return () => {
|
|
343
|
+
window.removeEventListener('pagehide', flushOnClose);
|
|
344
|
+
window.removeEventListener('beforeunload', flushOnClose);
|
|
345
|
+
};
|
|
346
|
+
}, []);
|
|
347
|
+
|
|
348
|
+
useImperativeHandle(ref, () => {
|
|
349
|
+
const newFormApi: any = hijackValidate(formRef?.current?.formApi);
|
|
350
|
+
const result: SentinelFormRef<T> = {
|
|
351
|
+
...(formRef?.current || {}),
|
|
352
|
+
formApi: newFormApi,
|
|
353
|
+
submitLog,
|
|
354
|
+
};
|
|
355
|
+
return result;
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
return (
|
|
359
|
+
<Form
|
|
360
|
+
ref={formRef}
|
|
361
|
+
onValueChange={onValuesChange}
|
|
362
|
+
getFormApi={instance => {
|
|
363
|
+
const hijacked = hijackValidate(instance);
|
|
364
|
+
instanceRef.current = hijacked;
|
|
365
|
+
getFormApi?.(hijacked);
|
|
366
|
+
}}
|
|
367
|
+
onSubmit={values => {
|
|
368
|
+
onSubmit?.(values as T);
|
|
369
|
+
}}
|
|
370
|
+
onSubmitFail={validateErrorLog}
|
|
371
|
+
{...(props as BaseFormProps<any>)}
|
|
372
|
+
>
|
|
373
|
+
{children}
|
|
374
|
+
</Form>
|
|
375
|
+
);
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
export const SentinelForm = forwardRef(SentinelFormInner) as <
|
|
379
|
+
T extends Record<string, any>,
|
|
380
|
+
>(
|
|
381
|
+
props: SentinelFormProps<T> & { ref?: Ref<SentinelFormRef<T>> },
|
|
382
|
+
) => JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.step-nav{
|
|
2
|
+
height: 24px;
|
|
3
|
+
display: flex;
|
|
4
|
+
gap:28px;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
|
|
8
|
+
.tab-step{
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: 8px;
|
|
11
|
+
align-items: center;
|
|
12
|
+
|
|
13
|
+
font-weight: 500 !important;
|
|
14
|
+
color: rgba(32, 41, 69, 62%);
|
|
15
|
+
|
|
16
|
+
.tab-icon{
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
|
|
21
|
+
width: 24px;
|
|
22
|
+
height: 24px;
|
|
23
|
+
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
font-style: normal;
|
|
27
|
+
line-height: 24px;
|
|
28
|
+
text-align: center;
|
|
29
|
+
|
|
30
|
+
background: rgba(87, 104, 161, 8%);
|
|
31
|
+
border-radius: 12px;
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.tab-active{
|
|
37
|
+
color: #5147FF;
|
|
38
|
+
|
|
39
|
+
.tab-icon{
|
|
40
|
+
color: #fff;
|
|
41
|
+
|
|
42
|
+
background: #5147FF;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { IconCozCheckMarkFill } from '@coze-arch/coze-design/icons';
|
|
3
|
+
import { Typography } from '@coze-arch/coze-design';
|
|
4
|
+
|
|
5
|
+
import styles from './index.module.less';
|
|
6
|
+
|
|
7
|
+
interface StepNavProps {
|
|
8
|
+
currentStep: string;
|
|
9
|
+
stepItems: {
|
|
10
|
+
key: string;
|
|
11
|
+
label: string;
|
|
12
|
+
icon?: React.ReactNode;
|
|
13
|
+
}[];
|
|
14
|
+
onStepChange?: (step: string) => void;
|
|
15
|
+
clickToChange?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function StepNav({
|
|
19
|
+
currentStep,
|
|
20
|
+
stepItems,
|
|
21
|
+
onStepChange,
|
|
22
|
+
clickToChange,
|
|
23
|
+
}: StepNavProps) {
|
|
24
|
+
const activeStepIndex = stepItems.findIndex(item => item.key === currentStep);
|
|
25
|
+
return (
|
|
26
|
+
<div className={styles['step-nav']}>
|
|
27
|
+
{stepItems.map((item, index) => (
|
|
28
|
+
<Typography.Text
|
|
29
|
+
key={item.key}
|
|
30
|
+
className={classNames(styles['tab-step'], {
|
|
31
|
+
[styles['tab-active']]:
|
|
32
|
+
currentStep === item.key || index <= activeStepIndex,
|
|
33
|
+
'cursor-pointer': clickToChange,
|
|
34
|
+
})}
|
|
35
|
+
icon={
|
|
36
|
+
index < activeStepIndex ? (
|
|
37
|
+
<span className={styles['tab-icon']}>
|
|
38
|
+
<IconCozCheckMarkFill />
|
|
39
|
+
</span>
|
|
40
|
+
) : (
|
|
41
|
+
<span className={styles['tab-icon']}>
|
|
42
|
+
{item?.icon ?? index + 1}
|
|
43
|
+
</span>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
onClick={() => clickToChange && onStepChange?.(item.key)}
|
|
47
|
+
>
|
|
48
|
+
{item.label}
|
|
49
|
+
</Typography.Text>
|
|
50
|
+
))}
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#loop-table {
|
|
2
|
+
/* stylelint-disable declaration-no-important */
|
|
3
|
+
/* stylelint-disable no-descending-specificity */
|
|
4
|
+
:global {
|
|
5
|
+
.semi-table-container {
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
border: 1px solid var(--line-color-border-2, #eaedf1);
|
|
8
|
+
border-radius: 6px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.semi-table-header {
|
|
12
|
+
background-color: var(--coz-bg, #f0f0f7);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.semi-spin-wrapper {
|
|
16
|
+
svg {
|
|
17
|
+
width: 20px;
|
|
18
|
+
height: 20px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.semi-table-row:hover > .semi-table-row-cell:first-child {
|
|
23
|
+
border-top-left-radius: 0;
|
|
24
|
+
border-bottom-left-radius: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.semi-table-row:hover > .semi-table-row-cell:last-child {
|
|
28
|
+
border-top-right-radius: 0;
|
|
29
|
+
border-bottom-right-radius: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.semi-table-tbody {
|
|
33
|
+
.semi-table-row:last-child {
|
|
34
|
+
.semi-table-row-cell {
|
|
35
|
+
border-bottom: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.semi-table-row-head {
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
height: 42px;
|
|
43
|
+
padding: 5px 20px;
|
|
44
|
+
|
|
45
|
+
font-size: 13px;
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
line-height: 20px;
|
|
48
|
+
color: var(--coz-fg-plus);
|
|
49
|
+
|
|
50
|
+
background: var(--coz-bg, #f0f0f7);
|
|
51
|
+
background-color: var(--coz-bg, #f0f0f7) !important;
|
|
52
|
+
border-bottom: 1px solid var(--line-color-border-2, #eaedf1);
|
|
53
|
+
|
|
54
|
+
&::before {
|
|
55
|
+
background-color: var(--coz-bg, #f0f0f7) !important;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.semi-table-row {
|
|
60
|
+
background-color: var(--coz-bg-max);
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
border-radius: 0 !important;
|
|
64
|
+
|
|
65
|
+
.semi-table-row-cell {
|
|
66
|
+
background-color: var(--coz-bg);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.semi-table-cell-fixed-left {
|
|
70
|
+
background-image: linear-gradient(0deg, var(--coz-bg), var(--coz-bg));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.semi-table-cell-fixed-right {
|
|
74
|
+
background-image: linear-gradient(0deg, var(--coz-bg), var(--coz-bg));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.semi-table-row-cell {
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
height: 42px;
|
|
84
|
+
padding: 10px 20px;
|
|
85
|
+
|
|
86
|
+
font-size: 13px;
|
|
87
|
+
font-weight: 400;
|
|
88
|
+
color: var(--coz-fg-primary);
|
|
89
|
+
vertical-align: top;
|
|
90
|
+
|
|
91
|
+
background-color: #fff;
|
|
92
|
+
border-radius: 0;
|
|
93
|
+
vertical-align: middle;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 左侧固定列去除左边框,仅保留阴影
|
|
97
|
+
.semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-left-last,
|
|
98
|
+
.semi-table-thead
|
|
99
|
+
> .semi-table-row
|
|
100
|
+
> .semi-table-row-head.semi-table-cell-fixed-left-last {
|
|
101
|
+
border-right: none;
|
|
102
|
+
box-shadow: 2px 0 8px rgba(0, 0, 0, 6%);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 右侧固定列去除左边框,仅保留阴影
|
|
106
|
+
.semi-table-tbody > .semi-table-row > .semi-table-cell-fixed-right-first,
|
|
107
|
+
.semi-table-thead
|
|
108
|
+
> .semi-table-row
|
|
109
|
+
> .semi-table-row-head.semi-table-cell-fixed-right-first {
|
|
110
|
+
border-left: none;
|
|
111
|
+
box-shadow: -2px 0 8px rgba(0, 0, 0, 6%);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.semi-table-scroll-position-left
|
|
115
|
+
.semi-table-tbody
|
|
116
|
+
> .semi-table-row
|
|
117
|
+
> .semi-table-cell-fixed-left-last,
|
|
118
|
+
.semi-table-scroll-position-left
|
|
119
|
+
.semi-table-thead
|
|
120
|
+
> .semi-table-row
|
|
121
|
+
> .semi-table-cell-fixed-left-last,
|
|
122
|
+
.semi-table-scroll-position-right
|
|
123
|
+
.semi-table-tbody
|
|
124
|
+
> .semi-table-row
|
|
125
|
+
> .semi-table-cell-fixed-right-first,
|
|
126
|
+
.semi-table-scroll-position-right
|
|
127
|
+
.semi-table-thead
|
|
128
|
+
> .semi-table-row
|
|
129
|
+
> .semi-table-cell-fixed-right-first {
|
|
130
|
+
box-shadow: none !important;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.semi-table-bordered
|
|
134
|
+
.semi-table-thead
|
|
135
|
+
> .semi-table-row
|
|
136
|
+
> .semi-table-row-head:last-child,
|
|
137
|
+
.semi-table-bordered
|
|
138
|
+
.semi-table-tbody
|
|
139
|
+
> .semi-table-row
|
|
140
|
+
> .semi-table-row-cell:last-child {
|
|
141
|
+
border-right: none;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IconCozIllusEmpty } from '@coze-arch/coze-design/illustrations';
|
|
2
|
+
import { type TableProps, EmptyState, Table } from '@coze-arch/coze-design';
|
|
3
|
+
|
|
4
|
+
import styles from './index.module.less';
|
|
5
|
+
|
|
6
|
+
export const LoopTable: React.FC<TableProps> = ({ className, ...props }) => (
|
|
7
|
+
<Table
|
|
8
|
+
empty={
|
|
9
|
+
<EmptyState
|
|
10
|
+
size="full_screen"
|
|
11
|
+
icon={<IconCozIllusEmpty />}
|
|
12
|
+
title="暂无数据"
|
|
13
|
+
/>
|
|
14
|
+
}
|
|
15
|
+
{...props}
|
|
16
|
+
id={styles['loop-table']}
|
|
17
|
+
/>
|
|
18
|
+
);
|