@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,103 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { type ContentPart } from '@cozeloop/api-schema/prompt';
|
|
3
|
+
import {
|
|
4
|
+
type Content,
|
|
5
|
+
type Image,
|
|
6
|
+
type ContentType,
|
|
7
|
+
} from '@cozeloop/api-schema/evaluation';
|
|
8
|
+
import { ItemErrorType, type MultiModalSpec } from '@cozeloop/api-schema/data';
|
|
9
|
+
|
|
10
|
+
export enum ImageStatus {
|
|
11
|
+
Loading = 'loading',
|
|
12
|
+
Success = 'success',
|
|
13
|
+
Error = 'error',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type FileItemStatus =
|
|
17
|
+
| 'success'
|
|
18
|
+
| 'uploadFail'
|
|
19
|
+
| 'validateFail'
|
|
20
|
+
| 'validating'
|
|
21
|
+
| 'uploading'
|
|
22
|
+
| 'wait';
|
|
23
|
+
|
|
24
|
+
export interface ContentPartLoop extends ContentPart {
|
|
25
|
+
uid?: string;
|
|
26
|
+
status?: FileItemStatus;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const ErrorTypeMap = {
|
|
30
|
+
[ItemErrorType.MismatchSchema]: 'schema 不匹配',
|
|
31
|
+
[ItemErrorType.EmptyData]: '空数据',
|
|
32
|
+
[ItemErrorType.ExceedMaxItemSize]: '单条数据大小超限',
|
|
33
|
+
[ItemErrorType.ExceedDatasetCapacity]: '数据集容量超限',
|
|
34
|
+
[ItemErrorType.MalformedFile]: '文件格式错误',
|
|
35
|
+
[ItemErrorType.InternalError]: '系统错误',
|
|
36
|
+
[ItemErrorType.IllegalContent]: '包含非法内容',
|
|
37
|
+
[ItemErrorType.MissingRequiredField]: '缺少必填字段',
|
|
38
|
+
[ItemErrorType.ExceedMaxNestedDepth]: '数据嵌套层数超限',
|
|
39
|
+
[ItemErrorType.TransformItemFailed]: '数据转换失败',
|
|
40
|
+
[ItemErrorType.ExceedMaxImageCount]: '图片数量超限',
|
|
41
|
+
[ItemErrorType.ExceedMaxImageSize]: '图片大小超限',
|
|
42
|
+
[ItemErrorType.GetImageFailed]: '图片获取失败',
|
|
43
|
+
[ItemErrorType.IllegalExtension]: '文件扩展名不合法',
|
|
44
|
+
[ItemErrorType.UploadImageFailed]: '上传图片失败',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type MultipartItemContentType = ContentType | 'Video';
|
|
48
|
+
export interface MultipartItem extends Omit<Content, 'content_type'> {
|
|
49
|
+
uid?: string;
|
|
50
|
+
sourceImage?: {
|
|
51
|
+
status: ImageStatus;
|
|
52
|
+
file?: File;
|
|
53
|
+
};
|
|
54
|
+
sourceVideo?: {
|
|
55
|
+
status: ImageStatus;
|
|
56
|
+
file?: File;
|
|
57
|
+
};
|
|
58
|
+
video?: Image;
|
|
59
|
+
content_type: MultipartItemContentType;
|
|
60
|
+
config?: {
|
|
61
|
+
image_resolution?: string;
|
|
62
|
+
video_fps?: number;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ImageField {
|
|
67
|
+
name?: string;
|
|
68
|
+
url?: string;
|
|
69
|
+
uri?: string;
|
|
70
|
+
thumb_url?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface UploadAttachmentDetail {
|
|
74
|
+
contentType?: ContentType;
|
|
75
|
+
originImage?: ImageField;
|
|
76
|
+
image?: ImageField;
|
|
77
|
+
errorType?: ItemErrorType;
|
|
78
|
+
errMsg?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type MultipartEditorConfig = MultiModalSpec & {
|
|
82
|
+
imageEnabled?: boolean;
|
|
83
|
+
imageSupportedFormats?: string[];
|
|
84
|
+
videoEnabled?: boolean;
|
|
85
|
+
videoSupportedFormats?: string[];
|
|
86
|
+
maxVideoSize?: number;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export interface MultipartEditorProps {
|
|
90
|
+
spaceID?: Int64;
|
|
91
|
+
className?: string;
|
|
92
|
+
value?: MultipartItem[];
|
|
93
|
+
multipartConfig?: MultipartEditorConfig;
|
|
94
|
+
readonly?: boolean;
|
|
95
|
+
onChange?: (contents: MultipartItem[]) => void;
|
|
96
|
+
uploadFile?: (params: any) => Promise<string>;
|
|
97
|
+
uploadImageUrl?: (
|
|
98
|
+
urls: string[],
|
|
99
|
+
) => Promise<UploadAttachmentDetail[] | undefined>;
|
|
100
|
+
imageHidden?: boolean;
|
|
101
|
+
videoHidden?: boolean;
|
|
102
|
+
intranetUrlValidator?: (url: string) => boolean;
|
|
103
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/* eslint-disable @coze-arch/max-line-per-function */
|
|
2
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { ContentType } from '@cozeloop/api-schema/prompt';
|
|
5
|
+
import {
|
|
6
|
+
IconCozImage,
|
|
7
|
+
IconCozImageArrowUp,
|
|
8
|
+
IconCozVideo,
|
|
9
|
+
} from '@coze-arch/coze-design/icons';
|
|
10
|
+
import {
|
|
11
|
+
IconButton,
|
|
12
|
+
Menu,
|
|
13
|
+
Toast,
|
|
14
|
+
Upload,
|
|
15
|
+
type UploadProps,
|
|
16
|
+
} from '@coze-arch/coze-design';
|
|
17
|
+
|
|
18
|
+
import { type ContentPartLoop } from './type';
|
|
19
|
+
|
|
20
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
|
+
interface UploadBtnProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
22
|
+
spaceID: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
maxImageSize?: number;
|
|
25
|
+
maxVideoSize?: number;
|
|
26
|
+
maxFileCount?: number;
|
|
27
|
+
imageEnabled?: boolean;
|
|
28
|
+
videoEnabled?: boolean;
|
|
29
|
+
imageSupportedFormats?: string[];
|
|
30
|
+
videoSupportedFormats?: string[];
|
|
31
|
+
fileLimit?: number;
|
|
32
|
+
fileParts?: ContentPartLoop[];
|
|
33
|
+
uploadFile?: (params: any) => Promise<string>;
|
|
34
|
+
onFilePartsChange?: (part: ContentPartLoop) => void;
|
|
35
|
+
}
|
|
36
|
+
export interface UploadButtonRef {
|
|
37
|
+
getUploadImage: () => Upload | null;
|
|
38
|
+
getUploadVideo: () => Upload | null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const UploadButton = forwardRef<UploadButtonRef, UploadBtnProps>(
|
|
42
|
+
(
|
|
43
|
+
{
|
|
44
|
+
spaceID,
|
|
45
|
+
disabled,
|
|
46
|
+
maxImageSize,
|
|
47
|
+
maxVideoSize,
|
|
48
|
+
maxFileCount,
|
|
49
|
+
uploadFile,
|
|
50
|
+
imageEnabled,
|
|
51
|
+
videoEnabled,
|
|
52
|
+
imageSupportedFormats,
|
|
53
|
+
videoSupportedFormats,
|
|
54
|
+
fileLimit,
|
|
55
|
+
fileParts = [],
|
|
56
|
+
onFilePartsChange,
|
|
57
|
+
}: UploadBtnProps,
|
|
58
|
+
ref,
|
|
59
|
+
) => {
|
|
60
|
+
const uploadImgRef = useRef<Upload>(null);
|
|
61
|
+
const uploadVideoRef = useRef<Upload>(null);
|
|
62
|
+
|
|
63
|
+
const createUploadHandler =
|
|
64
|
+
(fileType: 'image' | 'video'): UploadProps['customRequest'] =>
|
|
65
|
+
({ fileInstance, file, onProgress, onSuccess, onError }) => {
|
|
66
|
+
const currentFileType = fileType;
|
|
67
|
+
const { uid } = file;
|
|
68
|
+
|
|
69
|
+
const reader = new FileReader();
|
|
70
|
+
reader.readAsDataURL(fileInstance as Blob);
|
|
71
|
+
reader.onload = async () => {
|
|
72
|
+
const base64Url = reader.result as string;
|
|
73
|
+
const partInfo =
|
|
74
|
+
currentFileType === 'image'
|
|
75
|
+
? { image_url: { url: file.url, thumb_url: base64Url } }
|
|
76
|
+
: { video_url: { url: file.url, thumb_url: base64Url } };
|
|
77
|
+
const part: ContentPartLoop = {
|
|
78
|
+
type:
|
|
79
|
+
currentFileType === 'image'
|
|
80
|
+
? ContentType.ImageURL
|
|
81
|
+
: ContentType.VideoURL,
|
|
82
|
+
...partInfo,
|
|
83
|
+
status: 'uploading',
|
|
84
|
+
uid,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
onFilePartsChange?.(part);
|
|
89
|
+
const res = await uploadFile?.({
|
|
90
|
+
spaceID,
|
|
91
|
+
file: fileInstance,
|
|
92
|
+
fileType: 'image', // 不管是视频还是图片,都走imageX上传,所以fileType必须都是image
|
|
93
|
+
onProgress,
|
|
94
|
+
onSuccess,
|
|
95
|
+
onError,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const fileInfo =
|
|
99
|
+
currentFileType === 'image'
|
|
100
|
+
? {
|
|
101
|
+
image_url: {
|
|
102
|
+
url: file.url,
|
|
103
|
+
uri: res,
|
|
104
|
+
thumb_url: base64Url,
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
: {
|
|
108
|
+
video_url: {
|
|
109
|
+
url: file.url,
|
|
110
|
+
uri: res,
|
|
111
|
+
thumb_url: base64Url,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const newPart: ContentPartLoop = {
|
|
116
|
+
...part,
|
|
117
|
+
...fileInfo,
|
|
118
|
+
status: 'success',
|
|
119
|
+
};
|
|
120
|
+
onFilePartsChange?.(newPart);
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.info('error', error);
|
|
123
|
+
Toast.error('图片上传失败,请稍后重试');
|
|
124
|
+
onFilePartsChange?.({
|
|
125
|
+
...part,
|
|
126
|
+
status: 'uploadFail',
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const renderImageUpload = useCallback(
|
|
133
|
+
(children: React.ReactNode) => (
|
|
134
|
+
<Upload
|
|
135
|
+
ref={uploadImgRef}
|
|
136
|
+
action=""
|
|
137
|
+
customRequest={createUploadHandler('image')}
|
|
138
|
+
accept={imageSupportedFormats?.join(',') || 'image/*'}
|
|
139
|
+
showUploadList={false}
|
|
140
|
+
maxSize={maxImageSize ? maxImageSize * 1024 * 1024 : 0}
|
|
141
|
+
limit={fileLimit}
|
|
142
|
+
onSizeError={() => Toast.error(`图片大小不能超过${maxImageSize}MB`)}
|
|
143
|
+
onExceed={() => Toast.warning(`最多上传${maxFileCount}张图片`)}
|
|
144
|
+
multiple
|
|
145
|
+
fileList={fileParts.map(it => ({
|
|
146
|
+
uid: it.uid || '',
|
|
147
|
+
url: it.image_url?.url,
|
|
148
|
+
status: it.status || 'success',
|
|
149
|
+
name: it.uid || '',
|
|
150
|
+
size: '0',
|
|
151
|
+
}))}
|
|
152
|
+
>
|
|
153
|
+
{children}
|
|
154
|
+
</Upload>
|
|
155
|
+
),
|
|
156
|
+
[fileParts, maxImageSize, fileLimit, imageSupportedFormats],
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
const renderVideoUpload = useCallback(
|
|
160
|
+
(children: React.ReactNode) => (
|
|
161
|
+
<Upload
|
|
162
|
+
ref={uploadVideoRef}
|
|
163
|
+
action=""
|
|
164
|
+
customRequest={createUploadHandler('video')}
|
|
165
|
+
accept={videoSupportedFormats?.join(',') || 'video/*'}
|
|
166
|
+
showUploadList={false}
|
|
167
|
+
maxSize={maxVideoSize ? maxVideoSize * 1024 : 0}
|
|
168
|
+
limit={fileLimit}
|
|
169
|
+
onSizeError={() => Toast.error(`视频大小不能超过${maxVideoSize}MB`)}
|
|
170
|
+
onExceed={() => Toast.warning(`最多上传${maxFileCount}个视频`)}
|
|
171
|
+
multiple
|
|
172
|
+
fileList={fileParts.map(it => ({
|
|
173
|
+
uid: it.uid || '',
|
|
174
|
+
url: it.video_url?.url,
|
|
175
|
+
status: it.status || 'success',
|
|
176
|
+
name: it.uid || '',
|
|
177
|
+
size: '0',
|
|
178
|
+
}))}
|
|
179
|
+
>
|
|
180
|
+
{children}
|
|
181
|
+
</Upload>
|
|
182
|
+
),
|
|
183
|
+
[fileParts, maxVideoSize, fileLimit, videoSupportedFormats],
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
useImperativeHandle(ref, () => ({
|
|
187
|
+
getUploadImage: () => uploadImgRef.current,
|
|
188
|
+
getUploadVideo: () => uploadVideoRef.current,
|
|
189
|
+
}));
|
|
190
|
+
|
|
191
|
+
if (!imageEnabled && !videoEnabled) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (imageEnabled && !videoEnabled) {
|
|
196
|
+
return renderImageUpload(
|
|
197
|
+
<IconButton
|
|
198
|
+
icon={<IconCozImage />}
|
|
199
|
+
color="primary"
|
|
200
|
+
disabled={disabled}
|
|
201
|
+
data-btm="d41383"
|
|
202
|
+
data-btm-title="图片上传"
|
|
203
|
+
/>,
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (!imageEnabled && videoEnabled) {
|
|
208
|
+
return renderVideoUpload(
|
|
209
|
+
<IconButton
|
|
210
|
+
icon={<IconCozVideo />}
|
|
211
|
+
color="primary"
|
|
212
|
+
disabled={disabled}
|
|
213
|
+
data-btm="d27622"
|
|
214
|
+
data-btm-title="视频上传"
|
|
215
|
+
/>,
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return (
|
|
220
|
+
<>
|
|
221
|
+
<Menu
|
|
222
|
+
render={
|
|
223
|
+
<Menu.SubMenu mode="menu">
|
|
224
|
+
<Menu.Item
|
|
225
|
+
onClick={() => {
|
|
226
|
+
uploadImgRef.current?.openFileDialog();
|
|
227
|
+
}}
|
|
228
|
+
data-btm="d41383"
|
|
229
|
+
data-btm-title="图片上传"
|
|
230
|
+
>
|
|
231
|
+
图片上传
|
|
232
|
+
</Menu.Item>
|
|
233
|
+
<Menu.Item
|
|
234
|
+
onClick={() => {
|
|
235
|
+
uploadVideoRef.current?.openFileDialog();
|
|
236
|
+
}}
|
|
237
|
+
data-btm="d27622"
|
|
238
|
+
data-btm-title="视频上传"
|
|
239
|
+
>
|
|
240
|
+
视频上传
|
|
241
|
+
</Menu.Item>
|
|
242
|
+
</Menu.SubMenu>
|
|
243
|
+
}
|
|
244
|
+
>
|
|
245
|
+
<IconButton
|
|
246
|
+
icon={<IconCozImageArrowUp />}
|
|
247
|
+
color="primary"
|
|
248
|
+
disabled={disabled}
|
|
249
|
+
/>
|
|
250
|
+
</Menu>
|
|
251
|
+
{renderImageUpload(null)}
|
|
252
|
+
{renderVideoUpload(null)}
|
|
253
|
+
</>
|
|
254
|
+
);
|
|
255
|
+
},
|
|
256
|
+
);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type MultipartEditorConfig } from './type';
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_FILE_SIZE = 20 * 1024 * 1024;
|
|
4
|
+
export const DEFAULT_FILE_COUNT = 20;
|
|
5
|
+
export const DEFAULT_PART_COUNT = 50;
|
|
6
|
+
export const DEFAULT_SUPPORTED_FORMATS = [
|
|
7
|
+
'.jpg',
|
|
8
|
+
'.jpeg',
|
|
9
|
+
'.png',
|
|
10
|
+
'.gif',
|
|
11
|
+
'.bmp',
|
|
12
|
+
'.webp',
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export const DEFAULT_VIDEO_SUPPORTED_FORMATS = [
|
|
16
|
+
'.mp4',
|
|
17
|
+
'.avi',
|
|
18
|
+
'.mov',
|
|
19
|
+
'.wmv',
|
|
20
|
+
'.flv',
|
|
21
|
+
'.mkv',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export const getMultipartConfig = (multipartConfig?: MultipartEditorConfig) => {
|
|
25
|
+
const {
|
|
26
|
+
max_file_count,
|
|
27
|
+
max_part_count,
|
|
28
|
+
max_file_size,
|
|
29
|
+
imageEnabled,
|
|
30
|
+
videoEnabled,
|
|
31
|
+
imageSupportedFormats,
|
|
32
|
+
videoSupportedFormats,
|
|
33
|
+
maxVideoSize,
|
|
34
|
+
} = multipartConfig || {};
|
|
35
|
+
const maxFileCount = max_file_count
|
|
36
|
+
? Number(max_file_count)
|
|
37
|
+
: DEFAULT_FILE_COUNT;
|
|
38
|
+
const maxPartCount = max_part_count
|
|
39
|
+
? Number(max_part_count)
|
|
40
|
+
: DEFAULT_PART_COUNT;
|
|
41
|
+
const trueMaxFileCount =
|
|
42
|
+
maxFileCount > maxPartCount ? maxPartCount : maxFileCount;
|
|
43
|
+
const maxFileSize = max_file_size ? Number(max_file_size) : DEFAULT_FILE_SIZE;
|
|
44
|
+
const currentImageSupportedFormats = (
|
|
45
|
+
imageSupportedFormats?.map(format =>
|
|
46
|
+
format.startsWith('.') ? format : `.${format}`,
|
|
47
|
+
) || DEFAULT_SUPPORTED_FORMATS
|
|
48
|
+
).join(',');
|
|
49
|
+
const currentVideoSupportedFormats = (
|
|
50
|
+
videoSupportedFormats?.map(format =>
|
|
51
|
+
format.startsWith('.') ? format : `.${format}`,
|
|
52
|
+
) || DEFAULT_VIDEO_SUPPORTED_FORMATS
|
|
53
|
+
).join(',');
|
|
54
|
+
return {
|
|
55
|
+
maxFileCount: trueMaxFileCount,
|
|
56
|
+
maxPartCount,
|
|
57
|
+
maxFileSize,
|
|
58
|
+
imageEnabled,
|
|
59
|
+
videoEnabled,
|
|
60
|
+
imageSupportedFormats: currentImageSupportedFormats,
|
|
61
|
+
videoSupportedFormats: currentVideoSupportedFormats,
|
|
62
|
+
maxVideoSize,
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { IconCozLongArrowTopRight } from '@coze-arch/coze-design/icons';
|
|
3
|
+
import { Tooltip, Button } from '@coze-arch/coze-design';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
url: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function OpenDetailButton({ url, className }: Props) {
|
|
11
|
+
return (
|
|
12
|
+
<Tooltip theme="dark" content="查看详情">
|
|
13
|
+
<Button
|
|
14
|
+
onClick={e => {
|
|
15
|
+
e.stopPropagation();
|
|
16
|
+
window.open(url);
|
|
17
|
+
}}
|
|
18
|
+
className={classNames(
|
|
19
|
+
'flex-shrink-0 !h-6 !w-6 !min-w-[24px] !p-[5px]',
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
size="small"
|
|
23
|
+
color="secondary"
|
|
24
|
+
icon={
|
|
25
|
+
<IconCozLongArrowTopRight className="h-[14px] w-[14px] coz-fg-secondary" />
|
|
26
|
+
}
|
|
27
|
+
></Button>
|
|
28
|
+
</Tooltip>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import {
|
|
5
|
+
IconCozIllus404Dark,
|
|
6
|
+
IconCozIllus404,
|
|
7
|
+
IconCozIllusErrorDark,
|
|
8
|
+
IconCozIllusError,
|
|
9
|
+
IconCozIllusLock,
|
|
10
|
+
IconCozIllusLockDark,
|
|
11
|
+
IconCozIllusEmpty,
|
|
12
|
+
IconCozIllusEmptyDark,
|
|
13
|
+
} from '@coze-arch/coze-design/illustrations';
|
|
14
|
+
import { Empty, Spin, type EmptyStateProps } from '@coze-arch/coze-design';
|
|
15
|
+
|
|
16
|
+
interface PageLoadingProps {
|
|
17
|
+
tip?: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
interface FullPageProps {
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type PageContentProps = Omit<EmptyStateProps, 'image' | 'darkModeImage'>;
|
|
28
|
+
|
|
29
|
+
export function FullPage({ children, className, style }: FullPageProps) {
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
className={classNames(
|
|
33
|
+
'w-full h-full flex items-center justify-center bg-semi-bg-1 z-10',
|
|
34
|
+
className,
|
|
35
|
+
)}
|
|
36
|
+
style={style}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export function PageLoading(props: PageLoadingProps) {
|
|
43
|
+
return (
|
|
44
|
+
<FullPage className={props.className} style={props.style}>
|
|
45
|
+
<Spin wrapperClassName="w-full h-full" spinning tip={props.tip} />
|
|
46
|
+
</FullPage>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function PageNotFound({ className, ...props }: PageContentProps) {
|
|
51
|
+
return (
|
|
52
|
+
<FullPage className={className}>
|
|
53
|
+
<Empty
|
|
54
|
+
image={<IconCozIllus404 className="text-[160px]" />}
|
|
55
|
+
darkModeImage={<IconCozIllus404Dark className="text-[160px]" />}
|
|
56
|
+
description="页面丢失了"
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
</FullPage>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function PageError({ className, ...props }: PageContentProps) {
|
|
64
|
+
return (
|
|
65
|
+
<FullPage className={className}>
|
|
66
|
+
<Empty
|
|
67
|
+
image={<IconCozIllusError className="text-[160px]" />}
|
|
68
|
+
darkModeImage={<IconCozIllusErrorDark className="text-[160px]" />}
|
|
69
|
+
description="页面加载失败"
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
</FullPage>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function PageNoAuth({ className, ...props }: PageContentProps) {
|
|
77
|
+
return (
|
|
78
|
+
<FullPage className={className}>
|
|
79
|
+
<Empty
|
|
80
|
+
image={<IconCozIllusLock className="text-[160px]" />}
|
|
81
|
+
darkModeImage={<IconCozIllusLockDark className="text-[160px]" />}
|
|
82
|
+
description="暂无权限"
|
|
83
|
+
{...props}
|
|
84
|
+
></Empty>
|
|
85
|
+
</FullPage>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function PageNoContent({ className, ...props }: PageContentProps) {
|
|
90
|
+
return (
|
|
91
|
+
<FullPage className={className}>
|
|
92
|
+
<Empty
|
|
93
|
+
image={<IconCozIllusEmpty className="text-[160px]" />}
|
|
94
|
+
darkModeImage={<IconCozIllusEmptyDark className="text-[160px]" />}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
</FullPage>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PrimaryPage } from './primary-header';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
|
|
5
|
+
interface PrimaryPageHeaderProps {
|
|
6
|
+
pageTitle?: ReactNode;
|
|
7
|
+
filterSlot?: ReactNode;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
headerClassName?: string;
|
|
10
|
+
titleClassName?: string;
|
|
11
|
+
contentClassName?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
titleSlot?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const PrimaryPage = ({
|
|
17
|
+
pageTitle,
|
|
18
|
+
filterSlot,
|
|
19
|
+
children,
|
|
20
|
+
contentClassName,
|
|
21
|
+
className,
|
|
22
|
+
headerClassName,
|
|
23
|
+
titleClassName,
|
|
24
|
+
titleSlot,
|
|
25
|
+
}: PrimaryPageHeaderProps) => (
|
|
26
|
+
<div
|
|
27
|
+
className={classNames(
|
|
28
|
+
'pt-2 pb-3 h-full max-h-full flex flex-col',
|
|
29
|
+
className,
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
{pageTitle || titleSlot ? (
|
|
33
|
+
<div
|
|
34
|
+
className={classNames(
|
|
35
|
+
'flex items-center justify-between py-4 px-6',
|
|
36
|
+
headerClassName,
|
|
37
|
+
)}
|
|
38
|
+
>
|
|
39
|
+
<div
|
|
40
|
+
className={classNames(
|
|
41
|
+
'text-[20px] font-medium leading-6 coz-fg-plus',
|
|
42
|
+
titleClassName,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
{pageTitle}
|
|
46
|
+
</div>
|
|
47
|
+
<div>{titleSlot}</div>
|
|
48
|
+
</div>
|
|
49
|
+
) : null}
|
|
50
|
+
{filterSlot ? (
|
|
51
|
+
<div className="box-border coz-fg-secondary pt-1 pb-3 px-6">
|
|
52
|
+
{filterSlot}
|
|
53
|
+
</div>
|
|
54
|
+
) : null}
|
|
55
|
+
<div
|
|
56
|
+
className={classNames(
|
|
57
|
+
'flex-1 h-full max-h-full overflow-hidden px-6',
|
|
58
|
+
contentClassName,
|
|
59
|
+
)}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Typography } from '@coze-arch/coze-design';
|
|
4
|
+
|
|
5
|
+
import styles from './index.module.less';
|
|
6
|
+
|
|
7
|
+
interface PrimaryTitleProps {
|
|
8
|
+
title: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function PrimaryTitle({ title, className }: PrimaryTitleProps) {
|
|
13
|
+
return (
|
|
14
|
+
<Typography.Text className={classNames(styles['primary-title'], className)}>
|
|
15
|
+
{title}
|
|
16
|
+
</Typography.Text>
|
|
17
|
+
);
|
|
18
|
+
}
|