@cozeloop/components 0.0.3 → 0.0.4-beta-1770694681364
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/dist/es/index.css +13 -29
- package/dist/es/{index.js → index.mjs} +562 -518
- package/dist/es/loopIcons.mjs +3 -0
- package/dist/es/rslib-runtime.mjs +40 -0
- package/dist/lib/base-search-select/base-search-select.d.ts +4 -1
- package/dist/lib/base-search-select/index.d.ts +1 -1
- package/dist/lib/base-search-select/types.d.ts +1 -1
- package/dist/lib/code-editor-with-loading/index.d.ts +10 -0
- package/dist/lib/codemirror-editor/code-editor.d.ts +23 -2
- package/dist/lib/codemirror-editor/index.d.ts +2 -0
- package/dist/lib/codemirror-editor/json-editor.d.ts +1 -1
- package/dist/lib/codemirror-editor/raw-code-editor.d.ts +20 -0
- package/dist/lib/codemirror-editor/text-editor.d.ts +23 -2
- package/dist/lib/collapse-card/index.d.ts +2 -1
- package/dist/lib/collapse-item/index.d.ts +7 -0
- package/dist/lib/copyable/index.d.ts +5 -0
- package/dist/lib/hooks/use-unsave-leave-warning.d.ts +4 -1
- package/dist/lib/index.d.ts +7 -6
- package/dist/lib/large-txt-render/index.d.ts +1 -0
- package/dist/lib/logic-editor/logic-editor.d.ts +2 -4
- package/dist/lib/logic-editor/logic-types.d.ts +6 -2
- package/dist/lib/loop-icons/index.d.ts +1 -0
- package/dist/lib/multi-part-editor/type.d.ts +1 -1
- package/dist/lib/primary-page/primary-header.d.ts +2 -1
- package/dist/lib/table/sort-icon.d.ts +3 -3
- package/dist/lib/table-col-actions/index.d.ts +2 -0
- package/package.json +36 -28
- package/.eslintcache +0 -1
- package/.rush/temp/shrinkwrap-deps.json +0 -770
- package/OWNERS +0 -5
- package/config/rush-project.json +0 -8
- package/dist/lib/base-search-select/base-search-form-select.js +0 -6
- package/dist/lib/base-search-select/base-search-form-select.js.map +0 -1
- package/dist/lib/base-search-select/base-search-select.js +0 -127
- package/dist/lib/base-search-select/base-search-select.js.map +0 -1
- package/dist/lib/base-search-select/index.js +0 -3
- package/dist/lib/base-search-select/index.js.map +0 -1
- package/dist/lib/base-search-select/types.js +0 -2
- package/dist/lib/base-search-select/types.js.map +0 -1
- package/dist/lib/base-search-select/utils.js +0 -48
- package/dist/lib/base-search-select/utils.js.map +0 -1
- package/dist/lib/basic-card/index.js +0 -4
- package/dist/lib/basic-card/index.js.map +0 -1
- package/dist/lib/card-pane/index.js +0 -9
- package/dist/lib/card-pane/index.js.map +0 -1
- package/dist/lib/chip-select/index.js +0 -6
- package/dist/lib/chip-select/index.js.map +0 -1
- package/dist/lib/code-editor/index.js +0 -7
- package/dist/lib/code-editor/index.js.map +0 -1
- package/dist/lib/code-usage/index.d.ts +0 -14
- package/dist/lib/code-usage/index.js +0 -31
- package/dist/lib/code-usage/index.js.map +0 -1
- package/dist/lib/codemirror-editor/code-editor.js +0 -108
- package/dist/lib/codemirror-editor/code-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/index.js +0 -5
- package/dist/lib/codemirror-editor/index.js.map +0 -1
- package/dist/lib/codemirror-editor/json-editor.js +0 -97
- package/dist/lib/codemirror-editor/json-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/raw-text-editor.js +0 -32
- package/dist/lib/codemirror-editor/raw-text-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/text-editor.js +0 -44
- package/dist/lib/codemirror-editor/text-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/themes/coze-dark.js +0 -113
- package/dist/lib/codemirror-editor/themes/coze-dark.js.map +0 -1
- package/dist/lib/codemirror-editor/themes/coze-light.js +0 -119
- package/dist/lib/codemirror-editor/themes/coze-light.js.map +0 -1
- package/dist/lib/collapse-card/index.js +0 -31
- package/dist/lib/collapse-card/index.js.map +0 -1
- package/dist/lib/collapsible-card/index.js +0 -13
- package/dist/lib/collapsible-card/index.js.map +0 -1
- package/dist/lib/column-manage-storage/index.js +0 -48
- package/dist/lib/column-manage-storage/index.js.map +0 -1
- package/dist/lib/columns-select/index.js +0 -77
- package/dist/lib/columns-select/index.js.map +0 -1
- package/dist/lib/edit-icon-button/index.js +0 -13
- package/dist/lib/edit-icon-button/index.js.map +0 -1
- package/dist/lib/footer-actions/index.js +0 -9
- package/dist/lib/footer-actions/index.js.map +0 -1
- package/dist/lib/hooks/use-infinite-scroll.js +0 -133
- package/dist/lib/hooks/use-infinite-scroll.js.map +0 -1
- package/dist/lib/hooks/use-mouse-down-offset.js +0 -39
- package/dist/lib/hooks/use-mouse-down-offset.js.map +0 -1
- package/dist/lib/hooks/use-unsave-leave-warning.js +0 -33
- package/dist/lib/hooks/use-unsave-leave-warning.js.map +0 -1
- package/dist/lib/id-render/icon-button-container.js +0 -8
- package/dist/lib/id-render/icon-button-container.js.map +0 -1
- package/dist/lib/id-render/index.js +0 -21
- package/dist/lib/id-render/index.js.map +0 -1
- package/dist/lib/index-controller/record-navigation.js +0 -9
- package/dist/lib/index-controller/record-navigation.js.map +0 -1
- package/dist/lib/index-controller/use-item-index-controller.js +0 -123
- package/dist/lib/index-controller/use-item-index-controller.js.map +0 -1
- package/dist/lib/index.js +0 -76
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/infinite-scroll-table/index.js +0 -34
- package/dist/lib/infinite-scroll-table/index.js.map +0 -1
- package/dist/lib/info-tooltip/index.js +0 -9
- package/dist/lib/info-tooltip/index.js.map +0 -1
- package/dist/lib/input-components/radio-button.js +0 -21
- package/dist/lib/input-components/radio-button.js.map +0 -1
- package/dist/lib/input-slider/index.js +0 -81
- package/dist/lib/input-slider/index.js.map +0 -1
- package/dist/lib/input-with-count/index.js +0 -7
- package/dist/lib/input-with-count/index.js.map +0 -1
- package/dist/lib/jump-button/jump-icon-button.js +0 -7
- package/dist/lib/jump-button/jump-icon-button.js.map +0 -1
- package/dist/lib/large-txt-render/index.js +0 -26
- package/dist/lib/large-txt-render/index.js.map +0 -1
- package/dist/lib/layout/content.js +0 -5
- package/dist/lib/layout/content.js.map +0 -1
- package/dist/lib/layout/header.js +0 -6
- package/dist/lib/layout/header.js.map +0 -1
- package/dist/lib/layout/index.js +0 -9
- package/dist/lib/layout/index.js.map +0 -1
- package/dist/lib/layout/tabs.js +0 -10
- package/dist/lib/layout/tabs.js.map +0 -1
- package/dist/lib/lazy-load-component/index.js +0 -42
- package/dist/lib/lazy-load-component/index.js.map +0 -1
- package/dist/lib/logic-editor/index.js +0 -3
- package/dist/lib/logic-editor/index.js.map +0 -1
- package/dist/lib/logic-editor/logic-editor.js +0 -69
- package/dist/lib/logic-editor/logic-editor.js.map +0 -1
- package/dist/lib/logic-editor/logic-left-render.js +0 -60
- package/dist/lib/logic-editor/logic-left-render.js.map +0 -1
- package/dist/lib/logic-editor/logic-operator-render.js +0 -29
- package/dist/lib/logic-editor/logic-operator-render.js.map +0 -1
- package/dist/lib/logic-editor/logic-right-render.js +0 -25
- package/dist/lib/logic-editor/logic-right-render.js.map +0 -1
- package/dist/lib/logic-editor/logic-types.js +0 -136
- package/dist/lib/logic-editor/logic-types.js.map +0 -1
- package/dist/lib/logic-editor/utils.js +0 -18
- package/dist/lib/logic-editor/utils.js.map +0 -1
- package/dist/lib/logic-expr/consts.js +0 -5
- package/dist/lib/logic-expr/consts.js.map +0 -1
- package/dist/lib/logic-expr/expr-group-render.js +0 -61
- package/dist/lib/logic-expr/expr-group-render.js.map +0 -1
- package/dist/lib/logic-expr/expr-render.js +0 -85
- package/dist/lib/logic-expr/expr-render.js.map +0 -1
- package/dist/lib/logic-expr/index.js +0 -2
- package/dist/lib/logic-expr/index.js.map +0 -1
- package/dist/lib/logic-expr/logic-expr.js +0 -187
- package/dist/lib/logic-expr/logic-expr.js.map +0 -1
- package/dist/lib/logic-expr/logic-not.js +0 -21
- package/dist/lib/logic-expr/logic-not.js.map +0 -1
- package/dist/lib/logic-expr/logic-toggle.js +0 -33
- package/dist/lib/logic-expr/logic-toggle.js.map +0 -1
- package/dist/lib/logic-expr/types.js +0 -2
- package/dist/lib/logic-expr/types.js.map +0 -1
- package/dist/lib/loop-radio-group/index.js +0 -7
- package/dist/lib/loop-radio-group/index.js.map +0 -1
- package/dist/lib/multi-part-editor/components/image-item-renderer.js +0 -57
- package/dist/lib/multi-part-editor/components/image-item-renderer.js.map +0 -1
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js +0 -25
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js.map +0 -1
- package/dist/lib/multi-part-editor/components/url-input-modal.js +0 -150
- package/dist/lib/multi-part-editor/components/url-input-modal.js.map +0 -1
- package/dist/lib/multi-part-editor/components/video-item-renderer.js +0 -57
- package/dist/lib/multi-part-editor/components/video-item-renderer.js.map +0 -1
- package/dist/lib/multi-part-editor/index.js +0 -300
- package/dist/lib/multi-part-editor/index.js.map +0 -1
- package/dist/lib/multi-part-editor/multi-part-render.js +0 -40
- package/dist/lib/multi-part-editor/multi-part-render.js.map +0 -1
- package/dist/lib/multi-part-editor/type.js +0 -25
- package/dist/lib/multi-part-editor/type.js.map +0 -1
- package/dist/lib/multi-part-editor/upload-button.js +0 -103
- package/dist/lib/multi-part-editor/upload-button.js.map +0 -1
- package/dist/lib/multi-part-editor/utils.js +0 -43
- package/dist/lib/multi-part-editor/utils.js.map +0 -1
- package/dist/lib/open-detail-button/index.js +0 -11
- package/dist/lib/open-detail-button/index.js.map +0 -1
- package/dist/lib/page-content/index.js +0 -23
- package/dist/lib/page-content/index.js.map +0 -1
- package/dist/lib/primary-page/index.js +0 -2
- package/dist/lib/primary-page/index.js.map +0 -1
- package/dist/lib/primary-page/primary-header.js +0 -4
- package/dist/lib/primary-page/primary-header.js.map +0 -1
- package/dist/lib/primary-title/index.js +0 -8
- package/dist/lib/primary-title/index.js.map +0 -1
- package/dist/lib/provider/index.d.ts +0 -18
- package/dist/lib/provider/index.js +0 -43
- package/dist/lib/provider/index.js.map +0 -1
- package/dist/lib/resizable-side-sheet/index.js +0 -32
- package/dist/lib/resizable-side-sheet/index.js.map +0 -1
- package/dist/lib/resize-sidesheet/index.js +0 -15
- package/dist/lib/resize-sidesheet/index.js.map +0 -1
- package/dist/lib/resize-sidesheet/use-drag.js +0 -30
- package/dist/lib/resize-sidesheet/use-drag.js.map +0 -1
- package/dist/lib/schema-editor/index.js +0 -5
- package/dist/lib/schema-editor/index.js.map +0 -1
- package/dist/lib/search-form/index.d.ts +0 -15
- package/dist/lib/search-form/index.js +0 -77
- package/dist/lib/search-form/index.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js +0 -19
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js +0 -39
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js +0 -32
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js +0 -13
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js +0 -14
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js +0 -16
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/field.js +0 -21
- package/dist/lib/semi-schema-form/components/tmpls/field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js +0 -29
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/index.js +0 -31
- package/dist/lib/semi-schema-form/components/tmpls/index.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js +0 -81
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/submit.js +0 -13
- package/dist/lib/semi-schema-form/components/tmpls/submit.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js +0 -12
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js +0 -26
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js +0 -27
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/index.js +0 -15
- package/dist/lib/semi-schema-form/components/widgets/index.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/radio.js +0 -27
- package/dist/lib/semi-schema-form/components/widgets/radio.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/range.js +0 -26
- package/dist/lib/semi-schema-form/components/widgets/range.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/select.js +0 -44
- package/dist/lib/semi-schema-form/components/widgets/select.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/textarea.js +0 -18
- package/dist/lib/semi-schema-form/components/widgets/textarea.js.map +0 -1
- package/dist/lib/semi-schema-form/index.js +0 -9
- package/dist/lib/semi-schema-form/index.js.map +0 -1
- package/dist/lib/sentinel-form/enum.js +0 -15
- package/dist/lib/sentinel-form/enum.js.map +0 -1
- package/dist/lib/sentinel-form/index.js +0 -289
- package/dist/lib/sentinel-form/index.js.map +0 -1
- package/dist/lib/step-nav/index.js +0 -13
- package/dist/lib/step-nav/index.js.map +0 -1
- package/dist/lib/table/index.js +0 -6
- package/dist/lib/table/index.js.map +0 -1
- package/dist/lib/table/sort-icon.js +0 -30
- package/dist/lib/table/sort-icon.js.map +0 -1
- package/dist/lib/table/table-with-pagination.js +0 -74
- package/dist/lib/table/table-with-pagination.js.map +0 -1
- package/dist/lib/table/table-without-pagniation.js +0 -37
- package/dist/lib/table/table-without-pagniation.js.map +0 -1
- package/dist/lib/table-batch-operate/table-batch-operation.js +0 -14
- package/dist/lib/table-batch-operate/table-batch-operation.js.map +0 -1
- package/dist/lib/table-batch-operate/use-batch-operate.js +0 -71
- package/dist/lib/table-batch-operate/use-batch-operate.js.map +0 -1
- package/dist/lib/table-col-actions/index.js +0 -35
- package/dist/lib/table-col-actions/index.js.map +0 -1
- package/dist/lib/table-cols-config/index.js +0 -57
- package/dist/lib/table-cols-config/index.js.map +0 -1
- package/dist/lib/table-cols-config/type.js +0 -2
- package/dist/lib/table-cols-config/type.js.map +0 -1
- package/dist/lib/table-cols-config/use-hidden-col-keys.js +0 -32
- package/dist/lib/table-cols-config/use-hidden-col-keys.js.map +0 -1
- package/dist/lib/table-cols-config/util.js +0 -39
- package/dist/lib/table-cols-config/util.js.map +0 -1
- package/dist/lib/table-empty/index.js +0 -10
- package/dist/lib/table-empty/index.js.map +0 -1
- package/dist/lib/table-header/index.js +0 -11
- package/dist/lib/table-header/index.js.map +0 -1
- package/dist/lib/tabs/index.js +0 -9
- package/dist/lib/tabs/index.js.map +0 -1
- package/dist/lib/text-area-pro/index.js +0 -10
- package/dist/lib/text-area-pro/index.js.map +0 -1
- package/dist/lib/text-with-copy/index.js +0 -24
- package/dist/lib/text-with-copy/index.js.map +0 -1
- package/dist/lib/title-with-sub/index.js +0 -6
- package/dist/lib/title-with-sub/index.js.map +0 -1
- package/dist/lib/tooltip-when-disabled/index.js +0 -9
- package/dist/lib/tooltip-when-disabled/index.js.map +0 -1
- package/dist/lib/tooltip-with-disabled/index.js +0 -9
- package/dist/lib/tooltip-with-disabled/index.js.map +0 -1
- package/dist/lib/tsconfig.build.tsbuildinfo +0 -1
- package/dist/lib/upload/index.js +0 -25
- package/dist/lib/upload/index.js.map +0 -1
- package/dist/lib/user-profile/index.js +0 -21
- package/dist/lib/user-profile/index.js.map +0 -1
- package/dist/lib/utils/basic.js +0 -29
- package/dist/lib/utils/basic.js.map +0 -1
- package/dist/lib/version-list/version-descriptions.js +0 -14
- package/dist/lib/version-list/version-descriptions.js.map +0 -1
- package/dist/lib/version-list/version-item.js +0 -6
- package/dist/lib/version-list/version-item.js.map +0 -1
- package/dist/lib/version-list/version-list.js +0 -11
- package/dist/lib/version-list/version-list.js.map +0 -1
- package/dist/lib/version-list/version-switch-panel.js +0 -10
- package/dist/lib/version-list/version-switch-panel.js.map +0 -1
- package/eslint.config.js +0 -7
- package/rslib.config.js +0 -7
- package/script/publish.js +0 -146
- package/src/base-search-select/base-search-form-select.tsx +0 -10
- package/src/base-search-select/base-search-select.tsx +0 -200
- package/src/base-search-select/index.module.less +0 -16
- package/src/base-search-select/index.tsx +0 -3
- package/src/base-search-select/types.ts +0 -16
- package/src/base-search-select/utils.ts +0 -78
- package/src/basic-card/index.tsx +0 -23
- package/src/card-pane/index.module.less +0 -14
- package/src/card-pane/index.tsx +0 -25
- package/src/chip-select/index.module.less +0 -17
- package/src/chip-select/index.tsx +0 -7
- package/src/code-editor/index.tsx +0 -9
- package/src/code-usage/code-item.module.less +0 -32
- package/src/code-usage/index.tsx +0 -91
- package/src/codemirror-editor/code-editor.tsx +0 -139
- package/src/codemirror-editor/index.ts +0 -4
- package/src/codemirror-editor/json-editor.tsx +0 -183
- package/src/codemirror-editor/raw-text-editor.tsx +0 -68
- package/src/codemirror-editor/text-editor.tsx +0 -58
- package/src/codemirror-editor/themes/coze-dark.ts +0 -116
- package/src/codemirror-editor/themes/coze-light.ts +0 -122
- package/src/collapse-card/index.module.less +0 -27
- package/src/collapse-card/index.tsx +0 -93
- package/src/collapsible-card/index.module.less +0 -63
- package/src/collapsible-card/index.tsx +0 -57
- package/src/column-manage-storage/index.tsx +0 -64
- package/src/columns-select/index.tsx +0 -244
- package/src/edit-icon-button/index.tsx +0 -36
- package/src/footer-actions/index.tsx +0 -33
- package/src/hooks/use-infinite-scroll.ts +0 -183
- package/src/hooks/use-mouse-down-offset.ts +0 -50
- package/src/hooks/use-unsave-leave-warning.ts +0 -49
- package/src/id-render/icon-button-container.tsx +0 -37
- package/src/id-render/index.tsx +0 -64
- package/src/index-controller/record-navigation.tsx +0 -57
- package/src/index-controller/use-item-index-controller.ts +0 -197
- package/src/index.ts +0 -208
- package/src/infinite-scroll-table/index.tsx +0 -99
- package/src/info-tooltip/index.tsx +0 -41
- package/src/input-components/radio-button.tsx +0 -63
- package/src/input-slider/index.module.less +0 -30
- package/src/input-slider/index.tsx +0 -161
- package/src/input-with-count/index.tsx +0 -31
- package/src/jump-button/jump-icon-button.tsx +0 -12
- package/src/large-txt-render/index.tsx +0 -46
- package/src/layout/content.tsx +0 -28
- package/src/layout/header.tsx +0 -15
- package/src/layout/index.module.less +0 -28
- package/src/layout/index.tsx +0 -9
- package/src/layout/tabs.tsx +0 -11
- package/src/lazy-load-component/index.tsx +0 -55
- package/src/logic-editor/index.ts +0 -3
- package/src/logic-editor/logic-editor.module.less +0 -13
- package/src/logic-editor/logic-editor.tsx +0 -200
- package/src/logic-editor/logic-left-render.tsx +0 -100
- package/src/logic-editor/logic-operator-render.tsx +0 -54
- package/src/logic-editor/logic-right-render.tsx +0 -51
- package/src/logic-editor/logic-types.tsx +0 -238
- package/src/logic-editor/utils.ts +0 -22
- package/src/logic-expr/assets/select.svg +0 -1
- package/src/logic-expr/consts.ts +0 -6
- package/src/logic-expr/expr-group-render.tsx +0 -238
- package/src/logic-expr/expr-render.tsx +0 -226
- package/src/logic-expr/index.module.less +0 -252
- package/src/logic-expr/index.ts +0 -13
- package/src/logic-expr/logic-expr.tsx +0 -261
- package/src/logic-expr/logic-not.tsx +0 -46
- package/src/logic-expr/logic-toggle.tsx +0 -96
- package/src/logic-expr/types.ts +0 -95
- package/src/loop-radio-group/index.tsx +0 -16
- package/src/multi-part-editor/components/image-item-renderer.tsx +0 -134
- package/src/multi-part-editor/components/index.module.less +0 -21
- package/src/multi-part-editor/components/multipart-item-renderer.tsx +0 -74
- package/src/multi-part-editor/components/url-input-modal.tsx +0 -317
- package/src/multi-part-editor/components/video-item-renderer.tsx +0 -145
- package/src/multi-part-editor/index.module.less +0 -8
- package/src/multi-part-editor/index.tsx +0 -571
- package/src/multi-part-editor/multi-part-render.tsx +0 -87
- package/src/multi-part-editor/type.tsx +0 -103
- package/src/multi-part-editor/upload-button.tsx +0 -256
- package/src/multi-part-editor/utils.ts +0 -64
- package/src/open-detail-button/index.tsx +0 -30
- package/src/page-content/index.tsx +0 -99
- package/src/primary-page/index.tsx +0 -1
- package/src/primary-page/primary-header.tsx +0 -64
- package/src/primary-title/index.module.less +0 -14
- package/src/primary-title/index.tsx +0 -18
- package/src/provider/index.tsx +0 -89
- package/src/resizable-side-sheet/index.tsx +0 -69
- package/src/resize-sidesheet/index.module.less +0 -14
- package/src/resize-sidesheet/index.tsx +0 -68
- package/src/resize-sidesheet/use-drag.ts +0 -43
- package/src/schema-editor/index.tsx +0 -52
- package/src/search-form/index.tsx +0 -134
- package/src/semi-schema-form/components/tmpls/array-field-item.tsx +0 -97
- package/src/semi-schema-form/components/tmpls/array-field.tsx +0 -127
- package/src/semi-schema-form/components/tmpls/base-input.tsx +0 -126
- package/src/semi-schema-form/components/tmpls/description-field.tsx +0 -23
- package/src/semi-schema-form/components/tmpls/error-list.tsx +0 -44
- package/src/semi-schema-form/components/tmpls/field-error.tsx +0 -33
- package/src/semi-schema-form/components/tmpls/field.tsx +0 -54
- package/src/semi-schema-form/components/tmpls/icon-button.tsx +0 -112
- package/src/semi-schema-form/components/tmpls/index.ts +0 -39
- package/src/semi-schema-form/components/tmpls/object-field.tsx +0 -173
- package/src/semi-schema-form/components/tmpls/submit.tsx +0 -31
- package/src/semi-schema-form/components/tmpls/title-field.tsx +0 -30
- package/src/semi-schema-form/components/widgets/checkbox.tsx +0 -67
- package/src/semi-schema-form/components/widgets/checkboxs.tsx +0 -100
- package/src/semi-schema-form/components/widgets/index.ts +0 -17
- package/src/semi-schema-form/components/widgets/radio.tsx +0 -105
- package/src/semi-schema-form/components/widgets/range.tsx +0 -73
- package/src/semi-schema-form/components/widgets/select.tsx +0 -108
- package/src/semi-schema-form/components/widgets/textarea.tsx +0 -63
- package/src/semi-schema-form/index.tsx +0 -14
- package/src/sentinel-form/enum.ts +0 -16
- package/src/sentinel-form/index.tsx +0 -382
- package/src/step-nav/index.module.less +0 -45
- package/src/step-nav/index.tsx +0 -53
- package/src/table/index.module.less +0 -144
- package/src/table/index.tsx +0 -18
- package/src/table/sort-icon.tsx +0 -73
- package/src/table/table-with-pagination.tsx +0 -150
- package/src/table/table-without-pagniation.tsx +0 -66
- package/src/table-batch-operate/table-batch-operation.tsx +0 -47
- package/src/table-batch-operate/use-batch-operate.ts +0 -111
- package/src/table-col-actions/index.module.less +0 -8
- package/src/table-col-actions/index.tsx +0 -149
- package/src/table-cols-config/index.module.less +0 -34
- package/src/table-cols-config/index.tsx +0 -171
- package/src/table-cols-config/type.ts +0 -12
- package/src/table-cols-config/use-hidden-col-keys.ts +0 -53
- package/src/table-cols-config/util.ts +0 -56
- package/src/table-empty/index.tsx +0 -23
- package/src/table-header/index.module.less +0 -7
- package/src/table-header/index.tsx +0 -70
- package/src/tabs/index.module.less +0 -48
- package/src/tabs/index.tsx +0 -9
- package/src/text-area-pro/index.module.less +0 -5
- package/src/text-area-pro/index.tsx +0 -49
- package/src/text-with-copy/index.tsx +0 -95
- package/src/title-with-sub/index.tsx +0 -27
- package/src/tooltip-when-disabled/index.tsx +0 -23
- package/src/tooltip-with-disabled/index.tsx +0 -17
- package/src/types.d.ts +0 -24
- package/src/upload/index.ts +0 -39
- package/src/user-profile/index.tsx +0 -49
- package/src/utils/basic.ts +0 -29
- package/src/version-list/index.module.less +0 -16
- package/src/version-list/version-descriptions.tsx +0 -80
- package/src/version-list/version-item.tsx +0 -30
- package/src/version-list/version-list.tsx +0 -59
- package/src/version-list/version-switch-panel.tsx +0 -31
- package/tailwind.config.ts +0 -6
- package/tsconfig.build.json +0 -44
- package/tsconfig.json +0 -17
- package/tsconfig.misc.json +0 -28
- package/vitest.config.mts +0 -7
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React, { type FocusEvent } from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ariaDescribedByIds,
|
|
5
|
-
// labelValue,
|
|
6
|
-
type FormContextType,
|
|
7
|
-
type RJSFSchema,
|
|
8
|
-
type StrictRJSFSchema,
|
|
9
|
-
type WidgetProps,
|
|
10
|
-
type GenericObjectType,
|
|
11
|
-
} from '@rjsf/utils';
|
|
12
|
-
import { Checkbox, type CheckboxProps } from '@coze-arch/coze-design';
|
|
13
|
-
|
|
14
|
-
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
|
|
15
|
-
* It is typically used to represent a boolean.
|
|
16
|
-
*
|
|
17
|
-
* @param props - The `WidgetProps` for this component
|
|
18
|
-
*/
|
|
19
|
-
export default function CheckboxWidget<
|
|
20
|
-
T = unknown,
|
|
21
|
-
S extends StrictRJSFSchema = RJSFSchema,
|
|
22
|
-
F extends FormContextType = object,
|
|
23
|
-
>(props: WidgetProps<T, S, F>) {
|
|
24
|
-
const {
|
|
25
|
-
autofocus,
|
|
26
|
-
disabled,
|
|
27
|
-
formContext,
|
|
28
|
-
id,
|
|
29
|
-
// label,
|
|
30
|
-
// hideLabel,
|
|
31
|
-
onBlur,
|
|
32
|
-
onChange,
|
|
33
|
-
onFocus,
|
|
34
|
-
readonly,
|
|
35
|
-
value,
|
|
36
|
-
} = props;
|
|
37
|
-
const { readonlyAsDisabled = true } = formContext as GenericObjectType;
|
|
38
|
-
|
|
39
|
-
const handleChange: CheckboxProps['onChange'] = ({ target }) =>
|
|
40
|
-
onChange(target.checked);
|
|
41
|
-
|
|
42
|
-
const handleBlur = ({ target }: FocusEvent<HTMLInputElement>) =>
|
|
43
|
-
onBlur(id, target && target.checked);
|
|
44
|
-
|
|
45
|
-
const handleFocus = ({ target }: FocusEvent<HTMLInputElement>) =>
|
|
46
|
-
onFocus(id, target && target.checked);
|
|
47
|
-
|
|
48
|
-
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
49
|
-
// they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
|
|
50
|
-
const extraProps = {
|
|
51
|
-
onBlur: !readonly ? handleBlur : undefined,
|
|
52
|
-
onFocus: !readonly ? handleFocus : undefined,
|
|
53
|
-
};
|
|
54
|
-
return (
|
|
55
|
-
<Checkbox
|
|
56
|
-
autoFocus={autofocus}
|
|
57
|
-
checked={typeof value === 'undefined' ? false : value}
|
|
58
|
-
disabled={disabled || (readonlyAsDisabled && readonly)}
|
|
59
|
-
id={id}
|
|
60
|
-
onChange={!readonly ? handleChange : undefined}
|
|
61
|
-
{...extraProps}
|
|
62
|
-
aria-describedby={ariaDescribedByIds<T>(id)}
|
|
63
|
-
>
|
|
64
|
-
{/* {labelValue(label, hideLabel, '')} */}
|
|
65
|
-
</Checkbox>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import React, { type FocusEvent } from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ariaDescribedByIds,
|
|
5
|
-
enumOptionsIndexForValue,
|
|
6
|
-
enumOptionsValueForIndex,
|
|
7
|
-
optionId,
|
|
8
|
-
type FormContextType,
|
|
9
|
-
type WidgetProps,
|
|
10
|
-
type RJSFSchema,
|
|
11
|
-
type StrictRJSFSchema,
|
|
12
|
-
type GenericObjectType,
|
|
13
|
-
} from '@rjsf/utils';
|
|
14
|
-
import { Checkbox, type CheckboxGroupProps } from '@coze-arch/coze-design';
|
|
15
|
-
|
|
16
|
-
/** The `CheckboxesWidget` is a widget for rendering checkbox groups.
|
|
17
|
-
* It is typically used to represent an array of enums.
|
|
18
|
-
*
|
|
19
|
-
* @param props - The `WidgetProps` for this component
|
|
20
|
-
*/
|
|
21
|
-
export default function CheckboxesWidget<
|
|
22
|
-
T = unknown,
|
|
23
|
-
S extends StrictRJSFSchema = RJSFSchema,
|
|
24
|
-
F extends FormContextType = object,
|
|
25
|
-
>({
|
|
26
|
-
autofocus,
|
|
27
|
-
disabled,
|
|
28
|
-
formContext,
|
|
29
|
-
id,
|
|
30
|
-
onBlur,
|
|
31
|
-
onChange,
|
|
32
|
-
onFocus,
|
|
33
|
-
options,
|
|
34
|
-
readonly,
|
|
35
|
-
value,
|
|
36
|
-
}: WidgetProps<T, S, F>) {
|
|
37
|
-
const { readonlyAsDisabled = true } = formContext as GenericObjectType;
|
|
38
|
-
|
|
39
|
-
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
40
|
-
|
|
41
|
-
const handleChange: CheckboxGroupProps['onChange'] = nextValue =>
|
|
42
|
-
onChange(enumOptionsValueForIndex<S>(nextValue, enumOptions, emptyValue));
|
|
43
|
-
|
|
44
|
-
const handleBlur = ({ target }: FocusEvent<HTMLInputElement>) =>
|
|
45
|
-
onBlur(
|
|
46
|
-
id,
|
|
47
|
-
enumOptionsValueForIndex<S>(target.value, enumOptions, emptyValue),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const handleFocus = ({ target }: FocusEvent<HTMLInputElement>) =>
|
|
51
|
-
onFocus(
|
|
52
|
-
id,
|
|
53
|
-
enumOptionsValueForIndex<S>(target.value, enumOptions, emptyValue),
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
57
|
-
// they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
|
|
58
|
-
const extraProps = {
|
|
59
|
-
id,
|
|
60
|
-
onBlur: !readonly ? handleBlur : undefined,
|
|
61
|
-
onFocus: !readonly ? handleFocus : undefined,
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const selectedIndexes = enumOptionsIndexForValue<S>(
|
|
65
|
-
value,
|
|
66
|
-
enumOptions,
|
|
67
|
-
true,
|
|
68
|
-
) as string[];
|
|
69
|
-
|
|
70
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? (
|
|
71
|
-
<>
|
|
72
|
-
<Checkbox.Group
|
|
73
|
-
disabled={disabled || (readonlyAsDisabled && readonly)}
|
|
74
|
-
name={id}
|
|
75
|
-
onChange={!readonly ? handleChange : undefined}
|
|
76
|
-
value={selectedIndexes}
|
|
77
|
-
{...extraProps}
|
|
78
|
-
aria-describedby={ariaDescribedByIds<T>(id)}
|
|
79
|
-
>
|
|
80
|
-
{Array.isArray(enumOptions) &&
|
|
81
|
-
enumOptions.map((option, i) => (
|
|
82
|
-
<span key={i}>
|
|
83
|
-
<Checkbox
|
|
84
|
-
id={optionId(id, i)}
|
|
85
|
-
autoFocus={i === 0 ? autofocus : false}
|
|
86
|
-
disabled={
|
|
87
|
-
Array.isArray(enumDisabled) &&
|
|
88
|
-
enumDisabled.indexOf(option.value) !== -1
|
|
89
|
-
}
|
|
90
|
-
value={String(i)}
|
|
91
|
-
>
|
|
92
|
-
{option.label}
|
|
93
|
-
</Checkbox>
|
|
94
|
-
{!inline && <br />}
|
|
95
|
-
</span>
|
|
96
|
-
))}
|
|
97
|
-
</Checkbox.Group>
|
|
98
|
-
</>
|
|
99
|
-
) : null;
|
|
100
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type RegistryWidgetsType } from '@rjsf/utils';
|
|
2
|
-
|
|
3
|
-
import TextAreaWidget from './textarea';
|
|
4
|
-
import SelectWidget from './select';
|
|
5
|
-
import RangeWidget from './range';
|
|
6
|
-
import RadioWidget from './radio';
|
|
7
|
-
import CheckboxesWidget from './checkboxs';
|
|
8
|
-
import CheckboxWidget from './checkbox';
|
|
9
|
-
|
|
10
|
-
export const widgets: RegistryWidgetsType = {
|
|
11
|
-
TextAreaWidget,
|
|
12
|
-
SelectWidget,
|
|
13
|
-
CheckboxWidget,
|
|
14
|
-
CheckboxesWidget,
|
|
15
|
-
RadioWidget,
|
|
16
|
-
RangeWidget,
|
|
17
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import React, { type FocusEvent } from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ariaDescribedByIds,
|
|
5
|
-
enumOptionsIndexForValue,
|
|
6
|
-
enumOptionsValueForIndex,
|
|
7
|
-
type FormContextType,
|
|
8
|
-
type GenericObjectType,
|
|
9
|
-
type RJSFSchema,
|
|
10
|
-
type StrictRJSFSchema,
|
|
11
|
-
type WidgetProps,
|
|
12
|
-
} from '@rjsf/utils';
|
|
13
|
-
import { Radio, type RadioGroupProps } from '@coze-arch/coze-design';
|
|
14
|
-
|
|
15
|
-
/** The `RadioWidget` is a widget for rendering a radio group.
|
|
16
|
-
* It is typically used with a string property constrained with enum options.
|
|
17
|
-
*
|
|
18
|
-
* @param props - The `WidgetProps` for this component
|
|
19
|
-
*/
|
|
20
|
-
export default function RadioWidget<
|
|
21
|
-
T = unknown,
|
|
22
|
-
S extends StrictRJSFSchema = RJSFSchema,
|
|
23
|
-
F extends FormContextType = object,
|
|
24
|
-
>({
|
|
25
|
-
autofocus,
|
|
26
|
-
disabled,
|
|
27
|
-
formContext,
|
|
28
|
-
id,
|
|
29
|
-
onBlur,
|
|
30
|
-
onChange,
|
|
31
|
-
onFocus,
|
|
32
|
-
options,
|
|
33
|
-
readonly,
|
|
34
|
-
value,
|
|
35
|
-
}: WidgetProps<T, S, F>) {
|
|
36
|
-
const { readonlyAsDisabled = true } = formContext as GenericObjectType;
|
|
37
|
-
|
|
38
|
-
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
39
|
-
|
|
40
|
-
const handleChange: RadioGroupProps['onChange'] = ({
|
|
41
|
-
target: { value: nextValue },
|
|
42
|
-
}) =>
|
|
43
|
-
onChange(enumOptionsValueForIndex<S>(nextValue, enumOptions, emptyValue));
|
|
44
|
-
|
|
45
|
-
const handleBlur = ({ target }: FocusEvent<HTMLInputElement>) =>
|
|
46
|
-
onBlur(
|
|
47
|
-
id,
|
|
48
|
-
enumOptionsValueForIndex<S>(
|
|
49
|
-
target && target.value,
|
|
50
|
-
enumOptions,
|
|
51
|
-
emptyValue,
|
|
52
|
-
),
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
const handleFocus = ({ target }: FocusEvent<HTMLInputElement>) =>
|
|
56
|
-
onFocus(
|
|
57
|
-
id,
|
|
58
|
-
enumOptionsValueForIndex<S>(
|
|
59
|
-
target && target.value,
|
|
60
|
-
enumOptions,
|
|
61
|
-
emptyValue,
|
|
62
|
-
),
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const selectedIndexes = enumOptionsIndexForValue<S>(
|
|
66
|
-
value,
|
|
67
|
-
enumOptions,
|
|
68
|
-
) as string;
|
|
69
|
-
|
|
70
|
-
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
71
|
-
// they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
|
|
72
|
-
const extraProps = {
|
|
73
|
-
onBlur: !readonly ? handleBlur : undefined,
|
|
74
|
-
onFocus: !readonly ? handleFocus : undefined,
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<Radio.Group
|
|
79
|
-
disabled={disabled || (readonlyAsDisabled && readonly)}
|
|
80
|
-
id={id}
|
|
81
|
-
name={id}
|
|
82
|
-
onChange={!readonly ? handleChange : undefined}
|
|
83
|
-
{...extraProps}
|
|
84
|
-
value={selectedIndexes}
|
|
85
|
-
aria-describedby={ariaDescribedByIds<T>(id)}
|
|
86
|
-
>
|
|
87
|
-
{Array.isArray(enumOptions) &&
|
|
88
|
-
enumOptions.map((option, i) => (
|
|
89
|
-
<Radio
|
|
90
|
-
name={id}
|
|
91
|
-
autoFocus={i === 0 ? autofocus : false}
|
|
92
|
-
disabled={
|
|
93
|
-
disabled ||
|
|
94
|
-
(Array.isArray(enumDisabled) &&
|
|
95
|
-
enumDisabled.indexOf(option.value) !== -1)
|
|
96
|
-
}
|
|
97
|
-
key={i}
|
|
98
|
-
value={String(i)}
|
|
99
|
-
>
|
|
100
|
-
{option.label}
|
|
101
|
-
</Radio>
|
|
102
|
-
))}
|
|
103
|
-
</Radio.Group>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ariaDescribedByIds,
|
|
4
|
-
rangeSpec,
|
|
5
|
-
type FormContextType,
|
|
6
|
-
type RJSFSchema,
|
|
7
|
-
type StrictRJSFSchema,
|
|
8
|
-
type WidgetProps,
|
|
9
|
-
type GenericObjectType,
|
|
10
|
-
} from '@rjsf/utils';
|
|
11
|
-
import { Slider, type SliderProps } from '@coze-arch/coze-design';
|
|
12
|
-
|
|
13
|
-
/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
|
|
14
|
-
* in a div, with the value along side it.
|
|
15
|
-
*
|
|
16
|
-
* @param props - The `WidgetProps` for this component
|
|
17
|
-
*/
|
|
18
|
-
export default function RangeWidget<
|
|
19
|
-
T = unknown,
|
|
20
|
-
S extends StrictRJSFSchema = RJSFSchema,
|
|
21
|
-
F extends FormContextType = object,
|
|
22
|
-
>(props: WidgetProps<T, S, F>) {
|
|
23
|
-
const {
|
|
24
|
-
autofocus,
|
|
25
|
-
disabled,
|
|
26
|
-
formContext,
|
|
27
|
-
id,
|
|
28
|
-
onBlur,
|
|
29
|
-
onChange,
|
|
30
|
-
onFocus,
|
|
31
|
-
options,
|
|
32
|
-
placeholder,
|
|
33
|
-
readonly,
|
|
34
|
-
schema,
|
|
35
|
-
value,
|
|
36
|
-
} = props;
|
|
37
|
-
const { readonlyAsDisabled = true } = formContext as GenericObjectType;
|
|
38
|
-
|
|
39
|
-
const { min, max, step } = rangeSpec(schema);
|
|
40
|
-
|
|
41
|
-
const emptyValue = options.emptyValue || '';
|
|
42
|
-
|
|
43
|
-
const handleChange: SliderProps['onChange'] = nextValue =>
|
|
44
|
-
onChange(typeof nextValue === 'undefined' ? emptyValue : nextValue);
|
|
45
|
-
|
|
46
|
-
const handleBlur = () => onBlur(id, value);
|
|
47
|
-
|
|
48
|
-
const handleFocus = () => onFocus(id, value);
|
|
49
|
-
|
|
50
|
-
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
51
|
-
// they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
|
|
52
|
-
const extraProps = {
|
|
53
|
-
placeholder,
|
|
54
|
-
onBlur: !readonly ? handleBlur : undefined,
|
|
55
|
-
onFocus: !readonly ? handleFocus : undefined,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<Slider
|
|
60
|
-
autoFocus={autofocus}
|
|
61
|
-
disabled={disabled || (readonlyAsDisabled && readonly)}
|
|
62
|
-
id={id}
|
|
63
|
-
max={max}
|
|
64
|
-
min={min}
|
|
65
|
-
onChange={!readonly ? handleChange : undefined}
|
|
66
|
-
range={false}
|
|
67
|
-
step={step}
|
|
68
|
-
value={value}
|
|
69
|
-
{...extraProps}
|
|
70
|
-
aria-describedby={ariaDescribedByIds<T>(id)}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ariaDescribedByIds,
|
|
5
|
-
enumOptionsIndexForValue,
|
|
6
|
-
enumOptionsValueForIndex,
|
|
7
|
-
type FormContextType,
|
|
8
|
-
type GenericObjectType,
|
|
9
|
-
type RJSFSchema,
|
|
10
|
-
type StrictRJSFSchema,
|
|
11
|
-
type WidgetProps,
|
|
12
|
-
} from '@rjsf/utils';
|
|
13
|
-
import {
|
|
14
|
-
type SelectProps,
|
|
15
|
-
type OptionProps,
|
|
16
|
-
Select,
|
|
17
|
-
} from '@coze-arch/coze-design';
|
|
18
|
-
|
|
19
|
-
const SELECT_STYLE = {
|
|
20
|
-
width: '100%',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/** The `SelectWidget` is a widget for rendering dropdowns.
|
|
24
|
-
* It is typically used with string properties constrained with enum options.
|
|
25
|
-
*
|
|
26
|
-
* @param props - The `WidgetProps` for this component
|
|
27
|
-
*/
|
|
28
|
-
export default function SelectWidget<
|
|
29
|
-
T = unknown,
|
|
30
|
-
S extends StrictRJSFSchema = RJSFSchema,
|
|
31
|
-
F extends FormContextType = object,
|
|
32
|
-
>({
|
|
33
|
-
autofocus,
|
|
34
|
-
disabled,
|
|
35
|
-
formContext = {} as unknown as F,
|
|
36
|
-
id,
|
|
37
|
-
multiple,
|
|
38
|
-
onBlur,
|
|
39
|
-
onChange,
|
|
40
|
-
onFocus,
|
|
41
|
-
options,
|
|
42
|
-
placeholder,
|
|
43
|
-
readonly,
|
|
44
|
-
value,
|
|
45
|
-
}: WidgetProps<T, S, F>) {
|
|
46
|
-
const { readonlyAsDisabled = true } = formContext as GenericObjectType;
|
|
47
|
-
|
|
48
|
-
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
49
|
-
|
|
50
|
-
const handleChange: SelectProps['onChange'] = nextValue => {
|
|
51
|
-
if (typeof nextValue === 'object' && !Array.isArray(nextValue)) {
|
|
52
|
-
throw new Error('Object type value is not supported');
|
|
53
|
-
} else {
|
|
54
|
-
onChange(
|
|
55
|
-
typeof nextValue === 'undefined'
|
|
56
|
-
? undefined
|
|
57
|
-
: enumOptionsValueForIndex<S>(nextValue, enumOptions, emptyValue),
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const handleBlur = () =>
|
|
63
|
-
onBlur(id, enumOptionsValueForIndex<S>(value, enumOptions, emptyValue));
|
|
64
|
-
|
|
65
|
-
const handleFocus = () =>
|
|
66
|
-
onFocus(id, enumOptionsValueForIndex<S>(value, enumOptions, emptyValue));
|
|
67
|
-
|
|
68
|
-
const selectedIndexes = enumOptionsIndexForValue<S>(
|
|
69
|
-
value,
|
|
70
|
-
enumOptions,
|
|
71
|
-
multiple,
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
const selectOptions: OptionProps[] | undefined = useMemo(() => {
|
|
75
|
-
if (Array.isArray(enumOptions)) {
|
|
76
|
-
const opts: OptionProps[] = enumOptions.map(
|
|
77
|
-
({ value: optionValue, label: optionLabel }, index) => ({
|
|
78
|
-
disabled:
|
|
79
|
-
Array.isArray(enumDisabled) &&
|
|
80
|
-
enumDisabled.indexOf(optionValue) !== -1,
|
|
81
|
-
key: String(index),
|
|
82
|
-
value: String(index),
|
|
83
|
-
label: optionLabel,
|
|
84
|
-
}),
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
return opts;
|
|
88
|
-
}
|
|
89
|
-
return undefined;
|
|
90
|
-
}, [enumDisabled, enumOptions]);
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<Select
|
|
94
|
-
autoFocus={autofocus}
|
|
95
|
-
disabled={disabled || (readonlyAsDisabled && readonly)}
|
|
96
|
-
id={id}
|
|
97
|
-
multiple={multiple}
|
|
98
|
-
onBlur={!readonly ? handleBlur : undefined}
|
|
99
|
-
onChange={!readonly ? handleChange : undefined}
|
|
100
|
-
onFocus={!readonly ? handleFocus : undefined}
|
|
101
|
-
placeholder={placeholder}
|
|
102
|
-
style={SELECT_STYLE}
|
|
103
|
-
value={selectedIndexes}
|
|
104
|
-
aria-describedby={ariaDescribedByIds<T>(id)}
|
|
105
|
-
optionList={selectOptions}
|
|
106
|
-
/>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React, { type FocusEvent } from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ariaDescribedByIds,
|
|
5
|
-
type FormContextType,
|
|
6
|
-
type GenericObjectType,
|
|
7
|
-
type RJSFSchema,
|
|
8
|
-
type StrictRJSFSchema,
|
|
9
|
-
type WidgetProps,
|
|
10
|
-
} from '@rjsf/utils';
|
|
11
|
-
import { TextArea, type TextAreaProps } from '@coze-arch/coze-design';
|
|
12
|
-
|
|
13
|
-
const INPUT_STYLE = {
|
|
14
|
-
width: '100%',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
18
|
-
*
|
|
19
|
-
* @param props - The `WidgetProps` for this component
|
|
20
|
-
*/
|
|
21
|
-
export default function TextareaWidget<
|
|
22
|
-
T = unknown,
|
|
23
|
-
S extends StrictRJSFSchema = RJSFSchema,
|
|
24
|
-
F extends FormContextType = object,
|
|
25
|
-
>({
|
|
26
|
-
disabled,
|
|
27
|
-
formContext,
|
|
28
|
-
id,
|
|
29
|
-
onBlur,
|
|
30
|
-
onChange,
|
|
31
|
-
onFocus,
|
|
32
|
-
options,
|
|
33
|
-
placeholder,
|
|
34
|
-
readonly,
|
|
35
|
-
value,
|
|
36
|
-
}: WidgetProps<T, S, F>) {
|
|
37
|
-
const { readonlyAsDisabled = true } = formContext as GenericObjectType;
|
|
38
|
-
|
|
39
|
-
const handleChange: TextAreaProps['onChange'] = nextValue =>
|
|
40
|
-
onChange(nextValue === '' ? options.emptyValue : nextValue);
|
|
41
|
-
|
|
42
|
-
const handleBlur = ({ target }: FocusEvent<HTMLTextAreaElement>) =>
|
|
43
|
-
onBlur(id, target && target.value);
|
|
44
|
-
|
|
45
|
-
const handleFocus = ({ target }: FocusEvent<HTMLTextAreaElement>) =>
|
|
46
|
-
onFocus(id, target && target.value);
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<TextArea
|
|
50
|
-
disabled={disabled || (readonlyAsDisabled && readonly)}
|
|
51
|
-
id={id}
|
|
52
|
-
name={id}
|
|
53
|
-
onBlur={!readonly ? handleBlur : undefined}
|
|
54
|
-
onChange={!readonly ? handleChange : undefined}
|
|
55
|
-
onFocus={!readonly ? handleFocus : undefined}
|
|
56
|
-
placeholder={placeholder}
|
|
57
|
-
rows={options.rows || 4}
|
|
58
|
-
style={INPUT_STYLE}
|
|
59
|
-
value={value}
|
|
60
|
-
aria-describedby={ariaDescribedByIds<T>(id)}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type Form from '@rjsf/core';
|
|
2
|
-
import { withTheme } from '@rjsf/core';
|
|
3
|
-
|
|
4
|
-
export { default as schemaValidators } from '@rjsf/validator-ajv8';
|
|
5
|
-
|
|
6
|
-
import { widgets } from './components/widgets';
|
|
7
|
-
import { templates } from './components/tmpls';
|
|
8
|
-
|
|
9
|
-
export const SemiSchemaForm = withTheme({
|
|
10
|
-
widgets,
|
|
11
|
-
templates,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export type SemiSchemaFormInstance = Form;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export enum EventNames {
|
|
2
|
-
// 进入相关
|
|
3
|
-
INIT_LOOP_FORM = 'init_loop_form',
|
|
4
|
-
// 保点击保存,表单报错
|
|
5
|
-
LOOP_FORM_FIELD_VALIDATE_ERROR = 'loop_form_field_validate_error', // 表单项报错次数
|
|
6
|
-
|
|
7
|
-
// 点击保存,接口报错
|
|
8
|
-
LOOP_FORM_SUBMIT_INTERFACE_ERROR = 'loop_form_submit_interface_error', // 提交接口报错次数
|
|
9
|
-
|
|
10
|
-
// 点击保存,成功
|
|
11
|
-
LOOP_FORM_SUBMIT_SUCCESS = 'loop_form_submit_success', // 提交成功
|
|
12
|
-
|
|
13
|
-
// 离开表单
|
|
14
|
-
LOOP_FORM_FIELD_CHANGE_TIMELINE = 'loop_form_field_change_timeline', // 表单项变更时间轴
|
|
15
|
-
LOOP_FORM_CLOSE = 'loop_form_close', // 离开表单
|
|
16
|
-
}
|