@septkit/ui 0.0.88 → 0.0.90
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/dist/dialecte/composables/change-id-window.js +14 -0
- package/dist/dialecte/composables/use-live-data.js +154 -31
- package/dist/dialecte/create-document-store.js +16 -7
- package/dist/dropdown/combobox.vue_vue_type_script_setup_true_lang.js +35 -29
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/dialecte-DHj8__Ch.js +7293 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/helpers-Bfv2XDC-.js +351 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/index.js +6 -0
- package/dist/external/.pnpm/{@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/open-connections-D59wm6nb.js → @dialecte_core@0.12.1/node_modules/@dialecte/core/dist/open-connections-ClJo0-Af.js} +2 -2
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/project-key-DD8DyQ8-.js +1751 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/qname-definition-C6GUFWL8.js +56 -0
- package/dist/external/.pnpm/{@dialecte_core@0.11.0 → @dialecte_core@0.12.1}/node_modules/@dialecte/core/dist/rolldown-runtime-CYdcPHCu.js +1 -1
- package/dist/external/.pnpm/{@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/same-json-value-boJ4pSRe.js → @dialecte_core@0.12.1/node_modules/@dialecte/core/dist/same-json-value-DTtSsGUF.js} +491 -370
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils-Q5zsKl3Y.js +2449 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils.js +2 -0
- package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/index.js +627 -0
- package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +31 -0
- package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/utils.js +38 -0
- package/dist/external/.pnpm/@tanstack_vue-virtual@3.13.31_vue@3.5.39_typescript@5.8.3_/node_modules/@tanstack/vue-virtual/dist/esm/index.js +28 -0
- package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +24 -2
- package/dist/index.d.ts +268 -7
- package/dist/index.js +7 -1
- package/dist/ui.css +1 -1
- package/dist/virtual/grid-aria.js +16 -0
- package/dist/virtual/grid-navigation.js +84 -0
- package/dist/virtual/index.js +6 -0
- package/dist/virtual/kept-range.js +32 -0
- package/dist/virtual/use-virtual-scroller.js +180 -0
- package/dist/virtual/virtual.constants.js +7 -0
- package/package.json +6 -4
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/dialecte-Cs_XRP4I.js +0 -4426
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +0 -130
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/index.js +0 -6
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/project-key-sr4wkl2Q.js +0 -1371
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js +0 -865
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils.js +0 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region lib/virtual/grid-aria.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let { rowCount: t, columnCount: n, headerRows: r = 0, headerColumns: i = 0 } = e, a = { "aria-rowcount": t + r };
|
|
4
|
+
return n === void 0 ? a : {
|
|
5
|
+
...a,
|
|
6
|
+
"aria-colcount": n + i
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function t(e) {
|
|
10
|
+
return { "aria-rowindex": e.index + 1 + (e.headerRows ?? 0) };
|
|
11
|
+
}
|
|
12
|
+
function n(e) {
|
|
13
|
+
return { "aria-colindex": e.index + 1 + (e.headerColumns ?? 0) };
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as cellAria, e as gridAria, t as rowAria };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//#region lib/virtual/grid-navigation.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let { key: t, ctrlKey: r = !1, rowCount: i, columnCount: a } = e;
|
|
4
|
+
if (i <= 0 || a <= 0) return;
|
|
5
|
+
let o = i - 1, s = a - 1, c = n({
|
|
6
|
+
value: e.position.row,
|
|
7
|
+
max: o
|
|
8
|
+
}), l = n({
|
|
9
|
+
value: e.position.column,
|
|
10
|
+
max: s
|
|
11
|
+
}), u = Math.max(1, e.rowsPerPage);
|
|
12
|
+
switch (t) {
|
|
13
|
+
case "ArrowUp": return {
|
|
14
|
+
row: n({
|
|
15
|
+
value: c - 1,
|
|
16
|
+
max: o
|
|
17
|
+
}),
|
|
18
|
+
column: l
|
|
19
|
+
};
|
|
20
|
+
case "ArrowDown": return {
|
|
21
|
+
row: n({
|
|
22
|
+
value: c + 1,
|
|
23
|
+
max: o
|
|
24
|
+
}),
|
|
25
|
+
column: l
|
|
26
|
+
};
|
|
27
|
+
case "ArrowLeft": return {
|
|
28
|
+
row: c,
|
|
29
|
+
column: n({
|
|
30
|
+
value: l - 1,
|
|
31
|
+
max: s
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
case "ArrowRight": return {
|
|
35
|
+
row: c,
|
|
36
|
+
column: n({
|
|
37
|
+
value: l + 1,
|
|
38
|
+
max: s
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
case "Home": return r ? {
|
|
42
|
+
row: 0,
|
|
43
|
+
column: 0
|
|
44
|
+
} : {
|
|
45
|
+
row: c,
|
|
46
|
+
column: 0
|
|
47
|
+
};
|
|
48
|
+
case "End": return r ? {
|
|
49
|
+
row: o,
|
|
50
|
+
column: s
|
|
51
|
+
} : {
|
|
52
|
+
row: c,
|
|
53
|
+
column: s
|
|
54
|
+
};
|
|
55
|
+
case "PageUp": return {
|
|
56
|
+
row: n({
|
|
57
|
+
value: c - u,
|
|
58
|
+
max: o
|
|
59
|
+
}),
|
|
60
|
+
column: l
|
|
61
|
+
};
|
|
62
|
+
case "PageDown": return {
|
|
63
|
+
row: n({
|
|
64
|
+
value: c + u,
|
|
65
|
+
max: o
|
|
66
|
+
}),
|
|
67
|
+
column: l
|
|
68
|
+
};
|
|
69
|
+
default: return;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function t(e) {
|
|
73
|
+
let { from: t, direction: n, count: r, isEligible: i } = e;
|
|
74
|
+
if (n === "forward") {
|
|
75
|
+
for (let e = Math.max(t + 1, 0); e < r; e++) if (i(e)) return e;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
for (let e = Math.min(t - 1, r - 1); e >= 0; e--) if (i(e)) return e;
|
|
79
|
+
}
|
|
80
|
+
function n(e) {
|
|
81
|
+
return Math.min(Math.max(e.value, 0), e.max);
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { t as findNextIndex, e as moveGridPosition };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DEFAULT_OVERSCAN as e } from "./virtual.constants.js";
|
|
2
|
+
import { computeSpacers as t, mergeKeptIndices as n, splitKeptItems as r } from "./kept-range.js";
|
|
3
|
+
import { useVirtualScroller as i } from "./use-virtual-scroller.js";
|
|
4
|
+
import { findNextIndex as a, moveGridPosition as o } from "./grid-navigation.js";
|
|
5
|
+
import { cellAria as s, gridAria as c, rowAria as l } from "./grid-aria.js";
|
|
6
|
+
export { e as DEFAULT_OVERSCAN, s as cellAria, t as computeSpacers, a as findNextIndex, c as gridAria, n as mergeKeptIndices, o as moveGridPosition, l as rowAria, r as splitKeptItems, i as useVirtualScroller };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region lib/virtual/kept-range.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let { range: t, keep: n, count: r } = e, i = n.filter((e) => e >= 0 && e < r);
|
|
4
|
+
return [.../* @__PURE__ */ new Set([...t, ...i])].sort((e, t) => e - t);
|
|
5
|
+
}
|
|
6
|
+
function t(e) {
|
|
7
|
+
let { items: t, totalSize: i, paddingStart: a = 0 } = e, { before: o, inRange: s, after: c } = n({ items: t }), l = s[0], u = s.at(-1);
|
|
8
|
+
return !l || !u ? {
|
|
9
|
+
before: 0,
|
|
10
|
+
after: Math.max(0, i - a - r(o))
|
|
11
|
+
} : {
|
|
12
|
+
before: Math.max(0, l.start - a - r(o)),
|
|
13
|
+
after: Math.max(0, i - (u.start + u.size) - r(c))
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function n(e) {
|
|
17
|
+
let t = e.items.filter((e) => !e.kept), n = t[0], r = t.at(-1), i = e.items.filter((e) => e.kept);
|
|
18
|
+
return !n || !r ? {
|
|
19
|
+
before: i,
|
|
20
|
+
inRange: t,
|
|
21
|
+
after: []
|
|
22
|
+
} : {
|
|
23
|
+
before: i.filter((e) => e.start < n.start),
|
|
24
|
+
inRange: t,
|
|
25
|
+
after: i.filter((e) => e.start > r.start)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function r(e) {
|
|
29
|
+
return e.reduce((e, t) => e + t.size, 0);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { t as computeSpacers, e as mergeKeptIndices, n as splitKeptItems };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { useResizeObserver as e } from "../external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js";
|
|
2
|
+
import { defaultRangeExtractor as t } from "../external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/index.js";
|
|
3
|
+
import { useVirtualizer as n } from "../external/.pnpm/@tanstack_vue-virtual@3.13.31_vue@3.5.39_typescript@5.8.3_/node_modules/@tanstack/vue-virtual/dist/esm/index.js";
|
|
4
|
+
import { DEFAULT_OVERSCAN as r } from "./virtual.constants.js";
|
|
5
|
+
import { computeSpacers as i, mergeKeptIndices as a } from "./kept-range.js";
|
|
6
|
+
import { computed as o, ref as s, toValue as c, unref as l, watch as u } from "vue";
|
|
7
|
+
//#region lib/virtual/use-virtual-scroller.ts
|
|
8
|
+
function d(e) {
|
|
9
|
+
let { scrollElement: t, rows: n, columns: a } = e, s = _(t), l = p({
|
|
10
|
+
scrollElement: t,
|
|
11
|
+
axis: n,
|
|
12
|
+
horizontal: !1,
|
|
13
|
+
defaultOverscan: r.rows,
|
|
14
|
+
scrollbarSize: () => s.value.horizontal,
|
|
15
|
+
measured: n.measured ?? !1,
|
|
16
|
+
initialRect: e.initialRect
|
|
17
|
+
}), u = a ? p({
|
|
18
|
+
scrollElement: t,
|
|
19
|
+
axis: a,
|
|
20
|
+
horizontal: !0,
|
|
21
|
+
defaultOverscan: r.columns,
|
|
22
|
+
scrollbarSize: () => s.value.vertical,
|
|
23
|
+
measured: !1,
|
|
24
|
+
initialRect: e.initialRect
|
|
25
|
+
}) : void 0, d = o(() => ({
|
|
26
|
+
height: l.virtualizer.value.getTotalSize(),
|
|
27
|
+
width: u?.virtualizer.value.getTotalSize() ?? 0
|
|
28
|
+
})), g = o(() => i({
|
|
29
|
+
items: l.items.value,
|
|
30
|
+
totalSize: d.value.height,
|
|
31
|
+
paddingStart: c(n.paddingStart) ?? 0
|
|
32
|
+
})), y = o(() => m(x())), b = o(() => h(x()));
|
|
33
|
+
function x() {
|
|
34
|
+
return {
|
|
35
|
+
virtualizer: l.virtualizer.value,
|
|
36
|
+
scrollElement: t.value,
|
|
37
|
+
axis: n,
|
|
38
|
+
items: l.items.value
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
rows: l.items,
|
|
43
|
+
columns: u?.items ?? o(() => []),
|
|
44
|
+
totalSize: d,
|
|
45
|
+
spacers: g,
|
|
46
|
+
visibleRange: y,
|
|
47
|
+
rowsPerPage: b,
|
|
48
|
+
measureRow: S,
|
|
49
|
+
scrollToIndex: C,
|
|
50
|
+
scrollToCell: w
|
|
51
|
+
};
|
|
52
|
+
function S(e) {
|
|
53
|
+
n.measured && (e === null || e instanceof Element) && l.virtualizer.value.measureElement(e);
|
|
54
|
+
}
|
|
55
|
+
function C(e) {
|
|
56
|
+
T(), l.virtualizer.value.scrollToIndex(e.index, { align: e.align ?? "auto" });
|
|
57
|
+
}
|
|
58
|
+
function w(e) {
|
|
59
|
+
let t = e.align ?? "auto";
|
|
60
|
+
T(), l.virtualizer.value.scrollToIndex(e.row, { align: t }), u?.virtualizer.value.scrollToIndex(e.column, { align: t });
|
|
61
|
+
}
|
|
62
|
+
function T() {
|
|
63
|
+
let e = t.value;
|
|
64
|
+
e && (s.value = v(e), f({
|
|
65
|
+
axis: l,
|
|
66
|
+
size: s.value.horizontal
|
|
67
|
+
}), u && f({
|
|
68
|
+
axis: u,
|
|
69
|
+
size: s.value.vertical
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function f(e) {
|
|
74
|
+
let t = e.axis.virtualizer.value;
|
|
75
|
+
t.options.scrollPaddingEnd !== e.size && t.setOptions({
|
|
76
|
+
...t.options,
|
|
77
|
+
scrollPaddingEnd: e.size
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function p(e) {
|
|
81
|
+
let { scrollElement: r, axis: i, horizontal: s, defaultOverscan: d, scrollbarSize: f, measured: p, initialRect: m } = e, h = o(() => c(i.overscan) ?? d), g = o(() => l(i.size)), _ = o(() => typeof g.value == "function" ? g.value(0) : g.value), v = n(o(() => {
|
|
82
|
+
let e = c(i.keep) ?? [];
|
|
83
|
+
return {
|
|
84
|
+
count: c(i.count),
|
|
85
|
+
getScrollElement: () => r.value ?? null,
|
|
86
|
+
estimateSize: b({
|
|
87
|
+
size: g.value,
|
|
88
|
+
sample: _.value
|
|
89
|
+
}),
|
|
90
|
+
overscan: h.value,
|
|
91
|
+
horizontal: s,
|
|
92
|
+
paddingStart: c(i.paddingStart) ?? 0,
|
|
93
|
+
scrollPaddingStart: c(i.scrollPaddingStart) ?? 0,
|
|
94
|
+
scrollPaddingEnd: f(),
|
|
95
|
+
getItemKey: i.getKey ?? x,
|
|
96
|
+
...m === void 0 ? {} : { initialRect: m },
|
|
97
|
+
rangeExtractor: (n) => a({
|
|
98
|
+
range: t(n),
|
|
99
|
+
keep: e,
|
|
100
|
+
count: n.count
|
|
101
|
+
}),
|
|
102
|
+
useAnimationFrameWithResizeObserver: p
|
|
103
|
+
};
|
|
104
|
+
})), S = o(() => {
|
|
105
|
+
let e = v.value, t = e.getVirtualItems(), n = e.range, r = c(i.count), a = n ? Math.max(0, n.startIndex - h.value) : 0, o = n ? Math.min(r - 1, n.endIndex + h.value) : -1;
|
|
106
|
+
return y({
|
|
107
|
+
items: t,
|
|
108
|
+
keep: c(i.keep) ?? [],
|
|
109
|
+
measurements: e.measurementsCache
|
|
110
|
+
}).map((e) => ({
|
|
111
|
+
index: e.index,
|
|
112
|
+
key: e.key,
|
|
113
|
+
start: e.start,
|
|
114
|
+
size: e.size,
|
|
115
|
+
kept: e.index < a || e.index > o
|
|
116
|
+
}));
|
|
117
|
+
});
|
|
118
|
+
return u([g, _], () => v.value.measure()), {
|
|
119
|
+
virtualizer: v,
|
|
120
|
+
items: S
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function m(e) {
|
|
124
|
+
let t = g(e);
|
|
125
|
+
if (!t) return {
|
|
126
|
+
start: 0,
|
|
127
|
+
end: -1
|
|
128
|
+
};
|
|
129
|
+
let n = e.items.filter((e) => e.start + e.size > t.top && e.start < t.bottom);
|
|
130
|
+
return n.length === 0 ? {
|
|
131
|
+
start: 0,
|
|
132
|
+
end: -1
|
|
133
|
+
} : {
|
|
134
|
+
start: n[0].index,
|
|
135
|
+
end: n[n.length - 1].index
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function h(e) {
|
|
139
|
+
let t = g(e);
|
|
140
|
+
if (!t) return 1;
|
|
141
|
+
let n = e.items.filter((e) => e.start >= t.top && e.start + e.size <= t.bottom);
|
|
142
|
+
return Math.max(1, n.length);
|
|
143
|
+
}
|
|
144
|
+
function g(e) {
|
|
145
|
+
let { virtualizer: t, scrollElement: n, axis: r } = e, i = t.scrollOffset;
|
|
146
|
+
if (i === null || !n) return;
|
|
147
|
+
let a = t.options.horizontal ? n.clientWidth : n.clientHeight;
|
|
148
|
+
return {
|
|
149
|
+
top: i + (c(r.scrollPaddingStart) ?? 0),
|
|
150
|
+
bottom: i + a
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function _(t) {
|
|
154
|
+
let n = s({
|
|
155
|
+
horizontal: 0,
|
|
156
|
+
vertical: 0
|
|
157
|
+
});
|
|
158
|
+
return e(t, () => {
|
|
159
|
+
t.value && (n.value = v(t.value));
|
|
160
|
+
}), n;
|
|
161
|
+
}
|
|
162
|
+
function v(e) {
|
|
163
|
+
return {
|
|
164
|
+
horizontal: e.offsetHeight - e.clientHeight,
|
|
165
|
+
vertical: e.offsetWidth - e.clientWidth
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function y(e) {
|
|
169
|
+
let { items: t, keep: n, measurements: r } = e, i = new Set(t.map((e) => e.index)), a = [...new Set(n)].filter((e) => !i.has(e) && r[e] !== void 0).map((e) => r[e]);
|
|
170
|
+
return a.length === 0 ? t : [...t, ...a].sort((e, t) => e.index - t.index);
|
|
171
|
+
}
|
|
172
|
+
function b(e) {
|
|
173
|
+
let { size: t, sample: n } = e;
|
|
174
|
+
return typeof t == "function" ? t : () => n;
|
|
175
|
+
}
|
|
176
|
+
function x(e) {
|
|
177
|
+
return e;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
export { d as useVirtualScroller };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@septkit/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.90",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"source": "lib/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
"./uicss": "./dist/ui.css"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@dialecte/core": "0.
|
|
20
|
-
"@dialecte/scl": "0.
|
|
19
|
+
"@dialecte/core": "0.12.1",
|
|
20
|
+
"@dialecte/scl": "0.22.0",
|
|
21
21
|
"@lucide/vue": "^1.16.0",
|
|
22
22
|
"@tailwindcss/vite": "4.2.2",
|
|
23
|
+
"@tanstack/vue-virtual": "^3.13.24",
|
|
23
24
|
"@vueuse/components": "^13.9.0",
|
|
24
25
|
"@vueuse/core": "^14.2.1",
|
|
25
26
|
"elkjs": "^0.10.2",
|
|
@@ -76,8 +77,9 @@
|
|
|
76
77
|
"build-only": "vite build",
|
|
77
78
|
"build-storybook": "storybook build",
|
|
78
79
|
"//====== TEST ======//": "",
|
|
79
|
-
"test": "pnpm test:unit",
|
|
80
|
+
"test": "pnpm test:unit && pnpm test:browser",
|
|
80
81
|
"test:unit": "vitest run --config vitest.unit.config.ts",
|
|
82
|
+
"test:browser": "vitest run --project browser",
|
|
81
83
|
"//====== CHECK ======//": "",
|
|
82
84
|
"type-check": "vue-tsc --build",
|
|
83
85
|
"lint": "oxlint . --fix -D correctness --ignore-path .gitignore",
|