primevue 3.29.0 → 3.29.2
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/autocomplete/AutoComplete.d.ts +4 -4
- package/calendar/Calendar.d.ts +4 -0
- package/calendar/Calendar.vue +3 -3
- package/calendar/calendar.cjs.js +3 -3
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +3 -3
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +3 -3
- package/calendar/calendar.min.js +1 -1
- package/datatable/DataTable.vue +4 -2
- package/datatable/HeaderCheckbox.vue +1 -1
- package/datatable/RowCheckbox.vue +1 -1
- package/datatable/datatable.cjs.js +16 -10
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +17 -11
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +16 -10
- package/datatable/datatable.min.js +1 -1
- package/dialogservice/dialogservice.cjs.js +3 -3
- package/dialogservice/dialogservice.cjs.min.js +1 -1
- package/dialogservice/dialogservice.esm.js +3 -3
- package/dialogservice/dialogservice.esm.min.js +1 -1
- package/dialogservice/dialogservice.js +3 -3
- package/dialogservice/dialogservice.min.js +1 -1
- package/package.json +1 -1
- package/speeddial/SpeedDial.d.ts +4 -0
- package/speeddial/SpeedDial.vue +1 -1
- package/speeddial/speeddial.cjs.js +3 -2
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +3 -2
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +3 -2
- package/speeddial/speeddial.min.js +1 -1
- package/steps/Steps.vue +4 -0
- package/steps/steps.cjs.js +1 -1
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +1 -1
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +1 -1
- package/steps/steps.min.js +1 -1
- package/tabmenu/TabMenu.vue +13 -4
- package/tabmenu/tabmenu.cjs.js +13 -4
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +13 -4
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +13 -4
- package/tabmenu/tabmenu.min.js +1 -1
- package/web-types.json +1 -1
package/tabmenu/tabmenu.cjs.js
CHANGED
|
@@ -95,7 +95,7 @@ var script = {
|
|
|
95
95
|
index: index
|
|
96
96
|
});
|
|
97
97
|
},
|
|
98
|
-
onKeydownItem(event,
|
|
98
|
+
onKeydownItem(event, index) {
|
|
99
99
|
let i = index;
|
|
100
100
|
|
|
101
101
|
let foundElement = {};
|
|
@@ -242,6 +242,15 @@ var script = {
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
},
|
|
245
|
+
computed: {
|
|
246
|
+
focusableItems() {
|
|
247
|
+
return (this.model || []).reduce((result, item) => {
|
|
248
|
+
this.visible(item) && !utils.DomHandler.hasClass(item, 'p-disabled') && result.push(item);
|
|
249
|
+
|
|
250
|
+
return result;
|
|
251
|
+
}, []);
|
|
252
|
+
}
|
|
253
|
+
},
|
|
245
254
|
directives: {
|
|
246
255
|
ripple: Ripple__default["default"]
|
|
247
256
|
}
|
|
@@ -264,7 +273,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
264
273
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
265
274
|
"aria-label": _ctx.ariaLabel
|
|
266
275
|
}, _ctx.ptm('menu')), [
|
|
267
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($
|
|
276
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.focusableItems, (item, i) => {
|
|
268
277
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
269
278
|
key: $options.label(item) + '_' + i.toString()
|
|
270
279
|
}, [
|
|
@@ -296,7 +305,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
296
305
|
"aria-disabled": $options.disabled(item),
|
|
297
306
|
tabindex: isExactActive ? '0' : '-1',
|
|
298
307
|
onClick: $event => ($options.onItemClick($event, item, i, navigate)),
|
|
299
|
-
onKeydown: $event => ($options.onKeydownItem($event,
|
|
308
|
+
onKeydown: $event => ($options.onKeydownItem($event, i, navigate))
|
|
300
309
|
}, $options.getPTOptions('action', i)), [
|
|
301
310
|
(_ctx.$slots.itemicon)
|
|
302
311
|
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.$slots.itemicon), {
|
|
@@ -332,7 +341,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
332
341
|
class: $options.getItemClass(item, i),
|
|
333
342
|
role: "presentation",
|
|
334
343
|
onClick: $event => ($options.onItemClick($event, item, i)),
|
|
335
|
-
onKeydown: $event => ($options.onKeydownItem($event,
|
|
344
|
+
onKeydown: $event => ($options.onKeydownItem($event, i))
|
|
336
345
|
}, $options.getPTOptions('menuitem', i)), [
|
|
337
346
|
(!_ctx.$slots.item)
|
|
338
347
|
? vue.withDirectives((vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/basecomponent"),t=require("primevue/ripple"),n=require("primevue/utils"),a=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(e),
|
|
1
|
+
"use strict";var e=require("primevue/basecomponent"),t=require("primevue/ripple"),n=require("primevue/utils"),a=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(e),s=i(t),o={name:"TabMenu",extends:l.default,emits:["update:activeIndex","tab-change"],props:{model:{type:Array,default:null},exact:{type:Boolean,default:!0},activeIndex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},timeout:null,data(){return{d_activeIndex:this.activeIndex}},watch:{$route(){this.timeout=setTimeout((()=>this.updateInkBar()),50)},activeIndex(e){this.d_activeIndex=e}},mounted(){this.updateInkBar()},updated(){this.updateInkBar()},beforeUnmount(){clearTimeout(this.timeout)},methods:{getPTOptions(e,t){return this.ptm(e,{context:{order:t}})},onItemClick(e,t,n,a){this.disabled(t)?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.to&&a&&a(e),n!==this.d_activeIndex&&(this.d_activeIndex=n,this.$emit("update:activeIndex",this.d_activeIndex)),this.$emit("tab-change",{originalEvent:e,index:n}))},onKeydownItem(e,t){let n=t,a={};const i=this.$refs.tabLink;switch(e.code){case"ArrowRight":a=this.findNextItem(this.$refs.tab,n),n=a.i;break;case"ArrowLeft":a=this.findPrevItem(this.$refs.tab,n),n=a.i;break;case"End":a=this.findPrevItem(this.$refs.tab,this.model.length),n=a.i,e.preventDefault();break;case"Home":a=this.findNextItem(this.$refs.tab,-1),n=a.i,e.preventDefault();break;case"Space":case"Enter":e.currentTarget&&e.currentTarget.click(),e.preventDefault();break;case"Tab":this.setDefaultTabIndexes(i)}i[n]&&i[t]&&(i[t].tabIndex="-1",i[n].tabIndex="0",i[n].focus())},findNextItem(e,t){let a=t+1;if(a>=e.length)return{nextItem:e[e.length],i:e.length};let i=e[a];return i?n.DomHandler.hasClass(i,"p-disabled")?this.findNextItem(e,a):{nextItem:i,i:a}:null},findPrevItem(e,t){let a=t-1;if(a<0)return{nextItem:e[0],i:0};let i=e[a];return i?n.DomHandler.hasClass(i,"p-disabled")?this.findPrevItem(e,a):{prevItem:i,i:a}:null},getItemClass(e,t){return["p-tabmenuitem",e.class,{"p-highlight":this.d_activeIndex===t,"p-disabled":this.disabled(e)}]},getRouteItemClass(e,t,n){return["p-tabmenuitem",e.class,{"p-highlight":this.exact?n:t,"p-disabled":this.disabled(e)}]},getItemIcon:e=>["p-menuitem-icon",e.icon],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,setDefaultTabIndexes(e){setTimeout((()=>{e.forEach((e=>{e.tabIndex=n.DomHandler.hasClass(e.parentElement,"p-highlight")?"0":"-1"}))}),300)},setTabIndex(e){return this.d_activeIndex===e?"0":"-1"},updateInkBar(){let e=this.$refs.nav.children,t=!1;for(let a=0;a<e.length;a++){let i=e[a];n.DomHandler.hasClass(i,"p-highlight")&&(this.$refs.inkbar.style.width=n.DomHandler.getWidth(i)+"px",this.$refs.inkbar.style.left=n.DomHandler.getOffset(i).left-n.DomHandler.getOffset(this.$refs.nav).left+"px",t=!0)}t||(this.$refs.inkbar.style.width="0px",this.$refs.inkbar.style.left="0px")}},computed:{focusableItems(){return(this.model||[]).reduce(((e,t)=>(this.visible(t)&&!n.DomHandler.hasClass(t,"p-disabled")&&e.push(t),e)),[])}},directives:{ripple:s.default}};const r=["aria-labelledby","aria-label"],m=["href","aria-label","aria-disabled","tabindex","onClick","onKeydown"],d=["onClick","onKeydown"],c=["href","target","aria-label","aria-disabled","tabindex"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&a.firstChild?a.insertBefore(i,a.firstChild):a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-tabmenu {\n overflow-x: auto;\n}\n.p-tabmenu-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex-wrap: nowrap;\n}\n.p-tabmenu-nav a {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n text-decoration: none;\n overflow: hidden;\n}\n.p-tabmenu-nav a:focus {\n z-index: 1;\n}\n.p-tabmenu-nav .p-menuitem-text {\n line-height: 1;\n}\n.p-tabmenu-ink-bar {\n display: none;\n z-index: 1;\n}\n.p-tabmenu::-webkit-scrollbar {\n display: none;\n}\n"),o.render=function(e,t,n,i,l,s){const o=a.resolveComponent("router-link"),p=a.resolveDirective("ripple");return a.openBlock(),a.createElementBlock("div",a.mergeProps({class:"p-tabmenu p-component"},e.ptm("root")),[a.createElementVNode("ul",a.mergeProps({ref:"nav",class:"p-tabmenu-nav p-reset",role:"menubar","aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel},e.ptm("menu")),[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.focusableItems,((t,n)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:s.label(t)+"_"+n.toString()},[t.to&&!s.disabled(t)?(a.openBlock(),a.createBlock(o,{key:0,to:t.to,custom:""},{default:a.withCtx((({navigate:i,href:l,isActive:o,isExactActive:r})=>[s.visible(t)?(a.openBlock(),a.createElementBlock("li",a.mergeProps({key:0,ref_for:!0,ref:"tab",class:s.getRouteItemClass(t,o,r),style:t.style,role:"presentation"},s.getPTOptions("menuitem",n)),[e.$slots.item?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.item),{key:1,item:t,index:n},null,8,["item","index"])):a.withDirectives((a.openBlock(),a.createElementBlock("a",a.mergeProps({key:0,ref_for:!0,ref:"tabLink",role:"menuitem",href:l,class:"p-menuitem-link","aria-label":s.label(t),"aria-disabled":s.disabled(t),tabindex:r?"0":"-1",onClick:e=>s.onItemClick(e,t,n,i),onKeydown:e=>s.onKeydownItem(e,n,i)},s.getPTOptions("action",n)),[e.$slots.itemicon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.itemicon),{key:0,item:t,class:a.normalizeClass(s.getItemIcon(t))},null,8,["item","class"])):t.icon?(a.openBlock(),a.createElementBlock("span",a.mergeProps({key:1,class:s.getItemIcon(t)},s.getPTOptions("icon",n)),null,16)):a.createCommentVNode("",!0),a.createElementVNode("span",a.mergeProps({class:"p-menuitem-text"},s.getPTOptions("label",n)),a.toDisplayString(s.label(t)),17)],16,m)),[[p]])],16)):a.createCommentVNode("",!0)])),_:2},1032,["to"])):s.visible(t)?(a.openBlock(),a.createElementBlock("li",a.mergeProps({key:1,ref_for:!0,ref:"tab",class:s.getItemClass(t,n),role:"presentation",onClick:e=>s.onItemClick(e,t,n),onKeydown:e=>s.onKeydownItem(e,n)},s.getPTOptions("menuitem",n)),[e.$slots.item?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.item),{key:1,item:t,index:n},null,8,["item","index"])):a.withDirectives((a.openBlock(),a.createElementBlock("a",a.mergeProps({key:0,ref_for:!0,ref:"tabLink",role:"menuitem",href:t.url,class:"p-menuitem-link",target:t.target,"aria-label":s.label(t),"aria-disabled":s.disabled(t),tabindex:s.setTabIndex(n)},s.getPTOptions("action",n)),[e.$slots.itemicon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.itemicon),{key:0,item:t,class:a.normalizeClass(s.getItemIcon(t))},null,8,["item","class"])):t.icon?(a.openBlock(),a.createElementBlock("span",a.mergeProps({key:1,class:s.getItemIcon(t)},s.getPTOptions("icon",n)),null,16)):a.createCommentVNode("",!0),a.createElementVNode("span",a.mergeProps({class:"p-menuitem-text"},s.getPTOptions("label",n)),a.toDisplayString(s.label(t)),17)],16,c)),[[p]])],16,d)):a.createCommentVNode("",!0)],64)))),128)),a.createElementVNode("li",a.mergeProps({ref:"inkbar",role:"none",class:"p-tabmenu-ink-bar"},e.ptm("inkbar")),null,16)],16,r)],16)},module.exports=o;
|
package/tabmenu/tabmenu.esm.js
CHANGED
|
@@ -88,7 +88,7 @@ var script = {
|
|
|
88
88
|
index: index
|
|
89
89
|
});
|
|
90
90
|
},
|
|
91
|
-
onKeydownItem(event,
|
|
91
|
+
onKeydownItem(event, index) {
|
|
92
92
|
let i = index;
|
|
93
93
|
|
|
94
94
|
let foundElement = {};
|
|
@@ -235,6 +235,15 @@ var script = {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
},
|
|
238
|
+
computed: {
|
|
239
|
+
focusableItems() {
|
|
240
|
+
return (this.model || []).reduce((result, item) => {
|
|
241
|
+
this.visible(item) && !DomHandler.hasClass(item, 'p-disabled') && result.push(item);
|
|
242
|
+
|
|
243
|
+
return result;
|
|
244
|
+
}, []);
|
|
245
|
+
}
|
|
246
|
+
},
|
|
238
247
|
directives: {
|
|
239
248
|
ripple: Ripple
|
|
240
249
|
}
|
|
@@ -257,7 +266,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
257
266
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
258
267
|
"aria-label": _ctx.ariaLabel
|
|
259
268
|
}, _ctx.ptm('menu')), [
|
|
260
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList($
|
|
269
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($options.focusableItems, (item, i) => {
|
|
261
270
|
return (openBlock(), createElementBlock(Fragment, {
|
|
262
271
|
key: $options.label(item) + '_' + i.toString()
|
|
263
272
|
}, [
|
|
@@ -289,7 +298,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
289
298
|
"aria-disabled": $options.disabled(item),
|
|
290
299
|
tabindex: isExactActive ? '0' : '-1',
|
|
291
300
|
onClick: $event => ($options.onItemClick($event, item, i, navigate)),
|
|
292
|
-
onKeydown: $event => ($options.onKeydownItem($event,
|
|
301
|
+
onKeydown: $event => ($options.onKeydownItem($event, i, navigate))
|
|
293
302
|
}, $options.getPTOptions('action', i)), [
|
|
294
303
|
(_ctx.$slots.itemicon)
|
|
295
304
|
? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.itemicon), {
|
|
@@ -325,7 +334,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
325
334
|
class: $options.getItemClass(item, i),
|
|
326
335
|
role: "presentation",
|
|
327
336
|
onClick: $event => ($options.onItemClick($event, item, i)),
|
|
328
|
-
onKeydown: $event => ($options.onKeydownItem($event,
|
|
337
|
+
onKeydown: $event => ($options.onKeydownItem($event, i))
|
|
329
338
|
}, $options.getPTOptions('menuitem', i)), [
|
|
330
339
|
(!_ctx.$slots.item)
|
|
331
340
|
? withDirectives((openBlock(), createElementBlock("a", mergeProps({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/basecomponent";import t from"primevue/ripple";import{DomHandler as n}from"primevue/utils";import{resolveComponent as i,resolveDirective as a,openBlock as l,createElementBlock as s,mergeProps as r,createElementVNode as o,Fragment as d,renderList as m,createBlock as c,withCtx as
|
|
1
|
+
import e from"primevue/basecomponent";import t from"primevue/ripple";import{DomHandler as n}from"primevue/utils";import{resolveComponent as i,resolveDirective as a,openBlock as l,createElementBlock as s,mergeProps as r,createElementVNode as o,Fragment as d,renderList as m,createBlock as c,withCtx as u,withDirectives as p,resolveDynamicComponent as b,normalizeClass as f,createCommentVNode as h,toDisplayString as x}from"vue";var I={name:"TabMenu",extends:e,emits:["update:activeIndex","tab-change"],props:{model:{type:Array,default:null},exact:{type:Boolean,default:!0},activeIndex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},timeout:null,data(){return{d_activeIndex:this.activeIndex}},watch:{$route(){this.timeout=setTimeout((()=>this.updateInkBar()),50)},activeIndex(e){this.d_activeIndex=e}},mounted(){this.updateInkBar()},updated(){this.updateInkBar()},beforeUnmount(){clearTimeout(this.timeout)},methods:{getPTOptions(e,t){return this.ptm(e,{context:{order:t}})},onItemClick(e,t,n,i){this.disabled(t)?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.to&&i&&i(e),n!==this.d_activeIndex&&(this.d_activeIndex=n,this.$emit("update:activeIndex",this.d_activeIndex)),this.$emit("tab-change",{originalEvent:e,index:n}))},onKeydownItem(e,t){let n=t,i={};const a=this.$refs.tabLink;switch(e.code){case"ArrowRight":i=this.findNextItem(this.$refs.tab,n),n=i.i;break;case"ArrowLeft":i=this.findPrevItem(this.$refs.tab,n),n=i.i;break;case"End":i=this.findPrevItem(this.$refs.tab,this.model.length),n=i.i,e.preventDefault();break;case"Home":i=this.findNextItem(this.$refs.tab,-1),n=i.i,e.preventDefault();break;case"Space":case"Enter":e.currentTarget&&e.currentTarget.click(),e.preventDefault();break;case"Tab":this.setDefaultTabIndexes(a)}a[n]&&a[t]&&(a[t].tabIndex="-1",a[n].tabIndex="0",a[n].focus())},findNextItem(e,t){let i=t+1;if(i>=e.length)return{nextItem:e[e.length],i:e.length};let a=e[i];return a?n.hasClass(a,"p-disabled")?this.findNextItem(e,i):{nextItem:a,i:i}:null},findPrevItem(e,t){let i=t-1;if(i<0)return{nextItem:e[0],i:0};let a=e[i];return a?n.hasClass(a,"p-disabled")?this.findPrevItem(e,i):{prevItem:a,i:i}:null},getItemClass(e,t){return["p-tabmenuitem",e.class,{"p-highlight":this.d_activeIndex===t,"p-disabled":this.disabled(e)}]},getRouteItemClass(e,t,n){return["p-tabmenuitem",e.class,{"p-highlight":this.exact?n:t,"p-disabled":this.disabled(e)}]},getItemIcon:e=>["p-menuitem-icon",e.icon],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,setDefaultTabIndexes(e){setTimeout((()=>{e.forEach((e=>{e.tabIndex=n.hasClass(e.parentElement,"p-highlight")?"0":"-1"}))}),300)},setTabIndex(e){return this.d_activeIndex===e?"0":"-1"},updateInkBar(){let e=this.$refs.nav.children,t=!1;for(let i=0;i<e.length;i++){let a=e[i];n.hasClass(a,"p-highlight")&&(this.$refs.inkbar.style.width=n.getWidth(a)+"px",this.$refs.inkbar.style.left=n.getOffset(a).left-n.getOffset(this.$refs.nav).left+"px",t=!0)}t||(this.$refs.inkbar.style.width="0px",this.$refs.inkbar.style.left="0px")}},computed:{focusableItems(){return(this.model||[]).reduce(((e,t)=>(this.visible(t)&&!n.hasClass(t,"p-disabled")&&e.push(t),e)),[])}},directives:{ripple:t}};const g=["aria-labelledby","aria-label"],v=["href","aria-label","aria-disabled","tabindex","onClick","onKeydown"],y=["onClick","onKeydown"],k=["href","target","aria-label","aria-disabled","tabindex"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("\n.p-tabmenu {\n overflow-x: auto;\n}\n.p-tabmenu-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex-wrap: nowrap;\n}\n.p-tabmenu-nav a {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n text-decoration: none;\n overflow: hidden;\n}\n.p-tabmenu-nav a:focus {\n z-index: 1;\n}\n.p-tabmenu-nav .p-menuitem-text {\n line-height: 1;\n}\n.p-tabmenu-ink-bar {\n display: none;\n z-index: 1;\n}\n.p-tabmenu::-webkit-scrollbar {\n display: none;\n}\n"),I.render=function(e,t,n,I,T,$){const C=i("router-link"),w=a("ripple");return l(),s("div",r({class:"p-tabmenu p-component"},e.ptm("root")),[o("ul",r({ref:"nav",class:"p-tabmenu-nav p-reset",role:"menubar","aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel},e.ptm("menu")),[(l(!0),s(d,null,m($.focusableItems,((t,n)=>(l(),s(d,{key:$.label(t)+"_"+n.toString()},[t.to&&!$.disabled(t)?(l(),c(C,{key:0,to:t.to,custom:""},{default:u((({navigate:i,href:a,isActive:d,isExactActive:m})=>[$.visible(t)?(l(),s("li",r({key:0,ref_for:!0,ref:"tab",class:$.getRouteItemClass(t,d,m),style:t.style,role:"presentation"},$.getPTOptions("menuitem",n)),[e.$slots.item?(l(),c(b(e.$slots.item),{key:1,item:t,index:n},null,8,["item","index"])):p((l(),s("a",r({key:0,ref_for:!0,ref:"tabLink",role:"menuitem",href:a,class:"p-menuitem-link","aria-label":$.label(t),"aria-disabled":$.disabled(t),tabindex:m?"0":"-1",onClick:e=>$.onItemClick(e,t,n,i),onKeydown:e=>$.onKeydownItem(e,n,i)},$.getPTOptions("action",n)),[e.$slots.itemicon?(l(),c(b(e.$slots.itemicon),{key:0,item:t,class:f($.getItemIcon(t))},null,8,["item","class"])):t.icon?(l(),s("span",r({key:1,class:$.getItemIcon(t)},$.getPTOptions("icon",n)),null,16)):h("",!0),o("span",r({class:"p-menuitem-text"},$.getPTOptions("label",n)),x($.label(t)),17)],16,v)),[[w]])],16)):h("",!0)])),_:2},1032,["to"])):$.visible(t)?(l(),s("li",r({key:1,ref_for:!0,ref:"tab",class:$.getItemClass(t,n),role:"presentation",onClick:e=>$.onItemClick(e,t,n),onKeydown:e=>$.onKeydownItem(e,n)},$.getPTOptions("menuitem",n)),[e.$slots.item?(l(),c(b(e.$slots.item),{key:1,item:t,index:n},null,8,["item","index"])):p((l(),s("a",r({key:0,ref_for:!0,ref:"tabLink",role:"menuitem",href:t.url,class:"p-menuitem-link",target:t.target,"aria-label":$.label(t),"aria-disabled":$.disabled(t),tabindex:$.setTabIndex(n)},$.getPTOptions("action",n)),[e.$slots.itemicon?(l(),c(b(e.$slots.itemicon),{key:0,item:t,class:f($.getItemIcon(t))},null,8,["item","class"])):t.icon?(l(),s("span",r({key:1,class:$.getItemIcon(t)},$.getPTOptions("icon",n)),null,16)):h("",!0),o("span",r({class:"p-menuitem-text"},$.getPTOptions("label",n)),x($.label(t)),17)],16,k)),[[w]])],16,y)):h("",!0)],64)))),128)),o("li",r({ref:"inkbar",role:"none",class:"p-tabmenu-ink-bar"},e.ptm("inkbar")),null,16)],16,g)],16)};export{I as default};
|
package/tabmenu/tabmenu.js
CHANGED
|
@@ -92,7 +92,7 @@ this.primevue.tabmenu = (function (BaseComponent, Ripple, utils, vue) {
|
|
|
92
92
|
index: index
|
|
93
93
|
});
|
|
94
94
|
},
|
|
95
|
-
onKeydownItem(event,
|
|
95
|
+
onKeydownItem(event, index) {
|
|
96
96
|
let i = index;
|
|
97
97
|
|
|
98
98
|
let foundElement = {};
|
|
@@ -239,6 +239,15 @@ this.primevue.tabmenu = (function (BaseComponent, Ripple, utils, vue) {
|
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
|
+
computed: {
|
|
243
|
+
focusableItems() {
|
|
244
|
+
return (this.model || []).reduce((result, item) => {
|
|
245
|
+
this.visible(item) && !utils.DomHandler.hasClass(item, 'p-disabled') && result.push(item);
|
|
246
|
+
|
|
247
|
+
return result;
|
|
248
|
+
}, []);
|
|
249
|
+
}
|
|
250
|
+
},
|
|
242
251
|
directives: {
|
|
243
252
|
ripple: Ripple__default["default"]
|
|
244
253
|
}
|
|
@@ -261,7 +270,7 @@ this.primevue.tabmenu = (function (BaseComponent, Ripple, utils, vue) {
|
|
|
261
270
|
"aria-labelledby": _ctx.ariaLabelledby,
|
|
262
271
|
"aria-label": _ctx.ariaLabel
|
|
263
272
|
}, _ctx.ptm('menu')), [
|
|
264
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($
|
|
273
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.focusableItems, (item, i) => {
|
|
265
274
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
266
275
|
key: $options.label(item) + '_' + i.toString()
|
|
267
276
|
}, [
|
|
@@ -293,7 +302,7 @@ this.primevue.tabmenu = (function (BaseComponent, Ripple, utils, vue) {
|
|
|
293
302
|
"aria-disabled": $options.disabled(item),
|
|
294
303
|
tabindex: isExactActive ? '0' : '-1',
|
|
295
304
|
onClick: $event => ($options.onItemClick($event, item, i, navigate)),
|
|
296
|
-
onKeydown: $event => ($options.onKeydownItem($event,
|
|
305
|
+
onKeydown: $event => ($options.onKeydownItem($event, i, navigate))
|
|
297
306
|
}, $options.getPTOptions('action', i)), [
|
|
298
307
|
(_ctx.$slots.itemicon)
|
|
299
308
|
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.$slots.itemicon), {
|
|
@@ -329,7 +338,7 @@ this.primevue.tabmenu = (function (BaseComponent, Ripple, utils, vue) {
|
|
|
329
338
|
class: $options.getItemClass(item, i),
|
|
330
339
|
role: "presentation",
|
|
331
340
|
onClick: $event => ($options.onItemClick($event, item, i)),
|
|
332
|
-
onKeydown: $event => ($options.onKeydownItem($event,
|
|
341
|
+
onKeydown: $event => ($options.onKeydownItem($event, i))
|
|
333
342
|
}, $options.getPTOptions('menuitem', i)), [
|
|
334
343
|
(!_ctx.$slots.item)
|
|
335
344
|
? vue.withDirectives((vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({
|
package/tabmenu/tabmenu.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.tabmenu=function(e,t,n,a){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(e),
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.tabmenu=function(e,t,n,a){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(e),s=i(t),o={name:"TabMenu",extends:l.default,emits:["update:activeIndex","tab-change"],props:{model:{type:Array,default:null},exact:{type:Boolean,default:!0},activeIndex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},timeout:null,data(){return{d_activeIndex:this.activeIndex}},watch:{$route(){this.timeout=setTimeout((()=>this.updateInkBar()),50)},activeIndex(e){this.d_activeIndex=e}},mounted(){this.updateInkBar()},updated(){this.updateInkBar()},beforeUnmount(){clearTimeout(this.timeout)},methods:{getPTOptions(e,t){return this.ptm(e,{context:{order:t}})},onItemClick(e,t,n,a){this.disabled(t)?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.to&&a&&a(e),n!==this.d_activeIndex&&(this.d_activeIndex=n,this.$emit("update:activeIndex",this.d_activeIndex)),this.$emit("tab-change",{originalEvent:e,index:n}))},onKeydownItem(e,t){let n=t,a={};const i=this.$refs.tabLink;switch(e.code){case"ArrowRight":a=this.findNextItem(this.$refs.tab,n),n=a.i;break;case"ArrowLeft":a=this.findPrevItem(this.$refs.tab,n),n=a.i;break;case"End":a=this.findPrevItem(this.$refs.tab,this.model.length),n=a.i,e.preventDefault();break;case"Home":a=this.findNextItem(this.$refs.tab,-1),n=a.i,e.preventDefault();break;case"Space":case"Enter":e.currentTarget&&e.currentTarget.click(),e.preventDefault();break;case"Tab":this.setDefaultTabIndexes(i)}i[n]&&i[t]&&(i[t].tabIndex="-1",i[n].tabIndex="0",i[n].focus())},findNextItem(e,t){let a=t+1;if(a>=e.length)return{nextItem:e[e.length],i:e.length};let i=e[a];return i?n.DomHandler.hasClass(i,"p-disabled")?this.findNextItem(e,a):{nextItem:i,i:a}:null},findPrevItem(e,t){let a=t-1;if(a<0)return{nextItem:e[0],i:0};let i=e[a];return i?n.DomHandler.hasClass(i,"p-disabled")?this.findPrevItem(e,a):{prevItem:i,i:a}:null},getItemClass(e,t){return["p-tabmenuitem",e.class,{"p-highlight":this.d_activeIndex===t,"p-disabled":this.disabled(e)}]},getRouteItemClass(e,t,n){return["p-tabmenuitem",e.class,{"p-highlight":this.exact?n:t,"p-disabled":this.disabled(e)}]},getItemIcon:e=>["p-menuitem-icon",e.icon],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,setDefaultTabIndexes(e){setTimeout((()=>{e.forEach((e=>{e.tabIndex=n.DomHandler.hasClass(e.parentElement,"p-highlight")?"0":"-1"}))}),300)},setTabIndex(e){return this.d_activeIndex===e?"0":"-1"},updateInkBar(){let e=this.$refs.nav.children,t=!1;for(let a=0;a<e.length;a++){let i=e[a];n.DomHandler.hasClass(i,"p-highlight")&&(this.$refs.inkbar.style.width=n.DomHandler.getWidth(i)+"px",this.$refs.inkbar.style.left=n.DomHandler.getOffset(i).left-n.DomHandler.getOffset(this.$refs.nav).left+"px",t=!0)}t||(this.$refs.inkbar.style.width="0px",this.$refs.inkbar.style.left="0px")}},computed:{focusableItems(){return(this.model||[]).reduce(((e,t)=>(this.visible(t)&&!n.DomHandler.hasClass(t,"p-disabled")&&e.push(t),e)),[])}},directives:{ripple:s.default}};const r=["aria-labelledby","aria-label"],m=["href","aria-label","aria-disabled","tabindex","onClick","onKeydown"],d=["onClick","onKeydown"],c=["href","target","aria-label","aria-disabled","tabindex"];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&a.firstChild?a.insertBefore(i,a.firstChild):a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-tabmenu {\n overflow-x: auto;\n}\n.p-tabmenu-nav {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n flex-wrap: nowrap;\n}\n.p-tabmenu-nav a {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n position: relative;\n text-decoration: none;\n text-decoration: none;\n overflow: hidden;\n}\n.p-tabmenu-nav a:focus {\n z-index: 1;\n}\n.p-tabmenu-nav .p-menuitem-text {\n line-height: 1;\n}\n.p-tabmenu-ink-bar {\n display: none;\n z-index: 1;\n}\n.p-tabmenu::-webkit-scrollbar {\n display: none;\n}\n"),o.render=function(e,t,n,i,l,s){const o=a.resolveComponent("router-link"),p=a.resolveDirective("ripple");return a.openBlock(),a.createElementBlock("div",a.mergeProps({class:"p-tabmenu p-component"},e.ptm("root")),[a.createElementVNode("ul",a.mergeProps({ref:"nav",class:"p-tabmenu-nav p-reset",role:"menubar","aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel},e.ptm("menu")),[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.focusableItems,((t,n)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:s.label(t)+"_"+n.toString()},[t.to&&!s.disabled(t)?(a.openBlock(),a.createBlock(o,{key:0,to:t.to,custom:""},{default:a.withCtx((({navigate:i,href:l,isActive:o,isExactActive:r})=>[s.visible(t)?(a.openBlock(),a.createElementBlock("li",a.mergeProps({key:0,ref_for:!0,ref:"tab",class:s.getRouteItemClass(t,o,r),style:t.style,role:"presentation"},s.getPTOptions("menuitem",n)),[e.$slots.item?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.item),{key:1,item:t,index:n},null,8,["item","index"])):a.withDirectives((a.openBlock(),a.createElementBlock("a",a.mergeProps({key:0,ref_for:!0,ref:"tabLink",role:"menuitem",href:l,class:"p-menuitem-link","aria-label":s.label(t),"aria-disabled":s.disabled(t),tabindex:r?"0":"-1",onClick:e=>s.onItemClick(e,t,n,i),onKeydown:e=>s.onKeydownItem(e,n,i)},s.getPTOptions("action",n)),[e.$slots.itemicon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.itemicon),{key:0,item:t,class:a.normalizeClass(s.getItemIcon(t))},null,8,["item","class"])):t.icon?(a.openBlock(),a.createElementBlock("span",a.mergeProps({key:1,class:s.getItemIcon(t)},s.getPTOptions("icon",n)),null,16)):a.createCommentVNode("",!0),a.createElementVNode("span",a.mergeProps({class:"p-menuitem-text"},s.getPTOptions("label",n)),a.toDisplayString(s.label(t)),17)],16,m)),[[p]])],16)):a.createCommentVNode("",!0)])),_:2},1032,["to"])):s.visible(t)?(a.openBlock(),a.createElementBlock("li",a.mergeProps({key:1,ref_for:!0,ref:"tab",class:s.getItemClass(t,n),role:"presentation",onClick:e=>s.onItemClick(e,t,n),onKeydown:e=>s.onKeydownItem(e,n)},s.getPTOptions("menuitem",n)),[e.$slots.item?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.item),{key:1,item:t,index:n},null,8,["item","index"])):a.withDirectives((a.openBlock(),a.createElementBlock("a",a.mergeProps({key:0,ref_for:!0,ref:"tabLink",role:"menuitem",href:t.url,class:"p-menuitem-link",target:t.target,"aria-label":s.label(t),"aria-disabled":s.disabled(t),tabindex:s.setTabIndex(n)},s.getPTOptions("action",n)),[e.$slots.itemicon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.$slots.itemicon),{key:0,item:t,class:a.normalizeClass(s.getItemIcon(t))},null,8,["item","class"])):t.icon?(a.openBlock(),a.createElementBlock("span",a.mergeProps({key:1,class:s.getItemIcon(t)},s.getPTOptions("icon",n)),null,16)):a.createCommentVNode("",!0),a.createElementVNode("span",a.mergeProps({class:"p-menuitem-text"},s.getPTOptions("label",n)),a.toDisplayString(s.label(t)),17)],16,c)),[[p]])],16,d)):a.createCommentVNode("",!0)],64)))),128)),a.createElementVNode("li",a.mergeProps({ref:"inkbar",role:"none",class:"p-tabmenu-ink-bar"},e.ptm("inkbar")),null,16)],16,r)],16)},o}(primevue.basecomponent,primevue.ripple,primevue.utils,Vue);
|
package/web-types.json
CHANGED