primevue 3.11.0 → 3.12.1
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.esm.js +1 -1
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +1 -1
- package/accordiontab/accordiontab.esm.js +1 -1
- package/accordiontab/accordiontab.esm.min.js +1 -1
- package/accordiontab/accordiontab.js +1 -1
- package/api/api.js +1 -1
- 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.esm.js +1 -1
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +1 -1
- package/avatargroup/avatargroup.esm.js +1 -1
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +1 -1
- 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.esm.js +1 -1
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +1 -1
- 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 +30 -0
- package/calendar/Calendar.vue +19 -10
- package/calendar/calendar.cjs.js +22 -13
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +20 -11
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +23 -14
- package/calendar/calendar.min.js +1 -1
- package/card/card.esm.js +1 -1
- package/card/card.esm.min.js +1 -1
- package/card/card.js +1 -1
- 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.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.cjs.js +4 -2
- package/chart/chart.esm.js +1 -1
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +1 -1
- package/checkbox/checkbox.esm.js +1 -1
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +1 -1
- package/chip/chip.esm.js +1 -1
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +1 -1
- package/chips/chips.esm.js +1 -1
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +1 -1
- 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 +4 -0
- 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.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 +2 -1
- 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 +4 -0
- 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.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.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.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 +101 -82
- package/core/core.min.js +3 -3
- package/datatable/BodyCell.vue +6 -6
- package/datatable/DataTable.d.ts +1 -1
- package/datatable/DataTable.vue +11 -11
- package/datatable/TableFooter.vue +18 -1
- package/datatable/TableHeader.vue +18 -1
- package/datatable/datatable.cjs.js +73 -39
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +62 -28
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +74 -40
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +1 -1
- 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.esm.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.esm.min.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.js +1 -1
- package/deferredcontent/deferredcontent.esm.js +1 -1
- package/deferredcontent/deferredcontent.esm.min.js +1 -1
- package/deferredcontent/deferredcontent.js +1 -1
- package/dialog/dialog.cjs.js +1 -1
- package/dialog/dialog.esm.js +1 -1
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +2 -2
- package/divider/divider.esm.js +1 -1
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +1 -1
- package/dock/dock.cjs.js +2 -2
- package/dock/dock.esm.js +1 -1
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +3 -3
- package/dropdown/Dropdown.vue +17 -12
- package/dropdown/dropdown.cjs.js +29 -24
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +28 -23
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +30 -25
- package/dropdown/dropdown.min.js +1 -1
- 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.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.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.esm.js +1 -1
- package/fullcalendar/fullcalendar.esm.min.js +1 -1
- package/fullcalendar/fullcalendar.js +1 -1
- package/galleria/Galleria.vue +2 -8
- package/galleria/galleria.cjs.js +5 -11
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +3 -9
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +6 -12
- package/galleria/galleria.min.js +1 -1
- package/image/image.esm.js +1 -1
- package/image/image.esm.min.js +1 -1
- package/image/image.js +1 -1
- package/inlinemessage/inlinemessage.esm.js +1 -1
- package/inlinemessage/inlinemessage.esm.min.js +1 -1
- package/inlinemessage/inlinemessage.js +1 -1
- 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.esm.js +1 -1
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +1 -1
- package/inputnumber/InputNumber.d.ts +22 -1
- package/inputnumber/InputNumber.vue +7 -3
- package/inputnumber/inputnumber.cjs.js +8 -4
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +7 -3
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +9 -5
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +1 -1
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +1 -1
- package/inputtext/inputtext.esm.js +1 -1
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +1 -1
- 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.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.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.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.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/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.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 +4 -0
- 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 +1 -1
- 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.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.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.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.vue +9 -4
- package/panelmenu/PanelMenuSub.vue +6 -1
- package/panelmenu/panelmenu.cjs.js +16 -4
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +17 -5
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +17 -5
- package/panelmenu/panelmenu.min.js +1 -1
- 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 +5 -1
- 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.esm.js +1 -1
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +1 -1
- package/progressspinner/progressspinner.esm.js +1 -1
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +1 -1
- package/radiobutton/radiobutton.esm.js +1 -1
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +1 -1
- 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 +277 -3
- package/resources/themes/arya-green/theme.css +277 -3
- package/resources/themes/arya-orange/theme.css +277 -3
- package/resources/themes/arya-purple/theme.css +277 -3
- package/resources/themes/bootstrap4-dark-blue/theme.css +281 -3
- package/resources/themes/bootstrap4-dark-purple/theme.css +281 -3
- package/resources/themes/bootstrap4-light-blue/theme.css +280 -2
- package/resources/themes/bootstrap4-light-purple/theme.css +280 -2
- package/resources/themes/fluent-light/theme.css +276 -2
- package/resources/themes/lara-dark-blue/theme.css +284 -54
- package/resources/themes/lara-dark-indigo/theme.css +284 -54
- package/resources/themes/lara-dark-purple/theme.css +284 -54
- package/resources/themes/lara-dark-teal/theme.css +284 -54
- package/resources/themes/lara-light-blue/theme.css +376 -146
- package/resources/themes/lara-light-indigo/theme.css +283 -53
- package/resources/themes/lara-light-purple/theme.css +283 -53
- package/resources/themes/lara-light-teal/theme.css +283 -53
- package/resources/themes/luna-amber/theme.css +276 -2
- package/resources/themes/luna-blue/theme.css +276 -2
- package/resources/themes/luna-green/theme.css +276 -2
- package/resources/themes/luna-pink/theme.css +276 -2
- package/resources/themes/md-dark-deeppurple/theme.css +367 -10
- package/resources/themes/md-dark-indigo/theme.css +367 -10
- package/resources/themes/md-light-deeppurple/theme.css +364 -7
- package/resources/themes/md-light-indigo/theme.css +364 -7
- package/resources/themes/mdc-dark-deeppurple/theme.css +367 -10
- package/resources/themes/mdc-dark-indigo/theme.css +367 -10
- package/resources/themes/mdc-light-deeppurple/theme.css +364 -7
- package/resources/themes/mdc-light-indigo/theme.css +364 -7
- package/resources/themes/nova/theme.css +276 -2
- package/resources/themes/nova-accent/theme.css +276 -2
- package/resources/themes/nova-alt/theme.css +276 -2
- package/resources/themes/nova-vue/theme.css +276 -2
- package/resources/themes/rhea/theme.css +276 -2
- package/resources/themes/saga-blue/theme.css +276 -2
- package/resources/themes/saga-green/theme.css +276 -2
- package/resources/themes/saga-orange/theme.css +276 -2
- package/resources/themes/saga-purple/theme.css +276 -2
- package/resources/themes/tailwind-light/theme.css +279 -5
- package/resources/themes/vela-blue/theme.css +277 -3
- package/resources/themes/vela-green/theme.css +277 -3
- package/resources/themes/vela-orange/theme.css +277 -3
- package/resources/themes/vela-purple/theme.css +277 -3
- package/ripple/ripple.esm.js +1 -1
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +1 -1
- package/row/row.esm.js +1 -1
- package/row/row.esm.min.js +1 -1
- package/row/row.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +1 -1
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +1 -1
- package/scrolltop/scrolltop.esm.js +1 -1
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +1 -1
- 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.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.esm.js +1 -1
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +1 -1
- package/slider/slider.esm.js +1 -1
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +1 -1
- package/speeddial/speeddial.cjs.js +3 -3
- package/speeddial/speeddial.esm.js +1 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +4 -4
- package/splitbutton/SplitButton.vue +6 -2
- package/splitbutton/splitbutton.cjs.js +5 -5
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +4 -4
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +6 -6
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/Splitter.vue +1 -1
- 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.esm.js +1 -1
- package/splitterpanel/splitterpanel.esm.min.js +1 -1
- package/splitterpanel/splitterpanel.js +1 -1
- 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.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.esm.js +1 -1
- package/tabpanel/tabpanel.esm.min.js +1 -1
- package/tabpanel/tabpanel.js +1 -1
- 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.esm.js +1 -1
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +1 -1
- 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.esm.js +1 -1
- package/terminalservice/terminalservice.esm.min.js +1 -1
- package/terminalservice/terminalservice.js +1 -1
- package/textarea/textarea.esm.js +1 -1
- package/textarea/textarea.esm.min.js +1 -1
- package/textarea/textarea.js +1 -1
- 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.esm.js +1 -1
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +1 -1
- package/toast/Toast.d.ts +1 -1
- 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.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.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.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.cjs.js +1 -1
- package/tree/tree.esm.js +1 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +2 -2
- 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 +2 -2
- package/treetable/FooterCell.vue +3 -3
- package/treetable/HeaderCell.vue +2 -2
- package/treetable/TreeTable.d.ts +1 -1
- package/treetable/TreeTable.vue +5 -1
- package/treetable/treetable.cjs.js +10 -10
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +9 -9
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +11 -11
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +1 -1
- package/useconfirm/useconfirm.js +1 -1
- package/usetoast/usetoast.js +1 -1
- package/utils/utils.js +1 -1
- package/vetur-attributes.json +15 -3
- package/vetur-tags.json +6 -3
- package/virtualscroller/VirtualScroller.vue +24 -14
- package/virtualscroller/virtualscroller.cjs.js +24 -14
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +25 -15
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +25 -15
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +130 -10
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
package/README.md
CHANGED
|
@@ -5,6 +5,260 @@
|
|
|
5
5
|
|
|
6
6
|
[](https://www.primefaces.org/primevue)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# PrimeVue
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
PrimeVue is a rich set of open source UI Components for Vue. See [PrimeVue homepage](https://www.primefaces.org/primevue/) for live showcase and documentation.
|
|
11
|
+
|
|
12
|
+
## Download
|
|
13
|
+
|
|
14
|
+
PrimeVue is available at npm, if you have an existing application run the following command to download it to your project.
|
|
15
|
+
|
|
16
|
+
````
|
|
17
|
+
npm install primevue@^3 --save
|
|
18
|
+
npm install primeicons --save
|
|
19
|
+
````
|
|
20
|
+
|
|
21
|
+
or
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
yarn add primevue
|
|
25
|
+
yarn add primeicons
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Next step is setting up PrimeVue configuration.
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
import {createApp} from 'vue';
|
|
32
|
+
import App from './App.vue';
|
|
33
|
+
import PrimeVue from 'primevue/config';
|
|
34
|
+
const app = createApp(App);
|
|
35
|
+
|
|
36
|
+
app.use(PrimeVue);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Import
|
|
40
|
+
|
|
41
|
+
### Module
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
import {createApp} from 'vue';
|
|
45
|
+
import App from './App.vue';
|
|
46
|
+
import PrimeVue from 'primevue/config';
|
|
47
|
+
import Dialog from 'primevue/dialog';
|
|
48
|
+
const app = createApp(App);
|
|
49
|
+
|
|
50
|
+
app.use(PrimeVue);
|
|
51
|
+
|
|
52
|
+
app.component('Dialog', Dialog);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Finally you'll be able to utilize the component in your application. See the Styles section to apply styling.
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
<Dialog></Dialog>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### CDN
|
|
62
|
+
|
|
63
|
+
```javascript
|
|
64
|
+
<script src="https://unpkg.com/primevue@^3/core/core.min.js"></script>/script>
|
|
65
|
+
<script src="https://unpkg.com/primevue@^3/multiselect/multiselect.min.js"></script>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Single File Components
|
|
69
|
+
|
|
70
|
+
SFC files are available in the npm distribution and if you'd like to use SFCs directly, add ***/sfc*** as a suffix when referencing an import path. This will instruct your bundler to process the *.vue files in your local build instead of using the compiled output. One use case for this approach is optimizing for SSR by removing whitespaces.
|
|
71
|
+
|
|
72
|
+
```javascript
|
|
73
|
+
import Dialog from 'primevue/dialog/sfc';
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Script Tag
|
|
77
|
+
|
|
78
|
+
Other alternative is utilizing the components directly within the browser with the ***iife*** build. Note that PrimeVue does not provide a ***umd*** build.
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
<html>
|
|
82
|
+
<head>
|
|
83
|
+
<meta charset="utf-8">
|
|
84
|
+
<title>PrimeVue Demo</title>
|
|
85
|
+
<link href="https://unpkg.com/primevue/resources/themes/lara-light-indigo/theme.css" rel="stylesheet">
|
|
86
|
+
<link href="https://unpkg.com/primevue/resources/primevue.min.css" rel="stylesheet">
|
|
87
|
+
<link href="https://unpkg.com/primeicons/primeicons.css" rel="stylesheet">
|
|
88
|
+
|
|
89
|
+
<script src="https://unpkg.com/vue@next"></script>
|
|
90
|
+
<script src="https://unpkg.com/primevue^3/core/core.min.js"></script>
|
|
91
|
+
<script src="https://unpkg.com/primevue^3/slider/slider.min.js"></script>
|
|
92
|
+
</head>
|
|
93
|
+
|
|
94
|
+
<body>
|
|
95
|
+
<div id="app">
|
|
96
|
+
<p-slider v-model="val"></p-slider>
|
|
97
|
+
<h6>{{val}}</h6>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<script>
|
|
101
|
+
const {createApp, ref} = Vue;
|
|
102
|
+
|
|
103
|
+
const App = {
|
|
104
|
+
setup() {
|
|
105
|
+
const val = ref(null);
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
val
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
components: {
|
|
112
|
+
'p-slider': primevue.slider
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
createApp(App).use(primevue.config.default).mount("#app");
|
|
117
|
+
</script>
|
|
118
|
+
</body>
|
|
119
|
+
</html>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Styles
|
|
123
|
+
|
|
124
|
+
The css dependencies are as follows, note that you may change the theme with another one of your choice.
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
primevue/resources/themes/saga-blue/theme.css //theme
|
|
128
|
+
primevue/resources/primevue.min.css //core css
|
|
129
|
+
primeicons/primeicons.css //icons
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
If you are using a bundler such as webpack with a css loader you may also import them to your main application component.
|
|
133
|
+
|
|
134
|
+
```javascript
|
|
135
|
+
import 'primevue/resources/themes/lara-light-indigo/theme.css';
|
|
136
|
+
import 'primevue/resources/primevue.min.css';
|
|
137
|
+
import 'primeicons/primeicons.css';
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Nuxt Integration
|
|
141
|
+
|
|
142
|
+
Nuxt 3 is currently in beta and an official module is planned after the final release. At the moment, PrimeVue can easily be used with Nuxt 3 using a custom plugin.
|
|
143
|
+
|
|
144
|
+
**nuxt.config.js**
|
|
145
|
+
|
|
146
|
+
Open the nuxt configuration file and add the css dependencies.
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
import { defineNuxtConfig } from 'nuxt3';
|
|
150
|
+
|
|
151
|
+
export default defineNuxtConfig({
|
|
152
|
+
css: [
|
|
153
|
+
'primevue/resources/themes/saga-blue/theme.css',
|
|
154
|
+
'primevue/resources/primevue.css',
|
|
155
|
+
'primeicons/primeicons.css'
|
|
156
|
+
]
|
|
157
|
+
})
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**primevue.js**
|
|
161
|
+
|
|
162
|
+
Create a file like **primevue.js** under the plugins directory for the configuration.
|
|
163
|
+
|
|
164
|
+
```javascript
|
|
165
|
+
import { defineNuxtPlugin } from "#app";
|
|
166
|
+
import PrimeVue from "primevue/config";
|
|
167
|
+
import Button from "primevue/button";
|
|
168
|
+
|
|
169
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
170
|
+
nuxtApp.vueApp.use(PrimeVue, {ripple: true});
|
|
171
|
+
nuxtApp.vueApp.component('Button', Button);
|
|
172
|
+
//other components that you need
|
|
173
|
+
});
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Configuration
|
|
177
|
+
|
|
178
|
+
### Dependencies
|
|
179
|
+
|
|
180
|
+
PrimeVue components are not wrappers and implemented natively with the Vue APIs. There are some exceptions having 3rd party dependencies such as Quill for Editor.
|
|
181
|
+
|
|
182
|
+
In addition, components require PrimeIcons library for icons.
|
|
183
|
+
|
|
184
|
+
```javascript
|
|
185
|
+
dependencies: {
|
|
186
|
+
"vue": "^3.0.0",
|
|
187
|
+
"primeicons": "^5.0.0"
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Prop Cases
|
|
192
|
+
|
|
193
|
+
Component prop names are described as camel case throughout the documentation however camel-case is also fully supported. Events on the other hand should always be camel-case.
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
<Dialog :showHeader="false"></Dialog>
|
|
197
|
+
|
|
198
|
+
<!-- can be written as -->
|
|
199
|
+
|
|
200
|
+
<Dialog :show-header="false"></Dialog>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Ripple
|
|
204
|
+
|
|
205
|
+
Ripple is an optional animation for the supported components such as buttons. It is disabled by default and needs to be enabled at your app's entry file (e.g. main.js) during the PrimeVue setup.
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
import {createApp} from 'vue';
|
|
209
|
+
import PrimeVue from 'primevue/config';
|
|
210
|
+
const app = createApp(App);
|
|
211
|
+
|
|
212
|
+
app.use(PrimeVue, {ripple: true});
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Outlined vs Filled Input Styles
|
|
216
|
+
|
|
217
|
+
Input fields come in two styles, default is ***outlined*** with borders around the field whereas ***filled*** alternative adds a background color to the field. Applying *p-input-filled* to an ancestor of an input enables the filled style. If you prefer to use filled inputs in the entire application, use a global container such as the document body or the application element to apply the style class. Note that in case you add it to the application element, components that are teleported to the document body such as Dialog will not be able to display filled inputs as they are not a descendant of the application root element in the DOM tree, to resolve this case set inputStyle to 'filled' at PrimeVue configuration as well.
|
|
218
|
+
|
|
219
|
+
```javascript
|
|
220
|
+
import {createApp} from 'vue';
|
|
221
|
+
import PrimeVue from 'primevue/config';
|
|
222
|
+
const app = createApp(App);
|
|
223
|
+
|
|
224
|
+
app.use(PrimeVue, {inputStyle: 'filled'});
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## ZIndex Layering
|
|
228
|
+
|
|
229
|
+
ZIndexes are managed automatically to make sure layering of overlay components work seamlessly when combining multiple components. Still there may be cases where you'd like to configure the configure default values such as a custom layout where header section is fixed. In a case like this, dropdown needs to be displayed below the application header but a modal dialog should be displayed above. PrimeVue configuration offers the ***zIndex*** property to customize the default values for components categories. Default values are described below and can be customized when setting up PrimeVue.
|
|
230
|
+
|
|
231
|
+
```javascript
|
|
232
|
+
import {createApp} from 'vue';
|
|
233
|
+
import PrimeVue from 'primevue/config';
|
|
234
|
+
const app = createApp(App);
|
|
235
|
+
|
|
236
|
+
app.use(PrimeVue, {
|
|
237
|
+
zIndex: {
|
|
238
|
+
modal: 1100, //dialog, sidebar
|
|
239
|
+
overlay: 1000, //dropdown, overlaypanel
|
|
240
|
+
menu: 1000, //overlay menus
|
|
241
|
+
tooltip: 1100 //tooltip
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Locale
|
|
247
|
+
|
|
248
|
+
PrimeVue provides a Locale API to support i18n and l7n, visit the [Locale](https://www.primefaces.org/primevue/showcase/#/locale) documentation for more information.
|
|
249
|
+
|
|
250
|
+
## Quickstart with Vue CLI
|
|
251
|
+
|
|
252
|
+
An [example application](https://github.com/primefaces/primevue-quickstart) based on Vue CLI is available at github.
|
|
253
|
+
|
|
254
|
+
## Quickstart with Vite
|
|
255
|
+
|
|
256
|
+
A [starter application](https://github.com/primefaces/primevue-quickstart-vite) is also provided for Vite users.
|
|
257
|
+
|
|
258
|
+
## Quickstart with Nuxt
|
|
259
|
+
|
|
260
|
+
A [sample application](https://github.com/primefaces/primevue-quickstart-nuxt3) is created for Nuxt 3 users.
|
|
261
|
+
|
|
262
|
+
## Quickstart with TypeScript
|
|
263
|
+
|
|
264
|
+
Typescript is fully supported as type definition files are provided in the npm package of PrimeVue. A sample [typescript-primevue](https://github.com/primefaces/primevue-typescript-quickstart) application with Vue CLI is available as at github.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{UniqueComponentId as e}from"primevue/utils";import{openBlock as t,createBlock as i,Fragment as a,renderList as n,createVNode as d,toDisplayString as s,createCommentVNode as o,resolveDynamicComponent as c,Transition as r,withCtx as l,withDirectives as h,vShow as p}from"vue";var b={name:"Accordion",emits:["tab-close","tab-open","update:activeIndex"],props:{multiple:{type:Boolean,default:!1},activeIndex:{type:[Number,Array],default:null},lazy:{type:Boolean,default:!1}},data(){return{d_activeIndex:this.activeIndex}},watch:{activeIndex(e){this.d_activeIndex=e}},methods:{onTabClick(e,t,i){if(!this.isTabDisabled(t)){const t=this.isTabActive(i),a=t?"tab-close":"tab-open";this.multiple?t?this.d_activeIndex=this.d_activeIndex.filter((e=>e!==i)):this.d_activeIndex?this.d_activeIndex.push(i):this.d_activeIndex=[i]:this.d_activeIndex=this.d_activeIndex===i?null:i,this.$emit("update:activeIndex",this.d_activeIndex),this.$emit(a,{originalEvent:e,index:i})}},onTabKeydown(e,t,i){13===e.which&&this.onTabClick(e,t,i)},isTabActive(e){return this.multiple?this.d_activeIndex&&this.d_activeIndex.includes(e):e===this.d_activeIndex},getKey:(e,t)=>e.props&&e.props.header?e.props.header:t,isTabDisabled:e=>e.props&&e.props.disabled,getTabClass(e){return["p-accordion-tab",{"p-accordion-tab-active":this.isTabActive(e)}]},getTabHeaderClass(e,t){return["p-accordion-header",{"p-highlight":this.isTabActive(t),"p-disabled":this.isTabDisabled(e)}]},getTabAriaId(e){return this.ariaId+"_"+e},getHeaderIcon(e){const t=this.isTabActive(e);return["p-accordion-toggle-icon pi",{"pi-chevron-right":!t,"pi-chevron-down":t}]},isAccordionTab:e=>"AccordionTab"===e.type.name},computed:{tabs(){const e=[];return this.$slots.default().forEach((t=>{this.isAccordionTab(t)?e.push(t):t.children&&t.children instanceof Array&&t.children.forEach((t=>{this.isAccordionTab(t)&&e.push(t)}))})),e},ariaId:()=>e()}};const u={class:"p-accordion p-component"},v={key:0,class:"p-accordion-header-text"},x={class:"p-accordion-content"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-accordion-header-link {\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 -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: relative;\n text-decoration: none;\n}\n.p-accordion-header-link:focus {\n z-index: 1;\n}\n.p-accordion-header-text {\n line-height: 1;\n}\n"),b.render=function(e,b,T,m,g,y){return t(),i("div",u,[(t(!0),i(a,null,n(y.tabs,((e,a)=>(t(),i("div",{key:y.getKey(e,a),class:y.getTabClass(a)},[d("div",{class:y.getTabHeaderClass(e,a)},[d("a",{role:"tab",class:"p-accordion-header-link",onClick:t=>y.onTabClick(t,e,a),onKeydown:t=>y.onTabKeydown(t,e,a),tabindex:y.isTabDisabled(e)?null:"0","aria-expanded":y.isTabActive(a),id:y.getTabAriaId(a)+"_header","aria-controls":y.getTabAriaId(a)+"_content"},[d("span",{class:y.getHeaderIcon(a)},null,2),e.props&&e.props.header?(t(),i("span",v,s(e.props.header),1)):o("",!0),e.children&&e.children.header?(t(),i(c(e.children.header),{key:1})):o("",!0)],40,["onClick","onKeydown","tabindex","aria-expanded","id","aria-controls"])],2),d(r,{name:"p-toggleable-content"},{default:l((()=>[!T.lazy||y.isTabActive(a)?h((t(),i("div",{key:0,class:"p-toggleable-content",role:"region",id:y.getTabAriaId(a)+"_content","aria-labelledby":y.getTabAriaId(a)+"_header"},[d("div",x,[(t(),i(c(e)))])],8,["id","aria-labelledby"])),[[p,!!T.lazy||y.isTabActive(a)]]):o("",!0)])),_:2},1024)],2)))),128))])};export
|
|
1
|
+
import{UniqueComponentId as e}from"primevue/utils";import{openBlock as t,createBlock as i,Fragment as a,renderList as n,createVNode as d,toDisplayString as s,createCommentVNode as o,resolveDynamicComponent as c,Transition as r,withCtx as l,withDirectives as h,vShow as p}from"vue";var b={name:"Accordion",emits:["tab-close","tab-open","update:activeIndex"],props:{multiple:{type:Boolean,default:!1},activeIndex:{type:[Number,Array],default:null},lazy:{type:Boolean,default:!1}},data(){return{d_activeIndex:this.activeIndex}},watch:{activeIndex(e){this.d_activeIndex=e}},methods:{onTabClick(e,t,i){if(!this.isTabDisabled(t)){const t=this.isTabActive(i),a=t?"tab-close":"tab-open";this.multiple?t?this.d_activeIndex=this.d_activeIndex.filter((e=>e!==i)):this.d_activeIndex?this.d_activeIndex.push(i):this.d_activeIndex=[i]:this.d_activeIndex=this.d_activeIndex===i?null:i,this.$emit("update:activeIndex",this.d_activeIndex),this.$emit(a,{originalEvent:e,index:i})}},onTabKeydown(e,t,i){13===e.which&&this.onTabClick(e,t,i)},isTabActive(e){return this.multiple?this.d_activeIndex&&this.d_activeIndex.includes(e):e===this.d_activeIndex},getKey:(e,t)=>e.props&&e.props.header?e.props.header:t,isTabDisabled:e=>e.props&&e.props.disabled,getTabClass(e){return["p-accordion-tab",{"p-accordion-tab-active":this.isTabActive(e)}]},getTabHeaderClass(e,t){return["p-accordion-header",{"p-highlight":this.isTabActive(t),"p-disabled":this.isTabDisabled(e)}]},getTabAriaId(e){return this.ariaId+"_"+e},getHeaderIcon(e){const t=this.isTabActive(e);return["p-accordion-toggle-icon pi",{"pi-chevron-right":!t,"pi-chevron-down":t}]},isAccordionTab:e=>"AccordionTab"===e.type.name},computed:{tabs(){const e=[];return this.$slots.default().forEach((t=>{this.isAccordionTab(t)?e.push(t):t.children&&t.children instanceof Array&&t.children.forEach((t=>{this.isAccordionTab(t)&&e.push(t)}))})),e},ariaId:()=>e()}};const u={class:"p-accordion p-component"},v={key:0,class:"p-accordion-header-text"},x={class:"p-accordion-content"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-accordion-header-link {\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 -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: relative;\n text-decoration: none;\n}\n.p-accordion-header-link:focus {\n z-index: 1;\n}\n.p-accordion-header-text {\n line-height: 1;\n}\n"),b.render=function(e,b,T,m,g,y){return t(),i("div",u,[(t(!0),i(a,null,n(y.tabs,((e,a)=>(t(),i("div",{key:y.getKey(e,a),class:y.getTabClass(a)},[d("div",{class:y.getTabHeaderClass(e,a)},[d("a",{role:"tab",class:"p-accordion-header-link",onClick:t=>y.onTabClick(t,e,a),onKeydown:t=>y.onTabKeydown(t,e,a),tabindex:y.isTabDisabled(e)?null:"0","aria-expanded":y.isTabActive(a),id:y.getTabAriaId(a)+"_header","aria-controls":y.getTabAriaId(a)+"_content"},[d("span",{class:y.getHeaderIcon(a)},null,2),e.props&&e.props.header?(t(),i("span",v,s(e.props.header),1)):o("",!0),e.children&&e.children.header?(t(),i(c(e.children.header),{key:1})):o("",!0)],40,["onClick","onKeydown","tabindex","aria-expanded","id","aria-controls"])],2),d(r,{name:"p-toggleable-content"},{default:l((()=>[!T.lazy||y.isTabActive(a)?h((t(),i("div",{key:0,class:"p-toggleable-content",role:"region",id:y.getTabAriaId(a)+"_content","aria-labelledby":y.getTabAriaId(a)+"_header"},[d("div",x,[(t(),i(c(e)))])],8,["id","aria-labelledby"])),[[p,!!T.lazy||y.isTabActive(a)]]):o("",!0)])),_:2},1024)],2)))),128))])};export default b;
|
package/accordion/accordion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderSlot as e}from"vue";var r={name:"AccordionTab",props:{header:null,disabled:Boolean}};r.render=function(r,o,a,n,d,l){return e(r.$slots,"default")};export
|
|
1
|
+
import{renderSlot as e}from"vue";var r={name:"AccordionTab",props:{header:null,disabled:Boolean}};r.render=function(r,o,a,n,d,l){return e(r.$slots,"default")};export default r;
|
package/api/api.js
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
<div :ref="overlayRef" :class="panelStyleClass" :style="{'max-height': virtualScrollerDisabled ? scrollHeight : ''}" v-if="overlayVisible" @click="onOverlayClick">
|
|
22
22
|
<slot name="header" :value="modelValue" :suggestions="suggestions"></slot>
|
|
23
23
|
<VirtualScroller :ref="virtualScrollerRef" v-bind="virtualScrollerOptions" :style="{'height': scrollHeight}" :items="suggestions" :disabled="virtualScrollerDisabled">
|
|
24
|
-
<template v-slot:content="{ styleClass, contentRef, items, getItemOptions }">
|
|
25
|
-
<ul :id="listId" :ref="(el) => listRef(el, contentRef)" :class="['p-autocomplete-items', styleClass]" role="listbox">
|
|
24
|
+
<template v-slot:content="{ styleClass, contentRef, items, getItemOptions, contentStyle }">
|
|
25
|
+
<ul :id="listId" :ref="(el) => listRef(el, contentRef)" :class="['p-autocomplete-items', styleClass]" :style="contentStyle" role="listbox">
|
|
26
26
|
<template v-if="!optionGroupLabel">
|
|
27
27
|
<li v-for="(item, i) of items" class="p-autocomplete-item" :key="getOptionRenderKey(item)" @click="selectItem($event, item)" role="option" v-ripple :data-index="getOptionIndex(i, getItemOptions)">
|
|
28
28
|
<slot name="item" :item="item" :index="getOptionIndex(i, getItemOptions)">{{getItemContent(item)}}</slot>
|
|
@@ -513,7 +513,7 @@ var script = {
|
|
|
513
513
|
this.virtualScroller = el;
|
|
514
514
|
},
|
|
515
515
|
onOverlayClick(event) {
|
|
516
|
-
OverlayEventBus__default[
|
|
516
|
+
OverlayEventBus__default['default'].emit('overlay-click', {
|
|
517
517
|
originalEvent: event,
|
|
518
518
|
target: this.$el
|
|
519
519
|
});
|
|
@@ -574,11 +574,11 @@ var script = {
|
|
|
574
574
|
}
|
|
575
575
|
},
|
|
576
576
|
components: {
|
|
577
|
-
'Button': Button__default[
|
|
578
|
-
'VirtualScroller': VirtualScroller__default[
|
|
577
|
+
'Button': Button__default['default'],
|
|
578
|
+
'VirtualScroller': VirtualScroller__default['default']
|
|
579
579
|
},
|
|
580
580
|
directives: {
|
|
581
|
-
'ripple': Ripple__default[
|
|
581
|
+
'ripple': Ripple__default['default']
|
|
582
582
|
}
|
|
583
583
|
};
|
|
584
584
|
|
|
@@ -705,11 +705,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
705
705
|
items: $props.suggestions,
|
|
706
706
|
disabled: $options.virtualScrollerDisabled
|
|
707
707
|
}), vue.createSlots({
|
|
708
|
-
content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions }) => [
|
|
708
|
+
content: vue.withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle }) => [
|
|
709
709
|
vue.createVNode("ul", {
|
|
710
710
|
id: $options.listId,
|
|
711
711
|
ref: (el) => $options.listRef(el, contentRef),
|
|
712
712
|
class: ['p-autocomplete-items', styleClass],
|
|
713
|
+
style: contentStyle,
|
|
713
714
|
role: "listbox"
|
|
714
715
|
}, [
|
|
715
716
|
(!$props.optionGroupLabel)
|
|
@@ -764,7 +765,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
764
765
|
}), 128))
|
|
765
766
|
], 64))
|
|
766
767
|
}), 128))
|
|
767
|
-
],
|
|
768
|
+
], 14, ["id"])
|
|
768
769
|
]),
|
|
769
770
|
_: 2
|
|
770
771
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),i=require("primevue/button"),l=require("primevue/ripple"),n=require("primevue/virtualscroller"),o=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(t),a=s(i),u=s(l),d=s(n),p={name:"AutoComplete",inheritAttrs:!1,emits:["update:modelValue","item-select","item-unselect","dropdown-click","clear","complete"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},dropdown:{type:Boolean,default:!1},dropdownMode:{type:String,default:"blank"},autoHighlight:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},minLength:{type:Number,default:1},delay:{type:Number,default:300},appendTo:{type:String,default:"body"},forceSelection:{type:Boolean,default:!1},completeOnFocus:{type:Boolean,default:!1},inputClass:null,inputStyle:null,class:null,style:null,panelClass:null,virtualScrollerOptions:{type:Object,default:null}},timeout:null,outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,data:()=>({searching:!1,focused:!1,overlayVisible:!1,inputTextValue:null,highlightItem:null}),watch:{suggestions(){this.searching&&(this.suggestions&&this.suggestions.length?this.showOverlay():this.hideOverlay(),this.searching=!1)}},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.ZIndexUtils.clear(this.overlay),this.overlay=null)},updated(){this.overlayVisible&&this.alignOverlay()},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionRenderKey(e){return this.getItemContent(e)},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)},onOverlayEnter(t){e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoHighlight&&this.suggestions&&this.suggestions.length&&e.DomHandler.addClass(this.list.firstElementChild,"p-highlight")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(t){e.ZIndexUtils.clear(t)},alignOverlay(){let t=this.multiple?this.$refs.multiContainer:this.$refs.input;this.appendDisabled?e.DomHandler.relativePosition(this.overlay,t):(this.overlay.style.minWidth=e.DomHandler.getOuterWidth(t)+"px",e.DomHandler.absolutePosition(this.overlay,t))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&this.isOutsideClicked(e)&&this.hideOverlay()},document.addEventListener("click",this.outsideClickListener))},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hideOverlay()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&this.hideOverlay()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.input},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},selectItem(e,t){if(this.multiple){if(this.$refs.input.value="",this.inputTextValue="",!this.isSelected(t)){let e=this.modelValue?[...this.modelValue,t]:[t];this.$emit("update:modelValue",e)}}else this.$emit("update:modelValue",t);this.$emit("item-select",{originalEvent:e,value:t}),this.focus(),this.hideOverlay()},onMultiContainerClick(e){this.focus(),this.completeOnFocus&&this.search(e,"","click")},removeItem(e,t){let i=this.modelValue[t],l=this.modelValue.filter(((e,i)=>t!==i));this.$emit("update:modelValue",l),this.$emit("item-unselect",{originalEvent:e,value:i})},onDropdownClick(e){this.focus();const t=this.$refs.input.value;"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown"),this.$emit("dropdown-click",{originalEvent:e,query:t})},getItemContent(t){return this.field?e.ObjectUtils.resolveFieldData(t,this.field):t},showOverlay(){this.overlayVisible=!0},hideOverlay(){this.overlayVisible=!1},focus(){this.$refs.input.focus()},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},onInputClicked(e){this.completeOnFocus&&this.search(e,"","click")},onInput(e){this.inputTextValue=e.target.value,this.timeout&&clearTimeout(this.timeout);let t=e.target.value;this.multiple||this.$emit("update:modelValue",t),0===t.length?(this.hideOverlay(),this.$emit("clear")):t.length>=this.minLength?this.timeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay):this.hideOverlay()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onKeyDown(t){if(this.overlayVisible){let i=e.DomHandler.findSingle(this.list,"li.p-highlight");switch(t.which){case 40:if(i){let t=this.findNextItem(i);t&&(e.DomHandler.addClass(t,"p-highlight"),e.DomHandler.removeClass(i,"p-highlight"),t.scrollIntoView({block:"nearest",inline:"start"}))}else i=this.list.firstElementChild,e.DomHandler.hasClass(i,"p-autocomplete-item-group")&&(i=this.findNextItem(i)),i&&e.DomHandler.addClass(i,"p-highlight");t.preventDefault();break;case 38:if(i){let t=this.findPrevItem(i);t&&(e.DomHandler.addClass(t,"p-highlight"),e.DomHandler.removeClass(i,"p-highlight"),t.scrollIntoView({block:"nearest",inline:"start"}))}t.preventDefault();break;case 13:i&&(this.selectHighlightItem(t,i),this.hideOverlay()),t.preventDefault();break;case 27:this.hideOverlay(),t.preventDefault();break;case 9:i&&this.selectHighlightItem(t,i),this.hideOverlay()}}if(this.multiple&&8===t.which)if(this.modelValue&&this.modelValue.length&&!this.$refs.input.value){let e=this.modelValue[this.modelValue.length-1],i=this.modelValue.slice(0,-1);this.$emit("update:modelValue",i),this.$emit("item-unselect",{originalEvent:t,value:e})}},selectHighlightItem(e,t){if(this.optionGroupLabel){let i=this.suggestions[t.dataset.group];this.selectItem(e,this.getOptionGroupChildren(i)[t.dataset.index])}else this.selectItem(e,this.suggestions[t.dataset.index])},findNextItem(t){let i=t.nextElementSibling;return i?e.DomHandler.hasClass(i,"p-autocomplete-item-group")?this.findNextItem(i):i:null},findPrevItem(t){let i=t.previousElementSibling;return i?e.DomHandler.hasClass(i,"p-autocomplete-item-group")?this.findPrevItem(i):i:null},onChange(t){if(this.forceSelection){let i=!1,l=t.target.value.trim();if(this.suggestions)for(let n of this.suggestions){let o=this.field?e.ObjectUtils.resolveFieldData(n,this.field):n;if(o&&l===o.trim()){i=!0,this.selectItem(t,n);break}}i||(this.$refs.input.value="",this.inputTextValue="",this.$emit("clear"),this.multiple||this.$emit("update:modelValue",null))}},isSelected(t){let i=!1;if(this.modelValue&&this.modelValue.length)for(let l=0;l<this.modelValue.length;l++)if(e.ObjectUtils.equals(this.modelValue[l],t)){i=!0;break}return i},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e},onOverlayClick(e){r.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-autocomplete p-component p-inputwrapper",this.class,{"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||this.inputTextValue&&this.inputTextValue.length,"p-inputwrapper-focus":this.focused}]},inputFieldClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown,"p-disabled":this.$attrs.disabled}]},multiContainerClass(){return["p-autocomplete-multiple-container p-component p-inputtext",{"p-disabled":this.$attrs.disabled,"p-focus":this.focused}]},panelStyleClass(){return["p-autocomplete-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},inputValue(){if(this.modelValue){if(this.field&&"object"==typeof this.modelValue){const t=e.ObjectUtils.resolveFieldData(this.modelValue,this.field);return null!=t?t:this.modelValue}return this.modelValue}return""},listId:()=>e.UniqueComponentId()+"_list",appendDisabled(){return"self"===this.appendTo},appendTarget(){return this.appendDisabled?null:this.appendTo},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:a.default,VirtualScroller:d.default},directives:{ripple:u.default}};const c={class:"p-autocomplete-token-label"},h={class:"p-autocomplete-input-token"},m={key:2,class:"p-autocomplete-loader pi pi-spinner pi-spin"},g={class:"p-autocomplete-item-group"};!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-autocomplete {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n}\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-autocomplete-dd .p-autocomplete-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n.p-autocomplete-dd .p-autocomplete-input,\n.p-autocomplete-dd .p-autocomplete-multiple-container {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-autocomplete-dd .p-autocomplete-dropdown {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0px;\n}\n.p-autocomplete .p-autocomplete-panel {\n min-width: 100%;\n}\n.p-autocomplete-panel {\n position: absolute;\n overflow: auto;\n top: 0;\n left: 0;\n}\n.p-autocomplete-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-autocomplete-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-autocomplete-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\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 -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n.p-autocomplete-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-autocomplete-token-icon {\n cursor: pointer;\n}\n.p-autocomplete-input-token {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-autocomplete-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-autocomplete {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-autocomplete-dd .p-autocomplete-input {\n width: 1%;\n}\n"),p.render=function(e,t,i,l,n,s){const r=o.resolveComponent("Button"),a=o.resolveComponent("VirtualScroller"),u=o.resolveDirective("ripple");return o.openBlock(),o.createBlock("span",{ref:"container",class:s.containerClass,"aria-haspopup":"listbox","aria-owns":s.listId,"aria-expanded":n.overlayVisible,style:i.style},[i.multiple?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock("input",o.mergeProps({key:0,ref:"input",class:s.inputFieldClass,style:i.inputStyle},e.$attrs,{value:s.inputValue,onClick:t[1]||(t[1]=(...e)=>s.onInputClicked&&s.onInputClicked(...e)),onInput:t[2]||(t[2]=(...e)=>s.onInput&&s.onInput(...e)),onFocus:t[3]||(t[3]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[4]||(t[4]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[5]||(t[5]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onChange:t[6]||(t[6]=(...e)=>s.onChange&&s.onChange(...e)),type:"text",autoComplete:"off",role:"searchbox","aria-autocomplete":"list","aria-controls":s.listId}),null,16,["value","aria-controls"])),i.multiple?(o.openBlock(),o.createBlock("ul",{key:1,ref:"multiContainer",class:s.multiContainerClass,onClick:t[12]||(t[12]=(...e)=>s.onMultiContainerClick&&s.onMultiContainerClick(...e))},[(o.openBlock(!0),o.createBlock(o.Fragment,null,o.renderList(i.modelValue,((t,i)=>(o.openBlock(),o.createBlock("li",{key:i,class:"p-autocomplete-token"},[o.renderSlot(e.$slots,"chip",{value:t},(()=>[o.createVNode("span",c,o.toDisplayString(s.getItemContent(t)),1)])),o.createVNode("span",{class:"p-autocomplete-token-icon pi pi-times-circle",onClick:e=>s.removeItem(e,i)},null,8,["onClick"])])))),128)),o.createVNode("li",h,[o.createVNode("input",o.mergeProps({ref:"input",type:"text",autoComplete:"off"},e.$attrs,{onInput:t[7]||(t[7]=(...e)=>s.onInput&&s.onInput(...e)),onFocus:t[8]||(t[8]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[9]||(t[9]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[10]||(t[10]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onChange:t[11]||(t[11]=(...e)=>s.onChange&&s.onChange(...e)),role:"searchbox","aria-autocomplete":"list","aria-controls":s.listId}),null,16,["aria-controls"])])],2)):o.createCommentVNode("",!0),n.searching?(o.openBlock(),o.createBlock("i",m)):o.createCommentVNode("",!0),i.dropdown?(o.openBlock(),o.createBlock(r,{key:3,ref:"dropdownButton",type:"button",icon:"pi pi-chevron-down",class:"p-autocomplete-dropdown",disabled:e.$attrs.disabled,onClick:s.onDropdownClick},null,8,["disabled","onClick"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.Teleport,{to:s.appendTarget,disabled:s.appendDisabled},[o.createVNode(o.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:o.withCtx((()=>[n.overlayVisible?(o.openBlock(),o.createBlock("div",{key:0,ref:s.overlayRef,class:s.panelStyleClass,style:{"max-height":s.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e))},[o.renderSlot(e.$slots,"header",{value:i.modelValue,suggestions:i.suggestions}),o.createVNode(a,o.mergeProps({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:i.suggestions,disabled:s.virtualScrollerDisabled}),o.createSlots({content:o.withCtx((({styleClass:t,contentRef:l,items:n,getItemOptions:r})=>[o.createVNode("ul",{id:s.listId,ref:e=>s.listRef(e,l),class:["p-autocomplete-items",t],role:"listbox"},[i.optionGroupLabel?(o.openBlock(!0),o.createBlock(o.Fragment,{key:1},o.renderList(n,((t,i)=>(o.openBlock(),o.createBlock(o.Fragment,{key:s.getOptionGroupRenderKey(t)},[o.createVNode("li",g,[o.renderSlot(e.$slots,"optiongroup",{item:t,index:s.getOptionIndex(i,r)},(()=>[o.createTextVNode(o.toDisplayString(s.getOptionGroupLabel(t)),1)]))]),(o.openBlock(!0),o.createBlock(o.Fragment,null,o.renderList(s.getOptionGroupChildren(t),((t,l)=>o.withDirectives((o.openBlock(),o.createBlock("li",{class:"p-autocomplete-item",key:l,onClick:e=>s.selectItem(e,t),role:"option","data-group":i,"data-index":s.getOptionIndex(l,r)},[o.renderSlot(e.$slots,"item",{item:t,index:s.getOptionIndex(l,r)},(()=>[o.createTextVNode(o.toDisplayString(s.getItemContent(t)),1)]))],8,["onClick","data-group","data-index"])),[[u]]))),128))],64)))),128)):(o.openBlock(!0),o.createBlock(o.Fragment,{key:0},o.renderList(n,((t,i)=>o.withDirectives((o.openBlock(),o.createBlock("li",{class:"p-autocomplete-item",key:s.getOptionRenderKey(t),onClick:e=>s.selectItem(e,t),role:"option","data-index":s.getOptionIndex(i,r)},[o.renderSlot(e.$slots,"item",{item:t,index:s.getOptionIndex(i,r)},(()=>[o.createTextVNode(o.toDisplayString(s.getItemContent(t)),1)]))],8,["onClick","data-index"])),[[u]]))),128))],10,["id"])])),_:2},[e.$slots.loader?{name:"loader",fn:o.withCtx((({options:t})=>[o.renderSlot(e.$slots,"loader",{options:t})]))}:void 0]),1040,["style","items","disabled"]),o.renderSlot(e.$slots,"footer",{value:i.modelValue,suggestions:i.suggestions})],6)):o.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],14,["aria-owns","aria-expanded"])},module.exports=p;
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),i=require("primevue/button"),l=require("primevue/ripple"),n=require("primevue/virtualscroller"),o=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(t),a=s(i),u=s(l),d=s(n),p={name:"AutoComplete",inheritAttrs:!1,emits:["update:modelValue","item-select","item-unselect","dropdown-click","clear","complete"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},dropdown:{type:Boolean,default:!1},dropdownMode:{type:String,default:"blank"},autoHighlight:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},minLength:{type:Number,default:1},delay:{type:Number,default:300},appendTo:{type:String,default:"body"},forceSelection:{type:Boolean,default:!1},completeOnFocus:{type:Boolean,default:!1},inputClass:null,inputStyle:null,class:null,style:null,panelClass:null,virtualScrollerOptions:{type:Object,default:null}},timeout:null,outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,data:()=>({searching:!1,focused:!1,overlayVisible:!1,inputTextValue:null,highlightItem:null}),watch:{suggestions(){this.searching&&(this.suggestions&&this.suggestions.length?this.showOverlay():this.hideOverlay(),this.searching=!1)}},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.ZIndexUtils.clear(this.overlay),this.overlay=null)},updated(){this.overlayVisible&&this.alignOverlay()},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionRenderKey(e){return this.getItemContent(e)},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)},onOverlayEnter(t){e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoHighlight&&this.suggestions&&this.suggestions.length&&e.DomHandler.addClass(this.list.firstElementChild,"p-highlight")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(t){e.ZIndexUtils.clear(t)},alignOverlay(){let t=this.multiple?this.$refs.multiContainer:this.$refs.input;this.appendDisabled?e.DomHandler.relativePosition(this.overlay,t):(this.overlay.style.minWidth=e.DomHandler.getOuterWidth(t)+"px",e.DomHandler.absolutePosition(this.overlay,t))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&this.isOutsideClicked(e)&&this.hideOverlay()},document.addEventListener("click",this.outsideClickListener))},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hideOverlay()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&this.hideOverlay()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.input},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},selectItem(e,t){if(this.multiple){if(this.$refs.input.value="",this.inputTextValue="",!this.isSelected(t)){let e=this.modelValue?[...this.modelValue,t]:[t];this.$emit("update:modelValue",e)}}else this.$emit("update:modelValue",t);this.$emit("item-select",{originalEvent:e,value:t}),this.focus(),this.hideOverlay()},onMultiContainerClick(e){this.focus(),this.completeOnFocus&&this.search(e,"","click")},removeItem(e,t){let i=this.modelValue[t],l=this.modelValue.filter(((e,i)=>t!==i));this.$emit("update:modelValue",l),this.$emit("item-unselect",{originalEvent:e,value:i})},onDropdownClick(e){this.focus();const t=this.$refs.input.value;"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown"),this.$emit("dropdown-click",{originalEvent:e,query:t})},getItemContent(t){return this.field?e.ObjectUtils.resolveFieldData(t,this.field):t},showOverlay(){this.overlayVisible=!0},hideOverlay(){this.overlayVisible=!1},focus(){this.$refs.input.focus()},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},onInputClicked(e){this.completeOnFocus&&this.search(e,"","click")},onInput(e){this.inputTextValue=e.target.value,this.timeout&&clearTimeout(this.timeout);let t=e.target.value;this.multiple||this.$emit("update:modelValue",t),0===t.length?(this.hideOverlay(),this.$emit("clear")):t.length>=this.minLength?this.timeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay):this.hideOverlay()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onKeyDown(t){if(this.overlayVisible){let i=e.DomHandler.findSingle(this.list,"li.p-highlight");switch(t.which){case 40:if(i){let t=this.findNextItem(i);t&&(e.DomHandler.addClass(t,"p-highlight"),e.DomHandler.removeClass(i,"p-highlight"),t.scrollIntoView({block:"nearest",inline:"start"}))}else i=this.list.firstElementChild,e.DomHandler.hasClass(i,"p-autocomplete-item-group")&&(i=this.findNextItem(i)),i&&e.DomHandler.addClass(i,"p-highlight");t.preventDefault();break;case 38:if(i){let t=this.findPrevItem(i);t&&(e.DomHandler.addClass(t,"p-highlight"),e.DomHandler.removeClass(i,"p-highlight"),t.scrollIntoView({block:"nearest",inline:"start"}))}t.preventDefault();break;case 13:i&&(this.selectHighlightItem(t,i),this.hideOverlay()),t.preventDefault();break;case 27:this.hideOverlay(),t.preventDefault();break;case 9:i&&this.selectHighlightItem(t,i),this.hideOverlay()}}if(this.multiple&&8===t.which)if(this.modelValue&&this.modelValue.length&&!this.$refs.input.value){let e=this.modelValue[this.modelValue.length-1],i=this.modelValue.slice(0,-1);this.$emit("update:modelValue",i),this.$emit("item-unselect",{originalEvent:t,value:e})}},selectHighlightItem(e,t){if(this.optionGroupLabel){let i=this.suggestions[t.dataset.group];this.selectItem(e,this.getOptionGroupChildren(i)[t.dataset.index])}else this.selectItem(e,this.suggestions[t.dataset.index])},findNextItem(t){let i=t.nextElementSibling;return i?e.DomHandler.hasClass(i,"p-autocomplete-item-group")?this.findNextItem(i):i:null},findPrevItem(t){let i=t.previousElementSibling;return i?e.DomHandler.hasClass(i,"p-autocomplete-item-group")?this.findPrevItem(i):i:null},onChange(t){if(this.forceSelection){let i=!1,l=t.target.value.trim();if(this.suggestions)for(let n of this.suggestions){let o=this.field?e.ObjectUtils.resolveFieldData(n,this.field):n;if(o&&l===o.trim()){i=!0,this.selectItem(t,n);break}}i||(this.$refs.input.value="",this.inputTextValue="",this.$emit("clear"),this.multiple||this.$emit("update:modelValue",null))}},isSelected(t){let i=!1;if(this.modelValue&&this.modelValue.length)for(let l=0;l<this.modelValue.length;l++)if(e.ObjectUtils.equals(this.modelValue[l],t)){i=!0;break}return i},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e},onOverlayClick(e){r.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-autocomplete p-component p-inputwrapper",this.class,{"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||this.inputTextValue&&this.inputTextValue.length,"p-inputwrapper-focus":this.focused}]},inputFieldClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown,"p-disabled":this.$attrs.disabled}]},multiContainerClass(){return["p-autocomplete-multiple-container p-component p-inputtext",{"p-disabled":this.$attrs.disabled,"p-focus":this.focused}]},panelStyleClass(){return["p-autocomplete-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},inputValue(){if(this.modelValue){if(this.field&&"object"==typeof this.modelValue){const t=e.ObjectUtils.resolveFieldData(this.modelValue,this.field);return null!=t?t:this.modelValue}return this.modelValue}return""},listId:()=>e.UniqueComponentId()+"_list",appendDisabled(){return"self"===this.appendTo},appendTarget(){return this.appendDisabled?null:this.appendTo},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:a.default,VirtualScroller:d.default},directives:{ripple:u.default}};const c={class:"p-autocomplete-token-label"},h={class:"p-autocomplete-input-token"},m={key:2,class:"p-autocomplete-loader pi pi-spinner pi-spin"},g={class:"p-autocomplete-item-group"};!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-autocomplete {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n}\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-autocomplete-dd .p-autocomplete-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n.p-autocomplete-dd .p-autocomplete-input,\n.p-autocomplete-dd .p-autocomplete-multiple-container {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-autocomplete-dd .p-autocomplete-dropdown {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0px;\n}\n.p-autocomplete .p-autocomplete-panel {\n min-width: 100%;\n}\n.p-autocomplete-panel {\n position: absolute;\n overflow: auto;\n top: 0;\n left: 0;\n}\n.p-autocomplete-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-autocomplete-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-autocomplete-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\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 -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n.p-autocomplete-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-autocomplete-token-icon {\n cursor: pointer;\n}\n.p-autocomplete-input-token {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-autocomplete-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-autocomplete {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-autocomplete-dd .p-autocomplete-input {\n width: 1%;\n}\n"),p.render=function(e,t,i,l,n,s){const r=o.resolveComponent("Button"),a=o.resolveComponent("VirtualScroller"),u=o.resolveDirective("ripple");return o.openBlock(),o.createBlock("span",{ref:"container",class:s.containerClass,"aria-haspopup":"listbox","aria-owns":s.listId,"aria-expanded":n.overlayVisible,style:i.style},[i.multiple?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock("input",o.mergeProps({key:0,ref:"input",class:s.inputFieldClass,style:i.inputStyle},e.$attrs,{value:s.inputValue,onClick:t[1]||(t[1]=(...e)=>s.onInputClicked&&s.onInputClicked(...e)),onInput:t[2]||(t[2]=(...e)=>s.onInput&&s.onInput(...e)),onFocus:t[3]||(t[3]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[4]||(t[4]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[5]||(t[5]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onChange:t[6]||(t[6]=(...e)=>s.onChange&&s.onChange(...e)),type:"text",autoComplete:"off",role:"searchbox","aria-autocomplete":"list","aria-controls":s.listId}),null,16,["value","aria-controls"])),i.multiple?(o.openBlock(),o.createBlock("ul",{key:1,ref:"multiContainer",class:s.multiContainerClass,onClick:t[12]||(t[12]=(...e)=>s.onMultiContainerClick&&s.onMultiContainerClick(...e))},[(o.openBlock(!0),o.createBlock(o.Fragment,null,o.renderList(i.modelValue,((t,i)=>(o.openBlock(),o.createBlock("li",{key:i,class:"p-autocomplete-token"},[o.renderSlot(e.$slots,"chip",{value:t},(()=>[o.createVNode("span",c,o.toDisplayString(s.getItemContent(t)),1)])),o.createVNode("span",{class:"p-autocomplete-token-icon pi pi-times-circle",onClick:e=>s.removeItem(e,i)},null,8,["onClick"])])))),128)),o.createVNode("li",h,[o.createVNode("input",o.mergeProps({ref:"input",type:"text",autoComplete:"off"},e.$attrs,{onInput:t[7]||(t[7]=(...e)=>s.onInput&&s.onInput(...e)),onFocus:t[8]||(t[8]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[9]||(t[9]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[10]||(t[10]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onChange:t[11]||(t[11]=(...e)=>s.onChange&&s.onChange(...e)),role:"searchbox","aria-autocomplete":"list","aria-controls":s.listId}),null,16,["aria-controls"])])],2)):o.createCommentVNode("",!0),n.searching?(o.openBlock(),o.createBlock("i",m)):o.createCommentVNode("",!0),i.dropdown?(o.openBlock(),o.createBlock(r,{key:3,ref:"dropdownButton",type:"button",icon:"pi pi-chevron-down",class:"p-autocomplete-dropdown",disabled:e.$attrs.disabled,onClick:s.onDropdownClick},null,8,["disabled","onClick"])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.Teleport,{to:s.appendTarget,disabled:s.appendDisabled},[o.createVNode(o.Transition,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:o.withCtx((()=>[n.overlayVisible?(o.openBlock(),o.createBlock("div",{key:0,ref:s.overlayRef,class:s.panelStyleClass,style:{"max-height":s.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e))},[o.renderSlot(e.$slots,"header",{value:i.modelValue,suggestions:i.suggestions}),o.createVNode(a,o.mergeProps({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:i.suggestions,disabled:s.virtualScrollerDisabled}),o.createSlots({content:o.withCtx((({styleClass:t,contentRef:l,items:n,getItemOptions:r,contentStyle:a})=>[o.createVNode("ul",{id:s.listId,ref:e=>s.listRef(e,l),class:["p-autocomplete-items",t],style:a,role:"listbox"},[i.optionGroupLabel?(o.openBlock(!0),o.createBlock(o.Fragment,{key:1},o.renderList(n,((t,i)=>(o.openBlock(),o.createBlock(o.Fragment,{key:s.getOptionGroupRenderKey(t)},[o.createVNode("li",g,[o.renderSlot(e.$slots,"optiongroup",{item:t,index:s.getOptionIndex(i,r)},(()=>[o.createTextVNode(o.toDisplayString(s.getOptionGroupLabel(t)),1)]))]),(o.openBlock(!0),o.createBlock(o.Fragment,null,o.renderList(s.getOptionGroupChildren(t),((t,l)=>o.withDirectives((o.openBlock(),o.createBlock("li",{class:"p-autocomplete-item",key:l,onClick:e=>s.selectItem(e,t),role:"option","data-group":i,"data-index":s.getOptionIndex(l,r)},[o.renderSlot(e.$slots,"item",{item:t,index:s.getOptionIndex(l,r)},(()=>[o.createTextVNode(o.toDisplayString(s.getItemContent(t)),1)]))],8,["onClick","data-group","data-index"])),[[u]]))),128))],64)))),128)):(o.openBlock(!0),o.createBlock(o.Fragment,{key:0},o.renderList(n,((t,i)=>o.withDirectives((o.openBlock(),o.createBlock("li",{class:"p-autocomplete-item",key:s.getOptionRenderKey(t),onClick:e=>s.selectItem(e,t),role:"option","data-index":s.getOptionIndex(i,r)},[o.renderSlot(e.$slots,"item",{item:t,index:s.getOptionIndex(i,r)},(()=>[o.createTextVNode(o.toDisplayString(s.getItemContent(t)),1)]))],8,["onClick","data-index"])),[[u]]))),128))],14,["id"])])),_:2},[e.$slots.loader?{name:"loader",fn:o.withCtx((({options:t})=>[o.renderSlot(e.$slots,"loader",{options:t})]))}:void 0]),1040,["style","items","disabled"]),o.renderSlot(e.$slots,"footer",{value:i.modelValue,suggestions:i.suggestions})],6)):o.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],14,["aria-owns","aria-expanded"])},module.exports=p;
|
|
@@ -696,11 +696,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
696
696
|
items: $props.suggestions,
|
|
697
697
|
disabled: $options.virtualScrollerDisabled
|
|
698
698
|
}), createSlots({
|
|
699
|
-
content: withCtx(({ styleClass, contentRef, items, getItemOptions }) => [
|
|
699
|
+
content: withCtx(({ styleClass, contentRef, items, getItemOptions, contentStyle }) => [
|
|
700
700
|
createVNode("ul", {
|
|
701
701
|
id: $options.listId,
|
|
702
702
|
ref: (el) => $options.listRef(el, contentRef),
|
|
703
703
|
class: ['p-autocomplete-items', styleClass],
|
|
704
|
+
style: contentStyle,
|
|
704
705
|
role: "listbox"
|
|
705
706
|
}, [
|
|
706
707
|
(!$props.optionGroupLabel)
|
|
@@ -755,7 +756,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
755
756
|
}), 128))
|
|
756
757
|
], 64))
|
|
757
758
|
}), 128))
|
|
758
|
-
],
|
|
759
|
+
], 14, ["id"])
|
|
759
760
|
]),
|
|
760
761
|
_: 2
|
|
761
762
|
}, [
|
|
@@ -813,4 +814,4 @@ styleInject(css_248z);
|
|
|
813
814
|
|
|
814
815
|
script.render = render;
|
|
815
816
|
|
|
816
|
-
export
|
|
817
|
+
export default script;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ZIndexUtils as e,ObjectUtils as t,DomHandler as i,ConnectedOverlayScrollHandler as l,UniqueComponentId as n}from"primevue/utils";import o from"primevue/overlayeventbus";import s from"primevue/button";import r from"primevue/ripple";import a from"primevue/virtualscroller";import{resolveComponent as u,resolveDirective as p,openBlock as d,createBlock as h,mergeProps as c,createCommentVNode as m,Fragment as g,renderList as f,renderSlot as v,createVNode as y,toDisplayString as b,Teleport as C,Transition as k,withCtx as x,createSlots as w,withDirectives as O,createTextVNode as V}from"vue";var I={name:"AutoComplete",inheritAttrs:!1,emits:["update:modelValue","item-select","item-unselect","dropdown-click","clear","complete"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},dropdown:{type:Boolean,default:!1},dropdownMode:{type:String,default:"blank"},autoHighlight:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},minLength:{type:Number,default:1},delay:{type:Number,default:300},appendTo:{type:String,default:"body"},forceSelection:{type:Boolean,default:!1},completeOnFocus:{type:Boolean,default:!1},inputClass:null,inputStyle:null,class:null,style:null,panelClass:null,virtualScrollerOptions:{type:Object,default:null}},timeout:null,outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,data:()=>({searching:!1,focused:!1,overlayVisible:!1,inputTextValue:null,highlightItem:null}),watch:{suggestions(){this.searching&&(this.suggestions&&this.suggestions.length?this.showOverlay():this.hideOverlay(),this.searching=!1)}},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.clear(this.overlay),this.overlay=null)},updated(){this.overlayVisible&&this.alignOverlay()},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionRenderKey(e){return this.getItemContent(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)},onOverlayEnter(t){e.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoHighlight&&this.suggestions&&this.suggestions.length&&i.addClass(this.list.firstElementChild,"p-highlight")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(t){e.clear(t)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.input;this.appendDisabled?i.relativePosition(this.overlay,e):(this.overlay.style.minWidth=i.getOuterWidth(e)+"px",i.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&this.isOutsideClicked(e)&&this.hideOverlay()},document.addEventListener("click",this.outsideClickListener))},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new l(this.$refs.container,(()=>{this.overlayVisible&&this.hideOverlay()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&this.hideOverlay()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.input},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},selectItem(e,t){if(this.multiple){if(this.$refs.input.value="",this.inputTextValue="",!this.isSelected(t)){let e=this.modelValue?[...this.modelValue,t]:[t];this.$emit("update:modelValue",e)}}else this.$emit("update:modelValue",t);this.$emit("item-select",{originalEvent:e,value:t}),this.focus(),this.hideOverlay()},onMultiContainerClick(e){this.focus(),this.completeOnFocus&&this.search(e,"","click")},removeItem(e,t){let i=this.modelValue[t],l=this.modelValue.filter(((e,i)=>t!==i));this.$emit("update:modelValue",l),this.$emit("item-unselect",{originalEvent:e,value:i})},onDropdownClick(e){this.focus();const t=this.$refs.input.value;"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown"),this.$emit("dropdown-click",{originalEvent:e,query:t})},getItemContent(e){return this.field?t.resolveFieldData(e,this.field):e},showOverlay(){this.overlayVisible=!0},hideOverlay(){this.overlayVisible=!1},focus(){this.$refs.input.focus()},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},onInputClicked(e){this.completeOnFocus&&this.search(e,"","click")},onInput(e){this.inputTextValue=e.target.value,this.timeout&&clearTimeout(this.timeout);let t=e.target.value;this.multiple||this.$emit("update:modelValue",t),0===t.length?(this.hideOverlay(),this.$emit("clear")):t.length>=this.minLength?this.timeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay):this.hideOverlay()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onKeyDown(e){if(this.overlayVisible){let t=i.findSingle(this.list,"li.p-highlight");switch(e.which){case 40:if(t){let e=this.findNextItem(t);e&&(i.addClass(e,"p-highlight"),i.removeClass(t,"p-highlight"),e.scrollIntoView({block:"nearest",inline:"start"}))}else t=this.list.firstElementChild,i.hasClass(t,"p-autocomplete-item-group")&&(t=this.findNextItem(t)),t&&i.addClass(t,"p-highlight");e.preventDefault();break;case 38:if(t){let e=this.findPrevItem(t);e&&(i.addClass(e,"p-highlight"),i.removeClass(t,"p-highlight"),e.scrollIntoView({block:"nearest",inline:"start"}))}e.preventDefault();break;case 13:t&&(this.selectHighlightItem(e,t),this.hideOverlay()),e.preventDefault();break;case 27:this.hideOverlay(),e.preventDefault();break;case 9:t&&this.selectHighlightItem(e,t),this.hideOverlay()}}if(this.multiple&&8===e.which)if(this.modelValue&&this.modelValue.length&&!this.$refs.input.value){let t=this.modelValue[this.modelValue.length-1],i=this.modelValue.slice(0,-1);this.$emit("update:modelValue",i),this.$emit("item-unselect",{originalEvent:e,value:t})}},selectHighlightItem(e,t){if(this.optionGroupLabel){let i=this.suggestions[t.dataset.group];this.selectItem(e,this.getOptionGroupChildren(i)[t.dataset.index])}else this.selectItem(e,this.suggestions[t.dataset.index])},findNextItem(e){let t=e.nextElementSibling;return t?i.hasClass(t,"p-autocomplete-item-group")?this.findNextItem(t):t:null},findPrevItem(e){let t=e.previousElementSibling;return t?i.hasClass(t,"p-autocomplete-item-group")?this.findPrevItem(t):t:null},onChange(e){if(this.forceSelection){let i=!1,l=e.target.value.trim();if(this.suggestions)for(let n of this.suggestions){let o=this.field?t.resolveFieldData(n,this.field):n;if(o&&l===o.trim()){i=!0,this.selectItem(e,n);break}}i||(this.$refs.input.value="",this.inputTextValue="",this.$emit("clear"),this.multiple||this.$emit("update:modelValue",null))}},isSelected(e){let i=!1;if(this.modelValue&&this.modelValue.length)for(let l=0;l<this.modelValue.length;l++)if(t.equals(this.modelValue[l],e)){i=!0;break}return i},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e},onOverlayClick(e){o.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-autocomplete p-component p-inputwrapper",this.class,{"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||this.inputTextValue&&this.inputTextValue.length,"p-inputwrapper-focus":this.focused}]},inputFieldClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown,"p-disabled":this.$attrs.disabled}]},multiContainerClass(){return["p-autocomplete-multiple-container p-component p-inputtext",{"p-disabled":this.$attrs.disabled,"p-focus":this.focused}]},panelStyleClass(){return["p-autocomplete-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},inputValue(){if(this.modelValue){if(this.field&&"object"==typeof this.modelValue){const e=t.resolveFieldData(this.modelValue,this.field);return null!=e?e:this.modelValue}return this.modelValue}return""},listId:()=>n()+"_list",appendDisabled(){return"self"===this.appendTo},appendTarget(){return this.appendDisabled?null:this.appendTo},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:s,VirtualScroller:a},directives:{ripple:r}};const L={class:"p-autocomplete-token-label"},$={class:"p-autocomplete-input-token"},S={key:2,class:"p-autocomplete-loader pi pi-spinner pi-spin"},D={class:"p-autocomplete-item-group"};!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-autocomplete {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n}\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-autocomplete-dd .p-autocomplete-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n.p-autocomplete-dd .p-autocomplete-input,\n.p-autocomplete-dd .p-autocomplete-multiple-container {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-autocomplete-dd .p-autocomplete-dropdown {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0px;\n}\n.p-autocomplete .p-autocomplete-panel {\n min-width: 100%;\n}\n.p-autocomplete-panel {\n position: absolute;\n overflow: auto;\n top: 0;\n left: 0;\n}\n.p-autocomplete-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-autocomplete-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-autocomplete-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\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 -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n.p-autocomplete-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-autocomplete-token-icon {\n cursor: pointer;\n}\n.p-autocomplete-input-token {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-autocomplete-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-autocomplete {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-autocomplete-dd .p-autocomplete-input {\n width: 1%;\n}\n"),I.render=function(e,t,i,l,n,o){const s=u("Button"),r=u("VirtualScroller"),a=p("ripple");return d(),h("span",{ref:"container",class:o.containerClass,"aria-haspopup":"listbox","aria-owns":o.listId,"aria-expanded":n.overlayVisible,style:i.style},[i.multiple?m("",!0):(d(),h("input",c({key:0,ref:"input",class:o.inputFieldClass,style:i.inputStyle},e.$attrs,{value:o.inputValue,onClick:t[1]||(t[1]=(...e)=>o.onInputClicked&&o.onInputClicked(...e)),onInput:t[2]||(t[2]=(...e)=>o.onInput&&o.onInput(...e)),onFocus:t[3]||(t[3]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[4]||(t[4]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[5]||(t[5]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),onChange:t[6]||(t[6]=(...e)=>o.onChange&&o.onChange(...e)),type:"text",autoComplete:"off",role:"searchbox","aria-autocomplete":"list","aria-controls":o.listId}),null,16,["value","aria-controls"])),i.multiple?(d(),h("ul",{key:1,ref:"multiContainer",class:o.multiContainerClass,onClick:t[12]||(t[12]=(...e)=>o.onMultiContainerClick&&o.onMultiContainerClick(...e))},[(d(!0),h(g,null,f(i.modelValue,((t,i)=>(d(),h("li",{key:i,class:"p-autocomplete-token"},[v(e.$slots,"chip",{value:t},(()=>[y("span",L,b(o.getItemContent(t)),1)])),y("span",{class:"p-autocomplete-token-icon pi pi-times-circle",onClick:e=>o.removeItem(e,i)},null,8,["onClick"])])))),128)),y("li",$,[y("input",c({ref:"input",type:"text",autoComplete:"off"},e.$attrs,{onInput:t[7]||(t[7]=(...e)=>o.onInput&&o.onInput(...e)),onFocus:t[8]||(t[8]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[9]||(t[9]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[10]||(t[10]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),onChange:t[11]||(t[11]=(...e)=>o.onChange&&o.onChange(...e)),role:"searchbox","aria-autocomplete":"list","aria-controls":o.listId}),null,16,["aria-controls"])])],2)):m("",!0),n.searching?(d(),h("i",S)):m("",!0),i.dropdown?(d(),h(s,{key:3,ref:"dropdownButton",type:"button",icon:"pi pi-chevron-down",class:"p-autocomplete-dropdown",disabled:e.$attrs.disabled,onClick:o.onDropdownClick},null,8,["disabled","onClick"])):m("",!0),(d(),h(C,{to:o.appendTarget,disabled:o.appendDisabled},[y(k,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:x((()=>[n.overlayVisible?(d(),h("div",{key:0,ref:o.overlayRef,class:o.panelStyleClass,style:{"max-height":o.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e))},[v(e.$slots,"header",{value:i.modelValue,suggestions:i.suggestions}),y(r,c({ref:o.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:i.suggestions,disabled:o.virtualScrollerDisabled}),w({content:x((({styleClass:t,contentRef:l,items:n,getItemOptions:s})=>[y("ul",{id:o.listId,ref:e=>o.listRef(e,l),class:["p-autocomplete-items",t],role:"listbox"},[i.optionGroupLabel?(d(!0),h(g,{key:1},f(n,((t,i)=>(d(),h(g,{key:o.getOptionGroupRenderKey(t)},[y("li",D,[v(e.$slots,"optiongroup",{item:t,index:o.getOptionIndex(i,s)},(()=>[V(b(o.getOptionGroupLabel(t)),1)]))]),(d(!0),h(g,null,f(o.getOptionGroupChildren(t),((t,l)=>O((d(),h("li",{class:"p-autocomplete-item",key:l,onClick:e=>o.selectItem(e,t),role:"option","data-group":i,"data-index":o.getOptionIndex(l,s)},[v(e.$slots,"item",{item:t,index:o.getOptionIndex(l,s)},(()=>[V(b(o.getItemContent(t)),1)]))],8,["onClick","data-group","data-index"])),[[a]]))),128))],64)))),128)):(d(!0),h(g,{key:0},f(n,((t,i)=>O((d(),h("li",{class:"p-autocomplete-item",key:o.getOptionRenderKey(t),onClick:e=>o.selectItem(e,t),role:"option","data-index":o.getOptionIndex(i,s)},[v(e.$slots,"item",{item:t,index:o.getOptionIndex(i,s)},(()=>[V(b(o.getItemContent(t)),1)]))],8,["onClick","data-index"])),[[a]]))),128))],10,["id"])])),_:2},[e.$slots.loader?{name:"loader",fn:x((({options:t})=>[v(e.$slots,"loader",{options:t})]))}:void 0]),1040,["style","items","disabled"]),v(e.$slots,"footer",{value:i.modelValue,suggestions:i.suggestions})],6)):m("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],14,["aria-owns","aria-expanded"])};export{I as default};
|
|
1
|
+
import{ZIndexUtils as e,ObjectUtils as t,DomHandler as i,ConnectedOverlayScrollHandler as l,UniqueComponentId as n}from"primevue/utils";import o from"primevue/overlayeventbus";import s from"primevue/button";import r from"primevue/ripple";import a from"primevue/virtualscroller";import{resolveComponent as u,resolveDirective as p,openBlock as d,createBlock as h,mergeProps as c,createCommentVNode as m,Fragment as g,renderList as f,renderSlot as v,createVNode as y,toDisplayString as b,Teleport as C,Transition as k,withCtx as x,createSlots as w,withDirectives as O,createTextVNode as V}from"vue";var I={name:"AutoComplete",inheritAttrs:!1,emits:["update:modelValue","item-select","item-unselect","dropdown-click","clear","complete"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},dropdown:{type:Boolean,default:!1},dropdownMode:{type:String,default:"blank"},autoHighlight:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},minLength:{type:Number,default:1},delay:{type:Number,default:300},appendTo:{type:String,default:"body"},forceSelection:{type:Boolean,default:!1},completeOnFocus:{type:Boolean,default:!1},inputClass:null,inputStyle:null,class:null,style:null,panelClass:null,virtualScrollerOptions:{type:Object,default:null}},timeout:null,outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,data:()=>({searching:!1,focused:!1,overlayVisible:!1,inputTextValue:null,highlightItem:null}),watch:{suggestions(){this.searching&&(this.suggestions&&this.suggestions.length?this.showOverlay():this.hideOverlay(),this.searching=!1)}},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.clear(this.overlay),this.overlay=null)},updated(){this.overlayVisible&&this.alignOverlay()},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionRenderKey(e){return this.getItemContent(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)},onOverlayEnter(t){e.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoHighlight&&this.suggestions&&this.suggestions.length&&i.addClass(this.list.firstElementChild,"p-highlight")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave(t){e.clear(t)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.input;this.appendDisabled?i.relativePosition(this.overlay,e):(this.overlay.style.minWidth=i.getOuterWidth(e)+"px",i.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&this.isOutsideClicked(e)&&this.hideOverlay()},document.addEventListener("click",this.outsideClickListener))},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new l(this.$refs.container,(()=>{this.overlayVisible&&this.hideOverlay()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&this.hideOverlay()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.input},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},selectItem(e,t){if(this.multiple){if(this.$refs.input.value="",this.inputTextValue="",!this.isSelected(t)){let e=this.modelValue?[...this.modelValue,t]:[t];this.$emit("update:modelValue",e)}}else this.$emit("update:modelValue",t);this.$emit("item-select",{originalEvent:e,value:t}),this.focus(),this.hideOverlay()},onMultiContainerClick(e){this.focus(),this.completeOnFocus&&this.search(e,"","click")},removeItem(e,t){let i=this.modelValue[t],l=this.modelValue.filter(((e,i)=>t!==i));this.$emit("update:modelValue",l),this.$emit("item-unselect",{originalEvent:e,value:i})},onDropdownClick(e){this.focus();const t=this.$refs.input.value;"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown"),this.$emit("dropdown-click",{originalEvent:e,query:t})},getItemContent(e){return this.field?t.resolveFieldData(e,this.field):e},showOverlay(){this.overlayVisible=!0},hideOverlay(){this.overlayVisible=!1},focus(){this.$refs.input.focus()},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},onInputClicked(e){this.completeOnFocus&&this.search(e,"","click")},onInput(e){this.inputTextValue=e.target.value,this.timeout&&clearTimeout(this.timeout);let t=e.target.value;this.multiple||this.$emit("update:modelValue",t),0===t.length?(this.hideOverlay(),this.$emit("clear")):t.length>=this.minLength?this.timeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay):this.hideOverlay()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onKeyDown(e){if(this.overlayVisible){let t=i.findSingle(this.list,"li.p-highlight");switch(e.which){case 40:if(t){let e=this.findNextItem(t);e&&(i.addClass(e,"p-highlight"),i.removeClass(t,"p-highlight"),e.scrollIntoView({block:"nearest",inline:"start"}))}else t=this.list.firstElementChild,i.hasClass(t,"p-autocomplete-item-group")&&(t=this.findNextItem(t)),t&&i.addClass(t,"p-highlight");e.preventDefault();break;case 38:if(t){let e=this.findPrevItem(t);e&&(i.addClass(e,"p-highlight"),i.removeClass(t,"p-highlight"),e.scrollIntoView({block:"nearest",inline:"start"}))}e.preventDefault();break;case 13:t&&(this.selectHighlightItem(e,t),this.hideOverlay()),e.preventDefault();break;case 27:this.hideOverlay(),e.preventDefault();break;case 9:t&&this.selectHighlightItem(e,t),this.hideOverlay()}}if(this.multiple&&8===e.which)if(this.modelValue&&this.modelValue.length&&!this.$refs.input.value){let t=this.modelValue[this.modelValue.length-1],i=this.modelValue.slice(0,-1);this.$emit("update:modelValue",i),this.$emit("item-unselect",{originalEvent:e,value:t})}},selectHighlightItem(e,t){if(this.optionGroupLabel){let i=this.suggestions[t.dataset.group];this.selectItem(e,this.getOptionGroupChildren(i)[t.dataset.index])}else this.selectItem(e,this.suggestions[t.dataset.index])},findNextItem(e){let t=e.nextElementSibling;return t?i.hasClass(t,"p-autocomplete-item-group")?this.findNextItem(t):t:null},findPrevItem(e){let t=e.previousElementSibling;return t?i.hasClass(t,"p-autocomplete-item-group")?this.findPrevItem(t):t:null},onChange(e){if(this.forceSelection){let i=!1,l=e.target.value.trim();if(this.suggestions)for(let n of this.suggestions){let o=this.field?t.resolveFieldData(n,this.field):n;if(o&&l===o.trim()){i=!0,this.selectItem(e,n);break}}i||(this.$refs.input.value="",this.inputTextValue="",this.$emit("clear"),this.multiple||this.$emit("update:modelValue",null))}},isSelected(e){let i=!1;if(this.modelValue&&this.modelValue.length)for(let l=0;l<this.modelValue.length;l++)if(t.equals(this.modelValue[l],e)){i=!0;break}return i},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e},onOverlayClick(e){o.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{containerClass(){return["p-autocomplete p-component p-inputwrapper",this.class,{"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||this.inputTextValue&&this.inputTextValue.length,"p-inputwrapper-focus":this.focused}]},inputFieldClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown,"p-disabled":this.$attrs.disabled}]},multiContainerClass(){return["p-autocomplete-multiple-container p-component p-inputtext",{"p-disabled":this.$attrs.disabled,"p-focus":this.focused}]},panelStyleClass(){return["p-autocomplete-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},inputValue(){if(this.modelValue){if(this.field&&"object"==typeof this.modelValue){const e=t.resolveFieldData(this.modelValue,this.field);return null!=e?e:this.modelValue}return this.modelValue}return""},listId:()=>n()+"_list",appendDisabled(){return"self"===this.appendTo},appendTarget(){return this.appendDisabled?null:this.appendTo},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:s,VirtualScroller:a},directives:{ripple:r}};const L={class:"p-autocomplete-token-label"},$={class:"p-autocomplete-input-token"},S={key:2,class:"p-autocomplete-loader pi pi-spinner pi-spin"},D={class:"p-autocomplete-item-group"};!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-autocomplete {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n}\n.p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-autocomplete-dd .p-autocomplete-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n width: 1%;\n}\n.p-autocomplete-dd .p-autocomplete-input,\n.p-autocomplete-dd .p-autocomplete-multiple-container {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-autocomplete-dd .p-autocomplete-dropdown {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0px;\n}\n.p-autocomplete .p-autocomplete-panel {\n min-width: 100%;\n}\n.p-autocomplete-panel {\n position: absolute;\n overflow: auto;\n top: 0;\n left: 0;\n}\n.p-autocomplete-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-autocomplete-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-autocomplete-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\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 -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n.p-autocomplete-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-autocomplete-token-icon {\n cursor: pointer;\n}\n.p-autocomplete-input-token {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-autocomplete-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-autocomplete {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.p-fluid .p-autocomplete-dd .p-autocomplete-input {\n width: 1%;\n}\n"),I.render=function(e,t,i,l,n,o){const s=u("Button"),r=u("VirtualScroller"),a=p("ripple");return d(),h("span",{ref:"container",class:o.containerClass,"aria-haspopup":"listbox","aria-owns":o.listId,"aria-expanded":n.overlayVisible,style:i.style},[i.multiple?m("",!0):(d(),h("input",c({key:0,ref:"input",class:o.inputFieldClass,style:i.inputStyle},e.$attrs,{value:o.inputValue,onClick:t[1]||(t[1]=(...e)=>o.onInputClicked&&o.onInputClicked(...e)),onInput:t[2]||(t[2]=(...e)=>o.onInput&&o.onInput(...e)),onFocus:t[3]||(t[3]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[4]||(t[4]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[5]||(t[5]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),onChange:t[6]||(t[6]=(...e)=>o.onChange&&o.onChange(...e)),type:"text",autoComplete:"off",role:"searchbox","aria-autocomplete":"list","aria-controls":o.listId}),null,16,["value","aria-controls"])),i.multiple?(d(),h("ul",{key:1,ref:"multiContainer",class:o.multiContainerClass,onClick:t[12]||(t[12]=(...e)=>o.onMultiContainerClick&&o.onMultiContainerClick(...e))},[(d(!0),h(g,null,f(i.modelValue,((t,i)=>(d(),h("li",{key:i,class:"p-autocomplete-token"},[v(e.$slots,"chip",{value:t},(()=>[y("span",L,b(o.getItemContent(t)),1)])),y("span",{class:"p-autocomplete-token-icon pi pi-times-circle",onClick:e=>o.removeItem(e,i)},null,8,["onClick"])])))),128)),y("li",$,[y("input",c({ref:"input",type:"text",autoComplete:"off"},e.$attrs,{onInput:t[7]||(t[7]=(...e)=>o.onInput&&o.onInput(...e)),onFocus:t[8]||(t[8]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[9]||(t[9]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[10]||(t[10]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),onChange:t[11]||(t[11]=(...e)=>o.onChange&&o.onChange(...e)),role:"searchbox","aria-autocomplete":"list","aria-controls":o.listId}),null,16,["aria-controls"])])],2)):m("",!0),n.searching?(d(),h("i",S)):m("",!0),i.dropdown?(d(),h(s,{key:3,ref:"dropdownButton",type:"button",icon:"pi pi-chevron-down",class:"p-autocomplete-dropdown",disabled:e.$attrs.disabled,onClick:o.onDropdownClick},null,8,["disabled","onClick"])):m("",!0),(d(),h(C,{to:o.appendTarget,disabled:o.appendDisabled},[y(k,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:x((()=>[n.overlayVisible?(d(),h("div",{key:0,ref:o.overlayRef,class:o.panelStyleClass,style:{"max-height":o.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e))},[v(e.$slots,"header",{value:i.modelValue,suggestions:i.suggestions}),y(r,c({ref:o.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:i.suggestions,disabled:o.virtualScrollerDisabled}),w({content:x((({styleClass:t,contentRef:l,items:n,getItemOptions:s,contentStyle:r})=>[y("ul",{id:o.listId,ref:e=>o.listRef(e,l),class:["p-autocomplete-items",t],style:r,role:"listbox"},[i.optionGroupLabel?(d(!0),h(g,{key:1},f(n,((t,i)=>(d(),h(g,{key:o.getOptionGroupRenderKey(t)},[y("li",D,[v(e.$slots,"optiongroup",{item:t,index:o.getOptionIndex(i,s)},(()=>[V(b(o.getOptionGroupLabel(t)),1)]))]),(d(!0),h(g,null,f(o.getOptionGroupChildren(t),((t,l)=>O((d(),h("li",{class:"p-autocomplete-item",key:l,onClick:e=>o.selectItem(e,t),role:"option","data-group":i,"data-index":o.getOptionIndex(l,s)},[v(e.$slots,"item",{item:t,index:o.getOptionIndex(l,s)},(()=>[V(b(o.getItemContent(t)),1)]))],8,["onClick","data-group","data-index"])),[[a]]))),128))],64)))),128)):(d(!0),h(g,{key:0},f(n,((t,i)=>O((d(),h("li",{class:"p-autocomplete-item",key:o.getOptionRenderKey(t),onClick:e=>o.selectItem(e,t),role:"option","data-index":o.getOptionIndex(i,s)},[v(e.$slots,"item",{item:t,index:o.getOptionIndex(i,s)},(()=>[V(b(o.getItemContent(t)),1)]))],8,["onClick","data-index"])),[[a]]))),128))],14,["id"])])),_:2},[e.$slots.loader?{name:"loader",fn:x((({options:t})=>[v(e.$slots,"loader",{options:t})]))}:void 0]),1040,["style","items","disabled"]),v(e.$slots,"footer",{value:i.modelValue,suggestions:i.suggestions})],6)):m("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"]))],14,["aria-owns","aria-expanded"])};export default I;
|