primevue 3.52.0 → 3.53.1

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 (174) hide show
  1. package/README.md +1 -1
  2. package/api/Api.d.ts +58 -6
  3. package/api/api.cjs.js +58 -6
  4. package/api/api.cjs.min.js +1 -1
  5. package/api/api.esm.js +58 -6
  6. package/api/api.esm.min.js +1 -1
  7. package/api/api.js +58 -6
  8. package/api/api.min.js +1 -1
  9. package/autocomplete/AutoComplete.vue +1 -1
  10. package/autocomplete/autocomplete.cjs.js +2 -2
  11. package/autocomplete/autocomplete.cjs.min.js +1 -1
  12. package/autocomplete/autocomplete.esm.js +2 -2
  13. package/autocomplete/autocomplete.esm.min.js +1 -1
  14. package/autocomplete/autocomplete.js +2 -2
  15. package/autocomplete/autocomplete.min.js +1 -1
  16. package/basecomponent/BaseComponent.vue +11 -11
  17. package/basecomponent/basecomponent.cjs.js +20 -20
  18. package/basecomponent/basecomponent.cjs.min.js +1 -1
  19. package/basecomponent/basecomponent.esm.js +20 -20
  20. package/basecomponent/basecomponent.esm.min.js +1 -1
  21. package/basecomponent/basecomponent.js +20 -20
  22. package/basecomponent/basecomponent.min.js +1 -1
  23. package/basedirective/basedirective.cjs.js +5 -5
  24. package/basedirective/basedirective.cjs.min.js +1 -1
  25. package/basedirective/basedirective.esm.js +5 -5
  26. package/basedirective/basedirective.esm.min.js +1 -1
  27. package/basedirective/basedirective.js +5 -5
  28. package/basedirective/basedirective.min.js +1 -1
  29. package/calendar/BaseCalendar.vue +4 -0
  30. package/calendar/Calendar.d.ts +4 -0
  31. package/calendar/Calendar.vue +32 -18
  32. package/calendar/calendar.cjs.js +44 -26
  33. package/calendar/calendar.cjs.min.js +1 -1
  34. package/calendar/calendar.esm.js +44 -26
  35. package/calendar/calendar.esm.min.js +1 -1
  36. package/calendar/calendar.js +44 -26
  37. package/calendar/calendar.min.js +1 -1
  38. package/colorpicker/ColorPicker.vue +0 -23
  39. package/colorpicker/colorpicker.cjs.js +0 -19
  40. package/colorpicker/colorpicker.cjs.min.js +1 -1
  41. package/colorpicker/colorpicker.esm.js +0 -19
  42. package/colorpicker/colorpicker.esm.min.js +1 -1
  43. package/colorpicker/colorpicker.js +0 -19
  44. package/colorpicker/colorpicker.min.js +1 -1
  45. package/column/Column.d.ts +1 -1
  46. package/config/PrimeVue.d.ts +1 -10
  47. package/confirmationservice/ConfirmationService.d.ts +1 -7
  48. package/confirmpopup/ConfirmPopup.vue +6 -1
  49. package/confirmpopup/confirmpopup.cjs.js +5 -1
  50. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  51. package/confirmpopup/confirmpopup.esm.js +5 -1
  52. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  53. package/confirmpopup/confirmpopup.js +5 -1
  54. package/confirmpopup/confirmpopup.min.js +1 -1
  55. package/contextmenu/ContextMenu.vue +3 -1
  56. package/contextmenu/contextmenu.cjs.js +3 -1
  57. package/contextmenu/contextmenu.cjs.min.js +1 -1
  58. package/contextmenu/contextmenu.esm.js +3 -1
  59. package/contextmenu/contextmenu.esm.min.js +1 -1
  60. package/contextmenu/contextmenu.js +3 -1
  61. package/contextmenu/contextmenu.min.js +1 -1
  62. package/core/core.js +150 -59
  63. package/core/core.min.js +12 -10
  64. package/datatable/BodyCell.vue +8 -16
  65. package/datatable/DataTable.d.ts +1 -1
  66. package/datatable/DataTable.vue +3 -1
  67. package/datatable/datatable.cjs.js +10 -15
  68. package/datatable/datatable.cjs.min.js +1 -1
  69. package/datatable/datatable.esm.js +10 -15
  70. package/datatable/datatable.esm.min.js +1 -1
  71. package/datatable/datatable.js +10 -15
  72. package/datatable/datatable.min.js +1 -1
  73. package/dialog/Dialog.vue +9 -3
  74. package/dialog/dialog.cjs.js +10 -3
  75. package/dialog/dialog.cjs.min.js +1 -1
  76. package/dialog/dialog.esm.js +10 -3
  77. package/dialog/dialog.esm.min.js +1 -1
  78. package/dialog/dialog.js +10 -3
  79. package/dialog/dialog.min.js +1 -1
  80. package/dialogservice/DialogService.d.ts +1 -7
  81. package/dropdown/Dropdown.d.ts +1 -1
  82. package/dropdown/Dropdown.vue +17 -15
  83. package/dropdown/dropdown.cjs.js +15 -15
  84. package/dropdown/dropdown.cjs.min.js +1 -1
  85. package/dropdown/dropdown.esm.js +15 -15
  86. package/dropdown/dropdown.esm.min.js +1 -1
  87. package/dropdown/dropdown.js +15 -15
  88. package/dropdown/dropdown.min.js +1 -1
  89. package/floatlabel/floatlabel.js +1 -1
  90. package/floatlabel/floatlabel.min.js +1 -1
  91. package/inplace/Inplace.vue +2 -2
  92. package/inplace/inplace.cjs.js +3 -3
  93. package/inplace/inplace.cjs.min.js +1 -1
  94. package/inplace/inplace.esm.js +4 -4
  95. package/inplace/inplace.esm.min.js +1 -1
  96. package/inplace/inplace.js +3 -3
  97. package/inplace/inplace.min.js +1 -1
  98. package/inputnumber/InputNumber.vue +12 -2
  99. package/inputnumber/inputnumber.cjs.js +10 -2
  100. package/inputnumber/inputnumber.cjs.min.js +1 -1
  101. package/inputnumber/inputnumber.esm.js +10 -2
  102. package/inputnumber/inputnumber.esm.min.js +1 -1
  103. package/inputnumber/inputnumber.js +10 -2
  104. package/inputnumber/inputnumber.min.js +1 -1
  105. package/inputotp/InputOtp.vue +8 -0
  106. package/inputotp/inputotp.cjs.js +6 -0
  107. package/inputotp/inputotp.cjs.min.js +1 -1
  108. package/inputotp/inputotp.esm.js +6 -0
  109. package/inputotp/inputotp.esm.min.js +1 -1
  110. package/inputotp/inputotp.js +6 -0
  111. package/inputotp/inputotp.min.js +1 -1
  112. package/listbox/Listbox.d.ts +1 -1
  113. package/listbox/Listbox.vue +16 -5
  114. package/listbox/listbox.cjs.js +14 -5
  115. package/listbox/listbox.cjs.min.js +1 -1
  116. package/listbox/listbox.esm.js +14 -5
  117. package/listbox/listbox.esm.min.js +1 -1
  118. package/listbox/listbox.js +14 -5
  119. package/listbox/listbox.min.js +1 -1
  120. package/multiselect/MultiSelect.d.ts +1 -1
  121. package/multiselect/MultiSelect.vue +16 -10
  122. package/multiselect/multiselect.cjs.js +15 -8
  123. package/multiselect/multiselect.cjs.min.js +1 -1
  124. package/multiselect/multiselect.esm.js +15 -8
  125. package/multiselect/multiselect.esm.min.js +1 -1
  126. package/multiselect/multiselect.js +15 -8
  127. package/multiselect/multiselect.min.js +1 -1
  128. package/package.json +1 -1
  129. package/password/BasePassword.vue +2 -2
  130. package/password/Password.d.ts +2 -2
  131. package/password/password.cjs.js +2 -2
  132. package/password/password.cjs.min.js +1 -1
  133. package/password/password.esm.js +2 -2
  134. package/password/password.esm.min.js +1 -1
  135. package/password/password.js +2 -2
  136. package/password/password.min.js +1 -1
  137. package/ripple/ripple.cjs.js +1 -1
  138. package/ripple/ripple.cjs.min.js +1 -1
  139. package/ripple/ripple.esm.js +1 -1
  140. package/ripple/ripple.esm.min.js +1 -1
  141. package/ripple/ripple.js +1 -1
  142. package/ripple/ripple.min.js +1 -1
  143. package/splitbutton/SplitButton.vue +1 -0
  144. package/splitbutton/splitbutton.cjs.js +2 -1
  145. package/splitbutton/splitbutton.cjs.min.js +1 -1
  146. package/splitbutton/splitbutton.esm.js +2 -1
  147. package/splitbutton/splitbutton.esm.min.js +1 -1
  148. package/splitbutton/splitbutton.js +2 -1
  149. package/splitbutton/splitbutton.min.js +1 -1
  150. package/tieredmenu/TieredMenu.vue +3 -2
  151. package/tieredmenu/tieredmenu.cjs.js +4 -3
  152. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  153. package/tieredmenu/tieredmenu.esm.js +4 -3
  154. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  155. package/tieredmenu/tieredmenu.js +4 -3
  156. package/tieredmenu/tieredmenu.min.js +1 -1
  157. package/toastservice/ToastService.d.ts +1 -7
  158. package/tree/TreeNode.vue +4 -2
  159. package/tree/tree.cjs.js +4 -2
  160. package/tree/tree.cjs.min.js +1 -1
  161. package/tree/tree.esm.js +4 -2
  162. package/tree/tree.esm.min.js +1 -1
  163. package/tree/tree.js +4 -2
  164. package/tree/tree.min.js +1 -1
  165. package/treenode/TreeNode.d.ts +1 -1
  166. package/treeselect/TreeSelect.d.ts +1 -1
  167. package/virtualscroller/BaseVirtualScroller.vue +1 -1
  168. package/virtualscroller/virtualscroller.cjs.js +2 -2
  169. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  170. package/virtualscroller/virtualscroller.esm.js +2 -2
  171. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  172. package/virtualscroller/virtualscroller.js +2 -2
  173. package/virtualscroller/virtualscroller.min.js +1 -1
  174. package/web-types.json +1 -1
@@ -1 +1 @@
1
- import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ZIndexUtils as n,DomHandler as i,ConnectedOverlayScrollHandler as o}from"primevue/utils";import r from"primevue/basecomponent";import s from"primevue/colorpicker/style";import{resolveComponent as l,openBlock as a,createElementBlock as u,mergeProps as c,createCommentVNode as h,createVNode as d,withCtx as p,Transition as f,createElementVNode as b}from"vue";var m={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:r,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:[String,Object],default:"body"},panelClass:null},style:s,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(e)},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(e),this.updateInput()},updateModel:function(e){var t=this.modelValue;switch(this.format){case"hex":t=this.HSBtoHEX(this.hsbValue);break;case"rgb":t=this.HSBtoRGB(this.hsbValue);break;case"hsb":t=this.hsbValue}this.$emit("update:modelValue",t),this.$emit("change",{event:e,value:t})},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},validateRGB:function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},validateHEX:function(e){var t=6-e.length;if(t>0){for(var n=[],i=0;i<t;i++)n.push("0");n.push(e),e=n.join("")}return e},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.clear(e)},alignOverlay:function(){"self"===this.appendTo?i.relativePosition(this.picker,this.$refs.input):i.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&i.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&i.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&i.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new o(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!i.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(t){e.emit("overlay-click",{originalEvent:t,target:this.$el})}},components:{Portal:t}},g=["tabindex","disabled"];!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-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),m.render=function(e,t,n,i,o,r){var s=l("Portal");return a(),u("div",c({ref:"container",class:e.cx("root")},e.ptmi("root")),[e.inline?h("",!0):(a(),u("input",c({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return r.onInputClick&&r.onInputClick.apply(r,arguments)}),onKeydown:t[1]||(t[1]=function(){return r.onInputKeydown&&r.onInputKeydown.apply(r,arguments)})},e.ptm("input")),null,16,g)),d(s,{appendTo:e.appendTo,disabled:e.inline},{default:p((function(){return[d(f,c({name:"p-connected-overlay",onEnter:r.onOverlayEnter,onLeave:r.onOverlayLeave,onAfterLeave:r.onOverlayAfterLeave},e.ptm("transition")),{default:p((function(){return[e.inline||o.overlayVisible?(a(),u("div",c({key:0,ref:r.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return r.onOverlayClick&&r.onOverlayClick.apply(r,arguments)})},e.ptm("panel")),[b("div",c({class:e.cx("content")},e.ptm("content")),[b("div",c({ref:r.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return r.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return r.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return r.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return r.onDragEnd()})},e.ptm("selector")),[b("div",c({class:e.cx("color")},e.ptm("color")),[b("div",c({ref:r.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),b("div",c({ref:r.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return r.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return r.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return r.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return r.onDragEnd()})},e.ptm("hue")),[b("div",c({ref:r.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):h("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)};export{m as default};
1
+ import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ZIndexUtils as n,DomHandler as i,ConnectedOverlayScrollHandler as o}from"primevue/utils";import r from"primevue/basecomponent";import s from"primevue/colorpicker/style";import{resolveComponent as l,openBlock as u,createElementBlock as a,mergeProps as c,createCommentVNode as h,createVNode as d,withCtx as p,Transition as f,createElementVNode as b}from"vue";var m={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:r,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:[String,Object],default:"body"},panelClass:null},style:s,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(e)},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(e),this.updateInput()},updateModel:function(e){var t=this.modelValue;switch(this.format){case"hex":t=this.HSBtoHEX(this.hsbValue);break;case"rgb":t=this.HSBtoRGB(this.hsbValue);break;case"hsb":t=this.hsbValue}this.$emit("update:modelValue",t),this.$emit("change",{event:e,value:t})},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.clear(e)},alignOverlay:function(){"self"===this.appendTo?i.relativePosition(this.picker,this.$refs.input):i.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&i.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&i.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&i.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new o(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!i.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(t){e.emit("overlay-click",{originalEvent:t,target:this.$el})}},components:{Portal:t}},g=["tabindex","disabled"];!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-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),m.render=function(e,t,n,i,o,r){var s=l("Portal");return u(),a("div",c({ref:"container",class:e.cx("root")},e.ptmi("root")),[e.inline?h("",!0):(u(),a("input",c({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return r.onInputClick&&r.onInputClick.apply(r,arguments)}),onKeydown:t[1]||(t[1]=function(){return r.onInputKeydown&&r.onInputKeydown.apply(r,arguments)})},e.ptm("input")),null,16,g)),d(s,{appendTo:e.appendTo,disabled:e.inline},{default:p((function(){return[d(f,c({name:"p-connected-overlay",onEnter:r.onOverlayEnter,onLeave:r.onOverlayLeave,onAfterLeave:r.onOverlayAfterLeave},e.ptm("transition")),{default:p((function(){return[e.inline||o.overlayVisible?(u(),a("div",c({key:0,ref:r.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return r.onOverlayClick&&r.onOverlayClick.apply(r,arguments)})},e.ptm("panel")),[b("div",c({class:e.cx("content")},e.ptm("content")),[b("div",c({ref:r.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return r.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return r.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return r.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return r.onDragEnd()})},e.ptm("selector")),[b("div",c({class:e.cx("color")},e.ptm("color")),[b("div",c({ref:r.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),b("div",c({ref:r.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return r.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return r.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return r.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return r.onDragEnd()})},e.ptm("hue")),[b("div",c({ref:r.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):h("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)};export{m as default};
@@ -196,25 +196,6 @@ this.primevue.colorpicker = (function (OverlayEventBus, Portal, utils, BaseCompo
196
196
  b: Math.min(100, Math.max(0, hsb.b))
197
197
  };
198
198
  },
199
- validateRGB: function validateRGB(rgb) {
200
- return {
201
- r: Math.min(255, Math.max(0, rgb.r)),
202
- g: Math.min(255, Math.max(0, rgb.g)),
203
- b: Math.min(255, Math.max(0, rgb.b))
204
- };
205
- },
206
- validateHEX: function validateHEX(hex) {
207
- var len = 6 - hex.length;
208
- if (len > 0) {
209
- var o = [];
210
- for (var i = 0; i < len; i++) {
211
- o.push('0');
212
- }
213
- o.push(hex);
214
- hex = o.join('');
215
- }
216
- return hex;
217
- },
218
199
  HEXtoRGB: function HEXtoRGB(hex) {
219
200
  var hexValue = parseInt(hex.indexOf('#') > -1 ? hex.substring(1) : hex, 16);
220
201
  return {
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.colorpicker=function(e,t,n,i,o,r){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),a=s(t),u={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:s(i).default,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:[String,Object],default:"body"},panelClass:null},style:s(o).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.ZIndexUtils.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(e)},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(e),this.updateInput()},updateModel:function(e){var t=this.modelValue;switch(this.format){case"hex":t=this.HSBtoHEX(this.hsbValue);break;case"rgb":t=this.HSBtoRGB(this.hsbValue);break;case"hsb":t=this.hsbValue}this.$emit("update:modelValue",t),this.$emit("change",{event:e,value:t})},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},validateRGB:function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},validateHEX:function(e){var t=6-e.length;if(t>0){for(var n=[],i=0;i<t;i++)n.push("0");n.push(e),e=n.join("")}return e},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.ZIndexUtils.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?n.DomHandler.relativePosition(this.picker,this.$refs.input):n.DomHandler.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&n.DomHandler.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!n.DomHandler.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},components:{Portal:a.default}},c=["tabindex","disabled"];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],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-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),u.render=function(e,t,n,i,o,s){var l=r.resolveComponent("Portal");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:"container",class:e.cx("root")},e.ptmi("root")),[e.inline?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return s.onInputClick&&s.onInputClick.apply(s,arguments)}),onKeydown:t[1]||(t[1]=function(){return s.onInputKeydown&&s.onInputKeydown.apply(s,arguments)})},e.ptm("input")),null,16,c)),r.createVNode(l,{appendTo:e.appendTo,disabled:e.inline},{default:r.withCtx((function(){return[r.createVNode(r.Transition,r.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:r.withCtx((function(){return[e.inline||o.overlayVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:s.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)})},e.ptm("panel")),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},e.ptm("content")),[r.createElementVNode("div",r.mergeProps({ref:s.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return s.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return s.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return s.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return s.onDragEnd()})},e.ptm("selector")),[r.createElementVNode("div",r.mergeProps({class:e.cx("color")},e.ptm("color")),[r.createElementVNode("div",r.mergeProps({ref:s.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),r.createElementVNode("div",r.mergeProps({ref:s.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return s.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return s.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return s.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return s.onDragEnd()})},e.ptm("hue")),[r.createElementVNode("div",r.mergeProps({ref:s.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):r.createCommentVNode("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)},u}(primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.colorpicker.style,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.colorpicker=function(e,t,n,i,o,r){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),a=s(t),u={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:s(i).default,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:[String,Object],default:"body"},panelClass:null},style:s(o).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.ZIndexUtils.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(e)},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(e),this.updateInput()},updateModel:function(e){var t=this.modelValue;switch(this.format){case"hex":t=this.HSBtoHEX(this.hsbValue);break;case"rgb":t=this.HSBtoRGB(this.hsbValue);break;case"hsb":t=this.hsbValue}this.$emit("update:modelValue",t),this.$emit("change",{event:e,value:t})},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.ZIndexUtils.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?n.DomHandler.relativePosition(this.picker,this.$refs.input):n.DomHandler.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&n.DomHandler.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!n.DomHandler.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},components:{Portal:a.default}},c=["tabindex","disabled"];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],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-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),u.render=function(e,t,n,i,o,s){var l=r.resolveComponent("Portal");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:"container",class:e.cx("root")},e.ptmi("root")),[e.inline?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return s.onInputClick&&s.onInputClick.apply(s,arguments)}),onKeydown:t[1]||(t[1]=function(){return s.onInputKeydown&&s.onInputKeydown.apply(s,arguments)})},e.ptm("input")),null,16,c)),r.createVNode(l,{appendTo:e.appendTo,disabled:e.inline},{default:r.withCtx((function(){return[r.createVNode(r.Transition,r.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:r.withCtx((function(){return[e.inline||o.overlayVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:s.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)})},e.ptm("panel")),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},e.ptm("content")),[r.createElementVNode("div",r.mergeProps({ref:s.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return s.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return s.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return s.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return s.onDragEnd()})},e.ptm("selector")),[r.createElementVNode("div",r.mergeProps({class:e.cx("color")},e.ptm("color")),[r.createElementVNode("div",r.mergeProps({ref:s.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),r.createElementVNode("div",r.mergeProps({ref:s.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return s.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return s.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return s.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return s.onDragEnd()})},e.ptm("hue")),[r.createElementVNode("div",r.mergeProps({ref:s.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):r.createCommentVNode("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)},u}(primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.colorpicker.style,Vue);
@@ -689,7 +689,7 @@ export interface ColumnSlots {
689
689
  */
690
690
  editorInitCallback: (event: Event) => void;
691
691
  /**
692
- * Row toggler callback unction
692
+ * Row toggler callback function
693
693
  * @param {Event} event - Browser event
694
694
  */
695
695
  rowTogglerCallback: (event: Event) => void;
@@ -358,16 +358,7 @@ export declare function usePrimeVue(): {
358
358
  declare const plugin: Plugin;
359
359
  export default plugin;
360
360
 
361
- declare module 'vue/types/vue' {
362
- interface Vue {
363
- $primevue: {
364
- config: PrimeVueConfiguration;
365
- changeTheme: PrimeVueChangeTheme;
366
- };
367
- }
368
- }
369
-
370
- declare module '@vue/runtime-core' {
361
+ declare module 'vue' {
371
362
  interface ComponentCustomProperties {
372
363
  $primevue: {
373
364
  config: PrimeVueConfiguration;
@@ -27,13 +27,7 @@ export interface ConfirmationServiceMethods {
27
27
  close(): void;
28
28
  }
29
29
 
30
- declare module 'vue/types/vue' {
31
- interface Vue {
32
- $confirm: ConfirmationServiceMethods;
33
- }
34
- }
35
-
36
- declare module '@vue/runtime-core' {
30
+ declare module 'vue' {
37
31
  interface ComponentCustomProperties {
38
32
  $confirm: ConfirmationServiceMethods;
39
33
  }
@@ -54,7 +54,8 @@ export default {
54
54
  visible: false,
55
55
  confirmation: null,
56
56
  autoFocusAccept: null,
57
- autoFocusReject: null
57
+ autoFocusReject: null,
58
+ target: null
58
59
  };
59
60
  },
60
61
  target: null,
@@ -150,6 +151,7 @@ export default {
150
151
  onEnter(el) {
151
152
  this.autoFocusAccept = this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false;
152
153
  this.autoFocusReject = this.confirmation.defaultFocus === 'reject' ? true : false;
154
+ this.target = document.activeElement;
153
155
 
154
156
  this.bindOutsideClickListener();
155
157
  this.bindScrollListener();
@@ -164,6 +166,9 @@ export default {
164
166
  this.autoFocusAccept = null;
165
167
  this.autoFocusReject = null;
166
168
 
169
+ DomHandler.focus(this.target);
170
+ this.target = null;
171
+
167
172
  this.unbindOutsideClickListener();
168
173
  this.unbindScrollListener();
169
174
  this.unbindResizeListener();
@@ -43,7 +43,8 @@ var script = {
43
43
  visible: false,
44
44
  confirmation: null,
45
45
  autoFocusAccept: null,
46
- autoFocusReject: null
46
+ autoFocusReject: null,
47
+ target: null
47
48
  };
48
49
  },
49
50
  target: null,
@@ -127,6 +128,7 @@ var script = {
127
128
  onEnter: function onEnter(el) {
128
129
  this.autoFocusAccept = this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false;
129
130
  this.autoFocusReject = this.confirmation.defaultFocus === 'reject' ? true : false;
131
+ this.target = document.activeElement;
130
132
  this.bindOutsideClickListener();
131
133
  this.bindScrollListener();
132
134
  this.bindResizeListener();
@@ -138,6 +140,8 @@ var script = {
138
140
  onLeave: function onLeave() {
139
141
  this.autoFocusAccept = null;
140
142
  this.autoFocusReject = null;
143
+ utils.DomHandler.focus(this.target);
144
+ this.target = null;
141
145
  this.unbindOutsideClickListener();
142
146
  this.unbindScrollListener();
143
147
  this.unbindResizeListener();
@@ -1 +1 @@
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"),c=require("primevue/basecomponent"),s=require("primevue/confirmpopup/style"),l=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),f=a(t),d=a(n),m=a(i),p=a(o),h={name:"ConfirmPopup",extends:{name:"BaseConfirmPopup",extends:a(c).default,props:{group:String},style:a(s).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,data:function(){return{visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted:function(){var e=this;this.confirmListener=function(t){t&&t.group===e.group&&(e.confirmation=t,e.target=t.target,e.confirmation.onShow&&e.confirmation.onShow(),e.visible=!0)},this.closeListener=function(){e.visible=!1,e.confirmation=null},f.default.on("confirm",this.confirmListener),f.default.on("close",this.closeListener)},beforeUnmount:function(){f.default.off("confirm",this.confirmListener),f.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:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown:function(e){"Space"!==e.code&&"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.accept(),r.DomHandler.focus(this.target),e.preventDefault())},onRejectKeydown:function(e){"Space"!==e.code&&"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.reject(),r.DomHandler.focus(this.target),e.preventDefault())},onEnter:function(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),r.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter:function(){this.focus()},onLeave:function(){this.autoFocusAccept=null,this.autoFocusReject=null,this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave:function(e){r.ZIndexUtils.clear(e)},alignOverlay:function(){r.DomHandler.absolutePosition(this.container,this.target,!1);var e=r.DomHandler.getOffset(this.container),t=r.DomHandler.getOffset(this.target),n=0;e.left<t.left&&(n=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&(this.container.setAttribute("data-p-confirm-popup-flipped","true"),!this.isUnstyled&&r.DomHandler.addClass(this.container,"p-confirm-popup-flipped"))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.visible&&e.container&&!e.container.contains(t.target)&&!e.isTargetClicked(t)?(e.confirmation.onHide&&e.confirmation.onHide(),e.visible=!1):e.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new r.ConnectedOverlayScrollHandler(this.target,(function(){e.visible&&(e.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.visible&&!r.DomHandler.isTouchDevice()&&(e.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus:function(){var e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked:function(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef:function(e){this.container=e},onOverlayClick:function(e){m.default.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown:function(e){"Escape"===e.code&&(f.default.emit("close",this.closeListener),r.DomHandler.focus(this.target))},getCXOptions:function(e,t){return{contenxt:{icon:e,iconClass:t.class}}}},computed:{message:function(){return this.confirmation?this.confirmation.message:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null}},components:{CPButton:u.default,Portal:p.default},directives:{focustrap:d.default}},v=["aria-modal"];h.render=function(e,t,n,i,o,r){var c=l.resolveComponent("CPButton"),s=l.resolveComponent("Portal"),a=l.resolveDirective("focustrap");return l.openBlock(),l.createBlock(s,null,{default:l.withCtx((function(){return[l.createVNode(l.Transition,l.mergeProps({name:"p-confirm-popup",onEnter:r.onEnter,onAfterEnter:r.onAfterEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},e.ptm("transition")),{default:l.withCtx((function(){return[o.visible?l.withDirectives((l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:r.containerRef,role:"alertdialog",class:e.cx("root"),"aria-modal":o.visible,onClick:t[2]||(t[2]=function(){return r.onOverlayClick&&r.onOverlayClick.apply(r,arguments)}),onKeydown:t[3]||(t[3]=function(){return r.onOverlayKeydown&&r.onOverlayKeydown.apply(r,arguments)})},e.ptmi("root")),[e.$slots.container?l.renderSlot(e.$slots,"container",{key:0,message:o.confirmation,onAccept:r.accept,onReject:r.reject,acceptCallback:r.accept,rejectCallback:r.reject}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[e.$slots.message?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("content")},e.ptm("content")),[l.renderSlot(e.$slots,"icon",{},(function(){return[e.$slots.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.icon),{key:0,class:l.normalizeClass(e.cx("icon"))},null,8,["class"])):o.confirmation.icon?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,class:[o.confirmation.icon,e.cx("icon")]},e.ptm("icon")),null,16)):l.createCommentVNode("",!0)]})),l.createElementVNode("span",l.mergeProps({class:e.cx("message")},e.ptm("message")),l.toDisplayString(o.confirmation.message),17)],16)),l.createElementVNode("div",l.mergeProps({class:e.cx("footer")},e.ptm("footer")),[l.createVNode(c,{label:r.rejectLabel,onClick:t[0]||(t[0]=function(e){return r.reject()}),onKeydown:r.onRejectKeydown,autofocus:o.autoFocusReject,class:l.normalizeClass([e.cx("rejectButton"),o.confirmation.rejectClass]),unstyled:e.unstyled,pt:e.ptm("rejectButton")},l.createSlots({_:2},[r.rejectIcon||e.$slots.rejecticon?{name:"icon",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"rejecticon",{},(function(){return[l.createElementVNode("span",l.mergeProps({class:[r.rejectIcon,t.class]},e.ptm("rejectButton").icon,{"data-pc-section":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"]),l.createVNode(c,{label:r.acceptLabel,onClick:t[1]||(t[1]=function(e){return r.accept()}),onKeydown:r.onAcceptKeydown,autofocus:o.autoFocusAccept,class:l.normalizeClass([e.cx("acceptButton"),o.confirmation.acceptClass]),unstyled:e.unstyled,pt:e.ptm("acceptButton")},l.createSlots({_:2},[r.acceptIcon||e.$slots.accepticon?{name:"icon",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"accepticon",{},(function(){return[l.createElementVNode("span",l.mergeProps({class:[r.acceptIcon,t.class]},e.ptm("acceptButton").icon,{"data-pc-section":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"])],16)],64))],16,v)),[[a]]):l.createCommentVNode("",!0)]})),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:3})},module.exports=h;
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"),c=require("primevue/basecomponent"),s=require("primevue/confirmpopup/style"),l=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),f=a(t),d=a(n),m=a(i),p=a(o),h={name:"ConfirmPopup",extends:{name:"BaseConfirmPopup",extends:a(c).default,props:{group:String},style:a(s).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,data:function(){return{visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null,target:null}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted:function(){var e=this;this.confirmListener=function(t){t&&t.group===e.group&&(e.confirmation=t,e.target=t.target,e.confirmation.onShow&&e.confirmation.onShow(),e.visible=!0)},this.closeListener=function(){e.visible=!1,e.confirmation=null},f.default.on("confirm",this.confirmListener),f.default.on("close",this.closeListener)},beforeUnmount:function(){f.default.off("confirm",this.confirmListener),f.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:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown:function(e){"Space"!==e.code&&"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.accept(),r.DomHandler.focus(this.target),e.preventDefault())},onRejectKeydown:function(e){"Space"!==e.code&&"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.reject(),r.DomHandler.focus(this.target),e.preventDefault())},onEnter:function(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.target=document.activeElement,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),r.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter:function(){this.focus()},onLeave:function(){this.autoFocusAccept=null,this.autoFocusReject=null,r.DomHandler.focus(this.target),this.target=null,this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave:function(e){r.ZIndexUtils.clear(e)},alignOverlay:function(){r.DomHandler.absolutePosition(this.container,this.target,!1);var e=r.DomHandler.getOffset(this.container),t=r.DomHandler.getOffset(this.target),n=0;e.left<t.left&&(n=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&(this.container.setAttribute("data-p-confirm-popup-flipped","true"),!this.isUnstyled&&r.DomHandler.addClass(this.container,"p-confirm-popup-flipped"))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.visible&&e.container&&!e.container.contains(t.target)&&!e.isTargetClicked(t)?(e.confirmation.onHide&&e.confirmation.onHide(),e.visible=!1):e.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new r.ConnectedOverlayScrollHandler(this.target,(function(){e.visible&&(e.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.visible&&!r.DomHandler.isTouchDevice()&&(e.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus:function(){var e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked:function(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef:function(e){this.container=e},onOverlayClick:function(e){m.default.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown:function(e){"Escape"===e.code&&(f.default.emit("close",this.closeListener),r.DomHandler.focus(this.target))},getCXOptions:function(e,t){return{contenxt:{icon:e,iconClass:t.class}}}},computed:{message:function(){return this.confirmation?this.confirmation.message:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null}},components:{CPButton:u.default,Portal:p.default},directives:{focustrap:d.default}},v=["aria-modal"];h.render=function(e,t,n,i,o,r){var c=l.resolveComponent("CPButton"),s=l.resolveComponent("Portal"),a=l.resolveDirective("focustrap");return l.openBlock(),l.createBlock(s,null,{default:l.withCtx((function(){return[l.createVNode(l.Transition,l.mergeProps({name:"p-confirm-popup",onEnter:r.onEnter,onAfterEnter:r.onAfterEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},e.ptm("transition")),{default:l.withCtx((function(){return[o.visible?l.withDirectives((l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:r.containerRef,role:"alertdialog",class:e.cx("root"),"aria-modal":o.visible,onClick:t[2]||(t[2]=function(){return r.onOverlayClick&&r.onOverlayClick.apply(r,arguments)}),onKeydown:t[3]||(t[3]=function(){return r.onOverlayKeydown&&r.onOverlayKeydown.apply(r,arguments)})},e.ptmi("root")),[e.$slots.container?l.renderSlot(e.$slots,"container",{key:0,message:o.confirmation,onAccept:r.accept,onReject:r.reject,acceptCallback:r.accept,rejectCallback:r.reject}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[e.$slots.message?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("content")},e.ptm("content")),[l.renderSlot(e.$slots,"icon",{},(function(){return[e.$slots.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.icon),{key:0,class:l.normalizeClass(e.cx("icon"))},null,8,["class"])):o.confirmation.icon?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,class:[o.confirmation.icon,e.cx("icon")]},e.ptm("icon")),null,16)):l.createCommentVNode("",!0)]})),l.createElementVNode("span",l.mergeProps({class:e.cx("message")},e.ptm("message")),l.toDisplayString(o.confirmation.message),17)],16)),l.createElementVNode("div",l.mergeProps({class:e.cx("footer")},e.ptm("footer")),[l.createVNode(c,{label:r.rejectLabel,onClick:t[0]||(t[0]=function(e){return r.reject()}),onKeydown:r.onRejectKeydown,autofocus:o.autoFocusReject,class:l.normalizeClass([e.cx("rejectButton"),o.confirmation.rejectClass]),unstyled:e.unstyled,pt:e.ptm("rejectButton")},l.createSlots({_:2},[r.rejectIcon||e.$slots.rejecticon?{name:"icon",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"rejecticon",{},(function(){return[l.createElementVNode("span",l.mergeProps({class:[r.rejectIcon,t.class]},e.ptm("rejectButton").icon,{"data-pc-section":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"]),l.createVNode(c,{label:r.acceptLabel,onClick:t[1]||(t[1]=function(e){return r.accept()}),onKeydown:r.onAcceptKeydown,autofocus:o.autoFocusAccept,class:l.normalizeClass([e.cx("acceptButton"),o.confirmation.acceptClass]),unstyled:e.unstyled,pt:e.ptm("acceptButton")},l.createSlots({_:2},[r.acceptIcon||e.$slots.accepticon?{name:"icon",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"accepticon",{},(function(){return[l.createElementVNode("span",l.mergeProps({class:[r.acceptIcon,t.class]},e.ptm("acceptButton").icon,{"data-pc-section":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"])],16)],64))],16,v)),[[a]]):l.createCommentVNode("",!0)]})),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:3})},module.exports=h;
@@ -31,7 +31,8 @@ var script = {
31
31
  visible: false,
32
32
  confirmation: null,
33
33
  autoFocusAccept: null,
34
- autoFocusReject: null
34
+ autoFocusReject: null,
35
+ target: null
35
36
  };
36
37
  },
37
38
  target: null,
@@ -115,6 +116,7 @@ var script = {
115
116
  onEnter: function onEnter(el) {
116
117
  this.autoFocusAccept = this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false;
117
118
  this.autoFocusReject = this.confirmation.defaultFocus === 'reject' ? true : false;
119
+ this.target = document.activeElement;
118
120
  this.bindOutsideClickListener();
119
121
  this.bindScrollListener();
120
122
  this.bindResizeListener();
@@ -126,6 +128,8 @@ var script = {
126
128
  onLeave: function onLeave() {
127
129
  this.autoFocusAccept = null;
128
130
  this.autoFocusReject = null;
131
+ DomHandler.focus(this.target);
132
+ this.target = null;
129
133
  this.unbindOutsideClickListener();
130
134
  this.unbindScrollListener();
131
135
  this.unbindResizeListener();
@@ -1 +1 @@
1
- import t from"primevue/button";import e from"primevue/confirmationeventbus";import n from"primevue/focustrap";import i from"primevue/overlayeventbus";import o from"primevue/portal";import{ZIndexUtils as c,DomHandler as s,ConnectedOverlayScrollHandler as r}from"primevue/utils";import a from"primevue/basecomponent";import l from"primevue/confirmpopup/style";import{resolveComponent as u,resolveDirective as f,openBlock as p,createBlock as m,withCtx as d,createVNode as h,Transition as v,mergeProps as L,withDirectives as b,createElementBlock as y,renderSlot as g,Fragment as k,resolveDynamicComponent as j,normalizeClass as C,createCommentVNode as w,createElementVNode as A,toDisplayString as E,createSlots as O}from"vue";var z={name:"ConfirmPopup",extends:{name:"BaseConfirmPopup",extends:a,props:{group:String},style:l,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,data:function(){return{visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted:function(){var t=this;this.confirmListener=function(e){e&&e.group===t.group&&(t.confirmation=e,t.target=e.target,t.confirmation.onShow&&t.confirmation.onShow(),t.visible=!0)},this.closeListener=function(){t.visible=!1,t.confirmation=null},e.on("confirm",this.confirmListener),e.on("close",this.closeListener)},beforeUnmount:function(){e.off("confirm",this.confirmListener),e.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(c.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown:function(t){"Space"!==t.code&&"Enter"!==t.code&&"NumpadEnter"!==t.code||(this.accept(),s.focus(this.target),t.preventDefault())},onRejectKeydown:function(t){"Space"!==t.code&&"Enter"!==t.code&&"NumpadEnter"!==t.code||(this.reject(),s.focus(this.target),t.preventDefault())},onEnter:function(t){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),c.set("overlay",t,this.$primevue.config.zIndex.overlay)},onAfterEnter:function(){this.focus()},onLeave:function(){this.autoFocusAccept=null,this.autoFocusReject=null,this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave:function(t){c.clear(t)},alignOverlay:function(){s.absolutePosition(this.container,this.target,!1);var t=s.getOffset(this.container),e=s.getOffset(this.target),n=0;t.left<e.left&&(n=e.left-t.left),this.container.style.setProperty("--overlayArrowLeft","".concat(n,"px")),t.top<e.top&&(this.container.setAttribute("data-p-confirm-popup-flipped","true"),!this.isUnstyled&&s.addClass(this.container,"p-confirm-popup-flipped"))},bindOutsideClickListener:function(){var t=this;this.outsideClickListener||(this.outsideClickListener=function(e){t.visible&&t.container&&!t.container.contains(e.target)&&!t.isTargetClicked(e)?(t.confirmation.onHide&&t.confirmation.onHide(),t.visible=!1):t.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var t=this;this.scrollHandler||(this.scrollHandler=new r(this.target,(function(){t.visible&&(t.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var t=this;this.resizeListener||(this.resizeListener=function(){t.visible&&!s.isTouchDevice()&&(t.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus:function(){var t=this.container.querySelector("[autofocus]");t&&t.focus({preventScroll:!0})},isTargetClicked:function(t){return this.target&&(this.target===t.target||this.target.contains(t.target))},containerRef:function(t){this.container=t},onOverlayClick:function(t){i.emit("overlay-click",{originalEvent:t,target:this.target})},onOverlayKeydown:function(t){"Escape"===t.code&&(e.emit("close",this.closeListener),s.focus(this.target))},getCXOptions:function(t,e){return{contenxt:{icon:t,iconClass:e.class}}}},computed:{message:function(){return this.confirmation?this.confirmation.message:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null}},components:{CPButton:t,Portal:o},directives:{focustrap:n}},$=["aria-modal"];z.render=function(t,e,n,i,o,c){var s=u("CPButton"),r=u("Portal"),a=f("focustrap");return p(),m(r,null,{default:d((function(){return[h(v,L({name:"p-confirm-popup",onEnter:c.onEnter,onAfterEnter:c.onAfterEnter,onLeave:c.onLeave,onAfterLeave:c.onAfterLeave},t.ptm("transition")),{default:d((function(){return[o.visible?b((p(),y("div",L({key:0,ref:c.containerRef,role:"alertdialog",class:t.cx("root"),"aria-modal":o.visible,onClick:e[2]||(e[2]=function(){return c.onOverlayClick&&c.onOverlayClick.apply(c,arguments)}),onKeydown:e[3]||(e[3]=function(){return c.onOverlayKeydown&&c.onOverlayKeydown.apply(c,arguments)})},t.ptmi("root")),[t.$slots.container?g(t.$slots,"container",{key:0,message:o.confirmation,onAccept:c.accept,onReject:c.reject,acceptCallback:c.accept,rejectCallback:c.reject}):(p(),y(k,{key:1},[t.$slots.message?(p(),m(j(t.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(p(),y("div",L({key:0,class:t.cx("content")},t.ptm("content")),[g(t.$slots,"icon",{},(function(){return[t.$slots.icon?(p(),m(j(t.$slots.icon),{key:0,class:C(t.cx("icon"))},null,8,["class"])):o.confirmation.icon?(p(),y("span",L({key:1,class:[o.confirmation.icon,t.cx("icon")]},t.ptm("icon")),null,16)):w("",!0)]})),A("span",L({class:t.cx("message")},t.ptm("message")),E(o.confirmation.message),17)],16)),A("div",L({class:t.cx("footer")},t.ptm("footer")),[h(s,{label:c.rejectLabel,onClick:e[0]||(e[0]=function(t){return c.reject()}),onKeydown:c.onRejectKeydown,autofocus:o.autoFocusReject,class:C([t.cx("rejectButton"),o.confirmation.rejectClass]),unstyled:t.unstyled,pt:t.ptm("rejectButton")},O({_:2},[c.rejectIcon||t.$slots.rejecticon?{name:"icon",fn:d((function(e){return[g(t.$slots,"rejecticon",{},(function(){return[A("span",L({class:[c.rejectIcon,e.class]},t.ptm("rejectButton").icon,{"data-pc-section":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"]),h(s,{label:c.acceptLabel,onClick:e[1]||(e[1]=function(t){return c.accept()}),onKeydown:c.onAcceptKeydown,autofocus:o.autoFocusAccept,class:C([t.cx("acceptButton"),o.confirmation.acceptClass]),unstyled:t.unstyled,pt:t.ptm("acceptButton")},O({_:2},[c.acceptIcon||t.$slots.accepticon?{name:"icon",fn:d((function(e){return[g(t.$slots,"accepticon",{},(function(){return[A("span",L({class:[c.acceptIcon,e.class]},t.ptm("acceptButton").icon,{"data-pc-section":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"])],16)],64))],16,$)),[[a]]):w("",!0)]})),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:3})};export{z as default};
1
+ import t from"primevue/button";import e from"primevue/confirmationeventbus";import n from"primevue/focustrap";import i from"primevue/overlayeventbus";import o from"primevue/portal";import{ZIndexUtils as c,DomHandler as s,ConnectedOverlayScrollHandler as r}from"primevue/utils";import a from"primevue/basecomponent";import l from"primevue/confirmpopup/style";import{resolveComponent as u,resolveDirective as f,openBlock as p,createBlock as m,withCtx as d,createVNode as h,Transition as v,mergeProps as L,withDirectives as b,createElementBlock as y,renderSlot as g,Fragment as k,resolveDynamicComponent as j,normalizeClass as C,createCommentVNode as w,createElementVNode as E,toDisplayString as A,createSlots as O}from"vue";var z={name:"ConfirmPopup",extends:{name:"BaseConfirmPopup",extends:a,props:{group:String},style:l,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,data:function(){return{visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null,target:null}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted:function(){var t=this;this.confirmListener=function(e){e&&e.group===t.group&&(t.confirmation=e,t.target=e.target,t.confirmation.onShow&&t.confirmation.onShow(),t.visible=!0)},this.closeListener=function(){t.visible=!1,t.confirmation=null},e.on("confirm",this.confirmListener),e.on("close",this.closeListener)},beforeUnmount:function(){e.off("confirm",this.confirmListener),e.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(c.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown:function(t){"Space"!==t.code&&"Enter"!==t.code&&"NumpadEnter"!==t.code||(this.accept(),s.focus(this.target),t.preventDefault())},onRejectKeydown:function(t){"Space"!==t.code&&"Enter"!==t.code&&"NumpadEnter"!==t.code||(this.reject(),s.focus(this.target),t.preventDefault())},onEnter:function(t){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.target=document.activeElement,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),c.set("overlay",t,this.$primevue.config.zIndex.overlay)},onAfterEnter:function(){this.focus()},onLeave:function(){this.autoFocusAccept=null,this.autoFocusReject=null,s.focus(this.target),this.target=null,this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave:function(t){c.clear(t)},alignOverlay:function(){s.absolutePosition(this.container,this.target,!1);var t=s.getOffset(this.container),e=s.getOffset(this.target),n=0;t.left<e.left&&(n=e.left-t.left),this.container.style.setProperty("--overlayArrowLeft","".concat(n,"px")),t.top<e.top&&(this.container.setAttribute("data-p-confirm-popup-flipped","true"),!this.isUnstyled&&s.addClass(this.container,"p-confirm-popup-flipped"))},bindOutsideClickListener:function(){var t=this;this.outsideClickListener||(this.outsideClickListener=function(e){t.visible&&t.container&&!t.container.contains(e.target)&&!t.isTargetClicked(e)?(t.confirmation.onHide&&t.confirmation.onHide(),t.visible=!1):t.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var t=this;this.scrollHandler||(this.scrollHandler=new r(this.target,(function(){t.visible&&(t.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var t=this;this.resizeListener||(this.resizeListener=function(){t.visible&&!s.isTouchDevice()&&(t.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus:function(){var t=this.container.querySelector("[autofocus]");t&&t.focus({preventScroll:!0})},isTargetClicked:function(t){return this.target&&(this.target===t.target||this.target.contains(t.target))},containerRef:function(t){this.container=t},onOverlayClick:function(t){i.emit("overlay-click",{originalEvent:t,target:this.target})},onOverlayKeydown:function(t){"Escape"===t.code&&(e.emit("close",this.closeListener),s.focus(this.target))},getCXOptions:function(t,e){return{contenxt:{icon:t,iconClass:e.class}}}},computed:{message:function(){return this.confirmation?this.confirmation.message:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null}},components:{CPButton:t,Portal:o},directives:{focustrap:n}},$=["aria-modal"];z.render=function(t,e,n,i,o,c){var s=u("CPButton"),r=u("Portal"),a=f("focustrap");return p(),m(r,null,{default:d((function(){return[h(v,L({name:"p-confirm-popup",onEnter:c.onEnter,onAfterEnter:c.onAfterEnter,onLeave:c.onLeave,onAfterLeave:c.onAfterLeave},t.ptm("transition")),{default:d((function(){return[o.visible?b((p(),y("div",L({key:0,ref:c.containerRef,role:"alertdialog",class:t.cx("root"),"aria-modal":o.visible,onClick:e[2]||(e[2]=function(){return c.onOverlayClick&&c.onOverlayClick.apply(c,arguments)}),onKeydown:e[3]||(e[3]=function(){return c.onOverlayKeydown&&c.onOverlayKeydown.apply(c,arguments)})},t.ptmi("root")),[t.$slots.container?g(t.$slots,"container",{key:0,message:o.confirmation,onAccept:c.accept,onReject:c.reject,acceptCallback:c.accept,rejectCallback:c.reject}):(p(),y(k,{key:1},[t.$slots.message?(p(),m(j(t.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(p(),y("div",L({key:0,class:t.cx("content")},t.ptm("content")),[g(t.$slots,"icon",{},(function(){return[t.$slots.icon?(p(),m(j(t.$slots.icon),{key:0,class:C(t.cx("icon"))},null,8,["class"])):o.confirmation.icon?(p(),y("span",L({key:1,class:[o.confirmation.icon,t.cx("icon")]},t.ptm("icon")),null,16)):w("",!0)]})),E("span",L({class:t.cx("message")},t.ptm("message")),A(o.confirmation.message),17)],16)),E("div",L({class:t.cx("footer")},t.ptm("footer")),[h(s,{label:c.rejectLabel,onClick:e[0]||(e[0]=function(t){return c.reject()}),onKeydown:c.onRejectKeydown,autofocus:o.autoFocusReject,class:C([t.cx("rejectButton"),o.confirmation.rejectClass]),unstyled:t.unstyled,pt:t.ptm("rejectButton")},O({_:2},[c.rejectIcon||t.$slots.rejecticon?{name:"icon",fn:d((function(e){return[g(t.$slots,"rejecticon",{},(function(){return[E("span",L({class:[c.rejectIcon,e.class]},t.ptm("rejectButton").icon,{"data-pc-section":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"]),h(s,{label:c.acceptLabel,onClick:e[1]||(e[1]=function(t){return c.accept()}),onKeydown:c.onAcceptKeydown,autofocus:o.autoFocusAccept,class:C([t.cx("acceptButton"),o.confirmation.acceptClass]),unstyled:t.unstyled,pt:t.ptm("acceptButton")},O({_:2},[c.acceptIcon||t.$slots.accepticon?{name:"icon",fn:d((function(e){return[g(t.$slots,"accepticon",{},(function(){return[E("span",L({class:[c.acceptIcon,e.class]},t.ptm("acceptButton").icon,{"data-pc-section":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"])],16)],64))],16,$)),[[a]]):w("",!0)]})),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:3})};export{z as default};
@@ -35,7 +35,8 @@ this.primevue.confirmpopup = (function (Button, ConfirmationEventBus, FocusTrap,
35
35
  visible: false,
36
36
  confirmation: null,
37
37
  autoFocusAccept: null,
38
- autoFocusReject: null
38
+ autoFocusReject: null,
39
+ target: null
39
40
  };
40
41
  },
41
42
  target: null,
@@ -119,6 +120,7 @@ this.primevue.confirmpopup = (function (Button, ConfirmationEventBus, FocusTrap,
119
120
  onEnter: function onEnter(el) {
120
121
  this.autoFocusAccept = this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false;
121
122
  this.autoFocusReject = this.confirmation.defaultFocus === 'reject' ? true : false;
123
+ this.target = document.activeElement;
122
124
  this.bindOutsideClickListener();
123
125
  this.bindScrollListener();
124
126
  this.bindResizeListener();
@@ -130,6 +132,8 @@ this.primevue.confirmpopup = (function (Button, ConfirmationEventBus, FocusTrap,
130
132
  onLeave: function onLeave() {
131
133
  this.autoFocusAccept = null;
132
134
  this.autoFocusReject = null;
135
+ utils.DomHandler.focus(this.target);
136
+ this.target = null;
133
137
  this.unbindOutsideClickListener();
134
138
  this.unbindScrollListener();
135
139
  this.unbindResizeListener();
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.confirmpopup=function(e,t,n,i,o,c,r,s,l){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),f=a(t),d=a(n),p=a(i),m=a(o),h={name:"ConfirmPopup",extends:{name:"BaseConfirmPopup",extends:a(r).default,props:{group:String},style:a(s).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,data:function(){return{visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted:function(){var e=this;this.confirmListener=function(t){t&&t.group===e.group&&(e.confirmation=t,e.target=t.target,e.confirmation.onShow&&e.confirmation.onShow(),e.visible=!0)},this.closeListener=function(){e.visible=!1,e.confirmation=null},f.default.on("confirm",this.confirmListener),f.default.on("close",this.closeListener)},beforeUnmount:function(){f.default.off("confirm",this.confirmListener),f.default.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(c.ZIndexUtils.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown:function(e){"Space"!==e.code&&"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.accept(),c.DomHandler.focus(this.target),e.preventDefault())},onRejectKeydown:function(e){"Space"!==e.code&&"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.reject(),c.DomHandler.focus(this.target),e.preventDefault())},onEnter:function(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),c.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter:function(){this.focus()},onLeave:function(){this.autoFocusAccept=null,this.autoFocusReject=null,this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave:function(e){c.ZIndexUtils.clear(e)},alignOverlay:function(){c.DomHandler.absolutePosition(this.container,this.target,!1);var e=c.DomHandler.getOffset(this.container),t=c.DomHandler.getOffset(this.target),n=0;e.left<t.left&&(n=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&(this.container.setAttribute("data-p-confirm-popup-flipped","true"),!this.isUnstyled&&c.DomHandler.addClass(this.container,"p-confirm-popup-flipped"))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.visible&&e.container&&!e.container.contains(t.target)&&!e.isTargetClicked(t)?(e.confirmation.onHide&&e.confirmation.onHide(),e.visible=!1):e.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new c.ConnectedOverlayScrollHandler(this.target,(function(){e.visible&&(e.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.visible&&!c.DomHandler.isTouchDevice()&&(e.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus:function(){var e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked:function(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef:function(e){this.container=e},onOverlayClick:function(e){p.default.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown:function(e){"Escape"===e.code&&(f.default.emit("close",this.closeListener),c.DomHandler.focus(this.target))},getCXOptions:function(e,t){return{contenxt:{icon:e,iconClass:t.class}}}},computed:{message:function(){return this.confirmation?this.confirmation.message:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null}},components:{CPButton:u.default,Portal:m.default},directives:{focustrap:d.default}},v=["aria-modal"];return h.render=function(e,t,n,i,o,c){var r=l.resolveComponent("CPButton"),s=l.resolveComponent("Portal"),a=l.resolveDirective("focustrap");return l.openBlock(),l.createBlock(s,null,{default:l.withCtx((function(){return[l.createVNode(l.Transition,l.mergeProps({name:"p-confirm-popup",onEnter:c.onEnter,onAfterEnter:c.onAfterEnter,onLeave:c.onLeave,onAfterLeave:c.onAfterLeave},e.ptm("transition")),{default:l.withCtx((function(){return[o.visible?l.withDirectives((l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:c.containerRef,role:"alertdialog",class:e.cx("root"),"aria-modal":o.visible,onClick:t[2]||(t[2]=function(){return c.onOverlayClick&&c.onOverlayClick.apply(c,arguments)}),onKeydown:t[3]||(t[3]=function(){return c.onOverlayKeydown&&c.onOverlayKeydown.apply(c,arguments)})},e.ptmi("root")),[e.$slots.container?l.renderSlot(e.$slots,"container",{key:0,message:o.confirmation,onAccept:c.accept,onReject:c.reject,acceptCallback:c.accept,rejectCallback:c.reject}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[e.$slots.message?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("content")},e.ptm("content")),[l.renderSlot(e.$slots,"icon",{},(function(){return[e.$slots.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.icon),{key:0,class:l.normalizeClass(e.cx("icon"))},null,8,["class"])):o.confirmation.icon?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,class:[o.confirmation.icon,e.cx("icon")]},e.ptm("icon")),null,16)):l.createCommentVNode("",!0)]})),l.createElementVNode("span",l.mergeProps({class:e.cx("message")},e.ptm("message")),l.toDisplayString(o.confirmation.message),17)],16)),l.createElementVNode("div",l.mergeProps({class:e.cx("footer")},e.ptm("footer")),[l.createVNode(r,{label:c.rejectLabel,onClick:t[0]||(t[0]=function(e){return c.reject()}),onKeydown:c.onRejectKeydown,autofocus:o.autoFocusReject,class:l.normalizeClass([e.cx("rejectButton"),o.confirmation.rejectClass]),unstyled:e.unstyled,pt:e.ptm("rejectButton")},l.createSlots({_:2},[c.rejectIcon||e.$slots.rejecticon?{name:"icon",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"rejecticon",{},(function(){return[l.createElementVNode("span",l.mergeProps({class:[c.rejectIcon,t.class]},e.ptm("rejectButton").icon,{"data-pc-section":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"]),l.createVNode(r,{label:c.acceptLabel,onClick:t[1]||(t[1]=function(e){return c.accept()}),onKeydown:c.onAcceptKeydown,autofocus:o.autoFocusAccept,class:l.normalizeClass([e.cx("acceptButton"),o.confirmation.acceptClass]),unstyled:e.unstyled,pt:e.ptm("acceptButton")},l.createSlots({_:2},[c.acceptIcon||e.$slots.accepticon?{name:"icon",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"accepticon",{},(function(){return[l.createElementVNode("span",l.mergeProps({class:[c.acceptIcon,t.class]},e.ptm("acceptButton").icon,{"data-pc-section":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"])],16)],64))],16,v)),[[a]]):l.createCommentVNode("",!0)]})),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:3})},h}(primevue.button,primevue.confirmationeventbus,primevue.focustrap,primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.confirmpopup.style,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.confirmpopup=function(e,t,n,i,o,c,r,s,l){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),f=a(t),d=a(n),m=a(i),p=a(o),h={name:"ConfirmPopup",extends:{name:"BaseConfirmPopup",extends:a(r).default,props:{group:String},style:a(s).default,provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,data:function(){return{visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null,target:null}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted:function(){var e=this;this.confirmListener=function(t){t&&t.group===e.group&&(e.confirmation=t,e.target=t.target,e.confirmation.onShow&&e.confirmation.onShow(),e.visible=!0)},this.closeListener=function(){e.visible=!1,e.confirmation=null},f.default.on("confirm",this.confirmListener),f.default.on("close",this.closeListener)},beforeUnmount:function(){f.default.off("confirm",this.confirmListener),f.default.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(c.ZIndexUtils.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown:function(e){"Space"!==e.code&&"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.accept(),c.DomHandler.focus(this.target),e.preventDefault())},onRejectKeydown:function(e){"Space"!==e.code&&"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.reject(),c.DomHandler.focus(this.target),e.preventDefault())},onEnter:function(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.target=document.activeElement,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),c.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter:function(){this.focus()},onLeave:function(){this.autoFocusAccept=null,this.autoFocusReject=null,c.DomHandler.focus(this.target),this.target=null,this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave:function(e){c.ZIndexUtils.clear(e)},alignOverlay:function(){c.DomHandler.absolutePosition(this.container,this.target,!1);var e=c.DomHandler.getOffset(this.container),t=c.DomHandler.getOffset(this.target),n=0;e.left<t.left&&(n=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft","".concat(n,"px")),e.top<t.top&&(this.container.setAttribute("data-p-confirm-popup-flipped","true"),!this.isUnstyled&&c.DomHandler.addClass(this.container,"p-confirm-popup-flipped"))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.visible&&e.container&&!e.container.contains(t.target)&&!e.isTargetClicked(t)?(e.confirmation.onHide&&e.confirmation.onHide(),e.visible=!1):e.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new c.ConnectedOverlayScrollHandler(this.target,(function(){e.visible&&(e.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.visible&&!c.DomHandler.isTouchDevice()&&(e.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus:function(){var e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked:function(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef:function(e){this.container=e},onOverlayClick:function(e){m.default.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown:function(e){"Escape"===e.code&&(f.default.emit("close",this.closeListener),c.DomHandler.focus(this.target))},getCXOptions:function(e,t){return{contenxt:{icon:e,iconClass:t.class}}}},computed:{message:function(){return this.confirmation?this.confirmation.message:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null}},components:{CPButton:u.default,Portal:p.default},directives:{focustrap:d.default}},v=["aria-modal"];return h.render=function(e,t,n,i,o,c){var r=l.resolveComponent("CPButton"),s=l.resolveComponent("Portal"),a=l.resolveDirective("focustrap");return l.openBlock(),l.createBlock(s,null,{default:l.withCtx((function(){return[l.createVNode(l.Transition,l.mergeProps({name:"p-confirm-popup",onEnter:c.onEnter,onAfterEnter:c.onAfterEnter,onLeave:c.onLeave,onAfterLeave:c.onAfterLeave},e.ptm("transition")),{default:l.withCtx((function(){return[o.visible?l.withDirectives((l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:c.containerRef,role:"alertdialog",class:e.cx("root"),"aria-modal":o.visible,onClick:t[2]||(t[2]=function(){return c.onOverlayClick&&c.onOverlayClick.apply(c,arguments)}),onKeydown:t[3]||(t[3]=function(){return c.onOverlayKeydown&&c.onOverlayKeydown.apply(c,arguments)})},e.ptmi("root")),[e.$slots.container?l.renderSlot(e.$slots,"container",{key:0,message:o.confirmation,onAccept:c.accept,onReject:c.reject,acceptCallback:c.accept,rejectCallback:c.reject}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[e.$slots.message?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("content")},e.ptm("content")),[l.renderSlot(e.$slots,"icon",{},(function(){return[e.$slots.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.$slots.icon),{key:0,class:l.normalizeClass(e.cx("icon"))},null,8,["class"])):o.confirmation.icon?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,class:[o.confirmation.icon,e.cx("icon")]},e.ptm("icon")),null,16)):l.createCommentVNode("",!0)]})),l.createElementVNode("span",l.mergeProps({class:e.cx("message")},e.ptm("message")),l.toDisplayString(o.confirmation.message),17)],16)),l.createElementVNode("div",l.mergeProps({class:e.cx("footer")},e.ptm("footer")),[l.createVNode(r,{label:c.rejectLabel,onClick:t[0]||(t[0]=function(e){return c.reject()}),onKeydown:c.onRejectKeydown,autofocus:o.autoFocusReject,class:l.normalizeClass([e.cx("rejectButton"),o.confirmation.rejectClass]),unstyled:e.unstyled,pt:e.ptm("rejectButton")},l.createSlots({_:2},[c.rejectIcon||e.$slots.rejecticon?{name:"icon",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"rejecticon",{},(function(){return[l.createElementVNode("span",l.mergeProps({class:[c.rejectIcon,t.class]},e.ptm("rejectButton").icon,{"data-pc-section":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"]),l.createVNode(r,{label:c.acceptLabel,onClick:t[1]||(t[1]=function(e){return c.accept()}),onKeydown:c.onAcceptKeydown,autofocus:o.autoFocusAccept,class:l.normalizeClass([e.cx("acceptButton"),o.confirmation.acceptClass]),unstyled:e.unstyled,pt:e.ptm("acceptButton")},l.createSlots({_:2},[c.acceptIcon||e.$slots.accepticon?{name:"icon",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"accepticon",{},(function(){return[l.createElementVNode("span",l.mergeProps({class:[c.acceptIcon,t.class]},e.ptm("acceptButton").icon,{"data-pc-section":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","onKeydown","autofocus","class","unstyled","pt"])],16)],64))],16,v)),[[a]]):l.createCommentVNode("",!0)]})),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:3})},h}(primevue.button,primevue.confirmationeventbus,primevue.focustrap,primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.confirmpopup.style,Vue);
@@ -44,7 +44,7 @@ export default {
44
44
  name: 'ContextMenu',
45
45
  extends: BaseContextMenu,
46
46
  inheritAttrs: false,
47
- emits: ['focus', 'blur', 'show', 'hide'],
47
+ emits: ['focus', 'blur', 'show', 'hide', 'before-hide', 'before-show'],
48
48
  target: null,
49
49
  outsideClickListener: null,
50
50
  resizeListener: null,
@@ -125,6 +125,7 @@ export default {
125
125
  this.visible ? this.hide() : this.show(event);
126
126
  },
127
127
  show(event) {
128
+ this.$emit('before-show');
128
129
  this.activeItemPath = [];
129
130
  this.focusedItemInfo = { index: -1, level: 0, parentKey: '' };
130
131
  DomHandler.focus(this.list);
@@ -137,6 +138,7 @@ export default {
137
138
  event.preventDefault();
138
139
  },
139
140
  hide() {
141
+ this.$emit('before-hide');
140
142
  this.visible = false;
141
143
  this.activeItemPath = [];
142
144
  this.focusedItemInfo = { index: -1, level: 0, parentKey: '' };
@@ -341,7 +341,7 @@ var script = {
341
341
  name: 'ContextMenu',
342
342
  "extends": script$2,
343
343
  inheritAttrs: false,
344
- emits: ['focus', 'blur', 'show', 'hide'],
344
+ emits: ['focus', 'blur', 'show', 'hide', 'before-hide', 'before-show'],
345
345
  target: null,
346
346
  outsideClickListener: null,
347
347
  resizeListener: null,
@@ -423,6 +423,7 @@ var script = {
423
423
  this.visible ? this.hide() : this.show(event);
424
424
  },
425
425
  show: function show(event) {
426
+ this.$emit('before-show');
426
427
  this.activeItemPath = [];
427
428
  this.focusedItemInfo = {
428
429
  index: -1,
@@ -437,6 +438,7 @@ var script = {
437
438
  event.preventDefault();
438
439
  },
439
440
  hide: function hide() {
441
+ this.$emit('before-hide');
440
442
  this.visible = false;
441
443
  this.activeItemPath = [];
442
444
  this.focusedItemInfo = {