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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getFormItemStyle = getFormItemStyle;
|
|
8
|
+
exports.getFormItemWidth = getFormItemWidth;
|
|
9
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _api = require("../../api");
|
|
12
|
+
var _style = require("../../stack/style");
|
|
13
|
+
var _css = require("@emotion/css");
|
|
14
|
+
var _constant = require("../component/constant");
|
|
15
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
16
|
+
var _excluded = ["labelWidth", "controlWidth", "requiredMark", "layout", "type"];
|
|
17
|
+
function getFormItemWidth(_ref) {
|
|
18
|
+
var width = _ref.width,
|
|
19
|
+
type = _ref.type;
|
|
20
|
+
if (width) {
|
|
21
|
+
return width;
|
|
22
|
+
}
|
|
23
|
+
if (_constant.useUnsetWidthKeys.includes(type)) {
|
|
24
|
+
return 'unset';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function getFormItemStyle(_ref2) {
|
|
28
|
+
var labelWidth = _ref2.labelWidth,
|
|
29
|
+
controlWidth = _ref2.controlWidth,
|
|
30
|
+
_ref2$requiredMark = _ref2.requiredMark,
|
|
31
|
+
requiredMark = _ref2$requiredMark === void 0 ? true : _ref2$requiredMark,
|
|
32
|
+
layout = _ref2.layout,
|
|
33
|
+
type = _ref2.type,
|
|
34
|
+
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
35
|
+
var baseStyle = (0, _css.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n &.ant-form-item {\n min-width: 0;\n\n .ant-form-item-label {\n width: ", ";\n\n .ant-form-item-tooltip {\n color: inherit;\n font-size: 13px;\n margin-inline-start: unset;\n margin-left: 3px;\n }\n }\n\n .ant-form-item-control-input {\n width: ", ";\n }\n\n .ant-form-item-required::before {\n display: ", ";\n }\n\n ", "\n ", "\n ", "\n }\n "])), (0, _api.transformValueWithStyleUnit)(labelWidth), (0, _api.transformValueWithStyleUnit)(controlWidth), requiredMark ? undefined : 'none', layout === 'horizontal' && getHorizontalStyle(), layout === 'vertical' && getVerticalStyle(), type === 'tree' && treeItemStyle());
|
|
36
|
+
return (0, _css.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n "])), (0, _style.getWidthAndFlex)(props), baseStyle);
|
|
37
|
+
}
|
|
38
|
+
function getHorizontalStyle() {
|
|
39
|
+
return (0, _css.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .ant-form-item-row {\n flex-direction: row;\n }\n\n .ant-form-item-label {\n padding-bottom: 0;\n\n > label {\n height: 32px;\n margin-right: 8px;\n }\n }\n\n .ant-form-item-control {\n flex: 1;\n min-width: 0;\n }\n "])));
|
|
40
|
+
}
|
|
41
|
+
function getVerticalStyle() {
|
|
42
|
+
return (0, _css.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n .ant-form-item-row {\n flex-direction: column;\n }\n\n .ant-form-item-label {\n > label {\n height: auto;\n margin-bottom: 4px;\n }\n\n .ant-form-item-required::before {\n position: unset;\n }\n }\n "])));
|
|
43
|
+
}
|
|
44
|
+
function treeItemStyle() {
|
|
45
|
+
return (0, _css.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n &,\n .ant-form-item-row,\n .ant-form-item-control,\n .ant-form-item-control-input,\n .ant-form-item-control-input-content {\n height: 100%;\n }\n "])));
|
|
46
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FormProps } from "..";
|
|
2
|
+
export * from './form-item';
|
|
3
|
+
type WrapperProps = Pick<FormProps, 'labelWidth' | 'formItemMarginBottom'>;
|
|
4
|
+
declare const style: {
|
|
5
|
+
wrapper: ({ labelWidth, formItemMarginBottom }: WrapperProps) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
};
|
|
7
|
+
export default style;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
var _exportNames = {};
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
+
var _api = require("../../api");
|
|
11
|
+
var _react = require("@emotion/react");
|
|
12
|
+
var _formItem = require("./form-item");
|
|
13
|
+
Object.keys(_formItem).forEach(function (key) {
|
|
14
|
+
if (key === "default" || key === "__esModule") return;
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
16
|
+
if (key in exports && exports[key] === _formItem[key]) return;
|
|
17
|
+
Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function get() {
|
|
20
|
+
return _formItem[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
var _templateObject;
|
|
25
|
+
var style = {
|
|
26
|
+
wrapper: function wrapper(_ref) {
|
|
27
|
+
var labelWidth = _ref.labelWidth,
|
|
28
|
+
formItemMarginBottom = _ref.formItemMarginBottom;
|
|
29
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n\n .ant-form-item {\n margin-bottom: ", ";\n }\n\n .ant-form-item-label {\n width: ", ";\n }\n\n .ant-form-item-with-help .ant-form-item-explain {\n line-height: 1.1;\n padding: 4px 0;\n\n .ant-form-item-explain-error + .ant-form-item-explain-error {\n margin-top: 2px;\n }\n }\n\n &.ant-form-horizontal {\n .ant-form-item-required::before {\n position: absolute;\n left: -10px;\n }\n }\n\n &.ant-form-vertical {\n .ant-form-item-label {\n padding-bottom: 2px;\n }\n }\n\n // disabled \u65F6\u4E5F\u9700\u8981\u663E\u793A error \u6846\n .ant-picker-status-error.ant-picker,\n .ant-select-status-error.ant-select:not(.ant-select-customize-input) .ant-select-selector,\n .ant-input-status-error:not(.ant-input-borderless),\n .ant-input-number-status-error:not(.ant-input-number-borderless),\n .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-borderless) {\n border-color: #ff4d4f;\n }\n "])), _api.commonFontFamily, (0, _api.transformValueWithStyleUnit)(formItemMarginBottom), (0, _api.transformValueWithStyleUnit)(labelWidth));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var _default = exports.default = style;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { FunctionReturn, Refs } from "../../api";
|
|
2
|
+
import { CheckboxProps } from "../../checkbox";
|
|
3
|
+
import { DatePickerProps, RangePickerProps } from "../../date-picker";
|
|
4
|
+
import { CommonParams, FormListContext, FormValues } from "..";
|
|
5
|
+
import { InputProps } from "../../input";
|
|
6
|
+
import { RadioProps } from "../../radio";
|
|
7
|
+
import { SelectOptions, SelectProps } from "../../select";
|
|
8
|
+
import { SwitchProps } from "../../switch";
|
|
9
|
+
import { TreeSelectProps } from "../../tree-select";
|
|
10
|
+
import { FormItemProps as AntdFormItemProps } from 'antd/lib/form/FormItem';
|
|
11
|
+
import { SliderRangeProps, SliderSingleProps } from 'antd/lib/slider';
|
|
12
|
+
import { Rule } from 'rc-field-form/lib/interface';
|
|
13
|
+
import { ReactElement, ReactNode } from 'react';
|
|
14
|
+
import { InputComponentType, OtherComponentType } from '../component/form-item';
|
|
15
|
+
type SliderProps = SliderSingleProps | SliderRangeProps;
|
|
16
|
+
type UnionType = Omit<AntdFormItemProps & InputProps & SelectProps & TreeSelectProps & SwitchProps & RadioProps & CheckboxProps & SliderProps, 'rules' | 'type' | 'disabled' | 'options' | 'required'>;
|
|
17
|
+
/**
|
|
18
|
+
* @noExtends
|
|
19
|
+
*/
|
|
20
|
+
export interface FormItemProps extends UnionType {
|
|
21
|
+
/**
|
|
22
|
+
* @description 表单类型
|
|
23
|
+
* @default input
|
|
24
|
+
*/
|
|
25
|
+
type?: InputComponentType | OtherComponentType;
|
|
26
|
+
/**
|
|
27
|
+
* @description 表单名称,支持层级嵌套,如:a.b.c
|
|
28
|
+
* @default (必选)
|
|
29
|
+
*/
|
|
30
|
+
name?: string;
|
|
31
|
+
/**
|
|
32
|
+
* @description 是否禁用
|
|
33
|
+
*/
|
|
34
|
+
disabled?: boolean | ((values: FormValues, params: CommonParams) => boolean);
|
|
35
|
+
/**
|
|
36
|
+
* @description 选择框下拉选项
|
|
37
|
+
* @link SelectOptions: /components/select#select-option
|
|
38
|
+
*/
|
|
39
|
+
options?: SelectOptions | ((values: FormValues, params: OptionsParams) => FunctionReturn<SelectOptions>);
|
|
40
|
+
/**
|
|
41
|
+
* @description 是否必填
|
|
42
|
+
*/
|
|
43
|
+
required?: boolean | string;
|
|
44
|
+
/**
|
|
45
|
+
* @description 校验 `value` 是否在 `options` 中
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
requiredInOptions?: boolean | string;
|
|
49
|
+
/**
|
|
50
|
+
* @description 自定义校验
|
|
51
|
+
*/
|
|
52
|
+
validator?(params: ValidatorProps): FunctionReturn<string | void>;
|
|
53
|
+
/**
|
|
54
|
+
* @description 是否过滤选项中不存在的值
|
|
55
|
+
* @default false
|
|
56
|
+
* @replaceAll boolean | "useFirstOption" | string | number
|
|
57
|
+
*/
|
|
58
|
+
filterNotExistValue?: boolean | string | number | 'useFirstOption';
|
|
59
|
+
/**
|
|
60
|
+
* @description 是否显示
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
show?: boolean | ((values: FormValues, params: CommonParams) => boolean);
|
|
64
|
+
/**
|
|
65
|
+
* @link FormItemRule: https://4x.ant.design/components/form-cn/#Rule
|
|
66
|
+
*/
|
|
67
|
+
rules?: FormItemRule[];
|
|
68
|
+
/**
|
|
69
|
+
* @description 日期选择器属性(当 `type` 为 `date`、`rangeDate` 时生效)
|
|
70
|
+
* @link DatePickerProps | RangePickerProps: /components/date-picker#api
|
|
71
|
+
*/
|
|
72
|
+
dateProps?: DatePickerProps | RangePickerProps;
|
|
73
|
+
/**
|
|
74
|
+
* @description flex 布局属性
|
|
75
|
+
* @default 1
|
|
76
|
+
*/
|
|
77
|
+
flex?: number | string;
|
|
78
|
+
/**
|
|
79
|
+
* @description label 宽度
|
|
80
|
+
*/
|
|
81
|
+
labelWidth?: number | string;
|
|
82
|
+
/**
|
|
83
|
+
* @description 输入框宽度
|
|
84
|
+
*/
|
|
85
|
+
controlWidth?: number | string;
|
|
86
|
+
/**
|
|
87
|
+
* @description 布局方式
|
|
88
|
+
* @default horizontal
|
|
89
|
+
*/
|
|
90
|
+
layout?: 'horizontal' | 'vertical';
|
|
91
|
+
preserveStatus?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* @description 自定义渲染
|
|
94
|
+
*/
|
|
95
|
+
render?: (params: RenderProps) => ReactElement;
|
|
96
|
+
/**
|
|
97
|
+
* @description 子节点
|
|
98
|
+
*/
|
|
99
|
+
children?: ReactNode | ((params: RenderChildrenProps) => ReactNode);
|
|
100
|
+
formListContext?: FormListContext;
|
|
101
|
+
dependencies?: string[];
|
|
102
|
+
removeErrorOnBlur?: boolean;
|
|
103
|
+
__noCollectState__?: boolean;
|
|
104
|
+
}
|
|
105
|
+
export interface FormItemContext extends Pick<FormItemPropsWithType, 'type' | 'optionDependencies' | 'loading' | 'rules' | 'formListContext'> {
|
|
106
|
+
name: string;
|
|
107
|
+
options?: SelectOptions;
|
|
108
|
+
refs: Refs;
|
|
109
|
+
}
|
|
110
|
+
export interface OptionsParams extends CommonParams {
|
|
111
|
+
search: string;
|
|
112
|
+
}
|
|
113
|
+
export interface RenderProps extends CommonParams, FormItemProps {
|
|
114
|
+
id: string;
|
|
115
|
+
name: string;
|
|
116
|
+
refs: Refs;
|
|
117
|
+
collectState(item: Partial<FormItemContext>): void;
|
|
118
|
+
}
|
|
119
|
+
interface RenderChildrenProps {
|
|
120
|
+
id: string;
|
|
121
|
+
refs: Refs;
|
|
122
|
+
value?: any;
|
|
123
|
+
onChange?(value: any): void;
|
|
124
|
+
onBlur?(event: any): void;
|
|
125
|
+
onFocus?(event: any): void;
|
|
126
|
+
}
|
|
127
|
+
export type FormItemRenderProps = Partial<RenderProps>;
|
|
128
|
+
export type FormItemChildrenProps = Partial<RenderChildrenProps>;
|
|
129
|
+
export type FormItemPropsWithType = FormItemProps & {
|
|
130
|
+
type: string;
|
|
131
|
+
name: string;
|
|
132
|
+
};
|
|
133
|
+
export interface ValidatorProps extends CommonParams {
|
|
134
|
+
value: any;
|
|
135
|
+
item: FormItemProps;
|
|
136
|
+
}
|
|
137
|
+
export type FormItemRule = {
|
|
138
|
+
validateOnMount?: boolean;
|
|
139
|
+
validator?: FormItemProps['validator'];
|
|
140
|
+
} | Omit<Rule, 'validator'>;
|
|
141
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ButtonProps } from "../../button";
|
|
2
|
+
import { FormItemProps, FormValues } from "..";
|
|
3
|
+
import { ListOperation } from "../../hooks";
|
|
4
|
+
import { FormListFieldData } from 'antd/lib/form/FormList';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
export interface FormListContext extends FormListCommonProps {
|
|
7
|
+
name: FormItemProps['name'];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @noExtends
|
|
11
|
+
*/
|
|
12
|
+
export interface FormListProps extends FormItemProps {
|
|
13
|
+
/**
|
|
14
|
+
* @description 表单名称,支持层级嵌套,如:a.b.c
|
|
15
|
+
*/
|
|
16
|
+
name: FormItemProps['name'];
|
|
17
|
+
/**
|
|
18
|
+
* @description 每一项渲染函数
|
|
19
|
+
*/
|
|
20
|
+
item?: ReactNode | ((props: FormListItemProps) => ReactNode);
|
|
21
|
+
/**
|
|
22
|
+
* @description 渲染函数
|
|
23
|
+
*/
|
|
24
|
+
children?(props: FormListChildrenProps): ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* @description 是否在新增时,聚焦第一个输入框
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
focusFirstOnAdd?: boolean | string;
|
|
30
|
+
}
|
|
31
|
+
export interface FormListItemProps extends FormListCommonProps {
|
|
32
|
+
/**
|
|
33
|
+
* @description 当前项的索引
|
|
34
|
+
*/
|
|
35
|
+
index: number;
|
|
36
|
+
/**
|
|
37
|
+
* @description 当前项的值
|
|
38
|
+
*/
|
|
39
|
+
value: any;
|
|
40
|
+
/**
|
|
41
|
+
* @description 更新当前项的值
|
|
42
|
+
*/
|
|
43
|
+
onChange(value?: any): void;
|
|
44
|
+
}
|
|
45
|
+
export interface FormListChildrenProps extends FormListCommonProps {
|
|
46
|
+
/**
|
|
47
|
+
* @description 当前 `List` 中,所有表单项的内容
|
|
48
|
+
*/
|
|
49
|
+
component: ReactNode;
|
|
50
|
+
}
|
|
51
|
+
type FormListOperation = Omit<ListOperation, 'value'>;
|
|
52
|
+
export interface FormListCommonProps extends FormListOperation {
|
|
53
|
+
/**
|
|
54
|
+
* @description 表单值
|
|
55
|
+
*/
|
|
56
|
+
values: FormValues;
|
|
57
|
+
/**
|
|
58
|
+
* @description 当前 `List` 中,所有表单字段
|
|
59
|
+
*/
|
|
60
|
+
fields: FormListFieldData[];
|
|
61
|
+
/**
|
|
62
|
+
* @description 错误信息
|
|
63
|
+
*/
|
|
64
|
+
errors: ReactNode[];
|
|
65
|
+
warnings: ReactNode[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @noExtends
|
|
69
|
+
*/
|
|
70
|
+
export interface FormListActionProps extends ButtonProps {
|
|
71
|
+
/**
|
|
72
|
+
* @description 操作类型
|
|
73
|
+
* @replaceAll "add" | "remove" | "moveUp" | "moveDown" | "move"
|
|
74
|
+
*/
|
|
75
|
+
operation: keyof Omit<FormListOperation, 'update'>;
|
|
76
|
+
/**
|
|
77
|
+
* @description 新增时的默认值(当 `operation` 为 `add` 时生效)
|
|
78
|
+
*/
|
|
79
|
+
defaultValue?: any;
|
|
80
|
+
/**
|
|
81
|
+
* @description 插入位置,默认为数组末尾(当 `operation` 为 `add` 时生效)
|
|
82
|
+
*/
|
|
83
|
+
insertIndex?: number;
|
|
84
|
+
/**
|
|
85
|
+
* @description 当前项的索引(当 `operation` 为 `remove` 时,`index` 为数组支持批量删除,不传时,则清空所有项)
|
|
86
|
+
*/
|
|
87
|
+
index?: number | number[];
|
|
88
|
+
from?: number;
|
|
89
|
+
to?: number;
|
|
90
|
+
}
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { FunctionReturn } from "../../api";
|
|
2
|
+
import { ButtonProps } from "../../button";
|
|
3
|
+
import { FormContext, FormItemContext, FormItemProps, FormListContext } from "..";
|
|
4
|
+
import { FormProps as AntdFormProps } from 'antd/lib/form/Form';
|
|
5
|
+
import { FormInstance as AntdFormInstance } from 'antd/lib/form/hooks/useForm';
|
|
6
|
+
import { InputFocusOptions } from 'antd/lib/input/Input';
|
|
7
|
+
import { ValidateOptions } from 'rc-field-form/es/interface';
|
|
8
|
+
import { StoreValue } from 'rc-field-form/lib/interface';
|
|
9
|
+
import { ReactNode } from 'react';
|
|
10
|
+
import { registerMethods } from '../component/constant';
|
|
11
|
+
export * from './form-item';
|
|
12
|
+
export * from './form-list';
|
|
13
|
+
export type RegisterMethodType = keyof typeof registerMethods;
|
|
14
|
+
export type FormValues = Record<string, StoreValue>;
|
|
15
|
+
export interface FormInstance extends AntdFormInstance {
|
|
16
|
+
/**
|
|
17
|
+
* @description 设置表单的值
|
|
18
|
+
* @style { minWidth: 350 }
|
|
19
|
+
* @replaceAll (name: string, value: StoreValue): void;
|
|
20
|
+
* (params: FormValues): void;
|
|
21
|
+
*/
|
|
22
|
+
setValue(name: string, value: StoreValue): void;
|
|
23
|
+
setValue(params?: FormValues): void;
|
|
24
|
+
/**
|
|
25
|
+
* @description 获取表单的值,不传入 name 则返回所有值
|
|
26
|
+
*/
|
|
27
|
+
getValue(name?: string): StoreValue;
|
|
28
|
+
/**
|
|
29
|
+
* @description 设置上下文
|
|
30
|
+
* @replaceAll (name: string, value: StoreValue): void;
|
|
31
|
+
* (params: FormValues): void;
|
|
32
|
+
*/
|
|
33
|
+
setContext(name: string, value: StoreValue): void;
|
|
34
|
+
setContext(params?: FormValues): void;
|
|
35
|
+
getContext(name?: string): FormContext;
|
|
36
|
+
/**
|
|
37
|
+
* @description 设置表单的错误信息
|
|
38
|
+
* @replaceAll (name: string, message: string): void;
|
|
39
|
+
* (params: Record<string, string>): void;
|
|
40
|
+
*/
|
|
41
|
+
setError(name: string, message?: string): Promise<void>;
|
|
42
|
+
setError(params?: Record<string, string>): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* @description 获取表单的错误信息
|
|
45
|
+
*/
|
|
46
|
+
getError(name?: string): any;
|
|
47
|
+
/**
|
|
48
|
+
* @description 重置表单的错误信息
|
|
49
|
+
*/
|
|
50
|
+
resetError(name?: string | string[]): void;
|
|
51
|
+
/**
|
|
52
|
+
* @description 校验表单,返回校验结果
|
|
53
|
+
*/
|
|
54
|
+
validate(name?: string | string[], options?: ValidateOptions): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* @description 提交表单,返回表单值
|
|
57
|
+
*/
|
|
58
|
+
submit(): Promise<FormValues>;
|
|
59
|
+
/**
|
|
60
|
+
* @description 重置表单
|
|
61
|
+
*/
|
|
62
|
+
reset(name?: string | string[]): void;
|
|
63
|
+
/**
|
|
64
|
+
* @description 聚焦表单项
|
|
65
|
+
*/
|
|
66
|
+
focus(name: string, option?: InputFocusOptions): void;
|
|
67
|
+
/**
|
|
68
|
+
* FormItem 相关方法
|
|
69
|
+
*/
|
|
70
|
+
setItems(items: FormItemContext[]): void;
|
|
71
|
+
getItems(): FormItemContext[];
|
|
72
|
+
getItems(name: string): FormItemContext | undefined;
|
|
73
|
+
update(): void;
|
|
74
|
+
getName(): string;
|
|
75
|
+
/**
|
|
76
|
+
* 获取 FormList,不传入 name 则返回所有 FormList
|
|
77
|
+
*/
|
|
78
|
+
getFormList(): FormListContext[];
|
|
79
|
+
getFormList(name: string): FormListContext | undefined;
|
|
80
|
+
__INTERNAL__: any;
|
|
81
|
+
registerMethod(name: RegisterMethodType, fn: Function): void;
|
|
82
|
+
callMethod(name: RegisterMethodType, ...args: any): FunctionReturn<any>;
|
|
83
|
+
}
|
|
84
|
+
export interface FormProps extends AntdFormProps {
|
|
85
|
+
children?: ReactNode;
|
|
86
|
+
items?: FormItemProps[];
|
|
87
|
+
loading?: boolean;
|
|
88
|
+
form?: FormInstance;
|
|
89
|
+
context?: Record<string, any>;
|
|
90
|
+
footer?: ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* @description 表单初始值
|
|
93
|
+
*/
|
|
94
|
+
initialValues?: FormValues | ((context?: FormContext) => FunctionReturn<FormValues>);
|
|
95
|
+
/**
|
|
96
|
+
* @description 该方法可以初始化其他额外数据,可通过 `useFormContext()` 获取
|
|
97
|
+
*/
|
|
98
|
+
initialContext?: FormValues | ((props?: any) => FunctionReturn<FormValues>);
|
|
99
|
+
/**
|
|
100
|
+
* @description label 宽度
|
|
101
|
+
*/
|
|
102
|
+
labelWidth?: number | string;
|
|
103
|
+
/**
|
|
104
|
+
* @description formItem 底部间距
|
|
105
|
+
* @default 24px
|
|
106
|
+
*/
|
|
107
|
+
formItemMarginBottom?: number | string;
|
|
108
|
+
/**
|
|
109
|
+
* 是否在首次渲染时校验表单
|
|
110
|
+
*/
|
|
111
|
+
validateOnMount?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* 是否在首次渲染时,聚焦第一个输入框
|
|
114
|
+
*/
|
|
115
|
+
focusFirstOnMount?: boolean | string;
|
|
116
|
+
/**
|
|
117
|
+
* @description 校验失败,返回错误信息
|
|
118
|
+
*/
|
|
119
|
+
onValidateFailed?(error: Record<string, string>): void;
|
|
120
|
+
onValidate?(valid: boolean, form: FormInstance): boolean | void;
|
|
121
|
+
onMount?(params: CommonParams): void;
|
|
122
|
+
debug?: boolean;
|
|
123
|
+
}
|
|
124
|
+
export interface CommonParams {
|
|
125
|
+
form: FormInstance;
|
|
126
|
+
items: FormItemContext[];
|
|
127
|
+
}
|
|
128
|
+
export interface SubmitButtonProps extends Omit<ButtonProps, 'onClick'>, Pick<FormProps, 'onValidate'> {
|
|
129
|
+
disableOnValidateFailure?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* @description 点击事件
|
|
132
|
+
*/
|
|
133
|
+
onClick(value: FormValues, form: FormInstance): FunctionReturn<void>;
|
|
134
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _formItem = require("./form-item");
|
|
7
|
+
Object.keys(_formItem).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _formItem[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _formItem[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _formList = require("./form-list");
|
|
18
|
+
Object.keys(_formList).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _formList[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _formList[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Grid = Grid;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _api = require("../../api");
|
|
11
|
+
var _empty = require("../../empty");
|
|
12
|
+
var _stack = require("../../stack");
|
|
13
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
14
|
+
var _react = require("react");
|
|
15
|
+
var _reactUse = require("react-use");
|
|
16
|
+
var _style = _interopRequireDefault(require("../style"));
|
|
17
|
+
var _pagination = require("./pagination");
|
|
18
|
+
var _utils = require("./utils");
|
|
19
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
20
|
+
var _excluded = ["column", "gap", "onSize"],
|
|
21
|
+
_excluded2 = ["showData"],
|
|
22
|
+
_excluded3 = ["data", "emptyText", "children", "pagination", "rows"];
|
|
23
|
+
function useGrid(_ref) {
|
|
24
|
+
var _ref$column = _ref.column,
|
|
25
|
+
column = _ref$column === void 0 ? 5 : _ref$column,
|
|
26
|
+
_ref$gap = _ref.gap,
|
|
27
|
+
gap = _ref$gap === void 0 ? 16 : _ref$gap,
|
|
28
|
+
onSize = _ref.onSize,
|
|
29
|
+
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
|
+
var size = (0, _reactUse.useWindowSize)();
|
|
31
|
+
var columns = _lodash.default.isArray(column) ? column : [{
|
|
32
|
+
column: column
|
|
33
|
+
}];
|
|
34
|
+
var css = _style.default.wrapper({
|
|
35
|
+
columns: columns,
|
|
36
|
+
gap: gap
|
|
37
|
+
});
|
|
38
|
+
var config = (0, _utils.getColumnConfig)(columns, size.width);
|
|
39
|
+
var currentColumn = +config.column;
|
|
40
|
+
var _usePagination = (0, _pagination.usePagination)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, restProps), {}, {
|
|
41
|
+
column: currentColumn
|
|
42
|
+
})),
|
|
43
|
+
showData = _usePagination.showData,
|
|
44
|
+
pagination = (0, _objectWithoutProperties2.default)(_usePagination, _excluded2);
|
|
45
|
+
(0, _react.useEffect)(function () {
|
|
46
|
+
onSize === null || onSize === void 0 || onSize((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, size), config), {}, {
|
|
47
|
+
column: currentColumn
|
|
48
|
+
}));
|
|
49
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
|
+
}, [currentColumn]);
|
|
51
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
52
|
+
css: css
|
|
53
|
+
}, restProps), {}, {
|
|
54
|
+
className: (0, _api.combineClassName)('grid', restProps),
|
|
55
|
+
data: showData,
|
|
56
|
+
pagination: pagination
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function Grid(props) {
|
|
60
|
+
var _useGrid = useGrid(props),
|
|
61
|
+
data = _useGrid.data,
|
|
62
|
+
emptyText = _useGrid.emptyText,
|
|
63
|
+
children = _useGrid.children,
|
|
64
|
+
pagination = _useGrid.pagination,
|
|
65
|
+
rows = _useGrid.rows,
|
|
66
|
+
params = (0, _objectWithoutProperties2.default)(_useGrid, _excluded3);
|
|
67
|
+
if (_lodash.default.isEmpty(data)) {
|
|
68
|
+
return (0, _jsxRuntime.jsx)(_empty.Empty, {
|
|
69
|
+
description: emptyText
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return (0, _jsxRuntime.jsxs)(_stack.VStack, {
|
|
73
|
+
className: (0, _api.getClassName)('grid-container'),
|
|
74
|
+
children: [(0, _jsxRuntime.jsx)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
75
|
+
children: _lodash.default.map(data, function (item, index) {
|
|
76
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
77
|
+
className: (0, _api.getClassName)('grid-item'),
|
|
78
|
+
children: children(item, index)
|
|
79
|
+
}, index);
|
|
80
|
+
})
|
|
81
|
+
})), rows && (0, _jsxRuntime.jsx)(_pagination.Pagination, (0, _objectSpread2.default)({}, pagination))]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="rc-pagination" />
|
|
3
|
+
import { GridProps } from "..";
|
|
4
|
+
import { HStackProps } from "../../stack";
|
|
5
|
+
import { TablePaginationConfig } from 'antd';
|
|
6
|
+
interface PaginationParams extends GridProps {
|
|
7
|
+
column: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function usePagination({ data, rows, column, pagination }: PaginationParams): {
|
|
10
|
+
showData: any[];
|
|
11
|
+
pageSize: number;
|
|
12
|
+
current: number;
|
|
13
|
+
total: number;
|
|
14
|
+
onChange: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
15
|
+
position?: ("topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "topCenter" | "bottomCenter")[] | undefined;
|
|
16
|
+
showQuickJumper?: boolean | {
|
|
17
|
+
goButton?: import("react").ReactNode;
|
|
18
|
+
} | undefined;
|
|
19
|
+
size?: "small" | "default" | undefined;
|
|
20
|
+
responsive?: boolean | undefined;
|
|
21
|
+
role?: string | undefined;
|
|
22
|
+
totalBoundaryShowSizeChanger?: number | undefined;
|
|
23
|
+
onShowSizeChange?: ((current: number, size: number) => void) | undefined;
|
|
24
|
+
itemRender?: ((page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: import("react").ReactNode) => import("react").ReactNode) | undefined;
|
|
25
|
+
showTotal?: ((total: number, range: [number, number]) => import("react").ReactNode) | undefined;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
selectPrefixCls?: string | undefined;
|
|
28
|
+
prefixCls?: string | undefined;
|
|
29
|
+
pageSizeOptions?: string[] | number[] | undefined;
|
|
30
|
+
defaultCurrent?: number | undefined;
|
|
31
|
+
defaultPageSize?: number | undefined;
|
|
32
|
+
hideOnSinglePage?: boolean | undefined;
|
|
33
|
+
showSizeChanger?: boolean | undefined;
|
|
34
|
+
showLessItems?: boolean | undefined;
|
|
35
|
+
showPrevNextJumpers?: boolean | undefined;
|
|
36
|
+
showTitle?: boolean | undefined;
|
|
37
|
+
simple?: boolean | undefined;
|
|
38
|
+
disabled?: boolean | undefined;
|
|
39
|
+
locale?: import("rc-pagination").PaginationLocale | undefined;
|
|
40
|
+
style?: import("react").CSSProperties | undefined;
|
|
41
|
+
selectComponentClass?: import("react").ComponentType<{}> | undefined;
|
|
42
|
+
prevIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
|
|
43
|
+
nextIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
|
|
44
|
+
jumpPrevIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
|
|
45
|
+
jumpNextIcon?: import("react").ReactNode | import("react").ComponentType<{}>;
|
|
46
|
+
justify?: "center" | "left" | "right" | "between" | undefined;
|
|
47
|
+
};
|
|
48
|
+
export type PaginationProps = TablePaginationConfig & Pick<HStackProps, 'justify'>;
|
|
49
|
+
export declare function Pagination({ justify, className, style, ...props }: PaginationProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
50
|
+
export {};
|