@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,39 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
6
|
-
|
|
7
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
8
|
-
|
|
9
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
4
|
value: true
|
|
11
5
|
});
|
|
12
|
-
|
|
13
6
|
exports.default = void 0;
|
|
14
7
|
|
|
15
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
16
|
-
|
|
17
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
18
|
-
|
|
19
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
20
|
-
|
|
21
|
-
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
22
|
-
|
|
23
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
24
|
-
|
|
25
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
26
|
-
|
|
27
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
28
|
-
|
|
29
|
-
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
|
30
|
-
|
|
31
|
-
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
32
|
-
|
|
33
|
-
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
34
|
-
|
|
35
|
-
var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/every"));
|
|
36
|
-
|
|
37
8
|
var _difference2 = _interopRequireDefault(require("lodash/difference"));
|
|
38
9
|
|
|
39
10
|
var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
|
|
@@ -58,10 +29,12 @@ var _treeUtil = require("../tree/treeUtil");
|
|
|
58
29
|
|
|
59
30
|
var _isEnterPress = _interopRequireDefault(require("../utils/isEnterPress"));
|
|
60
31
|
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
+
|
|
61
34
|
// eslint-disable-next-line max-len
|
|
62
35
|
class TreeSelectFoundation extends _foundation.default {
|
|
63
36
|
constructor(adapter) {
|
|
64
|
-
super(
|
|
37
|
+
super(Object.assign({}, adapter));
|
|
65
38
|
}
|
|
66
39
|
|
|
67
40
|
init() {
|
|
@@ -95,11 +68,9 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
95
68
|
let width;
|
|
96
69
|
|
|
97
70
|
if (dropdownMatchSelectWidth) {
|
|
98
|
-
var _context;
|
|
99
|
-
|
|
100
71
|
if (style && (0, _isNumber2.default)(style.width)) {
|
|
101
72
|
width = style.width;
|
|
102
|
-
} else if (style && (0, _isString2.default)(style.width) && !
|
|
73
|
+
} else if (style && (0, _isString2.default)(style.width) && !style.width.includes('%')) {
|
|
103
74
|
width = style.width;
|
|
104
75
|
} else {
|
|
105
76
|
width = this._adapter.getTriggerWidth();
|
|
@@ -145,10 +116,8 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
145
116
|
}
|
|
146
117
|
|
|
147
118
|
getCopyFromState(items) {
|
|
148
|
-
var _context2;
|
|
149
|
-
|
|
150
119
|
const res = {};
|
|
151
|
-
(0,
|
|
120
|
+
(0, _treeUtil.normalizedArr)(items).forEach(key => {
|
|
152
121
|
res[key] = (0, _cloneDeep2.default)(this.getState(key));
|
|
153
122
|
});
|
|
154
123
|
return res;
|
|
@@ -156,18 +125,18 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
156
125
|
|
|
157
126
|
getTreeNodeProps(key) {
|
|
158
127
|
const {
|
|
159
|
-
expandedKeys = new
|
|
128
|
+
expandedKeys = new Set([]),
|
|
160
129
|
selectedKeys = [],
|
|
161
|
-
checkedKeys = new
|
|
162
|
-
halfCheckedKeys = new
|
|
163
|
-
realCheckedKeys = new
|
|
130
|
+
checkedKeys = new Set([]),
|
|
131
|
+
halfCheckedKeys = new Set([]),
|
|
132
|
+
realCheckedKeys = new Set([]),
|
|
164
133
|
keyEntities = {},
|
|
165
|
-
filteredKeys = new
|
|
134
|
+
filteredKeys = new Set([]),
|
|
166
135
|
inputValue = '',
|
|
167
136
|
loadedKeys,
|
|
168
137
|
loadingKeys,
|
|
169
|
-
filteredExpandedKeys = new
|
|
170
|
-
disabledKeys = new
|
|
138
|
+
filteredExpandedKeys = new Set([]),
|
|
139
|
+
disabledKeys = new Set([])
|
|
171
140
|
} = this.getStates();
|
|
172
141
|
const {
|
|
173
142
|
treeNodeFilterProp,
|
|
@@ -196,7 +165,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
196
165
|
const treeNodeProps = {
|
|
197
166
|
eventKey: key,
|
|
198
167
|
expanded: isSearching && !this._isExpandControlled() ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
199
|
-
selected:
|
|
168
|
+
selected: selectedKeys.includes(key),
|
|
200
169
|
checked: realChecked,
|
|
201
170
|
halfChecked: realHalfChecked,
|
|
202
171
|
pos: String(entity ? entity.pos : ''),
|
|
@@ -233,7 +202,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
233
202
|
loadingKeys: prevLoadingKeys
|
|
234
203
|
} = this.getCopyFromState(['loadedKeys', 'loadingKeys']);
|
|
235
204
|
const newLoadedKeys = prevLoadedKeys.add(key);
|
|
236
|
-
const newLoadingKeys = new
|
|
205
|
+
const newLoadingKeys = new Set([...prevLoadingKeys]);
|
|
237
206
|
newLoadingKeys.delete(key);
|
|
238
207
|
|
|
239
208
|
this._adapter.notifyLoad(newLoadedKeys, data);
|
|
@@ -277,7 +246,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
277
246
|
keyList = key;
|
|
278
247
|
}
|
|
279
248
|
|
|
280
|
-
const nodes =
|
|
249
|
+
const nodes = keyList.map(i => keyEntities[i].data);
|
|
281
250
|
|
|
282
251
|
if (this.getProp('onChangeWithObject')) {
|
|
283
252
|
this._adapter.notifyChangeWithObject(nodes, e);
|
|
@@ -293,7 +262,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
293
262
|
keyEntities
|
|
294
263
|
} = this.getStates();
|
|
295
264
|
|
|
296
|
-
if (this._isMultiple() &&
|
|
265
|
+
if (this._isMultiple() && Array.isArray(key)) {
|
|
297
266
|
this._notifyMultipleChange(key, e);
|
|
298
267
|
} else {
|
|
299
268
|
const nodes = (0, _isUndefined2.default)(key) ? key : keyEntities[key].data;
|
|
@@ -344,7 +313,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
344
313
|
|
|
345
314
|
if (this.getProp('motionExpand')) {
|
|
346
315
|
this._adapter.updateState({
|
|
347
|
-
motionKeys: new
|
|
316
|
+
motionKeys: new Set([])
|
|
348
317
|
});
|
|
349
318
|
}
|
|
350
319
|
}
|
|
@@ -411,9 +380,9 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
411
380
|
|
|
412
381
|
this._adapter.updateState({
|
|
413
382
|
selectedKeys: [],
|
|
414
|
-
checkedKeys: new
|
|
415
|
-
halfCheckedKeys: new
|
|
416
|
-
realCheckedKeys: new
|
|
383
|
+
checkedKeys: new Set(),
|
|
384
|
+
halfCheckedKeys: new Set(),
|
|
385
|
+
realCheckedKeys: new Set([])
|
|
417
386
|
});
|
|
418
387
|
} // When triggerSearch, clicking the clear button will trigger to clear Input
|
|
419
388
|
|
|
@@ -458,7 +427,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
458
427
|
}
|
|
459
428
|
|
|
460
429
|
if (checkRelation === 'unRelated') {
|
|
461
|
-
const newRealCheckedKeys = new
|
|
430
|
+
const newRealCheckedKeys = new Set(realCheckedKeys);
|
|
462
431
|
newRealCheckedKeys.delete(eventKey);
|
|
463
432
|
|
|
464
433
|
this._notifyChange([...newRealCheckedKeys], null);
|
|
@@ -502,22 +471,22 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
502
471
|
keyEntities,
|
|
503
472
|
treeData
|
|
504
473
|
} = this.getStates();
|
|
505
|
-
const newExpandedKeys = new
|
|
474
|
+
const newExpandedKeys = new Set(expandedKeys);
|
|
506
475
|
|
|
507
476
|
const isExpandControlled = this._isExpandControlled();
|
|
508
477
|
|
|
509
478
|
const expandedOptsKeys = (0, _treeUtil.findAncestorKeys)(selectedKeys, keyEntities);
|
|
510
|
-
|
|
479
|
+
expandedOptsKeys.forEach(item => newExpandedKeys.add(item));
|
|
511
480
|
const newFlattenNodes = (0, _treeUtil.flattenTreeData)(treeData, newExpandedKeys);
|
|
512
481
|
|
|
513
482
|
this._adapter.updateState({
|
|
514
483
|
expandedKeys: isExpandControlled ? expandedKeys : newExpandedKeys,
|
|
515
484
|
flattenNodes: isExpandControlled ? flattenNodes : newFlattenNodes,
|
|
516
485
|
inputValue: '',
|
|
517
|
-
motionKeys: new
|
|
518
|
-
filteredKeys: new
|
|
519
|
-
filteredExpandedKeys: new
|
|
520
|
-
filteredShownKeys: new
|
|
486
|
+
motionKeys: new Set([]),
|
|
487
|
+
filteredKeys: new Set([]),
|
|
488
|
+
filteredExpandedKeys: new Set(expandedOptsKeys),
|
|
489
|
+
filteredShownKeys: new Set([])
|
|
521
490
|
});
|
|
522
491
|
}
|
|
523
492
|
|
|
@@ -537,40 +506,38 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
537
506
|
filterTreeNode,
|
|
538
507
|
treeNodeFilterProp
|
|
539
508
|
} = this.getProps();
|
|
540
|
-
const newExpandedKeys = new
|
|
509
|
+
const newExpandedKeys = new Set(expandedKeys);
|
|
541
510
|
let filteredOptsKeys = [];
|
|
542
511
|
let expandedOptsKeys = [];
|
|
543
512
|
let newFlattenNodes = [];
|
|
544
|
-
let filteredShownKeys = new
|
|
513
|
+
let filteredShownKeys = new Set([]);
|
|
545
514
|
|
|
546
515
|
if (!sugInput) {
|
|
547
516
|
expandedOptsKeys = (0, _treeUtil.findAncestorKeys)(selectedKeys, keyEntities);
|
|
548
|
-
|
|
517
|
+
expandedOptsKeys.forEach(item => newExpandedKeys.add(item));
|
|
549
518
|
newFlattenNodes = (0, _treeUtil.flattenTreeData)(treeData, newExpandedKeys);
|
|
550
519
|
} else {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
filteredOptsKeys = (0, _map.default)(_context3 = (0, _filter.default)(_context4 = (0, _values.default)(keyEntities)).call(_context4, item => {
|
|
520
|
+
filteredOptsKeys = Object.values(keyEntities).filter(item => {
|
|
554
521
|
const {
|
|
555
522
|
data
|
|
556
523
|
} = item;
|
|
557
|
-
return (0,
|
|
558
|
-
})
|
|
524
|
+
return (0, _treeUtil.filter)(sugInput, data, filterTreeNode, treeNodeFilterProp);
|
|
525
|
+
}).map(item => item.key);
|
|
559
526
|
expandedOptsKeys = (0, _treeUtil.findAncestorKeys)(filteredOptsKeys, keyEntities, false);
|
|
560
527
|
const shownChildKeys = (0, _treeUtil.findDescendantKeys)(filteredOptsKeys, keyEntities, true);
|
|
561
|
-
filteredShownKeys = new
|
|
562
|
-
newFlattenNodes = (0, _treeUtil.flattenTreeData)(treeData, new
|
|
528
|
+
filteredShownKeys = new Set([...shownChildKeys, ...expandedOptsKeys]);
|
|
529
|
+
newFlattenNodes = (0, _treeUtil.flattenTreeData)(treeData, new Set(expandedOptsKeys), showFilteredOnly && filteredShownKeys);
|
|
563
530
|
}
|
|
564
531
|
|
|
565
|
-
const newFilteredExpandedKeys = new
|
|
532
|
+
const newFilteredExpandedKeys = new Set(expandedOptsKeys);
|
|
566
533
|
|
|
567
|
-
this._adapter.notifySearch(sugInput,
|
|
534
|
+
this._adapter.notifySearch(sugInput, Array.from(newFilteredExpandedKeys));
|
|
568
535
|
|
|
569
536
|
this._adapter.updateState({
|
|
570
537
|
expandedKeys: this._isExpandControlled() ? expandedKeys : newExpandedKeys,
|
|
571
538
|
flattenNodes: this._isExpandControlled() ? flattenNodes : newFlattenNodes,
|
|
572
|
-
motionKeys: new
|
|
573
|
-
filteredKeys: new
|
|
539
|
+
motionKeys: new Set([]),
|
|
540
|
+
filteredKeys: new Set(filteredOptsKeys),
|
|
574
541
|
filteredExpandedKeys: newFilteredExpandedKeys,
|
|
575
542
|
filteredShownKeys
|
|
576
543
|
});
|
|
@@ -605,7 +572,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
605
572
|
|
|
606
573
|
this._adapter.notifySelect(eventKey, true, data);
|
|
607
574
|
|
|
608
|
-
if (!
|
|
575
|
+
if (!selectedKeys.includes(eventKey) && !selected) {
|
|
609
576
|
selectedKeys = [eventKey];
|
|
610
577
|
|
|
611
578
|
this._notifyChange(eventKey, e);
|
|
@@ -674,7 +641,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
674
641
|
this._adapter.rePositionDropdown();
|
|
675
642
|
}
|
|
676
643
|
} else if (checkRelation === 'unRelated') {
|
|
677
|
-
const newRealCheckedKeys = new
|
|
644
|
+
const newRealCheckedKeys = new Set(realCheckedKeys);
|
|
678
645
|
let targetStatus;
|
|
679
646
|
|
|
680
647
|
if (realCheckedKeys.has(eventKey)) {
|
|
@@ -714,13 +681,13 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
714
681
|
checkedKeys
|
|
715
682
|
} = this.getCopyFromState(['checkedKeys']);
|
|
716
683
|
const descendantKeys = (0, _treeUtil.normalizeKeyList)((0, _treeUtil.findDescendantKeys)([eventKey], keyEntities, false), keyEntities, true);
|
|
717
|
-
const hasDisabled =
|
|
684
|
+
const hasDisabled = descendantKeys.some(key => disabledKeys.has(key));
|
|
718
685
|
|
|
719
686
|
if (!hasDisabled) {
|
|
720
687
|
return this.calcCheckedKeys(eventKey, targetStatus);
|
|
721
688
|
}
|
|
722
689
|
|
|
723
|
-
const nonDisabled =
|
|
690
|
+
const nonDisabled = descendantKeys.filter(key => !disabledKeys.has(key));
|
|
724
691
|
const newCheckedKeys = targetStatus ? [...nonDisabled, ...checkedKeys] : (0, _difference2.default)((0, _treeUtil.normalizeKeyList)([...checkedKeys], keyEntities, true), nonDisabled);
|
|
725
692
|
return (0, _treeUtil.calcCheckedKeys)(newCheckedKeys, keyEntities);
|
|
726
693
|
}
|
|
@@ -736,14 +703,14 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
736
703
|
disabledKeys
|
|
737
704
|
} = this.getStates();
|
|
738
705
|
const descendantKeys = (0, _treeUtil.normalizeKeyList)((0, _treeUtil.findDescendantKeys)([eventKey], keyEntities, false), keyEntities, true);
|
|
739
|
-
const hasDisabled =
|
|
706
|
+
const hasDisabled = descendantKeys.some(key => disabledKeys.has(key));
|
|
740
707
|
|
|
741
708
|
if (!hasDisabled) {
|
|
742
709
|
return targetStatus;
|
|
743
710
|
}
|
|
744
711
|
|
|
745
|
-
const nonDisabledKeys =
|
|
746
|
-
const allChecked =
|
|
712
|
+
const nonDisabledKeys = descendantKeys.filter(key => !disabledKeys.has(key));
|
|
713
|
+
const allChecked = nonDisabledKeys.every(key => checkedKeys.has(key));
|
|
747
714
|
return !allChecked;
|
|
748
715
|
}
|
|
749
716
|
|
|
@@ -784,7 +751,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
784
751
|
const newState = {
|
|
785
752
|
filteredExpandedKeys,
|
|
786
753
|
flattenNodes,
|
|
787
|
-
motionKeys: new
|
|
754
|
+
motionKeys: new Set(motionKeys),
|
|
788
755
|
motionType
|
|
789
756
|
};
|
|
790
757
|
|
|
@@ -849,7 +816,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
849
816
|
const newState = {
|
|
850
817
|
expandedKeys,
|
|
851
818
|
flattenNodes,
|
|
852
|
-
motionKeys: new
|
|
819
|
+
motionKeys: new Set(motionKeys),
|
|
853
820
|
motionType
|
|
854
821
|
};
|
|
855
822
|
|
|
@@ -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");
|