@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,19 +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
8
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
14
9
|
|
|
15
10
|
var _keyCode = require("./keyCode");
|
|
16
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
17
14
|
/* istanbul ignore next */
|
|
18
15
|
function isEscPress(e) {
|
|
19
16
|
return (0, _get2.default)(e, 'key') === _keyCode.ESC_KEY ? true : false;
|
|
@@ -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.default = isNullOrUndefined;
|
|
10
7
|
|
|
11
8
|
/**
|
|
@@ -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.default = isNumber;
|
|
10
7
|
|
|
11
8
|
function isNumber(value) {
|
|
@@ -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.default = isObject;
|
|
10
7
|
|
|
11
8
|
function isObject(obj) {
|
|
@@ -1,17 +1,14 @@
|
|
|
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 = isPromise;
|
|
12
7
|
|
|
13
8
|
var _isObject = _interopRequireDefault(require("./isObject"));
|
|
14
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
15
12
|
function isPromise(value) {
|
|
16
13
|
return (0, _isObject.default)(value) && typeof value.then === 'function';
|
|
17
14
|
}
|
|
@@ -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.default = _default;
|
|
10
7
|
|
|
11
8
|
function _default(str) {
|
package/lib/cjs/utils/keyCode.js
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.default = exports.TAB_KEY = exports.ESC_KEY = exports.ENTER_KEY = void 0;
|
|
10
7
|
|
|
11
8
|
/**
|
package/lib/cjs/utils/log.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
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
8
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
14
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
15
12
|
const log = function (text) {
|
|
16
13
|
if ((0, _get2.default)(process, 'env.NODE_ENV') === 'development') {
|
|
17
14
|
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
package/lib/cjs/utils/number.js
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.minus = minus;
|
|
10
7
|
exports.plus = plus;
|
|
11
8
|
|
package/lib/cjs/utils/object.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
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.empty = empty;
|
|
12
7
|
exports.forwardStatics = forwardStatics;
|
|
13
8
|
exports.get = get;
|
|
@@ -15,18 +10,6 @@ exports.has = has;
|
|
|
15
10
|
exports.remove = remove;
|
|
16
11
|
exports.set = set;
|
|
17
12
|
|
|
18
|
-
var _isInteger = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/number/is-integer"));
|
|
19
|
-
|
|
20
|
-
var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/every"));
|
|
21
|
-
|
|
22
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
23
|
-
|
|
24
|
-
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
25
|
-
|
|
26
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
27
|
-
|
|
28
|
-
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/entries"));
|
|
29
|
-
|
|
30
13
|
var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
|
|
31
14
|
|
|
32
15
|
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
|
|
@@ -43,11 +26,13 @@ var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
|
43
26
|
|
|
44
27
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
45
28
|
|
|
29
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
|
+
|
|
46
31
|
const pathToArrayElem = path => {
|
|
47
32
|
const pathArray = (0, _toPath2.default)(path); // internal-issues:673
|
|
48
33
|
|
|
49
34
|
const justNumber = (0, _isNumber2.default)(path) && pathArray.length === 1;
|
|
50
|
-
return justNumber ? false :
|
|
35
|
+
return justNumber ? false : Number.isInteger(+pathArray[pathArray.length - 1]);
|
|
51
36
|
};
|
|
52
37
|
|
|
53
38
|
function isEmptyObject(target) {
|
|
@@ -72,7 +57,7 @@ function isEmptyObject(target) {
|
|
|
72
57
|
if (!valuesOfTarget.length) {
|
|
73
58
|
return true; // like target: {}
|
|
74
59
|
} else {
|
|
75
|
-
return
|
|
60
|
+
return valuesOfTarget.every(item => typeof item === 'undefined');
|
|
76
61
|
}
|
|
77
62
|
}
|
|
78
63
|
}
|
|
@@ -94,14 +79,14 @@ function cleanup(obj, path) {
|
|
|
94
79
|
// Delete object if its empty
|
|
95
80
|
// eslint-disable-next-line
|
|
96
81
|
|
|
97
|
-
if (
|
|
82
|
+
if (Array.isArray(target) && target.every(e => e == null)) {
|
|
98
83
|
(0, _unset2.default)(obj, path);
|
|
99
84
|
} else if (isEmptyObject(target)) {
|
|
100
85
|
(0, _unset2.default)(obj, path);
|
|
101
86
|
} // Recur
|
|
102
87
|
|
|
103
88
|
|
|
104
|
-
cleanup(obj,
|
|
89
|
+
cleanup(obj, path.slice(0, path.length - 1), pull);
|
|
105
90
|
}
|
|
106
91
|
|
|
107
92
|
function empty(object) {
|
|
@@ -117,7 +102,7 @@ function remove(object, path) {
|
|
|
117
102
|
// arr[11].a => [arr, 11, a]
|
|
118
103
|
|
|
119
104
|
let pathArray = (0, _toPath2.default)(path);
|
|
120
|
-
pathArray =
|
|
105
|
+
pathArray = pathArray.slice(0, pathArray.length - 1);
|
|
121
106
|
cleanup(object, pathArray, false);
|
|
122
107
|
}
|
|
123
108
|
|
|
@@ -134,7 +119,7 @@ function set(object, path, value, allowEmpty) {
|
|
|
134
119
|
if (pathToArrayElem(path) && get(object, path) !== undefined) {
|
|
135
120
|
(0, _set2.default)(object, path, undefined);
|
|
136
121
|
let pathArray = (0, _toPath2.default)(path);
|
|
137
|
-
pathArray =
|
|
122
|
+
pathArray = pathArray.slice(0, pathArray.length - 1);
|
|
138
123
|
cleanup(object, pathArray, false);
|
|
139
124
|
} else if (!pathToArrayElem(path) && get(object, path) !== undefined) {
|
|
140
125
|
// Only delete the field if it needs to be deleted and its not a path to an array ( array leaf )
|
|
@@ -162,9 +147,7 @@ function has(object, path) {
|
|
|
162
147
|
|
|
163
148
|
function forwardStatics(obj, srcObj) {
|
|
164
149
|
if (obj && (typeof obj === 'function' || typeof obj === 'object') && srcObj && (typeof srcObj === 'function' || typeof srcObj === 'object')) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
(0, _forEach.default)(_context = (0, _entries.default)(srcObj)).call(_context, _ref => {
|
|
150
|
+
Object.entries(srcObj).forEach(_ref => {
|
|
168
151
|
let [key, value] = _ref;
|
|
169
152
|
obj[key] = value;
|
|
170
153
|
});
|
package/lib/cjs/utils/set.js
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
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.copySet = copySet;
|
|
12
7
|
exports.pullAll = pullAll;
|
|
13
8
|
|
|
14
|
-
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
15
|
-
|
|
16
9
|
var _isSet2 = _interopRequireDefault(require("lodash/isSet"));
|
|
17
10
|
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
18
13
|
/* istanbul ignore next */
|
|
19
14
|
function copySet(setA) {
|
|
20
|
-
return new
|
|
15
|
+
return new Set(setA);
|
|
21
16
|
}
|
|
22
17
|
/**
|
|
23
18
|
* Set deduplicate
|
|
@@ -1,17 +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 = shallowEqualObjects;
|
|
12
7
|
|
|
13
|
-
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
14
|
-
|
|
15
8
|
function shallowEqualObjects(objA, objB) {
|
|
16
9
|
if (objA === objB) {
|
|
17
10
|
return true;
|
|
@@ -21,8 +14,8 @@ function shallowEqualObjects(objA, objB) {
|
|
|
21
14
|
return false;
|
|
22
15
|
}
|
|
23
16
|
|
|
24
|
-
const aKeys =
|
|
25
|
-
const bKeys =
|
|
17
|
+
const aKeys = Object.keys(objA);
|
|
18
|
+
const bKeys = Object.keys(objB);
|
|
26
19
|
const len = aKeys.length;
|
|
27
20
|
|
|
28
21
|
if (bKeys.length !== len) {
|
|
@@ -1,31 +1,24 @@
|
|
|
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 _globalThis2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/global-this"));
|
|
14
|
-
|
|
15
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
16
|
-
|
|
17
8
|
var _warning = _interopRequireDefault(require("./warning"));
|
|
18
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
19
12
|
const touchEventPolyfill = (touch, touchEvent) => {
|
|
20
13
|
/* Touch is the first point of multi-touch. In order to minimize the change of slider code to support touch,
|
|
21
14
|
some methods that will be used on touchEvent are mounted on the multi-touch Touch object.*/
|
|
22
15
|
// polyfill for firefox
|
|
23
|
-
if (!
|
|
16
|
+
if (!globalThis.Touch || !(touch instanceof Touch)) {
|
|
24
17
|
return touch;
|
|
25
18
|
}
|
|
26
19
|
|
|
27
20
|
const keysNeedPolyfill = ['stopPropagation', 'preventDefault'];
|
|
28
|
-
|
|
21
|
+
keysNeedPolyfill.forEach(key => {
|
|
29
22
|
let value = touchEvent[key];
|
|
30
23
|
|
|
31
24
|
if (value) {
|
package/lib/cjs/utils/type.js
CHANGED
package/lib/cjs/utils/uuid.js
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
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.getUuid = exports.default = getUuid;
|
|
12
7
|
exports.getUuidShort = getUuidShort;
|
|
13
8
|
exports.getUuidv4 = getUuidv4;
|
|
14
9
|
|
|
15
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
16
|
-
|
|
17
10
|
function getUuid(prefix) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(prefix, "-")).call(_context2, new Date().getTime(), "-")).call(_context, Math.random());
|
|
11
|
+
return "".concat(prefix, "-").concat(new Date().getTime(), "-").concat(Math.random());
|
|
21
12
|
} // https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
|
|
22
13
|
|
|
23
14
|
|
|
@@ -41,8 +32,6 @@ function getUuidv4() {
|
|
|
41
32
|
|
|
42
33
|
|
|
43
34
|
function getUuidShort() {
|
|
44
|
-
var _context3;
|
|
45
|
-
|
|
46
35
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
47
36
|
const {
|
|
48
37
|
prefix = '',
|
|
@@ -57,5 +46,5 @@ function getUuidShort() {
|
|
|
57
46
|
randomId += characters.charAt(random);
|
|
58
47
|
}
|
|
59
48
|
|
|
60
|
-
return prefix ?
|
|
49
|
+
return prefix ? "".concat(prefix, "-").concat(randomId) : randomId;
|
|
61
50
|
}
|
package/lib/cjs/utils/warning.js
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.default = warning;
|
|
10
7
|
|
|
11
8
|
function warning(flag, info) {
|
package/lib/es/anchor/anchor.css
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,7 +1,5 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
2
|
import _isArray from "lodash/isArray";
|
|
3
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
4
|
-
import _Set from "@babel/runtime-corejs3/core-js-stable/set";
|
|
5
3
|
import BaseFoundation from '../base/foundation';
|
|
6
4
|
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
7
5
|
import { cssClasses } from './constants';
|
|
@@ -10,7 +8,7 @@ export default class AnchorFoundation extends BaseFoundation {
|
|
|
10
8
|
constructor(adapter) {
|
|
11
9
|
var _this;
|
|
12
10
|
|
|
13
|
-
super(
|
|
11
|
+
super(Object.assign(Object.assign({}, AnchorFoundation.defaultAdapter), adapter));
|
|
14
12
|
_this = this;
|
|
15
13
|
|
|
16
14
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -150,7 +148,7 @@ export default class AnchorFoundation extends BaseFoundation {
|
|
|
150
148
|
}
|
|
151
149
|
|
|
152
150
|
if (!(node.href in linkMap)) {
|
|
153
|
-
linkMap[node.href] = new
|
|
151
|
+
linkMap[node.href] = new Set();
|
|
154
152
|
} // Every ancestor kept a map
|
|
155
153
|
|
|
156
154
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
2
1
|
import BaseFoundation from '../base/foundation';
|
|
3
2
|
export default class LinkFoundation extends BaseFoundation {
|
|
4
3
|
constructor(adapter) {
|
|
5
|
-
super(
|
|
4
|
+
super(Object.assign({}, adapter));
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
init() {// this.setInitValue();
|
package/lib/es/anchor/rtl.scss
CHANGED
|
@@ -2,13 +2,6 @@ import _isObject from "lodash/isObject";
|
|
|
2
2
|
import _isUndefined from "lodash/isUndefined";
|
|
3
3
|
import _isNumber from "lodash/isNumber";
|
|
4
4
|
import _isString from "lodash/isString";
|
|
5
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
6
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
7
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
8
|
-
import _Map from "@babel/runtime-corejs3/core-js-stable/map";
|
|
9
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
10
|
-
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
11
|
-
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
|
12
5
|
|
|
13
6
|
/* eslint-disable prefer-const, max-len */
|
|
14
7
|
import BaseFoundation from '../base/foundation';
|
|
@@ -17,7 +10,7 @@ import KeyCode from '../utils/keyCode';
|
|
|
17
10
|
|
|
18
11
|
class AutoCompleteFoundation extends BaseFoundation {
|
|
19
12
|
constructor(adapter) {
|
|
20
|
-
super(
|
|
13
|
+
super(Object.assign({}, adapter));
|
|
21
14
|
this.isPanelOpen = false;
|
|
22
15
|
}
|
|
23
16
|
|
|
@@ -69,11 +62,9 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
69
62
|
let width;
|
|
70
63
|
|
|
71
64
|
if (dropdownMatchSelectWidth) {
|
|
72
|
-
var _context;
|
|
73
|
-
|
|
74
65
|
if (style && _isNumber(style.width)) {
|
|
75
66
|
width = style.width;
|
|
76
|
-
} else if (style && _isString(style.width) && !
|
|
67
|
+
} else if (style && _isString(style.width) && !style.width.includes('%')) {
|
|
77
68
|
width = style.width;
|
|
78
69
|
} else {
|
|
79
70
|
width = this._adapter.getTriggerWidth();
|
|
@@ -132,7 +123,7 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
132
123
|
const options = [];
|
|
133
124
|
|
|
134
125
|
if (data && data.length) {
|
|
135
|
-
|
|
126
|
+
data.forEach((item, i) => {
|
|
136
127
|
const key = String(new Date().getTime()) + i;
|
|
137
128
|
let option = {};
|
|
138
129
|
|
|
@@ -144,7 +135,7 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
144
135
|
show: true
|
|
145
136
|
};
|
|
146
137
|
} else if (_isObject(item) && !_isUndefined(item.value)) {
|
|
147
|
-
option =
|
|
138
|
+
option = Object.assign({
|
|
148
139
|
show: true
|
|
149
140
|
}, item);
|
|
150
141
|
}
|
|
@@ -210,7 +201,7 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
210
201
|
}
|
|
211
202
|
|
|
212
203
|
updateSelection(option) {
|
|
213
|
-
const selection = new
|
|
204
|
+
const selection = new Map();
|
|
214
205
|
|
|
215
206
|
if (option) {
|
|
216
207
|
selection.set(option.label, option);
|
|
@@ -261,12 +252,9 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
261
252
|
const options = this._generateList(data); // Get the option whose value match from options
|
|
262
253
|
|
|
263
254
|
|
|
264
|
-
let selectedOption =
|
|
265
|
-
|
|
255
|
+
let selectedOption = options.filter(option => renderSelectedItem(option) === selectedValue);
|
|
266
256
|
const canMatchInData = selectedOption.length;
|
|
267
|
-
|
|
268
|
-
const selectedOptionIndex = _findIndexInstanceProperty(options).call(options, option => renderSelectedItem(option) === selectedValue);
|
|
269
|
-
|
|
257
|
+
const selectedOptionIndex = options.findIndex(option => renderSelectedItem(option) === selectedValue);
|
|
270
258
|
let inputValue = '';
|
|
271
259
|
|
|
272
260
|
if (canMatchInData) {
|
|
@@ -304,7 +292,7 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
304
292
|
|
|
305
293
|
const options = this._generateList(data);
|
|
306
294
|
|
|
307
|
-
const selectedOptionIndex =
|
|
295
|
+
const selectedOptionIndex = options.findIndex(option => renderSelectedItem(option) === searchValue);
|
|
308
296
|
|
|
309
297
|
if (selectedOptionIndex === -1 && defaultActiveFirstOption) {
|
|
310
298
|
if (focusIndex !== 0) {
|
|
@@ -400,9 +388,7 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
400
388
|
focusIndex,
|
|
401
389
|
options
|
|
402
390
|
} = this.getStates();
|
|
403
|
-
|
|
404
|
-
const visibleOptions = _filterInstanceProperty(options).call(options, item => item.show);
|
|
405
|
-
|
|
391
|
+
const visibleOptions = options.filter(item => item.show);
|
|
406
392
|
const optionsLength = visibleOptions.length;
|
|
407
393
|
let index = focusIndex + offset;
|
|
408
394
|
|
|
@@ -475,8 +461,7 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
475
461
|
this.openDropdown();
|
|
476
462
|
} else {
|
|
477
463
|
if (focusIndex !== undefined && focusIndex !== -1 && options.length !== 0) {
|
|
478
|
-
const visibleOptions =
|
|
479
|
-
|
|
464
|
+
const visibleOptions = options.filter(item => item.show);
|
|
480
465
|
const selectedOption = visibleOptions[focusIndex];
|
|
481
466
|
this.handleSelect(selectedOption, focusIndex);
|
|
482
467
|
} else {
|
|
@@ -500,7 +485,7 @@ class AutoCompleteFoundation extends BaseFoundation {
|
|
|
500
485
|
handleBlur(e) {
|
|
501
486
|
// 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
|
|
502
487
|
// internal-issues:1231
|
|
503
|
-
|
|
488
|
+
setTimeout(() => {
|
|
504
489
|
this._adapter.notifyBlur(e);
|
|
505
490
|
|
|
506
491
|
this.closeDropdown();
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
2
1
|
import BaseFoundation from '../base/foundation';
|
|
3
2
|
export default class OptionFoundation extends BaseFoundation {
|
|
4
3
|
constructor(adapter) {
|
|
5
|
-
super(
|
|
4
|
+
super(Object.assign({}, adapter));
|
|
6
5
|
} // eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7
6
|
|
|
8
7
|
|