Fixed #1029 - Menubar, ContextMenu, TieredMenu warning

pull/1047/head
Cagatay Civici 2021-02-27 13:20:49 +03:00
parent 4bcdf2720f
commit cc5cb1a8b1
11 changed files with 17 additions and 17 deletions

View File

@ -58,7 +58,7 @@
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"rollup-plugin-vue": "^6.0.0-beta.9", "rollup-plugin-vue": "^6.0.0-beta.9",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"vue": "3.0.3", "vue": "3.0.6",
"vue-router": "^4.0.0-0", "vue-router": "^4.0.0-0",
"webpack-cli": "^4.3.0" "webpack-cli": "^4.3.0"
} }

View File

@ -93,7 +93,7 @@ export default {
return ['p-accordion-header', {'p-highlight': this.isTabActive(i), 'p-disabled': this.isTabDisabled(tab)}]; return ['p-accordion-header', {'p-highlight': this.isTabActive(i), 'p-disabled': this.isTabDisabled(tab)}];
}, },
getTabAriaId(i) { getTabAriaId(i) {
return this.ariaId + + '_' + i; return this.ariaId + '_' + i;
}, },
getHeaderIcon(i) { getHeaderIcon(i) {
const active = this.isTabActive(i); const active = this.isTabActive(i);

View File

@ -41,7 +41,7 @@
</button> </button>
</div> </div>
<ul :class="indicatorsContentClasses"> <ul :class="indicatorsContentClasses">
<li v-for="(indicator, i) of totalIndicators" :key="'p-carousel-indicator-' + i" :class="['p-carousel-indicator', {'p-highlight': d_page === i}]"> <li v-for="(indicator, i) of totalIndicators" :key="'p-carousel-indicator-' + i.toString()" :class="['p-carousel-indicator', {'p-highlight': d_page === i}]">
<button class="p-link" @click="onIndicatorClick($event, i)" type="button" /> <button class="p-link" @click="onIndicatorClick($event, i)" type="button" />
</li> </li>
</ul> </ul>

View File

@ -1,7 +1,7 @@
<template> <template>
<transition name="p-contextmenusub" @enter="onEnter"> <transition name="p-contextmenusub" @enter="onEnter">
<ul ref="container" :class="containerClass" role="menu" v-if="root ? true : parentActive"> <ul ref="container" :class="containerClass" role="menu" v-if="root ? true : parentActive">
<template v-for="(item, i) of model" :key="item.label + i"> <template v-for="(item, i) of model" :key="item.label + i.toString()">
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator" <li role="none" :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator"
@mouseenter="onItemMouseEnter($event, item)"> @mouseenter="onItemMouseEnter($event, item)">
<router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}"> <router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}">
@ -19,7 +19,7 @@
<sub-menu :model="item.items" v-if="visible(item) && item.items" :key="item.label + '_sub_'" <sub-menu :model="item.items" v-if="visible(item) && item.items" :key="item.label + '_sub_'"
@leaf-click="onLeafClick" :parentActive="item === activeItem" /> @leaf-click="onLeafClick" :parentActive="item === activeItem" />
</li> </li>
<li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i" role="separator"></li> <li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i.toString()" role="separator"></li>
</template> </template>
</ul> </ul>
</transition> </transition>

View File

@ -21,7 +21,7 @@
<div v-for="(column,columnIndex) of category.items" :key="category.label + '_column_' + columnIndex" :class="getColumnClassName(category)"> <div v-for="(column,columnIndex) of category.items" :key="category.label + '_column_' + columnIndex" :class="getColumnClassName(category)">
<ul v-for="(submenu,submenuIndex) of column" class="p-megamenu-submenu" :key="submenu.label + '_submenu_' + submenuIndex" role="menu"> <ul v-for="(submenu,submenuIndex) of column" class="p-megamenu-submenu" :key="submenu.label + '_submenu_' + submenuIndex" role="menu">
<li :class="getSubmenuHeaderClass(submenu)" :style="submenu.style" role="presentation">{{submenu.label}}</li> <li :class="getSubmenuHeaderClass(submenu)" :style="submenu.style" role="presentation">{{submenu.label}}</li>
<template v-for="(item, i) of submenu.items" :key="item.label + i"> <template v-for="(item, i) of submenu.items" :key="item.label + i.toString()">
<li role="none" :class="getSubmenuItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator"> <li role="none" :class="getSubmenuItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator">
<router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}"> <router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}">
<a :href="href" :class="getLinkClass(item)" @click="onLeafClick($event, item, navigate)" role="menuitem" v-ripple> <a :href="href" :class="getLinkClass(item)" @click="onLeafClick($event, item, navigate)" role="menuitem" v-ripple>
@ -35,7 +35,7 @@
<span :class="getSubmenuIcon()" v-if="item.items"></span> <span :class="getSubmenuIcon()" v-if="item.items"></span>
</a> </a>
</li> </li>
<li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i" role="separator"></li> <li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i.toString()" role="separator"></li>
</template> </template>
</ul> </ul>
</div> </div>

View File

@ -2,7 +2,7 @@
<transition name="p-connected-overlay" @enter="onEnter" @leave="onLeave"> <transition name="p-connected-overlay" @enter="onEnter" @leave="onLeave">
<div :ref="containerRef" :class="containerClass" v-if="popup ? overlayVisible : true"> <div :ref="containerRef" :class="containerClass" v-if="popup ? overlayVisible : true">
<ul class="p-menu-list p-reset" role="menu"> <ul class="p-menu-list p-reset" role="menu">
<template v-for="(item, i) of model" :key="item.label+i"> <template v-for="(item, i) of model" :key="item.label + i.toString()">
<template v-if="item.items && visible(item) && !item.separator"> <template v-if="item.items && visible(item) && !item.separator">
<li class="p-submenu-header" v-if="item.items">{{item.label}}</li> <li class="p-submenu-header" v-if="item.items">{{item.label}}</li>
<template v-for="(child, j) of item.items" :key="child.label + i + j"> <template v-for="(child, j) of item.items" :key="child.label + i + j">
@ -10,7 +10,7 @@
<li v-else-if="visible(child) && child.separator" :class="['p-menu-separator', child.class]" :style="child.style" :key="'separator' + i + j" role="separator"></li> <li v-else-if="visible(child) && child.separator" :class="['p-menu-separator', child.class]" :style="child.style" :key="'separator' + i + j" role="separator"></li>
</template> </template>
</template> </template>
<li v-else-if="visible(item) && item.separator" :class="['p-menu-separator', item.class]" :style="item.style" :key="'separator' + i" role="separator"></li> <li v-else-if="visible(item) && item.separator" :class="['p-menu-separator', item.class]" :style="item.style" :key="'separator' + i.toString()" role="separator"></li>
<Menuitem v-else :key="item.label+i" :item="item" @click="itemClick" /> <Menuitem v-else :key="item.label+i" :item="item" @click="itemClick" />
</template> </template>
</ul> </ul>

View File

@ -1,6 +1,6 @@
<template> <template>
<ul :class="containerClass" :role="root ? 'menubar' : 'menu'"> <ul :class="containerClass" :role="root ? 'menubar' : 'menu'">
<template v-for="(item, i) of model" :key="item.label + i"> <template v-for="(item, i) of model" :key="item.label + i.toString()">
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator" <li role="none" :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator"
@mouseenter="onItemMouseEnter($event, item)"> @mouseenter="onItemMouseEnter($event, item)">
<router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}"> <router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}">
@ -18,7 +18,7 @@
<sub-menu :model="item.items" v-if="visible(item) && item.items" :key="item.label + '_sub_'" :mobileActive="mobileActive" <sub-menu :model="item.items" v-if="visible(item) && item.items" :key="item.label + '_sub_'" :mobileActive="mobileActive"
@leaf-click="onLeafClick" @keydown-item="onChildItemKeyDown" :parentActive="item === activeItem" /> @leaf-click="onLeafClick" @keydown-item="onChildItemKeyDown" :parentActive="item === activeItem" />
</li> </li>
<li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i" role="separator"></li> <li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i.toString()" role="separator"></li>
</template> </template>
</ul> </ul>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<ul class="p-submenu-list" role="tree"> <ul class="p-submenu-list" role="tree">
<template v-for="(item, i) of model" :key="item.label + i"> <template v-for="(item, i) of model" :key="item.label + i.toString()">
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator"> <li role="none" :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator">
<router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}"> <router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}">
<a :href="href" :class="getLinkClass(item)" @click="onItemClick($event, item, navigate)" role="treeitem" :aria-expanded="isActive(item)"> <a :href="href" :class="getLinkClass(item)" @click="onItemClick($event, item, navigate)" role="treeitem" :aria-expanded="isActive(item)">
@ -20,7 +20,7 @@
</div> </div>
</transition> </transition>
</li> </li>
<li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i"></li> <li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i.toString()"></li>
</template> </template>
</ul> </ul>
</template> </template>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="p-tabmenu p-component"> <div class="p-tabmenu p-component">
<ul ref="nav" class="p-tabmenu-nav p-reset" role="tablist"> <ul ref="nav" class="p-tabmenu-nav p-reset" role="tablist">
<template v-for="(item,i) of model" :key="item.label + '_' + i"> <template v-for="(item,i) of model" :key="item.label + '_' + i.toString()">
<li :class="getItemClass(item)" :style="item.style" v-if="visible(item)" role="tab" :aria-selected="isActive(item)" :aria-expanded="isActive(item)"> <li :class="getItemClass(item)" :style="item.style" v-if="visible(item)" role="tab" :aria-selected="isActive(item)" :aria-expanded="isActive(item)">
<router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}"> <router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}">
<a :href="href" class="p-menuitem-link" @click="onItemClick($event, item, navigate)" role="presentation" v-ripple> <a :href="href" class="p-menuitem-link" @click="onItemClick($event, item, navigate)" role="presentation" v-ripple>

View File

@ -2,7 +2,7 @@
<div class="p-terminal p-component" @click="onClick"> <div class="p-terminal p-component" @click="onClick">
<div v-if="welcomeMessage">{{welcomeMessage}}</div> <div v-if="welcomeMessage">{{welcomeMessage}}</div>
<div class="p-terminal-content"> <div class="p-terminal-content">
<div v-for="(command,i) of commands" :key="command.text + '_' + i"> <div v-for="(command,i) of commands" :key="command.text + i.toString()">
<span class="p-terminal-prompt">{{prompt}}</span> <span class="p-terminal-prompt">{{prompt}}</span>
<span class="p-terminal-command">{{command.text}}</span> <span class="p-terminal-command">{{command.text}}</span>
<div class="p-terminal-response">{{command.response}}</div> <div class="p-terminal-response">{{command.response}}</div>

View File

@ -1,6 +1,6 @@
<template> <template>
<ul ref="element" :class="containerClass" role="'menubar' : 'menu'" aria-orientation="horizontal"> <ul ref="element" :class="containerClass" role="'menubar' : 'menu'" aria-orientation="horizontal">
<template v-for="(item, i) of model" :key="item.label + i"> <template v-for="(item, i) of model" :key="item.label + i.toString()">
<li :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator" <li :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator"
@mouseenter="onItemMouseEnter($event, item)" role="none"> @mouseenter="onItemMouseEnter($event, item)" role="none">
<router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}"> <router-link v-if="item.to && !item.disabled" :to="item.to" custom v-slot="{navigate, href}">
@ -18,7 +18,7 @@
<sub-menu :model="item.items" v-if="visible(item) && item.items" :key="item.label + '_sub_'" <sub-menu :model="item.items" v-if="visible(item) && item.items" :key="item.label + '_sub_'"
@leaf-click="onLeafClick" @keydown-item="onChildItemKeyDown" :parentActive="item === activeItem" /> @leaf-click="onLeafClick" @keydown-item="onChildItemKeyDown" :parentActive="item === activeItem" />
</li> </li>
<li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i" role="separator"></li> <li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i.toString()" role="separator"></li>
</template> </template>
</ul> </ul>
</template> </template>