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,46 +1,39 @@
1
- import { ref as A, computed as a } from "vue";
2
- const C = ({
3
- spanMethod: s,
4
- data: k,
5
- columns: y
1
+ import { computed as $ } from "vue";
2
+ const E = ({
3
+ spanMethod: n,
4
+ data: a,
5
+ columns: h
6
6
  }) => {
7
- const c = (f, l) => {
8
- f == null || f.forEach(($, e) => {
7
+ const p = (e, l, c) => {
8
+ e == null || e.forEach((f, i) => {
9
9
  var g;
10
- $.hasSubtree && ((g = $.children) != null && g.length) && c($.children || [], l), y.value.forEach((S, r) => {
11
- var n;
12
- const { rowspan: u = 1, colspan: v = 1 } = ((n = s.value) == null ? void 0 : n.call(s, {
13
- record: $.raw,
14
- column: S,
15
- rowIndex: e,
10
+ f.hasSubtree && ((g = f.children) != null && g.length) && p(f.children || [], l, c), h.value.forEach((k, r) => {
11
+ var o;
12
+ const { rowspan: u = 1, colspan: v = 1 } = ((o = n.value) == null ? void 0 : o.call(n, {
13
+ record: f.raw,
14
+ column: k,
15
+ rowIndex: i,
16
16
  columnIndex: r
17
- })) ?? {};
18
- (u > 1 || v > 1) && (l[`${e}-${r}-${$.key}`] = [u, v], Array.from({ length: u }).forEach((_, t) => {
19
- if (e + t < f.length) {
20
- const { key: p } = f[e + t] ?? {};
21
- Array.from({ length: v }).forEach((j, h) => {
22
- r + h < y.value.length && `${e}-${r}-${$.key}` != `${e + t}-${r + h}-${p}` && (i.value[`${e + t}-${r + h}-${p}`] = [0, 0]);
23
- });
24
- }
25
- }));
17
+ })) ?? {}, m = `${i}-${r}-${f.key}`;
18
+ if (u === 0 || v === 0)
19
+ c.add(m);
20
+ else if (u > 1 || v > 1) {
21
+ l[m] = [u, v];
22
+ for (let s = 0; s < Math.min(u, e.length - i); s++)
23
+ for (let t = 0; t < Math.min(v, h.value.length - r); t++)
24
+ (s || t) && c.add(`${i + s}-${r + t}-${e[i + s].key}`);
25
+ }
26
26
  });
27
27
  });
28
- };
29
- let i = A({});
30
- const o = a(() => {
31
- const f = {};
32
- return i.value = {}, s.value && c(k.value, f), f;
33
- }), E = a(() => {
34
- const f = [];
35
- for (const l of Object.keys(i.value))
36
- f.push(l);
37
- return f;
28
+ }, S = $(() => {
29
+ const e = {}, l = /* @__PURE__ */ new Set();
30
+ return n.value && p(a.value, e, l), { span: e, removed: [...l] };
38
31
  });
39
32
  return {
40
- tableSpan: o,
41
- removedCells: E
33
+ tableSpan: $(() => S.value.span),
34
+ removedCells: $(() => S.value.removed)
42
35
  };
43
36
  };
44
37
  export {
45
- C as useSpan
38
+ E as useSpan
46
39
  };
@@ -1,21 +1,38 @@
1
- const l = {
1
+ import { useLocale as r } from "../../locale/index.js";
2
+ const c = {
2
3
  resetText: "重置",
3
4
  okText: "确认",
4
5
  currentColumnText: "当前列",
5
6
  filterLabelText: "筛选{column}",
6
- summaryText: "Summary"
7
- }, m = {
7
+ summaryText: "Summary",
8
+ expandRowText: "展开行 {row}",
9
+ collapseRowText: "收起行 {row}",
10
+ selectRowText: "选择行 {row}",
11
+ selectAllText: "选择全部可选行",
12
+ resizeColumnText: "调整{column}列宽",
13
+ moveRowText: "移动行 {row},Alt 加上下方向键调整顺序"
14
+ }, s = {
8
15
  resetText: "Reset",
9
16
  okText: "OK",
10
17
  currentColumnText: "Column",
11
18
  filterLabelText: "Filter {column}",
12
- summaryText: "Summary"
13
- }, T = (r, e = {}) => r.replace(
19
+ summaryText: "Summary",
20
+ expandRowText: "Expand row {row}",
21
+ collapseRowText: "Collapse row {row}",
22
+ selectRowText: "Select row {row}",
23
+ selectAllText: "Select all selectable rows",
24
+ resizeColumnText: "Resize {column} column",
25
+ moveRowText: "Move row {row}, Alt plus Up or Down to reorder"
26
+ }, x = (o, e = {}) => o.replace(
14
27
  /\{(\w+)\}/g,
15
- (o, t) => Object.prototype.hasOwnProperty.call(e, t) ? String(e[t]) : o
16
- );
28
+ (t, l) => Object.prototype.hasOwnProperty.call(e, l) ? String(e[l]) : t
29
+ ), n = () => {
30
+ const { locale: o } = r();
31
+ return (e, t) => x(o.value.table[e] ?? c[e] ?? e, t);
32
+ };
17
33
  export {
18
- m as TABLE_LOCALE_EN_US,
19
- l as TABLE_LOCALE_ZH_CN,
20
- T as formatLocaleText
34
+ s as TABLE_LOCALE_EN_US,
35
+ c as TABLE_LOCALE_ZH_CN,
36
+ x as formatLocaleText,
37
+ n as useTableLocale
21
38
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as n } from "vue";
2
- const i = n({
1
+ import { defineComponent as i } from "vue";
2
+ const p = i({
3
3
  name: "ColGroup",
4
4
  props: {
5
5
  dataColumns: {
@@ -16,21 +16,21 @@ const i = n({
16
16
  },
17
17
  setup() {
18
18
  return {
19
- fixedWidth: (e, r) => {
20
- if (e) {
21
- const t = Math.max(e, r || 0);
19
+ fixedWidth: (r, t) => {
20
+ if (r) {
21
+ const e = Math.max(r, t || 0);
22
22
  return {
23
23
  width: `${e}px`,
24
- minWidth: `${t}px`,
24
+ minWidth: `${e}px`,
25
25
  maxWidth: `${e}px`
26
26
  };
27
27
  }
28
- if (r)
29
- return { minWidth: `${r}px` };
28
+ if (t)
29
+ return { minWidth: `${t}px` };
30
30
  }
31
31
  };
32
32
  }
33
33
  });
34
34
  export {
35
- i as default
35
+ p as default
36
36
  };
@@ -1,17 +1,21 @@
1
- import { defineComponent as x, inject as b, computed as l, createVNode as r } from "vue";
2
- import { getOperationStyle as k, getOperationFixedCls as w, getLeafKeys as B, getSelectionStatus as j } from "./utils.js";
3
- import { Checkbox as c } from "../form-checkbox/index.js";
4
- import { Radio as y } from "../form-radio/index.js";
5
- import v from "../../icons/_self/more-dot.js";
6
- import { tableInjectionKey as K } from "./context.js";
7
- import { getClassNameMixin as O } from "../../_utils/config.js";
8
- const P = /* @__PURE__ */ x({
1
+ import { defineComponent as v, inject as R, computed as d, createVNode as a, mergeProps as h } from "vue";
2
+ import { getOperationStyle as A, getOperationFixedCls as B, getLeafKeys as T, getSelectionStatus as j } from "./utils.js";
3
+ import { Checkbox as m } from "../form-checkbox/index.js";
4
+ import { Radio as w } from "../form-radio/index.js";
5
+ import K from "../../icons/_self/more-dot.js";
6
+ import { tableInjectionKey as L } from "./context.js";
7
+ import { getClassNameMixin as N } from "../../_utils/config.js";
8
+ import { useTableLocale as O } from "./locale.js";
9
+ import { tableDomListeners as E, getTableDomListeners as D } from "./dom-listeners.js";
10
+ const z = /* @__PURE__ */ v({
9
11
  name: "OperationTd",
12
+ inheritAttrs: !1,
10
13
  components: {
11
- Checkbox: c,
12
- Radio: y
14
+ Checkbox: m,
15
+ Radio: w
13
16
  },
14
17
  props: {
18
+ ...E,
15
19
  operationColumn: {
16
20
  type: Object,
17
21
  required: !0
@@ -49,69 +53,86 @@ const P = /* @__PURE__ */ x({
49
53
  },
50
54
  emits: ["select"],
51
55
  setup(e, {
52
- emit: E,
53
- slots: i
56
+ attrs: g,
57
+ slots: c
54
58
  }) {
55
- const o = O("table"), n = b(K, {}), C = l(() => k(e.operationColumn, e.operations)), g = l(() => [o.element("td"), o.element("operation"), {
56
- [o.element("checkbox")]: e.operationColumn.name === "selection-checkbox",
57
- [o.element("radio")]: e.operationColumn.name === "selection-radio",
58
- [o.element("expand")]: e.operationColumn.name === "expand",
59
+ const t = N("table"), n = R(L, {}), l = O(), x = d(() => A(e.operationColumn, e.operations)), k = d(() => [t.element("td"), t.element("operation"), {
60
+ [t.element("checkbox")]: e.operationColumn.name === "selection-checkbox",
61
+ [t.element("radio")]: e.operationColumn.name === "selection-radio",
62
+ [t.element("expand")]: e.operationColumn.name === "expand",
59
63
  // 注意
60
- [o.modifier("drag-handle")]: e.operationColumn.name === "drag-handle"
61
- }, ...w(o.block, e.operationColumn)]), h = l(() => B(e.record)), u = l(() => j(n.currentSelectedRowKeys ?? [], h.value)), S = () => {
62
- var m, f, s;
64
+ [t.modifier("drag-handle")]: e.operationColumn.name === "drag-handle"
65
+ }, ...B(t.block, e.operationColumn)]), s = d(() => T(e.record)), f = d(() => j(n.currentSelectedRowKeys ?? [], s.value)), S = () => {
66
+ var i, y, b, C;
63
67
  if (e.summary)
64
68
  return null;
65
69
  if (e.operationColumn.render)
66
70
  return e.operationColumn.render(e.record.raw);
67
71
  if (e.operationColumn.name === "selection-checkbox") {
68
- const d = e.record.key;
69
- return !n.checkStrictly && !e.record.isLeaf ? r(c, {
70
- modelValue: u.value.checked,
71
- indeterminate: u.value.indeterminate,
72
- disabled: !!e.record.disabled,
72
+ const u = e.record.key;
73
+ return !n.checkStrictly && !e.record.isLeaf && ((i = e.record.children) == null ? void 0 : i.length) !== 0 ? a(m, {
74
+ modelValue: f.value.checked,
75
+ indeterminate: f.value.indeterminate,
76
+ disabled: !!e.record.disabled || s.value.length === 0,
77
+ "aria-label": l("selectRowText", {
78
+ row: e.record.key
79
+ }),
73
80
  uninjectGroupContext: !0,
74
- onChange: (t) => {
75
- var a;
76
- return (a = n.onSelectAllLeafs) == null ? void 0 : a.call(n, e.record, t);
77
- },
78
- onClick: (t) => t.stopPropagation()
79
- }, null) : r(c, {
80
- modelValue: ((m = e.selectedRowKeys) == null ? void 0 : m.includes(d)) ?? !1,
81
+ onChange: (r) => {
82
+ var o;
83
+ return (o = n.onSelectAllLeafs) == null ? void 0 : o.call(n, e.record, r);
84
+ }
85
+ }, null) : a(m, {
86
+ modelValue: ((y = e.selectedRowKeys) == null ? void 0 : y.includes(u)) ?? !1,
81
87
  disabled: !!e.record.disabled,
88
+ "aria-label": l("selectRowText", {
89
+ row: e.record.key
90
+ }),
82
91
  uninjectGroupContext: !0,
83
- onChange: (t) => {
84
- var a;
85
- return (a = n.onSelect) == null ? void 0 : a.call(n, t, e.record);
86
- },
87
- onClick: (t) => t.stopPropagation()
92
+ onChange: (r) => {
93
+ var o;
94
+ return (o = n.onSelect) == null ? void 0 : o.call(n, r, e.record);
95
+ }
88
96
  }, null);
89
97
  }
90
98
  if (e.operationColumn.name === "selection-radio") {
91
- const d = e.record.key;
92
- return r(y, {
93
- modelValue: ((f = e.selectedRowKeys) == null ? void 0 : f.includes(d)) ?? !1,
99
+ const u = e.record.key;
100
+ return a(w, {
101
+ modelValue: ((b = e.selectedRowKeys) == null ? void 0 : b.includes(u)) ?? !1,
94
102
  disabled: !!e.record.disabled,
103
+ name: n.selectionName,
104
+ "aria-label": l("selectRowText", {
105
+ row: e.record.key
106
+ }),
95
107
  uninjectGroupContext: !0,
96
- onChange: (t) => {
97
- var a;
98
- return (a = n.onSelect) == null ? void 0 : a.call(n, t, e.record);
99
- },
100
- onClick: (t) => t.stopPropagation()
108
+ onChange: (r) => {
109
+ var o;
110
+ return (o = n.onSelect) == null ? void 0 : o.call(n, r, e.record);
111
+ }
101
112
  }, null);
102
113
  }
103
- return e.operationColumn.name === "expand" ? e.hasExpand && e.renderExpandBtn ? e.renderExpandBtn(e.record) : null : e.operationColumn.name === "drag-handle" ? ((s = i["drag-handle-icon"]) == null ? void 0 : s.call(i)) ?? r(v, null, null) : null;
114
+ return e.operationColumn.name === "expand" ? e.hasExpand && e.renderExpandBtn ? e.renderExpandBtn(e.record) : null : e.operationColumn.name === "drag-handle" ? a("button", {
115
+ type: "button",
116
+ class: t.element("drag-button"),
117
+ "aria-label": l("moveRowText", {
118
+ row: e.record.key
119
+ }),
120
+ "aria-keyshortcuts": "Alt+ArrowUp Alt+ArrowDown"
121
+ }, [((C = c["drag-handle-icon"]) == null ? void 0 : C.call(c)) ?? a(K, null, null)]) : null;
104
122
  };
105
- return () => r("td", {
106
- class: g.value,
107
- style: C.value,
123
+ return () => a("td", h(h(g, D(e), {
124
+ class: k.value,
125
+ style: x.value
126
+ }), {
127
+ "data-x-table-column": e.operationColumn.name,
108
128
  rowspan: e.rowSpan > 1 ? e.rowSpan : void 0,
109
129
  colspan: e.colSpan > 1 ? e.colSpan : void 0
110
- }, [r("span", {
111
- class: o.element("cell")
130
+ }), [a("span", {
131
+ class: t.element("cell"),
132
+ onClick: e.operationColumn.name.startsWith("selection-") ? (i) => i.stopPropagation() : void 0
112
133
  }, [S()])]);
113
134
  }
114
135
  });
115
136
  export {
116
- P as default
137
+ z as default
117
138
  };
@@ -1,10 +1,11 @@
1
- import { defineComponent as h, inject as w, computed as r, createVNode as a } from "vue";
2
- import { getOperationStyle as S, getOperationFixedCls as A } from "./utils.js";
3
- import { Checkbox as g } from "../form-checkbox/index.js";
4
- import { isFunction as d } from "../../_utils/is.js";
1
+ import { defineComponent as A, inject as S, computed as a, createVNode as i } from "vue";
2
+ import { getOperationStyle as g, getOperationFixedCls as x } from "./utils.js";
3
+ import { Checkbox as K } from "../form-checkbox/index.js";
4
+ import { isFunction as f } from "../../_utils/is.js";
5
5
  import { tableInjectionKey as k } from "./context.js";
6
- import { getClassNameMixin as x } from "../../_utils/config.js";
7
- const q = /* @__PURE__ */ h({
6
+ import { getClassNameMixin as E } from "../../_utils/config.js";
7
+ import { useTableLocale as N } from "./locale.js";
8
+ const V = /* @__PURE__ */ A({
8
9
  name: "OperationTh",
9
10
  props: {
10
11
  operationColumn: {
@@ -26,39 +27,45 @@ const q = /* @__PURE__ */ h({
26
27
  }
27
28
  },
28
29
  setup(e) {
29
- const n = x("table"), t = w(k, {}), i = r(() => {
30
- var c, m;
31
- let o = !1, l = !1;
32
- const u = (((c = t.currentSelectedRowKeys) == null ? void 0 : c.filter((p) => {
33
- var s;
34
- return ((s = t.currentAllEnabledRowKeys) == null ? void 0 : s.includes(p)) ?? !0;
35
- })) ?? []).length, y = ((m = t.currentAllEnabledRowKeys) == null ? void 0 : m.length) ?? 0;
36
- return u > 0 && (u >= y ? o = !0 : l = !0), {
37
- checked: o,
38
- indeterminate: l
30
+ const n = E("table"), t = S(k, {}), b = N(), c = a(() => {
31
+ var m, s;
32
+ let l = !1, o = !1;
33
+ const u = (((m = t.currentSelectedRowKeys) == null ? void 0 : m.filter((w) => {
34
+ var d;
35
+ return ((d = t.currentAllEnabledRowKeys) == null ? void 0 : d.includes(w)) ?? !0;
36
+ })) ?? []).length, h = ((s = t.currentAllEnabledRowKeys) == null ? void 0 : s.length) ?? 0;
37
+ return u > 0 && (u >= h ? l = !0 : o = !0), {
38
+ checked: l,
39
+ indeterminate: o
39
40
  };
40
- }), f = () => e.selectAll ? a(g, {
41
- modelValue: i.value.checked,
42
- indeterminate: i.value.indeterminate,
43
- uninjectGroupContext: !0,
44
- onChange: (o) => {
45
- var l;
46
- (l = t.onSelectAll) == null || l.call(t, o);
47
- }
48
- }, {
49
- default: d(e.operationColumn.title) ? e.operationColumn.title() : e.operationColumn.title
50
- }) : e.operationColumn.title ? d(e.operationColumn.title) ? e.operationColumn.title() : e.operationColumn.title : null, C = r(() => S(e.operationColumn, e.operations)), b = r(() => [n.element("th"), n.element("operation"), {
41
+ }), C = () => {
42
+ var l;
43
+ return e.selectAll ? i(K, {
44
+ modelValue: c.value.checked,
45
+ indeterminate: c.value.indeterminate,
46
+ disabled: !((l = t.currentAllEnabledRowKeys) != null && l.length),
47
+ "aria-label": b("selectAllText"),
48
+ uninjectGroupContext: !0,
49
+ onChange: (o) => {
50
+ var r;
51
+ (r = t.onSelectAll) == null || r.call(t, o);
52
+ }
53
+ }, {
54
+ default: f(e.operationColumn.title) ? e.operationColumn.title() : e.operationColumn.title
55
+ }) : e.operationColumn.title ? f(e.operationColumn.title) ? e.operationColumn.title() : e.operationColumn.title : null;
56
+ }, p = a(() => g(e.operationColumn, e.operations)), y = a(() => [n.element("th"), n.element("operation"), {
51
57
  [n.element("checkbox")]: e.selectAll
52
- }, ...A(n.block, e.operationColumn)]);
53
- return () => a("th", {
54
- class: b.value,
55
- style: C.value,
58
+ }, ...x(n.block, e.operationColumn)]);
59
+ return () => i("th", {
60
+ scope: "col",
61
+ class: y.value,
62
+ style: p.value,
56
63
  rowspan: e.rowSpan > 1 ? e.rowSpan : void 0
57
- }, [a("span", {
64
+ }, [i("span", {
58
65
  class: n.element("cell")
59
- }, [f()])]);
66
+ }, [C()])]);
60
67
  }
61
68
  });
62
69
  export {
63
- q as default
70
+ V as default
64
71
  };