@fibrae/semi-foundation 0.0.0-stage → 0.1.1
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 +84 -0
- package/README.md +76 -2
- package/dist/_portal/portal.css +12 -0
- package/dist/_portal/portal.scss +18 -0
- package/dist/anchor/anchor.css +118 -0
- package/dist/anchor/anchor.scss +148 -0
- package/dist/anchor/animation.scss +7 -0
- package/dist/anchor/constants.d.ts +9 -0
- package/dist/anchor/constants.js +14 -0
- package/dist/anchor/foundation.d.ts +49 -0
- package/dist/anchor/foundation.js +143 -0
- package/dist/anchor/rtl.scss +9 -0
- package/dist/anchor/utils.d.ts +6 -0
- package/dist/anchor/utils.js +16 -0
- package/dist/anchor/variables.scss +34 -0
- package/dist/audio-player/audio-player.css +226 -0
- package/dist/audio-player/audio-player.scss +278 -0
- package/dist/audio-player/constants.d.ts +11 -0
- package/dist/audio-player/constants.js +27 -0
- package/dist/audio-player/foundation.d.ts +46 -0
- package/dist/audio-player/foundation.js +116 -0
- package/dist/audio-player/utils.d.ts +2 -0
- package/dist/audio-player/utils.js +6 -0
- package/dist/audio-player/variables.scss +53 -0
- package/dist/auto-complete/animation.scss +5 -0
- package/dist/auto-complete/auto-complete.css +99 -0
- package/dist/auto-complete/auto-complete.scss +36 -0
- package/dist/auto-complete/constants.d.ts +4 -0
- package/dist/auto-complete/constants.js +7 -0
- package/dist/auto-complete/foundation.d.ts +77 -0
- package/dist/auto-complete/foundation.js +219 -0
- package/dist/auto-complete/option.scss +78 -0
- package/dist/auto-complete/rtl.scss +9 -0
- package/dist/auto-complete/variables.scss +23 -0
- package/dist/avatar/animation.scss +13 -0
- package/dist/avatar/avatar.css +652 -0
- package/dist/avatar/avatar.scss +540 -0
- package/dist/avatar/constants.d.ts +6 -0
- package/dist/avatar/constants.js +13 -0
- package/dist/avatar/foundation.d.ts +29 -0
- package/dist/avatar/foundation.js +31 -0
- package/dist/avatar/mixin.scss +7 -0
- package/dist/avatar/rtl.scss +11 -0
- package/dist/avatar/variables.scss +113 -0
- package/dist/backtop/backtop.css +9 -0
- package/dist/backtop/backtop.scss +15 -0
- package/dist/backtop/constants.d.ts +6 -0
- package/dist/backtop/constants.js +35 -0
- package/dist/backtop/foundation.d.ts +26 -0
- package/dist/backtop/foundation.js +69 -0
- package/dist/backtop/rtl.scss +8 -0
- package/dist/backtop/variables.scss +4 -0
- package/dist/badge/badge.css +131 -0
- package/dist/badge/badge.scss +158 -0
- package/dist/badge/constants.d.ts +3 -0
- package/dist/badge/constants.js +4 -0
- package/dist/badge/rtl.scss +8 -0
- package/dist/badge/variables.scss +46 -0
- package/dist/banner/banner.css +75 -0
- package/dist/banner/banner.scss +107 -0
- package/dist/banner/constants.d.ts +3 -0
- package/dist/banner/constants.js +4 -0
- package/dist/banner/foundation.d.ts +9 -0
- package/dist/banner/foundation.js +9 -0
- package/dist/banner/rtl.scss +8 -0
- package/dist/banner/variables.scss +29 -0
- package/dist/base/auto-close-foundation.d.ts +30 -0
- package/dist/base/auto-close-foundation.js +61 -0
- package/dist/base/base.scss +36 -0
- package/dist/base/constants.d.ts +11 -0
- package/dist/base/constants.js +23 -0
- package/dist/base/env.d.ts +1 -0
- package/dist/base/env.js +3 -0
- package/dist/base/foundation.d.ts +75 -0
- package/dist/base/foundation.js +79 -0
- package/dist/base/list-store.d.ts +26 -0
- package/dist/base/list-store.js +80 -0
- package/dist/base/mixin.scss +61 -0
- package/dist/base/tokens.css +799 -0
- package/dist/base/tokens.scss +3 -0
- package/dist/breadcrumb/animation.scss +7 -0
- package/dist/breadcrumb/breadcrumb.css +91 -0
- package/dist/breadcrumb/breadcrumb.scss +116 -0
- package/dist/breadcrumb/constants.d.ts +7 -0
- package/dist/breadcrumb/constants.js +8 -0
- package/dist/breadcrumb/foundation.d.ts +37 -0
- package/dist/breadcrumb/foundation.js +61 -0
- package/dist/breadcrumb/item-foundation.d.ts +45 -0
- package/dist/breadcrumb/item-foundation.js +36 -0
- package/dist/breadcrumb/rtl.scss +9 -0
- package/dist/breadcrumb/variables.scss +23 -0
- package/dist/button/animation.scss +63 -0
- package/dist/button/button.css +406 -0
- package/dist/button/button.scss +513 -0
- package/dist/button/constants.d.ts +6 -0
- package/dist/button/constants.js +5 -0
- package/dist/button/icon-button.css +65 -0
- package/dist/button/icon-button.scss +76 -0
- package/dist/button/rtl.scss +18 -0
- package/dist/button/split-button-group.scss +36 -0
- package/dist/button/utils.d.ts +27 -0
- package/dist/button/utils.js +89 -0
- package/dist/button/variables.scss +169 -0
- package/dist/calendar/calendar.css +486 -0
- package/dist/calendar/calendar.scss +518 -0
- package/dist/calendar/constants.d.ts +10 -0
- package/dist/calendar/constants.js +14 -0
- package/dist/calendar/event-util.d.ts +74 -0
- package/dist/calendar/event-util.js +203 -0
- package/dist/calendar/foundation.d.ts +80 -0
- package/dist/calendar/foundation.js +198 -0
- package/dist/calendar/month-foundation.d.ts +11 -0
- package/dist/calendar/month-foundation.js +13 -0
- package/dist/calendar/rtl.scss +10 -0
- package/dist/calendar/variables.scss +95 -0
- package/dist/card/card.css +124 -0
- package/dist/card/card.scss +149 -0
- package/dist/card/constants.d.ts +3 -0
- package/dist/card/constants.js +4 -0
- package/dist/card/rtl.scss +18 -0
- package/dist/card/variables.scss +32 -0
- package/dist/carousel/animation.scss +9 -0
- package/dist/carousel/carousel.css +345 -0
- package/dist/carousel/carousel.scss +451 -0
- package/dist/carousel/constants.d.ts +27 -0
- package/dist/carousel/constants.js +42 -0
- package/dist/carousel/foundation.d.ts +61 -0
- package/dist/carousel/foundation.js +204 -0
- package/dist/carousel/rtl.scss +14 -0
- package/dist/carousel/variables.scss +49 -0
- package/dist/cascader/animation.scss +5 -0
- package/dist/cascader/cascader.css +488 -0
- package/dist/cascader/cascader.scss +586 -0
- package/dist/cascader/constants.d.ts +19 -0
- package/dist/cascader/constants.js +20 -0
- package/dist/cascader/foundation.d.ts +300 -0
- package/dist/cascader/foundation.js +893 -0
- package/dist/cascader/rtl.scss +14 -0
- package/dist/cascader/util.d.ts +37 -0
- package/dist/cascader/util.js +155 -0
- package/dist/cascader/variables.scss +134 -0
- package/dist/checkbox/animation.scss +11 -0
- package/dist/checkbox/checkbox-foundation.d.ts +97 -0
- package/dist/checkbox/checkbox-foundation.js +65 -0
- package/dist/checkbox/checkbox-group-foundation.d.ts +21 -0
- package/dist/checkbox/checkbox-group-foundation.js +28 -0
- package/dist/checkbox/checkbox.css +301 -0
- package/dist/checkbox/checkbox.scss +415 -0
- package/dist/checkbox/constants.d.ts +14 -0
- package/dist/checkbox/constants.js +15 -0
- package/dist/checkbox/mixin.scss +3 -0
- package/dist/checkbox/rtl.scss +11 -0
- package/dist/checkbox/variables.scss +72 -0
- package/dist/code-highlight/code-highlight.css +54 -0
- package/dist/code-highlight/code-highlight.scss +65 -0
- package/dist/code-highlight/constants.d.ts +3 -0
- package/dist/code-highlight/constants.js +4 -0
- package/dist/code-highlight/highlighter.d.ts +3 -0
- package/dist/code-highlight/highlighter.js +56 -0
- package/dist/code-highlight/index.d.ts +25 -0
- package/dist/code-highlight/index.js +19 -0
- package/dist/code-highlight/registry.d.ts +23 -0
- package/dist/code-highlight/registry.js +33 -0
- package/dist/code-highlight/variables.scss +1 -0
- package/dist/collapse/collapse.css +101 -0
- package/dist/collapse/collapse.scss +112 -0
- package/dist/collapse/constants.d.ts +3 -0
- package/dist/collapse/constants.js +4 -0
- package/dist/collapse/foundation.d.ts +47 -0
- package/dist/collapse/foundation.js +44 -0
- package/dist/collapse/rtl.scss +8 -0
- package/dist/collapse/variables.scss +25 -0
- package/dist/collapsible/animation.scss +9 -0
- package/dist/collapsible/collapsible.css +17 -0
- package/dist/collapsible/collapsible.scss +28 -0
- package/dist/collapsible/constants.d.ts +3 -0
- package/dist/collapsible/constants.js +4 -0
- package/dist/collapsible/foundation.d.ts +68 -0
- package/dist/collapsible/foundation.js +123 -0
- package/dist/collapsible/variables.scss +1 -0
- package/dist/color-picker/alpha-slider-foundation.d.ts +29 -0
- package/dist/color-picker/alpha-slider-foundation.js +41 -0
- package/dist/color-picker/color-choose-area-foundation.d.ts +36 -0
- package/dist/color-picker/color-choose-area-foundation.js +57 -0
- package/dist/color-picker/color-picker.css +104 -0
- package/dist/color-picker/color-picker.scss +131 -0
- package/dist/color-picker/color-slider-foundation.d.ts +29 -0
- package/dist/color-picker/color-slider-foundation.js +41 -0
- package/dist/color-picker/constants.d.ts +3 -0
- package/dist/color-picker/constants.js +4 -0
- package/dist/color-picker/data-part-foundation.d.ts +28 -0
- package/dist/color-picker/data-part-foundation.js +76 -0
- package/dist/color-picker/foundation.d.ts +56 -0
- package/dist/color-picker/foundation.js +149 -0
- package/dist/color-picker/interface.d.ts +32 -0
- package/dist/color-picker/interface.js +0 -0
- package/dist/color-picker/utils/convert.d.ts +16 -0
- package/dist/color-picker/utils/convert.js +150 -0
- package/dist/color-picker/utils/round.d.ts +1 -0
- package/dist/color-picker/utils/round.js +5 -0
- package/dist/color-picker/utils/split.d.ts +5 -0
- package/dist/color-picker/utils/split.js +26 -0
- package/dist/color-picker/variables.scss +26 -0
- package/dist/config-provider/breakpoint-observer.d.ts +23 -0
- package/dist/config-provider/breakpoint-observer.js +139 -0
- package/dist/config-provider/inherit-config.d.ts +24 -0
- package/dist/config-provider/inherit-config.js +24 -0
- package/dist/config-provider/responsive-types.d.ts +39 -0
- package/dist/config-provider/responsive-types.js +0 -0
- package/dist/cropper/constants.d.ts +21 -0
- package/dist/cropper/constants.js +37 -0
- package/dist/cropper/cropper.css +101 -0
- package/dist/cropper/cropper.scss +129 -0
- package/dist/cropper/foundation.d.ts +91 -0
- package/dist/cropper/foundation.js +804 -0
- package/dist/cropper/utils.d.ts +20 -0
- package/dist/cropper/utils.js +23 -0
- package/dist/cropper/variables.scss +8 -0
- package/dist/date-picker/_utils/formatter.d.ts +6 -0
- package/dist/date-picker/_utils/formatter.js +21 -0
- package/dist/date-picker/_utils/get-day-of-week.d.ts +5 -0
- package/dist/date-picker/_utils/get-day-of-week.js +14 -0
- package/dist/date-picker/_utils/get-default-format-token.d.ts +10 -0
- package/dist/date-picker/_utils/get-default-format-token.js +18 -0
- package/dist/date-picker/_utils/get-default-picker-date.d.ts +15 -0
- package/dist/date-picker/_utils/get-default-picker-date.js +38 -0
- package/dist/date-picker/_utils/get-full-date-offset.d.ts +3 -0
- package/dist/date-picker/_utils/get-full-date-offset.js +11 -0
- package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +20 -0
- package/dist/date-picker/_utils/get-inset-input-format-token.js +35 -0
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +30 -0
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +59 -0
- package/dist/date-picker/_utils/get-month-table.d.ts +15 -0
- package/dist/date-picker/_utils/get-month-table.js +33 -0
- package/dist/date-picker/_utils/get-year-and-month.d.ts +16 -0
- package/dist/date-picker/_utils/get-year-and-month.js +18 -0
- package/dist/date-picker/_utils/get-year-month-from-value.d.ts +12 -0
- package/dist/date-picker/_utils/get-year-month-from-value.js +18 -0
- package/dist/date-picker/_utils/get-years.d.ts +1 -0
- package/dist/date-picker/_utils/get-years.js +9 -0
- package/dist/date-picker/_utils/index.d.ts +11 -0
- package/dist/date-picker/_utils/index.js +11 -0
- package/dist/date-picker/_utils/is-after.d.ts +1 -0
- package/dist/date-picker/_utils/is-after.js +7 -0
- package/dist/date-picker/_utils/is-before.d.ts +1 -0
- package/dist/date-picker/_utils/is-before.js +7 -0
- package/dist/date-picker/_utils/is-between.d.ts +8 -0
- package/dist/date-picker/_utils/is-between.js +11 -0
- package/dist/date-picker/_utils/is-same-day.d.ts +1 -0
- package/dist/date-picker/_utils/is-same-day.js +7 -0
- package/dist/date-picker/_utils/is-timestamp.d.ts +1 -0
- package/dist/date-picker/_utils/is-timestamp.js +6 -0
- package/dist/date-picker/_utils/is-valid-date.d.ts +1 -0
- package/dist/date-picker/_utils/is-valid-date.js +5 -0
- package/dist/date-picker/_utils/parser.d.ts +5 -0
- package/dist/date-picker/_utils/parser.js +24 -0
- package/dist/date-picker/_utils/picker-type.d.ts +20 -0
- package/dist/date-picker/_utils/picker-type.js +30 -0
- package/dist/date-picker/_utils/to-callback-args.d.ts +18 -0
- package/dist/date-picker/_utils/to-callback-args.js +47 -0
- package/dist/date-picker/_utils/to-date-arg.d.ts +6 -0
- package/dist/date-picker/_utils/to-date-arg.js +13 -0
- package/dist/date-picker/animation.scss +1 -0
- package/dist/date-picker/constants.d.ts +53 -0
- package/dist/date-picker/constants.js +78 -0
- package/dist/date-picker/date-picker.css +1285 -0
- package/dist/date-picker/date-picker.scss +1765 -0
- package/dist/date-picker/foundation.d.ts +336 -0
- package/dist/date-picker/foundation.js +736 -0
- package/dist/date-picker/input-foundation.d.ts +144 -0
- package/dist/date-picker/input-foundation.js +214 -0
- package/dist/date-picker/month-foundation.d.ts +157 -0
- package/dist/date-picker/month-foundation.js +188 -0
- package/dist/date-picker/months-grid-foundation.d.ts +180 -0
- package/dist/date-picker/months-grid-foundation.js +557 -0
- package/dist/date-picker/rtl.scss +28 -0
- package/dist/date-picker/variables.scss +237 -0
- package/dist/date-picker/year-and-month-foundation.d.ts +75 -0
- package/dist/date-picker/year-and-month-foundation.js +115 -0
- package/dist/descriptions/constants.d.ts +3 -0
- package/dist/descriptions/constants.js +4 -0
- package/dist/descriptions/descriptions.css +138 -0
- package/dist/descriptions/descriptions.scss +182 -0
- package/dist/descriptions/foundation.d.ts +12 -0
- package/dist/descriptions/foundation.js +36 -0
- package/dist/descriptions/rtl.scss +8 -0
- package/dist/descriptions/variables.scss +26 -0
- package/dist/divider/constants.d.ts +3 -0
- package/dist/divider/constants.js +4 -0
- package/dist/divider/divider.css +60 -0
- package/dist/divider/divider.scss +83 -0
- package/dist/divider/variables.scss +24 -0
- package/dist/drag-move/foundation.d.ts +31 -0
- package/dist/drag-move/foundation.js +178 -0
- package/dist/dropdown/animation.scss +5 -0
- package/dist/dropdown/constants.d.ts +11 -0
- package/dist/dropdown/constants.js +12 -0
- package/dist/dropdown/dropdown.css +154 -0
- package/dist/dropdown/dropdown.scss +128 -0
- package/dist/dropdown/foundation.d.ts +37 -0
- package/dist/dropdown/foundation.js +120 -0
- package/dist/dropdown/menu-foundation.d.ts +36 -0
- package/dist/dropdown/menu-foundation.js +82 -0
- package/dist/dropdown/rtl.scss +9 -0
- package/dist/dropdown/variables.scss +42 -0
- package/dist/empty/constants.d.ts +6 -0
- package/dist/empty/constants.js +5 -0
- package/dist/empty/empty.css +41 -0
- package/dist/empty/empty.scss +56 -0
- package/dist/empty/rtl.scss +8 -0
- package/dist/empty/variables.scss +10 -0
- package/dist/feedback/constants.d.ts +12 -0
- package/dist/feedback/constants.js +19 -0
- package/dist/feedback/feedback.css +110 -0
- package/dist/feedback/feedback.scss +153 -0
- package/dist/feedback/foundation.d.ts +43 -0
- package/dist/feedback/foundation.js +72 -0
- package/dist/feedback/variables.scss +26 -0
- package/dist/float-button/constants.d.ts +10 -0
- package/dist/float-button/constants.js +13 -0
- package/dist/float-button/float-button.css +159 -0
- package/dist/float-button/float-button.scss +203 -0
- package/dist/float-button/rtl.scss +2 -0
- package/dist/float-button/variables.scss +47 -0
- package/dist/form/constants.d.ts +7 -0
- package/dist/form/constants.js +8 -0
- package/dist/form/field-store.d.ts +10 -0
- package/dist/form/field-store.js +28 -0
- package/dist/form/form-api-proxy.d.ts +13 -0
- package/dist/form/form-api-proxy.js +48 -0
- package/dist/form/form.css +229 -0
- package/dist/form/form.scss +307 -0
- package/dist/form/foundation.d.ts +65 -0
- package/dist/form/foundation.js +836 -0
- package/dist/form/interface.d.ts +171 -0
- package/dist/form/interface.js +0 -0
- package/dist/form/rtl.scss +13 -0
- package/dist/form/utils.d.ts +89 -0
- package/dist/form/utils.js +115 -0
- package/dist/form/variables.scss +53 -0
- package/dist/grid/constants.d.ts +6 -0
- package/dist/grid/constants.js +12 -0
- package/dist/grid/grid.css +4206 -0
- package/dist/grid/grid.scss +101 -0
- package/dist/grid/gutter.d.ts +12 -0
- package/dist/grid/gutter.js +39 -0
- package/dist/grid/mixin.scss +119 -0
- package/dist/grid/rtl.scss +10 -0
- package/dist/grid/utils.d.ts +22 -0
- package/dist/grid/utils.js +39 -0
- package/dist/grid/variables.scss +29 -0
- package/dist/highlight/constants.d.ts +3 -0
- package/dist/highlight/constants.js +4 -0
- package/dist/highlight/foundation.d.ts +59 -0
- package/dist/highlight/foundation.js +110 -0
- package/dist/highlight/highlight.css +5 -0
- package/dist/highlight/highlight.scss +11 -0
- package/dist/highlight/variables.scss +6 -0
- package/dist/hot-keys/constants.d.ts +105 -0
- package/dist/hot-keys/constants.js +207 -0
- package/dist/hot-keys/foundation.d.ts +19 -0
- package/dist/hot-keys/foundation.js +92 -0
- package/dist/hot-keys/hot-keys.css +29 -0
- package/dist/hot-keys/hot-keys.scss +30 -0
- package/dist/hot-keys/variables.scss +12 -0
- package/dist/image/animation.scss +9 -0
- package/dist/image/constants.d.ts +6 -0
- package/dist/image/constants.js +5 -0
- package/dist/image/image-foundation.d.ts +30 -0
- package/dist/image/image-foundation.js +40 -0
- package/dist/image/image.css +250 -0
- package/dist/image/image.scss +272 -0
- package/dist/image/preview-footer-foundation.d.ts +26 -0
- package/dist/image/preview-footer-foundation.js +30 -0
- package/dist/image/preview-foundation.d.ts +51 -0
- package/dist/image/preview-foundation.js +70 -0
- package/dist/image/preview-image-foundation.d.ts +70 -0
- package/dist/image/preview-image-foundation.js +226 -0
- package/dist/image/preview-inner-foundation.d.ts +87 -0
- package/dist/image/preview-inner-foundation.js +238 -0
- package/dist/image/rtl.scss +28 -0
- package/dist/image/utils.d.ts +4 -0
- package/dist/image/utils.js +66 -0
- package/dist/image/variables.scss +44 -0
- package/dist/input/animation.scss +11 -0
- package/dist/input/constants.d.ts +9 -0
- package/dist/input/constants.js +14 -0
- package/dist/input/foundation.d.ts +51 -0
- package/dist/input/foundation.js +79 -0
- package/dist/input/input.css +616 -0
- package/dist/input/input.scss +738 -0
- package/dist/input/rtl.scss +11 -0
- package/dist/input/text-entry-foundation.d.ts +55 -0
- package/dist/input/text-entry-foundation.js +93 -0
- package/dist/input/textarea-foundation.d.ts +61 -0
- package/dist/input/textarea-foundation.js +130 -0
- package/dist/input/textarea.css +257 -0
- package/dist/input/textarea.scss +313 -0
- package/dist/input/util/line-number.d.ts +2 -0
- package/dist/input/util/line-number.js +42 -0
- package/dist/input/util/truncate-value.d.ts +5 -0
- package/dist/input/util/truncate-value.js +14 -0
- package/dist/input/variables.scss +107 -0
- package/dist/input-number/animation.scss +11 -0
- package/dist/input-number/caret.d.ts +4 -0
- package/dist/input-number/caret.js +21 -0
- package/dist/input-number/constants.d.ts +15 -0
- package/dist/input-number/constants.js +13 -0
- package/dist/input-number/foundation.d.ts +110 -0
- package/dist/input-number/foundation.js +557 -0
- package/dist/input-number/input-number.css +84 -0
- package/dist/input-number/input-number.scss +124 -0
- package/dist/input-number/rtl.scss +9 -0
- package/dist/input-number/variables.scss +26 -0
- package/dist/json-viewer/constants.d.ts +3 -0
- package/dist/json-viewer/constants.js +4 -0
- package/dist/json-viewer/foundation.d.ts +42 -0
- package/dist/json-viewer/foundation.js +124 -0
- package/dist/json-viewer/json-viewer.css +183 -0
- package/dist/json-viewer/json-viewer.scss +224 -0
- package/dist/json-viewer/variables.scss +18 -0
- package/dist/layout/constants.d.ts +3 -0
- package/dist/layout/constants.js +4 -0
- package/dist/layout/layout.css +36 -0
- package/dist/layout/layout.scss +51 -0
- package/dist/layout/rtl.scss +7 -0
- package/dist/list/constants.d.ts +3 -0
- package/dist/list/constants.js +4 -0
- package/dist/list/list.css +123 -0
- package/dist/list/list.scss +162 -0
- package/dist/list/rtl.scss +9 -0
- package/dist/list/variables.scss +18 -0
- package/dist/locale/interface.d.ts +663 -0
- package/dist/locale/interface.js +0 -0
- package/dist/locale/resolve-locale.d.ts +6 -0
- package/dist/locale/resolve-locale.js +17 -0
- package/dist/locale/source/ar.d.ts +3 -0
- package/dist/locale/source/ar.js +502 -0
- package/dist/locale/source/az.d.ts +3 -0
- package/dist/locale/source/az.js +502 -0
- package/dist/locale/source/bg.d.ts +3 -0
- package/dist/locale/source/bg.js +502 -0
- package/dist/locale/source/bn_IN.d.ts +3 -0
- package/dist/locale/source/bn_IN.js +502 -0
- package/dist/locale/source/ca.d.ts +3 -0
- package/dist/locale/source/ca.js +502 -0
- package/dist/locale/source/ceb_PH.d.ts +3 -0
- package/dist/locale/source/ceb_PH.js +502 -0
- package/dist/locale/source/cs_CZ.d.ts +3 -0
- package/dist/locale/source/cs_CZ.js +502 -0
- package/dist/locale/source/da.d.ts +3 -0
- package/dist/locale/source/da.js +502 -0
- package/dist/locale/source/de.d.ts +3 -0
- package/dist/locale/source/de.js +502 -0
- package/dist/locale/source/el_GR.d.ts +3 -0
- package/dist/locale/source/el_GR.js +502 -0
- package/dist/locale/source/en_GB.d.ts +3 -0
- package/dist/locale/source/en_GB.js +502 -0
- package/dist/locale/source/en_US.d.ts +3 -0
- package/dist/locale/source/en_US.js +502 -0
- package/dist/locale/source/es.d.ts +3 -0
- package/dist/locale/source/es.js +502 -0
- package/dist/locale/source/es_419.d.ts +3 -0
- package/dist/locale/source/es_419.js +502 -0
- package/dist/locale/source/et.d.ts +3 -0
- package/dist/locale/source/et.js +502 -0
- package/dist/locale/source/fa_IR.d.ts +3 -0
- package/dist/locale/source/fa_IR.js +502 -0
- package/dist/locale/source/fi_FI.d.ts +3 -0
- package/dist/locale/source/fi_FI.js +502 -0
- package/dist/locale/source/fil_PH.d.ts +3 -0
- package/dist/locale/source/fil_PH.js +502 -0
- package/dist/locale/source/fr.d.ts +3 -0
- package/dist/locale/source/fr.js +502 -0
- package/dist/locale/source/fr_CA.d.ts +3 -0
- package/dist/locale/source/fr_CA.js +502 -0
- package/dist/locale/source/ga.d.ts +3 -0
- package/dist/locale/source/ga.js +502 -0
- package/dist/locale/source/he_IL.d.ts +3 -0
- package/dist/locale/source/he_IL.js +502 -0
- package/dist/locale/source/hi_IN.d.ts +3 -0
- package/dist/locale/source/hi_IN.js +502 -0
- package/dist/locale/source/hr.d.ts +3 -0
- package/dist/locale/source/hr.js +502 -0
- package/dist/locale/source/hu_HU.d.ts +3 -0
- package/dist/locale/source/hu_HU.js +502 -0
- package/dist/locale/source/id_ID.d.ts +3 -0
- package/dist/locale/source/id_ID.js +502 -0
- package/dist/locale/source/is.d.ts +3 -0
- package/dist/locale/source/is.js +502 -0
- package/dist/locale/source/it.d.ts +3 -0
- package/dist/locale/source/it.js +502 -0
- package/dist/locale/source/ja_JP.d.ts +3 -0
- package/dist/locale/source/ja_JP.js +502 -0
- package/dist/locale/source/jv_ID.d.ts +3 -0
- package/dist/locale/source/jv_ID.js +502 -0
- package/dist/locale/source/kk.d.ts +3 -0
- package/dist/locale/source/kk.js +502 -0
- package/dist/locale/source/km_KH.d.ts +3 -0
- package/dist/locale/source/km_KH.js +502 -0
- package/dist/locale/source/ko_KR.d.ts +3 -0
- package/dist/locale/source/ko_KR.js +502 -0
- package/dist/locale/source/lt.d.ts +3 -0
- package/dist/locale/source/lt.js +502 -0
- package/dist/locale/source/lv.d.ts +3 -0
- package/dist/locale/source/lv.js +502 -0
- package/dist/locale/source/ms_MY.d.ts +3 -0
- package/dist/locale/source/ms_MY.js +502 -0
- package/dist/locale/source/my_MM.d.ts +3 -0
- package/dist/locale/source/my_MM.js +502 -0
- package/dist/locale/source/nb.d.ts +3 -0
- package/dist/locale/source/nb.js +502 -0
- package/dist/locale/source/nl_NL.d.ts +3 -0
- package/dist/locale/source/nl_NL.js +502 -0
- package/dist/locale/source/pl_PL.d.ts +3 -0
- package/dist/locale/source/pl_PL.js +502 -0
- package/dist/locale/source/pt.d.ts +3 -0
- package/dist/locale/source/pt.js +502 -0
- package/dist/locale/source/pt_BR.d.ts +3 -0
- package/dist/locale/source/pt_BR.js +502 -0
- package/dist/locale/source/ro.d.ts +3 -0
- package/dist/locale/source/ro.js +502 -0
- package/dist/locale/source/ru_RU.d.ts +3 -0
- package/dist/locale/source/ru_RU.js +502 -0
- package/dist/locale/source/sk.d.ts +3 -0
- package/dist/locale/source/sk.js +502 -0
- package/dist/locale/source/sl.d.ts +3 -0
- package/dist/locale/source/sl.js +502 -0
- package/dist/locale/source/sq.d.ts +3 -0
- package/dist/locale/source/sq.js +502 -0
- package/dist/locale/source/sv_SE.d.ts +3 -0
- package/dist/locale/source/sv_SE.js +502 -0
- package/dist/locale/source/sw.d.ts +3 -0
- package/dist/locale/source/sw.js +502 -0
- package/dist/locale/source/th_TH.d.ts +3 -0
- package/dist/locale/source/th_TH.js +502 -0
- package/dist/locale/source/tr_TR.d.ts +3 -0
- package/dist/locale/source/tr_TR.js +502 -0
- package/dist/locale/source/uk_UA.d.ts +3 -0
- package/dist/locale/source/uk_UA.js +502 -0
- package/dist/locale/source/ur.d.ts +3 -0
- package/dist/locale/source/ur.js +502 -0
- package/dist/locale/source/uz.d.ts +3 -0
- package/dist/locale/source/uz.js +502 -0
- package/dist/locale/source/vi_VN.d.ts +3 -0
- package/dist/locale/source/vi_VN.js +502 -0
- package/dist/locale/source/zh_CN.d.ts +3 -0
- package/dist/locale/source/zh_CN.js +502 -0
- package/dist/locale/source/zh_TW.d.ts +3 -0
- package/dist/locale/source/zh_TW.js +502 -0
- package/dist/lottie/constants.d.ts +3 -0
- package/dist/lottie/constants.js +4 -0
- package/dist/lottie/foundation.d.ts +24 -0
- package/dist/lottie/foundation.js +62 -0
- package/dist/markdown-render/constants.d.ts +3 -0
- package/dist/markdown-render/constants.js +4 -0
- package/dist/markdown-render/foundation.d.ts +50 -0
- package/dist/markdown-render/foundation.js +101 -0
- package/dist/markdown-render/markdown-render.css +59 -0
- package/dist/markdown-render/markdown-render.scss +79 -0
- package/dist/markdown-render/variables.scss +31 -0
- package/dist/modal/animation.scss +25 -0
- package/dist/modal/confirm.d.ts +13 -0
- package/dist/modal/confirm.js +34 -0
- package/dist/modal/constants.d.ts +3 -0
- package/dist/modal/constants.js +4 -0
- package/dist/modal/modal-content-foundation.d.ts +40 -0
- package/dist/modal/modal-content-foundation.js +48 -0
- package/dist/modal/modal-foundation.d.ts +85 -0
- package/dist/modal/modal-foundation.js +74 -0
- package/dist/modal/modal.css +235 -0
- package/dist/modal/modal.scss +285 -0
- package/dist/modal/rtl.scss +10 -0
- package/dist/modal/variables.scss +70 -0
- package/dist/navigation/animation.scss +5 -0
- package/dist/navigation/constants.d.ts +17 -0
- package/dist/navigation/constants.js +20 -0
- package/dist/navigation/foundation.d.ts +75 -0
- package/dist/navigation/foundation.js +158 -0
- package/dist/navigation/item-foundation.d.ts +44 -0
- package/dist/navigation/item-foundation.js +42 -0
- package/dist/navigation/mixin.scss +100 -0
- package/dist/navigation/navigation.css +779 -0
- package/dist/navigation/navigation.scss +764 -0
- package/dist/navigation/rtl.scss +17 -0
- package/dist/navigation/sub-nav-foundation.d.ts +31 -0
- package/dist/navigation/sub-nav-foundation.js +54 -0
- package/dist/navigation/variables.scss +120 -0
- package/dist/notification/animation.scss +12 -0
- package/dist/notification/constants.d.ts +19 -0
- package/dist/notification/constants.js +32 -0
- package/dist/notification/notification-foundation.d.ts +33 -0
- package/dist/notification/notification-foundation.js +5 -0
- package/dist/notification/notification-list-foundation.d.ts +56 -0
- package/dist/notification/notification-list-foundation.js +49 -0
- package/dist/notification/notification.css +398 -0
- package/dist/notification/notification.scss +428 -0
- package/dist/notification/rtl.scss +9 -0
- package/dist/notification/variables.scss +41 -0
- package/dist/overflow-list/constants.d.ts +17 -0
- package/dist/overflow-list/constants.js +16 -0
- package/dist/overflow-list/foundation.d.ts +78 -0
- package/dist/overflow-list/foundation.js +189 -0
- package/dist/overflow-list/overflow-list.css +19 -0
- package/dist/overflow-list/overflow-list.scss +24 -0
- package/dist/overflow-list/rtl.scss +7 -0
- package/dist/pagination/animation.scss +11 -0
- package/dist/pagination/constants.d.ts +8 -0
- package/dist/pagination/constants.js +14 -0
- package/dist/pagination/foundation.d.ts +61 -0
- package/dist/pagination/foundation.js +175 -0
- package/dist/pagination/pagination.css +192 -0
- package/dist/pagination/pagination.scss +189 -0
- package/dist/pagination/rtl.scss +14 -0
- package/dist/pagination/variables.scss +45 -0
- package/dist/pincode/constants.d.ts +3 -0
- package/dist/pincode/constants.js +4 -0
- package/dist/pincode/foundation.d.ts +39 -0
- package/dist/pincode/foundation.js +86 -0
- package/dist/pincode/pincode.css +30 -0
- package/dist/pincode/pincode.scss +47 -0
- package/dist/pincode/variables.scss +9 -0
- package/dist/popconfirm/constants.d.ts +7 -0
- package/dist/popconfirm/constants.js +8 -0
- package/dist/popconfirm/popconfirm-foundation.d.ts +38 -0
- package/dist/popconfirm/popconfirm-foundation.js +57 -0
- package/dist/popconfirm/popconfirm.css +69 -0
- package/dist/popconfirm/popconfirm.scss +84 -0
- package/dist/popconfirm/rtl.scss +12 -0
- package/dist/popconfirm/variables.scss +26 -0
- package/dist/popover/animation.scss +5 -0
- package/dist/popover/constants.d.ts +21 -0
- package/dist/popover/constants.js +47 -0
- package/dist/popover/popover.css +212 -0
- package/dist/popover/popover.scss +64 -0
- package/dist/popover/rtl.scss +9 -0
- package/dist/popover/variables.scss +25 -0
- package/dist/progress/constants.d.ts +7 -0
- package/dist/progress/constants.js +8 -0
- package/dist/progress/generates.d.ts +11 -0
- package/dist/progress/generates.js +27 -0
- package/dist/progress/progress.css +142 -0
- package/dist/progress/progress.scss +170 -0
- package/dist/progress/rtl.scss +13 -0
- package/dist/progress/utils.d.ts +18 -0
- package/dist/progress/utils.js +45 -0
- package/dist/progress/variables.scss +26 -0
- package/dist/radio/animation.scss +9 -0
- package/dist/radio/constants.d.ts +16 -0
- package/dist/radio/constants.js +19 -0
- package/dist/radio/mixin.scss +3 -0
- package/dist/radio/radio-foundation.d.ts +78 -0
- package/dist/radio/radio-foundation.js +94 -0
- package/dist/radio/radio-group-foundation.d.ts +18 -0
- package/dist/radio/radio-group-foundation.js +27 -0
- package/dist/radio/radio.css +332 -0
- package/dist/radio/radio.scss +457 -0
- package/dist/radio/rtl.scss +11 -0
- package/dist/radio/variables.scss +107 -0
- package/dist/rating/animation.scss +7 -0
- package/dist/rating/constants.d.ts +6 -0
- package/dist/rating/constants.js +5 -0
- package/dist/rating/foundation.d.ts +109 -0
- package/dist/rating/foundation.js +167 -0
- package/dist/rating/rating.css +89 -0
- package/dist/rating/rating.scss +119 -0
- package/dist/rating/rtl.scss +9 -0
- package/dist/rating/variables.scss +19 -0
- package/dist/resizable/constants.d.ts +3 -0
- package/dist/resizable/constants.js +4 -0
- package/dist/resizable/foundation.d.ts +3 -0
- package/dist/resizable/foundation.js +3 -0
- package/dist/resizable/group/index.d.ts +55 -0
- package/dist/resizable/group/index.js +313 -0
- package/dist/resizable/resizable.css +125 -0
- package/dist/resizable/resizable.scss +147 -0
- package/dist/resizable/single/index.d.ts +90 -0
- package/dist/resizable/single/index.js +429 -0
- package/dist/resizable/types.d.ts +43 -0
- package/dist/resizable/types.js +18 -0
- package/dist/resizable/utils.d.ts +23 -0
- package/dist/resizable/utils.js +53 -0
- package/dist/resizable/variables.scss +10 -0
- package/dist/scroll-list/animation.scss +5 -0
- package/dist/scroll-list/constants.d.ts +8 -0
- package/dist/scroll-list/constants.js +11 -0
- package/dist/scroll-list/item-foundation.d.ts +56 -0
- package/dist/scroll-list/item-foundation.js +336 -0
- package/dist/scroll-list/rtl.scss +9 -0
- package/dist/scroll-list/scroll-list.css +178 -0
- package/dist/scroll-list/scroll-list.scss +198 -0
- package/dist/scroll-list/scroll-to.d.ts +2 -0
- package/dist/scroll-list/scroll-to.js +15 -0
- package/dist/scroll-list/variables.scss +50 -0
- package/dist/select/animation.scss +16 -0
- package/dist/select/combobox-name.d.ts +10 -0
- package/dist/select/combobox-name.js +21 -0
- package/dist/select/constants.d.ts +15 -0
- package/dist/select/constants.js +22 -0
- package/dist/select/foundation.d.ts +140 -0
- package/dist/select/foundation.js +775 -0
- package/dist/select/mixin.scss +8 -0
- package/dist/select/option-foundation.d.ts +51 -0
- package/dist/select/option-foundation.js +44 -0
- package/dist/select/option.scss +86 -0
- package/dist/select/rtl.scss +10 -0
- package/dist/select/select.css +533 -0
- package/dist/select/select.scss +554 -0
- package/dist/select/variables.scss +128 -0
- package/dist/side-sheet/animation.scss +17 -0
- package/dist/side-sheet/constants.d.ts +6 -0
- package/dist/side-sheet/constants.js +5 -0
- package/dist/side-sheet/rtl.scss +9 -0
- package/dist/side-sheet/side-sheet-foundation.d.ts +69 -0
- package/dist/side-sheet/side-sheet-foundation.js +54 -0
- package/dist/side-sheet/side-sheet.css +285 -0
- package/dist/side-sheet/side-sheet.scss +356 -0
- package/dist/side-sheet/variables.scss +27 -0
- package/dist/skeleton/animation.scss +4 -0
- package/dist/skeleton/constants.d.ts +3 -0
- package/dist/skeleton/constants.js +4 -0
- package/dist/skeleton/rtl.scss +9 -0
- package/dist/skeleton/skeleton.css +84 -0
- package/dist/skeleton/skeleton.scss +115 -0
- package/dist/skeleton/variables.scss +21 -0
- package/dist/slider/animation.scss +7 -0
- package/dist/slider/constants.d.ts +9 -0
- package/dist/slider/constants.js +12 -0
- package/dist/slider/foundation.d.ts +167 -0
- package/dist/slider/foundation.js +441 -0
- package/dist/slider/rtl.scss +23 -0
- package/dist/slider/slider.css +239 -0
- package/dist/slider/slider.scss +269 -0
- package/dist/slider/variables.scss +67 -0
- package/dist/sortable/accessibility.d.ts +14 -0
- package/dist/sortable/accessibility.js +45 -0
- package/dist/space/constants.d.ts +8 -0
- package/dist/space/constants.js +9 -0
- package/dist/space/rtl.scss +8 -0
- package/dist/space/space.css +46 -0
- package/dist/space/space.scss +65 -0
- package/dist/space/variables.scss +5 -0
- package/dist/spin/animation.scss +4 -0
- package/dist/spin/constants.d.ts +3 -0
- package/dist/spin/constants.js +3 -0
- package/dist/spin/foundation.d.ts +20 -0
- package/dist/spin/foundation.js +43 -0
- package/dist/spin/mixin.scss +7 -0
- package/dist/spin/rtl.scss +11 -0
- package/dist/spin/spin.css +97 -0
- package/dist/spin/spin.scss +111 -0
- package/dist/spin/variables.scss +11 -0
- package/dist/steps/animation.scss +15 -0
- package/dist/steps/bacis-steps.scss +338 -0
- package/dist/steps/constants.d.ts +5 -0
- package/dist/steps/constants.js +8 -0
- package/dist/steps/fill-steps.scss +179 -0
- package/dist/steps/mixin.scss +3 -0
- package/dist/steps/nav-steps.scss +66 -0
- package/dist/steps/rtl.scss +14 -0
- package/dist/steps/steps.css +523 -0
- package/dist/steps/steps.scss +17 -0
- package/dist/steps/utils.d.ts +10 -0
- package/dist/steps/utils.js +15 -0
- package/dist/steps/variables.scss +95 -0
- package/dist/switch/animation.scss +5 -0
- package/dist/switch/constants.d.ts +13 -0
- package/dist/switch/constants.js +16 -0
- package/dist/switch/foundation.d.ts +24 -0
- package/dist/switch/foundation.js +19 -0
- package/dist/switch/rtl.scss +98 -0
- package/dist/switch/switch.css +293 -0
- package/dist/switch/switch.scss +317 -0
- package/dist/switch/variables.scss +75 -0
- package/dist/table/animation.scss +7 -0
- package/dist/table/constants.d.ts +62 -0
- package/dist/table/constants.js +97 -0
- package/dist/table/foundation.d.ts +354 -0
- package/dist/table/foundation.js +870 -0
- package/dist/table/mixin.scss +12 -0
- package/dist/table/operation-panel.scss +42 -0
- package/dist/table/rtl.scss +24 -0
- package/dist/table/table.css +636 -0
- package/dist/table/table.scss +789 -0
- package/dist/table/utils.d.ts +187 -0
- package/dist/table/utils.js +482 -0
- package/dist/table/variables.scss +85 -0
- package/dist/tabs/animation.scss +30 -0
- package/dist/tabs/constants.d.ts +28 -0
- package/dist/tabs/constants.js +37 -0
- package/dist/tabs/foundation.d.ts +91 -0
- package/dist/tabs/foundation.js +189 -0
- package/dist/tabs/rtl.scss +16 -0
- package/dist/tabs/tabs.css +699 -0
- package/dist/tabs/tabs.scss +933 -0
- package/dist/tabs/variables.scss +155 -0
- package/dist/tag/constants.d.ts +8 -0
- package/dist/tag/constants.js +35 -0
- package/dist/tag/focus.d.ts +6 -0
- package/dist/tag/focus.js +23 -0
- package/dist/tag/mixin.scss +18 -0
- package/dist/tag/rtl.scss +12 -0
- package/dist/tag/tag-key.d.ts +9 -0
- package/dist/tag/tag-key.js +18 -0
- package/dist/tag/tag.css +537 -0
- package/dist/tag/tag.scss +359 -0
- package/dist/tag/variables.scss +85 -0
- package/dist/tag-input/animation.scss +9 -0
- package/dist/tag-input/constants.d.ts +6 -0
- package/dist/tag-input/constants.js +9 -0
- package/dist/tag-input/foundation.d.ts +91 -0
- package/dist/tag-input/foundation.js +222 -0
- package/dist/tag-input/rtl.scss +9 -0
- package/dist/tag-input/tag-input.css +297 -0
- package/dist/tag-input/tag-input.scss +358 -0
- package/dist/tag-input/utils/get-splited-array.d.ts +4 -0
- package/dist/tag-input/utils/get-splited-array.js +16 -0
- package/dist/tag-input/utils/tag-focus.d.ts +3 -0
- package/dist/tag-input/utils/tag-focus.js +15 -0
- package/dist/tag-input/variables.scss +57 -0
- package/dist/theme/_font.scss +49 -0
- package/dist/theme/_palette.scss +474 -0
- package/dist/theme/animation.scss +40 -0
- package/dist/theme/global.scss +287 -0
- package/dist/theme/index.scss +3 -0
- package/dist/theme/mixin.scss +66 -0
- package/dist/theme/variables.scss +56 -0
- package/dist/time-picker/combox-foundation.d.ts +79 -0
- package/dist/time-picker/combox-foundation.js +103 -0
- package/dist/time-picker/constants.d.ts +18 -0
- package/dist/time-picker/constants.js +23 -0
- package/dist/time-picker/foundation.d.ts +108 -0
- package/dist/time-picker/foundation.js +254 -0
- package/dist/time-picker/input-foundation.d.ts +15 -0
- package/dist/time-picker/input-foundation.js +33 -0
- package/dist/time-picker/rtl.scss +10 -0
- package/dist/time-picker/time-picker.css +82 -0
- package/dist/time-picker/time-picker.scss +128 -0
- package/dist/time-picker/utils/index.d.ts +18 -0
- package/dist/time-picker/utils/index.js +68 -0
- package/dist/time-picker/variables.scss +19 -0
- package/dist/timeline/constants.d.ts +4 -0
- package/dist/timeline/constants.js +7 -0
- package/dist/timeline/rtl.scss +13 -0
- package/dist/timeline/timeline.css +137 -0
- package/dist/timeline/timeline.scss +190 -0
- package/dist/timeline/utils.d.ts +3 -0
- package/dist/timeline/utils.js +10 -0
- package/dist/timeline/variables.scss +48 -0
- package/dist/toast/animation.scss +16 -0
- package/dist/toast/constants.d.ts +25 -0
- package/dist/toast/constants.js +34 -0
- package/dist/toast/rtl.scss +9 -0
- package/dist/toast/toast-foundation.d.ts +37 -0
- package/dist/toast/toast-foundation.js +5 -0
- package/dist/toast/toast-list-foundation.d.ts +25 -0
- package/dist/toast/toast-list-foundation.js +54 -0
- package/dist/toast/toast.css +174 -0
- package/dist/toast/toast.scss +238 -0
- package/dist/toast/variables.scss +45 -0
- package/dist/tooltip/adjust-position.d.ts +41 -0
- package/dist/tooltip/adjust-position.js +202 -0
- package/dist/tooltip/animation.scss +4 -0
- package/dist/tooltip/arrow.scss +178 -0
- package/dist/tooltip/constants.d.ts +50 -0
- package/dist/tooltip/constants.js +96 -0
- package/dist/tooltip/foundation.d.ts +105 -0
- package/dist/tooltip/foundation.js +650 -0
- package/dist/tooltip/position.scss +63 -0
- package/dist/tooltip/rtl.scss +9 -0
- package/dist/tooltip/tooltip.css +229 -0
- package/dist/tooltip/tooltip.scss +72 -0
- package/dist/tooltip/variables.scss +34 -0
- package/dist/transfer/animation.scss +5 -0
- package/dist/transfer/constants.d.ts +11 -0
- package/dist/transfer/constants.js +10 -0
- package/dist/transfer/foundation.d.ts +112 -0
- package/dist/transfer/foundation.js +179 -0
- package/dist/transfer/rtl.scss +9 -0
- package/dist/transfer/transfer-utils.d.ts +5 -0
- package/dist/transfer/transfer-utils.js +45 -0
- package/dist/transfer/transfer.css +237 -0
- package/dist/transfer/transfer.scss +260 -0
- package/dist/transfer/variables.scss +50 -0
- package/dist/tree/animation.scss +7 -0
- package/dist/tree/constants.d.ts +7 -0
- package/dist/tree/constants.js +8 -0
- package/dist/tree/foundation.d.ts +296 -0
- package/dist/tree/foundation.js +539 -0
- package/dist/tree/rtl.scss +16 -0
- package/dist/tree/shared.d.ts +128 -0
- package/dist/tree/shared.js +308 -0
- package/dist/tree/tree-util.d.ts +105 -0
- package/dist/tree/tree-util.js +455 -0
- package/dist/tree/tree.css +387 -0
- package/dist/tree/tree.scss +439 -0
- package/dist/tree/variables.scss +39 -0
- package/dist/tree-select/constants.d.ts +11 -0
- package/dist/tree-select/constants.js +19 -0
- package/dist/tree-select/foundation.d.ts +176 -0
- package/dist/tree-select/foundation.js +610 -0
- package/dist/tree-select/rtl.scss +9 -0
- package/dist/tree-select/tree-select.css +376 -0
- package/dist/tree-select/tree-select.scss +467 -0
- package/dist/tree-select/variables.scss +90 -0
- package/dist/typography/constants.d.ts +12 -0
- package/dist/typography/constants.js +50 -0
- package/dist/typography/ellipsis.d.ts +36 -0
- package/dist/typography/ellipsis.js +156 -0
- package/dist/typography/format-numeral.d.ts +10 -0
- package/dist/typography/format-numeral.js +99 -0
- package/dist/typography/rtl.scss +13 -0
- package/dist/typography/typography.css +380 -0
- package/dist/typography/typography.scss +384 -0
- package/dist/typography/variables.scss +94 -0
- package/dist/upload/constants.d.ts +24 -0
- package/dist/upload/constants.js +39 -0
- package/dist/upload/foundation.d.ts +187 -0
- package/dist/upload/foundation.js +762 -0
- package/dist/upload/rtl.scss +13 -0
- package/dist/upload/upload.css +599 -0
- package/dist/upload/upload.scss +640 -0
- package/dist/upload/utils.d.ts +25 -0
- package/dist/upload/utils.js +98 -0
- package/dist/upload/variables.scss +89 -0
- package/dist/user-guide/animation.scss +4 -0
- package/dist/user-guide/constants.d.ts +9 -0
- package/dist/user-guide/constants.js +12 -0
- package/dist/user-guide/foundation.d.ts +47 -0
- package/dist/user-guide/foundation.js +73 -0
- package/dist/user-guide/user-guide.css +120 -0
- package/dist/user-guide/user-guide.scss +151 -0
- package/dist/user-guide/variables.scss +40 -0
- package/dist/utils/a11y.d.ts +99 -0
- package/dist/utils/a11y.js +168 -0
- package/dist/utils/animated-height.d.ts +8 -0
- package/dist/utils/animated-height.js +28 -0
- package/dist/utils/announcer.d.ts +35 -0
- package/dist/utils/announcer.js +54 -0
- package/dist/utils/array-move.d.ts +1 -0
- package/dist/utils/array-move.js +5 -0
- package/dist/utils/array.d.ts +10 -0
- package/dist/utils/array.js +21 -0
- package/dist/utils/classnames.d.ts +2 -0
- package/dist/utils/classnames.js +10 -0
- package/dist/utils/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.js +5 -0
- package/dist/utils/date-fns-extra.d.ts +38 -0
- package/dist/utils/date-fns-extra.js +105 -0
- package/dist/utils/dom.d.ts +31 -0
- package/dist/utils/dom.js +53 -0
- package/dist/utils/escape-html.d.ts +9 -0
- package/dist/utils/escape-html.js +67 -0
- package/dist/utils/event.d.ts +9 -0
- package/dist/utils/event.js +36 -0
- package/dist/utils/field-sizing.d.ts +15 -0
- package/dist/utils/field-sizing.js +52 -0
- package/dist/utils/focus-handle.d.ts +44 -0
- package/dist/utils/focus-handle.js +93 -0
- package/dist/utils/focus-handover.d.ts +11 -0
- package/dist/utils/focus-handover.js +22 -0
- package/dist/utils/focus-scope.d.ts +25 -0
- package/dist/utils/focus-scope.js +78 -0
- package/dist/utils/function.d.ts +1 -0
- package/dist/utils/function.js +3 -0
- package/dist/utils/get-data-attr.d.ts +3 -0
- package/dist/utils/get-data-attr.js +5 -0
- package/dist/utils/is-element.d.ts +1 -0
- package/dist/utils/is-element.js +5 -0
- package/dist/utils/is-enter-press.d.ts +3 -0
- package/dist/utils/is-enter-press.js +6 -0
- package/dist/utils/is-object.d.ts +1 -0
- package/dist/utils/is-object.js +5 -0
- package/dist/utils/is-promise.d.ts +1 -0
- package/dist/utils/is-promise.js +6 -0
- package/dist/utils/is-valid-time-zone.d.ts +1 -0
- package/dist/utils/is-valid-time-zone.js +5 -0
- package/dist/utils/key-code.d.ts +12 -0
- package/dist/utils/key-code.js +11 -0
- package/dist/utils/layer.d.ts +25 -0
- package/dist/utils/layer.js +73 -0
- package/dist/utils/object.d.ts +10 -0
- package/dist/utils/object.js +66 -0
- package/dist/utils/pointer.d.ts +1 -0
- package/dist/utils/pointer.js +5 -0
- package/dist/utils/release-holder.d.ts +9 -0
- package/dist/utils/release-holder.js +18 -0
- package/dist/utils/scroll-lock.d.ts +7 -0
- package/dist/utils/scroll-lock.js +38 -0
- package/dist/utils/shallow-equal-objects.d.ts +5 -0
- package/dist/utils/shallow-equal-objects.js +8 -0
- package/dist/utils/supports.d.ts +18 -0
- package/dist/utils/supports.js +93 -0
- package/dist/utils/tween.d.ts +14 -0
- package/dist/utils/tween.js +16 -0
- package/dist/utils/type.d.ts +2 -0
- package/dist/utils/type.js +0 -0
- package/dist/utils/uuid.d.ts +2 -0
- package/dist/utils/uuid.js +7 -0
- package/dist/utils/warning.d.ts +8 -0
- package/dist/utils/warning.js +14 -0
- package/dist/video-player/animation.scss +7 -0
- package/dist/video-player/constants.d.ts +27 -0
- package/dist/video-player/constants.js +48 -0
- package/dist/video-player/foundation.d.ts +94 -0
- package/dist/video-player/foundation.js +287 -0
- package/dist/video-player/progress-foundation.d.ts +80 -0
- package/dist/video-player/progress-foundation.js +117 -0
- package/dist/video-player/utils.d.ts +24 -0
- package/dist/video-player/utils.js +50 -0
- package/dist/video-player/variables.scss +69 -0
- package/dist/video-player/video-player.css +282 -0
- package/dist/video-player/video-player.scss +344 -0
- package/package.json +53 -3
|
@@ -0,0 +1,893 @@
|
|
|
1
|
+
import BaseFoundation from "../base/foundation.js";
|
|
2
|
+
import { Typeahead, getListTargetIndex, isInnerControlActivation, isTextEditor } from "../utils/a11y.js";
|
|
3
|
+
import isObject from "../utils/is-object.js";
|
|
4
|
+
import "../utils/key-code.js";
|
|
5
|
+
import isEnterPress from "../utils/is-enter-press.js";
|
|
6
|
+
import { strings } from "./constants.js";
|
|
7
|
+
import { calcCheckedKeys, calcCheckedKeysForChecked, calcCheckedKeysForUnchecked, calcDisabledKeys, findAncestorKeys, findDescendantKeys, normalizeKeyList, normalizedArr } from "../tree/tree-util.js";
|
|
8
|
+
import { calcMergeType, convertDataToEntities, filter, getColumns, getKeyByPos, getKeyByValuePath, getKeysByValuePath, getValueOrKey } from "./util.js";
|
|
9
|
+
import { difference, isEqual } from "es-toolkit";
|
|
10
|
+
// src/cascader/foundation.ts
|
|
11
|
+
const keyEntitiesCache = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
const disabledKeysCache = /* @__PURE__ */ new WeakMap();
|
|
13
|
+
const checkedStateCache = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
const DERIVED_STATE_KEYS = /* @__PURE__ */ new Set([
|
|
15
|
+
"keyEntities",
|
|
16
|
+
"checkedKeys",
|
|
17
|
+
"halfCheckedKeys",
|
|
18
|
+
"resolvedCheckedKeys",
|
|
19
|
+
"disabledKeys"
|
|
20
|
+
]);
|
|
21
|
+
const DERIVE_PROP_KEYS = [
|
|
22
|
+
"treeData",
|
|
23
|
+
"keyMaps",
|
|
24
|
+
"checkRelation",
|
|
25
|
+
"disableStrictly",
|
|
26
|
+
"autoMergeValue",
|
|
27
|
+
"leafOnly",
|
|
28
|
+
"onChangeWithObject",
|
|
29
|
+
"value"
|
|
30
|
+
];
|
|
31
|
+
var CascaderFoundation = class CascaderFoundation extends BaseFoundation {
|
|
32
|
+
#initialized = false;
|
|
33
|
+
#typeahead = new Typeahead();
|
|
34
|
+
static #getFilteredData({ treeNodeFilterProp, filterSorter, keyMaps }, { filteredKeys, keyEntities, inputValue }) {
|
|
35
|
+
const realFilterProp = treeNodeFilterProp !== "label" ? treeNodeFilterProp : keyMaps?.label ?? "label";
|
|
36
|
+
const filteredList = [];
|
|
37
|
+
filteredKeys.forEach((key) => {
|
|
38
|
+
const item = keyEntities[key];
|
|
39
|
+
if (!item) return;
|
|
40
|
+
const pathData = CascaderFoundation.getItemPropPath(key, [], keyEntities);
|
|
41
|
+
const itemSearchPath = pathData.map((pathItem) => pathItem[realFilterProp]);
|
|
42
|
+
const isDisabled = findAncestorKeys([key], keyEntities, true).some((ancestorKey) => keyEntities[ancestorKey].data.disabled);
|
|
43
|
+
filteredList.push({
|
|
44
|
+
data: item.data,
|
|
45
|
+
pathData,
|
|
46
|
+
key,
|
|
47
|
+
disabled: isDisabled,
|
|
48
|
+
searchText: itemSearchPath
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
if (typeof filterSorter === "function") filteredList.sort((a, b) => filterSorter(a.pathData, b.pathData, inputValue));
|
|
52
|
+
return filteredList;
|
|
53
|
+
}
|
|
54
|
+
/** Each path of a multiple-mode value, with the key it points at (undefined for an empty path) */
|
|
55
|
+
static #valuePaths(value, { onChangeWithObject, keyMaps }) {
|
|
56
|
+
let normalizedValue = [];
|
|
57
|
+
if (Array.isArray(value)) normalizedValue = Array.isArray(value[0]) ? value : [value];
|
|
58
|
+
else if (value !== void 0) normalizedValue = [[value]];
|
|
59
|
+
return normalizedValue.map((path) => {
|
|
60
|
+
const valuePath = onChangeWithObject && isObject(path[0]) ? getValueOrKey(path, keyMaps) : path;
|
|
61
|
+
return {
|
|
62
|
+
path,
|
|
63
|
+
key: valuePath.length > 0 ? getKeyByValuePath(valuePath) : void 0
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The paths of a controlled multiple value that the current treeData lacks (a remote search, unloaded nodes).
|
|
69
|
+
* They are the owner's data, so a change keeps them, max counts them, and the clear button removes them.
|
|
70
|
+
*/
|
|
71
|
+
static #missingValuePaths(props, keyEntities) {
|
|
72
|
+
if (props.value === void 0) return [];
|
|
73
|
+
return CascaderFoundation.#valuePaths(props.value, props).filter(({ key }) => key !== void 0 && !keyEntities[key]).map(({ path }) => path);
|
|
74
|
+
}
|
|
75
|
+
/** The states that select `value` from `state`, and the entities with a placeholder for a value treeData lacks */
|
|
76
|
+
static #selectionFor(props, state, value, keyEntities) {
|
|
77
|
+
const { changeOnSelect, onChangeWithObject, keyMaps, loadData, multiple } = props;
|
|
78
|
+
const { activeKeys, loadingKeys, keyEntities: keyEntityState, selectedKeys: selectedKeysState } = state;
|
|
79
|
+
const filterable = Boolean(props.filterTreeNode);
|
|
80
|
+
const loadingActive = [...activeKeys].filter((i) => loadingKeys.has(i));
|
|
81
|
+
const normalizedValue = normalizedArr(value);
|
|
82
|
+
const valuePath = onChangeWithObject && isObject(normalizedValue[0]) ? getValueOrKey(normalizedValue, keyMaps) : normalizedValue;
|
|
83
|
+
const selectedKeys = getKeysByValuePath(valuePath);
|
|
84
|
+
let updateStates = {};
|
|
85
|
+
const selectedKey = selectedKeys.length > 0 ? selectedKeys[0] : void 0;
|
|
86
|
+
const selectedItem = selectedKey ? keyEntities[selectedKey] : void 0;
|
|
87
|
+
if (selectedItem) {
|
|
88
|
+
/**
|
|
89
|
+
* Selected even when disabled
|
|
90
|
+
*/
|
|
91
|
+
if (changeOnSelect || CascaderFoundation.#isLeafData(selectedItem.data, loadData)) {
|
|
92
|
+
updateStates.selectedKeys = /* @__PURE__ */ new Set([selectedKey]);
|
|
93
|
+
if (!loadingActive.length) updateStates.activeKeys = new Set(selectedItem.path);
|
|
94
|
+
} else if (selectedKeysState.size) updateStates = CascaderFoundation.#clearedSelection(filterable, multiple);
|
|
95
|
+
} else if ((Array.isArray(value) || typeof value === "string") && value.length) {
|
|
96
|
+
const val = valuePath.at(-1);
|
|
97
|
+
const key = `not-exist-${val}`;
|
|
98
|
+
const optionNotExist = {
|
|
99
|
+
data: {
|
|
100
|
+
label: val,
|
|
101
|
+
value: val
|
|
102
|
+
},
|
|
103
|
+
key,
|
|
104
|
+
path: valuePath,
|
|
105
|
+
_notExist: true
|
|
106
|
+
};
|
|
107
|
+
updateStates.selectedKeys = /* @__PURE__ */ new Set([key]);
|
|
108
|
+
keyEntities = {
|
|
109
|
+
...keyEntities,
|
|
110
|
+
[key]: optionNotExist
|
|
111
|
+
};
|
|
112
|
+
} else if (loadingKeys.size) {
|
|
113
|
+
updateStates.keyEntities = {
|
|
114
|
+
...keyEntityState,
|
|
115
|
+
...keyEntities
|
|
116
|
+
};
|
|
117
|
+
return {
|
|
118
|
+
updateStates,
|
|
119
|
+
keyEntities
|
|
120
|
+
};
|
|
121
|
+
} else updateStates = CascaderFoundation.#clearedSelection(filterable, multiple);
|
|
122
|
+
updateStates.keyEntities = keyEntities;
|
|
123
|
+
return {
|
|
124
|
+
updateStates,
|
|
125
|
+
keyEntities
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
static #clearedSelection(filterable, multiple) {
|
|
129
|
+
const updateStates = {};
|
|
130
|
+
updateStates.selectedKeys = /* @__PURE__ */ new Set([]);
|
|
131
|
+
updateStates.activeKeys = /* @__PURE__ */ new Set([]);
|
|
132
|
+
updateStates.filteredKeys = /* @__PURE__ */ new Set([]);
|
|
133
|
+
if (filterable && !multiple) updateStates.inputValue = "";
|
|
134
|
+
return updateStates;
|
|
135
|
+
}
|
|
136
|
+
static #isLeafData(item, loadData) {
|
|
137
|
+
if (loadData) return Boolean(item.isLeaf);
|
|
138
|
+
return !item.children || !item.children.length;
|
|
139
|
+
}
|
|
140
|
+
#isDisabled() {
|
|
141
|
+
return this.getProp("disabled");
|
|
142
|
+
}
|
|
143
|
+
#isFilterable() {
|
|
144
|
+
return Boolean(this.getProp("filterTreeNode"));
|
|
145
|
+
}
|
|
146
|
+
#notifySingleChange(item) {
|
|
147
|
+
const valueProp = this.getProp("onChangeWithObject") ? [] : "value";
|
|
148
|
+
this._adapter.notifyChange(this.getItemPropPath(item.key, valueProp));
|
|
149
|
+
}
|
|
150
|
+
#notifyMultipleChange(checkedKeys) {
|
|
151
|
+
const valueProp = this.getProp("onChangeWithObject") ? [] : "value";
|
|
152
|
+
const keyEntities = this.getState("keyEntities");
|
|
153
|
+
const paths = [...checkedKeys].map((checkedKey) => this.getItemPropPath(checkedKey, valueProp, keyEntities));
|
|
154
|
+
this._adapter.notifyChange([...CascaderFoundation.#missingValuePaths(this.getProps(), keyEntities), ...paths]);
|
|
155
|
+
}
|
|
156
|
+
#isLeaf(item) {
|
|
157
|
+
return CascaderFoundation.#isLeafData(item, this.getProp("loadData"));
|
|
158
|
+
}
|
|
159
|
+
#clearInput() {
|
|
160
|
+
this._adapter.updateStates({ inputValue: "" });
|
|
161
|
+
}
|
|
162
|
+
#notifyBlur(e) {
|
|
163
|
+
this._adapter.notifyBlur(e);
|
|
164
|
+
}
|
|
165
|
+
#close(key) {
|
|
166
|
+
const { multiple } = this.getProps();
|
|
167
|
+
this._adapter.updateStates({
|
|
168
|
+
isOpen: false,
|
|
169
|
+
keyboardKey: null
|
|
170
|
+
});
|
|
171
|
+
this._adapter.notifyDropdownVisibleChange(false);
|
|
172
|
+
if (this.#isFilterable()) {
|
|
173
|
+
const { selectedKeys } = this.getStates();
|
|
174
|
+
let inputValue = "";
|
|
175
|
+
if (key && !multiple) inputValue = this.renderDisplayText(key);
|
|
176
|
+
else if (selectedKeys.size && !multiple) inputValue = this.renderDisplayText([...selectedKeys][0]);
|
|
177
|
+
this._adapter.updateStates({
|
|
178
|
+
inputValue,
|
|
179
|
+
isSearching: false
|
|
180
|
+
});
|
|
181
|
+
if (!multiple) this.#toggle2SearchInput(false);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
#notifyFocus(e) {
|
|
185
|
+
this._adapter.notifyFocus(e);
|
|
186
|
+
}
|
|
187
|
+
#getCacheValue(keyEntities) {
|
|
188
|
+
const { selectedKeys, keyEntities: prevKeyEntities } = this.getStates();
|
|
189
|
+
const selectedKey = Array.from(selectedKeys)[0];
|
|
190
|
+
const entity = keyEntities[selectedKey] ?? prevKeyEntities[selectedKey];
|
|
191
|
+
if (!entity) return;
|
|
192
|
+
return entity._notExist ? entity.path : entity.valuePath;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Filtered keys for the current props: remote mode treats the current treeData nodes as results without
|
|
196
|
+
* matching; local mode matches by filterTreeNode.
|
|
197
|
+
*/
|
|
198
|
+
#calcFilteredKeys(sugInput, keyEntities) {
|
|
199
|
+
if (!sugInput) return [];
|
|
200
|
+
const { treeNodeFilterProp, filterTreeNode, filterLeafOnly, remote, keyMaps } = this.getProps();
|
|
201
|
+
const realFilterProp = treeNodeFilterProp !== "label" ? treeNodeFilterProp : keyMaps?.label ?? "label";
|
|
202
|
+
keyEntities ??= this.getState("keyEntities");
|
|
203
|
+
const entities = Object.values(keyEntities);
|
|
204
|
+
if (remote) return entities.filter((item) => !item._notExist).filter((item) => filterTreeNode && !filterLeafOnly || this.#isLeaf(item.data)).map((item) => item.key);
|
|
205
|
+
return entities.filter(({ key, _notExist, data }) => {
|
|
206
|
+
if (_notExist) return false;
|
|
207
|
+
const filteredPath = this.getItemPropPath(key, realFilterProp, keyEntities);
|
|
208
|
+
return filter(sugInput, data, filterTreeNode, filteredPath);
|
|
209
|
+
}).filter((item) => filterTreeNode && !filterLeafOnly || this.#isLeaf(item.data)).map((item) => item.key);
|
|
210
|
+
}
|
|
211
|
+
#defaultRenderText(path, displayRender) {
|
|
212
|
+
const separator = this.getProp("separator");
|
|
213
|
+
if (displayRender && typeof displayRender === "function") return displayRender(path);
|
|
214
|
+
return path.every((item) => typeof item === "string" || typeof item === "number") ? path.join(separator) : "";
|
|
215
|
+
}
|
|
216
|
+
#handleMultipleSelect(item) {
|
|
217
|
+
const { checkRelation, searchPosition } = this.getProps();
|
|
218
|
+
if (checkRelation === strings.RELATED) this.#handleRelatedMultipleSelect(item);
|
|
219
|
+
else if (checkRelation === strings.UN_RELATED) this.#handleUnRelatedMultipleSelect(item);
|
|
220
|
+
if (searchPosition === strings.SEARCH_POSITION_TRIGGER && this.getState("inputValue") !== "") this.handleInputChange("");
|
|
221
|
+
}
|
|
222
|
+
#handleRelatedMultipleSelect({ key }) {
|
|
223
|
+
const { checkedKeys, keyEntities, resolvedCheckedKeys } = this.getStates();
|
|
224
|
+
const { autoMergeValue, max, disableStrictly, leafOnly } = this.getProps();
|
|
225
|
+
const missingCount = CascaderFoundation.#missingValuePaths(this.getProps(), keyEntities).length;
|
|
226
|
+
const prevCheckedStatus = checkedKeys.has(key);
|
|
227
|
+
const curCheckedStatus = disableStrictly ? this.calcCheckedStatus(!prevCheckedStatus, key) : !prevCheckedStatus;
|
|
228
|
+
const { checkedKeys: curCheckedKeys, halfCheckedKeys: curHalfCheckedKeys } = disableStrictly ? this.calcNonDisabledCheckedKeys(key, curCheckedStatus) : this.calcCheckedKeys(key, curCheckedStatus);
|
|
229
|
+
const mergeType = calcMergeType(autoMergeValue, leafOnly);
|
|
230
|
+
const isLeafOnlyMerge = mergeType === strings.LEAF_ONLY_MERGE_TYPE;
|
|
231
|
+
const isNoneMerge = mergeType === strings.NONE_MERGE_TYPE;
|
|
232
|
+
const curResolvedCheckedKeys = new Set(normalizeKeyList(curCheckedKeys, keyEntities, isLeafOnlyMerge));
|
|
233
|
+
const curRealCheckedKeys = isNoneMerge ? curCheckedKeys : curResolvedCheckedKeys;
|
|
234
|
+
if (typeof max === "number") {
|
|
235
|
+
if (!isNoneMerge) {
|
|
236
|
+
if (resolvedCheckedKeys.size < curResolvedCheckedKeys.size && curResolvedCheckedKeys.size + missingCount > max) {
|
|
237
|
+
const checkedEntities = [];
|
|
238
|
+
curResolvedCheckedKeys.forEach((itemKey) => {
|
|
239
|
+
checkedEntities.push(keyEntities[itemKey]);
|
|
240
|
+
});
|
|
241
|
+
this._adapter.notifyOnExceed(checkedEntities);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
} else if (checkedKeys.size < curCheckedKeys.size && curCheckedKeys.size + missingCount > max) {
|
|
245
|
+
const checkedEntities = [];
|
|
246
|
+
curCheckedKeys.forEach((itemKey) => {
|
|
247
|
+
checkedEntities.push(keyEntities[itemKey]);
|
|
248
|
+
});
|
|
249
|
+
this._adapter.notifyOnExceed(checkedEntities);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (!this._isControlledComponent()) this._adapter.updateStates({
|
|
254
|
+
checkedKeys: curCheckedKeys,
|
|
255
|
+
halfCheckedKeys: curHalfCheckedKeys,
|
|
256
|
+
resolvedCheckedKeys: curResolvedCheckedKeys,
|
|
257
|
+
checkedEntities: keyEntities
|
|
258
|
+
});
|
|
259
|
+
this.#notifyMultipleChange(curRealCheckedKeys);
|
|
260
|
+
if (curCheckedStatus) this.#notifySelect(curRealCheckedKeys);
|
|
261
|
+
}
|
|
262
|
+
#handleUnRelatedMultipleSelect({ key }) {
|
|
263
|
+
const { checkedKeys, keyEntities } = this.getStates();
|
|
264
|
+
const { max } = this.getProps();
|
|
265
|
+
const newCheckedKeys = new Set(checkedKeys);
|
|
266
|
+
let targetStatus;
|
|
267
|
+
if (checkedKeys.has(key)) {
|
|
268
|
+
newCheckedKeys.delete(key);
|
|
269
|
+
targetStatus = false;
|
|
270
|
+
} else {
|
|
271
|
+
if (typeof max === "number") {
|
|
272
|
+
if (checkedKeys.size + CascaderFoundation.#missingValuePaths(this.getProps(), keyEntities).length >= max) {
|
|
273
|
+
const checkedEntities = [];
|
|
274
|
+
checkedKeys.forEach((itemKey) => {
|
|
275
|
+
checkedEntities.push(keyEntities[itemKey]);
|
|
276
|
+
});
|
|
277
|
+
this._adapter.notifyOnExceed(checkedEntities);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
newCheckedKeys.add(key);
|
|
282
|
+
targetStatus = true;
|
|
283
|
+
}
|
|
284
|
+
if (!this._isControlledComponent()) this._adapter.updateStates({
|
|
285
|
+
checkedKeys: newCheckedKeys,
|
|
286
|
+
checkedEntities: keyEntities
|
|
287
|
+
});
|
|
288
|
+
this.#notifyMultipleChange(newCheckedKeys);
|
|
289
|
+
if (targetStatus) this.#notifySelect(newCheckedKeys);
|
|
290
|
+
}
|
|
291
|
+
#notifySelect(keys) {
|
|
292
|
+
const { keyEntities } = this.getStates();
|
|
293
|
+
const values = [];
|
|
294
|
+
keys.forEach((key) => {
|
|
295
|
+
const valueItem = keyEntities[key]?.data?.value;
|
|
296
|
+
if (valueItem !== void 0) values.push(valueItem);
|
|
297
|
+
});
|
|
298
|
+
const formatValue = values.length === 1 ? values[0] : values;
|
|
299
|
+
this._adapter.notifySelect(formatValue);
|
|
300
|
+
}
|
|
301
|
+
#toggle2SearchInput(isShow) {
|
|
302
|
+
if (isShow) this._adapter.toggleInputShow(isShow, () => this.focus());
|
|
303
|
+
else this._adapter.toggleInputShow(isShow, () => void 0);
|
|
304
|
+
}
|
|
305
|
+
#handleShowNextByHover(item) {
|
|
306
|
+
const { keyEntities } = this.getStates();
|
|
307
|
+
const { data, key } = item;
|
|
308
|
+
const isLeaf = this.#isLeaf(data);
|
|
309
|
+
const activeKeys = keyEntities[key].path;
|
|
310
|
+
this._adapter.updateStates({ activeKeys: new Set(activeKeys) });
|
|
311
|
+
if (!isLeaf) this.#notifyIfLoadData(item);
|
|
312
|
+
}
|
|
313
|
+
#handleNodeLoad({ data, key }) {
|
|
314
|
+
const newLoadedKeys = new Set(this.getState("loadedKeys")).add(key);
|
|
315
|
+
const newLoadingKeys = new Set(this.getState("loadingKeys"));
|
|
316
|
+
newLoadingKeys.delete(key);
|
|
317
|
+
this._adapter.notifyOnLoad(newLoadedKeys, data);
|
|
318
|
+
this._adapter.updateStates({
|
|
319
|
+
loadingKeys: newLoadingKeys,
|
|
320
|
+
loadedKeys: newLoadedKeys
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
#notifyIfLoadData(item) {
|
|
324
|
+
const { data, key } = item;
|
|
325
|
+
if (!data.isLeaf && !data.children && this.getProp("loadData")) {
|
|
326
|
+
const { loadedKeys, loadingKeys, keyEntities } = this.getStates();
|
|
327
|
+
if (loadedKeys.has(key) || loadingKeys.has(key)) return;
|
|
328
|
+
const optionPath = this.getItemPropPath(key, [], keyEntities);
|
|
329
|
+
this._adapter.updateStates({ loadingKeys: new Set(loadingKeys).add(key) });
|
|
330
|
+
this._adapter.notifyLoadData(optionPath, this.#handleNodeLoad.bind(this, item), this.#handleNodeLoadReject.bind(this, item));
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
#handleNodeLoadReject(item) {
|
|
334
|
+
const newLoadingKeys = new Set(this.getState("loadingKeys"));
|
|
335
|
+
newLoadingKeys.delete(item.key);
|
|
336
|
+
this._adapter.updateStates({ loadingKeys: newLoadingKeys });
|
|
337
|
+
}
|
|
338
|
+
#handleSingleSelect(e, item) {
|
|
339
|
+
const { changeOnSelect: allowChange, filterLeafOnly, multiple, enableLeafClick, clickToSelect } = this.getProps();
|
|
340
|
+
const { keyEntities, selectedKeys, isSearching } = this.getStates();
|
|
341
|
+
const { data, key } = item;
|
|
342
|
+
const isLeaf = this.#isLeaf(data);
|
|
343
|
+
const activeKeys = keyEntities[key].path;
|
|
344
|
+
const selectedKey = [key];
|
|
345
|
+
const hasChanged = key !== [...selectedKeys][0];
|
|
346
|
+
if (!isLeaf && !allowChange && !isSearching && !(multiple && clickToSelect)) {
|
|
347
|
+
this._adapter.updateStates({ activeKeys: new Set(activeKeys) });
|
|
348
|
+
this.#notifyIfLoadData(item);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
if (multiple) {
|
|
352
|
+
this._adapter.updateStates({ activeKeys: new Set(activeKeys) });
|
|
353
|
+
if (clickToSelect || isLeaf && enableLeafClick) this.onItemCheckboxClick(item);
|
|
354
|
+
} else {
|
|
355
|
+
this._adapter.notifySelect(data.value);
|
|
356
|
+
if (hasChanged) {
|
|
357
|
+
this.#notifySingleChange(item);
|
|
358
|
+
this.#notifyIfLoadData(item);
|
|
359
|
+
if (this._isControlledComponent()) {
|
|
360
|
+
this._adapter.updateStates({ activeKeys: new Set(activeKeys) });
|
|
361
|
+
if (isLeaf || !filterLeafOnly && isSearching) this.close(e);
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
this._adapter.updateStates({
|
|
365
|
+
activeKeys: new Set(activeKeys),
|
|
366
|
+
selectedKeys: new Set(selectedKey)
|
|
367
|
+
});
|
|
368
|
+
if (isLeaf) this.close(e, key);
|
|
369
|
+
else if (!filterLeafOnly && isSearching) this.close(e, key);
|
|
370
|
+
} else this.close(e);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
#updateSelectedKey(value, keyEntities) {
|
|
374
|
+
const selection = CascaderFoundation.#selectionFor(this.getProps(), this.getStates(), value, keyEntities);
|
|
375
|
+
this._adapter.updateStates(selection.updateStates);
|
|
376
|
+
return selection.keyEntities;
|
|
377
|
+
}
|
|
378
|
+
#reCalcActiveKeys() {
|
|
379
|
+
const { selectedKeys, activeKeys, keyEntities } = this.getStates();
|
|
380
|
+
const selectedItem = keyEntities[[...selectedKeys][0]];
|
|
381
|
+
if (!selectedItem) return;
|
|
382
|
+
const newActiveKeys = new Set(selectedItem.path);
|
|
383
|
+
if (!isEqual(newActiveKeys, activeKeys)) this._adapter.updateStates({ activeKeys: newActiveKeys });
|
|
384
|
+
}
|
|
385
|
+
/** Right (`into`) and Left on an option of the columns */
|
|
386
|
+
#handleColumnKey(option, into) {
|
|
387
|
+
const { activeKeys } = this.getStates();
|
|
388
|
+
const isOpen = activeKeys.has(option.key) && CascaderFoundation.isBranch(option.data, this.getProp("loadData"));
|
|
389
|
+
if (into) {
|
|
390
|
+
if (!isOpen) {
|
|
391
|
+
if (!this.#isOptionDisabled(option)) this.#handleShowNextByHover(option);
|
|
392
|
+
} else if (option.children?.length) this.#moveTo(option.children[0].key, 0);
|
|
393
|
+
} else if (isOpen) this._adapter.updateStates({ activeKeys: new Set(option.path.slice(0, -1)) });
|
|
394
|
+
else if (option.parent) {
|
|
395
|
+
const { parent } = option;
|
|
396
|
+
const column = parent.parent ? parent.parent.children : CascaderFoundation.getRenderData(this.getProps(), this.getStates());
|
|
397
|
+
this.#moveTo(parent.key, column.findIndex((item) => item.key === parent.key));
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
#moveTo(key, index) {
|
|
401
|
+
this._adapter.updateStates({ keyboardKey: key });
|
|
402
|
+
this._adapter.scrollToOption(key, index);
|
|
403
|
+
}
|
|
404
|
+
/** The options of the shown columns in display order, with their index in their column */
|
|
405
|
+
#getShownOptions() {
|
|
406
|
+
const { activeKeys } = this.getStates();
|
|
407
|
+
const topLevel = CascaderFoundation.getRenderData(this.getProps(), this.getStates());
|
|
408
|
+
return getColumns(topLevel, activeKeys).flatMap(({ items }) => items.map((option, index) => ({
|
|
409
|
+
option,
|
|
410
|
+
index
|
|
411
|
+
})));
|
|
412
|
+
}
|
|
413
|
+
#isOptionDisabled(option) {
|
|
414
|
+
return Boolean(option.data.disabled || "disabled" in option && option.disabled);
|
|
415
|
+
}
|
|
416
|
+
#collectOptions() {
|
|
417
|
+
const { treeData, value, keyMaps } = this.getProps();
|
|
418
|
+
const { isSearching, inputValue } = this.getStates();
|
|
419
|
+
let keyEntities = convertDataToEntities(treeData, keyMaps);
|
|
420
|
+
let cacheValue;
|
|
421
|
+
if (Object.keys(keyEntities).length > 0) cacheValue = this.#getCacheValue(keyEntities);
|
|
422
|
+
const selectedValue = !this._isControlledComponent() ? cacheValue : value === void 0 ? [] : value;
|
|
423
|
+
if (selectedValue != null) keyEntities = this.#updateSelectedKey(selectedValue, keyEntities);
|
|
424
|
+
else this._adapter.updateStates({ keyEntities });
|
|
425
|
+
this.#recalculateFilteredKeys(isSearching ? inputValue : void 0, keyEntities);
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Syncs filteredKeys with the latest keyEntities without triggering onSearch.
|
|
429
|
+
*/
|
|
430
|
+
#recalculateFilteredKeys(input, nextKeyEntities) {
|
|
431
|
+
if (!this.#isFilterable()) return;
|
|
432
|
+
const currentIsSearching = this.getState("isSearching");
|
|
433
|
+
if (input === void 0 && !currentIsSearching) return;
|
|
434
|
+
const sugInput = input === void 0 ? this.getState("inputValue") : input;
|
|
435
|
+
const filteredKeys = this.#calcFilteredKeys(sugInput, nextKeyEntities);
|
|
436
|
+
const updateStates = {
|
|
437
|
+
isSearching: Boolean(sugInput),
|
|
438
|
+
filteredKeys: new Set(filteredKeys)
|
|
439
|
+
};
|
|
440
|
+
if (nextKeyEntities) updateStates.keyEntities = nextKeyEntities;
|
|
441
|
+
this._adapter.updateStates(updateStates);
|
|
442
|
+
}
|
|
443
|
+
#handleValueChange(value) {
|
|
444
|
+
const { keyEntities } = this.getStates();
|
|
445
|
+
this.#updateSelectedKey(value, keyEntities);
|
|
446
|
+
const { isOpen, selectedKeys } = this.getStates();
|
|
447
|
+
if (this.#isFilterable() && !this.getProp("multiple") && !isOpen && selectedKeys.size) this._adapter.updateStates({ inputValue: this.renderDisplayText([...selectedKeys][0]) });
|
|
448
|
+
}
|
|
449
|
+
getItemPropPath(selectedKey, prop, keyEntities) {
|
|
450
|
+
return CascaderFoundation.getItemPropPath(selectedKey, prop, keyEntities || this.getState("keyEntities"));
|
|
451
|
+
}
|
|
452
|
+
renderDisplayText(targetKey, keyEntities) {
|
|
453
|
+
const renderFunc = this.getProp("displayRender");
|
|
454
|
+
const displayProp = this.getProp("displayProp");
|
|
455
|
+
const displayPath = this.getItemPropPath(targetKey, displayProp, keyEntities);
|
|
456
|
+
return this.#defaultRenderText(displayPath, renderFunc);
|
|
457
|
+
}
|
|
458
|
+
calcNonDisabledCheckedKeys(eventKey, targetStatus) {
|
|
459
|
+
const { keyEntities, disabledKeys } = this.getStates();
|
|
460
|
+
const checkedKeys = new Set(this.getState("checkedKeys"));
|
|
461
|
+
const descendantKeys = normalizeKeyList(findDescendantKeys([eventKey], keyEntities, false), keyEntities, true);
|
|
462
|
+
if (!descendantKeys.some((key) => disabledKeys.has(key))) return this.calcCheckedKeys(eventKey, targetStatus);
|
|
463
|
+
const nonDisabled = descendantKeys.filter((key) => !disabledKeys.has(key));
|
|
464
|
+
const newCheckedKeys = targetStatus ? [...nonDisabled, ...checkedKeys] : difference(normalizeKeyList([...checkedKeys], keyEntities, true), nonDisabled);
|
|
465
|
+
return calcCheckedKeys(newCheckedKeys, keyEntities);
|
|
466
|
+
}
|
|
467
|
+
calcCheckedStatus(targetStatus, eventKey) {
|
|
468
|
+
if (!targetStatus) return targetStatus;
|
|
469
|
+
const { checkedKeys, keyEntities, disabledKeys } = this.getStates();
|
|
470
|
+
const descendantKeys = normalizeKeyList(findDescendantKeys([eventKey], keyEntities, false), keyEntities, true);
|
|
471
|
+
if (!descendantKeys.some((key) => disabledKeys.has(key))) return targetStatus;
|
|
472
|
+
return !descendantKeys.filter((key) => !disabledKeys.has(key)).every((key) => checkedKeys.has(key));
|
|
473
|
+
}
|
|
474
|
+
calcCheckedKeys(key, curCheckedStatus) {
|
|
475
|
+
const { keyEntities } = this.getStates();
|
|
476
|
+
const checkedKeys = new Set(this.getState("checkedKeys"));
|
|
477
|
+
const halfCheckedKeys = new Set(this.getState("halfCheckedKeys"));
|
|
478
|
+
return curCheckedStatus ? calcCheckedKeysForChecked(key, keyEntities, checkedKeys, halfCheckedKeys) : calcCheckedKeysForUnchecked(key, keyEntities, checkedKeys, halfCheckedKeys);
|
|
479
|
+
}
|
|
480
|
+
/** keyEntities of a treeData, shared while treeData keeps its identity and keyMaps stays equal */
|
|
481
|
+
static getKeyEntities(treeData, keyMaps) {
|
|
482
|
+
if (!treeData) return convertDataToEntities(treeData, keyMaps);
|
|
483
|
+
const cached = keyEntitiesCache.get(treeData);
|
|
484
|
+
if (cached && isEqual(cached.keyMaps, keyMaps)) return cached.keyEntities;
|
|
485
|
+
const keyEntities = convertDataToEntities(treeData, keyMaps);
|
|
486
|
+
keyEntitiesCache.set(treeData, {
|
|
487
|
+
keyMaps,
|
|
488
|
+
keyEntities
|
|
489
|
+
});
|
|
490
|
+
return keyEntities;
|
|
491
|
+
}
|
|
492
|
+
/** Keys of the entities a multiple value points at; paths missing from keyEntities are dropped */
|
|
493
|
+
static getRealKeys(value, keyEntities, props) {
|
|
494
|
+
return CascaderFoundation.#valuePaths(value, props).map(({ key }) => key).filter((key) => key !== void 0 && keyEntities[key]);
|
|
495
|
+
}
|
|
496
|
+
/** Whether a multiple value holds anything to clear, counting the controlled paths treeData lacks */
|
|
497
|
+
static hasMultipleValue(props, { checkedKeys, keyEntities }) {
|
|
498
|
+
return checkedKeys.size > 0 || CascaderFoundation.#missingValuePaths(props, keyEntities).length > 0;
|
|
499
|
+
}
|
|
500
|
+
/** Checked, half checked and merged keys for a list of checked keys */
|
|
501
|
+
static calcCheckedState(keys, keyEntities, { checkRelation, autoMergeValue, leafOnly }) {
|
|
502
|
+
if (checkRelation !== strings.RELATED) return {
|
|
503
|
+
checkedKeys: new Set(keys),
|
|
504
|
+
halfCheckedKeys: /* @__PURE__ */ new Set(),
|
|
505
|
+
resolvedCheckedKeys: /* @__PURE__ */ new Set()
|
|
506
|
+
};
|
|
507
|
+
const calRes = calcCheckedKeys(keys, keyEntities);
|
|
508
|
+
const checkedKeys = new Set(calRes.checkedKeys);
|
|
509
|
+
const isLeafOnlyMerge = calcMergeType(autoMergeValue, leafOnly) === strings.LEAF_ONLY_MERGE_TYPE;
|
|
510
|
+
return {
|
|
511
|
+
checkedKeys,
|
|
512
|
+
halfCheckedKeys: new Set(calRes.halfCheckedKeys),
|
|
513
|
+
resolvedCheckedKeys: new Set(normalizeKeyList(checkedKeys, keyEntities, isLeafOnlyMerge))
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* The multiple-mode values that follow props: keyEntities, disabledKeys under disableStrictly, and the checked
|
|
518
|
+
* sets (from `value` when controlled, else the stored ones recomputed when keyEntities changed). Stored keys that
|
|
519
|
+
* treeData lacks (removed, or not loaded yet) are left out; the state keeps them until the next change, so
|
|
520
|
+
* treeData that brings them first checks them.
|
|
521
|
+
*/
|
|
522
|
+
static deriveMultipleState(props, state) {
|
|
523
|
+
const { treeData, keyMaps, checkRelation, disableStrictly, autoMergeValue, leafOnly, onChangeWithObject } = props;
|
|
524
|
+
const keyEntities = CascaderFoundation.getKeyEntities(treeData, keyMaps);
|
|
525
|
+
let disabledKeys = /* @__PURE__ */ new Set();
|
|
526
|
+
if (checkRelation === strings.RELATED && disableStrictly) {
|
|
527
|
+
disabledKeys = disabledKeysCache.get(keyEntities);
|
|
528
|
+
if (!disabledKeys) {
|
|
529
|
+
disabledKeys = calcDisabledKeys(keyEntities, keyMaps);
|
|
530
|
+
disabledKeysCache.set(keyEntities, disabledKeys);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const controlled = props.value !== void 0;
|
|
534
|
+
if (!controlled && state.checkedEntities === keyEntities) {
|
|
535
|
+
const { checkedKeys, halfCheckedKeys, resolvedCheckedKeys } = state;
|
|
536
|
+
return {
|
|
537
|
+
keyEntities,
|
|
538
|
+
disabledKeys,
|
|
539
|
+
checkedKeys,
|
|
540
|
+
halfCheckedKeys,
|
|
541
|
+
resolvedCheckedKeys
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
const inputs = [
|
|
545
|
+
controlled,
|
|
546
|
+
controlled ? props.value : state.checkedKeys,
|
|
547
|
+
checkRelation,
|
|
548
|
+
autoMergeValue,
|
|
549
|
+
leafOnly,
|
|
550
|
+
onChangeWithObject
|
|
551
|
+
];
|
|
552
|
+
const cached = checkedStateCache.get(keyEntities);
|
|
553
|
+
let checked = cached && isEqual(cached.inputs, inputs) ? cached.result : void 0;
|
|
554
|
+
if (!checked) {
|
|
555
|
+
const keys = controlled ? CascaderFoundation.getRealKeys(props.value, keyEntities, props) : [...state.checkedKeys].filter((key) => keyEntities[key]);
|
|
556
|
+
checked = CascaderFoundation.calcCheckedState(keys, keyEntities, props);
|
|
557
|
+
checkedStateCache.set(keyEntities, {
|
|
558
|
+
inputs,
|
|
559
|
+
result: checked
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
return {
|
|
563
|
+
keyEntities,
|
|
564
|
+
disabledKeys,
|
|
565
|
+
...checked
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
static getInitialState(props) {
|
|
569
|
+
const state = {
|
|
570
|
+
disabledKeys: /* @__PURE__ */ new Set(),
|
|
571
|
+
isOpen: false,
|
|
572
|
+
keyEntities: {},
|
|
573
|
+
selectedKeys: /* @__PURE__ */ new Set([]),
|
|
574
|
+
activeKeys: /* @__PURE__ */ new Set([]),
|
|
575
|
+
keyboardKey: null,
|
|
576
|
+
filteredKeys: /* @__PURE__ */ new Set([]),
|
|
577
|
+
inputValue: "",
|
|
578
|
+
isSearching: false,
|
|
579
|
+
checkedKeys: /* @__PURE__ */ new Set([]),
|
|
580
|
+
halfCheckedKeys: /* @__PURE__ */ new Set([]),
|
|
581
|
+
resolvedCheckedKeys: /* @__PURE__ */ new Set([]),
|
|
582
|
+
loadedKeys: /* @__PURE__ */ new Set(),
|
|
583
|
+
loadingKeys: /* @__PURE__ */ new Set(),
|
|
584
|
+
showInput: false
|
|
585
|
+
};
|
|
586
|
+
const keyEntities = convertDataToEntities(props.treeData, props.keyMaps);
|
|
587
|
+
const selectedValue = props.value !== void 0 ? props.value : props.defaultValue;
|
|
588
|
+
if (selectedValue != null) Object.assign(state, CascaderFoundation.#selectionFor(props, state, selectedValue, keyEntities).updateStates);
|
|
589
|
+
else state.keyEntities = keyEntities;
|
|
590
|
+
if (props.multiple && props.value === void 0) {
|
|
591
|
+
const keys = CascaderFoundation.#valuePaths(props.defaultValue, props).map(({ key }) => key).filter((key) => key !== void 0);
|
|
592
|
+
state.checkedKeys = new Set(keys);
|
|
593
|
+
}
|
|
594
|
+
return state;
|
|
595
|
+
}
|
|
596
|
+
/** The flattened search results while searching, otherwise the top level */
|
|
597
|
+
static getRenderData(props, state) {
|
|
598
|
+
const { keyEntities, isSearching } = state;
|
|
599
|
+
if (isSearching && Boolean(props.filterTreeNode)) return CascaderFoundation.#getFilteredData(props, state);
|
|
600
|
+
return Object.values(keyEntities).filter((item) => item.parentKey === null && !item._notExist).sort((a, b) => a.ind - b.ind);
|
|
601
|
+
}
|
|
602
|
+
/** Whether an option opens a column: it has children, or loadData may load some */
|
|
603
|
+
static isBranch(data, loadData) {
|
|
604
|
+
return Boolean(data.children?.length) || Boolean(loadData && !data.isLeaf);
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* What a treeitem in a column shows and exposes. An option that is both active and selected shows only as selected,
|
|
608
|
+
* and in multiple mode selection is the checkbox's, so the row is never marked selected.
|
|
609
|
+
*/
|
|
610
|
+
static getTreeItemState(key, sets, multiple, expandable) {
|
|
611
|
+
const active = sets.activeKeys.has(key);
|
|
612
|
+
const selected = sets.selectedKeys.has(key);
|
|
613
|
+
const loading = sets.loadingKeys.has(key) && !sets.loadedKeys.has(key);
|
|
614
|
+
const checkState = sets.halfCheckedKeys.has(key) ? "mixed" : sets.checkedKeys.has(key);
|
|
615
|
+
return {
|
|
616
|
+
selected,
|
|
617
|
+
loading,
|
|
618
|
+
showActive: active && !selected,
|
|
619
|
+
showSelected: selected && !multiple,
|
|
620
|
+
aria: {
|
|
621
|
+
"aria-busy": loading || void 0,
|
|
622
|
+
"aria-checked": multiple ? checkState : void 0,
|
|
623
|
+
"aria-expanded": expandable ? active : void 0,
|
|
624
|
+
"aria-selected": multiple ? void 0 : selected
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
/** `keyboardKey` while its option is shown; hover or a click elsewhere can close its column */
|
|
629
|
+
static getKeyboardKey({ keyboardKey, keyEntities, activeKeys, isSearching, filteredKeys }) {
|
|
630
|
+
const entity = keyEntities[keyboardKey];
|
|
631
|
+
if (!entity) return null;
|
|
632
|
+
return (isSearching ? filteredKeys.has(keyboardKey) : entity.path.slice(0, -1).every((key) => activeKeys.has(key))) ? keyboardKey : null;
|
|
633
|
+
}
|
|
634
|
+
static getItemPropPath(selectedKey, prop, keyEntities) {
|
|
635
|
+
const selectedItem = keyEntities[selectedKey];
|
|
636
|
+
let path = [];
|
|
637
|
+
if (!selectedItem) {} else if (selectedItem._notExist) path = selectedItem.path;
|
|
638
|
+
else {
|
|
639
|
+
const keyPath = selectedItem.path;
|
|
640
|
+
path = Array.isArray(prop) ? keyPath.map((key) => keyEntities[key].data) : keyPath.map((key) => keyEntities[key].data[prop]);
|
|
641
|
+
}
|
|
642
|
+
return path;
|
|
643
|
+
}
|
|
644
|
+
getStates() {
|
|
645
|
+
const state = super.getStates();
|
|
646
|
+
if (!this.getProp("multiple")) return state;
|
|
647
|
+
const props = {};
|
|
648
|
+
for (const key of DERIVE_PROP_KEYS) props[key] = this.getProp(key);
|
|
649
|
+
return {
|
|
650
|
+
...state,
|
|
651
|
+
...CascaderFoundation.deriveMultipleState(props, state)
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
getState(key) {
|
|
655
|
+
return DERIVED_STATE_KEYS.has(key) ? this.getStates()[key] : super.getState(key);
|
|
656
|
+
}
|
|
657
|
+
init() {
|
|
658
|
+
if (this.#initialized) return;
|
|
659
|
+
this.#initialized = true;
|
|
660
|
+
if (this.getProp("defaultOpen") && !this.#isDisabled()) this.open();
|
|
661
|
+
}
|
|
662
|
+
handleKeyDown(e) {
|
|
663
|
+
if (e.key === "Escape") {
|
|
664
|
+
if (this.getState("isOpen")) {
|
|
665
|
+
e.preventDefault();
|
|
666
|
+
this.close(e);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Keys of the open popup (APG combobox with a tree popup, or a listbox while searching); focus stays on the
|
|
672
|
+
* trigger or its search input. Up, Down, Home and End move within the current column or the search results;
|
|
673
|
+
* Right opens a branch, then enters it; Left closes an open branch, else moves to the parent (swapped in RTL);
|
|
674
|
+
* Enter and Space click the option, or check it in multiple mode; typed characters jump to the next shown option
|
|
675
|
+
* starting with them (APG tree typeahead). In a search input Space and typed characters edit the text; while
|
|
676
|
+
* searching only Up, Down and Enter navigate. Returns whether the key was used.
|
|
677
|
+
*/
|
|
678
|
+
handleOptionKeyDown(e, { editing, rtl }) {
|
|
679
|
+
const states = this.getStates();
|
|
680
|
+
const { key } = e;
|
|
681
|
+
if (!states.isOpen || e.ctrlKey || e.metaKey || e.altKey || editing && key === " ") return false;
|
|
682
|
+
if (editing && states.isSearching && ![
|
|
683
|
+
"ArrowUp",
|
|
684
|
+
"ArrowDown",
|
|
685
|
+
"Enter"
|
|
686
|
+
].includes(key)) return false;
|
|
687
|
+
if (!editing && !states.isSearching && this.#typeahead.accepts(e)) {
|
|
688
|
+
e.preventDefault();
|
|
689
|
+
const shown = this.#getShownOptions();
|
|
690
|
+
const labels = shown.map(({ option }) => typeof option.data.label === "string" ? option.data.label : "");
|
|
691
|
+
const current = shown.findIndex(({ option }) => option.key === CascaderFoundation.getKeyboardKey(states));
|
|
692
|
+
const target = shown[this.#typeahead.match(key, labels, current)];
|
|
693
|
+
if (target) this.#moveTo(target.option.key, target.index);
|
|
694
|
+
return true;
|
|
695
|
+
}
|
|
696
|
+
const currentKey = CascaderFoundation.getKeyboardKey(states);
|
|
697
|
+
const parent = states.isSearching ? void 0 : states.keyEntities[currentKey]?.parent;
|
|
698
|
+
const options = parent ? parent.children : CascaderFoundation.getRenderData(this.getProps(), states);
|
|
699
|
+
const index = options.findIndex((option) => option.key === currentKey);
|
|
700
|
+
const current = options[index];
|
|
701
|
+
if (key === "Enter" || key === " ") {
|
|
702
|
+
if (!current) return false;
|
|
703
|
+
e.preventDefault();
|
|
704
|
+
if (!this.#isOptionDisabled(current)) {
|
|
705
|
+
if (this.getProp("multiple")) this.onItemCheckboxClick(current);
|
|
706
|
+
else this.handleItemClick(e, current);
|
|
707
|
+
}
|
|
708
|
+
return true;
|
|
709
|
+
}
|
|
710
|
+
const [into, out] = rtl ? ["ArrowLeft", "ArrowRight"] : ["ArrowRight", "ArrowLeft"];
|
|
711
|
+
if (key === into || key === out) {
|
|
712
|
+
if (!current || states.isSearching) return false;
|
|
713
|
+
e.preventDefault();
|
|
714
|
+
this.#handleColumnKey(current, key === into);
|
|
715
|
+
return true;
|
|
716
|
+
}
|
|
717
|
+
const target = getListTargetIndex(key, index, options.length, () => false);
|
|
718
|
+
if (target === null) return false;
|
|
719
|
+
e.preventDefault();
|
|
720
|
+
this.#moveTo(options[target].key, target);
|
|
721
|
+
return true;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* After an update, the host reports whether the options (treeData or keyMaps) and value changed by its own change
|
|
725
|
+
* detection. Re-collecting the options also re-resolves the value.
|
|
726
|
+
*/
|
|
727
|
+
handleInputsChange({ optionsChanged, valueChanged }, value) {
|
|
728
|
+
if (this.getProp("multiple")) {
|
|
729
|
+
if (optionsChanged) this.#recalculateFilteredKeys();
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
if (optionsChanged) this.#collectOptions();
|
|
733
|
+
else if (valueChanged) this.#handleValueChange(value);
|
|
734
|
+
}
|
|
735
|
+
open() {
|
|
736
|
+
const filterable = this.#isFilterable();
|
|
737
|
+
const { multiple } = this.getProps();
|
|
738
|
+
const { isSearching } = this.getStates();
|
|
739
|
+
this._adapter.updateStates({ isOpen: true });
|
|
740
|
+
if (filterable) {
|
|
741
|
+
this._adapter.updateStates({
|
|
742
|
+
inputValue: "",
|
|
743
|
+
isSearching: false,
|
|
744
|
+
filteredKeys: /* @__PURE__ */ new Set()
|
|
745
|
+
});
|
|
746
|
+
if (isSearching) this._adapter.notifyOnSearch("");
|
|
747
|
+
if (!multiple) this.#toggle2SearchInput(true);
|
|
748
|
+
}
|
|
749
|
+
if (this._isControlledComponent()) this.#reCalcActiveKeys();
|
|
750
|
+
this._adapter.notifyDropdownVisibleChange(true);
|
|
751
|
+
}
|
|
752
|
+
/** Mousedown outside the trigger and dropdown while open */
|
|
753
|
+
handleClickOutside(e) {
|
|
754
|
+
this.close(e);
|
|
755
|
+
}
|
|
756
|
+
close(e, key) {
|
|
757
|
+
this.#close(key);
|
|
758
|
+
this.#notifyBlur(e);
|
|
759
|
+
}
|
|
760
|
+
/** Closes without a blur; called when Vue KeepAlive deactivates the host */
|
|
761
|
+
deactivate() {
|
|
762
|
+
this.#close();
|
|
763
|
+
}
|
|
764
|
+
focus() {
|
|
765
|
+
this._adapter.focusCombobox();
|
|
766
|
+
}
|
|
767
|
+
blur() {
|
|
768
|
+
this._adapter.blurCombobox();
|
|
769
|
+
}
|
|
770
|
+
/** Leaves search mode after the closed dropdown finishes its exit */
|
|
771
|
+
endSearching() {
|
|
772
|
+
this._adapter.updateStates({ isSearching: false });
|
|
773
|
+
}
|
|
774
|
+
/** A key that opens the dropdown sets the current option before the list mounts; it is scrolled to once shown */
|
|
775
|
+
handlePopoverOpen() {
|
|
776
|
+
const keyboardKey = this.getState("keyboardKey");
|
|
777
|
+
if (!keyboardKey) return;
|
|
778
|
+
const shown = this.#getShownOptions().find(({ option }) => option.key === keyboardKey);
|
|
779
|
+
if (shown) this._adapter.scrollToOption(keyboardKey, shown.index);
|
|
780
|
+
}
|
|
781
|
+
handleItemClick(e, item) {
|
|
782
|
+
if (this.#isDisabled()) return;
|
|
783
|
+
this.#handleSingleSelect(e, item);
|
|
784
|
+
}
|
|
785
|
+
handleItemHover(_e, item) {
|
|
786
|
+
if (this.#isDisabled()) return;
|
|
787
|
+
this.#handleShowNextByHover(item);
|
|
788
|
+
}
|
|
789
|
+
onItemCheckboxClick(item) {
|
|
790
|
+
if (this.#isDisabled()) return;
|
|
791
|
+
this.#handleMultipleSelect(item);
|
|
792
|
+
}
|
|
793
|
+
handleClick(e) {
|
|
794
|
+
const isDisabled = this.#isDisabled();
|
|
795
|
+
const isFilterable = this.#isFilterable();
|
|
796
|
+
const { isOpen } = this.getStates();
|
|
797
|
+
if (isDisabled || isInnerControlActivation(e)) return;
|
|
798
|
+
else if (!isOpen) {
|
|
799
|
+
this.open();
|
|
800
|
+
this.#notifyFocus(e);
|
|
801
|
+
} else if (isOpen && !isFilterable) this.close(e);
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Enter toggles like a click; Down and Up open a closed popup (APG combobox). Without a search input (select-only
|
|
805
|
+
* combobox) Space also opens it, and Home and End open it on the first and last option of the first column.
|
|
806
|
+
* While open with no current option (handleOptionKeyDown left the key), Space outside a text field acts like
|
|
807
|
+
* Enter, as in Select and TreeSelect. A search input keeps Space, Home and End for its text.
|
|
808
|
+
*/
|
|
809
|
+
handleSelectionKeyDown(keyboardEvent) {
|
|
810
|
+
const { key } = keyboardEvent;
|
|
811
|
+
const isOpen = this.getState("isOpen");
|
|
812
|
+
const opensOnArrow = (key === "ArrowDown" || key === "ArrowUp") && !isOpen;
|
|
813
|
+
const opensSelectOnly = !isOpen && !this.#isFilterable() && (key === " " || key === "Home" || key === "End");
|
|
814
|
+
const spaceWhileOpen = isOpen && key === " " && !isTextEditor(keyboardEvent.target);
|
|
815
|
+
if (opensOnArrow || opensSelectOnly || spaceWhileOpen || isEnterPress(keyboardEvent)) {
|
|
816
|
+
keyboardEvent.preventDefault();
|
|
817
|
+
this.handleClick(keyboardEvent);
|
|
818
|
+
}
|
|
819
|
+
if (opensSelectOnly && key !== " " && this.getState("isOpen")) {
|
|
820
|
+
const column = CascaderFoundation.getRenderData(this.getProps(), this.getStates());
|
|
821
|
+
const index = key === "Home" ? 0 : column.length - 1;
|
|
822
|
+
if (column[index]) this.#moveTo(column[index].key, index);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
handleInputChange(sugInput) {
|
|
826
|
+
const filteredKeys = this.#calcFilteredKeys(sugInput);
|
|
827
|
+
this._adapter.updateStates({
|
|
828
|
+
inputValue: sugInput,
|
|
829
|
+
isSearching: Boolean(sugInput),
|
|
830
|
+
filteredKeys: new Set(filteredKeys),
|
|
831
|
+
keyboardKey: null
|
|
832
|
+
});
|
|
833
|
+
this._adapter.notifyOnSearch(sugInput);
|
|
834
|
+
}
|
|
835
|
+
handleClear() {
|
|
836
|
+
const { isSearching, keyEntities, inputValue } = this.getStates();
|
|
837
|
+
const { multiple } = this.getProps();
|
|
838
|
+
const isFilterable = this.#isFilterable();
|
|
839
|
+
const isControlled = this._isControlledComponent();
|
|
840
|
+
const newState = {};
|
|
841
|
+
if (multiple) {
|
|
842
|
+
const hasValue = CascaderFoundation.hasMultipleValue(this.getProps(), this.getStates());
|
|
843
|
+
newState.isSearching = false;
|
|
844
|
+
this.#clearInput();
|
|
845
|
+
if (inputValue) this._adapter.notifyOnSearch("");
|
|
846
|
+
newState.checkedKeys = /* @__PURE__ */ new Set([]);
|
|
847
|
+
newState.halfCheckedKeys = /* @__PURE__ */ new Set([]);
|
|
848
|
+
newState.selectedKeys = /* @__PURE__ */ new Set([]);
|
|
849
|
+
newState.activeKeys = /* @__PURE__ */ new Set([]);
|
|
850
|
+
newState.resolvedCheckedKeys = /* @__PURE__ */ new Set([]);
|
|
851
|
+
newState.checkedEntities = keyEntities;
|
|
852
|
+
if (hasValue) this._adapter.notifyChange([]);
|
|
853
|
+
} else if (isFilterable && isSearching) {
|
|
854
|
+
newState.isSearching = false;
|
|
855
|
+
this.#clearInput();
|
|
856
|
+
this._adapter.notifyOnSearch("");
|
|
857
|
+
} else {
|
|
858
|
+
if (isFilterable) {
|
|
859
|
+
newState.inputValue = "";
|
|
860
|
+
this.#clearInput();
|
|
861
|
+
this._adapter.notifyOnSearch("");
|
|
862
|
+
}
|
|
863
|
+
if (!isControlled) newState.selectedKeys = /* @__PURE__ */ new Set([]);
|
|
864
|
+
newState.activeKeys = /* @__PURE__ */ new Set([]);
|
|
865
|
+
newState.filteredKeys = /* @__PURE__ */ new Set([]);
|
|
866
|
+
this._adapter.notifyChange([]);
|
|
867
|
+
}
|
|
868
|
+
this._adapter.updateStates(newState);
|
|
869
|
+
this._adapter.notifyClear();
|
|
870
|
+
}
|
|
871
|
+
handleListScroll(e, ind) {
|
|
872
|
+
const { activeKeys, keyEntities } = this.getStates();
|
|
873
|
+
const lastActiveKey = [...activeKeys].at(-1);
|
|
874
|
+
const data = lastActiveKey ? keyEntities?.[lastActiveKey]?.data ?? null : null;
|
|
875
|
+
this._adapter.notifyListScroll(e, {
|
|
876
|
+
panelIndex: ind,
|
|
877
|
+
activeNode: data
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
handleTagRemoveByKey(key) {
|
|
881
|
+
const { keyEntities } = this.getStates();
|
|
882
|
+
const { disabled } = this.getProps();
|
|
883
|
+
if (disabled) return;
|
|
884
|
+
const removedItem = keyEntities[key];
|
|
885
|
+
if (removedItem && !removedItem.data?.disabled) this.#handleMultipleSelect(removedItem);
|
|
886
|
+
}
|
|
887
|
+
handleTagRemoveInTrigger(pos) {
|
|
888
|
+
const { treeData, keyMaps } = this.getProps();
|
|
889
|
+
const key = getKeyByPos(pos, treeData, keyMaps);
|
|
890
|
+
this.handleTagRemoveByKey(key);
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
export { CascaderFoundation as default };
|