doui-react 1.0.0
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/LICENSE +21 -0
- package/README.md +28 -0
- package/es/api/component/class-name.d.ts +3 -0
- package/es/api/component/class-name.js +15 -0
- package/es/api/component/common.d.ts +22 -0
- package/es/api/component/common.js +144 -0
- package/es/api/component/dom.d.ts +2 -0
- package/es/api/component/dom.js +7 -0
- package/es/api/component/global-style.d.ts +3 -0
- package/es/api/component/global-style.js +16 -0
- package/es/api/component/index.d.ts +9 -0
- package/es/api/component/index.js +9 -0
- package/es/api/component/react-dom.d.ts +3 -0
- package/es/api/component/react-dom.js +72 -0
- package/es/api/component/sort.d.ts +2 -0
- package/es/api/component/sort.js +20 -0
- package/es/api/component/style.d.ts +4 -0
- package/es/api/component/style.js +33 -0
- package/es/api/component/url.d.ts +33 -0
- package/es/api/component/url.js +126 -0
- package/es/api/component/validate-input.d.ts +8 -0
- package/es/api/component/validate-input.js +16 -0
- package/es/api/index.d.ts +2 -0
- package/es/api/index.js +2 -0
- package/es/api/type/common.d.ts +24 -0
- package/es/api/type/common.js +1 -0
- package/es/api/type/index.d.ts +5 -0
- package/es/api/type/index.js +2 -0
- package/es/button/component/index.d.ts +2 -0
- package/es/button/component/index.js +87 -0
- package/es/button/index.d.ts +2 -0
- package/es/button/index.js +2 -0
- package/es/button/type/index.d.ts +31 -0
- package/es/button/type/index.js +1 -0
- package/es/checkbox/component/checkbox-group.d.ts +2 -0
- package/es/checkbox/component/checkbox-group.js +66 -0
- package/es/checkbox/component/checkbox.d.ts +2 -0
- package/es/checkbox/component/checkbox.js +8 -0
- package/es/checkbox/component/index.d.ts +2 -0
- package/es/checkbox/component/index.js +10 -0
- package/es/checkbox/component/use-checkbox.d.ts +12 -0
- package/es/checkbox/component/use-checkbox.js +43 -0
- package/es/checkbox/component/utils.d.ts +13 -0
- package/es/checkbox/component/utils.js +40 -0
- package/es/checkbox/index.d.ts +2 -0
- package/es/checkbox/index.js +2 -0
- package/es/checkbox/style/index.d.ts +5 -0
- package/es/checkbox/style/index.js +11 -0
- package/es/checkbox/type/index.d.ts +18 -0
- package/es/checkbox/type/index.js +1 -0
- package/es/config/index.d.ts +0 -0
- package/es/config/index.js +0 -0
- package/es/date-picker/component/index.d.ts +3 -0
- package/es/date-picker/component/index.js +38 -0
- package/es/date-picker/index.d.ts +2 -0
- package/es/date-picker/index.js +2 -0
- package/es/date-picker/style/index.d.ts +4 -0
- package/es/date-picker/style/index.js +7 -0
- package/es/date-picker/type/index.d.ts +21 -0
- package/es/date-picker/type/index.js +1 -0
- package/es/empty/component/index.d.ts +2 -0
- package/es/empty/component/index.js +17 -0
- package/es/empty/index.d.ts +2 -0
- package/es/empty/index.js +2 -0
- package/es/empty/type/index.d.ts +9 -0
- package/es/empty/type/index.js +1 -0
- package/es/form/component/constant.d.ts +15 -0
- package/es/form/component/constant.js +15 -0
- package/es/form/component/form-content.d.ts +10 -0
- package/es/form/component/form-content.js +280 -0
- package/es/form/component/form-item-map.d.ts +40 -0
- package/es/form/component/form-item-map.js +120 -0
- package/es/form/component/form-item.d.ts +7 -0
- package/es/form/component/form-item.js +219 -0
- package/es/form/component/form-list.d.ts +36 -0
- package/es/form/component/form-list.js +190 -0
- package/es/form/component/form.d.ts +2 -0
- package/es/form/component/form.js +40 -0
- package/es/form/component/index.d.ts +15 -0
- package/es/form/component/index.js +14 -0
- package/es/form/component/submit-button.d.ts +2 -0
- package/es/form/component/submit-button.js +47 -0
- package/es/form/component/use-debug.d.ts +1 -0
- package/es/form/component/use-debug.js +16 -0
- package/es/form/component/utils.d.ts +95 -0
- package/es/form/component/utils.js +435 -0
- package/es/form/component/validator-item.d.ts +7 -0
- package/es/form/component/validator-item.js +53 -0
- package/es/form/hook/index.d.ts +16 -0
- package/es/form/hook/index.js +116 -0
- package/es/form/hook/list-provider.d.ts +6 -0
- package/es/form/hook/list-provider.js +16 -0
- package/es/form/hook/provider.d.ts +23 -0
- package/es/form/hook/provider.js +21 -0
- package/es/form/hook/use-form.d.ts +2 -0
- package/es/form/hook/use-form.js +335 -0
- package/es/form/index.d.ts +3 -0
- package/es/form/index.js +3 -0
- package/es/form/style/form-item.d.ts +3 -0
- package/es/form/style/form-item.js +38 -0
- package/es/form/style/index.d.ts +7 -0
- package/es/form/style/index.js +13 -0
- package/es/form/type/form-item.d.ts +141 -0
- package/es/form/type/form-item.js +1 -0
- package/es/form/type/form-list.d.ts +91 -0
- package/es/form/type/form-list.js +1 -0
- package/es/form/type/index.d.ts +134 -0
- package/es/form/type/index.js +3 -0
- package/es/grid/component/index.d.ts +2 -0
- package/es/grid/component/index.js +76 -0
- package/es/grid/component/pagination.d.ts +50 -0
- package/es/grid/component/pagination.js +54 -0
- package/es/grid/component/utils.d.ts +2 -0
- package/es/grid/component/utils.js +7 -0
- package/es/grid/index.d.ts +2 -0
- package/es/grid/index.js +2 -0
- package/es/grid/style/index.d.ts +11 -0
- package/es/grid/style/index.js +26 -0
- package/es/grid/type/index.d.ts +67 -0
- package/es/grid/type/index.js +1 -0
- package/es/highlight-text/component/index.d.ts +2 -0
- package/es/highlight-text/component/index.js +71 -0
- package/es/highlight-text/index.d.ts +2 -0
- package/es/highlight-text/index.js +2 -0
- package/es/highlight-text/style/index.d.ts +4 -0
- package/es/highlight-text/style/index.js +7 -0
- package/es/highlight-text/type/index.d.ts +18 -0
- package/es/highlight-text/type/index.js +1 -0
- package/es/hooks/hook/common.d.ts +1 -0
- package/es/hooks/hook/common.js +12 -0
- package/es/hooks/hook/index.d.ts +7 -0
- package/es/hooks/hook/index.js +7 -0
- package/es/hooks/hook/use-debounce.d.ts +4 -0
- package/es/hooks/hook/use-debounce.js +23 -0
- package/es/hooks/hook/use-deep.d.ts +9 -0
- package/es/hooks/hook/use-deep.js +64 -0
- package/es/hooks/hook/use-fetch.d.ts +8 -0
- package/es/hooks/hook/use-fetch.js +164 -0
- package/es/hooks/hook/use-list-operation.d.ts +5 -0
- package/es/hooks/hook/use-list-operation.js +70 -0
- package/es/hooks/hook/use-loading.d.ts +7 -0
- package/es/hooks/hook/use-loading.js +59 -0
- package/es/hooks/hook/use-window-resize.d.ts +5 -0
- package/es/hooks/hook/use-window-resize.js +16 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.js +2 -0
- package/es/hooks/type/index.d.ts +2 -0
- package/es/hooks/type/index.js +2 -0
- package/es/hooks/type/use-fetch.d.ts +31 -0
- package/es/hooks/type/use-fetch.js +1 -0
- package/es/hooks/type/use-list-operation.d.ts +34 -0
- package/es/hooks/type/use-list-operation.js +1 -0
- package/es/icon/component/down.d.ts +2 -0
- package/es/icon/component/down.js +42 -0
- package/es/icon/component/index.d.ts +2 -0
- package/es/icon/component/index.js +5 -0
- package/es/icon/component/up.d.ts +2 -0
- package/es/icon/component/up.js +41 -0
- package/es/icon/hook/index.d.ts +477 -0
- package/es/icon/hook/index.js +60 -0
- package/es/icon/index.d.ts +2 -0
- package/es/icon/index.js +2 -0
- package/es/icon/style/index.d.ts +4 -0
- package/es/icon/style/index.js +10 -0
- package/es/icon/type/index.d.ts +14 -0
- package/es/icon/type/index.js +1 -0
- package/es/index.d.ts +25 -0
- package/es/index.js +25 -0
- package/es/input/component/index.d.ts +12 -0
- package/es/input/component/index.js +25 -0
- package/es/input/component/input.d.ts +2 -0
- package/es/input/component/input.js +8 -0
- package/es/input/component/number.d.ts +4 -0
- package/es/input/component/number.js +50 -0
- package/es/input/component/password.d.ts +2 -0
- package/es/input/component/password.js +8 -0
- package/es/input/component/text-area.d.ts +2 -0
- package/es/input/component/text-area.js +16 -0
- package/es/input/component/utils.d.ts +15 -0
- package/es/input/component/utils.js +102 -0
- package/es/input/index.d.ts +2 -0
- package/es/input/index.js +2 -0
- package/es/input/style/index.d.ts +6 -0
- package/es/input/style/index.js +11 -0
- package/es/input/type/index.d.ts +41 -0
- package/es/input/type/index.js +1 -0
- package/es/modal-prompt/component/index.d.ts +5 -0
- package/es/modal-prompt/component/index.js +60 -0
- package/es/modal-prompt/component/open-loading.d.ts +2 -0
- package/es/modal-prompt/component/open-loading.js +21 -0
- package/es/modal-prompt/component/utils.d.ts +4 -0
- package/es/modal-prompt/component/utils.js +49 -0
- package/es/modal-prompt/index.d.ts +2 -0
- package/es/modal-prompt/index.js +2 -0
- package/es/modal-prompt/style/index.d.ts +5 -0
- package/es/modal-prompt/style/index.js +9 -0
- package/es/modal-prompt/type/index.d.ts +36 -0
- package/es/modal-prompt/type/index.js +1 -0
- package/es/open-modal/component/constant.d.ts +1 -0
- package/es/open-modal/component/constant.js +3 -0
- package/es/open-modal/component/footer.d.ts +2 -0
- package/es/open-modal/component/footer.js +34 -0
- package/es/open-modal/component/index.d.ts +4 -0
- package/es/open-modal/component/index.js +9 -0
- package/es/open-modal/component/modal.d.ts +10 -0
- package/es/open-modal/component/modal.js +37 -0
- package/es/open-modal/component/title.d.ts +6 -0
- package/es/open-modal/component/title.js +12 -0
- package/es/open-modal/component/use-modal.d.ts +14 -0
- package/es/open-modal/component/use-modal.js +177 -0
- package/es/open-modal/component/utils.d.ts +11 -0
- package/es/open-modal/component/utils.js +109 -0
- package/es/open-modal/hook/index.d.ts +7 -0
- package/es/open-modal/hook/index.js +17 -0
- package/es/open-modal/hook/use-modal.d.ts +6 -0
- package/es/open-modal/hook/use-modal.js +27 -0
- package/es/open-modal/index.d.ts +3 -0
- package/es/open-modal/index.js +3 -0
- package/es/open-modal/style/index.d.ts +5 -0
- package/es/open-modal/style/index.js +18 -0
- package/es/open-modal/style/wrap.d.ts +2 -0
- package/es/open-modal/style/wrap.js +6 -0
- package/es/open-modal/type/index.d.ts +91 -0
- package/es/open-modal/type/index.js +1 -0
- package/es/portal/component/index.d.ts +2 -0
- package/es/portal/component/index.js +40 -0
- package/es/portal/index.d.ts +2 -0
- package/es/portal/index.js +2 -0
- package/es/portal/type/index.d.ts +13 -0
- package/es/portal/type/index.js +1 -0
- package/es/radio/component/abstract-box.d.ts +380 -0
- package/es/radio/component/abstract-box.js +90 -0
- package/es/radio/component/index.d.ts +2 -0
- package/es/radio/component/index.js +10 -0
- package/es/radio/component/radio.d.ts +2 -0
- package/es/radio/component/radio.js +10 -0
- package/es/radio/component/redio-group.d.ts +2 -0
- package/es/radio/component/redio-group.js +50 -0
- package/es/radio/component/use-box-options.d.ts +6 -0
- package/es/radio/component/use-box-options.js +20 -0
- package/es/radio/component/use-radio.d.ts +23 -0
- package/es/radio/component/use-radio.js +21 -0
- package/es/radio/component/utils.d.ts +7 -0
- package/es/radio/component/utils.js +25 -0
- package/es/radio/index.d.ts +2 -0
- package/es/radio/index.js +2 -0
- package/es/radio/style/index.d.ts +7 -0
- package/es/radio/style/index.js +15 -0
- package/es/radio/type/index.d.ts +32 -0
- package/es/radio/type/index.js +1 -0
- package/es/select/component/constant.d.ts +1 -0
- package/es/select/component/constant.js +1 -0
- package/es/select/component/index.d.ts +3 -0
- package/es/select/component/index.js +16 -0
- package/es/select/component/loading.d.ts +1 -0
- package/es/select/component/loading.js +13 -0
- package/es/select/component/use-select-options.d.ts +11 -0
- package/es/select/component/use-select-options.js +80 -0
- package/es/select/component/use-select.d.ts +2 -0
- package/es/select/component/use-select.js +136 -0
- package/es/select/component/utils.d.ts +14 -0
- package/es/select/component/utils.js +142 -0
- package/es/select/index.d.ts +2 -0
- package/es/select/index.js +2 -0
- package/es/select/style/index.d.ts +4 -0
- package/es/select/style/index.js +7 -0
- package/es/select/type/index.d.ts +105 -0
- package/es/select/type/index.js +1 -0
- package/es/stack/component/center-stack.d.ts +2 -0
- package/es/stack/component/center-stack.js +32 -0
- package/es/stack/component/h-stack.d.ts +2 -0
- package/es/stack/component/h-stack.js +39 -0
- package/es/stack/component/index.d.ts +3 -0
- package/es/stack/component/index.js +3 -0
- package/es/stack/component/v-stack.d.ts +2 -0
- package/es/stack/component/v-stack.js +36 -0
- package/es/stack/index.d.ts +2 -0
- package/es/stack/index.js +2 -0
- package/es/stack/style/index.d.ts +21 -0
- package/es/stack/style/index.js +49 -0
- package/es/stack/type/index.d.ts +54 -0
- package/es/stack/type/index.js +1 -0
- package/es/switch/component/index.d.ts +2 -0
- package/es/switch/component/index.js +60 -0
- package/es/switch/index.d.ts +2 -0
- package/es/switch/index.js +2 -0
- package/es/switch/style/index.d.ts +5 -0
- package/es/switch/style/index.js +13 -0
- package/es/switch/type/index.d.ts +27 -0
- package/es/switch/type/index.js +1 -0
- package/es/table/component/action-button.d.ts +2 -0
- package/es/table/component/action-button.js +95 -0
- package/es/table/component/actions.d.ts +2 -0
- package/es/table/component/actions.js +35 -0
- package/es/table/component/constant.d.ts +1 -0
- package/es/table/component/constant.js +5 -0
- package/es/table/component/editor.d.ts +2 -0
- package/es/table/component/editor.js +35 -0
- package/es/table/component/filter.d.ts +3 -0
- package/es/table/component/filter.js +55 -0
- package/es/table/component/index.d.ts +7 -0
- package/es/table/component/index.js +4 -0
- package/es/table/component/link.d.ts +2 -0
- package/es/table/component/link.js +20 -0
- package/es/table/component/sort.d.ts +6 -0
- package/es/table/component/sort.js +17 -0
- package/es/table/component/switch.d.ts +2 -0
- package/es/table/component/switch.js +27 -0
- package/es/table/component/table-body.d.ts +6 -0
- package/es/table/component/table-body.js +88 -0
- package/es/table/component/table.d.ts +10 -0
- package/es/table/component/table.js +235 -0
- package/es/table/component/time.d.ts +2 -0
- package/es/table/component/time.js +12 -0
- package/es/table/component/utils.d.ts +120 -0
- package/es/table/component/utils.js +222 -0
- package/es/table/component/wrapper.d.ts +6 -0
- package/es/table/component/wrapper.js +30 -0
- package/es/table/hook/index.d.ts +7 -0
- package/es/table/hook/index.js +17 -0
- package/es/table/hook/search.d.ts +5 -0
- package/es/table/hook/search.js +131 -0
- package/es/table/index.d.ts +3 -0
- package/es/table/index.js +3 -0
- package/es/table/style/index.d.ts +9 -0
- package/es/table/style/index.js +16 -0
- package/es/table/type/action.d.ts +48 -0
- package/es/table/type/action.js +1 -0
- package/es/table/type/column.d.ts +110 -0
- package/es/table/type/column.js +1 -0
- package/es/table/type/index.d.ts +113 -0
- package/es/table/type/index.js +11 -0
- package/es/tabs/component/constant.d.ts +2 -0
- package/es/tabs/component/constant.js +2 -0
- package/es/tabs/component/index.d.ts +2 -0
- package/es/tabs/component/index.js +18 -0
- package/es/tabs/component/utils.d.ts +24 -0
- package/es/tabs/component/utils.js +55 -0
- package/es/tabs/index.d.ts +2 -0
- package/es/tabs/index.js +2 -0
- package/es/tabs/style/index.d.ts +5 -0
- package/es/tabs/style/index.js +10 -0
- package/es/tabs/type/index.d.ts +20 -0
- package/es/tabs/type/index.js +1 -0
- package/es/text/component/index.d.ts +3 -0
- package/es/text/component/index.js +57 -0
- package/es/text/component/use-text.d.ts +4 -0
- package/es/text/component/use-text.js +24 -0
- package/es/text/component/utils.d.ts +3 -0
- package/es/text/component/utils.js +9 -0
- package/es/text/index.d.ts +2 -0
- package/es/text/index.js +2 -0
- package/es/text/style/index.d.ts +5 -0
- package/es/text/style/index.js +8 -0
- package/es/text/type/index.d.ts +19 -0
- package/es/text/type/index.js +1 -0
- package/es/tooltip/component/index.d.ts +48 -0
- package/es/tooltip/component/index.js +19 -0
- package/es/tooltip/index.d.ts +2 -0
- package/es/tooltip/index.js +2 -0
- package/es/tooltip/type/index.d.ts +8 -0
- package/es/tooltip/type/index.js +1 -0
- package/es/tree/component/index.d.ts +2 -0
- package/es/tree/component/index.js +23 -0
- package/es/tree/component/utils.d.ts +1 -0
- package/es/tree/component/utils.js +3 -0
- package/es/tree/index.d.ts +2 -0
- package/es/tree/index.js +2 -0
- package/es/tree/style/index.d.ts +4 -0
- package/es/tree/style/index.js +7 -0
- package/es/tree/type/index.d.ts +2 -0
- package/es/tree/type/index.js +1 -0
- package/es/tree-select/component/index.d.ts +2 -0
- package/es/tree-select/component/index.js +15 -0
- package/es/tree-select/component/use-tree-select.d.ts +2 -0
- package/es/tree-select/component/use-tree-select.js +59 -0
- package/es/tree-select/index.d.ts +2 -0
- package/es/tree-select/index.js +2 -0
- package/es/tree-select/style/index.d.ts +5 -0
- package/es/tree-select/style/index.js +15 -0
- package/es/tree-select/type/index.d.ts +23 -0
- package/es/tree-select/type/index.js +1 -0
- package/es/virtual-list/component/index.d.ts +2 -0
- package/es/virtual-list/component/index.js +28 -0
- package/es/virtual-list/index.d.ts +2 -0
- package/es/virtual-list/index.js +2 -0
- package/es/virtual-list/type/index.d.ts +17 -0
- package/es/virtual-list/type/index.js +1 -0
- package/lib/api/component/class-name.d.ts +3 -0
- package/lib/api/component/class-name.js +23 -0
- package/lib/api/component/common.d.ts +22 -0
- package/lib/api/component/common.js +163 -0
- package/lib/api/component/dom.d.ts +2 -0
- package/lib/api/component/dom.js +14 -0
- package/lib/api/component/global-style.d.ts +3 -0
- package/lib/api/component/global-style.js +23 -0
- package/lib/api/component/index.d.ts +9 -0
- package/lib/api/component/index.js +104 -0
- package/lib/api/component/react-dom.d.ts +3 -0
- package/lib/api/component/react-dom.js +80 -0
- package/lib/api/component/sort.d.ts +2 -0
- package/lib/api/component/sort.js +28 -0
- package/lib/api/component/style.d.ts +4 -0
- package/lib/api/component/style.js +43 -0
- package/lib/api/component/url.d.ts +33 -0
- package/lib/api/component/url.js +133 -0
- package/lib/api/component/validate-input.d.ts +8 -0
- package/lib/api/component/validate-input.js +24 -0
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +27 -0
- package/lib/api/type/common.d.ts +24 -0
- package/lib/api/type/common.js +5 -0
- package/lib/api/type/index.d.ts +5 -0
- package/lib/api/type/index.js +16 -0
- package/lib/button/component/index.d.ts +2 -0
- package/lib/button/component/index.js +94 -0
- package/lib/button/index.d.ts +2 -0
- package/lib/button/index.js +27 -0
- package/lib/button/type/index.d.ts +31 -0
- package/lib/button/type/index.js +5 -0
- package/lib/checkbox/component/checkbox-group.d.ts +2 -0
- package/lib/checkbox/component/checkbox-group.js +73 -0
- package/lib/checkbox/component/checkbox.d.ts +2 -0
- package/lib/checkbox/component/checkbox.js +15 -0
- package/lib/checkbox/component/index.d.ts +2 -0
- package/lib/checkbox/component/index.js +17 -0
- package/lib/checkbox/component/use-checkbox.d.ts +12 -0
- package/lib/checkbox/component/use-checkbox.js +50 -0
- package/lib/checkbox/component/utils.d.ts +13 -0
- package/lib/checkbox/component/utils.js +47 -0
- package/lib/checkbox/index.d.ts +2 -0
- package/lib/checkbox/index.js +27 -0
- package/lib/checkbox/style/index.d.ts +5 -0
- package/lib/checkbox/style/index.js +18 -0
- package/lib/checkbox/type/index.d.ts +18 -0
- package/lib/checkbox/type/index.js +5 -0
- package/lib/config/index.d.ts +0 -0
- package/lib/config/index.js +1 -0
- package/lib/date-picker/component/index.d.ts +3 -0
- package/lib/date-picker/component/index.js +46 -0
- package/lib/date-picker/index.d.ts +2 -0
- package/lib/date-picker/index.js +27 -0
- package/lib/date-picker/style/index.d.ts +4 -0
- package/lib/date-picker/style/index.js +14 -0
- package/lib/date-picker/type/index.d.ts +21 -0
- package/lib/date-picker/type/index.js +5 -0
- package/lib/empty/component/index.d.ts +2 -0
- package/lib/empty/component/index.js +24 -0
- package/lib/empty/index.d.ts +2 -0
- package/lib/empty/index.js +27 -0
- package/lib/empty/type/index.d.ts +9 -0
- package/lib/empty/type/index.js +5 -0
- package/lib/form/component/constant.d.ts +15 -0
- package/lib/form/component/constant.js +21 -0
- package/lib/form/component/form-content.d.ts +10 -0
- package/lib/form/component/form-content.js +288 -0
- package/lib/form/component/form-item-map.d.ts +40 -0
- package/lib/form/component/form-item-map.js +128 -0
- package/lib/form/component/form-item.d.ts +7 -0
- package/lib/form/component/form-item.js +227 -0
- package/lib/form/component/form-list.d.ts +36 -0
- package/lib/form/component/form-list.js +201 -0
- package/lib/form/component/form.d.ts +2 -0
- package/lib/form/component/form.js +47 -0
- package/lib/form/component/index.d.ts +15 -0
- package/lib/form/component/index.js +20 -0
- package/lib/form/component/submit-button.d.ts +2 -0
- package/lib/form/component/submit-button.js +54 -0
- package/lib/form/component/use-debug.d.ts +1 -0
- package/lib/form/component/use-debug.js +22 -0
- package/lib/form/component/utils.d.ts +95 -0
- package/lib/form/component/utils.js +467 -0
- package/lib/form/component/validator-item.d.ts +7 -0
- package/lib/form/component/validator-item.js +60 -0
- package/lib/form/hook/index.d.ts +16 -0
- package/lib/form/hook/index.js +163 -0
- package/lib/form/hook/list-provider.d.ts +6 -0
- package/lib/form/hook/list-provider.js +24 -0
- package/lib/form/hook/provider.d.ts +23 -0
- package/lib/form/hook/provider.js +30 -0
- package/lib/form/hook/use-form.d.ts +2 -0
- package/lib/form/hook/use-form.js +342 -0
- package/lib/form/index.d.ts +3 -0
- package/lib/form/index.js +38 -0
- package/lib/form/style/form-item.d.ts +3 -0
- package/lib/form/style/form-item.js +46 -0
- package/lib/form/style/index.d.ts +7 -0
- package/lib/form/style/index.js +32 -0
- package/lib/form/type/form-item.d.ts +141 -0
- package/lib/form/type/form-item.js +5 -0
- package/lib/form/type/form-list.d.ts +91 -0
- package/lib/form/type/form-list.js +5 -0
- package/lib/form/type/index.d.ts +134 -0
- package/lib/form/type/index.js +27 -0
- package/lib/grid/component/index.d.ts +2 -0
- package/lib/grid/component/index.js +83 -0
- package/lib/grid/component/pagination.d.ts +50 -0
- package/lib/grid/component/pagination.js +62 -0
- package/lib/grid/component/utils.d.ts +2 -0
- package/lib/grid/component/utils.js +14 -0
- package/lib/grid/index.d.ts +2 -0
- package/lib/grid/index.js +27 -0
- package/lib/grid/style/index.d.ts +11 -0
- package/lib/grid/style/index.js +33 -0
- package/lib/grid/type/index.d.ts +67 -0
- package/lib/grid/type/index.js +5 -0
- package/lib/highlight-text/component/index.d.ts +2 -0
- package/lib/highlight-text/component/index.js +78 -0
- package/lib/highlight-text/index.d.ts +2 -0
- package/lib/highlight-text/index.js +27 -0
- package/lib/highlight-text/style/index.d.ts +4 -0
- package/lib/highlight-text/style/index.js +14 -0
- package/lib/highlight-text/type/index.d.ts +18 -0
- package/lib/highlight-text/type/index.js +5 -0
- package/lib/hooks/hook/common.d.ts +1 -0
- package/lib/hooks/hook/common.js +18 -0
- package/lib/hooks/hook/index.d.ts +7 -0
- package/lib/hooks/hook/index.js +82 -0
- package/lib/hooks/hook/use-debounce.d.ts +4 -0
- package/lib/hooks/hook/use-debounce.js +32 -0
- package/lib/hooks/hook/use-deep.d.ts +9 -0
- package/lib/hooks/hook/use-deep.js +76 -0
- package/lib/hooks/hook/use-fetch.d.ts +8 -0
- package/lib/hooks/hook/use-fetch.js +171 -0
- package/lib/hooks/hook/use-list-operation.d.ts +5 -0
- package/lib/hooks/hook/use-list-operation.js +80 -0
- package/lib/hooks/hook/use-loading.d.ts +7 -0
- package/lib/hooks/hook/use-loading.js +66 -0
- package/lib/hooks/hook/use-window-resize.d.ts +5 -0
- package/lib/hooks/hook/use-window-resize.js +22 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +27 -0
- package/lib/hooks/type/index.d.ts +2 -0
- package/lib/hooks/type/index.js +27 -0
- package/lib/hooks/type/use-fetch.d.ts +31 -0
- package/lib/hooks/type/use-fetch.js +5 -0
- package/lib/hooks/type/use-list-operation.d.ts +34 -0
- package/lib/hooks/type/use-list-operation.js +5 -0
- package/lib/icon/component/down.d.ts +2 -0
- package/lib/icon/component/down.js +50 -0
- package/lib/icon/component/index.d.ts +2 -0
- package/lib/icon/component/index.js +27 -0
- package/lib/icon/component/up.d.ts +2 -0
- package/lib/icon/component/up.js +49 -0
- package/lib/icon/hook/index.d.ts +477 -0
- package/lib/icon/hook/index.js +67 -0
- package/lib/icon/index.d.ts +2 -0
- package/lib/icon/index.js +27 -0
- package/lib/icon/style/index.d.ts +4 -0
- package/lib/icon/style/index.js +17 -0
- package/lib/icon/type/index.d.ts +14 -0
- package/lib/icon/type/index.js +5 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.js +345 -0
- package/lib/input/component/index.d.ts +12 -0
- package/lib/input/component/index.js +33 -0
- package/lib/input/component/input.d.ts +2 -0
- package/lib/input/component/input.js +15 -0
- package/lib/input/component/number.d.ts +4 -0
- package/lib/input/component/number.js +57 -0
- package/lib/input/component/password.d.ts +2 -0
- package/lib/input/component/password.js +15 -0
- package/lib/input/component/text-area.d.ts +2 -0
- package/lib/input/component/text-area.js +23 -0
- package/lib/input/component/utils.d.ts +15 -0
- package/lib/input/component/utils.js +114 -0
- package/lib/input/index.d.ts +2 -0
- package/lib/input/index.js +27 -0
- package/lib/input/style/index.d.ts +6 -0
- package/lib/input/style/index.js +18 -0
- package/lib/input/type/index.d.ts +41 -0
- package/lib/input/type/index.js +5 -0
- package/lib/modal-prompt/component/index.d.ts +5 -0
- package/lib/modal-prompt/component/index.js +85 -0
- package/lib/modal-prompt/component/open-loading.d.ts +2 -0
- package/lib/modal-prompt/component/open-loading.js +28 -0
- package/lib/modal-prompt/component/utils.d.ts +4 -0
- package/lib/modal-prompt/component/utils.js +57 -0
- package/lib/modal-prompt/index.d.ts +2 -0
- package/lib/modal-prompt/index.js +27 -0
- package/lib/modal-prompt/style/index.d.ts +5 -0
- package/lib/modal-prompt/style/index.js +16 -0
- package/lib/modal-prompt/type/index.d.ts +36 -0
- package/lib/modal-prompt/type/index.js +5 -0
- package/lib/open-modal/component/constant.d.ts +1 -0
- package/lib/open-modal/component/constant.js +10 -0
- package/lib/open-modal/component/footer.d.ts +2 -0
- package/lib/open-modal/component/footer.js +41 -0
- package/lib/open-modal/component/index.d.ts +4 -0
- package/lib/open-modal/component/index.js +30 -0
- package/lib/open-modal/component/modal.d.ts +10 -0
- package/lib/open-modal/component/modal.js +44 -0
- package/lib/open-modal/component/title.d.ts +6 -0
- package/lib/open-modal/component/title.js +18 -0
- package/lib/open-modal/component/use-modal.d.ts +14 -0
- package/lib/open-modal/component/use-modal.js +184 -0
- package/lib/open-modal/component/utils.d.ts +11 -0
- package/lib/open-modal/component/utils.js +117 -0
- package/lib/open-modal/hook/index.d.ts +7 -0
- package/lib/open-modal/hook/index.js +40 -0
- package/lib/open-modal/hook/use-modal.d.ts +6 -0
- package/lib/open-modal/hook/use-modal.js +34 -0
- package/lib/open-modal/index.d.ts +3 -0
- package/lib/open-modal/index.js +38 -0
- package/lib/open-modal/style/index.d.ts +5 -0
- package/lib/open-modal/style/index.js +25 -0
- package/lib/open-modal/style/wrap.d.ts +2 -0
- package/lib/open-modal/style/wrap.js +13 -0
- package/lib/open-modal/type/index.d.ts +91 -0
- package/lib/open-modal/type/index.js +5 -0
- package/lib/portal/component/index.d.ts +2 -0
- package/lib/portal/component/index.js +47 -0
- package/lib/portal/index.d.ts +2 -0
- package/lib/portal/index.js +27 -0
- package/lib/portal/type/index.d.ts +13 -0
- package/lib/portal/type/index.js +5 -0
- package/lib/radio/component/abstract-box.d.ts +380 -0
- package/lib/radio/component/abstract-box.js +98 -0
- package/lib/radio/component/index.d.ts +2 -0
- package/lib/radio/component/index.js +17 -0
- package/lib/radio/component/radio.d.ts +2 -0
- package/lib/radio/component/radio.js +17 -0
- package/lib/radio/component/redio-group.d.ts +2 -0
- package/lib/radio/component/redio-group.js +57 -0
- package/lib/radio/component/use-box-options.d.ts +6 -0
- package/lib/radio/component/use-box-options.js +27 -0
- package/lib/radio/component/use-radio.d.ts +23 -0
- package/lib/radio/component/use-radio.js +28 -0
- package/lib/radio/component/utils.d.ts +7 -0
- package/lib/radio/component/utils.js +33 -0
- package/lib/radio/index.d.ts +2 -0
- package/lib/radio/index.js +27 -0
- package/lib/radio/style/index.d.ts +7 -0
- package/lib/radio/style/index.js +22 -0
- package/lib/radio/type/index.d.ts +32 -0
- package/lib/radio/type/index.js +5 -0
- package/lib/select/component/constant.d.ts +1 -0
- package/lib/select/component/constant.js +7 -0
- package/lib/select/component/index.d.ts +3 -0
- package/lib/select/component/index.js +29 -0
- package/lib/select/component/loading.d.ts +1 -0
- package/lib/select/component/loading.js +20 -0
- package/lib/select/component/use-select-options.d.ts +11 -0
- package/lib/select/component/use-select-options.js +88 -0
- package/lib/select/component/use-select.d.ts +2 -0
- package/lib/select/component/use-select.js +143 -0
- package/lib/select/component/utils.d.ts +14 -0
- package/lib/select/component/utils.js +152 -0
- package/lib/select/index.d.ts +2 -0
- package/lib/select/index.js +27 -0
- package/lib/select/style/index.d.ts +4 -0
- package/lib/select/style/index.js +14 -0
- package/lib/select/type/index.d.ts +105 -0
- package/lib/select/type/index.js +5 -0
- package/lib/stack/component/center-stack.d.ts +2 -0
- package/lib/stack/component/center-stack.js +39 -0
- package/lib/stack/component/h-stack.d.ts +2 -0
- package/lib/stack/component/h-stack.js +46 -0
- package/lib/stack/component/index.d.ts +3 -0
- package/lib/stack/component/index.js +38 -0
- package/lib/stack/component/v-stack.d.ts +2 -0
- package/lib/stack/component/v-stack.js +43 -0
- package/lib/stack/index.d.ts +2 -0
- package/lib/stack/index.js +27 -0
- package/lib/stack/style/index.d.ts +21 -0
- package/lib/stack/style/index.js +59 -0
- package/lib/stack/type/index.d.ts +54 -0
- package/lib/stack/type/index.js +5 -0
- package/lib/switch/component/index.d.ts +2 -0
- package/lib/switch/component/index.js +67 -0
- package/lib/switch/index.d.ts +2 -0
- package/lib/switch/index.js +27 -0
- package/lib/switch/style/index.d.ts +5 -0
- package/lib/switch/style/index.js +20 -0
- package/lib/switch/type/index.d.ts +27 -0
- package/lib/switch/type/index.js +5 -0
- package/lib/table/component/action-button.d.ts +2 -0
- package/lib/table/component/action-button.js +102 -0
- package/lib/table/component/actions.d.ts +2 -0
- package/lib/table/component/actions.js +42 -0
- package/lib/table/component/constant.d.ts +1 -0
- package/lib/table/component/constant.js +12 -0
- package/lib/table/component/editor.d.ts +2 -0
- package/lib/table/component/editor.js +42 -0
- package/lib/table/component/filter.d.ts +3 -0
- package/lib/table/component/filter.js +62 -0
- package/lib/table/component/index.d.ts +7 -0
- package/lib/table/component/index.js +10 -0
- package/lib/table/component/link.d.ts +2 -0
- package/lib/table/component/link.js +27 -0
- package/lib/table/component/sort.d.ts +6 -0
- package/lib/table/component/sort.js +24 -0
- package/lib/table/component/switch.d.ts +2 -0
- package/lib/table/component/switch.js +34 -0
- package/lib/table/component/table-body.d.ts +6 -0
- package/lib/table/component/table-body.js +95 -0
- package/lib/table/component/table.d.ts +10 -0
- package/lib/table/component/table.js +243 -0
- package/lib/table/component/time.d.ts +2 -0
- package/lib/table/component/time.js +19 -0
- package/lib/table/component/utils.d.ts +120 -0
- package/lib/table/component/utils.js +235 -0
- package/lib/table/component/wrapper.d.ts +6 -0
- package/lib/table/component/wrapper.js +37 -0
- package/lib/table/hook/index.d.ts +7 -0
- package/lib/table/hook/index.js +40 -0
- package/lib/table/hook/search.d.ts +5 -0
- package/lib/table/hook/search.js +138 -0
- package/lib/table/index.d.ts +3 -0
- package/lib/table/index.js +38 -0
- package/lib/table/style/index.d.ts +9 -0
- package/lib/table/style/index.js +23 -0
- package/lib/table/type/action.d.ts +48 -0
- package/lib/table/type/action.js +5 -0
- package/lib/table/type/column.d.ts +110 -0
- package/lib/table/type/column.js +5 -0
- package/lib/table/type/index.d.ts +113 -0
- package/lib/table/type/index.js +27 -0
- package/lib/tabs/component/constant.d.ts +2 -0
- package/lib/tabs/component/constant.js +8 -0
- package/lib/tabs/component/index.d.ts +2 -0
- package/lib/tabs/component/index.js +25 -0
- package/lib/tabs/component/utils.d.ts +24 -0
- package/lib/tabs/component/utils.js +63 -0
- package/lib/tabs/index.d.ts +2 -0
- package/lib/tabs/index.js +27 -0
- package/lib/tabs/style/index.d.ts +5 -0
- package/lib/tabs/style/index.js +17 -0
- package/lib/tabs/type/index.d.ts +20 -0
- package/lib/tabs/type/index.js +5 -0
- package/lib/text/component/index.d.ts +3 -0
- package/lib/text/component/index.js +78 -0
- package/lib/text/component/use-text.d.ts +4 -0
- package/lib/text/component/use-text.js +31 -0
- package/lib/text/component/utils.d.ts +3 -0
- package/lib/text/component/utils.js +15 -0
- package/lib/text/index.d.ts +2 -0
- package/lib/text/index.js +27 -0
- package/lib/text/style/index.d.ts +5 -0
- package/lib/text/style/index.js +15 -0
- package/lib/text/type/index.d.ts +19 -0
- package/lib/text/type/index.js +5 -0
- package/lib/tooltip/component/index.d.ts +48 -0
- package/lib/tooltip/component/index.js +28 -0
- package/lib/tooltip/index.d.ts +2 -0
- package/lib/tooltip/index.js +27 -0
- package/lib/tooltip/type/index.d.ts +8 -0
- package/lib/tooltip/type/index.js +5 -0
- package/lib/tree/component/index.d.ts +2 -0
- package/lib/tree/component/index.js +30 -0
- package/lib/tree/component/utils.d.ts +1 -0
- package/lib/tree/component/utils.js +9 -0
- package/lib/tree/index.d.ts +2 -0
- package/lib/tree/index.js +27 -0
- package/lib/tree/style/index.d.ts +4 -0
- package/lib/tree/style/index.js +14 -0
- package/lib/tree/type/index.d.ts +2 -0
- package/lib/tree/type/index.js +5 -0
- package/lib/tree-select/component/index.d.ts +2 -0
- package/lib/tree-select/component/index.js +22 -0
- package/lib/tree-select/component/use-tree-select.d.ts +2 -0
- package/lib/tree-select/component/use-tree-select.js +66 -0
- package/lib/tree-select/index.d.ts +2 -0
- package/lib/tree-select/index.js +27 -0
- package/lib/tree-select/style/index.d.ts +5 -0
- package/lib/tree-select/style/index.js +22 -0
- package/lib/tree-select/type/index.d.ts +23 -0
- package/lib/tree-select/type/index.js +5 -0
- package/lib/virtual-list/component/index.d.ts +2 -0
- package/lib/virtual-list/component/index.js +35 -0
- package/lib/virtual-list/index.d.ts +2 -0
- package/lib/virtual-list/index.js +27 -0
- package/lib/virtual-list/type/index.d.ts +17 -0
- package/lib/virtual-list/type/index.js +5 -0
- package/package.json +147 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { FunctionReturn } from "../../api";
|
|
2
|
+
import { FormProps } from "../../form";
|
|
3
|
+
import { ListOperation } from "../../hooks";
|
|
4
|
+
import { Column } from "..";
|
|
5
|
+
import { TableProps as AntdTableProps } from 'antd';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
export * from './action';
|
|
8
|
+
export * from './column';
|
|
9
|
+
export type DataSource = any[];
|
|
10
|
+
export interface TableContext {
|
|
11
|
+
/**
|
|
12
|
+
* @description 表格数据
|
|
13
|
+
*/
|
|
14
|
+
dataSource: DataSource;
|
|
15
|
+
/**
|
|
16
|
+
* @description 修改表格数据
|
|
17
|
+
*/
|
|
18
|
+
setDataSource(data: DataSource): void;
|
|
19
|
+
/**
|
|
20
|
+
* @description 选中的行 `key`
|
|
21
|
+
*/
|
|
22
|
+
selectedRowKeys: string[];
|
|
23
|
+
/**
|
|
24
|
+
* @description 设置选中的行 `key`
|
|
25
|
+
*/
|
|
26
|
+
setSelectedRowKeys(keys?: string[]): void;
|
|
27
|
+
/**
|
|
28
|
+
* @description 刷新表格
|
|
29
|
+
*/
|
|
30
|
+
refresh(props?: RefreshProps): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* @description 操作表单的方法
|
|
33
|
+
* @link ListOperation: /components/hooks#listoperation
|
|
34
|
+
*/
|
|
35
|
+
operation: ListOperation;
|
|
36
|
+
/**
|
|
37
|
+
* @description 设置表格上下文
|
|
38
|
+
*/
|
|
39
|
+
setContext(state: any): void;
|
|
40
|
+
rowKey: string;
|
|
41
|
+
editorValueKey: string;
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
44
|
+
export interface RefreshProps {
|
|
45
|
+
/**
|
|
46
|
+
* @description 是否只显示 loading 状态
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
onlyLoading?: boolean;
|
|
50
|
+
[name: string]: any;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @noExtends
|
|
54
|
+
*/
|
|
55
|
+
export interface CommonProps extends TableContext {
|
|
56
|
+
/**
|
|
57
|
+
* @description 当前列的值
|
|
58
|
+
*/
|
|
59
|
+
current?: any;
|
|
60
|
+
/**
|
|
61
|
+
* @description 当前行的值
|
|
62
|
+
*/
|
|
63
|
+
record: any;
|
|
64
|
+
/**
|
|
65
|
+
* @description 当前行的索引
|
|
66
|
+
*/
|
|
67
|
+
index: number;
|
|
68
|
+
[name: string]: any;
|
|
69
|
+
}
|
|
70
|
+
type UnionTableType = Omit<FormProps, 'onChange' | 'title'> & Omit<AntdTableProps<any>, 'columns' | 'dataSource' | 'scroll' | 'footer'>;
|
|
71
|
+
/**
|
|
72
|
+
* @noExtends
|
|
73
|
+
*/
|
|
74
|
+
export interface TableProps extends UnionTableType {
|
|
75
|
+
/**
|
|
76
|
+
* @description 表格列配置,具体项见下表
|
|
77
|
+
* @link Column: #column
|
|
78
|
+
*/
|
|
79
|
+
columns: Column[];
|
|
80
|
+
/**
|
|
81
|
+
* @description 表格数据
|
|
82
|
+
*/
|
|
83
|
+
dataSource?: DataSource | ((props: any) => FunctionReturn<DataSource>);
|
|
84
|
+
/**
|
|
85
|
+
* @description 每一行的唯一标示
|
|
86
|
+
* @default id
|
|
87
|
+
*/
|
|
88
|
+
rowKey?: string;
|
|
89
|
+
/**
|
|
90
|
+
* @description 表格宽度
|
|
91
|
+
* @default 100%
|
|
92
|
+
*/
|
|
93
|
+
width?: number | string;
|
|
94
|
+
/**
|
|
95
|
+
* @description 空数据时显示的文本
|
|
96
|
+
* @default No data
|
|
97
|
+
*/
|
|
98
|
+
emptyText?: ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* @description 表格最大高度
|
|
101
|
+
* @default 100%
|
|
102
|
+
*/
|
|
103
|
+
maxHeight?: number | string;
|
|
104
|
+
/**
|
|
105
|
+
* @description 点击表格行的回调
|
|
106
|
+
* @link CommonProps: #commonprops
|
|
107
|
+
*/
|
|
108
|
+
onRowClick?(props: CommonProps): FunctionReturn<void>;
|
|
109
|
+
scroll?: boolean | AntdTableProps<any>['scroll'];
|
|
110
|
+
footer?: ReactNode;
|
|
111
|
+
editorValueKey?: string;
|
|
112
|
+
autoCollectFormValue?: boolean;
|
|
113
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["tabMaxWidth"];
|
|
4
|
+
import { Tabs as AntdTabs } from 'antd';
|
|
5
|
+
import styles from "../style";
|
|
6
|
+
import { generateTabItems, getRenderTabBar } from "./utils";
|
|
7
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
8
|
+
export function Tabs(_ref) {
|
|
9
|
+
var _ref$tabMaxWidth = _ref.tabMaxWidth,
|
|
10
|
+
tabMaxWidth = _ref$tabMaxWidth === void 0 ? 200 : _ref$tabMaxWidth,
|
|
11
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
var tabsProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
13
|
+
items: generateTabItems(props),
|
|
14
|
+
renderTabBar: getRenderTabBar(props),
|
|
15
|
+
css: styles.wrapper(tabMaxWidth)
|
|
16
|
+
});
|
|
17
|
+
return _jsx(AntdTabs, _objectSpread({}, tabsProps));
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TabsProps } from "..";
|
|
3
|
+
import { RenderTabBar } from 'rc-tabs/lib/interface';
|
|
4
|
+
type RenderTabBarProps = Parameters<RenderTabBar>[0];
|
|
5
|
+
export declare function getRenderTabBar({ type, items, size, tabBarGutter, tabBarStyle }: TabsProps): (({ activeKey, onTabClick }: RenderTabBarProps) => import("@emotion/react/jsx-runtime").JSX.Element) | undefined;
|
|
6
|
+
export declare function generateTabItems({ items }: TabsProps): {
|
|
7
|
+
label: import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
key: string;
|
|
9
|
+
style?: import("react").CSSProperties | undefined;
|
|
10
|
+
children?: import("react").ReactNode;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
id?: string | undefined;
|
|
13
|
+
icon?: import("react").ReactNode;
|
|
14
|
+
prefixCls?: string | undefined;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
animated?: boolean | undefined;
|
|
17
|
+
destroyInactiveTabPane?: boolean | undefined;
|
|
18
|
+
forceRender?: boolean | undefined;
|
|
19
|
+
closable?: boolean | undefined;
|
|
20
|
+
closeIcon?: import("react").ReactNode;
|
|
21
|
+
tabKey?: string | undefined;
|
|
22
|
+
active?: boolean | undefined;
|
|
23
|
+
}[];
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { Radio } from "../../radio";
|
|
3
|
+
import { Text } from "../../text";
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import { tabPropKeys, textPropKeys } from "./constant";
|
|
6
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
7
|
+
export function getRenderTabBar(_ref) {
|
|
8
|
+
var type = _ref.type,
|
|
9
|
+
items = _ref.items,
|
|
10
|
+
size = _ref.size,
|
|
11
|
+
tabBarGutter = _ref.tabBarGutter,
|
|
12
|
+
tabBarStyle = _ref.tabBarStyle;
|
|
13
|
+
if (type !== 'radio') {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
return function (_ref2) {
|
|
17
|
+
var activeKey = _ref2.activeKey,
|
|
18
|
+
onTabClick = _ref2.onTabClick;
|
|
19
|
+
var options = _.map(items, function (item) {
|
|
20
|
+
return _objectSpread(_objectSpread({}, _.omit(item, tabPropKeys)), {}, {
|
|
21
|
+
value: item.key
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
var radioProps = {
|
|
25
|
+
size: size,
|
|
26
|
+
options: options,
|
|
27
|
+
gap: tabBarGutter,
|
|
28
|
+
style: tabBarStyle,
|
|
29
|
+
value: activeKey,
|
|
30
|
+
onChange: onTabClick
|
|
31
|
+
};
|
|
32
|
+
return _jsx(Radio, _objectSpread({}, radioProps));
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function generateTabItems(_ref3) {
|
|
36
|
+
var items = _ref3.items;
|
|
37
|
+
return _.map(items, function (item) {
|
|
38
|
+
var _parseOptionProps = parseOptionProps(item),
|
|
39
|
+
tabProps = _parseOptionProps.tabProps,
|
|
40
|
+
textProps = _parseOptionProps.textProps;
|
|
41
|
+
return _objectSpread(_objectSpread({}, tabProps), {}, {
|
|
42
|
+
label: _jsx(Text, _objectSpread(_objectSpread({}, textProps), {}, {
|
|
43
|
+
children: tabProps.label
|
|
44
|
+
}))
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function parseOptionProps(props) {
|
|
49
|
+
var textProps = _.pick(props, textPropKeys);
|
|
50
|
+
var tabProps = _.omit(props, textPropKeys);
|
|
51
|
+
return {
|
|
52
|
+
textProps: textProps,
|
|
53
|
+
tabProps: tabProps
|
|
54
|
+
};
|
|
55
|
+
}
|
package/es/tabs/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { getClassName, transformValueWithStyleUnit } from "../../api";
|
|
4
|
+
import { css } from '@emotion/react';
|
|
5
|
+
var style = {
|
|
6
|
+
wrapper: function wrapper(tabMaxWidth) {
|
|
7
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-tabs-tab-btn,\n .", " {\n max-width: ", ";\n }\n\n .ant-radio-group {\n margin-bottom: 16px;\n }\n "])), getClassName('radio'), transformValueWithStyleUnit(tabMaxWidth));
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
export default style;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SelectOption } from "../../select";
|
|
2
|
+
import { TabsProps as AntdTabsProps } from 'antd';
|
|
3
|
+
import { TabsType } from 'antd/lib/tabs';
|
|
4
|
+
import { Tab } from 'rc-tabs/lib/interface';
|
|
5
|
+
export interface TabProps extends Tab, Omit<SelectOption, 'label'> {
|
|
6
|
+
}
|
|
7
|
+
export interface TabsProps extends Omit<AntdTabsProps, 'type'> {
|
|
8
|
+
/**
|
|
9
|
+
* @description `tab` 样式
|
|
10
|
+
* @default line
|
|
11
|
+
* @replaceAll 'line' | 'card' | 'radio' | 'editable-card'
|
|
12
|
+
*/
|
|
13
|
+
type?: TabsType | 'radio';
|
|
14
|
+
/**
|
|
15
|
+
* @description `tab` 的最大宽度
|
|
16
|
+
* @default 200px
|
|
17
|
+
*/
|
|
18
|
+
tabMaxWidth?: number | string;
|
|
19
|
+
items?: TabProps[];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "tooltip", "rows", "autoShowTooltip"];
|
|
4
|
+
import { generateTooltip } from "./..";
|
|
5
|
+
import { getTooltipProps } from "../../tooltip";
|
|
6
|
+
import { Tooltip, Typography } from 'antd';
|
|
7
|
+
import style from "../style";
|
|
8
|
+
import { useText } from "./use-text";
|
|
9
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
10
|
+
var Paragraph = Typography.Paragraph;
|
|
11
|
+
export function Text(_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
13
|
+
tooltip = _ref.tooltip,
|
|
14
|
+
_ref$rows = _ref.rows,
|
|
15
|
+
rows = _ref$rows === void 0 ? 1 : _ref$rows,
|
|
16
|
+
_ref$autoShowTooltip = _ref.autoShowTooltip,
|
|
17
|
+
autoShowTooltip = _ref$autoShowTooltip === void 0 ? true : _ref$autoShowTooltip,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var _useText = useText({
|
|
20
|
+
children: children
|
|
21
|
+
}),
|
|
22
|
+
key = _useText.key;
|
|
23
|
+
if (tooltip === false || !rows) {
|
|
24
|
+
return _jsx("div", _objectSpread(_objectSpread({
|
|
25
|
+
css: style.wordBreak
|
|
26
|
+
}, props), {}, {
|
|
27
|
+
children: children
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
var ellipsis = {
|
|
31
|
+
rows: rows,
|
|
32
|
+
tooltip: getTooltipProps(_objectSpread({
|
|
33
|
+
align: {
|
|
34
|
+
offset: [0, 5]
|
|
35
|
+
}
|
|
36
|
+
}, generateTooltip(tooltip !== null && tooltip !== void 0 ? tooltip : children)))
|
|
37
|
+
};
|
|
38
|
+
if (autoShowTooltip) {
|
|
39
|
+
return _jsx(Paragraph, _objectSpread(_objectSpread({
|
|
40
|
+
css: style.wrapper
|
|
41
|
+
}, props), {}, {
|
|
42
|
+
ellipsis: ellipsis,
|
|
43
|
+
children: children
|
|
44
|
+
}), key);
|
|
45
|
+
}
|
|
46
|
+
return _jsx(Tooltip, _objectSpread(_objectSpread({}, ellipsis.tooltip), {}, {
|
|
47
|
+
children: _jsx(Paragraph, _objectSpread(_objectSpread({
|
|
48
|
+
css: style.wrapper
|
|
49
|
+
}, props), {}, {
|
|
50
|
+
ellipsis: {
|
|
51
|
+
rows: rows
|
|
52
|
+
},
|
|
53
|
+
children: children
|
|
54
|
+
}))
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
export * from "./utils";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import { useDebounce, useWindowResize } from "../../hooks";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { useUpdateEffect } from 'react-use';
|
|
5
|
+
export function useText(_ref) {
|
|
6
|
+
var children = _ref.children;
|
|
7
|
+
var _useState = useState(0),
|
|
8
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9
|
+
key = _useState2[0],
|
|
10
|
+
setKey = _useState2[1];
|
|
11
|
+
var reset = useDebounce(setKey, 150);
|
|
12
|
+
useWindowResize(function (_ref2) {
|
|
13
|
+
var width = _ref2.width;
|
|
14
|
+
return reset(width);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// 修复某些场景下,tooltip 会自动显示的问题
|
|
18
|
+
useUpdateEffect(function () {
|
|
19
|
+
reset(Date.now());
|
|
20
|
+
}, [children]);
|
|
21
|
+
return {
|
|
22
|
+
key: key
|
|
23
|
+
};
|
|
24
|
+
}
|
package/es/text/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
var style = {
|
|
5
|
+
wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.ant-typography {\n color: inherit;\n margin-bottom: 0;\n max-width: 100%;\n }\n "]))),
|
|
6
|
+
wordBreak: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n white-space: pre-wrap;\n word-wrap: break-word;\n word-break: break-word;\n "])))
|
|
7
|
+
};
|
|
8
|
+
export default style;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EllipsisConfig } from 'antd/lib/typography/Base';
|
|
2
|
+
import type { TypographyProps } from 'antd/lib/typography/Typography';
|
|
3
|
+
export interface TextProps extends Omit<TypographyProps<any>, 'onChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* @description 最多显示的行数,设置为 `0` 时,不显示省略号
|
|
6
|
+
* @default 1
|
|
7
|
+
*/
|
|
8
|
+
rows?: number | false;
|
|
9
|
+
/**
|
|
10
|
+
* @description 提示信息
|
|
11
|
+
* @replaceAll ReactNode | TooltipProps
|
|
12
|
+
* @link TooltipProps: https://4x.ant.design/components/tooltip-cn/#API
|
|
13
|
+
*/
|
|
14
|
+
tooltip?: EllipsisConfig['tooltip'];
|
|
15
|
+
/**
|
|
16
|
+
* 只有当文本超出时,才显示提示信息,设置为 `false` 时,始终显示提示信息
|
|
17
|
+
*/
|
|
18
|
+
autoShowTooltip?: boolean;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { getPopupContainer } from "../../api";
|
|
3
|
+
import { TooltipProps } from "..";
|
|
4
|
+
export declare const tooltipOverlayClassName: string;
|
|
5
|
+
export declare function getTooltipProps(props: TooltipProps): {
|
|
6
|
+
color?: string | undefined;
|
|
7
|
+
title?: import("react").ReactNode | import("antd/lib/tooltip").RenderFunction;
|
|
8
|
+
overlay?: import("react").ReactNode | import("antd/lib/tooltip").RenderFunction;
|
|
9
|
+
style?: import("react").CSSProperties | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
placement?: import("antd/lib/tooltip").TooltipPlacement | undefined;
|
|
12
|
+
builtinPlacements?: import("rc-trigger").BuildInPlacements | undefined;
|
|
13
|
+
openClassName?: string | undefined;
|
|
14
|
+
arrowPointAtCenter: boolean;
|
|
15
|
+
autoAdjustOverflow?: boolean | import("antd/lib/tooltip").AdjustOverflow | undefined;
|
|
16
|
+
getPopupContainer: typeof getPopupContainer;
|
|
17
|
+
children?: import("react").ReactNode;
|
|
18
|
+
visible?: boolean | undefined;
|
|
19
|
+
open?: boolean | undefined;
|
|
20
|
+
defaultVisible?: boolean | undefined;
|
|
21
|
+
defaultOpen?: boolean | undefined;
|
|
22
|
+
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
23
|
+
onOpenChange?: ((visible: boolean) => void) | undefined;
|
|
24
|
+
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
25
|
+
afterOpenChange?: ((visible: boolean) => void) | undefined;
|
|
26
|
+
zIndex?: number | undefined;
|
|
27
|
+
animation?: string | undefined;
|
|
28
|
+
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
29
|
+
id?: string | undefined;
|
|
30
|
+
onPopupAlign?: ((element: HTMLElement, align: import("rc-trigger/lib/interface").AlignType) => void) | undefined;
|
|
31
|
+
trigger?: string | string[] | undefined;
|
|
32
|
+
transitionName?: string | undefined;
|
|
33
|
+
overlayStyle?: import("react").CSSProperties | undefined;
|
|
34
|
+
overlayClassName: string;
|
|
35
|
+
prefixCls?: string | undefined;
|
|
36
|
+
mouseEnterDelay?: number | undefined;
|
|
37
|
+
mouseLeaveDelay?: number | undefined;
|
|
38
|
+
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
39
|
+
destroyTooltipOnHide?: boolean | {
|
|
40
|
+
keepParent?: boolean | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
align?: import("rc-trigger/lib/interface").AlignType | undefined;
|
|
43
|
+
showArrow?: boolean | undefined;
|
|
44
|
+
arrowContent?: import("react").ReactNode;
|
|
45
|
+
popupVisible?: boolean | undefined;
|
|
46
|
+
overlayInnerStyle?: import("react").CSSProperties | undefined;
|
|
47
|
+
};
|
|
48
|
+
export declare function Tooltip(props: TooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
|
+
var _templateObject;
|
|
4
|
+
import { getPopupContainer } from "../../api";
|
|
5
|
+
import { css } from '@emotion/css';
|
|
6
|
+
import { Tooltip as AntdTooltip } from 'antd';
|
|
7
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
8
|
+
export var tooltipOverlayClassName = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n --tooltip-background-color: #02334a;\n\n .ant-tooltip-inner {\n border-radius: 8px;\n white-space: pre-wrap;\n line-height: 1.3;\n background-color: var(--tooltip-background-color);\n }\n\n .ant-tooltip-arrow-content {\n --antd-arrow-background-color: var(--tooltip-background-color);\n }\n"])));
|
|
9
|
+
export function getTooltipProps(props) {
|
|
10
|
+
return _objectSpread({
|
|
11
|
+
overlayClassName: tooltipOverlayClassName,
|
|
12
|
+
arrowPointAtCenter: true,
|
|
13
|
+
getPopupContainer: getPopupContainer
|
|
14
|
+
}, props);
|
|
15
|
+
}
|
|
16
|
+
export function Tooltip(props) {
|
|
17
|
+
var mergedProps = getTooltipProps(props);
|
|
18
|
+
return _jsx(AntdTooltip, _objectSpread({}, mergedProps));
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import { VStack } from "../../stack";
|
|
4
|
+
import { TreeSelect } from "../../tree-select";
|
|
5
|
+
import { useMeasure } from 'react-use';
|
|
6
|
+
import styles from "../style";
|
|
7
|
+
import { getPopupContainer } from "./utils";
|
|
8
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
9
|
+
export function Tree(props) {
|
|
10
|
+
var _useMeasure = useMeasure(),
|
|
11
|
+
_useMeasure2 = _slicedToArray(_useMeasure, 2),
|
|
12
|
+
ref = _useMeasure2[0],
|
|
13
|
+
height = _useMeasure2[1].height;
|
|
14
|
+
return _jsx(VStack, {
|
|
15
|
+
refs: ref,
|
|
16
|
+
css: styles.wrapper,
|
|
17
|
+
children: _jsx(TreeSelect, _objectSpread({
|
|
18
|
+
open: true,
|
|
19
|
+
getPopupContainer: getPopupContainer,
|
|
20
|
+
listHeight: height
|
|
21
|
+
}, props))
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getPopupContainer(trigger: HTMLElement): HTMLElement;
|
package/es/tree/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
var style = {
|
|
5
|
+
wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n\n .ant-select-tree,\n .ant-tree-select-dropdown {\n background: unset;\n box-shadow: unset;\n }\n\n .ant-select-selector,\n .ant-select-arrow {\n opacity: 0 !important;\n height: 0 !important;\n border: none !important;\n padding: 0 !important;\n overflow: hidden !important;\n\n ~ div {\n position: unset !important;\n }\n }\n\n .ant-tree-select-dropdown {\n position: unset !important;\n width: 100% !important;\n min-width: unset !important;\n padding: 0;\n }\n "])))
|
|
6
|
+
};
|
|
7
|
+
export default style;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { TreeSelect as AntdTreeSelect } from 'antd';
|
|
3
|
+
import { useTreeSelect } from "./use-tree-select";
|
|
4
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
5
|
+
export function TreeSelect(props) {
|
|
6
|
+
var params = useTreeSelect(props);
|
|
7
|
+
return _jsx(AntdTreeSelect, _objectSpread({
|
|
8
|
+
maxTagCount: "responsive",
|
|
9
|
+
fieldNames: {
|
|
10
|
+
label: 'label',
|
|
11
|
+
value: 'value',
|
|
12
|
+
children: 'options'
|
|
13
|
+
}
|
|
14
|
+
}, params));
|
|
15
|
+
}
|