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.
Files changed (48) hide show
  1. package/autocomplete/AutoComplete.d.ts +4 -4
  2. package/calendar/Calendar.d.ts +4 -0
  3. package/calendar/Calendar.vue +3 -3
  4. package/calendar/calendar.cjs.js +3 -3
  5. package/calendar/calendar.cjs.min.js +1 -1
  6. package/calendar/calendar.esm.js +3 -3
  7. package/calendar/calendar.esm.min.js +1 -1
  8. package/calendar/calendar.js +3 -3
  9. package/calendar/calendar.min.js +1 -1
  10. package/datatable/DataTable.vue +4 -2
  11. package/datatable/HeaderCheckbox.vue +1 -1
  12. package/datatable/RowCheckbox.vue +1 -1
  13. package/datatable/datatable.cjs.js +16 -10
  14. package/datatable/datatable.cjs.min.js +1 -1
  15. package/datatable/datatable.esm.js +17 -11
  16. package/datatable/datatable.esm.min.js +1 -1
  17. package/datatable/datatable.js +16 -10
  18. package/datatable/datatable.min.js +1 -1
  19. package/dialogservice/dialogservice.cjs.js +3 -3
  20. package/dialogservice/dialogservice.cjs.min.js +1 -1
  21. package/dialogservice/dialogservice.esm.js +3 -3
  22. package/dialogservice/dialogservice.esm.min.js +1 -1
  23. package/dialogservice/dialogservice.js +3 -3
  24. package/dialogservice/dialogservice.min.js +1 -1
  25. package/package.json +1 -1
  26. package/speeddial/SpeedDial.d.ts +4 -0
  27. package/speeddial/SpeedDial.vue +1 -1
  28. package/speeddial/speeddial.cjs.js +3 -2
  29. package/speeddial/speeddial.cjs.min.js +1 -1
  30. package/speeddial/speeddial.esm.js +3 -2
  31. package/speeddial/speeddial.esm.min.js +1 -1
  32. package/speeddial/speeddial.js +3 -2
  33. package/speeddial/speeddial.min.js +1 -1
  34. package/steps/Steps.vue +4 -0
  35. package/steps/steps.cjs.js +1 -1
  36. package/steps/steps.cjs.min.js +1 -1
  37. package/steps/steps.esm.js +1 -1
  38. package/steps/steps.esm.min.js +1 -1
  39. package/steps/steps.js +1 -1
  40. package/steps/steps.min.js +1 -1
  41. package/tabmenu/TabMenu.vue +13 -4
  42. package/tabmenu/tabmenu.cjs.js +13 -4
  43. package/tabmenu/tabmenu.cjs.min.js +1 -1
  44. package/tabmenu/tabmenu.esm.js +13 -4
  45. package/tabmenu/tabmenu.esm.min.js +1 -1
  46. package/tabmenu/tabmenu.js +13 -4
  47. package/tabmenu/tabmenu.min.js +1 -1
  48. package/web-types.json +1 -1
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var vue = require('vue');
4
- var usedialog = require('primevue/usedialog');
5
3
  var DynamicDialogEventBus = require('primevue/dynamicdialogeventbus');
4
+ var usedialog = require('primevue/usedialog');
5
+ var vue = require('vue');
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -27,7 +27,7 @@ var DialogService = {
27
27
  }
28
28
  };
29
29
 
30
- app.config.unwrapInjectedRef = true; // Remove it after Vue 3.3. Details: https://vuejs.org/guide/components/provide-inject.html#working-with-reactivity
30
+ // app.config.unwrapInjectedRef = true; // Remove it after Vue 3.3. Details: https://vuejs.org/guide/components/provide-inject.html#working-with-reactivity
31
31
  app.config.globalProperties.$dialog = DialogService;
32
32
  app.provide(usedialog.PrimeVueDialogSymbol, DialogService);
33
33
  }
@@ -1 +1 @@
1
- "use strict";var e=require("vue"),t=require("primevue/usedialog");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(require("primevue/dynamicdialogeventbus")),o={install:a=>{const o={open:(t,a)=>{const o={content:t&&e.markRaw(t),options:a||{},data:a&&a.data,close:e=>{i.default.emit("close",{instance:o,params:e})}};return i.default.emit("open",{instance:o}),o}};a.config.unwrapInjectedRef=!0,a.config.globalProperties.$dialog=o,a.provide(t.PrimeVueDialogSymbol,o)}};module.exports=o;
1
+ "use strict";var e=require("primevue/dynamicdialogeventbus"),t=require("primevue/usedialog"),a=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e),r={install:e=>{const i={open:(e,t)=>{const i={content:e&&a.markRaw(e),options:t||{},data:t&&t.data,close:e=>{o.default.emit("close",{instance:i,params:e})}};return o.default.emit("open",{instance:i}),i}};e.config.globalProperties.$dialog=i,e.provide(t.PrimeVueDialogSymbol,i)}};module.exports=r;
@@ -1,6 +1,6 @@
1
- import { markRaw } from 'vue';
2
- import { PrimeVueDialogSymbol } from 'primevue/usedialog';
3
1
  import DynamicDialogEventBus from 'primevue/dynamicdialogeventbus';
2
+ import { PrimeVueDialogSymbol } from 'primevue/usedialog';
3
+ import { markRaw } from 'vue';
4
4
 
5
5
  var DialogService = {
6
6
  install: (app) => {
@@ -21,7 +21,7 @@ var DialogService = {
21
21
  }
22
22
  };
23
23
 
24
- app.config.unwrapInjectedRef = true; // Remove it after Vue 3.3. Details: https://vuejs.org/guide/components/provide-inject.html#working-with-reactivity
24
+ // app.config.unwrapInjectedRef = true; // Remove it after Vue 3.3. Details: https://vuejs.org/guide/components/provide-inject.html#working-with-reactivity
25
25
  app.config.globalProperties.$dialog = DialogService;
26
26
  app.provide(PrimeVueDialogSymbol, DialogService);
27
27
  }
@@ -1 +1 @@
1
- import{markRaw as e}from"vue";import{PrimeVueDialogSymbol as o}from"primevue/usedialog";import t from"primevue/dynamicdialogeventbus";var i={install:i=>{const n={open:(o,i)=>{const n={content:o&&e(o),options:i||{},data:i&&i.data,close:e=>{t.emit("close",{instance:n,params:e})}};return t.emit("open",{instance:n}),n}};i.config.unwrapInjectedRef=!0,i.config.globalProperties.$dialog=n,i.provide(o,n)}};export{i as default};
1
+ import e from"primevue/dynamicdialogeventbus";import{PrimeVueDialogSymbol as o}from"primevue/usedialog";import{markRaw as t}from"vue";var i={install:i=>{const a={open:(o,i)=>{const a={content:o&&t(o),options:i||{},data:i&&i.data,close:o=>{e.emit("close",{instance:a,params:o})}};return e.emit("open",{instance:a}),a}};i.config.globalProperties.$dialog=a,i.provide(o,a)}};export{i as default};
@@ -1,5 +1,5 @@
1
1
  this.primevue = this.primevue || {};
2
- this.primevue.dialogservice = (function (vue, usedialog, DynamicDialogEventBus) {
2
+ this.primevue.dialogservice = (function (DynamicDialogEventBus, usedialog, vue) {
3
3
  'use strict';
4
4
 
5
5
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -25,7 +25,7 @@ this.primevue.dialogservice = (function (vue, usedialog, DynamicDialogEventBus)
25
25
  }
26
26
  };
27
27
 
28
- app.config.unwrapInjectedRef = true; // Remove it after Vue 3.3. Details: https://vuejs.org/guide/components/provide-inject.html#working-with-reactivity
28
+ // app.config.unwrapInjectedRef = true; // Remove it after Vue 3.3. Details: https://vuejs.org/guide/components/provide-inject.html#working-with-reactivity
29
29
  app.config.globalProperties.$dialog = DialogService;
30
30
  app.provide(usedialog.PrimeVueDialogSymbol, DialogService);
31
31
  }
@@ -33,4 +33,4 @@ this.primevue.dialogservice = (function (vue, usedialog, DynamicDialogEventBus)
33
33
 
34
34
  return DialogService;
35
35
 
36
- })(Vue, primevue.usedialog, primevue.dynamicdialogeventbus);
36
+ })(primevue.dynamicdialogeventbus, primevue.usedialog, Vue);
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.dialogservice=function(e,t,i){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=n(primevue.dynamicdialogeventbus);return{install:i=>{const n={open:(t,i)=>{const n={content:t&&e.markRaw(t),options:i||{},data:i&&i.data,close:e=>{a.default.emit("close",{instance:n,params:e})}};return a.default.emit("open",{instance:n}),n}};i.config.unwrapInjectedRef=!0,i.config.globalProperties.$dialog=n,i.provide(t.PrimeVueDialogSymbol,n)}}}(Vue,primevue.usedialog);
1
+ this.primevue=this.primevue||{},this.primevue.dialogservice=function(e,t,i){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e);return{install:e=>{const a={open:(e,t)=>{const a={content:e&&i.markRaw(e),options:t||{},data:t&&t.data,close:e=>{n.default.emit("close",{instance:a,params:e})}};return n.default.emit("open",{instance:a}),a}};e.config.globalProperties.$dialog=a,e.provide(t.PrimeVueDialogSymbol,a)}}}(primevue.dynamicdialogeventbus,primevue.usedialog,Vue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primevue",
3
- "version": "3.29.0",
3
+ "version": "3.29.2",
4
4
  "homepage": "https://primevue.org/",
5
5
  "repository": {
6
6
  "type": "git",
@@ -244,6 +244,10 @@ export interface SpeedDialSlots {
244
244
  * @type {MenuItem}
245
245
  */
246
246
  item: MenuItem;
247
+ /**
248
+ * ıtem click function
249
+ */
250
+ onClick: void;
247
251
  }): VNode[];
248
252
  /**
249
253
  * Custom button template.
@@ -50,7 +50,7 @@
50
50
  <span v-if="item.icon" :class="['p-speeddial-action-icon', item.icon]" v-bind="getPTOptions(`${id}_${index}`, 'actionIcon')"></span>
51
51
  </a>
52
52
  </template>
53
- <component v-else :is="$slots.item" :item="item"></component>
53
+ <component v-else :is="$slots.item" :item="item" :onClick="(event) => onItemClick(event, item)"></component>
54
54
  </li>
55
55
  </template>
56
56
  </ul>
@@ -597,8 +597,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
597
597
  ])
598
598
  : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.$slots.item), {
599
599
  key: 1,
600
- item: item
601
- }, null, 8, ["item"]))
600
+ item: item,
601
+ onClick: (event) => $options.onItemClick(event, item)
602
+ }, null, 8, ["item", "onClick"]))
602
603
  ], 16, _hoisted_2))
603
604
  : vue.createCommentVNode("", true)
604
605
  ], 64))
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/basecomponent"),t=require("primevue/button"),i=require("primevue/icons/plus"),n=require("primevue/ripple"),s=require("primevue/tooltip"),o=require("primevue/utils"),l=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(e),d=a(t),c=a(i),p=a(n),u=a(s),m={name:"SpeedDial",extends:r.default,emits:["click","show","hide","focus","blur"],props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},documentClickListener:null,container:null,list:null,data(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o.UniqueComponentId()},visible(e){this.d_visible=e}},mounted(){if(this.id=this.id||o.UniqueComponentId(),"linear"!==this.type){const e=o.DomHandler.findSingle(this.container,".p-speeddial-button"),t=o.DomHandler.findSingle(this.list,".p-speeddial-item");if(e&&t){const i=Math.abs(e.offsetWidth-t.offsetWidth),n=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x",i/2+"px"),this.list.style.setProperty("--item-diff-y",n/2+"px")}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount(){this.unbindDocumentClickListener()},methods:{getPTOptions(e,t){return this.ptm(t,{context:{active:this.isItemActive(e)}})},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show(){this.d_visible=!0,this.$emit("show")},hide(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay(e){const t=this.model.length;return(this.d_visible?e:t-e-1)*this.transitionDelay},onTogglerKeydown(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].findIndex((e=>e.id===this.focusedOptionIndex));this.onItemClick(e,this.model[t]),this.onBlur(e);const i=o.DomHandler.findSingle(this.container,"button");i&&o.DomHandler.focus(i)},onEscapeKey(){this.hide();const e=o.DomHandler.findSingle(this.container,"button");e&&o.DomHandler.focus(e)},onArrowUp(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[t.length-1].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?t.length-1:n-1,n},findNextOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[0].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?0:n+1,n},calculatePointStyle(e){const t=this.type;if("linear"!==t){const i=this.model.length,n=this.radius||20*i;if("circle"===t){const t=2*Math.PI/i;return{left:`calc(${n*Math.cos(t*e)}px + var(--item-diff-x, 0px))`,top:`calc(${n*Math.sin(t*e)}px + var(--item-diff-y, 0px))`}}if("semi-circle"===t){const t=this.direction,s=Math.PI/(i-1),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up"===t)return{left:o,bottom:l};if("down"===t)return{left:o,top:l};if("left"===t)return{right:l,top:o};if("right"===t)return{left:l,top:o}}else if("quarter-circle"===t){const t=this.direction,s=Math.PI/(2*(i-1)),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up-left"===t)return{right:o,bottom:l};if("up-right"===t)return{left:o,bottom:l};if("down-left"===t)return{right:l,top:o};if("down-right"===t)return{left:l,top:o}}}return{}},getItemStyle(e){return{transitionDelay:`${this.calculateTransitionDelay(e)}ms`,...this.calculatePointStyle(e)}},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.d_visible&&this.isOutsideClicked(e)&&this.hide(),this.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,isItemActive(e){return e===this.focusedOptionId},containerRef(e){this.container=e},listRef(e){this.list=e},itemClass(e){return[{"p-focus":this.isItemActive(e)}]}},computed:{containerClass(){return[`p-speeddial p-component p-speeddial-${this.type}`,{[`p-speeddial-direction-${this.direction}`]:"circle"!==this.type,"p-speeddial-opened":this.d_visible,"p-disabled":this.disabled},this.class]},buttonClassName(){return["p-speeddial-button p-button-rounded",{"p-speeddial-rotate":this.rotateAnimation&&!this.hideIcon},this.buttonClass]},maskClassName(){return["p-speeddial-mask",{"p-speeddial-mask-visible":this.d_visible},this.maskClass]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:d.default,PlusIcon:c.default},directives:{ripple:p.default,tooltip:u.default}};const h=["id","aria-activedescendant"],f=["id","aria-controls"],b=["href","target","onClick","aria-label"];!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-speeddial {\n position: absolute;\n display: flex;\n}\n.p-speeddial-button {\n z-index: 1;\n}\n.p-speeddial-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: top 0s linear 0.2s;\n pointer-events: none;\n z-index: 2;\n}\n.p-speeddial-item {\n transform: scale(0);\n opacity: 0;\n transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 0.8s;\n will-change: transform;\n}\n.p-speeddial-action {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n position: relative;\n overflow: hidden;\n}\n.p-speeddial-circle .p-speeddial-item,\n.p-speeddial-semi-circle .p-speeddial-item,\n.p-speeddial-quarter-circle .p-speeddial-item {\n position: absolute;\n}\n.p-speeddial-rotate {\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n will-change: transform;\n}\n.p-speeddial-mask {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: opacity 250ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-mask-visible {\n pointer-events: none;\n opacity: 1;\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-opened .p-speeddial-list {\n pointer-events: auto;\n}\n.p-speeddial-opened .p-speeddial-item {\n transform: scale(1);\n opacity: 1;\n}\n.p-speeddial-opened .p-speeddial-rotate {\n transform: rotate(45deg);\n}\n\n/* Direction */\n.p-speeddial-direction-up {\n align-items: center;\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-up .p-speeddial-list {\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-down {\n align-items: center;\n flex-direction: column;\n}\n.p-speeddial-direction-down .p-speeddial-list {\n flex-direction: column;\n}\n.p-speeddial-direction-left {\n justify-content: center;\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-left .p-speeddial-list {\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-right {\n justify-content: center;\n flex-direction: row;\n}\n.p-speeddial-direction-right .p-speeddial-list {\n flex-direction: row;\n}\n"),m.render=function(e,t,i,n,s,o){const a=l.resolveComponent("SDButton"),r=l.resolveDirective("tooltip"),d=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",l.mergeProps({ref:o.containerRef,class:o.containerClass,style:i.style},e.ptm("root")),[l.renderSlot(e.$slots,"button",{toggle:o.onClick},(()=>[l.createVNode(a,{type:"button",class:l.normalizeClass(o.buttonClassName),onClick:t[0]||(t[0]=e=>o.onClick(e)),disabled:i.disabled,onKeydown:o.onTogglerKeydown,"aria-expanded":s.d_visible,"aria-haspopup":!0,"aria-controls":s.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button")},{icon:l.withCtx((()=>[l.renderSlot(e.$slots,"icon",{visible:s.d_visible},(()=>[s.d_visible&&i.hideIcon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.hideIcon?"span":"PlusIcon"),l.mergeProps({key:0,class:i.hideIcon},e.ptm("button").icon),null,16,["class"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.showIcon?"span":"PlusIcon"),l.mergeProps({key:1,class:i.showIcon},e.ptm("button").icon),null,16,["class"]))]))])),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt"])])),l.createElementVNode("ul",l.mergeProps({ref:o.listRef,id:s.id+"_list",class:"p-speeddial-list",role:"menu",onFocus:t[1]||(t[1]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),"aria-activedescendant":s.focused?o.focusedOptionId:void 0,tabindex:"-1"},e.ptm("menu")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.model,((t,n)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:n},[o.isItemVisible(t)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,id:`${s.id}_${n}`,"aria-controls":`${s.id}_item`,class:["p-speeddial-item",o.itemClass(`${s.id}_${n}`)],style:o.getItemStyle(n),role:"menuitem"},o.getPTOptions(`${s.id}_${n}`,"menuitem")),[e.$slots.item?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.item),{key:1,item:t},null,8,["item"])):l.withDirectives((l.openBlock(),l.createElementBlock("a",l.mergeProps({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:["p-speeddial-action",{"p-disabled":t.disabled}],target:t.target,onClick:e=>o.onItemClick(e,t),"aria-label":t.label},o.getPTOptions(`${s.id}_${n}`,"action")),[t.icon?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:0,class:["p-speeddial-action-icon",t.icon]},o.getPTOptions(`${s.id}_${n}`,"actionIcon")),null,16)):l.createCommentVNode("",!0)],16,b)),[[r,{value:t.label,disabled:!i.tooltipOptions},i.tooltipOptions],[d]])],16,f)):l.createCommentVNode("",!0)],64)))),128))],16,h)],16),i.mask?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:o.maskClassName,style:i.maskStyle},e.ptm("mask")),null,16)):l.createCommentVNode("",!0)],64)},module.exports=m;
1
+ "use strict";var e=require("primevue/basecomponent"),t=require("primevue/button"),i=require("primevue/icons/plus"),n=require("primevue/ripple"),s=require("primevue/tooltip"),o=require("primevue/utils"),l=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(e),d=a(t),c=a(i),p=a(n),u=a(s),m={name:"SpeedDial",extends:r.default,emits:["click","show","hide","focus","blur"],props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},documentClickListener:null,container:null,list:null,data(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o.UniqueComponentId()},visible(e){this.d_visible=e}},mounted(){if(this.id=this.id||o.UniqueComponentId(),"linear"!==this.type){const e=o.DomHandler.findSingle(this.container,".p-speeddial-button"),t=o.DomHandler.findSingle(this.list,".p-speeddial-item");if(e&&t){const i=Math.abs(e.offsetWidth-t.offsetWidth),n=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x",i/2+"px"),this.list.style.setProperty("--item-diff-y",n/2+"px")}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount(){this.unbindDocumentClickListener()},methods:{getPTOptions(e,t){return this.ptm(t,{context:{active:this.isItemActive(e)}})},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show(){this.d_visible=!0,this.$emit("show")},hide(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay(e){const t=this.model.length;return(this.d_visible?e:t-e-1)*this.transitionDelay},onTogglerKeydown(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].findIndex((e=>e.id===this.focusedOptionIndex));this.onItemClick(e,this.model[t]),this.onBlur(e);const i=o.DomHandler.findSingle(this.container,"button");i&&o.DomHandler.focus(i)},onEscapeKey(){this.hide();const e=o.DomHandler.findSingle(this.container,"button");e&&o.DomHandler.focus(e)},onArrowUp(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[t.length-1].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?t.length-1:n-1,n},findNextOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[0].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?0:n+1,n},calculatePointStyle(e){const t=this.type;if("linear"!==t){const i=this.model.length,n=this.radius||20*i;if("circle"===t){const t=2*Math.PI/i;return{left:`calc(${n*Math.cos(t*e)}px + var(--item-diff-x, 0px))`,top:`calc(${n*Math.sin(t*e)}px + var(--item-diff-y, 0px))`}}if("semi-circle"===t){const t=this.direction,s=Math.PI/(i-1),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up"===t)return{left:o,bottom:l};if("down"===t)return{left:o,top:l};if("left"===t)return{right:l,top:o};if("right"===t)return{left:l,top:o}}else if("quarter-circle"===t){const t=this.direction,s=Math.PI/(2*(i-1)),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up-left"===t)return{right:o,bottom:l};if("up-right"===t)return{left:o,bottom:l};if("down-left"===t)return{right:l,top:o};if("down-right"===t)return{left:l,top:o}}}return{}},getItemStyle(e){return{transitionDelay:`${this.calculateTransitionDelay(e)}ms`,...this.calculatePointStyle(e)}},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.d_visible&&this.isOutsideClicked(e)&&this.hide(),this.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,isItemActive(e){return e===this.focusedOptionId},containerRef(e){this.container=e},listRef(e){this.list=e},itemClass(e){return[{"p-focus":this.isItemActive(e)}]}},computed:{containerClass(){return[`p-speeddial p-component p-speeddial-${this.type}`,{[`p-speeddial-direction-${this.direction}`]:"circle"!==this.type,"p-speeddial-opened":this.d_visible,"p-disabled":this.disabled},this.class]},buttonClassName(){return["p-speeddial-button p-button-rounded",{"p-speeddial-rotate":this.rotateAnimation&&!this.hideIcon},this.buttonClass]},maskClassName(){return["p-speeddial-mask",{"p-speeddial-mask-visible":this.d_visible},this.maskClass]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:d.default,PlusIcon:c.default},directives:{ripple:p.default,tooltip:u.default}};const h=["id","aria-activedescendant"],f=["id","aria-controls"],b=["href","target","onClick","aria-label"];!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-speeddial {\n position: absolute;\n display: flex;\n}\n.p-speeddial-button {\n z-index: 1;\n}\n.p-speeddial-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: top 0s linear 0.2s;\n pointer-events: none;\n z-index: 2;\n}\n.p-speeddial-item {\n transform: scale(0);\n opacity: 0;\n transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 0.8s;\n will-change: transform;\n}\n.p-speeddial-action {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n position: relative;\n overflow: hidden;\n}\n.p-speeddial-circle .p-speeddial-item,\n.p-speeddial-semi-circle .p-speeddial-item,\n.p-speeddial-quarter-circle .p-speeddial-item {\n position: absolute;\n}\n.p-speeddial-rotate {\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n will-change: transform;\n}\n.p-speeddial-mask {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: opacity 250ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-mask-visible {\n pointer-events: none;\n opacity: 1;\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-opened .p-speeddial-list {\n pointer-events: auto;\n}\n.p-speeddial-opened .p-speeddial-item {\n transform: scale(1);\n opacity: 1;\n}\n.p-speeddial-opened .p-speeddial-rotate {\n transform: rotate(45deg);\n}\n\n/* Direction */\n.p-speeddial-direction-up {\n align-items: center;\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-up .p-speeddial-list {\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-down {\n align-items: center;\n flex-direction: column;\n}\n.p-speeddial-direction-down .p-speeddial-list {\n flex-direction: column;\n}\n.p-speeddial-direction-left {\n justify-content: center;\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-left .p-speeddial-list {\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-right {\n justify-content: center;\n flex-direction: row;\n}\n.p-speeddial-direction-right .p-speeddial-list {\n flex-direction: row;\n}\n"),m.render=function(e,t,i,n,s,o){const a=l.resolveComponent("SDButton"),r=l.resolveDirective("tooltip"),d=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",l.mergeProps({ref:o.containerRef,class:o.containerClass,style:i.style},e.ptm("root")),[l.renderSlot(e.$slots,"button",{toggle:o.onClick},(()=>[l.createVNode(a,{type:"button",class:l.normalizeClass(o.buttonClassName),onClick:t[0]||(t[0]=e=>o.onClick(e)),disabled:i.disabled,onKeydown:o.onTogglerKeydown,"aria-expanded":s.d_visible,"aria-haspopup":!0,"aria-controls":s.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button")},{icon:l.withCtx((()=>[l.renderSlot(e.$slots,"icon",{visible:s.d_visible},(()=>[s.d_visible&&i.hideIcon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.hideIcon?"span":"PlusIcon"),l.mergeProps({key:0,class:i.hideIcon},e.ptm("button").icon),null,16,["class"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.showIcon?"span":"PlusIcon"),l.mergeProps({key:1,class:i.showIcon},e.ptm("button").icon),null,16,["class"]))]))])),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt"])])),l.createElementVNode("ul",l.mergeProps({ref:o.listRef,id:s.id+"_list",class:"p-speeddial-list",role:"menu",onFocus:t[1]||(t[1]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),"aria-activedescendant":s.focused?o.focusedOptionId:void 0,tabindex:"-1"},e.ptm("menu")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.model,((t,n)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:n},[o.isItemVisible(t)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,id:`${s.id}_${n}`,"aria-controls":`${s.id}_item`,class:["p-speeddial-item",o.itemClass(`${s.id}_${n}`)],style:o.getItemStyle(n),role:"menuitem"},o.getPTOptions(`${s.id}_${n}`,"menuitem")),[e.$slots.item?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.item),{key:1,item:t,onClick:e=>o.onItemClick(e,t)},null,8,["item","onClick"])):l.withDirectives((l.openBlock(),l.createElementBlock("a",l.mergeProps({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:["p-speeddial-action",{"p-disabled":t.disabled}],target:t.target,onClick:e=>o.onItemClick(e,t),"aria-label":t.label},o.getPTOptions(`${s.id}_${n}`,"action")),[t.icon?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:0,class:["p-speeddial-action-icon",t.icon]},o.getPTOptions(`${s.id}_${n}`,"actionIcon")),null,16)):l.createCommentVNode("",!0)],16,b)),[[r,{value:t.label,disabled:!i.tooltipOptions},i.tooltipOptions],[d]])],16,f)):l.createCommentVNode("",!0)],64)))),128))],16,h)],16),i.mask?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:o.maskClassName,style:i.maskStyle},e.ptm("mask")),null,16)):l.createCommentVNode("",!0)],64)},module.exports=m;
@@ -587,8 +587,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
587
587
  ])
588
588
  : (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.item), {
589
589
  key: 1,
590
- item: item
591
- }, null, 8, ["item"]))
590
+ item: item,
591
+ onClick: (event) => $options.onItemClick(event, item)
592
+ }, null, 8, ["item", "onClick"]))
592
593
  ], 16, _hoisted_2))
593
594
  : createCommentVNode("", true)
594
595
  ], 64))
@@ -1 +1 @@
1
- import e from"primevue/basecomponent";import t from"primevue/button";import i from"primevue/icons/plus";import n from"primevue/ripple";import s from"primevue/tooltip";import{UniqueComponentId as o,DomHandler as l}from"primevue/utils";import{resolveComponent as a,resolveDirective as d,openBlock as r,createElementBlock as c,Fragment as p,createElementVNode as u,mergeProps as h,renderSlot as m,createVNode as f,normalizeClass as b,withCtx as g,createBlock as v,resolveDynamicComponent as y,renderList as x,withDirectives as I,createCommentVNode as w}from"vue";var k={name:"SpeedDial",extends:e,emits:["click","show","hide","focus","blur"],props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},documentClickListener:null,container:null,list:null,data(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o()},visible(e){this.d_visible=e}},mounted(){if(this.id=this.id||o(),"linear"!==this.type){const e=l.findSingle(this.container,".p-speeddial-button"),t=l.findSingle(this.list,".p-speeddial-item");if(e&&t){const i=Math.abs(e.offsetWidth-t.offsetWidth),n=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x",i/2+"px"),this.list.style.setProperty("--item-diff-y",n/2+"px")}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount(){this.unbindDocumentClickListener()},methods:{getPTOptions(e,t){return this.ptm(t,{context:{active:this.isItemActive(e)}})},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show(){this.d_visible=!0,this.$emit("show")},hide(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay(e){const t=this.model.length;return(this.d_visible?e:t-e-1)*this.transitionDelay},onTogglerKeydown(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp(e){this.focused=!0,l.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown(e){this.focused=!0,l.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey(e){const t=[...l.find(this.container,".p-speeddial-item")].findIndex((e=>e.id===this.focusedOptionIndex));this.onItemClick(e,this.model[t]),this.onBlur(e);const i=l.findSingle(this.container,"button");i&&l.focus(i)},onEscapeKey(){this.hide();const e=l.findSingle(this.container,"button");e&&l.focus(e)},onArrowUp(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex(e){const t=[...l.find(this.container,".p-speeddial-item")].filter((e=>!l.hasClass(l.findSingle(e,"a"),"p-disabled")));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex(e){const t=[...l.find(this.container,".p-speeddial-item")].filter((e=>!l.hasClass(l.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[t.length-1].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?t.length-1:n-1,n},findNextOptionIndex(e){const t=[...l.find(this.container,".p-speeddial-item")].filter((e=>!l.hasClass(l.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[0].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?0:n+1,n},calculatePointStyle(e){const t=this.type;if("linear"!==t){const i=this.model.length,n=this.radius||20*i;if("circle"===t){const t=2*Math.PI/i;return{left:`calc(${n*Math.cos(t*e)}px + var(--item-diff-x, 0px))`,top:`calc(${n*Math.sin(t*e)}px + var(--item-diff-y, 0px))`}}if("semi-circle"===t){const t=this.direction,s=Math.PI/(i-1),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up"===t)return{left:o,bottom:l};if("down"===t)return{left:o,top:l};if("left"===t)return{right:l,top:o};if("right"===t)return{left:l,top:o}}else if("quarter-circle"===t){const t=this.direction,s=Math.PI/(2*(i-1)),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up-left"===t)return{right:o,bottom:l};if("up-right"===t)return{left:o,bottom:l};if("down-left"===t)return{right:l,top:o};if("down-right"===t)return{left:l,top:o}}}return{}},getItemStyle(e){return{transitionDelay:`${this.calculateTransitionDelay(e)}ms`,...this.calculatePointStyle(e)}},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.d_visible&&this.isOutsideClicked(e)&&this.hide(),this.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,isItemActive(e){return e===this.focusedOptionId},containerRef(e){this.container=e},listRef(e){this.list=e},itemClass(e){return[{"p-focus":this.isItemActive(e)}]}},computed:{containerClass(){return[`p-speeddial p-component p-speeddial-${this.type}`,{[`p-speeddial-direction-${this.direction}`]:"circle"!==this.type,"p-speeddial-opened":this.d_visible,"p-disabled":this.disabled},this.class]},buttonClassName(){return["p-speeddial-button p-button-rounded",{"p-speeddial-rotate":this.rotateAnimation&&!this.hideIcon},this.buttonClass]},maskClassName(){return["p-speeddial-mask",{"p-speeddial-mask-visible":this.d_visible},this.maskClass]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:t,PlusIcon:i},directives:{ripple:n,tooltip:s}};const C=["id","aria-activedescendant"],O=["id","aria-controls"],$=["href","target","onClick","aria-label"];!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-speeddial {\n position: absolute;\n display: flex;\n}\n.p-speeddial-button {\n z-index: 1;\n}\n.p-speeddial-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: top 0s linear 0.2s;\n pointer-events: none;\n z-index: 2;\n}\n.p-speeddial-item {\n transform: scale(0);\n opacity: 0;\n transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 0.8s;\n will-change: transform;\n}\n.p-speeddial-action {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n position: relative;\n overflow: hidden;\n}\n.p-speeddial-circle .p-speeddial-item,\n.p-speeddial-semi-circle .p-speeddial-item,\n.p-speeddial-quarter-circle .p-speeddial-item {\n position: absolute;\n}\n.p-speeddial-rotate {\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n will-change: transform;\n}\n.p-speeddial-mask {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: opacity 250ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-mask-visible {\n pointer-events: none;\n opacity: 1;\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-opened .p-speeddial-list {\n pointer-events: auto;\n}\n.p-speeddial-opened .p-speeddial-item {\n transform: scale(1);\n opacity: 1;\n}\n.p-speeddial-opened .p-speeddial-rotate {\n transform: rotate(45deg);\n}\n\n/* Direction */\n.p-speeddial-direction-up {\n align-items: center;\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-up .p-speeddial-list {\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-down {\n align-items: center;\n flex-direction: column;\n}\n.p-speeddial-direction-down .p-speeddial-list {\n flex-direction: column;\n}\n.p-speeddial-direction-left {\n justify-content: center;\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-left .p-speeddial-list {\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-right {\n justify-content: center;\n flex-direction: row;\n}\n.p-speeddial-direction-right .p-speeddial-list {\n flex-direction: row;\n}\n"),k.render=function(e,t,i,n,s,o){const l=a("SDButton"),k=d("tooltip"),A=d("ripple");return r(),c(p,null,[u("div",h({ref:o.containerRef,class:o.containerClass,style:i.style},e.ptm("root")),[m(e.$slots,"button",{toggle:o.onClick},(()=>[f(l,{type:"button",class:b(o.buttonClassName),onClick:t[0]||(t[0]=e=>o.onClick(e)),disabled:i.disabled,onKeydown:o.onTogglerKeydown,"aria-expanded":s.d_visible,"aria-haspopup":!0,"aria-controls":s.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button")},{icon:g((()=>[m(e.$slots,"icon",{visible:s.d_visible},(()=>[s.d_visible&&i.hideIcon?(r(),v(y(i.hideIcon?"span":"PlusIcon"),h({key:0,class:i.hideIcon},e.ptm("button").icon),null,16,["class"])):(r(),v(y(i.showIcon?"span":"PlusIcon"),h({key:1,class:i.showIcon},e.ptm("button").icon),null,16,["class"]))]))])),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt"])])),u("ul",h({ref:o.listRef,id:s.id+"_list",class:"p-speeddial-list",role:"menu",onFocus:t[1]||(t[1]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),"aria-activedescendant":s.focused?o.focusedOptionId:void 0,tabindex:"-1"},e.ptm("menu")),[(r(!0),c(p,null,x(i.model,((t,n)=>(r(),c(p,{key:n},[o.isItemVisible(t)?(r(),c("li",h({key:0,id:`${s.id}_${n}`,"aria-controls":`${s.id}_item`,class:["p-speeddial-item",o.itemClass(`${s.id}_${n}`)],style:o.getItemStyle(n),role:"menuitem"},o.getPTOptions(`${s.id}_${n}`,"menuitem")),[e.$slots.item?(r(),v(y(e.$slots.item),{key:1,item:t},null,8,["item"])):I((r(),c("a",h({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:["p-speeddial-action",{"p-disabled":t.disabled}],target:t.target,onClick:e=>o.onItemClick(e,t),"aria-label":t.label},o.getPTOptions(`${s.id}_${n}`,"action")),[t.icon?(r(),c("span",h({key:0,class:["p-speeddial-action-icon",t.icon]},o.getPTOptions(`${s.id}_${n}`,"actionIcon")),null,16)):w("",!0)],16,$)),[[k,{value:t.label,disabled:!i.tooltipOptions},i.tooltipOptions],[A]])],16,O)):w("",!0)],64)))),128))],16,C)],16),i.mask?(r(),c("div",h({key:0,class:o.maskClassName,style:i.maskStyle},e.ptm("mask")),null,16)):w("",!0)],64)};export{k as default};
1
+ import e from"primevue/basecomponent";import t from"primevue/button";import i from"primevue/icons/plus";import n from"primevue/ripple";import s from"primevue/tooltip";import{UniqueComponentId as o,DomHandler as l}from"primevue/utils";import{resolveComponent as a,resolveDirective as d,openBlock as r,createElementBlock as c,Fragment as p,createElementVNode as u,mergeProps as h,renderSlot as m,createVNode as f,normalizeClass as b,withCtx as g,createBlock as v,resolveDynamicComponent as y,renderList as x,withDirectives as I,createCommentVNode as k}from"vue";var w={name:"SpeedDial",extends:e,emits:["click","show","hide","focus","blur"],props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},documentClickListener:null,container:null,list:null,data(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o()},visible(e){this.d_visible=e}},mounted(){if(this.id=this.id||o(),"linear"!==this.type){const e=l.findSingle(this.container,".p-speeddial-button"),t=l.findSingle(this.list,".p-speeddial-item");if(e&&t){const i=Math.abs(e.offsetWidth-t.offsetWidth),n=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x",i/2+"px"),this.list.style.setProperty("--item-diff-y",n/2+"px")}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount(){this.unbindDocumentClickListener()},methods:{getPTOptions(e,t){return this.ptm(t,{context:{active:this.isItemActive(e)}})},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show(){this.d_visible=!0,this.$emit("show")},hide(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay(e){const t=this.model.length;return(this.d_visible?e:t-e-1)*this.transitionDelay},onTogglerKeydown(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp(e){this.focused=!0,l.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown(e){this.focused=!0,l.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey(e){const t=[...l.find(this.container,".p-speeddial-item")].findIndex((e=>e.id===this.focusedOptionIndex));this.onItemClick(e,this.model[t]),this.onBlur(e);const i=l.findSingle(this.container,"button");i&&l.focus(i)},onEscapeKey(){this.hide();const e=l.findSingle(this.container,"button");e&&l.focus(e)},onArrowUp(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex(e){const t=[...l.find(this.container,".p-speeddial-item")].filter((e=>!l.hasClass(l.findSingle(e,"a"),"p-disabled")));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex(e){const t=[...l.find(this.container,".p-speeddial-item")].filter((e=>!l.hasClass(l.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[t.length-1].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?t.length-1:n-1,n},findNextOptionIndex(e){const t=[...l.find(this.container,".p-speeddial-item")].filter((e=>!l.hasClass(l.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[0].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?0:n+1,n},calculatePointStyle(e){const t=this.type;if("linear"!==t){const i=this.model.length,n=this.radius||20*i;if("circle"===t){const t=2*Math.PI/i;return{left:`calc(${n*Math.cos(t*e)}px + var(--item-diff-x, 0px))`,top:`calc(${n*Math.sin(t*e)}px + var(--item-diff-y, 0px))`}}if("semi-circle"===t){const t=this.direction,s=Math.PI/(i-1),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up"===t)return{left:o,bottom:l};if("down"===t)return{left:o,top:l};if("left"===t)return{right:l,top:o};if("right"===t)return{left:l,top:o}}else if("quarter-circle"===t){const t=this.direction,s=Math.PI/(2*(i-1)),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up-left"===t)return{right:o,bottom:l};if("up-right"===t)return{left:o,bottom:l};if("down-left"===t)return{right:l,top:o};if("down-right"===t)return{left:l,top:o}}}return{}},getItemStyle(e){return{transitionDelay:`${this.calculateTransitionDelay(e)}ms`,...this.calculatePointStyle(e)}},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.d_visible&&this.isOutsideClicked(e)&&this.hide(),this.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,isItemActive(e){return e===this.focusedOptionId},containerRef(e){this.container=e},listRef(e){this.list=e},itemClass(e){return[{"p-focus":this.isItemActive(e)}]}},computed:{containerClass(){return[`p-speeddial p-component p-speeddial-${this.type}`,{[`p-speeddial-direction-${this.direction}`]:"circle"!==this.type,"p-speeddial-opened":this.d_visible,"p-disabled":this.disabled},this.class]},buttonClassName(){return["p-speeddial-button p-button-rounded",{"p-speeddial-rotate":this.rotateAnimation&&!this.hideIcon},this.buttonClass]},maskClassName(){return["p-speeddial-mask",{"p-speeddial-mask-visible":this.d_visible},this.maskClass]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:t,PlusIcon:i},directives:{ripple:n,tooltip:s}};const C=["id","aria-activedescendant"],O=["id","aria-controls"],$=["href","target","onClick","aria-label"];!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-speeddial {\n position: absolute;\n display: flex;\n}\n.p-speeddial-button {\n z-index: 1;\n}\n.p-speeddial-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: top 0s linear 0.2s;\n pointer-events: none;\n z-index: 2;\n}\n.p-speeddial-item {\n transform: scale(0);\n opacity: 0;\n transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 0.8s;\n will-change: transform;\n}\n.p-speeddial-action {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n position: relative;\n overflow: hidden;\n}\n.p-speeddial-circle .p-speeddial-item,\n.p-speeddial-semi-circle .p-speeddial-item,\n.p-speeddial-quarter-circle .p-speeddial-item {\n position: absolute;\n}\n.p-speeddial-rotate {\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n will-change: transform;\n}\n.p-speeddial-mask {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: opacity 250ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-mask-visible {\n pointer-events: none;\n opacity: 1;\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-opened .p-speeddial-list {\n pointer-events: auto;\n}\n.p-speeddial-opened .p-speeddial-item {\n transform: scale(1);\n opacity: 1;\n}\n.p-speeddial-opened .p-speeddial-rotate {\n transform: rotate(45deg);\n}\n\n/* Direction */\n.p-speeddial-direction-up {\n align-items: center;\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-up .p-speeddial-list {\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-down {\n align-items: center;\n flex-direction: column;\n}\n.p-speeddial-direction-down .p-speeddial-list {\n flex-direction: column;\n}\n.p-speeddial-direction-left {\n justify-content: center;\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-left .p-speeddial-list {\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-right {\n justify-content: center;\n flex-direction: row;\n}\n.p-speeddial-direction-right .p-speeddial-list {\n flex-direction: row;\n}\n"),w.render=function(e,t,i,n,s,o){const l=a("SDButton"),w=d("tooltip"),A=d("ripple");return r(),c(p,null,[u("div",h({ref:o.containerRef,class:o.containerClass,style:i.style},e.ptm("root")),[m(e.$slots,"button",{toggle:o.onClick},(()=>[f(l,{type:"button",class:b(o.buttonClassName),onClick:t[0]||(t[0]=e=>o.onClick(e)),disabled:i.disabled,onKeydown:o.onTogglerKeydown,"aria-expanded":s.d_visible,"aria-haspopup":!0,"aria-controls":s.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button")},{icon:g((()=>[m(e.$slots,"icon",{visible:s.d_visible},(()=>[s.d_visible&&i.hideIcon?(r(),v(y(i.hideIcon?"span":"PlusIcon"),h({key:0,class:i.hideIcon},e.ptm("button").icon),null,16,["class"])):(r(),v(y(i.showIcon?"span":"PlusIcon"),h({key:1,class:i.showIcon},e.ptm("button").icon),null,16,["class"]))]))])),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt"])])),u("ul",h({ref:o.listRef,id:s.id+"_list",class:"p-speeddial-list",role:"menu",onFocus:t[1]||(t[1]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),"aria-activedescendant":s.focused?o.focusedOptionId:void 0,tabindex:"-1"},e.ptm("menu")),[(r(!0),c(p,null,x(i.model,((t,n)=>(r(),c(p,{key:n},[o.isItemVisible(t)?(r(),c("li",h({key:0,id:`${s.id}_${n}`,"aria-controls":`${s.id}_item`,class:["p-speeddial-item",o.itemClass(`${s.id}_${n}`)],style:o.getItemStyle(n),role:"menuitem"},o.getPTOptions(`${s.id}_${n}`,"menuitem")),[e.$slots.item?(r(),v(y(e.$slots.item),{key:1,item:t,onClick:e=>o.onItemClick(e,t)},null,8,["item","onClick"])):I((r(),c("a",h({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:["p-speeddial-action",{"p-disabled":t.disabled}],target:t.target,onClick:e=>o.onItemClick(e,t),"aria-label":t.label},o.getPTOptions(`${s.id}_${n}`,"action")),[t.icon?(r(),c("span",h({key:0,class:["p-speeddial-action-icon",t.icon]},o.getPTOptions(`${s.id}_${n}`,"actionIcon")),null,16)):k("",!0)],16,$)),[[w,{value:t.label,disabled:!i.tooltipOptions},i.tooltipOptions],[A]])],16,O)):k("",!0)],64)))),128))],16,C)],16),i.mask?(r(),c("div",h({key:0,class:o.maskClassName,style:i.maskStyle},e.ptm("mask")),null,16)):k("",!0)],64)};export{w as default};
@@ -591,8 +591,9 @@ this.primevue.speeddial = (function (BaseComponent, Button, PlusIcon, Ripple, To
591
591
  ])
592
592
  : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.$slots.item), {
593
593
  key: 1,
594
- item: item
595
- }, null, 8, ["item"]))
594
+ item: item,
595
+ onClick: (event) => $options.onItemClick(event, item)
596
+ }, null, 8, ["item", "onClick"]))
596
597
  ], 16, _hoisted_2))
597
598
  : vue.createCommentVNode("", true)
598
599
  ], 64))
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.speeddial=function(e,t,i,n,s,o,l){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=a(e),r=a(t),c=a(i),p=a(n),u=a(s),m={name:"SpeedDial",extends:d.default,emits:["click","show","hide","focus","blur"],props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},documentClickListener:null,container:null,list:null,data(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o.UniqueComponentId()},visible(e){this.d_visible=e}},mounted(){if(this.id=this.id||o.UniqueComponentId(),"linear"!==this.type){const e=o.DomHandler.findSingle(this.container,".p-speeddial-button"),t=o.DomHandler.findSingle(this.list,".p-speeddial-item");if(e&&t){const i=Math.abs(e.offsetWidth-t.offsetWidth),n=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x",i/2+"px"),this.list.style.setProperty("--item-diff-y",n/2+"px")}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount(){this.unbindDocumentClickListener()},methods:{getPTOptions(e,t){return this.ptm(t,{context:{active:this.isItemActive(e)}})},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show(){this.d_visible=!0,this.$emit("show")},hide(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay(e){const t=this.model.length;return(this.d_visible?e:t-e-1)*this.transitionDelay},onTogglerKeydown(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].findIndex((e=>e.id===this.focusedOptionIndex));this.onItemClick(e,this.model[t]),this.onBlur(e);const i=o.DomHandler.findSingle(this.container,"button");i&&o.DomHandler.focus(i)},onEscapeKey(){this.hide();const e=o.DomHandler.findSingle(this.container,"button");e&&o.DomHandler.focus(e)},onArrowUp(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[t.length-1].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?t.length-1:n-1,n},findNextOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[0].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?0:n+1,n},calculatePointStyle(e){const t=this.type;if("linear"!==t){const i=this.model.length,n=this.radius||20*i;if("circle"===t){const t=2*Math.PI/i;return{left:`calc(${n*Math.cos(t*e)}px + var(--item-diff-x, 0px))`,top:`calc(${n*Math.sin(t*e)}px + var(--item-diff-y, 0px))`}}if("semi-circle"===t){const t=this.direction,s=Math.PI/(i-1),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up"===t)return{left:o,bottom:l};if("down"===t)return{left:o,top:l};if("left"===t)return{right:l,top:o};if("right"===t)return{left:l,top:o}}else if("quarter-circle"===t){const t=this.direction,s=Math.PI/(2*(i-1)),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up-left"===t)return{right:o,bottom:l};if("up-right"===t)return{left:o,bottom:l};if("down-left"===t)return{right:l,top:o};if("down-right"===t)return{left:l,top:o}}}return{}},getItemStyle(e){return{transitionDelay:`${this.calculateTransitionDelay(e)}ms`,...this.calculatePointStyle(e)}},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.d_visible&&this.isOutsideClicked(e)&&this.hide(),this.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,isItemActive(e){return e===this.focusedOptionId},containerRef(e){this.container=e},listRef(e){this.list=e},itemClass(e){return[{"p-focus":this.isItemActive(e)}]}},computed:{containerClass(){return[`p-speeddial p-component p-speeddial-${this.type}`,{[`p-speeddial-direction-${this.direction}`]:"circle"!==this.type,"p-speeddial-opened":this.d_visible,"p-disabled":this.disabled},this.class]},buttonClassName(){return["p-speeddial-button p-button-rounded",{"p-speeddial-rotate":this.rotateAnimation&&!this.hideIcon},this.buttonClass]},maskClassName(){return["p-speeddial-mask",{"p-speeddial-mask-visible":this.d_visible},this.maskClass]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:r.default,PlusIcon:c.default},directives:{ripple:p.default,tooltip:u.default}};const h=["id","aria-activedescendant"],f=["id","aria-controls"],b=["href","target","onClick","aria-label"];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-speeddial {\n position: absolute;\n display: flex;\n}\n.p-speeddial-button {\n z-index: 1;\n}\n.p-speeddial-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: top 0s linear 0.2s;\n pointer-events: none;\n z-index: 2;\n}\n.p-speeddial-item {\n transform: scale(0);\n opacity: 0;\n transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 0.8s;\n will-change: transform;\n}\n.p-speeddial-action {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n position: relative;\n overflow: hidden;\n}\n.p-speeddial-circle .p-speeddial-item,\n.p-speeddial-semi-circle .p-speeddial-item,\n.p-speeddial-quarter-circle .p-speeddial-item {\n position: absolute;\n}\n.p-speeddial-rotate {\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n will-change: transform;\n}\n.p-speeddial-mask {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: opacity 250ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-mask-visible {\n pointer-events: none;\n opacity: 1;\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-opened .p-speeddial-list {\n pointer-events: auto;\n}\n.p-speeddial-opened .p-speeddial-item {\n transform: scale(1);\n opacity: 1;\n}\n.p-speeddial-opened .p-speeddial-rotate {\n transform: rotate(45deg);\n}\n\n/* Direction */\n.p-speeddial-direction-up {\n align-items: center;\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-up .p-speeddial-list {\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-down {\n align-items: center;\n flex-direction: column;\n}\n.p-speeddial-direction-down .p-speeddial-list {\n flex-direction: column;\n}\n.p-speeddial-direction-left {\n justify-content: center;\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-left .p-speeddial-list {\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-right {\n justify-content: center;\n flex-direction: row;\n}\n.p-speeddial-direction-right .p-speeddial-list {\n flex-direction: row;\n}\n"),m.render=function(e,t,i,n,s,o){const a=l.resolveComponent("SDButton"),d=l.resolveDirective("tooltip"),r=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",l.mergeProps({ref:o.containerRef,class:o.containerClass,style:i.style},e.ptm("root")),[l.renderSlot(e.$slots,"button",{toggle:o.onClick},(()=>[l.createVNode(a,{type:"button",class:l.normalizeClass(o.buttonClassName),onClick:t[0]||(t[0]=e=>o.onClick(e)),disabled:i.disabled,onKeydown:o.onTogglerKeydown,"aria-expanded":s.d_visible,"aria-haspopup":!0,"aria-controls":s.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button")},{icon:l.withCtx((()=>[l.renderSlot(e.$slots,"icon",{visible:s.d_visible},(()=>[s.d_visible&&i.hideIcon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.hideIcon?"span":"PlusIcon"),l.mergeProps({key:0,class:i.hideIcon},e.ptm("button").icon),null,16,["class"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.showIcon?"span":"PlusIcon"),l.mergeProps({key:1,class:i.showIcon},e.ptm("button").icon),null,16,["class"]))]))])),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt"])])),l.createElementVNode("ul",l.mergeProps({ref:o.listRef,id:s.id+"_list",class:"p-speeddial-list",role:"menu",onFocus:t[1]||(t[1]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),"aria-activedescendant":s.focused?o.focusedOptionId:void 0,tabindex:"-1"},e.ptm("menu")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.model,((t,n)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:n},[o.isItemVisible(t)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,id:`${s.id}_${n}`,"aria-controls":`${s.id}_item`,class:["p-speeddial-item",o.itemClass(`${s.id}_${n}`)],style:o.getItemStyle(n),role:"menuitem"},o.getPTOptions(`${s.id}_${n}`,"menuitem")),[e.$slots.item?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.item),{key:1,item:t},null,8,["item"])):l.withDirectives((l.openBlock(),l.createElementBlock("a",l.mergeProps({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:["p-speeddial-action",{"p-disabled":t.disabled}],target:t.target,onClick:e=>o.onItemClick(e,t),"aria-label":t.label},o.getPTOptions(`${s.id}_${n}`,"action")),[t.icon?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:0,class:["p-speeddial-action-icon",t.icon]},o.getPTOptions(`${s.id}_${n}`,"actionIcon")),null,16)):l.createCommentVNode("",!0)],16,b)),[[d,{value:t.label,disabled:!i.tooltipOptions},i.tooltipOptions],[r]])],16,f)):l.createCommentVNode("",!0)],64)))),128))],16,h)],16),i.mask?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:o.maskClassName,style:i.maskStyle},e.ptm("mask")),null,16)):l.createCommentVNode("",!0)],64)},m}(primevue.basecomponent,primevue.button,primevue.icons.plus,primevue.ripple,primevue.tooltip,primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.speeddial=function(e,t,i,n,s,o,l){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=a(e),r=a(t),c=a(i),p=a(n),u=a(s),m={name:"SpeedDial",extends:d.default,emits:["click","show","hide","focus","blur"],props:{model:null,visible:{type:Boolean,default:!1},direction:{type:String,default:"up"},transitionDelay:{type:Number,default:30},type:{type:String,default:"linear"},radius:{type:Number,default:0},mask:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideOnClickOutside:{type:Boolean,default:!0},buttonClass:null,maskStyle:null,maskClass:null,showIcon:{type:String,default:void 0},hideIcon:{type:String,default:void 0},rotateAnimation:{type:Boolean,default:!0},tooltipOptions:null,style:null,class:null,"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},documentClickListener:null,container:null,list:null,data(){return{id:this.$attrs.id,d_visible:this.visible,isItemClicked:!1,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||o.UniqueComponentId()},visible(e){this.d_visible=e}},mounted(){if(this.id=this.id||o.UniqueComponentId(),"linear"!==this.type){const e=o.DomHandler.findSingle(this.container,".p-speeddial-button"),t=o.DomHandler.findSingle(this.list,".p-speeddial-item");if(e&&t){const i=Math.abs(e.offsetWidth-t.offsetWidth),n=Math.abs(e.offsetHeight-t.offsetHeight);this.list.style.setProperty("--item-diff-x",i/2+"px"),this.list.style.setProperty("--item-diff-y",n/2+"px")}}this.hideOnClickOutside&&this.bindDocumentClickListener()},beforeMount(){this.unbindDocumentClickListener()},methods:{getPTOptions(e,t){return this.ptm(t,{context:{active:this.isItemActive(e)}})},onFocus(e){this.focused=!0,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onItemClick(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()},onClick(e){this.d_visible?this.hide():this.show(),this.isItemClicked=!0,this.$emit("click",e)},show(){this.d_visible=!0,this.$emit("show")},hide(){this.d_visible=!1,this.$emit("hide")},calculateTransitionDelay(e){const t=this.model.length;return(this.d_visible?e:t-e-1)*this.transitionDelay},onTogglerKeydown(e){switch(e.code){case"ArrowDown":case"ArrowLeft":this.onTogglerArrowDown(e);break;case"ArrowUp":case"ArrowRight":this.onTogglerArrowUp(e);break;case"Escape":this.onEscapeKey()}},onKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"ArrowRight":this.onArrowRight(e);break;case"Enter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e)}},onTogglerArrowUp(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigatePrevItem(e),e.preventDefault()},onTogglerArrowDown(e){this.focused=!0,o.DomHandler.focus(this.list),this.show(),this.navigateNextItem(e),e.preventDefault()},onEnterKey(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].findIndex((e=>e.id===this.focusedOptionIndex));this.onItemClick(e,this.model[t]),this.onBlur(e);const i=o.DomHandler.findSingle(this.container,"button");i&&o.DomHandler.focus(i)},onEscapeKey(){this.hide();const e=o.DomHandler.findSingle(this.container,"button");e&&o.DomHandler.focus(e)},onArrowUp(e){"up"===this.direction?this.navigateNextItem(e):"down"===this.direction?this.navigatePrevItem(e):this.navigateNextItem(e)},onArrowDown(e){"up"===this.direction?this.navigatePrevItem(e):"down"===this.direction?this.navigateNextItem(e):this.navigatePrevItem(e)},onArrowLeft(e){["left","up-right","down-left"].includes(this.direction)?this.navigateNextItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigatePrevItem(e))},onArrowRight(e){["left","up-right","down-left"].includes(this.direction)?this.navigatePrevItem(e):(["right","up-left","down-right"].includes(this.direction),this.navigateNextItem(e))},onEndKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigatePrevItem(e)},onHomeKey(e){e.preventDefault(),this.focusedOptionIndex=-1,this.navigateNextItem(e)},navigateNextItem(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},navigatePrevItem(e){const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},changeFocusedOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled")));t[e]&&(this.focusedOptionIndex=t[e].getAttribute("id"))},findPrevOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[t.length-1].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?t.length-1:n-1,n},findNextOptionIndex(e){const t=[...o.DomHandler.find(this.container,".p-speeddial-item")].filter((e=>!o.DomHandler.hasClass(o.DomHandler.findSingle(e,"a"),"p-disabled"))),i=-1===e?t[0].id:e;let n=t.findIndex((e=>e.getAttribute("id")===i));return n=-1===e?0:n+1,n},calculatePointStyle(e){const t=this.type;if("linear"!==t){const i=this.model.length,n=this.radius||20*i;if("circle"===t){const t=2*Math.PI/i;return{left:`calc(${n*Math.cos(t*e)}px + var(--item-diff-x, 0px))`,top:`calc(${n*Math.sin(t*e)}px + var(--item-diff-y, 0px))`}}if("semi-circle"===t){const t=this.direction,s=Math.PI/(i-1),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up"===t)return{left:o,bottom:l};if("down"===t)return{left:o,top:l};if("left"===t)return{right:l,top:o};if("right"===t)return{left:l,top:o}}else if("quarter-circle"===t){const t=this.direction,s=Math.PI/(2*(i-1)),o=`calc(${n*Math.cos(s*e)}px + var(--item-diff-x, 0px))`,l=`calc(${n*Math.sin(s*e)}px + var(--item-diff-y, 0px))`;if("up-left"===t)return{right:o,bottom:l};if("up-right"===t)return{left:o,bottom:l};if("down-left"===t)return{right:l,top:o};if("down-right"===t)return{left:l,top:o}}}return{}},getItemStyle(e){return{transitionDelay:`${this.calculateTransitionDelay(e)}ms`,...this.calculatePointStyle(e)}},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.d_visible&&this.isOutsideClicked(e)&&this.hide(),this.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},isOutsideClicked(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)},isItemVisible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,isItemActive(e){return e===this.focusedOptionId},containerRef(e){this.container=e},listRef(e){this.list=e},itemClass(e){return[{"p-focus":this.isItemActive(e)}]}},computed:{containerClass(){return[`p-speeddial p-component p-speeddial-${this.type}`,{[`p-speeddial-direction-${this.direction}`]:"circle"!==this.type,"p-speeddial-opened":this.d_visible,"p-disabled":this.disabled},this.class]},buttonClassName(){return["p-speeddial-button p-button-rounded",{"p-speeddial-rotate":this.rotateAnimation&&!this.hideIcon},this.buttonClass]},maskClassName(){return["p-speeddial-mask",{"p-speeddial-mask-visible":this.d_visible},this.maskClass]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{SDButton:r.default,PlusIcon:c.default},directives:{ripple:p.default,tooltip:u.default}};const h=["id","aria-activedescendant"],f=["id","aria-controls"],b=["href","target","onClick","aria-label"];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-speeddial {\n position: absolute;\n display: flex;\n}\n.p-speeddial-button {\n z-index: 1;\n}\n.p-speeddial-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: top 0s linear 0.2s;\n pointer-events: none;\n z-index: 2;\n}\n.p-speeddial-item {\n transform: scale(0);\n opacity: 0;\n transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 0.8s;\n will-change: transform;\n}\n.p-speeddial-action {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n position: relative;\n overflow: hidden;\n}\n.p-speeddial-circle .p-speeddial-item,\n.p-speeddial-semi-circle .p-speeddial-item,\n.p-speeddial-quarter-circle .p-speeddial-item {\n position: absolute;\n}\n.p-speeddial-rotate {\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n will-change: transform;\n}\n.p-speeddial-mask {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: opacity 250ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-mask-visible {\n pointer-events: none;\n opacity: 1;\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n.p-speeddial-opened .p-speeddial-list {\n pointer-events: auto;\n}\n.p-speeddial-opened .p-speeddial-item {\n transform: scale(1);\n opacity: 1;\n}\n.p-speeddial-opened .p-speeddial-rotate {\n transform: rotate(45deg);\n}\n\n/* Direction */\n.p-speeddial-direction-up {\n align-items: center;\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-up .p-speeddial-list {\n flex-direction: column-reverse;\n}\n.p-speeddial-direction-down {\n align-items: center;\n flex-direction: column;\n}\n.p-speeddial-direction-down .p-speeddial-list {\n flex-direction: column;\n}\n.p-speeddial-direction-left {\n justify-content: center;\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-left .p-speeddial-list {\n flex-direction: row-reverse;\n}\n.p-speeddial-direction-right {\n justify-content: center;\n flex-direction: row;\n}\n.p-speeddial-direction-right .p-speeddial-list {\n flex-direction: row;\n}\n"),m.render=function(e,t,i,n,s,o){const a=l.resolveComponent("SDButton"),d=l.resolveDirective("tooltip"),r=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",l.mergeProps({ref:o.containerRef,class:o.containerClass,style:i.style},e.ptm("root")),[l.renderSlot(e.$slots,"button",{toggle:o.onClick},(()=>[l.createVNode(a,{type:"button",class:l.normalizeClass(o.buttonClassName),onClick:t[0]||(t[0]=e=>o.onClick(e)),disabled:i.disabled,onKeydown:o.onTogglerKeydown,"aria-expanded":s.d_visible,"aria-haspopup":!0,"aria-controls":s.id+"_list","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,pt:e.ptm("button")},{icon:l.withCtx((()=>[l.renderSlot(e.$slots,"icon",{visible:s.d_visible},(()=>[s.d_visible&&i.hideIcon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.hideIcon?"span":"PlusIcon"),l.mergeProps({key:0,class:i.hideIcon},e.ptm("button").icon),null,16,["class"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.showIcon?"span":"PlusIcon"),l.mergeProps({key:1,class:i.showIcon},e.ptm("button").icon),null,16,["class"]))]))])),_:3},8,["class","disabled","onKeydown","aria-expanded","aria-controls","aria-label","aria-labelledby","pt"])])),l.createElementVNode("ul",l.mergeProps({ref:o.listRef,id:s.id+"_list",class:"p-speeddial-list",role:"menu",onFocus:t[1]||(t[1]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[2]||(t[2]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[3]||(t[3]=(...e)=>o.onKeyDown&&o.onKeyDown(...e)),"aria-activedescendant":s.focused?o.focusedOptionId:void 0,tabindex:"-1"},e.ptm("menu")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.model,((t,n)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:n},[o.isItemVisible(t)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,id:`${s.id}_${n}`,"aria-controls":`${s.id}_item`,class:["p-speeddial-item",o.itemClass(`${s.id}_${n}`)],style:o.getItemStyle(n),role:"menuitem"},o.getPTOptions(`${s.id}_${n}`,"menuitem")),[e.$slots.item?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.item),{key:1,item:t,onClick:e=>o.onItemClick(e,t)},null,8,["item","onClick"])):l.withDirectives((l.openBlock(),l.createElementBlock("a",l.mergeProps({key:0,tabindex:-1,href:t.url||"#",role:"menuitem",class:["p-speeddial-action",{"p-disabled":t.disabled}],target:t.target,onClick:e=>o.onItemClick(e,t),"aria-label":t.label},o.getPTOptions(`${s.id}_${n}`,"action")),[t.icon?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:0,class:["p-speeddial-action-icon",t.icon]},o.getPTOptions(`${s.id}_${n}`,"actionIcon")),null,16)):l.createCommentVNode("",!0)],16,b)),[[d,{value:t.label,disabled:!i.tooltipOptions},i.tooltipOptions],[r]])],16,f)):l.createCommentVNode("",!0)],64)))),128))],16,h)],16),i.mask?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:o.maskClassName,style:i.maskStyle},e.ptm("mask")),null,16)):l.createCommentVNode("",!0)],64)},m}(primevue.basecomponent,primevue.button,primevue.icons.plus,primevue.ripple,primevue.tooltip,primevue.utils,Vue);
package/steps/Steps.vue CHANGED
@@ -226,6 +226,7 @@ export default {
226
226
  display: flex;
227
227
  justify-content: center;
228
228
  flex: 1 1 auto;
229
+ overflow: hidden;
229
230
  }
230
231
 
231
232
  .p-steps-item .p-menuitem-link {
@@ -246,6 +247,9 @@ export default {
246
247
 
247
248
  .p-steps-title {
248
249
  white-space: nowrap;
250
+ overflow: hidden;
251
+ text-overflow: ellipsis;
252
+ max-width: 100%;
249
253
  }
250
254
 
251
255
  .p-steps-number {
@@ -275,7 +275,7 @@ function styleInject(css, ref) {
275
275
  }
276
276
  }
277
277
 
278
- var css_248z = "\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n";
278
+ var css_248z = "\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n overflow: hidden;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n";
279
279
  styleInject(css_248z);
280
280
 
281
281
  script.render = render;
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/basecomponent"),t=require("primevue/utils"),n=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i={name:"Steps",extends:s(e).default,props:{id:{type:String,default:t.UniqueComponentId()},model:{type:Array,default:null},readonly:{type:Boolean,default:!0},exact:{type:Boolean,default:!0}},mounted(){this.findFirstItem().tabIndex="0"},methods:{onItemClick(e,t,n){this.disabled(t)||this.readonly?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.to&&n&&n(e))},onItemKeydown(e,t,n){switch(e.code){case"ArrowRight":this.navigateToNextItem(e.target),e.preventDefault();break;case"ArrowLeft":this.navigateToPrevItem(e.target),e.preventDefault();break;case"Home":this.navigateToFirstItem(e.target),e.preventDefault();break;case"End":this.navigateToLastItem(e.target),e.preventDefault();break;case"Tab":break;case"Enter":case"Space":this.onItemClick(e,t,n),e.preventDefault()}},navigateToNextItem(e){const t=this.findNextItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToPrevItem(e){const t=this.findPrevItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToFirstItem(e){const t=this.findFirstItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToLastItem(e){const t=this.findLastItem(e);t&&this.setFocusToMenuitem(e,t)},findNextItem(e){const t=e.parentElement.nextElementSibling;return t?t.children[0]:null},findPrevItem(e){const t=e.parentElement.previousElementSibling;return t?t.children[0]:null},findFirstItem(){const e=t.DomHandler.findSingle(this.$refs.list,".p-steps-item");return e?e.children[0]:null},findLastItem(){const e=t.DomHandler.find(this.$refs.list,".p-steps-item");return e?e[e.length-1].children[0]:null},setFocusToMenuitem(e,t){e.tabIndex="-1",t.tabIndex="0",t.focus()},isActive(e){return!!e.to&&this.$router.resolve(e.to).path===this.$route.path},getItemClass(e){return["p-steps-item",e.class,{"p-highlight p-steps-current":this.isActive(e),"p-disabled":this.isItemDisabled(e)}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},isItemDisabled(e){return this.disabled(e)||this.readonly&&!this.isActive(e)},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},computed:{containerClass(){return["p-steps p-component",{"p-readonly":this.readonly}]}}};const l=["id"],o=["href","aria-current","onClick","onKeydown"],a=["onKeydown"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n"),i.render=function(e,t,s,i,r,p){const c=n.resolveComponent("router-link");return n.openBlock(),n.createElementBlock("nav",n.mergeProps({id:s.id,class:p.containerClass},e.ptm("root")),[n.createElementVNode("ol",n.mergeProps({ref:"list",class:"p-steps-list"},e.ptm("menu")),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.model,((t,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:t.to},[p.visible(t)?(n.openBlock(),n.createElementBlock("li",n.mergeProps({key:0,class:p.getItemClass(t),style:t.style},e.ptm("menuitem")),[e.$slots.item?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.$slots.item),{key:1,item:t},null,8,["item"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[p.isItemDisabled(t)?(n.openBlock(),n.createElementBlock("span",n.mergeProps({key:1,class:p.linkClass(),onKeydown:e=>p.onItemKeydown(e,t)},e.ptm("action")),[n.createElementVNode("span",n.mergeProps({class:"p-steps-number"},e.ptm("step")),n.toDisplayString(s+1),17),n.createElementVNode("span",n.mergeProps({class:"p-steps-title"},e.ptm("label")),n.toDisplayString(p.label(t)),17)],16,a)):(n.openBlock(),n.createBlock(c,{key:0,to:t.to,custom:""},{default:n.withCtx((({navigate:i,href:l,isActive:a,isExactActive:r})=>[n.createElementVNode("a",n.mergeProps({href:l,class:p.linkClass({isActive:a,isExactActive:r}),tabindex:-1,"aria-current":r?"step":void 0,onClick:e=>p.onItemClick(e,t,i),onKeydown:e=>p.onItemKeydown(e,t,i)},e.ptm("action")),[n.createElementVNode("span",n.mergeProps({class:"p-steps-number"},e.ptm("step")),n.toDisplayString(s+1),17),n.createElementVNode("span",n.mergeProps({class:"p-steps-title"},e.ptm("label")),n.toDisplayString(p.label(t)),17)],16,o)])),_:2},1032,["to"]))],64))],16)):n.createCommentVNode("",!0)],64)))),128))],16)],16,l)},module.exports=i;
1
+ "use strict";var e=require("primevue/basecomponent"),t=require("primevue/utils"),n=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i={name:"Steps",extends:s(e).default,props:{id:{type:String,default:t.UniqueComponentId()},model:{type:Array,default:null},readonly:{type:Boolean,default:!0},exact:{type:Boolean,default:!0}},mounted(){this.findFirstItem().tabIndex="0"},methods:{onItemClick(e,t,n){this.disabled(t)||this.readonly?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.to&&n&&n(e))},onItemKeydown(e,t,n){switch(e.code){case"ArrowRight":this.navigateToNextItem(e.target),e.preventDefault();break;case"ArrowLeft":this.navigateToPrevItem(e.target),e.preventDefault();break;case"Home":this.navigateToFirstItem(e.target),e.preventDefault();break;case"End":this.navigateToLastItem(e.target),e.preventDefault();break;case"Tab":break;case"Enter":case"Space":this.onItemClick(e,t,n),e.preventDefault()}},navigateToNextItem(e){const t=this.findNextItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToPrevItem(e){const t=this.findPrevItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToFirstItem(e){const t=this.findFirstItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToLastItem(e){const t=this.findLastItem(e);t&&this.setFocusToMenuitem(e,t)},findNextItem(e){const t=e.parentElement.nextElementSibling;return t?t.children[0]:null},findPrevItem(e){const t=e.parentElement.previousElementSibling;return t?t.children[0]:null},findFirstItem(){const e=t.DomHandler.findSingle(this.$refs.list,".p-steps-item");return e?e.children[0]:null},findLastItem(){const e=t.DomHandler.find(this.$refs.list,".p-steps-item");return e?e[e.length-1].children[0]:null},setFocusToMenuitem(e,t){e.tabIndex="-1",t.tabIndex="0",t.focus()},isActive(e){return!!e.to&&this.$router.resolve(e.to).path===this.$route.path},getItemClass(e){return["p-steps-item",e.class,{"p-highlight p-steps-current":this.isActive(e),"p-disabled":this.isItemDisabled(e)}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},isItemDisabled(e){return this.disabled(e)||this.readonly&&!this.isActive(e)},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},computed:{containerClass(){return["p-steps p-component",{"p-readonly":this.readonly}]}}};const l=["id"],o=["href","aria-current","onClick","onKeydown"],a=["onKeydown"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n overflow: hidden;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n"),i.render=function(e,t,s,i,r,p){const c=n.resolveComponent("router-link");return n.openBlock(),n.createElementBlock("nav",n.mergeProps({id:s.id,class:p.containerClass},e.ptm("root")),[n.createElementVNode("ol",n.mergeProps({ref:"list",class:"p-steps-list"},e.ptm("menu")),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.model,((t,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:t.to},[p.visible(t)?(n.openBlock(),n.createElementBlock("li",n.mergeProps({key:0,class:p.getItemClass(t),style:t.style},e.ptm("menuitem")),[e.$slots.item?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.$slots.item),{key:1,item:t},null,8,["item"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[p.isItemDisabled(t)?(n.openBlock(),n.createElementBlock("span",n.mergeProps({key:1,class:p.linkClass(),onKeydown:e=>p.onItemKeydown(e,t)},e.ptm("action")),[n.createElementVNode("span",n.mergeProps({class:"p-steps-number"},e.ptm("step")),n.toDisplayString(s+1),17),n.createElementVNode("span",n.mergeProps({class:"p-steps-title"},e.ptm("label")),n.toDisplayString(p.label(t)),17)],16,a)):(n.openBlock(),n.createBlock(c,{key:0,to:t.to,custom:""},{default:n.withCtx((({navigate:i,href:l,isActive:a,isExactActive:r})=>[n.createElementVNode("a",n.mergeProps({href:l,class:p.linkClass({isActive:a,isExactActive:r}),tabindex:-1,"aria-current":r?"step":void 0,onClick:e=>p.onItemClick(e,t,i),onKeydown:e=>p.onItemKeydown(e,t,i)},e.ptm("action")),[n.createElementVNode("span",n.mergeProps({class:"p-steps-number"},e.ptm("step")),n.toDisplayString(s+1),17),n.createElementVNode("span",n.mergeProps({class:"p-steps-title"},e.ptm("label")),n.toDisplayString(p.label(t)),17)],16,o)])),_:2},1032,["to"]))],64))],16)):n.createCommentVNode("",!0)],64)))),128))],16)],16,l)},module.exports=i;
@@ -269,7 +269,7 @@ function styleInject(css, ref) {
269
269
  }
270
270
  }
271
271
 
272
- var css_248z = "\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n";
272
+ var css_248z = "\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n overflow: hidden;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n";
273
273
  styleInject(css_248z);
274
274
 
275
275
  script.render = render;
@@ -1 +1 @@
1
- import e from"primevue/basecomponent";import{UniqueComponentId as t,DomHandler as n}from"primevue/utils";import{resolveComponent as s,openBlock as i,createElementBlock as a,mergeProps as l,createElementVNode as o,Fragment as r,renderList as p,createBlock as m,withCtx as c,toDisplayString as d,resolveDynamicComponent as u,createCommentVNode as f}from"vue";var h={name:"Steps",extends:e,props:{id:{type:String,default:t()},model:{type:Array,default:null},readonly:{type:Boolean,default:!0},exact:{type:Boolean,default:!0}},mounted(){this.findFirstItem().tabIndex="0"},methods:{onItemClick(e,t,n){this.disabled(t)||this.readonly?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.to&&n&&n(e))},onItemKeydown(e,t,n){switch(e.code){case"ArrowRight":this.navigateToNextItem(e.target),e.preventDefault();break;case"ArrowLeft":this.navigateToPrevItem(e.target),e.preventDefault();break;case"Home":this.navigateToFirstItem(e.target),e.preventDefault();break;case"End":this.navigateToLastItem(e.target),e.preventDefault();break;case"Tab":break;case"Enter":case"Space":this.onItemClick(e,t,n),e.preventDefault()}},navigateToNextItem(e){const t=this.findNextItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToPrevItem(e){const t=this.findPrevItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToFirstItem(e){const t=this.findFirstItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToLastItem(e){const t=this.findLastItem(e);t&&this.setFocusToMenuitem(e,t)},findNextItem(e){const t=e.parentElement.nextElementSibling;return t?t.children[0]:null},findPrevItem(e){const t=e.parentElement.previousElementSibling;return t?t.children[0]:null},findFirstItem(){const e=n.findSingle(this.$refs.list,".p-steps-item");return e?e.children[0]:null},findLastItem(){const e=n.find(this.$refs.list,".p-steps-item");return e?e[e.length-1].children[0]:null},setFocusToMenuitem(e,t){e.tabIndex="-1",t.tabIndex="0",t.focus()},isActive(e){return!!e.to&&this.$router.resolve(e.to).path===this.$route.path},getItemClass(e){return["p-steps-item",e.class,{"p-highlight p-steps-current":this.isActive(e),"p-disabled":this.isItemDisabled(e)}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},isItemDisabled(e){return this.disabled(e)||this.readonly&&!this.isActive(e)},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},computed:{containerClass(){return["p-steps p-component",{"p-readonly":this.readonly}]}}};const v=["id"],y=["href","aria-current","onClick","onKeydown"],b=["onKeydown"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n"),h.render=function(e,t,n,h,I,g){const x=s("router-link");return i(),a("nav",l({id:n.id,class:g.containerClass},e.ptm("root")),[o("ol",l({ref:"list",class:"p-steps-list"},e.ptm("menu")),[(i(!0),a(r,null,p(n.model,((t,n)=>(i(),a(r,{key:t.to},[g.visible(t)?(i(),a("li",l({key:0,class:g.getItemClass(t),style:t.style},e.ptm("menuitem")),[e.$slots.item?(i(),m(u(e.$slots.item),{key:1,item:t},null,8,["item"])):(i(),a(r,{key:0},[g.isItemDisabled(t)?(i(),a("span",l({key:1,class:g.linkClass(),onKeydown:e=>g.onItemKeydown(e,t)},e.ptm("action")),[o("span",l({class:"p-steps-number"},e.ptm("step")),d(n+1),17),o("span",l({class:"p-steps-title"},e.ptm("label")),d(g.label(t)),17)],16,b)):(i(),m(x,{key:0,to:t.to,custom:""},{default:c((({navigate:s,href:i,isActive:a,isExactActive:r})=>[o("a",l({href:i,class:g.linkClass({isActive:a,isExactActive:r}),tabindex:-1,"aria-current":r?"step":void 0,onClick:e=>g.onItemClick(e,t,s),onKeydown:e=>g.onItemKeydown(e,t,s)},e.ptm("action")),[o("span",l({class:"p-steps-number"},e.ptm("step")),d(n+1),17),o("span",l({class:"p-steps-title"},e.ptm("label")),d(g.label(t)),17)],16,y)])),_:2},1032,["to"]))],64))],16)):f("",!0)],64)))),128))],16)],16,v)};export{h as default};
1
+ import e from"primevue/basecomponent";import{UniqueComponentId as t,DomHandler as n}from"primevue/utils";import{resolveComponent as s,openBlock as i,createElementBlock as l,mergeProps as a,createElementVNode as o,Fragment as r,renderList as p,createBlock as d,withCtx as m,toDisplayString as c,resolveDynamicComponent as u,createCommentVNode as f}from"vue";var h={name:"Steps",extends:e,props:{id:{type:String,default:t()},model:{type:Array,default:null},readonly:{type:Boolean,default:!0},exact:{type:Boolean,default:!0}},mounted(){this.findFirstItem().tabIndex="0"},methods:{onItemClick(e,t,n){this.disabled(t)||this.readonly?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.to&&n&&n(e))},onItemKeydown(e,t,n){switch(e.code){case"ArrowRight":this.navigateToNextItem(e.target),e.preventDefault();break;case"ArrowLeft":this.navigateToPrevItem(e.target),e.preventDefault();break;case"Home":this.navigateToFirstItem(e.target),e.preventDefault();break;case"End":this.navigateToLastItem(e.target),e.preventDefault();break;case"Tab":break;case"Enter":case"Space":this.onItemClick(e,t,n),e.preventDefault()}},navigateToNextItem(e){const t=this.findNextItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToPrevItem(e){const t=this.findPrevItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToFirstItem(e){const t=this.findFirstItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToLastItem(e){const t=this.findLastItem(e);t&&this.setFocusToMenuitem(e,t)},findNextItem(e){const t=e.parentElement.nextElementSibling;return t?t.children[0]:null},findPrevItem(e){const t=e.parentElement.previousElementSibling;return t?t.children[0]:null},findFirstItem(){const e=n.findSingle(this.$refs.list,".p-steps-item");return e?e.children[0]:null},findLastItem(){const e=n.find(this.$refs.list,".p-steps-item");return e?e[e.length-1].children[0]:null},setFocusToMenuitem(e,t){e.tabIndex="-1",t.tabIndex="0",t.focus()},isActive(e){return!!e.to&&this.$router.resolve(e.to).path===this.$route.path},getItemClass(e){return["p-steps-item",e.class,{"p-highlight p-steps-current":this.isActive(e),"p-disabled":this.isItemDisabled(e)}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},isItemDisabled(e){return this.disabled(e)||this.readonly&&!this.isActive(e)},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},computed:{containerClass(){return["p-steps p-component",{"p-readonly":this.readonly}]}}};const v=["id"],y=["href","aria-current","onClick","onKeydown"],b=["onKeydown"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n overflow: hidden;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n"),h.render=function(e,t,n,h,I,g){const x=s("router-link");return i(),l("nav",a({id:n.id,class:g.containerClass},e.ptm("root")),[o("ol",a({ref:"list",class:"p-steps-list"},e.ptm("menu")),[(i(!0),l(r,null,p(n.model,((t,n)=>(i(),l(r,{key:t.to},[g.visible(t)?(i(),l("li",a({key:0,class:g.getItemClass(t),style:t.style},e.ptm("menuitem")),[e.$slots.item?(i(),d(u(e.$slots.item),{key:1,item:t},null,8,["item"])):(i(),l(r,{key:0},[g.isItemDisabled(t)?(i(),l("span",a({key:1,class:g.linkClass(),onKeydown:e=>g.onItemKeydown(e,t)},e.ptm("action")),[o("span",a({class:"p-steps-number"},e.ptm("step")),c(n+1),17),o("span",a({class:"p-steps-title"},e.ptm("label")),c(g.label(t)),17)],16,b)):(i(),d(x,{key:0,to:t.to,custom:""},{default:m((({navigate:s,href:i,isActive:l,isExactActive:r})=>[o("a",a({href:i,class:g.linkClass({isActive:l,isExactActive:r}),tabindex:-1,"aria-current":r?"step":void 0,onClick:e=>g.onItemClick(e,t,s),onKeydown:e=>g.onItemKeydown(e,t,s)},e.ptm("action")),[o("span",a({class:"p-steps-number"},e.ptm("step")),c(n+1),17),o("span",a({class:"p-steps-title"},e.ptm("label")),c(g.label(t)),17)],16,y)])),_:2},1032,["to"]))],64))],16)):f("",!0)],64)))),128))],16)],16,v)};export{h as default};
package/steps/steps.js CHANGED
@@ -273,7 +273,7 @@ this.primevue.steps = (function (BaseComponent, utils, vue) {
273
273
  }
274
274
  }
275
275
 
276
- var css_248z = "\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n";
276
+ var css_248z = "\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n overflow: hidden;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n";
277
277
  styleInject(css_248z);
278
278
 
279
279
  script.render = render;
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.steps=function(e,t,n){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i={name:"Steps",extends:s(e).default,props:{id:{type:String,default:t.UniqueComponentId()},model:{type:Array,default:null},readonly:{type:Boolean,default:!0},exact:{type:Boolean,default:!0}},mounted(){this.findFirstItem().tabIndex="0"},methods:{onItemClick(e,t,n){this.disabled(t)||this.readonly?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.to&&n&&n(e))},onItemKeydown(e,t,n){switch(e.code){case"ArrowRight":this.navigateToNextItem(e.target),e.preventDefault();break;case"ArrowLeft":this.navigateToPrevItem(e.target),e.preventDefault();break;case"Home":this.navigateToFirstItem(e.target),e.preventDefault();break;case"End":this.navigateToLastItem(e.target),e.preventDefault();break;case"Tab":break;case"Enter":case"Space":this.onItemClick(e,t,n),e.preventDefault()}},navigateToNextItem(e){const t=this.findNextItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToPrevItem(e){const t=this.findPrevItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToFirstItem(e){const t=this.findFirstItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToLastItem(e){const t=this.findLastItem(e);t&&this.setFocusToMenuitem(e,t)},findNextItem(e){const t=e.parentElement.nextElementSibling;return t?t.children[0]:null},findPrevItem(e){const t=e.parentElement.previousElementSibling;return t?t.children[0]:null},findFirstItem(){const e=t.DomHandler.findSingle(this.$refs.list,".p-steps-item");return e?e.children[0]:null},findLastItem(){const e=t.DomHandler.find(this.$refs.list,".p-steps-item");return e?e[e.length-1].children[0]:null},setFocusToMenuitem(e,t){e.tabIndex="-1",t.tabIndex="0",t.focus()},isActive(e){return!!e.to&&this.$router.resolve(e.to).path===this.$route.path},getItemClass(e){return["p-steps-item",e.class,{"p-highlight p-steps-current":this.isActive(e),"p-disabled":this.isItemDisabled(e)}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},isItemDisabled(e){return this.disabled(e)||this.readonly&&!this.isActive(e)},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},computed:{containerClass(){return["p-steps p-component",{"p-readonly":this.readonly}]}}};const l=["id"],o=["href","aria-current","onClick","onKeydown"],a=["onKeydown"];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n"),i.render=function(e,t,s,i,r,p){const c=n.resolveComponent("router-link");return n.openBlock(),n.createElementBlock("nav",n.mergeProps({id:s.id,class:p.containerClass},e.ptm("root")),[n.createElementVNode("ol",n.mergeProps({ref:"list",class:"p-steps-list"},e.ptm("menu")),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.model,((t,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:t.to},[p.visible(t)?(n.openBlock(),n.createElementBlock("li",n.mergeProps({key:0,class:p.getItemClass(t),style:t.style},e.ptm("menuitem")),[e.$slots.item?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.$slots.item),{key:1,item:t},null,8,["item"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[p.isItemDisabled(t)?(n.openBlock(),n.createElementBlock("span",n.mergeProps({key:1,class:p.linkClass(),onKeydown:e=>p.onItemKeydown(e,t)},e.ptm("action")),[n.createElementVNode("span",n.mergeProps({class:"p-steps-number"},e.ptm("step")),n.toDisplayString(s+1),17),n.createElementVNode("span",n.mergeProps({class:"p-steps-title"},e.ptm("label")),n.toDisplayString(p.label(t)),17)],16,a)):(n.openBlock(),n.createBlock(c,{key:0,to:t.to,custom:""},{default:n.withCtx((({navigate:i,href:l,isActive:a,isExactActive:r})=>[n.createElementVNode("a",n.mergeProps({href:l,class:p.linkClass({isActive:a,isExactActive:r}),tabindex:-1,"aria-current":r?"step":void 0,onClick:e=>p.onItemClick(e,t,i),onKeydown:e=>p.onItemKeydown(e,t,i)},e.ptm("action")),[n.createElementVNode("span",n.mergeProps({class:"p-steps-number"},e.ptm("step")),n.toDisplayString(s+1),17),n.createElementVNode("span",n.mergeProps({class:"p-steps-title"},e.ptm("label")),n.toDisplayString(p.label(t)),17)],16,o)])),_:2},1032,["to"]))],64))],16)):n.createCommentVNode("",!0)],64)))),128))],16)],16,l)},i}(primevue.basecomponent,primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.steps=function(e,t,n){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i={name:"Steps",extends:s(e).default,props:{id:{type:String,default:t.UniqueComponentId()},model:{type:Array,default:null},readonly:{type:Boolean,default:!0},exact:{type:Boolean,default:!0}},mounted(){this.findFirstItem().tabIndex="0"},methods:{onItemClick(e,t,n){this.disabled(t)||this.readonly?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.to&&n&&n(e))},onItemKeydown(e,t,n){switch(e.code){case"ArrowRight":this.navigateToNextItem(e.target),e.preventDefault();break;case"ArrowLeft":this.navigateToPrevItem(e.target),e.preventDefault();break;case"Home":this.navigateToFirstItem(e.target),e.preventDefault();break;case"End":this.navigateToLastItem(e.target),e.preventDefault();break;case"Tab":break;case"Enter":case"Space":this.onItemClick(e,t,n),e.preventDefault()}},navigateToNextItem(e){const t=this.findNextItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToPrevItem(e){const t=this.findPrevItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToFirstItem(e){const t=this.findFirstItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToLastItem(e){const t=this.findLastItem(e);t&&this.setFocusToMenuitem(e,t)},findNextItem(e){const t=e.parentElement.nextElementSibling;return t?t.children[0]:null},findPrevItem(e){const t=e.parentElement.previousElementSibling;return t?t.children[0]:null},findFirstItem(){const e=t.DomHandler.findSingle(this.$refs.list,".p-steps-item");return e?e.children[0]:null},findLastItem(){const e=t.DomHandler.find(this.$refs.list,".p-steps-item");return e?e[e.length-1].children[0]:null},setFocusToMenuitem(e,t){e.tabIndex="-1",t.tabIndex="0",t.focus()},isActive(e){return!!e.to&&this.$router.resolve(e.to).path===this.$route.path},getItemClass(e){return["p-steps-item",e.class,{"p-highlight p-steps-current":this.isActive(e),"p-disabled":this.isItemDisabled(e)}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},isItemDisabled(e){return this.disabled(e)||this.readonly&&!this.isActive(e)},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},computed:{containerClass(){return["p-steps p-component",{"p-readonly":this.readonly}]}}};const l=["id"],o=["href","aria-current","onClick","onKeydown"],a=["onKeydown"];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-steps {\n position: relative;\n}\n.p-steps .p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n overflow: hidden;\n}\n.p-steps-item .p-menuitem-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n}\n.p-steps.p-steps-readonly .p-steps-item {\n cursor: auto;\n}\n.p-steps-item.p-steps-current .p-menuitem-link {\n cursor: default;\n}\n.p-steps-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n.p-steps-number {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-steps-title {\n display: block;\n}\n"),i.render=function(e,t,s,i,r,p){const c=n.resolveComponent("router-link");return n.openBlock(),n.createElementBlock("nav",n.mergeProps({id:s.id,class:p.containerClass},e.ptm("root")),[n.createElementVNode("ol",n.mergeProps({ref:"list",class:"p-steps-list"},e.ptm("menu")),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.model,((t,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:t.to},[p.visible(t)?(n.openBlock(),n.createElementBlock("li",n.mergeProps({key:0,class:p.getItemClass(t),style:t.style},e.ptm("menuitem")),[e.$slots.item?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.$slots.item),{key:1,item:t},null,8,["item"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[p.isItemDisabled(t)?(n.openBlock(),n.createElementBlock("span",n.mergeProps({key:1,class:p.linkClass(),onKeydown:e=>p.onItemKeydown(e,t)},e.ptm("action")),[n.createElementVNode("span",n.mergeProps({class:"p-steps-number"},e.ptm("step")),n.toDisplayString(s+1),17),n.createElementVNode("span",n.mergeProps({class:"p-steps-title"},e.ptm("label")),n.toDisplayString(p.label(t)),17)],16,a)):(n.openBlock(),n.createBlock(c,{key:0,to:t.to,custom:""},{default:n.withCtx((({navigate:i,href:l,isActive:a,isExactActive:r})=>[n.createElementVNode("a",n.mergeProps({href:l,class:p.linkClass({isActive:a,isExactActive:r}),tabindex:-1,"aria-current":r?"step":void 0,onClick:e=>p.onItemClick(e,t,i),onKeydown:e=>p.onItemKeydown(e,t,i)},e.ptm("action")),[n.createElementVNode("span",n.mergeProps({class:"p-steps-number"},e.ptm("step")),n.toDisplayString(s+1),17),n.createElementVNode("span",n.mergeProps({class:"p-steps-title"},e.ptm("label")),n.toDisplayString(p.label(t)),17)],16,o)])),_:2},1032,["to"]))],64))],16)):n.createCommentVNode("",!0)],64)))),128))],16)],16,l)},i}(primevue.basecomponent,primevue.utils,Vue);
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="p-tabmenu p-component" v-bind="ptm('root')">
3
3
  <ul ref="nav" class="p-tabmenu-nav p-reset" role="menubar" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('menu')">
4
- <template v-for="(item, i) of model" :key="label(item) + '_' + i.toString()">
4
+ <template v-for="(item, i) of focusableItems" :key="label(item) + '_' + i.toString()">
5
5
  <router-link v-if="item.to && !disabled(item)" v-slot="{ navigate, href, isActive, isExactActive }" :to="item.to" custom>
6
6
  <li v-if="visible(item)" ref="tab" :class="getRouteItemClass(item, isActive, isExactActive)" :style="item.style" role="presentation" v-bind="getPTOptions('menuitem', i)">
7
7
  <template v-if="!$slots.item">
@@ -15,7 +15,7 @@
15
15
  :aria-disabled="disabled(item)"
16
16
  :tabindex="isExactActive ? '0' : '-1'"
17
17
  @click="onItemClick($event, item, i, navigate)"
18
- @keydown="onKeydownItem($event, item, i, navigate)"
18
+ @keydown="onKeydownItem($event, i, navigate)"
19
19
  v-bind="getPTOptions('action', i)"
20
20
  >
21
21
  <component v-if="$slots.itemicon" :is="$slots.itemicon" :item="item" :class="getItemIcon(item)" />
@@ -26,7 +26,7 @@
26
26
  <component v-else :is="$slots.item" :item="item" :index="i"></component>
27
27
  </li>
28
28
  </router-link>
29
- <li v-else-if="visible(item)" ref="tab" :class="getItemClass(item, i)" role="presentation" @click="onItemClick($event, item, i)" @keydown="onKeydownItem($event, item, i)" v-bind="getPTOptions('menuitem', i)">
29
+ <li v-else-if="visible(item)" ref="tab" :class="getItemClass(item, i)" role="presentation" @click="onItemClick($event, item, i)" @keydown="onKeydownItem($event, i)" v-bind="getPTOptions('menuitem', i)">
30
30
  <template v-if="!$slots.item">
31
31
  <a ref="tabLink" v-ripple role="menuitem" :href="item.url" class="p-menuitem-link" :target="item.target" :aria-label="label(item)" :aria-disabled="disabled(item)" :tabindex="setTabIndex(i)" v-bind="getPTOptions('action', i)">
32
32
  <component v-if="$slots.itemicon" :is="$slots.itemicon" :item="item" :class="getItemIcon(item)" />
@@ -132,7 +132,7 @@ export default {
132
132
  index: index
133
133
  });
134
134
  },
135
- onKeydownItem(event, item, index) {
135
+ onKeydownItem(event, index) {
136
136
  let i = index;
137
137
 
138
138
  let foundElement = {};
@@ -282,6 +282,15 @@ export default {
282
282
  }
283
283
  }
284
284
  },
285
+ computed: {
286
+ focusableItems() {
287
+ return (this.model || []).reduce((result, item) => {
288
+ this.visible(item) && !DomHandler.hasClass(item, 'p-disabled') && result.push(item);
289
+
290
+ return result;
291
+ }, []);
292
+ }
293
+ },
285
294
  directives: {
286
295
  ripple: Ripple
287
296
  }