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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Vshow
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Doui React
|
|
2
|
+
|
|
3
|
+
A React UI library based on Ant Design
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# develop library by docs demo
|
|
9
|
+
$ yarn dev
|
|
10
|
+
|
|
11
|
+
# build library source code and docs
|
|
12
|
+
$ yarn build:all
|
|
13
|
+
|
|
14
|
+
# run tests for library
|
|
15
|
+
$ yarn test
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## patch package
|
|
19
|
+
|
|
20
|
+
1. dumi
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
$ yarn patch-package dumi
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## LICENSE
|
|
27
|
+
|
|
28
|
+
MIT
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import { cx } from '@emotion/css';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
export function getClassName(className) {
|
|
5
|
+
return "do-".concat(className);
|
|
6
|
+
}
|
|
7
|
+
export function combineClassName(className) {
|
|
8
|
+
for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
9
|
+
props[_key - 1] = arguments[_key];
|
|
10
|
+
}
|
|
11
|
+
var names = _.map(props, function (prop) {
|
|
12
|
+
return _.isObject(prop) ? prop.className : prop;
|
|
13
|
+
});
|
|
14
|
+
return cx.apply(void 0, [getClassName(className)].concat(_toConsumableArray(names)));
|
|
15
|
+
}
|
|
@@ -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,144 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import delay from 'delay';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import { cloneElement, isValidElement } from 'react';
|
|
6
|
+
import { Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
7
|
+
export var isJest = !!process.env.JEST_WORKER_ID;
|
|
8
|
+
export function runDevOrJest(fn, jestFn) {
|
|
9
|
+
return executeFunction(isJest ? jestFn : /* istanbul ignore next */fn);
|
|
10
|
+
}
|
|
11
|
+
export function getPopupContainer(triggerNode) {
|
|
12
|
+
var modalElement = triggerNode.closest('.ant-modal-wrap');
|
|
13
|
+
return modalElement || document.body;
|
|
14
|
+
}
|
|
15
|
+
export function executeFunction(fn) {
|
|
16
|
+
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
17
|
+
params[_key - 1] = arguments[_key];
|
|
18
|
+
}
|
|
19
|
+
return _.isFunction(fn) ? fn.apply(void 0, params) : fn;
|
|
20
|
+
}
|
|
21
|
+
export function renderComponentByType(component, props) {
|
|
22
|
+
if (_.isFunction(component)) {
|
|
23
|
+
return component(props);
|
|
24
|
+
}
|
|
25
|
+
if ( /*#__PURE__*/isValidElement(component)) {
|
|
26
|
+
return /*#__PURE__*/cloneElement(component, props);
|
|
27
|
+
}
|
|
28
|
+
return _jsx(_Fragment, {
|
|
29
|
+
children: component
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export function lowercasedContains(text, search) {
|
|
33
|
+
if (!search) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return !!(text !== null && text !== void 0 && text.toString().toLowerCase().includes(search.toLowerCase()));
|
|
37
|
+
}
|
|
38
|
+
export function uuid() {
|
|
39
|
+
var d = new Date().getTime();
|
|
40
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
41
|
+
var r = (d + Math.random() * 16) % 16 | 0;
|
|
42
|
+
d = Math.floor(d / 16);
|
|
43
|
+
return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 判断是否是 ReactNode,符合下面任意一个条件
|
|
49
|
+
* 1. 不是 js 对象,比如 undefined, null, number, string, boolean 等
|
|
50
|
+
* 2. 是 ReactNode
|
|
51
|
+
*/
|
|
52
|
+
export function isReactNode(node) {
|
|
53
|
+
return !_.isPlainObject(node) || /*#__PURE__*/isValidElement(node);
|
|
54
|
+
}
|
|
55
|
+
export function includesNonStrictMode(options, value) {
|
|
56
|
+
if (_.isArray(value)) {
|
|
57
|
+
return _.every(value, function (val) {
|
|
58
|
+
return includesNonStrictMode(options, val);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// eslint-disable-next-line eqeqeq
|
|
63
|
+
return _.some(options, function (option) {
|
|
64
|
+
return option == value;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
export function mergeProps(originProps, patchProps) {
|
|
68
|
+
return _.assignWith({}, originProps, patchProps, function (prop1, prop2) {
|
|
69
|
+
if (_.isFunction(prop1) && _.isFunction(prop2)) {
|
|
70
|
+
return mergeFunction(prop1, prop2);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export function mergeFunction() {
|
|
75
|
+
for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
76
|
+
fns[_key2] = arguments[_key2];
|
|
77
|
+
}
|
|
78
|
+
return function () {
|
|
79
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
80
|
+
args[_key3] = arguments[_key3];
|
|
81
|
+
}
|
|
82
|
+
_.forEach(fns, function (fn) {
|
|
83
|
+
return fn === null || fn === void 0 ? void 0 : fn.apply(void 0, args);
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export function transformNullToUndefined(value) {
|
|
88
|
+
if (_.isNull(value)) {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
if (_.isArray(value)) {
|
|
92
|
+
return _.map(value, transformNullToUndefined);
|
|
93
|
+
}
|
|
94
|
+
if (_.isObject(value)) {
|
|
95
|
+
return _.mapValues(value, transformNullToUndefined);
|
|
96
|
+
}
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
export function wait(fn) {
|
|
100
|
+
var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30 * 1000;
|
|
101
|
+
var interval = 100;
|
|
102
|
+
return new Promise(function (resolve) {
|
|
103
|
+
function run() {
|
|
104
|
+
return _run.apply(this, arguments);
|
|
105
|
+
}
|
|
106
|
+
function _run() {
|
|
107
|
+
_run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
108
|
+
var times,
|
|
109
|
+
_args = arguments;
|
|
110
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
111
|
+
while (1) switch (_context.prev = _context.next) {
|
|
112
|
+
case 0:
|
|
113
|
+
times = _args.length > 0 && _args[0] !== undefined ? _args[0] : 0;
|
|
114
|
+
if (!(times * interval >= timeout)) {
|
|
115
|
+
_context.next = 3;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
return _context.abrupt("return", resolve(false));
|
|
119
|
+
case 3:
|
|
120
|
+
_context.next = 5;
|
|
121
|
+
return fn();
|
|
122
|
+
case 5:
|
|
123
|
+
if (!_context.sent) {
|
|
124
|
+
_context.next = 7;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
return _context.abrupt("return", resolve(true));
|
|
128
|
+
case 7:
|
|
129
|
+
_context.next = 9;
|
|
130
|
+
return delay(interval);
|
|
131
|
+
case 9:
|
|
132
|
+
_context.next = 11;
|
|
133
|
+
return run(times + 1);
|
|
134
|
+
case 11:
|
|
135
|
+
case "end":
|
|
136
|
+
return _context.stop();
|
|
137
|
+
}
|
|
138
|
+
}, _callee);
|
|
139
|
+
}));
|
|
140
|
+
return _run.apply(this, arguments);
|
|
141
|
+
}
|
|
142
|
+
run();
|
|
143
|
+
});
|
|
144
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
|
+
import { transformValueToGap } from "./..";
|
|
4
|
+
import { injectGlobal } from '@emotion/css';
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
|
+
var commonStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.do-hide-scroll {\n overflow: hidden !important;\n }\n"])));
|
|
7
|
+
injectGlobal(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n body {\n ", "\n }\n"])), commonStyle);
|
|
8
|
+
export var commonFontFamily = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\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"])));
|
|
9
|
+
export var flexStyle = function flexStyle(_ref) {
|
|
10
|
+
var vertical = _ref.vertical,
|
|
11
|
+
_ref$gap = _ref.gap,
|
|
12
|
+
gap = _ref$gap === void 0 ? 8 : _ref$gap,
|
|
13
|
+
_ref$wrap = _ref.wrap,
|
|
14
|
+
wrap = _ref$wrap === void 0 ? true : _ref$wrap;
|
|
15
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n gap: ", ";\n flex-wrap: ", ";\n min-width: 0;\n"])), vertical ? 'column' : 'row', transformValueToGap(gap), wrap ? 'wrap' : 'nowrap');
|
|
16
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["hideBodyScroll"];
|
|
4
|
+
import { hideBodyScroll } from "./..";
|
|
5
|
+
import ReactDOM from 'react-dom';
|
|
6
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
7
|
+
function getContainer() {
|
|
8
|
+
var container = document.createElement('div');
|
|
9
|
+
document.body.append(container);
|
|
10
|
+
return container;
|
|
11
|
+
}
|
|
12
|
+
// 处理React17和18版本的兼容性
|
|
13
|
+
function getReactDOM() {
|
|
14
|
+
// const { createRoot } = ReactDOM as any;
|
|
15
|
+
// if (createRoot) {
|
|
16
|
+
// return {
|
|
17
|
+
// render: (element, container: any) => {
|
|
18
|
+
// const root = createRoot(container);
|
|
19
|
+
// root.render(element);
|
|
20
|
+
// container._reactRootContainer = root;
|
|
21
|
+
// },
|
|
22
|
+
// unmount: (container: any) => {
|
|
23
|
+
// const root = container._reactRootContainer;
|
|
24
|
+
// if (root) {
|
|
25
|
+
// root.unmount();
|
|
26
|
+
// delete container._reactRootContainer;
|
|
27
|
+
// }
|
|
28
|
+
// },
|
|
29
|
+
// };
|
|
30
|
+
// }
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
render: function render(element, container) {
|
|
34
|
+
ReactDOM.render(element, container);
|
|
35
|
+
},
|
|
36
|
+
unmount: function unmount(container) {
|
|
37
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
var closeFunctionSet = new Set();
|
|
42
|
+
export function mountComponent(Component) {
|
|
43
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
44
|
+
var container = getContainer();
|
|
45
|
+
var _getReactDOM = getReactDOM(),
|
|
46
|
+
render = _getReactDOM.render,
|
|
47
|
+
unmount = _getReactDOM.unmount;
|
|
48
|
+
var close = function close() {
|
|
49
|
+
unmount(container);
|
|
50
|
+
container.remove();
|
|
51
|
+
closeFunctionSet.delete(close);
|
|
52
|
+
!closeFunctionSet.size && hideBodyScroll(false);
|
|
53
|
+
};
|
|
54
|
+
var _props$hideBodyScroll = props.hideBodyScroll,
|
|
55
|
+
hide = _props$hideBodyScroll === void 0 ? false : _props$hideBodyScroll,
|
|
56
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
57
|
+
hide && hideBodyScroll();
|
|
58
|
+
render(_jsx(Component, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
59
|
+
unmount: close,
|
|
60
|
+
getContainer: container
|
|
61
|
+
})), container);
|
|
62
|
+
|
|
63
|
+
// 缓存 close 方法
|
|
64
|
+
closeFunctionSet.add(close);
|
|
65
|
+
return close;
|
|
66
|
+
}
|
|
67
|
+
export function unmountComponent() {
|
|
68
|
+
closeFunctionSet.forEach(function (close) {
|
|
69
|
+
return close();
|
|
70
|
+
});
|
|
71
|
+
closeFunctionSet.clear();
|
|
72
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
export function sorter(a, b) {
|
|
3
|
+
if (_.isNumber(a)) {
|
|
4
|
+
return a - b;
|
|
5
|
+
}
|
|
6
|
+
if (_.isNil(a) && _.isNil(b)) {
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
if (_.isNil(a)) {
|
|
10
|
+
return -1;
|
|
11
|
+
}
|
|
12
|
+
return a.localeCompare(b);
|
|
13
|
+
}
|
|
14
|
+
export function sortBy() {
|
|
15
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
16
|
+
var key = arguments.length > 1 ? arguments[1] : undefined;
|
|
17
|
+
return data.sort(function (a, b) {
|
|
18
|
+
return sorter(a[key], b[key]);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function transformValueWithStyleUnit(value?: string | number, defaultValue?: any): any;
|
|
2
|
+
export declare function transformValueToFlex(value?: string | number, defaultValue?: any): any;
|
|
3
|
+
export declare function transformValueToGap(value?: number | [number, number], defaultValue?: any): any;
|
|
4
|
+
export declare function hideBodyScroll(hide?: boolean): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
var regularUnitsRegx = /(auto|unset|inherit|initial|%|px|vh|vw|em)$/i;
|
|
3
|
+
export function transformValueWithStyleUnit(value, defaultValue) {
|
|
4
|
+
if (_.isNil(value)) {
|
|
5
|
+
return defaultValue;
|
|
6
|
+
}
|
|
7
|
+
if (_.isNumber(value)) {
|
|
8
|
+
return "".concat(value, "px");
|
|
9
|
+
}
|
|
10
|
+
if (regularUnitsRegx.test(value)) {
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
return "".concat(value, "px");
|
|
14
|
+
}
|
|
15
|
+
export function transformValueToFlex(value, defaultValue) {
|
|
16
|
+
if (_.isNil(value)) {
|
|
17
|
+
return defaultValue;
|
|
18
|
+
}
|
|
19
|
+
return _.isString(value) ? value : "".concat(value, " 0 0");
|
|
20
|
+
}
|
|
21
|
+
export function transformValueToGap(value, defaultValue) {
|
|
22
|
+
if (_.isNil(value)) {
|
|
23
|
+
return defaultValue;
|
|
24
|
+
}
|
|
25
|
+
var gap = _.isArray(value) ? value : [value, value];
|
|
26
|
+
return gap.reverse().map(function (item) {
|
|
27
|
+
return "".concat(item, "px");
|
|
28
|
+
}).join(' ');
|
|
29
|
+
}
|
|
30
|
+
export function hideBodyScroll() {
|
|
31
|
+
var hide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
32
|
+
hide ? document.body.classList.add('do-hide-scroll') : document.body.classList.remove('do-hide-scroll');
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import queryString, { ParseOptions, StringifyOptions } from 'query-string';
|
|
2
|
+
/**
|
|
3
|
+
* Query 相关方法
|
|
4
|
+
*/
|
|
5
|
+
declare class Query {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
constructor(query: Record<string, any>);
|
|
8
|
+
toString(options?: StringifyOptions): string;
|
|
9
|
+
}
|
|
10
|
+
declare function parseQuery(url?: string, options?: ParseOptions): Record<string, any>;
|
|
11
|
+
declare function updateQuery(query?: Record<string, any>, url?: string): Query;
|
|
12
|
+
declare function removeQuery(key?: string | string[], url?: string): Query;
|
|
13
|
+
declare function stringifyQuery(query?: Record<string, any>, options?: StringifyOptions): string;
|
|
14
|
+
declare function parseParams(url?: string): Partial<Record<string, string | string[]>>;
|
|
15
|
+
declare function stringifyUrl(query?: Record<string, any>, url?: string, options?: StringifyOptions & ParseOptions): string;
|
|
16
|
+
declare function replaceUrl(query?: Record<string, any>, url?: string, options?: StringifyOptions & ParseOptions): string;
|
|
17
|
+
declare function parse(url?: string, options?: ParseOptions): {
|
|
18
|
+
params: Partial<Record<string, string | string[]>>;
|
|
19
|
+
url: string;
|
|
20
|
+
query: queryString.ParsedQuery<string>;
|
|
21
|
+
fragmentIdentifier?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
export declare const url: {
|
|
24
|
+
parse: typeof parse;
|
|
25
|
+
parseQuery: typeof parseQuery;
|
|
26
|
+
updateQuery: typeof updateQuery;
|
|
27
|
+
removeQuery: typeof removeQuery;
|
|
28
|
+
stringifyQuery: typeof stringifyQuery;
|
|
29
|
+
parseParams: typeof parseParams;
|
|
30
|
+
stringifyUrl: typeof stringifyUrl;
|
|
31
|
+
replaceUrl: typeof replaceUrl;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import { match } from 'match-path-parser';
|
|
6
|
+
import queryString from 'query-string';
|
|
7
|
+
function getUrl(url) {
|
|
8
|
+
return new URL(url !== null && url !== void 0 ? url : location.href, location.origin);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Query 相关方法
|
|
13
|
+
*/
|
|
14
|
+
var Query = /*#__PURE__*/function () {
|
|
15
|
+
function Query(query) {
|
|
16
|
+
_classCallCheck(this, Query);
|
|
17
|
+
Object.assign(this, query);
|
|
18
|
+
}
|
|
19
|
+
_createClass(Query, [{
|
|
20
|
+
key: "toString",
|
|
21
|
+
value: function toString(options) {
|
|
22
|
+
return stringifyQuery(this, options);
|
|
23
|
+
}
|
|
24
|
+
}]);
|
|
25
|
+
return Query;
|
|
26
|
+
}();
|
|
27
|
+
function parseQuery(url, options) {
|
|
28
|
+
var _getUrl = getUrl(url),
|
|
29
|
+
search = _getUrl.search;
|
|
30
|
+
return queryString.parse(search, _objectSpread({
|
|
31
|
+
parseNumbers: true,
|
|
32
|
+
parseBooleans: true
|
|
33
|
+
}, options));
|
|
34
|
+
}
|
|
35
|
+
function updateQuery(query, url) {
|
|
36
|
+
var parsedQuery = parseQuery(url);
|
|
37
|
+
var mergedQuery = _.assign(parsedQuery, query);
|
|
38
|
+
return new Query(mergedQuery);
|
|
39
|
+
}
|
|
40
|
+
function removeQuery() {
|
|
41
|
+
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
42
|
+
var url = arguments.length > 1 ? arguments[1] : undefined;
|
|
43
|
+
var keys = _.isArray(key) ? key : [key];
|
|
44
|
+
var query = _.omit(parseQuery(url), keys);
|
|
45
|
+
return new Query(query);
|
|
46
|
+
}
|
|
47
|
+
function stringifyQuery() {
|
|
48
|
+
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
49
|
+
var options = arguments.length > 1 ? arguments[1] : undefined;
|
|
50
|
+
return queryString.stringify(query, _objectSpread({
|
|
51
|
+
skipEmptyString: true,
|
|
52
|
+
skipNull: true
|
|
53
|
+
}, options));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Url 相关方法
|
|
58
|
+
*/
|
|
59
|
+
function getUrlMatch(pathname) {
|
|
60
|
+
// ESB
|
|
61
|
+
if (_.startsWith(pathname, '/project/')) {
|
|
62
|
+
return match('/project/:projectId{/dashboard/:dashboardId}', {
|
|
63
|
+
end: false
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Data Process
|
|
68
|
+
if (_.startsWith(pathname, '/dp/') || _.startsWith(pathname, '/projects/')) {
|
|
69
|
+
return match('{/dp}/projects/:projectId{/flows/:flowId}', {
|
|
70
|
+
end: false
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// EyeVia
|
|
75
|
+
if (_.startsWith(pathname, '/v/')) {
|
|
76
|
+
return match('/v/:projectId{/d/:dashboardId/s/:screenId}', {
|
|
77
|
+
end: false
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (_.startsWith(pathname, '/p/')) {
|
|
81
|
+
return match('/p/:projectId', {
|
|
82
|
+
end: false
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function parseParams(url) {
|
|
87
|
+
var _getUrl2 = getUrl(url),
|
|
88
|
+
pathname = _getUrl2.pathname;
|
|
89
|
+
var fn = getUrlMatch(pathname);
|
|
90
|
+
var res = fn === null || fn === void 0 ? void 0 : fn(pathname);
|
|
91
|
+
return res ? res.params : {};
|
|
92
|
+
}
|
|
93
|
+
function stringifyUrl(query, url, options) {
|
|
94
|
+
var parsedUrl = parse(url, options);
|
|
95
|
+
_.assign(parsedUrl.query, query);
|
|
96
|
+
return queryString.stringifyUrl(parsedUrl, _objectSpread({
|
|
97
|
+
skipEmptyString: true,
|
|
98
|
+
skipNull: true
|
|
99
|
+
}, options));
|
|
100
|
+
}
|
|
101
|
+
function replaceUrl(query, url, options) {
|
|
102
|
+
var newUrl = stringifyUrl(query, url, options);
|
|
103
|
+
history.replaceState({}, '', newUrl);
|
|
104
|
+
return newUrl;
|
|
105
|
+
}
|
|
106
|
+
function parse(url, options) {
|
|
107
|
+
var _getUrl3 = getUrl(url),
|
|
108
|
+
href = _getUrl3.href;
|
|
109
|
+
var parsedUrl = queryString.parseUrl(href, _objectSpread({
|
|
110
|
+
parseNumbers: true,
|
|
111
|
+
parseBooleans: true
|
|
112
|
+
}, options));
|
|
113
|
+
return _objectSpread(_objectSpread({}, parsedUrl), {}, {
|
|
114
|
+
params: parseParams(url)
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
export var url = {
|
|
118
|
+
parse: parse,
|
|
119
|
+
parseQuery: parseQuery,
|
|
120
|
+
updateQuery: updateQuery,
|
|
121
|
+
removeQuery: removeQuery,
|
|
122
|
+
stringifyQuery: stringifyQuery,
|
|
123
|
+
parseParams: parseParams,
|
|
124
|
+
stringifyUrl: stringifyUrl,
|
|
125
|
+
replaceUrl: replaceUrl
|
|
126
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const inputValueReg: RegExp;
|
|
2
|
+
export declare const scriptReg: RegExp;
|
|
3
|
+
export declare function validateScript(value: string): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* validate data of general String type
|
|
6
|
+
* letters, numbers, spot, underlines and Spaces
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateString(value: string): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export var inputValueReg = /^[a-zA-Z0-9_\-\s/.:*{}€,()%$|+#@=><']*$/i;
|
|
2
|
+
export var scriptReg = /<[/]*[^/<]*\s*script[\s+]*[^/>]*[/]*>/i;
|
|
3
|
+
export function validateScript(value) {
|
|
4
|
+
return !value.match(scriptReg);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* validate data of general String type
|
|
9
|
+
* letters, numbers, spot, underlines and Spaces
|
|
10
|
+
*/
|
|
11
|
+
export function validateString(value) {
|
|
12
|
+
if (!inputValueReg.test(value)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return validateScript(value);
|
|
16
|
+
}
|
package/es/api/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CSSProperties, MutableRefObject } from 'react';
|
|
2
|
+
export type Refs = MutableRefObject<any>;
|
|
3
|
+
export interface BaseComponentProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
refs?: Refs;
|
|
7
|
+
}
|
|
8
|
+
export interface BaseFlexProps {
|
|
9
|
+
/**
|
|
10
|
+
* @description 是否垂直排列
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
vertical?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @description 间距,如果是数组,第一个为水平间距,第二个为垂直间距
|
|
16
|
+
* @default 8
|
|
17
|
+
*/
|
|
18
|
+
gap?: number | [number, number];
|
|
19
|
+
/**
|
|
20
|
+
* @description 是否自动换行
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
wrap?: boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|