@kne/super-select 0.1.48 → 0.1.50
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 +70 -18
- package/dist/index.js +168 -12
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +170 -11
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
React 复杂信息选择组件库,提供列表、表格、树形等多种选择模式,支持单选/多选、搜索、全选等功能
|
|
6
6
|
|
|
7
|
+
### 关键词
|
|
8
|
+
|
|
9
|
+
react, select, picker, multiselect, tree-select, table-select, antd, form, dropdown, searchable, i18n
|
|
10
|
+
|
|
7
11
|
### 安装
|
|
8
12
|
|
|
9
13
|
```shell
|
|
@@ -739,34 +743,40 @@ const SearchableTableExample = ({ isPopup }) => {
|
|
|
739
743
|
|
|
740
744
|
const remoteSearchListFilter = { language: 'zh-CN' };
|
|
741
745
|
|
|
742
|
-
//
|
|
746
|
+
// 模拟分页 loader:根据 currentPage/perPage 切片,保留 filter
|
|
747
|
+
const makePaginatedLoader = (allData, setLastRequest) => request => {
|
|
748
|
+
const params = request?.params || {};
|
|
749
|
+
const snapshot = { params, data: request?.data || {} };
|
|
750
|
+
setTimeout(() => setLastRequest(snapshot), 0);
|
|
751
|
+
const keyword = (params.filter?.keyword || '').toLowerCase();
|
|
752
|
+
const filtered = allData.filter(item => {
|
|
753
|
+
if (!keyword) return true;
|
|
754
|
+
return item.name.toLowerCase().includes(keyword) || item.email.toLowerCase().includes(keyword) || item.department.toLowerCase().includes(keyword);
|
|
755
|
+
});
|
|
756
|
+
const currentPage = params.currentPage || 1;
|
|
757
|
+
const perPage = params.perPage || 5;
|
|
758
|
+
const start = (currentPage - 1) * perPage;
|
|
759
|
+
const pageData = filtered.slice(start, start + perPage);
|
|
760
|
+
return { pageData, totalCount: filtered.length };
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
// 远程搜索 + 分页器(默认 pagination.open=true)
|
|
743
764
|
const RemoteSearchTableExample = ({ isPopup }) => {
|
|
744
765
|
const [value, setValue] = useState([]);
|
|
745
766
|
const [lastRequest, setLastRequest] = useState(null);
|
|
746
767
|
const api = React.useMemo(
|
|
747
768
|
() => ({
|
|
748
|
-
params: { filter: remoteSearchListFilter },
|
|
749
|
-
loader:
|
|
750
|
-
const snapshot = { params: request?.params || {}, data: request?.data || {} };
|
|
751
|
-
setTimeout(() => setLastRequest(snapshot), 0);
|
|
752
|
-
const keyword = (snapshot.params.filter?.keyword || '').toLowerCase();
|
|
753
|
-
const pageData = employeeOptions.filter(item => {
|
|
754
|
-
if (!keyword) {
|
|
755
|
-
return true;
|
|
756
|
-
}
|
|
757
|
-
return item.name.toLowerCase().includes(keyword) || item.email.toLowerCase().includes(keyword) || item.department.toLowerCase().includes(keyword);
|
|
758
|
-
});
|
|
759
|
-
return { pageData, totalCount: pageData.length };
|
|
760
|
-
}
|
|
769
|
+
params: { filter: remoteSearchListFilter, perPage: 5, currentPage: 1 },
|
|
770
|
+
loader: makePaginatedLoader(employeeOptions, setLastRequest)
|
|
761
771
|
}),
|
|
762
772
|
[]
|
|
763
773
|
);
|
|
764
774
|
|
|
765
775
|
return (
|
|
766
776
|
<Flex vertical gap={8}>
|
|
767
|
-
<span
|
|
777
|
+
<span>远程搜索 + 分页器(验证翻页 filter 不丢):</span>
|
|
768
778
|
<div style={{ color: '#666', fontSize: 12, lineHeight: 1.6 }}>
|
|
769
|
-
|
|
779
|
+
每页 5 条,共 25 条。翻页后观察下方请求参数:params.filter.language 应始终为 zh-CN;搜索后翻页 keyword 也不丢。
|
|
770
780
|
</div>
|
|
771
781
|
<SelectTableList
|
|
772
782
|
api={api}
|
|
@@ -790,6 +800,46 @@ const RemoteSearchTableExample = ({ isPopup }) => {
|
|
|
790
800
|
);
|
|
791
801
|
};
|
|
792
802
|
|
|
803
|
+
// 远程搜索 + 下拉加载(pagination.open=false)
|
|
804
|
+
const RemoteSearchLoadMoreExample = ({ isPopup }) => {
|
|
805
|
+
const [value, setValue] = useState([]);
|
|
806
|
+
const [lastRequest, setLastRequest] = useState(null);
|
|
807
|
+
const api = React.useMemo(
|
|
808
|
+
() => ({
|
|
809
|
+
params: { filter: remoteSearchListFilter, perPage: 5, currentPage: 1 },
|
|
810
|
+
loader: makePaginatedLoader(employeeOptions, setLastRequest)
|
|
811
|
+
}),
|
|
812
|
+
[]
|
|
813
|
+
);
|
|
814
|
+
|
|
815
|
+
return (
|
|
816
|
+
<Flex vertical gap={8}>
|
|
817
|
+
<span>远程搜索 + 下拉加载(验证 open=false 自动 loadMore):</span>
|
|
818
|
+
<div style={{ color: '#666', fontSize: 12, lineHeight: 1.6 }}>
|
|
819
|
+
每页 5 条,无分页器。滚动到底部自动加载下一页,数据追加显示。翻页时 filter.language 不丢。
|
|
820
|
+
</div>
|
|
821
|
+
<SelectTableList
|
|
822
|
+
api={api}
|
|
823
|
+
columns={employeeColumns}
|
|
824
|
+
valueKey="id"
|
|
825
|
+
labelKey="name"
|
|
826
|
+
value={value}
|
|
827
|
+
onChange={setValue}
|
|
828
|
+
isPopup={isPopup}
|
|
829
|
+
placeholder="搜索姓名、邮箱或部门"
|
|
830
|
+
getSearchProps={({ searchText }) => ({
|
|
831
|
+
filter: Object.assign({}, remoteSearchListFilter, searchText ? { keyword: searchText } : {})
|
|
832
|
+
})}
|
|
833
|
+
pagination={{ open: false, paramsType: 'params' }}
|
|
834
|
+
style={{ width: 600 }}
|
|
835
|
+
/>
|
|
836
|
+
{lastRequest ? (
|
|
837
|
+
<pre style={{ margin: 0, fontSize: 12, background: '#f5f5f5', padding: 8, borderRadius: 4, overflow: 'auto' }}>{JSON.stringify(lastRequest, null, 2)}</pre>
|
|
838
|
+
) : null}
|
|
839
|
+
</Flex>
|
|
840
|
+
);
|
|
841
|
+
};
|
|
842
|
+
|
|
793
843
|
// 全选功能
|
|
794
844
|
const SelectAllTableExample = ({ isPopup }) => {
|
|
795
845
|
const [value, setValue] = useState([]);
|
|
@@ -1322,6 +1372,8 @@ const BaseExample = () => {
|
|
|
1322
1372
|
<Divider />
|
|
1323
1373
|
<RemoteSearchTableExample isPopup={isPopup} />
|
|
1324
1374
|
<Divider />
|
|
1375
|
+
<RemoteSearchLoadMoreExample isPopup={isPopup} />
|
|
1376
|
+
<Divider />
|
|
1325
1377
|
<SelectAllTableExample isPopup={isPopup} />
|
|
1326
1378
|
<Divider />
|
|
1327
1379
|
<WideTableExample isPopup={isPopup} />
|
|
@@ -2557,7 +2609,7 @@ render(<BaseExample />);
|
|
|
2557
2609
|
|
|
2558
2610
|
#### SelectTableList
|
|
2559
2611
|
|
|
2560
|
-
表格形式的选择组件,适用于需要展示多列数据的选择场景。基于 `@kne/table-
|
|
2612
|
+
表格形式的选择组件,适用于需要展示多列数据的选择场景。基于 `@kne/table-view` 的 `Table` 与 `@kne/react-fetch`,支持普通列表与树形(`tree` / `treeList`)选择;桌面端滚动时表头固定,横向滚动条吸附在可视区域底部。
|
|
2561
2613
|
|
|
2562
2614
|
| 属性名 | 说明 | 类型 | 默认值 |
|
|
2563
2615
|
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | --------------- |
|
|
@@ -2587,7 +2639,7 @@ render(<BaseExample />);
|
|
|
2587
2639
|
|
|
2588
2640
|
树形说明:
|
|
2589
2641
|
|
|
2590
|
-
- `tree` / `treeList` 能力透传自 `@kne/table-
|
|
2642
|
+
- `tree` / `treeList` 能力透传自 `@kne/table-view`(展开收起、缩进、半选、移动端面包屑等)
|
|
2591
2643
|
- 搜索(`getSearchCallback`)在 `tree` 下递归过滤并保留祖先;在 `treeList` 下匹配节点时自动带上祖先路径
|
|
2592
2644
|
- 懒加载示例:`onLoadChildren` 内用包导出的 `mergeTreeChildren` 更新 `options`
|
|
2593
2645
|
|
package/dist/index.js
CHANGED
|
@@ -19,13 +19,13 @@ var SearchInput = require('@kne/search-input');
|
|
|
19
19
|
var scrollLoader = require('@kne/scroll-loader');
|
|
20
20
|
require('@kne/scroll-loader/dist/index.css');
|
|
21
21
|
var merge = require('lodash/merge');
|
|
22
|
-
var
|
|
23
|
-
require('@kne/table-
|
|
22
|
+
var tableView = require('@kne/table-view');
|
|
23
|
+
require('@kne/table-view/dist/index.css');
|
|
24
|
+
var Fetch = require('@kne/react-fetch');
|
|
24
25
|
var infoPage = require('@kne/info-page');
|
|
25
26
|
require('@kne/info-page/dist/index.css');
|
|
26
27
|
var memoize = require('lodash/memoize');
|
|
27
28
|
var isNil = require('lodash/isNil');
|
|
28
|
-
var Fetch = require('@kne/react-fetch');
|
|
29
29
|
|
|
30
30
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
31
31
|
|
|
@@ -39,10 +39,9 @@ var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
|
|
|
39
39
|
var SimpleBar__default = /*#__PURE__*/_interopDefaultLegacy(SimpleBar);
|
|
40
40
|
var SearchInput__default = /*#__PURE__*/_interopDefaultLegacy(SearchInput);
|
|
41
41
|
var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
|
|
42
|
-
var
|
|
42
|
+
var Fetch__default = /*#__PURE__*/_interopDefaultLegacy(Fetch);
|
|
43
43
|
var memoize__default = /*#__PURE__*/_interopDefaultLegacy(memoize);
|
|
44
44
|
var isNil__default = /*#__PURE__*/_interopDefaultLegacy(isNil);
|
|
45
|
-
var Fetch__default = /*#__PURE__*/_interopDefaultLegacy(Fetch);
|
|
46
45
|
|
|
47
46
|
function _extends() {
|
|
48
47
|
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -1197,6 +1196,163 @@ const SelectList = React.forwardRef((_ref, ref) => {
|
|
|
1197
1196
|
|
|
1198
1197
|
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"};
|
|
1199
1198
|
|
|
1199
|
+
const defaultDataFormat = data => ({
|
|
1200
|
+
list: data?.pageData,
|
|
1201
|
+
total: data?.totalCount,
|
|
1202
|
+
data
|
|
1203
|
+
});
|
|
1204
|
+
const FetchTableContent = ({
|
|
1205
|
+
data,
|
|
1206
|
+
reload,
|
|
1207
|
+
refresh,
|
|
1208
|
+
requestParams,
|
|
1209
|
+
fetchProps,
|
|
1210
|
+
dataFormat = defaultDataFormat,
|
|
1211
|
+
pagination,
|
|
1212
|
+
columns,
|
|
1213
|
+
columnRenderProps,
|
|
1214
|
+
...tableProps
|
|
1215
|
+
}) => {
|
|
1216
|
+
const paginationMerged = Object.assign({
|
|
1217
|
+
open: true,
|
|
1218
|
+
paramsType: 'data',
|
|
1219
|
+
requestType: 'reload',
|
|
1220
|
+
currentName: 'currentPage',
|
|
1221
|
+
pageSizeName: 'perPage',
|
|
1222
|
+
pageSize: 20,
|
|
1223
|
+
showSizeChanger: false,
|
|
1224
|
+
showQuickJumper: false,
|
|
1225
|
+
hideOnSinglePage: true
|
|
1226
|
+
}, pagination);
|
|
1227
|
+
const formatData = dataFormat(data);
|
|
1228
|
+
const tableContext = Object.assign({}, columnRenderProps, {
|
|
1229
|
+
data,
|
|
1230
|
+
requestParams,
|
|
1231
|
+
fetchProps
|
|
1232
|
+
});
|
|
1233
|
+
const currentPage = get__default["default"](requestParams, [paginationMerged.paramsType, paginationMerged.currentName], 1);
|
|
1234
|
+
const currentPageSize = Number(get__default["default"](requestParams, [paginationMerged.paramsType, paginationMerged.pageSizeName], paginationMerged.pageSize)) || paginationMerged.pageSize || 20;
|
|
1235
|
+
const hasMore = formatData.total > currentPage * currentPageSize;
|
|
1236
|
+
const showPagination = paginationMerged.open && formatData.total > 0;
|
|
1237
|
+
const isLoadMoreMode = !paginationMerged.open;
|
|
1238
|
+
const [accumulatedList, setAccumulatedList] = React.useState([]);
|
|
1239
|
+
const [isLoadingMore, setIsLoadingMore] = React.useState(false);
|
|
1240
|
+
const isLoadingMoreRef = React.useRef(false);
|
|
1241
|
+
const prevDataRef = React.useRef(null);
|
|
1242
|
+
const containerRef = React.useRef(null);
|
|
1243
|
+
React.useEffect(() => {
|
|
1244
|
+
if (!isLoadMoreMode) return;
|
|
1245
|
+
if (data === prevDataRef.current) return;
|
|
1246
|
+
prevDataRef.current = data;
|
|
1247
|
+
const newList = formatData.list || [];
|
|
1248
|
+
if (currentPage <= 1) {
|
|
1249
|
+
setAccumulatedList(newList);
|
|
1250
|
+
} else {
|
|
1251
|
+
setAccumulatedList(prev => prev.concat(newList));
|
|
1252
|
+
}
|
|
1253
|
+
setIsLoadingMore(false);
|
|
1254
|
+
isLoadingMoreRef.current = false;
|
|
1255
|
+
}, [data, isLoadMoreMode, currentPage, formatData.list]);
|
|
1256
|
+
const doLoadNextPage = React.useCallback(() => {
|
|
1257
|
+
if (isLoadingMoreRef.current || !hasMore || !isLoadMoreMode) return;
|
|
1258
|
+
isLoadingMoreRef.current = true;
|
|
1259
|
+
setIsLoadingMore(true);
|
|
1260
|
+
const nextPage = currentPage + 1;
|
|
1261
|
+
const currentParams = get__default["default"](requestParams, paginationMerged.paramsType, {});
|
|
1262
|
+
(paginationMerged.requestType === 'refresh' ? refresh : reload)({
|
|
1263
|
+
[paginationMerged.paramsType]: Object.assign({}, currentParams, {
|
|
1264
|
+
[paginationMerged.currentName]: nextPage,
|
|
1265
|
+
[paginationMerged.pageSizeName]: currentPageSize
|
|
1266
|
+
})
|
|
1267
|
+
});
|
|
1268
|
+
}, [hasMore, isLoadMoreMode, currentPage, requestParams, paginationMerged, refresh, reload, currentPageSize]);
|
|
1269
|
+
React.useEffect(() => {
|
|
1270
|
+
if (!isLoadMoreMode) return;
|
|
1271
|
+
const container = containerRef.current;
|
|
1272
|
+
if (!container) return;
|
|
1273
|
+
const scrollEl = container.querySelector('.ant-table-body') || container.closest('.select-table-list-scroll-list');
|
|
1274
|
+
if (!scrollEl) return;
|
|
1275
|
+
const onScroll = () => {
|
|
1276
|
+
const {
|
|
1277
|
+
scrollTop,
|
|
1278
|
+
scrollHeight,
|
|
1279
|
+
clientHeight
|
|
1280
|
+
} = scrollEl;
|
|
1281
|
+
if (scrollHeight - scrollTop - clientHeight < 50) {
|
|
1282
|
+
doLoadNextPage();
|
|
1283
|
+
}
|
|
1284
|
+
};
|
|
1285
|
+
scrollEl.addEventListener('scroll', onScroll, {
|
|
1286
|
+
passive: true
|
|
1287
|
+
});
|
|
1288
|
+
return () => scrollEl.removeEventListener('scroll', onScroll);
|
|
1289
|
+
}, [isLoadMoreMode, doLoadNextPage]);
|
|
1290
|
+
|
|
1291
|
+
// 如果当前列表高度没有超过容器(弹窗模式可能不出现滚动条),
|
|
1292
|
+
// 仅靠 scroll 事件无法触发 loadMore:自动补页直到出现溢出或没有更多。
|
|
1293
|
+
const autoLoadCountRef = React.useRef(0);
|
|
1294
|
+
React.useEffect(() => {
|
|
1295
|
+
if (!isLoadMoreMode) return;
|
|
1296
|
+
if (isLoadingMoreRef.current) return;
|
|
1297
|
+
if (!hasMore) return;
|
|
1298
|
+
const container = containerRef.current;
|
|
1299
|
+
if (!container) return;
|
|
1300
|
+
const scrollEl = container.querySelector('.ant-table-body') || container.closest('.select-table-list-scroll-list');
|
|
1301
|
+
if (!scrollEl) return;
|
|
1302
|
+
const isOverflowing = scrollEl.scrollHeight > scrollEl.clientHeight + 1;
|
|
1303
|
+
if (isOverflowing) {
|
|
1304
|
+
autoLoadCountRef.current = 0;
|
|
1305
|
+
return;
|
|
1306
|
+
}
|
|
1307
|
+
if (autoLoadCountRef.current >= 5) return;
|
|
1308
|
+
autoLoadCountRef.current += 1;
|
|
1309
|
+
setTimeout(() => doLoadNextPage(), 0);
|
|
1310
|
+
}, [isLoadMoreMode, hasMore, data, currentPage, currentPageSize, doLoadNextPage]);
|
|
1311
|
+
const displayList = isLoadMoreMode ? accumulatedList : formatData.list || [];
|
|
1312
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1313
|
+
ref: containerRef
|
|
1314
|
+
}, /*#__PURE__*/React__default["default"].createElement(tableView.Table, _extends({}, tableProps, {
|
|
1315
|
+
dataSource: displayList,
|
|
1316
|
+
pagination: false,
|
|
1317
|
+
columns: columns,
|
|
1318
|
+
context: tableContext,
|
|
1319
|
+
columnRenderProps: tableContext
|
|
1320
|
+
})), showPagination ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1321
|
+
style: {
|
|
1322
|
+
padding: '8px 12px',
|
|
1323
|
+
display: 'flex',
|
|
1324
|
+
justifyContent: 'flex-end'
|
|
1325
|
+
}
|
|
1326
|
+
}, /*#__PURE__*/React__default["default"].createElement(antd.Pagination, {
|
|
1327
|
+
size: "small",
|
|
1328
|
+
total: formatData.total,
|
|
1329
|
+
current: currentPage,
|
|
1330
|
+
pageSize: currentPageSize,
|
|
1331
|
+
showSizeChanger: paginationMerged.showSizeChanger,
|
|
1332
|
+
showQuickJumper: paginationMerged.showQuickJumper,
|
|
1333
|
+
hideOnSinglePage: paginationMerged.hideOnSinglePage,
|
|
1334
|
+
onChange: (page, size) => {
|
|
1335
|
+
const currentParams = get__default["default"](requestParams, paginationMerged.paramsType, {});
|
|
1336
|
+
(paginationMerged.requestType === 'refresh' ? refresh : reload)({
|
|
1337
|
+
[paginationMerged.paramsType]: Object.assign({}, currentParams, {
|
|
1338
|
+
[paginationMerged.currentName]: page,
|
|
1339
|
+
[paginationMerged.pageSizeName]: size
|
|
1340
|
+
})
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
})) : null, isLoadMoreMode ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1344
|
+
style: {
|
|
1345
|
+
textAlign: 'center',
|
|
1346
|
+
padding: '8px 0',
|
|
1347
|
+
color: '#999',
|
|
1348
|
+
fontSize: 12,
|
|
1349
|
+
height: 32,
|
|
1350
|
+
visibility: isLoadingMore ? 'visible' : 'hidden'
|
|
1351
|
+
}
|
|
1352
|
+
}, "\u52A0\u8F7D\u4E2D...") : null);
|
|
1353
|
+
};
|
|
1354
|
+
const FetchTable = Fetch.withFetch(FetchTableContent);
|
|
1355
|
+
|
|
1200
1356
|
const isEmptyParentKey = value => value == null || value === '';
|
|
1201
1357
|
const flattenSelectList = (list, _ref) => {
|
|
1202
1358
|
let {
|
|
@@ -1205,16 +1361,16 @@ const flattenSelectList = (list, _ref) => {
|
|
|
1205
1361
|
parentKey,
|
|
1206
1362
|
childrenKey
|
|
1207
1363
|
} = _ref;
|
|
1208
|
-
if (!list || !
|
|
1364
|
+
if (!list || !tableView.isTreeDataType(dataType)) {
|
|
1209
1365
|
return list || [];
|
|
1210
1366
|
}
|
|
1211
|
-
const tree =
|
|
1367
|
+
const tree = tableView.normalizeTreeData(list, {
|
|
1212
1368
|
dataType,
|
|
1213
1369
|
rowKey,
|
|
1214
1370
|
parentKey,
|
|
1215
1371
|
childrenKey
|
|
1216
1372
|
});
|
|
1217
|
-
return
|
|
1373
|
+
return tableView.flattenAllTree(tree, {
|
|
1218
1374
|
rowKey,
|
|
1219
1375
|
childrenKey
|
|
1220
1376
|
}).map(row => row.item);
|
|
@@ -1424,7 +1580,7 @@ const SelectTableList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
1424
1580
|
};
|
|
1425
1581
|
}
|
|
1426
1582
|
} : merge__default["default"]({}, api, searchRequestProps);
|
|
1427
|
-
const allColumnsHaveWidth = Array.isArray(columns) && columns.length > 0 && columns.every(
|
|
1583
|
+
const allColumnsHaveWidth = Array.isArray(columns) && columns.length > 0 && columns.every(tableView.hasColumnWidth);
|
|
1428
1584
|
const tableSelection = {
|
|
1429
1585
|
allowSelectedAll,
|
|
1430
1586
|
isSelectedAll,
|
|
@@ -1537,13 +1693,13 @@ const SelectTableList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
1537
1693
|
'is-popup': isPopup,
|
|
1538
1694
|
[style$2['is-fit-columns']]: !allColumnsHaveWidth
|
|
1539
1695
|
})
|
|
1540
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
1696
|
+
}, /*#__PURE__*/React__default["default"].createElement(FetchTable, _extends({}, tablePageFetchConfig, {
|
|
1541
1697
|
ref: tablePageRef
|
|
1542
1698
|
}, dataFormat ? {
|
|
1543
1699
|
dataFormat
|
|
1544
1700
|
} : null, {
|
|
1545
1701
|
pagination: Object.assign({
|
|
1546
|
-
open:
|
|
1702
|
+
open: true,
|
|
1547
1703
|
showSizeChanger: false,
|
|
1548
1704
|
showQuickJumper: false,
|
|
1549
1705
|
hideOnSinglePage: true
|
|
@@ -2700,7 +2856,7 @@ const SelectCascader = _ref4 => {
|
|
|
2700
2856
|
|
|
2701
2857
|
Object.defineProperty(exports, 'mergeTreeChildren', {
|
|
2702
2858
|
enumerable: true,
|
|
2703
|
-
get: function () { return
|
|
2859
|
+
get: function () { return tableView.mergeTreeChildren; }
|
|
2704
2860
|
});
|
|
2705
2861
|
exports.SelectCascader = SelectCascader;
|
|
2706
2862
|
exports.SelectInput = SelectInput;
|