primevue 3.24.0 → 3.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/README.md +64 -176
  2. package/api/Api.d.ts +284 -292
  3. package/autocomplete/AutoComplete.d.ts +5 -5
  4. package/autocomplete/AutoComplete.vue +5 -5
  5. package/autocomplete/autocomplete.cjs.js +5 -5
  6. package/autocomplete/autocomplete.cjs.min.js +1 -1
  7. package/autocomplete/autocomplete.esm.js +5 -5
  8. package/autocomplete/autocomplete.esm.min.js +1 -1
  9. package/autocomplete/autocomplete.js +5 -5
  10. package/autocomplete/autocomplete.min.js +1 -1
  11. package/blockui/BlockUI.d.ts +2 -0
  12. package/calendar/Calendar.d.ts +4 -4
  13. package/calendar/Calendar.vue +71 -17
  14. package/calendar/calendar.cjs.js +58 -20
  15. package/calendar/calendar.cjs.min.js +1 -1
  16. package/calendar/calendar.esm.js +58 -20
  17. package/calendar/calendar.esm.min.js +1 -1
  18. package/calendar/calendar.js +58 -20
  19. package/calendar/calendar.min.js +1 -1
  20. package/cascadeselect/CascadeSelect.d.ts +4 -4
  21. package/cascadeselect/CascadeSelect.vue +4 -4
  22. package/cascadeselect/cascadeselect.cjs.js +4 -4
  23. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  24. package/cascadeselect/cascadeselect.esm.js +4 -4
  25. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  26. package/cascadeselect/cascadeselect.js +4 -4
  27. package/cascadeselect/cascadeselect.min.js +1 -1
  28. package/checkbox/Checkbox.d.ts +2 -2
  29. package/checkbox/Checkbox.vue +2 -2
  30. package/checkbox/checkbox.cjs.js +2 -2
  31. package/checkbox/checkbox.cjs.min.js +1 -1
  32. package/checkbox/checkbox.esm.js +2 -2
  33. package/checkbox/checkbox.esm.min.js +1 -1
  34. package/checkbox/checkbox.js +2 -2
  35. package/checkbox/checkbox.min.js +1 -1
  36. package/chips/Chips.d.ts +4 -3
  37. package/chips/Chips.vue +2 -2
  38. package/chips/chips.cjs.js +2 -2
  39. package/chips/chips.cjs.min.js +1 -1
  40. package/chips/chips.esm.js +2 -2
  41. package/chips/chips.esm.min.js +1 -1
  42. package/chips/chips.js +2 -2
  43. package/chips/chips.min.js +1 -1
  44. package/column/Column.d.ts +9 -0
  45. package/confirmationoptions/ConfirmationOptions.d.ts +1 -0
  46. package/confirmdialog/ConfirmDialog.d.ts +5 -0
  47. package/confirmdialog/ConfirmDialog.vue +17 -1
  48. package/confirmdialog/confirmdialog.cjs.js +7 -2
  49. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  50. package/confirmdialog/confirmdialog.esm.js +7 -2
  51. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  52. package/confirmdialog/confirmdialog.js +7 -2
  53. package/confirmdialog/confirmdialog.min.js +1 -1
  54. package/confirmpopup/ConfirmPopup.vue +3 -0
  55. package/confirmpopup/confirmpopup.cjs.js +3 -0
  56. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  57. package/confirmpopup/confirmpopup.esm.js +3 -0
  58. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  59. package/confirmpopup/confirmpopup.js +3 -0
  60. package/confirmpopup/confirmpopup.min.js +1 -1
  61. package/core/core.js +22 -15
  62. package/core/core.min.js +4 -4
  63. package/datatable/DataTable.d.ts +9 -9
  64. package/datatable/FooterCell.vue +2 -2
  65. package/datatable/TableBody.vue +6 -1
  66. package/datatable/datatable.cjs.js +8 -3
  67. package/datatable/datatable.cjs.min.js +1 -1
  68. package/datatable/datatable.esm.js +8 -3
  69. package/datatable/datatable.esm.min.js +1 -1
  70. package/datatable/datatable.js +8 -3
  71. package/datatable/datatable.min.js +1 -1
  72. package/dialog/Dialog.vue +24 -7
  73. package/dialog/dialog.cjs.js +14 -7
  74. package/dialog/dialog.cjs.min.js +1 -1
  75. package/dialog/dialog.esm.js +14 -7
  76. package/dialog/dialog.esm.min.js +1 -1
  77. package/dialog/dialog.js +14 -7
  78. package/dialog/dialog.min.js +1 -1
  79. package/dropdown/Dropdown.d.ts +10 -4
  80. package/dropdown/Dropdown.vue +5 -5
  81. package/dropdown/dropdown.cjs.js +5 -5
  82. package/dropdown/dropdown.cjs.min.js +1 -1
  83. package/dropdown/dropdown.esm.js +5 -5
  84. package/dropdown/dropdown.esm.min.js +1 -1
  85. package/dropdown/dropdown.js +5 -5
  86. package/dropdown/dropdown.min.js +1 -1
  87. package/dynamicdialog/DynamicDialog.vue +1 -1
  88. package/dynamicdialog/dynamicdialog.cjs.js +1 -1
  89. package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
  90. package/dynamicdialog/dynamicdialog.esm.js +2 -2
  91. package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
  92. package/dynamicdialog/dynamicdialog.js +1 -1
  93. package/dynamicdialog/dynamicdialog.min.js +1 -1
  94. package/editor/Editor.d.ts +1 -0
  95. package/inplace/Inplace.vue +5 -1
  96. package/inplace/inplace.cjs.js +10 -2
  97. package/inplace/inplace.cjs.min.js +1 -1
  98. package/inplace/inplace.esm.js +10 -3
  99. package/inplace/inplace.esm.min.js +1 -1
  100. package/inplace/inplace.js +11 -4
  101. package/inplace/inplace.min.js +1 -1
  102. package/inputmask/InputMask.vue +59 -49
  103. package/inputmask/inputmask.cjs.js +59 -49
  104. package/inputmask/inputmask.cjs.min.js +1 -1
  105. package/inputmask/inputmask.esm.js +59 -49
  106. package/inputmask/inputmask.esm.min.js +1 -1
  107. package/inputmask/inputmask.js +59 -49
  108. package/inputmask/inputmask.min.js +1 -1
  109. package/inputnumber/InputNumber.d.ts +2 -2
  110. package/inputnumber/InputNumber.vue +2 -2
  111. package/inputnumber/inputnumber.cjs.js +2 -2
  112. package/inputnumber/inputnumber.cjs.min.js +1 -1
  113. package/inputnumber/inputnumber.esm.js +2 -2
  114. package/inputnumber/inputnumber.esm.min.js +1 -1
  115. package/inputnumber/inputnumber.js +2 -2
  116. package/inputnumber/inputnumber.min.js +1 -1
  117. package/inputswitch/InputSwitch.d.ts +3 -2
  118. package/inputswitch/InputSwitch.vue +2 -2
  119. package/inputswitch/inputswitch.cjs.js +2 -2
  120. package/inputswitch/inputswitch.cjs.min.js +1 -1
  121. package/inputswitch/inputswitch.esm.js +2 -2
  122. package/inputswitch/inputswitch.esm.min.js +1 -1
  123. package/inputswitch/inputswitch.js +2 -2
  124. package/inputswitch/inputswitch.min.js +1 -1
  125. package/menuitem/MenuItem.d.ts +1 -1
  126. package/organizationchart/OrganizationChart.d.ts +3 -2
  127. package/package.json +1 -1
  128. package/panel/Panel.d.ts +4 -2
  129. package/password/Password.d.ts +4 -4
  130. package/password/Password.vue +4 -4
  131. package/password/password.cjs.js +4 -4
  132. package/password/password.cjs.min.js +1 -1
  133. package/password/password.esm.js +4 -4
  134. package/password/password.esm.min.js +1 -1
  135. package/password/password.js +4 -4
  136. package/password/password.min.js +1 -1
  137. package/portal/Portal.d.ts +1 -0
  138. package/radiobutton/RadioButton.d.ts +3 -2
  139. package/radiobutton/RadioButton.vue +2 -2
  140. package/radiobutton/radiobutton.cjs.js +2 -2
  141. package/radiobutton/radiobutton.cjs.min.js +1 -1
  142. package/radiobutton/radiobutton.esm.js +2 -2
  143. package/radiobutton/radiobutton.esm.min.js +1 -1
  144. package/radiobutton/radiobutton.js +2 -2
  145. package/radiobutton/radiobutton.min.js +1 -1
  146. package/row/Row.d.ts +1 -1
  147. package/selectbutton/SelectButton.d.ts +1 -1
  148. package/selectbutton/SelectButton.vue +2 -2
  149. package/selectbutton/selectbutton.cjs.js +2 -2
  150. package/selectbutton/selectbutton.cjs.min.js +1 -1
  151. package/selectbutton/selectbutton.esm.js +2 -2
  152. package/selectbutton/selectbutton.esm.min.js +1 -1
  153. package/selectbutton/selectbutton.js +2 -2
  154. package/selectbutton/selectbutton.min.js +1 -1
  155. package/slider/Slider.vue +3 -14
  156. package/slider/slider.cjs.js +3 -14
  157. package/slider/slider.cjs.min.js +1 -1
  158. package/slider/slider.esm.js +3 -14
  159. package/slider/slider.esm.min.js +1 -1
  160. package/slider/slider.js +3 -14
  161. package/slider/slider.min.js +1 -1
  162. package/splitbutton/SplitButton.vue +4 -2
  163. package/splitbutton/splitbutton.cjs.js +6 -4
  164. package/splitbutton/splitbutton.cjs.min.js +1 -1
  165. package/splitbutton/splitbutton.esm.js +6 -4
  166. package/splitbutton/splitbutton.esm.min.js +1 -1
  167. package/splitbutton/splitbutton.js +6 -4
  168. package/splitbutton/splitbutton.min.js +1 -1
  169. package/textarea/Textarea.d.ts +1 -0
  170. package/tieredmenu/TieredMenu.d.ts +2 -0
  171. package/toast/Toast.d.ts +0 -1
  172. package/togglebutton/ToggleButton.d.ts +2 -2
  173. package/togglebutton/ToggleButton.vue +2 -2
  174. package/togglebutton/togglebutton.cjs.js +2 -2
  175. package/togglebutton/togglebutton.cjs.min.js +1 -1
  176. package/togglebutton/togglebutton.esm.js +2 -2
  177. package/togglebutton/togglebutton.esm.min.js +1 -1
  178. package/togglebutton/togglebutton.js +2 -2
  179. package/togglebutton/togglebutton.min.js +1 -1
  180. package/tooltip/tooltip.cjs.js +1 -1
  181. package/tooltip/tooltip.cjs.min.js +1 -1
  182. package/tooltip/tooltip.esm.js +1 -1
  183. package/tooltip/tooltip.esm.min.js +1 -1
  184. package/tooltip/tooltip.js +1 -1
  185. package/tooltip/tooltip.min.js +1 -1
  186. package/tree/Tree.d.ts +3 -0
  187. package/treeselect/TreeSelect.d.ts +2 -2
  188. package/treeselect/TreeSelect.vue +3 -3
  189. package/treeselect/treeselect.cjs.js +3 -3
  190. package/treeselect/treeselect.cjs.min.js +1 -1
  191. package/treeselect/treeselect.esm.js +3 -3
  192. package/treeselect/treeselect.esm.min.js +1 -1
  193. package/treeselect/treeselect.js +3 -3
  194. package/treeselect/treeselect.min.js +1 -1
  195. package/treetable/TreeTable.d.ts +2 -0
  196. package/treetable/TreeTable.vue +3 -3
  197. package/treetable/treetable.cjs.js +3 -3
  198. package/treetable/treetable.cjs.min.js +1 -1
  199. package/treetable/treetable.esm.js +3 -3
  200. package/treetable/treetable.esm.min.js +1 -1
  201. package/treetable/treetable.js +3 -3
  202. package/treetable/treetable.min.js +1 -1
  203. package/tristatecheckbox/TriStateCheckbox.vue +1 -1
  204. package/tristatecheckbox/tristatecheckbox.cjs.js +1 -1
  205. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  206. package/tristatecheckbox/tristatecheckbox.esm.js +1 -1
  207. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  208. package/tristatecheckbox/tristatecheckbox.js +1 -1
  209. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  210. package/vetur-attributes.json +32 -28
  211. package/vetur-tags.json +2 -1
  212. package/web-types.json +40 -30
package/dialog/Dialog.vue CHANGED
@@ -8,10 +8,20 @@
8
8
  <span v-if="header" :id="ariaLabelledById" class="p-dialog-title">{{ header }}</span>
9
9
  </slot>
10
10
  <div class="p-dialog-header-icons">
11
- <button v-if="maximizable" :ref="maximizableRef" v-ripple :autofocus="focusable" class="p-dialog-header-icon p-dialog-header-maximize p-link" @click="maximize" type="button" :tabindex="maximizable ? '0' : '-1'">
11
+ <button v-if="maximizable" :ref="maximizableRef" v-ripple :autofocus="focusableMax" class="p-dialog-header-icon p-dialog-header-maximize p-link" @click="maximize" type="button" :tabindex="maximizable ? '0' : '-1'">
12
12
  <span :class="maximizeIconClass"></span>
13
13
  </button>
14
- <button v-if="closable" :ref="closeButtonRef" v-ripple :autofocus="focusable" class="p-dialog-header-icon p-dialog-header-close p-link" @click="close" :aria-label="closeAriaLabel" type="button" v-bind="closeButtonProps">
14
+ <button
15
+ v-if="closable"
16
+ :ref="closeButtonRef"
17
+ v-ripple
18
+ :autofocus="focusableClose"
19
+ class="p-dialog-header-icon p-dialog-header-close p-link"
20
+ @click="close"
21
+ :aria-label="closeAriaLabel"
22
+ type="button"
23
+ v-bind="closeButtonProps"
24
+ >
15
25
  <span :class="['p-dialog-header-close-icon', closeIcon]"></span>
16
26
  </button>
17
27
  </div>
@@ -155,7 +165,8 @@ export default {
155
165
  return {
156
166
  containerVisible: this.visible,
157
167
  maximized: false,
158
- focusable: false
168
+ focusableMax: null,
169
+ focusableClose: null
159
170
  };
160
171
  },
161
172
  documentKeydownListener: null,
@@ -218,7 +229,8 @@ export default {
218
229
  },
219
230
  onLeave() {
220
231
  this.$emit('hide');
221
- this.focusable = false;
232
+ this.focusableClose = null;
233
+ this.focusableMax = null;
222
234
  },
223
235
  onAfterLeave() {
224
236
  if (this.autoZIndex) {
@@ -249,14 +261,19 @@ export default {
249
261
  focusTarget = this.$slots.default && findFocusableElement(this.content);
250
262
 
251
263
  if (!focusTarget) {
252
- focusTarget = findFocusableElement(this.container);
264
+ if (this.maximizable) {
265
+ this.focusableMax = true;
266
+ focusTarget = this.maximizableButton;
267
+ } else {
268
+ this.focusableClose = true;
269
+ focusTarget = this.closeButton;
270
+ }
253
271
  }
254
272
  }
255
273
  }
256
274
 
257
275
  if (focusTarget) {
258
- this.focusable = true;
259
- focusTarget.focus();
276
+ DomHandler.focus(focusTarget);
260
277
  }
261
278
  },
262
279
  maximize(event) {
@@ -132,7 +132,8 @@ var script = {
132
132
  return {
133
133
  containerVisible: this.visible,
134
134
  maximized: false,
135
- focusable: false
135
+ focusableMax: null,
136
+ focusableClose: null
136
137
  };
137
138
  },
138
139
  documentKeydownListener: null,
@@ -195,7 +196,8 @@ var script = {
195
196
  },
196
197
  onLeave() {
197
198
  this.$emit('hide');
198
- this.focusable = false;
199
+ this.focusableClose = null;
200
+ this.focusableMax = null;
199
201
  },
200
202
  onAfterLeave() {
201
203
  if (this.autoZIndex) {
@@ -226,14 +228,19 @@ var script = {
226
228
  focusTarget = this.$slots.default && findFocusableElement(this.content);
227
229
 
228
230
  if (!focusTarget) {
229
- focusTarget = findFocusableElement(this.container);
231
+ if (this.maximizable) {
232
+ this.focusableMax = true;
233
+ focusTarget = this.maximizableButton;
234
+ } else {
235
+ this.focusableClose = true;
236
+ focusTarget = this.closeButton;
237
+ }
230
238
  }
231
239
  }
232
240
  }
233
241
 
234
242
  if (focusTarget) {
235
- this.focusable = true;
236
- focusTarget.focus();
243
+ utils.DomHandler.focus(focusTarget);
237
244
  }
238
245
  },
239
246
  maximize(event) {
@@ -529,7 +536,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
529
536
  ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
530
537
  key: 0,
531
538
  ref: $options.maximizableRef,
532
- autofocus: $data.focusable,
539
+ autofocus: $data.focusableMax,
533
540
  class: "p-dialog-header-icon p-dialog-header-maximize p-link",
534
541
  onClick: _cache[0] || (_cache[0] = (...args) => ($options.maximize && $options.maximize(...args))),
535
542
  type: "button",
@@ -546,7 +553,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
546
553
  ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
547
554
  key: 1,
548
555
  ref: $options.closeButtonRef,
549
- autofocus: $data.focusable,
556
+ autofocus: $data.focusableClose,
550
557
  class: "p-dialog-header-icon p-dialog-header-close p-link",
551
558
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.close && $options.close(...args))),
552
559
  "aria-label": $options.closeAriaLabel,
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/focustrap"),t=require("primevue/portal"),n=require("primevue/ripple"),i=require("primevue/utils"),o=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(e),s=a(t),r={name:"Dialog",inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:"pi pi-times"},maximizeIcon:{type:String,default:"pi pi-window-maximize"},minimizeIcon:{type:String,default:"pi pi-window-minimize"},closeButtonProps:{type:null,default:null},_instance:null},provide(){return{dialogRef:o.computed((()=>this._instance))}},data(){return{containerVisible:this.visible,maximized:!1,focusable:!1}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},mounted(){this.breakpoints&&this.createStyle()},methods:{close(){this.$emit("update:visible",!1)},onBeforeEnter(e){e.setAttribute(this.attributeSelector,"")},onEnter(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&i.ZIndexUtils.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave(){this.modal&&i.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide"),this.focusable=!1},onAfterLeave(){this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick(e){this.dismissableMask&&this.modal&&this.mask===e.target&&this.close()},focus(){const e=e=>e.querySelector("[autofocus]");let t=this.$slots.footer&&e(this.footerContainer);t||(t=this.$slots.header&&e(this.headerContainer),t||(t=this.$slots.default&&e(this.content),t||(t=e(this.container)))),t&&(this.focusable=!0,t.focus())},maximize(e){this.maximized?(this.maximized=!1,this.$emit("unmaximize",e)):(this.maximized=!0,this.$emit("maximize",e)),this.modal||(this.maximized?i.DomHandler.addClass(document.body,"p-overflow-hidden"):i.DomHandler.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings(){(this.modal||this.maximizable&&this.maximized)&&i.DomHandler.addClass(document.body,"p-overflow-hidden")},unbindDocumentState(){(this.modal||this.maximizable&&this.maximized)&&i.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeyDown(e){"Escape"===e.code&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},getPositionClass(){const e=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find((e=>e===this.position));return e?`p-dialog-${e}`:""},containerRef(e){this.container=e},maskRef(e){this.mask=e},contentRef(e){this.content=e},headerContainerRef(e){this.headerContainer=e},footerContainerRef(e){this.footerContainer=e},maximizableRef(e){this.maximizableButton=e},closeButtonRef(e){this.closeButton=e},createStyle(){if(!this.styleElement){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";for(let t in this.breakpoints)e+=`\n @media screen and (max-width: ${t}) {\n .p-dialog[${this.attributeSelector}] {\n width: ${this.breakpoints[t]} !important;\n }\n }\n `;this.styleElement.innerHTML=e}},destroyStyle(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag(e){i.DomHandler.hasClass(e.target,"p-dialog-header-icon")||i.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||this.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",i.DomHandler.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener(){this.documentDragListener=e=>{if(this.dragging){let t=i.DomHandler.getOuterWidth(this.container),n=i.DomHandler.getOuterHeight(this.container),o=e.pageX-this.lastPageX,a=e.pageY-this.lastPageY,l=this.container.getBoundingClientRect(),s=l.left+o,r=l.top+a,d=i.DomHandler.getViewport();this.container.style.position="fixed",this.keepInViewport?(s>=this.minX&&s+t<d.width&&(this.lastPageX=e.pageX,this.container.style.left=s+"px"),r>=this.minY&&r+n<d.height&&(this.lastPageY=e.pageY,this.container.style.top=r+"px")):(this.lastPageX=e.pageX,this.container.style.left=s+"px",this.lastPageY=e.pageY,this.container.style.top=r+"px")}},window.document.addEventListener("mousemove",this.documentDragListener)},unbindDocumentDragListener(){this.documentDragListener&&(window.document.removeEventListener("mousemove",this.documentDragListener),this.documentDragListener=null)},bindDocumentDragEndListener(){this.documentDragEndListener=e=>{this.dragging&&(this.dragging=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),this.$emit("dragend",e))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maskClass(){return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":this.modal},this.getPositionClass()]},dialogClass(){return["p-dialog p-component",{"p-dialog-rtl":this.rtl,"p-dialog-maximized":this.maximizable&&this.maximized,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},maximizeIconClass(){return["p-dialog-header-maximize-icon",{[this.maximizeIcon]:!this.maximized,[this.minimizeIcon]:this.maximized}]},ariaId:()=>i.UniqueComponentId(),ariaLabelledById(){return null!=this.header||null!==this.$attrs["aria-labelledby"]?this.ariaId+"_header":null},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector:()=>i.UniqueComponentId(),contentStyleClass(){return["p-dialog-content",this.contentClass]}},directives:{ripple:a(n).default,focustrap:l.default},components:{Portal:s.default}};const d=["aria-labelledby","aria-modal"],p=["id"],m={class:"p-dialog-header-icons"},c=["autofocus","tabindex"],g=["autofocus","aria-label"];!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-dialog-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n}\n.p-dialog-content {\n overflow-y: auto;\n}\n.p-dialog-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n}\n.p-dialog-footer {\n flex-shrink: 0;\n}\n.p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n}\n.p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n/* Fluid */\n.p-fluid .p-dialog-footer .p-button {\n width: auto;\n}\n\n/* Animation */\n/* Center */\n.p-dialog-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-dialog-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-dialog-enter-from,\n.p-dialog-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n\n/* Top, Bottom, Left, Right, Top* and Bottom* */\n.p-dialog-top .p-dialog,\n.p-dialog-bottom .p-dialog,\n.p-dialog-left .p-dialog,\n.p-dialog-right .p-dialog,\n.p-dialog-topleft .p-dialog,\n.p-dialog-topright .p-dialog,\n.p-dialog-bottomleft .p-dialog,\n.p-dialog-bottomright .p-dialog {\n margin: 0.75rem;\n transform: translate3d(0px, 0px, 0px);\n}\n.p-dialog-top .p-dialog-enter-active,\n.p-dialog-top .p-dialog-leave-active,\n.p-dialog-bottom .p-dialog-enter-active,\n.p-dialog-bottom .p-dialog-leave-active,\n.p-dialog-left .p-dialog-enter-active,\n.p-dialog-left .p-dialog-leave-active,\n.p-dialog-right .p-dialog-enter-active,\n.p-dialog-right .p-dialog-leave-active,\n.p-dialog-topleft .p-dialog-enter-active,\n.p-dialog-topleft .p-dialog-leave-active,\n.p-dialog-topright .p-dialog-enter-active,\n.p-dialog-topright .p-dialog-leave-active,\n.p-dialog-bottomleft .p-dialog-enter-active,\n.p-dialog-bottomleft .p-dialog-leave-active,\n.p-dialog-bottomright .p-dialog-enter-active,\n.p-dialog-bottomright .p-dialog-leave-active {\n transition: all 0.3s ease-out;\n}\n.p-dialog-top .p-dialog-enter-from,\n.p-dialog-top .p-dialog-leave-to {\n transform: translate3d(0px, -100%, 0px);\n}\n.p-dialog-bottom .p-dialog-enter-from,\n.p-dialog-bottom .p-dialog-leave-to {\n transform: translate3d(0px, 100%, 0px);\n}\n.p-dialog-left .p-dialog-enter-from,\n.p-dialog-left .p-dialog-leave-to,\n.p-dialog-topleft .p-dialog-enter-from,\n.p-dialog-topleft .p-dialog-leave-to,\n.p-dialog-bottomleft .p-dialog-enter-from,\n.p-dialog-bottomleft .p-dialog-leave-to {\n transform: translate3d(-100%, 0px, 0px);\n}\n.p-dialog-right .p-dialog-enter-from,\n.p-dialog-right .p-dialog-leave-to,\n.p-dialog-topright .p-dialog-enter-from,\n.p-dialog-topright .p-dialog-leave-to,\n.p-dialog-bottomright .p-dialog-enter-from,\n.p-dialog-bottomright .p-dialog-leave-to {\n transform: translate3d(100%, 0px, 0px);\n}\n\n/* Maximize */\n.p-dialog-maximized {\n -webkit-transition: none;\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n top: 0px !important;\n left: 0px !important;\n max-height: 100%;\n height: 100%;\n}\n.p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n}\n\n/* Position */\n.p-dialog-left {\n justify-content: flex-start;\n}\n.p-dialog-right {\n justify-content: flex-end;\n}\n.p-dialog-top {\n align-items: flex-start;\n}\n.p-dialog-topleft {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.p-dialog-topright {\n justify-content: flex-end;\n align-items: flex-start;\n}\n.p-dialog-bottom {\n align-items: flex-end;\n}\n.p-dialog-bottomleft {\n justify-content: flex-start;\n align-items: flex-end;\n}\n.p-dialog-bottomright {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n}\n"),r.render=function(e,t,n,i,a,l){const s=o.resolveComponent("Portal"),r=o.resolveDirective("ripple"),u=o.resolveDirective("focustrap");return o.openBlock(),o.createBlock(s,{appendTo:n.appendTo},{default:o.withCtx((()=>[a.containerVisible?(o.openBlock(),o.createElementBlock("div",{key:0,ref:l.maskRef,class:o.normalizeClass(l.maskClass),onClick:t[3]||(t[3]=(...e)=>l.onMaskClick&&l.onMaskClick(...e))},[o.createVNode(o.Transition,{name:"p-dialog",onBeforeEnter:l.onBeforeEnter,onEnter:l.onEnter,onBeforeLeave:l.onBeforeLeave,onLeave:l.onLeave,onAfterLeave:l.onAfterLeave,appear:""},{default:o.withCtx((()=>[n.visible?o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:l.containerRef,class:l.dialogClass,role:"dialog","aria-labelledby":l.ariaLabelledById,"aria-modal":n.modal},e.$attrs),[n.showHeader?(o.openBlock(),o.createElementBlock("div",{key:0,ref:l.headerContainerRef,class:"p-dialog-header",onMousedown:t[2]||(t[2]=(...e)=>l.initDrag&&l.initDrag(...e))},[o.renderSlot(e.$slots,"header",{},(()=>[n.header?(o.openBlock(),o.createElementBlock("span",{key:0,id:l.ariaLabelledById,class:"p-dialog-title"},o.toDisplayString(n.header),9,p)):o.createCommentVNode("",!0)])),o.createElementVNode("div",m,[n.maximizable?o.withDirectives((o.openBlock(),o.createElementBlock("button",{key:0,ref:l.maximizableRef,autofocus:a.focusable,class:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:t[0]||(t[0]=(...e)=>l.maximize&&l.maximize(...e)),type:"button",tabindex:n.maximizable?"0":"-1"},[o.createElementVNode("span",{class:o.normalizeClass(l.maximizeIconClass)},null,2)],8,c)),[[r]]):o.createCommentVNode("",!0),n.closable?o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({key:1,ref:l.closeButtonRef,autofocus:a.focusable,class:"p-dialog-header-icon p-dialog-header-close p-link",onClick:t[1]||(t[1]=(...e)=>l.close&&l.close(...e)),"aria-label":l.closeAriaLabel,type:"button"},n.closeButtonProps),[o.createElementVNode("span",{class:o.normalizeClass(["p-dialog-header-close-icon",n.closeIcon])},null,2)],16,g)),[[r]]):o.createCommentVNode("",!0)])],544)):o.createCommentVNode("",!0),o.createElementVNode("div",o.mergeProps({ref:l.contentRef,class:l.contentStyleClass,style:n.contentStyle},n.contentProps),[o.renderSlot(e.$slots,"default")],16),n.footer||e.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:1,ref:l.footerContainerRef,class:"p-dialog-footer"},[o.renderSlot(e.$slots,"footer",{},(()=>[o.createTextVNode(o.toDisplayString(n.footer),1)]))],512)):o.createCommentVNode("",!0)],16,d)),[[u,{disabled:!n.modal}]]):o.createCommentVNode("",!0)])),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],2)):o.createCommentVNode("",!0)])),_:3},8,["appendTo"])},module.exports=r;
1
+ "use strict";var e=require("primevue/focustrap"),t=require("primevue/portal"),n=require("primevue/ripple"),i=require("primevue/utils"),o=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(e),s=a(t),r={name:"Dialog",inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:"pi pi-times"},maximizeIcon:{type:String,default:"pi pi-window-maximize"},minimizeIcon:{type:String,default:"pi pi-window-minimize"},closeButtonProps:{type:null,default:null},_instance:null},provide(){return{dialogRef:o.computed((()=>this._instance))}},data(){return{containerVisible:this.visible,maximized:!1,focusableMax:null,focusableClose:null}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},mounted(){this.breakpoints&&this.createStyle()},methods:{close(){this.$emit("update:visible",!1)},onBeforeEnter(e){e.setAttribute(this.attributeSelector,"")},onEnter(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&i.ZIndexUtils.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave(){this.modal&&i.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide"),this.focusableClose=null,this.focusableMax=null},onAfterLeave(){this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick(e){this.dismissableMask&&this.modal&&this.mask===e.target&&this.close()},focus(){const e=e=>e.querySelector("[autofocus]");let t=this.$slots.footer&&e(this.footerContainer);t||(t=this.$slots.header&&e(this.headerContainer),t||(t=this.$slots.default&&e(this.content),t||(this.maximizable?(this.focusableMax=!0,t=this.maximizableButton):(this.focusableClose=!0,t=this.closeButton)))),t&&i.DomHandler.focus(t)},maximize(e){this.maximized?(this.maximized=!1,this.$emit("unmaximize",e)):(this.maximized=!0,this.$emit("maximize",e)),this.modal||(this.maximized?i.DomHandler.addClass(document.body,"p-overflow-hidden"):i.DomHandler.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings(){(this.modal||this.maximizable&&this.maximized)&&i.DomHandler.addClass(document.body,"p-overflow-hidden")},unbindDocumentState(){(this.modal||this.maximizable&&this.maximized)&&i.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeyDown(e){"Escape"===e.code&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},getPositionClass(){const e=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find((e=>e===this.position));return e?`p-dialog-${e}`:""},containerRef(e){this.container=e},maskRef(e){this.mask=e},contentRef(e){this.content=e},headerContainerRef(e){this.headerContainer=e},footerContainerRef(e){this.footerContainer=e},maximizableRef(e){this.maximizableButton=e},closeButtonRef(e){this.closeButton=e},createStyle(){if(!this.styleElement){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";for(let t in this.breakpoints)e+=`\n @media screen and (max-width: ${t}) {\n .p-dialog[${this.attributeSelector}] {\n width: ${this.breakpoints[t]} !important;\n }\n }\n `;this.styleElement.innerHTML=e}},destroyStyle(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag(e){i.DomHandler.hasClass(e.target,"p-dialog-header-icon")||i.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||this.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",i.DomHandler.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener(){this.documentDragListener=e=>{if(this.dragging){let t=i.DomHandler.getOuterWidth(this.container),n=i.DomHandler.getOuterHeight(this.container),o=e.pageX-this.lastPageX,a=e.pageY-this.lastPageY,l=this.container.getBoundingClientRect(),s=l.left+o,r=l.top+a,d=i.DomHandler.getViewport();this.container.style.position="fixed",this.keepInViewport?(s>=this.minX&&s+t<d.width&&(this.lastPageX=e.pageX,this.container.style.left=s+"px"),r>=this.minY&&r+n<d.height&&(this.lastPageY=e.pageY,this.container.style.top=r+"px")):(this.lastPageX=e.pageX,this.container.style.left=s+"px",this.lastPageY=e.pageY,this.container.style.top=r+"px")}},window.document.addEventListener("mousemove",this.documentDragListener)},unbindDocumentDragListener(){this.documentDragListener&&(window.document.removeEventListener("mousemove",this.documentDragListener),this.documentDragListener=null)},bindDocumentDragEndListener(){this.documentDragEndListener=e=>{this.dragging&&(this.dragging=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),this.$emit("dragend",e))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maskClass(){return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":this.modal},this.getPositionClass()]},dialogClass(){return["p-dialog p-component",{"p-dialog-rtl":this.rtl,"p-dialog-maximized":this.maximizable&&this.maximized,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},maximizeIconClass(){return["p-dialog-header-maximize-icon",{[this.maximizeIcon]:!this.maximized,[this.minimizeIcon]:this.maximized}]},ariaId:()=>i.UniqueComponentId(),ariaLabelledById(){return null!=this.header||null!==this.$attrs["aria-labelledby"]?this.ariaId+"_header":null},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector:()=>i.UniqueComponentId(),contentStyleClass(){return["p-dialog-content",this.contentClass]}},directives:{ripple:a(n).default,focustrap:l.default},components:{Portal:s.default}};const d=["aria-labelledby","aria-modal"],m=["id"],p={class:"p-dialog-header-icons"},c=["autofocus","tabindex"],u=["autofocus","aria-label"];!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-dialog-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n}\n.p-dialog-content {\n overflow-y: auto;\n}\n.p-dialog-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n}\n.p-dialog-footer {\n flex-shrink: 0;\n}\n.p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n}\n.p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n/* Fluid */\n.p-fluid .p-dialog-footer .p-button {\n width: auto;\n}\n\n/* Animation */\n/* Center */\n.p-dialog-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-dialog-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-dialog-enter-from,\n.p-dialog-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n\n/* Top, Bottom, Left, Right, Top* and Bottom* */\n.p-dialog-top .p-dialog,\n.p-dialog-bottom .p-dialog,\n.p-dialog-left .p-dialog,\n.p-dialog-right .p-dialog,\n.p-dialog-topleft .p-dialog,\n.p-dialog-topright .p-dialog,\n.p-dialog-bottomleft .p-dialog,\n.p-dialog-bottomright .p-dialog {\n margin: 0.75rem;\n transform: translate3d(0px, 0px, 0px);\n}\n.p-dialog-top .p-dialog-enter-active,\n.p-dialog-top .p-dialog-leave-active,\n.p-dialog-bottom .p-dialog-enter-active,\n.p-dialog-bottom .p-dialog-leave-active,\n.p-dialog-left .p-dialog-enter-active,\n.p-dialog-left .p-dialog-leave-active,\n.p-dialog-right .p-dialog-enter-active,\n.p-dialog-right .p-dialog-leave-active,\n.p-dialog-topleft .p-dialog-enter-active,\n.p-dialog-topleft .p-dialog-leave-active,\n.p-dialog-topright .p-dialog-enter-active,\n.p-dialog-topright .p-dialog-leave-active,\n.p-dialog-bottomleft .p-dialog-enter-active,\n.p-dialog-bottomleft .p-dialog-leave-active,\n.p-dialog-bottomright .p-dialog-enter-active,\n.p-dialog-bottomright .p-dialog-leave-active {\n transition: all 0.3s ease-out;\n}\n.p-dialog-top .p-dialog-enter-from,\n.p-dialog-top .p-dialog-leave-to {\n transform: translate3d(0px, -100%, 0px);\n}\n.p-dialog-bottom .p-dialog-enter-from,\n.p-dialog-bottom .p-dialog-leave-to {\n transform: translate3d(0px, 100%, 0px);\n}\n.p-dialog-left .p-dialog-enter-from,\n.p-dialog-left .p-dialog-leave-to,\n.p-dialog-topleft .p-dialog-enter-from,\n.p-dialog-topleft .p-dialog-leave-to,\n.p-dialog-bottomleft .p-dialog-enter-from,\n.p-dialog-bottomleft .p-dialog-leave-to {\n transform: translate3d(-100%, 0px, 0px);\n}\n.p-dialog-right .p-dialog-enter-from,\n.p-dialog-right .p-dialog-leave-to,\n.p-dialog-topright .p-dialog-enter-from,\n.p-dialog-topright .p-dialog-leave-to,\n.p-dialog-bottomright .p-dialog-enter-from,\n.p-dialog-bottomright .p-dialog-leave-to {\n transform: translate3d(100%, 0px, 0px);\n}\n\n/* Maximize */\n.p-dialog-maximized {\n -webkit-transition: none;\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n top: 0px !important;\n left: 0px !important;\n max-height: 100%;\n height: 100%;\n}\n.p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n}\n\n/* Position */\n.p-dialog-left {\n justify-content: flex-start;\n}\n.p-dialog-right {\n justify-content: flex-end;\n}\n.p-dialog-top {\n align-items: flex-start;\n}\n.p-dialog-topleft {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.p-dialog-topright {\n justify-content: flex-end;\n align-items: flex-start;\n}\n.p-dialog-bottom {\n align-items: flex-end;\n}\n.p-dialog-bottomleft {\n justify-content: flex-start;\n align-items: flex-end;\n}\n.p-dialog-bottomright {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n}\n"),r.render=function(e,t,n,i,a,l){const s=o.resolveComponent("Portal"),r=o.resolveDirective("ripple"),g=o.resolveDirective("focustrap");return o.openBlock(),o.createBlock(s,{appendTo:n.appendTo},{default:o.withCtx((()=>[a.containerVisible?(o.openBlock(),o.createElementBlock("div",{key:0,ref:l.maskRef,class:o.normalizeClass(l.maskClass),onClick:t[3]||(t[3]=(...e)=>l.onMaskClick&&l.onMaskClick(...e))},[o.createVNode(o.Transition,{name:"p-dialog",onBeforeEnter:l.onBeforeEnter,onEnter:l.onEnter,onBeforeLeave:l.onBeforeLeave,onLeave:l.onLeave,onAfterLeave:l.onAfterLeave,appear:""},{default:o.withCtx((()=>[n.visible?o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:l.containerRef,class:l.dialogClass,role:"dialog","aria-labelledby":l.ariaLabelledById,"aria-modal":n.modal},e.$attrs),[n.showHeader?(o.openBlock(),o.createElementBlock("div",{key:0,ref:l.headerContainerRef,class:"p-dialog-header",onMousedown:t[2]||(t[2]=(...e)=>l.initDrag&&l.initDrag(...e))},[o.renderSlot(e.$slots,"header",{},(()=>[n.header?(o.openBlock(),o.createElementBlock("span",{key:0,id:l.ariaLabelledById,class:"p-dialog-title"},o.toDisplayString(n.header),9,m)):o.createCommentVNode("",!0)])),o.createElementVNode("div",p,[n.maximizable?o.withDirectives((o.openBlock(),o.createElementBlock("button",{key:0,ref:l.maximizableRef,autofocus:a.focusableMax,class:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:t[0]||(t[0]=(...e)=>l.maximize&&l.maximize(...e)),type:"button",tabindex:n.maximizable?"0":"-1"},[o.createElementVNode("span",{class:o.normalizeClass(l.maximizeIconClass)},null,2)],8,c)),[[r]]):o.createCommentVNode("",!0),n.closable?o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({key:1,ref:l.closeButtonRef,autofocus:a.focusableClose,class:"p-dialog-header-icon p-dialog-header-close p-link",onClick:t[1]||(t[1]=(...e)=>l.close&&l.close(...e)),"aria-label":l.closeAriaLabel,type:"button"},n.closeButtonProps),[o.createElementVNode("span",{class:o.normalizeClass(["p-dialog-header-close-icon",n.closeIcon])},null,2)],16,u)),[[r]]):o.createCommentVNode("",!0)])],544)):o.createCommentVNode("",!0),o.createElementVNode("div",o.mergeProps({ref:l.contentRef,class:l.contentStyleClass,style:n.contentStyle},n.contentProps),[o.renderSlot(e.$slots,"default")],16),n.footer||e.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:1,ref:l.footerContainerRef,class:"p-dialog-footer"},[o.renderSlot(e.$slots,"footer",{},(()=>[o.createTextVNode(o.toDisplayString(n.footer),1)]))],512)):o.createCommentVNode("",!0)],16,d)),[[g,{disabled:!n.modal}]]):o.createCommentVNode("",!0)])),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],2)):o.createCommentVNode("",!0)])),_:3},8,["appendTo"])},module.exports=r;
@@ -124,7 +124,8 @@ var script = {
124
124
  return {
125
125
  containerVisible: this.visible,
126
126
  maximized: false,
127
- focusable: false
127
+ focusableMax: null,
128
+ focusableClose: null
128
129
  };
129
130
  },
130
131
  documentKeydownListener: null,
@@ -187,7 +188,8 @@ var script = {
187
188
  },
188
189
  onLeave() {
189
190
  this.$emit('hide');
190
- this.focusable = false;
191
+ this.focusableClose = null;
192
+ this.focusableMax = null;
191
193
  },
192
194
  onAfterLeave() {
193
195
  if (this.autoZIndex) {
@@ -218,14 +220,19 @@ var script = {
218
220
  focusTarget = this.$slots.default && findFocusableElement(this.content);
219
221
 
220
222
  if (!focusTarget) {
221
- focusTarget = findFocusableElement(this.container);
223
+ if (this.maximizable) {
224
+ this.focusableMax = true;
225
+ focusTarget = this.maximizableButton;
226
+ } else {
227
+ this.focusableClose = true;
228
+ focusTarget = this.closeButton;
229
+ }
222
230
  }
223
231
  }
224
232
  }
225
233
 
226
234
  if (focusTarget) {
227
- this.focusable = true;
228
- focusTarget.focus();
235
+ DomHandler.focus(focusTarget);
229
236
  }
230
237
  },
231
238
  maximize(event) {
@@ -521,7 +528,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
521
528
  ? withDirectives((openBlock(), createElementBlock("button", {
522
529
  key: 0,
523
530
  ref: $options.maximizableRef,
524
- autofocus: $data.focusable,
531
+ autofocus: $data.focusableMax,
525
532
  class: "p-dialog-header-icon p-dialog-header-maximize p-link",
526
533
  onClick: _cache[0] || (_cache[0] = (...args) => ($options.maximize && $options.maximize(...args))),
527
534
  type: "button",
@@ -538,7 +545,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
538
545
  ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
539
546
  key: 1,
540
547
  ref: $options.closeButtonRef,
541
- autofocus: $data.focusable,
548
+ autofocus: $data.focusableClose,
542
549
  class: "p-dialog-header-icon p-dialog-header-close p-link",
543
550
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.close && $options.close(...args))),
544
551
  "aria-label": $options.closeAriaLabel,
@@ -1 +1 @@
1
- import e from"primevue/focustrap";import t from"primevue/portal";import n from"primevue/ripple";import{ZIndexUtils as i,DomHandler as o,UniqueComponentId as a}from"primevue/utils";import{computed as l,resolveComponent as s,resolveDirective as d,openBlock as r,createBlock as p,withCtx as m,createElementBlock as g,normalizeClass as c,createVNode as h,Transition as u,withDirectives as f,mergeProps as b,renderSlot as y,toDisplayString as v,createCommentVNode as x,createElementVNode as L,createTextVNode as w}from"vue";var k={name:"Dialog",inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:"pi pi-times"},maximizeIcon:{type:String,default:"pi pi-window-maximize"},minimizeIcon:{type:String,default:"pi pi-window-minimize"},closeButtonProps:{type:null,default:null},_instance:null},provide(){return{dialogRef:l((()=>this._instance))}},data(){return{containerVisible:this.visible,maximized:!1,focusable:!1}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&i.clear(this.mask),this.container=null,this.mask=null},mounted(){this.breakpoints&&this.createStyle()},methods:{close(){this.$emit("update:visible",!1)},onBeforeEnter(e){e.setAttribute(this.attributeSelector,"")},onEnter(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&i.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave(){this.modal&&o.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide"),this.focusable=!1},onAfterLeave(){this.autoZIndex&&i.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick(e){this.dismissableMask&&this.modal&&this.mask===e.target&&this.close()},focus(){const e=e=>e.querySelector("[autofocus]");let t=this.$slots.footer&&e(this.footerContainer);t||(t=this.$slots.header&&e(this.headerContainer),t||(t=this.$slots.default&&e(this.content),t||(t=e(this.container)))),t&&(this.focusable=!0,t.focus())},maximize(e){this.maximized?(this.maximized=!1,this.$emit("unmaximize",e)):(this.maximized=!0,this.$emit("maximize",e)),this.modal||(this.maximized?o.addClass(document.body,"p-overflow-hidden"):o.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings(){(this.modal||this.maximizable&&this.maximized)&&o.addClass(document.body,"p-overflow-hidden")},unbindDocumentState(){(this.modal||this.maximizable&&this.maximized)&&o.removeClass(document.body,"p-overflow-hidden")},onKeyDown(e){"Escape"===e.code&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},getPositionClass(){const e=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find((e=>e===this.position));return e?`p-dialog-${e}`:""},containerRef(e){this.container=e},maskRef(e){this.mask=e},contentRef(e){this.content=e},headerContainerRef(e){this.headerContainer=e},footerContainerRef(e){this.footerContainer=e},maximizableRef(e){this.maximizableButton=e},closeButtonRef(e){this.closeButton=e},createStyle(){if(!this.styleElement){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";for(let t in this.breakpoints)e+=`\n @media screen and (max-width: ${t}) {\n .p-dialog[${this.attributeSelector}] {\n width: ${this.breakpoints[t]} !important;\n }\n }\n `;this.styleElement.innerHTML=e}},destroyStyle(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag(e){o.hasClass(e.target,"p-dialog-header-icon")||o.hasClass(e.target.parentElement,"p-dialog-header-icon")||this.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",o.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener(){this.documentDragListener=e=>{if(this.dragging){let t=o.getOuterWidth(this.container),n=o.getOuterHeight(this.container),i=e.pageX-this.lastPageX,a=e.pageY-this.lastPageY,l=this.container.getBoundingClientRect(),s=l.left+i,d=l.top+a,r=o.getViewport();this.container.style.position="fixed",this.keepInViewport?(s>=this.minX&&s+t<r.width&&(this.lastPageX=e.pageX,this.container.style.left=s+"px"),d>=this.minY&&d+n<r.height&&(this.lastPageY=e.pageY,this.container.style.top=d+"px")):(this.lastPageX=e.pageX,this.container.style.left=s+"px",this.lastPageY=e.pageY,this.container.style.top=d+"px")}},window.document.addEventListener("mousemove",this.documentDragListener)},unbindDocumentDragListener(){this.documentDragListener&&(window.document.removeEventListener("mousemove",this.documentDragListener),this.documentDragListener=null)},bindDocumentDragEndListener(){this.documentDragEndListener=e=>{this.dragging&&(this.dragging=!1,o.removeClass(document.body,"p-unselectable-text"),this.$emit("dragend",e))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maskClass(){return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":this.modal},this.getPositionClass()]},dialogClass(){return["p-dialog p-component",{"p-dialog-rtl":this.rtl,"p-dialog-maximized":this.maximizable&&this.maximized,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},maximizeIconClass(){return["p-dialog-header-maximize-icon",{[this.maximizeIcon]:!this.maximized,[this.minimizeIcon]:this.maximized}]},ariaId:()=>a(),ariaLabelledById(){return null!=this.header||null!==this.$attrs["aria-labelledby"]?this.ariaId+"_header":null},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector:()=>a(),contentStyleClass(){return["p-dialog-content",this.contentClass]}},directives:{ripple:n,focustrap:e},components:{Portal:t}};const D=["aria-labelledby","aria-modal"],C=["id"],z={class:"p-dialog-header-icons"},E=["autofocus","tabindex"],B=["autofocus","aria-label"];!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-dialog-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n}\n.p-dialog-content {\n overflow-y: auto;\n}\n.p-dialog-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n}\n.p-dialog-footer {\n flex-shrink: 0;\n}\n.p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n}\n.p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n/* Fluid */\n.p-fluid .p-dialog-footer .p-button {\n width: auto;\n}\n\n/* Animation */\n/* Center */\n.p-dialog-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-dialog-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-dialog-enter-from,\n.p-dialog-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n\n/* Top, Bottom, Left, Right, Top* and Bottom* */\n.p-dialog-top .p-dialog,\n.p-dialog-bottom .p-dialog,\n.p-dialog-left .p-dialog,\n.p-dialog-right .p-dialog,\n.p-dialog-topleft .p-dialog,\n.p-dialog-topright .p-dialog,\n.p-dialog-bottomleft .p-dialog,\n.p-dialog-bottomright .p-dialog {\n margin: 0.75rem;\n transform: translate3d(0px, 0px, 0px);\n}\n.p-dialog-top .p-dialog-enter-active,\n.p-dialog-top .p-dialog-leave-active,\n.p-dialog-bottom .p-dialog-enter-active,\n.p-dialog-bottom .p-dialog-leave-active,\n.p-dialog-left .p-dialog-enter-active,\n.p-dialog-left .p-dialog-leave-active,\n.p-dialog-right .p-dialog-enter-active,\n.p-dialog-right .p-dialog-leave-active,\n.p-dialog-topleft .p-dialog-enter-active,\n.p-dialog-topleft .p-dialog-leave-active,\n.p-dialog-topright .p-dialog-enter-active,\n.p-dialog-topright .p-dialog-leave-active,\n.p-dialog-bottomleft .p-dialog-enter-active,\n.p-dialog-bottomleft .p-dialog-leave-active,\n.p-dialog-bottomright .p-dialog-enter-active,\n.p-dialog-bottomright .p-dialog-leave-active {\n transition: all 0.3s ease-out;\n}\n.p-dialog-top .p-dialog-enter-from,\n.p-dialog-top .p-dialog-leave-to {\n transform: translate3d(0px, -100%, 0px);\n}\n.p-dialog-bottom .p-dialog-enter-from,\n.p-dialog-bottom .p-dialog-leave-to {\n transform: translate3d(0px, 100%, 0px);\n}\n.p-dialog-left .p-dialog-enter-from,\n.p-dialog-left .p-dialog-leave-to,\n.p-dialog-topleft .p-dialog-enter-from,\n.p-dialog-topleft .p-dialog-leave-to,\n.p-dialog-bottomleft .p-dialog-enter-from,\n.p-dialog-bottomleft .p-dialog-leave-to {\n transform: translate3d(-100%, 0px, 0px);\n}\n.p-dialog-right .p-dialog-enter-from,\n.p-dialog-right .p-dialog-leave-to,\n.p-dialog-topright .p-dialog-enter-from,\n.p-dialog-topright .p-dialog-leave-to,\n.p-dialog-bottomright .p-dialog-enter-from,\n.p-dialog-bottomright .p-dialog-leave-to {\n transform: translate3d(100%, 0px, 0px);\n}\n\n/* Maximize */\n.p-dialog-maximized {\n -webkit-transition: none;\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n top: 0px !important;\n left: 0px !important;\n max-height: 100%;\n height: 100%;\n}\n.p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n}\n\n/* Position */\n.p-dialog-left {\n justify-content: flex-start;\n}\n.p-dialog-right {\n justify-content: flex-end;\n}\n.p-dialog-top {\n align-items: flex-start;\n}\n.p-dialog-topleft {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.p-dialog-topright {\n justify-content: flex-end;\n align-items: flex-start;\n}\n.p-dialog-bottom {\n align-items: flex-end;\n}\n.p-dialog-bottomleft {\n justify-content: flex-start;\n align-items: flex-end;\n}\n.p-dialog-bottomright {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n}\n"),k.render=function(e,t,n,i,o,a){const l=s("Portal"),k=d("ripple"),S=d("focustrap");return r(),p(l,{appendTo:n.appendTo},{default:m((()=>[o.containerVisible?(r(),g("div",{key:0,ref:a.maskRef,class:c(a.maskClass),onClick:t[3]||(t[3]=(...e)=>a.onMaskClick&&a.onMaskClick(...e))},[h(u,{name:"p-dialog",onBeforeEnter:a.onBeforeEnter,onEnter:a.onEnter,onBeforeLeave:a.onBeforeLeave,onLeave:a.onLeave,onAfterLeave:a.onAfterLeave,appear:""},{default:m((()=>[n.visible?f((r(),g("div",b({key:0,ref:a.containerRef,class:a.dialogClass,role:"dialog","aria-labelledby":a.ariaLabelledById,"aria-modal":n.modal},e.$attrs),[n.showHeader?(r(),g("div",{key:0,ref:a.headerContainerRef,class:"p-dialog-header",onMousedown:t[2]||(t[2]=(...e)=>a.initDrag&&a.initDrag(...e))},[y(e.$slots,"header",{},(()=>[n.header?(r(),g("span",{key:0,id:a.ariaLabelledById,class:"p-dialog-title"},v(n.header),9,C)):x("",!0)])),L("div",z,[n.maximizable?f((r(),g("button",{key:0,ref:a.maximizableRef,autofocus:o.focusable,class:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:t[0]||(t[0]=(...e)=>a.maximize&&a.maximize(...e)),type:"button",tabindex:n.maximizable?"0":"-1"},[L("span",{class:c(a.maximizeIconClass)},null,2)],8,E)),[[k]]):x("",!0),n.closable?f((r(),g("button",b({key:1,ref:a.closeButtonRef,autofocus:o.focusable,class:"p-dialog-header-icon p-dialog-header-close p-link",onClick:t[1]||(t[1]=(...e)=>a.close&&a.close(...e)),"aria-label":a.closeAriaLabel,type:"button"},n.closeButtonProps),[L("span",{class:c(["p-dialog-header-close-icon",n.closeIcon])},null,2)],16,B)),[[k]]):x("",!0)])],544)):x("",!0),L("div",b({ref:a.contentRef,class:a.contentStyleClass,style:n.contentStyle},n.contentProps),[y(e.$slots,"default")],16),n.footer||e.$slots.footer?(r(),g("div",{key:1,ref:a.footerContainerRef,class:"p-dialog-footer"},[y(e.$slots,"footer",{},(()=>[w(v(n.footer),1)]))],512)):x("",!0)],16,D)),[[S,{disabled:!n.modal}]]):x("",!0)])),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],2)):x("",!0)])),_:3},8,["appendTo"])};export{k as default};
1
+ import e from"primevue/focustrap";import t from"primevue/portal";import n from"primevue/ripple";import{ZIndexUtils as i,DomHandler as o,UniqueComponentId as a}from"primevue/utils";import{computed as l,resolveComponent as s,resolveDirective as d,openBlock as r,createBlock as p,withCtx as m,createElementBlock as g,normalizeClass as c,createVNode as u,Transition as h,withDirectives as f,mergeProps as b,renderSlot as y,toDisplayString as v,createCommentVNode as x,createElementVNode as L,createTextVNode as w}from"vue";var C={name:"Dialog",inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:"pi pi-times"},maximizeIcon:{type:String,default:"pi pi-window-maximize"},minimizeIcon:{type:String,default:"pi pi-window-minimize"},closeButtonProps:{type:null,default:null},_instance:null},provide(){return{dialogRef:l((()=>this._instance))}},data(){return{containerVisible:this.visible,maximized:!1,focusableMax:null,focusableClose:null}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&i.clear(this.mask),this.container=null,this.mask=null},mounted(){this.breakpoints&&this.createStyle()},methods:{close(){this.$emit("update:visible",!1)},onBeforeEnter(e){e.setAttribute(this.attributeSelector,"")},onEnter(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&i.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave(){this.modal&&o.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide"),this.focusableClose=null,this.focusableMax=null},onAfterLeave(){this.autoZIndex&&i.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick(e){this.dismissableMask&&this.modal&&this.mask===e.target&&this.close()},focus(){const e=e=>e.querySelector("[autofocus]");let t=this.$slots.footer&&e(this.footerContainer);t||(t=this.$slots.header&&e(this.headerContainer),t||(t=this.$slots.default&&e(this.content),t||(this.maximizable?(this.focusableMax=!0,t=this.maximizableButton):(this.focusableClose=!0,t=this.closeButton)))),t&&o.focus(t)},maximize(e){this.maximized?(this.maximized=!1,this.$emit("unmaximize",e)):(this.maximized=!0,this.$emit("maximize",e)),this.modal||(this.maximized?o.addClass(document.body,"p-overflow-hidden"):o.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings(){(this.modal||this.maximizable&&this.maximized)&&o.addClass(document.body,"p-overflow-hidden")},unbindDocumentState(){(this.modal||this.maximizable&&this.maximized)&&o.removeClass(document.body,"p-overflow-hidden")},onKeyDown(e){"Escape"===e.code&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},getPositionClass(){const e=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find((e=>e===this.position));return e?`p-dialog-${e}`:""},containerRef(e){this.container=e},maskRef(e){this.mask=e},contentRef(e){this.content=e},headerContainerRef(e){this.headerContainer=e},footerContainerRef(e){this.footerContainer=e},maximizableRef(e){this.maximizableButton=e},closeButtonRef(e){this.closeButton=e},createStyle(){if(!this.styleElement){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";for(let t in this.breakpoints)e+=`\n @media screen and (max-width: ${t}) {\n .p-dialog[${this.attributeSelector}] {\n width: ${this.breakpoints[t]} !important;\n }\n }\n `;this.styleElement.innerHTML=e}},destroyStyle(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag(e){o.hasClass(e.target,"p-dialog-header-icon")||o.hasClass(e.target.parentElement,"p-dialog-header-icon")||this.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",o.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener(){this.documentDragListener=e=>{if(this.dragging){let t=o.getOuterWidth(this.container),n=o.getOuterHeight(this.container),i=e.pageX-this.lastPageX,a=e.pageY-this.lastPageY,l=this.container.getBoundingClientRect(),s=l.left+i,d=l.top+a,r=o.getViewport();this.container.style.position="fixed",this.keepInViewport?(s>=this.minX&&s+t<r.width&&(this.lastPageX=e.pageX,this.container.style.left=s+"px"),d>=this.minY&&d+n<r.height&&(this.lastPageY=e.pageY,this.container.style.top=d+"px")):(this.lastPageX=e.pageX,this.container.style.left=s+"px",this.lastPageY=e.pageY,this.container.style.top=d+"px")}},window.document.addEventListener("mousemove",this.documentDragListener)},unbindDocumentDragListener(){this.documentDragListener&&(window.document.removeEventListener("mousemove",this.documentDragListener),this.documentDragListener=null)},bindDocumentDragEndListener(){this.documentDragEndListener=e=>{this.dragging&&(this.dragging=!1,o.removeClass(document.body,"p-unselectable-text"),this.$emit("dragend",e))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maskClass(){return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":this.modal},this.getPositionClass()]},dialogClass(){return["p-dialog p-component",{"p-dialog-rtl":this.rtl,"p-dialog-maximized":this.maximizable&&this.maximized,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},maximizeIconClass(){return["p-dialog-header-maximize-icon",{[this.maximizeIcon]:!this.maximized,[this.minimizeIcon]:this.maximized}]},ariaId:()=>a(),ariaLabelledById(){return null!=this.header||null!==this.$attrs["aria-labelledby"]?this.ariaId+"_header":null},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector:()=>a(),contentStyleClass(){return["p-dialog-content",this.contentClass]}},directives:{ripple:n,focustrap:e},components:{Portal:t}};const k=["aria-labelledby","aria-modal"],D=["id"],z={class:"p-dialog-header-icons"},E=["autofocus","tabindex"],B=["autofocus","aria-label"];!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-dialog-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n}\n.p-dialog-content {\n overflow-y: auto;\n}\n.p-dialog-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n}\n.p-dialog-footer {\n flex-shrink: 0;\n}\n.p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n}\n.p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n/* Fluid */\n.p-fluid .p-dialog-footer .p-button {\n width: auto;\n}\n\n/* Animation */\n/* Center */\n.p-dialog-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-dialog-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-dialog-enter-from,\n.p-dialog-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n\n/* Top, Bottom, Left, Right, Top* and Bottom* */\n.p-dialog-top .p-dialog,\n.p-dialog-bottom .p-dialog,\n.p-dialog-left .p-dialog,\n.p-dialog-right .p-dialog,\n.p-dialog-topleft .p-dialog,\n.p-dialog-topright .p-dialog,\n.p-dialog-bottomleft .p-dialog,\n.p-dialog-bottomright .p-dialog {\n margin: 0.75rem;\n transform: translate3d(0px, 0px, 0px);\n}\n.p-dialog-top .p-dialog-enter-active,\n.p-dialog-top .p-dialog-leave-active,\n.p-dialog-bottom .p-dialog-enter-active,\n.p-dialog-bottom .p-dialog-leave-active,\n.p-dialog-left .p-dialog-enter-active,\n.p-dialog-left .p-dialog-leave-active,\n.p-dialog-right .p-dialog-enter-active,\n.p-dialog-right .p-dialog-leave-active,\n.p-dialog-topleft .p-dialog-enter-active,\n.p-dialog-topleft .p-dialog-leave-active,\n.p-dialog-topright .p-dialog-enter-active,\n.p-dialog-topright .p-dialog-leave-active,\n.p-dialog-bottomleft .p-dialog-enter-active,\n.p-dialog-bottomleft .p-dialog-leave-active,\n.p-dialog-bottomright .p-dialog-enter-active,\n.p-dialog-bottomright .p-dialog-leave-active {\n transition: all 0.3s ease-out;\n}\n.p-dialog-top .p-dialog-enter-from,\n.p-dialog-top .p-dialog-leave-to {\n transform: translate3d(0px, -100%, 0px);\n}\n.p-dialog-bottom .p-dialog-enter-from,\n.p-dialog-bottom .p-dialog-leave-to {\n transform: translate3d(0px, 100%, 0px);\n}\n.p-dialog-left .p-dialog-enter-from,\n.p-dialog-left .p-dialog-leave-to,\n.p-dialog-topleft .p-dialog-enter-from,\n.p-dialog-topleft .p-dialog-leave-to,\n.p-dialog-bottomleft .p-dialog-enter-from,\n.p-dialog-bottomleft .p-dialog-leave-to {\n transform: translate3d(-100%, 0px, 0px);\n}\n.p-dialog-right .p-dialog-enter-from,\n.p-dialog-right .p-dialog-leave-to,\n.p-dialog-topright .p-dialog-enter-from,\n.p-dialog-topright .p-dialog-leave-to,\n.p-dialog-bottomright .p-dialog-enter-from,\n.p-dialog-bottomright .p-dialog-leave-to {\n transform: translate3d(100%, 0px, 0px);\n}\n\n/* Maximize */\n.p-dialog-maximized {\n -webkit-transition: none;\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n top: 0px !important;\n left: 0px !important;\n max-height: 100%;\n height: 100%;\n}\n.p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n}\n\n/* Position */\n.p-dialog-left {\n justify-content: flex-start;\n}\n.p-dialog-right {\n justify-content: flex-end;\n}\n.p-dialog-top {\n align-items: flex-start;\n}\n.p-dialog-topleft {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.p-dialog-topright {\n justify-content: flex-end;\n align-items: flex-start;\n}\n.p-dialog-bottom {\n align-items: flex-end;\n}\n.p-dialog-bottomleft {\n justify-content: flex-start;\n align-items: flex-end;\n}\n.p-dialog-bottomright {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n}\n"),C.render=function(e,t,n,i,o,a){const l=s("Portal"),C=d("ripple"),S=d("focustrap");return r(),p(l,{appendTo:n.appendTo},{default:m((()=>[o.containerVisible?(r(),g("div",{key:0,ref:a.maskRef,class:c(a.maskClass),onClick:t[3]||(t[3]=(...e)=>a.onMaskClick&&a.onMaskClick(...e))},[u(h,{name:"p-dialog",onBeforeEnter:a.onBeforeEnter,onEnter:a.onEnter,onBeforeLeave:a.onBeforeLeave,onLeave:a.onLeave,onAfterLeave:a.onAfterLeave,appear:""},{default:m((()=>[n.visible?f((r(),g("div",b({key:0,ref:a.containerRef,class:a.dialogClass,role:"dialog","aria-labelledby":a.ariaLabelledById,"aria-modal":n.modal},e.$attrs),[n.showHeader?(r(),g("div",{key:0,ref:a.headerContainerRef,class:"p-dialog-header",onMousedown:t[2]||(t[2]=(...e)=>a.initDrag&&a.initDrag(...e))},[y(e.$slots,"header",{},(()=>[n.header?(r(),g("span",{key:0,id:a.ariaLabelledById,class:"p-dialog-title"},v(n.header),9,D)):x("",!0)])),L("div",z,[n.maximizable?f((r(),g("button",{key:0,ref:a.maximizableRef,autofocus:o.focusableMax,class:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:t[0]||(t[0]=(...e)=>a.maximize&&a.maximize(...e)),type:"button",tabindex:n.maximizable?"0":"-1"},[L("span",{class:c(a.maximizeIconClass)},null,2)],8,E)),[[C]]):x("",!0),n.closable?f((r(),g("button",b({key:1,ref:a.closeButtonRef,autofocus:o.focusableClose,class:"p-dialog-header-icon p-dialog-header-close p-link",onClick:t[1]||(t[1]=(...e)=>a.close&&a.close(...e)),"aria-label":a.closeAriaLabel,type:"button"},n.closeButtonProps),[L("span",{class:c(["p-dialog-header-close-icon",n.closeIcon])},null,2)],16,B)),[[C]]):x("",!0)])],544)):x("",!0),L("div",b({ref:a.contentRef,class:a.contentStyleClass,style:n.contentStyle},n.contentProps),[y(e.$slots,"default")],16),n.footer||e.$slots.footer?(r(),g("div",{key:1,ref:a.footerContainerRef,class:"p-dialog-footer"},[y(e.$slots,"footer",{},(()=>[w(v(n.footer),1)]))],512)):x("",!0)],16,k)),[[S,{disabled:!n.modal}]]):x("",!0)])),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],2)):x("",!0)])),_:3},8,["appendTo"])};export{C as default};
package/dialog/dialog.js CHANGED
@@ -128,7 +128,8 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
128
128
  return {
129
129
  containerVisible: this.visible,
130
130
  maximized: false,
131
- focusable: false
131
+ focusableMax: null,
132
+ focusableClose: null
132
133
  };
133
134
  },
134
135
  documentKeydownListener: null,
@@ -191,7 +192,8 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
191
192
  },
192
193
  onLeave() {
193
194
  this.$emit('hide');
194
- this.focusable = false;
195
+ this.focusableClose = null;
196
+ this.focusableMax = null;
195
197
  },
196
198
  onAfterLeave() {
197
199
  if (this.autoZIndex) {
@@ -222,14 +224,19 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
222
224
  focusTarget = this.$slots.default && findFocusableElement(this.content);
223
225
 
224
226
  if (!focusTarget) {
225
- focusTarget = findFocusableElement(this.container);
227
+ if (this.maximizable) {
228
+ this.focusableMax = true;
229
+ focusTarget = this.maximizableButton;
230
+ } else {
231
+ this.focusableClose = true;
232
+ focusTarget = this.closeButton;
233
+ }
226
234
  }
227
235
  }
228
236
  }
229
237
 
230
238
  if (focusTarget) {
231
- this.focusable = true;
232
- focusTarget.focus();
239
+ utils.DomHandler.focus(focusTarget);
233
240
  }
234
241
  },
235
242
  maximize(event) {
@@ -525,7 +532,7 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
525
532
  ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
526
533
  key: 0,
527
534
  ref: $options.maximizableRef,
528
- autofocus: $data.focusable,
535
+ autofocus: $data.focusableMax,
529
536
  class: "p-dialog-header-icon p-dialog-header-maximize p-link",
530
537
  onClick: _cache[0] || (_cache[0] = (...args) => ($options.maximize && $options.maximize(...args))),
531
538
  type: "button",
@@ -542,7 +549,7 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
542
549
  ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
543
550
  key: 1,
544
551
  ref: $options.closeButtonRef,
545
- autofocus: $data.focusable,
552
+ autofocus: $data.focusableClose,
546
553
  class: "p-dialog-header-icon p-dialog-header-close p-link",
547
554
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.close && $options.close(...args))),
548
555
  "aria-label": $options.closeAriaLabel,
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.dialog=function(e,t,n,i,o){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(e),s=a(t),d={name:"Dialog",inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:"pi pi-times"},maximizeIcon:{type:String,default:"pi pi-window-maximize"},minimizeIcon:{type:String,default:"pi pi-window-minimize"},closeButtonProps:{type:null,default:null},_instance:null},provide(){return{dialogRef:o.computed((()=>this._instance))}},data(){return{containerVisible:this.visible,maximized:!1,focusable:!1}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},mounted(){this.breakpoints&&this.createStyle()},methods:{close(){this.$emit("update:visible",!1)},onBeforeEnter(e){e.setAttribute(this.attributeSelector,"")},onEnter(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&i.ZIndexUtils.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave(){this.modal&&i.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide"),this.focusable=!1},onAfterLeave(){this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick(e){this.dismissableMask&&this.modal&&this.mask===e.target&&this.close()},focus(){const e=e=>e.querySelector("[autofocus]");let t=this.$slots.footer&&e(this.footerContainer);t||(t=this.$slots.header&&e(this.headerContainer),t||(t=this.$slots.default&&e(this.content),t||(t=e(this.container)))),t&&(this.focusable=!0,t.focus())},maximize(e){this.maximized?(this.maximized=!1,this.$emit("unmaximize",e)):(this.maximized=!0,this.$emit("maximize",e)),this.modal||(this.maximized?i.DomHandler.addClass(document.body,"p-overflow-hidden"):i.DomHandler.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings(){(this.modal||this.maximizable&&this.maximized)&&i.DomHandler.addClass(document.body,"p-overflow-hidden")},unbindDocumentState(){(this.modal||this.maximizable&&this.maximized)&&i.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeyDown(e){"Escape"===e.code&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},getPositionClass(){const e=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find((e=>e===this.position));return e?`p-dialog-${e}`:""},containerRef(e){this.container=e},maskRef(e){this.mask=e},contentRef(e){this.content=e},headerContainerRef(e){this.headerContainer=e},footerContainerRef(e){this.footerContainer=e},maximizableRef(e){this.maximizableButton=e},closeButtonRef(e){this.closeButton=e},createStyle(){if(!this.styleElement){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";for(let t in this.breakpoints)e+=`\n @media screen and (max-width: ${t}) {\n .p-dialog[${this.attributeSelector}] {\n width: ${this.breakpoints[t]} !important;\n }\n }\n `;this.styleElement.innerHTML=e}},destroyStyle(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag(e){i.DomHandler.hasClass(e.target,"p-dialog-header-icon")||i.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||this.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",i.DomHandler.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener(){this.documentDragListener=e=>{if(this.dragging){let t=i.DomHandler.getOuterWidth(this.container),n=i.DomHandler.getOuterHeight(this.container),o=e.pageX-this.lastPageX,a=e.pageY-this.lastPageY,l=this.container.getBoundingClientRect(),s=l.left+o,d=l.top+a,r=i.DomHandler.getViewport();this.container.style.position="fixed",this.keepInViewport?(s>=this.minX&&s+t<r.width&&(this.lastPageX=e.pageX,this.container.style.left=s+"px"),d>=this.minY&&d+n<r.height&&(this.lastPageY=e.pageY,this.container.style.top=d+"px")):(this.lastPageX=e.pageX,this.container.style.left=s+"px",this.lastPageY=e.pageY,this.container.style.top=d+"px")}},window.document.addEventListener("mousemove",this.documentDragListener)},unbindDocumentDragListener(){this.documentDragListener&&(window.document.removeEventListener("mousemove",this.documentDragListener),this.documentDragListener=null)},bindDocumentDragEndListener(){this.documentDragEndListener=e=>{this.dragging&&(this.dragging=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),this.$emit("dragend",e))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maskClass(){return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":this.modal},this.getPositionClass()]},dialogClass(){return["p-dialog p-component",{"p-dialog-rtl":this.rtl,"p-dialog-maximized":this.maximizable&&this.maximized,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},maximizeIconClass(){return["p-dialog-header-maximize-icon",{[this.maximizeIcon]:!this.maximized,[this.minimizeIcon]:this.maximized}]},ariaId:()=>i.UniqueComponentId(),ariaLabelledById(){return null!=this.header||null!==this.$attrs["aria-labelledby"]?this.ariaId+"_header":null},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector:()=>i.UniqueComponentId(),contentStyleClass(){return["p-dialog-content",this.contentClass]}},directives:{ripple:a(n).default,focustrap:l.default},components:{Portal:s.default}};const r=["aria-labelledby","aria-modal"],p=["id"],m={class:"p-dialog-header-icons"},c=["autofocus","tabindex"],g=["autofocus","aria-label"];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-dialog-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n}\n.p-dialog-content {\n overflow-y: auto;\n}\n.p-dialog-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n}\n.p-dialog-footer {\n flex-shrink: 0;\n}\n.p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n}\n.p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n/* Fluid */\n.p-fluid .p-dialog-footer .p-button {\n width: auto;\n}\n\n/* Animation */\n/* Center */\n.p-dialog-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-dialog-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-dialog-enter-from,\n.p-dialog-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n\n/* Top, Bottom, Left, Right, Top* and Bottom* */\n.p-dialog-top .p-dialog,\n.p-dialog-bottom .p-dialog,\n.p-dialog-left .p-dialog,\n.p-dialog-right .p-dialog,\n.p-dialog-topleft .p-dialog,\n.p-dialog-topright .p-dialog,\n.p-dialog-bottomleft .p-dialog,\n.p-dialog-bottomright .p-dialog {\n margin: 0.75rem;\n transform: translate3d(0px, 0px, 0px);\n}\n.p-dialog-top .p-dialog-enter-active,\n.p-dialog-top .p-dialog-leave-active,\n.p-dialog-bottom .p-dialog-enter-active,\n.p-dialog-bottom .p-dialog-leave-active,\n.p-dialog-left .p-dialog-enter-active,\n.p-dialog-left .p-dialog-leave-active,\n.p-dialog-right .p-dialog-enter-active,\n.p-dialog-right .p-dialog-leave-active,\n.p-dialog-topleft .p-dialog-enter-active,\n.p-dialog-topleft .p-dialog-leave-active,\n.p-dialog-topright .p-dialog-enter-active,\n.p-dialog-topright .p-dialog-leave-active,\n.p-dialog-bottomleft .p-dialog-enter-active,\n.p-dialog-bottomleft .p-dialog-leave-active,\n.p-dialog-bottomright .p-dialog-enter-active,\n.p-dialog-bottomright .p-dialog-leave-active {\n transition: all 0.3s ease-out;\n}\n.p-dialog-top .p-dialog-enter-from,\n.p-dialog-top .p-dialog-leave-to {\n transform: translate3d(0px, -100%, 0px);\n}\n.p-dialog-bottom .p-dialog-enter-from,\n.p-dialog-bottom .p-dialog-leave-to {\n transform: translate3d(0px, 100%, 0px);\n}\n.p-dialog-left .p-dialog-enter-from,\n.p-dialog-left .p-dialog-leave-to,\n.p-dialog-topleft .p-dialog-enter-from,\n.p-dialog-topleft .p-dialog-leave-to,\n.p-dialog-bottomleft .p-dialog-enter-from,\n.p-dialog-bottomleft .p-dialog-leave-to {\n transform: translate3d(-100%, 0px, 0px);\n}\n.p-dialog-right .p-dialog-enter-from,\n.p-dialog-right .p-dialog-leave-to,\n.p-dialog-topright .p-dialog-enter-from,\n.p-dialog-topright .p-dialog-leave-to,\n.p-dialog-bottomright .p-dialog-enter-from,\n.p-dialog-bottomright .p-dialog-leave-to {\n transform: translate3d(100%, 0px, 0px);\n}\n\n/* Maximize */\n.p-dialog-maximized {\n -webkit-transition: none;\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n top: 0px !important;\n left: 0px !important;\n max-height: 100%;\n height: 100%;\n}\n.p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n}\n\n/* Position */\n.p-dialog-left {\n justify-content: flex-start;\n}\n.p-dialog-right {\n justify-content: flex-end;\n}\n.p-dialog-top {\n align-items: flex-start;\n}\n.p-dialog-topleft {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.p-dialog-topright {\n justify-content: flex-end;\n align-items: flex-start;\n}\n.p-dialog-bottom {\n align-items: flex-end;\n}\n.p-dialog-bottomleft {\n justify-content: flex-start;\n align-items: flex-end;\n}\n.p-dialog-bottomright {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n}\n"),d.render=function(e,t,n,i,a,l){const s=o.resolveComponent("Portal"),d=o.resolveDirective("ripple"),u=o.resolveDirective("focustrap");return o.openBlock(),o.createBlock(s,{appendTo:n.appendTo},{default:o.withCtx((()=>[a.containerVisible?(o.openBlock(),o.createElementBlock("div",{key:0,ref:l.maskRef,class:o.normalizeClass(l.maskClass),onClick:t[3]||(t[3]=(...e)=>l.onMaskClick&&l.onMaskClick(...e))},[o.createVNode(o.Transition,{name:"p-dialog",onBeforeEnter:l.onBeforeEnter,onEnter:l.onEnter,onBeforeLeave:l.onBeforeLeave,onLeave:l.onLeave,onAfterLeave:l.onAfterLeave,appear:""},{default:o.withCtx((()=>[n.visible?o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:l.containerRef,class:l.dialogClass,role:"dialog","aria-labelledby":l.ariaLabelledById,"aria-modal":n.modal},e.$attrs),[n.showHeader?(o.openBlock(),o.createElementBlock("div",{key:0,ref:l.headerContainerRef,class:"p-dialog-header",onMousedown:t[2]||(t[2]=(...e)=>l.initDrag&&l.initDrag(...e))},[o.renderSlot(e.$slots,"header",{},(()=>[n.header?(o.openBlock(),o.createElementBlock("span",{key:0,id:l.ariaLabelledById,class:"p-dialog-title"},o.toDisplayString(n.header),9,p)):o.createCommentVNode("",!0)])),o.createElementVNode("div",m,[n.maximizable?o.withDirectives((o.openBlock(),o.createElementBlock("button",{key:0,ref:l.maximizableRef,autofocus:a.focusable,class:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:t[0]||(t[0]=(...e)=>l.maximize&&l.maximize(...e)),type:"button",tabindex:n.maximizable?"0":"-1"},[o.createElementVNode("span",{class:o.normalizeClass(l.maximizeIconClass)},null,2)],8,c)),[[d]]):o.createCommentVNode("",!0),n.closable?o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({key:1,ref:l.closeButtonRef,autofocus:a.focusable,class:"p-dialog-header-icon p-dialog-header-close p-link",onClick:t[1]||(t[1]=(...e)=>l.close&&l.close(...e)),"aria-label":l.closeAriaLabel,type:"button"},n.closeButtonProps),[o.createElementVNode("span",{class:o.normalizeClass(["p-dialog-header-close-icon",n.closeIcon])},null,2)],16,g)),[[d]]):o.createCommentVNode("",!0)])],544)):o.createCommentVNode("",!0),o.createElementVNode("div",o.mergeProps({ref:l.contentRef,class:l.contentStyleClass,style:n.contentStyle},n.contentProps),[o.renderSlot(e.$slots,"default")],16),n.footer||e.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:1,ref:l.footerContainerRef,class:"p-dialog-footer"},[o.renderSlot(e.$slots,"footer",{},(()=>[o.createTextVNode(o.toDisplayString(n.footer),1)]))],512)):o.createCommentVNode("",!0)],16,r)),[[u,{disabled:!n.modal}]]):o.createCommentVNode("",!0)])),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],2)):o.createCommentVNode("",!0)])),_:3},8,["appendTo"])},d}(primevue.focustrap,primevue.portal,primevue.ripple,primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.dialog=function(e,t,n,i,o){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(e),s=a(t),d={name:"Dialog",inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:"pi pi-times"},maximizeIcon:{type:String,default:"pi pi-window-maximize"},minimizeIcon:{type:String,default:"pi pi-window-minimize"},closeButtonProps:{type:null,default:null},_instance:null},provide(){return{dialogRef:o.computed((()=>this._instance))}},data(){return{containerVisible:this.visible,maximized:!1,focusableMax:null,focusableClose:null}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},mounted(){this.breakpoints&&this.createStyle()},methods:{close(){this.$emit("update:visible",!1)},onBeforeEnter(e){e.setAttribute(this.attributeSelector,"")},onEnter(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&i.ZIndexUtils.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave(){this.modal&&i.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide"),this.focusableClose=null,this.focusableMax=null},onAfterLeave(){this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick(e){this.dismissableMask&&this.modal&&this.mask===e.target&&this.close()},focus(){const e=e=>e.querySelector("[autofocus]");let t=this.$slots.footer&&e(this.footerContainer);t||(t=this.$slots.header&&e(this.headerContainer),t||(t=this.$slots.default&&e(this.content),t||(this.maximizable?(this.focusableMax=!0,t=this.maximizableButton):(this.focusableClose=!0,t=this.closeButton)))),t&&i.DomHandler.focus(t)},maximize(e){this.maximized?(this.maximized=!1,this.$emit("unmaximize",e)):(this.maximized=!0,this.$emit("maximize",e)),this.modal||(this.maximized?i.DomHandler.addClass(document.body,"p-overflow-hidden"):i.DomHandler.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings(){(this.modal||this.maximizable&&this.maximized)&&i.DomHandler.addClass(document.body,"p-overflow-hidden")},unbindDocumentState(){(this.modal||this.maximizable&&this.maximized)&&i.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeyDown(e){"Escape"===e.code&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},getPositionClass(){const e=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find((e=>e===this.position));return e?`p-dialog-${e}`:""},containerRef(e){this.container=e},maskRef(e){this.mask=e},contentRef(e){this.content=e},headerContainerRef(e){this.headerContainer=e},footerContainerRef(e){this.footerContainer=e},maximizableRef(e){this.maximizableButton=e},closeButtonRef(e){this.closeButton=e},createStyle(){if(!this.styleElement){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let e="";for(let t in this.breakpoints)e+=`\n @media screen and (max-width: ${t}) {\n .p-dialog[${this.attributeSelector}] {\n width: ${this.breakpoints[t]} !important;\n }\n }\n `;this.styleElement.innerHTML=e}},destroyStyle(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag(e){i.DomHandler.hasClass(e.target,"p-dialog-header-icon")||i.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||this.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",i.DomHandler.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener(){this.documentDragListener=e=>{if(this.dragging){let t=i.DomHandler.getOuterWidth(this.container),n=i.DomHandler.getOuterHeight(this.container),o=e.pageX-this.lastPageX,a=e.pageY-this.lastPageY,l=this.container.getBoundingClientRect(),s=l.left+o,d=l.top+a,r=i.DomHandler.getViewport();this.container.style.position="fixed",this.keepInViewport?(s>=this.minX&&s+t<r.width&&(this.lastPageX=e.pageX,this.container.style.left=s+"px"),d>=this.minY&&d+n<r.height&&(this.lastPageY=e.pageY,this.container.style.top=d+"px")):(this.lastPageX=e.pageX,this.container.style.left=s+"px",this.lastPageY=e.pageY,this.container.style.top=d+"px")}},window.document.addEventListener("mousemove",this.documentDragListener)},unbindDocumentDragListener(){this.documentDragListener&&(window.document.removeEventListener("mousemove",this.documentDragListener),this.documentDragListener=null)},bindDocumentDragEndListener(){this.documentDragEndListener=e=>{this.dragging&&(this.dragging=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),this.$emit("dragend",e))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maskClass(){return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":this.modal},this.getPositionClass()]},dialogClass(){return["p-dialog p-component",{"p-dialog-rtl":this.rtl,"p-dialog-maximized":this.maximizable&&this.maximized,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},maximizeIconClass(){return["p-dialog-header-maximize-icon",{[this.maximizeIcon]:!this.maximized,[this.minimizeIcon]:this.maximized}]},ariaId:()=>i.UniqueComponentId(),ariaLabelledById(){return null!=this.header||null!==this.$attrs["aria-labelledby"]?this.ariaId+"_header":null},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector:()=>i.UniqueComponentId(),contentStyleClass(){return["p-dialog-content",this.contentClass]}},directives:{ripple:a(n).default,focustrap:l.default},components:{Portal:s.default}};const r=["aria-labelledby","aria-modal"],m=["id"],p={class:"p-dialog-header-icons"},c=["autofocus","tabindex"],u=["autofocus","aria-label"];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-dialog-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n}\n.p-dialog-content {\n overflow-y: auto;\n}\n.p-dialog-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n}\n.p-dialog-footer {\n flex-shrink: 0;\n}\n.p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n}\n.p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n/* Fluid */\n.p-fluid .p-dialog-footer .p-button {\n width: auto;\n}\n\n/* Animation */\n/* Center */\n.p-dialog-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-dialog-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-dialog-enter-from,\n.p-dialog-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n\n/* Top, Bottom, Left, Right, Top* and Bottom* */\n.p-dialog-top .p-dialog,\n.p-dialog-bottom .p-dialog,\n.p-dialog-left .p-dialog,\n.p-dialog-right .p-dialog,\n.p-dialog-topleft .p-dialog,\n.p-dialog-topright .p-dialog,\n.p-dialog-bottomleft .p-dialog,\n.p-dialog-bottomright .p-dialog {\n margin: 0.75rem;\n transform: translate3d(0px, 0px, 0px);\n}\n.p-dialog-top .p-dialog-enter-active,\n.p-dialog-top .p-dialog-leave-active,\n.p-dialog-bottom .p-dialog-enter-active,\n.p-dialog-bottom .p-dialog-leave-active,\n.p-dialog-left .p-dialog-enter-active,\n.p-dialog-left .p-dialog-leave-active,\n.p-dialog-right .p-dialog-enter-active,\n.p-dialog-right .p-dialog-leave-active,\n.p-dialog-topleft .p-dialog-enter-active,\n.p-dialog-topleft .p-dialog-leave-active,\n.p-dialog-topright .p-dialog-enter-active,\n.p-dialog-topright .p-dialog-leave-active,\n.p-dialog-bottomleft .p-dialog-enter-active,\n.p-dialog-bottomleft .p-dialog-leave-active,\n.p-dialog-bottomright .p-dialog-enter-active,\n.p-dialog-bottomright .p-dialog-leave-active {\n transition: all 0.3s ease-out;\n}\n.p-dialog-top .p-dialog-enter-from,\n.p-dialog-top .p-dialog-leave-to {\n transform: translate3d(0px, -100%, 0px);\n}\n.p-dialog-bottom .p-dialog-enter-from,\n.p-dialog-bottom .p-dialog-leave-to {\n transform: translate3d(0px, 100%, 0px);\n}\n.p-dialog-left .p-dialog-enter-from,\n.p-dialog-left .p-dialog-leave-to,\n.p-dialog-topleft .p-dialog-enter-from,\n.p-dialog-topleft .p-dialog-leave-to,\n.p-dialog-bottomleft .p-dialog-enter-from,\n.p-dialog-bottomleft .p-dialog-leave-to {\n transform: translate3d(-100%, 0px, 0px);\n}\n.p-dialog-right .p-dialog-enter-from,\n.p-dialog-right .p-dialog-leave-to,\n.p-dialog-topright .p-dialog-enter-from,\n.p-dialog-topright .p-dialog-leave-to,\n.p-dialog-bottomright .p-dialog-enter-from,\n.p-dialog-bottomright .p-dialog-leave-to {\n transform: translate3d(100%, 0px, 0px);\n}\n\n/* Maximize */\n.p-dialog-maximized {\n -webkit-transition: none;\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n top: 0px !important;\n left: 0px !important;\n max-height: 100%;\n height: 100%;\n}\n.p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n}\n\n/* Position */\n.p-dialog-left {\n justify-content: flex-start;\n}\n.p-dialog-right {\n justify-content: flex-end;\n}\n.p-dialog-top {\n align-items: flex-start;\n}\n.p-dialog-topleft {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.p-dialog-topright {\n justify-content: flex-end;\n align-items: flex-start;\n}\n.p-dialog-bottom {\n align-items: flex-end;\n}\n.p-dialog-bottomleft {\n justify-content: flex-start;\n align-items: flex-end;\n}\n.p-dialog-bottomright {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n}\n"),d.render=function(e,t,n,i,a,l){const s=o.resolveComponent("Portal"),d=o.resolveDirective("ripple"),g=o.resolveDirective("focustrap");return o.openBlock(),o.createBlock(s,{appendTo:n.appendTo},{default:o.withCtx((()=>[a.containerVisible?(o.openBlock(),o.createElementBlock("div",{key:0,ref:l.maskRef,class:o.normalizeClass(l.maskClass),onClick:t[3]||(t[3]=(...e)=>l.onMaskClick&&l.onMaskClick(...e))},[o.createVNode(o.Transition,{name:"p-dialog",onBeforeEnter:l.onBeforeEnter,onEnter:l.onEnter,onBeforeLeave:l.onBeforeLeave,onLeave:l.onLeave,onAfterLeave:l.onAfterLeave,appear:""},{default:o.withCtx((()=>[n.visible?o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:l.containerRef,class:l.dialogClass,role:"dialog","aria-labelledby":l.ariaLabelledById,"aria-modal":n.modal},e.$attrs),[n.showHeader?(o.openBlock(),o.createElementBlock("div",{key:0,ref:l.headerContainerRef,class:"p-dialog-header",onMousedown:t[2]||(t[2]=(...e)=>l.initDrag&&l.initDrag(...e))},[o.renderSlot(e.$slots,"header",{},(()=>[n.header?(o.openBlock(),o.createElementBlock("span",{key:0,id:l.ariaLabelledById,class:"p-dialog-title"},o.toDisplayString(n.header),9,m)):o.createCommentVNode("",!0)])),o.createElementVNode("div",p,[n.maximizable?o.withDirectives((o.openBlock(),o.createElementBlock("button",{key:0,ref:l.maximizableRef,autofocus:a.focusableMax,class:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:t[0]||(t[0]=(...e)=>l.maximize&&l.maximize(...e)),type:"button",tabindex:n.maximizable?"0":"-1"},[o.createElementVNode("span",{class:o.normalizeClass(l.maximizeIconClass)},null,2)],8,c)),[[d]]):o.createCommentVNode("",!0),n.closable?o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({key:1,ref:l.closeButtonRef,autofocus:a.focusableClose,class:"p-dialog-header-icon p-dialog-header-close p-link",onClick:t[1]||(t[1]=(...e)=>l.close&&l.close(...e)),"aria-label":l.closeAriaLabel,type:"button"},n.closeButtonProps),[o.createElementVNode("span",{class:o.normalizeClass(["p-dialog-header-close-icon",n.closeIcon])},null,2)],16,u)),[[d]]):o.createCommentVNode("",!0)])],544)):o.createCommentVNode("",!0),o.createElementVNode("div",o.mergeProps({ref:l.contentRef,class:l.contentStyleClass,style:n.contentStyle},n.contentProps),[o.renderSlot(e.$slots,"default")],16),n.footer||e.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:1,ref:l.footerContainerRef,class:"p-dialog-footer"},[o.renderSlot(e.$slots,"footer",{},(()=>[o.createTextVNode(o.toDisplayString(n.footer),1)]))],512)):o.createCommentVNode("",!0)],16,r)),[[g,{disabled:!n.modal}]]):o.createCommentVNode("",!0)])),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],2)):o.createCommentVNode("",!0)])),_:3},8,["appendTo"])},d}(primevue.focustrap,primevue.portal,primevue.ripple,primevue.utils,Vue);
@@ -80,6 +80,7 @@ export interface DropdownProps {
80
80
  scrollHeight?: string | undefined;
81
81
  /**
82
82
  * When specified, displays a filter input at header.
83
+ * @defaultValue false
83
84
  */
84
85
  filter?: boolean | undefined;
85
86
  /**
@@ -101,6 +102,7 @@ export interface DropdownProps {
101
102
  filterFields?: string[] | undefined;
102
103
  /**
103
104
  * When present, custom value instead of predefined options can be entered using the editable input field.
105
+ * @defaultValue false
104
106
  */
105
107
  editable?: boolean | undefined;
106
108
  /**
@@ -109,6 +111,7 @@ export interface DropdownProps {
109
111
  placeholder?: string | undefined;
110
112
  /**
111
113
  * When present, it specifies that the component should be disabled.
114
+ * @defaultValue false
112
115
  */
113
116
  disabled?: boolean | undefined;
114
117
  /**
@@ -117,6 +120,7 @@ export interface DropdownProps {
117
120
  dataKey?: string | undefined;
118
121
  /**
119
122
  * When enabled, a clear icon is displayed to clear the value.
123
+ * @defaultValue false
120
124
  */
121
125
  showClear?: boolean | undefined;
122
126
  /**
@@ -126,11 +130,11 @@ export interface DropdownProps {
126
130
  /**
127
131
  * Inline style of the input field.
128
132
  */
129
- inputStyle?: any;
133
+ inputStyle?: object | undefined;
130
134
  /**
131
135
  * Style class of the input field.
132
136
  */
133
- inputClass?: any;
137
+ inputClass?: string | object | undefined;
134
138
  /**
135
139
  * Uses to pass all properties of the HTMLInputElement/HTMLSpanElement to the focusable input element inside the component.
136
140
  */
@@ -138,11 +142,11 @@ export interface DropdownProps {
138
142
  /**
139
143
  * Inline style of the overlay panel.
140
144
  */
141
- panelStyle?: any;
145
+ panelStyle?: object | undefined;
142
146
  /**
143
147
  * Style class of the overlay panel.
144
148
  */
145
- panelClass?: any;
149
+ panelClass?: string | object | undefined;
146
150
  /**
147
151
  * Uses to pass all properties of the HTMLDivElement to the overlay panel inside the component.
148
152
  */
@@ -162,6 +166,7 @@ export interface DropdownProps {
162
166
  appendTo?: 'body' | 'self' | string | undefined | HTMLElement;
163
167
  /**
164
168
  * Whether the dropdown is in loading state.
169
+ * @defaultValue false
165
170
  */
166
171
  loading?: boolean | undefined;
167
172
  /**
@@ -186,6 +191,7 @@ export interface DropdownProps {
186
191
  loadingIcon?: string | undefined;
187
192
  /**
188
193
  * Clears the filter value when hiding the dropdown.
194
+ * @defaultValue false
189
195
  */
190
196
  resetFilterOnHide?: boolean;
191
197
  /**
@@ -188,11 +188,11 @@ export default {
188
188
  default: null
189
189
  },
190
190
  inputClass: {
191
- type: String,
191
+ type: [String, Object],
192
192
  default: null
193
193
  },
194
194
  inputStyle: {
195
- type: null,
195
+ type: Object,
196
196
  default: null
197
197
  },
198
198
  inputProps: {
@@ -200,11 +200,11 @@ export default {
200
200
  default: null
201
201
  },
202
202
  panelClass: {
203
- type: String,
203
+ type: [String, Object],
204
204
  default: null
205
205
  },
206
206
  panelStyle: {
207
- type: null,
207
+ type: Object,
208
208
  default: null
209
209
  },
210
210
  panelProps: {
@@ -809,7 +809,7 @@ export default {
809
809
  return this.isValidOption(option) && this.isSelected(option);
810
810
  },
811
811
  isSelected(option) {
812
- return ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
812
+ return this.isValidOption(option) && ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
813
813
  },
814
814
  findFirstOptionIndex() {
815
815
  return this.visibleOptions.findIndex((option) => this.isValidOption(option));