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