@fibrae/semi-foundation 0.3.0 → 0.4.0
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/LICENSE +0 -62
- package/README.md +37 -35
- package/README.zh-CN.md +79 -0
- package/dist/base/auto-close-foundation.d.ts +21 -6
- package/dist/base/auto-close-foundation.js +28 -9
- package/dist/base/focus-handle.d.ts +42 -0
- package/dist/base/focus-handle.js +89 -0
- package/dist/base/focus-scope.js +75 -0
- package/dist/base/foundation.d.ts +57 -26
- package/dist/base/foundation.js +59 -26
- package/dist/base/list-store.js +15 -2
- package/dist/base/modal-resources.d.ts +35 -0
- package/dist/base/modal-resources.js +57 -0
- package/dist/base/popup-lifecycle.d.ts +13 -0
- package/dist/base/popup-lifecycle.js +30 -0
- package/dist/base/release-holder.js +18 -0
- package/dist/base/reset-timer.d.ts +9 -0
- package/dist/base/reset-timer.js +29 -0
- package/dist/base/static-list-wrapper.d.ts +15 -0
- package/dist/base/static-list-wrapper.js +47 -0
- package/dist/base/tokens.css +36 -36
- package/dist/components/anchor/constants.d.ts +11 -0
- package/dist/components/anchor/constants.js +18 -0
- package/dist/components/anchor/foundation.d.ts +49 -0
- package/dist/components/anchor/foundation.js +162 -0
- package/dist/components/anchor/utils.js +16 -0
- package/dist/components/anchor/variables.scss +34 -0
- package/dist/components/audio-player/audio-player.css +226 -0
- package/dist/components/audio-player/audio-player.scss +278 -0
- package/dist/components/audio-player/constants.js +27 -0
- package/dist/components/audio-player/foundation.d.ts +44 -0
- package/dist/components/audio-player/foundation.js +126 -0
- package/dist/components/audio-player/utils.js +6 -0
- package/dist/components/audio-player/variables.scss +53 -0
- package/dist/components/auto-complete/constants.js +7 -0
- package/dist/components/auto-complete/foundation.d.ts +67 -0
- package/dist/components/auto-complete/foundation.js +217 -0
- package/dist/components/auto-complete/option.css +62 -0
- package/dist/components/avatar/constants.js +13 -0
- package/dist/components/avatar/foundation.d.ts +31 -0
- package/dist/components/avatar/foundation.js +43 -0
- package/dist/components/avatar/variables.scss +112 -0
- package/dist/components/backtop/constants.js +35 -0
- package/dist/components/backtop/foundation.d.ts +26 -0
- package/dist/components/backtop/foundation.js +94 -0
- package/dist/components/badge/constants.js +4 -0
- package/dist/components/banner/constants.js +4 -0
- package/dist/components/banner/foundation.d.ts +12 -0
- package/dist/components/banner/foundation.js +12 -0
- package/dist/components/breadcrumb/breadcrumb.scss +116 -0
- package/dist/components/breadcrumb/constants.js +8 -0
- package/dist/components/breadcrumb/foundation.d.ts +47 -0
- package/dist/components/breadcrumb/foundation.js +64 -0
- package/dist/components/breadcrumb/item-foundation.d.ts +45 -0
- package/dist/components/breadcrumb/item-foundation.js +36 -0
- package/dist/components/button/constants.js +5 -0
- package/dist/components/button/split-button-group.css +19 -0
- package/dist/components/button/utils.d.ts +27 -0
- package/dist/components/button/utils.js +89 -0
- package/dist/components/button/variables.scss +169 -0
- package/dist/components/calendar/calendar.css +485 -0
- package/dist/components/calendar/calendar.scss +515 -0
- package/dist/components/calendar/constants.js +14 -0
- package/dist/components/calendar/event-util.js +193 -0
- package/dist/components/calendar/foundation.d.ts +75 -0
- package/dist/components/calendar/foundation.js +196 -0
- package/dist/components/calendar/month-foundation.d.ts +22 -0
- package/dist/components/calendar/month-foundation.js +32 -0
- package/dist/components/card/constants.js +4 -0
- package/dist/components/carousel/carousel.css +345 -0
- package/dist/components/carousel/carousel.scss +451 -0
- package/dist/components/carousel/constants.js +42 -0
- package/dist/components/carousel/foundation.d.ts +64 -0
- package/dist/components/carousel/foundation.js +217 -0
- package/dist/components/carousel/variables.scss +49 -0
- package/dist/components/cascader/cascader.scss +586 -0
- package/dist/components/cascader/constants.js +20 -0
- package/dist/components/cascader/foundation.d.ts +295 -0
- package/dist/components/cascader/foundation.js +884 -0
- package/dist/components/cascader/util.js +148 -0
- package/dist/components/checkbox/checkbox-foundation.d.ts +100 -0
- package/dist/components/checkbox/checkbox-foundation.js +74 -0
- package/dist/components/checkbox/checkbox-group-foundation.d.ts +25 -0
- package/dist/components/checkbox/checkbox-group-foundation.js +34 -0
- package/dist/components/checkbox/constants.js +15 -0
- package/dist/components/checkbox/variables.scss +72 -0
- package/dist/components/code-highlight/constants.js +4 -0
- package/dist/components/code-highlight/highlighter.js +56 -0
- package/dist/components/code-highlight/index.d.ts +26 -0
- package/dist/components/code-highlight/index.js +43 -0
- package/dist/components/code-highlight/registry.js +33 -0
- package/dist/components/collapse/collapse.scss +112 -0
- package/dist/components/collapse/constants.js +4 -0
- package/dist/components/collapse/foundation.d.ts +51 -0
- package/dist/components/collapse/foundation.js +56 -0
- package/dist/components/collapsible/constants.js +4 -0
- package/dist/components/collapsible/foundation.d.ts +69 -0
- package/dist/components/collapsible/foundation.js +132 -0
- package/dist/components/color-picker/color-choose-area-foundation.d.ts +33 -0
- package/dist/components/color-picker/color-choose-area-foundation.js +57 -0
- package/dist/components/color-picker/color-picker.scss +129 -0
- package/dist/components/color-picker/color-slider-foundation.d.ts +28 -0
- package/dist/components/color-picker/color-slider-foundation.js +45 -0
- package/dist/components/color-picker/constants.js +4 -0
- package/dist/components/color-picker/data-part-foundation.d.ts +35 -0
- package/dist/components/color-picker/data-part-foundation.js +86 -0
- package/dist/components/color-picker/foundation.d.ts +53 -0
- package/dist/components/color-picker/foundation.js +150 -0
- package/dist/components/color-picker/utils/convert.d.ts +14 -0
- package/dist/components/color-picker/utils/convert.js +148 -0
- package/dist/components/color-picker/utils/round.js +5 -0
- package/dist/components/color-picker/utils/split.js +26 -0
- package/dist/components/config-provider/breakpoint-observer.js +139 -0
- package/dist/components/config-provider/inherit-config.d.ts +24 -0
- package/dist/components/config-provider/inherit-config.js +24 -0
- package/dist/components/cropper/constants.js +37 -0
- package/dist/components/cropper/cropper.scss +129 -0
- package/dist/components/cropper/foundation.d.ts +94 -0
- package/dist/components/cropper/foundation.js +851 -0
- package/dist/components/cropper/utils.js +23 -0
- package/dist/components/date-picker/_utils/formatter.js +21 -0
- package/dist/components/date-picker/_utils/get-day-of-week.js +14 -0
- package/dist/components/date-picker/_utils/get-default-format-token.js +18 -0
- package/dist/components/date-picker/_utils/get-default-picker-date.js +35 -0
- package/dist/components/date-picker/_utils/get-full-date-offset.js +11 -0
- package/dist/components/date-picker/_utils/get-inset-input-format-token.js +33 -0
- package/dist/components/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +57 -0
- package/dist/components/date-picker/_utils/get-month-table.js +33 -0
- package/dist/components/date-picker/_utils/get-year-and-month.js +18 -0
- package/dist/components/date-picker/_utils/get-year-month-from-value.js +18 -0
- package/dist/components/date-picker/_utils/get-years.js +9 -0
- package/dist/components/date-picker/_utils/index.d.ts +9 -0
- package/dist/components/date-picker/_utils/index.js +9 -0
- package/dist/components/date-picker/_utils/is-after.js +7 -0
- package/dist/components/date-picker/_utils/is-before.js +7 -0
- package/dist/components/date-picker/_utils/is-between.js +11 -0
- package/dist/components/date-picker/_utils/is-same-day.js +7 -0
- package/dist/components/date-picker/_utils/is-timestamp.js +6 -0
- package/dist/components/date-picker/_utils/is-valid-date.js +5 -0
- package/dist/components/date-picker/_utils/parser.js +17 -0
- package/dist/components/date-picker/_utils/picker-type.js +28 -0
- package/dist/components/date-picker/_utils/to-callback-args.js +46 -0
- package/dist/components/date-picker/_utils/to-date-arg.js +13 -0
- package/dist/components/date-picker/constants.js +78 -0
- package/dist/components/date-picker/date-picker.scss +1762 -0
- package/dist/components/date-picker/foundation.d.ts +299 -0
- package/dist/components/date-picker/foundation.js +707 -0
- package/dist/components/date-picker/input-foundation.d.ts +134 -0
- package/dist/components/date-picker/input-foundation.js +212 -0
- package/dist/components/date-picker/month-foundation.d.ts +163 -0
- package/dist/components/date-picker/month-foundation.js +196 -0
- package/dist/components/date-picker/months-grid-foundation.d.ts +163 -0
- package/dist/components/date-picker/months-grid-foundation.js +614 -0
- package/dist/components/date-picker/year-and-month-foundation.d.ts +75 -0
- package/dist/components/date-picker/year-and-month-foundation.js +115 -0
- package/dist/components/descriptions/constants.js +4 -0
- package/dist/components/descriptions/foundation.d.ts +9 -0
- package/dist/components/descriptions/foundation.js +33 -0
- package/dist/components/divider/constants.js +4 -0
- package/dist/components/drag-move/foundation.d.ts +31 -0
- package/dist/components/drag-move/foundation.js +203 -0
- package/dist/components/dropdown/constants.js +12 -0
- package/dist/components/dropdown/foundation.d.ts +37 -0
- package/dist/components/dropdown/foundation.js +124 -0
- package/dist/components/dropdown/menu-foundation.d.ts +35 -0
- package/dist/components/dropdown/menu-foundation.js +83 -0
- package/dist/components/empty/constants.js +5 -0
- package/dist/components/feedback/constants.js +19 -0
- package/dist/components/feedback/feedback.scss +153 -0
- package/dist/components/feedback/foundation.d.ts +42 -0
- package/dist/components/feedback/foundation.js +70 -0
- package/dist/components/float-button/constants.js +13 -0
- package/dist/components/float-button/float-button.scss +201 -0
- package/dist/components/form/array-field-rows.d.ts +23 -0
- package/dist/components/form/array-field-rows.js +60 -0
- package/dist/components/form/constants.d.ts +15 -0
- package/dist/components/form/constants.js +47 -0
- package/dist/components/form/errors.d.ts +15 -0
- package/dist/components/form/errors.js +50 -0
- package/dist/components/form/field-store.js +28 -0
- package/dist/components/form/form-api-proxy.d.ts +14 -0
- package/dist/components/form/form-api-proxy.js +48 -0
- package/dist/components/form/form.css +250 -0
- package/dist/components/form/form.scss +319 -0
- package/dist/components/form/foundation.d.ts +71 -0
- package/dist/components/form/foundation.js +1100 -0
- package/dist/components/form/interface.d.ts +247 -0
- package/dist/components/form/json-schema.d.ts +42 -0
- package/dist/components/form/json-schema.js +208 -0
- package/dist/components/form/rtl.scss +13 -0
- package/dist/components/form/rules.d.ts +37 -0
- package/dist/components/form/rules.js +97 -0
- package/dist/components/form/utils.d.ts +119 -0
- package/dist/components/form/utils.js +154 -0
- package/dist/components/form/variables.scss +52 -0
- package/dist/components/grid/constants.js +12 -0
- package/dist/components/grid/gutter.js +39 -0
- package/dist/components/grid/utils.js +39 -0
- package/dist/components/highlight/constants.js +4 -0
- package/dist/components/highlight/foundation.js +108 -0
- package/dist/components/hot-keys/constants.js +207 -0
- package/dist/components/hot-keys/foundation.d.ts +22 -0
- package/dist/components/hot-keys/foundation.js +96 -0
- package/dist/components/image/constants.js +5 -0
- package/dist/components/image/image-foundation.d.ts +39 -0
- package/dist/components/image/image-foundation.js +60 -0
- package/dist/components/image/image.scss +272 -0
- package/dist/components/image/preview-footer-foundation.d.ts +25 -0
- package/dist/components/image/preview-footer-foundation.js +30 -0
- package/dist/components/image/preview-foundation.d.ts +54 -0
- package/dist/components/image/preview-foundation.js +79 -0
- package/dist/components/image/preview-image-foundation.d.ts +63 -0
- package/dist/components/image/preview-image-foundation.js +238 -0
- package/dist/components/image/preview-inner-foundation.d.ts +92 -0
- package/dist/components/image/preview-inner-foundation.js +290 -0
- package/dist/components/image/utils.js +66 -0
- package/dist/components/input/constants.d.ts +8 -0
- package/dist/components/input/constants.js +13 -0
- package/dist/components/input/foundation.d.ts +51 -0
- package/dist/components/input/foundation.js +81 -0
- package/dist/components/input/input.css +619 -0
- package/dist/components/input/input.scss +746 -0
- package/dist/components/input/text-entry-foundation.d.ts +60 -0
- package/dist/components/input/text-entry-foundation.js +105 -0
- package/dist/components/input/textarea-foundation.d.ts +63 -0
- package/dist/components/input/textarea-foundation.js +138 -0
- package/dist/components/input/textarea.css +260 -0
- package/dist/components/input/textarea.scss +320 -0
- package/dist/components/input/util/line-number.js +42 -0
- package/dist/components/input/util/truncate-value.js +14 -0
- package/dist/components/input/variables.scss +107 -0
- package/dist/components/input-number/caret.js +20 -0
- package/dist/components/input-number/constants.d.ts +14 -0
- package/dist/components/input-number/constants.js +13 -0
- package/dist/components/input-number/foundation.d.ts +104 -0
- package/dist/components/input-number/foundation.js +555 -0
- package/dist/components/json-viewer/constants.js +4 -0
- package/dist/components/json-viewer/foundation.d.ts +53 -0
- package/dist/components/json-viewer/foundation.js +161 -0
- package/dist/components/json-viewer/json-viewer.scss +224 -0
- package/dist/components/layout/constants.js +4 -0
- package/dist/components/list/constants.js +4 -0
- package/dist/components/list/list.scss +162 -0
- package/dist/components/lottie/constants.js +4 -0
- package/dist/components/lottie/foundation.d.ts +31 -0
- package/dist/components/lottie/foundation.js +65 -0
- package/dist/components/markdown-render/constants.js +4 -0
- package/dist/components/markdown-render/foundation.d.ts +54 -0
- package/dist/components/markdown-render/foundation.js +118 -0
- package/dist/components/modal/confirm-registry.d.ts +10 -0
- package/dist/components/modal/confirm-registry.js +21 -0
- package/dist/components/modal/confirm.js +34 -0
- package/dist/components/modal/constants.js +4 -0
- package/dist/components/modal/modal-content-foundation.d.ts +38 -0
- package/dist/components/modal/modal-content-foundation.js +73 -0
- package/dist/components/modal/modal-foundation.d.ts +92 -0
- package/dist/components/modal/modal-foundation.js +115 -0
- package/dist/components/navigation/constants.js +20 -0
- package/dist/components/navigation/foundation.d.ts +81 -0
- package/dist/components/navigation/foundation.js +180 -0
- package/dist/components/navigation/item-foundation.d.ts +44 -0
- package/dist/components/navigation/item-foundation.js +42 -0
- package/dist/components/navigation/navigation.scss +764 -0
- package/dist/components/navigation/sub-nav-foundation.d.ts +30 -0
- package/dist/components/navigation/sub-nav-foundation.js +54 -0
- package/dist/components/navigation/variables.scss +120 -0
- package/dist/components/notification/constants.js +32 -0
- package/dist/components/notification/notification-api-foundation.d.ts +29 -0
- package/dist/components/notification/notification-api-foundation.js +58 -0
- package/dist/components/notification/notification-foundation.d.ts +40 -0
- package/dist/components/notification/notification-foundation.js +12 -0
- package/dist/components/notification/notification-list-foundation.d.ts +73 -0
- package/dist/components/notification/notification-list-foundation.js +94 -0
- package/dist/components/overflow-list/constants.d.ts +21 -0
- package/dist/components/overflow-list/constants.js +22 -0
- package/dist/components/overflow-list/foundation.d.ts +78 -0
- package/dist/components/overflow-list/foundation.js +195 -0
- package/dist/components/pagination/constants.js +14 -0
- package/dist/components/pagination/foundation.d.ts +54 -0
- package/dist/components/pagination/foundation.js +185 -0
- package/dist/components/pagination/pagination.scss +189 -0
- package/dist/components/pincode/constants.js +4 -0
- package/dist/components/pincode/foundation.d.ts +38 -0
- package/dist/components/pincode/foundation.js +92 -0
- package/dist/components/popconfirm/constants.d.ts +4 -0
- package/dist/components/popconfirm/constants.js +7 -0
- package/dist/components/popconfirm/popconfirm-foundation.d.ts +47 -0
- package/dist/components/popconfirm/popconfirm-foundation.js +85 -0
- package/dist/components/popover/constants.js +47 -0
- package/dist/components/progress/constants.js +8 -0
- package/dist/components/progress/generates.js +24 -0
- package/dist/components/progress/utils.js +45 -0
- package/dist/components/radio/constants.js +19 -0
- package/dist/components/radio/radio-foundation.d.ts +76 -0
- package/dist/components/radio/radio-foundation.js +92 -0
- package/dist/components/radio/radio-group-foundation.d.ts +19 -0
- package/dist/components/radio/radio-group-foundation.js +31 -0
- package/dist/components/radio/variables.scss +107 -0
- package/dist/components/rating/constants.js +5 -0
- package/dist/components/rating/foundation.d.ts +101 -0
- package/dist/components/rating/foundation.js +166 -0
- package/dist/components/rating/variables.scss +19 -0
- package/dist/components/resizable/constants.js +4 -0
- package/dist/components/resizable/foundation.d.ts +3 -0
- package/dist/components/resizable/group/index.d.ts +60 -0
- package/dist/components/resizable/group/index.js +351 -0
- package/dist/components/resizable/resizable.scss +146 -0
- package/dist/components/resizable/single/index.d.ts +86 -0
- package/dist/components/resizable/single/index.js +444 -0
- package/dist/components/resizable/types.js +18 -0
- package/dist/components/resizable/utils.js +53 -0
- package/dist/components/scroll-list/constants.js +11 -0
- package/dist/components/scroll-list/item-foundation.d.ts +57 -0
- package/dist/components/scroll-list/item-foundation.js +331 -0
- package/dist/components/scroll-list/scroll-list.scss +198 -0
- package/dist/components/scroll-list/scroll-to.js +15 -0
- package/dist/components/select/combobox-name.js +21 -0
- package/dist/components/select/constants.js +22 -0
- package/dist/components/select/foundation.d.ts +135 -0
- package/dist/components/select/foundation.js +752 -0
- package/dist/components/select/option-foundation.js +35 -0
- package/dist/components/select/option.css +67 -0
- package/dist/components/select/select.scss +554 -0
- package/dist/components/side-sheet/constants.js +5 -0
- package/dist/components/side-sheet/side-sheet-foundation.d.ts +80 -0
- package/dist/components/side-sheet/side-sheet-foundation.js +109 -0
- package/dist/components/skeleton/constants.js +4 -0
- package/dist/components/slider/constants.js +12 -0
- package/dist/components/slider/foundation.d.ts +163 -0
- package/dist/components/slider/foundation.js +444 -0
- package/dist/components/slider/variables.scss +63 -0
- package/dist/components/sortable/accessibility.d.ts +14 -0
- package/dist/components/sortable/accessibility.js +49 -0
- package/dist/components/space/constants.js +9 -0
- package/dist/components/spin/constants.js +3 -0
- package/dist/components/spin/foundation.d.ts +22 -0
- package/dist/components/spin/foundation.js +46 -0
- package/dist/components/spin/spin.scss +111 -0
- package/dist/components/steps/bacis-steps.css +234 -0
- package/dist/components/steps/constants.js +8 -0
- package/dist/components/steps/fill-steps.css +141 -0
- package/dist/components/steps/nav-steps.css +48 -0
- package/dist/components/steps/steps.scss +17 -0
- package/dist/components/steps/utils.js +15 -0
- package/dist/components/switch/constants.js +16 -0
- package/dist/components/switch/foundation.d.ts +23 -0
- package/dist/components/switch/foundation.js +20 -0
- package/dist/components/switch/variables.scss +71 -0
- package/dist/components/table/constants.d.ts +76 -0
- package/dist/components/table/constants.js +111 -0
- package/dist/components/table/foundation.d.ts +356 -0
- package/dist/components/table/foundation.js +1001 -0
- package/dist/components/table/operation-panel.css +29 -0
- package/dist/components/table/table.css +636 -0
- package/dist/components/table/table.scss +788 -0
- package/dist/components/table/utils.d.ts +216 -0
- package/dist/components/table/utils.js +516 -0
- package/dist/components/table/variables.scss +81 -0
- package/dist/components/tabs/constants.d.ts +32 -0
- package/dist/components/tabs/constants.js +39 -0
- package/dist/components/tabs/foundation.d.ts +87 -0
- package/dist/components/tabs/foundation.js +190 -0
- package/dist/components/tabs/tabs.scss +933 -0
- package/dist/components/tabs/variables.scss +155 -0
- package/dist/components/tag/constants.js +35 -0
- package/dist/components/tag/focus.js +22 -0
- package/dist/components/tag/mixin.scss +19 -0
- package/dist/components/tag/tag-key.js +18 -0
- package/dist/components/tag/tag.css +537 -0
- package/dist/components/tag/variables.scss +85 -0
- package/dist/components/tag-input/constants.js +9 -0
- package/dist/components/tag-input/foundation.d.ts +94 -0
- package/dist/components/tag-input/foundation.js +247 -0
- package/dist/components/tag-input/tag-input.scss +357 -0
- package/dist/components/tag-input/utils/get-splited-array.js +16 -0
- package/dist/components/tag-input/utils/tag-focus.js +14 -0
- package/dist/components/time-picker/combox-foundation.d.ts +64 -0
- package/dist/components/time-picker/combox-foundation.js +96 -0
- package/dist/components/time-picker/constants.js +23 -0
- package/dist/components/time-picker/foundation.d.ts +91 -0
- package/dist/components/time-picker/foundation.js +272 -0
- package/dist/components/time-picker/input-foundation.d.ts +18 -0
- package/dist/components/time-picker/input-foundation.js +35 -0
- package/dist/components/time-picker/utils/index.js +57 -0
- package/dist/components/timeline/constants.js +7 -0
- package/dist/components/timeline/timeline.scss +190 -0
- package/dist/components/timeline/utils.js +10 -0
- package/dist/components/toast/constants.js +34 -0
- package/dist/components/toast/toast-api-foundation.d.ts +26 -0
- package/dist/components/toast/toast-api-foundation.js +49 -0
- package/dist/components/toast/toast-foundation.d.ts +37 -0
- package/dist/components/toast/toast-foundation.js +5 -0
- package/dist/components/toast/toast-list-foundation.d.ts +31 -0
- package/dist/components/toast/toast-list-foundation.js +76 -0
- package/dist/components/tooltip/adjust-position.js +202 -0
- package/dist/components/tooltip/arrow.css +1 -0
- package/dist/components/tooltip/constants.d.ts +53 -0
- package/dist/components/tooltip/constants.js +99 -0
- package/dist/components/tooltip/foundation.d.ts +116 -0
- package/dist/components/tooltip/foundation.js +750 -0
- package/dist/components/tooltip/position.css +10 -0
- package/dist/components/tooltip/tooltip.scss +72 -0
- package/dist/components/transfer/constants.js +10 -0
- package/dist/components/transfer/foundation.d.ts +130 -0
- package/dist/components/transfer/foundation.js +241 -0
- package/dist/components/transfer/transfer-utils.js +45 -0
- package/dist/components/transfer/transfer.scss +260 -0
- package/dist/components/tree/constants.js +8 -0
- package/dist/components/tree/foundation.d.ts +283 -0
- package/dist/components/tree/foundation.js +341 -0
- package/dist/components/tree/shared.d.ts +208 -0
- package/dist/components/tree/shared.js +564 -0
- package/dist/components/tree/tree-util.d.ts +100 -0
- package/dist/components/tree/tree-util.js +447 -0
- package/dist/components/tree/tree.scss +439 -0
- package/dist/components/tree-select/constants.js +19 -0
- package/dist/components/tree-select/foundation.d.ts +161 -0
- package/dist/components/tree-select/foundation.js +427 -0
- package/dist/components/tree-select/tree-select.scss +467 -0
- package/dist/components/typography/constants.js +50 -0
- package/dist/components/typography/ellipsis.js +154 -0
- package/dist/components/typography/format-numeral.js +99 -0
- package/dist/components/typography/typography.scss +383 -0
- package/dist/components/upload/constants.d.ts +24 -0
- package/dist/components/upload/constants.js +39 -0
- package/dist/components/upload/foundation.d.ts +180 -0
- package/dist/components/upload/foundation.js +763 -0
- package/dist/components/upload/upload.scss +640 -0
- package/dist/components/upload/utils.d.ts +25 -0
- package/dist/components/upload/utils.js +102 -0
- package/dist/components/user-guide/constants.js +12 -0
- package/dist/components/user-guide/foundation.d.ts +72 -0
- package/dist/components/user-guide/foundation.js +121 -0
- package/dist/components/video-player/constants.js +48 -0
- package/dist/components/video-player/foundation.d.ts +89 -0
- package/dist/components/video-player/foundation.js +316 -0
- package/dist/components/video-player/progress-foundation.d.ts +48 -0
- package/dist/components/video-player/progress-foundation.js +91 -0
- package/dist/components/video-player/seek-foundation.d.ts +49 -0
- package/dist/components/video-player/seek-foundation.js +52 -0
- package/dist/components/video-player/utils.js +58 -0
- package/dist/components/video-player/video-player.scss +344 -0
- package/dist/locale/format.d.ts +5 -0
- package/dist/locale/format.js +9 -0
- package/dist/locale/interface.d.ts +18 -0
- package/dist/locale/source/ar.js +19 -1
- package/dist/locale/source/az.js +19 -1
- package/dist/locale/source/bg.js +19 -1
- package/dist/locale/source/bn_IN.js +19 -1
- package/dist/locale/source/ca.js +19 -1
- package/dist/locale/source/ceb_PH.js +19 -1
- package/dist/locale/source/cs_CZ.js +19 -1
- package/dist/locale/source/da.js +19 -1
- package/dist/locale/source/de.js +19 -1
- package/dist/locale/source/el_GR.js +19 -1
- package/dist/locale/source/en_GB.js +19 -1
- package/dist/locale/source/en_US.js +19 -1
- package/dist/locale/source/es.js +19 -1
- package/dist/locale/source/es_419.js +19 -1
- package/dist/locale/source/et.js +19 -1
- package/dist/locale/source/fa_IR.js +19 -1
- package/dist/locale/source/fi_FI.js +19 -1
- package/dist/locale/source/fil_PH.js +19 -1
- package/dist/locale/source/fr.js +19 -1
- package/dist/locale/source/fr_CA.js +19 -1
- package/dist/locale/source/ga.js +19 -1
- package/dist/locale/source/he_IL.js +19 -1
- package/dist/locale/source/hi_IN.js +19 -1
- package/dist/locale/source/hr.js +19 -1
- package/dist/locale/source/hu_HU.js +19 -1
- package/dist/locale/source/id_ID.js +19 -1
- package/dist/locale/source/is.js +19 -1
- package/dist/locale/source/it.js +19 -1
- package/dist/locale/source/ja_JP.js +19 -1
- package/dist/locale/source/jv_ID.js +19 -1
- package/dist/locale/source/kk.js +19 -1
- package/dist/locale/source/km_KH.js +19 -1
- package/dist/locale/source/ko_KR.js +19 -1
- package/dist/locale/source/lt.js +19 -1
- package/dist/locale/source/lv.js +19 -1
- package/dist/locale/source/ms_MY.js +19 -1
- package/dist/locale/source/my_MM.js +19 -1
- package/dist/locale/source/nb.js +19 -1
- package/dist/locale/source/nl_NL.js +19 -1
- package/dist/locale/source/pl_PL.js +19 -1
- package/dist/locale/source/pt.js +19 -1
- package/dist/locale/source/pt_BR.js +19 -1
- package/dist/locale/source/ro.js +19 -1
- package/dist/locale/source/ru_RU.js +19 -1
- package/dist/locale/source/sk.js +19 -1
- package/dist/locale/source/sl.js +19 -1
- package/dist/locale/source/sq.js +19 -1
- package/dist/locale/source/sv_SE.js +19 -1
- package/dist/locale/source/sw.js +19 -1
- package/dist/locale/source/th_TH.js +19 -1
- package/dist/locale/source/tr_TR.js +19 -1
- package/dist/locale/source/uk_UA.js +19 -1
- package/dist/locale/source/ur.js +19 -1
- package/dist/locale/source/uz.js +19 -1
- package/dist/locale/source/vi_VN.js +19 -1
- package/dist/locale/source/zh_CN.js +19 -1
- package/dist/locale/source/zh_TW.js +19 -1
- package/dist/theme/global.scss +36 -36
- package/dist/utils/a11y.d.ts +11 -3
- package/dist/utils/a11y.js +25 -5
- package/dist/utils/date-fns-extra.d.ts +3 -1
- package/dist/utils/date-fns-extra.js +8 -3
- package/dist/utils/dom.d.ts +0 -2
- package/dist/utils/dom.js +1 -4
- package/dist/utils/focus-handover.js +1 -1
- package/package.json +2 -3
- package/dist/anchor/constants.d.ts +0 -9
- package/dist/anchor/constants.js +0 -14
- package/dist/anchor/foundation.d.ts +0 -46
- package/dist/anchor/foundation.js +0 -142
- package/dist/anchor/utils.js +0 -16
- package/dist/anchor/variables.scss +0 -34
- package/dist/audio-player/audio-player.css +0 -226
- package/dist/audio-player/audio-player.scss +0 -278
- package/dist/audio-player/constants.js +0 -27
- package/dist/audio-player/foundation.d.ts +0 -43
- package/dist/audio-player/foundation.js +0 -115
- package/dist/audio-player/utils.js +0 -6
- package/dist/audio-player/variables.scss +0 -53
- package/dist/auto-complete/constants.js +0 -7
- package/dist/auto-complete/foundation.d.ts +0 -75
- package/dist/auto-complete/foundation.js +0 -218
- package/dist/avatar/constants.js +0 -13
- package/dist/avatar/foundation.d.ts +0 -28
- package/dist/avatar/foundation.js +0 -31
- package/dist/avatar/variables.scss +0 -112
- package/dist/backtop/constants.js +0 -35
- package/dist/backtop/foundation.d.ts +0 -23
- package/dist/backtop/foundation.js +0 -68
- package/dist/badge/constants.js +0 -4
- package/dist/banner/constants.js +0 -4
- package/dist/banner/foundation.d.ts +0 -9
- package/dist/banner/foundation.js +0 -9
- package/dist/breadcrumb/breadcrumb.scss +0 -116
- package/dist/breadcrumb/constants.js +0 -8
- package/dist/breadcrumb/foundation.d.ts +0 -37
- package/dist/breadcrumb/foundation.js +0 -60
- package/dist/breadcrumb/item-foundation.d.ts +0 -45
- package/dist/breadcrumb/item-foundation.js +0 -36
- package/dist/button/constants.js +0 -5
- package/dist/button/utils.d.ts +0 -27
- package/dist/button/utils.js +0 -89
- package/dist/button/variables.scss +0 -169
- package/dist/calendar/calendar.css +0 -486
- package/dist/calendar/calendar.scss +0 -518
- package/dist/calendar/constants.js +0 -14
- package/dist/calendar/event-util.js +0 -193
- package/dist/calendar/foundation.d.ts +0 -75
- package/dist/calendar/foundation.js +0 -194
- package/dist/calendar/month-foundation.d.ts +0 -10
- package/dist/calendar/month-foundation.js +0 -12
- package/dist/card/constants.js +0 -4
- package/dist/carousel/carousel.css +0 -345
- package/dist/carousel/carousel.scss +0 -451
- package/dist/carousel/constants.js +0 -42
- package/dist/carousel/foundation.d.ts +0 -59
- package/dist/carousel/foundation.js +0 -204
- package/dist/carousel/variables.scss +0 -49
- package/dist/cascader/cascader.scss +0 -586
- package/dist/cascader/constants.js +0 -20
- package/dist/cascader/foundation.d.ts +0 -304
- package/dist/cascader/foundation.js +0 -906
- package/dist/cascader/util.js +0 -148
- package/dist/checkbox/checkbox-foundation.d.ts +0 -93
- package/dist/checkbox/checkbox-foundation.js +0 -63
- package/dist/checkbox/checkbox-group-foundation.d.ts +0 -20
- package/dist/checkbox/checkbox-group-foundation.js +0 -28
- package/dist/checkbox/constants.js +0 -15
- package/dist/checkbox/variables.scss +0 -72
- package/dist/code-highlight/constants.js +0 -4
- package/dist/code-highlight/highlighter.js +0 -56
- package/dist/code-highlight/index.d.ts +0 -24
- package/dist/code-highlight/index.js +0 -19
- package/dist/code-highlight/registry.js +0 -33
- package/dist/collapse/collapse.scss +0 -112
- package/dist/collapse/constants.js +0 -4
- package/dist/collapse/foundation.d.ts +0 -47
- package/dist/collapse/foundation.js +0 -44
- package/dist/collapsible/constants.js +0 -4
- package/dist/collapsible/foundation.d.ts +0 -68
- package/dist/collapsible/foundation.js +0 -123
- package/dist/color-picker/alpha-slider-foundation.d.ts +0 -27
- package/dist/color-picker/alpha-slider-foundation.js +0 -41
- package/dist/color-picker/color-choose-area-foundation.d.ts +0 -33
- package/dist/color-picker/color-choose-area-foundation.js +0 -57
- package/dist/color-picker/color-picker.scss +0 -129
- package/dist/color-picker/color-slider-foundation.d.ts +0 -27
- package/dist/color-picker/color-slider-foundation.js +0 -41
- package/dist/color-picker/constants.js +0 -4
- package/dist/color-picker/data-part-foundation.d.ts +0 -28
- package/dist/color-picker/data-part-foundation.js +0 -76
- package/dist/color-picker/foundation.d.ts +0 -56
- package/dist/color-picker/foundation.js +0 -149
- package/dist/color-picker/utils/convert.d.ts +0 -16
- package/dist/color-picker/utils/convert.js +0 -150
- package/dist/color-picker/utils/round.js +0 -5
- package/dist/color-picker/utils/split.js +0 -26
- package/dist/config-provider/breakpoint-observer.js +0 -139
- package/dist/config-provider/inherit-config.d.ts +0 -24
- package/dist/config-provider/inherit-config.js +0 -24
- package/dist/cropper/constants.js +0 -37
- package/dist/cropper/cropper.scss +0 -129
- package/dist/cropper/foundation.d.ts +0 -90
- package/dist/cropper/foundation.js +0 -806
- package/dist/cropper/utils.js +0 -23
- package/dist/date-picker/_utils/formatter.js +0 -21
- package/dist/date-picker/_utils/get-day-of-week.js +0 -14
- package/dist/date-picker/_utils/get-default-format-token.js +0 -18
- package/dist/date-picker/_utils/get-default-picker-date.js +0 -35
- package/dist/date-picker/_utils/get-full-date-offset.js +0 -11
- package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -33
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -57
- package/dist/date-picker/_utils/get-month-table.js +0 -33
- package/dist/date-picker/_utils/get-year-and-month.js +0 -18
- package/dist/date-picker/_utils/get-year-month-from-value.js +0 -18
- package/dist/date-picker/_utils/get-years.js +0 -9
- package/dist/date-picker/_utils/index.d.ts +0 -11
- package/dist/date-picker/_utils/index.js +0 -11
- package/dist/date-picker/_utils/is-after.js +0 -7
- package/dist/date-picker/_utils/is-before.js +0 -7
- package/dist/date-picker/_utils/is-between.js +0 -11
- package/dist/date-picker/_utils/is-same-day.js +0 -7
- package/dist/date-picker/_utils/is-timestamp.js +0 -6
- package/dist/date-picker/_utils/is-valid-date.js +0 -5
- package/dist/date-picker/_utils/parser.js +0 -17
- package/dist/date-picker/_utils/picker-type.js +0 -28
- package/dist/date-picker/_utils/to-callback-args.js +0 -46
- package/dist/date-picker/_utils/to-date-arg.js +0 -13
- package/dist/date-picker/constants.js +0 -78
- package/dist/date-picker/date-picker.scss +0 -1762
- package/dist/date-picker/foundation.d.ts +0 -317
- package/dist/date-picker/foundation.js +0 -709
- package/dist/date-picker/input-foundation.d.ts +0 -138
- package/dist/date-picker/input-foundation.js +0 -212
- package/dist/date-picker/month-foundation.d.ts +0 -154
- package/dist/date-picker/month-foundation.js +0 -186
- package/dist/date-picker/months-grid-foundation.d.ts +0 -171
- package/dist/date-picker/months-grid-foundation.js +0 -547
- package/dist/date-picker/year-and-month-foundation.d.ts +0 -75
- package/dist/date-picker/year-and-month-foundation.js +0 -115
- package/dist/descriptions/constants.js +0 -4
- package/dist/descriptions/foundation.d.ts +0 -12
- package/dist/descriptions/foundation.js +0 -36
- package/dist/divider/constants.js +0 -4
- package/dist/drag-move/foundation.d.ts +0 -30
- package/dist/drag-move/foundation.js +0 -180
- package/dist/dropdown/constants.js +0 -12
- package/dist/dropdown/foundation.d.ts +0 -38
- package/dist/dropdown/foundation.js +0 -124
- package/dist/dropdown/menu-foundation.d.ts +0 -35
- package/dist/dropdown/menu-foundation.js +0 -82
- package/dist/empty/constants.js +0 -5
- package/dist/feedback/constants.js +0 -19
- package/dist/feedback/feedback.scss +0 -153
- package/dist/feedback/foundation.d.ts +0 -42
- package/dist/feedback/foundation.js +0 -72
- package/dist/float-button/constants.js +0 -13
- package/dist/float-button/float-button.scss +0 -201
- package/dist/form/constants.d.ts +0 -7
- package/dist/form/constants.js +0 -8
- package/dist/form/field-store.js +0 -28
- package/dist/form/form-api-proxy.d.ts +0 -14
- package/dist/form/form-api-proxy.js +0 -48
- package/dist/form/form.css +0 -229
- package/dist/form/form.scss +0 -295
- package/dist/form/foundation.d.ts +0 -65
- package/dist/form/foundation.js +0 -820
- package/dist/form/interface.d.ts +0 -158
- package/dist/form/rtl.scss +0 -13
- package/dist/form/utils.d.ts +0 -81
- package/dist/form/utils.js +0 -108
- package/dist/form/variables.scss +0 -50
- package/dist/grid/constants.js +0 -12
- package/dist/grid/gutter.js +0 -39
- package/dist/grid/utils.js +0 -39
- package/dist/highlight/constants.js +0 -4
- package/dist/highlight/foundation.js +0 -108
- package/dist/hot-keys/constants.js +0 -207
- package/dist/hot-keys/foundation.d.ts +0 -18
- package/dist/hot-keys/foundation.js +0 -92
- package/dist/image/constants.js +0 -5
- package/dist/image/image-foundation.d.ts +0 -28
- package/dist/image/image-foundation.js +0 -40
- package/dist/image/image.scss +0 -272
- package/dist/image/preview-footer-foundation.d.ts +0 -25
- package/dist/image/preview-footer-foundation.js +0 -30
- package/dist/image/preview-foundation.d.ts +0 -48
- package/dist/image/preview-foundation.js +0 -71
- package/dist/image/preview-image-foundation.d.ts +0 -67
- package/dist/image/preview-image-foundation.js +0 -226
- package/dist/image/preview-inner-foundation.d.ts +0 -86
- package/dist/image/preview-inner-foundation.js +0 -238
- package/dist/image/utils.js +0 -66
- package/dist/input/constants.d.ts +0 -9
- package/dist/input/constants.js +0 -14
- package/dist/input/foundation.d.ts +0 -50
- package/dist/input/foundation.js +0 -77
- package/dist/input/input.css +0 -616
- package/dist/input/input.scss +0 -738
- package/dist/input/text-entry-foundation.d.ts +0 -53
- package/dist/input/text-entry-foundation.js +0 -92
- package/dist/input/textarea-foundation.d.ts +0 -60
- package/dist/input/textarea-foundation.js +0 -130
- package/dist/input/textarea.css +0 -257
- package/dist/input/textarea.scss +0 -313
- package/dist/input/util/line-number.js +0 -42
- package/dist/input/util/truncate-value.js +0 -14
- package/dist/input/variables.scss +0 -107
- package/dist/input-number/caret.js +0 -20
- package/dist/input-number/constants.d.ts +0 -15
- package/dist/input-number/constants.js +0 -13
- package/dist/input-number/foundation.d.ts +0 -107
- package/dist/input-number/foundation.js +0 -553
- package/dist/json-viewer/constants.js +0 -4
- package/dist/json-viewer/foundation.d.ts +0 -40
- package/dist/json-viewer/foundation.js +0 -123
- package/dist/json-viewer/json-viewer.scss +0 -224
- package/dist/layout/constants.js +0 -4
- package/dist/list/constants.js +0 -4
- package/dist/list/list.scss +0 -162
- package/dist/lottie/constants.js +0 -4
- package/dist/lottie/foundation.d.ts +0 -24
- package/dist/lottie/foundation.js +0 -62
- package/dist/markdown-render/constants.js +0 -4
- package/dist/markdown-render/foundation.d.ts +0 -45
- package/dist/markdown-render/foundation.js +0 -97
- package/dist/modal/confirm.js +0 -34
- package/dist/modal/constants.js +0 -4
- package/dist/modal/modal-content-foundation.d.ts +0 -40
- package/dist/modal/modal-content-foundation.js +0 -48
- package/dist/modal/modal-foundation.d.ts +0 -85
- package/dist/modal/modal-foundation.js +0 -74
- package/dist/navigation/constants.js +0 -20
- package/dist/navigation/foundation.d.ts +0 -68
- package/dist/navigation/foundation.js +0 -152
- package/dist/navigation/item-foundation.d.ts +0 -44
- package/dist/navigation/item-foundation.js +0 -42
- package/dist/navigation/navigation.scss +0 -764
- package/dist/navigation/sub-nav-foundation.d.ts +0 -30
- package/dist/navigation/sub-nav-foundation.js +0 -54
- package/dist/navigation/variables.scss +0 -120
- package/dist/notification/constants.js +0 -32
- package/dist/notification/notification-foundation.d.ts +0 -33
- package/dist/notification/notification-foundation.js +0 -5
- package/dist/notification/notification-list-foundation.d.ts +0 -55
- package/dist/notification/notification-list-foundation.js +0 -48
- package/dist/overflow-list/constants.d.ts +0 -17
- package/dist/overflow-list/constants.js +0 -16
- package/dist/overflow-list/foundation.d.ts +0 -76
- package/dist/overflow-list/foundation.js +0 -188
- package/dist/pagination/constants.js +0 -14
- package/dist/pagination/foundation.d.ts +0 -59
- package/dist/pagination/foundation.js +0 -175
- package/dist/pagination/pagination.scss +0 -189
- package/dist/pincode/constants.js +0 -4
- package/dist/pincode/foundation.d.ts +0 -36
- package/dist/pincode/foundation.js +0 -83
- package/dist/popconfirm/constants.d.ts +0 -7
- package/dist/popconfirm/constants.js +0 -8
- package/dist/popconfirm/popconfirm-foundation.d.ts +0 -36
- package/dist/popconfirm/popconfirm-foundation.js +0 -57
- package/dist/popover/constants.js +0 -47
- package/dist/progress/constants.js +0 -8
- package/dist/progress/generates.js +0 -24
- package/dist/progress/utils.js +0 -45
- package/dist/radio/constants.js +0 -19
- package/dist/radio/radio-foundation.d.ts +0 -74
- package/dist/radio/radio-foundation.js +0 -93
- package/dist/radio/radio-group-foundation.d.ts +0 -17
- package/dist/radio/radio-group-foundation.js +0 -27
- package/dist/radio/variables.scss +0 -107
- package/dist/rating/constants.js +0 -5
- package/dist/rating/foundation.d.ts +0 -104
- package/dist/rating/foundation.js +0 -164
- package/dist/rating/variables.scss +0 -19
- package/dist/resizable/constants.js +0 -4
- package/dist/resizable/foundation.d.ts +0 -3
- package/dist/resizable/group/index.d.ts +0 -51
- package/dist/resizable/group/index.js +0 -309
- package/dist/resizable/resizable.scss +0 -146
- package/dist/resizable/single/index.d.ts +0 -86
- package/dist/resizable/single/index.js +0 -426
- package/dist/resizable/types.js +0 -18
- package/dist/resizable/utils.js +0 -53
- package/dist/scroll-list/constants.js +0 -11
- package/dist/scroll-list/item-foundation.d.ts +0 -54
- package/dist/scroll-list/item-foundation.js +0 -335
- package/dist/scroll-list/scroll-list.scss +0 -198
- package/dist/scroll-list/scroll-to.js +0 -15
- package/dist/select/combobox-name.js +0 -21
- package/dist/select/constants.js +0 -22
- package/dist/select/foundation.d.ts +0 -125
- package/dist/select/foundation.js +0 -710
- package/dist/select/option-foundation.js +0 -35
- package/dist/select/select.scss +0 -554
- package/dist/side-sheet/constants.js +0 -5
- package/dist/side-sheet/side-sheet-foundation.d.ts +0 -64
- package/dist/side-sheet/side-sheet-foundation.js +0 -50
- package/dist/skeleton/constants.js +0 -4
- package/dist/slider/constants.js +0 -12
- package/dist/slider/foundation.d.ts +0 -156
- package/dist/slider/foundation.js +0 -429
- package/dist/slider/variables.scss +0 -63
- package/dist/sortable/accessibility.d.ts +0 -14
- package/dist/sortable/accessibility.js +0 -45
- package/dist/space/constants.js +0 -9
- package/dist/spin/constants.js +0 -3
- package/dist/spin/foundation.d.ts +0 -18
- package/dist/spin/foundation.js +0 -42
- package/dist/spin/spin.scss +0 -111
- package/dist/steps/constants.js +0 -8
- package/dist/steps/steps.scss +0 -17
- package/dist/steps/utils.js +0 -15
- package/dist/switch/constants.js +0 -16
- package/dist/switch/foundation.d.ts +0 -23
- package/dist/switch/foundation.js +0 -19
- package/dist/switch/variables.scss +0 -71
- package/dist/table/constants.d.ts +0 -62
- package/dist/table/constants.js +0 -97
- package/dist/table/foundation.d.ts +0 -345
- package/dist/table/foundation.js +0 -906
- package/dist/table/table.css +0 -636
- package/dist/table/table.scss +0 -788
- package/dist/table/utils.d.ts +0 -179
- package/dist/table/utils.js +0 -469
- package/dist/table/variables.scss +0 -81
- package/dist/tabs/constants.d.ts +0 -28
- package/dist/tabs/constants.js +0 -37
- package/dist/tabs/foundation.d.ts +0 -82
- package/dist/tabs/foundation.js +0 -185
- package/dist/tabs/tabs.scss +0 -933
- package/dist/tabs/variables.scss +0 -155
- package/dist/tag/constants.js +0 -35
- package/dist/tag/focus.js +0 -22
- package/dist/tag/mixin.scss +0 -18
- package/dist/tag/tag-key.js +0 -18
- package/dist/tag/tag.css +0 -537
- package/dist/tag/variables.scss +0 -85
- package/dist/tag-input/constants.js +0 -9
- package/dist/tag-input/foundation.d.ts +0 -89
- package/dist/tag-input/foundation.js +0 -221
- package/dist/tag-input/tag-input.scss +0 -357
- package/dist/tag-input/utils/get-splited-array.js +0 -16
- package/dist/tag-input/utils/tag-focus.js +0 -14
- package/dist/time-picker/combox-foundation.d.ts +0 -71
- package/dist/time-picker/combox-foundation.js +0 -96
- package/dist/time-picker/constants.js +0 -23
- package/dist/time-picker/foundation.d.ts +0 -98
- package/dist/time-picker/foundation.js +0 -245
- package/dist/time-picker/input-foundation.d.ts +0 -15
- package/dist/time-picker/input-foundation.js +0 -33
- package/dist/time-picker/utils/index.js +0 -57
- package/dist/timeline/constants.js +0 -7
- package/dist/timeline/timeline.scss +0 -190
- package/dist/timeline/utils.js +0 -10
- package/dist/toast/constants.js +0 -34
- package/dist/toast/toast-foundation.d.ts +0 -37
- package/dist/toast/toast-foundation.js +0 -5
- package/dist/toast/toast-list-foundation.d.ts +0 -25
- package/dist/toast/toast-list-foundation.js +0 -54
- package/dist/tooltip/adjust-position.js +0 -202
- package/dist/tooltip/constants.d.ts +0 -47
- package/dist/tooltip/constants.js +0 -93
- package/dist/tooltip/foundation.d.ts +0 -102
- package/dist/tooltip/foundation.js +0 -654
- package/dist/tooltip/tooltip.scss +0 -72
- package/dist/transfer/constants.js +0 -10
- package/dist/transfer/foundation.d.ts +0 -121
- package/dist/transfer/foundation.js +0 -193
- package/dist/transfer/transfer-utils.js +0 -45
- package/dist/transfer/transfer.scss +0 -260
- package/dist/tree/constants.js +0 -8
- package/dist/tree/foundation.d.ts +0 -294
- package/dist/tree/foundation.js +0 -538
- package/dist/tree/shared.d.ts +0 -126
- package/dist/tree/shared.js +0 -306
- package/dist/tree/tree-util.d.ts +0 -100
- package/dist/tree/tree-util.js +0 -450
- package/dist/tree/tree.scss +0 -439
- package/dist/tree-select/constants.js +0 -19
- package/dist/tree-select/foundation.d.ts +0 -180
- package/dist/tree-select/foundation.js +0 -615
- package/dist/tree-select/tree-select.scss +0 -467
- package/dist/typography/constants.js +0 -50
- package/dist/typography/ellipsis.js +0 -154
- package/dist/typography/format-numeral.js +0 -99
- package/dist/typography/typography.scss +0 -383
- package/dist/upload/constants.d.ts +0 -24
- package/dist/upload/constants.js +0 -39
- package/dist/upload/foundation.d.ts +0 -181
- package/dist/upload/foundation.js +0 -752
- package/dist/upload/upload.scss +0 -640
- package/dist/upload/utils.d.ts +0 -20
- package/dist/upload/utils.js +0 -93
- package/dist/user-guide/constants.js +0 -12
- package/dist/user-guide/foundation.d.ts +0 -45
- package/dist/user-guide/foundation.js +0 -73
- package/dist/utils/focus-handle.d.ts +0 -43
- package/dist/utils/focus-handle.js +0 -91
- package/dist/utils/focus-scope.js +0 -77
- package/dist/utils/release-holder.js +0 -18
- package/dist/video-player/constants.js +0 -48
- package/dist/video-player/foundation.d.ts +0 -94
- package/dist/video-player/foundation.js +0 -287
- package/dist/video-player/progress-foundation.d.ts +0 -79
- package/dist/video-player/progress-foundation.js +0 -116
- package/dist/video-player/utils.js +0 -50
- package/dist/video-player/video-player.scss +0 -344
- /package/dist/{utils → base}/focus-scope.d.ts +0 -0
- /package/dist/{utils → base}/release-holder.d.ts +0 -0
- /package/dist/{anchor → components/anchor}/anchor.css +0 -0
- /package/dist/{anchor → components/anchor}/anchor.scss +0 -0
- /package/dist/{anchor → components/anchor}/animation.scss +0 -0
- /package/dist/{anchor → components/anchor}/rtl.scss +0 -0
- /package/dist/{anchor → components/anchor}/utils.d.ts +0 -0
- /package/dist/{audio-player → components/audio-player}/constants.d.ts +0 -0
- /package/dist/{audio-player → components/audio-player}/utils.d.ts +0 -0
- /package/dist/{auto-complete → components/auto-complete}/animation.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/auto-complete.css +0 -0
- /package/dist/{auto-complete → components/auto-complete}/auto-complete.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/constants.d.ts +0 -0
- /package/dist/{auto-complete → components/auto-complete}/option.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/rtl.scss +0 -0
- /package/dist/{auto-complete → components/auto-complete}/variables.scss +0 -0
- /package/dist/{avatar → components/avatar}/animation.scss +0 -0
- /package/dist/{avatar → components/avatar}/avatar.css +0 -0
- /package/dist/{avatar → components/avatar}/avatar.scss +0 -0
- /package/dist/{avatar → components/avatar}/constants.d.ts +0 -0
- /package/dist/{avatar → components/avatar}/mixin.scss +0 -0
- /package/dist/{avatar → components/avatar}/rtl.scss +0 -0
- /package/dist/{backtop → components/backtop}/backtop.css +0 -0
- /package/dist/{backtop → components/backtop}/backtop.scss +0 -0
- /package/dist/{backtop → components/backtop}/constants.d.ts +0 -0
- /package/dist/{backtop → components/backtop}/rtl.scss +0 -0
- /package/dist/{backtop → components/backtop}/variables.scss +0 -0
- /package/dist/{badge → components/badge}/badge.css +0 -0
- /package/dist/{badge → components/badge}/badge.scss +0 -0
- /package/dist/{badge → components/badge}/constants.d.ts +0 -0
- /package/dist/{badge → components/badge}/rtl.scss +0 -0
- /package/dist/{badge → components/badge}/variables.scss +0 -0
- /package/dist/{banner → components/banner}/banner.css +0 -0
- /package/dist/{banner → components/banner}/banner.scss +0 -0
- /package/dist/{banner → components/banner}/constants.d.ts +0 -0
- /package/dist/{banner → components/banner}/rtl.scss +0 -0
- /package/dist/{banner → components/banner}/variables.scss +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/animation.scss +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/breadcrumb.css +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/constants.d.ts +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/rtl.scss +0 -0
- /package/dist/{breadcrumb → components/breadcrumb}/variables.scss +0 -0
- /package/dist/{button → components/button}/animation.scss +0 -0
- /package/dist/{button → components/button}/button.css +0 -0
- /package/dist/{button → components/button}/button.scss +0 -0
- /package/dist/{button → components/button}/constants.d.ts +0 -0
- /package/dist/{button → components/button}/icon-button.css +0 -0
- /package/dist/{button → components/button}/icon-button.scss +0 -0
- /package/dist/{button → components/button}/rtl.scss +0 -0
- /package/dist/{button → components/button}/split-button-group.scss +0 -0
- /package/dist/{calendar → components/calendar}/constants.d.ts +0 -0
- /package/dist/{calendar → components/calendar}/event-util.d.ts +0 -0
- /package/dist/{calendar → components/calendar}/rtl.scss +0 -0
- /package/dist/{calendar → components/calendar}/variables.scss +0 -0
- /package/dist/{card → components/card}/card.css +0 -0
- /package/dist/{card → components/card}/card.scss +0 -0
- /package/dist/{card → components/card}/constants.d.ts +0 -0
- /package/dist/{card → components/card}/rtl.scss +0 -0
- /package/dist/{card → components/card}/variables.scss +0 -0
- /package/dist/{carousel → components/carousel}/animation.scss +0 -0
- /package/dist/{carousel → components/carousel}/constants.d.ts +0 -0
- /package/dist/{carousel → components/carousel}/rtl.scss +0 -0
- /package/dist/{cascader → components/cascader}/animation.scss +0 -0
- /package/dist/{cascader → components/cascader}/cascader.css +0 -0
- /package/dist/{cascader → components/cascader}/constants.d.ts +0 -0
- /package/dist/{cascader → components/cascader}/rtl.scss +0 -0
- /package/dist/{cascader → components/cascader}/util.d.ts +0 -0
- /package/dist/{cascader → components/cascader}/variables.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/animation.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/checkbox.css +0 -0
- /package/dist/{checkbox → components/checkbox}/checkbox.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/constants.d.ts +0 -0
- /package/dist/{checkbox → components/checkbox}/mixin.scss +0 -0
- /package/dist/{checkbox → components/checkbox}/rtl.scss +0 -0
- /package/dist/{code-highlight → components/code-highlight}/code-highlight.css +0 -0
- /package/dist/{code-highlight → components/code-highlight}/code-highlight.scss +0 -0
- /package/dist/{code-highlight → components/code-highlight}/constants.d.ts +0 -0
- /package/dist/{code-highlight → components/code-highlight}/highlighter.d.ts +0 -0
- /package/dist/{code-highlight → components/code-highlight}/registry.d.ts +0 -0
- /package/dist/{code-highlight → components/code-highlight}/variables.scss +0 -0
- /package/dist/{collapse → components/collapse}/collapse.css +0 -0
- /package/dist/{collapse → components/collapse}/constants.d.ts +0 -0
- /package/dist/{collapse → components/collapse}/rtl.scss +0 -0
- /package/dist/{collapse → components/collapse}/variables.scss +0 -0
- /package/dist/{collapsible → components/collapsible}/animation.scss +0 -0
- /package/dist/{collapsible → components/collapsible}/collapsible.css +0 -0
- /package/dist/{collapsible → components/collapsible}/collapsible.scss +0 -0
- /package/dist/{collapsible → components/collapsible}/constants.d.ts +0 -0
- /package/dist/{collapsible → components/collapsible}/variables.scss +0 -0
- /package/dist/{color-picker → components/color-picker}/color-picker.css +0 -0
- /package/dist/{color-picker → components/color-picker}/constants.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/interface.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/interface.js +0 -0
- /package/dist/{color-picker → components/color-picker}/utils/round.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/utils/split.d.ts +0 -0
- /package/dist/{color-picker → components/color-picker}/variables.scss +0 -0
- /package/dist/{config-provider → components/config-provider}/breakpoint-observer.d.ts +0 -0
- /package/dist/{config-provider → components/config-provider}/responsive-types.d.ts +0 -0
- /package/dist/{config-provider → components/config-provider}/responsive-types.js +0 -0
- /package/dist/{cropper → components/cropper}/constants.d.ts +0 -0
- /package/dist/{cropper → components/cropper}/cropper.css +0 -0
- /package/dist/{cropper → components/cropper}/utils.d.ts +0 -0
- /package/dist/{cropper → components/cropper}/variables.scss +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/formatter.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-day-of-week.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-default-format-token.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-default-picker-date.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-full-date-offset.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-inset-input-format-token.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-month-table.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-year-and-month.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-year-month-from-value.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/get-years.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-after.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-before.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-between.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-same-day.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-timestamp.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/is-valid-date.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/parser.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/picker-type.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/to-callback-args.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/_utils/to-date-arg.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/animation.scss +0 -0
- /package/dist/{date-picker → components/date-picker}/constants.d.ts +0 -0
- /package/dist/{date-picker → components/date-picker}/date-picker.css +0 -0
- /package/dist/{date-picker → components/date-picker}/rtl.scss +0 -0
- /package/dist/{date-picker → components/date-picker}/variables.scss +0 -0
- /package/dist/{descriptions → components/descriptions}/constants.d.ts +0 -0
- /package/dist/{descriptions → components/descriptions}/descriptions.css +0 -0
- /package/dist/{descriptions → components/descriptions}/descriptions.scss +0 -0
- /package/dist/{descriptions → components/descriptions}/rtl.scss +0 -0
- /package/dist/{descriptions → components/descriptions}/variables.scss +0 -0
- /package/dist/{divider → components/divider}/constants.d.ts +0 -0
- /package/dist/{divider → components/divider}/divider.css +0 -0
- /package/dist/{divider → components/divider}/divider.scss +0 -0
- /package/dist/{divider → components/divider}/variables.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/animation.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/constants.d.ts +0 -0
- /package/dist/{dropdown → components/dropdown}/dropdown.css +0 -0
- /package/dist/{dropdown → components/dropdown}/dropdown.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/rtl.scss +0 -0
- /package/dist/{dropdown → components/dropdown}/variables.scss +0 -0
- /package/dist/{empty → components/empty}/constants.d.ts +0 -0
- /package/dist/{empty → components/empty}/empty.css +0 -0
- /package/dist/{empty → components/empty}/empty.scss +0 -0
- /package/dist/{empty → components/empty}/rtl.scss +0 -0
- /package/dist/{empty → components/empty}/variables.scss +0 -0
- /package/dist/{feedback → components/feedback}/constants.d.ts +0 -0
- /package/dist/{feedback → components/feedback}/feedback.css +0 -0
- /package/dist/{feedback → components/feedback}/variables.scss +0 -0
- /package/dist/{float-button → components/float-button}/constants.d.ts +0 -0
- /package/dist/{float-button → components/float-button}/float-button.css +0 -0
- /package/dist/{float-button → components/float-button}/rtl.scss +0 -0
- /package/dist/{float-button → components/float-button}/variables.scss +0 -0
- /package/dist/{form → components/form}/field-store.d.ts +0 -0
- /package/dist/{form → components/form}/interface.js +0 -0
- /package/dist/{grid → components/grid}/constants.d.ts +0 -0
- /package/dist/{grid → components/grid}/grid.css +0 -0
- /package/dist/{grid → components/grid}/grid.scss +0 -0
- /package/dist/{grid → components/grid}/gutter.d.ts +0 -0
- /package/dist/{grid → components/grid}/mixin.scss +0 -0
- /package/dist/{grid → components/grid}/rtl.scss +0 -0
- /package/dist/{grid → components/grid}/utils.d.ts +0 -0
- /package/dist/{grid → components/grid}/variables.scss +0 -0
- /package/dist/{highlight → components/highlight}/constants.d.ts +0 -0
- /package/dist/{highlight → components/highlight}/foundation.d.ts +0 -0
- /package/dist/{highlight → components/highlight}/highlight.css +0 -0
- /package/dist/{highlight → components/highlight}/highlight.scss +0 -0
- /package/dist/{highlight → components/highlight}/variables.scss +0 -0
- /package/dist/{hot-keys → components/hot-keys}/constants.d.ts +0 -0
- /package/dist/{hot-keys → components/hot-keys}/hot-keys.css +0 -0
- /package/dist/{hot-keys → components/hot-keys}/hot-keys.scss +0 -0
- /package/dist/{hot-keys → components/hot-keys}/variables.scss +0 -0
- /package/dist/{image → components/image}/animation.scss +0 -0
- /package/dist/{image → components/image}/constants.d.ts +0 -0
- /package/dist/{image → components/image}/image.css +0 -0
- /package/dist/{image → components/image}/rtl.scss +0 -0
- /package/dist/{image → components/image}/utils.d.ts +0 -0
- /package/dist/{image → components/image}/variables.scss +0 -0
- /package/dist/{input → components/input}/animation.scss +0 -0
- /package/dist/{input → components/input}/rtl.scss +0 -0
- /package/dist/{input → components/input}/util/line-number.d.ts +0 -0
- /package/dist/{input → components/input}/util/truncate-value.d.ts +0 -0
- /package/dist/{input-number → components/input-number}/animation.scss +0 -0
- /package/dist/{input-number → components/input-number}/caret.d.ts +0 -0
- /package/dist/{input-number → components/input-number}/input-number.css +0 -0
- /package/dist/{input-number → components/input-number}/input-number.scss +0 -0
- /package/dist/{input-number → components/input-number}/rtl.scss +0 -0
- /package/dist/{input-number → components/input-number}/variables.scss +0 -0
- /package/dist/{json-viewer → components/json-viewer}/constants.d.ts +0 -0
- /package/dist/{json-viewer → components/json-viewer}/json-viewer.css +0 -0
- /package/dist/{json-viewer → components/json-viewer}/variables.scss +0 -0
- /package/dist/{layout → components/layout}/constants.d.ts +0 -0
- /package/dist/{layout → components/layout}/layout.css +0 -0
- /package/dist/{layout → components/layout}/layout.scss +0 -0
- /package/dist/{layout → components/layout}/rtl.scss +0 -0
- /package/dist/{list → components/list}/constants.d.ts +0 -0
- /package/dist/{list → components/list}/list.css +0 -0
- /package/dist/{list → components/list}/rtl.scss +0 -0
- /package/dist/{list → components/list}/variables.scss +0 -0
- /package/dist/{lottie → components/lottie}/constants.d.ts +0 -0
- /package/dist/{markdown-render → components/markdown-render}/constants.d.ts +0 -0
- /package/dist/{markdown-render → components/markdown-render}/markdown-render.css +0 -0
- /package/dist/{markdown-render → components/markdown-render}/markdown-render.scss +0 -0
- /package/dist/{markdown-render → components/markdown-render}/variables.scss +0 -0
- /package/dist/{modal → components/modal}/animation.scss +0 -0
- /package/dist/{modal → components/modal}/confirm.d.ts +0 -0
- /package/dist/{modal → components/modal}/constants.d.ts +0 -0
- /package/dist/{modal → components/modal}/modal.css +0 -0
- /package/dist/{modal → components/modal}/modal.scss +0 -0
- /package/dist/{modal → components/modal}/rtl.scss +0 -0
- /package/dist/{modal → components/modal}/variables.scss +0 -0
- /package/dist/{navigation → components/navigation}/animation.scss +0 -0
- /package/dist/{navigation → components/navigation}/constants.d.ts +0 -0
- /package/dist/{navigation → components/navigation}/mixin.scss +0 -0
- /package/dist/{navigation → components/navigation}/navigation.css +0 -0
- /package/dist/{navigation → components/navigation}/rtl.scss +0 -0
- /package/dist/{notification → components/notification}/animation.scss +0 -0
- /package/dist/{notification → components/notification}/constants.d.ts +0 -0
- /package/dist/{notification → components/notification}/notification.css +0 -0
- /package/dist/{notification → components/notification}/notification.scss +0 -0
- /package/dist/{notification → components/notification}/rtl.scss +0 -0
- /package/dist/{notification → components/notification}/variables.scss +0 -0
- /package/dist/{overflow-list → components/overflow-list}/overflow-list.css +0 -0
- /package/dist/{overflow-list → components/overflow-list}/overflow-list.scss +0 -0
- /package/dist/{overflow-list → components/overflow-list}/rtl.scss +0 -0
- /package/dist/{pagination → components/pagination}/animation.scss +0 -0
- /package/dist/{pagination → components/pagination}/constants.d.ts +0 -0
- /package/dist/{pagination → components/pagination}/pagination.css +0 -0
- /package/dist/{pagination → components/pagination}/rtl.scss +0 -0
- /package/dist/{pagination → components/pagination}/variables.scss +0 -0
- /package/dist/{pincode → components/pincode}/constants.d.ts +0 -0
- /package/dist/{pincode → components/pincode}/pincode.css +0 -0
- /package/dist/{pincode → components/pincode}/pincode.scss +0 -0
- /package/dist/{pincode → components/pincode}/variables.scss +0 -0
- /package/dist/{popconfirm → components/popconfirm}/popconfirm.css +0 -0
- /package/dist/{popconfirm → components/popconfirm}/popconfirm.scss +0 -0
- /package/dist/{popconfirm → components/popconfirm}/rtl.scss +0 -0
- /package/dist/{popconfirm → components/popconfirm}/variables.scss +0 -0
- /package/dist/{popover → components/popover}/animation.scss +0 -0
- /package/dist/{popover → components/popover}/constants.d.ts +0 -0
- /package/dist/{popover → components/popover}/popover.css +0 -0
- /package/dist/{popover → components/popover}/popover.scss +0 -0
- /package/dist/{popover → components/popover}/rtl.scss +0 -0
- /package/dist/{popover → components/popover}/variables.scss +0 -0
- /package/dist/{_portal → components/portal}/portal.css +0 -0
- /package/dist/{_portal → components/portal}/portal.scss +0 -0
- /package/dist/{progress → components/progress}/constants.d.ts +0 -0
- /package/dist/{progress → components/progress}/generates.d.ts +0 -0
- /package/dist/{progress → components/progress}/progress.css +0 -0
- /package/dist/{progress → components/progress}/progress.scss +0 -0
- /package/dist/{progress → components/progress}/rtl.scss +0 -0
- /package/dist/{progress → components/progress}/utils.d.ts +0 -0
- /package/dist/{progress → components/progress}/variables.scss +0 -0
- /package/dist/{radio → components/radio}/animation.scss +0 -0
- /package/dist/{radio → components/radio}/constants.d.ts +0 -0
- /package/dist/{radio → components/radio}/mixin.scss +0 -0
- /package/dist/{radio → components/radio}/radio.css +0 -0
- /package/dist/{radio → components/radio}/radio.scss +0 -0
- /package/dist/{radio → components/radio}/rtl.scss +0 -0
- /package/dist/{rating → components/rating}/animation.scss +0 -0
- /package/dist/{rating → components/rating}/constants.d.ts +0 -0
- /package/dist/{rating → components/rating}/rating.css +0 -0
- /package/dist/{rating → components/rating}/rating.scss +0 -0
- /package/dist/{rating → components/rating}/rtl.scss +0 -0
- /package/dist/{resizable → components/resizable}/constants.d.ts +0 -0
- /package/dist/{resizable → components/resizable}/foundation.js +0 -0
- /package/dist/{resizable → components/resizable}/resizable.css +0 -0
- /package/dist/{resizable → components/resizable}/types.d.ts +0 -0
- /package/dist/{resizable → components/resizable}/utils.d.ts +0 -0
- /package/dist/{resizable → components/resizable}/variables.scss +0 -0
- /package/dist/{scroll-list → components/scroll-list}/animation.scss +0 -0
- /package/dist/{scroll-list → components/scroll-list}/constants.d.ts +0 -0
- /package/dist/{scroll-list → components/scroll-list}/rtl.scss +0 -0
- /package/dist/{scroll-list → components/scroll-list}/scroll-list.css +0 -0
- /package/dist/{scroll-list → components/scroll-list}/scroll-to.d.ts +0 -0
- /package/dist/{scroll-list → components/scroll-list}/variables.scss +0 -0
- /package/dist/{select → components/select}/animation.scss +0 -0
- /package/dist/{select → components/select}/combobox-name.d.ts +0 -0
- /package/dist/{select → components/select}/constants.d.ts +0 -0
- /package/dist/{select → components/select}/mixin.scss +0 -0
- /package/dist/{select → components/select}/option-foundation.d.ts +0 -0
- /package/dist/{select → components/select}/option.scss +0 -0
- /package/dist/{select → components/select}/rtl.scss +0 -0
- /package/dist/{select → components/select}/select.css +0 -0
- /package/dist/{select → components/select}/variables.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/animation.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/constants.d.ts +0 -0
- /package/dist/{side-sheet → components/side-sheet}/rtl.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/side-sheet.css +0 -0
- /package/dist/{side-sheet → components/side-sheet}/side-sheet.scss +0 -0
- /package/dist/{side-sheet → components/side-sheet}/variables.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/animation.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/constants.d.ts +0 -0
- /package/dist/{skeleton → components/skeleton}/rtl.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/skeleton.css +0 -0
- /package/dist/{skeleton → components/skeleton}/skeleton.scss +0 -0
- /package/dist/{skeleton → components/skeleton}/variables.scss +0 -0
- /package/dist/{slider → components/slider}/animation.scss +0 -0
- /package/dist/{slider → components/slider}/constants.d.ts +0 -0
- /package/dist/{slider → components/slider}/rtl.scss +0 -0
- /package/dist/{slider → components/slider}/slider.css +0 -0
- /package/dist/{slider → components/slider}/slider.scss +0 -0
- /package/dist/{space → components/space}/constants.d.ts +0 -0
- /package/dist/{space → components/space}/rtl.scss +0 -0
- /package/dist/{space → components/space}/space.css +0 -0
- /package/dist/{space → components/space}/space.scss +0 -0
- /package/dist/{space → components/space}/variables.scss +0 -0
- /package/dist/{spin → components/spin}/animation.scss +0 -0
- /package/dist/{spin → components/spin}/constants.d.ts +0 -0
- /package/dist/{spin → components/spin}/mixin.scss +0 -0
- /package/dist/{spin → components/spin}/rtl.scss +0 -0
- /package/dist/{spin → components/spin}/spin.css +0 -0
- /package/dist/{spin → components/spin}/variables.scss +0 -0
- /package/dist/{steps → components/steps}/animation.scss +0 -0
- /package/dist/{steps → components/steps}/bacis-steps.scss +0 -0
- /package/dist/{steps → components/steps}/constants.d.ts +0 -0
- /package/dist/{steps → components/steps}/fill-steps.scss +0 -0
- /package/dist/{steps → components/steps}/mixin.scss +0 -0
- /package/dist/{steps → components/steps}/nav-steps.scss +0 -0
- /package/dist/{steps → components/steps}/rtl.scss +0 -0
- /package/dist/{steps → components/steps}/steps.css +0 -0
- /package/dist/{steps → components/steps}/utils.d.ts +0 -0
- /package/dist/{steps → components/steps}/variables.scss +0 -0
- /package/dist/{switch → components/switch}/animation.scss +0 -0
- /package/dist/{switch → components/switch}/constants.d.ts +0 -0
- /package/dist/{switch → components/switch}/rtl.scss +0 -0
- /package/dist/{switch → components/switch}/switch.css +0 -0
- /package/dist/{switch → components/switch}/switch.scss +0 -0
- /package/dist/{table → components/table}/animation.scss +0 -0
- /package/dist/{table → components/table}/mixin.scss +0 -0
- /package/dist/{table → components/table}/operation-panel.scss +0 -0
- /package/dist/{table → components/table}/rtl.scss +0 -0
- /package/dist/{tabs → components/tabs}/animation.scss +0 -0
- /package/dist/{tabs → components/tabs}/rtl.scss +0 -0
- /package/dist/{tabs → components/tabs}/tabs.css +0 -0
- /package/dist/{tag → components/tag}/constants.d.ts +0 -0
- /package/dist/{tag → components/tag}/focus.d.ts +0 -0
- /package/dist/{tag → components/tag}/rtl.scss +0 -0
- /package/dist/{tag → components/tag}/tag-key.d.ts +0 -0
- /package/dist/{tag → components/tag}/tag.scss +0 -0
- /package/dist/{tag-input → components/tag-input}/animation.scss +0 -0
- /package/dist/{tag-input → components/tag-input}/constants.d.ts +0 -0
- /package/dist/{tag-input → components/tag-input}/rtl.scss +0 -0
- /package/dist/{tag-input → components/tag-input}/tag-input.css +0 -0
- /package/dist/{tag-input → components/tag-input}/utils/get-splited-array.d.ts +0 -0
- /package/dist/{tag-input → components/tag-input}/utils/tag-focus.d.ts +0 -0
- /package/dist/{tag-input → components/tag-input}/variables.scss +0 -0
- /package/dist/{time-picker → components/time-picker}/constants.d.ts +0 -0
- /package/dist/{time-picker → components/time-picker}/rtl.scss +0 -0
- /package/dist/{time-picker → components/time-picker}/time-picker.css +0 -0
- /package/dist/{time-picker → components/time-picker}/time-picker.scss +0 -0
- /package/dist/{time-picker → components/time-picker}/utils/index.d.ts +0 -0
- /package/dist/{time-picker → components/time-picker}/variables.scss +0 -0
- /package/dist/{timeline → components/timeline}/constants.d.ts +0 -0
- /package/dist/{timeline → components/timeline}/rtl.scss +0 -0
- /package/dist/{timeline → components/timeline}/timeline.css +0 -0
- /package/dist/{timeline → components/timeline}/utils.d.ts +0 -0
- /package/dist/{timeline → components/timeline}/variables.scss +0 -0
- /package/dist/{toast → components/toast}/animation.scss +0 -0
- /package/dist/{toast → components/toast}/constants.d.ts +0 -0
- /package/dist/{toast → components/toast}/rtl.scss +0 -0
- /package/dist/{toast → components/toast}/toast.css +0 -0
- /package/dist/{toast → components/toast}/toast.scss +0 -0
- /package/dist/{toast → components/toast}/variables.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/adjust-position.d.ts +0 -0
- /package/dist/{tooltip → components/tooltip}/animation.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/arrow.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/position.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/rtl.scss +0 -0
- /package/dist/{tooltip → components/tooltip}/tooltip.css +0 -0
- /package/dist/{tooltip → components/tooltip}/variables.scss +0 -0
- /package/dist/{transfer → components/transfer}/animation.scss +0 -0
- /package/dist/{transfer → components/transfer}/constants.d.ts +0 -0
- /package/dist/{transfer → components/transfer}/rtl.scss +0 -0
- /package/dist/{transfer → components/transfer}/transfer-utils.d.ts +0 -0
- /package/dist/{transfer → components/transfer}/transfer.css +0 -0
- /package/dist/{transfer → components/transfer}/variables.scss +0 -0
- /package/dist/{tree → components/tree}/animation.scss +0 -0
- /package/dist/{tree → components/tree}/constants.d.ts +0 -0
- /package/dist/{tree → components/tree}/rtl.scss +0 -0
- /package/dist/{tree → components/tree}/tree.css +0 -0
- /package/dist/{tree → components/tree}/variables.scss +0 -0
- /package/dist/{tree-select → components/tree-select}/constants.d.ts +0 -0
- /package/dist/{tree-select → components/tree-select}/rtl.scss +0 -0
- /package/dist/{tree-select → components/tree-select}/tree-select.css +0 -0
- /package/dist/{tree-select → components/tree-select}/variables.scss +0 -0
- /package/dist/{typography → components/typography}/constants.d.ts +0 -0
- /package/dist/{typography → components/typography}/ellipsis.d.ts +0 -0
- /package/dist/{typography → components/typography}/format-numeral.d.ts +0 -0
- /package/dist/{typography → components/typography}/rtl.scss +0 -0
- /package/dist/{typography → components/typography}/typography.css +0 -0
- /package/dist/{typography → components/typography}/variables.scss +0 -0
- /package/dist/{upload → components/upload}/rtl.scss +0 -0
- /package/dist/{upload → components/upload}/upload.css +0 -0
- /package/dist/{upload → components/upload}/variables.scss +0 -0
- /package/dist/{user-guide → components/user-guide}/animation.scss +0 -0
- /package/dist/{user-guide → components/user-guide}/constants.d.ts +0 -0
- /package/dist/{user-guide → components/user-guide}/user-guide.css +0 -0
- /package/dist/{user-guide → components/user-guide}/user-guide.scss +0 -0
- /package/dist/{user-guide → components/user-guide}/variables.scss +0 -0
- /package/dist/{video-player → components/video-player}/animation.scss +0 -0
- /package/dist/{video-player → components/video-player}/constants.d.ts +0 -0
- /package/dist/{video-player → components/video-player}/utils.d.ts +0 -0
- /package/dist/{video-player → components/video-player}/variables.scss +0 -0
- /package/dist/{video-player → components/video-player}/video-player.css +0 -0
|
@@ -0,0 +1,1001 @@
|
|
|
1
|
+
import BaseFoundation from "../../base/foundation.js";
|
|
2
|
+
import warning, { isDev } from "../../utils/warning.js";
|
|
3
|
+
import { formatLocale } from "../../locale/format.js";
|
|
4
|
+
import { differenceUnique, withOrderSort } from "../../utils/array.js";
|
|
5
|
+
import isObject from "../../utils/is-object.js";
|
|
6
|
+
import { calcCheckedKeysForChecked, calcCheckedKeysForCheckedKeys, calcCheckedKeysForUnchecked, convertDataToEntities } from "../tree/tree-util.js";
|
|
7
|
+
import { numbers, strings } from "./constants.js";
|
|
8
|
+
import { buildRecordsByKey, flattenBodyRows, getChangedRowKeys, isMissingDataIndex, mergeColumns } from "./utils.js";
|
|
9
|
+
import { isEqual, merge, pick } from "es-toolkit";
|
|
10
|
+
import { get } from "es-toolkit/compat";
|
|
11
|
+
// src/components/table/foundation.ts
|
|
12
|
+
var TableFoundation = class TableFoundation extends BaseFoundation {
|
|
13
|
+
#trackScrollEdges;
|
|
14
|
+
#rangeAnchor = null;
|
|
15
|
+
#rangeBase = null;
|
|
16
|
+
#rangeResult = null;
|
|
17
|
+
#spaceShiftKey = false;
|
|
18
|
+
#missingDataIndex = false;
|
|
19
|
+
static propKeys = [
|
|
20
|
+
"flattenColumns",
|
|
21
|
+
"dataSource",
|
|
22
|
+
"rowSelection",
|
|
23
|
+
"pagination",
|
|
24
|
+
"expandedRowKeys",
|
|
25
|
+
"expandAllRows",
|
|
26
|
+
"expandAllGroupRows"
|
|
27
|
+
];
|
|
28
|
+
static #pagerIsControlled(props) {
|
|
29
|
+
return props.pagination?.currentPage != null;
|
|
30
|
+
}
|
|
31
|
+
static #restoreRowKeys(keys, known, keyEntities) {
|
|
32
|
+
const knownMap = new Map(known.map((key) => [String(key), key]));
|
|
33
|
+
return [...keys].map((key) => keyEntities?.[key]?.data?.rowKey ?? knownMap.get(key) ?? key);
|
|
34
|
+
}
|
|
35
|
+
static #getRelatedCheckedRowKeys(rowKeys = [], keyEntities = {}) {
|
|
36
|
+
const { checkedKeys, halfCheckedKeys } = calcCheckedKeysForCheckedKeys(rowKeys.map(String), keyEntities, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set());
|
|
37
|
+
return {
|
|
38
|
+
checkedRowKeys: TableFoundation.#restoreRowKeys(checkedKeys, rowKeys, keyEntities),
|
|
39
|
+
halfCheckedRowKeys: TableFoundation.#restoreRowKeys(halfCheckedKeys, rowKeys, keyEntities)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
static #sameKeys(a, b) {
|
|
43
|
+
return a.size === b.size && [...a].every((key) => b.has(key));
|
|
44
|
+
}
|
|
45
|
+
static #sortOrderIsControlled(column) {
|
|
46
|
+
return column.sortOrder != null;
|
|
47
|
+
}
|
|
48
|
+
static #syncScrollableEdges(body) {
|
|
49
|
+
const { left, right } = TableFoundation.getScrollableEdges({
|
|
50
|
+
scrollLeft: body.scrollLeft,
|
|
51
|
+
scrollWidth: body.scrollWidth,
|
|
52
|
+
clientWidth: body.clientWidth,
|
|
53
|
+
rtl: getComputedStyle(body).direction === "rtl"
|
|
54
|
+
});
|
|
55
|
+
body.parentElement?.toggleAttribute("data-scrollable-left", left);
|
|
56
|
+
body.parentElement?.toggleAttribute("data-scrollable-right", right);
|
|
57
|
+
}
|
|
58
|
+
#addNoDuplicatedItemsToArr(srcArr = [], ...objArrs) {
|
|
59
|
+
for (const objArr of objArrs) if (Array.isArray(objArr)) {
|
|
60
|
+
for (const item of objArr) if (!srcArr.includes(item)) srcArr.push(item);
|
|
61
|
+
}
|
|
62
|
+
return srcArr;
|
|
63
|
+
}
|
|
64
|
+
#notifyChange(pagination, filters, sorter, extra) {
|
|
65
|
+
pagination = pagination == null ? this.#getPagination() : pagination;
|
|
66
|
+
filters = filters == null ? this.#getAllFilters() : filters;
|
|
67
|
+
sorter = sorter == null ? this.#getAllSorters()[0] : sorter;
|
|
68
|
+
if (this.getProp("scroll")?.scrollToFirstRowOnChange) this.#resetScrollY();
|
|
69
|
+
this.adapter.notifyChange({
|
|
70
|
+
pagination: { ...pagination },
|
|
71
|
+
filters: [...filters],
|
|
72
|
+
sorter,
|
|
73
|
+
extra: { ...extra }
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
#resetScrollY() {
|
|
77
|
+
if (this.getProp("scroll")?.y) {
|
|
78
|
+
const body = this.adapter.getBodyWrapper();
|
|
79
|
+
if (body) body.scrollTop = 0;
|
|
80
|
+
} else this.adapter.getWrapper()?.scrollIntoView({
|
|
81
|
+
behavior: "smooth",
|
|
82
|
+
block: "start"
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
#warnMissingDataIndex() {
|
|
86
|
+
const missing = this.getProp("flattenColumns")?.some(isMissingDataIndex) ?? false;
|
|
87
|
+
warning(missing && !this.#missingDataIndex, `[Semi Table] The column with sorter or filter must pass the 'dataIndex' prop`);
|
|
88
|
+
this.#missingDataIndex = missing;
|
|
89
|
+
}
|
|
90
|
+
#rowExpansionIsControlled() {
|
|
91
|
+
return Array.isArray(this.getProp("expandedRowKeys"));
|
|
92
|
+
}
|
|
93
|
+
#selectionIsControlled() {
|
|
94
|
+
const rowSelection = this.getProp("rowSelection");
|
|
95
|
+
return isObject(rowSelection) && Array.isArray(rowSelection.selectedRowKeys);
|
|
96
|
+
}
|
|
97
|
+
#sorterIsControlled(dataIndex) {
|
|
98
|
+
const query = dataIndex && this.getQuery(dataIndex, this.getState("flattenColumns"));
|
|
99
|
+
return Boolean(query && TableFoundation.#sortOrderIsControlled(query));
|
|
100
|
+
}
|
|
101
|
+
#filterIsControlled(dataIndex) {
|
|
102
|
+
const query = dataIndex && this.getQuery(dataIndex, this.getState("flattenColumns"));
|
|
103
|
+
return Boolean(query && Array.isArray(query.filteredValue));
|
|
104
|
+
}
|
|
105
|
+
#getSelectedRowKeys() {
|
|
106
|
+
return [...this.getState("rowSelection")?.selectedRowKeys ?? []];
|
|
107
|
+
}
|
|
108
|
+
#getSelectedRowKeysSet() {
|
|
109
|
+
return this.getState("rowSelection")?.selectedRowKeysSet ?? /* @__PURE__ */ new Set();
|
|
110
|
+
}
|
|
111
|
+
#getFilteredDisabledRowKeysSet() {
|
|
112
|
+
return this.getState("filteredDisabledRowKeysSet") ?? /* @__PURE__ */ new Set();
|
|
113
|
+
}
|
|
114
|
+
#getCheckRelation() {
|
|
115
|
+
return this.getState("rowSelection")?.checkRelation ?? "unRelated";
|
|
116
|
+
}
|
|
117
|
+
#setSelectedRowKeys(selectedRowKeys) {
|
|
118
|
+
this.setState({ rowSelection: {
|
|
119
|
+
...this.getState("rowSelection"),
|
|
120
|
+
selectedRowKeys: [...selectedRowKeys],
|
|
121
|
+
selectedRowKeysSet: new Set(selectedRowKeys)
|
|
122
|
+
} });
|
|
123
|
+
}
|
|
124
|
+
#setHalfCheckedRowKeys(halfCheckedRowKeys) {
|
|
125
|
+
this.setState({
|
|
126
|
+
halfCheckedRowKeys,
|
|
127
|
+
halfCheckedRowKeysSet: new Set(halfCheckedRowKeys)
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
#setPageDisabledRowKeys(pageDisabledRowKeys) {
|
|
131
|
+
this.setState({
|
|
132
|
+
pageDisabledRowKeys,
|
|
133
|
+
pageDisabledRowKeysSet: new Set(pageDisabledRowKeys)
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
#setFilteredDisabledRowKeys(filteredDisabledRowKeys) {
|
|
137
|
+
this.setState({
|
|
138
|
+
filteredDisabledRowKeys,
|
|
139
|
+
filteredDisabledRowKeysSet: new Set(filteredDisabledRowKeys)
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
#getVisibleRowKeys() {
|
|
143
|
+
const { rowKey, childrenRecordName } = this.getProps();
|
|
144
|
+
const dataSource = this.getState("dataSource");
|
|
145
|
+
const options = {
|
|
146
|
+
rowKey,
|
|
147
|
+
childrenRecordName,
|
|
148
|
+
expandedRowKeys: this.getState("expandedRowKeys"),
|
|
149
|
+
hasExpandedRow: false
|
|
150
|
+
};
|
|
151
|
+
return flattenBodyRows(options, dataSource, this.getState("groups"), buildRecordsByKey(dataSource, rowKey)).flatMap((row) => row.kind === "base" ? [row.key] : []);
|
|
152
|
+
}
|
|
153
|
+
/** Gives every enabled row from the anchor to `rowKey` the anchor's state; false when either row is not shown */
|
|
154
|
+
#selectRange(rowKey) {
|
|
155
|
+
const visibleRowKeys = this.#getVisibleRowKeys();
|
|
156
|
+
const anchorIndex = visibleRowKeys.indexOf(this.#rangeAnchor);
|
|
157
|
+
const index = visibleRowKeys.indexOf(rowKey);
|
|
158
|
+
if (anchorIndex === -1 || index === -1) return false;
|
|
159
|
+
const currentKeys = this.#getSelectedRowKeysSet();
|
|
160
|
+
if (!this.#rangeBase || !this.#rangeResult || !TableFoundation.#sameKeys(this.#rangeResult, currentKeys)) this.#rangeBase = new Set(this.#getSelectedRowKeys());
|
|
161
|
+
const selected = this.#rangeBase.has(this.#rangeAnchor);
|
|
162
|
+
const disabledRowKeys = this.#getFilteredDisabledRowKeysSet();
|
|
163
|
+
const nextKeys = new Set(this.#rangeBase);
|
|
164
|
+
for (const key of visibleRowKeys.slice(Math.min(anchorIndex, index), Math.max(anchorIndex, index) + 1)) if (!disabledRowKeys.has(key)) {
|
|
165
|
+
if (selected) nextKeys.add(key);
|
|
166
|
+
else nextKeys.delete(key);
|
|
167
|
+
}
|
|
168
|
+
window.getSelection()?.removeAllRanges();
|
|
169
|
+
this.#rangeResult = nextKeys;
|
|
170
|
+
if (TableFoundation.#sameKeys(nextKeys, currentKeys)) return true;
|
|
171
|
+
const selectedRowKeys = [...nextKeys];
|
|
172
|
+
if (!this.#selectionIsControlled()) this.#setSelectedRowKeys(selectedRowKeys);
|
|
173
|
+
this.adapter.notifySelectionChange(selectedRowKeys, this.getRecordsByKeys(null, selectedRowKeys));
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
#getDataSource() {
|
|
177
|
+
return this.getProp("dataSource") || [];
|
|
178
|
+
}
|
|
179
|
+
#getPagination() {
|
|
180
|
+
return this.getState("pagination") || {};
|
|
181
|
+
}
|
|
182
|
+
#getAllFilters(queries) {
|
|
183
|
+
queries = queries || this.getState("queries");
|
|
184
|
+
const filters = [];
|
|
185
|
+
queries?.forEach((query) => {
|
|
186
|
+
if (Array.isArray(query.filteredValue) && (query.filteredValue.length || this.#filterIsControlled(query.dataIndex))) filters.push(query);
|
|
187
|
+
});
|
|
188
|
+
return filters;
|
|
189
|
+
}
|
|
190
|
+
#getAllSorters(queries) {
|
|
191
|
+
queries = queries || this.getState("queries");
|
|
192
|
+
return queries?.filter((query) => query.sorter && query.sortOrder) ?? [];
|
|
193
|
+
}
|
|
194
|
+
#filterQueries(targetQuery, queries, keys = ["dataIndex"]) {
|
|
195
|
+
queries = queries == null ? this.getState("queries") : queries;
|
|
196
|
+
const filteredQueries = [];
|
|
197
|
+
const filteredIndexes = [];
|
|
198
|
+
queries?.forEach((itQuery, index) => {
|
|
199
|
+
if (keys?.some((k) => k && targetQuery[k] != null && targetQuery[k] === itQuery[k]) ?? false) {
|
|
200
|
+
filteredQueries.push(itQuery);
|
|
201
|
+
filteredIndexes.push(index);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return {
|
|
205
|
+
filteredQueries,
|
|
206
|
+
filteredIndexes
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
#mergeToQueries(query, queries, keys = ["dataIndex"]) {
|
|
210
|
+
queries = queries == null ? this.getState("queries") : queries;
|
|
211
|
+
queries = [...queries];
|
|
212
|
+
query = { ...query };
|
|
213
|
+
const { filteredQueries, filteredIndexes } = this.#filterQueries(query, queries, keys);
|
|
214
|
+
filteredQueries?.forEach((_curQuery, idx) => {
|
|
215
|
+
queries[filteredIndexes[idx]] = { ...query };
|
|
216
|
+
});
|
|
217
|
+
return queries;
|
|
218
|
+
}
|
|
219
|
+
#getGroups() {
|
|
220
|
+
if (this.getProp("groupBy") !== null) return this.getState("groups");
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
#initSelectedRowKeys(keyEntities) {
|
|
224
|
+
const rowSelection = this.getProp("rowSelection");
|
|
225
|
+
let rowKeys = [];
|
|
226
|
+
if (rowSelection) {
|
|
227
|
+
const selectedRowKeys = isObject(rowSelection) ? rowSelection.selectedRowKeys : void 0;
|
|
228
|
+
const defaultSelectedRowKeys = isObject(rowSelection) ? rowSelection.defaultSelectedRowKeys : void 0;
|
|
229
|
+
const controlled = Array.isArray(selectedRowKeys);
|
|
230
|
+
if (controlled) this.#addNoDuplicatedItemsToArr(rowKeys, selectedRowKeys);
|
|
231
|
+
else if (Array.isArray(defaultSelectedRowKeys)) this.#addNoDuplicatedItemsToArr(rowKeys, defaultSelectedRowKeys);
|
|
232
|
+
let halfCheckedRowKeys = [];
|
|
233
|
+
if (this.#getCheckRelation() === "related") {
|
|
234
|
+
const related = TableFoundation.#getRelatedCheckedRowKeys(rowKeys, keyEntities);
|
|
235
|
+
halfCheckedRowKeys = related.halfCheckedRowKeys;
|
|
236
|
+
if (!controlled) {
|
|
237
|
+
const known = new Set(rowKeys.map(String));
|
|
238
|
+
rowKeys = [...rowKeys, ...related.checkedRowKeys.filter((key) => !known.has(String(key)))];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
this.#setSelectedRowKeys(rowKeys);
|
|
242
|
+
this.#setHalfCheckedRowKeys(halfCheckedRowKeys);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
#getPageData(dataSource, pagination, queries) {
|
|
246
|
+
const filteredSortedDataSource = this.getState("filteredSortedDataSource") ?? [];
|
|
247
|
+
dataSource = dataSource == null ? [...filteredSortedDataSource] : dataSource;
|
|
248
|
+
pagination = pagination == null ? this.getState("pagination") && { ...this.getState("pagination") } : pagination;
|
|
249
|
+
queries = queries == null ? [...this.getState("queries")] : queries;
|
|
250
|
+
return TableFoundation.getPageData(this.getProps(), dataSource, pagination, queries);
|
|
251
|
+
}
|
|
252
|
+
#setPageData({ pagination, dataSource, disabledRowKeys, allRowKeys, groups } = {}) {
|
|
253
|
+
this.#setPageDisabledRowKeys(disabledRowKeys);
|
|
254
|
+
this.setState({
|
|
255
|
+
allRowKeys,
|
|
256
|
+
pagination,
|
|
257
|
+
groups,
|
|
258
|
+
dataSource
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
#setCachedFilteredSortedDataSource(filteredSortedDataSource) {
|
|
262
|
+
const filteredSortedRowKeys = this.getAllRowKeys(filteredSortedDataSource);
|
|
263
|
+
this.setState({
|
|
264
|
+
filteredSortedDataSource,
|
|
265
|
+
filteredSortedRowKeys,
|
|
266
|
+
filteredSortedRowKeysSet: new Set(filteredSortedRowKeys)
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
#applyQueries(queries) {
|
|
270
|
+
const dataSource = [...this.getProp("dataSource")];
|
|
271
|
+
const sortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
|
|
272
|
+
const allDataDisabledRowKeys = this.getAllDisabledRowKeys(sortedDataSource);
|
|
273
|
+
this.#setCachedFilteredSortedDataSource(sortedDataSource);
|
|
274
|
+
this.#setFilteredDisabledRowKeys(allDataDisabledRowKeys);
|
|
275
|
+
const pageData = this.#getPageData(sortedDataSource);
|
|
276
|
+
this.#setPageData(pageData);
|
|
277
|
+
}
|
|
278
|
+
#updateKeyEntities() {
|
|
279
|
+
const keyEntities = TableFoundation.buildKeyEntities(this.getProps(), this.getProp("dataSource"));
|
|
280
|
+
this.setState({ keyEntities });
|
|
281
|
+
this.#setHalfCheckedRowKeys(TableFoundation.#getRelatedCheckedRowKeys(this.#getSelectedRowKeys(), keyEntities).halfCheckedRowKeys);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* @param dataSourceChanged the dataSource prop changed: the uncontrolled page goes back to 1
|
|
285
|
+
* @param recompute the dataSource prop or the columns changed
|
|
286
|
+
*/
|
|
287
|
+
#handleDataUpdate(dataSourceChanged, recompute, prevPagination) {
|
|
288
|
+
const { dataSource, groupBy, pagination: propsPagination, defaultExpandAllRows, expandAllRows, expandAllGroupRows } = this.getProps();
|
|
289
|
+
const statePagination = this.getState("pagination");
|
|
290
|
+
const states = {};
|
|
291
|
+
if (recompute) {
|
|
292
|
+
const filteredSortedDataSource = this.getFilteredSortedDataSource(dataSource, this.getState("queries"));
|
|
293
|
+
const allDataDisabledRowKeys = this.getAllDisabledRowKeys(filteredSortedDataSource);
|
|
294
|
+
this.#setCachedFilteredSortedDataSource(filteredSortedDataSource);
|
|
295
|
+
this.#setFilteredDisabledRowKeys(allDataDisabledRowKeys);
|
|
296
|
+
states.dataSource = filteredSortedDataSource;
|
|
297
|
+
if (this.#getCheckRelation() === "related") this.#updateKeyEntities();
|
|
298
|
+
if (groupBy) states.groups = null;
|
|
299
|
+
}
|
|
300
|
+
if (dataSourceChanged) states.pagination = isObject(statePagination) ? {
|
|
301
|
+
...statePagination,
|
|
302
|
+
currentPage: isObject(propsPagination) && propsPagination.currentPage || 1
|
|
303
|
+
} : statePagination;
|
|
304
|
+
const pageSizeChanged = isObject(propsPagination) && propsPagination.pageSize !== (isObject(prevPagination) ? prevPagination.pageSize : void 0);
|
|
305
|
+
if (pageSizeChanged) states.pagination ??= { ...statePagination };
|
|
306
|
+
if (Object.keys(states).length) {
|
|
307
|
+
const pageData = this.#getPageData(states.dataSource ?? null, states.pagination ?? (statePagination && { ...statePagination }), null);
|
|
308
|
+
this.setState({ allRowKeys: pageData.allRowKeys });
|
|
309
|
+
this.#setPageDisabledRowKeys(pageData.disabledRowKeys);
|
|
310
|
+
if ("dataSource" in states) {
|
|
311
|
+
if (defaultExpandAllRows && dataSourceChanged && pageData.groups?.size && !this.#rowExpansionIsControlled() || expandAllRows || expandAllGroupRows) this.initExpandedRowKeys(pageData);
|
|
312
|
+
this.setState({ dataSource: pageData.dataSource });
|
|
313
|
+
states.pagination = pageData.pagination;
|
|
314
|
+
}
|
|
315
|
+
if (pageSizeChanged && !("dataSource" in states)) this.setState({ dataSource: pageData.dataSource });
|
|
316
|
+
if ("groups" in states) this.setState({ groups: pageData.groups });
|
|
317
|
+
if ("pagination" in states) this.setState({ pagination: pageData.pagination });
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
getFilteredSortedDataSource(dataSource, queries) {
|
|
321
|
+
return TableFoundation.getFilteredSortedDataSource(this.getProps(), dataSource, queries);
|
|
322
|
+
}
|
|
323
|
+
getRecordKey(record) {
|
|
324
|
+
return TableFoundation.getRecordKey({ rowKey: this.getProp("rowKey") }, record);
|
|
325
|
+
}
|
|
326
|
+
calcCheckedKeysForSelect(realKey, selected, checkedKeys, halfCheckedKeys) {
|
|
327
|
+
const keyEntities = this.getState("keyEntities") ?? {};
|
|
328
|
+
const keyStr = String(realKey);
|
|
329
|
+
if (!keyEntities || !keyEntities[keyStr]) {
|
|
330
|
+
if (selected) checkedKeys.add(keyStr);
|
|
331
|
+
else checkedKeys.delete(keyStr);
|
|
332
|
+
return {
|
|
333
|
+
checkedKeys,
|
|
334
|
+
halfCheckedKeys
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
if (selected) return calcCheckedKeysForChecked(keyStr, keyEntities, checkedKeys, halfCheckedKeys);
|
|
338
|
+
else return calcCheckedKeysForUnchecked(keyStr, keyEntities, checkedKeys, halfCheckedKeys);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* The records of the given keys, children included
|
|
342
|
+
* @param dataSource null means the dataSource prop
|
|
343
|
+
*/
|
|
344
|
+
getRecordsByKeys(dataSource, keys, keysSet) {
|
|
345
|
+
dataSource = dataSource == null ? this.#getDataSource() : dataSource;
|
|
346
|
+
if (!(keysSet instanceof Set)) keysSet = new Set(keys);
|
|
347
|
+
const childrenRecordName = this.getProp("childrenRecordName");
|
|
348
|
+
const records = [];
|
|
349
|
+
if (keysSet.size && Array.isArray(dataSource) && dataSource.length) {
|
|
350
|
+
records.push(...dataSource.filter((data) => keysSet.has(this.getRecordKey(data))));
|
|
351
|
+
if (records.length < keys.length) for (const item of dataSource) {
|
|
352
|
+
const children = get(item, childrenRecordName);
|
|
353
|
+
if (Array.isArray(children) && children.length) records.push(...this.getRecordsByKeys(children, keys, keysSet));
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return records;
|
|
357
|
+
}
|
|
358
|
+
getAllDisabledRowKeys(dataSource) {
|
|
359
|
+
return TableFoundation.getAllDisabledRowKeys(this.getProps(), dataSource == null ? this.#getDataSource() : dataSource);
|
|
360
|
+
}
|
|
361
|
+
getAllRowKeys(dataSource) {
|
|
362
|
+
return TableFoundation.getAllRowKeys(this.getProps(), dataSource == null ? this.#getDataSource() : dataSource);
|
|
363
|
+
}
|
|
364
|
+
getQuery(dataIndex, queries) {
|
|
365
|
+
queries = queries || this.getState("queries");
|
|
366
|
+
if (dataIndex != null) return queries?.find((query) => query.dataIndex === dataIndex);
|
|
367
|
+
}
|
|
368
|
+
initOnce() {
|
|
369
|
+
const { defaultExpandAllRows, expandAllRows, expandAllGroupRows } = this.getProps();
|
|
370
|
+
const groups = this.getState("groups");
|
|
371
|
+
if (!(defaultExpandAllRows && !expandAllRows && !expandAllGroupRows && groups?.size && this.#rowExpansionIsControlled())) this.initExpandedRowKeys({ groups });
|
|
372
|
+
this.#initSelectedRowKeys(this.getState("keyEntities"));
|
|
373
|
+
this.#warnMissingDataIndex();
|
|
374
|
+
}
|
|
375
|
+
static initColumnsFilteredValueAndSorterOrder(columns) {
|
|
376
|
+
columns.forEach((column) => {
|
|
377
|
+
TableFoundation.initFilteredValue(column);
|
|
378
|
+
TableFoundation.initSorterOrder(column);
|
|
379
|
+
});
|
|
380
|
+
return columns;
|
|
381
|
+
}
|
|
382
|
+
static initFilteredValue(column) {
|
|
383
|
+
const { defaultFilteredValue, filteredValue } = column;
|
|
384
|
+
if (filteredValue === void 0) {
|
|
385
|
+
if (Array.isArray(defaultFilteredValue) && defaultFilteredValue.length) column.filteredValue = defaultFilteredValue;
|
|
386
|
+
else column.filteredValue = [];
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
static initSorterOrder(column) {
|
|
390
|
+
const { defaultSortOrder, sortOrder, sorter } = column;
|
|
391
|
+
if (sorter && sortOrder === void 0) {
|
|
392
|
+
if (defaultSortOrder !== void 0) column.sortOrder = defaultSortOrder;
|
|
393
|
+
else column.sortOrder = false;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
static getFilteredSortedDataSource(props, dataSource, queries) {
|
|
397
|
+
const filteredDataSource = TableFoundation.filterDataSource(props, dataSource, queries.filter((query) => {
|
|
398
|
+
const currentFilteredValue = query.filteredValue ? query.filteredValue : query.defaultFilteredValue;
|
|
399
|
+
return typeof query.onFilter === "function" && Array.isArray(currentFilteredValue) && currentFilteredValue.length;
|
|
400
|
+
}));
|
|
401
|
+
return TableFoundation.sortDataSource(props, filteredDataSource, queries.filter((query) => query && typeof query.sorter === "function"));
|
|
402
|
+
}
|
|
403
|
+
static getPageData(props, dataSource, pagination, queries) {
|
|
404
|
+
let groups;
|
|
405
|
+
if (props.groupBy != null) {
|
|
406
|
+
const { groups: groupedGroups, dataSource: groupedData } = TableFoundation.groupDataSource(props, dataSource);
|
|
407
|
+
dataSource = groupedData;
|
|
408
|
+
groups = groupedGroups;
|
|
409
|
+
}
|
|
410
|
+
pagination = TableFoundation.normalizePagination(props, pagination, dataSource);
|
|
411
|
+
dataSource = TableFoundation.limitPageDataSource(props, dataSource, pagination);
|
|
412
|
+
return {
|
|
413
|
+
dataSource,
|
|
414
|
+
groups,
|
|
415
|
+
pagination,
|
|
416
|
+
disabledRowKeys: TableFoundation.getAllDisabledRowKeys(props, dataSource),
|
|
417
|
+
allRowKeys: TableFoundation.getAllRowKeys(props, dataSource),
|
|
418
|
+
queries
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
static groupDataSource(props, dataSource) {
|
|
422
|
+
const { groupBy } = props;
|
|
423
|
+
const groups = /* @__PURE__ */ new Map();
|
|
424
|
+
const newDataSource = [];
|
|
425
|
+
if (groupBy != null) dataSource?.forEach((record) => {
|
|
426
|
+
const groupKey = typeof groupBy === "function" ? groupBy(record) : get(record, groupBy);
|
|
427
|
+
if (groupKey != null && groupKey !== "") {
|
|
428
|
+
const recordKey = TableFoundation.getRecordKey(props, record);
|
|
429
|
+
let group = groups.get(groupKey);
|
|
430
|
+
if (!(group instanceof Set)) {
|
|
431
|
+
group = /* @__PURE__ */ new Set([recordKey]);
|
|
432
|
+
groups.set(groupKey, group);
|
|
433
|
+
} else group.add(recordKey);
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
if (groups && groups.size) {
|
|
437
|
+
const recordsByKey = /* @__PURE__ */ new Map();
|
|
438
|
+
dataSource?.forEach((record) => {
|
|
439
|
+
const recordKey = TableFoundation.getRecordKey(props, record);
|
|
440
|
+
if (recordKey != null && recordKey !== "" && !recordsByKey.has(recordKey)) recordsByKey.set(recordKey, record);
|
|
441
|
+
});
|
|
442
|
+
groups.forEach((set) => {
|
|
443
|
+
if (set instanceof Set) set.forEach((realKey) => {
|
|
444
|
+
newDataSource.push(recordsByKey.get(realKey));
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
} else newDataSource.push(...dataSource);
|
|
448
|
+
return {
|
|
449
|
+
groups,
|
|
450
|
+
dataSource: newDataSource
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
static sortDataSource(props, dataSource, sorters) {
|
|
454
|
+
for (const sorterObj of sorters ?? []) {
|
|
455
|
+
const { sorter, sortOrder, defaultSortOrder, sortChildrenRecord } = sorterObj;
|
|
456
|
+
const currentSortOrder = TableFoundation.isSortOrderValid(sortOrder) ? sortOrder : defaultSortOrder;
|
|
457
|
+
if (typeof sorter === "function" && (currentSortOrder === "ascend" || currentSortOrder === "descend")) {
|
|
458
|
+
if (sortChildrenRecord) {
|
|
459
|
+
const { childrenRecordName } = props;
|
|
460
|
+
dataSource = dataSource && dataSource.map((record) => {
|
|
461
|
+
const children = get(record, childrenRecordName);
|
|
462
|
+
if (Array.isArray(children) && children.length) return {
|
|
463
|
+
...record,
|
|
464
|
+
[childrenRecordName]: TableFoundation.sortDataSource(props, children, [sorterObj])
|
|
465
|
+
};
|
|
466
|
+
return record;
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
dataSource = dataSource.toSorted(withOrderSort(sorter, currentSortOrder));
|
|
470
|
+
break;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
return dataSource;
|
|
474
|
+
}
|
|
475
|
+
static filterDataSource(props, dataSource, filters) {
|
|
476
|
+
let filteredData = null;
|
|
477
|
+
let hasValidFilters = false;
|
|
478
|
+
const { childrenRecordName } = props;
|
|
479
|
+
const getRecordKey = (record) => TableFoundation.getRecordKey(props, record);
|
|
480
|
+
filters?.forEach((filterObj) => {
|
|
481
|
+
const { onFilter, filteredValue, filterChildrenRecord, defaultFilteredValue } = filterObj;
|
|
482
|
+
const currentFilteredValue = Array.isArray(filteredValue) ? filteredValue : defaultFilteredValue;
|
|
483
|
+
if (typeof onFilter === "function" && Array.isArray(currentFilteredValue) && currentFilteredValue.length) {
|
|
484
|
+
hasValidFilters = true;
|
|
485
|
+
if (filteredData === null) filteredData = /* @__PURE__ */ new Map();
|
|
486
|
+
else {
|
|
487
|
+
dataSource = Array.from(filteredData && filteredData.values());
|
|
488
|
+
filteredData = /* @__PURE__ */ new Map();
|
|
489
|
+
}
|
|
490
|
+
dataSource?.forEach((record) => {
|
|
491
|
+
currentFilteredValue.forEach((value) => {
|
|
492
|
+
const childrenRecords = get(record, childrenRecordName);
|
|
493
|
+
const recordKey = getRecordKey(record);
|
|
494
|
+
let filteredChildren;
|
|
495
|
+
if (Array.isArray(childrenRecords) && childrenRecords.length && filterChildrenRecord) filteredChildren = TableFoundation.filterDataSource(props, childrenRecords, [filterObj]);
|
|
496
|
+
if (Array.isArray(filteredChildren) && filteredChildren.length) {
|
|
497
|
+
if (recordKey != null) {
|
|
498
|
+
const children = get(filteredData.get(recordKey), childrenRecordName, []);
|
|
499
|
+
filteredData.set(recordKey, {
|
|
500
|
+
...record,
|
|
501
|
+
[childrenRecordName]: filteredChildren.reduce((arr, cur) => {
|
|
502
|
+
if (arr.find((item) => getRecordKey(item) === getRecordKey(cur)) == null) arr.push(cur);
|
|
503
|
+
return arr;
|
|
504
|
+
}, [...children])
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
} else if (onFilter(value, record)) filteredData.set(recordKey, record);
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
if (hasValidFilters) dataSource = Array.from(filteredData && filteredData.values());
|
|
513
|
+
return dataSource;
|
|
514
|
+
}
|
|
515
|
+
static limitPageDataSource(props, dataSource, pagination) {
|
|
516
|
+
let pageData = dataSource;
|
|
517
|
+
const pageNo = pagination?.currentPage;
|
|
518
|
+
if (props.pagination !== false && pageNo && dataSource && pagination && !TableFoundation.#pagerIsControlled(props)) {
|
|
519
|
+
const { pageSize = numbers.DEFAULT_PAGE_SIZE } = pagination;
|
|
520
|
+
const start = (pageNo - 1) * pageSize;
|
|
521
|
+
const end = pageNo * pageSize;
|
|
522
|
+
pageData = dataSource.slice(start, end);
|
|
523
|
+
}
|
|
524
|
+
return pageData;
|
|
525
|
+
}
|
|
526
|
+
static normalizePagination(props, pagination, dataSource) {
|
|
527
|
+
pagination = pagination == null ? {} : pagination;
|
|
528
|
+
dataSource = dataSource == null ? props.dataSource || [] : dataSource;
|
|
529
|
+
const propPagination = props.pagination;
|
|
530
|
+
if (pagination) {
|
|
531
|
+
pagination = typeof pagination === "object" ? { ...pagination } : {};
|
|
532
|
+
pagination = merge({
|
|
533
|
+
total: dataSource && dataSource.length || 0,
|
|
534
|
+
pageSize: numbers.DEFAULT_PAGE_SIZE,
|
|
535
|
+
currentPage: propPagination?.defaultCurrentPage ?? 1,
|
|
536
|
+
position: strings.PAGINATION_POSITIONS[0]
|
|
537
|
+
}, pagination);
|
|
538
|
+
if (!TableFoundation.#pagerIsControlled(props)) {
|
|
539
|
+
const total = propPagination?.total ?? dataSource.length;
|
|
540
|
+
const { currentPage, pageSize } = pagination;
|
|
541
|
+
const realTotalPage = Math.ceil(total / pageSize);
|
|
542
|
+
pagination.total = total;
|
|
543
|
+
if (currentPage > realTotalPage) pagination.currentPage = 1;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
return pagination;
|
|
547
|
+
}
|
|
548
|
+
static getRecordKey({ rowKey }, record) {
|
|
549
|
+
if (!record) return;
|
|
550
|
+
return typeof rowKey === "function" ? rowKey(record) : get(record, rowKey);
|
|
551
|
+
}
|
|
552
|
+
static getAllDisabledRowKeys(props, dataSource, getCheckboxProps) {
|
|
553
|
+
getCheckboxProps = getCheckboxProps == null ? props.rowSelection?.getCheckboxProps : getCheckboxProps;
|
|
554
|
+
const { childrenRecordName } = props;
|
|
555
|
+
const disabledRowKeys = [];
|
|
556
|
+
if (Array.isArray(dataSource) && dataSource.length && typeof getCheckboxProps === "function") for (const record of dataSource) {
|
|
557
|
+
const checkboxProps = getCheckboxProps(record);
|
|
558
|
+
if (checkboxProps && checkboxProps.disabled) disabledRowKeys.push(TableFoundation.getRecordKey(props, record));
|
|
559
|
+
const children = get(record, childrenRecordName);
|
|
560
|
+
if (Array.isArray(children) && children.length) disabledRowKeys.push(...TableFoundation.getAllDisabledRowKeys(props, children, getCheckboxProps));
|
|
561
|
+
}
|
|
562
|
+
return disabledRowKeys;
|
|
563
|
+
}
|
|
564
|
+
static getAllRowKeys(props, dataSource) {
|
|
565
|
+
const { childrenRecordName } = props;
|
|
566
|
+
const allRowKeys = [];
|
|
567
|
+
if (Array.isArray(dataSource) && dataSource.length) for (const record of dataSource) {
|
|
568
|
+
const childrenRowKeys = [];
|
|
569
|
+
const children = get(record, childrenRecordName);
|
|
570
|
+
if (Array.isArray(children) && children.length) childrenRowKeys.push(...TableFoundation.getAllRowKeys(props, children));
|
|
571
|
+
allRowKeys.push(TableFoundation.getRecordKey(props, record), ...childrenRowKeys);
|
|
572
|
+
}
|
|
573
|
+
return allRowKeys;
|
|
574
|
+
}
|
|
575
|
+
static buildKeyEntities({ rowKey, childrenRecordName }, dataSource) {
|
|
576
|
+
const convertToTreeData = (data) => {
|
|
577
|
+
return data.map((record) => {
|
|
578
|
+
const key = typeof rowKey === "function" ? rowKey(record) : get(record, rowKey);
|
|
579
|
+
const children = get(record, childrenRecordName);
|
|
580
|
+
const node = {
|
|
581
|
+
...record,
|
|
582
|
+
key: String(key),
|
|
583
|
+
rowKey: key
|
|
584
|
+
};
|
|
585
|
+
if (Array.isArray(children) && children.length) node.children = convertToTreeData(children);
|
|
586
|
+
return node;
|
|
587
|
+
});
|
|
588
|
+
};
|
|
589
|
+
const { keyEntities } = convertDataToEntities(convertToTreeData(dataSource ?? []), {
|
|
590
|
+
key: "key",
|
|
591
|
+
children: "children"
|
|
592
|
+
});
|
|
593
|
+
return keyEntities;
|
|
594
|
+
}
|
|
595
|
+
/** scrollLeft is 0 at the start edge and negative in RTL; a pixel of slack absorbs fractional scroll positions */
|
|
596
|
+
static getScrollableEdges({ scrollLeft, scrollWidth, clientWidth, rtl }) {
|
|
597
|
+
const max = scrollWidth - clientWidth;
|
|
598
|
+
const min = rtl ? -max : 0;
|
|
599
|
+
return {
|
|
600
|
+
left: scrollLeft - min > 1,
|
|
601
|
+
right: min + max - scrollLeft > 1
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
static hasRowSelected(selectedRowKeys, allRowKeysSet) {
|
|
605
|
+
return Boolean(Array.isArray(selectedRowKeys) && selectedRowKeys.length && allRowKeysSet instanceof Set && allRowKeysSet.size && selectedRowKeys.filter((key) => allRowKeysSet.has(key)).length);
|
|
606
|
+
}
|
|
607
|
+
static allIsSelected(selectedRowKeysSet, disabledRowKeysSet, allKeys) {
|
|
608
|
+
const filteredAllKeys = allKeys.filter((key) => key != null && !disabledRowKeysSet.has(key));
|
|
609
|
+
if (filteredAllKeys && filteredAllKeys.length) {
|
|
610
|
+
for (const key of filteredAllKeys) if (key != null && !selectedRowKeysSet.has(key)) return false;
|
|
611
|
+
return true;
|
|
612
|
+
} else return allKeys.length && allKeys.every((rowKey) => selectedRowKeysSet.has(rowKey)) || false;
|
|
613
|
+
}
|
|
614
|
+
static formatPaginationInfo({ total, pageSize, currentPage } = {}, defaultPageText = "", formatPageText) {
|
|
615
|
+
let info = "";
|
|
616
|
+
const currentStart = Math.min((currentPage - 1) * pageSize + 1, total);
|
|
617
|
+
const currentEnd = Math.min(currentPage * pageSize, total);
|
|
618
|
+
if (formatPageText || formatPageText !== false && defaultPageText && total > 0) info = typeof formatPageText === "function" ? formatPageText({
|
|
619
|
+
currentStart,
|
|
620
|
+
currentEnd,
|
|
621
|
+
total
|
|
622
|
+
}) : formatLocale(defaultPageText, {
|
|
623
|
+
currentStart,
|
|
624
|
+
currentEnd,
|
|
625
|
+
total
|
|
626
|
+
});
|
|
627
|
+
return info;
|
|
628
|
+
}
|
|
629
|
+
static isSortOrderValid(sortOrder) {
|
|
630
|
+
return typeof sortOrder === "string" && strings.SORT_DIRECTIONS.includes(sortOrder) || sortOrder === false;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* What a header cell shows for a column, from the column as given and its query (the state kept by dataIndex).
|
|
634
|
+
* @param hasFilterDropdown whether the column brings its own filter dropdown; the framework knows what counts as one
|
|
635
|
+
*/
|
|
636
|
+
static getColumnFlags(column, queries, hasFilterDropdown) {
|
|
637
|
+
const hasSorter = typeof column.sorter === "function" || column.sorter === true;
|
|
638
|
+
const hasFilter = Array.isArray(column.filters) && column.filters.length > 0 || hasFilterDropdown || typeof column.renderFilterDropdown === "function";
|
|
639
|
+
const query = column.dataIndex != null ? queries?.find((item) => item.dataIndex === column.dataIndex) : void 0;
|
|
640
|
+
const stateSortOrder = query?.sortOrder;
|
|
641
|
+
return {
|
|
642
|
+
hasSorter,
|
|
643
|
+
hasFilter,
|
|
644
|
+
needsTitle: Boolean(column.sorter || column.filters || column.onFilter || column.useFullRender || hasFilter),
|
|
645
|
+
clickToSort: hasSorter && !hasFilter && !column.useFullRender,
|
|
646
|
+
showSortTip: !TableFoundation.#sortOrderIsControlled(column) && column.showSortTip === true,
|
|
647
|
+
query,
|
|
648
|
+
sortOrder: TableFoundation.isSortOrderValid(stateSortOrder) ? stateSortOrder : query?.defaultSortOrder ?? false,
|
|
649
|
+
filteredValue: query?.filteredValue ? query.filteredValue : query?.defaultFilteredValue
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* The state that follows props, derived during render. Returns null when nothing changed.
|
|
654
|
+
* @param flattenColumns the leaf columns of the props, the same reference until the columns change
|
|
655
|
+
*/
|
|
656
|
+
static deriveState(props, state, flattenColumns) {
|
|
657
|
+
const changes = {};
|
|
658
|
+
const { rowSelection, dataSource, pagination, expandedRowKeys } = props;
|
|
659
|
+
if (flattenColumns !== state.flattenColumns) {
|
|
660
|
+
changes.flattenColumns = flattenColumns;
|
|
661
|
+
changes.queries = mergeColumns(state.queries, flattenColumns);
|
|
662
|
+
}
|
|
663
|
+
if (rowSelection !== state.prePropRowSelection) {
|
|
664
|
+
const newSelectionStates = isObject(rowSelection) ? { ...rowSelection } : rowSelection ? {} : null;
|
|
665
|
+
const selectedRowKeys = isObject(rowSelection) ? rowSelection.selectedRowKeys : void 0;
|
|
666
|
+
const getCheckboxProps = isObject(rowSelection) ? rowSelection.getCheckboxProps : void 0;
|
|
667
|
+
if (newSelectionStates) {
|
|
668
|
+
if (Array.isArray(selectedRowKeys)) newSelectionStates.selectedRowKeysSet = new Set(selectedRowKeys);
|
|
669
|
+
else if (isObject(state.prePropRowSelection) && Array.isArray(state.prePropRowSelection.selectedRowKeys)) {
|
|
670
|
+
newSelectionStates.selectedRowKeys = [];
|
|
671
|
+
newSelectionStates.selectedRowKeysSet = /* @__PURE__ */ new Set();
|
|
672
|
+
} else if (state.rowSelection) {
|
|
673
|
+
newSelectionStates.selectedRowKeys = state.rowSelection.selectedRowKeys;
|
|
674
|
+
newSelectionStates.selectedRowKeysSet = state.rowSelection.selectedRowKeysSet;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
if (typeof getCheckboxProps === "function") {
|
|
678
|
+
const disabledRowKeys = TableFoundation.getAllDisabledRowKeys(props, dataSource, getCheckboxProps);
|
|
679
|
+
const disabledRowKeysSet = new Set(disabledRowKeys);
|
|
680
|
+
changes.pageDisabledRowKeys = disabledRowKeys;
|
|
681
|
+
changes.pageDisabledRowKeysSet = disabledRowKeysSet;
|
|
682
|
+
changes.filteredDisabledRowKeys = disabledRowKeys;
|
|
683
|
+
changes.filteredDisabledRowKeysSet = disabledRowKeysSet;
|
|
684
|
+
}
|
|
685
|
+
const halfCheckedRowKeys = newSelectionStates?.checkRelation === "related" ? TableFoundation.#getRelatedCheckedRowKeys(newSelectionStates.selectedRowKeys, state.keyEntities).halfCheckedRowKeys : [];
|
|
686
|
+
changes.halfCheckedRowKeys = halfCheckedRowKeys;
|
|
687
|
+
changes.halfCheckedRowKeysSet = new Set(halfCheckedRowKeys);
|
|
688
|
+
changes.rowSelection = newSelectionStates;
|
|
689
|
+
changes.prePropRowSelection = rowSelection;
|
|
690
|
+
}
|
|
691
|
+
if (pagination !== state.prePagination) {
|
|
692
|
+
changes.pagination = {
|
|
693
|
+
...isObject(state.pagination) ? pick(state.pagination, [
|
|
694
|
+
"currentPage",
|
|
695
|
+
"pageSize",
|
|
696
|
+
"total"
|
|
697
|
+
]) : {},
|
|
698
|
+
...isObject(pagination) ? pagination : {}
|
|
699
|
+
};
|
|
700
|
+
changes.prePagination = pagination;
|
|
701
|
+
}
|
|
702
|
+
if (expandedRowKeys !== state.preExpandedRowKeys) {
|
|
703
|
+
if (Array.isArray(expandedRowKeys)) changes.expandedRowKeys = expandedRowKeys;
|
|
704
|
+
else if (Array.isArray(state.preExpandedRowKeys)) changes.expandedRowKeys = [];
|
|
705
|
+
changes.preExpandedRowKeys = expandedRowKeys;
|
|
706
|
+
}
|
|
707
|
+
return Object.keys(changes).length ? changes : null;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* @param queries copies of flattenColumns with initColumnsFilteredValueAndSorterOrder applied; the framework copies
|
|
711
|
+
* them, since a deep clone would break framework values held by a column
|
|
712
|
+
*/
|
|
713
|
+
static getInitialState(props, flattenColumns, queries) {
|
|
714
|
+
const filteredSortedDataSource = TableFoundation.getFilteredSortedDataSource(props, props.dataSource, queries);
|
|
715
|
+
const filteredSortedRowKeys = TableFoundation.getAllRowKeys(props, filteredSortedDataSource);
|
|
716
|
+
const pageData = TableFoundation.getPageData(props, filteredSortedDataSource, isObject(props.pagination) ? props.pagination : {}, queries);
|
|
717
|
+
const related = isObject(props.rowSelection) && props.rowSelection.checkRelation === "related";
|
|
718
|
+
const state = {
|
|
719
|
+
flattenColumns,
|
|
720
|
+
queries,
|
|
721
|
+
dataSource: pageData.dataSource,
|
|
722
|
+
expandedRowKeys: [...props.expandedRowKeys || [], ...props.defaultExpandedRowKeys || []],
|
|
723
|
+
preExpandedRowKeys: props.expandedRowKeys,
|
|
724
|
+
rowSelection: props.rowSelection ? isObject(props.rowSelection) ? { ...props.rowSelection } : {} : null,
|
|
725
|
+
pagination: pageData.pagination,
|
|
726
|
+
groups: pageData.groups ?? null,
|
|
727
|
+
allRowKeys: pageData.allRowKeys,
|
|
728
|
+
pageDisabledRowKeys: [],
|
|
729
|
+
pageDisabledRowKeysSet: /* @__PURE__ */ new Set(),
|
|
730
|
+
filteredDisabledRowKeys: [],
|
|
731
|
+
filteredDisabledRowKeysSet: /* @__PURE__ */ new Set(),
|
|
732
|
+
headWidths: [],
|
|
733
|
+
bodyHasScrollBar: false,
|
|
734
|
+
prePropRowSelection: void 0,
|
|
735
|
+
prePagination: void 0,
|
|
736
|
+
halfCheckedRowKeys: [],
|
|
737
|
+
halfCheckedRowKeysSet: /* @__PURE__ */ new Set(),
|
|
738
|
+
keyEntities: related && props.dataSource?.length ? TableFoundation.buildKeyEntities(props, props.dataSource) : {},
|
|
739
|
+
filteredSortedDataSource,
|
|
740
|
+
filteredSortedRowKeys,
|
|
741
|
+
filteredSortedRowKeysSet: new Set(filteredSortedRowKeys)
|
|
742
|
+
};
|
|
743
|
+
const filteredDisabledRowKeys = TableFoundation.getAllDisabledRowKeys(props, filteredSortedDataSource);
|
|
744
|
+
return {
|
|
745
|
+
...state,
|
|
746
|
+
...TableFoundation.deriveState(props, state, flattenColumns),
|
|
747
|
+
pageDisabledRowKeys: pageData.disabledRowKeys,
|
|
748
|
+
pageDisabledRowKeysSet: new Set(pageData.disabledRowKeys),
|
|
749
|
+
filteredDisabledRowKeys,
|
|
750
|
+
filteredDisabledRowKeysSet: new Set(filteredDisabledRowKeys)
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
/** Hosts call it after mount, on body scroll and when the table or its content resizes */
|
|
754
|
+
syncScrollEdges = () => {
|
|
755
|
+
this.#trackScrollEdges ??= !CSS.supports("container-type", "scroll-state");
|
|
756
|
+
const body = this.#trackScrollEdges ? this.adapter.getBodyWrapper() : null;
|
|
757
|
+
if (body) TableFoundation.#syncScrollableEdges(body);
|
|
758
|
+
};
|
|
759
|
+
/** `index` is the header row the widths were measured in */
|
|
760
|
+
setHeadWidths = (widths, index = 0) => {
|
|
761
|
+
const prevHeadWidths = this.getState("headWidths") ?? [];
|
|
762
|
+
if (!isEqual(prevHeadWidths[index], widths)) {
|
|
763
|
+
const nextHeadWidths = [...prevHeadWidths];
|
|
764
|
+
nextHeadWidths[index] = [...widths];
|
|
765
|
+
this.setState({ headWidths: nextHeadWidths });
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
setBodyHasScrollbar = (bodyHasScrollBar) => {
|
|
769
|
+
if (bodyHasScrollBar !== this.getState("bodyHasScrollBar")) this.setState({ bodyHasScrollBar });
|
|
770
|
+
};
|
|
771
|
+
handlePropsChange(prev) {
|
|
772
|
+
const derived = TableFoundation.deriveState(this.getProps(), this.getStates(), this.getProp("flattenColumns"));
|
|
773
|
+
if (derived) this.setState(derived);
|
|
774
|
+
const props = this.getProps();
|
|
775
|
+
const flattenColumns = this.getState("flattenColumns");
|
|
776
|
+
if ((props.rowSelection || props.expandedRowRender || flattenColumns.some((column) => column.onFilter)) && props.dataSource?.some((record) => TableFoundation.getRecordKey(props, record) == null)) {
|
|
777
|
+
if (isDev()) console.error("[Semi Table] You must specify a key for each element in the dataSource or use \"rowKey\" to specify an attribute name as the primary key!");
|
|
778
|
+
}
|
|
779
|
+
if (props.flattenColumns !== prev.flattenColumns) this.#warnMissingDataIndex();
|
|
780
|
+
if (props.expandAllRows !== prev.expandAllRows || props.expandAllGroupRows !== prev.expandAllGroupRows) this.initExpandedRowKeys({ groups: this.getState("groups") });
|
|
781
|
+
const dataSourceChanged = props.dataSource !== prev.dataSource;
|
|
782
|
+
const recompute = dataSourceChanged || flattenColumns !== prev.flattenColumns;
|
|
783
|
+
if (this.#getCheckRelation() === "related" && !(isObject(prev.rowSelection) && prev.rowSelection.checkRelation === "related") && !recompute) this.#updateKeyEntities();
|
|
784
|
+
this.#handleDataUpdate(dataSourceChanged, recompute, prev.pagination);
|
|
785
|
+
}
|
|
786
|
+
initExpandedRowKeys({ groups } = {}) {
|
|
787
|
+
const { defaultExpandAllRows, defaultExpandedRowKeys = [], expandedRowKeys: propExpandedRowKeys = [], dataSource = [], expandAllRows, defaultExpandAllGroupRows, expandAllGroupRows } = this.getProps();
|
|
788
|
+
const expandedRowKeys = [];
|
|
789
|
+
if (defaultExpandAllRows || expandAllRows) this.#addNoDuplicatedItemsToArr(expandedRowKeys, this.getAllRowKeys(dataSource), groups && groups instanceof Map && groups.size ? Array.from(groups.keys()) : []);
|
|
790
|
+
else if (defaultExpandAllGroupRows || expandAllGroupRows) this.#addNoDuplicatedItemsToArr(expandedRowKeys, propExpandedRowKeys, groups && groups instanceof Map && groups.size ? Array.from(groups.keys()) : []);
|
|
791
|
+
else if (Array.isArray(defaultExpandedRowKeys) && defaultExpandedRowKeys.length) this.#addNoDuplicatedItemsToArr(expandedRowKeys, defaultExpandedRowKeys);
|
|
792
|
+
else if (Array.isArray(propExpandedRowKeys) && propExpandedRowKeys.length) this.#addNoDuplicatedItemsToArr(expandedRowKeys, propExpandedRowKeys);
|
|
793
|
+
this.setState({ expandedRowKeys });
|
|
794
|
+
}
|
|
795
|
+
/** The rows and groups of the current page as the foundation keeps them; the host clones them before handing them out */
|
|
796
|
+
getCurrentPageData = () => {
|
|
797
|
+
const { dataSource, groups } = this.#getPageData();
|
|
798
|
+
return {
|
|
799
|
+
...dataSource && { dataSource },
|
|
800
|
+
...groups && { groups }
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
/** Pagination's onChange: a pagination.onChange of the user's takes over paging, still with the scrollToFirstRowOnChange scroll */
|
|
804
|
+
handlePageChange = (currentPage, pageSize) => {
|
|
805
|
+
if (typeof this.getProp("pagination")?.onChange !== "function") {
|
|
806
|
+
this.setPage(currentPage, pageSize);
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
if (this.getProp("scroll")?.scrollToFirstRowOnChange) this.#resetScrollY();
|
|
810
|
+
this.adapter.notifyPageChange(currentPage, pageSize);
|
|
811
|
+
};
|
|
812
|
+
setPage = (currentPage, currentPageSize) => {
|
|
813
|
+
const currentPagination = this.getState("pagination");
|
|
814
|
+
currentPage = currentPage || (currentPagination?.currentPage ?? 1);
|
|
815
|
+
const { dataSource, pagination, disabledRowKeys, allRowKeys } = this.#getPageData(null, {
|
|
816
|
+
...currentPagination,
|
|
817
|
+
currentPage,
|
|
818
|
+
pageSize: currentPageSize
|
|
819
|
+
});
|
|
820
|
+
if (!TableFoundation.#pagerIsControlled(this.getProps()) && currentPage > 0) {
|
|
821
|
+
this.#setPageDisabledRowKeys(disabledRowKeys);
|
|
822
|
+
this.setState({
|
|
823
|
+
allRowKeys,
|
|
824
|
+
pagination,
|
|
825
|
+
dataSource
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
this.#notifyChange(pagination, void 0, void 0, { changeType: "pagination" });
|
|
829
|
+
};
|
|
830
|
+
handleSelectionKeyUp = (e) => {
|
|
831
|
+
if (e.key === " ") this.#spaceShiftKey = e.shiftKey;
|
|
832
|
+
};
|
|
833
|
+
handleSelectRow = (realKey, selected, e) => {
|
|
834
|
+
e?.stopPropagation();
|
|
835
|
+
if (typeof selected === "boolean" && realKey != null) {
|
|
836
|
+
const checkRelation = this.#getCheckRelation();
|
|
837
|
+
const native = e?.nativeEvent;
|
|
838
|
+
const shiftKey = e?.shiftKey ?? (native?.shiftKey || native?.detail === 0 && this.#spaceShiftKey);
|
|
839
|
+
this.#spaceShiftKey = false;
|
|
840
|
+
if (shiftKey && checkRelation !== "related" && this.#rangeAnchor != null && this.#selectRange(realKey)) return;
|
|
841
|
+
this.#rangeAnchor = realKey;
|
|
842
|
+
this.#rangeResult = null;
|
|
843
|
+
const selectedRowKeys = this.#getSelectedRowKeys();
|
|
844
|
+
const halfCheckedRowKeys = [...this.getState("halfCheckedRowKeys") ?? []];
|
|
845
|
+
let foundIdx = -1;
|
|
846
|
+
const selectedRow = this.getRecordsByKeys(null, [realKey])[0];
|
|
847
|
+
let selectedRows;
|
|
848
|
+
if (checkRelation === "related") {
|
|
849
|
+
const checkedKeysSet = new Set(selectedRowKeys.map((key) => String(key)));
|
|
850
|
+
const halfCheckedKeysSet = new Set(halfCheckedRowKeys.map((key) => String(key)));
|
|
851
|
+
const { checkedKeys, halfCheckedKeys } = this.calcCheckedKeysForSelect(String(realKey), selected, checkedKeysSet, halfCheckedKeysSet);
|
|
852
|
+
const keyEntities = this.getState("keyEntities") ?? {};
|
|
853
|
+
const newSelectedRowKeys = TableFoundation.#restoreRowKeys(checkedKeys, [...selectedRowKeys, realKey], keyEntities);
|
|
854
|
+
const newHalfCheckedRowKeys = TableFoundation.#restoreRowKeys(halfCheckedKeys, halfCheckedRowKeys, keyEntities);
|
|
855
|
+
selectedRows = this.getRecordsByKeys(null, newSelectedRowKeys);
|
|
856
|
+
if (!this.#selectionIsControlled()) {
|
|
857
|
+
this.#setSelectedRowKeys(newSelectedRowKeys);
|
|
858
|
+
this.#setHalfCheckedRowKeys(newHalfCheckedRowKeys);
|
|
859
|
+
}
|
|
860
|
+
this.adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
861
|
+
this.adapter.notifySelectionChange(newSelectedRowKeys, selectedRows);
|
|
862
|
+
} else if ((foundIdx = selectedRowKeys.indexOf(realKey)) > -1 && selected === false) {
|
|
863
|
+
selectedRowKeys.splice(foundIdx, 1);
|
|
864
|
+
selectedRows = this.getRecordsByKeys(null, selectedRowKeys);
|
|
865
|
+
if (!this.#selectionIsControlled()) this.#setSelectedRowKeys(selectedRowKeys);
|
|
866
|
+
this.adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
867
|
+
this.adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
868
|
+
} else if (selectedRowKeys.indexOf(realKey) === -1 && selected === true) {
|
|
869
|
+
selectedRowKeys.push(realKey);
|
|
870
|
+
selectedRows = this.getRecordsByKeys(null, selectedRowKeys);
|
|
871
|
+
if (!this.#selectionIsControlled()) this.#setSelectedRowKeys(selectedRowKeys);
|
|
872
|
+
this.adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
873
|
+
this.adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
handleSelectAllRow = (selected, e) => {
|
|
878
|
+
e?.stopPropagation();
|
|
879
|
+
if (typeof selected === "boolean") {
|
|
880
|
+
const checkRelation = this.#getCheckRelation();
|
|
881
|
+
const curSelectedRowKeys = this.#getSelectedRowKeys();
|
|
882
|
+
let selectedRowKeys = [...curSelectedRowKeys];
|
|
883
|
+
const selectedRowKeysSet = this.#getSelectedRowKeysSet();
|
|
884
|
+
const disabledRowKeysSet = this.#getFilteredDisabledRowKeysSet();
|
|
885
|
+
const scopeRowKeys = (this.getState("filteredSortedRowKeys") ?? []).filter((key) => !disabledRowKeysSet.has(key));
|
|
886
|
+
if (checkRelation === "related") {
|
|
887
|
+
const keyEntities = this.getState("keyEntities") ?? {};
|
|
888
|
+
const halfCheckedRowKeys = [...this.getState("halfCheckedRowKeys") ?? []];
|
|
889
|
+
let checkedKeysSet = new Set(selectedRowKeys.map((key) => String(key)));
|
|
890
|
+
let halfCheckedKeysSet = new Set(halfCheckedRowKeys.map((key) => String(key)));
|
|
891
|
+
if (selected) {
|
|
892
|
+
if (keyEntities) {
|
|
893
|
+
const result = calcCheckedKeysForCheckedKeys(scopeRowKeys.map((key) => String(key)), keyEntities, checkedKeysSet, halfCheckedKeysSet);
|
|
894
|
+
checkedKeysSet = result.checkedKeys;
|
|
895
|
+
halfCheckedKeysSet = result.halfCheckedKeys;
|
|
896
|
+
}
|
|
897
|
+
} else for (const key of scopeRowKeys.map((rowKey) => String(rowKey))) if (checkedKeysSet.has(key) && keyEntities && keyEntities[key]) {
|
|
898
|
+
const result = calcCheckedKeysForUnchecked(key, keyEntities, checkedKeysSet, halfCheckedKeysSet);
|
|
899
|
+
checkedKeysSet = result.checkedKeys;
|
|
900
|
+
halfCheckedKeysSet = result.halfCheckedKeys;
|
|
901
|
+
}
|
|
902
|
+
selectedRowKeys = TableFoundation.#restoreRowKeys(checkedKeysSet, [...curSelectedRowKeys, ...scopeRowKeys], keyEntities);
|
|
903
|
+
const newHalfCheckedRowKeys = TableFoundation.#restoreRowKeys(halfCheckedKeysSet, halfCheckedRowKeys, keyEntities);
|
|
904
|
+
const changedRows = this.getRecordsByKeys(null, getChangedRowKeys(curSelectedRowKeys, selectedRowKeys));
|
|
905
|
+
const selectedRows = this.getRecordsByKeys(null, selectedRowKeys || []);
|
|
906
|
+
if (!this.#selectionIsControlled()) {
|
|
907
|
+
this.#setSelectedRowKeys(selectedRowKeys);
|
|
908
|
+
this.#setHalfCheckedRowKeys(newHalfCheckedRowKeys);
|
|
909
|
+
}
|
|
910
|
+
this.adapter.notifySelectAll(selected, selectedRows, changedRows, e);
|
|
911
|
+
this.adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
912
|
+
} else {
|
|
913
|
+
if (selected) {
|
|
914
|
+
for (const key of scopeRowKeys) if (!selectedRowKeysSet.has(key)) selectedRowKeys.push(key);
|
|
915
|
+
} else selectedRowKeys = differenceUnique(selectedRowKeys, scopeRowKeys);
|
|
916
|
+
const changedRows = this.getRecordsByKeys(null, getChangedRowKeys(curSelectedRowKeys, selectedRowKeys));
|
|
917
|
+
const selectedRows = this.getRecordsByKeys(null, selectedRowKeys || []);
|
|
918
|
+
if (!this.#selectionIsControlled()) this.#setSelectedRowKeys(selectedRowKeys);
|
|
919
|
+
this.adapter.notifySelectAll(selected, selectedRows, changedRows, e);
|
|
920
|
+
this.adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
};
|
|
924
|
+
handleRowExpanded = (expanded, realKey, domEvent) => {
|
|
925
|
+
domEvent?.stopPropagation();
|
|
926
|
+
const expandedRowKeys = [...this.getState("expandedRowKeys")];
|
|
927
|
+
const index = expandedRowKeys.indexOf(realKey);
|
|
928
|
+
const keyIsValid = typeof realKey === "string" || typeof realKey === "number";
|
|
929
|
+
if (keyIsValid && expanded && index === -1) expandedRowKeys.push(realKey);
|
|
930
|
+
else if (keyIsValid && !expanded && index > -1) expandedRowKeys.splice(index, 1);
|
|
931
|
+
if (!this.#rowExpansionIsControlled()) this.setState({ expandedRowKeys: [...expandedRowKeys] });
|
|
932
|
+
const expandedRows = this.getRecordsByKeys(null, expandedRowKeys);
|
|
933
|
+
let expandedRow = this.getRecordsByKeys(null, [realKey])[0];
|
|
934
|
+
const groups = this.#getGroups();
|
|
935
|
+
if (groups) {
|
|
936
|
+
if (groups.has(realKey)) expandedRow = { groupKey: realKey };
|
|
937
|
+
for (const groupKey of expandedRowKeys) if (groups.has(groupKey)) expandedRows.push({ groupKey });
|
|
938
|
+
}
|
|
939
|
+
this.adapter.notifyExpand(expanded, expandedRow, domEvent);
|
|
940
|
+
this.adapter.notifyExpandedRowsChange(expandedRows, [...expandedRowKeys]);
|
|
941
|
+
};
|
|
942
|
+
toggleShowFilter = (dataIndex, visible) => {
|
|
943
|
+
const column = dataIndex ? this.getQuery(dataIndex) : void 0;
|
|
944
|
+
if (column) this.adapter.notifyFilterDropdownVisibleChange(column, visible);
|
|
945
|
+
};
|
|
946
|
+
handleFilterSelect = (dataIndex, data = {}) => {
|
|
947
|
+
const query = {
|
|
948
|
+
...this.getQuery(dataIndex),
|
|
949
|
+
filteredValue: data.filteredValue
|
|
950
|
+
};
|
|
951
|
+
const queries = this.#mergeToQueries(query, null);
|
|
952
|
+
const filters = this.#getAllFilters(queries);
|
|
953
|
+
const pagination = this.#getPagination();
|
|
954
|
+
const sorter = this.#getAllSorters()[0];
|
|
955
|
+
if (!this.#filterIsControlled(dataIndex)) {
|
|
956
|
+
this.setState({ queries });
|
|
957
|
+
this.#applyQueries(queries);
|
|
958
|
+
}
|
|
959
|
+
this.#notifyChange(pagination, filters, sorter, { changeType: "filter" });
|
|
960
|
+
};
|
|
961
|
+
handleSort = ({ dataIndex } = {}) => {
|
|
962
|
+
let queries = this.getState("queries");
|
|
963
|
+
let curQuery = null;
|
|
964
|
+
queries = [...queries];
|
|
965
|
+
queries.forEach((query, idx, arr) => {
|
|
966
|
+
if (query.sorter) {
|
|
967
|
+
const sorterObj = { ...query };
|
|
968
|
+
const stateSortOrder = sorterObj.sortOrder;
|
|
969
|
+
const defaultSortOrder = sorterObj.defaultSortOrder ?? false;
|
|
970
|
+
let querySortOrder = TableFoundation.isSortOrderValid(stateSortOrder) ? stateSortOrder : defaultSortOrder;
|
|
971
|
+
if (dataIndex && dataIndex === sorterObj.dataIndex) {
|
|
972
|
+
if (querySortOrder === strings.SORT_DIRECTIONS[0]) querySortOrder = strings.SORT_DIRECTIONS[1];
|
|
973
|
+
else if (querySortOrder === strings.SORT_DIRECTIONS[1]) querySortOrder = false;
|
|
974
|
+
else querySortOrder = strings.SORT_DIRECTIONS[0];
|
|
975
|
+
} else querySortOrder = false;
|
|
976
|
+
arr[idx] = {
|
|
977
|
+
...sorterObj,
|
|
978
|
+
sortOrder: querySortOrder
|
|
979
|
+
};
|
|
980
|
+
if (dataIndex === sorterObj.dataIndex) curQuery = arr[idx];
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
const pagination = this.#getPagination();
|
|
984
|
+
const filters = this.#getAllFilters();
|
|
985
|
+
if (!this.#sorterIsControlled(dataIndex)) {
|
|
986
|
+
this.setState({ queries });
|
|
987
|
+
this.#applyQueries(queries);
|
|
988
|
+
}
|
|
989
|
+
this.#notifyChange(pagination, filters, curQuery, { changeType: "sorter" });
|
|
990
|
+
};
|
|
991
|
+
handleRowClickSelection = (rowKey, selected, e) => {
|
|
992
|
+
const rowSelection = this.getState("rowSelection");
|
|
993
|
+
if (rowSelection?.clickRow && !rowSelection.disabled) {
|
|
994
|
+
const getCheckboxProps = rowSelection?.getCheckboxProps;
|
|
995
|
+
const record = (this.getState("filteredSortedDataSource") ?? []).find((r) => this.getRecordKey(r) === rowKey);
|
|
996
|
+
if (record && typeof getCheckboxProps === "function" && getCheckboxProps(record).disabled) return;
|
|
997
|
+
this.handleSelectRow(rowKey, selected, e);
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
};
|
|
1001
|
+
export { TableFoundation as default };
|