@kne/super-select 0.1.45 → 0.1.47
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/README.md +65 -2
- package/dist/index.css +59 -16
- package/dist/index.css.map +1 -1
- package/dist/index.js +667 -582
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +175 -147
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -2
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo, forwardRef, useState, useCallback, useLayoutEffect, useEffect, useImperativeHandle, useRef } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { createContext } from '@kne/global-context';
|
|
4
4
|
import useResize from '@kne/use-resize';
|
|
@@ -11,15 +11,17 @@ import { CloseCircleFilled, DownOutlined, CheckOutlined, RightOutlined } from '@
|
|
|
11
11
|
import { isNotEmpty } from '@kne/is-empty';
|
|
12
12
|
import { usePopupContainer, useScrollElement, useMobilePopupMount, MOBILE_POPUP_MODE } from '@kne/responsive-utils';
|
|
13
13
|
import { createWithIntlProvider, useIntl } from '@kne/react-intl';
|
|
14
|
+
import { useOverflowItems } from '@kne/overflow-items';
|
|
14
15
|
import 'simplebar-react/dist/simplebar.min.css';
|
|
15
16
|
import get from 'lodash/get';
|
|
16
17
|
import SimpleBar from 'simplebar-react';
|
|
17
18
|
import SearchInput from '@kne/search-input';
|
|
18
19
|
import { FetchScrollLoader } from '@kne/scroll-loader';
|
|
19
20
|
import '@kne/scroll-loader/dist/index.css';
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
import merge from 'lodash/merge';
|
|
22
|
+
import TablePage, { hasColumnWidth, isTreeDataType, normalizeTreeData, flattenAllTree } from '@kne/table-page';
|
|
23
|
+
export { mergeTreeChildren } from '@kne/table-page';
|
|
24
|
+
import '@kne/table-page/dist/index.css';
|
|
23
25
|
import { CentralContent } from '@kne/info-page';
|
|
24
26
|
import '@kne/info-page/dist/index.css';
|
|
25
27
|
import memoize from 'lodash/memoize';
|
|
@@ -51,7 +53,7 @@ const {
|
|
|
51
53
|
useContext
|
|
52
54
|
} = context;
|
|
53
55
|
|
|
54
|
-
var style$6 = {"kne-responsive-boundary":"kne-super-select_mJpBa","kne-responsive-scroll":"kne-super-select_90VCi","select-input":"kne-super-select_d8lGc","disabled":"kne-super-select_3kjwO","wrap":"kne-super-select_dsTM2","select-input-inner":"kne-super-select_NQoX9","large":"kne-super-select_T8ZX8","small":"kne-super-select_1B72H","is-mobile":"kne-super-select_VoUSp","single-label":"kne-super-select_pL0tE","tag-item":"kne-super-select_lc4o7","tag-label":"kne-super-select_RJmlD","overflow-tag":"kne-super-select_aHua2","measure-layer":"kne-super-select_QoQpC","select-input-icon":"kne-super-select_g8QC-","placeholder":"kne-super-select_r3q69","overlay-content":"kne-super-select_zEqGe","mobile-sheet-body":"kne-super-select_Gmh-5","overlay":"kne-super-select_ybN30","select-input-prefix":"kne-super-select_4Pw75","select-input-suffix":"kne-super-select_Wd4pE","mobile-sheet-mask":"kne-super-select_EOKDm","mobile-sheet-mask-fade-in":"kne-super-select_tWTg9","mobile-sheet-mask-leave":"kne-super-select_UAU38","mobile-sheet-mask-fade-out":"kne-super-select_e3tK2","mobile-sheet-popup":"kne-super-select_x0gT0","mobile-sheet-portal":"kne-super-select_kuA7x","mobile-sheet-header":"kne-super-select_EqRnq","mobile-sheet-title":"kne-super-select_5DU3x","mobile-sheet-action":"kne-super-select_UMAVM","mobile-sheet-confirm":"kne-super-select_Y48cj"};
|
|
56
|
+
var style$6 = {"kne-responsive-boundary":"kne-super-select_mJpBa","kne-responsive-scroll":"kne-super-select_90VCi","select-input":"kne-super-select_d8lGc","disabled":"kne-super-select_3kjwO","wrap":"kne-super-select_dsTM2","select-input-inner":"kne-super-select_NQoX9","large":"kne-super-select_T8ZX8","small":"kne-super-select_1B72H","is-mobile":"kne-super-select_VoUSp","single-label":"kne-super-select_pL0tE","tag-item":"kne-super-select_lc4o7","tag-label":"kne-super-select_RJmlD","overflow-tag":"kne-super-select_aHua2","tag-overflow":"kne-super-select_as9W0","tag-overflow-content":"kne-super-select_-JRYS","measure-layer":"kne-super-select_QoQpC","select-input-icon":"kne-super-select_g8QC-","placeholder":"kne-super-select_r3q69","overlay-content":"kne-super-select_zEqGe","mobile-sheet-body":"kne-super-select_Gmh-5","overlay":"kne-super-select_ybN30","select-input-prefix":"kne-super-select_4Pw75","select-input-suffix":"kne-super-select_Wd4pE","mobile-sheet-mask":"kne-super-select_EOKDm","mobile-sheet-mask-fade-in":"kne-super-select_tWTg9","mobile-sheet-mask-leave":"kne-super-select_UAU38","mobile-sheet-mask-fade-out":"kne-super-select_e3tK2","mobile-sheet-popup":"kne-super-select_x0gT0","mobile-sheet-portal":"kne-super-select_kuA7x","mobile-sheet-header":"kne-super-select_EqRnq","mobile-sheet-title":"kne-super-select_5DU3x","mobile-sheet-action":"kne-super-select_UMAVM","mobile-sheet-confirm":"kne-super-select_Y48cj"};
|
|
55
57
|
|
|
56
58
|
const locale$1 = {
|
|
57
59
|
placeholder: '请选择',
|
|
@@ -79,9 +81,10 @@ const locale = {
|
|
|
79
81
|
confirm: 'OK'
|
|
80
82
|
};
|
|
81
83
|
|
|
84
|
+
const TAG_GAP = 8;
|
|
85
|
+
|
|
82
86
|
/**
|
|
83
|
-
*
|
|
84
|
-
* 根据 innerWidth 计算标签显示数量
|
|
87
|
+
* 标签溢出:用 @kne/overflow-items 按容器宽度计算可见数量,预留 +N。
|
|
85
88
|
*/
|
|
86
89
|
const TagOverflowInner = ({
|
|
87
90
|
value,
|
|
@@ -89,73 +92,82 @@ const TagOverflowInner = ({
|
|
|
89
92
|
labelKey,
|
|
90
93
|
valueKey,
|
|
91
94
|
onRemove,
|
|
92
|
-
overflowTagWidth: _overflowTagWidth = 45,
|
|
93
95
|
iconSpace: _iconSpace = 20
|
|
94
96
|
}) => {
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
const list = Array.isArray(value) ? value : [];
|
|
98
|
+
const availableWidth = Math.max((innerWidth || 0) - _iconSpace, 0);
|
|
99
|
+
const maxTagWidth = innerWidth > 0 ? Math.min(150, Math.max(60, innerWidth - 60)) : 150;
|
|
100
|
+
const shareItems = useMemo(() => list.map(item => ({
|
|
101
|
+
key: item == null ? void 0 : item[valueKey],
|
|
102
|
+
label: item == null ? void 0 : item[labelKey]
|
|
103
|
+
})), [list, labelKey, valueKey]);
|
|
104
|
+
const {
|
|
105
|
+
setContainerRef,
|
|
106
|
+
setMeasureRef,
|
|
107
|
+
setMoreMeasureRef,
|
|
108
|
+
visibleCount,
|
|
109
|
+
ready,
|
|
110
|
+
hiddenCount,
|
|
111
|
+
shouldMeasure
|
|
112
|
+
} = useOverflowItems({
|
|
113
|
+
itemCount: list.length,
|
|
114
|
+
items: shareItems,
|
|
115
|
+
enabled: list.length > 0 && availableWidth > 0,
|
|
116
|
+
gap: TAG_GAP,
|
|
117
|
+
beforeReady: 'all',
|
|
118
|
+
debounce: 0,
|
|
119
|
+
itemSelector: '[data-tag-measure]'
|
|
120
|
+
});
|
|
121
|
+
const displayCount = ready ? visibleCount : list.length;
|
|
122
|
+
const displayTags = list.slice(0, displayCount);
|
|
123
|
+
const showOverflow = ready && hiddenCount > 0;
|
|
124
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
125
|
+
ref: setContainerRef,
|
|
126
|
+
className: style$6['tag-overflow'],
|
|
127
|
+
style: {
|
|
128
|
+
width: availableWidth || '100%',
|
|
129
|
+
maxWidth: '100%'
|
|
104
130
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const marginLeft = parseFloat(style.marginLeft) || 0;
|
|
112
|
-
const marginRight = parseFloat(style.marginRight) || 0;
|
|
113
|
-
return el.offsetWidth + marginLeft + marginRight;
|
|
114
|
-
});
|
|
115
|
-
const availableWidth = innerWidth - _iconSpace;
|
|
116
|
-
let totalWidth = 0;
|
|
117
|
-
let count = 0;
|
|
118
|
-
for (let i = 0; i < tagWidths.length; i++) {
|
|
119
|
-
// 如果不是最后一个,需要预留 +N 标签空间
|
|
120
|
-
const needOverflowSpace = i < tagWidths.length - 1;
|
|
121
|
-
const requiredWidth = tagWidths[i] + (needOverflowSpace ? _overflowTagWidth : 0);
|
|
122
|
-
if (totalWidth + requiredWidth <= availableWidth) {
|
|
123
|
-
totalWidth += tagWidths[i];
|
|
124
|
-
count++;
|
|
125
|
-
} else {
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
131
|
+
}, shouldMeasure ? /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
ref: setMeasureRef,
|
|
133
|
+
className: style$6['measure-layer'],
|
|
134
|
+
"aria-hidden": true,
|
|
135
|
+
style: {
|
|
136
|
+
gap: TAG_GAP
|
|
128
137
|
}
|
|
129
|
-
|
|
130
|
-
// 确保至少显示一个标签
|
|
131
|
-
setVisibleCount(Math.max(1, count));
|
|
132
|
-
}, [value, innerWidth, _overflowTagWidth, _iconSpace]);
|
|
133
|
-
|
|
134
|
-
// 计算单个标签最大宽度:min(150px, innerWidth - 60),初始状态默认 150px
|
|
135
|
-
const maxTagWidth = innerWidth > 0 ? Math.min(150, Math.max(60, innerWidth - 60)) : 150;
|
|
136
|
-
const displayTags = value.slice(0, visibleCount);
|
|
137
|
-
const hiddenCount = value.length - visibleCount;
|
|
138
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
139
|
-
ref: measureRef,
|
|
140
|
-
className: style$6['measure-layer']
|
|
141
|
-
}, value.map(item => /*#__PURE__*/React.createElement(Tag, {
|
|
138
|
+
}, list.map(item => /*#__PURE__*/React.createElement("div", {
|
|
142
139
|
key: item[valueKey],
|
|
143
|
-
"data-tag-measure": true
|
|
140
|
+
"data-tag-measure": true
|
|
141
|
+
}, /*#__PURE__*/React.createElement(Tag, {
|
|
144
142
|
closable: true,
|
|
145
143
|
bordered: false,
|
|
146
144
|
className: style$6['tag-item'],
|
|
147
145
|
style: {
|
|
148
|
-
'--max-tag-width': `${maxTagWidth}px
|
|
146
|
+
'--max-tag-width': `${maxTagWidth}px`,
|
|
147
|
+
margin: 0
|
|
149
148
|
}
|
|
150
149
|
}, /*#__PURE__*/React.createElement("span", {
|
|
151
150
|
className: style$6['tag-label']
|
|
152
|
-
}, item[labelKey])))),
|
|
151
|
+
}, item[labelKey])))), /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
ref: setMoreMeasureRef
|
|
153
|
+
}, /*#__PURE__*/React.createElement(Tag, {
|
|
154
|
+
className: style$6['overflow-tag'],
|
|
155
|
+
style: {
|
|
156
|
+
margin: 0
|
|
157
|
+
}
|
|
158
|
+
}, "+99"))) : null, /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
className: style$6['tag-overflow-content'],
|
|
160
|
+
style: {
|
|
161
|
+
gap: TAG_GAP
|
|
162
|
+
}
|
|
163
|
+
}, displayTags.map(item => /*#__PURE__*/React.createElement(Tag, {
|
|
153
164
|
key: item[valueKey],
|
|
154
165
|
closable: true,
|
|
155
166
|
bordered: false,
|
|
156
167
|
className: style$6['tag-item'],
|
|
157
168
|
style: {
|
|
158
|
-
'--max-tag-width': `${maxTagWidth}px
|
|
169
|
+
'--max-tag-width': `${maxTagWidth}px`,
|
|
170
|
+
margin: 0
|
|
159
171
|
},
|
|
160
172
|
onClose: e => {
|
|
161
173
|
e.preventDefault();
|
|
@@ -164,9 +176,9 @@ const TagOverflowInner = ({
|
|
|
164
176
|
}, /*#__PURE__*/React.createElement("span", {
|
|
165
177
|
className: style$6['tag-label'],
|
|
166
178
|
title: item[labelKey]
|
|
167
|
-
}, item[labelKey]))),
|
|
179
|
+
}, item[labelKey]))), showOverflow ? /*#__PURE__*/React.createElement(Tag, {
|
|
168
180
|
className: style$6['overflow-tag']
|
|
169
|
-
}, "+", hiddenCount));
|
|
181
|
+
}, "+", hiddenCount) : null));
|
|
170
182
|
};
|
|
171
183
|
|
|
172
184
|
const _excluded$3 = ["children"];
|
|
@@ -1167,7 +1179,7 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
1167
1179
|
});
|
|
1168
1180
|
});
|
|
1169
1181
|
|
|
1170
|
-
var style$2 = {"body":"kne-super-select_704J1","is-mobile":"kne-super-select_HYGUN","table-panel-wrap":"kne-super-select_Boo1a","selected-panel-wrap":"kne-super-select_q-BjK","table-panel":"kne-super-select_UAejp","filter-wrap":"kne-super-select_gmlBv","table":"kne-super-select_zE-14","list":"kne-super-select_DrEYJ","is-
|
|
1182
|
+
var style$2 = {"body":"kne-super-select_704J1","is-mobile":"kne-super-select_HYGUN","table-panel-wrap":"kne-super-select_Boo1a","selected-panel-wrap":"kne-super-select_q-BjK","table-panel":"kne-super-select_UAejp","filter-wrap":"kne-super-select_gmlBv","table":"kne-super-select_zE-14","list":"kne-super-select_DrEYJ","is-fit-columns":"kne-super-select_QqZxW","empty":"kne-super-select_5Tyrt","right-options-col":"kne-super-select_sNBrJ","right-options":"kne-super-select_UXi-g","no-padding-btn":"kne-super-select_iaCir","selected-tags-scroll":"kne-super-select_b-3Xk","tag":"kne-super-select_JkYqS","tag-inner":"kne-super-select_VZlBL","single-checked":"kne-super-select_Eiz-u","select-search":"kne-super-select_temy6","tags-search":"kne-super-select_7phL2","descriptions":"kne-super-select_ttNK9","footer":"kne-super-select_lISfA"};
|
|
1171
1183
|
|
|
1172
1184
|
const isEmptyParentKey = value => value == null || value === '';
|
|
1173
1185
|
const flattenSelectList = (list, {
|
|
@@ -1237,12 +1249,25 @@ const filterTreeOptions = (options, searchProps, getSearchCallback, targetProps,
|
|
|
1237
1249
|
}
|
|
1238
1250
|
return options.filter(item => getSearchCallback(searchProps, item, targetProps));
|
|
1239
1251
|
};
|
|
1252
|
+
const getListFromPageData = data => {
|
|
1253
|
+
if (Array.isArray(data == null ? void 0 : data.pageData)) {
|
|
1254
|
+
return data.pageData;
|
|
1255
|
+
}
|
|
1256
|
+
if (Array.isArray(data == null ? void 0 : data.list)) {
|
|
1257
|
+
return data.list;
|
|
1258
|
+
}
|
|
1259
|
+
return [];
|
|
1260
|
+
};
|
|
1261
|
+
const TABLE_LIST_MAX_HEIGHT_POPUP = 300;
|
|
1262
|
+
const TABLE_LIST_MAX_HEIGHT_EMBED = 400;
|
|
1263
|
+
const TABLE_HEADER_HEIGHT = 48;
|
|
1240
1264
|
const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select')(forwardRef((p, ref) => {
|
|
1241
1265
|
const {
|
|
1242
1266
|
formatMessage
|
|
1243
1267
|
} = useIntl();
|
|
1244
1268
|
const [tagSearchText, setTagSearchText] = useState('');
|
|
1245
|
-
const
|
|
1269
|
+
const tablePageRef = useRef();
|
|
1270
|
+
const listScrollRef = useRef();
|
|
1246
1271
|
const props = Object.assign({}, {
|
|
1247
1272
|
overlayWidth: '600px',
|
|
1248
1273
|
dataType: 'list',
|
|
@@ -1336,7 +1361,9 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1336
1361
|
defaultExpandedKeys,
|
|
1337
1362
|
onExpandedKeysChange,
|
|
1338
1363
|
indentSize,
|
|
1339
|
-
checkRelation
|
|
1364
|
+
checkRelation,
|
|
1365
|
+
pagination: paginationProp,
|
|
1366
|
+
dataFormat
|
|
1340
1367
|
} = props;
|
|
1341
1368
|
const isSelectedAll = computedIsSelectAll(value, selectedAllValue, valueKey);
|
|
1342
1369
|
const resolvedTreeTitleKey = treeTitleKey || labelKey;
|
|
@@ -1344,57 +1371,40 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1344
1371
|
className: classnames(style$2['footer'], 'select-table-footer')
|
|
1345
1372
|
}, typeof footer === 'function' ? footer({
|
|
1346
1373
|
reload: () => {
|
|
1347
|
-
var
|
|
1348
|
-
(
|
|
1374
|
+
var _tablePageRef$current;
|
|
1375
|
+
(_tablePageRef$current = tablePageRef.current) == null || _tablePageRef$current.reload();
|
|
1349
1376
|
},
|
|
1350
1377
|
close: () => {
|
|
1351
1378
|
onOpenChange(false);
|
|
1352
1379
|
}
|
|
1353
1380
|
}) : footer);
|
|
1354
|
-
const
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
options,
|
|
1364
|
-
searchProps
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
searchProps
|
|
1372
|
-
} = data;
|
|
1373
|
-
return {
|
|
1374
|
-
pageData: filterTreeOptions(options, searchProps, getSearchCallback, targetProps, {
|
|
1375
|
-
dataType,
|
|
1376
|
-
valueKey,
|
|
1377
|
-
parentKey,
|
|
1378
|
-
childrenKey
|
|
1379
|
-
})
|
|
1380
|
-
};
|
|
1381
|
-
}
|
|
1382
|
-
} : api)
|
|
1383
|
-
}), fetchProps => {
|
|
1384
|
-
fetchListRef.current = fetchProps;
|
|
1385
|
-
const {
|
|
1386
|
-
list
|
|
1387
|
-
} = fetchProps;
|
|
1388
|
-
const contextProps = Object.assign({}, fetchProps, targetProps, {
|
|
1389
|
-
isSelectedAll
|
|
1390
|
-
});
|
|
1391
|
-
if (!(list && list.length > 0)) {
|
|
1392
|
-
return props.empty || /*#__PURE__*/React.createElement(Empty, {
|
|
1393
|
-
className: classnames(style$2['empty'])
|
|
1381
|
+
const tablePageFetchConfig = options ? {
|
|
1382
|
+
data: {
|
|
1383
|
+
options,
|
|
1384
|
+
searchProps
|
|
1385
|
+
},
|
|
1386
|
+
loader: ({
|
|
1387
|
+
data
|
|
1388
|
+
}) => {
|
|
1389
|
+
const {
|
|
1390
|
+
options: nextOptions,
|
|
1391
|
+
searchProps: nextSearchProps
|
|
1392
|
+
} = data;
|
|
1393
|
+
const pageData = filterTreeOptions(nextOptions, nextSearchProps, getSearchCallback, targetProps, {
|
|
1394
|
+
dataType,
|
|
1395
|
+
valueKey,
|
|
1396
|
+
parentKey,
|
|
1397
|
+
childrenKey
|
|
1394
1398
|
});
|
|
1399
|
+
return {
|
|
1400
|
+
pageData,
|
|
1401
|
+
totalCount: pageData.length
|
|
1402
|
+
};
|
|
1395
1403
|
}
|
|
1396
|
-
|
|
1397
|
-
|
|
1404
|
+
} : merge({}, api, typeof getSearchProps === 'function' && isNotEmpty(searchProps) ? {
|
|
1405
|
+
data: getSearchProps(searchProps) || {}
|
|
1406
|
+
} : {});
|
|
1407
|
+
const allColumnsHaveWidth = Array.isArray(columns) && columns.length > 0 && columns.every(hasColumnWidth);
|
|
1398
1408
|
const tableSelection = {
|
|
1399
1409
|
allowSelectedAll,
|
|
1400
1410
|
isSelectedAll,
|
|
@@ -1406,9 +1416,9 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1406
1416
|
checkRelation,
|
|
1407
1417
|
onChange: selectedRowKeys => {
|
|
1408
1418
|
setValue(prev => {
|
|
1409
|
-
var
|
|
1419
|
+
var _tablePageRef$current2;
|
|
1410
1420
|
const prevMap = new Map((prev || []).map(item => [item[valueKey], item]));
|
|
1411
|
-
const listMap = new Map(flattenSelectList((
|
|
1421
|
+
const listMap = new Map(flattenSelectList(getListFromPageData((_tablePageRef$current2 = tablePageRef.current) == null ? void 0 : _tablePageRef$current2.data), {
|
|
1412
1422
|
dataType,
|
|
1413
1423
|
rowKey: valueKey,
|
|
1414
1424
|
parentKey,
|
|
@@ -1453,7 +1463,7 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1453
1463
|
wrap: true,
|
|
1454
1464
|
gap: 8
|
|
1455
1465
|
}, value.filter(item => getTagSearchCallback(tagSearchText, item, targetProps)).map(item => {
|
|
1456
|
-
var
|
|
1466
|
+
var _tablePageRef$current3;
|
|
1457
1467
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
1458
1468
|
className: style$2['tag'],
|
|
1459
1469
|
key: item[valueKey],
|
|
@@ -1477,8 +1487,8 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1477
1487
|
})),
|
|
1478
1488
|
dataSource: Object.assign({}, item),
|
|
1479
1489
|
context: Object.assign({}, targetProps, {
|
|
1480
|
-
fetchApi:
|
|
1481
|
-
list: (
|
|
1490
|
+
fetchApi: tablePageRef.current,
|
|
1491
|
+
list: getListFromPageData((_tablePageRef$current3 = tablePageRef.current) == null ? void 0 : _tablePageRef$current3.data)
|
|
1482
1492
|
})
|
|
1483
1493
|
})
|
|
1484
1494
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -1503,42 +1513,60 @@ const SelectTableList = createWithIntlProvider('zh-CN', locale$1, 'super-select'
|
|
|
1503
1513
|
className: style$2['filter-wrap']
|
|
1504
1514
|
}, filterRender(Object.assign({}, targetProps))), /*#__PURE__*/React.createElement("div", {
|
|
1505
1515
|
className: classnames(style$2['table'], 'select-table')
|
|
1506
|
-
},
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1516
|
+
}, open ? /*#__PURE__*/React.createElement("div", {
|
|
1517
|
+
ref: listScrollRef,
|
|
1518
|
+
className: classnames(style$2['list'], 'select-table-list-scroll-list', {
|
|
1519
|
+
'is-popup': isPopup,
|
|
1520
|
+
[style$2['is-fit-columns']]: !allColumnsHaveWidth
|
|
1521
|
+
})
|
|
1522
|
+
}, /*#__PURE__*/React.createElement(TablePage, _extends({}, tablePageFetchConfig, {
|
|
1523
|
+
ref: tablePageRef
|
|
1524
|
+
}, dataFormat ? {
|
|
1525
|
+
dataFormat
|
|
1526
|
+
} : null, {
|
|
1527
|
+
pagination: Object.assign({
|
|
1528
|
+
open: false,
|
|
1529
|
+
showSizeChanger: false,
|
|
1530
|
+
showQuickJumper: false,
|
|
1531
|
+
hideOnSinglePage: true
|
|
1532
|
+
}, paginationProp),
|
|
1533
|
+
scroll: isMobile ? undefined : Object.assign({
|
|
1534
|
+
y: (isPopup ? TABLE_LIST_MAX_HEIGHT_POPUP : TABLE_LIST_MAX_HEIGHT_EMBED) - TABLE_HEADER_HEIGHT
|
|
1535
|
+
}, allColumnsHaveWidth ? null : {
|
|
1536
|
+
x: undefined
|
|
1537
|
+
}),
|
|
1538
|
+
controllerOpen: false,
|
|
1539
|
+
columns: columns,
|
|
1540
|
+
rowKey: valueKey,
|
|
1541
|
+
rowSelection: tableSelection,
|
|
1542
|
+
columnRenderProps: Object.assign({}, targetProps, {
|
|
1543
|
+
isSelectedAll
|
|
1544
|
+
}),
|
|
1545
|
+
empty: props.empty || /*#__PURE__*/React.createElement(Empty, {
|
|
1546
|
+
className: classnames(style$2['empty'])
|
|
1547
|
+
}),
|
|
1548
|
+
dataType: dataType,
|
|
1549
|
+
parentKey: parentKey,
|
|
1550
|
+
childrenKey: childrenKey,
|
|
1551
|
+
hasChildrenKey: hasChildrenKey,
|
|
1552
|
+
treeTitleKey: resolvedTreeTitleKey,
|
|
1553
|
+
renderMobile: renderMobile === false ? false : typeof renderMobile === 'function' ? mobileProps => renderMobile(_extends({}, mobileProps, targetProps, {
|
|
1554
|
+
isSelectedAll,
|
|
1555
|
+
list: mobileProps.displayDataSource || mobileProps.dataSource,
|
|
1556
|
+
dataSource: mobileProps.dataSource,
|
|
1557
|
+
renderBody: (nextList = mobileProps.displayDataSource || mobileProps.dataSource, nextContext) => mobileProps.renderBody(nextList, nextContext)
|
|
1558
|
+
})) : true
|
|
1559
|
+
}, typeof onLoadChildren === 'function' ? {
|
|
1560
|
+
onLoadChildren
|
|
1561
|
+
} : null, typeof onExpandedKeysChange === 'function' ? {
|
|
1562
|
+
onExpandedKeysChange
|
|
1563
|
+
} : null, indentSize != null ? {
|
|
1564
|
+
indentSize
|
|
1565
|
+
} : null, Object.prototype.hasOwnProperty.call(p, 'expandedKeys') ? {
|
|
1566
|
+
expandedKeys
|
|
1567
|
+
} : null, Object.prototype.hasOwnProperty.call(p, 'defaultExpandedKeys') ? {
|
|
1568
|
+
defaultExpandedKeys
|
|
1569
|
+
} : null))) : null), single && footerEl || !isMobile && /*#__PURE__*/React.createElement("div", {
|
|
1542
1570
|
className: classnames(style$2['footer'], 'select-table-footer')
|
|
1543
1571
|
}));
|
|
1544
1572
|
|