@sheinx/hooks 3.0.0-rc.2 → 3.0.0-rc.4
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 +20 -29
- 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 +3 -3
- package/cjs/components/use-button/use-button.js +12 -13
- package/cjs/components/use-button/use-button.type.d.ts +3 -3
- 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 +4 -4
- 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.js +16 -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.js +34 -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.js +19 -26
- 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 +35 -54
- 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 +3 -3
- package/esm/components/use-button/use-button.js +17 -24
- package/esm/components/use-button/use-button.type.d.ts +3 -3
- 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 +4 -4
- 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.js +22 -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.js +66 -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.js +36 -49
- 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,20 +1,14 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
require("core-js/modules/es.array.filter.js");
|
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");
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
8
|
-
value: true
|
9
|
-
});
|
10
|
-
exports.default = void 0;
|
11
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
13
|
-
var _utils = require("../../utils");
|
14
|
-
var _element = require("../../utils/dom/element");
|
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); }
|
15
2
|
var _excluded = ["htmlType", "href", "target", "disabled", "loading", "onClick"];
|
16
|
-
function ownKeys(
|
17
|
-
function _objectSpread(
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
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; }
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
7
|
+
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); }
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
10
|
+
import { extractEventHandlers } from "../../utils";
|
11
|
+
import { wrapSpan } from "../../utils/dom/element";
|
18
12
|
var useButton = function useButton() {
|
19
13
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
20
14
|
var htmlType = props.htmlType,
|
@@ -23,23 +17,23 @@ var useButton = function useButton() {
|
|
23
17
|
disabled = props.disabled,
|
24
18
|
loading = props.loading,
|
25
19
|
onClick = props.onClick,
|
26
|
-
propsToForward = (
|
20
|
+
propsToForward = _objectWithoutProperties(props, _excluded);
|
27
21
|
var handleClick = function handleClick(otherHandlers) {
|
28
22
|
return function (event) {
|
29
23
|
var _otherHandlers$onClic;
|
30
24
|
if (disabled || loading) {
|
31
25
|
return;
|
32
26
|
}
|
33
|
-
onClick === null || onClick === void 0
|
34
|
-
otherHandlers === null || otherHandlers === void 0
|
27
|
+
onClick === null || onClick === void 0 || onClick(event);
|
28
|
+
otherHandlers === null || otherHandlers === void 0 || (_otherHandlers$onClic = otherHandlers.onClick) === null || _otherHandlers$onClic === void 0 || _otherHandlers$onClic.call(otherHandlers, event);
|
35
29
|
};
|
36
30
|
};
|
37
31
|
var getSpaceChildren = function getSpaceChildren(children, space, className) {
|
38
|
-
return
|
32
|
+
return wrapSpan(children, space, className);
|
39
33
|
};
|
40
34
|
var getAnchorProps = function getAnchorProps() {
|
41
35
|
var externalProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
42
|
-
var externalEventHandlers = _objectSpread({},
|
36
|
+
var externalEventHandlers = _objectSpread({}, extractEventHandlers(externalProps));
|
43
37
|
var mergedEventHandlers = _objectSpread(_objectSpread(_objectSpread({}, propsToForward), externalProps), {}, {
|
44
38
|
onClick: handleClick(externalEventHandlers)
|
45
39
|
});
|
@@ -50,7 +44,7 @@ var useButton = function useButton() {
|
|
50
44
|
};
|
51
45
|
var getButtonProps = function getButtonProps() {
|
52
46
|
var externalProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
53
|
-
var externalEventHandlers = _objectSpread({},
|
47
|
+
var externalEventHandlers = _objectSpread({}, extractEventHandlers(externalProps));
|
54
48
|
var mergedEventHandlers = _objectSpread(_objectSpread(_objectSpread({}, propsToForward), externalProps), {}, {
|
55
49
|
disabled: disabled || loading,
|
56
50
|
htmlType: htmlType,
|
@@ -65,5 +59,4 @@ var useButton = function useButton() {
|
|
65
59
|
getSpaceChildren: getSpaceChildren
|
66
60
|
};
|
67
61
|
};
|
68
|
-
|
69
|
-
exports.default = _default;
|
62
|
+
export default useButton;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
2
|
+
export type ButtonShape = 'circle' | 'round' | 'square';
|
3
|
+
export type ButtonMode = 'text' | 'outline' | 'dashed';
|
4
|
+
export type ButtonType = 'default' | 'primary' | 'secondary' | 'danger' | 'warning' | 'success' | 'link';
|
5
5
|
export interface BaseButtonProps {
|
6
6
|
/**
|
7
7
|
* @en Specifies the button should be disabled
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-button.type.d.ts","sourceRoot":"","sources":["use-button.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,
|
1
|
+
{"version":3,"file":"use-button.type.d.ts","sourceRoot":"","sources":["use-button.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IACrC;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACzC,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACzC;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;CACnC"}
|
@@ -1,20 +1,2 @@
|
|
1
|
-
"use strict";
|
2
1
|
"use client";
|
3
|
-
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "default", {
|
9
|
-
enumerable: true,
|
10
|
-
get: function get() {
|
11
|
-
return _useCarousel.default;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
Object.defineProperty(exports, "useCarousel", {
|
15
|
-
enumerable: true,
|
16
|
-
get: function get() {
|
17
|
-
return _useCarousel.default;
|
18
|
-
}
|
19
|
-
});
|
20
|
-
var _useCarousel = _interopRequireDefault(require("./use-carousel"));
|
2
|
+
export { default, default as useCarousel } from "./use-carousel";
|
@@ -10,7 +10,7 @@ export interface UseCarouselProps {
|
|
10
10
|
moveTo: (num: number) => void;
|
11
11
|
}) => void;
|
12
12
|
}
|
13
|
-
export
|
13
|
+
export type DirectionType = 'forward' | 'backward' | 'stop';
|
14
14
|
declare const useCarousel: (props: UseCarouselProps) => {
|
15
15
|
current: number;
|
16
16
|
pre: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-carousel.d.ts","sourceRoot":"","sources":["use-carousel.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CACP,OAAO,EAAE,MAAM,EACf,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;QAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,KACtF,IAAI,CAAC;CACX;AAED,
|
1
|
+
{"version":3,"file":"use-carousel.d.ts","sourceRoot":"","sources":["use-carousel.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CACP,OAAO,EAAE,MAAM,EACf,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;QAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,KACtF,IAAI,CAAC;CACX;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5D,QAAA,MAAM,WAAW,UAAW,gBAAgB;;;;;;;;;oBAcV,MAAM;;CAmEvC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
@@ -1,37 +1,35 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
var _usePersistFn = require("../../common/use-persist-fn");
|
11
|
-
var _useLatestObj = _interopRequireDefault(require("../../common/use-latest-obj"));
|
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 _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); }
|
4
|
+
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; }
|
5
|
+
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; } }
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
7
|
+
import { useEffect, useRef, useState } from 'react';
|
8
|
+
import { usePersistFn } from "../../common/use-persist-fn";
|
9
|
+
import useLatestObj from "../../common/use-latest-obj";
|
12
10
|
var useCarousel = function useCarousel(props) {
|
13
11
|
var total = props.total,
|
14
12
|
_props$interval = props.interval,
|
15
13
|
interval = _props$interval === void 0 ? 0 : _props$interval;
|
16
|
-
var _useState =
|
14
|
+
var _useState = useState({
|
17
15
|
current: 0,
|
18
16
|
pre: -1,
|
19
17
|
direction: 'stop'
|
20
18
|
}),
|
21
|
-
_useState2 = (
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
22
20
|
_useState2$ = _useState2[0],
|
23
21
|
current = _useState2$.current,
|
24
22
|
pre = _useState2$.pre,
|
25
23
|
direction = _useState2$.direction,
|
26
24
|
setState = _useState2[1];
|
27
|
-
var _useRef =
|
25
|
+
var _useRef = useRef({
|
28
26
|
timer: null,
|
29
27
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
30
28
|
setNext: function setNext(next) {}
|
31
29
|
}),
|
32
30
|
context = _useRef.current;
|
33
31
|
var autoPlay = interval > 0 && total > 1;
|
34
|
-
var moveTo =
|
32
|
+
var moveTo = usePersistFn(function (i) {
|
35
33
|
var next = i;
|
36
34
|
if (next === current) return;
|
37
35
|
var dir = next > current ? 'forward' : 'backward';
|
@@ -56,13 +54,13 @@ var useCarousel = function useCarousel(props) {
|
|
56
54
|
}
|
57
55
|
context.setNext(next + 1);
|
58
56
|
});
|
59
|
-
var stop =
|
57
|
+
var stop = usePersistFn(function () {
|
60
58
|
if (context.timer) {
|
61
59
|
clearTimeout(context.timer);
|
62
60
|
context.timer = null;
|
63
61
|
}
|
64
62
|
});
|
65
|
-
var setNext =
|
63
|
+
var setNext = usePersistFn(function (next) {
|
66
64
|
if (!autoPlay) return;
|
67
65
|
stop();
|
68
66
|
context.timer = setTimeout(function () {
|
@@ -70,23 +68,23 @@ var useCarousel = function useCarousel(props) {
|
|
70
68
|
}, interval);
|
71
69
|
});
|
72
70
|
context.setNext = setNext;
|
73
|
-
var start =
|
71
|
+
var start = usePersistFn(function () {
|
74
72
|
setNext(current + 1);
|
75
73
|
});
|
76
|
-
var forward =
|
74
|
+
var forward = usePersistFn(function () {
|
77
75
|
moveTo(current + 1);
|
78
76
|
});
|
79
|
-
var backward =
|
77
|
+
var backward = usePersistFn(function () {
|
80
78
|
moveTo(current - 1);
|
81
79
|
});
|
82
|
-
var func = (
|
80
|
+
var func = useLatestObj({
|
83
81
|
start: start,
|
84
82
|
stop: stop,
|
85
83
|
forward: forward,
|
86
84
|
backward: backward,
|
87
85
|
moveTo: moveTo
|
88
86
|
});
|
89
|
-
|
87
|
+
useEffect(function () {
|
90
88
|
if (interval > 0 && total > 1) {
|
91
89
|
start();
|
92
90
|
}
|
@@ -98,5 +96,4 @@ var useCarousel = function useCarousel(props) {
|
|
98
96
|
func: func
|
99
97
|
};
|
100
98
|
};
|
101
|
-
|
102
|
-
exports.default = _default;
|
99
|
+
export default useCarousel;
|
@@ -1,20 +1,2 @@
|
|
1
|
-
"use strict";
|
2
1
|
"use client";
|
3
|
-
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "default", {
|
9
|
-
enumerable: true,
|
10
|
-
get: function get() {
|
11
|
-
return _useCascader.default;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
Object.defineProperty(exports, "useCascader", {
|
15
|
-
enumerable: true,
|
16
|
-
get: function get() {
|
17
|
-
return _useCascader.default;
|
18
|
-
}
|
19
|
-
});
|
20
|
-
var _useCascader = _interopRequireDefault(require("./use-cascader"));
|
2
|
+
export { default, default as useCascader } from "./use-cascader";
|
@@ -1,12 +1,5 @@
|
|
1
|
-
"use
|
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 _useInputAble2 = require("../../common/use-input-able");
|
9
|
-
var _useTree2 = _interopRequireDefault(require("../use-tree"));
|
1
|
+
import { useInputAble } from "../../common/use-input-able";
|
2
|
+
import useTree from "../use-tree";
|
10
3
|
var useCascader = function useCascader(props) {
|
11
4
|
var data = props.data,
|
12
5
|
control = props.control,
|
@@ -19,7 +12,7 @@ var useCascader = function useCascader(props) {
|
|
19
12
|
valueProp = props.value,
|
20
13
|
onChangeProp = props.onChange,
|
21
14
|
filterSameChange = props.filterSameChange;
|
22
|
-
var _useInputAble =
|
15
|
+
var _useInputAble = useInputAble({
|
23
16
|
value: valueProp,
|
24
17
|
control: control,
|
25
18
|
defaultValue: defaultValue,
|
@@ -29,7 +22,7 @@ var useCascader = function useCascader(props) {
|
|
29
22
|
}),
|
30
23
|
value = _useInputAble.value,
|
31
24
|
onChange = _useInputAble.onChange;
|
32
|
-
var _useTree = (
|
25
|
+
var _useTree = useTree({
|
33
26
|
value: value,
|
34
27
|
data: data,
|
35
28
|
unmatch: unmatch,
|
@@ -45,5 +38,4 @@ var useCascader = function useCascader(props) {
|
|
45
38
|
onChange: onChange
|
46
39
|
};
|
47
40
|
};
|
48
|
-
|
49
|
-
exports.default = _default;
|
41
|
+
export default useCascader;
|
@@ -1,20 +1,2 @@
|
|
1
|
-
"use strict";
|
2
1
|
"use client";
|
3
|
-
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "default", {
|
9
|
-
enumerable: true,
|
10
|
-
get: function get() {
|
11
|
-
return _useCheck.default;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
Object.defineProperty(exports, "useCheck", {
|
15
|
-
enumerable: true,
|
16
|
-
get: function get() {
|
17
|
-
return _useCheck.default;
|
18
|
-
}
|
19
|
-
});
|
20
|
-
var _useCheck = _interopRequireDefault(require("./use-check"));
|
2
|
+
export { default, default as useCheck } from "./use-check";
|
@@ -7,10 +7,10 @@ import React from 'react';
|
|
7
7
|
import { ObjectType } from '../../common/type';
|
8
8
|
import { BaseCheckProps } from './use-check.type';
|
9
9
|
declare const useCheck: (props: BaseCheckProps) => {
|
10
|
-
getIndicatorProps: <TOther extends ObjectType
|
10
|
+
getIndicatorProps: <TOther extends ObjectType>(externalProps?: TOther) => TOther & {
|
11
11
|
tabIndex: number;
|
12
12
|
};
|
13
|
-
getInputProps: <TOther_1 extends ObjectType
|
13
|
+
getInputProps: <TOther_1 extends ObjectType>(externalProps?: TOther_1) => TOther_1 & {
|
14
14
|
onClick: (e: React.MouseEvent<HTMLInputElement>) => void;
|
15
15
|
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
16
16
|
tabIndex: number;
|
@@ -22,7 +22,7 @@ declare const useCheck: (props: BaseCheckProps) => {
|
|
22
22
|
ref: ((instance: HTMLInputElement | null) => void) | null;
|
23
23
|
disabled: boolean | undefined;
|
24
24
|
};
|
25
|
-
getRootProps: <TOther_2 extends ObjectType
|
25
|
+
getRootProps: <TOther_2 extends ObjectType>(externalProps?: TOther_2) => TOther_2 & {
|
26
26
|
onClick: (event: React.MouseEvent) => void;
|
27
27
|
};
|
28
28
|
disabled: boolean | undefined;
|
@@ -1,20 +1,23 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
var
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
var
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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 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; }
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
6
|
+
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); }
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
8
|
+
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."); }
|
9
|
+
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); }
|
10
|
+
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; }
|
11
|
+
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; } }
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
13
|
+
/**
|
14
|
+
* 状态 disabled
|
15
|
+
* dom wrapper input indicator desc
|
16
|
+
* 事件 onClick(模拟点击) 点击wrapper
|
17
|
+
*/
|
18
|
+
import React from 'react';
|
19
|
+
import { extractEventHandlers } from "../../utils";
|
20
|
+
import useForkRef from "../../common/use-fork-ref";
|
18
21
|
var useCheck = function useCheck(props) {
|
19
22
|
var checked = props.checked,
|
20
23
|
defaultChecked = props.defaultChecked,
|
@@ -22,8 +25,8 @@ var useCheck = function useCheck(props) {
|
|
22
25
|
disabled = props.disabled,
|
23
26
|
inputRefPo = props.inputRef,
|
24
27
|
_onClick = props.onClick;
|
25
|
-
var _React$useState =
|
26
|
-
_React$useState2 = (
|
28
|
+
var _React$useState = React.useState(defaultChecked || false),
|
29
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
27
30
|
checkedState = _React$useState2[0],
|
28
31
|
setCheckedState = _React$useState2[1];
|
29
32
|
var getChecked = function getChecked() {
|
@@ -32,31 +35,30 @@ var useCheck = function useCheck(props) {
|
|
32
35
|
}
|
33
36
|
return checkedState;
|
34
37
|
};
|
35
|
-
var inputRef =
|
36
|
-
var handleInputRef = (
|
38
|
+
var inputRef = React.useRef(null);
|
39
|
+
var handleInputRef = useForkRef(inputRef, inputRefPo);
|
37
40
|
var handleClick = function handleClick(otherHandlers) {
|
38
41
|
return function (event) {
|
39
42
|
var _inputRef$current, _otherHandlers$onClic;
|
40
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0
|
41
|
-
otherHandlers === null || otherHandlers === void 0
|
43
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.click();
|
44
|
+
otherHandlers === null || otherHandlers === void 0 || (_otherHandlers$onClic = otherHandlers.onClick) === null || _otherHandlers$onClic === void 0 || _otherHandlers$onClic.call(otherHandlers, event);
|
42
45
|
};
|
43
46
|
};
|
44
47
|
var getRootProps = function getRootProps() {
|
45
48
|
var externalProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
46
|
-
var externalEventHandlers =
|
49
|
+
var externalEventHandlers = extractEventHandlers(externalProps);
|
47
50
|
return _objectSpread(_objectSpread({}, externalProps), {}, {
|
48
51
|
onClick: handleClick(externalEventHandlers)
|
49
52
|
});
|
50
53
|
//封装点击事件 点击触发input 的点击
|
51
54
|
// disabled 禁用后不可点击
|
52
55
|
};
|
53
|
-
|
54
56
|
var handleChange = function handleChange(otherHandlers) {
|
55
57
|
return function (event) {
|
56
58
|
var _otherHandlers$onChan;
|
57
59
|
setCheckedState(event.target.checked);
|
58
|
-
onChange === null || onChange === void 0
|
59
|
-
otherHandlers === null || otherHandlers === void 0
|
60
|
+
onChange === null || onChange === void 0 || onChange(event.target.checked, event);
|
61
|
+
otherHandlers === null || otherHandlers === void 0 || (_otherHandlers$onChan = otherHandlers.onChange) === null || _otherHandlers$onChan === void 0 || _otherHandlers$onChan.call(otherHandlers, event);
|
60
62
|
};
|
61
63
|
};
|
62
64
|
var getInputProps = function getInputProps() {
|
@@ -76,9 +78,9 @@ var useCheck = function useCheck(props) {
|
|
76
78
|
}, checkProps), {}, {
|
77
79
|
onClick: function onClick(e) {
|
78
80
|
e.stopPropagation();
|
79
|
-
_onClick === null || _onClick === void 0
|
81
|
+
_onClick === null || _onClick === void 0 || _onClick(e);
|
80
82
|
},
|
81
|
-
onChange: handleChange(
|
83
|
+
onChange: handleChange(extractEventHandlers(externalProps)),
|
82
84
|
tabIndex: 0,
|
83
85
|
style: {
|
84
86
|
display: 'none'
|
@@ -99,5 +101,4 @@ var useCheck = function useCheck(props) {
|
|
99
101
|
checked: getChecked()
|
100
102
|
};
|
101
103
|
};
|
102
|
-
|
103
|
-
exports.default = _default;
|
104
|
+
export default useCheck;
|
@@ -1,27 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
"use client";
|
3
|
-
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "default", {
|
9
|
-
enumerable: true,
|
10
|
-
get: function get() {
|
11
|
-
return _useCollapse.default;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
Object.defineProperty(exports, "useCollapse", {
|
15
|
-
enumerable: true,
|
16
|
-
get: function get() {
|
17
|
-
return _useCollapse.default;
|
18
|
-
}
|
19
|
-
});
|
20
|
-
Object.defineProperty(exports, "useCollapseItem", {
|
21
|
-
enumerable: true,
|
22
|
-
get: function get() {
|
23
|
-
return _useCollapseItem.default;
|
24
|
-
}
|
25
|
-
});
|
26
|
-
var _useCollapse = _interopRequireDefault(require("./use-collapse"));
|
27
|
-
var _useCollapseItem = _interopRequireDefault(require("./use-collapse-item"));
|
2
|
+
export { default, default as useCollapse } from "./use-collapse";
|
3
|
+
export { default as useCollapseItem } from "./use-collapse-item";
|
@@ -3,18 +3,18 @@ import type { ObjectType } from '../../common/type';
|
|
3
3
|
import type { BaseCollapseType } from './use-collapse-item.type';
|
4
4
|
declare const useCollapseItem: (props: BaseCollapseType) => {
|
5
5
|
judgeExpanded: boolean;
|
6
|
-
getItemContentProps: <TOther extends ObjectType
|
6
|
+
getItemContentProps: <TOther extends ObjectType>(externalProps?: TOther) => TOther & {
|
7
7
|
'data-soui-disabled': boolean;
|
8
8
|
tabIndex: number;
|
9
9
|
onClick: (e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
10
10
|
};
|
11
|
-
getHeaderIconProps: <TOther_1 extends ObjectType
|
11
|
+
getHeaderIconProps: <TOther_1 extends ObjectType>(externalProps?: TOther_1) => TOther_1 & {
|
12
12
|
onClick: (e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
13
13
|
};
|
14
|
-
getTitleProps: <TOther_2 extends ObjectType
|
14
|
+
getTitleProps: <TOther_2 extends ObjectType>(externalProps?: TOther_2) => TOther_2 & {
|
15
15
|
onClick: (e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
16
16
|
};
|
17
|
-
getExtraProps: <TOther_3 extends ObjectType
|
17
|
+
getExtraProps: <TOther_3 extends ObjectType>(externalProps?: TOther_3) => TOther_3 & {
|
18
18
|
onClick: (e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
19
19
|
};
|
20
20
|
};
|
@@ -1,18 +1,10 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
var
|
7
|
-
|
8
|
-
value: true
|
9
|
-
});
|
10
|
-
exports.default = void 0;
|
11
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
12
|
-
require("core-js/modules/es.array.includes.js");
|
13
|
-
var _usePersistFn = require("../../common/use-persist-fn");
|
14
|
-
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; }
|
15
|
-
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 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; }
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
6
|
+
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); }
|
7
|
+
import { usePersistFn } from "../../common/use-persist-fn";
|
16
8
|
var useCollapseItem = function useCollapseItem(props) {
|
17
9
|
var active = props.active,
|
18
10
|
keygen = props.keygen,
|
@@ -21,7 +13,7 @@ var useCollapseItem = function useCollapseItem(props) {
|
|
21
13
|
onChange = props.onChange;
|
22
14
|
var judgeExpanded = active.indexOf(keygen) > -1;
|
23
15
|
var currentDisabled = triggerRegion === 'disabled' || disabled;
|
24
|
-
var handleClickByRegion =
|
16
|
+
var handleClickByRegion = usePersistFn(function (e, regionKey) {
|
25
17
|
if (currentDisabled) return;
|
26
18
|
var triggerKey = triggerRegion === 'icon' ? 0 : triggerRegion === 'header' ? 1 : 2;
|
27
19
|
if (regionKey === triggerKey || triggerRegion === 'header' && [0, 1].includes(regionKey)) onChange(keygen, e);
|
@@ -68,5 +60,4 @@ var useCollapseItem = function useCollapseItem(props) {
|
|
68
60
|
getExtraProps: getExtraProps
|
69
61
|
};
|
70
62
|
};
|
71
|
-
|
72
|
-
exports.default = _default;
|
63
|
+
export default useCollapseItem;
|
@@ -25,5 +25,5 @@ export interface BaseCollapseItemProps {
|
|
25
25
|
*/
|
26
26
|
disabled?: boolean;
|
27
27
|
}
|
28
|
-
export
|
28
|
+
export type BaseCollapseType = BaseCollapseItemContext & BaseCollapseItemProps;
|
29
29
|
//# sourceMappingURL=use-collapse-item.type.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-collapse-item.type.d.ts","sourceRoot":"","sources":["use-collapse-item.type.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC/C,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;CAC5F;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,
|
1
|
+
{"version":3,"file":"use-collapse-item.type.d.ts","sourceRoot":"","sources":["use-collapse-item.type.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC/C,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;CAC5F;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GAAG,qBAAqB,CAAC"}
|