primevue 3.44.0 → 3.45.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/accordion/Accordion.vue +1 -0
- package/accordion/accordion.cjs.js +1 -0
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +1 -0
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +1 -0
- package/accordion/accordion.min.js +1 -1
- package/basecomponent/BaseComponent.vue +1 -1
- package/basecomponent/basecomponent.cjs.js +2 -2
- package/basecomponent/basecomponent.cjs.min.js +1 -1
- package/basecomponent/basecomponent.esm.js +2 -2
- package/basecomponent/basecomponent.esm.min.js +1 -1
- package/basecomponent/basecomponent.js +2 -2
- package/basecomponent/basecomponent.min.js +1 -1
- package/basecomponent/style/basecomponentstyle.cjs.js +1 -1
- package/basecomponent/style/basecomponentstyle.cjs.min.js +1 -1
- package/basecomponent/style/basecomponentstyle.esm.js +1 -1
- package/basecomponent/style/basecomponentstyle.esm.min.js +1 -1
- package/basecomponent/style/basecomponentstyle.js +1 -1
- package/basecomponent/style/basecomponentstyle.min.js +1 -1
- package/baseicon/BaseIcon.vue +8 -14
- package/baseicon/baseicon.cjs.js +10 -15
- package/baseicon/baseicon.cjs.min.js +1 -1
- package/baseicon/baseicon.esm.js +10 -15
- package/baseicon/baseicon.esm.min.js +1 -1
- package/baseicon/baseicon.js +10 -15
- package/baseicon/baseicon.min.js +1 -1
- package/calendar/Calendar.vue +5 -2
- package/calendar/calendar.cjs.js +5 -2
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +5 -2
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +5 -2
- package/calendar/calendar.min.js +1 -1
- package/cascadeselect/CascadeSelect.vue +1 -0
- package/cascadeselect/cascadeselect.cjs.js +1 -0
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +1 -0
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +1 -0
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/cascadeselect/style/cascadeselectstyle.cjs.js +1 -1
- package/cascadeselect/style/cascadeselectstyle.cjs.min.js +1 -1
- package/cascadeselect/style/cascadeselectstyle.esm.js +1 -1
- package/cascadeselect/style/cascadeselectstyle.esm.min.js +1 -1
- package/cascadeselect/style/cascadeselectstyle.js +1 -1
- package/cascadeselect/style/cascadeselectstyle.min.js +1 -1
- package/chips/Chips.vue +1 -0
- package/chips/chips.cjs.js +1 -0
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +1 -0
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +1 -0
- package/chips/chips.min.js +1 -1
- package/column/Column.vue +7 -0
- package/column/column.cjs.js +9 -0
- package/column/column.cjs.min.js +1 -1
- package/column/column.esm.js +9 -0
- package/column/column.esm.min.js +1 -1
- package/column/column.js +9 -0
- package/column/column.min.js +1 -1
- package/columngroup/ColumnGroup.vue +7 -0
- package/columngroup/columngroup.cjs.js +9 -0
- package/columngroup/columngroup.cjs.min.js +1 -1
- package/columngroup/columngroup.esm.js +9 -0
- package/columngroup/columngroup.esm.min.js +1 -1
- package/columngroup/columngroup.js +9 -0
- package/columngroup/columngroup.min.js +1 -1
- package/confirmdialog/ConfirmDialog.d.ts +1 -1
- package/confirmpopup/ConfirmPopup.vue +2 -2
- package/confirmpopup/confirmpopup.cjs.js +2 -2
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +2 -2
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +2 -2
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenu.vue +1 -0
- package/contextmenu/contextmenu.cjs.js +1 -0
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +1 -0
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +1 -0
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +276 -132
- package/core/core.min.js +22 -22
- package/datatable/BaseDataTable.vue +2 -2
- package/datatable/BodyRow.vue +578 -0
- package/datatable/ColumnFilter.vue +1 -0
- package/datatable/DataTable.d.ts +1 -1
- package/datatable/DataTable.vue +111 -132
- package/datatable/HeaderCell.vue +9 -7
- package/datatable/TableBody.vue +74 -414
- package/datatable/TableFooter.vue +19 -26
- package/datatable/TableHeader.vue +19 -26
- package/datatable/datatable.cjs.js +891 -634
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +892 -635
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +891 -634
- package/datatable/datatable.min.js +1 -1
- package/datatable/style/datatablestyle.cjs.js +5 -4
- package/datatable/style/datatablestyle.cjs.min.js +1 -1
- package/datatable/style/datatablestyle.esm.js +5 -4
- package/datatable/style/datatablestyle.esm.min.js +1 -1
- package/datatable/style/datatablestyle.js +5 -4
- package/datatable/style/datatablestyle.min.js +1 -1
- package/dialog/style/dialogstyle.cjs.js +1 -1
- package/dialog/style/dialogstyle.cjs.min.js +1 -1
- package/dialog/style/dialogstyle.esm.js +1 -1
- package/dialog/style/dialogstyle.esm.min.js +1 -1
- package/dialog/style/dialogstyle.js +1 -1
- package/dialog/style/dialogstyle.min.js +1 -1
- package/dock/DockSub.vue +1 -0
- package/dock/dock.cjs.js +1 -0
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +1 -0
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +1 -0
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.vue +26 -0
- package/dropdown/dropdown.cjs.js +49 -25
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +49 -25
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +49 -25
- package/dropdown/dropdown.min.js +1 -1
- package/fieldset/Fieldset.vue +1 -1
- package/fieldset/fieldset.cjs.js +1 -1
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +1 -1
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +1 -1
- package/fieldset/fieldset.min.js +1 -1
- package/galleria/GalleriaItem.vue +1 -0
- package/galleria/GalleriaThumbnails.vue +1 -1
- package/galleria/galleria.cjs.js +2 -1
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +2 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +2 -1
- package/galleria/galleria.min.js +1 -1
- package/icons/sortamountdown/index.cjs.js +10 -7
- package/icons/sortamountdown/index.cjs.min.js +1 -1
- package/icons/sortamountdown/index.esm.js +11 -8
- package/icons/sortamountdown/index.esm.min.js +1 -1
- package/icons/sortamountdown/index.js +10 -7
- package/icons/sortamountdown/index.min.js +1 -1
- package/icons/sortamountdown/index.vue +1 -21
- package/icons/sortamountupalt/index.cjs.js +10 -7
- package/icons/sortamountupalt/index.cjs.min.js +1 -1
- package/icons/sortamountupalt/index.esm.js +11 -8
- package/icons/sortamountupalt/index.esm.min.js +1 -1
- package/icons/sortamountupalt/index.js +10 -7
- package/icons/sortamountupalt/index.min.js +1 -1
- package/icons/sortamountupalt/index.vue +1 -21
- package/image/Image.vue +2 -6
- package/image/image.cjs.js +2 -5
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +2 -5
- package/image/image.esm.min.js +1 -1
- package/image/image.js +2 -5
- package/image/image.min.js +1 -1
- package/image/style/imagestyle.cjs.js +1 -1
- package/image/style/imagestyle.cjs.min.js +1 -1
- package/image/style/imagestyle.esm.js +1 -1
- package/image/style/imagestyle.esm.min.js +1 -1
- package/image/style/imagestyle.js +1 -1
- package/image/style/imagestyle.min.js +1 -1
- package/inputnumber/BaseInputNumber.vue +7 -0
- package/inputnumber/InputNumber.d.ts +7 -0
- package/inputnumber/InputNumber.vue +4 -3
- package/inputnumber/inputnumber.cjs.js +13 -3
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +13 -3
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +13 -3
- package/inputnumber/inputnumber.min.js +1 -1
- package/knob/Knob.vue +1 -1
- package/knob/knob.cjs.js +1 -1
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +1 -1
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +1 -1
- package/knob/knob.min.js +1 -1
- package/listbox/BaseListbox.vue +1 -1
- package/listbox/Listbox.d.ts +1 -1
- package/listbox/Listbox.vue +2 -0
- package/listbox/listbox.cjs.js +3 -1
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +3 -1
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +3 -1
- package/listbox/listbox.min.js +1 -1
- package/megamenu/MegaMenu.vue +2 -1
- package/megamenu/megamenu.cjs.js +2 -1
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +2 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +2 -1
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.vue +1 -0
- package/menu/menu.cjs.js +1 -0
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +1 -0
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +1 -0
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.vue +2 -1
- package/menubar/menubar.cjs.js +2 -1
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +2 -1
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +2 -1
- package/menubar/menubar.min.js +1 -1
- package/menuitem/MenuItem.d.ts +0 -6
- package/message/style/messagestyle.cjs.js +1 -1
- package/message/style/messagestyle.cjs.min.js +1 -1
- package/message/style/messagestyle.esm.js +1 -1
- package/message/style/messagestyle.esm.min.js +1 -1
- package/message/style/messagestyle.js +1 -1
- package/message/style/messagestyle.min.js +1 -1
- package/multiselect/MultiSelect.vue +2 -0
- package/multiselect/multiselect.cjs.js +2 -0
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +2 -0
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +2 -0
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/BaseOrderList.vue +1 -1
- package/orderlist/OrderList.d.ts +1 -1
- package/orderlist/OrderList.vue +1 -0
- package/orderlist/orderlist.cjs.js +2 -1
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +2 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +2 -1
- package/orderlist/orderlist.min.js +1 -1
- package/organizationchart/OrganizationChartNode.vue +1 -1
- package/organizationchart/organizationchart.cjs.js +1 -1
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +1 -1
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +1 -1
- package/organizationchart/organizationchart.min.js +1 -1
- package/package.json +1 -1
- package/paginator/Paginator.vue +4 -4
- package/paginator/paginator.cjs.js +2 -2
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +2 -2
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +2 -2
- package/paginator/paginator.min.js +1 -1
- package/panel/Panel.vue +1 -1
- package/panel/panel.cjs.js +1 -1
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +1 -1
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +1 -1
- package/panel/panel.min.js +1 -1
- package/panelmenu/PanelMenu.vue +1 -0
- package/panelmenu/PanelMenuList.vue +1 -0
- package/panelmenu/panelmenu.cjs.js +2 -0
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +2 -0
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +2 -0
- package/panelmenu/panelmenu.min.js +1 -1
- package/picklist/BasePickList.vue +1 -1
- package/picklist/PickList.d.ts +1 -1
- package/picklist/PickList.vue +2 -1
- package/picklist/picklist.cjs.js +3 -2
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +3 -2
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +3 -2
- package/picklist/picklist.min.js +1 -1
- package/picklist/style/pickliststyle.cjs.js +1 -1
- package/picklist/style/pickliststyle.cjs.min.js +1 -1
- package/picklist/style/pickliststyle.esm.js +1 -1
- package/picklist/style/pickliststyle.esm.min.js +1 -1
- package/picklist/style/pickliststyle.js +1 -1
- package/picklist/style/pickliststyle.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +4 -4
- package/resources/themes/arya-green/theme.css +4 -4
- package/resources/themes/arya-orange/theme.css +4 -4
- package/resources/themes/arya-purple/theme.css +4 -4
- package/resources/themes/bootstrap4-dark-blue/theme.css +4 -4
- package/resources/themes/bootstrap4-dark-purple/theme.css +4 -4
- package/resources/themes/bootstrap4-light-blue/theme.css +4 -4
- package/resources/themes/bootstrap4-light-purple/theme.css +4 -4
- package/resources/themes/fluent-light/theme.css +4 -4
- package/resources/themes/lara-dark-amber/theme.css +4 -4
- package/resources/themes/lara-dark-blue/theme.css +4 -4
- package/resources/themes/lara-dark-cyan/theme.css +4 -4
- package/resources/themes/lara-dark-green/theme.css +4 -4
- package/resources/themes/lara-dark-indigo/theme.css +4 -4
- package/resources/themes/lara-dark-pink/theme.css +4 -4
- package/resources/themes/lara-dark-purple/theme.css +4 -4
- package/resources/themes/lara-dark-teal/theme.css +4 -4
- package/resources/themes/lara-light-amber/theme.css +4 -4
- package/resources/themes/lara-light-blue/theme.css +4 -4
- package/resources/themes/lara-light-cyan/theme.css +4 -4
- package/resources/themes/lara-light-green/theme.css +4 -4
- package/resources/themes/lara-light-indigo/theme.css +4 -4
- package/resources/themes/lara-light-pink/theme.css +4 -4
- package/resources/themes/lara-light-purple/theme.css +4 -4
- package/resources/themes/lara-light-teal/theme.css +44 -44
- package/resources/themes/luna-amber/theme.css +4 -4
- package/resources/themes/luna-blue/theme.css +4 -4
- package/resources/themes/luna-green/theme.css +4 -4
- package/resources/themes/luna-pink/theme.css +4 -4
- package/resources/themes/md-dark-deeppurple/theme.css +4 -4
- package/resources/themes/md-dark-indigo/theme.css +4 -4
- package/resources/themes/md-light-deeppurple/theme.css +4 -4
- package/resources/themes/md-light-indigo/theme.css +4 -4
- package/resources/themes/mdc-dark-deeppurple/theme.css +4 -4
- package/resources/themes/mdc-dark-indigo/theme.css +4 -4
- package/resources/themes/mdc-light-deeppurple/theme.css +4 -4
- package/resources/themes/mdc-light-indigo/theme.css +4 -4
- package/resources/themes/mira/theme.css +4 -4
- package/resources/themes/nano/theme.css +4 -4
- package/resources/themes/nova/theme.css +4 -4
- package/resources/themes/nova-accent/theme.css +4 -4
- package/resources/themes/nova-alt/theme.css +4 -4
- package/resources/themes/nova-vue/theme.css +4 -4
- package/resources/themes/rhea/theme.css +4 -4
- package/resources/themes/saga-blue/theme.css +4 -4
- package/resources/themes/saga-green/theme.css +4 -4
- package/resources/themes/saga-orange/theme.css +4 -4
- package/resources/themes/saga-purple/theme.css +4 -4
- package/resources/themes/soho-dark/theme.css +4 -4
- package/resources/themes/soho-light/theme.css +4 -4
- package/resources/themes/tailwind-light/theme.css +4 -4
- package/resources/themes/vela-blue/theme.css +4 -4
- package/resources/themes/vela-green/theme.css +4 -4
- package/resources/themes/vela-orange/theme.css +4 -4
- package/resources/themes/vela-purple/theme.css +4 -4
- package/resources/themes/viva-dark/theme.css +4 -4
- package/resources/themes/viva-light/theme.css +4 -4
- package/ripple/style/ripplestyle.cjs.js +1 -1
- package/ripple/style/ripplestyle.cjs.min.js +1 -1
- package/ripple/style/ripplestyle.esm.js +1 -1
- package/ripple/style/ripplestyle.esm.min.js +1 -1
- package/ripple/style/ripplestyle.js +1 -1
- package/ripple/style/ripplestyle.min.js +1 -1
- package/row/Row.vue +7 -0
- package/row/row.cjs.js +9 -0
- package/row/row.cjs.min.js +1 -1
- package/row/row.esm.js +9 -0
- package/row/row.esm.min.js +1 -1
- package/row/row.js +9 -0
- package/row/row.min.js +1 -1
- package/slider/Slider.vue +26 -19
- package/slider/slider.cjs.js +19 -11
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +19 -11
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +19 -11
- package/slider/slider.min.js +1 -1
- package/speeddial/SpeedDial.vue +1 -0
- package/speeddial/speeddial.cjs.js +1 -0
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +1 -0
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +1 -0
- package/speeddial/speeddial.min.js +1 -1
- package/steps/Steps.vue +1 -0
- package/steps/steps.cjs.js +1 -0
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +1 -0
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +1 -0
- package/steps/steps.min.js +1 -1
- package/tabmenu/TabMenu.vue +1 -0
- package/tabmenu/tabmenu.cjs.js +1 -0
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +1 -0
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +1 -0
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabview/TabView.vue +1 -0
- package/tabview/tabview.cjs.js +1 -0
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +1 -0
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +1 -0
- package/tabview/tabview.min.js +1 -1
- package/terminal/Terminal.vue +1 -1
- package/terminal/terminal.cjs.js +1 -1
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +1 -1
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +1 -1
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/TieredMenu.vue +1 -0
- package/tieredmenu/tieredmenu.cjs.js +1 -0
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +1 -0
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +1 -0
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/tree/BaseTree.vue +1 -1
- package/tree/Tree.d.ts +1 -1
- package/tree/Tree.vue +1 -1
- package/tree/TreeNode.vue +1 -0
- package/tree/tree.cjs.js +3 -2
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +3 -2
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +3 -2
- package/tree/tree.min.js +1 -1
- package/treeselect/BaseTreeSelect.vue +1 -1
- package/treeselect/TreeSelect.d.ts +1 -1
- package/treeselect/TreeSelect.vue +1 -0
- package/treeselect/treeselect.cjs.js +2 -1
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +2 -1
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +2 -1
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/BaseTreeTable.vue +5 -1
- package/treetable/HeaderCell.vue +1 -1
- package/treetable/TreeTable.d.ts +6 -1
- package/treetable/TreeTable.vue +32 -24
- package/treetable/TreeTableRow.vue +32 -20
- package/treetable/style/treetablestyle.cjs.js +1 -1
- package/treetable/style/treetablestyle.cjs.min.js +1 -1
- package/treetable/style/treetablestyle.esm.js +1 -1
- package/treetable/style/treetablestyle.esm.min.js +1 -1
- package/treetable/style/treetablestyle.js +1 -1
- package/treetable/style/treetablestyle.min.js +1 -1
- package/treetable/treetable.cjs.js +70 -43
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +71 -44
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +70 -43
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.vue +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +1 -1
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/utils/Utils.d.ts +9 -0
- package/utils/utils.cjs.js +142 -41
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +142 -42
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +142 -41
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +4 -0
- package/vetur-tags.json +1 -0
- package/virtualscroller/VirtualScroller.vue +19 -15
- package/virtualscroller/style/virtualscrollerstyle.cjs.js +1 -1
- package/virtualscroller/style/virtualscrollerstyle.cjs.min.js +1 -1
- package/virtualscroller/style/virtualscrollerstyle.esm.js +1 -1
- package/virtualscroller/style/virtualscrollerstyle.esm.min.js +1 -1
- package/virtualscroller/style/virtualscrollerstyle.js +1 -1
- package/virtualscroller/style/virtualscrollerstyle.min.js +1 -1
- package/virtualscroller/virtualscroller.cjs.js +19 -15
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +19 -15
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +19 -15
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +11 -1
package/dropdown/dropdown.esm.js
CHANGED
|
@@ -192,6 +192,7 @@ var script = {
|
|
|
192
192
|
outsideClickListener: null,
|
|
193
193
|
scrollHandler: null,
|
|
194
194
|
resizeListener: null,
|
|
195
|
+
labelClickListener: null,
|
|
195
196
|
overlay: null,
|
|
196
197
|
list: null,
|
|
197
198
|
virtualScroller: null,
|
|
@@ -222,6 +223,7 @@ var script = {
|
|
|
222
223
|
mounted: function mounted() {
|
|
223
224
|
this.id = this.id || UniqueComponentId();
|
|
224
225
|
this.autoUpdateModel();
|
|
226
|
+
this.bindLabelClickListener();
|
|
225
227
|
},
|
|
226
228
|
updated: function updated() {
|
|
227
229
|
if (this.overlayVisible && this.isModelValueChanged) {
|
|
@@ -232,6 +234,7 @@ var script = {
|
|
|
232
234
|
beforeUnmount: function beforeUnmount() {
|
|
233
235
|
this.unbindOutsideClickListener();
|
|
234
236
|
this.unbindResizeListener();
|
|
237
|
+
this.unbindLabelClickListener();
|
|
235
238
|
if (this.scrollHandler) {
|
|
236
239
|
this.scrollHandler.destroy();
|
|
237
240
|
this.scrollHandler = null;
|
|
@@ -445,6 +448,7 @@ var script = {
|
|
|
445
448
|
this.onEndKey(event, true);
|
|
446
449
|
break;
|
|
447
450
|
case 'Enter':
|
|
451
|
+
case 'NumpadEnter':
|
|
448
452
|
this.onEnterKey(event);
|
|
449
453
|
break;
|
|
450
454
|
case 'Escape':
|
|
@@ -663,6 +667,26 @@ var script = {
|
|
|
663
667
|
this.resizeListener = null;
|
|
664
668
|
}
|
|
665
669
|
},
|
|
670
|
+
bindLabelClickListener: function bindLabelClickListener() {
|
|
671
|
+
var _this6 = this;
|
|
672
|
+
if (!this.editable && !this.labelClickListener) {
|
|
673
|
+
var label = document.querySelector("label[for=\"".concat(this.inputId, "\"]"));
|
|
674
|
+
if (label && DomHandler.isVisible(label)) {
|
|
675
|
+
this.labelClickListener = function () {
|
|
676
|
+
DomHandler.focus(_this6.$refs.focusInput);
|
|
677
|
+
};
|
|
678
|
+
label.addEventListener('click', this.labelClickListener);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
unbindLabelClickListener: function unbindLabelClickListener() {
|
|
683
|
+
if (this.labelClickListener) {
|
|
684
|
+
var label = document.querySelector("label[for=\"".concat(this.inputId, "\"]"));
|
|
685
|
+
if (label && DomHandler.isVisible(label)) {
|
|
686
|
+
label.removeEventListener('click', this.labelClickListener);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
},
|
|
666
690
|
hasFocusableElements: function hasFocusableElements() {
|
|
667
691
|
return DomHandler.getFocusableElements(this.overlay, ':not([data-p-hidden-focusable="true"])').length > 0;
|
|
668
692
|
},
|
|
@@ -679,35 +703,35 @@ var script = {
|
|
|
679
703
|
return this.isValidOption(option) && ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
|
|
680
704
|
},
|
|
681
705
|
findFirstOptionIndex: function findFirstOptionIndex() {
|
|
682
|
-
var
|
|
706
|
+
var _this7 = this;
|
|
683
707
|
return this.visibleOptions.findIndex(function (option) {
|
|
684
|
-
return
|
|
708
|
+
return _this7.isValidOption(option);
|
|
685
709
|
});
|
|
686
710
|
},
|
|
687
711
|
findLastOptionIndex: function findLastOptionIndex() {
|
|
688
|
-
var
|
|
712
|
+
var _this8 = this;
|
|
689
713
|
return ObjectUtils.findLastIndex(this.visibleOptions, function (option) {
|
|
690
|
-
return
|
|
714
|
+
return _this8.isValidOption(option);
|
|
691
715
|
});
|
|
692
716
|
},
|
|
693
717
|
findNextOptionIndex: function findNextOptionIndex(index) {
|
|
694
|
-
var
|
|
718
|
+
var _this9 = this;
|
|
695
719
|
var matchedOptionIndex = index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function (option) {
|
|
696
|
-
return
|
|
720
|
+
return _this9.isValidOption(option);
|
|
697
721
|
}) : -1;
|
|
698
722
|
return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
|
|
699
723
|
},
|
|
700
724
|
findPrevOptionIndex: function findPrevOptionIndex(index) {
|
|
701
|
-
var
|
|
725
|
+
var _this10 = this;
|
|
702
726
|
var matchedOptionIndex = index > 0 ? ObjectUtils.findLastIndex(this.visibleOptions.slice(0, index), function (option) {
|
|
703
|
-
return
|
|
727
|
+
return _this10.isValidOption(option);
|
|
704
728
|
}) : -1;
|
|
705
729
|
return matchedOptionIndex > -1 ? matchedOptionIndex : index;
|
|
706
730
|
},
|
|
707
731
|
findSelectedOptionIndex: function findSelectedOptionIndex() {
|
|
708
|
-
var
|
|
732
|
+
var _this11 = this;
|
|
709
733
|
return this.hasSelectedOption ? this.visibleOptions.findIndex(function (option) {
|
|
710
|
-
return
|
|
734
|
+
return _this11.isValidSelectedOption(option);
|
|
711
735
|
}) : -1;
|
|
712
736
|
},
|
|
713
737
|
findFirstFocusedOptionIndex: function findFirstFocusedOptionIndex() {
|
|
@@ -719,20 +743,20 @@ var script = {
|
|
|
719
743
|
return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
|
|
720
744
|
},
|
|
721
745
|
searchOptions: function searchOptions(event, _char) {
|
|
722
|
-
var
|
|
746
|
+
var _this12 = this;
|
|
723
747
|
this.searchValue = (this.searchValue || '') + _char;
|
|
724
748
|
var optionIndex = -1;
|
|
725
749
|
var matched = false;
|
|
726
750
|
if (this.focusedOptionIndex !== -1) {
|
|
727
751
|
optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(function (option) {
|
|
728
|
-
return
|
|
752
|
+
return _this12.isOptionMatched(option);
|
|
729
753
|
});
|
|
730
754
|
optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(function (option) {
|
|
731
|
-
return
|
|
755
|
+
return _this12.isOptionMatched(option);
|
|
732
756
|
}) : optionIndex + this.focusedOptionIndex;
|
|
733
757
|
} else {
|
|
734
758
|
optionIndex = this.visibleOptions.findIndex(function (option) {
|
|
735
|
-
return
|
|
759
|
+
return _this12.isOptionMatched(option);
|
|
736
760
|
});
|
|
737
761
|
}
|
|
738
762
|
if (optionIndex !== -1) {
|
|
@@ -748,8 +772,8 @@ var script = {
|
|
|
748
772
|
clearTimeout(this.searchTimeout);
|
|
749
773
|
}
|
|
750
774
|
this.searchTimeout = setTimeout(function () {
|
|
751
|
-
|
|
752
|
-
|
|
775
|
+
_this12.searchValue = '';
|
|
776
|
+
_this12.searchTimeout = null;
|
|
753
777
|
}, 500);
|
|
754
778
|
return matched;
|
|
755
779
|
},
|
|
@@ -763,7 +787,7 @@ var script = {
|
|
|
763
787
|
}
|
|
764
788
|
},
|
|
765
789
|
scrollInView: function scrollInView() {
|
|
766
|
-
var
|
|
790
|
+
var _this13 = this;
|
|
767
791
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
768
792
|
var id = index !== -1 ? "".concat(this.id, "_").concat(index) : this.focusedOptionId;
|
|
769
793
|
var element = DomHandler.findSingle(this.list, "li[id=\"".concat(id, "\"]"));
|
|
@@ -774,7 +798,7 @@ var script = {
|
|
|
774
798
|
});
|
|
775
799
|
} else if (!this.virtualScrollerDisabled) {
|
|
776
800
|
setTimeout(function () {
|
|
777
|
-
|
|
801
|
+
_this13.virtualScroller && _this13.virtualScroller.scrollToIndex(index !== -1 ? index : _this13.focusedOptionIndex);
|
|
778
802
|
}, 0);
|
|
779
803
|
}
|
|
780
804
|
},
|
|
@@ -792,14 +816,14 @@ var script = {
|
|
|
792
816
|
});
|
|
793
817
|
},
|
|
794
818
|
flatOptions: function flatOptions(options) {
|
|
795
|
-
var
|
|
819
|
+
var _this14 = this;
|
|
796
820
|
return (options || []).reduce(function (result, option, index) {
|
|
797
821
|
result.push({
|
|
798
822
|
optionGroup: option,
|
|
799
823
|
group: true,
|
|
800
824
|
index: index
|
|
801
825
|
});
|
|
802
|
-
var optionGroupChildren =
|
|
826
|
+
var optionGroupChildren = _this14.getOptionGroupChildren(option);
|
|
803
827
|
optionGroupChildren && optionGroupChildren.forEach(function (o) {
|
|
804
828
|
return result.push(o);
|
|
805
829
|
});
|
|
@@ -819,7 +843,7 @@ var script = {
|
|
|
819
843
|
},
|
|
820
844
|
computed: {
|
|
821
845
|
visibleOptions: function visibleOptions() {
|
|
822
|
-
var
|
|
846
|
+
var _this15 = this;
|
|
823
847
|
var options = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];
|
|
824
848
|
if (this.filterValue) {
|
|
825
849
|
var filteredOptions = FilterService.filter(options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
|
|
@@ -827,11 +851,11 @@ var script = {
|
|
|
827
851
|
var optionGroups = this.options || [];
|
|
828
852
|
var filtered = [];
|
|
829
853
|
optionGroups.forEach(function (group) {
|
|
830
|
-
var groupChildren =
|
|
854
|
+
var groupChildren = _this15.getOptionGroupChildren(group);
|
|
831
855
|
var filteredItems = groupChildren.filter(function (item) {
|
|
832
856
|
return filteredOptions.includes(item);
|
|
833
857
|
});
|
|
834
|
-
if (filteredItems.length > 0) filtered.push(_objectSpread$1(_objectSpread$1({}, group), {}, _defineProperty$1({}, typeof
|
|
858
|
+
if (filteredItems.length > 0) filtered.push(_objectSpread$1(_objectSpread$1({}, group), {}, _defineProperty$1({}, typeof _this15.optionGroupChildren === 'string' ? _this15.optionGroupChildren : 'items', _toConsumableArray(filteredItems))));
|
|
835
859
|
});
|
|
836
860
|
return this.flatOptions(filtered);
|
|
837
861
|
}
|
|
@@ -881,9 +905,9 @@ var script = {
|
|
|
881
905
|
return this.focusedOptionIndex !== -1 ? "".concat(this.id, "_").concat(this.focusedOptionIndex) : null;
|
|
882
906
|
},
|
|
883
907
|
ariaSetSize: function ariaSetSize() {
|
|
884
|
-
var
|
|
908
|
+
var _this16 = this;
|
|
885
909
|
return this.visibleOptions.filter(function (option) {
|
|
886
|
-
return !
|
|
910
|
+
return !_this16.isOptionGroup(option);
|
|
887
911
|
}).length;
|
|
888
912
|
},
|
|
889
913
|
virtualScrollerDisabled: function virtualScrollerDisabled() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FilterService as e}from"primevue/api";import t from"primevue/icons/chevrondown";import i from"primevue/icons/filter";import n from"primevue/icons/spinner";import o from"primevue/icons/times";import s from"primevue/overlayeventbus";import r from"primevue/portal";import l from"primevue/ripple";import{UniqueComponentId as a,ZIndexUtils as c,ObjectUtils as u,DomHandler as d,ConnectedOverlayScrollHandler as p}from"primevue/utils";import h from"primevue/virtualscroller";import f from"primevue/basecomponent";import y from"primevue/dropdown/style";import{resolveComponent as b,resolveDirective as v,openBlock as O,createElementBlock as m,mergeProps as g,renderSlot as I,createTextVNode as x,toDisplayString as S,normalizeClass as w,createBlock as F,resolveDynamicComponent as L,createCommentVNode as V,createElementVNode as k,createVNode as C,withCtx as D,Transition as M,createSlots as K,Fragment as E,renderList as P,withDirectives as T}from"vue";function $(e){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(e)}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e,t){if(e){if("string"==typeof e)return B(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?B(e,t):void 0}}function H(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function G(e){if(Array.isArray(e))return B(e)}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function R(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function z(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?R(Object(i),!0).forEach((function(t){U(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function U(e,t,i){var n;return(t="symbol"==$(n=N(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function N(e,t){if("object"!=$(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var _={name:"Dropdown",extends:{name:"BaseDropdown",extends:f,props:{modelValue:null,options:Array,optionLabel:[String,Function],optionValue:[String,Function],optionDisabled:[String,Function],optionGroupLabel:[String,Function],optionGroupChildren:[String,Function],scrollHeight:{type:String,default:"200px"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},clearIconProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:void 0},dropdownIcon:{type:String,default:void 0},filterIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:y,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,focusOnHover:!1,data:function(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||a()},modelValue:function(){this.isModelValueChanged=!0},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||a(),this.autoUpdateModel()},updated:function(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(c.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?u.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?u.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,t){return(this.dataKey?u.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},getPTItemOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&u.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return u.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return u.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},show:function(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&d.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.focusedOptionIndex=-1,t.searchValue="",t.resetFilterOnHide&&(t.filterValue=null),e&&d.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(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:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||d.isAndroid())e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,this.editable);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,this.editable);break;case"Delete":this.onDeleteKey(e);case"Home":this.onHomeKey(e,this.editable);break;case"End":this.onEndKey(e,this.editable);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Space":this.onSpaceKey(e,this.editable);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e,this.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&u.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),!this.editable&&this.searchOptions(e,e.key))}}},onEditableInput:function(e){var t=e.target.value;this.searchValue="",!this.searchOptions(e,t)&&(this.focusedOptionIndex=-1),this.updateModel(e,t),!this.overlayVisible&&u.isNotEmpty(t)&&this.show()},onContainerClick:function(e){this.disabled||this.loading||"INPUT"===e.target.tagName||"clearicon"===e.target.getAttribute("data-pc-section")||e.target.closest('[data-pc-section="clearicon"]')||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onClearClick:function(e){this.updateModel(e,null)},onFirstHiddenFocus:function(e){var t=e.relatedTarget===this.$refs.focusInput?d.getFirstFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;d.focus(t)},onLastHiddenFocus:function(e){var t=e.relatedTarget===this.$refs.focusInput?d.getLastFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;d.focus(t)},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t);this.updateModel(e,n),i&&this.hide(!0)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onFilterChange:function(e){var t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur:function(){this.focusedOptionIndex=-1},onFilterUpdated:function(){this.overlayVisible&&this.alignOverlay()},onOverlayClick:function(e){s.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onDeleteKey:function(e){this.showClear&&(this.updateModel(e,null),e.preventDefault())},onArrowDownKey:function(e){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey&&!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1):(this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show()),e.preventDefault()},onEndKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show();e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onSpaceKey:function(e){!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||(this.overlayVisible&&this.hasFocusableElements()?(d.focus(this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onBackspaceKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&!this.overlayVisible&&this.show()},onOverlayEnter:function(e){c.set("overlay",e,this.$primevue.config.zIndex.overlay),d.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&d.focus(this.$refs.filterInput)},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave:function(e){c.clear(e)},alignOverlay:function(){"self"===this.appendTo?d.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=d.getOuterWidth(this.$el)+"px",d.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new p(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!d.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},hasFocusableElements:function(){return d.getFocusableElements(this.overlay,':not([data-p-hidden-focusable="true"])').length>0},isOptionMatched:function(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption:function(e){return u.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.isValidOption(e)&&u.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return u.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?u.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionIndex?-1===(n=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionIndex&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=-1!==t?"".concat(this.id,"_").concat(t):this.focusedOptionId,n=d.findSingle(this.list,'li[id="'.concat(i,'"]'));n?n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((function(){e.virtualScroller&&e.virtualScroller.scrollToIndex(-1!==t?t:e.focusedOptionIndex)}),0)},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},overlayRef:function(e){this.overlay=e},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var t=this,i=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){var n=e.filter(i,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){var o=[];return(this.options||[]).forEach((function(e){var i,s=t.getOptionGroupChildren(e).filter((function(e){return n.includes(e)}));s.length>0&&o.push(z(z({},e),{},U({},"string"==typeof t.optionGroupChildren?t.optionGroupChildren:"items",G(i=s)||H(i)||j(i)||A())))})),this.flatOptions(o)}return n}return i},hasSelectedOption:function(){return u.isNotEmpty(this.modelValue)},label:function(){var e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.placeholder||"p-emptylabel"},editableInputValue:function(){var e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.modelValue||""},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},filterResultMessageText:function(){return u.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:l},components:{VirtualScroller:h,Portal:r,TimesIcon:o,ChevronDownIcon:t,SpinnerIcon:n,FilterIcon:i}};function q(e){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(e)}function W(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function J(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?W(Object(i),!0).forEach((function(t){Q(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):W(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Q(e,t,i){var n;return(t="symbol"==q(n=X(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function X(e,t){if("object"!=q(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var Y=["id"],Z=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],ee=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],te=["value","placeholder","aria-owns","aria-activedescendant"],ie=["id"],ne=["id"],oe=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"];_.render=function(e,t,i,n,o,s){var r=b("SpinnerIcon"),l=b("VirtualScroller"),a=b("Portal"),c=v("ripple");return O(),m("div",g({ref:"container",id:o.id,class:e.cx("root"),onClick:t[15]||(t[15]=function(){return s.onContainerClick&&s.onContainerClick.apply(s,arguments)})},e.ptm("root"),{"data-pc-name":"dropdown"}),[e.editable?(O(),m("input",g({key:0,ref:"focusInput",id:e.inputId,type:"text",class:[e.cx("input"),e.inputClass],style:e.inputStyle,value:s.editableInputValue,placeholder:e.placeholder,tabindex:e.disabled?-1:e.tabindex,disabled:e.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)}),onInput:t[3]||(t[3]=function(){return s.onEditableInput&&s.onEditableInput.apply(s,arguments)})},J(J({},e.inputProps),e.ptm("input"))),null,16,Z)):(O(),m("span",g({key:1,ref:"focusInput",id:e.inputId,class:[e.cx("input"),e.inputClass],style:e.inputStyle,tabindex:e.disabled?-1:e.tabindex,role:"combobox","aria-label":e.ariaLabel||("p-emptylabel"===s.label?void 0:s.label),"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":e.disabled,onFocus:t[4]||(t[4]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[5]||(t[5]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[6]||(t[6]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},J(J({},e.inputProps),e.ptm("input"))),[I(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[x(S("p-emptylabel"===s.label?" ":s.label||"empty"),1)]}))],16,ee)),e.showClear&&null!=e.modelValue?I(e.$slots,"clearicon",{key:2,class:w(e.cx("clearIcon")),onClick:s.onClearClick,clearCallback:s.onClearClick},(function(){return[(O(),F(L(e.clearIcon?"i":"TimesIcon"),g({ref:"clearIcon",class:[e.cx("clearIcon"),e.clearIcon],onClick:s.onClearClick},J(J({},e.clearIconProps),e.ptm("clearIcon")),{"data-pc-section":"clearicon"}),null,16,["class","onClick"]))]})):V("",!0),k("div",g({class:e.cx("trigger")},e.ptm("trigger")),[e.loading?I(e.$slots,"loadingicon",{key:0,class:w(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(O(),m("span",g({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(O(),F(r,g({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):I(e.$slots,"dropdownicon",{key:1,class:w(e.cx("dropdownIcon"))},(function(){return[(O(),F(L(e.dropdownIcon?"span":"ChevronDownIcon"),g({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),C(a,{appendTo:e.appendTo},{default:D((function(){return[C(M,g({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:D((function(){return[o.overlayVisible?(O(),m("div",g({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[13]||(t[13]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[14]||(t[14]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},J(J({},e.panelProps),e.ptm("panel"))),[k("span",g({ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[7]||(t[7]=function(){return s.onFirstHiddenFocus&&s.onFirstHiddenFocus.apply(s,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16),I(e.$slots,"header",{value:e.modelValue,options:s.visibleOptions}),e.filter?(O(),m("div",g({key:0,class:e.cx("header")},e.ptm("header")),[k("div",g({class:e.cx("filterContainer")},e.ptm("filterContainer")),[k("input",g({ref:"filterInput",type:"text",value:o.filterValue,onVnodeMounted:t[8]||(t[8]=function(){return s.onFilterUpdated&&s.onFilterUpdated.apply(s,arguments)}),class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,onKeydown:t[9]||(t[9]=function(){return s.onFilterKeyDown&&s.onFilterKeyDown.apply(s,arguments)}),onBlur:t[10]||(t[10]=function(){return s.onFilterBlur&&s.onFilterBlur.apply(s,arguments)}),onInput:t[11]||(t[11]=function(){return s.onFilterChange&&s.onFilterChange.apply(s,arguments)})},J(J({},e.filterInputProps),e.ptm("filterInput"))),null,16,te),I(e.$slots,"filtericon",{class:w(e.cx("filterIcon"))},(function(){return[(O(),F(L(e.filterIcon?"span":"FilterIcon"),g({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16),k("span",g({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),S(s.filterResultMessageText),17)],16)):V("",!0),k("div",g({class:e.cx("wrapper"),style:{"max-height":s.virtualScrollerDisabled?e.scrollHeight:""}},e.ptm("wrapper")),[C(l,g({ref:s.virtualScrollerRef},e.virtualScrollerOptions,{items:s.visibleOptions,style:{height:e.scrollHeight},tabindex:-1,disabled:s.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),K({content:D((function(t){var i=t.styleClass,n=t.contentRef,r=t.items,l=t.getItemOptions,a=t.contentStyle,u=t.itemSize;return[k("ul",g({ref:function(e){return s.listRef(e,n)},id:o.id+"_list",class:[e.cx("list"),i],style:a,role:"listbox"},e.ptm("list")),[(O(!0),m(E,null,P(r,(function(t,i){return O(),m(E,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,l))},[s.isOptionGroup(t)?(O(),m("li",g({key:0,id:o.id+"_"+s.getOptionIndex(i,l),style:{height:u?u+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[I(e.$slots,"optiongroup",{option:t.optionGroup,index:s.getOptionIndex(i,l)},(function(){return[x(S(s.getOptionGroupLabel(t.optionGroup)),1)]}))],16,ne)):T((O(),m("li",g({key:1,id:o.id+"_"+s.getOptionIndex(i,l),class:e.cx("item",{option:t,focusedOption:s.getOptionIndex(i,l)}),style:{height:u?u+"px":void 0},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:function(e){return s.onOptionSelect(e,t)},onMousemove:function(e){return s.onOptionMouseMove(e,s.getOptionIndex(i,l))},"data-p-highlight":s.isSelected(t),"data-p-focused":o.focusedOptionIndex===s.getOptionIndex(i,l),"data-p-disabled":s.isOptionDisabled(t)},s.getPTItemOptions(t,l,i,"item")),[I(e.$slots,"option",{option:t,index:s.getOptionIndex(i,l)},(function(){return[x(S(s.getOptionLabel(t)),1)]}))],16,oe)),[[c]])],64)})),128)),o.filterValue&&(!r||r&&0===r.length)?(O(),m("li",g({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage"),{"data-p-hidden-accessible":!0}),[I(e.$slots,"emptyfilter",{},(function(){return[x(S(s.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(O(),m("li",g({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage"),{"data-p-hidden-accessible":!0}),[I(e.$slots,"empty",{},(function(){return[x(S(s.emptyMessageText),1)]}))],16)):V("",!0)],16,ie)]})),_:2},[e.$slots.loader?{name:"loader",fn:D((function(t){return[I(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["items","style","disabled","pt"])],16),I(e.$slots,"footer",{value:e.modelValue,options:s.visibleOptions}),!e.options||e.options&&0===e.options.length?(O(),m("span",g({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),S(s.emptyMessageText),17)):V("",!0),k("span",g({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),S(s.selectedMessageText),17),k("span",g({ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[12]||(t[12]=function(){return s.onLastHiddenFocus&&s.onLastHiddenFocus.apply(s,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16)],16)):V("",!0)]})),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:3},8,["appendTo"])],16,Y)};export{_ as default};
|
|
1
|
+
import{FilterService as e}from"primevue/api";import t from"primevue/icons/chevrondown";import i from"primevue/icons/filter";import n from"primevue/icons/spinner";import o from"primevue/icons/times";import s from"primevue/overlayeventbus";import r from"primevue/portal";import l from"primevue/ripple";import{UniqueComponentId as a,ZIndexUtils as c,ObjectUtils as u,DomHandler as d,ConnectedOverlayScrollHandler as p}from"primevue/utils";import h from"primevue/virtualscroller";import f from"primevue/basecomponent";import b from"primevue/dropdown/style";import{resolveComponent as y,resolveDirective as v,openBlock as O,createElementBlock as m,mergeProps as g,renderSlot as I,createTextVNode as x,toDisplayString as S,normalizeClass as w,createBlock as L,resolveDynamicComponent as F,createCommentVNode as k,createElementVNode as V,createVNode as C,withCtx as D,Transition as M,createSlots as E,Fragment as K,renderList as P,withDirectives as T}from"vue";function $(e){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(e)}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e,t){if(e){if("string"==typeof e)return B(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?B(e,t):void 0}}function H(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function G(e){if(Array.isArray(e))return B(e)}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function R(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function z(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?R(Object(i),!0).forEach((function(t){U(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function U(e,t,i){var n;return(t="symbol"==$(n=N(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function N(e,t){if("object"!=$(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var _={name:"Dropdown",extends:{name:"BaseDropdown",extends:f,props:{modelValue:null,options:Array,optionLabel:[String,Function],optionValue:[String,Function],optionDisabled:[String,Function],optionGroupLabel:[String,Function],optionGroupChildren:[String,Function],scrollHeight:{type:String,default:"200px"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},clearIconProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:void 0},dropdownIcon:{type:String,default:void 0},filterIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:b,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter"],outsideClickListener:null,scrollHandler:null,resizeListener:null,labelClickListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,focusOnHover:!1,data:function(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||a()},modelValue:function(){this.isModelValueChanged=!0},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||a(),this.autoUpdateModel(),this.bindLabelClickListener()},updated:function(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindLabelClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(c.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?u.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?u.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,t){return(this.dataKey?u.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},getPTItemOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&u.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return u.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return u.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},show:function(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&d.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.focusedOptionIndex=-1,t.searchValue="",t.resetFilterOnHide&&(t.filterValue=null),e&&d.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(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:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||d.isAndroid())e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,this.editable);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,this.editable);break;case"Delete":this.onDeleteKey(e);case"Home":this.onHomeKey(e,this.editable);break;case"End":this.onEndKey(e,this.editable);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Space":this.onSpaceKey(e,this.editable);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e,this.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!t&&u.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),!this.editable&&this.searchOptions(e,e.key))}}},onEditableInput:function(e){var t=e.target.value;this.searchValue="",!this.searchOptions(e,t)&&(this.focusedOptionIndex=-1),this.updateModel(e,t),!this.overlayVisible&&u.isNotEmpty(t)&&this.show()},onContainerClick:function(e){this.disabled||this.loading||"INPUT"===e.target.tagName||"clearicon"===e.target.getAttribute("data-pc-section")||e.target.closest('[data-pc-section="clearicon"]')||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onClearClick:function(e){this.updateModel(e,null)},onFirstHiddenFocus:function(e){var t=e.relatedTarget===this.$refs.focusInput?d.getFirstFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;d.focus(t)},onLastHiddenFocus:function(e){var t=e.relatedTarget===this.$refs.focusInput?d.getLastFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;d.focus(t)},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t);this.updateModel(e,n),i&&this.hide(!0)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onFilterChange:function(e){var t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur:function(){this.focusedOptionIndex=-1},onFilterUpdated:function(){this.overlayVisible&&this.alignOverlay()},onOverlayClick:function(e){s.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onDeleteKey:function(e){this.showClear&&(this.updateModel(e,null),e.preventDefault())},onArrowDownKey:function(e){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey&&!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]?(e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1):(this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show()),e.preventDefault()},onEndKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show();e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(e),e.preventDefault()},onSpaceKey:function(e){!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||(this.overlayVisible&&this.hasFocusableElements()?(d.focus(this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onBackspaceKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&!this.overlayVisible&&this.show()},onOverlayEnter:function(e){c.set("overlay",e,this.$primevue.config.zIndex.overlay),d.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&d.focus(this.$refs.filterInput)},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave:function(e){c.clear(e)},alignOverlay:function(){"self"===this.appendTo?d.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=d.getOuterWidth(this.$el)+"px",d.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new p(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!d.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindLabelClickListener:function(){var e=this;if(!this.editable&&!this.labelClickListener){var t=document.querySelector('label[for="'.concat(this.inputId,'"]'));t&&d.isVisible(t)&&(this.labelClickListener=function(){d.focus(e.$refs.focusInput)},t.addEventListener("click",this.labelClickListener))}},unbindLabelClickListener:function(){if(this.labelClickListener){var e=document.querySelector('label[for="'.concat(this.inputId,'"]'));e&&d.isVisible(e)&&e.removeEventListener("click",this.labelClickListener)}},hasFocusableElements:function(){return d.getFocusableElements(this.overlay,':not([data-p-hidden-focusable="true"])').length>0},isOptionMatched:function(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption:function(e){return u.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.isValidOption(e)&&u.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return u.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?u.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionIndex?-1===(n=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionIndex&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=-1!==t?"".concat(this.id,"_").concat(t):this.focusedOptionId,n=d.findSingle(this.list,'li[id="'.concat(i,'"]'));n?n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout((function(){e.virtualScroller&&e.virtualScroller.scrollToIndex(-1!==t?t:e.focusedOptionIndex)}),0)},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},overlayRef:function(e){this.overlay=e},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var t=this,i=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){var n=e.filter(i,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){var o=[];return(this.options||[]).forEach((function(e){var i,s=t.getOptionGroupChildren(e).filter((function(e){return n.includes(e)}));s.length>0&&o.push(z(z({},e),{},U({},"string"==typeof t.optionGroupChildren?t.optionGroupChildren:"items",G(i=s)||H(i)||j(i)||A())))})),this.flatOptions(o)}return n}return i},hasSelectedOption:function(){return u.isNotEmpty(this.modelValue)},label:function(){var e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.placeholder||"p-emptylabel"},editableInputValue:function(){var e=this.findSelectedOptionIndex();return-1!==e?this.getOptionLabel(this.visibleOptions[e]):this.modelValue||""},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},filterResultMessageText:function(){return u.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:l},components:{VirtualScroller:h,Portal:r,TimesIcon:o,ChevronDownIcon:t,SpinnerIcon:n,FilterIcon:i}};function q(e){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(e)}function W(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function J(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?W(Object(i),!0).forEach((function(t){Q(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):W(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Q(e,t,i){var n;return(t="symbol"==q(n=X(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function X(e,t){if("object"!=q(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var Y=["id"],Z=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],ee=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],te=["value","placeholder","aria-owns","aria-activedescendant"],ie=["id"],ne=["id"],oe=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"];_.render=function(e,t,i,n,o,s){var r=y("SpinnerIcon"),l=y("VirtualScroller"),a=y("Portal"),c=v("ripple");return O(),m("div",g({ref:"container",id:o.id,class:e.cx("root"),onClick:t[15]||(t[15]=function(){return s.onContainerClick&&s.onContainerClick.apply(s,arguments)})},e.ptm("root"),{"data-pc-name":"dropdown"}),[e.editable?(O(),m("input",g({key:0,ref:"focusInput",id:e.inputId,type:"text",class:[e.cx("input"),e.inputClass],style:e.inputStyle,value:s.editableInputValue,placeholder:e.placeholder,tabindex:e.disabled?-1:e.tabindex,disabled:e.disabled,autocomplete:"off",role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)}),onInput:t[3]||(t[3]=function(){return s.onEditableInput&&s.onEditableInput.apply(s,arguments)})},J(J({},e.inputProps),e.ptm("input"))),null,16,Z)):(O(),m("span",g({key:1,ref:"focusInput",id:e.inputId,class:[e.cx("input"),e.inputClass],style:e.inputStyle,tabindex:e.disabled?-1:e.tabindex,role:"combobox","aria-label":e.ariaLabel||("p-emptylabel"===s.label?void 0:s.label),"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":e.disabled,onFocus:t[4]||(t[4]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[5]||(t[5]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[6]||(t[6]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},J(J({},e.inputProps),e.ptm("input"))),[I(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[x(S("p-emptylabel"===s.label?" ":s.label||"empty"),1)]}))],16,ee)),e.showClear&&null!=e.modelValue?I(e.$slots,"clearicon",{key:2,class:w(e.cx("clearIcon")),onClick:s.onClearClick,clearCallback:s.onClearClick},(function(){return[(O(),L(F(e.clearIcon?"i":"TimesIcon"),g({ref:"clearIcon",class:[e.cx("clearIcon"),e.clearIcon],onClick:s.onClearClick},J(J({},e.clearIconProps),e.ptm("clearIcon")),{"data-pc-section":"clearicon"}),null,16,["class","onClick"]))]})):k("",!0),V("div",g({class:e.cx("trigger")},e.ptm("trigger")),[e.loading?I(e.$slots,"loadingicon",{key:0,class:w(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(O(),m("span",g({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(O(),L(r,g({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):I(e.$slots,"dropdownicon",{key:1,class:w(e.cx("dropdownIcon"))},(function(){return[(O(),L(F(e.dropdownIcon?"span":"ChevronDownIcon"),g({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),C(a,{appendTo:e.appendTo},{default:D((function(){return[C(M,g({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:D((function(){return[o.overlayVisible?(O(),m("div",g({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[13]||(t[13]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[14]||(t[14]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},J(J({},e.panelProps),e.ptm("panel"))),[V("span",g({ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[7]||(t[7]=function(){return s.onFirstHiddenFocus&&s.onFirstHiddenFocus.apply(s,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16),I(e.$slots,"header",{value:e.modelValue,options:s.visibleOptions}),e.filter?(O(),m("div",g({key:0,class:e.cx("header")},e.ptm("header")),[V("div",g({class:e.cx("filterContainer")},e.ptm("filterContainer")),[V("input",g({ref:"filterInput",type:"text",value:o.filterValue,onVnodeMounted:t[8]||(t[8]=function(){return s.onFilterUpdated&&s.onFilterUpdated.apply(s,arguments)}),class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,onKeydown:t[9]||(t[9]=function(){return s.onFilterKeyDown&&s.onFilterKeyDown.apply(s,arguments)}),onBlur:t[10]||(t[10]=function(){return s.onFilterBlur&&s.onFilterBlur.apply(s,arguments)}),onInput:t[11]||(t[11]=function(){return s.onFilterChange&&s.onFilterChange.apply(s,arguments)})},J(J({},e.filterInputProps),e.ptm("filterInput"))),null,16,te),I(e.$slots,"filtericon",{class:w(e.cx("filterIcon"))},(function(){return[(O(),L(F(e.filterIcon?"span":"FilterIcon"),g({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16),V("span",g({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),S(s.filterResultMessageText),17)],16)):k("",!0),V("div",g({class:e.cx("wrapper"),style:{"max-height":s.virtualScrollerDisabled?e.scrollHeight:""}},e.ptm("wrapper")),[C(l,g({ref:s.virtualScrollerRef},e.virtualScrollerOptions,{items:s.visibleOptions,style:{height:e.scrollHeight},tabindex:-1,disabled:s.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),E({content:D((function(t){var i=t.styleClass,n=t.contentRef,r=t.items,l=t.getItemOptions,a=t.contentStyle,u=t.itemSize;return[V("ul",g({ref:function(e){return s.listRef(e,n)},id:o.id+"_list",class:[e.cx("list"),i],style:a,role:"listbox"},e.ptm("list")),[(O(!0),m(K,null,P(r,(function(t,i){return O(),m(K,{key:s.getOptionRenderKey(t,s.getOptionIndex(i,l))},[s.isOptionGroup(t)?(O(),m("li",g({key:0,id:o.id+"_"+s.getOptionIndex(i,l),style:{height:u?u+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[I(e.$slots,"optiongroup",{option:t.optionGroup,index:s.getOptionIndex(i,l)},(function(){return[x(S(s.getOptionGroupLabel(t.optionGroup)),1)]}))],16,ne)):T((O(),m("li",g({key:1,id:o.id+"_"+s.getOptionIndex(i,l),class:e.cx("item",{option:t,focusedOption:s.getOptionIndex(i,l)}),style:{height:u?u+"px":void 0},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:function(e){return s.onOptionSelect(e,t)},onMousemove:function(e){return s.onOptionMouseMove(e,s.getOptionIndex(i,l))},"data-p-highlight":s.isSelected(t),"data-p-focused":o.focusedOptionIndex===s.getOptionIndex(i,l),"data-p-disabled":s.isOptionDisabled(t)},s.getPTItemOptions(t,l,i,"item")),[I(e.$slots,"option",{option:t,index:s.getOptionIndex(i,l)},(function(){return[x(S(s.getOptionLabel(t)),1)]}))],16,oe)),[[c]])],64)})),128)),o.filterValue&&(!r||r&&0===r.length)?(O(),m("li",g({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage"),{"data-p-hidden-accessible":!0}),[I(e.$slots,"emptyfilter",{},(function(){return[x(S(s.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(O(),m("li",g({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage"),{"data-p-hidden-accessible":!0}),[I(e.$slots,"empty",{},(function(){return[x(S(s.emptyMessageText),1)]}))],16)):k("",!0)],16,ie)]})),_:2},[e.$slots.loader?{name:"loader",fn:D((function(t){return[I(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["items","style","disabled","pt"])],16),I(e.$slots,"footer",{value:e.modelValue,options:s.visibleOptions}),!e.options||e.options&&0===e.options.length?(O(),m("span",g({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),S(s.emptyMessageText),17)):k("",!0),V("span",g({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),S(s.selectedMessageText),17),V("span",g({ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[12]||(t[12]=function(){return s.onLastHiddenFocus&&s.onLastHiddenFocus.apply(s,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16)],16)):k("",!0)]})),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:3},8,["appendTo"])],16,Y)};export{_ as default};
|
package/dropdown/dropdown.js
CHANGED
|
@@ -195,6 +195,7 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
195
195
|
outsideClickListener: null,
|
|
196
196
|
scrollHandler: null,
|
|
197
197
|
resizeListener: null,
|
|
198
|
+
labelClickListener: null,
|
|
198
199
|
overlay: null,
|
|
199
200
|
list: null,
|
|
200
201
|
virtualScroller: null,
|
|
@@ -225,6 +226,7 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
225
226
|
mounted: function mounted() {
|
|
226
227
|
this.id = this.id || utils.UniqueComponentId();
|
|
227
228
|
this.autoUpdateModel();
|
|
229
|
+
this.bindLabelClickListener();
|
|
228
230
|
},
|
|
229
231
|
updated: function updated() {
|
|
230
232
|
if (this.overlayVisible && this.isModelValueChanged) {
|
|
@@ -235,6 +237,7 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
235
237
|
beforeUnmount: function beforeUnmount() {
|
|
236
238
|
this.unbindOutsideClickListener();
|
|
237
239
|
this.unbindResizeListener();
|
|
240
|
+
this.unbindLabelClickListener();
|
|
238
241
|
if (this.scrollHandler) {
|
|
239
242
|
this.scrollHandler.destroy();
|
|
240
243
|
this.scrollHandler = null;
|
|
@@ -448,6 +451,7 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
448
451
|
this.onEndKey(event, true);
|
|
449
452
|
break;
|
|
450
453
|
case 'Enter':
|
|
454
|
+
case 'NumpadEnter':
|
|
451
455
|
this.onEnterKey(event);
|
|
452
456
|
break;
|
|
453
457
|
case 'Escape':
|
|
@@ -666,6 +670,26 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
666
670
|
this.resizeListener = null;
|
|
667
671
|
}
|
|
668
672
|
},
|
|
673
|
+
bindLabelClickListener: function bindLabelClickListener() {
|
|
674
|
+
var _this6 = this;
|
|
675
|
+
if (!this.editable && !this.labelClickListener) {
|
|
676
|
+
var label = document.querySelector("label[for=\"".concat(this.inputId, "\"]"));
|
|
677
|
+
if (label && utils.DomHandler.isVisible(label)) {
|
|
678
|
+
this.labelClickListener = function () {
|
|
679
|
+
utils.DomHandler.focus(_this6.$refs.focusInput);
|
|
680
|
+
};
|
|
681
|
+
label.addEventListener('click', this.labelClickListener);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
unbindLabelClickListener: function unbindLabelClickListener() {
|
|
686
|
+
if (this.labelClickListener) {
|
|
687
|
+
var label = document.querySelector("label[for=\"".concat(this.inputId, "\"]"));
|
|
688
|
+
if (label && utils.DomHandler.isVisible(label)) {
|
|
689
|
+
label.removeEventListener('click', this.labelClickListener);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
},
|
|
669
693
|
hasFocusableElements: function hasFocusableElements() {
|
|
670
694
|
return utils.DomHandler.getFocusableElements(this.overlay, ':not([data-p-hidden-focusable="true"])').length > 0;
|
|
671
695
|
},
|
|
@@ -682,35 +706,35 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
682
706
|
return this.isValidOption(option) && utils.ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
|
|
683
707
|
},
|
|
684
708
|
findFirstOptionIndex: function findFirstOptionIndex() {
|
|
685
|
-
var
|
|
709
|
+
var _this7 = this;
|
|
686
710
|
return this.visibleOptions.findIndex(function (option) {
|
|
687
|
-
return
|
|
711
|
+
return _this7.isValidOption(option);
|
|
688
712
|
});
|
|
689
713
|
},
|
|
690
714
|
findLastOptionIndex: function findLastOptionIndex() {
|
|
691
|
-
var
|
|
715
|
+
var _this8 = this;
|
|
692
716
|
return utils.ObjectUtils.findLastIndex(this.visibleOptions, function (option) {
|
|
693
|
-
return
|
|
717
|
+
return _this8.isValidOption(option);
|
|
694
718
|
});
|
|
695
719
|
},
|
|
696
720
|
findNextOptionIndex: function findNextOptionIndex(index) {
|
|
697
|
-
var
|
|
721
|
+
var _this9 = this;
|
|
698
722
|
var matchedOptionIndex = index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function (option) {
|
|
699
|
-
return
|
|
723
|
+
return _this9.isValidOption(option);
|
|
700
724
|
}) : -1;
|
|
701
725
|
return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
|
|
702
726
|
},
|
|
703
727
|
findPrevOptionIndex: function findPrevOptionIndex(index) {
|
|
704
|
-
var
|
|
728
|
+
var _this10 = this;
|
|
705
729
|
var matchedOptionIndex = index > 0 ? utils.ObjectUtils.findLastIndex(this.visibleOptions.slice(0, index), function (option) {
|
|
706
|
-
return
|
|
730
|
+
return _this10.isValidOption(option);
|
|
707
731
|
}) : -1;
|
|
708
732
|
return matchedOptionIndex > -1 ? matchedOptionIndex : index;
|
|
709
733
|
},
|
|
710
734
|
findSelectedOptionIndex: function findSelectedOptionIndex() {
|
|
711
|
-
var
|
|
735
|
+
var _this11 = this;
|
|
712
736
|
return this.hasSelectedOption ? this.visibleOptions.findIndex(function (option) {
|
|
713
|
-
return
|
|
737
|
+
return _this11.isValidSelectedOption(option);
|
|
714
738
|
}) : -1;
|
|
715
739
|
},
|
|
716
740
|
findFirstFocusedOptionIndex: function findFirstFocusedOptionIndex() {
|
|
@@ -722,20 +746,20 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
722
746
|
return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
|
|
723
747
|
},
|
|
724
748
|
searchOptions: function searchOptions(event, _char) {
|
|
725
|
-
var
|
|
749
|
+
var _this12 = this;
|
|
726
750
|
this.searchValue = (this.searchValue || '') + _char;
|
|
727
751
|
var optionIndex = -1;
|
|
728
752
|
var matched = false;
|
|
729
753
|
if (this.focusedOptionIndex !== -1) {
|
|
730
754
|
optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(function (option) {
|
|
731
|
-
return
|
|
755
|
+
return _this12.isOptionMatched(option);
|
|
732
756
|
});
|
|
733
757
|
optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(function (option) {
|
|
734
|
-
return
|
|
758
|
+
return _this12.isOptionMatched(option);
|
|
735
759
|
}) : optionIndex + this.focusedOptionIndex;
|
|
736
760
|
} else {
|
|
737
761
|
optionIndex = this.visibleOptions.findIndex(function (option) {
|
|
738
|
-
return
|
|
762
|
+
return _this12.isOptionMatched(option);
|
|
739
763
|
});
|
|
740
764
|
}
|
|
741
765
|
if (optionIndex !== -1) {
|
|
@@ -751,8 +775,8 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
751
775
|
clearTimeout(this.searchTimeout);
|
|
752
776
|
}
|
|
753
777
|
this.searchTimeout = setTimeout(function () {
|
|
754
|
-
|
|
755
|
-
|
|
778
|
+
_this12.searchValue = '';
|
|
779
|
+
_this12.searchTimeout = null;
|
|
756
780
|
}, 500);
|
|
757
781
|
return matched;
|
|
758
782
|
},
|
|
@@ -766,7 +790,7 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
766
790
|
}
|
|
767
791
|
},
|
|
768
792
|
scrollInView: function scrollInView() {
|
|
769
|
-
var
|
|
793
|
+
var _this13 = this;
|
|
770
794
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
771
795
|
var id = index !== -1 ? "".concat(this.id, "_").concat(index) : this.focusedOptionId;
|
|
772
796
|
var element = utils.DomHandler.findSingle(this.list, "li[id=\"".concat(id, "\"]"));
|
|
@@ -777,7 +801,7 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
777
801
|
});
|
|
778
802
|
} else if (!this.virtualScrollerDisabled) {
|
|
779
803
|
setTimeout(function () {
|
|
780
|
-
|
|
804
|
+
_this13.virtualScroller && _this13.virtualScroller.scrollToIndex(index !== -1 ? index : _this13.focusedOptionIndex);
|
|
781
805
|
}, 0);
|
|
782
806
|
}
|
|
783
807
|
},
|
|
@@ -795,14 +819,14 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
795
819
|
});
|
|
796
820
|
},
|
|
797
821
|
flatOptions: function flatOptions(options) {
|
|
798
|
-
var
|
|
822
|
+
var _this14 = this;
|
|
799
823
|
return (options || []).reduce(function (result, option, index) {
|
|
800
824
|
result.push({
|
|
801
825
|
optionGroup: option,
|
|
802
826
|
group: true,
|
|
803
827
|
index: index
|
|
804
828
|
});
|
|
805
|
-
var optionGroupChildren =
|
|
829
|
+
var optionGroupChildren = _this14.getOptionGroupChildren(option);
|
|
806
830
|
optionGroupChildren && optionGroupChildren.forEach(function (o) {
|
|
807
831
|
return result.push(o);
|
|
808
832
|
});
|
|
@@ -822,7 +846,7 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
822
846
|
},
|
|
823
847
|
computed: {
|
|
824
848
|
visibleOptions: function visibleOptions() {
|
|
825
|
-
var
|
|
849
|
+
var _this15 = this;
|
|
826
850
|
var options = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];
|
|
827
851
|
if (this.filterValue) {
|
|
828
852
|
var filteredOptions = api.FilterService.filter(options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
|
|
@@ -830,11 +854,11 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
830
854
|
var optionGroups = this.options || [];
|
|
831
855
|
var filtered = [];
|
|
832
856
|
optionGroups.forEach(function (group) {
|
|
833
|
-
var groupChildren =
|
|
857
|
+
var groupChildren = _this15.getOptionGroupChildren(group);
|
|
834
858
|
var filteredItems = groupChildren.filter(function (item) {
|
|
835
859
|
return filteredOptions.includes(item);
|
|
836
860
|
});
|
|
837
|
-
if (filteredItems.length > 0) filtered.push(_objectSpread$1(_objectSpread$1({}, group), {}, _defineProperty$1({}, typeof
|
|
861
|
+
if (filteredItems.length > 0) filtered.push(_objectSpread$1(_objectSpread$1({}, group), {}, _defineProperty$1({}, typeof _this15.optionGroupChildren === 'string' ? _this15.optionGroupChildren : 'items', _toConsumableArray(filteredItems))));
|
|
838
862
|
});
|
|
839
863
|
return this.flatOptions(filtered);
|
|
840
864
|
}
|
|
@@ -884,9 +908,9 @@ this.primevue.dropdown = (function (api, ChevronDownIcon, FilterIcon, SpinnerIco
|
|
|
884
908
|
return this.focusedOptionIndex !== -1 ? "".concat(this.id, "_").concat(this.focusedOptionIndex) : null;
|
|
885
909
|
},
|
|
886
910
|
ariaSetSize: function ariaSetSize() {
|
|
887
|
-
var
|
|
911
|
+
var _this16 = this;
|
|
888
912
|
return this.visibleOptions.filter(function (option) {
|
|
889
|
-
return !
|
|
913
|
+
return !_this16.isOptionGroup(option);
|
|
890
914
|
}).length;
|
|
891
915
|
},
|
|
892
916
|
virtualScrollerDisabled: function virtualScrollerDisabled() {
|