@wirecore/wirelayer-react 0.1.1 → 0.2.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/dist/chart/Chart.d.ts.map +1 -1
- package/dist/chart/ChartCanvas.d.ts.map +1 -1
- package/dist/chart/Sparkline.d.ts.map +1 -1
- package/dist/chart.js +27 -25
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +2 -2
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/LocaleProvider/LocaleProvider.d.ts +1 -1
- package/dist/components/LocaleProvider/LocaleProvider.d.ts.map +1 -1
- package/dist/data-table/DataTable.d.ts +12 -3
- package/dist/data-table/DataTable.d.ts.map +1 -1
- package/dist/data-table/ValueInput.d.ts.map +1 -1
- package/dist/data-table/features.d.ts +3 -0
- package/dist/data-table/features.d.ts.map +1 -1
- package/dist/data-table/index.d.ts +4 -1
- package/dist/data-table/index.d.ts.map +1 -1
- package/dist/data-table/inputs.d.ts +6 -0
- package/dist/data-table/inputs.d.ts.map +1 -0
- package/dist/data-table/types.d.ts +41 -2
- package/dist/data-table/types.d.ts.map +1 -1
- package/dist/data-table.js +1166 -1143
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -57
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/de.d.ts.map +1 -0
- package/dist/locales/de.js +2 -0
- package/dist/virtual/index.d.ts +3 -0
- package/dist/virtual/index.d.ts.map +1 -1
- package/dist/virtual/virtual-rows.d.ts +4 -0
- package/dist/virtual/virtual-rows.d.ts.map +1 -0
- package/dist/virtual.js +124 -121
- package/package.json +3 -3
package/dist/virtual.js
CHANGED
|
@@ -10,25 +10,25 @@ import { Portal as C } from "@ark-ui/react/portal";
|
|
|
10
10
|
import { createListCollection as w } from "@ark-ui/react/collection";
|
|
11
11
|
import { Select as T } from "@ark-ui/react/select";
|
|
12
12
|
import { TreeView as E } from "@ark-ui/react/tree-view";
|
|
13
|
-
import { defaultRangeExtractor as D, useVirtualizer as
|
|
13
|
+
import { defaultRangeExtractor as D, useVirtualizer as O } from "@tanstack/react-virtual";
|
|
14
14
|
//#region src/virtual/VirtualSelect.tsx
|
|
15
|
-
function
|
|
15
|
+
function k({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder: c, disabled: l, invalid: te, required: ne, name: re, itemValue: E, itemLabel: D, itemDisabled: k, valueKey: j, clearable: M, loading: N, loadingText: P, size: F, filter: I, manualFilter: L, onFilterChange: R, emptyText: z, hasMore: B, onLoadMore: V, dataSource: H, pageSize: U, minSearchLength: ae, className: oe, style: W, onKeyDown: G, ...se }) {
|
|
16
16
|
let ce = t("select", u), le = t("virtualList", d), K = ce({
|
|
17
|
-
size:
|
|
18
|
-
clearable:
|
|
17
|
+
size: F,
|
|
18
|
+
clearable: M
|
|
19
19
|
}), q = le(), J = e(), ue = J.select, de = {
|
|
20
20
|
itemValue: E,
|
|
21
21
|
itemLabel: D,
|
|
22
|
-
itemDisabled:
|
|
23
|
-
itemGroup:
|
|
24
|
-
valueKey:
|
|
22
|
+
itemDisabled: k,
|
|
23
|
+
itemGroup: A,
|
|
24
|
+
valueKey: j
|
|
25
25
|
}, [Y, fe] = ie(""), X = r({
|
|
26
26
|
items: a,
|
|
27
|
-
source:
|
|
27
|
+
source: H,
|
|
28
28
|
accessors: de,
|
|
29
|
-
pageSize:
|
|
30
|
-
minSearchLength:
|
|
31
|
-
}), { options: pe, visible: Z, firstFor: me } = n(X.items, de,
|
|
29
|
+
pageSize: U,
|
|
30
|
+
minSearchLength: ae
|
|
31
|
+
}), { options: pe, visible: Z, firstFor: me } = n(X.items, de, I && !L && !H ? Y : ""), he = v(() => [...pe, ...X.resolvedOptions], [pe, X.resolvedOptions]), { selected: ge, keys: _e, commit: ve, commitKeys: ye } = i({
|
|
32
32
|
multiple: !1,
|
|
33
33
|
value: o,
|
|
34
34
|
defaultValue: ee,
|
|
@@ -38,20 +38,20 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
38
38
|
}), be = _e.join("\0");
|
|
39
39
|
g(() => {
|
|
40
40
|
X.resolve(_e, he);
|
|
41
|
-
}, [be,
|
|
42
|
-
let Q = !!
|
|
41
|
+
}, [be, H]);
|
|
42
|
+
let Q = !!N || X.loading, xe = !!B || X.hasMore, Se = ge[0], Ce = Se?.icon, we = v(() => w({
|
|
43
43
|
items: Z,
|
|
44
44
|
itemToString: (e) => e.label,
|
|
45
45
|
itemToValue: (e) => e.key,
|
|
46
46
|
isItemDisabled: (e) => e.disabled
|
|
47
|
-
}), [Z]), Te = _(), Ee = y(null), De = y(null), $ =
|
|
47
|
+
}), [Z]), Te = _(), Ee = y(null), De = y(null), $ = O({
|
|
48
48
|
count: Z.length,
|
|
49
|
-
getScrollElement: () =>
|
|
49
|
+
getScrollElement: () => I ? De.current : Ee.current,
|
|
50
50
|
estimateSize: () => 36,
|
|
51
51
|
overscan: 8
|
|
52
|
-
}), Oe = $.getVirtualItems().at(-1)?.index ?? -1, ke = y(
|
|
52
|
+
}), Oe = $.getVirtualItems().at(-1)?.index ?? -1, ke = y(V);
|
|
53
53
|
g(() => {
|
|
54
|
-
ke.current =
|
|
54
|
+
ke.current = H ? X.loadMore : V;
|
|
55
55
|
}), g(() => {
|
|
56
56
|
xe && !Q && Z.length && Oe >= Z.length - 1 && ke.current?.();
|
|
57
57
|
}, [
|
|
@@ -61,7 +61,7 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
61
61
|
xe
|
|
62
62
|
]);
|
|
63
63
|
function Ae(e) {
|
|
64
|
-
G?.(e),
|
|
64
|
+
G?.(e), M && ge.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), ve([]));
|
|
65
65
|
}
|
|
66
66
|
let je = /* @__PURE__ */ S(b, { children: [
|
|
67
67
|
/* @__PURE__ */ x("div", {
|
|
@@ -97,13 +97,13 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
97
97
|
children: [/* @__PURE__ */ x(m, {
|
|
98
98
|
className: K.loadingIcon(),
|
|
99
99
|
"aria-hidden": "true"
|
|
100
|
-
}),
|
|
100
|
+
}), P ?? J.common.loading]
|
|
101
101
|
}),
|
|
102
102
|
!Z.length && !Q && /* @__PURE__ */ x("div", {
|
|
103
103
|
role: "option",
|
|
104
104
|
"aria-disabled": "true",
|
|
105
105
|
className: K.empty(),
|
|
106
|
-
children:
|
|
106
|
+
children: z ?? X.emptyText ?? (Y ? J.common.noResults : J.common.empty)
|
|
107
107
|
})
|
|
108
108
|
] });
|
|
109
109
|
return /* @__PURE__ */ S(T.Root, {
|
|
@@ -113,7 +113,7 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
113
113
|
value: _e,
|
|
114
114
|
onValueChange: (e) => ye(e.value, e.items),
|
|
115
115
|
onOpenChange: (e) => {
|
|
116
|
-
e.open && X.open(), !e.open && Y && (fe(""),
|
|
116
|
+
e.open && X.open(), !e.open && Y && (fe(""), R?.(""), H && X.search(""));
|
|
117
117
|
},
|
|
118
118
|
disabled: l,
|
|
119
119
|
invalid: te,
|
|
@@ -123,11 +123,11 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
123
123
|
sameWidth: !0,
|
|
124
124
|
gutter: 4
|
|
125
125
|
},
|
|
126
|
-
composite: !
|
|
126
|
+
composite: !I,
|
|
127
127
|
scrollToIndexFn: (e) => $.scrollToIndex(e.index, { align: "auto" }),
|
|
128
128
|
children: [
|
|
129
129
|
/* @__PURE__ */ S(T.Control, {
|
|
130
|
-
...
|
|
130
|
+
...M ? { className: K.control() } : {},
|
|
131
131
|
children: [/* @__PURE__ */ S(T.Trigger, {
|
|
132
132
|
...se,
|
|
133
133
|
className: K.trigger(),
|
|
@@ -152,7 +152,7 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
152
152
|
"aria-hidden": "true"
|
|
153
153
|
})
|
|
154
154
|
})]
|
|
155
|
-
}),
|
|
155
|
+
}), M && /* @__PURE__ */ x(T.Context, { children: (e) => Se && !e.disabled && /* @__PURE__ */ x("button", {
|
|
156
156
|
type: "button",
|
|
157
157
|
tabIndex: -1,
|
|
158
158
|
className: K.clear(),
|
|
@@ -170,8 +170,8 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
170
170
|
ref: Ee,
|
|
171
171
|
className: K.content(),
|
|
172
172
|
"aria-busy": Q || void 0,
|
|
173
|
-
"aria-label":
|
|
174
|
-
children:
|
|
173
|
+
"aria-label": I ? se["aria-label"] : void 0,
|
|
174
|
+
children: I ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("div", {
|
|
175
175
|
className: K.header(),
|
|
176
176
|
children: /* @__PURE__ */ x(T.Context, { children: (e) => /* @__PURE__ */ x("input", {
|
|
177
177
|
type: "text",
|
|
@@ -188,8 +188,8 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
188
188
|
className: K.search(),
|
|
189
189
|
onChange: (t) => {
|
|
190
190
|
let n = t.target.value;
|
|
191
|
-
fe(n),
|
|
192
|
-
let r =
|
|
191
|
+
fe(n), R?.(n), H && X.search(n);
|
|
192
|
+
let r = L || H ? void 0 : me(n);
|
|
193
193
|
r && requestAnimationFrame(() => e.setHighlightValue(r.key));
|
|
194
194
|
},
|
|
195
195
|
onKeyDown: (e) => {
|
|
@@ -208,7 +208,7 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
208
208
|
})] }) : je
|
|
209
209
|
}) }) }),
|
|
210
210
|
/* @__PURE__ */ x(T.HiddenSelect, {}),
|
|
211
|
-
|
|
211
|
+
H && /* @__PURE__ */ x("span", {
|
|
212
212
|
role: "status",
|
|
213
213
|
className: K.status(),
|
|
214
214
|
children: X.announcement
|
|
@@ -216,22 +216,22 @@ function O({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
216
216
|
]
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var A = () => void 0;
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region src/virtual/VirtualList.tsx
|
|
222
|
-
function
|
|
223
|
-
let E = t("virtualListBox", ne)(),
|
|
222
|
+
function j({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, height: ee = "20rem", itemGroup: s, hasMore: c = !1, loading: l = !1, loadingMore: u = !1, endThreshold: te = 5, onLoadMore: d, onEndReached: f, dataSource: p, query: h, pageSize: _, children: ie, className: C, style: w, ref: T }) {
|
|
223
|
+
let E = t("virtualListBox", ne)(), k = e(), A = y(null), { search: j, ...M } = h ?? {}, N = a({
|
|
224
224
|
source: p,
|
|
225
225
|
pageSize: _,
|
|
226
|
-
query: h ?
|
|
227
|
-
}),
|
|
226
|
+
query: h ? M : void 0
|
|
227
|
+
}), P = y(null);
|
|
228
228
|
g(() => {
|
|
229
229
|
if (!p) return;
|
|
230
|
-
let e =
|
|
231
|
-
|
|
232
|
-
}, [p,
|
|
233
|
-
let
|
|
234
|
-
if (!s) return
|
|
230
|
+
let e = P.current === null;
|
|
231
|
+
P.current = j ?? "", N.search(j ?? "", !e);
|
|
232
|
+
}, [p, j]);
|
|
233
|
+
let F = p ? N.state.items : n, I = p ? N.state.hasMore : c, L = p ? N.state.status === "loading" : l || u, R = v(() => {
|
|
234
|
+
if (!s) return F.map((e, t) => ({
|
|
235
235
|
kind: "item",
|
|
236
236
|
item: e,
|
|
237
237
|
index: t
|
|
@@ -240,7 +240,7 @@ function A({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
|
|
|
240
240
|
let t = typeof s == "function" ? s(e) : e?.[s];
|
|
241
241
|
return t == null || t === "" ? void 0 : String(t);
|
|
242
242
|
}, t = [], n;
|
|
243
|
-
return
|
|
243
|
+
return F.forEach((r, i) => {
|
|
244
244
|
let a = e(r);
|
|
245
245
|
a !== void 0 && a !== n && t.push({
|
|
246
246
|
kind: "header",
|
|
@@ -251,40 +251,40 @@ function A({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
|
|
|
251
251
|
index: i
|
|
252
252
|
});
|
|
253
253
|
}), t;
|
|
254
|
-
}, [
|
|
255
|
-
count:
|
|
256
|
-
getScrollElement: () =>
|
|
254
|
+
}, [F, s]), z = v(() => R.flatMap((e, t) => e.kind === "header" ? [t] : []), [R]), B = (e) => [...z].reverse().find((t) => e >= t) ?? -1, V = O({
|
|
255
|
+
count: R.length,
|
|
256
|
+
getScrollElement: () => A.current,
|
|
257
257
|
estimateSize: (e) => {
|
|
258
|
-
let t =
|
|
258
|
+
let t = R[e];
|
|
259
259
|
return t?.kind === "item" && o ? o(t.item, t.index) : i;
|
|
260
260
|
},
|
|
261
261
|
measureElement: (e) => e.getBoundingClientRect().height || i,
|
|
262
262
|
overscan: 6,
|
|
263
|
-
rangeExtractor:
|
|
264
|
-
let t =
|
|
263
|
+
rangeExtractor: z.length ? (e) => {
|
|
264
|
+
let t = B(e.startIndex), n = new Set(D(e));
|
|
265
265
|
return t >= 0 && n.add(t), [...n].sort((e, t) => e - t);
|
|
266
266
|
} : D,
|
|
267
267
|
initialRect: {
|
|
268
268
|
width: 0,
|
|
269
269
|
height: 320
|
|
270
270
|
}
|
|
271
|
-
}),
|
|
271
|
+
}), H = V.getVirtualItems(), U = z.length ? B(V.range?.startIndex ?? 0) : -1, ae = y(-1), oe = H.at(-1)?.index;
|
|
272
272
|
g(() => {
|
|
273
|
-
oe !== void 0 &&
|
|
273
|
+
oe !== void 0 && I && !L && ae.current !== R.length && (oe < R.length - 1 - te || (ae.current = R.length, p ? N.loadMore() : (d?.(), f?.())));
|
|
274
274
|
});
|
|
275
275
|
let W = !!p || c || l || u;
|
|
276
276
|
re(T, () => ({
|
|
277
277
|
scrollToIndex(e, t = {}) {
|
|
278
|
-
let n =
|
|
279
|
-
n >= 0 &&
|
|
278
|
+
let n = R.findIndex((t) => t.kind === "item" && t.index === e);
|
|
279
|
+
n >= 0 && V.scrollToIndex(n, { align: t.align ?? "auto" });
|
|
280
280
|
},
|
|
281
|
-
refresh: () =>
|
|
281
|
+
refresh: () => N.refresh()
|
|
282
282
|
}));
|
|
283
283
|
let G = /* @__PURE__ */ S("div", {
|
|
284
|
-
ref:
|
|
284
|
+
ref: A,
|
|
285
285
|
role: "list",
|
|
286
286
|
"aria-label": r,
|
|
287
|
-
"aria-busy": W &&
|
|
287
|
+
"aria-busy": W && L || void 0,
|
|
288
288
|
tabIndex: 0,
|
|
289
289
|
className: E.base({ class: C }),
|
|
290
290
|
style: {
|
|
@@ -293,14 +293,14 @@ function A({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
|
|
|
293
293
|
},
|
|
294
294
|
children: [/* @__PURE__ */ x("div", {
|
|
295
295
|
className: E.spacer(),
|
|
296
|
-
style: { height:
|
|
297
|
-
children:
|
|
298
|
-
let t =
|
|
296
|
+
style: { height: V.getTotalSize() },
|
|
297
|
+
children: H.map((e) => {
|
|
298
|
+
let t = R[e.index];
|
|
299
299
|
if (!t) return null;
|
|
300
300
|
if (t.kind === "header") {
|
|
301
|
-
let n = e.index ===
|
|
301
|
+
let n = e.index === U;
|
|
302
302
|
return /* @__PURE__ */ x("div", {
|
|
303
|
-
ref:
|
|
303
|
+
ref: V.measureElement,
|
|
304
304
|
role: "presentation",
|
|
305
305
|
"data-index": e.index,
|
|
306
306
|
className: n ? E.groupHeader({ class: E.sticky() }) : E.item({ class: E.groupHeader() }),
|
|
@@ -309,39 +309,39 @@ function A({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
|
|
|
309
309
|
}, e.key);
|
|
310
310
|
}
|
|
311
311
|
return /* @__PURE__ */ x("div", {
|
|
312
|
-
ref:
|
|
312
|
+
ref: V.measureElement,
|
|
313
313
|
role: "listitem",
|
|
314
314
|
"aria-posinset": t.index + 1,
|
|
315
|
-
"aria-setsize":
|
|
315
|
+
"aria-setsize": F.length,
|
|
316
316
|
"data-index": e.index,
|
|
317
317
|
className: E.item(),
|
|
318
318
|
style: { transform: `translateY(${e.start}px)` },
|
|
319
319
|
children: ie(t.item, t.index)
|
|
320
320
|
}, e.key);
|
|
321
321
|
})
|
|
322
|
-
}), W &&
|
|
322
|
+
}), W && L && F.length > 0 && /* @__PURE__ */ S("div", {
|
|
323
323
|
className: E.loading(),
|
|
324
324
|
"aria-hidden": "true",
|
|
325
|
-
children: [/* @__PURE__ */ x(m, { className: E.loadingIcon() }),
|
|
325
|
+
children: [/* @__PURE__ */ x(m, { className: E.loadingIcon() }), k.dataSource.loadingMore]
|
|
326
326
|
})]
|
|
327
327
|
});
|
|
328
328
|
return p ? /* @__PURE__ */ S(b, { children: [G, /* @__PURE__ */ x("p", {
|
|
329
329
|
role: "status",
|
|
330
330
|
className: E.status(),
|
|
331
|
-
children:
|
|
331
|
+
children: N.announcement
|
|
332
332
|
})] }) : G;
|
|
333
333
|
}
|
|
334
334
|
//#endregion
|
|
335
335
|
//#region src/virtual/VirtualTree.tsx
|
|
336
|
-
function
|
|
336
|
+
function M(e, t = 6) {
|
|
337
337
|
requestAnimationFrame(() => {
|
|
338
338
|
let n = e();
|
|
339
|
-
n ? n.ownerDocument.activeElement !== n && n.focus() : t > 0 &&
|
|
339
|
+
n ? n.ownerDocument.activeElement !== n && n.focus() : t > 0 && M(e, t - 1);
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
let
|
|
344
|
-
...
|
|
342
|
+
function N({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u = "single", checkable: d = !1, checkStrictly: ne = !1, checkedValue: f, defaultCheckedValue: p, reorderable: h = !1, filter: g = !1, filterMode: _ = "filter", expandControls: ie = !1, renderNode: b, emptyText: C, empty: w, height: T = "20rem", itemHeight: D = 32, className: k, style: A, ref: j, ...N }) {
|
|
343
|
+
let P = t("tree", te, n)(), F = e(), I = F.tree, L = y(null), R = y(null), z = s({
|
|
344
|
+
...N,
|
|
345
345
|
items: r,
|
|
346
346
|
checkable: d,
|
|
347
347
|
checkStrictly: ne,
|
|
@@ -349,29 +349,29 @@ function M({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u =
|
|
|
349
349
|
defaultCheckedValue: p,
|
|
350
350
|
reorderable: h,
|
|
351
351
|
filterMode: _
|
|
352
|
-
},
|
|
352
|
+
}, L), B = v(() => {
|
|
353
353
|
let e = [];
|
|
354
|
-
for (let t of l(
|
|
354
|
+
for (let t of l(z.view, z.expanded)) e.push({
|
|
355
355
|
...t,
|
|
356
356
|
kind: "node"
|
|
357
|
-
}), t.expanded &&
|
|
357
|
+
}), t.expanded && z.loadingOf(t.node) && e.push({
|
|
358
358
|
kind: "loading",
|
|
359
359
|
parentId: t.node.id,
|
|
360
360
|
level: t.level
|
|
361
361
|
});
|
|
362
362
|
return e;
|
|
363
363
|
}, [
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
]),
|
|
368
|
-
count:
|
|
369
|
-
getScrollElement: () =>
|
|
364
|
+
z.view,
|
|
365
|
+
z.expanded,
|
|
366
|
+
z.loadingOf
|
|
367
|
+
]), V = O({
|
|
368
|
+
count: B.length,
|
|
369
|
+
getScrollElement: () => R.current,
|
|
370
370
|
estimateSize: () => D,
|
|
371
371
|
measureElement: (e) => e.getBoundingClientRect().height || D,
|
|
372
372
|
overscan: 8,
|
|
373
373
|
getItemKey: (e) => {
|
|
374
|
-
let t =
|
|
374
|
+
let t = B[e];
|
|
375
375
|
return t.kind === "node" ? t.node.id : `${t.parentId}\u0000loading`;
|
|
376
376
|
},
|
|
377
377
|
initialRect: {
|
|
@@ -379,44 +379,44 @@ function M({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u =
|
|
|
379
379
|
height: 320
|
|
380
380
|
}
|
|
381
381
|
});
|
|
382
|
-
re(
|
|
383
|
-
expandAll:
|
|
384
|
-
collapseAll:
|
|
385
|
-
invalidate:
|
|
382
|
+
re(j, () => ({
|
|
383
|
+
expandAll: z.expandAll,
|
|
384
|
+
collapseAll: z.collapseAll,
|
|
385
|
+
invalidate: z.invalidate,
|
|
386
386
|
focusNode: (e) => {
|
|
387
|
-
let t =
|
|
388
|
-
t >= 0 &&
|
|
387
|
+
let t = B.findIndex((t) => t.kind === "node" && t.node.id === e);
|
|
388
|
+
t >= 0 && V.scrollToIndex(t, { align: "auto" }), requestAnimationFrame(() => z.focusNode(e));
|
|
389
389
|
}
|
|
390
390
|
}));
|
|
391
|
-
let
|
|
391
|
+
let H = C ?? (z.query.trim() ? I.noMatches : N.group === void 0 ? void 0 : F.common.empty), U = !z.view.length && (H !== void 0 || !!w || N.group !== void 0);
|
|
392
392
|
return /* @__PURE__ */ S(E.Root, {
|
|
393
|
-
ref:
|
|
394
|
-
className:
|
|
395
|
-
style:
|
|
396
|
-
collection:
|
|
393
|
+
ref: L,
|
|
394
|
+
className: P.base({ class: k }),
|
|
395
|
+
style: A,
|
|
396
|
+
collection: z.collection,
|
|
397
397
|
selectionMode: u,
|
|
398
|
-
selectedValue:
|
|
399
|
-
onSelectionChange: (e) =>
|
|
400
|
-
expandedValue:
|
|
401
|
-
onExpandedChange: (e) =>
|
|
402
|
-
...
|
|
398
|
+
selectedValue: z.selected,
|
|
399
|
+
onSelectionChange: (e) => z.onSelectionChange(e.selectedValue),
|
|
400
|
+
expandedValue: z.expanded,
|
|
401
|
+
onExpandedChange: (e) => z.setExpanded(e.expandedValue),
|
|
402
|
+
...z.ownChecks ? {} : {
|
|
403
403
|
checkedValue: f,
|
|
404
404
|
defaultCheckedValue: p
|
|
405
405
|
},
|
|
406
|
-
onCheckedChange: (e) =>
|
|
407
|
-
translations: { treeLabel: i ?? a ??
|
|
406
|
+
onCheckedChange: (e) => z.ownChecks || z.onArkCheckedChange(e.checkedValue),
|
|
407
|
+
translations: { treeLabel: i ?? a ?? F.tree.treeLabel },
|
|
408
408
|
scrollToIndexFn: ({ node: e, getElement: t }) => {
|
|
409
|
-
let n =
|
|
410
|
-
n < 0 || (
|
|
409
|
+
let n = B.findIndex((t) => t.kind === "node" && t.node.id === e.id);
|
|
410
|
+
n < 0 || (V.scrollToIndex(n, { align: "auto" }), M(t));
|
|
411
411
|
},
|
|
412
|
-
onKeyDownCapture:
|
|
412
|
+
onKeyDownCapture: z.onKeyDown,
|
|
413
413
|
children: [
|
|
414
414
|
i && /* @__PURE__ */ x(E.Label, {
|
|
415
|
-
className:
|
|
415
|
+
className: P.label(),
|
|
416
416
|
children: i
|
|
417
417
|
}),
|
|
418
418
|
/* @__PURE__ */ x(o, {
|
|
419
|
-
model:
|
|
419
|
+
model: z,
|
|
420
420
|
filter: g,
|
|
421
421
|
filterMode: _,
|
|
422
422
|
expandControls: ie,
|
|
@@ -424,25 +424,25 @@ function M({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u =
|
|
|
424
424
|
}),
|
|
425
425
|
/* @__PURE__ */ x(c, {
|
|
426
426
|
value: {
|
|
427
|
-
model:
|
|
427
|
+
model: z,
|
|
428
428
|
checkable: d,
|
|
429
429
|
showLines: !1,
|
|
430
430
|
renderNode: b
|
|
431
431
|
},
|
|
432
432
|
children: /* @__PURE__ */ x(E.Tree, {
|
|
433
|
-
ref:
|
|
434
|
-
className:
|
|
433
|
+
ref: R,
|
|
434
|
+
className: P.tree({ class: P.viewport() }),
|
|
435
435
|
style: { height: T },
|
|
436
|
-
hidden:
|
|
436
|
+
hidden: U || void 0,
|
|
437
437
|
children: /* @__PURE__ */ x("div", {
|
|
438
|
-
className:
|
|
439
|
-
style: { height:
|
|
440
|
-
children:
|
|
441
|
-
let t =
|
|
438
|
+
className: P.spacer(),
|
|
439
|
+
style: { height: V.getTotalSize() },
|
|
440
|
+
children: V.getVirtualItems().map((e) => {
|
|
441
|
+
let t = B[e.index];
|
|
442
442
|
return /* @__PURE__ */ x("div", {
|
|
443
|
-
ref:
|
|
443
|
+
ref: V.measureElement,
|
|
444
444
|
"data-index": e.index,
|
|
445
|
-
className:
|
|
445
|
+
className: P.row(),
|
|
446
446
|
style: { transform: `translateY(${e.start}px)` },
|
|
447
447
|
children: t.kind === "node" ? /* @__PURE__ */ x(ee, {
|
|
448
448
|
node: t.node,
|
|
@@ -451,29 +451,32 @@ function M({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u =
|
|
|
451
451
|
posinset: t.posinset,
|
|
452
452
|
setsize: t.setsize
|
|
453
453
|
}) : /* @__PURE__ */ S("div", {
|
|
454
|
-
className:
|
|
454
|
+
className: P.loadingRow(),
|
|
455
455
|
style: { "--depth": t.level },
|
|
456
456
|
"aria-hidden": "true",
|
|
457
|
-
children: [/* @__PURE__ */ x(m, { className:
|
|
457
|
+
children: [/* @__PURE__ */ x(m, { className: P.loadingIcon() }), I.loadingRow]
|
|
458
458
|
})
|
|
459
459
|
}, e.key);
|
|
460
460
|
})
|
|
461
461
|
})
|
|
462
462
|
})
|
|
463
463
|
}),
|
|
464
|
-
|
|
465
|
-
className:
|
|
466
|
-
onDragOver:
|
|
467
|
-
onDrop:
|
|
468
|
-
children: w ??
|
|
464
|
+
U && /* @__PURE__ */ x("div", {
|
|
465
|
+
className: P.empty(),
|
|
466
|
+
onDragOver: z.onEmptyDragOver,
|
|
467
|
+
onDrop: z.onEmptyDrop,
|
|
468
|
+
children: w ?? H
|
|
469
469
|
}),
|
|
470
470
|
/* @__PURE__ */ x("p", {
|
|
471
471
|
role: "status",
|
|
472
|
-
className:
|
|
473
|
-
children:
|
|
472
|
+
className: P.status(),
|
|
473
|
+
children: z.status
|
|
474
474
|
})
|
|
475
475
|
]
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
478
|
//#endregion
|
|
479
|
-
|
|
479
|
+
//#region src/virtual/virtual-rows.ts
|
|
480
|
+
var P = { useVirtualizer: O };
|
|
481
|
+
//#endregion
|
|
482
|
+
export { j as VirtualList, k as VirtualSelect, N as VirtualTree, P as virtualRows };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecore/wirelayer-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "WireLayer components for React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
"dependencies": {
|
|
158
158
|
"@ark-ui/react": "^5.39.3",
|
|
159
159
|
"@internationalized/date": "^3.12.4",
|
|
160
|
-
"@wirecore/wirelayer-recipes": "^0.
|
|
161
|
-
"@wirecore/wirelayer-tokens": "^0.
|
|
160
|
+
"@wirecore/wirelayer-recipes": "^0.2.0",
|
|
161
|
+
"@wirecore/wirelayer-tokens": "^0.2.0",
|
|
162
162
|
"lucide-react": "^1.59.0"
|
|
163
163
|
},
|
|
164
164
|
"devDependencies": {
|