@sheinx/hooks 3.0.0-rc.2 → 3.0.0-rc.5
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 +3 -3
- package/cjs/components/use-image/use-image.d.ts.map +1 -1
- package/cjs/components/use-image/use-image.js +17 -23
- package/cjs/components/use-image/use-image.type.d.ts +4 -4
- package/cjs/components/use-image/use-image.type.d.ts.map +1 -1
- package/cjs/components/use-input/index.js +2 -2
- package/cjs/components/use-input/use-input-format.d.ts +1 -1
- package/cjs/components/use-input/use-input-format.js +13 -15
- package/cjs/components/use-input/use-input-format.type.d.ts +1 -1
- package/cjs/components/use-input/use-input-format.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-number.d.ts +1 -1
- package/cjs/components/use-input/use-input-number.js +15 -16
- package/cjs/components/use-input/use-input-number.type.d.ts +1 -1
- package/cjs/components/use-input/use-input-number.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input-password.js +11 -9
- package/cjs/components/use-input/use-input-password.type.d.ts +1 -1
- package/cjs/components/use-input/use-input-password.type.d.ts.map +1 -1
- package/cjs/components/use-input/use-input.d.ts +3 -3
- package/cjs/components/use-input/use-input.js +30 -29
- package/cjs/components/use-input/use-input.type.d.ts +5 -5
- package/cjs/components/use-input/use-input.type.d.ts.map +1 -1
- package/cjs/components/use-menu/index.js +2 -2
- package/cjs/components/use-menu/use-menu-item.d.ts +1 -1
- package/cjs/components/use-menu/use-menu-item.d.ts.map +1 -1
- package/cjs/components/use-menu/use-menu-item.js +11 -12
- package/cjs/components/use-menu/use-menu.js +2 -8
- package/cjs/components/use-menu/use-menu.type.d.ts +1 -1
- package/cjs/components/use-menu/use-menu.type.d.ts.map +1 -1
- package/cjs/components/use-pagination/index.js +2 -2
- package/cjs/components/use-pagination/use-pagination.d.ts +1 -1
- package/cjs/components/use-pagination/use-pagination.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 +3 -3
- package/esm/components/use-image/use-image.d.ts.map +1 -1
- package/esm/components/use-image/use-image.js +28 -41
- package/esm/components/use-image/use-image.type.d.ts +4 -4
- package/esm/components/use-image/use-image.type.d.ts.map +1 -1
- package/esm/components/use-image/use-image.type.js +1 -5
- package/esm/components/use-input/index.js +4 -40
- package/esm/components/use-input/use-input-format.d.ts +1 -1
- package/esm/components/use-input/use-input-format.js +18 -27
- package/esm/components/use-input/use-input-format.type.d.ts +1 -1
- package/esm/components/use-input/use-input-format.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-format.type.js +1 -5
- package/esm/components/use-input/use-input-number.d.ts +1 -1
- package/esm/components/use-input/use-input-number.js +23 -31
- package/esm/components/use-input/use-input-number.type.d.ts +1 -1
- package/esm/components/use-input/use-input-number.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-number.type.js +1 -5
- package/esm/components/use-input/use-input-password.js +16 -21
- package/esm/components/use-input/use-input-password.type.d.ts +1 -1
- package/esm/components/use-input/use-input-password.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input-password.type.js +1 -5
- package/esm/components/use-input/use-input.d.ts +3 -3
- package/esm/components/use-input/use-input.js +34 -42
- package/esm/components/use-input/use-input.type.d.ts +5 -5
- package/esm/components/use-input/use-input.type.d.ts.map +1 -1
- package/esm/components/use-input/use-input.type.js +1 -5
- package/esm/components/use-menu/index.js +2 -20
- package/esm/components/use-menu/use-menu-item.d.ts +1 -1
- package/esm/components/use-menu/use-menu-item.d.ts.map +1 -1
- package/esm/components/use-menu/use-menu-item.js +23 -31
- package/esm/components/use-menu/use-menu.js +15 -28
- package/esm/components/use-menu/use-menu.type.d.ts +1 -1
- package/esm/components/use-menu/use-menu.type.d.ts.map +1 -1
- package/esm/components/use-menu/use-menu.type.js +1 -5
- package/esm/components/use-pagination/index.js +1 -19
- package/esm/components/use-pagination/use-pagination.d.ts +1 -1
- package/esm/components/use-pagination/use-pagination.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
package/esm/utils/rule/rule.js
CHANGED
@@ -1,29 +1,16 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
10
|
-
require("core-js/modules/es.array.concat.js");
|
11
|
-
require("core-js/modules/es.array.includes.js");
|
12
|
-
require("core-js/modules/es.string.includes.js");
|
13
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
14
|
-
var _object = require("../object");
|
15
|
-
var _is = require("../is");
|
16
|
-
var _required = _interopRequireDefault(require("./required"));
|
17
|
-
var _length = _interopRequireDefault(require("./length"));
|
18
|
-
var _type2 = _interopRequireDefault(require("./type"));
|
19
|
-
var _regexp = _interopRequireDefault(require("./regexp"));
|
20
|
-
var RULE_TYPE = 'RULE_OBJECT';
|
21
|
-
exports.RULE_TYPE = RULE_TYPE;
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
import { deepMerge, objectValues } from "../object";
|
3
|
+
import { isObject } from "../is";
|
4
|
+
import required from "./required";
|
5
|
+
import length from "./length";
|
6
|
+
import _type from "./type";
|
7
|
+
import regExp from "./regexp";
|
8
|
+
export var RULE_TYPE = 'RULE_OBJECT';
|
22
9
|
var innerType = ['email', 'integer', 'number', 'url', 'json', 'hex', 'rgb', 'ipv4'];
|
23
10
|
var mergeOptions = function mergeOptions() {
|
24
11
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
25
|
-
if (!
|
26
|
-
console.error(new Error("rules expect an object, got ".concat((
|
12
|
+
if (!isObject(opts)) {
|
13
|
+
console.error(new Error("rules expect an object, got ".concat(_typeof(opts))));
|
27
14
|
return {};
|
28
15
|
}
|
29
16
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
@@ -36,21 +23,21 @@ var mergeOptions = function mergeOptions() {
|
|
36
23
|
func: arg[k]
|
37
24
|
};
|
38
25
|
});
|
39
|
-
var a =
|
26
|
+
var a = deepMerge(opts, arg);
|
40
27
|
return mergeOptions.apply(void 0, [a].concat(args));
|
41
28
|
};
|
42
|
-
function Rule() {
|
29
|
+
export default function Rule() {
|
43
30
|
for (var _len2 = arguments.length, opts = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
44
31
|
opts[_key2] = arguments[_key2];
|
45
32
|
}
|
46
33
|
var options = mergeOptions.apply(void 0, [{}].concat(opts));
|
47
34
|
var rules = {
|
48
|
-
required: (
|
49
|
-
max: (
|
50
|
-
min: (
|
51
|
-
regExp: (
|
35
|
+
required: required(options.required),
|
36
|
+
max: length('max', options.max),
|
37
|
+
min: length('min', options.min),
|
38
|
+
regExp: regExp(options.regExp),
|
52
39
|
type: function type(t) {
|
53
|
-
return (
|
40
|
+
return _type(t, options.type);
|
54
41
|
}
|
55
42
|
};
|
56
43
|
rules.length = function (min, max, msg) {
|
@@ -60,12 +47,12 @@ function Rule() {
|
|
60
47
|
return [rules.min(min, msg), rules.max(max, msg)];
|
61
48
|
};
|
62
49
|
innerType.forEach(function (k) {
|
63
|
-
rules[k] = (
|
50
|
+
rules[k] = _type(k, options[k] || options.type);
|
64
51
|
});
|
65
52
|
var ruleKeys = Object.keys(rules);
|
66
53
|
Object.keys(options).forEach(function (k) {
|
67
54
|
if (!ruleKeys.includes(k)) {
|
68
|
-
if (
|
55
|
+
if (isObject(options[k])) {
|
69
56
|
rules[k] = function (args) {
|
70
57
|
return Object.assign({}, options[k], {
|
71
58
|
args: args
|
@@ -76,7 +63,7 @@ function Rule() {
|
|
76
63
|
}
|
77
64
|
}
|
78
65
|
});
|
79
|
-
|
66
|
+
objectValues(rules).forEach(function (rule) {
|
80
67
|
rule.isInnerValidator = true;
|
81
68
|
});
|
82
69
|
rules.$$type = RULE_TYPE;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { ObjectType } from '../../common/type';
|
2
|
-
export
|
2
|
+
export type ValueOf<T> = T[keyof T];
|
3
3
|
export interface ValidFunc<T = any> {
|
4
4
|
(value: T | undefined, formValue: ObjectType, cb: (cbArgs: Error | true) => void, props: any): void | Promise<any>;
|
5
5
|
}
|
6
|
-
export
|
7
|
-
export
|
6
|
+
export type RuleTypeEnum = 'email' | 'integer' | 'number' | 'url' | 'json' | 'hex' | 'rgb' | 'ipv4';
|
7
|
+
export type MessageType = string | ((props?: any) => string);
|
8
8
|
export interface Required {
|
9
9
|
required?: boolean;
|
10
10
|
message?: MessageType;
|
@@ -102,14 +102,14 @@ export interface RuleFuncResult {
|
|
102
102
|
};
|
103
103
|
isInnerValidator: true;
|
104
104
|
}
|
105
|
-
export
|
105
|
+
export type RuleResult = {
|
106
106
|
[key: string]: RuleFuncResult;
|
107
107
|
} | RuleCommonResult;
|
108
|
-
export
|
109
|
-
export
|
108
|
+
export type RuleResultValue = ValueOf<RuleResult>;
|
109
|
+
export type FormItemObjectRule = Type & RegExpParams & Range & Min & Max & Required & {
|
110
110
|
func?: ValidFunc;
|
111
111
|
};
|
112
|
-
export
|
112
|
+
export type FormItemRule<Value, FormData = any, Props = any> = Array<RuleResultValue | FormItemObjectRule | ((value: Value, formData: FormData, callback: (cbArgs: boolean | Error) => void, props?: Props) => void)>;
|
113
113
|
export interface RuleParams {
|
114
114
|
required?: Required;
|
115
115
|
min?: Min;
|
@@ -129,7 +129,7 @@ export interface RuleParams {
|
|
129
129
|
message?: MessageType;
|
130
130
|
} | ValidFunc | undefined;
|
131
131
|
}
|
132
|
-
export
|
132
|
+
export type InnerRuleFunc<U> = U & {
|
133
133
|
isInnerValidator: true;
|
134
134
|
};
|
135
135
|
//# sourceMappingURL=rule.type.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rule.type.d.ts","sourceRoot":"","sources":["rule.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,
|
1
|
+
{"version":3,"file":"rule.type.d.ts","sourceRoot":"","sources":["rule.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpC,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IAChC,CACE,KAAK,EAAE,CAAC,GAAG,SAAS,EACpB,SAAS,EAAE,UAAU,EACrB,EAAE,EAAE,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,EAClC,KAAK,EAAE,GAAG,GACT,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACxB;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AACpG,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,GAAG;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,GAAG;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,KAAM,SAAQ,GAAG,EAAE,GAAG;CAAG;AAE1C,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAGD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,QAAQ,CAAC,CAAC;IAE7D;;;OAGG;IACH,GAAG,EAAE,aAAa,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,GAAG,CAAC,CAAC;IAEpE;;;OAGG;IACH,GAAG,EAAE,aAAa,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,GAAG,CAAC,CAAC;IAEpE;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,KAAK,CAAC,CAAC;IAEnF;;;OAGG;IACH,MAAM,EAAE,aAAa,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,YAAY,CAAC,CAAC;IAEtF;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;IAEtD;;;OAGG;IACH,OAAO,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;IAExD;;;OAGG;IACH,MAAM,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;IAEvD;;;OAGG;IACH,GAAG,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;IAEpD;;;OAGG;IACH,IAAI,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;IAErD;;;OAGG;IACH,GAAG,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;IAEpD;;;OAGG;IACH,GAAG,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;IAEpD;;;OAGG;IACH,IAAI,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC;CACtD;AAGD,MAAM,WAAW,cAAc;IAC7B,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,SAAS,CAAC;QAAC,OAAO,CAAC,EAAE,WAAW,CAAA;KAAE,CAAC;IACnE,gBAAgB,EAAE,IAAI,CAAC;CACxB;AAGD,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,GAAG,gBAAgB,CAAC;AAG9E,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGlD,MAAM,MAAM,kBAAkB,GAAG,IAAI,GACnC,YAAY,GACZ,KAAK,GACL,GAAG,GACH,GAAG,GACH,QAAQ,GAAG;IACT,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEJ,MAAM,MAAM,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI,KAAK,CAChE,eAAe,GACf,kBAAkB,GAClB,CAAC,CACC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,KAAK,IAAI,EAC3C,KAAK,CAAC,EAAE,KAAK,KACV,IAAI,CAAC,CACb,CAAC;AAGF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,CAAC,QAAQ,EAAE,MAAM,GACb;QACE,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,OAAO,CAAC,EAAE,WAAW,CAAC;KACvB,GACD,SAAS,GACT,SAAS,CAAC;CACf;AAGD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,gBAAgB,EAAE,IAAI,CAAA;CAAE,CAAC"}
|
package/esm/utils/rule/type.d.ts
CHANGED
@@ -4,6 +4,6 @@ export declare const typeMessage: (props: ObjectType) => "$rules.type" | "$rules
|
|
4
4
|
declare const _default: (type: string, { message, tip }?: {
|
5
5
|
message?: MessageType | undefined;
|
6
6
|
tip?: string | undefined;
|
7
|
-
}) => (msg: MessageType) => ObjectType
|
7
|
+
}) => (msg: MessageType) => ObjectType;
|
8
8
|
export default _default;
|
9
9
|
//# sourceMappingURL=type.d.ts.map
|
package/esm/utils/rule/type.js
CHANGED
@@ -1,31 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.typeMessage = exports.default = void 0;
|
7
|
-
var _object = require("../object");
|
8
|
-
var typeMessage = function typeMessage(props) {
|
1
|
+
import { deepMerge } from "../object";
|
2
|
+
export var typeMessage = function typeMessage(props) {
|
9
3
|
return props.title ? '$rules.type' : '$rules.reg';
|
10
4
|
};
|
11
|
-
exports.typeMessage = typeMessage;
|
12
5
|
var options = {
|
13
6
|
skipUndefined: true
|
14
7
|
};
|
15
|
-
|
8
|
+
export default (function (type) {
|
16
9
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
17
10
|
message = _ref.message,
|
18
11
|
tip = _ref.tip;
|
19
12
|
return function (msg) {
|
20
|
-
return
|
13
|
+
return deepMerge({
|
21
14
|
type: type,
|
22
15
|
message: typeMessage
|
23
|
-
},
|
16
|
+
}, deepMerge({
|
24
17
|
message: message,
|
25
18
|
tip: tip
|
26
19
|
}, {
|
27
20
|
message: msg
|
28
21
|
}, options), options);
|
29
22
|
};
|
30
|
-
};
|
31
|
-
exports.default = _default;
|
23
|
+
});
|
@@ -1,18 +1,5 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.compareColumns = compareColumns;
|
8
|
-
exports.default = void 0;
|
9
|
-
exports.shallowEqual = shallowEqual;
|
10
|
-
require("core-js/modules/es.array.sort.js");
|
11
|
-
require("core-js/modules/es.array.index-of.js");
|
12
|
-
require("core-js/modules/es.array.includes.js");
|
13
|
-
require("core-js/modules/es.string.includes.js");
|
14
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
15
|
-
var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
import deepEqual from 'react-fast-compare';
|
16
3
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
17
4
|
function is(x, y) {
|
18
5
|
if (x === y) {
|
@@ -26,7 +13,7 @@ function getOption(options, key) {
|
|
26
13
|
var val = options[key];
|
27
14
|
return Array.isArray(val) ? val : [val];
|
28
15
|
}
|
29
|
-
function compareColumns(columns1, columns2) {
|
16
|
+
export function compareColumns(columns1, columns2) {
|
30
17
|
if (!columns1 || !columns2) return true;
|
31
18
|
if (columns1.length !== columns2.length) return false;
|
32
19
|
var simpleCompare = columns1.every(function (c, i) {
|
@@ -41,12 +28,12 @@ function compareColumns(columns1, columns2) {
|
|
41
28
|
});
|
42
29
|
return complexCompare;
|
43
30
|
}
|
44
|
-
function shallowEqual(objA, objB) {
|
31
|
+
export function shallowEqual(objA, objB) {
|
45
32
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
46
33
|
if (is(objA, objB)) {
|
47
34
|
return true;
|
48
35
|
}
|
49
|
-
if ((
|
36
|
+
if (_typeof(objA) !== 'object' || objA === null || _typeof(objB) !== 'object' || objB === null) {
|
50
37
|
return false;
|
51
38
|
}
|
52
39
|
var keysA = Object.keys(objA);
|
@@ -70,7 +57,7 @@ function shallowEqual(objA, objB) {
|
|
70
57
|
continue;
|
71
58
|
}
|
72
59
|
if (deep.includes(k)) {
|
73
|
-
if (!(
|
60
|
+
if (!deepEqual(objA[k], objB[k])) return false;
|
74
61
|
} else {
|
75
62
|
return false;
|
76
63
|
}
|
@@ -78,5 +65,4 @@ function shallowEqual(objA, objB) {
|
|
78
65
|
}
|
79
66
|
return true;
|
80
67
|
}
|
81
|
-
|
82
|
-
exports.default = _default;
|
68
|
+
export default shallowEqual;
|
package/esm/utils/string.js
CHANGED
@@ -1,23 +1,9 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.removeProtocol = removeProtocol;
|
7
|
-
exports.substitute = substitute;
|
8
|
-
require("core-js/modules/es.regexp.exec.js");
|
9
|
-
require("core-js/modules/es.string.replace.js");
|
10
|
-
require("core-js/modules/es.array.slice.js");
|
11
|
-
require("core-js/modules/es.array.iterator.js");
|
12
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
13
|
-
require("core-js/modules/web.url.js");
|
14
|
-
require("core-js/modules/web.url-search-params.js");
|
15
1
|
/**
|
16
2
|
*
|
17
3
|
* 输入 substitute('请输入至少{min}个字符', {min: 50})
|
18
4
|
* 输出 请输入至少50个字符
|
19
5
|
*/
|
20
|
-
function substitute(str, obj) {
|
6
|
+
export function substitute(str, obj) {
|
21
7
|
if (typeof str === 'string') {
|
22
8
|
if (str.indexOf('{') < 0) {
|
23
9
|
return str;
|
@@ -41,7 +27,7 @@ function substitute(str, obj) {
|
|
41
27
|
* 输入 'https://github.com/'
|
42
28
|
* 输出 '//github.com/'
|
43
29
|
*/
|
44
|
-
function removeProtocol(url) {
|
30
|
+
export function removeProtocol(url) {
|
45
31
|
if (url.indexOf('http') !== 0) return url;
|
46
32
|
try {
|
47
33
|
var _URL = new URL(url),
|
package/esm/utils/style-unit.js
CHANGED
@@ -1,15 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.parseStyleUnitValue = parseStyleUnitValue;
|
7
|
-
require("core-js/modules/es.regexp.exec.js");
|
8
|
-
require("core-js/modules/es.string.match.js");
|
9
|
-
var _is = require("./is");
|
10
|
-
function parseStyleUnitValue(value) {
|
1
|
+
import { isNumber } from "./is";
|
2
|
+
export function parseStyleUnitValue(value) {
|
11
3
|
if (value === undefined) return;
|
12
|
-
if (
|
4
|
+
if (isNumber(value)) {
|
13
5
|
return {
|
14
6
|
value: value,
|
15
7
|
unit: 'px'
|
package/esm/utils/tree.d.ts
CHANGED
@@ -3,7 +3,7 @@ export declare const getFlattenTree: <T>(data: T[], childrenKey?: keyof T, wide?
|
|
3
3
|
export declare const getFilterTree: <DataItem, K extends (node: DataItem) => KeygenResult>(treeNodes: DataItem[] | undefined, filterFunc: void | ((data: DataItem) => boolean) | undefined, filterExpandKeys: KeygenResult[] | undefined, keyFunc: K, childrenKey: keyof DataItem | undefined, showHitDescendants: boolean, firstMatchNode?: ((node: DataItem) => void) | undefined, { advanced, }?: {
|
4
4
|
advanced?: boolean | undefined;
|
5
5
|
}) => (DataItem | null)[];
|
6
|
-
|
6
|
+
type FilterDatum<DataItem> = {
|
7
7
|
data: DataItem[];
|
8
8
|
childrenKey: any;
|
9
9
|
getKey: (node: DataItem) => KeygenResult;
|
package/esm/utils/tree.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,cAAc,+CAGlB,OAAO,UAkBf,CAAC;AAEF,eAAO,MAAM,aAAa,2CAA4C,YAAY,6EAE5B,OAAO,iCACzC,YAAY,EAAE,GAAG,SAAS,2EAGxB,OAAO,wCACU,IAAI;;yBA4B1C,CAAC;AAEF,
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,eAAO,MAAM,cAAc,+CAGlB,OAAO,UAkBf,CAAC;AAEF,eAAO,MAAM,aAAa,2CAA4C,YAAY,6EAE5B,OAAO,iCACzC,YAAY,EAAE,GAAG,SAAS,2EAGxB,OAAO,wCACU,IAAI;;yBA4B1C,CAAC;AAEF,KAAK,WAAW,CAAC,QAAQ,IAAI;IAC3B,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,WAAW,EAAE,GAAG,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,YAAY,CAAC;IACzC,WAAW,EAAE,CAAC,EAAE,EAAE,YAAY,KAAK,QAAQ,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBACf,YAAY,GAAG,CAAC,YACnB,YAAY,GAAG,CAAC,WACjB,YAAY,EAAE,UAqBxB,CAAC"}
|
package/esm/utils/tree.js
CHANGED
@@ -1,23 +1,18 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
var
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
var _immer = require("../utils/immer");
|
17
|
-
var _clone = require("./clone");
|
18
|
-
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; }
|
19
|
-
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; }
|
20
|
-
var getFlattenTree = function getFlattenTree(data) {
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
12
|
+
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; }
|
13
|
+
import { produce } from "../utils/immer";
|
14
|
+
import { deepClone } from "./clone";
|
15
|
+
export var getFlattenTree = function getFlattenTree(data) {
|
21
16
|
var childrenKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';
|
22
17
|
var wide = arguments.length > 2 ? arguments[2] : undefined;
|
23
18
|
var arr = [];
|
@@ -25,20 +20,19 @@ var getFlattenTree = function getFlattenTree(data) {
|
|
25
20
|
list.forEach(function (item) {
|
26
21
|
var children = item[childrenKey];
|
27
22
|
if (children && children.length > 0) {
|
28
|
-
var clonedPath = (
|
23
|
+
var clonedPath = _toConsumableArray(path);
|
29
24
|
clonedPath.push(item);
|
30
25
|
if (wide) arr.push(clonedPath);
|
31
26
|
flatten(children, clonedPath);
|
32
27
|
} else {
|
33
|
-
arr.push([].concat((
|
28
|
+
arr.push([].concat(_toConsumableArray(path), [item]));
|
34
29
|
}
|
35
30
|
});
|
36
31
|
};
|
37
32
|
flatten(data, []);
|
38
33
|
return arr;
|
39
34
|
};
|
40
|
-
|
41
|
-
var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKeys, keyFunc) {
|
35
|
+
export var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKeys, keyFunc) {
|
42
36
|
var childrenKey = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'children';
|
43
37
|
var showHitDescendants = arguments.length > 5 ? arguments[5] : undefined;
|
44
38
|
var firstMatchNode = arguments.length > 6 ? arguments[6] : undefined;
|
@@ -60,7 +54,7 @@ var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKe
|
|
60
54
|
if (!node[childrenKey]) return node;
|
61
55
|
var childNodes = showHitDescendants && match ? node[childrenKey] || [] : children;
|
62
56
|
if (advanced && match && children.length > 0) childNodes = children;
|
63
|
-
return _objectSpread(_objectSpread({}, node), {}, (
|
57
|
+
return _objectSpread(_objectSpread({}, node), {}, _defineProperty({}, childrenKey, childNodes));
|
64
58
|
}
|
65
59
|
return null;
|
66
60
|
};
|
@@ -68,26 +62,24 @@ var getFilterTree = function getFilterTree(treeNodes, filterFunc, filterExpandKe
|
|
68
62
|
return node;
|
69
63
|
});
|
70
64
|
};
|
71
|
-
|
72
|
-
var mergeFilteredTree = function mergeFilteredTree(filterDatum, rawDatum, tiledId) {
|
65
|
+
export var mergeFilteredTree = function mergeFilteredTree(filterDatum, rawDatum, tiledId) {
|
73
66
|
var filterData = filterDatum.data;
|
74
67
|
var childrenKey = filterDatum.childrenKey;
|
75
68
|
if (tiledId.length === 0) return filterData;
|
76
69
|
var recursion = function recursion(node) {
|
77
70
|
var nodeKey = filterDatum.getKey(node);
|
78
71
|
if (tiledId.indexOf(nodeKey) >= 0) {
|
79
|
-
node[childrenKey] =
|
72
|
+
node[childrenKey] = deepClone(rawDatum.getDataById(nodeKey)[childrenKey] || []);
|
80
73
|
} else {
|
81
74
|
var item = filterDatum.getDataById(nodeKey);
|
82
75
|
if (item && item[childrenKey]) {
|
83
|
-
node[childrenKey] =
|
76
|
+
node[childrenKey] = deepClone(item[childrenKey] || []);
|
84
77
|
}
|
85
78
|
}
|
86
79
|
var children = node[childrenKey] || [];
|
87
80
|
children.map(recursion);
|
88
81
|
};
|
89
|
-
return
|
82
|
+
return produce(filterData, function (draft) {
|
90
83
|
draft.map(recursion);
|
91
84
|
});
|
92
|
-
};
|
93
|
-
exports.mergeFilteredTree = mergeFilteredTree;
|
85
|
+
};
|
package/esm/utils/uid.js
CHANGED
@@ -1,22 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.generateUUID = generateUUID;
|
7
|
-
exports.getUidStr = getUidStr;
|
8
|
-
require("core-js/modules/es.regexp.exec.js");
|
9
|
-
require("core-js/modules/es.string.replace.js");
|
10
|
-
require("core-js/modules/es.regexp.to-string.js");
|
11
|
-
require("core-js/modules/es.array.iterator.js");
|
12
|
-
require("core-js/modules/es.typed-array.uint32-array.js");
|
13
|
-
require("core-js/modules/es.typed-array.fill.js");
|
14
|
-
require("core-js/modules/es.typed-array.iterator.js");
|
15
|
-
require("core-js/modules/es.typed-array.set.js");
|
16
|
-
require("core-js/modules/es.typed-array.sort.js");
|
17
|
-
require("core-js/modules/es.typed-array.to-string.js");
|
18
|
-
require("core-js/modules/es.string.pad-start.js");
|
19
|
-
function generateUUID() {
|
1
|
+
export function generateUUID() {
|
20
2
|
var c = crypto || typeof window !== 'undefined' && window.crypto; // 获取加密库
|
21
3
|
if (!c || !c.getRandomValues) {
|
22
4
|
// 如果不支持就返回一个随机的UUID v4 版本
|
@@ -34,7 +16,7 @@ function generateUUID() {
|
|
34
16
|
};
|
35
17
|
return (intToHex(uuid[0]) + '-' + intToHex(uuid[1]) + '-' + intToHex(uuid[2]) + '-' + intToHex(uuid[3])).toLowerCase();
|
36
18
|
}
|
37
|
-
function getUidStr() {
|
19
|
+
export function getUidStr() {
|
38
20
|
// dom id cannot start with number
|
39
21
|
return "a".concat(generateUUID());
|
40
22
|
}
|
@@ -1,38 +1,35 @@
|
|
1
|
-
"
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
});
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
var
|
11
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
12
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
14
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
15
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
16
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
18
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
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 _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
4
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
6
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
7
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
8
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
9
|
+
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
10
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
19
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
20
|
-
|
21
|
-
|
12
|
+
function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
14
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
15
|
+
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; }
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
17
|
+
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); }
|
18
|
+
export var FormError = /*#__PURE__*/function (_Error) {
|
19
|
+
_inherits(FormError, _Error);
|
22
20
|
var _super = _createSuper(FormError);
|
23
21
|
function FormError(message, props) {
|
24
22
|
var _this;
|
25
|
-
(
|
23
|
+
_classCallCheck(this, FormError);
|
26
24
|
_this = _super.call(this, message);
|
27
|
-
(
|
25
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
28
26
|
_this.name = 'FormError';
|
29
27
|
_this.props = props;
|
30
28
|
return _this;
|
31
29
|
}
|
32
|
-
return (
|
33
|
-
}( /*#__PURE__*/(
|
34
|
-
|
35
|
-
function wrapFormError(error) {
|
30
|
+
return _createClass(FormError);
|
31
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
32
|
+
export function wrapFormError(error) {
|
36
33
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
37
34
|
if (error instanceof FormError) return error;
|
38
35
|
if (error instanceof Error) {
|