@wirecore/wirelayer-react 0.11.0 → 0.12.1

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.
Files changed (110) hide show
  1. package/dist/CopyButton-C_LAuCkR.js +47 -0
  2. package/dist/Tree-DLHbcH3-.js +602 -0
  3. package/dist/chart/Chart.d.ts +3 -3
  4. package/dist/chart/Chart.d.ts.map +1 -1
  5. package/dist/chart/PieChart.d.ts +3 -3
  6. package/dist/chart/PieChart.d.ts.map +1 -1
  7. package/dist/chart/SeriesChartView.d.ts +1 -1
  8. package/dist/chart/SeriesChartView.d.ts.map +1 -1
  9. package/dist/chart/Sparkline.d.ts +3 -3
  10. package/dist/chart/Sparkline.d.ts.map +1 -1
  11. package/dist/chart/WaterfallChart.d.ts +3 -3
  12. package/dist/chart/WaterfallChart.d.ts.map +1 -1
  13. package/dist/chart/types.d.ts +2 -2
  14. package/dist/chart/types.d.ts.map +1 -1
  15. package/dist/chart.js +148 -143
  16. package/dist/code.js +1 -1
  17. package/dist/components/AngleSlider/AngleSlider.d.ts +3 -3
  18. package/dist/components/AngleSlider/AngleSlider.d.ts.map +1 -1
  19. package/dist/components/BlockUi/BlockUi.d.ts +3 -3
  20. package/dist/components/BlockUi/BlockUi.d.ts.map +1 -1
  21. package/dist/components/Calendar/Calendar.d.ts +3 -3
  22. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  23. package/dist/components/Carousel/Carousel.d.ts +3 -3
  24. package/dist/components/Carousel/Carousel.d.ts.map +1 -1
  25. package/dist/components/CascadeSelect/CascadeSelect.d.ts +4 -3
  26. package/dist/components/CascadeSelect/CascadeSelect.d.ts.map +1 -1
  27. package/dist/components/ColorPicker/ColorPicker.d.ts +4 -4
  28. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  29. package/dist/components/CopyButton/CopyButton.d.ts +3 -3
  30. package/dist/components/CopyButton/CopyButton.d.ts.map +1 -1
  31. package/dist/components/DataView/DataView.d.ts +3 -3
  32. package/dist/components/DataView/DataView.d.ts.map +1 -1
  33. package/dist/components/Fieldset/Fieldset.d.ts +5 -3
  34. package/dist/components/Fieldset/Fieldset.d.ts.map +1 -1
  35. package/dist/components/Gallery/Gallery.d.ts +3 -3
  36. package/dist/components/Gallery/Gallery.d.ts.map +1 -1
  37. package/dist/components/JsonViewer/JsonViewer.d.ts +4 -3
  38. package/dist/components/JsonViewer/JsonViewer.d.ts.map +1 -1
  39. package/dist/components/Knob/Knob.d.ts +4 -3
  40. package/dist/components/Knob/Knob.d.ts.map +1 -1
  41. package/dist/components/Listbox/Listbox.d.ts +4 -4
  42. package/dist/components/Listbox/Listbox.d.ts.map +1 -1
  43. package/dist/components/LogViewer/LogViewer.d.ts +3 -3
  44. package/dist/components/LogViewer/LogViewer.d.ts.map +1 -1
  45. package/dist/components/MeterGroup/MeterGroup.d.ts +3 -3
  46. package/dist/components/MeterGroup/MeterGroup.d.ts.map +1 -1
  47. package/dist/components/NavigationMenu/NavigationMenu.d.ts +3 -3
  48. package/dist/components/NavigationMenu/NavigationMenu.d.ts.map +1 -1
  49. package/dist/components/OrderList/OrderList.d.ts +3 -3
  50. package/dist/components/OrderList/OrderList.d.ts.map +1 -1
  51. package/dist/components/OrgChart/OrgChart.d.ts +3 -3
  52. package/dist/components/OrgChart/OrgChart.d.ts.map +1 -1
  53. package/dist/components/Panel/Panel.d.ts +3 -3
  54. package/dist/components/Panel/Panel.d.ts.map +1 -1
  55. package/dist/components/PickList/PickList.d.ts +3 -3
  56. package/dist/components/PickList/PickList.d.ts.map +1 -1
  57. package/dist/components/PinInput/PinInput.d.ts +4 -4
  58. package/dist/components/PinInput/PinInput.d.ts.map +1 -1
  59. package/dist/components/ProgressCircle/ProgressCircle.d.ts +3 -3
  60. package/dist/components/ProgressCircle/ProgressCircle.d.ts.map +1 -1
  61. package/dist/components/Rating/Rating.d.ts +3 -3
  62. package/dist/components/Rating/Rating.d.ts.map +1 -1
  63. package/dist/components/ScrollPanel/ScrollPanel.d.ts +3 -3
  64. package/dist/components/ScrollPanel/ScrollPanel.d.ts.map +1 -1
  65. package/dist/components/ScrollTop/ScrollTop.d.ts +3 -2
  66. package/dist/components/ScrollTop/ScrollTop.d.ts.map +1 -1
  67. package/dist/components/SidebarNav/SidebarNav.d.ts +3 -3
  68. package/dist/components/SidebarNav/SidebarNav.d.ts.map +1 -1
  69. package/dist/components/SignaturePad/SignaturePad.d.ts +3 -3
  70. package/dist/components/SignaturePad/SignaturePad.d.ts.map +1 -1
  71. package/dist/components/Sortable/Sortable.d.ts +9 -3
  72. package/dist/components/Sortable/Sortable.d.ts.map +1 -1
  73. package/dist/components/SpeedDial/SpeedDial.d.ts +3 -3
  74. package/dist/components/SpeedDial/SpeedDial.d.ts.map +1 -1
  75. package/dist/components/SplitButton/SplitButton.d.ts +3 -3
  76. package/dist/components/SplitButton/SplitButton.d.ts.map +1 -1
  77. package/dist/components/Splitter/Splitter.d.ts +3 -3
  78. package/dist/components/Splitter/Splitter.d.ts.map +1 -1
  79. package/dist/components/Spoiler/Spoiler.d.ts +3 -3
  80. package/dist/components/Spoiler/Spoiler.d.ts.map +1 -1
  81. package/dist/components/Stepper/Stepper.d.ts +3 -3
  82. package/dist/components/Stepper/Stepper.d.ts.map +1 -1
  83. package/dist/components/TableOfContents/TableOfContents.d.ts +3 -3
  84. package/dist/components/TableOfContents/TableOfContents.d.ts.map +1 -1
  85. package/dist/components/Timeline/Timeline.d.ts +3 -3
  86. package/dist/components/Timeline/Timeline.d.ts.map +1 -1
  87. package/dist/components/Toolbar/Toolbar.d.ts +3 -3
  88. package/dist/components/Toolbar/Toolbar.d.ts.map +1 -1
  89. package/dist/components/Tour/Tour.d.ts +10 -1
  90. package/dist/components/Tour/Tour.d.ts.map +1 -1
  91. package/dist/components/Tree/Tree.d.ts +3 -3
  92. package/dist/components/Tree/Tree.d.ts.map +1 -1
  93. package/dist/components/Tree/useTree.d.ts +2 -0
  94. package/dist/components/Tree/useTree.d.ts.map +1 -1
  95. package/dist/components/TreeSelect/TreeSelect.d.ts +4 -4
  96. package/dist/components/TreeSelect/TreeSelect.d.ts.map +1 -1
  97. package/dist/data-table.js +1 -1
  98. package/dist/editor/Editor.d.ts +4 -4
  99. package/dist/editor/Editor.d.ts.map +1 -1
  100. package/dist/editor.js +184 -183
  101. package/dist/index.js +2903 -2779
  102. package/dist/pdf.js +1 -1
  103. package/dist/virtual/VirtualList.d.ts +3 -3
  104. package/dist/virtual/VirtualList.d.ts.map +1 -1
  105. package/dist/virtual/VirtualTree.d.ts.map +1 -1
  106. package/dist/virtual.js +224 -219
  107. package/llms-full.txt +70 -10
  108. package/package.json +2 -2
  109. package/dist/CopyButton-0e1pHR3f.js +0 -45
  110. 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 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";
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 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,
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: A,
24
- itemGroup: j,
25
- valueKey: M
23
+ itemDisabled: k,
24
+ itemGroup: oe,
25
+ valueKey: j
26
26
  }, [Y, ge] = ie(""), X = r({
27
27
  items: a,
28
- source: U,
28
+ source: H,
29
29
  accessors: he,
30
- pageSize: oe,
30
+ pageSize: U,
31
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
+ }), { 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: ee,
35
+ defaultValue: s,
36
36
  accessors: he,
37
37
  items: ye,
38
- onChange: s,
38
+ onChange: c,
39
39
  check: {
40
40
  component: "VirtualSelect",
41
- ready: !U && !P && a.length > 0
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, U]);
47
- let Q = !!P || X.loading, Te = !!V || X.hasMore, Ee = be[0], De = Ee?.icon, Oe = y(() => T({
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 = re(), Ae = b(null), je = b(null), $ = k({
52
+ }), [Z]), ke = v(), Ae = x(null), je = x(null), $ = A({
53
53
  count: Z.length,
54
- getScrollElement: () => L ? je.current : Ae.current,
54
+ getScrollElement: () => I ? je.current : Ae.current,
55
55
  estimateSize: () => 36,
56
56
  overscan: 8
57
- }), Me = $.getVirtualItems().at(-1)?.index ?? -1, Ne = b(H);
57
+ }), Me = $.getVirtualItems().at(-1)?.index ?? -1, Ne = x(V);
58
58
  _(() => {
59
- Ne.current = U ? X.loadMore : H;
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
- le?.(e), N && be.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), Se([]));
69
+ ce?.(e), M && be.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), Se([]));
70
70
  }
71
- let Fe = /* @__PURE__ */ C(x, { children: [
72
- /* @__PURE__ */ S("div", {
73
- className: q.spacer(),
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__ */ C(E.Item, {
77
+ return /* @__PURE__ */ w(D.Item, {
78
78
  item: t,
79
- className: K.item({ class: q.item() }),
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__ */ S(n, {
85
- className: K.icon(),
84
+ n && /* @__PURE__ */ C(n, {
85
+ className: q.icon(),
86
86
  "aria-hidden": "true"
87
87
  }),
88
- /* @__PURE__ */ S(E.ItemText, {
89
- className: K.itemText(),
88
+ /* @__PURE__ */ C(D.ItemText, {
89
+ className: q.itemText(),
90
90
  children: t.label
91
91
  }),
92
- /* @__PURE__ */ S(E.ItemIndicator, { children: /* @__PURE__ */ S(m, {
93
- className: K.itemIndicator(),
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__ */ C("div", {
101
- className: K.loading(),
102
- children: [/* @__PURE__ */ S(g, {
103
- className: K.loadingIcon(),
100
+ Q && /* @__PURE__ */ w("div", {
101
+ className: q.loading(),
102
+ children: [/* @__PURE__ */ C(g, {
103
+ className: q.loadingIcon(),
104
104
  "aria-hidden": "true"
105
- }), F ?? J.common.loading]
105
+ }), P ?? J.common.loading]
106
106
  }),
107
- !Z.length && !Q && /* @__PURE__ */ S("div", {
107
+ !Z.length && !Q && /* @__PURE__ */ C("div", {
108
108
  role: "option",
109
109
  "aria-disabled": "true",
110
- className: K.empty(),
111
- children: B ?? X.emptyText ?? (Y ? J.common.noResults : J.common.empty)
110
+ className: q.empty(),
111
+ children: z ?? X.emptyText ?? (Y ? J.common.noResults : J.common.empty)
112
112
  })
113
113
  ] });
114
- return /* @__PURE__ */ C(E.Root, {
115
- className: K.base({ class: se }),
116
- style: ce,
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(""), z?.(""), U && X.search(""));
121
+ e.open && X.open(), !e.open && Y && (ge(""), R?.(""), H && X.search(""));
122
122
  },
123
123
  disabled: u,
124
- invalid: f,
125
- required: p,
126
- name: v,
124
+ invalid: ee,
125
+ required: te,
126
+ name: ne,
127
127
  positioning: {
128
128
  sameWidth: !0,
129
129
  gutter: 4
130
130
  },
131
- composite: !L,
132
- ...l(G, "trigger", {
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__ */ C(E.Control, {
139
- ...N ? { className: K.control() } : {},
140
- children: [/* @__PURE__ */ C(E.Trigger, {
141
- ...ue,
142
- className: K.trigger(),
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__ */ C("span", {
146
- className: K.value(),
147
- children: [De && /* @__PURE__ */ S(De, {
148
- className: K.icon(),
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__ */ S(E.ValueText, {
151
- placeholder: c ?? J.common.placeholder,
150
+ }), /* @__PURE__ */ C(D.ValueText, {
151
+ placeholder: l ?? J.common.placeholder,
152
152
  children: Ee?.label || void 0
153
153
  })]
154
- }), /* @__PURE__ */ S(E.Indicator, {
155
- className: K.indicator(),
156
- children: Q ? /* @__PURE__ */ S(g, {
157
- className: K.spinner(),
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__ */ S(h, {
160
- className: K.indicatorIcon(),
159
+ }) : /* @__PURE__ */ C(h, {
160
+ className: q.indicatorIcon(),
161
161
  "aria-hidden": "true"
162
162
  })
163
163
  })]
164
- }), N && /* @__PURE__ */ S(E.Context, { children: (e) => Ee && !e.disabled && /* @__PURE__ */ S("button", {
164
+ }), M && /* @__PURE__ */ C(D.Context, { children: (e) => Ee && !e.disabled && /* @__PURE__ */ C("button", {
165
165
  type: "button",
166
166
  tabIndex: -1,
167
- className: K.clear(),
167
+ className: q.clear(),
168
168
  "aria-label": me.clear,
169
169
  onClick: () => {
170
170
  Se([]), e.focus();
171
171
  },
172
- children: /* @__PURE__ */ S(ne, {
173
- className: K.clearIcon(),
172
+ children: /* @__PURE__ */ C(re, {
173
+ className: q.clearIcon(),
174
174
  "aria-hidden": "true"
175
175
  })
176
176
  }) })]
177
177
  }),
178
- /* @__PURE__ */ S(w, { children: /* @__PURE__ */ S(E.Positioner, { children: /* @__PURE__ */ S(E.Content, {
178
+ /* @__PURE__ */ C(ae, { children: /* @__PURE__ */ C(D.Positioner, { children: /* @__PURE__ */ C(D.Content, {
179
179
  ref: Ae,
180
- className: K.content(),
180
+ className: q.content(),
181
181
  "aria-busy": Q || void 0,
182
- "aria-label": L ? ue["aria-label"] : void 0,
183
- children: L ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("div", {
184
- className: K.header(),
185
- children: /* @__PURE__ */ S(E.Context, { children: (e) => /* @__PURE__ */ S("input", {
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: K.search(),
197
+ className: q.search(),
198
198
  onChange: (t) => {
199
199
  let n = t.target.value;
200
- ge(n), z?.(n), U && X.search(n);
201
- let r = R || U ? void 0 : ve(n);
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__ */ S(E.List, {
212
+ }), /* @__PURE__ */ C(D.List, {
213
213
  ref: je,
214
214
  id: ke,
215
- className: K.list({ class: q.scroll() }),
215
+ className: q.list({ class: fe.scroll() }),
216
216
  children: Fe
217
217
  })] }) : Fe
218
218
  }) }) }),
219
- /* @__PURE__ */ S(E.HiddenSelect, {}),
220
- U && /* @__PURE__ */ S("span", {
219
+ /* @__PURE__ */ C(D.HiddenSelect, {}),
220
+ H && /* @__PURE__ */ C("span", {
221
221
  role: "status",
222
- className: K.status(),
222
+ className: q.status(),
223
223
  children: X.announcement
224
224
  })
225
225
  ]
226
226
  });
227
227
  }
228
- var j = () => void 0;
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: 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);
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 (!m) return;
238
+ if (!p) return;
239
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) => ({
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 s == "function" ? s(e) : e?.[s];
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, s]), R = y(() => L.flatMap((e, t) => e.kind === "header" ? [t] : []), [L]), z = (e) => [...R].reverse().find((t) => e >= t) ?? -1, B = k({
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: () => D.current,
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(O(e));
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
- } : O,
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 = b(-1), oe = V.at(-1)?.index;
280
+ }), V = B.getVirtualItems(), H = R.length ? z(B.range?.startIndex ?? 0) : -1, U = x(-1), W = V.at(-1)?.index;
281
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?.())));
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 W = !!m || c || l || u;
285
- v(ae, () => ({
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 G = /* @__PURE__ */ C("div", {
293
- ref: D,
292
+ let K = /* @__PURE__ */ w("div", {
293
+ ...T,
294
+ ref: O,
294
295
  role: "list",
295
296
  "aria-label": r,
296
- "aria-busy": W && I || void 0,
297
+ "aria-busy": G && I || void 0,
297
298
  tabIndex: 0,
298
- className: T.base({ class: ie }),
299
+ className: E.base({ class: v }),
299
300
  style: {
300
- height: ee,
301
- ...w
301
+ height: s,
302
+ ...ie
302
303
  },
303
- children: [/* @__PURE__ */ S("div", {
304
- className: T.spacer(),
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__ */ S("div", {
312
+ return /* @__PURE__ */ C("div", {
312
313
  ref: B.measureElement,
313
314
  role: "presentation",
314
315
  "data-index": e.index,
315
- className: n ? T.groupHeader({ class: T.sticky() }) : T.item({ class: T.groupHeader() }),
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__ */ S("div", {
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: T.item(),
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
- }), W && I && P.length > 0 && /* @__PURE__ */ C("div", {
332
- className: T.loading(),
332
+ }), G && I && P.length > 0 && /* @__PURE__ */ w("div", {
333
+ className: E.loading(),
333
334
  "aria-hidden": "true",
334
- children: [/* @__PURE__ */ S(g, { className: T.loadingIcon() }), E.dataSource.loadingMore]
335
+ children: [/* @__PURE__ */ C(g, { className: E.loadingIcon() }), D.dataSource.loadingMore]
335
336
  })]
336
337
  });
337
- return m ? /* @__PURE__ */ C(x, { children: [G, /* @__PURE__ */ S("p", {
338
+ return p ? /* @__PURE__ */ w(S, { children: [K, /* @__PURE__ */ C("p", {
338
339
  role: "status",
339
- className: T.status(),
340
+ className: E.status(),
340
341
  children: M.announcement
341
- })] }) : G;
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: 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,
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: d,
356
- checkStrictly: te,
357
- checkedValue: p,
358
- defaultCheckedValue: m,
359
- reorderable: h,
360
- filterMode: _
361
- }, I), z = y(() => {
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 u(R.view, R.expanded)) e.push({
364
+ for (let t of ee(z.view, z.expanded)) e.push({
364
365
  ...t,
365
366
  kind: "node"
366
- }), t.expanded && R.loadingOf(t.node) && e.push({
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
- 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,
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 = z[e];
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
- v(A, () => ({
392
- expandAll: R.expandAll,
393
- collapseAll: R.collapseAll,
394
- invalidate: R.invalidate,
392
+ y(oe, () => ({
393
+ expandAll: z.expandAll,
394
+ collapseAll: z.collapseAll,
395
+ invalidate: z.invalidate,
395
396
  focusNode: (e) => {
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));
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 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
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) => R.ownChecks || R.onArkCheckedChange(e.checkedValue),
416
- translations: { treeLabel: i ?? a ?? P.tree.treeLabel },
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 = z.findIndex((t) => t.kind === "node" && t.node.id === e.id);
419
- n < 0 || (B.scrollToIndex(n, { align: "auto" }), N(t));
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__ */ S(D.Label, {
424
- className: M.label(),
428
+ i && /* @__PURE__ */ C(O.Label, {
429
+ className: P.label(),
425
430
  children: i
426
431
  }),
427
- /* @__PURE__ */ S(o, {
428
- model: R,
429
- filter: ne,
430
- filterMode: _,
431
- expandControls: re,
432
+ /* @__PURE__ */ C(o, {
433
+ model: z,
434
+ filter: _,
435
+ filterMode: v,
436
+ expandControls: ie,
432
437
  classes: n
433
438
  }),
434
- /* @__PURE__ */ S(c, {
439
+ /* @__PURE__ */ C(l, {
435
440
  value: {
436
- model: R,
437
- checkable: d,
441
+ model: z,
442
+ checkable: p,
438
443
  showLines: !1,
439
- renderNode: ie
444
+ renderNode: S
440
445
  },
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,
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: M.row(),
459
+ className: P.row(),
455
460
  style: { transform: `translateY(${e.start}px)` },
456
- children: t.kind === "node" ? /* @__PURE__ */ S(ee, {
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__ */ C("div", {
463
- className: M.loadingRow(),
467
+ }) : /* @__PURE__ */ w("div", {
468
+ className: P.loadingRow(),
464
469
  style: { "--depth": t.level },
465
470
  "aria-hidden": "true",
466
- children: [/* @__PURE__ */ S(g, { className: M.loadingIcon() }), F.loadingRow]
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
- H && /* @__PURE__ */ S("div", {
474
- className: M.empty(),
475
- onDragOver: R.onEmptyDragOver,
476
- onDrop: R.onEmptyDrop,
477
- children: w ?? V
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__ */ S("p", {
484
+ /* @__PURE__ */ C("p", {
480
485
  role: "status",
481
- className: M.status(),
482
- children: R.status
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: k };
494
+ var F = { useVirtualizer: A };
490
495
  //#endregion
491
- export { M as VirtualList, A as VirtualSelect, P as VirtualTree, F as virtualRows };
496
+ export { M as VirtualList, j as VirtualSelect, P as VirtualTree, F as virtualRows };