primevue 3.18.0 → 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 (235) hide show
  1. package/README.md +13 -2
  2. package/autocomplete/AutoComplete.vue +15 -2
  3. package/autocomplete/autocomplete.cjs.js +15 -2
  4. package/autocomplete/autocomplete.cjs.min.js +1 -1
  5. package/autocomplete/autocomplete.esm.js +15 -2
  6. package/autocomplete/autocomplete.esm.min.js +1 -1
  7. package/autocomplete/autocomplete.js +15 -2
  8. package/autocomplete/autocomplete.min.js +1 -1
  9. package/breadcrumb/BreadcrumbItem.vue +6 -6
  10. package/breadcrumb/breadcrumb.cjs.js +6 -6
  11. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  12. package/breadcrumb/breadcrumb.esm.js +6 -6
  13. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  14. package/breadcrumb/breadcrumb.js +6 -6
  15. package/breadcrumb/breadcrumb.min.js +1 -1
  16. package/calendar/Calendar.d.ts +20 -0
  17. package/calendar/Calendar.vue +32 -14
  18. package/calendar/calendar.cjs.js +139 -121
  19. package/calendar/calendar.cjs.min.js +1 -1
  20. package/calendar/calendar.esm.js +139 -121
  21. package/calendar/calendar.esm.min.js +1 -1
  22. package/calendar/calendar.js +139 -121
  23. package/calendar/calendar.min.js +1 -1
  24. package/chips/Chips.d.ts +7 -2
  25. package/chips/Chips.vue +11 -3
  26. package/chips/chips.cjs.js +12 -4
  27. package/chips/chips.cjs.min.js +1 -1
  28. package/chips/chips.esm.js +12 -4
  29. package/chips/chips.esm.min.js +1 -1
  30. package/chips/chips.js +12 -4
  31. package/chips/chips.min.js +1 -1
  32. package/confirmdialog/ConfirmDialog.vue +6 -1
  33. package/confirmdialog/confirmdialog.cjs.js +7 -1
  34. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  35. package/confirmdialog/confirmdialog.esm.js +7 -1
  36. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  37. package/confirmdialog/confirmdialog.js +7 -1
  38. package/confirmdialog/confirmdialog.min.js +1 -1
  39. package/confirmpopup/ConfirmPopup.vue +59 -5
  40. package/confirmpopup/confirmpopup.cjs.js +83 -19
  41. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  42. package/confirmpopup/confirmpopup.esm.js +82 -19
  43. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  44. package/confirmpopup/confirmpopup.js +82 -19
  45. package/confirmpopup/confirmpopup.min.js +1 -1
  46. package/contextmenu/ContextMenu.vue +14 -16
  47. package/contextmenu/contextmenu.cjs.js +14 -16
  48. package/contextmenu/contextmenu.cjs.min.js +1 -1
  49. package/contextmenu/contextmenu.esm.js +14 -16
  50. package/contextmenu/contextmenu.esm.min.js +1 -1
  51. package/contextmenu/contextmenu.js +14 -16
  52. package/contextmenu/contextmenu.min.js +1 -1
  53. package/core/core.js +374 -94
  54. package/core/core.min.js +13 -9
  55. package/datatable/DataTable.d.ts +1 -1
  56. package/datatable/DataTable.vue +1 -1
  57. package/datatable/HeaderCell.vue +1 -1
  58. package/datatable/TableBody.vue +1 -1
  59. package/datatable/TableHeader.vue +1 -1
  60. package/datatable/datatable.cjs.js +4 -4
  61. package/datatable/datatable.cjs.min.js +1 -1
  62. package/datatable/datatable.esm.js +4 -4
  63. package/datatable/datatable.esm.min.js +1 -1
  64. package/datatable/datatable.js +4 -4
  65. package/datatable/datatable.min.js +1 -1
  66. package/dialog/Dialog.d.ts +19 -5
  67. package/dialog/Dialog.vue +114 -51
  68. package/dialog/dialog.cjs.js +145 -72
  69. package/dialog/dialog.cjs.min.js +1 -1
  70. package/dialog/dialog.esm.js +143 -71
  71. package/dialog/dialog.esm.min.js +1 -1
  72. package/dialog/dialog.js +143 -71
  73. package/dialog/dialog.min.js +1 -1
  74. package/dropdown/Dropdown.vue +20 -1
  75. package/dropdown/dropdown.cjs.js +20 -1
  76. package/dropdown/dropdown.cjs.min.js +1 -1
  77. package/dropdown/dropdown.esm.js +20 -1
  78. package/dropdown/dropdown.esm.min.js +1 -1
  79. package/dropdown/dropdown.js +20 -1
  80. package/dropdown/dropdown.min.js +1 -1
  81. package/fileupload/FileContent.vue +9 -2
  82. package/fileupload/fileupload.cjs.js +10 -4
  83. package/fileupload/fileupload.cjs.min.js +1 -1
  84. package/fileupload/fileupload.esm.js +9 -4
  85. package/fileupload/fileupload.esm.min.js +1 -1
  86. package/fileupload/fileupload.js +11 -6
  87. package/fileupload/fileupload.min.js +1 -1
  88. package/focustrap/FocusTrap.d.ts +5 -0
  89. package/focustrap/focustrap.cjs.js +94 -0
  90. package/focustrap/focustrap.cjs.min.js +1 -0
  91. package/focustrap/focustrap.esm.js +92 -0
  92. package/focustrap/focustrap.esm.min.js +1 -0
  93. package/focustrap/focustrap.js +96 -0
  94. package/focustrap/focustrap.min.js +1 -0
  95. package/focustrap/package.json +6 -0
  96. package/inplace/Inplace.d.ts +5 -0
  97. package/inplace/Inplace.vue +5 -1
  98. package/inplace/inplace.cjs.js +6 -2
  99. package/inplace/inplace.cjs.min.js +1 -1
  100. package/inplace/inplace.esm.js +6 -2
  101. package/inplace/inplace.esm.min.js +1 -1
  102. package/inplace/inplace.js +6 -2
  103. package/inplace/inplace.min.js +1 -1
  104. package/inputnumber/InputNumber.d.ts +5 -0
  105. package/inputnumber/InputNumber.vue +9 -0
  106. package/inputnumber/inputnumber.cjs.js +9 -0
  107. package/inputnumber/inputnumber.cjs.min.js +1 -1
  108. package/inputnumber/inputnumber.esm.js +9 -0
  109. package/inputnumber/inputnumber.esm.min.js +1 -1
  110. package/inputnumber/inputnumber.js +9 -0
  111. package/inputnumber/inputnumber.min.js +1 -1
  112. package/megamenu/MegaMenu.vue +3 -2
  113. package/megamenu/megamenu.cjs.js +3 -2
  114. package/megamenu/megamenu.cjs.min.js +1 -1
  115. package/megamenu/megamenu.esm.js +3 -2
  116. package/megamenu/megamenu.esm.min.js +1 -1
  117. package/megamenu/megamenu.js +3 -2
  118. package/megamenu/megamenu.min.js +1 -1
  119. package/menu/Menu.vue +7 -7
  120. package/menu/menu.cjs.js +7 -7
  121. package/menu/menu.cjs.min.js +1 -1
  122. package/menu/menu.esm.js +7 -7
  123. package/menu/menu.esm.min.js +1 -1
  124. package/menu/menu.js +7 -7
  125. package/menu/menu.min.js +1 -1
  126. package/menubar/Menubar.vue +5 -3
  127. package/menubar/MenubarSub.vue +1 -1
  128. package/menubar/menubar.cjs.js +22 -18
  129. package/menubar/menubar.cjs.min.js +1 -1
  130. package/menubar/menubar.esm.js +22 -18
  131. package/menubar/menubar.esm.min.js +1 -1
  132. package/menubar/menubar.js +22 -18
  133. package/menubar/menubar.min.js +1 -1
  134. package/message/Message.d.ts +5 -0
  135. package/message/Message.vue +5 -1
  136. package/message/message.cjs.js +9 -5
  137. package/message/message.cjs.min.js +1 -1
  138. package/message/message.esm.js +9 -5
  139. package/message/message.esm.min.js +1 -1
  140. package/message/message.js +9 -5
  141. package/message/message.min.js +1 -1
  142. package/multiselect/MultiSelect.vue +24 -3
  143. package/multiselect/multiselect.cjs.js +24 -3
  144. package/multiselect/multiselect.cjs.min.js +1 -1
  145. package/multiselect/multiselect.esm.js +24 -3
  146. package/multiselect/multiselect.esm.min.js +1 -1
  147. package/multiselect/multiselect.js +24 -3
  148. package/multiselect/multiselect.min.js +1 -1
  149. package/overlaypanel/OverlayPanel.d.ts +2 -1
  150. package/overlaypanel/OverlayPanel.vue +31 -5
  151. package/overlaypanel/overlaypanel.cjs.js +49 -17
  152. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  153. package/overlaypanel/overlaypanel.esm.js +48 -17
  154. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  155. package/overlaypanel/overlaypanel.js +48 -17
  156. package/overlaypanel/overlaypanel.min.js +1 -1
  157. package/package.json +1 -1
  158. package/paginator/Paginator.vue +5 -3
  159. package/paginator/paginator.cjs.js +5 -3
  160. package/paginator/paginator.cjs.min.js +1 -1
  161. package/paginator/paginator.esm.js +5 -3
  162. package/paginator/paginator.esm.min.js +1 -1
  163. package/paginator/paginator.js +5 -3
  164. package/paginator/paginator.min.js +1 -1
  165. package/panelmenu/PanelMenuList.vue +1 -2
  166. package/panelmenu/panelmenu.cjs.js +4 -622
  167. package/panelmenu/panelmenu.cjs.min.js +1 -1
  168. package/panelmenu/panelmenu.esm.js +13 -631
  169. package/panelmenu/panelmenu.esm.min.js +1 -1
  170. package/panelmenu/panelmenu.js +4 -622
  171. package/panelmenu/panelmenu.min.js +1 -1
  172. package/resources/primevue.css +4 -2
  173. package/resources/primevue.min.css +1 -1
  174. package/scrollpanel/ScrollPanel.vue +5 -0
  175. package/scrollpanel/scrollpanel.cjs.js +1 -1
  176. package/scrollpanel/scrollpanel.cjs.min.js +1 -1
  177. package/scrollpanel/scrollpanel.esm.js +1 -1
  178. package/scrollpanel/scrollpanel.esm.min.js +1 -1
  179. package/scrollpanel/scrollpanel.js +1 -1
  180. package/scrollpanel/scrollpanel.min.js +1 -1
  181. package/sidebar/Sidebar.d.ts +5 -5
  182. package/sidebar/Sidebar.vue +46 -14
  183. package/sidebar/sidebar.cjs.js +73 -30
  184. package/sidebar/sidebar.cjs.min.js +1 -1
  185. package/sidebar/sidebar.esm.js +72 -30
  186. package/sidebar/sidebar.esm.min.js +1 -1
  187. package/sidebar/sidebar.js +72 -30
  188. package/sidebar/sidebar.min.js +1 -1
  189. package/slider/Slider.vue +21 -12
  190. package/slider/slider.cjs.js +21 -12
  191. package/slider/slider.cjs.min.js +1 -1
  192. package/slider/slider.esm.js +21 -12
  193. package/slider/slider.esm.min.js +1 -1
  194. package/slider/slider.js +21 -12
  195. package/slider/slider.min.js +1 -1
  196. package/splitter/Splitter.d.ts +16 -0
  197. package/splitter/Splitter.vue +2 -1
  198. package/splitter/splitter.cjs.js +2 -1
  199. package/splitter/splitter.cjs.min.js +1 -1
  200. package/splitter/splitter.esm.js +2 -1
  201. package/splitter/splitter.esm.min.js +1 -1
  202. package/splitter/splitter.js +2 -1
  203. package/splitter/splitter.min.js +1 -1
  204. package/tieredmenu/TieredMenu.vue +1 -2
  205. package/tieredmenu/tieredmenu.cjs.js +1 -2
  206. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  207. package/tieredmenu/tieredmenu.esm.js +1 -2
  208. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  209. package/tieredmenu/tieredmenu.js +1 -2
  210. package/tieredmenu/tieredmenu.min.js +1 -1
  211. package/toast/Toast.d.ts +25 -0
  212. package/toast/Toast.vue +32 -1
  213. package/toast/ToastMessage.vue +12 -7
  214. package/toast/toast.cjs.js +44 -14
  215. package/toast/toast.cjs.min.js +1 -1
  216. package/toast/toast.esm.js +44 -14
  217. package/toast/toast.esm.min.js +1 -1
  218. package/toast/toast.js +44 -14
  219. package/toast/toast.min.js +1 -1
  220. package/tooltip/tooltip.cjs.js +28 -5
  221. package/tooltip/tooltip.cjs.min.js +1 -1
  222. package/tooltip/tooltip.esm.js +28 -5
  223. package/tooltip/tooltip.esm.min.js +1 -1
  224. package/tooltip/tooltip.js +28 -5
  225. package/tooltip/tooltip.min.js +1 -1
  226. package/utils/Utils.d.ts +1 -0
  227. package/utils/utils.cjs.js +6 -0
  228. package/utils/utils.cjs.min.js +1 -1
  229. package/utils/utils.esm.js +6 -0
  230. package/utils/utils.esm.min.js +1 -1
  231. package/utils/utils.js +6 -0
  232. package/utils/utils.min.js +1 -1
  233. package/vetur-attributes.json +75 -11
  234. package/vetur-tags.json +25 -8
  235. package/web-types.json +233 -21
package/chips/chips.js CHANGED
@@ -15,7 +15,7 @@ this.primevue.chips = (function (utils, vue) {
15
15
  default: null
16
16
  },
17
17
  separator: {
18
- type: String,
18
+ type: [String, Object],
19
19
  default: null
20
20
  },
21
21
  addOnBlur: {
@@ -50,6 +50,10 @@ this.primevue.chips = (function (utils, vue) {
50
50
  type: null,
51
51
  default: null
52
52
  },
53
+ removeTokenIcon: {
54
+ type: String,
55
+ default: 'pi pi-times-circle'
56
+ },
53
57
  'aria-labelledby': {
54
58
  type: String,
55
59
  default: null
@@ -123,7 +127,7 @@ this.primevue.chips = (function (utils, vue) {
123
127
 
124
128
  default:
125
129
  if (this.separator) {
126
- if (this.separator === ',' && event.key === ',') {
130
+ if (this.separator === event.key || event.key.match(this.separator)) {
127
131
  this.addItem(event, inputValue, true);
128
132
  }
129
133
  }
@@ -197,6 +201,10 @@ this.primevue.chips = (function (utils, vue) {
197
201
  this.$refs.input.value = '';
198
202
  this.inputValue = '';
199
203
 
204
+ setTimeout(() => {
205
+ this.maxedOut && (this.focused = false);
206
+ }, 0);
207
+
200
208
  if (preventDefault) {
201
209
  event.preventDefault();
202
210
  }
@@ -292,10 +300,10 @@ this.primevue.chips = (function (utils, vue) {
292
300
  vue.createElementVNode("span", _hoisted_3, vue.toDisplayString(val), 1)
293
301
  ]),
294
302
  vue.createElementVNode("span", {
295
- class: "p-chips-token-icon pi pi-times-circle",
303
+ class: vue.normalizeClass(['p-chips-token-icon', $props.removeTokenIcon]),
296
304
  onClick: $event => ($options.removeItem($event, i)),
297
305
  "aria-hidden": "true"
298
- }, null, 8, _hoisted_4)
306
+ }, null, 10, _hoisted_4)
299
307
  ], 10, _hoisted_2))
300
308
  }), 128)),
301
309
  vue.createElementVNode("li", _hoisted_5, [
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.chips=function(e,t){"use strict";var n={name:"Chips",emits:["update:modelValue","add","remove","focus","blur"],props:{modelValue:{type:Array,default:null},max:{type:Number,default:null},separator:{type:String,default:null},addOnBlur:{type:Boolean,default:null},allowDuplicate:{type:Boolean,default:!0},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({id:e.UniqueComponentId(),inputValue:null,focused:!1,focusedIndex:null}),methods:{onWrapperClick(){this.$refs.input.focus()},onInput(e){this.inputValue=e.target.value,this.focusedIndex=null},onFocus(e){this.focused=!0,this.focusedIndex=null,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedIndex=null,this.addOnBlur&&this.addItem(e,e.target.value,!1),this.$emit("blur",e)},onKeyDown(e){const t=e.target.value;switch(e.code){case"Backspace":0===t.length&&this.modelValue&&this.modelValue.length>0&&(null!==this.focusedIndex?this.removeItem(e,this.focusedIndex):this.removeItem(e,this.modelValue.length-1));break;case"Enter":t&&t.trim().length&&!this.maxedOut&&this.addItem(e,t,!0);break;case"ArrowLeft":0===t.length&&this.modelValue&&this.modelValue.length>0&&this.$refs.container.focus();break;case"ArrowRight":e.stopPropagation();break;default:this.separator&&","===this.separator&&","===e.key&&this.addItem(e,t,!0)}},onPaste(e){if(this.separator){let t=(e.clipboardData||window.clipboardData).getData("Text");if(t){let n=this.modelValue||[],l=t.split(this.separator);l=l.filter((e=>this.allowDuplicate||-1===n.indexOf(e))),n=[...n,...l],this.updateModel(e,n,!0)}}},onContainerFocus(){this.focused=!0},onContainerBlur(){this.focusedIndex=-1,this.focused=!1},onContainerKeyDown(e){switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOn(e);break;case"ArrowRight":this.onArrowRightKeyOn(e);break;case"Backspace":this.onBackspaceKeyOn(e)}},onArrowLeftKeyOn(){0===this.inputValue.length&&this.modelValue&&this.modelValue.length>0&&(this.focusedIndex=null===this.focusedIndex?this.modelValue.length-1:this.focusedIndex-1,this.focusedIndex<0&&(this.focusedIndex=0))},onArrowRightKeyOn(){0===this.inputValue.length&&this.modelValue&&this.modelValue.length>0&&(this.focusedIndex===this.modelValue.length-1?(this.focusedIndex=null,this.$refs.input.focus()):this.focusedIndex++)},onBackspaceKeyOn(e){null!==this.focusedIndex&&this.removeItem(e,this.focusedIndex)},updateModel(e,t,n){this.$emit("update:modelValue",t),this.$emit("add",{originalEvent:e,value:t}),this.$refs.input.value="",this.inputValue="",n&&e.preventDefault()},addItem(e,t,n){if(t&&t.trim().length){let l=this.modelValue?[...this.modelValue]:[];(this.allowDuplicate||-1===l.indexOf(t))&&(l.push(t),this.updateModel(e,l,n))}},removeItem(e,t){if(this.disabled)return;let n=[...this.modelValue];const l=n.splice(t,1);this.focusedIndex=null,this.$refs.input.focus(),this.$emit("update:modelValue",n),this.$emit("remove",{originalEvent:e,value:l})}},computed:{maxedOut(){return this.max&&this.modelValue&&this.max===this.modelValue.length},containerClass(){return["p-chips p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length||this.inputValue&&this.inputValue.length,"p-inputwrapper-focus":this.focused}]},focusedOptionId(){return null!==this.focusedIndex?`${this.id}_chips_item_${this.focusedIndex}`:null}}};const l=["aria-labelledby","aria-label","aria-activedescendant"],i=["id","aria-label","aria-setsize","aria-posinset"],a={class:"p-chips-token-label"},s=["onClick"],o={class:"p-chips-input-token",role:"option"},d=["id","disabled","placeholder"];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-chips {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-chips-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\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 -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n.p-chips-token {\n cursor: default;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-chips-input-token {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-chips-token-icon {\n cursor: pointer;\n}\n.p-chips-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-chips {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),n.render=function(e,n,u,r,p,c){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(c.containerClass)},[t.createElementVNode("ul",{ref:"container",class:"p-inputtext p-chips-multiple-container",tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-activedescendant":p.focused?c.focusedOptionId:void 0,onClick:n[5]||(n[5]=e=>c.onWrapperClick()),onFocus:n[6]||(n[6]=(...e)=>c.onContainerFocus&&c.onContainerFocus(...e)),onBlur:n[7]||(n[7]=(...e)=>c.onContainerBlur&&c.onContainerBlur(...e)),onKeydown:n[8]||(n[8]=(...e)=>c.onContainerKeyDown&&c.onContainerKeyDown(...e))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.modelValue,((n,l)=>(t.openBlock(),t.createElementBlock("li",{key:`${l}_${n}`,id:p.id+"_chips_item_"+l,role:"option",class:t.normalizeClass(["p-chips-token",{"p-focus":p.focusedIndex===l}]),"aria-label":n,"aria-selected":!0,"aria-setsize":u.modelValue.length,"aria-posinset":l+1},[t.renderSlot(e.$slots,"chip",{value:n},(()=>[t.createElementVNode("span",a,t.toDisplayString(n),1)])),t.createElementVNode("span",{class:"p-chips-token-icon pi pi-times-circle",onClick:e=>c.removeItem(e,l),"aria-hidden":"true"},null,8,s)],10,i)))),128)),t.createElementVNode("li",o,[t.createElementVNode("input",t.mergeProps({ref:"input",id:u.inputId,type:"text",class:u.inputClass,style:u.inputStyle,disabled:u.disabled||c.maxedOut,placeholder:u.placeholder,onFocus:n[0]||(n[0]=e=>c.onFocus(e)),onBlur:n[1]||(n[1]=e=>c.onBlur(e)),onInput:n[2]||(n[2]=(...e)=>c.onInput&&c.onInput(...e)),onKeydown:n[3]||(n[3]=e=>c.onKeyDown(e)),onPaste:n[4]||(n[4]=e=>c.onPaste(e))},u.inputProps),null,16,d)])],40,l)],2)},n}(primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.chips=function(e,t){"use strict";var n={name:"Chips",emits:["update:modelValue","add","remove","focus","blur"],props:{modelValue:{type:Array,default:null},max:{type:Number,default:null},separator:{type:[String,Object],default:null},addOnBlur:{type:Boolean,default:null},allowDuplicate:{type:Boolean,default:!0},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},removeTokenIcon:{type:String,default:"pi pi-times-circle"},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({id:e.UniqueComponentId(),inputValue:null,focused:!1,focusedIndex:null}),methods:{onWrapperClick(){this.$refs.input.focus()},onInput(e){this.inputValue=e.target.value,this.focusedIndex=null},onFocus(e){this.focused=!0,this.focusedIndex=null,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedIndex=null,this.addOnBlur&&this.addItem(e,e.target.value,!1),this.$emit("blur",e)},onKeyDown(e){const t=e.target.value;switch(e.code){case"Backspace":0===t.length&&this.modelValue&&this.modelValue.length>0&&(null!==this.focusedIndex?this.removeItem(e,this.focusedIndex):this.removeItem(e,this.modelValue.length-1));break;case"Enter":t&&t.trim().length&&!this.maxedOut&&this.addItem(e,t,!0);break;case"ArrowLeft":0===t.length&&this.modelValue&&this.modelValue.length>0&&this.$refs.container.focus();break;case"ArrowRight":e.stopPropagation();break;default:this.separator&&(this.separator===e.key||e.key.match(this.separator))&&this.addItem(e,t,!0)}},onPaste(e){if(this.separator){let t=(e.clipboardData||window.clipboardData).getData("Text");if(t){let n=this.modelValue||[],i=t.split(this.separator);i=i.filter((e=>this.allowDuplicate||-1===n.indexOf(e))),n=[...n,...i],this.updateModel(e,n,!0)}}},onContainerFocus(){this.focused=!0},onContainerBlur(){this.focusedIndex=-1,this.focused=!1},onContainerKeyDown(e){switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOn(e);break;case"ArrowRight":this.onArrowRightKeyOn(e);break;case"Backspace":this.onBackspaceKeyOn(e)}},onArrowLeftKeyOn(){0===this.inputValue.length&&this.modelValue&&this.modelValue.length>0&&(this.focusedIndex=null===this.focusedIndex?this.modelValue.length-1:this.focusedIndex-1,this.focusedIndex<0&&(this.focusedIndex=0))},onArrowRightKeyOn(){0===this.inputValue.length&&this.modelValue&&this.modelValue.length>0&&(this.focusedIndex===this.modelValue.length-1?(this.focusedIndex=null,this.$refs.input.focus()):this.focusedIndex++)},onBackspaceKeyOn(e){null!==this.focusedIndex&&this.removeItem(e,this.focusedIndex)},updateModel(e,t,n){this.$emit("update:modelValue",t),this.$emit("add",{originalEvent:e,value:t}),this.$refs.input.value="",this.inputValue="",setTimeout((()=>{this.maxedOut&&(this.focused=!1)}),0),n&&e.preventDefault()},addItem(e,t,n){if(t&&t.trim().length){let i=this.modelValue?[...this.modelValue]:[];(this.allowDuplicate||-1===i.indexOf(t))&&(i.push(t),this.updateModel(e,i,n))}},removeItem(e,t){if(this.disabled)return;let n=[...this.modelValue];const i=n.splice(t,1);this.focusedIndex=null,this.$refs.input.focus(),this.$emit("update:modelValue",n),this.$emit("remove",{originalEvent:e,value:i})}},computed:{maxedOut(){return this.max&&this.modelValue&&this.max===this.modelValue.length},containerClass(){return["p-chips p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length||this.inputValue&&this.inputValue.length,"p-inputwrapper-focus":this.focused}]},focusedOptionId(){return null!==this.focusedIndex?`${this.id}_chips_item_${this.focusedIndex}`:null}}};const i=["aria-labelledby","aria-label","aria-activedescendant"],l=["id","aria-label","aria-setsize","aria-posinset"],a={class:"p-chips-token-label"},s=["onClick"],o={class:"p-chips-input-token",role:"option"},d=["id","disabled","placeholder"];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===n&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-chips {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-chips-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\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 -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n.p-chips-token {\n cursor: default;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-chips-input-token {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-chips-token-icon {\n cursor: pointer;\n}\n.p-chips-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-chips {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),n.render=function(e,n,u,r,p,c){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(c.containerClass)},[t.createElementVNode("ul",{ref:"container",class:"p-inputtext p-chips-multiple-container",tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-activedescendant":p.focused?c.focusedOptionId:void 0,onClick:n[5]||(n[5]=e=>c.onWrapperClick()),onFocus:n[6]||(n[6]=(...e)=>c.onContainerFocus&&c.onContainerFocus(...e)),onBlur:n[7]||(n[7]=(...e)=>c.onContainerBlur&&c.onContainerBlur(...e)),onKeydown:n[8]||(n[8]=(...e)=>c.onContainerKeyDown&&c.onContainerKeyDown(...e))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.modelValue,((n,i)=>(t.openBlock(),t.createElementBlock("li",{key:`${i}_${n}`,id:p.id+"_chips_item_"+i,role:"option",class:t.normalizeClass(["p-chips-token",{"p-focus":p.focusedIndex===i}]),"aria-label":n,"aria-selected":!0,"aria-setsize":u.modelValue.length,"aria-posinset":i+1},[t.renderSlot(e.$slots,"chip",{value:n},(()=>[t.createElementVNode("span",a,t.toDisplayString(n),1)])),t.createElementVNode("span",{class:t.normalizeClass(["p-chips-token-icon",u.removeTokenIcon]),onClick:e=>c.removeItem(e,i),"aria-hidden":"true"},null,10,s)],10,l)))),128)),t.createElementVNode("li",o,[t.createElementVNode("input",t.mergeProps({ref:"input",id:u.inputId,type:"text",class:u.inputClass,style:u.inputStyle,disabled:u.disabled||c.maxedOut,placeholder:u.placeholder,onFocus:n[0]||(n[0]=e=>c.onFocus(e)),onBlur:n[1]||(n[1]=e=>c.onBlur(e)),onInput:n[2]||(n[2]=(...e)=>c.onInput&&c.onInput(...e)),onKeydown:n[3]||(n[3]=e=>c.onKeyDown(e)),onPaste:n[4]||(n[4]=e=>c.onPaste(e))},u.inputProps),null,16,d)])],40,i)],2)},n}(primevue.utils,Vue);
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <CDialog v-model:visible="visible" :modal="true" :header="header" :blockScroll="blockScroll" :position="position" class="p-confirm-dialog" :breakpoints="breakpoints" :closeOnEscape="closeOnEscape" @update:visible="onHide">
2
+ <CDialog v-model:visible="visible" role="alertdialog" class="p-confirm-dialog" :modal="true" :header="header" :blockScroll="blockScroll" :position="position" :breakpoints="breakpoints" :closeOnEscape="closeOnEscape" @update:visible="onHide">
3
3
  <template v-if="!$slots.message">
4
4
  <i :class="iconClass" />
5
5
  <span class="p-confirm-dialog-message">{{ message }}</span>
@@ -42,6 +42,11 @@ export default {
42
42
 
43
43
  if (options.group === this.group) {
44
44
  this.confirmation = options;
45
+
46
+ if (this.confirmation.onShow) {
47
+ this.confirmation.onShow();
48
+ }
49
+
45
50
  this.visible = true;
46
51
  }
47
52
  };
@@ -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;