@sheinx/hooks 3.0.0-alpha.3 → 3.0.0-alpha.30
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/use-click-away/index.d.ts +1 -0
- package/cjs/common/use-click-away/index.d.ts.map +1 -1
- package/cjs/common/use-click-away/index.js +6 -3
- package/cjs/common/use-default-value/index.js +1 -0
- package/cjs/common/use-drag-mock/index.js +1 -0
- package/cjs/common/use-filter/index.js +1 -0
- package/cjs/common/use-filter/use-filter.d.ts +4 -3
- package/cjs/common/use-filter/use-filter.d.ts.map +1 -1
- package/cjs/common/use-filter/use-filter.js +41 -23
- package/cjs/common/use-filter/use-filter.type.d.ts +3 -1
- package/cjs/common/use-filter/use-filter.type.d.ts.map +1 -1
- package/cjs/common/use-fork-ref/index.js +1 -0
- package/cjs/common/use-fork-ref/setRef.d.ts +0 -1
- package/cjs/common/use-fork-ref/setRef.d.ts.map +1 -1
- package/cjs/common/use-fork-ref/setRef.js +0 -1
- package/cjs/common/use-func-change/index.js +1 -0
- package/cjs/common/use-func-change/use-func-change.d.ts.map +1 -1
- package/cjs/common/use-func-change/use-func-change.js +1 -1
- package/cjs/common/use-input-able/index.js +1 -0
- package/cjs/common/use-input-able/use-Input-able.d.ts.map +1 -1
- package/cjs/common/use-input-able/use-Input-able.js +7 -3
- package/cjs/common/use-input-able/use-Input-able.type.d.ts +1 -0
- package/cjs/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
- package/cjs/common/use-key-event/index.js +1 -0
- package/cjs/common/use-latest-obj/index.js +1 -0
- package/cjs/common/use-list-select/index.js +1 -0
- package/cjs/common/use-list-select/use-list-select-multiple.d.ts.map +1 -1
- package/cjs/common/use-list-select/use-list-select-multiple.js +4 -6
- package/cjs/common/use-pagination-list/index.d.ts +2 -1
- package/cjs/common/use-pagination-list/index.d.ts.map +1 -1
- package/cjs/common/use-pagination-list/index.js +3 -1
- package/cjs/common/use-persist-fn/index.js +1 -0
- package/cjs/common/use-position-style/get-position-style.d.ts +1 -0
- package/cjs/common/use-position-style/get-position-style.d.ts.map +1 -1
- package/cjs/common/use-position-style/get-position-style.js +6 -2
- 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 +47 -26
- package/cjs/common/use-previous/index.js +1 -0
- package/cjs/common/use-render/index.js +1 -0
- package/cjs/common/use-resize/index.js +1 -0
- package/cjs/common/use-safe-state/index.js +1 -0
- package/cjs/common/use-style/index.js +1 -0
- package/cjs/common/use-toggle/index.js +1 -0
- package/cjs/common/use-transform/index.js +1 -0
- package/cjs/common/use-transform/use-transform.d.ts.map +1 -1
- package/cjs/common/use-transform/use-transform.js +6 -9
- package/cjs/common/use-unmounted-ref/index.js +1 -0
- package/cjs/components/use-button/index.js +1 -0
- package/cjs/components/use-button/use-button.d.ts +2 -3
- package/cjs/components/use-button/use-button.d.ts.map +1 -1
- package/cjs/components/use-button/use-button.js +3 -19
- package/cjs/components/use-button/use-button.type.d.ts +51 -1
- package/cjs/components/use-button/use-button.type.d.ts.map +1 -1
- package/cjs/components/use-carousel/index.js +1 -0
- package/cjs/components/use-cascader/index.js +1 -0
- package/cjs/components/use-cascader/use-cascader.d.ts +6 -2
- package/cjs/components/use-cascader/use-cascader.d.ts.map +1 -1
- package/cjs/components/use-cascader/use-cascader.js +6 -3
- package/cjs/components/use-cascader/use-cascader.type.d.ts +3 -0
- package/cjs/components/use-cascader/use-cascader.type.d.ts.map +1 -1
- package/cjs/components/use-check/index.js +1 -0
- package/cjs/components/use-check/use-check.type.d.ts +25 -0
- package/cjs/components/use-check/use-check.type.d.ts.map +1 -1
- package/cjs/components/use-collapse/index.js +1 -0
- package/cjs/components/use-collapse/use-collapse-item.type.d.ts +17 -0
- package/cjs/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
- package/cjs/components/use-collapse/use-collapse.type.d.ts +13 -0
- package/cjs/components/use-collapse/use-collapse.type.d.ts.map +1 -1
- package/cjs/components/use-datepicker/index.js +1 -0
- package/cjs/components/use-datepicker/use-date.d.ts +1 -1
- package/cjs/components/use-datepicker/use-datepicker-format.d.ts +1 -1
- package/cjs/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-datepicker-format.js +5 -1
- package/cjs/components/use-datepicker/use-datepicker-range.d.ts.map +1 -1
- package/cjs/components/use-datepicker/use-datepicker-range.js +2 -1
- package/cjs/components/use-datepicker/use-month.d.ts +1 -1
- package/cjs/components/use-datepicker/use-quarter.d.ts +1 -1
- package/cjs/components/use-datepicker/use-time.js +1 -1
- package/cjs/components/use-datepicker/use-year.d.ts +1 -1
- package/cjs/components/use-descriptions/index.js +1 -0
- package/cjs/components/use-descriptions/use-descriptions.type.d.ts +41 -0
- package/cjs/components/use-descriptions/use-descriptions.type.d.ts.map +1 -1
- package/cjs/components/use-form/Provider.d.ts.map +1 -1
- package/cjs/components/use-form/Provider.js +11 -3
- package/cjs/components/use-form/form-bind-context.d.ts.map +1 -1
- package/cjs/components/use-form/form-bind-context.js +1 -0
- package/cjs/components/use-form/form-config-context.d.ts.map +1 -1
- package/cjs/components/use-form/form-config-context.js +1 -0
- package/cjs/components/use-form/form-func-context.d.ts.map +1 -1
- package/cjs/components/use-form/form-func-context.js +1 -0
- package/cjs/components/use-form/index.js +1 -0
- package/cjs/components/use-form/use-form-control/index.js +1 -0
- package/cjs/components/use-form/use-form-control/use-form-control.d.ts +1 -0
- package/cjs/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
- package/cjs/components/use-form/use-form-control/use-form-control.js +9 -5
- package/cjs/components/use-form/use-form-fieldset/fieldset-context.d.ts +1 -1
- package/cjs/components/use-form/use-form-fieldset/fieldset-context.d.ts.map +1 -1
- package/cjs/components/use-form/use-form-fieldset/fieldset-context.js +15 -7
- package/cjs/components/use-form/use-form-fieldset/index.js +1 -0
- package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.d.ts +1 -1
- package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.d.ts.map +1 -1
- package/cjs/components/use-form/use-form-fieldset/use-form-fieldset.js +7 -15
- package/cjs/components/use-form/use-form-flow/index.js +1 -0
- package/cjs/components/use-form/use-form-item/form-item-context.d.ts.map +1 -1
- package/cjs/components/use-form/use-form-item/form-item-context.js +1 -0
- package/cjs/components/use-form/use-form-item/index.js +1 -0
- package/cjs/components/use-form/use-form-item/use-form-item.js +1 -1
- package/cjs/components/use-form/use-form.d.ts.map +1 -1
- package/cjs/components/use-form/use-form.js +16 -4
- package/cjs/components/use-form/use-form.type.d.ts +4 -1
- package/cjs/components/use-form/use-form.type.d.ts.map +1 -1
- package/cjs/components/use-image/index.js +1 -0
- package/cjs/components/use-image/use-image.type.d.ts +76 -0
- package/cjs/components/use-image/use-image.type.d.ts.map +1 -1
- package/cjs/components/use-input/index.js +1 -0
- package/cjs/components/use-input/use-input-format.d.ts +1 -1
- package/cjs/components/use-input/use-input-format.type.d.ts +25 -5
- 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.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-number.js +1 -0
- package/cjs/components/use-input/use-input-number.type.d.ts +17 -0
- package/cjs/components/use-input/use-input-number.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-password.type.d.ts +21 -0
- package/cjs/components/use-input/use-input-password.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input.d.ts.map +1 -1
- package/cjs/components/use-input/use-input.js +9 -3
- package/cjs/components/use-input/use-input.type.d.ts +44 -0
- package/cjs/components/use-input/use-input.type.d.ts.map +1 -1
- package/cjs/components/use-menu/index.js +1 -0
- package/cjs/components/use-pagination/index.js +1 -0
- package/cjs/components/use-popup/index.js +1 -0
- package/cjs/components/use-popup/popup-context.d.ts.map +1 -1
- package/cjs/components/use-popup/popup-context.js +1 -0
- package/cjs/components/use-popup/use-popup.d.ts.map +1 -1
- package/cjs/components/use-popup/use-popup.js +6 -2
- package/cjs/components/use-select/index.js +1 -0
- package/cjs/components/use-select/use-select.d.ts.map +1 -1
- package/cjs/components/use-select/use-select.js +6 -3
- package/cjs/components/use-select/use-select.type.d.ts +37 -0
- package/cjs/components/use-select/use-select.type.d.ts.map +1 -1
- package/cjs/components/use-slider/index.js +1 -0
- package/cjs/components/use-table/index.js +1 -0
- package/cjs/components/use-table/use-table-columns.js +9 -12
- package/cjs/components/use-table/use-table-layout.d.ts +1 -0
- package/cjs/components/use-table/use-table-layout.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-layout.js +26 -13
- 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 +38 -40
- package/cjs/components/use-table/use-table-virtual.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-virtual.js +12 -2
- package/cjs/components/use-tabs/context.d.ts.map +1 -1
- package/cjs/components/use-tabs/context.js +1 -0
- package/cjs/components/use-tabs/context.type.d.ts +25 -0
- package/cjs/components/use-tabs/context.type.d.ts.map +1 -1
- package/cjs/components/use-tabs/index.js +1 -0
- package/cjs/components/use-tabs/use-tabs.type.d.ts +9 -0
- package/cjs/components/use-tabs/use-tabs.type.d.ts.map +1 -1
- package/cjs/components/use-textarea/index.js +1 -0
- package/cjs/components/use-textarea/use-textarea-format.type.d.ts +0 -4
- package/cjs/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
- package/cjs/components/use-textarea/use-textarea.type.d.ts +29 -0
- package/cjs/components/use-textarea/use-textarea.type.d.ts.map +1 -1
- package/cjs/components/use-transfer/index.js +1 -0
- package/cjs/components/use-transfer/use-transfer.type.d.ts +53 -0
- package/cjs/components/use-transfer/use-transfer.type.d.ts.map +1 -1
- package/cjs/components/use-tree/index.d.ts +1 -2
- package/cjs/components/use-tree/index.d.ts.map +1 -1
- package/cjs/components/use-tree/index.js +2 -8
- package/cjs/components/use-tree/use-tree.d.ts +14 -19
- package/cjs/components/use-tree/use-tree.d.ts.map +1 -1
- package/cjs/components/use-tree/use-tree.js +29 -25
- package/cjs/components/use-tree/use-tree.type.d.ts +75 -13
- package/cjs/components/use-tree/use-tree.type.d.ts.map +1 -1
- package/cjs/components/use-treeselect/index.js +1 -0
- package/cjs/components/use-treeselect/use-tiled.d.ts +2 -2
- package/cjs/components/use-treeselect/use-tiled.d.ts.map +1 -1
- package/cjs/components/use-treeselect/use-tiled.js +5 -12
- package/cjs/components/use-treeselect/use-tiled.type.d.ts +4 -3
- package/cjs/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
- package/cjs/components/use-treeselect/use-treeselect.d.ts +1 -1
- package/cjs/components/use-treeselect/use-treeselect.d.ts.map +1 -1
- package/cjs/components/use-treeselect/use-treeselect.js +4 -2
- package/cjs/components/use-treeselect/use-treeselect.type.d.ts +2 -1
- package/cjs/components/use-treeselect/use-treeselect.type.d.ts.map +1 -1
- package/cjs/components/use-upload/index.js +1 -0
- package/cjs/components/use-upload/use-upload.js +8 -8
- package/cjs/components/use-upload/use-upload.type.d.ts +5 -1
- package/cjs/components/use-upload/use-upload.type.d.ts.map +1 -1
- package/cjs/components/use-validate/index.js +1 -0
- package/cjs/index.js +1 -0
- package/cjs/utils/attribute.d.ts +1 -1
- package/cjs/utils/attribute.d.ts.map +1 -1
- package/cjs/utils/attribute.js +3 -1
- package/cjs/utils/document.d.ts.map +1 -1
- package/cjs/utils/document.js +8 -1
- package/cjs/utils/dom/element.d.ts.map +1 -1
- package/cjs/utils/dom/element.js +9 -6
- package/cjs/utils/dom/ready.d.ts.map +1 -1
- package/cjs/utils/dom/ready.js +2 -0
- package/cjs/utils/immer.d.ts +10 -0
- package/cjs/utils/immer.d.ts.map +1 -0
- package/cjs/utils/immer.js +21 -0
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.d.ts.map +1 -1
- package/cjs/utils/index.js +12 -0
- package/cjs/utils/is.d.ts +1 -0
- package/cjs/utils/is.d.ts.map +1 -1
- package/cjs/utils/is.js +10 -3
- package/cjs/utils/tree.d.ts +1 -1
- package/cjs/utils/tree.d.ts.map +1 -1
- package/cjs/utils/tree.js +1 -1
- package/cjs/utils/uid.js +2 -2
- package/esm/common/use-click-away/index.d.ts +1 -0
- package/esm/common/use-click-away/index.d.ts.map +1 -1
- package/esm/common/use-click-away/index.js +6 -3
- package/esm/common/use-default-value/index.js +1 -0
- package/esm/common/use-drag-mock/index.js +1 -0
- package/esm/common/use-filter/index.js +1 -0
- package/esm/common/use-filter/use-filter.d.ts +4 -3
- package/esm/common/use-filter/use-filter.d.ts.map +1 -1
- package/esm/common/use-filter/use-filter.js +41 -23
- package/esm/common/use-filter/use-filter.type.d.ts +3 -1
- package/esm/common/use-filter/use-filter.type.d.ts.map +1 -1
- package/esm/common/use-fork-ref/index.js +1 -0
- package/esm/common/use-fork-ref/setRef.d.ts +0 -1
- package/esm/common/use-fork-ref/setRef.d.ts.map +1 -1
- package/esm/common/use-fork-ref/setRef.js +0 -1
- package/esm/common/use-func-change/index.js +1 -0
- package/esm/common/use-func-change/use-func-change.d.ts.map +1 -1
- package/esm/common/use-func-change/use-func-change.js +1 -1
- package/esm/common/use-input-able/index.js +1 -0
- package/esm/common/use-input-able/use-Input-able.d.ts.map +1 -1
- package/esm/common/use-input-able/use-Input-able.js +7 -3
- package/esm/common/use-input-able/use-Input-able.type.d.ts +1 -0
- package/esm/common/use-input-able/use-Input-able.type.d.ts.map +1 -1
- package/esm/common/use-key-event/index.js +1 -0
- package/esm/common/use-latest-obj/index.js +1 -0
- package/esm/common/use-list-select/index.js +1 -0
- package/esm/common/use-list-select/use-list-select-multiple.d.ts.map +1 -1
- package/esm/common/use-list-select/use-list-select-multiple.js +4 -6
- package/esm/common/use-pagination-list/index.d.ts +2 -1
- package/esm/common/use-pagination-list/index.d.ts.map +1 -1
- package/esm/common/use-pagination-list/index.js +3 -1
- package/esm/common/use-persist-fn/index.js +1 -0
- package/esm/common/use-position-style/get-position-style.d.ts +1 -0
- package/esm/common/use-position-style/get-position-style.d.ts.map +1 -1
- package/esm/common/use-position-style/get-position-style.js +6 -2
- 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 +47 -26
- package/esm/common/use-previous/index.js +1 -0
- package/esm/common/use-render/index.js +1 -0
- package/esm/common/use-resize/index.js +1 -0
- package/esm/common/use-safe-state/index.js +1 -0
- package/esm/common/use-style/index.js +1 -0
- package/esm/common/use-toggle/index.js +1 -0
- package/esm/common/use-transform/index.js +1 -0
- package/esm/common/use-transform/use-transform.d.ts.map +1 -1
- package/esm/common/use-transform/use-transform.js +6 -9
- package/esm/common/use-unmounted-ref/index.js +1 -0
- package/esm/components/use-button/index.js +1 -0
- package/esm/components/use-button/use-button.d.ts +2 -3
- package/esm/components/use-button/use-button.d.ts.map +1 -1
- package/esm/components/use-button/use-button.js +3 -19
- package/esm/components/use-button/use-button.type.d.ts +51 -1
- package/esm/components/use-button/use-button.type.d.ts.map +1 -1
- package/esm/components/use-carousel/index.js +1 -0
- package/esm/components/use-cascader/index.js +1 -0
- package/esm/components/use-cascader/use-cascader.d.ts +6 -2
- package/esm/components/use-cascader/use-cascader.d.ts.map +1 -1
- package/esm/components/use-cascader/use-cascader.js +6 -3
- package/esm/components/use-cascader/use-cascader.type.d.ts +3 -0
- package/esm/components/use-cascader/use-cascader.type.d.ts.map +1 -1
- package/esm/components/use-check/index.js +1 -0
- package/esm/components/use-check/use-check.type.d.ts +25 -0
- package/esm/components/use-check/use-check.type.d.ts.map +1 -1
- package/esm/components/use-collapse/index.js +1 -0
- package/esm/components/use-collapse/use-collapse-item.type.d.ts +17 -0
- package/esm/components/use-collapse/use-collapse-item.type.d.ts.map +1 -1
- package/esm/components/use-collapse/use-collapse.type.d.ts +13 -0
- package/esm/components/use-collapse/use-collapse.type.d.ts.map +1 -1
- package/esm/components/use-datepicker/index.js +1 -0
- package/esm/components/use-datepicker/use-date.d.ts +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.d.ts +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-datepicker-format.js +5 -1
- package/esm/components/use-datepicker/use-datepicker-range.d.ts.map +1 -1
- package/esm/components/use-datepicker/use-datepicker-range.js +2 -1
- package/esm/components/use-datepicker/use-month.d.ts +1 -1
- package/esm/components/use-datepicker/use-quarter.d.ts +1 -1
- package/esm/components/use-datepicker/use-time.js +1 -1
- package/esm/components/use-datepicker/use-year.d.ts +1 -1
- package/esm/components/use-descriptions/index.js +1 -0
- package/esm/components/use-descriptions/use-descriptions.type.d.ts +41 -0
- package/esm/components/use-descriptions/use-descriptions.type.d.ts.map +1 -1
- package/esm/components/use-form/Provider.d.ts.map +1 -1
- package/esm/components/use-form/Provider.js +11 -3
- package/esm/components/use-form/form-bind-context.d.ts.map +1 -1
- package/esm/components/use-form/form-bind-context.js +1 -0
- package/esm/components/use-form/form-config-context.d.ts.map +1 -1
- package/esm/components/use-form/form-config-context.js +1 -0
- package/esm/components/use-form/form-func-context.d.ts.map +1 -1
- package/esm/components/use-form/form-func-context.js +1 -0
- package/esm/components/use-form/index.js +1 -0
- package/esm/components/use-form/use-form-control/index.js +1 -0
- package/esm/components/use-form/use-form-control/use-form-control.d.ts +1 -0
- package/esm/components/use-form/use-form-control/use-form-control.d.ts.map +1 -1
- package/esm/components/use-form/use-form-control/use-form-control.js +9 -5
- package/esm/components/use-form/use-form-fieldset/fieldset-context.d.ts +1 -1
- package/esm/components/use-form/use-form-fieldset/fieldset-context.d.ts.map +1 -1
- package/esm/components/use-form/use-form-fieldset/fieldset-context.js +15 -7
- package/esm/components/use-form/use-form-fieldset/index.js +1 -0
- package/esm/components/use-form/use-form-fieldset/use-form-fieldset.d.ts +1 -1
- package/esm/components/use-form/use-form-fieldset/use-form-fieldset.d.ts.map +1 -1
- package/esm/components/use-form/use-form-fieldset/use-form-fieldset.js +7 -15
- package/esm/components/use-form/use-form-flow/index.js +1 -0
- package/esm/components/use-form/use-form-item/form-item-context.d.ts.map +1 -1
- package/esm/components/use-form/use-form-item/form-item-context.js +1 -0
- package/esm/components/use-form/use-form-item/index.js +1 -0
- package/esm/components/use-form/use-form-item/use-form-item.js +1 -1
- package/esm/components/use-form/use-form.d.ts.map +1 -1
- package/esm/components/use-form/use-form.js +16 -4
- package/esm/components/use-form/use-form.type.d.ts +4 -1
- package/esm/components/use-form/use-form.type.d.ts.map +1 -1
- package/esm/components/use-image/index.js +1 -0
- package/esm/components/use-image/use-image.type.d.ts +76 -0
- package/esm/components/use-image/use-image.type.d.ts.map +1 -1
- package/esm/components/use-input/index.js +1 -0
- package/esm/components/use-input/use-input-format.d.ts +1 -1
- package/esm/components/use-input/use-input-format.type.d.ts +25 -5
- package/esm/components/use-input/use-input-format.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-number.d.ts +1 -1
- package/esm/components/use-input/use-input-number.d.ts.map +1 -1
- package/esm/components/use-input/use-input-number.js +1 -0
- package/esm/components/use-input/use-input-number.type.d.ts +17 -0
- package/esm/components/use-input/use-input-number.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-password.type.d.ts +21 -0
- package/esm/components/use-input/use-input-password.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input.d.ts.map +1 -1
- package/esm/components/use-input/use-input.js +9 -3
- package/esm/components/use-input/use-input.type.d.ts +44 -0
- package/esm/components/use-input/use-input.type.d.ts.map +1 -1
- package/esm/components/use-menu/index.js +1 -0
- package/esm/components/use-pagination/index.js +1 -0
- package/esm/components/use-popup/index.js +1 -0
- package/esm/components/use-popup/popup-context.d.ts.map +1 -1
- package/esm/components/use-popup/popup-context.js +1 -0
- package/esm/components/use-popup/use-popup.d.ts.map +1 -1
- package/esm/components/use-popup/use-popup.js +6 -2
- package/esm/components/use-select/index.js +1 -0
- package/esm/components/use-select/use-select.d.ts.map +1 -1
- package/esm/components/use-select/use-select.js +6 -3
- package/esm/components/use-select/use-select.type.d.ts +37 -0
- package/esm/components/use-select/use-select.type.d.ts.map +1 -1
- package/esm/components/use-slider/index.js +1 -0
- package/esm/components/use-table/index.js +1 -0
- package/esm/components/use-table/use-table-columns.js +9 -12
- package/esm/components/use-table/use-table-layout.d.ts +1 -0
- package/esm/components/use-table/use-table-layout.d.ts.map +1 -1
- package/esm/components/use-table/use-table-layout.js +26 -13
- 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 +38 -40
- package/esm/components/use-table/use-table-virtual.d.ts.map +1 -1
- package/esm/components/use-table/use-table-virtual.js +12 -2
- package/esm/components/use-tabs/context.d.ts.map +1 -1
- package/esm/components/use-tabs/context.js +1 -0
- package/esm/components/use-tabs/context.type.d.ts +25 -0
- package/esm/components/use-tabs/context.type.d.ts.map +1 -1
- package/esm/components/use-tabs/index.js +1 -0
- package/esm/components/use-tabs/use-tabs.type.d.ts +9 -0
- package/esm/components/use-tabs/use-tabs.type.d.ts.map +1 -1
- package/esm/components/use-textarea/index.js +1 -0
- package/esm/components/use-textarea/use-textarea-format.type.d.ts +0 -4
- package/esm/components/use-textarea/use-textarea-format.type.d.ts.map +1 -1
- package/esm/components/use-textarea/use-textarea.type.d.ts +29 -0
- package/esm/components/use-textarea/use-textarea.type.d.ts.map +1 -1
- package/esm/components/use-transfer/index.js +1 -0
- package/esm/components/use-transfer/use-transfer.type.d.ts +53 -0
- package/esm/components/use-transfer/use-transfer.type.d.ts.map +1 -1
- package/esm/components/use-tree/index.d.ts +1 -2
- package/esm/components/use-tree/index.d.ts.map +1 -1
- package/esm/components/use-tree/index.js +2 -8
- package/esm/components/use-tree/use-tree.d.ts +14 -19
- package/esm/components/use-tree/use-tree.d.ts.map +1 -1
- package/esm/components/use-tree/use-tree.js +29 -25
- package/esm/components/use-tree/use-tree.type.d.ts +75 -13
- package/esm/components/use-tree/use-tree.type.d.ts.map +1 -1
- package/esm/components/use-treeselect/index.js +1 -0
- package/esm/components/use-treeselect/use-tiled.d.ts +2 -2
- package/esm/components/use-treeselect/use-tiled.d.ts.map +1 -1
- package/esm/components/use-treeselect/use-tiled.js +5 -12
- package/esm/components/use-treeselect/use-tiled.type.d.ts +4 -3
- package/esm/components/use-treeselect/use-tiled.type.d.ts.map +1 -1
- package/esm/components/use-treeselect/use-treeselect.d.ts +1 -1
- package/esm/components/use-treeselect/use-treeselect.d.ts.map +1 -1
- package/esm/components/use-treeselect/use-treeselect.js +4 -2
- package/esm/components/use-treeselect/use-treeselect.type.d.ts +2 -1
- package/esm/components/use-treeselect/use-treeselect.type.d.ts.map +1 -1
- package/esm/components/use-upload/index.js +1 -0
- package/esm/components/use-upload/use-upload.js +8 -8
- package/esm/components/use-upload/use-upload.type.d.ts +5 -1
- package/esm/components/use-upload/use-upload.type.d.ts.map +1 -1
- package/esm/components/use-validate/index.js +1 -0
- package/esm/index.js +1 -0
- package/esm/utils/attribute.d.ts +1 -1
- package/esm/utils/attribute.d.ts.map +1 -1
- package/esm/utils/attribute.js +3 -1
- package/esm/utils/document.d.ts.map +1 -1
- package/esm/utils/document.js +8 -1
- package/esm/utils/dom/element.d.ts.map +1 -1
- package/esm/utils/dom/element.js +9 -6
- package/esm/utils/dom/ready.d.ts.map +1 -1
- package/esm/utils/dom/ready.js +2 -0
- package/esm/utils/immer.d.ts +10 -0
- package/esm/utils/immer.d.ts.map +1 -0
- package/esm/utils/immer.js +21 -0
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/index.d.ts.map +1 -1
- package/esm/utils/index.js +12 -0
- package/esm/utils/is.d.ts +1 -0
- package/esm/utils/is.d.ts.map +1 -1
- package/esm/utils/is.js +10 -3
- package/esm/utils/tree.d.ts +1 -1
- package/esm/utils/tree.d.ts.map +1 -1
- package/esm/utils/tree.js +1 -1
- package/esm/utils/uid.js +2 -2
- package/package.json +3 -2
- package/cjs/components/use-tree/use-placement.d.ts +0 -6
- package/cjs/components/use-tree/use-placement.d.ts.map +0 -1
- package/cjs/components/use-tree/use-placement.js +0 -25
- package/cjs/components/use-tree/use-placement.type.d.ts +0 -4
- package/cjs/components/use-tree/use-placement.type.d.ts.map +0 -1
- package/cjs/components/use-tree/use-placement.type.js +0 -5
- package/esm/components/use-tree/use-placement.d.ts +0 -6
- package/esm/components/use-tree/use-placement.d.ts.map +0 -1
- package/esm/components/use-tree/use-placement.js +0 -25
- package/esm/components/use-tree/use-placement.type.d.ts +0 -4
- package/esm/components/use-tree/use-placement.type.d.ts.map +0 -1
- package/esm/components/use-tree/use-placement.type.js +0 -5
@@ -5,7 +5,7 @@ declare const useInputFormat: (props: InputFormatProps) => {
|
|
5
5
|
onBlur: (e: React.FocusEvent) => void;
|
6
6
|
onFocus: (e: React.FocusEvent) => void;
|
7
7
|
value: string | undefined;
|
8
|
-
type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "
|
8
|
+
type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "month" | "week" | "date" | "hidden" | "checkbox" | "datetime-local" | "file" | "password" | "radio" | undefined;
|
9
9
|
};
|
10
10
|
export default useInputFormat;
|
11
11
|
//# sourceMappingURL=use-input-format.d.ts.map
|
@@ -4,28 +4,48 @@ export interface InputFormatProps {
|
|
4
4
|
value: InputValue;
|
5
5
|
onChange: (value: InputValue) => void;
|
6
6
|
/**
|
7
|
-
*
|
7
|
+
* @en Whether to remove leading and trailing spaces
|
8
|
+
* @cn 是否去除前后空格
|
8
9
|
*/
|
9
10
|
trim?: boolean;
|
11
|
+
/**
|
12
|
+
* @en Same as the type of the native input tag
|
13
|
+
* @cn 同原生 input 标签的 type
|
14
|
+
* @override string
|
15
|
+
* @default 'text'
|
16
|
+
*/
|
10
17
|
type?: React.InputHTMLAttributes<HTMLInputElement>['type'];
|
18
|
+
/**
|
19
|
+
* @en Number type supports "positive" and "non-negative", only works when type = number
|
20
|
+
* @cn 设置数字类型 支持 "positive" 和 "non-negative", 仅在 type = number 下生效
|
21
|
+
*/
|
11
22
|
numType?: 'non-negative' | 'positive';
|
23
|
+
/**
|
24
|
+
* @en Show as thousands separator, valid only when type is "number"
|
25
|
+
* @cn 以千位分隔符展示,仅当 type 为 number 时有效
|
26
|
+
* @default false
|
27
|
+
*/
|
12
28
|
coin?: boolean;
|
13
29
|
/**
|
14
|
-
*
|
30
|
+
* @en Integer limit, only works when type = number
|
31
|
+
* @cn 整数位数限制, 仅在 type = number 下生效
|
15
32
|
*/
|
16
33
|
integerLimit?: number;
|
17
34
|
/**
|
18
|
-
*
|
35
|
+
* @en Decimal limit, only works when type = number
|
36
|
+
* @cn 小数位数限制, 仅在 type = number 下生效
|
19
37
|
*/
|
20
38
|
digits?: number;
|
21
39
|
/**
|
22
|
-
*
|
40
|
+
* @en Whether to automatically complete the number of decimal places, only works when type = number
|
41
|
+
* @cn 是否自动补全小数位数, 仅在 type = number 下生效
|
23
42
|
*/
|
24
43
|
autoFix?: boolean;
|
25
44
|
onBlur?: React.FocusEventHandler;
|
26
45
|
onFocus?: React.FocusEventHandler;
|
27
46
|
/**
|
28
|
-
*
|
47
|
+
* @en Cancel blur trigger onChange, used for multi-layer nesting of formatting, only trigger onChange once at the outermost layer
|
48
|
+
* @cn 取消 blur 触发 onChange,用于多层嵌套的格式化,只在最外层触发一次onChange
|
29
49
|
*/
|
30
50
|
cancelBlurChange?: boolean;
|
31
51
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-input-format.type.d.ts","sourceRoot":"","sources":["use-input-format.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,oBAAY,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAC5C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC
|
1
|
+
{"version":3,"file":"use-input-format.type.d.ts","sourceRoot":"","sources":["use-input-format.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,oBAAY,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAC5C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3D;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
@@ -7,7 +7,7 @@ declare const useNumberFormat: (props: InputNumberProps) => {
|
|
7
7
|
onBlur: (e: React.FocusEvent<Element, Element>) => void;
|
8
8
|
onFocus: (e: React.FocusEvent<Element, Element>) => void;
|
9
9
|
value: string | undefined;
|
10
|
-
type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "
|
10
|
+
type: "reset" | "submit" | "search" | "color" | "button" | "time" | "image" | "text" | "email" | "url" | "range" | "tel" | (string & {}) | "month" | "week" | "date" | "hidden" | "checkbox" | "datetime-local" | "file" | "password" | "radio" | undefined;
|
11
11
|
};
|
12
12
|
export default useNumberFormat;
|
13
13
|
//# sourceMappingURL=use-input-number.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-input-number.d.ts","sourceRoot":"","sources":["use-input-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,QAAA,MAAM,eAAe,UAAW,gBAAgB;;;;;;;;
|
1
|
+
{"version":3,"file":"use-input-number.d.ts","sourceRoot":"","sources":["use-input-number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,QAAA,MAAM,eAAe,UAAW,gBAAgB;;;;;;;;CA6H/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
@@ -3,9 +3,26 @@ export declare type NumberValue = string | number | undefined | null;
|
|
3
3
|
export interface InputNumberProps extends Omit<InputFormatProps, 'value' | 'onChange' | 'autoFix' | 'trim' | 'coin' | 'type'> {
|
4
4
|
value: NumberValue;
|
5
5
|
onChange: (value: NumberValue) => void | undefined;
|
6
|
+
/**
|
7
|
+
* @en Minimum value
|
8
|
+
* @cn 最小值
|
9
|
+
*/
|
6
10
|
min?: number;
|
11
|
+
/**
|
12
|
+
* @en Maximum value
|
13
|
+
* @cn 最大值
|
14
|
+
*/
|
7
15
|
max?: number;
|
16
|
+
/**
|
17
|
+
* @en Allow value is null
|
18
|
+
* @cn 清空后值为 null
|
19
|
+
*/
|
8
20
|
allowNull?: boolean;
|
21
|
+
/**
|
22
|
+
* @en Change the digital span. It can be decimal
|
23
|
+
* @cn 改变数字跨度,可为小数
|
24
|
+
* @default 1
|
25
|
+
*/
|
9
26
|
step?: number;
|
10
27
|
disabled?: boolean;
|
11
28
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-input-number.type.d.ts","sourceRoot":"","sources":["use-input-number.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,oBAAY,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3F,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,SAAS,CAAC;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
1
|
+
{"version":3,"file":"use-input-number.type.d.ts","sourceRoot":"","sources":["use-input-number.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,oBAAY,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3F,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,SAAS,CAAC;IACnD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
@@ -2,10 +2,31 @@ export declare type PasswordValue = string | undefined;
|
|
2
2
|
export interface InputPasswordProps {
|
3
3
|
value: PasswordValue;
|
4
4
|
onChange: (value: PasswordValue) => void;
|
5
|
+
/**
|
6
|
+
* @cn 密码符号
|
7
|
+
* @en Password symbol
|
8
|
+
* @default '•'
|
9
|
+
*/
|
5
10
|
point?: string;
|
11
|
+
/**
|
12
|
+
* @cn 是否显示切换密码可见状态的按钮
|
13
|
+
* @en Whether to display the button to toggle the visibility of the password
|
14
|
+
*/
|
6
15
|
visibilityToggle?: boolean;
|
16
|
+
/**
|
17
|
+
* @cn 是否显示密码
|
18
|
+
* @en Whether to display the password
|
19
|
+
*/
|
7
20
|
visibility?: boolean;
|
21
|
+
/**
|
22
|
+
* @cn 初始状态是否显示密码
|
23
|
+
* @en Whether to display the password initially
|
24
|
+
*/
|
8
25
|
defaultVisibility?: boolean;
|
26
|
+
/**
|
27
|
+
* @cn 切换密码可见状态的按钮的图标
|
28
|
+
* @en The icon of the button to toggle the visibility of the password
|
29
|
+
*/
|
9
30
|
onVisibilityChange?: (visibility: boolean) => void;
|
10
31
|
}
|
11
32
|
//# sourceMappingURL=use-input-password.type.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-input-password.type.d.ts","sourceRoot":"","sources":["use-input-password.type.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAC/C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"use-input-password.type.d.ts","sourceRoot":"","sources":["use-input-password.type.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAC/C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;
|
1
|
+
{"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CAyIvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
@@ -18,7 +18,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
18
18
|
var _useForkRef = _interopRequireDefault(require("../../common/use-fork-ref"));
|
19
19
|
var React = _interopRequireWildcard(require("react"));
|
20
20
|
var _utils = require("../../utils");
|
21
|
-
var _excluded = ["inputRef", "rootRef", "value", "onChange", "onFocus", "onBlur", "clearable", "disabled", "autoSelect", "onClear", "onClick", "showClear"];
|
21
|
+
var _excluded = ["inputRef", "rootRef", "value", "onChange", "onFocus", "onBlur", "clearable", "disabled", "autoSelect", "onClear", "onClick", "showClear", "onFocusedChange"];
|
22
22
|
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); }
|
23
23
|
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; }
|
24
24
|
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; }
|
@@ -47,12 +47,17 @@ var useInput = function useInput(params) {
|
|
47
47
|
onClear = params.onClear,
|
48
48
|
onClick = params.onClick,
|
49
49
|
showClear = params.showClear,
|
50
|
+
onFocusedChange = params.onFocusedChange,
|
50
51
|
propsToForward = (0, _objectWithoutProperties2.default)(params, _excluded);
|
51
52
|
var inputRef = React.useRef(null);
|
52
53
|
var _React$useState = React.useState(false),
|
53
54
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
54
55
|
focused = _React$useState2[0],
|
55
|
-
|
56
|
+
changeFocued = _React$useState2[1];
|
57
|
+
var setFocused = function setFocused(focus) {
|
58
|
+
changeFocued(focus);
|
59
|
+
onFocusedChange === null || onFocusedChange === void 0 ? void 0 : onFocusedChange(focus);
|
60
|
+
};
|
56
61
|
var handleClick = function handleClick(otherHandlers) {
|
57
62
|
return function (event) {
|
58
63
|
var _otherHandlers$onClic;
|
@@ -126,6 +131,7 @@ var useInput = function useInput(params) {
|
|
126
131
|
event.preventDefault();
|
127
132
|
if (!focused) {
|
128
133
|
var _inputRef$current;
|
134
|
+
setFocused(true);
|
129
135
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
130
136
|
}
|
131
137
|
if (onClear) {
|
@@ -147,7 +153,7 @@ var useInput = function useInput(params) {
|
|
147
153
|
return {
|
148
154
|
focused: focused,
|
149
155
|
disabled: disabled,
|
150
|
-
showClear: showClearValue,
|
156
|
+
showClear: !disabled && showClearValue,
|
151
157
|
getRootProps: getRootProps,
|
152
158
|
getInputProps: getInputProps,
|
153
159
|
getClearProps: getClearProps
|
@@ -3,22 +3,66 @@ import { AddNoProps } from '../../common/type';
|
|
3
3
|
export interface InputPropsOwn {
|
4
4
|
/**
|
5
5
|
* The default value. Use when the component is not controlled.
|
6
|
+
* @en Value
|
7
|
+
* @cn 输入值
|
6
8
|
*/
|
7
9
|
value?: string;
|
10
|
+
/**
|
11
|
+
* @en Value change callback
|
12
|
+
* @cn 值改变回调
|
13
|
+
*/
|
8
14
|
onChange?: (value: string) => void;
|
15
|
+
/**
|
16
|
+
* @en The callback of blur
|
17
|
+
* @cn 失去焦点后的回调
|
18
|
+
*/
|
9
19
|
onBlur?: React.FocusEventHandler;
|
20
|
+
/**
|
21
|
+
* @en The callback when Textarea focus
|
22
|
+
* @cn 聚焦后的回调
|
23
|
+
*/
|
10
24
|
onFocus?: React.FocusEventHandler;
|
25
|
+
/**
|
26
|
+
* @en Click callback
|
27
|
+
* @cn 点击回调
|
28
|
+
*/
|
11
29
|
onClick?: React.MouseEventHandler;
|
30
|
+
/**
|
31
|
+
* @en Disable component
|
32
|
+
* @cn 禁用组件
|
33
|
+
* @default false
|
34
|
+
*/
|
12
35
|
disabled?: boolean;
|
36
|
+
/**
|
37
|
+
* @en Can click the clear icon to delete the content of the input box
|
38
|
+
* @cn 可点击清空图标删除输入框内容
|
39
|
+
* @default false
|
40
|
+
*/
|
13
41
|
clearable?: boolean;
|
14
42
|
/**
|
15
43
|
* focus后自动全选数据
|
44
|
+
* @en Automatically select all data after mouse click
|
45
|
+
* @cn 是否自动获得焦点
|
46
|
+
* @default false
|
16
47
|
*/
|
17
48
|
autoSelect?: boolean;
|
49
|
+
/**
|
50
|
+
* @en Get input dom
|
51
|
+
* @cn 获取input dom
|
52
|
+
*/
|
18
53
|
inputRef?: React.Ref<HTMLInputElement>;
|
54
|
+
/**
|
55
|
+
* @en Get root node dom
|
56
|
+
* @cn 获取root节点 dom
|
57
|
+
*/
|
19
58
|
rootRef?: React.Ref<HTMLElement>;
|
59
|
+
/**
|
60
|
+
* @en Click to clear callback
|
61
|
+
* @cn 点击清空回调
|
62
|
+
*/
|
20
63
|
onClear?: () => void;
|
21
64
|
showClear?: boolean;
|
65
|
+
onFocusedChange?: (focused?: boolean) => void;
|
22
66
|
}
|
23
67
|
export interface BaseInputProps extends InputPropsOwn, Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof InputPropsOwn | 'size' | 'prefix' | 'onError'> {
|
24
68
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-input.type.d.ts","sourceRoot":"","sources":["use-input.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B
|
1
|
+
{"version":3,"file":"use-input.type.d.ts","sourceRoot":"","sources":["use-input.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACvC;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,eAAe,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,cACf,SAAQ,aAAa,EACnB,IAAI,CACF,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CACpD;CAAG;AAER,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;CACnC;AAED,oBAAY,qBAAqB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CACxE,MAAM,EAEN,MAAM,wBAAwB,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CACnE,GACC,wBAAwB,CAAC;AAE3B,oBAAY,oBAAoB,GAAG;IACjC,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAChC,QAAQ,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjC,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,oBAAY,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CACpE,MAAM,EACN,MAAM,oBAAoB,CAC3B,GACC,oBAAoB,CAAC;AAEvB,oBAAY,qBAAqB,GAAG;IAClC,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC;CACtC,CAAC;AAEF,oBAAY,kBAAkB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,UAAU,CAC3E,qBAAqB,EACrB,MAAM,CACP,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"popup-context.d.ts","sourceRoot":"","sources":["popup-context.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"popup-context.d.ts","sourceRoot":"","sources":["popup-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAO7C,QAAA,MAAM,OAAO;sBAJO,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;wBACxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;EAGnB,CAAC;AAE9C,eAAe,OAAO,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-popup.d.ts","sourceRoot":"","sources":["use-popup.ts"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMhE,QAAA,MAAM,QAAQ,UAAW,cAAc;;;;;;
|
1
|
+
{"version":3,"file":"use-popup.d.ts","sourceRoot":"","sources":["use-popup.ts"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMhE,QAAA,MAAM,QAAQ,UAAW,cAAc;;;;;;0BA4GK;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;0BAM9B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;qBA5B7B;YAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;2BA6ElD,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;6BAGxC,MAAM,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;;CAqBpE,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
@@ -39,13 +39,16 @@ var usePopup = function usePopup(props) {
|
|
39
39
|
removeChild(popupRef);
|
40
40
|
};
|
41
41
|
}, []);
|
42
|
+
(0, _react.useEffect)(function () {
|
43
|
+
setOpenState(!!props.open);
|
44
|
+
}, [props.open]);
|
42
45
|
var _useRef = (0, _react.useRef)({
|
43
46
|
triggerTimer: null,
|
44
47
|
// 记录所有的子popup 点击子 popup 不关闭弹窗
|
45
48
|
chain: [targetRef, popupRef]
|
46
49
|
}),
|
47
50
|
context = _useRef.current;
|
48
|
-
var open =
|
51
|
+
var open = openState;
|
49
52
|
var changeOpen = function changeOpen(openIn, delay) {
|
50
53
|
if (context.triggerTimer) clearTimeout(context.triggerTimer);
|
51
54
|
context.triggerTimer = setTimeout(function () {
|
@@ -164,7 +167,8 @@ var usePopup = function usePopup(props) {
|
|
164
167
|
return handleBlur();
|
165
168
|
},
|
166
169
|
target: context.chain,
|
167
|
-
effect: (trigger === 'click' || trigger === 'hover') && open
|
170
|
+
effect: (trigger === 'click' || trigger === 'hover') && open,
|
171
|
+
event: 'mousedown'
|
168
172
|
});
|
169
173
|
var providerValue = (0, _react.useMemo)(function () {
|
170
174
|
return {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-select.d.ts","sourceRoot":"","sources":["use-select.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"use-select.d.ts","sourceRoot":"","sources":["use-select.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Cd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.default = void 0;
|
7
7
|
var _useInputAble2 = require("../../common/use-input-able");
|
8
8
|
var _useListSelect = require("../../common/use-list-select");
|
9
|
+
var emptyArray = [];
|
9
10
|
var useSelect = function useSelect(props) {
|
10
11
|
var data = props.data,
|
11
12
|
treeData = props.treeData,
|
@@ -18,18 +19,20 @@ var useSelect = function useSelect(props) {
|
|
18
19
|
multiple = props.multiple,
|
19
20
|
prediction = props.prediction,
|
20
21
|
valueProp = props.value,
|
21
|
-
onChangeProp = props.onChange
|
22
|
+
onChangeProp = props.onChange,
|
23
|
+
filterSameChange = props.filterSameChange;
|
22
24
|
var _useInputAble = (0, _useInputAble2.useInputAble)({
|
23
25
|
value: valueProp,
|
24
26
|
control: control,
|
25
27
|
defaultValue: defaultValue,
|
26
28
|
beforeChange: beforeChange,
|
27
|
-
onChange: onChangeProp
|
29
|
+
onChange: onChangeProp,
|
30
|
+
filterSameChange: filterSameChange
|
28
31
|
}),
|
29
32
|
value = _useInputAble.value,
|
30
33
|
onChange = _useInputAble.onChange;
|
31
34
|
var datum = (0, _useListSelect.useListSelect)({
|
32
|
-
data: data || treeData,
|
35
|
+
data: data || treeData || emptyArray,
|
33
36
|
separator: separator,
|
34
37
|
format: format,
|
35
38
|
value: value,
|
@@ -3,16 +3,53 @@ export interface BaseSelectProps<DataItem, Value> {
|
|
3
3
|
value?: Value;
|
4
4
|
data?: DataItem[];
|
5
5
|
treeData?: DataItem[];
|
6
|
+
/**
|
7
|
+
* @en Initial value
|
8
|
+
* @cn 默认值 通过 Value 类型
|
9
|
+
*/
|
6
10
|
defaultValue?: Value;
|
7
11
|
control: boolean;
|
8
12
|
separator?: string;
|
13
|
+
/**
|
14
|
+
* @en If it is true, it will be multiple selection
|
15
|
+
* @cn 是否是多选
|
16
|
+
* @default false
|
17
|
+
*/
|
9
18
|
multiple?: boolean;
|
10
19
|
childrenKey?: keyof DataItem;
|
20
|
+
/**
|
21
|
+
* @en When the value is true, disabled all checkboxes; When the value is function, disable the checkbox that this function returns true
|
22
|
+
* @cn 如果 disabled 为 true,禁用全部选项,如果 disabled 为函数,根据函数反回结果禁用选项
|
23
|
+
* @default false
|
24
|
+
*/
|
11
25
|
disabled?: boolean | ((data: DataItem) => boolean);
|
26
|
+
/**
|
27
|
+
* @en By default, the result of the format function is used to compare whether it matches. In some cases (for example, whe an object that returns the original data is updated, an different option with the same value is generated), the prediction function needs to be used to determine whether match
|
28
|
+
* @cn 默认使用 format 函数执行的结果来比较是否匹配,在某些情况下(例如返回原始数据的对象,更新数据时,生成了一个值相同,非同一个对象的选项),需要借助 prediction 函数来判断是否匹配
|
29
|
+
* @default (val, d) => val===format(d)
|
30
|
+
*/
|
12
31
|
prediction?: (value: Value, Data: DataItem) => boolean;
|
32
|
+
/**
|
33
|
+
* @en Format value. The defaule value is return the original data. When it is a string, the value is fetched from the original data as a key equivalent to (d) => d[format] When it is a function, use its return value
|
34
|
+
* @cn 格式化 value, 默认值,返回原始数据。 为 string 时,会作为 key 从原始数据中获取值,相当于 (d) => d[format]; 为函数时,以函数返回结果作为 value
|
35
|
+
* @default d => d
|
36
|
+
*/
|
13
37
|
format?: ((data: DataItem) => Value extends (infer U)[] ? U : Value) | ObjectKey<DataItem>;
|
38
|
+
/**
|
39
|
+
* @en The callback before the value is changed, when the return value is not empty, it will be used as the new value of the component
|
40
|
+
* @cn 值改变前的回调,当返回值不为空时将作为组件的新值
|
41
|
+
*/
|
14
42
|
beforeChange?: (value: Value) => any;
|
43
|
+
/**
|
44
|
+
* @en Change callback
|
45
|
+
* @cn 值改变回调
|
46
|
+
*/
|
15
47
|
onChange?: (value: Value, data?: DataItem | DataItem[], checked?: boolean) => void;
|
48
|
+
/**
|
49
|
+
* @en Group by
|
50
|
+
* @cn 分组
|
51
|
+
*/
|
16
52
|
groupBy?: (item: DataItem, index?: number, data?: DataItem[]) => string;
|
53
|
+
filterSameChange?: boolean;
|
17
54
|
}
|
18
55
|
//# sourceMappingURL=use-select.type.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-select.type.d.ts","sourceRoot":"","sources":["use-select.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,eAAe,CAAC,QAAQ,EAAE,KAAK;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;
|
1
|
+
{"version":3,"file":"use-select.type.d.ts","sourceRoot":"","sources":["use-select.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,eAAe,CAAC,QAAQ,EAAE,KAAK;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEtB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,QAAQ,CAAC;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC;IAEnD;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;IAEvD;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IAE3F;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnF;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,MAAM,CAAC;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
@@ -9,7 +9,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
require("core-js/modules/es.array.filter.js");
|
10
10
|
require("core-js/modules/web.dom-collections.for-each.js");
|
11
11
|
require("core-js/modules/es.array.map.js");
|
12
|
-
var _immer = require("immer");
|
12
|
+
var _immer = require("../../utils/immer");
|
13
13
|
var _react = require("react");
|
14
14
|
var _usePersistFn = _interopRequireDefault(require("../../common/use-persist-fn"));
|
15
15
|
var getHideExpandCol = function getHideExpandCol() {
|
@@ -45,6 +45,14 @@ var useColumns = function useColumns(props) {
|
|
45
45
|
}).filter(function (c) {
|
46
46
|
return c !== context.expandHideCol;
|
47
47
|
});
|
48
|
+
var haveCheckbox = columns.find(function (v) {
|
49
|
+
return v.type === 'checkbox';
|
50
|
+
});
|
51
|
+
if (props.showCheckbox && !haveCheckbox) {
|
52
|
+
columns.unshift({
|
53
|
+
type: 'checkbox'
|
54
|
+
});
|
55
|
+
}
|
48
56
|
var left = -1;
|
49
57
|
var right = -1;
|
50
58
|
columns.forEach(function (c, i) {
|
@@ -65,17 +73,6 @@ var useColumns = function useColumns(props) {
|
|
65
73
|
if (i === right) draft.firstFixed = true;
|
66
74
|
});
|
67
75
|
});
|
68
|
-
var haveCheckbox = columns.find(function (v) {
|
69
|
-
return v.type === 'checkbox';
|
70
|
-
});
|
71
|
-
if (props.showCheckbox && !haveCheckbox) {
|
72
|
-
context.cachedColumns.unshift({
|
73
|
-
index: -1,
|
74
|
-
key: 'checkbox',
|
75
|
-
type: 'checkbox',
|
76
|
-
fixed: left >= 0 ? 'left' : undefined
|
77
|
-
});
|
78
|
-
}
|
79
76
|
context.oldColumns = columnsA;
|
80
77
|
return context.cachedColumns;
|
81
78
|
});
|
@@ -24,6 +24,7 @@ declare const useTableLayout: (props: UseTableLayoutProps) => {
|
|
24
24
|
shouldLastColAuto: boolean | undefined;
|
25
25
|
scrollWidth: number;
|
26
26
|
maxScrollLeft: number;
|
27
|
+
resizeFlag: number;
|
27
28
|
};
|
28
29
|
export default useTableLayout;
|
29
30
|
//# sourceMappingURL=use-table-layout.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;CACzC;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;CACzC;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA8CX,MAAM,UAAU,MAAM;;;;;;;;CAgM5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
@@ -71,22 +71,26 @@ var useTableLayout = function useTableLayout(props) {
|
|
71
71
|
setFloatRight = _React$useState10[1];
|
72
72
|
var _React$useState11 = _react.default.useState(0),
|
73
73
|
_React$useState12 = (0, _slicedToArray2.default)(_React$useState11, 2),
|
74
|
-
|
75
|
-
|
74
|
+
resizeFlag = _React$useState12[0],
|
75
|
+
setResizeFlag = _React$useState12[1];
|
76
76
|
var _React$useState13 = _react.default.useState(0),
|
77
77
|
_React$useState14 = (0, _slicedToArray2.default)(_React$useState13, 2),
|
78
|
-
|
79
|
-
|
80
|
-
var _React$useState15 = _react.default.useState(
|
78
|
+
scrollBarWidth = _React$useState14[0],
|
79
|
+
setScrollBarWidth = _React$useState14[1];
|
80
|
+
var _React$useState15 = _react.default.useState(0),
|
81
|
+
_React$useState16 = (0, _slicedToArray2.default)(_React$useState15, 2),
|
82
|
+
scrollWidth = _React$useState16[0],
|
83
|
+
setScrollWidth = _React$useState16[1];
|
84
|
+
var _React$useState17 = _react.default.useState(props.columns.map(function (v) {
|
81
85
|
return v.width;
|
82
86
|
})),
|
83
|
-
_React$useState16 = (0, _slicedToArray2.default)(_React$useState15, 2),
|
84
|
-
colgroup = _React$useState16[0],
|
85
|
-
setColgroup = _React$useState16[1];
|
86
|
-
var _React$useState17 = _react.default.useState(true),
|
87
87
|
_React$useState18 = (0, _slicedToArray2.default)(_React$useState17, 2),
|
88
|
-
|
89
|
-
|
88
|
+
colgroup = _React$useState18[0],
|
89
|
+
setColgroup = _React$useState18[1];
|
90
|
+
var _React$useState19 = _react.default.useState(true),
|
91
|
+
_React$useState20 = (0, _slicedToArray2.default)(_React$useState19, 2),
|
92
|
+
adjust = _React$useState20[0],
|
93
|
+
setAdjust = _React$useState20[1];
|
90
94
|
|
91
95
|
// 检查滚动状态
|
92
96
|
var checkScroll = (0, _usePersistFn.default)(function () {
|
@@ -116,7 +120,7 @@ var useTableLayout = function useTableLayout(props) {
|
|
116
120
|
if (!colgroup) return;
|
117
121
|
var table = theadRef.current || tbodyRef.current;
|
118
122
|
if (!table) return;
|
119
|
-
var colEl = table.querySelector("colgroup col:nth-child(".concat(
|
123
|
+
var colEl = table.querySelector("colgroup col:nth-child(".concat(index + 1, ")"));
|
120
124
|
if (!colEl) return;
|
121
125
|
var oWidth = parseInt(colEl.style.width, 10);
|
122
126
|
if (Number.isNaN(oWidth) || oWidth === 0) {
|
@@ -134,9 +138,17 @@ var useTableLayout = function useTableLayout(props) {
|
|
134
138
|
colEl.style.width = "".concat(w, "px");
|
135
139
|
context.dragWidth = w;
|
136
140
|
});
|
141
|
+
var updateResizeFlag = function updateResizeFlag() {
|
142
|
+
setResizeFlag(function (v) {
|
143
|
+
return (v + 1) % 10;
|
144
|
+
});
|
145
|
+
};
|
137
146
|
var changeColGroup = function changeColGroup(cols, adjust) {
|
138
147
|
setColgroup(cols);
|
139
148
|
setAdjust(adjust);
|
149
|
+
if (!adjust) {
|
150
|
+
updateResizeFlag();
|
151
|
+
}
|
140
152
|
};
|
141
153
|
|
142
154
|
// 完成拖拽
|
@@ -293,7 +305,8 @@ var useTableLayout = function useTableLayout(props) {
|
|
293
305
|
width: typeof props.width === 'number' ? props.width + deltaXSum : props.width,
|
294
306
|
shouldLastColAuto: props.columnResizable && !adjust,
|
295
307
|
scrollWidth: scrollWidth,
|
296
|
-
maxScrollLeft: scrollWidth - context.clientWidth
|
308
|
+
maxScrollLeft: scrollWidth - context.clientWidth,
|
309
|
+
resizeFlag: resizeFlag
|
297
310
|
};
|
298
311
|
};
|
299
312
|
var _default = useTableLayout;
|