@cozeloop/components 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -1
- 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/package.json +31 -21
- 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
|
@@ -1,129 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
-
};
|
|
41
|
-
var __copyProps = (to, from, except, desc) => {
|
|
42
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
-
for (let key of __getOwnPropNames(from))
|
|
44
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
-
}
|
|
47
|
-
return to;
|
|
48
|
-
};
|
|
49
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
-
mod
|
|
56
|
-
));
|
|
57
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
-
var resize_sidesheet_exports = {};
|
|
59
|
-
__export(resize_sidesheet_exports, {
|
|
60
|
-
ResizeSidesheet: () => ResizeSidesheet
|
|
61
|
-
});
|
|
62
|
-
module.exports = __toCommonJS(resize_sidesheet_exports);
|
|
63
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
64
|
-
var import_classnames = __toESM(require("classnames"));
|
|
65
|
-
var import_icons = require("@coze-arch/coze-design/icons");
|
|
66
|
-
var import_coze_design = require("@coze-arch/coze-design");
|
|
67
|
-
var import_coze_design2 = require("@coze-arch/coze-design");
|
|
68
|
-
var import_use_drag = require("./use-drag");
|
|
69
|
-
var import_index = __toESM(require("./index.module"));
|
|
70
|
-
const ResizeSidesheet = (props) => {
|
|
71
|
-
const _a = props, {
|
|
72
|
-
children,
|
|
73
|
-
dragOptions,
|
|
74
|
-
title,
|
|
75
|
-
onCancel,
|
|
76
|
-
className,
|
|
77
|
-
showDivider
|
|
78
|
-
} = _a, rest = __objRest(_a, [
|
|
79
|
-
"children",
|
|
80
|
-
"dragOptions",
|
|
81
|
-
"title",
|
|
82
|
-
"onCancel",
|
|
83
|
-
"className",
|
|
84
|
-
"showDivider"
|
|
85
|
-
]);
|
|
86
|
-
const { containerRef, isActive, sidePaneWidth } = (0, import_use_drag.useDrag)(dragOptions);
|
|
87
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
88
|
-
import_coze_design.SideSheet,
|
|
89
|
-
__spreadProps(__spreadValues({
|
|
90
|
-
title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
91
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex-1", children: title }),
|
|
92
|
-
showDivider ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_coze_design.Divider, { layout: "vertical", className: "h-[12px]" }) : null,
|
|
93
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
-
import_coze_design2.Button,
|
|
95
|
-
{
|
|
96
|
-
type: "primary",
|
|
97
|
-
color: "secondary",
|
|
98
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.IconCozCrossFill, { className: "w-[16px] h-[16px]" }),
|
|
99
|
-
onClick: onCancel
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
] }),
|
|
103
|
-
width: sidePaneWidth,
|
|
104
|
-
className: (0, import_classnames.default)(import_index.default.sheet, className)
|
|
105
|
-
}, rest), {
|
|
106
|
-
onCancel,
|
|
107
|
-
closable: false,
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
-
"div",
|
|
111
|
-
{
|
|
112
|
-
ref: containerRef,
|
|
113
|
-
className: (0, import_classnames.default)(
|
|
114
|
-
"absolute h-full w-[2px] z-[20000] bg-transparent top-0 left-0 hover:cursor-col-resize hover:bg-[rgb(var(--coze-up-brand-9))] transition ",
|
|
115
|
-
{
|
|
116
|
-
"bg-[rgb(var(--coze-up-brand-9))] cursor-col-resize": isActive
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
props.children
|
|
122
|
-
]
|
|
123
|
-
})
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
127
|
-
0 && (module.exports = {
|
|
128
|
-
ResizeSidesheet
|
|
129
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { IconCozCrossFill } from '@coze-arch/coze-design/icons';
|
|
4
|
+
import { Divider, SideSheet, } from '@coze-arch/coze-design';
|
|
5
|
+
import { Button } from '@coze-arch/coze-design';
|
|
6
|
+
import { useDrag } from './use-drag';
|
|
7
|
+
import styles from './index.module.less';
|
|
8
|
+
export const ResizeSidesheet = (props) => {
|
|
9
|
+
const { children, dragOptions, title, onCancel, className, showDivider, disableDrag, ...rest } = props;
|
|
10
|
+
const { containerRef, isActive, sidePaneWidth } = useDrag(dragOptions);
|
|
11
|
+
return (_jsxs(SideSheet, { title: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex-1", children: title }), showDivider ? (_jsx(Divider, { layout: "vertical", className: "h-[12px]" })) : null, _jsx(Button, { type: "primary", color: "secondary", icon: _jsx(IconCozCrossFill, { className: "w-[16px] h-[16px]" }), onClick: onCancel })] }), width: disableDrag ? undefined : sidePaneWidth, className: cn(styles.sheet, className), ...rest, onCancel: onCancel, closable: false, children: [disableDrag ? null : (_jsx("div", { ref: containerRef, className: cn('absolute h-full w-[2px] z-[20000] bg-transparent top-0 left-0 hover:cursor-col-resize hover:bg-[rgb(var(--coze-up-brand-9))] transition ', {
|
|
12
|
+
'bg-[rgb(var(--coze-up-brand-9))] cursor-col-resize': isActive,
|
|
13
|
+
}) })), props.children] }));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resize-sidesheet/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAEL,OAAO,EACP,SAAS,GACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAoB,MAAM,YAAY,CAAC;AAEvD,OAAO,MAAM,MAAM,qB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
+
maxWidth?: number;
|
|
4
|
+
minWidth?: number;
|
|
5
|
+
onDragEnd?: (width: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useDrag: (options?: DragOptions) => {
|
|
8
|
+
sidePaneWidth: number;
|
|
9
|
+
containerRef: (node: HTMLElement | null) => void;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
};
|
|
@@ -1,55 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var use_drag_exports = {};
|
|
20
|
-
__export(use_drag_exports, {
|
|
21
|
-
useDrag: () => useDrag
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(use_drag_exports);
|
|
24
|
-
var import_react = require("react");
|
|
25
|
-
var import_use_mouse_down_offset = require("../hooks/use-mouse-down-offset");
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useMouseDownOffset } from '../hooks/use-mouse-down-offset';
|
|
26
3
|
const DEFAULT_WIDTH = 500;
|
|
27
4
|
const MAX_WIDTH = 800;
|
|
28
5
|
const MIN_WIDTH = 300;
|
|
29
|
-
const useDrag = (options = {}) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
6
|
+
export const useDrag = (options = {}) => {
|
|
7
|
+
const { defaultWidth = DEFAULT_WIDTH, maxWidth = MAX_WIDTH, minWidth = MIN_WIDTH, } = options;
|
|
8
|
+
const [sidePaneWidth, setSidePaneWidth] = useState(defaultWidth);
|
|
9
|
+
const prevWidthRef = useRef(sidePaneWidth);
|
|
10
|
+
const isActiveRef = useRef(false);
|
|
11
|
+
const { ref, isActive } = useMouseDownOffset(({ offsetX }) => {
|
|
12
|
+
const newWidth = prevWidthRef.current - offsetX;
|
|
13
|
+
setSidePaneWidth([maxWidth, newWidth, minWidth].sort((a, b) => a - b)[1]);
|
|
14
|
+
});
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
prevWidthRef.current = sidePaneWidth;
|
|
17
|
+
document.body.style.cursor = isActive ? 'col-resize' : '';
|
|
18
|
+
document.body.style.userSelect = isActive ? 'none' : 'auto';
|
|
19
|
+
if (isActiveRef.current && !isActive) {
|
|
20
|
+
options?.onDragEnd?.(sidePaneWidth);
|
|
21
|
+
}
|
|
22
|
+
isActiveRef.current = isActive;
|
|
23
|
+
}, [isActive]);
|
|
24
|
+
return {
|
|
25
|
+
sidePaneWidth,
|
|
26
|
+
containerRef: ref,
|
|
27
|
+
isActive,
|
|
28
|
+
};
|
|
51
29
|
};
|
|
52
|
-
|
|
53
|
-
0 && (module.exports = {
|
|
54
|
-
useDrag
|
|
55
|
-
});
|
|
30
|
+
//# sourceMappingURL=use-drag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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CAAC;QAC1D,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5D,IAAI,WAAW,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,OAAO,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,CAAC;QACtC,CAAC;QACD,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IACjC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO;QACL,aAAa;QACb,YAAY,EAAE,GAAG;QACjB,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface SchemaEditorProps {
|
|
2
|
+
value?: string;
|
|
3
|
+
readOnly?: boolean;
|
|
4
|
+
onChange?: (value?: string) => void;
|
|
5
|
+
language?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
showLineNumbs?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const SchemaEditor: ({ value, onChange, placeholder, readOnly, language, className, }: SchemaEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { CodeMirrorJsonEditor, CodeMirrorRawTextEditor, } from '../codemirror-editor';
|
|
4
|
+
export const SchemaEditor = ({ value, onChange, placeholder, readOnly, language, className, }) => (_jsx("div", { className: classNames('w-full h-[500px] border border-solid coz-stroke-primary rounded-[4px] overflow-hidden relative bg-white', { 'opacity-70': readOnly }, className), children: language === 'json' ? (_jsx(CodeMirrorJsonEditor, { className: "w-full h-full overflow-y-auto", onChange: onChange, value: value || '', placeholder: placeholder, readonly: readOnly, borderRadius: 4 })) : (_jsx(CodeMirrorRawTextEditor, { className: "w-full h-full overflow-y-auto", onChange: onChange, value: value || '', placeholder: placeholder, readonly: readOnly })) }));
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema-editor/index.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EACL,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAY9B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,GACS,EAAE,EAAE,CAAC,CACvB,cACE,SAAS,EAAE,UAAU,CACnB,yGAAyG,EACzG,EAAE,YAAY,EAAE,QAAQ,EAAE,EAC1B,SAAS,CACV,YAEA,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,CACrB,KAAC,oBAAoB,IACnB,SAAS,EAAC,+BAA+B,EACzC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,CAAC,GACf,CACH,CAAC,CAAC,CAAC,CACF,KAAC,uBAAuB,IACtB,SAAS,EAAC,+BAA+B,EACzC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,GAClB,CACH,GACG,CACP,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Form } from '@coze-arch/coze-design';
|
|
3
|
+
export type SearchFormFilterRecord = Record<string, any>;
|
|
4
|
+
export interface SearchFormRef {
|
|
5
|
+
getValues: () => SearchFormFilterRecord | undefined;
|
|
6
|
+
}
|
|
7
|
+
interface SearchFormProps {
|
|
8
|
+
className?: string;
|
|
9
|
+
children: any;
|
|
10
|
+
SemiForm: typeof Form;
|
|
11
|
+
onSearch?: (v: SearchFormFilterRecord) => Promise<any>;
|
|
12
|
+
initValue?: SearchFormFilterRecord;
|
|
13
|
+
}
|
|
14
|
+
export declare const SearchForm: React.ForwardRefExoticComponent<SearchFormProps & React.RefAttributes<SearchFormRef>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable security/detect-object-injection */
|
|
3
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
|
+
import { useSearchParams } from 'react-router-dom';
|
|
6
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef, useState, } from 'react';
|
|
7
|
+
import { omit } from 'lodash-es';
|
|
8
|
+
import { safeJsonParse } from '@cozeloop/toolkit';
|
|
9
|
+
/**
|
|
10
|
+
* 如果对象的value为对象,将 value 转换为字符串
|
|
11
|
+
* @param value
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
const stringifyObjectValue = (value) => Object.keys(value).reduce((acc, key) => {
|
|
15
|
+
const val = value[key];
|
|
16
|
+
if (typeof val === 'object') {
|
|
17
|
+
acc[key] = JSON.stringify(val);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
acc[key] = val;
|
|
21
|
+
}
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
const parseObjectValue = (data) => Object.keys(data).reduce((acc, key) => {
|
|
25
|
+
const value = data[key];
|
|
26
|
+
if (value.startsWith('{') || value.startsWith('[')) {
|
|
27
|
+
acc[key] = safeJsonParse(value) || value;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
acc[key] = value;
|
|
31
|
+
}
|
|
32
|
+
return acc;
|
|
33
|
+
}, {});
|
|
34
|
+
export const SearchForm = forwardRef(({ className, children, onSearch, SemiForm, initValue = {} }, ref) => {
|
|
35
|
+
const formRef = useRef(null);
|
|
36
|
+
const [initValueAndParams] = useState(() => {
|
|
37
|
+
const params = new URLSearchParams(window.location.search);
|
|
38
|
+
const initParams = {};
|
|
39
|
+
params.forEach((value, key) => {
|
|
40
|
+
initParams[key] = value;
|
|
41
|
+
});
|
|
42
|
+
const urlValues = parseObjectValue(initParams);
|
|
43
|
+
const defaultValue = { ...initValue, ...urlValues };
|
|
44
|
+
const defaultSearchParams = new URLSearchParams(stringifyObjectValue(defaultValue));
|
|
45
|
+
const filterValue = omit(defaultValue, ['page', 'pageSize']);
|
|
46
|
+
if (Object.keys(filterValue).length !== 0) {
|
|
47
|
+
onSearch?.(filterValue);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
defaultValue: filterValue,
|
|
51
|
+
defaultSearchParams,
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
55
|
+
const formValueChange = useCallback((allValues) => {
|
|
56
|
+
const searchResult = onSearch?.(allValues);
|
|
57
|
+
searchResult?.then(() => {
|
|
58
|
+
setSearchParams(prev => {
|
|
59
|
+
const v = stringifyObjectValue(allValues || {});
|
|
60
|
+
prev.forEach((_value, key) => {
|
|
61
|
+
if (!['page', 'pageSize', 'tab'].includes(key)) {
|
|
62
|
+
prev.delete(key);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
Object.keys(v).forEach(key => {
|
|
66
|
+
prev.set(key, v[key]);
|
|
67
|
+
});
|
|
68
|
+
return prev;
|
|
69
|
+
}, { replace: true });
|
|
70
|
+
});
|
|
71
|
+
}, [searchParams]);
|
|
72
|
+
useImperativeHandle(ref, () => ({
|
|
73
|
+
getValues: () => formRef.current?.formApi?.getValues?.(),
|
|
74
|
+
}));
|
|
75
|
+
return children ? (_jsx(SemiForm, { ref: formRef, initValues: initValueAndParams.defaultValue, onValueChange: formValueChange, layout: "horizontal", className: className, children: children })) : null;
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search-form/index.tsx"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,yDAAyD;AACzD,uDAAuD;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAc,EACZ,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAgBlD;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,CAAC,KAA0B,EAAE,EAAE,CAC1D,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CACvB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACX,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IACvB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IACjB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,EACD,EAAuC,CACxC,CAAC;AAEJ,MAAM,gBAAgB,GAAG,CAAC,IAA4B,EAAE,EAAE,CACxD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CACtB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACX,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,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EACZ,UAAU,EAAE,kBAAkB,CAAC,YAAY,EAC3C,aAAa,EAAE,eAAe,EAC9B,MAAM,EAAC,YAAY,EACnB,SAAS,EAAE,SAAS,YAEnB,QAAQ,GACA,CACZ,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ArrayFieldTemplateItemType, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
5
|
+
*/
|
|
6
|
+
export default function ArrayFieldItemTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: ArrayFieldTemplateItemType<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ButtonGroup, Col, Row } from '@coze-arch/coze-design';
|
|
3
|
+
const BTN_GRP_STYLE = {
|
|
4
|
+
width: '100%',
|
|
5
|
+
};
|
|
6
|
+
const BTN_STYLE = {
|
|
7
|
+
width: 'calc(100% / 4)',
|
|
8
|
+
};
|
|
9
|
+
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
10
|
+
*
|
|
11
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
12
|
+
*/
|
|
13
|
+
export default function ArrayFieldItemTemplate(props) {
|
|
14
|
+
const { children, disabled, hasCopy, hasMoveDown, hasMoveUp, hasRemove, hasToolbar, index, onCopyIndexClick, onDropIndexClick, onReorderClick, readonly, registry, uiSchema, } = props;
|
|
15
|
+
const { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } = registry.templates.ButtonTemplates;
|
|
16
|
+
const { rowGutter = 24, toolbarAlign = 'top' } = registry.formContext;
|
|
17
|
+
return (_jsxs(Row, { align: toolbarAlign, gutter: rowGutter, children: [_jsx(Col, { span: 18, children: children }), hasToolbar ? (_jsx(Col, { span: 6, children: _jsxs(ButtonGroup, { style: BTN_GRP_STYLE, children: [hasMoveUp || hasMoveDown ? (_jsx(MoveUpButton, { disabled: disabled || readonly || !hasMoveUp, onClick: onReorderClick(index, index - 1), style: BTN_STYLE, uiSchema: uiSchema, registry: registry })) : null, hasMoveUp || hasMoveDown ? (_jsx(MoveDownButton, { disabled: disabled || readonly || !hasMoveDown, onClick: onReorderClick(index, index + 1), style: BTN_STYLE, uiSchema: uiSchema, registry: registry })) : null, hasCopy ? (_jsx(CopyButton, { disabled: disabled || readonly, onClick: onCopyIndexClick(index), style: BTN_STYLE, uiSchema: uiSchema, registry: registry })) : null, hasRemove ? (_jsx(RemoveButton, { disabled: disabled || readonly, onClick: onDropIndexClick(index), style: BTN_STYLE, uiSchema: uiSchema, registry: registry })) : null] }) })) : null] }, `array-item-${index}`));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=array-field-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-field-item.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/array-field-item.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAI5C,KAA0C;IAC1C,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,QAAQ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S,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,EACP,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,YAAY,IACX,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAChC,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,IACI,GACV,CACP,CAAC,CAAC,CAAC,IAAI,KA5CqB,cAAc,KAAK,EAAE,CA6C9C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ArrayFieldTemplateProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
5
|
+
*/
|
|
6
|
+
export default function ArrayFieldTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: ArrayFieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { getTemplate, getUiOptions, } from '@rjsf/utils';
|
|
4
|
+
import { Col, Row } from '@coze-arch/coze-design';
|
|
5
|
+
// const DESCRIPTION_COL_STYLE = {
|
|
6
|
+
// paddingBottom: '8px',
|
|
7
|
+
// };
|
|
8
|
+
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
11
|
+
*/
|
|
12
|
+
export default function ArrayFieldTemplate(props) {
|
|
13
|
+
const { canAdd, className, disabled, formContext, idSchema, items, onAddClick, readonly, registry,
|
|
14
|
+
// required,
|
|
15
|
+
// schema,
|
|
16
|
+
// title,
|
|
17
|
+
uiSchema, } = props;
|
|
18
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
19
|
+
// const ArrayFieldDescriptionTemplate = getTemplate<
|
|
20
|
+
// 'ArrayFieldDescriptionTemplate',
|
|
21
|
+
// T,
|
|
22
|
+
// S,
|
|
23
|
+
// F
|
|
24
|
+
// >('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
25
|
+
const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
26
|
+
// const ArrayFieldTitleTemplate = getTemplate<
|
|
27
|
+
// 'ArrayFieldTitleTemplate',
|
|
28
|
+
// T,
|
|
29
|
+
// S,
|
|
30
|
+
// F
|
|
31
|
+
// >('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
32
|
+
// Button templates are not overridden in the uiSchema
|
|
33
|
+
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
34
|
+
const { rowGutter = 24 } = formContext;
|
|
35
|
+
return (_jsx("div", { className: cn('p-3 semi-card-bordered rounded-[4px]', className), id: idSchema.$id, children: _jsxs(Row, { gutter: rowGutter, children: [_jsx(Col, { className: "row array-item-list", span: 24, children: items
|
|
36
|
+
? items.map(({ key, ...itemProps }) => (_jsx(ArrayFieldItemTemplate, { ...itemProps }, key)))
|
|
37
|
+
: null }), canAdd ? (_jsx(Col, { span: 24, children: _jsx(Row, { gutter: rowGutter, justify: "end", children: _jsx(Col, { span: 6, children: _jsx(AddButton, { className: "array-item-add", disabled: disabled || readonly, onClick: onAddClick, uiSchema: uiSchema, registry: registry }) }) }) })) : null] }) }));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=array-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-field.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/array-field.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S,EACwB,EAAE,EAAE,CAAC,CACzC,KAAC,sBAAsB,OAAe,SAAS,IAAlB,GAAG,CAAmB,CACpD,CACF;wBACH,CAAC,CAAC,IAAI,GACJ,EAEL,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,GAAG,IAAC,IAAI,EAAE,EAAE,YACX,KAAC,GAAG,IAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAC,KAAK,YACnC,KAAC,GAAG,IAAC,IAAI,EAAE,CAAC,YACV,KAAC,SAAS,IACR,SAAS,EAAC,gBAAgB,EAC1B,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACE,GACF,GACF,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type BaseInputTemplateProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
3
|
+
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
4
|
+
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `WidgetProps` for this template
|
|
7
|
+
*/
|
|
8
|
+
export default function BaseInputTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: BaseInputTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ariaDescribedByIds, examplesId, getInputProps, } from '@rjsf/utils';
|
|
3
|
+
import { Input, CozInputNumber, } from '@coze-arch/coze-design';
|
|
4
|
+
const INPUT_STYLE = {
|
|
5
|
+
width: '100%',
|
|
6
|
+
};
|
|
7
|
+
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
8
|
+
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
9
|
+
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
10
|
+
*
|
|
11
|
+
* @param props - The `WidgetProps` for this template
|
|
12
|
+
*/
|
|
13
|
+
export default function BaseInputTemplate(props) {
|
|
14
|
+
const { disabled, formContext, id, onBlur, onChange, onChangeOverride, onFocus, options, placeholder, readonly, schema, value, type, } = props;
|
|
15
|
+
const { step, type: fieldType, ...inputProps } = getInputProps(schema, type, options, false);
|
|
16
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
17
|
+
const handleNumberChange = nextValue => onChange(nextValue);
|
|
18
|
+
const handleTextChange = (nextValue, e) => {
|
|
19
|
+
onChangeOverride
|
|
20
|
+
? onChangeOverride(e)
|
|
21
|
+
: onChange(nextValue === '' ? options.emptyValue : nextValue);
|
|
22
|
+
};
|
|
23
|
+
const handleBlur = ({ target }) => onBlur(id, target && target.value);
|
|
24
|
+
const handleFocus = ({ target }) => onFocus(id, target && target.value);
|
|
25
|
+
const input = fieldType === 'number' || fieldType === 'integer' ? (_jsx(CozInputNumber, { disabled: disabled || (readonlyAsDisabled && readonly), id: id, name: id, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleNumberChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, style: INPUT_STYLE, list: schema.examples ? examplesId(id) : undefined, ...inputProps, step: step, value: value, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) })) : (_jsx(Input, { disabled: disabled || (readonlyAsDisabled && readonly), id: id, name: id, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleTextChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, style: INPUT_STYLE, list: schema.examples ? examplesId(id) : undefined, ...inputProps, value: value, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) }));
|
|
26
|
+
return (_jsxs(_Fragment, { children: [input, Array.isArray(schema.examples) && (_jsx("datalist", { id: examplesId(id), children: schema.examples
|
|
27
|
+
.concat(schema.default && !schema.examples.includes(schema.default)
|
|
28
|
+
? [schema.default]
|
|
29
|
+
: [])
|
|
30
|
+
.map(example => (_jsx("option", { value: example }, example))) }))] }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=base-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-input.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/base-input.tsx"],"names":[],"mappings":";AAGA,OAAO,EACL,kBAAkB,EAElB,UAAU,EACV,aAAa,GAKd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,EACL,cAAc,GAGf,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,KAAsC;IACtC,MAAM,EACJ,QAAQ,EACR,WAAW,EACX,EAAE,EACF,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,WAAW,EACX,QAAQ,EACR,MAAM,EACN,KAAK,EACL,IAAI,GACL,GAAG,KAAK,CAAC;IACV,MAAM,EACJ,IAAI,EACJ,IAAI,EAAE,SAAS,EACf,GAAG,UAAU,EACd,GAAG,aAAa,CAAU,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAEzD,MAAM,EAAE,kBAAkB,GAAG,IAAI,EAAE,GAAG,WAAgC,CAAC;IAEvE,MAAM,kBAAkB,GAAiC,SAAS,CAAC,EAAE,CACnE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEtB,MAAM,gBAAgB,GAA2B,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE;QAChE,gBAAgB;YACd,CAAC,CAAC,gBAAgB,CAA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The `DescriptionField` is the template to use to render the description of a field
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `DescriptionFieldProps` for this component
|
|
5
|
+
*/
|
|
6
|
+
export default function DescriptionField<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: DescriptionFieldProps<T, S, F>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** The `DescriptionField` is the template to use to render the description of a field
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `DescriptionFieldProps` for this component
|
|
5
|
+
*/
|
|
6
|
+
export default function DescriptionField(props) {
|
|
7
|
+
const { id, description } = props;
|
|
8
|
+
if (!description) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return _jsx("span", { id: id, children: description });
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=description-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-field.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/description-field.tsx"],"names":[],"mappings":";AAOA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,KAAqC;IACrC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAElC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,eAAM,EAAE,EAAE,EAAE,YAAG,WAAW,GAAQ,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ErrorListProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `ErrorListProps` for this component
|
|
5
|
+
*/
|
|
6
|
+
export default function ErrorList<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>({ errors, registry }: ErrorListProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TranslatableString, } from '@rjsf/utils';
|
|
3
|
+
import { IconCozWarningCircle } from '@coze-arch/coze-design/icons';
|
|
4
|
+
import { Banner, List, Space } from '@coze-arch/coze-design';
|
|
5
|
+
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `ErrorListProps` for this component
|
|
8
|
+
*/
|
|
9
|
+
export default function ErrorList({ errors, registry }) {
|
|
10
|
+
const { translateString } = registry;
|
|
11
|
+
const renderErrors = () => (_jsx(List, { className: "list-group", size: "small", children: errors.map((error, index) => (_jsx(List.Item, { children: _jsxs(Space, { children: [_jsx(IconCozWarningCircle, {}), error.stack] }) }, index))) }));
|
|
12
|
+
return (_jsx(Banner, { type: "danger", className: "panel panel-danger errors", title: translateString(TranslatableString.ErrorsLabel), description: renderErrors() }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=error-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-list.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/error-list.tsx"],"names":[],"mappings":";AAEA,OAAO,EAKL,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAI/B,EAAE,MAAM,EAAE,QAAQ,EAA2B;IAC7C,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,CACzB,KAAC,IAAI,IAAC,SAAS,EAAC,YAAY,EAAC,IAAI,EAAC,OAAO,YACtC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,KAAC,IAAI,CAAC,IAAI,cACR,MAAC,KAAK,eACJ,KAAC,oBAAoB,KAAG,EACvB,KAAK,CAAC,KAAK,IACN,IAJM,KAAK,CAKT,CACb,CAAC,GACG,CACR,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,2BAA2B,EACrC,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,WAAW,CAAC,EACtD,WAAW,EAAE,YAAY,EAAE,GAC3B,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type FieldErrorProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
5
|
+
*/
|
|
6
|
+
export default function FieldErrorTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: FieldErrorProps<T, S, F>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { errorId, } from '@rjsf/utils';
|
|
3
|
+
import { Form } from '@coze-arch/coze-design';
|
|
4
|
+
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
7
|
+
*/
|
|
8
|
+
export default function FieldErrorTemplate(props) {
|
|
9
|
+
const { errors = [], idSchema } = props;
|
|
10
|
+
if (errors.length === 0) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const id = errorId(idSchema);
|
|
14
|
+
return (_jsx("div", { id: id, children: errors.map(error => (_jsx(Form.ErrorMessage, { error: error }, `field-${id}-error-${error}`))) }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=field-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-error.js","sourceRoot":"","sources":["../../../../../src/semi-schema-form/components/tmpls/field-error.tsx"],"names":[],"mappings":";AACA,OAAO,EAKL,OAAO,GACR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAA+B;IAC/B,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,CAAI,QAAQ,CAAC,CAAC;IAEhC,OAAO,CACL,cAAK,EAAE,EAAE,EAAE,YACR,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACnB,KAAC,IAAI,CAAC,YAAY,IAAoC,KAAK,EAAE,KAAK,IAA1C,SAAS,EAAE,UAAU,KAAK,EAAE,CAAkB,CACvE,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FieldTemplateProps, type FormContextType, type RJSFSchema, type StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
3
|
+
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `FieldTemplateProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function FieldTemplate<T = unknown, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = object>(props: FieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|