@sheinx/hooks 3.0.0-rc.1 → 3.0.0-rc.10
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/cjs/common/type.d.ts +15 -15
- package/cjs/common/type.d.ts.map +1 -1
- package/cjs/common/use-click-away/index.d.ts +2 -2
- package/cjs/common/use-click-away/index.d.ts.map +1 -1
- package/cjs/common/use-click-away/index.js +2 -3
- package/cjs/common/use-default-value/index.js +2 -2
- package/cjs/common/use-default-value/use-default-value.js +9 -5
- package/cjs/common/use-drag-mock/index.js +2 -2
- package/cjs/common/use-drag-mock/use-drag-mock.js +11 -8
- package/cjs/common/use-drag-mock/use-drag-move.js +15 -11
- package/cjs/common/use-drag-mock/use-drag-resize.js +9 -5
- package/cjs/common/use-filter/index.js +2 -2
- package/cjs/common/use-filter/use-filter.js +17 -13
- package/cjs/common/use-fork-ref/index.js +5 -10
- package/cjs/common/use-func-change/index.js +2 -2
- package/cjs/common/use-func-change/use-func-change.d.ts +1 -1
- package/cjs/common/use-func-change/use-func-change.js +2 -3
- package/cjs/common/use-input-able/index.js +2 -2
- package/cjs/common/use-input-able/use-Input-able.js +8 -4
- package/cjs/common/use-input-able/use-Input-able.type.d.ts +1 -1
- package/cjs/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
- package/cjs/common/use-key-event/index.js +6 -8
- package/cjs/common/use-latest-obj/index.js +1 -3
- package/cjs/common/use-list-select/index.js +2 -2
- package/cjs/common/use-list-select/use-list-select-multiple.js +26 -39
- package/cjs/common/use-list-select/use-list-select-single.js +9 -11
- package/cjs/common/use-list-select/use-list-select.js +10 -12
- package/cjs/common/use-pagination-list/index.js +17 -15
- package/cjs/common/use-persist-fn/index.js +1 -2
- package/cjs/common/use-position-style/get-position-style.js +10 -7
- package/cjs/common/use-position-style/index.d.ts +3 -3
- package/cjs/common/use-position-style/index.d.ts.map +1 -1
- package/cjs/common/use-position-style/index.js +16 -22
- package/cjs/common/use-previous/index.js +1 -2
- package/cjs/common/use-render/index.js +8 -5
- package/cjs/common/use-resize/index.js +11 -9
- package/cjs/common/use-safe-state/index.js +8 -5
- package/cjs/common/use-style/index.js +0 -2
- package/cjs/common/use-toggle/index.d.ts +1 -1
- package/cjs/common/use-toggle/index.d.ts.map +1 -1
- package/cjs/common/use-toggle/index.js +7 -3
- package/cjs/common/use-transform/index.js +2 -2
- package/cjs/common/use-transform/use-transform.js +13 -11
- package/cjs/common/use-unmounted-ref/index.js +1 -2
- package/cjs/components/use-button/index.js +2 -2
- package/cjs/components/use-button/use-button.d.ts +5 -6
- package/cjs/components/use-button/use-button.d.ts.map +1 -1
- package/cjs/components/use-button/use-button.js +15 -32
- package/cjs/components/use-button/use-button.type.d.ts +3 -8
- package/cjs/components/use-button/use-button.type.d.ts.map +1 -1
- package/cjs/components/use-carousel/index.js +2 -2
- package/cjs/components/use-carousel/use-carousel.d.ts +1 -1
- package/cjs/components/use-carousel/use-carousel.d.ts.map +1 -1
- package/cjs/components/use-carousel/use-carousel.js +9 -5
- package/cjs/components/use-cascader/index.js +2 -2
- package/cjs/components/use-cascader/use-cascader.js +2 -3
- package/cjs/components/use-check/index.js +2 -2
- package/cjs/components/use-check/use-check.d.ts +3 -3
- package/cjs/components/use-check/use-check.js +24 -17
- package/cjs/components/use-collapse/index.js +2 -2
- package/cjs/components/use-collapse/use-collapse-item.d.ts +4 -4
- package/cjs/components/use-collapse/use-collapse-item.js +7 -10
- package/cjs/components/use-collapse/use-collapse-item.type.d.ts +1 -1
- package/cjs/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
- package/cjs/components/use-collapse/use-collapse.js +14 -13
- package/cjs/components/use-datepicker/index.js +2 -2
- package/cjs/components/use-datepicker/use-date.js +13 -11
- package/cjs/components/use-datepicker/use-datepicker-format.js +26 -21
- package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts +4 -4
- package/cjs/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-datepicker-range.js +10 -7
- package/cjs/components/use-datepicker/use-datepicker-range.type.d.ts +1 -1
- package/cjs/components/use-datepicker/use-datepicker-range.type.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-month.js +13 -11
- package/cjs/components/use-datepicker/use-quarter.js +13 -12
- package/cjs/components/use-datepicker/use-time.js +3 -8
- package/cjs/components/use-datepicker/use-year.js +13 -11
- package/cjs/components/use-datepicker/util.d.ts +3 -3
- package/cjs/components/use-datepicker/util.d.ts.map +1 -1
- package/cjs/components/use-datepicker/util.js +13 -20
- package/cjs/components/use-descriptions/index.js +2 -2
- package/cjs/components/use-descriptions/use-descriptions.js +14 -11
- package/cjs/components/use-form/Provider.js +6 -10
- package/cjs/components/use-form/form-bind-context.js +6 -11
- package/cjs/components/use-form/form-config-context.js +6 -11
- package/cjs/components/use-form/form-func-context.js +6 -11
- package/cjs/components/use-form/index.js +2 -3
- package/cjs/components/use-form/use-form-control/index.js +2 -2
- package/cjs/components/use-form/use-form-control/use-form-control.js +23 -23
- package/cjs/components/use-form/use-form-fieldset/fieldset-context.js +10 -19
- package/cjs/components/use-form/use-form-fieldset/index.js +2 -2
- package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.js +3 -5
- package/cjs/components/use-form/use-form-flow/index.js +2 -2
- package/cjs/components/use-form/use-form-flow/use-form-datum.js +1 -2
- package/cjs/components/use-form/use-form-flow/use-form-flow.js +2 -3
- package/cjs/components/use-form/use-form-item/form-item-context.js +5 -9
- package/cjs/components/use-form/use-form-item/index.js +2 -2
- package/cjs/components/use-form/use-form-item/use-form-item.js +12 -13
- package/cjs/components/use-form/use-form.d.ts +2 -2
- package/cjs/components/use-form/use-form.js +28 -37
- package/cjs/components/use-form/use-form.type.d.ts +4 -4
- package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
- package/cjs/components/use-image/index.js +2 -2
- package/cjs/components/use-image/use-image-gallery.d.ts +4 -4
- package/cjs/components/use-image/use-image-gallery.d.ts.map +1 -1
- package/cjs/components/use-image/use-image-gallery.js +18 -15
- package/cjs/components/use-image/use-image-gallery.type.d.ts +1 -1
- package/cjs/components/use-image/use-image-gallery.type.d.ts.map +1 -1
- package/cjs/components/use-image/use-image-group.d.ts +2 -2
- package/cjs/components/use-image/use-image-group.d.ts.map +1 -1
- package/cjs/components/use-image/use-image-group.js +9 -12
- package/cjs/components/use-image/use-image-magnify.js +13 -13
- package/cjs/components/use-image/use-image.d.ts +3 -3
- package/cjs/components/use-image/use-image.d.ts.map +1 -1
- package/cjs/components/use-image/use-image.js +17 -23
- package/cjs/components/use-image/use-image.type.d.ts +4 -4
- package/cjs/components/use-image/use-image.type.d.ts.map +1 -1
- package/cjs/components/use-input/index.js +2 -2
- package/cjs/components/use-input/use-input-format.d.ts +1 -1
- package/cjs/components/use-input/use-input-format.js +13 -15
- package/cjs/components/use-input/use-input-format.type.d.ts +1 -1
- package/cjs/components/use-input/use-input-format.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-number.d.ts +1 -1
- package/cjs/components/use-input/use-input-number.js +15 -16
- package/cjs/components/use-input/use-input-number.type.d.ts +1 -1
- package/cjs/components/use-input/use-input-number.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-password.js +11 -9
- package/cjs/components/use-input/use-input-password.type.d.ts +1 -1
- package/cjs/components/use-input/use-input-password.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input.d.ts +3 -3
- package/cjs/components/use-input/use-input.js +30 -29
- package/cjs/components/use-input/use-input.type.d.ts +5 -5
- package/cjs/components/use-input/use-input.type.d.ts.map +1 -1
- package/cjs/components/use-menu/index.js +2 -2
- package/cjs/components/use-menu/use-menu-item.d.ts +1 -1
- package/cjs/components/use-menu/use-menu-item.d.ts.map +1 -1
- package/cjs/components/use-menu/use-menu-item.js +11 -12
- package/cjs/components/use-menu/use-menu.js +2 -8
- package/cjs/components/use-menu/use-menu.type.d.ts +1 -1
- package/cjs/components/use-menu/use-menu.type.d.ts.map +1 -1
- package/cjs/components/use-pagination/index.js +2 -2
- package/cjs/components/use-pagination/use-pagination.d.ts +1 -1
- package/cjs/components/use-pagination/use-pagination.d.ts.map +1 -1
- package/cjs/components/use-pagination/use-pagination.js +19 -13
- package/cjs/components/use-popup/index.js +2 -2
- package/cjs/components/use-popup/popup-context.js +1 -2
- package/cjs/components/use-popup/use-popup.js +14 -11
- package/cjs/components/use-popup/use-popup.type.d.ts +1 -1
- package/cjs/components/use-popup/use-popup.type.d.ts.map +1 -1
- package/cjs/components/use-select/index.js +2 -2
- package/cjs/components/use-select/use-select-group.js +13 -10
- package/cjs/components/use-select/use-select.js +1 -2
- package/cjs/components/use-select/use-select.type.d.ts +1 -1
- package/cjs/components/use-select/use-select.type.d.ts.map +1 -1
- package/cjs/components/use-slider/index.js +2 -2
- package/cjs/components/use-slider/use-slider.js +15 -10
- package/cjs/components/use-table/index.js +2 -2
- package/cjs/components/use-table/use-table-columns.d.ts +1 -1
- package/cjs/components/use-table/use-table-columns.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-columns.js +4 -8
- package/cjs/components/use-table/use-table-expand.js +19 -20
- package/cjs/components/use-table/use-table-group.js +1 -7
- package/cjs/components/use-table/use-table-layout.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-layout.js +36 -34
- package/cjs/components/use-table/use-table-row.js +8 -9
- package/cjs/components/use-table/use-table-sort.d.ts +1 -1
- package/cjs/components/use-table/use-table-sort.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-sort.js +21 -22
- package/cjs/components/use-table/use-table-tree.d.ts +1 -1
- package/cjs/components/use-table/use-table-tree.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-tree.js +48 -57
- package/cjs/components/use-table/use-table-virtual.js +17 -13
- package/cjs/components/use-table/use-table.type.d.ts +4 -4
- package/cjs/components/use-table/use-table.type.d.ts.map +1 -1
- package/cjs/components/use-tabs/context.js +7 -13
- package/cjs/components/use-tabs/index.js +2 -2
- package/cjs/components/use-tabs/use-tabs.js +9 -6
- package/cjs/components/use-tabs/use-tabs.type.d.ts +1 -1
- package/cjs/components/use-tabs/use-tabs.type.d.ts.map +1 -1
- package/cjs/components/use-textarea/index.js +2 -2
- package/cjs/components/use-textarea/use-textarea-format.js +5 -7
- package/cjs/components/use-textarea/use-textarea-format.type.d.ts +1 -1
- package/cjs/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
- package/cjs/components/use-textarea/use-textarea.d.ts +2 -2
- package/cjs/components/use-textarea/use-textarea.js +23 -18
- package/cjs/components/use-textarea/use-textarea.type.d.ts +3 -3
- package/cjs/components/use-textarea/use-textarea.type.d.ts.map +1 -1
- package/cjs/components/use-transfer/index.js +2 -2
- package/cjs/components/use-transfer/use-transfer.js +20 -19
- package/cjs/components/use-transfer/use-transfer.type.d.ts +1 -1
- package/cjs/components/use-transfer/use-transfer.type.d.ts.map +1 -1
- package/cjs/components/use-tree/index.js +2 -2
- package/cjs/components/use-tree/use-tree-node.js +11 -7
- package/cjs/components/use-tree/use-tree-node.type.d.ts +2 -2
- package/cjs/components/use-tree/use-tree-node.type.d.ts.map +1 -1
- package/cjs/components/use-tree/use-tree.js +11 -16
- package/cjs/components/use-tree/use-tree.type.d.ts +3 -3
- package/cjs/components/use-tree/use-tree.type.d.ts.map +1 -1
- package/cjs/components/use-treeselect/index.js +2 -2
- package/cjs/components/use-treeselect/use-tiled.js +13 -9
- package/cjs/components/use-treeselect/use-tiled.type.d.ts +1 -1
- package/cjs/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
- package/cjs/components/use-treeselect/use-treeselect.js +1 -2
- package/cjs/components/use-upload/index.js +2 -2
- package/cjs/components/use-upload/use-upload.js +36 -34
- package/cjs/components/use-upload/xhr.js +0 -1
- package/cjs/components/use-validate/index.js +2 -2
- package/cjs/components/use-validate/use-validate.js +9 -5
- package/cjs/index.js +4 -9
- package/cjs/utils/accept.d.ts +1 -1
- package/cjs/utils/accept.d.ts.map +1 -1
- package/cjs/utils/accept.js +0 -4
- package/cjs/utils/array.js +2 -4
- package/cjs/utils/attribute.js +3 -5
- package/cjs/utils/clone.js +11 -20
- package/cjs/utils/document.js +2 -4
- package/cjs/utils/dom/element.js +11 -11
- package/cjs/utils/dom/index.js +2 -3
- package/cjs/utils/dom/responsiveObserve.js +10 -15
- package/cjs/utils/dom/responsiveObserve.type.d.ts +4 -4
- package/cjs/utils/dom/responsiveObserve.type.d.ts.map +1 -1
- package/cjs/utils/dom/scroll-behavior.js +2 -3
- package/cjs/utils/extract-event-handlers.js +0 -6
- package/cjs/utils/func.js +3 -5
- package/cjs/utils/immer.d.ts +1 -8
- package/cjs/utils/immer.d.ts.map +1 -1
- package/cjs/utils/immer.js +11 -8
- package/cjs/utils/index.js +2 -3
- package/cjs/utils/is.d.ts +1 -1
- package/cjs/utils/is.d.ts.map +1 -1
- package/cjs/utils/is.js +30 -55
- package/cjs/utils/lazyload.d.ts +1 -1
- package/cjs/utils/lazyload.d.ts.map +1 -1
- package/cjs/utils/lazyload.js +0 -1
- package/cjs/utils/number.js +0 -7
- package/cjs/utils/object.d.ts +4 -4
- package/cjs/utils/object.d.ts.map +1 -1
- package/cjs/utils/object.js +18 -37
- package/cjs/utils/position.js +4 -3
- package/cjs/utils/react-render.d.ts +1 -1
- package/cjs/utils/react-render.d.ts.map +1 -1
- package/cjs/utils/react-render.js +17 -24
- package/cjs/utils/render.d.ts +1 -1
- package/cjs/utils/render.d.ts.map +1 -1
- package/cjs/utils/render.js +3 -5
- package/cjs/utils/rule/index.js +2 -2
- package/cjs/utils/rule/length.d.ts +1 -1
- package/cjs/utils/rule/length.js +9 -11
- package/cjs/utils/rule/regexp.d.ts +1 -1
- package/cjs/utils/rule/regexp.js +4 -9
- package/cjs/utils/rule/required.d.ts +1 -1
- package/cjs/utils/rule/required.js +3 -5
- package/cjs/utils/rule/rule.js +4 -9
- package/cjs/utils/rule/rule.type.d.ts +8 -8
- package/cjs/utils/rule/rule.type.d.ts.map +1 -1
- package/cjs/utils/rule/type.d.ts +1 -1
- package/cjs/utils/rule/type.js +3 -5
- package/cjs/utils/shallow-equal.js +4 -9
- package/cjs/utils/string.js +0 -7
- package/cjs/utils/style-unit.js +0 -2
- package/cjs/utils/tree.d.ts +1 -1
- package/cjs/utils/tree.d.ts.map +1 -1
- package/cjs/utils/tree.js +19 -21
- package/cjs/utils/uid.js +0 -11
- package/cjs/utils/validate/error.js +22 -18
- package/cjs/utils/validate/get-rule.js +1 -4
- package/cjs/utils/validate/index.d.ts +1 -1
- package/cjs/utils/validate/index.d.ts.map +1 -1
- package/cjs/utils/validate/index.js +13 -13
- package/cjs/utils/validate/isJson.js +2 -5
- package/cjs/utils/validate/nullable.js +2 -3
- package/cjs/utils/validate/type.d.ts +1 -1
- package/cjs/utils/validate/type.d.ts.map +1 -1
- package/cjs/utils/validate/type.js +4 -9
- package/esm/common/type.d.ts +15 -15
- package/esm/common/type.d.ts.map +1 -1
- package/esm/common/type.js +1 -5
- package/esm/common/use-click-away/index.d.ts +2 -2
- package/esm/common/use-click-away/index.d.ts.map +1 -1
- package/esm/common/use-click-away/index.js +8 -17
- package/esm/common/use-default-value/index.js +2 -26
- package/esm/common/use-default-value/use-default-value.js +16 -19
- package/esm/common/use-default-value/use-previous.js +4 -10
- package/esm/common/use-drag-mock/index.js +3 -33
- package/esm/common/use-drag-mock/use-drag-mock.js +17 -20
- package/esm/common/use-drag-mock/use-drag-move.js +25 -28
- package/esm/common/use-drag-mock/use-drag-resize.js +19 -22
- package/esm/common/use-filter/index.js +1 -19
- package/esm/common/use-filter/use-filter.js +34 -36
- package/esm/common/use-filter/use-filter.type.js +1 -5
- package/esm/common/use-fork-ref/index.js +5 -20
- package/esm/common/use-fork-ref/setRef.js +1 -7
- package/esm/common/use-func-change/index.js +1 -19
- package/esm/common/use-func-change/use-func-change.d.ts +1 -1
- package/esm/common/use-func-change/use-func-change.js +8 -16
- package/esm/common/use-input-able/index.js +1 -19
- package/esm/common/use-input-able/use-Input-able.js +25 -28
- package/esm/common/use-input-able/use-Input-able.type.d.ts +1 -1
- package/esm/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
- package/esm/common/use-input-able/use-Input-able.type.js +1 -5
- package/esm/common/use-key-event/index.js +7 -15
- package/esm/common/use-latest-obj/index.js +4 -12
- package/esm/common/use-list-select/index.js +3 -33
- package/esm/common/use-list-select/use-list-select-multiple.js +41 -64
- package/esm/common/use-list-select/use-list-select-single.js +17 -26
- package/esm/common/use-list-select/use-list-select.js +16 -25
- package/esm/common/use-list-select/use-list.type.js +1 -5
- package/esm/common/use-pagination-list/index.js +22 -26
- package/esm/common/use-persist-fn/index.js +5 -11
- package/esm/common/use-position-style/get-position-style.js +10 -13
- package/esm/common/use-position-style/index.d.ts +3 -3
- package/esm/common/use-position-style/index.d.ts.map +1 -1
- package/esm/common/use-position-style/index.js +25 -41
- package/esm/common/use-previous/index.js +5 -13
- package/esm/common/use-render/index.js +15 -19
- package/esm/common/use-resize/index.js +17 -21
- package/esm/common/use-safe-state/index.js +15 -19
- package/esm/common/use-style/index.js +3 -11
- package/esm/common/use-toggle/index.d.ts +1 -1
- package/esm/common/use-toggle/index.d.ts.map +1 -1
- package/esm/common/use-toggle/index.js +12 -14
- package/esm/common/use-transform/index.js +1 -19
- package/esm/common/use-transform/use-transform.js +23 -27
- package/esm/common/use-transform/use-transform.type.js +1 -5
- package/esm/common/use-unmounted-ref/index.js +5 -13
- package/esm/components/use-button/index.js +1 -19
- package/esm/components/use-button/use-button-group.type.js +1 -5
- package/esm/components/use-button/use-button.d.ts +5 -6
- package/esm/components/use-button/use-button.d.ts.map +1 -1
- package/esm/components/use-button/use-button.js +20 -43
- package/esm/components/use-button/use-button.type.d.ts +3 -8
- package/esm/components/use-button/use-button.type.d.ts.map +1 -1
- package/esm/components/use-button/use-button.type.js +1 -5
- package/esm/components/use-carousel/index.js +1 -19
- package/esm/components/use-carousel/use-carousel.d.ts +1 -1
- package/esm/components/use-carousel/use-carousel.d.ts.map +1 -1
- package/esm/components/use-carousel/use-carousel.js +21 -24
- package/esm/components/use-cascader/index.js +1 -19
- package/esm/components/use-cascader/use-cascader.js +5 -13
- package/esm/components/use-cascader/use-cascader.type.js +1 -5
- package/esm/components/use-check/index.js +1 -19
- package/esm/components/use-check/use-check.d.ts +3 -3
- package/esm/components/use-check/use-check.js +32 -31
- package/esm/components/use-check/use-check.type.js +1 -5
- package/esm/components/use-collapse/index.js +2 -26
- package/esm/components/use-collapse/use-collapse-item.d.ts +4 -4
- package/esm/components/use-collapse/use-collapse-item.js +9 -18
- package/esm/components/use-collapse/use-collapse-item.type.d.ts +1 -1
- package/esm/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
- package/esm/components/use-collapse/use-collapse-item.type.js +1 -5
- package/esm/components/use-collapse/use-collapse.js +17 -22
- package/esm/components/use-collapse/use-collapse.type.js +1 -5
- package/esm/components/use-datepicker/index.js +8 -62
- package/esm/components/use-datepicker/use-date.js +53 -57
- package/esm/components/use-datepicker/use-date.type.js +1 -5
- package/esm/components/use-datepicker/use-datepicker-format.js +54 -56
- package/esm/components/use-datepicker/use-datepicker-format.type.d.ts +4 -4
- package/esm/components/use-datepicker/use-datepicker-format.type.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.type.js +1 -5
- package/esm/components/use-datepicker/use-datepicker-range.js +43 -47
- package/esm/components/use-datepicker/use-datepicker-range.type.d.ts +1 -1
- package/esm/components/use-datepicker/use-datepicker-range.type.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-datepicker-range.type.js +1 -5
- package/esm/components/use-datepicker/use-month.js +37 -41
- package/esm/components/use-datepicker/use-month.type.js +1 -5
- package/esm/components/use-datepicker/use-quarter.js +36 -41
- package/esm/components/use-datepicker/use-quarter.type.js +1 -5
- package/esm/components/use-datepicker/use-time.js +23 -35
- package/esm/components/use-datepicker/use-time.type.js +1 -5
- package/esm/components/use-datepicker/use-year.js +37 -41
- package/esm/components/use-datepicker/use-year.type.js +1 -5
- package/esm/components/use-datepicker/util.d.ts +3 -3
- package/esm/components/use-datepicker/util.d.ts.map +1 -1
- package/esm/components/use-datepicker/util.js +67 -80
- package/esm/components/use-descriptions/index.js +1 -19
- package/esm/components/use-descriptions/use-descriptions.js +24 -27
- package/esm/components/use-descriptions/use-descriptions.type.js +1 -5
- package/esm/components/use-form/Provider.js +12 -26
- package/esm/components/use-form/form-bind-context.js +4 -17
- package/esm/components/use-form/form-config-context.js +4 -17
- package/esm/components/use-form/form-func-context.js +4 -17
- package/esm/components/use-form/index.js +7 -87
- package/esm/components/use-form/use-form-control/index.js +1 -19
- package/esm/components/use-form/use-form-control/use-form-control.js +57 -66
- package/esm/components/use-form/use-form-control/use-form-control.type.js +1 -5
- package/esm/components/use-form/use-form-fieldset/fieldset-context.js +13 -29
- package/esm/components/use-form/use-form-fieldset/index.js +2 -26
- package/esm/components/use-form/use-form-fieldset/use-form-fieldset.js +6 -15
- package/esm/components/use-form/use-form-fieldset/use-form-fieldset.type.js +1 -5
- package/esm/components/use-form/use-form-flow/index.js +2 -26
- package/esm/components/use-form/use-form-flow/use-form-datum.js +4 -11
- package/esm/components/use-form/use-form-flow/use-form-flow.js +9 -17
- package/esm/components/use-form/use-form-flow/use-form-flow.type.js +1 -5
- package/esm/components/use-form/use-form-item/form-item-context.js +3 -15
- package/esm/components/use-form/use-form-item/index.js +1 -19
- package/esm/components/use-form/use-form-item/use-form-item.js +21 -32
- package/esm/components/use-form/use-form.d.ts +2 -2
- package/esm/components/use-form/use-form.js +65 -83
- package/esm/components/use-form/use-form.type.d.ts +4 -4
- package/esm/components/use-form/use-form.type.d.ts.map +1 -1
- package/esm/components/use-form/use-form.type.js +1 -5
- package/esm/components/use-image/index.js +4 -40
- package/esm/components/use-image/use-image-gallery.d.ts +4 -4
- package/esm/components/use-image/use-image-gallery.d.ts.map +1 -1
- package/esm/components/use-image/use-image-gallery.js +34 -37
- package/esm/components/use-image/use-image-gallery.type.d.ts +1 -1
- package/esm/components/use-image/use-image-gallery.type.d.ts.map +1 -1
- package/esm/components/use-image/use-image-gallery.type.js +1 -5
- package/esm/components/use-image/use-image-group.d.ts +2 -2
- package/esm/components/use-image/use-image-group.d.ts.map +1 -1
- package/esm/components/use-image/use-image-group.js +15 -24
- package/esm/components/use-image/use-image-group.type.js +1 -5
- package/esm/components/use-image/use-image-magnify.js +17 -26
- package/esm/components/use-image/use-image-magnify.type.js +1 -5
- package/esm/components/use-image/use-image.d.ts +3 -3
- package/esm/components/use-image/use-image.d.ts.map +1 -1
- package/esm/components/use-image/use-image.js +28 -41
- package/esm/components/use-image/use-image.type.d.ts +4 -4
- package/esm/components/use-image/use-image.type.d.ts.map +1 -1
- package/esm/components/use-image/use-image.type.js +1 -5
- package/esm/components/use-input/index.js +4 -40
- package/esm/components/use-input/use-input-format.d.ts +1 -1
- package/esm/components/use-input/use-input-format.js +18 -27
- package/esm/components/use-input/use-input-format.type.d.ts +1 -1
- package/esm/components/use-input/use-input-format.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-format.type.js +1 -5
- package/esm/components/use-input/use-input-number.d.ts +1 -1
- package/esm/components/use-input/use-input-number.js +23 -31
- package/esm/components/use-input/use-input-number.type.d.ts +1 -1
- package/esm/components/use-input/use-input-number.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-number.type.js +1 -5
- package/esm/components/use-input/use-input-password.js +16 -21
- package/esm/components/use-input/use-input-password.type.d.ts +1 -1
- package/esm/components/use-input/use-input-password.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-password.type.js +1 -5
- package/esm/components/use-input/use-input.d.ts +3 -3
- package/esm/components/use-input/use-input.js +34 -42
- package/esm/components/use-input/use-input.type.d.ts +5 -5
- package/esm/components/use-input/use-input.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input.type.js +1 -5
- package/esm/components/use-menu/index.js +2 -20
- package/esm/components/use-menu/use-menu-item.d.ts +1 -1
- package/esm/components/use-menu/use-menu-item.d.ts.map +1 -1
- package/esm/components/use-menu/use-menu-item.js +23 -31
- package/esm/components/use-menu/use-menu.js +15 -28
- package/esm/components/use-menu/use-menu.type.d.ts +1 -1
- package/esm/components/use-menu/use-menu.type.d.ts.map +1 -1
- package/esm/components/use-menu/use-menu.type.js +1 -5
- package/esm/components/use-pagination/index.js +1 -19
- package/esm/components/use-pagination/use-pagination.d.ts +1 -1
- package/esm/components/use-pagination/use-pagination.d.ts.map +1 -1
- package/esm/components/use-pagination/use-pagination.js +25 -25
- package/esm/components/use-pagination/use-pagination.type.js +1 -5
- package/esm/components/use-popup/index.js +1 -19
- package/esm/components/use-popup/popup-context.js +3 -9
- package/esm/components/use-popup/use-popup.js +35 -39
- package/esm/components/use-popup/use-popup.type.d.ts +1 -1
- package/esm/components/use-popup/use-popup.type.d.ts.map +1 -1
- package/esm/components/use-popup/use-popup.type.js +1 -5
- package/esm/components/use-select/index.js +2 -26
- package/esm/components/use-select/use-select-group.js +19 -22
- package/esm/components/use-select/use-select-group.type.js +1 -5
- package/esm/components/use-select/use-select.js +5 -12
- package/esm/components/use-select/use-select.type.d.ts +1 -1
- package/esm/components/use-select/use-select.type.d.ts.map +1 -1
- package/esm/components/use-select/use-select.type.js +1 -5
- package/esm/components/use-slider/index.js +1 -19
- package/esm/components/use-slider/use-slider.js +30 -32
- package/esm/components/use-slider/use-slider.type.js +1 -5
- package/esm/components/use-table/index.js +8 -68
- package/esm/components/use-table/use-table-columns.d.ts +1 -1
- package/esm/components/use-table/use-table-columns.d.ts.map +1 -1
- package/esm/components/use-table/use-table-columns.js +9 -20
- package/esm/components/use-table/use-table-expand.js +24 -35
- package/esm/components/use-table/use-table-group.js +5 -17
- package/esm/components/use-table/use-table-layout.d.ts.map +1 -1
- package/esm/components/use-table/use-table-layout.js +68 -75
- package/esm/components/use-table/use-table-row.js +18 -25
- package/esm/components/use-table/use-table-sort.d.ts +1 -1
- package/esm/components/use-table/use-table-sort.d.ts.map +1 -1
- package/esm/components/use-table/use-table-sort.js +34 -41
- package/esm/components/use-table/use-table-tree.d.ts +1 -1
- package/esm/components/use-table/use-table-tree.d.ts.map +1 -1
- package/esm/components/use-table/use-table-tree.js +61 -76
- package/esm/components/use-table/use-table-virtual.js +34 -36
- package/esm/components/use-table/use-table.type.d.ts +4 -4
- package/esm/components/use-table/use-table.type.d.ts.map +1 -1
- package/esm/components/use-table/use-table.type.js +1 -5
- package/esm/components/use-tabs/context.js +7 -21
- package/esm/components/use-tabs/context.type.js +1 -5
- package/esm/components/use-tabs/index.js +2 -26
- package/esm/components/use-tabs/use-tabs.js +13 -16
- package/esm/components/use-tabs/use-tabs.type.d.ts +1 -1
- package/esm/components/use-tabs/use-tabs.type.d.ts.map +1 -1
- package/esm/components/use-tabs/use-tabs.type.js +1 -5
- package/esm/components/use-textarea/index.js +2 -26
- package/esm/components/use-textarea/use-textarea-format.js +6 -15
- package/esm/components/use-textarea/use-textarea-format.type.d.ts +1 -1
- package/esm/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
- package/esm/components/use-textarea/use-textarea-format.type.js +1 -5
- package/esm/components/use-textarea/use-textarea.d.ts +2 -2
- package/esm/components/use-textarea/use-textarea.js +31 -32
- package/esm/components/use-textarea/use-textarea.type.d.ts +3 -3
- package/esm/components/use-textarea/use-textarea.type.d.ts.map +1 -1
- package/esm/components/use-textarea/use-textarea.type.js +1 -5
- package/esm/components/use-transfer/index.js +1 -19
- package/esm/components/use-transfer/use-transfer.js +33 -38
- package/esm/components/use-transfer/use-transfer.type.d.ts +1 -1
- package/esm/components/use-transfer/use-transfer.type.d.ts.map +1 -1
- package/esm/components/use-transfer/use-transfer.type.js +1 -5
- package/esm/components/use-tree/index.js +2 -26
- package/esm/components/use-tree/use-tree-node.js +17 -20
- package/esm/components/use-tree/use-tree-node.type.d.ts +2 -2
- package/esm/components/use-tree/use-tree-node.type.d.ts.map +1 -1
- package/esm/components/use-tree/use-tree-node.type.js +1 -5
- package/esm/components/use-tree/use-tree.js +25 -37
- package/esm/components/use-tree/use-tree.type.d.ts +3 -3
- package/esm/components/use-tree/use-tree.type.d.ts.map +1 -1
- package/esm/components/use-tree/use-tree.type.js +1 -5
- package/esm/components/use-treeselect/index.js +2 -26
- package/esm/components/use-treeselect/use-tiled.js +22 -24
- package/esm/components/use-treeselect/use-tiled.type.d.ts +1 -1
- package/esm/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
- package/esm/components/use-treeselect/use-tiled.type.js +1 -5
- package/esm/components/use-treeselect/use-treeselect.js +3 -10
- package/esm/components/use-treeselect/use-treeselect.type.js +1 -5
- package/esm/components/use-upload/index.js +1 -19
- package/esm/components/use-upload/use-upload.js +57 -62
- package/esm/components/use-upload/use-upload.type.js +1 -5
- package/esm/components/use-upload/xhr.js +1 -8
- package/esm/components/use-validate/index.js +1 -19
- package/esm/components/use-validate/use-validate.js +16 -19
- package/esm/components/use-validate/use-validate.type.js +1 -5
- package/esm/index.js +48 -547
- package/esm/utils/accept.d.ts +1 -1
- package/esm/utils/accept.d.ts.map +1 -1
- package/esm/utils/accept.js +1 -11
- package/esm/utils/array.js +2 -10
- package/esm/utils/attribute.js +3 -11
- package/esm/utils/clone.js +19 -34
- package/esm/utils/document.js +11 -20
- package/esm/utils/dom/element.js +23 -33
- package/esm/utils/dom/index.js +5 -69
- package/esm/utils/dom/normalize-wheel.js +1 -7
- package/esm/utils/dom/normalize-wheel.type.js +1 -5
- package/esm/utils/dom/ready.js +3 -9
- package/esm/utils/dom/responsiveObserve.js +10 -21
- package/esm/utils/dom/responsiveObserve.type.d.ts +4 -4
- package/esm/utils/dom/responsiveObserve.type.d.ts.map +1 -1
- package/esm/utils/dom/responsiveObserve.type.js +1 -5
- package/esm/utils/dom/scroll-behavior.js +2 -9
- package/esm/utils/extract-event-handlers.js +1 -13
- package/esm/utils/func.js +3 -11
- package/esm/utils/immer.d.ts +1 -8
- package/esm/utils/immer.d.ts.map +1 -1
- package/esm/utils/immer.js +12 -20
- package/esm/utils/index.js +22 -269
- package/esm/utils/is.d.ts +1 -1
- package/esm/utils/is.d.ts.map +1 -1
- package/esm/utils/is.js +33 -69
- package/esm/utils/lazyload.d.ts +1 -1
- package/esm/utils/lazyload.d.ts.map +1 -1
- package/esm/utils/lazyload.js +6 -15
- package/esm/utils/number.js +6 -24
- package/esm/utils/object.d.ts +4 -4
- package/esm/utils/object.d.ts.map +1 -1
- package/esm/utils/object.js +30 -59
- package/esm/utils/position.js +8 -13
- package/esm/utils/react-render.d.ts +1 -1
- package/esm/utils/react-render.d.ts.map +1 -1
- package/esm/utils/react-render.js +16 -31
- package/esm/utils/render.d.ts +1 -1
- package/esm/utils/render.d.ts.map +1 -1
- package/esm/utils/render.js +4 -13
- package/esm/utils/rule/index.js +1 -19
- package/esm/utils/rule/length.d.ts +1 -1
- package/esm/utils/rule/length.js +11 -19
- package/esm/utils/rule/regexp.d.ts +1 -1
- package/esm/utils/rule/regexp.js +7 -18
- package/esm/utils/rule/required.d.ts +1 -1
- package/esm/utils/rule/required.js +6 -14
- package/esm/utils/rule/rule.js +20 -33
- package/esm/utils/rule/rule.type.d.ts +8 -8
- package/esm/utils/rule/rule.type.d.ts.map +1 -1
- package/esm/utils/rule/rule.type.js +1 -5
- package/esm/utils/rule/type.d.ts +1 -1
- package/esm/utils/rule/type.js +6 -14
- package/esm/utils/shallow-equal.js +7 -21
- package/esm/utils/string.js +2 -16
- package/esm/utils/style-unit.js +3 -11
- package/esm/utils/tree.d.ts +1 -1
- package/esm/utils/tree.d.ts.map +1 -1
- package/esm/utils/tree.js +24 -32
- package/esm/utils/uid.js +2 -20
- package/esm/utils/validate/error.js +23 -26
- package/esm/utils/validate/get-rule.js +16 -26
- package/esm/utils/validate/index.d.ts +1 -1
- package/esm/utils/validate/index.d.ts.map +1 -1
- package/esm/utils/validate/index.js +20 -40
- package/esm/utils/validate/isJson.js +3 -12
- package/esm/utils/validate/nullable.js +2 -9
- package/esm/utils/validate/type.d.ts +1 -1
- package/esm/utils/validate/type.d.ts.map +1 -1
- package/esm/utils/validate/type.js +8 -19
- package/package.json +3 -2
@@ -1,24 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
|
4
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
5
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
6
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
7
4
|
Object.defineProperty(exports, "__esModule", {
|
8
5
|
value: true
|
9
6
|
});
|
10
7
|
exports.default = void 0;
|
11
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
13
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
15
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
16
|
-
require("core-js/modules/es.promise.js");
|
17
|
-
require("core-js/modules/es.regexp.exec.js");
|
18
|
-
require("core-js/modules/es.array.from.js");
|
19
|
-
require("core-js/modules/es.array.iterator.js");
|
20
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
21
|
-
require("core-js/modules/es.array.splice.js");
|
22
8
|
var _react = require("react");
|
23
9
|
var _immer = require("../../utils/immer");
|
24
10
|
var _useLatestObj = _interopRequireDefault(require("../../common/use-latest-obj"));
|
@@ -26,8 +12,25 @@ var _xhr = _interopRequireDefault(require("./xhr"));
|
|
26
12
|
var _accept = require("../../utils/accept");
|
27
13
|
var _uid = require("../../utils/uid");
|
28
14
|
var _ = require("../..");
|
29
|
-
function
|
30
|
-
function
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
17
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
18
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
19
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
20
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
21
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
22
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
23
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
24
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
25
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
26
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
27
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
28
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
29
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
30
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
31
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
32
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
33
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
31
34
|
var VALIDATORITEMS = [{
|
32
35
|
key: 'size',
|
33
36
|
param: function param(blob) {
|
@@ -69,11 +72,11 @@ var useUpload = function useUpload(props) {
|
|
69
72
|
var accept = props.forceAccept || props.accept;
|
70
73
|
var forceAccept = !!props.forceAccept;
|
71
74
|
var _useState = (0, _react.useState)({}),
|
72
|
-
_useState2 = (
|
75
|
+
_useState2 = _slicedToArray(_useState, 2),
|
73
76
|
filesState = _useState2[0],
|
74
77
|
setFiles = _useState2[1];
|
75
78
|
var _useState3 = (0, _react.useState)([]),
|
76
|
-
_useState4 = (
|
79
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
77
80
|
recycleValues = _useState4[0],
|
78
81
|
setRecycleValues = _useState4[1];
|
79
82
|
var restLength = limit - value.length - Object.keys(filesState).length;
|
@@ -82,9 +85,9 @@ var useUpload = function useUpload(props) {
|
|
82
85
|
invalidImage: 'invalidImage'
|
83
86
|
}, props.text);
|
84
87
|
var validateFile = /*#__PURE__*/function () {
|
85
|
-
var _ref = (
|
88
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(blob, image) {
|
86
89
|
var validator, error, i, acceptRes, item;
|
87
|
-
return
|
90
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
88
91
|
while (1) switch (_context.prev = _context.next) {
|
89
92
|
case 0:
|
90
93
|
validator = props.validator;
|
@@ -284,9 +287,9 @@ var useUpload = function useUpload(props) {
|
|
284
287
|
});
|
285
288
|
};
|
286
289
|
var addFiles = /*#__PURE__*/function () {
|
287
|
-
var _ref2 = (
|
288
|
-
var fileList, newFiles, resetLength, list, _loop,
|
289
|
-
return
|
290
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(files) {
|
291
|
+
var fileList, newFiles, resetLength, list, _loop, _ret, i;
|
292
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context3) {
|
290
293
|
while (1) switch (_context3.prev = _context3.next) {
|
291
294
|
case 0:
|
292
295
|
if (!props.disabled) {
|
@@ -308,9 +311,9 @@ var useUpload = function useUpload(props) {
|
|
308
311
|
list = Array.from({
|
309
312
|
length: Math.min(fileList.length, resetLength)
|
310
313
|
});
|
311
|
-
_loop = /*#__PURE__*/
|
314
|
+
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
312
315
|
var blob, id, fileRecord, error, imageResult, beforeUploadResult;
|
313
|
-
return
|
316
|
+
return _regeneratorRuntime().wrap(function _loop$(_context2) {
|
314
317
|
while (1) switch (_context2.prev = _context2.next) {
|
315
318
|
case 0:
|
316
319
|
blob = fileList[i];
|
@@ -360,12 +363,12 @@ var useUpload = function useUpload(props) {
|
|
360
363
|
}
|
361
364
|
delete newFiles[id];
|
362
365
|
setFiles(_objectSpread({}, newFiles));
|
363
|
-
return _context2.abrupt("return",
|
366
|
+
return _context2.abrupt("return", 0);
|
364
367
|
case 26:
|
365
368
|
fileRecord.message = error.message;
|
366
369
|
fileRecord.status = 3;
|
367
370
|
setFiles(_objectSpread({}, newFiles));
|
368
|
-
return _context2.abrupt("return",
|
371
|
+
return _context2.abrupt("return", 0);
|
369
372
|
case 30:
|
370
373
|
if (!props.beforeUpload) {
|
371
374
|
_context2.next = 37;
|
@@ -385,7 +388,7 @@ var useUpload = function useUpload(props) {
|
|
385
388
|
delete newFiles[id];
|
386
389
|
setFiles(_objectSpread({}, newFiles));
|
387
390
|
});
|
388
|
-
return _context2.abrupt("return",
|
391
|
+
return _context2.abrupt("return", 0);
|
389
392
|
case 35:
|
390
393
|
_context2.next = 39;
|
391
394
|
break;
|
@@ -407,7 +410,7 @@ var useUpload = function useUpload(props) {
|
|
407
410
|
return _context3.delegateYield(_loop(), "t0", 13);
|
408
411
|
case 13:
|
409
412
|
_ret = _context3.t0;
|
410
|
-
if (!(_ret ===
|
413
|
+
if (!(_ret === 0)) {
|
411
414
|
_context3.next = 16;
|
412
415
|
break;
|
413
416
|
}
|
@@ -452,7 +455,7 @@ var useUpload = function useUpload(props) {
|
|
452
455
|
var current = props.value[index];
|
453
456
|
var startRemove = typeof beforeRemove === 'function' ? beforeRemove(current) : Promise.resolve();
|
454
457
|
startRemove.then(function () {
|
455
|
-
var newRecycle = (
|
458
|
+
var newRecycle = _toConsumableArray(recycleValues);
|
456
459
|
if (typeof recoverAble !== 'number' ? !!recoverAble : recycleValues.length < recoverAble) {
|
457
460
|
newRecycle.push(value[index]);
|
458
461
|
}
|
@@ -469,7 +472,7 @@ var useUpload = function useUpload(props) {
|
|
469
472
|
draft.push(recycleValues[index]);
|
470
473
|
}));
|
471
474
|
setRecycleValues(function (pre) {
|
472
|
-
var newRecycle = (
|
475
|
+
var newRecycle = _toConsumableArray(pre);
|
473
476
|
newRecycle.splice(index, 1);
|
474
477
|
return newRecycle;
|
475
478
|
});
|
@@ -488,5 +491,4 @@ var useUpload = function useUpload(props) {
|
|
488
491
|
func: func
|
489
492
|
};
|
490
493
|
};
|
491
|
-
var _default = useUpload;
|
492
|
-
exports.default = _default;
|
494
|
+
var _default = exports.default = useUpload;
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = _default;
|
7
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
8
7
|
function createCORSRequest(method, url) {
|
9
8
|
var xhr = new XMLHttpRequest();
|
10
9
|
if ('withCredentials' in xhr) {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
"use client";
|
3
3
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
@@ -17,4 +16,5 @@ Object.defineProperty(exports, "useValidate", {
|
|
17
16
|
return _useValidate.default;
|
18
17
|
}
|
19
18
|
});
|
20
|
-
var _useValidate = _interopRequireDefault(require("./use-validate"));
|
19
|
+
var _useValidate = _interopRequireDefault(require("./use-validate"));
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -1,18 +1,23 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.default = void 0;
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
9
7
|
var _react = require("react");
|
10
8
|
var _usePersistFn = _interopRequireDefault(require("../../common/use-persist-fn"));
|
11
9
|
var _utils = require("../../utils");
|
12
10
|
var _formItemContext = require("../use-form/use-form-item/form-item-context");
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
14
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
16
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
13
18
|
var useValidate = function useValidate(props) {
|
14
19
|
var _useState = (0, _react.useState)(undefined),
|
15
|
-
_useState2 = (
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
16
21
|
error = _useState2[0],
|
17
22
|
setError = _useState2[1];
|
18
23
|
var _props$rules = props.rules,
|
@@ -41,5 +46,4 @@ var useValidate = function useValidate(props) {
|
|
41
46
|
validate: validate
|
42
47
|
};
|
43
48
|
};
|
44
|
-
var _default = useValidate;
|
45
|
-
exports.default = _default;
|
49
|
+
var _default = exports.default = useValidate;
|
package/cjs/index.js
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
"use client";
|
3
3
|
|
4
|
-
|
5
|
-
require("core-js/modules/es.weak-map.js");
|
6
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
7
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
8
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
4
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
9
5
|
Object.defineProperty(exports, "__esModule", {
|
10
6
|
value: true
|
11
7
|
});
|
@@ -543,9 +539,8 @@ Object.keys(_useCascader).forEach(function (key) {
|
|
543
539
|
}
|
544
540
|
});
|
545
541
|
});
|
546
|
-
function _getRequireWildcardCache(
|
547
|
-
function _interopRequireWildcard(
|
542
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
543
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
548
544
|
//common
|
549
545
|
//components
|
550
|
-
var _default = {};
|
551
|
-
exports.default = _default;
|
546
|
+
var _default = exports.default = {};
|
package/cjs/utils/accept.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["accept.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["accept.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAEvC,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,aAAa,WAsBpE"}
|
package/cjs/utils/accept.js
CHANGED
@@ -4,10 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.attrAccept = attrAccept;
|
7
|
-
require("core-js/modules/es.regexp.exec.js");
|
8
|
-
require("core-js/modules/es.string.replace.js");
|
9
|
-
require("core-js/modules/es.string.trim.js");
|
10
|
-
require("core-js/modules/es.string.ends-with.js");
|
11
7
|
function attrAccept(file, acceptedFiles) {
|
12
8
|
if (file && acceptedFiles) {
|
13
9
|
var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');
|
package/cjs/utils/array.js
CHANGED
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.flattenArray = void 0;
|
7
|
-
|
8
|
-
var flattenArray = function flattenArray(arr1) {
|
7
|
+
var flattenArray = exports.flattenArray = function flattenArray(arr1) {
|
9
8
|
return arr1.reduce(function (acc, val) {
|
10
9
|
return Array.isArray(val) ? acc.concat(flattenArray(val)) : acc.concat(val);
|
11
10
|
}, []);
|
12
|
-
};
|
13
|
-
exports.flattenArray = flattenArray;
|
11
|
+
};
|
package/cjs/utils/attribute.js
CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.getDataAttributeName = exports.getDataAttribute = void 0;
|
7
|
-
var getDataAttribute = function getDataAttribute(attrs) {
|
7
|
+
var getDataAttribute = exports.getDataAttribute = function getDataAttribute(attrs) {
|
8
8
|
return Object.keys(attrs).reduce(function (acc, key) {
|
9
9
|
var ns = "data-soui-".concat(key);
|
10
10
|
if (attrs[key] !== undefined) {
|
@@ -13,8 +13,6 @@ var getDataAttribute = function getDataAttribute(attrs) {
|
|
13
13
|
return acc;
|
14
14
|
}, {});
|
15
15
|
};
|
16
|
-
exports.
|
17
|
-
var getDataAttributeName = function getDataAttributeName(name) {
|
16
|
+
var getDataAttributeName = exports.getDataAttributeName = function getDataAttributeName(name) {
|
18
17
|
return "data-soui-".concat(name);
|
19
|
-
};
|
20
|
-
exports.getDataAttributeName = getDataAttributeName;
|
18
|
+
};
|
package/cjs/utils/clone.js
CHANGED
@@ -1,22 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.shallowClone = exports.fastClone = exports.deepClone = void 0;
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
9
|
-
require("core-js/modules/es.array.from.js");
|
10
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
11
|
-
require("core-js/modules/es.array.concat.js");
|
12
|
-
require("core-js/modules/es.array.iterator.js");
|
13
|
-
require("core-js/modules/es.map.js");
|
14
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
15
|
-
require("core-js/modules/es.set.js");
|
16
|
-
require("core-js/modules/es.regexp.constructor.js");
|
17
|
-
require("core-js/modules/es.regexp.exec.js");
|
18
|
-
require("core-js/modules/es.regexp.to-string.js");
|
19
7
|
var _is = require("./is");
|
8
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
11
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
12
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
20
14
|
// eslint-disable-next-line
|
21
15
|
var cloneArray = function cloneArray(source) {
|
22
16
|
return (
|
@@ -41,17 +35,16 @@ var cloneObject = function cloneObject(source) {
|
|
41
35
|
console.error(e);
|
42
36
|
target = {};
|
43
37
|
}
|
44
|
-
[].concat((
|
38
|
+
[].concat(_toConsumableArray(specialKeys), _toConsumableArray(Object.keys(source))).forEach(function (k) {
|
45
39
|
// eslint-disable-next-line
|
46
40
|
target[k] = deepClone(source[k]);
|
47
41
|
});
|
48
42
|
return target;
|
49
43
|
};
|
50
|
-
var fastClone = function fastClone(obj) {
|
44
|
+
var fastClone = exports.fastClone = function fastClone(obj) {
|
51
45
|
return JSON.parse(JSON.stringify(obj));
|
52
46
|
};
|
53
|
-
exports.
|
54
|
-
var shallowClone = function shallowClone(val) {
|
47
|
+
var shallowClone = exports.shallowClone = function shallowClone(val) {
|
55
48
|
if (!val) return val;
|
56
49
|
if ((0, _is.isDate)(val)) return new Date(val);
|
57
50
|
if ((0, _is.isMap)(val)) return new Map(val);
|
@@ -60,10 +53,8 @@ var shallowClone = function shallowClone(val) {
|
|
60
53
|
if ((0, _is.isError)(val)) return cloneObject(val, ['message']);
|
61
54
|
return val;
|
62
55
|
};
|
63
|
-
exports.
|
64
|
-
var deepClone = function deepClone(source) {
|
56
|
+
var deepClone = exports.deepClone = function deepClone(source) {
|
65
57
|
if ((0, _is.isArray)(source)) return cloneArray(source);
|
66
58
|
if ((0, _is.isMergeable)(source)) return cloneObject(source);
|
67
59
|
return shallowClone(source);
|
68
|
-
};
|
69
|
-
exports.deepClone = deepClone;
|
60
|
+
};
|
package/cjs/utils/document.js
CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.docSize = exports.docScroll = void 0;
|
7
7
|
exports.isInDocument = isInDocument;
|
8
8
|
var _is = require("./is");
|
9
|
-
var docSize = {
|
9
|
+
var docSize = exports.docSize = {
|
10
10
|
get width() {
|
11
11
|
if (!(0, _is.isBrowser)()) return 0;
|
12
12
|
return document.documentElement.clientWidth || document.body.clientWidth;
|
@@ -16,8 +16,7 @@ var docSize = {
|
|
16
16
|
return document.documentElement.clientHeight || document.body.clientHeight;
|
17
17
|
}
|
18
18
|
};
|
19
|
-
exports.
|
20
|
-
var docScroll = {
|
19
|
+
var docScroll = exports.docScroll = {
|
21
20
|
get top() {
|
22
21
|
if (!(0, _is.isBrowser)()) return 0;
|
23
22
|
return document.documentElement.scrollTop || document.body.scrollTop;
|
@@ -37,7 +36,6 @@ var docScroll = {
|
|
37
36
|
document.body.scrollLeft = value;
|
38
37
|
}
|
39
38
|
};
|
40
|
-
exports.docScroll = docScroll;
|
41
39
|
function isInDocument(element) {
|
42
40
|
if (element && 'isConnected' in element) {
|
43
41
|
return element.isConnected;
|
package/cjs/utils/dom/element.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
@@ -9,10 +8,6 @@ exports.cssSupport = cssSupport;
|
|
9
8
|
exports.getParent = getParent;
|
10
9
|
exports.parsePxToNumber = void 0;
|
11
10
|
exports.wrapSpan = wrapSpan;
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
13
|
-
require("core-js/modules/es.regexp.exec.js");
|
14
|
-
require("core-js/modules/es.array.map.js");
|
15
|
-
require("core-js/modules/es.string.replace.js");
|
16
11
|
var _react = _interopRequireDefault(require("react"));
|
17
12
|
var _func = require("../func");
|
18
13
|
var _is = require("../is");
|
@@ -24,6 +19,13 @@ var _this = void 0;
|
|
24
19
|
* @param str 文本内容
|
25
20
|
* @returns boolean
|
26
21
|
*/
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
24
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
25
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
26
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
27
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
28
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
27
29
|
var isTwoCNChar = function isTwoCNChar(str) {
|
28
30
|
return /^[\u4e00-\u9fa5]{2}$/.test(str);
|
29
31
|
};
|
@@ -53,12 +55,12 @@ function wrapSpan(children) {
|
|
53
55
|
return item;
|
54
56
|
});
|
55
57
|
}
|
56
|
-
var addResizeObserver = function addResizeObserver(el, handler) {
|
58
|
+
var addResizeObserver = exports.addResizeObserver = function addResizeObserver(el, handler) {
|
57
59
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
58
60
|
var direction = options.direction,
|
59
61
|
timer = options.timer;
|
60
62
|
var _debounce = (0, _func.debounce)(handler, timer),
|
61
|
-
_debounce2 = (
|
63
|
+
_debounce2 = _slicedToArray(_debounce, 2),
|
62
64
|
debounceHandler = _debounce2[0],
|
63
65
|
cleanTimer = _debounce2[1];
|
64
66
|
var h = debounceHandler;
|
@@ -106,7 +108,6 @@ var addResizeObserver = function addResizeObserver(el, handler) {
|
|
106
108
|
cleanTimer();
|
107
109
|
};
|
108
110
|
};
|
109
|
-
exports.addResizeObserver = addResizeObserver;
|
110
111
|
function getParent(el, target) {
|
111
112
|
if (!target) {
|
112
113
|
return null;
|
@@ -137,7 +138,6 @@ function cssSupport(attr, value) {
|
|
137
138
|
}
|
138
139
|
return false;
|
139
140
|
}
|
140
|
-
var parsePxToNumber = function parsePxToNumber(str) {
|
141
|
+
var parsePxToNumber = exports.parsePxToNumber = function parsePxToNumber(str) {
|
141
142
|
return Number(str.replace(/\s+|px/gi, ''));
|
142
|
-
};
|
143
|
-
exports.parsePxToNumber = parsePxToNumber;
|
143
|
+
};
|
package/cjs/utils/dom/index.js
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
6
4
|
value: true
|
7
5
|
});
|
@@ -66,4 +64,5 @@ Object.keys(_ready).forEach(function (key) {
|
|
66
64
|
}
|
67
65
|
});
|
68
66
|
});
|
69
|
-
var _responsiveObserve = _interopRequireDefault(require("./responsiveObserve"));
|
67
|
+
var _responsiveObserve = _interopRequireDefault(require("./responsiveObserve"));
|
68
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -1,20 +1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
6
4
|
value: true
|
7
5
|
});
|
8
6
|
exports.responsiveMap = exports.responsiveArray = exports.default = void 0;
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
function
|
14
|
-
function
|
15
|
-
var responsiveArray = ['xxxl', 'xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
16
|
-
exports.
|
17
|
-
var responsiveMap = {
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
13
|
+
var responsiveArray = exports.responsiveArray = ['xxxl', 'xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
14
|
+
var responsiveMap = exports.responsiveMap = {
|
18
15
|
xs: '(max-width: 575px)',
|
19
16
|
sm: '(min-width: 576px)',
|
20
17
|
md: '(min-width: 768px)',
|
@@ -23,7 +20,6 @@ var responsiveMap = {
|
|
23
20
|
xxl: '(min-width: 1600px)',
|
24
21
|
xxxl: '(min-width: 2000px)'
|
25
22
|
};
|
26
|
-
exports.responsiveMap = responsiveMap;
|
27
23
|
var subscribers = [];
|
28
24
|
var subUid = -1;
|
29
25
|
var screens = {};
|
@@ -42,7 +38,7 @@ var responsiveObserve = {
|
|
42
38
|
var listener = function listener(screen) {
|
43
39
|
return function (_ref) {
|
44
40
|
var matches = _ref.matches;
|
45
|
-
return _this.dispatch(_objectSpread(_objectSpread({}, screens), {}, (
|
41
|
+
return _this.dispatch(_objectSpread(_objectSpread({}, screens), {}, _defineProperty({}, screen, matches)), screen);
|
46
42
|
};
|
47
43
|
};
|
48
44
|
Object.keys(responsiveMap).forEach(function (screen) {
|
@@ -85,5 +81,4 @@ var responsiveObserve = {
|
|
85
81
|
if (subscribers.length === 0) this.unregister();
|
86
82
|
}
|
87
83
|
};
|
88
|
-
var _default = responsiveObserve;
|
89
|
-
exports.default = _default;
|
84
|
+
var _default = exports.default = responsiveObserve;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
1
|
+
export type Breakpoint = 'xxxl' | 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
2
|
+
export type BreakpointMap = Partial<Record<Breakpoint, string>>;
|
3
|
+
export type ScreenMap = Partial<Record<Breakpoint, boolean>>;
|
4
|
+
export type SubscribeFunc = (screens: ScreenMap, breakpointChecked?: Breakpoint) => void;
|
5
5
|
//# sourceMappingURL=responsiveObserve.type.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"responsiveObserve.type.d.ts","sourceRoot":"","sources":["responsiveObserve.type.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"responsiveObserve.type.d.ts","sourceRoot":"","sources":["responsiveObserve.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3E,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAChE,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAE7D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,iBAAiB,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC"}
|
@@ -19,12 +19,11 @@ var resetScrollBehavior = function resetScrollBehavior() {
|
|
19
19
|
htmlDom.style.overscrollBehaviorX = lastStyle;
|
20
20
|
lastStyle = null;
|
21
21
|
};
|
22
|
-
var banOverScrollx = function banOverScrollx(el) {
|
22
|
+
var banOverScrollx = exports.banOverScrollx = function banOverScrollx(el) {
|
23
23
|
el.addEventListener('mouseenter', setScrollBehavior);
|
24
24
|
el.addEventListener('mouseleave', resetScrollBehavior);
|
25
25
|
return function () {
|
26
26
|
el.removeEventListener('mouseenter', setScrollBehavior);
|
27
27
|
el.removeEventListener('mouseleave', resetScrollBehavior);
|
28
28
|
};
|
29
|
-
};
|
30
|
-
exports.banOverScrollx = banOverScrollx;
|
29
|
+
};
|
@@ -4,12 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = extractEventHandlers;
|
7
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
8
|
-
require("core-js/modules/es.array.filter.js");
|
9
|
-
require("core-js/modules/es.regexp.exec.js");
|
10
|
-
require("core-js/modules/es.string.match.js");
|
11
|
-
require("core-js/modules/es.array.includes.js");
|
12
|
-
require("core-js/modules/es.string.includes.js");
|
13
7
|
/**
|
14
8
|
* Extracts event handlers from a given object.
|
15
9
|
* A prop is considered an event handler if it is a function and its name starts with `on`.
|