@autobest-ui/components 2.3.0 → 2.4.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/esm/accordion/Item.js +6 -23
- package/esm/accordion/index.js +8 -36
- package/esm/affix/PortalAffix.js +7 -11
- package/esm/affix/index.js +30 -70
- package/esm/carousel/index.js +45 -141
- package/esm/checkbox/index.js +12 -37
- package/esm/collapse/index.js +11 -49
- package/esm/confirm/index.d.ts +8 -0
- package/esm/confirm/index.js +23 -31
- package/esm/date-picker/DateEnum.js +0 -3
- package/esm/date-picker/calendar/Day.js +62 -78
- package/esm/date-picker/calendar/MonthYear.js +20 -53
- package/esm/date-picker/calendar/grid/index.js +7 -12
- package/esm/date-picker/calendar/index.js +4 -31
- package/esm/date-picker/index.js +11 -51
- package/esm/date-picker/utils.js +6 -11
- package/esm/drawer/Child.js +10 -20
- package/esm/drawer/index.js +22 -71
- package/esm/ellipsis/index.js +9 -17
- package/esm/guide/index.js +25 -63
- package/esm/index.d.ts +1 -1
- package/esm/input-number/ControlArrow.js +0 -2
- package/esm/input-number/constants.js +2 -2
- package/esm/input-number/index.js +26 -106
- package/esm/lazy-image/index.js +10 -55
- package/esm/link-list/index.js +11 -35
- package/esm/loading/index.js +15 -42
- package/esm/loading-container/index.js +3 -6
- package/esm/loading-icon/index.js +0 -2
- package/esm/mask/index.js +6 -9
- package/esm/message/index.d.ts +17 -6
- package/esm/message/index.js +68 -96
- package/esm/message/renderMessage.d.ts +17 -0
- package/esm/message/renderMessage.js +137 -0
- package/esm/message/style/index.css +1 -1
- package/esm/modal/Title.js +5 -12
- package/esm/modal/getPopupLocation.js +5 -7
- package/esm/modal/index.js +44 -125
- package/esm/move/index.js +32 -132
- package/esm/move/range.js +6 -12
- package/esm/move/utils.js +3 -10
- package/esm/popover/index.js +9 -28
- package/esm/portal/index.js +1 -22
- package/esm/script/index.js +19 -59
- package/esm/select/index.js +28 -106
- package/esm/show-more/index.js +40 -103
- package/esm/skeleton/Item.js +1 -3
- package/esm/skeleton/index.js +5 -11
- package/esm/style.css +1 -1
- package/esm/table/body/BodyRow.js +11 -28
- package/esm/table/body/CheckIcon.js +10 -18
- package/esm/table/body/index.js +8 -12
- package/esm/table/header/CheckIcon.js +3 -11
- package/esm/table/header/HeaderCell.js +12 -33
- package/esm/table/header/HeaderRow.js +6 -17
- package/esm/table/index.js +30 -100
- package/esm/tabs/index.js +35 -118
- package/esm/tooltip/index.js +0 -4
- package/esm/trigger/align.js +6 -6
- package/esm/trigger/bottomAlign.js +33 -45
- package/esm/trigger/constants.js +0 -1
- package/esm/trigger/getPopupLocation.js +48 -68
- package/esm/trigger/index.js +52 -187
- package/esm/trigger/leftAlign.js +33 -47
- package/esm/trigger/ref.js +2 -7
- package/esm/trigger/rightAlign.js +33 -45
- package/esm/trigger/topAlign.js +33 -45
- package/esm/trigger/utils.js +28 -45
- package/lib/accordion/Item.js +6 -27
- package/lib/accordion/index.js +8 -41
- package/lib/affix/PortalAffix.js +7 -17
- package/lib/affix/index.js +30 -75
- package/lib/carousel/index.js +45 -146
- package/lib/checkbox/index.js +12 -41
- package/lib/collapse/index.js +11 -53
- package/lib/confirm/index.d.ts +8 -0
- package/lib/confirm/index.js +23 -38
- package/lib/date-picker/DateEnum.js +0 -3
- package/lib/date-picker/calendar/Day.js +62 -87
- package/lib/date-picker/calendar/MonthYear.js +20 -62
- package/lib/date-picker/calendar/grid/index.js +7 -16
- package/lib/date-picker/calendar/index.js +4 -37
- package/lib/date-picker/index.js +9 -58
- package/lib/date-picker/utils.js +6 -26
- package/lib/drawer/Child.js +10 -25
- package/lib/drawer/index.js +22 -78
- package/lib/ellipsis/index.js +9 -23
- package/lib/guide/index.js +25 -71
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -29
- package/lib/input-number/ControlArrow.js +0 -4
- package/lib/input-number/constants.js +2 -2
- package/lib/input-number/index.js +26 -114
- package/lib/lazy-image/index.js +10 -58
- package/lib/link-list/index.js +11 -40
- package/lib/loading/index.js +13 -48
- package/lib/loading-bar/index.js +0 -5
- package/lib/loading-container/index.js +3 -11
- package/lib/loading-icon/index.js +0 -7
- package/lib/mask/index.js +6 -17
- package/lib/message/index.d.ts +17 -6
- package/lib/message/index.js +67 -104
- package/lib/message/renderMessage.d.ts +17 -0
- package/lib/message/renderMessage.js +144 -0
- package/lib/message/style/index.css +1 -1
- package/lib/modal/Affix.js +0 -4
- package/lib/modal/Title.js +5 -15
- package/lib/modal/getPopupLocation.js +5 -9
- package/lib/modal/index.js +44 -135
- package/lib/move/index.js +32 -144
- package/lib/move/range.js +6 -14
- package/lib/move/utils.js +3 -12
- package/lib/popover/index.js +9 -33
- package/lib/portal/index.js +1 -25
- package/lib/script/index.js +19 -61
- package/lib/select/index.js +28 -113
- package/lib/show-more/index.js +40 -110
- package/lib/skeleton/Item.js +1 -8
- package/lib/skeleton/index.js +5 -16
- package/lib/style.css +1 -1
- package/lib/table/body/BodyRow.js +11 -33
- package/lib/table/body/CheckIcon.js +10 -22
- package/lib/table/body/index.js +8 -17
- package/lib/table/header/CheckIcon.js +3 -15
- package/lib/table/header/HeaderCell.js +12 -37
- package/lib/table/header/HeaderRow.js +6 -22
- package/lib/table/index.js +30 -107
- package/lib/tabs/index.js +35 -122
- package/lib/tooltip/index.js +0 -9
- package/lib/trigger/align.js +0 -4
- package/lib/trigger/bottomAlign.js +33 -48
- package/lib/trigger/constants.js +0 -2
- package/lib/trigger/getPopupLocation.js +48 -74
- package/lib/trigger/index.js +52 -198
- package/lib/trigger/leftAlign.js +33 -50
- package/lib/trigger/ref.js +2 -12
- package/lib/trigger/rightAlign.js +33 -48
- package/lib/trigger/topAlign.js +33 -48
- package/lib/trigger/utils.js +28 -53
- package/package.json +7 -3
package/lib/table/index.js
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _utils = require("@autobest-ui/utils");
|
|
15
|
-
|
|
16
11
|
var _loadingContainer = _interopRequireDefault(require("../loading-container"));
|
|
17
|
-
|
|
18
12
|
var _HeaderRow = _interopRequireDefault(require("./header/HeaderRow"));
|
|
19
|
-
|
|
20
13
|
var _body = _interopRequireDefault(require("./body"));
|
|
21
|
-
|
|
22
14
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
23
15
|
var _extendStatics = function extendStatics(d, b) {
|
|
24
16
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -30,47 +22,33 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
30
22
|
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
31
23
|
}
|
|
32
24
|
};
|
|
33
|
-
|
|
34
25
|
return _extendStatics(d, b);
|
|
35
26
|
};
|
|
36
|
-
|
|
37
27
|
return function (d, b) {
|
|
38
28
|
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
39
|
-
|
|
40
29
|
_extendStatics(d, b);
|
|
41
|
-
|
|
42
30
|
function __() {
|
|
43
31
|
this.constructor = d;
|
|
44
32
|
}
|
|
45
|
-
|
|
46
33
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
47
34
|
};
|
|
48
35
|
}();
|
|
49
|
-
|
|
50
36
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
51
37
|
__assign = Object.assign || function (t) {
|
|
52
38
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
53
39
|
s = arguments[i];
|
|
54
|
-
|
|
55
40
|
for (var p in s) {
|
|
56
41
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
57
42
|
}
|
|
58
43
|
}
|
|
59
|
-
|
|
60
44
|
return t;
|
|
61
45
|
};
|
|
62
|
-
|
|
63
46
|
return __assign.apply(this, arguments);
|
|
64
47
|
};
|
|
65
|
-
|
|
66
|
-
var Table =
|
|
67
|
-
/** @class */
|
|
68
|
-
function (_super) {
|
|
48
|
+
var Table = /** @class */function (_super) {
|
|
69
49
|
__extends(Table, _super);
|
|
70
|
-
|
|
71
50
|
function Table(props) {
|
|
72
51
|
var _this = _super.call(this, props) || this;
|
|
73
|
-
|
|
74
52
|
_this.prefixCls = 'ab-table';
|
|
75
53
|
_this.headerRef = /*#__PURE__*/_react.default.createRef();
|
|
76
54
|
_this.bodyRef = /*#__PURE__*/_react.default.createRef();
|
|
@@ -85,7 +63,6 @@ function (_super) {
|
|
|
85
63
|
/**
|
|
86
64
|
* 清空选项
|
|
87
65
|
*/
|
|
88
|
-
|
|
89
66
|
_this.clearSelection = function () {
|
|
90
67
|
_this.setState(function (prevState) {
|
|
91
68
|
return {
|
|
@@ -97,51 +74,40 @@ function (_super) {
|
|
|
97
74
|
};
|
|
98
75
|
});
|
|
99
76
|
};
|
|
100
|
-
|
|
101
77
|
_this.headerScroll = (0, _utils.throttleWithRAF)(function () {
|
|
102
78
|
_this.headerRef.current.scrollLeft = _this.bodyRef.current.scrollLeft;
|
|
103
79
|
});
|
|
104
|
-
|
|
105
80
|
_this.addListener = function () {
|
|
106
81
|
var fixedHeader = _this.props.fixedHeader;
|
|
107
82
|
var bodyRef = _this.bodyRef.current;
|
|
108
|
-
|
|
109
83
|
if (fixedHeader && _this.headerRef.current && bodyRef) {
|
|
110
84
|
_this.scrollHandler = (0, _utils.addEventListener)(bodyRef, 'scroll', _this.headerScroll);
|
|
111
85
|
_this.resizeObserver = new ResizeObserver(function (entries) {
|
|
112
86
|
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
113
87
|
var entry = entries_1[_i];
|
|
114
88
|
var ele = entry.target;
|
|
115
|
-
|
|
116
89
|
if (entry.contentBoxSize) {
|
|
117
90
|
var headerRef = _this.headerRef.current;
|
|
118
|
-
|
|
119
91
|
if (!headerRef) {
|
|
120
92
|
return;
|
|
121
93
|
}
|
|
122
|
-
|
|
123
94
|
if (ele.scrollHeight > ele.clientHeight) {
|
|
124
95
|
if (_this.scrollBarThAdded) {
|
|
125
96
|
return;
|
|
126
97
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
98
|
+
var scrollBarTh = document.createElement('th');
|
|
99
|
+
// 显示滚动条的情况下,需要在thead追加一个与滚动条等宽的th
|
|
130
100
|
scrollBarTh.setAttribute('style', "width: ".concat((0, _utils.getScrollBarSize)(), "px; padding: 0"));
|
|
131
101
|
var tHeader = headerRef.querySelector('thead > tr');
|
|
132
|
-
|
|
133
102
|
if (tHeader) {
|
|
134
103
|
tHeader.appendChild(scrollBarTh);
|
|
135
104
|
_this.scrollBarThAdded = true;
|
|
136
105
|
}
|
|
137
|
-
|
|
138
106
|
return;
|
|
139
107
|
}
|
|
140
|
-
|
|
141
108
|
if (_this.scrollBarThAdded) {
|
|
142
109
|
// 删除thead追加了的与滚动条等宽的th
|
|
143
110
|
var scrollBarTh = headerRef.querySelector('thead > tr > th:last-child');
|
|
144
|
-
|
|
145
111
|
if (scrollBarTh) {
|
|
146
112
|
scrollBarTh.parentNode.removeChild(scrollBarTh);
|
|
147
113
|
}
|
|
@@ -149,16 +115,13 @@ function (_super) {
|
|
|
149
115
|
}
|
|
150
116
|
}
|
|
151
117
|
});
|
|
152
|
-
|
|
153
118
|
_this.resizeObserver.observe(bodyRef);
|
|
154
119
|
}
|
|
155
120
|
};
|
|
156
|
-
|
|
157
121
|
_this.getSelectedRows = function (selectedKeys) {
|
|
158
122
|
if ((0, _utils.isEmptyArray)(selectedKeys)) {
|
|
159
123
|
return [];
|
|
160
124
|
}
|
|
161
|
-
|
|
162
125
|
var getRowKey = _this.getRowKey;
|
|
163
126
|
var dataSource = _this.props.dataSource;
|
|
164
127
|
return selectedKeys.map(function (key) {
|
|
@@ -170,21 +133,16 @@ function (_super) {
|
|
|
170
133
|
/**
|
|
171
134
|
* 点击表头的checkbox,全选或全不选
|
|
172
135
|
*/
|
|
173
|
-
|
|
174
|
-
|
|
175
136
|
_this.onSelectAll = function (checked) {
|
|
176
137
|
var getRowKey = _this.getRowKey;
|
|
177
138
|
var _a = _this.props,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
139
|
+
dataSource = _a.dataSource,
|
|
140
|
+
rowSelection = _a.rowSelection;
|
|
181
141
|
if (checked) {
|
|
182
142
|
var newSelectedRowKeys_1 = dataSource.map(getRowKey);
|
|
183
|
-
|
|
184
143
|
if (rowSelection.onSelectAll) {
|
|
185
144
|
rowSelection.onSelectAll(true);
|
|
186
145
|
}
|
|
187
|
-
|
|
188
146
|
_this.setState(function (prevState) {
|
|
189
147
|
return {
|
|
190
148
|
rowSelection: __assign(__assign({}, prevState.rowSelection), {
|
|
@@ -193,18 +151,14 @@ function (_super) {
|
|
|
193
151
|
selectedRowKeys: newSelectedRowKeys_1
|
|
194
152
|
};
|
|
195
153
|
});
|
|
196
|
-
|
|
197
154
|
if (rowSelection.onSelectedRowChange) {
|
|
198
155
|
rowSelection.onSelectedRowChange(newSelectedRowKeys_1, dataSource);
|
|
199
156
|
}
|
|
200
|
-
|
|
201
157
|
return;
|
|
202
158
|
}
|
|
203
|
-
|
|
204
159
|
if (rowSelection.onSelectAll) {
|
|
205
160
|
rowSelection.onSelectAll(false);
|
|
206
161
|
}
|
|
207
|
-
|
|
208
162
|
_this.setState(function (prevState) {
|
|
209
163
|
return {
|
|
210
164
|
rowSelection: __assign(__assign({}, prevState.rowSelection), {
|
|
@@ -213,7 +167,6 @@ function (_super) {
|
|
|
213
167
|
selectedRowKeys: []
|
|
214
168
|
};
|
|
215
169
|
});
|
|
216
|
-
|
|
217
170
|
if (rowSelection.onSelectedRowChange) {
|
|
218
171
|
rowSelection.onSelectedRowChange([], []);
|
|
219
172
|
}
|
|
@@ -224,20 +177,17 @@ function (_super) {
|
|
|
224
177
|
* @param rowData
|
|
225
178
|
* @param rowIndex
|
|
226
179
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
180
|
_this.onSelect = function (visible, rowData, rowIndex) {
|
|
230
181
|
var getRowKey = _this.getRowKey;
|
|
231
182
|
var _a = _this.props,
|
|
232
|
-
|
|
233
|
-
|
|
183
|
+
dataSource = _a.dataSource,
|
|
184
|
+
rowSelection = _a.rowSelection;
|
|
234
185
|
var _b = _this.state,
|
|
235
|
-
|
|
236
|
-
|
|
186
|
+
selectedRowKeys = _b.selectedRowKeys,
|
|
187
|
+
selectedRows = _b.selectedRows;
|
|
237
188
|
var newRowKey = getRowKey(rowData, rowIndex);
|
|
238
189
|
var newSelectedRowKeys = [];
|
|
239
190
|
var newSelectedRows = [];
|
|
240
|
-
|
|
241
191
|
if (visible) {
|
|
242
192
|
if (!selectedRowKeys.includes(newRowKey)) {
|
|
243
193
|
newSelectedRowKeys = selectedRowKeys.concat(newRowKey);
|
|
@@ -248,16 +198,13 @@ function (_super) {
|
|
|
248
198
|
if (currentValue === newRowKey) {
|
|
249
199
|
return previousValue;
|
|
250
200
|
}
|
|
251
|
-
|
|
252
201
|
var data = dataSource.find(function (item, index) {
|
|
253
202
|
return getRowKey(item, index) === currentValue;
|
|
254
203
|
});
|
|
255
|
-
|
|
256
204
|
if (data) {
|
|
257
205
|
previousValue.selectedRowKeys.push(currentValue);
|
|
258
206
|
previousValue.selectedRows.push(data);
|
|
259
207
|
}
|
|
260
|
-
|
|
261
208
|
return previousValue;
|
|
262
209
|
}, {
|
|
263
210
|
selectedRowKeys: [],
|
|
@@ -266,11 +213,9 @@ function (_super) {
|
|
|
266
213
|
newSelectedRows = result.selectedRows;
|
|
267
214
|
newSelectedRowKeys = result.selectedRowKeys;
|
|
268
215
|
}
|
|
269
|
-
|
|
270
216
|
if (rowSelection.onSelect) {
|
|
271
217
|
rowSelection.onSelect(visible, rowData, selectedRows);
|
|
272
218
|
}
|
|
273
|
-
|
|
274
219
|
if (!visible && _this.state.rowSelection.selectAllChecked) {
|
|
275
220
|
_this.setState(function (prevState) {
|
|
276
221
|
return {
|
|
@@ -280,35 +225,28 @@ function (_super) {
|
|
|
280
225
|
};
|
|
281
226
|
});
|
|
282
227
|
}
|
|
283
|
-
|
|
284
228
|
_this.setState({
|
|
285
229
|
selectedRowKeys: newSelectedRowKeys,
|
|
286
230
|
selectedRows: newSelectedRows
|
|
287
231
|
});
|
|
288
|
-
|
|
289
232
|
if (rowSelection.onSelectedRowChange) {
|
|
290
233
|
rowSelection.onSelectedRowChange(newSelectedRowKeys, newSelectedRows);
|
|
291
234
|
}
|
|
292
235
|
};
|
|
293
|
-
|
|
294
236
|
_this.getDisabled = function (rowData) {
|
|
295
237
|
var rowSelection = _this.props.rowSelection;
|
|
296
|
-
|
|
297
238
|
if ('getDisabled' in rowSelection) {
|
|
298
239
|
var _a = _this.state,
|
|
299
|
-
|
|
300
|
-
|
|
240
|
+
selectedRowKeys = _a.selectedRowKeys,
|
|
241
|
+
selectedRows = _a.selectedRows;
|
|
301
242
|
return rowSelection.getDisabled(rowData, selectedRowKeys, selectedRows);
|
|
302
243
|
}
|
|
303
|
-
|
|
304
244
|
return false;
|
|
305
245
|
};
|
|
306
|
-
|
|
307
246
|
_this.getRowSelection = function () {
|
|
308
247
|
if (!('rowSelection' in _this.props) || !_this.props.rowSelection) {
|
|
309
248
|
return null;
|
|
310
249
|
}
|
|
311
|
-
|
|
312
250
|
var propsRowSelection = _this.props.rowSelection;
|
|
313
251
|
return __assign(__assign(__assign({}, _this.defaultRowSelection), propsRowSelection), {
|
|
314
252
|
onSelect: _this.onSelect,
|
|
@@ -319,17 +257,14 @@ function (_super) {
|
|
|
319
257
|
/**
|
|
320
258
|
* 用colgroup设置每一列的宽度
|
|
321
259
|
*/
|
|
322
|
-
|
|
323
|
-
|
|
324
260
|
_this.renderColgroup = function () {
|
|
325
261
|
var _a = _this.props,
|
|
326
|
-
|
|
327
|
-
|
|
262
|
+
columns = _a.columns,
|
|
263
|
+
rowSelection = _a.rowSelection;
|
|
328
264
|
return /*#__PURE__*/_react.default.createElement("colgroup", null, rowSelection ? /*#__PURE__*/_react.default.createElement("col", {
|
|
329
265
|
className: "".concat(_this.prefixCls, "-checkbox-col")
|
|
330
266
|
}) : null, columns.map(function (item) {
|
|
331
267
|
var width = item.width;
|
|
332
|
-
|
|
333
268
|
if (width) {
|
|
334
269
|
return /*#__PURE__*/_react.default.createElement("col", {
|
|
335
270
|
key: item.key,
|
|
@@ -339,21 +274,19 @@ function (_super) {
|
|
|
339
274
|
}
|
|
340
275
|
});
|
|
341
276
|
}
|
|
342
|
-
|
|
343
277
|
return /*#__PURE__*/_react.default.createElement("col", {
|
|
344
278
|
key: item.key
|
|
345
279
|
});
|
|
346
280
|
}));
|
|
347
281
|
};
|
|
348
|
-
|
|
349
282
|
_this.renderHeader = function () {
|
|
350
283
|
var cls = _this.prefixCls;
|
|
351
284
|
var _a = _this.props,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
285
|
+
columns = _a.columns,
|
|
286
|
+
sortName = _a.sortName,
|
|
287
|
+
isSortedDescending = _a.isSortedDescending,
|
|
288
|
+
sortIcon = _a.sortIcon,
|
|
289
|
+
onSortChange = _a.onSortChange;
|
|
357
290
|
var rowSelection = _this.state.rowSelection;
|
|
358
291
|
return /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement(_HeaderRow.default, {
|
|
359
292
|
prefixCls: cls,
|
|
@@ -365,19 +298,18 @@ function (_super) {
|
|
|
365
298
|
rowSelection: rowSelection
|
|
366
299
|
}));
|
|
367
300
|
};
|
|
368
|
-
|
|
369
301
|
_this.renderBody = function () {
|
|
370
302
|
var cls = _this.prefixCls;
|
|
371
303
|
var getRowKey = _this.getRowKey;
|
|
372
304
|
var _a = _this.props,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
305
|
+
columns = _a.columns,
|
|
306
|
+
dataSource = _a.dataSource,
|
|
307
|
+
expandable = _a.expandable,
|
|
308
|
+
onRowClick = _a.onRowClick,
|
|
309
|
+
rowClassName = _a.rowClassName;
|
|
378
310
|
var _b = _this.state,
|
|
379
|
-
|
|
380
|
-
|
|
311
|
+
rowSelection = _b.rowSelection,
|
|
312
|
+
selectedRowKeys = _b.selectedRowKeys;
|
|
381
313
|
return /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement(_body.default, {
|
|
382
314
|
prefixCls: cls,
|
|
383
315
|
getRowKey: getRowKey,
|
|
@@ -390,9 +322,8 @@ function (_super) {
|
|
|
390
322
|
getRowClassName: rowClassName
|
|
391
323
|
}));
|
|
392
324
|
};
|
|
393
|
-
|
|
394
325
|
var rowSelection = props.rowSelection,
|
|
395
|
-
|
|
326
|
+
rowKey = props.rowKey;
|
|
396
327
|
_this.getRowKey = typeof rowKey === 'string' ? function (data) {
|
|
397
328
|
return data[rowKey];
|
|
398
329
|
} : rowKey;
|
|
@@ -404,30 +335,25 @@ function (_super) {
|
|
|
404
335
|
};
|
|
405
336
|
return _this;
|
|
406
337
|
}
|
|
407
|
-
|
|
408
338
|
Table.prototype.componentDidMount = function () {
|
|
409
339
|
this.addListener();
|
|
410
340
|
};
|
|
411
|
-
|
|
412
341
|
Table.prototype.componentWillUnmount = function () {
|
|
413
342
|
if (this.scrollHandler) {
|
|
414
343
|
this.scrollHandler.remove();
|
|
415
344
|
this.scrollHandler = null;
|
|
416
345
|
}
|
|
417
|
-
|
|
418
346
|
if (this.resizeObserver && this.bodyRef.current) {
|
|
419
347
|
this.resizeObserver.unobserve(this.bodyRef.current);
|
|
420
348
|
}
|
|
421
349
|
};
|
|
422
|
-
|
|
423
350
|
Table.prototype.render = function () {
|
|
424
351
|
var cls = this.prefixCls;
|
|
425
352
|
var _a = this.props,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
353
|
+
className = _a.className,
|
|
354
|
+
fixedHeader = _a.fixedHeader,
|
|
355
|
+
maxHeight = _a.maxHeight,
|
|
356
|
+
loading = _a.loading;
|
|
431
357
|
if (fixedHeader) {
|
|
432
358
|
return /*#__PURE__*/_react.default.createElement(_loadingContainer.default, {
|
|
433
359
|
loading: loading,
|
|
@@ -447,7 +373,6 @@ function (_super) {
|
|
|
447
373
|
className: "".concat(cls, "-table")
|
|
448
374
|
}, this.renderColgroup(), this.renderBody())));
|
|
449
375
|
}
|
|
450
|
-
|
|
451
376
|
return /*#__PURE__*/_react.default.createElement(_loadingContainer.default, {
|
|
452
377
|
loading: loading,
|
|
453
378
|
className: (0, _classnames.default)(className, cls)
|
|
@@ -455,7 +380,6 @@ function (_super) {
|
|
|
455
380
|
className: "".concat(cls, "-table")
|
|
456
381
|
}, this.renderColgroup(), this.renderHeader(), this.renderBody()));
|
|
457
382
|
};
|
|
458
|
-
|
|
459
383
|
Table.defaultProps = {
|
|
460
384
|
fixedHeader: false,
|
|
461
385
|
loading: false,
|
|
@@ -466,6 +390,5 @@ function (_super) {
|
|
|
466
390
|
};
|
|
467
391
|
return Table;
|
|
468
392
|
}(_react.default.Component);
|
|
469
|
-
|
|
470
393
|
var _default = Table;
|
|
471
394
|
exports.default = _default;
|