@wirecore/wirelayer-react 0.6.0 → 0.7.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/Checkbox-BMRax6m4.js +49 -0
- package/dist/ContextMenu-BD72S5n6.js +1452 -0
- package/dist/{Highlight-CX30-nP7.js → Highlight-43-H9459.js} +93 -86
- package/dist/Input-C8T3WLd5.js +119 -0
- package/dist/PasswordInput-SjO66gZB.js +422 -0
- package/dist/Select-7rfeNmJb.js +242 -0
- package/dist/Slider-Bfm_jjYE.js +80 -0
- package/dist/{Tree-BiPIkmwT.js → Tree-DVjwp6FG.js} +1 -1
- package/dist/chart.js +1 -1
- package/dist/components/AngleSlider/AngleSlider.d.ts +3 -1
- package/dist/components/AngleSlider/AngleSlider.d.ts.map +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +3 -1
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/CascadeSelect/CascadeSelect.d.ts +3 -1
- package/dist/components/CascadeSelect/CascadeSelect.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +3 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +1 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/Confirm/ConfirmDialog.d.ts +6 -1
- package/dist/components/Confirm/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/Confirm/confirm.d.ts +7 -0
- package/dist/components/Confirm/confirm.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +3 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePickerBase.d.ts +3 -1
- package/dist/components/DatePicker/DatePickerBase.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +3 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +3 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/DurationInput/DurationInput.d.ts +3 -1
- package/dist/components/DurationInput/DurationInput.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +3 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/Knob/Knob.d.ts +3 -1
- package/dist/components/Knob/Knob.d.ts.map +1 -1
- package/dist/components/Listbox/Listbox.d.ts +3 -1
- package/dist/components/Listbox/Listbox.d.ts.map +1 -1
- package/dist/components/MonthPicker/MonthPicker.d.ts +3 -1
- package/dist/components/MonthPicker/MonthPicker.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/components/PinInput/PinInput.d.ts +3 -1
- package/dist/components/PinInput/PinInput.d.ts.map +1 -1
- package/dist/components/QuarterPicker/QuarterPicker.d.ts +3 -1
- package/dist/components/QuarterPicker/QuarterPicker.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/Rating/Rating.d.ts +3 -1
- package/dist/components/Rating/Rating.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/list.d.ts +6 -1
- package/dist/components/Select/list.d.ts.map +1 -1
- package/dist/components/SelectionCard/SelectionCard.d.ts +1 -1
- package/dist/components/SelectionCard/SelectionCard.d.ts.map +1 -1
- package/dist/components/Slider/Slider.d.ts +3 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/TagsInput/TagsInput.d.ts +3 -1
- package/dist/components/TagsInput/TagsInput.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +3 -1
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/TimeRangePicker/TimeRangePicker.d.ts +3 -1
- package/dist/components/TimeRangePicker/TimeRangePicker.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +3 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/TreeSelect/TreeSelect.d.ts +3 -1
- package/dist/components/TreeSelect/TreeSelect.d.ts.map +1 -1
- package/dist/components/YearPicker/YearPicker.d.ts +3 -1
- package/dist/components/YearPicker/YearPicker.d.ts.map +1 -1
- package/dist/data-table/DataTable.d.ts +10 -2
- package/dist/data-table/DataTable.d.ts.map +1 -1
- package/dist/data-table.js +952 -949
- package/dist/editor.js +1 -1
- package/dist/form/FormField.d.ts +5 -1
- package/dist/form/FormField.d.ts.map +1 -1
- package/dist/form.js +7 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3231 -3150
- package/dist/label-for-DYgV5EwH.js +9 -0
- package/dist/pdf.js +3 -3
- package/dist/sources/ActionBar.css +1 -0
- package/dist/sources/AppShell.css +1 -0
- package/dist/sources/ChatPrompt.css +1 -0
- package/dist/sources/Gallery.css +1 -0
- package/dist/sources/IconButton.css +1 -0
- package/dist/sources/Image.css +1 -0
- package/dist/sources/ImageCropper.css +1 -0
- package/dist/sources/InlineEdit.css +1 -0
- package/dist/sources/Marquee.css +1 -0
- package/dist/sources/MegaMenu.css +1 -0
- package/dist/sources/Menubar.css +1 -0
- package/dist/sources/OrderList.css +1 -0
- package/dist/sources/PickList.css +1 -0
- package/dist/sources/ScrollTop.css +1 -0
- package/dist/utils/label-for.d.ts +3 -0
- package/dist/utils/label-for.d.ts.map +1 -0
- package/dist/virtual/VirtualSelect.d.ts +1 -1
- package/dist/virtual/VirtualSelect.d.ts.map +1 -1
- package/dist/virtual.js +245 -236
- package/fonts.css +2 -0
- package/llms-full.txt +180 -3
- package/llms.txt +4 -1
- package/package.json +7 -3
- package/theme.css +14 -0
- package/dist/Checkbox-CZTyKWId.js +0 -44
- package/dist/ContextMenu-CjDI7Jy5.js +0 -1434
- package/dist/Input-D8U-Auys.js +0 -109
- package/dist/PasswordInput-DivSjtN8.js +0 -420
- package/dist/Select-Cx3KwSzU.js +0 -234
- package/dist/Slider-x-SsBc1d.js +0 -74
package/dist/virtual.js
CHANGED
|
@@ -1,90 +1,95 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as e, n as t } from "./RecipesProvider-0idafuGm.js";
|
|
3
|
-
import { a as n, c as r, o as i, s as a } from "./Highlight-
|
|
4
|
-
import { i as o, n as ee, o as s, r as c } from "./Tree-
|
|
5
|
-
import {
|
|
6
|
-
import { Check as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { Portal as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
3
|
+
import { a as n, c as r, o as i, s as a } from "./Highlight-43-H9459.js";
|
|
4
|
+
import { i as o, n as ee, o as s, r as c } from "./Tree-DVjwp6FG.js";
|
|
5
|
+
import { controlIds as l, flattenTree as u, select as d, tree as f, virtualList as te, virtualListBox as p } from "@wirecore/wirelayer-recipes";
|
|
6
|
+
import { Check as m, ChevronDown as h, LoaderCircle as g, X as ne } from "lucide-react";
|
|
7
|
+
import { useEffect as _, useId as re, useImperativeHandle as v, useMemo as y, useRef as b, useState as ie } from "react";
|
|
8
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
9
|
+
import { Portal as w } from "@ark-ui/react/portal";
|
|
10
|
+
import { useFieldContext as ae } from "@ark-ui/react/field";
|
|
11
|
+
import { createListCollection as T } from "@ark-ui/react/collection";
|
|
12
|
+
import { Select as E } from "@ark-ui/react/select";
|
|
13
|
+
import { TreeView as D } from "@ark-ui/react/tree-view";
|
|
14
|
+
import { defaultRangeExtractor as O, useVirtualizer as k } from "@tanstack/react-virtual";
|
|
14
15
|
//#region src/virtual/VirtualSelect.tsx
|
|
15
|
-
function
|
|
16
|
-
let
|
|
17
|
-
size:
|
|
18
|
-
clearable:
|
|
19
|
-
}), q =
|
|
20
|
-
itemValue:
|
|
21
|
-
itemLabel:
|
|
22
|
-
itemDisabled:
|
|
23
|
-
itemGroup:
|
|
24
|
-
valueKey:
|
|
25
|
-
}, [Y,
|
|
16
|
+
function A({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder: c, disabled: u, invalid: f, required: p, name: v, itemValue: D, itemLabel: O, itemDisabled: A, valueKey: M, clearable: N, loading: P, loadingText: F, size: I, filter: L, manualFilter: R, onFilterChange: z, emptyText: B, hasMore: V, onLoadMore: H, dataSource: U, pageSize: oe, minSearchLength: W, id: G, className: se, style: ce, onKeyDown: le, ...ue }) {
|
|
17
|
+
let de = t("select", d), fe = t("virtualList", te), K = de({
|
|
18
|
+
size: I,
|
|
19
|
+
clearable: N
|
|
20
|
+
}), q = fe(), pe = ae(), J = e(), me = J.select, he = {
|
|
21
|
+
itemValue: D,
|
|
22
|
+
itemLabel: O,
|
|
23
|
+
itemDisabled: A,
|
|
24
|
+
itemGroup: j,
|
|
25
|
+
valueKey: M
|
|
26
|
+
}, [Y, ge] = ie(""), X = r({
|
|
26
27
|
items: a,
|
|
27
|
-
source:
|
|
28
|
-
accessors:
|
|
29
|
-
pageSize:
|
|
30
|
-
minSearchLength:
|
|
31
|
-
}), { options:
|
|
28
|
+
source: U,
|
|
29
|
+
accessors: he,
|
|
30
|
+
pageSize: oe,
|
|
31
|
+
minSearchLength: W
|
|
32
|
+
}), { options: _e, visible: Z, firstFor: ve } = n(X.items, he, L && !R && !U ? Y : ""), ye = y(() => [..._e, ...X.resolvedOptions], [_e, X.resolvedOptions]), { selected: be, keys: xe, commit: Se, commitKeys: Ce } = i({
|
|
32
33
|
multiple: !1,
|
|
33
34
|
value: o,
|
|
34
35
|
defaultValue: ee,
|
|
35
|
-
accessors:
|
|
36
|
-
items:
|
|
37
|
-
onChange: s
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
accessors: he,
|
|
37
|
+
items: ye,
|
|
38
|
+
onChange: s,
|
|
39
|
+
check: {
|
|
40
|
+
component: "VirtualSelect",
|
|
41
|
+
ready: !U && !P && a.length > 0
|
|
42
|
+
}
|
|
43
|
+
}), we = xe.join("\0");
|
|
44
|
+
_(() => {
|
|
45
|
+
X.resolve(xe, ye);
|
|
46
|
+
}, [we, U]);
|
|
47
|
+
let Q = !!P || X.loading, Te = !!V || X.hasMore, Ee = be[0], De = Ee?.icon, Oe = y(() => T({
|
|
43
48
|
items: Z,
|
|
44
49
|
itemToString: (e) => e.label,
|
|
45
50
|
itemToValue: (e) => e.key,
|
|
46
51
|
isItemDisabled: (e) => e.disabled
|
|
47
|
-
}), [Z]),
|
|
52
|
+
}), [Z]), ke = re(), Ae = b(null), je = b(null), $ = k({
|
|
48
53
|
count: Z.length,
|
|
49
|
-
getScrollElement: () =>
|
|
54
|
+
getScrollElement: () => L ? je.current : Ae.current,
|
|
50
55
|
estimateSize: () => 36,
|
|
51
56
|
overscan: 8
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
+
}), Me = $.getVirtualItems().at(-1)?.index ?? -1, Ne = b(H);
|
|
58
|
+
_(() => {
|
|
59
|
+
Ne.current = U ? X.loadMore : H;
|
|
60
|
+
}), _(() => {
|
|
61
|
+
Te && !Q && Z.length && Me >= Z.length - 1 && Ne.current?.();
|
|
57
62
|
}, [
|
|
58
|
-
|
|
63
|
+
Me,
|
|
59
64
|
Z.length,
|
|
60
65
|
Q,
|
|
61
|
-
|
|
66
|
+
Te
|
|
62
67
|
]);
|
|
63
|
-
function
|
|
64
|
-
|
|
68
|
+
function Pe(e) {
|
|
69
|
+
le?.(e), N && be.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), Se([]));
|
|
65
70
|
}
|
|
66
|
-
let
|
|
67
|
-
/* @__PURE__ */
|
|
71
|
+
let Fe = /* @__PURE__ */ C(x, { children: [
|
|
72
|
+
/* @__PURE__ */ S("div", {
|
|
68
73
|
className: q.spacer(),
|
|
69
74
|
style: { height: `${$.getTotalSize()}px` },
|
|
70
75
|
children: $.getVirtualItems().map((e) => {
|
|
71
76
|
let t = Z[e.index], n = t.icon;
|
|
72
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ C(E.Item, {
|
|
73
78
|
item: t,
|
|
74
79
|
className: K.item({ class: q.item() }),
|
|
75
80
|
style: { transform: `translateY(${e.start}px)` },
|
|
76
81
|
"aria-setsize": Z.length,
|
|
77
82
|
"aria-posinset": e.index + 1,
|
|
78
83
|
children: [
|
|
79
|
-
n && /* @__PURE__ */
|
|
84
|
+
n && /* @__PURE__ */ S(n, {
|
|
80
85
|
className: K.icon(),
|
|
81
86
|
"aria-hidden": "true"
|
|
82
87
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ S(E.ItemText, {
|
|
84
89
|
className: K.itemText(),
|
|
85
90
|
children: t.label
|
|
86
91
|
}),
|
|
87
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ S(E.ItemIndicator, { children: /* @__PURE__ */ S(m, {
|
|
88
93
|
className: K.itemIndicator(),
|
|
89
94
|
"aria-hidden": "true"
|
|
90
95
|
}) })
|
|
@@ -92,104 +97,108 @@ function k({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
92
97
|
}, e.key);
|
|
93
98
|
})
|
|
94
99
|
}),
|
|
95
|
-
Q && /* @__PURE__ */
|
|
100
|
+
Q && /* @__PURE__ */ C("div", {
|
|
96
101
|
className: K.loading(),
|
|
97
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ S(g, {
|
|
98
103
|
className: K.loadingIcon(),
|
|
99
104
|
"aria-hidden": "true"
|
|
100
|
-
}),
|
|
105
|
+
}), F ?? J.common.loading]
|
|
101
106
|
}),
|
|
102
|
-
!Z.length && !Q && /* @__PURE__ */
|
|
107
|
+
!Z.length && !Q && /* @__PURE__ */ S("div", {
|
|
103
108
|
role: "option",
|
|
104
109
|
"aria-disabled": "true",
|
|
105
110
|
className: K.empty(),
|
|
106
|
-
children:
|
|
111
|
+
children: B ?? X.emptyText ?? (Y ? J.common.noResults : J.common.empty)
|
|
107
112
|
})
|
|
108
113
|
] });
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
className: K.base({ class:
|
|
111
|
-
style:
|
|
112
|
-
collection:
|
|
113
|
-
value:
|
|
114
|
-
onValueChange: (e) =>
|
|
114
|
+
return /* @__PURE__ */ C(E.Root, {
|
|
115
|
+
className: K.base({ class: se }),
|
|
116
|
+
style: ce,
|
|
117
|
+
collection: Oe,
|
|
118
|
+
value: xe,
|
|
119
|
+
onValueChange: (e) => Ce(e.value, e.items),
|
|
115
120
|
onOpenChange: (e) => {
|
|
116
|
-
e.open && X.open(), !e.open && Y && (
|
|
121
|
+
e.open && X.open(), !e.open && Y && (ge(""), z?.(""), U && X.search(""));
|
|
117
122
|
},
|
|
118
|
-
disabled:
|
|
119
|
-
invalid:
|
|
120
|
-
required:
|
|
121
|
-
name:
|
|
123
|
+
disabled: u,
|
|
124
|
+
invalid: f,
|
|
125
|
+
required: p,
|
|
126
|
+
name: v,
|
|
122
127
|
positioning: {
|
|
123
128
|
sameWidth: !0,
|
|
124
129
|
gutter: 4
|
|
125
130
|
},
|
|
126
|
-
composite: !
|
|
131
|
+
composite: !L,
|
|
132
|
+
...l(G, "trigger", {
|
|
133
|
+
label: pe?.ids.label,
|
|
134
|
+
hiddenSelect: pe?.ids.control
|
|
135
|
+
}),
|
|
127
136
|
scrollToIndexFn: (e) => $.scrollToIndex(e.index, { align: "auto" }),
|
|
128
137
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
...
|
|
131
|
-
children: [/* @__PURE__ */
|
|
132
|
-
...
|
|
138
|
+
/* @__PURE__ */ C(E.Control, {
|
|
139
|
+
...N ? { className: K.control() } : {},
|
|
140
|
+
children: [/* @__PURE__ */ C(E.Trigger, {
|
|
141
|
+
...ue,
|
|
133
142
|
className: K.trigger(),
|
|
134
143
|
"aria-busy": Q || void 0,
|
|
135
|
-
onKeyDown:
|
|
136
|
-
children: [/* @__PURE__ */
|
|
144
|
+
onKeyDown: Pe,
|
|
145
|
+
children: [/* @__PURE__ */ C("span", {
|
|
137
146
|
className: K.value(),
|
|
138
|
-
children: [
|
|
147
|
+
children: [De && /* @__PURE__ */ S(De, {
|
|
139
148
|
className: K.icon(),
|
|
140
149
|
"aria-hidden": "true"
|
|
141
|
-
}), /* @__PURE__ */
|
|
150
|
+
}), /* @__PURE__ */ S(E.ValueText, {
|
|
142
151
|
placeholder: c ?? J.common.placeholder,
|
|
143
|
-
children:
|
|
152
|
+
children: Ee?.label || void 0
|
|
144
153
|
})]
|
|
145
|
-
}), /* @__PURE__ */
|
|
154
|
+
}), /* @__PURE__ */ S(E.Indicator, {
|
|
146
155
|
className: K.indicator(),
|
|
147
|
-
children: Q ? /* @__PURE__ */
|
|
156
|
+
children: Q ? /* @__PURE__ */ S(g, {
|
|
148
157
|
className: K.spinner(),
|
|
149
158
|
"aria-hidden": "true"
|
|
150
|
-
}) : /* @__PURE__ */
|
|
159
|
+
}) : /* @__PURE__ */ S(h, {
|
|
151
160
|
className: K.indicatorIcon(),
|
|
152
161
|
"aria-hidden": "true"
|
|
153
162
|
})
|
|
154
163
|
})]
|
|
155
|
-
}),
|
|
164
|
+
}), N && /* @__PURE__ */ S(E.Context, { children: (e) => Ee && !e.disabled && /* @__PURE__ */ S("button", {
|
|
156
165
|
type: "button",
|
|
157
166
|
tabIndex: -1,
|
|
158
167
|
className: K.clear(),
|
|
159
|
-
"aria-label":
|
|
168
|
+
"aria-label": me.clear,
|
|
160
169
|
onClick: () => {
|
|
161
|
-
|
|
170
|
+
Se([]), e.focus();
|
|
162
171
|
},
|
|
163
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ S(ne, {
|
|
164
173
|
className: K.clearIcon(),
|
|
165
174
|
"aria-hidden": "true"
|
|
166
175
|
})
|
|
167
176
|
}) })]
|
|
168
177
|
}),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
ref:
|
|
178
|
+
/* @__PURE__ */ S(w, { children: /* @__PURE__ */ S(E.Positioner, { children: /* @__PURE__ */ S(E.Content, {
|
|
179
|
+
ref: Ae,
|
|
171
180
|
className: K.content(),
|
|
172
181
|
"aria-busy": Q || void 0,
|
|
173
|
-
"aria-label":
|
|
174
|
-
children:
|
|
182
|
+
"aria-label": L ? ue["aria-label"] : void 0,
|
|
183
|
+
children: L ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("div", {
|
|
175
184
|
className: K.header(),
|
|
176
|
-
children: /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ S(E.Context, { children: (e) => /* @__PURE__ */ S("input", {
|
|
177
186
|
type: "text",
|
|
178
187
|
role: "combobox",
|
|
179
188
|
autoComplete: "off",
|
|
180
189
|
"aria-autocomplete": "list",
|
|
181
190
|
"aria-expanded": "true",
|
|
182
191
|
"data-autofocus": "",
|
|
183
|
-
"aria-controls":
|
|
192
|
+
"aria-controls": ke,
|
|
184
193
|
"aria-activedescendant": e.highlightedItem ? e.getItemProps({ item: e.highlightedItem }).id : void 0,
|
|
185
|
-
"aria-label":
|
|
194
|
+
"aria-label": me.filter,
|
|
186
195
|
placeholder: J.combobox.search,
|
|
187
196
|
value: Y,
|
|
188
197
|
className: K.search(),
|
|
189
198
|
onChange: (t) => {
|
|
190
199
|
let n = t.target.value;
|
|
191
|
-
|
|
192
|
-
let r =
|
|
200
|
+
ge(n), z?.(n), U && X.search(n);
|
|
201
|
+
let r = R || U ? void 0 : ve(n);
|
|
193
202
|
r && requestAnimationFrame(() => e.setHighlightValue(r.key));
|
|
194
203
|
},
|
|
195
204
|
onKeyDown: (e) => {
|
|
@@ -200,15 +209,15 @@ function k({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
200
209
|
].includes(e.key) && e.stopPropagation();
|
|
201
210
|
}
|
|
202
211
|
}) })
|
|
203
|
-
}), /* @__PURE__ */
|
|
204
|
-
ref:
|
|
205
|
-
id:
|
|
212
|
+
}), /* @__PURE__ */ S(E.List, {
|
|
213
|
+
ref: je,
|
|
214
|
+
id: ke,
|
|
206
215
|
className: K.list({ class: q.scroll() }),
|
|
207
|
-
children:
|
|
208
|
-
})] }) :
|
|
216
|
+
children: Fe
|
|
217
|
+
})] }) : Fe
|
|
209
218
|
}) }) }),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
|
|
219
|
+
/* @__PURE__ */ S(E.HiddenSelect, {}),
|
|
220
|
+
U && /* @__PURE__ */ S("span", {
|
|
212
221
|
role: "status",
|
|
213
222
|
className: K.status(),
|
|
214
223
|
children: X.announcement
|
|
@@ -216,22 +225,22 @@ function k({ items: a, value: o, defaultValue: ee, onValueChange: s, placeholder
|
|
|
216
225
|
]
|
|
217
226
|
});
|
|
218
227
|
}
|
|
219
|
-
var
|
|
228
|
+
var j = () => void 0;
|
|
220
229
|
//#endregion
|
|
221
230
|
//#region src/virtual/VirtualList.tsx
|
|
222
|
-
function
|
|
223
|
-
let
|
|
224
|
-
source:
|
|
225
|
-
pageSize:
|
|
226
|
-
query: h ?
|
|
227
|
-
}),
|
|
228
|
-
|
|
229
|
-
if (!
|
|
230
|
-
let e =
|
|
231
|
-
|
|
232
|
-
}, [
|
|
233
|
-
let
|
|
234
|
-
if (!s) return
|
|
231
|
+
function M({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, height: ee = "20rem", itemGroup: s, hasMore: c = !1, loading: l = !1, loadingMore: u = !1, endThreshold: d = 5, onLoadMore: f, onEndReached: te, dataSource: m, query: h, pageSize: ne, children: re, className: ie, style: w, ref: ae }) {
|
|
232
|
+
let T = t("virtualListBox", p)(), E = e(), D = b(null), { search: A, ...j } = h ?? {}, M = a({
|
|
233
|
+
source: m,
|
|
234
|
+
pageSize: ne,
|
|
235
|
+
query: h ? j : void 0
|
|
236
|
+
}), N = b(null);
|
|
237
|
+
_(() => {
|
|
238
|
+
if (!m) return;
|
|
239
|
+
let e = N.current === null;
|
|
240
|
+
N.current = A ?? "", M.search(A ?? "", !e);
|
|
241
|
+
}, [m, A]);
|
|
242
|
+
let P = m ? M.state.items : n, F = m ? M.state.hasMore : c, I = m ? M.state.status === "loading" : l || u, L = y(() => {
|
|
243
|
+
if (!s) return P.map((e, t) => ({
|
|
235
244
|
kind: "item",
|
|
236
245
|
item: e,
|
|
237
246
|
index: t
|
|
@@ -240,7 +249,7 @@ function j({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
|
|
|
240
249
|
let t = typeof s == "function" ? s(e) : e?.[s];
|
|
241
250
|
return t == null || t === "" ? void 0 : String(t);
|
|
242
251
|
}, t = [], n;
|
|
243
|
-
return
|
|
252
|
+
return P.forEach((r, i) => {
|
|
244
253
|
let a = e(r);
|
|
245
254
|
a !== void 0 && a !== n && t.push({
|
|
246
255
|
kind: "header",
|
|
@@ -251,127 +260,127 @@ function j({ items: n = [], label: r, itemHeight: i = 40, estimateSize: o, heigh
|
|
|
251
260
|
index: i
|
|
252
261
|
});
|
|
253
262
|
}), t;
|
|
254
|
-
}, [
|
|
255
|
-
count:
|
|
256
|
-
getScrollElement: () =>
|
|
263
|
+
}, [P, s]), R = y(() => L.flatMap((e, t) => e.kind === "header" ? [t] : []), [L]), z = (e) => [...R].reverse().find((t) => e >= t) ?? -1, B = k({
|
|
264
|
+
count: L.length,
|
|
265
|
+
getScrollElement: () => D.current,
|
|
257
266
|
estimateSize: (e) => {
|
|
258
|
-
let t =
|
|
267
|
+
let t = L[e];
|
|
259
268
|
return t?.kind === "item" && o ? o(t.item, t.index) : i;
|
|
260
269
|
},
|
|
261
270
|
measureElement: (e) => e.getBoundingClientRect().height || i,
|
|
262
271
|
overscan: 6,
|
|
263
|
-
rangeExtractor:
|
|
264
|
-
let t =
|
|
272
|
+
rangeExtractor: R.length ? (e) => {
|
|
273
|
+
let t = z(e.startIndex), n = new Set(O(e));
|
|
265
274
|
return t >= 0 && n.add(t), [...n].sort((e, t) => e - t);
|
|
266
|
-
} :
|
|
275
|
+
} : O,
|
|
267
276
|
initialRect: {
|
|
268
277
|
width: 0,
|
|
269
278
|
height: 320
|
|
270
279
|
}
|
|
271
|
-
}),
|
|
272
|
-
|
|
273
|
-
oe !== void 0 &&
|
|
280
|
+
}), V = B.getVirtualItems(), H = R.length ? z(B.range?.startIndex ?? 0) : -1, U = b(-1), oe = V.at(-1)?.index;
|
|
281
|
+
_(() => {
|
|
282
|
+
oe !== void 0 && F && !I && U.current !== L.length && (oe < L.length - 1 - d || (U.current = L.length, m ? M.loadMore() : (f?.(), te?.())));
|
|
274
283
|
});
|
|
275
|
-
let W = !!
|
|
276
|
-
|
|
284
|
+
let W = !!m || c || l || u;
|
|
285
|
+
v(ae, () => ({
|
|
277
286
|
scrollToIndex(e, t = {}) {
|
|
278
|
-
let n =
|
|
279
|
-
n >= 0 &&
|
|
287
|
+
let n = L.findIndex((t) => t.kind === "item" && t.index === e);
|
|
288
|
+
n >= 0 && B.scrollToIndex(n, { align: t.align ?? "auto" });
|
|
280
289
|
},
|
|
281
|
-
refresh: () =>
|
|
290
|
+
refresh: () => M.refresh()
|
|
282
291
|
}));
|
|
283
|
-
let G = /* @__PURE__ */
|
|
284
|
-
ref:
|
|
292
|
+
let G = /* @__PURE__ */ C("div", {
|
|
293
|
+
ref: D,
|
|
285
294
|
role: "list",
|
|
286
295
|
"aria-label": r,
|
|
287
|
-
"aria-busy": W &&
|
|
296
|
+
"aria-busy": W && I || void 0,
|
|
288
297
|
tabIndex: 0,
|
|
289
|
-
className:
|
|
298
|
+
className: T.base({ class: ie }),
|
|
290
299
|
style: {
|
|
291
300
|
height: ee,
|
|
292
301
|
...w
|
|
293
302
|
},
|
|
294
|
-
children: [/* @__PURE__ */
|
|
295
|
-
className:
|
|
296
|
-
style: { height:
|
|
297
|
-
children:
|
|
298
|
-
let t =
|
|
303
|
+
children: [/* @__PURE__ */ S("div", {
|
|
304
|
+
className: T.spacer(),
|
|
305
|
+
style: { height: B.getTotalSize() },
|
|
306
|
+
children: V.map((e) => {
|
|
307
|
+
let t = L[e.index];
|
|
299
308
|
if (!t) return null;
|
|
300
309
|
if (t.kind === "header") {
|
|
301
|
-
let n = e.index ===
|
|
302
|
-
return /* @__PURE__ */
|
|
303
|
-
ref:
|
|
310
|
+
let n = e.index === H;
|
|
311
|
+
return /* @__PURE__ */ S("div", {
|
|
312
|
+
ref: B.measureElement,
|
|
304
313
|
role: "presentation",
|
|
305
314
|
"data-index": e.index,
|
|
306
|
-
className: n ?
|
|
315
|
+
className: n ? T.groupHeader({ class: T.sticky() }) : T.item({ class: T.groupHeader() }),
|
|
307
316
|
style: n ? void 0 : { transform: `translateY(${e.start}px)` },
|
|
308
317
|
children: t.label
|
|
309
318
|
}, e.key);
|
|
310
319
|
}
|
|
311
|
-
return /* @__PURE__ */
|
|
312
|
-
ref:
|
|
320
|
+
return /* @__PURE__ */ S("div", {
|
|
321
|
+
ref: B.measureElement,
|
|
313
322
|
role: "listitem",
|
|
314
323
|
"aria-posinset": t.index + 1,
|
|
315
|
-
"aria-setsize":
|
|
324
|
+
"aria-setsize": P.length,
|
|
316
325
|
"data-index": e.index,
|
|
317
|
-
className:
|
|
326
|
+
className: T.item(),
|
|
318
327
|
style: { transform: `translateY(${e.start}px)` },
|
|
319
|
-
children:
|
|
328
|
+
children: re(t.item, t.index)
|
|
320
329
|
}, e.key);
|
|
321
330
|
})
|
|
322
|
-
}), W &&
|
|
323
|
-
className:
|
|
331
|
+
}), W && I && P.length > 0 && /* @__PURE__ */ C("div", {
|
|
332
|
+
className: T.loading(),
|
|
324
333
|
"aria-hidden": "true",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ S(g, { className: T.loadingIcon() }), E.dataSource.loadingMore]
|
|
326
335
|
})]
|
|
327
336
|
});
|
|
328
|
-
return
|
|
337
|
+
return m ? /* @__PURE__ */ C(x, { children: [G, /* @__PURE__ */ S("p", {
|
|
329
338
|
role: "status",
|
|
330
|
-
className:
|
|
331
|
-
children:
|
|
339
|
+
className: T.status(),
|
|
340
|
+
children: M.announcement
|
|
332
341
|
})] }) : G;
|
|
333
342
|
}
|
|
334
343
|
//#endregion
|
|
335
344
|
//#region src/virtual/VirtualTree.tsx
|
|
336
|
-
function
|
|
345
|
+
function N(e, t = 6) {
|
|
337
346
|
requestAnimationFrame(() => {
|
|
338
347
|
let n = e();
|
|
339
|
-
n ? n.ownerDocument.activeElement !== n && n.focus() : t > 0 &&
|
|
348
|
+
n ? n.ownerDocument.activeElement !== n && n.focus() : t > 0 && N(e, t - 1);
|
|
340
349
|
});
|
|
341
350
|
}
|
|
342
|
-
function
|
|
343
|
-
let
|
|
344
|
-
...
|
|
351
|
+
function P({ classes: n, items: r, label: i, "aria-label": a, selectionMode: l = "single", checkable: d = !1, checkStrictly: te = !1, checkedValue: p, defaultCheckedValue: m, reorderable: h = !1, filter: ne = !1, filterMode: _ = "filter", expandControls: re = !1, renderNode: ie, emptyText: x, empty: w, height: ae = "20rem", itemHeight: T = 32, className: E, style: O, ref: A, ...j }) {
|
|
352
|
+
let M = t("tree", f, n)(), P = e(), F = P.tree, I = b(null), L = b(null), R = s({
|
|
353
|
+
...j,
|
|
345
354
|
items: r,
|
|
346
355
|
checkable: d,
|
|
347
|
-
checkStrictly:
|
|
348
|
-
checkedValue:
|
|
349
|
-
defaultCheckedValue:
|
|
356
|
+
checkStrictly: te,
|
|
357
|
+
checkedValue: p,
|
|
358
|
+
defaultCheckedValue: m,
|
|
350
359
|
reorderable: h,
|
|
351
360
|
filterMode: _
|
|
352
|
-
},
|
|
361
|
+
}, I), z = y(() => {
|
|
353
362
|
let e = [];
|
|
354
|
-
for (let t of
|
|
363
|
+
for (let t of u(R.view, R.expanded)) e.push({
|
|
355
364
|
...t,
|
|
356
365
|
kind: "node"
|
|
357
|
-
}), t.expanded &&
|
|
366
|
+
}), t.expanded && R.loadingOf(t.node) && e.push({
|
|
358
367
|
kind: "loading",
|
|
359
368
|
parentId: t.node.id,
|
|
360
369
|
level: t.level
|
|
361
370
|
});
|
|
362
371
|
return e;
|
|
363
372
|
}, [
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
]),
|
|
368
|
-
count:
|
|
369
|
-
getScrollElement: () =>
|
|
370
|
-
estimateSize: () =>
|
|
371
|
-
measureElement: (e) => e.getBoundingClientRect().height ||
|
|
373
|
+
R.view,
|
|
374
|
+
R.expanded,
|
|
375
|
+
R.loadingOf
|
|
376
|
+
]), B = k({
|
|
377
|
+
count: z.length,
|
|
378
|
+
getScrollElement: () => L.current,
|
|
379
|
+
estimateSize: () => T,
|
|
380
|
+
measureElement: (e) => e.getBoundingClientRect().height || T,
|
|
372
381
|
overscan: 8,
|
|
373
382
|
getItemKey: (e) => {
|
|
374
|
-
let t =
|
|
383
|
+
let t = z[e];
|
|
375
384
|
return t.kind === "node" ? t.node.id : `${t.parentId}\u0000loading`;
|
|
376
385
|
},
|
|
377
386
|
initialRect: {
|
|
@@ -379,104 +388,104 @@ function N({ classes: n, items: r, label: i, "aria-label": a, selectionMode: u =
|
|
|
379
388
|
height: 320
|
|
380
389
|
}
|
|
381
390
|
});
|
|
382
|
-
|
|
383
|
-
expandAll:
|
|
384
|
-
collapseAll:
|
|
385
|
-
invalidate:
|
|
391
|
+
v(A, () => ({
|
|
392
|
+
expandAll: R.expandAll,
|
|
393
|
+
collapseAll: R.collapseAll,
|
|
394
|
+
invalidate: R.invalidate,
|
|
386
395
|
focusNode: (e) => {
|
|
387
|
-
let t =
|
|
388
|
-
t >= 0 &&
|
|
396
|
+
let t = z.findIndex((t) => t.kind === "node" && t.node.id === e);
|
|
397
|
+
t >= 0 && B.scrollToIndex(t, { align: "auto" }), requestAnimationFrame(() => R.focusNode(e));
|
|
389
398
|
}
|
|
390
399
|
}));
|
|
391
|
-
let
|
|
392
|
-
return /* @__PURE__ */
|
|
393
|
-
ref:
|
|
394
|
-
className:
|
|
395
|
-
style:
|
|
396
|
-
collection:
|
|
397
|
-
selectionMode:
|
|
398
|
-
selectedValue:
|
|
399
|
-
onSelectionChange: (e) =>
|
|
400
|
-
expandedValue:
|
|
401
|
-
onExpandedChange: (e) =>
|
|
402
|
-
...
|
|
403
|
-
checkedValue:
|
|
404
|
-
defaultCheckedValue:
|
|
400
|
+
let V = x ?? (R.query.trim() ? F.noMatches : j.group === void 0 ? void 0 : P.common.empty), H = !R.view.length && (V !== void 0 || !!w || j.group !== void 0);
|
|
401
|
+
return /* @__PURE__ */ C(D.Root, {
|
|
402
|
+
ref: I,
|
|
403
|
+
className: M.base({ class: E }),
|
|
404
|
+
style: O,
|
|
405
|
+
collection: R.collection,
|
|
406
|
+
selectionMode: l,
|
|
407
|
+
selectedValue: R.selected,
|
|
408
|
+
onSelectionChange: (e) => R.onSelectionChange(e.selectedValue),
|
|
409
|
+
expandedValue: R.expanded,
|
|
410
|
+
onExpandedChange: (e) => R.setExpanded(e.expandedValue),
|
|
411
|
+
...R.ownChecks ? {} : {
|
|
412
|
+
checkedValue: p,
|
|
413
|
+
defaultCheckedValue: m
|
|
405
414
|
},
|
|
406
|
-
onCheckedChange: (e) =>
|
|
407
|
-
translations: { treeLabel: i ?? a ??
|
|
415
|
+
onCheckedChange: (e) => R.ownChecks || R.onArkCheckedChange(e.checkedValue),
|
|
416
|
+
translations: { treeLabel: i ?? a ?? P.tree.treeLabel },
|
|
408
417
|
scrollToIndexFn: ({ node: e, getElement: t }) => {
|
|
409
|
-
let n =
|
|
410
|
-
n < 0 || (
|
|
418
|
+
let n = z.findIndex((t) => t.kind === "node" && t.node.id === e.id);
|
|
419
|
+
n < 0 || (B.scrollToIndex(n, { align: "auto" }), N(t));
|
|
411
420
|
},
|
|
412
|
-
onKeyDownCapture:
|
|
421
|
+
onKeyDownCapture: R.onKeyDown,
|
|
413
422
|
children: [
|
|
414
|
-
i && /* @__PURE__ */
|
|
415
|
-
className:
|
|
423
|
+
i && /* @__PURE__ */ S(D.Label, {
|
|
424
|
+
className: M.label(),
|
|
416
425
|
children: i
|
|
417
426
|
}),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
model:
|
|
420
|
-
filter:
|
|
427
|
+
/* @__PURE__ */ S(o, {
|
|
428
|
+
model: R,
|
|
429
|
+
filter: ne,
|
|
421
430
|
filterMode: _,
|
|
422
|
-
expandControls:
|
|
431
|
+
expandControls: re,
|
|
423
432
|
classes: n
|
|
424
433
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ S(c, {
|
|
426
435
|
value: {
|
|
427
|
-
model:
|
|
436
|
+
model: R,
|
|
428
437
|
checkable: d,
|
|
429
438
|
showLines: !1,
|
|
430
|
-
renderNode:
|
|
439
|
+
renderNode: ie
|
|
431
440
|
},
|
|
432
|
-
children: /* @__PURE__ */
|
|
433
|
-
ref:
|
|
434
|
-
className:
|
|
435
|
-
style: { height:
|
|
436
|
-
hidden:
|
|
437
|
-
children: /* @__PURE__ */
|
|
438
|
-
className:
|
|
439
|
-
style: { height:
|
|
440
|
-
children:
|
|
441
|
-
let t =
|
|
442
|
-
return /* @__PURE__ */
|
|
443
|
-
ref:
|
|
441
|
+
children: /* @__PURE__ */ S(D.Tree, {
|
|
442
|
+
ref: L,
|
|
443
|
+
className: M.tree({ class: M.viewport() }),
|
|
444
|
+
style: { height: ae },
|
|
445
|
+
hidden: H || void 0,
|
|
446
|
+
children: /* @__PURE__ */ S("div", {
|
|
447
|
+
className: M.spacer(),
|
|
448
|
+
style: { height: B.getTotalSize() },
|
|
449
|
+
children: B.getVirtualItems().map((e) => {
|
|
450
|
+
let t = z[e.index];
|
|
451
|
+
return /* @__PURE__ */ S("div", {
|
|
452
|
+
ref: B.measureElement,
|
|
444
453
|
"data-index": e.index,
|
|
445
|
-
className:
|
|
454
|
+
className: M.row(),
|
|
446
455
|
style: { transform: `translateY(${e.start}px)` },
|
|
447
|
-
children: t.kind === "node" ? /* @__PURE__ */
|
|
456
|
+
children: t.kind === "node" ? /* @__PURE__ */ S(ee, {
|
|
448
457
|
node: t.node,
|
|
449
458
|
indexPath: t.indexPath,
|
|
450
459
|
flat: !0,
|
|
451
460
|
posinset: t.posinset,
|
|
452
461
|
setsize: t.setsize
|
|
453
|
-
}) : /* @__PURE__ */
|
|
454
|
-
className:
|
|
462
|
+
}) : /* @__PURE__ */ C("div", {
|
|
463
|
+
className: M.loadingRow(),
|
|
455
464
|
style: { "--depth": t.level },
|
|
456
465
|
"aria-hidden": "true",
|
|
457
|
-
children: [/* @__PURE__ */
|
|
466
|
+
children: [/* @__PURE__ */ S(g, { className: M.loadingIcon() }), F.loadingRow]
|
|
458
467
|
})
|
|
459
468
|
}, e.key);
|
|
460
469
|
})
|
|
461
470
|
})
|
|
462
471
|
})
|
|
463
472
|
}),
|
|
464
|
-
|
|
465
|
-
className:
|
|
466
|
-
onDragOver:
|
|
467
|
-
onDrop:
|
|
468
|
-
children: w ??
|
|
473
|
+
H && /* @__PURE__ */ S("div", {
|
|
474
|
+
className: M.empty(),
|
|
475
|
+
onDragOver: R.onEmptyDragOver,
|
|
476
|
+
onDrop: R.onEmptyDrop,
|
|
477
|
+
children: w ?? V
|
|
469
478
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ S("p", {
|
|
471
480
|
role: "status",
|
|
472
|
-
className:
|
|
473
|
-
children:
|
|
481
|
+
className: M.status(),
|
|
482
|
+
children: R.status
|
|
474
483
|
})
|
|
475
484
|
]
|
|
476
485
|
});
|
|
477
486
|
}
|
|
478
487
|
//#endregion
|
|
479
488
|
//#region src/virtual/virtual-rows.ts
|
|
480
|
-
var
|
|
489
|
+
var F = { useVirtualizer: k };
|
|
481
490
|
//#endregion
|
|
482
|
-
export {
|
|
491
|
+
export { M as VirtualList, A as VirtualSelect, P as VirtualTree, F as virtualRows };
|