primevue 3.18.1 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +11 -3
  2. package/calendar/Calendar.vue +1 -1
  3. package/calendar/calendar.cjs.js +1 -1
  4. package/calendar/calendar.cjs.min.js +1 -1
  5. package/calendar/calendar.esm.js +1 -1
  6. package/calendar/calendar.esm.min.js +1 -1
  7. package/calendar/calendar.js +1 -1
  8. package/calendar/calendar.min.js +1 -1
  9. package/chips/Chips.d.ts +2 -2
  10. package/chips/Chips.vue +6 -2
  11. package/chips/chips.cjs.js +6 -2
  12. package/chips/chips.cjs.min.js +1 -1
  13. package/chips/chips.esm.js +6 -2
  14. package/chips/chips.esm.min.js +1 -1
  15. package/chips/chips.js +6 -2
  16. package/chips/chips.min.js +1 -1
  17. package/confirmdialog/ConfirmDialog.vue +6 -1
  18. package/confirmdialog/confirmdialog.cjs.js +7 -1
  19. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  20. package/confirmdialog/confirmdialog.esm.js +7 -1
  21. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  22. package/confirmdialog/confirmdialog.js +7 -1
  23. package/confirmdialog/confirmdialog.min.js +1 -1
  24. package/confirmpopup/ConfirmPopup.vue +59 -5
  25. package/confirmpopup/confirmpopup.cjs.js +83 -19
  26. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  27. package/confirmpopup/confirmpopup.esm.js +82 -19
  28. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  29. package/confirmpopup/confirmpopup.js +82 -19
  30. package/confirmpopup/confirmpopup.min.js +1 -1
  31. package/core/core.js +244 -69
  32. package/core/core.min.js +7 -5
  33. package/datatable/DataTable.d.ts +1 -1
  34. package/datatable/DataTable.vue +1 -1
  35. package/datatable/HeaderCell.vue +1 -1
  36. package/datatable/TableBody.vue +1 -1
  37. package/datatable/TableHeader.vue +1 -1
  38. package/datatable/datatable.cjs.js +4 -4
  39. package/datatable/datatable.cjs.min.js +1 -1
  40. package/datatable/datatable.esm.js +4 -4
  41. package/datatable/datatable.esm.min.js +1 -1
  42. package/datatable/datatable.js +4 -4
  43. package/datatable/datatable.min.js +1 -1
  44. package/dialog/Dialog.d.ts +4 -5
  45. package/dialog/Dialog.vue +95 -44
  46. package/dialog/dialog.cjs.js +123 -62
  47. package/dialog/dialog.cjs.min.js +1 -1
  48. package/dialog/dialog.esm.js +123 -63
  49. package/dialog/dialog.esm.min.js +1 -1
  50. package/dialog/dialog.js +124 -64
  51. package/dialog/dialog.min.js +1 -1
  52. package/focustrap/FocusTrap.d.ts +5 -0
  53. package/focustrap/focustrap.cjs.js +94 -0
  54. package/focustrap/focustrap.cjs.min.js +1 -0
  55. package/focustrap/focustrap.esm.js +92 -0
  56. package/focustrap/focustrap.esm.min.js +1 -0
  57. package/focustrap/focustrap.js +96 -0
  58. package/focustrap/focustrap.min.js +1 -0
  59. package/focustrap/package.json +6 -0
  60. package/megamenu/MegaMenu.vue +3 -2
  61. package/megamenu/megamenu.cjs.js +3 -2
  62. package/megamenu/megamenu.cjs.min.js +1 -1
  63. package/megamenu/megamenu.esm.js +3 -2
  64. package/megamenu/megamenu.esm.min.js +1 -1
  65. package/megamenu/megamenu.js +3 -2
  66. package/megamenu/megamenu.min.js +1 -1
  67. package/menu/Menu.vue +2 -2
  68. package/menu/menu.cjs.js +2 -2
  69. package/menu/menu.cjs.min.js +1 -1
  70. package/menu/menu.esm.js +2 -2
  71. package/menu/menu.esm.min.js +1 -1
  72. package/menu/menu.js +2 -2
  73. package/menu/menu.min.js +1 -1
  74. package/menubar/Menubar.vue +1 -0
  75. package/menubar/menubar.cjs.js +16 -13
  76. package/menubar/menubar.cjs.min.js +1 -1
  77. package/menubar/menubar.esm.js +16 -13
  78. package/menubar/menubar.esm.min.js +1 -1
  79. package/menubar/menubar.js +16 -13
  80. package/menubar/menubar.min.js +1 -1
  81. package/overlaypanel/OverlayPanel.vue +31 -5
  82. package/overlaypanel/overlaypanel.cjs.js +49 -17
  83. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  84. package/overlaypanel/overlaypanel.esm.js +48 -17
  85. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  86. package/overlaypanel/overlaypanel.js +48 -17
  87. package/overlaypanel/overlaypanel.min.js +1 -1
  88. package/package.json +1 -1
  89. package/resources/primevue.css +4 -2
  90. package/resources/primevue.min.css +1 -1
  91. package/sidebar/Sidebar.d.ts +0 -5
  92. package/sidebar/Sidebar.vue +39 -11
  93. package/sidebar/sidebar.cjs.js +62 -23
  94. package/sidebar/sidebar.cjs.min.js +1 -1
  95. package/sidebar/sidebar.esm.js +62 -24
  96. package/sidebar/sidebar.esm.min.js +1 -1
  97. package/sidebar/sidebar.js +63 -25
  98. package/sidebar/sidebar.min.js +1 -1
  99. package/slider/Slider.vue +2 -2
  100. package/slider/slider.cjs.js +2 -2
  101. package/slider/slider.cjs.min.js +1 -1
  102. package/slider/slider.esm.js +2 -2
  103. package/slider/slider.esm.min.js +1 -1
  104. package/slider/slider.js +2 -2
  105. package/slider/slider.min.js +1 -1
  106. package/splitter/Splitter.d.ts +16 -0
  107. package/splitter/Splitter.vue +2 -1
  108. package/splitter/splitter.cjs.js +2 -1
  109. package/splitter/splitter.cjs.min.js +1 -1
  110. package/splitter/splitter.esm.js +2 -1
  111. package/splitter/splitter.esm.min.js +1 -1
  112. package/splitter/splitter.js +2 -1
  113. package/splitter/splitter.min.js +1 -1
  114. package/tieredmenu/TieredMenu.vue +1 -2
  115. package/tieredmenu/tieredmenu.cjs.js +1 -2
  116. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  117. package/tieredmenu/tieredmenu.esm.js +1 -2
  118. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  119. package/tieredmenu/tieredmenu.js +1 -2
  120. package/tieredmenu/tieredmenu.min.js +1 -1
  121. package/tooltip/tooltip.cjs.js +14 -1
  122. package/tooltip/tooltip.cjs.min.js +1 -1
  123. package/tooltip/tooltip.esm.js +14 -1
  124. package/tooltip/tooltip.esm.min.js +1 -1
  125. package/tooltip/tooltip.js +14 -1
  126. package/tooltip/tooltip.min.js +1 -1
  127. package/utils/Utils.d.ts +1 -0
  128. package/utils/utils.cjs.js +6 -0
  129. package/utils/utils.cjs.min.js +1 -1
  130. package/utils/utils.esm.js +6 -0
  131. package/utils/utils.esm.min.js +1 -1
  132. package/utils/utils.js +6 -0
  133. package/utils/utils.min.js +1 -1
  134. package/vetur-attributes.json +6 -10
  135. package/vetur-tags.json +2 -3
  136. package/web-types.json +55 -23
@@ -36,6 +36,11 @@ var script = {
36
36
 
37
37
  if (options.group === this.group) {
38
38
  this.confirmation = options;
39
+
40
+ if (this.confirmation.onShow) {
41
+ this.confirmation.onShow();
42
+ }
43
+
39
44
  this.visible = true;
40
45
  }
41
46
  };
@@ -137,11 +142,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
137
142
  _cache[2] || (_cache[2] = $event => (($data.visible) = $event)),
138
143
  $options.onHide
139
144
  ],
145
+ role: "alertdialog",
146
+ class: "p-confirm-dialog",
140
147
  modal: true,
141
148
  header: $options.header,
142
149
  blockScroll: $options.blockScroll,
143
150
  position: $options.position,
144
- class: "p-confirm-dialog",
145
151
  breakpoints: $props.breakpoints,
146
152
  closeOnEscape: $options.closeOnEscape
147
153
  }, {
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/button"),o=require("primevue/confirmationeventbus"),i=require("primevue/dialog"),t=require("vue");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(e),s=n(o),r={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},s.default.on("confirm",this.confirmListener),s.default.on("close",this.closeListener)},beforeUnmount(){s.default.off("confirm",this.confirmListener),s.default.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:n(i).default,CDButton:c.default}};const a={class:"p-confirm-dialog-message"};r.render=function(e,o,i,n,c,s){const r=t.resolveComponent("CDButton"),l=t.resolveComponent("CDialog");return t.openBlock(),t.createBlock(l,{visible:c.visible,"onUpdate:visible":[o[2]||(o[2]=e=>c.visible=e),s.onHide],modal:!0,header:s.header,blockScroll:s.blockScroll,position:s.position,class:"p-confirm-dialog",breakpoints:i.breakpoints,closeOnEscape:s.closeOnEscape},{footer:t.withCtx((()=>[t.createVNode(r,{label:s.rejectLabel,icon:s.rejectIcon,class:t.normalizeClass(s.rejectClass),onClick:o[0]||(o[0]=e=>s.reject()),autofocus:s.autoFocusReject},null,8,["label","icon","class","autofocus"]),t.createVNode(r,{label:s.acceptLabel,icon:s.acceptIcon,class:t.normalizeClass(s.acceptClass),onClick:o[1]||(o[1]=e=>s.accept()),autofocus:s.autoFocusAccept},null,8,["label","icon","class","autofocus"])])),default:t.withCtx((()=>[e.$slots.message?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("i",{class:t.normalizeClass(s.iconClass)},null,2),t.createElementVNode("span",a,t.toDisplayString(s.message),1)],64))])),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","onUpdate:visible"])},module.exports=r;
1
+ "use strict";var e=require("primevue/button"),o=require("primevue/confirmationeventbus"),i=require("primevue/dialog"),t=require("vue");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(e),s=n(o),r={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},s.default.on("confirm",this.confirmListener),s.default.on("close",this.closeListener)},beforeUnmount(){s.default.off("confirm",this.confirmListener),s.default.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:n(i).default,CDButton:c.default}};const a={class:"p-confirm-dialog-message"};r.render=function(e,o,i,n,c,s){const r=t.resolveComponent("CDButton"),l=t.resolveComponent("CDialog");return t.openBlock(),t.createBlock(l,{visible:c.visible,"onUpdate:visible":[o[2]||(o[2]=e=>c.visible=e),s.onHide],role:"alertdialog",class:"p-confirm-dialog",modal:!0,header:s.header,blockScroll:s.blockScroll,position:s.position,breakpoints:i.breakpoints,closeOnEscape:s.closeOnEscape},{footer:t.withCtx((()=>[t.createVNode(r,{label:s.rejectLabel,icon:s.rejectIcon,class:t.normalizeClass(s.rejectClass),onClick:o[0]||(o[0]=e=>s.reject()),autofocus:s.autoFocusReject},null,8,["label","icon","class","autofocus"]),t.createVNode(r,{label:s.acceptLabel,icon:s.acceptIcon,class:t.normalizeClass(s.acceptClass),onClick:o[1]||(o[1]=e=>s.accept()),autofocus:s.autoFocusAccept},null,8,["label","icon","class","autofocus"])])),default:t.withCtx((()=>[e.$slots.message?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("i",{class:t.normalizeClass(s.iconClass)},null,2),t.createElementVNode("span",a,t.toDisplayString(s.message),1)],64))])),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","onUpdate:visible"])},module.exports=r;
@@ -28,6 +28,11 @@ var script = {
28
28
 
29
29
  if (options.group === this.group) {
30
30
  this.confirmation = options;
31
+
32
+ if (this.confirmation.onShow) {
33
+ this.confirmation.onShow();
34
+ }
35
+
31
36
  this.visible = true;
32
37
  }
33
38
  };
@@ -129,11 +134,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
129
134
  _cache[2] || (_cache[2] = $event => (($data.visible) = $event)),
130
135
  $options.onHide
131
136
  ],
137
+ role: "alertdialog",
138
+ class: "p-confirm-dialog",
132
139
  modal: true,
133
140
  header: $options.header,
134
141
  blockScroll: $options.blockScroll,
135
142
  position: $options.position,
136
- class: "p-confirm-dialog",
137
143
  breakpoints: $props.breakpoints,
138
144
  closeOnEscape: $options.closeOnEscape
139
145
  }, {
@@ -1 +1 @@
1
- import i from"primevue/button";import o from"primevue/confirmationeventbus";import t from"primevue/dialog";import{resolveComponent as e,openBlock as n,createBlock as c,withCtx as s,createVNode as r,normalizeClass as a,createElementBlock as l,Fragment as m,createElementVNode as u,toDisplayString as f,resolveDynamicComponent as p}from"vue";var h={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=i=>{i&&i.group===this.group&&(this.confirmation=i,this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},o.on("confirm",this.confirmListener),o.on("close",this.closeListener)},beforeUnmount(){o.off("confirm",this.confirmListener),o.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:t,CDButton:i}};const b={class:"p-confirm-dialog-message"};h.render=function(i,o,t,h,d,g){const v=e("CDButton"),j=e("CDialog");return n(),c(j,{visible:d.visible,"onUpdate:visible":[o[2]||(o[2]=i=>d.visible=i),g.onHide],modal:!0,header:g.header,blockScroll:g.blockScroll,position:g.position,class:"p-confirm-dialog",breakpoints:t.breakpoints,closeOnEscape:g.closeOnEscape},{footer:s((()=>[r(v,{label:g.rejectLabel,icon:g.rejectIcon,class:a(g.rejectClass),onClick:o[0]||(o[0]=i=>g.reject()),autofocus:g.autoFocusReject},null,8,["label","icon","class","autofocus"]),r(v,{label:g.acceptLabel,icon:g.acceptIcon,class:a(g.acceptClass),onClick:o[1]||(o[1]=i=>g.accept()),autofocus:g.autoFocusAccept},null,8,["label","icon","class","autofocus"])])),default:s((()=>[i.$slots.message?(n(),c(p(i.$slots.message),{key:1,message:d.confirmation},null,8,["message"])):(n(),l(m,{key:0},[u("i",{class:a(g.iconClass)},null,2),u("span",b,f(g.message),1)],64))])),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","onUpdate:visible"])};export{h as default};
1
+ import i from"primevue/button";import o from"primevue/confirmationeventbus";import t from"primevue/dialog";import{resolveComponent as e,openBlock as n,createBlock as c,withCtx as s,createVNode as r,normalizeClass as a,createElementBlock as l,Fragment as m,createElementVNode as u,toDisplayString as f,resolveDynamicComponent as h}from"vue";var p={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=i=>{i&&i.group===this.group&&(this.confirmation=i,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},o.on("confirm",this.confirmListener),o.on("close",this.closeListener)},beforeUnmount(){o.off("confirm",this.confirmListener),o.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:t,CDButton:i}};const b={class:"p-confirm-dialog-message"};p.render=function(i,o,t,p,d,g){const v=e("CDButton"),j=e("CDialog");return n(),c(j,{visible:d.visible,"onUpdate:visible":[o[2]||(o[2]=i=>d.visible=i),g.onHide],role:"alertdialog",class:"p-confirm-dialog",modal:!0,header:g.header,blockScroll:g.blockScroll,position:g.position,breakpoints:t.breakpoints,closeOnEscape:g.closeOnEscape},{footer:s((()=>[r(v,{label:g.rejectLabel,icon:g.rejectIcon,class:a(g.rejectClass),onClick:o[0]||(o[0]=i=>g.reject()),autofocus:g.autoFocusReject},null,8,["label","icon","class","autofocus"]),r(v,{label:g.acceptLabel,icon:g.acceptIcon,class:a(g.acceptClass),onClick:o[1]||(o[1]=i=>g.accept()),autofocus:g.autoFocusAccept},null,8,["label","icon","class","autofocus"])])),default:s((()=>[i.$slots.message?(n(),c(h(i.$slots.message),{key:1,message:d.confirmation},null,8,["message"])):(n(),l(m,{key:0},[u("i",{class:a(g.iconClass)},null,2),u("span",b,f(g.message),1)],64))])),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","onUpdate:visible"])};export{p as default};
@@ -33,6 +33,11 @@ this.primevue.confirmdialog = (function (Button, ConfirmationEventBus, Dialog, v
33
33
 
34
34
  if (options.group === this.group) {
35
35
  this.confirmation = options;
36
+
37
+ if (this.confirmation.onShow) {
38
+ this.confirmation.onShow();
39
+ }
40
+
36
41
  this.visible = true;
37
42
  }
38
43
  };
@@ -134,11 +139,12 @@ this.primevue.confirmdialog = (function (Button, ConfirmationEventBus, Dialog, v
134
139
  _cache[2] || (_cache[2] = $event => (($data.visible) = $event)),
135
140
  $options.onHide
136
141
  ],
142
+ role: "alertdialog",
143
+ class: "p-confirm-dialog",
137
144
  modal: true,
138
145
  header: $options.header,
139
146
  blockScroll: $options.blockScroll,
140
147
  position: $options.position,
141
- class: "p-confirm-dialog",
142
148
  breakpoints: $props.breakpoints,
143
149
  closeOnEscape: $options.closeOnEscape
144
150
  }, {
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.confirmdialog=function(e,i,o,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(e),s=n(i),a={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},s.default.on("confirm",this.confirmListener),s.default.on("close",this.closeListener)},beforeUnmount(){s.default.off("confirm",this.confirmListener),s.default.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:n(o).default,CDButton:c.default}};const r={class:"p-confirm-dialog-message"};return a.render=function(e,i,o,n,c,s){const a=t.resolveComponent("CDButton"),l=t.resolveComponent("CDialog");return t.openBlock(),t.createBlock(l,{visible:c.visible,"onUpdate:visible":[i[2]||(i[2]=e=>c.visible=e),s.onHide],modal:!0,header:s.header,blockScroll:s.blockScroll,position:s.position,class:"p-confirm-dialog",breakpoints:o.breakpoints,closeOnEscape:s.closeOnEscape},{footer:t.withCtx((()=>[t.createVNode(a,{label:s.rejectLabel,icon:s.rejectIcon,class:t.normalizeClass(s.rejectClass),onClick:i[0]||(i[0]=e=>s.reject()),autofocus:s.autoFocusReject},null,8,["label","icon","class","autofocus"]),t.createVNode(a,{label:s.acceptLabel,icon:s.acceptIcon,class:t.normalizeClass(s.acceptClass),onClick:i[1]||(i[1]=e=>s.accept()),autofocus:s.autoFocusAccept},null,8,["label","icon","class","autofocus"])])),default:t.withCtx((()=>[e.$slots.message?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("i",{class:t.normalizeClass(s.iconClass)},null,2),t.createElementVNode("span",r,t.toDisplayString(s.message),1)],64))])),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","onUpdate:visible"])},a}(primevue.button,primevue.confirmationeventbus,primevue.dialog,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.confirmdialog=function(e,o,i,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(e),s=n(o),a={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},s.default.on("confirm",this.confirmListener),s.default.on("close",this.closeListener)},beforeUnmount(){s.default.off("confirm",this.confirmListener),s.default.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:n(i).default,CDButton:c.default}};const r={class:"p-confirm-dialog-message"};return a.render=function(e,o,i,n,c,s){const a=t.resolveComponent("CDButton"),l=t.resolveComponent("CDialog");return t.openBlock(),t.createBlock(l,{visible:c.visible,"onUpdate:visible":[o[2]||(o[2]=e=>c.visible=e),s.onHide],role:"alertdialog",class:"p-confirm-dialog",modal:!0,header:s.header,blockScroll:s.blockScroll,position:s.position,breakpoints:i.breakpoints,closeOnEscape:s.closeOnEscape},{footer:t.withCtx((()=>[t.createVNode(a,{label:s.rejectLabel,icon:s.rejectIcon,class:t.normalizeClass(s.rejectClass),onClick:o[0]||(o[0]=e=>s.reject()),autofocus:s.autoFocusReject},null,8,["label","icon","class","autofocus"]),t.createVNode(a,{label:s.acceptLabel,icon:s.acceptIcon,class:t.normalizeClass(s.acceptClass),onClick:o[1]||(o[1]=e=>s.accept()),autofocus:s.autoFocusAccept},null,8,["label","icon","class","autofocus"])])),default:t.withCtx((()=>[e.$slots.message?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("i",{class:t.normalizeClass(s.iconClass)},null,2),t.createElementVNode("span",r,t.toDisplayString(s.message),1)],64))])),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","onUpdate:visible"])},a}(primevue.button,primevue.confirmationeventbus,primevue.dialog,Vue);
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <Portal>
3
3
  <transition name="p-confirm-popup" @enter="onEnter" @leave="onLeave" @after-leave="onAfterLeave">
4
- <div v-if="visible" :ref="containerRef" :class="containerClass" v-bind="$attrs" @click="onOverlayClick">
4
+ <div v-if="visible" :ref="containerRef" v-focustrap role="alertdialog" :class="containerClass" :aria-modal="visible" @click="onOverlayClick" @keydown="onOverlayKeydown" v-bind="$attrs">
5
5
  <template v-if="!$slots.message">
6
6
  <div class="p-confirm-popup-content">
7
7
  <i :class="iconClass" />
@@ -10,8 +10,8 @@
10
10
  </template>
11
11
  <component v-else :is="$slots.message" :message="confirmation"></component>
12
12
  <div class="p-confirm-popup-footer">
13
- <CPButton :label="rejectLabel" :icon="rejectIcon" :class="rejectClass" @click="reject()" />
14
- <CPButton :label="acceptLabel" :icon="acceptIcon" :class="acceptClass" @click="accept()" autofocus />
13
+ <CPButton :label="rejectLabel" :icon="rejectIcon" :class="rejectClass" @click="reject()" @keydown="onRejectKeydown" :autofocus="autoFocusReject" />
14
+ <CPButton :label="acceptLabel" :icon="acceptIcon" :class="acceptClass" @click="accept()" @keydown="onAcceptKeydown" :autofocus="autoFocusAccept" />
15
15
  </div>
16
16
  </div>
17
17
  </transition>
@@ -19,11 +19,12 @@
19
19
  </template>
20
20
 
21
21
  <script>
22
+ import Button from 'primevue/button';
22
23
  import ConfirmationEventBus from 'primevue/confirmationeventbus';
23
- import { ConnectedOverlayScrollHandler, DomHandler, ZIndexUtils } from 'primevue/utils';
24
+ import FocusTrap from 'primevue/focustrap';
24
25
  import OverlayEventBus from 'primevue/overlayeventbus';
25
- import Button from 'primevue/button';
26
26
  import Portal from 'primevue/portal';
27
+ import { ConnectedOverlayScrollHandler, DomHandler, ZIndexUtils } from 'primevue/utils';
27
28
 
28
29
  export default {
29
30
  name: 'ConfirmPopup',
@@ -53,6 +54,11 @@ export default {
53
54
  if (options.group === this.group) {
54
55
  this.confirmation = options;
55
56
  this.target = options.target;
57
+
58
+ if (this.confirmation.onShow) {
59
+ this.confirmation.onShow();
60
+ }
61
+
56
62
  this.visible = true;
57
63
  }
58
64
  };
@@ -101,7 +107,29 @@ export default {
101
107
 
102
108
  this.visible = false;
103
109
  },
110
+ onHide() {
111
+ if (this.confirmation.onHide) {
112
+ this.confirmation.onHide();
113
+ }
114
+
115
+ this.visible = false;
116
+ },
117
+ onAcceptKeydown(event) {
118
+ if (event.code === 'Space' || event.code === 'Enter') {
119
+ this.accept();
120
+ DomHandler.focus(this.target);
121
+ event.preventDefault();
122
+ }
123
+ },
124
+ onRejectKeydown(event) {
125
+ if (event.code === 'Space' || event.code === 'Enter') {
126
+ this.reject();
127
+ DomHandler.focus(this.target);
128
+ event.preventDefault();
129
+ }
130
+ },
104
131
  onEnter(el) {
132
+ this.focus();
105
133
  this.bindOutsideClickListener();
106
134
  this.bindScrollListener();
107
135
  this.bindResizeListener();
@@ -137,6 +165,10 @@ export default {
137
165
  if (!this.outsideClickListener) {
138
166
  this.outsideClickListener = (event) => {
139
167
  if (this.visible && this.container && !this.container.contains(event.target) && !this.isTargetClicked(event)) {
168
+ if (this.confirmation.onHide) {
169
+ this.confirmation.onHide();
170
+ }
171
+
140
172
  this.visible = false;
141
173
  } else {
142
174
  this.alignOverlay();
@@ -185,6 +217,13 @@ export default {
185
217
  this.resizeListener = null;
186
218
  }
187
219
  },
220
+ focus() {
221
+ let focusTarget = this.container.querySelector('[autofocus]');
222
+
223
+ if (focusTarget) {
224
+ focusTarget.focus();
225
+ }
226
+ },
188
227
  isTargetClicked(event) {
189
228
  return this.target && (this.target === event.target || this.target.contains(event.target));
190
229
  },
@@ -196,6 +235,12 @@ export default {
196
235
  originalEvent: event,
197
236
  target: this.target
198
237
  });
238
+ },
239
+ onOverlayKeydown(event) {
240
+ if (event.code === 'Escape') {
241
+ ConfirmationEventBus.emit('close', this.closeListener);
242
+ DomHandler.focus(this.target);
243
+ }
199
244
  }
200
245
  },
201
246
  computed: {
@@ -231,11 +276,20 @@ export default {
231
276
  },
232
277
  rejectClass() {
233
278
  return ['p-confirm-popup-reject p-button-sm', this.confirmation ? this.confirmation.rejectClass || 'p-button-text' : null];
279
+ },
280
+ autoFocusAccept() {
281
+ return this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false;
282
+ },
283
+ autoFocusReject() {
284
+ return this.confirmation.defaultFocus === 'reject' ? true : false;
234
285
  }
235
286
  },
236
287
  components: {
237
288
  CPButton: Button,
238
289
  Portal: Portal
290
+ },
291
+ directives: {
292
+ focustrap: FocusTrap
239
293
  }
240
294
  };
241
295
  </script>
@@ -1,17 +1,19 @@
1
1
  'use strict';
2
2
 
3
+ var Button = require('primevue/button');
3
4
  var ConfirmationEventBus = require('primevue/confirmationeventbus');
4
- var utils = require('primevue/utils');
5
+ var FocusTrap = require('primevue/focustrap');
5
6
  var OverlayEventBus = require('primevue/overlayeventbus');
6
- var Button = require('primevue/button');
7
7
  var Portal = require('primevue/portal');
8
+ var utils = require('primevue/utils');
8
9
  var vue = require('vue');
9
10
 
10
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
12
 
13
+ var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
12
14
  var ConfirmationEventBus__default = /*#__PURE__*/_interopDefaultLegacy(ConfirmationEventBus);
15
+ var FocusTrap__default = /*#__PURE__*/_interopDefaultLegacy(FocusTrap);
13
16
  var OverlayEventBus__default = /*#__PURE__*/_interopDefaultLegacy(OverlayEventBus);
14
- var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
15
17
  var Portal__default = /*#__PURE__*/_interopDefaultLegacy(Portal);
16
18
 
17
19
  var script = {
@@ -42,6 +44,11 @@ var script = {
42
44
  if (options.group === this.group) {
43
45
  this.confirmation = options;
44
46
  this.target = options.target;
47
+
48
+ if (this.confirmation.onShow) {
49
+ this.confirmation.onShow();
50
+ }
51
+
45
52
  this.visible = true;
46
53
  }
47
54
  };
@@ -90,7 +97,29 @@ var script = {
90
97
 
91
98
  this.visible = false;
92
99
  },
100
+ onHide() {
101
+ if (this.confirmation.onHide) {
102
+ this.confirmation.onHide();
103
+ }
104
+
105
+ this.visible = false;
106
+ },
107
+ onAcceptKeydown(event) {
108
+ if (event.code === 'Space' || event.code === 'Enter') {
109
+ this.accept();
110
+ utils.DomHandler.focus(this.target);
111
+ event.preventDefault();
112
+ }
113
+ },
114
+ onRejectKeydown(event) {
115
+ if (event.code === 'Space' || event.code === 'Enter') {
116
+ this.reject();
117
+ utils.DomHandler.focus(this.target);
118
+ event.preventDefault();
119
+ }
120
+ },
93
121
  onEnter(el) {
122
+ this.focus();
94
123
  this.bindOutsideClickListener();
95
124
  this.bindScrollListener();
96
125
  this.bindResizeListener();
@@ -126,6 +155,10 @@ var script = {
126
155
  if (!this.outsideClickListener) {
127
156
  this.outsideClickListener = (event) => {
128
157
  if (this.visible && this.container && !this.container.contains(event.target) && !this.isTargetClicked(event)) {
158
+ if (this.confirmation.onHide) {
159
+ this.confirmation.onHide();
160
+ }
161
+
129
162
  this.visible = false;
130
163
  } else {
131
164
  this.alignOverlay();
@@ -174,6 +207,13 @@ var script = {
174
207
  this.resizeListener = null;
175
208
  }
176
209
  },
210
+ focus() {
211
+ let focusTarget = this.container.querySelector('[autofocus]');
212
+
213
+ if (focusTarget) {
214
+ focusTarget.focus();
215
+ }
216
+ },
177
217
  isTargetClicked(event) {
178
218
  return this.target && (this.target === event.target || this.target.contains(event.target));
179
219
  },
@@ -185,6 +225,12 @@ var script = {
185
225
  originalEvent: event,
186
226
  target: this.target
187
227
  });
228
+ },
229
+ onOverlayKeydown(event) {
230
+ if (event.code === 'Escape') {
231
+ ConfirmationEventBus__default["default"].emit('close', this.closeListener);
232
+ utils.DomHandler.focus(this.target);
233
+ }
188
234
  }
189
235
  },
190
236
  computed: {
@@ -220,24 +266,35 @@ var script = {
220
266
  },
221
267
  rejectClass() {
222
268
  return ['p-confirm-popup-reject p-button-sm', this.confirmation ? this.confirmation.rejectClass || 'p-button-text' : null];
269
+ },
270
+ autoFocusAccept() {
271
+ return this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false;
272
+ },
273
+ autoFocusReject() {
274
+ return this.confirmation.defaultFocus === 'reject' ? true : false;
223
275
  }
224
276
  },
225
277
  components: {
226
278
  CPButton: Button__default["default"],
227
279
  Portal: Portal__default["default"]
280
+ },
281
+ directives: {
282
+ focustrap: FocusTrap__default["default"]
228
283
  }
229
284
  };
230
285
 
231
- const _hoisted_1 = {
286
+ const _hoisted_1 = ["aria-modal"];
287
+ const _hoisted_2 = {
232
288
  key: 0,
233
289
  class: "p-confirm-popup-content"
234
290
  };
235
- const _hoisted_2 = { class: "p-confirm-popup-message" };
236
- const _hoisted_3 = { class: "p-confirm-popup-footer" };
291
+ const _hoisted_3 = { class: "p-confirm-popup-message" };
292
+ const _hoisted_4 = { class: "p-confirm-popup-footer" };
237
293
 
238
294
  function render(_ctx, _cache, $props, $setup, $data, $options) {
239
295
  const _component_CPButton = vue.resolveComponent("CPButton");
240
296
  const _component_Portal = vue.resolveComponent("Portal");
297
+ const _directive_focustrap = vue.resolveDirective("focustrap");
241
298
 
242
299
  return (vue.openBlock(), vue.createBlock(_component_Portal, null, {
243
300
  default: vue.withCtx(() => [
@@ -249,40 +306,47 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
249
306
  }, {
250
307
  default: vue.withCtx(() => [
251
308
  ($data.visible)
252
- ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
309
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
253
310
  key: 0,
254
311
  ref: $options.containerRef,
255
- class: $options.containerClass
256
- }, _ctx.$attrs, {
257
- onClick: _cache[2] || (_cache[2] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
258
- }), [
312
+ role: "alertdialog",
313
+ class: $options.containerClass,
314
+ "aria-modal": $data.visible,
315
+ onClick: _cache[2] || (_cache[2] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args))),
316
+ onKeydown: _cache[3] || (_cache[3] = (...args) => ($options.onOverlayKeydown && $options.onOverlayKeydown(...args)))
317
+ }, _ctx.$attrs), [
259
318
  (!_ctx.$slots.message)
260
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
319
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
261
320
  vue.createElementVNode("i", {
262
321
  class: vue.normalizeClass($options.iconClass)
263
322
  }, null, 2),
264
- vue.createElementVNode("span", _hoisted_2, vue.toDisplayString($data.confirmation.message), 1)
323
+ vue.createElementVNode("span", _hoisted_3, vue.toDisplayString($data.confirmation.message), 1)
265
324
  ]))
266
325
  : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.$slots.message), {
267
326
  key: 1,
268
327
  message: $data.confirmation
269
328
  }, null, 8, ["message"])),
270
- vue.createElementVNode("div", _hoisted_3, [
329
+ vue.createElementVNode("div", _hoisted_4, [
271
330
  vue.createVNode(_component_CPButton, {
272
331
  label: $options.rejectLabel,
273
332
  icon: $options.rejectIcon,
274
333
  class: vue.normalizeClass($options.rejectClass),
275
- onClick: _cache[0] || (_cache[0] = $event => ($options.reject()))
276
- }, null, 8, ["label", "icon", "class"]),
334
+ onClick: _cache[0] || (_cache[0] = $event => ($options.reject())),
335
+ onKeydown: $options.onRejectKeydown,
336
+ autofocus: $options.autoFocusReject
337
+ }, null, 8, ["label", "icon", "class", "onKeydown", "autofocus"]),
277
338
  vue.createVNode(_component_CPButton, {
278
339
  label: $options.acceptLabel,
279
340
  icon: $options.acceptIcon,
280
341
  class: vue.normalizeClass($options.acceptClass),
281
342
  onClick: _cache[1] || (_cache[1] = $event => ($options.accept())),
282
- autofocus: ""
283
- }, null, 8, ["label", "icon", "class"])
343
+ onKeydown: $options.onAcceptKeydown,
344
+ autofocus: $options.autoFocusAccept
345
+ }, null, 8, ["label", "icon", "class", "onKeydown", "autofocus"])
284
346
  ])
285
- ], 16))
347
+ ], 16, _hoisted_1)), [
348
+ [_directive_focustrap]
349
+ ])
286
350
  : vue.createCommentVNode("", true)
287
351
  ]),
288
352
  _: 1
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/confirmationeventbus"),t=require("primevue/utils"),n=require("primevue/overlayeventbus"),i=require("primevue/button"),r=require("primevue/portal"),o=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),c=s(n),a=s(i),p=s(r),u={name:"ConfirmPopup",inheritAttrs:!1,props:{group:String},data:()=>({visible:!1,confirmation:null}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.target=e.target,this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},l.default.on("confirm",this.confirmListener),l.default.on("close",this.closeListener)},beforeUnmount(){l.default.off("confirm",this.confirmListener),l.default.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(t.ZIndexUtils.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onEnter(e){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),t.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave(e){t.ZIndexUtils.clear(e)},alignOverlay(){t.DomHandler.absolutePosition(this.container,this.target);const e=t.DomHandler.getOffset(this.container),n=t.DomHandler.getOffset(this.target);let i=0;e.left<n.left&&(i=n.left-e.left),this.container.style.setProperty("--overlayArrowLeft",`${i}px`),e.top<n.top&&t.DomHandler.addClass(this.container,"p-confirm-popup-flipped")},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.visible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)?this.visible=!1:this.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new t.ConnectedOverlayScrollHandler(this.target,(()=>{this.visible&&(this.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.visible&&!t.DomHandler.isTouchDevice()&&(this.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isTargetClicked(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef(e){this.container=e},onOverlayClick(e){c.default.emit("overlay-click",{originalEvent:e,target:this.target})}},computed:{containerClass(){return["p-confirm-popup p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},message(){return this.confirmation?this.confirmation.message:null},iconClass(){return["p-confirm-popup-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-popup-accept p-button-sm",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-popup-reject p-button-sm",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]}},components:{CPButton:a.default,Portal:p.default}};const m={key:0,class:"p-confirm-popup-content"},f={class:"p-confirm-popup-message"},d={class:"p-confirm-popup-footer"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("\n.p-confirm-popup {\n position: absolute;\n margin-top: 10px;\n top: 0;\n left: 0;\n}\n.p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n/* Animation */\n.p-confirm-popup-enter-from {\n opacity: 0;\n -webkit-transform: scaleY(0.8);\n transform: scaleY(0.8);\n}\n.p-confirm-popup-leave-to {\n opacity: 0;\n}\n.p-confirm-popup-enter-active {\n -webkit-transition: opacity 0.12s cubic-bezier(0, 0, 0.2, 1), -webkit-transform 0.12s cubic-bezier(0, 0, 0.2, 1);\n transition: opacity 0.12s cubic-bezier(0, 0, 0.2, 1), -webkit-transform 0.12s cubic-bezier(0, 0, 0.2, 1);\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1), -webkit-transform 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n.p-confirm-popup-leave-active {\n -webkit-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n}\n.p-confirm-popup:after,\n.p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n.p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n}\n.p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n}\n.p-confirm-popup-flipped:after,\n.p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n}\n.p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n}\n.p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent;\n}\n.p-confirm-popup .p-confirm-popup-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n"),u.render=function(e,t,n,i,r,s){const l=o.resolveComponent("CPButton"),c=o.resolveComponent("Portal");return o.openBlock(),o.createBlock(c,null,{default:o.withCtx((()=>[o.createVNode(o.Transition,{name:"p-confirm-popup",onEnter:s.onEnter,onLeave:s.onLeave,onAfterLeave:s.onAfterLeave},{default:o.withCtx((()=>[r.visible?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:s.containerRef,class:s.containerClass},e.$attrs,{onClick:t[2]||(t[2]=(...e)=>s.onOverlayClick&&s.onOverlayClick(...e))}),[e.$slots.message?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.$slots.message),{key:1,message:r.confirmation},null,8,["message"])):(o.openBlock(),o.createElementBlock("div",m,[o.createElementVNode("i",{class:o.normalizeClass(s.iconClass)},null,2),o.createElementVNode("span",f,o.toDisplayString(r.confirmation.message),1)])),o.createElementVNode("div",d,[o.createVNode(l,{label:s.rejectLabel,icon:s.rejectIcon,class:o.normalizeClass(s.rejectClass),onClick:t[0]||(t[0]=e=>s.reject())},null,8,["label","icon","class"]),o.createVNode(l,{label:s.acceptLabel,icon:s.acceptIcon,class:o.normalizeClass(s.acceptClass),onClick:t[1]||(t[1]=e=>s.accept()),autofocus:""},null,8,["label","icon","class"])])],16)):o.createCommentVNode("",!0)])),_:1},8,["onEnter","onLeave","onAfterLeave"])])),_:1})},module.exports=u;
1
+ "use strict";var e=require("primevue/button"),t=require("primevue/confirmationeventbus"),n=require("primevue/focustrap"),i=require("primevue/overlayeventbus"),o=require("primevue/portal"),r=require("primevue/utils"),s=require("vue");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),a=c(t),p=c(n),u=c(i),f=c(o),m={name:"ConfirmPopup",inheritAttrs:!1,props:{group:String},data:()=>({visible:!1,confirmation:null}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.target=e.target,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},a.default.on("confirm",this.confirmListener),a.default.on("close",this.closeListener)},beforeUnmount(){a.default.off("confirm",this.confirmListener),a.default.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(r.ZIndexUtils.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.accept(),r.DomHandler.focus(this.target),e.preventDefault())},onRejectKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.reject(),r.DomHandler.focus(this.target),e.preventDefault())},onEnter(e){this.focus(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),r.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave(e){r.ZIndexUtils.clear(e)},alignOverlay(){r.DomHandler.absolutePosition(this.container,this.target);const e=r.DomHandler.getOffset(this.container),t=r.DomHandler.getOffset(this.target);let n=0;e.left<t.left&&(n=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft",`${n}px`),e.top<t.top&&r.DomHandler.addClass(this.container,"p-confirm-popup-flipped")},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.visible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)?(this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1):this.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new r.ConnectedOverlayScrollHandler(this.target,(()=>{this.visible&&(this.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.visible&&!r.DomHandler.isTouchDevice()&&(this.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus(){let e=this.container.querySelector("[autofocus]");e&&e.focus()},isTargetClicked(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef(e){this.container=e},onOverlayClick(e){u.default.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown(e){"Escape"===e.code&&(a.default.emit("close",this.closeListener),r.DomHandler.focus(this.target))}},computed:{containerClass(){return["p-confirm-popup p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},message(){return this.confirmation?this.confirmation.message:null},iconClass(){return["p-confirm-popup-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-popup-accept p-button-sm",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-popup-reject p-button-sm",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus}},components:{CPButton:l.default,Portal:f.default},directives:{focustrap:p.default}};const d=["aria-modal"],h={key:0,class:"p-confirm-popup-content"},b={class:"p-confirm-popup-message"},v={class:"p-confirm-popup-footer"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-confirm-popup {\n position: absolute;\n margin-top: 10px;\n top: 0;\n left: 0;\n}\n.p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n/* Animation */\n.p-confirm-popup-enter-from {\n opacity: 0;\n -webkit-transform: scaleY(0.8);\n transform: scaleY(0.8);\n}\n.p-confirm-popup-leave-to {\n opacity: 0;\n}\n.p-confirm-popup-enter-active {\n -webkit-transition: opacity 0.12s cubic-bezier(0, 0, 0.2, 1), -webkit-transform 0.12s cubic-bezier(0, 0, 0.2, 1);\n transition: opacity 0.12s cubic-bezier(0, 0, 0.2, 1), -webkit-transform 0.12s cubic-bezier(0, 0, 0.2, 1);\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1), -webkit-transform 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n.p-confirm-popup-leave-active {\n -webkit-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n}\n.p-confirm-popup:after,\n.p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n.p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n}\n.p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n}\n.p-confirm-popup-flipped:after,\n.p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n}\n.p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n}\n.p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent;\n}\n.p-confirm-popup .p-confirm-popup-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n"),m.render=function(e,t,n,i,o,r){const c=s.resolveComponent("CPButton"),l=s.resolveComponent("Portal"),a=s.resolveDirective("focustrap");return s.openBlock(),s.createBlock(l,null,{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-confirm-popup",onEnter:r.onEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},{default:s.withCtx((()=>[o.visible?s.withDirectives((s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:r.containerRef,role:"alertdialog",class:r.containerClass,"aria-modal":o.visible,onClick:t[2]||(t[2]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>r.onOverlayKeydown&&r.onOverlayKeydown(...e))},e.$attrs),[e.$slots.message?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(s.openBlock(),s.createElementBlock("div",h,[s.createElementVNode("i",{class:s.normalizeClass(r.iconClass)},null,2),s.createElementVNode("span",b,s.toDisplayString(o.confirmation.message),1)])),s.createElementVNode("div",v,[s.createVNode(c,{label:r.rejectLabel,icon:r.rejectIcon,class:s.normalizeClass(r.rejectClass),onClick:t[0]||(t[0]=e=>r.reject()),onKeydown:r.onRejectKeydown,autofocus:r.autoFocusReject},null,8,["label","icon","class","onKeydown","autofocus"]),s.createVNode(c,{label:r.acceptLabel,icon:r.acceptIcon,class:s.normalizeClass(r.acceptClass),onClick:t[1]||(t[1]=e=>r.accept()),onKeydown:r.onAcceptKeydown,autofocus:r.autoFocusAccept},null,8,["label","icon","class","onKeydown","autofocus"])])],16,d)),[[a]]):s.createCommentVNode("",!0)])),_:1},8,["onEnter","onLeave","onAfterLeave"])])),_:1})},module.exports=m;