asterui 0.12.26 → 0.12.27

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 (163) hide show
  1. package/dist/components/Descriptions.d.ts +35 -3
  2. package/dist/components/Empty.d.ts +10 -1
  3. package/dist/components/Image.d.ts +13 -1
  4. package/dist/components/List.d.ts +74 -8
  5. package/dist/components/Table.d.ts +64 -10
  6. package/dist/components/Timeline.d.ts +62 -7
  7. package/dist/index.d.ts +4 -6
  8. package/dist/index.js +148 -150
  9. package/dist/index.js.map +1 -1
  10. package/dist/index10.js +1 -1
  11. package/dist/index100.js +5 -32
  12. package/dist/index100.js.map +1 -1
  13. package/dist/index101.js +13 -5
  14. package/dist/index101.js.map +1 -1
  15. package/dist/index102.js +43 -11
  16. package/dist/index102.js.map +1 -1
  17. package/dist/index103.js +11 -44
  18. package/dist/index103.js.map +1 -1
  19. package/dist/index104.js +12 -10
  20. package/dist/index104.js.map +1 -1
  21. package/dist/index105.js +7 -14
  22. package/dist/index105.js.map +1 -1
  23. package/dist/index106.js +12 -7
  24. package/dist/index106.js.map +1 -1
  25. package/dist/index107.js +29 -11
  26. package/dist/index107.js.map +1 -1
  27. package/dist/index108.js +16 -29
  28. package/dist/index108.js.map +1 -1
  29. package/dist/index109.js +31 -16
  30. package/dist/index109.js.map +1 -1
  31. package/dist/index110.js +517 -30
  32. package/dist/index110.js.map +1 -1
  33. package/dist/index111.js +45 -515
  34. package/dist/index111.js.map +1 -1
  35. package/dist/index22.js +1 -1
  36. package/dist/index23.js +127 -93
  37. package/dist/index23.js.map +1 -1
  38. package/dist/index39.js +162 -115
  39. package/dist/index39.js.map +1 -1
  40. package/dist/index40.js +398 -40
  41. package/dist/index40.js.map +1 -1
  42. package/dist/index41.js +132 -389
  43. package/dist/index41.js.map +1 -1
  44. package/dist/index42.js +252 -91
  45. package/dist/index42.js.map +1 -1
  46. package/dist/index43.js +143 -247
  47. package/dist/index43.js.map +1 -1
  48. package/dist/index44.js +15 -154
  49. package/dist/index44.js.map +1 -1
  50. package/dist/index45.js +17 -15
  51. package/dist/index45.js.map +1 -1
  52. package/dist/index46.js +136 -16
  53. package/dist/index46.js.map +1 -1
  54. package/dist/index47.js +118 -133
  55. package/dist/index47.js.map +1 -1
  56. package/dist/index48.js +35 -13
  57. package/dist/index48.js.map +1 -1
  58. package/dist/index49.js +34 -35
  59. package/dist/index49.js.map +1 -1
  60. package/dist/index50.js +81 -34
  61. package/dist/index50.js.map +1 -1
  62. package/dist/index51.js +166 -71
  63. package/dist/index51.js.map +1 -1
  64. package/dist/index52.js +144 -167
  65. package/dist/index52.js.map +1 -1
  66. package/dist/index53.js +11 -152
  67. package/dist/index53.js.map +1 -1
  68. package/dist/index54.js +55 -10
  69. package/dist/index54.js.map +1 -1
  70. package/dist/index55.js +12 -55
  71. package/dist/index55.js.map +1 -1
  72. package/dist/index56.js +7 -14
  73. package/dist/index56.js.map +1 -1
  74. package/dist/index57.js +333 -6
  75. package/dist/index57.js.map +1 -1
  76. package/dist/index58.js +47 -334
  77. package/dist/index58.js.map +1 -1
  78. package/dist/index59.js +122 -47
  79. package/dist/index59.js.map +1 -1
  80. package/dist/index60.js +108 -120
  81. package/dist/index60.js.map +1 -1
  82. package/dist/index61.js +167 -107
  83. package/dist/index61.js.map +1 -1
  84. package/dist/index62.js +29 -167
  85. package/dist/index62.js.map +1 -1
  86. package/dist/index63.js +120 -30
  87. package/dist/index63.js.map +1 -1
  88. package/dist/index64.js +80 -116
  89. package/dist/index64.js.map +1 -1
  90. package/dist/index65.js +19 -85
  91. package/dist/index65.js.map +1 -1
  92. package/dist/index66.js +73 -19
  93. package/dist/index66.js.map +1 -1
  94. package/dist/index67.js +54 -71
  95. package/dist/index67.js.map +1 -1
  96. package/dist/index68.js +44 -56
  97. package/dist/index68.js.map +1 -1
  98. package/dist/index69.js +49 -42
  99. package/dist/index69.js.map +1 -1
  100. package/dist/index70.js +121 -50
  101. package/dist/index70.js.map +1 -1
  102. package/dist/index71.js +102 -118
  103. package/dist/index71.js.map +1 -1
  104. package/dist/index72.js +72 -105
  105. package/dist/index72.js.map +1 -1
  106. package/dist/index73.js +67 -73
  107. package/dist/index73.js.map +1 -1
  108. package/dist/index74.js +19 -66
  109. package/dist/index74.js.map +1 -1
  110. package/dist/index75.js +55 -18
  111. package/dist/index75.js.map +1 -1
  112. package/dist/index76.js +251 -55
  113. package/dist/index76.js.map +1 -1
  114. package/dist/index77.js +22 -254
  115. package/dist/index77.js.map +1 -1
  116. package/dist/index78.js +31 -22
  117. package/dist/index78.js.map +1 -1
  118. package/dist/index79.js +93 -30
  119. package/dist/index79.js.map +1 -1
  120. package/dist/index80.js +626 -86
  121. package/dist/index80.js.map +1 -1
  122. package/dist/index81.js +73 -322
  123. package/dist/index81.js.map +1 -1
  124. package/dist/index82.js +39 -79
  125. package/dist/index82.js.map +1 -1
  126. package/dist/index83.js +23 -40
  127. package/dist/index83.js.map +1 -1
  128. package/dist/index84.js +207 -23
  129. package/dist/index84.js.map +1 -1
  130. package/dist/index85.js +148 -199
  131. package/dist/index85.js.map +1 -1
  132. package/dist/index86.js +152 -147
  133. package/dist/index86.js.map +1 -1
  134. package/dist/index87.js +143 -156
  135. package/dist/index87.js.map +1 -1
  136. package/dist/index88.js +35 -65
  137. package/dist/index88.js.map +1 -1
  138. package/dist/index89.js +234 -35
  139. package/dist/index89.js.map +1 -1
  140. package/dist/index90.js +31 -231
  141. package/dist/index90.js.map +1 -1
  142. package/dist/index91.js +210 -34
  143. package/dist/index91.js.map +1 -1
  144. package/dist/index92.js +418 -187
  145. package/dist/index92.js.map +1 -1
  146. package/dist/index93.js +686 -376
  147. package/dist/index93.js.map +1 -1
  148. package/dist/index94.js +165 -738
  149. package/dist/index94.js.map +1 -1
  150. package/dist/index95.js +253 -173
  151. package/dist/index95.js.map +1 -1
  152. package/dist/index96.js +64 -256
  153. package/dist/index96.js.map +1 -1
  154. package/dist/index97.js +121 -61
  155. package/dist/index97.js.map +1 -1
  156. package/dist/index98.js +14 -126
  157. package/dist/index98.js.map +1 -1
  158. package/dist/index99.js +31 -12
  159. package/dist/index99.js.map +1 -1
  160. package/package.json +1 -1
  161. package/dist/components/Indicator.d.ts +0 -7
  162. package/dist/index112.js +0 -53
  163. package/dist/index112.js.map +0 -1
package/dist/index93.js CHANGED
@@ -1,444 +1,754 @@
1
- import { jsx as k, jsxs as ue } from "react/jsx-runtime";
2
- import he, { forwardRef as Ne, useCallback as D, useMemo as G, useState as V, createContext as Te, useRef as Ee, useEffect as Ie, useContext as Le } from "react";
3
- const ke = Te(null);
4
- function De() {
5
- const e = Le(ke);
6
- if (!e)
7
- throw new Error("Tree components must be used within a Tree");
8
- return e;
9
- }
10
- function Se(e) {
11
- const a = [], c = (d) => {
12
- d.forEach((f) => {
13
- a.push(f.key), f.children && c(f.children);
14
- });
15
- };
16
- return c(e), a;
1
+ import { jsx as v, jsxs as z } from "react/jsx-runtime";
2
+ import rn, { forwardRef as sn, useId as on, useState as F, useRef as be, useMemo as oe, useCallback as T, useEffect as ve } from "react";
3
+ const cn = "SHOW_ALL", ln = "SHOW_PARENT", an = "SHOW_CHILD";
4
+ function u(r, d, p) {
5
+ if (d === "title") {
6
+ const l = p?.label || "title";
7
+ return r[l];
8
+ }
9
+ if (d === "key") {
10
+ const l = p?.value || "key";
11
+ return r[l];
12
+ }
13
+ if (d === "children") {
14
+ const l = p?.children || "children";
15
+ return r[l];
16
+ }
17
17
  }
18
- function de(e) {
19
- const a = [], c = (d) => {
20
- d.children && d.children.forEach((f) => {
21
- a.push(f.key), c(f);
22
- });
23
- };
24
- return c(e), a;
18
+ function Me(r, d = [], p) {
19
+ const l = [];
20
+ return r.forEach((f) => {
21
+ const b = u(f, "title", p), g = u(f, "children", p), k = [...d, b];
22
+ l.push({ node: f, path: k }), g && l.push(...Me(g, k, p));
23
+ }), l;
25
24
  }
26
- function ye(e) {
27
- const a = /* @__PURE__ */ new Map(), c = (d, f) => {
28
- d.forEach((u) => {
29
- a.set(u.key, f), u.children && c(u.children, u.key);
25
+ function un(r, d) {
26
+ const p = [], l = (f) => {
27
+ f.forEach((b) => {
28
+ const g = u(b, "key", d), k = u(b, "children", d);
29
+ p.push(g), k && l(k);
30
30
  });
31
31
  };
32
- return c(e, null), a;
32
+ return l(r), p;
33
33
  }
34
- function pe(e, a) {
35
- for (const c of e) {
36
- if (c.key === a) return c;
37
- if (c.children) {
38
- const d = pe(c.children, a);
39
- if (d) return d;
34
+ function $(r, d, p) {
35
+ for (const l of r) {
36
+ const f = u(l, "key", p), b = u(l, "children", p);
37
+ if (f === d) return l;
38
+ if (b) {
39
+ const g = $(b, d, p);
40
+ if (g) return g;
40
41
  }
41
42
  }
42
43
  return null;
43
44
  }
44
- function Ae(e, a) {
45
- const c = [], d = (f) => {
46
- f.forEach((u) => {
47
- c.push(u), u.children && a.includes(u.key) && d(u.children);
45
+ function Oe(r, d) {
46
+ const p = [], l = (f) => {
47
+ const b = u(f, "children", d);
48
+ b && b.forEach((g) => {
49
+ const k = u(g, "key", d);
50
+ p.push(k), l(g);
48
51
  });
49
52
  };
50
- return d(e), c;
51
- }
52
- function Me(e, a) {
53
- const c = ye(e), d = [];
54
- let f = c.get(a);
55
- for (; f; )
56
- d.push(f), f = c.get(f);
57
- return d;
53
+ return l(r), p;
58
54
  }
59
- function be({ node: e, level: a }) {
60
- const {
61
- checkable: c,
62
- checkboxColor: d,
63
- checkboxSize: f,
64
- selectable: u,
65
- showLine: J,
66
- showIcon: E,
67
- blockNode: Q,
68
- expandedKeys: I,
69
- selectedKeys: S,
70
- loadingKeys: X,
71
- switcherIcon: C,
72
- titleRender: q,
73
- filterTreeNode: L,
74
- onToggle: N,
75
- onSelect: A,
76
- onCheck: M,
77
- onRightClick: H,
78
- getCheckedState: Y,
79
- focusedKey: T,
80
- setFocusedKey: w,
81
- flattenedNodes: K,
82
- baseTestId: Z
83
- } = De(), $ = Ee(null), j = e.children && e.children.length > 0, b = e.isLeaf ?? !j, g = I.includes(e.key), p = S.includes(e.key), ee = X.includes(e.key), F = T === e.key, { checked: R, indeterminate: _ } = Y(e), O = L ? L(e) : !1, m = e.disabled;
84
- Ie(() => {
85
- F && $.current && $.current.focus();
86
- }, [F]);
87
- const x = (s) => {
88
- s.stopPropagation(), !b && !m && N(e.key, e);
89
- }, te = (s) => {
90
- u && e.selectable !== !1 && !m && A(e.key, e);
91
- }, z = (s) => {
92
- s.stopPropagation(), !m && !e.disableCheckbox && M(e.key, e);
93
- }, ne = (s) => {
94
- H && (s.preventDefault(), H({ event: s, node: e }));
95
- }, se = (s) => {
96
- const v = K.findIndex((i) => i.key === e.key);
97
- switch (s.key) {
98
- case "ArrowDown": {
99
- s.preventDefault();
100
- const i = K[v + 1];
101
- i && w(i.key);
102
- break;
103
- }
104
- case "ArrowUp": {
105
- s.preventDefault();
106
- const i = K[v - 1];
107
- i && w(i.key);
108
- break;
109
- }
110
- case "ArrowRight": {
111
- if (s.preventDefault(), !b && !g)
112
- N(e.key, e);
113
- else if (j && g) {
114
- const i = e.children[0];
115
- w(i.key);
116
- }
117
- break;
118
- }
119
- case "ArrowLeft": {
120
- s.preventDefault(), !b && g && N(e.key, e);
121
- break;
122
- }
123
- case "Enter":
124
- case " ": {
125
- s.preventDefault(), c && e.checkable !== !1 ? M(e.key, e) : u && e.selectable !== !1 ? A(e.key, e) : b || N(e.key, e);
126
- break;
127
- }
128
- case "Home": {
129
- s.preventDefault();
130
- const i = K[0];
131
- i && w(i.key);
132
- break;
133
- }
134
- case "End": {
135
- s.preventDefault();
136
- const i = K[K.length - 1];
137
- i && w(i.key);
138
- break;
139
- }
55
+ function ge(r, d, p, l = []) {
56
+ for (const f of r) {
57
+ const b = u(f, "key", p), g = u(f, "children", p);
58
+ if (b === d) return l;
59
+ if (g) {
60
+ const k = ge(g, d, p, [...l, b]);
61
+ if (k) return k;
140
62
  }
141
- }, re = {
142
- xs: "checkbox-xs",
143
- sm: "checkbox-sm",
144
- md: "",
145
- lg: "checkbox-lg",
146
- xl: "checkbox-xl"
147
- }, ce = {
148
- primary: "checkbox-primary",
149
- secondary: "checkbox-secondary",
150
- accent: "checkbox-accent",
151
- neutral: "checkbox-neutral",
152
- info: "checkbox-info",
153
- success: "checkbox-success",
154
- warning: "checkbox-warning",
155
- error: "checkbox-error"
156
- }, ie = re[f], ae = ce[d], le = () => ee ? /* @__PURE__ */ k("span", { className: "loading loading-spinner loading-xs" }) : b ? /* @__PURE__ */ k("span", { className: "w-4 h-4" }) : C ? typeof C == "function" ? C(g) : C : /* @__PURE__ */ k(
63
+ }
64
+ return null;
65
+ }
66
+ function dn({
67
+ node: r,
68
+ level: d,
69
+ expanded: p,
70
+ selected: l,
71
+ checked: f,
72
+ indeterminate: b,
73
+ treeCheckable: g,
74
+ treeLine: k,
75
+ treeIcon: V,
76
+ focused: H,
77
+ loading: ce,
78
+ baseTestId: U,
79
+ id: le,
80
+ fieldNames: q,
81
+ switcherIcon: L,
82
+ onToggle: X,
83
+ onSelect: Y,
84
+ onCheck: M,
85
+ renderChildren: Z
86
+ }) {
87
+ const C = u(r, "children", q), P = u(r, "title", q), W = u(r, "key", q), D = r.icon, G = C && C.length > 0, E = r.isLeaf ?? !G, B = (K) => {
88
+ K.stopPropagation(), E || X(W);
89
+ }, m = () => {
90
+ r.disabled || (g ? M(W, r) : Y(W, r));
91
+ }, j = (K) => {
92
+ K.stopPropagation(), r.disabled || M(W, r);
93
+ }, J = (K) => {
94
+ (K.key === "Enter" || K.key === " ") && (K.preventDefault(), m());
95
+ }, N = () => ce ? /* @__PURE__ */ v("span", { className: "loading loading-spinner loading-xs" }) : L ? typeof L == "function" ? L({ expanded: p }) : L : /* @__PURE__ */ v(
157
96
  "svg",
158
97
  {
159
- className: `w-4 h-4 transition-transform duration-200 ${g ? "rotate-90" : ""}`,
98
+ className: `w-3 h-3 transition-transform ${p ? "rotate-90" : ""}`,
160
99
  fill: "none",
161
100
  viewBox: "0 0 24 24",
162
101
  stroke: "currentColor",
163
102
  "aria-hidden": "true",
164
- children: /* @__PURE__ */ k("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
103
+ children: /* @__PURE__ */ v("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
165
104
  }
166
- ), B = () => q ? q(e) : e.title, P = p ? "selected" : g ? "expanded" : "collapsed";
167
- return /* @__PURE__ */ ue(
105
+ );
106
+ return /* @__PURE__ */ z(
168
107
  "div",
169
108
  {
170
- className: "tree-node",
109
+ className: "tree-select-node",
171
110
  role: "treeitem",
172
- "aria-expanded": b ? void 0 : g,
173
- "aria-selected": p,
174
- "aria-checked": c ? _ ? "mixed" : R : void 0,
175
- "aria-disabled": m,
176
- "aria-level": a + 1,
177
- "data-testid": `${Z}-node-${e.key}`,
178
- "data-state": P,
179
- "data-key": e.key,
111
+ id: le,
112
+ "aria-selected": l || f,
113
+ "aria-expanded": G ? p : void 0,
114
+ "data-testid": `${U}-option-${W}`,
115
+ "data-state": l || f ? "selected" : "unselected",
116
+ "data-disabled": r.disabled || void 0,
180
117
  children: [
181
- /* @__PURE__ */ ue(
118
+ /* @__PURE__ */ z(
182
119
  "div",
183
120
  {
184
- ref: $,
185
121
  className: [
186
- "flex items-center py-1 px-1 rounded transition-colors outline-none",
187
- "focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1",
188
- u && !m && "cursor-pointer hover:bg-base-200",
189
- p && "bg-primary/10 text-primary",
190
- m && "opacity-50 cursor-not-allowed",
191
- O && "bg-warning/20",
192
- Q && "w-full"
122
+ "flex items-center py-1.5 px-2 cursor-pointer hover:bg-base-200 transition-colors outline-none",
123
+ (l || f) && "bg-primary/10 text-primary",
124
+ r.disabled && "opacity-50 cursor-not-allowed",
125
+ H && "ring-2 ring-primary ring-inset",
126
+ k && d > 0 && "border-l border-base-300 ml-2"
193
127
  ].filter(Boolean).join(" "),
194
- style: { paddingLeft: `${a * 20}px` },
195
- tabIndex: F ? 0 : -1,
196
- onClick: te,
197
- onContextMenu: ne,
198
- onKeyDown: se,
199
- onFocus: () => w(e.key),
128
+ style: { paddingLeft: `${d * 16 + 8}px` },
129
+ onClick: m,
130
+ onKeyDown: J,
131
+ tabIndex: -1,
200
132
  children: [
201
- /* @__PURE__ */ k(
133
+ /* @__PURE__ */ v(
202
134
  "span",
203
135
  {
204
136
  className: [
205
- "w-5 h-5 flex items-center justify-center flex-shrink-0",
206
- !b && !m && "cursor-pointer hover:bg-base-300 rounded"
137
+ "w-4 h-4 flex items-center justify-center flex-shrink-0 mr-1",
138
+ !E && "cursor-pointer"
207
139
  ].filter(Boolean).join(" "),
208
- onClick: x,
140
+ onClick: B,
209
141
  "aria-hidden": "true",
210
- children: le()
142
+ children: !E && N()
211
143
  }
212
144
  ),
213
- c && e.checkable !== !1 && /* @__PURE__ */ k("span", { className: "mr-1 flex-shrink-0", onClick: z, children: /* @__PURE__ */ k(
145
+ g && /* @__PURE__ */ v("span", { className: "mr-2 flex-shrink-0", onClick: j, children: /* @__PURE__ */ v(
214
146
  "input",
215
147
  {
216
148
  type: "checkbox",
217
- className: `checkbox ${ie} ${ae}`,
218
- checked: R,
219
- ref: (s) => {
220
- s && (s.indeterminate = _);
149
+ className: "checkbox checkbox-sm checkbox-primary",
150
+ checked: f,
151
+ ref: (K) => {
152
+ K && (K.indeterminate = b);
221
153
  },
222
- disabled: m || e.disableCheckbox,
223
- onChange: z,
224
- tabIndex: -1,
225
- "aria-hidden": "true",
226
- "data-state": _ ? "indeterminate" : R ? "checked" : "unchecked"
154
+ disabled: r.disabled,
155
+ onChange: m,
156
+ "aria-label": typeof P == "string" ? P : void 0,
157
+ tabIndex: -1
227
158
  }
228
159
  ) }),
229
- E && e.icon && /* @__PURE__ */ k("span", { className: "mr-1 flex-shrink-0", "aria-hidden": "true", children: e.icon }),
230
- /* @__PURE__ */ k("span", { className: "flex-1 truncate select-none", children: B() })
160
+ V && D && /* @__PURE__ */ v("span", { className: "mr-1.5 flex-shrink-0 flex items-center", children: D }),
161
+ /* @__PURE__ */ v("span", { className: "flex-1 truncate select-none text-sm", children: P })
231
162
  ]
232
163
  }
233
164
  ),
234
- j && g && /* @__PURE__ */ k(
235
- "div",
236
- {
237
- className: J ? "border-l border-base-300 ml-2.5" : "",
238
- role: "group",
239
- "aria-label": `${e.title} children`,
240
- children: e.children.map((s) => /* @__PURE__ */ k(be, { node: s, level: a + 1 }, s.key))
241
- }
242
- )
165
+ G && p && /* @__PURE__ */ v("div", { role: "group", children: Z(C, d + 1) })
243
166
  ]
244
167
  }
245
168
  );
246
169
  }
247
- function fe(e) {
248
- return null;
249
- }
250
- fe.displayName = "Tree.Node";
251
- function $e(e) {
252
- return e.type === fe || typeof e.type == "function" && e.type.displayName === "Tree.Node";
253
- }
254
- const _e = Object.assign(
255
- Ne(function({
256
- treeData: a,
257
- children: c,
258
- checkable: d = !1,
259
- checkboxColor: f = "primary",
260
- checkboxSize: u = "sm",
261
- selectable: J = !0,
262
- multiple: E = !1,
263
- defaultExpandAll: Q = !1,
264
- defaultExpandedKeys: I = [],
265
- expandedKeys: S,
266
- defaultSelectedKeys: X = [],
267
- selectedKeys: C,
268
- defaultCheckedKeys: q = [],
269
- checkedKeys: L,
270
- onExpand: N,
271
- onSelect: A,
272
- onCheck: M,
273
- showLine: H = !1,
274
- showIcon: Y = !1,
275
- checkStrictly: T = !1,
276
- autoExpandParent: w = !0,
277
- blockNode: K = !1,
278
- switcherIcon: Z,
279
- titleRender: $,
280
- filterTreeNode: j,
281
- loadData: b,
282
- onRightClick: g,
283
- fieldNames: p,
284
- className: ee = "",
285
- "data-testid": F,
286
- ...R
287
- }, _) {
288
- const O = F ?? "tree", m = D((t, o, n) => {
289
- }, []), x = G(() => {
290
- if (a) {
291
- if (p) {
292
- const o = (n) => {
293
- const r = p.key ? n[p.key] : n.key, l = p.title ? n[p.title] : n.title, h = p.children ? n[p.children] : n.children;
294
- return {
295
- ...n,
296
- key: r,
297
- title: l,
298
- children: Array.isArray(h) ? h.map((y) => o(y)) : void 0
299
- };
300
- };
301
- return a.map(o);
302
- }
303
- return a;
304
- }
305
- const t = (o) => {
306
- const n = [];
307
- return he.Children.forEach(o, (r) => {
308
- if (he.isValidElement(r) && $e(r)) {
309
- const l = r.props, h = r.key;
310
- if (!h) {
311
- console.warn("Tree.Node requires a key prop");
312
- return;
313
- }
314
- const y = {
315
- key: h,
316
- title: l.title,
317
- icon: l.icon,
318
- disabled: l.disabled,
319
- disableCheckbox: l.disableCheckbox,
320
- selectable: l.selectable,
321
- checkable: l.checkable,
322
- isLeaf: l.isLeaf,
323
- children: l.children ? t(l.children) : void 0
324
- };
325
- n.push(y);
326
- }
327
- }), n;
170
+ const fn = {
171
+ xs: "min-h-6 text-xs",
172
+ sm: "min-h-8 text-sm",
173
+ md: "min-h-10 text-base",
174
+ lg: "min-h-12 text-lg",
175
+ xl: "min-h-14 text-xl"
176
+ }, hn = {
177
+ primary: "border-primary focus-within:border-primary",
178
+ secondary: "border-secondary focus-within:border-secondary",
179
+ accent: "border-accent focus-within:border-accent",
180
+ neutral: "border-neutral focus-within:border-neutral",
181
+ info: "border-info focus-within:border-info",
182
+ success: "border-success focus-within:border-success",
183
+ warning: "border-warning focus-within:border-warning",
184
+ error: "border-error focus-within:border-error"
185
+ }, pn = {
186
+ error: "border-error focus-within:border-error",
187
+ warning: "border-warning focus-within:border-warning"
188
+ }, bn = {
189
+ outlined: "border border-base-300",
190
+ filled: "bg-base-200 border-transparent",
191
+ borderless: "border-transparent"
192
+ }, Pe = sn(
193
+ ({
194
+ treeData: r,
195
+ value: d,
196
+ defaultValue: p = [],
197
+ onChange: l,
198
+ multiple: f = !1,
199
+ treeCheckable: b = !1,
200
+ treeCheckStrictly: g = !1,
201
+ showCheckedStrategy: k = "SHOW_ALL",
202
+ showSearch: V = !1,
203
+ searchValue: H,
204
+ onSearch: ce,
205
+ filterTreeNode: U,
206
+ placeholder: le = "Please select",
207
+ allowClear: q = !0,
208
+ disabled: L = !1,
209
+ treeDefaultExpandAll: X = !1,
210
+ treeDefaultExpandedKeys: Y = [],
211
+ treeExpandedKeys: M,
212
+ onTreeExpand: Z,
213
+ size: C = "md",
214
+ color: P,
215
+ status: W,
216
+ variant: D = "outlined",
217
+ ghost: G = !1,
218
+ maxTagCount: E,
219
+ maxTagPlaceholder: B,
220
+ maxCount: m,
221
+ labelInValue: j = !1,
222
+ tagRender: J,
223
+ treeLine: N = !1,
224
+ treeIcon: K = !1,
225
+ loadData: ae,
226
+ fieldNames: i,
227
+ open: ue,
228
+ onDropdownVisibleChange: ye,
229
+ suffixIcon: Be,
230
+ switcherIcon: we,
231
+ notFoundContent: Re = "No results found",
232
+ dropdownRender: xe,
233
+ popupClassName: Fe = "",
234
+ className: Te = "",
235
+ "data-testid": ze,
236
+ ...Ve
237
+ }, ee) => {
238
+ const _ = ze ?? "treeselect", ne = on(), ke = `${ne}-listbox`, [Ue, qe] = F(!1), [Ce, te] = F(""), [w, I] = F(null), [Le, me] = F(/* @__PURE__ */ new Set()), de = be(null), fe = be(null), re = be(null), Q = H ?? Ce, y = ue ?? Ue, Ke = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map((n) => typeof n == "object" && n !== null ? n.value : n) : typeof e == "object" && e !== null ? [e.value] : [e], Ge = Ke(p), [Je, se] = F(Ge), h = d !== void 0 ? Ke(d) : Je, Qe = oe(() => X ? un(r, i) : Y, [r, X, Y, i]), [Xe, Ye] = F(Qe), A = M ?? Xe, S = oe(() => {
239
+ const e = [], n = (c) => {
240
+ c.forEach((t) => {
241
+ const o = u(t, "key", i), s = u(t, "children", i);
242
+ e.push({ key: o, node: t }), s && A.includes(o) && n(s);
243
+ });
328
244
  };
329
- return t(c);
330
- }, [a, c, p]), [te, z] = V([]), ne = G(() => {
331
- if (Q)
332
- return Se(x);
333
- if (w && I.length > 0) {
334
- const t = new Set(I);
335
- return I.forEach((o) => {
336
- Me(x, o).forEach((n) => t.add(n));
337
- }), Array.from(t);
338
- }
339
- return I;
340
- }, []), [se, re] = V(ne), [ce, ie] = V(X), [ae, le] = V(q), [B, P] = V(null), s = S ?? se, v = C ?? ce, i = L ?? ae, oe = G(() => ye(x), [x]), U = G(() => Ae(x, s), [x, s]), xe = D(
341
- (t) => {
342
- if (T)
343
- return { checked: i.includes(t.key), indeterminate: !1 };
344
- if (!t.children || t.children.length === 0)
345
- return { checked: i.includes(t.key), indeterminate: !1 };
346
- const o = de(t), n = o.filter((r) => i.includes(r));
347
- return n.length === 0 ? { checked: i.includes(t.key), indeterminate: !1 } : n.length === o.length ? { checked: !0, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
245
+ return n(r), e;
246
+ }, [r, A, i]), O = T(
247
+ (e) => {
248
+ ue === void 0 && qe(e), ye?.(e);
348
249
  },
349
- [i, T]
350
- ), ge = D(
351
- async (t, o) => {
352
- const n = s.includes(t);
353
- if (b && !n && !o.isLeaf && (!o.children || o.children.length === 0)) {
354
- z((l) => [...l, t]);
355
- try {
356
- await b(o);
357
- } finally {
358
- z((l) => l.filter((h) => h !== t));
250
+ [ue, ye]
251
+ );
252
+ ve(() => {
253
+ const e = (n) => {
254
+ de.current && !de.current.contains(n.target) && (O(!1), H === void 0 && te(""));
255
+ };
256
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
257
+ }, [O, H]), ve(() => {
258
+ y && V && fe.current ? fe.current.focus() : y && re.current && re.current.focus();
259
+ }, [y, V]), ve(() => {
260
+ y && S.length > 0 ? h.length > 0 ? I(h[0]) : I(S[0].key) : y || I(null);
261
+ }, [y, S, h]);
262
+ const $e = oe(() => {
263
+ if (!Q) return r;
264
+ const e = Me(r, [], i), n = /* @__PURE__ */ new Set();
265
+ e.forEach(({ node: t }) => {
266
+ const o = u(t, "title", i), s = u(t, "key", i);
267
+ let a = !1;
268
+ U ? a = U(Q, t) : a = (typeof o == "string" ? o : String(o)).toLowerCase().includes(Q.toLowerCase()), a && n.add(s);
269
+ });
270
+ const c = (t) => t.map((o) => {
271
+ const s = u(o, "children", i), a = u(o, "key", i), x = s && c(s).length > 0;
272
+ return n.has(a) || x ? {
273
+ ...o,
274
+ children: s ? c(s) : void 0
275
+ } : null;
276
+ }).filter(Boolean);
277
+ return c(r);
278
+ }, [r, Q, U, i]), ie = T(
279
+ async (e) => {
280
+ const n = $(r, e, i);
281
+ if (ae && n) {
282
+ const t = u(n, "children", i);
283
+ if (!t || t.length === 0) {
284
+ me((o) => new Set(o).add(e));
285
+ try {
286
+ await ae(n);
287
+ } finally {
288
+ me((o) => {
289
+ const s = new Set(o);
290
+ return s.delete(e), s;
291
+ });
292
+ }
359
293
  }
360
294
  }
361
- const r = n ? s.filter((l) => l !== t) : [...s, t];
362
- S === void 0 && re(r), N?.(r, { node: o, expanded: !n });
295
+ const c = A.includes(e) ? A.filter((t) => t !== e) : [...A, e];
296
+ M === void 0 && Ye(c), Z?.(c);
363
297
  },
364
- [s, S, N, b]
365
- ), me = D(
366
- (t, o) => {
367
- let n;
368
- E ? v.includes(t) ? n = v.filter((r) => r !== t) : n = [...v, t] : n = v.includes(t) ? [] : [t], C === void 0 && ie(n), A?.(n, { node: o, selected: n.includes(t) });
298
+ [A, M, Z, ae, r, i]
299
+ ), he = T(
300
+ (e, n) => {
301
+ let c;
302
+ if (f)
303
+ if (h.includes(e))
304
+ c = h.filter((o) => o !== e);
305
+ else {
306
+ if (m !== void 0 && h.length >= m)
307
+ return;
308
+ c = [...h, e];
309
+ }
310
+ else
311
+ c = [e], O(!1), H === void 0 && te("");
312
+ d === void 0 && se(c);
313
+ const t = c.map((o) => {
314
+ const s = $(r, o, i);
315
+ return s ? u(s, "title", i) : o;
316
+ });
317
+ if (j) {
318
+ const o = c.map((s) => {
319
+ const a = $(r, s, i);
320
+ return {
321
+ value: s,
322
+ label: a ? u(a, "title", i) : s
323
+ };
324
+ });
325
+ l?.(
326
+ f ? o : o[0] || { value: "", label: "" },
327
+ t,
328
+ { triggerValue: e, triggerNode: n }
329
+ );
330
+ } else
331
+ l?.(f ? c : c[0] || "", t, { triggerValue: e, triggerNode: n });
369
332
  },
370
- [v, E, C, A]
371
- ), ve = D(
372
- (t, o) => {
373
- const n = i.includes(t);
374
- let r = [...i];
375
- if (T)
376
- n ? r = r.filter((l) => l !== t) : r.push(t);
333
+ [
334
+ h,
335
+ f,
336
+ m,
337
+ d,
338
+ l,
339
+ r,
340
+ O,
341
+ H,
342
+ i,
343
+ j
344
+ ]
345
+ ), pe = T(
346
+ (e, n) => {
347
+ const c = h.includes(e);
348
+ let t = [...h];
349
+ if (g)
350
+ if (c)
351
+ t = t.filter((s) => s !== e);
352
+ else {
353
+ if (m !== void 0 && h.length >= m)
354
+ return;
355
+ t.push(e);
356
+ }
377
357
  else {
378
- const l = de(o);
379
- n ? r = r.filter((y) => y !== t && !l.includes(y)) : (r.push(t), l.forEach((y) => {
380
- r.includes(y) || r.push(y);
381
- }));
382
- let h = oe.get(t) ?? null;
383
- for (; h; ) {
384
- const y = pe(x, h);
385
- y && y.children && (y.children.every(
386
- (W) => r.includes(W.key) || de(W).every((Ke) => r.includes(Ke))
387
- ) ? r.includes(h) || r.push(h) : r = r.filter((W) => W !== h)), h = oe.get(h) ?? null;
358
+ const s = Oe(n, i);
359
+ if (c)
360
+ t = t.filter((a) => a !== e && !s.includes(a));
361
+ else {
362
+ const a = [e, ...s.filter((x) => !t.includes(x))];
363
+ if (m !== void 0 && t.length + a.length > m) {
364
+ const x = m - t.length;
365
+ if (x <= 0) return;
366
+ a.slice(0, x).forEach((R) => t.push(R));
367
+ } else
368
+ t.push(e), s.forEach((x) => {
369
+ t.includes(x) || t.push(x);
370
+ });
388
371
  }
389
372
  }
390
- L === void 0 && le(r), M?.(r, { node: o, checked: !n });
373
+ d === void 0 && se(t);
374
+ const o = t.map((s) => {
375
+ const a = $(r, s, i);
376
+ return a ? u(a, "title", i) : s;
377
+ });
378
+ if (j) {
379
+ const s = t.map((a) => {
380
+ const x = $(r, a, i);
381
+ return {
382
+ value: a,
383
+ label: x ? u(x, "title", i) : a
384
+ };
385
+ });
386
+ l?.(s, o, { triggerValue: e, triggerNode: n });
387
+ } else
388
+ l?.(t, o, { triggerValue: e, triggerNode: n });
391
389
  },
392
- [i, L, M, oe, x, T]
393
- ), Ce = D(() => {
394
- !B && U.length > 0 && P(U[0].key);
395
- }, [B, U]), we = {
396
- checkable: d,
397
- checkboxColor: f,
398
- checkboxSize: u,
399
- selectable: J,
400
- multiple: E,
401
- showLine: H,
402
- showIcon: Y,
403
- blockNode: K,
404
- checkStrictly: T,
405
- expandedKeys: s,
406
- selectedKeys: v,
407
- checkedKeys: i,
408
- loadingKeys: te,
409
- switcherIcon: Z,
410
- titleRender: $,
411
- filterTreeNode: j,
412
- onToggle: ge,
413
- onSelect: me,
414
- onCheck: ve,
415
- onRightClick: g,
416
- getCheckedState: xe,
417
- focusedKey: B,
418
- setFocusedKey: P,
419
- flattenedNodes: U,
420
- registerNode: m,
421
- baseTestId: O
422
- };
423
- return /* @__PURE__ */ k(ke.Provider, { value: we, children: /* @__PURE__ */ k(
390
+ [h, d, l, r, g, i, m, j]
391
+ ), Ze = (e) => {
392
+ e.stopPropagation();
393
+ const n = [];
394
+ d === void 0 && se(n), j ? l?.(f || b ? [] : { value: "", label: "" }, []) : l?.(f || b ? n : "", []);
395
+ }, Se = (e, n) => {
396
+ n.stopPropagation();
397
+ const c = h.filter((o) => o !== e);
398
+ d === void 0 && se(c);
399
+ const t = c.map((o) => {
400
+ const s = $(r, o, i);
401
+ return s ? u(s, "title", i) : o;
402
+ });
403
+ if (j) {
404
+ const o = c.map((s) => {
405
+ const a = $(r, s, i);
406
+ return {
407
+ value: s,
408
+ label: a ? u(a, "title", i) : s
409
+ };
410
+ });
411
+ l?.(
412
+ f || b ? o : o[0] || { value: "", label: "" },
413
+ t
414
+ );
415
+ } else
416
+ l?.(f || b ? c : c[0] || "", t);
417
+ }, De = (e) => {
418
+ const n = e.target.value;
419
+ H === void 0 && te(n), ce?.(n);
420
+ }, Ne = (e) => {
421
+ if (!L)
422
+ switch (e.key) {
423
+ case "Enter":
424
+ case " ":
425
+ if (!y)
426
+ e.preventDefault(), O(!0);
427
+ else if (w) {
428
+ e.preventDefault();
429
+ const n = $(r, w, i);
430
+ n && !n.disabled && (b ? pe(w, n) : he(w, n));
431
+ }
432
+ break;
433
+ case "Escape":
434
+ e.preventDefault(), O(!1), H === void 0 && te(""), re.current?.focus();
435
+ break;
436
+ case "ArrowDown":
437
+ if (e.preventDefault(), !y)
438
+ O(!0);
439
+ else {
440
+ const n = S.findIndex((t) => t.key === w), c = n < S.length - 1 ? n + 1 : 0;
441
+ I(S[c]?.key || null);
442
+ }
443
+ break;
444
+ case "ArrowUp":
445
+ if (e.preventDefault(), y) {
446
+ const n = S.findIndex((t) => t.key === w), c = n > 0 ? n - 1 : S.length - 1;
447
+ I(S[c]?.key || null);
448
+ }
449
+ break;
450
+ case "ArrowRight":
451
+ if (y && w) {
452
+ e.preventDefault();
453
+ const n = $(r, w, i), c = n ? u(n, "children", i) : void 0;
454
+ c && c.length > 0 && !A.includes(w) && ie(w);
455
+ }
456
+ break;
457
+ case "ArrowLeft":
458
+ if (y && w)
459
+ if (e.preventDefault(), A.includes(w))
460
+ ie(w);
461
+ else {
462
+ const n = ge(r, w, i);
463
+ n && n.length > 0 && I(n[n.length - 1]);
464
+ }
465
+ break;
466
+ case "Home":
467
+ y && (e.preventDefault(), I(S[0]?.key || null));
468
+ break;
469
+ case "End":
470
+ y && (e.preventDefault(), I(S[S.length - 1]?.key || null));
471
+ break;
472
+ }
473
+ }, Ee = T(
474
+ (e) => {
475
+ const n = u(e, "key", i), c = u(e, "children", i);
476
+ if (g)
477
+ return { checked: h.includes(n), indeterminate: !1 };
478
+ if (!c || c.length === 0)
479
+ return { checked: h.includes(n), indeterminate: !1 };
480
+ const t = Oe(e, i), o = t.filter((s) => h.includes(s));
481
+ return o.length === 0 ? { checked: h.includes(n), indeterminate: !1 } : o.length === t.length ? { checked: !0, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
482
+ },
483
+ [h, g, i]
484
+ ), _e = T(
485
+ (e, n) => e.map((c) => {
486
+ const t = u(c, "key", i), { checked: o, indeterminate: s } = Ee(c);
487
+ return /* @__PURE__ */ v(
488
+ dn,
489
+ {
490
+ node: c,
491
+ level: n,
492
+ expanded: A.includes(t),
493
+ selected: h.includes(t),
494
+ checked: o,
495
+ indeterminate: s,
496
+ treeCheckable: b,
497
+ treeLine: N,
498
+ treeIcon: K,
499
+ focused: w === t,
500
+ loading: Le.has(t),
501
+ baseTestId: _,
502
+ id: `${ne}-option-${t}`,
503
+ fieldNames: i,
504
+ switcherIcon: we,
505
+ onToggle: ie,
506
+ onSelect: he,
507
+ onCheck: pe,
508
+ renderChildren: _e
509
+ },
510
+ t
511
+ );
512
+ }),
513
+ [
514
+ A,
515
+ h,
516
+ b,
517
+ N,
518
+ K,
519
+ w,
520
+ Le,
521
+ _,
522
+ ne,
523
+ i,
524
+ we,
525
+ ie,
526
+ he,
527
+ pe,
528
+ Ee
529
+ ]
530
+ ), en = oe(() => {
531
+ if (h.length === 0) return null;
532
+ let e = h;
533
+ if ((b || f) && k !== "SHOW_ALL" && (k === "SHOW_PARENT" ? e = h.filter((t) => {
534
+ const o = ge(r, t, i);
535
+ return o ? !o.some((s) => h.includes(s)) : !0;
536
+ }) : k === "SHOW_CHILD" && (e = h.filter((t) => {
537
+ const o = $(r, t, i);
538
+ if (!o) return !0;
539
+ const s = u(o, "children", i);
540
+ return !s || s.length === 0;
541
+ }))), f || b) {
542
+ let t = e, o = 0;
543
+ E !== void 0 && E !== "responsive" && e.length > E && (t = e.slice(0, E), o = e.length - E);
544
+ const s = t.map((a) => {
545
+ const x = $(r, a, i), R = x ? u(x, "title", i) : a, We = R, je = !L, tn = () => {
546
+ Se(a, { stopPropagation: () => {
547
+ } });
548
+ };
549
+ return J ? /* @__PURE__ */ v(rn.Fragment, { children: J({ label: We, value: a, closable: je, onClose: tn }) }, a) : /* @__PURE__ */ z(
550
+ "span",
551
+ {
552
+ className: "inline-flex items-center gap-1 px-2 py-0.5 bg-base-200 rounded text-sm mr-1 mb-1",
553
+ "data-testid": `${_}-tag-${a}`,
554
+ children: [
555
+ We,
556
+ je && /* @__PURE__ */ v(
557
+ "button",
558
+ {
559
+ type: "button",
560
+ className: "hover:text-error",
561
+ onClick: (Ie) => Se(a, Ie),
562
+ "aria-label": `Remove ${typeof R == "string" ? R : a}`,
563
+ children: /* @__PURE__ */ v(
564
+ "svg",
565
+ {
566
+ className: "w-3 h-3",
567
+ fill: "none",
568
+ viewBox: "0 0 24 24",
569
+ stroke: "currentColor",
570
+ "aria-hidden": "true",
571
+ children: /* @__PURE__ */ v(
572
+ "path",
573
+ {
574
+ strokeLinecap: "round",
575
+ strokeLinejoin: "round",
576
+ strokeWidth: 2,
577
+ d: "M6 18L18 6M6 6l12 12"
578
+ }
579
+ )
580
+ }
581
+ )
582
+ }
583
+ )
584
+ ]
585
+ },
586
+ a
587
+ );
588
+ });
589
+ if (o > 0) {
590
+ const a = e.slice(E), x = typeof B == "function" ? B(a) : B || `+${o} more`;
591
+ s.push(
592
+ /* @__PURE__ */ v(
593
+ "span",
594
+ {
595
+ className: "inline-flex items-center px-2 py-0.5 bg-base-200 rounded text-sm mr-1 mb-1",
596
+ children: x
597
+ },
598
+ "__more__"
599
+ )
600
+ );
601
+ }
602
+ return s;
603
+ }
604
+ const n = $(r, h[0], i);
605
+ return n ? u(n, "title", i) : h[0];
606
+ }, [
607
+ h,
608
+ r,
609
+ f,
610
+ b,
611
+ k,
612
+ E,
613
+ B,
614
+ _,
615
+ i,
616
+ L,
617
+ J
618
+ ]), Ae = W ? pn[W] : P ? hn[P] : "", nn = G ? "bg-transparent border-transparent" : bn[D], He = /* @__PURE__ */ v("div", { className: "py-1", role: "tree", "aria-label": "Tree options", children: $e.length > 0 ? _e($e, 0) : /* @__PURE__ */ v(
424
619
  "div",
425
620
  {
426
- ref: _,
427
- className: `tree ${ee}`,
428
- role: "tree",
429
- "aria-multiselectable": E,
430
- "data-testid": O,
431
- onFocus: Ce,
432
- ...R,
433
- children: x.map((t) => /* @__PURE__ */ k(be, { node: t, level: 0 }, t.key))
621
+ className: "px-4 py-2 text-base-content/50 text-sm text-center",
622
+ "data-testid": `${_}-empty`,
623
+ children: Re
434
624
  }
435
625
  ) });
436
- }),
437
- {
438
- Node: fe
626
+ return /* @__PURE__ */ z(
627
+ "div",
628
+ {
629
+ ref: (e) => {
630
+ de.current = e, typeof ee == "function" ? ee(e) : ee && (ee.current = e);
631
+ },
632
+ className: `relative ${Te}`,
633
+ "data-testid": _,
634
+ "data-state": y ? "open" : "closed",
635
+ "data-disabled": L || void 0,
636
+ onKeyDown: Ne,
637
+ ...Ve,
638
+ children: [
639
+ /* @__PURE__ */ z(
640
+ "div",
641
+ {
642
+ ref: re,
643
+ role: "combobox",
644
+ "aria-expanded": y,
645
+ "aria-haspopup": "tree",
646
+ "aria-owns": y ? ke : void 0,
647
+ "aria-activedescendant": y && w ? `${ne}-option-${w}` : void 0,
648
+ "aria-disabled": L,
649
+ tabIndex: L ? -1 : 0,
650
+ className: [
651
+ "input flex items-center gap-2 cursor-pointer flex-wrap",
652
+ fn[C],
653
+ nn,
654
+ Ae,
655
+ L && "input-disabled opacity-50 cursor-not-allowed",
656
+ y && !Ae && "border-primary"
657
+ ].filter(Boolean).join(" "),
658
+ onClick: () => !L && O(!y),
659
+ "data-testid": `${_}-trigger`,
660
+ children: [
661
+ /* @__PURE__ */ v("div", { className: "flex-1 flex flex-wrap items-center gap-1 min-w-0", children: en || /* @__PURE__ */ v("span", { className: "text-base-content/50", children: le }) }),
662
+ q && h.length > 0 && !L && /* @__PURE__ */ v(
663
+ "button",
664
+ {
665
+ type: "button",
666
+ className: "hover:text-error flex-shrink-0",
667
+ onClick: Ze,
668
+ "aria-label": "Clear selection",
669
+ "data-testid": `${_}-clear`,
670
+ children: /* @__PURE__ */ v(
671
+ "svg",
672
+ {
673
+ className: "w-4 h-4",
674
+ fill: "none",
675
+ viewBox: "0 0 24 24",
676
+ stroke: "currentColor",
677
+ "aria-hidden": "true",
678
+ children: /* @__PURE__ */ v(
679
+ "path",
680
+ {
681
+ strokeLinecap: "round",
682
+ strokeLinejoin: "round",
683
+ strokeWidth: 2,
684
+ d: "M6 18L18 6M6 6l12 12"
685
+ }
686
+ )
687
+ }
688
+ )
689
+ }
690
+ ),
691
+ Be || /* @__PURE__ */ v(
692
+ "svg",
693
+ {
694
+ className: `w-4 h-4 flex-shrink-0 transition-transform ${y ? "rotate-180" : ""}`,
695
+ fill: "none",
696
+ viewBox: "0 0 24 24",
697
+ stroke: "currentColor",
698
+ "aria-hidden": "true",
699
+ children: /* @__PURE__ */ v(
700
+ "path",
701
+ {
702
+ strokeLinecap: "round",
703
+ strokeLinejoin: "round",
704
+ strokeWidth: 2,
705
+ d: "M19 9l-7 7-7-7"
706
+ }
707
+ )
708
+ }
709
+ )
710
+ ]
711
+ }
712
+ ),
713
+ y && /* @__PURE__ */ z(
714
+ "div",
715
+ {
716
+ id: ke,
717
+ className: `absolute z-50 mt-1 w-full bg-base-100 border border-base-300 rounded-lg shadow-lg max-h-64 overflow-auto ${Fe}`,
718
+ "data-testid": `${_}-dropdown`,
719
+ children: [
720
+ V && /* @__PURE__ */ v("div", { className: "p-2 border-b border-base-300", children: /* @__PURE__ */ v(
721
+ "input",
722
+ {
723
+ ref: fe,
724
+ type: "text",
725
+ className: "input input-sm w-full",
726
+ placeholder: "Search...",
727
+ value: Q,
728
+ onChange: De,
729
+ onClick: (e) => e.stopPropagation(),
730
+ "aria-label": "Search tree options",
731
+ "data-testid": `${_}-search`
732
+ }
733
+ ) }),
734
+ xe ? xe(He) : He
735
+ ]
736
+ }
737
+ )
738
+ ]
739
+ }
740
+ );
439
741
  }
440
742
  );
743
+ Pe.displayName = "TreeSelect";
744
+ const yn = Object.assign(Pe, {
745
+ SHOW_ALL: cn,
746
+ SHOW_PARENT: ln,
747
+ SHOW_CHILD: an
748
+ });
441
749
  export {
442
- _e as Tree
750
+ Pe as TreeSelect,
751
+ yn as TreeSelectComponent,
752
+ yn as default
443
753
  };
444
754
  //# sourceMappingURL=index93.js.map