@douyinfe/semi-foundation 2.36.0-alpha.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/calendar.scss +1 -1
- package/calendar/foundation.ts +2 -1
- package/datePicker/_utils/getYears.ts +8 -4
- package/datePicker/foundation.ts +1 -1
- package/datePicker/monthsGridFoundation.ts +2 -1
- package/datePicker/yearAndMonthFoundation.ts +3 -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/calendar.css +2 -2
- package/lib/cjs/calendar/calendar.scss +1 -1
- 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.d.ts +1 -1
- package/lib/cjs/datePicker/_utils/getYears.js +9 -7
- 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 +25 -25
- 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 +5 -4
- package/lib/cjs/datePicker/monthsGridFoundation.js +43 -238
- package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +3 -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.d.ts +0 -2
- package/lib/cjs/navigation/itemFoundation.js +3 -21
- package/lib/cjs/navigation/navigation.css +7 -77
- package/lib/cjs/navigation/navigation.scss +7 -119
- package/lib/cjs/navigation/subNavFoundation.d.ts +0 -2
- 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/bacisSteps.scss +238 -287
- package/lib/cjs/steps/constants.js +0 -2
- package/lib/cjs/steps/fillSteps.scss +142 -153
- package/lib/cjs/steps/navSteps.scss +40 -61
- package/lib/cjs/steps/steps.css +17 -381
- 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 +72 -302
- package/lib/cjs/table/table.css +6 -0
- package/lib/cjs/table/table.scss +12 -0
- 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/tabs/tabs.css +14 -14
- package/lib/cjs/tabs/tabs.scss +16 -14
- 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 +2 -2
- package/lib/cjs/timePicker/foundation.js +6 -102
- 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/timeline/timeline.css +0 -36
- package/lib/cjs/timeline/timeline.scss +46 -96
- 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.d.ts +1 -0
- package/lib/cjs/typography/constants.js +1 -2
- package/lib/cjs/typography/formatNumeral.d.ts +3 -3
- package/lib/cjs/typography/formatNumeral.js +16 -32
- package/lib/cjs/typography/typography.css +120 -0
- package/lib/cjs/typography/typography.scss +131 -6
- package/lib/cjs/typography/variables.scss +48 -0
- 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/calendar.css +2 -2
- package/lib/es/calendar/calendar.scss +1 -1
- 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.d.ts +1 -1
- package/lib/es/datePicker/_utils/getYears.js +9 -6
- 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 +25 -25
- 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 +5 -4
- package/lib/es/datePicker/monthsGridFoundation.js +42 -222
- package/lib/es/datePicker/yearAndMonthFoundation.d.ts +3 -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.d.ts +0 -2
- package/lib/es/navigation/itemFoundation.js +3 -18
- package/lib/es/navigation/navigation.css +7 -77
- package/lib/es/navigation/navigation.scss +7 -119
- package/lib/es/navigation/subNavFoundation.d.ts +0 -2
- 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/steps/bacisSteps.scss +238 -287
- package/lib/es/steps/fillSteps.scss +142 -153
- package/lib/es/steps/navSteps.scss +40 -61
- package/lib/es/steps/steps.css +17 -381
- 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 +72 -309
- package/lib/es/table/table.css +6 -0
- package/lib/es/table/table.scss +12 -0
- 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/tabs/tabs.css +14 -14
- package/lib/es/tabs/tabs.scss +16 -14
- 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 +2 -2
- package/lib/es/timePicker/foundation.js +7 -95
- 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/timeline/timeline.css +0 -36
- package/lib/es/timeline/timeline.scss +46 -96
- 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/constants.d.ts +1 -0
- package/lib/es/typography/constants.js +1 -0
- package/lib/es/typography/formatNumeral.d.ts +3 -3
- package/lib/es/typography/formatNumeral.js +16 -29
- package/lib/es/typography/typography.css +120 -0
- package/lib/es/typography/typography.scss +131 -6
- package/lib/es/typography/variables.scss +48 -0
- 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/navigation/itemFoundation.ts +1 -3
- package/navigation/navigation.scss +7 -119
- package/navigation/subNavFoundation.ts +1 -3
- package/overflowList/foundation.ts +4 -4
- package/package.json +2 -2
- package/steps/bacisSteps.scss +238 -287
- package/steps/fillSteps.scss +142 -153
- package/steps/navSteps.scss +40 -61
- package/table/foundation.ts +8 -10
- package/table/table.scss +12 -0
- package/tabs/tabs.scss +16 -14
- package/timePicker/foundation.ts +4 -6
- package/timeline/timeline.scss +46 -96
- package/typography/constants.ts +1 -0
- package/typography/typography.scss +131 -6
- package/typography/variables.scss +48 -0
- package/upload/foundation.ts +8 -8
package/lib/es/cascader/util.js
CHANGED
|
@@ -2,11 +2,9 @@ import _isEqual from "lodash/isEqual";
|
|
|
2
2
|
import _isUndefined from "lodash/isUndefined";
|
|
3
3
|
import _isNull from "lodash/isNull";
|
|
4
4
|
import { strings } from './constants';
|
|
5
|
-
|
|
6
5
|
function getPosition(level, index) {
|
|
7
6
|
return `${level}-${index}`;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
export function isValid(val) {
|
|
11
9
|
return !_isNull(val) && !_isUndefined(val);
|
|
12
10
|
}
|
|
@@ -20,12 +18,11 @@ export function normalizedArr(val) {
|
|
|
20
18
|
/**
|
|
21
19
|
* Traverse all the data by `treeData`.
|
|
22
20
|
*/
|
|
23
|
-
|
|
24
21
|
function traverseDataNodes(treeNodes, callback) {
|
|
25
22
|
const processNode = (node, ind, parent) => {
|
|
26
23
|
const children = node ? node.children : treeNodes;
|
|
27
|
-
let item = null;
|
|
28
|
-
|
|
24
|
+
let item = null;
|
|
25
|
+
// Process node if is not root
|
|
29
26
|
if (node) {
|
|
30
27
|
const key = parent ? getPosition(parent.key, ind) : `${ind}`;
|
|
31
28
|
item = {
|
|
@@ -38,19 +35,16 @@ function traverseDataNodes(treeNodes, callback) {
|
|
|
38
35
|
valuePath: parent ? [...parent.valuePath, node.value] : [node.value]
|
|
39
36
|
};
|
|
40
37
|
callback(item);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
}
|
|
39
|
+
// Process children node
|
|
44
40
|
if (children) {
|
|
45
41
|
children.forEach((subNode, subIndex) => {
|
|
46
42
|
processNode(subNode, subIndex, item);
|
|
47
43
|
});
|
|
48
44
|
}
|
|
49
45
|
};
|
|
50
|
-
|
|
51
46
|
processNode(null);
|
|
52
47
|
}
|
|
53
|
-
|
|
54
48
|
export function convertDataToEntities(dataNodes) {
|
|
55
49
|
const keyEntities = {};
|
|
56
50
|
traverseDataNodes(dataNodes, data => {
|
|
@@ -59,10 +53,9 @@ export function convertDataToEntities(dataNodes) {
|
|
|
59
53
|
parentKey
|
|
60
54
|
} = data;
|
|
61
55
|
const entity = Object.assign({}, data);
|
|
62
|
-
keyEntities[key] = entity;
|
|
63
|
-
|
|
56
|
+
keyEntities[key] = entity;
|
|
57
|
+
// Fill children
|
|
64
58
|
entity.parent = keyEntities[parentKey];
|
|
65
|
-
|
|
66
59
|
if (entity.parent) {
|
|
67
60
|
entity.parent.children = entity.parent.children || [];
|
|
68
61
|
entity.parent.children.push(entity);
|
|
@@ -77,7 +70,6 @@ export function findKeysForValues(value, keyEntities) {
|
|
|
77
70
|
}
|
|
78
71
|
export function calcMergeType(autoMergeValue, leafOnly) {
|
|
79
72
|
let mergeType;
|
|
80
|
-
|
|
81
73
|
if (leafOnly) {
|
|
82
74
|
mergeType = strings.LEAF_ONLY_MERGE_TYPE;
|
|
83
75
|
} else if (autoMergeValue) {
|
|
@@ -85,6 +77,5 @@ export function calcMergeType(autoMergeValue, leafOnly) {
|
|
|
85
77
|
} else {
|
|
86
78
|
mergeType = strings.NONE_MERGE_TYPE;
|
|
87
79
|
}
|
|
88
|
-
|
|
89
80
|
return mergeType;
|
|
90
81
|
}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import BaseFoundation from '../base/foundation';
|
|
2
2
|
import isEnterPress from '../utils/isEnterPress';
|
|
3
3
|
import warning from '../utils/warning';
|
|
4
|
-
|
|
5
4
|
class CheckboxFoundation extends BaseFoundation {
|
|
6
5
|
constructor(adapter) {
|
|
7
6
|
super(Object.assign({}, adapter));
|
|
8
7
|
this.clickState = false;
|
|
9
|
-
|
|
10
8
|
this.handleFocusVisible = event => {
|
|
11
9
|
const {
|
|
12
10
|
target
|
|
13
11
|
} = event;
|
|
14
|
-
|
|
15
12
|
try {
|
|
16
13
|
if (this.clickState) {
|
|
17
14
|
this.clickState = false;
|
|
18
15
|
return;
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
if (target.matches(':focus-visible')) {
|
|
22
18
|
this._adapter.setFocusVisible(true);
|
|
23
19
|
}
|
|
@@ -25,14 +21,11 @@ class CheckboxFoundation extends BaseFoundation {
|
|
|
25
21
|
warning(true, 'Warning: [Semi Checkbox] The current browser does not support the focus-visible');
|
|
26
22
|
}
|
|
27
23
|
};
|
|
28
|
-
|
|
29
24
|
this.handleBlur = () => {
|
|
30
25
|
this.clickState = false;
|
|
31
|
-
|
|
32
26
|
this._adapter.setFocusVisible(false);
|
|
33
27
|
};
|
|
34
28
|
}
|
|
35
|
-
|
|
36
29
|
init() {
|
|
37
30
|
const {
|
|
38
31
|
children,
|
|
@@ -40,50 +33,36 @@ class CheckboxFoundation extends BaseFoundation {
|
|
|
40
33
|
extraId,
|
|
41
34
|
addonId
|
|
42
35
|
} = this.getProps();
|
|
43
|
-
|
|
44
36
|
if (children && !addonId) {
|
|
45
37
|
this._adapter.setAddonId();
|
|
46
38
|
}
|
|
47
|
-
|
|
48
39
|
if (extra && !extraId) {
|
|
49
40
|
this._adapter.setExtraId();
|
|
50
41
|
}
|
|
51
42
|
}
|
|
52
|
-
|
|
53
43
|
notifyChange(checked, e) {
|
|
54
44
|
const cbValue = this._adapter.generateEvent(checked, e);
|
|
55
|
-
|
|
56
45
|
this._adapter.notifyChange(cbValue);
|
|
57
46
|
}
|
|
58
|
-
|
|
59
47
|
handleChange(e) {
|
|
60
48
|
const disabled = this.getProp('disabled');
|
|
61
|
-
|
|
62
49
|
if (disabled) {
|
|
63
50
|
return;
|
|
64
51
|
}
|
|
65
|
-
|
|
66
52
|
if ((e === null || e === void 0 ? void 0 : e.type) === 'click') {
|
|
67
53
|
this.clickState = true;
|
|
68
54
|
}
|
|
69
|
-
|
|
70
55
|
this._adapter.focusCheckboxEntity();
|
|
71
|
-
|
|
72
56
|
const isInGroup = this._adapter.getIsInGroup();
|
|
73
|
-
|
|
74
57
|
if (isInGroup) {
|
|
75
58
|
const groupDisabled = this._adapter.getGroupDisabled();
|
|
76
|
-
|
|
77
59
|
if (!groupDisabled) {
|
|
78
60
|
this.handleChangeInGroup(e);
|
|
79
61
|
}
|
|
80
|
-
|
|
81
62
|
return;
|
|
82
63
|
}
|
|
83
|
-
|
|
84
64
|
const checked = this.getState('checked');
|
|
85
65
|
const newChecked = !checked;
|
|
86
|
-
|
|
87
66
|
if (this._isControlledComponent('checked')) {
|
|
88
67
|
this.notifyChange(newChecked, e);
|
|
89
68
|
} else {
|
|
@@ -91,37 +70,26 @@ class CheckboxFoundation extends BaseFoundation {
|
|
|
91
70
|
this.notifyChange(newChecked, e);
|
|
92
71
|
}
|
|
93
72
|
}
|
|
94
|
-
|
|
95
73
|
handleChangeInGroup(e) {
|
|
96
74
|
const {
|
|
97
75
|
value
|
|
98
76
|
} = this.getProps();
|
|
99
|
-
|
|
100
77
|
const groupValue = this._adapter.getGroupValue();
|
|
101
|
-
|
|
102
78
|
const checked = groupValue.includes(value);
|
|
103
79
|
const newChecked = !checked;
|
|
104
|
-
|
|
105
80
|
const event = this._adapter.generateEvent(newChecked, e);
|
|
106
|
-
|
|
107
81
|
this._adapter.notifyChange(event);
|
|
108
|
-
|
|
109
82
|
this._adapter.notifyGroupChange(event);
|
|
110
83
|
}
|
|
111
|
-
|
|
112
84
|
handleEnterPress(e) {
|
|
113
85
|
if (isEnterPress(e)) {
|
|
114
86
|
this.handleChange(e);
|
|
115
87
|
}
|
|
116
88
|
}
|
|
117
|
-
|
|
118
89
|
setChecked(checked) {
|
|
119
90
|
this._adapter.setNativeControlChecked(checked);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
91
|
+
}
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
123
93
|
destroy() {}
|
|
124
|
-
|
|
125
94
|
}
|
|
126
|
-
|
|
127
95
|
export default CheckboxFoundation;
|
|
@@ -1,67 +1,53 @@
|
|
|
1
1
|
import BaseFoundation from '../base/foundation';
|
|
2
2
|
import warning from '../utils/warning';
|
|
3
|
-
|
|
4
3
|
class CheckboxGroupFoundation extends BaseFoundation {
|
|
5
4
|
static get checkboxGroupDefaultAdapter() {
|
|
6
5
|
return {};
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
constructor(adapter) {
|
|
10
8
|
super(Object.assign(Object.assign({}, CheckboxGroupFoundation.checkboxGroupDefaultAdapter), adapter));
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
init() {
|
|
14
11
|
const {
|
|
15
12
|
defaultValue,
|
|
16
13
|
value
|
|
17
14
|
} = this.getProps();
|
|
18
|
-
|
|
19
15
|
if (typeof defaultValue !== 'undefined' && !Array.isArray(defaultValue)) {
|
|
20
16
|
warning(true, 'Warning: [Semi CheckboxGroup] defaultValue should be an Array');
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
if (typeof value !== 'undefined' && !Array.isArray(value)) {
|
|
24
19
|
warning(true, 'Warning: [Semi CheckboxGroup] value should be an Array');
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
notifyChange(value) {
|
|
29
23
|
this._adapter.notifyChange(value);
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
handleChange(evt) {
|
|
33
26
|
const prevValue = this.getState('value');
|
|
34
27
|
let newValue = [];
|
|
35
|
-
|
|
36
28
|
if (!Array.isArray(prevValue)) {
|
|
37
29
|
newValue = [prevValue];
|
|
38
30
|
}
|
|
39
|
-
|
|
40
31
|
if (evt.target.checked) {
|
|
41
32
|
newValue = [...prevValue, evt.target.value];
|
|
42
33
|
} else {
|
|
43
34
|
newValue = prevValue.filter((itm, idx) => itm !== evt.target.value);
|
|
44
35
|
}
|
|
45
|
-
|
|
46
36
|
const isControlledMode = ('value' in this.getProps());
|
|
47
|
-
|
|
48
37
|
if (isControlledMode) {
|
|
49
38
|
// Controlled mode only needs to notify
|
|
50
39
|
this.notifyChange(newValue);
|
|
51
40
|
} else {
|
|
52
41
|
// In uncontrolled mode, update the value in the state, and then notify
|
|
53
42
|
this._adapter.updateGroupValue(newValue);
|
|
54
|
-
|
|
55
43
|
this.notifyChange(newValue);
|
|
56
44
|
}
|
|
57
45
|
}
|
|
58
|
-
|
|
59
46
|
getFormatName() {
|
|
60
47
|
const propName = this.getProp('name');
|
|
61
48
|
const defaultName = 'default';
|
|
62
49
|
return propName || defaultName;
|
|
63
50
|
}
|
|
64
|
-
|
|
65
51
|
handlePropValueChange(newPropValue) {
|
|
66
52
|
if (Array.isArray(newPropValue)) {
|
|
67
53
|
this._adapter.updateGroupValue(newPropValue);
|
|
@@ -70,14 +56,10 @@ class CheckboxGroupFoundation extends BaseFoundation {
|
|
|
70
56
|
if (typeof newPropValue === 'undefined') {
|
|
71
57
|
this._adapter.updateGroupValue([]);
|
|
72
58
|
}
|
|
73
|
-
|
|
74
59
|
warning(true, 'Warning: [Semi CheckboxGroup] value should be an Array');
|
|
75
60
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
}
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
79
63
|
destroy() {}
|
|
80
|
-
|
|
81
64
|
}
|
|
82
|
-
|
|
83
65
|
export default CheckboxGroupFoundation;
|
|
@@ -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[];
|
|
@@ -3,7 +3,6 @@ export default class CollapseFoundation extends BaseFoundation {
|
|
|
3
3
|
constructor(adapter) {
|
|
4
4
|
super(Object.assign({}, adapter));
|
|
5
5
|
}
|
|
6
|
-
|
|
7
6
|
initActiveKey() {
|
|
8
7
|
const {
|
|
9
8
|
defaultActiveKey,
|
|
@@ -11,17 +10,15 @@ export default class CollapseFoundation extends BaseFoundation {
|
|
|
11
10
|
accordion
|
|
12
11
|
} = this.getProps();
|
|
13
12
|
let activeKeyList = activeKey ? activeKey : defaultActiveKey;
|
|
14
|
-
|
|
15
13
|
if (accordion) {
|
|
16
14
|
activeKeyList = Array.isArray(activeKeyList) ? activeKeyList[0] : activeKeyList;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
if (activeKeyList && activeKeyList.length) {
|
|
20
17
|
activeKeyList = Array.isArray(activeKeyList) ? activeKeyList : [activeKeyList];
|
|
21
18
|
return activeKeyList;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
return [];
|
|
21
|
+
// this._adapter.initActiveSet(activeKeyList);
|
|
25
22
|
}
|
|
26
23
|
|
|
27
24
|
handleChange(newKey, e) {
|
|
@@ -33,7 +30,6 @@ export default class CollapseFoundation extends BaseFoundation {
|
|
|
33
30
|
activeSet
|
|
34
31
|
} = this.getStates();
|
|
35
32
|
let newSet = new Set(activeSet);
|
|
36
|
-
|
|
37
33
|
if (newSet.has(newKey)) {
|
|
38
34
|
newSet.delete(newKey);
|
|
39
35
|
} else {
|
|
@@ -43,12 +39,9 @@ export default class CollapseFoundation extends BaseFoundation {
|
|
|
43
39
|
newSet.add(newKey);
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
|
-
|
|
47
42
|
this._adapter.handleChange([...newSet.values()], e);
|
|
48
|
-
|
|
49
43
|
if (typeof activeKey === 'undefined') {
|
|
50
44
|
this._adapter.addActiveKey(newSet);
|
|
51
45
|
}
|
|
52
46
|
}
|
|
53
|
-
|
|
54
47
|
}
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
import BaseFoundation from "../base/foundation";
|
|
2
|
-
|
|
3
2
|
class CollapsibleFoundation extends BaseFoundation {
|
|
4
3
|
constructor(adapter) {
|
|
5
4
|
super(Object.assign({}, adapter));
|
|
6
|
-
|
|
7
5
|
this.updateDOMInRenderTree = isInRenderTree => {
|
|
8
6
|
this._adapter.setDOMInRenderTree(isInRenderTree);
|
|
9
7
|
};
|
|
10
|
-
|
|
11
8
|
this.updateDOMHeight = domHeight => {
|
|
12
9
|
this._adapter.setDOMHeight(domHeight);
|
|
13
10
|
};
|
|
14
|
-
|
|
15
11
|
this.updateVisible = visible => {
|
|
16
12
|
this._adapter.setVisible(visible);
|
|
17
13
|
};
|
|
18
|
-
|
|
19
14
|
this.updateIsTransitioning = isTransitioning => {
|
|
20
15
|
this._adapter.setIsTransitioning(isTransitioning);
|
|
21
16
|
};
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
}
|
|
25
|
-
|
|
26
19
|
export default CollapsibleFoundation;
|
|
@@ -12,7 +12,6 @@ import { strings } from '../constants';
|
|
|
12
12
|
* @param {Object} locale
|
|
13
13
|
* @returns {string}
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
export function formatDateValues(values, formatToken) {
|
|
17
16
|
let {
|
|
18
17
|
groupInnerSeparator = strings.DEFAULT_SEPARATOR_RANGE,
|
|
@@ -21,23 +20,21 @@ export function formatDateValues(values, formatToken) {
|
|
|
21
20
|
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
22
21
|
let locale = arguments.length > 3 ? arguments[3] : undefined;
|
|
23
22
|
let text = '';
|
|
24
|
-
(groupSize <= 0 || typeof groupSize !== 'number') && (groupSize = 1);
|
|
25
|
-
|
|
23
|
+
(groupSize <= 0 || typeof groupSize !== 'number') && (groupSize = 1);
|
|
24
|
+
// console.log(values, formatToken, groupInnerSeparator, groupSize, groupSeparator);
|
|
26
25
|
if (Array.isArray(values) && values.length) {
|
|
27
26
|
const groups = [];
|
|
28
27
|
const {
|
|
29
28
|
length
|
|
30
|
-
} = values;
|
|
31
|
-
|
|
29
|
+
} = values;
|
|
30
|
+
// chunk
|
|
32
31
|
for (let i = 0; i < length; i++) {
|
|
33
32
|
if (i % groupSize === 0) {
|
|
34
33
|
groups.push([]);
|
|
35
34
|
}
|
|
36
|
-
|
|
37
35
|
const curArrIdx = Math.floor(i / groupSize);
|
|
38
36
|
groups[curArrIdx].push(values[i]);
|
|
39
37
|
}
|
|
40
|
-
|
|
41
38
|
text = groups.map(arr => arr.map(v => {
|
|
42
39
|
if (v) {
|
|
43
40
|
// console.log(`formatDateValues() -> formatDateValues: ${v}`);
|
|
@@ -49,6 +46,5 @@ export function formatDateValues(values, formatToken) {
|
|
|
49
46
|
}
|
|
50
47
|
}).join(groupInnerSeparator)).join(groupSeparator);
|
|
51
48
|
}
|
|
52
|
-
|
|
53
49
|
return text;
|
|
54
50
|
}
|
|
@@ -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[];
|
|
@@ -9,12 +9,9 @@ const getDayofWeek = _ref => {
|
|
|
9
9
|
weekStartsOn = 0
|
|
10
10
|
} = _ref;
|
|
11
11
|
const weekDay = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
12
|
-
|
|
13
12
|
for (let index = 0; index < weekStartsOn; index++) {
|
|
14
13
|
weekDay.push(weekDay.shift());
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
return weekDay;
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
export default getDayofWeek;
|
|
@@ -7,9 +7,7 @@ const defaultFormatTokens = {
|
|
|
7
7
|
month: strings.FORMAT_YEAR_MONTH,
|
|
8
8
|
monthRange: strings.FORMAT_YEAR_MONTH
|
|
9
9
|
};
|
|
10
|
-
|
|
11
10
|
const getDefaultFormatToken = type => defaultFormatTokens;
|
|
12
|
-
|
|
13
11
|
export function getDefaultFormatTokenByType(type) {
|
|
14
12
|
return type && defaultFormatTokens[type];
|
|
15
13
|
}
|
|
@@ -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;
|
|
@@ -5,7 +5,6 @@ import isTimestamp from './isTimestamp';
|
|
|
5
5
|
/**
|
|
6
6
|
* get left panel picker date and right panel picker date
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
8
|
export default function getDefaultPickerDate(options) {
|
|
10
9
|
const {
|
|
11
10
|
defaultPickerValue,
|
|
@@ -14,41 +13,32 @@ export default function getDefaultPickerDate(options) {
|
|
|
14
13
|
} = options;
|
|
15
14
|
let nowDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[0] : defaultPickerValue;
|
|
16
15
|
let nextDate = Array.isArray(defaultPickerValue) ? defaultPickerValue[1] : undefined;
|
|
17
|
-
|
|
18
16
|
switch (true) {
|
|
19
17
|
case isValidDate(nowDate):
|
|
20
18
|
break;
|
|
21
|
-
|
|
22
19
|
case isTimestamp(nowDate):
|
|
23
20
|
nowDate = new Date(nowDate);
|
|
24
21
|
break;
|
|
25
|
-
|
|
26
22
|
case typeof nowDate === 'string':
|
|
27
23
|
nowDate = compatibleParse(nowDate, format, undefined, dateFnsLocale);
|
|
28
24
|
break;
|
|
29
|
-
|
|
30
25
|
default:
|
|
31
26
|
nowDate = new Date();
|
|
32
27
|
break;
|
|
33
28
|
}
|
|
34
|
-
|
|
35
29
|
switch (true) {
|
|
36
30
|
case isValidDate(nextDate):
|
|
37
31
|
break;
|
|
38
|
-
|
|
39
32
|
case isTimestamp(nextDate):
|
|
40
33
|
nextDate = new Date(nextDate);
|
|
41
34
|
break;
|
|
42
|
-
|
|
43
35
|
case typeof nextDate === 'string':
|
|
44
36
|
nextDate = compatibleParse(nextDate, format, undefined, dateFnsLocale);
|
|
45
37
|
break;
|
|
46
|
-
|
|
47
38
|
default:
|
|
48
39
|
nextDate = addMonths(nowDate, 1);
|
|
49
40
|
break;
|
|
50
41
|
}
|
|
51
|
-
|
|
52
42
|
return {
|
|
53
43
|
nowDate: nowDate,
|
|
54
44
|
nextDate: nextDate
|
|
@@ -6,15 +6,12 @@ import { format } from 'date-fns';
|
|
|
6
6
|
* @param {*} fn
|
|
7
7
|
* @param {*} date
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
9
|
const getFullDateOffset = (fn, date) => {
|
|
11
10
|
if (!date) {
|
|
12
11
|
return '';
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
const getDate = new Date(date);
|
|
16
14
|
const offsetDate = _isFunction(fn) ? fn(getDate) : getDate;
|
|
17
15
|
return format(new Date(offsetDate), strings.FORMAT_FULL_DATE);
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
export default getFullDateOffset;
|
|
@@ -14,7 +14,6 @@ import { getDefaultFormatTokenByType } from './getDefaultFormatToken';
|
|
|
14
14
|
* 'yyyy-MM-dd HH:mm' => 'yyyy-MM-dd HH:mm'
|
|
15
15
|
* 'Pp' => 'yyyy-MM-dd'
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
17
|
export default function getInsetInputFormatToken(options) {
|
|
19
18
|
const {
|
|
20
19
|
format,
|
|
@@ -24,14 +23,12 @@ export default function getInsetInputFormatToken(options) {
|
|
|
24
23
|
const dateTimeReg = /([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4}) (H{0,2}[^a-z\s]*m{0,2}[^a-z\s]*s{0,2})/i;
|
|
25
24
|
const defaultToken = getDefaultFormatTokenByType(type);
|
|
26
25
|
let insetInputFormat;
|
|
27
|
-
|
|
28
26
|
switch (type) {
|
|
29
27
|
case 'dateTime':
|
|
30
28
|
case 'dateTimeRange':
|
|
31
29
|
const dateTimeResult = dateTimeReg.exec(format);
|
|
32
30
|
insetInputFormat = dateTimeResult && dateTimeResult[1] && dateTimeResult[2] ? `${dateTimeResult[1]} ${dateTimeResult[2]}` : defaultToken;
|
|
33
31
|
break;
|
|
34
|
-
|
|
35
32
|
case 'date':
|
|
36
33
|
case 'month':
|
|
37
34
|
case 'monthRange':
|
|
@@ -41,6 +38,5 @@ export default function getInsetInputFormatToken(options) {
|
|
|
41
38
|
insetInputFormat = dateResult && dateResult[1] || defaultToken;
|
|
42
39
|
break;
|
|
43
40
|
}
|
|
44
|
-
|
|
45
41
|
return insetInputFormat;
|
|
46
42
|
}
|
|
@@ -32,26 +32,22 @@ export default function getInsetInputValueFromInsetInputStr(options) {
|
|
|
32
32
|
timeInput: ''
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
|
|
36
35
|
switch (type) {
|
|
37
36
|
case 'date':
|
|
38
37
|
case 'month':
|
|
39
38
|
case 'monthRange':
|
|
40
39
|
insetInputValue.monthLeft.dateInput = inputValue;
|
|
41
40
|
break;
|
|
42
|
-
|
|
43
41
|
case 'dateRange':
|
|
44
42
|
[leftDateInput = '', rightDateInput = ''] = inputValue.split(rangeSeparator);
|
|
45
43
|
insetInputValue.monthLeft.dateInput = leftDateInput;
|
|
46
44
|
insetInputValue.monthRight.dateInput = rightDateInput;
|
|
47
45
|
break;
|
|
48
|
-
|
|
49
46
|
case 'dateTime':
|
|
50
47
|
[leftDateInput = '', leftTimeInput = ''] = inputValue.split(timeSeparator);
|
|
51
48
|
insetInputValue.monthLeft.dateInput = leftDateInput;
|
|
52
49
|
insetInputValue.monthLeft.timeInput = leftTimeInput;
|
|
53
50
|
break;
|
|
54
|
-
|
|
55
51
|
case 'dateTimeRange':
|
|
56
52
|
const [leftInput = '', rightInput = ''] = inputValue.split(rangeSeparator);
|
|
57
53
|
[leftDateInput = '', leftTimeInput = ''] = leftInput.split(timeSeparator);
|
|
@@ -62,6 +58,5 @@ export default function getInsetInputValueFromInsetInputStr(options) {
|
|
|
62
58
|
insetInputValue.monthRight.timeInput = rightTimeInput;
|
|
63
59
|
break;
|
|
64
60
|
}
|
|
65
|
-
|
|
66
61
|
return insetInputValue;
|
|
67
62
|
}
|
|
@@ -2,7 +2,7 @@ declare function formatFullDate(year?: number | string, month?: number | string,
|
|
|
2
2
|
/**
|
|
3
3
|
* [getWeeks description]
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type WeekStartNumber = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
6
|
declare const getMonthTable: (month: Date, weekStartsOn: WeekStartNumber) => {
|
|
7
7
|
monthText: string;
|
|
8
8
|
weeks: any[];
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
*
|
|
3
3
|
* @param {string} month
|
|
4
4
|
*/
|
|
5
|
-
import { startOfMonth, lastDayOfMonth, getDaysInMonth,
|
|
5
|
+
import { startOfMonth, lastDayOfMonth, getDaysInMonth,
|
|
6
|
+
// getDay,
|
|
6
7
|
// parseISO,
|
|
7
8
|
format } from 'date-fns';
|
|
8
|
-
|
|
9
9
|
function formatFullDate() {
|
|
10
10
|
let year = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
11
11
|
let month = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
@@ -16,7 +16,6 @@ function formatFullDate() {
|
|
|
16
16
|
dateStr = `${String(year)}-${monthFull}-${dayNumberFull}`;
|
|
17
17
|
return dateStr;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
19
|
function getWeeks(date) {
|
|
21
20
|
let weekStartsOn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
22
21
|
const weekDayNotInMonth = {
|
|
@@ -24,27 +23,22 @@ function getWeeks(date) {
|
|
|
24
23
|
dateNumberFull: '',
|
|
25
24
|
fullDate: ''
|
|
26
25
|
}; // For the first or last week epmtyDays
|
|
27
|
-
|
|
28
26
|
const daysInMonth = getDaysInMonth(date); // Get the total number of days in the month
|
|
29
|
-
|
|
30
27
|
const year = format(date, 'yyyy');
|
|
31
28
|
const month = format(date, 'MM');
|
|
32
29
|
const lastday = lastDayOfMonth(date); // Get the last day of the month
|
|
33
|
-
|
|
34
30
|
const firstDay = startOfMonth(date); // Get the first day of the month
|
|
35
31
|
// Const firstDayInWeek = getDay (firstDay);//The first day belongs to the day of the week
|
|
36
32
|
// What is the first day of the month in the first row?
|
|
37
|
-
|
|
38
33
|
const firstDayInWeek = Number(format(firstDay, 'e', {
|
|
39
34
|
weekStartsOn
|
|
40
35
|
}));
|
|
41
36
|
const weeks = [];
|
|
42
|
-
let week = [];
|
|
43
|
-
|
|
37
|
+
let week = [];
|
|
38
|
+
// add empty days to set first day in correct position
|
|
44
39
|
for (let s = 1; s < firstDayInWeek; s++) {
|
|
45
40
|
week.push(weekDayNotInMonth);
|
|
46
41
|
}
|
|
47
|
-
|
|
48
42
|
for (let d = 0; d < daysInMonth; d++) {
|
|
49
43
|
const dayNumber = d + 1;
|
|
50
44
|
const dayNumberFull = dayNumber < 10 ? `0${dayNumber}` : dayNumber.toString();
|
|
@@ -54,7 +48,6 @@ function getWeeks(date) {
|
|
|
54
48
|
dayNumberFull,
|
|
55
49
|
fullDate
|
|
56
50
|
});
|
|
57
|
-
|
|
58
51
|
if (week.length === 7) {
|
|
59
52
|
weeks.push(week);
|
|
60
53
|
week = [];
|
|
@@ -64,10 +57,8 @@ function getWeeks(date) {
|
|
|
64
57
|
week = [];
|
|
65
58
|
}
|
|
66
59
|
}
|
|
67
|
-
|
|
68
60
|
return weeks;
|
|
69
61
|
}
|
|
70
|
-
|
|
71
62
|
const getMonthTable = (month, weekStartsOn) => {
|
|
72
63
|
const weeks = getWeeks(month, weekStartsOn);
|
|
73
64
|
const monthText = format(month, 'yyyy-MM');
|
|
@@ -77,6 +68,5 @@ const getMonthTable = (month, weekStartsOn) => {
|
|
|
77
68
|
month
|
|
78
69
|
};
|
|
79
70
|
};
|
|
80
|
-
|
|
81
71
|
export default getMonthTable;
|
|
82
72
|
export { formatFullDate };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const getYears: () => number[];
|
|
1
|
+
declare const getYears: (startYear?: number, endYear?: number) => number[];
|
|
2
2
|
export default getYears;
|