1 line
62 KiB
Plaintext
1 line
62 KiB
Plaintext
|
|
{"version":3,"file":"index.mjs","sources":["../../src/menu/BaseMenu.vue","../../src/menu/Menuitem.vue","../../src/menu/Menuitem.vue?vue&type=template&id=d15e76a4&lang.js","../../src/menu/Menu.vue","../../src/menu/Menu.vue?vue&type=template&id=3805573f&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport MenuStyle from 'primevue/menu/style';\n\nexport default {\n name: 'BaseMenu',\n extends: BaseComponent,\n props: {\n popup: {\n type: Boolean,\n default: false\n },\n model: {\n type: Array,\n default: null\n },\n appendTo: {\n type: [String, Object],\n default: 'body'\n },\n autoZIndex: {\n type: Boolean,\n default: true\n },\n baseZIndex: {\n type: Number,\n default: 0\n },\n tabindex: {\n type: Number,\n default: 0\n },\n ariaLabel: {\n type: String,\n default: null\n },\n ariaLabelledby: {\n type: String,\n default: null\n }\n },\n style: MenuStyle,\n provide() {\n return {\n $pcMenu: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <li\n v-if=\"visible()\"\n :id=\"id\"\n :class=\"[cx('item'), item.class]\"\n role=\"menuitem\"\n :style=\"item.style\"\n :aria-label=\"label()\"\n :aria-disabled=\"disabled()\"\n :data-p-focused=\"isItemFocused()\"\n :data-p-disabled=\"disabled() || false\"\n :data-p=\"dataP\"\n v-bind=\"getPTOptions('item')\"\n >\n <div :class=\"cx('itemContent')\" @click=\"onItemClick($event)\" @mousemove=\"onItemMouseMove($event)\" :data-p=\"dataP\" v-bind=\"getPTOptions('itemContent')\">\n <template v-if=\"!templates.item\">\n <a v-ripple :href=\"item.url\" :class=\"cx('itemLink')\" :target=\"item.target\" tabindex=\"-1\" v-bind=\"getPTOptions('itemLink')\">\n <component v-if=\"templates.itemicon\" :is=\"templates.itemicon\" :item=\"item\" :class=\"cx('itemIcon')\" />\n <span v-else-if=\"item.icon\" :class=\"[cx('itemIcon'), item.icon]\" :data-p=\"dataP\" v-bind=\"getPTOptions('itemIcon')\" />\n <span :class=\"cx('itemLabel')\" :data-p=\"dataP\" v-bind=\"getPTOptions('itemLabel')\">{{ label() }}</span>\n </a>\n </template>\n <component v-else-if=\"templates.item\" :is=\"templates.item\" :item=\"item\" :label=\"label()\" :props=\"getMenuItemProps(item)\"></component>\n </div>\n </li>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport { resolve } from '@primeuix/utils/object';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport Ripple from 'primevue/ripple';\nimport { mergeProps } from 'vue';\n\nexport default {\n name: 'Menuitem',\n hostName: 'Menu',\n extends: BaseComponent,\n inheritAttrs: false,\n emits: ['item-click', 'item-mousemove'],\n props: {\n item: null,\n templates: null,\n id: null,\n focusedOptionId: null,\n index: null\n },\n methods: {\n getItemProp(processedItem, name) {\n return processedItem && processedItem.item ? resolve(processedItem.item[name]) : undefined;\n },\n getPTOptions(key) {\n return this.ptm(key, {\n context: {\n item: this.item,\n index: this.index,\n focused: this.isItemFocused(),\n disabled: this.disabled()\n }\n });\n },\n isItemFocused() {\n return this.focusedOptionId === this.id;\n },\n onItemClick(event) {\n const command = this.getItemProp(this.item, 'command');\n\n command && command({ originalEvent: event, item: this.item
|