x-next 1.11.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/AI_USAGE/catalog.md +1 -1
  2. package/AI_USAGE/components/alert.md +1 -1
  3. package/AI_USAGE/components/bar-chart.md +1 -1
  4. package/AI_USAGE/components/button.md +1 -1
  5. package/AI_USAGE/components/checkbox.md +1 -1
  6. package/AI_USAGE/components/color-picker.md +1 -1
  7. package/AI_USAGE/components/config-provider.md +1 -1
  8. package/AI_USAGE/components/date-picker.md +1 -1
  9. package/AI_USAGE/components/dialog.md +1 -1
  10. package/AI_USAGE/components/dropdown.md +1 -1
  11. package/AI_USAGE/components/empty.md +1 -1
  12. package/AI_USAGE/components/input.md +1 -1
  13. package/AI_USAGE/components/line-chart.md +1 -1
  14. package/AI_USAGE/components/message-box.md +1 -1
  15. package/AI_USAGE/components/message.md +1 -1
  16. package/AI_USAGE/components/notification.md +1 -1
  17. package/AI_USAGE/components/pagination.md +1 -1
  18. package/AI_USAGE/components/pie-chart.md +1 -1
  19. package/AI_USAGE/components/popconfirm.md +1 -1
  20. package/AI_USAGE/components/popover.md +1 -1
  21. package/AI_USAGE/components/progress.md +1 -1
  22. package/AI_USAGE/components/radio.md +1 -1
  23. package/AI_USAGE/components/rate.md +1 -1
  24. package/AI_USAGE/components/select.md +1 -1
  25. package/AI_USAGE/components/slider.md +1 -1
  26. package/AI_USAGE/components/steps.md +1 -1
  27. package/AI_USAGE/components/switch.md +1 -1
  28. package/AI_USAGE/components/tabs.md +1 -1
  29. package/AI_USAGE/components/textarea.md +1 -1
  30. package/AI_USAGE/components/time-picker.md +1 -1
  31. package/AI_USAGE/components/upload.md +1 -1
  32. package/AI_USAGE/core.md +1 -1
  33. package/AI_USAGE/index.md +1 -1
  34. package/AI_USAGE/recipes/form-on-demand.md +1 -1
  35. package/AI_USAGE.md +2 -2
  36. package/CHANGELOG.md +18 -0
  37. package/dist/components/network/Network.vue.d.ts +1 -1
  38. package/dist/components/network/index.d.ts +3 -3
  39. package/dist/components/table/Table.d.ts +11 -0
  40. package/dist/components/table/context.d.ts +5 -0
  41. package/dist/components/table/dom-listeners.d.ts +23 -0
  42. package/dist/components/table/hooks/use-column-resize.d.ts +2 -1
  43. package/dist/components/table/hooks/use-drag.d.ts +6 -3
  44. package/dist/components/table/hooks/use-keyboard-navigation.d.ts +27 -0
  45. package/dist/components/table/hooks/use-sorter.d.ts +3 -1
  46. package/dist/components/table/index.d.ts +15 -0
  47. package/dist/components/table/interface.d.ts +9 -2
  48. package/dist/components/table/locale.d.ts +8 -7
  49. package/dist/components/table/table-operation-td.d.ts +34 -0
  50. package/dist/components/table/table-td.d.ts +36 -2
  51. package/dist/components/table/table-th.d.ts +34 -0
  52. package/dist/components/table/table-tr.d.ts +34 -0
  53. package/dist/components/trend-chart/components/TrendChart.d.ts +1 -1
  54. package/dist/components/trend-chart/index.d.ts +3 -3
  55. package/dist/components/upload/Upload.d.ts +1 -1
  56. package/dist/components/upload/index.d.ts +3 -3
  57. package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/dayjs.min.js +1 -1
  58. package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/locale/zh-cn.js +1 -1
  59. package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/advancedFormat.js +1 -1
  60. package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/customParseFormat.js +1 -1
  61. package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/isBetween.js +1 -1
  62. package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/quarterOfYear.js +1 -1
  63. package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekOfYear.js +1 -1
  64. package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekYear.js +1 -1
  65. package/dist/es/_container/resize-observer-v2.js +1 -1
  66. package/dist/es/_container/resize-observer.js +1 -1
  67. package/dist/es/_hooks/use-resize-observer.js +1 -1
  68. package/dist/es/_virtual/advancedFormat.js +1 -1
  69. package/dist/es/_virtual/customParseFormat.js +1 -1
  70. package/dist/es/_virtual/dayjs.min.js +1 -1
  71. package/dist/es/_virtual/isBetween.js +1 -1
  72. package/dist/es/_virtual/quarterOfYear.js +1 -1
  73. package/dist/es/_virtual/weekOfYear.js +1 -1
  74. package/dist/es/_virtual/weekYear.js +1 -1
  75. package/dist/es/_virtual/zh-cn.js +1 -1
  76. package/dist/es/components/draggable/useDraggable.js +1 -1
  77. package/dist/es/components/form/Form.vue2.js +1 -1
  78. package/dist/es/components/form/FormItem.vue2.js +1 -1
  79. package/dist/es/components/form-input-number/InputNumber.js +1 -1
  80. package/dist/es/components/form-slider/Slider.vue2.js +1 -1
  81. package/dist/es/components/form-slider/slider-ticks.vue2.js +1 -1
  82. package/dist/es/components/form-slider/utils.js +1 -1
  83. package/dist/es/components/menu/MenuItem.js +1 -1
  84. package/dist/es/components/menu/overflow-wrap.js +1 -1
  85. package/dist/es/components/progress/circle.vue2.js +1 -1
  86. package/dist/es/components/progress/line.vue2.js +1 -1
  87. package/dist/es/components/progress/steps.vue2.js +1 -1
  88. package/dist/es/components/rate/Rate.js +1 -1
  89. package/dist/es/components/table/Table.js +947 -713
  90. package/dist/es/components/table/dom-listeners.js +23 -0
  91. package/dist/es/components/table/hooks/use-column-resize.js +27 -18
  92. package/dist/es/components/table/hooks/use-column-sorter.js +22 -29
  93. package/dist/es/components/table/hooks/use-drag.js +23 -20
  94. package/dist/es/components/table/hooks/use-filter.js +43 -43
  95. package/dist/es/components/table/hooks/use-keyboard-navigation.js +69 -0
  96. package/dist/es/components/table/hooks/use-row-selection.js +33 -29
  97. package/dist/es/components/table/hooks/use-sorter.js +86 -38
  98. package/dist/es/components/table/hooks/use-span.js +28 -35
  99. package/dist/es/components/table/locale.js +27 -10
  100. package/dist/es/components/table/table-col-group.vue2.js +9 -9
  101. package/dist/es/components/table/table-operation-td.js +72 -51
  102. package/dist/es/components/table/table-operation-th.js +41 -34
  103. package/dist/es/components/table/table-td.js +100 -77
  104. package/dist/es/components/table/table-th.js +221 -188
  105. package/dist/es/components/table/table-tr.js +11 -8
  106. package/dist/es/components/table/utils.js +104 -94
  107. package/dist/es/components/virtual-list-v2/hooks/use-size.js +47 -41
  108. package/dist/es/components/virtual-list-v2/virtual-list-item.js +29 -16
  109. package/dist/es/locale/en-US.js +7 -1
  110. package/dist/es/locale/index.js +3 -3
  111. package/dist/es/locale/zh-CN.js +7 -1
  112. package/dist/es/style.css +1 -1
  113. package/dist/index.cjs +3 -3
  114. package/dist/index.umd.js +3 -3
  115. package/dist/locale/interface.d.ts +9 -0
  116. package/dist/style/table.css +1 -1
  117. package/dist/style.css +1 -1
  118. package/package.json +1 -1
  119. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/index.js +0 -0
  120. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/is.js +0 -0
  121. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/locale/en-US.js +0 -0
  122. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/array.js +0 -0
  123. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/base.js +0 -0
  124. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/boolean.js +0 -0
  125. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/custom.js +0 -0
  126. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/number.js +0 -0
  127. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/object.js +0 -0
  128. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/string.js +0 -0
  129. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/type.js +0 -0
  130. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/util.js +0 -0
  131. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/compute-scroll-into-view@3.1.1/node_modules/compute-scroll-into-view/dist/index.js +0 -0
  132. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/number-precision@1.6.0/node_modules/number-precision/build/index.es.js +0 -0
  133. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +0 -0
  134. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/scroll-into-view-if-needed@3.1.0/node_modules/scroll-into-view-if-needed/dist/index.js +0 -0
  135. /package/dist/es/{node_modules → Users/xuyu/Code/x-next/node_modules}/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js +0 -0
@@ -1,49 +1,52 @@
1
- import { defineComponent as $l, toRefs as zl, computed as h, ref as p, reactive as we, watch as ne, watchEffect as Ml, toRef as Wl, provide as Ol, onMounted as jl, createVNode as u, Fragment as ke, mergeProps as k, isVNode as Hl } from "vue";
2
- import { isObject as Re, isFunction as K, isNumber as L, isString as Il, isArray as _l, isUndefined as Vl, isNull as Nl } from "../../_utils/is.js";
3
- import { debounce as ft } from "../../_utils/debounce.js";
4
- import { getGroupColumns as Gl, mapArrayWithChildren as Ul, mapRawTableData as Yl, getColumnsFromSlot as ql } from "./utils.js";
5
- import { useRowSelection as Jl } from "./hooks/use-row-selection.js";
6
- import { useExpand as Ql } from "./hooks/use-expand.js";
7
- import { usePagination as Xl } from "./hooks/use-pagination.js";
8
- import Zl from "../../icons/default/plus.js";
9
- import ea from "../../icons/default/minus-circle-fill.js";
10
- import { Spin as ta } from "../spin/index.js";
11
- import { Pagination as la } from "../pagination/index.js";
12
- import { Empty as aa } from "../empty/index.js";
13
- import re from "./table-col-group.vue.js";
14
- import na from "./table-thead.js";
15
- import ra from "./table-tbody.js";
16
- import U from "./table-tr.js";
17
- import oa from "./table-th.js";
18
- import oe from "./table-td.js";
19
- import ua from "./table-operation-th.js";
20
- import mt from "./table-operation-td.js";
21
- import ia from "../virtual-list-v2/virtual-list.vue.js";
22
- import ht from "../../_container/resize-observer.js";
23
- import { omit as sa } from "../../_utils/omit.js";
24
- import { useDrag as ca } from "./hooks/use-drag.js";
25
- import { useColumnResize as da } from "./hooks/use-column-resize.js";
26
- import { tableInjectionKey as fa } from "./context.js";
27
- import { useFilter as ma } from "./hooks/use-filter.js";
28
- import { useSorter as ha } from "./hooks/use-sorter.js";
29
- import { useSpan as vt } from "./hooks/use-span.js";
30
- import { useChildrenComponents as va } from "../../_hooks/use-children-components.js";
31
- import { Scrollbar as gt } from "../scrollbar-v2/index.js";
32
- import { useComponentRef as Ee } from "../../_hooks/use-component-ref.js";
33
- import { useSize as ga } from "../../_hooks/use-size.js";
34
- import { useLocale as ya } from "../../locale/index.js";
35
- import { useScrollbar as ba } from "../../_hooks/use-scrollbar.js";
36
- import { getValueByPath as Le, setValueByPath as yt } from "../../_utils/get-value-by-path.js";
37
- import { getClassNameMixin as pa } from "../../_utils/config.js";
38
- function xa(t) {
39
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Hl(t);
1
+ import { defineComponent as ha, toRefs as va, computed as g, ref as A, useId as ga, reactive as _e, watch as J, watchEffect as ma, onBeforeUnmount as It, toRef as Ht, provide as ya, nextTick as jt, onMounted as ba, createVNode as s, Fragment as Ve, mergeProps as F, isVNode as pa } from "vue";
2
+ import { isObject as qe, isFunction as Q, isNumber as W, isString as xa, isArray as Sa, isUndefined as wa, isNull as Ca } from "../../_utils/is.js";
3
+ import { debounce as Nt } from "../../_utils/debounce.js";
4
+ import { getGroupColumns as ka, mapArrayWithChildren as Ra, mapRawTableData as _t, getColumnsFromSlot as Pa, getSelectionStatus as La, getLeafKeys as Aa } from "./utils.js";
5
+ import { useRowSelection as Ea } from "./hooks/use-row-selection.js";
6
+ import { useExpand as Ta } from "./hooks/use-expand.js";
7
+ import { usePagination as Ka } from "./hooks/use-pagination.js";
8
+ import Da from "../../icons/default/plus.js";
9
+ import Ba from "../../icons/default/minus.js";
10
+ import { Spin as $a } from "../spin/index.js";
11
+ import { Pagination as Ma } from "../pagination/index.js";
12
+ import { Empty as za } from "../empty/index.js";
13
+ import Se from "./table-col-group.vue.js";
14
+ import Fa from "./table-thead.js";
15
+ import Wa from "./table-tbody.js";
16
+ import ne from "./table-tr.js";
17
+ import Oa from "./table-th.js";
18
+ import we from "./table-td.js";
19
+ import Ia from "./table-operation-th.js";
20
+ import Vt from "./table-operation-td.js";
21
+ import Ha from "../virtual-list-v2/virtual-list.vue.js";
22
+ import qt from "../../_container/resize-observer.js";
23
+ import { omit as Yt } from "../../_utils/omit.js";
24
+ import { useDrag as ja } from "./hooks/use-drag.js";
25
+ import { useColumnResize as Na } from "./hooks/use-column-resize.js";
26
+ import { tableInjectionKey as _a } from "./context.js";
27
+ import { useFilter as Va } from "./hooks/use-filter.js";
28
+ import { useSorter as qa } from "./hooks/use-sorter.js";
29
+ import { useSpan as Ut } from "./hooks/use-span.js";
30
+ import { useKeyboardNavigation as Ya } from "./hooks/use-keyboard-navigation.js";
31
+ import { useChildrenComponents as Ua } from "../../_hooks/use-children-components.js";
32
+ import { Scrollbar as Gt } from "../scrollbar-v2/index.js";
33
+ import { useComponentRef as Ye } from "../../_hooks/use-component-ref.js";
34
+ import { useSize as Ga } from "../../_hooks/use-size.js";
35
+ import { useLocale as Ja } from "../../locale/index.js";
36
+ import { useScrollbar as Qa } from "../../_hooks/use-scrollbar.js";
37
+ import { setValueByPath as Jt, getValueByPath as Ue } from "../../_utils/get-value-by-path.js";
38
+ import { getClassNameMixin as Xa } from "../../_utils/config.js";
39
+ import { useTableLocale as Za } from "./locale.js";
40
+ import en from "../../icons/animation/animation-loading.js";
41
+ function tn(l) {
42
+ return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !pa(l);
40
43
  }
41
- const bt = {
44
+ const Qt = {
42
45
  wrapper: !0,
43
46
  cell: !1,
44
47
  headerCell: !1,
45
48
  bodyCell: !1
46
- }, un = /* @__PURE__ */ $l({
49
+ }, qn = /* @__PURE__ */ ha({
47
50
  name: "Table",
48
51
  props: {
49
52
  /**
@@ -54,6 +57,11 @@ const bt = {
54
57
  type: Array,
55
58
  default: () => []
56
59
  },
60
+ /** @zh 启用表体单元格方向键、Home / End 导航,保留原生 table 语义。 */
61
+ keyboardNavigation: {
62
+ type: Boolean,
63
+ default: !1
64
+ },
57
65
  /**
58
66
  * @zh 表格的数据
59
67
  * @en Table data
@@ -347,21 +355,21 @@ const bt = {
347
355
  }
348
356
  },
349
357
  emits: {
350
- "update:selectedKeys": (t) => !0,
351
- "update:expandedKeys": (t) => !0,
358
+ "update:selectedKeys": (l) => !0,
359
+ "update:expandedKeys": (l) => !0,
352
360
  /**
353
361
  * @zh 点击展开行时触发
354
362
  * @en Triggered when a row is clicked to expand
355
363
  * @param {string | number} rowKey
356
364
  * @param {TableData} record
357
365
  */
358
- expand: (t, d) => !0,
366
+ expand: (l, v) => !0,
359
367
  /**
360
368
  * @zh 已展开的数据行发生改变时触发
361
369
  * @en Triggered when the expanded data row changes
362
370
  * @param {(string | number)[]} rowKeys
363
371
  */
364
- expandedChange: (t) => !0,
372
+ expandedChange: (l) => !0,
365
373
  /**
366
374
  * @zh 点击行选择器时触发
367
375
  * @en Triggered when the row selector is clicked
@@ -369,45 +377,45 @@ const bt = {
369
377
  * @param {string | number} rowKey
370
378
  * @param {TableData} record
371
379
  */
372
- select: (t, d, s) => !0,
380
+ select: (l, v, h) => !0,
373
381
  /**
374
382
  * @zh 点击全选选择器时触发
375
383
  * @en Triggered when the select all selector is clicked
376
384
  * @param {boolean} checked
377
385
  */
378
- selectAll: (t) => !0,
386
+ selectAll: (l) => !0,
379
387
  /**
380
388
  * @zh 已选择的数据行发生改变时触发
381
389
  * @en Triggered when the selected data row changes
382
390
  * @param {(string | number)[]} rowKeys
383
391
  */
384
- selectionChange: (t) => !0,
392
+ selectionChange: (l) => !0,
385
393
  /**
386
394
  * @zh 排序规则发生改变时触发
387
395
  * @en Triggered when the collation changes
388
396
  * @param {string} dataIndex
389
397
  * @param {string} direction
390
398
  */
391
- sorterChange: (t, d) => !0,
399
+ sorterChange: (l, v) => !0,
392
400
  /**
393
401
  * @zh 过滤选项发生改变时触发
394
402
  * @en Triggered when the filter options are changed
395
403
  * @param {string} dataIndex
396
404
  * @param {string[]} filteredValues
397
405
  */
398
- filterChange: (t, d) => !0,
406
+ filterChange: (l, v) => !0,
399
407
  /**
400
408
  * @zh 表格分页发生改变时触发
401
409
  * @en Triggered when the table pagination changes
402
410
  * @param {number} page
403
411
  */
404
- pageChange: (t) => !0,
412
+ pageChange: (l) => !0,
405
413
  /**
406
414
  * @zh 表格每页数据数量发生改变时触发
407
415
  * @en Triggered when the number of data per page of the table changes
408
416
  * @param {number} pageSize
409
417
  */
410
- pageSizeChange: (t) => !0,
418
+ pageSizeChange: (l) => !0,
411
419
  /**
412
420
  * @zh 表格数据发生变化时触发
413
421
  * @en Triggered when table data changes
@@ -416,7 +424,7 @@ const bt = {
416
424
  * @param {TableData[]} currentData
417
425
  * @version 2.40.0 增加 currentData
418
426
  */
419
- change: (t, d, s) => !0,
427
+ change: (l, v, h) => !0,
420
428
  /**
421
429
  * @zh 单元格 hover 进入时触发
422
430
  * @en Triggered when hovering into a cell
@@ -424,7 +432,7 @@ const bt = {
424
432
  * @param {TableColumnData} column
425
433
  * @param {Event} ev
426
434
  */
427
- cellMouseEnter: (t, d, s) => !0,
435
+ cellMouseEnter: (l, v, h) => !0,
428
436
  /**
429
437
  * @zh 单元格 hover 退出时触发
430
438
  * @en Triggered when hovering out of a cell
@@ -432,7 +440,7 @@ const bt = {
432
440
  * @param {TableColumnData} column
433
441
  * @param {Event} ev
434
442
  */
435
- cellMouseLeave: (t, d, s) => !0,
443
+ cellMouseLeave: (l, v, h) => !0,
436
444
  /**
437
445
  * @zh 点击单元格时触发
438
446
  * @en Triggered when a cell is clicked
@@ -440,21 +448,21 @@ const bt = {
440
448
  * @param {TableColumnData} column
441
449
  * @param {Event} ev
442
450
  */
443
- cellClick: (t, d, s) => !0,
451
+ cellClick: (l, v, h) => !0,
444
452
  /**
445
453
  * @zh 点击行数据时触发
446
454
  * @en Triggered when row data is clicked
447
455
  * @param {TableData} record
448
456
  * @param {Event} ev
449
457
  */
450
- rowClick: (t, d) => !0,
458
+ rowClick: (l, v) => !0,
451
459
  /**
452
460
  * @zh 点击表头数据时触发
453
461
  * @en Triggered when the header data is clicked
454
462
  * @param {TableColumnData} column
455
463
  * @param {Event} ev
456
464
  */
457
- headerClick: (t, d) => !0,
465
+ headerClick: (l, v) => !0,
458
466
  /**
459
467
  * @zh 调整列宽时触发
460
468
  * @en Triggered when column width is adjusted
@@ -462,14 +470,14 @@ const bt = {
462
470
  * @param {number} width
463
471
  * @version 2.28.0
464
472
  */
465
- columnResize: (t, d) => !0,
473
+ columnResize: (l, v) => !0,
466
474
  /**
467
475
  * @zh 双击行数据时触发
468
476
  * @en Triggered when row data is double clicked
469
477
  * @param {TableData} record
470
478
  * @param {Event} ev
471
479
  */
472
- rowDblclick: (t, d) => !0,
480
+ rowDblclick: (l, v) => !0,
473
481
  /**
474
482
  * @zh 双击单元格时触发
475
483
  * @en Triggered when a cell is double clicked
@@ -477,14 +485,14 @@ const bt = {
477
485
  * @param {TableColumnData} column
478
486
  * @param {Event} ev
479
487
  */
480
- cellDblclick: (t, d, s) => !0,
488
+ cellDblclick: (l, v, h) => !0,
481
489
  /**
482
490
  * @zh 右击行数据时触发
483
491
  * @en Triggered when row data is right clicked
484
492
  * @param {TableData} record
485
493
  * @param {Event} ev
486
494
  */
487
- rowContextmenu: (t, d) => !0,
495
+ rowContextmenu: (l, v) => !0,
488
496
  /**
489
497
  * @zh 右击单元格时触发
490
498
  * @en Triggered when a cell is right clicked
@@ -492,7 +500,7 @@ const bt = {
492
500
  * @param {TableColumnData} column
493
501
  * @param {Event} ev
494
502
  */
495
- cellContextmenu: (t, d, s) => !0
503
+ cellContextmenu: (l, v, h) => !0
496
504
  },
497
505
  /**
498
506
  * @zh 表格列定义。启用时会屏蔽 columns 属性
@@ -585,904 +593,1130 @@ const bt = {
585
593
  * @binding {TableColumnData} column
586
594
  * @version 2.26.0
587
595
  */
588
- setup(t, {
589
- emit: d,
590
- slots: s
596
+ setup(l, {
597
+ emit: v,
598
+ slots: h
591
599
  }) {
592
600
  const {
593
- columns: pt,
594
- rowKey: Ae,
595
- rowSelection: ue,
596
- expandable: xt,
597
- loadMore: Ct,
598
- filterIconAlignLeft: St,
599
- selectedKeys: wt,
600
- defaultSelectedKeys: kt,
601
- expandedKeys: Rt,
602
- defaultExpandedKeys: Et,
603
- defaultExpandAllRows: Lt,
604
- spanMethod: At,
605
- draggable: Bt,
606
- summarySpanMethod: Dt,
607
- scrollbar: Y,
608
- showEmptyTree: Pt
609
- } = zl(t), i = pa("table"), {
610
- t: Ft
611
- } = ya(), A = h(() => Re(t.bordered) ? {
612
- ...bt,
613
- ...t.bordered
601
+ columns: Xt,
602
+ rowKey: Ge,
603
+ rowSelection: Ce,
604
+ expandable: Zt,
605
+ loadMore: el,
606
+ filterIconAlignLeft: tl,
607
+ selectedKeys: ll,
608
+ defaultSelectedKeys: al,
609
+ expandedKeys: nl,
610
+ defaultExpandedKeys: rl,
611
+ defaultExpandAllRows: ol,
612
+ spanMethod: il,
613
+ draggable: Je,
614
+ summarySpanMethod: ul,
615
+ scrollbar: re,
616
+ showEmptyTree: Qe
617
+ } = va(l), d = Xa("table"), {
618
+ t: sl
619
+ } = Ja(), j = g(() => qe(l.bordered) ? {
620
+ ...Qt,
621
+ ...l.bordered
614
622
  } : {
615
- ...bt,
616
- wrapper: t.bordered
623
+ ...Qt,
624
+ wrapper: l.bordered
617
625
  }), {
618
- children: Be,
619
- components: Kt
620
- } = va("TableColumn"), Tt = h(() => {
626
+ children: Xe,
627
+ components: dl
628
+ } = Ua("TableColumn"), ke = g(() => {
621
629
  var e;
622
- return ((e = ue.value) == null ? void 0 : e.checkStrictly) ?? !0;
630
+ return ((e = Ce.value) == null ? void 0 : e.checkStrictly) ?? !0;
623
631
  }), {
624
- displayScrollbar: q,
625
- scrollbarProps: T
626
- } = ba(Y), B = h(() => {
627
- var a, n, r, o;
628
- const e = !!((a = t.scroll) != null && a.x || (n = t.scroll) != null && n.minWidth), l = !!((r = t.scroll) != null && r.y || (o = t.scroll) != null && o.maxHeight);
632
+ displayScrollbar: oe,
633
+ scrollbarProps: X
634
+ } = Qa(re), N = g(() => {
635
+ var a, n, r, i;
636
+ const e = !!((a = l.scroll) != null && a.x || (n = l.scroll) != null && n.minWidth), t = !!((r = l.scroll) != null && r.y || (i = l.scroll) != null && i.maxHeight);
629
637
  return {
630
638
  x: e,
631
- y: l
639
+ y: t
632
640
  };
633
- }), ie = p(), $ = p({}), {
634
- componentRef: $t,
635
- elementRef: zt
636
- } = Ee("containerRef"), {
637
- componentRef: De,
638
- elementRef: J
639
- } = Ee("containerRef"), {
640
- componentRef: Mt,
641
- elementRef: Pe
642
- } = Ee("containerRef"), Fe = h(() => z.value ? J.value : zt.value), z = h(() => B.value.y || t.stickyHeader || te.value || B.value.x && b.value.length === 0), se = we(/* @__PURE__ */ new Map()), ce = p();
643
- ne([Kt, se], ([e, l]) => {
641
+ }), Re = A(), Z = A({}), {
642
+ componentRef: cl,
643
+ elementRef: fl
644
+ } = Ye("containerRef"), {
645
+ componentRef: ie,
646
+ elementRef: ue
647
+ } = Ye("containerRef"), {
648
+ componentRef: hl,
649
+ elementRef: Ze
650
+ } = Ye("containerRef"), _ = g(() => ee.value ? ue.value : fl.value), V = g(() => l.stickyHeader !== !1), vl = Za(), gl = `${ga()}-row-selection`, ee = g(() => N.value.y || V.value || !!l.virtualListProps || N.value.x && p.value.length === 0), Pe = _e(/* @__PURE__ */ new Map()), Le = A();
651
+ J([dl, Pe], ([e, t]) => {
644
652
  if (e.length > 0) {
645
653
  const a = [];
646
654
  e.forEach((n) => {
647
- const r = l.get(n);
655
+ const r = t.get(n);
648
656
  r && a.push(r);
649
- }), ce.value = a;
657
+ }), Le.value = a;
650
658
  } else
651
- ce.value = void 0;
659
+ Le.value = void 0;
660
+ });
661
+ const se = /* @__PURE__ */ new Map(), m = A([]), Ae = A([]), {
662
+ resizingColumn: ml,
663
+ columnWidth: q,
664
+ handleThMouseDown: yl,
665
+ handleThKeyDown: bl
666
+ } = Na(Z, v, (e) => {
667
+ var t;
668
+ return ((t = se.get(e)) == null ? void 0 : t.minWidth) ?? 40;
652
669
  });
653
- const de = /* @__PURE__ */ new Map(), v = p([]), fe = p([]), {
654
- resizingColumn: Wt,
655
- columnWidth: D,
656
- handleThMouseDown: Ot
657
- } = da($, d);
658
- ne([pt, ce, D], ([e, l]) => {
659
- const a = Gl(l ?? e ?? [], de, D);
660
- v.value = a.dataColumns, fe.value = a.groupColumns;
670
+ J([Xt, Le, q], ([e, t]) => {
671
+ const a = ka(t ?? e ?? [], se, q);
672
+ m.value = a.dataColumns, Ae.value = a.groupColumns;
661
673
  }, {
662
674
  immediate: !0,
663
675
  deep: !0
664
676
  });
665
- const me = h(() => ["tl", "top", "tr"].includes(t.pagePosition)), M = p(!1), W = p(!1), he = p(!1);
666
- Ml(() => {
667
- var n, r, o;
668
- let e = !1, l = !1, a = !1;
669
- ((n = t.rowSelection) != null && n.fixed || (r = t.expandable) != null && r.fixed || (o = t.draggable) != null && o.fixed) && (e = !0);
670
- for (const c of v.value)
671
- c.fixed === "left" ? (e = !0, a = !0) : c.fixed === "right" && (l = !0);
672
- e !== M.value && (M.value = e), l !== W.value && (W.value = l), a !== he.value && (he.value = a);
677
+ const Ee = g(() => ["tl", "top", "tr"].includes(l.pagePosition)), te = A(!1), le = A(!1), Te = A(!1);
678
+ ma(() => {
679
+ var n, r, i;
680
+ let e = !1, t = !1, a = !1;
681
+ ((n = l.rowSelection) != null && n.fixed || (r = l.expandable) != null && r.fixed || (i = l.draggable) != null && i.fixed) && (e = !0);
682
+ for (const o of m.value)
683
+ o.fixed === "left" ? (e = !0, a = !0) : o.fixed === "right" && (t = !0);
684
+ e !== te.value && (te.value = e), t !== le.value && (le.value = t), a !== Te.value && (Te.value = a);
673
685
  });
674
- const jt = h(() => {
675
- for (const e of v.value)
686
+ const pl = g(() => {
687
+ for (const e of m.value)
676
688
  if (e.ellipsis)
677
689
  return !0;
678
690
  return !1;
679
691
  }), O = (e) => {
680
- const l = {
692
+ const t = {
681
693
  type: e,
682
- page: _.value,
683
- pageSize: F.value,
684
- sorter: j.value,
685
- filters: P.value,
686
- dragTarget: e === "drag" ? I.data : void 0
694
+ page: D.value,
695
+ pageSize: k.value,
696
+ sorter: lt.value,
697
+ sorters: de.value,
698
+ filters: Y.value,
699
+ dragTarget: e === "drag" ? S.data : void 0
687
700
  };
688
- d("change", He.value, l, R.value);
689
- }, Ke = (e, l) => {
690
- Ht.value = {
691
- ...P.value,
692
- [e]: l
693
- }, ge(), d("filterChange", e, l), O("filter");
694
- }, Te = (e, l) => {
695
- Vt.value = l ? {
696
- field: e,
697
- direction: l
698
- } : void 0, ge(), d("sorterChange", e, l), O("sorter");
701
+ v("change", ct.value, t, _t(E.value));
702
+ }, et = (e, t) => {
703
+ Sl.value = {
704
+ ...Y.value,
705
+ [e]: t
706
+ }, $e(), v("filterChange", e, t), O("filter");
707
+ }, xl = (e, t) => {
708
+ kl(e, t), tt(e, t);
709
+ }, tt = (e, t) => {
710
+ $e(), v("sorterChange", e, t), O("sorter");
699
711
  }, {
700
- _filters: Ht,
701
- computedFilters: P,
702
- resetFilters: It,
703
- clearFilters: _t
704
- } = ma({
705
- columns: v,
706
- onFilterChange: Ke
712
+ _filters: Sl,
713
+ computedFilters: Y,
714
+ resetFilters: wl,
715
+ clearFilters: Cl
716
+ } = Va({
717
+ columns: m,
718
+ onFilterChange: et
707
719
  }), {
708
- _sorter: Vt,
709
- computedSorter: j,
710
- resetSorters: Nt,
711
- clearSorters: Gt
712
- } = ha({
713
- columns: v,
714
- onSorterChange: Te
715
- }), $e = /* @__PURE__ */ new Set(), Ut = h(() => {
720
+ computedSorter: lt,
721
+ computedSorters: de,
722
+ setSorter: kl,
723
+ resetSorters: Rl,
724
+ clearSorters: Pl
725
+ } = qa({
726
+ columns: m,
727
+ onSorterChange: tt
728
+ }), at = /* @__PURE__ */ new Set(), Ke = _e(/* @__PURE__ */ new WeakMap()), Ll = g(() => {
716
729
  const e = [];
717
- $e.clear();
718
- const l = (a) => {
719
- if (_l(a) && a.length > 0)
720
- for (const n of a)
721
- e.push(n[Ae.value]), n.disabled && $e.add(n[Ae.value]), n.children && l(n.children);
730
+ at.clear();
731
+ const t = (a) => {
732
+ if (Sa(a) && a.length > 0)
733
+ for (const n of a) {
734
+ e.push(n[Ge.value]), n.disabled && at.add(n[Ge.value]);
735
+ const r = n.children ?? Ke.get(n);
736
+ r && t(r);
737
+ }
722
738
  };
723
- return l(t.data), e;
724
- }), Yt = h(() => {
725
- const e = [], l = (a) => {
739
+ return t(l.data), e;
740
+ }), Al = g(() => {
741
+ const e = [], t = (a) => {
726
742
  for (const n of a)
727
- e.push(n.key), n.children && l(n.children);
743
+ e.push(n.key), n.children && t(n.children);
728
744
  };
729
- return l(b.value), e;
730
- }), ze = h(() => {
731
- const e = [], l = (a) => {
745
+ return t(p.value), e;
746
+ }), nt = g(() => {
747
+ const e = [], t = (a) => {
732
748
  for (const n of a)
733
- n.disabled || e.push(n.key), n.children && l(n.children);
749
+ !n.disabled && (ke.value || n.isLeaf) && e.push(n.key), n.children && t(n.children);
734
750
  };
735
- return l(b.value), e;
751
+ return t(p.value), e;
736
752
  }), {
737
- selectedRowKeys: qt,
738
- currentSelectedRowKeys: Me,
739
- handleSelect: Jt,
740
- handleSelectAllLeafs: Qt,
741
- handleSelectAll: Xt,
742
- select: Zt,
743
- selectAll: el,
744
- clearSelected: tl
745
- } = Jl({
746
- selectedKeys: wt,
747
- defaultSelectedKeys: kt,
748
- rowSelection: ue,
749
- currentAllRowKeys: Yt,
750
- currentAllEnabledRowKeys: ze,
751
- emit: d
753
+ isRadio: El,
754
+ selectedRowKeys: Tl,
755
+ currentSelectedRowKeys: De,
756
+ handleSelect: Kl,
757
+ handleSelectAllLeafs: Dl,
758
+ handleSelectAll: Bl,
759
+ select: $l,
760
+ selectAll: Ml,
761
+ clearSelected: zl
762
+ } = Ea({
763
+ selectedKeys: ll,
764
+ defaultSelectedKeys: al,
765
+ rowSelection: Ce,
766
+ currentAllRowKeys: Al,
767
+ currentAllEnabledRowKeys: nt,
768
+ emit: v
752
769
  }), {
753
- expandedRowKeys: We,
754
- handleExpand: ll,
755
- expand: al,
756
- expandAll: nl
757
- } = Ql({
758
- expandedKeys: Rt,
759
- defaultExpandedKeys: Et,
760
- defaultExpandAllRows: Lt,
761
- expandable: xt,
762
- allRowKeys: Ut,
763
- emit: d
764
- }), ve = we({}), rl = (e, l) => {
765
- e && (ve[l.key] = e);
766
- }, ol = (e) => {
767
- var l, a;
768
- for (const n of Object.keys(P.value)) {
769
- const r = P.value[n], o = de.get(n);
770
- if (o && ((l = o.filterable) != null && l.filter) && r.length > 0) {
771
- const c = (a = o.filterable) == null ? void 0 : a.filter(r, e.raw);
772
- if (!c)
773
- return c;
770
+ expandedRowKeys: ce,
771
+ handleExpand: Fl,
772
+ expand: Wl,
773
+ expandAll: Ol
774
+ } = Ta({
775
+ expandedKeys: nl,
776
+ defaultExpandedKeys: rl,
777
+ defaultExpandAllRows: ol,
778
+ expandable: Zt,
779
+ allRowKeys: Ll,
780
+ emit: v
781
+ }), rt = (e, t) => {
782
+ e && Ke.set(t.raw, e);
783
+ }, Be = /* @__PURE__ */ new WeakMap();
784
+ let ot = !0;
785
+ It(() => {
786
+ ot = !1;
787
+ });
788
+ const Il = (e) => {
789
+ const t = Be.get(e.raw);
790
+ if (t) return t;
791
+ const a = new Promise((n, r) => {
792
+ var i;
793
+ Promise.resolve((i = l.loadMore) == null ? void 0 : i.call(l, e.raw, n)).catch(r);
794
+ }).then((n) => (ot && rt(n, e), n)).finally(() => Be.delete(e.raw));
795
+ return Be.set(e.raw, a), a;
796
+ }, Hl = (e) => {
797
+ var t, a;
798
+ for (const n of Object.keys(Y.value)) {
799
+ const r = Y.value[n], i = se.get(n);
800
+ if (i && ((t = i.filterable) != null && t.filter) && r.length > 0) {
801
+ const o = (a = i.filterable) == null ? void 0 : a.filter(r, e.raw);
802
+ if (!o)
803
+ return o;
774
804
  }
775
805
  }
776
806
  return !0;
777
807
  }, {
778
- dragType: H,
779
- dragState: I,
780
- handleDragStart: ul,
781
- handleDragEnter: il,
782
- handleDragover: sl,
783
- handleDragEnd: cl,
784
- handleDrop: dl
785
- } = ca(Bt), Oe = h(() => {
786
- const e = (l) => {
808
+ beginDrag: it,
809
+ clearDragState: ut,
810
+ dragType: T,
811
+ dragState: S,
812
+ handleDragStart: jl,
813
+ handleDragEnter: Nl,
814
+ handleDragover: _l,
815
+ handleDragEnd: Vl,
816
+ handleDrop: ql
817
+ } = ja(Je), st = g(() => {
818
+ const e = (t) => {
787
819
  const a = [];
788
- for (const n of l) {
820
+ for (const n of t) {
789
821
  const r = {
790
822
  raw: n,
791
- key: n[t.rowKey],
823
+ key: n[l.rowKey],
792
824
  disabled: n.disabled,
793
825
  expand: n.expand,
794
826
  isLeaf: n.isLeaf
795
827
  };
796
- n.children ? (r.isLeaf = !1, r.children = e(n.children)) : t.loadMore && !n.isLeaf ? (r.isLeaf = !1, ve[r.key] && (r.children = e(ve[r.key]))) : r.isLeaf = !0, r.hasSubtree = !!(r.children ? !t.hideExpandButtonOnEmpty || r.children.length > 0 : t.loadMore && !r.isLeaf), a.push(r);
828
+ if (n.children)
829
+ r.isLeaf = n.children.length === 0, r.children = e(n.children);
830
+ else if (l.loadMore && !n.isLeaf) {
831
+ r.isLeaf = !1;
832
+ const i = Ke.get(n);
833
+ i && (r.children = e(i), r.isLeaf = i.length === 0);
834
+ } else
835
+ r.isLeaf = !0;
836
+ r.hasSubtree = !!(r.children ? !l.hideExpandButtonOnEmpty || r.children.length > 0 : l.loadMore && !r.isLeaf), a.push(r);
797
837
  }
798
838
  return a;
799
839
  };
800
- return e(t.data ?? []);
801
- }), je = h(() => {
802
- const e = (l) => l.reduce((a, n) => (ol(n) && a.push({
840
+ return e(l.data ?? []);
841
+ }), dt = g(() => {
842
+ const e = (t) => t.reduce((a, n) => (Hl(n) && a.push({
803
843
  ...n,
804
844
  children: n.children ? e(n.children) : void 0
805
845
  }), a), []);
806
- return Object.keys(P.value).length > 0 ? e(Oe.value) : Oe.value;
807
- }), R = h(() => {
808
- var l, a;
809
- const e = Ul(je.value);
846
+ return Object.keys(Y.value).length > 0 ? e(st.value) : st.value;
847
+ }), E = g(() => {
848
+ var t;
849
+ const e = Ra(dt.value);
810
850
  if (e.length > 0) {
811
- if ((l = j.value) != null && l.field) {
812
- const o = de.get(j.value.field);
813
- if (o && ((a = o.sortable) == null ? void 0 : a.sorter) !== !0) {
814
- const {
815
- field: c,
816
- direction: m
817
- } = j.value;
818
- e.sort((g, w) => {
819
- var f;
820
- const x = Le(g.raw, c), ae = Le(w.raw, c);
821
- if ((f = o.sortable) != null && f.sorter && K(o.sortable.sorter))
822
- return o.sortable.sorter(g.raw, w.raw, {
823
- dataIndex: c,
824
- direction: m
851
+ if (de.value.length) {
852
+ const r = (o, u) => {
853
+ var f, x;
854
+ for (const {
855
+ field: R,
856
+ direction: K
857
+ } of de.value) {
858
+ const P = se.get(R);
859
+ if (!P || ((f = P.sortable) == null ? void 0 : f.sorter) === !0) continue;
860
+ const z = Ue(o.raw, R), H = Ue(u.raw, R);
861
+ if ((x = P.sortable) != null && x.sorter && Q(P.sortable.sorter)) {
862
+ const c = P.sortable.sorter(o.raw, u.raw, {
863
+ dataIndex: R,
864
+ direction: K
825
865
  });
826
- const N = x === ae ? 0 : x > ae ? 1 : -1;
827
- return m === "descend" ? -N : N;
866
+ if (c) return c;
867
+ continue;
868
+ }
869
+ const y = z === H ? 0 : z > H ? 1 : -1;
870
+ if (y) return K === "descend" ? -y : y;
871
+ }
872
+ return 0;
873
+ }, i = (o) => {
874
+ o.sort(r), o.forEach((u) => {
875
+ u.children && i(u.children);
828
876
  });
829
- }
877
+ };
878
+ i(e);
830
879
  }
831
880
  const {
832
- sourcePath: n,
833
- targetPath: r
834
- } = I;
835
- if (I.dragging && r.length && r.toString() !== n.toString() && n.length === r.length && n.slice(0, -1).toString() === r.slice(0, -1).toString()) {
836
- let o = e;
837
- for (let c = 0; c < n.length; c++) {
838
- const m = n[c];
839
- if (c >= n.length - 1) {
840
- const w = o[m], x = r[c];
841
- x > m ? (o.splice(x + 1, 0, w), o.splice(m, 1)) : (o.splice(x, 0, w), o.splice(m + 1, 1));
881
+ sourcePath: a,
882
+ targetPath: n
883
+ } = S;
884
+ if (S.dragging && n.length && n.toString() !== a.toString() && a.length === n.length && a.slice(0, -1).toString() === n.slice(0, -1).toString()) {
885
+ let r = e;
886
+ for (let i = 0; i < a.length; i++) {
887
+ const o = a[i];
888
+ if (i >= a.length - 1) {
889
+ const f = r[o], x = n[i];
890
+ if (!f || !r[x]) break;
891
+ x > o ? (r.splice(x + 1, 0, f), r.splice(o, 1)) : (r.splice(x, 0, f), r.splice(o + 1, 1));
842
892
  } else
843
- o = o[m].children ?? [];
893
+ r = ((t = r[o]) == null ? void 0 : t.children) ?? [];
844
894
  }
845
895
  }
846
896
  }
847
897
  return e;
848
898
  }), {
849
- page: _,
850
- pageSize: F,
851
- handlePageChange: fl,
852
- handlePageSizeChange: ml,
853
- resetPage: ge,
854
- clampPage: hl
855
- } = Xl(t, d);
856
- ne(() => [R.value.length, F.value], ([e]) => hl(e), {
899
+ page: D,
900
+ pageSize: k,
901
+ handlePageChange: Yl,
902
+ handlePageSizeChange: Ul,
903
+ resetPage: $e,
904
+ clampPage: Gl
905
+ } = Ka(l, v);
906
+ J(() => [E.value.length, k.value], ([e]) => Gl(e), {
857
907
  immediate: !0
858
908
  });
859
909
  const {
860
- mergedSize: vl
861
- } = ga(Wl(t, "size"), {
910
+ mergedSize: Jl
911
+ } = Ga(Ht(l, "size"), {
862
912
  defaultValue: "large"
863
- }), gl = h(() => {
913
+ }), Ql = g(() => {
864
914
  var e;
865
- return ((e = ue.value) == null ? void 0 : e.onlyCurrent) ?? !1;
915
+ return ((e = Ce.value) == null ? void 0 : e.onlyCurrent) ?? !1;
866
916
  });
867
- ne(_, (e, l) => {
868
- e !== l && gl.value && tl();
917
+ J(D, (e, t) => {
918
+ e !== t && Ql.value && zl();
869
919
  });
870
- const b = h(() => t.pagination && R.value.length > F.value ? R.value.slice((_.value - 1) * F.value, _.value * F.value) : R.value), He = h(() => Yl(b.value)), yl = () => v.value.reduce((e, l, a) => {
871
- if (l.dataIndex)
920
+ const p = g(() => l.pagination && E.value.length > k.value ? E.value.slice((D.value - 1) * k.value, D.value * k.value) : E.value), ct = g(() => _t(p.value)), Xl = () => m.value.reduce((e, t, a) => {
921
+ if (t.dataIndex)
872
922
  if (a === 0)
873
- yt(e, l.dataIndex, t.summaryText ?? Ft("table.summaryText"), {
923
+ Jt(e, t.dataIndex, l.summaryText ?? sl("table.summaryText"), {
874
924
  addPath: !0
875
925
  });
876
926
  else {
877
927
  let n = 0, r = !1;
878
- b.value.forEach((o) => {
879
- if (l.dataIndex) {
880
- const c = Le(o.raw, l.dataIndex);
881
- L(c) ? n += c : !Vl(c) && !Nl(c) && (r = !0);
928
+ p.value.forEach((i) => {
929
+ if (t.dataIndex) {
930
+ const o = Ue(i.raw, t.dataIndex);
931
+ W(o) ? n += o : !wa(o) && !Ca(o) && (r = !0);
882
932
  }
883
- }), yt(e, l.dataIndex, r ? "" : n, {
933
+ }), Jt(e, t.dataIndex, r ? "" : n, {
884
934
  addPath: !0
885
935
  });
886
936
  }
887
937
  return e;
888
- }, {}), Ie = (e) => e && e.length > 0 ? e.map((l) => ({
889
- raw: l,
890
- key: l[t.rowKey]
891
- })) : [], S = h(() => t.summary ? K(t.summary) ? Ie(t.summary({
892
- columns: v.value,
893
- data: He.value
894
- })) : Ie([yl()]) : []), Q = p(0), X = p(!0), Z = p(!0), ye = () => {
895
- let e = !0, l = !0;
896
- const a = Fe.value;
897
- a && (e = Q.value === 0, l = Math.ceil(Q.value + a.offsetWidth) >= a.scrollWidth), e !== X.value && (X.value = e), l !== Z.value && (Z.value = l);
898
- }, bl = () => X.value && Z.value ? i.modifier("scroll-position-both") : X.value ? i.modifier("scroll-position-left") : Z.value ? i.modifier("scroll-position-right") : i.modifier("scroll-position-middle"), pl = () => {
938
+ }, {}), ft = (e) => e && e.length > 0 ? e.map((t) => ({
939
+ raw: t,
940
+ key: t[l.rowKey]
941
+ })) : [], $ = g(() => l.summary ? Q(l.summary) ? ft(l.summary({
942
+ columns: m.value,
943
+ data: ct.value
944
+ })) : ft([Xl()]) : []), fe = A(0), he = A(!0), ve = A(!0), Me = () => {
945
+ let e = !0, t = !0;
946
+ const a = _.value;
947
+ a && (e = fe.value === 0, t = Math.ceil(fe.value + a.offsetWidth) >= a.scrollWidth), e !== he.value && (he.value = e), t !== ve.value && (ve.value = t);
948
+ }, Zl = () => he.value && ve.value ? d.modifier("scroll-position-both") : he.value ? d.modifier("scroll-position-left") : ve.value ? d.modifier("scroll-position-right") : d.modifier("scroll-position-middle"), ea = () => {
899
949
  const e = [];
900
- return M.value && e.push(i.modifier("has-fixed-col-left")), W.value && e.push(i.modifier("has-fixed-col-right")), e;
901
- }, _e = (e) => {
902
- e.target.scrollLeft !== Q.value && (Q.value = e.target.scrollLeft), ye();
903
- }, Ve = (e) => {
904
- _e(e);
950
+ return te.value && e.push(d.modifier("has-fixed-col-left")), le.value && e.push(d.modifier("has-fixed-col-right")), e;
951
+ }, ht = (e) => {
952
+ e.target.scrollLeft !== fe.value && (fe.value = e.target.scrollLeft), Me();
953
+ }, vt = (e) => {
954
+ ht(e);
905
955
  const {
906
- scrollLeft: l
956
+ scrollLeft: t
907
957
  } = e.target;
908
- Pe.value && (Pe.value.scrollLeft = l), ie.value && (ie.value.scrollLeft = l);
909
- }, Ne = (e, l) => {
910
- d("rowClick", e.raw, l);
911
- }, xl = (e, l) => {
912
- d("rowDblclick", e.raw, l);
913
- }, Cl = (e, l) => {
914
- d("rowContextmenu", e.raw, l);
915
- }, Ge = (e, l, a) => {
916
- d("cellClick", e.raw, l, a);
917
- }, Ue = ft((e, l, a) => {
918
- d("cellMouseEnter", e.raw, l, a);
919
- }, 30), Ye = ft((e, l, a) => {
920
- d("cellMouseLeave", e.raw, l, a);
921
- }, 30), qe = (e, l, a) => {
922
- d("cellDblclick", e.raw, l, a);
923
- }, Je = (e, l, a) => {
924
- d("cellContextmenu", e.raw, l, a);
925
- }, Sl = (e, l) => {
926
- d("headerClick", e, l);
927
- }, y = h(() => {
928
- var c, m;
929
- const e = [], l = M.value || W.value;
958
+ Ze.value && (Ze.value.scrollLeft = t), Re.value && (Re.value.scrollLeft = t);
959
+ }, gt = (e, t) => {
960
+ v("rowClick", e.raw, t);
961
+ }, ta = (e, t) => {
962
+ v("rowDblclick", e.raw, t);
963
+ }, la = (e, t) => {
964
+ v("rowContextmenu", e.raw, t);
965
+ }, mt = (e, t, a) => {
966
+ v("cellClick", e.raw, t, a);
967
+ }, yt = Nt((e, t, a) => {
968
+ v("cellMouseEnter", e.raw, t, a);
969
+ }, 30), bt = Nt((e, t, a) => {
970
+ v("cellMouseLeave", e.raw, t, a);
971
+ }, 30), pt = (e, t, a) => {
972
+ v("cellDblclick", e.raw, t, a);
973
+ }, xt = (e, t, a) => {
974
+ v("cellContextmenu", e.raw, t, a);
975
+ }, aa = (e, t) => {
976
+ v("headerClick", e, t);
977
+ }, b = g(() => {
978
+ var o, u;
979
+ const e = [], t = te.value || le.value;
930
980
  let a, n, r;
931
- ((c = t.draggable) == null ? void 0 : c.type) === "handle" && (a = {
981
+ ((o = l.draggable) == null ? void 0 : o.type) === "handle" && (a = {
932
982
  name: "drag-handle",
933
- title: t.draggable.title,
934
- width: t.draggable.width,
935
- fixed: t.draggable.fixed || l
936
- }, e.push(a)), t.expandable && (n = {
983
+ title: l.draggable.title,
984
+ width: l.draggable.width,
985
+ fixed: l.draggable.fixed || t
986
+ }, e.push(a)), l.expandable && (n = {
937
987
  name: "expand",
938
- title: t.expandable.title,
939
- width: t.expandable.width,
940
- fixed: t.expandable.fixed || l
941
- }, e.push(n)), t.rowSelection && (r = {
942
- name: t.rowSelection.type === "radio" ? "selection-radio" : "selection-checkbox",
943
- title: t.rowSelection.title,
944
- width: t.rowSelection.width,
945
- fixed: t.rowSelection.fixed || l
946
- }, e.push(r)), !he.value && e.length > 0 && e[e.length - 1].fixed && (e[e.length - 1].isLastLeftFixed = !0);
947
- const o = (m = t.components) == null ? void 0 : m.operations;
948
- return K(o) ? o({
988
+ title: l.expandable.title,
989
+ width: l.expandable.width,
990
+ fixed: l.expandable.fixed || t
991
+ }, e.push(n)), l.rowSelection && (r = {
992
+ name: l.rowSelection.type === "radio" ? "selection-radio" : "selection-checkbox",
993
+ title: l.rowSelection.title,
994
+ width: l.rowSelection.width,
995
+ fixed: l.rowSelection.fixed || t
996
+ }, e.push(r)), !Te.value && e.length > 0 && e[e.length - 1].fixed && (e[e.length - 1].isLastLeftFixed = !0);
997
+ const i = (u = l.components) == null ? void 0 : u.operations;
998
+ return Q(i) ? i({
949
999
  dragHandle: a,
950
1000
  expand: n,
951
1001
  selection: r
952
1002
  }) : e;
953
- }), wl = h(() => {
954
- var e, l, a, n;
955
- if (B.value.x) {
1003
+ }), na = g(() => {
1004
+ var e, t, a, n;
1005
+ if (N.value.x) {
956
1006
  const r = {
957
- width: L((e = t.scroll) == null ? void 0 : e.x) ? `${(l = t.scroll) == null ? void 0 : l.x}px` : (a = t.scroll) == null ? void 0 : a.x
1007
+ width: W((e = l.scroll) == null ? void 0 : e.x) ? `${(t = l.scroll) == null ? void 0 : t.x}px` : (a = l.scroll) == null ? void 0 : a.x
958
1008
  };
959
- return (n = t.scroll) != null && n.minWidth && (r.minWidth = L(t.scroll.minWidth) ? `${t.scroll.minWidth}px` : t.scroll.minWidth), r;
1009
+ return (n = l.scroll) != null && n.minWidth && (r.minWidth = W(l.scroll.minWidth) ? `${l.scroll.minWidth}px` : l.scroll.minWidth), r;
960
1010
  }
961
- }), ee = h(() => {
962
- var e, l, a, n;
963
- if (B.value.x && b.value.length > 0) {
1011
+ }), ge = g(() => {
1012
+ var e, t, a, n;
1013
+ if (N.value.x && p.value.length > 0) {
964
1014
  const r = {
965
- width: L((e = t.scroll) == null ? void 0 : e.x) ? `${(l = t.scroll) == null ? void 0 : l.x}px` : (a = t.scroll) == null ? void 0 : a.x
1015
+ width: W((e = l.scroll) == null ? void 0 : e.x) ? `${(t = l.scroll) == null ? void 0 : t.x}px` : (a = l.scroll) == null ? void 0 : a.x
966
1016
  };
967
- return (n = t.scroll) != null && n.minWidth && (r.minWidth = L(t.scroll.minWidth) ? `${t.scroll.minWidth}px` : t.scroll.minWidth), r;
1017
+ return (n = l.scroll) != null && n.minWidth && (r.minWidth = W(l.scroll.minWidth) ? `${l.scroll.minWidth}px` : l.scroll.minWidth), r;
968
1018
  }
969
1019
  });
970
- Ol(fa, we({
971
- loadMore: Ct,
972
- addLazyLoadData: rl,
973
- slots: s,
974
- sorter: j,
975
- filters: P,
976
- filterIconAlignLeft: St,
977
- resizingColumn: Wt,
978
- checkStrictly: Tt,
979
- currentAllEnabledRowKeys: ze,
980
- currentSelectedRowKeys: Me,
981
- addColumn: (e, l) => {
982
- se.set(e, l);
1020
+ ya(_a, _e({
1021
+ loadMore: el,
1022
+ addLazyLoadData: rt,
1023
+ loadChildren: Il,
1024
+ slots: h,
1025
+ sorter: lt,
1026
+ sorters: de,
1027
+ filters: Y,
1028
+ filterIconAlignLeft: tl,
1029
+ resizingColumn: ml,
1030
+ selectionName: gl,
1031
+ checkStrictly: ke,
1032
+ currentAllEnabledRowKeys: nt,
1033
+ currentSelectedRowKeys: De,
1034
+ expandedRowKeys: ce,
1035
+ addColumn: (e, t) => {
1036
+ Pe.set(e, t);
983
1037
  },
984
1038
  removeColumn: (e) => {
985
- se.delete(e);
1039
+ Pe.delete(e);
986
1040
  },
987
- onSelectAll: Xt,
988
- onSelect: Jt,
989
- onSelectAllLeafs: Qt,
990
- onSorterChange: Te,
991
- onFilterChange: Ke,
992
- onThMouseDown: Ot
1041
+ onSelectAll: Bl,
1042
+ onSelect: Kl,
1043
+ onSelectAllLeafs: Dl,
1044
+ onSorterChange: xl,
1045
+ onFilterChange: et,
1046
+ onThMouseDown: yl,
1047
+ onThKeyDown: bl
993
1048
  }));
994
- const Qe = h(() => [i.block, i.modifier(`size-${vl.value}`), {
995
- [i.modifier("border")]: A.value.wrapper,
996
- [i.modifier("border-cell")]: A.value.cell,
997
- [i.modifier("border-header-cell")]: !A.value.cell && A.value.headerCell,
998
- [i.modifier("border-body-cell")]: !A.value.cell && A.value.bodyCell,
999
- [i.modifier("stripe")]: t.stripe,
1000
- [i.modifier("hover")]: t.hoverable,
1001
- [i.modifier("dragging")]: I.dragging,
1002
- [i.modifier("type-selection")]: !!t.rowSelection,
1003
- [i.modifier("empty")]: t.data && b.value.length === 0,
1004
- [i.modifier("layout-fixed")]: t.tableLayoutFixed || B.value.x || z.value || jt.value
1005
- }]), kl = h(() => [i.modifier("pagination"), {
1006
- [i.modifier("pagination-left")]: t.pagePosition === "tl" || t.pagePosition === "bl",
1007
- [i.modifier("pagination-center")]: t.pagePosition === "top" || t.pagePosition === "bottom",
1008
- [i.modifier("pagination-right")]: t.pagePosition === "tr" || t.pagePosition === "br",
1009
- [i.modifier("pagination-top")]: me.value
1010
- }]), Rl = h(() => {
1011
- const e = pl();
1012
- return B.value.x && e.push(bl()), z.value && e.push(i.modifier("scroll-y")), e;
1013
- }), te = h(() => !!t.virtualListProps), be = p({}), Xe = () => {
1049
+ const St = g(() => [d.block, d.modifier(`size-${Jl.value}`), {
1050
+ [d.modifier("border")]: j.value.wrapper,
1051
+ [d.modifier("border-cell")]: j.value.cell,
1052
+ [d.modifier("border-header-cell")]: !j.value.cell && j.value.headerCell,
1053
+ [d.modifier("border-body-cell")]: !j.value.cell && j.value.bodyCell,
1054
+ [d.modifier("stripe")]: l.stripe,
1055
+ [d.modifier("hover")]: l.hoverable,
1056
+ [d.modifier("dragging")]: S.dragging,
1057
+ [d.modifier("type-selection")]: !!l.rowSelection,
1058
+ [d.modifier("empty")]: l.data && p.value.length === 0,
1059
+ [d.modifier("layout-fixed")]: l.tableLayoutFixed || N.value.x || ee.value || pl.value,
1060
+ [d.modifier("virtualized")]: U.value,
1061
+ [d.modifier("sticky-header")]: V.value
1062
+ }]), ra = g(() => [d.modifier("pagination"), {
1063
+ [d.modifier("pagination-left")]: l.pagePosition === "tl" || l.pagePosition === "bl",
1064
+ [d.modifier("pagination-center")]: l.pagePosition === "top" || l.pagePosition === "bottom",
1065
+ [d.modifier("pagination-right")]: l.pagePosition === "tr" || l.pagePosition === "br",
1066
+ [d.modifier("pagination-top")]: Ee.value
1067
+ }]), oa = g(() => {
1068
+ const e = ea();
1069
+ return N.value.x && e.push(Zl()), ee.value && e.push(d.modifier("scroll-y")), e;
1070
+ }), U = g(() => !!l.virtualListProps && !l.spanMethod), I = A({}), ze = g(() => m.value.map((e) => ({
1071
+ ...e,
1072
+ _resizeWidth: e.dataIndex && I.value[e.dataIndex] > 0 ? I.value[e.dataIndex] : e._resizeWidth
1073
+ }))), G = g(() => b.value.map((e) => ({
1074
+ ...e,
1075
+ width: I.value[e.name] > 0 ? I.value[e.name] : e.width
1076
+ }))), me = () => {
1014
1077
  const e = {};
1015
- for (const l of Object.keys($.value))
1016
- e[l] = $.value[l].offsetWidth;
1017
- be.value = e;
1018
- }, V = p(!1), Ze = () => J.value ? J.value.offsetWidth > J.value.clientWidth : !1, El = () => {
1019
- const e = Ze();
1020
- V.value !== e && (V.value = e), ye(), Xe();
1078
+ for (const a of Object.keys(Z.value))
1079
+ e[a] = Z.value[a].getBoundingClientRect().width;
1080
+ const t = _.value;
1081
+ for (const a of (t == null ? void 0 : t.querySelectorAll("[data-x-table-column]")) ?? []) {
1082
+ const n = a.dataset.xTableColumn;
1083
+ n && !e[n] && a.getAttribute("colspan") === null && (e[n] = a.getBoundingClientRect().width);
1084
+ }
1085
+ I.value = e;
1086
+ };
1087
+ J([m, b, () => l.showHeader], () => {
1088
+ jt(() => me());
1089
+ }, {
1090
+ flush: "post"
1091
+ });
1092
+ const ae = A(!1), wt = () => ue.value ? ue.value.offsetWidth > ue.value.clientWidth : !1, ia = () => {
1093
+ const e = wt();
1094
+ ae.value !== e && (ae.value = e), Me(), me();
1021
1095
  };
1022
- jl(() => {
1023
- V.value = Ze(), Xe();
1096
+ ba(() => {
1097
+ ae.value = wt(), me();
1024
1098
  });
1025
- const Ll = h(() => Re(t.loading) ? t.loading : {
1026
- loading: t.loading,
1027
- dot: "color"
1028
- }), et = () => u(U, {
1099
+ const Fe = g(() => qe(l.loading) ? l.loading : {
1100
+ loading: l.loading
1101
+ }), Ct = () => s(ne, {
1029
1102
  empty: !0
1030
1103
  }, {
1031
- default: () => [u(oe, {
1032
- colSpan: v.value.length + y.value.length
1104
+ default: () => [s(we, {
1105
+ colSpan: m.value.length + b.value.length
1033
1106
  }, {
1034
1107
  default: () => {
1035
1108
  var e;
1036
- return [((e = s.empty) == null ? void 0 : e.call(s)) ?? u(aa, {
1109
+ return [((e = h.empty) == null ? void 0 : e.call(h)) ?? s(za, {
1037
1110
  component: "table"
1038
1111
  }, null)];
1039
1112
  }
1040
1113
  })]
1041
- }), Al = (e) => {
1042
- var l;
1114
+ }), We = (e) => {
1115
+ var t;
1043
1116
  if (e.expand)
1044
- return K(e.expand) ? e.expand() : e.expand;
1045
- if (s["expand-row"])
1046
- return s["expand-row"]({
1117
+ return Q(e.expand) ? e.expand() : e.expand;
1118
+ if (h["expand-row"])
1119
+ return h["expand-row"]({
1047
1120
  record: e.raw
1048
1121
  });
1049
- if ((l = t.expandable) != null && l.expandedRowRender)
1050
- return t.expandable.expandedRowRender(e.raw);
1051
- }, tt = h(() => [].concat(y.value, v.value)), Bl = h(() => t.spanAll ? tt.value : v.value), {
1052
- tableSpan: lt,
1053
- removedCells: at
1054
- } = vt({
1055
- spanMethod: At,
1056
- data: b,
1057
- columns: Bl
1122
+ if ((t = l.expandable) != null && t.expandedRowRender)
1123
+ return l.expandable.expandedRowRender(e.raw);
1124
+ }, kt = g(() => [].concat(b.value, m.value)), ua = g(() => l.spanAll ? kt.value : m.value), {
1125
+ tableSpan: Rt,
1126
+ removedCells: ye
1127
+ } = Ut({
1128
+ spanMethod: il,
1129
+ data: p,
1130
+ columns: ua
1058
1131
  }), {
1059
- tableSpan: nt,
1060
- removedCells: rt
1061
- } = vt({
1062
- spanMethod: Dt,
1063
- data: S,
1064
- columns: tt
1065
- }), le = (e) => {
1066
- if (!(!te.value || !e || !be.value[e]))
1132
+ tableSpan: Pt,
1133
+ removedCells: Lt
1134
+ } = Ut({
1135
+ spanMethod: ul,
1136
+ data: $,
1137
+ columns: kt
1138
+ }), be = (e) => {
1139
+ if (!(!U.value || !e || !I.value[e]))
1067
1140
  return {
1068
- width: `${be.value[e]}px`
1141
+ width: `${I.value[e]}px`
1069
1142
  };
1070
- }, Dl = (e, l) => u(U, {
1071
- key: `table-summary-${l}`,
1072
- class: [i.element("tr-summary"), K(t.rowClass) ? t.rowClass(e.raw, l) : t.rowClass],
1073
- onClick: (a) => Ne(e, a)
1143
+ }, sa = (e, t) => s(ne, {
1144
+ key: `table-summary-${t}`,
1145
+ class: [d.element("tr-summary"), Q(l.rowClass) ? l.rowClass(e.raw, t) : l.rowClass],
1146
+ onClick: (a) => gt(e, a)
1074
1147
  }, {
1075
- default: () => [y.value.map((a, n) => {
1076
- const r = `${l}-${n}-${e.key}`, [o, c] = nt.value[r] ?? [1, 1];
1077
- if (rt.value.includes(r))
1148
+ default: () => [b.value.map((a, n) => {
1149
+ const r = `${t}-${n}-${e.key}`, [i, o] = Pt.value[r] ?? [1, 1];
1150
+ if (Lt.value.includes(r))
1078
1151
  return null;
1079
- const m = le(a.name);
1080
- return u(mt, {
1081
- style: m,
1152
+ const u = be(a.name);
1153
+ return s(Vt, {
1154
+ style: u,
1082
1155
  operationColumn: a,
1083
- operations: y.value,
1156
+ operations: G.value,
1084
1157
  record: e,
1085
- rowSpan: o,
1086
- colSpan: c,
1158
+ rowSpan: i,
1159
+ colSpan: o,
1087
1160
  summary: !0
1088
1161
  }, null);
1089
- }), v.value.map((a, n) => {
1090
- const r = `${l}-${y.value.length + n}-${e.key}`, [o, c] = nt.value[r] ?? [1, 1];
1091
- if (rt.value.includes(r))
1162
+ }), m.value.map((a, n) => {
1163
+ const r = `${t}-${b.value.length + n}-${e.key}`, [i, o] = Pt.value[r] ?? [1, 1];
1164
+ if (Lt.value.includes(r))
1092
1165
  return null;
1093
- const m = le(a.dataIndex);
1094
- return u(oe, {
1166
+ const u = be(a.dataIndex);
1167
+ return s(we, {
1095
1168
  key: `td-${r}`,
1096
- style: m,
1097
- rowIndex: l,
1169
+ style: u,
1170
+ rowIndex: t,
1098
1171
  record: e,
1099
1172
  column: a,
1100
- operations: y.value,
1101
- dataColumns: v.value,
1102
- rowSpan: o,
1103
- colSpan: c,
1173
+ operations: G.value,
1174
+ dataColumns: ze.value,
1175
+ rowSpan: i,
1176
+ colSpan: o,
1104
1177
  summary: !0,
1105
- onClick: (g) => Ge(e, a, g),
1106
- onDblclick: (g) => qe(e, a, g),
1107
- onMouseenter: (g) => Ue(e, a, g),
1108
- onMouseleave: (g) => Ye(e, a, g),
1109
- onContextmenu: (g) => Je(e, a, g)
1178
+ onClick: (f) => mt(e, a, f),
1179
+ onDblclick: (f) => pt(e, a, f),
1180
+ onMouseenter: (f) => yt(e, a, f),
1181
+ onMouseleave: (f) => bt(e, a, f),
1182
+ onContextmenu: (f) => xt(e, a, f)
1110
1183
  }, {
1111
- td: s.td,
1112
- cell: s["summary-cell"]
1184
+ td: h.td,
1185
+ cell: h["summary-cell"]
1113
1186
  });
1114
1187
  })],
1115
- tr: s.tr
1116
- }), ot = () => S.value && S.value.length > 0 ? u("tfoot", null, [S.value.map((e, l) => Dl(e, l))]) : null, ut = (e, l = !0) => {
1117
- var r, o, c;
1118
- const a = e.key, n = We.value.includes(a);
1119
- return u("button", {
1188
+ tr: h.tr
1189
+ }), At = () => $.value && $.value.length > 0 ? s("tfoot", null, [$.value.map((e, t) => sa(e, t))]) : null, Et = (e, t = !0, a = !1) => {
1190
+ var i, o, u;
1191
+ const n = e.key, r = ce.value.includes(n);
1192
+ return s("button", {
1120
1193
  type: "button",
1121
- class: i.element("expand-btn"),
1122
- onClick: (m) => {
1123
- ll(a, e.raw), l && m.stopPropagation();
1194
+ class: d.element("expand-btn"),
1195
+ "aria-expanded": r,
1196
+ "aria-busy": a || void 0,
1197
+ "aria-disabled": a || void 0,
1198
+ "aria-label": vl(r ? "collapseRowText" : "expandRowText", {
1199
+ row: e.key
1200
+ }),
1201
+ onClick: (f) => {
1202
+ if (a) {
1203
+ f.stopPropagation();
1204
+ return;
1205
+ }
1206
+ (!e.hasSubtree || e.children || !r) && Fl(n, e.raw), t && f.stopPropagation();
1124
1207
  }
1125
- }, [((r = s["expand-icon"]) == null ? void 0 : r.call(s, {
1126
- expanded: n,
1208
+ }, [a ? s(en, null, null) : ((i = h["expand-icon"]) == null ? void 0 : i.call(h, {
1209
+ expanded: r,
1127
1210
  record: e.raw
1128
- })) ?? ((c = (o = t.expandable) == null ? void 0 : o.icon) == null ? void 0 : c.call(o, n, e.raw)) ?? (n ? u(ea, null, null) : u(Zl, null, null))]);
1129
- }, Pl = (e, {
1130
- indentSize: l,
1211
+ })) ?? ((u = (o = l.expandable) == null ? void 0 : o.icon) == null ? void 0 : u.call(o, r, e.raw)) ?? (r ? s(Ba, null, null) : s(Da, null, null))]);
1212
+ }, Tt = (e, {
1213
+ indentSize: t,
1131
1214
  indexPath: a,
1132
1215
  allowDrag: n,
1133
1216
  expandContent: r
1134
1217
  }) => {
1135
- var o, c;
1218
+ var i, o;
1136
1219
  if (e.hasSubtree)
1137
- return ((o = e.children) == null ? void 0 : o.length) === 0 && Pt.value ? et() : (c = e.children) == null ? void 0 : c.map((m, g) => pe(m, g, {
1138
- indentSize: l,
1220
+ return ((i = e.children) == null ? void 0 : i.length) === 0 && Qe.value ? Ct() : (o = e.children) == null ? void 0 : o.map((u, f) => Oe(u, f, {
1221
+ indentSize: t,
1139
1222
  indexPath: a,
1140
1223
  allowDrag: n
1141
1224
  }));
1142
1225
  if (r) {
1143
- const m = Fe.value;
1144
- return u(U, {
1226
+ const u = _.value;
1227
+ return s(ne, {
1145
1228
  key: `${e.key}-expand`,
1146
1229
  expand: !0
1147
1230
  }, {
1148
- default: () => [u(oe, {
1149
- isFixedExpand: M.value || W.value,
1150
- containerWidth: m == null ? void 0 : m.clientWidth,
1151
- colSpan: v.value.length + y.value.length
1152
- }, xa(r) ? r : {
1231
+ default: () => [s(we, {
1232
+ isFixedExpand: te.value || le.value,
1233
+ containerWidth: u == null ? void 0 : u.clientWidth,
1234
+ colSpan: m.value.length + b.value.length
1235
+ }, tn(r) ? r : {
1153
1236
  default: () => [r]
1154
1237
  })]
1155
1238
  });
1156
1239
  }
1157
1240
  return null;
1158
- }, pe = (e, l, {
1241
+ }, Oe = (e, t, {
1159
1242
  indentSize: a = 0,
1160
1243
  indexPath: n,
1161
- allowDrag: r = !0
1244
+ allowDrag: r = !0,
1245
+ renderChildren: i = !0
1162
1246
  } = {}) => {
1163
- var N;
1164
- const o = e.key, c = (n ?? []).concat(l), m = Al(e), g = We.value.includes(o), w = I.sourceKey === e.key, x = H.value ? {
1247
+ var y;
1248
+ const o = e.key, u = !n && l.pagination && E.value.length > k.value ? (D.value - 1) * k.value : 0, f = (n ?? []).concat(t + u), x = We(e), R = ce.value.includes(o), K = S.sourceKey === e.key, P = Array.from({
1249
+ length: b.value.length + m.value.length
1250
+ }, (c, w) => w).find((c) => !ye.value.includes(`${t}-${l.spanAll ? c : c - b.value.length}-${e.key}`) && (c >= b.value.length || !l.spanAll || !ye.value.includes(`${t}-${c}-${e.key}`))) ?? 0, z = T.value ? {
1165
1251
  draggable: r,
1166
- onDragstart: (f) => {
1167
- r && ul(f, e.key, c, e.raw);
1252
+ onDragstart: (c) => {
1253
+ r && jl(c, e.key, f, e.raw);
1168
1254
  },
1169
- onDragend: (f) => {
1170
- r && cl(f);
1255
+ onDragend: (c) => {
1256
+ r && Vl(c);
1171
1257
  }
1172
- } : {}, ae = H.value ? {
1173
- onDragenter: (f) => {
1174
- r && il(f, c);
1258
+ } : {}, H = T.value ? {
1259
+ onDragenter: (c) => {
1260
+ !r || !S.dragging || Nl(c, f);
1175
1261
  },
1176
- onDragover: (f) => {
1177
- r && sl(f);
1262
+ onDragover: (c) => {
1263
+ !r || !S.dragging || _l(c);
1178
1264
  },
1179
- onDrop: (f) => {
1180
- r && (O("drag"), dl(f));
1265
+ onDrop: (c) => {
1266
+ if (!r) return;
1267
+ const {
1268
+ sourcePath: w,
1269
+ targetPath: B
1270
+ } = S;
1271
+ S.dragging && w.toString() !== B.toString() && w.length === B.length && w.slice(0, -1).toString() === B.slice(0, -1).toString() && O("drag"), ql(c);
1181
1272
  }
1182
1273
  } : {};
1183
- return u(ke, null, [u(U, k({
1274
+ return s(Ve, null, [s(ne, F({
1184
1275
  key: o,
1276
+ "data-x-table-row": String(o),
1277
+ tabindex: T.value === "row" && r && !l.keyboardNavigation ? 0 : void 0,
1278
+ "aria-keyshortcuts": T.value === "row" ? "Alt+ArrowUp Alt+ArrowDown" : void 0,
1279
+ onKeydown: T.value === "row" ? (c) => {
1280
+ c.target === c.currentTarget && Ie(c, e, f, r);
1281
+ } : void 0,
1185
1282
  class: [{
1186
- [i.element("tr-draggable")]: H.value === "row",
1187
- [i.element("tr-drag")]: w
1188
- }, K(t.rowClass) ? t.rowClass(e.raw, l) : t.rowClass],
1189
- rowIndex: l,
1283
+ [d.element("tr-draggable")]: T.value === "row",
1284
+ [d.element("tr-drag")]: K
1285
+ }, Q(l.rowClass) ? l.rowClass(e.raw, t) : l.rowClass],
1286
+ rowIndex: t,
1190
1287
  record: e,
1191
- checked: t.rowSelection && ((N = qt.value) == null ? void 0 : N.includes(o)),
1192
- onClick: (f) => Ne(e, f),
1193
- onDblclick: (f) => xl(e, f),
1194
- onContextmenu: (f) => Cl(e, f)
1195
- }, H.value === "row" ? x : {}, ae), {
1196
- default: () => [y.value.map((f, E) => {
1197
- const G = `${l}-${E}-${e.key}`, [xe, Ce] = t.spanAll ? lt.value[G] ?? [1, 1] : [1, 1];
1198
- if (t.spanAll && at.value.includes(G))
1288
+ checked: !!(l.rowSelection && (!ke.value && !El.value && !e.isLeaf ? La(De.value, Aa(e)).checked : (y = Tl.value) != null && y.includes(o))),
1289
+ onClick: (c) => gt(e, c),
1290
+ onDblclick: (c) => ta(e, c),
1291
+ onContextmenu: (c) => la(e, c)
1292
+ }, T.value === "row" ? z : {}, H), {
1293
+ default: () => [b.value.map((c, w) => {
1294
+ const B = `${t}-${w}-${e.key}`, [He, je] = l.spanAll ? Rt.value[B] ?? [1, 1] : [1, 1];
1295
+ if (l.spanAll && ye.value.includes(B))
1199
1296
  return null;
1200
- const Se = le(f.name);
1201
- return u(mt, k({
1202
- key: `operation-td-${E}`,
1203
- style: Se,
1204
- operationColumn: f,
1205
- operations: y.value,
1297
+ const Ne = be(c.name);
1298
+ return s(Vt, F({
1299
+ key: `operation-td-${w}`,
1300
+ style: Ne,
1301
+ operationColumn: c,
1302
+ operations: G.value,
1206
1303
  record: e,
1207
- hasExpand: !!m,
1208
- selectedRowKeys: Me.value,
1209
- rowSpan: xe,
1210
- colSpan: Ce,
1211
- renderExpandBtn: ut
1212
- }, H.value === "handle" ? x : {}), {
1213
- "drag-handle-icon": s["drag-handle-icon"]
1304
+ hasExpand: !!x,
1305
+ selectedRowKeys: De.value,
1306
+ rowSpan: He,
1307
+ colSpan: je,
1308
+ renderExpandBtn: Et
1309
+ }, Kt(o, w, P), {
1310
+ onKeydown: (xe) => {
1311
+ Dt(o, w, xe), (c.name === "drag-handle" || T.value === "row") && Ie(xe, e, f, r);
1312
+ }
1313
+ }, T.value === "handle" && c.name === "drag-handle" ? da(e, f, r) : {}, T.value === "handle" && c.name === "drag-handle" ? z : {}), {
1314
+ "drag-handle-icon": h["drag-handle-icon"]
1214
1315
  });
1215
- }), v.value.map((f, E) => {
1216
- const G = `${l}-${t.spanAll ? y.value.length + E : E}-${e.key}`, [xe, Ce] = lt.value[G] ?? [1, 1];
1217
- if (at.value.includes(G))
1316
+ }), m.value.map((c, w) => {
1317
+ const B = `${t}-${l.spanAll ? b.value.length + w : w}-${e.key}`, [He, je] = Rt.value[B] ?? [1, 1];
1318
+ if (ye.value.includes(B))
1218
1319
  return null;
1219
- const Se = E === 0 ? {
1320
+ const Ne = w === 0 ? {
1220
1321
  showExpandBtn: e.hasSubtree,
1221
1322
  indentSize: e.hasSubtree ? a - 20 : a
1222
- } : {}, Tl = le(f.dataIndex);
1223
- return u(oe, k({
1224
- key: `td-${E}`,
1225
- style: Tl,
1226
- rowIndex: l,
1323
+ } : {}, xe = be(c.dataIndex);
1324
+ return s(we, F({
1325
+ key: `td-${w}`,
1326
+ style: xe,
1327
+ rowIndex: t,
1227
1328
  record: e,
1228
- column: f,
1229
- operations: y.value,
1230
- dataColumns: v.value,
1231
- rowSpan: xe,
1232
- renderExpandBtn: ut,
1233
- colSpan: Ce
1234
- }, Se, {
1235
- onClick: (C) => Ge(e, f, C),
1236
- onDblclick: (C) => qe(e, f, C),
1237
- onMouseenter: (C) => Ue(e, f, C),
1238
- onMouseleave: (C) => Ye(e, f, C),
1239
- onContextmenu: (C) => Je(e, f, C)
1329
+ column: c,
1330
+ operations: G.value,
1331
+ dataColumns: ze.value,
1332
+ rowSpan: He,
1333
+ renderExpandBtn: Et,
1334
+ colSpan: je
1335
+ }, Ne, Kt(o, b.value.length + w, P), {
1336
+ onKeydown: (L) => {
1337
+ Dt(o, b.value.length + w, L), T.value === "row" && L.target === L.currentTarget && Ie(L, e, f, r);
1338
+ },
1339
+ onClick: (L) => mt(e, c, L),
1340
+ onDblclick: (L) => pt(e, c, L),
1341
+ onMouseenter: (L) => yt(e, c, L),
1342
+ onMouseleave: (L) => bt(e, c, L),
1343
+ onContextmenu: (L) => xt(e, c, L)
1240
1344
  }), {
1241
- td: s.td
1345
+ td: h.td
1242
1346
  });
1243
1347
  })],
1244
- tr: s.tr
1245
- }), g && Pl(e, {
1246
- indentSize: a + t.indentSize,
1247
- indexPath: c,
1248
- allowDrag: r && !w,
1249
- expandContent: m
1348
+ tr: h.tr
1349
+ }), i && R && Tt(e, {
1350
+ indentSize: a + l.indentSize,
1351
+ indexPath: f,
1352
+ allowDrag: r && !K,
1353
+ expandContent: x
1250
1354
  })]);
1251
- }, it = () => {
1252
- const e = b.value.some((l) => !!l.hasSubtree);
1253
- return u(ra, null, {
1254
- default: () => [b.value.length > 0 ? b.value.map((l, a) => pe(l, a, {
1355
+ }, pe = g(() => {
1356
+ const e = [], t = (n, r = 0, i, o = !0) => {
1357
+ n.forEach((u, f) => {
1358
+ var K, P;
1359
+ if (e.push({
1360
+ key: `row:${u.key}`,
1361
+ record: u,
1362
+ rowIndex: f,
1363
+ indentSize: r,
1364
+ indexPath: i,
1365
+ allowDrag: o
1366
+ }), !ce.value.includes(u.key)) return;
1367
+ const x = !i && l.pagination && E.value.length > k.value ? (D.value - 1) * k.value : 0, R = (i ?? []).concat(f + x);
1368
+ u.hasSubtree && ((K = u.children) != null && K.length) ? t(u.children, r + l.indentSize, R, o && S.sourceKey !== u.key) : (u.hasSubtree && ((P = u.children) == null ? void 0 : P.length) === 0 && Qe.value || We(u)) && e.push({
1369
+ key: `expand:${u.key}`,
1370
+ record: u,
1371
+ rowIndex: f,
1372
+ indentSize: r,
1373
+ indexPath: R,
1374
+ allowDrag: !1,
1375
+ detail: !0
1376
+ });
1377
+ });
1378
+ }, a = p.value.some((n) => n.hasSubtree);
1379
+ return t(p.value, a ? 20 : 0), e;
1380
+ }), {
1381
+ getCellProps: Kt,
1382
+ handleCellKeydown: Dt
1383
+ } = Ya({
1384
+ enabled: Ht(l, "keyboardNavigation"),
1385
+ rows: pe,
1386
+ root: _,
1387
+ mountedKeys: g(() => {
1388
+ var t;
1389
+ if (!U.value) return;
1390
+ const e = (t = ie.value) == null ? void 0 : t.currentList;
1391
+ return e == null ? void 0 : e.filter((a) => !a.detail).map((a) => a.record.key);
1392
+ }),
1393
+ scrollToRow: (e) => {
1394
+ var t;
1395
+ U.value && ((t = ie.value) == null || t.scrollTo({
1396
+ index: e
1397
+ }));
1398
+ }
1399
+ }), Bt = async (e) => {
1400
+ var a, n;
1401
+ await jt();
1402
+ const t = Array.from(((a = _.value) == null ? void 0 : a.querySelectorAll("[data-x-table-row]")) ?? []).find((r) => r.dataset.xTableRow === String(e));
1403
+ (n = (t == null ? void 0 : t.querySelector(".x-table--drag-button")) ?? (t == null ? void 0 : t.querySelector('[tabindex="0"]')) ?? t) == null || n.focus();
1404
+ }, Ie = (e, t, a, n) => {
1405
+ var u;
1406
+ if (!n || !e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || !["ArrowUp", "ArrowDown"].includes(e.key)) return;
1407
+ e.preventDefault(), e.stopPropagation();
1408
+ let r = E.value;
1409
+ for (const f of a.slice(0, -1)) r = ((u = r[f]) == null ? void 0 : u.children) ?? [];
1410
+ const o = a[a.length - 1] + (e.key === "ArrowDown" ? 1 : -1);
1411
+ if (r[o] && !(a.length === 1 && l.pagination && E.value.length > k.value && Math.floor(o / k.value) !== D.value - 1)) {
1412
+ it(t.key, a, t.raw), S.targetPath = [...a.slice(0, -1), o];
1413
+ try {
1414
+ O("drag");
1415
+ } finally {
1416
+ ut();
1417
+ }
1418
+ Bt(t.key);
1419
+ }
1420
+ };
1421
+ let C;
1422
+ const $t = (e) => {
1423
+ if (!C || C.id !== e.pointerId || !S.dragging && Math.abs(e.clientY - C.y) < 6) return;
1424
+ e.preventDefault(), S.dragging || it(C.record.key, C.path, C.record.raw);
1425
+ const t = C.targets.find((a) => e.clientY >= a.top && e.clientY <= a.bottom);
1426
+ t && t.path.slice(0, -1).toString() === C.path.slice(0, -1).toString() && (S.targetPath = t.path);
1427
+ }, M = () => {
1428
+ var t, a;
1429
+ const e = C;
1430
+ C = void 0, e && (e.element.removeEventListener("pointermove", $t), e.element.removeEventListener("pointerup", Mt), e.element.removeEventListener("pointercancel", M), e.element.removeEventListener("lostpointercapture", M), (a = (t = e.element).hasPointerCapture) != null && a.call(t, e.id) && e.element.releasePointerCapture(e.id)), ut();
1431
+ }, Mt = (e) => {
1432
+ if (!C || C.id !== e.pointerId) return;
1433
+ const t = C.record.key, a = S.dragging && S.sourcePath.toString() !== S.targetPath.toString();
1434
+ try {
1435
+ a && O("drag");
1436
+ } finally {
1437
+ M();
1438
+ }
1439
+ a && (e.preventDefault(), Bt(t));
1440
+ };
1441
+ It(M), J([() => l.data, Je], () => {
1442
+ C && M();
1443
+ });
1444
+ const da = (e, t, a) => ({
1445
+ onPointerdown: (n) => {
1446
+ var o;
1447
+ if (!a || n.pointerType !== "touch" || !n.isPrimary) return;
1448
+ const r = _.value;
1449
+ if (!r) return;
1450
+ M();
1451
+ const i = Array.from(r.querySelectorAll("[data-x-table-row]"));
1452
+ C = {
1453
+ id: n.pointerId,
1454
+ y: n.clientY,
1455
+ element: r,
1456
+ record: e,
1457
+ path: t,
1458
+ targets: pe.value.filter((u) => !u.detail).flatMap((u) => {
1459
+ const f = i.find((R) => R.dataset.xTableRow === String(u.record.key));
1460
+ if (!f) return [];
1461
+ const x = f.getBoundingClientRect();
1462
+ return [{
1463
+ top: x.top,
1464
+ bottom: x.bottom,
1465
+ path: (u.indexPath ?? []).concat(u.rowIndex + (!u.indexPath && l.pagination && E.value.length > k.value ? (D.value - 1) * k.value : 0))
1466
+ }];
1467
+ })
1468
+ }, r.addEventListener("pointermove", $t), r.addEventListener("pointerup", Mt), r.addEventListener("pointercancel", M), r.addEventListener("lostpointercapture", M), (o = r.setPointerCapture) == null || o.call(r, n.pointerId);
1469
+ }
1470
+ }), zt = () => {
1471
+ const e = p.value.some((t) => !!t.hasSubtree);
1472
+ return s(Wa, null, {
1473
+ default: () => [p.value.length > 0 ? p.value.map((t, a) => Oe(t, a, {
1255
1474
  indentSize: e ? 20 : 0
1256
- })) : et()],
1257
- tbody: s.tbody
1475
+ })) : Ct()],
1476
+ tbody: h.tbody
1258
1477
  });
1259
- }, st = () => u(na, null, {
1260
- default: () => [fe.value.map((e, l) => u(U, {
1261
- key: `header-row-${l}`
1478
+ }, Ft = () => s(Fa, null, {
1479
+ default: () => [Ae.value.map((e, t) => s(ne, {
1480
+ key: `header-row-${t}`
1262
1481
  }, {
1263
- default: () => [l === 0 && y.value.map((a, n) => {
1482
+ default: () => [t === 0 && b.value.map((a, n) => {
1264
1483
  var r;
1265
- return u(ua, {
1484
+ return s(Ia, {
1266
1485
  key: `operation-th-${n}`,
1267
- ref: (o) => {
1268
- o != null && o.$el && a.name && ($.value[a.name] = o.$el);
1486
+ ref: (i) => {
1487
+ i && "$el" in i && a.name && (Z.value[a.name] = i.$el);
1269
1488
  },
1270
1489
  operationColumn: a,
1271
- operations: y.value,
1272
- selectAll: !!(a.name === "selection-checkbox" && ((r = t.rowSelection) != null && r.showCheckedAll)),
1273
- rowSpan: fe.value.length
1490
+ operations: G.value,
1491
+ selectAll: !!(a.name === "selection-checkbox" && ((r = l.rowSelection) != null && r.showCheckedAll)),
1492
+ rowSpan: Ae.value.length
1274
1493
  }, null);
1275
1494
  }), e.map((a, n) => {
1276
- const r = t.columnResizable && !!a.dataIndex && n < e.length - 1;
1277
- return u(oa, {
1495
+ var i, o;
1496
+ const r = l.columnResizable && !!a.dataIndex && !((i = a.children) != null && i.length) && a.dataIndex !== ((o = m.value[m.value.length - 1]) == null ? void 0 : o.dataIndex);
1497
+ return s(Oa, {
1278
1498
  key: `th-${n}`,
1279
- ref: (o) => {
1280
- o != null && o.$el && a.dataIndex && ($.value[a.dataIndex] = o.$el);
1499
+ ref: (u) => {
1500
+ u && "$el" in u && a.dataIndex && (Z.value[a.dataIndex] = u.$el);
1281
1501
  },
1282
1502
  column: a,
1283
- operations: y.value,
1284
- dataColumns: v.value,
1503
+ operations: G.value,
1504
+ dataColumns: ze.value,
1285
1505
  resizable: r,
1286
- onClick: (o) => Sl(a, o)
1506
+ onClick: (u) => aa(a, u)
1287
1507
  }, {
1288
- th: s.th
1508
+ th: h.th
1289
1509
  });
1290
1510
  })]
1291
1511
  }))],
1292
- thead: s.thead
1293
- }), Fl = () => {
1294
- var e, l;
1295
- if (z.value) {
1296
- const a = L(t.stickyHeader) ? `${t.stickyHeader}px` : void 0, n = [(e = T.value) == null ? void 0 : e.outerClass];
1297
- t.stickyHeader && n.push(i.element("header-sticky"));
1512
+ thead: h.thead
1513
+ }), ca = () => {
1514
+ var e, t;
1515
+ if (ee.value) {
1516
+ const a = W(l.stickyHeader) ? `${l.stickyHeader}px` : void 0, n = [(e = X.value) == null ? void 0 : e.outerClass];
1517
+ V.value && n.push(d.element("header-sticky"));
1298
1518
  const r = {
1299
1519
  top: a,
1300
- ...(l = T.value) == null ? void 0 : l.outerStyle
1301
- }, o = q.value ? gt : "div";
1302
- return u(ke, null, [t.showHeader && u(o, k({
1303
- ref: Mt,
1304
- class: [i.element("header"), {
1305
- [i.element("header-sticky")]: t.stickyHeader && !q.value
1520
+ ...(t = X.value) == null ? void 0 : t.outerStyle
1521
+ }, i = oe.value ? Gt : "div";
1522
+ return s(Ve, null, [l.showHeader && s(i, F({
1523
+ ref: hl,
1524
+ class: [d.element("header"), {
1525
+ [d.element("header-sticky")]: V.value && !oe.value
1306
1526
  }],
1307
1527
  style: {
1308
- overflowY: V.value ? "scroll" : void 0,
1309
- top: q.value ? void 0 : a
1528
+ overflowY: ae.value ? "scroll" : void 0,
1529
+ top: oe.value ? void 0 : a
1310
1530
  }
1311
- }, Y.value ? {
1312
- hide: b.value.length !== 0,
1531
+ }, re.value ? {
1532
+ hide: p.value.length !== 0,
1313
1533
  disableVertical: !0,
1314
- ...T.value,
1534
+ ...X.value,
1315
1535
  outerClass: n,
1316
1536
  outerStyle: r
1317
1537
  } : void 0), {
1318
- default: () => [u("table", {
1319
- class: i.element("element"),
1320
- style: wl.value,
1538
+ default: () => [s("table", {
1539
+ class: d.element("element"),
1540
+ style: na.value,
1321
1541
  cellpadding: 0,
1322
1542
  cellspacing: 0
1323
- }, [u(re, {
1324
- dataColumns: v.value,
1325
- operations: y.value,
1326
- columnWidth: D
1327
- }, null), st()])]
1328
- }), u(ht, {
1329
- onResize: El
1543
+ }, [s(Se, {
1544
+ dataColumns: m.value,
1545
+ operations: b.value,
1546
+ columnWidth: q
1547
+ }, null), Ft()])]
1548
+ }), s(qt, {
1549
+ onResize: ia
1330
1550
  }, {
1331
1551
  default: () => {
1332
- var c;
1333
- return [te.value && b.value.length ? u(ia, k({
1334
- ref: De,
1335
- class: i.element("body"),
1336
- data: b.value,
1552
+ var o, u, f, x, R, K, P, z, H;
1553
+ return [U.value && p.value.length ? s(Ha, F({
1554
+ ref: ie,
1555
+ class: d.element("body"),
1556
+ data: pe.value,
1337
1557
  itemKey: "key",
1338
1558
  component: {
1339
1559
  list: "table",
1340
1560
  content: "tbody"
1341
1561
  },
1342
1562
  listAttrs: {
1343
- class: i.element("element"),
1344
- style: ee.value
1563
+ class: d.element("element"),
1564
+ style: ge.value
1345
1565
  },
1346
1566
  paddingPosition: "list",
1347
1567
  height: "auto"
1348
- }, t.virtualListProps, {
1349
- onScroll: Ve
1568
+ }, Yt(l.virtualListProps ?? {}, ["data", "itemKey", "component"]), {
1569
+ fixedSize: pe.value.some((y) => y.detail || y.record.hasSubtree) ? !1 : (o = l.virtualListProps) == null ? void 0 : o.fixedSize,
1570
+ onScroll: vt
1350
1571
  }), {
1351
1572
  item: ({
1352
- item: m,
1353
- index: g
1354
- }) => pe(m, g)
1355
- }) : u(o, k({
1356
- ref: De,
1357
- class: i.element("body"),
1573
+ item: y
1574
+ }) => y.detail ? Tt(y.record, {
1575
+ indentSize: y.indentSize,
1576
+ indexPath: y.indexPath ?? [],
1577
+ allowDrag: !1,
1578
+ expandContent: We(y.record)
1579
+ }) : Oe(y.record, y.rowIndex, {
1580
+ indentSize: y.indentSize,
1581
+ indexPath: y.indexPath,
1582
+ allowDrag: y.allowDrag,
1583
+ renderChildren: !1
1584
+ })
1585
+ }) : s(i, F({
1586
+ ref: ie,
1587
+ class: d.element("body"),
1358
1588
  style: {
1359
- maxHeight: (c = t.scroll) != null && c.y ? L(t.scroll.y) ? `${t.scroll.y}px` : t.scroll.y : "100%"
1589
+ maxHeight: ((u = l.scroll) == null ? void 0 : u.y) ?? ((f = l.virtualListProps) == null ? void 0 : f.height) ? W(((x = l.scroll) == null ? void 0 : x.y) ?? ((R = l.virtualListProps) == null ? void 0 : R.height)) ? `${((K = l.scroll) == null ? void 0 : K.y) ?? ((P = l.virtualListProps) == null ? void 0 : P.height)}px` : ((z = l.scroll) == null ? void 0 : z.y) ?? ((H = l.virtualListProps) == null ? void 0 : H.height) : "100%"
1360
1590
  }
1361
- }, Y.value ? {
1591
+ }, re.value ? {
1362
1592
  outerStyle: {
1363
1593
  display: "flex",
1364
1594
  minHeight: "0"
1365
1595
  },
1366
- ...T.value
1596
+ ...X.value
1367
1597
  } : void 0, {
1368
- onScroll: Ve
1598
+ onScroll: vt
1369
1599
  }), {
1370
- default: () => [u("table", {
1371
- class: i.element("element"),
1372
- style: ee.value,
1600
+ default: () => [s("table", {
1601
+ class: d.element("element"),
1602
+ style: ge.value,
1373
1603
  cellpadding: 0,
1374
1604
  cellspacing: 0
1375
- }, [b.value.length !== 0 && u(re, {
1376
- dataColumns: v.value,
1377
- operations: y.value,
1378
- columnWidth: D
1379
- }, null), it()])]
1605
+ }, [p.value.length !== 0 && s(Se, {
1606
+ dataColumns: m.value,
1607
+ operations: b.value,
1608
+ columnWidth: q
1609
+ }, null), zt()])]
1380
1610
  })];
1381
1611
  }
1382
- }), S.value && S.value.length > 0 && u("div", {
1383
- ref: ie,
1384
- class: i.element("tfoot"),
1612
+ }), $.value && $.value.length > 0 && s("div", {
1613
+ ref: Re,
1614
+ class: d.element("tfoot"),
1385
1615
  style: {
1386
- overflowY: V.value ? "scroll" : "hidden"
1616
+ overflowY: ae.value ? "scroll" : "hidden"
1387
1617
  }
1388
- }, [u("table", {
1389
- class: i.element("element"),
1390
- style: ee.value,
1618
+ }, [s("table", {
1619
+ class: d.element("element"),
1620
+ style: ge.value,
1391
1621
  cellpadding: 0,
1392
1622
  cellspacing: 0
1393
- }, [u(re, {
1394
- dataColumns: v.value,
1395
- operations: y.value,
1396
- columnWidth: D
1397
- }, null), ot()])])]);
1623
+ }, [s(Se, {
1624
+ dataColumns: m.value,
1625
+ operations: b.value,
1626
+ columnWidth: q
1627
+ }, null), At()])])]);
1398
1628
  }
1399
- return u(ht, {
1400
- onResize: () => ye()
1629
+ return s(qt, {
1630
+ onResize: () => {
1631
+ Me(), me();
1632
+ }
1401
1633
  }, {
1402
- default: () => [u("table", {
1403
- class: i.element("element"),
1634
+ default: () => [s("table", {
1635
+ class: d.element("element"),
1404
1636
  cellpadding: 0,
1405
1637
  cellspacing: 0,
1406
- style: ee.value
1407
- }, [u(re, {
1408
- dataColumns: v.value,
1409
- operations: y.value,
1410
- columnWidth: D
1411
- }, null), t.showHeader && st(), it(), S.value && S.value.length > 0 && ot()])]
1638
+ style: ge.value
1639
+ }, [s(Se, {
1640
+ dataColumns: m.value,
1641
+ operations: b.value,
1642
+ columnWidth: q
1643
+ }, null), l.showHeader && Ft(), zt(), $.value && $.value.length > 0 && At()])]
1412
1644
  });
1413
- }, ct = (e) => {
1645
+ }, Wt = (e) => {
1414
1646
  var n;
1415
- const l = (n = t.scroll) != null && n.maxHeight ? {
1416
- maxHeight: t.scroll.maxHeight
1417
- } : void 0, a = q.value ? gt : "div";
1418
- return u(ke, null, [u("div", {
1419
- class: [i.element("container"), Rl.value]
1420
- }, [u(a, k({
1421
- ref: $t,
1422
- class: [i.element("content"), {
1423
- [i.element("content-scroll-x")]: !z.value
1647
+ const t = (n = l.scroll) != null && n.maxHeight ? {
1648
+ maxHeight: W(l.scroll.maxHeight) ? `${l.scroll.maxHeight}px` : l.scroll.maxHeight
1649
+ } : void 0, a = oe.value && !V.value ? Gt : "div";
1650
+ return s(Ve, null, [s("div", {
1651
+ class: [d.element("container"), oa.value]
1652
+ }, [s(a, F({
1653
+ ref: cl,
1654
+ class: [d.element("content"), {
1655
+ [d.element("content-scroll-x")]: !ee.value
1424
1656
  }],
1425
- style: l
1426
- }, Y.value ? {
1657
+ style: t
1658
+ }, re.value && !V.value ? {
1427
1659
  outerStyle: {
1428
1660
  height: "100%"
1429
1661
  },
1430
- ...T.value
1662
+ ...X.value
1431
1663
  } : void 0, {
1432
- onScroll: _e
1664
+ onScroll: ht
1433
1665
  }), {
1434
- default: () => [e ? u("table", {
1435
- class: i.element("element"),
1666
+ default: () => [e ? s("table", {
1667
+ class: d.element("element"),
1436
1668
  cellpadding: 0,
1437
1669
  cellspacing: 0
1438
- }, [e()]) : Fl()]
1439
- })]), s.footer && u("div", {
1440
- class: i.element("footer")
1441
- }, [s.footer()])]);
1442
- }, dt = () => {
1443
- var l, a;
1444
- const e = Re(t.pagination) ? sa(t.pagination, ["current", "pageSize", "defaultCurrent", "defaultPageSize"]) : {};
1445
- return u("div", {
1446
- class: kl.value
1447
- }, [(l = s["pagination-left"]) == null ? void 0 : l.call(s), u(la, k({
1448
- total: je.value.length,
1449
- current: _.value,
1450
- pageSize: F.value,
1670
+ }, [e()]) : ca()]
1671
+ })]), h.footer && s("div", {
1672
+ class: d.element("footer")
1673
+ }, [h.footer()])]);
1674
+ }, Ot = () => {
1675
+ var t, a;
1676
+ const e = qe(l.pagination) ? Yt(l.pagination, ["current", "pageSize", "defaultCurrent", "defaultPageSize"]) : {};
1677
+ return s("div", {
1678
+ class: ra.value
1679
+ }, [(t = h["pagination-left"]) == null ? void 0 : t.call(h), s(Ma, F({
1680
+ total: dt.value.length,
1681
+ current: D.value,
1682
+ pageSize: k.value,
1451
1683
  onChange: (n) => {
1452
- fl(n), O("pagination");
1684
+ Yl(n), O("pagination");
1453
1685
  },
1454
1686
  onPageSizeChange: (n) => {
1455
- ml(n), ge(), O("pagination");
1687
+ Ul(n), $e(), O("pagination");
1456
1688
  }
1457
- }, e), null), (a = s["pagination-right"]) == null ? void 0 : a.call(s)]);
1458
- }, Kl = h(() => {
1459
- var e, l;
1460
- if (Il((e = t.scroll) == null ? void 0 : e.y) && te.value)
1689
+ }, e), null), (a = h["pagination-right"]) == null ? void 0 : a.call(h)]);
1690
+ }, fa = g(() => {
1691
+ var e, t;
1692
+ if (xa((e = l.scroll) == null ? void 0 : e.y) && U.value)
1461
1693
  return {
1462
- height: (l = t.scroll) == null ? void 0 : l.y
1694
+ height: (t = l.scroll) == null ? void 0 : t.y
1463
1695
  };
1464
1696
  });
1465
1697
  return {
1466
1698
  render: () => {
1467
1699
  var a, n;
1468
- const e = ((a = s.default) == null ? void 0 : a.call(s)) ?? [], l = e && ql(e).length > 0;
1469
- return s.default && !l ? u("div", {
1470
- class: Qe.value
1471
- }, [ct(() => e)]) : (Be.value = ((n = s.columns) == null ? void 0 : n.call(s)) ?? e, u("div", {
1472
- class: Qe.value,
1473
- style: Kl.value
1474
- }, [Be.value, u(ta, Ll.value, {
1475
- default: () => [t.pagination !== !1 && (b.value.length > 0 || R.value.length > 0) && me.value && dt(), ct(), t.pagination !== !1 && (b.value.length > 0 || R.value.length > 0) && !me.value && dt()]
1700
+ const e = ((a = h.default) == null ? void 0 : a.call(h)) ?? [], t = e && Pa(e).length > 0;
1701
+ return h.default && !t ? s("div", {
1702
+ class: St.value,
1703
+ "aria-busy": !!Fe.value.loading
1704
+ }, [Wt(() => e)]) : (Xe.value = ((n = h.columns) == null ? void 0 : n.call(h)) ?? e, s("div", {
1705
+ class: St.value,
1706
+ style: fa.value,
1707
+ "aria-busy": !!Fe.value.loading
1708
+ }, [Xe.value, s($a, Fe.value, {
1709
+ default: () => [l.pagination !== !1 && (p.value.length > 0 || E.value.length > 0) && Ee.value && Ot(), Wt(), l.pagination !== !1 && (p.value.length > 0 || E.value.length > 0) && !Ee.value && Ot()]
1476
1710
  })]));
1477
1711
  },
1478
- selfExpand: al,
1479
- selfExpandAll: nl,
1480
- selfSelect: Zt,
1481
- selfSelectAll: el,
1482
- selfResetFilters: It,
1483
- selfClearFilters: _t,
1484
- selfResetSorters: Nt,
1485
- selfClearSorters: Gt
1712
+ selfExpand: Wl,
1713
+ selfExpandAll: Ol,
1714
+ selfSelect: $l,
1715
+ selfSelectAll: Ml,
1716
+ selfResetFilters: wl,
1717
+ selfClearFilters: Cl,
1718
+ selfResetSorters: Rl,
1719
+ selfClearSorters: Pl
1486
1720
  };
1487
1721
  },
1488
1722
  methods: {
@@ -1493,8 +1727,8 @@ const bt = {
1493
1727
  * @public
1494
1728
  * @version 2.22.0
1495
1729
  */
1496
- selectAll(t) {
1497
- return this.selfSelectAll(t);
1730
+ selectAll(l) {
1731
+ return this.selfSelectAll(l);
1498
1732
  },
1499
1733
  /**
1500
1734
  * @zh 设置行选择器状态
@@ -1504,8 +1738,8 @@ const bt = {
1504
1738
  * @public
1505
1739
  * @version 2.31.0
1506
1740
  */
1507
- select(t, d) {
1508
- return this.selfSelect(t, d);
1741
+ select(l, v) {
1742
+ return this.selfSelect(l, v);
1509
1743
  },
1510
1744
  /**
1511
1745
  * @zh 设置全部展开状态
@@ -1514,8 +1748,8 @@ const bt = {
1514
1748
  * @public
1515
1749
  * @version 2.31.0
1516
1750
  */
1517
- expandAll(t) {
1518
- return this.selfExpandAll(t);
1751
+ expandAll(l) {
1752
+ return this.selfExpandAll(l);
1519
1753
  },
1520
1754
  /**
1521
1755
  * @zh 设置展开状态
@@ -1525,8 +1759,8 @@ const bt = {
1525
1759
  * @public
1526
1760
  * @version 2.31.0
1527
1761
  */
1528
- expand(t, d) {
1529
- return this.selfExpand(t, d);
1762
+ expand(l, v) {
1763
+ return this.selfExpand(l, v);
1530
1764
  },
1531
1765
  /**
1532
1766
  * @zh 重置列的筛选器
@@ -1535,8 +1769,8 @@ const bt = {
1535
1769
  * @public
1536
1770
  * @version 2.31.0
1537
1771
  */
1538
- resetFilters(t) {
1539
- return this.selfResetFilters(t);
1772
+ resetFilters(l) {
1773
+ return this.selfResetFilters(l);
1540
1774
  },
1541
1775
  /**
1542
1776
  * @zh 清空列的筛选器
@@ -1545,8 +1779,8 @@ const bt = {
1545
1779
  * @public
1546
1780
  * @version 2.31.0
1547
1781
  */
1548
- clearFilters(t) {
1549
- return this.selfClearFilters(t);
1782
+ clearFilters(l) {
1783
+ return this.selfClearFilters(l);
1550
1784
  },
1551
1785
  /**
1552
1786
  * @zh 重置列的排序
@@ -1572,5 +1806,5 @@ const bt = {
1572
1806
  }
1573
1807
  });
1574
1808
  export {
1575
- un as default
1809
+ qn as default
1576
1810
  };