@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,35 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
9
|
-
|
|
10
8
|
var _touchPolyfill = _interopRequireDefault(require("../utils/touchPolyfill"));
|
|
11
|
-
|
|
12
9
|
var _warning = _interopRequireDefault(require("../utils/warning"));
|
|
13
|
-
|
|
14
10
|
var _a11y = require("../utils/a11y");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
/* eslint-disable no-param-reassign */
|
|
19
|
-
|
|
20
13
|
/* eslint-disable max-len */
|
|
21
|
-
|
|
22
14
|
/* eslint-disable no-nested-ternary */
|
|
15
|
+
|
|
23
16
|
class SliderFoundation extends _foundation.default {
|
|
24
17
|
constructor(adapter) {
|
|
25
18
|
var _this;
|
|
26
|
-
|
|
27
|
-
super(Object.assign(Object.assign({}, SliderFoundation.defaultAdapter), adapter));
|
|
28
|
-
_this = this;
|
|
29
|
-
|
|
30
19
|
/**
|
|
31
20
|
* Calculate the percentage corresponding to the current value for style calculation
|
|
32
21
|
* @{}
|
|
33
22
|
*
|
|
34
23
|
* @memberof SliderFoundation
|
|
35
24
|
*/
|
|
25
|
+
super(Object.assign(Object.assign({}, SliderFoundation.defaultAdapter), adapter));
|
|
26
|
+
_this = this;
|
|
36
27
|
this.getMinAndMaxPercent = value => {
|
|
37
28
|
// debugger
|
|
38
29
|
const {
|
|
@@ -40,7 +31,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
40
31
|
min,
|
|
41
32
|
max
|
|
42
33
|
} = this._adapter.getProps();
|
|
43
|
-
|
|
44
34
|
const minPercent = range ? (value[0] - min) / (max - min) : (value - min) / (max - min);
|
|
45
35
|
const maxPercent = range ? (value[1] - min) / (max - min) : 1;
|
|
46
36
|
return {
|
|
@@ -52,8 +42,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
52
42
|
* Check if value is out of range
|
|
53
43
|
* @memberof SliderFoundation
|
|
54
44
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
45
|
this._checkValidity = function (value) {
|
|
58
46
|
let min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
59
47
|
let max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
@@ -66,21 +54,17 @@ class SliderFoundation extends _foundation.default {
|
|
|
66
54
|
* @formatter: tooltip content formatting function
|
|
67
55
|
* @memberof SliderFoundation
|
|
68
56
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
57
|
this.computeHandleVisibleVal = (visible, formatter, range) => {
|
|
72
58
|
// debugger;
|
|
73
59
|
const {
|
|
74
60
|
focusPos,
|
|
75
61
|
currentValue
|
|
76
62
|
} = this._adapter.getStates();
|
|
77
|
-
|
|
78
63
|
const tipVisible = {
|
|
79
64
|
min: false,
|
|
80
65
|
max: false
|
|
81
66
|
};
|
|
82
67
|
let tipChildren;
|
|
83
|
-
|
|
84
68
|
if (formatter) {
|
|
85
69
|
tipChildren = {
|
|
86
70
|
min: range ? formatter(this.outPutValue(currentValue[0])) : formatter(this.outPutValue(currentValue)),
|
|
@@ -92,7 +76,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
92
76
|
max: range ? this.outPutValue(currentValue[1]) : null
|
|
93
77
|
};
|
|
94
78
|
}
|
|
95
|
-
|
|
96
79
|
if (visible) {
|
|
97
80
|
tipVisible.min = true;
|
|
98
81
|
tipVisible.max = true;
|
|
@@ -103,7 +86,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
103
86
|
tipVisible.max = true;
|
|
104
87
|
}
|
|
105
88
|
}
|
|
106
|
-
|
|
107
89
|
const result = {
|
|
108
90
|
tipVisible,
|
|
109
91
|
tipChildren
|
|
@@ -115,8 +97,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
115
97
|
*
|
|
116
98
|
* @memberof SliderFoundation
|
|
117
99
|
*/
|
|
118
|
-
|
|
119
|
-
|
|
120
100
|
this.valueFormatIsCorrect = value => {
|
|
121
101
|
if (Array.isArray(value)) {
|
|
122
102
|
return typeof value[0] === 'number' && typeof value[0] === 'number';
|
|
@@ -129,13 +109,9 @@ class SliderFoundation extends _foundation.default {
|
|
|
129
109
|
*
|
|
130
110
|
* @memberof SliderFoundation
|
|
131
111
|
*/
|
|
132
|
-
|
|
133
|
-
|
|
134
112
|
this.handleMousePos = (clientX, clientY) => {
|
|
135
113
|
const parentRect = this._adapter.getParentRect();
|
|
136
|
-
|
|
137
114
|
const scrollParent = this._adapter.getScrollParentVal();
|
|
138
|
-
|
|
139
115
|
const parentX = parentRect ? parentRect.left : 0;
|
|
140
116
|
const parentY = parentRect ? parentRect.top : 0;
|
|
141
117
|
return {
|
|
@@ -148,19 +124,13 @@ class SliderFoundation extends _foundation.default {
|
|
|
148
124
|
*
|
|
149
125
|
* @memberof SliderFoundation
|
|
150
126
|
*/
|
|
151
|
-
|
|
152
|
-
|
|
153
127
|
this.getScrollParent = element => {
|
|
154
128
|
// TODO: move window document out of foundation.
|
|
155
129
|
const el = element;
|
|
156
130
|
const regex = /(auto|scroll)/;
|
|
157
|
-
|
|
158
131
|
const style = (node, prop) => window.getComputedStyle(node, null).getPropertyValue(prop);
|
|
159
|
-
|
|
160
132
|
const scroll = node => regex.test(style(node, 'overflow') + style(node, 'overflow-y') + style(node, 'overflow-x'));
|
|
161
|
-
|
|
162
133
|
const scrollParent = node => !node || node === document.body || !(node instanceof Element) ? document.body : scroll(node) ? node : scrollParent(node.parentNode);
|
|
163
|
-
|
|
164
134
|
return scrollParent(el);
|
|
165
135
|
};
|
|
166
136
|
/**
|
|
@@ -168,8 +138,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
168
138
|
*
|
|
169
139
|
* @memberof SliderFoundation
|
|
170
140
|
*/
|
|
171
|
-
|
|
172
|
-
|
|
173
141
|
this.checkMeetMinMax = position => {
|
|
174
142
|
// Returns the length of the distance to the left
|
|
175
143
|
const {
|
|
@@ -177,43 +145,34 @@ class SliderFoundation extends _foundation.default {
|
|
|
177
145
|
verticalReverse,
|
|
178
146
|
range
|
|
179
147
|
} = this._adapter.getProps();
|
|
180
|
-
|
|
181
148
|
const value = this._adapter.getState('currentValue');
|
|
182
|
-
|
|
183
149
|
const currentPos = this.transValueToPos(value);
|
|
184
|
-
|
|
185
150
|
const {
|
|
186
151
|
sliderX,
|
|
187
152
|
sliderY,
|
|
188
153
|
sliderWidth,
|
|
189
154
|
sliderHeight
|
|
190
155
|
} = this._adapter.getSliderLengths();
|
|
191
|
-
|
|
192
156
|
const {
|
|
193
157
|
chooseMovePos,
|
|
194
158
|
isDrag
|
|
195
159
|
} = this._adapter.getStates();
|
|
196
|
-
|
|
197
160
|
const len = vertical ? sliderHeight : sliderWidth;
|
|
198
161
|
let startPos;
|
|
199
|
-
|
|
200
162
|
if (vertical && verticalReverse) {
|
|
201
163
|
startPos = sliderY + len;
|
|
202
164
|
} else {
|
|
203
165
|
startPos = vertical ? sliderY : sliderX;
|
|
204
|
-
}
|
|
166
|
+
}
|
|
167
|
+
// startPos = chooseMovePos === 'max' && isDrag ? currentPos[0] : startPos;
|
|
205
168
|
// eslint-disable-next-line one-var
|
|
206
|
-
|
|
207
|
-
|
|
208
169
|
let endPos;
|
|
209
|
-
|
|
210
170
|
if (vertical && verticalReverse) {
|
|
211
171
|
endPos = sliderY;
|
|
212
172
|
} else {
|
|
213
173
|
endPos = vertical ? sliderY + sliderHeight : sliderX + sliderWidth;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
174
|
+
}
|
|
175
|
+
// endPos = chooseMovePos === 'min' && isDrag && range ? currentPos[1] : endPos;
|
|
217
176
|
if (vertical && verticalReverse) {
|
|
218
177
|
if (position >= startPos) {
|
|
219
178
|
position = startPos;
|
|
@@ -227,7 +186,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
227
186
|
position = endPos;
|
|
228
187
|
}
|
|
229
188
|
}
|
|
230
|
-
|
|
231
189
|
return position;
|
|
232
190
|
};
|
|
233
191
|
/**
|
|
@@ -235,57 +193,46 @@ class SliderFoundation extends _foundation.default {
|
|
|
235
193
|
*
|
|
236
194
|
* @memberof SliderFoundation
|
|
237
195
|
*/
|
|
238
|
-
|
|
239
|
-
|
|
240
196
|
this.transPosToValue = (mousePos, isMin) => {
|
|
241
197
|
const pos = this.checkMeetMinMax(mousePos);
|
|
242
|
-
|
|
243
198
|
const {
|
|
244
199
|
min,
|
|
245
200
|
max,
|
|
246
201
|
currentValue
|
|
247
202
|
} = this._adapter.getStates();
|
|
248
|
-
|
|
249
203
|
const {
|
|
250
204
|
range,
|
|
251
205
|
vertical,
|
|
252
206
|
step,
|
|
253
207
|
verticalReverse
|
|
254
208
|
} = this._adapter.getProps();
|
|
255
|
-
|
|
256
209
|
const {
|
|
257
210
|
sliderX,
|
|
258
211
|
sliderY,
|
|
259
212
|
sliderWidth,
|
|
260
213
|
sliderHeight
|
|
261
214
|
} = this._adapter.getSliderLengths();
|
|
262
|
-
|
|
263
215
|
const startPos = vertical ? sliderY : sliderX;
|
|
264
216
|
const len = vertical ? sliderHeight : sliderWidth;
|
|
265
217
|
let stepValue;
|
|
266
|
-
|
|
267
218
|
if (vertical && verticalReverse) {
|
|
268
219
|
//isMin = !isMin;
|
|
269
220
|
stepValue = (startPos + len - pos) / len * (max - min) + min;
|
|
270
221
|
} else {
|
|
271
222
|
stepValue = (pos - startPos) / len * (max - min) + min;
|
|
272
|
-
}
|
|
223
|
+
}
|
|
224
|
+
// debugger
|
|
273
225
|
// eslint-disable-next-line one-var
|
|
274
|
-
|
|
275
|
-
|
|
276
226
|
let compareValue;
|
|
277
|
-
|
|
278
227
|
if (range) {
|
|
279
228
|
compareValue = isMin ? currentValue[0] : currentValue[1];
|
|
280
229
|
} else {
|
|
281
230
|
compareValue = currentValue;
|
|
282
231
|
}
|
|
283
|
-
|
|
284
232
|
if (step !== 1) {
|
|
285
233
|
// Find nearest step point
|
|
286
234
|
stepValue = Math.round(stepValue / step) * step;
|
|
287
235
|
}
|
|
288
|
-
|
|
289
236
|
if (range && stepValue !== compareValue) {
|
|
290
237
|
return isMin ? [stepValue, currentValue[1]] : [currentValue[0], stepValue];
|
|
291
238
|
} else if (!range && stepValue !== compareValue) {
|
|
@@ -299,30 +246,24 @@ class SliderFoundation extends _foundation.default {
|
|
|
299
246
|
*
|
|
300
247
|
* @memberof SliderFoundation
|
|
301
248
|
*/
|
|
302
|
-
|
|
303
|
-
|
|
304
249
|
this.transValueToPos = value => {
|
|
305
250
|
const {
|
|
306
251
|
min,
|
|
307
252
|
max
|
|
308
253
|
} = this._adapter.getStates();
|
|
309
|
-
|
|
310
254
|
const {
|
|
311
255
|
vertical,
|
|
312
256
|
range,
|
|
313
257
|
verticalReverse
|
|
314
258
|
} = this._adapter.getProps();
|
|
315
|
-
|
|
316
259
|
const {
|
|
317
260
|
sliderX,
|
|
318
261
|
sliderY,
|
|
319
262
|
sliderWidth,
|
|
320
263
|
sliderHeight
|
|
321
264
|
} = this._adapter.getSliderLengths();
|
|
322
|
-
|
|
323
265
|
const startPos = vertical ? sliderY : sliderX;
|
|
324
266
|
const len = vertical ? sliderHeight : sliderWidth;
|
|
325
|
-
|
|
326
267
|
if (range) {
|
|
327
268
|
return [(value[0] - min) * len / (max - min) + startPos, (value[1] - min) * len / (max - min) + startPos];
|
|
328
269
|
} else {
|
|
@@ -334,8 +275,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
334
275
|
*
|
|
335
276
|
* @memberof SliderFoundation
|
|
336
277
|
*/
|
|
337
|
-
|
|
338
|
-
|
|
339
278
|
this.isMarkActive = mark => {
|
|
340
279
|
const {
|
|
341
280
|
min,
|
|
@@ -343,9 +282,7 @@ class SliderFoundation extends _foundation.default {
|
|
|
343
282
|
range,
|
|
344
283
|
included
|
|
345
284
|
} = this._adapter.getProps();
|
|
346
|
-
|
|
347
285
|
const currentValue = this._adapter.getState('currentValue');
|
|
348
|
-
|
|
349
286
|
if (typeof (mark / 1) === 'number' && mark >= min && mark <= max) {
|
|
350
287
|
if (range) {
|
|
351
288
|
return (mark > currentValue[1] || mark < currentValue[0]) && included ? 'unActive' : 'active';
|
|
@@ -361,23 +298,16 @@ class SliderFoundation extends _foundation.default {
|
|
|
361
298
|
*
|
|
362
299
|
* @memberof SliderFoundation
|
|
363
300
|
*/
|
|
364
|
-
|
|
365
|
-
|
|
366
301
|
this.outPutValue = inputValue => {
|
|
367
302
|
const checkHowManyDecimals = num => {
|
|
368
303
|
var _a, _b;
|
|
369
|
-
|
|
370
304
|
const reg = /^\d+(\.\d+)?$/;
|
|
371
|
-
|
|
372
305
|
if (reg.test(String(num))) {
|
|
373
306
|
return (_b = (_a = num.toString().split('.')[1]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
374
307
|
}
|
|
375
|
-
|
|
376
308
|
return 0;
|
|
377
309
|
};
|
|
378
|
-
|
|
379
310
|
const step = this._adapter.getProp('step');
|
|
380
|
-
|
|
381
311
|
const transWay = (() => {
|
|
382
312
|
const decimals = checkHowManyDecimals(step);
|
|
383
313
|
const multipler = Math.pow(10, decimals);
|
|
@@ -385,27 +315,21 @@ class SliderFoundation extends _foundation.default {
|
|
|
385
315
|
return Math.round(value * multipler) / multipler;
|
|
386
316
|
};
|
|
387
317
|
})();
|
|
388
|
-
|
|
389
318
|
if (Array.isArray(inputValue)) {
|
|
390
319
|
return [transWay(inputValue[0]), transWay(inputValue[1])];
|
|
391
320
|
} else {
|
|
392
321
|
return transWay(inputValue);
|
|
393
322
|
}
|
|
394
323
|
};
|
|
395
|
-
|
|
396
324
|
this.handleDisabledChange = disabled => {
|
|
397
325
|
this._adapter.updateDisabled(disabled);
|
|
398
326
|
};
|
|
399
|
-
|
|
400
327
|
this.checkAndUpdateIsInRenderTreeState = () => this._adapter.checkAndUpdateIsInRenderTreeState();
|
|
401
|
-
|
|
402
328
|
this.calculateOutputValue = (position, isMin) => {
|
|
403
329
|
const moveValue = this.transPosToValue(position, isMin);
|
|
404
|
-
|
|
405
330
|
if (moveValue === false) {
|
|
406
331
|
return undefined;
|
|
407
332
|
}
|
|
408
|
-
|
|
409
333
|
return this.outPutValue(moveValue);
|
|
410
334
|
};
|
|
411
335
|
/**
|
|
@@ -413,35 +337,29 @@ class SliderFoundation extends _foundation.default {
|
|
|
413
337
|
*
|
|
414
338
|
* @memberof SliderFoundation
|
|
415
339
|
*/
|
|
416
|
-
|
|
417
|
-
|
|
418
340
|
this.handleValueChange = (prevValue, nextValue) => {
|
|
419
341
|
const {
|
|
420
342
|
min,
|
|
421
343
|
max
|
|
422
344
|
} = this._adapter.getStates();
|
|
423
|
-
|
|
424
345
|
let resultState = null;
|
|
425
346
|
const disableState = {};
|
|
426
|
-
|
|
427
347
|
if (this.valueFormatIsCorrect(nextValue)) {
|
|
428
348
|
if (Array.isArray(prevValue) && Array.isArray(nextValue)) {
|
|
429
349
|
nextValue = [nextValue[0] < min ? min : nextValue[0], nextValue[1] > max ? max : nextValue[1] // Math.round(nextValue[1])
|
|
430
|
-
];
|
|
431
|
-
|
|
350
|
+
];
|
|
351
|
+
// this._adapter.notifyChange(this.outPutValue(nextValue));
|
|
432
352
|
resultState = Object.assign(disableState, {
|
|
433
353
|
currentValue: nextValue
|
|
434
354
|
});
|
|
435
355
|
}
|
|
436
|
-
|
|
437
356
|
if (typeof prevValue === 'number' && typeof nextValue === 'number') {
|
|
438
357
|
if (nextValue > max) {
|
|
439
358
|
nextValue = max;
|
|
440
359
|
} else {
|
|
441
360
|
nextValue = nextValue < min ? min : nextValue; // Math.round(nextValue);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
|
|
361
|
+
}
|
|
362
|
+
// this._adapter.notifyChange(this.outPutValue(nextValue));
|
|
445
363
|
resultState = Object.assign(disableState, {
|
|
446
364
|
currentValue: nextValue
|
|
447
365
|
});
|
|
@@ -449,119 +367,88 @@ class SliderFoundation extends _foundation.default {
|
|
|
449
367
|
} else {
|
|
450
368
|
resultState = disableState;
|
|
451
369
|
}
|
|
452
|
-
|
|
453
370
|
if (resultState) {
|
|
454
371
|
this._adapter.transNewPropsToState(resultState);
|
|
455
372
|
}
|
|
456
373
|
};
|
|
457
|
-
|
|
458
374
|
this.onHandleDown = (e, handler) => {
|
|
459
375
|
this._adapter.onHandleDown(e);
|
|
460
|
-
|
|
461
376
|
const disabled = this._adapter.getState('disabled');
|
|
462
|
-
|
|
463
377
|
const {
|
|
464
378
|
vertical
|
|
465
379
|
} = this._adapter.getProps();
|
|
466
|
-
|
|
467
380
|
const {
|
|
468
381
|
dragging
|
|
469
382
|
} = this._adapter.getOverallVars();
|
|
470
|
-
|
|
471
383
|
if (disabled) {
|
|
472
384
|
return false;
|
|
473
385
|
}
|
|
474
|
-
|
|
475
386
|
this._adapter.setStateVal('isDrag', true);
|
|
476
|
-
|
|
477
387
|
this._adapter.setStateVal('chooseMovePos', handler);
|
|
478
|
-
|
|
479
388
|
if (handler === 'min') {
|
|
480
389
|
this._adapter.setDragging([true, dragging[1]]);
|
|
481
390
|
} else {
|
|
482
391
|
this._adapter.setDragging([dragging[0], true]);
|
|
483
392
|
}
|
|
484
|
-
|
|
485
393
|
const mousePos = this.handleMousePos(e.clientX, e.clientY);
|
|
486
394
|
let pos = vertical ? mousePos.y : mousePos.x;
|
|
487
|
-
|
|
488
395
|
if (!this._adapter.isEventFromHandle(e)) {
|
|
489
396
|
this._dragOffset = 0;
|
|
490
397
|
} else {
|
|
491
398
|
const handlePosition = this._getHandleCenterPosition(vertical, e.target);
|
|
492
|
-
|
|
493
399
|
this._dragOffset = vertical ? pos - handlePosition : pos - handlePosition;
|
|
494
400
|
pos = handlePosition;
|
|
495
401
|
}
|
|
496
|
-
|
|
497
402
|
return true;
|
|
498
403
|
};
|
|
499
|
-
|
|
500
404
|
this.onHandleMove = e => {
|
|
501
405
|
this._adapter.setEventDefault(e);
|
|
502
|
-
|
|
503
406
|
const {
|
|
504
407
|
disabled,
|
|
505
408
|
chooseMovePos
|
|
506
409
|
} = this._adapter.getStates();
|
|
507
|
-
|
|
508
410
|
const {
|
|
509
411
|
vertical
|
|
510
412
|
} = this._adapter.getProps();
|
|
511
|
-
|
|
512
413
|
const {
|
|
513
414
|
dragging
|
|
514
415
|
} = this._adapter.getOverallVars();
|
|
515
|
-
|
|
516
416
|
if (disabled) {
|
|
517
417
|
return false;
|
|
518
418
|
}
|
|
519
|
-
|
|
520
419
|
this.onHandleEnter(chooseMovePos);
|
|
521
420
|
const mousePos = this.handleMousePos(e.clientX, e.clientY);
|
|
522
421
|
let pagePos = vertical ? mousePos.y : mousePos.x;
|
|
523
422
|
pagePos = pagePos - this._dragOffset;
|
|
524
|
-
|
|
525
423
|
if (chooseMovePos === 'min' && dragging[0] || chooseMovePos === 'max' && dragging[1]) {
|
|
526
424
|
const outPutValue = this.calculateOutputValue(pagePos, chooseMovePos === 'min');
|
|
527
|
-
|
|
528
425
|
if (outPutValue === undefined) {
|
|
529
426
|
return false;
|
|
530
427
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
428
|
+
this._adapter.notifyChange(outPutValue);
|
|
429
|
+
// allow drag for controlled component, so no _isControlledComponent check
|
|
535
430
|
this._adapter.onHandleMove(pagePos, chooseMovePos === 'min', undefined, false, outPutValue);
|
|
536
431
|
}
|
|
537
|
-
|
|
538
432
|
return true;
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
|
|
433
|
+
};
|
|
434
|
+
// run when user touch left or right handle.
|
|
542
435
|
this.onHandleTouchStart = (e, handler) => {
|
|
543
436
|
const handleMinDom = this._adapter.getMinHandleEl();
|
|
544
|
-
|
|
545
437
|
const handleMaxDom = this._adapter.getMaxHandleEl();
|
|
546
|
-
|
|
547
438
|
if (e.target === handleMinDom || e.target === handleMaxDom) {
|
|
548
439
|
(0, _a11y.handlePrevent)(e);
|
|
549
440
|
const touch = (0, _touchPolyfill.default)(e.touches[0], e);
|
|
550
441
|
this.onHandleDown(touch, handler);
|
|
551
442
|
}
|
|
552
443
|
};
|
|
553
|
-
|
|
554
444
|
this.onHandleTouchMove = e => {
|
|
555
445
|
const handleMinDom = this._adapter.getMinHandleEl();
|
|
556
|
-
|
|
557
446
|
const handleMaxDom = this._adapter.getMaxHandleEl();
|
|
558
|
-
|
|
559
447
|
if (e.target === handleMinDom || e.target === handleMaxDom) {
|
|
560
448
|
const touch = (0, _touchPolyfill.default)(e.touches[0], e);
|
|
561
449
|
this.onHandleMove(touch);
|
|
562
450
|
}
|
|
563
451
|
};
|
|
564
|
-
|
|
565
452
|
this.onHandleEnter = pos => {
|
|
566
453
|
// debugger;
|
|
567
454
|
// this._adapter.setEventDefault(e);
|
|
@@ -569,55 +456,42 @@ class SliderFoundation extends _foundation.default {
|
|
|
569
456
|
disabled,
|
|
570
457
|
focusPos
|
|
571
458
|
} = this._adapter.getStates();
|
|
572
|
-
|
|
573
459
|
if (!disabled) {
|
|
574
460
|
if (!focusPos && pos !== focusPos) {
|
|
575
461
|
this._adapter.onHandleEnter(pos);
|
|
576
462
|
}
|
|
577
463
|
}
|
|
578
464
|
};
|
|
579
|
-
|
|
580
465
|
this.onHandleLeave = () => {
|
|
581
466
|
// this._adapter.setEventDefault(e);
|
|
582
467
|
const disabled = this._adapter.getState('disabled');
|
|
583
|
-
|
|
584
468
|
if (!disabled) {
|
|
585
469
|
this._adapter.onHandleLeave();
|
|
586
470
|
}
|
|
587
471
|
};
|
|
588
|
-
|
|
589
472
|
this.onHandleUp = e => {
|
|
590
|
-
this._adapter.onHandleUpBefore(e);
|
|
591
|
-
|
|
592
|
-
|
|
473
|
+
this._adapter.onHandleUpBefore(e);
|
|
474
|
+
// const value = this._adapter.getProp('value');
|
|
593
475
|
const {
|
|
594
476
|
disabled,
|
|
595
477
|
chooseMovePos
|
|
596
478
|
} = this._adapter.getStates();
|
|
597
|
-
|
|
598
479
|
const {
|
|
599
480
|
dragging
|
|
600
481
|
} = this._adapter.getOverallVars();
|
|
601
|
-
|
|
602
482
|
if (disabled) {
|
|
603
483
|
return false;
|
|
604
484
|
}
|
|
605
|
-
|
|
606
485
|
if (chooseMovePos === 'min') {
|
|
607
486
|
this._adapter.setDragging([false, dragging[1]]);
|
|
608
487
|
} else {
|
|
609
488
|
this._adapter.setDragging([dragging[0], false]);
|
|
610
489
|
}
|
|
611
|
-
|
|
612
490
|
this._adapter.setStateVal('isDrag', false);
|
|
613
|
-
|
|
614
491
|
this._adapter.onHandleLeave();
|
|
615
|
-
|
|
616
492
|
this._adapter.onHandleUpAfter();
|
|
617
|
-
|
|
618
493
|
return true;
|
|
619
494
|
};
|
|
620
|
-
|
|
621
495
|
this._handleValueDecreaseWithKeyBoard = (step, handler) => {
|
|
622
496
|
const {
|
|
623
497
|
min,
|
|
@@ -626,7 +500,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
626
500
|
const {
|
|
627
501
|
range
|
|
628
502
|
} = this.getProps();
|
|
629
|
-
|
|
630
503
|
if (handler === 'min') {
|
|
631
504
|
if (range) {
|
|
632
505
|
let newMinValue = currentValue[0] - step;
|
|
@@ -643,7 +516,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
643
516
|
return [currentValue[0], newMaxValue];
|
|
644
517
|
}
|
|
645
518
|
};
|
|
646
|
-
|
|
647
519
|
this._handleValueIncreaseWithKeyBoard = (step, handler) => {
|
|
648
520
|
const {
|
|
649
521
|
max,
|
|
@@ -652,7 +524,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
652
524
|
const {
|
|
653
525
|
range
|
|
654
526
|
} = this.getProps();
|
|
655
|
-
|
|
656
527
|
if (handler === 'min') {
|
|
657
528
|
if (range) {
|
|
658
529
|
let newMinValue = currentValue[0] + step;
|
|
@@ -669,7 +540,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
669
540
|
return [currentValue[0], newMaxValue];
|
|
670
541
|
}
|
|
671
542
|
};
|
|
672
|
-
|
|
673
543
|
this._handleHomeKey = handler => {
|
|
674
544
|
const {
|
|
675
545
|
min,
|
|
@@ -678,7 +548,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
678
548
|
const {
|
|
679
549
|
range
|
|
680
550
|
} = this.getProps();
|
|
681
|
-
|
|
682
551
|
if (handler === 'min') {
|
|
683
552
|
if (range) {
|
|
684
553
|
return [min, currentValue[1]];
|
|
@@ -689,7 +558,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
689
558
|
return [currentValue[0], currentValue[0]];
|
|
690
559
|
}
|
|
691
560
|
};
|
|
692
|
-
|
|
693
561
|
this._handleEndKey = handler => {
|
|
694
562
|
const {
|
|
695
563
|
max,
|
|
@@ -698,7 +566,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
698
566
|
const {
|
|
699
567
|
range
|
|
700
568
|
} = this.getProps();
|
|
701
|
-
|
|
702
569
|
if (handler === 'min') {
|
|
703
570
|
if (range) {
|
|
704
571
|
return [currentValue[1], currentValue[1]];
|
|
@@ -709,7 +576,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
709
576
|
return [currentValue[0], max];
|
|
710
577
|
}
|
|
711
578
|
};
|
|
712
|
-
|
|
713
579
|
this.handleKeyDown = (event, handler) => {
|
|
714
580
|
const {
|
|
715
581
|
min,
|
|
@@ -721,64 +587,50 @@ class SliderFoundation extends _foundation.default {
|
|
|
721
587
|
range
|
|
722
588
|
} = this.getProps();
|
|
723
589
|
let outputValue;
|
|
724
|
-
|
|
725
590
|
switch (event.key) {
|
|
726
591
|
case "ArrowLeft":
|
|
727
592
|
case "ArrowDown":
|
|
728
593
|
outputValue = this._handleValueDecreaseWithKeyBoard(step, handler);
|
|
729
594
|
break;
|
|
730
|
-
|
|
731
595
|
case "ArrowRight":
|
|
732
596
|
case "ArrowUp":
|
|
733
597
|
outputValue = this._handleValueIncreaseWithKeyBoard(step, handler);
|
|
734
598
|
break;
|
|
735
|
-
|
|
736
599
|
case "PageUp":
|
|
737
600
|
outputValue = this._handleValueIncreaseWithKeyBoard(10 * step, handler);
|
|
738
601
|
break;
|
|
739
|
-
|
|
740
602
|
case "PageDown":
|
|
741
603
|
outputValue = this._handleValueDecreaseWithKeyBoard(10 * step, handler);
|
|
742
604
|
break;
|
|
743
|
-
|
|
744
605
|
case "Home":
|
|
745
606
|
outputValue = this._handleHomeKey(handler);
|
|
746
607
|
break;
|
|
747
|
-
|
|
748
608
|
case "End":
|
|
749
609
|
outputValue = this._handleEndKey(handler);
|
|
750
610
|
break;
|
|
751
|
-
|
|
752
611
|
case 'default':
|
|
753
612
|
break;
|
|
754
613
|
}
|
|
755
|
-
|
|
756
614
|
if (["ArrowLeft", "ArrowDown", "ArrowRight", "ArrowUp", "PageUp", "PageDown", "Home", "End"].includes(event.key)) {
|
|
757
615
|
let update = true;
|
|
758
|
-
|
|
759
616
|
if (Array.isArray(currentValue)) {
|
|
760
617
|
update = !(currentValue[0] === outputValue[0] && currentValue[1] === outputValue[1]);
|
|
761
618
|
} else {
|
|
762
619
|
update = currentValue !== outputValue;
|
|
763
620
|
}
|
|
764
|
-
|
|
765
621
|
if (update) {
|
|
766
622
|
this._adapter.updateCurrentValue(outputValue);
|
|
767
|
-
|
|
768
623
|
this._adapter.notifyChange(outputValue);
|
|
769
624
|
}
|
|
770
|
-
|
|
771
625
|
(0, _a11y.handlePrevent)(event);
|
|
772
626
|
}
|
|
773
|
-
};
|
|
774
|
-
|
|
775
|
-
|
|
627
|
+
};
|
|
628
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
776
629
|
this.onFocus = (e, handler) => {
|
|
777
630
|
(0, _a11y.handlePrevent)(e);
|
|
778
631
|
const {
|
|
779
632
|
target
|
|
780
633
|
} = e;
|
|
781
|
-
|
|
782
634
|
try {
|
|
783
635
|
if (target.matches(':focus-visible')) {
|
|
784
636
|
if (handler === 'min') {
|
|
@@ -791,30 +643,25 @@ class SliderFoundation extends _foundation.default {
|
|
|
791
643
|
(0, _warning.default)(true, 'Warning: [Semi Slider] The current browser does not support the focus-visible');
|
|
792
644
|
}
|
|
793
645
|
};
|
|
794
|
-
|
|
795
646
|
this.onBlur = (e, handler) => {
|
|
796
647
|
const {
|
|
797
648
|
firstDotFocusVisible,
|
|
798
649
|
secondDotFocusVisible
|
|
799
650
|
} = this.getStates();
|
|
800
|
-
|
|
801
651
|
if (handler === 'min') {
|
|
802
652
|
firstDotFocusVisible && this._adapter.setStateVal('firstDotFocusVisible', false);
|
|
803
653
|
} else {
|
|
804
654
|
secondDotFocusVisible && this._adapter.setStateVal('secondDotFocusVisible', false);
|
|
805
655
|
}
|
|
806
656
|
};
|
|
807
|
-
|
|
808
657
|
this.handleWrapClick = e => {
|
|
809
658
|
const {
|
|
810
659
|
disabled,
|
|
811
660
|
isDrag
|
|
812
661
|
} = this._adapter.getStates();
|
|
813
|
-
|
|
814
662
|
if (isDrag || disabled || this._adapter.isEventFromHandle(e)) {
|
|
815
663
|
return;
|
|
816
664
|
}
|
|
817
|
-
|
|
818
665
|
const {
|
|
819
666
|
vertical
|
|
820
667
|
} = this.getProps();
|
|
@@ -822,20 +669,16 @@ class SliderFoundation extends _foundation.default {
|
|
|
822
669
|
const position = vertical ? mousePos.y : mousePos.x;
|
|
823
670
|
const isMin = this.checkWhichHandle(position);
|
|
824
671
|
const outPutValue = this.calculateOutputValue(position, isMin);
|
|
825
|
-
|
|
826
672
|
if (outPutValue === undefined) {
|
|
827
673
|
return;
|
|
828
674
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
675
|
+
this._adapter.notifyChange(outPutValue);
|
|
676
|
+
// check if is controlled component
|
|
833
677
|
if (this._isControlledComponent()) {
|
|
834
678
|
// only perform callback ops, skip UI update
|
|
835
679
|
return;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
|
|
680
|
+
}
|
|
681
|
+
// trigger UI state update
|
|
839
682
|
this.setHandlePos(position, isMin, true, outPutValue);
|
|
840
683
|
};
|
|
841
684
|
/**
|
|
@@ -843,12 +686,9 @@ class SliderFoundation extends _foundation.default {
|
|
|
843
686
|
*
|
|
844
687
|
* @memberof SliderFoundation
|
|
845
688
|
*/
|
|
846
|
-
|
|
847
|
-
|
|
848
689
|
this.setHandlePos = function (position, isMin) {
|
|
849
690
|
let clickTrack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
850
691
|
let outPutValue = arguments.length > 3 ? arguments[3] : undefined;
|
|
851
|
-
|
|
852
692
|
_this._adapter.onHandleMove(position, isMin, () => _this._adapter.onHandleUpAfter(), clickTrack, outPutValue);
|
|
853
693
|
};
|
|
854
694
|
/**
|
|
@@ -856,50 +696,38 @@ class SliderFoundation extends _foundation.default {
|
|
|
856
696
|
*
|
|
857
697
|
* @memberof SliderFoundation
|
|
858
698
|
*/
|
|
859
|
-
|
|
860
|
-
|
|
861
699
|
this.checkWhichHandle = pagePos => {
|
|
862
700
|
const {
|
|
863
701
|
vertical,
|
|
864
702
|
verticalReverse
|
|
865
703
|
} = this.getProps();
|
|
866
|
-
|
|
867
704
|
const {
|
|
868
705
|
currentValue
|
|
869
706
|
} = this._adapter.getStates();
|
|
870
|
-
|
|
871
707
|
const currentPos = this.transValueToPos(currentValue);
|
|
872
708
|
let isMin = true;
|
|
873
|
-
|
|
874
709
|
if (Array.isArray(currentPos)) {
|
|
875
710
|
// Slide on both sides
|
|
876
711
|
if (pagePos > currentPos[1] || Math.abs(pagePos - currentPos[0]) > Math.abs(pagePos - currentPos[1])) {
|
|
877
712
|
isMin = false;
|
|
878
713
|
}
|
|
879
714
|
}
|
|
880
|
-
|
|
881
715
|
if (vertical && verticalReverse) {
|
|
882
716
|
isMin = !isMin;
|
|
883
717
|
}
|
|
884
|
-
|
|
885
718
|
return isMin;
|
|
886
719
|
};
|
|
887
|
-
|
|
888
720
|
this.handleWrapperEnter = () => {
|
|
889
721
|
this._adapter.setStateVal('showBoundary', true);
|
|
890
722
|
};
|
|
891
|
-
|
|
892
723
|
this.handleWrapperLeave = () => {
|
|
893
724
|
this._adapter.setStateVal('showBoundary', false);
|
|
894
725
|
};
|
|
895
726
|
}
|
|
896
|
-
|
|
897
727
|
init() {
|
|
898
728
|
this._checkCurrentValue();
|
|
899
|
-
|
|
900
729
|
this._dragOffset = 0;
|
|
901
730
|
}
|
|
902
|
-
|
|
903
731
|
_checkCurrentValue() {
|
|
904
732
|
const {
|
|
905
733
|
currentValue,
|
|
@@ -907,7 +735,6 @@ class SliderFoundation extends _foundation.default {
|
|
|
907
735
|
max
|
|
908
736
|
} = this.getStates();
|
|
909
737
|
let checked;
|
|
910
|
-
|
|
911
738
|
if (Array.isArray(currentValue)) {
|
|
912
739
|
checked = [];
|
|
913
740
|
checked[0] = this._checkValidity(currentValue[0], min, max);
|
|
@@ -915,20 +742,16 @@ class SliderFoundation extends _foundation.default {
|
|
|
915
742
|
} else {
|
|
916
743
|
checked = this._checkValidity(currentValue, min, max);
|
|
917
744
|
}
|
|
918
|
-
|
|
919
745
|
this._adapter.updateCurrentValue(checked);
|
|
920
746
|
}
|
|
921
747
|
/**
|
|
922
748
|
* Untie event
|
|
923
749
|
* @memberof SliderFoundation
|
|
924
750
|
*/
|
|
925
|
-
|
|
926
|
-
|
|
927
751
|
destroy() {
|
|
928
752
|
// debugger
|
|
929
753
|
this._adapter.unSubscribeEventListener();
|
|
930
754
|
}
|
|
931
|
-
|
|
932
755
|
_getHandleCenterPosition(vertical, handle) {
|
|
933
756
|
const pos = handle.getBoundingClientRect();
|
|
934
757
|
const {
|
|
@@ -937,7 +760,5 @@ class SliderFoundation extends _foundation.default {
|
|
|
937
760
|
} = this.handleMousePos(pos.left + pos.width * 0.5, pos.top + pos.height * 0.5);
|
|
938
761
|
return vertical ? y : x;
|
|
939
762
|
}
|
|
940
|
-
|
|
941
763
|
}
|
|
942
|
-
|
|
943
764
|
exports.default = SliderFoundation;
|