shirkasoft-ui-components 1.14.0 → 2.0.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/README.md +4 -8
- package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +189 -100
- package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-button.mjs +363 -69
- package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-chart.mjs +206 -142
- package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-config.mjs +905 -843
- package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +307 -142
- package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs +1624 -1440
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-fieldset.mjs +347 -92
- package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-file-upload.mjs +484 -300
- package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-icons.mjs +1028 -533
- package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-knob.mjs +389 -201
- package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-loading.mjs +505 -128
- package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-modal.mjs +311 -314
- package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-notification.mjs +188 -142
- package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-price-input.mjs +517 -327
- package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +669 -289
- package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-select.mjs +1014 -819
- package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-sidebar.mjs +508 -184
- package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-skeleton.mjs +197 -57
- package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-table.mjs +1916 -1698
- package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-tabs.mjs +419 -175
- package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-tag.mjs +175 -49
- package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-text-field.mjs +687 -402
- package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +310 -124
- package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-theme.mjs +141 -174
- package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-timeline.mjs +791 -203
- package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-toggle.mjs +179 -109
- package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-tooltip.mjs +244 -180
- package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-utils.mjs +95 -134
- package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-wizard.mjs +673 -165
- package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components.mjs +0 -9
- package/package.json +5 -5
- package/types/shirkasoft-ui-components-breadcrumb.d.ts +59 -44
- package/types/shirkasoft-ui-components-button.d.ts +142 -49
- package/types/shirkasoft-ui-components-chart.d.ts +59 -44
- package/types/shirkasoft-ui-components-config.d.ts +193 -204
- package/types/shirkasoft-ui-components-confirm-dialog.d.ts +107 -66
- package/types/shirkasoft-ui-components-date-picker.d.ts +527 -398
- package/types/shirkasoft-ui-components-fieldset.d.ts +135 -60
- package/types/shirkasoft-ui-components-file-upload.d.ts +176 -112
- package/types/shirkasoft-ui-components-icons.d.ts +1302 -1294
- package/types/shirkasoft-ui-components-knob.d.ts +144 -78
- package/types/shirkasoft-ui-components-loading.d.ts +155 -64
- package/types/shirkasoft-ui-components-modal.d.ts +134 -136
- package/types/shirkasoft-ui-components-notification.d.ts +63 -59
- package/types/shirkasoft-ui-components-price-input.d.ts +198 -113
- package/types/shirkasoft-ui-components-rail-sidebar.d.ts +262 -142
- package/types/shirkasoft-ui-components-select.d.ts +301 -196
- package/types/shirkasoft-ui-components-sidebar.d.ts +198 -93
- package/types/shirkasoft-ui-components-skeleton.d.ts +68 -27
- package/types/shirkasoft-ui-components-table.d.ts +849 -660
- package/types/shirkasoft-ui-components-tabs.d.ts +102 -61
- package/types/shirkasoft-ui-components-tag.d.ts +54 -23
- package/types/shirkasoft-ui-components-text-field.d.ts +231 -127
- package/types/shirkasoft-ui-components-theme-picker.d.ts +92 -58
- package/types/shirkasoft-ui-components-theme.d.ts +56 -64
- package/types/shirkasoft-ui-components-timeline.d.ts +325 -150
- package/types/shirkasoft-ui-components-toggle.d.ts +73 -49
- package/types/shirkasoft-ui-components-tooltip.d.ts +64 -43
- package/types/shirkasoft-ui-components-utils.d.ts +15 -16
- package/types/shirkasoft-ui-components-wizard.d.ts +236 -87
- package/types/shirkasoft-ui-components.d.ts +1 -2
- package/fesm2022/shirkasoft-ui-components.mjs.map +0 -1
|
@@ -1,820 +1,1015 @@
|
|
|
1
|
-
import { CommonModule } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { takeUntilDestroyed } from
|
|
6
|
-
import * as i1 from
|
|
7
|
-
import {
|
|
8
|
-
import { LucideChevronDown, ShkIconDirective } from
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
1
|
+
import { CommonModule } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, HostListener, computed, effect, forwardRef, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
4
|
+
import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from "@angular/forms";
|
|
5
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
6
|
+
import * as i1 from "@jsverse/transloco";
|
|
7
|
+
import { TranslocoModule, TranslocoService } from "@jsverse/transloco";
|
|
8
|
+
import { LucideChevronDown, ShkIconDirective } from "shirkasoft-ui-components/icons";
|
|
9
|
+
import { PortalDirective, getIcon } from "shirkasoft-ui-components/utils";
|
|
10
|
+
var SelectComponent = class SelectComponent {
|
|
11
|
+
get _value() {
|
|
12
|
+
return this.value;
|
|
13
|
+
}
|
|
14
|
+
static {
|
|
15
|
+
this.DROPDOWN_MAX_HEIGHT = 240;
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.OPTION_HEIGHT = 40;
|
|
19
|
+
}
|
|
20
|
+
dropdownHeight() {
|
|
21
|
+
const max = SelectComponent.DROPDOWN_MAX_HEIGHT;
|
|
22
|
+
const panel = this.dropdownContainer()?.nativeElement;
|
|
23
|
+
if (panel && panel.offsetHeight > 0) return Math.min(panel.offsetHeight, max);
|
|
24
|
+
const rows = this.regularOptions().length + (this.showCustomOption() ? 1 : 0);
|
|
25
|
+
return Math.min(Math.max(rows, 1) * SelectComponent.OPTION_HEIGHT + 2, max);
|
|
26
|
+
}
|
|
27
|
+
computeDropdownPosition() {
|
|
28
|
+
const trigger = this.selectTrigger()?.nativeElement;
|
|
29
|
+
if (!trigger) return;
|
|
30
|
+
const rect = trigger.getBoundingClientRect();
|
|
31
|
+
const height = this.dropdownHeight();
|
|
32
|
+
const opensUpward = this.dropdownUpward();
|
|
33
|
+
const inModal = !!trigger.closest("shk-modal");
|
|
34
|
+
let top;
|
|
35
|
+
if (opensUpward) {
|
|
36
|
+
top = rect.top - height - 4;
|
|
37
|
+
if (top < 8) top = 8;
|
|
38
|
+
} else {
|
|
39
|
+
top = rect.bottom + 4;
|
|
40
|
+
if (!inModal && top + height > window.innerHeight - 8 && rect.top - height - 4 >= 8) top = rect.top - height - 4;
|
|
41
|
+
}
|
|
42
|
+
this.dropdownPosition.set({
|
|
43
|
+
top,
|
|
44
|
+
left: rect.left,
|
|
45
|
+
width: rect.width
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
constructor(elementRef) {
|
|
49
|
+
this.elementRef = elementRef;
|
|
50
|
+
this.getIcon = (name) => getIcon(name, LucideChevronDown);
|
|
51
|
+
this.options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
|
|
52
|
+
this.multiple = input(false, ...ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []);
|
|
53
|
+
this.validCombinations = input(void 0, ...ngDevMode ? [{ debugName: "validCombinations" }] : /* istanbul ignore next */ []);
|
|
54
|
+
this.placeholder = input("Seleccionar...", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
55
|
+
this.label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
56
|
+
this.isLoading = input(false, ...ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []);
|
|
57
|
+
this.isAllDataLoaded = input(false, ...ngDevMode ? [{ debugName: "isAllDataLoaded" }] : /* istanbul ignore next */ []);
|
|
58
|
+
this.allowCustomEntries = input(false, ...ngDevMode ? [{ debugName: "allowCustomEntries" }] : /* istanbul ignore next */ []);
|
|
59
|
+
this.formGroup = input(void 0, ...ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []);
|
|
60
|
+
this.isSearchable = input(false, ...ngDevMode ? [{ debugName: "isSearchable" }] : /* istanbul ignore next */ []);
|
|
61
|
+
this.itemsPerPage = input(10, ...ngDevMode ? [{ debugName: "itemsPerPage" }] : /* istanbul ignore next */ []);
|
|
62
|
+
this.control = input(void 0, ...ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []);
|
|
63
|
+
this.usePagination = input(false, ...ngDevMode ? [{ debugName: "usePagination" }] : /* istanbul ignore next */ []);
|
|
64
|
+
this.disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
65
|
+
this.errorMessages = input({ required: "Este campo es requerido" }, ...ngDevMode ? [{ debugName: "errorMessages" }] : /* istanbul ignore next */ []);
|
|
66
|
+
this.preserveSearchOnLoad = input(false, ...ngDevMode ? [{ debugName: "preserveSearchOnLoad" }] : /* istanbul ignore next */ []);
|
|
67
|
+
this.emptyMessageKey = input("common.no_records", ...ngDevMode ? [{ debugName: "emptyMessageKey" }] : /* istanbul ignore next */ []);
|
|
68
|
+
this.dropdownUpward = input(false, ...ngDevMode ? [{ debugName: "dropdownUpward" }] : /* istanbul ignore next */ []);
|
|
69
|
+
this.showEmptyOption = input(true, ...ngDevMode ? [{ debugName: "showEmptyOption" }] : /* istanbul ignore next */ []);
|
|
70
|
+
this.selectionChange = output();
|
|
71
|
+
this.touch = output();
|
|
72
|
+
this.search = output();
|
|
73
|
+
this.filterInput = viewChild("filterInput", ...ngDevMode ? [{ debugName: "filterInput" }] : /* istanbul ignore next */ []);
|
|
74
|
+
this.selectContainer = viewChild("selectContainer", ...ngDevMode ? [{ debugName: "selectContainer" }] : /* istanbul ignore next */ []);
|
|
75
|
+
this.selectTrigger = viewChild("selectTrigger", ...ngDevMode ? [{ debugName: "selectTrigger" }] : /* istanbul ignore next */ []);
|
|
76
|
+
this.dropdownContainer = viewChild("dropdownContainer", ...ngDevMode ? [{ debugName: "dropdownContainer" }] : /* istanbul ignore next */ []);
|
|
77
|
+
this.value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
78
|
+
this.isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
|
|
79
|
+
this.focusedIndex = signal(-1, ...ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []);
|
|
80
|
+
this.searchTerm = signal("", ...ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []);
|
|
81
|
+
this.currentPage = signal(1, ...ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []);
|
|
82
|
+
this.searchTermChanged = signal(false, ...ngDevMode ? [{ debugName: "searchTermChanged" }] : /* istanbul ignore next */ []);
|
|
83
|
+
this._isDisabled = signal(false, ...ngDevMode ? [{ debugName: "_isDisabled" }] : /* istanbul ignore next */ []);
|
|
84
|
+
this.debounceTimer = null;
|
|
85
|
+
this.errorTracker = signal(0, ...ngDevMode ? [{ debugName: "errorTracker" }] : /* istanbul ignore next */ []);
|
|
86
|
+
this.hadError = signal(false, ...ngDevMode ? [{ debugName: "hadError" }] : /* istanbul ignore next */ []);
|
|
87
|
+
this.subscribed = signal(false, ...ngDevMode ? [{ debugName: "subscribed" }] : /* istanbul ignore next */ []);
|
|
88
|
+
this.valueSubscribed = signal(false, ...ngDevMode ? [{ debugName: "valueSubscribed" }] : /* istanbul ignore next */ []);
|
|
89
|
+
this.isDisabled = computed(() => this.disabled() || this._isDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
90
|
+
this.actualControl = computed(() => {
|
|
91
|
+
const ctrl = this.control();
|
|
92
|
+
if (ctrl) return ctrl;
|
|
93
|
+
const fg = this.formGroup();
|
|
94
|
+
const lbl = this.label();
|
|
95
|
+
if (fg && lbl) return fg.get(lbl);
|
|
96
|
+
}, ...ngDevMode ? [{ debugName: "actualControl" }] : /* istanbul ignore next */ []);
|
|
97
|
+
this.shouldShowError = computed(() => {
|
|
98
|
+
this.errorTracker();
|
|
99
|
+
const ctrl = this.actualControl();
|
|
100
|
+
return ctrl?.invalid && (ctrl?.dirty || ctrl?.touched);
|
|
101
|
+
}, ...ngDevMode ? [{ debugName: "shouldShowError" }] : /* istanbul ignore next */ []);
|
|
102
|
+
this.wasFixedError = computed(() => {
|
|
103
|
+
this.errorTracker();
|
|
104
|
+
const ctrl = this.actualControl();
|
|
105
|
+
return this.hadError() && ctrl?.valid && ctrl?.touched;
|
|
106
|
+
}, ...ngDevMode ? [{ debugName: "wasFixedError" }] : /* istanbul ignore next */ []);
|
|
107
|
+
this.displayValue = computed(() => {
|
|
108
|
+
const val = this._value();
|
|
109
|
+
const opts = this.options();
|
|
110
|
+
const isMultiple = this.multiple();
|
|
111
|
+
const ph = this.placeholder();
|
|
112
|
+
if (!val || Array.isArray(val) && val.length === 0) return ph;
|
|
113
|
+
if (isMultiple) {
|
|
114
|
+
const values = Array.isArray(val) ? val : [];
|
|
115
|
+
const selectedLabels = opts.filter((option) => values.includes(option.value)).map((option) => option.label);
|
|
116
|
+
if (selectedLabels.length === 0) return values.toString();
|
|
117
|
+
return selectedLabels.join(", ");
|
|
118
|
+
}
|
|
119
|
+
const selectedOption = opts.find((opt) => opt.value === val);
|
|
120
|
+
return selectedOption ? selectedOption.label : val;
|
|
121
|
+
}, ...ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []);
|
|
122
|
+
this.getErrorMessages = computed(() => {
|
|
123
|
+
this.errorTracker();
|
|
124
|
+
const ctrl = this.actualControl();
|
|
125
|
+
if (!ctrl?.errors) return [];
|
|
126
|
+
const customErrors = this.errorMessages();
|
|
127
|
+
const t = this.transloco;
|
|
128
|
+
return Object.keys(ctrl.errors).map((errorKey) => {
|
|
129
|
+
if (customErrors[errorKey]) return customErrors[errorKey];
|
|
130
|
+
switch (errorKey) {
|
|
131
|
+
case "required": return t.translate("validation.required");
|
|
132
|
+
case "email": return t.translate("validation.email");
|
|
133
|
+
case "minlength": return t.translate("validation.minlength", { min: ctrl.errors["minlength"].requiredLength });
|
|
134
|
+
case "maxlength": return t.translate("validation.maxlength", { max: ctrl.errors["maxlength"].requiredLength });
|
|
135
|
+
case "pattern": return t.translate("validation.pattern");
|
|
136
|
+
default: return t.translate("validation.invalid");
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}, ...ngDevMode ? [{ debugName: "getErrorMessages" }] : /* istanbul ignore next */ []);
|
|
140
|
+
this.filteredOptions = computed(() => {
|
|
141
|
+
const opts = this.options();
|
|
142
|
+
const term = this.searchTerm();
|
|
143
|
+
if (!term) return opts;
|
|
144
|
+
const normalizedSearchTerm = this.normalizeText(term);
|
|
145
|
+
return opts.filter((option) => this.normalizeText(option.label).includes(normalizedSearchTerm)).sort((a, b) => {
|
|
146
|
+
const aLbl = this.normalizeText(a.label);
|
|
147
|
+
const bLbl = this.normalizeText(b.label);
|
|
148
|
+
const aStarts = aLbl.startsWith(normalizedSearchTerm);
|
|
149
|
+
const bStarts = bLbl.startsWith(normalizedSearchTerm);
|
|
150
|
+
if (aStarts && !bStarts) return -1;
|
|
151
|
+
if (!aStarts && bStarts) return 1;
|
|
152
|
+
return 0;
|
|
153
|
+
});
|
|
154
|
+
}, ...ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []);
|
|
155
|
+
this.paginatedOptions = computed(() => {
|
|
156
|
+
let filtered = this.filteredOptions();
|
|
157
|
+
const term = this.searchTerm();
|
|
158
|
+
if (this.allowCustomEntries() && term && !filtered.some((o) => o.value === term)) filtered = [{
|
|
159
|
+
label: `${term} (nuevo)`,
|
|
160
|
+
value: term,
|
|
161
|
+
custom: true
|
|
162
|
+
}, ...filtered];
|
|
163
|
+
if (!this.usePagination()) return filtered;
|
|
164
|
+
const page = this.currentPage();
|
|
165
|
+
const perPage = this.itemsPerPage();
|
|
166
|
+
const startIndex = (page - 1) * perPage;
|
|
167
|
+
const endIndex = startIndex + perPage;
|
|
168
|
+
return filtered.slice(startIndex, endIndex);
|
|
169
|
+
}, ...ngDevMode ? [{ debugName: "paginatedOptions" }] : /* istanbul ignore next */ []);
|
|
170
|
+
this.regularOptions = computed(() => {
|
|
171
|
+
const opts = this.paginatedOptions().filter((option) => !option.custom);
|
|
172
|
+
if (!this.multiple() && this.showEmptyOption()) return [{
|
|
173
|
+
label: "- Sin selección -",
|
|
174
|
+
value: null
|
|
175
|
+
}, ...opts];
|
|
176
|
+
return opts;
|
|
177
|
+
}, ...ngDevMode ? [{ debugName: "regularOptions" }] : /* istanbul ignore next */ []);
|
|
178
|
+
this.totalPages = computed(() => {
|
|
179
|
+
if (!this.usePagination()) return 1;
|
|
180
|
+
const filtered = this.filteredOptions();
|
|
181
|
+
const perPage = this.itemsPerPage();
|
|
182
|
+
return Math.ceil(filtered.length / perPage);
|
|
183
|
+
}, ...ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []);
|
|
184
|
+
this.hasSelectedValues = computed(() => {
|
|
185
|
+
const val = this._value();
|
|
186
|
+
if (this.multiple()) return val && val.length > 0;
|
|
187
|
+
return !!val;
|
|
188
|
+
}, ...ngDevMode ? [{ debugName: "hasSelectedValues" }] : /* istanbul ignore next */ []);
|
|
189
|
+
this.showCustomOption = computed(() => {
|
|
190
|
+
const term = this.searchTerm();
|
|
191
|
+
const opts = this.options();
|
|
192
|
+
return this.allowCustomEntries() && term !== "" && !opts.some((o) => o.value === term);
|
|
193
|
+
}, ...ngDevMode ? [{ debugName: "showCustomOption" }] : /* istanbul ignore next */ []);
|
|
194
|
+
this.dropdownPosition = signal({
|
|
195
|
+
top: 0,
|
|
196
|
+
left: 0,
|
|
197
|
+
width: 0
|
|
198
|
+
}, ...ngDevMode ? [{ debugName: "dropdownPosition" }] : /* istanbul ignore next */ []);
|
|
199
|
+
this.transloco = inject(TranslocoService);
|
|
200
|
+
this.onChange = (_) => {};
|
|
201
|
+
this.onTouched = () => {};
|
|
202
|
+
this.destroyRef = inject(DestroyRef);
|
|
203
|
+
this.scrollCloseHandler = (event) => {
|
|
204
|
+
const target = event.target;
|
|
205
|
+
if (target && this.isInsideComponent(target)) return;
|
|
206
|
+
if (this.isOpen()) {
|
|
207
|
+
this.isOpen.set(false);
|
|
208
|
+
this.searchTerm.set("");
|
|
209
|
+
this.focusedIndex.set(-1);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const doc = this.elementRef.nativeElement.ownerDocument;
|
|
213
|
+
doc.addEventListener("scroll", this.scrollCloseHandler, true);
|
|
214
|
+
this.destroyRef.onDestroy(() => doc.removeEventListener("scroll", this.scrollCloseHandler, true));
|
|
215
|
+
effect(() => {
|
|
216
|
+
const term = this.searchTerm();
|
|
217
|
+
if (term !== "" && this.isSearchable()) {
|
|
218
|
+
if (this.debounceTimer) clearTimeout(this.debounceTimer);
|
|
219
|
+
this.debounceTimer = setTimeout(() => {
|
|
220
|
+
this.search.emit(term);
|
|
221
|
+
}, 300);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
effect(() => {
|
|
225
|
+
const isMultiple = this.multiple();
|
|
226
|
+
if (this._value() === null || this._value() === void 0) this._value.set(isMultiple ? [] : null);
|
|
227
|
+
});
|
|
228
|
+
effect(() => {
|
|
229
|
+
this.options();
|
|
230
|
+
this.currentPage.set(1);
|
|
231
|
+
if (!this.preserveSearchOnLoad() || !this.searchTermChanged()) this.searchTerm.set("");
|
|
232
|
+
});
|
|
233
|
+
effect(() => {
|
|
234
|
+
const ctrl = this.actualControl();
|
|
235
|
+
if (!ctrl) {
|
|
236
|
+
this.subscribed.set(false);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (this.subscribed()) return;
|
|
240
|
+
if (ctrl.invalid && ctrl.touched) this.hadError.set(true);
|
|
241
|
+
ctrl.statusChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
242
|
+
this.errorTracker.update((v) => v + 1);
|
|
243
|
+
if (ctrl.invalid && ctrl.touched) this.hadError.set(true);
|
|
244
|
+
});
|
|
245
|
+
ctrl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
246
|
+
this.errorTracker.update((v) => v + 1);
|
|
247
|
+
});
|
|
248
|
+
this.subscribed.set(true);
|
|
249
|
+
});
|
|
250
|
+
this.transloco.langChanges$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
251
|
+
this.errorTracker.update((v) => v + 1);
|
|
252
|
+
});
|
|
253
|
+
effect(() => {
|
|
254
|
+
const ctrl = this.actualControl();
|
|
255
|
+
if (!ctrl) return;
|
|
256
|
+
if (!this.valueSubscribed()) {
|
|
257
|
+
this.writeValue(ctrl.value);
|
|
258
|
+
ctrl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
259
|
+
this.writeValue(value);
|
|
260
|
+
});
|
|
261
|
+
this.valueSubscribed.set(true);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
setDisabledState(isDisabled) {
|
|
266
|
+
this._isDisabled.set(isDisabled);
|
|
267
|
+
}
|
|
268
|
+
markAsTouchedAndUpdate() {
|
|
269
|
+
this.touch.emit();
|
|
270
|
+
const ctrl = this.actualControl();
|
|
271
|
+
if (ctrl) {
|
|
272
|
+
ctrl.markAsTouched();
|
|
273
|
+
ctrl.updateValueAndValidity({ emitEvent: false });
|
|
274
|
+
}
|
|
275
|
+
this.onTouched();
|
|
276
|
+
this.errorTracker.update((v) => v + 1);
|
|
277
|
+
if (ctrl?.invalid) this.hadError.set(true);
|
|
278
|
+
}
|
|
279
|
+
normalizeText(text) {
|
|
280
|
+
return text.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
281
|
+
}
|
|
282
|
+
onKeydown(event) {
|
|
283
|
+
if (this.isDisabled()) return;
|
|
284
|
+
switch (event.key) {
|
|
285
|
+
case "Enter":
|
|
286
|
+
case " ":
|
|
287
|
+
event.preventDefault();
|
|
288
|
+
if (this.isOpen()) {
|
|
289
|
+
if (this.focusedIndex() >= 0) {
|
|
290
|
+
const selectedOption = this.regularOptions()[this.focusedIndex()];
|
|
291
|
+
if (selectedOption && !this.isOptionDisabled(selectedOption)) this.selectOption(selectedOption);
|
|
292
|
+
}
|
|
293
|
+
} else this.toggleDropdown();
|
|
294
|
+
break;
|
|
295
|
+
case "Escape":
|
|
296
|
+
if (this.isOpen()) {
|
|
297
|
+
this.isOpen.set(false);
|
|
298
|
+
this.searchTerm.set("");
|
|
299
|
+
this.focusedIndex.set(-1);
|
|
300
|
+
this.selectTrigger()?.nativeElement.focus();
|
|
301
|
+
}
|
|
302
|
+
break;
|
|
303
|
+
case "ArrowDown":
|
|
304
|
+
event.preventDefault();
|
|
305
|
+
if (!this.isOpen()) this.toggleDropdown();
|
|
306
|
+
else this.moveFocus(1);
|
|
307
|
+
break;
|
|
308
|
+
case "ArrowUp":
|
|
309
|
+
event.preventDefault();
|
|
310
|
+
if (this.isOpen()) this.moveFocus(-1);
|
|
311
|
+
break;
|
|
312
|
+
case "Tab": if (this.isOpen()) {
|
|
313
|
+
this.isOpen.set(false);
|
|
314
|
+
this.searchTerm.set("");
|
|
315
|
+
this.focusedIndex.set(-1);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
handleKeyDown(event) {
|
|
320
|
+
switch (event.key) {
|
|
321
|
+
case "Enter":
|
|
322
|
+
event.preventDefault();
|
|
323
|
+
event.stopPropagation();
|
|
324
|
+
if (this.focusedIndex() >= 0) {
|
|
325
|
+
const option = this.regularOptions()[this.focusedIndex()];
|
|
326
|
+
if (option && !this.isOptionDisabled(option)) this.selectOption(option);
|
|
327
|
+
} else {
|
|
328
|
+
const filtered = this.filteredOptions();
|
|
329
|
+
if (filtered.length > 0) this.selectOption(filtered[0]);
|
|
330
|
+
}
|
|
331
|
+
break;
|
|
332
|
+
case "ArrowDown":
|
|
333
|
+
event.preventDefault();
|
|
334
|
+
event.stopPropagation();
|
|
335
|
+
this.moveFocus(1);
|
|
336
|
+
break;
|
|
337
|
+
case "ArrowUp":
|
|
338
|
+
event.preventDefault();
|
|
339
|
+
event.stopPropagation();
|
|
340
|
+
this.moveFocus(-1);
|
|
341
|
+
break;
|
|
342
|
+
case "Escape":
|
|
343
|
+
event.stopPropagation();
|
|
344
|
+
event.preventDefault();
|
|
345
|
+
this.isOpen.set(false);
|
|
346
|
+
this.searchTerm.set("");
|
|
347
|
+
this.focusedIndex.set(-1);
|
|
348
|
+
this.selectTrigger()?.nativeElement.focus();
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
moveFocus(direction) {
|
|
352
|
+
const options = this.regularOptions();
|
|
353
|
+
if (!options.length) return;
|
|
354
|
+
let newIndex = this.focusedIndex();
|
|
355
|
+
do {
|
|
356
|
+
newIndex = newIndex + direction;
|
|
357
|
+
if (newIndex < 0) newIndex = options.length - 1;
|
|
358
|
+
if (newIndex >= options.length) newIndex = 0;
|
|
359
|
+
} while (this.isOptionDisabled(options[newIndex]) && options.length > 1);
|
|
360
|
+
this.focusedIndex.set(newIndex);
|
|
361
|
+
setTimeout(() => {
|
|
362
|
+
const container = this.dropdownContainer()?.nativeElement;
|
|
363
|
+
const activeItem = container?.querySelector(".select-option-active");
|
|
364
|
+
if (activeItem && container) {
|
|
365
|
+
const itemTop = activeItem.offsetTop;
|
|
366
|
+
const itemBottom = itemTop + activeItem.offsetHeight;
|
|
367
|
+
const containerScrollTop = container.scrollTop;
|
|
368
|
+
const containerHeight = container.clientHeight;
|
|
369
|
+
if (itemTop < containerScrollTop) container.scrollTop = itemTop;
|
|
370
|
+
else if (itemBottom > containerScrollTop + containerHeight) container.scrollTop = itemBottom - containerHeight;
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
getSelectedIndex() {
|
|
375
|
+
const currentVal = this._value();
|
|
376
|
+
const options = this.regularOptions();
|
|
377
|
+
if (currentVal === null || currentVal === void 0) return -1;
|
|
378
|
+
const index = options.findIndex((opt) => opt.value === currentVal);
|
|
379
|
+
return index >= 0 ? index : -1;
|
|
380
|
+
}
|
|
381
|
+
isOptionDisabled(option) {
|
|
382
|
+
if (option.value === null) return false;
|
|
383
|
+
const validCombos = this.validCombinations();
|
|
384
|
+
if (!validCombos || !this.multiple()) return false;
|
|
385
|
+
const currentSelection = Array.isArray(this._value()) ? this._value() : [];
|
|
386
|
+
if (currentSelection.length === 0) return false;
|
|
387
|
+
if (currentSelection.includes(option.value)) return false;
|
|
388
|
+
const hypotheticalSelection = [...currentSelection, option.value];
|
|
389
|
+
return !validCombos.some((combination) => {
|
|
390
|
+
const allSelected = hypotheticalSelection.every((selected) => combination.includes(selected));
|
|
391
|
+
const withinLimit = hypotheticalSelection.length <= combination.length;
|
|
392
|
+
return allSelected && withinLimit;
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
isSelected(option) {
|
|
396
|
+
const val = this._value();
|
|
397
|
+
if (this.multiple()) return Array.isArray(val) && val.includes(option.value);
|
|
398
|
+
return val === option.value;
|
|
399
|
+
}
|
|
400
|
+
nextPage() {
|
|
401
|
+
const total = this.totalPages();
|
|
402
|
+
const current = this.currentPage();
|
|
403
|
+
if (current < total) this.currentPage.set(current + 1);
|
|
404
|
+
}
|
|
405
|
+
previousPage() {
|
|
406
|
+
const current = this.currentPage();
|
|
407
|
+
if (current > 1) this.currentPage.set(current - 1);
|
|
408
|
+
}
|
|
409
|
+
isInsideComponent(target) {
|
|
410
|
+
if (!target) return false;
|
|
411
|
+
if (this.elementRef.nativeElement.contains(target)) return true;
|
|
412
|
+
const panel = this.dropdownContainer()?.nativeElement;
|
|
413
|
+
return !!panel && panel.contains(target);
|
|
414
|
+
}
|
|
415
|
+
onClickOutside(event) {
|
|
416
|
+
if (!this.isInsideComponent(event.target) && this.isOpen()) {
|
|
417
|
+
this.markAsTouchedAndUpdate();
|
|
418
|
+
this.isOpen.set(false);
|
|
419
|
+
this.searchTerm.set("");
|
|
420
|
+
this.focusedIndex.set(-1);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
onCustomOptionClick() {
|
|
424
|
+
const term = this.searchTerm();
|
|
425
|
+
const customOption = {
|
|
426
|
+
label: term,
|
|
427
|
+
value: term
|
|
428
|
+
};
|
|
429
|
+
this._value.set(customOption.value);
|
|
430
|
+
this.onChange(customOption.value);
|
|
431
|
+
this.selectionChange.emit(customOption.value);
|
|
432
|
+
this.isOpen.set(false);
|
|
433
|
+
this.searchTerm.set("");
|
|
434
|
+
const ctrl = this.actualControl();
|
|
435
|
+
if (ctrl) ctrl.setValue(customOption.value);
|
|
436
|
+
this.markAsTouchedAndUpdate();
|
|
437
|
+
}
|
|
438
|
+
onInputChange(event) {
|
|
439
|
+
const previousSearch = this.searchTerm();
|
|
440
|
+
const target = event.target;
|
|
441
|
+
this.searchTerm.set(target.value);
|
|
442
|
+
this.searchTermChanged.set(true);
|
|
443
|
+
if (previousSearch !== this.searchTerm()) {
|
|
444
|
+
this.search.emit(this.searchTerm());
|
|
445
|
+
if (this.allowCustomEntries() && this.searchTerm()) {
|
|
446
|
+
this._value.set(this.searchTerm());
|
|
447
|
+
this.onChange(this.searchTerm());
|
|
448
|
+
this.selectionChange.emit(this.searchTerm());
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
this.currentPage.set(1);
|
|
452
|
+
}
|
|
453
|
+
onOptionClick(option) {
|
|
454
|
+
if (this.isDisabled()) return;
|
|
455
|
+
if (this.allowCustomEntries() && option.value === this.searchTerm()) {
|
|
456
|
+
const customOption = {
|
|
457
|
+
label: this.searchTerm(),
|
|
458
|
+
value: this.searchTerm()
|
|
459
|
+
};
|
|
460
|
+
this._value.set(customOption.value);
|
|
461
|
+
this.onChange(customOption.value);
|
|
462
|
+
this.selectionChange.emit(customOption.value);
|
|
463
|
+
this.isOpen.set(false);
|
|
464
|
+
this.searchTerm.set("");
|
|
465
|
+
const ctrl = this.actualControl();
|
|
466
|
+
if (ctrl) ctrl.setValue(customOption.value);
|
|
467
|
+
this.markAsTouchedAndUpdate();
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
if (this.multiple()) this.toggleOption(option);
|
|
471
|
+
else this.selectOption(option);
|
|
472
|
+
}
|
|
473
|
+
selectOption(option) {
|
|
474
|
+
if (this.multiple()) {
|
|
475
|
+
this.toggleOption(option);
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
this._value.set(option.value);
|
|
479
|
+
this.onChange(option.value);
|
|
480
|
+
this.onTouched();
|
|
481
|
+
this.selectionChange.emit(option.value);
|
|
482
|
+
this.isOpen.set(false);
|
|
483
|
+
const ctrl = this.actualControl();
|
|
484
|
+
if (ctrl) ctrl.setValue(option.value);
|
|
485
|
+
this.markAsTouchedAndUpdate();
|
|
486
|
+
this.focusedIndex.set(-1);
|
|
487
|
+
this.selectTrigger()?.nativeElement.focus();
|
|
488
|
+
}
|
|
489
|
+
toggleOption(option) {
|
|
490
|
+
if (this.isOptionDisabled(option)) return;
|
|
491
|
+
if (!this.multiple()) return;
|
|
492
|
+
let currentValue = this._value();
|
|
493
|
+
if (!Array.isArray(currentValue)) currentValue = [];
|
|
494
|
+
const index = currentValue.indexOf(option.value);
|
|
495
|
+
let newValue;
|
|
496
|
+
if (index === -1) newValue = [...currentValue, option.value];
|
|
497
|
+
else newValue = currentValue.filter((v) => v !== option.value);
|
|
498
|
+
this._value.set(newValue);
|
|
499
|
+
this.onChange(newValue);
|
|
500
|
+
this.onTouched();
|
|
501
|
+
this.selectionChange.emit(newValue);
|
|
502
|
+
this.markAsTouchedAndUpdate();
|
|
503
|
+
}
|
|
504
|
+
toggleDropdown() {
|
|
505
|
+
if (this.isDisabled()) return;
|
|
506
|
+
const wasOpen = this.isOpen();
|
|
507
|
+
this.isOpen.update((v) => !v);
|
|
508
|
+
if (!wasOpen && this.isOpen()) {
|
|
509
|
+
const selectedIdx = this.getSelectedIndex();
|
|
510
|
+
this.focusedIndex.set(selectedIdx);
|
|
511
|
+
} else if (wasOpen && !this.isOpen()) {
|
|
512
|
+
this.searchTerm.set("");
|
|
513
|
+
this.focusedIndex.set(-1);
|
|
514
|
+
this.selectTrigger()?.nativeElement.focus();
|
|
515
|
+
}
|
|
516
|
+
if (this.isOpen() && this.isSearchable()) setTimeout(() => {
|
|
517
|
+
this.filterInput()?.nativeElement?.focus();
|
|
518
|
+
});
|
|
519
|
+
if (this.isOpen()) {
|
|
520
|
+
this.computeDropdownPosition();
|
|
521
|
+
requestAnimationFrame(() => {
|
|
522
|
+
if (this.isOpen()) this.computeDropdownPosition();
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
this.onTouched();
|
|
526
|
+
}
|
|
527
|
+
trackByFn(index, option) {
|
|
528
|
+
return option.value;
|
|
529
|
+
}
|
|
530
|
+
writeValue(value) {
|
|
531
|
+
if (value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0) this._value.set(this.multiple() ? [] : null);
|
|
532
|
+
else this._value.set(value);
|
|
533
|
+
}
|
|
534
|
+
registerOnChange(fn) {
|
|
535
|
+
this.onChange = fn;
|
|
536
|
+
}
|
|
537
|
+
registerOnTouched(fn) {
|
|
538
|
+
this.onTouched = fn;
|
|
539
|
+
}
|
|
540
|
+
static {
|
|
541
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
542
|
+
minVersion: "12.0.0",
|
|
543
|
+
version: "22.3.2",
|
|
544
|
+
ngImport: i0,
|
|
545
|
+
type: SelectComponent,
|
|
546
|
+
deps: [{ token: ElementRef }],
|
|
547
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
static {
|
|
551
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
552
|
+
minVersion: "17.0.0",
|
|
553
|
+
version: "22.3.2",
|
|
554
|
+
type: SelectComponent,
|
|
555
|
+
isStandalone: true,
|
|
556
|
+
selector: "shk-select",
|
|
557
|
+
inputs: {
|
|
558
|
+
options: {
|
|
559
|
+
classPropertyName: "options",
|
|
560
|
+
publicName: "options",
|
|
561
|
+
isSignal: true,
|
|
562
|
+
isRequired: false,
|
|
563
|
+
transformFunction: null
|
|
564
|
+
},
|
|
565
|
+
multiple: {
|
|
566
|
+
classPropertyName: "multiple",
|
|
567
|
+
publicName: "multiple",
|
|
568
|
+
isSignal: true,
|
|
569
|
+
isRequired: false,
|
|
570
|
+
transformFunction: null
|
|
571
|
+
},
|
|
572
|
+
validCombinations: {
|
|
573
|
+
classPropertyName: "validCombinations",
|
|
574
|
+
publicName: "validCombinations",
|
|
575
|
+
isSignal: true,
|
|
576
|
+
isRequired: false,
|
|
577
|
+
transformFunction: null
|
|
578
|
+
},
|
|
579
|
+
placeholder: {
|
|
580
|
+
classPropertyName: "placeholder",
|
|
581
|
+
publicName: "placeholder",
|
|
582
|
+
isSignal: true,
|
|
583
|
+
isRequired: false,
|
|
584
|
+
transformFunction: null
|
|
585
|
+
},
|
|
586
|
+
label: {
|
|
587
|
+
classPropertyName: "label",
|
|
588
|
+
publicName: "label",
|
|
589
|
+
isSignal: true,
|
|
590
|
+
isRequired: false,
|
|
591
|
+
transformFunction: null
|
|
592
|
+
},
|
|
593
|
+
isLoading: {
|
|
594
|
+
classPropertyName: "isLoading",
|
|
595
|
+
publicName: "isLoading",
|
|
596
|
+
isSignal: true,
|
|
597
|
+
isRequired: false,
|
|
598
|
+
transformFunction: null
|
|
599
|
+
},
|
|
600
|
+
isAllDataLoaded: {
|
|
601
|
+
classPropertyName: "isAllDataLoaded",
|
|
602
|
+
publicName: "isAllDataLoaded",
|
|
603
|
+
isSignal: true,
|
|
604
|
+
isRequired: false,
|
|
605
|
+
transformFunction: null
|
|
606
|
+
},
|
|
607
|
+
allowCustomEntries: {
|
|
608
|
+
classPropertyName: "allowCustomEntries",
|
|
609
|
+
publicName: "allowCustomEntries",
|
|
610
|
+
isSignal: true,
|
|
611
|
+
isRequired: false,
|
|
612
|
+
transformFunction: null
|
|
613
|
+
},
|
|
614
|
+
formGroup: {
|
|
615
|
+
classPropertyName: "formGroup",
|
|
616
|
+
publicName: "formGroup",
|
|
617
|
+
isSignal: true,
|
|
618
|
+
isRequired: false,
|
|
619
|
+
transformFunction: null
|
|
620
|
+
},
|
|
621
|
+
isSearchable: {
|
|
622
|
+
classPropertyName: "isSearchable",
|
|
623
|
+
publicName: "isSearchable",
|
|
624
|
+
isSignal: true,
|
|
625
|
+
isRequired: false,
|
|
626
|
+
transformFunction: null
|
|
627
|
+
},
|
|
628
|
+
itemsPerPage: {
|
|
629
|
+
classPropertyName: "itemsPerPage",
|
|
630
|
+
publicName: "itemsPerPage",
|
|
631
|
+
isSignal: true,
|
|
632
|
+
isRequired: false,
|
|
633
|
+
transformFunction: null
|
|
634
|
+
},
|
|
635
|
+
control: {
|
|
636
|
+
classPropertyName: "control",
|
|
637
|
+
publicName: "control",
|
|
638
|
+
isSignal: true,
|
|
639
|
+
isRequired: false,
|
|
640
|
+
transformFunction: null
|
|
641
|
+
},
|
|
642
|
+
usePagination: {
|
|
643
|
+
classPropertyName: "usePagination",
|
|
644
|
+
publicName: "usePagination",
|
|
645
|
+
isSignal: true,
|
|
646
|
+
isRequired: false,
|
|
647
|
+
transformFunction: null
|
|
648
|
+
},
|
|
649
|
+
disabled: {
|
|
650
|
+
classPropertyName: "disabled",
|
|
651
|
+
publicName: "disabled",
|
|
652
|
+
isSignal: true,
|
|
653
|
+
isRequired: false,
|
|
654
|
+
transformFunction: null
|
|
655
|
+
},
|
|
656
|
+
errorMessages: {
|
|
657
|
+
classPropertyName: "errorMessages",
|
|
658
|
+
publicName: "errorMessages",
|
|
659
|
+
isSignal: true,
|
|
660
|
+
isRequired: false,
|
|
661
|
+
transformFunction: null
|
|
662
|
+
},
|
|
663
|
+
preserveSearchOnLoad: {
|
|
664
|
+
classPropertyName: "preserveSearchOnLoad",
|
|
665
|
+
publicName: "preserveSearchOnLoad",
|
|
666
|
+
isSignal: true,
|
|
667
|
+
isRequired: false,
|
|
668
|
+
transformFunction: null
|
|
669
|
+
},
|
|
670
|
+
emptyMessageKey: {
|
|
671
|
+
classPropertyName: "emptyMessageKey",
|
|
672
|
+
publicName: "emptyMessageKey",
|
|
673
|
+
isSignal: true,
|
|
674
|
+
isRequired: false,
|
|
675
|
+
transformFunction: null
|
|
676
|
+
},
|
|
677
|
+
dropdownUpward: {
|
|
678
|
+
classPropertyName: "dropdownUpward",
|
|
679
|
+
publicName: "dropdownUpward",
|
|
680
|
+
isSignal: true,
|
|
681
|
+
isRequired: false,
|
|
682
|
+
transformFunction: null
|
|
683
|
+
},
|
|
684
|
+
showEmptyOption: {
|
|
685
|
+
classPropertyName: "showEmptyOption",
|
|
686
|
+
publicName: "showEmptyOption",
|
|
687
|
+
isSignal: true,
|
|
688
|
+
isRequired: false,
|
|
689
|
+
transformFunction: null
|
|
690
|
+
},
|
|
691
|
+
value: {
|
|
692
|
+
classPropertyName: "value",
|
|
693
|
+
publicName: "value",
|
|
694
|
+
isSignal: true,
|
|
695
|
+
isRequired: false,
|
|
696
|
+
transformFunction: null
|
|
697
|
+
}
|
|
698
|
+
},
|
|
699
|
+
outputs: {
|
|
700
|
+
selectionChange: "selectionChange",
|
|
701
|
+
touch: "touch",
|
|
702
|
+
search: "search",
|
|
703
|
+
value: "valueChange"
|
|
704
|
+
},
|
|
705
|
+
host: { listeners: { "document:mousedown": "onClickOutside($event)" } },
|
|
706
|
+
providers: [{
|
|
707
|
+
provide: NG_VALUE_ACCESSOR,
|
|
708
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
709
|
+
multi: true
|
|
710
|
+
}],
|
|
711
|
+
viewQueries: [
|
|
712
|
+
{
|
|
713
|
+
propertyName: "filterInput",
|
|
714
|
+
first: true,
|
|
715
|
+
predicate: ["filterInput"],
|
|
716
|
+
descendants: true,
|
|
717
|
+
isSignal: true
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
propertyName: "selectContainer",
|
|
721
|
+
first: true,
|
|
722
|
+
predicate: ["selectContainer"],
|
|
723
|
+
descendants: true,
|
|
724
|
+
isSignal: true
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
propertyName: "selectTrigger",
|
|
728
|
+
first: true,
|
|
729
|
+
predicate: ["selectTrigger"],
|
|
730
|
+
descendants: true,
|
|
731
|
+
isSignal: true
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
propertyName: "dropdownContainer",
|
|
735
|
+
first: true,
|
|
736
|
+
predicate: ["dropdownContainer"],
|
|
737
|
+
descendants: true,
|
|
738
|
+
isSignal: true
|
|
739
|
+
}
|
|
740
|
+
],
|
|
741
|
+
ngImport: i0,
|
|
742
|
+
template: "<div\n #selectContainer\n class=\"relative w-full font-sans outline-none\"\n>\n @if (label()) {\n <div class=\"text-sm font-medium _shk-text-surface-700 mb-1\">\n {{ label() }}\n </div>\n }\n\n <div\n #selectTrigger\n class=\"shk-control flex justify-between items-center w-full px-3 py-2 border _shk-border rounded-lg _shk-bg-surface-50 transition-colors duration-150 cursor-pointer min-h-[2.5rem] _shk-text-surface-700 focus-within:outline-none focus-within:[background-color:var(--shk-surface-50)] dark:focus-within:[background-color:var(--shk-surface-100)] focus-within:ring-1 focus-within:[--tw-ring-color:var(--shk-primary-500)] focus-within:[border-color:var(--shk-primary-500)] focus:outline-none focus:ring-1 focus:[--tw-ring-color:var(--shk-primary-500)] focus:[border-color:var(--shk-primary-500)] sm:text-sm\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (keydown)=\"onKeydown($event)\"\n (click)=\"toggleDropdown()\"\n [class.open]=\"isOpen()\"\n [class.disabled-select]=\"isDisabled()\"\n [class.shk-control-disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"shouldShowError() || null\"\n [class._shk-border-red]=\"shouldShowError()\"\n >\n <div class=\"selected-value truncate\">\n @if (isSearchable() && isOpen()) {\n <input\n #filterInput\n type=\"text\"\n class=\"w-full bg-transparent border-0 outline-none p-0 _shk-text-surface-700\"\n placeholder=\"Buscar...\"\n [value]=\"searchTerm()\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"handleKeyDown($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <span\n [class._shk-text-surface-400]=\"!hasSelectedValues()\"\n [class._shk-text-surface-800]=\"hasSelectedValues()\"\n >\n {{ displayValue() }}\n </span>\n }\n </div>\n <div\n class=\"text-xs transition-transform duration-200 shrink-0 ml-2\"\n [class.rotate-180]=\"isOpen()\"\n >\n <svg\n [shkIcon]=\"getIcon('chevron-down')\"\n class=\"w-4 h-4 _shk-text-surface-400\"\n ></svg>\n </div>\n </div>\n\n @if (isOpen()) {\n <div\n #dropdownContainer\n shkPortal\n (keydown)=\"onKeydown($event)\"\n class=\"shk-select-panel fixed _shk-bg-surface-50 border _shk-border rounded-lg max-h-[240px] overflow-y-auto z-[9999] shadow-lg _shk-scrollbar\"\n [style.top]=\"dropdownPosition().top + 'px'\"\n [style.left]=\"dropdownPosition().left + 'px'\"\n [style.width]=\"dropdownPosition().width + 'px'\"\n >\n @if (showCustomOption()) {\n <div\n class=\"shk-select-option flex items-center gap-2 px-3 py-2 cursor-pointer hover:[background-color:var(--shk-surface-50)] dark:hover:[background-color:var(--shk-surface-200)] text-sm\"\n (click)=\"onCustomOptionClick()\"\n >\n <span class=\"font-semibold _shk-text-primary\">Crear nuevo:</span>\n <span class=\"_shk-text-surface-700 ml-1\">{{ searchTerm() }}</span>\n </div>\n }\n\n @for (option of regularOptions(); track trackByFn($index, option); let i = $index) {\n <div\n class=\"shk-select-option flex items-center gap-2 px-3 py-2 cursor-pointer hover:[background-color:var(--shk-surface-50)] dark:hover:[background-color:var(--shk-surface-200)] text-sm _shk-text-surface-700\"\n [class.shk-select-option-disabled]=\"isOptionDisabled(option)\"\n [class.shk-select-option-selected]=\"!multiple() && option.value !== null && isSelected(option)\"\n [class.opacity-50]=\"isOptionDisabled(option)\"\n [class.select-option-active]=\"focusedIndex() === i\"\n [class._shk-text-surface-400]=\"option.value === null\"\n (click)=\"!isOptionDisabled(option) && onOptionClick(option)\"\n >\n @if (multiple()) {\n <input\n type=\"checkbox\"\n [checked]=\"isSelected(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"!isOptionDisabled(option) && toggleOption(option)\"\n class=\"flex-shrink-0 [accent-color:var(--shk-primary-600)]\"\n />\n {{ option.label }}\n } @else {\n <span class=\"shk-select-option-label flex-1 min-w-0\">{{ option.label }}</span>\n @if (option.value !== null && isSelected(option)) {\n <svg [shkIcon]=\"getIcon('check')\" class=\"shk-select-check w-4 h-4 shrink-0\"></svg>\n }\n }\n </div>\n }\n\n <div class=\"px-3 py-2 text-center\">\n @if (isLoading() && regularOptions().length === 0) {\n <div class=\"flex items-center justify-center gap-2 text-sm _shk-text-surface-500\">\n <svg class=\"spinner\" viewBox=\"0 0 50 50\">\n <circle\n class=\"path\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n fill=\"none\"\n stroke-width=\"5\"\n ></circle>\n </svg>\n Cargando más resultados...\n </div>\n }\n\n @if (!isLoading() && isAllDataLoaded() && regularOptions().length === 0) {\n <div class=\"text-sm _shk-text-surface-400 italic\">\n No se encontraron coincidencias\n </div>\n }\n\n @if (options().length === 0) {\n <div class=\"text-sm _shk-text-surface-400 italic\">\n {{ emptyMessageKey() | transloco }}\n </div>\n }\n </div>\n\n @if (usePagination() && totalPages() > 1) {\n <div class=\"flex justify-between items-center px-3 py-2 border-t _shk-border\">\n <button\n class=\"bg-transparent border-0 cursor-pointer px-2 py-1 rounded hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] disabled:opacity-50 disabled:cursor-not-allowed _shk-text-surface-600\"\n [disabled]=\"currentPage() === 1\"\n (click)=\"$event.stopPropagation(); previousPage()\"\n >\n <svg [shkIcon]=\"getIcon('chevron-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <span class=\"text-sm _shk-text-surface-600\">\n {{ currentPage() }} de {{ totalPages() }}\n </span>\n <button\n class=\"bg-transparent border-0 cursor-pointer px-2 py-1 rounded hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] disabled:opacity-50 disabled:cursor-not-allowed _shk-text-surface-600\"\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"$event.stopPropagation(); nextPage()\"\n >\n <svg [shkIcon]=\"getIcon('chevron-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n }\n </div>\n }\n\n @if (shouldShowError()) {\n <div class=\"mt-1 text-xs text-red-500 max-h-20 overflow-y-auto _shk-scrollbar\" tabindex=\"-1\">\n <ul class=\"list-disc pl-4 space-y-1\">\n @for (error of getErrorMessages(); track error) {\n <li>{{ error }}</li>\n }\n </ul>\n </div>\n }\n</div>",
|
|
743
|
+
styles: [".shk-select-panel{padding:.25rem;border-radius:.625rem;box-shadow:0 10px 24px -6px #0000001f,0 4px 8px -4px #0000000f;animation:shk-select-in .12s ease-out}@keyframes shk-select-in{0%{opacity:0;transform:translateY(-4px) scale(.98)}}@keyframes shk-spin{to{transform:rotate(360deg)}}.shk-select-option{border-radius:.375rem;transition:background-color .1s ease}.shk-select-option:hover:not(.shk-select-option-disabled){background-color:var(--shk-surface-100)}:host-context(.dark) .shk-select-option:hover:not(.shk-select-option-disabled),.dark .shk-select-option:hover:not(.shk-select-option-disabled){background-color:var(--shk-surface-200)}.shk-select-option-label{overflow-wrap:anywhere}.spinner{width:1rem;height:1rem;animation:shk-spin .9s linear infinite;transform-origin:center}.spinner .path{stroke:var(--shk-surface-400);stroke-linecap:round;stroke-dasharray:90,150;stroke-dashoffset:0}.shk-select-option-disabled{cursor:not-allowed}.shk-select-option-selected{color:var(--shk-primary-700);font-weight:500}:host-context(.dark) .shk-select-option-selected,.dark .shk-select-option-selected{color:var(--shk-primary-400)}.shk-select-check{color:var(--shk-primary-600)}:host-context(.dark) .shk-select-check,.dark .shk-select-check{color:var(--shk-primary-400)}.select-option-active{background-color:var(--shk-primary-50);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--shk-primary-500) 35%,transparent);color:var(--shk-primary-700)}:host-context(.dark) .select-option-active,.dark .select-option-active{background-color:color-mix(in srgb,var(--shk-primary-900) 40%,transparent);color:var(--shk-primary-300)}\n"],
|
|
744
|
+
dependencies: [
|
|
745
|
+
{
|
|
746
|
+
kind: "directive",
|
|
747
|
+
type: PortalDirective,
|
|
748
|
+
selector: "[shkPortal]"
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
kind: "ngmodule",
|
|
752
|
+
type: CommonModule
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
kind: "ngmodule",
|
|
756
|
+
type: ReactiveFormsModule
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
kind: "ngmodule",
|
|
760
|
+
type: FormsModule
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
kind: "ngmodule",
|
|
764
|
+
type: TranslocoModule
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
kind: "directive",
|
|
768
|
+
type: ShkIconDirective,
|
|
769
|
+
selector: "svg[shkIcon]",
|
|
770
|
+
inputs: [
|
|
771
|
+
"shkIcon",
|
|
772
|
+
"size",
|
|
773
|
+
"strokeWidth",
|
|
774
|
+
"color"
|
|
775
|
+
]
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
kind: "pipe",
|
|
779
|
+
type: i1.TranslocoPipe,
|
|
780
|
+
name: "transloco"
|
|
781
|
+
}
|
|
782
|
+
],
|
|
783
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
788
|
+
minVersion: "12.0.0",
|
|
789
|
+
version: "22.3.2",
|
|
790
|
+
ngImport: i0,
|
|
791
|
+
type: SelectComponent,
|
|
792
|
+
decorators: [{
|
|
793
|
+
type: Component,
|
|
794
|
+
args: [{
|
|
795
|
+
selector: "shk-select",
|
|
796
|
+
imports: [
|
|
797
|
+
PortalDirective,
|
|
798
|
+
CommonModule,
|
|
799
|
+
ReactiveFormsModule,
|
|
800
|
+
FormsModule,
|
|
801
|
+
TranslocoModule,
|
|
802
|
+
ShkIconDirective
|
|
803
|
+
],
|
|
804
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
805
|
+
providers: [{
|
|
806
|
+
provide: NG_VALUE_ACCESSOR,
|
|
807
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
808
|
+
multi: true
|
|
809
|
+
}],
|
|
810
|
+
template: "<div\n #selectContainer\n class=\"relative w-full font-sans outline-none\"\n>\n @if (label()) {\n <div class=\"text-sm font-medium _shk-text-surface-700 mb-1\">\n {{ label() }}\n </div>\n }\n\n <div\n #selectTrigger\n class=\"shk-control flex justify-between items-center w-full px-3 py-2 border _shk-border rounded-lg _shk-bg-surface-50 transition-colors duration-150 cursor-pointer min-h-[2.5rem] _shk-text-surface-700 focus-within:outline-none focus-within:[background-color:var(--shk-surface-50)] dark:focus-within:[background-color:var(--shk-surface-100)] focus-within:ring-1 focus-within:[--tw-ring-color:var(--shk-primary-500)] focus-within:[border-color:var(--shk-primary-500)] focus:outline-none focus:ring-1 focus:[--tw-ring-color:var(--shk-primary-500)] focus:[border-color:var(--shk-primary-500)] sm:text-sm\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (keydown)=\"onKeydown($event)\"\n (click)=\"toggleDropdown()\"\n [class.open]=\"isOpen()\"\n [class.disabled-select]=\"isDisabled()\"\n [class.shk-control-disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"shouldShowError() || null\"\n [class._shk-border-red]=\"shouldShowError()\"\n >\n <div class=\"selected-value truncate\">\n @if (isSearchable() && isOpen()) {\n <input\n #filterInput\n type=\"text\"\n class=\"w-full bg-transparent border-0 outline-none p-0 _shk-text-surface-700\"\n placeholder=\"Buscar...\"\n [value]=\"searchTerm()\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"handleKeyDown($event)\"\n (click)=\"$event.stopPropagation()\"\n />\n } @else {\n <span\n [class._shk-text-surface-400]=\"!hasSelectedValues()\"\n [class._shk-text-surface-800]=\"hasSelectedValues()\"\n >\n {{ displayValue() }}\n </span>\n }\n </div>\n <div\n class=\"text-xs transition-transform duration-200 shrink-0 ml-2\"\n [class.rotate-180]=\"isOpen()\"\n >\n <svg\n [shkIcon]=\"getIcon('chevron-down')\"\n class=\"w-4 h-4 _shk-text-surface-400\"\n ></svg>\n </div>\n </div>\n\n @if (isOpen()) {\n <div\n #dropdownContainer\n shkPortal\n (keydown)=\"onKeydown($event)\"\n class=\"shk-select-panel fixed _shk-bg-surface-50 border _shk-border rounded-lg max-h-[240px] overflow-y-auto z-[9999] shadow-lg _shk-scrollbar\"\n [style.top]=\"dropdownPosition().top + 'px'\"\n [style.left]=\"dropdownPosition().left + 'px'\"\n [style.width]=\"dropdownPosition().width + 'px'\"\n >\n @if (showCustomOption()) {\n <div\n class=\"shk-select-option flex items-center gap-2 px-3 py-2 cursor-pointer hover:[background-color:var(--shk-surface-50)] dark:hover:[background-color:var(--shk-surface-200)] text-sm\"\n (click)=\"onCustomOptionClick()\"\n >\n <span class=\"font-semibold _shk-text-primary\">Crear nuevo:</span>\n <span class=\"_shk-text-surface-700 ml-1\">{{ searchTerm() }}</span>\n </div>\n }\n\n @for (option of regularOptions(); track trackByFn($index, option); let i = $index) {\n <div\n class=\"shk-select-option flex items-center gap-2 px-3 py-2 cursor-pointer hover:[background-color:var(--shk-surface-50)] dark:hover:[background-color:var(--shk-surface-200)] text-sm _shk-text-surface-700\"\n [class.shk-select-option-disabled]=\"isOptionDisabled(option)\"\n [class.shk-select-option-selected]=\"!multiple() && option.value !== null && isSelected(option)\"\n [class.opacity-50]=\"isOptionDisabled(option)\"\n [class.select-option-active]=\"focusedIndex() === i\"\n [class._shk-text-surface-400]=\"option.value === null\"\n (click)=\"!isOptionDisabled(option) && onOptionClick(option)\"\n >\n @if (multiple()) {\n <input\n type=\"checkbox\"\n [checked]=\"isSelected(option)\"\n [disabled]=\"isOptionDisabled(option)\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"!isOptionDisabled(option) && toggleOption(option)\"\n class=\"flex-shrink-0 [accent-color:var(--shk-primary-600)]\"\n />\n {{ option.label }}\n } @else {\n <span class=\"shk-select-option-label flex-1 min-w-0\">{{ option.label }}</span>\n @if (option.value !== null && isSelected(option)) {\n <svg [shkIcon]=\"getIcon('check')\" class=\"shk-select-check w-4 h-4 shrink-0\"></svg>\n }\n }\n </div>\n }\n\n <div class=\"px-3 py-2 text-center\">\n @if (isLoading() && regularOptions().length === 0) {\n <div class=\"flex items-center justify-center gap-2 text-sm _shk-text-surface-500\">\n <svg class=\"spinner\" viewBox=\"0 0 50 50\">\n <circle\n class=\"path\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n fill=\"none\"\n stroke-width=\"5\"\n ></circle>\n </svg>\n Cargando más resultados...\n </div>\n }\n\n @if (!isLoading() && isAllDataLoaded() && regularOptions().length === 0) {\n <div class=\"text-sm _shk-text-surface-400 italic\">\n No se encontraron coincidencias\n </div>\n }\n\n @if (options().length === 0) {\n <div class=\"text-sm _shk-text-surface-400 italic\">\n {{ emptyMessageKey() | transloco }}\n </div>\n }\n </div>\n\n @if (usePagination() && totalPages() > 1) {\n <div class=\"flex justify-between items-center px-3 py-2 border-t _shk-border\">\n <button\n class=\"bg-transparent border-0 cursor-pointer px-2 py-1 rounded hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] disabled:opacity-50 disabled:cursor-not-allowed _shk-text-surface-600\"\n [disabled]=\"currentPage() === 1\"\n (click)=\"$event.stopPropagation(); previousPage()\"\n >\n <svg [shkIcon]=\"getIcon('chevron-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <span class=\"text-sm _shk-text-surface-600\">\n {{ currentPage() }} de {{ totalPages() }}\n </span>\n <button\n class=\"bg-transparent border-0 cursor-pointer px-2 py-1 rounded hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] disabled:opacity-50 disabled:cursor-not-allowed _shk-text-surface-600\"\n [disabled]=\"currentPage() === totalPages()\"\n (click)=\"$event.stopPropagation(); nextPage()\"\n >\n <svg [shkIcon]=\"getIcon('chevron-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n }\n </div>\n }\n\n @if (shouldShowError()) {\n <div class=\"mt-1 text-xs text-red-500 max-h-20 overflow-y-auto _shk-scrollbar\" tabindex=\"-1\">\n <ul class=\"list-disc pl-4 space-y-1\">\n @for (error of getErrorMessages(); track error) {\n <li>{{ error }}</li>\n }\n </ul>\n </div>\n }\n</div>",
|
|
811
|
+
styles: [".shk-select-panel{padding:.25rem;border-radius:.625rem;box-shadow:0 10px 24px -6px #0000001f,0 4px 8px -4px #0000000f;animation:shk-select-in .12s ease-out}@keyframes shk-select-in{0%{opacity:0;transform:translateY(-4px) scale(.98)}}@keyframes shk-spin{to{transform:rotate(360deg)}}.shk-select-option{border-radius:.375rem;transition:background-color .1s ease}.shk-select-option:hover:not(.shk-select-option-disabled){background-color:var(--shk-surface-100)}:host-context(.dark) .shk-select-option:hover:not(.shk-select-option-disabled),.dark .shk-select-option:hover:not(.shk-select-option-disabled){background-color:var(--shk-surface-200)}.shk-select-option-label{overflow-wrap:anywhere}.spinner{width:1rem;height:1rem;animation:shk-spin .9s linear infinite;transform-origin:center}.spinner .path{stroke:var(--shk-surface-400);stroke-linecap:round;stroke-dasharray:90,150;stroke-dashoffset:0}.shk-select-option-disabled{cursor:not-allowed}.shk-select-option-selected{color:var(--shk-primary-700);font-weight:500}:host-context(.dark) .shk-select-option-selected,.dark .shk-select-option-selected{color:var(--shk-primary-400)}.shk-select-check{color:var(--shk-primary-600)}:host-context(.dark) .shk-select-check,.dark .shk-select-check{color:var(--shk-primary-400)}.select-option-active{background-color:var(--shk-primary-50);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--shk-primary-500) 35%,transparent);color:var(--shk-primary-700)}:host-context(.dark) .select-option-active,.dark .select-option-active{background-color:color-mix(in srgb,var(--shk-primary-900) 40%,transparent);color:var(--shk-primary-300)}\n"]
|
|
812
|
+
}]
|
|
813
|
+
}],
|
|
814
|
+
ctorParameters: () => [{ type: ElementRef }],
|
|
815
|
+
propDecorators: {
|
|
816
|
+
options: [{
|
|
817
|
+
type: i0.Input,
|
|
818
|
+
args: [{
|
|
819
|
+
isSignal: true,
|
|
820
|
+
alias: "options",
|
|
821
|
+
required: false
|
|
822
|
+
}]
|
|
823
|
+
}],
|
|
824
|
+
multiple: [{
|
|
825
|
+
type: i0.Input,
|
|
826
|
+
args: [{
|
|
827
|
+
isSignal: true,
|
|
828
|
+
alias: "multiple",
|
|
829
|
+
required: false
|
|
830
|
+
}]
|
|
831
|
+
}],
|
|
832
|
+
validCombinations: [{
|
|
833
|
+
type: i0.Input,
|
|
834
|
+
args: [{
|
|
835
|
+
isSignal: true,
|
|
836
|
+
alias: "validCombinations",
|
|
837
|
+
required: false
|
|
838
|
+
}]
|
|
839
|
+
}],
|
|
840
|
+
placeholder: [{
|
|
841
|
+
type: i0.Input,
|
|
842
|
+
args: [{
|
|
843
|
+
isSignal: true,
|
|
844
|
+
alias: "placeholder",
|
|
845
|
+
required: false
|
|
846
|
+
}]
|
|
847
|
+
}],
|
|
848
|
+
label: [{
|
|
849
|
+
type: i0.Input,
|
|
850
|
+
args: [{
|
|
851
|
+
isSignal: true,
|
|
852
|
+
alias: "label",
|
|
853
|
+
required: false
|
|
854
|
+
}]
|
|
855
|
+
}],
|
|
856
|
+
isLoading: [{
|
|
857
|
+
type: i0.Input,
|
|
858
|
+
args: [{
|
|
859
|
+
isSignal: true,
|
|
860
|
+
alias: "isLoading",
|
|
861
|
+
required: false
|
|
862
|
+
}]
|
|
863
|
+
}],
|
|
864
|
+
isAllDataLoaded: [{
|
|
865
|
+
type: i0.Input,
|
|
866
|
+
args: [{
|
|
867
|
+
isSignal: true,
|
|
868
|
+
alias: "isAllDataLoaded",
|
|
869
|
+
required: false
|
|
870
|
+
}]
|
|
871
|
+
}],
|
|
872
|
+
allowCustomEntries: [{
|
|
873
|
+
type: i0.Input,
|
|
874
|
+
args: [{
|
|
875
|
+
isSignal: true,
|
|
876
|
+
alias: "allowCustomEntries",
|
|
877
|
+
required: false
|
|
878
|
+
}]
|
|
879
|
+
}],
|
|
880
|
+
formGroup: [{
|
|
881
|
+
type: i0.Input,
|
|
882
|
+
args: [{
|
|
883
|
+
isSignal: true,
|
|
884
|
+
alias: "formGroup",
|
|
885
|
+
required: false
|
|
886
|
+
}]
|
|
887
|
+
}],
|
|
888
|
+
isSearchable: [{
|
|
889
|
+
type: i0.Input,
|
|
890
|
+
args: [{
|
|
891
|
+
isSignal: true,
|
|
892
|
+
alias: "isSearchable",
|
|
893
|
+
required: false
|
|
894
|
+
}]
|
|
895
|
+
}],
|
|
896
|
+
itemsPerPage: [{
|
|
897
|
+
type: i0.Input,
|
|
898
|
+
args: [{
|
|
899
|
+
isSignal: true,
|
|
900
|
+
alias: "itemsPerPage",
|
|
901
|
+
required: false
|
|
902
|
+
}]
|
|
903
|
+
}],
|
|
904
|
+
control: [{
|
|
905
|
+
type: i0.Input,
|
|
906
|
+
args: [{
|
|
907
|
+
isSignal: true,
|
|
908
|
+
alias: "control",
|
|
909
|
+
required: false
|
|
910
|
+
}]
|
|
911
|
+
}],
|
|
912
|
+
usePagination: [{
|
|
913
|
+
type: i0.Input,
|
|
914
|
+
args: [{
|
|
915
|
+
isSignal: true,
|
|
916
|
+
alias: "usePagination",
|
|
917
|
+
required: false
|
|
918
|
+
}]
|
|
919
|
+
}],
|
|
920
|
+
disabled: [{
|
|
921
|
+
type: i0.Input,
|
|
922
|
+
args: [{
|
|
923
|
+
isSignal: true,
|
|
924
|
+
alias: "disabled",
|
|
925
|
+
required: false
|
|
926
|
+
}]
|
|
927
|
+
}],
|
|
928
|
+
errorMessages: [{
|
|
929
|
+
type: i0.Input,
|
|
930
|
+
args: [{
|
|
931
|
+
isSignal: true,
|
|
932
|
+
alias: "errorMessages",
|
|
933
|
+
required: false
|
|
934
|
+
}]
|
|
935
|
+
}],
|
|
936
|
+
preserveSearchOnLoad: [{
|
|
937
|
+
type: i0.Input,
|
|
938
|
+
args: [{
|
|
939
|
+
isSignal: true,
|
|
940
|
+
alias: "preserveSearchOnLoad",
|
|
941
|
+
required: false
|
|
942
|
+
}]
|
|
943
|
+
}],
|
|
944
|
+
emptyMessageKey: [{
|
|
945
|
+
type: i0.Input,
|
|
946
|
+
args: [{
|
|
947
|
+
isSignal: true,
|
|
948
|
+
alias: "emptyMessageKey",
|
|
949
|
+
required: false
|
|
950
|
+
}]
|
|
951
|
+
}],
|
|
952
|
+
dropdownUpward: [{
|
|
953
|
+
type: i0.Input,
|
|
954
|
+
args: [{
|
|
955
|
+
isSignal: true,
|
|
956
|
+
alias: "dropdownUpward",
|
|
957
|
+
required: false
|
|
958
|
+
}]
|
|
959
|
+
}],
|
|
960
|
+
showEmptyOption: [{
|
|
961
|
+
type: i0.Input,
|
|
962
|
+
args: [{
|
|
963
|
+
isSignal: true,
|
|
964
|
+
alias: "showEmptyOption",
|
|
965
|
+
required: false
|
|
966
|
+
}]
|
|
967
|
+
}],
|
|
968
|
+
selectionChange: [{
|
|
969
|
+
type: i0.Output,
|
|
970
|
+
args: ["selectionChange"]
|
|
971
|
+
}],
|
|
972
|
+
touch: [{
|
|
973
|
+
type: i0.Output,
|
|
974
|
+
args: ["touch"]
|
|
975
|
+
}],
|
|
976
|
+
search: [{
|
|
977
|
+
type: i0.Output,
|
|
978
|
+
args: ["search"]
|
|
979
|
+
}],
|
|
980
|
+
filterInput: [{
|
|
981
|
+
type: i0.ViewChild,
|
|
982
|
+
args: ["filterInput", { isSignal: true }]
|
|
983
|
+
}],
|
|
984
|
+
selectContainer: [{
|
|
985
|
+
type: i0.ViewChild,
|
|
986
|
+
args: ["selectContainer", { isSignal: true }]
|
|
987
|
+
}],
|
|
988
|
+
selectTrigger: [{
|
|
989
|
+
type: i0.ViewChild,
|
|
990
|
+
args: ["selectTrigger", { isSignal: true }]
|
|
991
|
+
}],
|
|
992
|
+
dropdownContainer: [{
|
|
993
|
+
type: i0.ViewChild,
|
|
994
|
+
args: ["dropdownContainer", { isSignal: true }]
|
|
995
|
+
}],
|
|
996
|
+
value: [{
|
|
997
|
+
type: i0.Input,
|
|
998
|
+
args: [{
|
|
999
|
+
isSignal: true,
|
|
1000
|
+
alias: "value",
|
|
1001
|
+
required: false
|
|
1002
|
+
}]
|
|
1003
|
+
}, {
|
|
1004
|
+
type: i0.Output,
|
|
1005
|
+
args: ["valueChange"]
|
|
1006
|
+
}],
|
|
1007
|
+
onClickOutside: [{
|
|
1008
|
+
type: HostListener,
|
|
1009
|
+
args: ["document:mousedown", ["$event"]]
|
|
1010
|
+
}]
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
819
1013
|
export { SelectComponent };
|
|
820
|
-
|
|
1014
|
+
|
|
1015
|
+
//# sourceMappingURL=shirkasoft-ui-components-select.mjs.map
|