@douyinfe/semi-foundation 2.27.1 → 2.28.0-beta.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/base/foundation.ts +2 -2
- package/cascader/foundation.ts +19 -8
- package/lib/cjs/select/select.css +20 -0
- package/lib/cjs/select/select.scss +27 -0
- package/lib/cjs/tabs/tabs.css +196 -0
- package/lib/cjs/tabs/tabs.scss +326 -17
- package/lib/cjs/toast/toast.css +12 -0
- package/lib/cjs/toast/toast.scss +12 -0
- package/lib/cjs/toast/variables.scss +8 -0
- package/lib/es/select/select.css +20 -0
- package/lib/es/select/select.scss +27 -0
- package/lib/es/tabs/tabs.css +196 -0
- package/lib/es/tabs/tabs.scss +326 -17
- package/lib/es/toast/toast.css +12 -0
- package/lib/es/toast/toast.scss +12 -0
- package/lib/es/toast/variables.scss +8 -0
- package/modal/modalFoundation.ts +26 -5
- package/package.json +2 -2
- package/select/foundation.ts +31 -3
- package/select/select.scss +27 -0
- package/tabs/tabs.scss +326 -17
- package/toast/toast.scss +12 -0
- package/toast/variables.scss +8 -0
- package/tree/foundation.ts +1 -1
- package/tree/treeUtil.ts +5 -4
- package/lib/cjs/anchor/constants.d.ts +0 -11
- package/lib/cjs/anchor/constants.js +0 -21
- package/lib/cjs/anchor/foundation.d.ts +0 -40
- package/lib/cjs/anchor/foundation.js +0 -263
- package/lib/cjs/anchor/linkFoundation.d.ts +0 -14
- package/lib/cjs/anchor/linkFoundation.js +0 -45
- package/lib/cjs/autoComplete/constants.d.ts +0 -12
- package/lib/cjs/autoComplete/constants.js +0 -24
- package/lib/cjs/autoComplete/foundation.d.ts +0 -66
- package/lib/cjs/autoComplete/foundation.js +0 -518
- package/lib/cjs/autoComplete/optionFoundation.d.ts +0 -21
- package/lib/cjs/autoComplete/optionFoundation.js +0 -37
- package/lib/cjs/avatar/constants.d.ts +0 -10
- package/lib/cjs/avatar/constants.js +0 -21
- package/lib/cjs/avatar/foundation.d.ts +0 -17
- package/lib/cjs/avatar/foundation.js +0 -64
- package/lib/cjs/backtop/constants.d.ts +0 -5
- package/lib/cjs/backtop/constants.js +0 -15
- package/lib/cjs/backtop/foundation.d.ts +0 -21
- package/lib/cjs/backtop/foundation.js +0 -109
- package/lib/cjs/badge/constants.d.ts +0 -10
- package/lib/cjs/badge/constants.js +0 -21
- package/lib/cjs/banner/constants.d.ts +0 -7
- package/lib/cjs/banner/constants.js +0 -17
- package/lib/cjs/banner/foundation.d.ts +0 -9
- package/lib/cjs/banner/foundation.js +0 -25
- package/lib/cjs/base/constants.d.ts +0 -3
- package/lib/cjs/base/constants.js +0 -18
- package/lib/cjs/base/env.d.ts +0 -1
- package/lib/cjs/base/env.js +0 -8
- package/lib/cjs/base/foundation.d.ts +0 -62
- package/lib/cjs/base/foundation.js +0 -157
- package/lib/cjs/base/index.d.ts +0 -5
- package/lib/cjs/base/index.js +0 -15
- package/lib/cjs/breadcrumb/constants.d.ts +0 -7
- package/lib/cjs/breadcrumb/constants.js +0 -17
- package/lib/cjs/breadcrumb/foundation.d.ts +0 -28
- package/lib/cjs/breadcrumb/foundation.js +0 -57
- package/lib/cjs/breadcrumb/itemFoundation.d.ts +0 -22
- package/lib/cjs/breadcrumb/itemFoundation.js +0 -26
- package/lib/cjs/button/constants.d.ts +0 -14
- package/lib/cjs/button/constants.js +0 -25
- package/lib/cjs/calendar/constants.d.ts +0 -7
- package/lib/cjs/calendar/constants.js +0 -17
- package/lib/cjs/calendar/eventUtil.d.ts +0 -94
- package/lib/cjs/calendar/eventUtil.js +0 -409
- package/lib/cjs/calendar/foundation.d.ts +0 -100
- package/lib/cjs/calendar/foundation.js +0 -467
- package/lib/cjs/card/constants.d.ts +0 -8
- package/lib/cjs/card/constants.js +0 -18
- package/lib/cjs/carousel/constants.d.ts +0 -27
- package/lib/cjs/carousel/constants.js +0 -38
- package/lib/cjs/carousel/foundation.d.ts +0 -29
- package/lib/cjs/carousel/foundation.js +0 -215
- package/lib/cjs/cascader/constants.d.ts +0 -17
- package/lib/cjs/cascader/constants.js +0 -30
- package/lib/cjs/cascader/foundation.d.ts +0 -237
- package/lib/cjs/cascader/foundation.js +0 -1055
- package/lib/cjs/cascader/util.d.ts +0 -5
- package/lib/cjs/cascader/util.js +0 -110
- package/lib/cjs/checkbox/checkboxFoundation.d.ts +0 -58
- package/lib/cjs/checkbox/checkboxFoundation.js +0 -139
- package/lib/cjs/checkbox/checkboxGroupFoundation.d.ts +0 -17
- package/lib/cjs/checkbox/checkboxGroupFoundation.js +0 -94
- package/lib/cjs/checkbox/constants.d.ts +0 -27
- package/lib/cjs/checkbox/constants.js +0 -39
- package/lib/cjs/collapse/constants.d.ts +0 -7
- package/lib/cjs/collapse/constants.js +0 -17
- package/lib/cjs/collapse/foundation.d.ts +0 -27
- package/lib/cjs/collapse/foundation.js +0 -66
- package/lib/cjs/collapsible/constants.d.ts +0 -4
- package/lib/cjs/collapsible/constants.js +0 -13
- package/lib/cjs/collapsible/foundation.d.ts +0 -31
- package/lib/cjs/collapsible/foundation.js +0 -36
- package/lib/cjs/datePicker/_utils/formatter.d.ts +0 -14
- package/lib/cjs/datePicker/_utils/formatter.js +0 -63
- package/lib/cjs/datePicker/_utils/getDayOfWeek.d.ts +0 -11
- package/lib/cjs/datePicker/_utils/getDayOfWeek.js +0 -28
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.d.ts +0 -9
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +0 -26
- package/lib/cjs/datePicker/_utils/getDefaultPickerDate.d.ts +0 -15
- package/lib/cjs/datePicker/_utils/getDefaultPickerDate.js +0 -68
- package/lib/cjs/datePicker/_utils/getFullDateOffset.d.ts +0 -7
- package/lib/cjs/datePicker/_utils/getFullDateOffset.js +0 -32
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.d.ts +0 -20
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +0 -52
- package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.d.ts +0 -31
- package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +0 -73
- package/lib/cjs/datePicker/_utils/getMonthTable.d.ts +0 -12
- package/lib/cjs/datePicker/_utils/getMonthTable.js +0 -88
- package/lib/cjs/datePicker/_utils/getMonthsInYear.d.ts +0 -2
- package/lib/cjs/datePicker/_utils/getMonthsInYear.js +0 -13
- package/lib/cjs/datePicker/_utils/getYears.d.ts +0 -2
- package/lib/cjs/datePicker/_utils/getYears.js +0 -17
- package/lib/cjs/datePicker/_utils/index.d.ts +0 -13
- package/lib/cjs/datePicker/_utils/index.js +0 -103
- package/lib/cjs/datePicker/_utils/isAfter.d.ts +0 -1
- package/lib/cjs/datePicker/_utils/isAfter.js +0 -18
- package/lib/cjs/datePicker/_utils/isBefore.d.ts +0 -1
- package/lib/cjs/datePicker/_utils/isBefore.js +0 -18
- package/lib/cjs/datePicker/_utils/isBetween.d.ts +0 -11
- package/lib/cjs/datePicker/_utils/isBetween.js +0 -33
- package/lib/cjs/datePicker/_utils/isDate.d.ts +0 -1
- package/lib/cjs/datePicker/_utils/isDate.js +0 -10
- package/lib/cjs/datePicker/_utils/isSameDay.d.ts +0 -1
- package/lib/cjs/datePicker/_utils/isSameDay.js +0 -18
- package/lib/cjs/datePicker/_utils/isTimestamp.d.ts +0 -1
- package/lib/cjs/datePicker/_utils/isTimestamp.js +0 -16
- package/lib/cjs/datePicker/_utils/isUnixTimestamp.d.ts +0 -1
- package/lib/cjs/datePicker/_utils/isUnixTimestamp.js +0 -16
- package/lib/cjs/datePicker/_utils/isValidDate.d.ts +0 -1
- package/lib/cjs/datePicker/_utils/isValidDate.js +0 -10
- package/lib/cjs/datePicker/_utils/isWithinInterval.d.ts +0 -4
- package/lib/cjs/datePicker/_utils/isWithinInterval.js +0 -26
- package/lib/cjs/datePicker/_utils/parser.d.ts +0 -23
- package/lib/cjs/datePicker/_utils/parser.js +0 -68
- package/lib/cjs/datePicker/constants.d.ts +0 -53
- package/lib/cjs/datePicker/constants.js +0 -70
- package/lib/cjs/datePicker/foundation.d.ts +0 -483
- package/lib/cjs/datePicker/foundation.js +0 -1456
- package/lib/cjs/datePicker/inputFoundation.d.ts +0 -133
- package/lib/cjs/datePicker/inputFoundation.js +0 -392
- package/lib/cjs/datePicker/monthFoundation.d.ts +0 -74
- package/lib/cjs/datePicker/monthFoundation.js +0 -89
- package/lib/cjs/datePicker/monthsGridFoundation.d.ts +0 -253
- package/lib/cjs/datePicker/monthsGridFoundation.js +0 -1078
- package/lib/cjs/datePicker/yearAndMonthFoundation.d.ts +0 -65
- package/lib/cjs/datePicker/yearAndMonthFoundation.js +0 -102
- package/lib/cjs/descriptions/constants.d.ts +0 -9
- package/lib/cjs/descriptions/constants.js +0 -20
- package/lib/cjs/divider/constants.d.ts +0 -7
- package/lib/cjs/divider/constants.js +0 -17
- package/lib/cjs/dropdown/constants.d.ts +0 -16
- package/lib/cjs/dropdown/constants.js +0 -29
- package/lib/cjs/dropdown/foundation.d.ts +0 -13
- package/lib/cjs/dropdown/foundation.js +0 -77
- package/lib/cjs/dropdown/menuFoundation.d.ts +0 -8
- package/lib/cjs/dropdown/menuFoundation.js +0 -91
- package/lib/cjs/empty/constants.d.ts +0 -7
- package/lib/cjs/empty/constants.js +0 -17
- package/lib/cjs/form/constants.d.ts +0 -11
- package/lib/cjs/form/constants.js +0 -22
- package/lib/cjs/form/foundation.d.ts +0 -100
- package/lib/cjs/form/foundation.js +0 -832
- package/lib/cjs/form/interface.d.ts +0 -124
- package/lib/cjs/form/interface.js +0 -5
- package/lib/cjs/form/utils.d.ts +0 -56
- package/lib/cjs/form/utils.js +0 -234
- package/lib/cjs/grid/constants.d.ts +0 -4
- package/lib/cjs/grid/constants.js +0 -13
- package/lib/cjs/highlight/constants.d.ts +0 -4
- package/lib/cjs/highlight/constants.js +0 -13
- package/lib/cjs/icons/constants.d.ts +0 -9
- package/lib/cjs/icons/constants.js +0 -21
- package/lib/cjs/image/constants.d.ts +0 -4
- package/lib/cjs/image/constants.js +0 -13
- package/lib/cjs/image/imageFoundation.d.ts +0 -11
- package/lib/cjs/image/imageFoundation.js +0 -89
- package/lib/cjs/image/previewFooterFoundation.d.ts +0 -10
- package/lib/cjs/image/previewFooterFoundation.js +0 -69
- package/lib/cjs/image/previewFoundation.d.ts +0 -5
- package/lib/cjs/image/previewFoundation.js +0 -49
- package/lib/cjs/image/previewImageFoundation.d.ts +0 -59
- package/lib/cjs/image/previewImageFoundation.js +0 -390
- package/lib/cjs/image/previewInnerFoundation.d.ts +0 -46
- package/lib/cjs/image/previewInnerFoundation.js +0 -345
- package/lib/cjs/image/utils.d.ts +0 -4
- package/lib/cjs/image/utils.js +0 -111
- package/lib/cjs/input/constants.d.ts +0 -12
- package/lib/cjs/input/constants.js +0 -23
- package/lib/cjs/input/foundation.d.ts +0 -82
- package/lib/cjs/input/foundation.js +0 -386
- package/lib/cjs/input/textareaFoundation.d.ts +0 -63
- package/lib/cjs/input/textareaFoundation.js +0 -294
- package/lib/cjs/input/util/calculateNodeHeight.d.ts +0 -1
- package/lib/cjs/input/util/calculateNodeHeight.js +0 -87
- package/lib/cjs/input/util/getSizingData.d.ts +0 -6
- package/lib/cjs/input/util/getSizingData.js +0 -42
- package/lib/cjs/inputNumber/constants.d.ts +0 -18
- package/lib/cjs/inputNumber/constants.js +0 -21
- package/lib/cjs/inputNumber/foundation.d.ts +0 -120
- package/lib/cjs/inputNumber/foundation.js +0 -718
- package/lib/cjs/layout/constants.d.ts +0 -7
- package/lib/cjs/layout/constants.js +0 -17
- package/lib/cjs/list/constants.d.ts +0 -9
- package/lib/cjs/list/constants.js +0 -19
- package/lib/cjs/modal/constants.d.ts +0 -10
- package/lib/cjs/modal/constants.js +0 -20
- package/lib/cjs/modal/modalContentFoundation.d.ts +0 -42
- package/lib/cjs/modal/modalContentFoundation.js +0 -85
- package/lib/cjs/modal/modalFoundation.d.ts +0 -67
- package/lib/cjs/modal/modalFoundation.js +0 -47
- package/lib/cjs/navigation/NavItem.d.ts +0 -10
- package/lib/cjs/navigation/NavItem.js +0 -59
- package/lib/cjs/navigation/constants.d.ts +0 -21
- package/lib/cjs/navigation/constants.js +0 -35
- package/lib/cjs/navigation/foundation.d.ts +0 -85
- package/lib/cjs/navigation/foundation.js +0 -292
- package/lib/cjs/navigation/itemFoundation.d.ts +0 -50
- package/lib/cjs/navigation/itemFoundation.js +0 -101
- package/lib/cjs/navigation/subNavFoundation.d.ts +0 -45
- package/lib/cjs/navigation/subNavFoundation.js +0 -150
- package/lib/cjs/notification/constants.d.ts +0 -14
- package/lib/cjs/notification/constants.js +0 -26
- package/lib/cjs/notification/notificationFoundation.d.ts +0 -47
- package/lib/cjs/notification/notificationFoundation.js +0 -67
- package/lib/cjs/notification/notificationListFoundation.d.ts +0 -28
- package/lib/cjs/notification/notificationListFoundation.js +0 -56
- package/lib/cjs/overflowList/constants.d.ts +0 -25
- package/lib/cjs/overflowList/constants.js +0 -39
- package/lib/cjs/overflowList/foundation.d.ts +0 -17
- package/lib/cjs/overflowList/foundation.js +0 -172
- package/lib/cjs/pagination/constants.d.ts +0 -12
- package/lib/cjs/pagination/constants.js +0 -23
- package/lib/cjs/pagination/foundation.d.ts +0 -52
- package/lib/cjs/pagination/foundation.js +0 -366
- package/lib/cjs/popconfirm/constants.d.ts +0 -13
- package/lib/cjs/popconfirm/constants.js +0 -24
- package/lib/cjs/popconfirm/popconfirmFoundation.d.ts +0 -18
- package/lib/cjs/popconfirm/popconfirmFoundation.js +0 -70
- package/lib/cjs/popover/constants.d.ts +0 -25
- package/lib/cjs/popover/constants.js +0 -38
- package/lib/cjs/progress/constants.d.ts +0 -15
- package/lib/cjs/progress/constants.js +0 -26
- package/lib/cjs/progress/generates.d.ts +0 -7
- package/lib/cjs/progress/generates.js +0 -249
- package/lib/cjs/radio/constants.d.ts +0 -29
- package/lib/cjs/radio/constants.js +0 -41
- package/lib/cjs/radio/radioFoundation.d.ts +0 -15
- package/lib/cjs/radio/radioFoundation.js +0 -64
- package/lib/cjs/radio/radioGroupFoundation.d.ts +0 -16
- package/lib/cjs/radio/radioGroupFoundation.js +0 -86
- package/lib/cjs/radio/radioInnerFoundation.d.ts +0 -22
- package/lib/cjs/radio/radioInnerFoundation.js +0 -69
- package/lib/cjs/rating/constants.d.ts +0 -7
- package/lib/cjs/rating/constants.js +0 -17
- package/lib/cjs/rating/foundation.d.ts +0 -41
- package/lib/cjs/rating/foundation.js +0 -279
- package/lib/cjs/scrollList/constants.d.ts +0 -12
- package/lib/cjs/scrollList/constants.js +0 -23
- package/lib/cjs/scrollList/foundation.d.ts +0 -3
- package/lib/cjs/scrollList/foundation.js +0 -14
- package/lib/cjs/scrollList/itemFoundation.d.ts +0 -74
- package/lib/cjs/scrollList/itemFoundation.js +0 -307
- package/lib/cjs/scrollList/scrollTo.d.ts +0 -3
- package/lib/cjs/scrollList/scrollTo.js +0 -32
- package/lib/cjs/select/constants.d.ts +0 -16
- package/lib/cjs/select/constants.js +0 -30
- package/lib/cjs/select/foundation.d.ts +0 -136
- package/lib/cjs/select/foundation.js +0 -1422
- package/lib/cjs/select/optionFoundation.d.ts +0 -21
- package/lib/cjs/select/optionFoundation.js +0 -37
- package/lib/cjs/sideSheet/constants.d.ts +0 -15
- package/lib/cjs/sideSheet/constants.js +0 -25
- package/lib/cjs/sideSheet/sideSheetFoundation.d.ts +0 -55
- package/lib/cjs/sideSheet/sideSheetFoundation.js +0 -73
- package/lib/cjs/skeleton/constants.d.ts +0 -5
- package/lib/cjs/skeleton/constants.js +0 -15
- package/lib/cjs/slider/constants.d.ts +0 -15
- package/lib/cjs/slider/constants.js +0 -25
- package/lib/cjs/slider/foundation.d.ts +0 -212
- package/lib/cjs/slider/foundation.js +0 -952
- package/lib/cjs/space/constants.d.ts +0 -10
- package/lib/cjs/space/constants.js +0 -20
- package/lib/cjs/spin/constants.d.ts +0 -8
- package/lib/cjs/spin/constants.js +0 -20
- package/lib/cjs/spin/foundation.d.ts +0 -12
- package/lib/cjs/spin/foundation.js +0 -55
- package/lib/cjs/steps/constants.d.ts +0 -5
- package/lib/cjs/steps/constants.js +0 -14
- package/lib/cjs/switch/constants.d.ts +0 -19
- package/lib/cjs/switch/constants.js +0 -29
- package/lib/cjs/switch/foundation.d.ts +0 -17
- package/lib/cjs/switch/foundation.js +0 -73
- package/lib/cjs/table/bodyFoundation.d.ts +0 -38
- package/lib/cjs/table/bodyFoundation.js +0 -151
- package/lib/cjs/table/cellFoundation.d.ts +0 -7
- package/lib/cjs/table/cellFoundation.js +0 -19
- package/lib/cjs/table/constants.d.ts +0 -77
- package/lib/cjs/table/constants.js +0 -107
- package/lib/cjs/table/foundation.d.ts +0 -365
- package/lib/cjs/table/foundation.js +0 -1183
- package/lib/cjs/table/tableRowFoundation.d.ts +0 -14
- package/lib/cjs/table/tableRowFoundation.js +0 -41
- package/lib/cjs/table/tableSelectionCellFoundation.d.ts +0 -13
- package/lib/cjs/table/tableSelectionCellFoundation.js +0 -21
- package/lib/cjs/table/utils.d.ts +0 -102
- package/lib/cjs/table/utils.js +0 -618
- package/lib/cjs/tabs/constants.d.ts +0 -32
- package/lib/cjs/tabs/constants.js +0 -43
- package/lib/cjs/tabs/foundation.d.ts +0 -28
- package/lib/cjs/tabs/foundation.js +0 -210
- package/lib/cjs/tag/constants.d.ts +0 -10
- package/lib/cjs/tag/constants.js +0 -21
- package/lib/cjs/tagInput/constants.d.ts +0 -8
- package/lib/cjs/tagInput/constants.js +0 -18
- package/lib/cjs/tagInput/foundation.d.ts +0 -74
- package/lib/cjs/tagInput/foundation.js +0 -391
- package/lib/cjs/tagInput/utils/getSplitedArray.d.ts +0 -7
- package/lib/cjs/tagInput/utils/getSplitedArray.js +0 -44
- package/lib/cjs/timePicker/ComboxFoundation.d.ts +0 -31
- package/lib/cjs/timePicker/ComboxFoundation.js +0 -174
- package/lib/cjs/timePicker/constants.d.ts +0 -23
- package/lib/cjs/timePicker/constants.js +0 -40
- package/lib/cjs/timePicker/foundation.d.ts +0 -54
- package/lib/cjs/timePicker/foundation.js +0 -464
- package/lib/cjs/timePicker/inputFoundation.d.ts +0 -18
- package/lib/cjs/timePicker/inputFoundation.js +0 -76
- package/lib/cjs/timePicker/utils/index.d.ts +0 -41
- package/lib/cjs/timePicker/utils/index.js +0 -184
- package/lib/cjs/timePicker/utils/localeDate.d.ts +0 -2
- package/lib/cjs/timePicker/utils/localeDate.js +0 -45
- package/lib/cjs/timeline/constants.d.ts +0 -10
- package/lib/cjs/timeline/constants.js +0 -20
- package/lib/cjs/toast/constants.d.ts +0 -14
- package/lib/cjs/toast/constants.js +0 -27
- package/lib/cjs/toast/toastFoundation.d.ts +0 -47
- package/lib/cjs/toast/toastFoundation.js +0 -65
- package/lib/cjs/toast/toastListFoundation.d.ts +0 -20
- package/lib/cjs/toast/toastListFoundation.js +0 -75
- package/lib/cjs/tooltip/constants.d.ts +0 -23
- package/lib/cjs/tooltip/constants.js +0 -34
- package/lib/cjs/tooltip/foundation.d.ts +0 -142
- package/lib/cjs/tooltip/foundation.js +0 -1322
- package/lib/cjs/transfer/constants.d.ts +0 -10
- package/lib/cjs/transfer/constants.js +0 -21
- package/lib/cjs/transfer/foundation.d.ts +0 -50
- package/lib/cjs/transfer/foundation.js +0 -282
- package/lib/cjs/transfer/transferUtils.d.ts +0 -4
- package/lib/cjs/transfer/transferUtils.js +0 -99
- package/lib/cjs/tree/constants.d.ts +0 -9
- package/lib/cjs/tree/constants.js +0 -20
- package/lib/cjs/tree/foundation.d.ts +0 -286
- package/lib/cjs/tree/foundation.js +0 -725
- package/lib/cjs/tree/treeUtil.d.ts +0 -79
- package/lib/cjs/tree/treeUtil.js +0 -774
- package/lib/cjs/treeSelect/constants.d.ts +0 -13
- package/lib/cjs/treeSelect/constants.js +0 -24
- package/lib/cjs/treeSelect/foundation.d.ts +0 -179
- package/lib/cjs/treeSelect/foundation.js +0 -925
- package/lib/cjs/typography/constants.d.ts +0 -12
- package/lib/cjs/typography/constants.js +0 -22
- package/lib/cjs/typography/formatNumeral.d.ts +0 -18
- package/lib/cjs/typography/formatNumeral.js +0 -114
- package/lib/cjs/upload/constants.d.ts +0 -28
- package/lib/cjs/upload/constants.js +0 -46
- package/lib/cjs/upload/foundation.d.ts +0 -167
- package/lib/cjs/upload/foundation.js +0 -1123
- package/lib/cjs/upload/utils.d.ts +0 -6
- package/lib/cjs/upload/utils.js +0 -146
- package/lib/cjs/utils/Event.d.ts +0 -7
- package/lib/cjs/utils/Event.js +0 -77
- package/lib/cjs/utils/FocusHandle.d.ts +0 -26
- package/lib/cjs/utils/FocusHandle.js +0 -157
- package/lib/cjs/utils/Logger.d.ts +0 -15
- package/lib/cjs/utils/Logger.js +0 -82
- package/lib/cjs/utils/Store.d.ts +0 -9
- package/lib/cjs/utils/Store.js +0 -46
- package/lib/cjs/utils/a11y.d.ts +0 -10
- package/lib/cjs/utils/a11y.js +0 -132
- package/lib/cjs/utils/array.d.ts +0 -22
- package/lib/cjs/utils/array.js +0 -55
- package/lib/cjs/utils/arrayMove.d.ts +0 -1
- package/lib/cjs/utils/arrayMove.js +0 -12
- package/lib/cjs/utils/classnames.d.ts +0 -4
- package/lib/cjs/utils/classnames.js +0 -45
- package/lib/cjs/utils/date-fns-extra.d.ts +0 -55
- package/lib/cjs/utils/date-fns-extra.js +0 -141
- package/lib/cjs/utils/dom.d.ts +0 -27
- package/lib/cjs/utils/dom.js +0 -85
- package/lib/cjs/utils/function.d.ts +0 -4
- package/lib/cjs/utils/function.js +0 -12
- package/lib/cjs/utils/getDataAttr.d.ts +0 -1
- package/lib/cjs/utils/getDataAttr.js +0 -16
- package/lib/cjs/utils/getHighlight.d.ts +0 -45
- package/lib/cjs/utils/getHighlight.js +0 -196
- package/lib/cjs/utils/getMotionObjFromProps.d.ts +0 -26
- package/lib/cjs/utils/getMotionObjFromProps.js +0 -72
- package/lib/cjs/utils/index.d.ts +0 -2
- package/lib/cjs/utils/index.js +0 -31
- package/lib/cjs/utils/isBothNaN.d.ts +0 -8
- package/lib/cjs/utils/isBothNaN.js +0 -22
- package/lib/cjs/utils/isElement.d.ts +0 -1
- package/lib/cjs/utils/isElement.js +0 -19
- package/lib/cjs/utils/isEnterPress.d.ts +0 -4
- package/lib/cjs/utils/isEnterPress.js +0 -19
- package/lib/cjs/utils/isEscPress.d.ts +0 -4
- package/lib/cjs/utils/isEscPress.js +0 -20
- package/lib/cjs/utils/isNullOrUndefined.d.ts +0 -6
- package/lib/cjs/utils/isNullOrUndefined.js +0 -15
- package/lib/cjs/utils/isNumber.d.ts +0 -1
- package/lib/cjs/utils/isNumber.js +0 -10
- package/lib/cjs/utils/isObject.d.ts +0 -1
- package/lib/cjs/utils/isObject.js +0 -10
- package/lib/cjs/utils/isPromise.d.ts +0 -1
- package/lib/cjs/utils/isPromise.js +0 -14
- package/lib/cjs/utils/isString.d.ts +0 -1
- package/lib/cjs/utils/isString.js +0 -10
- package/lib/cjs/utils/keyCode.d.ts +0 -430
- package/lib/cjs/utils/keyCode.js +0 -545
- package/lib/cjs/utils/log.d.ts +0 -2
- package/lib/cjs/utils/log.js +0 -23
- package/lib/cjs/utils/number.d.ts +0 -10
- package/lib/cjs/utils/number.js +0 -26
- package/lib/cjs/utils/object.d.ts +0 -17
- package/lib/cjs/utils/object.js +0 -157
- package/lib/cjs/utils/set.d.ts +0 -7
- package/lib/cjs/utils/set.js +0 -40
- package/lib/cjs/utils/shallowEqualObjects.d.ts +0 -5
- package/lib/cjs/utils/shallowEqualObjects.js +0 -34
- package/lib/cjs/utils/touchPolyfill.d.ts +0 -2
- package/lib/cjs/utils/touchPolyfill.js +0 -43
- package/lib/cjs/utils/type.d.ts +0 -31
- package/lib/cjs/utils/type.js +0 -5
- package/lib/cjs/utils/uuid.d.ts +0 -18
- package/lib/cjs/utils/uuid.js +0 -53
- package/lib/cjs/utils/warning.d.ts +0 -1
- package/lib/cjs/utils/warning.js +0 -12
- package/lib/es/anchor/constants.d.ts +0 -11
- package/lib/es/anchor/constants.js +0 -12
- package/lib/es/anchor/foundation.d.ts +0 -40
- package/lib/es/anchor/foundation.js +0 -248
- package/lib/es/anchor/linkFoundation.d.ts +0 -14
- package/lib/es/anchor/linkFoundation.js +0 -33
- package/lib/es/autoComplete/constants.d.ts +0 -12
- package/lib/es/autoComplete/constants.js +0 -14
- package/lib/es/autoComplete/foundation.d.ts +0 -66
- package/lib/es/autoComplete/foundation.js +0 -503
- package/lib/es/autoComplete/optionFoundation.d.ts +0 -21
- package/lib/es/autoComplete/optionFoundation.js +0 -25
- package/lib/es/avatar/constants.d.ts +0 -10
- package/lib/es/avatar/constants.js +0 -12
- package/lib/es/avatar/foundation.d.ts +0 -17
- package/lib/es/avatar/foundation.js +0 -51
- package/lib/es/backtop/constants.d.ts +0 -5
- package/lib/es/backtop/constants.js +0 -6
- package/lib/es/backtop/foundation.d.ts +0 -21
- package/lib/es/backtop/foundation.js +0 -96
- package/lib/es/badge/constants.d.ts +0 -10
- package/lib/es/badge/constants.js +0 -11
- package/lib/es/banner/constants.d.ts +0 -7
- package/lib/es/banner/constants.js +0 -8
- package/lib/es/banner/foundation.d.ts +0 -9
- package/lib/es/banner/foundation.js +0 -13
- package/lib/es/base/constants.d.ts +0 -3
- package/lib/es/base/constants.js +0 -4
- package/lib/es/base/env.d.ts +0 -1
- package/lib/es/base/env.js +0 -1
- package/lib/es/base/foundation.d.ts +0 -62
- package/lib/es/base/foundation.js +0 -147
- package/lib/es/base/index.d.ts +0 -5
- package/lib/es/base/index.js +0 -4
- package/lib/es/breadcrumb/constants.d.ts +0 -7
- package/lib/es/breadcrumb/constants.js +0 -8
- package/lib/es/breadcrumb/foundation.d.ts +0 -28
- package/lib/es/breadcrumb/foundation.js +0 -44
- package/lib/es/breadcrumb/itemFoundation.d.ts +0 -22
- package/lib/es/breadcrumb/itemFoundation.js +0 -14
- package/lib/es/button/constants.d.ts +0 -14
- package/lib/es/button/constants.js +0 -15
- package/lib/es/calendar/constants.d.ts +0 -7
- package/lib/es/calendar/constants.js +0 -8
- package/lib/es/calendar/eventUtil.d.ts +0 -94
- package/lib/es/calendar/eventUtil.js +0 -346
- package/lib/es/calendar/foundation.d.ts +0 -100
- package/lib/es/calendar/foundation.js +0 -453
- package/lib/es/card/constants.d.ts +0 -8
- package/lib/es/card/constants.js +0 -9
- package/lib/es/carousel/constants.d.ts +0 -27
- package/lib/es/carousel/constants.js +0 -28
- package/lib/es/carousel/foundation.d.ts +0 -29
- package/lib/es/carousel/foundation.js +0 -202
- package/lib/es/cascader/constants.d.ts +0 -17
- package/lib/es/cascader/constants.js +0 -20
- package/lib/es/cascader/foundation.d.ts +0 -237
- package/lib/es/cascader/foundation.js +0 -1030
- package/lib/es/cascader/util.d.ts +0 -5
- package/lib/es/cascader/util.js +0 -90
- package/lib/es/checkbox/checkboxFoundation.d.ts +0 -58
- package/lib/es/checkbox/checkboxFoundation.js +0 -127
- package/lib/es/checkbox/checkboxGroupFoundation.d.ts +0 -17
- package/lib/es/checkbox/checkboxGroupFoundation.js +0 -83
- package/lib/es/checkbox/constants.d.ts +0 -27
- package/lib/es/checkbox/constants.js +0 -28
- package/lib/es/collapse/constants.d.ts +0 -7
- package/lib/es/collapse/constants.js +0 -8
- package/lib/es/collapse/foundation.d.ts +0 -27
- package/lib/es/collapse/foundation.js +0 -54
- package/lib/es/collapsible/constants.d.ts +0 -4
- package/lib/es/collapsible/constants.js +0 -5
- package/lib/es/collapsible/foundation.d.ts +0 -31
- package/lib/es/collapsible/foundation.js +0 -26
- package/lib/es/datePicker/_utils/formatter.d.ts +0 -14
- package/lib/es/datePicker/_utils/formatter.js +0 -54
- package/lib/es/datePicker/_utils/getDayOfWeek.d.ts +0 -11
- package/lib/es/datePicker/_utils/getDayOfWeek.js +0 -20
- package/lib/es/datePicker/_utils/getDefaultFormatToken.d.ts +0 -9
- package/lib/es/datePicker/_utils/getDefaultFormatToken.js +0 -15
- package/lib/es/datePicker/_utils/getDefaultPickerDate.d.ts +0 -15
- package/lib/es/datePicker/_utils/getDefaultPickerDate.js +0 -56
- package/lib/es/datePicker/_utils/getFullDateOffset.d.ts +0 -7
- package/lib/es/datePicker/_utils/getFullDateOffset.js +0 -20
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.d.ts +0 -20
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +0 -45
- package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.d.ts +0 -31
- package/lib/es/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +0 -66
- package/lib/es/datePicker/_utils/getMonthTable.d.ts +0 -12
- package/lib/es/datePicker/_utils/getMonthTable.js +0 -82
- package/lib/es/datePicker/_utils/getMonthsInYear.d.ts +0 -2
- package/lib/es/datePicker/_utils/getMonthsInYear.js +0 -5
- package/lib/es/datePicker/_utils/getYears.d.ts +0 -2
- package/lib/es/datePicker/_utils/getYears.js +0 -9
- package/lib/es/datePicker/_utils/index.d.ts +0 -13
- package/lib/es/datePicker/_utils/index.js +0 -13
- package/lib/es/datePicker/_utils/isAfter.d.ts +0 -1
- package/lib/es/datePicker/_utils/isAfter.js +0 -7
- package/lib/es/datePicker/_utils/isBefore.d.ts +0 -1
- package/lib/es/datePicker/_utils/isBefore.js +0 -7
- package/lib/es/datePicker/_utils/isBetween.d.ts +0 -11
- package/lib/es/datePicker/_utils/isBetween.js +0 -23
- package/lib/es/datePicker/_utils/isDate.d.ts +0 -1
- package/lib/es/datePicker/_utils/isDate.js +0 -3
- package/lib/es/datePicker/_utils/isSameDay.d.ts +0 -1
- package/lib/es/datePicker/_utils/isSameDay.js +0 -7
- package/lib/es/datePicker/_utils/isTimestamp.d.ts +0 -1
- package/lib/es/datePicker/_utils/isTimestamp.js +0 -5
- package/lib/es/datePicker/_utils/isUnixTimestamp.d.ts +0 -1
- package/lib/es/datePicker/_utils/isUnixTimestamp.js +0 -5
- package/lib/es/datePicker/_utils/isValidDate.d.ts +0 -1
- package/lib/es/datePicker/_utils/isValidDate.js +0 -3
- package/lib/es/datePicker/_utils/isWithinInterval.d.ts +0 -4
- package/lib/es/datePicker/_utils/isWithinInterval.js +0 -15
- package/lib/es/datePicker/_utils/parser.d.ts +0 -23
- package/lib/es/datePicker/_utils/parser.js +0 -58
- package/lib/es/datePicker/constants.d.ts +0 -53
- package/lib/es/datePicker/constants.js +0 -59
- package/lib/es/datePicker/foundation.d.ts +0 -483
- package/lib/es/datePicker/foundation.js +0 -1433
- package/lib/es/datePicker/inputFoundation.d.ts +0 -133
- package/lib/es/datePicker/inputFoundation.js +0 -371
- package/lib/es/datePicker/monthFoundation.d.ts +0 -74
- package/lib/es/datePicker/monthFoundation.js +0 -73
- package/lib/es/datePicker/monthsGridFoundation.d.ts +0 -253
- package/lib/es/datePicker/monthsGridFoundation.js +0 -1054
- package/lib/es/datePicker/yearAndMonthFoundation.d.ts +0 -65
- package/lib/es/datePicker/yearAndMonthFoundation.js +0 -89
- package/lib/es/descriptions/constants.d.ts +0 -9
- package/lib/es/descriptions/constants.js +0 -10
- package/lib/es/divider/constants.d.ts +0 -7
- package/lib/es/divider/constants.js +0 -8
- package/lib/es/dropdown/constants.d.ts +0 -16
- package/lib/es/dropdown/constants.js +0 -18
- package/lib/es/dropdown/foundation.d.ts +0 -13
- package/lib/es/dropdown/foundation.js +0 -64
- package/lib/es/dropdown/menuFoundation.d.ts +0 -8
- package/lib/es/dropdown/menuFoundation.js +0 -78
- package/lib/es/empty/constants.d.ts +0 -7
- package/lib/es/empty/constants.js +0 -8
- package/lib/es/form/constants.d.ts +0 -11
- package/lib/es/form/constants.js +0 -12
- package/lib/es/form/foundation.d.ts +0 -100
- package/lib/es/form/foundation.js +0 -811
- package/lib/es/form/interface.d.ts +0 -124
- package/lib/es/form/interface.js +0 -1
- package/lib/es/form/utils.d.ts +0 -56
- package/lib/es/form/utils.js +0 -215
- package/lib/es/grid/constants.d.ts +0 -4
- package/lib/es/grid/constants.js +0 -5
- package/lib/es/highlight/constants.d.ts +0 -4
- package/lib/es/highlight/constants.js +0 -5
- package/lib/es/icons/constants.d.ts +0 -9
- package/lib/es/icons/constants.js +0 -11
- package/lib/es/image/constants.d.ts +0 -4
- package/lib/es/image/constants.js +0 -5
- package/lib/es/image/imageFoundation.d.ts +0 -11
- package/lib/es/image/imageFoundation.js +0 -76
- package/lib/es/image/previewFooterFoundation.d.ts +0 -10
- package/lib/es/image/previewFooterFoundation.js +0 -57
- package/lib/es/image/previewFoundation.d.ts +0 -5
- package/lib/es/image/previewFoundation.js +0 -37
- package/lib/es/image/previewImageFoundation.d.ts +0 -59
- package/lib/es/image/previewImageFoundation.js +0 -374
- package/lib/es/image/previewInnerFoundation.d.ts +0 -46
- package/lib/es/image/previewInnerFoundation.js +0 -330
- package/lib/es/image/utils.d.ts +0 -4
- package/lib/es/image/utils.js +0 -93
- package/lib/es/input/constants.d.ts +0 -12
- package/lib/es/input/constants.js +0 -13
- package/lib/es/input/foundation.d.ts +0 -82
- package/lib/es/input/foundation.js +0 -370
- package/lib/es/input/textareaFoundation.d.ts +0 -63
- package/lib/es/input/textareaFoundation.js +0 -276
- package/lib/es/input/util/calculateNodeHeight.d.ts +0 -1
- package/lib/es/input/util/calculateNodeHeight.js +0 -81
- package/lib/es/input/util/getSizingData.d.ts +0 -6
- package/lib/es/input/util/getSizingData.js +0 -32
- package/lib/es/inputNumber/constants.d.ts +0 -18
- package/lib/es/inputNumber/constants.js +0 -11
- package/lib/es/inputNumber/foundation.d.ts +0 -120
- package/lib/es/inputNumber/foundation.js +0 -701
- package/lib/es/layout/constants.d.ts +0 -7
- package/lib/es/layout/constants.js +0 -8
- package/lib/es/list/constants.d.ts +0 -9
- package/lib/es/list/constants.js +0 -10
- package/lib/es/modal/constants.d.ts +0 -10
- package/lib/es/modal/constants.js +0 -11
- package/lib/es/modal/modalContentFoundation.d.ts +0 -42
- package/lib/es/modal/modalContentFoundation.js +0 -72
- package/lib/es/modal/modalFoundation.d.ts +0 -67
- package/lib/es/modal/modalFoundation.js +0 -35
- package/lib/es/navigation/NavItem.d.ts +0 -10
- package/lib/es/navigation/NavItem.js +0 -47
- package/lib/es/navigation/constants.d.ts +0 -21
- package/lib/es/navigation/constants.js +0 -25
- package/lib/es/navigation/foundation.d.ts +0 -85
- package/lib/es/navigation/foundation.js +0 -277
- package/lib/es/navigation/itemFoundation.d.ts +0 -50
- package/lib/es/navigation/itemFoundation.js +0 -89
- package/lib/es/navigation/subNavFoundation.d.ts +0 -45
- package/lib/es/navigation/subNavFoundation.js +0 -138
- package/lib/es/notification/constants.d.ts +0 -14
- package/lib/es/notification/constants.js +0 -16
- package/lib/es/notification/notificationFoundation.d.ts +0 -47
- package/lib/es/notification/notificationFoundation.js +0 -54
- package/lib/es/notification/notificationListFoundation.d.ts +0 -28
- package/lib/es/notification/notificationListFoundation.js +0 -44
- package/lib/es/overflowList/constants.d.ts +0 -25
- package/lib/es/overflowList/constants.js +0 -29
- package/lib/es/overflowList/foundation.d.ts +0 -17
- package/lib/es/overflowList/foundation.js +0 -160
- package/lib/es/pagination/constants.d.ts +0 -12
- package/lib/es/pagination/constants.js +0 -13
- package/lib/es/pagination/foundation.d.ts +0 -52
- package/lib/es/pagination/foundation.js +0 -355
- package/lib/es/popconfirm/constants.d.ts +0 -13
- package/lib/es/popconfirm/constants.js +0 -14
- package/lib/es/popconfirm/popconfirmFoundation.d.ts +0 -18
- package/lib/es/popconfirm/popconfirmFoundation.js +0 -57
- package/lib/es/popover/constants.d.ts +0 -25
- package/lib/es/popover/constants.js +0 -27
- package/lib/es/progress/constants.d.ts +0 -15
- package/lib/es/progress/constants.js +0 -17
- package/lib/es/progress/generates.d.ts +0 -7
- package/lib/es/progress/generates.js +0 -243
- package/lib/es/radio/constants.d.ts +0 -29
- package/lib/es/radio/constants.js +0 -30
- package/lib/es/radio/radioFoundation.d.ts +0 -15
- package/lib/es/radio/radioFoundation.js +0 -51
- package/lib/es/radio/radioGroupFoundation.d.ts +0 -16
- package/lib/es/radio/radioGroupFoundation.js +0 -74
- package/lib/es/radio/radioInnerFoundation.d.ts +0 -22
- package/lib/es/radio/radioInnerFoundation.js +0 -57
- package/lib/es/rating/constants.d.ts +0 -7
- package/lib/es/rating/constants.js +0 -8
- package/lib/es/rating/foundation.d.ts +0 -41
- package/lib/es/rating/foundation.js +0 -263
- package/lib/es/scrollList/constants.d.ts +0 -12
- package/lib/es/scrollList/constants.js +0 -13
- package/lib/es/scrollList/foundation.d.ts +0 -3
- package/lib/es/scrollList/foundation.js +0 -2
- package/lib/es/scrollList/itemFoundation.d.ts +0 -74
- package/lib/es/scrollList/itemFoundation.js +0 -298
- package/lib/es/scrollList/scrollTo.d.ts +0 -3
- package/lib/es/scrollList/scrollTo.js +0 -24
- package/lib/es/select/constants.d.ts +0 -16
- package/lib/es/select/constants.js +0 -19
- package/lib/es/select/foundation.d.ts +0 -136
- package/lib/es/select/foundation.js +0 -1398
- package/lib/es/select/optionFoundation.d.ts +0 -21
- package/lib/es/select/optionFoundation.js +0 -25
- package/lib/es/sideSheet/constants.d.ts +0 -15
- package/lib/es/sideSheet/constants.js +0 -16
- package/lib/es/sideSheet/sideSheetFoundation.d.ts +0 -55
- package/lib/es/sideSheet/sideSheetFoundation.js +0 -59
- package/lib/es/skeleton/constants.d.ts +0 -5
- package/lib/es/skeleton/constants.js +0 -6
- package/lib/es/slider/constants.d.ts +0 -15
- package/lib/es/slider/constants.js +0 -16
- package/lib/es/slider/foundation.d.ts +0 -212
- package/lib/es/slider/foundation.js +0 -937
- package/lib/es/space/constants.d.ts +0 -10
- package/lib/es/space/constants.js +0 -11
- package/lib/es/spin/constants.d.ts +0 -8
- package/lib/es/spin/constants.js +0 -10
- package/lib/es/spin/foundation.d.ts +0 -12
- package/lib/es/spin/foundation.js +0 -45
- package/lib/es/steps/constants.d.ts +0 -5
- package/lib/es/steps/constants.js +0 -6
- package/lib/es/switch/constants.d.ts +0 -19
- package/lib/es/switch/constants.js +0 -20
- package/lib/es/switch/foundation.d.ts +0 -17
- package/lib/es/switch/foundation.js +0 -60
- package/lib/es/table/bodyFoundation.d.ts +0 -38
- package/lib/es/table/bodyFoundation.js +0 -134
- package/lib/es/table/cellFoundation.d.ts +0 -7
- package/lib/es/table/cellFoundation.js +0 -7
- package/lib/es/table/constants.d.ts +0 -77
- package/lib/es/table/constants.js +0 -97
- package/lib/es/table/foundation.d.ts +0 -365
- package/lib/es/table/foundation.js +0 -1181
- package/lib/es/table/tableRowFoundation.d.ts +0 -14
- package/lib/es/table/tableRowFoundation.js +0 -29
- package/lib/es/table/tableSelectionCellFoundation.d.ts +0 -13
- package/lib/es/table/tableSelectionCellFoundation.js +0 -9
- package/lib/es/table/utils.d.ts +0 -102
- package/lib/es/table/utils.js +0 -534
- package/lib/es/tabs/constants.d.ts +0 -32
- package/lib/es/tabs/constants.js +0 -33
- package/lib/es/tabs/foundation.d.ts +0 -28
- package/lib/es/tabs/foundation.js +0 -198
- package/lib/es/tag/constants.d.ts +0 -10
- package/lib/es/tag/constants.js +0 -12
- package/lib/es/tagInput/constants.d.ts +0 -8
- package/lib/es/tagInput/constants.js +0 -9
- package/lib/es/tagInput/foundation.d.ts +0 -74
- package/lib/es/tagInput/foundation.js +0 -373
- package/lib/es/tagInput/utils/getSplitedArray.d.ts +0 -7
- package/lib/es/tagInput/utils/getSplitedArray.js +0 -32
- package/lib/es/timePicker/ComboxFoundation.d.ts +0 -31
- package/lib/es/timePicker/ComboxFoundation.js +0 -156
- package/lib/es/timePicker/constants.d.ts +0 -23
- package/lib/es/timePicker/constants.js +0 -29
- package/lib/es/timePicker/foundation.d.ts +0 -54
- package/lib/es/timePicker/foundation.js +0 -448
- package/lib/es/timePicker/inputFoundation.d.ts +0 -18
- package/lib/es/timePicker/inputFoundation.js +0 -65
- package/lib/es/timePicker/utils/index.d.ts +0 -41
- package/lib/es/timePicker/utils/index.js +0 -148
- package/lib/es/timePicker/utils/localeDate.d.ts +0 -2
- package/lib/es/timePicker/utils/localeDate.js +0 -36
- package/lib/es/timeline/constants.d.ts +0 -10
- package/lib/es/timeline/constants.js +0 -11
- package/lib/es/toast/constants.d.ts +0 -14
- package/lib/es/toast/constants.js +0 -17
- package/lib/es/toast/toastFoundation.d.ts +0 -47
- package/lib/es/toast/toastFoundation.js +0 -52
- package/lib/es/toast/toastListFoundation.d.ts +0 -20
- package/lib/es/toast/toastListFoundation.js +0 -63
- package/lib/es/tooltip/constants.d.ts +0 -23
- package/lib/es/tooltip/constants.js +0 -24
- package/lib/es/tooltip/foundation.d.ts +0 -142
- package/lib/es/tooltip/foundation.js +0 -1310
- package/lib/es/transfer/constants.d.ts +0 -10
- package/lib/es/transfer/constants.js +0 -11
- package/lib/es/transfer/foundation.d.ts +0 -50
- package/lib/es/transfer/foundation.js +0 -266
- package/lib/es/transfer/transferUtils.d.ts +0 -4
- package/lib/es/transfer/transferUtils.js +0 -83
- package/lib/es/tree/constants.d.ts +0 -9
- package/lib/es/tree/constants.js +0 -10
- package/lib/es/tree/foundation.d.ts +0 -286
- package/lib/es/tree/foundation.js +0 -709
- package/lib/es/tree/treeUtil.d.ts +0 -79
- package/lib/es/tree/treeUtil.js +0 -705
- package/lib/es/treeSelect/constants.d.ts +0 -13
- package/lib/es/treeSelect/constants.js +0 -14
- package/lib/es/treeSelect/foundation.d.ts +0 -179
- package/lib/es/treeSelect/foundation.js +0 -902
- package/lib/es/typography/constants.d.ts +0 -12
- package/lib/es/typography/constants.js +0 -13
- package/lib/es/typography/formatNumeral.d.ts +0 -18
- package/lib/es/typography/formatNumeral.js +0 -104
- package/lib/es/upload/constants.d.ts +0 -28
- package/lib/es/upload/constants.js +0 -36
- package/lib/es/upload/foundation.d.ts +0 -167
- package/lib/es/upload/foundation.js +0 -1108
- package/lib/es/upload/utils.d.ts +0 -6
- package/lib/es/upload/utils.js +0 -129
- package/lib/es/utils/Event.d.ts +0 -7
- package/lib/es/utils/Event.js +0 -65
- package/lib/es/utils/FocusHandle.d.ts +0 -26
- package/lib/es/utils/FocusHandle.js +0 -146
- package/lib/es/utils/Logger.d.ts +0 -15
- package/lib/es/utils/Logger.js +0 -74
- package/lib/es/utils/Store.d.ts +0 -9
- package/lib/es/utils/Store.js +0 -38
- package/lib/es/utils/a11y.d.ts +0 -10
- package/lib/es/utils/a11y.js +0 -104
- package/lib/es/utils/array.d.ts +0 -22
- package/lib/es/utils/array.js +0 -46
- package/lib/es/utils/arrayMove.d.ts +0 -1
- package/lib/es/utils/arrayMove.js +0 -5
- package/lib/es/utils/classnames.d.ts +0 -4
- package/lib/es/utils/classnames.js +0 -36
- package/lib/es/utils/date-fns-extra.d.ts +0 -55
- package/lib/es/utils/date-fns-extra.js +0 -120
- package/lib/es/utils/dom.d.ts +0 -27
- package/lib/es/utils/dom.js +0 -67
- package/lib/es/utils/function.d.ts +0 -4
- package/lib/es/utils/function.js +0 -5
- package/lib/es/utils/getDataAttr.d.ts +0 -1
- package/lib/es/utils/getDataAttr.js +0 -9
- package/lib/es/utils/getHighlight.d.ts +0 -45
- package/lib/es/utils/getHighlight.js +0 -187
- package/lib/es/utils/getMotionObjFromProps.d.ts +0 -26
- package/lib/es/utils/getMotionObjFromProps.js +0 -61
- package/lib/es/utils/index.d.ts +0 -2
- package/lib/es/utils/index.js +0 -2
- package/lib/es/utils/isBothNaN.d.ts +0 -8
- package/lib/es/utils/isBothNaN.js +0 -14
- package/lib/es/utils/isElement.d.ts +0 -1
- package/lib/es/utils/isElement.js +0 -12
- package/lib/es/utils/isEnterPress.d.ts +0 -4
- package/lib/es/utils/isEnterPress.js +0 -8
- package/lib/es/utils/isEscPress.d.ts +0 -4
- package/lib/es/utils/isEscPress.js +0 -9
- package/lib/es/utils/isNullOrUndefined.d.ts +0 -6
- package/lib/es/utils/isNullOrUndefined.js +0 -8
- package/lib/es/utils/isNumber.d.ts +0 -1
- package/lib/es/utils/isNumber.js +0 -3
- package/lib/es/utils/isObject.d.ts +0 -1
- package/lib/es/utils/isObject.js +0 -3
- package/lib/es/utils/isPromise.d.ts +0 -1
- package/lib/es/utils/isPromise.js +0 -4
- package/lib/es/utils/isString.d.ts +0 -1
- package/lib/es/utils/isString.js +0 -3
- package/lib/es/utils/keyCode.d.ts +0 -430
- package/lib/es/utils/keyCode.js +0 -534
- package/lib/es/utils/log.d.ts +0 -2
- package/lib/es/utils/log.js +0 -13
- package/lib/es/utils/number.d.ts +0 -10
- package/lib/es/utils/number.js +0 -17
- package/lib/es/utils/object.d.ts +0 -17
- package/lib/es/utils/object.js +0 -138
- package/lib/es/utils/set.d.ts +0 -7
- package/lib/es/utils/set.js +0 -29
- package/lib/es/utils/shallowEqualObjects.d.ts +0 -5
- package/lib/es/utils/shallowEqualObjects.js +0 -27
- package/lib/es/utils/touchPolyfill.d.ts +0 -2
- package/lib/es/utils/touchPolyfill.js +0 -33
- package/lib/es/utils/type.d.ts +0 -31
- package/lib/es/utils/type.js +0 -1
- package/lib/es/utils/uuid.d.ts +0 -18
- package/lib/es/utils/uuid.js +0 -45
- package/lib/es/utils/warning.d.ts +0 -1
- package/lib/es/utils/warning.js +0 -5
|
@@ -1,1078 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
9
|
-
|
|
10
|
-
var _isSet2 = _interopRequireDefault(require("lodash/isSet"));
|
|
11
|
-
|
|
12
|
-
var _includes2 = _interopRequireDefault(require("lodash/includes"));
|
|
13
|
-
|
|
14
|
-
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
15
|
-
|
|
16
|
-
var _constants = require("./constants");
|
|
17
|
-
|
|
18
|
-
var _dateFns = require("date-fns");
|
|
19
|
-
|
|
20
|
-
var _index = require("./_utils/index");
|
|
21
|
-
|
|
22
|
-
var _getMonthTable = require("./_utils/getMonthTable");
|
|
23
|
-
|
|
24
|
-
var _parser = require("./_utils/parser");
|
|
25
|
-
|
|
26
|
-
var _dateFnsExtra = require("../utils/date-fns-extra");
|
|
27
|
-
|
|
28
|
-
var _getDefaultFormatToken = require("./_utils/getDefaultFormatToken");
|
|
29
|
-
|
|
30
|
-
var _isNullOrUndefined = _interopRequireDefault(require("../utils/isNullOrUndefined"));
|
|
31
|
-
|
|
32
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
-
|
|
34
|
-
/* eslint-disable max-len */
|
|
35
|
-
const dateDiffFns = {
|
|
36
|
-
month: _dateFns.differenceInCalendarMonths,
|
|
37
|
-
year: _dateFns.differenceInCalendarYears
|
|
38
|
-
};
|
|
39
|
-
const dateCalcFns = {
|
|
40
|
-
prevMonth: _dateFns.subMonths,
|
|
41
|
-
nextMonth: _dateFns.addMonths,
|
|
42
|
-
prevYear: _dateFns.subYears,
|
|
43
|
-
nextYear: _dateFns.addYears
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
class MonthsGridFoundation extends _foundation.default {
|
|
47
|
-
constructor(adapter) {
|
|
48
|
-
super(Object.assign({}, adapter)); // Date change data when double panels
|
|
49
|
-
|
|
50
|
-
this.newBiMonthPanelDate = [this.getState('monthLeft').pickerDate, this.getState('monthRight').pickerDate];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
init() {
|
|
54
|
-
const defaultValue = this.getProp('defaultValue');
|
|
55
|
-
this.initDefaultPickerValue();
|
|
56
|
-
this.updateSelectedFromProps(defaultValue);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
initDefaultPickerValue() {
|
|
60
|
-
const defaultPickerValue = (0, _parser.compatibleParse)(this.getProp('defaultPickerValue'));
|
|
61
|
-
|
|
62
|
-
if (defaultPickerValue && (0, _index.isValidDate)(defaultPickerValue)) {
|
|
63
|
-
this._updatePanelDetail(_constants.strings.PANEL_TYPE_LEFT, {
|
|
64
|
-
pickerDate: defaultPickerValue
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
this._updatePanelDetail(_constants.strings.PANEL_TYPE_RIGHT, {
|
|
68
|
-
pickerDate: (0, _dateFns.addMonths)(defaultPickerValue, 1)
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
updateSelectedFromProps(values) {
|
|
74
|
-
let refreshPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
75
|
-
const type = this.getProp('type');
|
|
76
|
-
const {
|
|
77
|
-
selected,
|
|
78
|
-
rangeStart,
|
|
79
|
-
rangeEnd
|
|
80
|
-
} = this.getStates();
|
|
81
|
-
|
|
82
|
-
if (values && values.length) {
|
|
83
|
-
switch (type) {
|
|
84
|
-
case 'date':
|
|
85
|
-
this._initDatePickerFromValue(values, refreshPicker);
|
|
86
|
-
|
|
87
|
-
break;
|
|
88
|
-
|
|
89
|
-
case 'dateRange':
|
|
90
|
-
this._initDateRangePickerFromValue(values);
|
|
91
|
-
|
|
92
|
-
break;
|
|
93
|
-
|
|
94
|
-
case 'dateTime':
|
|
95
|
-
this._initDateTimePickerFromValue(values);
|
|
96
|
-
|
|
97
|
-
break;
|
|
98
|
-
|
|
99
|
-
case 'dateTimeRange':
|
|
100
|
-
this._initDateTimeRangePickerFormValue(values);
|
|
101
|
-
|
|
102
|
-
break;
|
|
103
|
-
|
|
104
|
-
default:
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
} else if (Array.isArray(values) && !values.length || !values) {
|
|
108
|
-
// Empty panel when value is empty Select date
|
|
109
|
-
if ((0, _isSet2.default)(selected) && selected.size) {
|
|
110
|
-
this._adapter.updateDaySelected(new Set());
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (rangeStart) {
|
|
114
|
-
this._adapter.setRangeStart('');
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (rangeEnd) {
|
|
118
|
-
this._adapter.setRangeEnd('');
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
calcDisabledTime(panelType) {
|
|
124
|
-
const {
|
|
125
|
-
disabledTime,
|
|
126
|
-
type
|
|
127
|
-
} = this.getProps();
|
|
128
|
-
|
|
129
|
-
if (typeof disabledTime === 'function' && panelType && ['dateTime', 'dateTimeRange'].includes(type)) {
|
|
130
|
-
const {
|
|
131
|
-
rangeStart,
|
|
132
|
-
rangeEnd,
|
|
133
|
-
monthLeft
|
|
134
|
-
} = this.getStates();
|
|
135
|
-
const selected = [];
|
|
136
|
-
|
|
137
|
-
if (type === 'dateTimeRange') {
|
|
138
|
-
if (rangeStart) {
|
|
139
|
-
selected.push(rangeStart);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (rangeStart && rangeEnd) {
|
|
143
|
-
selected.push(rangeEnd);
|
|
144
|
-
}
|
|
145
|
-
} else if (monthLeft && monthLeft.showDate) {
|
|
146
|
-
selected.push(monthLeft.showDate);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
const selectedDates = selected.map(str => str instanceof Date ? str : (0, _dateFns.parseISO)(str));
|
|
150
|
-
const cbDates = type === 'dateTimeRange' ? selectedDates : selectedDates[0];
|
|
151
|
-
return disabledTime(cbDates, panelType);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
_initDatePickerFromValue(values) {
|
|
156
|
-
let refreshPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
157
|
-
const monthLeft = this.getState('monthLeft');
|
|
158
|
-
const newMonthLeft = Object.assign({}, monthLeft); // REMOVE:
|
|
159
|
-
|
|
160
|
-
this._adapter.updateMonthOnLeft(newMonthLeft);
|
|
161
|
-
|
|
162
|
-
const newSelected = new Set();
|
|
163
|
-
|
|
164
|
-
if (!this._isMultiple()) {
|
|
165
|
-
values[0] && newSelected.add((0, _dateFns.format)(values[0], _constants.strings.FORMAT_FULL_DATE));
|
|
166
|
-
} else {
|
|
167
|
-
values.forEach(date => {
|
|
168
|
-
date && newSelected.add((0, _dateFns.format)(date, _constants.strings.FORMAT_FULL_DATE));
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (refreshPicker) {
|
|
173
|
-
this.handleShowDateAndTime(_constants.strings.PANEL_TYPE_LEFT, values[0] || newMonthLeft.pickerDate);
|
|
174
|
-
} else {
|
|
175
|
-
// FIXME:
|
|
176
|
-
this.handleShowDateAndTime(_constants.strings.PANEL_TYPE_LEFT, newMonthLeft.pickerDate);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
this._adapter.updateDaySelected(newSelected);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
_initDateRangePickerFromValue(values) {
|
|
183
|
-
let withTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
184
|
-
// init month panel
|
|
185
|
-
const monthLeft = this.getState('monthLeft');
|
|
186
|
-
const monthRight = this.getState('monthRight');
|
|
187
|
-
|
|
188
|
-
const adjustResult = this._autoAdjustMonth(Object.assign(Object.assign({}, monthLeft), {
|
|
189
|
-
pickerDate: values[0] || monthLeft.pickerDate
|
|
190
|
-
}), Object.assign(Object.assign({}, monthRight), {
|
|
191
|
-
pickerDate: values[1] || monthRight.pickerDate
|
|
192
|
-
}));
|
|
193
|
-
|
|
194
|
-
this.handleShowDateAndTime(_constants.strings.PANEL_TYPE_LEFT, adjustResult.monthLeft.pickerDate);
|
|
195
|
-
this.handleShowDateAndTime(_constants.strings.PANEL_TYPE_RIGHT, adjustResult.monthRight.pickerDate); // init range
|
|
196
|
-
|
|
197
|
-
const formatToken = withTime ? _constants.strings.FORMAT_DATE_TIME : _constants.strings.FORMAT_FULL_DATE;
|
|
198
|
-
let rangeStart = values[0] && (0, _dateFns.format)(values[0], formatToken);
|
|
199
|
-
let rangeEnd = values[1] && (0, _dateFns.format)(values[1], formatToken);
|
|
200
|
-
|
|
201
|
-
if (this._isNeedSwap(rangeStart, rangeEnd)) {
|
|
202
|
-
[rangeStart, rangeEnd] = [rangeEnd, rangeStart];
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
this._adapter.setRangeStart(rangeStart);
|
|
206
|
-
|
|
207
|
-
this._adapter.setRangeEnd(rangeEnd);
|
|
208
|
-
|
|
209
|
-
this._adapter.setHoverDay(rangeEnd);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
_initDateTimePickerFromValue(values) {
|
|
213
|
-
this._initDatePickerFromValue(values);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
_initDateTimeRangePickerFormValue(values) {
|
|
217
|
-
this._initDateRangePickerFromValue(values, true);
|
|
218
|
-
} // eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
destroy() {}
|
|
222
|
-
/**
|
|
223
|
-
* sync change another panel month when change months from the else yam panel
|
|
224
|
-
* call it when
|
|
225
|
-
* - current change panel targe date month is same with another panel date
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* - panelType=right, target=new Date('2022-09-01') and left panel is in '2022-09' => call it, left panel minus one month to '2022-08'
|
|
229
|
-
* - panelType=left, target=new Date('2021-12-01') and right panel is in '2021-12' => call it, right panel add one month to '2021-01'
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
handleSyncChangeMonths(options) {
|
|
234
|
-
const {
|
|
235
|
-
panelType,
|
|
236
|
-
target
|
|
237
|
-
} = options;
|
|
238
|
-
|
|
239
|
-
const {
|
|
240
|
-
type
|
|
241
|
-
} = this._adapter.getProps();
|
|
242
|
-
|
|
243
|
-
const {
|
|
244
|
-
monthLeft,
|
|
245
|
-
monthRight
|
|
246
|
-
} = this._adapter.getStates();
|
|
247
|
-
|
|
248
|
-
if (this.isRangeType(type)) {
|
|
249
|
-
if (panelType === 'right' && (0, _dateFns.differenceInCalendarMonths)(target, monthLeft.pickerDate) === 0) {
|
|
250
|
-
this.handleYearOrMonthChange('prevMonth', 'left', 1, true);
|
|
251
|
-
} else if (panelType === 'left' && (0, _dateFns.differenceInCalendarMonths)(monthRight.pickerDate, target) === 0) {
|
|
252
|
-
this.handleYearOrMonthChange('nextMonth', 'right', 1, true);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Get the target date based on the panel type and switch type
|
|
258
|
-
*/
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
getTargetChangeDate(options) {
|
|
262
|
-
const {
|
|
263
|
-
panelType,
|
|
264
|
-
switchType
|
|
265
|
-
} = options;
|
|
266
|
-
|
|
267
|
-
const {
|
|
268
|
-
monthRight,
|
|
269
|
-
monthLeft
|
|
270
|
-
} = this._adapter.getStates();
|
|
271
|
-
|
|
272
|
-
const currentDate = panelType === 'left' ? monthLeft.pickerDate : monthRight.pickerDate;
|
|
273
|
-
let target;
|
|
274
|
-
|
|
275
|
-
switch (switchType) {
|
|
276
|
-
case 'prevMonth':
|
|
277
|
-
target = (0, _dateFns.addMonths)(currentDate, -1);
|
|
278
|
-
break;
|
|
279
|
-
|
|
280
|
-
case 'nextMonth':
|
|
281
|
-
target = (0, _dateFns.addMonths)(currentDate, 1);
|
|
282
|
-
break;
|
|
283
|
-
|
|
284
|
-
case 'prevYear':
|
|
285
|
-
target = (0, _dateFns.addYears)(currentDate, -1);
|
|
286
|
-
break;
|
|
287
|
-
|
|
288
|
-
case 'nextYear':
|
|
289
|
-
target = (0, _dateFns.addYears)(currentDate, 1);
|
|
290
|
-
break;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
return target;
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Change month by yam panel
|
|
297
|
-
*/
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
toMonth(panelType, target) {
|
|
301
|
-
const {
|
|
302
|
-
type
|
|
303
|
-
} = this._adapter.getProps();
|
|
304
|
-
|
|
305
|
-
const diff = this._getDiff('month', target, panelType);
|
|
306
|
-
|
|
307
|
-
this.handleYearOrMonthChange(diff < 0 ? 'prevMonth' : 'nextMonth', panelType, Math.abs(diff), false);
|
|
308
|
-
|
|
309
|
-
if (this.isRangeType(type)) {
|
|
310
|
-
this.handleSyncChangeMonths({
|
|
311
|
-
panelType,
|
|
312
|
-
target
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
toYear(panelType, target) {
|
|
318
|
-
const diff = this._getDiff('year', target, panelType);
|
|
319
|
-
|
|
320
|
-
this.handleYearOrMonthChange(diff < 0 ? 'prevYear' : 'nextYear', panelType, Math.abs(diff), false);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
toYearMonth(panelType, target) {
|
|
324
|
-
this.toYear(panelType, target);
|
|
325
|
-
this.toMonth(panelType, target);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
isRangeType(type) {
|
|
329
|
-
const {
|
|
330
|
-
type: typeFromProp
|
|
331
|
-
} = this.getProps();
|
|
332
|
-
const realType = type ? type : typeFromProp;
|
|
333
|
-
return typeof realType === 'string' && /range/i.test(realType);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
handleSwitchMonthOrYear(switchType, panelType) {
|
|
337
|
-
const {
|
|
338
|
-
type,
|
|
339
|
-
syncSwitchMonth
|
|
340
|
-
} = this.getProps();
|
|
341
|
-
const rangeType = this.isRangeType(type); // range type and syncSwitchMonth, we should change panels at same time
|
|
342
|
-
|
|
343
|
-
if (rangeType && syncSwitchMonth) {
|
|
344
|
-
this.handleYearOrMonthChange(switchType, 'left', 1, true);
|
|
345
|
-
this.handleYearOrMonthChange(switchType, 'right', 1, true);
|
|
346
|
-
} else {
|
|
347
|
-
this.handleYearOrMonthChange(switchType, panelType);
|
|
348
|
-
/**
|
|
349
|
-
* default behavior (v2.2.0)
|
|
350
|
-
* In order to prevent the two panels from being the same month, this will confuse the user when selecting the range
|
|
351
|
-
* https://github.com/DouyinFE/semi-design/issues/260
|
|
352
|
-
*/
|
|
353
|
-
|
|
354
|
-
if (rangeType) {
|
|
355
|
-
const target = this.getTargetChangeDate({
|
|
356
|
-
panelType,
|
|
357
|
-
switchType
|
|
358
|
-
});
|
|
359
|
-
this.handleSyncChangeMonths({
|
|
360
|
-
panelType,
|
|
361
|
-
target
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
prevMonth(panelType) {
|
|
368
|
-
this.handleSwitchMonthOrYear('prevMonth', panelType);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
nextMonth(panelType) {
|
|
372
|
-
this.handleSwitchMonthOrYear('nextMonth', panelType);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
prevYear(panelType) {
|
|
376
|
-
this.handleSwitchMonthOrYear('prevYear', panelType);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
nextYear(panelType) {
|
|
380
|
-
this.handleSwitchMonthOrYear('nextYear', panelType);
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Calculate the year and month difference
|
|
384
|
-
*/
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
_getDiff(type, target, panelType) {
|
|
388
|
-
const panelDetail = this._getPanelDetail(panelType);
|
|
389
|
-
|
|
390
|
-
const diff = dateDiffFns[type] && dateDiffFns[type](target, panelDetail.pickerDate);
|
|
391
|
-
return diff;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
_getPanelDetail(panelType) {
|
|
395
|
-
return panelType === _constants.strings.PANEL_TYPE_RIGHT ? this.getState('monthRight') : this.getState('monthLeft');
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* Format locale date
|
|
399
|
-
* locale get from LocaleProvider
|
|
400
|
-
* @param {Date} date
|
|
401
|
-
* @param {String} token
|
|
402
|
-
* @returns
|
|
403
|
-
*/
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
localeFormat(date, token) {
|
|
407
|
-
const dateFnsLocale = this._adapter.getProp('dateFnsLocale');
|
|
408
|
-
|
|
409
|
-
return (0, _dateFns.format)(date, token, {
|
|
410
|
-
locale: dateFnsLocale
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
isValidTimeZone(timeZone) {
|
|
415
|
-
const propTimeZone = this.getProp('timeZone');
|
|
416
|
-
|
|
417
|
-
const _timeZone = (0, _isNullOrUndefined.default)(timeZone) ? propTimeZone : timeZone;
|
|
418
|
-
|
|
419
|
-
return ['string', 'number'].includes(typeof _timeZone) && _timeZone !== '';
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* 根据 type 处理 onChange 返回的参数
|
|
423
|
-
*
|
|
424
|
-
* - 返回的日期需要把用户时间转换为设置的时区时间
|
|
425
|
-
* - 用户时间:用户计算机系统时间
|
|
426
|
-
* - 时区时间:通过 ConfigProvider 设置的 timeZone
|
|
427
|
-
* - 例子:用户设置时区为+9,计算机所在时区为+8区,然后用户选择了22:00
|
|
428
|
-
* - DatePicker 内部保存日期 state 为 +8 的 22:00 => a = new Date("2021-05-25 22:00:00")
|
|
429
|
-
* - 传出去时,需要把 +8 的 22:00 => +9 的 22:00 => b = zonedTimeToUtc(a, "+09:00");
|
|
430
|
-
*
|
|
431
|
-
* The parameters returned by onChange are processed according to type
|
|
432
|
-
*
|
|
433
|
-
* -The returned date needs to convert the user time to the set time zone time
|
|
434
|
-
* -User time: user computer system time
|
|
435
|
-
* -Time zone: timeZone set by ConfigProvider
|
|
436
|
-
* -Example: The user sets the time zone to + 9, and the time zone where the computer is located is + 8, and then the user selects 22:00
|
|
437
|
-
* -DatePicker internal save date state is + 8 22:00 = > a = new Date ("2021-05-25 22:00:00")
|
|
438
|
-
* -When passing out, you need to put + 8's 22:00 = > + 9's 22:00 = > b = zonedTimeToUtc (a, "+ 09:00");
|
|
439
|
-
*
|
|
440
|
-
* e.g.
|
|
441
|
-
* let a = new Date ("2021-05-25 22:00:00");
|
|
442
|
-
* = > Tue May 25 2021 22:00:00 GMT + 0800 (China Standard Time)
|
|
443
|
-
* let b = zonedTimeToUtc (a, "+ 09:00");
|
|
444
|
-
* = > Tue May 25 2021 21:00:00 GMT + 0800 (China Standard Time)
|
|
445
|
-
*
|
|
446
|
-
* @param {Date|Date[]} value
|
|
447
|
-
*/
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
disposeCallbackArgs(value) {
|
|
451
|
-
let _value = Array.isArray(value) ? value : value && [value] || [];
|
|
452
|
-
|
|
453
|
-
if (this.isValidTimeZone()) {
|
|
454
|
-
const timeZone = this.getProp('timeZone');
|
|
455
|
-
_value = _value.map(date => (0, _dateFnsExtra.zonedTimeToUtc)(date, timeZone));
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
const type = this.getProp('type');
|
|
459
|
-
const formatToken = this.getProp('format') || (0, _getDefaultFormatToken.getDefaultFormatTokenByType)(type);
|
|
460
|
-
let notifyValue, notifyDate;
|
|
461
|
-
|
|
462
|
-
switch (type) {
|
|
463
|
-
case 'date':
|
|
464
|
-
case 'dateTime':
|
|
465
|
-
case 'month':
|
|
466
|
-
if (!this._isMultiple()) {
|
|
467
|
-
notifyValue = _value[0] && this.localeFormat(_value[0], formatToken);
|
|
468
|
-
[notifyDate] = _value;
|
|
469
|
-
} else {
|
|
470
|
-
notifyValue = _value.map(v => v && this.localeFormat(v, formatToken));
|
|
471
|
-
notifyDate = [..._value];
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
break;
|
|
475
|
-
|
|
476
|
-
case 'dateRange':
|
|
477
|
-
case 'dateTimeRange':
|
|
478
|
-
notifyValue = _value.map(v => v && this.localeFormat(v, formatToken));
|
|
479
|
-
notifyDate = [..._value];
|
|
480
|
-
break;
|
|
481
|
-
|
|
482
|
-
default:
|
|
483
|
-
break;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
return {
|
|
487
|
-
notifyValue,
|
|
488
|
-
notifyDate
|
|
489
|
-
};
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
handleYearOrMonthChange(type) {
|
|
493
|
-
let panelType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _constants.strings.PANEL_TYPE_LEFT;
|
|
494
|
-
let step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
495
|
-
let notSeparateInRange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
496
|
-
const {
|
|
497
|
-
autoSwitchDate,
|
|
498
|
-
type: datePanelType
|
|
499
|
-
} = this.getProps();
|
|
500
|
-
const {
|
|
501
|
-
monthLeft,
|
|
502
|
-
monthRight
|
|
503
|
-
} = this.getStates();
|
|
504
|
-
const isRangeType = this.isRangeType(datePanelType);
|
|
505
|
-
const isLeftPanelInRange = isRangeType && panelType === _constants.strings.PANEL_TYPE_LEFT;
|
|
506
|
-
|
|
507
|
-
const panelDetail = this._getPanelDetail(panelType);
|
|
508
|
-
|
|
509
|
-
const {
|
|
510
|
-
pickerDate
|
|
511
|
-
} = panelDetail;
|
|
512
|
-
const fn = dateCalcFns[type];
|
|
513
|
-
const targetMonth = fn(pickerDate, step); // Determine if the date has changed
|
|
514
|
-
|
|
515
|
-
const panelDateHasUpdate = panelType === _constants.strings.PANEL_TYPE_LEFT && !(0, _isEqual2.default)(targetMonth, monthLeft.pickerDate) || panelType === _constants.strings.PANEL_TYPE_RIGHT && !(0, _isEqual2.default)(targetMonth, monthRight.pickerDate);
|
|
516
|
-
|
|
517
|
-
this._updatePanelDetail(panelType, {
|
|
518
|
-
pickerDate: targetMonth
|
|
519
|
-
});
|
|
520
|
-
|
|
521
|
-
if (panelDateHasUpdate) {
|
|
522
|
-
// When the date changes
|
|
523
|
-
if (!isRangeType) {
|
|
524
|
-
// Single Panel Type
|
|
525
|
-
const {
|
|
526
|
-
notifyValue,
|
|
527
|
-
notifyDate
|
|
528
|
-
} = this.disposeCallbackArgs(targetMonth);
|
|
529
|
-
|
|
530
|
-
this._adapter.notifyPanelChange(notifyDate, notifyValue);
|
|
531
|
-
} else {
|
|
532
|
-
// Double Panel Type
|
|
533
|
-
if (isLeftPanelInRange) {
|
|
534
|
-
// Left panel
|
|
535
|
-
this.newBiMonthPanelDate[0] = targetMonth;
|
|
536
|
-
} else {
|
|
537
|
-
// Right panel
|
|
538
|
-
this.newBiMonthPanelDate[1] = targetMonth;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
if (!(isLeftPanelInRange && notSeparateInRange)) {
|
|
542
|
-
// Not synchronously switching the left panel in the scene
|
|
543
|
-
const {
|
|
544
|
-
notifyValue,
|
|
545
|
-
notifyDate
|
|
546
|
-
} = this.disposeCallbackArgs(this.newBiMonthPanelDate);
|
|
547
|
-
|
|
548
|
-
this._adapter.notifyPanelChange(notifyDate, notifyValue);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
if (autoSwitchDate) {
|
|
554
|
-
this.updateDateAfterChangeYM(type, targetMonth);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
/**
|
|
558
|
-
* You have chosen to switch the year and month in the future to directly update the Date without closing the date panel
|
|
559
|
-
* @param {*} type
|
|
560
|
-
* @param {*} targetDate
|
|
561
|
-
*/
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
updateDateAfterChangeYM(type, targetDate) {
|
|
565
|
-
const {
|
|
566
|
-
multiple,
|
|
567
|
-
disabledDate,
|
|
568
|
-
type: dateType
|
|
569
|
-
} = this.getProps();
|
|
570
|
-
const {
|
|
571
|
-
selected: selectedSet,
|
|
572
|
-
rangeStart,
|
|
573
|
-
rangeEnd,
|
|
574
|
-
monthLeft
|
|
575
|
-
} = this.getStates(); // FIXME:
|
|
576
|
-
|
|
577
|
-
const includeRange = ['dateRange', 'dateTimeRange'].includes(type);
|
|
578
|
-
const options = {
|
|
579
|
-
closePanel: false
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
if (!multiple && !includeRange && selectedSet.size) {
|
|
583
|
-
const selectedStr = Array.from(selectedSet)[0];
|
|
584
|
-
const selectedDate = new Date(selectedStr);
|
|
585
|
-
const year = targetDate.getFullYear();
|
|
586
|
-
const month = targetDate.getMonth();
|
|
587
|
-
let fullDate = (0, _dateFns.set)(selectedDate, {
|
|
588
|
-
year,
|
|
589
|
-
month
|
|
590
|
-
});
|
|
591
|
-
|
|
592
|
-
if (dateType === 'dateTime') {
|
|
593
|
-
/**
|
|
594
|
-
* 如果是 type dateTime 切换月份要读取只取的time
|
|
595
|
-
* 无论 monthLeft 还是 monthRight 他们的 time 是不变的,所以只取 monthLeft 即可
|
|
596
|
-
*/
|
|
597
|
-
fullDate = this._mergeDateAndTime(fullDate, monthLeft.pickerDate);
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
if (disabledDate(fullDate, {
|
|
601
|
-
rangeStart,
|
|
602
|
-
rangeEnd
|
|
603
|
-
})) {
|
|
604
|
-
return;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
this._adapter.notifySelectedChange([fullDate], options);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
_isMultiple() {
|
|
612
|
-
return Boolean(this.getProp('multiple')) && this.getProp('type') === 'date';
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
_isRange() {// return this._adapter.getProp('type') === dateRangeTypeKey;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
handleDayClick(day, panelType) {
|
|
619
|
-
const type = this.getProp('type');
|
|
620
|
-
|
|
621
|
-
switch (true) {
|
|
622
|
-
case type === 'date' || type === 'dateTime':
|
|
623
|
-
this.handleDateSelected(day, panelType);
|
|
624
|
-
break;
|
|
625
|
-
|
|
626
|
-
case type === 'dateRange' || type === 'dateTimeRange':
|
|
627
|
-
this.handleRangeSelected(day);
|
|
628
|
-
break;
|
|
629
|
-
|
|
630
|
-
default:
|
|
631
|
-
break;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
handleDateSelected(day, panelType) {
|
|
636
|
-
const {
|
|
637
|
-
max,
|
|
638
|
-
type,
|
|
639
|
-
isControlledComponent,
|
|
640
|
-
dateFnsLocale
|
|
641
|
-
} = this.getProps();
|
|
642
|
-
|
|
643
|
-
const multiple = this._isMultiple();
|
|
644
|
-
|
|
645
|
-
const {
|
|
646
|
-
selected
|
|
647
|
-
} = this.getStates();
|
|
648
|
-
|
|
649
|
-
const monthDetail = this._getPanelDetail(panelType);
|
|
650
|
-
|
|
651
|
-
const newSelected = new Set(multiple ? [...selected] : []);
|
|
652
|
-
const {
|
|
653
|
-
fullDate
|
|
654
|
-
} = day;
|
|
655
|
-
const time = monthDetail.pickerDate;
|
|
656
|
-
const dateStr = type === 'dateTime' ? this._mergeDateAndTime(fullDate, time) : fullDate;
|
|
657
|
-
|
|
658
|
-
if (!multiple) {
|
|
659
|
-
newSelected.add(dateStr);
|
|
660
|
-
} else {
|
|
661
|
-
if (newSelected.has(dateStr)) {
|
|
662
|
-
newSelected.delete(dateStr);
|
|
663
|
-
} else if (max && newSelected.size === max) {
|
|
664
|
-
this._adapter.notifyMaxLimit();
|
|
665
|
-
} else {
|
|
666
|
-
newSelected.add(dateStr);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
const dateFormat = this.getValidDateFormat(); // When passed to the upper layer, it is converted into a Date object to ensure that the input parameter format of initFormDefaultValue is consistent
|
|
671
|
-
|
|
672
|
-
const newSelectedDates = [...newSelected].map(_dateStr => (0, _parser.compatibleParse)(_dateStr, dateFormat, undefined, dateFnsLocale));
|
|
673
|
-
this.handleShowDateAndTime(panelType, time);
|
|
674
|
-
|
|
675
|
-
if (!isControlledComponent) {
|
|
676
|
-
// Uncontrolled components, update internal values when operating, and notify external
|
|
677
|
-
// MonthGrid internally uses string to represent fullDate for easy rendering
|
|
678
|
-
this._adapter.updateDaySelected(newSelected);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
this._adapter.notifySelectedChange(newSelectedDates);
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
handleShowDateAndTime(panelType, pickerDate, showDate) {
|
|
685
|
-
const _showDate = showDate || pickerDate;
|
|
686
|
-
|
|
687
|
-
this._updatePanelDetail(panelType, {
|
|
688
|
-
showDate: _showDate,
|
|
689
|
-
pickerDate
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
/**
|
|
693
|
-
* link date and time
|
|
694
|
-
*
|
|
695
|
-
* @param {Date|string} date
|
|
696
|
-
* @param {Date|string} time
|
|
697
|
-
* @returns {Date}
|
|
698
|
-
*/
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
_mergeDateAndTime(date, time) {
|
|
702
|
-
const dateFnsLocale = this._adapter.getProp('dateFnsLocale');
|
|
703
|
-
|
|
704
|
-
const dateStr = (0, _dateFns.format)((0, _index.isValidDate)(date) ? date : (0, _parser.compatibleParse)(date, _constants.strings.FORMAT_FULL_DATE, undefined, dateFnsLocale), _constants.strings.FORMAT_FULL_DATE);
|
|
705
|
-
const timeStr = (0, _dateFns.format)((0, _index.isValidDate)(time) ? time : (0, _parser.compatibleParse)(time, _constants.strings.FORMAT_TIME_PICKER, undefined, dateFnsLocale), _constants.strings.FORMAT_TIME_PICKER);
|
|
706
|
-
const timeFormat = this.getValidTimeFormat();
|
|
707
|
-
return (0, _parser.compatibleParse)("".concat(dateStr, " ").concat(timeStr), timeFormat, undefined, dateFnsLocale);
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
handleRangeSelected(day) {
|
|
711
|
-
let {
|
|
712
|
-
rangeStart,
|
|
713
|
-
rangeEnd
|
|
714
|
-
} = this.getStates();
|
|
715
|
-
|
|
716
|
-
const {
|
|
717
|
-
startDateOffset,
|
|
718
|
-
endDateOffset,
|
|
719
|
-
type,
|
|
720
|
-
dateFnsLocale,
|
|
721
|
-
rangeInputFocus,
|
|
722
|
-
triggerRender
|
|
723
|
-
} = this._adapter.getProps();
|
|
724
|
-
|
|
725
|
-
const {
|
|
726
|
-
fullDate
|
|
727
|
-
} = day;
|
|
728
|
-
let rangeStartReset = false;
|
|
729
|
-
let rangeEndReset = false;
|
|
730
|
-
const isDateRangeAndHasOffset = (startDateOffset || endDateOffset) && type === 'dateRange';
|
|
731
|
-
|
|
732
|
-
if (isDateRangeAndHasOffset) {
|
|
733
|
-
rangeStart = (0, _index.getFullDateOffset)(startDateOffset, fullDate);
|
|
734
|
-
rangeEnd = (0, _index.getFullDateOffset)(endDateOffset, fullDate);
|
|
735
|
-
} else {
|
|
736
|
-
if (rangeInputFocus === 'rangeEnd') {
|
|
737
|
-
rangeEnd = fullDate; // rangStart Parten in dateTime: 'yyyy-MM-dd HH:MM:SS', rangeEnd parten: 'yyyy-MM-dd'
|
|
738
|
-
|
|
739
|
-
if (rangeStart && rangeEnd && (0, _index.isBefore)(rangeEnd, rangeStart.trim().split(/\s+/)[0])) {
|
|
740
|
-
rangeStart = null;
|
|
741
|
-
rangeStartReset = true;
|
|
742
|
-
} // Compatible to select date after opening the panel without click input
|
|
743
|
-
|
|
744
|
-
} else if (rangeInputFocus === 'rangeStart' || !rangeInputFocus) {
|
|
745
|
-
rangeStart = fullDate; // rangEnd Parten in dateTime: 'yyyy-MM-dd HH:MM:SS', rangeStart parten: 'yyyy-MM-dd'
|
|
746
|
-
|
|
747
|
-
if (rangeStart && rangeEnd && (0, _index.isBefore)(rangeEnd.trim().split(/\s+/)[0], rangeStart)) {
|
|
748
|
-
rangeEnd = null;
|
|
749
|
-
rangeEndReset = true;
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
} // next focus logic
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
const isRangeType = /range/i.test(type);
|
|
756
|
-
|
|
757
|
-
if (isRangeType) {
|
|
758
|
-
if (isDateRangeAndHasOffset) {
|
|
759
|
-
this._adapter.setRangeStart(rangeStart);
|
|
760
|
-
|
|
761
|
-
this._adapter.setRangeEnd(rangeEnd);
|
|
762
|
-
} else {
|
|
763
|
-
if (rangeInputFocus === 'rangeEnd') {
|
|
764
|
-
this._adapter.setRangeEnd(rangeEnd);
|
|
765
|
-
|
|
766
|
-
if (rangeStartReset) {
|
|
767
|
-
this._adapter.setRangeStart(rangeStart);
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
if (!this._adapter.isAnotherPanelHasOpened('rangeEnd') || !rangeStart) {
|
|
771
|
-
this._adapter.setRangeInputFocus('rangeStart');
|
|
772
|
-
}
|
|
773
|
-
} else if (rangeInputFocus === 'rangeStart' || !rangeInputFocus) {
|
|
774
|
-
this._adapter.setRangeStart(rangeStart);
|
|
775
|
-
|
|
776
|
-
if (rangeEndReset) {
|
|
777
|
-
this._adapter.setRangeEnd(rangeEnd);
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
if (!this._adapter.isAnotherPanelHasOpened('rangeStart') || !rangeEnd) {
|
|
781
|
-
this._adapter.setRangeInputFocus('rangeEnd');
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
const dateFormat = this.getValidDateFormat(); // only notify when choose completed
|
|
788
|
-
|
|
789
|
-
if (rangeStart || rangeEnd) {
|
|
790
|
-
const [startDate, endDate] = [(0, _parser.compatibleParse)(rangeStart, dateFormat, undefined, dateFnsLocale), (0, _parser.compatibleParse)(rangeEnd, dateFormat, undefined, dateFnsLocale)];
|
|
791
|
-
let date = [startDate, endDate]; // If the type is dateRangeTime, add the value of time
|
|
792
|
-
|
|
793
|
-
if (type === 'dateTimeRange') {
|
|
794
|
-
const startTime = this.getState('monthLeft').pickerDate;
|
|
795
|
-
const endTime = this.getState('monthRight').pickerDate;
|
|
796
|
-
const start = rangeStart ? this._mergeDateAndTime(rangeStart, startTime) : null;
|
|
797
|
-
const end = rangeEnd ? this._mergeDateAndTime(rangeEnd, endTime) : null;
|
|
798
|
-
|
|
799
|
-
if ((0, _dateFns.isSameDay)(startDate, endDate) && (0, _index.isBefore)(end, start)) {
|
|
800
|
-
date = [start, start];
|
|
801
|
-
} else {
|
|
802
|
-
date = [start, end];
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
/**
|
|
806
|
-
* no need to check focus then
|
|
807
|
-
* - dateRange and isDateRangeAndHasOffset
|
|
808
|
-
*/
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
const needCheckFocusRecord = !(type === 'dateRange' && isDateRangeAndHasOffset);
|
|
812
|
-
|
|
813
|
-
this._adapter.notifySelectedChange(date, {
|
|
814
|
-
needCheckFocusRecord
|
|
815
|
-
});
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
_isNeedSwap(rangeStart, rangeEnd) {
|
|
820
|
-
// Check whether the start and end are reasonable and whether they need to be reversed
|
|
821
|
-
return rangeStart && rangeEnd && (0, _index.isBefore)(rangeEnd, rangeStart);
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* Day may be empty, this is unhover state
|
|
825
|
-
* @param {*} day
|
|
826
|
-
*/
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
handleDayHover() {
|
|
830
|
-
let day = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
831
|
-
fullDate: ''
|
|
832
|
-
};
|
|
833
|
-
let panelType = arguments.length > 1 ? arguments[1] : undefined;
|
|
834
|
-
const {
|
|
835
|
-
fullDate
|
|
836
|
-
} = day;
|
|
837
|
-
const {
|
|
838
|
-
startDateOffset,
|
|
839
|
-
endDateOffset,
|
|
840
|
-
type
|
|
841
|
-
} = this.getProps();
|
|
842
|
-
|
|
843
|
-
this._adapter.setHoverDay(fullDate);
|
|
844
|
-
|
|
845
|
-
if ((startDateOffset || endDateOffset) && type === 'dateRange') {
|
|
846
|
-
const offsetRangeStart = (0, _index.getFullDateOffset)(startDateOffset, fullDate);
|
|
847
|
-
const offsetRangeEnd = (0, _index.getFullDateOffset)(endDateOffset, fullDate);
|
|
848
|
-
|
|
849
|
-
this._adapter.setOffsetRangeStart(offsetRangeStart);
|
|
850
|
-
|
|
851
|
-
this._adapter.setOffsetRangeEnd(offsetRangeEnd);
|
|
852
|
-
}
|
|
853
|
-
} // Guarantee that monthLeft, monthRight will not appear in the same month or monthLeft is greater than MonthRight
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
_autoAdjustMonth(monthLeft, monthRight) {
|
|
857
|
-
let newMonthLeft = monthLeft;
|
|
858
|
-
let newMonthRight = monthRight;
|
|
859
|
-
const difference = (0, _dateFns.differenceInCalendarMonths)(monthLeft.pickerDate, monthRight.pickerDate);
|
|
860
|
-
|
|
861
|
-
if (difference > 0) {
|
|
862
|
-
// The month on the left is larger than the month on the right, swap
|
|
863
|
-
newMonthLeft = Object.assign({}, monthRight);
|
|
864
|
-
newMonthRight = Object.assign({}, monthLeft);
|
|
865
|
-
} else if (difference === 0) {
|
|
866
|
-
// Around the same month, the number of months on the right + 1
|
|
867
|
-
newMonthLeft = monthLeft;
|
|
868
|
-
newMonthRight = Object.assign(Object.assign({}, monthRight), {
|
|
869
|
-
pickerDate: (0, _dateFns.addMonths)(monthRight.pickerDate, 1)
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
return {
|
|
874
|
-
monthLeft: newMonthLeft,
|
|
875
|
-
monthRight: newMonthRight
|
|
876
|
-
};
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
getValidTimeFormat() {
|
|
880
|
-
const formatProp = this.getProp('format') || _constants.strings.FORMAT_TIME_PICKER;
|
|
881
|
-
|
|
882
|
-
const timeFormatTokens = [];
|
|
883
|
-
|
|
884
|
-
if ((0, _includes2.default)(formatProp, 'h') || (0, _includes2.default)(formatProp, 'H')) {
|
|
885
|
-
timeFormatTokens.push('HH');
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
if ((0, _includes2.default)(formatProp, 'm')) {
|
|
889
|
-
timeFormatTokens.push('mm');
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
if ((0, _includes2.default)(formatProp, 's')) {
|
|
893
|
-
timeFormatTokens.push('ss');
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
return timeFormatTokens.join(':');
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
getValidDateFormat() {
|
|
900
|
-
return this.getProp('format') || (0, _index.getDefaultFormatToken)(this.getProp('type'));
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
handleTimeChange(newTime, panelType) {
|
|
904
|
-
const {
|
|
905
|
-
rangeEnd,
|
|
906
|
-
rangeStart
|
|
907
|
-
} = this.getStates();
|
|
908
|
-
const dateFnsLocale = this.getProp('dateFnsLocale');
|
|
909
|
-
const ts = newTime.timeStampValue;
|
|
910
|
-
const type = this.getProp('type');
|
|
911
|
-
|
|
912
|
-
const panelDetail = this._getPanelDetail(panelType);
|
|
913
|
-
|
|
914
|
-
const {
|
|
915
|
-
showDate
|
|
916
|
-
} = panelDetail;
|
|
917
|
-
const timeDate = new Date(ts);
|
|
918
|
-
const dateFormat = this.getValidDateFormat();
|
|
919
|
-
const destRange = panelType === _constants.strings.PANEL_TYPE_RIGHT ? rangeEnd : rangeStart;
|
|
920
|
-
let year, monthNo, date; // if (pickerDate && isValidDate(pickerDate)) {
|
|
921
|
-
// year = pickerDate.getFullYear();
|
|
922
|
-
// monthNo = pickerDate.getMonth();
|
|
923
|
-
// date = pickerDate.getDate();
|
|
924
|
-
// } else
|
|
925
|
-
|
|
926
|
-
if (type === 'dateTimeRange' && destRange) {
|
|
927
|
-
const rangeDate = (0, _parser.compatibleParse)(destRange, dateFormat, undefined, dateFnsLocale);
|
|
928
|
-
year = rangeDate.getFullYear();
|
|
929
|
-
monthNo = rangeDate.getMonth();
|
|
930
|
-
date = rangeDate.getDate();
|
|
931
|
-
} else {
|
|
932
|
-
year = showDate.getFullYear();
|
|
933
|
-
monthNo = showDate.getMonth();
|
|
934
|
-
date = showDate.getDate();
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
const hours = timeDate.getHours();
|
|
938
|
-
const minutes = timeDate.getMinutes();
|
|
939
|
-
const seconds = timeDate.getSeconds();
|
|
940
|
-
const milSeconds = timeDate.getMilliseconds();
|
|
941
|
-
const dateArgs = [year, monthNo, date, hours, minutes, seconds, milSeconds];
|
|
942
|
-
const fullValidDate = new Date(...dateArgs);
|
|
943
|
-
|
|
944
|
-
if (type === 'dateTimeRange') {
|
|
945
|
-
this.handleShowDateAndTime(panelType, fullValidDate, showDate);
|
|
946
|
-
|
|
947
|
-
this._updateTimeInDateRange(panelType, fullValidDate);
|
|
948
|
-
} else {
|
|
949
|
-
const fullDate = (0, _getMonthTable.formatFullDate)(year, monthNo + 1, date);
|
|
950
|
-
this.handleDateSelected({
|
|
951
|
-
fullDate,
|
|
952
|
-
fullValidDate
|
|
953
|
-
}, panelType);
|
|
954
|
-
this.handleShowDateAndTime(panelType, fullValidDate);
|
|
955
|
-
|
|
956
|
-
this._adapter.notifySelectedChange([fullValidDate]);
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
/**
|
|
960
|
-
* Update the time part in the range
|
|
961
|
-
* @param {string} panelType
|
|
962
|
-
* @param {Date} timeDate
|
|
963
|
-
*/
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
_updateTimeInDateRange(panelType, timeDate) {
|
|
967
|
-
const {
|
|
968
|
-
isControlledComponent,
|
|
969
|
-
dateFnsLocale
|
|
970
|
-
} = this.getProps();
|
|
971
|
-
let rangeStart = this.getState('rangeStart');
|
|
972
|
-
let rangeEnd = this.getState('rangeEnd');
|
|
973
|
-
const dateFormat = this.getValidDateFormat(); // TODO: Modify a time individually
|
|
974
|
-
|
|
975
|
-
if (rangeStart && rangeEnd) {
|
|
976
|
-
let startDate = (0, _parser.compatibleParse)(rangeStart, dateFormat, undefined, dateFnsLocale);
|
|
977
|
-
let endDate = (0, _parser.compatibleParse)(rangeEnd, dateFormat, undefined, dateFnsLocale); // console.log('_updateTimeInDateRange()', rangeStart, rangeEnd, startDate, endDate);
|
|
978
|
-
|
|
979
|
-
if (panelType === _constants.strings.PANEL_TYPE_RIGHT) {
|
|
980
|
-
endDate = this._mergeDateAndTime(timeDate, timeDate);
|
|
981
|
-
rangeEnd = (0, _dateFns.format)(endDate, _constants.strings.FORMAT_DATE_TIME);
|
|
982
|
-
|
|
983
|
-
if (this._isNeedSwap(rangeStart, rangeEnd)) {
|
|
984
|
-
[rangeStart, rangeEnd] = [rangeEnd, rangeStart];
|
|
985
|
-
[startDate, endDate] = [endDate, startDate];
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
if (!isControlledComponent) {
|
|
989
|
-
this._adapter.setRangeEnd(rangeEnd);
|
|
990
|
-
}
|
|
991
|
-
} else {
|
|
992
|
-
startDate = this._mergeDateAndTime(timeDate, timeDate);
|
|
993
|
-
rangeStart = (0, _dateFns.format)(startDate, _constants.strings.FORMAT_DATE_TIME);
|
|
994
|
-
|
|
995
|
-
if (this._isNeedSwap(rangeStart, rangeEnd)) {
|
|
996
|
-
[rangeStart, rangeEnd] = [rangeEnd, rangeStart];
|
|
997
|
-
[startDate, endDate] = [endDate, startDate];
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
if (!isControlledComponent) {
|
|
1001
|
-
this._adapter.setRangeStart(rangeStart);
|
|
1002
|
-
}
|
|
1003
|
-
} // console.log('_updateTimeInDateRange()', rangeStart, rangeEnd, startDate, endDate);
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
this._adapter.notifySelectedChange([startDate, endDate]);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
_updatePanelDetail(panelType, kvs) {
|
|
1011
|
-
const {
|
|
1012
|
-
monthLeft,
|
|
1013
|
-
monthRight
|
|
1014
|
-
} = this.getStates();
|
|
1015
|
-
|
|
1016
|
-
if (panelType === _constants.strings.PANEL_TYPE_RIGHT) {
|
|
1017
|
-
this._adapter.updateMonthOnRight(Object.assign(Object.assign({}, monthRight), kvs));
|
|
1018
|
-
} else {
|
|
1019
|
-
this._adapter.updateMonthOnLeft(Object.assign(Object.assign({}, monthLeft), kvs));
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
showYearPicker(panelType) {
|
|
1024
|
-
this._updatePanelDetail(panelType, {
|
|
1025
|
-
isTimePickerOpen: false,
|
|
1026
|
-
isYearPickerOpen: true
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
showTimePicker(panelType, opt) {
|
|
1031
|
-
if (this.getProp('disabledTimePicker')) {
|
|
1032
|
-
return;
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
this._updatePanelDetail(panelType, {
|
|
1036
|
-
isTimePickerOpen: true,
|
|
1037
|
-
isYearPickerOpen: false
|
|
1038
|
-
});
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
showDatePanel(panelType) {
|
|
1042
|
-
this._updatePanelDetail(panelType, {
|
|
1043
|
-
isTimePickerOpen: false,
|
|
1044
|
-
isYearPickerOpen: false
|
|
1045
|
-
});
|
|
1046
|
-
}
|
|
1047
|
-
/**
|
|
1048
|
-
* Get year and month panel open type
|
|
1049
|
-
*
|
|
1050
|
-
* It is useful info to set minHeight of weeks.
|
|
1051
|
-
* - When yam open type is 'left' or 'right', weeks minHeight should be set
|
|
1052
|
-
* If the minHeight is not set, the change of the number of weeks will cause the scrollList to be unstable
|
|
1053
|
-
*/
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
getYAMOpenType() {
|
|
1057
|
-
const {
|
|
1058
|
-
monthLeft,
|
|
1059
|
-
monthRight
|
|
1060
|
-
} = this._adapter.getStates();
|
|
1061
|
-
|
|
1062
|
-
const leftYearPickerOpen = monthLeft.isYearPickerOpen;
|
|
1063
|
-
const rightYearPickerOpen = monthRight.isYearPickerOpen;
|
|
1064
|
-
|
|
1065
|
-
if (leftYearPickerOpen && rightYearPickerOpen) {
|
|
1066
|
-
return 'both';
|
|
1067
|
-
} else if (leftYearPickerOpen) {
|
|
1068
|
-
return 'left';
|
|
1069
|
-
} else if (rightYearPickerOpen) {
|
|
1070
|
-
return 'right';
|
|
1071
|
-
} else {
|
|
1072
|
-
return 'none';
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
exports.default = MonthsGridFoundation;
|