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,59 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["presetProcessOption", "treeNodeAlign"],
|
|
4
|
+
_excluded2 = ["optionFilterProp", "optionLabelProp", "options", "popupClassName", "activeBackgroundColor", "indent", "multiple"];
|
|
5
|
+
import { Checkbox } from "../../checkbox";
|
|
6
|
+
import { useSelect } from "../../select/component/use-select";
|
|
7
|
+
import { cx } from '@emotion/css';
|
|
8
|
+
import style from "../style";
|
|
9
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
10
|
+
export function useTreeSelect(_ref) {
|
|
11
|
+
var presetProcessOption = _ref.presetProcessOption,
|
|
12
|
+
_ref$treeNodeAlign = _ref.treeNodeAlign,
|
|
13
|
+
treeNodeAlign = _ref$treeNodeAlign === void 0 ? 'center' : _ref$treeNodeAlign,
|
|
14
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
var _useSelect = useSelect(_objectSpread(_objectSpread({}, props), {}, {
|
|
16
|
+
presetProcessOption: processOption
|
|
17
|
+
})),
|
|
18
|
+
treeNodeFilterProp = _useSelect.optionFilterProp,
|
|
19
|
+
treeNodeLabelProp = _useSelect.optionLabelProp,
|
|
20
|
+
treeData = _useSelect.options,
|
|
21
|
+
popupClassName = _useSelect.popupClassName,
|
|
22
|
+
_useSelect$activeBack = _useSelect.activeBackgroundColor,
|
|
23
|
+
activeBackgroundColor = _useSelect$activeBack === void 0 ? '#e6f7ff' : _useSelect$activeBack,
|
|
24
|
+
indent = _useSelect.indent,
|
|
25
|
+
multiple = _useSelect.multiple,
|
|
26
|
+
params = _objectWithoutProperties(_useSelect, _excluded2);
|
|
27
|
+
function processOption(option) {
|
|
28
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
29
|
+
icon: function icon(_ref2) {
|
|
30
|
+
var checked = _ref2.checked,
|
|
31
|
+
halfChecked = _ref2.halfChecked,
|
|
32
|
+
disabled = _ref2.disabled,
|
|
33
|
+
boxTooltip = _ref2.boxTooltip;
|
|
34
|
+
return _jsx(Checkbox, {
|
|
35
|
+
value: checked,
|
|
36
|
+
indeterminate: halfChecked,
|
|
37
|
+
disabled: disabled,
|
|
38
|
+
boxTooltip: boxTooltip
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}, presetProcessOption === null || presetProcessOption === void 0 ? void 0 : presetProcessOption(option));
|
|
42
|
+
}
|
|
43
|
+
var classString = style.wrapper({
|
|
44
|
+
activeBackgroundColor: activeBackgroundColor,
|
|
45
|
+
indent: indent,
|
|
46
|
+
switcherIcon: params.switcherIcon,
|
|
47
|
+
treeNodeAlign: treeNodeAlign
|
|
48
|
+
});
|
|
49
|
+
return _objectSpread({
|
|
50
|
+
treeNodeFilterProp: treeNodeFilterProp,
|
|
51
|
+
treeNodeLabelProp: treeNodeLabelProp,
|
|
52
|
+
treeData: treeData,
|
|
53
|
+
multiple: multiple,
|
|
54
|
+
popupClassName: cx(popupClassName, classString),
|
|
55
|
+
treeCheckable: multiple,
|
|
56
|
+
treeExpandAction: multiple ? false : 'click',
|
|
57
|
+
treeIcon: multiple
|
|
58
|
+
}, params);
|
|
59
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { transformValueWithStyleUnit } from "../../api";
|
|
4
|
+
import { getAlign } from "../../stack/style";
|
|
5
|
+
import { css } from '@emotion/css';
|
|
6
|
+
var style = {
|
|
7
|
+
wrapper: function wrapper(_ref) {
|
|
8
|
+
var activeBackgroundColor = _ref.activeBackgroundColor,
|
|
9
|
+
indent = _ref.indent,
|
|
10
|
+
switcherIcon = _ref.switcherIcon,
|
|
11
|
+
treeNodeAlign = _ref.treeNodeAlign;
|
|
12
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n span.ant-select-tree-node-content-wrapper {\n display: flex;\n align-items: ", ";\n overflow: hidden;\n\n &.ant-select-tree-node-selected {\n background-color: ", ";\n }\n }\n\n .ant-select-tree .ant-select-tree-treenode {\n &:has(.ant-select-tree-indent-unit) .ant-select-tree-node-content-wrapper {\n margin-left: ", ";\n }\n\n .ant-select-tree-switcher {\n display: ", ";\n }\n\n .ant-select-tree-checkbox {\n display: none !important;\n }\n\n .ant-select-tree-iconEle {\n width: unset;\n height: unset;\n margin-right: 10px;\n }\n\n .ant-select-tree-title {\n min-width: 0;\n overflow: hidden;\n }\n }\n "])), getAlign(treeNodeAlign), activeBackgroundColor, transformValueWithStyleUnit(indent), switcherIcon === false ? 'none' : undefined);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export default style;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SelectProps } from "../../select";
|
|
2
|
+
import { HStackProps } from "../../stack";
|
|
3
|
+
import { TreeSelectProps as RCTreeSelectProps } from 'rc-tree-select/lib/TreeSelect';
|
|
4
|
+
type UnionType = Omit<SelectProps, 'fieldNames' | 'onChange' | 'onDeselect' | 'onSelect'> & RCTreeSelectProps;
|
|
5
|
+
/**
|
|
6
|
+
* @noExtends
|
|
7
|
+
*/
|
|
8
|
+
export interface TreeSelectProps extends UnionType {
|
|
9
|
+
/**
|
|
10
|
+
* @description 缩进
|
|
11
|
+
*/
|
|
12
|
+
indent?: number | string;
|
|
13
|
+
/**
|
|
14
|
+
* @description 选中的背景色
|
|
15
|
+
* @default #e6f7ff
|
|
16
|
+
*/
|
|
17
|
+
activeBackgroundColor?: string;
|
|
18
|
+
/**
|
|
19
|
+
* @default center
|
|
20
|
+
*/
|
|
21
|
+
treeNodeAlign?: HStackProps['align'];
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["data", "emptyText", "children"];
|
|
4
|
+
import { Empty } from "../../empty";
|
|
5
|
+
import _ from 'lodash';
|
|
6
|
+
import { Virtuoso } from 'react-virtuoso';
|
|
7
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
8
|
+
export function VirtualList(_ref) {
|
|
9
|
+
var data = _ref.data,
|
|
10
|
+
emptyText = _ref.emptyText,
|
|
11
|
+
children = _ref.children,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
if (_.isEmpty(data)) {
|
|
14
|
+
return _jsx("div", {
|
|
15
|
+
className: props.className,
|
|
16
|
+
style: props.style,
|
|
17
|
+
children: _jsx(Empty, {
|
|
18
|
+
description: emptyText
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return _jsx(Virtuoso, _objectSpread({
|
|
23
|
+
data: data,
|
|
24
|
+
itemContent: function itemContent(index, item, context) {
|
|
25
|
+
return children(item, index, context);
|
|
26
|
+
}
|
|
27
|
+
}, props));
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { VirtuosoProps } from 'react-virtuoso';
|
|
3
|
+
export interface VirtualListProps extends VirtuosoProps<any, any> {
|
|
4
|
+
/**
|
|
5
|
+
* @description 数据
|
|
6
|
+
*/
|
|
7
|
+
data?: any[];
|
|
8
|
+
/**
|
|
9
|
+
* @description 每一项渲染函数
|
|
10
|
+
*/
|
|
11
|
+
children(item: any, index: number, context: any): ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* @description 空数据时显示的文本
|
|
14
|
+
* @default No data
|
|
15
|
+
*/
|
|
16
|
+
emptyText?: ReactNode;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.combineClassName = combineClassName;
|
|
8
|
+
exports.getClassName = getClassName;
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _css = require("@emotion/css");
|
|
11
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
12
|
+
function getClassName(className) {
|
|
13
|
+
return "do-".concat(className);
|
|
14
|
+
}
|
|
15
|
+
function combineClassName(className) {
|
|
16
|
+
for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
17
|
+
props[_key - 1] = arguments[_key];
|
|
18
|
+
}
|
|
19
|
+
var names = _lodash.default.map(props, function (prop) {
|
|
20
|
+
return _lodash.default.isObject(prop) ? prop.className : prop;
|
|
21
|
+
});
|
|
22
|
+
return _css.cx.apply(void 0, [getClassName(className)].concat((0, _toConsumableArray2.default)(names)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FunctionType } from "..";
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export declare const isJest: boolean;
|
|
4
|
+
export declare function runDevOrJest<T, U>(fn: T, jestFn: U): any;
|
|
5
|
+
export declare function getPopupContainer(triggerNode: HTMLElement): HTMLElement;
|
|
6
|
+
export declare function executeFunction(fn: any, ...params: any[]): any;
|
|
7
|
+
export declare function renderComponentByType(component?: any, props?: any): any;
|
|
8
|
+
export declare function lowercasedContains(text?: string, search?: string): boolean;
|
|
9
|
+
export declare function uuid(): string;
|
|
10
|
+
/**
|
|
11
|
+
* 判断是否是 ReactNode,符合下面任意一个条件
|
|
12
|
+
* 1. 不是 js 对象,比如 undefined, null, number, string, boolean 等
|
|
13
|
+
* 2. 是 ReactNode
|
|
14
|
+
*/
|
|
15
|
+
export declare function isReactNode(node?: ReactNode): boolean;
|
|
16
|
+
type OptionType = string | number | boolean;
|
|
17
|
+
export declare function includesNonStrictMode(options?: Array<OptionType>, value?: OptionType | Array<OptionType>): boolean;
|
|
18
|
+
export declare function mergeProps<T, U>(originProps: T, patchProps: U): {} & T & U;
|
|
19
|
+
export declare function mergeFunction(...fns: Array<FunctionType | undefined>): (...args: any[]) => void;
|
|
20
|
+
export declare function transformNullToUndefined<T>(value: T): T;
|
|
21
|
+
export declare function wait(fn: Function, timeout?: number): Promise<unknown>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.executeFunction = executeFunction;
|
|
8
|
+
exports.getPopupContainer = getPopupContainer;
|
|
9
|
+
exports.includesNonStrictMode = includesNonStrictMode;
|
|
10
|
+
exports.isJest = void 0;
|
|
11
|
+
exports.isReactNode = isReactNode;
|
|
12
|
+
exports.lowercasedContains = lowercasedContains;
|
|
13
|
+
exports.mergeFunction = mergeFunction;
|
|
14
|
+
exports.mergeProps = mergeProps;
|
|
15
|
+
exports.renderComponentByType = renderComponentByType;
|
|
16
|
+
exports.runDevOrJest = runDevOrJest;
|
|
17
|
+
exports.transformNullToUndefined = transformNullToUndefined;
|
|
18
|
+
exports.uuid = uuid;
|
|
19
|
+
exports.wait = wait;
|
|
20
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
21
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
22
|
+
var _delay = _interopRequireDefault(require("delay"));
|
|
23
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
24
|
+
var _react = require("react");
|
|
25
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
26
|
+
var isJest = exports.isJest = !!process.env.JEST_WORKER_ID;
|
|
27
|
+
function runDevOrJest(fn, jestFn) {
|
|
28
|
+
return executeFunction(isJest ? jestFn : /* istanbul ignore next */fn);
|
|
29
|
+
}
|
|
30
|
+
function getPopupContainer(triggerNode) {
|
|
31
|
+
var modalElement = triggerNode.closest('.ant-modal-wrap');
|
|
32
|
+
return modalElement || document.body;
|
|
33
|
+
}
|
|
34
|
+
function executeFunction(fn) {
|
|
35
|
+
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
36
|
+
params[_key - 1] = arguments[_key];
|
|
37
|
+
}
|
|
38
|
+
return _lodash.default.isFunction(fn) ? fn.apply(void 0, params) : fn;
|
|
39
|
+
}
|
|
40
|
+
function renderComponentByType(component, props) {
|
|
41
|
+
if (_lodash.default.isFunction(component)) {
|
|
42
|
+
return component(props);
|
|
43
|
+
}
|
|
44
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(component)) {
|
|
45
|
+
return /*#__PURE__*/(0, _react.cloneElement)(component, props);
|
|
46
|
+
}
|
|
47
|
+
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
48
|
+
children: component
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function lowercasedContains(text, search) {
|
|
52
|
+
if (!search) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
return !!(text !== null && text !== void 0 && text.toString().toLowerCase().includes(search.toLowerCase()));
|
|
56
|
+
}
|
|
57
|
+
function uuid() {
|
|
58
|
+
var d = new Date().getTime();
|
|
59
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
60
|
+
var r = (d + Math.random() * 16) % 16 | 0;
|
|
61
|
+
d = Math.floor(d / 16);
|
|
62
|
+
return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 判断是否是 ReactNode,符合下面任意一个条件
|
|
68
|
+
* 1. 不是 js 对象,比如 undefined, null, number, string, boolean 等
|
|
69
|
+
* 2. 是 ReactNode
|
|
70
|
+
*/
|
|
71
|
+
function isReactNode(node) {
|
|
72
|
+
return !_lodash.default.isPlainObject(node) || /*#__PURE__*/(0, _react.isValidElement)(node);
|
|
73
|
+
}
|
|
74
|
+
function includesNonStrictMode(options, value) {
|
|
75
|
+
if (_lodash.default.isArray(value)) {
|
|
76
|
+
return _lodash.default.every(value, function (val) {
|
|
77
|
+
return includesNonStrictMode(options, val);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// eslint-disable-next-line eqeqeq
|
|
82
|
+
return _lodash.default.some(options, function (option) {
|
|
83
|
+
return option == value;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function mergeProps(originProps, patchProps) {
|
|
87
|
+
return _lodash.default.assignWith({}, originProps, patchProps, function (prop1, prop2) {
|
|
88
|
+
if (_lodash.default.isFunction(prop1) && _lodash.default.isFunction(prop2)) {
|
|
89
|
+
return mergeFunction(prop1, prop2);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function mergeFunction() {
|
|
94
|
+
for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
95
|
+
fns[_key2] = arguments[_key2];
|
|
96
|
+
}
|
|
97
|
+
return function () {
|
|
98
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
99
|
+
args[_key3] = arguments[_key3];
|
|
100
|
+
}
|
|
101
|
+
_lodash.default.forEach(fns, function (fn) {
|
|
102
|
+
return fn === null || fn === void 0 ? void 0 : fn.apply(void 0, args);
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function transformNullToUndefined(value) {
|
|
107
|
+
if (_lodash.default.isNull(value)) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
if (_lodash.default.isArray(value)) {
|
|
111
|
+
return _lodash.default.map(value, transformNullToUndefined);
|
|
112
|
+
}
|
|
113
|
+
if (_lodash.default.isObject(value)) {
|
|
114
|
+
return _lodash.default.mapValues(value, transformNullToUndefined);
|
|
115
|
+
}
|
|
116
|
+
return value;
|
|
117
|
+
}
|
|
118
|
+
function wait(fn) {
|
|
119
|
+
var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30 * 1000;
|
|
120
|
+
var interval = 100;
|
|
121
|
+
return new Promise(function (resolve) {
|
|
122
|
+
function run() {
|
|
123
|
+
return _run.apply(this, arguments);
|
|
124
|
+
}
|
|
125
|
+
function _run() {
|
|
126
|
+
_run = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
127
|
+
var times,
|
|
128
|
+
_args = arguments;
|
|
129
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
130
|
+
while (1) switch (_context.prev = _context.next) {
|
|
131
|
+
case 0:
|
|
132
|
+
times = _args.length > 0 && _args[0] !== undefined ? _args[0] : 0;
|
|
133
|
+
if (!(times * interval >= timeout)) {
|
|
134
|
+
_context.next = 3;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
return _context.abrupt("return", resolve(false));
|
|
138
|
+
case 3:
|
|
139
|
+
_context.next = 5;
|
|
140
|
+
return fn();
|
|
141
|
+
case 5:
|
|
142
|
+
if (!_context.sent) {
|
|
143
|
+
_context.next = 7;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
return _context.abrupt("return", resolve(true));
|
|
147
|
+
case 7:
|
|
148
|
+
_context.next = 9;
|
|
149
|
+
return (0, _delay.default)(interval);
|
|
150
|
+
case 9:
|
|
151
|
+
_context.next = 11;
|
|
152
|
+
return run(times + 1);
|
|
153
|
+
case 11:
|
|
154
|
+
case "end":
|
|
155
|
+
return _context.stop();
|
|
156
|
+
}
|
|
157
|
+
}, _callee);
|
|
158
|
+
}));
|
|
159
|
+
return _run.apply(this, arguments);
|
|
160
|
+
}
|
|
161
|
+
run();
|
|
162
|
+
});
|
|
163
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.$ = $;
|
|
7
|
+
exports.$$ = $$;
|
|
8
|
+
function $(selector) {
|
|
9
|
+
var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
10
|
+
return $$(selector)[index];
|
|
11
|
+
}
|
|
12
|
+
function $$(selector) {
|
|
13
|
+
return document.querySelectorAll(selector);
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.flexStyle = exports.commonFontFamily = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _ = require("./..");
|
|
10
|
+
var _css = require("@emotion/css");
|
|
11
|
+
var _react = require("@emotion/react");
|
|
12
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
13
|
+
var commonStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n &.do-hide-scroll {\n overflow: hidden !important;\n }\n"])));
|
|
14
|
+
(0, _css.injectGlobal)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n body {\n ", "\n }\n"])), commonStyle);
|
|
15
|
+
var commonFontFamily = exports.commonFontFamily = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-family: 'MyriadPro-Cond', 'Helvetica Neue', Helvetica, sans-serif;\n\n input,\n button,\n select,\n textarea {\n font-family: 'MyriadPro-Cond', 'Helvetica Neue', Helvetica, sans-serif;\n }\n"])));
|
|
16
|
+
var flexStyle = exports.flexStyle = function flexStyle(_ref) {
|
|
17
|
+
var vertical = _ref.vertical,
|
|
18
|
+
_ref$gap = _ref.gap,
|
|
19
|
+
gap = _ref$gap === void 0 ? 8 : _ref$gap,
|
|
20
|
+
_ref$wrap = _ref.wrap,
|
|
21
|
+
wrap = _ref$wrap === void 0 ? true : _ref$wrap;
|
|
22
|
+
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: ", ";\n gap: ", ";\n flex-wrap: ", ";\n min-width: 0;\n"])), vertical ? 'column' : 'row', (0, _.transformValueToGap)(gap), wrap ? 'wrap' : 'nowrap');
|
|
23
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _className = require("./class-name");
|
|
7
|
+
Object.keys(_className).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _className[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _className[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _common = require("./common");
|
|
18
|
+
Object.keys(_common).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _common[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _common[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _dom = require("./dom");
|
|
29
|
+
Object.keys(_dom).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _dom[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _dom[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _globalStyle = require("./global-style");
|
|
40
|
+
Object.keys(_globalStyle).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _globalStyle[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _globalStyle[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _reactDom = require("./react-dom");
|
|
51
|
+
Object.keys(_reactDom).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _reactDom[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _reactDom[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _sort = require("./sort");
|
|
62
|
+
Object.keys(_sort).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _sort[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function get() {
|
|
68
|
+
return _sort[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _style = require("./style");
|
|
73
|
+
Object.keys(_style).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _style[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function get() {
|
|
79
|
+
return _style[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var _url = require("./url");
|
|
84
|
+
Object.keys(_url).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _url[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function get() {
|
|
90
|
+
return _url[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
var _validateInput = require("./validate-input");
|
|
95
|
+
Object.keys(_validateInput).forEach(function (key) {
|
|
96
|
+
if (key === "default" || key === "__esModule") return;
|
|
97
|
+
if (key in exports && exports[key] === _validateInput[key]) return;
|
|
98
|
+
Object.defineProperty(exports, key, {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function get() {
|
|
101
|
+
return _validateInput[key];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.mountComponent = mountComponent;
|
|
8
|
+
exports.unmountComponent = unmountComponent;
|
|
9
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _ = require("./..");
|
|
12
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
14
|
+
var _excluded = ["hideBodyScroll"];
|
|
15
|
+
function getContainer() {
|
|
16
|
+
var container = document.createElement('div');
|
|
17
|
+
document.body.append(container);
|
|
18
|
+
return container;
|
|
19
|
+
}
|
|
20
|
+
// 处理React17和18版本的兼容性
|
|
21
|
+
function getReactDOM() {
|
|
22
|
+
// const { createRoot } = ReactDOM as any;
|
|
23
|
+
// if (createRoot) {
|
|
24
|
+
// return {
|
|
25
|
+
// render: (element, container: any) => {
|
|
26
|
+
// const root = createRoot(container);
|
|
27
|
+
// root.render(element);
|
|
28
|
+
// container._reactRootContainer = root;
|
|
29
|
+
// },
|
|
30
|
+
// unmount: (container: any) => {
|
|
31
|
+
// const root = container._reactRootContainer;
|
|
32
|
+
// if (root) {
|
|
33
|
+
// root.unmount();
|
|
34
|
+
// delete container._reactRootContainer;
|
|
35
|
+
// }
|
|
36
|
+
// },
|
|
37
|
+
// };
|
|
38
|
+
// }
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
render: function render(element, container) {
|
|
42
|
+
_reactDom.default.render(element, container);
|
|
43
|
+
},
|
|
44
|
+
unmount: function unmount(container) {
|
|
45
|
+
_reactDom.default.unmountComponentAtNode(container);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
var closeFunctionSet = new Set();
|
|
50
|
+
function mountComponent(Component) {
|
|
51
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
52
|
+
var container = getContainer();
|
|
53
|
+
var _getReactDOM = getReactDOM(),
|
|
54
|
+
render = _getReactDOM.render,
|
|
55
|
+
unmount = _getReactDOM.unmount;
|
|
56
|
+
var close = function close() {
|
|
57
|
+
unmount(container);
|
|
58
|
+
container.remove();
|
|
59
|
+
closeFunctionSet.delete(close);
|
|
60
|
+
!closeFunctionSet.size && (0, _.hideBodyScroll)(false);
|
|
61
|
+
};
|
|
62
|
+
var _props$hideBodyScroll = props.hideBodyScroll,
|
|
63
|
+
hide = _props$hideBodyScroll === void 0 ? false : _props$hideBodyScroll,
|
|
64
|
+
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
65
|
+
hide && (0, _.hideBodyScroll)();
|
|
66
|
+
render((0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, restProps), {}, {
|
|
67
|
+
unmount: close,
|
|
68
|
+
getContainer: container
|
|
69
|
+
})), container);
|
|
70
|
+
|
|
71
|
+
// 缓存 close 方法
|
|
72
|
+
closeFunctionSet.add(close);
|
|
73
|
+
return close;
|
|
74
|
+
}
|
|
75
|
+
function unmountComponent() {
|
|
76
|
+
closeFunctionSet.forEach(function (close) {
|
|
77
|
+
return close();
|
|
78
|
+
});
|
|
79
|
+
closeFunctionSet.clear();
|
|
80
|
+
}
|