@douyinfe/semi-foundation 2.1.1 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +15 -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 +56 -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 +87 -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 +11 -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/modal/modal.css +1 -1
- package/lib/es/modal/modalFoundation.d.ts +2 -2
- package/lib/es/modal/variables.scss +1 -1
- 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/sideSheet.css +1 -1
- package/lib/es/sideSheet/sideSheetFoundation.js +8 -7
- package/lib/es/sideSheet/variables.scss +1 -1
- package/lib/es/table/bodyFoundation.js +14 -8
- package/lib/es/table/foundation.js +87 -67
- package/lib/es/table/table.css +2 -2
- package/lib/es/table/table.scss +2 -2
- package/lib/es/table/utils.js +65 -42
- package/lib/es/table/variables.scss +3 -0
- 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/upload/upload.css +1 -1
- package/lib/es/upload/variables.scss +1 -1
- 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/modal/modalFoundation.ts +2 -2
- package/modal/variables.scss +1 -1
- 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/sideSheet/variables.scss +1 -1
- package/table/bodyFoundation.ts +1 -1
- package/table/foundation.ts +1 -1
- package/table/table.scss +2 -2
- package/table/utils.ts +1 -1
- package/table/variables.scss +3 -0
- 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/upload/variables.scss +1 -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,1167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
exports.default = void 0;
|
|
12
|
+
|
|
13
|
+
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
+
|
|
15
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
16
|
+
|
|
17
|
+
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
18
|
+
|
|
19
|
+
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/keys"));
|
|
20
|
+
|
|
21
|
+
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
22
|
+
|
|
23
|
+
var _filter2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
24
|
+
|
|
25
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map"));
|
|
26
|
+
|
|
27
|
+
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
28
|
+
|
|
29
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
30
|
+
|
|
31
|
+
var _map2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
32
|
+
|
|
33
|
+
var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort"));
|
|
34
|
+
|
|
35
|
+
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
|
|
36
|
+
|
|
37
|
+
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
38
|
+
|
|
39
|
+
var _find2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
40
|
+
|
|
41
|
+
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
42
|
+
|
|
43
|
+
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice"));
|
|
44
|
+
|
|
45
|
+
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
46
|
+
|
|
47
|
+
var _slice2 = _interopRequireDefault(require("lodash/slice"));
|
|
48
|
+
|
|
49
|
+
var _isMap2 = _interopRequireDefault(require("lodash/isMap"));
|
|
50
|
+
|
|
51
|
+
var _filter3 = _interopRequireDefault(require("lodash/filter"));
|
|
52
|
+
|
|
53
|
+
var _isSet2 = _interopRequireDefault(require("lodash/isSet"));
|
|
54
|
+
|
|
55
|
+
var _pull2 = _interopRequireDefault(require("lodash/pull"));
|
|
56
|
+
|
|
57
|
+
var _some2 = _interopRequireDefault(require("lodash/some"));
|
|
58
|
+
|
|
59
|
+
var _find3 = _interopRequireDefault(require("lodash/find"));
|
|
60
|
+
|
|
61
|
+
var _each2 = _interopRequireDefault(require("lodash/each"));
|
|
62
|
+
|
|
63
|
+
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
64
|
+
|
|
65
|
+
var _merge2 = _interopRequireDefault(require("lodash/merge"));
|
|
66
|
+
|
|
67
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
68
|
+
|
|
69
|
+
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
70
|
+
|
|
71
|
+
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
72
|
+
|
|
73
|
+
var _constants = require("./constants");
|
|
74
|
+
|
|
75
|
+
var _utils = require("./utils");
|
|
76
|
+
|
|
77
|
+
var _array = require("../utils/array");
|
|
78
|
+
|
|
79
|
+
class TableFoundation extends _foundation.default {
|
|
80
|
+
constructor(adapter) {
|
|
81
|
+
super((0, _assign.default)({}, adapter));
|
|
82
|
+
/**
|
|
83
|
+
* set page number
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
this.setPage = (currentPage, currentPageSize) => {
|
|
87
|
+
currentPage = currentPage || this._adapter.getCurrentPage();
|
|
88
|
+
const currentPagination = this.getState('pagination');
|
|
89
|
+
const {
|
|
90
|
+
dataSource,
|
|
91
|
+
pagination,
|
|
92
|
+
disabledRowKeys,
|
|
93
|
+
allRowKeys
|
|
94
|
+
} = this.getCurrentPageData(null, (0, _assign.default)((0, _assign.default)({}, currentPagination), {
|
|
95
|
+
currentPage,
|
|
96
|
+
pageSize: currentPageSize
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
if (!this._pagerIsControlled() && currentPage > 0) {
|
|
100
|
+
this._adapter.setDisabledRowKeys(disabledRowKeys);
|
|
101
|
+
|
|
102
|
+
this._adapter.setAllRowKeys(allRowKeys);
|
|
103
|
+
|
|
104
|
+
this._adapter.setPagination(pagination);
|
|
105
|
+
|
|
106
|
+
this._adapter.setDataSource(dataSource);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
this._notifyChange(pagination);
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Cache related data when initializing or updating the calculated dataSource
|
|
113
|
+
* @param {*} filteredSortedDataSource
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
this.setCachedFilteredSortedDataSource = filteredSortedDataSource => {
|
|
118
|
+
this._adapter.setCachedFilteredSortedDataSource(filteredSortedDataSource);
|
|
119
|
+
|
|
120
|
+
const filteredSortedRowKeys = this.getAllRowKeys(filteredSortedDataSource);
|
|
121
|
+
|
|
122
|
+
this._adapter.setCachedFilteredSortedRowKeys(filteredSortedRowKeys);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
this.isSortOrderValid = sortOrder => {
|
|
126
|
+
var _context;
|
|
127
|
+
|
|
128
|
+
return (0, _includes.default)(_context = _constants.strings.SORT_DIRECTIONS).call(_context, sortOrder) || sortOrder === false;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* memoized function list
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
const handleColumns = this._adapter.getHandleColumns();
|
|
136
|
+
|
|
137
|
+
const mergePagination = this._adapter.getMergePagination();
|
|
138
|
+
|
|
139
|
+
this.memoizedWithFnsColumns = (0, _memoizeOne.default)(handleColumns, _isEqual2.default);
|
|
140
|
+
this.memoizedFilterColumns = (0, _memoizeOne.default)(_utils.filterColumns);
|
|
141
|
+
this.memoizedFlattenFnsColumns = (0, _memoizeOne.default)(_utils.flattenColumns);
|
|
142
|
+
this.memoizedPagination = (0, _memoizeOne.default)(mergePagination, _isEqual2.default);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
init() {
|
|
146
|
+
const dataSource = [...this.getProp('dataSource')];
|
|
147
|
+
|
|
148
|
+
const {
|
|
149
|
+
queries
|
|
150
|
+
} = this._adapter.getStates();
|
|
151
|
+
|
|
152
|
+
const filteredSortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
|
|
153
|
+
const pageData = this.getCurrentPageData(filteredSortedDataSource);
|
|
154
|
+
this.setAdapterPageData(pageData);
|
|
155
|
+
this.initExpandedRowKeys(pageData);
|
|
156
|
+
this.initSelectedRowKeys(pageData); // cache dataSource after mount, and then calculate it on demand
|
|
157
|
+
|
|
158
|
+
this.setCachedFilteredSortedDataSource(filteredSortedDataSource);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
initExpandedRowKeys() {
|
|
162
|
+
let {
|
|
163
|
+
groups
|
|
164
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
165
|
+
const {
|
|
166
|
+
defaultExpandAllRows,
|
|
167
|
+
defaultExpandedRowKeys = [],
|
|
168
|
+
expandedRowKeys: propExpandedRowKeys = [],
|
|
169
|
+
dataSource = [],
|
|
170
|
+
expandAllRows,
|
|
171
|
+
defaultExpandAllGroupRows,
|
|
172
|
+
expandAllGroupRows
|
|
173
|
+
} = this.getProps();
|
|
174
|
+
const expandedRowKeys = [];
|
|
175
|
+
|
|
176
|
+
if (defaultExpandAllRows || expandAllRows) {
|
|
177
|
+
this._addNoDuplicatedItemsToArr(expandedRowKeys, this.getAllRowKeys(dataSource), groups && (0, _isMap2.default)(groups) && groups.size ? (0, _from.default)((0, _keys.default)(groups).call(groups)) : []);
|
|
178
|
+
} else if (defaultExpandAllGroupRows || expandAllGroupRows) {
|
|
179
|
+
this._addNoDuplicatedItemsToArr(expandedRowKeys, groups && (0, _isMap2.default)(groups) && groups.size ? (0, _from.default)((0, _keys.default)(groups).call(groups)) : []);
|
|
180
|
+
} else if ((0, _isArray.default)(defaultExpandedRowKeys) && defaultExpandedRowKeys.length) {
|
|
181
|
+
this._addNoDuplicatedItemsToArr(expandedRowKeys, defaultExpandedRowKeys);
|
|
182
|
+
} else if ((0, _isArray.default)(propExpandedRowKeys) && propExpandedRowKeys.length) {
|
|
183
|
+
this._addNoDuplicatedItemsToArr(expandedRowKeys, propExpandedRowKeys);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
this._adapter.setExpandedRowKeys(expandedRowKeys);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
initSelectedRowKeys(_ref) {
|
|
190
|
+
let {
|
|
191
|
+
disabledRowKeys
|
|
192
|
+
} = _ref;
|
|
193
|
+
const rowSelection = this.getProp('rowSelection');
|
|
194
|
+
const rowKeys = [];
|
|
195
|
+
|
|
196
|
+
if (rowSelection) {
|
|
197
|
+
const selectedRowKeys = (0, _get2.default)(rowSelection, 'selectedRowKeys');
|
|
198
|
+
const defaultSelectedRowKeys = (0, _get2.default)(rowSelection, 'defaultSelectedRowKeys');
|
|
199
|
+
|
|
200
|
+
if ((0, _isArray.default)(selectedRowKeys)) {
|
|
201
|
+
this._addNoDuplicatedItemsToArr(rowKeys, selectedRowKeys);
|
|
202
|
+
} else if ((0, _isArray.default)(defaultSelectedRowKeys)) {
|
|
203
|
+
this._addNoDuplicatedItemsToArr(rowKeys, defaultSelectedRowKeys);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if ((0, _isArray.default)(disabledRowKeys) && disabledRowKeys.length) {
|
|
207
|
+
(0, _pull2.default)(rowKeys, ...disabledRowKeys);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
this._adapter.setSelectedRowKeys(rowKeys);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Get filtered and sorted data
|
|
215
|
+
* @param {Object[]} dataSource
|
|
216
|
+
* @param {Object[]} queries
|
|
217
|
+
* @returns {Object[]} sortedDataSource
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
getFilteredSortedDataSource(dataSource, queries) {
|
|
222
|
+
const filteredDataSource = this.filterDataSource(dataSource, (0, _filter2.default)(queries).call(queries, query => (0, _isFunction2.default)(query.onFilter) && (0, _isArray.default)(query.filters) && query.filters.length && (0, _isArray.default)(query.filteredValue) && query.filteredValue.length));
|
|
223
|
+
const sortedDataSource = this.sortDataSource(filteredDataSource, (0, _filter2.default)(queries).call(queries, query => query && (0, _isFunction2.default)(query.sorter)));
|
|
224
|
+
return sortedDataSource;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* get current page data
|
|
228
|
+
*
|
|
229
|
+
* @param {Array} dataSource
|
|
230
|
+
* @param {object} pagination
|
|
231
|
+
* @param {object} queries
|
|
232
|
+
* @returns {{dataSource: RecordType[], groups: Map<string, Set<string>>, pagination: object, disabledRowKeys: string[], queries: BaseColumnProps[], allRowKeys: string[]}}
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
getCurrentPageData(dataSource, pagination, queries) {
|
|
237
|
+
const filteredSortedDataSource = this._adapter.getCachedFilteredSortedDataSource();
|
|
238
|
+
|
|
239
|
+
dataSource = dataSource == null ? [...filteredSortedDataSource] : dataSource;
|
|
240
|
+
pagination = pagination == null ? this.getState('pagination') && (0, _assign.default)({}, this.getState('pagination')) : pagination;
|
|
241
|
+
queries = queries == null ? [...this.getState('queries')] : queries;
|
|
242
|
+
let groups;
|
|
243
|
+
|
|
244
|
+
if (this.getProp('groupBy') != null) {
|
|
245
|
+
const {
|
|
246
|
+
groups: groupedGroups,
|
|
247
|
+
dataSource: groupedData
|
|
248
|
+
} = this.groupDataSource(dataSource);
|
|
249
|
+
dataSource = groupedData;
|
|
250
|
+
groups = groupedGroups;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
pagination = this.normalizePagination(pagination, dataSource);
|
|
254
|
+
dataSource = this.limitPageDataSource(dataSource, pagination);
|
|
255
|
+
const disabledRowKeys = this.getAllDisabledRowKeys(dataSource);
|
|
256
|
+
const allRowKeys = this.getAllRowKeys(dataSource);
|
|
257
|
+
const pageData = {
|
|
258
|
+
dataSource,
|
|
259
|
+
groups,
|
|
260
|
+
pagination,
|
|
261
|
+
disabledRowKeys,
|
|
262
|
+
allRowKeys,
|
|
263
|
+
queries
|
|
264
|
+
};
|
|
265
|
+
return pageData;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* group dataSource, return grouped row keys
|
|
269
|
+
*
|
|
270
|
+
* @param {*[]} dataSource
|
|
271
|
+
* @param {Function|string} groupBy
|
|
272
|
+
*/
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
groupDataSource(dataSource, groupBy) {
|
|
276
|
+
groupBy = groupBy == null ? this.getProp('groupBy') : groupBy;
|
|
277
|
+
const groups = new _map.default();
|
|
278
|
+
const newDataSource = [];
|
|
279
|
+
|
|
280
|
+
if (groupBy != null) {
|
|
281
|
+
(0, _each2.default)(dataSource, (record, index) => {
|
|
282
|
+
const groupKey = typeof groupBy === 'function' ? groupBy(record) : (0, _get2.default)(record, groupBy);
|
|
283
|
+
|
|
284
|
+
if (groupKey != null && groupKey !== '') {
|
|
285
|
+
const recordKey = this.getRecordKey(record);
|
|
286
|
+
let group = groups.get(groupKey);
|
|
287
|
+
|
|
288
|
+
if (!(0, _isSet2.default)(group)) {
|
|
289
|
+
group = new _set.default([recordKey]);
|
|
290
|
+
groups.set(groupKey, group);
|
|
291
|
+
} else {
|
|
292
|
+
group.add(recordKey);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (groups && groups.size) {
|
|
299
|
+
(0, _forEach.default)(groups).call(groups, (set, key) => {
|
|
300
|
+
if ((0, _isSet2.default)(set)) {
|
|
301
|
+
(0, _forEach.default)(set).call(set, realKey => {
|
|
302
|
+
newDataSource.push(this._getRecord(realKey));
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
} else {
|
|
307
|
+
newDataSource.push(...dataSource);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return {
|
|
311
|
+
groups,
|
|
312
|
+
dataSource: newDataSource
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* sort data
|
|
317
|
+
*
|
|
318
|
+
* @param {Array} dataSource
|
|
319
|
+
* @param {Array} sorters
|
|
320
|
+
* @returns {Array}
|
|
321
|
+
*/
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
sortDataSource(dataSource, sorters) {
|
|
325
|
+
(0, _each2.default)(sorters, sorterObj => {
|
|
326
|
+
var _context2;
|
|
327
|
+
|
|
328
|
+
// const sorterObj = last(sorters) || {};
|
|
329
|
+
const {
|
|
330
|
+
sorter,
|
|
331
|
+
sortOrder,
|
|
332
|
+
defaultSortOrder,
|
|
333
|
+
sortChildrenRecord
|
|
334
|
+
} = sorterObj;
|
|
335
|
+
const currentSortOrder = this.isSortOrderValid(sortOrder) ? sortOrder : defaultSortOrder;
|
|
336
|
+
|
|
337
|
+
if ((0, _isFunction2.default)(sorter) && currentSortOrder && (0, _includes.default)(_context2 = _constants.strings.SORT_DIRECTIONS).call(_context2, currentSortOrder)) {
|
|
338
|
+
if (sortChildrenRecord) {
|
|
339
|
+
const childrenRecordName = this.getProp('childrenRecordName');
|
|
340
|
+
dataSource = dataSource && (0, _map2.default)(dataSource).call(dataSource, record => {
|
|
341
|
+
const children = this._getRecordChildren(record);
|
|
342
|
+
|
|
343
|
+
if ((0, _isArray.default)(children) && children.length) {
|
|
344
|
+
return (0, _assign.default)((0, _assign.default)({}, record), {
|
|
345
|
+
[childrenRecordName]: this.sortDataSource(children, [sorterObj])
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return record;
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
(0, _sort.default)(dataSource).call(dataSource, (0, _array.withOrderSort)(sorter, currentSortOrder));
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return undefined;
|
|
358
|
+
});
|
|
359
|
+
return dataSource;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* filter data source
|
|
363
|
+
*
|
|
364
|
+
* @param {*[]} dataSource
|
|
365
|
+
* @param {*[]} filters
|
|
366
|
+
* @returns {*[]}
|
|
367
|
+
*/
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
filterDataSource(dataSource, filters) {
|
|
371
|
+
let filteredData = null;
|
|
372
|
+
let hasValidFilters = false;
|
|
373
|
+
const childrenRecordName = this.getProp('childrenRecordName');
|
|
374
|
+
(0, _each2.default)(filters, filterObj => {
|
|
375
|
+
const {
|
|
376
|
+
onFilter,
|
|
377
|
+
filteredValue,
|
|
378
|
+
filterChildrenRecord
|
|
379
|
+
} = filterObj;
|
|
380
|
+
|
|
381
|
+
if (typeof onFilter === 'function' && (0, _isArray.default)(filteredValue) && filteredValue.length) {
|
|
382
|
+
hasValidFilters = true;
|
|
383
|
+
|
|
384
|
+
if (filteredData === null) {
|
|
385
|
+
filteredData = new _map.default();
|
|
386
|
+
} else {
|
|
387
|
+
dataSource = (0, _from.default)(filteredData && (0, _values.default)(filteredData).call(filteredData));
|
|
388
|
+
filteredData = new _map.default();
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
(0, _each2.default)(filteredValue, value => {
|
|
392
|
+
(0, _each2.default)(dataSource, record => {
|
|
393
|
+
const childrenRecords = (0, _get2.default)(record, childrenRecordName);
|
|
394
|
+
const recordKey = this.getRecordKey(record);
|
|
395
|
+
let filteredChildren;
|
|
396
|
+
|
|
397
|
+
if ((0, _isArray.default)(childrenRecords) && childrenRecords.length && filterChildrenRecord) {
|
|
398
|
+
filteredChildren = this.filterDataSource(childrenRecords, [filterObj]);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if ((0, _isArray.default)(filteredChildren) && filteredChildren.length) {
|
|
402
|
+
if (recordKey != null) {
|
|
403
|
+
const children = (0, _get2.default)(filteredData.get(recordKey), childrenRecordName, []);
|
|
404
|
+
filteredData.set(recordKey, (0, _assign.default)((0, _assign.default)({}, record), {
|
|
405
|
+
[childrenRecordName]: (0, _reduce.default)(filteredChildren).call(filteredChildren, (arr, cur) => {
|
|
406
|
+
if ((0, _find2.default)(arr).call(arr, item => this.getRecordKey(item) === this.getRecordKey(cur)) == null) {
|
|
407
|
+
arr.push(cur);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
return arr;
|
|
411
|
+
}, [...children])
|
|
412
|
+
}));
|
|
413
|
+
}
|
|
414
|
+
} else if (onFilter(value, record)) {
|
|
415
|
+
filteredData.set(recordKey, record);
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
if (hasValidFilters) {
|
|
423
|
+
dataSource = (0, _from.default)(filteredData && (0, _values.default)(filteredData).call(filteredData));
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
return dataSource;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
limitPageDataSource(dataSource, pagination) {
|
|
430
|
+
dataSource = dataSource == null ? this.getProp('dataSource') : dataSource;
|
|
431
|
+
pagination = pagination == null ? this.getState('pagination') : pagination;
|
|
432
|
+
let pageData = dataSource;
|
|
433
|
+
const pageNo = (0, _get2.default)(pagination, 'currentPage');
|
|
434
|
+
|
|
435
|
+
if (this.getProp('pagination') !== false && pageNo && dataSource && pagination && !this._pagerIsControlled()) {
|
|
436
|
+
const {
|
|
437
|
+
pageSize = _constants.numbers.DEFAULT_PAGE_SIZE
|
|
438
|
+
} = pagination;
|
|
439
|
+
const start = (pageNo - 1) * pageSize;
|
|
440
|
+
const end = pageNo * pageSize;
|
|
441
|
+
pageData = (0, _slice2.default)(dataSource, start, end);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
return pageData;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
normalizePagination(pagination, dataSource) {
|
|
448
|
+
pagination = pagination == null ? this._getPagination() : pagination;
|
|
449
|
+
dataSource = dataSource == null ? this._getDataSource() : dataSource;
|
|
450
|
+
const propPagination = this.getProp('pagination');
|
|
451
|
+
|
|
452
|
+
if (pagination) {
|
|
453
|
+
pagination = typeof pagination === 'object' ? (0, _assign.default)({}, pagination) : {};
|
|
454
|
+
pagination = (0, _merge2.default)({
|
|
455
|
+
total: dataSource && dataSource.length || 0,
|
|
456
|
+
pageSize: _constants.numbers.DEFAULT_PAGE_SIZE,
|
|
457
|
+
currentPage: (0, _get2.default)(propPagination, 'defaultCurrentPage', 1),
|
|
458
|
+
position: _constants.strings.PAGINATION_POSITIONS[0]
|
|
459
|
+
}, pagination);
|
|
460
|
+
|
|
461
|
+
if (!this._pagerIsControlled()) {
|
|
462
|
+
const total = (0, _get2.default)(propPagination, 'total', dataSource.length);
|
|
463
|
+
const pageSize = (0, _get2.default)(propPagination, 'pageSize', pagination.pageSize);
|
|
464
|
+
const {
|
|
465
|
+
currentPage
|
|
466
|
+
} = pagination;
|
|
467
|
+
const realTotalPage = Math.ceil(total / pageSize);
|
|
468
|
+
pagination.total = total;
|
|
469
|
+
|
|
470
|
+
if (currentPage > realTotalPage) {
|
|
471
|
+
pagination.currentPage = 1;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
return pagination;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
setAdapterPageData() {
|
|
480
|
+
let pageData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
481
|
+
const {
|
|
482
|
+
pagination,
|
|
483
|
+
dataSource,
|
|
484
|
+
disabledRowKeys,
|
|
485
|
+
allRowKeys,
|
|
486
|
+
groups
|
|
487
|
+
} = pageData;
|
|
488
|
+
|
|
489
|
+
this._adapter.setDisabledRowKeys(disabledRowKeys);
|
|
490
|
+
|
|
491
|
+
this._adapter.setAllRowKeys(allRowKeys);
|
|
492
|
+
|
|
493
|
+
this._adapter.setPagination(pagination);
|
|
494
|
+
|
|
495
|
+
this._adapter.setGroups(groups);
|
|
496
|
+
|
|
497
|
+
this._adapter.setDataSource(dataSource);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
destroy() {}
|
|
501
|
+
|
|
502
|
+
handleClick(e) {}
|
|
503
|
+
|
|
504
|
+
handleMouseEnter(e) {}
|
|
505
|
+
|
|
506
|
+
handleMouseLeave(e) {}
|
|
507
|
+
|
|
508
|
+
stopPropagation(e) {
|
|
509
|
+
if (e && typeof e === 'object') {
|
|
510
|
+
if (typeof e.stopPropagation === 'function') {
|
|
511
|
+
e.stopPropagation();
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if (e.nativeEvent && typeof e.nativeEvent.stopPropagation === 'function') {
|
|
515
|
+
e.nativeEvent.stopPropagation();
|
|
516
|
+
} else if (typeof e.stopImmediatePropagation === 'function') {
|
|
517
|
+
e.stopImmediatePropagation();
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Add non-repeating elements to the array itself
|
|
523
|
+
* @param {Array} srcArr
|
|
524
|
+
* @param {Object} objArrs
|
|
525
|
+
*/
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
_addNoDuplicatedItemsToArr() {
|
|
529
|
+
let srcArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
530
|
+
|
|
531
|
+
for (var _len = arguments.length, objArrs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
532
|
+
objArrs[_key - 1] = arguments[_key];
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
for (const objArr of objArrs) {
|
|
536
|
+
if ((0, _isArray.default)(objArr)) {
|
|
537
|
+
for (const item of objArr) {
|
|
538
|
+
if (!(0, _includes.default)(srcArr).call(srcArr, item)) {
|
|
539
|
+
srcArr.push(item);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return srcArr;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
_notifyChange(pagination, filters, sorter, extra) {
|
|
549
|
+
pagination = pagination == null ? this._getPagination() : pagination;
|
|
550
|
+
filters = filters == null ? this._getAllFilters() : filters;
|
|
551
|
+
sorter = sorter == null ? this._getAllSorters()[0] : sorter;
|
|
552
|
+
|
|
553
|
+
if ((0, _get2.default)(this.getProp('scroll'), 'scrollToFirstRowOnChange')) {
|
|
554
|
+
this._adapter.resetScrollY();
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
this._adapter.notifyChange({
|
|
558
|
+
pagination: (0, _assign.default)({}, pagination),
|
|
559
|
+
filters: [...filters],
|
|
560
|
+
sorter,
|
|
561
|
+
extra: (0, _assign.default)({}, extra)
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
_rowExpansionIsControlled() {
|
|
566
|
+
return (0, _isArray.default)(this.getProp('expandedRowKeys'));
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
_pagerIsControlled() {
|
|
570
|
+
return (0, _get2.default)(this.getProp('pagination'), 'currentPage') != null;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
_selectionIsControlled() {
|
|
574
|
+
return (0, _isArray.default)((0, _get2.default)(this.getProp('rowSelection'), 'selectedRowKeys'));
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Determine whether the column sorting is controlled
|
|
578
|
+
* Controlled: the column passed the sortOrder prop
|
|
579
|
+
* @param {String} dataIndex
|
|
580
|
+
* @returns {Boolean}
|
|
581
|
+
*/
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
_sorterIsControlled(dataIndex) {
|
|
585
|
+
// The basis for judgment should be props columns instead of cachedColumns fix#1141
|
|
586
|
+
const query = dataIndex && this.getQuery(dataIndex, this.getState('flattenColumns'));
|
|
587
|
+
return Boolean(query && query.sortOrder != null);
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Determine whether the column is filtered and controlled
|
|
591
|
+
* Controlled: the column passed the filteredValue prop
|
|
592
|
+
* @param {String} dataIndex
|
|
593
|
+
* @returns {Boolean}
|
|
594
|
+
*/
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
_filterIsControlled(dataIndex) {
|
|
598
|
+
const query = dataIndex && this.getQuery(dataIndex, this.getState('flattenColumns'));
|
|
599
|
+
return Boolean(query && (0, _isArray.default)(query.filteredValue));
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
_filterShowIsControlled(dataIndex) {
|
|
603
|
+
const query = dataIndex && this.getQuery(dataIndex, this.getState('flattenColumns'));
|
|
604
|
+
return Boolean(query && (query.filterDropdownVisible === true || query.filterDropdownVisible === false));
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
_getSelectedRowKeys() {
|
|
608
|
+
const rowSelection = this.getState('rowSelection');
|
|
609
|
+
const selectedRowKeys = (0, _get2.default)(rowSelection, 'selectedRowKeys', []);
|
|
610
|
+
return [...selectedRowKeys];
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
_getSelectedRowKeysSet() {
|
|
614
|
+
const rowSelection = this.getState('rowSelection');
|
|
615
|
+
const selectedRowKeysSet = (0, _get2.default)(rowSelection, 'selectedRowKeysSet', new _set.default());
|
|
616
|
+
return selectedRowKeysSet;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
_getDataSource() {
|
|
620
|
+
return this.getProp('dataSource') || [];
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
_getRecord(realKey) {
|
|
624
|
+
return (0, _find3.default)(this.getProp('dataSource'), record => realKey != null && realKey !== '' && this.getRecordKey(record) === realKey);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
_getRecordChildren(record) {
|
|
628
|
+
return (0, _get2.default)(record, this.getProp('childrenRecordName'));
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
_getPagination() {
|
|
632
|
+
return this.getState('pagination') || {};
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
_getAllFilters(queries) {
|
|
636
|
+
queries = queries || this.getState('queries');
|
|
637
|
+
const filters = [];
|
|
638
|
+
(0, _each2.default)(queries, query => {
|
|
639
|
+
if ((0, _isArray.default)(query.filteredValue) && (query.filteredValue.length || this._filterIsControlled(query.dataIndex))) {
|
|
640
|
+
filters.push(query);
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
return filters;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
_getAllSorters(queries) {
|
|
647
|
+
queries = queries || this.getState('queries');
|
|
648
|
+
return (0, _filter3.default)(queries, query => query.sorter && query.sortOrder);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
_filterQueries(targetQuery, queries) {
|
|
652
|
+
let keys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['dataIndex'];
|
|
653
|
+
queries = queries == null ? this.getState('queries') : queries;
|
|
654
|
+
const filteredQueries = [];
|
|
655
|
+
const filteredIndexes = [];
|
|
656
|
+
(0, _each2.default)(queries, (itQuery, index) => {
|
|
657
|
+
const flag = (0, _some2.default)(keys, k => k && targetQuery[k] != null && targetQuery[k] === itQuery[k]);
|
|
658
|
+
|
|
659
|
+
if (flag) {
|
|
660
|
+
filteredQueries.push(itQuery);
|
|
661
|
+
filteredIndexes.push(index);
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
return {
|
|
665
|
+
filteredQueries,
|
|
666
|
+
filteredIndexes
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
_mergeToQueries(query, queries) {
|
|
671
|
+
let keys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['dataIndex'];
|
|
672
|
+
queries = queries == null ? this.getState('queries') : queries;
|
|
673
|
+
queries = [...queries];
|
|
674
|
+
query = (0, _assign.default)({}, query);
|
|
675
|
+
|
|
676
|
+
const {
|
|
677
|
+
filteredQueries,
|
|
678
|
+
filteredIndexes
|
|
679
|
+
} = this._filterQueries(query, queries, keys);
|
|
680
|
+
|
|
681
|
+
(0, _each2.default)(filteredQueries, (curQuery, idx) => {
|
|
682
|
+
// assign(curQuery, query);
|
|
683
|
+
queries[filteredIndexes[idx]] = (0, _assign.default)({}, query);
|
|
684
|
+
});
|
|
685
|
+
return queries;
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* get record real key
|
|
689
|
+
* @param {RecordType} record
|
|
690
|
+
* @returns {string}
|
|
691
|
+
*/
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
getRecordKey(record) {
|
|
695
|
+
if (!record) {
|
|
696
|
+
return undefined;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
const rowKey = this.getProp('rowKey');
|
|
700
|
+
return typeof rowKey === 'function' ? rowKey(record) : (0, _get2.default)(record, rowKey);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
isEmpty(dataSource) {
|
|
704
|
+
dataSource = dataSource == null ? this.getProp('dataSource') : dataSource;
|
|
705
|
+
return !((0, _isArray.default)(dataSource) && dataSource.length > 0);
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
handleSelectRow(realKey, selected, e) {
|
|
709
|
+
this.stopPropagation(e);
|
|
710
|
+
|
|
711
|
+
if (typeof selected === 'boolean' && realKey != null) {
|
|
712
|
+
const selectedRowKeys = this._getSelectedRowKeys();
|
|
713
|
+
|
|
714
|
+
let foundIdx = -1;
|
|
715
|
+
const selectedRow = this.getSelectedRows(null, [realKey])[0];
|
|
716
|
+
let selectedRows;
|
|
717
|
+
|
|
718
|
+
if ((foundIdx = (0, _indexOf.default)(selectedRowKeys).call(selectedRowKeys, realKey)) > -1 && selected === false) {
|
|
719
|
+
(0, _splice.default)(selectedRowKeys).call(selectedRowKeys, foundIdx, 1);
|
|
720
|
+
selectedRows = this.getSelectedRows(null, selectedRowKeys);
|
|
721
|
+
|
|
722
|
+
if (!this._selectionIsControlled()) {
|
|
723
|
+
this._adapter.setSelectedRowKeys(selectedRowKeys);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
this._adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
727
|
+
|
|
728
|
+
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
729
|
+
} else if ((0, _indexOf.default)(selectedRowKeys).call(selectedRowKeys, realKey) === -1 && selected === true) {
|
|
730
|
+
selectedRowKeys.push(realKey);
|
|
731
|
+
selectedRows = this.getSelectedRows(null, selectedRowKeys);
|
|
732
|
+
|
|
733
|
+
if (!this._selectionIsControlled()) {
|
|
734
|
+
this._adapter.setSelectedRowKeys(selectedRowKeys);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
this._adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
738
|
+
|
|
739
|
+
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* select all rows
|
|
745
|
+
* @param {*} selected The future state of the select all button
|
|
746
|
+
* @param {*} e
|
|
747
|
+
*/
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
handleSelectAllRow(selected, e) {
|
|
751
|
+
this.stopPropagation(e);
|
|
752
|
+
|
|
753
|
+
if (typeof selected === 'boolean') {
|
|
754
|
+
const curSelectedRowKeys = this._getSelectedRowKeys();
|
|
755
|
+
|
|
756
|
+
let selectedRowKeys = [...curSelectedRowKeys];
|
|
757
|
+
|
|
758
|
+
const selectedRowKeysSet = this._getSelectedRowKeysSet();
|
|
759
|
+
|
|
760
|
+
let allRowKeys = [...this._adapter.getCachedFilteredSortedRowKeys()];
|
|
761
|
+
const disabledRowKeys = this.getAllDisabledRowKeys();
|
|
762
|
+
const disabledRowKeysSet = new _set.default(disabledRowKeys);
|
|
763
|
+
let changedRowKeys; // Select all, if not disabled && not in selectedRowKeys
|
|
764
|
+
|
|
765
|
+
if (selected) {
|
|
766
|
+
for (const key of allRowKeys) {
|
|
767
|
+
if (!disabledRowKeysSet.has(key) && !selectedRowKeysSet.has(key)) {
|
|
768
|
+
selectedRowKeys.push(key);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
allRowKeys = (0, _array.pullAll)(allRowKeys, [...disabledRowKeys, ...curSelectedRowKeys]);
|
|
773
|
+
changedRowKeys = [...allRowKeys];
|
|
774
|
+
} else {
|
|
775
|
+
selectedRowKeys = (0, _array.pullAll)(selectedRowKeys, allRowKeys);
|
|
776
|
+
changedRowKeys = [...curSelectedRowKeys];
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
const changedRows = this.getSelectedRows(null, changedRowKeys || []);
|
|
780
|
+
const selectedRows = this.getSelectedRows(null, selectedRowKeys || []);
|
|
781
|
+
|
|
782
|
+
if (!this._selectionIsControlled()) {
|
|
783
|
+
this._adapter.setSelectedRowKeys(selectedRowKeys);
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
this._adapter.notifySelectAll(selected, selectedRows, changedRows, e);
|
|
787
|
+
|
|
788
|
+
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* row keys => rows
|
|
793
|
+
* @param {*} dataSource
|
|
794
|
+
* @param {*} selectedRowKeys
|
|
795
|
+
* @param {*} selectedRowKeysSet Recursive optimization
|
|
796
|
+
*/
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
getSelectedRows(dataSource, selectedRowKeys, selectedRowKeysSet) {
|
|
800
|
+
dataSource = dataSource == null ? this._getDataSource() : dataSource;
|
|
801
|
+
selectedRowKeys = selectedRowKeys == null ? this._getSelectedRowKeys() : selectedRowKeys;
|
|
802
|
+
|
|
803
|
+
if (!(0, _isSet2.default)(selectedRowKeysSet)) {
|
|
804
|
+
selectedRowKeysSet = new _set.default(selectedRowKeys);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
const childrenRecordName = this.getProp('childrenRecordName');
|
|
808
|
+
const selectedRows = [];
|
|
809
|
+
|
|
810
|
+
if ((0, _isSet2.default)(selectedRowKeysSet) && selectedRowKeysSet.size && (0, _isArray.default)(dataSource) && dataSource.length) {
|
|
811
|
+
// Time complexity optimization, replace the includes operation of array with has of set
|
|
812
|
+
selectedRows.push(...(0, _filter2.default)(dataSource).call(dataSource, data => selectedRowKeysSet.has(this.getRecordKey(data))));
|
|
813
|
+
|
|
814
|
+
if (selectedRows.length < selectedRowKeys.length) {
|
|
815
|
+
for (const item of dataSource) {
|
|
816
|
+
const children = (0, _get2.default)(item, childrenRecordName);
|
|
817
|
+
|
|
818
|
+
if ((0, _isArray.default)(children) && children.length) {
|
|
819
|
+
const rows = this.getSelectedRows(children, selectedRowKeys, selectedRowKeysSet);
|
|
820
|
+
selectedRows.push(...rows);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
return selectedRows;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
getAllDisabledRowKeys(dataSource, getCheckboxProps) {
|
|
830
|
+
dataSource = dataSource == null ? this._getDataSource() : dataSource;
|
|
831
|
+
getCheckboxProps = getCheckboxProps == null ? (0, _get2.default)(this.getProp('rowSelection'), 'getCheckboxProps') : getCheckboxProps;
|
|
832
|
+
const childrenRecordName = this.getProp('childrenRecordName');
|
|
833
|
+
const disabledRowKeys = [];
|
|
834
|
+
|
|
835
|
+
if ((0, _isArray.default)(dataSource) && dataSource.length && typeof getCheckboxProps === 'function') {
|
|
836
|
+
for (const record of dataSource) {
|
|
837
|
+
const props = getCheckboxProps(record);
|
|
838
|
+
|
|
839
|
+
if (props && props.disabled) {
|
|
840
|
+
disabledRowKeys.push(this.getRecordKey(record));
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
const children = (0, _get2.default)(record, childrenRecordName);
|
|
844
|
+
|
|
845
|
+
if ((0, _isArray.default)(children) && children.length) {
|
|
846
|
+
const keys = this.getAllDisabledRowKeys(children, getCheckboxProps);
|
|
847
|
+
disabledRowKeys.push(...keys);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
return disabledRowKeys;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
getAllRowKeys(dataSource) {
|
|
856
|
+
dataSource = dataSource == null ? this._getDataSource() : dataSource;
|
|
857
|
+
const childrenRecordName = this.getProp('childrenRecordName');
|
|
858
|
+
const allRowKeys = [];
|
|
859
|
+
|
|
860
|
+
if ((0, _isArray.default)(dataSource) && dataSource.length) {
|
|
861
|
+
for (const record of dataSource) {
|
|
862
|
+
const childrenRowKeys = [];
|
|
863
|
+
const children = (0, _get2.default)(record, childrenRecordName);
|
|
864
|
+
|
|
865
|
+
if ((0, _isArray.default)(children) && children.length) {
|
|
866
|
+
childrenRowKeys.push(...this.getAllRowKeys(children));
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
allRowKeys.push(this.getRecordKey(record), ...childrenRowKeys);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
return allRowKeys;
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Check if the selected item is in allRowKeysSet
|
|
877
|
+
* @param {Array} selectedRowKeys
|
|
878
|
+
* @param {Set} allRowKeysSet
|
|
879
|
+
*/
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
hasRowSelected(selectedRowKeys, allRowKeysSet) {
|
|
883
|
+
return Boolean((0, _isArray.default)(selectedRowKeys) && selectedRowKeys.length && (0, _isSet2.default)(allRowKeysSet) && allRowKeysSet.size && (0, _filter2.default)(selectedRowKeys).call(selectedRowKeys, key => allRowKeysSet.has(key)).length);
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* expand processing function
|
|
887
|
+
* @param {Boolean} expanded
|
|
888
|
+
* @param {String} realKey
|
|
889
|
+
* @param {Event} domEvent
|
|
890
|
+
*/
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
handleRowExpanded(expanded, realKey, domEvent) {
|
|
894
|
+
this.stopPropagation(domEvent);
|
|
895
|
+
const expandedRowKeys = [...this.getState('expandedRowKeys')];
|
|
896
|
+
const index = (0, _indexOf.default)(expandedRowKeys).call(expandedRowKeys, realKey);
|
|
897
|
+
const keyIsValid = typeof realKey === 'string' || typeof realKey === 'number';
|
|
898
|
+
|
|
899
|
+
if (keyIsValid && expanded && index === -1) {
|
|
900
|
+
expandedRowKeys.push(realKey);
|
|
901
|
+
} else if (keyIsValid && !expanded && index > -1) {
|
|
902
|
+
(0, _splice.default)(expandedRowKeys).call(expandedRowKeys, index, 1);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
if (!this._rowExpansionIsControlled()) {
|
|
906
|
+
this._adapter.setExpandedRowKeys(expandedRowKeys);
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
const expandedRows = this.getSelectedRows(null, expandedRowKeys);
|
|
910
|
+
let expandedRow = this.getSelectedRows(null, [realKey])[0]; // groups record processing
|
|
911
|
+
|
|
912
|
+
const groups = this._getGroups();
|
|
913
|
+
|
|
914
|
+
if (groups) {
|
|
915
|
+
// Construct group expandRow
|
|
916
|
+
if (groups.has(realKey)) {
|
|
917
|
+
expandedRow = {
|
|
918
|
+
groupKey: realKey
|
|
919
|
+
};
|
|
920
|
+
} // If expandedRowKeys includes groupKey, add to expandedRows
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
for (let i = 0, len = expandedRowKeys.length; i < len; i++) {
|
|
924
|
+
if (groups.has(realKey)) {
|
|
925
|
+
expandedRows.push({
|
|
926
|
+
groupKey: expandedRowKeys[i]
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
this._adapter.notifyExpand(expanded, expandedRow, domEvent);
|
|
933
|
+
|
|
934
|
+
this._adapter.notifyExpandedRowsChange(expandedRows);
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* get state.groups
|
|
938
|
+
* @returns {Map|Null}
|
|
939
|
+
*/
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
_getGroups() {
|
|
943
|
+
const groupBy = this._adapter.getProp('groupBy');
|
|
944
|
+
|
|
945
|
+
if (groupBy !== null) {
|
|
946
|
+
const groups = this._adapter.getState('groups');
|
|
947
|
+
|
|
948
|
+
return groups;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
return null;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Determine whether you have selected all except for disabled
|
|
955
|
+
* @param {Set} selectedRowKeysSet
|
|
956
|
+
* @param {Set} disabledRowKeysSet
|
|
957
|
+
* @param {Array} allKeys keys after sorted and filtered
|
|
958
|
+
*/
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
allIsSelected(selectedRowKeysSet, disabledRowKeysSet, allKeys) {
|
|
962
|
+
const filteredAllKeys = (0, _filter3.default)(allKeys, key => key != null && !disabledRowKeysSet.has(key));
|
|
963
|
+
|
|
964
|
+
if (filteredAllKeys && filteredAllKeys.length) {
|
|
965
|
+
for (const key of filteredAllKeys) {
|
|
966
|
+
if (key != null && !selectedRowKeysSet.has(key)) {
|
|
967
|
+
return false;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
return true;
|
|
972
|
+
} else {
|
|
973
|
+
return false;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* This function is not used yet
|
|
978
|
+
* @param {*} selectedRowKeys
|
|
979
|
+
* @param {*} allKeys
|
|
980
|
+
*/
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
allIsNotSelected(selectedRowKeys, allKeys) {
|
|
984
|
+
for (const key of allKeys) {
|
|
985
|
+
if (key != null && (0, _isArray.default)(selectedRowKeys) && (0, _includes.default)(selectedRowKeys).call(selectedRowKeys, key)) {
|
|
986
|
+
return true;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
formatPaginationInfo() {
|
|
994
|
+
let pagination = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
995
|
+
let defaultPageText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
996
|
+
let info = '';
|
|
997
|
+
const formatPageText = (0, _get2.default)(this.getProp('pagination'), 'formatPageText');
|
|
998
|
+
const {
|
|
999
|
+
total,
|
|
1000
|
+
pageSize,
|
|
1001
|
+
currentPage
|
|
1002
|
+
} = pagination;
|
|
1003
|
+
const currentStart = Math.min((currentPage - 1) * pageSize + 1, total);
|
|
1004
|
+
const currentEnd = Math.min(currentPage * pageSize, total);
|
|
1005
|
+
|
|
1006
|
+
if (formatPageText || formatPageText !== false && defaultPageText && total > 0) {
|
|
1007
|
+
info = typeof formatPageText === 'function' ? formatPageText({
|
|
1008
|
+
currentStart,
|
|
1009
|
+
currentEnd,
|
|
1010
|
+
total
|
|
1011
|
+
}) : defaultPageText.replace('${currentStart}', currentStart).replace('${currentEnd}', currentEnd).replace('${total}', total);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
return info;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
toggleShowFilter(dataIndex, visible) {
|
|
1018
|
+
let filterObj = this.getQuery(dataIndex);
|
|
1019
|
+
const filterDropdownVisible = visible; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1020
|
+
|
|
1021
|
+
filterObj = (0, _assign.default)((0, _assign.default)({}, filterObj), {
|
|
1022
|
+
filterDropdownVisible
|
|
1023
|
+
});
|
|
1024
|
+
|
|
1025
|
+
if (!this._filterShowIsControlled()) {// this._adapter.setQuery({
|
|
1026
|
+
// ...filterObj,
|
|
1027
|
+
// filterDropdownVisible,
|
|
1028
|
+
// });
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
this._adapter.notifyFilterDropdownVisibleChange(filterDropdownVisible, dataIndex);
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* Called when the filter changes
|
|
1035
|
+
* @param {*} dataIndex
|
|
1036
|
+
* @param {*} data
|
|
1037
|
+
*/
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
handleFilterSelect(dataIndex) {
|
|
1041
|
+
let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1042
|
+
let query = this.getQuery(dataIndex);
|
|
1043
|
+
let queries = [...this._adapter.getState('queries')];
|
|
1044
|
+
const {
|
|
1045
|
+
filteredValue
|
|
1046
|
+
} = data;
|
|
1047
|
+
query = (0, _assign.default)((0, _assign.default)({}, query), {
|
|
1048
|
+
filteredValue
|
|
1049
|
+
});
|
|
1050
|
+
queries = (0, _utils.mergeQueries)(query, queries);
|
|
1051
|
+
|
|
1052
|
+
const mergedQueries = this._mergeToQueries(query, null);
|
|
1053
|
+
|
|
1054
|
+
const filters = this._getAllFilters(mergedQueries);
|
|
1055
|
+
|
|
1056
|
+
if (!this._filterIsControlled(dataIndex)) {
|
|
1057
|
+
this._adapter.setQueries(queries);
|
|
1058
|
+
|
|
1059
|
+
this.handleClickFilterOrSorter(queries);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
this._notifyChange(null, filters);
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* Click the sort button to call
|
|
1066
|
+
* @param {*} column
|
|
1067
|
+
* @param {*} e
|
|
1068
|
+
*/
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
handleSort() {
|
|
1072
|
+
let column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1073
|
+
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
1074
|
+
this.stopPropagation(e);
|
|
1075
|
+
const {
|
|
1076
|
+
dataIndex
|
|
1077
|
+
} = column;
|
|
1078
|
+
let queries = this.getState('queries');
|
|
1079
|
+
let curQuery = null;
|
|
1080
|
+
queries = [...queries];
|
|
1081
|
+
(0, _each2.default)(queries, (query, idx, arr) => {
|
|
1082
|
+
if (query.sorter) {
|
|
1083
|
+
const sorterObj = (0, _assign.default)({}, query);
|
|
1084
|
+
const stateSortOrder = (0, _get2.default)(sorterObj, 'sortOrder');
|
|
1085
|
+
const defaultSortOrder = (0, _get2.default)(sorterObj, 'defaultSortOrder', false);
|
|
1086
|
+
let querySortOrder = this.isSortOrderValid(stateSortOrder) ? stateSortOrder : defaultSortOrder;
|
|
1087
|
+
|
|
1088
|
+
if (dataIndex && dataIndex === sorterObj.dataIndex) {
|
|
1089
|
+
if (querySortOrder === _constants.strings.SORT_DIRECTIONS[0]) {
|
|
1090
|
+
querySortOrder = _constants.strings.SORT_DIRECTIONS[1];
|
|
1091
|
+
} else if (querySortOrder === _constants.strings.SORT_DIRECTIONS[1]) {
|
|
1092
|
+
querySortOrder = false;
|
|
1093
|
+
} else {
|
|
1094
|
+
querySortOrder = _constants.strings.SORT_DIRECTIONS[0];
|
|
1095
|
+
}
|
|
1096
|
+
} else {
|
|
1097
|
+
// This results in the current click only supports single column sorting
|
|
1098
|
+
querySortOrder = false;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
arr[idx] = (0, _assign.default)((0, _assign.default)({}, sorterObj), {
|
|
1102
|
+
sortOrder: querySortOrder
|
|
1103
|
+
});
|
|
1104
|
+
|
|
1105
|
+
if (dataIndex === sorterObj.dataIndex) {
|
|
1106
|
+
curQuery = arr[idx];
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
});
|
|
1110
|
+
|
|
1111
|
+
if (!this._sorterIsControlled(dataIndex)) {
|
|
1112
|
+
this._adapter.setQueries(queries);
|
|
1113
|
+
|
|
1114
|
+
this.handleClickFilterOrSorter(queries);
|
|
1115
|
+
} // notify sort event
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
this._notifyChange(null, null, curQuery, null);
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* Recalculate the cached data after clicking filter or sorter
|
|
1122
|
+
* @param {*} queries
|
|
1123
|
+
*/
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
handleClickFilterOrSorter(queries) {
|
|
1127
|
+
const dataSource = [...this.getProp('dataSource')];
|
|
1128
|
+
const sortedDataSource = this.getFilteredSortedDataSource(dataSource, queries);
|
|
1129
|
+
this.setCachedFilteredSortedDataSource(sortedDataSource);
|
|
1130
|
+
const pageData = this.getCurrentPageData(sortedDataSource);
|
|
1131
|
+
this.setAdapterPageData(pageData);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
getQuery(dataIndex, queries) {
|
|
1135
|
+
queries = queries || this.getState('queries');
|
|
1136
|
+
|
|
1137
|
+
if (dataIndex != null) {
|
|
1138
|
+
return (0, _find3.default)(queries, query => query.dataIndex === dataIndex);
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
return undefined;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
getCellWidths(flattenedColumns, flattenedWidths, ignoreScrollBarKey) {
|
|
1145
|
+
return this._adapter.getCellWidths(flattenedColumns, flattenedWidths, ignoreScrollBarKey);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
setHeadWidths(headWidths, index) {
|
|
1149
|
+
return this._adapter.setHeadWidths(headWidths, index);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
getHeadWidths(index) {
|
|
1153
|
+
return this._adapter.getHeadWidths(index);
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
mergedRowExpandable(record) {
|
|
1157
|
+
return this._adapter.mergedRowExpandable(record);
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
setBodyHasScrollbar(bodyHasScrollbar) {
|
|
1161
|
+
this._adapter.setBodyHasScrollbar(bodyHasScrollbar);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
var _default = TableFoundation;
|
|
1167
|
+
exports.default = _default;
|