x-next 1.11.0 → 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 (137) hide show
  1. package/AI_CODING.md +18 -1
  2. package/AI_USAGE/catalog.md +2 -2
  3. package/AI_USAGE/components/alert.md +2 -2
  4. package/AI_USAGE/components/bar-chart.md +6 -4
  5. package/AI_USAGE/components/button.md +3 -3
  6. package/AI_USAGE/components/checkbox.md +2 -2
  7. package/AI_USAGE/components/color-picker.md +2 -2
  8. package/AI_USAGE/components/config-provider.md +2 -2
  9. package/AI_USAGE/components/date-picker.md +2 -2
  10. package/AI_USAGE/components/dialog.md +2 -2
  11. package/AI_USAGE/components/dropdown.md +2 -2
  12. package/AI_USAGE/components/empty.md +2 -2
  13. package/AI_USAGE/components/input.md +3 -3
  14. package/AI_USAGE/components/line-chart.md +6 -4
  15. package/AI_USAGE/components/message-box.md +2 -2
  16. package/AI_USAGE/components/message.md +3 -3
  17. package/AI_USAGE/components/notification.md +4 -2
  18. package/AI_USAGE/components/pagination.md +2 -2
  19. package/AI_USAGE/components/pie-chart.md +2 -2
  20. package/AI_USAGE/components/popconfirm.md +2 -2
  21. package/AI_USAGE/components/popover.md +3 -3
  22. package/AI_USAGE/components/progress.md +4 -3
  23. package/AI_USAGE/components/radio.md +2 -2
  24. package/AI_USAGE/components/rate.md +2 -2
  25. package/AI_USAGE/components/select.md +3 -3
  26. package/AI_USAGE/components/slider.md +2 -2
  27. package/AI_USAGE/components/steps.md +2 -2
  28. package/AI_USAGE/components/switch.md +3 -3
  29. package/AI_USAGE/components/tabs.md +2 -2
  30. package/AI_USAGE/components/textarea.md +2 -2
  31. package/AI_USAGE/components/time-picker.md +3 -3
  32. package/AI_USAGE/components/upload.md +4 -4
  33. package/AI_USAGE/core.md +3 -3
  34. package/AI_USAGE/index.md +2 -2
  35. package/AI_USAGE/recipes/form-on-demand.md +11 -8
  36. package/AI_USAGE.md +36 -43
  37. package/CHANGELOG.md +34 -0
  38. package/dist/components/network/Network.vue.d.ts +1 -1
  39. package/dist/components/network/index.d.ts +3 -3
  40. package/dist/components/table/Table.d.ts +11 -0
  41. package/dist/components/table/context.d.ts +5 -0
  42. package/dist/components/table/dom-listeners.d.ts +23 -0
  43. package/dist/components/table/hooks/use-column-resize.d.ts +2 -1
  44. package/dist/components/table/hooks/use-drag.d.ts +6 -3
  45. package/dist/components/table/hooks/use-keyboard-navigation.d.ts +27 -0
  46. package/dist/components/table/hooks/use-sorter.d.ts +3 -1
  47. package/dist/components/table/index.d.ts +15 -0
  48. package/dist/components/table/interface.d.ts +9 -2
  49. package/dist/components/table/locale.d.ts +8 -7
  50. package/dist/components/table/table-operation-td.d.ts +34 -0
  51. package/dist/components/table/table-td.d.ts +36 -2
  52. package/dist/components/table/table-th.d.ts +34 -0
  53. package/dist/components/table/table-tr.d.ts +34 -0
  54. package/dist/components/trend-chart/components/TrendChart.d.ts +1 -1
  55. package/dist/components/trend-chart/index.d.ts +3 -3
  56. package/dist/components/upload/Upload.d.ts +1 -1
  57. package/dist/components/upload/index.d.ts +3 -3
  58. 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
  59. 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
  60. 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
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. package/dist/es/_container/resize-observer-v2.js +1 -1
  67. package/dist/es/_container/resize-observer.js +1 -1
  68. package/dist/es/_hooks/use-resize-observer.js +1 -1
  69. package/dist/es/_virtual/advancedFormat.js +1 -1
  70. package/dist/es/_virtual/customParseFormat.js +1 -1
  71. package/dist/es/_virtual/dayjs.min.js +1 -1
  72. package/dist/es/_virtual/isBetween.js +1 -1
  73. package/dist/es/_virtual/quarterOfYear.js +1 -1
  74. package/dist/es/_virtual/weekOfYear.js +1 -1
  75. package/dist/es/_virtual/weekYear.js +1 -1
  76. package/dist/es/_virtual/zh-cn.js +1 -1
  77. package/dist/es/components/draggable/useDraggable.js +1 -1
  78. package/dist/es/components/form/Form.vue2.js +1 -1
  79. package/dist/es/components/form/FormItem.vue2.js +1 -1
  80. package/dist/es/components/form-input-number/InputNumber.js +1 -1
  81. package/dist/es/components/form-slider/Slider.vue2.js +1 -1
  82. package/dist/es/components/form-slider/slider-ticks.vue2.js +1 -1
  83. package/dist/es/components/form-slider/utils.js +1 -1
  84. package/dist/es/components/menu/MenuItem.js +1 -1
  85. package/dist/es/components/menu/overflow-wrap.js +1 -1
  86. package/dist/es/components/progress/circle.vue2.js +1 -1
  87. package/dist/es/components/progress/line.vue2.js +1 -1
  88. package/dist/es/components/progress/steps.vue2.js +1 -1
  89. package/dist/es/components/rate/Rate.js +1 -1
  90. package/dist/es/components/table/Table.js +947 -713
  91. package/dist/es/components/table/dom-listeners.js +23 -0
  92. package/dist/es/components/table/hooks/use-column-resize.js +27 -18
  93. package/dist/es/components/table/hooks/use-column-sorter.js +22 -29
  94. package/dist/es/components/table/hooks/use-drag.js +23 -20
  95. package/dist/es/components/table/hooks/use-filter.js +43 -43
  96. package/dist/es/components/table/hooks/use-keyboard-navigation.js +69 -0
  97. package/dist/es/components/table/hooks/use-row-selection.js +33 -29
  98. package/dist/es/components/table/hooks/use-sorter.js +86 -38
  99. package/dist/es/components/table/hooks/use-span.js +28 -35
  100. package/dist/es/components/table/locale.js +27 -10
  101. package/dist/es/components/table/table-col-group.vue2.js +9 -9
  102. package/dist/es/components/table/table-operation-td.js +72 -51
  103. package/dist/es/components/table/table-operation-th.js +41 -34
  104. package/dist/es/components/table/table-td.js +100 -77
  105. package/dist/es/components/table/table-th.js +221 -188
  106. package/dist/es/components/table/table-tr.js +11 -8
  107. package/dist/es/components/table/utils.js +104 -94
  108. package/dist/es/components/virtual-list-v2/hooks/use-size.js +47 -41
  109. package/dist/es/components/virtual-list-v2/virtual-list-item.js +29 -16
  110. package/dist/es/locale/en-US.js +7 -1
  111. package/dist/es/locale/index.js +3 -3
  112. package/dist/es/locale/zh-CN.js +7 -1
  113. package/dist/es/style.css +1 -1
  114. package/dist/index.cjs +3 -3
  115. package/dist/index.umd.js +3 -3
  116. package/dist/locale/interface.d.ts +9 -0
  117. package/dist/style/space.css +1 -1
  118. package/dist/style/table.css +1 -1
  119. package/dist/style.css +1 -1
  120. package/package.json +1 -1
  121. /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
  122. /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
  123. /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
  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/array.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/base.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/boolean.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/custom.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/number.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/object.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/rules/string.js +0 -0
  131. /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
  132. /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
  133. /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
  134. /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
  135. /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
  136. /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
  137. /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,77 +1,86 @@
1
- import { isUndefined as c, isArray as h, isNull as S } from "../../_utils/is.js";
2
- import { isNamedComponent as y, resolveProps as _, isSlotsChildren as $, isArrayChildren as b } from "../../_utils/vue-eco.js";
3
- const R = (t) => {
1
+ import { toRaw as F } from "vue";
2
+ import { isUndefined as h, isArray as c, isNull as _ } from "../../_utils/is.js";
3
+ import { isNamedComponent as $, resolveProps as b, isSlotsChildren as R, isArrayChildren as k } from "../../_utils/vue-eco.js";
4
+ const D = (e) => {
4
5
  let i = 0;
5
- const e = (r) => {
6
- if (h(r) && r.length > 0)
6
+ const t = (r) => {
7
+ if (c(r) && r.length > 0)
7
8
  for (const d of r)
8
- d.children ? e(d.children) : i += 1;
9
+ d.children ? t(d.children) : i += 1;
9
10
  };
10
- return e(t), i;
11
- }, F = (t) => {
11
+ return t(e), i;
12
+ }, I = (e) => {
12
13
  let i = 0;
13
- if (h(t) && t.length > 0) {
14
+ if (c(e) && e.length > 0) {
14
15
  i = 1;
15
- for (const e of t)
16
- if (e.children) {
17
- const r = F(e.children);
16
+ for (const t of e)
17
+ if (t.children) {
18
+ const r = I(t.children);
18
19
  r > 0 && (i = Math.max(i, r + 1));
19
20
  }
20
21
  }
21
22
  return i;
22
- }, p = (t, i) => {
23
- let { parent: e } = t;
24
- for (; e; )
25
- e.fixed === i && (i === "left" ? e.isLastLeftFixed = !0 : e.isFirstRightFixed = !0), e = e.parent;
26
- }, v = (t, i, e) => {
27
- const r = F(t);
23
+ }, w = (e, i) => {
24
+ let { parent: t } = e;
25
+ for (; t; )
26
+ t.fixed === i && (i === "left" ? t.isLastLeftFixed = !0 : t.isFirstRightFixed = !0), t = t.parent;
27
+ }, G = (e, i, t) => {
28
+ const r = I(e);
28
29
  i.clear();
29
- const d = [], s = [...Array(r)].map(() => []);
30
- let f, l;
31
- const x = (w, {
30
+ const d = [], l = [...Array(r)].map(() => []);
31
+ let s, f;
32
+ const g = (S, {
32
33
  level: a = 0,
33
- parent: L,
34
- fixed: g
34
+ parent: y,
35
+ fixed: x
35
36
  } = {}) => {
36
- for (const C of w) {
37
- const n = { ...C, parent: L };
38
- if (h(n.children)) {
39
- const o = R(n.children);
40
- o > 1 && (n.colSpan = o), s[a].push(n), x(n.children, {
37
+ for (const p of S) {
38
+ const n = { ...p, fixed: p.fixed ?? x, parent: y };
39
+ if (c(n.children)) {
40
+ const o = D(n.children);
41
+ o > 1 && (n.colSpan = o), l[a].push(n), g(n.children, {
41
42
  level: a + 1,
42
43
  parent: n,
43
44
  fixed: n.fixed
44
45
  });
45
46
  } else {
47
+ n.width !== void 0 && n.minWidth !== void 0 && (n.width = Math.max(n.width, n.minWidth));
46
48
  const o = r - a;
47
- o > 1 && (n.rowSpan = o), (g || n.fixed) && (n.fixed = n.fixed ?? g, n.fixed === "left" ? f = d.length : c(l) && (l = d.length)), (c(n.dataIndex) || S(n.dataIndex)) && (n.dataIndex = `__arco_data_index_${d.length}`), e[n.dataIndex] && (n._resizeWidth = e[n.dataIndex]), i.set(n.dataIndex, n), d.push(n), s[a].push(n);
49
+ o > 1 && (n.rowSpan = o), (x || n.fixed) && (n.fixed = n.fixed ?? x, n.fixed === "left" ? s = d.length : h(f) && (f = d.length)), (h(n.dataIndex) || _(n.dataIndex)) && (n.dataIndex = `__arco_data_index_${d.length}`), t[n.dataIndex] && (n._resizeWidth = t[n.dataIndex]), i.set(n.dataIndex, n), d.push(n), l[a].push(n);
48
50
  }
49
51
  }
50
52
  };
51
- return x(t), c(f) || (d[f].isLastLeftFixed = !0, p(d[f], "left")), c(l) || (d[l].isFirstRightFixed = !0, p(d[l], "right")), { dataColumns: d, groupColumns: s };
52
- }, k = (t, i) => {
53
- for (let e = 0; e < t.length; e++)
54
- if (t[e].name === i)
55
- return e;
53
+ return g(e), h(s) || (d[s].isLastLeftFixed = !0, w(d[s], "left")), h(f) || (d[f].isFirstRightFixed = !0, w(d[f], "right")), { dataColumns: d, groupColumns: l };
54
+ }, N = (e, i) => {
55
+ for (let t = 0; t < e.length; t++)
56
+ if (e[t].name === i)
57
+ return t;
56
58
  return -1;
57
- }, N = (t, i) => {
58
- const e = k(i, t.name);
59
- if (e <= 0)
59
+ }, W = (e, i) => {
60
+ const t = N(i, e.name);
61
+ if (t <= 0)
60
62
  return 0;
61
63
  let r = 0;
62
- const d = i.slice(0, e);
63
- for (const s of d)
64
- r += s.width ?? 0;
64
+ const d = i.slice(0, t);
65
+ for (const l of d)
66
+ r += l.width ?? 40;
65
67
  return r;
66
- }, m = (t) => t.children && t.children.length > 0 ? m(t.children[0]) : t, I = (t) => t.children && t.children.length > 0 ? I(t.children[t.children.length - 1]) : t, A = (t, {
68
+ }, L = (e) => e.children && e.children.length > 0 ? L(e.children[0]) : e, C = (e) => e.children && e.children.length > 0 ? C(e.children[e.children.length - 1]) : e, m = (e, i) => i.filter((t) => {
69
+ let r = t.parent;
70
+ for (; r; ) {
71
+ if (F(r) === F(e)) return !0;
72
+ r = r.parent;
73
+ }
74
+ return !1;
75
+ }), v = (e, {
67
76
  dataColumns: i,
68
- operations: e
77
+ operations: t
69
78
  }) => {
70
79
  let r = 0;
71
- if (t.fixed === "left") {
72
- for (const f of e)
80
+ if (e.fixed === "left") {
81
+ for (const f of t)
73
82
  r += f.width ?? 40;
74
- const s = m(t);
83
+ const s = m(e, i)[0] ?? L(e);
75
84
  for (const f of i) {
76
85
  if (s.dataIndex === f.dataIndex)
77
86
  break;
@@ -79,90 +88,91 @@ const R = (t) => {
79
88
  }
80
89
  return r;
81
90
  }
82
- const d = I(t);
91
+ const d = m(e, i), l = d[d.length - 1] ?? C(e);
83
92
  for (let s = i.length - 1; s >= 0; s--) {
84
93
  const f = i[s];
85
- if (d.dataIndex === f.dataIndex)
94
+ if (l.dataIndex === f.dataIndex)
86
95
  break;
87
96
  f.fixed === "right" && (r += f._resizeWidth ?? f.width ?? 0);
88
97
  }
89
98
  return r;
90
- }, H = (t, i) => i.fixed ? [
91
- `${t}-col-fixed-left`,
99
+ }, K = (e, i) => i.fixed ? [
100
+ `${e}-col-fixed-left`,
92
101
  {
93
- [`${t}-col-fixed-left-last`]: i.isLastLeftFixed
102
+ [`${e}-col-fixed-left-last`]: i.isLastLeftFixed
94
103
  }
95
- ] : [], P = (t, i) => i.fixed === "left" ? [
96
- `${t}-col-fixed-left`,
104
+ ] : [], M = (e, i) => i.fixed === "left" ? [
105
+ `${e}-col-fixed-left`,
97
106
  {
98
- [`${t}-col-fixed-left-last`]: i.isLastLeftFixed
107
+ [`${e}-col-fixed-left-last`]: i.isLastLeftFixed
99
108
  }
100
109
  ] : i.fixed === "right" ? [
101
- `${t}-col-fixed-right`,
110
+ `${e}-col-fixed-right`,
102
111
  {
103
- [`${t}-col-fixed-right-first`]: i.isFirstRightFixed
112
+ [`${e}-col-fixed-right-first`]: i.isFirstRightFixed
104
113
  }
105
- ] : [], G = (t, {
114
+ ] : [], U = (e, {
106
115
  dataColumns: i,
107
- operations: e
116
+ operations: t
108
117
  }) => {
109
- if (t.fixed) {
110
- const r = `${A(t, { dataColumns: i, operations: e })}px`;
111
- return t.fixed === "left" ? {
118
+ if (e.fixed) {
119
+ const r = `${v(e, { dataColumns: i, operations: t })}px`;
120
+ return e.fixed === "left" ? {
112
121
  left: r
113
122
  } : {
114
123
  right: r
115
124
  };
116
125
  }
117
126
  return {};
118
- }, K = (t, i) => t.fixed ? {
119
- left: `${N(t, i)}px`
120
- } : {}, u = (t) => {
127
+ }, j = (e, i) => e.fixed ? {
128
+ left: `${W(e, i)}px`
129
+ } : {}, u = (e) => {
121
130
  const i = [];
122
- for (const e of t)
123
- if (y(e, "TableColumn")) {
124
- const r = _(e);
125
- $(e, e.children) && (e.children.default && (r.children = u(e.children.default())), e.children.cell && (r.render = e.children.cell), e.children.title && (r.title = e.children.title)), i.push(r);
126
- } else b(e, e.children) ? i.push(...u(e.children)) : h(e) && i.push(...u(e));
131
+ for (const t of e)
132
+ if ($(t, "TableColumn")) {
133
+ const r = b(t);
134
+ R(t, t.children) && (t.children.default && (r.children = u(t.children.default())), t.children.cell && (r.render = t.children.cell), t.children.title && (r.title = t.children.title)), i.push(r);
135
+ } else k(t, t.children) ? i.push(...u(t.children)) : c(t) && i.push(...u(t));
127
136
  return i;
128
137
  };
129
- function D(t) {
130
- return t.map((i) => {
131
- const e = { ...i };
132
- return e.children && (e.children = D(e.children)), e;
138
+ function A(e) {
139
+ return e.map((i) => {
140
+ const t = { ...i };
141
+ return t.children && (t.children = A(t.children)), t;
133
142
  });
134
143
  }
135
- function O(t) {
136
- return t.map((i) => {
137
- const e = { ...i.raw };
138
- return i.children && (e.children = O(i.children)), e;
144
+ function O(e) {
145
+ return e.map((i) => {
146
+ const t = { ...i.raw };
147
+ return i.children && (t.children = O(i.children)), t;
139
148
  });
140
149
  }
141
- const z = (t) => {
150
+ const z = (e) => {
151
+ var t;
142
152
  const i = [];
143
- if (t.children)
144
- for (const e of t.children)
145
- e.isLeaf ? i.push(e.key) : i.push(...z(e));
153
+ if (e.children)
154
+ for (const r of e.children)
155
+ r.isLeaf || ((t = r.children) == null ? void 0 : t.length) === 0 ? r.disabled || i.push(r.key) : i.push(...z(r));
146
156
  return i;
147
- }, U = (t, i) => {
148
- let e = !1, r = !1;
149
- const d = i.filter((s) => t.includes(s));
150
- return d.length > 0 && (d.length >= i.length ? e = !0 : r = !0), {
151
- checked: e,
157
+ }, q = (e, i) => {
158
+ let t = !1, r = !1;
159
+ const d = i.filter((l) => e.includes(l));
160
+ return d.length > 0 && (d.length >= i.length ? t = !0 : r = !0), {
161
+ checked: t,
152
162
  indeterminate: r
153
163
  };
154
164
  };
155
165
  export {
156
166
  u as getColumnsFromSlot,
157
- P as getFixedCls,
158
- A as getFixedNumber,
159
- v as getGroupColumns,
167
+ M as getFixedCls,
168
+ v as getFixedNumber,
169
+ G as getGroupColumns,
160
170
  z as getLeafKeys,
161
- H as getOperationFixedCls,
162
- N as getOperationFixedNumber,
163
- K as getOperationStyle,
164
- U as getSelectionStatus,
165
- G as getStyle,
166
- D as mapArrayWithChildren,
171
+ K as getOperationFixedCls,
172
+ W as getOperationFixedNumber,
173
+ j as getOperationStyle,
174
+ q as getSelectionStatus,
175
+ U as getStyle,
176
+ A as mapArrayWithChildren,
167
177
  O as mapRawTableData
168
178
  };
@@ -1,60 +1,66 @@
1
- import { ref as z, computed as n, onMounted as O } from "vue";
2
- const B = ({
3
- dataKeys: h,
4
- contentRef: P,
1
+ import { ref as w, reactive as A, watch as O, computed as a, onMounted as P } from "vue";
2
+ const N = ({
3
+ dataKeys: i,
4
+ contentRef: b,
5
5
  fixedSize: _,
6
- estimatedSize: i,
7
- buffer: g
6
+ estimatedSize: g,
7
+ buffer: S
8
8
  }) => {
9
- const I = z(0), r = /* @__PURE__ */ new Map(), l = n(() => h.value.length), a = z(0), d = n(() => {
10
- const e = a.value + g.value * 3;
9
+ const I = w(0), u = A(/* @__PURE__ */ new Map());
10
+ O(i, (e) => {
11
+ const t = new Set(e);
12
+ for (const n of u.keys())
13
+ t.has(n) || u.delete(n);
14
+ });
15
+ const l = a(() => i.value.length), r = w(0), d = a(() => {
16
+ const e = r.value + S.value * 3;
11
17
  return e > l.value ? l.value : e;
12
- }), v = n(() => {
13
- const e = l.value - g.value * 3;
18
+ }), v = a(() => {
19
+ const e = l.value - S.value * 3;
14
20
  return e < 0 ? 0 : e;
15
21
  }), x = (e) => {
16
- e < 0 ? a.value = 0 : e > v.value ? a.value = v.value : a.value = e;
17
- }, c = z(_.value), s = n(() => i.value !== 30 ? i.value : I.value || i.value), M = (e, t) => {
18
- r.set(e, t);
22
+ e < 0 ? r.value = 0 : e > v.value ? r.value = v.value : r.value = e;
23
+ }, c = _, s = a(() => g.value !== 30 ? g.value ?? 30 : I.value || g.value || 30), z = (e, t) => {
24
+ Number.isFinite(t) && t > 0 && u.get(e) !== t && u.set(e, t);
19
25
  }, p = (e) => {
20
26
  if (c.value)
21
27
  return s.value;
22
- const t = h.value[e];
23
- return r.get(t) ?? s.value;
24
- }, w = (e) => r.has(e);
25
- O(() => {
26
- const e = Array.from(r.values()).reduce((t, u) => t + u, 0);
27
- e > 0 && (I.value = e / r.size);
28
+ const t = i.value[e];
29
+ return u.get(t) ?? s.value;
30
+ }, M = (e) => u.has(e);
31
+ P(() => {
32
+ const e = Array.from(u.values()).reduce((t, n) => t + n, 0);
33
+ e > 0 && (I.value = e / u.size);
28
34
  });
29
- const R = (e) => c.value ? s.value * e : S(0, e), S = (e, t) => {
30
- let u = 0;
35
+ const y = (e) => c.value ? s.value * e : m(0, e), m = (e, t) => {
36
+ let n = 0;
31
37
  for (let o = e; o < t; o++)
32
- u += p(o);
33
- return u;
34
- }, m = n(() => c.value ? s.value * a.value : S(0, a.value)), y = (e) => {
35
- const t = e >= m.value;
36
- let u = Math.abs(e - m.value);
37
- const o = t ? a.value : a.value - 1;
38
+ n += p(o);
39
+ return n;
40
+ }, h = a(() => c.value ? s.value * r.value : m(0, r.value)), F = (e) => {
41
+ const t = e >= h.value;
42
+ let n = Math.abs(e - h.value);
43
+ const o = t ? r.value : r.value - 1;
38
44
  let f = 0;
39
- for (; u > 0; )
40
- u -= p(o + f), t ? f++ : f--;
45
+ for (; n > 0; )
46
+ n -= p(o + f), t ? f++ : f--;
41
47
  return f;
42
- }, A = (e) => {
43
- const t = y(e), u = a.value + t - g.value;
44
- return u < 0 ? 0 : u > v.value ? v.value : u;
45
- }, F = n(() => c.value ? s.value * (l.value - d.value) : S(d.value, l.value));
48
+ }, R = (e) => {
49
+ const t = F(e), n = r.value + t - S.value;
50
+ return n < 0 ? 0 : n > v.value ? v.value : n;
51
+ }, k = a(() => c.value ? s.value * (l.value - d.value) : m(d.value, l.value));
46
52
  return {
47
- frontPadding: m,
48
- behindPadding: F,
49
- start: a,
53
+ frontPadding: h,
54
+ behindPadding: k,
55
+ start: r,
50
56
  end: d,
51
- getStartByScroll: A,
52
- setItemSize: M,
53
- hasItemSize: w,
57
+ getStartByScroll: R,
58
+ setItemSize: z,
59
+ hasItemSize: M,
54
60
  setStart: x,
55
- getScrollOffset: R
61
+ getScrollOffset: y
56
62
  };
57
63
  };
58
64
  export {
59
- B as useSize
65
+ N as useSize
60
66
  };
@@ -1,6 +1,7 @@
1
- import { defineComponent as s, getCurrentInstance as a, ref as d, onMounted as p, onBeforeUnmount as g, cloneVNode as h } from "vue";
2
- import { getFirstComponent as I } from "../../_utils/vue-eco.js";
3
- const C = /* @__PURE__ */ s({
1
+ import { defineComponent as d, getCurrentInstance as p, ref as g, watch as h, onMounted as a, onBeforeUnmount as I, cloneVNode as z } from "vue";
2
+ import l from "../../Users/xuyu/Code/x-next/node_modules/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js";
3
+ import { getFirstComponent as y } from "../../_utils/vue-eco.js";
4
+ const $ = /* @__PURE__ */ d({
4
5
  name: "VirtualListItem",
5
6
  props: {
6
7
  hasItemSize: {
@@ -12,24 +13,36 @@ const C = /* @__PURE__ */ s({
12
13
  required: !0
13
14
  }
14
15
  },
15
- setup(c, {
16
- slots: n
16
+ setup(f, {
17
+ slots: r
17
18
  }) {
18
- var o;
19
- const f = (o = a()) == null ? void 0 : o.vnode.key, r = d(), i = () => {
20
- var u, m;
21
- const e = ((u = r.value) == null ? void 0 : u.$el) ?? r.value, t = ((m = e == null ? void 0 : e.getBoundingClientRect) == null ? void 0 : m.call(e).height) ?? (e == null ? void 0 : e.offsetHeight);
22
- t && c.setItemSize(f, t);
19
+ var c;
20
+ const m = (c = p()) == null ? void 0 : c.vnode.key, u = g();
21
+ let n;
22
+ const i = () => {
23
+ var s;
24
+ const t = u.value, e = t && "$el" in t ? t.$el : t, o = ((s = e == null ? void 0 : e.getBoundingClientRect) == null ? void 0 : s.call(e).height) ?? (e == null ? void 0 : e.offsetHeight);
25
+ o && f.setItemSize(m, o);
23
26
  };
24
- return p(() => i()), g(() => i()), () => {
25
- var t;
26
- const e = I((t = n.default) == null ? void 0 : t.call(n));
27
- return e ? h(e, {
28
- ref: r
27
+ return h(u, (t) => {
28
+ n == null || n.disconnect();
29
+ const e = t && "$el" in t ? t.$el : t;
30
+ if (!(e != null && e.getBoundingClientRect)) return;
31
+ const o = typeof ResizeObserver > "u" ? l : ResizeObserver;
32
+ n = new o(i), n.observe(e), i();
33
+ }, {
34
+ flush: "post"
35
+ }), a(() => i()), I(() => {
36
+ n == null || n.disconnect(), i();
37
+ }), () => {
38
+ var e;
39
+ const t = y((e = r.default) == null ? void 0 : e.call(r));
40
+ return t ? z(t, {
41
+ ref: u
29
42
  }, !0) : null;
30
43
  };
31
44
  }
32
45
  });
33
46
  export {
34
- C as default
47
+ $ as default
35
48
  };
@@ -42,7 +42,13 @@ const e = {
42
42
  okText: "OK",
43
43
  currentColumnText: "Column",
44
44
  filterLabelText: "Filter {column}",
45
- summaryText: "Summary"
45
+ summaryText: "Summary",
46
+ expandRowText: "Expand row {row}",
47
+ collapseRowText: "Collapse row {row}",
48
+ selectRowText: "Select row {row}",
49
+ selectAllText: "Select all selectable rows",
50
+ resizeColumnText: "Resize {column} column",
51
+ moveRowText: "Move row {row}, Alt plus Up or Down to reorder"
46
52
  },
47
53
  dialog: {
48
54
  okText: "OK",
@@ -1,4 +1,4 @@
1
- import { inject as f, computed as g, ref as v } from "vue";
1
+ import { ref as f, inject as g, computed as v } from "vue";
2
2
  import c from "./zh-CN.js";
3
3
  import L from "./en-US.js";
4
4
  const l = {
@@ -15,13 +15,13 @@ const l = {
15
15
  t = t[s];
16
16
  }
17
17
  return typeof t == "string" ? t : void 0;
18
- }, r = v(m), d = (e) => {
18
+ }, r = f(m), d = (e) => {
19
19
  l[e] && (r.value = e);
20
20
  }, O = () => r.value, p = Symbol("XLocale"), h = (e, o) => {
21
21
  const n = l[r.value] ?? c, t = i(n, e);
22
22
  return t === void 0 ? String(e) : u(t, o);
23
23
  }, E = () => {
24
- const e = f(p, void 0), o = g(() => e != null && e.value ? e.value : l[r.value] ?? c);
24
+ const e = g(p, void 0), o = v(() => e != null && e.value ? e.value : l[r.value] ?? c);
25
25
  return { locale: o, t: (t, s) => {
26
26
  const a = i(o.value, t);
27
27
  return a === void 0 ? String(t) : u(a, s);
@@ -42,7 +42,13 @@ const e = {
42
42
  okText: "确认",
43
43
  currentColumnText: "当前列",
44
44
  filterLabelText: "筛选{column}",
45
- summaryText: "Summary"
45
+ summaryText: "Summary",
46
+ expandRowText: "展开行 {row}",
47
+ collapseRowText: "收起行 {row}",
48
+ selectRowText: "选择行 {row}",
49
+ selectAllText: "选择全部可选行",
50
+ resizeColumnText: "调整{column}列宽",
51
+ moveRowText: "移动行 {row},Alt 加上下方向键调整顺序"
46
52
  },
47
53
  dialog: {
48
54
  okText: "确认",