@douyinfe/semi-foundation 2.19.0-alpha.8 → 2.19.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/anchor/anchor.scss +1 -8
- package/anchor/rtl.scss +0 -1
- package/anchor/variables.scss +1 -0
- package/calendar/eventUtil.ts +8 -7
- package/calendar/foundation.ts +14 -14
- package/datePicker/monthsGridFoundation.ts +10 -3
- package/dropdown/foundation.ts +2 -1
- package/dropdown/menuFoundation.ts +2 -1
- package/getBabelConfig.js +0 -12
- package/lib/cjs/anchor/anchor.css +1 -10
- package/lib/cjs/anchor/anchor.scss +1 -8
- package/lib/cjs/anchor/constants.js +1 -4
- package/lib/cjs/anchor/foundation.js +5 -12
- package/lib/cjs/anchor/linkFoundation.js +4 -9
- package/lib/cjs/anchor/rtl.scss +0 -1
- package/lib/cjs/anchor/variables.scss +1 -0
- package/lib/cjs/autoComplete/constants.js +1 -4
- package/lib/cjs/autoComplete/foundation.js +14 -33
- package/lib/cjs/autoComplete/optionFoundation.js +4 -9
- package/lib/cjs/avatar/constants.js +1 -4
- package/lib/cjs/avatar/foundation.js +4 -9
- package/lib/cjs/backtop/constants.js +1 -4
- package/lib/cjs/backtop/foundation.js +4 -9
- package/lib/cjs/badge/constants.js +1 -4
- package/lib/cjs/banner/constants.js +1 -4
- package/lib/cjs/banner/foundation.js +4 -9
- package/lib/cjs/base/constants.js +2 -6
- package/lib/cjs/base/env.js +1 -4
- package/lib/cjs/base/foundation.js +5 -10
- package/lib/cjs/base/index.js +3 -6
- package/lib/cjs/breadcrumb/constants.js +1 -4
- package/lib/cjs/breadcrumb/foundation.js +6 -13
- package/lib/cjs/breadcrumb/itemFoundation.js +4 -9
- package/lib/cjs/button/constants.js +1 -4
- package/lib/cjs/calendar/constants.js +1 -4
- package/lib/cjs/calendar/eventUtil.d.ts +3 -3
- package/lib/cjs/calendar/eventUtil.js +28 -53
- package/lib/cjs/calendar/foundation.js +63 -85
- package/lib/cjs/card/constants.js +1 -4
- package/lib/cjs/carousel/constants.js +1 -4
- package/lib/cjs/carousel/foundation.js +5 -12
- package/lib/cjs/cascader/constants.js +1 -4
- package/lib/cjs/cascader/foundation.js +55 -100
- package/lib/cjs/cascader/util.js +9 -30
- package/lib/cjs/checkbox/checkboxFoundation.js +6 -13
- package/lib/cjs/checkbox/checkboxGroupFoundation.js +9 -18
- package/lib/cjs/checkbox/constants.js +1 -4
- package/lib/cjs/collapse/constants.js +1 -4
- package/lib/cjs/collapse/foundation.js +9 -20
- package/lib/cjs/collapsible/constants.js +1 -4
- package/lib/cjs/datePicker/_utils/formatter.js +3 -12
- package/lib/cjs/datePicker/_utils/getDayOfWeek.js +1 -4
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +1 -4
- package/lib/cjs/datePicker/_utils/getDefaultPickerDate.js +5 -10
- package/lib/cjs/datePicker/_utils/getFullDateOffset.js +3 -6
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +2 -11
- package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +1 -4
- package/lib/cjs/datePicker/_utils/getMonthTable.js +2 -11
- package/lib/cjs/datePicker/_utils/getMonthsInYear.js +3 -16
- package/lib/cjs/datePicker/_utils/getYears.js +2 -9
- package/lib/cjs/datePicker/_utils/index.js +16 -30
- package/lib/cjs/datePicker/_utils/isAfter.js +3 -6
- package/lib/cjs/datePicker/_utils/isBefore.js +3 -6
- package/lib/cjs/datePicker/_utils/isBetween.js +3 -6
- package/lib/cjs/datePicker/_utils/isDate.js +1 -4
- package/lib/cjs/datePicker/_utils/isSameDay.js +3 -6
- package/lib/cjs/datePicker/_utils/isTimestamp.js +3 -6
- package/lib/cjs/datePicker/_utils/isUnixTimestamp.js +3 -6
- package/lib/cjs/datePicker/_utils/isValidDate.js +1 -4
- package/lib/cjs/datePicker/_utils/isWithinInterval.js +3 -6
- package/lib/cjs/datePicker/_utils/parser.js +1 -4
- package/lib/cjs/datePicker/constants.js +3 -10
- package/lib/cjs/datePicker/foundation.js +42 -85
- package/lib/cjs/datePicker/inputFoundation.js +7 -20
- package/lib/cjs/datePicker/monthFoundation.js +5 -12
- package/lib/cjs/datePicker/monthsGridFoundation.js +47 -68
- package/lib/cjs/datePicker/yearAndMonthFoundation.js +4 -9
- package/lib/cjs/descriptions/constants.js +1 -4
- package/lib/cjs/divider/constants.js +1 -4
- package/lib/cjs/dropdown/constants.js +1 -4
- package/lib/cjs/dropdown/foundation.js +7 -15
- package/lib/cjs/dropdown/menuFoundation.js +11 -31
- package/lib/cjs/empty/constants.js +1 -4
- package/lib/cjs/form/constants.js +1 -4
- package/lib/cjs/form/foundation.js +64 -104
- package/lib/cjs/form/interface.js +1 -3
- package/lib/cjs/form/utils.js +14 -29
- package/lib/cjs/grid/constants.js +1 -4
- package/lib/cjs/icons/constants.js +1 -4
- package/lib/cjs/input/constants.js +1 -4
- package/lib/cjs/input/foundation.js +7 -18
- package/lib/cjs/input/textareaFoundation.js +6 -13
- package/lib/cjs/input/util/calculateNodeHeight.js +3 -17
- package/lib/cjs/input/util/getSizingData.js +5 -10
- package/lib/cjs/inputNumber/constants.js +4 -11
- package/lib/cjs/inputNumber/foundation.js +11 -30
- package/lib/cjs/layout/constants.js +1 -4
- package/lib/cjs/list/constants.js +1 -4
- package/lib/cjs/modal/constants.js +1 -4
- package/lib/cjs/modal/modalContentFoundation.js +4 -9
- package/lib/cjs/modal/modalFoundation.js +4 -9
- package/lib/cjs/navigation/NavItem.js +6 -21
- package/lib/cjs/navigation/constants.js +1 -4
- package/lib/cjs/navigation/foundation.js +22 -37
- package/lib/cjs/navigation/itemFoundation.js +4 -9
- package/lib/cjs/navigation/subNavFoundation.js +10 -21
- package/lib/cjs/notification/constants.js +1 -4
- package/lib/cjs/notification/notificationFoundation.js +5 -12
- package/lib/cjs/notification/notificationListFoundation.js +4 -9
- package/lib/cjs/overflowList/constants.js +3 -10
- package/lib/cjs/overflowList/foundation.js +12 -29
- package/lib/cjs/pagination/constants.js +1 -4
- package/lib/cjs/pagination/foundation.js +18 -37
- package/lib/cjs/popconfirm/constants.js +1 -4
- package/lib/cjs/popconfirm/popconfirm.css +1 -7
- package/lib/cjs/popconfirm/popconfirm.scss +1 -11
- package/lib/cjs/popconfirm/popconfirmFoundation.js +3 -6
- package/lib/cjs/popover/constants.js +2 -9
- package/lib/cjs/progress/constants.js +1 -4
- package/lib/cjs/radio/constants.js +1 -4
- package/lib/cjs/radio/radioFoundation.js +3 -6
- package/lib/cjs/radio/radioGroupFoundation.js +6 -11
- package/lib/cjs/radio/radioInnerFoundation.js +5 -10
- package/lib/cjs/rating/constants.js +1 -4
- package/lib/cjs/rating/foundation.js +7 -20
- package/lib/cjs/scrollList/constants.js +1 -4
- package/lib/cjs/scrollList/foundation.js +3 -6
- package/lib/cjs/scrollList/itemFoundation.js +8 -21
- package/lib/cjs/scrollList/scrollTo.js +1 -4
- package/lib/cjs/select/constants.js +1 -4
- package/lib/cjs/select/foundation.js +56 -98
- package/lib/cjs/select/optionFoundation.js +4 -9
- package/lib/cjs/sideSheet/constants.js +1 -4
- package/lib/cjs/sideSheet/sideSheet.css +1 -0
- package/lib/cjs/sideSheet/sideSheet.scss +1 -0
- package/lib/cjs/sideSheet/sideSheetFoundation.js +6 -15
- package/lib/cjs/skeleton/constants.js +1 -4
- package/lib/cjs/slider/constants.js +1 -4
- package/lib/cjs/slider/foundation.js +32 -33
- package/lib/cjs/space/constants.js +1 -4
- package/lib/cjs/spin/constants.js +1 -4
- package/lib/cjs/spin/foundation.js +5 -12
- package/lib/cjs/steps/constants.js +1 -4
- package/lib/cjs/switch/constants.js +1 -4
- package/lib/cjs/switch/foundation.js +4 -9
- package/lib/cjs/table/bodyFoundation.js +9 -22
- package/lib/cjs/table/cellFoundation.js +3 -6
- package/lib/cjs/table/constants.js +1 -4
- package/lib/cjs/table/foundation.js +76 -117
- package/lib/cjs/table/mixin.scss +2 -2
- package/lib/cjs/table/rtl.scss +8 -8
- package/lib/cjs/table/table.scss +16 -16
- package/lib/cjs/table/tableRowFoundation.js +3 -6
- package/lib/cjs/table/tableSelectionCellFoundation.js +3 -6
- package/lib/cjs/table/utils.js +42 -71
- package/lib/cjs/table/variables.scss +0 -3
- package/lib/cjs/tabs/constants.js +1 -4
- package/lib/cjs/tabs/foundation.js +8 -23
- package/lib/cjs/tag/constants.js +1 -4
- package/lib/cjs/tagInput/constants.js +1 -4
- package/lib/cjs/tagInput/foundation.js +12 -31
- package/lib/cjs/tagInput/utils/getSplitedArray.js +3 -6
- package/lib/cjs/timePicker/ComboxFoundation.js +10 -29
- package/lib/cjs/timePicker/constants.js +1 -4
- package/lib/cjs/timePicker/foundation.js +26 -45
- package/lib/cjs/timePicker/inputFoundation.js +4 -9
- package/lib/cjs/timePicker/utils/index.js +7 -14
- package/lib/cjs/timePicker/utils/localeDate.js +2 -9
- package/lib/cjs/timeline/constants.js +1 -4
- package/lib/cjs/toast/constants.js +1 -4
- package/lib/cjs/toast/toastFoundation.js +5 -12
- package/lib/cjs/toast/toastListFoundation.js +5 -12
- package/lib/cjs/tooltip/constants.js +1 -4
- package/lib/cjs/tooltip/foundation.js +29 -56
- package/lib/cjs/transfer/constants.js +1 -4
- package/lib/cjs/transfer/foundation.js +24 -47
- package/lib/cjs/transfer/transferUtils.js +16 -45
- package/lib/cjs/tree/constants.js +1 -4
- package/lib/cjs/tree/foundation.js +41 -76
- package/lib/cjs/tree/tree.css +3 -0
- package/lib/cjs/tree/tree.scss +4 -0
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/tree/treeUtil.js +60 -107
- package/lib/cjs/treeSelect/constants.js +1 -4
- package/lib/cjs/treeSelect/foundation.js +49 -82
- package/lib/cjs/typography/constants.js +1 -4
- package/lib/cjs/upload/constants.d.ts +1 -1
- package/lib/cjs/upload/constants.js +1 -4
- package/lib/cjs/upload/foundation.js +56 -112
- package/lib/cjs/upload/utils.js +13 -32
- package/lib/cjs/utils/Event.js +9 -23
- package/lib/cjs/utils/FocusHandle.js +6 -15
- package/lib/cjs/utils/Logger.js +1 -4
- package/lib/cjs/utils/Store.js +5 -20
- package/lib/cjs/utils/a11y.js +8 -13
- package/lib/cjs/utils/array.js +6 -15
- package/lib/cjs/utils/arrayMove.js +3 -12
- package/lib/cjs/utils/classnames.js +6 -15
- package/lib/cjs/utils/date-fns-extra.js +7 -18
- package/lib/cjs/utils/dom.js +5 -12
- package/lib/cjs/utils/function.js +1 -4
- package/lib/cjs/utils/getDataAttr.js +2 -13
- package/lib/cjs/utils/getHighlight.js +7 -22
- package/lib/cjs/utils/getMotionObjFromProps.js +4 -9
- package/lib/cjs/utils/index.js +5 -15
- package/lib/cjs/utils/isBothNaN.js +1 -4
- package/lib/cjs/utils/isElement.js +1 -4
- package/lib/cjs/utils/isEnterPress.js +3 -6
- package/lib/cjs/utils/isEscPress.js +3 -6
- package/lib/cjs/utils/isNullOrUndefined.js +1 -4
- package/lib/cjs/utils/isNumber.js +1 -4
- package/lib/cjs/utils/isObject.js +1 -4
- package/lib/cjs/utils/isPromise.js +3 -6
- package/lib/cjs/utils/isString.js +1 -4
- package/lib/cjs/utils/keyCode.js +1 -4
- package/lib/cjs/utils/log.js +3 -6
- package/lib/cjs/utils/number.js +1 -4
- package/lib/cjs/utils/object.js +10 -27
- package/lib/cjs/utils/set.js +4 -9
- package/lib/cjs/utils/shallowEqualObjects.js +3 -10
- package/lib/cjs/utils/touchPolyfill.js +5 -12
- package/lib/cjs/utils/type.js +1 -3
- package/lib/cjs/utils/uuid.js +3 -14
- package/lib/cjs/utils/warning.js +1 -4
- package/lib/es/anchor/anchor.css +1 -10
- package/lib/es/anchor/anchor.scss +1 -8
- package/lib/es/anchor/foundation.js +2 -4
- package/lib/es/anchor/linkFoundation.js +1 -2
- package/lib/es/anchor/rtl.scss +0 -1
- package/lib/es/anchor/variables.scss +1 -0
- package/lib/es/autoComplete/foundation.js +11 -26
- package/lib/es/autoComplete/optionFoundation.js +1 -2
- package/lib/es/avatar/foundation.js +1 -2
- package/lib/es/backtop/foundation.js +1 -2
- package/lib/es/banner/foundation.js +1 -2
- package/lib/es/base/foundation.js +2 -3
- package/lib/es/breadcrumb/foundation.js +3 -6
- package/lib/es/breadcrumb/itemFoundation.js +1 -2
- package/lib/es/calendar/eventUtil.d.ts +3 -3
- package/lib/es/calendar/eventUtil.js +27 -56
- package/lib/es/calendar/foundation.js +60 -90
- package/lib/es/carousel/foundation.js +2 -4
- package/lib/es/cascader/foundation.js +49 -94
- package/lib/es/cascader/util.js +6 -21
- package/lib/es/checkbox/checkboxFoundation.js +3 -6
- package/lib/es/checkbox/checkboxGroupFoundation.js +6 -9
- package/lib/es/collapse/foundation.js +6 -10
- package/lib/es/datePicker/_utils/formatter.js +2 -5
- package/lib/es/datePicker/_utils/getDefaultPickerDate.js +2 -3
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +1 -4
- package/lib/es/datePicker/_utils/getMonthTable.js +1 -5
- package/lib/es/datePicker/_utils/getMonthsInYear.js +2 -9
- package/lib/es/datePicker/_utils/getYears.js +1 -3
- package/lib/es/datePicker/constants.js +2 -7
- package/lib/es/datePicker/foundation.js +39 -70
- package/lib/es/datePicker/inputFoundation.js +4 -11
- package/lib/es/datePicker/monthFoundation.js +2 -4
- package/lib/es/datePicker/monthsGridFoundation.js +40 -55
- package/lib/es/datePicker/yearAndMonthFoundation.js +1 -2
- package/lib/es/dropdown/foundation.js +4 -7
- package/lib/es/dropdown/menuFoundation.js +8 -21
- package/lib/es/form/foundation.js +59 -91
- package/lib/es/form/utils.js +11 -19
- package/lib/es/input/foundation.js +4 -9
- package/lib/es/input/textareaFoundation.js +3 -5
- package/lib/es/input/util/calculateNodeHeight.js +2 -10
- package/lib/es/input/util/getSizingData.js +2 -5
- package/lib/es/inputNumber/constants.js +3 -8
- package/lib/es/inputNumber/foundation.js +8 -18
- package/lib/es/modal/modalContentFoundation.js +1 -2
- package/lib/es/modal/modalFoundation.js +1 -2
- package/lib/es/navigation/NavItem.js +5 -11
- package/lib/es/navigation/foundation.js +19 -25
- package/lib/es/navigation/itemFoundation.js +1 -3
- package/lib/es/navigation/subNavFoundation.js +7 -13
- package/lib/es/notification/notificationFoundation.js +2 -4
- package/lib/es/notification/notificationListFoundation.js +1 -3
- package/lib/es/overflowList/constants.js +2 -3
- package/lib/es/overflowList/foundation.js +9 -23
- package/lib/es/pagination/foundation.js +15 -28
- package/lib/es/popconfirm/popconfirm.css +1 -7
- package/lib/es/popconfirm/popconfirm.scss +1 -11
- package/lib/es/popover/constants.js +1 -2
- package/lib/es/radio/radioGroupFoundation.js +3 -4
- package/lib/es/radio/radioInnerFoundation.js +2 -3
- package/lib/es/rating/foundation.js +4 -13
- package/lib/es/scrollList/itemFoundation.js +5 -13
- package/lib/es/select/foundation.js +50 -88
- package/lib/es/select/optionFoundation.js +1 -2
- package/lib/es/sideSheet/sideSheet.css +1 -0
- package/lib/es/sideSheet/sideSheet.scss +1 -0
- package/lib/es/sideSheet/sideSheetFoundation.js +3 -7
- package/lib/es/slider/foundation.js +29 -25
- package/lib/es/spin/foundation.js +2 -4
- package/lib/es/switch/foundation.js +1 -2
- package/lib/es/table/bodyFoundation.js +6 -11
- package/lib/es/table/foundation.js +67 -93
- package/lib/es/table/mixin.scss +2 -2
- package/lib/es/table/rtl.scss +8 -8
- package/lib/es/table/table.scss +16 -16
- package/lib/es/table/utils.js +33 -51
- package/lib/es/table/variables.scss +0 -3
- package/lib/es/tabs/foundation.js +5 -18
- package/lib/es/tagInput/foundation.js +9 -21
- package/lib/es/timePicker/ComboxFoundation.js +7 -16
- package/lib/es/timePicker/foundation.js +23 -37
- package/lib/es/timePicker/inputFoundation.js +1 -2
- package/lib/es/timePicker/utils/index.js +4 -6
- package/lib/es/timePicker/utils/localeDate.js +1 -2
- package/lib/es/toast/toastFoundation.js +2 -4
- package/lib/es/toast/toastListFoundation.js +2 -4
- package/lib/es/tooltip/foundation.js +26 -46
- package/lib/es/transfer/foundation.js +21 -43
- package/lib/es/transfer/transferUtils.js +13 -33
- package/lib/es/tree/foundation.js +38 -70
- package/lib/es/tree/tree.css +3 -0
- package/lib/es/tree/tree.scss +4 -0
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/tree/treeUtil.js +57 -109
- package/lib/es/treeSelect/foundation.js +45 -73
- package/lib/es/upload/constants.d.ts +1 -1
- package/lib/es/upload/foundation.js +52 -118
- package/lib/es/upload/utils.js +12 -25
- package/lib/es/utils/Event.js +5 -12
- package/lib/es/utils/FocusHandle.js +3 -7
- package/lib/es/utils/Store.js +4 -12
- package/lib/es/utils/a11y.js +5 -6
- package/lib/es/utils/array.js +3 -5
- package/lib/es/utils/arrayMove.js +2 -6
- package/lib/es/utils/classnames.js +3 -6
- package/lib/es/utils/date-fns-extra.js +6 -14
- package/lib/es/utils/dom.js +1 -2
- package/lib/es/utils/getDataAttr.js +1 -5
- package/lib/es/utils/getHighlight.js +4 -14
- package/lib/es/utils/getMotionObjFromProps.js +1 -2
- package/lib/es/utils/object.js +7 -15
- package/lib/es/utils/set.js +1 -2
- package/lib/es/utils/shallowEqualObjects.js +2 -5
- package/lib/es/utils/touchPolyfill.js +2 -6
- package/lib/es/utils/uuid.js +2 -7
- package/package.json +2 -4
- package/popconfirm/popconfirm.scss +1 -11
- package/select/foundation.ts +2 -2
- package/sideSheet/sideSheet.scss +1 -0
- package/slider/foundation.ts +15 -8
- package/table/mixin.scss +2 -2
- package/table/rtl.scss +8 -8
- package/table/table.scss +16 -16
- package/table/variables.scss +0 -3
- package/tree/tree.scss +4 -0
package/anchor/anchor.scss
CHANGED
|
@@ -18,8 +18,6 @@ $module: #{$prefix}-anchor;
|
|
|
18
18
|
left: $spacing-anchor_slide-left;
|
|
19
19
|
top: $spacing-anchor_slide-top;
|
|
20
20
|
height: 100%;
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
padding: $width-anchor-outline 0;
|
|
23
21
|
|
|
24
22
|
&-muted {
|
|
25
23
|
display: none;
|
|
@@ -65,12 +63,6 @@ $module: #{$prefix}-anchor;
|
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
&-link {
|
|
68
|
-
padding-left: $spacing-anchor_link-paddingLeft;
|
|
69
|
-
|
|
70
|
-
&-wrapper {
|
|
71
|
-
padding-right: $width-anchor-outline;
|
|
72
|
-
margin: $width-anchor-outline 0;
|
|
73
|
-
}
|
|
74
66
|
|
|
75
67
|
&-title {
|
|
76
68
|
cursor: pointer;
|
|
@@ -93,6 +85,7 @@ $module: #{$prefix}-anchor;
|
|
|
93
85
|
|
|
94
86
|
&:focus-visible {
|
|
95
87
|
outline: $width-anchor-outline solid $color-anchor_title-outline-focus;
|
|
88
|
+
outline-offset: $width-anchor-outlineOffset;
|
|
96
89
|
}
|
|
97
90
|
|
|
98
91
|
&-disabled {
|
package/anchor/rtl.scss
CHANGED
package/anchor/variables.scss
CHANGED
package/calendar/eventUtil.ts
CHANGED
|
@@ -98,7 +98,7 @@ export interface DateObj {
|
|
|
98
98
|
|
|
99
99
|
export type weeekStartsOnEnum = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
100
100
|
|
|
101
|
-
export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale) => {
|
|
101
|
+
export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode: string, locale: Locale, weekStartsOn: weeekStartsOnEnum) => {
|
|
102
102
|
const today = getCurrDate();
|
|
103
103
|
const arr: Array<DateObj> = [];
|
|
104
104
|
[...Array(rangeLen).keys()].map(ind => {
|
|
@@ -106,8 +106,8 @@ export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode:
|
|
|
106
106
|
const date = addDays(start, ind);
|
|
107
107
|
dateObj.ind = ind;
|
|
108
108
|
dateObj.date = date;
|
|
109
|
-
dateObj.dayString = format(date, 'd', { locale });
|
|
110
|
-
dateObj.weekday = format(date, 'EEE', { locale });
|
|
109
|
+
dateObj.dayString = format(date, 'd', { locale, weekStartsOn });
|
|
110
|
+
dateObj.weekday = format(date, 'EEE', { locale, weekStartsOn });
|
|
111
111
|
dateObj.isToday = isSameDay(date, today);
|
|
112
112
|
dateObj.isWeekend = checkWeekend(date);
|
|
113
113
|
if (mode === 'month') {
|
|
@@ -129,7 +129,7 @@ export const calcRangeData = (value: Date, start: Date, rangeLen: number, mode:
|
|
|
129
129
|
*/
|
|
130
130
|
export const calcWeekData = (value: Date, mode = 'week', locale: Locale, weekStartsOn: weeekStartsOnEnum) => {
|
|
131
131
|
const start = startOfWeek(value, { weekStartsOn });
|
|
132
|
-
return calcRangeData(value, start, 7, mode, locale);
|
|
132
|
+
return calcRangeData(value, start, 7, mode, locale, weekStartsOn);
|
|
133
133
|
};
|
|
134
134
|
|
|
135
135
|
/**
|
|
@@ -250,7 +250,7 @@ export const filterEvents = (events: Map<string, EventObject[]>, start: Date, en
|
|
|
250
250
|
* filter out event that is not in the week range
|
|
251
251
|
*/
|
|
252
252
|
// eslint-disable-next-line max-len
|
|
253
|
-
export const filterWeeklyEvents = (events: Map<string, EventObject[]>, weekStart: Date) => filterEvents(events, weekStart, addDays(endOfWeek(weekStart), 1));
|
|
253
|
+
export const filterWeeklyEvents = (events: Map<string, EventObject[]>, weekStart: Date, weekStartsOn: weeekStartsOnEnum ) => filterEvents(events, weekStart, addDays(endOfWeek(weekStart, { weekStartsOn }), 1));
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
256
|
* @returns {arr}
|
|
@@ -308,8 +308,9 @@ export const parseWeeklyAllDayEvent = (
|
|
|
308
308
|
event: EventObject[],
|
|
309
309
|
startDate: Date,
|
|
310
310
|
weekStart: Date,
|
|
311
|
-
parsed: Array<Array<ParsedRangeEvent
|
|
312
|
-
|
|
311
|
+
parsed: Array<Array<ParsedRangeEvent>>,
|
|
312
|
+
weekStartsOn: weeekStartsOnEnum
|
|
313
|
+
) => parseRangeAllDayEvent(event, startDate, weekStart, addDays(endOfWeek(startDate, { weekStartsOn }), 1), parsed);
|
|
313
314
|
|
|
314
315
|
|
|
315
316
|
export const collectDailyEvents = (events: ParsedRangeEvent[][]) => {
|
package/calendar/foundation.ts
CHANGED
|
@@ -190,8 +190,8 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
|
|
|
190
190
|
|
|
191
191
|
getWeeklyData(value: Date, dateFnsLocale: Locale) {
|
|
192
192
|
const data = {} as WeeklyData;
|
|
193
|
-
data.month = format(value, 'LLL', { locale: dateFnsLocale });
|
|
194
193
|
const { weekStartsOn } = this.getProps();
|
|
194
|
+
data.month = format(value, 'LLL', { locale: dateFnsLocale, weekStartsOn });
|
|
195
195
|
data.week = calcWeekData(value, 'week', dateFnsLocale, weekStartsOn);
|
|
196
196
|
this._adapter.setWeeklyData(data);
|
|
197
197
|
return data;
|
|
@@ -199,10 +199,10 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
|
|
|
199
199
|
|
|
200
200
|
getRangeData(value: Date, dateFnsLocale: Locale) {
|
|
201
201
|
const data = {} as { month: string; week: Array<DateObj> };
|
|
202
|
-
const { range } = this.getProps();
|
|
202
|
+
const { range, weekStartsOn } = this.getProps();
|
|
203
203
|
const len = differenceInCalendarDays(range[1], range[0]);
|
|
204
|
-
data.month = format(value, 'LLL', { locale: dateFnsLocale });
|
|
205
|
-
data.week = calcRangeData(value, range[0], len, 'week', dateFnsLocale);
|
|
204
|
+
data.month = format(value, 'LLL', { locale: dateFnsLocale, weekStartsOn });
|
|
205
|
+
data.week = calcRangeData(value, range[0], len, 'week', dateFnsLocale, weekStartsOn);
|
|
206
206
|
this._adapter.setRangeData(data);
|
|
207
207
|
return data;
|
|
208
208
|
}
|
|
@@ -211,7 +211,7 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
|
|
|
211
211
|
const monthStart = startOfMonth(value);
|
|
212
212
|
const data = {} as MonthData;
|
|
213
213
|
const { weekStartsOn } = this.getProps();
|
|
214
|
-
const numberOfWeek = getWeeksInMonth(value);
|
|
214
|
+
const numberOfWeek = getWeeksInMonth(value, { weekStartsOn });
|
|
215
215
|
[...Array(numberOfWeek).keys()].map(ind => {
|
|
216
216
|
data[ind] = calcWeekData(addDays(monthStart, ind * 7), 'month', dateFnsLocale, weekStartsOn);
|
|
217
217
|
});
|
|
@@ -263,12 +263,13 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
|
|
|
263
263
|
// ================== Weekly Event ==================
|
|
264
264
|
|
|
265
265
|
_parseWeeklyEvents(events: ParsedEvents['allDay'], weekStart: Date) {
|
|
266
|
+
const { weekStartsOn } = this.getProps();
|
|
266
267
|
let parsed = [[]] as ParsedRangeEvent[][];
|
|
267
|
-
const filtered = filterWeeklyEvents(events, weekStart);
|
|
268
|
+
const filtered = filterWeeklyEvents(events, weekStart, weekStartsOn);
|
|
268
269
|
[...filtered.keys()].sort((a, b) => sortDate(a, b)).forEach(item => {
|
|
269
270
|
const startDate = new Date(item);
|
|
270
271
|
const curr = filtered.get(item).filter(event => isSameDay(event.date, startDate));
|
|
271
|
-
parsed = parseWeeklyAllDayEvent(curr, startDate, weekStart, parsed);
|
|
272
|
+
parsed = parseWeeklyAllDayEvent(curr, startDate, weekStart, parsed, weekStartsOn);
|
|
272
273
|
});
|
|
273
274
|
return parsed;
|
|
274
275
|
}
|
|
@@ -332,7 +333,7 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
|
|
|
332
333
|
|
|
333
334
|
getParseMonthlyEvents(itemLimit: number) {
|
|
334
335
|
const parsed: any = {};
|
|
335
|
-
const { displayValue, events } = this.getProps();
|
|
336
|
+
const { displayValue, events, weekStartsOn } = this.getProps();
|
|
336
337
|
const currDate = this._getDate();
|
|
337
338
|
const firstDayOfMonth = startOfMonth(displayValue);
|
|
338
339
|
const lastDayOfMonth = endOfMonth(displayValue);
|
|
@@ -354,31 +355,30 @@ export default class CalendarFoundation<P = Record<string, any>, S = Record<stri
|
|
|
354
355
|
// WeekInd calculation error, need to consider the boundary situation at the beginning/end of the month
|
|
355
356
|
// When the date falls within the month
|
|
356
357
|
if (isSameMonth(item.date, displayValue)) {
|
|
357
|
-
const weekInd = getWeekOfMonth(item.date) - 1;
|
|
358
|
+
const weekInd = getWeekOfMonth(item.date, { weekStartsOn }) - 1;
|
|
358
359
|
this.pushDayEventIntoWeekMap(item, weekInd, parsed);
|
|
359
360
|
return;
|
|
360
361
|
}
|
|
361
362
|
// When the date is within the previous month
|
|
362
363
|
if (isBefore(item.date, firstDayOfMonth)) {
|
|
363
|
-
if (isSameWeek(item.date, firstDayOfMonth)) {
|
|
364
|
+
if (isSameWeek(item.date, firstDayOfMonth, { weekStartsOn })) {
|
|
364
365
|
this.pushDayEventIntoWeekMap(item, 0, parsed);
|
|
365
366
|
}
|
|
366
367
|
return;
|
|
367
368
|
}
|
|
368
369
|
// When the date is within the next month
|
|
369
370
|
if (isAfter(item.date, lastDayOfMonth)) {
|
|
370
|
-
if (isSameWeek(item.date, lastDayOfMonth)) {
|
|
371
|
-
const weekInd = getWeekOfMonth(lastDayOfMonth) - 1;
|
|
371
|
+
if (isSameWeek(item.date, lastDayOfMonth, { weekStartsOn })) {
|
|
372
|
+
const weekInd = getWeekOfMonth(lastDayOfMonth, { weekStartsOn }) - 1;
|
|
372
373
|
this.pushDayEventIntoWeekMap(item, weekInd, parsed);
|
|
373
374
|
}
|
|
374
375
|
return;
|
|
375
376
|
}
|
|
376
377
|
});
|
|
377
|
-
|
|
378
378
|
Object.keys(parsed).forEach(key => {
|
|
379
379
|
const week = parsed[key];
|
|
380
380
|
parsed[key] = {};
|
|
381
|
-
const weekStart = startOfWeek(week[0].date);
|
|
381
|
+
const weekStart = startOfWeek(week[0].date, { weekStartsOn });
|
|
382
382
|
const weekMap = convertEventsArrToMap(week, 'start', startOfDay);
|
|
383
383
|
// When there are multiple events in a week, multiple events should be parsed
|
|
384
384
|
// const oldParsedWeeklyEvent = this._parseWeeklyEvents(weekMap, weekStart);
|
|
@@ -542,8 +542,8 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
542
542
|
type: YearMonthChangeType,
|
|
543
543
|
targetDate: Date
|
|
544
544
|
) {
|
|
545
|
-
const { multiple, disabledDate } = this.getProps();
|
|
546
|
-
const { selected: selectedSet, rangeStart, rangeEnd } = this.getStates();
|
|
545
|
+
const { multiple, disabledDate, type: dateType } = this.getProps();
|
|
546
|
+
const { selected: selectedSet, rangeStart, rangeEnd, monthLeft } = this.getStates();
|
|
547
547
|
// FIXME:
|
|
548
548
|
const includeRange = ['dateRange', 'dateTimeRange'].includes(type);
|
|
549
549
|
const options = { closePanel: false };
|
|
@@ -552,7 +552,14 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
552
552
|
const selectedDate = new Date(selectedStr);
|
|
553
553
|
const year = targetDate.getFullYear();
|
|
554
554
|
const month = targetDate.getMonth();
|
|
555
|
-
|
|
555
|
+
let fullDate = set(selectedDate, { year, month });
|
|
556
|
+
if (dateType === 'dateTime') {
|
|
557
|
+
/**
|
|
558
|
+
* 如果是 type dateTime 切换月份要读取只取的time
|
|
559
|
+
* 无论 monthLeft 还是 monthRight 他们的 time 是不变的,所以只取 monthLeft 即可
|
|
560
|
+
*/
|
|
561
|
+
fullDate = this._mergeDateAndTime(fullDate, monthLeft.pickerDate);
|
|
562
|
+
}
|
|
556
563
|
if (disabledDate(fullDate, { rangeStart, rangeEnd })) {
|
|
557
564
|
return;
|
|
558
565
|
}
|
package/dropdown/foundation.ts
CHANGED
|
@@ -34,7 +34,8 @@ export default class DropdownFoundation extends BaseFoundation<DropdownAdapter>
|
|
|
34
34
|
case ' ':
|
|
35
35
|
case 'Enter':
|
|
36
36
|
event.target.click();
|
|
37
|
-
|
|
37
|
+
// user may use input to be the trigger and bind some key event on it, so do not stoppropagation
|
|
38
|
+
// handlePrevent(event);
|
|
38
39
|
break;
|
|
39
40
|
case 'ArrowDown':
|
|
40
41
|
this.setFocusToFirstMenuItem(event.target);
|
|
@@ -54,7 +54,8 @@ export default class DropdownMenuFoundation extends BaseFoundation<Partial<Defau
|
|
|
54
54
|
case ' ':
|
|
55
55
|
case 'Enter':
|
|
56
56
|
event.target.click();
|
|
57
|
-
|
|
57
|
+
// user may use input to be the trigger and bind some key event on it, so do not stoppropagation
|
|
58
|
+
// handlePrevent(event);
|
|
58
59
|
break;
|
|
59
60
|
case 'Escape':
|
|
60
61
|
this.handleEscape(menu);
|
package/getBabelConfig.js
CHANGED
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
left: 0;
|
|
20
20
|
top: 0;
|
|
21
21
|
height: 100%;
|
|
22
|
-
box-sizing: border-box;
|
|
23
|
-
padding: 2px 0;
|
|
24
22
|
}
|
|
25
23
|
.semi-anchor-slide-muted {
|
|
26
24
|
display: none;
|
|
@@ -56,13 +54,6 @@
|
|
|
56
54
|
border-radius: 1px;
|
|
57
55
|
content: " ";
|
|
58
56
|
}
|
|
59
|
-
.semi-anchor-link {
|
|
60
|
-
padding-left: 8px;
|
|
61
|
-
}
|
|
62
|
-
.semi-anchor-link-wrapper {
|
|
63
|
-
padding-right: 2px;
|
|
64
|
-
margin: 2px 0;
|
|
65
|
-
}
|
|
66
57
|
.semi-anchor-link-title {
|
|
67
58
|
cursor: pointer;
|
|
68
59
|
color: var(--semi-color-text-2);
|
|
@@ -83,6 +74,7 @@
|
|
|
83
74
|
}
|
|
84
75
|
.semi-anchor-link-title:focus-visible {
|
|
85
76
|
outline: 2px solid var(--semi-color-primary-light-active);
|
|
77
|
+
outline-offset: -2px;
|
|
86
78
|
}
|
|
87
79
|
.semi-anchor-link-title-disabled {
|
|
88
80
|
color: var(--semi-color-disabled-text);
|
|
@@ -125,6 +117,5 @@
|
|
|
125
117
|
}
|
|
126
118
|
.semi-rtl .semi-anchor-link,
|
|
127
119
|
.semi-portal-rtl .semi-anchor-link {
|
|
128
|
-
padding-right: 8px;
|
|
129
120
|
padding-left: auto;
|
|
130
121
|
}
|
|
@@ -18,8 +18,6 @@ $module: #{$prefix}-anchor;
|
|
|
18
18
|
left: $spacing-anchor_slide-left;
|
|
19
19
|
top: $spacing-anchor_slide-top;
|
|
20
20
|
height: 100%;
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
padding: $width-anchor-outline 0;
|
|
23
21
|
|
|
24
22
|
&-muted {
|
|
25
23
|
display: none;
|
|
@@ -65,12 +63,6 @@ $module: #{$prefix}-anchor;
|
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
&-link {
|
|
68
|
-
padding-left: $spacing-anchor_link-paddingLeft;
|
|
69
|
-
|
|
70
|
-
&-wrapper {
|
|
71
|
-
padding-right: $width-anchor-outline;
|
|
72
|
-
margin: $width-anchor-outline 0;
|
|
73
|
-
}
|
|
74
66
|
|
|
75
67
|
&-title {
|
|
76
68
|
cursor: pointer;
|
|
@@ -93,6 +85,7 @@ $module: #{$prefix}-anchor;
|
|
|
93
85
|
|
|
94
86
|
&:focus-visible {
|
|
95
87
|
outline: $width-anchor-outline solid $color-anchor_title-outline-focus;
|
|
88
|
+
outline-offset: $width-anchor-outlineOffset;
|
|
96
89
|
}
|
|
97
90
|
|
|
98
91
|
&-disabled {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.strings = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
16
|
-
|
|
17
8
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
18
9
|
|
|
19
10
|
var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
|
|
@@ -24,13 +15,15 @@ var _scrollIntoViewIfNeeded = _interopRequireDefault(require("scroll-into-view-i
|
|
|
24
15
|
|
|
25
16
|
var _constants = require("./constants");
|
|
26
17
|
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
27
20
|
const prefixCls = _constants.cssClasses.PREFIX;
|
|
28
21
|
|
|
29
22
|
class AnchorFoundation extends _foundation.default {
|
|
30
23
|
constructor(adapter) {
|
|
31
24
|
var _this;
|
|
32
25
|
|
|
33
|
-
super(
|
|
26
|
+
super(Object.assign(Object.assign({}, AnchorFoundation.defaultAdapter), adapter));
|
|
34
27
|
_this = this;
|
|
35
28
|
|
|
36
29
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -170,7 +163,7 @@ class AnchorFoundation extends _foundation.default {
|
|
|
170
163
|
}
|
|
171
164
|
|
|
172
165
|
if (!(node.href in linkMap)) {
|
|
173
|
-
linkMap[node.href] = new
|
|
166
|
+
linkMap[node.href] = new Set();
|
|
174
167
|
} // Every ancestor kept a map
|
|
175
168
|
|
|
176
169
|
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
8
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
16
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
17
12
|
class LinkFoundation extends _foundation.default {
|
|
18
13
|
constructor(adapter) {
|
|
19
|
-
super(
|
|
14
|
+
super(Object.assign({}, adapter));
|
|
20
15
|
}
|
|
21
16
|
|
|
22
17
|
init() {// this.setInitValue();
|
package/lib/cjs/anchor/rtl.scss
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.strings = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../tooltip/constants");
|
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
16
|
-
|
|
17
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
18
|
-
|
|
19
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map"));
|
|
20
|
-
|
|
21
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
22
|
-
|
|
23
|
-
var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
|
|
24
|
-
|
|
25
|
-
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
|
|
26
|
-
|
|
27
8
|
var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
|
|
28
9
|
|
|
29
10
|
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
|
|
@@ -38,10 +19,12 @@ var _warning = _interopRequireDefault(require("../utils/warning"));
|
|
|
38
19
|
|
|
39
20
|
var _keyCode = _interopRequireDefault(require("../utils/keyCode"));
|
|
40
21
|
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
41
24
|
/* eslint-disable prefer-const, max-len */
|
|
42
25
|
class AutoCompleteFoundation extends _foundation.default {
|
|
43
26
|
constructor(adapter) {
|
|
44
|
-
super(
|
|
27
|
+
super(Object.assign({}, adapter));
|
|
45
28
|
this.isPanelOpen = false;
|
|
46
29
|
}
|
|
47
30
|
|
|
@@ -93,11 +76,9 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
93
76
|
let width;
|
|
94
77
|
|
|
95
78
|
if (dropdownMatchSelectWidth) {
|
|
96
|
-
var _context;
|
|
97
|
-
|
|
98
79
|
if (style && (0, _isNumber2.default)(style.width)) {
|
|
99
80
|
width = style.width;
|
|
100
|
-
} else if (style && (0, _isString2.default)(style.width) && !
|
|
81
|
+
} else if (style && (0, _isString2.default)(style.width) && !style.width.includes('%')) {
|
|
101
82
|
width = style.width;
|
|
102
83
|
} else {
|
|
103
84
|
width = this._adapter.getTriggerWidth();
|
|
@@ -156,7 +137,7 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
156
137
|
const options = [];
|
|
157
138
|
|
|
158
139
|
if (data && data.length) {
|
|
159
|
-
|
|
140
|
+
data.forEach((item, i) => {
|
|
160
141
|
const key = String(new Date().getTime()) + i;
|
|
161
142
|
let option = {};
|
|
162
143
|
|
|
@@ -168,7 +149,7 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
168
149
|
show: true
|
|
169
150
|
};
|
|
170
151
|
} else if ((0, _isObject2.default)(item) && !(0, _isUndefined2.default)(item.value)) {
|
|
171
|
-
option =
|
|
152
|
+
option = Object.assign({
|
|
172
153
|
show: true
|
|
173
154
|
}, item);
|
|
174
155
|
}
|
|
@@ -234,7 +215,7 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
234
215
|
}
|
|
235
216
|
|
|
236
217
|
updateSelection(option) {
|
|
237
|
-
const selection = new
|
|
218
|
+
const selection = new Map();
|
|
238
219
|
|
|
239
220
|
if (option) {
|
|
240
221
|
selection.set(option.label, option);
|
|
@@ -285,9 +266,9 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
285
266
|
const options = this._generateList(data); // Get the option whose value match from options
|
|
286
267
|
|
|
287
268
|
|
|
288
|
-
let selectedOption =
|
|
269
|
+
let selectedOption = options.filter(option => renderSelectedItem(option) === selectedValue);
|
|
289
270
|
const canMatchInData = selectedOption.length;
|
|
290
|
-
const selectedOptionIndex =
|
|
271
|
+
const selectedOptionIndex = options.findIndex(option => renderSelectedItem(option) === selectedValue);
|
|
291
272
|
let inputValue = '';
|
|
292
273
|
|
|
293
274
|
if (canMatchInData) {
|
|
@@ -325,7 +306,7 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
325
306
|
|
|
326
307
|
const options = this._generateList(data);
|
|
327
308
|
|
|
328
|
-
const selectedOptionIndex =
|
|
309
|
+
const selectedOptionIndex = options.findIndex(option => renderSelectedItem(option) === searchValue);
|
|
329
310
|
|
|
330
311
|
if (selectedOptionIndex === -1 && defaultActiveFirstOption) {
|
|
331
312
|
if (focusIndex !== 0) {
|
|
@@ -421,7 +402,7 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
421
402
|
focusIndex,
|
|
422
403
|
options
|
|
423
404
|
} = this.getStates();
|
|
424
|
-
const visibleOptions =
|
|
405
|
+
const visibleOptions = options.filter(item => item.show);
|
|
425
406
|
const optionsLength = visibleOptions.length;
|
|
426
407
|
let index = focusIndex + offset;
|
|
427
408
|
|
|
@@ -494,7 +475,7 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
494
475
|
this.openDropdown();
|
|
495
476
|
} else {
|
|
496
477
|
if (focusIndex !== undefined && focusIndex !== -1 && options.length !== 0) {
|
|
497
|
-
const visibleOptions =
|
|
478
|
+
const visibleOptions = options.filter(item => item.show);
|
|
498
479
|
const selectedOption = visibleOptions[focusIndex];
|
|
499
480
|
this.handleSelect(selectedOption, focusIndex);
|
|
500
481
|
} else {
|
|
@@ -518,7 +499,7 @@ class AutoCompleteFoundation extends _foundation.default {
|
|
|
518
499
|
handleBlur(e) {
|
|
519
500
|
// In order to handle the problem of losing onClick binding when clicking on the padding area, the onBlur event is triggered first to cause the react view to be updated
|
|
520
501
|
// internal-issues:1231
|
|
521
|
-
(
|
|
502
|
+
setTimeout(() => {
|
|
522
503
|
this._adapter.notifyBlur(e);
|
|
523
504
|
|
|
524
505
|
this.closeDropdown();
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
8
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
16
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
17
12
|
class OptionFoundation extends _foundation.default {
|
|
18
13
|
constructor(adapter) {
|
|
19
|
-
super(
|
|
14
|
+
super(Object.assign({}, adapter));
|
|
20
15
|
} // eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
21
16
|
|
|
22
17
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.strings = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
8
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
16
9
|
|
|
17
10
|
var _warning = _interopRequireDefault(require("../utils/warning"));
|
|
18
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
19
14
|
class AvatarFoundation extends _foundation.default {
|
|
20
15
|
constructor(adapter) {
|
|
21
|
-
super(
|
|
16
|
+
super(Object.assign({}, adapter));
|
|
22
17
|
|
|
23
18
|
this.handleFocusVisible = event => {
|
|
24
19
|
const {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.strings = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|