primevue 3.9.1 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +256 -2
- package/accordion/Accordion.d.ts +74 -11
- package/accordion/accordion.esm.js +1 -1
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +1 -1
- package/accordiontab/AccordionTab.d.ts +37 -8
- package/accordiontab/accordiontab.esm.js +1 -1
- package/accordiontab/accordiontab.esm.min.js +1 -1
- package/accordiontab/accordiontab.js +1 -1
- package/api/Api.d.ts +292 -285
- package/api/api.js +1 -1
- package/autocomplete/AutoComplete.d.ts +280 -63
- package/autocomplete/AutoComplete.vue +2 -2
- package/autocomplete/autocomplete.cjs.js +7 -6
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +4 -3
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +8 -7
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +57 -8
- package/avatar/avatar.esm.js +1 -1
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +1 -1
- package/avatargroup/AvatarGroup.d.ts +29 -3
- package/avatargroup/avatargroup.esm.js +1 -1
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +1 -1
- package/badge/Badge.d.ts +46 -5
- package/badge/badge.esm.js +1 -1
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +1 -1
- package/badgedirective/badgedirective.esm.js +1 -1
- package/badgedirective/badgedirective.esm.min.js +1 -1
- package/badgedirective/badgedirective.js +1 -1
- package/blockui/BlockUI.d.ts +52 -11
- package/blockui/blockui.esm.js +1 -1
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +1 -1
- package/breadcrumb/Breadcrumb.d.ts +49 -9
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +1 -1
- package/button/Button.d.ts +68 -11
- package/button/button.cjs.js +1 -1
- package/button/button.esm.js +1 -1
- package/button/button.esm.min.js +1 -1
- package/button/button.js +2 -2
- package/calendar/Calendar.d.ts +333 -62
- package/calendar/Calendar.vue +67 -35
- package/calendar/calendar.cjs.js +141 -110
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +139 -107
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +143 -111
- package/calendar/calendar.min.js +1 -1
- package/card/Card.d.ts +43 -9
- package/card/card.esm.js +1 -1
- package/card/card.esm.min.js +1 -1
- package/card/card.js +1 -1
- package/carousel/Carousel.d.ts +121 -24
- package/carousel/carousel.cjs.js +1 -1
- package/carousel/carousel.esm.js +1 -1
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +2 -2
- package/cascadeselect/CascadeSelect.d.ts +164 -31
- package/cascadeselect/cascadeselect.cjs.js +2 -2
- package/cascadeselect/cascadeselect.esm.js +1 -1
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +3 -3
- package/chart/Chart.d.ts +104 -12
- package/chart/Chart.vue +9 -2
- package/chart/chart.cjs.js +11 -6
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +10 -3
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +10 -3
- package/chart/chart.min.js +1 -1
- package/checkbox/Checkbox.d.ts +66 -8
- package/checkbox/checkbox.esm.js +1 -1
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +1 -1
- package/chip/Chip.d.ts +50 -4
- package/chip/chip.esm.js +1 -1
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +1 -1
- package/chips/Chips.d.ts +88 -15
- package/chips/chips.esm.js +1 -1
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +1 -1
- package/colorpicker/ColorPicker.d.ts +105 -16
- package/colorpicker/colorpicker.cjs.js +1 -1
- package/colorpicker/colorpicker.esm.js +1 -1
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +2 -2
- package/column/Column.d.ts +452 -78
- package/column/Column.vue +6 -2
- package/column/column.cjs.js +6 -2
- package/column/column.cjs.min.js +1 -1
- package/column/column.esm.js +7 -3
- package/column/column.esm.min.js +1 -1
- package/column/column.js +7 -3
- package/column/column.min.js +1 -1
- package/columngroup/ColumnGroup.d.ts +30 -4
- package/columngroup/columngroup.esm.js +1 -1
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +1 -1
- package/config/config.cjs.js +1 -1
- package/config/config.esm.js +1 -2
- package/config/config.esm.min.js +1 -1
- package/config/config.js +2 -2
- package/confirmationeventbus/confirmationeventbus.esm.js +1 -1
- package/confirmationeventbus/confirmationeventbus.esm.min.js +1 -1
- package/confirmationeventbus/confirmationeventbus.js +1 -1
- package/confirmationoptions/ConfirmationOptions.d.ts +62 -0
- package/confirmationoptions/package.json +3 -0
- package/confirmationservice/ConfirmationService.d.ts +2 -1
- package/confirmationservice/confirmationservice.cjs.js +2 -2
- package/confirmationservice/confirmationservice.esm.js +1 -1
- package/confirmationservice/confirmationservice.esm.min.js +1 -1
- package/confirmationservice/confirmationservice.js +3 -3
- package/confirmdialog/ConfirmDialog.d.ts +57 -5
- package/confirmdialog/confirmdialog.cjs.js +6 -6
- package/confirmdialog/confirmdialog.esm.js +1 -1
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +7 -7
- package/confirmpopup/ConfirmPopup.d.ts +38 -7
- package/confirmpopup/confirmpopup.cjs.js +6 -6
- package/confirmpopup/confirmpopup.esm.js +1 -1
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +7 -7
- package/contextmenu/ContextMenu.d.ts +88 -16
- package/contextmenu/contextmenu.cjs.js +1 -1
- package/contextmenu/contextmenu.esm.js +1 -1
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +2 -2
- package/core/core.js +754 -327
- package/core/core.min.js +7 -5
- package/datatable/BodyCell.vue +26 -1
- package/datatable/DataTable.d.ts +1056 -131
- package/datatable/DataTable.vue +124 -118
- package/datatable/HeaderCheckbox.vue +5 -2
- package/datatable/RowCheckbox.vue +1 -1
- package/datatable/RowRadioButton.vue +1 -1
- package/datatable/TableBody.vue +53 -14
- package/datatable/TableFooter.vue +18 -1
- package/datatable/TableHeader.vue +18 -1
- package/datatable/datatable.cjs.js +488 -362
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +478 -353
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +489 -364
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +198 -32
- package/dataview/dataview.cjs.js +1 -1
- package/dataview/dataview.esm.js +1 -1
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +2 -2
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +34 -5
- package/dataviewlayoutoptions/dataviewlayoutoptions.esm.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.esm.min.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.js +1 -1
- package/deferredcontent/DeferredContent.d.ts +31 -6
- package/deferredcontent/deferredcontent.esm.js +1 -1
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +1 -1
- package/dialog/Dialog.d.ts +187 -34
- package/dialog/Dialog.vue +1 -1
- package/dialog/dialog.cjs.js +2 -3
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +2 -3
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +3 -4
- package/dialog/dialog.min.js +1 -1
- package/divider/Divider.d.ts +53 -8
- package/divider/divider.esm.js +1 -1
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +1 -1
- package/dock/Dock.d.ts +92 -15
- package/dock/DockSub.vue +3 -1
- package/dock/dock.cjs.js +4 -1
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +4 -2
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +5 -3
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.d.ts +335 -76
- package/dropdown/Dropdown.vue +16 -12
- package/dropdown/dropdown.cjs.js +21 -15
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +19 -13
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +22 -16
- package/dropdown/dropdown.min.js +1 -1
- package/editor/Editor.d.ts +78 -11
- package/editor/editor.cjs.js +1 -1
- package/editor/editor.esm.js +1 -1
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +2 -2
- package/fieldset/Fieldset.d.ts +63 -11
- package/fieldset/fieldset.cjs.js +1 -1
- package/fieldset/fieldset.esm.js +1 -1
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +2 -2
- package/fileupload/FileUpload.d.ts +255 -37
- package/fileupload/fileupload.cjs.js +4 -4
- package/fileupload/fileupload.esm.js +1 -1
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +5 -5
- package/fullcalendar/FullCalendar.d.ts +29 -3
- package/fullcalendar/fullcalendar.esm.js +1 -1
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +1 -1
- package/galleria/Galleria.d.ts +196 -46
- package/galleria/galleria.cjs.js +3 -3
- package/galleria/galleria.esm.js +1 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +4 -4
- package/image/Image.d.ts +51 -6
- package/image/image.esm.js +1 -1
- package/image/image.esm.min.js +1 -1
- package/image/image.js +1 -1
- package/inlinemessage/InlineMessage.d.ts +34 -6
- package/inlinemessage/inlinemessage.esm.js +1 -1
- package/inlinemessage/inlinemessage.esm.min.js +1 -1
- package/inlinemessage/inlinemessage.js +1 -1
- package/inplace/Inplace.d.ts +57 -12
- package/inplace/inplace.cjs.js +1 -1
- package/inplace/inplace.esm.js +1 -1
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +2 -2
- package/inputmask/InputMask.d.ts +75 -15
- package/inputmask/inputmask.esm.js +1 -1
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +1 -1
- package/inputnumber/InputNumber.d.ts +180 -30
- package/inputnumber/inputnumber.cjs.js +2 -2
- package/inputnumber/inputnumber.esm.js +1 -1
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +3 -3
- package/inputswitch/InputSwitch.d.ts +61 -9
- package/inputswitch/inputswitch.esm.js +1 -1
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +1 -1
- package/inputtext/InputText.d.ts +34 -5
- package/inputtext/inputtext.esm.js +1 -1
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +1 -1
- package/knob/Knob.d.ts +92 -18
- package/knob/Knob.vue +1 -1
- package/knob/knob.cjs.js +1 -1
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +2 -2
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +2 -2
- package/knob/knob.min.js +1 -1
- package/listbox/Listbox.d.ts +240 -55
- package/listbox/Listbox.vue +2 -2
- package/listbox/listbox.cjs.js +5 -4
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +4 -3
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +6 -5
- package/listbox/listbox.min.js +1 -1
- package/megamenu/MegaMenu.d.ts +60 -12
- package/megamenu/megamenu.cjs.js +1 -1
- package/megamenu/megamenu.esm.js +1 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +2 -2
- package/menu/Menu.d.ts +84 -15
- package/menu/menu.cjs.js +2 -2
- package/menu/menu.esm.js +1 -1
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +3 -3
- package/menubar/Menubar.d.ts +52 -11
- package/menubar/menubar.cjs.js +1 -1
- package/menubar/menubar.esm.js +1 -1
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +2 -2
- package/menuitem/MenuItem.d.ts +82 -0
- package/menuitem/package.json +3 -0
- package/message/Message.d.ts +57 -11
- package/message/message.cjs.js +1 -1
- package/message/message.esm.js +1 -1
- package/message/message.esm.min.js +1 -1
- package/message/message.js +2 -2
- package/multiselect/MultiSelect.d.ts +363 -83
- package/multiselect/MultiSelect.vue +17 -13
- package/multiselect/multiselect.cjs.js +20 -13
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +18 -11
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +21 -14
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/OrderList.d.ts +126 -19
- package/orderlist/OrderList.vue +10 -1
- package/orderlist/orderlist.cjs.js +19 -11
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +18 -10
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +20 -12
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/OrganizationChart.d.ts +137 -15
- package/organizationchart/organizationchart.esm.js +1 -1
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +1 -1
- package/overlayeventbus/overlayeventbus.esm.js +1 -1
- package/overlayeventbus/overlayeventbus.esm.min.js +1 -1
- package/overlayeventbus/overlayeventbus.js +1 -1
- package/overlaypanel/OverlayPanel.d.ts +107 -12
- package/overlaypanel/overlaypanel.cjs.js +5 -5
- package/overlaypanel/overlaypanel.esm.js +1 -1
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +6 -6
- package/package.json +1 -1
- package/paginator/Paginator.d.ts +129 -27
- package/paginator/paginator.cjs.js +8 -8
- package/paginator/paginator.esm.js +1 -1
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +9 -9
- package/panel/Panel.d.ts +64 -9
- package/panel/panel.cjs.js +1 -1
- package/panel/panel.esm.js +1 -1
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +2 -2
- package/panelmenu/PanelMenu.d.ts +59 -11
- package/panelmenu/PanelMenu.vue +2 -2
- package/panelmenu/panelmenu.cjs.js +4 -4
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +5 -5
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +5 -5
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/Password.d.ts +115 -24
- package/password/password.cjs.js +2 -2
- package/password/password.esm.js +1 -1
- package/password/password.esm.min.js +1 -1
- package/password/password.js +3 -3
- package/picklist/PickList.d.ts +203 -32
- package/picklist/PickList.vue +10 -1
- package/picklist/picklist.cjs.js +27 -19
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +26 -18
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +28 -20
- package/picklist/picklist.min.js +1 -1
- package/progressbar/ProgressBar.d.ts +43 -8
- package/progressbar/progressbar.esm.js +1 -1
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +1 -1
- package/progressspinner/ProgressSpinner.d.ts +39 -6
- package/progressspinner/progressspinner.esm.js +1 -1
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +1 -1
- package/radiobutton/RadioButton.d.ts +52 -7
- package/radiobutton/radiobutton.esm.js +1 -1
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +1 -1
- package/rating/Rating.d.ts +67 -10
- package/rating/rating.esm.js +1 -1
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +1 -1
- package/resources/themes/arya-blue/theme.css +41 -22
- package/resources/themes/arya-green/theme.css +41 -22
- package/resources/themes/arya-orange/theme.css +41 -22
- package/resources/themes/arya-purple/theme.css +41 -22
- package/resources/themes/bootstrap4-dark-blue/theme.css +29 -6
- package/resources/themes/bootstrap4-dark-purple/theme.css +29 -6
- package/resources/themes/bootstrap4-light-blue/theme.css +29 -6
- package/resources/themes/bootstrap4-light-purple/theme.css +29 -6
- package/resources/themes/fluent-light/theme.css +41 -22
- package/resources/themes/lara-dark-blue/theme.css +371 -361
- package/resources/themes/lara-dark-indigo/theme.css +371 -361
- package/resources/themes/lara-dark-purple/theme.css +371 -361
- package/resources/themes/lara-dark-teal/theme.css +371 -361
- package/resources/themes/lara-light-blue/theme.css +41 -31
- package/resources/themes/lara-light-indigo/theme.css +41 -31
- package/resources/themes/lara-light-purple/theme.css +41 -31
- package/resources/themes/lara-light-teal/theme.css +41 -31
- package/resources/themes/luna-amber/theme.css +41 -22
- package/resources/themes/luna-blue/theme.css +41 -22
- package/resources/themes/luna-green/theme.css +41 -22
- package/resources/themes/luna-pink/theme.css +41 -22
- package/resources/themes/md-dark-deeppurple/theme.css +24 -5
- package/resources/themes/md-dark-indigo/theme.css +24 -5
- package/resources/themes/md-light-deeppurple/theme.css +24 -5
- package/resources/themes/md-light-indigo/theme.css +24 -5
- package/resources/themes/mdc-dark-deeppurple/theme.css +24 -5
- package/resources/themes/mdc-dark-indigo/theme.css +24 -5
- package/resources/themes/mdc-light-deeppurple/theme.css +24 -5
- package/resources/themes/mdc-light-indigo/theme.css +24 -5
- package/resources/themes/nova/theme.css +41 -22
- package/resources/themes/nova-accent/theme.css +41 -22
- package/resources/themes/nova-alt/theme.css +41 -22
- package/resources/themes/nova-vue/theme.css +41 -22
- package/resources/themes/rhea/theme.css +41 -22
- package/resources/themes/saga-blue/theme.css +25 -6
- package/resources/themes/saga-green/theme.css +25 -6
- package/resources/themes/saga-orange/theme.css +25 -6
- package/resources/themes/saga-purple/theme.css +25 -6
- package/resources/themes/tailwind-light/theme.css +44 -25
- package/resources/themes/vela-blue/theme.css +41 -22
- package/resources/themes/vela-green/theme.css +41 -22
- package/resources/themes/vela-orange/theme.css +41 -22
- package/resources/themes/vela-purple/theme.css +41 -22
- package/ripple/ripple.esm.js +1 -1
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +1 -1
- package/row/Row.d.ts +25 -3
- package/row/row.esm.js +1 -1
- package/row/row.esm.min.js +1 -1
- package/row/row.js +1 -1
- package/scrollpanel/ScrollPanel.d.ts +27 -5
- package/scrollpanel/scrollpanel.esm.js +1 -1
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +1 -1
- package/scrolltop/ScrollTop.d.ts +47 -7
- package/scrolltop/scrolltop.esm.js +1 -1
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +1 -1
- package/selectbutton/SelectButton.d.ts +101 -17
- package/selectbutton/selectbutton.cjs.js +1 -1
- package/selectbutton/selectbutton.esm.js +1 -1
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +2 -2
- package/sidebar/Sidebar.d.ts +81 -16
- package/sidebar/Sidebar.vue +2 -0
- package/sidebar/sidebar.cjs.js +2 -2
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +2 -2
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +3 -3
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/Skeleton.d.ts +58 -9
- package/skeleton/skeleton.esm.js +1 -1
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +1 -1
- package/slider/Slider.d.ts +90 -14
- package/slider/slider.esm.js +1 -1
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +1 -1
- package/speeddial/SpeedDial.d.ts +166 -29
- package/speeddial/SpeedDial.vue +3 -1
- package/speeddial/speeddial.cjs.js +5 -2
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +4 -2
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +6 -4
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +76 -11
- package/splitbutton/SplitButton.vue +3 -1
- package/splitbutton/splitbutton.cjs.js +15 -13
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +15 -13
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +16 -14
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/Splitter.d.ts +74 -7
- package/splitter/Splitter.vue +5 -5
- package/splitter/splitter.cjs.js +1 -1
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +2 -2
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +2 -2
- package/splitter/splitter.min.js +1 -1
- package/splitterpanel/SplitterPanel.d.ts +34 -7
- package/splitterpanel/splitterpanel.esm.js +1 -1
- package/splitterpanel/splitterpanel.esm.min.js +1 -1
- package/splitterpanel/splitterpanel.js +1 -1
- package/steps/Steps.d.ts +51 -11
- package/steps/steps.esm.js +1 -1
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +1 -1
- package/styleclass/styleclass.esm.js +1 -1
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +1 -1
- package/tabmenu/TabMenu.d.ts +63 -10
- package/tabmenu/tabmenu.cjs.js +1 -1
- package/tabmenu/tabmenu.esm.js +1 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +2 -2
- package/tabpanel/TabPanel.d.ts +38 -7
- package/tabpanel/tabpanel.esm.js +1 -1
- package/tabpanel/tabpanel.esm.min.js +1 -1
- package/tabpanel/tabpanel.js +1 -1
- package/tabview/TabView.d.ts +73 -11
- package/tabview/TabView.vue +1 -1
- package/tabview/tabview.cjs.js +2 -2
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +2 -2
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +3 -3
- package/tabview/tabview.min.js +1 -1
- package/tag/Tag.d.ts +44 -8
- package/tag/Tag.vue +1 -1
- package/tag/tag.cjs.js +6 -6
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.esm.js +8 -8
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +7 -7
- package/tag/tag.min.js +1 -1
- package/terminal/Terminal.d.ts +36 -5
- package/terminal/terminal.cjs.js +3 -3
- package/terminal/terminal.esm.js +1 -1
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +4 -4
- package/terminalservice/TerminalService.d.ts +1 -1
- package/terminalservice/terminalservice.esm.js +1 -1
- package/terminalservice/terminalservice.esm.min.js +1 -1
- package/terminalservice/terminalservice.js +1 -1
- package/textarea/Textarea.d.ts +38 -6
- package/textarea/textarea.esm.js +1 -1
- package/textarea/textarea.esm.min.js +1 -1
- package/textarea/textarea.js +1 -1
- package/tieredmenu/TieredMenu.d.ts +89 -15
- package/tieredmenu/tieredmenu.cjs.js +2 -2
- package/tieredmenu/tieredmenu.esm.js +1 -1
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +3 -3
- package/timeline/Timeline.d.ts +94 -15
- package/timeline/timeline.esm.js +1 -1
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +1 -1
- package/toast/Toast.d.ts +118 -12
- package/toast/toast.cjs.js +7 -7
- package/toast/toast.esm.js +1 -1
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +8 -8
- package/toasteventbus/toasteventbus.esm.js +1 -1
- package/toasteventbus/toasteventbus.esm.min.js +1 -1
- package/toasteventbus/toasteventbus.js +1 -1
- package/toastservice/ToastService.d.ts +17 -5
- package/toastservice/toastservice.cjs.js +3 -3
- package/toastservice/toastservice.esm.js +1 -1
- package/toastservice/toastservice.esm.min.js +1 -1
- package/toastservice/toastservice.js +4 -4
- package/togglebutton/ToggleButton.d.ts +64 -11
- package/togglebutton/togglebutton.cjs.js +1 -1
- package/togglebutton/togglebutton.esm.js +1 -1
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -2
- package/toolbar/Toolbar.d.ts +31 -6
- package/toolbar/toolbar.esm.js +1 -1
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +1 -1
- package/tooltip/tooltip.esm.js +1 -1
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +1 -1
- package/tree/Tree.d.ts +189 -26
- package/tree/Tree.vue +1 -0
- package/tree/tree.cjs.js +2 -2
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +2 -2
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +3 -3
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +201 -44
- package/treeselect/treeselect.cjs.js +3 -3
- package/treeselect/treeselect.esm.js +1 -1
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +4 -4
- package/treetable/BodyCell.vue +5 -5
- package/treetable/FooterCell.vue +3 -3
- package/treetable/HeaderCell.vue +2 -2
- package/treetable/TreeTable.d.ts +459 -63
- package/treetable/TreeTable.vue +6 -2
- package/treetable/treetable.cjs.js +13 -13
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +12 -12
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +14 -14
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.d.ts +40 -6
- package/tristatecheckbox/tristatecheckbox.esm.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +1 -1
- package/ts-helpers.d.ts +28 -0
- package/useconfirm/UseConfirm.d.ts +5 -19
- package/useconfirm/useconfirm.js +1 -1
- package/usetoast/UseToast.d.ts +3 -5
- package/usetoast/usetoast.js +1 -1
- package/utils/Utils.d.ts +3 -0
- package/utils/utils.cjs.js +41 -4
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +41 -4
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +42 -5
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +70 -30
- package/vetur-tags.json +18 -8
- package/virtualscroller/VirtualScroller.d.ts +294 -53
- package/virtualscroller/VirtualScroller.vue +304 -253
- package/virtualscroller/virtualscroller.cjs.js +333 -264
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +334 -265
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +334 -265
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +229 -45
|
@@ -317,6 +317,17 @@ var script = {
|
|
|
317
317
|
onOverlayEnter(el) {
|
|
318
318
|
utils.ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
319
319
|
this.alignOverlay();
|
|
320
|
+
|
|
321
|
+
if (!this.virtualScrollerDisabled) {
|
|
322
|
+
const selectedIndex = this.getSelectedOptionIndex();
|
|
323
|
+
if (selectedIndex !== -1) {
|
|
324
|
+
setTimeout(() => {
|
|
325
|
+
this.virtualScroller && this.virtualScroller.scrollToIndex(selectedIndex);
|
|
326
|
+
}, 0);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
onOverlayAfterEnter() {
|
|
320
331
|
this.bindOutsideClickListener();
|
|
321
332
|
this.bindScrollListener();
|
|
322
333
|
this.bindResizeListener();
|
|
@@ -325,13 +336,6 @@ var script = {
|
|
|
325
336
|
this.$refs.filterInput.focus();
|
|
326
337
|
}
|
|
327
338
|
|
|
328
|
-
if (!this.virtualScrollerDisabled) {
|
|
329
|
-
const selectedIndex = this.getSelectedOptionIndex();
|
|
330
|
-
if (selectedIndex !== -1) {
|
|
331
|
-
this.virtualScroller.scrollToIndex(selectedIndex);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
339
|
this.$emit('show');
|
|
336
340
|
},
|
|
337
341
|
onOverlayLeave() {
|
|
@@ -484,7 +488,7 @@ var script = {
|
|
|
484
488
|
this.$emit('change', {originalEvent: event, value: value});
|
|
485
489
|
},
|
|
486
490
|
onOverlayClick(event) {
|
|
487
|
-
OverlayEventBus__default[
|
|
491
|
+
OverlayEventBus__default["default"].emit('overlay-click', {
|
|
488
492
|
originalEvent: event,
|
|
489
493
|
target: this.$el
|
|
490
494
|
});
|
|
@@ -629,10 +633,10 @@ var script = {
|
|
|
629
633
|
}
|
|
630
634
|
},
|
|
631
635
|
directives: {
|
|
632
|
-
'ripple': Ripple__default[
|
|
636
|
+
'ripple': Ripple__default["default"]
|
|
633
637
|
},
|
|
634
638
|
components: {
|
|
635
|
-
'VirtualScroller': VirtualScroller__default[
|
|
639
|
+
'VirtualScroller': VirtualScroller__default["default"]
|
|
636
640
|
}
|
|
637
641
|
};
|
|
638
642
|
|
|
@@ -740,6 +744,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
740
744
|
vue.createVNode(vue.Transition, {
|
|
741
745
|
name: "p-connected-overlay",
|
|
742
746
|
onEnter: $options.onOverlayEnter,
|
|
747
|
+
onAfterEnter: $options.onOverlayAfterEnter,
|
|
743
748
|
onLeave: $options.onOverlayLeave,
|
|
744
749
|
onAfterLeave: $options.onOverlayAfterLeave
|
|
745
750
|
}, {
|
|
@@ -790,6 +795,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
790
795
|
type: "text",
|
|
791
796
|
ref: "filterInput",
|
|
792
797
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = $event => ($data.filterValue = $event)),
|
|
798
|
+
autoComplete: "on",
|
|
793
799
|
class: "p-multiselect-filter p-inputtext p-component",
|
|
794
800
|
placeholder: $props.filterPlaceholder,
|
|
795
801
|
onInput: _cache[8] || (_cache[8] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))
|
|
@@ -819,10 +825,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
819
825
|
style: {'height': $props.scrollHeight},
|
|
820
826
|
disabled: $options.virtualScrollerDisabled
|
|
821
827
|
}), vue.createSlots({
|
|
822
|
-
content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions }) => [
|
|
828
|
+
content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle}) => [
|
|
823
829
|
vue.createVNode("ul", {
|
|
824
830
|
ref: contentRef,
|
|
825
831
|
class: ['p-multiselect-items p-component', styleClass],
|
|
832
|
+
style: contentStyle,
|
|
826
833
|
role: "listbox",
|
|
827
834
|
"aria-multiselectable": "true"
|
|
828
835
|
}, [
|
|
@@ -914,7 +921,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
914
921
|
])
|
|
915
922
|
]))
|
|
916
923
|
: vue.createCommentVNode("", true)
|
|
917
|
-
],
|
|
924
|
+
], 6)
|
|
918
925
|
]),
|
|
919
926
|
_: 2
|
|
920
927
|
}, [
|
|
@@ -936,7 +943,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
936
943
|
: vue.createCommentVNode("", true)
|
|
937
944
|
]),
|
|
938
945
|
_: 3
|
|
939
|
-
}, 8, ["onEnter", "onLeave", "onAfterLeave"])
|
|
946
|
+
}, 8, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])
|
|
940
947
|
], 8, ["to", "disabled"]))
|
|
941
948
|
], 2))
|
|
942
949
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),l=require("primevue/api"),i=require("primevue/ripple"),n=require("primevue/virtualscroller"),s=require("vue");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(t),a=o(i),c=o(n),d={name:"MultiSelect",emits:["update:modelValue","before-show","before-hide","change","show","hide","filter","selectall-change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,disabled:Boolean,tabindex:String,inputId:String,dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},ariaLabelledBy:null,appendTo:{type:String,default:"body"},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},display:{type:String,default:"comma"},panelClass:null,selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},virtualScrollerOptions:{type:Object,default:null},selectAll:{type:Boolean,default:null}},data:()=>({focused:!1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}),outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t){return this.dataKey?e.ObjectUtils.resolveFieldData(t,this.dataKey):this.getOptionLabel(t)},getOptionGroupRenderKey(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupLabel(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupChildren)},isOptionDisabled(t){return!(!this.maxSelectionLimitReached||this.isSelected(t))||!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t,this.optionDisabled)},getSelectedOptionIndex(){if(null!=this.modelValue&&this.options){if(!this.optionGroupLabel)return this.findOptionIndexInList(this.modelValue,this.options);for(let e=0;e<this.options.length;e++){let t=this.findOptionIndexInList(this.modelValue,this.getOptionGroupChildren(this.options[e]));if(-1!==t)return{group:e,option:t}}}return-1},findOptionIndexInList(t,l){return t?l.findIndex((l=>t.some((t=>e.ObjectUtils.equals(t,this.getOptionValue(l),this.equalityKey))))):-1},isSelected(t){if(this.modelValue){let l=this.getOptionValue(t),i=this.equalityKey;return this.modelValue.some((t=>e.ObjectUtils.equals(t,l,i)))}return!1},show(){this.$emit("before-show"),this.overlayVisible=!0},hide(){this.$emit("before-hide"),this.overlayVisible=!1},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onClick(t){this.disabled||this.loading||this.overlay&&this.overlay.contains(t.target)||e.DomHandler.hasClass(t.target,"p-multiselect-close")||(e.DomHandler.hasClass(t.target,"p-multiselect-close"),this.overlayVisible?this.hide():this.show(),this.$refs.focusInput.focus())},onCloseClick(){this.hide()},onKeyDown(e){switch(e.which){case 40:this.visibleOptions&&!this.overlayVisible&&e.altKey&&this.show();break;case 32:this.overlayVisible||(this.show(),e.preventDefault());break;case 13:case 27:this.overlayVisible&&(this.hide(),e.preventDefault());break;case 9:this.hide()}},onOptionSelect(t,l){if(this.disabled||this.isOptionDisabled(l))return;let i=null;i=this.isSelected(l)?this.modelValue.filter((t=>!e.ObjectUtils.equals(t,this.getOptionValue(l),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(l)],this.$emit("update:modelValue",i),this.$emit("change",{originalEvent:t,value:i})},onOptionKeyDown(e,t){let l=e.target;switch(e.which){case 40:var i=this.findNextItem(l);i&&i.focus(),e.preventDefault();break;case 38:var n=this.findPrevItem(l);n&&n.focus(),e.preventDefault();break;case 13:this.onOptionSelect(e,t),e.preventDefault()}},findNextItem(t){let l=t.nextElementSibling;return l?e.DomHandler.hasClass(l,"p-disabled")||e.DomHandler.hasClass(l,"p-multiselect-item-group")?this.findNextItem(l):l:null},findPrevItem(t){let l=t.previousElementSibling;return l?e.DomHandler.hasClass(l,"p-disabled")||e.DomHandler.hasClass(l,"p-multiselect-item-group")?this.findPrevItem(l):l:null},onOverlayEnter(t){if(e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.filter&&this.$refs.filterInput.focus(),!this.virtualScrollerDisabled){const e=this.getSelectedOptionIndex();-1!==e&&this.virtualScroller.scrollToIndex(e)}this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(t){e.ZIndexUtils.clear(t)},alignOverlay(){this.appendDisabled?e.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=e.DomHandler.getOuterWidth(this.$el)+"px",e.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!e.DomHandler.isAndroid()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue(e){let t;if(this.options)if(this.optionGroupLabel){for(let l of this.options)if(t=this.findOptionByValue(e,this.getOptionGroupChildren(l)),t)break}else t=this.findOptionByValue(e,this.options);return t?this.getOptionLabel(t):null},findOptionByValue(t,l){for(let i of l){let l=this.getOptionValue(i);if(e.ObjectUtils.equals(l,t,this.equalityKey))return i}return null},getSelectedItemsLabel(){let e=/{(.*?)}/;return e.test(this.selectedItemsLabel)?this.selectedItemsLabel.replace(this.selectedItemsLabel.match(e)[0],this.modelValue.length+""):this.selectedItemsLabel},onToggleAll(e){if(null!==this.selectAll)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{let t=null;this.allSelected?t=[]:this.visibleOptions&&(this.optionGroupLabel?(t=[],this.visibleOptions.forEach((e=>t=[...t,...this.getOptionGroupChildren(e)]))):t=this.visibleOptions.map((e=>this.getOptionValue(e)))),this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})}},onFilterChange(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.overlayVisible&&this.alignOverlay()},overlayRef(e){this.overlay=e},virtualScrollerRef(e){this.virtualScroller=e},removeChip(t){let l=this.modelValue.filter((l=>!e.ObjectUtils.equals(l,t,this.equalityKey)));this.$emit("update:modelValue",l),this.$emit("change",{originalEvent:event,value:l})},onOverlayClick(e){r.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{visibleOptions(){if(this.filterValue){if(this.optionGroupLabel){let e=[];for(let t of this.options){let i=l.FilterService.filter(this.getOptionGroupChildren(t),this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);i&&i.length&&e.push({...t,items:i})}return e}return l.FilterService.filter(this.options,this.searchFields,this.filterValue,"contains",this.filterLocale)}return this.options},containerClass(){return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":"chip"===this.display,"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length,"p-inputwrapper-focus":this.focused||this.overlayVisible}]},labelClass(){return["p-multiselect-label",{"p-placeholder":this.label===this.placeholder,"p-multiselect-label-empty":!(this.placeholder||this.modelValue&&0!==this.modelValue.length)}]},panelStyleClass(){return["p-multiselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},label(){let e;if(this.modelValue&&this.modelValue.length){if(this.maxSelectedLabels&&!(this.modelValue.length<=this.maxSelectedLabels))return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},allSelected(){if(null!==this.selectAll)return this.selectAll;if(this.filterValue&&this.filterValue.trim().length>0){if(0===this.visibleOptions.length)return!1;if(this.optionGroupLabel){for(let e of this.visibleOptions)for(let t of this.getOptionGroupChildren(e))if(!this.isSelected(t))return!1}else for(let e of this.visibleOptions)if(!this.isSelected(e))return!1;return!0}if(this.modelValue&&this.options){let e=0;return this.optionGroupLabel?this.options.forEach((t=>e+=this.getOptionGroupChildren(t).length)):e=this.options.length,e>0&&e===this.modelValue.length}return!1},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptyFilterMessage},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage},appendDisabled(){return"self"===this.appendTo},appendTarget(){return this.appendDisabled?null:this.appendTo},virtualScrollerDisabled(){return!this.virtualScrollerOptions},maxSelectionLimitReached(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},dropdownIconClass(){return["p-multiselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]}},directives:{ripple:a.default},components:{VirtualScroller:c.default}};const p={class:"p-hidden-accessible"},u={class:"p-multiselect-label-container"},h={class:"p-multiselect-token-label"},m={class:"p-multiselect-trigger"},b={key:0,class:"p-multiselect-header"},f={class:"p-hidden-accessible"},y={key:1,class:"p-multiselect-filter-container"},g=s.createVNode("span",{class:"p-multiselect-filter-icon pi pi-search"},null,-1),v=s.createVNode("span",{class:"p-multiselect-close-icon pi pi-times"},null,-1),k={class:"p-checkbox p-component"},x={class:"p-multiselect-item-group"},V={class:"p-checkbox p-component"},O={key:2,class:"p-multiselect-empty-message"},S={key:3,class:"p-multiselect-empty-message"};!function(e,t){void 0===t&&(t={});var l=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===l&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n cursor: pointer;\n}\n.p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-multiselect-token {\n cursor: default;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-multiselect-token-icon {\n cursor: pointer;\n}\n.p-multiselect .p-multiselect-panel {\n min-width: 100%;\n}\n.p-multiselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-multiselect-items-wrapper {\n overflow: auto;\n}\n.p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-multiselect-item {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-multiselect-item-group {\n cursor: auto;\n}\n.p-multiselect-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),d.render=function(e,t,l,i,n,o){const r=s.resolveComponent("VirtualScroller"),a=s.resolveDirective("ripple");return s.openBlock(),s.createBlock("div",{ref:"container",class:o.containerClass,onClick:t[11]||(t[11]=(...e)=>o.onClick&&o.onClick(...e))},[s.createVNode("div",p,[s.createVNode("input",{ref:"focusInput",type:"text",role:"listbox",id:l.inputId,readonly:"",disabled:l.disabled,onFocus:t[1]||(t[1]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),tabindex:l.tabindex,"aria-haspopup":"true","aria-expanded":n.overlayVisible,"aria-labelledby":l.ariaLabelledBy},null,40,["id","disabled","tabindex","aria-expanded","aria-labelledby"])]),s.createVNode("div",u,[s.createVNode("div",{class:o.labelClass},[s.renderSlot(e.$slots,"value",{value:l.modelValue,placeholder:l.placeholder},(()=>["comma"===l.display?(s.openBlock(),s.createBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(o.label||"empty"),1)],64)):"chip"===l.display?(s.openBlock(),s.createBlock(s.Fragment,{key:1},[(s.openBlock(!0),s.createBlock(s.Fragment,null,s.renderList(l.modelValue,(t=>(s.openBlock(),s.createBlock("div",{class:"p-multiselect-token",key:o.getLabelByValue(t)},[s.renderSlot(e.$slots,"chip",{value:t},(()=>[s.createVNode("span",h,s.toDisplayString(o.getLabelByValue(t)),1)])),l.disabled?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock("span",{key:0,class:"p-multiselect-token-icon pi pi-times-circle",onClick:e=>o.removeChip(t)},null,8,["onClick"]))])))),128)),l.modelValue&&0!==l.modelValue.length?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(l.placeholder||"empty"),1)],64))],64)):s.createCommentVNode("",!0)]))],2)]),s.createVNode("div",m,[s.renderSlot(e.$slots,"indicator",{},(()=>[s.createVNode("span",{class:o.dropdownIconClass},null,2)]))]),(s.openBlock(),s.createBlock(s.Teleport,{to:o.appendTarget,disabled:o.appendDisabled},[s.createVNode(s.Transition,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:s.withCtx((()=>[n.overlayVisible?(s.openBlock(),s.createBlock("div",{key:0,ref:o.overlayRef,class:o.panelStyleClass,onClick:t[10]||(t[10]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e))},[s.renderSlot(e.$slots,"header",{value:l.modelValue,options:o.visibleOptions}),l.showToggleAll&&null==l.selectionLimit||l.filter?(s.openBlock(),s.createBlock("div",b,[l.showToggleAll&&null==l.selectionLimit?(s.openBlock(),s.createBlock("div",{key:0,class:"p-checkbox p-component",onClick:t[6]||(t[6]=(...e)=>o.onToggleAll&&o.onToggleAll(...e)),role:"checkbox","aria-checked":o.allSelected},[s.createVNode("div",f,[s.createVNode("input",{type:"checkbox",readonly:"",onFocus:t[4]||(t[4]=(...e)=>o.onHeaderCheckboxFocus&&o.onHeaderCheckboxFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>o.onHeaderCheckboxBlur&&o.onHeaderCheckboxBlur(...e))},null,32)]),s.createVNode("div",{class:["p-checkbox-box",{"p-highlight":o.allSelected,"p-focus":n.headerCheckboxFocused}],role:"checkbox","aria-checked":o.allSelected},[s.createVNode("span",{class:["p-checkbox-icon",{"pi pi-check":o.allSelected}]},null,2)],10,["aria-checked"])],8,["aria-checked"])):s.createCommentVNode("",!0),l.filter?(s.openBlock(),s.createBlock("div",y,[s.withDirectives(s.createVNode("input",{type:"text",ref:"filterInput","onUpdate:modelValue":t[7]||(t[7]=e=>n.filterValue=e),class:"p-multiselect-filter p-inputtext p-component",placeholder:l.filterPlaceholder,onInput:t[8]||(t[8]=(...e)=>o.onFilterChange&&o.onFilterChange(...e))},null,40,["placeholder"]),[[s.vModelText,n.filterValue]]),g])):s.createCommentVNode("",!0),s.withDirectives(s.createVNode("button",{class:"p-multiselect-close p-link",onClick:t[9]||(t[9]=(...e)=>o.onCloseClick&&o.onCloseClick(...e)),type:"button"},[v],512),[[a]])])):s.createCommentVNode("",!0),s.createVNode("div",{class:"p-multiselect-items-wrapper",style:{"max-height":o.virtualScrollerDisabled?l.scrollHeight:""}},[s.createVNode(r,s.mergeProps({ref:o.virtualScrollerRef},l.virtualScrollerOptions,{items:o.visibleOptions,style:{height:l.scrollHeight},disabled:o.virtualScrollerDisabled}),s.createSlots({content:s.withCtx((({styleClass:t,contentRef:i,items:r,getItemOptions:c})=>[s.createVNode("ul",{ref:i,class:["p-multiselect-items p-component",t],role:"listbox","aria-multiselectable":"true"},[l.optionGroupLabel?(s.openBlock(!0),s.createBlock(s.Fragment,{key:1},s.renderList(r,((t,i)=>(s.openBlock(),s.createBlock(s.Fragment,{key:o.getOptionGroupRenderKey(t)},[s.createVNode("li",x,[s.renderSlot(e.$slots,"optiongroup",{option:t,index:o.getOptionIndex(i,c)},(()=>[s.createTextVNode(s.toDisplayString(o.getOptionGroupLabel(t)),1)]))]),(s.openBlock(!0),s.createBlock(s.Fragment,null,s.renderList(o.getOptionGroupChildren(t),((t,i)=>s.withDirectives((s.openBlock(),s.createBlock("li",{class:["p-multiselect-item",{"p-highlight":o.isSelected(t),"p-disabled":o.isOptionDisabled(t)}],role:"option","aria-selected":o.isSelected(t),key:o.getOptionRenderKey(t),onClick:e=>o.onOptionSelect(e,t),onKeydown:e=>o.onOptionKeyDown(e,t),tabindex:l.tabindex||"0","aria-label":o.getOptionLabel(t)},[s.createVNode("div",V,[s.createVNode("div",{class:["p-checkbox-box",{"p-highlight":o.isSelected(t)}]},[s.createVNode("span",{class:["p-checkbox-icon",{"pi pi-check":o.isSelected(t)}]},null,2)],2)]),s.renderSlot(e.$slots,"option",{option:t,index:o.getOptionIndex(i,c)},(()=>[s.createVNode("span",null,s.toDisplayString(o.getOptionLabel(t)),1)]))],42,["aria-selected","onClick","onKeydown","tabindex","aria-label"])),[[a]]))),128))],64)))),128)):(s.openBlock(!0),s.createBlock(s.Fragment,{key:0},s.renderList(r,((t,i)=>s.withDirectives((s.openBlock(),s.createBlock("li",{class:["p-multiselect-item",{"p-highlight":o.isSelected(t),"p-disabled":o.isOptionDisabled(t)}],role:"option","aria-selected":o.isSelected(t),key:o.getOptionRenderKey(t),onClick:e=>o.onOptionSelect(e,t),onKeydown:e=>o.onOptionKeyDown(e,t),tabindex:l.tabindex||"0","aria-label":o.getOptionLabel(t)},[s.createVNode("div",k,[s.createVNode("div",{class:["p-checkbox-box",{"p-highlight":o.isSelected(t)}]},[s.createVNode("span",{class:["p-checkbox-icon",{"pi pi-check":o.isSelected(t)}]},null,2)],2)]),s.renderSlot(e.$slots,"option",{option:t,index:o.getOptionIndex(i,c)},(()=>[s.createVNode("span",null,s.toDisplayString(o.getOptionLabel(t)),1)]))],42,["aria-selected","onClick","onKeydown","tabindex","aria-label"])),[[a]]))),128)),n.filterValue&&(!r||r&&0===r.length)?(s.openBlock(),s.createBlock("li",O,[s.renderSlot(e.$slots,"emptyfilter",{},(()=>[s.createTextVNode(s.toDisplayString(o.emptyFilterMessageText),1)]))])):!l.options||l.options&&0===l.options.length?(s.openBlock(),s.createBlock("li",S,[s.renderSlot(e.$slots,"empty",{},(()=>[s.createTextVNode(s.toDisplayString(o.emptyMessageText),1)]))])):s.createCommentVNode("",!0)],2)])),_:2},[e.$slots.loader?{name:"loader",fn:s.withCtx((({options:t})=>[s.renderSlot(e.$slots,"loader",{options:t})]))}:void 0]),1040,["items","style","disabled"])],4),s.renderSlot(e.$slots,"footer",{value:l.modelValue,options:o.visibleOptions})],2)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],2)},module.exports=d;
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),l=require("primevue/api"),i=require("primevue/ripple"),n=require("primevue/virtualscroller"),s=require("vue");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(t),a=o(i),c=o(n),d={name:"MultiSelect",emits:["update:modelValue","before-show","before-hide","change","show","hide","filter","selectall-change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,disabled:Boolean,tabindex:String,inputId:String,dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},ariaLabelledBy:null,appendTo:{type:String,default:"body"},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},display:{type:String,default:"comma"},panelClass:null,selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},virtualScrollerOptions:{type:Object,default:null},selectAll:{type:Boolean,default:null}},data:()=>({focused:!1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}),outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t){return this.dataKey?e.ObjectUtils.resolveFieldData(t,this.dataKey):this.getOptionLabel(t)},getOptionGroupRenderKey(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupLabel(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupChildren)},isOptionDisabled(t){return!(!this.maxSelectionLimitReached||this.isSelected(t))||!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t,this.optionDisabled)},getSelectedOptionIndex(){if(null!=this.modelValue&&this.options){if(!this.optionGroupLabel)return this.findOptionIndexInList(this.modelValue,this.options);for(let e=0;e<this.options.length;e++){let t=this.findOptionIndexInList(this.modelValue,this.getOptionGroupChildren(this.options[e]));if(-1!==t)return{group:e,option:t}}}return-1},findOptionIndexInList(t,l){return t?l.findIndex((l=>t.some((t=>e.ObjectUtils.equals(t,this.getOptionValue(l),this.equalityKey))))):-1},isSelected(t){if(this.modelValue){let l=this.getOptionValue(t),i=this.equalityKey;return this.modelValue.some((t=>e.ObjectUtils.equals(t,l,i)))}return!1},show(){this.$emit("before-show"),this.overlayVisible=!0},hide(){this.$emit("before-hide"),this.overlayVisible=!1},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onClick(t){this.disabled||this.loading||this.overlay&&this.overlay.contains(t.target)||e.DomHandler.hasClass(t.target,"p-multiselect-close")||(e.DomHandler.hasClass(t.target,"p-multiselect-close"),this.overlayVisible?this.hide():this.show(),this.$refs.focusInput.focus())},onCloseClick(){this.hide()},onKeyDown(e){switch(e.which){case 40:this.visibleOptions&&!this.overlayVisible&&e.altKey&&this.show();break;case 32:this.overlayVisible||(this.show(),e.preventDefault());break;case 13:case 27:this.overlayVisible&&(this.hide(),e.preventDefault());break;case 9:this.hide()}},onOptionSelect(t,l){if(this.disabled||this.isOptionDisabled(l))return;let i=null;i=this.isSelected(l)?this.modelValue.filter((t=>!e.ObjectUtils.equals(t,this.getOptionValue(l),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(l)],this.$emit("update:modelValue",i),this.$emit("change",{originalEvent:t,value:i})},onOptionKeyDown(e,t){let l=e.target;switch(e.which){case 40:var i=this.findNextItem(l);i&&i.focus(),e.preventDefault();break;case 38:var n=this.findPrevItem(l);n&&n.focus(),e.preventDefault();break;case 13:this.onOptionSelect(e,t),e.preventDefault()}},findNextItem(t){let l=t.nextElementSibling;return l?e.DomHandler.hasClass(l,"p-disabled")||e.DomHandler.hasClass(l,"p-multiselect-item-group")?this.findNextItem(l):l:null},findPrevItem(t){let l=t.previousElementSibling;return l?e.DomHandler.hasClass(l,"p-disabled")||e.DomHandler.hasClass(l,"p-multiselect-item-group")?this.findPrevItem(l):l:null},onOverlayEnter(t){if(e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),!this.virtualScrollerDisabled){const e=this.getSelectedOptionIndex();-1!==e&&setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(e)}),0)}},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.filter&&this.$refs.filterInput.focus(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(t){e.ZIndexUtils.clear(t)},alignOverlay(){this.appendDisabled?e.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=e.DomHandler.getOuterWidth(this.$el)+"px",e.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!e.DomHandler.isAndroid()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue(e){let t;if(this.options)if(this.optionGroupLabel){for(let l of this.options)if(t=this.findOptionByValue(e,this.getOptionGroupChildren(l)),t)break}else t=this.findOptionByValue(e,this.options);return t?this.getOptionLabel(t):null},findOptionByValue(t,l){for(let i of l){let l=this.getOptionValue(i);if(e.ObjectUtils.equals(l,t,this.equalityKey))return i}return null},getSelectedItemsLabel(){let e=/{(.*?)}/;return e.test(this.selectedItemsLabel)?this.selectedItemsLabel.replace(this.selectedItemsLabel.match(e)[0],this.modelValue.length+""):this.selectedItemsLabel},onToggleAll(e){if(null!==this.selectAll)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{let t=null;this.allSelected?t=[]:this.visibleOptions&&(this.optionGroupLabel?(t=[],this.visibleOptions.forEach((e=>t=[...t,...this.getOptionGroupChildren(e)]))):t=this.visibleOptions.map((e=>this.getOptionValue(e)))),this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})}},onFilterChange(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.overlayVisible&&this.alignOverlay()},overlayRef(e){this.overlay=e},virtualScrollerRef(e){this.virtualScroller=e},removeChip(t){let l=this.modelValue.filter((l=>!e.ObjectUtils.equals(l,t,this.equalityKey)));this.$emit("update:modelValue",l),this.$emit("change",{originalEvent:event,value:l})},onOverlayClick(e){r.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{visibleOptions(){if(this.filterValue){if(this.optionGroupLabel){let e=[];for(let t of this.options){let i=l.FilterService.filter(this.getOptionGroupChildren(t),this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);i&&i.length&&e.push({...t,items:i})}return e}return l.FilterService.filter(this.options,this.searchFields,this.filterValue,"contains",this.filterLocale)}return this.options},containerClass(){return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":"chip"===this.display,"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length,"p-inputwrapper-focus":this.focused||this.overlayVisible}]},labelClass(){return["p-multiselect-label",{"p-placeholder":this.label===this.placeholder,"p-multiselect-label-empty":!(this.placeholder||this.modelValue&&0!==this.modelValue.length)}]},panelStyleClass(){return["p-multiselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},label(){let e;if(this.modelValue&&this.modelValue.length){if(this.maxSelectedLabels&&!(this.modelValue.length<=this.maxSelectedLabels))return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},allSelected(){if(null!==this.selectAll)return this.selectAll;if(this.filterValue&&this.filterValue.trim().length>0){if(0===this.visibleOptions.length)return!1;if(this.optionGroupLabel){for(let e of this.visibleOptions)for(let t of this.getOptionGroupChildren(e))if(!this.isSelected(t))return!1}else for(let e of this.visibleOptions)if(!this.isSelected(e))return!1;return!0}if(this.modelValue&&this.options){let e=0;return this.optionGroupLabel?this.options.forEach((t=>e+=this.getOptionGroupChildren(t).length)):e=this.options.length,e>0&&e===this.modelValue.length}return!1},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptyFilterMessage},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage},appendDisabled(){return"self"===this.appendTo},appendTarget(){return this.appendDisabled?null:this.appendTo},virtualScrollerDisabled(){return!this.virtualScrollerOptions},maxSelectionLimitReached(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},dropdownIconClass(){return["p-multiselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]}},directives:{ripple:a.default},components:{VirtualScroller:c.default}};const p={class:"p-hidden-accessible"},u={class:"p-multiselect-label-container"},h={class:"p-multiselect-token-label"},m={class:"p-multiselect-trigger"},b={key:0,class:"p-multiselect-header"},f={class:"p-hidden-accessible"},y={key:1,class:"p-multiselect-filter-container"},g=s.createVNode("span",{class:"p-multiselect-filter-icon pi pi-search"},null,-1),v=s.createVNode("span",{class:"p-multiselect-close-icon pi pi-times"},null,-1),k={class:"p-checkbox p-component"},x={class:"p-multiselect-item-group"},V={class:"p-checkbox p-component"},O={key:2,class:"p-multiselect-empty-message"},S={key:3,class:"p-multiselect-empty-message"};!function(e,t){void 0===t&&(t={});var l=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===l&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n cursor: pointer;\n}\n.p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-multiselect-token {\n cursor: default;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-multiselect-token-icon {\n cursor: pointer;\n}\n.p-multiselect .p-multiselect-panel {\n min-width: 100%;\n}\n.p-multiselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-multiselect-items-wrapper {\n overflow: auto;\n}\n.p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-multiselect-item {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-multiselect-item-group {\n cursor: auto;\n}\n.p-multiselect-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),d.render=function(e,t,l,i,n,o){const r=s.resolveComponent("VirtualScroller"),a=s.resolveDirective("ripple");return s.openBlock(),s.createBlock("div",{ref:"container",class:o.containerClass,onClick:t[11]||(t[11]=(...e)=>o.onClick&&o.onClick(...e))},[s.createVNode("div",p,[s.createVNode("input",{ref:"focusInput",type:"text",role:"listbox",id:l.inputId,readonly:"",disabled:l.disabled,onFocus:t[1]||(t[1]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),tabindex:l.tabindex,"aria-haspopup":"true","aria-expanded":n.overlayVisible,"aria-labelledby":l.ariaLabelledBy},null,40,["id","disabled","tabindex","aria-expanded","aria-labelledby"])]),s.createVNode("div",u,[s.createVNode("div",{class:o.labelClass},[s.renderSlot(e.$slots,"value",{value:l.modelValue,placeholder:l.placeholder},(()=>["comma"===l.display?(s.openBlock(),s.createBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(o.label||"empty"),1)],64)):"chip"===l.display?(s.openBlock(),s.createBlock(s.Fragment,{key:1},[(s.openBlock(!0),s.createBlock(s.Fragment,null,s.renderList(l.modelValue,(t=>(s.openBlock(),s.createBlock("div",{class:"p-multiselect-token",key:o.getLabelByValue(t)},[s.renderSlot(e.$slots,"chip",{value:t},(()=>[s.createVNode("span",h,s.toDisplayString(o.getLabelByValue(t)),1)])),l.disabled?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock("span",{key:0,class:"p-multiselect-token-icon pi pi-times-circle",onClick:e=>o.removeChip(t)},null,8,["onClick"]))])))),128)),l.modelValue&&0!==l.modelValue.length?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(l.placeholder||"empty"),1)],64))],64)):s.createCommentVNode("",!0)]))],2)]),s.createVNode("div",m,[s.renderSlot(e.$slots,"indicator",{},(()=>[s.createVNode("span",{class:o.dropdownIconClass},null,2)]))]),(s.openBlock(),s.createBlock(s.Teleport,{to:o.appendTarget,disabled:o.appendDisabled},[s.createVNode(s.Transition,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onAfterEnter:o.onOverlayAfterEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:s.withCtx((()=>[n.overlayVisible?(s.openBlock(),s.createBlock("div",{key:0,ref:o.overlayRef,class:o.panelStyleClass,onClick:t[10]||(t[10]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e))},[s.renderSlot(e.$slots,"header",{value:l.modelValue,options:o.visibleOptions}),l.showToggleAll&&null==l.selectionLimit||l.filter?(s.openBlock(),s.createBlock("div",b,[l.showToggleAll&&null==l.selectionLimit?(s.openBlock(),s.createBlock("div",{key:0,class:"p-checkbox p-component",onClick:t[6]||(t[6]=(...e)=>o.onToggleAll&&o.onToggleAll(...e)),role:"checkbox","aria-checked":o.allSelected},[s.createVNode("div",f,[s.createVNode("input",{type:"checkbox",readonly:"",onFocus:t[4]||(t[4]=(...e)=>o.onHeaderCheckboxFocus&&o.onHeaderCheckboxFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>o.onHeaderCheckboxBlur&&o.onHeaderCheckboxBlur(...e))},null,32)]),s.createVNode("div",{class:["p-checkbox-box",{"p-highlight":o.allSelected,"p-focus":n.headerCheckboxFocused}],role:"checkbox","aria-checked":o.allSelected},[s.createVNode("span",{class:["p-checkbox-icon",{"pi pi-check":o.allSelected}]},null,2)],10,["aria-checked"])],8,["aria-checked"])):s.createCommentVNode("",!0),l.filter?(s.openBlock(),s.createBlock("div",y,[s.withDirectives(s.createVNode("input",{type:"text",ref:"filterInput","onUpdate:modelValue":t[7]||(t[7]=e=>n.filterValue=e),autoComplete:"on",class:"p-multiselect-filter p-inputtext p-component",placeholder:l.filterPlaceholder,onInput:t[8]||(t[8]=(...e)=>o.onFilterChange&&o.onFilterChange(...e))},null,40,["placeholder"]),[[s.vModelText,n.filterValue]]),g])):s.createCommentVNode("",!0),s.withDirectives(s.createVNode("button",{class:"p-multiselect-close p-link",onClick:t[9]||(t[9]=(...e)=>o.onCloseClick&&o.onCloseClick(...e)),type:"button"},[v],512),[[a]])])):s.createCommentVNode("",!0),s.createVNode("div",{class:"p-multiselect-items-wrapper",style:{"max-height":o.virtualScrollerDisabled?l.scrollHeight:""}},[s.createVNode(r,s.mergeProps({ref:o.virtualScrollerRef},l.virtualScrollerOptions,{items:o.visibleOptions,style:{height:l.scrollHeight},disabled:o.virtualScrollerDisabled}),s.createSlots({content:s.withCtx((({styleClass:t,contentRef:i,items:r,getItemOptions:c,contentStyle:d})=>[s.createVNode("ul",{ref:i,class:["p-multiselect-items p-component",t],style:d,role:"listbox","aria-multiselectable":"true"},[l.optionGroupLabel?(s.openBlock(!0),s.createBlock(s.Fragment,{key:1},s.renderList(r,((t,i)=>(s.openBlock(),s.createBlock(s.Fragment,{key:o.getOptionGroupRenderKey(t)},[s.createVNode("li",x,[s.renderSlot(e.$slots,"optiongroup",{option:t,index:o.getOptionIndex(i,c)},(()=>[s.createTextVNode(s.toDisplayString(o.getOptionGroupLabel(t)),1)]))]),(s.openBlock(!0),s.createBlock(s.Fragment,null,s.renderList(o.getOptionGroupChildren(t),((t,i)=>s.withDirectives((s.openBlock(),s.createBlock("li",{class:["p-multiselect-item",{"p-highlight":o.isSelected(t),"p-disabled":o.isOptionDisabled(t)}],role:"option","aria-selected":o.isSelected(t),key:o.getOptionRenderKey(t),onClick:e=>o.onOptionSelect(e,t),onKeydown:e=>o.onOptionKeyDown(e,t),tabindex:l.tabindex||"0","aria-label":o.getOptionLabel(t)},[s.createVNode("div",V,[s.createVNode("div",{class:["p-checkbox-box",{"p-highlight":o.isSelected(t)}]},[s.createVNode("span",{class:["p-checkbox-icon",{"pi pi-check":o.isSelected(t)}]},null,2)],2)]),s.renderSlot(e.$slots,"option",{option:t,index:o.getOptionIndex(i,c)},(()=>[s.createVNode("span",null,s.toDisplayString(o.getOptionLabel(t)),1)]))],42,["aria-selected","onClick","onKeydown","tabindex","aria-label"])),[[a]]))),128))],64)))),128)):(s.openBlock(!0),s.createBlock(s.Fragment,{key:0},s.renderList(r,((t,i)=>s.withDirectives((s.openBlock(),s.createBlock("li",{class:["p-multiselect-item",{"p-highlight":o.isSelected(t),"p-disabled":o.isOptionDisabled(t)}],role:"option","aria-selected":o.isSelected(t),key:o.getOptionRenderKey(t),onClick:e=>o.onOptionSelect(e,t),onKeydown:e=>o.onOptionKeyDown(e,t),tabindex:l.tabindex||"0","aria-label":o.getOptionLabel(t)},[s.createVNode("div",k,[s.createVNode("div",{class:["p-checkbox-box",{"p-highlight":o.isSelected(t)}]},[s.createVNode("span",{class:["p-checkbox-icon",{"pi pi-check":o.isSelected(t)}]},null,2)],2)]),s.renderSlot(e.$slots,"option",{option:t,index:o.getOptionIndex(i,c)},(()=>[s.createVNode("span",null,s.toDisplayString(o.getOptionLabel(t)),1)]))],42,["aria-selected","onClick","onKeydown","tabindex","aria-label"])),[[a]]))),128)),n.filterValue&&(!r||r&&0===r.length)?(s.openBlock(),s.createBlock("li",O,[s.renderSlot(e.$slots,"emptyfilter",{},(()=>[s.createTextVNode(s.toDisplayString(o.emptyFilterMessageText),1)]))])):!l.options||l.options&&0===l.options.length?(s.openBlock(),s.createBlock("li",S,[s.renderSlot(e.$slots,"empty",{},(()=>[s.createTextVNode(s.toDisplayString(o.emptyMessageText),1)]))])):s.createCommentVNode("",!0)],6)])),_:2},[e.$slots.loader?{name:"loader",fn:s.withCtx((({options:t})=>[s.renderSlot(e.$slots,"loader",{options:t})]))}:void 0]),1040,["items","style","disabled"])],4),s.renderSlot(e.$slots,"footer",{value:l.modelValue,options:o.visibleOptions})],2)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],2)},module.exports=d;
|
|
@@ -309,6 +309,17 @@ var script = {
|
|
|
309
309
|
onOverlayEnter(el) {
|
|
310
310
|
ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
311
311
|
this.alignOverlay();
|
|
312
|
+
|
|
313
|
+
if (!this.virtualScrollerDisabled) {
|
|
314
|
+
const selectedIndex = this.getSelectedOptionIndex();
|
|
315
|
+
if (selectedIndex !== -1) {
|
|
316
|
+
setTimeout(() => {
|
|
317
|
+
this.virtualScroller && this.virtualScroller.scrollToIndex(selectedIndex);
|
|
318
|
+
}, 0);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
onOverlayAfterEnter() {
|
|
312
323
|
this.bindOutsideClickListener();
|
|
313
324
|
this.bindScrollListener();
|
|
314
325
|
this.bindResizeListener();
|
|
@@ -317,13 +328,6 @@ var script = {
|
|
|
317
328
|
this.$refs.filterInput.focus();
|
|
318
329
|
}
|
|
319
330
|
|
|
320
|
-
if (!this.virtualScrollerDisabled) {
|
|
321
|
-
const selectedIndex = this.getSelectedOptionIndex();
|
|
322
|
-
if (selectedIndex !== -1) {
|
|
323
|
-
this.virtualScroller.scrollToIndex(selectedIndex);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
331
|
this.$emit('show');
|
|
328
332
|
},
|
|
329
333
|
onOverlayLeave() {
|
|
@@ -732,6 +736,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
732
736
|
createVNode(Transition, {
|
|
733
737
|
name: "p-connected-overlay",
|
|
734
738
|
onEnter: $options.onOverlayEnter,
|
|
739
|
+
onAfterEnter: $options.onOverlayAfterEnter,
|
|
735
740
|
onLeave: $options.onOverlayLeave,
|
|
736
741
|
onAfterLeave: $options.onOverlayAfterLeave
|
|
737
742
|
}, {
|
|
@@ -782,6 +787,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
782
787
|
type: "text",
|
|
783
788
|
ref: "filterInput",
|
|
784
789
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = $event => ($data.filterValue = $event)),
|
|
790
|
+
autoComplete: "on",
|
|
785
791
|
class: "p-multiselect-filter p-inputtext p-component",
|
|
786
792
|
placeholder: $props.filterPlaceholder,
|
|
787
793
|
onInput: _cache[8] || (_cache[8] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))
|
|
@@ -811,10 +817,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
811
817
|
style: {'height': $props.scrollHeight},
|
|
812
818
|
disabled: $options.virtualScrollerDisabled
|
|
813
819
|
}), createSlots({
|
|
814
|
-
content: withCtx(({ styleClass, contentRef, items, getItemOptions }) => [
|
|
820
|
+
content: withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle}) => [
|
|
815
821
|
createVNode("ul", {
|
|
816
822
|
ref: contentRef,
|
|
817
823
|
class: ['p-multiselect-items p-component', styleClass],
|
|
824
|
+
style: contentStyle,
|
|
818
825
|
role: "listbox",
|
|
819
826
|
"aria-multiselectable": "true"
|
|
820
827
|
}, [
|
|
@@ -906,7 +913,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
906
913
|
])
|
|
907
914
|
]))
|
|
908
915
|
: createCommentVNode("", true)
|
|
909
|
-
],
|
|
916
|
+
], 6)
|
|
910
917
|
]),
|
|
911
918
|
_: 2
|
|
912
919
|
}, [
|
|
@@ -928,7 +935,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
928
935
|
: createCommentVNode("", true)
|
|
929
936
|
]),
|
|
930
937
|
_: 3
|
|
931
|
-
}, 8, ["onEnter", "onLeave", "onAfterLeave"])
|
|
938
|
+
}, 8, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])
|
|
932
939
|
], 8, ["to", "disabled"]))
|
|
933
940
|
], 2))
|
|
934
941
|
}
|
|
@@ -965,4 +972,4 @@ styleInject(css_248z);
|
|
|
965
972
|
|
|
966
973
|
script.render = render;
|
|
967
974
|
|
|
968
|
-
export default
|
|
975
|
+
export { script as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ZIndexUtils as e,ObjectUtils as t,DomHandler as i,ConnectedOverlayScrollHandler as l}from"primevue/utils";import n from"primevue/overlayeventbus";import{FilterService as s}from"primevue/api";import o from"primevue/ripple";import a from"primevue/virtualscroller";import{resolveComponent as r,resolveDirective as p,openBlock as c,createBlock as d,createVNode as u,renderSlot as h,Fragment as m,createTextVNode as b,toDisplayString as f,renderList as y,createCommentVNode as g,Teleport as v,Transition as x,withCtx as k,withDirectives as L,vModelText as O,mergeProps as C,createSlots as V}from"vue";var S={name:"MultiSelect",emits:["update:modelValue","before-show","before-hide","change","show","hide","filter","selectall-change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,disabled:Boolean,tabindex:String,inputId:String,dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},ariaLabelledBy:null,appendTo:{type:String,default:"body"},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},display:{type:String,default:"comma"},panelClass:null,selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},virtualScrollerOptions:{type:Object,default:null},selectAll:{type:Boolean,default:null}},data:()=>({focused:!1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}),outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?t.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?t.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?t.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},getOptionGroupRenderKey(e){return t.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupLabel(e){return t.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return t.resolveFieldData(e,this.optionGroupChildren)},isOptionDisabled(e){return!(!this.maxSelectionLimitReached||this.isSelected(e))||!!this.optionDisabled&&t.resolveFieldData(e,this.optionDisabled)},getSelectedOptionIndex(){if(null!=this.modelValue&&this.options){if(!this.optionGroupLabel)return this.findOptionIndexInList(this.modelValue,this.options);for(let e=0;e<this.options.length;e++){let t=this.findOptionIndexInList(this.modelValue,this.getOptionGroupChildren(this.options[e]));if(-1!==t)return{group:e,option:t}}}return-1},findOptionIndexInList(e,i){return e?i.findIndex((i=>e.some((e=>t.equals(e,this.getOptionValue(i),this.equalityKey))))):-1},isSelected(e){if(this.modelValue){let i=this.getOptionValue(e),l=this.equalityKey;return this.modelValue.some((e=>t.equals(e,i,l)))}return!1},show(){this.$emit("before-show"),this.overlayVisible=!0},hide(){this.$emit("before-hide"),this.overlayVisible=!1},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||i.hasClass(e.target,"p-multiselect-close")||(i.hasClass(e.target,"p-multiselect-close"),this.overlayVisible?this.hide():this.show(),this.$refs.focusInput.focus())},onCloseClick(){this.hide()},onKeyDown(e){switch(e.which){case 40:this.visibleOptions&&!this.overlayVisible&&e.altKey&&this.show();break;case 32:this.overlayVisible||(this.show(),e.preventDefault());break;case 13:case 27:this.overlayVisible&&(this.hide(),e.preventDefault());break;case 9:this.hide()}},onOptionSelect(e,i){if(this.disabled||this.isOptionDisabled(i))return;let l=null;l=this.isSelected(i)?this.modelValue.filter((e=>!t.equals(e,this.getOptionValue(i),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(i)],this.$emit("update:modelValue",l),this.$emit("change",{originalEvent:e,value:l})},onOptionKeyDown(e,t){let i=e.target;switch(e.which){case 40:var l=this.findNextItem(i);l&&l.focus(),e.preventDefault();break;case 38:var n=this.findPrevItem(i);n&&n.focus(),e.preventDefault();break;case 13:this.onOptionSelect(e,t),e.preventDefault()}},findNextItem(e){let t=e.nextElementSibling;return t?i.hasClass(t,"p-disabled")||i.hasClass(t,"p-multiselect-item-group")?this.findNextItem(t):t:null},findPrevItem(e){let t=e.previousElementSibling;return t?i.hasClass(t,"p-disabled")||i.hasClass(t,"p-multiselect-item-group")?this.findPrevItem(t):t:null},onOverlayEnter(t){if(e.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.filter&&this.$refs.filterInput.focus(),!this.virtualScrollerDisabled){const e=this.getSelectedOptionIndex();-1!==e&&this.virtualScroller.scrollToIndex(e)}this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(t){e.clear(t)},alignOverlay(){this.appendDisabled?i.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=i.getOuterWidth(this.$el)+"px",i.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new l(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!i.isAndroid()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue(e){let t;if(this.options)if(this.optionGroupLabel){for(let i of this.options)if(t=this.findOptionByValue(e,this.getOptionGroupChildren(i)),t)break}else t=this.findOptionByValue(e,this.options);return t?this.getOptionLabel(t):null},findOptionByValue(e,i){for(let l of i){let i=this.getOptionValue(l);if(t.equals(i,e,this.equalityKey))return l}return null},getSelectedItemsLabel(){let e=/{(.*?)}/;return e.test(this.selectedItemsLabel)?this.selectedItemsLabel.replace(this.selectedItemsLabel.match(e)[0],this.modelValue.length+""):this.selectedItemsLabel},onToggleAll(e){if(null!==this.selectAll)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{let t=null;this.allSelected?t=[]:this.visibleOptions&&(this.optionGroupLabel?(t=[],this.visibleOptions.forEach((e=>t=[...t,...this.getOptionGroupChildren(e)]))):t=this.visibleOptions.map((e=>this.getOptionValue(e)))),this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})}},onFilterChange(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.overlayVisible&&this.alignOverlay()},overlayRef(e){this.overlay=e},virtualScrollerRef(e){this.virtualScroller=e},removeChip(e){let i=this.modelValue.filter((i=>!t.equals(i,e,this.equalityKey)));this.$emit("update:modelValue",i),this.$emit("change",{originalEvent:event,value:i})},onOverlayClick(e){n.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{visibleOptions(){if(this.filterValue){if(this.optionGroupLabel){let e=[];for(let t of this.options){let i=s.filter(this.getOptionGroupChildren(t),this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);i&&i.length&&e.push({...t,items:i})}return e}return s.filter(this.options,this.searchFields,this.filterValue,"contains",this.filterLocale)}return this.options},containerClass(){return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":"chip"===this.display,"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length,"p-inputwrapper-focus":this.focused||this.overlayVisible}]},labelClass(){return["p-multiselect-label",{"p-placeholder":this.label===this.placeholder,"p-multiselect-label-empty":!(this.placeholder||this.modelValue&&0!==this.modelValue.length)}]},panelStyleClass(){return["p-multiselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},label(){let e;if(this.modelValue&&this.modelValue.length){if(this.maxSelectedLabels&&!(this.modelValue.length<=this.maxSelectedLabels))return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},allSelected(){if(null!==this.selectAll)return this.selectAll;if(this.filterValue&&this.filterValue.trim().length>0){if(0===this.visibleOptions.length)return!1;if(this.optionGroupLabel){for(let e of this.visibleOptions)for(let t of this.getOptionGroupChildren(e))if(!this.isSelected(t))return!1}else for(let e of this.visibleOptions)if(!this.isSelected(e))return!1;return!0}if(this.modelValue&&this.options){let e=0;return this.optionGroupLabel?this.options.forEach((t=>e+=this.getOptionGroupChildren(t).length)):e=this.options.length,e>0&&e===this.modelValue.length}return!1},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptyFilterMessage},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage},appendDisabled(){return"self"===this.appendTo},appendTarget(){return this.appendDisabled?null:this.appendTo},virtualScrollerDisabled(){return!this.virtualScrollerOptions},maxSelectionLimitReached(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},dropdownIconClass(){return["p-multiselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]}},directives:{ripple:o},components:{VirtualScroller:a}};const w={class:"p-hidden-accessible"},I={class:"p-multiselect-label-container"},$={class:"p-multiselect-token-label"},D={class:"p-multiselect-trigger"},F={key:0,class:"p-multiselect-header"},K={class:"p-hidden-accessible"},B={key:1,class:"p-multiselect-filter-container"},G=u("span",{class:"p-multiselect-filter-icon pi pi-search"},null,-1),E=u("span",{class:"p-multiselect-close-icon pi pi-times"},null,-1),T={class:"p-checkbox p-component"},A={class:"p-multiselect-item-group"},H={class:"p-checkbox p-component"},R={key:2,class:"p-multiselect-empty-message"},z={key:3,class:"p-multiselect-empty-message"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&l.firstChild?l.insertBefore(n,l.firstChild):l.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n cursor: pointer;\n}\n.p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-multiselect-token {\n cursor: default;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-multiselect-token-icon {\n cursor: pointer;\n}\n.p-multiselect .p-multiselect-panel {\n min-width: 100%;\n}\n.p-multiselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-multiselect-items-wrapper {\n overflow: auto;\n}\n.p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-multiselect-item {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-multiselect-item-group {\n cursor: auto;\n}\n.p-multiselect-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),S.render=function(e,t,i,l,n,s){const o=r("VirtualScroller"),a=p("ripple");return c(),d("div",{ref:"container",class:s.containerClass,onClick:t[11]||(t[11]=(...e)=>s.onClick&&s.onClick(...e))},[u("div",w,[u("input",{ref:"focusInput",type:"text",role:"listbox",id:i.inputId,readonly:"",disabled:i.disabled,onFocus:t[1]||(t[1]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),tabindex:i.tabindex,"aria-haspopup":"true","aria-expanded":n.overlayVisible,"aria-labelledby":i.ariaLabelledBy},null,40,["id","disabled","tabindex","aria-expanded","aria-labelledby"])]),u("div",I,[u("div",{class:s.labelClass},[h(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>["comma"===i.display?(c(),d(m,{key:0},[b(f(s.label||"empty"),1)],64)):"chip"===i.display?(c(),d(m,{key:1},[(c(!0),d(m,null,y(i.modelValue,(t=>(c(),d("div",{class:"p-multiselect-token",key:s.getLabelByValue(t)},[h(e.$slots,"chip",{value:t},(()=>[u("span",$,f(s.getLabelByValue(t)),1)])),i.disabled?g("",!0):(c(),d("span",{key:0,class:"p-multiselect-token-icon pi pi-times-circle",onClick:e=>s.removeChip(t)},null,8,["onClick"]))])))),128)),i.modelValue&&0!==i.modelValue.length?g("",!0):(c(),d(m,{key:0},[b(f(i.placeholder||"empty"),1)],64))],64)):g("",!0)]))],2)]),u("div",D,[h(e.$slots,"indicator",{},(()=>[u("span",{class:s.dropdownIconClass},null,2)]))]),(c(),d(v,{to:s.appendTarget,disabled:s.appendDisabled},[u(x,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:k((()=>[n.overlayVisible?(c(),d("div",{key:0,ref:s.overlayRef,class:s.panelStyleClass,onClick:t[10]||(t[10]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e))},[h(e.$slots,"header",{value:i.modelValue,options:s.visibleOptions}),i.showToggleAll&&null==i.selectionLimit||i.filter?(c(),d("div",F,[i.showToggleAll&&null==i.selectionLimit?(c(),d("div",{key:0,class:"p-checkbox p-component",onClick:t[6]||(t[6]=(...e)=>s.onToggleAll&&s.onToggleAll(...e)),role:"checkbox","aria-checked":s.allSelected},[u("div",K,[u("input",{type:"checkbox",readonly:"",onFocus:t[4]||(t[4]=(...e)=>s.onHeaderCheckboxFocus&&s.onHeaderCheckboxFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>s.onHeaderCheckboxBlur&&s.onHeaderCheckboxBlur(...e))},null,32)]),u("div",{class:["p-checkbox-box",{"p-highlight":s.allSelected,"p-focus":n.headerCheckboxFocused}],role:"checkbox","aria-checked":s.allSelected},[u("span",{class:["p-checkbox-icon",{"pi pi-check":s.allSelected}]},null,2)],10,["aria-checked"])],8,["aria-checked"])):g("",!0),i.filter?(c(),d("div",B,[L(u("input",{type:"text",ref:"filterInput","onUpdate:modelValue":t[7]||(t[7]=e=>n.filterValue=e),class:"p-multiselect-filter p-inputtext p-component",placeholder:i.filterPlaceholder,onInput:t[8]||(t[8]=(...e)=>s.onFilterChange&&s.onFilterChange(...e))},null,40,["placeholder"]),[[O,n.filterValue]]),G])):g("",!0),L(u("button",{class:"p-multiselect-close p-link",onClick:t[9]||(t[9]=(...e)=>s.onCloseClick&&s.onCloseClick(...e)),type:"button"},[E],512),[[a]])])):g("",!0),u("div",{class:"p-multiselect-items-wrapper",style:{"max-height":s.virtualScrollerDisabled?i.scrollHeight:""}},[u(o,C({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{items:s.visibleOptions,style:{height:i.scrollHeight},disabled:s.virtualScrollerDisabled}),V({content:k((({styleClass:t,contentRef:l,items:o,getItemOptions:r})=>[u("ul",{ref:l,class:["p-multiselect-items p-component",t],role:"listbox","aria-multiselectable":"true"},[i.optionGroupLabel?(c(!0),d(m,{key:1},y(o,((t,l)=>(c(),d(m,{key:s.getOptionGroupRenderKey(t)},[u("li",A,[h(e.$slots,"optiongroup",{option:t,index:s.getOptionIndex(l,r)},(()=>[b(f(s.getOptionGroupLabel(t)),1)]))]),(c(!0),d(m,null,y(s.getOptionGroupChildren(t),((t,l)=>L((c(),d("li",{class:["p-multiselect-item",{"p-highlight":s.isSelected(t),"p-disabled":s.isOptionDisabled(t)}],role:"option","aria-selected":s.isSelected(t),key:s.getOptionRenderKey(t),onClick:e=>s.onOptionSelect(e,t),onKeydown:e=>s.onOptionKeyDown(e,t),tabindex:i.tabindex||"0","aria-label":s.getOptionLabel(t)},[u("div",H,[u("div",{class:["p-checkbox-box",{"p-highlight":s.isSelected(t)}]},[u("span",{class:["p-checkbox-icon",{"pi pi-check":s.isSelected(t)}]},null,2)],2)]),h(e.$slots,"option",{option:t,index:s.getOptionIndex(l,r)},(()=>[u("span",null,f(s.getOptionLabel(t)),1)]))],42,["aria-selected","onClick","onKeydown","tabindex","aria-label"])),[[a]]))),128))],64)))),128)):(c(!0),d(m,{key:0},y(o,((t,l)=>L((c(),d("li",{class:["p-multiselect-item",{"p-highlight":s.isSelected(t),"p-disabled":s.isOptionDisabled(t)}],role:"option","aria-selected":s.isSelected(t),key:s.getOptionRenderKey(t),onClick:e=>s.onOptionSelect(e,t),onKeydown:e=>s.onOptionKeyDown(e,t),tabindex:i.tabindex||"0","aria-label":s.getOptionLabel(t)},[u("div",T,[u("div",{class:["p-checkbox-box",{"p-highlight":s.isSelected(t)}]},[u("span",{class:["p-checkbox-icon",{"pi pi-check":s.isSelected(t)}]},null,2)],2)]),h(e.$slots,"option",{option:t,index:s.getOptionIndex(l,r)},(()=>[u("span",null,f(s.getOptionLabel(t)),1)]))],42,["aria-selected","onClick","onKeydown","tabindex","aria-label"])),[[a]]))),128)),n.filterValue&&(!o||o&&0===o.length)?(c(),d("li",R,[h(e.$slots,"emptyfilter",{},(()=>[b(f(s.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(c(),d("li",z,[h(e.$slots,"empty",{},(()=>[b(f(s.emptyMessageText),1)]))])):g("",!0)],2)])),_:2},[e.$slots.loader?{name:"loader",fn:k((({options:t})=>[h(e.$slots,"loader",{options:t})]))}:void 0]),1040,["items","style","disabled"])],4),h(e.$slots,"footer",{value:i.modelValue,options:s.visibleOptions})],2)):g("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],2)};export default S;
|
|
1
|
+
import{ZIndexUtils as e,ObjectUtils as t,DomHandler as i,ConnectedOverlayScrollHandler as l}from"primevue/utils";import n from"primevue/overlayeventbus";import{FilterService as s}from"primevue/api";import o from"primevue/ripple";import a from"primevue/virtualscroller";import{resolveComponent as r,resolveDirective as p,openBlock as c,createBlock as d,createVNode as u,renderSlot as h,Fragment as m,createTextVNode as b,toDisplayString as f,renderList as y,createCommentVNode as g,Teleport as v,Transition as x,withCtx as k,withDirectives as L,vModelText as O,mergeProps as C,createSlots as S}from"vue";var V={name:"MultiSelect",emits:["update:modelValue","before-show","before-hide","change","show","hide","filter","selectall-change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,disabled:Boolean,tabindex:String,inputId:String,dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},ariaLabelledBy:null,appendTo:{type:String,default:"body"},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},display:{type:String,default:"comma"},panelClass:null,selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},virtualScrollerOptions:{type:Object,default:null},selectAll:{type:Boolean,default:null}},data:()=>({focused:!1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}),outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?t.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?t.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e){return this.dataKey?t.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},getOptionGroupRenderKey(e){return t.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupLabel(e){return t.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return t.resolveFieldData(e,this.optionGroupChildren)},isOptionDisabled(e){return!(!this.maxSelectionLimitReached||this.isSelected(e))||!!this.optionDisabled&&t.resolveFieldData(e,this.optionDisabled)},getSelectedOptionIndex(){if(null!=this.modelValue&&this.options){if(!this.optionGroupLabel)return this.findOptionIndexInList(this.modelValue,this.options);for(let e=0;e<this.options.length;e++){let t=this.findOptionIndexInList(this.modelValue,this.getOptionGroupChildren(this.options[e]));if(-1!==t)return{group:e,option:t}}}return-1},findOptionIndexInList(e,i){return e?i.findIndex((i=>e.some((e=>t.equals(e,this.getOptionValue(i),this.equalityKey))))):-1},isSelected(e){if(this.modelValue){let i=this.getOptionValue(e),l=this.equalityKey;return this.modelValue.some((e=>t.equals(e,i,l)))}return!1},show(){this.$emit("before-show"),this.overlayVisible=!0},hide(){this.$emit("before-hide"),this.overlayVisible=!1},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||i.hasClass(e.target,"p-multiselect-close")||(i.hasClass(e.target,"p-multiselect-close"),this.overlayVisible?this.hide():this.show(),this.$refs.focusInput.focus())},onCloseClick(){this.hide()},onKeyDown(e){switch(e.which){case 40:this.visibleOptions&&!this.overlayVisible&&e.altKey&&this.show();break;case 32:this.overlayVisible||(this.show(),e.preventDefault());break;case 13:case 27:this.overlayVisible&&(this.hide(),e.preventDefault());break;case 9:this.hide()}},onOptionSelect(e,i){if(this.disabled||this.isOptionDisabled(i))return;let l=null;l=this.isSelected(i)?this.modelValue.filter((e=>!t.equals(e,this.getOptionValue(i),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(i)],this.$emit("update:modelValue",l),this.$emit("change",{originalEvent:e,value:l})},onOptionKeyDown(e,t){let i=e.target;switch(e.which){case 40:var l=this.findNextItem(i);l&&l.focus(),e.preventDefault();break;case 38:var n=this.findPrevItem(i);n&&n.focus(),e.preventDefault();break;case 13:this.onOptionSelect(e,t),e.preventDefault()}},findNextItem(e){let t=e.nextElementSibling;return t?i.hasClass(t,"p-disabled")||i.hasClass(t,"p-multiselect-item-group")?this.findNextItem(t):t:null},findPrevItem(e){let t=e.previousElementSibling;return t?i.hasClass(t,"p-disabled")||i.hasClass(t,"p-multiselect-item-group")?this.findPrevItem(t):t:null},onOverlayEnter(t){if(e.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),!this.virtualScrollerDisabled){const e=this.getSelectedOptionIndex();-1!==e&&setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(e)}),0)}},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.filter&&this.$refs.filterInput.focus(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(t){e.clear(t)},alignOverlay(){this.appendDisabled?i.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=i.getOuterWidth(this.$el)+"px",i.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new l(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!i.isAndroid()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue(e){let t;if(this.options)if(this.optionGroupLabel){for(let i of this.options)if(t=this.findOptionByValue(e,this.getOptionGroupChildren(i)),t)break}else t=this.findOptionByValue(e,this.options);return t?this.getOptionLabel(t):null},findOptionByValue(e,i){for(let l of i){let i=this.getOptionValue(l);if(t.equals(i,e,this.equalityKey))return l}return null},getSelectedItemsLabel(){let e=/{(.*?)}/;return e.test(this.selectedItemsLabel)?this.selectedItemsLabel.replace(this.selectedItemsLabel.match(e)[0],this.modelValue.length+""):this.selectedItemsLabel},onToggleAll(e){if(null!==this.selectAll)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{let t=null;this.allSelected?t=[]:this.visibleOptions&&(this.optionGroupLabel?(t=[],this.visibleOptions.forEach((e=>t=[...t,...this.getOptionGroupChildren(e)]))):t=this.visibleOptions.map((e=>this.getOptionValue(e)))),this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})}},onFilterChange(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.overlayVisible&&this.alignOverlay()},overlayRef(e){this.overlay=e},virtualScrollerRef(e){this.virtualScroller=e},removeChip(e){let i=this.modelValue.filter((i=>!t.equals(i,e,this.equalityKey)));this.$emit("update:modelValue",i),this.$emit("change",{originalEvent:event,value:i})},onOverlayClick(e){n.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{visibleOptions(){if(this.filterValue){if(this.optionGroupLabel){let e=[];for(let t of this.options){let i=s.filter(this.getOptionGroupChildren(t),this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);i&&i.length&&e.push({...t,items:i})}return e}return s.filter(this.options,this.searchFields,this.filterValue,"contains",this.filterLocale)}return this.options},containerClass(){return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":"chip"===this.display,"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length,"p-inputwrapper-focus":this.focused||this.overlayVisible}]},labelClass(){return["p-multiselect-label",{"p-placeholder":this.label===this.placeholder,"p-multiselect-label-empty":!(this.placeholder||this.modelValue&&0!==this.modelValue.length)}]},panelStyleClass(){return["p-multiselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},label(){let e;if(this.modelValue&&this.modelValue.length){if(this.maxSelectedLabels&&!(this.modelValue.length<=this.maxSelectedLabels))return this.getSelectedItemsLabel();e="";for(let t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},allSelected(){if(null!==this.selectAll)return this.selectAll;if(this.filterValue&&this.filterValue.trim().length>0){if(0===this.visibleOptions.length)return!1;if(this.optionGroupLabel){for(let e of this.visibleOptions)for(let t of this.getOptionGroupChildren(e))if(!this.isSelected(t))return!1}else for(let e of this.visibleOptions)if(!this.isSelected(e))return!1;return!0}if(this.modelValue&&this.options){let e=0;return this.optionGroupLabel?this.options.forEach((t=>e+=this.getOptionGroupChildren(t).length)):e=this.options.length,e>0&&e===this.modelValue.length}return!1},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptyFilterMessage},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage},appendDisabled(){return"self"===this.appendTo},appendTarget(){return this.appendDisabled?null:this.appendTo},virtualScrollerDisabled(){return!this.virtualScrollerOptions},maxSelectionLimitReached(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},dropdownIconClass(){return["p-multiselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]}},directives:{ripple:o},components:{VirtualScroller:a}};const w={class:"p-hidden-accessible"},I={class:"p-multiselect-label-container"},$={class:"p-multiselect-token-label"},D={class:"p-multiselect-trigger"},F={key:0,class:"p-multiselect-header"},K={class:"p-hidden-accessible"},B={key:1,class:"p-multiselect-filter-container"},E=u("span",{class:"p-multiselect-filter-icon pi pi-search"},null,-1),G=u("span",{class:"p-multiselect-close-icon pi pi-times"},null,-1),A={class:"p-checkbox p-component"},T={class:"p-multiselect-item-group"},H={class:"p-checkbox p-component"},R={key:2,class:"p-multiselect-empty-message"},z={key:3,class:"p-multiselect-empty-message"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&l.firstChild?l.insertBefore(n,l.firstChild):l.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n cursor: pointer;\n}\n.p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-multiselect-token {\n cursor: default;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-multiselect-token-icon {\n cursor: pointer;\n}\n.p-multiselect .p-multiselect-panel {\n min-width: 100%;\n}\n.p-multiselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-multiselect-items-wrapper {\n overflow: auto;\n}\n.p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-multiselect-item {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-multiselect-item-group {\n cursor: auto;\n}\n.p-multiselect-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),V.render=function(e,t,i,l,n,s){const o=r("VirtualScroller"),a=p("ripple");return c(),d("div",{ref:"container",class:s.containerClass,onClick:t[11]||(t[11]=(...e)=>s.onClick&&s.onClick(...e))},[u("div",w,[u("input",{ref:"focusInput",type:"text",role:"listbox",id:i.inputId,readonly:"",disabled:i.disabled,onFocus:t[1]||(t[1]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),tabindex:i.tabindex,"aria-haspopup":"true","aria-expanded":n.overlayVisible,"aria-labelledby":i.ariaLabelledBy},null,40,["id","disabled","tabindex","aria-expanded","aria-labelledby"])]),u("div",I,[u("div",{class:s.labelClass},[h(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>["comma"===i.display?(c(),d(m,{key:0},[b(f(s.label||"empty"),1)],64)):"chip"===i.display?(c(),d(m,{key:1},[(c(!0),d(m,null,y(i.modelValue,(t=>(c(),d("div",{class:"p-multiselect-token",key:s.getLabelByValue(t)},[h(e.$slots,"chip",{value:t},(()=>[u("span",$,f(s.getLabelByValue(t)),1)])),i.disabled?g("",!0):(c(),d("span",{key:0,class:"p-multiselect-token-icon pi pi-times-circle",onClick:e=>s.removeChip(t)},null,8,["onClick"]))])))),128)),i.modelValue&&0!==i.modelValue.length?g("",!0):(c(),d(m,{key:0},[b(f(i.placeholder||"empty"),1)],64))],64)):g("",!0)]))],2)]),u("div",D,[h(e.$slots,"indicator",{},(()=>[u("span",{class:s.dropdownIconClass},null,2)]))]),(c(),d(v,{to:s.appendTarget,disabled:s.appendDisabled},[u(x,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:k((()=>[n.overlayVisible?(c(),d("div",{key:0,ref:s.overlayRef,class:s.panelStyleClass,onClick:t[10]||(t[10]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e))},[h(e.$slots,"header",{value:i.modelValue,options:s.visibleOptions}),i.showToggleAll&&null==i.selectionLimit||i.filter?(c(),d("div",F,[i.showToggleAll&&null==i.selectionLimit?(c(),d("div",{key:0,class:"p-checkbox p-component",onClick:t[6]||(t[6]=(...e)=>s.onToggleAll&&s.onToggleAll(...e)),role:"checkbox","aria-checked":s.allSelected},[u("div",K,[u("input",{type:"checkbox",readonly:"",onFocus:t[4]||(t[4]=(...e)=>s.onHeaderCheckboxFocus&&s.onHeaderCheckboxFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>s.onHeaderCheckboxBlur&&s.onHeaderCheckboxBlur(...e))},null,32)]),u("div",{class:["p-checkbox-box",{"p-highlight":s.allSelected,"p-focus":n.headerCheckboxFocused}],role:"checkbox","aria-checked":s.allSelected},[u("span",{class:["p-checkbox-icon",{"pi pi-check":s.allSelected}]},null,2)],10,["aria-checked"])],8,["aria-checked"])):g("",!0),i.filter?(c(),d("div",B,[L(u("input",{type:"text",ref:"filterInput","onUpdate:modelValue":t[7]||(t[7]=e=>n.filterValue=e),autoComplete:"on",class:"p-multiselect-filter p-inputtext p-component",placeholder:i.filterPlaceholder,onInput:t[8]||(t[8]=(...e)=>s.onFilterChange&&s.onFilterChange(...e))},null,40,["placeholder"]),[[O,n.filterValue]]),E])):g("",!0),L(u("button",{class:"p-multiselect-close p-link",onClick:t[9]||(t[9]=(...e)=>s.onCloseClick&&s.onCloseClick(...e)),type:"button"},[G],512),[[a]])])):g("",!0),u("div",{class:"p-multiselect-items-wrapper",style:{"max-height":s.virtualScrollerDisabled?i.scrollHeight:""}},[u(o,C({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{items:s.visibleOptions,style:{height:i.scrollHeight},disabled:s.virtualScrollerDisabled}),S({content:k((({styleClass:t,contentRef:l,items:o,getItemOptions:r,contentStyle:p})=>[u("ul",{ref:l,class:["p-multiselect-items p-component",t],style:p,role:"listbox","aria-multiselectable":"true"},[i.optionGroupLabel?(c(!0),d(m,{key:1},y(o,((t,l)=>(c(),d(m,{key:s.getOptionGroupRenderKey(t)},[u("li",T,[h(e.$slots,"optiongroup",{option:t,index:s.getOptionIndex(l,r)},(()=>[b(f(s.getOptionGroupLabel(t)),1)]))]),(c(!0),d(m,null,y(s.getOptionGroupChildren(t),((t,l)=>L((c(),d("li",{class:["p-multiselect-item",{"p-highlight":s.isSelected(t),"p-disabled":s.isOptionDisabled(t)}],role:"option","aria-selected":s.isSelected(t),key:s.getOptionRenderKey(t),onClick:e=>s.onOptionSelect(e,t),onKeydown:e=>s.onOptionKeyDown(e,t),tabindex:i.tabindex||"0","aria-label":s.getOptionLabel(t)},[u("div",H,[u("div",{class:["p-checkbox-box",{"p-highlight":s.isSelected(t)}]},[u("span",{class:["p-checkbox-icon",{"pi pi-check":s.isSelected(t)}]},null,2)],2)]),h(e.$slots,"option",{option:t,index:s.getOptionIndex(l,r)},(()=>[u("span",null,f(s.getOptionLabel(t)),1)]))],42,["aria-selected","onClick","onKeydown","tabindex","aria-label"])),[[a]]))),128))],64)))),128)):(c(!0),d(m,{key:0},y(o,((t,l)=>L((c(),d("li",{class:["p-multiselect-item",{"p-highlight":s.isSelected(t),"p-disabled":s.isOptionDisabled(t)}],role:"option","aria-selected":s.isSelected(t),key:s.getOptionRenderKey(t),onClick:e=>s.onOptionSelect(e,t),onKeydown:e=>s.onOptionKeyDown(e,t),tabindex:i.tabindex||"0","aria-label":s.getOptionLabel(t)},[u("div",A,[u("div",{class:["p-checkbox-box",{"p-highlight":s.isSelected(t)}]},[u("span",{class:["p-checkbox-icon",{"pi pi-check":s.isSelected(t)}]},null,2)],2)]),h(e.$slots,"option",{option:t,index:s.getOptionIndex(l,r)},(()=>[u("span",null,f(s.getOptionLabel(t)),1)]))],42,["aria-selected","onClick","onKeydown","tabindex","aria-label"])),[[a]]))),128)),n.filterValue&&(!o||o&&0===o.length)?(c(),d("li",R,[h(e.$slots,"emptyfilter",{},(()=>[b(f(s.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(c(),d("li",z,[h(e.$slots,"empty",{},(()=>[b(f(s.emptyMessageText),1)]))])):g("",!0)],6)])),_:2},[e.$slots.loader?{name:"loader",fn:k((({options:t})=>[h(e.$slots,"loader",{options:t})]))}:void 0]),1040,["items","style","disabled"])],4),h(e.$slots,"footer",{value:i.modelValue,options:s.visibleOptions})],2)):g("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],2)};export{V as default};
|
|
@@ -312,6 +312,17 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
312
312
|
onOverlayEnter(el) {
|
|
313
313
|
utils.ZIndexUtils.set('overlay', el, this.$primevue.config.zIndex.overlay);
|
|
314
314
|
this.alignOverlay();
|
|
315
|
+
|
|
316
|
+
if (!this.virtualScrollerDisabled) {
|
|
317
|
+
const selectedIndex = this.getSelectedOptionIndex();
|
|
318
|
+
if (selectedIndex !== -1) {
|
|
319
|
+
setTimeout(() => {
|
|
320
|
+
this.virtualScroller && this.virtualScroller.scrollToIndex(selectedIndex);
|
|
321
|
+
}, 0);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
onOverlayAfterEnter() {
|
|
315
326
|
this.bindOutsideClickListener();
|
|
316
327
|
this.bindScrollListener();
|
|
317
328
|
this.bindResizeListener();
|
|
@@ -320,13 +331,6 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
320
331
|
this.$refs.filterInput.focus();
|
|
321
332
|
}
|
|
322
333
|
|
|
323
|
-
if (!this.virtualScrollerDisabled) {
|
|
324
|
-
const selectedIndex = this.getSelectedOptionIndex();
|
|
325
|
-
if (selectedIndex !== -1) {
|
|
326
|
-
this.virtualScroller.scrollToIndex(selectedIndex);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
334
|
this.$emit('show');
|
|
331
335
|
},
|
|
332
336
|
onOverlayLeave() {
|
|
@@ -479,7 +483,7 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
479
483
|
this.$emit('change', {originalEvent: event, value: value});
|
|
480
484
|
},
|
|
481
485
|
onOverlayClick(event) {
|
|
482
|
-
OverlayEventBus__default[
|
|
486
|
+
OverlayEventBus__default["default"].emit('overlay-click', {
|
|
483
487
|
originalEvent: event,
|
|
484
488
|
target: this.$el
|
|
485
489
|
});
|
|
@@ -624,10 +628,10 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
624
628
|
}
|
|
625
629
|
},
|
|
626
630
|
directives: {
|
|
627
|
-
'ripple': Ripple__default[
|
|
631
|
+
'ripple': Ripple__default["default"]
|
|
628
632
|
},
|
|
629
633
|
components: {
|
|
630
|
-
'VirtualScroller': VirtualScroller__default[
|
|
634
|
+
'VirtualScroller': VirtualScroller__default["default"]
|
|
631
635
|
}
|
|
632
636
|
};
|
|
633
637
|
|
|
@@ -735,6 +739,7 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
735
739
|
vue.createVNode(vue.Transition, {
|
|
736
740
|
name: "p-connected-overlay",
|
|
737
741
|
onEnter: $options.onOverlayEnter,
|
|
742
|
+
onAfterEnter: $options.onOverlayAfterEnter,
|
|
738
743
|
onLeave: $options.onOverlayLeave,
|
|
739
744
|
onAfterLeave: $options.onOverlayAfterLeave
|
|
740
745
|
}, {
|
|
@@ -785,6 +790,7 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
785
790
|
type: "text",
|
|
786
791
|
ref: "filterInput",
|
|
787
792
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = $event => ($data.filterValue = $event)),
|
|
793
|
+
autoComplete: "on",
|
|
788
794
|
class: "p-multiselect-filter p-inputtext p-component",
|
|
789
795
|
placeholder: $props.filterPlaceholder,
|
|
790
796
|
onInput: _cache[8] || (_cache[8] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))
|
|
@@ -814,10 +820,11 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
814
820
|
style: {'height': $props.scrollHeight},
|
|
815
821
|
disabled: $options.virtualScrollerDisabled
|
|
816
822
|
}), vue.createSlots({
|
|
817
|
-
content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions }) => [
|
|
823
|
+
content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle}) => [
|
|
818
824
|
vue.createVNode("ul", {
|
|
819
825
|
ref: contentRef,
|
|
820
826
|
class: ['p-multiselect-items p-component', styleClass],
|
|
827
|
+
style: contentStyle,
|
|
821
828
|
role: "listbox",
|
|
822
829
|
"aria-multiselectable": "true"
|
|
823
830
|
}, [
|
|
@@ -909,7 +916,7 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
909
916
|
])
|
|
910
917
|
]))
|
|
911
918
|
: vue.createCommentVNode("", true)
|
|
912
|
-
],
|
|
919
|
+
], 6)
|
|
913
920
|
]),
|
|
914
921
|
_: 2
|
|
915
922
|
}, [
|
|
@@ -931,7 +938,7 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
931
938
|
: vue.createCommentVNode("", true)
|
|
932
939
|
]),
|
|
933
940
|
_: 3
|
|
934
|
-
}, 8, ["onEnter", "onLeave", "onAfterLeave"])
|
|
941
|
+
}, 8, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])
|
|
935
942
|
], 8, ["to", "disabled"]))
|
|
936
943
|
], 2))
|
|
937
944
|
}
|
|
@@ -970,4 +977,4 @@ this.primevue.multiselect = (function (utils, OverlayEventBus, api, Ripple, Virt
|
|
|
970
977
|
|
|
971
978
|
return script;
|
|
972
979
|
|
|
973
|
-
}(primevue.utils, primevue.overlayeventbus, primevue.api, primevue.ripple, primevue.virtualscroller, Vue)
|
|
980
|
+
})(primevue.utils, primevue.overlayeventbus, primevue.api, primevue.ripple, primevue.virtualscroller, Vue);
|