primevue 4.3.1 → 4.3.3
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/accordionheader/AccordionHeader.vue +8 -2
- package/accordionheader/index.mjs +8 -1
- package/accordionheader/index.mjs.map +1 -1
- package/autocomplete/AutoComplete.vue +72 -16
- package/autocomplete/index.d.ts +3 -3
- package/autocomplete/index.mjs +84 -37
- package/autocomplete/index.mjs.map +1 -1
- package/avatar/Avatar.vue +13 -4
- package/avatar/index.d.ts +3 -3
- package/avatar/index.mjs +26 -6
- package/avatar/index.mjs.map +1 -1
- package/badge/Badge.vue +13 -2
- package/badge/index.d.ts +1 -1
- package/badge/index.mjs +18 -3
- package/badge/index.mjs.map +1 -1
- package/blockui/BlockUI.vue +15 -4
- package/blockui/index.mjs +13 -4
- package/blockui/index.mjs.map +1 -1
- package/button/Button.vue +30 -3
- package/button/index.d.ts +3 -7
- package/button/index.mjs +28 -9
- package/button/index.mjs.map +1 -1
- package/cascadeselect/CascadeSelect.vue +1 -1
- package/cascadeselect/index.d.ts +2 -2
- package/cascadeselect/index.mjs +1 -2
- package/cascadeselect/index.mjs.map +1 -1
- package/checkbox/Checkbox.vue +15 -5
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.mjs +29 -7
- package/checkbox/index.mjs.map +1 -1
- package/chip/BaseChip.vue +1 -1
- package/chip/Chip.vue +9 -1
- package/chip/index.d.ts +1 -1
- package/chip/index.mjs +13 -3
- package/chip/index.mjs.map +1 -1
- package/colorpicker/ColorPicker.vue +10 -2
- package/colorpicker/index.d.ts +1 -1
- package/colorpicker/index.mjs +9 -2
- package/colorpicker/index.mjs.map +1 -1
- package/column/index.d.ts +3 -3
- package/columngroup/index.d.ts +2 -2
- package/confirmationoptions/index.d.ts +1 -1
- package/datatable/BodyCell.vue +4 -1
- package/datatable/BodyRow.vue +2 -0
- package/datatable/ColumnFilter.vue +1 -1
- package/datatable/DataTable.vue +103 -44
- package/datatable/HeaderCheckbox.vue +2 -2
- package/datatable/RowCheckbox.vue +1 -1
- package/datatable/TableBody.vue +12 -1
- package/datatable/TableFooter.vue +9 -1
- package/datatable/TableHeader.vue +9 -2
- package/datatable/index.d.ts +45 -37
- package/datatable/index.mjs +170 -101
- package/datatable/index.mjs.map +1 -1
- package/dataview/DataView.vue +4 -0
- package/dataview/index.d.ts +61 -4
- package/dataview/index.mjs +6 -2
- package/dataview/index.mjs.map +1 -1
- package/datepicker/DatePicker.vue +370 -234
- package/datepicker/index.d.ts +162 -6
- package/datepicker/index.mjs +644 -384
- package/datepicker/index.mjs.map +1 -1
- package/dialog/Dialog.vue +48 -39
- package/dialog/index.d.ts +26 -1
- package/dialog/index.mjs +73 -50
- package/dialog/index.mjs.map +1 -1
- package/divider/Divider.vue +13 -3
- package/divider/index.d.ts +4 -4
- package/divider/index.mjs +18 -5
- package/divider/index.mjs.map +1 -1
- package/dock/index.d.ts +4 -4
- package/drawer/Drawer.vue +30 -20
- package/drawer/index.d.ts +12 -2
- package/drawer/index.mjs +42 -25
- package/drawer/index.mjs.map +1 -1
- package/fieldset/Fieldset.vue +8 -2
- package/fieldset/index.mjs +20 -10
- package/fieldset/index.mjs.map +1 -1
- package/fileupload/FileUpload.vue +1 -1
- package/fileupload/index.d.ts +2 -2
- package/fileupload/index.mjs +2 -2
- package/fileupload/index.mjs.map +1 -1
- package/floatlabel/index.d.ts +2 -2
- package/galleria/Galleria.vue +39 -3
- package/galleria/GalleriaItem.vue +8 -9
- package/galleria/index.d.ts +3 -3
- package/galleria/index.mjs +48 -11
- package/galleria/index.mjs.map +1 -1
- package/inplace/Inplace.vue +1 -1
- package/inplace/index.mjs +3 -2
- package/inplace/index.mjs.map +1 -1
- package/inputchips/index.d.ts +2 -2
- package/inputmask/InputMask.vue +15 -1
- package/inputmask/index.d.ts +3 -3
- package/inputmask/index.mjs +12 -1
- package/inputmask/index.mjs.map +1 -1
- package/inputnumber/BaseInputNumber.vue +4 -0
- package/inputnumber/InputNumber.vue +29 -14
- package/inputnumber/index.d.ts +6 -6
- package/inputnumber/index.mjs +47 -25
- package/inputnumber/index.mjs.map +1 -1
- package/inputotp/index.d.ts +3 -3
- package/inputtext/InputText.vue +10 -1
- package/inputtext/index.d.ts +4 -5
- package/inputtext/index.mjs +14 -1
- package/inputtext/index.mjs.map +1 -1
- package/keyfilter/index.mjs +12 -19
- package/keyfilter/index.mjs.map +1 -1
- package/knob/Knob.vue +1 -1
- package/knob/index.mjs +1 -1
- package/knob/index.mjs.map +1 -1
- package/listbox/Listbox.vue +9 -2
- package/listbox/index.mjs +11 -3
- package/listbox/index.mjs.map +1 -1
- package/megamenu/index.d.ts +2 -2
- package/menu/Menu.vue +8 -2
- package/menu/Menuitem.vue +14 -4
- package/menu/index.mjs +36 -16
- package/menu/index.mjs.map +1 -1
- package/message/Message.vue +16 -7
- package/message/index.d.ts +2 -2
- package/message/index.mjs +35 -13
- package/message/index.mjs.map +1 -1
- package/metergroup/MeterGroup.vue +9 -3
- package/metergroup/MeterGroupLabel.vue +10 -1
- package/metergroup/index.mjs +32 -7
- package/metergroup/index.mjs.map +1 -1
- package/multiselect/MultiSelect.vue +41 -6
- package/multiselect/index.d.ts +3 -3
- package/multiselect/index.mjs +53 -21
- package/multiselect/index.mjs.map +1 -1
- package/organizationchart/index.d.ts +2 -2
- package/overlaybadge/index.d.ts +1 -1
- package/package.json +3 -3
- package/paginator/Paginator.vue +2 -0
- package/paginator/index.d.ts +8 -0
- package/paginator/index.mjs +3 -1
- package/paginator/index.mjs.map +1 -1
- package/panel/Panel.vue +29 -22
- package/panel/index.d.ts +22 -2
- package/panel/index.mjs +55 -31
- package/panel/index.mjs.map +1 -1
- package/panelmenu/PanelMenuList.vue +1 -1
- package/panelmenu/index.mjs +1 -1
- package/panelmenu/index.mjs.map +1 -1
- package/password/Password.vue +21 -3
- package/password/index.d.ts +3 -3
- package/password/index.mjs +32 -10
- package/password/index.mjs.map +1 -1
- package/popover/Popover.vue +3 -3
- package/popover/index.mjs +3 -4
- package/popover/index.mjs.map +1 -1
- package/progressbar/ProgressBar.vue +11 -4
- package/progressbar/index.mjs +21 -7
- package/progressbar/index.mjs.map +1 -1
- package/radiobutton/RadioButton.vue +13 -3
- package/radiobutton/index.d.ts +3 -3
- package/radiobutton/index.mjs +24 -4
- package/radiobutton/index.mjs.map +1 -1
- package/rating/Rating.vue +19 -2
- package/rating/index.mjs +28 -7
- package/rating/index.mjs.map +1 -1
- package/scrolltop/ScrollTop.vue +2 -2
- package/scrolltop/index.d.ts +2 -2
- package/scrolltop/index.mjs +4 -2
- package/scrolltop/index.mjs.map +1 -1
- package/select/Select.vue +56 -16
- package/select/index.d.ts +2 -2
- package/select/index.mjs +111 -74
- package/select/index.mjs.map +1 -1
- package/selectbutton/SelectButton.vue +26 -9
- package/selectbutton/index.d.ts +2 -2
- package/selectbutton/index.mjs +30 -10
- package/selectbutton/index.mjs.map +1 -1
- package/skeleton/Skeleton.vue +7 -1
- package/skeleton/index.d.ts +3 -3
- package/skeleton/index.mjs +12 -1
- package/skeleton/index.mjs.map +1 -1
- package/slider/Slider.vue +11 -2
- package/slider/index.d.ts +2 -2
- package/slider/index.mjs +27 -8
- package/slider/index.mjs.map +1 -1
- package/speeddial/index.d.ts +5 -5
- package/splitbutton/index.d.ts +1 -1
- package/splitter/Splitter.vue +10 -2
- package/splitter/index.d.ts +3 -3
- package/splitter/index.mjs +19 -6
- package/splitter/index.mjs.map +1 -1
- package/step/Step.vue +25 -7
- package/step/index.mjs +44 -14
- package/step/index.mjs.map +1 -1
- package/steppanel/StepPanel.vue +9 -3
- package/steppanel/index.d.ts +8 -0
- package/steppanel/index.mjs +23 -8
- package/steppanel/index.mjs.map +1 -1
- package/stepper/StepperSeparator.vue +5 -2
- package/stepper/index.d.ts +4 -0
- package/tab/Tab.vue +12 -6
- package/tab/index.mjs +13 -5
- package/tab/index.mjs.map +1 -1
- package/tablist/TabList.vue +13 -2
- package/tablist/index.mjs +21 -8
- package/tablist/index.mjs.map +1 -1
- package/tabpanel/TabPanel.vue +2 -2
- package/tabpanel/index.mjs +2 -2
- package/tabpanel/index.mjs.map +1 -1
- package/tag/Tag.vue +11 -2
- package/tag/index.mjs +17 -3
- package/tag/index.mjs.map +1 -1
- package/textarea/Textarea.vue +10 -1
- package/textarea/index.d.ts +4 -5
- package/textarea/index.mjs +14 -1
- package/textarea/index.mjs.map +1 -1
- package/tieredmenu/TieredMenu.vue +1 -1
- package/tieredmenu/index.mjs +1 -2
- package/tieredmenu/index.mjs.map +1 -1
- package/timeline/Timeline.vue +16 -7
- package/timeline/index.d.ts +3 -3
- package/timeline/index.mjs +42 -11
- package/timeline/index.mjs.map +1 -1
- package/toast/Toast.vue +10 -1
- package/toast/ToastMessage.vue +29 -19
- package/toast/index.d.ts +2 -2
- package/toast/index.mjs +77 -38
- package/toast/index.mjs.map +1 -1
- package/togglebutton/ToggleButton.vue +10 -1
- package/togglebutton/index.d.ts +3 -3
- package/togglebutton/index.mjs +19 -4
- package/togglebutton/index.mjs.map +1 -1
- package/toggleswitch/ToggleSwitch.vue +11 -3
- package/toggleswitch/index.mjs +20 -5
- package/toggleswitch/index.mjs.map +1 -1
- package/tooltip/index.mjs +22 -22
- package/tooltip/index.mjs.map +1 -1
- package/tree/Tree.vue +14 -2
- package/tree/TreeNode.vue +2 -2
- package/tree/index.d.ts +3 -3
- package/tree/index.mjs +28 -10
- package/tree/index.mjs.map +1 -1
- package/treeselect/TreeSelect.vue +1 -1
- package/treeselect/index.d.ts +6 -6
- package/treeselect/index.mjs +1 -2
- package/treeselect/index.mjs.map +1 -1
- package/treetable/index.d.ts +7 -7
- package/treetable/style/index.mjs +2 -3
- package/treetable/style/index.mjs.map +1 -1
- package/umd/primevue.min.js +1 -1
- package/virtualscroller/VirtualScroller.vue +13 -2
- package/virtualscroller/index.d.ts +2 -2
- package/virtualscroller/index.mjs +14 -4
- package/virtualscroller/index.mjs.map +1 -1
- package/virtualscroller/style/index.mjs +1 -1
- package/virtualscroller/style/index.mjs.map +1 -1
- package/web-types.json +1 -1
package/select/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cn } from '@primeuix/utils';
|
|
1
2
|
import { findSingle, getFocusableElements, isVisible, focus, isTouchDevice, relativePosition, getOuterWidth, absolutePosition, addStyle, getLastFocusableElement, getFirstFocusableElement, isAndroid } from '@primeuix/utils/dom';
|
|
2
3
|
import { isNotEmpty, findLastIndex, equals, isPrintableCharacter, resolveFieldData } from '@primeuix/utils/object';
|
|
3
4
|
import { ZIndex } from '@primeuix/utils/zindex';
|
|
@@ -344,12 +345,15 @@ var script = {
|
|
|
344
345
|
this.$emit('focus', event);
|
|
345
346
|
},
|
|
346
347
|
onBlur: function onBlur(event) {
|
|
347
|
-
var
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
348
|
+
var _this3 = this;
|
|
349
|
+
setTimeout(function () {
|
|
350
|
+
var _this3$formField$onBl, _this3$formField;
|
|
351
|
+
_this3.focused = false;
|
|
352
|
+
_this3.focusedOptionIndex = -1;
|
|
353
|
+
_this3.searchValue = '';
|
|
354
|
+
_this3.$emit('blur', event);
|
|
355
|
+
(_this3$formField$onBl = (_this3$formField = _this3.formField).onBlur) === null || _this3$formField$onBl === void 0 || _this3$formField$onBl.call(_this3$formField, event);
|
|
356
|
+
}, 100);
|
|
353
357
|
},
|
|
354
358
|
onKeyDown: function onKeyDown(event) {
|
|
355
359
|
if (this.disabled || isAndroid()) {
|
|
@@ -627,18 +631,17 @@ var script = {
|
|
|
627
631
|
}
|
|
628
632
|
},
|
|
629
633
|
onOverlayEnter: function onOverlayEnter(el) {
|
|
630
|
-
var
|
|
634
|
+
var _this4 = this;
|
|
631
635
|
ZIndex.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
632
636
|
addStyle(el, {
|
|
633
637
|
position: 'absolute',
|
|
634
|
-
top: '0'
|
|
635
|
-
left: '0'
|
|
638
|
+
top: '0'
|
|
636
639
|
});
|
|
637
640
|
this.alignOverlay();
|
|
638
641
|
this.scrollInView();
|
|
639
642
|
setTimeout(function () {
|
|
640
|
-
|
|
641
|
-
|
|
643
|
+
_this4.autoFilterFocus && _this4.filter && focus(_this4.$refs.filterInput.$el);
|
|
644
|
+
_this4.autoUpdateModel();
|
|
642
645
|
}, 1);
|
|
643
646
|
},
|
|
644
647
|
onOverlayAfterEnter: function onOverlayAfterEnter() {
|
|
@@ -648,14 +651,14 @@ var script = {
|
|
|
648
651
|
this.$emit('show');
|
|
649
652
|
},
|
|
650
653
|
onOverlayLeave: function onOverlayLeave() {
|
|
651
|
-
var
|
|
654
|
+
var _this5 = this;
|
|
652
655
|
this.unbindOutsideClickListener();
|
|
653
656
|
this.unbindScrollListener();
|
|
654
657
|
this.unbindResizeListener();
|
|
655
658
|
if (this.autoFilterFocus && this.filter && !this.editable) {
|
|
656
659
|
this.$nextTick(function () {
|
|
657
|
-
if (
|
|
658
|
-
focus(
|
|
660
|
+
if (_this5.$refs.filterInput) {
|
|
661
|
+
focus(_this5.$refs.filterInput.$el);
|
|
659
662
|
}
|
|
660
663
|
});
|
|
661
664
|
}
|
|
@@ -669,16 +672,19 @@ var script = {
|
|
|
669
672
|
if (this.appendTo === 'self') {
|
|
670
673
|
relativePosition(this.overlay, this.$el);
|
|
671
674
|
} else {
|
|
672
|
-
this.overlay
|
|
673
|
-
|
|
675
|
+
if (this.overlay) {
|
|
676
|
+
this.overlay.style.minWidth = getOuterWidth(this.$el) + 'px';
|
|
677
|
+
absolutePosition(this.overlay, this.$el);
|
|
678
|
+
}
|
|
674
679
|
}
|
|
675
680
|
},
|
|
676
681
|
bindOutsideClickListener: function bindOutsideClickListener() {
|
|
677
|
-
var
|
|
682
|
+
var _this6 = this;
|
|
678
683
|
if (!this.outsideClickListener) {
|
|
679
684
|
this.outsideClickListener = function (event) {
|
|
680
|
-
|
|
681
|
-
|
|
685
|
+
var composedPath = event.composedPath();
|
|
686
|
+
if (_this6.overlayVisible && _this6.overlay && !composedPath.includes(_this6.$el) && !composedPath.includes(_this6.overlay)) {
|
|
687
|
+
_this6.hide();
|
|
682
688
|
}
|
|
683
689
|
};
|
|
684
690
|
document.addEventListener('click', this.outsideClickListener, true);
|
|
@@ -691,11 +697,11 @@ var script = {
|
|
|
691
697
|
}
|
|
692
698
|
},
|
|
693
699
|
bindScrollListener: function bindScrollListener() {
|
|
694
|
-
var
|
|
700
|
+
var _this7 = this;
|
|
695
701
|
if (!this.scrollHandler) {
|
|
696
702
|
this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function () {
|
|
697
|
-
if (
|
|
698
|
-
|
|
703
|
+
if (_this7.overlayVisible) {
|
|
704
|
+
_this7.hide();
|
|
699
705
|
}
|
|
700
706
|
});
|
|
701
707
|
}
|
|
@@ -707,11 +713,11 @@ var script = {
|
|
|
707
713
|
}
|
|
708
714
|
},
|
|
709
715
|
bindResizeListener: function bindResizeListener() {
|
|
710
|
-
var
|
|
716
|
+
var _this8 = this;
|
|
711
717
|
if (!this.resizeListener) {
|
|
712
718
|
this.resizeListener = function () {
|
|
713
|
-
if (
|
|
714
|
-
|
|
719
|
+
if (_this8.overlayVisible && !isTouchDevice()) {
|
|
720
|
+
_this8.hide();
|
|
715
721
|
}
|
|
716
722
|
};
|
|
717
723
|
window.addEventListener('resize', this.resizeListener);
|
|
@@ -724,12 +730,12 @@ var script = {
|
|
|
724
730
|
}
|
|
725
731
|
},
|
|
726
732
|
bindLabelClickListener: function bindLabelClickListener() {
|
|
727
|
-
var
|
|
733
|
+
var _this9 = this;
|
|
728
734
|
if (!this.editable && !this.labelClickListener) {
|
|
729
735
|
var label = document.querySelector("label[for=\"".concat(this.labelId, "\"]"));
|
|
730
736
|
if (label && isVisible(label)) {
|
|
731
737
|
this.labelClickListener = function () {
|
|
732
|
-
focus(
|
|
738
|
+
focus(_this9.$refs.focusInput);
|
|
733
739
|
};
|
|
734
740
|
label.addEventListener('click', this.labelClickListener);
|
|
735
741
|
}
|
|
@@ -744,12 +750,12 @@ var script = {
|
|
|
744
750
|
}
|
|
745
751
|
},
|
|
746
752
|
bindMatchMediaOrientationListener: function bindMatchMediaOrientationListener() {
|
|
747
|
-
var
|
|
753
|
+
var _this10 = this;
|
|
748
754
|
if (!this.matchMediaOrientationListener) {
|
|
749
755
|
var query = matchMedia("(orientation: portrait)");
|
|
750
756
|
this.queryOrientation = query;
|
|
751
757
|
this.matchMediaOrientationListener = function () {
|
|
752
|
-
|
|
758
|
+
_this10.alignOverlay();
|
|
753
759
|
};
|
|
754
760
|
this.queryOrientation.addEventListener('change', this.matchMediaOrientationListener);
|
|
755
761
|
}
|
|
@@ -782,35 +788,35 @@ var script = {
|
|
|
782
788
|
return equals(this.d_value, this.getOptionValue(option), this.equalityKey);
|
|
783
789
|
},
|
|
784
790
|
findFirstOptionIndex: function findFirstOptionIndex() {
|
|
785
|
-
var
|
|
791
|
+
var _this11 = this;
|
|
786
792
|
return this.visibleOptions.findIndex(function (option) {
|
|
787
|
-
return
|
|
793
|
+
return _this11.isValidOption(option);
|
|
788
794
|
});
|
|
789
795
|
},
|
|
790
796
|
findLastOptionIndex: function findLastOptionIndex() {
|
|
791
|
-
var
|
|
797
|
+
var _this12 = this;
|
|
792
798
|
return findLastIndex(this.visibleOptions, function (option) {
|
|
793
|
-
return
|
|
799
|
+
return _this12.isValidOption(option);
|
|
794
800
|
});
|
|
795
801
|
},
|
|
796
802
|
findNextOptionIndex: function findNextOptionIndex(index) {
|
|
797
|
-
var
|
|
803
|
+
var _this13 = this;
|
|
798
804
|
var matchedOptionIndex = index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function (option) {
|
|
799
|
-
return
|
|
805
|
+
return _this13.isValidOption(option);
|
|
800
806
|
}) : -1;
|
|
801
807
|
return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
|
|
802
808
|
},
|
|
803
809
|
findPrevOptionIndex: function findPrevOptionIndex(index) {
|
|
804
|
-
var
|
|
810
|
+
var _this14 = this;
|
|
805
811
|
var matchedOptionIndex = index > 0 ? findLastIndex(this.visibleOptions.slice(0, index), function (option) {
|
|
806
|
-
return
|
|
812
|
+
return _this14.isValidOption(option);
|
|
807
813
|
}) : -1;
|
|
808
814
|
return matchedOptionIndex > -1 ? matchedOptionIndex : index;
|
|
809
815
|
},
|
|
810
816
|
findSelectedOptionIndex: function findSelectedOptionIndex() {
|
|
811
|
-
var
|
|
817
|
+
var _this15 = this;
|
|
812
818
|
return this.$filled ? this.visibleOptions.findIndex(function (option) {
|
|
813
|
-
return
|
|
819
|
+
return _this15.isValidSelectedOption(option);
|
|
814
820
|
}) : -1;
|
|
815
821
|
},
|
|
816
822
|
findFirstFocusedOptionIndex: function findFirstFocusedOptionIndex() {
|
|
@@ -822,17 +828,17 @@ var script = {
|
|
|
822
828
|
return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
|
|
823
829
|
},
|
|
824
830
|
searchOptions: function searchOptions(event, _char) {
|
|
825
|
-
var
|
|
831
|
+
var _this16 = this;
|
|
826
832
|
this.searchValue = (this.searchValue || '') + _char;
|
|
827
833
|
var optionIndex = -1;
|
|
828
834
|
var matched = false;
|
|
829
835
|
if (isNotEmpty(this.searchValue)) {
|
|
830
836
|
optionIndex = this.visibleOptions.findIndex(function (option) {
|
|
831
|
-
return
|
|
837
|
+
return _this16.isOptionExactMatched(option);
|
|
832
838
|
});
|
|
833
839
|
if (optionIndex === -1) {
|
|
834
840
|
optionIndex = this.visibleOptions.findIndex(function (option) {
|
|
835
|
-
return
|
|
841
|
+
return _this16.isOptionStartsWith(option);
|
|
836
842
|
});
|
|
837
843
|
}
|
|
838
844
|
if (optionIndex !== -1) {
|
|
@@ -849,8 +855,8 @@ var script = {
|
|
|
849
855
|
clearTimeout(this.searchTimeout);
|
|
850
856
|
}
|
|
851
857
|
this.searchTimeout = setTimeout(function () {
|
|
852
|
-
|
|
853
|
-
|
|
858
|
+
_this16.searchValue = '';
|
|
859
|
+
_this16.searchTimeout = null;
|
|
854
860
|
}, 500);
|
|
855
861
|
return matched;
|
|
856
862
|
},
|
|
@@ -864,18 +870,18 @@ var script = {
|
|
|
864
870
|
}
|
|
865
871
|
},
|
|
866
872
|
scrollInView: function scrollInView() {
|
|
867
|
-
var
|
|
873
|
+
var _this17 = this;
|
|
868
874
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
869
875
|
this.$nextTick(function () {
|
|
870
|
-
var id = index !== -1 ? "".concat(
|
|
871
|
-
var element = findSingle(
|
|
876
|
+
var id = index !== -1 ? "".concat(_this17.$id, "_").concat(index) : _this17.focusedOptionId;
|
|
877
|
+
var element = findSingle(_this17.list, "li[id=\"".concat(id, "\"]"));
|
|
872
878
|
if (element) {
|
|
873
879
|
element.scrollIntoView && element.scrollIntoView({
|
|
874
880
|
block: 'nearest',
|
|
875
|
-
inline: '
|
|
881
|
+
inline: 'nearest'
|
|
876
882
|
});
|
|
877
|
-
} else if (!
|
|
878
|
-
|
|
883
|
+
} else if (!_this17.virtualScrollerDisabled) {
|
|
884
|
+
_this17.virtualScroller && _this17.virtualScroller.scrollToIndex(index !== -1 ? index : _this17.focusedOptionIndex);
|
|
879
885
|
}
|
|
880
886
|
});
|
|
881
887
|
},
|
|
@@ -895,14 +901,14 @@ var script = {
|
|
|
895
901
|
});
|
|
896
902
|
},
|
|
897
903
|
flatOptions: function flatOptions(options) {
|
|
898
|
-
var
|
|
904
|
+
var _this18 = this;
|
|
899
905
|
return (options || []).reduce(function (result, option, index) {
|
|
900
906
|
result.push({
|
|
901
907
|
optionGroup: option,
|
|
902
908
|
group: true,
|
|
903
909
|
index: index
|
|
904
910
|
});
|
|
905
|
-
var optionGroupChildren =
|
|
911
|
+
var optionGroupChildren = _this18.getOptionGroupChildren(option);
|
|
906
912
|
optionGroupChildren && optionGroupChildren.forEach(function (o) {
|
|
907
913
|
return result.push(o);
|
|
908
914
|
});
|
|
@@ -922,7 +928,7 @@ var script = {
|
|
|
922
928
|
},
|
|
923
929
|
computed: {
|
|
924
930
|
visibleOptions: function visibleOptions() {
|
|
925
|
-
var
|
|
931
|
+
var _this19 = this;
|
|
926
932
|
var options = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];
|
|
927
933
|
if (this.filterValue) {
|
|
928
934
|
var filteredOptions = FilterService.filter(options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
|
|
@@ -930,11 +936,11 @@ var script = {
|
|
|
930
936
|
var optionGroups = this.options || [];
|
|
931
937
|
var filtered = [];
|
|
932
938
|
optionGroups.forEach(function (group) {
|
|
933
|
-
var groupChildren =
|
|
939
|
+
var groupChildren = _this19.getOptionGroupChildren(group);
|
|
934
940
|
var filteredItems = groupChildren.filter(function (item) {
|
|
935
941
|
return filteredOptions.includes(item);
|
|
936
942
|
});
|
|
937
|
-
if (filteredItems.length > 0) filtered.push(_objectSpread(_objectSpread({}, group), {}, _defineProperty({}, typeof
|
|
943
|
+
if (filteredItems.length > 0) filtered.push(_objectSpread(_objectSpread({}, group), {}, _defineProperty({}, typeof _this19.optionGroupChildren === 'string' ? _this19.optionGroupChildren : 'items', _toConsumableArray(filteredItems))));
|
|
938
944
|
});
|
|
939
945
|
return this.flatOptions(filtered);
|
|
940
946
|
}
|
|
@@ -985,9 +991,9 @@ var script = {
|
|
|
985
991
|
return this.focusedOptionIndex !== -1 ? "".concat(this.$id, "_").concat(this.focusedOptionIndex) : null;
|
|
986
992
|
},
|
|
987
993
|
ariaSetSize: function ariaSetSize() {
|
|
988
|
-
var
|
|
994
|
+
var _this20 = this;
|
|
989
995
|
return this.visibleOptions.filter(function (option) {
|
|
990
|
-
return !
|
|
996
|
+
return !_this20.isOptionGroup(option);
|
|
991
997
|
}).length;
|
|
992
998
|
},
|
|
993
999
|
isClearIconVisible: function isClearIconVisible() {
|
|
@@ -995,6 +1001,29 @@ var script = {
|
|
|
995
1001
|
},
|
|
996
1002
|
virtualScrollerDisabled: function virtualScrollerDisabled() {
|
|
997
1003
|
return !this.virtualScrollerOptions;
|
|
1004
|
+
},
|
|
1005
|
+
containerDataP: function containerDataP() {
|
|
1006
|
+
return cn(_defineProperty({
|
|
1007
|
+
invalid: this.$invalid,
|
|
1008
|
+
disabled: this.disabled,
|
|
1009
|
+
focus: this.focused,
|
|
1010
|
+
fluid: this.$fluid,
|
|
1011
|
+
filled: this.$variant === 'filled'
|
|
1012
|
+
}, this.size, this.size));
|
|
1013
|
+
},
|
|
1014
|
+
labelDataP: function labelDataP() {
|
|
1015
|
+
return cn(_defineProperty(_defineProperty({
|
|
1016
|
+
placeholder: !this.editable && this.label === this.placeholder,
|
|
1017
|
+
clearable: this.showClear,
|
|
1018
|
+
disabled: this.disabled,
|
|
1019
|
+
editable: this.editable
|
|
1020
|
+
}, this.size, this.size), "empty", !this.editable && !this.$slots['value'] && (this.label === 'p-emptylabel' || this.label.length === 0)));
|
|
1021
|
+
},
|
|
1022
|
+
dropdownIconDataP: function dropdownIconDataP() {
|
|
1023
|
+
return cn(_defineProperty({}, this.size, this.size));
|
|
1024
|
+
},
|
|
1025
|
+
overlayDataP: function overlayDataP() {
|
|
1026
|
+
return cn(_defineProperty({}, 'portal-' + this.appendTo, 'portal-' + this.appendTo));
|
|
998
1027
|
}
|
|
999
1028
|
},
|
|
1000
1029
|
directives: {
|
|
@@ -1015,12 +1044,13 @@ var script = {
|
|
|
1015
1044
|
}
|
|
1016
1045
|
};
|
|
1017
1046
|
|
|
1018
|
-
var _hoisted_1 = ["id"];
|
|
1019
|
-
var _hoisted_2 = ["id", "value", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"];
|
|
1020
|
-
var _hoisted_3 = ["id", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid", "aria-disabled"];
|
|
1021
|
-
var _hoisted_4 = ["
|
|
1047
|
+
var _hoisted_1 = ["id", "data-p"];
|
|
1048
|
+
var _hoisted_2 = ["name", "id", "value", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid", "data-p"];
|
|
1049
|
+
var _hoisted_3 = ["name", "id", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid", "aria-disabled", "data-p"];
|
|
1050
|
+
var _hoisted_4 = ["data-p"];
|
|
1022
1051
|
var _hoisted_5 = ["id"];
|
|
1023
|
-
var _hoisted_6 = ["id"
|
|
1052
|
+
var _hoisted_6 = ["id"];
|
|
1053
|
+
var _hoisted_7 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onMousedown", "onMousemove", "data-p-selected", "data-p-focused", "data-p-disabled"];
|
|
1024
1054
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1025
1055
|
var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
|
|
1026
1056
|
var _component_InputText = resolveComponent("InputText");
|
|
@@ -1038,10 +1068,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1038
1068
|
"class": _ctx.cx('root'),
|
|
1039
1069
|
onClick: _cache[11] || (_cache[11] = function () {
|
|
1040
1070
|
return $options.onContainerClick && $options.onContainerClick.apply($options, arguments);
|
|
1041
|
-
})
|
|
1071
|
+
}),
|
|
1072
|
+
"data-p": $options.containerDataP
|
|
1042
1073
|
}, _ctx.ptmi('root')), [_ctx.editable ? (openBlock(), createElementBlock("input", mergeProps({
|
|
1043
1074
|
key: 0,
|
|
1044
1075
|
ref: "focusInput",
|
|
1076
|
+
name: _ctx.name,
|
|
1045
1077
|
id: _ctx.labelId || _ctx.inputId,
|
|
1046
1078
|
type: "text",
|
|
1047
1079
|
"class": [_ctx.cx('label'), _ctx.inputClass, _ctx.labelClass],
|
|
@@ -1070,10 +1102,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1070
1102
|
}),
|
|
1071
1103
|
onInput: _cache[3] || (_cache[3] = function () {
|
|
1072
1104
|
return $options.onEditableInput && $options.onEditableInput.apply($options, arguments);
|
|
1073
|
-
})
|
|
1105
|
+
}),
|
|
1106
|
+
"data-p": $options.labelDataP
|
|
1074
1107
|
}, _ctx.ptm('label')), null, 16, _hoisted_2)) : (openBlock(), createElementBlock("span", mergeProps({
|
|
1075
1108
|
key: 1,
|
|
1076
1109
|
ref: "focusInput",
|
|
1110
|
+
name: _ctx.name,
|
|
1077
1111
|
id: _ctx.labelId || _ctx.inputId,
|
|
1078
1112
|
"class": [_ctx.cx('label'), _ctx.inputClass, _ctx.labelClass],
|
|
1079
1113
|
style: [_ctx.inputStyle, _ctx.labelStyle],
|
|
@@ -1095,7 +1129,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1095
1129
|
}),
|
|
1096
1130
|
onKeydown: _cache[6] || (_cache[6] = function () {
|
|
1097
1131
|
return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
|
|
1098
|
-
})
|
|
1132
|
+
}),
|
|
1133
|
+
"data-p": $options.labelDataP
|
|
1099
1134
|
}, _ctx.ptm('label')), [renderSlot(_ctx.$slots, "value", {
|
|
1100
1135
|
value: _ctx.d_value,
|
|
1101
1136
|
placeholder: _ctx.placeholder
|
|
@@ -1136,8 +1171,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1136
1171
|
}, function () {
|
|
1137
1172
|
return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.dropdownIcon ? 'span' : 'ChevronDownIcon'), mergeProps({
|
|
1138
1173
|
"class": [_ctx.cx('dropdownIcon'), _ctx.dropdownIcon],
|
|
1139
|
-
"aria-hidden": "true"
|
|
1140
|
-
|
|
1174
|
+
"aria-hidden": "true",
|
|
1175
|
+
"data-p": $options.dropdownIconDataP
|
|
1176
|
+
}, _ctx.ptm('dropdownIcon')), null, 16, ["class", "data-p"]))];
|
|
1141
1177
|
})], 16), createVNode(_component_Portal, {
|
|
1142
1178
|
appendTo: _ctx.appendTo
|
|
1143
1179
|
}, {
|
|
@@ -1160,7 +1196,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1160
1196
|
}),
|
|
1161
1197
|
onKeydown: _cache[10] || (_cache[10] = function () {
|
|
1162
1198
|
return $options.onOverlayKeyDown && $options.onOverlayKeyDown.apply($options, arguments);
|
|
1163
|
-
})
|
|
1199
|
+
}),
|
|
1200
|
+
"data-p": $options.overlayDataP
|
|
1164
1201
|
}, _ctx.ptm('overlay')), [createElementVNode("span", mergeProps({
|
|
1165
1202
|
ref: "firstHiddenFocusableElementOnOverlay",
|
|
1166
1203
|
role: "presentation",
|
|
@@ -1280,7 +1317,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1280
1317
|
"class": _ctx.cx('optionGroupLabel'),
|
|
1281
1318
|
ref_for: true
|
|
1282
1319
|
}, _ctx.ptm('optionGroupLabel')), toDisplayString($options.getOptionGroupLabel(option.optionGroup)), 17)];
|
|
1283
|
-
})], 16,
|
|
1320
|
+
})], 16, _hoisted_6)) : withDirectives((openBlock(), createElementBlock("li", mergeProps({
|
|
1284
1321
|
key: 1,
|
|
1285
1322
|
id: _ctx.$id + '_' + $options.getOptionIndex(i, getItemOptions),
|
|
1286
1323
|
"class": _ctx.cx('option', {
|
|
@@ -1296,13 +1333,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1296
1333
|
"aria-disabled": $options.isOptionDisabled(option),
|
|
1297
1334
|
"aria-setsize": $options.ariaSetSize,
|
|
1298
1335
|
"aria-posinset": $options.getAriaPosInset($options.getOptionIndex(i, getItemOptions)),
|
|
1299
|
-
|
|
1336
|
+
onMousedown: function onMousedown($event) {
|
|
1300
1337
|
return $options.onOptionSelect($event, option);
|
|
1301
1338
|
},
|
|
1302
1339
|
onMousemove: function onMousemove($event) {
|
|
1303
1340
|
return $options.onOptionMouseMove($event, $options.getOptionIndex(i, getItemOptions));
|
|
1304
1341
|
},
|
|
1305
|
-
"data-p-selected": $options.isSelected(option),
|
|
1342
|
+
"data-p-selected": !_ctx.checkmark && $options.isSelected(option),
|
|
1306
1343
|
"data-p-focused": $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions),
|
|
1307
1344
|
"data-p-disabled": $options.isOptionDisabled(option),
|
|
1308
1345
|
ref_for: true
|
|
@@ -1325,7 +1362,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1325
1362
|
"class": _ctx.cx('optionLabel'),
|
|
1326
1363
|
ref_for: true
|
|
1327
1364
|
}, _ctx.ptm('optionLabel')), toDisplayString($options.getOptionLabel(option)), 17)];
|
|
1328
|
-
})], 16,
|
|
1365
|
+
})], 16, _hoisted_7)), [[_directive_ripple]])], 64);
|
|
1329
1366
|
}), 128)), $data.filterValue && (!items || items && items.length === 0) ? (openBlock(), createElementBlock("li", mergeProps({
|
|
1330
1367
|
key: 0,
|
|
1331
1368
|
"class": _ctx.cx('emptyMessage'),
|
|
@@ -1342,7 +1379,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1342
1379
|
"data-p-hidden-accessible": true
|
|
1343
1380
|
}), [renderSlot(_ctx.$slots, "empty", {}, function () {
|
|
1344
1381
|
return [createTextVNode(toDisplayString($options.emptyMessageText), 1)];
|
|
1345
|
-
})], 16)) : createCommentVNode("", true)], 16,
|
|
1382
|
+
})], 16)) : createCommentVNode("", true)], 16, _hoisted_5)];
|
|
1346
1383
|
}),
|
|
1347
1384
|
_: 2
|
|
1348
1385
|
}, [_ctx.$slots.loader ? {
|
|
@@ -1382,7 +1419,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1382
1419
|
}, _ctx.ptm('hiddenLastFocusableEl'), {
|
|
1383
1420
|
"data-p-hidden-accessible": true,
|
|
1384
1421
|
"data-p-hidden-focusable": true
|
|
1385
|
-
}), null, 16)], 16)) : createCommentVNode("", true)];
|
|
1422
|
+
}), null, 16)], 16, _hoisted_4)) : createCommentVNode("", true)];
|
|
1386
1423
|
}),
|
|
1387
1424
|
_: 3
|
|
1388
1425
|
}, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])];
|