primevue 3.16.2 → 3.18.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/LICENSE.md +1 -1
- package/README.md +2 -1
- package/accordion/Accordion.d.ts +23 -5
- package/accordion/Accordion.vue +196 -79
- package/accordion/accordion.cjs.js +204 -98
- package/accordion/accordion.cjs.min.js +1 -1
- package/accordion/accordion.esm.js +202 -100
- package/accordion/accordion.esm.min.js +1 -1
- package/accordion/accordion.js +205 -100
- package/accordion/accordion.min.js +1 -1
- package/accordiontab/AccordionTab.d.ts +33 -5
- package/accordiontab/AccordionTab.vue +8 -1
- package/accordiontab/accordiontab.cjs.js +7 -0
- package/accordiontab/accordiontab.cjs.min.js +1 -1
- package/accordiontab/accordiontab.esm.js +7 -0
- package/accordiontab/accordiontab.esm.min.js +1 -1
- package/accordiontab/accordiontab.js +7 -0
- package/accordiontab/accordiontab.min.js +1 -1
- package/api/Api.d.ts +1 -1
- package/api/api.cjs.js +321 -313
- package/api/api.cjs.min.js +1 -1
- package/api/api.esm.js +321 -313
- package/api/api.esm.min.js +1 -1
- package/api/api.js +321 -313
- package/api/api.min.js +1 -1
- package/autocomplete/AutoComplete.d.ts +32 -17
- package/autocomplete/AutoComplete.vue +252 -131
- package/autocomplete/autocomplete.cjs.js +163 -118
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +161 -116
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +162 -117
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +4 -4
- package/avatar/Avatar.vue +15 -11
- package/avatar/avatar.cjs.js +11 -7
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +11 -7
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +11 -7
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/AvatarGroup.d.ts +6 -9
- package/avatargroup/AvatarGroup.vue +1 -1
- package/badge/Badge.d.ts +4 -5
- package/badge/Badge.vue +16 -13
- package/badge/badge.cjs.js +14 -11
- package/badge/badge.esm.js +14 -11
- package/badge/badge.js +14 -11
- package/badgedirective/badgedirective.cjs.js +8 -10
- package/badgedirective/badgedirective.esm.js +8 -10
- package/badgedirective/badgedirective.js +8 -10
- package/blockui/BlockUI.d.ts +6 -6
- package/blockui/BlockUI.vue +13 -15
- package/blockui/blockui.cjs.js +11 -13
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +11 -13
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +11 -13
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/Breadcrumb.d.ts +14 -7
- package/breadcrumb/Breadcrumb.vue +16 -7
- package/breadcrumb/BreadcrumbItem.vue +24 -15
- package/breadcrumb/breadcrumb.cjs.js +39 -25
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +39 -25
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +39 -25
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/Button.d.ts +10 -7
- package/button/Button.vue +28 -17
- package/button/button.cjs.js +25 -14
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +25 -14
- package/button/button.esm.min.js +1 -1
- package/button/button.js +25 -14
- package/button/button.min.js +1 -1
- package/calendar/Calendar.d.ts +14 -14
- package/calendar/Calendar.vue +856 -601
- package/calendar/calendar.cjs.js +714 -614
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +712 -612
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +713 -613
- package/calendar/calendar.min.js +1 -1
- package/card/Card.d.ts +5 -7
- package/card/Card.vue +5 -5
- package/carousel/Carousel.d.ts +29 -19
- package/carousel/Carousel.vue +537 -528
- package/carousel/carousel.cjs.js +496 -493
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +496 -493
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +645 -642
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +29 -14
- package/cascadeselect/CascadeSelect.vue +197 -102
- package/cascadeselect/CascadeSelectSub.vue +50 -15
- package/cascadeselect/cascadeselect.cjs.js +185 -111
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +184 -110
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +185 -111
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/chart/Chart.d.ts +6 -7
- package/chart/Chart.vue +12 -12
- package/chart/chart.cjs.js +11 -11
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +11 -11
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +11 -11
- package/chart/chart.min.js +1 -1
- package/checkbox/Checkbox.d.ts +12 -12
- package/checkbox/Checkbox.vue +48 -20
- package/checkbox/checkbox.cjs.js +28 -17
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +28 -17
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +28 -17
- package/checkbox/checkbox.min.js +1 -1
- package/chip/Chip.d.ts +5 -5
- package/chip/Chip.vue +13 -11
- package/chip/chip.cjs.js +7 -4
- package/chip/chip.esm.js +7 -4
- package/chip/chip.js +7 -4
- package/chips/Chips.d.ts +9 -9
- package/chips/Chips.vue +89 -33
- package/chips/chips.cjs.js +48 -26
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +48 -26
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +48 -26
- package/chips/chips.min.js +1 -1
- package/colorpicker/ColorPicker.d.ts +11 -12
- package/colorpicker/ColorPicker.vue +146 -110
- package/colorpicker/colorpicker.cjs.js +113 -74
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +113 -74
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +113 -74
- package/colorpicker/colorpicker.min.js +1 -1
- package/column/Column.d.ts +5 -6
- package/column/Column.vue +1 -1
- package/columngroup/ColumnGroup.d.ts +5 -7
- package/columngroup/ColumnGroup.vue +1 -1
- package/config/PrimeVue.d.ts +8 -3
- package/config/config.cjs.js +18 -30
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +18 -30
- package/config/config.esm.min.js +1 -1
- package/config/config.js +19 -31
- package/config/config.min.js +1 -1
- package/confirmationoptions/ConfirmationOptions.d.ts +4 -0
- package/confirmationservice/confirmationservice.cjs.js +1 -0
- package/confirmationservice/confirmationservice.esm.js +1 -0
- package/confirmationservice/confirmationservice.js +1 -0
- package/confirmdialog/ConfirmDialog.d.ts +11 -5
- package/confirmdialog/ConfirmDialog.vue +25 -15
- package/confirmdialog/confirmdialog.cjs.js +34 -16
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +34 -16
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +35 -17
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.d.ts +5 -8
- package/confirmpopup/ConfirmPopup.vue +44 -32
- package/confirmpopup/confirmpopup.cjs.js +24 -14
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +24 -14
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +24 -14
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenu.d.ts +43 -5
- package/contextmenu/ContextMenu.vue +449 -38
- package/contextmenu/ContextMenuSub.vue +134 -101
- package/contextmenu/contextmenu.cjs.js +639 -206
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +640 -207
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +640 -207
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +2984 -2116
- package/core/core.min.js +16 -16
- package/datatable/BodyCell.vue +93 -75
- package/datatable/ColumnFilter.vue +137 -86
- package/datatable/DataTable.d.ts +25 -26
- package/datatable/DataTable.vue +472 -298
- package/datatable/FooterCell.vue +20 -13
- package/datatable/HeaderCell.vue +108 -51
- package/datatable/HeaderCheckbox.vue +12 -5
- package/datatable/RowCheckbox.vue +14 -6
- package/datatable/RowRadioButton.vue +4 -4
- package/datatable/TableBody.vue +135 -83
- package/datatable/TableFooter.vue +17 -20
- package/datatable/TableHeader.vue +132 -52
- package/datatable/TableLoadingBody.vue +3 -3
- package/datatable/datatable.cjs.js +2674 -2537
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +2676 -2539
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +2676 -2539
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +8 -8
- package/dataview/DataView.vue +80 -66
- package/dataview/dataview.cjs.js +31 -35
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +31 -35
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +31 -35
- package/dataview/dataview.min.js +1 -1
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +5 -6
- package/dataviewlayoutoptions/DataViewLayoutOptions.vue +28 -34
- package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.js +19 -25
- package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.min.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.esm.js +19 -25
- package/dataviewlayoutoptions/dataviewlayoutoptions.esm.min.js +1 -1
- package/dataviewlayoutoptions/dataviewlayoutoptions.js +46 -52
- package/dataviewlayoutoptions/dataviewlayoutoptions.min.js +1 -1
- package/deferredcontent/DeferredContent.d.ts +6 -7
- package/deferredcontent/DeferredContent.vue +6 -9
- package/deferredcontent/deferredcontent.cjs.js +5 -8
- package/deferredcontent/deferredcontent.esm.js +5 -8
- package/deferredcontent/deferredcontent.js +5 -8
- package/dialog/Dialog.d.ts +10 -10
- package/dialog/Dialog.vue +64 -60
- package/dialog/dialog.cjs.js +50 -46
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +50 -46
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +50 -46
- package/dialog/dialog.min.js +1 -1
- package/divider/Divider.d.ts +4 -5
- package/divider/Divider.vue +15 -12
- package/divider/divider.cjs.js +17 -12
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +17 -12
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +17 -12
- package/divider/divider.min.js +1 -1
- package/dock/Dock.d.ts +36 -6
- package/dock/Dock.vue +21 -5
- package/dock/DockSub.vue +229 -55
- package/dock/dock.cjs.js +284 -106
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +284 -106
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +285 -108
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.d.ts +46 -17
- package/dropdown/Dropdown.vue +271 -129
- package/dropdown/dropdown.cjs.js +213 -132
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +212 -131
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +212 -131
- package/dropdown/dropdown.min.js +1 -1
- package/dynamicdialog/DynamicDialog.d.ts +4 -4
- package/dynamicdialog/DynamicDialog.vue +10 -10
- package/dynamicdialog/dynamicdialog.cjs.js +11 -9
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +11 -9
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +11 -9
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/editor/Editor.d.ts +20 -4
- package/editor/Editor.vue +506 -466
- package/editor/editor.cjs.js +99 -45
- package/editor/editor.cjs.min.js +1 -1
- package/editor/editor.esm.js +82 -42
- package/editor/editor.esm.min.js +1 -1
- package/editor/editor.js +83 -47
- package/editor/editor.min.js +1 -1
- package/fieldset/Fieldset.d.ts +9 -5
- package/fieldset/Fieldset.vue +28 -20
- package/fieldset/fieldset.cjs.js +31 -19
- package/fieldset/fieldset.cjs.min.js +1 -1
- package/fieldset/fieldset.esm.js +32 -20
- package/fieldset/fieldset.esm.min.js +1 -1
- package/fieldset/fieldset.js +31 -19
- package/fieldset/fieldset.min.js +1 -1
- package/fileupload/FileContent.vue +51 -0
- package/fileupload/FileUpload.d.ts +32 -12
- package/fileupload/FileUpload.vue +122 -102
- package/fileupload/fileupload.cjs.js +265 -160
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +265 -160
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +265 -160
- package/fileupload/fileupload.min.js +1 -1
- package/fullcalendar/FullCalendar.d.ts +5 -7
- package/fullcalendar/FullCalendar.vue +6 -6
- package/fullcalendar/fullcalendar.cjs.js +3 -2
- package/fullcalendar/fullcalendar.esm.js +3 -2
- package/fullcalendar/fullcalendar.js +3 -2
- package/galleria/Galleria.d.ts +4 -4
- package/galleria/Galleria.vue +39 -34
- package/galleria/GalleriaContent.vue +58 -31
- package/galleria/GalleriaItem.vue +44 -36
- package/galleria/GalleriaItemSlot.vue +2 -1
- package/galleria/GalleriaThumbnails.vue +108 -92
- package/galleria/galleria.cjs.js +181 -153
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +181 -153
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +181 -153
- package/galleria/galleria.min.js +1 -1
- package/image/Image.d.ts +4 -5
- package/image/Image.vue +19 -15
- package/image/image.cjs.js +11 -7
- package/image/image.cjs.min.js +1 -1
- package/image/image.esm.js +11 -7
- package/image/image.esm.min.js +1 -1
- package/image/image.js +11 -7
- package/image/image.min.js +1 -1
- package/inlinemessage/InlineMessage.d.ts +4 -5
- package/inlinemessage/InlineMessage.vue +12 -9
- package/inlinemessage/inlinemessage.cjs.js +12 -10
- package/inlinemessage/inlinemessage.cjs.min.js +1 -1
- package/inlinemessage/inlinemessage.esm.js +12 -10
- package/inlinemessage/inlinemessage.esm.min.js +1 -1
- package/inlinemessage/inlinemessage.js +12 -10
- package/inlinemessage/inlinemessage.min.js +1 -1
- package/inplace/Inplace.d.ts +6 -6
- package/inplace/Inplace.vue +11 -11
- package/inplace/inplace.cjs.js +9 -9
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +9 -9
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +9 -9
- package/inplace/inplace.min.js +1 -1
- package/inputmask/InputMask.d.ts +11 -12
- package/inputmask/InputMask.vue +119 -92
- package/inputmask/inputmask.cjs.js +116 -89
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +116 -89
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +116 -89
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +17 -17
- package/inputnumber/InputNumber.vue +247 -180
- package/inputnumber/inputnumber.cjs.js +219 -175
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +218 -174
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +219 -176
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +10 -10
- package/inputswitch/InputSwitch.vue +39 -11
- package/inputswitch/inputswitch.cjs.js +23 -9
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +23 -9
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +23 -9
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/InputText.d.ts +5 -6
- package/inputtext/InputText.vue +3 -3
- package/inputtext/inputtext.cjs.js +2 -2
- package/inputtext/inputtext.esm.js +2 -2
- package/inputtext/inputtext.js +2 -2
- package/knob/Knob.d.ts +10 -11
- package/knob/Knob.vue +47 -29
- package/knob/knob.cjs.js +27 -25
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +27 -25
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +27 -25
- package/knob/knob.min.js +1 -1
- package/listbox/Listbox.d.ts +22 -13
- package/listbox/Listbox.vue +149 -98
- package/listbox/listbox.cjs.js +121 -106
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +122 -107
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +121 -106
- package/listbox/listbox.min.js +1 -1
- package/megamenu/MegaMenu.d.ts +32 -6
- package/megamenu/MegaMenu.vue +510 -238
- package/megamenu/MegaMenuSub.vue +231 -0
- package/megamenu/megamenu.cjs.js +837 -391
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +839 -393
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +837 -391
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +28 -8
- package/menu/Menu.vue +204 -34
- package/menu/Menuitem.vue +48 -38
- package/menu/menu.cjs.js +325 -137
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +325 -137
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +325 -137
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +19 -8
- package/menubar/Menubar.vue +536 -26
- package/menubar/MenubarSub.vue +123 -239
- package/menubar/menubar.cjs.js +708 -335
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +710 -337
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +708 -335
- package/menubar/menubar.min.js +1 -1
- package/menuitem/MenuItem.d.ts +2 -2
- package/message/Message.d.ts +5 -5
- package/message/Message.vue +19 -14
- package/message/message.cjs.js +15 -10
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +15 -10
- package/message/message.esm.min.js +1 -1
- package/message/message.js +15 -10
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +46 -16
- package/multiselect/MultiSelect.vue +266 -156
- package/multiselect/multiselect.cjs.js +239 -167
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +238 -166
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +238 -166
- package/multiselect/multiselect.min.js +1 -1
- package/orderlist/OrderList.d.ts +5 -5
- package/orderlist/OrderList.vue +65 -60
- package/orderlist/orderlist.cjs.js +51 -53
- package/orderlist/orderlist.esm.js +51 -53
- package/orderlist/orderlist.js +51 -53
- package/organizationchart/OrganizationChart.d.ts +4 -4
- package/organizationchart/OrganizationChart.vue +13 -17
- package/organizationchart/OrganizationChartNode.vue +20 -12
- package/organizationchart/organizationchart.cjs.js +14 -16
- package/organizationchart/organizationchart.cjs.min.js +1 -1
- package/organizationchart/organizationchart.esm.js +14 -16
- package/organizationchart/organizationchart.esm.min.js +1 -1
- package/organizationchart/organizationchart.js +14 -16
- package/organizationchart/organizationchart.min.js +1 -1
- package/overlaypanel/OverlayPanel.d.ts +5 -5
- package/overlaypanel/OverlayPanel.vue +60 -50
- package/overlaypanel/overlaypanel.cjs.js +40 -32
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +40 -32
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +40 -32
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +3 -3
- package/paginator/CurrentPageReport.vue +47 -47
- package/paginator/FirstPageLink.vue +11 -8
- package/paginator/JumpToPageDropdown.vue +7 -6
- package/paginator/JumpToPageInput.vue +3 -3
- package/paginator/LastPageLink.vue +11 -8
- package/paginator/NextPageLink.vue +11 -8
- package/paginator/PageLinks.vue +3 -4
- package/paginator/Paginator.d.ts +7 -7
- package/paginator/Paginator.vue +144 -49
- package/paginator/PrevPageLink.vue +11 -8
- package/paginator/RowsPerPageDropdown.vue +7 -6
- package/paginator/paginator.cjs.js +373 -259
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +374 -260
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +651 -538
- package/paginator/paginator.min.js +1 -1
- package/panel/Panel.d.ts +9 -5
- package/panel/Panel.vue +29 -11
- package/panel/panel.cjs.js +24 -14
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +24 -14
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +24 -14
- package/panel/panel.min.js +1 -1
- package/panelmenu/PanelMenu.d.ts +37 -6
- package/panelmenu/PanelMenu.vue +202 -88
- package/panelmenu/PanelMenuList.vue +335 -0
- package/panelmenu/PanelMenuSub.vue +130 -80
- package/panelmenu/panelmenu.cjs.js +1385 -283
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +1382 -284
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +1385 -284
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/Password.d.ts +12 -7
- package/password/Password.vue +158 -80
- package/password/password.cjs.js +140 -78
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +139 -77
- package/password/password.esm.min.js +1 -1
- package/password/password.js +140 -78
- package/password/password.min.js +1 -1
- package/picklist/PickList.d.ts +9 -9
- package/picklist/PickList.vue +99 -78
- package/picklist/picklist.cjs.js +71 -66
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +71 -66
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +71 -66
- package/picklist/picklist.min.js +1 -1
- package/portal/Portal.d.ts +3 -3
- package/portal/Portal.vue +2 -2
- package/portal/portal.cjs.js +1 -1
- package/portal/portal.esm.js +1 -1
- package/portal/portal.js +1 -1
- package/progressbar/ProgressBar.d.ts +4 -5
- package/progressbar/ProgressBar.vue +63 -51
- package/progressbar/progressbar.cjs.js +2 -2
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +2 -2
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +2 -2
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/ProgressSpinner.d.ts +5 -7
- package/progressspinner/ProgressSpinner.vue +1 -1
- package/radiobutton/RadioButton.d.ts +9 -9
- package/radiobutton/RadioButton.vue +41 -13
- package/radiobutton/radiobutton.cjs.js +24 -10
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +24 -10
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +24 -10
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/Rating.d.ts +54 -5
- package/rating/Rating.vue +88 -62
- package/rating/rating.cjs.js +105 -84
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +106 -85
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +106 -86
- package/rating/rating.min.js +1 -1
- package/resources/primevue.css +21 -2
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +340 -282
- package/resources/themes/arya-green/theme.css +340 -282
- package/resources/themes/arya-orange/theme.css +340 -282
- package/resources/themes/arya-purple/theme.css +340 -282
- package/resources/themes/bootstrap4-dark-blue/theme.css +356 -298
- package/resources/themes/bootstrap4-dark-purple/theme.css +356 -298
- package/resources/themes/bootstrap4-light-blue/theme.css +369 -311
- package/resources/themes/bootstrap4-light-purple/theme.css +369 -311
- package/resources/themes/fluent-light/theme.css +350 -292
- package/resources/themes/lara-dark-blue/theme.css +343 -285
- package/resources/themes/lara-dark-indigo/theme.css +343 -285
- package/resources/themes/lara-dark-purple/theme.css +343 -285
- package/resources/themes/lara-dark-teal/theme.css +343 -285
- package/resources/themes/lara-light-blue/theme.css +367 -309
- package/resources/themes/lara-light-indigo/theme.css +367 -309
- package/resources/themes/lara-light-purple/theme.css +367 -309
- package/resources/themes/lara-light-teal/theme.css +367 -309
- package/resources/themes/luna-amber/theme.css +372 -314
- package/resources/themes/luna-blue/theme.css +372 -314
- package/resources/themes/luna-green/theme.css +372 -314
- package/resources/themes/luna-pink/theme.css +372 -314
- package/resources/themes/md-dark-deeppurple/theme.css +413 -318
- package/resources/themes/md-dark-indigo/theme.css +413 -318
- package/resources/themes/md-light-deeppurple/theme.css +413 -318
- package/resources/themes/md-light-indigo/theme.css +413 -318
- package/resources/themes/mdc-dark-deeppurple/theme.css +413 -318
- package/resources/themes/mdc-dark-indigo/theme.css +413 -318
- package/resources/themes/mdc-light-deeppurple/theme.css +413 -318
- package/resources/themes/mdc-light-indigo/theme.css +413 -318
- package/resources/themes/nova/theme.css +336 -278
- package/resources/themes/nova-accent/theme.css +335 -277
- package/resources/themes/nova-alt/theme.css +336 -278
- package/resources/themes/nova-vue/theme.css +336 -278
- package/resources/themes/rhea/theme.css +335 -277
- package/resources/themes/saga-blue/theme.css +347 -289
- package/resources/themes/saga-green/theme.css +347 -289
- package/resources/themes/saga-orange/theme.css +347 -289
- package/resources/themes/saga-purple/theme.css +347 -289
- package/resources/themes/tailwind-light/theme.css +359 -301
- package/resources/themes/vela-blue/theme.css +347 -289
- package/resources/themes/vela-green/theme.css +347 -289
- package/resources/themes/vela-orange/theme.css +347 -289
- package/resources/themes/vela-purple/theme.css +347 -289
- package/ripple/ripple.cjs.js +19 -1
- package/ripple/ripple.cjs.min.js +1 -1
- package/ripple/ripple.esm.js +19 -1
- package/ripple/ripple.esm.min.js +1 -1
- package/ripple/ripple.js +19 -1
- package/ripple/ripple.min.js +1 -1
- package/row/Row.d.ts +6 -9
- package/row/Row.vue +1 -1
- package/scrollpanel/ScrollPanel.d.ts +9 -5
- package/scrollpanel/ScrollPanel.vue +194 -56
- package/scrollpanel/scrollpanel.cjs.js +180 -56
- package/scrollpanel/scrollpanel.cjs.min.js +1 -1
- package/scrollpanel/scrollpanel.esm.js +181 -57
- package/scrollpanel/scrollpanel.esm.min.js +1 -1
- package/scrollpanel/scrollpanel.js +180 -56
- package/scrollpanel/scrollpanel.min.js +1 -1
- package/scrolltop/ScrollTop.d.ts +5 -7
- package/scrolltop/ScrollTop.vue +18 -23
- package/scrolltop/scrolltop.cjs.js +14 -19
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.esm.js +14 -19
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +14 -19
- package/scrolltop/scrolltop.min.js +1 -1
- package/selectbutton/SelectButton.d.ts +11 -11
- package/selectbutton/SelectButton.vue +50 -32
- package/selectbutton/selectbutton.cjs.js +30 -25
- package/selectbutton/selectbutton.esm.js +30 -25
- package/selectbutton/selectbutton.js +30 -25
- package/sidebar/Sidebar.d.ts +6 -6
- package/sidebar/Sidebar.vue +24 -14
- package/sidebar/sidebar.cjs.js +20 -10
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +20 -10
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +20 -10
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/Skeleton.d.ts +5 -7
- package/skeleton/Skeleton.vue +12 -11
- package/skeleton/skeleton.cjs.js +10 -9
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +10 -9
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +10 -9
- package/skeleton/skeleton.min.js +1 -1
- package/slider/Slider.d.ts +7 -8
- package/slider/Slider.vue +162 -141
- package/slider/slider.cjs.js +100 -127
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +100 -127
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +100 -127
- package/slider/slider.min.js +1 -1
- package/speeddial/SpeedDial.d.ts +8 -8
- package/speeddial/SpeedDial.vue +66 -46
- package/speeddial/speeddial.cjs.js +77 -62
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +77 -62
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +77 -62
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +6 -6
- package/splitbutton/SplitButton.vue +9 -11
- package/splitbutton/splitbutton.cjs.js +7 -7
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +7 -7
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +7 -7
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/Splitter.d.ts +10 -5
- package/splitter/Splitter.vue +158 -53
- package/splitter/splitter.cjs.js +156 -52
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +157 -53
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +156 -52
- package/splitter/splitter.min.js +1 -1
- package/splitterpanel/SplitterPanel.d.ts +4 -5
- package/splitterpanel/SplitterPanel.vue +3 -3
- package/splitterpanel/splitterpanel.cjs.js +2 -2
- package/splitterpanel/splitterpanel.esm.js +2 -2
- package/splitterpanel/splitterpanel.js +2 -2
- package/steps/Steps.d.ts +4 -5
- package/steps/Steps.vue +137 -30
- package/steps/steps.cjs.js +135 -36
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +136 -37
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +135 -36
- package/steps/steps.min.js +1 -1
- package/styleclass/styleclass.cjs.js +20 -22
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +20 -22
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +20 -22
- package/styleclass/styleclass.min.js +1 -1
- package/tabmenu/TabMenu.d.ts +13 -5
- package/tabmenu/TabMenu.vue +176 -36
- package/tabmenu/tabmenu.cjs.js +173 -42
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +173 -42
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +174 -43
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabpanel/TabPanel.d.ts +33 -6
- package/tabpanel/TabPanel.vue +8 -1
- package/tabpanel/tabpanel.cjs.js +7 -0
- package/tabpanel/tabpanel.cjs.min.js +1 -1
- package/tabpanel/tabpanel.esm.js +7 -0
- package/tabpanel/tabpanel.esm.min.js +1 -1
- package/tabpanel/tabpanel.js +7 -0
- package/tabpanel/tabpanel.min.js +1 -1
- package/tabview/TabView.d.ts +22 -6
- package/tabview/TabView.vue +280 -96
- package/tabview/tabview.cjs.js +295 -132
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +296 -133
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +296 -133
- package/tabview/tabview.min.js +1 -1
- package/tag/Tag.d.ts +4 -5
- package/tag/Tag.vue +13 -10
- package/tag/tag.cjs.js +10 -7
- package/tag/tag.esm.js +10 -7
- package/tag/tag.js +10 -7
- package/terminal/Terminal.d.ts +5 -7
- package/terminal/Terminal.vue +10 -10
- package/terminal/terminal.cjs.js +3 -3
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +3 -3
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +3 -3
- package/terminal/terminal.min.js +1 -1
- package/textarea/Textarea.d.ts +5 -6
- package/textarea/Textarea.vue +7 -7
- package/textarea/textarea.cjs.js +6 -6
- package/textarea/textarea.esm.js +6 -6
- package/textarea/textarea.js +6 -6
- package/tieredmenu/TieredMenu.d.ts +48 -6
- package/tieredmenu/TieredMenu.vue +500 -58
- package/tieredmenu/TieredMenuSub.vue +126 -208
- package/tieredmenu/tieredmenu.cjs.js +684 -338
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +685 -339
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +685 -339
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/timeline/Timeline.d.ts +4 -5
- package/timeline/Timeline.vue +6 -10
- package/timeline/timeline.cjs.js +3 -7
- package/timeline/timeline.cjs.min.js +1 -1
- package/timeline/timeline.esm.js +3 -7
- package/timeline/timeline.esm.min.js +1 -1
- package/timeline/timeline.js +3 -7
- package/timeline/timeline.min.js +1 -1
- package/toast/Toast.d.ts +10 -13
- package/toast/Toast.vue +40 -31
- package/toast/ToastMessage.vue +29 -20
- package/toast/toast.cjs.js +56 -38
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +55 -37
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +56 -38
- package/toast/toast.min.js +1 -1
- package/toastservice/toastservice.cjs.js +1 -0
- package/toastservice/toastservice.esm.js +1 -0
- package/toastservice/toastservice.js +1 -0
- package/togglebutton/ToggleButton.d.ts +10 -10
- package/togglebutton/ToggleButton.vue +82 -23
- package/togglebutton/togglebutton.cjs.js +66 -18
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +66 -18
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +66 -18
- package/togglebutton/togglebutton.min.js +1 -1
- package/toolbar/Toolbar.d.ts +8 -5
- package/toolbar/Toolbar.vue +9 -3
- package/toolbar/toolbar.cjs.js +14 -7
- package/toolbar/toolbar.cjs.min.js +1 -1
- package/toolbar/toolbar.esm.js +14 -7
- package/toolbar/toolbar.esm.min.js +1 -1
- package/toolbar/toolbar.js +14 -7
- package/toolbar/toolbar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +36 -24
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +37 -25
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +36 -24
- package/tooltip/tooltip.min.js +1 -1
- package/tree/Tree.d.ts +15 -7
- package/tree/Tree.vue +66 -56
- package/tree/TreeNode.vue +70 -66
- package/tree/tree.cjs.js +99 -102
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +99 -102
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +99 -102
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +9 -9
- package/treeselect/TreeSelect.vue +130 -72
- package/treeselect/treeselect.cjs.js +89 -59
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +89 -59
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +89 -59
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/BodyCell.vue +29 -19
- package/treetable/FooterCell.vue +19 -11
- package/treetable/HeaderCell.vue +44 -36
- package/treetable/TreeTable.d.ts +8 -8
- package/treetable/TreeTable.vue +229 -178
- package/treetable/TreeTableRow.vue +74 -58
- package/treetable/treetable.cjs.js +287 -253
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +287 -253
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +287 -253
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.d.ts +9 -9
- package/tristatecheckbox/TriStateCheckbox.vue +39 -18
- package/tristatecheckbox/tristatecheckbox.cjs.js +24 -15
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +24 -15
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +24 -15
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/ts-helpers.d.ts +16 -10
- package/useconfirm/UseConfirm.d.ts +1 -1
- package/useconfirm/useconfirm.cjs.js +2 -1
- package/useconfirm/useconfirm.esm.js +2 -1
- package/useconfirm/useconfirm.js +2 -1
- package/usedialog/UseDialog.d.ts +1 -1
- package/usedialog/usedialog.cjs.js +2 -1
- package/usedialog/usedialog.esm.js +2 -1
- package/usedialog/usedialog.js +2 -1
- package/usetoast/usetoast.cjs.js +2 -1
- package/usetoast/usetoast.esm.js +2 -1
- package/usetoast/usetoast.js +2 -1
- package/utils/Utils.d.ts +10 -5
- package/utils/utils.cjs.js +209 -156
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +209 -156
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +209 -156
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +335 -3
- package/vetur-tags.json +112 -19
- package/virtualscroller/VirtualScroller.d.ts +9 -9
- package/virtualscroller/VirtualScroller.vue +108 -96
- package/virtualscroller/virtualscroller.cjs.js +87 -89
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +87 -89
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +87 -89
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1183 -73
package/menubar/Menubar.vue
CHANGED
|
@@ -1,70 +1,432 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="containerClass">
|
|
3
|
-
<div
|
|
2
|
+
<div :ref="containerRef" :class="containerClass">
|
|
3
|
+
<div v-if="$slots.start" class="p-menubar-start">
|
|
4
4
|
<slot name="start"></slot>
|
|
5
5
|
</div>
|
|
6
|
-
<a
|
|
6
|
+
<a
|
|
7
|
+
ref="menubutton"
|
|
8
|
+
role="button"
|
|
9
|
+
tabindex="0"
|
|
10
|
+
class="p-menubar-button"
|
|
11
|
+
:aria-haspopup="model.length && model.length > 0 ? true : false"
|
|
12
|
+
:aria-expanded="mobileActive"
|
|
13
|
+
:aria-controls="id"
|
|
14
|
+
:aria-label="$primevue.config.locale.aria.navigation"
|
|
15
|
+
@click="menuButtonClick($event)"
|
|
16
|
+
@keydown="menuButtonKeydown($event)"
|
|
17
|
+
v-bind="buttonProps"
|
|
18
|
+
>
|
|
7
19
|
<i class="pi pi-bars" />
|
|
8
20
|
</a>
|
|
9
|
-
<MenubarSub
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
<MenubarSub
|
|
22
|
+
:ref="menubarRef"
|
|
23
|
+
:id="id"
|
|
24
|
+
class="p-menubar-root-list"
|
|
25
|
+
role="menubar"
|
|
26
|
+
:items="processedItems"
|
|
27
|
+
:root="true"
|
|
28
|
+
:mobileActive="mobileActive"
|
|
29
|
+
tabindex="0"
|
|
30
|
+
:aria-activedescendant="focused ? focusedItemId : undefined"
|
|
31
|
+
:menuId="id"
|
|
32
|
+
:focusedItemId="focused ? focusedItemId : undefined"
|
|
33
|
+
:activeItemPath="activeItemPath"
|
|
34
|
+
:exact="exact"
|
|
35
|
+
:level="0"
|
|
36
|
+
:aria-labelledby="ariaLabelledby"
|
|
37
|
+
:aria-label="ariaLabel"
|
|
38
|
+
@focus="onFocus"
|
|
39
|
+
@blur="onBlur"
|
|
40
|
+
@keydown="onKeyDown"
|
|
41
|
+
@item-click="onItemClick"
|
|
42
|
+
@item-mouseenter="onItemMouseEnter"
|
|
43
|
+
/>
|
|
44
|
+
<div v-if="$slots.end" class="p-menubar-end">
|
|
12
45
|
<slot name="end"></slot>
|
|
13
46
|
</div>
|
|
14
47
|
</div>
|
|
15
48
|
</template>
|
|
16
49
|
|
|
17
50
|
<script>
|
|
51
|
+
import { DomHandler, ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primevue/utils';
|
|
18
52
|
import MenubarSub from './MenubarSub.vue';
|
|
19
|
-
import {ZIndexUtils} from 'primevue/utils';
|
|
20
53
|
|
|
21
54
|
export default {
|
|
22
55
|
name: 'Menubar',
|
|
56
|
+
emits: ['focus', 'blur'],
|
|
23
57
|
props: {
|
|
24
|
-
|
|
58
|
+
model: {
|
|
25
59
|
type: Array,
|
|
26
60
|
default: null
|
|
27
61
|
},
|
|
28
62
|
exact: {
|
|
29
63
|
type: Boolean,
|
|
30
64
|
default: true
|
|
65
|
+
},
|
|
66
|
+
buttonProps: {
|
|
67
|
+
type: null,
|
|
68
|
+
default: null
|
|
69
|
+
},
|
|
70
|
+
'aria-labelledby': {
|
|
71
|
+
type: String,
|
|
72
|
+
default: null
|
|
73
|
+
},
|
|
74
|
+
'aria-label': {
|
|
75
|
+
type: String,
|
|
76
|
+
default: null
|
|
31
77
|
}
|
|
32
78
|
},
|
|
33
79
|
outsideClickListener: null,
|
|
80
|
+
container: null,
|
|
81
|
+
menubar: null,
|
|
34
82
|
data() {
|
|
35
83
|
return {
|
|
36
|
-
mobileActive: false
|
|
84
|
+
mobileActive: false,
|
|
85
|
+
focused: false,
|
|
86
|
+
focusedItemInfo: { index: -1, level: 0, parentKey: '' },
|
|
87
|
+
activeItemPath: [],
|
|
88
|
+
dirty: false
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
watch: {
|
|
92
|
+
activeItemPath(newPath) {
|
|
93
|
+
if (ObjectUtils.isNotEmpty(newPath)) {
|
|
94
|
+
this.bindOutsideClickListener();
|
|
95
|
+
this.bindResizeListener();
|
|
96
|
+
} else {
|
|
97
|
+
this.unbindOutsideClickListener();
|
|
98
|
+
this.unbindResizeListener();
|
|
99
|
+
}
|
|
37
100
|
}
|
|
38
101
|
},
|
|
39
102
|
beforeUnmount() {
|
|
40
103
|
this.mobileActive = false;
|
|
41
104
|
this.unbindOutsideClickListener();
|
|
42
|
-
|
|
43
|
-
|
|
105
|
+
this.unbindResizeListener();
|
|
106
|
+
|
|
107
|
+
if (this.container) {
|
|
108
|
+
ZIndexUtils.clear(this.container);
|
|
44
109
|
}
|
|
110
|
+
|
|
111
|
+
this.container = null;
|
|
45
112
|
},
|
|
46
113
|
methods: {
|
|
114
|
+
getItemProp(item, name) {
|
|
115
|
+
return item ? ObjectUtils.getItemValue(item[name]) : undefined;
|
|
116
|
+
},
|
|
117
|
+
getItemLabel(item) {
|
|
118
|
+
return this.getItemProp(item, 'label');
|
|
119
|
+
},
|
|
120
|
+
isItemDisabled(item) {
|
|
121
|
+
return this.getItemProp(item, 'disabled');
|
|
122
|
+
},
|
|
123
|
+
isItemGroup(item) {
|
|
124
|
+
return ObjectUtils.isNotEmpty(this.getItemProp(item, 'items'));
|
|
125
|
+
},
|
|
126
|
+
isItemSeparator(item) {
|
|
127
|
+
return this.getItemProp(item, 'separator');
|
|
128
|
+
},
|
|
129
|
+
getProccessedItemLabel(processedItem) {
|
|
130
|
+
return processedItem ? this.getItemLabel(processedItem.item) : undefined;
|
|
131
|
+
},
|
|
132
|
+
isProccessedItemGroup(processedItem) {
|
|
133
|
+
return processedItem && ObjectUtils.isNotEmpty(processedItem.items);
|
|
134
|
+
},
|
|
47
135
|
toggle(event) {
|
|
48
136
|
if (this.mobileActive) {
|
|
49
137
|
this.mobileActive = false;
|
|
50
|
-
ZIndexUtils.clear(this
|
|
51
|
-
|
|
52
|
-
else {
|
|
138
|
+
ZIndexUtils.clear(this.menubar);
|
|
139
|
+
this.hide();
|
|
140
|
+
} else {
|
|
53
141
|
this.mobileActive = true;
|
|
54
|
-
ZIndexUtils.set('menu', this
|
|
142
|
+
ZIndexUtils.set('menu', this.menubar, this.$primevue.config.zIndex.menu);
|
|
143
|
+
setTimeout(() => {
|
|
144
|
+
this.show();
|
|
145
|
+
}, 0);
|
|
55
146
|
}
|
|
56
147
|
|
|
57
148
|
this.bindOutsideClickListener();
|
|
58
149
|
event.preventDefault();
|
|
59
150
|
},
|
|
151
|
+
show() {
|
|
152
|
+
this.focusedItemInfo = { index: this.findFirstFocusedItemIndex(), level: 0, parentKey: '' };
|
|
153
|
+
|
|
154
|
+
DomHandler.focus(this.menubar);
|
|
155
|
+
},
|
|
156
|
+
hide(event, isFocus) {
|
|
157
|
+
if (this.mobileActive) {
|
|
158
|
+
setTimeout(() => {
|
|
159
|
+
DomHandler.focus(this.$refs.menubutton);
|
|
160
|
+
}, 0);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
this.activeItemPath = [];
|
|
164
|
+
this.focusedItemInfo = { index: -1, level: 0, parentKey: '' };
|
|
165
|
+
|
|
166
|
+
isFocus && DomHandler.focus(this.menubar);
|
|
167
|
+
this.dirty = false;
|
|
168
|
+
},
|
|
169
|
+
onFocus(event) {
|
|
170
|
+
this.focused = true;
|
|
171
|
+
this.focusedItemInfo = this.focusedItemInfo.index !== -1 ? this.focusedItemInfo : { index: this.findFirstFocusedItemIndex(), level: 0, parentKey: '' };
|
|
172
|
+
this.$emit('focus', event);
|
|
173
|
+
},
|
|
174
|
+
onBlur(event) {
|
|
175
|
+
this.focused = false;
|
|
176
|
+
this.focusedItemInfo = { index: -1, level: 0, parentKey: '' };
|
|
177
|
+
this.searchValue = '';
|
|
178
|
+
this.dirty = false;
|
|
179
|
+
this.$emit('blur', event);
|
|
180
|
+
},
|
|
181
|
+
onKeyDown(event) {
|
|
182
|
+
const metaKey = event.metaKey || event.ctrlKey;
|
|
183
|
+
|
|
184
|
+
switch (event.code) {
|
|
185
|
+
case 'ArrowDown':
|
|
186
|
+
this.onArrowDownKey(event);
|
|
187
|
+
break;
|
|
188
|
+
|
|
189
|
+
case 'ArrowUp':
|
|
190
|
+
this.onArrowUpKey(event);
|
|
191
|
+
break;
|
|
192
|
+
|
|
193
|
+
case 'ArrowLeft':
|
|
194
|
+
this.onArrowLeftKey(event);
|
|
195
|
+
break;
|
|
196
|
+
|
|
197
|
+
case 'ArrowRight':
|
|
198
|
+
this.onArrowRightKey(event);
|
|
199
|
+
break;
|
|
200
|
+
|
|
201
|
+
case 'Home':
|
|
202
|
+
this.onHomeKey(event);
|
|
203
|
+
break;
|
|
204
|
+
|
|
205
|
+
case 'End':
|
|
206
|
+
this.onEndKey(event);
|
|
207
|
+
break;
|
|
208
|
+
|
|
209
|
+
case 'Space':
|
|
210
|
+
this.onSpaceKey(event);
|
|
211
|
+
break;
|
|
212
|
+
|
|
213
|
+
case 'Enter':
|
|
214
|
+
this.onEnterKey(event);
|
|
215
|
+
break;
|
|
216
|
+
|
|
217
|
+
case 'Escape':
|
|
218
|
+
this.onEscapeKey(event);
|
|
219
|
+
break;
|
|
220
|
+
|
|
221
|
+
case 'Tab':
|
|
222
|
+
this.onTabKey(event);
|
|
223
|
+
break;
|
|
224
|
+
|
|
225
|
+
case 'PageDown':
|
|
226
|
+
case 'PageUp':
|
|
227
|
+
case 'Backspace':
|
|
228
|
+
case 'ShiftLeft':
|
|
229
|
+
case 'ShiftRight':
|
|
230
|
+
//NOOP
|
|
231
|
+
break;
|
|
232
|
+
|
|
233
|
+
default:
|
|
234
|
+
if (!metaKey && ObjectUtils.isPrintableCharacter(event.key)) {
|
|
235
|
+
this.searchItems(event, event.key);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
onItemChange(event) {
|
|
242
|
+
const { processedItem, isFocus } = event;
|
|
243
|
+
|
|
244
|
+
if (ObjectUtils.isEmpty(processedItem)) return;
|
|
245
|
+
|
|
246
|
+
const { index, key, level, parentKey, items } = processedItem;
|
|
247
|
+
const grouped = ObjectUtils.isNotEmpty(items);
|
|
248
|
+
const activeItemPath = this.activeItemPath.filter((p) => p.parentKey !== parentKey && p.parentKey !== key);
|
|
249
|
+
|
|
250
|
+
grouped && activeItemPath.push(processedItem);
|
|
251
|
+
|
|
252
|
+
this.focusedItemInfo = { index, level, parentKey };
|
|
253
|
+
this.activeItemPath = activeItemPath;
|
|
254
|
+
|
|
255
|
+
grouped && (this.dirty = true);
|
|
256
|
+
isFocus && DomHandler.focus(this.menubar);
|
|
257
|
+
},
|
|
258
|
+
onItemClick(event) {
|
|
259
|
+
const { originalEvent, processedItem } = event;
|
|
260
|
+
const grouped = this.isProccessedItemGroup(processedItem);
|
|
261
|
+
const root = ObjectUtils.isEmpty(processedItem.parent);
|
|
262
|
+
const selected = this.isSelected(processedItem);
|
|
263
|
+
|
|
264
|
+
if (selected) {
|
|
265
|
+
const { index, key, level, parentKey } = processedItem;
|
|
266
|
+
|
|
267
|
+
this.activeItemPath = this.activeItemPath.filter((p) => key !== p.key && key.startsWith(p.key));
|
|
268
|
+
this.focusedItemInfo = { index, level, parentKey };
|
|
269
|
+
|
|
270
|
+
this.dirty = !root;
|
|
271
|
+
DomHandler.focus(this.menubar);
|
|
272
|
+
} else {
|
|
273
|
+
if (grouped) {
|
|
274
|
+
this.onItemChange(event);
|
|
275
|
+
} else {
|
|
276
|
+
this.hide(originalEvent, true);
|
|
277
|
+
this.mobileActive = false;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
onItemMouseEnter(event) {
|
|
282
|
+
if (!this.mobileActive && this.dirty) {
|
|
283
|
+
this.onItemChange(event);
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
menuButtonClick(event) {
|
|
287
|
+
this.toggle(event);
|
|
288
|
+
},
|
|
289
|
+
menuButtonKeydown(event) {
|
|
290
|
+
(event.code === 'Enter' || event.code === 'Space') && this.menuButtonClick(event);
|
|
291
|
+
},
|
|
292
|
+
onArrowDownKey(event) {
|
|
293
|
+
const processedItem = this.visibleItems[this.focusedItemInfo.index];
|
|
294
|
+
const root = processedItem ? ObjectUtils.isEmpty(processedItem.parent) : null;
|
|
295
|
+
|
|
296
|
+
if (root) {
|
|
297
|
+
const grouped = this.isProccessedItemGroup(processedItem);
|
|
298
|
+
|
|
299
|
+
if (grouped) {
|
|
300
|
+
this.onItemChange({ originalEvent: event, processedItem });
|
|
301
|
+
this.focusedItemInfo = { index: -1, parentKey: processedItem.key };
|
|
302
|
+
this.onArrowRightKey(event);
|
|
303
|
+
}
|
|
304
|
+
} else {
|
|
305
|
+
const itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex();
|
|
306
|
+
|
|
307
|
+
this.changeFocusedItemIndex(event, itemIndex);
|
|
308
|
+
event.preventDefault();
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
onArrowUpKey(event) {
|
|
312
|
+
const processedItem = this.visibleItems[this.focusedItemInfo.index];
|
|
313
|
+
const root = ObjectUtils.isEmpty(processedItem.parent);
|
|
314
|
+
|
|
315
|
+
if (root) {
|
|
316
|
+
const grouped = this.isProccessedItemGroup(processedItem);
|
|
317
|
+
|
|
318
|
+
if (grouped) {
|
|
319
|
+
this.onItemChange({ originalEvent: event, processedItem });
|
|
320
|
+
this.focusedItemInfo = { index: -1, parentKey: processedItem.key };
|
|
321
|
+
const itemIndex = this.findLastItemIndex();
|
|
322
|
+
|
|
323
|
+
this.changeFocusedItemIndex(event, itemIndex);
|
|
324
|
+
}
|
|
325
|
+
} else {
|
|
326
|
+
const parentItem = this.activeItemPath.find((p) => p.key === processedItem.parentKey);
|
|
327
|
+
|
|
328
|
+
if (this.focusedItemInfo.index === 0) {
|
|
329
|
+
this.focusedItemInfo = { index: -1, parentKey: parentItem ? parentItem.parentKey : '' };
|
|
330
|
+
this.searchValue = '';
|
|
331
|
+
this.onArrowLeftKey(event);
|
|
332
|
+
this.activeItemPath = this.activeItemPath.filter((p) => p.parentKey !== this.focusedItemInfo.parentKey);
|
|
333
|
+
} else {
|
|
334
|
+
const itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex();
|
|
335
|
+
|
|
336
|
+
this.changeFocusedItemIndex(event, itemIndex);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
event.preventDefault();
|
|
341
|
+
},
|
|
342
|
+
onArrowLeftKey(event) {
|
|
343
|
+
const processedItem = this.visibleItems[this.focusedItemInfo.index];
|
|
344
|
+
const parentItem = processedItem ? this.activeItemPath.find((p) => p.key === processedItem.parentKey) : null;
|
|
345
|
+
|
|
346
|
+
if (parentItem) {
|
|
347
|
+
this.onItemChange({ originalEvent: event, processedItem: parentItem });
|
|
348
|
+
this.activeItemPath = this.activeItemPath.filter((p) => p.parentKey !== this.focusedItemInfo.parentKey);
|
|
349
|
+
|
|
350
|
+
event.preventDefault();
|
|
351
|
+
} else {
|
|
352
|
+
const itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex();
|
|
353
|
+
|
|
354
|
+
this.changeFocusedItemIndex(event, itemIndex);
|
|
355
|
+
event.preventDefault();
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
onArrowRightKey(event) {
|
|
359
|
+
const processedItem = this.visibleItems[this.focusedItemInfo.index];
|
|
360
|
+
const parentItem = processedItem ? this.activeItemPath.find((p) => p.key === processedItem.parentKey) : null;
|
|
361
|
+
|
|
362
|
+
if (parentItem) {
|
|
363
|
+
const grouped = this.isProccessedItemGroup(processedItem);
|
|
364
|
+
|
|
365
|
+
if (grouped) {
|
|
366
|
+
this.onItemChange({ originalEvent: event, processedItem });
|
|
367
|
+
this.focusedItemInfo = { index: -1, parentKey: processedItem.key };
|
|
368
|
+
this.onArrowDownKey(event);
|
|
369
|
+
}
|
|
370
|
+
} else {
|
|
371
|
+
const itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex();
|
|
372
|
+
|
|
373
|
+
this.changeFocusedItemIndex(event, itemIndex);
|
|
374
|
+
event.preventDefault();
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
onHomeKey(event) {
|
|
378
|
+
this.changeFocusedItemIndex(event, this.findFirstItemIndex());
|
|
379
|
+
event.preventDefault();
|
|
380
|
+
},
|
|
381
|
+
onEndKey(event) {
|
|
382
|
+
this.changeFocusedItemIndex(event, this.findLastItemIndex());
|
|
383
|
+
event.preventDefault();
|
|
384
|
+
},
|
|
385
|
+
onEnterKey(event) {
|
|
386
|
+
if (this.focusedItemInfo.index !== -1) {
|
|
387
|
+
const element = DomHandler.findSingle(this.menubar, `li[id="${`${this.focusedItemId}`}"]`);
|
|
388
|
+
const anchorElement = element && DomHandler.findSingle(element, '.p-menuitem-link');
|
|
389
|
+
|
|
390
|
+
anchorElement ? anchorElement.click() : element && element.click();
|
|
391
|
+
|
|
392
|
+
const processedItem = this.visibleItems[this.focusedItemInfo.index];
|
|
393
|
+
const grouped = this.isProccessedItemGroup(processedItem);
|
|
394
|
+
|
|
395
|
+
!grouped && (this.focusedItemInfo.index = this.findFirstFocusedItemIndex());
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
event.preventDefault();
|
|
399
|
+
},
|
|
400
|
+
onSpaceKey(event) {
|
|
401
|
+
this.onEnterKey(event);
|
|
402
|
+
},
|
|
403
|
+
onEscapeKey(event) {
|
|
404
|
+
this.hide(event, true);
|
|
405
|
+
this.focusedItemInfo.index = this.findFirstFocusedItemIndex();
|
|
406
|
+
|
|
407
|
+
event.preventDefault();
|
|
408
|
+
},
|
|
409
|
+
onTabKey(event) {
|
|
410
|
+
if (this.focusedItemInfo.index !== -1) {
|
|
411
|
+
const processedItem = this.visibleItems[this.focusedItemInfo.index];
|
|
412
|
+
const grouped = this.isProccessedItemGroup(processedItem);
|
|
413
|
+
|
|
414
|
+
!grouped && this.onItemChange({ originalEvent: event, processedItem });
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
this.hide();
|
|
418
|
+
},
|
|
60
419
|
bindOutsideClickListener() {
|
|
61
420
|
if (!this.outsideClickListener) {
|
|
62
421
|
this.outsideClickListener = (event) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
422
|
+
const isOutsideContainer = this.menubar !== event.target && !this.menubar.contains(event.target);
|
|
423
|
+
const isOutsideMenuButton = this.mobileActive && this.$refs.menubutton !== event.target && !this.$refs.menubutton.contains(event.target);
|
|
424
|
+
|
|
425
|
+
if (isOutsideContainer) {
|
|
426
|
+
isOutsideMenuButton ? (this.mobileActive = false) : this.hide();
|
|
66
427
|
}
|
|
67
428
|
};
|
|
429
|
+
|
|
68
430
|
document.addEventListener('click', this.outsideClickListener);
|
|
69
431
|
}
|
|
70
432
|
},
|
|
@@ -74,19 +436,167 @@ export default {
|
|
|
74
436
|
this.outsideClickListener = null;
|
|
75
437
|
}
|
|
76
438
|
},
|
|
77
|
-
|
|
78
|
-
this.
|
|
439
|
+
bindResizeListener() {
|
|
440
|
+
if (!this.resizeListener) {
|
|
441
|
+
this.resizeListener = (event) => {
|
|
442
|
+
if (!DomHandler.isTouchDevice()) {
|
|
443
|
+
this.hide(event, true);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
this.mobileActive = false;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
window.addEventListener('resize', this.resizeListener);
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
unbindResizeListener() {
|
|
453
|
+
if (this.resizeListener) {
|
|
454
|
+
window.removeEventListener('resize', this.resizeListener);
|
|
455
|
+
this.resizeListener = null;
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
isItemMatched(processedItem) {
|
|
459
|
+
return this.isValidItem(processedItem) && this.getProccessedItemLabel(processedItem).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase());
|
|
460
|
+
},
|
|
461
|
+
isValidItem(processedItem) {
|
|
462
|
+
return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item);
|
|
463
|
+
},
|
|
464
|
+
isValidSelectedItem(processedItem) {
|
|
465
|
+
return this.isValidItem(processedItem) && this.isSelected(processedItem);
|
|
466
|
+
},
|
|
467
|
+
isSelected(processedItem) {
|
|
468
|
+
return this.activeItemPath.some((p) => p.key === processedItem.key);
|
|
469
|
+
},
|
|
470
|
+
findFirstItemIndex() {
|
|
471
|
+
return this.visibleItems.findIndex((processedItem) => this.isValidItem(processedItem));
|
|
472
|
+
},
|
|
473
|
+
findLastItemIndex() {
|
|
474
|
+
return ObjectUtils.findLastIndex(this.visibleItems, (processedItem) => this.isValidItem(processedItem));
|
|
475
|
+
},
|
|
476
|
+
findNextItemIndex(index) {
|
|
477
|
+
const matchedItemIndex = index < this.visibleItems.length - 1 ? this.visibleItems.slice(index + 1).findIndex((processedItem) => this.isValidItem(processedItem)) : -1;
|
|
478
|
+
|
|
479
|
+
return matchedItemIndex > -1 ? matchedItemIndex + index + 1 : index;
|
|
480
|
+
},
|
|
481
|
+
findPrevItemIndex(index) {
|
|
482
|
+
const matchedItemIndex = index > 0 ? ObjectUtils.findLastIndex(this.visibleItems.slice(0, index), (processedItem) => this.isValidItem(processedItem)) : -1;
|
|
483
|
+
|
|
484
|
+
return matchedItemIndex > -1 ? matchedItemIndex : index;
|
|
485
|
+
},
|
|
486
|
+
findSelectedItemIndex() {
|
|
487
|
+
return this.visibleItems.findIndex((processedItem) => this.isValidSelectedItem(processedItem));
|
|
488
|
+
},
|
|
489
|
+
findFirstFocusedItemIndex() {
|
|
490
|
+
const selectedIndex = this.findSelectedItemIndex();
|
|
491
|
+
|
|
492
|
+
return selectedIndex < 0 ? this.findFirstItemIndex() : selectedIndex;
|
|
493
|
+
},
|
|
494
|
+
findLastFocusedItemIndex() {
|
|
495
|
+
const selectedIndex = this.findSelectedItemIndex();
|
|
496
|
+
|
|
497
|
+
return selectedIndex < 0 ? this.findLastItemIndex() : selectedIndex;
|
|
498
|
+
},
|
|
499
|
+
searchItems(event, char) {
|
|
500
|
+
this.searchValue = (this.searchValue || '') + char;
|
|
501
|
+
|
|
502
|
+
let itemIndex = -1;
|
|
503
|
+
let matched = false;
|
|
504
|
+
|
|
505
|
+
if (this.focusedItemInfo.index !== -1) {
|
|
506
|
+
itemIndex = this.visibleItems.slice(this.focusedItemInfo.index).findIndex((processedItem) => this.isItemMatched(processedItem));
|
|
507
|
+
itemIndex = itemIndex === -1 ? this.visibleItems.slice(0, this.focusedItemInfo.index).findIndex((processedItem) => this.isItemMatched(processedItem)) : itemIndex + this.focusedItemInfo.index;
|
|
508
|
+
} else {
|
|
509
|
+
itemIndex = this.visibleItems.findIndex((processedItem) => this.isItemMatched(processedItem));
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
if (itemIndex !== -1) {
|
|
513
|
+
matched = true;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
if (itemIndex === -1 && this.focusedItemInfo.index === -1) {
|
|
517
|
+
itemIndex = this.findFirstFocusedItemIndex();
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
if (itemIndex !== -1) {
|
|
521
|
+
this.changeFocusedItemIndex(event, itemIndex);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
if (this.searchTimeout) {
|
|
525
|
+
clearTimeout(this.searchTimeout);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
this.searchTimeout = setTimeout(() => {
|
|
529
|
+
this.searchValue = '';
|
|
530
|
+
this.searchTimeout = null;
|
|
531
|
+
}, 500);
|
|
532
|
+
|
|
533
|
+
return matched;
|
|
534
|
+
},
|
|
535
|
+
changeFocusedItemIndex(event, index) {
|
|
536
|
+
if (this.focusedItemInfo.index !== index) {
|
|
537
|
+
this.focusedItemInfo.index = index;
|
|
538
|
+
this.scrollInView();
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
scrollInView(index = -1) {
|
|
542
|
+
const id = index !== -1 ? `${this.id}_${index}` : this.focusedItemId;
|
|
543
|
+
const element = DomHandler.findSingle(this.menubar, `li[id="${id}"]`);
|
|
544
|
+
|
|
545
|
+
if (element) {
|
|
546
|
+
element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'start' });
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
createProcessedItems(items, level = 0, parent = {}, parentKey = '') {
|
|
550
|
+
const processedItems = [];
|
|
551
|
+
|
|
552
|
+
items &&
|
|
553
|
+
items.forEach((item, index) => {
|
|
554
|
+
const key = (parentKey !== '' ? parentKey + '_' : '') + index;
|
|
555
|
+
const newItem = {
|
|
556
|
+
item,
|
|
557
|
+
index,
|
|
558
|
+
level,
|
|
559
|
+
key,
|
|
560
|
+
parent,
|
|
561
|
+
parentKey
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
newItem['items'] = this.createProcessedItems(item.items, level + 1, newItem, key);
|
|
565
|
+
processedItems.push(newItem);
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
return processedItems;
|
|
569
|
+
},
|
|
570
|
+
containerRef(el) {
|
|
571
|
+
this.container = el;
|
|
572
|
+
},
|
|
573
|
+
menubarRef(el) {
|
|
574
|
+
this.menubar = el ? el.$el : undefined;
|
|
79
575
|
}
|
|
80
576
|
},
|
|
81
577
|
computed: {
|
|
82
578
|
containerClass() {
|
|
83
|
-
return ['p-menubar p-component', {'p-menubar-mobile-active': this.mobileActive}];
|
|
579
|
+
return ['p-menubar p-component', { 'p-menubar-mobile-active': this.mobileActive }];
|
|
580
|
+
},
|
|
581
|
+
processedItems() {
|
|
582
|
+
return this.createProcessedItems(this.model || []);
|
|
583
|
+
},
|
|
584
|
+
visibleItems() {
|
|
585
|
+
const processedItem = this.activeItemPath.find((p) => p.key === this.focusedItemInfo.parentKey);
|
|
586
|
+
|
|
587
|
+
return processedItem ? processedItem.items : this.processedItems;
|
|
588
|
+
},
|
|
589
|
+
id() {
|
|
590
|
+
return this.$attrs.id || UniqueComponentId();
|
|
591
|
+
},
|
|
592
|
+
focusedItemId() {
|
|
593
|
+
return this.focusedItemInfo.index !== -1 ? `${this.id}${ObjectUtils.isNotEmpty(this.focusedItemInfo.parentKey) ? '_' + this.focusedItemInfo.parentKey : ''}_${this.focusedItemInfo.index}` : null;
|
|
84
594
|
}
|
|
85
595
|
},
|
|
86
596
|
components: {
|
|
87
|
-
|
|
597
|
+
MenubarSub: MenubarSub
|
|
88
598
|
}
|
|
89
|
-
}
|
|
599
|
+
};
|
|
90
600
|
</script>
|
|
91
601
|
|
|
92
602
|
<style>
|
|
@@ -121,6 +631,7 @@ export default {
|
|
|
121
631
|
.p-menubar-root-list {
|
|
122
632
|
display: flex;
|
|
123
633
|
align-items: center;
|
|
634
|
+
flex-wrap: wrap;
|
|
124
635
|
}
|
|
125
636
|
|
|
126
637
|
.p-menubar-root-list > li ul {
|
|
@@ -138,17 +649,16 @@ export default {
|
|
|
138
649
|
z-index: 1;
|
|
139
650
|
}
|
|
140
651
|
|
|
141
|
-
.p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list
|
|
652
|
+
.p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {
|
|
142
653
|
display: block;
|
|
143
654
|
left: 100%;
|
|
144
655
|
top: 0;
|
|
145
656
|
}
|
|
146
657
|
|
|
147
|
-
.p-menubar .p-submenu-list .p-menuitem-link .p-submenu-icon {
|
|
658
|
+
.p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon {
|
|
148
659
|
margin-left: auto;
|
|
149
660
|
}
|
|
150
661
|
|
|
151
|
-
.p-menubar .p-menubar-custom,
|
|
152
662
|
.p-menubar .p-menubar-end {
|
|
153
663
|
margin-left: auto;
|
|
154
664
|
align-self: center;
|