@douyinfe/semi-foundation 2.36.0-beta.0 → 2.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/calendar/foundation.ts +2 -1
- package/lib/cjs/anchor/constants.js +0 -2
- package/lib/cjs/anchor/foundation.js +10 -73
- package/lib/cjs/anchor/linkFoundation.js +4 -16
- package/lib/cjs/autoComplete/constants.js +0 -3
- package/lib/cjs/autoComplete/foundation.d.ts +1 -1
- package/lib/cjs/autoComplete/foundation.js +25 -139
- package/lib/cjs/autoComplete/optionFoundation.js +4 -14
- package/lib/cjs/avatar/constants.js +0 -2
- package/lib/cjs/avatar/foundation.js +0 -17
- package/lib/cjs/backtop/constants.js +0 -2
- package/lib/cjs/backtop/foundation.d.ts +2 -2
- package/lib/cjs/backtop/foundation.js +0 -21
- package/lib/cjs/badge/constants.js +0 -2
- package/lib/cjs/banner/constants.js +0 -2
- package/lib/cjs/banner/foundation.js +0 -7
- package/lib/cjs/base/constants.js +2 -4
- package/lib/cjs/base/foundation.d.ts +1 -1
- package/lib/cjs/base/foundation.js +12 -46
- package/lib/cjs/base/index.js +0 -3
- package/lib/cjs/breadcrumb/constants.js +0 -2
- package/lib/cjs/breadcrumb/foundation.js +1 -12
- package/lib/cjs/breadcrumb/itemFoundation.js +0 -7
- package/lib/cjs/button/constants.js +0 -2
- package/lib/cjs/calendar/constants.js +0 -2
- package/lib/cjs/calendar/eventUtil.d.ts +1 -1
- package/lib/cjs/calendar/eventUtil.js +2 -74
- package/lib/cjs/calendar/foundation.d.ts +2 -2
- package/lib/cjs/calendar/foundation.js +28 -123
- package/lib/cjs/card/constants.js +0 -2
- package/lib/cjs/carousel/constants.js +0 -2
- package/lib/cjs/carousel/foundation.js +2 -52
- package/lib/cjs/cascader/constants.js +0 -3
- package/lib/cjs/cascader/foundation.d.ts +4 -4
- package/lib/cjs/cascader/foundation.js +28 -242
- package/lib/cjs/cascader/util.js +6 -24
- package/lib/cjs/checkbox/checkboxFoundation.js +2 -38
- package/lib/cjs/checkbox/checkboxGroupFoundation.js +2 -23
- package/lib/cjs/checkbox/constants.js +0 -2
- package/lib/cjs/collapse/constants.js +0 -2
- package/lib/cjs/collapse/foundation.d.ts +1 -1
- package/lib/cjs/collapse/foundation.js +2 -13
- package/lib/cjs/collapsible/constants.js +0 -2
- package/lib/cjs/collapsible/foundation.js +0 -9
- package/lib/cjs/datePicker/_utils/formatter.js +4 -10
- package/lib/cjs/datePicker/_utils/getDayOfWeek.d.ts +1 -1
- package/lib/cjs/datePicker/_utils/getDayOfWeek.js +0 -4
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +0 -5
- package/lib/cjs/datePicker/_utils/getDefaultPickerDate.d.ts +1 -1
- package/lib/cjs/datePicker/_utils/getDefaultPickerDate.js +0 -15
- package/lib/cjs/datePicker/_utils/getFullDateOffset.js +0 -7
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +0 -5
- package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +0 -6
- package/lib/cjs/datePicker/_utils/getMonthTable.d.ts +1 -1
- package/lib/cjs/datePicker/_utils/getMonthTable.js +3 -14
- package/lib/cjs/datePicker/_utils/getMonthsInYear.js +0 -2
- package/lib/cjs/datePicker/_utils/getYears.js +0 -4
- package/lib/cjs/datePicker/_utils/index.js +0 -13
- package/lib/cjs/datePicker/_utils/isAfter.js +0 -4
- package/lib/cjs/datePicker/_utils/isBefore.js +0 -4
- package/lib/cjs/datePicker/_utils/isBetween.js +0 -4
- package/lib/cjs/datePicker/_utils/isDate.js +0 -1
- package/lib/cjs/datePicker/_utils/isSameDay.js +0 -4
- package/lib/cjs/datePicker/_utils/isTimestamp.js +0 -4
- package/lib/cjs/datePicker/_utils/isUnixTimestamp.js +0 -4
- package/lib/cjs/datePicker/_utils/isValidDate.js +0 -1
- package/lib/cjs/datePicker/_utils/isValidTimeZone.js +0 -1
- package/lib/cjs/datePicker/_utils/isWithinInterval.js +0 -4
- package/lib/cjs/datePicker/_utils/parser.js +0 -10
- package/lib/cjs/datePicker/constants.js +0 -3
- package/lib/cjs/datePicker/foundation.d.ts +24 -24
- package/lib/cjs/datePicker/foundation.js +22 -333
- package/lib/cjs/datePicker/inputFoundation.d.ts +3 -3
- package/lib/cjs/datePicker/inputFoundation.js +5 -86
- package/lib/cjs/datePicker/monthFoundation.d.ts +1 -1
- package/lib/cjs/datePicker/monthFoundation.js +3 -28
- package/lib/cjs/datePicker/monthsGridFoundation.d.ts +3 -3
- package/lib/cjs/datePicker/monthsGridFoundation.js +43 -238
- package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonthFoundation.js +12 -38
- package/lib/cjs/descriptions/constants.js +0 -2
- package/lib/cjs/divider/constants.js +0 -2
- package/lib/cjs/dropdown/constants.js +0 -3
- package/lib/cjs/dropdown/foundation.js +4 -23
- package/lib/cjs/dropdown/menuFoundation.js +8 -27
- package/lib/cjs/empty/constants.js +0 -2
- package/lib/cjs/form/constants.js +0 -2
- package/lib/cjs/form/foundation.js +75 -206
- package/lib/cjs/form/interface.d.ts +5 -5
- package/lib/cjs/form/utils.js +47 -77
- package/lib/cjs/grid/constants.js +0 -2
- package/lib/cjs/highlight/constants.js +0 -2
- package/lib/cjs/icons/constants.js +0 -2
- package/lib/cjs/image/constants.js +0 -2
- package/lib/cjs/image/imageFoundation.js +4 -18
- package/lib/cjs/image/previewFooterFoundation.js +0 -13
- package/lib/cjs/image/previewFoundation.js +0 -11
- package/lib/cjs/image/previewImageFoundation.js +6 -80
- package/lib/cjs/image/previewInnerFoundation.js +12 -77
- package/lib/cjs/image/utils.js +0 -14
- package/lib/cjs/input/constants.js +0 -2
- package/lib/cjs/input/foundation.js +17 -101
- package/lib/cjs/input/textareaFoundation.js +20 -85
- package/lib/cjs/input/util/calculateNodeHeight.js +6 -18
- package/lib/cjs/input/util/getSizingData.js +7 -11
- package/lib/cjs/inputNumber/constants.js +0 -2
- package/lib/cjs/inputNumber/foundation.js +29 -192
- package/lib/cjs/layout/constants.js +0 -2
- package/lib/cjs/list/constants.js +0 -2
- package/lib/cjs/modal/constants.js +0 -2
- package/lib/cjs/modal/modalContentFoundation.js +0 -20
- package/lib/cjs/modal/modalFoundation.d.ts +2 -2
- package/lib/cjs/modal/modalFoundation.js +2 -22
- package/lib/cjs/navigation/NavItem.js +0 -10
- package/lib/cjs/navigation/constants.js +0 -3
- package/lib/cjs/navigation/foundation.js +3 -67
- package/lib/cjs/navigation/itemFoundation.js +3 -21
- package/lib/cjs/navigation/subNavFoundation.js +4 -40
- package/lib/cjs/notification/constants.js +0 -3
- package/lib/cjs/notification/notificationFoundation.d.ts +3 -3
- package/lib/cjs/notification/notificationFoundation.js +0 -16
- package/lib/cjs/notification/notificationListFoundation.js +7 -17
- package/lib/cjs/overflowList/constants.js +0 -2
- package/lib/cjs/overflowList/foundation.js +11 -41
- package/lib/cjs/pagination/constants.js +0 -2
- package/lib/cjs/pagination/foundation.d.ts +3 -3
- package/lib/cjs/pagination/foundation.js +21 -90
- package/lib/cjs/popconfirm/constants.js +0 -2
- package/lib/cjs/popconfirm/popconfirmFoundation.js +1 -21
- package/lib/cjs/popover/constants.js +0 -3
- package/lib/cjs/progress/constants.js +0 -2
- package/lib/cjs/progress/generates.d.ts +2 -2
- package/lib/cjs/progress/generates.js +19 -60
- package/lib/cjs/radio/constants.js +0 -2
- package/lib/cjs/radio/radioFoundation.js +0 -14
- package/lib/cjs/radio/radioGroupFoundation.js +4 -23
- package/lib/cjs/radio/radioInnerFoundation.js +2 -19
- package/lib/cjs/rating/constants.js +0 -2
- package/lib/cjs/rating/foundation.js +11 -61
- package/lib/cjs/scrollList/constants.js +0 -2
- package/lib/cjs/scrollList/foundation.js +0 -4
- package/lib/cjs/scrollList/itemFoundation.js +8 -61
- package/lib/cjs/scrollList/scrollTo.js +2 -5
- package/lib/cjs/select/constants.js +0 -3
- package/lib/cjs/select/foundation.d.ts +2 -2
- package/lib/cjs/select/foundation.js +122 -425
- package/lib/cjs/select/optionFoundation.js +4 -14
- package/lib/cjs/sideSheet/constants.js +0 -2
- package/lib/cjs/sideSheet/sideSheetFoundation.js +0 -18
- package/lib/cjs/skeleton/constants.js +0 -2
- package/lib/cjs/slider/constants.js +0 -2
- package/lib/cjs/slider/foundation.d.ts +1 -1
- package/lib/cjs/slider/foundation.js +25 -204
- package/lib/cjs/space/constants.js +0 -2
- package/lib/cjs/spin/constants.js +0 -2
- package/lib/cjs/spin/foundation.js +3 -13
- package/lib/cjs/steps/constants.js +0 -2
- package/lib/cjs/switch/constants.js +0 -2
- package/lib/cjs/switch/foundation.js +2 -18
- package/lib/cjs/table/bodyFoundation.js +2 -34
- package/lib/cjs/table/cellFoundation.js +0 -5
- package/lib/cjs/table/constants.js +7 -8
- package/lib/cjs/table/foundation.d.ts +17 -14
- package/lib/cjs/table/foundation.js +71 -302
- package/lib/cjs/table/tableRowFoundation.js +0 -11
- package/lib/cjs/table/tableSelectionCellFoundation.js +0 -6
- package/lib/cjs/table/utils.d.ts +2 -2
- package/lib/cjs/table/utils.js +5 -118
- package/lib/cjs/tabs/constants.js +0 -2
- package/lib/cjs/tabs/foundation.js +2 -40
- package/lib/cjs/tag/constants.js +1 -2
- package/lib/cjs/tagInput/constants.js +0 -2
- package/lib/cjs/tagInput/foundation.d.ts +4 -4
- package/lib/cjs/tagInput/foundation.js +4 -94
- package/lib/cjs/tagInput/utils/getSplitedArray.js +0 -11
- package/lib/cjs/timePicker/ComboxFoundation.js +4 -39
- package/lib/cjs/timePicker/constants.js +0 -3
- package/lib/cjs/timePicker/foundation.d.ts +1 -1
- package/lib/cjs/timePicker/foundation.js +3 -97
- package/lib/cjs/timePicker/inputFoundation.js +6 -25
- package/lib/cjs/timePicker/utils/index.js +6 -45
- package/lib/cjs/timePicker/utils/localeDate.js +0 -10
- package/lib/cjs/timeline/constants.js +0 -2
- package/lib/cjs/toast/constants.js +0 -3
- package/lib/cjs/toast/toastFoundation.d.ts +3 -3
- package/lib/cjs/toast/toastFoundation.js +0 -14
- package/lib/cjs/toast/toastListFoundation.js +4 -22
- package/lib/cjs/tooltip/constants.js +0 -2
- package/lib/cjs/tooltip/foundation.d.ts +1 -1
- package/lib/cjs/tooltip/foundation.js +63 -291
- package/lib/cjs/transfer/constants.js +0 -2
- package/lib/cjs/transfer/foundation.d.ts +1 -1
- package/lib/cjs/transfer/foundation.js +4 -68
- package/lib/cjs/transfer/transferUtils.js +5 -27
- package/lib/cjs/tree/constants.js +0 -2
- package/lib/cjs/tree/foundation.d.ts +3 -3
- package/lib/cjs/tree/foundation.js +34 -150
- package/lib/cjs/tree/treeUtil.js +54 -173
- package/lib/cjs/treeSelect/constants.js +0 -2
- package/lib/cjs/treeSelect/foundation.d.ts +7 -7
- package/lib/cjs/treeSelect/foundation.js +18 -192
- package/lib/cjs/typography/constants.js +0 -2
- package/lib/cjs/typography/formatNumeral.d.ts +3 -3
- package/lib/cjs/typography/formatNumeral.js +16 -32
- package/lib/cjs/upload/constants.js +0 -2
- package/lib/cjs/upload/foundation.d.ts +5 -5
- package/lib/cjs/upload/foundation.js +36 -245
- package/lib/cjs/upload/utils.js +10 -29
- package/lib/cjs/utils/Event.js +2 -21
- package/lib/cjs/utils/FocusHandle.d.ts +1 -1
- package/lib/cjs/utils/FocusHandle.js +6 -35
- package/lib/cjs/utils/Logger.js +0 -21
- package/lib/cjs/utils/Store.js +0 -10
- package/lib/cjs/utils/a11y.js +18 -43
- package/lib/cjs/utils/array.d.ts +1 -1
- package/lib/cjs/utils/array.js +0 -7
- package/lib/cjs/utils/arrayMove.js +0 -1
- package/lib/cjs/utils/classnames.js +0 -12
- package/lib/cjs/utils/date-fns-extra.js +0 -35
- package/lib/cjs/utils/dom.d.ts +1 -1
- package/lib/cjs/utils/dom.js +0 -13
- package/lib/cjs/utils/function.js +0 -1
- package/lib/cjs/utils/getDataAttr.js +0 -2
- package/lib/cjs/utils/getHighlight.js +5 -26
- package/lib/cjs/utils/getMotionObjFromProps.js +0 -12
- package/lib/cjs/utils/index.js +0 -4
- package/lib/cjs/utils/isBothNaN.js +0 -2
- package/lib/cjs/utils/isElement.js +0 -1
- package/lib/cjs/utils/isEnterPress.js +0 -5
- package/lib/cjs/utils/isEscPress.js +0 -5
- package/lib/cjs/utils/isNullOrUndefined.js +0 -1
- package/lib/cjs/utils/isNumber.js +0 -1
- package/lib/cjs/utils/isObject.js +0 -1
- package/lib/cjs/utils/isPromise.js +0 -3
- package/lib/cjs/utils/isString.js +0 -1
- package/lib/cjs/utils/keyCode.js +0 -105
- package/lib/cjs/utils/log.js +0 -5
- package/lib/cjs/utils/number.js +0 -2
- package/lib/cjs/utils/object.d.ts +4 -4
- package/lib/cjs/utils/object.js +12 -34
- package/lib/cjs/utils/set.js +0 -8
- package/lib/cjs/utils/shallowEqualObjects.js +0 -7
- package/lib/cjs/utils/touchPolyfill.js +0 -7
- package/lib/cjs/utils/type.d.ts +3 -3
- package/lib/cjs/utils/uuid.js +2 -9
- package/lib/cjs/utils/warning.js +0 -1
- package/lib/es/anchor/foundation.js +10 -66
- package/lib/es/anchor/linkFoundation.js +4 -12
- package/lib/es/autoComplete/foundation.d.ts +1 -1
- package/lib/es/autoComplete/foundation.js +24 -132
- package/lib/es/autoComplete/optionFoundation.js +4 -10
- package/lib/es/avatar/foundation.js +0 -12
- package/lib/es/backtop/foundation.d.ts +2 -2
- package/lib/es/backtop/foundation.js +0 -16
- package/lib/es/banner/foundation.js +0 -3
- package/lib/es/base/constants.js +2 -2
- package/lib/es/base/foundation.d.ts +1 -1
- package/lib/es/base/foundation.js +11 -44
- package/lib/es/breadcrumb/foundation.js +0 -7
- package/lib/es/breadcrumb/itemFoundation.js +0 -3
- package/lib/es/calendar/eventUtil.d.ts +1 -1
- package/lib/es/calendar/eventUtil.js +2 -36
- package/lib/es/calendar/foundation.d.ts +2 -2
- package/lib/es/calendar/foundation.js +28 -117
- package/lib/es/carousel/foundation.js +2 -47
- package/lib/es/cascader/constants.js +0 -1
- package/lib/es/cascader/foundation.d.ts +4 -4
- package/lib/es/cascader/foundation.js +30 -226
- package/lib/es/cascader/util.js +6 -15
- package/lib/es/checkbox/checkboxFoundation.js +2 -34
- package/lib/es/checkbox/checkboxGroupFoundation.js +2 -20
- package/lib/es/collapse/foundation.d.ts +1 -1
- package/lib/es/collapse/foundation.js +2 -9
- package/lib/es/collapsible/foundation.js +0 -7
- package/lib/es/datePicker/_utils/formatter.js +4 -8
- package/lib/es/datePicker/_utils/getDayOfWeek.d.ts +1 -1
- package/lib/es/datePicker/_utils/getDayOfWeek.js +0 -3
- package/lib/es/datePicker/_utils/getDefaultFormatToken.js +0 -2
- package/lib/es/datePicker/_utils/getDefaultPickerDate.d.ts +1 -1
- package/lib/es/datePicker/_utils/getDefaultPickerDate.js +0 -10
- package/lib/es/datePicker/_utils/getFullDateOffset.js +0 -3
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +0 -4
- package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +0 -5
- package/lib/es/datePicker/_utils/getMonthTable.d.ts +1 -1
- package/lib/es/datePicker/_utils/getMonthTable.js +4 -14
- package/lib/es/datePicker/_utils/getMonthsInYear.js +0 -1
- package/lib/es/datePicker/_utils/getYears.js +0 -3
- package/lib/es/datePicker/_utils/isBetween.js +0 -1
- package/lib/es/datePicker/_utils/parser.js +0 -8
- package/lib/es/datePicker/foundation.d.ts +24 -24
- package/lib/es/datePicker/foundation.js +22 -318
- package/lib/es/datePicker/inputFoundation.d.ts +3 -3
- package/lib/es/datePicker/inputFoundation.js +5 -74
- package/lib/es/datePicker/monthFoundation.d.ts +1 -1
- package/lib/es/datePicker/monthFoundation.js +4 -22
- package/lib/es/datePicker/monthsGridFoundation.d.ts +3 -3
- package/lib/es/datePicker/monthsGridFoundation.js +42 -222
- package/lib/es/datePicker/yearAndMonthFoundation.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonthFoundation.js +12 -36
- package/lib/es/dropdown/foundation.js +4 -18
- package/lib/es/dropdown/menuFoundation.js +8 -22
- package/lib/es/form/foundation.js +74 -195
- package/lib/es/form/interface.d.ts +5 -5
- package/lib/es/form/utils.js +47 -70
- package/lib/es/image/imageFoundation.js +4 -13
- package/lib/es/image/previewFooterFoundation.js +0 -9
- package/lib/es/image/previewFoundation.js +0 -7
- package/lib/es/image/previewImageFoundation.js +6 -72
- package/lib/es/image/previewInnerFoundation.js +12 -70
- package/lib/es/image/utils.js +0 -6
- package/lib/es/input/foundation.js +17 -93
- package/lib/es/input/textareaFoundation.js +20 -75
- package/lib/es/input/util/calculateNodeHeight.js +6 -18
- package/lib/es/input/util/getSizingData.js +7 -11
- package/lib/es/inputNumber/foundation.js +28 -183
- package/lib/es/modal/modalContentFoundation.js +0 -15
- package/lib/es/modal/modalFoundation.d.ts +2 -2
- package/lib/es/modal/modalFoundation.js +2 -17
- package/lib/es/navigation/NavItem.js +0 -6
- package/lib/es/navigation/constants.js +1 -1
- package/lib/es/navigation/foundation.js +2 -60
- package/lib/es/navigation/itemFoundation.js +3 -18
- package/lib/es/navigation/subNavFoundation.js +4 -36
- package/lib/es/notification/constants.js +1 -1
- package/lib/es/notification/notificationFoundation.d.ts +3 -3
- package/lib/es/notification/notificationFoundation.js +0 -11
- package/lib/es/notification/notificationListFoundation.js +6 -13
- package/lib/es/overflowList/foundation.js +11 -37
- package/lib/es/pagination/foundation.d.ts +3 -3
- package/lib/es/pagination/foundation.js +20 -87
- package/lib/es/popconfirm/popconfirmFoundation.js +1 -16
- package/lib/es/progress/generates.d.ts +2 -2
- package/lib/es/progress/generates.js +19 -59
- package/lib/es/radio/radioFoundation.js +0 -9
- package/lib/es/radio/radioGroupFoundation.js +4 -19
- package/lib/es/radio/radioInnerFoundation.js +2 -15
- package/lib/es/rating/foundation.js +10 -54
- package/lib/es/scrollList/itemFoundation.js +8 -60
- package/lib/es/scrollList/scrollTo.js +2 -4
- package/lib/es/select/foundation.d.ts +2 -2
- package/lib/es/select/foundation.js +122 -411
- package/lib/es/select/optionFoundation.js +4 -10
- package/lib/es/sideSheet/sideSheetFoundation.js +0 -12
- package/lib/es/slider/foundation.d.ts +1 -1
- package/lib/es/slider/foundation.js +24 -197
- package/lib/es/spin/foundation.js +3 -11
- package/lib/es/switch/foundation.js +2 -13
- package/lib/es/table/bodyFoundation.js +2 -25
- package/lib/es/table/cellFoundation.js +0 -1
- package/lib/es/table/constants.js +6 -6
- package/lib/es/table/foundation.d.ts +17 -14
- package/lib/es/table/foundation.js +71 -309
- package/lib/es/table/tableRowFoundation.js +2 -9
- package/lib/es/table/tableSelectionCellFoundation.js +0 -2
- package/lib/es/table/utils.d.ts +2 -2
- package/lib/es/table/utils.js +5 -81
- package/lib/es/tabs/foundation.js +2 -35
- package/lib/es/tagInput/foundation.d.ts +4 -4
- package/lib/es/tagInput/foundation.js +4 -84
- package/lib/es/tagInput/utils/getSplitedArray.js +0 -7
- package/lib/es/timePicker/ComboxFoundation.js +4 -30
- package/lib/es/timePicker/foundation.d.ts +1 -1
- package/lib/es/timePicker/foundation.js +4 -90
- package/lib/es/timePicker/inputFoundation.js +6 -22
- package/lib/es/timePicker/utils/index.js +6 -25
- package/lib/es/timePicker/utils/localeDate.js +0 -8
- package/lib/es/toast/constants.js +1 -1
- package/lib/es/toast/toastFoundation.d.ts +3 -3
- package/lib/es/toast/toastFoundation.js +0 -9
- package/lib/es/toast/toastListFoundation.js +4 -18
- package/lib/es/tooltip/foundation.d.ts +1 -1
- package/lib/es/tooltip/foundation.js +63 -288
- package/lib/es/transfer/foundation.d.ts +1 -1
- package/lib/es/transfer/foundation.js +6 -62
- package/lib/es/transfer/transferUtils.js +5 -21
- package/lib/es/tree/foundation.d.ts +3 -3
- package/lib/es/tree/foundation.js +34 -143
- package/lib/es/tree/treeUtil.js +54 -139
- package/lib/es/treeSelect/foundation.d.ts +7 -7
- package/lib/es/treeSelect/foundation.js +20 -179
- package/lib/es/typography/formatNumeral.d.ts +3 -3
- package/lib/es/typography/formatNumeral.js +16 -29
- package/lib/es/upload/foundation.d.ts +5 -5
- package/lib/es/upload/foundation.js +36 -238
- package/lib/es/upload/utils.js +10 -24
- package/lib/es/utils/Event.js +2 -17
- package/lib/es/utils/FocusHandle.d.ts +1 -1
- package/lib/es/utils/FocusHandle.js +6 -32
- package/lib/es/utils/Logger.js +0 -20
- package/lib/es/utils/Store.js +0 -9
- package/lib/es/utils/a11y.js +18 -31
- package/lib/es/utils/array.d.ts +1 -1
- package/lib/es/utils/array.js +0 -5
- package/lib/es/utils/classnames.js +0 -10
- package/lib/es/utils/date-fns-extra.js +0 -27
- package/lib/es/utils/dom.d.ts +1 -1
- package/lib/es/utils/dom.js +0 -9
- package/lib/es/utils/getDataAttr.js +0 -1
- package/lib/es/utils/getHighlight.js +5 -26
- package/lib/es/utils/getMotionObjFromProps.js +0 -8
- package/lib/es/utils/isBothNaN.js +0 -1
- package/lib/es/utils/isEnterPress.js +0 -2
- package/lib/es/utils/isEscPress.js +0 -2
- package/lib/es/utils/keyCode.js +0 -104
- package/lib/es/utils/log.js +0 -3
- package/lib/es/utils/object.d.ts +4 -4
- package/lib/es/utils/object.js +12 -28
- package/lib/es/utils/set.js +0 -5
- package/lib/es/utils/shallowEqualObjects.js +0 -6
- package/lib/es/utils/touchPolyfill.js +0 -5
- package/lib/es/utils/type.d.ts +3 -3
- package/lib/es/utils/uuid.js +2 -8
- package/package.json +2 -2
- package/table/foundation.ts +7 -10
- package/upload/foundation.ts +8 -8
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
// eslint-disable-next-line max-len
|
|
13
10
|
class TableRowFoundation extends _foundation.default {
|
|
14
11
|
handleClick(e) {
|
|
@@ -16,26 +13,18 @@ class TableRowFoundation extends _foundation.default {
|
|
|
16
13
|
expanded,
|
|
17
14
|
rowKey
|
|
18
15
|
} = this.getProps();
|
|
19
|
-
|
|
20
16
|
this._adapter.notifyClick(rowKey, e, expanded);
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
handleDoubleClick(e) {
|
|
24
19
|
this._adapter.notifyDoubleClick(this.getProp('record'), e);
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
handleMouseEnter(e) {
|
|
28
22
|
const record = this.getProp('record');
|
|
29
|
-
|
|
30
23
|
this._adapter.notifyMouseEnter(record, e);
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
handleMouseLeave(e) {
|
|
34
26
|
const record = this.getProp('record');
|
|
35
|
-
|
|
36
27
|
this._adapter.notifyMouseLeave(record, e);
|
|
37
28
|
}
|
|
38
|
-
|
|
39
29
|
}
|
|
40
|
-
|
|
41
30
|
exports.default = TableRowFoundation;
|
|
@@ -4,18 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
class TableSelectionCellFoundation extends _foundation.default {
|
|
13
10
|
handleChange(e) {
|
|
14
11
|
const value = e.target.checked;
|
|
15
|
-
|
|
16
12
|
this._adapter.notifyChange(value, e);
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
}
|
|
20
|
-
|
|
21
15
|
exports.default = TableSelectionCellFoundation;
|
package/lib/cjs/table/utils.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export declare function getAllLevelColumns(columns: Record<string, any>[], child
|
|
|
62
62
|
export declare function getColumnByLevelIndex(columns: Record<string, any>[], index: number, level?: number, childrenColumnName?: string): any;
|
|
63
63
|
export declare function findColumn(columns: Record<string, any>[], column: Record<string, any>, childrenColumnName?: string): any;
|
|
64
64
|
export declare function expandBtnShouldInRow(props: ExpandBtnShouldInRowProps): boolean;
|
|
65
|
-
export
|
|
65
|
+
export type ExpandBtnShouldInRowProps = {
|
|
66
66
|
expandedRowRender: (record?: Record<string, any>, index?: number, expanded?: boolean) => any;
|
|
67
67
|
dataSource: Record<string, any>[];
|
|
68
68
|
hideExpandedColumn: boolean;
|
|
@@ -152,4 +152,4 @@ export declare function isTreeTable({ dataSource, childrenRecordName }: {
|
|
|
152
152
|
childrenRecordName?: string;
|
|
153
153
|
}): boolean;
|
|
154
154
|
export declare function getRTLAlign(align: typeof strings.ALIGNS[number], direction?: 'ltr' | 'rtl'): typeof strings.ALIGNS[number];
|
|
155
|
-
export declare function shouldShowEllipsisTitle(ellipsis: BaseEllipsis):
|
|
155
|
+
export declare function shouldShowEllipsisTitle(ellipsis: BaseEllipsis): true;
|
package/lib/cjs/table/utils.js
CHANGED
|
@@ -42,64 +42,47 @@ exports.shouldShowEllipsisTitle = shouldShowEllipsisTitle;
|
|
|
42
42
|
exports.sliceColumnsByLevel = sliceColumnsByLevel;
|
|
43
43
|
exports.warnIfNoDataIndex = warnIfNoDataIndex;
|
|
44
44
|
exports.withResizeWidth = withResizeWidth;
|
|
45
|
-
|
|
46
45
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
47
|
-
|
|
48
46
|
var _toString2 = _interopRequireDefault(require("lodash/toString"));
|
|
49
|
-
|
|
50
47
|
var _includes2 = _interopRequireDefault(require("lodash/includes"));
|
|
51
|
-
|
|
52
48
|
var _some2 = _interopRequireDefault(require("lodash/some"));
|
|
53
|
-
|
|
54
49
|
var _findIndex2 = _interopRequireDefault(require("lodash/findIndex"));
|
|
55
|
-
|
|
56
50
|
var _each2 = _interopRequireDefault(require("lodash/each"));
|
|
57
|
-
|
|
58
51
|
var _find2 = _interopRequireDefault(require("lodash/find"));
|
|
59
|
-
|
|
60
52
|
var _filter2 = _interopRequireDefault(require("lodash/filter"));
|
|
61
|
-
|
|
62
53
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
63
|
-
|
|
64
54
|
var _isEqualWith2 = _interopRequireDefault(require("lodash/isEqualWith"));
|
|
65
|
-
|
|
66
55
|
var _constants = require("./constants");
|
|
67
|
-
|
|
68
56
|
var _isNullOrUndefined = _interopRequireDefault(require("../utils/isNullOrUndefined"));
|
|
69
|
-
|
|
70
57
|
var _Logger = _interopRequireDefault(require("../utils/Logger"));
|
|
71
|
-
|
|
72
58
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
59
|
+
/* eslint-disable max-len */
|
|
60
|
+
/* eslint-disable no-param-reassign */
|
|
61
|
+
/* eslint-disable eqeqeq */
|
|
73
62
|
|
|
74
63
|
function equalWith(value, other, customizer) {
|
|
75
64
|
return (0, _isEqualWith2.default)(value, other, function (objVal, othVal) {
|
|
76
65
|
if (typeof objVal === 'function' && typeof othVal === 'function') {
|
|
77
66
|
return (0, _toString2.default)(objVal) === (0, _toString2.default)(othVal);
|
|
78
67
|
}
|
|
79
|
-
|
|
80
68
|
if (typeof customizer === 'function') {
|
|
81
69
|
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
82
70
|
rest[_key - 2] = arguments[_key];
|
|
83
71
|
}
|
|
84
|
-
|
|
85
72
|
return customizer(objVal, othVal, ...rest);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
}
|
|
74
|
+
// If customizer returns undefined, comparisons are handled by isEqual instead
|
|
89
75
|
return undefined;
|
|
90
76
|
});
|
|
91
77
|
}
|
|
92
|
-
|
|
93
78
|
function getColumnKey(column, keyPropNames) {
|
|
94
79
|
keyPropNames = Array.isArray(keyPropNames) ? keyPropNames : ['key', 'dataIndex'];
|
|
95
80
|
let key = null;
|
|
96
81
|
(0, _each2.default)(keyPropNames, propName => {
|
|
97
82
|
key = (0, _get2.default)(column, propName);
|
|
98
|
-
|
|
99
83
|
if (key != null) {
|
|
100
84
|
return false;
|
|
101
85
|
}
|
|
102
|
-
|
|
103
86
|
return undefined;
|
|
104
87
|
});
|
|
105
88
|
return key;
|
|
@@ -111,8 +94,6 @@ function getColumnKey(column, keyPropNames) {
|
|
|
111
94
|
* @param {number} [endIndex] end index, not included
|
|
112
95
|
* @returns {number}
|
|
113
96
|
*/
|
|
114
|
-
|
|
115
|
-
|
|
116
97
|
function arrayAdd() {
|
|
117
98
|
let arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
118
99
|
let beginIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -127,63 +108,49 @@ function arrayAdd() {
|
|
|
127
108
|
});
|
|
128
109
|
return result;
|
|
129
110
|
}
|
|
130
|
-
|
|
131
111
|
function isLastLeftFixed(columns, column) {
|
|
132
112
|
let checkKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['key'];
|
|
133
113
|
const leftFixedColumns = (0, _filter2.default)(columns, col => col.fixed === true || col.fixed === 'left');
|
|
134
114
|
const index = (0, _findIndex2.default)(leftFixedColumns, col => checkKeys.every(key => col[key] != null && col[key] === column[key]));
|
|
135
115
|
return leftFixedColumns.length > 0 && index === leftFixedColumns.length - 1;
|
|
136
116
|
}
|
|
137
|
-
|
|
138
117
|
function isFirstFixedRight(columns, column) {
|
|
139
118
|
let checkKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['key'];
|
|
140
119
|
const rightFixedColumns = (0, _filter2.default)(columns, col => col.fixed === 'right');
|
|
141
120
|
const index = (0, _findIndex2.default)(rightFixedColumns, col => checkKeys.every(key => col[key] != null && col[key] === column[key]));
|
|
142
121
|
return rightFixedColumns.length > 0 && index === 0;
|
|
143
122
|
}
|
|
144
|
-
|
|
145
123
|
function isAnyFixed(columns) {
|
|
146
124
|
let fixedSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['left', true, 'right'];
|
|
147
|
-
|
|
148
125
|
if (typeof fixedSet === 'string' || typeof fixedSet === 'boolean') {
|
|
149
126
|
fixedSet = [fixedSet];
|
|
150
127
|
}
|
|
151
|
-
|
|
152
128
|
return fixedSet.length > 0 && (0, _some2.default)(columns, col => fixedSet.includes(col.fixed));
|
|
153
129
|
}
|
|
154
|
-
|
|
155
130
|
function isAnyFixedRight(columns) {
|
|
156
131
|
return (0, _some2.default)(columns, col => col.fixed === 'right');
|
|
157
132
|
}
|
|
158
|
-
|
|
159
133
|
function isFixedLeft(column) {
|
|
160
134
|
return ['left', true].includes((0, _get2.default)(column, 'fixed'));
|
|
161
135
|
}
|
|
162
|
-
|
|
163
136
|
function isFixedRight(column) {
|
|
164
137
|
return ['right'].includes((0, _get2.default)(column, 'fixed'));
|
|
165
138
|
}
|
|
166
|
-
|
|
167
139
|
function isFixed(column) {
|
|
168
140
|
return isFixedLeft(column) || isFixedRight(column);
|
|
169
141
|
}
|
|
170
|
-
|
|
171
142
|
function isInnerColumnKey(key) {
|
|
172
143
|
return [_constants.strings.DEFAULT_KEY_COLUMN_EXPAND, _constants.strings.DEFAULT_KEY_COLUMN_SCROLLBAR, _constants.strings.DEFAULT_KEY_COLUMN_SELECTION].includes(key);
|
|
173
144
|
}
|
|
174
|
-
|
|
175
145
|
function isExpandedColumn(column) {
|
|
176
146
|
return (0, _get2.default)(column, 'key') === _constants.strings.DEFAULT_KEY_COLUMN_EXPAND;
|
|
177
147
|
}
|
|
178
|
-
|
|
179
148
|
function isScrollbarColumn(column) {
|
|
180
149
|
return (0, _get2.default)(column, 'key') === _constants.strings.DEFAULT_KEY_COLUMN_SCROLLBAR;
|
|
181
150
|
}
|
|
182
|
-
|
|
183
151
|
function isSelectionColumn(column) {
|
|
184
152
|
return (0, _get2.default)(column, 'key') === _constants.strings.DEFAULT_KEY_COLUMN_SELECTION;
|
|
185
153
|
}
|
|
186
|
-
|
|
187
154
|
function filterColumns(columns) {
|
|
188
155
|
let ignoreKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [_constants.strings.DEFAULT_KEY_COLUMN_SCROLLBAR];
|
|
189
156
|
return (0, _filter2.default)(columns, col => !ignoreKeys.includes(col.key));
|
|
@@ -193,26 +160,20 @@ function filterColumns(columns) {
|
|
|
193
160
|
* @param {Array} columns
|
|
194
161
|
* @returns {Number|undefined}
|
|
195
162
|
*/
|
|
196
|
-
|
|
197
|
-
|
|
198
163
|
function getScrollbarColumnWidth() {
|
|
199
164
|
let columns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
200
165
|
const len = columns.length;
|
|
201
|
-
|
|
202
166
|
if (len) {
|
|
203
167
|
const lastColumn = columns[len - 1];
|
|
204
|
-
|
|
205
168
|
if ((0, _get2.default)(lastColumn, 'key') === _constants.strings.DEFAULT_KEY_COLUMN_SCROLLBAR) {
|
|
206
169
|
return (0, _get2.default)(lastColumn, 'width', 0);
|
|
207
170
|
}
|
|
208
171
|
}
|
|
209
172
|
}
|
|
210
|
-
|
|
211
173
|
function getRecordKey(record, rowKey) {
|
|
212
174
|
if (rowKey === undefined) {
|
|
213
175
|
rowKey = 'key';
|
|
214
176
|
}
|
|
215
|
-
|
|
216
177
|
return typeof rowKey === 'function' ? rowKey(record) : (0, _get2.default)(record, rowKey);
|
|
217
178
|
}
|
|
218
179
|
/**
|
|
@@ -220,8 +181,6 @@ function getRecordKey(record, rowKey) {
|
|
|
220
181
|
* @param {*} expandedRowKeys
|
|
221
182
|
* @param {*} key
|
|
222
183
|
*/
|
|
223
|
-
|
|
224
|
-
|
|
225
184
|
function isExpanded(expandedRowKeys, key) {
|
|
226
185
|
return key != null && (0, _includes2.default)(expandedRowKeys, key);
|
|
227
186
|
}
|
|
@@ -230,8 +189,6 @@ function isExpanded(expandedRowKeys, key) {
|
|
|
230
189
|
* @param {Set} selectedRowKeysSet
|
|
231
190
|
* @param {String} key
|
|
232
191
|
*/
|
|
233
|
-
|
|
234
|
-
|
|
235
192
|
function isSelected(selectedRowKeysSet, key) {
|
|
236
193
|
return key !== null && selectedRowKeysSet.has(key);
|
|
237
194
|
}
|
|
@@ -240,44 +197,33 @@ function isSelected(selectedRowKeysSet, key) {
|
|
|
240
197
|
* @param {Set} disabledRowKeysSet
|
|
241
198
|
* @param {String} key
|
|
242
199
|
*/
|
|
243
|
-
|
|
244
|
-
|
|
245
200
|
function isDisabled(disabledRowKeysSet, key) {
|
|
246
201
|
return key !== null && disabledRowKeysSet.has(key);
|
|
247
202
|
}
|
|
248
|
-
|
|
249
203
|
function getRecord(data, recordKey, rowKey) {
|
|
250
204
|
if (rowKey === undefined) {
|
|
251
205
|
rowKey = 'key';
|
|
252
206
|
}
|
|
253
|
-
|
|
254
207
|
return (0, _find2.default)(data, record => recordKey != null && recordKey !== '' && getRecordKey(record, rowKey) === recordKey);
|
|
255
208
|
}
|
|
256
|
-
|
|
257
209
|
function getRecordChildren(record, childrenRecordName) {
|
|
258
210
|
if (childrenRecordName === undefined) {
|
|
259
211
|
childrenRecordName = 'children';
|
|
260
212
|
}
|
|
261
|
-
|
|
262
213
|
return (0, _get2.default)(record, childrenRecordName);
|
|
263
214
|
}
|
|
264
|
-
|
|
265
215
|
function genExpandedRowKey() {
|
|
266
216
|
let recordKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
267
217
|
let suffix = arguments.length > 1 ? arguments[1] : undefined;
|
|
268
|
-
|
|
269
218
|
if (suffix === undefined) {
|
|
270
219
|
suffix = '__expanded_row';
|
|
271
220
|
}
|
|
272
|
-
|
|
273
221
|
return recordKey + suffix;
|
|
274
222
|
}
|
|
275
|
-
|
|
276
223
|
function getDefaultVirtualizedRowConfig() {
|
|
277
224
|
let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
278
225
|
let sectionRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
279
226
|
const config = {};
|
|
280
|
-
|
|
281
227
|
if (size === 'small') {
|
|
282
228
|
config.height = sectionRow ? _constants.numbers.DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT : _constants.numbers.DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT;
|
|
283
229
|
config.minHeight = _constants.numbers.DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT;
|
|
@@ -288,14 +234,11 @@ function getDefaultVirtualizedRowConfig() {
|
|
|
288
234
|
config.height = sectionRow ? _constants.numbers.DEFAULT_VIRTUALIZED_SECTION_ROW_HEIGHT : _constants.numbers.DEFAULT_VIRTUALIZED_ROW_HEIGHT;
|
|
289
235
|
config.minHeight = _constants.numbers.DEFAULT_VIRTUALIZED_ROW_MIN_HEIGHT;
|
|
290
236
|
}
|
|
291
|
-
|
|
292
237
|
return config;
|
|
293
238
|
}
|
|
294
|
-
|
|
295
239
|
function flattenColumns(cols) {
|
|
296
240
|
let childrenColumnName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';
|
|
297
241
|
const list = [];
|
|
298
|
-
|
|
299
242
|
if (Array.isArray(cols) && cols.length) {
|
|
300
243
|
for (const col of cols) {
|
|
301
244
|
if (Array.isArray(col[childrenColumnName]) && col[childrenColumnName].length) {
|
|
@@ -306,10 +249,8 @@ function flattenColumns(cols) {
|
|
|
306
249
|
}
|
|
307
250
|
}
|
|
308
251
|
}
|
|
309
|
-
|
|
310
252
|
return list;
|
|
311
253
|
}
|
|
312
|
-
|
|
313
254
|
function assignColumnKeys(columns) {
|
|
314
255
|
let childrenColumnName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';
|
|
315
256
|
let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -318,32 +259,25 @@ function assignColumnKeys(columns) {
|
|
|
318
259
|
if (column.key == null) {
|
|
319
260
|
// if user give column a dataIndex, use it for backup
|
|
320
261
|
const _index = column.dataIndex || index;
|
|
321
|
-
|
|
322
262
|
column.key = `${level}-${_index}`;
|
|
323
263
|
}
|
|
324
|
-
|
|
325
264
|
if (Array.isArray(column[childrenColumnName]) && column[childrenColumnName].length) {
|
|
326
265
|
sameLevelCols.push(...column[childrenColumnName]);
|
|
327
266
|
}
|
|
328
267
|
});
|
|
329
|
-
|
|
330
268
|
if (sameLevelCols.length) {
|
|
331
269
|
assignColumnKeys(sameLevelCols, childrenColumnName, level + 1);
|
|
332
270
|
}
|
|
333
|
-
|
|
334
271
|
return columns;
|
|
335
272
|
}
|
|
336
|
-
|
|
337
273
|
function sliceColumnsByLevel(columns) {
|
|
338
274
|
let targetLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
339
275
|
let childrenColumnName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
|
|
340
276
|
let currentLevel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
341
277
|
const slicedColumns = [];
|
|
342
|
-
|
|
343
278
|
if (Array.isArray(columns) && columns.length && currentLevel <= targetLevel) {
|
|
344
279
|
columns.forEach(column => {
|
|
345
280
|
const children = column[childrenColumnName];
|
|
346
|
-
|
|
347
281
|
if (Array.isArray(children) && children.length && currentLevel < targetLevel) {
|
|
348
282
|
slicedColumns.push(...sliceColumnsByLevel(children, targetLevel, childrenColumnName, currentLevel + 1));
|
|
349
283
|
} else {
|
|
@@ -351,16 +285,13 @@ function sliceColumnsByLevel(columns) {
|
|
|
351
285
|
}
|
|
352
286
|
});
|
|
353
287
|
}
|
|
354
|
-
|
|
355
288
|
return slicedColumns;
|
|
356
289
|
}
|
|
357
|
-
|
|
358
290
|
function getColumnsByLevel(columns) {
|
|
359
291
|
let targetLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
360
292
|
let targetColumns = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
361
293
|
let currentLevel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
362
294
|
let childrenColumnName = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'children';
|
|
363
|
-
|
|
364
295
|
if (Array.isArray(columns) && columns.length) {
|
|
365
296
|
if (targetLevel === currentLevel) {
|
|
366
297
|
targetColumns.push(...columns);
|
|
@@ -370,40 +301,32 @@ function getColumnsByLevel(columns) {
|
|
|
370
301
|
});
|
|
371
302
|
}
|
|
372
303
|
}
|
|
373
|
-
|
|
374
304
|
return targetColumns;
|
|
375
305
|
}
|
|
376
|
-
|
|
377
306
|
function getAllLevelColumns(columns) {
|
|
378
307
|
let childrenColumnName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';
|
|
379
308
|
const all = [];
|
|
380
|
-
|
|
381
309
|
if (Array.isArray(columns) && columns.length) {
|
|
382
310
|
all.push([...columns]);
|
|
383
311
|
const sameLevelColumns = [];
|
|
384
312
|
columns.forEach(column => {
|
|
385
313
|
const children = column[childrenColumnName];
|
|
386
|
-
|
|
387
314
|
if (Array.isArray(children) && children.length) {
|
|
388
315
|
sameLevelColumns.push(...children);
|
|
389
316
|
}
|
|
390
317
|
});
|
|
391
|
-
|
|
392
318
|
if (sameLevelColumns.length) {
|
|
393
319
|
all.push(sameLevelColumns);
|
|
394
320
|
}
|
|
395
321
|
}
|
|
396
|
-
|
|
397
322
|
return all;
|
|
398
323
|
}
|
|
399
|
-
|
|
400
324
|
function getColumnByLevelIndex(columns, index) {
|
|
401
325
|
let level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
402
326
|
let childrenColumnName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'children';
|
|
403
327
|
const allLevelColumns = getAllLevelColumns(columns, childrenColumnName);
|
|
404
328
|
return allLevelColumns[level][index];
|
|
405
329
|
}
|
|
406
|
-
|
|
407
330
|
function findColumn(columns, column) {
|
|
408
331
|
let childrenColumnName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
|
|
409
332
|
let found;
|
|
@@ -413,20 +336,16 @@ function findColumn(columns, column) {
|
|
|
413
336
|
found = item;
|
|
414
337
|
}
|
|
415
338
|
}
|
|
416
|
-
|
|
417
339
|
if (item && Array.isArray(item[childrenColumnName]) && !found) {
|
|
418
340
|
found = findColumn(item[childrenColumnName], column, childrenColumnName);
|
|
419
341
|
}
|
|
420
|
-
|
|
421
342
|
if (found) {
|
|
422
343
|
return false;
|
|
423
344
|
}
|
|
424
|
-
|
|
425
345
|
return undefined;
|
|
426
346
|
});
|
|
427
347
|
return found;
|
|
428
348
|
}
|
|
429
|
-
|
|
430
349
|
function expandBtnShouldInRow(props) {
|
|
431
350
|
const {
|
|
432
351
|
expandedRowRender,
|
|
@@ -438,7 +357,6 @@ function expandBtnShouldInRow(props) {
|
|
|
438
357
|
const hasExpandedRowRender = typeof expandedRowRender === 'function';
|
|
439
358
|
return hideExpandedColumn && hasExpandedRowRender || !hasExpandedRowRender && dataSource.some(record => {
|
|
440
359
|
const children = (0, _get2.default)(record, childrenRecordName);
|
|
441
|
-
|
|
442
360
|
if (Array.isArray(children) && children.length || rowExpandable(record)) {
|
|
443
361
|
return true;
|
|
444
362
|
} else {
|
|
@@ -451,28 +369,21 @@ function expandBtnShouldInRow(props) {
|
|
|
451
369
|
* @param {*} query
|
|
452
370
|
* @param {*} queries
|
|
453
371
|
*/
|
|
454
|
-
|
|
455
|
-
|
|
456
372
|
function mergeQueries(query) {
|
|
457
373
|
let queries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
458
|
-
|
|
459
374
|
let _mergedQuery;
|
|
460
|
-
|
|
461
375
|
const idx = queries.findIndex(item => {
|
|
462
376
|
if (query.dataIndex === item.dataIndex) {
|
|
463
377
|
_mergedQuery = Object.assign(Object.assign({}, item), query);
|
|
464
378
|
return true;
|
|
465
379
|
}
|
|
466
|
-
|
|
467
380
|
return false;
|
|
468
381
|
});
|
|
469
|
-
|
|
470
382
|
if (idx > -1) {
|
|
471
383
|
queries.splice(idx, 1, _mergedQuery);
|
|
472
384
|
} else {
|
|
473
385
|
queries.push(_mergedQuery);
|
|
474
386
|
}
|
|
475
|
-
|
|
476
387
|
return [...queries];
|
|
477
388
|
}
|
|
478
389
|
/**
|
|
@@ -480,30 +391,23 @@ function mergeQueries(query) {
|
|
|
480
391
|
* @param {Object[]} columns columns retain the column width after resize
|
|
481
392
|
* @param {Object[]} newColumns
|
|
482
393
|
*/
|
|
483
|
-
|
|
484
|
-
|
|
485
394
|
function withResizeWidth(columns, newColumns) {
|
|
486
395
|
const _newColumns = Object.assign({}, newColumns);
|
|
487
|
-
|
|
488
396
|
for (const column of columns) {
|
|
489
397
|
if (!(0, _isNullOrUndefined.default)(column.width)) {
|
|
490
398
|
const currentColumn = column.key;
|
|
491
399
|
const columnIndex = (0, _findIndex2.default)(_newColumns, item => item.key === currentColumn);
|
|
492
|
-
|
|
493
400
|
if (columnIndex !== -1) {
|
|
494
401
|
_newColumns[columnIndex].width = (0, _get2.default)(column, 'width');
|
|
495
402
|
}
|
|
496
403
|
}
|
|
497
404
|
}
|
|
498
|
-
|
|
499
405
|
return _newColumns;
|
|
500
406
|
}
|
|
501
407
|
/**
|
|
502
408
|
* Pure function version of the same function in table foundation
|
|
503
409
|
* This is not accessible in getDerivedStateFromProps, so fork one out
|
|
504
410
|
*/
|
|
505
|
-
|
|
506
|
-
|
|
507
411
|
function getAllDisabledRowKeys(_ref) {
|
|
508
412
|
let {
|
|
509
413
|
dataSource,
|
|
@@ -512,18 +416,14 @@ function getAllDisabledRowKeys(_ref) {
|
|
|
512
416
|
rowKey
|
|
513
417
|
} = _ref;
|
|
514
418
|
const disabledRowKeys = [];
|
|
515
|
-
|
|
516
419
|
if (Array.isArray(dataSource) && dataSource.length && typeof getCheckboxProps === 'function') {
|
|
517
420
|
for (const record of dataSource) {
|
|
518
421
|
const props = getCheckboxProps(record);
|
|
519
422
|
const recordKey = typeof rowKey === 'function' ? rowKey(record) : (0, _get2.default)(record, rowKey);
|
|
520
|
-
|
|
521
423
|
if (props && props.disabled) {
|
|
522
424
|
disabledRowKeys.push(recordKey);
|
|
523
425
|
}
|
|
524
|
-
|
|
525
426
|
const children = (0, _get2.default)(record, childrenRecordName);
|
|
526
|
-
|
|
527
427
|
if (Array.isArray(children) && children.length) {
|
|
528
428
|
const keys = getAllDisabledRowKeys({
|
|
529
429
|
dataSource: children,
|
|
@@ -533,10 +433,8 @@ function getAllDisabledRowKeys(_ref) {
|
|
|
533
433
|
}
|
|
534
434
|
}
|
|
535
435
|
}
|
|
536
|
-
|
|
537
436
|
return disabledRowKeys;
|
|
538
437
|
}
|
|
539
|
-
|
|
540
438
|
function warnIfNoDataIndex(column) {
|
|
541
439
|
if (typeof column === 'object' && column !== null) {
|
|
542
440
|
const {
|
|
@@ -546,7 +444,6 @@ function warnIfNoDataIndex(column) {
|
|
|
546
444
|
onFilter
|
|
547
445
|
} = column;
|
|
548
446
|
const logger = new _Logger.default('[@douyinfe/semi-ui Table]');
|
|
549
|
-
|
|
550
447
|
if ((Array.isArray(filters) || (0, _isFunction2.default)(onFilter) || (0, _isFunction2.default)(sorter)) && (0, _isNullOrUndefined.default)(dataIndex)) {
|
|
551
448
|
logger.warn(`The column with sorter or filter must pass the 'dataIndex' prop`);
|
|
552
449
|
}
|
|
@@ -555,46 +452,36 @@ function warnIfNoDataIndex(column) {
|
|
|
555
452
|
/**
|
|
556
453
|
* Whether is tree table
|
|
557
454
|
*/
|
|
558
|
-
|
|
559
|
-
|
|
560
455
|
function isTreeTable(_ref2) {
|
|
561
456
|
let {
|
|
562
457
|
dataSource,
|
|
563
458
|
childrenRecordName = 'children'
|
|
564
459
|
} = _ref2;
|
|
565
460
|
let flag = false;
|
|
566
|
-
|
|
567
461
|
if (Array.isArray(dataSource)) {
|
|
568
462
|
for (const data of dataSource) {
|
|
569
463
|
const children = (0, _get2.default)(data, childrenRecordName);
|
|
570
|
-
|
|
571
464
|
if (Array.isArray(children) && children.length) {
|
|
572
465
|
flag = true;
|
|
573
466
|
break;
|
|
574
467
|
}
|
|
575
468
|
}
|
|
576
469
|
}
|
|
577
|
-
|
|
578
470
|
return flag;
|
|
579
471
|
}
|
|
580
|
-
|
|
581
472
|
function getRTLAlign(align, direction) {
|
|
582
473
|
if (direction === 'rtl') {
|
|
583
474
|
switch (align) {
|
|
584
475
|
case 'left':
|
|
585
476
|
return 'right';
|
|
586
|
-
|
|
587
477
|
case 'right':
|
|
588
478
|
return 'left';
|
|
589
|
-
|
|
590
479
|
default:
|
|
591
480
|
return align;
|
|
592
481
|
}
|
|
593
482
|
}
|
|
594
|
-
|
|
595
483
|
return align;
|
|
596
484
|
}
|
|
597
|
-
|
|
598
485
|
function shouldShowEllipsisTitle(ellipsis) {
|
|
599
486
|
const shouldShowTitle = ellipsis === true || (0, _get2.default)(ellipsis, 'showTitle', true);
|
|
600
487
|
return shouldShowTitle;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
7
|
-
|
|
8
7
|
var _constants = require("../base/constants");
|
|
9
|
-
|
|
10
8
|
const cssClasses = {
|
|
11
9
|
TABS: `${_constants.BASE_CLASS_PREFIX}-tabs`,
|
|
12
10
|
TABS_BAR: `${_constants.BASE_CLASS_PREFIX}-tabs-bar`,
|