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