primevue 3.19.0 → 3.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/Api.d.ts +22 -0
- package/autocomplete/AutoComplete.d.ts +5 -1
- package/autocomplete/AutoComplete.vue +9 -5
- package/autocomplete/autocomplete.cjs.js +10 -6
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +10 -6
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +10 -6
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +8 -0
- package/avatar/Avatar.vue +9 -1
- package/avatar/avatar.cjs.js +17 -6
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +17 -6
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +17 -6
- package/avatar/avatar.min.js +1 -1
- package/blockui/BlockUI.vue +8 -1
- package/blockui/blockui.cjs.js +14 -4
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +15 -5
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +14 -4
- package/blockui/blockui.min.js +1 -1
- package/calendar/Calendar.vue +5 -0
- package/calendar/calendar.cjs.js +5 -0
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +5 -0
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +5 -0
- package/calendar/calendar.min.js +1 -1
- package/carousel/Carousel.d.ts +9 -1
- package/carousel/Carousel.vue +131 -9
- package/carousel/carousel.cjs.js +142 -29
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +143 -30
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +143 -30
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.vue +4 -4
- package/cascadeselect/cascadeselect.cjs.js +3 -3
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +3 -3
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +3 -3
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/Chart.d.ts +5 -0
- package/chart/Chart.vue +5 -1
- package/chart/chart.cjs.js +6 -2
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +7 -3
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +6 -2
- package/chart/chart.min.js +1 -1
- package/chip/Chip.vue +7 -2
- package/chip/chip.cjs.js +14 -7
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.esm.js +15 -8
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +14 -7
- package/chip/chip.min.js +1 -1
- package/colorpicker/ColorPicker.vue +5 -7
- package/colorpicker/colorpicker.cjs.js +5 -7
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +5 -7
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +6 -8
- package/colorpicker/colorpicker.min.js +1 -1
- package/config/PrimeVue.d.ts +38 -0
- package/config/config.cjs.js +39 -1
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +39 -1
- package/config/config.esm.min.js +1 -1
- package/config/config.js +39 -1
- package/config/config.min.js +1 -1
- package/core/core.js +453 -198
- package/core/core.min.js +12 -12
- package/datatable/BodyCell.vue +39 -14
- package/datatable/ColumnFilter.vue +67 -41
- package/datatable/DataTable.d.ts +9 -1
- package/datatable/DataTable.vue +162 -25
- package/datatable/HeaderCell.vue +12 -6
- package/datatable/HeaderCheckbox.vue +17 -14
- package/datatable/RowCheckbox.vue +28 -13
- package/datatable/RowRadioButton.vue +11 -3
- package/datatable/TableBody.vue +25 -7
- package/datatable/TableFooter.vue +1 -1
- package/datatable/TableHeader.vue +9 -3
- package/datatable/TableLoadingBody.vue +1 -1
- package/datatable/datatable.cjs.js +539 -268
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +538 -268
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +538 -268
- package/datatable/datatable.min.js +1 -1
- package/dataviewlayoutoptions/DataViewLayoutOptions.vue +23 -3
- package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.js +40 -11
- package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.min.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.esm.js +40 -11
- package/dataviewlayoutoptions/dataviewlayoutoptions.esm.min.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.js +40 -11
- package/dataviewlayoutoptions/dataviewlayoutoptions.min.js +1 -1
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.vue +12 -7
- package/dialog/dialog.cjs.js +14 -9
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +14 -9
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +14 -9
- package/dialog/dialog.min.js +1 -1
- package/dropdown/Dropdown.vue +13 -16
- package/dropdown/dropdown.cjs.js +13 -16
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +13 -16
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +13 -16
- package/dropdown/dropdown.min.js +1 -1
- package/fieldset/Fieldset.d.ts +1 -1
- package/fieldset/Fieldset.vue +21 -3
- package/fieldset/fieldset.cjs.js +12 -6
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +13 -7
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +13 -7
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/FileUpload.d.ts +51 -1
- package/fileupload/FileUpload.vue +2 -2
- package/fileupload/fileupload.cjs.js +2 -2
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +2 -2
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +2 -2
- package/fileupload/fileupload.min.js +1 -1
- package/focustrap/focustrap.cjs.js +86 -64
- package/focustrap/focustrap.cjs.min.js +1 -1
- package/focustrap/focustrap.esm.js +85 -63
- package/focustrap/focustrap.esm.min.js +1 -1
- package/focustrap/focustrap.js +86 -64
- package/focustrap/focustrap.min.js +1 -1
- package/galleria/Galleria.d.ts +15 -3
- package/galleria/Galleria.vue +36 -6
- package/galleria/GalleriaContent.vue +11 -7
- package/galleria/GalleriaItem.vue +36 -6
- package/galleria/GalleriaThumbnails.vue +108 -4
- package/galleria/galleria.cjs.js +258 -122
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +257 -122
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +258 -123
- package/galleria/galleria.min.js +1 -1
- package/image/Image.vue +71 -13
- package/image/image.cjs.js +112 -39
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +112 -40
- package/image/image.esm.min.js +1 -1
- package/image/image.js +112 -40
- package/image/image.min.js +1 -1
- package/inplace/Inplace.d.ts +9 -1
- package/inplace/Inplace.vue +17 -3
- package/inplace/inplace.cjs.js +25 -7
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +26 -8
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +25 -7
- package/inplace/inplace.min.js +1 -1
- package/inputnumber/InputNumber.vue +11 -20
- package/inputnumber/inputnumber.cjs.js +11 -20
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +11 -20
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +11 -20
- package/inputnumber/inputnumber.min.js +1 -1
- package/listbox/Listbox.vue +7 -7
- package/listbox/listbox.cjs.js +7 -7
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +7 -7
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +8 -8
- package/listbox/listbox.min.js +1 -1
- package/megamenu/MegaMenu.vue +10 -1
- package/megamenu/megamenu.cjs.js +10 -1
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +10 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +10 -1
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.vue +8 -2
- package/menu/menu.cjs.js +8 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +8 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +8 -2
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.vue +7 -2
- package/menubar/menubar.cjs.js +7 -2
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +7 -2
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +7 -2
- package/menubar/menubar.min.js +1 -1
- package/message/Message.d.ts +5 -1
- package/message/Message.vue +9 -2
- package/message/message.cjs.js +17 -6
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +18 -7
- package/message/message.esm.min.js +1 -1
- package/message/message.js +17 -6
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.vue +33 -32
- package/multiselect/multiselect.cjs.js +33 -32
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +34 -33
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +33 -32
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/OrderList.d.ts +33 -1
- package/orderlist/OrderList.vue +258 -63
- package/orderlist/orderlist.cjs.js +270 -68
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +271 -69
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +271 -69
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/OrganizationChartNode.vue +7 -1
- package/organizationchart/organizationchart.cjs.js +7 -1
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +8 -2
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +7 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/OverlayPanel.d.ts +0 -5
- package/overlaypanel/OverlayPanel.vue +4 -5
- package/overlaypanel/overlaypanel.cjs.js +4 -5
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +4 -5
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +4 -5
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/CurrentPageReport.vue +0 -1
- package/paginator/JumpToPageDropdown.vue +0 -1
- package/paginator/JumpToPageInput.vue +6 -1
- package/paginator/PageLinks.vue +16 -1
- package/paginator/Paginator.vue +23 -10
- package/paginator/RowsPerPageDropdown.vue +0 -1
- package/paginator/paginator.cjs.js +35 -15
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +35 -15
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +35 -15
- package/paginator/paginator.min.js +1 -1
- package/panel/Panel.d.ts +2 -2
- package/panel/Panel.vue +10 -3
- package/panel/panel.cjs.js +12 -6
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +13 -7
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +13 -7
- package/panel/panel.min.js +1 -1
- package/panelmenu/PanelMenuList.vue +57 -0
- package/panelmenu/panelmenu.cjs.js +70 -0
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +70 -0
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +70 -0
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/Password.vue +5 -0
- package/password/password.cjs.js +1 -1
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +1 -1
- package/password/password.esm.min.js +1 -1
- package/password/password.js +1 -1
- package/password/password.min.js +1 -1
- package/picklist/PickList.d.ts +45 -1
- package/picklist/PickList.vue +296 -58
- package/picklist/picklist.cjs.js +340 -88
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +341 -89
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +341 -89
- package/picklist/picklist.min.js +1 -1
- package/progressspinner/ProgressSpinner.vue +1 -1
- package/progressspinner/progressspinner.cjs.js +1 -2
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +1 -2
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +1 -2
- package/progressspinner/progressspinner.min.js +1 -1
- package/resources/primevue.css +2 -6
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +31 -13
- package/resources/themes/arya-green/theme.css +31 -13
- package/resources/themes/arya-orange/theme.css +31 -13
- package/resources/themes/arya-purple/theme.css +31 -13
- package/resources/themes/bootstrap4-dark-blue/theme.css +31 -13
- package/resources/themes/bootstrap4-dark-purple/theme.css +31 -13
- package/resources/themes/bootstrap4-light-blue/theme.css +31 -13
- package/resources/themes/bootstrap4-light-purple/theme.css +31 -13
- package/resources/themes/fluent-light/theme.css +31 -13
- package/resources/themes/lara-dark-blue/theme.css +35 -13
- package/resources/themes/lara-dark-indigo/theme.css +35 -13
- package/resources/themes/lara-dark-purple/theme.css +35 -13
- package/resources/themes/lara-dark-teal/theme.css +35 -13
- package/resources/themes/lara-light-blue/theme.css +35 -13
- package/resources/themes/lara-light-indigo/theme.css +35 -13
- package/resources/themes/lara-light-purple/theme.css +35 -13
- package/resources/themes/lara-light-teal/theme.css +35 -13
- package/resources/themes/luna-amber/theme.css +31 -13
- package/resources/themes/luna-blue/theme.css +31 -13
- package/resources/themes/luna-green/theme.css +31 -13
- package/resources/themes/luna-pink/theme.css +31 -13
- package/resources/themes/md-dark-deeppurple/theme.css +55 -19
- package/resources/themes/md-dark-indigo/theme.css +55 -19
- package/resources/themes/md-light-deeppurple/theme.css +55 -19
- package/resources/themes/md-light-indigo/theme.css +55 -19
- package/resources/themes/mdc-dark-deeppurple/theme.css +55 -19
- package/resources/themes/mdc-dark-indigo/theme.css +55 -19
- package/resources/themes/mdc-light-deeppurple/theme.css +55 -19
- package/resources/themes/mdc-light-indigo/theme.css +55 -19
- package/resources/themes/nova/theme.css +31 -13
- package/resources/themes/nova-accent/theme.css +31 -13
- package/resources/themes/nova-alt/theme.css +31 -13
- package/resources/themes/nova-vue/theme.css +31 -13
- package/resources/themes/rhea/theme.css +31 -13
- package/resources/themes/saga-blue/theme.css +31 -13
- package/resources/themes/saga-green/theme.css +31 -13
- package/resources/themes/saga-orange/theme.css +31 -13
- package/resources/themes/saga-purple/theme.css +31 -13
- package/resources/themes/tailwind-light/theme.css +35 -13
- package/resources/themes/vela-blue/theme.css +31 -13
- package/resources/themes/vela-green/theme.css +31 -13
- package/resources/themes/vela-orange/theme.css +31 -13
- package/resources/themes/vela-purple/theme.css +31 -13
- package/ripple/ripple.cjs.js +1 -0
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +1 -0
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +1 -0
- package/ripple/ripple.min.js +1 -1
- package/scrolltop/ScrollTop.vue +4 -1
- package/scrolltop/scrolltop.cjs.js +8 -2
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.esm.js +8 -2
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +8 -2
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/SelectButton.vue +1 -1
- package/selectbutton/selectbutton.cjs.js +1 -1
- package/selectbutton/selectbutton.cjs.min.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/selectbutton/selectbutton.min.js +1 -1
- package/skeleton/Skeleton.vue +1 -1
- package/skeleton/skeleton.cjs.js +2 -1
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +2 -1
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +2 -1
- package/skeleton/skeleton.min.js +1 -1
- package/speeddial/SpeedDial.d.ts +19 -1
- package/speeddial/SpeedDial.vue +250 -7
- package/speeddial/speeddial.cjs.js +254 -13
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +255 -14
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +254 -13
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +16 -4
- package/splitbutton/SplitButton.vue +49 -8
- package/splitbutton/splitbutton.cjs.js +49 -16
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +49 -16
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +49 -16
- package/splitbutton/splitbutton.min.js +1 -1
- package/tabmenu/TabMenu.vue +2 -14
- package/tabmenu/tabmenu.cjs.js +12 -11
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +12 -11
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +12 -11
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/TabView.vue +8 -2
- package/tabview/tabview.cjs.js +8 -2
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +8 -2
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +8 -2
- package/tabview/tabview.min.js +1 -1
- package/terminal/Terminal.vue +2 -2
- package/terminal/terminal.cjs.js +5 -2
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +5 -2
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +5 -2
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/TieredMenu.vue +13 -3
- package/tieredmenu/tieredmenu.cjs.js +13 -3
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +13 -3
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +13 -3
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/Toast.d.ts +5 -1
- package/toast/Toast.vue +5 -0
- package/toast/ToastMessage.vue +36 -8
- package/toast/toast.cjs.js +48 -12
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +49 -13
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +48 -12
- package/toast/toast.min.js +1 -1
- package/toolbar/Toolbar.d.ts +6 -0
- package/toolbar/Toolbar.vue +12 -2
- package/toolbar/toolbar.cjs.js +7 -3
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +7 -3
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +7 -3
- package/toolbar/toolbar.min.js +1 -1
- package/tree/Tree.d.ts +8 -0
- package/tree/Tree.vue +10 -2
- package/tree/TreeNode.vue +174 -37
- package/tree/tree.cjs.js +192 -58
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +192 -58
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +192 -58
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.vue +40 -26
- package/treeselect/treeselect.cjs.js +45 -29
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +43 -27
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +44 -28
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/BodyCell.vue +4 -4
- package/treetable/HeaderCell.vue +4 -2
- package/treetable/TreeTable.d.ts +4 -0
- package/treetable/TreeTable.vue +43 -17
- package/treetable/TreeTableRow.vue +200 -59
- package/treetable/treetable.cjs.js +797 -620
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +794 -617
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +794 -617
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.cjs.js +26 -6
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +26 -6
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +26 -6
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +174 -10
- package/vetur-tags.json +58 -17
- package/web-types.json +465 -19
- package/galleria/GalleriaItemSlot.vue +0 -53
package/api/Api.d.ts
CHANGED
|
@@ -76,16 +76,19 @@ export interface PrimeIconsOptions {
|
|
|
76
76
|
readonly ARROW_DOWN_RIGHT: string;
|
|
77
77
|
readonly ARROW_LEFT: string;
|
|
78
78
|
readonly ARROW_RIGHT: string;
|
|
79
|
+
readonly ARROW_RIGHT_ARROW_LEFT: string;
|
|
79
80
|
readonly ARROW_UP: string;
|
|
80
81
|
readonly ARROW_UP_LEFT: string;
|
|
81
82
|
readonly ARROW_UP_RIGHT: string;
|
|
82
83
|
readonly ARROW_H: string;
|
|
83
84
|
readonly ARROW_V: string;
|
|
85
|
+
readonly ARROW_A: string;
|
|
84
86
|
readonly AT: string;
|
|
85
87
|
readonly BACKWARD: string;
|
|
86
88
|
readonly BAN: string;
|
|
87
89
|
readonly BARS: string;
|
|
88
90
|
readonly BELL: string;
|
|
91
|
+
readonly BITCOIN: string;
|
|
89
92
|
readonly BOLT: string;
|
|
90
93
|
readonly BOOK: string;
|
|
91
94
|
readonly BOOKMARK: string;
|
|
@@ -97,12 +100,14 @@ export interface PrimeIconsOptions {
|
|
|
97
100
|
readonly CALENDAR_MINUS: string;
|
|
98
101
|
readonly CALENDAR_PLUS: string;
|
|
99
102
|
readonly CALENDAR_TIMES: string;
|
|
103
|
+
readonly CALCULATOR: string;
|
|
100
104
|
readonly CAMERA: string;
|
|
101
105
|
readonly CAR: string;
|
|
102
106
|
readonly CARET_DOWN: string;
|
|
103
107
|
readonly CARET_LEFT: string;
|
|
104
108
|
readonly CARET_RIGHT: string;
|
|
105
109
|
readonly CARET_UP: string;
|
|
110
|
+
readonly CART_PLUS: string;
|
|
106
111
|
readonly CHART_BAR: string;
|
|
107
112
|
readonly CHART_LINE: string;
|
|
108
113
|
readonly CHART_PIE: string;
|
|
@@ -132,6 +137,7 @@ export interface PrimeIconsOptions {
|
|
|
132
137
|
readonly COPY: string;
|
|
133
138
|
readonly CREDIT_CARD: string;
|
|
134
139
|
readonly DATABASE: string;
|
|
140
|
+
readonly DELETELEFT: string;
|
|
135
141
|
readonly DESKTOP: string;
|
|
136
142
|
readonly DIRECTIONS: string;
|
|
137
143
|
readonly DIRECTIONS_ALT: string;
|
|
@@ -142,6 +148,7 @@ export interface PrimeIconsOptions {
|
|
|
142
148
|
readonly ELLIPSIS_H: string;
|
|
143
149
|
readonly ELLIPSIS_V: string;
|
|
144
150
|
readonly ENVELOPE: string;
|
|
151
|
+
readonly ERASER: string;
|
|
145
152
|
readonly EURO: string;
|
|
146
153
|
readonly EXCLAMATION_CIRCLE: string;
|
|
147
154
|
readonly EXCLAMATION_TRIANGLE: string;
|
|
@@ -152,8 +159,12 @@ export interface PrimeIconsOptions {
|
|
|
152
159
|
readonly FAST_BACKWARD: string;
|
|
153
160
|
readonly FAST_FORWARD: string;
|
|
154
161
|
readonly FILE: string;
|
|
162
|
+
readonly FILE_EDIT: string;
|
|
155
163
|
readonly FILE_EXCEL: string;
|
|
164
|
+
readonly FILE_EXPORT: string;
|
|
165
|
+
readonly FILE_IMPORT: string;
|
|
156
166
|
readonly FILE_PDF: string;
|
|
167
|
+
readonly FILE_WORD: string;
|
|
157
168
|
readonly FILTER: string;
|
|
158
169
|
readonly FILTER_FILL: string;
|
|
159
170
|
readonly FILTER_SLASH: string;
|
|
@@ -162,6 +173,7 @@ export interface PrimeIconsOptions {
|
|
|
162
173
|
readonly FOLDER: string;
|
|
163
174
|
readonly FOLDER_OPEN: string;
|
|
164
175
|
readonly FORWARD: string;
|
|
176
|
+
readonly GIFT: string;
|
|
165
177
|
readonly GITHUB: string;
|
|
166
178
|
readonly GLOBE: string;
|
|
167
179
|
readonly GOOGLE: string;
|
|
@@ -169,6 +181,7 @@ export interface PrimeIconsOptions {
|
|
|
169
181
|
readonly HEART: string;
|
|
170
182
|
readonly HEART_FILL: string;
|
|
171
183
|
readonly HISTORY: string;
|
|
184
|
+
readonly HOURGLASS: string;
|
|
172
185
|
readonly HOME: string;
|
|
173
186
|
readonly ID_CARD: string;
|
|
174
187
|
readonly IMAGE: string;
|
|
@@ -178,6 +191,7 @@ export interface PrimeIconsOptions {
|
|
|
178
191
|
readonly INFO_CIRCLE: string;
|
|
179
192
|
readonly INSTAGRAM: string;
|
|
180
193
|
readonly KEY: string;
|
|
194
|
+
readonly LANGUAGE: string;
|
|
181
195
|
readonly LINK: string;
|
|
182
196
|
readonly LINKEDIN: string;
|
|
183
197
|
readonly LIST: string;
|
|
@@ -185,6 +199,8 @@ export interface PrimeIconsOptions {
|
|
|
185
199
|
readonly LOCK_OPEN: string;
|
|
186
200
|
readonly MAP: string;
|
|
187
201
|
readonly MAP_MARKER: string;
|
|
202
|
+
readonly MEGAPHONE: string;
|
|
203
|
+
readonly MICREPHONE: string;
|
|
188
204
|
readonly MICROSOFT: string;
|
|
189
205
|
readonly MINUS: string;
|
|
190
206
|
readonly MINUS_CIRCLE: string;
|
|
@@ -253,6 +269,7 @@ export interface PrimeIconsOptions {
|
|
|
253
269
|
readonly STEP_FORWARD: string;
|
|
254
270
|
readonly STEP_FORWARD_ALT: string;
|
|
255
271
|
readonly STOP: string;
|
|
272
|
+
readonly STOPWATCH: string;
|
|
256
273
|
readonly STOP_CIRCLE: string;
|
|
257
274
|
readonly SUN: string;
|
|
258
275
|
readonly SYNC: string;
|
|
@@ -263,11 +280,14 @@ export interface PrimeIconsOptions {
|
|
|
263
280
|
readonly TELEGRAM: string;
|
|
264
281
|
readonly TH_LARGE: string;
|
|
265
282
|
readonly THUMBS_DOWN: string;
|
|
283
|
+
readonly THUMBS_DOWN_FILL: string;
|
|
266
284
|
readonly THUMBS_UP: string;
|
|
285
|
+
readonly THUMBS_UP_FILL: string;
|
|
267
286
|
readonly TICKET: string;
|
|
268
287
|
readonly TIMES: string;
|
|
269
288
|
readonly TIMES_CIRCLE: string;
|
|
270
289
|
readonly TRASH: string;
|
|
290
|
+
readonly TRUCK: string;
|
|
271
291
|
readonly TWITTER: string;
|
|
272
292
|
readonly UNDO: string;
|
|
273
293
|
readonly UNLOCK: string;
|
|
@@ -277,6 +297,7 @@ export interface PrimeIconsOptions {
|
|
|
277
297
|
readonly USER_MINUS: string;
|
|
278
298
|
readonly USER_PLUS: string;
|
|
279
299
|
readonly USERS: string;
|
|
300
|
+
readonly VERIFIED: string;
|
|
280
301
|
readonly VIDEO: string;
|
|
281
302
|
readonly VIMEO: string;
|
|
282
303
|
readonly VOLUME_DOWN: string;
|
|
@@ -287,6 +308,7 @@ export interface PrimeIconsOptions {
|
|
|
287
308
|
readonly WIFI: string;
|
|
288
309
|
readonly WINDOW_MAXIMIZE: string;
|
|
289
310
|
readonly WINDOW_MINIMIZE: string;
|
|
311
|
+
readonly WRENCH: string;
|
|
290
312
|
readonly YOUTUBE: string;
|
|
291
313
|
}
|
|
292
314
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, InputHTMLAttributes, VNode } from 'vue';
|
|
2
2
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
3
|
-
import {
|
|
3
|
+
import { VirtualScrollerItemOptions, VirtualScrollerProps } from '../virtualscroller';
|
|
4
4
|
|
|
5
5
|
type AutoCompleteFieldType = string | ((data: any) => string) | undefined;
|
|
6
6
|
|
|
@@ -192,6 +192,10 @@ export interface AutoCompleteProps {
|
|
|
192
192
|
* Default value is 'pi pi-chevron-down'.
|
|
193
193
|
*/
|
|
194
194
|
dropdownIcon?: string | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* Style class of the dropdown button.
|
|
197
|
+
*/
|
|
198
|
+
dropdownClass?: string | undefined;
|
|
195
199
|
/**
|
|
196
200
|
* Icon to display in loading state.
|
|
197
201
|
* Default value is 'pi pi-spinner pi-spin'.
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
</li>
|
|
85
85
|
</ul>
|
|
86
86
|
<i v-if="searching" :class="loadingIconClass" aria-hidden="true"></i>
|
|
87
|
-
<Button v-if="dropdown" ref="dropdownButton" type="button" :icon="dropdownIcon" class="p-autocomplete-dropdown" tabindex="-1" :disabled="disabled" aria-hidden="true" @click="onDropdownClick" />
|
|
87
|
+
<Button v-if="dropdown" ref="dropdownButton" type="button" :icon="dropdownIcon" :class="['p-autocomplete-dropdown', dropdownClass]" tabindex="-1" :disabled="disabled" aria-hidden="true" @click="onDropdownClick" />
|
|
88
88
|
<span role="status" aria-live="polite" class="p-hidden-accessible">
|
|
89
89
|
{{ searchResultMessageText }}
|
|
90
90
|
</span>
|
|
@@ -120,15 +120,15 @@
|
|
|
120
120
|
</li>
|
|
121
121
|
</template>
|
|
122
122
|
</ul>
|
|
123
|
-
<span role="status" aria-live="polite" class="p-hidden-accessible">
|
|
124
|
-
{{ selectedMessageText }}
|
|
125
|
-
</span>
|
|
126
123
|
</template>
|
|
127
124
|
<template v-if="$slots.loader" v-slot:loader="{ options }">
|
|
128
125
|
<slot name="loader" :options="options"></slot>
|
|
129
126
|
</template>
|
|
130
127
|
</VirtualScroller>
|
|
131
128
|
<slot name="footer" :value="modelValue" :suggestions="visibleOptions"></slot>
|
|
129
|
+
<span role="status" aria-live="polite" class="p-hidden-accessible">
|
|
130
|
+
{{ selectedMessageText }}
|
|
131
|
+
</span>
|
|
132
132
|
</div>
|
|
133
133
|
</transition>
|
|
134
134
|
</Portal>
|
|
@@ -246,6 +246,10 @@ export default {
|
|
|
246
246
|
type: String,
|
|
247
247
|
default: 'pi pi-chevron-down'
|
|
248
248
|
},
|
|
249
|
+
dropdownClass: {
|
|
250
|
+
type: String,
|
|
251
|
+
default: null
|
|
252
|
+
},
|
|
249
253
|
loadingIcon: {
|
|
250
254
|
type: String,
|
|
251
255
|
default: 'pi pi-spinner'
|
|
@@ -506,7 +510,7 @@ export default {
|
|
|
506
510
|
let valid = false;
|
|
507
511
|
|
|
508
512
|
if (this.visibleOptions) {
|
|
509
|
-
const matchedValue = this.visibleOptions.find((option) => this.isOptionMatched(option,
|
|
513
|
+
const matchedValue = this.visibleOptions.find((option) => this.isOptionMatched(option, this.$refs.focusInput.value || ''));
|
|
510
514
|
|
|
511
515
|
if (matchedValue !== undefined) {
|
|
512
516
|
valid = true;
|
|
@@ -119,6 +119,10 @@ var script = {
|
|
|
119
119
|
type: String,
|
|
120
120
|
default: 'pi pi-chevron-down'
|
|
121
121
|
},
|
|
122
|
+
dropdownClass: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: null
|
|
125
|
+
},
|
|
122
126
|
loadingIcon: {
|
|
123
127
|
type: String,
|
|
124
128
|
default: 'pi pi-spinner'
|
|
@@ -371,7 +375,7 @@ var script = {
|
|
|
371
375
|
let valid = false;
|
|
372
376
|
|
|
373
377
|
if (this.visibleOptions) {
|
|
374
|
-
const matchedValue = this.visibleOptions.find((option) => this.isOptionMatched(option,
|
|
378
|
+
const matchedValue = this.visibleOptions.find((option) => this.isOptionMatched(option, this.$refs.focusInput.value || ''));
|
|
375
379
|
|
|
376
380
|
if (matchedValue !== undefined) {
|
|
377
381
|
valid = true;
|
|
@@ -1060,12 +1064,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1060
1064
|
ref: "dropdownButton",
|
|
1061
1065
|
type: "button",
|
|
1062
1066
|
icon: $props.dropdownIcon,
|
|
1063
|
-
class:
|
|
1067
|
+
class: vue.normalizeClass(['p-autocomplete-dropdown', $props.dropdownClass]),
|
|
1064
1068
|
tabindex: "-1",
|
|
1065
1069
|
disabled: $props.disabled,
|
|
1066
1070
|
"aria-hidden": "true",
|
|
1067
1071
|
onClick: $options.onDropdownClick
|
|
1068
|
-
}, null, 8, ["icon", "disabled", "onClick"]))
|
|
1072
|
+
}, null, 8, ["icon", "class", "disabled", "onClick"]))
|
|
1069
1073
|
: vue.createCommentVNode("", true),
|
|
1070
1074
|
vue.createElementVNode("span", _hoisted_8, vue.toDisplayString($options.searchResultMessageText), 1),
|
|
1071
1075
|
vue.createVNode(_component_Portal, { appendTo: $props.appendTo }, {
|
|
@@ -1159,8 +1163,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1159
1163
|
])
|
|
1160
1164
|
], 64))
|
|
1161
1165
|
}), 128))
|
|
1162
|
-
], 14, _hoisted_9)
|
|
1163
|
-
vue.createElementVNode("span", _hoisted_12, vue.toDisplayString($options.selectedMessageText), 1)
|
|
1166
|
+
], 14, _hoisted_9)
|
|
1164
1167
|
]),
|
|
1165
1168
|
_: 2
|
|
1166
1169
|
}, [
|
|
@@ -1177,7 +1180,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1177
1180
|
vue.renderSlot(_ctx.$slots, "footer", {
|
|
1178
1181
|
value: $props.modelValue,
|
|
1179
1182
|
suggestions: $options.visibleOptions
|
|
1180
|
-
})
|
|
1183
|
+
}),
|
|
1184
|
+
vue.createElementVNode("span", _hoisted_12, vue.toDisplayString($options.selectedMessageText), 1)
|
|
1181
1185
|
], 16))
|
|
1182
1186
|
: vue.createCommentVNode("", true)
|
|
1183
1187
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/button"),t=require("primevue/overlayeventbus"),i=require("primevue/portal"),n=require("primevue/ripple"),o=require("primevue/utils"),l=require("primevue/virtualscroller"),s=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(e),d=a(t),p=a(i),u=a(n),c=a(l),h={name:"AutoComplete",emits:["update:modelValue","change","focus","blur","item-select","item-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionLabel:null,optionDisabled: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},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},dataKey:{type:String,default:null},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},inputId:{type:String,default:null},inputStyle:{type:null,default:null},inputClass:{type:String,default:null},inputProps:{type:null,default:null},panelStyle:{type:null,default:null},panelClass:{type:String,default:null},panelProps:{type:null,default:null},dropdownIcon:{type:String,default:"pi pi-chevron-down"},loadingIcon:{type:String,default:"pi pi-spinner"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,focusOnHover:!1,dirty:!1,data:()=>({focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}),watch:{suggestions(){this.searching&&(o.ObjectUtils.isNotEmpty(this.suggestions)?this.show():this.hide(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1),this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},updated(){this.overlayVisible&&this.alignOverlay()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(o.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.field||this.optionLabel?o.ObjectUtils.resolveFieldData(e,this.field||this.optionLabel):e},getOptionValue:e=>e,getOptionRenderKey(e,t){return(this.dataKey?o.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&o.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return o.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return o.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.dirty=!0,this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&o.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.dirty=e,this.overlayVisible=!1,this.focusedOptionIndex=-1,e&&o.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e)},onBlur(e){this.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e)}},onInput(e){this.searchTimeout&&clearTimeout(this.searchTimeout);let t=e.target.value;this.multiple||this.updateModel(e,t),0===t.length?(this.hide(),this.$emit("clear")):t.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay)):this.hide()},onChange(e){if(this.forceSelection){let t=!1;if(this.visibleOptions){const i=this.visibleOptions.find((t=>this.isOptionMatched(t,e.target.value)));void 0!==i&&(t=!0,!this.isSelected(i)&&this.onOptionSelect(e,i))}t||(this.$refs.focusInput.value="",this.$emit("clear"),!this.multiple&&this.updateModel(e,null))}},onMultipleContainerFocus(){this.focused=!0},onMultipleContainerBlur(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown(e){switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e)}},onContainerClick(e){this.disabled||this.searching||this.isInputClicked(e)||this.isDropdownClicked(e)||this.overlay&&this.overlay.contains(e.target)||o.DomHandler.focus(this.$refs.focusInput)},onDropdownClick(e){let t;this.overlayVisible?this.hide(!0):(o.DomHandler.focus(this.$refs.focusInput),t=this.$refs.focusInput.value,"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown")),this.$emit("dropdown-click",{originalEvent:e,query:t})},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.multiple?(this.$refs.focusInput.value="",this.isSelected(t)||this.updateModel(e,[...this.modelValue||[],n])):this.updateModel(e,n),this.$emit("item-select",{originalEvent:e,value:t}),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOverlayClick(e){d.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){if(!this.overlayVisible)return;const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey(e){if(this.overlayVisible)if(e.altKey)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowLeftKey(e){const t=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(o.ObjectUtils.isEmpty(t.value)&&this.hasSelectedOption?(o.DomHandler.focus(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.modelValue.length):e.stopPropagation())},onArrowRightKey(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey(e){const t=e.currentTarget.value.length;e.shiftKey?e.currentTarget.setSelectionRange(0,t):e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey(e){const t=e.currentTarget,i=t.value.length;e.shiftKey?e.currentTarget.setSelectionRange(0,i):t.setSelectionRange(i,i),this.focusedOptionIndex=-1,e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onBackspaceKey(e){if(this.multiple){if(o.ObjectUtils.isNotEmpty(this.modelValue)&&!this.$refs.focusInput.value){const 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})}e.stopPropagation()}},onArrowLeftKeyOnMultiple(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.modelValue.length-1&&(this.focusedMultipleOptionIndex=-1,o.DomHandler.focus(this.$refs.focusInput))},onBackspaceKeyOnMultiple(e){-1!==this.focusedMultipleOptionIndex&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter(e){o.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){o.ZIndexUtils.clear(e)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput;"self"===this.appendTo?o.DomHandler.relativePosition(this.overlay,e):(this.overlay.style.minWidth=o.DomHandler.getOuterWidth(e)+"px",o.DomHandler.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new o.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!o.DomHandler.isTouchDevice()&&this.hide()},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.focusInput},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},isOptionMatched(e,t){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.searchLocale)===t.toLocaleLowerCase(this.searchLocale)},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return o.ObjectUtils.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return o.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?o.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},removeOption(e,t){const i=this.modelValue[t],n=this.modelValue.filter(((e,i)=>i!==t)).map((e=>this.getOptionValue(e)));this.updateModel(e,n),this.$emit("item-unselect",{originalEvent:e,value:i}),this.dirty=!0,o.DomHandler.focus(this.$refs.focusInput)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),(this.selectOnFocus||this.autoHighlight)&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=o.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){(this.selectOnFocus||this.autoHighlight)&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const n=this.getOptionGroupChildren(t);return n&&n.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-autocomplete p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||o.ObjectUtils.isNotEmpty(this.inputValue),"p-inputwrapper-focus":this.focused,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown}]},multiContainerClass:()=>["p-autocomplete-multiple-container p-component p-inputtext"],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}]},loadingIconClass(){return["p-autocomplete-loader pi-spin",this.loadingIcon]},visibleOptions(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue(){if(this.modelValue){if("object"==typeof this.modelValue){const e=this.getOptionLabel(this.modelValue);return null!=e?e:this.modelValue}return this.modelValue}return""},hasSelectedOption(){return o.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.dataKey},searchResultMessageText(){return o.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},id(){return this.$attrs.id||o.UniqueComponentId()},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},focusedMultipleOptionId(){return-1!==this.focusedMultipleOptionIndex?`${this.id}_multiple_option_${this.focusedMultipleOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:r.default,VirtualScroller:c.default,Portal:p.default},directives:{ripple:u.default}};const f=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],m=["aria-activedescendant"],y=["id","aria-label","aria-setsize","aria-posinset"],b={class:"p-autocomplete-token-label"},g=["onClick"],O={class:"p-autocomplete-input-token",role:"option"},v=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],x={role:"status","aria-live":"polite",class:"p-hidden-accessible"},I=["id"],w=["id"],k=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],S={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.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: -0.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"),h.render=function(e,t,i,n,o,l){const a=s.resolveComponent("Button"),r=s.resolveComponent("VirtualScroller"),d=s.resolveComponent("Portal"),p=s.resolveDirective("ripple");return s.openBlock(),s.createElementBlock("div",{ref:"container",class:s.normalizeClass(l.containerClass),onClick:t[15]||(t[15]=(...e)=>l.onContainerClick&&l.onContainerClick(...e))},[i.multiple?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:l.inputStyleClass,value:l.inputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":l.id+"_list","aria-activedescendant":o.focused?l.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>l.onFocus&&l.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onBlur&&l.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onKeyDown&&l.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>l.onInput&&l.onInput(...e)),onChange:t[4]||(t[4]=(...e)=>l.onChange&&l.onChange(...e))},i.inputProps),null,16,f)),i.multiple?(s.openBlock(),s.createElementBlock("ul",{key:1,ref:"multiContainer",class:s.normalizeClass(l.multiContainerClass),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":o.focused?l.focusedMultipleOptionId:void 0,onFocus:t[10]||(t[10]=(...e)=>l.onMultipleContainerFocus&&l.onMultipleContainerFocus(...e)),onBlur:t[11]||(t[11]=(...e)=>l.onMultipleContainerBlur&&l.onMultipleContainerBlur(...e)),onKeydown:t[12]||(t[12]=(...e)=>l.onMultipleContainerKeyDown&&l.onMultipleContainerKeyDown(...e))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.modelValue,((t,n)=>(s.openBlock(),s.createElementBlock("li",{key:n,id:l.id+"_multiple_option_"+n,class:s.normalizeClass(["p-autocomplete-token",{"p-focus":o.focusedMultipleOptionIndex===n}]),role:"option","aria-label":l.getOptionLabel(t),"aria-selected":!0,"aria-setsize":i.modelValue.length,"aria-posinset":n+1},[s.renderSlot(e.$slots,"chip",{value:t},(()=>[s.createElementVNode("span",b,s.toDisplayString(l.getOptionLabel(t)),1)])),s.createElementVNode("span",{class:s.normalizeClass(["p-autocomplete-token-icon",i.removeTokenIcon]),onClick:e=>l.removeOption(e,n),"aria-hidden":"true"},null,10,g)],10,y)))),128)),s.createElementVNode("li",O,[s.createElementVNode("input",s.mergeProps({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":l.id+"_list","aria-activedescendant":o.focused?l.focusedOptionId:void 0,onFocus:t[5]||(t[5]=(...e)=>l.onFocus&&l.onFocus(...e)),onBlur:t[6]||(t[6]=(...e)=>l.onBlur&&l.onBlur(...e)),onKeydown:t[7]||(t[7]=(...e)=>l.onKeyDown&&l.onKeyDown(...e)),onInput:t[8]||(t[8]=(...e)=>l.onInput&&l.onInput(...e)),onChange:t[9]||(t[9]=(...e)=>l.onChange&&l.onChange(...e))},i.inputProps),null,16,v)])],42,m)):s.createCommentVNode("",!0),o.searching?(s.openBlock(),s.createElementBlock("i",{key:2,class:s.normalizeClass(l.loadingIconClass),"aria-hidden":"true"},null,2)):s.createCommentVNode("",!0),i.dropdown?(s.openBlock(),s.createBlock(a,{key:3,ref:"dropdownButton",type:"button",icon:i.dropdownIcon,class:"p-autocomplete-dropdown",tabindex:"-1",disabled:i.disabled,"aria-hidden":"true",onClick:l.onDropdownClick},null,8,["icon","disabled","onClick"])):s.createCommentVNode("",!0),s.createElementVNode("span",x,s.toDisplayString(l.searchResultMessageText),1),s.createVNode(d,{appendTo:i.appendTo},{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-connected-overlay",onEnter:l.onOverlayEnter,onAfterEnter:l.onOverlayAfterEnter,onLeave:l.onOverlayLeave,onAfterLeave:l.onOverlayAfterLeave},{default:s.withCtx((()=>[o.overlayVisible?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:l.overlayRef,class:l.panelStyleClass,style:{...i.panelStyle,"max-height":l.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>l.onOverlayKeyDown&&l.onOverlayKeyDown(...e))},i.panelProps),[s.renderSlot(e.$slots,"header",{value:i.modelValue,suggestions:l.visibleOptions}),s.createVNode(r,s.mergeProps({ref:l.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:l.visibleOptions,tabindex:-1,disabled:l.virtualScrollerDisabled}),s.createSlots({content:s.withCtx((({styleClass:t,contentRef:i,items:n,getItemOptions:a,contentStyle:r,itemSize:d})=>[s.createElementVNode("ul",{ref:e=>l.listRef(e,i),id:l.id+"_list",class:s.normalizeClass(["p-autocomplete-items",t]),style:s.normalizeStyle(r),role:"listbox"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n,((t,i)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l.getOptionRenderKey(t,l.getOptionIndex(i,a))},[l.isOptionGroup(t)?(s.openBlock(),s.createElementBlock("li",{key:0,id:l.id+"_"+l.getOptionIndex(i,a),style:s.normalizeStyle({height:d?d+"px":void 0}),class:"p-autocomplete-item-group",role:"option"},[s.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,item:t.optionGroup,index:l.getOptionIndex(i,a)},(()=>[s.createTextVNode(s.toDisplayString(l.getOptionGroupLabel(t.optionGroup)),1)]))],12,w)):s.withDirectives((s.openBlock(),s.createElementBlock("li",{key:1,id:l.id+"_"+l.getOptionIndex(i,a),style:s.normalizeStyle({height:d?d+"px":void 0}),class:s.normalizeClass(["p-autocomplete-item",{"p-highlight":l.isSelected(t),"p-focus":o.focusedOptionIndex===l.getOptionIndex(i,a),"p-disabled":l.isOptionDisabled(t)}]),role:"option","aria-label":l.getOptionLabel(t),"aria-selected":l.isSelected(t),"aria-disabled":l.isOptionDisabled(t),"aria-setsize":l.ariaSetSize,"aria-posinset":l.getAriaPosInset(l.getOptionIndex(i,a)),onClick:e=>l.onOptionSelect(e,t),onMousemove:e=>l.onOptionMouseMove(e,l.getOptionIndex(i,a))},[e.$slots.option?s.renderSlot(e.$slots,"option",{key:0,option:t,index:l.getOptionIndex(i,a)},(()=>[s.createTextVNode(s.toDisplayString(l.getOptionLabel(t)),1)])):s.renderSlot(e.$slots,"item",{key:1,item:t,index:l.getOptionIndex(i,a)},(()=>[s.createTextVNode(s.toDisplayString(l.getOptionLabel(t)),1)]))],46,k)),[[p]])],64)))),128))],14,I),s.createElementVNode("span",S,s.toDisplayString(l.selectedMessageText),1)])),_:2},[e.$slots.loader?{name:"loader",fn:s.withCtx((({options:t})=>[s.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["style","items","disabled"]),s.renderSlot(e.$slots,"footer",{value:i.modelValue,suggestions:l.visibleOptions})],16)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)},module.exports=h;
|
|
1
|
+
"use strict";var e=require("primevue/button"),t=require("primevue/overlayeventbus"),i=require("primevue/portal"),n=require("primevue/ripple"),o=require("primevue/utils"),l=require("primevue/virtualscroller"),s=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(e),d=a(t),p=a(i),u=a(n),c=a(l),h={name:"AutoComplete",emits:["update:modelValue","change","focus","blur","item-select","item-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionLabel:null,optionDisabled: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},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},dataKey:{type:String,default:null},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},inputId:{type:String,default:null},inputStyle:{type:null,default:null},inputClass:{type:String,default:null},inputProps:{type:null,default:null},panelStyle:{type:null,default:null},panelClass:{type:String,default:null},panelProps:{type:null,default:null},dropdownIcon:{type:String,default:"pi pi-chevron-down"},dropdownClass:{type:String,default:null},loadingIcon:{type:String,default:"pi pi-spinner"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,focusOnHover:!1,dirty:!1,data:()=>({focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}),watch:{suggestions(){this.searching&&(o.ObjectUtils.isNotEmpty(this.suggestions)?this.show():this.hide(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1),this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},updated(){this.overlayVisible&&this.alignOverlay()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(o.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.field||this.optionLabel?o.ObjectUtils.resolveFieldData(e,this.field||this.optionLabel):e},getOptionValue:e=>e,getOptionRenderKey(e,t){return(this.dataKey?o.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&o.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return o.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return o.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.dirty=!0,this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&o.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.dirty=e,this.overlayVisible=!1,this.focusedOptionIndex=-1,e&&o.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e)},onBlur(e){this.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e)}},onInput(e){this.searchTimeout&&clearTimeout(this.searchTimeout);let t=e.target.value;this.multiple||this.updateModel(e,t),0===t.length?(this.hide(),this.$emit("clear")):t.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay)):this.hide()},onChange(e){if(this.forceSelection){let t=!1;if(this.visibleOptions){const i=this.visibleOptions.find((e=>this.isOptionMatched(e,this.$refs.focusInput.value||"")));void 0!==i&&(t=!0,!this.isSelected(i)&&this.onOptionSelect(e,i))}t||(this.$refs.focusInput.value="",this.$emit("clear"),!this.multiple&&this.updateModel(e,null))}},onMultipleContainerFocus(){this.focused=!0},onMultipleContainerBlur(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown(e){switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e)}},onContainerClick(e){this.disabled||this.searching||this.isInputClicked(e)||this.isDropdownClicked(e)||this.overlay&&this.overlay.contains(e.target)||o.DomHandler.focus(this.$refs.focusInput)},onDropdownClick(e){let t;this.overlayVisible?this.hide(!0):(o.DomHandler.focus(this.$refs.focusInput),t=this.$refs.focusInput.value,"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown")),this.$emit("dropdown-click",{originalEvent:e,query:t})},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.multiple?(this.$refs.focusInput.value="",this.isSelected(t)||this.updateModel(e,[...this.modelValue||[],n])):this.updateModel(e,n),this.$emit("item-select",{originalEvent:e,value:t}),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOverlayClick(e){d.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){if(!this.overlayVisible)return;const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey(e){if(this.overlayVisible)if(e.altKey)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowLeftKey(e){const t=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(o.ObjectUtils.isEmpty(t.value)&&this.hasSelectedOption?(o.DomHandler.focus(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.modelValue.length):e.stopPropagation())},onArrowRightKey(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey(e){const t=e.currentTarget.value.length;e.shiftKey?e.currentTarget.setSelectionRange(0,t):e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey(e){const t=e.currentTarget,i=t.value.length;e.shiftKey?e.currentTarget.setSelectionRange(0,i):t.setSelectionRange(i,i),this.focusedOptionIndex=-1,e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onBackspaceKey(e){if(this.multiple){if(o.ObjectUtils.isNotEmpty(this.modelValue)&&!this.$refs.focusInput.value){const 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})}e.stopPropagation()}},onArrowLeftKeyOnMultiple(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.modelValue.length-1&&(this.focusedMultipleOptionIndex=-1,o.DomHandler.focus(this.$refs.focusInput))},onBackspaceKeyOnMultiple(e){-1!==this.focusedMultipleOptionIndex&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter(e){o.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){o.ZIndexUtils.clear(e)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput;"self"===this.appendTo?o.DomHandler.relativePosition(this.overlay,e):(this.overlay.style.minWidth=o.DomHandler.getOuterWidth(e)+"px",o.DomHandler.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new o.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!o.DomHandler.isTouchDevice()&&this.hide()},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.focusInput},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},isOptionMatched(e,t){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.searchLocale)===t.toLocaleLowerCase(this.searchLocale)},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return o.ObjectUtils.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return o.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?o.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},removeOption(e,t){const i=this.modelValue[t],n=this.modelValue.filter(((e,i)=>i!==t)).map((e=>this.getOptionValue(e)));this.updateModel(e,n),this.$emit("item-unselect",{originalEvent:e,value:i}),this.dirty=!0,o.DomHandler.focus(this.$refs.focusInput)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),(this.selectOnFocus||this.autoHighlight)&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=o.DomHandler.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){(this.selectOnFocus||this.autoHighlight)&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const n=this.getOptionGroupChildren(t);return n&&n.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-autocomplete p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||o.ObjectUtils.isNotEmpty(this.inputValue),"p-inputwrapper-focus":this.focused,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown}]},multiContainerClass:()=>["p-autocomplete-multiple-container p-component p-inputtext"],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}]},loadingIconClass(){return["p-autocomplete-loader pi-spin",this.loadingIcon]},visibleOptions(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue(){if(this.modelValue){if("object"==typeof this.modelValue){const e=this.getOptionLabel(this.modelValue);return null!=e?e:this.modelValue}return this.modelValue}return""},hasSelectedOption(){return o.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.dataKey},searchResultMessageText(){return o.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},id(){return this.$attrs.id||o.UniqueComponentId()},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},focusedMultipleOptionId(){return-1!==this.focusedMultipleOptionIndex?`${this.id}_multiple_option_${this.focusedMultipleOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:r.default,VirtualScroller:c.default,Portal:p.default},directives:{ripple:u.default}};const f=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],m=["aria-activedescendant"],y=["id","aria-label","aria-setsize","aria-posinset"],b={class:"p-autocomplete-token-label"},g=["onClick"],O={class:"p-autocomplete-input-token",role:"option"},v=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],x={role:"status","aria-live":"polite",class:"p-hidden-accessible"},I=["id"],w=["id"],k=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],S={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.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: -0.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"),h.render=function(e,t,i,n,o,l){const a=s.resolveComponent("Button"),r=s.resolveComponent("VirtualScroller"),d=s.resolveComponent("Portal"),p=s.resolveDirective("ripple");return s.openBlock(),s.createElementBlock("div",{ref:"container",class:s.normalizeClass(l.containerClass),onClick:t[15]||(t[15]=(...e)=>l.onContainerClick&&l.onContainerClick(...e))},[i.multiple?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:l.inputStyleClass,value:l.inputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":l.id+"_list","aria-activedescendant":o.focused?l.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>l.onFocus&&l.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onBlur&&l.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onKeyDown&&l.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>l.onInput&&l.onInput(...e)),onChange:t[4]||(t[4]=(...e)=>l.onChange&&l.onChange(...e))},i.inputProps),null,16,f)),i.multiple?(s.openBlock(),s.createElementBlock("ul",{key:1,ref:"multiContainer",class:s.normalizeClass(l.multiContainerClass),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":o.focused?l.focusedMultipleOptionId:void 0,onFocus:t[10]||(t[10]=(...e)=>l.onMultipleContainerFocus&&l.onMultipleContainerFocus(...e)),onBlur:t[11]||(t[11]=(...e)=>l.onMultipleContainerBlur&&l.onMultipleContainerBlur(...e)),onKeydown:t[12]||(t[12]=(...e)=>l.onMultipleContainerKeyDown&&l.onMultipleContainerKeyDown(...e))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.modelValue,((t,n)=>(s.openBlock(),s.createElementBlock("li",{key:n,id:l.id+"_multiple_option_"+n,class:s.normalizeClass(["p-autocomplete-token",{"p-focus":o.focusedMultipleOptionIndex===n}]),role:"option","aria-label":l.getOptionLabel(t),"aria-selected":!0,"aria-setsize":i.modelValue.length,"aria-posinset":n+1},[s.renderSlot(e.$slots,"chip",{value:t},(()=>[s.createElementVNode("span",b,s.toDisplayString(l.getOptionLabel(t)),1)])),s.createElementVNode("span",{class:s.normalizeClass(["p-autocomplete-token-icon",i.removeTokenIcon]),onClick:e=>l.removeOption(e,n),"aria-hidden":"true"},null,10,g)],10,y)))),128)),s.createElementVNode("li",O,[s.createElementVNode("input",s.mergeProps({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":l.id+"_list","aria-activedescendant":o.focused?l.focusedOptionId:void 0,onFocus:t[5]||(t[5]=(...e)=>l.onFocus&&l.onFocus(...e)),onBlur:t[6]||(t[6]=(...e)=>l.onBlur&&l.onBlur(...e)),onKeydown:t[7]||(t[7]=(...e)=>l.onKeyDown&&l.onKeyDown(...e)),onInput:t[8]||(t[8]=(...e)=>l.onInput&&l.onInput(...e)),onChange:t[9]||(t[9]=(...e)=>l.onChange&&l.onChange(...e))},i.inputProps),null,16,v)])],42,m)):s.createCommentVNode("",!0),o.searching?(s.openBlock(),s.createElementBlock("i",{key:2,class:s.normalizeClass(l.loadingIconClass),"aria-hidden":"true"},null,2)):s.createCommentVNode("",!0),i.dropdown?(s.openBlock(),s.createBlock(a,{key:3,ref:"dropdownButton",type:"button",icon:i.dropdownIcon,class:s.normalizeClass(["p-autocomplete-dropdown",i.dropdownClass]),tabindex:"-1",disabled:i.disabled,"aria-hidden":"true",onClick:l.onDropdownClick},null,8,["icon","class","disabled","onClick"])):s.createCommentVNode("",!0),s.createElementVNode("span",x,s.toDisplayString(l.searchResultMessageText),1),s.createVNode(d,{appendTo:i.appendTo},{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-connected-overlay",onEnter:l.onOverlayEnter,onAfterEnter:l.onOverlayAfterEnter,onLeave:l.onOverlayLeave,onAfterLeave:l.onOverlayAfterLeave},{default:s.withCtx((()=>[o.overlayVisible?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:l.overlayRef,class:l.panelStyleClass,style:{...i.panelStyle,"max-height":l.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>l.onOverlayKeyDown&&l.onOverlayKeyDown(...e))},i.panelProps),[s.renderSlot(e.$slots,"header",{value:i.modelValue,suggestions:l.visibleOptions}),s.createVNode(r,s.mergeProps({ref:l.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:l.visibleOptions,tabindex:-1,disabled:l.virtualScrollerDisabled}),s.createSlots({content:s.withCtx((({styleClass:t,contentRef:i,items:n,getItemOptions:a,contentStyle:r,itemSize:d})=>[s.createElementVNode("ul",{ref:e=>l.listRef(e,i),id:l.id+"_list",class:s.normalizeClass(["p-autocomplete-items",t]),style:s.normalizeStyle(r),role:"listbox"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n,((t,i)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l.getOptionRenderKey(t,l.getOptionIndex(i,a))},[l.isOptionGroup(t)?(s.openBlock(),s.createElementBlock("li",{key:0,id:l.id+"_"+l.getOptionIndex(i,a),style:s.normalizeStyle({height:d?d+"px":void 0}),class:"p-autocomplete-item-group",role:"option"},[s.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,item:t.optionGroup,index:l.getOptionIndex(i,a)},(()=>[s.createTextVNode(s.toDisplayString(l.getOptionGroupLabel(t.optionGroup)),1)]))],12,w)):s.withDirectives((s.openBlock(),s.createElementBlock("li",{key:1,id:l.id+"_"+l.getOptionIndex(i,a),style:s.normalizeStyle({height:d?d+"px":void 0}),class:s.normalizeClass(["p-autocomplete-item",{"p-highlight":l.isSelected(t),"p-focus":o.focusedOptionIndex===l.getOptionIndex(i,a),"p-disabled":l.isOptionDisabled(t)}]),role:"option","aria-label":l.getOptionLabel(t),"aria-selected":l.isSelected(t),"aria-disabled":l.isOptionDisabled(t),"aria-setsize":l.ariaSetSize,"aria-posinset":l.getAriaPosInset(l.getOptionIndex(i,a)),onClick:e=>l.onOptionSelect(e,t),onMousemove:e=>l.onOptionMouseMove(e,l.getOptionIndex(i,a))},[e.$slots.option?s.renderSlot(e.$slots,"option",{key:0,option:t,index:l.getOptionIndex(i,a)},(()=>[s.createTextVNode(s.toDisplayString(l.getOptionLabel(t)),1)])):s.renderSlot(e.$slots,"item",{key:1,item:t,index:l.getOptionIndex(i,a)},(()=>[s.createTextVNode(s.toDisplayString(l.getOptionLabel(t)),1)]))],46,k)),[[p]])],64)))),128))],14,I)])),_:2},[e.$slots.loader?{name:"loader",fn:s.withCtx((({options:t})=>[s.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["style","items","disabled"]),s.renderSlot(e.$slots,"footer",{value:i.modelValue,suggestions:l.visibleOptions}),s.createElementVNode("span",S,s.toDisplayString(l.selectedMessageText),1)],16)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)},module.exports=h;
|
|
@@ -109,6 +109,10 @@ var script = {
|
|
|
109
109
|
type: String,
|
|
110
110
|
default: 'pi pi-chevron-down'
|
|
111
111
|
},
|
|
112
|
+
dropdownClass: {
|
|
113
|
+
type: String,
|
|
114
|
+
default: null
|
|
115
|
+
},
|
|
112
116
|
loadingIcon: {
|
|
113
117
|
type: String,
|
|
114
118
|
default: 'pi pi-spinner'
|
|
@@ -361,7 +365,7 @@ var script = {
|
|
|
361
365
|
let valid = false;
|
|
362
366
|
|
|
363
367
|
if (this.visibleOptions) {
|
|
364
|
-
const matchedValue = this.visibleOptions.find((option) => this.isOptionMatched(option,
|
|
368
|
+
const matchedValue = this.visibleOptions.find((option) => this.isOptionMatched(option, this.$refs.focusInput.value || ''));
|
|
365
369
|
|
|
366
370
|
if (matchedValue !== undefined) {
|
|
367
371
|
valid = true;
|
|
@@ -1050,12 +1054,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1050
1054
|
ref: "dropdownButton",
|
|
1051
1055
|
type: "button",
|
|
1052
1056
|
icon: $props.dropdownIcon,
|
|
1053
|
-
class:
|
|
1057
|
+
class: normalizeClass(['p-autocomplete-dropdown', $props.dropdownClass]),
|
|
1054
1058
|
tabindex: "-1",
|
|
1055
1059
|
disabled: $props.disabled,
|
|
1056
1060
|
"aria-hidden": "true",
|
|
1057
1061
|
onClick: $options.onDropdownClick
|
|
1058
|
-
}, null, 8, ["icon", "disabled", "onClick"]))
|
|
1062
|
+
}, null, 8, ["icon", "class", "disabled", "onClick"]))
|
|
1059
1063
|
: createCommentVNode("", true),
|
|
1060
1064
|
createElementVNode("span", _hoisted_8, toDisplayString($options.searchResultMessageText), 1),
|
|
1061
1065
|
createVNode(_component_Portal, { appendTo: $props.appendTo }, {
|
|
@@ -1149,8 +1153,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1149
1153
|
])
|
|
1150
1154
|
], 64))
|
|
1151
1155
|
}), 128))
|
|
1152
|
-
], 14, _hoisted_9)
|
|
1153
|
-
createElementVNode("span", _hoisted_12, toDisplayString($options.selectedMessageText), 1)
|
|
1156
|
+
], 14, _hoisted_9)
|
|
1154
1157
|
]),
|
|
1155
1158
|
_: 2
|
|
1156
1159
|
}, [
|
|
@@ -1167,7 +1170,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1167
1170
|
renderSlot(_ctx.$slots, "footer", {
|
|
1168
1171
|
value: $props.modelValue,
|
|
1169
1172
|
suggestions: $options.visibleOptions
|
|
1170
|
-
})
|
|
1173
|
+
}),
|
|
1174
|
+
createElementVNode("span", _hoisted_12, toDisplayString($options.selectedMessageText), 1)
|
|
1171
1175
|
], 16))
|
|
1172
1176
|
: createCommentVNode("", true)
|
|
1173
1177
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/button";import t from"primevue/overlayeventbus";import i from"primevue/portal";import n from"primevue/ripple";import{ObjectUtils as o,ZIndexUtils as s,DomHandler as l,ConnectedOverlayScrollHandler as a,UniqueComponentId as r}from"primevue/utils";import p from"primevue/virtualscroller";import{resolveComponent as d,resolveDirective as u,openBlock as c,createElementBlock as h,normalizeClass as f,mergeProps as y,createCommentVNode as m,Fragment as b,renderList as g,renderSlot as O,createElementVNode as v,toDisplayString as x,createBlock as I,createVNode as w,withCtx as S,Transition as k,createSlots as C,normalizeStyle as L,createTextVNode as M,withDirectives as V}from"vue";var $={name:"AutoComplete",emits:["update:modelValue","change","focus","blur","item-select","item-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionLabel:null,optionDisabled: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},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},dataKey:{type:String,default:null},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},inputId:{type:String,default:null},inputStyle:{type:null,default:null},inputClass:{type:String,default:null},inputProps:{type:null,default:null},panelStyle:{type:null,default:null},panelClass:{type:String,default:null},panelProps:{type:null,default:null},dropdownIcon:{type:String,default:"pi pi-chevron-down"},loadingIcon:{type:String,default:"pi pi-spinner"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,focusOnHover:!1,dirty:!1,data:()=>({focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}),watch:{suggestions(){this.searching&&(o.isNotEmpty(this.suggestions)?this.show():this.hide(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1),this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},updated(){this.overlayVisible&&this.alignOverlay()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.field||this.optionLabel?o.resolveFieldData(e,this.field||this.optionLabel):e},getOptionValue:e=>e,getOptionRenderKey(e,t){return(this.dataKey?o.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&o.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return o.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return o.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.dirty=!0,this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&l.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.dirty=e,this.overlayVisible=!1,this.focusedOptionIndex=-1,e&&l.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e)},onBlur(e){this.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e)}},onInput(e){this.searchTimeout&&clearTimeout(this.searchTimeout);let t=e.target.value;this.multiple||this.updateModel(e,t),0===t.length?(this.hide(),this.$emit("clear")):t.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay)):this.hide()},onChange(e){if(this.forceSelection){let t=!1;if(this.visibleOptions){const i=this.visibleOptions.find((t=>this.isOptionMatched(t,e.target.value)));void 0!==i&&(t=!0,!this.isSelected(i)&&this.onOptionSelect(e,i))}t||(this.$refs.focusInput.value="",this.$emit("clear"),!this.multiple&&this.updateModel(e,null))}},onMultipleContainerFocus(){this.focused=!0},onMultipleContainerBlur(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown(e){switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e)}},onContainerClick(e){this.disabled||this.searching||this.isInputClicked(e)||this.isDropdownClicked(e)||this.overlay&&this.overlay.contains(e.target)||l.focus(this.$refs.focusInput)},onDropdownClick(e){let t;this.overlayVisible?this.hide(!0):(l.focus(this.$refs.focusInput),t=this.$refs.focusInput.value,"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown")),this.$emit("dropdown-click",{originalEvent:e,query:t})},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.multiple?(this.$refs.focusInput.value="",this.isSelected(t)||this.updateModel(e,[...this.modelValue||[],n])):this.updateModel(e,n),this.$emit("item-select",{originalEvent:e,value:t}),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOverlayClick(e){t.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){if(!this.overlayVisible)return;const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey(e){if(this.overlayVisible)if(e.altKey)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowLeftKey(e){const t=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(o.isEmpty(t.value)&&this.hasSelectedOption?(l.focus(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.modelValue.length):e.stopPropagation())},onArrowRightKey(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey(e){const t=e.currentTarget.value.length;e.shiftKey?e.currentTarget.setSelectionRange(0,t):e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey(e){const t=e.currentTarget,i=t.value.length;e.shiftKey?e.currentTarget.setSelectionRange(0,i):t.setSelectionRange(i,i),this.focusedOptionIndex=-1,e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onBackspaceKey(e){if(this.multiple){if(o.isNotEmpty(this.modelValue)&&!this.$refs.focusInput.value){const 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})}e.stopPropagation()}},onArrowLeftKeyOnMultiple(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.modelValue.length-1&&(this.focusedMultipleOptionIndex=-1,l.focus(this.$refs.focusInput))},onBackspaceKeyOnMultiple(e){-1!==this.focusedMultipleOptionIndex&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter(e){s.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){s.clear(e)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput;"self"===this.appendTo?l.relativePosition(this.overlay,e):(this.overlay.style.minWidth=l.getOuterWidth(e)+"px",l.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new a(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!l.isTouchDevice()&&this.hide()},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.focusInput},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},isOptionMatched(e,t){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.searchLocale)===t.toLocaleLowerCase(this.searchLocale)},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return o.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return o.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?o.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},removeOption(e,t){const i=this.modelValue[t],n=this.modelValue.filter(((e,i)=>i!==t)).map((e=>this.getOptionValue(e)));this.updateModel(e,n),this.$emit("item-unselect",{originalEvent:e,value:i}),this.dirty=!0,l.focus(this.$refs.focusInput)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),(this.selectOnFocus||this.autoHighlight)&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=l.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){(this.selectOnFocus||this.autoHighlight)&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const n=this.getOptionGroupChildren(t);return n&&n.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-autocomplete p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||o.isNotEmpty(this.inputValue),"p-inputwrapper-focus":this.focused,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown}]},multiContainerClass:()=>["p-autocomplete-multiple-container p-component p-inputtext"],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}]},loadingIconClass(){return["p-autocomplete-loader pi-spin",this.loadingIcon]},visibleOptions(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue(){if(this.modelValue){if("object"==typeof this.modelValue){const e=this.getOptionLabel(this.modelValue);return null!=e?e:this.modelValue}return this.modelValue}return""},hasSelectedOption(){return o.isNotEmpty(this.modelValue)},equalityKey(){return this.dataKey},searchResultMessageText(){return o.isNotEmpty(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},id(){return this.$attrs.id||r()},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},focusedMultipleOptionId(){return-1!==this.focusedMultipleOptionIndex?`${this.id}_multiple_option_${this.focusedMultipleOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:e,VirtualScroller:p,Portal:i},directives:{ripple:n}};const K=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],D=["aria-activedescendant"],F=["id","aria-label","aria-setsize","aria-posinset"],T={class:"p-autocomplete-token-label"},E=["onClick"],A={class:"p-autocomplete-input-token",role:"option"},B=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],R={role:"status","aria-live":"polite",class:"p-hidden-accessible"},z=["id"],P=["id"],G=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],H={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.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: -0.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"),$.render=function(e,t,i,n,o,s){const l=d("Button"),a=d("VirtualScroller"),r=d("Portal"),p=u("ripple");return c(),h("div",{ref:"container",class:f(s.containerClass),onClick:t[15]||(t[15]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.multiple?m("",!0):(c(),h("input",y({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.inputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[4]||(t[4]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,K)),i.multiple?(c(),h("ul",{key:1,ref:"multiContainer",class:f(s.multiContainerClass),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":o.focused?s.focusedMultipleOptionId:void 0,onFocus:t[10]||(t[10]=(...e)=>s.onMultipleContainerFocus&&s.onMultipleContainerFocus(...e)),onBlur:t[11]||(t[11]=(...e)=>s.onMultipleContainerBlur&&s.onMultipleContainerBlur(...e)),onKeydown:t[12]||(t[12]=(...e)=>s.onMultipleContainerKeyDown&&s.onMultipleContainerKeyDown(...e))},[(c(!0),h(b,null,g(i.modelValue,((t,n)=>(c(),h("li",{key:n,id:s.id+"_multiple_option_"+n,class:f(["p-autocomplete-token",{"p-focus":o.focusedMultipleOptionIndex===n}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":!0,"aria-setsize":i.modelValue.length,"aria-posinset":n+1},[O(e.$slots,"chip",{value:t},(()=>[v("span",T,x(s.getOptionLabel(t)),1)])),v("span",{class:f(["p-autocomplete-token-icon",i.removeTokenIcon]),onClick:e=>s.removeOption(e,n),"aria-hidden":"true"},null,10,E)],10,F)))),128)),v("li",A,[v("input",y({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[5]||(t[5]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[6]||(t[6]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[7]||(t[7]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[8]||(t[8]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[9]||(t[9]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,B)])],42,D)):m("",!0),o.searching?(c(),h("i",{key:2,class:f(s.loadingIconClass),"aria-hidden":"true"},null,2)):m("",!0),i.dropdown?(c(),I(l,{key:3,ref:"dropdownButton",type:"button",icon:i.dropdownIcon,class:"p-autocomplete-dropdown",tabindex:"-1",disabled:i.disabled,"aria-hidden":"true",onClick:s.onDropdownClick},null,8,["icon","disabled","onClick"])):m("",!0),v("span",R,x(s.searchResultMessageText),1),w(r,{appendTo:i.appendTo},{default:S((()=>[w(k,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:S((()=>[o.overlayVisible?(c(),h("div",y({key:0,ref:s.overlayRef,class:s.panelStyleClass,style:{...i.panelStyle,"max-height":s.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[O(e.$slots,"header",{value:i.modelValue,suggestions:s.visibleOptions}),w(a,y({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled}),C({content:S((({styleClass:t,contentRef:i,items:n,getItemOptions:l,contentStyle:a,itemSize:r})=>[v("ul",{ref:e=>s.listRef(e,i),id:s.id+"_list",class:f(["p-autocomplete-items",t]),style:L(a),role:"listbox"},[(c(!0),h(b,null,g(n,((t,i)=>(c(),h(b,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,l))},[s.isOptionGroup(t)?(c(),h("li",{key:0,id:s.id+"_"+s.getOptionIndex(i,l),style:L({height:r?r+"px":void 0}),class:"p-autocomplete-item-group",role:"option"},[O(e.$slots,"optiongroup",{option:t.optionGroup,item:t.optionGroup,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,P)):V((c(),h("li",{key:1,id:s.id+"_"+s.getOptionIndex(i,l),style:L({height:r?r+"px":void 0}),class:f(["p-autocomplete-item",{"p-highlight":s.isSelected(t),"p-focus":o.focusedOptionIndex===s.getOptionIndex(i,l),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,l)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,l))},[e.$slots.option?O(e.$slots,"option",{key:0,option:t,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionLabel(t)),1)])):O(e.$slots,"item",{key:1,item:t,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionLabel(t)),1)]))],46,G)),[[p]])],64)))),128))],14,z),v("span",H,x(s.selectedMessageText),1)])),_:2},[e.$slots.loader?{name:"loader",fn:S((({options:t})=>[O(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["style","items","disabled"]),O(e.$slots,"footer",{value:i.modelValue,suggestions:s.visibleOptions})],16)):m("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)};export{$ as default};
|
|
1
|
+
import e from"primevue/button";import t from"primevue/overlayeventbus";import i from"primevue/portal";import n from"primevue/ripple";import{ObjectUtils as o,ZIndexUtils as s,DomHandler as l,ConnectedOverlayScrollHandler as a,UniqueComponentId as r}from"primevue/utils";import p from"primevue/virtualscroller";import{resolveComponent as d,resolveDirective as u,openBlock as c,createElementBlock as h,normalizeClass as f,mergeProps as y,createCommentVNode as m,Fragment as b,renderList as g,renderSlot as O,createElementVNode as v,toDisplayString as x,createBlock as I,createVNode as w,withCtx as S,Transition as k,createSlots as C,normalizeStyle as L,createTextVNode as M,withDirectives as V}from"vue";var $={name:"AutoComplete",emits:["update:modelValue","change","focus","blur","item-select","item-unselect","dropdown-click","clear","complete","before-show","before-hide","show","hide"],props:{modelValue:null,suggestions:{type:Array,default:null},field:{type:[String,Function],default:null},optionLabel:null,optionDisabled: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},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},dataKey:{type:String,default:null},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},inputId:{type:String,default:null},inputStyle:{type:null,default:null},inputClass:{type:String,default:null},inputProps:{type:null,default:null},panelStyle:{type:null,default:null},panelClass:{type:String,default:null},panelProps:{type:null,default:null},dropdownIcon:{type:String,default:"pi pi-chevron-down"},dropdownClass:{type:String,default:null},loadingIcon:{type:String,default:"pi pi-spinner"},removeTokenIcon:{type:String,default:"pi pi-times-circle"},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,resizeListener:null,scrollHandler:null,overlay:null,virtualScroller:null,searchTimeout:null,focusOnHover:!1,dirty:!1,data:()=>({focused:!1,focusedOptionIndex:-1,focusedMultipleOptionIndex:-1,overlayVisible:!1,searching:!1}),watch:{suggestions(){this.searching&&(o.isNotEmpty(this.suggestions)?this.show():this.hide(),this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.searching=!1),this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},updated(){this.overlayVisible&&this.alignOverlay()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.field||this.optionLabel?o.resolveFieldData(e,this.field||this.optionLabel):e},getOptionValue:e=>e,getOptionRenderKey(e,t){return(this.dataKey?o.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&o.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return o.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return o.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.dirty=!0,this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&l.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.dirty=e,this.overlayVisible=!1,this.focusedOptionIndex=-1,e&&l.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){!this.dirty&&this.completeOnFocus&&this.search(e,e.target.value,"focus"),this.dirty=!0,this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e)},onBlur(e){this.dirty=!1,this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e)}},onInput(e){this.searchTimeout&&clearTimeout(this.searchTimeout);let t=e.target.value;this.multiple||this.updateModel(e,t),0===t.length?(this.hide(),this.$emit("clear")):t.length>=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout((()=>{this.search(e,t,"input")}),this.delay)):this.hide()},onChange(e){if(this.forceSelection){let t=!1;if(this.visibleOptions){const i=this.visibleOptions.find((e=>this.isOptionMatched(e,this.$refs.focusInput.value||"")));void 0!==i&&(t=!0,!this.isSelected(i)&&this.onOptionSelect(e,i))}t||(this.$refs.focusInput.value="",this.$emit("clear"),!this.multiple&&this.updateModel(e,null))}},onMultipleContainerFocus(){this.focused=!0},onMultipleContainerBlur(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown(e){switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e)}},onContainerClick(e){this.disabled||this.searching||this.isInputClicked(e)||this.isDropdownClicked(e)||this.overlay&&this.overlay.contains(e.target)||l.focus(this.$refs.focusInput)},onDropdownClick(e){let t;this.overlayVisible?this.hide(!0):(l.focus(this.$refs.focusInput),t=this.$refs.focusInput.value,"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown")),this.$emit("dropdown-click",{originalEvent:e,query:t})},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t);this.multiple?(this.$refs.focusInput.value="",this.isSelected(t)||this.updateModel(e,[...this.modelValue||[],n])):this.updateModel(e,n),this.$emit("item-select",{originalEvent:e,value:t}),i&&this.hide(!0)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOverlayClick(e){t.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){if(!this.overlayVisible)return;const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey(e){if(this.overlayVisible)if(e.altKey)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowLeftKey(e){const t=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(o.isEmpty(t.value)&&this.hasSelectedOption?(l.focus(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.modelValue.length):e.stopPropagation())},onArrowRightKey(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey(e){const t=e.currentTarget.value.length;e.shiftKey?e.currentTarget.setSelectionRange(0,t):e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey(e){const t=e.currentTarget,i=t.value.length;e.shiftKey?e.currentTarget.setSelectionRange(0,i):t.setSelectionRange(i,i),this.focusedOptionIndex=-1,e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onBackspaceKey(e){if(this.multiple){if(o.isNotEmpty(this.modelValue)&&!this.$refs.focusInput.value){const 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})}e.stopPropagation()}},onArrowLeftKeyOnMultiple(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.modelValue.length-1&&(this.focusedMultipleOptionIndex=-1,l.focus(this.$refs.focusInput))},onBackspaceKeyOnMultiple(e){-1!==this.focusedMultipleOptionIndex&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter(e){s.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(e){s.clear(e)},alignOverlay(){let e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput;"self"===this.appendTo?l.relativePosition(this.overlay,e):(this.overlay.style.minWidth=l.getOuterWidth(e)+"px",l.absolutePosition(this.overlay,e))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new a(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!l.isTouchDevice()&&this.hide()},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.focusInput},isDropdownClicked(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},isOptionMatched(e,t){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.searchLocale)===t.toLocaleLowerCase(this.searchLocale)},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return o.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return o.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?o.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},removeOption(e,t){const i=this.modelValue[t],n=this.modelValue.filter(((e,i)=>i!==t)).map((e=>this.getOptionValue(e)));this.updateModel(e,n),this.$emit("item-unselect",{originalEvent:e,value:i}),this.dirty=!0,l.focus(this.$refs.focusInput)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),(this.selectOnFocus||this.autoHighlight)&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=l.findSingle(this.list,`li[id="${t}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)}),0)},autoUpdateModel(){(this.selectOnFocus||this.autoHighlight)&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const n=this.getOptionGroupChildren(t);return n&&n.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-autocomplete p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-autocomplete-dd":this.dropdown,"p-autocomplete-multiple":this.multiple,"p-inputwrapper-filled":this.modelValue||o.isNotEmpty(this.inputValue),"p-inputwrapper-focus":this.focused,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-autocomplete-input p-inputtext p-component",this.inputClass,{"p-autocomplete-dd-input":this.dropdown}]},multiContainerClass:()=>["p-autocomplete-multiple-container p-component p-inputtext"],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}]},loadingIconClass(){return["p-autocomplete-loader pi-spin",this.loadingIcon]},visibleOptions(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue(){if(this.modelValue){if("object"==typeof this.modelValue){const e=this.getOptionLabel(this.modelValue);return null!=e?e:this.modelValue}return this.modelValue}return""},hasSelectedOption(){return o.isNotEmpty(this.modelValue)},equalityKey(){return this.dataKey},searchResultMessageText(){return o.isNotEmpty(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},id(){return this.$attrs.id||r()},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},focusedMultipleOptionId(){return-1!==this.focusedMultipleOptionIndex?`${this.id}_multiple_option_${this.focusedMultipleOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},components:{Button:e,VirtualScroller:p,Portal:i},directives:{ripple:n}};const K=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],D=["aria-activedescendant"],F=["id","aria-label","aria-setsize","aria-posinset"],T={class:"p-autocomplete-token-label"},E=["onClick"],A={class:"p-autocomplete-input-token",role:"option"},B=["id","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],R={role:"status","aria-live":"polite",class:"p-hidden-accessible"},z=["id"],P=["id"],G=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],H={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.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: -0.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"),$.render=function(e,t,i,n,o,s){const l=d("Button"),a=d("VirtualScroller"),r=d("Portal"),p=u("ripple");return c(),h("div",{ref:"container",class:f(s.containerClass),onClick:t[15]||(t[15]=(...e)=>s.onContainerClick&&s.onContainerClick(...e))},[i.multiple?m("",!0):(c(),h("input",y({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.inputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[3]||(t[3]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[4]||(t[4]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,K)),i.multiple?(c(),h("ul",{key:1,ref:"multiContainer",class:f(s.multiContainerClass),tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-activedescendant":o.focused?s.focusedMultipleOptionId:void 0,onFocus:t[10]||(t[10]=(...e)=>s.onMultipleContainerFocus&&s.onMultipleContainerFocus(...e)),onBlur:t[11]||(t[11]=(...e)=>s.onMultipleContainerBlur&&s.onMultipleContainerBlur(...e)),onKeydown:t[12]||(t[12]=(...e)=>s.onMultipleContainerKeyDown&&s.onMultipleContainerKeyDown(...e))},[(c(!0),h(b,null,g(i.modelValue,((t,n)=>(c(),h("li",{key:n,id:s.id+"_multiple_option_"+n,class:f(["p-autocomplete-token",{"p-focus":o.focusedMultipleOptionIndex===n}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":!0,"aria-setsize":i.modelValue.length,"aria-posinset":n+1},[O(e.$slots,"chip",{value:t},(()=>[v("span",T,x(s.getOptionLabel(t)),1)])),v("span",{class:f(["p-autocomplete-token-icon",i.removeTokenIcon]),onClick:e=>s.removeOption(e,n),"aria-hidden":"true"},null,10,E)],10,F)))),128)),v("li",A,[v("input",y({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-expanded":o.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[5]||(t[5]=(...e)=>s.onFocus&&s.onFocus(...e)),onBlur:t[6]||(t[6]=(...e)=>s.onBlur&&s.onBlur(...e)),onKeydown:t[7]||(t[7]=(...e)=>s.onKeyDown&&s.onKeyDown(...e)),onInput:t[8]||(t[8]=(...e)=>s.onInput&&s.onInput(...e)),onChange:t[9]||(t[9]=(...e)=>s.onChange&&s.onChange(...e))},i.inputProps),null,16,B)])],42,D)):m("",!0),o.searching?(c(),h("i",{key:2,class:f(s.loadingIconClass),"aria-hidden":"true"},null,2)):m("",!0),i.dropdown?(c(),I(l,{key:3,ref:"dropdownButton",type:"button",icon:i.dropdownIcon,class:f(["p-autocomplete-dropdown",i.dropdownClass]),tabindex:"-1",disabled:i.disabled,"aria-hidden":"true",onClick:s.onDropdownClick},null,8,["icon","class","disabled","onClick"])):m("",!0),v("span",R,x(s.searchResultMessageText),1),w(r,{appendTo:i.appendTo},{default:S((()=>[w(k,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:S((()=>[o.overlayVisible?(c(),h("div",y({key:0,ref:s.overlayRef,class:s.panelStyleClass,style:{...i.panelStyle,"max-height":s.virtualScrollerDisabled?i.scrollHeight:""},onClick:t[13]||(t[13]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...e))},i.panelProps),[O(e.$slots,"header",{value:i.modelValue,suggestions:s.visibleOptions}),w(a,y({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{style:{height:i.scrollHeight},items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled}),C({content:S((({styleClass:t,contentRef:i,items:n,getItemOptions:l,contentStyle:a,itemSize:r})=>[v("ul",{ref:e=>s.listRef(e,i),id:s.id+"_list",class:f(["p-autocomplete-items",t]),style:L(a),role:"listbox"},[(c(!0),h(b,null,g(n,((t,i)=>(c(),h(b,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,l))},[s.isOptionGroup(t)?(c(),h("li",{key:0,id:s.id+"_"+s.getOptionIndex(i,l),style:L({height:r?r+"px":void 0}),class:"p-autocomplete-item-group",role:"option"},[O(e.$slots,"optiongroup",{option:t.optionGroup,item:t.optionGroup,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionGroupLabel(t.optionGroup)),1)]))],12,P)):V((c(),h("li",{key:1,id:s.id+"_"+s.getOptionIndex(i,l),style:L({height:r?r+"px":void 0}),class:f(["p-autocomplete-item",{"p-highlight":s.isSelected(t),"p-focus":o.focusedOptionIndex===s.getOptionIndex(i,l),"p-disabled":s.isOptionDisabled(t)}]),role:"option","aria-label":s.getOptionLabel(t),"aria-selected":s.isSelected(t),"aria-disabled":s.isOptionDisabled(t),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(i,l)),onClick:e=>s.onOptionSelect(e,t),onMousemove:e=>s.onOptionMouseMove(e,s.getOptionIndex(i,l))},[e.$slots.option?O(e.$slots,"option",{key:0,option:t,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionLabel(t)),1)])):O(e.$slots,"item",{key:1,item:t,index:s.getOptionIndex(i,l)},(()=>[M(x(s.getOptionLabel(t)),1)]))],46,G)),[[p]])],64)))),128))],14,z)])),_:2},[e.$slots.loader?{name:"loader",fn:S((({options:t})=>[O(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["style","items","disabled"]),O(e.$slots,"footer",{value:i.modelValue,suggestions:s.visibleOptions}),v("span",H,x(s.selectedMessageText),1)],16)):m("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)};export{$ as default};
|