@douyinfe/semi-foundation 2.1.0 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/anchor/foundation.ts +1 -1
- package/autoComplete/autoComplete.scss +3 -2
- package/autoComplete/foundation.ts +1 -1
- package/base/foundation.ts +1 -1
- package/cascader/foundation.ts +1 -1
- package/cascader/util.ts +1 -1
- package/checkbox/checkbox.scss +25 -1
- package/checkbox/checkboxFoundation.ts +14 -4
- package/checkbox/variables.scss +6 -1
- package/datePicker/_utils/getFullDateOffset.ts +1 -1
- package/datePicker/foundation.ts +1 -1
- package/datePicker/monthsGridFoundation.ts +1 -1
- package/form/foundation.ts +1 -1
- package/form/utils.ts +1 -1
- package/getBabelConfig.js +36 -0
- package/gulpfile.js +27 -9
- package/input/foundation.ts +1 -1
- package/input/input.scss +2 -0
- package/input/textareaFoundation.ts +1 -1
- package/input/util/getSizingData.ts +1 -1
- package/input/variables.scss +1 -1
- package/inputNumber/foundation.ts +1 -1
- package/lib/cjs/_portal/portal.css +15 -0
- package/lib/cjs/_portal/portal.scss +17 -0
- package/lib/cjs/anchor/anchor.css +118 -0
- package/lib/cjs/anchor/anchor.scss +120 -0
- package/lib/cjs/anchor/constants.d.ts +11 -0
- package/lib/cjs/anchor/constants.js +24 -0
- package/lib/cjs/anchor/foundation.d.ts +41 -0
- package/lib/cjs/anchor/foundation.js +270 -0
- package/lib/cjs/anchor/linkFoundation.d.ts +14 -0
- package/lib/cjs/anchor/linkFoundation.js +50 -0
- package/lib/cjs/anchor/rtl.scss +18 -0
- package/lib/cjs/anchor/variables.scss +27 -0
- package/lib/cjs/autoComplete/autoComplete.css +103 -0
- package/lib/cjs/autoComplete/autoComplete.scss +38 -0
- package/lib/cjs/autoComplete/constants.d.ts +10 -0
- package/lib/cjs/autoComplete/constants.js +25 -0
- package/lib/cjs/autoComplete/foundation.d.ts +62 -0
- package/lib/cjs/autoComplete/foundation.js +465 -0
- package/lib/cjs/autoComplete/rtl.scss +8 -0
- package/lib/cjs/autoComplete/variables.scss +3 -0
- package/lib/cjs/avatar/avatar.css +426 -0
- package/lib/cjs/avatar/avatar.scss +205 -0
- package/lib/cjs/avatar/constants.d.ts +10 -0
- package/lib/cjs/avatar/constants.js +24 -0
- package/lib/cjs/avatar/foundation.d.ts +14 -0
- package/lib/cjs/avatar/foundation.js +49 -0
- package/lib/cjs/avatar/mixin.css +3 -0
- package/lib/cjs/avatar/mixin.scss +4 -0
- package/lib/cjs/avatar/rtl.scss +69 -0
- package/lib/cjs/avatar/variables.scss +45 -0
- package/lib/cjs/backtop/backtop.css +20 -0
- package/lib/cjs/backtop/backtop.scss +17 -0
- package/lib/cjs/backtop/constants.d.ts +5 -0
- package/lib/cjs/backtop/constants.js +18 -0
- package/lib/cjs/backtop/foundation.d.ts +21 -0
- package/lib/cjs/backtop/foundation.js +114 -0
- package/lib/cjs/backtop/rtl.scss +10 -0
- package/lib/cjs/backtop/variables.scss +3 -0
- package/lib/cjs/badge/badge.css +146 -0
- package/lib/cjs/badge/badge.scss +168 -0
- package/lib/cjs/badge/constants.d.ts +10 -0
- package/lib/cjs/badge/constants.js +24 -0
- package/lib/cjs/badge/rtl.scss +8 -0
- package/lib/cjs/badge/variables.scss +43 -0
- package/lib/cjs/banner/banner.css +92 -0
- package/lib/cjs/banner/banner.scss +109 -0
- package/lib/cjs/banner/constants.d.ts +7 -0
- package/lib/cjs/banner/constants.js +20 -0
- package/lib/cjs/banner/foundation.d.ts +9 -0
- package/lib/cjs/banner/foundation.js +30 -0
- package/lib/cjs/banner/rtl.scss +20 -0
- package/lib/cjs/banner/variables.scss +27 -0
- package/lib/cjs/base/base.css +24 -0
- package/lib/cjs/base/base.scss +33 -0
- package/lib/cjs/base/constants.d.ts +3 -0
- package/lib/cjs/base/constants.js +22 -0
- package/lib/cjs/base/env.d.ts +1 -0
- package/lib/cjs/base/env.js +11 -0
- package/lib/cjs/base/foundation.d.ts +59 -0
- package/lib/cjs/base/foundation.js +144 -0
- package/lib/cjs/base/index.d.ts +5 -0
- package/lib/cjs/base/index.js +18 -0
- package/lib/cjs/breadcrumb/breadcrumb.css +109 -0
- package/lib/cjs/breadcrumb/breadcrumb.scss +120 -0
- package/lib/cjs/breadcrumb/constants.d.ts +7 -0
- package/lib/cjs/breadcrumb/constants.js +20 -0
- package/lib/cjs/breadcrumb/foundation.d.ts +24 -0
- package/lib/cjs/breadcrumb/foundation.js +52 -0
- package/lib/cjs/breadcrumb/itemFoundation.d.ts +22 -0
- package/lib/cjs/breadcrumb/itemFoundation.js +31 -0
- package/lib/cjs/breadcrumb/rtl.scss +33 -0
- package/lib/cjs/breadcrumb/variables.scss +19 -0
- package/lib/cjs/button/button.css +309 -0
- package/lib/cjs/button/button.scss +219 -0
- package/lib/cjs/button/constants.d.ts +6 -0
- package/lib/cjs/button/constants.js +28 -0
- package/lib/cjs/button/iconButton.css +160 -0
- package/lib/cjs/button/iconButton.scss +70 -0
- package/lib/cjs/button/rtl.scss +128 -0
- package/lib/cjs/button/splitButtonGroup.scss +32 -0
- package/lib/cjs/button/variables.scss +128 -0
- package/lib/cjs/calendar/calendar.css +592 -0
- package/lib/cjs/calendar/calendar.scss +520 -0
- package/lib/cjs/calendar/constants.d.ts +7 -0
- package/lib/cjs/calendar/constants.js +20 -0
- package/lib/cjs/calendar/eventUtil.d.ts +93 -0
- package/lib/cjs/calendar/eventUtil.js +431 -0
- package/lib/cjs/calendar/foundation.d.ts +99 -0
- package/lib/cjs/calendar/foundation.js +483 -0
- package/lib/cjs/calendar/rtl.scss +134 -0
- package/lib/cjs/calendar/variables.scss +105 -0
- package/lib/cjs/card/card.css +148 -0
- package/lib/cjs/card/card.scss +146 -0
- package/lib/cjs/card/constants.d.ts +8 -0
- package/lib/cjs/card/constants.js +21 -0
- package/lib/cjs/card/rtl.scss +43 -0
- package/lib/cjs/card/variables.scss +30 -0
- package/lib/cjs/cascader/cascader.css +438 -0
- package/lib/cjs/cascader/cascader.scss +436 -0
- package/lib/cjs/cascader/constants.d.ts +14 -0
- package/lib/cjs/cascader/constants.js +28 -0
- package/lib/cjs/cascader/foundation.d.ts +221 -0
- package/lib/cjs/cascader/foundation.js +1061 -0
- package/lib/cjs/cascader/rtl.scss +114 -0
- package/lib/cjs/cascader/util.d.ts +4 -0
- package/lib/cjs/cascader/util.js +114 -0
- package/lib/cjs/cascader/variables.scss +117 -0
- package/lib/cjs/checkbox/checkbox.css +330 -0
- package/lib/cjs/checkbox/checkbox.scss +387 -0
- package/lib/cjs/checkbox/checkboxFoundation.d.ts +55 -0
- package/lib/cjs/checkbox/checkboxFoundation.js +112 -0
- package/lib/cjs/checkbox/checkboxGroupFoundation.d.ts +17 -0
- package/lib/cjs/checkbox/checkboxGroupFoundation.js +103 -0
- package/lib/cjs/checkbox/constants.d.ts +27 -0
- package/lib/cjs/checkbox/constants.js +42 -0
- package/lib/cjs/checkbox/mixin.css +3 -0
- package/lib/cjs/checkbox/mixin.scss +0 -0
- package/lib/cjs/checkbox/rtl.scss +54 -0
- package/lib/cjs/checkbox/variables.scss +67 -0
- package/lib/cjs/collapse/collapse.css +78 -0
- package/lib/cjs/collapse/collapse.scss +77 -0
- package/lib/cjs/collapse/constants.d.ts +7 -0
- package/lib/cjs/collapse/constants.js +20 -0
- package/lib/cjs/collapse/foundation.d.ts +28 -0
- package/lib/cjs/collapse/foundation.js +77 -0
- package/lib/cjs/collapse/rtl.scss +26 -0
- package/lib/cjs/collapse/variables.scss +22 -0
- package/lib/cjs/collapsible/constants.d.ts +4 -0
- package/lib/cjs/collapsible/constants.js +16 -0
- package/lib/cjs/datePicker/_utils/formatter.d.ts +14 -0
- package/lib/cjs/datePicker/_utils/formatter.js +72 -0
- package/lib/cjs/datePicker/_utils/getDayOfWeek.d.ts +11 -0
- package/lib/cjs/datePicker/_utils/getDayOfWeek.js +31 -0
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.d.ts +9 -0
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +29 -0
- package/lib/cjs/datePicker/_utils/getFullDateOffset.d.ts +7 -0
- package/lib/cjs/datePicker/_utils/getFullDateOffset.js +35 -0
- package/lib/cjs/datePicker/_utils/getMonthTable.d.ts +12 -0
- package/lib/cjs/datePicker/_utils/getMonthTable.js +97 -0
- package/lib/cjs/datePicker/_utils/getMonthsInYear.d.ts +2 -0
- package/lib/cjs/datePicker/_utils/getMonthsInYear.js +26 -0
- package/lib/cjs/datePicker/_utils/getYears.d.ts +2 -0
- package/lib/cjs/datePicker/_utils/getYears.js +24 -0
- package/lib/cjs/datePicker/_utils/index.d.ts +13 -0
- package/lib/cjs/datePicker/_utils/index.js +117 -0
- package/lib/cjs/datePicker/_utils/isAfter.d.ts +1 -0
- package/lib/cjs/datePicker/_utils/isAfter.js +21 -0
- package/lib/cjs/datePicker/_utils/isBefore.d.ts +1 -0
- package/lib/cjs/datePicker/_utils/isBefore.js +21 -0
- package/lib/cjs/datePicker/_utils/isBetween.d.ts +11 -0
- package/lib/cjs/datePicker/_utils/isBetween.js +36 -0
- package/lib/cjs/datePicker/_utils/isDate.d.ts +1 -0
- package/lib/cjs/datePicker/_utils/isDate.js +13 -0
- package/lib/cjs/datePicker/_utils/isSameDay.d.ts +1 -0
- package/lib/cjs/datePicker/_utils/isSameDay.js +21 -0
- package/lib/cjs/datePicker/_utils/isTimestamp.d.ts +1 -0
- package/lib/cjs/datePicker/_utils/isTimestamp.js +19 -0
- package/lib/cjs/datePicker/_utils/isUnixTimestamp.d.ts +1 -0
- package/lib/cjs/datePicker/_utils/isUnixTimestamp.js +19 -0
- package/lib/cjs/datePicker/_utils/isValidDate.d.ts +1 -0
- package/lib/cjs/datePicker/_utils/isValidDate.js +13 -0
- package/lib/cjs/datePicker/_utils/isWithinInterval.d.ts +4 -0
- package/lib/cjs/datePicker/_utils/isWithinInterval.js +29 -0
- package/lib/cjs/datePicker/_utils/parser.d.ts +4 -0
- package/lib/cjs/datePicker/_utils/parser.js +46 -0
- package/lib/cjs/datePicker/constants.d.ts +50 -0
- package/lib/cjs/datePicker/constants.js +75 -0
- package/lib/cjs/datePicker/datePicker.css +810 -0
- package/lib/cjs/datePicker/datePicker.scss +1034 -0
- package/lib/cjs/datePicker/foundation.d.ts +409 -0
- package/lib/cjs/datePicker/foundation.js +1167 -0
- package/lib/cjs/datePicker/inputFoundation.d.ts +59 -0
- package/lib/cjs/datePicker/inputFoundation.js +125 -0
- package/lib/cjs/datePicker/monthFoundation.d.ts +73 -0
- package/lib/cjs/datePicker/monthFoundation.js +96 -0
- package/lib/cjs/datePicker/monthsGridFoundation.d.ts +218 -0
- package/lib/cjs/datePicker/monthsGridFoundation.js +954 -0
- package/lib/cjs/datePicker/rtl.scss +171 -0
- package/lib/cjs/datePicker/variables.scss +169 -0
- package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +56 -0
- package/lib/cjs/datePicker/yearAndMonthFoundation.js +52 -0
- package/lib/cjs/descriptions/constants.d.ts +9 -0
- package/lib/cjs/descriptions/constants.js +23 -0
- package/lib/cjs/descriptions/descriptions.css +191 -0
- package/lib/cjs/descriptions/descriptions.scss +150 -0
- package/lib/cjs/descriptions/rtl.scss +91 -0
- package/lib/cjs/descriptions/variables.scss +15 -0
- package/lib/cjs/dropdown/constants.d.ts +16 -0
- package/lib/cjs/dropdown/constants.js +32 -0
- package/lib/cjs/dropdown/dropdown.css +123 -0
- package/lib/cjs/dropdown/dropdown.scss +106 -0
- package/lib/cjs/dropdown/foundation.d.ts +8 -0
- package/lib/cjs/dropdown/foundation.js +24 -0
- package/lib/cjs/dropdown/rtl.scss +27 -0
- package/lib/cjs/dropdown/variables.scss +38 -0
- package/lib/cjs/empty/constants.d.ts +7 -0
- package/lib/cjs/empty/constants.js +20 -0
- package/lib/cjs/empty/empty.css +50 -0
- package/lib/cjs/empty/empty.scss +54 -0
- package/lib/cjs/empty/rtl.scss +15 -0
- package/lib/cjs/empty/variables.scss +8 -0
- package/lib/cjs/form/constants.d.ts +11 -0
- package/lib/cjs/form/constants.js +25 -0
- package/lib/cjs/form/form.css +250 -0
- package/lib/cjs/form/form.scss +273 -0
- package/lib/cjs/form/foundation.d.ts +86 -0
- package/lib/cjs/form/foundation.js +845 -0
- package/lib/cjs/form/interface.d.ts +121 -0
- package/lib/cjs/form/interface.js +7 -0
- package/lib/cjs/form/rtl.scss +89 -0
- package/lib/cjs/form/utils.d.ts +52 -0
- package/lib/cjs/form/utils.js +242 -0
- package/lib/cjs/form/variables.scss +44 -0
- package/lib/cjs/grid/constants.d.ts +4 -0
- package/lib/cjs/grid/constants.js +16 -0
- package/lib/cjs/grid/grid.css +6295 -0
- package/lib/cjs/grid/grid.scss +121 -0
- package/lib/cjs/grid/mixin.css +3 -0
- package/lib/cjs/grid/mixin.scss +115 -0
- package/lib/cjs/grid/rtl.scss +9 -0
- package/lib/cjs/grid/variables.scss +35 -0
- package/lib/cjs/icons/constants.d.ts +9 -0
- package/lib/cjs/icons/constants.js +24 -0
- package/lib/cjs/input/constants.d.ts +12 -0
- package/lib/cjs/input/constants.js +26 -0
- package/lib/cjs/input/foundation.d.ts +79 -0
- package/lib/cjs/input/foundation.js +379 -0
- package/lib/cjs/input/input.css +568 -0
- package/lib/cjs/input/input.scss +630 -0
- package/lib/cjs/input/rtl.scss +100 -0
- package/lib/cjs/input/textarea.css +222 -0
- package/lib/cjs/input/textarea.scss +188 -0
- package/lib/cjs/input/textareaFoundation.d.ts +63 -0
- package/lib/cjs/input/textareaFoundation.js +299 -0
- package/lib/cjs/input/util/calculateNodeHeight.d.ts +1 -0
- package/lib/cjs/input/util/calculateNodeHeight.js +101 -0
- package/lib/cjs/input/util/getSizingData.d.ts +6 -0
- package/lib/cjs/input/util/getSizingData.js +47 -0
- package/lib/cjs/input/variables.scss +109 -0
- package/lib/cjs/inputNumber/constants.d.ts +17 -0
- package/lib/cjs/inputNumber/constants.js +27 -0
- package/lib/cjs/inputNumber/foundation.d.ts +107 -0
- package/lib/cjs/inputNumber/foundation.js +692 -0
- package/lib/cjs/inputNumber/inputNumber.css +99 -0
- package/lib/cjs/inputNumber/inputNumber.scss +108 -0
- package/lib/cjs/inputNumber/rtl.scss +30 -0
- package/lib/cjs/inputNumber/variables.scss +23 -0
- package/lib/cjs/keyframes/rotate.css +11 -0
- package/lib/cjs/keyframes/rotate.scss +8 -0
- package/lib/cjs/layout/constants.d.ts +7 -0
- package/lib/cjs/layout/constants.js +20 -0
- package/lib/cjs/layout/layout.css +40 -0
- package/lib/cjs/layout/layout.scss +49 -0
- package/lib/cjs/layout/rtl.scss +8 -0
- package/lib/cjs/list/constants.d.ts +9 -0
- package/lib/cjs/list/constants.js +22 -0
- package/lib/cjs/list/list.css +121 -0
- package/lib/cjs/list/list.scss +125 -0
- package/lib/cjs/list/rtl.scss +39 -0
- package/lib/cjs/list/variables.scss +17 -0
- package/lib/cjs/modal/constants.d.ts +10 -0
- package/lib/cjs/modal/constants.js +23 -0
- package/lib/cjs/modal/modal.css +233 -0
- package/lib/cjs/modal/modal.scss +267 -0
- package/lib/cjs/modal/modalContentFoundation.d.ts +33 -0
- package/lib/cjs/modal/modalContentFoundation.js +76 -0
- package/lib/cjs/modal/modalFoundation.d.ts +68 -0
- package/lib/cjs/modal/modalFoundation.js +52 -0
- package/lib/cjs/modal/rtl.scss +48 -0
- package/lib/cjs/modal/variables.scss +69 -0
- package/lib/cjs/navigation/NavItem.d.ts +10 -0
- package/lib/cjs/navigation/NavItem.js +74 -0
- package/lib/cjs/navigation/constants.d.ts +21 -0
- package/lib/cjs/navigation/constants.js +38 -0
- package/lib/cjs/navigation/foundation.d.ts +86 -0
- package/lib/cjs/navigation/foundation.js +313 -0
- package/lib/cjs/navigation/itemFoundation.d.ts +45 -0
- package/lib/cjs/navigation/itemFoundation.js +84 -0
- package/lib/cjs/navigation/mixin.css +3 -0
- package/lib/cjs/navigation/mixin.scss +98 -0
- package/lib/cjs/navigation/navigation.css +758 -0
- package/lib/cjs/navigation/navigation.scss +683 -0
- package/lib/cjs/navigation/rtl.scss +132 -0
- package/lib/cjs/navigation/subNavFoundation.d.ts +39 -0
- package/lib/cjs/navigation/subNavFoundation.js +147 -0
- package/lib/cjs/navigation/variables.scss +132 -0
- package/lib/cjs/notification/constants.d.ts +14 -0
- package/lib/cjs/notification/constants.js +29 -0
- package/lib/cjs/notification/notification.css +154 -0
- package/lib/cjs/notification/notification.scss +168 -0
- package/lib/cjs/notification/notificationFoundation.d.ts +48 -0
- package/lib/cjs/notification/notificationFoundation.js +74 -0
- package/lib/cjs/notification/notificationListFoundation.d.ts +28 -0
- package/lib/cjs/notification/notificationListFoundation.js +61 -0
- package/lib/cjs/notification/rtl.scss +23 -0
- package/lib/cjs/notification/variables.scss +43 -0
- package/lib/cjs/overflowList/constants.d.ts +23 -0
- package/lib/cjs/overflowList/constants.js +44 -0
- package/lib/cjs/overflowList/foundation.d.ts +14 -0
- package/lib/cjs/overflowList/foundation.js +143 -0
- package/lib/cjs/overflowList/overflowList.css +23 -0
- package/lib/cjs/overflowList/overflowList.scss +20 -0
- package/lib/cjs/overflowList/rtl.scss +8 -0
- package/lib/cjs/pagination/constants.d.ts +12 -0
- package/lib/cjs/pagination/constants.js +26 -0
- package/lib/cjs/pagination/foundation.d.ts +52 -0
- package/lib/cjs/pagination/foundation.js +385 -0
- package/lib/cjs/pagination/pagination.css +155 -0
- package/lib/cjs/pagination/pagination.scss +158 -0
- package/lib/cjs/pagination/rtl.scss +18 -0
- package/lib/cjs/pagination/variables.scss +51 -0
- package/lib/cjs/popconfirm/constants.d.ts +13 -0
- package/lib/cjs/popconfirm/constants.js +27 -0
- package/lib/cjs/popconfirm/popconfirm.css +117 -0
- package/lib/cjs/popconfirm/popconfirm.scss +105 -0
- package/lib/cjs/popconfirm/popconfirmFoundation.d.ts +16 -0
- package/lib/cjs/popconfirm/popconfirmFoundation.js +47 -0
- package/lib/cjs/popconfirm/rtl.scss +60 -0
- package/lib/cjs/popconfirm/variables.scss +36 -0
- package/lib/cjs/popover/constants.d.ts +25 -0
- package/lib/cjs/popover/constants.js +45 -0
- package/lib/cjs/popover/popover.css +160 -0
- package/lib/cjs/popover/popover.scss +54 -0
- package/lib/cjs/popover/rtl.scss +7 -0
- package/lib/cjs/popover/variables.scss +28 -0
- package/lib/cjs/progress/constants.d.ts +14 -0
- package/lib/cjs/progress/constants.js +28 -0
- package/lib/cjs/progress/progress.css +106 -0
- package/lib/cjs/progress/progress.scss +105 -0
- package/lib/cjs/progress/rtl.scss +29 -0
- package/lib/cjs/progress/variables.scss +25 -0
- package/lib/cjs/radio/constants.d.ts +29 -0
- package/lib/cjs/radio/constants.js +44 -0
- package/lib/cjs/radio/mixin.css +3 -0
- package/lib/cjs/radio/mixin.scss +0 -0
- package/lib/cjs/radio/radio.css +377 -0
- package/lib/cjs/radio/radio.scss +422 -0
- package/lib/cjs/radio/radioFoundation.d.ts +7 -0
- package/lib/cjs/radio/radioFoundation.js +22 -0
- package/lib/cjs/radio/radioGroupFoundation.d.ts +16 -0
- package/lib/cjs/radio/radioGroupFoundation.js +91 -0
- package/lib/cjs/radio/radioInnerFoundation.d.ts +22 -0
- package/lib/cjs/radio/radioInnerFoundation.js +74 -0
- package/lib/cjs/radio/rtl.scss +78 -0
- package/lib/cjs/radio/variables.scss +101 -0
- package/lib/cjs/rating/constants.d.ts +7 -0
- package/lib/cjs/rating/constants.js +20 -0
- package/lib/cjs/rating/foundation.d.ts +28 -0
- package/lib/cjs/rating/foundation.js +202 -0
- package/lib/cjs/rating/rating.css +84 -0
- package/lib/cjs/rating/rating.scss +91 -0
- package/lib/cjs/rating/rtl.scss +21 -0
- package/lib/cjs/rating/variables.scss +14 -0
- package/lib/cjs/scrollList/constants.d.ts +12 -0
- package/lib/cjs/scrollList/constants.js +26 -0
- package/lib/cjs/scrollList/foundation.d.ts +3 -0
- package/lib/cjs/scrollList/foundation.js +17 -0
- package/lib/cjs/scrollList/itemFoundation.d.ts +74 -0
- package/lib/cjs/scrollList/itemFoundation.js +320 -0
- package/lib/cjs/scrollList/rtl.scss +47 -0
- package/lib/cjs/scrollList/scrollList.css +181 -0
- package/lib/cjs/scrollList/scrollList.scss +182 -0
- package/lib/cjs/scrollList/scrollTo.d.ts +3 -0
- package/lib/cjs/scrollList/scrollTo.js +35 -0
- package/lib/cjs/scrollList/variables.scss +48 -0
- package/lib/cjs/select/constants.d.ts +16 -0
- package/lib/cjs/select/constants.js +33 -0
- package/lib/cjs/select/foundation.d.ts +107 -0
- package/lib/cjs/select/foundation.js +1220 -0
- package/lib/cjs/select/mixin.css +3 -0
- package/lib/cjs/select/mixin.scss +6 -0
- package/lib/cjs/select/option.css +76 -0
- package/lib/cjs/select/option.scss +95 -0
- package/lib/cjs/select/optionFoundation.d.ts +21 -0
- package/lib/cjs/select/optionFoundation.js +42 -0
- package/lib/cjs/select/rtl.scss +93 -0
- package/lib/cjs/select/select.css +465 -0
- package/lib/cjs/select/select.scss +422 -0
- package/lib/cjs/select/variables.scss +100 -0
- package/lib/cjs/sideSheet/constants.d.ts +15 -0
- package/lib/cjs/sideSheet/constants.js +28 -0
- package/lib/cjs/sideSheet/rtl.scss +17 -0
- package/lib/cjs/sideSheet/sideSheet.css +143 -0
- package/lib/cjs/sideSheet/sideSheet.scss +171 -0
- package/lib/cjs/sideSheet/sideSheetFoundation.d.ts +55 -0
- package/lib/cjs/sideSheet/sideSheetFoundation.js +126 -0
- package/lib/cjs/sideSheet/variables.scss +16 -0
- package/lib/cjs/skeleton/constants.d.ts +5 -0
- package/lib/cjs/skeleton/constants.js +18 -0
- package/lib/cjs/skeleton/rtl.scss +8 -0
- package/lib/cjs/skeleton/skeleton.css +87 -0
- package/lib/cjs/skeleton/skeleton.scss +115 -0
- package/lib/cjs/skeleton/variables.scss +20 -0
- package/lib/cjs/slider/constants.d.ts +15 -0
- package/lib/cjs/slider/constants.js +28 -0
- package/lib/cjs/slider/foundation.d.ts +203 -0
- package/lib/cjs/slider/foundation.js +734 -0
- package/lib/cjs/slider/slider.css +192 -0
- package/lib/cjs/slider/slider.scss +234 -0
- package/lib/cjs/slider/variables.scss +60 -0
- package/lib/cjs/space/constants.d.ts +10 -0
- package/lib/cjs/space/constants.js +23 -0
- package/lib/cjs/space/rtl.scss +8 -0
- package/lib/cjs/space/space.css +50 -0
- package/lib/cjs/space/space.scss +58 -0
- package/lib/cjs/space/variables.scss +3 -0
- package/lib/cjs/spin/constants.d.ts +8 -0
- package/lib/cjs/spin/constants.js +23 -0
- package/lib/cjs/spin/foundation.d.ts +12 -0
- package/lib/cjs/spin/foundation.js +62 -0
- package/lib/cjs/spin/mixin.css +3 -0
- package/lib/cjs/spin/mixin.scss +5 -0
- package/lib/cjs/spin/rtl.scss +12 -0
- package/lib/cjs/spin/spin.css +104 -0
- package/lib/cjs/spin/spin.scss +104 -0
- package/lib/cjs/spin/variables.scss +18 -0
- package/lib/cjs/steps/bacisSteps.scss +344 -0
- package/lib/cjs/steps/constants.d.ts +5 -0
- package/lib/cjs/steps/constants.js +17 -0
- package/lib/cjs/steps/fillSteps.scss +193 -0
- package/lib/cjs/steps/mixin.css +3 -0
- package/lib/cjs/steps/mixin.scss +0 -0
- package/lib/cjs/steps/navSteps.scss +63 -0
- package/lib/cjs/steps/rtl.scss +46 -0
- package/lib/cjs/steps/steps.css +444 -0
- package/lib/cjs/steps/steps.scss +9 -0
- package/lib/cjs/steps/variables.scss +104 -0
- package/lib/cjs/switch/constants.d.ts +18 -0
- package/lib/cjs/switch/constants.js +31 -0
- package/lib/cjs/switch/foundation.d.ts +14 -0
- package/lib/cjs/switch/foundation.js +58 -0
- package/lib/cjs/switch/rtl.scss +103 -0
- package/lib/cjs/switch/switch.css +288 -0
- package/lib/cjs/switch/switch.scss +282 -0
- package/lib/cjs/switch/variables.scss +70 -0
- package/lib/cjs/table/bodyFoundation.d.ts +38 -0
- package/lib/cjs/table/bodyFoundation.js +164 -0
- package/lib/cjs/table/cellFoundation.d.ts +7 -0
- package/lib/cjs/table/cellFoundation.js +22 -0
- package/lib/cjs/table/constants.d.ts +77 -0
- package/lib/cjs/table/constants.js +110 -0
- package/lib/cjs/table/foundation.d.ts +351 -0
- package/lib/cjs/table/foundation.js +1167 -0
- package/lib/cjs/table/mixin.css +3 -0
- package/lib/cjs/table/mixin.scss +10 -0
- package/lib/cjs/table/operationPanel.scss +46 -0
- package/lib/cjs/table/rtl.scss +158 -0
- package/lib/cjs/table/table.css +559 -0
- package/lib/cjs/table/table.scss +552 -0
- package/lib/cjs/table/tableRowFoundation.d.ts +14 -0
- package/lib/cjs/table/tableRowFoundation.js +44 -0
- package/lib/cjs/table/tableSelectionCellFoundation.d.ts +13 -0
- package/lib/cjs/table/tableSelectionCellFoundation.js +24 -0
- package/lib/cjs/table/utils.d.ts +95 -0
- package/lib/cjs/table/utils.js +617 -0
- package/lib/cjs/table/variables.scss +84 -0
- package/lib/cjs/tabs/constants.d.ts +28 -0
- package/lib/cjs/tabs/constants.js +42 -0
- package/lib/cjs/tabs/foundation.d.ts +23 -0
- package/lib/cjs/tabs/foundation.js +95 -0
- package/lib/cjs/tabs/rtl.scss +123 -0
- package/lib/cjs/tabs/tabs.css +378 -0
- package/lib/cjs/tabs/tabs.scss +411 -0
- package/lib/cjs/tabs/variables.scss +115 -0
- package/lib/cjs/tag/constants.d.ts +10 -0
- package/lib/cjs/tag/constants.js +24 -0
- package/lib/cjs/tag/mixin.css +3 -0
- package/lib/cjs/tag/mixin.scss +21 -0
- package/lib/cjs/tag/rtl.scss +61 -0
- package/lib/cjs/tag/tag.css +444 -0
- package/lib/cjs/tag/tag.scss +181 -0
- package/lib/cjs/tag/variables.scss +48 -0
- package/lib/cjs/tagInput/constants.d.ts +8 -0
- package/lib/cjs/tagInput/constants.js +21 -0
- package/lib/cjs/tagInput/foundation.d.ts +53 -0
- package/lib/cjs/tagInput/foundation.js +267 -0
- package/lib/cjs/tagInput/rtl.scss +23 -0
- package/lib/cjs/tagInput/tagInput.css +171 -0
- package/lib/cjs/tagInput/tagInput.scss +192 -0
- package/lib/cjs/tagInput/utils/getSplitedArray.d.ts +7 -0
- package/lib/cjs/tagInput/utils/getSplitedArray.js +47 -0
- package/lib/cjs/tagInput/variables.scss +39 -0
- package/lib/cjs/timePicker/ComboxFoundation.d.ts +31 -0
- package/lib/cjs/timePicker/ComboxFoundation.js +193 -0
- package/lib/cjs/timePicker/constants.d.ts +23 -0
- package/lib/cjs/timePicker/constants.js +43 -0
- package/lib/cjs/timePicker/foundation.d.ts +53 -0
- package/lib/cjs/timePicker/foundation.js +465 -0
- package/lib/cjs/timePicker/inputFoundation.d.ts +18 -0
- package/lib/cjs/timePicker/inputFoundation.js +81 -0
- package/lib/cjs/timePicker/rtl.scss +30 -0
- package/lib/cjs/timePicker/timePicker.css +72 -0
- package/lib/cjs/timePicker/timePicker.scss +86 -0
- package/lib/cjs/timePicker/utils/index.d.ts +41 -0
- package/lib/cjs/timePicker/utils/index.js +191 -0
- package/lib/cjs/timePicker/utils/localeDate.d.ts +2 -0
- package/lib/cjs/timePicker/utils/localeDate.js +47 -0
- package/lib/cjs/timePicker/variables.scss +22 -0
- package/lib/cjs/timeline/constants.d.ts +10 -0
- package/lib/cjs/timeline/constants.js +23 -0
- package/lib/cjs/timeline/rtl.scss +92 -0
- package/lib/cjs/timeline/timeline.css +197 -0
- package/lib/cjs/timeline/timeline.scss +175 -0
- package/lib/cjs/timeline/variables.scss +46 -0
- package/lib/cjs/toast/constants.d.ts +14 -0
- package/lib/cjs/toast/constants.js +30 -0
- package/lib/cjs/toast/rtl.scss +16 -0
- package/lib/cjs/toast/toast.css +76 -0
- package/lib/cjs/toast/toast.scss +92 -0
- package/lib/cjs/toast/toastFoundation.d.ts +48 -0
- package/lib/cjs/toast/toastFoundation.js +72 -0
- package/lib/cjs/toast/toastListFoundation.d.ts +17 -0
- package/lib/cjs/toast/toastListFoundation.js +62 -0
- package/lib/cjs/toast/variables.scss +34 -0
- package/lib/cjs/tooltip/arrow.scss +141 -0
- package/lib/cjs/tooltip/constants.d.ts +22 -0
- package/lib/cjs/tooltip/constants.js +37 -0
- package/lib/cjs/tooltip/foundation.d.ts +99 -0
- package/lib/cjs/tooltip/foundation.js +819 -0
- package/lib/cjs/tooltip/rtl.scss +12 -0
- package/lib/cjs/tooltip/tooltip.css +203 -0
- package/lib/cjs/tooltip/tooltip.scss +91 -0
- package/lib/cjs/tooltip/variables.scss +31 -0
- package/lib/cjs/transfer/constants.d.ts +10 -0
- package/lib/cjs/transfer/constants.js +24 -0
- package/lib/cjs/transfer/foundation.d.ts +51 -0
- package/lib/cjs/transfer/foundation.js +314 -0
- package/lib/cjs/transfer/rtl.scss +31 -0
- package/lib/cjs/transfer/transfer.css +202 -0
- package/lib/cjs/transfer/transfer.scss +200 -0
- package/lib/cjs/transfer/transferUtlls.d.ts +4 -0
- package/lib/cjs/transfer/transferUtlls.js +128 -0
- package/lib/cjs/transfer/variables.scss +55 -0
- package/lib/cjs/tree/constants.d.ts +9 -0
- package/lib/cjs/tree/constants.js +23 -0
- package/lib/cjs/tree/foundation.d.ts +281 -0
- package/lib/cjs/tree/foundation.js +711 -0
- package/lib/cjs/tree/rtl.scss +59 -0
- package/lib/cjs/tree/tree.css +478 -0
- package/lib/cjs/tree/tree.scss +372 -0
- package/lib/cjs/tree/treeUtil.d.ts +79 -0
- package/lib/cjs/tree/treeUtil.js +804 -0
- package/lib/cjs/tree/variables.scss +54 -0
- package/lib/cjs/treeSelect/constants.d.ts +13 -0
- package/lib/cjs/treeSelect/constants.js +27 -0
- package/lib/cjs/treeSelect/foundation.d.ts +162 -0
- package/lib/cjs/treeSelect/foundation.js +792 -0
- package/lib/cjs/treeSelect/rtl.scss +62 -0
- package/lib/cjs/treeSelect/treeSelect.css +308 -0
- package/lib/cjs/treeSelect/treeSelect.scss +332 -0
- package/lib/cjs/treeSelect/variables.scss +90 -0
- package/lib/cjs/typography/constants.d.ts +10 -0
- package/lib/cjs/typography/constants.js +23 -0
- package/lib/cjs/typography/rtl.scss +34 -0
- package/lib/cjs/typography/typography.css +220 -0
- package/lib/cjs/typography/typography.scss +218 -0
- package/lib/cjs/typography/variables.scss +45 -0
- package/lib/cjs/upload/constants.d.ts +28 -0
- package/lib/cjs/upload/constants.js +49 -0
- package/lib/cjs/upload/foundation.d.ts +166 -0
- package/lib/cjs/upload/foundation.js +1067 -0
- package/lib/cjs/upload/rtl.scss +87 -0
- package/lib/cjs/upload/upload.css +493 -0
- package/lib/cjs/upload/upload.scss +522 -0
- package/lib/cjs/upload/utils.d.ts +6 -0
- package/lib/cjs/upload/utils.js +165 -0
- package/lib/cjs/upload/variables.scss +81 -0
- package/lib/cjs/utils/Event.d.ts +7 -0
- package/lib/cjs/utils/Event.js +91 -0
- package/lib/cjs/utils/Logger.d.ts +15 -0
- package/lib/cjs/utils/Logger.js +77 -0
- package/lib/cjs/utils/Store.d.ts +9 -0
- package/lib/cjs/utils/Store.js +60 -0
- package/lib/cjs/utils/array.d.ts +22 -0
- package/lib/cjs/utils/array.js +64 -0
- package/lib/cjs/utils/classnames.d.ts +4 -0
- package/lib/cjs/utils/classnames.js +54 -0
- package/lib/cjs/utils/date-fns-extra.d.ts +55 -0
- package/lib/cjs/utils/date-fns-extra.js +148 -0
- package/lib/cjs/utils/dom.d.ts +27 -0
- package/lib/cjs/utils/dom.js +92 -0
- package/lib/cjs/utils/function.d.ts +4 -0
- package/lib/cjs/utils/function.js +15 -0
- package/lib/cjs/utils/getDataAttr.d.ts +1 -0
- package/lib/cjs/utils/getDataAttr.js +27 -0
- package/lib/cjs/utils/getHighlight.d.ts +45 -0
- package/lib/cjs/utils/getHighlight.js +211 -0
- package/lib/cjs/utils/getMotionObjFromProps.d.ts +26 -0
- package/lib/cjs/utils/getMotionObjFromProps.js +77 -0
- package/lib/cjs/utils/index.d.ts +2 -0
- package/lib/cjs/utils/index.js +41 -0
- package/lib/cjs/utils/isBothNaN.d.ts +8 -0
- package/lib/cjs/utils/isBothNaN.js +25 -0
- package/lib/cjs/utils/isElement.d.ts +1 -0
- package/lib/cjs/utils/isElement.js +21 -0
- package/lib/cjs/utils/isNullOrUndefined.d.ts +6 -0
- package/lib/cjs/utils/isNullOrUndefined.js +18 -0
- package/lib/cjs/utils/isNumber.d.ts +1 -0
- package/lib/cjs/utils/isNumber.js +13 -0
- package/lib/cjs/utils/isObject.d.ts +1 -0
- package/lib/cjs/utils/isObject.js +13 -0
- package/lib/cjs/utils/isPromise.d.ts +1 -0
- package/lib/cjs/utils/isPromise.js +17 -0
- package/lib/cjs/utils/isString.d.ts +1 -0
- package/lib/cjs/utils/isString.js +13 -0
- package/lib/cjs/utils/keyCode.d.ts +427 -0
- package/lib/cjs/utils/keyCode.js +542 -0
- package/lib/cjs/utils/log.d.ts +2 -0
- package/lib/cjs/utils/log.js +26 -0
- package/lib/cjs/utils/number.d.ts +10 -0
- package/lib/cjs/utils/number.js +29 -0
- package/lib/cjs/utils/object.d.ts +17 -0
- package/lib/cjs/utils/object.js +174 -0
- package/lib/cjs/utils/set.d.ts +7 -0
- package/lib/cjs/utils/set.js +44 -0
- package/lib/cjs/utils/shallowEqualObjects.d.ts +5 -0
- package/lib/cjs/utils/shallowEqualObjects.js +41 -0
- package/lib/cjs/utils/touchPolyfill.d.ts +2 -0
- package/lib/cjs/utils/touchPolyfill.js +50 -0
- package/lib/cjs/utils/type.d.ts +31 -0
- package/lib/cjs/utils/type.js +7 -0
- package/lib/cjs/utils/uuid.d.ts +3 -0
- package/lib/cjs/utils/uuid.js +29 -0
- package/lib/cjs/utils/warning.d.ts +1 -0
- package/lib/cjs/utils/warning.js +15 -0
- package/lib/es/anchor/foundation.js +8 -5
- package/lib/es/autoComplete/autoComplete.css +5 -5
- package/lib/es/autoComplete/autoComplete.scss +3 -2
- package/lib/es/autoComplete/foundation.js +8 -5
- package/lib/es/base/foundation.js +12 -12
- package/lib/es/cascader/foundation.js +25 -17
- package/lib/es/cascader/util.js +5 -3
- package/lib/es/checkbox/checkbox.css +21 -2
- package/lib/es/checkbox/checkbox.scss +25 -1
- package/lib/es/checkbox/checkboxFoundation.d.ts +10 -4
- package/lib/es/checkbox/checkboxFoundation.js +7 -0
- package/lib/es/checkbox/variables.scss +6 -1
- package/lib/es/datePicker/_utils/getFullDateOffset.js +2 -2
- package/lib/es/datePicker/foundation.js +15 -10
- package/lib/es/datePicker/monthsGridFoundation.js +8 -6
- package/lib/es/form/foundation.js +9 -6
- package/lib/es/form/utils.js +2 -2
- package/lib/es/input/foundation.js +15 -10
- package/lib/es/input/input.css +3 -2
- package/lib/es/input/input.scss +2 -0
- package/lib/es/input/textareaFoundation.js +17 -14
- package/lib/es/input/util/getSizingData.js +3 -3
- package/lib/es/input/variables.scss +1 -1
- package/lib/es/inputNumber/foundation.js +13 -11
- package/lib/es/navigation/foundation.js +2 -2
- package/lib/es/notification/notificationFoundation.js +2 -2
- package/lib/es/overflowList/foundation.js +6 -3
- package/lib/es/radio/radio.css +33 -2
- package/lib/es/radio/radio.scss +44 -1
- package/lib/es/radio/variables.scss +12 -2
- package/lib/es/rating/rating.css +3 -0
- package/lib/es/rating/rating.scss +4 -0
- package/lib/es/scrollList/itemFoundation.js +17 -7
- package/lib/es/select/foundation.js +9 -6
- package/lib/es/sideSheet/sideSheetFoundation.js +8 -7
- package/lib/es/table/bodyFoundation.js +14 -8
- package/lib/es/table/foundation.js +87 -67
- package/lib/es/table/utils.js +65 -42
- package/lib/es/tabs/foundation.js +2 -2
- package/lib/es/tagInput/foundation.js +10 -7
- package/lib/es/tagInput/utils/getSplitedArray.js +6 -4
- package/lib/es/timePicker/foundation.js +6 -4
- package/lib/es/timePicker/utils/index.js +5 -5
- package/lib/es/toast/toastFoundation.js +2 -2
- package/lib/es/tooltip/foundation.js +15 -16
- package/lib/es/transfer/foundation.js +2 -2
- package/lib/es/transfer/transferUtlls.js +4 -4
- package/lib/es/tree/foundation.js +14 -14
- package/lib/es/tree/treeUtil.js +21 -18
- package/lib/es/treeSelect/foundation.js +16 -9
- package/lib/es/utils/classnames.js +9 -5
- package/lib/es/utils/getHighlight.js +2 -3
- package/lib/es/utils/getMotionObjFromProps.js +6 -5
- package/lib/es/utils/log.js +2 -2
- package/lib/es/utils/object.js +31 -21
- package/lib/es/utils/set.js +2 -2
- package/navigation/foundation.ts +1 -1
- package/notification/notificationFoundation.ts +1 -1
- package/overflowList/foundation.ts +1 -1
- package/package.json +6 -4
- package/radio/radio.scss +44 -1
- package/radio/variables.scss +12 -2
- package/rating/rating.scss +4 -0
- package/scrollList/itemFoundation.ts +1 -1
- package/select/foundation.ts +1 -1
- package/sideSheet/sideSheetFoundation.ts +1 -1
- package/table/bodyFoundation.ts +1 -1
- package/table/foundation.ts +1 -1
- package/table/utils.ts +1 -1
- package/tabs/foundation.ts +1 -1
- package/tagInput/foundation.ts +1 -1
- package/tagInput/utils/getSplitedArray.ts +1 -1
- package/timePicker/foundation.ts +1 -1
- package/timePicker/utils/index.ts +1 -1
- package/toast/toastFoundation.ts +1 -1
- package/tooltip/foundation.ts +1 -1
- package/transfer/foundation.ts +1 -1
- package/transfer/transferUtlls.ts +1 -1
- package/tree/foundation.ts +1 -1
- package/tree/treeUtil.ts +2 -2
- package/treeSelect/foundation.ts +1 -1
- package/tsconfig.json +2 -1
- package/utils/classnames.ts +1 -1
- package/utils/getHighlight.ts +1 -1
- package/utils/getMotionObjFromProps.ts +1 -1
- package/utils/log.ts +1 -1
- package/utils/object.ts +1 -1
- package/utils/set.ts +1 -1
- package/babel.config.js +0 -33
- package/icons/icons.scss +0 -39
- package/icons/variables.scss +0 -7
- package/lib/es/icons/icons.css +0 -40
- package/lib/es/icons/icons.scss +0 -39
- package/lib/es/icons/variables.scss +0 -7
|
@@ -0,0 +1,1061 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _filterInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
4
|
+
|
|
5
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
6
|
+
|
|
7
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
8
|
+
|
|
9
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
exports.default = void 0;
|
|
14
|
+
|
|
15
|
+
var _assign2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
16
|
+
|
|
17
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
18
|
+
|
|
19
|
+
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
20
|
+
|
|
21
|
+
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
22
|
+
|
|
23
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
24
|
+
|
|
25
|
+
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
26
|
+
|
|
27
|
+
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
28
|
+
|
|
29
|
+
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
30
|
+
|
|
31
|
+
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
32
|
+
|
|
33
|
+
var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/every"));
|
|
34
|
+
|
|
35
|
+
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
|
36
|
+
|
|
37
|
+
var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort"));
|
|
38
|
+
|
|
39
|
+
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int"));
|
|
40
|
+
|
|
41
|
+
var _includes2 = _interopRequireDefault(require("lodash/includes"));
|
|
42
|
+
|
|
43
|
+
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
|
|
44
|
+
|
|
45
|
+
var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
|
|
46
|
+
|
|
47
|
+
var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
48
|
+
|
|
49
|
+
var _assign3 = _interopRequireDefault(require("lodash/assign"));
|
|
50
|
+
|
|
51
|
+
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
|
|
52
|
+
|
|
53
|
+
var _difference2 = _interopRequireDefault(require("lodash/difference"));
|
|
54
|
+
|
|
55
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
56
|
+
|
|
57
|
+
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
58
|
+
|
|
59
|
+
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
60
|
+
|
|
61
|
+
var _treeUtil = require("../tree/treeUtil");
|
|
62
|
+
|
|
63
|
+
var _util = require("./util");
|
|
64
|
+
|
|
65
|
+
// eslint-disable-next-line max-len
|
|
66
|
+
class CascaderFoundation extends _foundation.default {
|
|
67
|
+
constructor(adapter) {
|
|
68
|
+
var _this;
|
|
69
|
+
|
|
70
|
+
super((0, _assign2.default)({}, adapter));
|
|
71
|
+
_this = this;
|
|
72
|
+
|
|
73
|
+
this.getMergedMotion = () => {
|
|
74
|
+
const {
|
|
75
|
+
motion
|
|
76
|
+
} = this.getProps();
|
|
77
|
+
const {
|
|
78
|
+
isSearching
|
|
79
|
+
} = this.getStates();
|
|
80
|
+
|
|
81
|
+
if (isSearching) {
|
|
82
|
+
const mergedMotion = typeof motion === 'undefined' || motion ? (0, _assign2.default)((0, _assign2.default)({}, motion), {
|
|
83
|
+
didLeave: function () {
|
|
84
|
+
const didLeave = (0, _get2.default)(motion, 'didLeave');
|
|
85
|
+
|
|
86
|
+
if (typeof didLeave === 'function') {
|
|
87
|
+
didLeave(...arguments);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
_this._adapter.updateStates({
|
|
91
|
+
isSearching: false
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}) : false;
|
|
95
|
+
return mergedMotion;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return motion;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
init() {
|
|
103
|
+
const isOpen = this.getProp('open') || this.getProp('defaultOpen');
|
|
104
|
+
this.collectOptions(true);
|
|
105
|
+
|
|
106
|
+
if (isOpen && !this._isDisabled()) {
|
|
107
|
+
this.open();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
destroy() {
|
|
112
|
+
this._adapter.unregisterClickOutsideHandler();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
_isDisabled() {
|
|
116
|
+
return this.getProp('disabled');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
_isFilterable() {
|
|
120
|
+
return Boolean(this.getProp('filterTreeNode')); // filter can be boolean or function
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
_notifyChange(item) {
|
|
124
|
+
const {
|
|
125
|
+
onChangeWithObject,
|
|
126
|
+
multiple
|
|
127
|
+
} = this.getProps();
|
|
128
|
+
const valueProp = onChangeWithObject ? [] : 'value';
|
|
129
|
+
|
|
130
|
+
if (multiple) {
|
|
131
|
+
const valuePath = []; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
132
|
+
// @ts-ignore
|
|
133
|
+
|
|
134
|
+
(0, _forEach.default)(item).call(item, checkedKey => {
|
|
135
|
+
const valuePathItem = this.getItemPropPath(checkedKey, valueProp);
|
|
136
|
+
valuePath.push(valuePathItem);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
this._adapter.notifyChange(valuePath);
|
|
140
|
+
} else {
|
|
141
|
+
const valuePath = (0, _isUndefined2.default)(item) || !('key' in item) ? [] : this.getItemPropPath(item.key, valueProp);
|
|
142
|
+
|
|
143
|
+
this._adapter.notifyChange(valuePath);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
_isLeaf(item) {
|
|
148
|
+
if (this.getProp('loadData')) {
|
|
149
|
+
return Boolean(item.isLeaf);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return !item.children || !item.children.length;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
_clearInput() {
|
|
156
|
+
this._adapter.updateInputValue('');
|
|
157
|
+
} // Scenes that may trigger blur:
|
|
158
|
+
// 1、clickOutSide
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
_notifyBlur(e) {
|
|
162
|
+
this._adapter.notifyBlur(e);
|
|
163
|
+
} // Scenes that may trigger focus:
|
|
164
|
+
// 1、click selection
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
_notifyFocus(e) {
|
|
168
|
+
this._adapter.notifyFocus(e);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
_isOptionDisabled(key, keyEntities) {
|
|
172
|
+
var _context;
|
|
173
|
+
|
|
174
|
+
const isDisabled = (0, _some.default)(_context = (0, _treeUtil.findAncestorKeys)([key], keyEntities, true)).call(_context, item => keyEntities[item].data.disabled);
|
|
175
|
+
return isDisabled;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
getCopyFromState(items) {
|
|
179
|
+
var _context2;
|
|
180
|
+
|
|
181
|
+
const res = {};
|
|
182
|
+
(0, _forEach.default)(_context2 = (0, _util.normalizedArr)(items)).call(_context2, key => {
|
|
183
|
+
res[key] = (0, _cloneDeep2.default)(this.getState(key));
|
|
184
|
+
});
|
|
185
|
+
return res;
|
|
186
|
+
} // prop: is array, return all data
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
getItemPropPath(selectedKey, prop, keyEntities) {
|
|
190
|
+
const searchMap = keyEntities || this.getState('keyEntities');
|
|
191
|
+
const selectedItem = searchMap[selectedKey];
|
|
192
|
+
let path = [];
|
|
193
|
+
|
|
194
|
+
if (!selectedItem) {// do nothing
|
|
195
|
+
} else if (selectedItem._notExist) {
|
|
196
|
+
path = selectedItem.path;
|
|
197
|
+
} else {
|
|
198
|
+
const keyPath = selectedItem.path;
|
|
199
|
+
path = (0, _isArray.default)(prop) ? (0, _map.default)(keyPath).call(keyPath, key => searchMap[key].data) : (0, _map.default)(keyPath).call(keyPath, key => searchMap[key].data[prop]);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return path;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
_getCacheValue(keyEntities) {
|
|
206
|
+
const {
|
|
207
|
+
selectedKeys
|
|
208
|
+
} = this.getStates();
|
|
209
|
+
const selectedKey = (0, _from.default)(selectedKeys)[0];
|
|
210
|
+
let cacheValue;
|
|
211
|
+
/* selectedKeys does not match keyEntities */
|
|
212
|
+
|
|
213
|
+
if ((0, _isEmpty2.default)(keyEntities[selectedKey])) {
|
|
214
|
+
if ((0, _includes2.default)(selectedKey, 'not-exist-')) {
|
|
215
|
+
/* Get the value behind not-exist- */
|
|
216
|
+
// eslint-disable-next-line prefer-destructuring
|
|
217
|
+
const targetValue = selectedKey.match(/not-exist-(\S*)/)[1]; // eslint-disable-next-line max-depth
|
|
218
|
+
|
|
219
|
+
if ((0, _isEmpty2.default)(keyEntities[targetValue])) {
|
|
220
|
+
cacheValue = targetValue;
|
|
221
|
+
} else {
|
|
222
|
+
/**
|
|
223
|
+
* 典型的场景是: 假设我们选中了 0-0 这个节点,此时 selectedKeys=Set('0-0'),
|
|
224
|
+
* 输入框会显示 0-0 的 label。当 treeData 发生更新,假设此时 0-0 在 treeData
|
|
225
|
+
* 中不存在,则 selectedKeys=Set('not-exist-0-0'),此时输入框显示的是 0-0,
|
|
226
|
+
* 也就是显示 not-exist- 后的内容。当treeData再次更新,假设此时 0-0 在 treeData
|
|
227
|
+
* 中存在,则 selectedKeys=Set('0-0'),此时输入框显示 0-0 的 label。 这个地
|
|
228
|
+
* 方做的操作就是,为了例子中第二次更新后 0-0 label 能够正常显示。
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* The typical scenario is: suppose we select the 0-0 node, at this time
|
|
233
|
+
* selectedKeys=Set('0-0'), the input box will display a 0-0 label. When
|
|
234
|
+
* treeData is updated, assuming 0-0 does not exist in treeData at this
|
|
235
|
+
* time, then selectedKeys=Set('not-exist-0-0'), at this time the input
|
|
236
|
+
* box displays 0-0, which means not-exist -After the content. When treeData
|
|
237
|
+
* is updated again, assuming that 0-0 exists in treeData at this time,
|
|
238
|
+
* then selectedKeys=Set('0-0'), and the input box displays a label of
|
|
239
|
+
* 0-0 at this time. The operation done here is for the 0-0 label to be
|
|
240
|
+
* displayed normally after the second update in the example.
|
|
241
|
+
*/
|
|
242
|
+
cacheValue = keyEntities[targetValue].valuePath;
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
cacheValue = selectedKey;
|
|
246
|
+
}
|
|
247
|
+
/* selectedKeys match keyEntities */
|
|
248
|
+
|
|
249
|
+
} else {
|
|
250
|
+
/* selectedKeys match keyEntities */
|
|
251
|
+
cacheValue = keyEntities[selectedKey].valuePath;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return cacheValue;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
collectOptions() {
|
|
258
|
+
let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
259
|
+
const {
|
|
260
|
+
treeData,
|
|
261
|
+
value,
|
|
262
|
+
defaultValue
|
|
263
|
+
} = this.getProps();
|
|
264
|
+
const keyEntities = (0, _util.convertDataToEntities)(treeData);
|
|
265
|
+
|
|
266
|
+
this._adapter.rePositionDropdown();
|
|
267
|
+
|
|
268
|
+
let cacheValue;
|
|
269
|
+
/* when mount */
|
|
270
|
+
|
|
271
|
+
if (init) {
|
|
272
|
+
cacheValue = defaultValue;
|
|
273
|
+
} else if (!(0, _isEmpty2.default)(keyEntities)) {
|
|
274
|
+
cacheValue = this._getCacheValue(keyEntities);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const selectedValue = !this._isControlledComponent() ? cacheValue : value;
|
|
278
|
+
|
|
279
|
+
if ((0, _util.isValid)(selectedValue)) {
|
|
280
|
+
this.updateSelectedKey(selectedValue, keyEntities);
|
|
281
|
+
} else {
|
|
282
|
+
this._adapter.updateStates({
|
|
283
|
+
keyEntities
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
} // call when props.value change
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
handleValueChange(value) {
|
|
290
|
+
const {
|
|
291
|
+
keyEntities
|
|
292
|
+
} = this.getStates();
|
|
293
|
+
const {
|
|
294
|
+
multiple
|
|
295
|
+
} = this.getProps();
|
|
296
|
+
!multiple && this.updateSelectedKey(value, keyEntities);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* When single selection, the clear objects of
|
|
300
|
+
* selectedKeys, activeKeys, filteredKeys, input, etc.
|
|
301
|
+
*/
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
_getClearSelectedKey(filterable) {
|
|
305
|
+
const updateStates = {};
|
|
306
|
+
const {
|
|
307
|
+
searchPlaceholder,
|
|
308
|
+
placeholder,
|
|
309
|
+
multiple
|
|
310
|
+
} = this.getProps();
|
|
311
|
+
updateStates.selectedKeys = new _set.default([]);
|
|
312
|
+
updateStates.activeKeys = new _set.default([]);
|
|
313
|
+
updateStates.filteredKeys = new _set.default([]);
|
|
314
|
+
|
|
315
|
+
if (filterable && !multiple) {
|
|
316
|
+
updateStates.inputPlaceHolder = searchPlaceholder || placeholder || '';
|
|
317
|
+
updateStates.inputValue = '';
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return updateStates;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
updateSelectedKey(value, keyEntities) {
|
|
324
|
+
var _context3, _context4;
|
|
325
|
+
|
|
326
|
+
const {
|
|
327
|
+
changeOnSelect,
|
|
328
|
+
onChangeWithObject,
|
|
329
|
+
multiple
|
|
330
|
+
} = this.getProps();
|
|
331
|
+
const {
|
|
332
|
+
activeKeys,
|
|
333
|
+
loadingKeys,
|
|
334
|
+
loading,
|
|
335
|
+
keyEntities: keyEntitieState,
|
|
336
|
+
selectedKeys: selectedKeysState
|
|
337
|
+
} = this.getStates();
|
|
338
|
+
|
|
339
|
+
const filterable = this._isFilterable();
|
|
340
|
+
|
|
341
|
+
const loadingActive = (0, _filter.default)(_context3 = [...activeKeys]).call(_context3, i => loadingKeys.has(i));
|
|
342
|
+
const valuePath = onChangeWithObject ? (0, _map.default)(_context4 = (0, _util.normalizedArr)(value)).call(_context4, i => i.value) : (0, _util.normalizedArr)(value);
|
|
343
|
+
const selectedKeys = (0, _util.findKeysForValues)(valuePath, keyEntities);
|
|
344
|
+
let updateStates = {};
|
|
345
|
+
|
|
346
|
+
if (selectedKeys.length) {
|
|
347
|
+
const selectedKey = selectedKeys[0];
|
|
348
|
+
const selectedItem = keyEntities[selectedKey];
|
|
349
|
+
/**
|
|
350
|
+
* When changeOnSelect is turned on, or the target option is a leaf option,
|
|
351
|
+
* the option is considered to be selected, even if the option is disabled
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
if (changeOnSelect || this._isLeaf(selectedItem.data)) {
|
|
355
|
+
updateStates.selectedKeys = new _set.default([selectedKey]);
|
|
356
|
+
|
|
357
|
+
if (!loadingActive.length) {
|
|
358
|
+
updateStates.activeKeys = new _set.default(selectedItem.path);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (filterable && !multiple) {
|
|
362
|
+
const displayText = this.renderDisplayText(selectedKey, keyEntities);
|
|
363
|
+
updateStates.inputPlaceHolder = displayText;
|
|
364
|
+
updateStates.inputValue = displayText;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* If selectedKeys does not meet the update conditions,
|
|
368
|
+
* and state.selectedKeys is the same as selectedKeys
|
|
369
|
+
* at this time, state.selectedKeys should be cleared.
|
|
370
|
+
* A typical scenario is:
|
|
371
|
+
* The originally selected node is the leaf node, but
|
|
372
|
+
* after props.treeData is dynamically updated, the node
|
|
373
|
+
* is a non-leaf node. At this point, selectedKeys should
|
|
374
|
+
* be cleared.
|
|
375
|
+
*/
|
|
376
|
+
|
|
377
|
+
} else if ((0, _isEqual2.default)(selectedKeys, (0, _from.default)(selectedKeysState))) {
|
|
378
|
+
updateStates = this._getClearSelectedKey(filterable);
|
|
379
|
+
}
|
|
380
|
+
} else if (value && value.length) {
|
|
381
|
+
const val = valuePath[valuePath.length - 1];
|
|
382
|
+
const key = "not-exist-".concat(val);
|
|
383
|
+
const optionNotExist = {
|
|
384
|
+
data: {
|
|
385
|
+
label: val,
|
|
386
|
+
value: val
|
|
387
|
+
},
|
|
388
|
+
key,
|
|
389
|
+
path: valuePath,
|
|
390
|
+
_notExist: true
|
|
391
|
+
};
|
|
392
|
+
updateStates.selectedKeys = new _set.default([key]);
|
|
393
|
+
|
|
394
|
+
if (filterable && !multiple) {
|
|
395
|
+
const displayText = this._defaultRenderText(valuePath);
|
|
396
|
+
|
|
397
|
+
updateStates.inputPlaceHolder = displayText;
|
|
398
|
+
updateStates.inputValue = displayText;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
keyEntities[key] = optionNotExist; // Fix: 1155, if the data is loaded asynchronously to update treeData, the emptying operation should not be done when entering the updateSelectedKey method
|
|
402
|
+
} else if (loading) {
|
|
403
|
+
// Use assign to avoid overwriting the'not-exist- * 'property of keyEntities after asynchronous loading
|
|
404
|
+
// Overwriting'not-exist- * 'will cause selectionContent to be emptied unexpectedly when clicking on a dropDown item
|
|
405
|
+
updateStates.keyEntities = (0, _assign3.default)(keyEntitieState, keyEntities);
|
|
406
|
+
|
|
407
|
+
this._adapter.updateStates(updateStates);
|
|
408
|
+
|
|
409
|
+
return;
|
|
410
|
+
} else {
|
|
411
|
+
updateStates = this._getClearSelectedKey(filterable);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
updateStates.keyEntities = keyEntities;
|
|
415
|
+
|
|
416
|
+
this._adapter.updateStates(updateStates);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
open() {
|
|
420
|
+
const filterable = this._isFilterable();
|
|
421
|
+
|
|
422
|
+
this._adapter.openMenu();
|
|
423
|
+
|
|
424
|
+
if (filterable) {
|
|
425
|
+
this._clearInput();
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
if (this._isControlledComponent()) {
|
|
429
|
+
this.reCalcActiveKeys();
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
this._adapter.notifyDropdownVisibleChange(true);
|
|
433
|
+
|
|
434
|
+
this._adapter.registerClickOutsideHandler(e => this.close(e));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
reCalcActiveKeys() {
|
|
438
|
+
const {
|
|
439
|
+
selectedKeys,
|
|
440
|
+
activeKeys,
|
|
441
|
+
keyEntities
|
|
442
|
+
} = this.getStates();
|
|
443
|
+
const selectedKey = [...selectedKeys][0];
|
|
444
|
+
const selectedItem = keyEntities[selectedKey];
|
|
445
|
+
|
|
446
|
+
if (!selectedItem) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
const newActiveKeys = new _set.default(selectedItem.path);
|
|
451
|
+
|
|
452
|
+
if (!(0, _isEqual2.default)(newActiveKeys, activeKeys)) {
|
|
453
|
+
this._adapter.updateStates({
|
|
454
|
+
activeKeys: newActiveKeys
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
close(e, key) {
|
|
460
|
+
const {
|
|
461
|
+
multiple
|
|
462
|
+
} = this.getProps();
|
|
463
|
+
|
|
464
|
+
this._adapter.closeMenu();
|
|
465
|
+
|
|
466
|
+
this._adapter.notifyDropdownVisibleChange(false);
|
|
467
|
+
|
|
468
|
+
this._adapter.unregisterClickOutsideHandler();
|
|
469
|
+
|
|
470
|
+
if (this._isFilterable()) {
|
|
471
|
+
const {
|
|
472
|
+
selectedKeys
|
|
473
|
+
} = this.getStates();
|
|
474
|
+
let inputValue = '';
|
|
475
|
+
|
|
476
|
+
if (key && !multiple) {
|
|
477
|
+
inputValue = this.renderDisplayText(key);
|
|
478
|
+
} else if (selectedKeys.size && !multiple) {
|
|
479
|
+
inputValue = this.renderDisplayText([...selectedKeys][0]);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
this._adapter.updateStates({
|
|
483
|
+
inputValue
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
this._notifyBlur(e);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
handleItemClick(e, item) {
|
|
491
|
+
const isDisabled = this._isDisabled();
|
|
492
|
+
|
|
493
|
+
if (isDisabled) {
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
this.handleSingleSelect(e, item);
|
|
498
|
+
|
|
499
|
+
this._adapter.rePositionDropdown();
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
handleItemHover(e, item) {
|
|
503
|
+
const isDisabled = this._isDisabled();
|
|
504
|
+
|
|
505
|
+
if (isDisabled) {
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
this.handleShowNextByHover(item);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
handleShowNextByHover(item) {
|
|
513
|
+
const {
|
|
514
|
+
keyEntities
|
|
515
|
+
} = this.getStates();
|
|
516
|
+
const {
|
|
517
|
+
data,
|
|
518
|
+
key
|
|
519
|
+
} = item;
|
|
520
|
+
|
|
521
|
+
const isLeaf = this._isLeaf(data);
|
|
522
|
+
|
|
523
|
+
const activeKeys = keyEntities[key].path;
|
|
524
|
+
|
|
525
|
+
this._adapter.updateStates({
|
|
526
|
+
activeKeys: new _set.default(activeKeys)
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
if (!isLeaf) {
|
|
530
|
+
this.notifyIfLoadData(item);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
onItemCheckboxClick(item) {
|
|
535
|
+
const isDisabled = this._isDisabled();
|
|
536
|
+
|
|
537
|
+
if (isDisabled) {
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
this._handleMultipleSelect(item);
|
|
542
|
+
|
|
543
|
+
this._adapter.rePositionDropdown();
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
handleClick(e) {
|
|
547
|
+
const isDisabled = this._isDisabled();
|
|
548
|
+
|
|
549
|
+
const isFilterable = this._isFilterable();
|
|
550
|
+
|
|
551
|
+
const {
|
|
552
|
+
isOpen
|
|
553
|
+
} = this.getStates();
|
|
554
|
+
|
|
555
|
+
if (isDisabled) {
|
|
556
|
+
return;
|
|
557
|
+
} else if (!isOpen) {
|
|
558
|
+
this.open();
|
|
559
|
+
|
|
560
|
+
this._notifyFocus(e);
|
|
561
|
+
} else if (isOpen && !isFilterable) {
|
|
562
|
+
this.close(e);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
toggleHoverState(bool) {
|
|
567
|
+
this._adapter.toggleHovering(bool);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
_defaultRenderText(path, displayRender) {
|
|
571
|
+
if (displayRender && typeof displayRender === 'function') {
|
|
572
|
+
return displayRender(path);
|
|
573
|
+
} else {
|
|
574
|
+
return path.join(' / ');
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
renderDisplayText(targetKey, keyEntities) {
|
|
579
|
+
const renderFunc = this.getProp('displayRender');
|
|
580
|
+
const displayProp = this.getProp('displayProp');
|
|
581
|
+
const displayPath = this.getItemPropPath(targetKey, displayProp, keyEntities);
|
|
582
|
+
return this._defaultRenderText(displayPath, renderFunc);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
handleNodeLoad(item) {
|
|
586
|
+
const {
|
|
587
|
+
data,
|
|
588
|
+
key
|
|
589
|
+
} = item;
|
|
590
|
+
const {
|
|
591
|
+
loadedKeys: prevLoadedKeys,
|
|
592
|
+
loadingKeys: prevLoadingKeys
|
|
593
|
+
} = this.getCopyFromState(['loadedKeys', 'loadingKeys']);
|
|
594
|
+
const newLoadedKeys = prevLoadedKeys.add(key);
|
|
595
|
+
const newLoadingKeys = new _set.default([...prevLoadingKeys]);
|
|
596
|
+
newLoadingKeys.delete(key); // onLoad should trigger before internal setState to avoid `loadData` trigger twice.
|
|
597
|
+
|
|
598
|
+
this._adapter.notifyOnLoad(newLoadedKeys, data);
|
|
599
|
+
|
|
600
|
+
this._adapter.updateStates({
|
|
601
|
+
loadingKeys: newLoadingKeys
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
notifyIfLoadData(item) {
|
|
606
|
+
const {
|
|
607
|
+
data,
|
|
608
|
+
key
|
|
609
|
+
} = item;
|
|
610
|
+
|
|
611
|
+
this._adapter.updateStates({
|
|
612
|
+
loading: false
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
if (!data.isLeaf && !data.children && this.getProp('loadData')) {
|
|
616
|
+
var _context5;
|
|
617
|
+
|
|
618
|
+
const {
|
|
619
|
+
loadedKeys,
|
|
620
|
+
loadingKeys
|
|
621
|
+
} = this.getCopyFromState(['loadedKeys', 'loadingKeys']);
|
|
622
|
+
|
|
623
|
+
if (loadedKeys.has(key) || loadingKeys.has(key)) {
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
this._adapter.updateStates({
|
|
628
|
+
loading: true
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
const {
|
|
632
|
+
keyEntities
|
|
633
|
+
} = this.getStates();
|
|
634
|
+
const optionPath = this.getItemPropPath(key, [], keyEntities);
|
|
635
|
+
|
|
636
|
+
this._adapter.updateStates({
|
|
637
|
+
loadingKeys: loadingKeys.add(key)
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
this._adapter.notifyLoadData(optionPath, (0, _bind.default)(_context5 = this.handleNodeLoad).call(_context5, this, item));
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
handleSingleSelect(e, item) {
|
|
645
|
+
const {
|
|
646
|
+
changeOnSelect: allowChange,
|
|
647
|
+
filterLeafOnly,
|
|
648
|
+
multiple
|
|
649
|
+
} = this.getProps();
|
|
650
|
+
const {
|
|
651
|
+
keyEntities,
|
|
652
|
+
selectedKeys,
|
|
653
|
+
isSearching
|
|
654
|
+
} = this.getStates();
|
|
655
|
+
|
|
656
|
+
const filterable = this._isFilterable();
|
|
657
|
+
|
|
658
|
+
const {
|
|
659
|
+
data,
|
|
660
|
+
key
|
|
661
|
+
} = item;
|
|
662
|
+
|
|
663
|
+
const isLeaf = this._isLeaf(data);
|
|
664
|
+
|
|
665
|
+
const activeKeys = keyEntities[key].path;
|
|
666
|
+
const selectedKey = [key];
|
|
667
|
+
const hasChanged = key !== [...selectedKeys][0];
|
|
668
|
+
|
|
669
|
+
if (!isLeaf && !allowChange && !isSearching) {
|
|
670
|
+
this._adapter.updateStates({
|
|
671
|
+
activeKeys: new _set.default(activeKeys)
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
this.notifyIfLoadData(item);
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
if (multiple) {
|
|
679
|
+
this._adapter.updateStates({
|
|
680
|
+
activeKeys: new _set.default(activeKeys)
|
|
681
|
+
});
|
|
682
|
+
} else {
|
|
683
|
+
this._adapter.notifySelect(data.value);
|
|
684
|
+
|
|
685
|
+
if (hasChanged) {
|
|
686
|
+
this._notifyChange(item);
|
|
687
|
+
|
|
688
|
+
this.notifyIfLoadData(item);
|
|
689
|
+
|
|
690
|
+
if (this._isControlledComponent()) {
|
|
691
|
+
this._adapter.updateStates({
|
|
692
|
+
activeKeys: new _set.default(activeKeys)
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
if (isLeaf) {
|
|
696
|
+
this.close(e);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
this._adapter.updateStates({
|
|
703
|
+
activeKeys: new _set.default(activeKeys),
|
|
704
|
+
selectedKeys: new _set.default(selectedKey)
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
const displayText = this.renderDisplayText(key);
|
|
708
|
+
|
|
709
|
+
if (filterable) {
|
|
710
|
+
this._adapter.updateInputPlaceHolder(displayText);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
if (isLeaf) {
|
|
714
|
+
this.close(e, key);
|
|
715
|
+
} else if (!filterLeafOnly && isSearching) {
|
|
716
|
+
this.close(e, key);
|
|
717
|
+
}
|
|
718
|
+
} else {
|
|
719
|
+
this.close(e);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
_handleMultipleSelect(item) {
|
|
725
|
+
const {
|
|
726
|
+
key
|
|
727
|
+
} = item;
|
|
728
|
+
const {
|
|
729
|
+
checkedKeys,
|
|
730
|
+
keyEntities,
|
|
731
|
+
mergedCheckedKeys
|
|
732
|
+
} = this.getStates();
|
|
733
|
+
const {
|
|
734
|
+
autoMergeValue,
|
|
735
|
+
max,
|
|
736
|
+
disableStrictly
|
|
737
|
+
} = this.getProps(); // prev checked status
|
|
738
|
+
|
|
739
|
+
const prevCheckedStatus = checkedKeys.has(key); // next checked status
|
|
740
|
+
|
|
741
|
+
const curCheckedStatus = disableStrictly ? this.calcChekcedStatus(!prevCheckedStatus, key) : !prevCheckedStatus; // calculate all key of nodes that are checked or half checked
|
|
742
|
+
|
|
743
|
+
const {
|
|
744
|
+
checkedKeys: curCheckedKeys,
|
|
745
|
+
halfCheckedKeys: curHalfCheckedKeys
|
|
746
|
+
} = disableStrictly ? this.calcNonDisabedCheckedKeys(key, curCheckedStatus) : this.calcCheckedKeys(key, curCheckedStatus);
|
|
747
|
+
const curMergedCheckedKeys = new _set.default((0, _treeUtil.normalizeKeyList)(curCheckedKeys, keyEntities));
|
|
748
|
+
const curRealCheckedKeys = autoMergeValue ? curMergedCheckedKeys : curCheckedKeys;
|
|
749
|
+
|
|
750
|
+
if ((0, _isNumber2.default)(max)) {
|
|
751
|
+
if (autoMergeValue) {
|
|
752
|
+
// When it exceeds max, the quantity is allowed to be reduced, and no further increase is allowed
|
|
753
|
+
if (mergedCheckedKeys.size < curMergedCheckedKeys.size && curMergedCheckedKeys.size > max) {
|
|
754
|
+
const checkedEntities = [];
|
|
755
|
+
(0, _forEach.default)(curMergedCheckedKeys).call(curMergedCheckedKeys, itemKey => {
|
|
756
|
+
checkedEntities.push(keyEntities[itemKey]);
|
|
757
|
+
});
|
|
758
|
+
|
|
759
|
+
this._adapter.notifyOnExceed(checkedEntities);
|
|
760
|
+
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
} else {
|
|
764
|
+
// When it exceeds max, the quantity is allowed to be reduced, and no further increase is allowed
|
|
765
|
+
if (checkedKeys.size < curCheckedKeys.size && curCheckedKeys.size > max) {
|
|
766
|
+
const checkedEntities = [];
|
|
767
|
+
(0, _forEach.default)(curCheckedKeys).call(curCheckedKeys, itemKey => {
|
|
768
|
+
checkedEntities.push(keyEntities[itemKey]);
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
this._adapter.notifyOnExceed(checkedEntities);
|
|
772
|
+
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
if (!this._isControlledComponent()) {
|
|
779
|
+
this._adapter.updateStates({
|
|
780
|
+
checkedKeys: curCheckedKeys,
|
|
781
|
+
halfCheckedKeys: curHalfCheckedKeys,
|
|
782
|
+
mergedCheckedKeys: curMergedCheckedKeys
|
|
783
|
+
});
|
|
784
|
+
} // The click event during multiple selection will definitely cause the checked state of node to change,
|
|
785
|
+
// so there is no need to judge the value to change.
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
this._notifyChange(curRealCheckedKeys);
|
|
789
|
+
|
|
790
|
+
if (curCheckedStatus) {
|
|
791
|
+
this._notifySelect(curRealCheckedKeys);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
this._adapter.updateStates({
|
|
795
|
+
inputValue: ''
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
calcNonDisabedCheckedKeys(eventKey, targetStatus) {
|
|
800
|
+
const {
|
|
801
|
+
keyEntities,
|
|
802
|
+
disabledKeys
|
|
803
|
+
} = this.getStates();
|
|
804
|
+
const {
|
|
805
|
+
checkedKeys
|
|
806
|
+
} = this.getCopyFromState(['checkedKeys']);
|
|
807
|
+
const descendantKeys = (0, _treeUtil.normalizeKeyList)((0, _treeUtil.findDescendantKeys)([eventKey], keyEntities, false), keyEntities, true);
|
|
808
|
+
const hasDisabled = (0, _some.default)(descendantKeys).call(descendantKeys, key => disabledKeys.has(key));
|
|
809
|
+
|
|
810
|
+
if (!hasDisabled) {
|
|
811
|
+
return this.calcCheckedKeys(eventKey, targetStatus);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
const nonDisabled = (0, _filter.default)(descendantKeys).call(descendantKeys, key => !disabledKeys.has(key));
|
|
815
|
+
const newCheckedKeys = targetStatus ? [...nonDisabled, ...checkedKeys] : (0, _difference2.default)((0, _treeUtil.normalizeKeyList)([...checkedKeys], keyEntities, true), nonDisabled);
|
|
816
|
+
return (0, _treeUtil.calcCheckedKeys)(newCheckedKeys, keyEntities);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
calcChekcedStatus(targetStatus, eventKey) {
|
|
820
|
+
if (!targetStatus) {
|
|
821
|
+
return targetStatus;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
const {
|
|
825
|
+
checkedKeys,
|
|
826
|
+
keyEntities,
|
|
827
|
+
disabledKeys
|
|
828
|
+
} = this.getStates();
|
|
829
|
+
const descendantKeys = (0, _treeUtil.normalizeKeyList)((0, _treeUtil.findDescendantKeys)([eventKey], keyEntities, false), keyEntities, true);
|
|
830
|
+
const hasDisabled = (0, _some.default)(descendantKeys).call(descendantKeys, key => disabledKeys.has(key));
|
|
831
|
+
|
|
832
|
+
if (!hasDisabled) {
|
|
833
|
+
return targetStatus;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
const nonDisabledKeys = (0, _filter.default)(descendantKeys).call(descendantKeys, key => !disabledKeys.has(key));
|
|
837
|
+
const allChecked = (0, _every.default)(nonDisabledKeys).call(nonDisabledKeys, key => checkedKeys.has(key));
|
|
838
|
+
return !allChecked;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
_notifySelect(keys) {
|
|
842
|
+
const {
|
|
843
|
+
keyEntities
|
|
844
|
+
} = this.getStates();
|
|
845
|
+
const values = [];
|
|
846
|
+
(0, _forEach.default)(keys).call(keys, key => {
|
|
847
|
+
if (!(0, _isEmpty2.default)(keyEntities) && !(0, _isEmpty2.default)(keyEntities[key])) {
|
|
848
|
+
const valueItem = keyEntities[key].data.value;
|
|
849
|
+
values.push(valueItem);
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
const formatValue = values.length === 1 ? values[0] : values;
|
|
853
|
+
|
|
854
|
+
this._adapter.notifySelect(formatValue);
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* calculate all key of nodes that are checked or half checked
|
|
858
|
+
* @param {string} key key of node
|
|
859
|
+
* @param {boolean} curCheckedStatus checked status of node
|
|
860
|
+
*/
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
calcCheckedKeys(key, curCheckedStatus) {
|
|
864
|
+
const {
|
|
865
|
+
keyEntities
|
|
866
|
+
} = this.getStates();
|
|
867
|
+
const {
|
|
868
|
+
checkedKeys,
|
|
869
|
+
halfCheckedKeys
|
|
870
|
+
} = this.getCopyFromState(['checkedKeys', 'halfCheckedKeys']);
|
|
871
|
+
return curCheckedStatus ? (0, _treeUtil.calcCheckedKeysForChecked)(key, keyEntities, checkedKeys, halfCheckedKeys) : (0, _treeUtil.calcCheckedKeysForUnchecked)(key, keyEntities, checkedKeys, halfCheckedKeys);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
handleInputChange(sugInput) {
|
|
875
|
+
this._adapter.updateInputValue(sugInput);
|
|
876
|
+
|
|
877
|
+
const {
|
|
878
|
+
keyEntities
|
|
879
|
+
} = this.getStates();
|
|
880
|
+
const {
|
|
881
|
+
treeNodeFilterProp,
|
|
882
|
+
filterTreeNode,
|
|
883
|
+
filterLeafOnly
|
|
884
|
+
} = this.getProps();
|
|
885
|
+
let filteredKeys = [];
|
|
886
|
+
|
|
887
|
+
if (sugInput) {
|
|
888
|
+
var _context6, _context7, _context8;
|
|
889
|
+
|
|
890
|
+
filteredKeys = (0, _map.default)(_context6 = (0, _filter.default)(_context7 = (0, _filter.default)(_context8 = (0, _values.default)(keyEntities)).call(_context8, item => {
|
|
891
|
+
const {
|
|
892
|
+
key,
|
|
893
|
+
_notExist
|
|
894
|
+
} = item;
|
|
895
|
+
|
|
896
|
+
if (_notExist) {
|
|
897
|
+
return false;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
const filteredPath = this.getItemPropPath(key, treeNodeFilterProp).join();
|
|
901
|
+
return (0, _filterInstanceProperty2(_treeUtil))(sugInput, filteredPath, filterTreeNode, false);
|
|
902
|
+
})).call(_context7, item => filterTreeNode && !filterLeafOnly || this._isLeaf(item))).call(_context6, item => item.key);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
this._adapter.updateStates({
|
|
906
|
+
isSearching: Boolean(sugInput),
|
|
907
|
+
filteredKeys: new _set.default(filteredKeys)
|
|
908
|
+
});
|
|
909
|
+
|
|
910
|
+
this._adapter.notifyOnSearch(sugInput);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
handleClear() {
|
|
914
|
+
const {
|
|
915
|
+
isSearching
|
|
916
|
+
} = this.getStates();
|
|
917
|
+
const {
|
|
918
|
+
searchPlaceholder,
|
|
919
|
+
placeholder,
|
|
920
|
+
multiple
|
|
921
|
+
} = this.getProps();
|
|
922
|
+
|
|
923
|
+
const isFilterable = this._isFilterable();
|
|
924
|
+
|
|
925
|
+
const isControlled = this._isControlledComponent();
|
|
926
|
+
|
|
927
|
+
const newState = {};
|
|
928
|
+
|
|
929
|
+
if (multiple) {
|
|
930
|
+
this._adapter.updateInputValue('');
|
|
931
|
+
|
|
932
|
+
this._adapter.notifyOnSearch('');
|
|
933
|
+
|
|
934
|
+
newState.checkedKeys = new _set.default([]);
|
|
935
|
+
newState.halfCheckedKeys = new _set.default([]);
|
|
936
|
+
newState.selectedKeys = new _set.default([]);
|
|
937
|
+
newState.activeKeys = new _set.default([]);
|
|
938
|
+
newState.mergedCheckedKeys = new _set.default([]);
|
|
939
|
+
|
|
940
|
+
this._adapter.notifyChange([]);
|
|
941
|
+
} else {
|
|
942
|
+
// if click clearBtn when not searching, clear selected and active values as well
|
|
943
|
+
if (isFilterable && isSearching) {
|
|
944
|
+
newState.isSearching = false;
|
|
945
|
+
|
|
946
|
+
this._adapter.updateInputValue('');
|
|
947
|
+
|
|
948
|
+
this._adapter.notifyOnSearch('');
|
|
949
|
+
} else {
|
|
950
|
+
if (isFilterable) {
|
|
951
|
+
newState.inputValue = '';
|
|
952
|
+
newState.inputPlaceHolder = searchPlaceholder || placeholder || '';
|
|
953
|
+
|
|
954
|
+
this._adapter.updateInputValue('');
|
|
955
|
+
|
|
956
|
+
this._adapter.notifyOnSearch('');
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
if (!isControlled) {
|
|
960
|
+
newState.selectedKeys = new _set.default([]);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
newState.activeKeys = new _set.default([]);
|
|
964
|
+
newState.filteredKeys = new _set.default([]);
|
|
965
|
+
|
|
966
|
+
this._adapter.notifyChange([]);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
this._adapter.updateStates(newState);
|
|
971
|
+
|
|
972
|
+
this._adapter.notifyClear();
|
|
973
|
+
|
|
974
|
+
this._adapter.rePositionDropdown();
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
getRenderData() {
|
|
978
|
+
var _context9, _context10;
|
|
979
|
+
|
|
980
|
+
const {
|
|
981
|
+
keyEntities,
|
|
982
|
+
isSearching
|
|
983
|
+
} = this.getStates();
|
|
984
|
+
|
|
985
|
+
const isFilterable = this._isFilterable();
|
|
986
|
+
|
|
987
|
+
if (isSearching && isFilterable) {
|
|
988
|
+
return this.getFilteredData();
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
return (0, _sort.default)(_context9 = (0, _filter.default)(_context10 = (0, _values.default)(keyEntities)).call(_context10, item => item.parentKey === null && !item._notExist) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
992
|
+
// @ts-ignore
|
|
993
|
+
).call(_context9, (a, b) => (0, _parseInt2.default)(a.ind, 10) - (0, _parseInt2.default)(b.ind, 10));
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
getFilteredData() {
|
|
997
|
+
const {
|
|
998
|
+
treeNodeFilterProp
|
|
999
|
+
} = this.getProps();
|
|
1000
|
+
const {
|
|
1001
|
+
filteredKeys,
|
|
1002
|
+
keyEntities
|
|
1003
|
+
} = this.getStates();
|
|
1004
|
+
const filteredList = [];
|
|
1005
|
+
const filteredKeyArr = [...filteredKeys];
|
|
1006
|
+
(0, _forEach.default)(filteredKeyArr).call(filteredKeyArr, key => {
|
|
1007
|
+
const item = keyEntities[key];
|
|
1008
|
+
|
|
1009
|
+
if (!item) {
|
|
1010
|
+
return;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
const itemSearchPath = this.getItemPropPath(key, treeNodeFilterProp);
|
|
1014
|
+
|
|
1015
|
+
const isDisabled = this._isOptionDisabled(key, keyEntities);
|
|
1016
|
+
|
|
1017
|
+
filteredList.push({
|
|
1018
|
+
data: item.data,
|
|
1019
|
+
key,
|
|
1020
|
+
disabled: isDisabled,
|
|
1021
|
+
searchText: itemSearchPath
|
|
1022
|
+
});
|
|
1023
|
+
});
|
|
1024
|
+
return filteredList;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
handleListScroll(e, ind) {
|
|
1028
|
+
const {
|
|
1029
|
+
activeKeys,
|
|
1030
|
+
keyEntities
|
|
1031
|
+
} = this.getStates();
|
|
1032
|
+
const lastActiveKey = [...activeKeys][activeKeys.size - 1];
|
|
1033
|
+
const data = lastActiveKey ? (0, _get2.default)(keyEntities, [lastActiveKey, 'data'], null) : null;
|
|
1034
|
+
|
|
1035
|
+
this._adapter.notifyListScroll(e, {
|
|
1036
|
+
panelIndex: ind,
|
|
1037
|
+
activeNode: data
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
handleTagRemove(e, tagValuePath) {
|
|
1042
|
+
var _context11;
|
|
1043
|
+
|
|
1044
|
+
const {
|
|
1045
|
+
keyEntities
|
|
1046
|
+
} = this.getStates();
|
|
1047
|
+
const {
|
|
1048
|
+
disabled
|
|
1049
|
+
} = this.getProps();
|
|
1050
|
+
|
|
1051
|
+
if (disabled) {
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
const removedItem = (0, _filter.default)(_context11 = (0, _values.default)(keyEntities)).call(_context11, item => (0, _isEqual2.default)(item.valuePath, tagValuePath))[0];
|
|
1056
|
+
!(0, _isEmpty2.default)(removedItem) && !removedItem.data.disabled && this._handleMultipleSelect(removedItem);
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
exports.default = CascaderFoundation;
|