@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
|
@@ -4,26 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.RatingItemFoundation = void 0;
|
|
7
|
-
|
|
8
7
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
9
|
-
|
|
10
8
|
var _warning = _interopRequireDefault(require("../utils/warning"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
/* eslint-disable no-param-reassign */
|
|
11
|
+
|
|
15
12
|
class RatingFoundation extends _foundation.default {
|
|
16
13
|
constructor(adapter) {
|
|
17
14
|
super(Object.assign(Object.assign({}, RatingFoundation.defaultAdapter), adapter));
|
|
18
|
-
|
|
19
15
|
this.handleStarFocusVisible = event => {
|
|
20
16
|
const {
|
|
21
17
|
target
|
|
22
18
|
} = event;
|
|
23
19
|
const {
|
|
24
20
|
count
|
|
25
|
-
} = this.getProps();
|
|
26
|
-
|
|
21
|
+
} = this.getProps();
|
|
22
|
+
// when rating 0 is focus visible
|
|
27
23
|
try {
|
|
28
24
|
if (target.matches(':focus-visible')) {
|
|
29
25
|
this._adapter.setEmptyStarFocusVisible(true);
|
|
@@ -31,49 +27,40 @@ class RatingFoundation extends _foundation.default {
|
|
|
31
27
|
} catch (error) {
|
|
32
28
|
(0, _warning.default)(true, 'Warning: [Semi Rating] The current browser does not support the focus-visible');
|
|
33
29
|
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
};
|
|
31
|
+
// e: FocusEvent
|
|
37
32
|
this.handleStarBlur = e => {
|
|
38
33
|
const {
|
|
39
34
|
emptyStarFocusVisible
|
|
40
35
|
} = this.getStates();
|
|
41
|
-
|
|
42
36
|
if (emptyStarFocusVisible) {
|
|
43
37
|
this._adapter.setEmptyStarFocusVisible(false);
|
|
44
38
|
}
|
|
45
39
|
};
|
|
46
40
|
}
|
|
47
|
-
|
|
48
41
|
init() {
|
|
49
42
|
const {
|
|
50
43
|
autoFocus,
|
|
51
44
|
disabled
|
|
52
45
|
} = this.getProps();
|
|
53
|
-
|
|
54
46
|
if (autoFocus && !disabled) {
|
|
55
47
|
this._adapter.focus();
|
|
56
48
|
}
|
|
57
49
|
}
|
|
58
|
-
|
|
59
50
|
_getScroll(w, top) {
|
|
60
51
|
let ret = top ? w.pageYOffset : w.pageXOffset;
|
|
61
52
|
const method = top ? 'scrollTop' : 'scrollLeft';
|
|
62
|
-
|
|
63
53
|
if (typeof ret !== 'number') {
|
|
64
|
-
const d = w.document;
|
|
65
|
-
|
|
54
|
+
const d = w.document;
|
|
55
|
+
// ie6,7,8 standard mode
|
|
66
56
|
ret = d.documentElement[method];
|
|
67
|
-
|
|
68
57
|
if (typeof ret !== 'number') {
|
|
69
58
|
// quirks mode
|
|
70
59
|
ret = d.body[method];
|
|
71
60
|
}
|
|
72
61
|
}
|
|
73
|
-
|
|
74
62
|
return ret;
|
|
75
63
|
}
|
|
76
|
-
|
|
77
64
|
_getClientPosition(elem) {
|
|
78
65
|
let x, y;
|
|
79
66
|
const doc = elem.ownerDocument;
|
|
@@ -91,59 +78,45 @@ class RatingFoundation extends _foundation.default {
|
|
|
91
78
|
top: y
|
|
92
79
|
};
|
|
93
80
|
}
|
|
94
|
-
|
|
95
81
|
_getOffsetLeft(el) {
|
|
96
82
|
const pos = this._getClientPosition(el);
|
|
97
|
-
|
|
98
83
|
const doc = el.ownerDocument;
|
|
99
84
|
const w = doc.defaultView || doc.parentWindow;
|
|
100
85
|
pos.left += this._getScroll(w);
|
|
101
86
|
return pos.left;
|
|
102
87
|
}
|
|
103
|
-
|
|
104
88
|
getStarValue(index, pos) {
|
|
105
89
|
const {
|
|
106
90
|
allowHalf
|
|
107
91
|
} = this.getProps();
|
|
108
|
-
|
|
109
92
|
const direction = this._adapter.getContext('direction');
|
|
110
|
-
|
|
111
93
|
const reverse = direction === 'rtl';
|
|
112
94
|
let value = index + 1;
|
|
113
|
-
|
|
114
95
|
if (allowHalf) {
|
|
115
96
|
const starEle = this._adapter.getStarDOM(index);
|
|
116
|
-
|
|
117
97
|
const leftDis = this._getOffsetLeft(starEle);
|
|
118
|
-
|
|
119
98
|
const width = starEle.clientWidth;
|
|
120
|
-
|
|
121
99
|
if (reverse && pos - leftDis > width / 2) {
|
|
122
100
|
value -= 0.5;
|
|
123
101
|
} else if (!reverse && pos - leftDis < width / 2) {
|
|
124
102
|
value -= 0.5;
|
|
125
103
|
}
|
|
126
104
|
}
|
|
127
|
-
|
|
128
105
|
return value;
|
|
129
106
|
}
|
|
130
|
-
|
|
131
107
|
handleHover(event, index) {
|
|
132
108
|
const currValue = this.getStarValue(index, event.pageX);
|
|
133
109
|
const {
|
|
134
110
|
clearedValue,
|
|
135
111
|
hoverValue
|
|
136
112
|
} = this.getStates();
|
|
137
|
-
|
|
138
113
|
if (currValue !== hoverValue && currValue !== clearedValue) {
|
|
139
114
|
this._adapter.notifyHoverChange(currValue, null);
|
|
140
115
|
}
|
|
141
116
|
}
|
|
142
|
-
|
|
143
117
|
handleMouseLeave() {
|
|
144
118
|
this._adapter.notifyHoverChange(undefined, null);
|
|
145
119
|
}
|
|
146
|
-
|
|
147
120
|
handleClick(event, index) {
|
|
148
121
|
const {
|
|
149
122
|
allowClear
|
|
@@ -153,24 +126,19 @@ class RatingFoundation extends _foundation.default {
|
|
|
153
126
|
} = this.getStates();
|
|
154
127
|
const newValue = this.getStarValue(index, event.pageX);
|
|
155
128
|
const isReset = allowClear ? newValue === value : false;
|
|
156
|
-
|
|
157
129
|
this._adapter.updateValue(isReset ? 0 : newValue);
|
|
158
|
-
|
|
159
130
|
if (isReset) {
|
|
160
131
|
this._adapter.notifyHoverChange(undefined, newValue);
|
|
161
132
|
} else {
|
|
162
133
|
this._adapter.clearValue(null);
|
|
163
134
|
}
|
|
164
135
|
}
|
|
165
|
-
|
|
166
136
|
handleFocus(e) {
|
|
167
137
|
this._adapter.notifyFocus(e);
|
|
168
138
|
}
|
|
169
|
-
|
|
170
139
|
handleBlur(e) {
|
|
171
140
|
this._adapter.notifyBlur(e);
|
|
172
141
|
}
|
|
173
|
-
|
|
174
142
|
handleKeyDown(event, value) {
|
|
175
143
|
const {
|
|
176
144
|
key
|
|
@@ -179,20 +147,16 @@ class RatingFoundation extends _foundation.default {
|
|
|
179
147
|
count,
|
|
180
148
|
allowHalf
|
|
181
149
|
} = this.getProps();
|
|
182
|
-
|
|
183
150
|
const direction = this._adapter.getContext('direction');
|
|
184
|
-
|
|
185
151
|
const reverse = direction === 'rtl';
|
|
186
152
|
const step = allowHalf ? 0.5 : 1;
|
|
187
153
|
let tempValue;
|
|
188
154
|
let newValue;
|
|
189
|
-
|
|
190
155
|
if (key === 'ArrowRight' || key === 'ArrowUp') {
|
|
191
156
|
tempValue = value + (reverse ? -step : step);
|
|
192
157
|
} else if (key === 'ArrowLeft' || key === 'ArrowDown') {
|
|
193
158
|
tempValue = value + (reverse ? step : -step);
|
|
194
159
|
}
|
|
195
|
-
|
|
196
160
|
if (tempValue > count) {
|
|
197
161
|
newValue = 0;
|
|
198
162
|
} else if (tempValue < 0) {
|
|
@@ -200,19 +164,14 @@ class RatingFoundation extends _foundation.default {
|
|
|
200
164
|
} else {
|
|
201
165
|
newValue = tempValue;
|
|
202
166
|
}
|
|
203
|
-
|
|
204
167
|
if (['ArrowRight', 'ArrowUp', 'ArrowLeft', 'ArrowDown'].includes(key)) {
|
|
205
168
|
this._adapter.notifyKeyDown(event);
|
|
206
|
-
|
|
207
169
|
this._adapter.updateValue(newValue);
|
|
208
|
-
|
|
209
170
|
this.changeFocusStar(newValue, event);
|
|
210
171
|
event.preventDefault();
|
|
211
|
-
|
|
212
172
|
this._adapter.notifyHoverChange(undefined, null);
|
|
213
173
|
}
|
|
214
174
|
}
|
|
215
|
-
|
|
216
175
|
changeFocusStar(value, event) {
|
|
217
176
|
const {
|
|
218
177
|
count,
|
|
@@ -221,7 +180,6 @@ class RatingFoundation extends _foundation.default {
|
|
|
221
180
|
} = this.getProps();
|
|
222
181
|
const index = Math.ceil(value) - 1;
|
|
223
182
|
const starElement = [...event.currentTarget.childNodes].map(item => item.childNodes[0].childNodes);
|
|
224
|
-
|
|
225
183
|
if (index < 0) {
|
|
226
184
|
starElement[count][0].focus({
|
|
227
185
|
preventScroll
|
|
@@ -232,20 +190,16 @@ class RatingFoundation extends _foundation.default {
|
|
|
232
190
|
});
|
|
233
191
|
}
|
|
234
192
|
}
|
|
235
|
-
|
|
236
193
|
}
|
|
237
|
-
|
|
238
194
|
exports.default = RatingFoundation;
|
|
239
|
-
|
|
240
195
|
class RatingItemFoundation extends _foundation.default {
|
|
241
196
|
constructor(adapter) {
|
|
242
197
|
super(Object.assign(Object.assign({}, RatingItemFoundation.defaultAdapter), adapter));
|
|
243
|
-
|
|
244
198
|
this.handleFocusVisible = (event, star) => {
|
|
245
199
|
const {
|
|
246
200
|
target
|
|
247
|
-
} = event;
|
|
248
|
-
|
|
201
|
+
} = event;
|
|
202
|
+
// when rating 0 is focus visible
|
|
249
203
|
try {
|
|
250
204
|
if (target.matches(':focus-visible')) {
|
|
251
205
|
if (star === 'first') {
|
|
@@ -257,15 +211,13 @@ class RatingItemFoundation extends _foundation.default {
|
|
|
257
211
|
} catch (error) {
|
|
258
212
|
(0, _warning.default)(true, 'Warning: [Semi Rating] The current browser does not support the focus-visible');
|
|
259
213
|
}
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
|
|
214
|
+
};
|
|
215
|
+
// e: FocusEvent
|
|
263
216
|
this.handleBlur = (e, star) => {
|
|
264
217
|
const {
|
|
265
218
|
firstStarFocus,
|
|
266
219
|
secondStarFocus
|
|
267
220
|
} = this.getStates();
|
|
268
|
-
|
|
269
221
|
if (star === 'first') {
|
|
270
222
|
firstStarFocus && this._adapter.setFirstStarFocus(false);
|
|
271
223
|
} else {
|
|
@@ -273,7 +225,5 @@ class RatingItemFoundation extends _foundation.default {
|
|
|
273
225
|
}
|
|
274
226
|
};
|
|
275
227
|
}
|
|
276
|
-
|
|
277
228
|
}
|
|
278
|
-
|
|
279
229
|
exports.RatingItemFoundation = RatingItemFoundation;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
7
|
-
|
|
8
7
|
var _constants = require("../base/constants");
|
|
9
|
-
|
|
10
8
|
const cssClasses = {
|
|
11
9
|
PREFIX: `${_constants.BASE_CLASS_PREFIX}-scrolllist`,
|
|
12
10
|
SELECTED: `${_constants.BASE_CLASS_PREFIX}-scrolllist-item-selected`
|
|
@@ -4,11 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
class ScrollListFoundation extends _foundation.default {}
|
|
13
|
-
|
|
14
10
|
exports.default = ScrollListFoundation;
|
|
@@ -4,40 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _findIndex2 = _interopRequireDefault(require("lodash/findIndex"));
|
|
9
|
-
|
|
10
8
|
var _find2 = _interopRequireDefault(require("lodash/find"));
|
|
11
|
-
|
|
12
9
|
var _slice2 = _interopRequireDefault(require("lodash/slice"));
|
|
13
|
-
|
|
14
10
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
15
|
-
|
|
16
11
|
var _isElement = _interopRequireDefault(require("../utils/isElement"));
|
|
17
|
-
|
|
18
12
|
var _dom = require("../utils/dom");
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
class ItemFoundation extends _foundation.default {
|
|
23
15
|
constructor() {
|
|
24
16
|
super(...arguments);
|
|
25
17
|
this._cachedSelectedNode = null;
|
|
26
18
|
}
|
|
27
|
-
|
|
28
19
|
selectIndex(index, listWrapper) {
|
|
29
20
|
const {
|
|
30
21
|
type,
|
|
31
22
|
list
|
|
32
23
|
} = this.getProps();
|
|
33
|
-
|
|
34
24
|
if (index > -1 && Array.isArray(list) && list.length && (0, _isElement.default)(listWrapper)) {
|
|
35
25
|
const indexInData = index % list.length;
|
|
36
26
|
const item = list[indexInData];
|
|
37
27
|
const node = listWrapper.children[index];
|
|
38
|
-
|
|
39
28
|
this._adapter.setSelectedNode(node);
|
|
40
|
-
|
|
41
29
|
this._adapter.notifySelectItem(Object.assign(Object.assign({}, item), {
|
|
42
30
|
value: item.value,
|
|
43
31
|
type,
|
|
@@ -45,30 +33,24 @@ class ItemFoundation extends _foundation.default {
|
|
|
45
33
|
}));
|
|
46
34
|
}
|
|
47
35
|
}
|
|
48
|
-
|
|
49
36
|
selectNode(node, listWrapper) {
|
|
50
37
|
const {
|
|
51
38
|
type,
|
|
52
39
|
list: data
|
|
53
40
|
} = this.getProps();
|
|
54
|
-
|
|
55
41
|
if ((0, _isElement.default)(node) && (0, _isElement.default)(listWrapper)) {
|
|
56
42
|
const indexInList = (0, _findIndex2.default)(listWrapper.children, ele => ele === node);
|
|
57
43
|
const indexInData = indexInList % data.length;
|
|
58
44
|
const cachedIndexInList = (0, _findIndex2.default)(listWrapper.children, ele => ele === this._cachedSelectedNode);
|
|
59
45
|
const cachedIndexData = cachedIndexInList % data.length;
|
|
60
46
|
const item = data[indexInData];
|
|
61
|
-
|
|
62
47
|
this._adapter.setSelectedNode(node);
|
|
63
|
-
|
|
64
|
-
|
|
48
|
+
this._adapter.scrollToCenter(node);
|
|
49
|
+
// Avoid triggerring notifySelectItem twice,
|
|
65
50
|
// because that scroll event will be trigger
|
|
66
51
|
// when you click to select an item.
|
|
67
|
-
|
|
68
|
-
|
|
69
52
|
if (this._cachedSelectedNode !== node) {
|
|
70
53
|
this._cachedSelectedNode = node;
|
|
71
|
-
|
|
72
54
|
if (cachedIndexData !== indexInData) {
|
|
73
55
|
this._adapter.notifySelectItem(Object.assign(Object.assign({}, item), {
|
|
74
56
|
value: item.value,
|
|
@@ -86,35 +68,28 @@ class ItemFoundation extends _foundation.default {
|
|
|
86
68
|
* @param {number} ratio
|
|
87
69
|
* @returns {boolean}
|
|
88
70
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
71
|
shouldAppend(listWrapper, scrollWrapper) {
|
|
92
72
|
let ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
|
93
73
|
const tag = 'li';
|
|
94
|
-
|
|
95
74
|
if ((0, _isElement.default)(listWrapper) && (0, _isElement.default)(scrollWrapper)) {
|
|
96
75
|
const itemNodes = listWrapper.querySelectorAll(tag);
|
|
97
76
|
const lastNode = itemNodes[itemNodes.length - 1];
|
|
98
77
|
const {
|
|
99
78
|
list
|
|
100
79
|
} = this.getProps();
|
|
101
|
-
|
|
102
80
|
if (lastNode) {
|
|
103
81
|
const scrollRect = scrollWrapper.getBoundingClientRect();
|
|
104
82
|
const lastRect = lastNode.getBoundingClientRect();
|
|
105
83
|
const listHeight = lastRect.height * list.length;
|
|
106
84
|
let baseTop = lastRect.top;
|
|
107
85
|
let count = 0;
|
|
108
|
-
|
|
109
86
|
while (baseTop <= scrollRect.top + scrollRect.height * ratio) {
|
|
110
87
|
count += 1;
|
|
111
88
|
baseTop += listHeight;
|
|
112
89
|
}
|
|
113
|
-
|
|
114
90
|
return count;
|
|
115
91
|
}
|
|
116
92
|
}
|
|
117
|
-
|
|
118
93
|
return false;
|
|
119
94
|
}
|
|
120
95
|
/**
|
|
@@ -125,35 +100,28 @@ class ItemFoundation extends _foundation.default {
|
|
|
125
100
|
*
|
|
126
101
|
* @returns {boolean}
|
|
127
102
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
103
|
shouldPrepend(listWrapper, scrollWrapper) {
|
|
131
104
|
let ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
|
132
105
|
const tag = 'li';
|
|
133
|
-
|
|
134
106
|
if ((0, _isElement.default)(listWrapper) && (0, _isElement.default)(scrollWrapper)) {
|
|
135
107
|
const itemNodes = listWrapper.querySelectorAll(tag);
|
|
136
108
|
const firstNode = itemNodes[0];
|
|
137
109
|
const {
|
|
138
110
|
list
|
|
139
111
|
} = this.getProps();
|
|
140
|
-
|
|
141
112
|
if (firstNode) {
|
|
142
113
|
const scrollRect = scrollWrapper.getBoundingClientRect();
|
|
143
114
|
const firstRect = firstNode.getBoundingClientRect();
|
|
144
115
|
const listHeight = firstRect.height * list.length;
|
|
145
116
|
let baseTop = firstRect.top;
|
|
146
117
|
let count = 0;
|
|
147
|
-
|
|
148
118
|
while (baseTop + firstRect.height >= scrollRect.top - scrollRect.height * ratio) {
|
|
149
119
|
count += 1;
|
|
150
120
|
baseTop -= listHeight;
|
|
151
121
|
}
|
|
152
|
-
|
|
153
122
|
return count;
|
|
154
123
|
}
|
|
155
124
|
}
|
|
156
|
-
|
|
157
125
|
return 0;
|
|
158
126
|
}
|
|
159
127
|
/**
|
|
@@ -162,20 +130,17 @@ class ItemFoundation extends _foundation.default {
|
|
|
162
130
|
* @param {HTMLElement} wrapper
|
|
163
131
|
* @param {Function} [callback]
|
|
164
132
|
*/
|
|
165
|
-
|
|
166
|
-
|
|
167
133
|
initWheelList(listWrapper, wrapper, callback) {
|
|
168
134
|
const {
|
|
169
135
|
list
|
|
170
136
|
} = this.getProps();
|
|
171
|
-
|
|
172
137
|
if ((0, _isElement.default)(wrapper) && (0, _isElement.default)(listWrapper) && list && list.length) {
|
|
173
138
|
const allNodes = listWrapper.children;
|
|
174
139
|
const baseNodes = (0, _slice2.default)(allNodes, 0, list.length);
|
|
175
140
|
const prependCount = this.shouldPrepend(listWrapper, wrapper);
|
|
176
|
-
const appendCount = this.shouldAppend(listWrapper, wrapper);
|
|
141
|
+
const appendCount = this.shouldAppend(listWrapper, wrapper);
|
|
142
|
+
// this._adapter.setPrependCount(prependCount);
|
|
177
143
|
// this._adapter.setAppendCount(appendCount);
|
|
178
|
-
|
|
179
144
|
this._adapter.setState({
|
|
180
145
|
prependCount,
|
|
181
146
|
appendCount
|
|
@@ -188,30 +153,26 @@ class ItemFoundation extends _foundation.default {
|
|
|
188
153
|
* @param {HTMLElement} wrapper
|
|
189
154
|
* @param {HTMLElement} [nearestNode]
|
|
190
155
|
*/
|
|
191
|
-
|
|
192
|
-
|
|
193
156
|
adjustInfiniteList(listWrapper, wrapper, nearestNode) {
|
|
194
157
|
const {
|
|
195
158
|
list
|
|
196
159
|
} = this.getProps();
|
|
197
160
|
const nodeTag = 'li';
|
|
198
|
-
|
|
199
161
|
if ((0, _isElement.default)(wrapper) && (0, _isElement.default)(listWrapper) && list && list.length) {
|
|
200
162
|
const allNodes = listWrapper.querySelectorAll(nodeTag);
|
|
201
163
|
const total = allNodes.length;
|
|
202
164
|
const ratio = 1;
|
|
203
165
|
const prependCount = this.shouldPrepend(listWrapper, wrapper, ratio);
|
|
204
|
-
const appendCount = this.shouldAppend(listWrapper, wrapper, ratio);
|
|
205
|
-
|
|
166
|
+
const appendCount = this.shouldAppend(listWrapper, wrapper, ratio);
|
|
167
|
+
// while (this.shouldPrepend(listWrapper, wrapper, nearestNode)) {
|
|
206
168
|
if (prependCount) {
|
|
207
169
|
// move last nodes to first position
|
|
208
170
|
for (let i = 0; i < prependCount; i++) {
|
|
209
171
|
const nodes = (0, _slice2.default)(allNodes, total - list.length * (i + 1), total - list.length * i);
|
|
210
172
|
(0, _dom.prepend)(listWrapper, ...nodes);
|
|
211
173
|
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
174
|
+
}
|
|
175
|
+
// while (this.shouldAppend(listWrapper, wrapper, nearestNode)) {
|
|
215
176
|
if (appendCount) {
|
|
216
177
|
for (let i = 0; i < appendCount; i++) {
|
|
217
178
|
const nodes = (0, _slice2.default)(allNodes, i * list.length, (i + 1) * list.length);
|
|
@@ -226,8 +187,6 @@ class ItemFoundation extends _foundation.default {
|
|
|
226
187
|
* @param {HTMLElement} selector
|
|
227
188
|
*
|
|
228
189
|
*/
|
|
229
|
-
|
|
230
|
-
|
|
231
190
|
getNearestNodeInfo(listWrapper, selector) {
|
|
232
191
|
if ((0, _isElement.default)(listWrapper) && (0, _isElement.default)(selector)) {
|
|
233
192
|
const selectorRect = selector.getBoundingClientRect();
|
|
@@ -240,7 +199,6 @@ class ItemFoundation extends _foundation.default {
|
|
|
240
199
|
const rect = node.getBoundingClientRect();
|
|
241
200
|
const rectTop = rect.top;
|
|
242
201
|
const absDistance = Math.abs(rectTop - selectorTop);
|
|
243
|
-
|
|
244
202
|
if (absDistance < nearestDistance && !this._adapter.isDisabledIndex(index)) {
|
|
245
203
|
nearestDistance = absDistance;
|
|
246
204
|
nearestNode = node;
|
|
@@ -252,7 +210,6 @@ class ItemFoundation extends _foundation.default {
|
|
|
252
210
|
nearestIndex
|
|
253
211
|
};
|
|
254
212
|
}
|
|
255
|
-
|
|
256
213
|
return undefined;
|
|
257
214
|
}
|
|
258
215
|
/**
|
|
@@ -261,8 +218,6 @@ class ItemFoundation extends _foundation.default {
|
|
|
261
218
|
*
|
|
262
219
|
* @param {HTMLElement|null}
|
|
263
220
|
*/
|
|
264
|
-
|
|
265
|
-
|
|
266
221
|
getTargetNode(e, listWrapper) {
|
|
267
222
|
if (e && (0, _isElement.default)(listWrapper)) {
|
|
268
223
|
const targetTagName = 'li';
|
|
@@ -276,21 +231,16 @@ class ItemFoundation extends _foundation.default {
|
|
|
276
231
|
const targetNode = (0, _find2.default)(itemNodes, (node, index) => {
|
|
277
232
|
if (node === currentTarget || node.contains(currentTarget)) {
|
|
278
233
|
targetIndex = index;
|
|
279
|
-
|
|
280
234
|
if (length > 0) {
|
|
281
235
|
indexInList = index % length;
|
|
282
236
|
}
|
|
283
|
-
|
|
284
237
|
return true;
|
|
285
238
|
}
|
|
286
|
-
|
|
287
239
|
return undefined;
|
|
288
240
|
});
|
|
289
|
-
|
|
290
241
|
if (indexInList > -1) {
|
|
291
242
|
infoInList = list[indexInList];
|
|
292
243
|
}
|
|
293
|
-
|
|
294
244
|
return {
|
|
295
245
|
targetNode,
|
|
296
246
|
targetIndex,
|
|
@@ -298,10 +248,7 @@ class ItemFoundation extends _foundation.default {
|
|
|
298
248
|
infoInList
|
|
299
249
|
};
|
|
300
250
|
}
|
|
301
|
-
|
|
302
251
|
return null;
|
|
303
252
|
}
|
|
304
|
-
|
|
305
253
|
}
|
|
306
|
-
|
|
307
254
|
exports.default = ItemFoundation;
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _semiAnimation = require("@douyinfe/semi-animation");
|
|
9
|
-
|
|
10
8
|
const scrollTo = (element, to, duration) => {
|
|
11
9
|
const animation = new _semiAnimation.Animation({
|
|
12
10
|
from: {
|
|
@@ -23,10 +21,9 @@ const scrollTo = (element, to, duration) => {
|
|
|
23
21
|
scrollTop
|
|
24
22
|
} = _ref;
|
|
25
23
|
element.scrollTop = scrollTop;
|
|
26
|
-
});
|
|
27
|
-
|
|
24
|
+
});
|
|
25
|
+
// animation.start();
|
|
28
26
|
return animation;
|
|
29
27
|
};
|
|
30
|
-
|
|
31
28
|
var _default = scrollTo;
|
|
32
29
|
exports.default = _default;
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
7
|
-
|
|
8
7
|
var _constants = require("../base/constants");
|
|
9
|
-
|
|
10
8
|
var _constants2 = require("../tooltip/constants");
|
|
11
|
-
|
|
12
9
|
const cssClasses = {
|
|
13
10
|
PREFIX: `${_constants.BASE_CLASS_PREFIX}-select`,
|
|
14
11
|
PREFIX_OPTION: `${_constants.BASE_CLASS_PREFIX}-select-option`,
|
|
@@ -47,8 +47,8 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
|
|
|
47
47
|
emit(eventName: string): void;
|
|
48
48
|
once(eventName: string, eventCallback: () => void): void;
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
type LabelValue = string | number;
|
|
51
|
+
type PropValue = LabelValue | Record<string, any>;
|
|
52
52
|
export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
53
53
|
constructor(adapter: SelectAdapter);
|
|
54
54
|
_keydownHandler: (...arg: any[]) => void | null;
|