@douyinfe/semi-foundation 2.19.0-beta.0 → 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/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/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 +13 -24
- 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/tableRowFoundation.js +3 -6
- package/lib/cjs/table/tableSelectionCellFoundation.js +3 -6
- package/lib/cjs/table/utils.js +42 -71
- 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/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.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/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/sideSheetFoundation.js +3 -7
- package/lib/es/slider/foundation.js +10 -16
- 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/utils.js +33 -51
- 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/treeUtil.js +57 -109
- package/lib/es/treeSelect/foundation.js +45 -73
- 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/select/foundation.ts +2 -2
|
@@ -1,38 +1,15 @@
|
|
|
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 _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
16
|
-
|
|
17
|
-
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
18
|
-
|
|
19
|
-
var _includes2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
20
|
-
|
|
21
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
22
|
-
|
|
23
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
24
|
-
|
|
25
|
-
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
26
|
-
|
|
27
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
28
|
-
|
|
29
|
-
var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim"));
|
|
30
|
-
|
|
31
8
|
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
32
9
|
|
|
33
10
|
var _isSet2 = _interopRequireDefault(require("lodash/isSet"));
|
|
34
11
|
|
|
35
|
-
var
|
|
12
|
+
var _includes2 = _interopRequireDefault(require("lodash/includes"));
|
|
36
13
|
|
|
37
14
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
38
15
|
|
|
@@ -52,6 +29,8 @@ var _getDefaultFormatToken = require("./_utils/getDefaultFormatToken");
|
|
|
52
29
|
|
|
53
30
|
var _isNullOrUndefined = _interopRequireDefault(require("../utils/isNullOrUndefined"));
|
|
54
31
|
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
+
|
|
55
34
|
/* eslint-disable max-len */
|
|
56
35
|
const dateDiffFns = {
|
|
57
36
|
month: _dateFns.differenceInCalendarMonths,
|
|
@@ -66,7 +45,7 @@ const dateCalcFns = {
|
|
|
66
45
|
|
|
67
46
|
class MonthsGridFoundation extends _foundation.default {
|
|
68
47
|
constructor(adapter) {
|
|
69
|
-
super(
|
|
48
|
+
super(Object.assign({}, adapter)); // Date change data when double panels
|
|
70
49
|
|
|
71
50
|
this.newBiMonthPanelDate = [this.getState('monthLeft').pickerDate, this.getState('monthRight').pickerDate];
|
|
72
51
|
}
|
|
@@ -125,10 +104,10 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
125
104
|
default:
|
|
126
105
|
break;
|
|
127
106
|
}
|
|
128
|
-
} else if (
|
|
107
|
+
} else if (Array.isArray(values) && !values.length || !values) {
|
|
129
108
|
// Empty panel when value is empty Select date
|
|
130
109
|
if ((0, _isSet2.default)(selected) && selected.size) {
|
|
131
|
-
this._adapter.updateDaySelected(new
|
|
110
|
+
this._adapter.updateDaySelected(new Set());
|
|
132
111
|
}
|
|
133
112
|
|
|
134
113
|
if (rangeStart) {
|
|
@@ -142,14 +121,12 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
142
121
|
}
|
|
143
122
|
|
|
144
123
|
calcDisabledTime(panelType) {
|
|
145
|
-
var _context;
|
|
146
|
-
|
|
147
124
|
const {
|
|
148
125
|
disabledTime,
|
|
149
126
|
type
|
|
150
127
|
} = this.getProps();
|
|
151
128
|
|
|
152
|
-
if (typeof disabledTime === 'function' && panelType &&
|
|
129
|
+
if (typeof disabledTime === 'function' && panelType && ['dateTime', 'dateTimeRange'].includes(type)) {
|
|
153
130
|
const {
|
|
154
131
|
rangeStart,
|
|
155
132
|
rangeEnd,
|
|
@@ -169,7 +146,7 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
169
146
|
selected.push(monthLeft.showDate);
|
|
170
147
|
}
|
|
171
148
|
|
|
172
|
-
const selectedDates =
|
|
149
|
+
const selectedDates = selected.map(str => str instanceof Date ? str : (0, _dateFns.parseISO)(str));
|
|
173
150
|
const cbDates = type === 'dateTimeRange' ? selectedDates : selectedDates[0];
|
|
174
151
|
return disabledTime(cbDates, panelType);
|
|
175
152
|
}
|
|
@@ -178,16 +155,16 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
178
155
|
_initDatePickerFromValue(values) {
|
|
179
156
|
let refreshPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
180
157
|
const monthLeft = this.getState('monthLeft');
|
|
181
|
-
const newMonthLeft =
|
|
158
|
+
const newMonthLeft = Object.assign({}, monthLeft); // REMOVE:
|
|
182
159
|
|
|
183
160
|
this._adapter.updateMonthOnLeft(newMonthLeft);
|
|
184
161
|
|
|
185
|
-
const newSelected = new
|
|
162
|
+
const newSelected = new Set();
|
|
186
163
|
|
|
187
164
|
if (!this._isMultiple()) {
|
|
188
165
|
values[0] && newSelected.add((0, _dateFns.format)(values[0], _constants.strings.FORMAT_FULL_DATE));
|
|
189
166
|
} else {
|
|
190
|
-
|
|
167
|
+
values.forEach(date => {
|
|
191
168
|
date && newSelected.add((0, _dateFns.format)(date, _constants.strings.FORMAT_FULL_DATE));
|
|
192
169
|
});
|
|
193
170
|
}
|
|
@@ -208,9 +185,9 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
208
185
|
const monthLeft = this.getState('monthLeft');
|
|
209
186
|
const monthRight = this.getState('monthRight');
|
|
210
187
|
|
|
211
|
-
const adjustResult = this._autoAdjustMonth(
|
|
188
|
+
const adjustResult = this._autoAdjustMonth(Object.assign(Object.assign({}, monthLeft), {
|
|
212
189
|
pickerDate: values[0] || monthLeft.pickerDate
|
|
213
|
-
}),
|
|
190
|
+
}), Object.assign(Object.assign({}, monthRight), {
|
|
214
191
|
pickerDate: values[1] || monthRight.pickerDate
|
|
215
192
|
}));
|
|
216
193
|
|
|
@@ -435,13 +412,11 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
435
412
|
}
|
|
436
413
|
|
|
437
414
|
isValidTimeZone(timeZone) {
|
|
438
|
-
var _context2;
|
|
439
|
-
|
|
440
415
|
const propTimeZone = this.getProp('timeZone');
|
|
441
416
|
|
|
442
417
|
const _timeZone = (0, _isNullOrUndefined.default)(timeZone) ? propTimeZone : timeZone;
|
|
443
418
|
|
|
444
|
-
return
|
|
419
|
+
return ['string', 'number'].includes(typeof _timeZone) && _timeZone !== '';
|
|
445
420
|
}
|
|
446
421
|
/**
|
|
447
422
|
* 根据 type 处理 onChange 返回的参数
|
|
@@ -473,11 +448,11 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
473
448
|
|
|
474
449
|
|
|
475
450
|
disposeCallbackArgs(value) {
|
|
476
|
-
let _value =
|
|
451
|
+
let _value = Array.isArray(value) ? value : value && [value] || [];
|
|
477
452
|
|
|
478
453
|
if (this.isValidTimeZone()) {
|
|
479
454
|
const timeZone = this.getProp('timeZone');
|
|
480
|
-
_value =
|
|
455
|
+
_value = _value.map(date => (0, _dateFnsExtra.zonedTimeToUtc)(date, timeZone));
|
|
481
456
|
}
|
|
482
457
|
|
|
483
458
|
const type = this.getProp('type');
|
|
@@ -492,7 +467,7 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
492
467
|
notifyValue = _value[0] && this.localeFormat(_value[0], formatToken);
|
|
493
468
|
[notifyDate] = _value;
|
|
494
469
|
} else {
|
|
495
|
-
notifyValue =
|
|
470
|
+
notifyValue = _value.map(v => v && this.localeFormat(v, formatToken));
|
|
496
471
|
notifyDate = [..._value];
|
|
497
472
|
}
|
|
498
473
|
|
|
@@ -500,7 +475,7 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
500
475
|
|
|
501
476
|
case 'dateRange':
|
|
502
477
|
case 'dateTimeRange':
|
|
503
|
-
notifyValue =
|
|
478
|
+
notifyValue = _value.map(v => v && this.localeFormat(v, formatToken));
|
|
504
479
|
notifyDate = [..._value];
|
|
505
480
|
break;
|
|
506
481
|
|
|
@@ -587,33 +562,41 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
587
562
|
|
|
588
563
|
|
|
589
564
|
updateDateAfterChangeYM(type, targetDate) {
|
|
590
|
-
var _context3;
|
|
591
|
-
|
|
592
565
|
const {
|
|
593
566
|
multiple,
|
|
594
|
-
disabledDate
|
|
567
|
+
disabledDate,
|
|
568
|
+
type: dateType
|
|
595
569
|
} = this.getProps();
|
|
596
570
|
const {
|
|
597
571
|
selected: selectedSet,
|
|
598
572
|
rangeStart,
|
|
599
|
-
rangeEnd
|
|
573
|
+
rangeEnd,
|
|
574
|
+
monthLeft
|
|
600
575
|
} = this.getStates(); // FIXME:
|
|
601
576
|
|
|
602
|
-
const includeRange =
|
|
577
|
+
const includeRange = ['dateRange', 'dateTimeRange'].includes(type);
|
|
603
578
|
const options = {
|
|
604
579
|
closePanel: false
|
|
605
580
|
};
|
|
606
581
|
|
|
607
582
|
if (!multiple && !includeRange && selectedSet.size) {
|
|
608
|
-
const selectedStr =
|
|
583
|
+
const selectedStr = Array.from(selectedSet)[0];
|
|
609
584
|
const selectedDate = new Date(selectedStr);
|
|
610
585
|
const year = targetDate.getFullYear();
|
|
611
586
|
const month = targetDate.getMonth();
|
|
612
|
-
|
|
587
|
+
let fullDate = (0, _dateFns.set)(selectedDate, {
|
|
613
588
|
year,
|
|
614
589
|
month
|
|
615
590
|
});
|
|
616
591
|
|
|
592
|
+
if (dateType === 'dateTime') {
|
|
593
|
+
/**
|
|
594
|
+
* 如果是 type dateTime 切换月份要读取只取的time
|
|
595
|
+
* 无论 monthLeft 还是 monthRight 他们的 time 是不变的,所以只取 monthLeft 即可
|
|
596
|
+
*/
|
|
597
|
+
fullDate = this._mergeDateAndTime(fullDate, monthLeft.pickerDate);
|
|
598
|
+
}
|
|
599
|
+
|
|
617
600
|
if (disabledDate(fullDate, {
|
|
618
601
|
rangeStart,
|
|
619
602
|
rangeEnd
|
|
@@ -650,8 +633,6 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
650
633
|
}
|
|
651
634
|
|
|
652
635
|
handleDateSelected(day, panelType) {
|
|
653
|
-
var _context4;
|
|
654
|
-
|
|
655
636
|
const {
|
|
656
637
|
max,
|
|
657
638
|
type,
|
|
@@ -667,7 +648,7 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
667
648
|
|
|
668
649
|
const monthDetail = this._getPanelDetail(panelType);
|
|
669
650
|
|
|
670
|
-
const newSelected = new
|
|
651
|
+
const newSelected = new Set(multiple ? [...selected] : []);
|
|
671
652
|
const {
|
|
672
653
|
fullDate
|
|
673
654
|
} = day;
|
|
@@ -688,7 +669,7 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
688
669
|
|
|
689
670
|
const dateFormat = this.getValidDateFormat(); // When passed to the upper layer, it is converted into a Date object to ensure that the input parameter format of initFormDefaultValue is consistent
|
|
690
671
|
|
|
691
|
-
const newSelectedDates =
|
|
672
|
+
const newSelectedDates = [...newSelected].map(_dateStr => (0, _parser.compatibleParse)(_dateStr, dateFormat, undefined, dateFnsLocale));
|
|
692
673
|
this.handleShowDateAndTime(panelType, time);
|
|
693
674
|
|
|
694
675
|
if (!isControlledComponent) {
|
|
@@ -718,14 +699,12 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
718
699
|
|
|
719
700
|
|
|
720
701
|
_mergeDateAndTime(date, time) {
|
|
721
|
-
var _context5;
|
|
722
|
-
|
|
723
702
|
const dateFnsLocale = this._adapter.getProp('dateFnsLocale');
|
|
724
703
|
|
|
725
704
|
const dateStr = (0, _dateFns.format)((0, _index.isValidDate)(date) ? date : (0, _parser.compatibleParse)(date, _constants.strings.FORMAT_FULL_DATE, undefined, dateFnsLocale), _constants.strings.FORMAT_FULL_DATE);
|
|
726
705
|
const timeStr = (0, _dateFns.format)((0, _index.isValidDate)(time) ? time : (0, _parser.compatibleParse)(time, _constants.strings.FORMAT_TIME_PICKER, undefined, dateFnsLocale), _constants.strings.FORMAT_TIME_PICKER);
|
|
727
706
|
const timeFormat = this.getValidTimeFormat();
|
|
728
|
-
return (0, _parser.compatibleParse)(
|
|
707
|
+
return (0, _parser.compatibleParse)("".concat(dateStr, " ").concat(timeStr), timeFormat, undefined, dateFnsLocale);
|
|
729
708
|
}
|
|
730
709
|
|
|
731
710
|
handleRangeSelected(day) {
|
|
@@ -757,7 +736,7 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
757
736
|
if (rangeInputFocus === 'rangeEnd') {
|
|
758
737
|
rangeEnd = fullDate; // rangStart Parten in dateTime: 'yyyy-MM-dd HH:MM:SS', rangeEnd parten: 'yyyy-MM-dd'
|
|
759
738
|
|
|
760
|
-
if (rangeStart && rangeEnd && (0, _index.isBefore)(rangeEnd,
|
|
739
|
+
if (rangeStart && rangeEnd && (0, _index.isBefore)(rangeEnd, rangeStart.trim().split(/\s+/)[0])) {
|
|
761
740
|
rangeStart = null;
|
|
762
741
|
rangeStartReset = true;
|
|
763
742
|
} // Compatible to select date after opening the panel without click input
|
|
@@ -765,7 +744,7 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
765
744
|
} else if (rangeInputFocus === 'rangeStart' || !rangeInputFocus) {
|
|
766
745
|
rangeStart = fullDate; // rangEnd Parten in dateTime: 'yyyy-MM-dd HH:MM:SS', rangeStart parten: 'yyyy-MM-dd'
|
|
767
746
|
|
|
768
|
-
if (rangeStart && rangeEnd && (0, _index.isBefore)(
|
|
747
|
+
if (rangeStart && rangeEnd && (0, _index.isBefore)(rangeEnd.trim().split(/\s+/)[0], rangeStart)) {
|
|
769
748
|
rangeEnd = null;
|
|
770
749
|
rangeEndReset = true;
|
|
771
750
|
}
|
|
@@ -881,12 +860,12 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
881
860
|
|
|
882
861
|
if (difference > 0) {
|
|
883
862
|
// The month on the left is larger than the month on the right, swap
|
|
884
|
-
newMonthLeft =
|
|
885
|
-
newMonthRight =
|
|
863
|
+
newMonthLeft = Object.assign({}, monthRight);
|
|
864
|
+
newMonthRight = Object.assign({}, monthLeft);
|
|
886
865
|
} else if (difference === 0) {
|
|
887
866
|
// Around the same month, the number of months on the right + 1
|
|
888
867
|
newMonthLeft = monthLeft;
|
|
889
|
-
newMonthRight =
|
|
868
|
+
newMonthRight = Object.assign(Object.assign({}, monthRight), {
|
|
890
869
|
pickerDate: (0, _dateFns.addMonths)(monthRight.pickerDate, 1)
|
|
891
870
|
});
|
|
892
871
|
}
|
|
@@ -902,15 +881,15 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
902
881
|
|
|
903
882
|
const timeFormatTokens = [];
|
|
904
883
|
|
|
905
|
-
if ((0,
|
|
884
|
+
if ((0, _includes2.default)(formatProp, 'h') || (0, _includes2.default)(formatProp, 'H')) {
|
|
906
885
|
timeFormatTokens.push('HH');
|
|
907
886
|
}
|
|
908
887
|
|
|
909
|
-
if ((0,
|
|
888
|
+
if ((0, _includes2.default)(formatProp, 'm')) {
|
|
910
889
|
timeFormatTokens.push('mm');
|
|
911
890
|
}
|
|
912
891
|
|
|
913
|
-
if ((0,
|
|
892
|
+
if ((0, _includes2.default)(formatProp, 's')) {
|
|
914
893
|
timeFormatTokens.push('ss');
|
|
915
894
|
}
|
|
916
895
|
|
|
@@ -1035,9 +1014,9 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
1035
1014
|
} = this.getStates();
|
|
1036
1015
|
|
|
1037
1016
|
if (panelType === _constants.strings.PANEL_TYPE_RIGHT) {
|
|
1038
|
-
this._adapter.updateMonthOnRight(
|
|
1017
|
+
this._adapter.updateMonthOnRight(Object.assign(Object.assign({}, monthRight), kvs));
|
|
1039
1018
|
} else {
|
|
1040
|
-
this._adapter.updateMonthOnLeft(
|
|
1019
|
+
this._adapter.updateMonthOnLeft(Object.assign(Object.assign({}, monthLeft), kvs));
|
|
1041
1020
|
}
|
|
1042
1021
|
}
|
|
1043
1022
|
|
|
@@ -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 YearAndMonthFoundation 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.numbers = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|
|
@@ -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,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.numbers = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../tooltip/constants");
|
|
@@ -1,23 +1,16 @@
|
|
|
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 _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
14
|
-
|
|
15
|
-
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
16
|
-
|
|
17
8
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
18
9
|
|
|
19
10
|
var _a11y = require("../utils/a11y");
|
|
20
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
21
14
|
class DropdownFoundation extends _foundation.default {
|
|
22
15
|
handleVisibleChange(visible) {
|
|
23
16
|
this._adapter.setPopVisible(visible);
|
|
@@ -26,12 +19,10 @@ class DropdownFoundation extends _foundation.default {
|
|
|
26
19
|
}
|
|
27
20
|
|
|
28
21
|
getMenuItemNodes(target) {
|
|
29
|
-
var _context;
|
|
30
|
-
|
|
31
22
|
const id = target.attributes['data-popupid'].value;
|
|
32
23
|
const menuWrapper = document.getElementById(id); // if has dropdown item, the item must wrapped by li
|
|
33
24
|
|
|
34
|
-
return menuWrapper ?
|
|
25
|
+
return menuWrapper ? Array.from(menuWrapper.getElementsByTagName('li')).filter(item => item.ariaDisabled === "false") : null;
|
|
35
26
|
}
|
|
36
27
|
|
|
37
28
|
setFocusToFirstMenuItem(target) {
|
|
@@ -48,8 +39,9 @@ class DropdownFoundation extends _foundation.default {
|
|
|
48
39
|
switch (event.key) {
|
|
49
40
|
case ' ':
|
|
50
41
|
case 'Enter':
|
|
51
|
-
event.target.click();
|
|
52
|
-
|
|
42
|
+
event.target.click(); // user may use input to be the trigger and bind some key event on it, so do not stoppropagation
|
|
43
|
+
// handlePrevent(event);
|
|
44
|
+
|
|
53
45
|
break;
|
|
54
46
|
|
|
55
47
|
case 'ArrowDown':
|
|
@@ -1,27 +1,16 @@
|
|
|
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 _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
14
|
-
|
|
15
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
16
|
-
|
|
17
|
-
var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim"));
|
|
18
|
-
|
|
19
|
-
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
20
|
-
|
|
21
8
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
22
9
|
|
|
23
10
|
var _a11y = require("../utils/a11y");
|
|
24
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
25
14
|
class DropdownMenuFoundation extends _foundation.default {
|
|
26
15
|
constructor() {
|
|
27
16
|
super(...arguments);
|
|
@@ -34,10 +23,8 @@ class DropdownMenuFoundation extends _foundation.default {
|
|
|
34
23
|
const trigger = this._adapter.getContext('trigger');
|
|
35
24
|
|
|
36
25
|
if (trigger === 'click') {
|
|
37
|
-
var _context;
|
|
38
|
-
|
|
39
26
|
// find all non-disabled li under this menu and set focus to the first menu
|
|
40
|
-
this.menuItemNodes =
|
|
27
|
+
this.menuItemNodes = [...ulElement.getElementsByTagName('li')].filter(item => item.ariaDisabled !== "true");
|
|
41
28
|
(0, _a11y.setFocusToFirstItem)(this.menuItemNodes);
|
|
42
29
|
}
|
|
43
30
|
}
|
|
@@ -60,37 +47,30 @@ class DropdownMenuFoundation extends _foundation.default {
|
|
|
60
47
|
}
|
|
61
48
|
|
|
62
49
|
onMenuKeydown(event) {
|
|
63
|
-
var _context5;
|
|
64
|
-
|
|
65
50
|
const menu = (0, _a11y.getAncestorNodeByRole)(event.target, 'tooltip');
|
|
66
51
|
|
|
67
52
|
if (!this.menuItemNodes) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.menuItemNodes = (0, _filter.default)(_context2 = [...event.target.parentNode.getElementsByTagName('li')]).call(_context2, item => item.ariaDisabled !== "true");
|
|
53
|
+
this.menuItemNodes = [...event.target.parentNode.getElementsByTagName('li')].filter(item => item.ariaDisabled !== "true");
|
|
71
54
|
}
|
|
72
55
|
|
|
73
56
|
if (this.firstChars.length === 0) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
(0, _forEach.default)(_context3 = this.menuItemNodes).call(_context3, item => {
|
|
77
|
-
var _context4;
|
|
78
|
-
|
|
57
|
+
this.menuItemNodes.forEach(item => {
|
|
79
58
|
var _a; // the menuItemNodes can be an component and not exit textContent
|
|
80
59
|
|
|
81
60
|
|
|
82
|
-
this.firstChars.push((_a =
|
|
61
|
+
this.firstChars.push((_a = item.textContent.trim()[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
83
62
|
});
|
|
84
63
|
} // get the currently focused menu item
|
|
85
64
|
|
|
86
65
|
|
|
87
|
-
const curItem =
|
|
66
|
+
const curItem = this.menuItemNodes.find(item => item.tabIndex === 0);
|
|
88
67
|
|
|
89
68
|
switch (event.key) {
|
|
90
69
|
case ' ':
|
|
91
70
|
case 'Enter':
|
|
92
|
-
event.target.click();
|
|
93
|
-
|
|
71
|
+
event.target.click(); // user may use input to be the trigger and bind some key event on it, so do not stoppropagation
|
|
72
|
+
// handlePrevent(event);
|
|
73
|
+
|
|
94
74
|
break;
|
|
95
75
|
|
|
96
76
|
case 'Escape':
|
|
@@ -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,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.numbers = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|