vue-devui 1.0.0-rc.11 → 1.0.0-rc.12

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.
Files changed (94) hide show
  1. package/README.md +2 -2
  2. package/auto-complete/index.es.js +29 -8
  3. package/auto-complete/index.umd.js +16 -16
  4. package/auto-complete/style.css +1 -1
  5. package/badge/index.es.js +3 -1
  6. package/badge/index.umd.js +1 -1
  7. package/button/index.es.js +3 -2
  8. package/button/index.umd.js +6 -6
  9. package/collapse/index.es.js +20 -186
  10. package/collapse/index.umd.js +1 -1
  11. package/collapse/style.css +1 -1
  12. package/countdown/index.es.js +56 -13
  13. package/countdown/index.umd.js +1 -1
  14. package/{date-picker → date-picker-pro}/index.d.ts +0 -0
  15. package/date-picker-pro/index.es.js +10856 -0
  16. package/date-picker-pro/index.umd.js +27 -0
  17. package/date-picker-pro/package.json +7 -0
  18. package/date-picker-pro/style.css +1 -0
  19. package/dropdown/index.es.js +1 -1
  20. package/dropdown/index.umd.js +1 -1
  21. package/editable-select/index.es.js +98 -56
  22. package/editable-select/index.umd.js +1 -1
  23. package/editable-select/style.css +1 -1
  24. package/icon/index.es.js +3 -2
  25. package/icon/index.umd.js +1 -1
  26. package/input/index.es.js +35 -8
  27. package/input/index.umd.js +7 -7
  28. package/input/style.css +1 -1
  29. package/modal/index.es.js +3 -2
  30. package/modal/index.umd.js +1 -1
  31. package/modal/style.css +1 -1
  32. package/notification/index.es.js +3 -2
  33. package/notification/index.umd.js +1 -1
  34. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  35. package/nuxt/components/DatePickerPro.js +3 -0
  36. package/nuxt/components/OptionGroup.js +3 -0
  37. package/nuxt/components/Step.js +3 -0
  38. package/nuxt/components/Steps.js +3 -0
  39. package/nuxt/components/TimePicker.js +3 -0
  40. package/nuxt/components/datePickerProCommonProps.js +3 -0
  41. package/nuxt/components/datePickerProPanelProps.js +3 -0
  42. package/nuxt/components/datePickerProProps.js +3 -0
  43. package/nuxt/components/stepProps.js +3 -0
  44. package/nuxt/components/stepsProps.js +3 -0
  45. package/nuxt/components/timerPickerPanelProps.js +3 -0
  46. package/package.json +1 -1
  47. package/pagination/index.es.js +25 -7
  48. package/pagination/index.umd.js +1 -1
  49. package/result/index.es.js +3 -2
  50. package/result/index.umd.js +1 -1
  51. package/search/index.es.js +39 -10
  52. package/search/index.umd.js +7 -7
  53. package/search/style.css +1 -1
  54. package/select/index.es.js +156 -219
  55. package/select/index.umd.js +13 -13
  56. package/select/style.css +1 -1
  57. package/splitter/index.es.js +27 -7
  58. package/splitter/index.umd.js +10 -10
  59. package/steps/index.d.ts +7 -0
  60. package/steps/index.es.js +385 -0
  61. package/steps/index.umd.js +1 -0
  62. package/{date-picker → steps}/package.json +1 -1
  63. package/steps/style.css +1 -0
  64. package/style.css +1 -1
  65. package/table/index.es.js +542 -267
  66. package/table/index.umd.js +15 -15
  67. package/table/style.css +1 -1
  68. package/tabs/index.es.js +1 -1
  69. package/tabs/index.umd.js +1 -1
  70. package/tabs/style.css +1 -1
  71. package/time-picker/index.d.ts +7 -0
  72. package/{date-picker → time-picker}/index.es.js +1371 -1038
  73. package/time-picker/index.umd.js +27 -0
  74. package/time-picker/package.json +7 -0
  75. package/time-picker/style.css +1 -0
  76. package/time-select/index.es.js +157 -219
  77. package/time-select/index.umd.js +14 -14
  78. package/time-select/style.css +1 -1
  79. package/timeline/index.es.js +3 -2
  80. package/timeline/index.umd.js +1 -1
  81. package/tooltip/index.es.js +1 -1
  82. package/tooltip/index.umd.js +1 -1
  83. package/tree/index.es.js +186 -59
  84. package/tree/index.umd.js +16 -16
  85. package/tree/style.css +1 -1
  86. package/upload/index.es.js +51 -25
  87. package/upload/index.umd.js +1 -1
  88. package/upload/style.css +1 -1
  89. package/vue-devui.es.js +3963 -1421
  90. package/vue-devui.umd.js +23 -23
  91. package/date-picker/index.umd.js +0 -27
  92. package/date-picker/style.css +0 -1
  93. package/nuxt/components/DatePicker.js +0 -3
  94. package/nuxt/components/StickSlider.js +0 -3
package/table/index.es.js CHANGED
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
33
33
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
34
  return value;
35
35
  };
36
- import { computed, ref, watchEffect, getCurrentInstance, watch, unref, defineComponent, inject, createVNode, toRefs, onMounted, onUnmounted, Transition, mergeProps, nextTick, Comment, Text, h, Fragment, withDirectives, cloneVNode, provide, Teleport, vShow, resolveDynamicComponent, render, resolveDirective, toRef, reactive, createTextVNode, onBeforeUnmount, isVNode, onBeforeMount } from "vue";
36
+ import { computed, ref, watchEffect, watch, getCurrentInstance, unref, defineComponent, inject, createVNode, toRefs, onMounted, onUnmounted, Transition, mergeProps, nextTick, Comment, Text, h, Fragment, withDirectives, cloneVNode, provide, Teleport, vShow, resolveDynamicComponent, render, resolveDirective, toRef, reactive, createTextVNode, onBeforeUnmount, isVNode, onBeforeMount } from "vue";
37
37
  import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
38
38
  import { onClickOutside } from "@vueuse/core";
39
39
  const tableProps = {
@@ -111,7 +111,8 @@ const tableProps = {
111
111
  default: true
112
112
  },
113
113
  rowKey: {
114
- type: String
114
+ type: [Function, String],
115
+ default: "id"
115
116
  },
116
117
  defaultExpandAll: {
117
118
  type: Boolean,
@@ -120,8 +121,9 @@ const tableProps = {
120
121
  expandRowKeys: {
121
122
  type: Array
122
123
  },
123
- trackBy: {
124
- type: Function
124
+ indent: {
125
+ type: Number,
126
+ default: 16
125
127
  }
126
128
  };
127
129
  const TABLE_TOKEN = Symbol();
@@ -166,18 +168,18 @@ function useTable(props, tableWidth) {
166
168
  }));
167
169
  return { classes, styles };
168
170
  }
169
- const useFixedColumn = (column) => {
171
+ const useFixedColumn = (column2) => {
170
172
  const ns2 = useNamespace("table");
171
173
  const stickyClass = computed(() => ({
172
- [ns2.e("checkable-cell")]: column.value.type === "checkable",
173
- [ns2.m("sticky-cell")]: Boolean(column.value.fixedLeft) || Boolean(column.value.fixedRight),
174
- left: Boolean(column.value.fixedLeft),
175
- right: Boolean(column.value.fixedRight),
176
- [`is-${column.value.align}`]: true
174
+ [ns2.e("checkable-cell")]: column2.value.type === "checkable",
175
+ [ns2.m("sticky-cell")]: Boolean(column2.value.fixedLeft) || Boolean(column2.value.fixedRight),
176
+ left: Boolean(column2.value.fixedLeft),
177
+ right: Boolean(column2.value.fixedRight),
178
+ [`is-${column2.value.align}`]: true
177
179
  }));
178
180
  const stickyStyle = computed(() => ({
179
- left: column.value.fixedLeft,
180
- right: column.value.fixedRight
181
+ left: column2.value.fixedLeft,
182
+ right: column2.value.fixedRight
181
183
  }));
182
184
  return { stickyClass, stickyStyle };
183
185
  };
@@ -191,15 +193,15 @@ function useTableLayout(table2) {
191
193
  }
192
194
  const flatColumns = table2.store.states.flatColumns;
193
195
  const columnMap = {};
194
- flatColumns.value.forEach((column) => {
195
- columnMap[column.id] = column;
196
+ flatColumns.value.forEach((column2) => {
197
+ columnMap[column2.id] = column2;
196
198
  });
197
199
  for (let i = 0, len = cols.length; i < len; i++) {
198
200
  const col = cols[i];
199
201
  const columnId = col.getAttribute("column-id");
200
- const column = columnMap[columnId];
201
- if (column) {
202
- col.setAttribute("width", column.realWidth);
202
+ const column2 = columnMap[columnId];
203
+ if (column2) {
204
+ col.setAttribute("width", column2.realWidth);
203
205
  }
204
206
  }
205
207
  };
@@ -208,39 +210,39 @@ function useTableLayout(table2) {
208
210
  const tableClientWidth = (_b = (_a = table2 == null ? void 0 : table2.vnode) == null ? void 0 : _a.el) == null ? void 0 : _b.clientWidth;
209
211
  let tableMinWidth = 0;
210
212
  const flatColumns = table2.store.states.flatColumns;
211
- const flexColumns = flatColumns.value.filter((column) => typeof column.width !== "number");
213
+ const flexColumns = flatColumns.value.filter((column2) => typeof column2.width !== "number");
212
214
  if (flexColumns.length) {
213
- flatColumns.value.forEach((column) => {
214
- tableMinWidth += Number(column.width || 80);
215
+ flatColumns.value.forEach((column2) => {
216
+ tableMinWidth += Number(column2.width || 80);
215
217
  });
216
218
  if (tableMinWidth <= tableClientWidth) {
217
219
  const totalFlexWidth = tableClientWidth - tableMinWidth;
218
220
  if (flexColumns.length === 1) {
219
221
  flexColumns[0].realWidth = Number(flexColumns[0].width || 80) + totalFlexWidth;
220
222
  } else {
221
- const allFlexColumnWidth = flexColumns.reduce((pre, column) => pre + Number(column.width || 80), 0);
223
+ const allFlexColumnWidth = flexColumns.reduce((pre, column2) => pre + Number(column2.width || 80), 0);
222
224
  const flexWidthPercent = totalFlexWidth / allFlexColumnWidth;
223
225
  let exceptFistWidth = 0;
224
- flexColumns.forEach((column, index2) => {
226
+ flexColumns.forEach((column2, index2) => {
225
227
  if (index2 === 0) {
226
228
  return;
227
229
  }
228
- const perFlexWidth = Math.floor(Number(column.width || 80) * flexWidthPercent);
230
+ const perFlexWidth = Math.floor(Number(column2.width || 80) * flexWidthPercent);
229
231
  exceptFistWidth += perFlexWidth;
230
- column.realWidth = Number(column.width || 80) + perFlexWidth;
232
+ column2.realWidth = Number(column2.width || 80) + perFlexWidth;
231
233
  });
232
234
  flexColumns[0].realWidth = Number(flexColumns[0].width || 80) + totalFlexWidth - exceptFistWidth;
233
235
  }
234
236
  } else {
235
- flexColumns.forEach((column) => {
236
- column.realWidth = Number(column.width || 80);
237
+ flexColumns.forEach((column2) => {
238
+ column2.realWidth = Number(column2.width || 80);
237
239
  });
238
240
  }
239
241
  tableWidth.value = Math.max(tableMinWidth, tableClientWidth);
240
242
  } else {
241
- flatColumns.value.forEach((column) => {
242
- column.realWidth = column.width || 80;
243
- tableMinWidth += Number(column.realWidth);
243
+ flatColumns.value.forEach((column2) => {
244
+ column2.realWidth = column2.width || 80;
245
+ tableMinWidth += Number(column2.realWidth);
244
246
  });
245
247
  tableWidth.value = tableMinWidth;
246
248
  }
@@ -254,6 +256,9 @@ function useTableWatcher(props, store) {
254
256
  store.setExpandRows(props.expandRowKeys);
255
257
  }
256
258
  });
259
+ watch(() => props.data, () => {
260
+ store.updateRows();
261
+ }, { deep: true });
257
262
  }
258
263
  const inBrowser = typeof window !== "undefined";
259
264
  function getElement(element) {
@@ -285,6 +290,8 @@ function lockScroll() {
285
290
  return;
286
291
  }
287
292
  const isBoolean = (value) => typeof value === "boolean";
293
+ const isString = (value) => typeof value === "string";
294
+ const isFunction = (value) => Object.prototype.toString.call(value) === "[object Function]";
288
295
  function formatWidth(width) {
289
296
  if (width === "") {
290
297
  return width;
@@ -294,13 +301,18 @@ function formatWidth(width) {
294
301
  }
295
302
  return parseInt(width, 10) || 80;
296
303
  }
297
- function getRowIdentity(row, rowKey) {
298
- const paths = rowKey.split(".");
299
- let obj = row;
300
- for (const p of paths) {
301
- obj = obj[p];
302
- }
303
- return `${obj}`;
304
+ function getRowIdentity(row, rowKey, index2) {
305
+ if (isFunction(rowKey)) {
306
+ return rowKey(row, index2);
307
+ } else if (isString(rowKey)) {
308
+ const paths = rowKey.split(".");
309
+ let obj = row;
310
+ for (const p of paths) {
311
+ obj = obj[p];
312
+ }
313
+ return `${obj}`;
314
+ }
315
+ return "";
304
316
  }
305
317
  function getRowKeysMap(data, rowKey) {
306
318
  const rowKeyMap = {};
@@ -336,7 +348,31 @@ function toggleRowExpandStatus(rowsArr, row, status) {
336
348
  }
337
349
  return isChanged;
338
350
  }
339
- function useExpand(dataSource) {
351
+ function toggleRowVisible(expand, table2, key) {
352
+ const rowLevelMap = (table2 == null ? void 0 : table2.store.states.rowLevelMap.value) || {};
353
+ const levelKeys = Object.keys(rowLevelMap);
354
+ const hiddenRowKeys = table2 == null ? void 0 : table2.store.states.hiddenRowKeys;
355
+ let start = false;
356
+ for (let index2 = 0; index2 < levelKeys.length; index2++) {
357
+ if (levelKeys[index2] === key) {
358
+ start = true;
359
+ index2++;
360
+ }
361
+ if (start && rowLevelMap[levelKeys[index2]] !== rowLevelMap[key] + 1) {
362
+ break;
363
+ }
364
+ if (start && rowLevelMap[levelKeys[index2]] === rowLevelMap[key] + 1) {
365
+ if (expand) {
366
+ hiddenRowKeys.value = hiddenRowKeys.value.filter((rowKey) => rowKey !== levelKeys[index2]);
367
+ } else {
368
+ if (!hiddenRowKeys.value.includes(levelKeys[index2])) {
369
+ hiddenRowKeys.value.push(levelKeys[index2]);
370
+ }
371
+ }
372
+ }
373
+ }
374
+ }
375
+ function useExpand(dataSource, table2) {
340
376
  const tableInstance = getCurrentInstance();
341
377
  const rowKey = tableInstance.props.rowKey || "";
342
378
  const defaultExpandAll = ref(tableInstance.props.defaultExpandAll);
@@ -359,14 +395,32 @@ function useExpand(dataSource) {
359
395
  return pre;
360
396
  }, []);
361
397
  };
398
+ const isRowExpanded = (row) => {
399
+ return _expandedRows.value.includes(row);
400
+ };
401
+ const doToggleRowVisible = (expand, row) => {
402
+ var _a;
403
+ if ((_a = row.children) == null ? void 0 : _a.length) {
404
+ const key = getRowIdentity(row, rowKey);
405
+ if (expand && isRowExpanded(row)) {
406
+ toggleRowVisible(true, table2, key);
407
+ }
408
+ if (!expand) {
409
+ toggleRowVisible(false, table2, key);
410
+ }
411
+ row.children.forEach((child) => {
412
+ doToggleRowVisible(expand, child);
413
+ });
414
+ }
415
+ };
362
416
  const toggleRowExpansion = (row, expanded) => {
363
417
  const isChanged = toggleRowExpandStatus(_expandedRows.value, row, expanded);
364
418
  if (isChanged) {
365
419
  tableInstance.emit("expand-change", row, _expandedRows.value.slice());
366
420
  }
367
- };
368
- const isRowExpanded = (row) => {
369
- return _expandedRows.value.includes(row);
421
+ if (!table2.store.states.flatColumns.value.some((column2) => column2.type === "expand")) {
422
+ doToggleRowVisible(isRowExpanded(row), row);
423
+ }
370
424
  };
371
425
  return {
372
426
  isRowExpanded,
@@ -375,29 +429,29 @@ function useExpand(dataSource) {
375
429
  toggleRowExpansion
376
430
  };
377
431
  }
378
- function replaceColumn(array4, column) {
432
+ function replaceColumn(array4, column2) {
379
433
  return array4.map((item) => {
380
434
  var _a;
381
- if (item.id === column.id) {
382
- return column;
435
+ if (item.id === column2.id) {
436
+ return column2;
383
437
  } else if ((_a = item.children) == null ? void 0 : _a.length) {
384
- item.children = replaceColumn(item.children, column);
438
+ item.children = replaceColumn(item.children, column2);
385
439
  }
386
440
  return item;
387
441
  });
388
442
  }
389
443
  function doFlattenColumns(columns) {
390
444
  const result = [];
391
- columns.forEach((column) => {
392
- if (column.children) {
393
- result.push.apply(result, doFlattenColumns(column.children));
445
+ columns.forEach((column2) => {
446
+ if (column2.children) {
447
+ result.push.apply(result, doFlattenColumns(column2.children));
394
448
  } else {
395
- result.push(column);
449
+ result.push(column2);
396
450
  }
397
451
  });
398
452
  return result;
399
453
  }
400
- const createColumnGenerator = () => {
454
+ function createColumnGenerator() {
401
455
  const _columns = ref([]);
402
456
  const flatColumns = ref([]);
403
457
  const sortColumn = () => {
@@ -406,24 +460,24 @@ const createColumnGenerator = () => {
406
460
  return ((_a = a.order) != null ? _a : 0) - ((_b = b.order) != null ? _b : 0);
407
461
  });
408
462
  };
409
- const insertColumn = (column, parent) => {
463
+ const insertColumn = (column2, parent) => {
410
464
  const array4 = unref(_columns);
411
465
  let newColumns = [];
412
466
  if (!parent) {
413
- array4.push(column);
467
+ array4.push(column2);
414
468
  newColumns = array4;
415
469
  } else {
416
470
  if (parent && !parent.children) {
417
471
  parent.children = [];
418
472
  }
419
- parent.children.push(column);
473
+ parent.children.push(column2);
420
474
  newColumns = replaceColumn(array4, parent);
421
475
  }
422
476
  sortColumn();
423
477
  _columns.value = newColumns;
424
478
  };
425
- const removeColumn = (column) => {
426
- const i = _columns.value.findIndex((v) => v === column);
479
+ const removeColumn = (column2) => {
480
+ const i = _columns.value.findIndex((v) => v === column2);
427
481
  if (i === -1) {
428
482
  return;
429
483
  }
@@ -432,30 +486,100 @@ const createColumnGenerator = () => {
432
486
  const updateColumns = () => {
433
487
  flatColumns.value = [].concat(doFlattenColumns(_columns.value));
434
488
  };
435
- return { _columns, flatColumns, insertColumn, removeColumn, sortColumn, updateColumns };
436
- };
437
- const createSelection = (dataSource, trackBy) => {
489
+ return {
490
+ _columns,
491
+ flatColumns,
492
+ insertColumn,
493
+ removeColumn,
494
+ sortColumn,
495
+ updateColumns
496
+ };
497
+ }
498
+ function doFlattenRows(dataList, level, rowKey, rowLevelMap, hiddenRowKeys) {
499
+ const result = [];
500
+ dataList.forEach((data) => {
501
+ result.push(data);
502
+ if (level > 0) {
503
+ const key = getRowIdentity(data, rowKey);
504
+ rowLevelMap.value[key] = level;
505
+ hiddenRowKeys.value.push(key);
506
+ }
507
+ if (data.children) {
508
+ rowLevelMap.value[getRowIdentity(data, rowKey)] = level;
509
+ result.push.apply(result, doFlattenRows(data.children, level + 1, rowKey, rowLevelMap, hiddenRowKeys));
510
+ }
511
+ });
512
+ return result;
513
+ }
514
+ function createRowGenerator(dataSource, rowKey, flatColumns) {
515
+ const flatRows = ref([]);
516
+ const hiddenRowKeys = ref([]);
517
+ const rowLevelMap = ref({});
518
+ const firstDefaultColumn = ref("");
519
+ const updateRows = () => {
520
+ const hasExpand = flatColumns.value.some((column2) => column2.type === "expand");
521
+ const result = hasExpand ? dataSource.value : doFlattenRows(dataSource.value, 0, rowKey, rowLevelMap, hiddenRowKeys);
522
+ flatRows.value = [].concat(result);
523
+ };
524
+ const updateFirstDefaultColumn = () => {
525
+ const index2 = flatColumns.value.findIndex((column2) => column2.type === "");
526
+ firstDefaultColumn.value = index2 !== -1 ? flatColumns.value[index2].id : "";
527
+ };
528
+ return {
529
+ flatRows,
530
+ hiddenRowKeys,
531
+ rowLevelMap,
532
+ updateRows,
533
+ firstDefaultColumn,
534
+ updateFirstDefaultColumn
535
+ };
536
+ }
537
+ function createSelection(dataSource, rowKey, flatRows) {
438
538
  const _checkSet = ref(/* @__PURE__ */ new Set());
439
- const checkRow = (toggle, row) => {
539
+ const checkRow = (toggle, row, index2) => {
540
+ const key = getRowIdentity(row, rowKey, index2);
440
541
  if (toggle) {
441
- _checkSet.value.add(trackBy(row));
542
+ _checkSet.value.add(key);
543
+ } else {
544
+ _checkSet.value.delete(key);
545
+ }
546
+ };
547
+ const toggleRowSelection = (row, checked, index2) => {
548
+ const key = getRowIdentity(row, rowKey, index2);
549
+ const isIncluded = _checkSet.value.has(key);
550
+ const addRow = () => {
551
+ _checkSet.value.add(key);
552
+ };
553
+ const deleteRow = () => {
554
+ _checkSet.value.delete(key);
555
+ };
556
+ if (isBoolean(checked)) {
557
+ if (checked && !isIncluded) {
558
+ addRow();
559
+ } else if (!checked && isIncluded) {
560
+ deleteRow();
561
+ }
442
562
  } else {
443
- _checkSet.value.delete(trackBy(row));
563
+ if (isIncluded) {
564
+ deleteRow();
565
+ } else {
566
+ addRow();
567
+ }
444
568
  }
445
569
  };
446
- const isRowChecked = (row) => {
447
- return _checkSet.value.has(trackBy(row));
570
+ const isRowChecked = (row, index2) => {
571
+ return _checkSet.value.has(getRowIdentity(row, rowKey, index2));
448
572
  };
449
573
  const getCheckedRows = () => {
450
- return dataSource.value.filter((item) => isRowChecked(item));
574
+ return flatRows.value.filter((item, index2) => isRowChecked(item, index2));
451
575
  };
452
576
  const _checkAllRecord = ref(false);
453
577
  const _checkAll = computed({
454
578
  get: () => _checkAllRecord.value,
455
579
  set: (val) => {
456
580
  _checkAllRecord.value = val;
457
- dataSource.value.forEach((item) => {
458
- checkRow(val, item);
581
+ dataSource.value.forEach((item, index2) => {
582
+ checkRow(val, item, index2);
459
583
  });
460
584
  }
461
585
  });
@@ -466,9 +590,9 @@ const createSelection = (dataSource, trackBy) => {
466
590
  }
467
591
  let allTrue = true;
468
592
  let allFalse = true;
469
- const items = dataSource.value;
593
+ const items = flatRows.value;
470
594
  for (let i = 0; i < items.length; i++) {
471
- const checked = isRowChecked(items[i]);
595
+ const checked = isRowChecked(items[i], i);
472
596
  allTrue && (allTrue = checked);
473
597
  allFalse && (allFalse = !checked);
474
598
  }
@@ -476,7 +600,7 @@ const createSelection = (dataSource, trackBy) => {
476
600
  _halfChecked.value = !(allFalse || allTrue);
477
601
  }, { immediate: true, deep: true });
478
602
  watch(dataSource, (value) => {
479
- _checkAllRecord.value = value.findIndex((item) => !isRowChecked(item)) === -1;
603
+ _checkAllRecord.value = value.findIndex((item, index2) => !isRowChecked(item, index2)) === -1;
480
604
  });
481
605
  return {
482
606
  _checkSet,
@@ -484,10 +608,11 @@ const createSelection = (dataSource, trackBy) => {
484
608
  _halfChecked,
485
609
  getCheckedRows,
486
610
  checkRow,
487
- isRowChecked
611
+ isRowChecked,
612
+ toggleRowSelection
488
613
  };
489
- };
490
- const createSorter = (dataSource, _data) => {
614
+ }
615
+ function createSorter(dataSource, _data) {
491
616
  const sortData = (direction, sortMethod) => {
492
617
  if (direction === "ASC") {
493
618
  _data.value = _data.value.sort((a, b) => sortMethod ? sortMethod(a, b) ? 1 : -1 : 0);
@@ -499,20 +624,21 @@ const createSorter = (dataSource, _data) => {
499
624
  };
500
625
  const thList = [];
501
626
  return { sortData, thList };
502
- };
503
- const createFixedLogic = (columns) => {
627
+ }
628
+ function createFixedLogic(columns) {
504
629
  const isFixedLeft = computed(() => {
505
630
  return columns.value.reduce((prev, current) => prev || !!current.fixedLeft, false);
506
631
  });
507
632
  return { isFixedLeft };
508
- };
633
+ }
509
634
  function createStore(dataSource, table2) {
510
635
  const _data = ref([]);
511
636
  const { _columns, flatColumns, insertColumn, removeColumn, sortColumn, updateColumns } = createColumnGenerator();
512
- const { _checkAll, _checkSet, _halfChecked, getCheckedRows, isRowChecked, checkRow } = createSelection(_data, table2.props.trackBy);
513
- const { sortData, thList } = createSorter(dataSource, _data);
637
+ const { flatRows, hiddenRowKeys, rowLevelMap, updateRows, firstDefaultColumn, updateFirstDefaultColumn } = createRowGenerator(dataSource, table2.props.rowKey, flatColumns);
638
+ const { _checkAll, _checkSet, _halfChecked, getCheckedRows, isRowChecked, checkRow, toggleRowSelection } = createSelection(_data, table2.props.rowKey, flatRows);
639
+ const { sortData, thList } = createSorter(dataSource, flatRows);
514
640
  const { isFixedLeft } = createFixedLogic(_columns);
515
- const { isRowExpanded, updateExpandRows, setExpandRows, toggleRowExpansion } = useExpand(_data);
641
+ const { isRowExpanded, updateExpandRows, setExpandRows, toggleRowExpansion } = useExpand(_data, table2);
516
642
  watch(dataSource, (value) => {
517
643
  _data.value = [...value];
518
644
  updateExpandRows();
@@ -521,25 +647,32 @@ function createStore(dataSource, table2) {
521
647
  _table: table2,
522
648
  states: {
523
649
  _data,
650
+ flatRows,
651
+ hiddenRowKeys,
652
+ rowLevelMap,
524
653
  _columns,
525
654
  flatColumns,
526
655
  _checkSet,
527
656
  _checkAll,
528
657
  _halfChecked,
529
658
  isFixedLeft,
530
- thList
659
+ thList,
660
+ firstDefaultColumn
531
661
  },
532
662
  insertColumn,
533
663
  sortColumn,
534
664
  removeColumn,
535
665
  updateColumns,
666
+ updateRows,
536
667
  getCheckedRows,
537
668
  sortData,
538
669
  isRowChecked,
539
670
  checkRow,
540
671
  isRowExpanded,
541
672
  setExpandRows,
542
- toggleRowExpansion
673
+ toggleRowExpansion,
674
+ toggleRowSelection,
675
+ updateFirstDefaultColumn
543
676
  };
544
677
  }
545
678
  var ColGroup = defineComponent({
@@ -548,11 +681,11 @@ var ColGroup = defineComponent({
548
681
  const parent = inject(TABLE_TOKEN);
549
682
  const columns = parent == null ? void 0 : parent.store.states.flatColumns;
550
683
  const isFixed = computed(() => (parent == null ? void 0 : parent.props.tableLayout) === "fixed");
551
- return () => createVNode("colgroup", null, [columns == null ? void 0 : columns.value.map((column, index2) => {
684
+ return () => createVNode("colgroup", null, [columns == null ? void 0 : columns.value.map((column2, index2) => {
552
685
  return createVNode("col", {
553
686
  "key": index2,
554
- "column-id": isFixed.value ? column.id : "",
555
- "width": column.type === "expand" ? 60 : isFixed.value ? column.realWidth : column.width || ""
687
+ "column-id": isFixed.value ? column2.id : "",
688
+ "width": column2.type === "expand" ? 60 : isFixed.value ? column2.realWidth : column2.width || ""
556
689
  }, null);
557
690
  })]);
558
691
  }
@@ -1069,9 +1202,9 @@ const FlexibleOverlay = defineComponent({
1069
1202
  }
1070
1203
  });
1071
1204
  const isObject = (val) => val !== null && typeof val === "object";
1072
- const ns$1 = useNamespace("popper-trigger");
1205
+ const ns$3 = useNamespace("popper-trigger");
1073
1206
  function wrapContent(content) {
1074
- return h("span", { class: ns$1.b() }, content);
1207
+ return h("span", { class: ns$3.b() }, content);
1075
1208
  }
1076
1209
  function getFirstValidChild(nodes) {
1077
1210
  for (const child of nodes) {
@@ -1453,6 +1586,7 @@ function useIconDom(props, ctx) {
1453
1586
  var Icon = defineComponent({
1454
1587
  name: "DIcon",
1455
1588
  props: iconProps,
1589
+ emits: ["click"],
1456
1590
  setup(props, ctx) {
1457
1591
  const {
1458
1592
  disabled,
@@ -1468,10 +1602,10 @@ var Icon = defineComponent({
1468
1602
  [ns2.m("operable")]: operable.value
1469
1603
  }));
1470
1604
  const onClick = (e) => {
1471
- e.stopImmediatePropagation();
1472
1605
  if (disabled.value) {
1473
- e.preventDefault();
1606
+ return;
1474
1607
  }
1608
+ ctx.emit("click", e);
1475
1609
  };
1476
1610
  return () => {
1477
1611
  var _a, _b, _c, _d;
@@ -2816,7 +2950,7 @@ var lodash = { exports: {} };
2816
2950
  function baseAt(object4, paths) {
2817
2951
  var index2 = -1, length = paths.length, result2 = Array2(length), skip = object4 == null;
2818
2952
  while (++index2 < length) {
2819
- result2[index2] = skip ? undefined$1 : get(object4, paths[index2]);
2953
+ result2[index2] = skip ? undefined$1 : get2(object4, paths[index2]);
2820
2954
  }
2821
2955
  return result2;
2822
2956
  }
@@ -3026,7 +3160,7 @@ var lodash = { exports: {} };
3026
3160
  }
3027
3161
  function baseFunctions(object4, props) {
3028
3162
  return arrayFilter(props, function(key) {
3029
- return isFunction(object4[key]);
3163
+ return isFunction2(object4[key]);
3030
3164
  });
3031
3165
  }
3032
3166
  function baseGet(object4, path) {
@@ -3189,7 +3323,7 @@ var lodash = { exports: {} };
3189
3323
  if (!isObject2(value) || isMasked(value)) {
3190
3324
  return false;
3191
3325
  }
3192
- var pattern4 = isFunction(value) ? reIsNative : reIsHostCtor;
3326
+ var pattern4 = isFunction2(value) ? reIsNative : reIsHostCtor;
3193
3327
  return pattern4.test(toSource(value));
3194
3328
  }
3195
3329
  function baseIsRegExp(value) {
@@ -3261,7 +3395,7 @@ var lodash = { exports: {} };
3261
3395
  return matchesStrictComparable(toKey(path), srcValue);
3262
3396
  }
3263
3397
  return function(object4) {
3264
- var objValue = get(object4, path);
3398
+ var objValue = get2(object4, path);
3265
3399
  return objValue === undefined$1 && objValue === srcValue ? hasIn(object4, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
3266
3400
  };
3267
3401
  }
@@ -3311,7 +3445,7 @@ var lodash = { exports: {} };
3311
3445
  newValue = objValue;
3312
3446
  if (isArguments(objValue)) {
3313
3447
  newValue = toPlainObject(objValue);
3314
- } else if (!isObject2(objValue) || isFunction(objValue)) {
3448
+ } else if (!isObject2(objValue) || isFunction2(objValue)) {
3315
3449
  newValue = initCloneObject(srcValue);
3316
3450
  }
3317
3451
  } else {
@@ -4613,7 +4747,7 @@ var lodash = { exports: {} };
4613
4747
  function isMasked(func) {
4614
4748
  return !!maskSrcKey && maskSrcKey in func;
4615
4749
  }
4616
- var isMaskable = coreJsData ? isFunction : stubFalse;
4750
+ var isMaskable = coreJsData ? isFunction2 : stubFalse;
4617
4751
  function isPrototype(value) {
4618
4752
  var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
4619
4753
  return value === proto;
@@ -5337,7 +5471,7 @@ var lodash = { exports: {} };
5337
5471
  if (fromIndex < 0) {
5338
5472
  fromIndex = nativeMax(length + fromIndex, 0);
5339
5473
  }
5340
- return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
5474
+ return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
5341
5475
  }
5342
5476
  var invokeMap = baseRest(function(collection, path, args) {
5343
5477
  var index2 = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
@@ -5405,7 +5539,7 @@ var lodash = { exports: {} };
5405
5539
  return 0;
5406
5540
  }
5407
5541
  if (isArrayLike(collection)) {
5408
- return isString(collection) ? stringSize(collection) : collection.length;
5542
+ return isString2(collection) ? stringSize(collection) : collection.length;
5409
5543
  }
5410
5544
  var tag = getTag(collection);
5411
5545
  if (tag == mapTag || tag == setTag) {
@@ -5726,7 +5860,7 @@ var lodash = { exports: {} };
5726
5860
  var isArray = Array2.isArray;
5727
5861
  var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
5728
5862
  function isArrayLike(value) {
5729
- return value != null && isLength(value.length) && !isFunction(value);
5863
+ return value != null && isLength(value.length) && !isFunction2(value);
5730
5864
  }
5731
5865
  function isArrayLikeObject(value) {
5732
5866
  return isObjectLike(value) && isArrayLike(value);
@@ -5778,7 +5912,7 @@ var lodash = { exports: {} };
5778
5912
  function isFinite(value) {
5779
5913
  return typeof value == "number" && nativeIsFinite(value);
5780
5914
  }
5781
- function isFunction(value) {
5915
+ function isFunction2(value) {
5782
5916
  if (!isObject2(value)) {
5783
5917
  return false;
5784
5918
  }
@@ -5840,7 +5974,7 @@ var lodash = { exports: {} };
5840
5974
  return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
5841
5975
  }
5842
5976
  var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
5843
- function isString(value) {
5977
+ function isString2(value) {
5844
5978
  return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
5845
5979
  }
5846
5980
  function isSymbol(value) {
@@ -5865,7 +5999,7 @@ var lodash = { exports: {} };
5865
5999
  return [];
5866
6000
  }
5867
6001
  if (isArrayLike(value)) {
5868
- return isString(value) ? stringToArray(value) : copyArray(value);
6002
+ return isString2(value) ? stringToArray(value) : copyArray(value);
5869
6003
  }
5870
6004
  if (symIterator && value[symIterator]) {
5871
6005
  return iteratorToArray(value[symIterator]());
@@ -5994,7 +6128,7 @@ var lodash = { exports: {} };
5994
6128
  function functionsIn(object4) {
5995
6129
  return object4 == null ? [] : baseFunctions(object4, keysIn(object4));
5996
6130
  }
5997
- function get(object4, path, defaultValue) {
6131
+ function get2(object4, path, defaultValue) {
5998
6132
  var result2 = object4 == null ? undefined$1 : baseGet(object4, path);
5999
6133
  return result2 === undefined$1 ? defaultValue : result2;
6000
6134
  }
@@ -6101,7 +6235,7 @@ var lodash = { exports: {} };
6101
6235
  index2 = length;
6102
6236
  value = defaultValue;
6103
6237
  }
6104
- object4 = isFunction(value) ? value.call(object4) : value;
6238
+ object4 = isFunction2(value) ? value.call(object4) : value;
6105
6239
  }
6106
6240
  return object4;
6107
6241
  }
@@ -6122,7 +6256,7 @@ var lodash = { exports: {} };
6122
6256
  if (isArrLike) {
6123
6257
  accumulator = isArr ? new Ctor() : [];
6124
6258
  } else if (isObject2(object4)) {
6125
- accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object4)) : {};
6259
+ accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object4)) : {};
6126
6260
  } else {
6127
6261
  accumulator = {};
6128
6262
  }
@@ -6539,7 +6673,7 @@ var lodash = { exports: {} };
6539
6673
  object4 = this;
6540
6674
  methodNames = baseFunctions(source, keys(source));
6541
6675
  }
6542
- var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object4);
6676
+ var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object4);
6543
6677
  arrayEach(methodNames, function(methodName) {
6544
6678
  var func = source[methodName];
6545
6679
  object4[methodName] = func;
@@ -6849,7 +6983,7 @@ var lodash = { exports: {} };
6849
6983
  lodash2.forInRight = forInRight;
6850
6984
  lodash2.forOwn = forOwn;
6851
6985
  lodash2.forOwnRight = forOwnRight;
6852
- lodash2.get = get;
6986
+ lodash2.get = get2;
6853
6987
  lodash2.gt = gt;
6854
6988
  lodash2.gte = gte;
6855
6989
  lodash2.has = has;
@@ -6874,7 +7008,7 @@ var lodash = { exports: {} };
6874
7008
  lodash2.isEqualWith = isEqualWith;
6875
7009
  lodash2.isError = isError;
6876
7010
  lodash2.isFinite = isFinite;
6877
- lodash2.isFunction = isFunction;
7011
+ lodash2.isFunction = isFunction2;
6878
7012
  lodash2.isInteger = isInteger;
6879
7013
  lodash2.isLength = isLength;
6880
7014
  lodash2.isMap = isMap;
@@ -6891,7 +7025,7 @@ var lodash = { exports: {} };
6891
7025
  lodash2.isRegExp = isRegExp;
6892
7026
  lodash2.isSafeInteger = isSafeInteger;
6893
7027
  lodash2.isSet = isSet;
6894
- lodash2.isString = isString;
7028
+ lodash2.isString = isString2;
6895
7029
  lodash2.isSymbol = isSymbol;
6896
7030
  lodash2.isTypedArray = isTypedArray;
6897
7031
  lodash2.isUndefined = isUndefined;
@@ -7681,10 +7815,10 @@ function usePopoverEvent(props, visible, origin) {
7681
7815
  });
7682
7816
  return { placement, handlePositionChange, onMouseenter, onMouseleave };
7683
7817
  }
7684
- const ns = useNamespace("popover");
7818
+ const ns$2 = useNamespace("popover");
7685
7819
  function SuccessIcon$1() {
7686
7820
  return createVNode("svg", {
7687
- "class": [ns.e("icon"), ns.em("icon", "success")],
7821
+ "class": [ns$2.e("icon"), ns$2.em("icon", "success")],
7688
7822
  "viewBox": "0 0 16 16",
7689
7823
  "version": "1.1",
7690
7824
  "xmlns": "http://www.w3.org/2000/svg"
@@ -7708,7 +7842,7 @@ function SuccessIcon$1() {
7708
7842
  }
7709
7843
  function WarningIcon() {
7710
7844
  return createVNode("svg", {
7711
- "class": [ns.e("icon"), ns.em("icon", "warning")],
7845
+ "class": [ns$2.e("icon"), ns$2.em("icon", "warning")],
7712
7846
  "viewBox": "0 0 16 16",
7713
7847
  "version": "1.1",
7714
7848
  "xmlns": "http://www.w3.org/2000/svg"
@@ -7725,7 +7859,7 @@ function WarningIcon() {
7725
7859
  }
7726
7860
  function InfoIcon() {
7727
7861
  return createVNode("svg", {
7728
- "class": [ns.e("icon"), ns.em("icon", "info")],
7862
+ "class": [ns$2.e("icon"), ns$2.em("icon", "info")],
7729
7863
  "viewBox": "0 0 16 16",
7730
7864
  "version": "1.1",
7731
7865
  "xmlns": "http://www.w3.org/2000/svg"
@@ -7746,7 +7880,7 @@ function InfoIcon() {
7746
7880
  }
7747
7881
  function ErrorIcon$1() {
7748
7882
  return createVNode("svg", {
7749
- "class": [ns.e("icon"), ns.em("icon", "error")],
7883
+ "class": [ns$2.e("icon"), ns$2.em("icon", "error")],
7750
7884
  "width": "16px",
7751
7885
  "height": "16px",
7752
7886
  "viewBox": "0 0 16 16",
@@ -9727,6 +9861,27 @@ function useFilterSingle(ctx) {
9727
9861
  };
9728
9862
  return { selectedItem, handleSelect };
9729
9863
  }
9864
+ const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
9865
+ function get(object4, path) {
9866
+ const keys = path.split(".");
9867
+ let result = object4;
9868
+ keys.forEach((key) => {
9869
+ var _a;
9870
+ result = (_a = result[key]) != null ? _a : "";
9871
+ });
9872
+ return result;
9873
+ }
9874
+ function createI18nTranslate(name, app, newPrefix) {
9875
+ const prefix = newPrefix || camelize(name) + ".";
9876
+ return (path) => {
9877
+ const messages2 = app == null ? void 0 : app.appContext.config.globalProperties.langMessages.value;
9878
+ const message = get(messages2, prefix + path) || get(messages2, path);
9879
+ return message;
9880
+ };
9881
+ }
9882
+ function _isSlot$1(s) {
9883
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
9884
+ }
9730
9885
  var MultipleFilter = defineComponent({
9731
9886
  props: {
9732
9887
  filterList: {
@@ -9736,37 +9891,42 @@ var MultipleFilter = defineComponent({
9736
9891
  },
9737
9892
  emits: ["confirm"],
9738
9893
  setup(props, ctx) {
9894
+ const app = getCurrentInstance();
9895
+ const t = createI18nTranslate("DTable", app);
9739
9896
  const {
9740
9897
  _checkList,
9741
9898
  _checkAll,
9742
9899
  _halfChecked,
9743
9900
  handleConfirm
9744
9901
  } = useFilterMultiple(props.filterList, ctx);
9745
- return () => createVNode(Fragment, null, [createVNode("div", {
9746
- "class": "filter-all-check"
9747
- }, [createVNode("div", {
9748
- "class": "filter-item"
9749
- }, [createVNode(Checkbox, {
9750
- "modelValue": _checkAll.value,
9751
- "onUpdate:modelValue": ($event) => _checkAll.value = $event,
9752
- "halfChecked": _halfChecked.value,
9753
- "label": "\u5168\u9009"
9754
- }, null)])]), createVNode("div", {
9755
- "class": "filter-multiple-menu"
9756
- }, [_checkList.value.map((item) => createVNode("div", {
9757
- "class": "filter-item"
9758
- }, [createVNode(Checkbox, {
9759
- "modelValue": item.checked,
9760
- "onUpdate:modelValue": ($event) => item.checked = $event,
9761
- "label": item.name
9762
- }, null)]))]), createVNode("div", {
9763
- "class": "filter-operation"
9764
- }, [createVNode(Button, {
9765
- "variant": "text",
9766
- "onClick": handleConfirm
9767
- }, {
9768
- default: () => [createTextVNode("\u786E\u5B9A")]
9769
- })])]);
9902
+ return () => {
9903
+ let _slot;
9904
+ return createVNode(Fragment, null, [createVNode("div", {
9905
+ "class": "filter-all-check"
9906
+ }, [createVNode("div", {
9907
+ "class": "filter-item"
9908
+ }, [createVNode(Checkbox, {
9909
+ "modelValue": _checkAll.value,
9910
+ "onUpdate:modelValue": ($event) => _checkAll.value = $event,
9911
+ "halfChecked": _halfChecked.value,
9912
+ "label": t("selectAll")
9913
+ }, null)])]), createVNode("div", {
9914
+ "class": "filter-multiple-menu"
9915
+ }, [_checkList.value.map((item) => createVNode("div", {
9916
+ "class": "filter-item"
9917
+ }, [createVNode(Checkbox, {
9918
+ "modelValue": item.checked,
9919
+ "onUpdate:modelValue": ($event) => item.checked = $event,
9920
+ "label": item.name
9921
+ }, null)]))]), createVNode("div", {
9922
+ "class": "filter-operation"
9923
+ }, [createVNode(Button, {
9924
+ "variant": "text",
9925
+ "onClick": handleConfirm
9926
+ }, _isSlot$1(_slot = t("ok")) ? _slot : {
9927
+ default: () => [_slot]
9928
+ })])]);
9929
+ };
9770
9930
  }
9771
9931
  });
9772
9932
  var list = "";
@@ -9886,17 +10046,17 @@ var Filter = defineComponent({
9886
10046
  });
9887
10047
  }
9888
10048
  });
9889
- function useBaseRender(column) {
10049
+ function useBaseRender(column2) {
9890
10050
  const baseClass = computed(() => ({
9891
- operable: column.value.filterable || column.value.sortable || column.value.resizeable,
9892
- resizeable: column.value.resizeable
10051
+ operable: column2.value.filterable || column2.value.sortable || column2.value.resizeable,
10052
+ resizeable: column2.value.resizeable
9893
10053
  }));
9894
10054
  return { baseClass };
9895
10055
  }
9896
- function useSort(column) {
10056
+ function useSort(column2) {
9897
10057
  const table2 = inject(TABLE_TOKEN);
9898
10058
  const store = table2.store;
9899
- const direction = ref(column.value.sortDirection);
10059
+ const direction = ref(column2.value.sortDirection);
9900
10060
  const sortClass = computed(() => ({
9901
10061
  "sort-active": Boolean(direction.value)
9902
10062
  }));
@@ -9904,7 +10064,7 @@ function useSort(column) {
9904
10064
  thInstance && store.states.thList.push(thInstance);
9905
10065
  onMounted(() => {
9906
10066
  var _a;
9907
- column.value.sortable && column.value.sortDirection && ((_a = store.sortData) == null ? void 0 : _a.call(store, direction.value, column.value.sortMethod));
10067
+ column2.value.sortable && column2.value.sortDirection && ((_a = store.sortData) == null ? void 0 : _a.call(store, direction.value, column2.value.sortMethod));
9908
10068
  });
9909
10069
  const execClearSortOrder = () => {
9910
10070
  store.states.thList.forEach((th) => {
@@ -9918,22 +10078,23 @@ function useSort(column) {
9918
10078
  var _a;
9919
10079
  direction.value = val;
9920
10080
  execClearSortOrder();
9921
- (_a = store.sortData) == null ? void 0 : _a.call(store, direction.value, column.value.sortMethod);
9922
- table2.emit("sort-change", { field: column.value.field, direction: direction.value });
10081
+ (_a = store.sortData) == null ? void 0 : _a.call(store, direction.value, column2.value.sortMethod);
10082
+ table2.emit("sort-change", { field: column2.value.field, direction: direction.value });
9923
10083
  };
9924
10084
  const clearSortOrder = () => {
9925
10085
  direction.value = "";
9926
10086
  };
9927
10087
  return { direction, sortClass, handleSort, clearSortOrder };
9928
10088
  }
9929
- function useFilter(column) {
10089
+ function useFilter(column2) {
9930
10090
  const filter2 = ref(null);
9931
10091
  const filterClass = computed(() => ({
9932
10092
  "filter-active": Boolean(filter2.value || Array.isArray(filter2.value) && filter2.value.length)
9933
10093
  }));
9934
10094
  const handleFilter = (val) => {
10095
+ var _a;
9935
10096
  filter2.value = val;
9936
- column.value.ctx.emit("filter-change", val);
10097
+ (_a = column2.value.ctx) == null ? void 0 : _a.emit("filter-change", val);
9937
10098
  };
9938
10099
  return { filterClass, handleFilter };
9939
10100
  }
@@ -9954,7 +10115,7 @@ function getFinalWidth(newWidth, minWidth, maxWidth) {
9954
10115
  const finalWidth = !overMinWidth ? realMinWidth : !underMaxWidth ? realMaxWidth : newWidth;
9955
10116
  return finalWidth;
9956
10117
  }
9957
- function useDragColumnWidth(elementRef, column) {
10118
+ function useDragColumnWidth(elementRef, column2) {
9958
10119
  let initialWidth = 0;
9959
10120
  let mouseDownScreenX = 0;
9960
10121
  let resizeBarElement;
@@ -9963,33 +10124,36 @@ function useDragColumnWidth(elementRef, column) {
9963
10124
  const resizing = ref(false);
9964
10125
  const tableElement = table2.tableRef;
9965
10126
  const onMousemove = (e) => {
10127
+ var _a;
9966
10128
  const movementX = e.clientX - mouseDownScreenX;
9967
10129
  const newWidth = initialWidth + movementX;
9968
- const finalWidth = getFinalWidth(newWidth, column.value.minWidth, column.value.maxWidth);
10130
+ const finalWidth = getFinalWidth(newWidth, column2.value.minWidth, column2.value.maxWidth);
9969
10131
  if (resizeBarElement) {
9970
10132
  resizeBarElement.style.left = `${finalWidth + elementRef.value.offsetLeft}px`;
9971
10133
  }
9972
- column.value.ctx.emit("resizing", { width: finalWidth });
10134
+ (_a = column2.value.ctx) == null ? void 0 : _a.emit("resizing", { width: finalWidth });
9973
10135
  };
9974
10136
  const onMouseup = (e) => {
10137
+ var _a;
9975
10138
  const movementX = e.clientX - mouseDownScreenX;
9976
10139
  const newWidth = initialWidth + movementX;
9977
- const finalWidth = getFinalWidth(newWidth, column.value.minWidth, column.value.maxWidth);
9978
- column.value.width = finalWidth;
9979
- column.value.realWidth = finalWidth;
10140
+ const finalWidth = getFinalWidth(newWidth, column2.value.minWidth, column2.value.maxWidth);
10141
+ column2.value.width = finalWidth;
10142
+ column2.value.realWidth = finalWidth;
9980
10143
  table2.updateColumnWidth();
9981
10144
  resizing.value = false;
9982
10145
  tableElement == null ? void 0 : tableElement.value.classList.remove("table-selector");
9983
10146
  dragClass.value = "";
9984
10147
  tableElement == null ? void 0 : tableElement.value.removeChild(resizeBarElement);
9985
- column.value.ctx.emit("resize-end", { width: finalWidth, beforeWidth: initialWidth });
10148
+ (_a = column2.value.ctx) == null ? void 0 : _a.emit("resize-end", { width: finalWidth, beforeWidth: initialWidth });
9986
10149
  document.removeEventListener("mouseup", onMouseup);
9987
10150
  document.removeEventListener("mousemove", onMousemove);
9988
10151
  };
9989
10152
  const onMousedown = (e) => {
10153
+ var _a;
9990
10154
  const isHandle = e.target.classList.contains("resize-handle");
9991
10155
  if (isHandle) {
9992
- column.value.ctx.emit("resize-start");
10156
+ (_a = column2.value.ctx) == null ? void 0 : _a.emit("resize-start");
9993
10157
  const initialOffset = elementRef.value.offsetLeft;
9994
10158
  initialWidth = elementRef.value.clientWidth;
9995
10159
  mouseDownScreenX = e.clientX;
@@ -10025,30 +10189,30 @@ var TH = defineComponent({
10025
10189
  const store = table2.store;
10026
10190
  const headerContainerRef = ref();
10027
10191
  const {
10028
- column
10192
+ column: column2
10029
10193
  } = toRefs(props);
10030
10194
  const {
10031
10195
  baseClass
10032
- } = useBaseRender(column);
10196
+ } = useBaseRender(column2);
10033
10197
  const {
10034
10198
  direction,
10035
10199
  sortClass,
10036
10200
  handleSort,
10037
10201
  clearSortOrder
10038
- } = useSort(column);
10202
+ } = useSort(column2);
10039
10203
  const {
10040
10204
  filterClass,
10041
10205
  handleFilter
10042
- } = useFilter(column);
10206
+ } = useFilter(column2);
10043
10207
  const {
10044
10208
  stickyClass,
10045
10209
  stickyStyle
10046
- } = useFixedColumn(column);
10210
+ } = useFixedColumn(column2);
10047
10211
  const {
10048
10212
  resizing,
10049
10213
  dragClass,
10050
10214
  onMousedown
10051
- } = useDragColumnWidth(headerContainerRef, column);
10215
+ } = useDragColumnWidth(headerContainerRef, column2);
10052
10216
  expose({
10053
10217
  clearSortOrder
10054
10218
  });
@@ -10061,17 +10225,17 @@ var TH = defineComponent({
10061
10225
  "ref": headerContainerRef,
10062
10226
  "class": "header-container",
10063
10227
  "onMousedown": onMousedown
10064
- }, [(_b = (_a = column.value).renderHeader) == null ? void 0 : _b.call(_a, column.value, store), column.value.filterable && createVNode(Filter, {
10065
- "filterList": column.value.filterList,
10066
- "multiple": column.value.filterMultiple,
10228
+ }, [(_b = (_a = column2.value).renderHeader) == null ? void 0 : _b.call(_a, column2.value, store), column2.value.filterable && createVNode(Filter, {
10229
+ "filterList": column2.value.filterList,
10230
+ "multiple": column2.value.filterMultiple,
10067
10231
  "onFilter": handleFilter
10068
- }, null), column.value.sortable && createVNode(Sort, {
10232
+ }, null), column2.value.sortable && createVNode(Sort, {
10069
10233
  "sort-direction": direction.value,
10070
10234
  "onSort": handleSort
10071
- }, null), column.value.resizeable && createVNode("span", {
10235
+ }, null), column2.value.resizeable && createVNode("span", {
10072
10236
  "class": "resize-handle",
10073
10237
  "onClick": (e) => e.stopPropagation()
10074
- }, null), column.value.resizeable && resizing.value && createVNode("div", {
10238
+ }, null), column2.value.resizeable && resizing.value && createVNode("div", {
10075
10239
  "class": "resize-overlay",
10076
10240
  "onClick": (e) => e.stopPropagation()
10077
10241
  }, null)])]);
@@ -10080,53 +10244,53 @@ var TH = defineComponent({
10080
10244
  });
10081
10245
  function getAllColumns(columns) {
10082
10246
  const result = [];
10083
- columns.forEach((column) => {
10084
- if (column.children) {
10085
- result.push(column);
10086
- result.push.apply(result, getAllColumns(column.children));
10247
+ columns.forEach((column2) => {
10248
+ if (column2.children) {
10249
+ result.push(column2);
10250
+ result.push.apply(result, getAllColumns(column2.children));
10087
10251
  } else {
10088
- result.push(column);
10252
+ result.push(column2);
10089
10253
  }
10090
10254
  });
10091
10255
  return result;
10092
10256
  }
10093
10257
  function convertToRows(originColumns) {
10094
10258
  let maxLevel = 1;
10095
- const traverse = (column, parent) => {
10259
+ const traverse = (column2, parent) => {
10096
10260
  if (parent) {
10097
- column.level = parent.level + 1;
10098
- if (maxLevel < column.level) {
10099
- maxLevel = column.level;
10261
+ column2.level = parent.level + 1;
10262
+ if (maxLevel < column2.level) {
10263
+ maxLevel = column2.level;
10100
10264
  }
10101
10265
  }
10102
- if (column.children) {
10266
+ if (column2.children) {
10103
10267
  let colSpan = 0;
10104
- column.children.forEach((subColumn) => {
10105
- traverse(subColumn, column);
10268
+ column2.children.forEach((subColumn) => {
10269
+ traverse(subColumn, column2);
10106
10270
  colSpan += subColumn.colSpan;
10107
10271
  });
10108
- column.colSpan = colSpan;
10272
+ column2.colSpan = colSpan;
10109
10273
  } else {
10110
- column.colSpan = 1;
10274
+ column2.colSpan = 1;
10111
10275
  }
10112
10276
  };
10113
- originColumns.forEach((column) => {
10114
- column.level = 1;
10115
- traverse(column, void 0);
10277
+ originColumns.forEach((column2) => {
10278
+ column2.level = 1;
10279
+ traverse(column2, void 0);
10116
10280
  });
10117
10281
  const rows = [];
10118
10282
  for (let i = 0; i < maxLevel; i++) {
10119
10283
  rows.push([]);
10120
10284
  }
10121
10285
  const allColumns = getAllColumns(originColumns);
10122
- allColumns.forEach((column) => {
10123
- if (!column.children) {
10124
- column.rowSpan = maxLevel - column.level + 1;
10286
+ allColumns.forEach((column2) => {
10287
+ if (!column2.children) {
10288
+ column2.rowSpan = maxLevel - column2.level + 1;
10125
10289
  } else {
10126
- column.rowSpan = 1;
10127
- column.children.forEach((col) => col.isSubColumn = true);
10290
+ column2.rowSpan = 1;
10291
+ column2.children.forEach((col) => col.isSubColumn = true);
10128
10292
  }
10129
- rows[column.level - 1].push(column);
10293
+ rows[column2.level - 1].push(column2);
10130
10294
  });
10131
10295
  return rows;
10132
10296
  }
@@ -10146,12 +10310,12 @@ var TableHeader = defineComponent({
10146
10310
  } = useHeader();
10147
10311
  return () => createVNode("thead", {
10148
10312
  "class": ns2.e("thead")
10149
- }, [headerRows.value.map((subColumns) => createVNode("tr", null, [subColumns.map((column, columnIndex) => {
10313
+ }, [headerRows.value.map((subColumns) => createVNode("tr", null, [subColumns.map((column2, columnIndex) => {
10150
10314
  return createVNode(TH, {
10151
10315
  "key": columnIndex,
10152
- "column": column,
10153
- "colspan": column.colSpan,
10154
- "rowspan": column.rowSpan
10316
+ "column": column2,
10317
+ "colspan": column2.colSpan,
10318
+ "rowspan": column2.rowSpan
10155
10319
  }, null);
10156
10320
  })]))]);
10157
10321
  }
@@ -10357,12 +10521,12 @@ var TD = defineComponent({
10357
10521
  inheritAttrs: false,
10358
10522
  props: bodyTdProps,
10359
10523
  setup(props, ctx) {
10360
- const column = toRef(props, "column");
10524
+ const column2 = toRef(props, "column");
10361
10525
  const table2 = inject(TABLE_TOKEN);
10362
10526
  const {
10363
10527
  stickyClass,
10364
10528
  stickyStyle
10365
- } = useFixedColumn(column);
10529
+ } = useFixedColumn(column2);
10366
10530
  const {
10367
10531
  tdRef,
10368
10532
  isShowTooltip,
@@ -10379,21 +10543,22 @@ var TD = defineComponent({
10379
10543
  "ref": tdRef,
10380
10544
  "class": stickyClass.value,
10381
10545
  "style": stickyStyle.value
10382
- }, ctx.attrs), [(_b = (_a = props.column).renderCell) == null ? void 0 : _b.call(_a, props.row, props.column, table2.store, props.index)])];
10546
+ }, ctx.attrs), [(_b = (_a = props.column).renderCell) == null ? void 0 : _b.call(_a, props.row, props.column, table2.store, props.index, table2.props)])];
10383
10547
  }
10384
10548
  });
10385
10549
  };
10386
10550
  }
10387
10551
  });
10552
+ const ns$1 = useNamespace("table");
10388
10553
  function useMergeCell() {
10389
10554
  const table2 = inject(TABLE_TOKEN);
10390
10555
  const { _data: data, _columns: columns } = table2.store.states;
10391
- const getSpan = (row, column, rowIndex, columnIndex) => {
10556
+ const getSpan = (row, column2, rowIndex, columnIndex) => {
10392
10557
  const fn = table2 == null ? void 0 : table2.props.spanMethod;
10393
10558
  let rowspan = 1;
10394
10559
  let colspan = 1;
10395
10560
  if (typeof fn === "function") {
10396
- const result = fn({ row, column, rowIndex, columnIndex });
10561
+ const result = fn({ row, column: column2, rowIndex, columnIndex });
10397
10562
  if (Array.isArray(result)) {
10398
10563
  rowspan = result[0];
10399
10564
  colspan = result[1];
@@ -10408,8 +10573,8 @@ function useMergeCell() {
10408
10573
  const result = {};
10409
10574
  if (table2 == null ? void 0 : table2.props.spanMethod) {
10410
10575
  data.value.forEach((row, rowIndex) => {
10411
- columns.value.forEach((column, columnIndex) => {
10412
- const { rowspan, colspan } = getSpan(row, column, rowIndex, columnIndex);
10576
+ columns.value.forEach((column2, columnIndex) => {
10577
+ const { rowspan, colspan } = getSpan(row, column2, rowIndex, columnIndex);
10413
10578
  if (rowspan > 1 || colspan > 1) {
10414
10579
  result[`${rowIndex}-${columnIndex}`] = [rowspan, colspan];
10415
10580
  }
@@ -10437,20 +10602,39 @@ function useMergeCell() {
10437
10602
  });
10438
10603
  return { tableSpans, removeCells };
10439
10604
  }
10605
+ function useBodyRender() {
10606
+ const table2 = inject(TABLE_TOKEN);
10607
+ const hoverEnabled = computed(() => table2 == null ? void 0 : table2.props.rowHoveredHighlight);
10608
+ const rowLevelMap = (table2 == null ? void 0 : table2.store.states.rowLevelMap) || {};
10609
+ const rowKey = (table2 == null ? void 0 : table2.props.rowKey) || "id";
10610
+ const getTableRowClass = (row) => {
10611
+ const level = rowLevelMap.value[getRowIdentity(row, rowKey)];
10612
+ return {
10613
+ [ns$1.e("row")]: true,
10614
+ ["hover-enabled"]: hoverEnabled.value,
10615
+ ["expanded"]: table2 == null ? void 0 : table2.store.isRowExpanded(row),
10616
+ [ns$1.em("row", `level-${level}`)]: level !== void 0,
10617
+ ["is-hidden"]: table2 == null ? void 0 : table2.store.states.hiddenRowKeys.value.includes(getRowIdentity(row, rowKey))
10618
+ };
10619
+ };
10620
+ return { getTableRowClass };
10621
+ }
10440
10622
  var TableBody = defineComponent({
10441
10623
  name: "DTableBody",
10442
10624
  setup() {
10443
10625
  const table2 = inject(TABLE_TOKEN);
10444
10626
  const {
10445
- _data: data,
10446
- flatColumns
10627
+ flatColumns,
10628
+ flatRows
10447
10629
  } = table2.store.states;
10448
10630
  const ns2 = useNamespace("table");
10449
- const hoverEnabled = computed(() => table2.props.rowHoveredHighlight);
10450
10631
  const {
10451
10632
  tableSpans,
10452
10633
  removeCells
10453
10634
  } = useMergeCell();
10635
+ const {
10636
+ getTableRowClass
10637
+ } = useBodyRender();
10454
10638
  const onCellClick = (cellClickArg) => {
10455
10639
  table2.emit("cell-click", cellClickArg);
10456
10640
  };
@@ -10459,18 +10643,15 @@ var TableBody = defineComponent({
10459
10643
  };
10460
10644
  return () => createVNode("tbody", {
10461
10645
  "class": ns2.e("tbody")
10462
- }, [data.value.map((row, rowIndex) => {
10646
+ }, [flatRows.value.map((row, rowIndex) => {
10463
10647
  var _a, _b, _c, _d;
10464
10648
  return createVNode(Fragment, null, [createVNode("tr", {
10465
10649
  "key": rowIndex,
10466
- "class": {
10467
- "hover-enabled": hoverEnabled.value,
10468
- expanded: table2.store.isRowExpanded(row)
10469
- },
10650
+ "class": getTableRowClass(row),
10470
10651
  "onClick": () => onRowClick({
10471
10652
  row
10472
10653
  })
10473
- }, [flatColumns.value.map((column, columnIndex) => {
10654
+ }, [flatColumns.value.map((column2, columnIndex) => {
10474
10655
  var _a2;
10475
10656
  const cellId = `${rowIndex}-${columnIndex}`;
10476
10657
  const [rowspan, colspan] = (_a2 = tableSpans.value[cellId]) != null ? _a2 : [1, 1];
@@ -10478,7 +10659,7 @@ var TableBody = defineComponent({
10478
10659
  return null;
10479
10660
  }
10480
10661
  return createVNode(TD, {
10481
- "column": column,
10662
+ "column": column2,
10482
10663
  "index": rowIndex,
10483
10664
  "row": row,
10484
10665
  "rowspan": rowspan,
@@ -10486,13 +10667,13 @@ var TableBody = defineComponent({
10486
10667
  "onClick": () => onCellClick({
10487
10668
  rowIndex,
10488
10669
  columnIndex,
10489
- column,
10670
+ column: column2,
10490
10671
  row
10491
10672
  })
10492
10673
  }, null);
10493
- })]), flatColumns.value.some((column) => column.type === "expand") && table2.store.isRowExpanded(row) && createVNode("tr", null, [createVNode("td", {
10674
+ })]), flatColumns.value.some((column2) => column2.type === "expand") && table2.store.isRowExpanded(row) && createVNode("tr", null, [createVNode("td", {
10494
10675
  "colspan": flatColumns.value.length
10495
- }, [(_d = (_c = (_b = (_a = flatColumns.value.filter((column) => column.type === "expand")) == null ? void 0 : _a[0]) == null ? void 0 : _b.slots) == null ? void 0 : _c.default) == null ? void 0 : _d.call(_c, {
10676
+ }, [(_d = (_c = (_b = (_a = flatColumns.value.filter((column2) => column2.type === "expand")) == null ? void 0 : _a[0]) == null ? void 0 : _b.slots) == null ? void 0 : _c.default) == null ? void 0 : _d.call(_c, {
10496
10677
  row
10497
10678
  })])])]);
10498
10679
  })]);
@@ -10592,6 +10773,8 @@ var Table = defineComponent({
10592
10773
  onMounted(async () => {
10593
10774
  await nextTick();
10594
10775
  store.updateColumns();
10776
+ store.updateFirstDefaultColumn();
10777
+ store.updateRows();
10595
10778
  updateColumnWidth();
10596
10779
  });
10597
10780
  return () => {
@@ -10695,36 +10878,86 @@ const tableColumnProps = {
10695
10878
  default: false
10696
10879
  }
10697
10880
  };
10881
+ var column = "";
10882
+ const IconOpen = () => createVNode("svg", {
10883
+ "width": "16px",
10884
+ "height": "16px",
10885
+ "viewBox": "0 0 16 16",
10886
+ "version": "1.1",
10887
+ "xmlns": "http://www.w3.org/2000/svg",
10888
+ "class": "svg-icon svg-icon-close"
10889
+ }, [createVNode("g", {
10890
+ "stroke-width": "1",
10891
+ "fill": "none",
10892
+ "fill-rule": "evenodd"
10893
+ }, [createVNode("rect", {
10894
+ "x": "0.5",
10895
+ "y": "0.5",
10896
+ "width": "15",
10897
+ "height": "15",
10898
+ "rx": "2",
10899
+ "stroke": "#5e7ce0"
10900
+ }, null), createVNode("rect", {
10901
+ "x": "4",
10902
+ "y": "7",
10903
+ "width": "8",
10904
+ "height": "2",
10905
+ "fill": "#5e7ce0"
10906
+ }, null)])]);
10907
+ const IconClose = () => createVNode("svg", {
10908
+ "width": "16px",
10909
+ "height": "16px",
10910
+ "viewBox": "0 0 16 16",
10911
+ "version": "1.1",
10912
+ "xmlns": "http://www.w3.org/2000/svg",
10913
+ "class": "svg-icon"
10914
+ }, [createVNode("g", {
10915
+ "stroke": "none",
10916
+ "stroke-width": "1",
10917
+ "fill": "none",
10918
+ "fill-rule": "evenodd"
10919
+ }, [createVNode("rect", {
10920
+ "x": "0.5",
10921
+ "y": "0.5",
10922
+ "width": "15",
10923
+ "height": "15",
10924
+ "rx": "2",
10925
+ "stroke": "#252b3a"
10926
+ }, null), createVNode("path", {
10927
+ "fill": "#252b3a",
10928
+ "d": "M8.75,4 L8.75,7.25 L12,7.25 L12,8.75 L8.749,8.75 L8.75,12 L7.25,12 L7.249,8.75 L4,8.75 L4,7.25 L7.25,7.25 L7.25,4 L8.75,4 Z"
10929
+ }, null)])]);
10930
+ const ns = useNamespace("table");
10698
10931
  const cellMap = {
10699
10932
  checkable: {
10700
- renderHeader(column, store) {
10933
+ renderHeader(column2, store) {
10701
10934
  return h(Checkbox, {
10702
10935
  modelValue: store.states._checkAll.value,
10703
10936
  halfChecked: store.states._halfChecked.value,
10704
10937
  onChange: (val) => {
10705
10938
  store.states._checkAll.value = val;
10706
- store._table.emit("check-all-change", val);
10939
+ store._table.emit("check-all-change", val, store.getCheckedRows());
10707
10940
  }
10708
10941
  });
10709
10942
  },
10710
- renderCell(rowData, column, store, rowIndex) {
10943
+ renderCell(rowData, column2, store, rowIndex) {
10711
10944
  return h(Checkbox, {
10712
- modelValue: store.isRowChecked(rowData),
10945
+ modelValue: store.isRowChecked(rowData, rowIndex),
10713
10946
  onChange: (val) => {
10714
- store.checkRow(val, rowData);
10715
- store._table.emit("check-change", val, store.states._data.value[rowIndex]);
10947
+ store.checkRow(val, rowData, rowIndex);
10948
+ store._table.emit("check-change", val, store.states._data.value[rowIndex], store.getCheckedRows());
10716
10949
  }
10717
10950
  });
10718
10951
  }
10719
10952
  },
10720
10953
  index: {
10721
- renderHeader(column) {
10954
+ renderHeader(column2) {
10722
10955
  var _a;
10723
10956
  return h("span", {
10724
10957
  class: "title"
10725
- }, (_a = column.header) != null ? _a : "#");
10958
+ }, (_a = column2.header) != null ? _a : "#");
10726
10959
  },
10727
- renderCell(rowData, column, store, rowIndex) {
10960
+ renderCell(rowData, column2, store, rowIndex) {
10728
10961
  return rowIndex + 1;
10729
10962
  }
10730
10963
  },
@@ -10732,7 +10965,7 @@ const cellMap = {
10732
10965
  renderHeader() {
10733
10966
  return createVNode("span", null, null);
10734
10967
  },
10735
- renderCell(rowData, column, store, rowIndex) {
10968
+ renderCell(rowData, column2, store, rowIndex) {
10736
10969
  return createVNode(Icon, {
10737
10970
  "name": "chevron-right",
10738
10971
  "class": "icon-expand-row",
@@ -10743,19 +10976,60 @@ const cellMap = {
10743
10976
  }
10744
10977
  },
10745
10978
  default: {
10746
- renderHeader(column) {
10979
+ renderHeader(column2) {
10747
10980
  var _a;
10748
10981
  return h("span", {
10749
10982
  class: "title"
10750
- }, (_a = column.header) != null ? _a : "");
10983
+ }, (_a = column2.header) != null ? _a : "");
10751
10984
  },
10752
- renderCell(rowData, column, store, rowIndex) {
10753
- var _a, _b;
10754
- const value = column.field ? rowData[column.field] : "";
10755
- if (column.formatter) {
10756
- return column.formatter(rowData, column, value, rowIndex);
10985
+ renderCell(rowData, column2, store, rowIndex, props, ctx) {
10986
+ var _a, _b, _c;
10987
+ let columnValue;
10988
+ if (ctx.slots.default) {
10989
+ columnValue = ctx.slots.default({
10990
+ row: rowData,
10991
+ rowIndex
10992
+ });
10993
+ } else {
10994
+ const value = column2.field ? rowData[column2.field] : "";
10995
+ if (column2.formatter) {
10996
+ columnValue = column2.formatter(rowData, column2, value, rowIndex);
10997
+ }
10998
+ columnValue = (_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : "";
10999
+ }
11000
+ const hasExpandColumn = store.states.flatColumns.value.some((column22) => column22.type === "expand");
11001
+ const hasChildren = store.states._data.value.some((row) => {
11002
+ var _a2;
11003
+ return (_a2 = row.children) == null ? void 0 : _a2.length;
11004
+ });
11005
+ const level = store.states.rowLevelMap.value[getRowIdentity(rowData, props.rowKey)] || 0;
11006
+ const indentDom = h("span", {
11007
+ class: `${ns.e("indent")}`,
11008
+ style: {
11009
+ paddingLeft: `${level * props.indent}px`
11010
+ }
11011
+ }, "");
11012
+ const isTreeCell = store.states.firstDefaultColumn.value === column2.id;
11013
+ const showIndentDom = isTreeCell && level;
11014
+ const showExpendIconDom = isTreeCell && ((_c = rowData.children) == null ? void 0 : _c.length);
11015
+ const expendIconDom = createVNode("span", {
11016
+ "class": ns.e("tree-operate"),
11017
+ "onClick": () => {
11018
+ store.toggleRowExpansion(rowData);
11019
+ },
11020
+ "style": showExpendIconDom ? "" : "visibility: hidden;"
11021
+ }, [store.isRowExpanded(rowData) ? createVNode(IconOpen, null, null) : createVNode(IconClose, null, null)]);
11022
+ const cellDom = [];
11023
+ if (showIndentDom) {
11024
+ cellDom.push(indentDom);
11025
+ }
11026
+ if (hasChildren && !hasExpandColumn && isTreeCell) {
11027
+ cellDom.push(expendIconDom);
10757
11028
  }
10758
- return (_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : "";
11029
+ cellDom.push(columnValue);
11030
+ return h("div", {
11031
+ class: `${ns.e("cell")} `
11032
+ }, cellDom);
10759
11033
  }
10760
11034
  }
10761
11035
  };
@@ -10781,64 +11055,65 @@ function createColumn(id, props, ctx) {
10781
11055
  showOverflowTooltip,
10782
11056
  resizeable
10783
11057
  } = props;
10784
- const column = reactive({ id });
10785
- column.type = type4.value;
11058
+ const column2 = reactive({ id });
11059
+ column2.type = type4.value;
10786
11060
  function renderHeader(columnItem, store) {
10787
11061
  if (ctx.slots.header) {
10788
11062
  return ctx.slots.header(columnItem);
10789
11063
  }
10790
11064
  return cellMap[type4.value || "default"].renderHeader(columnItem, store);
10791
11065
  }
10792
- function renderCell(rowData, columnItem, store, rowIndex) {
10793
- if (ctx.slots.default && columnItem.type !== "expand") {
11066
+ function renderCell(rowData, columnItem, store, rowIndex, tableProps2) {
11067
+ if (ctx.slots.default && columnItem.type === "index") {
10794
11068
  return ctx.slots.default({ row: rowData, rowIndex });
10795
11069
  }
10796
- return cellMap[type4.value || "default"].renderCell(rowData, columnItem, store, rowIndex);
11070
+ return cellMap[type4.value || "default"].renderCell(rowData, columnItem, store, rowIndex, tableProps2, ctx);
10797
11071
  }
10798
11072
  watch([field, header2, order], ([fieldVal, headerVal, orderVal]) => {
10799
- column.field = fieldVal;
10800
- column.header = headerVal;
10801
- column.order = orderVal;
11073
+ column2.field = fieldVal;
11074
+ column2.header = headerVal;
11075
+ column2.order = orderVal;
10802
11076
  }, { immediate: true });
10803
11077
  watch([sortable, sortDirection, sortMethod], ([sortableVal, sortDirectionVal, sortMethodVal]) => {
10804
- column.sortable = sortableVal;
10805
- column.sortDirection = sortDirectionVal;
10806
- column.sortMethod = sortMethodVal;
11078
+ column2.sortable = sortableVal;
11079
+ column2.sortDirection = sortDirectionVal;
11080
+ column2.sortMethod = sortMethodVal;
10807
11081
  }, { immediate: true });
10808
11082
  watch([filterable, filterList, filterMultiple], ([filterableVal, filterListVal, filterMultipleVal]) => {
10809
- column.filterable = filterableVal;
10810
- column.filterMultiple = filterMultipleVal;
10811
- column.filterList = filterListVal;
11083
+ column2.filterable = filterableVal;
11084
+ column2.filterMultiple = filterMultipleVal;
11085
+ column2.filterList = filterListVal;
10812
11086
  }, { immediate: true });
10813
11087
  watch([fixedLeft, fixedRight], ([left, right]) => {
10814
- column.fixedLeft = left;
10815
- column.fixedRight = right;
11088
+ column2.fixedLeft = left;
11089
+ column2.fixedRight = right;
10816
11090
  }, { immediate: true });
10817
11091
  watch(align, (alignVal) => {
10818
- column.align = alignVal;
11092
+ column2.align = alignVal;
10819
11093
  }, { immediate: true });
10820
11094
  watch(showOverflowTooltip, (showVal) => {
10821
- column.showOverflowTooltip = showVal;
11095
+ column2.showOverflowTooltip = showVal;
10822
11096
  }, { immediate: true });
10823
11097
  watch(resizeable, (resizeVal) => {
10824
- column.resizeable = resizeVal;
11098
+ column2.resizeable = resizeVal;
10825
11099
  }, { immediate: true });
10826
11100
  watch([width, minWidth, maxWidth], ([widthVal, minWidthVal, maxWidthVal]) => {
10827
- column.width = formatWidth(widthVal);
10828
- column.minWidth = minWidthVal;
10829
- column.maxWidth = maxWidthVal;
10830
- column.realWidth = column.width;
11101
+ column2.width = formatWidth(widthVal);
11102
+ column2.minWidth = minWidthVal;
11103
+ column2.maxWidth = maxWidthVal;
11104
+ column2.realWidth = column2.width;
10831
11105
  }, { immediate: true });
10832
11106
  onBeforeMount(() => {
10833
- column.id = id;
10834
- column.renderHeader = renderHeader;
10835
- column.renderCell = renderCell;
10836
- column.formatter = formatter == null ? void 0 : formatter.value;
10837
- column.customFilterTemplate = ctx.slots.customFilterTemplate;
10838
- column.subColumns = ctx.slots.subColumns;
10839
- column.slots = ctx.slots;
11107
+ column2.id = id;
11108
+ column2.renderHeader = renderHeader;
11109
+ column2.renderCell = renderCell;
11110
+ column2.formatter = formatter == null ? void 0 : formatter.value;
11111
+ column2.customFilterTemplate = ctx.slots.customFilterTemplate;
11112
+ column2.subColumns = ctx.slots.subColumns;
11113
+ column2.slots = ctx.slots;
11114
+ column2.ctx = ctx;
10840
11115
  });
10841
- return column;
11116
+ return column2;
10842
11117
  }
10843
11118
  function useRender() {
10844
11119
  const instance = getCurrentInstance();
@@ -10870,8 +11145,8 @@ var Column = defineComponent({
10870
11145
  const parent = columnOrTableParent.value;
10871
11146
  const instance = getCurrentInstance();
10872
11147
  instance.columnId = `${parent.tableId || parent.columnId}_column_${columnIdInit++}`;
10873
- const column = createColumn(instance.columnId, toRefs(props), ctx);
10874
- instance.columnConfig = column;
11148
+ const column2 = createColumn(instance.columnId, toRefs(props), ctx);
11149
+ instance.columnConfig = column2;
10875
11150
  onBeforeMount(() => {
10876
11151
  isSubColumn.value = owner !== parent;
10877
11152
  });
@@ -10879,7 +11154,7 @@ var Column = defineComponent({
10879
11154
  var _a;
10880
11155
  const children = isSubColumn.value ? parent.vnode.el.children : (_a = owner == null ? void 0 : owner.hiddenColumns.value) == null ? void 0 : _a.children;
10881
11156
  const columnIndex = getColumnIndex(children || [], instance.vnode.el);
10882
- columnIndex > -1 && (owner == null ? void 0 : owner.store.insertColumn(column, isSubColumn.value ? parent.columnConfig : null));
11157
+ columnIndex > -1 && (owner == null ? void 0 : owner.store.insertColumn(column2, isSubColumn.value ? parent.columnConfig : null));
10883
11158
  if (typeof props.checkable === "function") {
10884
11159
  for (const [rowIndex, row] of owner == null ? void 0 : owner.store.states._data.value.entries()) {
10885
11160
  if (props.checkable(row, rowIndex)) {
@@ -10888,11 +11163,11 @@ var Column = defineComponent({
10888
11163
  }
10889
11164
  }
10890
11165
  });
10891
- watch(() => column.order, () => {
11166
+ watch(() => column2.order, () => {
10892
11167
  owner == null ? void 0 : owner.store.sortColumn();
10893
11168
  });
10894
11169
  onBeforeUnmount(() => {
10895
- owner == null ? void 0 : owner.store.removeColumn(column);
11170
+ owner == null ? void 0 : owner.store.removeColumn(column2);
10896
11171
  });
10897
11172
  return () => {
10898
11173
  var _a, _b;
@@ -10908,7 +11183,7 @@ var Column = defineComponent({
10908
11183
  var index = {
10909
11184
  title: "Table \u8868\u683C",
10910
11185
  category: "\u6570\u636E\u5C55\u793A",
10911
- status: "20%",
11186
+ status: "50%",
10912
11187
  install(app) {
10913
11188
  app.component(Table.name, Table);
10914
11189
  app.component(Column.name, Column);