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.
- package/AI_CODING.md +18 -1
- package/AI_USAGE/catalog.md +2 -2
- package/AI_USAGE/components/alert.md +2 -2
- package/AI_USAGE/components/bar-chart.md +6 -4
- package/AI_USAGE/components/button.md +3 -3
- package/AI_USAGE/components/checkbox.md +2 -2
- package/AI_USAGE/components/color-picker.md +2 -2
- package/AI_USAGE/components/config-provider.md +2 -2
- package/AI_USAGE/components/date-picker.md +2 -2
- package/AI_USAGE/components/dialog.md +2 -2
- package/AI_USAGE/components/dropdown.md +2 -2
- package/AI_USAGE/components/empty.md +2 -2
- package/AI_USAGE/components/input.md +3 -3
- package/AI_USAGE/components/line-chart.md +6 -4
- package/AI_USAGE/components/message-box.md +2 -2
- package/AI_USAGE/components/message.md +3 -3
- package/AI_USAGE/components/notification.md +4 -2
- package/AI_USAGE/components/pagination.md +2 -2
- package/AI_USAGE/components/pie-chart.md +2 -2
- package/AI_USAGE/components/popconfirm.md +2 -2
- package/AI_USAGE/components/popover.md +3 -3
- package/AI_USAGE/components/progress.md +4 -3
- package/AI_USAGE/components/radio.md +2 -2
- package/AI_USAGE/components/rate.md +2 -2
- package/AI_USAGE/components/select.md +3 -3
- package/AI_USAGE/components/slider.md +2 -2
- package/AI_USAGE/components/steps.md +2 -2
- package/AI_USAGE/components/switch.md +3 -3
- package/AI_USAGE/components/tabs.md +2 -2
- package/AI_USAGE/components/textarea.md +2 -2
- package/AI_USAGE/components/time-picker.md +3 -3
- package/AI_USAGE/components/upload.md +4 -4
- package/AI_USAGE/core.md +3 -3
- package/AI_USAGE/index.md +2 -2
- package/AI_USAGE/recipes/form-on-demand.md +11 -8
- package/AI_USAGE.md +36 -43
- package/CHANGELOG.md +34 -0
- package/dist/components/network/Network.vue.d.ts +1 -1
- package/dist/components/network/index.d.ts +3 -3
- package/dist/components/table/Table.d.ts +11 -0
- package/dist/components/table/context.d.ts +5 -0
- package/dist/components/table/dom-listeners.d.ts +23 -0
- package/dist/components/table/hooks/use-column-resize.d.ts +2 -1
- package/dist/components/table/hooks/use-drag.d.ts +6 -3
- package/dist/components/table/hooks/use-keyboard-navigation.d.ts +27 -0
- package/dist/components/table/hooks/use-sorter.d.ts +3 -1
- package/dist/components/table/index.d.ts +15 -0
- package/dist/components/table/interface.d.ts +9 -2
- package/dist/components/table/locale.d.ts +8 -7
- package/dist/components/table/table-operation-td.d.ts +34 -0
- package/dist/components/table/table-td.d.ts +36 -2
- package/dist/components/table/table-th.d.ts +34 -0
- package/dist/components/table/table-tr.d.ts +34 -0
- package/dist/components/trend-chart/components/TrendChart.d.ts +1 -1
- package/dist/components/trend-chart/index.d.ts +3 -3
- package/dist/components/upload/Upload.d.ts +1 -1
- package/dist/components/upload/index.d.ts +3 -3
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/es/_container/resize-observer-v2.js +1 -1
- package/dist/es/_container/resize-observer.js +1 -1
- package/dist/es/_hooks/use-resize-observer.js +1 -1
- package/dist/es/_virtual/advancedFormat.js +1 -1
- package/dist/es/_virtual/customParseFormat.js +1 -1
- package/dist/es/_virtual/dayjs.min.js +1 -1
- package/dist/es/_virtual/isBetween.js +1 -1
- package/dist/es/_virtual/quarterOfYear.js +1 -1
- package/dist/es/_virtual/weekOfYear.js +1 -1
- package/dist/es/_virtual/weekYear.js +1 -1
- package/dist/es/_virtual/zh-cn.js +1 -1
- package/dist/es/components/draggable/useDraggable.js +1 -1
- package/dist/es/components/form/Form.vue2.js +1 -1
- package/dist/es/components/form/FormItem.vue2.js +1 -1
- package/dist/es/components/form-input-number/InputNumber.js +1 -1
- package/dist/es/components/form-slider/Slider.vue2.js +1 -1
- package/dist/es/components/form-slider/slider-ticks.vue2.js +1 -1
- package/dist/es/components/form-slider/utils.js +1 -1
- package/dist/es/components/menu/MenuItem.js +1 -1
- package/dist/es/components/menu/overflow-wrap.js +1 -1
- package/dist/es/components/progress/circle.vue2.js +1 -1
- package/dist/es/components/progress/line.vue2.js +1 -1
- package/dist/es/components/progress/steps.vue2.js +1 -1
- package/dist/es/components/rate/Rate.js +1 -1
- package/dist/es/components/table/Table.js +947 -713
- package/dist/es/components/table/dom-listeners.js +23 -0
- package/dist/es/components/table/hooks/use-column-resize.js +27 -18
- package/dist/es/components/table/hooks/use-column-sorter.js +22 -29
- package/dist/es/components/table/hooks/use-drag.js +23 -20
- package/dist/es/components/table/hooks/use-filter.js +43 -43
- package/dist/es/components/table/hooks/use-keyboard-navigation.js +69 -0
- package/dist/es/components/table/hooks/use-row-selection.js +33 -29
- package/dist/es/components/table/hooks/use-sorter.js +86 -38
- package/dist/es/components/table/hooks/use-span.js +28 -35
- package/dist/es/components/table/locale.js +27 -10
- package/dist/es/components/table/table-col-group.vue2.js +9 -9
- package/dist/es/components/table/table-operation-td.js +72 -51
- package/dist/es/components/table/table-operation-th.js +41 -34
- package/dist/es/components/table/table-td.js +100 -77
- package/dist/es/components/table/table-th.js +221 -188
- package/dist/es/components/table/table-tr.js +11 -8
- package/dist/es/components/table/utils.js +104 -94
- package/dist/es/components/virtual-list-v2/hooks/use-size.js +47 -41
- package/dist/es/components/virtual-list-v2/virtual-list-item.js +29 -16
- package/dist/es/locale/en-US.js +7 -1
- package/dist/es/locale/index.js +3 -3
- package/dist/es/locale/zh-CN.js +7 -1
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/locale/interface.d.ts +9 -0
- package/dist/style/space.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
|
6
|
-
if (
|
|
6
|
+
const t = (r) => {
|
|
7
|
+
if (c(r) && r.length > 0)
|
|
7
8
|
for (const d of r)
|
|
8
|
-
d.children ?
|
|
9
|
+
d.children ? t(d.children) : i += 1;
|
|
9
10
|
};
|
|
10
|
-
return e
|
|
11
|
-
},
|
|
11
|
+
return t(e), i;
|
|
12
|
+
}, I = (e) => {
|
|
12
13
|
let i = 0;
|
|
13
|
-
if (
|
|
14
|
+
if (c(e) && e.length > 0) {
|
|
14
15
|
i = 1;
|
|
15
|
-
for (const
|
|
16
|
-
if (
|
|
17
|
-
const r =
|
|
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
|
-
},
|
|
23
|
-
let { parent:
|
|
24
|
-
for (;
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
const r =
|
|
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 = [],
|
|
30
|
-
let
|
|
31
|
-
const
|
|
30
|
+
const d = [], l = [...Array(r)].map(() => []);
|
|
31
|
+
let s, f;
|
|
32
|
+
const g = (S, {
|
|
32
33
|
level: a = 0,
|
|
33
|
-
parent:
|
|
34
|
-
fixed:
|
|
34
|
+
parent: y,
|
|
35
|
+
fixed: x
|
|
35
36
|
} = {}) => {
|
|
36
|
-
for (const
|
|
37
|
-
const n = { ...
|
|
38
|
-
if (
|
|
39
|
-
const o =
|
|
40
|
-
o > 1 && (n.colSpan = o),
|
|
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), (
|
|
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
|
|
52
|
-
},
|
|
53
|
-
for (let
|
|
54
|
-
if (t
|
|
55
|
-
return
|
|
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
|
-
},
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
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,
|
|
63
|
-
for (const
|
|
64
|
-
r +=
|
|
64
|
+
const d = i.slice(0, t);
|
|
65
|
+
for (const l of d)
|
|
66
|
+
r += l.width ?? 40;
|
|
65
67
|
return r;
|
|
66
|
-
},
|
|
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:
|
|
77
|
+
operations: t
|
|
69
78
|
}) => {
|
|
70
79
|
let r = 0;
|
|
71
|
-
if (
|
|
72
|
-
for (const f of
|
|
80
|
+
if (e.fixed === "left") {
|
|
81
|
+
for (const f of t)
|
|
73
82
|
r += f.width ?? 40;
|
|
74
|
-
const s = m(
|
|
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 =
|
|
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 (
|
|
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
|
-
},
|
|
91
|
-
`${
|
|
99
|
+
}, K = (e, i) => i.fixed ? [
|
|
100
|
+
`${e}-col-fixed-left`,
|
|
92
101
|
{
|
|
93
|
-
[`${
|
|
102
|
+
[`${e}-col-fixed-left-last`]: i.isLastLeftFixed
|
|
94
103
|
}
|
|
95
|
-
] : [],
|
|
96
|
-
`${
|
|
104
|
+
] : [], M = (e, i) => i.fixed === "left" ? [
|
|
105
|
+
`${e}-col-fixed-left`,
|
|
97
106
|
{
|
|
98
|
-
[`${
|
|
107
|
+
[`${e}-col-fixed-left-last`]: i.isLastLeftFixed
|
|
99
108
|
}
|
|
100
109
|
] : i.fixed === "right" ? [
|
|
101
|
-
`${
|
|
110
|
+
`${e}-col-fixed-right`,
|
|
102
111
|
{
|
|
103
|
-
[`${
|
|
112
|
+
[`${e}-col-fixed-right-first`]: i.isFirstRightFixed
|
|
104
113
|
}
|
|
105
|
-
] : [],
|
|
114
|
+
] : [], U = (e, {
|
|
106
115
|
dataColumns: i,
|
|
107
|
-
operations:
|
|
116
|
+
operations: t
|
|
108
117
|
}) => {
|
|
109
|
-
if (
|
|
110
|
-
const r = `${
|
|
111
|
-
return
|
|
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
|
-
},
|
|
119
|
-
left: `${
|
|
120
|
-
} : {}, u = (
|
|
127
|
+
}, j = (e, i) => e.fixed ? {
|
|
128
|
+
left: `${W(e, i)}px`
|
|
129
|
+
} : {}, u = (e) => {
|
|
121
130
|
const i = [];
|
|
122
|
-
for (const
|
|
123
|
-
if (
|
|
124
|
-
const r =
|
|
125
|
-
|
|
126
|
-
} else
|
|
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
|
|
130
|
-
return
|
|
131
|
-
const
|
|
132
|
-
return
|
|
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(
|
|
136
|
-
return
|
|
137
|
-
const
|
|
138
|
-
return i.children && (
|
|
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 = (
|
|
150
|
+
const z = (e) => {
|
|
151
|
+
var t;
|
|
142
152
|
const i = [];
|
|
143
|
-
if (
|
|
144
|
-
for (const
|
|
145
|
-
|
|
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
|
-
},
|
|
148
|
-
let
|
|
149
|
-
const d = i.filter((
|
|
150
|
-
return d.length > 0 && (d.length >= i.length ?
|
|
151
|
-
checked:
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
M as getFixedCls,
|
|
168
|
+
v as getFixedNumber,
|
|
169
|
+
G as getGroupColumns,
|
|
160
170
|
z as getLeafKeys,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
|
2
|
-
const
|
|
3
|
-
dataKeys:
|
|
4
|
-
contentRef:
|
|
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:
|
|
7
|
-
buffer:
|
|
6
|
+
estimatedSize: g,
|
|
7
|
+
buffer: S
|
|
8
8
|
}) => {
|
|
9
|
-
const I =
|
|
10
|
-
|
|
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 =
|
|
13
|
-
const e = l.value -
|
|
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 ?
|
|
17
|
-
}, c =
|
|
18
|
-
|
|
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 =
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
const e = Array.from(
|
|
27
|
-
e > 0 && (I.value = e /
|
|
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
|
|
30
|
-
let
|
|
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
|
-
|
|
33
|
-
return
|
|
34
|
-
},
|
|
35
|
-
const t = e >=
|
|
36
|
-
let
|
|
37
|
-
const o = t ?
|
|
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 (;
|
|
40
|
-
|
|
45
|
+
for (; n > 0; )
|
|
46
|
+
n -= p(o + f), t ? f++ : f--;
|
|
41
47
|
return f;
|
|
42
|
-
},
|
|
43
|
-
const t =
|
|
44
|
-
return
|
|
45
|
-
},
|
|
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:
|
|
48
|
-
behindPadding:
|
|
49
|
-
start:
|
|
53
|
+
frontPadding: h,
|
|
54
|
+
behindPadding: k,
|
|
55
|
+
start: r,
|
|
50
56
|
end: d,
|
|
51
|
-
getStartByScroll:
|
|
52
|
-
setItemSize:
|
|
53
|
-
hasItemSize:
|
|
57
|
+
getStartByScroll: R,
|
|
58
|
+
setItemSize: z,
|
|
59
|
+
hasItemSize: M,
|
|
54
60
|
setStart: x,
|
|
55
|
-
getScrollOffset:
|
|
61
|
+
getScrollOffset: y
|
|
56
62
|
};
|
|
57
63
|
};
|
|
58
64
|
export {
|
|
59
|
-
|
|
65
|
+
N as useSize
|
|
60
66
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
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(
|
|
16
|
-
slots:
|
|
16
|
+
setup(f, {
|
|
17
|
+
slots: r
|
|
17
18
|
}) {
|
|
18
|
-
var
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
25
|
-
|
|
26
|
-
const e =
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
47
|
+
$ as default
|
|
35
48
|
};
|
package/dist/es/locale/en-US.js
CHANGED
|
@@ -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",
|
package/dist/es/locale/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 =
|
|
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 =
|
|
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);
|
package/dist/es/locale/zh-CN.js
CHANGED
|
@@ -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: "确认",
|