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