@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,54 +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
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
16
|
-
|
|
17
|
-
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
18
|
-
|
|
19
|
-
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/keys"));
|
|
20
|
-
|
|
21
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
22
|
-
|
|
23
|
-
var _filter2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
24
|
-
|
|
25
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map"));
|
|
26
|
-
|
|
27
|
-
var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
|
|
28
|
-
|
|
29
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
30
|
-
|
|
31
|
-
var _map2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
32
|
-
|
|
33
|
-
var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort"));
|
|
34
|
-
|
|
35
|
-
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
|
|
36
|
-
|
|
37
|
-
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
38
|
-
|
|
39
|
-
var _find2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
40
|
-
|
|
41
|
-
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
42
|
-
|
|
43
|
-
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice"));
|
|
44
|
-
|
|
45
8
|
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
46
9
|
|
|
47
10
|
var _slice2 = _interopRequireDefault(require("lodash/slice"));
|
|
48
11
|
|
|
49
12
|
var _isMap2 = _interopRequireDefault(require("lodash/isMap"));
|
|
50
13
|
|
|
51
|
-
var
|
|
14
|
+
var _filter2 = _interopRequireDefault(require("lodash/filter"));
|
|
52
15
|
|
|
53
16
|
var _isSet2 = _interopRequireDefault(require("lodash/isSet"));
|
|
54
17
|
|
|
@@ -56,7 +19,7 @@ var _pull2 = _interopRequireDefault(require("lodash/pull"));
|
|
|
56
19
|
|
|
57
20
|
var _some2 = _interopRequireDefault(require("lodash/some"));
|
|
58
21
|
|
|
59
|
-
var
|
|
22
|
+
var _find2 = _interopRequireDefault(require("lodash/find"));
|
|
60
23
|
|
|
61
24
|
var _each2 = _interopRequireDefault(require("lodash/each"));
|
|
62
25
|
|
|
@@ -76,9 +39,11 @@ var _utils = require("./utils");
|
|
|
76
39
|
|
|
77
40
|
var _array = require("../utils/array");
|
|
78
41
|
|
|
42
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
|
+
|
|
79
44
|
class TableFoundation extends _foundation.default {
|
|
80
45
|
constructor(adapter) {
|
|
81
|
-
super(
|
|
46
|
+
super(Object.assign({}, adapter));
|
|
82
47
|
/**
|
|
83
48
|
* set page number
|
|
84
49
|
*/
|
|
@@ -91,7 +56,7 @@ class TableFoundation extends _foundation.default {
|
|
|
91
56
|
pagination,
|
|
92
57
|
disabledRowKeys,
|
|
93
58
|
allRowKeys
|
|
94
|
-
} = this.getCurrentPageData(null,
|
|
59
|
+
} = this.getCurrentPageData(null, Object.assign(Object.assign({}, currentPagination), {
|
|
95
60
|
currentPage,
|
|
96
61
|
pageSize: currentPageSize
|
|
97
62
|
}));
|
|
@@ -122,11 +87,7 @@ class TableFoundation extends _foundation.default {
|
|
|
122
87
|
this._adapter.setCachedFilteredSortedRowKeys(filteredSortedRowKeys);
|
|
123
88
|
};
|
|
124
89
|
|
|
125
|
-
this.isSortOrderValid = sortOrder =>
|
|
126
|
-
var _context;
|
|
127
|
-
|
|
128
|
-
return (0, _includes.default)(_context = _constants.strings.SORT_DIRECTIONS).call(_context, sortOrder) || sortOrder === false;
|
|
129
|
-
};
|
|
90
|
+
this.isSortOrderValid = sortOrder => _constants.strings.SORT_DIRECTIONS.includes(sortOrder) || sortOrder === false;
|
|
130
91
|
/**
|
|
131
92
|
* memoized function list
|
|
132
93
|
*/
|
|
@@ -174,12 +135,12 @@ class TableFoundation extends _foundation.default {
|
|
|
174
135
|
const expandedRowKeys = [];
|
|
175
136
|
|
|
176
137
|
if (defaultExpandAllRows || expandAllRows) {
|
|
177
|
-
this._addNoDuplicatedItemsToArr(expandedRowKeys, this.getAllRowKeys(dataSource), groups && (0, _isMap2.default)(groups) && groups.size ?
|
|
138
|
+
this._addNoDuplicatedItemsToArr(expandedRowKeys, this.getAllRowKeys(dataSource), groups && (0, _isMap2.default)(groups) && groups.size ? Array.from(groups.keys()) : []);
|
|
178
139
|
} else if (defaultExpandAllGroupRows || expandAllGroupRows) {
|
|
179
|
-
this._addNoDuplicatedItemsToArr(expandedRowKeys, groups && (0, _isMap2.default)(groups) && groups.size ?
|
|
180
|
-
} else if (
|
|
140
|
+
this._addNoDuplicatedItemsToArr(expandedRowKeys, groups && (0, _isMap2.default)(groups) && groups.size ? Array.from(groups.keys()) : []);
|
|
141
|
+
} else if (Array.isArray(defaultExpandedRowKeys) && defaultExpandedRowKeys.length) {
|
|
181
142
|
this._addNoDuplicatedItemsToArr(expandedRowKeys, defaultExpandedRowKeys);
|
|
182
|
-
} else if (
|
|
143
|
+
} else if (Array.isArray(propExpandedRowKeys) && propExpandedRowKeys.length) {
|
|
183
144
|
this._addNoDuplicatedItemsToArr(expandedRowKeys, propExpandedRowKeys);
|
|
184
145
|
}
|
|
185
146
|
|
|
@@ -197,13 +158,13 @@ class TableFoundation extends _foundation.default {
|
|
|
197
158
|
const selectedRowKeys = (0, _get2.default)(rowSelection, 'selectedRowKeys');
|
|
198
159
|
const defaultSelectedRowKeys = (0, _get2.default)(rowSelection, 'defaultSelectedRowKeys');
|
|
199
160
|
|
|
200
|
-
if (
|
|
161
|
+
if (Array.isArray(selectedRowKeys)) {
|
|
201
162
|
this._addNoDuplicatedItemsToArr(rowKeys, selectedRowKeys);
|
|
202
|
-
} else if (
|
|
163
|
+
} else if (Array.isArray(defaultSelectedRowKeys)) {
|
|
203
164
|
this._addNoDuplicatedItemsToArr(rowKeys, defaultSelectedRowKeys);
|
|
204
165
|
}
|
|
205
166
|
|
|
206
|
-
if (
|
|
167
|
+
if (Array.isArray(disabledRowKeys) && disabledRowKeys.length) {
|
|
207
168
|
(0, _pull2.default)(rowKeys, ...disabledRowKeys);
|
|
208
169
|
}
|
|
209
170
|
|
|
@@ -219,7 +180,7 @@ class TableFoundation extends _foundation.default {
|
|
|
219
180
|
|
|
220
181
|
|
|
221
182
|
getFilteredSortedDataSource(dataSource, queries) {
|
|
222
|
-
const filteredDataSource = this.filterDataSource(dataSource,
|
|
183
|
+
const filteredDataSource = this.filterDataSource(dataSource, queries.filter(query => {
|
|
223
184
|
/**
|
|
224
185
|
* 这里无需判断 filteredValue 是否为数组,初始化时它是 `undefined`,点击选择空时为 `[]`
|
|
225
186
|
* 初始化时我们应该用 `defaultFilteredValue`,点击后我们应该用 `filteredValue`
|
|
@@ -228,9 +189,9 @@ class TableFoundation extends _foundation.default {
|
|
|
228
189
|
* When initializing we should use `defaultFilteredValue`, after clicking we should use `filteredValue`
|
|
229
190
|
*/
|
|
230
191
|
const currentFilteredValue = query.filteredValue ? query.filteredValue : query.defaultFilteredValue;
|
|
231
|
-
return (0, _isFunction2.default)(query.onFilter) &&
|
|
192
|
+
return (0, _isFunction2.default)(query.onFilter) && Array.isArray(query.filters) && query.filters.length && Array.isArray(currentFilteredValue) && currentFilteredValue.length;
|
|
232
193
|
}));
|
|
233
|
-
const sortedDataSource = this.sortDataSource(filteredDataSource,
|
|
194
|
+
const sortedDataSource = this.sortDataSource(filteredDataSource, queries.filter(query => query && (0, _isFunction2.default)(query.sorter)));
|
|
234
195
|
return sortedDataSource;
|
|
235
196
|
}
|
|
236
197
|
/**
|
|
@@ -247,7 +208,7 @@ class TableFoundation extends _foundation.default {
|
|
|
247
208
|
const filteredSortedDataSource = this._adapter.getCachedFilteredSortedDataSource();
|
|
248
209
|
|
|
249
210
|
dataSource = dataSource == null ? [...filteredSortedDataSource] : dataSource;
|
|
250
|
-
pagination = pagination == null ? this.getState('pagination') &&
|
|
211
|
+
pagination = pagination == null ? this.getState('pagination') && Object.assign({}, this.getState('pagination')) : pagination;
|
|
251
212
|
queries = queries == null ? [...this.getState('queries')] : queries;
|
|
252
213
|
let groups;
|
|
253
214
|
|
|
@@ -284,7 +245,7 @@ class TableFoundation extends _foundation.default {
|
|
|
284
245
|
|
|
285
246
|
groupDataSource(dataSource, groupBy) {
|
|
286
247
|
groupBy = groupBy == null ? this.getProp('groupBy') : groupBy;
|
|
287
|
-
const groups = new
|
|
248
|
+
const groups = new Map();
|
|
288
249
|
const newDataSource = [];
|
|
289
250
|
|
|
290
251
|
if (groupBy != null) {
|
|
@@ -296,7 +257,7 @@ class TableFoundation extends _foundation.default {
|
|
|
296
257
|
let group = groups.get(groupKey);
|
|
297
258
|
|
|
298
259
|
if (!(0, _isSet2.default)(group)) {
|
|
299
|
-
group = new
|
|
260
|
+
group = new Set([recordKey]);
|
|
300
261
|
groups.set(groupKey, group);
|
|
301
262
|
} else {
|
|
302
263
|
group.add(recordKey);
|
|
@@ -306,9 +267,9 @@ class TableFoundation extends _foundation.default {
|
|
|
306
267
|
}
|
|
307
268
|
|
|
308
269
|
if (groups && groups.size) {
|
|
309
|
-
|
|
270
|
+
groups.forEach((set, key) => {
|
|
310
271
|
if ((0, _isSet2.default)(set)) {
|
|
311
|
-
|
|
272
|
+
set.forEach(realKey => {
|
|
312
273
|
newDataSource.push(this._getRecord(realKey));
|
|
313
274
|
});
|
|
314
275
|
}
|
|
@@ -333,8 +294,6 @@ class TableFoundation extends _foundation.default {
|
|
|
333
294
|
|
|
334
295
|
sortDataSource(dataSource, sorters) {
|
|
335
296
|
(0, _each2.default)(sorters, sorterObj => {
|
|
336
|
-
var _context2;
|
|
337
|
-
|
|
338
297
|
// const sorterObj = last(sorters) || {};
|
|
339
298
|
const {
|
|
340
299
|
sorter,
|
|
@@ -344,14 +303,14 @@ class TableFoundation extends _foundation.default {
|
|
|
344
303
|
} = sorterObj;
|
|
345
304
|
const currentSortOrder = this.isSortOrderValid(sortOrder) ? sortOrder : defaultSortOrder;
|
|
346
305
|
|
|
347
|
-
if ((0, _isFunction2.default)(sorter) && currentSortOrder &&
|
|
306
|
+
if ((0, _isFunction2.default)(sorter) && currentSortOrder && _constants.strings.SORT_DIRECTIONS.includes(currentSortOrder)) {
|
|
348
307
|
if (sortChildrenRecord) {
|
|
349
308
|
const childrenRecordName = this.getProp('childrenRecordName');
|
|
350
|
-
dataSource = dataSource &&
|
|
309
|
+
dataSource = dataSource && dataSource.map(record => {
|
|
351
310
|
const children = this._getRecordChildren(record);
|
|
352
311
|
|
|
353
|
-
if (
|
|
354
|
-
return
|
|
312
|
+
if (Array.isArray(children) && children.length) {
|
|
313
|
+
return Object.assign(Object.assign({}, record), {
|
|
355
314
|
[childrenRecordName]: this.sortDataSource(children, [sorterObj])
|
|
356
315
|
});
|
|
357
316
|
}
|
|
@@ -360,7 +319,7 @@ class TableFoundation extends _foundation.default {
|
|
|
360
319
|
});
|
|
361
320
|
}
|
|
362
321
|
|
|
363
|
-
|
|
322
|
+
dataSource.sort((0, _array.withOrderSort)(sorter, currentSortOrder));
|
|
364
323
|
return false;
|
|
365
324
|
}
|
|
366
325
|
|
|
@@ -388,16 +347,16 @@ class TableFoundation extends _foundation.default {
|
|
|
388
347
|
filterChildrenRecord,
|
|
389
348
|
defaultFilteredValue
|
|
390
349
|
} = filterObj;
|
|
391
|
-
const currentFilteredValue =
|
|
350
|
+
const currentFilteredValue = Array.isArray(filteredValue) ? filteredValue : defaultFilteredValue;
|
|
392
351
|
|
|
393
|
-
if (typeof onFilter === 'function' &&
|
|
352
|
+
if (typeof onFilter === 'function' && Array.isArray(currentFilteredValue) && currentFilteredValue.length) {
|
|
394
353
|
hasValidFilters = true;
|
|
395
354
|
|
|
396
355
|
if (filteredData === null) {
|
|
397
|
-
filteredData = new
|
|
356
|
+
filteredData = new Map();
|
|
398
357
|
} else {
|
|
399
|
-
dataSource =
|
|
400
|
-
filteredData = new
|
|
358
|
+
dataSource = Array.from(filteredData && filteredData.values());
|
|
359
|
+
filteredData = new Map();
|
|
401
360
|
}
|
|
402
361
|
|
|
403
362
|
(0, _each2.default)(dataSource, record => {
|
|
@@ -406,16 +365,16 @@ class TableFoundation extends _foundation.default {
|
|
|
406
365
|
const recordKey = this.getRecordKey(record);
|
|
407
366
|
let filteredChildren;
|
|
408
367
|
|
|
409
|
-
if (
|
|
368
|
+
if (Array.isArray(childrenRecords) && childrenRecords.length && filterChildrenRecord) {
|
|
410
369
|
filteredChildren = this.filterDataSource(childrenRecords, [filterObj]);
|
|
411
370
|
}
|
|
412
371
|
|
|
413
|
-
if (
|
|
372
|
+
if (Array.isArray(filteredChildren) && filteredChildren.length) {
|
|
414
373
|
if (recordKey != null) {
|
|
415
374
|
const children = (0, _get2.default)(filteredData.get(recordKey), childrenRecordName, []);
|
|
416
|
-
filteredData.set(recordKey,
|
|
417
|
-
[childrenRecordName]:
|
|
418
|
-
if (
|
|
375
|
+
filteredData.set(recordKey, Object.assign(Object.assign({}, record), {
|
|
376
|
+
[childrenRecordName]: filteredChildren.reduce((arr, cur) => {
|
|
377
|
+
if (arr.find(item => this.getRecordKey(item) === this.getRecordKey(cur)) == null) {
|
|
419
378
|
arr.push(cur);
|
|
420
379
|
}
|
|
421
380
|
|
|
@@ -432,7 +391,7 @@ class TableFoundation extends _foundation.default {
|
|
|
432
391
|
});
|
|
433
392
|
|
|
434
393
|
if (hasValidFilters) {
|
|
435
|
-
dataSource =
|
|
394
|
+
dataSource = Array.from(filteredData && filteredData.values());
|
|
436
395
|
}
|
|
437
396
|
|
|
438
397
|
return dataSource;
|
|
@@ -462,7 +421,7 @@ class TableFoundation extends _foundation.default {
|
|
|
462
421
|
const propPagination = this.getProp('pagination');
|
|
463
422
|
|
|
464
423
|
if (pagination) {
|
|
465
|
-
pagination = typeof pagination === 'object' ?
|
|
424
|
+
pagination = typeof pagination === 'object' ? Object.assign({}, pagination) : {};
|
|
466
425
|
pagination = (0, _merge2.default)({
|
|
467
426
|
total: dataSource && dataSource.length || 0,
|
|
468
427
|
pageSize: _constants.numbers.DEFAULT_PAGE_SIZE,
|
|
@@ -545,9 +504,9 @@ class TableFoundation extends _foundation.default {
|
|
|
545
504
|
}
|
|
546
505
|
|
|
547
506
|
for (const objArr of objArrs) {
|
|
548
|
-
if (
|
|
507
|
+
if (Array.isArray(objArr)) {
|
|
549
508
|
for (const item of objArr) {
|
|
550
|
-
if (!
|
|
509
|
+
if (!srcArr.includes(item)) {
|
|
551
510
|
srcArr.push(item);
|
|
552
511
|
}
|
|
553
512
|
}
|
|
@@ -567,15 +526,15 @@ class TableFoundation extends _foundation.default {
|
|
|
567
526
|
}
|
|
568
527
|
|
|
569
528
|
this._adapter.notifyChange({
|
|
570
|
-
pagination:
|
|
529
|
+
pagination: Object.assign({}, pagination),
|
|
571
530
|
filters: [...filters],
|
|
572
531
|
sorter,
|
|
573
|
-
extra:
|
|
532
|
+
extra: Object.assign({}, extra)
|
|
574
533
|
});
|
|
575
534
|
}
|
|
576
535
|
|
|
577
536
|
_rowExpansionIsControlled() {
|
|
578
|
-
return
|
|
537
|
+
return Array.isArray(this.getProp('expandedRowKeys'));
|
|
579
538
|
}
|
|
580
539
|
|
|
581
540
|
_pagerIsControlled() {
|
|
@@ -583,7 +542,7 @@ class TableFoundation extends _foundation.default {
|
|
|
583
542
|
}
|
|
584
543
|
|
|
585
544
|
_selectionIsControlled() {
|
|
586
|
-
return
|
|
545
|
+
return Array.isArray((0, _get2.default)(this.getProp('rowSelection'), 'selectedRowKeys'));
|
|
587
546
|
}
|
|
588
547
|
/**
|
|
589
548
|
* Determine whether the column sorting is controlled
|
|
@@ -608,7 +567,7 @@ class TableFoundation extends _foundation.default {
|
|
|
608
567
|
|
|
609
568
|
_filterIsControlled(dataIndex) {
|
|
610
569
|
const query = dataIndex && this.getQuery(dataIndex, this.getState('flattenColumns'));
|
|
611
|
-
return Boolean(query &&
|
|
570
|
+
return Boolean(query && Array.isArray(query.filteredValue));
|
|
612
571
|
}
|
|
613
572
|
|
|
614
573
|
_filterShowIsControlled(dataIndex) {
|
|
@@ -624,7 +583,7 @@ class TableFoundation extends _foundation.default {
|
|
|
624
583
|
|
|
625
584
|
_getSelectedRowKeysSet() {
|
|
626
585
|
const rowSelection = this.getState('rowSelection');
|
|
627
|
-
const selectedRowKeysSet = (0, _get2.default)(rowSelection, 'selectedRowKeysSet', new
|
|
586
|
+
const selectedRowKeysSet = (0, _get2.default)(rowSelection, 'selectedRowKeysSet', new Set());
|
|
628
587
|
return selectedRowKeysSet;
|
|
629
588
|
}
|
|
630
589
|
|
|
@@ -633,7 +592,7 @@ class TableFoundation extends _foundation.default {
|
|
|
633
592
|
}
|
|
634
593
|
|
|
635
594
|
_getRecord(realKey) {
|
|
636
|
-
return (0,
|
|
595
|
+
return (0, _find2.default)(this.getProp('dataSource'), record => realKey != null && realKey !== '' && this.getRecordKey(record) === realKey);
|
|
637
596
|
}
|
|
638
597
|
|
|
639
598
|
_getRecordChildren(record) {
|
|
@@ -648,7 +607,7 @@ class TableFoundation extends _foundation.default {
|
|
|
648
607
|
queries = queries || this.getState('queries');
|
|
649
608
|
const filters = [];
|
|
650
609
|
(0, _each2.default)(queries, query => {
|
|
651
|
-
if (
|
|
610
|
+
if (Array.isArray(query.filteredValue) && (query.filteredValue.length || this._filterIsControlled(query.dataIndex))) {
|
|
652
611
|
filters.push(query);
|
|
653
612
|
}
|
|
654
613
|
});
|
|
@@ -657,7 +616,7 @@ class TableFoundation extends _foundation.default {
|
|
|
657
616
|
|
|
658
617
|
_getAllSorters(queries) {
|
|
659
618
|
queries = queries || this.getState('queries');
|
|
660
|
-
return (0,
|
|
619
|
+
return (0, _filter2.default)(queries, query => query.sorter && query.sortOrder);
|
|
661
620
|
}
|
|
662
621
|
|
|
663
622
|
_filterQueries(targetQuery, queries) {
|
|
@@ -683,7 +642,7 @@ class TableFoundation extends _foundation.default {
|
|
|
683
642
|
let keys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['dataIndex'];
|
|
684
643
|
queries = queries == null ? this.getState('queries') : queries;
|
|
685
644
|
queries = [...queries];
|
|
686
|
-
query =
|
|
645
|
+
query = Object.assign({}, query);
|
|
687
646
|
|
|
688
647
|
const {
|
|
689
648
|
filteredQueries,
|
|
@@ -692,7 +651,7 @@ class TableFoundation extends _foundation.default {
|
|
|
692
651
|
|
|
693
652
|
(0, _each2.default)(filteredQueries, (curQuery, idx) => {
|
|
694
653
|
// assign(curQuery, query);
|
|
695
|
-
queries[filteredIndexes[idx]] =
|
|
654
|
+
queries[filteredIndexes[idx]] = Object.assign({}, query);
|
|
696
655
|
});
|
|
697
656
|
return queries;
|
|
698
657
|
}
|
|
@@ -714,7 +673,7 @@ class TableFoundation extends _foundation.default {
|
|
|
714
673
|
|
|
715
674
|
isEmpty(dataSource) {
|
|
716
675
|
dataSource = dataSource == null ? this.getProp('dataSource') : dataSource;
|
|
717
|
-
return !(
|
|
676
|
+
return !(Array.isArray(dataSource) && dataSource.length > 0);
|
|
718
677
|
}
|
|
719
678
|
|
|
720
679
|
handleSelectRow(realKey, selected, e) {
|
|
@@ -727,8 +686,8 @@ class TableFoundation extends _foundation.default {
|
|
|
727
686
|
const selectedRow = this.getSelectedRows(null, [realKey])[0];
|
|
728
687
|
let selectedRows;
|
|
729
688
|
|
|
730
|
-
if ((foundIdx =
|
|
731
|
-
|
|
689
|
+
if ((foundIdx = selectedRowKeys.indexOf(realKey)) > -1 && selected === false) {
|
|
690
|
+
selectedRowKeys.splice(foundIdx, 1);
|
|
732
691
|
selectedRows = this.getSelectedRows(null, selectedRowKeys);
|
|
733
692
|
|
|
734
693
|
if (!this._selectionIsControlled()) {
|
|
@@ -738,7 +697,7 @@ class TableFoundation extends _foundation.default {
|
|
|
738
697
|
this._adapter.notifySelect(selectedRow, selected, selectedRows, e);
|
|
739
698
|
|
|
740
699
|
this._adapter.notifySelectionChange(selectedRowKeys, selectedRows);
|
|
741
|
-
} else if (
|
|
700
|
+
} else if (selectedRowKeys.indexOf(realKey) === -1 && selected === true) {
|
|
742
701
|
selectedRowKeys.push(realKey);
|
|
743
702
|
selectedRows = this.getSelectedRows(null, selectedRowKeys);
|
|
744
703
|
|
|
@@ -771,7 +730,7 @@ class TableFoundation extends _foundation.default {
|
|
|
771
730
|
|
|
772
731
|
let allRowKeys = [...this._adapter.getCachedFilteredSortedRowKeys()];
|
|
773
732
|
const disabledRowKeys = this.getAllDisabledRowKeys();
|
|
774
|
-
const disabledRowKeysSet = new
|
|
733
|
+
const disabledRowKeysSet = new Set(disabledRowKeys);
|
|
775
734
|
let changedRowKeys; // Select all, if not disabled && not in selectedRowKeys
|
|
776
735
|
|
|
777
736
|
if (selected) {
|
|
@@ -813,21 +772,21 @@ class TableFoundation extends _foundation.default {
|
|
|
813
772
|
selectedRowKeys = selectedRowKeys == null ? this._getSelectedRowKeys() : selectedRowKeys;
|
|
814
773
|
|
|
815
774
|
if (!(0, _isSet2.default)(selectedRowKeysSet)) {
|
|
816
|
-
selectedRowKeysSet = new
|
|
775
|
+
selectedRowKeysSet = new Set(selectedRowKeys);
|
|
817
776
|
}
|
|
818
777
|
|
|
819
778
|
const childrenRecordName = this.getProp('childrenRecordName');
|
|
820
779
|
const selectedRows = [];
|
|
821
780
|
|
|
822
|
-
if ((0, _isSet2.default)(selectedRowKeysSet) && selectedRowKeysSet.size &&
|
|
781
|
+
if ((0, _isSet2.default)(selectedRowKeysSet) && selectedRowKeysSet.size && Array.isArray(dataSource) && dataSource.length) {
|
|
823
782
|
// Time complexity optimization, replace the includes operation of array with has of set
|
|
824
|
-
selectedRows.push(...
|
|
783
|
+
selectedRows.push(...dataSource.filter(data => selectedRowKeysSet.has(this.getRecordKey(data))));
|
|
825
784
|
|
|
826
785
|
if (selectedRows.length < selectedRowKeys.length) {
|
|
827
786
|
for (const item of dataSource) {
|
|
828
787
|
const children = (0, _get2.default)(item, childrenRecordName);
|
|
829
788
|
|
|
830
|
-
if (
|
|
789
|
+
if (Array.isArray(children) && children.length) {
|
|
831
790
|
const rows = this.getSelectedRows(children, selectedRowKeys, selectedRowKeysSet);
|
|
832
791
|
selectedRows.push(...rows);
|
|
833
792
|
}
|
|
@@ -844,7 +803,7 @@ class TableFoundation extends _foundation.default {
|
|
|
844
803
|
const childrenRecordName = this.getProp('childrenRecordName');
|
|
845
804
|
const disabledRowKeys = [];
|
|
846
805
|
|
|
847
|
-
if (
|
|
806
|
+
if (Array.isArray(dataSource) && dataSource.length && typeof getCheckboxProps === 'function') {
|
|
848
807
|
for (const record of dataSource) {
|
|
849
808
|
const props = getCheckboxProps(record);
|
|
850
809
|
|
|
@@ -854,7 +813,7 @@ class TableFoundation extends _foundation.default {
|
|
|
854
813
|
|
|
855
814
|
const children = (0, _get2.default)(record, childrenRecordName);
|
|
856
815
|
|
|
857
|
-
if (
|
|
816
|
+
if (Array.isArray(children) && children.length) {
|
|
858
817
|
const keys = this.getAllDisabledRowKeys(children, getCheckboxProps);
|
|
859
818
|
disabledRowKeys.push(...keys);
|
|
860
819
|
}
|
|
@@ -869,12 +828,12 @@ class TableFoundation extends _foundation.default {
|
|
|
869
828
|
const childrenRecordName = this.getProp('childrenRecordName');
|
|
870
829
|
const allRowKeys = [];
|
|
871
830
|
|
|
872
|
-
if (
|
|
831
|
+
if (Array.isArray(dataSource) && dataSource.length) {
|
|
873
832
|
for (const record of dataSource) {
|
|
874
833
|
const childrenRowKeys = [];
|
|
875
834
|
const children = (0, _get2.default)(record, childrenRecordName);
|
|
876
835
|
|
|
877
|
-
if (
|
|
836
|
+
if (Array.isArray(children) && children.length) {
|
|
878
837
|
childrenRowKeys.push(...this.getAllRowKeys(children));
|
|
879
838
|
}
|
|
880
839
|
|
|
@@ -892,7 +851,7 @@ class TableFoundation extends _foundation.default {
|
|
|
892
851
|
|
|
893
852
|
|
|
894
853
|
hasRowSelected(selectedRowKeys, allRowKeysSet) {
|
|
895
|
-
return Boolean(
|
|
854
|
+
return Boolean(Array.isArray(selectedRowKeys) && selectedRowKeys.length && (0, _isSet2.default)(allRowKeysSet) && allRowKeysSet.size && selectedRowKeys.filter(key => allRowKeysSet.has(key)).length);
|
|
896
855
|
}
|
|
897
856
|
/**
|
|
898
857
|
* expand processing function
|
|
@@ -905,13 +864,13 @@ class TableFoundation extends _foundation.default {
|
|
|
905
864
|
handleRowExpanded(expanded, realKey, domEvent) {
|
|
906
865
|
this.stopPropagation(domEvent);
|
|
907
866
|
const expandedRowKeys = [...this.getState('expandedRowKeys')];
|
|
908
|
-
const index =
|
|
867
|
+
const index = expandedRowKeys.indexOf(realKey);
|
|
909
868
|
const keyIsValid = typeof realKey === 'string' || typeof realKey === 'number';
|
|
910
869
|
|
|
911
870
|
if (keyIsValid && expanded && index === -1) {
|
|
912
871
|
expandedRowKeys.push(realKey);
|
|
913
872
|
} else if (keyIsValid && !expanded && index > -1) {
|
|
914
|
-
|
|
873
|
+
expandedRowKeys.splice(index, 1);
|
|
915
874
|
}
|
|
916
875
|
|
|
917
876
|
if (!this._rowExpansionIsControlled()) {
|
|
@@ -971,7 +930,7 @@ class TableFoundation extends _foundation.default {
|
|
|
971
930
|
|
|
972
931
|
|
|
973
932
|
allIsSelected(selectedRowKeysSet, disabledRowKeysSet, allKeys) {
|
|
974
|
-
const filteredAllKeys = (0,
|
|
933
|
+
const filteredAllKeys = (0, _filter2.default)(allKeys, key => key != null && !disabledRowKeysSet.has(key));
|
|
975
934
|
|
|
976
935
|
if (filteredAllKeys && filteredAllKeys.length) {
|
|
977
936
|
for (const key of filteredAllKeys) {
|
|
@@ -994,7 +953,7 @@ class TableFoundation extends _foundation.default {
|
|
|
994
953
|
|
|
995
954
|
allIsNotSelected(selectedRowKeys, allKeys) {
|
|
996
955
|
for (const key of allKeys) {
|
|
997
|
-
if (key != null &&
|
|
956
|
+
if (key != null && Array.isArray(selectedRowKeys) && selectedRowKeys.includes(key)) {
|
|
998
957
|
return true;
|
|
999
958
|
}
|
|
1000
959
|
}
|
|
@@ -1030,7 +989,7 @@ class TableFoundation extends _foundation.default {
|
|
|
1030
989
|
let filterObj = this.getQuery(dataIndex);
|
|
1031
990
|
const filterDropdownVisible = visible; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1032
991
|
|
|
1033
|
-
filterObj =
|
|
992
|
+
filterObj = Object.assign(Object.assign({}, filterObj), {
|
|
1034
993
|
filterDropdownVisible
|
|
1035
994
|
});
|
|
1036
995
|
|
|
@@ -1056,7 +1015,7 @@ class TableFoundation extends _foundation.default {
|
|
|
1056
1015
|
const {
|
|
1057
1016
|
filteredValue
|
|
1058
1017
|
} = data;
|
|
1059
|
-
query =
|
|
1018
|
+
query = Object.assign(Object.assign({}, query), {
|
|
1060
1019
|
filteredValue
|
|
1061
1020
|
});
|
|
1062
1021
|
queries = (0, _utils.mergeQueries)(query, queries);
|
|
@@ -1092,7 +1051,7 @@ class TableFoundation extends _foundation.default {
|
|
|
1092
1051
|
queries = [...queries];
|
|
1093
1052
|
(0, _each2.default)(queries, (query, idx, arr) => {
|
|
1094
1053
|
if (query.sorter) {
|
|
1095
|
-
const sorterObj =
|
|
1054
|
+
const sorterObj = Object.assign({}, query);
|
|
1096
1055
|
const stateSortOrder = (0, _get2.default)(sorterObj, 'sortOrder');
|
|
1097
1056
|
const defaultSortOrder = (0, _get2.default)(sorterObj, 'defaultSortOrder', false);
|
|
1098
1057
|
let querySortOrder = this.isSortOrderValid(stateSortOrder) ? stateSortOrder : defaultSortOrder;
|
|
@@ -1110,7 +1069,7 @@ class TableFoundation extends _foundation.default {
|
|
|
1110
1069
|
querySortOrder = false;
|
|
1111
1070
|
}
|
|
1112
1071
|
|
|
1113
|
-
arr[idx] =
|
|
1072
|
+
arr[idx] = Object.assign(Object.assign({}, sorterObj), {
|
|
1114
1073
|
sortOrder: querySortOrder
|
|
1115
1074
|
});
|
|
1116
1075
|
|
|
@@ -1147,7 +1106,7 @@ class TableFoundation extends _foundation.default {
|
|
|
1147
1106
|
queries = queries || this.getState('queries');
|
|
1148
1107
|
|
|
1149
1108
|
if (dataIndex != null) {
|
|
1150
|
-
return (0,
|
|
1109
|
+
return (0, _find2.default)(queries, query => query.dataIndex === dataIndex);
|
|
1151
1110
|
}
|
|
1152
1111
|
|
|
1153
1112
|
return undefined;
|
|
@@ -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 _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
14
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
15
12
|
// eslint-disable-next-line max-len
|
|
16
13
|
class TableRowFoundation extends _foundation.default {
|
|
17
14
|
handleClick(e) {
|
|
@@ -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 _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
14
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
15
12
|
class TableSelectionCellFoundation extends _foundation.default {
|
|
16
13
|
handleChange(e) {
|
|
17
14
|
const value = e.target.checked;
|