@sheinx/hooks 3.0.0-rc.1 → 3.0.0-rc.11
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
package/esm/utils/object.js
CHANGED
@@ -1,33 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
require("core-js/modules/es.array.slice.js");
|
6
|
-
require("core-js/modules/es.array.from.js");
|
7
|
-
require("core-js/modules/es.symbol.description.js");
|
8
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
10
|
-
value: true
|
11
|
-
});
|
12
|
-
exports.entries = exports.deepSet = exports.deepRemove = exports.deepMerge = exports.deepHas = exports.deepGet = void 0;
|
13
|
-
exports.insertPoint = insertPoint;
|
14
|
-
exports.objectValues = void 0;
|
15
|
-
exports.pathGenerator = pathGenerator;
|
16
|
-
exports.removeProps = void 0;
|
17
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
18
|
-
require("core-js/modules/es.regexp.exec.js");
|
19
|
-
require("core-js/modules/es.string.replace.js");
|
20
|
-
require("core-js/modules/es.array.map.js");
|
21
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
22
|
-
require("core-js/modules/es.array.index-of.js");
|
23
|
-
require("core-js/modules/es.array.includes.js");
|
24
|
-
require("core-js/modules/es.string.includes.js");
|
25
|
-
require("core-js/modules/es.array.splice.js");
|
26
|
-
var _is = require("./is");
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
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."); }
|
3
|
+
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; } }
|
4
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
27
5
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
28
6
|
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); }
|
29
7
|
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; }
|
30
|
-
|
8
|
+
import { isMergeable, isObject } from "./is";
|
9
|
+
export function insertPoint(name) {
|
31
10
|
var reg = /(\[\d+\])/gi;
|
32
11
|
return name.replace(reg, function (s, m, i) {
|
33
12
|
return s.replace(m, i === 0 ? m : ".".concat(m));
|
@@ -41,7 +20,7 @@ var PATH_MODE = {
|
|
41
20
|
append: '$'
|
42
21
|
};
|
43
22
|
// Object.values()
|
44
|
-
var objectValues = function objectValues(obj) {
|
23
|
+
export var objectValues = function objectValues(obj) {
|
45
24
|
if (!obj) return [];
|
46
25
|
return Object.keys(obj).map(function (k) {
|
47
26
|
return obj[k];
|
@@ -49,24 +28,23 @@ var objectValues = function objectValues(obj) {
|
|
49
28
|
};
|
50
29
|
|
51
30
|
// object only, not handle array.
|
52
|
-
|
53
|
-
var deepMerge = function deepMerge() {
|
31
|
+
export var deepMerge = function deepMerge() {
|
54
32
|
var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
55
33
|
var source = arguments.length > 1 ? arguments[1] : undefined;
|
56
34
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
57
35
|
var clone = options.clone,
|
58
36
|
removeUndefined = options.removeUndefined,
|
59
37
|
skipUndefined = options.skipUndefined;
|
60
|
-
if (!
|
38
|
+
if (!isMergeable(source)) return source;
|
61
39
|
var dest = {};
|
62
|
-
if (
|
40
|
+
if (isMergeable(target)) {
|
63
41
|
Object.keys(target).forEach(function (k) {
|
64
42
|
dest[k] = clone ? deepMerge({}, target[k], options) : target[k];
|
65
43
|
if (removeUndefined && dest[k] === undefined) delete dest[k];
|
66
44
|
});
|
67
45
|
}
|
68
46
|
Object.keys(source).forEach(function (k) {
|
69
|
-
if (
|
47
|
+
if (isMergeable(source[k]) && isMergeable(target[k])) {
|
70
48
|
dest[k] = deepMerge(target[k], source[k], options);
|
71
49
|
} else {
|
72
50
|
if (skipUndefined && source[k] === undefined) return;
|
@@ -76,8 +54,7 @@ var deepMerge = function deepMerge() {
|
|
76
54
|
});
|
77
55
|
return dest;
|
78
56
|
};
|
79
|
-
|
80
|
-
function pathGenerator(raw) {
|
57
|
+
export function pathGenerator(raw) {
|
81
58
|
var path = insertPoint(raw);
|
82
59
|
var reg = /^\[(\d+)\]$/;
|
83
60
|
var pathModeValues = objectValues(PATH_MODE);
|
@@ -104,9 +81,9 @@ function pathGenerator(raw) {
|
|
104
81
|
}
|
105
82
|
return results;
|
106
83
|
}
|
107
|
-
var deepSet = function deepSet(target, path, value) {
|
84
|
+
export var deepSet = function deepSet(target, path, value) {
|
108
85
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
109
|
-
if (!
|
86
|
+
if (!isObject(target)) throw new Error('Target must be an object.');
|
110
87
|
if (typeof path !== 'string') throw new Error('Path must be a string.');
|
111
88
|
var removeUndefined = options.removeUndefined,
|
112
89
|
skipUndefined = options.skipUndefined;
|
@@ -129,7 +106,7 @@ var deepSet = function deepSet(target, path, value) {
|
|
129
106
|
_step;
|
130
107
|
try {
|
131
108
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
132
|
-
var _step$value = (
|
109
|
+
var _step$value = _slicedToArray(_step.value, 3),
|
133
110
|
prop = _step$value[0],
|
134
111
|
next = _step$value[1],
|
135
112
|
mode = _step$value[2];
|
@@ -152,7 +129,7 @@ var deepSet = function deepSet(target, path, value) {
|
|
152
129
|
current.splice(prop + 1, 0, value);
|
153
130
|
} else {
|
154
131
|
if (skipUndefined && value === undefined) break;
|
155
|
-
current[prop] =
|
132
|
+
current[prop] = isMergeable(current[prop]) && isMergeable(value) ? deepMerge(current[prop], value, mergeOptions) : value;
|
156
133
|
}
|
157
134
|
if (removeUndefined && value === undefined) delete current[prop];
|
158
135
|
}
|
@@ -163,10 +140,9 @@ var deepSet = function deepSet(target, path, value) {
|
|
163
140
|
}
|
164
141
|
return target;
|
165
142
|
};
|
166
|
-
|
167
|
-
var deepGet = function deepGet(target, path) {
|
143
|
+
export var deepGet = function deepGet(target, path) {
|
168
144
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
169
|
-
if (!
|
145
|
+
if (!isObject(target)) throw new Error('Target must be an object.');
|
170
146
|
if (typeof path !== 'string') throw new Error('Path must be a string.');
|
171
147
|
|
172
148
|
// empty root
|
@@ -178,7 +154,7 @@ var deepGet = function deepGet(target, path) {
|
|
178
154
|
_step2;
|
179
155
|
try {
|
180
156
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
181
|
-
var _step2$value = (
|
157
|
+
var _step2$value = _slicedToArray(_step2.value, 3),
|
182
158
|
prop = _step2$value[0],
|
183
159
|
mode = _step2$value[2];
|
184
160
|
var isStrict = mode === PATH_MODE.strict || strictMode && defaultValue === undefined && mode !== PATH_MODE.loose;
|
@@ -199,9 +175,8 @@ var deepGet = function deepGet(target, path) {
|
|
199
175
|
}
|
200
176
|
return current;
|
201
177
|
};
|
202
|
-
|
203
|
-
|
204
|
-
if (!(0, _is.isObject)(target)) throw new Error('Target must be an object.');
|
178
|
+
export var deepRemove = function deepRemove(target, path) {
|
179
|
+
if (!isObject(target)) throw new Error('Target must be an object.');
|
205
180
|
if (typeof path !== 'string' || !path) throw new Error('Path must be a string.');
|
206
181
|
var current = target;
|
207
182
|
var nextIsArray = false;
|
@@ -209,7 +184,7 @@ var deepRemove = function deepRemove(target, path) {
|
|
209
184
|
_step3;
|
210
185
|
try {
|
211
186
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
212
|
-
var _step3$value = (
|
187
|
+
var _step3$value = _slicedToArray(_step3.value, 2),
|
213
188
|
prop = _step3$value[0],
|
214
189
|
next = _step3$value[1];
|
215
190
|
// eslint-disable-next-line eqeqeq
|
@@ -219,7 +194,7 @@ var deepRemove = function deepRemove(target, path) {
|
|
219
194
|
if (next) {
|
220
195
|
current = current[prop];
|
221
196
|
nextIsArray = /^\[\d+\]/.test(next);
|
222
|
-
} else if (
|
197
|
+
} else if (isObject(current)) {
|
223
198
|
if (nextIsArray) throw new Error('Target is an object, expect array');
|
224
199
|
delete current[prop];
|
225
200
|
} else {
|
@@ -236,9 +211,8 @@ var deepRemove = function deepRemove(target, path) {
|
|
236
211
|
}
|
237
212
|
return target;
|
238
213
|
};
|
239
|
-
|
240
|
-
|
241
|
-
if (!(0, _is.isObject)(target)) throw new Error('Target must be an object.');
|
214
|
+
export var deepHas = function deepHas(target, path) {
|
215
|
+
if (!isObject(target)) throw new Error('Target must be an object.');
|
242
216
|
if (typeof path !== 'string') throw new Error('Path must be a string.');
|
243
217
|
if (path === '') return true;
|
244
218
|
var current = target;
|
@@ -246,7 +220,7 @@ var deepHas = function deepHas(target, path) {
|
|
246
220
|
_step4;
|
247
221
|
try {
|
248
222
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
249
|
-
var _step4$value = (
|
223
|
+
var _step4$value = _slicedToArray(_step4.value, 2),
|
250
224
|
prop = _step4$value[0];
|
251
225
|
if (!current || !hasOwnProperty.call(current, prop)) return false;
|
252
226
|
current = current[prop];
|
@@ -258,22 +232,20 @@ var deepHas = function deepHas(target, path) {
|
|
258
232
|
}
|
259
233
|
return true;
|
260
234
|
};
|
261
|
-
|
262
|
-
var entries = function entries(obj) {
|
235
|
+
export var entries = function entries(obj) {
|
263
236
|
if (!obj) return [];
|
264
237
|
var keys = Object.keys(obj);
|
265
238
|
return keys.map(function (key) {
|
266
239
|
return [key, obj[key]];
|
267
240
|
});
|
268
241
|
};
|
269
|
-
|
270
|
-
var removeProps = function removeProps(target, remove) {
|
242
|
+
export var removeProps = function removeProps(target, remove) {
|
271
243
|
var a = {};
|
272
244
|
var _iterator5 = _createForOfIteratorHelper(entries(target)),
|
273
245
|
_step5;
|
274
246
|
try {
|
275
247
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
276
|
-
var _step5$value = (
|
248
|
+
var _step5$value = _slicedToArray(_step5.value, 2),
|
277
249
|
key = _step5$value[0],
|
278
250
|
value = _step5$value[1];
|
279
251
|
if (!(key in remove)) {
|
@@ -286,5 +258,4 @@ var removeProps = function removeProps(target, remove) {
|
|
286
258
|
_iterator5.f();
|
287
259
|
}
|
288
260
|
return a;
|
289
|
-
};
|
290
|
-
exports.removeProps = removeProps;
|
261
|
+
};
|
package/esm/utils/position.js
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
1
|
+
import { docSize } from "./document";
|
2
|
+
// 根据位置计算合适的 position
|
2
3
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.getPosition = void 0;
|
7
|
-
var _document = require("./document");
|
8
4
|
var getMenuPosition = function getMenuPosition(target) {
|
9
5
|
var priorityDirection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'vertical';
|
10
6
|
var position = 'bottom-left';
|
@@ -13,8 +9,8 @@ var getMenuPosition = function getMenuPosition(target) {
|
|
13
9
|
var tempPriorityDirection = priorityDirection;
|
14
10
|
var horizontalPoint = rect.left + rect.width / 2;
|
15
11
|
var verticalPoint = rect.top + rect.height / 2;
|
16
|
-
var windowHeight =
|
17
|
-
var windowWidth =
|
12
|
+
var windowHeight = docSize.height;
|
13
|
+
var windowWidth = docSize.width;
|
18
14
|
if (priorityDirection === 'auto') {
|
19
15
|
var maxX = Math.max(rect.left, windowWidth - rect.right);
|
20
16
|
var maxY = Math.max(rect.top, windowHeight - rect.bottom);
|
@@ -45,8 +41,8 @@ var getPopoverPosition = function getPopoverPosition(target) {
|
|
45
41
|
var tempPriorityDirection = priorityDirection;
|
46
42
|
var horizontalPoint = rect.left + rect.width / 2;
|
47
43
|
var verticalPoint = rect.top + rect.height / 2;
|
48
|
-
var windowHeight =
|
49
|
-
var windowWidth =
|
44
|
+
var windowHeight = docSize.height;
|
45
|
+
var windowWidth = docSize.width;
|
50
46
|
if (priorityDirection === 'auto') {
|
51
47
|
var maxX = Math.max(rect.left, windowWidth - rect.right);
|
52
48
|
var maxY = Math.max(rect.top, windowHeight - rect.bottom);
|
@@ -69,11 +65,10 @@ var getPopoverPosition = function getPopoverPosition(target) {
|
|
69
65
|
}
|
70
66
|
return position;
|
71
67
|
};
|
72
|
-
var getPosition = function getPosition(target) {
|
68
|
+
export var getPosition = function getPosition(target) {
|
73
69
|
var priorityDirection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'vertical';
|
74
70
|
var mode = arguments.length > 2 ? arguments[2] : undefined;
|
75
71
|
if (mode === 'popover') return getPopoverPosition(target, priorityDirection);
|
76
72
|
if (mode === 'menu') return getMenuPosition(target, priorityDirection);
|
77
73
|
return 'bottom-left';
|
78
|
-
};
|
79
|
-
exports.getPosition = getPosition;
|
74
|
+
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type * as React from 'react';
|
2
2
|
import type { Root } from 'react-dom/client';
|
3
3
|
declare const MARK = "__sheinout_root__";
|
4
|
-
|
4
|
+
type ContainerType = (Element | DocumentFragment) & {
|
5
5
|
[MARK]?: Root;
|
6
6
|
};
|
7
7
|
export declare const ReactRender: (node: React.ReactElement, container: ContainerType) => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"react-render.d.ts","sourceRoot":"","sources":["react-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAQ7C,QAAA,MAAM,IAAI,sBAAsB,CAAC;AAEjC,
|
1
|
+
{"version":3,"file":"react-render.d.ts","sourceRoot":"","sources":["react-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAQ7C,QAAA,MAAM,IAAI,sBAAsB,CAAC;AAEjC,KAAK,aAAa,GAAG,CAAC,OAAO,GAAG,gBAAgB,CAAC,GAAG;IAClD,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;CACf,CAAC;AA6BF,eAAO,MAAM,WAAW,SAAU,MAAM,YAAY,aAAa,aAAa,SAQ7E,CAAC;AAcF,eAAO,MAAM,YAAY,cAAe,aAAa,8BAMpD,CAAC"}
|
@@ -1,26 +1,13 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
var
|
10
|
-
|
11
|
-
Object.defineProperty(exports, "__esModule", {
|
12
|
-
value: true
|
13
|
-
});
|
14
|
-
exports.ReactUnmount = exports.ReactRender = void 0;
|
15
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
16
|
-
require("core-js/modules/es.promise.js");
|
17
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
18
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
19
|
-
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
1
|
+
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); }
|
2
|
+
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; }
|
3
|
+
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); } }
|
4
|
+
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); }); }; }
|
5
|
+
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; }
|
6
|
+
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; }
|
7
|
+
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; }
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
9
|
+
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); }
|
10
|
+
import * as ReactDOM from 'react-dom';
|
24
11
|
var fullClone = _objectSpread({}, ReactDOM);
|
25
12
|
var MARK = '__sheinout_root__';
|
26
13
|
var version = fullClone.version,
|
@@ -43,7 +30,7 @@ var modernRender = function modernRender(node, container) {
|
|
43
30
|
var legacyRender = function legacyRender(node, container) {
|
44
31
|
reactRender(node, container);
|
45
32
|
};
|
46
|
-
var ReactRender = function ReactRender(node, container) {
|
33
|
+
export var ReactRender = function ReactRender(node, container) {
|
47
34
|
// @ts-ignore
|
48
35
|
if (createRoot) {
|
49
36
|
modernRender(node, container);
|
@@ -51,15 +38,14 @@ var ReactRender = function ReactRender(node, container) {
|
|
51
38
|
}
|
52
39
|
legacyRender(node, container);
|
53
40
|
};
|
54
|
-
exports.ReactRender = ReactRender;
|
55
41
|
var modernUnmount = /*#__PURE__*/function () {
|
56
|
-
var _ref = (
|
57
|
-
return
|
42
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(container) {
|
43
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
58
44
|
while (1) switch (_context.prev = _context.next) {
|
59
45
|
case 0:
|
60
46
|
return _context.abrupt("return", Promise.resolve().then(function () {
|
61
47
|
var _container$MARK;
|
62
|
-
(_container$MARK = container[MARK]) === null || _container$MARK === void 0
|
48
|
+
(_container$MARK = container[MARK]) === null || _container$MARK === void 0 || _container$MARK.unmount();
|
63
49
|
delete container[MARK];
|
64
50
|
}));
|
65
51
|
case 1:
|
@@ -75,10 +61,9 @@ var modernUnmount = /*#__PURE__*/function () {
|
|
75
61
|
var legacyUnmount = function legacyUnmount(container) {
|
76
62
|
unmountComponentAtNode(container);
|
77
63
|
};
|
78
|
-
var ReactUnmount = function ReactUnmount(container) {
|
64
|
+
export var ReactUnmount = function ReactUnmount(container) {
|
79
65
|
if (createRoot !== undefined) {
|
80
66
|
return modernUnmount(container);
|
81
67
|
}
|
82
68
|
legacyUnmount(container);
|
83
|
-
};
|
84
|
-
exports.ReactUnmount = ReactUnmount;
|
69
|
+
};
|
package/esm/utils/render.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { KeygenType } from '../common/type';
|
3
|
-
export
|
3
|
+
export type renderFunc<T extends any[]> = (...args: T) => React.ReactNode;
|
4
4
|
export declare const render: <T extends any[]>(r: string | renderFunc<T> | undefined, ...args: T) => any;
|
5
5
|
export declare function getKey<T>(gen: KeygenType<T> | undefined, d: T, index?: number): string | number;
|
6
6
|
//# sourceMappingURL=render.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;AAE1E,eAAO,MAAM,MAAM,6EAIlB,CAAC;AAQF,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,mBAM7E"}
|
package/esm/utils/render.js
CHANGED
@@ -1,13 +1,5 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.getKey = getKey;
|
8
|
-
exports.render = void 0;
|
9
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
10
|
-
var render = function render(r) {
|
1
|
+
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); }
|
2
|
+
export var render = function render(r) {
|
11
3
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
12
4
|
args[_key - 1] = arguments[_key];
|
13
5
|
}
|
@@ -15,17 +7,16 @@ var render = function render(r) {
|
|
15
7
|
if (typeof r === 'string' && args[0]) return args[0][r];
|
16
8
|
return args[0];
|
17
9
|
};
|
18
|
-
exports.render = render;
|
19
10
|
function $getKey(gen, d, index) {
|
20
11
|
if (gen === true) return d;
|
21
12
|
if (typeof gen === 'string') return d[gen];
|
22
13
|
if (typeof gen === 'function') return gen(d, index);
|
23
14
|
return index;
|
24
15
|
}
|
25
|
-
function getKey(gen, d, index) {
|
16
|
+
export function getKey(gen, d, index) {
|
26
17
|
var key = $getKey(gen, d, index);
|
27
18
|
if (typeof key !== 'string' && typeof key !== 'number') {
|
28
|
-
console.error(new Error("keygen result expect a string or a number, get '".concat((
|
19
|
+
console.error(new Error("keygen result expect a string or a number, get '".concat(_typeof(key), "'")));
|
29
20
|
}
|
30
21
|
return key;
|
31
22
|
}
|
package/esm/utils/rule/index.js
CHANGED
@@ -1,19 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
Object.defineProperty(exports, "Rule", {
|
8
|
-
enumerable: true,
|
9
|
-
get: function get() {
|
10
|
-
return _rule.default;
|
11
|
-
}
|
12
|
-
});
|
13
|
-
Object.defineProperty(exports, "default", {
|
14
|
-
enumerable: true,
|
15
|
-
get: function get() {
|
16
|
-
return _rule.default;
|
17
|
-
}
|
18
|
-
});
|
19
|
-
var _rule = _interopRequireDefault(require("./rule"));
|
1
|
+
export { default, default as Rule } from "./rule";
|
@@ -6,6 +6,6 @@ export declare const lengthMessage: {
|
|
6
6
|
};
|
7
7
|
declare const _default: (key: 'min' | 'max', { message }?: {
|
8
8
|
message?: MessageType | undefined;
|
9
|
-
}) => (len: number, msg?: MessageType) => ObjectType
|
9
|
+
}) => (len: number, msg?: MessageType) => ObjectType | null;
|
10
10
|
export default _default;
|
11
11
|
//# sourceMappingURL=length.d.ts.map
|
package/esm/utils/rule/length.js
CHANGED
@@ -1,14 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var
|
4
|
-
|
5
|
-
|
6
|
-
});
|
7
|
-
exports.lengthMessage = exports.default = void 0;
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
10
|
-
require("core-js/modules/es.array.concat.js");
|
11
|
-
var _object = require("../object");
|
1
|
+
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; }
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
3
|
+
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); }
|
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); }
|
5
|
+
import { deepMerge } from "../object";
|
12
6
|
var createMessage = function createMessage(key) {
|
13
7
|
return function (props) {
|
14
8
|
var lt = '';
|
@@ -29,26 +23,24 @@ var createMessage = function createMessage(key) {
|
|
29
23
|
var options = {
|
30
24
|
skipUndefined: true
|
31
25
|
};
|
32
|
-
var lengthMessage = {
|
26
|
+
export var lengthMessage = {
|
33
27
|
max: createMessage('max'),
|
34
28
|
min: createMessage('min')
|
35
29
|
};
|
36
|
-
|
37
|
-
var _default = function _default(key) {
|
30
|
+
export default (function (key) {
|
38
31
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
39
32
|
message = _ref.message;
|
40
33
|
return function (len, msg) {
|
41
34
|
if (typeof len !== 'number') {
|
42
|
-
console.error(new Error("Rule \"".concat(key, "\" param expect a number, get ").concat((
|
35
|
+
console.error(new Error("Rule \"".concat(key, "\" param expect a number, get ").concat(_typeof(len))));
|
43
36
|
return null;
|
44
37
|
}
|
45
|
-
return
|
38
|
+
return deepMerge({
|
46
39
|
message: lengthMessage[key]
|
47
|
-
},
|
40
|
+
}, deepMerge(_defineProperty({
|
48
41
|
message: message
|
49
42
|
}, key, len), {
|
50
43
|
message: msg
|
51
44
|
}, options), options);
|
52
45
|
};
|
53
|
-
};
|
54
|
-
exports.default = _default;
|
46
|
+
});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { MessageType } from './rule.type';
|
2
2
|
declare const _default: ({ message }?: {
|
3
3
|
message?: MessageType | undefined;
|
4
|
-
}) => (regExp: string | RegExp, msg?: MessageType) => import("../..").ObjectType
|
4
|
+
}) => (regExp: string | RegExp, msg?: MessageType) => import("../..").ObjectType | null;
|
5
5
|
export default _default;
|
6
6
|
//# sourceMappingURL=regexp.d.ts.map
|
package/esm/utils/rule/regexp.js
CHANGED
@@ -1,34 +1,23 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.default = void 0;
|
8
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
9
|
-
require("core-js/modules/es.regexp.constructor.js");
|
10
|
-
require("core-js/modules/es.regexp.exec.js");
|
11
|
-
require("core-js/modules/es.regexp.to-string.js");
|
12
|
-
var _object = require("../object");
|
1
|
+
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); }
|
2
|
+
import { deepMerge } from "../object";
|
13
3
|
var options = {
|
14
4
|
skipUndefined: true
|
15
5
|
};
|
16
|
-
|
6
|
+
export default (function () {
|
17
7
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
18
8
|
message = _ref.message;
|
19
9
|
return function (regExp, msg) {
|
20
10
|
if (typeof regExp !== 'string' && !(regExp instanceof RegExp)) {
|
21
|
-
console.error(new Error("Rule \"reg\" param expect a RegExp object or a string, get ".concat((
|
11
|
+
console.error(new Error("Rule \"reg\" param expect a RegExp object or a string, get ".concat(_typeof(regExp))));
|
22
12
|
return null;
|
23
13
|
}
|
24
|
-
return
|
14
|
+
return deepMerge({
|
25
15
|
message: '$rules.reg'
|
26
|
-
},
|
16
|
+
}, deepMerge({
|
27
17
|
message: message,
|
28
18
|
regExp: regExp
|
29
19
|
}, {
|
30
20
|
message: msg
|
31
21
|
}, options), options);
|
32
22
|
};
|
33
|
-
};
|
34
|
-
exports.default = _default;
|
23
|
+
});
|
@@ -3,6 +3,6 @@ import { MessageType } from './rule.type';
|
|
3
3
|
export declare const requiredMessage: (props: ObjectType) => string;
|
4
4
|
declare const _default: ({ message }?: {
|
5
5
|
message?: MessageType | undefined;
|
6
|
-
}) => (msg: MessageType) => ObjectType
|
6
|
+
}) => (msg: MessageType) => ObjectType;
|
7
7
|
export default _default;
|
8
8
|
//# sourceMappingURL=required.d.ts.map
|
@@ -1,30 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.requiredMessage = exports.default = void 0;
|
7
|
-
var _object = require("../object");
|
1
|
+
import { deepMerge } from "../object";
|
8
2
|
var options = {
|
9
3
|
skipUndefined: true
|
10
4
|
};
|
11
|
-
var requiredMessage = function requiredMessage(props) {
|
5
|
+
export var requiredMessage = function requiredMessage(props) {
|
12
6
|
var type = props.type === 'array' ? 'array' : 'string';
|
13
7
|
return "$rules.required.".concat(type);
|
14
8
|
};
|
15
|
-
|
16
|
-
var _default = function _default() {
|
9
|
+
export default (function () {
|
17
10
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
18
11
|
message = _ref.message;
|
19
12
|
return function (msg) {
|
20
|
-
return
|
13
|
+
return deepMerge({
|
21
14
|
required: true,
|
22
15
|
message: requiredMessage
|
23
|
-
},
|
16
|
+
}, deepMerge({
|
24
17
|
message: message
|
25
18
|
}, {
|
26
19
|
message: msg
|
27
20
|
}, options), options);
|
28
21
|
};
|
29
|
-
};
|
30
|
-
exports.default = _default;
|
22
|
+
});
|