@oneplatformdev/ui 0.1.10-94 → 0.1.11-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/AlertDialog/AlertDialog.js +40 -46
- package/AlertDialog/AlertDialog.js.map +1 -1
- package/AlertDialog/AlertDialogRoot.d.ts.map +1 -1
- package/AlertDialog/AlertDialogRoot.js +37 -33
- package/AlertDialog/AlertDialogRoot.js.map +1 -1
- package/Button/Button.d.ts.map +1 -1
- package/Button/Button.js +71 -46
- package/Button/Button.js.map +1 -1
- package/Button/Button.stories.d.ts +3 -0
- package/Button/Button.stories.d.ts.map +1 -1
- package/Button/Button.stories.js +128 -13
- package/Button/Button.stories.js.map +1 -1
- package/Button/Button.types.d.ts +7 -6
- package/Button/Button.types.d.ts.map +1 -1
- package/Button/buttonVariants.d.ts +33 -1
- package/Button/buttonVariants.d.ts.map +1 -1
- package/Button/buttonVariants.js +158 -4
- package/Button/buttonVariants.js.map +1 -1
- package/Button/index.js +5 -4
- package/ButtonIcon/buttonIconVariants.d.ts +1 -1
- package/CHANGELOG.md +297 -0
- package/Combobox/Combobox.d.ts.map +1 -1
- package/Combobox/Combobox.js +107 -106
- package/Combobox/Combobox.js.map +1 -1
- package/DataTable/useDataTable.d.ts +1 -1
- package/Dialog/Dialog.js +14 -14
- package/Dialog/Dialog.js.map +1 -1
- package/Form/Form_old.d.ts +1 -1
- package/Form/Form_old.d.ts.map +1 -1
- package/FormInput/FormInput.d.ts.map +1 -1
- package/FormInput/FormInput.js +29 -26
- package/FormInput/FormInput.js.map +1 -1
- package/FormSelect/FormSelect.d.ts.map +1 -1
- package/FormSelect/FormSelect.js +30 -26
- package/FormSelect/FormSelect.js.map +1 -1
- package/FormSelect/FormSelect.types.d.ts +4 -2
- package/FormSelect/FormSelect.types.d.ts.map +1 -1
- package/Input/Input.types.d.ts +2 -0
- package/Input/Input.types.d.ts.map +1 -1
- package/Search/Search.d.ts.map +1 -1
- package/Search/Search.js +35 -33
- package/Search/Search.js.map +1 -1
- package/Select/Select.d.ts.map +1 -1
- package/Select/Select.js +23 -23
- package/Select/Select.js.map +1 -1
- package/Select/SelectRoot.d.ts +2 -1
- package/Select/SelectRoot.d.ts.map +1 -1
- package/Select/SelectRoot.js +59 -57
- package/Select/SelectRoot.js.map +1 -1
- package/Toast/Toast.d.ts +1 -1
- package/Toast/toastVariants.d.ts +1 -1
- package/index.js +325 -324
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,300 @@
|
|
|
1
|
+
## 0.1.11-0 (2025-12-26)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **Button:** enhance button component with new variants, adornments, and improved props ([0d373b8](https://github.com/oneplatformdev/core-web/commit/0d373b8))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated @oneplatformdev/utils to 0.1.1-170
|
|
10
|
+
- Updated @oneplatformdev/hooks to 0.1.0-156
|
|
11
|
+
- Updated @oneplatformdev/tokens to 0.0.1-143
|
|
12
|
+
|
|
13
|
+
### ❤️ Thank You
|
|
14
|
+
|
|
15
|
+
- Bohdan Radchenko
|
|
16
|
+
|
|
17
|
+
## 0.1.10-120 (2025-12-26)
|
|
18
|
+
|
|
19
|
+
### 🚀 Features
|
|
20
|
+
|
|
21
|
+
- enhance FormSelect with onChangePrepare and updated onChange signature ([3b4402b](https://github.com/oneplatformdev/core-web/commit/3b4402b))
|
|
22
|
+
|
|
23
|
+
### 🩹 Fixes
|
|
24
|
+
|
|
25
|
+
- **FormSelect:** ensure default value is an empty string when undefined ([056631f](https://github.com/oneplatformdev/core-web/commit/056631f))
|
|
26
|
+
- update icon size for large button variant ([1e7c0a7](https://github.com/oneplatformdev/core-web/commit/1e7c0a7))
|
|
27
|
+
- add min-width to large button variant ([e34bc71](https://github.com/oneplatformdev/core-web/commit/e34bc71))
|
|
28
|
+
- handle undefined value in FormSelect component ([9c7ae4a](https://github.com/oneplatformdev/core-web/commit/9c7ae4a))
|
|
29
|
+
- minor alert dialog content ([#41](https://github.com/oneplatformdev/core-web/pull/41))
|
|
30
|
+
- update Dialog component title font size for better readability and add .env to .gitignore ([9646134](https://github.com/oneplatformdev/core-web/commit/9646134))
|
|
31
|
+
- adjust Dialog component styling for better alignment and update container size in CSS ([afaa5af](https://github.com/oneplatformdev/core-web/commit/afaa5af))
|
|
32
|
+
- update XIcon styling in Dialog component for improved visibility ([164338b](https://github.com/oneplatformdev/core-web/commit/164338b))
|
|
33
|
+
- update dialog primitive close ([5e7c577](https://github.com/oneplatformdev/core-web/commit/5e7c577))
|
|
34
|
+
- update dialog primitive close ([560b5ba](https://github.com/oneplatformdev/core-web/commit/560b5ba))
|
|
35
|
+
- update dialog primitive close ([f63b143](https://github.com/oneplatformdev/core-web/commit/f63b143))
|
|
36
|
+
|
|
37
|
+
### 🧱 Updated Dependencies
|
|
38
|
+
|
|
39
|
+
- Updated @oneplatformdev/utils to 0.1.1-169
|
|
40
|
+
- Updated @oneplatformdev/hooks to 0.1.0-155
|
|
41
|
+
- Updated @oneplatformdev/tokens to 0.0.1-142
|
|
42
|
+
|
|
43
|
+
### ❤️ Thank You
|
|
44
|
+
|
|
45
|
+
- Bohdan Radchenko @BohdanRadchenko
|
|
46
|
+
- BohdanRadchenko
|
|
47
|
+
|
|
48
|
+
## 0.1.10-118 (2025-12-23)
|
|
49
|
+
|
|
50
|
+
### 🧱 Updated Dependencies
|
|
51
|
+
|
|
52
|
+
- Updated @oneplatformdev/utils to 0.1.1-167
|
|
53
|
+
- Updated @oneplatformdev/hooks to 0.1.0-153
|
|
54
|
+
- Updated @oneplatformdev/tokens to 0.0.1-140
|
|
55
|
+
|
|
56
|
+
## 0.1.10-117 (2025-12-23)
|
|
57
|
+
|
|
58
|
+
### 🧱 Updated Dependencies
|
|
59
|
+
|
|
60
|
+
- Updated @oneplatformdev/utils to 0.1.1-166
|
|
61
|
+
- Updated @oneplatformdev/hooks to 0.1.0-152
|
|
62
|
+
- Updated @oneplatformdev/tokens to 0.0.1-139
|
|
63
|
+
|
|
64
|
+
## 0.1.10-116 (2025-12-23)
|
|
65
|
+
|
|
66
|
+
### 🧱 Updated Dependencies
|
|
67
|
+
|
|
68
|
+
- Updated @oneplatformdev/utils to 0.1.1-165
|
|
69
|
+
- Updated @oneplatformdev/hooks to 0.1.0-151
|
|
70
|
+
- Updated @oneplatformdev/tokens to 0.0.1-138
|
|
71
|
+
|
|
72
|
+
## 0.1.10-115 (2025-12-18)
|
|
73
|
+
|
|
74
|
+
### 🧱 Updated Dependencies
|
|
75
|
+
|
|
76
|
+
- Updated @oneplatformdev/utils to 0.1.1-164
|
|
77
|
+
- Updated @oneplatformdev/hooks to 0.1.0-150
|
|
78
|
+
- Updated @oneplatformdev/tokens to 0.0.1-137
|
|
79
|
+
|
|
80
|
+
## 0.1.10-114 (2025-12-18)
|
|
81
|
+
|
|
82
|
+
### 🩹 Fixes
|
|
83
|
+
|
|
84
|
+
- update icon size for large button variant ([1e7c0a7](https://github.com/oneplatformdev/core-web/commit/1e7c0a7))
|
|
85
|
+
|
|
86
|
+
### 🧱 Updated Dependencies
|
|
87
|
+
|
|
88
|
+
- Updated @oneplatformdev/utils to 0.1.1-163
|
|
89
|
+
- Updated @oneplatformdev/hooks to 0.1.0-149
|
|
90
|
+
- Updated @oneplatformdev/tokens to 0.0.1-136
|
|
91
|
+
|
|
92
|
+
### ❤️ Thank You
|
|
93
|
+
|
|
94
|
+
- Bohdan Radchenko
|
|
95
|
+
|
|
96
|
+
## 0.1.10-113 (2025-12-18)
|
|
97
|
+
|
|
98
|
+
### 🩹 Fixes
|
|
99
|
+
|
|
100
|
+
- add min-width to large button variant ([e34bc71](https://github.com/oneplatformdev/core-web/commit/e34bc71))
|
|
101
|
+
- handle undefined value in FormSelect component ([9c7ae4a](https://github.com/oneplatformdev/core-web/commit/9c7ae4a))
|
|
102
|
+
|
|
103
|
+
### 🧱 Updated Dependencies
|
|
104
|
+
|
|
105
|
+
- Updated @oneplatformdev/utils to 0.1.1-162
|
|
106
|
+
- Updated @oneplatformdev/hooks to 0.1.0-148
|
|
107
|
+
- Updated @oneplatformdev/tokens to 0.0.1-135
|
|
108
|
+
|
|
109
|
+
### ❤️ Thank You
|
|
110
|
+
|
|
111
|
+
- Bohdan Radchenko
|
|
112
|
+
|
|
113
|
+
## 0.1.10-112 (2025-12-17)
|
|
114
|
+
|
|
115
|
+
### 🧱 Updated Dependencies
|
|
116
|
+
|
|
117
|
+
- Updated @oneplatformdev/utils to 0.1.1-161
|
|
118
|
+
- Updated @oneplatformdev/hooks to 0.1.0-147
|
|
119
|
+
- Updated @oneplatformdev/tokens to 0.0.1-134
|
|
120
|
+
|
|
121
|
+
## 0.1.10-111 (2025-12-17)
|
|
122
|
+
|
|
123
|
+
### 🩹 Fixes
|
|
124
|
+
|
|
125
|
+
- minor alert dialog content ([#41](https://github.com/oneplatformdev/core-web/pull/41))
|
|
126
|
+
|
|
127
|
+
### 🧱 Updated Dependencies
|
|
128
|
+
|
|
129
|
+
- Updated @oneplatformdev/utils to 0.1.1-160
|
|
130
|
+
- Updated @oneplatformdev/hooks to 0.1.0-146
|
|
131
|
+
- Updated @oneplatformdev/tokens to 0.0.1-133
|
|
132
|
+
|
|
133
|
+
### ❤️ Thank You
|
|
134
|
+
|
|
135
|
+
- Bohdan Radchenko @BohdanRadchenko
|
|
136
|
+
|
|
137
|
+
## 0.1.10-110 (2025-12-15)
|
|
138
|
+
|
|
139
|
+
### 🩹 Fixes
|
|
140
|
+
|
|
141
|
+
- simplify AlertDialog component structure and improve styling ([e27bb84](https://github.com/oneplatformdev/core-web/commit/e27bb84))
|
|
142
|
+
|
|
143
|
+
### 🧱 Updated Dependencies
|
|
144
|
+
|
|
145
|
+
- Updated @oneplatformdev/utils to 0.1.1-159
|
|
146
|
+
- Updated @oneplatformdev/hooks to 0.1.0-145
|
|
147
|
+
- Updated @oneplatformdev/tokens to 0.0.1-132
|
|
148
|
+
|
|
149
|
+
### ❤️ Thank You
|
|
150
|
+
|
|
151
|
+
- Bohdan Radchenko
|
|
152
|
+
|
|
153
|
+
## 0.1.10-109 (2025-12-15)
|
|
154
|
+
|
|
155
|
+
### 🧱 Updated Dependencies
|
|
156
|
+
|
|
157
|
+
- Updated @oneplatformdev/utils to 0.1.1-158
|
|
158
|
+
- Updated @oneplatformdev/hooks to 0.1.0-144
|
|
159
|
+
- Updated @oneplatformdev/tokens to 0.0.1-131
|
|
160
|
+
|
|
161
|
+
## 0.1.10-108 (2025-12-15)
|
|
162
|
+
|
|
163
|
+
### 🧱 Updated Dependencies
|
|
164
|
+
|
|
165
|
+
- Updated @oneplatformdev/utils to 0.1.1-157
|
|
166
|
+
- Updated @oneplatformdev/hooks to 0.1.0-143
|
|
167
|
+
- Updated @oneplatformdev/tokens to 0.0.1-130
|
|
168
|
+
|
|
169
|
+
## 0.1.10-107 (2025-12-15)
|
|
170
|
+
|
|
171
|
+
### 🧱 Updated Dependencies
|
|
172
|
+
|
|
173
|
+
- Updated @oneplatformdev/utils to 0.1.1-156
|
|
174
|
+
- Updated @oneplatformdev/hooks to 0.1.0-142
|
|
175
|
+
- Updated @oneplatformdev/tokens to 0.0.1-129
|
|
176
|
+
|
|
177
|
+
## 0.1.10-106 (2025-12-15)
|
|
178
|
+
|
|
179
|
+
### 🧱 Updated Dependencies
|
|
180
|
+
|
|
181
|
+
- Updated @oneplatformdev/utils to 0.1.1-155
|
|
182
|
+
- Updated @oneplatformdev/hooks to 0.1.0-141
|
|
183
|
+
- Updated @oneplatformdev/tokens to 0.0.1-128
|
|
184
|
+
|
|
185
|
+
## 0.1.10-105 (2025-12-15)
|
|
186
|
+
|
|
187
|
+
### 🧱 Updated Dependencies
|
|
188
|
+
|
|
189
|
+
- Updated @oneplatformdev/utils to 0.1.1-154
|
|
190
|
+
- Updated @oneplatformdev/hooks to 0.1.0-140
|
|
191
|
+
- Updated @oneplatformdev/tokens to 0.0.1-127
|
|
192
|
+
|
|
193
|
+
## 0.1.10-104 (2025-12-08)
|
|
194
|
+
|
|
195
|
+
### 🩹 Fixes
|
|
196
|
+
|
|
197
|
+
- update Dialog component title font size for better readability and add .env to .gitignore ([9646134](https://github.com/oneplatformdev/core-web/commit/9646134))
|
|
198
|
+
- adjust Dialog component styling for better alignment and update container size in CSS ([afaa5af](https://github.com/oneplatformdev/core-web/commit/afaa5af))
|
|
199
|
+
|
|
200
|
+
### 🧱 Updated Dependencies
|
|
201
|
+
|
|
202
|
+
- Updated @oneplatformdev/utils to 0.1.1-153
|
|
203
|
+
- Updated @oneplatformdev/hooks to 0.1.0-139
|
|
204
|
+
- Updated @oneplatformdev/tokens to 0.0.1-126
|
|
205
|
+
|
|
206
|
+
### ❤️ Thank You
|
|
207
|
+
|
|
208
|
+
- Bohdan Radchenko
|
|
209
|
+
|
|
210
|
+
## 0.1.10-103 (2025-12-04)
|
|
211
|
+
|
|
212
|
+
### 🩹 Fixes
|
|
213
|
+
|
|
214
|
+
- update XIcon styling in Dialog component for improved visibility ([164338b](https://github.com/oneplatformdev/core-web/commit/164338b))
|
|
215
|
+
|
|
216
|
+
### 🧱 Updated Dependencies
|
|
217
|
+
|
|
218
|
+
- Updated @oneplatformdev/utils to 0.1.1-152
|
|
219
|
+
- Updated @oneplatformdev/hooks to 0.1.0-138
|
|
220
|
+
- Updated @oneplatformdev/tokens to 0.0.1-125
|
|
221
|
+
|
|
222
|
+
### ❤️ Thank You
|
|
223
|
+
|
|
224
|
+
- Bohdan Radchenko
|
|
225
|
+
|
|
226
|
+
## 0.1.10-102 (2025-12-03)
|
|
227
|
+
|
|
228
|
+
### 🚀 Features
|
|
229
|
+
|
|
230
|
+
- enhance FormSelect with onChangePrepare and updated onChange signature ([3b4402b](https://github.com/oneplatformdev/core-web/commit/3b4402b))
|
|
231
|
+
|
|
232
|
+
### 🧱 Updated Dependencies
|
|
233
|
+
|
|
234
|
+
- Updated @oneplatformdev/utils to 0.1.1-151
|
|
235
|
+
- Updated @oneplatformdev/hooks to 0.1.0-137
|
|
236
|
+
- Updated @oneplatformdev/tokens to 0.0.1-124
|
|
237
|
+
|
|
238
|
+
### ❤️ Thank You
|
|
239
|
+
|
|
240
|
+
- Bohdan Radchenko
|
|
241
|
+
|
|
242
|
+
## 0.1.10-101 (2025-12-03)
|
|
243
|
+
|
|
244
|
+
### 🧱 Updated Dependencies
|
|
245
|
+
|
|
246
|
+
- Updated @oneplatformdev/utils to 0.1.1-150
|
|
247
|
+
- Updated @oneplatformdev/hooks to 0.1.0-136
|
|
248
|
+
- Updated @oneplatformdev/tokens to 0.0.1-123
|
|
249
|
+
|
|
250
|
+
## 0.1.10-100 (2025-12-03)
|
|
251
|
+
|
|
252
|
+
### 🧱 Updated Dependencies
|
|
253
|
+
|
|
254
|
+
- Updated @oneplatformdev/utils to 0.1.1-149
|
|
255
|
+
- Updated @oneplatformdev/hooks to 0.1.0-135
|
|
256
|
+
- Updated @oneplatformdev/tokens to 0.0.1-122
|
|
257
|
+
|
|
258
|
+
## 0.1.10-99 (2025-12-03)
|
|
259
|
+
|
|
260
|
+
### 🧱 Updated Dependencies
|
|
261
|
+
|
|
262
|
+
- Updated @oneplatformdev/utils to 0.1.1-148
|
|
263
|
+
- Updated @oneplatformdev/hooks to 0.1.0-134
|
|
264
|
+
- Updated @oneplatformdev/tokens to 0.0.1-121
|
|
265
|
+
|
|
266
|
+
## 0.1.10-98 (2025-12-03)
|
|
267
|
+
|
|
268
|
+
### 🧱 Updated Dependencies
|
|
269
|
+
|
|
270
|
+
- Updated @oneplatformdev/utils to 0.1.1-147
|
|
271
|
+
- Updated @oneplatformdev/hooks to 0.1.0-133
|
|
272
|
+
- Updated @oneplatformdev/tokens to 0.0.1-120
|
|
273
|
+
|
|
274
|
+
## 0.1.10-97 (2025-12-03)
|
|
275
|
+
|
|
276
|
+
### 🧱 Updated Dependencies
|
|
277
|
+
|
|
278
|
+
- Updated @oneplatformdev/utils to 0.1.1-146
|
|
279
|
+
- Updated @oneplatformdev/hooks to 0.1.0-132
|
|
280
|
+
- Updated @oneplatformdev/tokens to 0.0.1-119
|
|
281
|
+
|
|
282
|
+
## 0.1.10-96 (2025-11-25)
|
|
283
|
+
|
|
284
|
+
### 🧱 Updated Dependencies
|
|
285
|
+
|
|
286
|
+
- Updated @oneplatformdev/utils to 0.1.1-145
|
|
287
|
+
- Updated @oneplatformdev/hooks to 0.1.0-131
|
|
288
|
+
- Updated @oneplatformdev/tokens to 0.0.1-118
|
|
289
|
+
|
|
290
|
+
## 0.1.10-95 (2025-11-25)
|
|
291
|
+
|
|
292
|
+
### 🧱 Updated Dependencies
|
|
293
|
+
|
|
294
|
+
- Updated @oneplatformdev/utils to 0.1.1-144
|
|
295
|
+
- Updated @oneplatformdev/hooks to 0.1.0-130
|
|
296
|
+
- Updated @oneplatformdev/tokens to 0.0.1-117
|
|
297
|
+
|
|
1
298
|
## 0.1.10-94 (2025-11-25)
|
|
2
299
|
|
|
3
300
|
### 🧱 Updated Dependencies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../src/Combobox/Combobox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../src/Combobox/Combobox.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAGL,aAAa,EACd,MAAM,kBAAkB,CAAC;AAqB1B,eAAO,MAAM,QAAQ,0GA+PpB,CAAC"}
|
package/Combobox/Combobox.js
CHANGED
|
@@ -1,173 +1,174 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { LoadingMask as
|
|
1
|
+
import { jsx as e, jsxs as d, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as oe, useState as s, useCallback as p, useEffect as re, useMemo as M, useLayoutEffect as ae } from "react";
|
|
3
|
+
import { LoadingMask as V } from "../LoadingMask/LoadingMask.js";
|
|
4
4
|
import "../LoadingMask/RenderLoadingMask.js";
|
|
5
|
-
import { Popover as
|
|
5
|
+
import { Popover as ie, PopoverTrigger as se, PopoverContent as le } from "../Popover/Popover.js";
|
|
6
6
|
import { Button as ce } from "../Button/Button.js";
|
|
7
7
|
import "../Button/buttonVariants.js";
|
|
8
|
-
import { Command as de, CommandInput as pe, CommandList as
|
|
9
|
-
import { cn as
|
|
8
|
+
import { Command as de, CommandInput as pe, CommandList as me, CommandGroup as fe, CommandEmpty as X, CommandItem as ue } from "../Command/Command.js";
|
|
9
|
+
import { cn as R } from "@oneplatformdev/utils";
|
|
10
10
|
import { useDebounceCallback as he } from "@oneplatformdev/hooks";
|
|
11
11
|
import { X as ge, ChevronsUpDown as be } from "lucide-react";
|
|
12
12
|
import { ComboboxOptions as ve } from "./ComboboxOptions.js";
|
|
13
|
-
const
|
|
14
|
-
const { value:
|
|
15
|
-
if (!
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
}, Ee =
|
|
19
|
-
(S,
|
|
13
|
+
const ye = (S) => {
|
|
14
|
+
const { value: m, flattenOptions: n = [], selectedOption: L } = S;
|
|
15
|
+
if (!m) return "No value for render label";
|
|
16
|
+
const y = [n.find((f) => String(f.value).toLowerCase() === String(m).toLowerCase()), L].filter(Boolean).map((f) => f.label).find(Boolean);
|
|
17
|
+
return y || m;
|
|
18
|
+
}, Ee = oe(
|
|
19
|
+
(S, m) => {
|
|
20
20
|
const {
|
|
21
21
|
value: n,
|
|
22
|
-
onChange:
|
|
22
|
+
onChange: L,
|
|
23
23
|
placeholder: T,
|
|
24
|
-
disabled:
|
|
25
|
-
searchLabel:
|
|
26
|
-
fetchOptions:
|
|
27
|
-
options:
|
|
24
|
+
disabled: y,
|
|
25
|
+
searchLabel: f = "Type to search...",
|
|
26
|
+
fetchOptions: _,
|
|
27
|
+
options: N,
|
|
28
28
|
emptyLabel: A = "No options",
|
|
29
|
-
emptyAction:
|
|
29
|
+
emptyAction: C,
|
|
30
30
|
commandInputAction: I,
|
|
31
31
|
listHeadAction: w,
|
|
32
32
|
onMount: k
|
|
33
|
-
} = S,
|
|
34
|
-
const b = (
|
|
35
|
-
const
|
|
33
|
+
} = S, [F, z] = s(!1), [l, B] = s(!1), [a, P] = s(""), [u, D] = s(), [o, c] = s(!1), [r, J] = s([]), [K, Q] = s([]), h = p((t) => {
|
|
34
|
+
const b = (E) => {
|
|
35
|
+
const i = [], H = (x) => {
|
|
36
36
|
if (x)
|
|
37
37
|
for (const v of x)
|
|
38
|
-
|
|
38
|
+
i.push(v), v.items && v.items.length && H(v.items);
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
if (!
|
|
42
|
-
const O =
|
|
43
|
-
if (O) return [O, ...
|
|
40
|
+
H(E), Q((x) => {
|
|
41
|
+
if (!i.find((O) => !!n && String(O.value) === String(n))) {
|
|
42
|
+
const O = u || x.find((ne) => !!n && String(ne.value) === String(n));
|
|
43
|
+
if (O) return [O, ...i];
|
|
44
44
|
}
|
|
45
|
-
return
|
|
45
|
+
return i;
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
return b(
|
|
48
|
+
J((E) => {
|
|
49
|
+
const i = typeof t == "function" ? t(E) : t;
|
|
50
|
+
return b(i), i;
|
|
51
51
|
});
|
|
52
|
-
}, [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}, [
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
52
|
+
}, [u, n]);
|
|
53
|
+
re(() => {
|
|
54
|
+
N?.length && h(N);
|
|
55
|
+
}, [N]);
|
|
56
|
+
const Y = async () => {
|
|
57
|
+
l || (G(), P(""));
|
|
58
|
+
}, G = p(async (t) => {
|
|
59
|
+
c(!0);
|
|
60
60
|
try {
|
|
61
|
-
const b = await
|
|
61
|
+
const b = await _(t);
|
|
62
62
|
h(b);
|
|
63
63
|
} catch (b) {
|
|
64
64
|
console.error("Unexpected error while get option:", b);
|
|
65
65
|
} finally {
|
|
66
|
-
|
|
66
|
+
c(!1);
|
|
67
67
|
}
|
|
68
|
-
}, [h]),
|
|
68
|
+
}, [h]), Z = he(G, 1e3, {
|
|
69
69
|
leading: !1,
|
|
70
70
|
trailing: !0
|
|
71
|
-
}),
|
|
72
|
-
|
|
73
|
-
}, []),
|
|
74
|
-
|
|
75
|
-
}, []),
|
|
76
|
-
|
|
77
|
-
}, []),
|
|
71
|
+
}), $ = p((t) => {
|
|
72
|
+
c(!0), P(t), Z(t);
|
|
73
|
+
}, []), U = p((t) => {
|
|
74
|
+
L(t.value), D(t), c(!1);
|
|
75
|
+
}, []), ee = p(() => {
|
|
76
|
+
U({ value: "", label: "" }), D(void 0), c(!1);
|
|
77
|
+
}, []), W = M(() => !!a && !r.length && !o, [o, r.length, a]), q = M(() => !r.length && !o, [o, r.length, a]), g = M(() => ({
|
|
78
78
|
options: r,
|
|
79
79
|
setOptions: h,
|
|
80
|
-
selectedOption:
|
|
81
|
-
setSelectedOption:
|
|
80
|
+
selectedOption: u,
|
|
81
|
+
setSelectedOption: D,
|
|
82
82
|
search: a || "",
|
|
83
|
-
setSearch:
|
|
84
|
-
open:
|
|
85
|
-
setOpen:
|
|
83
|
+
setSearch: P,
|
|
84
|
+
open: l,
|
|
85
|
+
setOpen: B,
|
|
86
86
|
loading: o,
|
|
87
|
-
setLoading:
|
|
88
|
-
isEmptyList:
|
|
89
|
-
isSearchedEmptyList:
|
|
90
|
-
}), [o,
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
setLoading: c,
|
|
88
|
+
isEmptyList: q,
|
|
89
|
+
isSearchedEmptyList: W
|
|
90
|
+
}), [o, l, r, a, u, q, W, h]), te = p(async () => {
|
|
91
|
+
if (k) {
|
|
92
|
+
z(!0);
|
|
93
|
+
try {
|
|
94
|
+
await k(g);
|
|
95
|
+
} finally {
|
|
96
|
+
z(!1);
|
|
97
|
+
}
|
|
94
98
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
|
|
100
|
-
B.current = !1;
|
|
101
|
-
}), []), /* @__PURE__ */ t("div", { className: "w-full", ref: u, children: /* @__PURE__ */ c(
|
|
102
|
-
se,
|
|
99
|
+
}, [k, g]);
|
|
100
|
+
return ae(() => {
|
|
101
|
+
te();
|
|
102
|
+
}, []), /* @__PURE__ */ e("div", { className: "w-full", ref: m, children: /* @__PURE__ */ d(
|
|
103
|
+
ie,
|
|
103
104
|
{
|
|
104
|
-
open:
|
|
105
|
-
onOpenChange: (
|
|
106
|
-
|
|
105
|
+
open: l,
|
|
106
|
+
onOpenChange: (t) => {
|
|
107
|
+
B(t), t && Y();
|
|
107
108
|
},
|
|
108
109
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ e(se, { asChild: !0, className: "border-input", children: /* @__PURE__ */ e(
|
|
110
111
|
ce,
|
|
111
112
|
{
|
|
112
113
|
variant: "outline",
|
|
113
114
|
role: "combobox",
|
|
114
115
|
size: "lg",
|
|
115
|
-
"aria-expanded":
|
|
116
|
-
className:
|
|
117
|
-
"w-full justify-between font-normal text-sm bg-transparent relative p-3",
|
|
116
|
+
"aria-expanded": l,
|
|
117
|
+
className: R(
|
|
118
|
+
"relative w-full justify-between font-normal text-sm bg-transparent relative p-3",
|
|
118
119
|
"border border-border",
|
|
119
|
-
|
|
120
|
+
l && "border-2 outline-hidden ring-1 ring-ring",
|
|
120
121
|
"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"
|
|
121
122
|
),
|
|
122
|
-
disabled:
|
|
123
|
-
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
n ? /* @__PURE__ */
|
|
123
|
+
disabled: y || F,
|
|
124
|
+
children: F ? /* @__PURE__ */ e(V, { fullWidth: !0 }) : /* @__PURE__ */ d(j, { children: [
|
|
125
|
+
/* @__PURE__ */ e("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: n ? ye({ value: n, flattenOptions: K, selectedOption: u }) : /* @__PURE__ */ e("span", { className: "text-gray-400", children: T }) }),
|
|
126
|
+
n ? /* @__PURE__ */ e(
|
|
126
127
|
"div",
|
|
127
128
|
{
|
|
128
|
-
className:
|
|
129
|
+
className: R(
|
|
129
130
|
"absolute top-0 right-1",
|
|
130
131
|
"flex items-center justify-center",
|
|
131
132
|
"w-9 aspect-square [&_svg]:size-5",
|
|
132
133
|
"opacity-50 cursor-pointer hover:opacity-100"
|
|
133
134
|
),
|
|
134
|
-
onClick: (
|
|
135
|
-
|
|
135
|
+
onClick: (t) => {
|
|
136
|
+
t.stopPropagation(), ee();
|
|
136
137
|
},
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
+
children: /* @__PURE__ */ e(ge, {})
|
|
138
139
|
}
|
|
139
|
-
) : /* @__PURE__ */
|
|
140
|
-
]
|
|
140
|
+
) : /* @__PURE__ */ e(be, { className: "opacity-50 w-4 h-4" })
|
|
141
|
+
] })
|
|
141
142
|
}
|
|
142
143
|
) }),
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ e(
|
|
144
145
|
le,
|
|
145
146
|
{
|
|
146
147
|
className: "w-(--radix-popper-anchor-width) max-w-none p-0",
|
|
147
148
|
align: "start",
|
|
148
|
-
children: /* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
149
|
+
children: /* @__PURE__ */ d(de, { shouldFilter: !1, children: [
|
|
150
|
+
/* @__PURE__ */ e(
|
|
150
151
|
pe,
|
|
151
152
|
{
|
|
152
|
-
placeholder:
|
|
153
|
+
placeholder: f,
|
|
153
154
|
value: a,
|
|
154
|
-
onValueChange:
|
|
155
|
+
onValueChange: $
|
|
155
156
|
}
|
|
156
157
|
),
|
|
157
158
|
typeof I == "function" ? I(g) : I,
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
|
|
159
|
+
/* @__PURE__ */ e(me, { children: /* @__PURE__ */ d(
|
|
160
|
+
fe,
|
|
160
161
|
{
|
|
161
|
-
className:
|
|
162
|
+
className: R(!r.length && "p-0 shadow-none"),
|
|
162
163
|
children: [
|
|
163
|
-
o && /* @__PURE__ */
|
|
164
|
-
!o && !!a && /* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
typeof
|
|
167
|
-
] }) : /* @__PURE__ */
|
|
168
|
-
!o && /* @__PURE__ */
|
|
169
|
-
!!r.length && w && /* @__PURE__ */
|
|
170
|
-
|
|
164
|
+
o && /* @__PURE__ */ e(V, { fullWidth: !0 }),
|
|
165
|
+
!o && !!a && /* @__PURE__ */ e(j, { children: C ? /* @__PURE__ */ d(X, { className: "flex flex-col gap-3 py-5 px-3 items-center", children: [
|
|
166
|
+
/* @__PURE__ */ e("span", { children: A }),
|
|
167
|
+
typeof C == "function" ? C(g) : C
|
|
168
|
+
] }) : /* @__PURE__ */ e(X, { children: A }) }),
|
|
169
|
+
!o && /* @__PURE__ */ d(j, { children: [
|
|
170
|
+
!!r.length && w && /* @__PURE__ */ e(
|
|
171
|
+
ue,
|
|
171
172
|
{
|
|
172
173
|
asChild: !0,
|
|
173
174
|
className: "w-full",
|
|
@@ -175,13 +176,13 @@ const Ce = (S) => {
|
|
|
175
176
|
},
|
|
176
177
|
"combobox-list-head-action"
|
|
177
178
|
),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ e(
|
|
179
180
|
ve,
|
|
180
181
|
{
|
|
181
182
|
value: n,
|
|
182
183
|
options: r,
|
|
183
|
-
onChangeOption:
|
|
184
|
-
setOpen:
|
|
184
|
+
onChangeOption: U,
|
|
185
|
+
setOpen: B
|
|
185
186
|
}
|
|
186
187
|
)
|
|
187
188
|
] })
|