primevue 3.22.4 → 3.24.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 +13 -13
- package/accordion/Accordion.d.ts +53 -21
- package/accordiontab/AccordionTab.d.ts +33 -12
- package/autocomplete/AutoComplete.d.ts +111 -84
- package/avatar/Avatar.d.ts +38 -25
- package/avatar/Avatar.vue +1 -1
- package/avatar/avatar.cjs.js +2 -1
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +2 -1
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +2 -1
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/AvatarGroup.d.ts +30 -14
- package/badge/Badge.d.ts +34 -20
- package/badge/Badge.vue +16 -5
- package/badge/badge.cjs.js +15 -5
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +15 -5
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +16 -7
- package/badge/badge.min.js +1 -1
- package/badgedirective/BadgeDirective.d.ts +60 -1
- package/blockui/BlockUI.d.ts +36 -16
- package/breadcrumb/Breadcrumb.d.ts +37 -20
- package/breadcrumb/Breadcrumb.vue +1 -1
- package/breadcrumb/breadcrumb.cjs.js +2 -1
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +2 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +2 -1
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/Button.d.ts +74 -17
- package/button/Button.vue +51 -8
- package/button/button.cjs.js +51 -8
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +51 -8
- package/button/button.esm.min.js +1 -1
- package/button/button.js +51 -8
- package/button/button.min.js +1 -1
- package/calendar/Calendar.d.ts +112 -77
- package/calendar/Calendar.vue +4 -4
- package/calendar/calendar.cjs.js +4 -4
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +4 -4
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +4 -4
- package/calendar/calendar.min.js +1 -1
- package/card/Card.d.ts +35 -15
- package/carousel/Carousel.d.ts +47 -29
- package/cascadeselect/CascadeSelect.d.ts +70 -59
- package/chart/Chart.d.ts +41 -23
- package/checkbox/Checkbox.d.ts +39 -15
- package/checkbox/Checkbox.vue +1 -1
- package/checkbox/checkbox.cjs.js +1 -1
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +1 -1
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +1 -1
- package/checkbox/checkbox.min.js +1 -1
- package/chip/Chip.d.ts +35 -14
- package/chips/Chips.d.ts +45 -20
- package/colorpicker/ColorPicker.d.ts +46 -28
- package/column/Column.d.ts +81 -65
- package/columngroup/ColumnGroup.d.ts +29 -13
- package/config/PrimeVue.d.ts +1 -2
- package/config/config.cjs.js +20 -2
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +20 -2
- package/config/config.esm.min.js +1 -1
- package/config/config.js +20 -2
- package/config/config.min.js +1 -1
- package/confirmationoptions/ConfirmationOptions.d.ts +15 -6
- package/confirmationservice/ConfirmationService.d.ts +11 -0
- package/confirmdialog/ConfirmDialog.d.ts +35 -17
- package/confirmpopup/ConfirmPopup.d.ts +32 -17
- package/contextmenu/ContextMenu.d.ts +51 -35
- package/core/core.js +368 -121
- package/core/core.min.js +8 -8
- package/datatable/DataTable.d.ts +248 -205
- package/datatable/DataTable.vue +78 -117
- package/datatable/TableBody.vue +3 -17
- package/datatable/datatable.cjs.js +73 -67
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +73 -67
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +73 -67
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +65 -47
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +33 -13
- package/deferredcontent/DeferredContent.d.ts +30 -13
- package/dialog/Dialog.d.ts +67 -46
- package/dialog/Dialog.vue +1 -1
- package/dialog/dialog.cjs.js +1 -1
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +1 -1
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +1 -1
- package/dialog/dialog.min.js +1 -1
- package/dialogservice/DialogService.d.ts +13 -2
- package/divider/Divider.d.ts +35 -30
- package/dock/Dock.d.ts +49 -36
- package/dropdown/Dropdown.d.ts +90 -82
- package/dropdown/Dropdown.vue +1 -1
- package/dropdown/dropdown.cjs.js +1 -1
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +1 -1
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +1 -1
- package/dropdown/dropdown.min.js +1 -1
- package/dynamicdialog/DynamicDialog.d.ts +30 -10
- package/dynamicdialog/DynamicDialog.vue +2 -2
- package/dynamicdialog/dynamicdialog.cjs.js +3 -3
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +2 -2
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +3 -3
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/dynamicdialogoptions/DynamicDialogOptions.d.ts +28 -8
- package/editor/Editor.d.ts +48 -17
- package/fieldset/Fieldset.d.ts +43 -16
- package/fileupload/FileUpload.d.ts +101 -47
- package/focustrap/FocusTrap.d.ts +42 -3
- package/fullcalendar/FullCalendar.d.ts +1 -1
- package/galleria/Galleria.d.ts +64 -40
- package/image/Image.d.ts +33 -14
- package/inlinemessage/InlineMessage.d.ts +31 -17
- package/inplace/Inplace.d.ts +41 -18
- package/inputmask/InputMask.d.ts +41 -17
- package/inputnumber/InputNumber.d.ts +60 -41
- package/inputswitch/InputSwitch.d.ts +35 -15
- package/inputswitch/InputSwitch.vue +1 -0
- package/inputswitch/inputswitch.cjs.js +1 -1
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +1 -1
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +1 -1
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/InputText.d.ts +32 -12
- package/knob/Knob.d.ts +47 -21
- package/listbox/Listbox.d.ts +81 -60
- package/megamenu/MegaMenu.d.ts +42 -27
- package/megamenu/MegaMenu.vue +17 -0
- package/megamenu/megamenu.cjs.js +1 -1
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +1 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +1 -1
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +57 -28
- package/menu/Menu.vue +6 -0
- package/menu/menu.cjs.js +26 -8
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +27 -9
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +26 -8
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +36 -19
- package/menuitem/MenuItem.d.ts +22 -10
- package/message/Message.d.ts +40 -21
- package/multiselect/MultiSelect.d.ts +111 -90
- package/orderlist/OrderList.d.ts +51 -23
- package/organizationchart/OrganizationChart.d.ts +43 -26
- package/overlaypanel/OverlayPanel.d.ts +46 -26
- package/package.json +2 -2
- package/paginator/Paginator.d.ts +49 -24
- package/panel/Panel.d.ts +39 -14
- package/panelmenu/PanelMenu.d.ts +49 -21
- package/password/Password.d.ts +47 -28
- package/picklist/PickList.d.ts +74 -33
- package/progressbar/ProgressBar.d.ts +34 -17
- package/progressspinner/ProgressSpinner.d.ts +32 -13
- package/radiobutton/RadioButton.d.ts +32 -14
- package/rating/Rating.d.ts +51 -25
- package/resources/themes/arya-blue/theme.css +34 -11
- package/resources/themes/arya-green/theme.css +34 -11
- package/resources/themes/arya-orange/theme.css +34 -11
- package/resources/themes/arya-purple/theme.css +34 -11
- package/resources/themes/bootstrap4-dark-blue/theme.css +34 -11
- package/resources/themes/bootstrap4-dark-purple/theme.css +34 -11
- package/resources/themes/bootstrap4-light-blue/theme.css +34 -11
- package/resources/themes/bootstrap4-light-purple/theme.css +34 -11
- package/resources/themes/fluent-light/theme.css +34 -11
- package/resources/themes/lara-dark-blue/theme.css +34 -11
- package/resources/themes/lara-dark-indigo/theme.css +34 -11
- package/resources/themes/lara-dark-purple/theme.css +34 -11
- package/resources/themes/lara-dark-teal/theme.css +34 -11
- package/resources/themes/lara-light-blue/theme.css +34 -11
- package/resources/themes/lara-light-indigo/theme.css +34 -11
- package/resources/themes/lara-light-purple/theme.css +34 -11
- package/resources/themes/lara-light-teal/theme.css +34 -11
- package/resources/themes/luna-amber/theme.css +34 -11
- package/resources/themes/luna-blue/theme.css +34 -11
- package/resources/themes/luna-green/theme.css +34 -11
- package/resources/themes/luna-pink/theme.css +34 -11
- package/resources/themes/md-dark-deeppurple/theme.css +34 -11
- package/resources/themes/md-dark-indigo/theme.css +34 -11
- package/resources/themes/md-light-deeppurple/theme.css +34 -11
- package/resources/themes/md-light-indigo/theme.css +34 -11
- package/resources/themes/mdc-dark-deeppurple/theme.css +34 -11
- package/resources/themes/mdc-dark-indigo/theme.css +34 -11
- package/resources/themes/mdc-light-deeppurple/theme.css +34 -11
- package/resources/themes/mdc-light-indigo/theme.css +34 -11
- package/resources/themes/mira/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/mira/theme.css +6089 -0
- package/resources/themes/nano/theme.css +5861 -0
- package/resources/themes/nova/theme.css +34 -11
- package/resources/themes/nova-accent/theme.css +34 -11
- package/resources/themes/nova-alt/theme.css +34 -11
- package/resources/themes/nova-vue/theme.css +34 -11
- package/resources/themes/rhea/theme.css +34 -11
- package/resources/themes/saga-blue/theme.css +34 -11
- package/resources/themes/saga-green/theme.css +34 -11
- package/resources/themes/saga-orange/theme.css +34 -11
- package/resources/themes/saga-purple/theme.css +34 -11
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-dark/theme.css +5854 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-light/theme.css +5908 -0
- package/resources/themes/tailwind-light/theme.css +34 -11
- package/resources/themes/vela-blue/theme.css +34 -11
- package/resources/themes/vela-green/theme.css +34 -11
- package/resources/themes/vela-orange/theme.css +34 -11
- package/resources/themes/vela-purple/theme.css +34 -11
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-dark/theme.css +6016 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-light/theme.css +6016 -0
- package/ripple/Ripple.d.ts +24 -1
- package/row/Row.d.ts +28 -10
- package/scrollpanel/ScrollPanel.d.ts +29 -11
- package/scrolltop/ScrollTop.d.ts +35 -18
- package/selectbutton/SelectButton.d.ts +47 -27
- package/sidebar/Sidebar.d.ts +46 -27
- package/skeleton/Skeleton.d.ts +36 -22
- package/slider/Slider.d.ts +46 -23
- package/speeddial/SpeedDial.d.ts +64 -51
- package/splitbutton/SplitButton.d.ts +73 -24
- package/splitbutton/SplitButton.vue +41 -1
- package/splitbutton/splitbutton.cjs.js +43 -3
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +43 -3
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +43 -3
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/Splitter.d.ts +49 -30
- package/splitterpanel/SplitterPanel.d.ts +28 -10
- package/steps/Steps.d.ts +36 -15
- package/styleclass/StyleClass.d.ts +72 -1
- package/tabmenu/TabMenu.d.ts +41 -16
- package/tabmenu/TabMenu.vue +1 -1
- 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/tabpanel/TabPanel.d.ts +29 -11
- package/tabview/TabView.d.ts +47 -19
- package/tag/Tag.d.ts +33 -15
- package/tag/Tag.vue +1 -1
- package/tag/tag.cjs.js +4 -2
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.esm.js +5 -3
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +4 -2
- package/tag/tag.min.js +1 -1
- package/terminal/Terminal.d.ts +30 -14
- package/terminalservice/TerminalService.d.ts +24 -5
- package/textarea/Textarea.d.ts +33 -11
- package/tieredmenu/TieredMenu.d.ts +45 -31
- package/timeline/Timeline.d.ts +41 -32
- package/toast/Toast.d.ts +63 -35
- package/toast/Toast.vue +4 -2
- package/toast/ToastMessage.vue +4 -4
- package/toast/toast.cjs.js +8 -6
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +8 -6
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +8 -6
- package/toast/toast.min.js +1 -1
- package/toastservice/ToastService.d.ts +16 -3
- package/togglebutton/ToggleButton.d.ts +42 -22
- package/toolbar/Toolbar.d.ts +34 -14
- package/tooltip/Tooltip.d.ts +99 -1
- package/tree/Tree.d.ts +55 -36
- package/treeselect/TreeSelect.d.ts +63 -55
- package/treetable/TreeTable.d.ts +121 -107
- package/tristatecheckbox/TriStateCheckbox.d.ts +35 -12
- package/ts-helpers.d.ts +2 -2
- package/utils/utils.cjs.js +20 -22
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +20 -22
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +20 -22
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +62 -2
- package/vetur-tags.json +17 -2
- package/virtualscroller/VirtualScroller.d.ts +99 -43
- package/virtualscroller/VirtualScroller.vue +248 -72
- package/virtualscroller/virtualscroller.cjs.js +234 -72
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +234 -72
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +235 -74
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1930 -1742
package/menu/menu.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import OverlayEventBus from 'primevue/overlayeventbus';
|
|
|
2
2
|
import Portal from 'primevue/portal';
|
|
3
3
|
import { ObjectUtils, UniqueComponentId, ZIndexUtils, DomHandler, ConnectedOverlayScrollHandler } from 'primevue/utils';
|
|
4
4
|
import Ripple from 'primevue/ripple';
|
|
5
|
-
import { resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, createBlock, withCtx, withDirectives, createCommentVNode, toDisplayString, resolveDynamicComponent, createVNode, Transition, mergeProps,
|
|
5
|
+
import { resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, createBlock, withCtx, withDirectives, createCommentVNode, toDisplayString, resolveDynamicComponent, createVNode, Transition, mergeProps, renderSlot, renderList, createTextVNode } from 'vue';
|
|
6
6
|
|
|
7
7
|
var script$1 = {
|
|
8
8
|
name: 'Menuitem',
|
|
@@ -58,8 +58,8 @@ var script$1 = {
|
|
|
58
58
|
const _hoisted_1$1 = ["id", "aria-label", "aria-disabled"];
|
|
59
59
|
const _hoisted_2$1 = ["href", "onClick"];
|
|
60
60
|
const _hoisted_3$1 = { class: "p-menuitem-text" };
|
|
61
|
-
const _hoisted_4 = ["href", "target"];
|
|
62
|
-
const _hoisted_5 = { class: "p-menuitem-text" };
|
|
61
|
+
const _hoisted_4$1 = ["href", "target"];
|
|
62
|
+
const _hoisted_5$1 = { class: "p-menuitem-text" };
|
|
63
63
|
|
|
64
64
|
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
65
65
|
const _component_router_link = resolveComponent("router-link");
|
|
@@ -122,8 +122,8 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
122
122
|
class: normalizeClass(['p-menuitem-icon', $props.item.icon])
|
|
123
123
|
}, null, 2))
|
|
124
124
|
: createCommentVNode("", true),
|
|
125
|
-
createElementVNode("span", _hoisted_5, toDisplayString($options.label()), 1)
|
|
126
|
-
], 10, _hoisted_4)), [
|
|
125
|
+
createElementVNode("span", _hoisted_5$1, toDisplayString($options.label()), 1)
|
|
126
|
+
], 10, _hoisted_4$1)), [
|
|
127
127
|
[_directive_ripple]
|
|
128
128
|
])
|
|
129
129
|
], 64))
|
|
@@ -503,8 +503,16 @@ var script = {
|
|
|
503
503
|
};
|
|
504
504
|
|
|
505
505
|
const _hoisted_1 = ["id"];
|
|
506
|
-
const _hoisted_2 =
|
|
507
|
-
|
|
506
|
+
const _hoisted_2 = {
|
|
507
|
+
key: 0,
|
|
508
|
+
class: "p-menu-start"
|
|
509
|
+
};
|
|
510
|
+
const _hoisted_3 = ["id", "tabindex", "aria-activedescendant", "aria-label", "aria-labelledby"];
|
|
511
|
+
const _hoisted_4 = ["id"];
|
|
512
|
+
const _hoisted_5 = {
|
|
513
|
+
key: 1,
|
|
514
|
+
class: "p-menu-end"
|
|
515
|
+
};
|
|
508
516
|
|
|
509
517
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
510
518
|
const _component_PVMenuitem = resolveComponent("PVMenuitem");
|
|
@@ -531,6 +539,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
531
539
|
}, _ctx.$attrs, {
|
|
532
540
|
onClick: _cache[3] || (_cache[3] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
|
|
533
541
|
}), [
|
|
542
|
+
(_ctx.$slots.start)
|
|
543
|
+
? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
544
|
+
renderSlot(_ctx.$slots, "start")
|
|
545
|
+
]))
|
|
546
|
+
: createCommentVNode("", true),
|
|
534
547
|
createElementVNode("ul", {
|
|
535
548
|
ref: $options.listRef,
|
|
536
549
|
id: $data.id + '_list',
|
|
@@ -560,7 +573,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
560
573
|
renderSlot(_ctx.$slots, "item", { item: item }, () => [
|
|
561
574
|
createTextVNode(toDisplayString($options.label(item)), 1)
|
|
562
575
|
])
|
|
563
|
-
], 8,
|
|
576
|
+
], 8, _hoisted_4))
|
|
564
577
|
: createCommentVNode("", true),
|
|
565
578
|
(openBlock(true), createElementBlock(Fragment, null, renderList(item.items, (child, j) => {
|
|
566
579
|
return (openBlock(), createElementBlock(Fragment, {
|
|
@@ -605,7 +618,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
605
618
|
}, null, 8, ["id", "item", "template", "exact", "focusedOptionId", "onItemClick"]))
|
|
606
619
|
], 64))
|
|
607
620
|
}), 128))
|
|
608
|
-
], 40,
|
|
621
|
+
], 40, _hoisted_3),
|
|
622
|
+
(_ctx.$slots.end)
|
|
623
|
+
? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
624
|
+
renderSlot(_ctx.$slots, "end")
|
|
625
|
+
]))
|
|
626
|
+
: createCommentVNode("", true)
|
|
609
627
|
], 16, _hoisted_1))
|
|
610
628
|
: createCommentVNode("", true)
|
|
611
629
|
]),
|
package/menu/menu.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ObjectUtils as i,UniqueComponentId as n,ZIndexUtils as s,DomHandler as l,ConnectedOverlayScrollHandler as o}from"primevue/utils";import a from"primevue/ripple";import{resolveComponent as r,resolveDirective as d,openBlock as c,createElementBlock as u,normalizeClass as p,normalizeStyle as h,createElementVNode as m,Fragment as b,createBlock as f,withCtx as v,withDirectives as y,createCommentVNode as k,toDisplayString as x,resolveDynamicComponent as g,createVNode as I,Transition as L,mergeProps as O,renderList as C,renderSlot as w,createTextVNode as E}from"vue";var A={name:"Menuitem",inheritAttrs:!1,emits:["item-click"],props:{item:null,template:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?i.getItemValue(e.item[t]):void 0,onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},directives:{ripple:a}};const S=["id","aria-label","aria-disabled"],K=["href","onClick"],z={class:"p-menuitem-text"},$=["href","target"],D={class:"p-menuitem-text"};A.render=function(e,t,i,n,s,l){const o=r("router-link"),a=d("ripple");return l.visible()?(c(),u("li",{key:0,id:i.id,class:p(l.containerClass()),role:"menuitem",style:h(i.item.style),"aria-label":l.label(),"aria-disabled":l.disabled()},[m("div",{class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>l.onItemClick(e))},[i.template?(c(),f(g(i.template),{key:1,item:i.item},null,8,["item"])):(c(),u(b,{key:0},[i.item.to&&!l.disabled()?(c(),f(o,{key:0,to:i.item.to,custom:""},{default:v((({navigate:e,href:t,isActive:n,isExactActive:s})=>[y((c(),u("a",{href:t,class:p(l.linkClass({isActive:n,isExactActive:s})),tabindex:"-1","aria-hidden":"true",onClick:t=>l.onItemActionClick(t,e)},[i.item.icon?(c(),u("span",{key:0,class:p(["p-menuitem-icon",i.item.icon])},null,2)):k("",!0),m("span",z,x(l.label()),1)],10,K)),[[a]])])),_:1},8,["to"])):y((c(),u("a",{key:1,href:i.item.url,class:p(l.linkClass()),target:i.item.target,tabindex:"-1","aria-hidden":"true"},[i.item.icon?(c(),u("span",{key:0,class:p(["p-menuitem-icon",i.item.icon])},null,2)):k("",!0),m("span",D,x(l.label()),1)],10,$)),[[a]])],64))])],14,S)):k("",!0)};var V={name:"Menu",inheritAttrs:!1,emits:["show","hide","focus","blur"],props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data(){return{id:this.$attrs.id,overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n()}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.id=this.id||n(),this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&s.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(l.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)l.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(l.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=l.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),i=t&&l.findSingle(t,".p-menuitem-link");this.popup&&l.focus(this.target),i?i.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...l.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...l.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=l.find(this.container,"li.p-menuitem:not(.p-disabled)");let i=e>=t.length?t.length-1:e<0?0:e;i>-1&&(this.focusedOptionIndex=t[i].getAttribute("id"))},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&s.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(l.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&s.clear(e)},alignOverlay(){l.absolutePosition(this.container,this.target),this.container.style.minWidth=l.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new o(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!l.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(t){e.emit("overlay-click",{originalEvent:t,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:A,Portal:t}};const F=["id"],H=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],R=["id"];!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),V.render=function(e,t,i,n,s,l){const o=r("PVMenuitem"),a=r("Portal");return c(),f(a,{appendTo:i.appendTo,disabled:!i.popup},{default:v((()=>[I(L,{name:"p-connected-overlay",onEnter:l.onEnter,onLeave:l.onLeave,onAfterLeave:l.onAfterLeave},{default:v((()=>[!i.popup||s.overlayVisible?(c(),u("div",O({key:0,ref:l.containerRef,id:s.id,class:l.containerClass},e.$attrs,{onClick:t[3]||(t[3]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e))}),[m("ul",{ref:l.listRef,id:s.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":s.focused?l.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>l.onListFocus&&l.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onListBlur&&l.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onListKeyDown&&l.onListKeyDown(...e))},[(c(!0),u(b,null,C(i.model,((t,n)=>(c(),u(b,{key:l.label(t)+n.toString()},[t.items&&l.visible(t)&&!t.separator?(c(),u(b,{key:0},[t.items?(c(),u("li",{key:0,id:s.id+"_"+n,class:"p-submenu-header",role:"none"},[w(e.$slots,"item",{item:t},(()=>[E(x(l.label(t)),1)]))],8,R)):k("",!0),(c(!0),u(b,null,C(t.items,((a,r)=>(c(),u(b,{key:a.label+n+"_"+r},[l.visible(a)&&!a.separator?(c(),f(o,{key:0,id:s.id+"_"+n+"_"+r,item:a,template:e.$slots.item,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):l.visible(a)&&a.separator?(c(),u("li",{key:"separator"+n+r,class:p(l.separatorClass(t)),style:h(a.style),role:"separator"},null,6)):k("",!0)],64)))),128))],64)):l.visible(t)&&t.separator?(c(),u("li",{key:"separator"+n.toString(),class:p(l.separatorClass(t)),style:h(t.style),role:"separator"},null,6)):(c(),f(o,{key:l.label(t)+n.toString(),id:s.id+"_"+n,item:t,template:e.$slots.item,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,H)],16,F)):k("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])};export{V as default};
|
|
1
|
+
import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ObjectUtils as i,UniqueComponentId as n,ZIndexUtils as s,DomHandler as l,ConnectedOverlayScrollHandler as o}from"primevue/utils";import a from"primevue/ripple";import{resolveComponent as r,resolveDirective as d,openBlock as c,createElementBlock as u,normalizeClass as p,normalizeStyle as h,createElementVNode as m,Fragment as b,createBlock as f,withCtx as v,withDirectives as y,createCommentVNode as k,toDisplayString as x,resolveDynamicComponent as g,createVNode as I,Transition as L,mergeProps as O,renderSlot as C,renderList as w,createTextVNode as E}from"vue";var A={name:"Menuitem",inheritAttrs:!1,emits:["item-click"],props:{item:null,template:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?i.getItemValue(e.item[t]):void 0,onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},directives:{ripple:a}};const S=["id","aria-label","aria-disabled"],$=["href","onClick"],K={class:"p-menuitem-text"},z=["href","target"],D={class:"p-menuitem-text"};A.render=function(e,t,i,n,s,l){const o=r("router-link"),a=d("ripple");return l.visible()?(c(),u("li",{key:0,id:i.id,class:p(l.containerClass()),role:"menuitem",style:h(i.item.style),"aria-label":l.label(),"aria-disabled":l.disabled()},[m("div",{class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>l.onItemClick(e))},[i.template?(c(),f(g(i.template),{key:1,item:i.item},null,8,["item"])):(c(),u(b,{key:0},[i.item.to&&!l.disabled()?(c(),f(o,{key:0,to:i.item.to,custom:""},{default:v((({navigate:e,href:t,isActive:n,isExactActive:s})=>[y((c(),u("a",{href:t,class:p(l.linkClass({isActive:n,isExactActive:s})),tabindex:"-1","aria-hidden":"true",onClick:t=>l.onItemActionClick(t,e)},[i.item.icon?(c(),u("span",{key:0,class:p(["p-menuitem-icon",i.item.icon])},null,2)):k("",!0),m("span",K,x(l.label()),1)],10,$)),[[a]])])),_:1},8,["to"])):y((c(),u("a",{key:1,href:i.item.url,class:p(l.linkClass()),target:i.item.target,tabindex:"-1","aria-hidden":"true"},[i.item.icon?(c(),u("span",{key:0,class:p(["p-menuitem-icon",i.item.icon])},null,2)):k("",!0),m("span",D,x(l.label()),1)],10,z)),[[a]])],64))])],14,S)):k("",!0)};var V={name:"Menu",inheritAttrs:!1,emits:["show","hide","focus","blur"],props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data(){return{id:this.$attrs.id,overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n()}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.id=this.id||n(),this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&s.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(l.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)l.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(l.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=l.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),i=t&&l.findSingle(t,".p-menuitem-link");this.popup&&l.focus(this.target),i?i.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...l.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...l.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=l.find(this.container,"li.p-menuitem:not(.p-disabled)");let i=e>=t.length?t.length-1:e<0?0:e;i>-1&&(this.focusedOptionIndex=t[i].getAttribute("id"))},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&s.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(l.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&s.clear(e)},alignOverlay(){l.absolutePosition(this.container,this.target),this.container.style.minWidth=l.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new o(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!l.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(t){e.emit("overlay-click",{originalEvent:t,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:A,Portal:t}};const F=["id"],H={key:0,class:"p-menu-start"},R=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],T=["id"],B={key:1,class:"p-menu-end"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),V.render=function(e,t,i,n,s,l){const o=r("PVMenuitem"),a=r("Portal");return c(),f(a,{appendTo:i.appendTo,disabled:!i.popup},{default:v((()=>[I(L,{name:"p-connected-overlay",onEnter:l.onEnter,onLeave:l.onLeave,onAfterLeave:l.onAfterLeave},{default:v((()=>[!i.popup||s.overlayVisible?(c(),u("div",O({key:0,ref:l.containerRef,id:s.id,class:l.containerClass},e.$attrs,{onClick:t[3]||(t[3]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e))}),[e.$slots.start?(c(),u("div",H,[C(e.$slots,"start")])):k("",!0),m("ul",{ref:l.listRef,id:s.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":s.focused?l.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>l.onListFocus&&l.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onListBlur&&l.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onListKeyDown&&l.onListKeyDown(...e))},[(c(!0),u(b,null,w(i.model,((t,n)=>(c(),u(b,{key:l.label(t)+n.toString()},[t.items&&l.visible(t)&&!t.separator?(c(),u(b,{key:0},[t.items?(c(),u("li",{key:0,id:s.id+"_"+n,class:"p-submenu-header",role:"none"},[C(e.$slots,"item",{item:t},(()=>[E(x(l.label(t)),1)]))],8,T)):k("",!0),(c(!0),u(b,null,w(t.items,((a,r)=>(c(),u(b,{key:a.label+n+"_"+r},[l.visible(a)&&!a.separator?(c(),f(o,{key:0,id:s.id+"_"+n+"_"+r,item:a,template:e.$slots.item,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):l.visible(a)&&a.separator?(c(),u("li",{key:"separator"+n+r,class:p(l.separatorClass(t)),style:h(a.style),role:"separator"},null,6)):k("",!0)],64)))),128))],64)):l.visible(t)&&t.separator?(c(),u("li",{key:"separator"+n.toString(),class:p(l.separatorClass(t)),style:h(t.style),role:"separator"},null,6)):(c(),f(o,{key:l.label(t)+n.toString(),id:s.id+"_"+n,item:t,template:e.$slots.item,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,R),e.$slots.end?(c(),u("div",B,[C(e.$slots,"end")])):k("",!0)],16,F)):k("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])};export{V as default};
|
package/menu/menu.js
CHANGED
|
@@ -62,8 +62,8 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
62
62
|
const _hoisted_1$1 = ["id", "aria-label", "aria-disabled"];
|
|
63
63
|
const _hoisted_2$1 = ["href", "onClick"];
|
|
64
64
|
const _hoisted_3$1 = { class: "p-menuitem-text" };
|
|
65
|
-
const _hoisted_4 = ["href", "target"];
|
|
66
|
-
const _hoisted_5 = { class: "p-menuitem-text" };
|
|
65
|
+
const _hoisted_4$1 = ["href", "target"];
|
|
66
|
+
const _hoisted_5$1 = { class: "p-menuitem-text" };
|
|
67
67
|
|
|
68
68
|
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
69
69
|
const _component_router_link = vue.resolveComponent("router-link");
|
|
@@ -126,8 +126,8 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
126
126
|
class: vue.normalizeClass(['p-menuitem-icon', $props.item.icon])
|
|
127
127
|
}, null, 2))
|
|
128
128
|
: vue.createCommentVNode("", true),
|
|
129
|
-
vue.createElementVNode("span", _hoisted_5, vue.toDisplayString($options.label()), 1)
|
|
130
|
-
], 10, _hoisted_4)), [
|
|
129
|
+
vue.createElementVNode("span", _hoisted_5$1, vue.toDisplayString($options.label()), 1)
|
|
130
|
+
], 10, _hoisted_4$1)), [
|
|
131
131
|
[_directive_ripple]
|
|
132
132
|
])
|
|
133
133
|
], 64))
|
|
@@ -507,8 +507,16 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
507
507
|
};
|
|
508
508
|
|
|
509
509
|
const _hoisted_1 = ["id"];
|
|
510
|
-
const _hoisted_2 =
|
|
511
|
-
|
|
510
|
+
const _hoisted_2 = {
|
|
511
|
+
key: 0,
|
|
512
|
+
class: "p-menu-start"
|
|
513
|
+
};
|
|
514
|
+
const _hoisted_3 = ["id", "tabindex", "aria-activedescendant", "aria-label", "aria-labelledby"];
|
|
515
|
+
const _hoisted_4 = ["id"];
|
|
516
|
+
const _hoisted_5 = {
|
|
517
|
+
key: 1,
|
|
518
|
+
class: "p-menu-end"
|
|
519
|
+
};
|
|
512
520
|
|
|
513
521
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
514
522
|
const _component_PVMenuitem = vue.resolveComponent("PVMenuitem");
|
|
@@ -535,6 +543,11 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
535
543
|
}, _ctx.$attrs, {
|
|
536
544
|
onClick: _cache[3] || (_cache[3] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
|
|
537
545
|
}), [
|
|
546
|
+
(_ctx.$slots.start)
|
|
547
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
548
|
+
vue.renderSlot(_ctx.$slots, "start")
|
|
549
|
+
]))
|
|
550
|
+
: vue.createCommentVNode("", true),
|
|
538
551
|
vue.createElementVNode("ul", {
|
|
539
552
|
ref: $options.listRef,
|
|
540
553
|
id: $data.id + '_list',
|
|
@@ -564,7 +577,7 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
564
577
|
vue.renderSlot(_ctx.$slots, "item", { item: item }, () => [
|
|
565
578
|
vue.createTextVNode(vue.toDisplayString($options.label(item)), 1)
|
|
566
579
|
])
|
|
567
|
-
], 8,
|
|
580
|
+
], 8, _hoisted_4))
|
|
568
581
|
: vue.createCommentVNode("", true),
|
|
569
582
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.items, (child, j) => {
|
|
570
583
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
@@ -609,7 +622,12 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
609
622
|
}, null, 8, ["id", "item", "template", "exact", "focusedOptionId", "onItemClick"]))
|
|
610
623
|
], 64))
|
|
611
624
|
}), 128))
|
|
612
|
-
], 40,
|
|
625
|
+
], 40, _hoisted_3),
|
|
626
|
+
(_ctx.$slots.end)
|
|
627
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
|
|
628
|
+
vue.renderSlot(_ctx.$slots, "end")
|
|
629
|
+
]))
|
|
630
|
+
: vue.createCommentVNode("", true)
|
|
613
631
|
], 16, _hoisted_1))
|
|
614
632
|
: vue.createCommentVNode("", true)
|
|
615
633
|
]),
|
package/menu/menu.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.menu=function(e,t,i,n,s){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),a=l(t),r={name:"Menuitem",inheritAttrs:!1,emits:["item-click"],props:{item:null,template:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0,onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},directives:{ripple:l(n).default}};const d=["id","aria-label","aria-disabled"],c=["href","onClick"],u={class:"p-menuitem-text"},p=["href","target"],m={class:"p-menuitem-text"};r.render=function(e,t,i,n,l,o){const a=s.resolveComponent("router-link"),r=s.resolveDirective("ripple");return o.visible()?(s.openBlock(),s.createElementBlock("li",{key:0,id:i.id,class:s.normalizeClass(o.containerClass()),role:"menuitem",style:s.normalizeStyle(i.item.style),"aria-label":o.label(),"aria-disabled":o.disabled()},[s.createElementVNode("div",{class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>o.onItemClick(e))},[i.template?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.template),{key:1,item:i.item},null,8,["item"])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[i.item.to&&!o.disabled()?(s.openBlock(),s.createBlock(a,{key:0,to:i.item.to,custom:""},{default:s.withCtx((({navigate:e,href:t,isActive:n,isExactActive:l})=>[s.withDirectives((s.openBlock(),s.createElementBlock("a",{href:t,class:s.normalizeClass(o.linkClass({isActive:n,isExactActive:l})),tabindex:"-1","aria-hidden":"true",onClick:t=>o.onItemActionClick(t,e)},[i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",u,s.toDisplayString(o.label()),1)],10,c)),[[r]])])),_:1},8,["to"])):s.withDirectives((s.openBlock(),s.createElementBlock("a",{key:1,href:i.item.url,class:s.normalizeClass(o.linkClass()),target:i.item.target,tabindex:"-1","aria-hidden":"true"},[i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",m,s.toDisplayString(o.label()),1)],10,p)),[[r]])],64))])],14,d)):s.createCommentVNode("",!0)};var h={name:"Menu",inheritAttrs:!1,emits:["show","hide","focus","blur"],props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data(){return{id:this.$attrs.id,overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||i.UniqueComponentId()}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.id=this.id||i.UniqueComponentId(),this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&i.ZIndexUtils.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(i.DomHandler.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)i.DomHandler.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=i.DomHandler.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),n=t&&i.DomHandler.findSingle(t,".p-menuitem-link");this.popup&&i.DomHandler.focus(this.target),n?n.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)");let n=e>=t.length?t.length-1:e<0?0:e;n>-1&&(this.focusedOptionIndex=t[n].getAttribute("id"))},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&i.ZIndexUtils.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(i.DomHandler.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&i.ZIndexUtils.clear(e)},alignOverlay(){i.DomHandler.absolutePosition(this.container,this.target),this.container.style.minWidth=i.DomHandler.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!i.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(e){o.default.emit("overlay-click",{originalEvent:e,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:r,Portal:a.default}};const b=["id"],f=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],k=["id"];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),h.render=function(e,t,i,n,l,o){const a=s.resolveComponent("PVMenuitem"),r=s.resolveComponent("Portal");return s.openBlock(),s.createBlock(r,{appendTo:i.appendTo,disabled:!i.popup},{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-connected-overlay",onEnter:o.onEnter,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave},{default:s.withCtx((()=>[!i.popup||l.overlayVisible?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:o.containerRef,id:l.id,class:o.containerClass},e.$attrs,{onClick:t[3]||(t[3]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e))}),[s.createElementVNode("ul",{ref:o.listRef,id:l.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":l.focused?o.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>o.onListFocus&&o.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onListBlur&&o.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onListKeyDown&&o.onListKeyDown(...e))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.model,((t,n)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:o.label(t)+n.toString()},[t.items&&o.visible(t)&&!t.separator?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[t.items?(s.openBlock(),s.createElementBlock("li",{key:0,id:l.id+"_"+n,class:"p-submenu-header",role:"none"},[s.renderSlot(e.$slots,"item",{item:t},(()=>[s.createTextVNode(s.toDisplayString(o.label(t)),1)]))],8,k)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,((r,d)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:r.label+n+"_"+d},[o.visible(r)&&!r.separator?(s.openBlock(),s.createBlock(a,{key:0,id:l.id+"_"+n+"_"+d,item:r,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):o.visible(r)&&r.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n+d,class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(r.style),role:"separator"},null,6)):s.createCommentVNode("",!0)],64)))),128))],64)):o.visible(t)&&t.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n.toString(),class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(t.style),role:"separator"},null,6)):(s.openBlock(),s.createBlock(a,{key:o.label(t)+n.toString(),id:l.id+"_"+n,item:t,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,f)],16,b)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])},h}(primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.ripple,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.menu=function(e,t,i,n,s){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),a=l(t),r={name:"Menuitem",inheritAttrs:!1,emits:["item-click"],props:{item:null,template:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0,onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},directives:{ripple:l(n).default}};const d=["id","aria-label","aria-disabled"],c=["href","onClick"],u={class:"p-menuitem-text"},p=["href","target"],m={class:"p-menuitem-text"};r.render=function(e,t,i,n,l,o){const a=s.resolveComponent("router-link"),r=s.resolveDirective("ripple");return o.visible()?(s.openBlock(),s.createElementBlock("li",{key:0,id:i.id,class:s.normalizeClass(o.containerClass()),role:"menuitem",style:s.normalizeStyle(i.item.style),"aria-label":o.label(),"aria-disabled":o.disabled()},[s.createElementVNode("div",{class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>o.onItemClick(e))},[i.template?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.template),{key:1,item:i.item},null,8,["item"])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[i.item.to&&!o.disabled()?(s.openBlock(),s.createBlock(a,{key:0,to:i.item.to,custom:""},{default:s.withCtx((({navigate:e,href:t,isActive:n,isExactActive:l})=>[s.withDirectives((s.openBlock(),s.createElementBlock("a",{href:t,class:s.normalizeClass(o.linkClass({isActive:n,isExactActive:l})),tabindex:"-1","aria-hidden":"true",onClick:t=>o.onItemActionClick(t,e)},[i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",u,s.toDisplayString(o.label()),1)],10,c)),[[r]])])),_:1},8,["to"])):s.withDirectives((s.openBlock(),s.createElementBlock("a",{key:1,href:i.item.url,class:s.normalizeClass(o.linkClass()),target:i.item.target,tabindex:"-1","aria-hidden":"true"},[i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",m,s.toDisplayString(o.label()),1)],10,p)),[[r]])],64))])],14,d)):s.createCommentVNode("",!0)};var h={name:"Menu",inheritAttrs:!1,emits:["show","hide","focus","blur"],props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data(){return{id:this.$attrs.id,overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||i.UniqueComponentId()}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.id=this.id||i.UniqueComponentId(),this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&i.ZIndexUtils.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(i.DomHandler.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)i.DomHandler.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=i.DomHandler.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),n=t&&i.DomHandler.findSingle(t,".p-menuitem-link");this.popup&&i.DomHandler.focus(this.target),n?n.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)");let n=e>=t.length?t.length-1:e<0?0:e;n>-1&&(this.focusedOptionIndex=t[n].getAttribute("id"))},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&i.ZIndexUtils.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(i.DomHandler.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&i.ZIndexUtils.clear(e)},alignOverlay(){i.DomHandler.absolutePosition(this.container,this.target),this.container.style.minWidth=i.DomHandler.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!i.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(e){o.default.emit("overlay-click",{originalEvent:e,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:r,Portal:a.default}};const b=["id"],f={key:0,class:"p-menu-start"},k=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],v=["id"],y={key:1,class:"p-menu-end"};return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),h.render=function(e,t,i,n,l,o){const a=s.resolveComponent("PVMenuitem"),r=s.resolveComponent("Portal");return s.openBlock(),s.createBlock(r,{appendTo:i.appendTo,disabled:!i.popup},{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-connected-overlay",onEnter:o.onEnter,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave},{default:s.withCtx((()=>[!i.popup||l.overlayVisible?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:o.containerRef,id:l.id,class:o.containerClass},e.$attrs,{onClick:t[3]||(t[3]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e))}),[e.$slots.start?(s.openBlock(),s.createElementBlock("div",f,[s.renderSlot(e.$slots,"start")])):s.createCommentVNode("",!0),s.createElementVNode("ul",{ref:o.listRef,id:l.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":l.focused?o.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>o.onListFocus&&o.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onListBlur&&o.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onListKeyDown&&o.onListKeyDown(...e))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.model,((t,n)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:o.label(t)+n.toString()},[t.items&&o.visible(t)&&!t.separator?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[t.items?(s.openBlock(),s.createElementBlock("li",{key:0,id:l.id+"_"+n,class:"p-submenu-header",role:"none"},[s.renderSlot(e.$slots,"item",{item:t},(()=>[s.createTextVNode(s.toDisplayString(o.label(t)),1)]))],8,v)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,((r,d)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:r.label+n+"_"+d},[o.visible(r)&&!r.separator?(s.openBlock(),s.createBlock(a,{key:0,id:l.id+"_"+n+"_"+d,item:r,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):o.visible(r)&&r.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n+d,class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(r.style),role:"separator"},null,6)):s.createCommentVNode("",!0)],64)))),128))],64)):o.visible(t)&&t.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n.toString(),class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(t.style),role:"separator"},null,6)):(s.openBlock(),s.createBlock(a,{key:o.label(t)+n.toString(),id:l.id+"_"+n,item:t,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,k),e.$slots.end?(s.openBlock(),s.createElementBlock("div",y,[s.renderSlot(e.$slots,"end")])):s.createCommentVNode("",!0)],16,b)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])},h}(primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.ripple,Vue);
|
package/menubar/Menubar.d.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Menubar is a horizontal menu component.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primevue.org/menubar/)
|
|
6
|
+
*
|
|
7
|
+
* @module menubar
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import { ButtonHTMLAttributes, VNode } from 'vue';
|
|
2
11
|
import { MenuItem } from '../menuitem';
|
|
3
12
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
4
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Defines valid properties in Menubar component.
|
|
16
|
+
*/
|
|
5
17
|
export interface MenubarProps {
|
|
6
18
|
/**
|
|
7
19
|
* An array of menuitems.
|
|
@@ -9,7 +21,7 @@ export interface MenubarProps {
|
|
|
9
21
|
model?: MenuItem[] | undefined;
|
|
10
22
|
/**
|
|
11
23
|
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
|
|
12
|
-
*
|
|
24
|
+
* @defaultValue true
|
|
13
25
|
*/
|
|
14
26
|
exact?: boolean | undefined;
|
|
15
27
|
/**
|
|
@@ -26,29 +38,47 @@ export interface MenubarProps {
|
|
|
26
38
|
'aria-labelledby'?: string | undefined;
|
|
27
39
|
}
|
|
28
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Defines valid slots in Menubar component.
|
|
43
|
+
*/
|
|
29
44
|
export interface MenubarSlots {
|
|
30
45
|
/**
|
|
31
46
|
* Custom start template.
|
|
32
47
|
*/
|
|
33
|
-
start
|
|
48
|
+
start(): VNode[];
|
|
34
49
|
/**
|
|
35
50
|
* Custom end template.
|
|
36
51
|
*/
|
|
37
|
-
end
|
|
52
|
+
end(): VNode[];
|
|
38
53
|
/**
|
|
39
54
|
* Custom item template.
|
|
40
55
|
* @param {Object} scope - item slot's params.
|
|
41
56
|
*/
|
|
42
|
-
item
|
|
57
|
+
item(scope: {
|
|
43
58
|
/**
|
|
44
59
|
* Menuitem instance
|
|
45
60
|
*/
|
|
46
61
|
item: MenuItem;
|
|
47
|
-
})
|
|
62
|
+
}): VNode[];
|
|
48
63
|
}
|
|
49
64
|
|
|
50
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Defines valid emits in Menubar component.
|
|
67
|
+
*/
|
|
68
|
+
export interface MenubarEmits {}
|
|
51
69
|
|
|
70
|
+
/**
|
|
71
|
+
* **PrimeVue - Menubar**
|
|
72
|
+
*
|
|
73
|
+
* _Menubar is a horizontal menu component._
|
|
74
|
+
*
|
|
75
|
+
* [Live Demo](https://www.primevue.org/menubar/)
|
|
76
|
+
* --- ---
|
|
77
|
+
* 
|
|
78
|
+
*
|
|
79
|
+
* @group Component
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
52
82
|
declare class Menubar extends ClassComponent<MenubarProps, MenubarSlots, MenubarEmits> {}
|
|
53
83
|
|
|
54
84
|
declare module '@vue/runtime-core' {
|
|
@@ -57,17 +87,4 @@ declare module '@vue/runtime-core' {
|
|
|
57
87
|
}
|
|
58
88
|
}
|
|
59
89
|
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
* Menubar is a horizontal menu component.
|
|
63
|
-
*
|
|
64
|
-
* Helper API:
|
|
65
|
-
*
|
|
66
|
-
* - [MenuItem](https://www.primefaces.org/primevue/menumodel)
|
|
67
|
-
*
|
|
68
|
-
* Demos:
|
|
69
|
-
*
|
|
70
|
-
* - [Menubar](https://www.primefaces.org/primevue/menubar)
|
|
71
|
-
*
|
|
72
|
-
*/
|
|
73
90
|
export default Menubar;
|
package/menuitem/MenuItem.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* PrimeVue menu components share a common api to specify the menuitems and submenus.
|
|
4
|
+
*
|
|
5
|
+
* @module menuitem
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
1
8
|
import { RouteLocationRaw } from 'vue-router';
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type MenuItemVisibleType = boolean | ((...args: any) => boolean) | undefined;
|
|
8
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Custom command event.
|
|
12
|
+
* @see {@link MenuItem.command}
|
|
13
|
+
*/
|
|
9
14
|
export interface MenuItemCommandEvent {
|
|
10
15
|
/**
|
|
11
16
|
* Browser event.
|
|
@@ -21,11 +26,14 @@ export interface MenuItemCommandEvent {
|
|
|
21
26
|
[key: string]: any;
|
|
22
27
|
}
|
|
23
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Defines model of MenuItem API.
|
|
31
|
+
*/
|
|
24
32
|
export interface MenuItem {
|
|
25
33
|
/**
|
|
26
34
|
* Property name or getter function to use as the label of an item.
|
|
27
35
|
*/
|
|
28
|
-
label?:
|
|
36
|
+
label?: string | ((...args: any) => string) | undefined;
|
|
29
37
|
/**
|
|
30
38
|
* Icon of the item.
|
|
31
39
|
*/
|
|
@@ -36,7 +44,8 @@ export interface MenuItem {
|
|
|
36
44
|
to?: RouteLocationRaw | undefined;
|
|
37
45
|
/**
|
|
38
46
|
* Callback to execute when item is clicked.
|
|
39
|
-
* @param {
|
|
47
|
+
* @param {MenuItemCommandEvent} event - Custom command event.
|
|
48
|
+
* @todo next release should be able to change
|
|
40
49
|
*/
|
|
41
50
|
command?: (event: MenuItemCommandEvent) => void;
|
|
42
51
|
/**
|
|
@@ -49,18 +58,21 @@ export interface MenuItem {
|
|
|
49
58
|
items?: MenuItem[] | undefined;
|
|
50
59
|
/**
|
|
51
60
|
* A boolean or a function to return a boolean to specify if the item is disabled.
|
|
61
|
+
* @defaultValue false
|
|
52
62
|
*/
|
|
53
|
-
disabled?:
|
|
63
|
+
disabled?: boolean | ((...args: any) => boolean) | undefined;
|
|
54
64
|
/**
|
|
55
65
|
* A boolean or a function to return a boolean to specify if the item is visible.
|
|
66
|
+
* @defaultValue true
|
|
56
67
|
*/
|
|
57
|
-
visible?:
|
|
68
|
+
visible?: boolean | ((...args: any) => boolean) | undefined;
|
|
58
69
|
/**
|
|
59
70
|
* Specifies where to open the linked document.
|
|
60
71
|
*/
|
|
61
72
|
target?: string | undefined;
|
|
62
73
|
/**
|
|
63
74
|
* Defines the item as a separator.
|
|
75
|
+
* @defaultValue false
|
|
64
76
|
*/
|
|
65
77
|
separator?: boolean | undefined;
|
|
66
78
|
/**
|
package/message/Message.d.ts
CHANGED
|
@@ -1,27 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Message groups a collection of contents in tabs.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primevue.org/message/)
|
|
6
|
+
*
|
|
7
|
+
* @module message
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import { ButtonHTMLAttributes, VNode } from 'vue';
|
|
2
11
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
3
12
|
|
|
4
|
-
|
|
5
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Defines valid properties in Message component.
|
|
15
|
+
*/
|
|
6
16
|
export interface MessageProps {
|
|
7
17
|
/**
|
|
8
18
|
* Severity level of the message.
|
|
9
|
-
* @
|
|
10
|
-
* Default value is 'info'.
|
|
19
|
+
* @defaultValue info
|
|
11
20
|
*/
|
|
12
|
-
severity?:
|
|
21
|
+
severity?: 'success' | 'info' | 'warn' | 'error' | undefined;
|
|
13
22
|
/**
|
|
14
23
|
* Whether the message can be closed manually using the close icon.
|
|
15
|
-
*
|
|
24
|
+
* @defaultValue true
|
|
16
25
|
*/
|
|
17
26
|
closable?: boolean | undefined;
|
|
18
27
|
/**
|
|
19
28
|
* When enabled, message is not removed automatically.
|
|
29
|
+
* @defaultValue true
|
|
20
30
|
*/
|
|
21
31
|
sticky?: boolean | undefined;
|
|
22
32
|
/**
|
|
23
33
|
* Delay in milliseconds to close the message automatically.
|
|
24
|
-
*
|
|
34
|
+
* @defaultValue 3000
|
|
25
35
|
*/
|
|
26
36
|
life?: number | undefined;
|
|
27
37
|
/**
|
|
@@ -30,7 +40,7 @@ export interface MessageProps {
|
|
|
30
40
|
icon?: string | undefined;
|
|
31
41
|
/**
|
|
32
42
|
* Icon to display in the message close button.
|
|
33
|
-
*
|
|
43
|
+
* @defaultValue pi pi-times
|
|
34
44
|
*/
|
|
35
45
|
closeIcon?: string | undefined;
|
|
36
46
|
/**
|
|
@@ -39,21 +49,39 @@ export interface MessageProps {
|
|
|
39
49
|
closeButtonProps?: ButtonHTMLAttributes | undefined;
|
|
40
50
|
}
|
|
41
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Defines valid slots in Message slots.
|
|
54
|
+
*/
|
|
42
55
|
export interface MessageSlots {
|
|
43
56
|
/**
|
|
44
57
|
* Default custom slot.
|
|
45
58
|
*/
|
|
46
|
-
default
|
|
59
|
+
default(): VNode[];
|
|
47
60
|
}
|
|
48
61
|
|
|
49
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Defines valid emits in Message component.
|
|
64
|
+
*/
|
|
65
|
+
export interface MessageEmits {
|
|
50
66
|
/**
|
|
51
67
|
* Callback to invoke when a message is closed.
|
|
52
68
|
* @param {Event} event - Browser event.
|
|
53
69
|
*/
|
|
54
|
-
close
|
|
55
|
-
}
|
|
70
|
+
close(event: Event): void;
|
|
71
|
+
}
|
|
56
72
|
|
|
73
|
+
/**
|
|
74
|
+
* **PrimeVue - Message**
|
|
75
|
+
*
|
|
76
|
+
* _Messages is used to display inline messages with various severities._
|
|
77
|
+
*
|
|
78
|
+
* [Live Demo](https://www.primevue.org/message/)
|
|
79
|
+
* --- ---
|
|
80
|
+
* 
|
|
81
|
+
*
|
|
82
|
+
* @group Component
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
57
85
|
declare class Message extends ClassComponent<MessageProps, MessageSlots, MessageEmits> {}
|
|
58
86
|
|
|
59
87
|
declare module '@vue/runtime-core' {
|
|
@@ -62,13 +90,4 @@ declare module '@vue/runtime-core' {
|
|
|
62
90
|
}
|
|
63
91
|
}
|
|
64
92
|
|
|
65
|
-
/**
|
|
66
|
-
*
|
|
67
|
-
* Messages is used to display inline messages with various severities.
|
|
68
|
-
*
|
|
69
|
-
* Demos:
|
|
70
|
-
*
|
|
71
|
-
* - [Message](https://www.primefaces.org/primevue/message)
|
|
72
|
-
*
|
|
73
|
-
*/
|
|
74
93
|
export default Message;
|