@danielgindi/selectbox 2.0.46 → 2.0.48
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/lib.cjs.js +15 -13
- package/dist/lib.cjs.js.map +1 -1
- package/dist/lib.cjs.min.js +2 -2
- package/dist/lib.cjs.min.js.map +1 -1
- package/dist/lib.es6.js +14 -12
- package/dist/lib.es6.js.map +1 -1
- package/dist/lib.es6.min.js +2 -2
- package/dist/lib.es6.min.js.map +1 -1
- package/dist/lib.umd.js +15 -13
- package/dist/lib.umd.js.map +1 -1
- package/dist/lib.umd.min.js +2 -2
- package/dist/lib.umd.min.js.map +1 -1
- package/lib/DropList.js +13 -11
- package/package.json +2 -2
- package/vue/SelectBox.vue +136 -139
package/lib/DropList.js
CHANGED
|
@@ -687,16 +687,20 @@ class DropList {
|
|
|
687
687
|
return false;
|
|
688
688
|
}
|
|
689
689
|
|
|
690
|
-
if (
|
|
690
|
+
if (p.multi) {
|
|
691
|
+
if (this.hasFocusedItem()) {
|
|
692
|
+
this.toggleFocusedItem();
|
|
693
|
+
}
|
|
694
|
+
} else {
|
|
691
695
|
this._setSingleSelectedItemEl(p.focusItemEl);
|
|
692
|
-
}
|
|
693
696
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
697
|
+
this._trigger('select', {
|
|
698
|
+
value: item ? item.value : undefined,
|
|
699
|
+
item: item[ItemSymbol] ?? item,
|
|
700
|
+
event: event,
|
|
701
|
+
el: p.focusItemEl,
|
|
702
|
+
});
|
|
703
|
+
}
|
|
700
704
|
|
|
701
705
|
return true;
|
|
702
706
|
}
|
|
@@ -2047,7 +2051,7 @@ class DropList {
|
|
|
2047
2051
|
}
|
|
2048
2052
|
|
|
2049
2053
|
hasFocusedItem() {
|
|
2050
|
-
return this._p.focusItemIndex > -1;
|
|
2054
|
+
return this._p.focusItemIndex > -1 && this._p.focusItemIndex < this._p.items.length;
|
|
2051
2055
|
}
|
|
2052
2056
|
|
|
2053
2057
|
getFocusedItemIndex() {
|
|
@@ -2475,8 +2479,6 @@ class DropList {
|
|
|
2475
2479
|
if (this[DestroyedSymbol])
|
|
2476
2480
|
return;
|
|
2477
2481
|
|
|
2478
|
-
this.toggleFocusedItem();
|
|
2479
|
-
|
|
2480
2482
|
if (document.activeElement !== this.el && p.focusItemEl) {
|
|
2481
2483
|
clearTimeout(p.blurTimer);
|
|
2482
2484
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielgindi/selectbox",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.48",
|
|
4
4
|
"description": "A collection of dom utilities. So you can work natively with the dom without dom frameworks.",
|
|
5
5
|
"main": "dist/lib.cjs.min.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"pinst": "^3.0.0",
|
|
51
51
|
"rollup": "^4.59.0",
|
|
52
52
|
"sass": "^1.97.3",
|
|
53
|
-
"vite": "^
|
|
53
|
+
"vite": "^8.1.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@danielgindi/dom-utils": "^1.0.11",
|
package/vue/SelectBox.vue
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import { version } from 'vue';
|
|
6
|
+
import { markRaw, version } from 'vue';
|
|
7
7
|
import SelectBox, { DefaultOptions } from '../lib/SelectBox';
|
|
8
8
|
import { createSlotBasedRenderFunc, createSlotBasedUnrenderFunc } from './utils/slots';
|
|
9
9
|
import deepEqual from 'fast-deep-equal';
|
|
@@ -314,10 +314,7 @@ export default {
|
|
|
314
314
|
return {
|
|
315
315
|
el: undefined,
|
|
316
316
|
isMounted: false,
|
|
317
|
-
|
|
318
|
-
nonReactive: Object.seal({
|
|
319
|
-
instance: undefined,
|
|
320
|
-
}),
|
|
317
|
+
instance: undefined,
|
|
321
318
|
};
|
|
322
319
|
},
|
|
323
320
|
|
|
@@ -480,162 +477,162 @@ export default {
|
|
|
480
477
|
|
|
481
478
|
watch: {
|
|
482
479
|
disabled(value) {
|
|
483
|
-
if (this.
|
|
484
|
-
this.
|
|
480
|
+
if (this.instance)
|
|
481
|
+
this.instance.disable(value);
|
|
485
482
|
},
|
|
486
483
|
|
|
487
484
|
readOnly() {
|
|
488
|
-
if (this.
|
|
489
|
-
this.
|
|
485
|
+
if (this.instance)
|
|
486
|
+
this.instance.setReadOnly(this.readOnly ?? false);
|
|
490
487
|
},
|
|
491
488
|
|
|
492
489
|
clearable(value) {
|
|
493
|
-
if (this.
|
|
494
|
-
this.
|
|
490
|
+
if (this.instance)
|
|
491
|
+
this.instance.setClearable(value);
|
|
495
492
|
},
|
|
496
493
|
|
|
497
494
|
direction(value) {
|
|
498
|
-
if (this.
|
|
499
|
-
this.
|
|
495
|
+
if (this.instance)
|
|
496
|
+
this.instance.setDirection(value);
|
|
500
497
|
},
|
|
501
498
|
|
|
502
499
|
hasOpenIndicator(value) {
|
|
503
|
-
if (this.
|
|
504
|
-
this.
|
|
500
|
+
if (this.instance)
|
|
501
|
+
this.instance.setHasOpenIndicator(value);
|
|
505
502
|
},
|
|
506
503
|
|
|
507
504
|
placeholder(value) {
|
|
508
|
-
if (this.
|
|
509
|
-
this.
|
|
505
|
+
if (this.instance)
|
|
506
|
+
this.instance.setPlaceholder(value);
|
|
510
507
|
},
|
|
511
508
|
|
|
512
509
|
sortSelectedItems(value) {
|
|
513
|
-
if (this.
|
|
514
|
-
this.
|
|
510
|
+
if (this.instance)
|
|
511
|
+
this.instance.setSortSelectedItems(value);
|
|
515
512
|
},
|
|
516
513
|
|
|
517
514
|
sortListItems(value) {
|
|
518
|
-
if (this.
|
|
519
|
-
this.
|
|
515
|
+
if (this.instance)
|
|
516
|
+
this.instance.setSortListItems(value);
|
|
520
517
|
},
|
|
521
518
|
|
|
522
519
|
sortListCheckedFirst(value) {
|
|
523
|
-
if (this.
|
|
524
|
-
this.
|
|
520
|
+
if (this.instance)
|
|
521
|
+
this.instance.setSortListCheckedFirst(value);
|
|
525
522
|
},
|
|
526
523
|
|
|
527
524
|
stickyValues(value) {
|
|
528
|
-
if (!this.
|
|
525
|
+
if (!this.instance) return;
|
|
529
526
|
|
|
530
527
|
// `stickyValues` tend to be a literal array,
|
|
531
528
|
// and Vue will get a different reference for each update, triggering this watcher.
|
|
532
529
|
// so use deepEqual here to avoid redoing the list items on each selection change.
|
|
533
530
|
if (deepEqual(this.stickyValues, value)) return;
|
|
534
531
|
|
|
535
|
-
this.
|
|
532
|
+
this.instance.setStickyValues(value);
|
|
536
533
|
},
|
|
537
534
|
|
|
538
535
|
sortItemComparator(value) {
|
|
539
|
-
if (this.
|
|
540
|
-
this.
|
|
536
|
+
if (this.instance)
|
|
537
|
+
this.instance.setSortItemComparator(value);
|
|
541
538
|
},
|
|
542
539
|
|
|
543
540
|
splitListCheckedGroups(value) {
|
|
544
|
-
if (this.
|
|
545
|
-
this.
|
|
541
|
+
if (this.instance)
|
|
542
|
+
this.instance.setSplitListCheckedGroups(value);
|
|
546
543
|
},
|
|
547
544
|
|
|
548
545
|
showSelection(value) {
|
|
549
|
-
if (this.
|
|
550
|
-
this.
|
|
546
|
+
if (this.instance)
|
|
547
|
+
this.instance.setShowSelection(value);
|
|
551
548
|
},
|
|
552
549
|
|
|
553
550
|
showPlaceholderInTooltip(value) {
|
|
554
|
-
if (this.
|
|
555
|
-
this.
|
|
551
|
+
if (this.instance)
|
|
552
|
+
this.instance.setShowPlaceholderInTooltip(value);
|
|
556
553
|
},
|
|
557
554
|
|
|
558
555
|
multiPlaceholderFormatter(formatter) {
|
|
559
|
-
if (this.
|
|
560
|
-
this.
|
|
556
|
+
if (this.instance)
|
|
557
|
+
this.instance.setMultiPlaceholderFormatter(formatter);
|
|
561
558
|
},
|
|
562
559
|
|
|
563
560
|
showBlurOnSingleSelection(value) {
|
|
564
|
-
if (this.
|
|
565
|
-
this.
|
|
561
|
+
if (this.instance)
|
|
562
|
+
this.instance.setBlurOnSingleSelection(value);
|
|
566
563
|
},
|
|
567
564
|
|
|
568
565
|
multi(value) {
|
|
569
|
-
if (this.
|
|
570
|
-
this.
|
|
566
|
+
if (this.instance)
|
|
567
|
+
this.instance.setMulti(value);
|
|
571
568
|
},
|
|
572
569
|
|
|
573
570
|
searchable(value) {
|
|
574
|
-
if (this.
|
|
575
|
-
this.
|
|
571
|
+
if (this.instance)
|
|
572
|
+
this.instance.setSearchable(value);
|
|
576
573
|
},
|
|
577
574
|
|
|
578
575
|
allowTypeToSelect(value) {
|
|
579
|
-
if (this.
|
|
580
|
-
this.
|
|
576
|
+
if (this.instance)
|
|
577
|
+
this.instance.setAllowTypeToSelect(value);
|
|
581
578
|
},
|
|
582
579
|
|
|
583
580
|
noResultsText(value) {
|
|
584
|
-
if (this.
|
|
585
|
-
this.
|
|
581
|
+
if (this.instance)
|
|
582
|
+
this.instance.setNoResultsText(value ?? DefaultOptions.noResultsText);
|
|
586
583
|
},
|
|
587
584
|
|
|
588
585
|
filterThrottleWindow(value) {
|
|
589
|
-
if (this.
|
|
590
|
-
this.
|
|
586
|
+
if (this.instance)
|
|
587
|
+
this.instance.setFilterThrottleWindow(value ?? DefaultOptions.filterThrottleWindow ?? 0);
|
|
591
588
|
},
|
|
592
589
|
|
|
593
590
|
filterOnEmptyTerm(value) {
|
|
594
|
-
if (this.
|
|
595
|
-
this.
|
|
591
|
+
if (this.instance)
|
|
592
|
+
this.instance.setFilterOnEmptyTerm(value || false);
|
|
596
593
|
},
|
|
597
594
|
|
|
598
595
|
filterFn() {
|
|
599
|
-
if (this.
|
|
600
|
-
this.
|
|
596
|
+
if (this.instance)
|
|
597
|
+
this.instance.setFilterFn(this.filterFn);
|
|
601
598
|
},
|
|
602
599
|
|
|
603
600
|
labelProp(value) {
|
|
604
|
-
if (this.
|
|
605
|
-
this.
|
|
601
|
+
if (this.instance)
|
|
602
|
+
this.instance.setLabelProp(value);
|
|
606
603
|
},
|
|
607
604
|
|
|
608
605
|
valueProp(value) {
|
|
609
|
-
if (this.
|
|
610
|
-
this.
|
|
606
|
+
if (this.instance)
|
|
607
|
+
this.instance.setValueProp(value);
|
|
611
608
|
},
|
|
612
609
|
|
|
613
610
|
multiItemLabelProp(value) {
|
|
614
|
-
if (this.
|
|
615
|
-
this.
|
|
611
|
+
if (this.instance)
|
|
612
|
+
this.instance.setMultiItemLabelProp(value);
|
|
616
613
|
},
|
|
617
614
|
|
|
618
615
|
multiItemRemovePosition(value) {
|
|
619
|
-
if (this.
|
|
620
|
-
this.
|
|
616
|
+
if (this.instance)
|
|
617
|
+
this.instance.setMultiItemRemovePosition(value);
|
|
621
618
|
},
|
|
622
619
|
|
|
623
620
|
maxMultiItems(value) {
|
|
624
|
-
if (this.
|
|
625
|
-
this.
|
|
621
|
+
if (this.instance)
|
|
622
|
+
this.instance.setMaxMultiItems(value);
|
|
626
623
|
},
|
|
627
624
|
|
|
628
625
|
multiItemsRestLabelProvider(value) {
|
|
629
|
-
if (this.
|
|
630
|
-
this.
|
|
626
|
+
if (this.instance)
|
|
627
|
+
this.instance.setMultiItemsRestLabelProvider(value);
|
|
631
628
|
},
|
|
632
629
|
|
|
633
630
|
items(value) {
|
|
634
|
-
if (this.
|
|
635
|
-
this.
|
|
631
|
+
if (this.instance) {
|
|
632
|
+
this.instance.setItems(value, false);
|
|
636
633
|
|
|
637
634
|
const modelValue = isVue3 ? this.modelValue : this.value;
|
|
638
|
-
this.
|
|
635
|
+
this.instance.setValue(modelValue === null && (!this.acceptNullAsValue || this.multi) ? undefined : modelValue);
|
|
639
636
|
}
|
|
640
637
|
},
|
|
641
638
|
|
|
@@ -644,102 +641,102 @@ export default {
|
|
|
644
641
|
value.length === old && value.every((v, i) => old[i] === v))
|
|
645
642
|
return;
|
|
646
643
|
|
|
647
|
-
if (this.
|
|
648
|
-
this.
|
|
644
|
+
if (this.instance)
|
|
645
|
+
this.instance.setValue(value === null && (!this.acceptNullAsValue || this.multi) ? undefined : value);
|
|
649
646
|
},
|
|
650
647
|
|
|
651
648
|
renderSingleItem() {
|
|
652
|
-
if (this.
|
|
653
|
-
this.
|
|
649
|
+
if (this.instance)
|
|
650
|
+
this.instance.setRenderSingleItem(this.computedRenderSingleItem, this.computedUnrenderSingleItem);
|
|
654
651
|
},
|
|
655
652
|
|
|
656
653
|
unrenderSingleItem() {
|
|
657
|
-
if (this.
|
|
658
|
-
this.
|
|
654
|
+
if (this.instance)
|
|
655
|
+
this.instance.setRenderSingleItem(this.computedRenderSingleItem, this.computedUnrenderSingleItem);
|
|
659
656
|
},
|
|
660
657
|
|
|
661
658
|
renderMultiItem() {
|
|
662
|
-
if (this.
|
|
663
|
-
this.
|
|
659
|
+
if (this.instance)
|
|
660
|
+
this.instance.setRenderMultiItem(this.computedRenderMultiItem, this.computedUnrenderMultiItem);
|
|
664
661
|
},
|
|
665
662
|
|
|
666
663
|
unrenderMultiItem() {
|
|
667
|
-
if (this.
|
|
668
|
-
this.
|
|
664
|
+
if (this.instance)
|
|
665
|
+
this.instance.setRenderMultiItem(this.computedRenderMultiItem, this.computedUnrenderMultiItem);
|
|
669
666
|
},
|
|
670
667
|
|
|
671
668
|
renderRestMultiItem() {
|
|
672
|
-
if (this.
|
|
673
|
-
this.
|
|
669
|
+
if (this.instance)
|
|
670
|
+
this.instance.setRenderRestMultiItem(this.computedRenderRestMultiItem, this.computedUnrenderRestMultiItem);
|
|
674
671
|
},
|
|
675
672
|
|
|
676
673
|
unrenderRestMultiItem() {
|
|
677
|
-
if (this.
|
|
678
|
-
this.
|
|
674
|
+
if (this.instance)
|
|
675
|
+
this.instance.setRenderRestMultiItem(this.computedRenderRestMultiItem, this.computedUnrenderRestMultiItem);
|
|
679
676
|
},
|
|
680
677
|
|
|
681
678
|
renderNoResultsItem() {
|
|
682
|
-
if (this.
|
|
683
|
-
this.
|
|
679
|
+
if (this.instance)
|
|
680
|
+
this.instance.setRenderNoResultsItem(this.computedRenderNoResultsItem, this.computedUnrenderNoResultsItem);
|
|
684
681
|
},
|
|
685
682
|
|
|
686
683
|
unrenderNoResultsItem() {
|
|
687
|
-
if (this.
|
|
688
|
-
this.
|
|
684
|
+
if (this.instance)
|
|
685
|
+
this.instance.setRenderNoResultsItem(this.computedRenderNoResultsItem, this.computedUnrenderNoResultsItem);
|
|
689
686
|
},
|
|
690
687
|
|
|
691
688
|
renderListItem() {
|
|
692
|
-
if (this.
|
|
693
|
-
this.
|
|
689
|
+
if (this.instance)
|
|
690
|
+
this.instance.setListOptions(this.computedListOptions);
|
|
694
691
|
},
|
|
695
692
|
|
|
696
693
|
unrenderListItem() {
|
|
697
|
-
if (this.
|
|
698
|
-
this.
|
|
694
|
+
if (this.instance)
|
|
695
|
+
this.instance.setListOptions(this.computedListOptions);
|
|
699
696
|
},
|
|
700
697
|
|
|
701
698
|
...(isVue3 ? {} : {
|
|
702
699
|
$scopedSlots() { // Vue 2
|
|
703
|
-
if (this.
|
|
704
|
-
this.
|
|
700
|
+
if (this.instance)
|
|
701
|
+
this.instance.setListOptions(this.computedListOptions);
|
|
705
702
|
},
|
|
706
703
|
}),
|
|
707
704
|
|
|
708
705
|
$slots() {
|
|
709
|
-
if (this.
|
|
710
|
-
this.
|
|
706
|
+
if (this.instance)
|
|
707
|
+
this.instance.setListOptions(this.computedListOptions);
|
|
711
708
|
},
|
|
712
709
|
|
|
713
710
|
additionalClasses() {
|
|
714
|
-
if (this.
|
|
715
|
-
this.
|
|
711
|
+
if (this.instance)
|
|
712
|
+
this.instance.setAdditionalClasses(this.additionalClassesList);
|
|
716
713
|
},
|
|
717
714
|
|
|
718
715
|
isLoadingMode() {
|
|
719
|
-
if (this.
|
|
720
|
-
this.
|
|
716
|
+
if (this.instance)
|
|
717
|
+
this.instance.setIsLoadingMode(!!this.isLoadingMode);
|
|
721
718
|
},
|
|
722
719
|
|
|
723
720
|
closeListWhenLoading() {
|
|
724
|
-
if (this.
|
|
725
|
-
this.
|
|
721
|
+
if (this.instance)
|
|
722
|
+
this.instance.setCloseListWhenLoading(this.closeListWhenLoading ?? DefaultOptions.closeListWhenLoading);
|
|
726
723
|
},
|
|
727
724
|
|
|
728
725
|
clearInputWhen() {
|
|
729
|
-
if (this.
|
|
730
|
-
this.
|
|
726
|
+
if (this.instance)
|
|
727
|
+
this.instance.setClearInputWhen(this.clearInputWhen);
|
|
731
728
|
},
|
|
732
729
|
|
|
733
730
|
treatGroupSelectionAsItems() {
|
|
734
|
-
if (this.
|
|
735
|
-
this.
|
|
731
|
+
if (this.instance)
|
|
732
|
+
this.instance.setTreatGroupSelectionAsItems(!!this.treatGroupSelectionAsItems);
|
|
736
733
|
},
|
|
737
734
|
|
|
738
735
|
filterDependencies: {
|
|
739
736
|
deep: true,
|
|
740
737
|
handler() {
|
|
741
|
-
if (this.
|
|
742
|
-
this.
|
|
738
|
+
if (this.instance)
|
|
739
|
+
this.instance.invokeRefilter();
|
|
743
740
|
},
|
|
744
741
|
},
|
|
745
742
|
|
|
@@ -751,8 +748,8 @@ export default {
|
|
|
751
748
|
if (window.ResizeObserver === undefined) {
|
|
752
749
|
const wasAttached = this._isAttached;
|
|
753
750
|
this._isAttached = !!this.el && document.body.contains(this.el);
|
|
754
|
-
if (!wasAttached && this.
|
|
755
|
-
this.
|
|
751
|
+
if (!wasAttached && this.instance && this._isAttached)
|
|
752
|
+
this.instance.refreshSize();
|
|
756
753
|
}
|
|
757
754
|
}
|
|
758
755
|
} else {
|
|
@@ -766,11 +763,11 @@ export default {
|
|
|
766
763
|
|
|
767
764
|
this._createBox();
|
|
768
765
|
|
|
769
|
-
if (window.ResizeObserver === undefined && this.
|
|
766
|
+
if (window.ResizeObserver === undefined && this.instance) {
|
|
770
767
|
const wasAttached = this._isAttached;
|
|
771
768
|
this._isAttached = !!this.$refs.el && document.body.contains(this.$refs.el);
|
|
772
|
-
if (!wasAttached && this.
|
|
773
|
-
this.
|
|
769
|
+
if (!wasAttached && this.instance && this._isAttached)
|
|
770
|
+
this.instance.refreshSize();
|
|
774
771
|
}
|
|
775
772
|
},
|
|
776
773
|
|
|
@@ -809,7 +806,7 @@ export default {
|
|
|
809
806
|
event === 'groupcheck' ||
|
|
810
807
|
(event === 'addsel' && !event.isCheckingGroup) ||
|
|
811
808
|
(event === 'removesel' && !event.isCheckingGroup)) {
|
|
812
|
-
let value = event === 'select' ? data.value : this.
|
|
809
|
+
let value = event === 'select' ? data.value : this.instance.getValue();
|
|
813
810
|
if (value === undefined && event !== 'select' && this.emitNullForEmptyValue)
|
|
814
811
|
value = null;
|
|
815
812
|
this.$emit(isVue3 ? 'update:modelValue' : 'input', value);
|
|
@@ -873,14 +870,14 @@ export default {
|
|
|
873
870
|
const modelValue = isVue3 ? this.modelValue : this.value;
|
|
874
871
|
box.setValue(modelValue === null && (!this.acceptNullAsValue || this.multi) ? undefined : modelValue);
|
|
875
872
|
|
|
876
|
-
this.
|
|
873
|
+
this.instance = markRaw(box);
|
|
877
874
|
this.el = box.el;
|
|
878
875
|
},
|
|
879
876
|
|
|
880
877
|
_destroyBox() {
|
|
881
|
-
if (this.
|
|
882
|
-
this.
|
|
883
|
-
this.
|
|
878
|
+
if (this.instance) {
|
|
879
|
+
this.instance.destroy();
|
|
880
|
+
this.instance = undefined;
|
|
884
881
|
}
|
|
885
882
|
},
|
|
886
883
|
|
|
@@ -901,39 +898,39 @@ export default {
|
|
|
901
898
|
},
|
|
902
899
|
|
|
903
900
|
toggleLoading(on) {
|
|
904
|
-
if (this.
|
|
905
|
-
this.
|
|
901
|
+
if (this.instance)
|
|
902
|
+
this.instance.toggleLoading(on);
|
|
906
903
|
},
|
|
907
904
|
|
|
908
905
|
toggleList(open) {
|
|
909
|
-
if (this.
|
|
910
|
-
this.
|
|
906
|
+
if (this.instance)
|
|
907
|
+
this.instance.toggleList(open);
|
|
911
908
|
},
|
|
912
909
|
|
|
913
910
|
openList() {
|
|
914
|
-
if (this.
|
|
915
|
-
this.
|
|
911
|
+
if (this.instance)
|
|
912
|
+
this.instance.openList();
|
|
916
913
|
},
|
|
917
914
|
|
|
918
915
|
closeList() {
|
|
919
|
-
if (this.
|
|
920
|
-
this.
|
|
916
|
+
if (this.instance)
|
|
917
|
+
this.instance.closeList();
|
|
921
918
|
},
|
|
922
919
|
|
|
923
920
|
isListOpen() {
|
|
924
|
-
if (this.
|
|
925
|
-
return this.
|
|
921
|
+
if (this.instance)
|
|
922
|
+
return this.instance.isListOpen();
|
|
926
923
|
return false;
|
|
927
924
|
},
|
|
928
925
|
|
|
929
926
|
updateItemByValue(value, newItem) {
|
|
930
|
-
if (this.
|
|
931
|
-
return this.
|
|
927
|
+
if (this.instance)
|
|
928
|
+
return this.instance.updateItemByValue(value, newItem);
|
|
932
929
|
},
|
|
933
930
|
|
|
934
931
|
getSelectedItems() {
|
|
935
|
-
if (this.
|
|
936
|
-
return this.
|
|
932
|
+
if (this.instance)
|
|
933
|
+
return this.instance.getSelectedItems();
|
|
937
934
|
return [];
|
|
938
935
|
},
|
|
939
936
|
|
|
@@ -942,16 +939,16 @@ export default {
|
|
|
942
939
|
* @param {boolean} [performSearch=false] should actually perform the search, or just set the input's text?
|
|
943
940
|
*/
|
|
944
941
|
setSearchTerm(term, performSearch) {
|
|
945
|
-
if (term != null && this.
|
|
946
|
-
this.
|
|
942
|
+
if (term != null && this.instance)
|
|
943
|
+
this.instance.setSearchTerm(term, performSearch);
|
|
947
944
|
},
|
|
948
945
|
|
|
949
946
|
/**
|
|
950
947
|
* @returns {string}
|
|
951
948
|
*/
|
|
952
949
|
getSearchTerm() {
|
|
953
|
-
if (this.
|
|
954
|
-
return this.
|
|
950
|
+
if (this.instance)
|
|
951
|
+
return this.instance.getSearchTerm();
|
|
955
952
|
return '';
|
|
956
953
|
},
|
|
957
954
|
|
|
@@ -959,8 +956,8 @@ export default {
|
|
|
959
956
|
* @returns {number}
|
|
960
957
|
*/
|
|
961
958
|
getFilteredItemCount() {
|
|
962
|
-
if (this.
|
|
963
|
-
return this.
|
|
959
|
+
if (this.instance)
|
|
960
|
+
return this.instance.getFilteredItemCount();
|
|
964
961
|
return 0;
|
|
965
962
|
},
|
|
966
963
|
|
|
@@ -968,21 +965,21 @@ export default {
|
|
|
968
965
|
* @returns {boolean}
|
|
969
966
|
*/
|
|
970
967
|
isFilterPending() {
|
|
971
|
-
if (this.
|
|
972
|
-
return this.
|
|
968
|
+
if (this.instance)
|
|
969
|
+
return this.instance.isFilterPending();
|
|
973
970
|
return false;
|
|
974
971
|
},
|
|
975
972
|
|
|
976
973
|
focus() {
|
|
977
|
-
this.
|
|
974
|
+
this.instance?.focusInput();
|
|
978
975
|
},
|
|
979
976
|
|
|
980
977
|
blur() {
|
|
981
|
-
this.
|
|
978
|
+
this.instance?.blurInput();
|
|
982
979
|
},
|
|
983
980
|
|
|
984
981
|
droplistElContains(other, considerSublists = true) {
|
|
985
|
-
return this.
|
|
982
|
+
return this.instance?.droplistElContains(other, considerSublists);
|
|
986
983
|
},
|
|
987
984
|
},
|
|
988
985
|
};
|