@stackline/vue-multiselect-dropdown 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/dist/index.js ADDED
@@ -0,0 +1,2061 @@
1
+ // src/styles.ts
2
+ var STYLE_ID = "stackline-vue-multiselect-dropdown-styles";
3
+ var styles = `
4
+ .vmsd-root {
5
+ --vmsd-primary: #3f51b5;
6
+ --vmsd-primary-soft: rgba(63, 81, 181, 0.12);
7
+ --vmsd-bg: #ffffff;
8
+ --vmsd-surface: #f5f7fb;
9
+ --vmsd-surface-muted: #e8eaf6;
10
+ --vmsd-border: #c5cae9;
11
+ --vmsd-border-strong: #7986cb;
12
+ --vmsd-ink: #212121;
13
+ --vmsd-muted: #5f6368;
14
+ --vmsd-chip-bg: #e8eaf6;
15
+ --vmsd-chip-text: #303f9f;
16
+ --vmsd-chip-remove: #303f9f;
17
+ --vmsd-divider: rgba(125, 119, 134, 0.16);
18
+ --vmsd-section-bg: #f5f7fb;
19
+ --vmsd-focus: rgba(63, 81, 181, 0.32);
20
+ --vmsd-shadow: 0 1px 2px rgba(33, 33, 33, 0.16), 0 12px 32px rgba(63, 81, 181, 0.12);
21
+ --vmsd-shadow-soft: 0 1px 2px rgba(33, 33, 33, 0.12), 0 4px 12px rgba(33, 33, 33, 0.08);
22
+ position: relative;
23
+ display: block;
24
+ width: 100%;
25
+ color: var(--vmsd-ink);
26
+ font: inherit;
27
+ }
28
+
29
+ .vmsd-root *,
30
+ .vmsd-root *::before,
31
+ .vmsd-root *::after,
32
+ .vmsd-menu,
33
+ .vmsd-menu *,
34
+ .vmsd-menu *::before,
35
+ .vmsd-menu *::after {
36
+ box-sizing: border-box;
37
+ }
38
+
39
+ .vmsd-trigger {
40
+ position: relative;
41
+ display: flex;
42
+ align-items: center;
43
+ flex-wrap: wrap;
44
+ width: 100%;
45
+ min-height: 56px;
46
+ gap: 8px;
47
+ border: 1px solid var(--vmsd-border);
48
+ border-radius: 18px;
49
+ background-color: var(--vmsd-bg);
50
+ color: var(--vmsd-ink);
51
+ padding: 11px 54px 11px 16px;
52
+ box-shadow: var(--vmsd-shadow-soft);
53
+ text-align: left;
54
+ cursor: pointer;
55
+ line-height: 1.45;
56
+ transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 160ms ease;
57
+ }
58
+
59
+ .vmsd-trigger:hover {
60
+ border-color: var(--vmsd-border-strong);
61
+ }
62
+
63
+ .vmsd-root[data-open="true"] .vmsd-trigger,
64
+ .vmsd-trigger:focus-visible {
65
+ outline: none;
66
+ border-color: var(--vmsd-primary);
67
+ box-shadow: 0 0 0 3px var(--vmsd-focus), var(--vmsd-shadow-soft);
68
+ }
69
+
70
+ .vmsd-trigger.vmsd-disabled {
71
+ cursor: not-allowed;
72
+ opacity: 0.68;
73
+ }
74
+
75
+ .vmsd-value {
76
+ display: flex;
77
+ flex: 1 1 auto;
78
+ min-width: 0;
79
+ align-items: center;
80
+ gap: 8px;
81
+ flex-wrap: wrap;
82
+ }
83
+
84
+ .vmsd-placeholder,
85
+ .vmsd-single-value {
86
+ min-width: 0;
87
+ color: var(--vmsd-muted);
88
+ font-size: 0.95rem;
89
+ overflow: hidden;
90
+ text-overflow: ellipsis;
91
+ white-space: nowrap;
92
+ }
93
+
94
+ .vmsd-single-value {
95
+ color: var(--vmsd-ink);
96
+ font-weight: 500;
97
+ }
98
+
99
+ .vmsd-badge-list {
100
+ display: flex;
101
+ flex: 1 1 auto;
102
+ min-width: 0;
103
+ align-items: center;
104
+ gap: 8px;
105
+ flex-wrap: wrap;
106
+ }
107
+
108
+ .vmsd-badge {
109
+ position: relative;
110
+ display: inline-block;
111
+ vertical-align: middle;
112
+ min-height: 32px;
113
+ max-width: 100%;
114
+ border-radius: 999px;
115
+ background-color: var(--vmsd-chip-bg);
116
+ color: var(--vmsd-chip-text);
117
+ padding: 6px 30px 6px 12px;
118
+ box-shadow: inset 0 0 0 1px rgba(103, 80, 164, 0.08);
119
+ line-height: 1.35;
120
+ white-space: normal;
121
+ overflow-wrap: anywhere;
122
+ }
123
+
124
+ .vmsd-badge-label {
125
+ display: inline-flex;
126
+ align-items: center;
127
+ min-width: 0;
128
+ max-width: 100%;
129
+ line-height: 1.3;
130
+ font-weight: 500;
131
+ white-space: normal;
132
+ overflow-wrap: anywhere;
133
+ }
134
+
135
+ .vmsd-badge-remove,
136
+ .vmsd-clear,
137
+ .vmsd-search-clear,
138
+ .vmsd-arrow-button,
139
+ .vmsd-group-action {
140
+ appearance: none;
141
+ border: 0;
142
+ background: transparent;
143
+ color: inherit;
144
+ cursor: pointer;
145
+ font: inherit;
146
+ padding: 0;
147
+ }
148
+
149
+ .vmsd-badge-remove {
150
+ position: absolute;
151
+ top: 50%;
152
+ right: 10px;
153
+ display: inline-grid;
154
+ width: 16px;
155
+ height: 16px;
156
+ place-items: center;
157
+ transform: translateY(-50%);
158
+ color: var(--vmsd-chip-remove);
159
+ font-size: 12px;
160
+ line-height: 1;
161
+ }
162
+
163
+ .vmsd-overflow {
164
+ display: inline-flex;
165
+ align-items: center;
166
+ justify-content: center;
167
+ min-width: 0;
168
+ min-height: 0;
169
+ color: var(--vmsd-muted);
170
+ font-size: 0.8rem;
171
+ font-weight: 600;
172
+ }
173
+
174
+ .vmsd-root.vmsd-has-overflow:not(.skin-classic) .vmsd-trigger {
175
+ padding-right: 104px;
176
+ }
177
+
178
+ .vmsd-root.vmsd-has-overflow:not(.skin-classic):not(.vmsd-has-clear) .vmsd-trigger {
179
+ padding-right: 74px;
180
+ }
181
+
182
+ .vmsd-root.vmsd-has-overflow:not(.skin-classic) .vmsd-overflow {
183
+ position: absolute;
184
+ top: 50%;
185
+ right: 76px;
186
+ transform: translateY(-50%);
187
+ z-index: 1;
188
+ }
189
+
190
+ .vmsd-root.vmsd-has-overflow:not(.skin-classic):not(.vmsd-has-clear) .vmsd-overflow {
191
+ right: 42px;
192
+ }
193
+
194
+ .vmsd-actions {
195
+ position: absolute;
196
+ top: 50%;
197
+ right: 16px;
198
+ display: inline-flex;
199
+ align-items: center;
200
+ gap: 6px;
201
+ transform: translateY(-50%);
202
+ }
203
+
204
+ .vmsd-clear {
205
+ display: inline-grid;
206
+ width: 20px;
207
+ height: 20px;
208
+ place-items: center;
209
+ border-radius: 999px;
210
+ color: var(--vmsd-muted);
211
+ font-size: 14px;
212
+ line-height: 1;
213
+ }
214
+
215
+ .vmsd-icon {
216
+ display: block;
217
+ width: 100%;
218
+ height: 100%;
219
+ fill: currentColor;
220
+ }
221
+
222
+ .vmsd-badge-remove .vmsd-icon {
223
+ width: 10px;
224
+ height: 10px;
225
+ }
226
+
227
+ .vmsd-clear .vmsd-icon {
228
+ width: 12px;
229
+ height: 12px;
230
+ }
231
+
232
+ .vmsd-search-clear .vmsd-icon {
233
+ width: 18px;
234
+ height: 18px;
235
+ }
236
+
237
+ .vmsd-arrow-button {
238
+ display: inline-grid;
239
+ width: 20px;
240
+ height: 20px;
241
+ place-items: center;
242
+ border-radius: 999px;
243
+ color: var(--vmsd-muted);
244
+ }
245
+
246
+ .vmsd-arrow-button:disabled {
247
+ cursor: not-allowed;
248
+ }
249
+
250
+ .vmsd-badge-remove:focus-visible,
251
+ .vmsd-clear:focus-visible,
252
+ .vmsd-search-clear:focus-visible,
253
+ .vmsd-arrow-button:focus-visible,
254
+ .vmsd-group-action:focus-visible,
255
+ .vmsd-inline-button:focus-visible {
256
+ outline: 3px solid var(--vmsd-focus);
257
+ outline-offset: 2px;
258
+ }
259
+
260
+ .vmsd-arrow {
261
+ display: inline-flex;
262
+ width: 100%;
263
+ height: 100%;
264
+ line-height: 0;
265
+ }
266
+
267
+ .vmsd-arrow .vmsd-icon {
268
+ display: block;
269
+ width: 100%;
270
+ height: 100%;
271
+ fill: currentColor;
272
+ }
273
+
274
+ .vmsd-menu {
275
+ position: absolute;
276
+ left: 0;
277
+ z-index: 99999;
278
+ width: 100%;
279
+ border: 1px solid var(--vmsd-border);
280
+ border-radius: 22px;
281
+ background-color: var(--vmsd-bg);
282
+ box-shadow: var(--vmsd-shadow);
283
+ overflow: hidden;
284
+ }
285
+
286
+ .vmsd-menu.vmsd-body-overlay {
287
+ position: fixed;
288
+ right: auto;
289
+ top: auto;
290
+ bottom: auto;
291
+ max-width: calc(100vw - 16px);
292
+ z-index: 100000;
293
+ }
294
+
295
+ .vmsd-menu.vmsd-bottom {
296
+ top: calc(100% + 8px);
297
+ }
298
+
299
+ .vmsd-menu.vmsd-top {
300
+ bottom: calc(100% + 8px);
301
+ }
302
+
303
+ .vmsd-menu.vmsd-body-overlay.vmsd-bottom,
304
+ .vmsd-menu.vmsd-body-overlay.vmsd-top {
305
+ top: auto;
306
+ bottom: auto;
307
+ }
308
+
309
+ .vmsd-toolbar {
310
+ display: grid;
311
+ gap: 0;
312
+ padding: 0;
313
+ background-color: var(--vmsd-bg);
314
+ }
315
+
316
+ .vmsd-search-shell {
317
+ position: relative;
318
+ min-height: 52px;
319
+ border-bottom: 1px solid var(--vmsd-divider);
320
+ background-color: var(--vmsd-bg);
321
+ }
322
+
323
+ .vmsd-search-icon {
324
+ position: absolute;
325
+ top: 50%;
326
+ left: 16px;
327
+ width: 18px;
328
+ height: 18px;
329
+ color: var(--vmsd-muted);
330
+ fill: currentColor;
331
+ pointer-events: none;
332
+ transform: translateY(-50%);
333
+ }
334
+
335
+ .vmsd-search-input {
336
+ width: 100%;
337
+ min-height: 52px;
338
+ border: 0;
339
+ border-radius: 0;
340
+ background-color: var(--vmsd-bg);
341
+ color: var(--vmsd-ink);
342
+ font: inherit;
343
+ padding: 0 44px 0 48px;
344
+ }
345
+
346
+ .vmsd-search-input:focus {
347
+ outline: none;
348
+ box-shadow: inset 0 0 0 2px var(--vmsd-primary);
349
+ }
350
+
351
+ .vmsd-search-clear {
352
+ position: absolute;
353
+ top: 50%;
354
+ right: 16px;
355
+ display: inline-grid;
356
+ width: 18px;
357
+ height: 18px;
358
+ place-items: center;
359
+ transform: translateY(-50%);
360
+ border-radius: 999px;
361
+ color: var(--vmsd-muted);
362
+ }
363
+
364
+ .vmsd-bulk-actions {
365
+ display: block;
366
+ align-items: center;
367
+ padding: 0;
368
+ border-bottom: 1px solid var(--vmsd-divider);
369
+ background: var(--vmsd-section-bg);
370
+ }
371
+
372
+ .vmsd-inline-button {
373
+ display: flex;
374
+ align-items: center;
375
+ gap: 10px;
376
+ width: 100%;
377
+ min-height: 39px;
378
+ border: 0;
379
+ border-radius: 0;
380
+ background: transparent;
381
+ color: var(--vmsd-ink);
382
+ cursor: pointer;
383
+ font: inherit;
384
+ font-weight: 500;
385
+ padding: 10px 14px;
386
+ text-align: left;
387
+ }
388
+
389
+ .vmsd-inline-button:hover {
390
+ background-color: var(--vmsd-surface);
391
+ }
392
+
393
+ .vmsd-inline-button:disabled {
394
+ opacity: 0.58;
395
+ cursor: not-allowed;
396
+ }
397
+
398
+ .vmsd-add-button {
399
+ justify-content: center;
400
+ border-top: 1px solid var(--vmsd-divider);
401
+ color: var(--vmsd-primary);
402
+ font-weight: 700;
403
+ }
404
+
405
+ .vmsd-list {
406
+ max-height: 300px;
407
+ overflow: auto;
408
+ padding: 8px;
409
+ background: var(--vmsd-bg);
410
+ scrollbar-width: thin;
411
+ scrollbar-color: rgba(125, 119, 134, 0.34) transparent;
412
+ }
413
+
414
+ .vmsd-list:focus {
415
+ outline: none;
416
+ }
417
+
418
+ .vmsd-menu ::-webkit-scrollbar {
419
+ width: 10px;
420
+ }
421
+
422
+ .vmsd-menu ::-webkit-scrollbar-thumb {
423
+ background: rgba(125, 119, 134, 0.34);
424
+ border: 2px solid transparent;
425
+ border-radius: 999px;
426
+ background-clip: padding-box;
427
+ }
428
+
429
+ .vmsd-menu ::-webkit-scrollbar-track {
430
+ background: transparent;
431
+ }
432
+
433
+ .vmsd-option {
434
+ display: flex;
435
+ align-items: center;
436
+ gap: 10px;
437
+ min-height: 0;
438
+ margin: 4px;
439
+ padding: 12px 14px;
440
+ border-radius: 14px;
441
+ background: transparent;
442
+ color: inherit;
443
+ text-align: left;
444
+ cursor: pointer;
445
+ line-height: 1.35;
446
+ }
447
+
448
+ .vmsd-option:hover {
449
+ background-color: var(--vmsd-surface);
450
+ }
451
+
452
+ .vmsd-option:focus-visible {
453
+ outline: 3px solid var(--vmsd-focus);
454
+ outline-offset: 1px;
455
+ }
456
+
457
+ .vmsd-option.vmsd-selected {
458
+ background-color: var(--vmsd-primary-soft);
459
+ color: var(--vmsd-primary);
460
+ }
461
+
462
+ .vmsd-option.vmsd-disabled {
463
+ opacity: 0.54;
464
+ cursor: not-allowed;
465
+ }
466
+
467
+ .vmsd-checkbox {
468
+ position: relative;
469
+ box-sizing: content-box;
470
+ display: inline-grid;
471
+ place-items: center;
472
+ align-self: center;
473
+ flex: 0 0 auto;
474
+ width: 18px;
475
+ height: 18px;
476
+ margin-top: 0;
477
+ border: 2px solid var(--vmsd-border-strong);
478
+ border-radius: 6px;
479
+ background-color: var(--vmsd-bg);
480
+ line-height: 0;
481
+ vertical-align: middle;
482
+ }
483
+
484
+ .vmsd-checkbox[data-checked="true"] {
485
+ border-color: var(--vmsd-primary);
486
+ background-color: var(--vmsd-primary);
487
+ }
488
+
489
+ .vmsd-checkbox[data-checked="true"]::after {
490
+ box-sizing: content-box;
491
+ content: "";
492
+ position: absolute;
493
+ top: 50%;
494
+ left: 50%;
495
+ width: 8px;
496
+ height: 4px;
497
+ margin-top: 0;
498
+ border-color: #fff;
499
+ border-style: solid;
500
+ border-width: 0 0 2px 2px;
501
+ transform: translate(-50%, -62%) rotate(-45deg);
502
+ transform-origin: 50%;
503
+ }
504
+
505
+ .vmsd-option-body {
506
+ min-width: 0;
507
+ flex: 1;
508
+ }
509
+
510
+ .vmsd-option-label {
511
+ font-weight: 500;
512
+ }
513
+
514
+ .vmsd-option-hint {
515
+ display: block;
516
+ margin-top: 3px;
517
+ color: var(--vmsd-muted);
518
+ font-size: 12px;
519
+ }
520
+
521
+ .vmsd-group {
522
+ margin-bottom: 8px;
523
+ }
524
+
525
+ .vmsd-group:last-child {
526
+ margin-bottom: 0;
527
+ }
528
+
529
+ .vmsd-group-header {
530
+ display: flex;
531
+ align-items: center;
532
+ justify-content: space-between;
533
+ gap: 8px;
534
+ padding: 9px 10px;
535
+ color: var(--vmsd-muted);
536
+ font-size: 12px;
537
+ font-weight: 800;
538
+ letter-spacing: 0.08em;
539
+ text-transform: uppercase;
540
+ }
541
+
542
+ .vmsd-group-action {
543
+ color: var(--vmsd-primary);
544
+ font-size: 12px;
545
+ font-weight: 800;
546
+ }
547
+
548
+ .vmsd-state {
549
+ padding: 18px 12px;
550
+ text-align: center;
551
+ color: var(--vmsd-muted);
552
+ }
553
+
554
+ .theme-material,
555
+ .skin-material {
556
+ --vmsd-primary: #3f51b5;
557
+ --vmsd-primary-soft: rgba(63, 81, 181, 0.12);
558
+ --vmsd-bg: #ffffff;
559
+ --vmsd-surface: #f5f7fb;
560
+ --vmsd-surface-muted: #e8eaf6;
561
+ --vmsd-border: #c5cae9;
562
+ --vmsd-border-strong: #7986cb;
563
+ --vmsd-ink: #212121;
564
+ --vmsd-muted: #5f6368;
565
+ --vmsd-chip-bg: #e8eaf6;
566
+ --vmsd-chip-text: #303f9f;
567
+ --vmsd-chip-remove: #303f9f;
568
+ --vmsd-divider: rgba(125, 119, 134, 0.16);
569
+ --vmsd-section-bg: #f5f7fb;
570
+ --vmsd-focus: rgba(63, 81, 181, 0.32);
571
+ --vmsd-shadow: 0 1px 2px rgba(33, 33, 33, 0.16), 0 12px 32px rgba(63, 81, 181, 0.12);
572
+ --vmsd-shadow-soft: 0 1px 2px rgba(33, 33, 33, 0.12), 0 4px 12px rgba(33, 33, 33, 0.08);
573
+ }
574
+
575
+ .theme-material .vmsd-trigger,
576
+ .skin-material .vmsd-trigger {
577
+ min-height: 56px;
578
+ border-radius: 18px;
579
+ padding: 11px 54px 11px 16px;
580
+ }
581
+
582
+ .theme-material .vmsd-menu,
583
+ .skin-material .vmsd-menu,
584
+ .vmsd-menu.theme-material,
585
+ .vmsd-menu.skin-material {
586
+ border-radius: 22px;
587
+ }
588
+
589
+ .theme-material .vmsd-option,
590
+ .skin-material .vmsd-option {
591
+ border-radius: 14px;
592
+ margin: 4px;
593
+ padding: 12px 14px;
594
+ }
595
+
596
+ .theme-dark,
597
+ .skin-dark {
598
+ --vmsd-primary: #8ab4f8;
599
+ --vmsd-primary-soft: rgba(138, 180, 248, 0.18);
600
+ --vmsd-bg: #151a23;
601
+ --vmsd-surface: #202736;
602
+ --vmsd-surface-muted: #111722;
603
+ --vmsd-border: #384456;
604
+ --vmsd-border-strong: #8ab4f8;
605
+ --vmsd-ink: #edf2f7;
606
+ --vmsd-muted: #aab6c5;
607
+ --vmsd-chip-bg: #263247;
608
+ --vmsd-chip-text: #d7e6ff;
609
+ --vmsd-chip-remove: #d7e6ff;
610
+ --vmsd-divider: rgba(170, 182, 197, 0.18);
611
+ --vmsd-section-bg: #202736;
612
+ --vmsd-focus: rgba(138, 180, 248, 0.34);
613
+ --vmsd-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
614
+ --vmsd-shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.45), 0 10px 24px rgba(0, 0, 0, 0.28);
615
+ }
616
+
617
+ .theme-custom,
618
+ .skin-custom {
619
+ --vmsd-primary: var(--stackline-ms-primary, #0f766e);
620
+ --vmsd-primary-soft: var(--stackline-ms-primary-soft, rgba(15, 118, 110, 0.14));
621
+ --vmsd-bg: var(--stackline-ms-surface, #ffffff);
622
+ --vmsd-surface: var(--stackline-ms-surface-soft, #ecfdf5);
623
+ --vmsd-surface-muted: var(--stackline-ms-surface-muted, #d1fae5);
624
+ --vmsd-border: var(--stackline-ms-outline, #99f6e4);
625
+ --vmsd-border-strong: var(--stackline-ms-outline-strong, #0f766e);
626
+ --vmsd-ink: var(--stackline-ms-on-surface, #102a2a);
627
+ --vmsd-muted: var(--stackline-ms-on-surface-muted, #47615f);
628
+ --vmsd-chip-bg: var(--stackline-ms-chip-bg, #ccfbf1);
629
+ --vmsd-chip-text: var(--stackline-ms-chip-text, #115e59);
630
+ --vmsd-chip-remove: var(--stackline-ms-chip-remove, #115e59);
631
+ --vmsd-divider: var(--stackline-ms-divider, rgba(15, 118, 110, 0.18));
632
+ --vmsd-section-bg: var(--stackline-ms-section-bg, #ecfdf5);
633
+ --vmsd-focus: var(--stackline-ms-focus, rgba(15, 118, 110, 0.28));
634
+ --vmsd-shadow: var(--stackline-ms-shadow, 0 18px 42px rgba(15, 118, 110, 0.15));
635
+ --vmsd-shadow-soft: var(--stackline-ms-shadow-soft, 0 1px 2px rgba(15, 118, 110, 0.16), 0 8px 18px rgba(15, 118, 110, 0.09));
636
+ }
637
+
638
+ .theme-brand,
639
+ .skin-brand {
640
+ --stackline-ms-primary: #7c3aed;
641
+ --stackline-ms-primary-soft: rgba(124, 58, 237, 0.14);
642
+ --stackline-ms-surface: #ffffff;
643
+ --stackline-ms-surface-soft: #f5f3ff;
644
+ --stackline-ms-surface-muted: #ede9fe;
645
+ --stackline-ms-outline: #c4b5fd;
646
+ --stackline-ms-outline-strong: #7c3aed;
647
+ --stackline-ms-on-surface: #22183f;
648
+ --stackline-ms-on-surface-muted: #6b5d80;
649
+ --stackline-ms-chip-bg: #ede9fe;
650
+ --stackline-ms-chip-text: #5b21b6;
651
+ --stackline-ms-chip-remove: #5b21b6;
652
+ --stackline-ms-divider: rgba(124, 58, 237, 0.16);
653
+ --stackline-ms-section-bg: #f5f3ff;
654
+ }
655
+
656
+ .theme-classic,
657
+ .skin-classic {
658
+ --vmsd-primary: #0079fe;
659
+ --vmsd-primary-soft: #e9f4ff;
660
+ --vmsd-bg: #ffffff;
661
+ --vmsd-surface: #f5f5f5;
662
+ --vmsd-surface-muted: #e9f4ff;
663
+ --vmsd-border: #cccccc;
664
+ --vmsd-border-strong: #0079fe;
665
+ --vmsd-ink: #333333;
666
+ --vmsd-muted: #333333;
667
+ --vmsd-chip-bg: #0079fe;
668
+ --vmsd-chip-text: #ffffff;
669
+ --vmsd-chip-remove: #ffffff;
670
+ --vmsd-focus: rgba(0, 121, 254, 0.26);
671
+ --vmsd-divider: #cccccc;
672
+ --vmsd-section-bg: #ffffff;
673
+ --vmsd-shadow: 0 1px 5px #959595;
674
+ --vmsd-shadow-soft: 0 1px 5px #959595;
675
+ color: #333333;
676
+ }
677
+
678
+ .theme-classic .vmsd-trigger,
679
+ .skin-classic .vmsd-trigger {
680
+ flex-wrap: nowrap;
681
+ gap: 6px;
682
+ min-height: 42px;
683
+ border-radius: 3px;
684
+ padding: 10px 68px 10px 10px;
685
+ border: 1px solid #cccccc;
686
+ background: #ffffff;
687
+ box-shadow: 0 1px 5px #959595;
688
+ color: #333333;
689
+ font-size: 14px;
690
+ line-height: 1.35;
691
+ }
692
+
693
+ .theme-classic .vmsd-trigger:hover,
694
+ .skin-classic .vmsd-trigger:hover,
695
+ .theme-classic[data-open="true"] .vmsd-trigger,
696
+ .skin-classic[data-open="true"] .vmsd-trigger {
697
+ border-color: #cccccc;
698
+ box-shadow: 0 1px 5px #959595;
699
+ }
700
+
701
+ .theme-classic .vmsd-trigger.vmsd-disabled,
702
+ .skin-classic .vmsd-trigger.vmsd-disabled {
703
+ background: #cccccc;
704
+ opacity: 1;
705
+ }
706
+
707
+ .theme-classic .vmsd-placeholder,
708
+ .theme-classic .vmsd-single-value,
709
+ .skin-classic .vmsd-placeholder,
710
+ .skin-classic .vmsd-single-value {
711
+ color: #333333;
712
+ font-size: 14px;
713
+ }
714
+
715
+ .theme-classic .vmsd-value,
716
+ .theme-classic .vmsd-badge-list,
717
+ .skin-classic .vmsd-value,
718
+ .skin-classic .vmsd-badge-list {
719
+ align-items: center;
720
+ gap: 4px;
721
+ flex-wrap: wrap;
722
+ min-width: 0;
723
+ }
724
+
725
+ .theme-classic .vmsd-badge,
726
+ .skin-classic .vmsd-badge {
727
+ display: inline-block;
728
+ min-height: 0;
729
+ margin: 2px 0 0;
730
+ border-radius: 2px;
731
+ padding: 2px 24px 2px 6px;
732
+ box-shadow: none;
733
+ color: #ffffff;
734
+ line-height: 1.4;
735
+ }
736
+
737
+ .theme-classic .vmsd-badge-label,
738
+ .skin-classic .vmsd-badge-label {
739
+ display: inline;
740
+ color: #ffffff;
741
+ font-size: 14px;
742
+ font-weight: 400;
743
+ line-height: 1.4;
744
+ }
745
+
746
+ .theme-classic .vmsd-badge-remove,
747
+ .skin-classic .vmsd-badge-remove {
748
+ right: 5px;
749
+ width: 14px;
750
+ height: 14px;
751
+ color: #ffffff;
752
+ }
753
+
754
+ .theme-classic .vmsd-badge-remove .vmsd-icon,
755
+ .skin-classic .vmsd-badge-remove .vmsd-icon {
756
+ width: 9px;
757
+ height: 9px;
758
+ }
759
+
760
+ .theme-classic .vmsd-overflow,
761
+ .skin-classic .vmsd-overflow {
762
+ color: #333333;
763
+ font-size: 14px;
764
+ font-weight: 400;
765
+ }
766
+
767
+ .theme-classic .vmsd-actions,
768
+ .skin-classic .vmsd-actions {
769
+ right: 10px;
770
+ gap: 12px;
771
+ }
772
+
773
+ .theme-classic .vmsd-clear,
774
+ .skin-classic .vmsd-clear {
775
+ width: 18px;
776
+ height: 18px;
777
+ color: #333333;
778
+ }
779
+
780
+ .theme-classic .vmsd-clear .vmsd-icon,
781
+ .skin-classic .vmsd-clear .vmsd-icon {
782
+ width: 11px;
783
+ height: 11px;
784
+ }
785
+
786
+ .theme-classic .vmsd-arrow-button,
787
+ .skin-classic .vmsd-arrow-button {
788
+ width: 20px;
789
+ height: 20px;
790
+ color: #333333;
791
+ }
792
+
793
+ .theme-classic .vmsd-menu,
794
+ .skin-classic .vmsd-menu,
795
+ .vmsd-menu.theme-classic,
796
+ .vmsd-menu.skin-classic {
797
+ overflow: visible;
798
+ border: 1px solid #cccccc;
799
+ border-radius: 3px;
800
+ background: #ffffff;
801
+ box-shadow: 0 1px 5px #959595;
802
+ }
803
+
804
+ .vmsd-menu.theme-classic.vmsd-bottom,
805
+ .vmsd-menu.skin-classic.vmsd-bottom {
806
+ top: calc(100% + 14px);
807
+ }
808
+
809
+ .vmsd-menu.theme-classic.vmsd-top,
810
+ .vmsd-menu.skin-classic.vmsd-top {
811
+ bottom: calc(100% + 14px);
812
+ }
813
+
814
+ .vmsd-menu.vmsd-body-overlay.vmsd-bottom,
815
+ .vmsd-menu.vmsd-body-overlay.vmsd-top {
816
+ bottom: auto;
817
+ }
818
+
819
+ .vmsd-menu.theme-classic::before,
820
+ .vmsd-menu.theme-classic::after,
821
+ .vmsd-menu.skin-classic::before,
822
+ .vmsd-menu.skin-classic::after {
823
+ content: "";
824
+ position: absolute;
825
+ left: 15px;
826
+ width: 0;
827
+ height: 0;
828
+ border-right: 13px solid transparent;
829
+ border-left: 13px solid transparent;
830
+ }
831
+
832
+ .vmsd-menu.theme-classic.vmsd-bottom::before,
833
+ .vmsd-menu.skin-classic.vmsd-bottom::before {
834
+ top: -15px;
835
+ border-bottom: 15px solid #cccccc;
836
+ }
837
+
838
+ .vmsd-menu.theme-classic.vmsd-bottom::after,
839
+ .vmsd-menu.skin-classic.vmsd-bottom::after {
840
+ top: -14px;
841
+ border-bottom: 15px solid #ffffff;
842
+ }
843
+
844
+ .vmsd-menu.theme-classic.vmsd-top::before,
845
+ .vmsd-menu.skin-classic.vmsd-top::before {
846
+ bottom: -15px;
847
+ border-top: 15px solid #cccccc;
848
+ }
849
+
850
+ .vmsd-menu.theme-classic.vmsd-top::after,
851
+ .vmsd-menu.skin-classic.vmsd-top::after {
852
+ bottom: -14px;
853
+ border-top: 15px solid #ffffff;
854
+ }
855
+
856
+ .theme-classic .vmsd-toolbar,
857
+ .skin-classic .vmsd-toolbar,
858
+ .vmsd-menu.theme-classic .vmsd-toolbar,
859
+ .vmsd-menu.skin-classic .vmsd-toolbar {
860
+ gap: 0;
861
+ padding: 0;
862
+ background: #ffffff;
863
+ }
864
+
865
+ .theme-classic .vmsd-search-shell,
866
+ .skin-classic .vmsd-search-shell,
867
+ .vmsd-menu.theme-classic .vmsd-search-shell,
868
+ .vmsd-menu.skin-classic .vmsd-search-shell {
869
+ min-height: 35px;
870
+ border-bottom: 1px solid #cccccc;
871
+ background: #ffffff;
872
+ }
873
+
874
+ .theme-classic .vmsd-search-icon,
875
+ .skin-classic .vmsd-search-icon,
876
+ .vmsd-menu.theme-classic .vmsd-search-icon,
877
+ .vmsd-menu.skin-classic .vmsd-search-icon {
878
+ left: 13px;
879
+ width: 18px;
880
+ height: 18px;
881
+ }
882
+
883
+ .theme-classic .vmsd-search-input,
884
+ .skin-classic .vmsd-search-input,
885
+ .vmsd-menu.theme-classic .vmsd-search-input,
886
+ .vmsd-menu.skin-classic .vmsd-search-input {
887
+ min-height: 35px;
888
+ height: 35px;
889
+ padding: 0 35px;
890
+ border: 0;
891
+ color: #333333;
892
+ }
893
+
894
+ .theme-classic .vmsd-search-input:focus,
895
+ .skin-classic .vmsd-search-input:focus,
896
+ .vmsd-menu.theme-classic .vmsd-search-input:focus,
897
+ .vmsd-menu.skin-classic .vmsd-search-input:focus {
898
+ box-shadow: none;
899
+ }
900
+
901
+ .theme-classic .vmsd-search-clear,
902
+ .skin-classic .vmsd-search-clear,
903
+ .vmsd-menu.theme-classic .vmsd-search-clear,
904
+ .vmsd-menu.skin-classic .vmsd-search-clear {
905
+ right: 13px;
906
+ }
907
+
908
+ .theme-classic .vmsd-bulk-actions,
909
+ .skin-classic .vmsd-bulk-actions,
910
+ .vmsd-menu.theme-classic .vmsd-bulk-actions,
911
+ .vmsd-menu.skin-classic .vmsd-bulk-actions {
912
+ border-top: 0;
913
+ border-bottom: 1px solid #cccccc;
914
+ background: #ffffff;
915
+ }
916
+
917
+ .theme-classic .vmsd-inline-button,
918
+ .skin-classic .vmsd-inline-button,
919
+ .vmsd-menu.theme-classic .vmsd-inline-button,
920
+ .vmsd-menu.skin-classic .vmsd-inline-button {
921
+ min-height: 35px;
922
+ border-radius: 0;
923
+ color: #333333;
924
+ font-weight: 400;
925
+ padding: 10px;
926
+ }
927
+
928
+ .theme-classic .vmsd-inline-button:hover,
929
+ .skin-classic .vmsd-inline-button:hover,
930
+ .vmsd-menu.theme-classic .vmsd-inline-button:hover,
931
+ .vmsd-menu.skin-classic .vmsd-inline-button:hover {
932
+ background: #f5f5f5;
933
+ }
934
+
935
+ .theme-classic .vmsd-list,
936
+ .skin-classic .vmsd-list,
937
+ .vmsd-menu.theme-classic .vmsd-list,
938
+ .vmsd-menu.skin-classic .vmsd-list {
939
+ margin: 0;
940
+ padding: 0;
941
+ background: #ffffff;
942
+ }
943
+
944
+ .theme-classic .vmsd-option,
945
+ .skin-classic .vmsd-option,
946
+ .vmsd-menu.theme-classic .vmsd-option,
947
+ .vmsd-menu.skin-classic .vmsd-option {
948
+ border-radius: 0;
949
+ margin: 0;
950
+ padding: 10px;
951
+ color: #333333;
952
+ line-height: 1.35;
953
+ }
954
+
955
+ .theme-classic .vmsd-option:hover,
956
+ .skin-classic .vmsd-option:hover,
957
+ .vmsd-menu.theme-classic .vmsd-option:hover,
958
+ .vmsd-menu.skin-classic .vmsd-option:hover {
959
+ background: #f5f5f5;
960
+ }
961
+
962
+ .theme-classic .vmsd-option.vmsd-selected,
963
+ .skin-classic .vmsd-option.vmsd-selected,
964
+ .vmsd-menu.theme-classic .vmsd-option.vmsd-selected,
965
+ .vmsd-menu.skin-classic .vmsd-option.vmsd-selected {
966
+ background: #e9f4ff;
967
+ color: #333333;
968
+ }
969
+
970
+ .theme-classic .vmsd-checkbox,
971
+ .skin-classic .vmsd-checkbox,
972
+ .vmsd-menu.theme-classic .vmsd-checkbox,
973
+ .vmsd-menu.skin-classic .vmsd-checkbox {
974
+ width: 14px;
975
+ height: 14px;
976
+ border: 2px solid #0079fe;
977
+ border-radius: 0;
978
+ background: #ffffff;
979
+ }
980
+
981
+ .theme-classic .vmsd-checkbox[data-checked="true"],
982
+ .skin-classic .vmsd-checkbox[data-checked="true"],
983
+ .vmsd-menu.theme-classic .vmsd-checkbox[data-checked="true"],
984
+ .vmsd-menu.skin-classic .vmsd-checkbox[data-checked="true"] {
985
+ border-color: #0079fe;
986
+ background: #0079fe;
987
+ }
988
+
989
+ .theme-classic .vmsd-checkbox[data-checked="true"]::after,
990
+ .skin-classic .vmsd-checkbox[data-checked="true"]::after,
991
+ .vmsd-menu.theme-classic .vmsd-checkbox[data-checked="true"]::after,
992
+ .vmsd-menu.skin-classic .vmsd-checkbox[data-checked="true"]::after {
993
+ top: 50%;
994
+ left: 50%;
995
+ width: 8px;
996
+ height: 3px;
997
+ margin-top: 0;
998
+ border-width: 0 0 3px 3px;
999
+ transform: translate(-50%, -62%) rotate(-45deg);
1000
+ }
1001
+
1002
+ .theme-classic .vmsd-option-label,
1003
+ .skin-classic .vmsd-option-label,
1004
+ .vmsd-menu.theme-classic .vmsd-option-label,
1005
+ .vmsd-menu.skin-classic .vmsd-option-label {
1006
+ color: #000000;
1007
+ font-weight: 300;
1008
+ }
1009
+
1010
+ .theme-classic .vmsd-group-header,
1011
+ .skin-classic .vmsd-group-header,
1012
+ .vmsd-menu.theme-classic .vmsd-group-header,
1013
+ .vmsd-menu.skin-classic .vmsd-group-header {
1014
+ color: #000000;
1015
+ font-size: 14px;
1016
+ font-weight: 700;
1017
+ letter-spacing: 0;
1018
+ text-transform: capitalize;
1019
+ }
1020
+
1021
+ .custom-class-example {
1022
+ --vmsd-primary: #0f766e;
1023
+ --vmsd-primary-soft: #ccfbf1;
1024
+ --vmsd-bg: #f8fffd;
1025
+ --vmsd-surface: #ecfdf5;
1026
+ --vmsd-border: #99f6e4;
1027
+ --vmsd-border-strong: #0f766e;
1028
+ }
1029
+
1030
+ @media (max-width: 720px) {
1031
+ .vmsd-trigger {
1032
+ align-items: flex-start;
1033
+ padding-right: 54px;
1034
+ }
1035
+ }
1036
+
1037
+ /* stackline-vue2-live-20260527 */
1038
+ `;
1039
+ function ensureDropdownStyles() {
1040
+ if (typeof document === "undefined") {
1041
+ return;
1042
+ }
1043
+ if (document.getElementById(STYLE_ID)) {
1044
+ return;
1045
+ }
1046
+ const tag = document.createElement("style");
1047
+ tag.id = STYLE_ID;
1048
+ tag.textContent = styles;
1049
+ document.head.appendChild(tag);
1050
+ }
1051
+
1052
+ // src/VueMultiselectDropdown.ts
1053
+ var DEFAULT_SETTINGS = {
1054
+ singleSelection: false,
1055
+ text: "Select",
1056
+ enableCheckAll: true,
1057
+ selectAllText: "Select All",
1058
+ unSelectAllText: "Unselect All",
1059
+ filterSelectAllText: "Select filtered",
1060
+ filterUnSelectAllText: "Unselect filtered",
1061
+ enableFilterSelectAll: true,
1062
+ enableSearchFilter: false,
1063
+ searchBy: [],
1064
+ maxHeight: 300,
1065
+ badgeShowLimit: Number.MAX_SAFE_INTEGER,
1066
+ classes: "",
1067
+ limitSelection: 0,
1068
+ disabled: false,
1069
+ searchPlaceholderText: "Search",
1070
+ groupBy: "",
1071
+ showCheckbox: true,
1072
+ noDataLabel: "No Data Available",
1073
+ searchAutofocus: true,
1074
+ lazyLoading: false,
1075
+ labelKey: "itemName",
1076
+ primaryKey: "id",
1077
+ position: "bottom",
1078
+ autoPosition: true,
1079
+ loading: false,
1080
+ selectGroup: false,
1081
+ addNewItemOnFilter: false,
1082
+ addNewButtonText: "Add",
1083
+ escapeToClose: true,
1084
+ clearAll: true,
1085
+ closeDropDownOnSelection: false,
1086
+ tagToBody: false,
1087
+ appendToBody: false,
1088
+ theme: "",
1089
+ skin: "classic",
1090
+ ariaLabel: "Multiselect dropdown",
1091
+ listboxAriaLabel: "Dropdown options",
1092
+ searchAriaLabel: "Search options",
1093
+ clearSearchAriaLabel: "Clear search",
1094
+ clearAllAriaLabel: "Clear selected options",
1095
+ removeItemAriaLabel: "Remove selected option",
1096
+ openDropdownAriaLabel: "Open dropdown",
1097
+ closeDropdownAriaLabel: "Close dropdown",
1098
+ loadingText: "Loading options"
1099
+ };
1100
+ function iconPath(name) {
1101
+ if (name === "remove") {
1102
+ return "M28.228,23.986L47.092,5.122c1.172-1.171,1.172-3.071,0-4.242c-1.172-1.172-3.07-1.172-4.242,0L23.986,19.744L5.121,0.88c-1.172-1.172-3.07-1.172-4.242,0c-1.172,1.171-1.172,3.071,0,4.242l18.865,18.864L0.879,42.85c-1.172,1.171-1.172,3.071,0,4.242C1.465,47.677,2.233,47.97,3,47.97s1.535-0.293,2.121-0.879l18.865-18.864L42.85,47.091c0.586,0.586,1.354,0.879,2.121,0.879s1.535-0.293,2.121-0.879c1.172-1.171,1.172-3.071,0-4.242L28.228,23.986z";
1103
+ }
1104
+ if (name === "clear") {
1105
+ return "M44.373,7.603c-10.137-10.137-26.632-10.138-36.77,0c-10.138,10.138-10.137,26.632,0,36.77s26.632,10.138,36.77,0C54.51,34.235,54.51,17.74,44.373,7.603z M36.241,36.241c-0.781,0.781-2.047,0.781-2.828,0l-7.425-7.425l-7.778,7.778c-0.781,0.781-2.047,0.781-2.828,0c-0.781-0.781-0.781-2.047,0-2.828l7.778-7.778l-7.425-7.425c-0.781-0.781-0.781-2.048,0-2.828c0.781-0.781,2.047-0.781,2.828,0l7.425,7.425l7.071-7.071c0.781-0.781,2.047-0.781,2.828,0c0.781,0.781,0.781,2.047,0,2.828l-7.071,7.071l7.425,7.425C37.022,34.194,37.022,35.46,36.241,36.241z";
1106
+ }
1107
+ if (name === "search") {
1108
+ return "M602.531,549.736l-184.31-185.368c26.679-37.72,42.528-83.729,42.528-133.548C460.75,103.35,357.997,0,231.258,0C104.518,0,1.765,103.35,1.765,230.82c0,127.47,102.753,230.82,229.493,230.82c49.53,0,95.271-15.944,132.78-42.777l184.31,185.366c7.482,7.521,17.292,11.291,27.102,11.291c9.812,0,19.62-3.77,27.083-11.291C617.496,589.188,617.496,564.777,602.531,549.736z M355.9,319.763l-15.042,21.273L319.7,356.174c-26.083,18.658-56.667,28.526-88.442,28.526c-84.365,0-152.995-69.035-152.995-153.88c0-84.846,68.63-153.88,152.995-153.88s152.996,69.034,152.996,153.88C384.271,262.769,374.462,293.526,355.9,319.763z";
1109
+ }
1110
+ if (name === "angle-up") {
1111
+ return "M604.501,440.509L325.398,134.956c-5.331-5.357-12.423-7.627-19.386-7.27c-6.989-0.357-14.056,1.913-19.387,7.27L7.499,440.509c-9.999,10.024-9.999,26.298,0,36.323s26.223,10.024,36.222,0l262.293-287.164L568.28,476.832c9.999,10.024,26.222,10.024,36.221,0C614.5,466.809,614.5,450.534,604.501,440.509z";
1112
+ }
1113
+ return "M604.501,134.782c-9.999-10.05-26.222-10.05-36.221,0L306.014,422.558L43.721,134.782c-9.999-10.05-26.223-10.05-36.222,0s-9.999,26.35,0,36.399l279.103,306.241c5.331,5.357,12.422,7.652,19.386,7.296c6.988,0.356,14.055-1.939,19.386-7.296l279.128-306.268C614.5,161.106,614.5,144.832,604.501,134.782z";
1114
+ }
1115
+ function renderIcon(h, name, className = "vmsd-icon") {
1116
+ const viewBox = name === "remove" ? "0 0 47.971 47.971" : name === "clear" ? "0 0 51.976 51.976" : name === "search" ? "0 0 615.52 615.52" : "0 0 612 612";
1117
+ return h("svg", { class: className, attrs: { viewBox, focusable: "false", "aria-hidden": "true" } }, [
1118
+ h("path", { attrs: { d: iconPath(name) } })
1119
+ ]);
1120
+ }
1121
+ function isPrimitiveItem(item) {
1122
+ return typeof item === "string" || typeof item === "number" || typeof item === "boolean";
1123
+ }
1124
+ function getLabel(item, settings) {
1125
+ if (isPrimitiveItem(item)) {
1126
+ return String(item);
1127
+ }
1128
+ const keys = [settings.labelKey, "itemName", "name", "label", "title", "value"].filter(Boolean);
1129
+ for (const key of keys) {
1130
+ if (key && item[key] != null) {
1131
+ return String(item[key]);
1132
+ }
1133
+ }
1134
+ return JSON.stringify(item);
1135
+ }
1136
+ function getPrimaryValue(item, settings) {
1137
+ if (isPrimitiveItem(item)) {
1138
+ return String(item);
1139
+ }
1140
+ const keys = [settings.primaryKey, "id", "value", "key"].filter(Boolean);
1141
+ for (const key of keys) {
1142
+ if (key && item[key] != null) {
1143
+ return String(item[key]);
1144
+ }
1145
+ }
1146
+ return getLabel(item, settings);
1147
+ }
1148
+ function isDisabledItem(item) {
1149
+ return !isPrimitiveItem(item) && Boolean(item.disabled);
1150
+ }
1151
+ function itemMatchesQuery(item, query, settings) {
1152
+ if (!query.trim()) {
1153
+ return true;
1154
+ }
1155
+ const needle = query.trim().toLowerCase();
1156
+ const haystack = /* @__PURE__ */ new Set();
1157
+ haystack.add(getLabel(item, settings).toLowerCase());
1158
+ if (!isPrimitiveItem(item)) {
1159
+ const searchKeys = settings.searchBy.length ? settings.searchBy : [settings.labelKey];
1160
+ for (const key of searchKeys) {
1161
+ if (key && item[key] != null) {
1162
+ haystack.add(String(item[key]).toLowerCase());
1163
+ }
1164
+ }
1165
+ }
1166
+ for (const value of haystack) {
1167
+ if (value.indexOf(needle) >= 0) {
1168
+ return true;
1169
+ }
1170
+ }
1171
+ return false;
1172
+ }
1173
+ function getGroupName(item, settings) {
1174
+ if (!settings.groupBy) {
1175
+ return "";
1176
+ }
1177
+ if (typeof settings.groupBy === "function") {
1178
+ return settings.groupBy(item);
1179
+ }
1180
+ if (!isPrimitiveItem(item)) {
1181
+ const groupKey = settings.groupBy;
1182
+ const objectItem = item;
1183
+ if (groupKey in objectItem) {
1184
+ return String(objectItem[groupKey] || "");
1185
+ }
1186
+ }
1187
+ return "";
1188
+ }
1189
+ function buildGroups(items, settings) {
1190
+ if (!settings.groupBy) {
1191
+ return [];
1192
+ }
1193
+ const map = /* @__PURE__ */ new Map();
1194
+ for (const item of items) {
1195
+ const groupName = getGroupName(item, settings) || "Ungrouped";
1196
+ const current = map.get(groupName) || [];
1197
+ current.push(item);
1198
+ map.set(groupName, current);
1199
+ }
1200
+ return Array.from(map.entries()).map(([name, groupedItems]) => ({ name, items: groupedItems }));
1201
+ }
1202
+ function mergeUniqueItems(base, extra, settings) {
1203
+ const bucket = /* @__PURE__ */ new Map();
1204
+ for (const item of base.concat(extra)) {
1205
+ bucket.set(getPrimaryValue(item, settings), item);
1206
+ }
1207
+ return Array.from(bucket.values());
1208
+ }
1209
+ function callRenderFunction(renderFunction, h, item, context) {
1210
+ if (!renderFunction) {
1211
+ return null;
1212
+ }
1213
+ return renderFunction(item, context, h);
1214
+ }
1215
+ function escapeSelectorValue(value) {
1216
+ if (typeof CSS !== "undefined" && typeof CSS.escape === "function") {
1217
+ return CSS.escape(value);
1218
+ }
1219
+ return value.replace(/["\\]/g, "\\$&");
1220
+ }
1221
+ function isActivationKey(event) {
1222
+ return event.key === "Enter" || event.key === " " || event.key === "Spacebar";
1223
+ }
1224
+ function isTextInputTarget(target) {
1225
+ const element = target;
1226
+ if (!element) {
1227
+ return false;
1228
+ }
1229
+ return element.tagName === "INPUT" || element.tagName === "TEXTAREA" || element.isContentEditable;
1230
+ }
1231
+ var VueMultiselectDropdown = {
1232
+ name: "VueMultiselectDropdown",
1233
+ model: {
1234
+ prop: "value",
1235
+ event: "input"
1236
+ },
1237
+ props: {
1238
+ data: {
1239
+ type: Array,
1240
+ default: () => []
1241
+ },
1242
+ value: {
1243
+ type: Array,
1244
+ default: void 0
1245
+ },
1246
+ selectedItems: {
1247
+ type: Array,
1248
+ default: void 0
1249
+ },
1250
+ defaultSelectedItems: {
1251
+ type: Array,
1252
+ default: () => []
1253
+ },
1254
+ settings: {
1255
+ type: Object,
1256
+ default: () => ({})
1257
+ },
1258
+ disabled: {
1259
+ type: Boolean,
1260
+ default: false
1261
+ },
1262
+ renderItem: {
1263
+ type: Function,
1264
+ default: void 0
1265
+ },
1266
+ renderBadge: {
1267
+ type: Function,
1268
+ default: void 0
1269
+ },
1270
+ renderEmptyState: {
1271
+ type: Function,
1272
+ default: void 0
1273
+ }
1274
+ },
1275
+ data() {
1276
+ return {
1277
+ isOpen: false,
1278
+ query: "",
1279
+ focusedKey: "",
1280
+ internalSelected: Array.isArray(this.defaultSelectedItems) ? this.defaultSelectedItems.slice() : [],
1281
+ menuStyle: {},
1282
+ bodyListMaxHeight: void 0,
1283
+ menuPlaceholder: null,
1284
+ menuAttachedToBody: false,
1285
+ effectivePosition: "bottom",
1286
+ instanceId: `stackline-vmsd-${Math.random().toString(36).slice(2)}`
1287
+ };
1288
+ },
1289
+ computed: {
1290
+ resolvedSettings() {
1291
+ const merged = {
1292
+ ...DEFAULT_SETTINGS,
1293
+ ...this.settings || {}
1294
+ };
1295
+ const skin = merged.skin || merged.theme || "classic";
1296
+ return {
1297
+ ...merged,
1298
+ skin,
1299
+ disabled: Boolean(merged.disabled || this.disabled),
1300
+ searchBy: Array.isArray(merged.searchBy) ? merged.searchBy : []
1301
+ };
1302
+ },
1303
+ selected() {
1304
+ if (Array.isArray(this.selectedItems)) {
1305
+ return this.selectedItems;
1306
+ }
1307
+ if (Array.isArray(this.value)) {
1308
+ return this.value;
1309
+ }
1310
+ return this.internalSelected;
1311
+ },
1312
+ filteredItems() {
1313
+ const settings = this.resolvedSettings;
1314
+ return (this.data || []).filter((item) => itemMatchesQuery(item, this.query, settings));
1315
+ },
1316
+ groupedItems() {
1317
+ return buildGroups(this.filteredItems, this.resolvedSettings);
1318
+ },
1319
+ visibleSelected() {
1320
+ const limit = this.resolvedSettings.badgeShowLimit;
1321
+ return this.selected.slice(0, limit);
1322
+ },
1323
+ hiddenSelectedCount() {
1324
+ return Math.max(0, this.selected.length - this.visibleSelected.length);
1325
+ },
1326
+ openDirection() {
1327
+ return this.effectivePosition === "top" ? "up" : "down";
1328
+ },
1329
+ shouldAppendToBody() {
1330
+ return Boolean(this.resolvedSettings.appendToBody || this.resolvedSettings.tagToBody);
1331
+ }
1332
+ },
1333
+ watch: {
1334
+ isOpen(value) {
1335
+ this.$nextTick(() => {
1336
+ if (value) {
1337
+ this.attachMenuToBody();
1338
+ this.updateMenuPosition();
1339
+ if (this.resolvedSettings.searchAutofocus && this.resolvedSettings.enableSearchFilter) {
1340
+ this.focusSearch();
1341
+ }
1342
+ this.$emit("open");
1343
+ } else {
1344
+ this.restoreMenuToComponent();
1345
+ this.menuStyle = {};
1346
+ this.bodyListMaxHeight = void 0;
1347
+ this.$emit("close");
1348
+ }
1349
+ });
1350
+ },
1351
+ selected() {
1352
+ this.$nextTick(this.updateMenuPosition);
1353
+ },
1354
+ filteredItems() {
1355
+ this.$nextTick(this.updateMenuPosition);
1356
+ },
1357
+ settings: {
1358
+ deep: true,
1359
+ handler() {
1360
+ this.$nextTick(this.updateMenuPosition);
1361
+ }
1362
+ }
1363
+ },
1364
+ mounted() {
1365
+ ensureDropdownStyles();
1366
+ document.addEventListener("click", this.onDocumentClick, true);
1367
+ document.addEventListener("keydown", this.onDocumentKeydown, true);
1368
+ window.addEventListener("resize", this.updateMenuPosition);
1369
+ window.addEventListener("scroll", this.updateMenuPosition, true);
1370
+ },
1371
+ beforeDestroy() {
1372
+ document.removeEventListener("click", this.onDocumentClick, true);
1373
+ document.removeEventListener("keydown", this.onDocumentKeydown, true);
1374
+ window.removeEventListener("resize", this.updateMenuPosition);
1375
+ window.removeEventListener("scroll", this.updateMenuPosition, true);
1376
+ this.restoreMenuToComponent();
1377
+ },
1378
+ methods: {
1379
+ getLabel(item) {
1380
+ return getLabel(item, this.resolvedSettings);
1381
+ },
1382
+ getKey(item) {
1383
+ return getPrimaryValue(item, this.resolvedSettings);
1384
+ },
1385
+ isSelected(item) {
1386
+ const key = this.getKey(item);
1387
+ return this.selected.some((selectedItem) => this.getKey(selectedItem) === key);
1388
+ },
1389
+ visibleSelectableItems() {
1390
+ return this.filteredItems.filter((item) => !isDisabledItem(item));
1391
+ },
1392
+ emitSelection(items) {
1393
+ if (!Array.isArray(this.selectedItems) && !Array.isArray(this.value)) {
1394
+ this.internalSelected = items;
1395
+ }
1396
+ this.$emit("input", items);
1397
+ this.$emit("update:selectedItems", items);
1398
+ this.$emit("change", items);
1399
+ },
1400
+ openDropdown() {
1401
+ if (this.resolvedSettings.disabled) {
1402
+ return;
1403
+ }
1404
+ this.isOpen = true;
1405
+ },
1406
+ closeDropdown() {
1407
+ this.isOpen = false;
1408
+ this.query = "";
1409
+ this.focusedKey = "";
1410
+ },
1411
+ toggleDropdown() {
1412
+ if (this.isOpen) {
1413
+ this.closeDropdown();
1414
+ } else {
1415
+ this.openDropdown();
1416
+ }
1417
+ },
1418
+ focusSearch() {
1419
+ if (!this.isOpen) {
1420
+ this.openDropdown();
1421
+ }
1422
+ const search = this.$refs.searchInput;
1423
+ if (search && typeof search.focus === "function") {
1424
+ search.focus();
1425
+ }
1426
+ },
1427
+ clearSelection(event) {
1428
+ if (event) {
1429
+ event.preventDefault();
1430
+ event.stopPropagation();
1431
+ }
1432
+ const previous = this.selected.slice();
1433
+ this.emitSelection([]);
1434
+ this.$emit("de-select-all", previous);
1435
+ },
1436
+ selectAll(event) {
1437
+ if (event) {
1438
+ event.preventDefault();
1439
+ event.stopPropagation();
1440
+ }
1441
+ const settings = this.resolvedSettings;
1442
+ const selectable = this.visibleSelectableItems();
1443
+ const allSelected = selectable.length > 0 && selectable.every((item) => this.isSelected(item));
1444
+ if (allSelected) {
1445
+ const keys = new Set(selectable.map((item) => this.getKey(item)));
1446
+ const next2 = this.selected.filter((item) => !keys.has(this.getKey(item)));
1447
+ this.emitSelection(next2);
1448
+ this.$emit("de-select-all", selectable);
1449
+ return;
1450
+ }
1451
+ const remainingCapacity = settings.limitSelection ? Math.max(settings.limitSelection - this.selected.length, 0) : Number.MAX_SAFE_INTEGER;
1452
+ const currentKeys = new Set(this.selected.map((item) => this.getKey(item)));
1453
+ const nextItemsToAdd = selectable.filter((item) => !currentKeys.has(this.getKey(item))).slice(0, remainingCapacity);
1454
+ const next = settings.singleSelection ? selectable.slice(0, 1) : mergeUniqueItems(this.selected, nextItemsToAdd, settings);
1455
+ this.emitSelection(next);
1456
+ this.$emit("select-all", next);
1457
+ },
1458
+ deSelectAll(event) {
1459
+ this.clearSelection(event);
1460
+ },
1461
+ selectGroup(groupName, items, event) {
1462
+ event.preventDefault();
1463
+ event.stopPropagation();
1464
+ const settings = this.resolvedSettings;
1465
+ const selectable = items.filter((item) => !isDisabledItem(item));
1466
+ const everySelected = selectable.every((item) => this.isSelected(item));
1467
+ if (everySelected) {
1468
+ const keys = new Set(selectable.map((item) => this.getKey(item)));
1469
+ const next2 = this.selected.filter((item) => !keys.has(this.getKey(item)));
1470
+ this.emitSelection(next2);
1471
+ this.$emit("group-de-select", groupName, selectable);
1472
+ return;
1473
+ }
1474
+ const next = settings.singleSelection ? selectable.slice(0, 1) : mergeUniqueItems(this.selected, selectable, settings);
1475
+ this.emitSelection(next);
1476
+ this.$emit("group-select", groupName, selectable);
1477
+ },
1478
+ toggleItem(item, event) {
1479
+ if (event) {
1480
+ event.preventDefault();
1481
+ event.stopPropagation();
1482
+ }
1483
+ const isAlreadySelected = this.isSelected(item);
1484
+ const limitReached = Boolean(this.resolvedSettings.limitSelection) && this.selected.length >= this.resolvedSettings.limitSelection;
1485
+ if (this.resolvedSettings.disabled || isDisabledItem(item) || limitReached && !isAlreadySelected) {
1486
+ return;
1487
+ }
1488
+ const key = this.getKey(item);
1489
+ const exists = this.selected.some((selectedItem) => this.getKey(selectedItem) === key);
1490
+ if (exists) {
1491
+ const next2 = this.selected.filter((selectedItem) => this.getKey(selectedItem) !== key);
1492
+ this.emitSelection(next2);
1493
+ this.$emit("de-select", item);
1494
+ return;
1495
+ }
1496
+ let next = this.resolvedSettings.singleSelection ? [item] : this.selected.concat(item);
1497
+ if (this.resolvedSettings.limitSelection > 0) {
1498
+ next = next.slice(0, this.resolvedSettings.limitSelection);
1499
+ }
1500
+ this.emitSelection(next);
1501
+ this.$emit("select", item);
1502
+ if (this.resolvedSettings.singleSelection || this.resolvedSettings.closeDropDownOnSelection) {
1503
+ this.closeDropdown();
1504
+ }
1505
+ },
1506
+ removeItem(item, event) {
1507
+ if (event) {
1508
+ event.preventDefault();
1509
+ event.stopPropagation();
1510
+ }
1511
+ const key = this.getKey(item);
1512
+ const next = this.selected.filter((selectedItem) => this.getKey(selectedItem) !== key);
1513
+ this.emitSelection(next);
1514
+ this.$emit("de-select", item);
1515
+ },
1516
+ addFilterItem(event) {
1517
+ event.preventDefault();
1518
+ event.stopPropagation();
1519
+ const label = this.query.trim();
1520
+ if (!label) {
1521
+ return;
1522
+ }
1523
+ const item = {
1524
+ [this.resolvedSettings.primaryKey]: label.toLowerCase().replace(/\s+/g, "-"),
1525
+ [this.resolvedSettings.labelKey]: label
1526
+ };
1527
+ this.$emit("add-filter-new-item", label, item);
1528
+ this.toggleItem(item);
1529
+ this.query = "";
1530
+ },
1531
+ onTriggerKeydown(event) {
1532
+ if (isActivationKey(event)) {
1533
+ event.preventDefault();
1534
+ this.toggleDropdown();
1535
+ return;
1536
+ }
1537
+ if (event.key === "ArrowDown") {
1538
+ event.preventDefault();
1539
+ this.openDropdown();
1540
+ this.focusFirstOption();
1541
+ return;
1542
+ }
1543
+ if (event.key === "ArrowUp") {
1544
+ event.preventDefault();
1545
+ this.openDropdown();
1546
+ this.focusLastOption();
1547
+ return;
1548
+ }
1549
+ if (event.key === "Escape") {
1550
+ this.closeDropdown();
1551
+ }
1552
+ },
1553
+ onListKeydown(event) {
1554
+ if (event.key === "Escape") {
1555
+ event.preventDefault();
1556
+ event.stopPropagation();
1557
+ this.closeDropdown();
1558
+ return;
1559
+ }
1560
+ if (isTextInputTarget(event.target) && event.key !== "ArrowDown") {
1561
+ return;
1562
+ }
1563
+ const selectable = this.visibleSelectableItems();
1564
+ if (!selectable.length) {
1565
+ return;
1566
+ }
1567
+ const currentIndex = Math.max(0, selectable.findIndex((item) => this.getKey(item) === this.focusedKey));
1568
+ if (event.key === "ArrowDown") {
1569
+ event.preventDefault();
1570
+ event.stopPropagation();
1571
+ const nextItem = selectable[Math.min(currentIndex + 1, selectable.length - 1)];
1572
+ this.focusOption(nextItem);
1573
+ return;
1574
+ }
1575
+ if (event.key === "ArrowUp") {
1576
+ event.preventDefault();
1577
+ event.stopPropagation();
1578
+ const nextItem = selectable[Math.max(currentIndex - 1, 0)];
1579
+ this.focusOption(nextItem);
1580
+ return;
1581
+ }
1582
+ if (event.key === "Home") {
1583
+ event.preventDefault();
1584
+ event.stopPropagation();
1585
+ this.focusFirstOption();
1586
+ return;
1587
+ }
1588
+ if (event.key === "End") {
1589
+ event.preventDefault();
1590
+ event.stopPropagation();
1591
+ this.focusLastOption();
1592
+ return;
1593
+ }
1594
+ if (isActivationKey(event)) {
1595
+ event.preventDefault();
1596
+ event.stopPropagation();
1597
+ const activeItem = selectable.find((item) => this.getKey(item) === this.focusedKey) || selectable[0];
1598
+ this.toggleItem(activeItem);
1599
+ return;
1600
+ }
1601
+ },
1602
+ focusFirstOption() {
1603
+ this.$nextTick(() => {
1604
+ const first = this.visibleSelectableItems()[0];
1605
+ if (first) {
1606
+ this.focusOption(first);
1607
+ }
1608
+ });
1609
+ },
1610
+ focusLastOption() {
1611
+ this.$nextTick(() => {
1612
+ const items = this.visibleSelectableItems();
1613
+ const last = items[items.length - 1];
1614
+ if (last) {
1615
+ this.focusOption(last);
1616
+ }
1617
+ });
1618
+ },
1619
+ focusOption(item) {
1620
+ const key = this.getKey(item);
1621
+ this.focusedKey = key;
1622
+ this.$nextTick(() => {
1623
+ const menu = this.$refs.menu;
1624
+ const option = menu?.querySelector(`[data-vmsd-key="${escapeSelectorValue(key)}"]`);
1625
+ if (option) {
1626
+ option.focus();
1627
+ option.scrollIntoView({ block: "nearest" });
1628
+ }
1629
+ });
1630
+ },
1631
+ onInlineKeydown(event) {
1632
+ if (isActivationKey(event)) {
1633
+ event.stopPropagation();
1634
+ }
1635
+ if (event.key === "ArrowDown") {
1636
+ event.preventDefault();
1637
+ event.stopPropagation();
1638
+ this.openDropdown();
1639
+ this.focusFirstOption();
1640
+ }
1641
+ if (event.key === "ArrowUp") {
1642
+ event.preventDefault();
1643
+ event.stopPropagation();
1644
+ this.openDropdown();
1645
+ this.focusLastOption();
1646
+ }
1647
+ },
1648
+ onTriggerClick(event) {
1649
+ const target = event.target;
1650
+ if (target && target.closest("button")) {
1651
+ return;
1652
+ }
1653
+ this.toggleDropdown();
1654
+ },
1655
+ onDocumentClick(event) {
1656
+ if (!this.isOpen) {
1657
+ return;
1658
+ }
1659
+ const root = this.$el;
1660
+ const menu = this.$refs.menu;
1661
+ const target = event.target;
1662
+ if (root && root.contains(target) || menu && menu.contains(target)) {
1663
+ return;
1664
+ }
1665
+ this.closeDropdown();
1666
+ },
1667
+ onDocumentKeydown(event) {
1668
+ if (this.isOpen && this.resolvedSettings.escapeToClose && event.key === "Escape") {
1669
+ this.closeDropdown();
1670
+ }
1671
+ },
1672
+ onListScroll(event) {
1673
+ const target = event.target;
1674
+ if (!target) {
1675
+ return;
1676
+ }
1677
+ const payload = {
1678
+ scrollTop: target.scrollTop,
1679
+ scrollHeight: target.scrollHeight,
1680
+ clientHeight: target.clientHeight
1681
+ };
1682
+ if (target.scrollTop + target.clientHeight >= target.scrollHeight - 4) {
1683
+ this.$emit("scroll-to-end", payload);
1684
+ }
1685
+ },
1686
+ attachMenuToBody() {
1687
+ if (!this.shouldAppendToBody || !this.isOpen || typeof document === "undefined") {
1688
+ return;
1689
+ }
1690
+ const menu = this.$refs.menu;
1691
+ if (!menu || menu.parentNode === document.body) {
1692
+ return;
1693
+ }
1694
+ if (!this.menuPlaceholder && menu.parentNode) {
1695
+ this.menuPlaceholder = document.createComment("stackline-vue-multiselect-menu");
1696
+ menu.parentNode.insertBefore(this.menuPlaceholder, menu);
1697
+ }
1698
+ document.body.appendChild(menu);
1699
+ this.menuAttachedToBody = true;
1700
+ },
1701
+ restoreMenuToComponent() {
1702
+ const menu = this.$refs.menu;
1703
+ if (!menu || !this.menuPlaceholder || !this.menuPlaceholder.parentNode) {
1704
+ return;
1705
+ }
1706
+ this.menuPlaceholder.parentNode.insertBefore(menu, this.menuPlaceholder.nextSibling);
1707
+ this.menuPlaceholder.parentNode.removeChild(this.menuPlaceholder);
1708
+ this.menuPlaceholder = null;
1709
+ this.menuAttachedToBody = false;
1710
+ this.menuStyle = {};
1711
+ },
1712
+ updateMenuPosition() {
1713
+ if (!this.isOpen || typeof window === "undefined") {
1714
+ return;
1715
+ }
1716
+ const trigger = this.$refs.trigger;
1717
+ const menu = this.$refs.menu;
1718
+ if (!trigger || !menu) {
1719
+ return;
1720
+ }
1721
+ const rect = trigger.getBoundingClientRect();
1722
+ const gap = 8;
1723
+ const viewportPadding = 8;
1724
+ const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
1725
+ const spaceOnTop = rect.top;
1726
+ const spaceOnBottom = viewportHeight - rect.bottom;
1727
+ const menuHeight = menu.offsetHeight || Math.min(this.resolvedSettings.maxHeight + 92, 420);
1728
+ const preferredPosition = this.resolvedSettings.position === "top" ? "top" : "bottom";
1729
+ const topHasMeaningfullyMoreRoom = spaceOnTop > spaceOnBottom + 48;
1730
+ const resolvedPosition = this.resolvedSettings.autoPosition ? spaceOnBottom < menuHeight && topHasMeaningfullyMoreRoom && menuHeight < spaceOnTop ? "top" : "bottom" : preferredPosition;
1731
+ this.effectivePosition = resolvedPosition;
1732
+ if (!this.shouldAppendToBody) {
1733
+ this.bodyListMaxHeight = void 0;
1734
+ return;
1735
+ }
1736
+ const list = this.$refs.list;
1737
+ const listHeight = list?.offsetHeight || Math.min(this.resolvedSettings.maxHeight, menuHeight);
1738
+ const nonListHeight = Math.max(0, menuHeight - listHeight);
1739
+ const availableHeight = resolvedPosition === "top" ? Math.max(0, rect.top - gap - viewportPadding) : Math.max(0, viewportHeight - rect.bottom - gap - viewportPadding);
1740
+ const nextListMaxHeight = menuHeight > 0 ? Math.max(0, Math.min(this.resolvedSettings.maxHeight, availableHeight - nonListHeight)) : this.resolvedSettings.maxHeight;
1741
+ const positionedMenuHeight = nonListHeight + nextListMaxHeight;
1742
+ const preferredTop = resolvedPosition === "top" ? rect.top - positionedMenuHeight - gap : rect.bottom + gap;
1743
+ const top = resolvedPosition === "top" ? Math.max(viewportPadding, preferredTop) : preferredTop;
1744
+ const maxWidth = Math.max(0, window.innerWidth - viewportPadding * 2);
1745
+ const width = Math.min(rect.width, maxWidth);
1746
+ const left = Math.min(Math.max(viewportPadding, rect.left), window.innerWidth - width - viewportPadding);
1747
+ const style = {
1748
+ position: "fixed",
1749
+ top: `${top}px`,
1750
+ left: `${left}px`,
1751
+ width: `${width}px`,
1752
+ maxWidth: `${maxWidth}px`,
1753
+ zIndex: "100000",
1754
+ display: this.isOpen ? "block" : "none"
1755
+ };
1756
+ this.bodyListMaxHeight = nextListMaxHeight;
1757
+ this.menuStyle = style;
1758
+ }
1759
+ },
1760
+ render(h) {
1761
+ const settings = this.resolvedSettings;
1762
+ const skin = String(settings.skin || settings.theme || "classic");
1763
+ const skinFallbackClass = ["classic", "material", "dark", "custom"].includes(skin) ? "" : "theme-custom";
1764
+ const hasSelection = this.selected.length > 0;
1765
+ const visibleBadges = this.visibleSelected;
1766
+ const hiddenCount = this.hiddenSelectedCount;
1767
+ const hasClear = settings.clearAll && hasSelection && !settings.disabled;
1768
+ const selectableItems = this.visibleSelectableItems();
1769
+ const allFilteredSelected = selectableItems.length > 0 && selectableItems.every((item) => this.isSelected(item));
1770
+ const hasBulkActions = settings.enableCheckAll && !settings.singleSelection || Boolean(settings.addNewItemOnFilter && this.query.trim());
1771
+ const menuClasses = [
1772
+ "vmsd-menu",
1773
+ `vmsd-${this.effectivePosition}`,
1774
+ `skin-${skin}`,
1775
+ `theme-${skin}`,
1776
+ skinFallbackClass,
1777
+ this.shouldAppendToBody ? "vmsd-body-overlay" : ""
1778
+ ].filter(Boolean);
1779
+ const badges = settings.singleSelection && hasSelection ? [h("span", { class: "vmsd-single-value" }, [this.getLabel(this.selected[0])])] : visibleBadges.map((item) => {
1780
+ const label = this.getLabel(item);
1781
+ const context = {
1782
+ item,
1783
+ label,
1784
+ selected: true,
1785
+ disabled: false,
1786
+ query: this.query,
1787
+ toggle: () => this.toggleItem(item),
1788
+ remove: () => this.removeItem(item)
1789
+ };
1790
+ const rendered = callRenderFunction(this.renderBadge, h, item, context);
1791
+ const removeLabel = typeof settings.removeItemAriaLabel === "function" ? settings.removeItemAriaLabel(item) : `${settings.removeItemAriaLabel}: ${label}`;
1792
+ return h("span", { class: "vmsd-badge", key: this.getKey(item) }, [
1793
+ h("span", { class: "vmsd-badge-label" }, [rendered || label]),
1794
+ settings.disabled ? null : h(
1795
+ "button",
1796
+ {
1797
+ class: "vmsd-badge-remove",
1798
+ attrs: { type: "button", "aria-label": removeLabel },
1799
+ on: {
1800
+ click: (event) => this.removeItem(item, event),
1801
+ keydown: this.onInlineKeydown
1802
+ }
1803
+ },
1804
+ [renderIcon(h, "remove")]
1805
+ )
1806
+ ]);
1807
+ });
1808
+ const valueContent = hasSelection ? [h("span", { class: "vmsd-badge-list" }, badges)] : [h("span", { class: "vmsd-placeholder" }, [settings.text])];
1809
+ if (hiddenCount > 0) {
1810
+ valueContent.push(h("span", { class: "vmsd-overflow", attrs: { "aria-label": `${hiddenCount} more selected options` } }, [`+${hiddenCount}`]));
1811
+ }
1812
+ const trigger = h(
1813
+ "div",
1814
+ {
1815
+ ref: "trigger",
1816
+ class: ["vmsd-trigger", settings.disabled ? "vmsd-disabled" : ""],
1817
+ attrs: {
1818
+ role: "combobox",
1819
+ tabindex: settings.disabled ? "-1" : "0",
1820
+ "aria-label": hasSelection ? `${settings.ariaLabel}: ${this.selected.map((item) => this.getLabel(item)).join(", ")}` : settings.ariaLabel,
1821
+ "aria-expanded": this.isOpen ? "true" : "false",
1822
+ "aria-haspopup": "listbox",
1823
+ "aria-disabled": settings.disabled ? "true" : "false",
1824
+ "aria-controls": `${this.instanceId}-listbox`
1825
+ },
1826
+ on: {
1827
+ click: this.onTriggerClick,
1828
+ keydown: this.onTriggerKeydown
1829
+ }
1830
+ },
1831
+ [
1832
+ h("div", { class: "vmsd-value" }, valueContent),
1833
+ h("div", { class: "vmsd-actions" }, [
1834
+ hasClear ? h(
1835
+ "button",
1836
+ {
1837
+ class: "vmsd-clear",
1838
+ attrs: { type: "button", "aria-label": settings.clearAllAriaLabel },
1839
+ on: {
1840
+ click: (event) => this.clearSelection(event),
1841
+ keydown: this.onInlineKeydown
1842
+ }
1843
+ },
1844
+ [renderIcon(h, "remove")]
1845
+ ) : null,
1846
+ h(
1847
+ "button",
1848
+ {
1849
+ class: "vmsd-arrow-button",
1850
+ attrs: {
1851
+ type: "button",
1852
+ disabled: settings.disabled,
1853
+ "aria-label": this.isOpen ? settings.closeDropdownAriaLabel : settings.openDropdownAriaLabel,
1854
+ "aria-expanded": this.isOpen ? "true" : "false",
1855
+ "aria-controls": `${this.instanceId}-listbox`
1856
+ },
1857
+ on: {
1858
+ click: (event) => {
1859
+ event.preventDefault();
1860
+ event.stopPropagation();
1861
+ this.toggleDropdown();
1862
+ },
1863
+ keydown: this.onInlineKeydown
1864
+ }
1865
+ },
1866
+ [h("span", { class: "vmsd-arrow", attrs: { "aria-hidden": "true" } }, [renderIcon(h, this.isOpen ? "angle-up" : "angle-down")])]
1867
+ )
1868
+ ])
1869
+ ]
1870
+ );
1871
+ const search = settings.enableSearchFilter ? h("div", { class: "vmsd-search-shell" }, [
1872
+ renderIcon(h, "search", "vmsd-search-icon"),
1873
+ h("input", {
1874
+ ref: "searchInput",
1875
+ class: "vmsd-search-input",
1876
+ domProps: { value: this.query },
1877
+ attrs: { type: "text", placeholder: settings.searchPlaceholderText, "aria-label": settings.searchAriaLabel },
1878
+ on: {
1879
+ input: (event) => {
1880
+ this.query = String(event.target.value || "");
1881
+ },
1882
+ keydown: this.onListKeydown
1883
+ }
1884
+ }),
1885
+ this.query ? h(
1886
+ "button",
1887
+ {
1888
+ class: "vmsd-search-clear",
1889
+ attrs: { type: "button", "aria-label": settings.clearSearchAriaLabel },
1890
+ on: {
1891
+ click: () => this.query = "",
1892
+ keydown: this.onInlineKeydown
1893
+ }
1894
+ },
1895
+ [renderIcon(h, "clear")]
1896
+ ) : null
1897
+ ]) : null;
1898
+ const bulkActions = hasBulkActions ? h("div", { class: "vmsd-bulk-actions" }, [
1899
+ settings.enableCheckAll && !settings.singleSelection ? h(
1900
+ "button",
1901
+ {
1902
+ class: "vmsd-inline-button vmsd-select-all-button",
1903
+ attrs: { type: "button", disabled: settings.disabled || selectableItems.length === 0 },
1904
+ on: { click: (event) => this.selectAll(event), keydown: this.onInlineKeydown }
1905
+ },
1906
+ [
1907
+ settings.showCheckbox ? h("span", { class: "vmsd-checkbox", attrs: { "data-checked": allFilteredSelected ? "true" : "false", "aria-hidden": "true" } }) : null,
1908
+ h("span", [allFilteredSelected ? settings.unSelectAllText : settings.selectAllText])
1909
+ ]
1910
+ ) : null,
1911
+ settings.addNewItemOnFilter && this.query.trim() ? h(
1912
+ "button",
1913
+ {
1914
+ class: "vmsd-inline-button vmsd-add-button",
1915
+ attrs: { type: "button" },
1916
+ on: { click: this.addFilterItem, keydown: this.onInlineKeydown }
1917
+ },
1918
+ [`${settings.addNewButtonText} "${this.query.trim()}"`]
1919
+ ) : null
1920
+ ]) : null;
1921
+ const renderOption = (item) => {
1922
+ const label = this.getLabel(item);
1923
+ const selected = this.isSelected(item);
1924
+ const limitReached = Boolean(settings.limitSelection) && this.selected.length >= settings.limitSelection;
1925
+ const disabled = settings.disabled || isDisabledItem(item) || limitReached && !selected;
1926
+ const key = this.getKey(item);
1927
+ const context = {
1928
+ item,
1929
+ label,
1930
+ selected,
1931
+ disabled,
1932
+ query: this.query,
1933
+ toggle: () => this.toggleItem(item),
1934
+ remove: () => this.removeItem(item)
1935
+ };
1936
+ const rendered = callRenderFunction(this.renderItem, h, item, context);
1937
+ return h(
1938
+ "div",
1939
+ {
1940
+ key,
1941
+ class: ["vmsd-option", selected ? "vmsd-selected" : "", disabled ? "vmsd-disabled" : ""],
1942
+ attrs: {
1943
+ role: "option",
1944
+ tabindex: disabled ? "-1" : "0",
1945
+ "data-vmsd-option": "true",
1946
+ "data-vmsd-key": key,
1947
+ "aria-disabled": disabled ? "true" : "false",
1948
+ "aria-selected": selected ? "true" : "false"
1949
+ },
1950
+ on: {
1951
+ click: (event) => {
1952
+ if (!disabled) {
1953
+ this.toggleItem(item, event);
1954
+ }
1955
+ },
1956
+ focus: () => this.focusedKey = key,
1957
+ mouseenter: () => this.focusedKey = key,
1958
+ keydown: this.onListKeydown
1959
+ }
1960
+ },
1961
+ [
1962
+ settings.showCheckbox ? h("span", { class: "vmsd-checkbox", attrs: { "data-checked": selected ? "true" : "false", "aria-hidden": "true" } }) : null,
1963
+ rendered || h("div", { class: "vmsd-option-body" }, [
1964
+ h("div", { class: "vmsd-option-label" }, [label]),
1965
+ !isPrimitiveItem(item) && item.caption ? h("span", { class: "vmsd-option-hint" }, [String(item.caption)]) : null
1966
+ ])
1967
+ ]
1968
+ );
1969
+ };
1970
+ const listChildren = settings.loading ? [h("div", { class: "vmsd-state", attrs: { role: "status" } }, [settings.loadingText])] : settings.groupBy ? this.groupedItems.map(
1971
+ (group) => h("div", { class: "vmsd-group", key: group.name, attrs: { role: "group", "aria-label": group.name } }, [
1972
+ h("div", { class: "vmsd-group-header" }, [
1973
+ h("span", [`${group.name} \xB7 ${group.items.length}`]),
1974
+ settings.selectGroup ? h(
1975
+ "button",
1976
+ {
1977
+ class: "vmsd-group-action",
1978
+ attrs: { type: "button" },
1979
+ on: { click: (event) => this.selectGroup(group.name, group.items, event) }
1980
+ },
1981
+ [group.items.filter((item) => !isDisabledItem(item)).every((item) => this.isSelected(item)) ? "Unselect" : "Select"]
1982
+ ) : null
1983
+ ]),
1984
+ group.items.map(renderOption)
1985
+ ])
1986
+ ) : this.filteredItems.map(renderOption);
1987
+ if (!this.filteredItems.length && !settings.loading) {
1988
+ const emptyContent = this.renderEmptyState ? this.renderEmptyState(this.query, h) : settings.noDataLabel;
1989
+ listChildren.push(h("div", { class: "vmsd-state" }, [emptyContent]));
1990
+ }
1991
+ const menu = h(
1992
+ "div",
1993
+ {
1994
+ ref: "menu",
1995
+ class: menuClasses,
1996
+ style: {
1997
+ ...this.shouldAppendToBody ? this.menuStyle : {},
1998
+ display: this.isOpen ? "block" : "none"
1999
+ },
2000
+ attrs: {
2001
+ role: "presentation",
2002
+ "aria-hidden": this.isOpen ? "false" : "true"
2003
+ },
2004
+ on: { keydown: this.onListKeydown }
2005
+ },
2006
+ [
2007
+ h("div", { class: "vmsd-toolbar" }, [bulkActions, search]),
2008
+ h(
2009
+ "div",
2010
+ {
2011
+ ref: "list",
2012
+ class: "vmsd-list",
2013
+ style: { maxHeight: `${this.shouldAppendToBody && this.bodyListMaxHeight != null ? this.bodyListMaxHeight : settings.maxHeight}px` },
2014
+ attrs: { id: `${this.instanceId}-listbox`, role: "listbox", "aria-label": settings.listboxAriaLabel, "aria-multiselectable": settings.singleSelection ? "false" : "true" },
2015
+ on: { scroll: this.onListScroll }
2016
+ },
2017
+ listChildren
2018
+ )
2019
+ ]
2020
+ );
2021
+ return h(
2022
+ "div",
2023
+ {
2024
+ class: [
2025
+ "vmsd-root",
2026
+ `skin-${skin}`,
2027
+ `theme-${skin}`,
2028
+ skinFallbackClass,
2029
+ this.isOpen ? "vmsd-open" : "",
2030
+ this.effectivePosition === "top" ? "vmsd-opens-up" : "vmsd-opens-down",
2031
+ settings.classes,
2032
+ hasSelection ? "vmsd-has-selection" : "",
2033
+ hasClear ? "vmsd-has-clear" : "",
2034
+ hiddenCount > 0 ? "vmsd-has-overflow" : ""
2035
+ ],
2036
+ attrs: {
2037
+ "data-open": this.isOpen ? "true" : "false"
2038
+ }
2039
+ },
2040
+ [trigger, menu]
2041
+ );
2042
+ }
2043
+ };
2044
+ var StacklineVueMultiselect = VueMultiselectDropdown;
2045
+
2046
+ // src/plugin.ts
2047
+ var VueMultiselect = {
2048
+ install(Vue) {
2049
+ Vue.component("StacklineVueMultiselect", VueMultiselectDropdown);
2050
+ Vue.component("VueMultiselectDropdown", VueMultiselectDropdown);
2051
+ Vue.component("vue-multiselect-dropdown", VueMultiselectDropdown);
2052
+ Vue.component("stackline-vue-multiselect", VueMultiselectDropdown);
2053
+ }
2054
+ };
2055
+ var plugin_default = VueMultiselect;
2056
+ export {
2057
+ StacklineVueMultiselect,
2058
+ VueMultiselect,
2059
+ VueMultiselectDropdown,
2060
+ plugin_default as default
2061
+ };