@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
package/lib/cjs/cascader/util.js
CHANGED
|
@@ -8,25 +8,17 @@ exports.convertDataToEntities = convertDataToEntities;
|
|
|
8
8
|
exports.findKeysForValues = findKeysForValues;
|
|
9
9
|
exports.isValid = isValid;
|
|
10
10
|
exports.normalizedArr = normalizedArr;
|
|
11
|
-
|
|
12
11
|
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
13
|
-
|
|
14
12
|
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
|
|
15
|
-
|
|
16
13
|
var _isNull2 = _interopRequireDefault(require("lodash/isNull"));
|
|
17
|
-
|
|
18
14
|
var _constants = require("./constants");
|
|
19
|
-
|
|
20
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
16
|
function getPosition(level, index) {
|
|
23
17
|
return `${level}-${index}`;
|
|
24
18
|
}
|
|
25
|
-
|
|
26
19
|
function isValid(val) {
|
|
27
20
|
return !(0, _isNull2.default)(val) && !(0, _isUndefined2.default)(val);
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
function normalizedArr(val) {
|
|
31
23
|
if (!Array.isArray(val)) {
|
|
32
24
|
return [val];
|
|
@@ -37,13 +29,11 @@ function normalizedArr(val) {
|
|
|
37
29
|
/**
|
|
38
30
|
* Traverse all the data by `treeData`.
|
|
39
31
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
32
|
function traverseDataNodes(treeNodes, callback) {
|
|
43
33
|
const processNode = (node, ind, parent) => {
|
|
44
34
|
const children = node ? node.children : treeNodes;
|
|
45
|
-
let item = null;
|
|
46
|
-
|
|
35
|
+
let item = null;
|
|
36
|
+
// Process node if is not root
|
|
47
37
|
if (node) {
|
|
48
38
|
const key = parent ? getPosition(parent.key, ind) : `${ind}`;
|
|
49
39
|
item = {
|
|
@@ -56,19 +46,16 @@ function traverseDataNodes(treeNodes, callback) {
|
|
|
56
46
|
valuePath: parent ? [...parent.valuePath, node.value] : [node.value]
|
|
57
47
|
};
|
|
58
48
|
callback(item);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
}
|
|
50
|
+
// Process children node
|
|
62
51
|
if (children) {
|
|
63
52
|
children.forEach((subNode, subIndex) => {
|
|
64
53
|
processNode(subNode, subIndex, item);
|
|
65
54
|
});
|
|
66
55
|
}
|
|
67
56
|
};
|
|
68
|
-
|
|
69
57
|
processNode(null);
|
|
70
58
|
}
|
|
71
|
-
|
|
72
59
|
function convertDataToEntities(dataNodes) {
|
|
73
60
|
const keyEntities = {};
|
|
74
61
|
traverseDataNodes(dataNodes, data => {
|
|
@@ -77,10 +64,9 @@ function convertDataToEntities(dataNodes) {
|
|
|
77
64
|
parentKey
|
|
78
65
|
} = data;
|
|
79
66
|
const entity = Object.assign({}, data);
|
|
80
|
-
keyEntities[key] = entity;
|
|
81
|
-
|
|
67
|
+
keyEntities[key] = entity;
|
|
68
|
+
// Fill children
|
|
82
69
|
entity.parent = keyEntities[parentKey];
|
|
83
|
-
|
|
84
70
|
if (entity.parent) {
|
|
85
71
|
entity.parent.children = entity.parent.children || [];
|
|
86
72
|
entity.parent.children.push(entity);
|
|
@@ -88,16 +74,13 @@ function convertDataToEntities(dataNodes) {
|
|
|
88
74
|
});
|
|
89
75
|
return keyEntities;
|
|
90
76
|
}
|
|
91
|
-
|
|
92
77
|
function findKeysForValues(value, keyEntities) {
|
|
93
78
|
const valuePath = normalizedArr(value);
|
|
94
79
|
const res = Object.values(keyEntities).filter(item => (0, _isEqual2.default)(item.valuePath, valuePath)).map(item => item.key);
|
|
95
80
|
return res;
|
|
96
81
|
}
|
|
97
|
-
|
|
98
82
|
function calcMergeType(autoMergeValue, leafOnly) {
|
|
99
83
|
let mergeType;
|
|
100
|
-
|
|
101
84
|
if (leafOnly) {
|
|
102
85
|
mergeType = _constants.strings.LEAF_ONLY_MERGE_TYPE;
|
|
103
86
|
} else if (autoMergeValue) {
|
|
@@ -105,6 +88,5 @@ function calcMergeType(autoMergeValue, leafOnly) {
|
|
|
105
88
|
} else {
|
|
106
89
|
mergeType = _constants.strings.NONE_MERGE_TYPE;
|
|
107
90
|
}
|
|
108
|
-
|
|
109
91
|
return mergeType;
|
|
110
92
|
}
|
|
@@ -4,31 +4,23 @@ 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
|
var _isEnterPress = _interopRequireDefault(require("../utils/isEnterPress"));
|
|
11
|
-
|
|
12
9
|
var _warning = _interopRequireDefault(require("../utils/warning"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
class CheckboxFoundation extends _foundation.default {
|
|
17
12
|
constructor(adapter) {
|
|
18
13
|
super(Object.assign({}, adapter));
|
|
19
14
|
this.clickState = false;
|
|
20
|
-
|
|
21
15
|
this.handleFocusVisible = event => {
|
|
22
16
|
const {
|
|
23
17
|
target
|
|
24
18
|
} = event;
|
|
25
|
-
|
|
26
19
|
try {
|
|
27
20
|
if (this.clickState) {
|
|
28
21
|
this.clickState = false;
|
|
29
22
|
return;
|
|
30
23
|
}
|
|
31
|
-
|
|
32
24
|
if (target.matches(':focus-visible')) {
|
|
33
25
|
this._adapter.setFocusVisible(true);
|
|
34
26
|
}
|
|
@@ -36,14 +28,11 @@ class CheckboxFoundation extends _foundation.default {
|
|
|
36
28
|
(0, _warning.default)(true, 'Warning: [Semi Checkbox] The current browser does not support the focus-visible');
|
|
37
29
|
}
|
|
38
30
|
};
|
|
39
|
-
|
|
40
31
|
this.handleBlur = () => {
|
|
41
32
|
this.clickState = false;
|
|
42
|
-
|
|
43
33
|
this._adapter.setFocusVisible(false);
|
|
44
34
|
};
|
|
45
35
|
}
|
|
46
|
-
|
|
47
36
|
init() {
|
|
48
37
|
const {
|
|
49
38
|
children,
|
|
@@ -51,50 +40,36 @@ class CheckboxFoundation extends _foundation.default {
|
|
|
51
40
|
extraId,
|
|
52
41
|
addonId
|
|
53
42
|
} = this.getProps();
|
|
54
|
-
|
|
55
43
|
if (children && !addonId) {
|
|
56
44
|
this._adapter.setAddonId();
|
|
57
45
|
}
|
|
58
|
-
|
|
59
46
|
if (extra && !extraId) {
|
|
60
47
|
this._adapter.setExtraId();
|
|
61
48
|
}
|
|
62
49
|
}
|
|
63
|
-
|
|
64
50
|
notifyChange(checked, e) {
|
|
65
51
|
const cbValue = this._adapter.generateEvent(checked, e);
|
|
66
|
-
|
|
67
52
|
this._adapter.notifyChange(cbValue);
|
|
68
53
|
}
|
|
69
|
-
|
|
70
54
|
handleChange(e) {
|
|
71
55
|
const disabled = this.getProp('disabled');
|
|
72
|
-
|
|
73
56
|
if (disabled) {
|
|
74
57
|
return;
|
|
75
58
|
}
|
|
76
|
-
|
|
77
59
|
if ((e === null || e === void 0 ? void 0 : e.type) === 'click') {
|
|
78
60
|
this.clickState = true;
|
|
79
61
|
}
|
|
80
|
-
|
|
81
62
|
this._adapter.focusCheckboxEntity();
|
|
82
|
-
|
|
83
63
|
const isInGroup = this._adapter.getIsInGroup();
|
|
84
|
-
|
|
85
64
|
if (isInGroup) {
|
|
86
65
|
const groupDisabled = this._adapter.getGroupDisabled();
|
|
87
|
-
|
|
88
66
|
if (!groupDisabled) {
|
|
89
67
|
this.handleChangeInGroup(e);
|
|
90
68
|
}
|
|
91
|
-
|
|
92
69
|
return;
|
|
93
70
|
}
|
|
94
|
-
|
|
95
71
|
const checked = this.getState('checked');
|
|
96
72
|
const newChecked = !checked;
|
|
97
|
-
|
|
98
73
|
if (this._isControlledComponent('checked')) {
|
|
99
74
|
this.notifyChange(newChecked, e);
|
|
100
75
|
} else {
|
|
@@ -102,38 +77,27 @@ class CheckboxFoundation extends _foundation.default {
|
|
|
102
77
|
this.notifyChange(newChecked, e);
|
|
103
78
|
}
|
|
104
79
|
}
|
|
105
|
-
|
|
106
80
|
handleChangeInGroup(e) {
|
|
107
81
|
const {
|
|
108
82
|
value
|
|
109
83
|
} = this.getProps();
|
|
110
|
-
|
|
111
84
|
const groupValue = this._adapter.getGroupValue();
|
|
112
|
-
|
|
113
85
|
const checked = groupValue.includes(value);
|
|
114
86
|
const newChecked = !checked;
|
|
115
|
-
|
|
116
87
|
const event = this._adapter.generateEvent(newChecked, e);
|
|
117
|
-
|
|
118
88
|
this._adapter.notifyChange(event);
|
|
119
|
-
|
|
120
89
|
this._adapter.notifyGroupChange(event);
|
|
121
90
|
}
|
|
122
|
-
|
|
123
91
|
handleEnterPress(e) {
|
|
124
92
|
if ((0, _isEnterPress.default)(e)) {
|
|
125
93
|
this.handleChange(e);
|
|
126
94
|
}
|
|
127
95
|
}
|
|
128
|
-
|
|
129
96
|
setChecked(checked) {
|
|
130
97
|
this._adapter.setNativeControlChecked(checked);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
98
|
+
}
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
134
100
|
destroy() {}
|
|
135
|
-
|
|
136
101
|
}
|
|
137
|
-
|
|
138
102
|
var _default = CheckboxFoundation;
|
|
139
103
|
exports.default = _default;
|
|
@@ -4,74 +4,57 @@ 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
|
var _warning = _interopRequireDefault(require("../utils/warning"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
class CheckboxGroupFoundation extends _foundation.default {
|
|
15
11
|
static get checkboxGroupDefaultAdapter() {
|
|
16
12
|
return {};
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
constructor(adapter) {
|
|
20
15
|
super(Object.assign(Object.assign({}, CheckboxGroupFoundation.checkboxGroupDefaultAdapter), adapter));
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
init() {
|
|
24
18
|
const {
|
|
25
19
|
defaultValue,
|
|
26
20
|
value
|
|
27
21
|
} = this.getProps();
|
|
28
|
-
|
|
29
22
|
if (typeof defaultValue !== 'undefined' && !Array.isArray(defaultValue)) {
|
|
30
23
|
(0, _warning.default)(true, 'Warning: [Semi CheckboxGroup] defaultValue should be an Array');
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
if (typeof value !== 'undefined' && !Array.isArray(value)) {
|
|
34
26
|
(0, _warning.default)(true, 'Warning: [Semi CheckboxGroup] value should be an Array');
|
|
35
27
|
}
|
|
36
28
|
}
|
|
37
|
-
|
|
38
29
|
notifyChange(value) {
|
|
39
30
|
this._adapter.notifyChange(value);
|
|
40
31
|
}
|
|
41
|
-
|
|
42
32
|
handleChange(evt) {
|
|
43
33
|
const prevValue = this.getState('value');
|
|
44
34
|
let newValue = [];
|
|
45
|
-
|
|
46
35
|
if (!Array.isArray(prevValue)) {
|
|
47
36
|
newValue = [prevValue];
|
|
48
37
|
}
|
|
49
|
-
|
|
50
38
|
if (evt.target.checked) {
|
|
51
39
|
newValue = [...prevValue, evt.target.value];
|
|
52
40
|
} else {
|
|
53
41
|
newValue = prevValue.filter((itm, idx) => itm !== evt.target.value);
|
|
54
42
|
}
|
|
55
|
-
|
|
56
43
|
const isControlledMode = ('value' in this.getProps());
|
|
57
|
-
|
|
58
44
|
if (isControlledMode) {
|
|
59
45
|
// Controlled mode only needs to notify
|
|
60
46
|
this.notifyChange(newValue);
|
|
61
47
|
} else {
|
|
62
48
|
// In uncontrolled mode, update the value in the state, and then notify
|
|
63
49
|
this._adapter.updateGroupValue(newValue);
|
|
64
|
-
|
|
65
50
|
this.notifyChange(newValue);
|
|
66
51
|
}
|
|
67
52
|
}
|
|
68
|
-
|
|
69
53
|
getFormatName() {
|
|
70
54
|
const propName = this.getProp('name');
|
|
71
55
|
const defaultName = 'default';
|
|
72
56
|
return propName || defaultName;
|
|
73
57
|
}
|
|
74
|
-
|
|
75
58
|
handlePropValueChange(newPropValue) {
|
|
76
59
|
if (Array.isArray(newPropValue)) {
|
|
77
60
|
this._adapter.updateGroupValue(newPropValue);
|
|
@@ -80,15 +63,11 @@ class CheckboxGroupFoundation extends _foundation.default {
|
|
|
80
63
|
if (typeof newPropValue === 'undefined') {
|
|
81
64
|
this._adapter.updateGroupValue([]);
|
|
82
65
|
}
|
|
83
|
-
|
|
84
66
|
(0, _warning.default)(true, 'Warning: [Semi CheckboxGroup] value should be an Array');
|
|
85
67
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
68
|
+
}
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
89
70
|
destroy() {}
|
|
90
|
-
|
|
91
71
|
}
|
|
92
|
-
|
|
93
72
|
var _default = CheckboxGroupFoundation;
|
|
94
73
|
exports.default = _default;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.strings = exports.numbers = exports.checkboxGroupClasses = exports.checkboxClasses = void 0;
|
|
7
|
-
|
|
8
7
|
var _constants = require("../base/constants");
|
|
9
|
-
|
|
10
8
|
const checkboxClasses = {
|
|
11
9
|
PREFIX: `${_constants.BASE_CLASS_PREFIX}-checkbox`,
|
|
12
10
|
INNER: `${_constants.BASE_CLASS_PREFIX}-checkbox-inner`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
2
|
-
export
|
|
2
|
+
export type ArgsType<T> = T extends (...args: infer A) => any ? A : never;
|
|
3
3
|
export interface CollapseProps {
|
|
4
4
|
activeKey?: string | string[];
|
|
5
5
|
defaultActiveKey?: string | string[];
|
|
@@ -4,16 +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 CollapseFoundation extends _foundation.default {
|
|
13
10
|
constructor(adapter) {
|
|
14
11
|
super(Object.assign({}, adapter));
|
|
15
12
|
}
|
|
16
|
-
|
|
17
13
|
initActiveKey() {
|
|
18
14
|
const {
|
|
19
15
|
defaultActiveKey,
|
|
@@ -21,17 +17,15 @@ class CollapseFoundation extends _foundation.default {
|
|
|
21
17
|
accordion
|
|
22
18
|
} = this.getProps();
|
|
23
19
|
let activeKeyList = activeKey ? activeKey : defaultActiveKey;
|
|
24
|
-
|
|
25
20
|
if (accordion) {
|
|
26
21
|
activeKeyList = Array.isArray(activeKeyList) ? activeKeyList[0] : activeKeyList;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
if (activeKeyList && activeKeyList.length) {
|
|
30
24
|
activeKeyList = Array.isArray(activeKeyList) ? activeKeyList : [activeKeyList];
|
|
31
25
|
return activeKeyList;
|
|
32
26
|
}
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
return [];
|
|
28
|
+
// this._adapter.initActiveSet(activeKeyList);
|
|
35
29
|
}
|
|
36
30
|
|
|
37
31
|
handleChange(newKey, e) {
|
|
@@ -43,7 +37,6 @@ class CollapseFoundation extends _foundation.default {
|
|
|
43
37
|
activeSet
|
|
44
38
|
} = this.getStates();
|
|
45
39
|
let newSet = new Set(activeSet);
|
|
46
|
-
|
|
47
40
|
if (newSet.has(newKey)) {
|
|
48
41
|
newSet.delete(newKey);
|
|
49
42
|
} else {
|
|
@@ -53,14 +46,10 @@ class CollapseFoundation extends _foundation.default {
|
|
|
53
46
|
newSet.add(newKey);
|
|
54
47
|
}
|
|
55
48
|
}
|
|
56
|
-
|
|
57
49
|
this._adapter.handleChange([...newSet.values()], e);
|
|
58
|
-
|
|
59
50
|
if (typeof activeKey === 'undefined') {
|
|
60
51
|
this._adapter.addActiveKey(newSet);
|
|
61
52
|
}
|
|
62
53
|
}
|
|
63
|
-
|
|
64
54
|
}
|
|
65
|
-
|
|
66
55
|
exports.default = CollapseFoundation;
|
|
@@ -4,33 +4,24 @@ 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 CollapsibleFoundation extends _foundation.default {
|
|
13
10
|
constructor(adapter) {
|
|
14
11
|
super(Object.assign({}, adapter));
|
|
15
|
-
|
|
16
12
|
this.updateDOMInRenderTree = isInRenderTree => {
|
|
17
13
|
this._adapter.setDOMInRenderTree(isInRenderTree);
|
|
18
14
|
};
|
|
19
|
-
|
|
20
15
|
this.updateDOMHeight = domHeight => {
|
|
21
16
|
this._adapter.setDOMHeight(domHeight);
|
|
22
17
|
};
|
|
23
|
-
|
|
24
18
|
this.updateVisible = visible => {
|
|
25
19
|
this._adapter.setVisible(visible);
|
|
26
20
|
};
|
|
27
|
-
|
|
28
21
|
this.updateIsTransitioning = isTransitioning => {
|
|
29
22
|
this._adapter.setIsTransitioning(isTransitioning);
|
|
30
23
|
};
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
}
|
|
34
|
-
|
|
35
26
|
var _default = CollapsibleFoundation;
|
|
36
27
|
exports.default = _default;
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.formatDateValues = formatDateValues;
|
|
7
|
-
|
|
8
7
|
var _dateFns = require("date-fns");
|
|
9
|
-
|
|
10
8
|
var _constants = require("../constants");
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* @file
|
|
14
11
|
* Date-related formatting display method
|
|
@@ -30,23 +27,21 @@ function formatDateValues(values, formatToken) {
|
|
|
30
27
|
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
31
28
|
let locale = arguments.length > 3 ? arguments[3] : undefined;
|
|
32
29
|
let text = '';
|
|
33
|
-
(groupSize <= 0 || typeof groupSize !== 'number') && (groupSize = 1);
|
|
34
|
-
|
|
30
|
+
(groupSize <= 0 || typeof groupSize !== 'number') && (groupSize = 1);
|
|
31
|
+
// console.log(values, formatToken, groupInnerSeparator, groupSize, groupSeparator);
|
|
35
32
|
if (Array.isArray(values) && values.length) {
|
|
36
33
|
const groups = [];
|
|
37
34
|
const {
|
|
38
35
|
length
|
|
39
|
-
} = values;
|
|
40
|
-
|
|
36
|
+
} = values;
|
|
37
|
+
// chunk
|
|
41
38
|
for (let i = 0; i < length; i++) {
|
|
42
39
|
if (i % groupSize === 0) {
|
|
43
40
|
groups.push([]);
|
|
44
41
|
}
|
|
45
|
-
|
|
46
42
|
const curArrIdx = Math.floor(i / groupSize);
|
|
47
43
|
groups[curArrIdx].push(values[i]);
|
|
48
44
|
}
|
|
49
|
-
|
|
50
45
|
text = groups.map(arr => arr.map(v => {
|
|
51
46
|
if (v) {
|
|
52
47
|
// console.log(`formatDateValues() -> formatDateValues: ${v}`);
|
|
@@ -58,6 +53,5 @@ function formatDateValues(values, formatToken) {
|
|
|
58
53
|
}
|
|
59
54
|
}).join(groupInnerSeparator)).join(groupSeparator);
|
|
60
55
|
}
|
|
61
|
-
|
|
62
56
|
return text;
|
|
63
57
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* the index of the first day of the week (0-Sunday,1-Monday, etc)
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
type WeekStartNumber = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
8
8
|
declare const getDayofWeek: ({ weekStartsOn }: {
|
|
9
9
|
weekStartsOn: WeekStartNumber;
|
|
10
10
|
}) => string[];
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
*
|
|
10
9
|
* @param {number} weekStartsOn
|
|
@@ -16,13 +15,10 @@ const getDayofWeek = _ref => {
|
|
|
16
15
|
weekStartsOn = 0
|
|
17
16
|
} = _ref;
|
|
18
17
|
const weekDay = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
19
|
-
|
|
20
18
|
for (let index = 0; index < weekStartsOn; index++) {
|
|
21
19
|
weekDay.push(weekDay.shift());
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
return weekDay;
|
|
25
22
|
};
|
|
26
|
-
|
|
27
23
|
var _default = getDayofWeek;
|
|
28
24
|
exports.default = _default;
|
|
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.getDefaultFormatTokenByType = getDefaultFormatTokenByType;
|
|
8
|
-
|
|
9
8
|
var _constants = require("../constants");
|
|
10
|
-
|
|
11
9
|
const defaultFormatTokens = {
|
|
12
10
|
date: _constants.strings.FORMAT_FULL_DATE,
|
|
13
11
|
dateTime: _constants.strings.FORMAT_DATE_TIME,
|
|
@@ -16,12 +14,9 @@ const defaultFormatTokens = {
|
|
|
16
14
|
month: _constants.strings.FORMAT_YEAR_MONTH,
|
|
17
15
|
monthRange: _constants.strings.FORMAT_YEAR_MONTH
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
const getDefaultFormatToken = type => defaultFormatTokens;
|
|
21
|
-
|
|
22
18
|
function getDefaultFormatTokenByType(type) {
|
|
23
19
|
return type && defaultFormatTokens[type];
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
var _default = getDefaultFormatToken;
|
|
27
22
|
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ export default function getDefaultPickerDate(options: GetDefaultPickerValueDateO
|
|
|
6
6
|
nowDate: Date;
|
|
7
7
|
nextDate: Date;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type BaseValueType = string | number | Date;
|
|
10
10
|
interface GetDefaultPickerValueDateOptions {
|
|
11
11
|
defaultPickerValue?: BaseValueType | BaseValueType[];
|
|
12
12
|
format: string;
|
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = getDefaultPickerDate;
|
|
7
|
-
|
|
8
7
|
var _dateFns = require("date-fns");
|
|
9
|
-
|
|
10
8
|
var _isValidDate = _interopRequireDefault(require("./isValidDate"));
|
|
11
|
-
|
|
12
9
|
var _parser = require("./parser");
|
|
13
|
-
|
|
14
10
|
var _isTimestamp = _interopRequireDefault(require("./isTimestamp"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
/**
|
|
19
13
|
* get left panel picker date and right panel picker date
|
|
20
14
|
*/
|
|
@@ -26,41 +20,32 @@ function getDefaultPickerDate(options) {
|
|
|
26
20
|
} = options;
|
|
27
21
|
let nowDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[0] : defaultPickerValue;
|
|
28
22
|
let nextDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[1] : undefined;
|
|
29
|
-
|
|
30
23
|
switch (true) {
|
|
31
24
|
case (0, _isValidDate.default)(nowDate):
|
|
32
25
|
break;
|
|
33
|
-
|
|
34
26
|
case (0, _isTimestamp.default)(nowDate):
|
|
35
27
|
nowDate = new Date(nowDate);
|
|
36
28
|
break;
|
|
37
|
-
|
|
38
29
|
case typeof nowDate === 'string':
|
|
39
30
|
nowDate = (0, _parser.compatibleParse)(nowDate, format, undefined, dateFnsLocale);
|
|
40
31
|
break;
|
|
41
|
-
|
|
42
32
|
default:
|
|
43
33
|
nowDate = new Date();
|
|
44
34
|
break;
|
|
45
35
|
}
|
|
46
|
-
|
|
47
36
|
switch (true) {
|
|
48
37
|
case (0, _isValidDate.default)(nextDate):
|
|
49
38
|
break;
|
|
50
|
-
|
|
51
39
|
case (0, _isTimestamp.default)(nextDate):
|
|
52
40
|
nextDate = new Date(nextDate);
|
|
53
41
|
break;
|
|
54
|
-
|
|
55
42
|
case typeof nextDate === 'string':
|
|
56
43
|
nextDate = (0, _parser.compatibleParse)(nextDate, format, undefined, dateFnsLocale);
|
|
57
44
|
break;
|
|
58
|
-
|
|
59
45
|
default:
|
|
60
46
|
nextDate = (0, _dateFns.addMonths)(nowDate, 1);
|
|
61
47
|
break;
|
|
62
48
|
}
|
|
63
|
-
|
|
64
49
|
return {
|
|
65
50
|
nowDate: nowDate,
|
|
66
51
|
nextDate: nextDate
|
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
9
|
-
|
|
10
8
|
var _constants = require("../constants");
|
|
11
|
-
|
|
12
9
|
var _dateFns = require("date-fns");
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
/**
|
|
17
12
|
* Calculate the date string offset from the date
|
|
18
13
|
* @param {*} fn
|
|
@@ -22,11 +17,9 @@ const getFullDateOffset = (fn, date) => {
|
|
|
22
17
|
if (!date) {
|
|
23
18
|
return '';
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
const getDate = new Date(date);
|
|
27
21
|
const offsetDate = (0, _isFunction2.default)(fn) ? fn(getDate) : getDate;
|
|
28
22
|
return (0, _dateFns.format)(new Date(offsetDate), _constants.strings.FORMAT_FULL_DATE);
|
|
29
23
|
};
|
|
30
|
-
|
|
31
24
|
var _default = getFullDateOffset;
|
|
32
25
|
exports.default = _default;
|