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.
- package/README.md +64 -176
- package/api/Api.d.ts +284 -292
- package/autocomplete/AutoComplete.d.ts +5 -5
- package/autocomplete/AutoComplete.vue +5 -5
- package/autocomplete/autocomplete.cjs.js +5 -5
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +5 -5
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +5 -5
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/BlockUI.d.ts +2 -0
- package/calendar/Calendar.d.ts +4 -4
- package/calendar/Calendar.vue +71 -17
- package/calendar/calendar.cjs.js +58 -20
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +58 -20
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +58 -20
- package/calendar/calendar.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +4 -4
- package/cascadeselect/CascadeSelect.vue +4 -4
- package/cascadeselect/cascadeselect.cjs.js +4 -4
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +4 -4
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +4 -4
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.vue +2 -2
- package/checkbox/checkbox.cjs.js +2 -2
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +2 -2
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +2 -2
- package/checkbox/checkbox.min.js +1 -1
- package/chips/Chips.d.ts +4 -3
- package/chips/Chips.vue +2 -2
- package/chips/chips.cjs.js +2 -2
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -2
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -2
- package/chips/chips.min.js +1 -1
- package/column/Column.d.ts +9 -0
- package/confirmationoptions/ConfirmationOptions.d.ts +1 -0
- package/confirmdialog/ConfirmDialog.d.ts +5 -0
- package/confirmdialog/ConfirmDialog.vue +17 -1
- package/confirmdialog/confirmdialog.cjs.js +7 -2
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +7 -2
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +7 -2
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.vue +3 -0
- package/confirmpopup/confirmpopup.cjs.js +3 -0
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +3 -0
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +3 -0
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/core/core.js +22 -15
- package/core/core.min.js +4 -4
- package/datatable/DataTable.d.ts +9 -9
- package/datatable/FooterCell.vue +2 -2
- package/datatable/TableBody.vue +6 -1
- package/datatable/datatable.cjs.js +8 -3
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +8 -3
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +8 -3
- package/datatable/datatable.min.js +1 -1
- package/dialog/Dialog.vue +24 -7
- package/dialog/dialog.cjs.js +14 -7
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +14 -7
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +14 -7
- package/dialog/dialog.min.js +1 -1
- package/dropdown/Dropdown.d.ts +10 -4
- package/dropdown/Dropdown.vue +5 -5
- package/dropdown/dropdown.cjs.js +5 -5
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +5 -5
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +5 -5
- package/dropdown/dropdown.min.js +1 -1
- package/dynamicdialog/DynamicDialog.vue +1 -1
- package/dynamicdialog/dynamicdialog.cjs.js +1 -1
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +2 -2
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +1 -1
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/editor/Editor.d.ts +1 -0
- package/inplace/Inplace.vue +5 -1
- package/inplace/inplace.cjs.js +10 -2
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +10 -3
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +11 -4
- package/inplace/inplace.min.js +1 -1
- package/inputmask/InputMask.vue +59 -49
- package/inputmask/inputmask.cjs.js +59 -49
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +59 -49
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +59 -49
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +2 -2
- package/inputnumber/InputNumber.vue +2 -2
- package/inputnumber/inputnumber.cjs.js +2 -2
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +2 -2
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +2 -2
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +3 -2
- package/inputswitch/InputSwitch.vue +2 -2
- package/inputswitch/inputswitch.cjs.js +2 -2
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +2 -2
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +2 -2
- package/inputswitch/inputswitch.min.js +1 -1
- package/menuitem/MenuItem.d.ts +1 -1
- package/organizationchart/OrganizationChart.d.ts +3 -2
- package/package.json +1 -1
- package/panel/Panel.d.ts +4 -2
- package/password/Password.d.ts +4 -4
- package/password/Password.vue +4 -4
- package/password/password.cjs.js +4 -4
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +4 -4
- package/password/password.esm.min.js +1 -1
- package/password/password.js +4 -4
- package/password/password.min.js +1 -1
- package/portal/Portal.d.ts +1 -0
- package/radiobutton/RadioButton.d.ts +3 -2
- package/radiobutton/RadioButton.vue +2 -2
- package/radiobutton/radiobutton.cjs.js +2 -2
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -2
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +2 -2
- package/radiobutton/radiobutton.min.js +1 -1
- package/row/Row.d.ts +1 -1
- package/selectbutton/SelectButton.d.ts +1 -1
- package/selectbutton/SelectButton.vue +2 -2
- package/selectbutton/selectbutton.cjs.js +2 -2
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +2 -2
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +2 -2
- package/selectbutton/selectbutton.min.js +1 -1
- package/slider/Slider.vue +3 -14
- package/slider/slider.cjs.js +3 -14
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +3 -14
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +3 -14
- package/slider/slider.min.js +1 -1
- package/splitbutton/SplitButton.vue +4 -2
- package/splitbutton/splitbutton.cjs.js +6 -4
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +6 -4
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +6 -4
- package/splitbutton/splitbutton.min.js +1 -1
- package/textarea/Textarea.d.ts +1 -0
- package/tieredmenu/TieredMenu.d.ts +2 -0
- package/toast/Toast.d.ts +0 -1
- package/togglebutton/ToggleButton.d.ts +2 -2
- package/togglebutton/ToggleButton.vue +2 -2
- package/togglebutton/togglebutton.cjs.js +2 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +2 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -2
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.cjs.js +1 -1
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +1 -1
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tree/Tree.d.ts +3 -0
- package/treeselect/TreeSelect.d.ts +2 -2
- package/treeselect/TreeSelect.vue +3 -3
- package/treeselect/treeselect.cjs.js +3 -3
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +3 -3
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +3 -3
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/TreeTable.d.ts +2 -0
- package/treetable/TreeTable.vue +3 -3
- package/treetable/treetable.cjs.js +3 -3
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +3 -3
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +3 -3
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.vue +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +1 -1
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/vetur-attributes.json +32 -28
- package/vetur-tags.json +2 -1
- package/web-types.json +40 -30
package/chips/chips.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.chips=function(e,t){"use strict";var n={name:"Chips",emits:["update:modelValue","add","remove","focus","blur"],props:{modelValue:{type:Array,default:null},max:{type:Number,default:null},separator:{type:[String,Object],default:null},addOnBlur:{type:Boolean,default:null},allowDuplicate:{type:Boolean,default:!0},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:String,default:null},inputStyle:{type:
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.chips=function(e,t){"use strict";var n={name:"Chips",emits:["update:modelValue","add","remove","focus","blur"],props:{modelValue:{type:Array,default:null},max:{type:Number,default:null},separator:{type:[String,Object],default:null},addOnBlur:{type:Boolean,default:null},allowDuplicate:{type:Boolean,default:!0},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},removeTokenIcon:{type:String,default:"pi pi-times-circle"},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data:()=>({id:e.UniqueComponentId(),inputValue:null,focused:!1,focusedIndex:null}),methods:{onWrapperClick(){this.$refs.input.focus()},onInput(e){this.inputValue=e.target.value,this.focusedIndex=null},onFocus(e){this.focused=!0,this.focusedIndex=null,this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedIndex=null,this.addOnBlur&&this.addItem(e,e.target.value,!1),this.$emit("blur",e)},onKeyDown(e){const t=e.target.value;switch(e.code){case"Backspace":0===t.length&&this.modelValue&&this.modelValue.length>0&&(null!==this.focusedIndex?this.removeItem(e,this.focusedIndex):this.removeItem(e,this.modelValue.length-1));break;case"Enter":t&&t.trim().length&&!this.maxedOut&&this.addItem(e,t,!0);break;case"ArrowLeft":0===t.length&&this.modelValue&&this.modelValue.length>0&&this.$refs.container.focus();break;case"ArrowRight":e.stopPropagation();break;default:this.separator&&(this.separator===e.key||e.key.match(this.separator))&&this.addItem(e,t,!0)}},onPaste(e){if(this.separator){let t=(e.clipboardData||window.clipboardData).getData("Text");if(t){let n=this.modelValue||[],l=t.split(this.separator);l=l.filter((e=>this.allowDuplicate||-1===n.indexOf(e))),n=[...n,...l],this.updateModel(e,n,!0)}}},onContainerFocus(){this.focused=!0},onContainerBlur(){this.focusedIndex=-1,this.focused=!1},onContainerKeyDown(e){switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOn(e);break;case"ArrowRight":this.onArrowRightKeyOn(e);break;case"Backspace":this.onBackspaceKeyOn(e)}},onArrowLeftKeyOn(){0===this.inputValue.length&&this.modelValue&&this.modelValue.length>0&&(this.focusedIndex=null===this.focusedIndex?this.modelValue.length-1:this.focusedIndex-1,this.focusedIndex<0&&(this.focusedIndex=0))},onArrowRightKeyOn(){0===this.inputValue.length&&this.modelValue&&this.modelValue.length>0&&(this.focusedIndex===this.modelValue.length-1?(this.focusedIndex=null,this.$refs.input.focus()):this.focusedIndex++)},onBackspaceKeyOn(e){null!==this.focusedIndex&&this.removeItem(e,this.focusedIndex)},updateModel(e,t,n){this.$emit("update:modelValue",t),this.$emit("add",{originalEvent:e,value:t}),this.$refs.input.value="",this.inputValue="",setTimeout((()=>{this.maxedOut&&(this.focused=!1)}),0),n&&e.preventDefault()},addItem(e,t,n){if(t&&t.trim().length){let l=this.modelValue?[...this.modelValue]:[];(this.allowDuplicate||-1===l.indexOf(t))&&(l.push(t),this.updateModel(e,l,n))}},removeItem(e,t){if(this.disabled)return;let n=[...this.modelValue];const l=n.splice(t,1);this.focusedIndex=null,this.$refs.input.focus(),this.$emit("update:modelValue",n),this.$emit("remove",{originalEvent:e,value:l})}},computed:{maxedOut(){return this.max&&this.modelValue&&this.max===this.modelValue.length},containerClass(){return["p-chips p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length||this.inputValue&&this.inputValue.length,"p-inputwrapper-focus":this.focused}]},focusedOptionId(){return null!==this.focusedIndex?`${this.id}_chips_item_${this.focusedIndex}`:null}}};const l=["aria-labelledby","aria-label","aria-activedescendant"],i=["id","aria-label","aria-setsize","aria-posinset"],a={class:"p-chips-token-label"},s=["onClick"],o={class:"p-chips-input-token",role:"option"},u=["id","disabled","placeholder"];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-chips {\n display: inline-flex;\n}\n.p-chips-multiple-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.p-chips-token {\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n}\n.p-chips-input-token {\n flex: 1 1 auto;\n display: inline-flex;\n}\n.p-chips-token-icon {\n cursor: pointer;\n}\n.p-chips-input-token input {\n border: 0 none;\n outline: 0 none;\n background-color: transparent;\n margin: 0;\n padding: 0;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n}\n.p-fluid .p-chips {\n display: flex;\n}\n"),n.render=function(e,n,d,r,p,c){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(c.containerClass)},[t.createElementVNode("ul",{ref:"container",class:"p-inputtext p-chips-multiple-container",tabindex:"-1",role:"listbox","aria-orientation":"horizontal","aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-activedescendant":p.focused?c.focusedOptionId:void 0,onClick:n[5]||(n[5]=e=>c.onWrapperClick()),onFocus:n[6]||(n[6]=(...e)=>c.onContainerFocus&&c.onContainerFocus(...e)),onBlur:n[7]||(n[7]=(...e)=>c.onContainerBlur&&c.onContainerBlur(...e)),onKeydown:n[8]||(n[8]=(...e)=>c.onContainerKeyDown&&c.onContainerKeyDown(...e))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.modelValue,((n,l)=>(t.openBlock(),t.createElementBlock("li",{key:`${l}_${n}`,id:p.id+"_chips_item_"+l,role:"option",class:t.normalizeClass(["p-chips-token",{"p-focus":p.focusedIndex===l}]),"aria-label":n,"aria-selected":!0,"aria-setsize":d.modelValue.length,"aria-posinset":l+1},[t.renderSlot(e.$slots,"chip",{value:n},(()=>[t.createElementVNode("span",a,t.toDisplayString(n),1)])),t.createElementVNode("span",{class:t.normalizeClass(["p-chips-token-icon",d.removeTokenIcon]),onClick:e=>c.removeItem(e,l),"aria-hidden":"true"},null,10,s)],10,i)))),128)),t.createElementVNode("li",o,[t.createElementVNode("input",t.mergeProps({ref:"input",id:d.inputId,type:"text",class:d.inputClass,style:d.inputStyle,disabled:d.disabled||c.maxedOut,placeholder:d.placeholder,onFocus:n[0]||(n[0]=e=>c.onFocus(e)),onBlur:n[1]||(n[1]=e=>c.onBlur(e)),onInput:n[2]||(n[2]=(...e)=>c.onInput&&c.onInput(...e)),onKeydown:n[3]||(n[3]=e=>c.onKeyDown(e)),onPaste:n[4]||(n[4]=e=>c.onPaste(e))},d.inputProps),null,16,u)])],40,l)],2)},n}(primevue.utils,Vue);
|
package/column/Column.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export interface ColumnProps {
|
|
|
94
94
|
dataType?: string | undefined;
|
|
95
95
|
/**
|
|
96
96
|
* Defines if a column is sortable.
|
|
97
|
+
* @defaultValue false
|
|
97
98
|
*/
|
|
98
99
|
sortable?: boolean | undefined;
|
|
99
100
|
/**
|
|
@@ -177,6 +178,7 @@ export interface ColumnProps {
|
|
|
177
178
|
maxConstraints?: number | undefined;
|
|
178
179
|
/**
|
|
179
180
|
* Whether to exclude from global filtering or not.
|
|
181
|
+
* @defaultValue false
|
|
180
182
|
*/
|
|
181
183
|
excludeGlobalFilter?: boolean | undefined;
|
|
182
184
|
/**
|
|
@@ -201,6 +203,7 @@ export interface ColumnProps {
|
|
|
201
203
|
selectionMode?: 'single' | 'multiple' | undefined;
|
|
202
204
|
/**
|
|
203
205
|
* Displays an icon to toggle row expansion.
|
|
206
|
+
* @defaultValue false
|
|
204
207
|
*/
|
|
205
208
|
expander?: boolean | undefined;
|
|
206
209
|
/**
|
|
@@ -213,6 +216,7 @@ export interface ColumnProps {
|
|
|
213
216
|
rowspan?: number | undefined;
|
|
214
217
|
/**
|
|
215
218
|
* Whether this column displays an icon to reorder the rows.
|
|
219
|
+
* @defaultValue false
|
|
216
220
|
*/
|
|
217
221
|
rowReorder?: boolean | undefined;
|
|
218
222
|
/**
|
|
@@ -222,14 +226,17 @@ export interface ColumnProps {
|
|
|
222
226
|
rowReorderIcon?: string | undefined;
|
|
223
227
|
/**
|
|
224
228
|
* Defines if the column itself can be reordered with dragging.
|
|
229
|
+
* @defaultValue false
|
|
225
230
|
*/
|
|
226
231
|
reorderableColumn?: boolean | undefined;
|
|
227
232
|
/**
|
|
228
233
|
* When enabled, column displays row editor controls.
|
|
234
|
+
* @defaultValue false
|
|
229
235
|
*/
|
|
230
236
|
rowEditor?: boolean | undefined;
|
|
231
237
|
/**
|
|
232
238
|
* Whether the column is fixed in horizontal scrolling.
|
|
239
|
+
* @defaultValue false
|
|
233
240
|
*/
|
|
234
241
|
frozen?: boolean | undefined;
|
|
235
242
|
/**
|
|
@@ -239,6 +246,7 @@ export interface ColumnProps {
|
|
|
239
246
|
alignFrozen?: 'left' | 'right' | undefined;
|
|
240
247
|
/**
|
|
241
248
|
* Whether the column is included in data export.
|
|
249
|
+
* @defaultValue false
|
|
242
250
|
*/
|
|
243
251
|
exportable?: boolean | undefined;
|
|
244
252
|
/**
|
|
@@ -255,6 +263,7 @@ export interface ColumnProps {
|
|
|
255
263
|
filterMatchMode?: string | undefined;
|
|
256
264
|
/**
|
|
257
265
|
* Whether the column is rendered.
|
|
266
|
+
* @defaultValue false
|
|
258
267
|
*/
|
|
259
268
|
hidden?: boolean | undefined;
|
|
260
269
|
}
|
|
@@ -46,6 +46,11 @@ export interface ConfirmDialogProps {
|
|
|
46
46
|
* @see ConfirmDialogBreakpoints
|
|
47
47
|
*/
|
|
48
48
|
breakpoints?: ConfirmDialogBreakpoints;
|
|
49
|
+
/**
|
|
50
|
+
* Enables dragging to change the position using header.
|
|
51
|
+
* @defaultValue true
|
|
52
|
+
*/
|
|
53
|
+
draggable?: boolean | undefined;
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
/**
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<CDialog
|
|
2
|
+
<CDialog
|
|
3
|
+
v-model:visible="visible"
|
|
4
|
+
role="alertdialog"
|
|
5
|
+
class="p-confirm-dialog"
|
|
6
|
+
:modal="true"
|
|
7
|
+
:header="header"
|
|
8
|
+
:blockScroll="blockScroll"
|
|
9
|
+
:position="position"
|
|
10
|
+
:breakpoints="breakpoints"
|
|
11
|
+
:closeOnEscape="closeOnEscape"
|
|
12
|
+
:draggable="draggable"
|
|
13
|
+
@update:visible="onHide"
|
|
14
|
+
>
|
|
3
15
|
<template v-if="!$slots.message">
|
|
4
16
|
<i v-if="confirmation.icon" :class="iconClass" />
|
|
5
17
|
<span class="p-confirm-dialog-message">{{ message }}</span>
|
|
@@ -24,6 +36,10 @@ export default {
|
|
|
24
36
|
breakpoints: {
|
|
25
37
|
type: Object,
|
|
26
38
|
default: null
|
|
39
|
+
},
|
|
40
|
+
draggable: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true
|
|
27
43
|
}
|
|
28
44
|
},
|
|
29
45
|
confirmListener: null,
|
|
@@ -18,6 +18,10 @@ var script = {
|
|
|
18
18
|
breakpoints: {
|
|
19
19
|
type: Object,
|
|
20
20
|
default: null
|
|
21
|
+
},
|
|
22
|
+
draggable: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
confirmListener: null,
|
|
@@ -149,7 +153,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
149
153
|
blockScroll: $options.blockScroll,
|
|
150
154
|
position: $options.position,
|
|
151
155
|
breakpoints: $props.breakpoints,
|
|
152
|
-
closeOnEscape: $options.closeOnEscape
|
|
156
|
+
closeOnEscape: $options.closeOnEscape,
|
|
157
|
+
draggable: $props.draggable
|
|
153
158
|
}, {
|
|
154
159
|
footer: vue.withCtx(() => [
|
|
155
160
|
vue.createVNode(_component_CDButton, {
|
|
@@ -184,7 +189,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
184
189
|
}, null, 8, ["message"]))
|
|
185
190
|
]),
|
|
186
191
|
_: 1
|
|
187
|
-
}, 8, ["visible", "header", "blockScroll", "position", "breakpoints", "closeOnEscape", "onUpdate:visible"]))
|
|
192
|
+
}, 8, ["visible", "header", "blockScroll", "position", "breakpoints", "closeOnEscape", "draggable", "onUpdate:visible"]))
|
|
188
193
|
}
|
|
189
194
|
|
|
190
195
|
script.render = render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/button"),o=require("primevue/confirmationeventbus"),i=require("primevue/dialog"),t=require("vue");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(e),s=n(o),
|
|
1
|
+
"use strict";var e=require("primevue/button"),o=require("primevue/confirmationeventbus"),i=require("primevue/dialog"),t=require("vue");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(e),s=n(o),a={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},s.default.on("confirm",this.confirmListener),s.default.on("close",this.closeListener)},beforeUnmount(){s.default.off("confirm",this.confirmListener),s.default.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:n(i).default,CDButton:c.default}};const r={class:"p-confirm-dialog-message"};a.render=function(e,o,i,n,c,s){const a=t.resolveComponent("CDButton"),l=t.resolveComponent("CDialog");return t.openBlock(),t.createBlock(l,{visible:c.visible,"onUpdate:visible":[o[2]||(o[2]=e=>c.visible=e),s.onHide],role:"alertdialog",class:"p-confirm-dialog",modal:!0,header:s.header,blockScroll:s.blockScroll,position:s.position,breakpoints:i.breakpoints,closeOnEscape:s.closeOnEscape,draggable:i.draggable},{footer:t.withCtx((()=>[t.createVNode(a,{label:s.rejectLabel,icon:s.rejectIcon,class:t.normalizeClass(s.rejectClass),onClick:o[0]||(o[0]=e=>s.reject()),autofocus:s.autoFocusReject},null,8,["label","icon","class","autofocus"]),t.createVNode(a,{label:s.acceptLabel,icon:s.acceptIcon,class:t.normalizeClass(s.acceptClass),onClick:o[1]||(o[1]=e=>s.accept()),autofocus:s.autoFocusAccept},null,8,["label","icon","class","autofocus"])])),default:t.withCtx((()=>[e.$slots.message?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[c.confirmation.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(s.iconClass)},null,2)):t.createCommentVNode("",!0),t.createElementVNode("span",r,t.toDisplayString(s.message),1)],64))])),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible"])},module.exports=a;
|
|
@@ -10,6 +10,10 @@ var script = {
|
|
|
10
10
|
breakpoints: {
|
|
11
11
|
type: Object,
|
|
12
12
|
default: null
|
|
13
|
+
},
|
|
14
|
+
draggable: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: true
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
confirmListener: null,
|
|
@@ -141,7 +145,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
141
145
|
blockScroll: $options.blockScroll,
|
|
142
146
|
position: $options.position,
|
|
143
147
|
breakpoints: $props.breakpoints,
|
|
144
|
-
closeOnEscape: $options.closeOnEscape
|
|
148
|
+
closeOnEscape: $options.closeOnEscape,
|
|
149
|
+
draggable: $props.draggable
|
|
145
150
|
}, {
|
|
146
151
|
footer: withCtx(() => [
|
|
147
152
|
createVNode(_component_CDButton, {
|
|
@@ -176,7 +181,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
176
181
|
}, null, 8, ["message"]))
|
|
177
182
|
]),
|
|
178
183
|
_: 1
|
|
179
|
-
}, 8, ["visible", "header", "blockScroll", "position", "breakpoints", "closeOnEscape", "onUpdate:visible"]))
|
|
184
|
+
}, 8, ["visible", "header", "blockScroll", "position", "breakpoints", "closeOnEscape", "draggable", "onUpdate:visible"]))
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
script.render = render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import i from"primevue/button";import o from"primevue/confirmationeventbus";import t from"primevue/dialog";import{resolveComponent as e,openBlock as n,createBlock as c,withCtx as s,createVNode as r,normalizeClass as a,createElementBlock as l,Fragment as m,createCommentVNode as u,createElementVNode as f,toDisplayString as
|
|
1
|
+
import i from"primevue/button";import o from"primevue/confirmationeventbus";import t from"primevue/dialog";import{resolveComponent as e,openBlock as n,createBlock as c,withCtx as s,createVNode as r,normalizeClass as a,createElementBlock as l,Fragment as m,createCommentVNode as u,createElementVNode as f,toDisplayString as p,resolveDynamicComponent as h}from"vue";var b={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=i=>{i&&i.group===this.group&&(this.confirmation=i,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},o.on("confirm",this.confirmListener),o.on("close",this.closeListener)},beforeUnmount(){o.off("confirm",this.confirmListener),o.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:t,CDButton:i}};const d={class:"p-confirm-dialog-message"};b.render=function(i,o,t,b,g,v){const j=e("CDButton"),C=e("CDialog");return n(),c(C,{visible:g.visible,"onUpdate:visible":[o[2]||(o[2]=i=>g.visible=i),v.onHide],role:"alertdialog",class:"p-confirm-dialog",modal:!0,header:v.header,blockScroll:v.blockScroll,position:v.position,breakpoints:t.breakpoints,closeOnEscape:v.closeOnEscape,draggable:t.draggable},{footer:s((()=>[r(j,{label:v.rejectLabel,icon:v.rejectIcon,class:a(v.rejectClass),onClick:o[0]||(o[0]=i=>v.reject()),autofocus:v.autoFocusReject},null,8,["label","icon","class","autofocus"]),r(j,{label:v.acceptLabel,icon:v.acceptIcon,class:a(v.acceptClass),onClick:o[1]||(o[1]=i=>v.accept()),autofocus:v.autoFocusAccept},null,8,["label","icon","class","autofocus"])])),default:s((()=>[i.$slots.message?(n(),c(h(i.$slots.message),{key:1,message:g.confirmation},null,8,["message"])):(n(),l(m,{key:0},[g.confirmation.icon?(n(),l("i",{key:0,class:a(v.iconClass)},null,2)):u("",!0),f("span",d,p(v.message),1)],64))])),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible"])};export{b as default};
|
|
@@ -15,6 +15,10 @@ this.primevue.confirmdialog = (function (Button, ConfirmationEventBus, Dialog, v
|
|
|
15
15
|
breakpoints: {
|
|
16
16
|
type: Object,
|
|
17
17
|
default: null
|
|
18
|
+
},
|
|
19
|
+
draggable: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
confirmListener: null,
|
|
@@ -146,7 +150,8 @@ this.primevue.confirmdialog = (function (Button, ConfirmationEventBus, Dialog, v
|
|
|
146
150
|
blockScroll: $options.blockScroll,
|
|
147
151
|
position: $options.position,
|
|
148
152
|
breakpoints: $props.breakpoints,
|
|
149
|
-
closeOnEscape: $options.closeOnEscape
|
|
153
|
+
closeOnEscape: $options.closeOnEscape,
|
|
154
|
+
draggable: $props.draggable
|
|
150
155
|
}, {
|
|
151
156
|
footer: vue.withCtx(() => [
|
|
152
157
|
vue.createVNode(_component_CDButton, {
|
|
@@ -181,7 +186,7 @@ this.primevue.confirmdialog = (function (Button, ConfirmationEventBus, Dialog, v
|
|
|
181
186
|
}, null, 8, ["message"]))
|
|
182
187
|
]),
|
|
183
188
|
_: 1
|
|
184
|
-
}, 8, ["visible", "header", "blockScroll", "position", "breakpoints", "closeOnEscape", "onUpdate:visible"]))
|
|
189
|
+
}, 8, ["visible", "header", "blockScroll", "position", "breakpoints", "closeOnEscape", "draggable", "onUpdate:visible"]))
|
|
185
190
|
}
|
|
186
191
|
|
|
187
192
|
script.render = render;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.confirmdialog=function(e,o,i,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(e),s=n(o),a={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},s.default.on("confirm",this.confirmListener),s.default.on("close",this.closeListener)},beforeUnmount(){s.default.off("confirm",this.confirmListener),s.default.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:n(i).default,CDButton:c.default}};const
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.confirmdialog=function(e,o,i,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(e),s=n(o),a={name:"ConfirmDialog",props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},confirmListener:null,closeListener:null,data:()=>({visible:!1,confirmation:null}),mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},s.default.on("confirm",this.confirmListener),s.default.on("close",this.closeListener)},beforeUnmount(){s.default.off("confirm",this.confirmListener),s.default.off("close",this.closeListener)},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1}},computed:{header(){return this.confirmation?this.confirmation.header:null},message(){return this.confirmation?this.confirmation.message:null},blockScroll(){return!this.confirmation||this.confirmation.blockScroll},position(){return this.confirmation?this.confirmation.position:null},iconClass(){return["p-confirm-dialog-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-dialog-accept",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-dialog-reject",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]},autoFocusAccept(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject(){return"reject"===this.confirmation.defaultFocus},closeOnEscape(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:n(i).default,CDButton:c.default}};const l={class:"p-confirm-dialog-message"};return a.render=function(e,o,i,n,c,s){const a=t.resolveComponent("CDButton"),r=t.resolveComponent("CDialog");return t.openBlock(),t.createBlock(r,{visible:c.visible,"onUpdate:visible":[o[2]||(o[2]=e=>c.visible=e),s.onHide],role:"alertdialog",class:"p-confirm-dialog",modal:!0,header:s.header,blockScroll:s.blockScroll,position:s.position,breakpoints:i.breakpoints,closeOnEscape:s.closeOnEscape,draggable:i.draggable},{footer:t.withCtx((()=>[t.createVNode(a,{label:s.rejectLabel,icon:s.rejectIcon,class:t.normalizeClass(s.rejectClass),onClick:o[0]||(o[0]=e=>s.reject()),autofocus:s.autoFocusReject},null,8,["label","icon","class","autofocus"]),t.createVNode(a,{label:s.acceptLabel,icon:s.acceptIcon,class:t.normalizeClass(s.acceptClass),onClick:o[1]||(o[1]=e=>s.accept()),autofocus:s.autoFocusAccept},null,8,["label","icon","class","autofocus"])])),default:t.withCtx((()=>[e.$slots.message?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[c.confirmation.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(s.iconClass)},null,2)):t.createCommentVNode("",!0),t.createElementVNode("span",l,t.toDisplayString(s.message),1)],64))])),_:1},8,["visible","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible"])},a}(primevue.button,primevue.confirmationeventbus,primevue.dialog,Vue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/button"),t=require("primevue/confirmationeventbus"),n=require("primevue/focustrap"),i=require("primevue/overlayeventbus"),o=require("primevue/portal"),r=require("primevue/utils"),s=require("vue");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),a=c(t),p=c(n),u=c(i),f=c(o),d={name:"ConfirmPopup",inheritAttrs:!1,props:{group:String},data:()=>({visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.target=e.target,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},a.default.on("confirm",this.confirmListener),a.default.on("close",this.closeListener)},beforeUnmount(){a.default.off("confirm",this.confirmListener),a.default.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(r.ZIndexUtils.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.accept(),r.DomHandler.focus(this.target),e.preventDefault())},onRejectKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.reject(),r.DomHandler.focus(this.target),e.preventDefault())},onEnter(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),r.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter(){this.focus()},onLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave(e){r.ZIndexUtils.clear(e)},alignOverlay(){r.DomHandler.absolutePosition(this.container,this.target);const e=r.DomHandler.getOffset(this.container),t=r.DomHandler.getOffset(this.target);let n=0;e.left<t.left&&(n=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft",`${n}px`),e.top<t.top&&r.DomHandler.addClass(this.container,"p-confirm-popup-flipped")},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.visible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)?(this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1):this.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new r.ConnectedOverlayScrollHandler(this.target,(()=>{this.visible&&(this.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.visible&&!r.DomHandler.isTouchDevice()&&(this.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus(){let e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef(e){this.container=e},onOverlayClick(e){u.default.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown(e){"Escape"===e.code&&(a.default.emit("close",this.closeListener),r.DomHandler.focus(this.target))}},computed:{containerClass(){return["p-confirm-popup p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},message(){return this.confirmation?this.confirmation.message:null},iconClass(){return["p-confirm-popup-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-popup-accept p-button-sm",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-popup-reject p-button-sm",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]}},components:{CPButton:l.default,Portal:f.default},directives:{focustrap:p.default}};const m=["aria-modal"],h={key:0,class:"p-confirm-popup-content"},v={class:"p-confirm-popup-message"},b={class:"p-confirm-popup-footer"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-confirm-popup {\n position: absolute;\n margin-top: 10px;\n top: 0;\n left: 0;\n}\n.p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n/* Animation */\n.p-confirm-popup-enter-from {\n opacity: 0;\n transform: scaleY(0.8);\n}\n.p-confirm-popup-leave-to {\n opacity: 0;\n}\n.p-confirm-popup-enter-active {\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n.p-confirm-popup-leave-active {\n transition: opacity 0.1s linear;\n}\n.p-confirm-popup:after,\n.p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n.p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n}\n.p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n}\n.p-confirm-popup-flipped:after,\n.p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n}\n.p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n}\n.p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent;\n}\n.p-confirm-popup .p-confirm-popup-content {\n display: flex;\n align-items: center;\n}\n"),d.render=function(e,t,n,i,o,r){const c=s.resolveComponent("CPButton"),l=s.resolveComponent("Portal"),a=s.resolveDirective("focustrap");return s.openBlock(),s.createBlock(l,null,{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-confirm-popup",onEnter:r.onEnter,onAfterEnter:r.onAfterEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},{default:s.withCtx((()=>[o.visible?s.withDirectives((s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:r.containerRef,role:"alertdialog",class:r.containerClass,"aria-modal":o.visible,onClick:t[2]||(t[2]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>r.onOverlayKeydown&&r.onOverlayKeydown(...e))},e.$attrs),[e.$slots.message?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(s.openBlock(),s.createElementBlock("div",h,[s.createElementVNode("i",{class:s.normalizeClass(r.iconClass)},null,2),s.createElementVNode("span",v,s.toDisplayString(o.confirmation.message),1)])),s.createElementVNode("div",b,[s.createVNode(c,{label:r.rejectLabel,icon:r.rejectIcon,class:s.normalizeClass(r.rejectClass),onClick:t[0]||(t[0]=e=>r.reject()),onKeydown:r.onRejectKeydown,autofocus:o.autoFocusReject},null,8,["label","icon","class","onKeydown","autofocus"]),s.createVNode(c,{label:r.acceptLabel,icon:r.acceptIcon,class:s.normalizeClass(r.acceptClass),onClick:t[1]||(t[1]=e=>r.accept()),onKeydown:r.onAcceptKeydown,autofocus:o.autoFocusAccept},null,8,["label","icon","class","onKeydown","autofocus"])])],16,m)),[[a]]):s.createCommentVNode("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1})},module.exports=d;
|
|
1
|
+
"use strict";var e=require("primevue/button"),t=require("primevue/confirmationeventbus"),n=require("primevue/focustrap"),i=require("primevue/overlayeventbus"),o=require("primevue/portal"),r=require("primevue/utils"),s=require("vue");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),a=c(t),p=c(n),u=c(i),f=c(o),d={name:"ConfirmPopup",inheritAttrs:!1,props:{group:String},data:()=>({visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.target=e.target,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},a.default.on("confirm",this.confirmListener),a.default.on("close",this.closeListener)},beforeUnmount(){a.default.off("confirm",this.confirmListener),a.default.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(r.ZIndexUtils.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.accept(),r.DomHandler.focus(this.target),e.preventDefault())},onRejectKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.reject(),r.DomHandler.focus(this.target),e.preventDefault())},onEnter(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),r.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter(){this.focus()},onLeave(){this.autoFocusAccept=null,this.autoFocusReject=null,this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave(e){r.ZIndexUtils.clear(e)},alignOverlay(){r.DomHandler.absolutePosition(this.container,this.target);const e=r.DomHandler.getOffset(this.container),t=r.DomHandler.getOffset(this.target);let n=0;e.left<t.left&&(n=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft",`${n}px`),e.top<t.top&&r.DomHandler.addClass(this.container,"p-confirm-popup-flipped")},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.visible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)?(this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1):this.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new r.ConnectedOverlayScrollHandler(this.target,(()=>{this.visible&&(this.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.visible&&!r.DomHandler.isTouchDevice()&&(this.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus(){let e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef(e){this.container=e},onOverlayClick(e){u.default.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown(e){"Escape"===e.code&&(a.default.emit("close",this.closeListener),r.DomHandler.focus(this.target))}},computed:{containerClass(){return["p-confirm-popup p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},message(){return this.confirmation?this.confirmation.message:null},iconClass(){return["p-confirm-popup-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-popup-accept p-button-sm",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-popup-reject p-button-sm",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]}},components:{CPButton:l.default,Portal:f.default},directives:{focustrap:p.default}};const m=["aria-modal"],h={key:0,class:"p-confirm-popup-content"},v={class:"p-confirm-popup-message"},b={class:"p-confirm-popup-footer"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-confirm-popup {\n position: absolute;\n margin-top: 10px;\n top: 0;\n left: 0;\n}\n.p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n/* Animation */\n.p-confirm-popup-enter-from {\n opacity: 0;\n transform: scaleY(0.8);\n}\n.p-confirm-popup-leave-to {\n opacity: 0;\n}\n.p-confirm-popup-enter-active {\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n.p-confirm-popup-leave-active {\n transition: opacity 0.1s linear;\n}\n.p-confirm-popup:after,\n.p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n.p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n}\n.p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n}\n.p-confirm-popup-flipped:after,\n.p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n}\n.p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n}\n.p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent;\n}\n.p-confirm-popup .p-confirm-popup-content {\n display: flex;\n align-items: center;\n}\n"),d.render=function(e,t,n,i,o,r){const c=s.resolveComponent("CPButton"),l=s.resolveComponent("Portal"),a=s.resolveDirective("focustrap");return s.openBlock(),s.createBlock(l,null,{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-confirm-popup",onEnter:r.onEnter,onAfterEnter:r.onAfterEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},{default:s.withCtx((()=>[o.visible?s.withDirectives((s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:r.containerRef,role:"alertdialog",class:r.containerClass,"aria-modal":o.visible,onClick:t[2]||(t[2]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>r.onOverlayKeydown&&r.onOverlayKeydown(...e))},e.$attrs),[e.$slots.message?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(s.openBlock(),s.createElementBlock("div",h,[s.createElementVNode("i",{class:s.normalizeClass(r.iconClass)},null,2),s.createElementVNode("span",v,s.toDisplayString(o.confirmation.message),1)])),s.createElementVNode("div",b,[s.createVNode(c,{label:r.rejectLabel,icon:r.rejectIcon,class:s.normalizeClass(r.rejectClass),onClick:t[0]||(t[0]=e=>r.reject()),onKeydown:r.onRejectKeydown,autofocus:o.autoFocusReject},null,8,["label","icon","class","onKeydown","autofocus"]),s.createVNode(c,{label:r.acceptLabel,icon:r.acceptIcon,class:s.normalizeClass(r.acceptClass),onClick:t[1]||(t[1]=e=>r.accept()),onKeydown:r.onAcceptKeydown,autofocus:o.autoFocusAccept},null,8,["label","icon","class","onKeydown","autofocus"])])],16,m)),[[a]]):s.createCommentVNode("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1})},module.exports=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/button";import t from"primevue/confirmationeventbus";import i from"primevue/focustrap";import n from"primevue/overlayeventbus";import o from"primevue/portal";import{ZIndexUtils as r,DomHandler as s,ConnectedOverlayScrollHandler as c}from"primevue/utils";import{resolveComponent as l,resolveDirective as a,openBlock as p,createBlock as u,withCtx as f,createVNode as m,Transition as h,withDirectives as d,createElementBlock as v,mergeProps as b,createElementVNode as L,normalizeClass as g,toDisplayString as y,resolveDynamicComponent as C,createCommentVNode as k}from"vue";var w={name:"ConfirmPopup",inheritAttrs:!1,props:{group:String},data:()=>({visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.target=e.target,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},t.on("confirm",this.confirmListener),t.on("close",this.closeListener)},beforeUnmount(){t.off("confirm",this.confirmListener),t.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(r.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.accept(),s.focus(this.target),e.preventDefault())},onRejectKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.reject(),s.focus(this.target),e.preventDefault())},onEnter(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),r.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter(){this.focus()},onLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave(e){r.clear(e)},alignOverlay(){s.absolutePosition(this.container,this.target);const e=s.getOffset(this.container),t=s.getOffset(this.target);let i=0;e.left<t.left&&(i=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft",`${i}px`),e.top<t.top&&s.addClass(this.container,"p-confirm-popup-flipped")},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.visible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)?(this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1):this.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new c(this.target,(()=>{this.visible&&(this.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.visible&&!s.isTouchDevice()&&(this.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus(){let e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef(e){this.container=e},onOverlayClick(e){n.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown(e){"Escape"===e.code&&(t.emit("close",this.closeListener),s.focus(this.target))}},computed:{containerClass(){return["p-confirm-popup p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},message(){return this.confirmation?this.confirmation.message:null},iconClass(){return["p-confirm-popup-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-popup-accept p-button-sm",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-popup-reject p-button-sm",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]}},components:{CPButton:e,Portal:o},directives:{focustrap:i}};const j=["aria-modal"],A={key:0,class:"p-confirm-popup-content"},E={class:"p-confirm-popup-message"},z={class:"p-confirm-popup-footer"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-confirm-popup {\n position: absolute;\n margin-top: 10px;\n top: 0;\n left: 0;\n}\n.p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n/* Animation */\n.p-confirm-popup-enter-from {\n opacity: 0;\n transform: scaleY(0.8);\n}\n.p-confirm-popup-leave-to {\n opacity: 0;\n}\n.p-confirm-popup-enter-active {\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n.p-confirm-popup-leave-active {\n transition: opacity 0.1s linear;\n}\n.p-confirm-popup:after,\n.p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n.p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n}\n.p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n}\n.p-confirm-popup-flipped:after,\n.p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n}\n.p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n}\n.p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent;\n}\n.p-confirm-popup .p-confirm-popup-content {\n display: flex;\n align-items: center;\n}\n"),w.render=function(e,t,i,n,o,r){const s=l("CPButton"),c=l("Portal"),w=a("focustrap");return p(),u(c,null,{default:f((()=>[m(h,{name:"p-confirm-popup",onEnter:r.onEnter,onAfterEnter:r.onAfterEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},{default:f((()=>[o.visible?d((p(),v("div",b({key:0,ref:r.containerRef,role:"alertdialog",class:r.containerClass,"aria-modal":o.visible,onClick:t[2]||(t[2]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>r.onOverlayKeydown&&r.onOverlayKeydown(...e))},e.$attrs),[e.$slots.message?(p(),u(C(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(p(),v("div",A,[L("i",{class:g(r.iconClass)},null,2),L("span",E,y(o.confirmation.message),1)])),L("div",z,[m(s,{label:r.rejectLabel,icon:r.rejectIcon,class:g(r.rejectClass),onClick:t[0]||(t[0]=e=>r.reject()),onKeydown:r.onRejectKeydown,autofocus:o.autoFocusReject},null,8,["label","icon","class","onKeydown","autofocus"]),m(s,{label:r.acceptLabel,icon:r.acceptIcon,class:g(r.acceptClass),onClick:t[1]||(t[1]=e=>r.accept()),onKeydown:r.onAcceptKeydown,autofocus:o.autoFocusAccept},null,8,["label","icon","class","onKeydown","autofocus"])])],16,j)),[[w]]):k("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1})};export{w as default};
|
|
1
|
+
import e from"primevue/button";import t from"primevue/confirmationeventbus";import i from"primevue/focustrap";import n from"primevue/overlayeventbus";import o from"primevue/portal";import{ZIndexUtils as r,DomHandler as s,ConnectedOverlayScrollHandler as c}from"primevue/utils";import{resolveComponent as l,resolveDirective as a,openBlock as p,createBlock as u,withCtx as f,createVNode as m,Transition as h,withDirectives as d,createElementBlock as v,mergeProps as b,createElementVNode as L,normalizeClass as g,toDisplayString as y,resolveDynamicComponent as C,createCommentVNode as k}from"vue";var w={name:"ConfirmPopup",inheritAttrs:!1,props:{group:String},data:()=>({visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.target=e.target,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},t.on("confirm",this.confirmListener),t.on("close",this.closeListener)},beforeUnmount(){t.off("confirm",this.confirmListener),t.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(r.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.accept(),s.focus(this.target),e.preventDefault())},onRejectKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.reject(),s.focus(this.target),e.preventDefault())},onEnter(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),r.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter(){this.focus()},onLeave(){this.autoFocusAccept=null,this.autoFocusReject=null,this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave(e){r.clear(e)},alignOverlay(){s.absolutePosition(this.container,this.target);const e=s.getOffset(this.container),t=s.getOffset(this.target);let i=0;e.left<t.left&&(i=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft",`${i}px`),e.top<t.top&&s.addClass(this.container,"p-confirm-popup-flipped")},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.visible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)?(this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1):this.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new c(this.target,(()=>{this.visible&&(this.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.visible&&!s.isTouchDevice()&&(this.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus(){let e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef(e){this.container=e},onOverlayClick(e){n.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown(e){"Escape"===e.code&&(t.emit("close",this.closeListener),s.focus(this.target))}},computed:{containerClass(){return["p-confirm-popup p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},message(){return this.confirmation?this.confirmation.message:null},iconClass(){return["p-confirm-popup-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-popup-accept p-button-sm",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-popup-reject p-button-sm",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]}},components:{CPButton:e,Portal:o},directives:{focustrap:i}};const j=["aria-modal"],A={key:0,class:"p-confirm-popup-content"},E={class:"p-confirm-popup-message"},z={class:"p-confirm-popup-footer"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-confirm-popup {\n position: absolute;\n margin-top: 10px;\n top: 0;\n left: 0;\n}\n.p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n/* Animation */\n.p-confirm-popup-enter-from {\n opacity: 0;\n transform: scaleY(0.8);\n}\n.p-confirm-popup-leave-to {\n opacity: 0;\n}\n.p-confirm-popup-enter-active {\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n.p-confirm-popup-leave-active {\n transition: opacity 0.1s linear;\n}\n.p-confirm-popup:after,\n.p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n.p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n}\n.p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n}\n.p-confirm-popup-flipped:after,\n.p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n}\n.p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n}\n.p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent;\n}\n.p-confirm-popup .p-confirm-popup-content {\n display: flex;\n align-items: center;\n}\n"),w.render=function(e,t,i,n,o,r){const s=l("CPButton"),c=l("Portal"),w=a("focustrap");return p(),u(c,null,{default:f((()=>[m(h,{name:"p-confirm-popup",onEnter:r.onEnter,onAfterEnter:r.onAfterEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},{default:f((()=>[o.visible?d((p(),v("div",b({key:0,ref:r.containerRef,role:"alertdialog",class:r.containerClass,"aria-modal":o.visible,onClick:t[2]||(t[2]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>r.onOverlayKeydown&&r.onOverlayKeydown(...e))},e.$attrs),[e.$slots.message?(p(),u(C(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(p(),v("div",A,[L("i",{class:g(r.iconClass)},null,2),L("span",E,y(o.confirmation.message),1)])),L("div",z,[m(s,{label:r.rejectLabel,icon:r.rejectIcon,class:g(r.rejectClass),onClick:t[0]||(t[0]=e=>r.reject()),onKeydown:r.onRejectKeydown,autofocus:o.autoFocusReject},null,8,["label","icon","class","onKeydown","autofocus"]),m(s,{label:r.acceptLabel,icon:r.acceptIcon,class:g(r.acceptClass),onClick:t[1]||(t[1]=e=>r.accept()),onKeydown:r.onAcceptKeydown,autofocus:o.autoFocusAccept},null,8,["label","icon","class","onKeydown","autofocus"])])],16,j)),[[w]]):k("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1})};export{w as default};
|
|
@@ -128,6 +128,9 @@ this.primevue.confirmpopup = (function (Button, ConfirmationEventBus, FocusTrap,
|
|
|
128
128
|
this.focus();
|
|
129
129
|
},
|
|
130
130
|
onLeave() {
|
|
131
|
+
this.autoFocusAccept = null;
|
|
132
|
+
this.autoFocusReject = null;
|
|
133
|
+
|
|
131
134
|
this.unbindOutsideClickListener();
|
|
132
135
|
this.unbindScrollListener();
|
|
133
136
|
this.unbindResizeListener();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.confirmpopup=function(e,t,n,i,o,r,s){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),a=c(t),p=c(n),u=c(i),f=c(o),m={name:"ConfirmPopup",inheritAttrs:!1,props:{group:String},data:()=>({visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.target=e.target,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},a.default.on("confirm",this.confirmListener),a.default.on("close",this.closeListener)},beforeUnmount(){a.default.off("confirm",this.confirmListener),a.default.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(r.ZIndexUtils.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.accept(),r.DomHandler.focus(this.target),e.preventDefault())},onRejectKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.reject(),r.DomHandler.focus(this.target),e.preventDefault())},onEnter(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),r.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter(){this.focus()},onLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave(e){r.ZIndexUtils.clear(e)},alignOverlay(){r.DomHandler.absolutePosition(this.container,this.target);const e=r.DomHandler.getOffset(this.container),t=r.DomHandler.getOffset(this.target);let n=0;e.left<t.left&&(n=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft",`${n}px`),e.top<t.top&&r.DomHandler.addClass(this.container,"p-confirm-popup-flipped")},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.visible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)?(this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1):this.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new r.ConnectedOverlayScrollHandler(this.target,(()=>{this.visible&&(this.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.visible&&!r.DomHandler.isTouchDevice()&&(this.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus(){let e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef(e){this.container=e},onOverlayClick(e){u.default.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown(e){"Escape"===e.code&&(a.default.emit("close",this.closeListener),r.DomHandler.focus(this.target))}},computed:{containerClass(){return["p-confirm-popup p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},message(){return this.confirmation?this.confirmation.message:null},iconClass(){return["p-confirm-popup-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-popup-accept p-button-sm",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-popup-reject p-button-sm",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]}},components:{CPButton:l.default,Portal:f.default},directives:{focustrap:p.default}};const d=["aria-modal"],h={key:0,class:"p-confirm-popup-content"},v={class:"p-confirm-popup-message"},b={class:"p-confirm-popup-footer"};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-confirm-popup {\n position: absolute;\n margin-top: 10px;\n top: 0;\n left: 0;\n}\n.p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n/* Animation */\n.p-confirm-popup-enter-from {\n opacity: 0;\n transform: scaleY(0.8);\n}\n.p-confirm-popup-leave-to {\n opacity: 0;\n}\n.p-confirm-popup-enter-active {\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n.p-confirm-popup-leave-active {\n transition: opacity 0.1s linear;\n}\n.p-confirm-popup:after,\n.p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n.p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n}\n.p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n}\n.p-confirm-popup-flipped:after,\n.p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n}\n.p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n}\n.p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent;\n}\n.p-confirm-popup .p-confirm-popup-content {\n display: flex;\n align-items: center;\n}\n"),m.render=function(e,t,n,i,o,r){const c=s.resolveComponent("CPButton"),l=s.resolveComponent("Portal"),a=s.resolveDirective("focustrap");return s.openBlock(),s.createBlock(l,null,{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-confirm-popup",onEnter:r.onEnter,onAfterEnter:r.onAfterEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},{default:s.withCtx((()=>[o.visible?s.withDirectives((s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:r.containerRef,role:"alertdialog",class:r.containerClass,"aria-modal":o.visible,onClick:t[2]||(t[2]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>r.onOverlayKeydown&&r.onOverlayKeydown(...e))},e.$attrs),[e.$slots.message?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(s.openBlock(),s.createElementBlock("div",h,[s.createElementVNode("i",{class:s.normalizeClass(r.iconClass)},null,2),s.createElementVNode("span",v,s.toDisplayString(o.confirmation.message),1)])),s.createElementVNode("div",b,[s.createVNode(c,{label:r.rejectLabel,icon:r.rejectIcon,class:s.normalizeClass(r.rejectClass),onClick:t[0]||(t[0]=e=>r.reject()),onKeydown:r.onRejectKeydown,autofocus:o.autoFocusReject},null,8,["label","icon","class","onKeydown","autofocus"]),s.createVNode(c,{label:r.acceptLabel,icon:r.acceptIcon,class:s.normalizeClass(r.acceptClass),onClick:t[1]||(t[1]=e=>r.accept()),onKeydown:r.onAcceptKeydown,autofocus:o.autoFocusAccept},null,8,["label","icon","class","onKeydown","autofocus"])])],16,d)),[[a]]):s.createCommentVNode("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1})},m}(primevue.button,primevue.confirmationeventbus,primevue.focustrap,primevue.overlayeventbus,primevue.portal,primevue.utils,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.confirmpopup=function(e,t,n,i,o,r,s){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),a=c(t),p=c(n),u=c(i),f=c(o),m={name:"ConfirmPopup",inheritAttrs:!1,props:{group:String},data:()=>({visible:!1,confirmation:null,autoFocusAccept:null,autoFocusReject:null}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,confirmListener:null,closeListener:null,mounted(){this.confirmListener=e=>{e&&e.group===this.group&&(this.confirmation=e,this.target=e.target,this.confirmation.onShow&&this.confirmation.onShow(),this.visible=!0)},this.closeListener=()=>{this.visible=!1,this.confirmation=null},a.default.on("confirm",this.confirmListener),a.default.on("close",this.closeListener)},beforeUnmount(){a.default.off("confirm",this.confirmListener),a.default.off("close",this.closeListener),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.unbindResizeListener(),this.container&&(r.ZIndexUtils.clear(this.container),this.container=null),this.target=null,this.confirmation=null},methods:{accept(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},onAcceptKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.accept(),r.DomHandler.focus(this.target),e.preventDefault())},onRejectKeydown(e){"Space"!==e.code&&"Enter"!==e.code||(this.reject(),r.DomHandler.focus(this.target),e.preventDefault())},onEnter(e){this.autoFocusAccept=void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus,this.autoFocusReject="reject"===this.confirmation.defaultFocus,this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),r.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay)},onAfterEnter(){this.focus()},onLeave(){this.autoFocusAccept=null,this.autoFocusReject=null,this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener()},onAfterLeave(e){r.ZIndexUtils.clear(e)},alignOverlay(){r.DomHandler.absolutePosition(this.container,this.target);const e=r.DomHandler.getOffset(this.container),t=r.DomHandler.getOffset(this.target);let n=0;e.left<t.left&&(n=t.left-e.left),this.container.style.setProperty("--overlayArrowLeft",`${n}px`),e.top<t.top&&r.DomHandler.addClass(this.container,"p-confirm-popup-flipped")},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.visible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)?(this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1):this.alignOverlay()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new r.ConnectedOverlayScrollHandler(this.target,(()=>{this.visible&&(this.visible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.visible&&!r.DomHandler.isTouchDevice()&&(this.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},focus(){let e=this.container.querySelector("[autofocus]");e&&e.focus({preventScroll:!0})},isTargetClicked(e){return this.target&&(this.target===e.target||this.target.contains(e.target))},containerRef(e){this.container=e},onOverlayClick(e){u.default.emit("overlay-click",{originalEvent:e,target:this.target})},onOverlayKeydown(e){"Escape"===e.code&&(a.default.emit("close",this.closeListener),r.DomHandler.focus(this.target))}},computed:{containerClass(){return["p-confirm-popup p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},message(){return this.confirmation?this.confirmation.message:null},iconClass(){return["p-confirm-popup-icon",this.confirmation?this.confirmation.icon:null]},acceptLabel(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon(){return this.confirmation?this.confirmation.rejectIcon:null},acceptClass(){return["p-confirm-popup-accept p-button-sm",this.confirmation?this.confirmation.acceptClass:null]},rejectClass(){return["p-confirm-popup-reject p-button-sm",this.confirmation?this.confirmation.rejectClass||"p-button-text":null]}},components:{CPButton:l.default,Portal:f.default},directives:{focustrap:p.default}};const d=["aria-modal"],h={key:0,class:"p-confirm-popup-content"},v={class:"p-confirm-popup-message"},b={class:"p-confirm-popup-footer"};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-confirm-popup {\n position: absolute;\n margin-top: 10px;\n top: 0;\n left: 0;\n}\n.p-confirm-popup-flipped {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n/* Animation */\n.p-confirm-popup-enter-from {\n opacity: 0;\n transform: scaleY(0.8);\n}\n.p-confirm-popup-leave-to {\n opacity: 0;\n}\n.p-confirm-popup-enter-active {\n transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);\n}\n.p-confirm-popup-leave-active {\n transition: opacity 0.1s linear;\n}\n.p-confirm-popup:after,\n.p-confirm-popup:before {\n bottom: 100%;\n left: calc(var(--overlayArrowLeft, 0) + 1.25rem);\n content: ' ';\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n.p-confirm-popup:after {\n border-width: 8px;\n margin-left: -8px;\n}\n.p-confirm-popup:before {\n border-width: 10px;\n margin-left: -10px;\n}\n.p-confirm-popup-flipped:after,\n.p-confirm-popup-flipped:before {\n bottom: auto;\n top: 100%;\n}\n.p-confirm-popup.p-confirm-popup-flipped:after {\n border-bottom-color: transparent;\n}\n.p-confirm-popup.p-confirm-popup-flipped:before {\n border-bottom-color: transparent;\n}\n.p-confirm-popup .p-confirm-popup-content {\n display: flex;\n align-items: center;\n}\n"),m.render=function(e,t,n,i,o,r){const c=s.resolveComponent("CPButton"),l=s.resolveComponent("Portal"),a=s.resolveDirective("focustrap");return s.openBlock(),s.createBlock(l,null,{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-confirm-popup",onEnter:r.onEnter,onAfterEnter:r.onAfterEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},{default:s.withCtx((()=>[o.visible?s.withDirectives((s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:r.containerRef,role:"alertdialog",class:r.containerClass,"aria-modal":o.visible,onClick:t[2]||(t[2]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>r.onOverlayKeydown&&r.onOverlayKeydown(...e))},e.$attrs),[e.$slots.message?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.$slots.message),{key:1,message:o.confirmation},null,8,["message"])):(s.openBlock(),s.createElementBlock("div",h,[s.createElementVNode("i",{class:s.normalizeClass(r.iconClass)},null,2),s.createElementVNode("span",v,s.toDisplayString(o.confirmation.message),1)])),s.createElementVNode("div",b,[s.createVNode(c,{label:r.rejectLabel,icon:r.rejectIcon,class:s.normalizeClass(r.rejectClass),onClick:t[0]||(t[0]=e=>r.reject()),onKeydown:r.onRejectKeydown,autofocus:o.autoFocusReject},null,8,["label","icon","class","onKeydown","autofocus"]),s.createVNode(c,{label:r.acceptLabel,icon:r.acceptIcon,class:s.normalizeClass(r.acceptClass),onClick:t[1]||(t[1]=e=>r.accept()),onKeydown:r.onAcceptKeydown,autofocus:o.autoFocusAccept},null,8,["label","icon","class","onKeydown","autofocus"])])],16,d)),[[a]]):s.createCommentVNode("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1})},m}(primevue.button,primevue.confirmationeventbus,primevue.focustrap,primevue.overlayeventbus,primevue.portal,primevue.utils,Vue);
|
package/core/core.js
CHANGED
|
@@ -2276,7 +2276,7 @@ this.primevue.tooltip = (function (utils) {
|
|
|
2276
2276
|
|
|
2277
2277
|
bindEvents(target);
|
|
2278
2278
|
} else if (typeof options.value === 'object' && options.value) {
|
|
2279
|
-
if (utils.ObjectUtils.isEmpty(options.value.value || options.value.value.trim() === '')
|
|
2279
|
+
if (utils.ObjectUtils.isEmpty(options.value.value) || options.value.value.trim() === '') {
|
|
2280
2280
|
unbindEvents(target);
|
|
2281
2281
|
return;
|
|
2282
2282
|
} else {
|
|
@@ -3698,11 +3698,11 @@ this.primevue.inputnumber = (function (Button, InputText, utils, vue) {
|
|
|
3698
3698
|
default: null
|
|
3699
3699
|
},
|
|
3700
3700
|
inputClass: {
|
|
3701
|
-
type: String,
|
|
3701
|
+
type: [String, Object],
|
|
3702
3702
|
default: null
|
|
3703
3703
|
},
|
|
3704
3704
|
inputStyle: {
|
|
3705
|
-
type:
|
|
3705
|
+
type: Object,
|
|
3706
3706
|
default: null
|
|
3707
3707
|
},
|
|
3708
3708
|
inputProps: {
|
|
@@ -5114,11 +5114,11 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
5114
5114
|
default: null
|
|
5115
5115
|
},
|
|
5116
5116
|
inputClass: {
|
|
5117
|
-
type: String,
|
|
5117
|
+
type: [String, Object],
|
|
5118
5118
|
default: null
|
|
5119
5119
|
},
|
|
5120
5120
|
inputStyle: {
|
|
5121
|
-
type:
|
|
5121
|
+
type: Object,
|
|
5122
5122
|
default: null
|
|
5123
5123
|
},
|
|
5124
5124
|
inputProps: {
|
|
@@ -5126,11 +5126,11 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
5126
5126
|
default: null
|
|
5127
5127
|
},
|
|
5128
5128
|
panelClass: {
|
|
5129
|
-
type: String,
|
|
5129
|
+
type: [String, Object],
|
|
5130
5130
|
default: null
|
|
5131
5131
|
},
|
|
5132
5132
|
panelStyle: {
|
|
5133
|
-
type:
|
|
5133
|
+
type: Object,
|
|
5134
5134
|
default: null
|
|
5135
5135
|
},
|
|
5136
5136
|
panelProps: {
|
|
@@ -5729,7 +5729,7 @@ this.primevue.dropdown = (function (api, OverlayEventBus, Portal, Ripple, utils,
|
|
|
5729
5729
|
return this.isValidOption(option) && this.isSelected(option);
|
|
5730
5730
|
},
|
|
5731
5731
|
isSelected(option) {
|
|
5732
|
-
return utils.ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
|
|
5732
|
+
return this.isValidOption(option) && utils.ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
|
|
5733
5733
|
},
|
|
5734
5734
|
findFirstOptionIndex() {
|
|
5735
5735
|
return this.visibleOptions.findIndex((option) => this.isValidOption(option));
|
|
@@ -6426,7 +6426,8 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
6426
6426
|
return {
|
|
6427
6427
|
containerVisible: this.visible,
|
|
6428
6428
|
maximized: false,
|
|
6429
|
-
|
|
6429
|
+
focusableMax: null,
|
|
6430
|
+
focusableClose: null
|
|
6430
6431
|
};
|
|
6431
6432
|
},
|
|
6432
6433
|
documentKeydownListener: null,
|
|
@@ -6489,7 +6490,8 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
6489
6490
|
},
|
|
6490
6491
|
onLeave() {
|
|
6491
6492
|
this.$emit('hide');
|
|
6492
|
-
this.
|
|
6493
|
+
this.focusableClose = null;
|
|
6494
|
+
this.focusableMax = null;
|
|
6493
6495
|
},
|
|
6494
6496
|
onAfterLeave() {
|
|
6495
6497
|
if (this.autoZIndex) {
|
|
@@ -6520,14 +6522,19 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
6520
6522
|
focusTarget = this.$slots.default && findFocusableElement(this.content);
|
|
6521
6523
|
|
|
6522
6524
|
if (!focusTarget) {
|
|
6523
|
-
|
|
6525
|
+
if (this.maximizable) {
|
|
6526
|
+
this.focusableMax = true;
|
|
6527
|
+
focusTarget = this.maximizableButton;
|
|
6528
|
+
} else {
|
|
6529
|
+
this.focusableClose = true;
|
|
6530
|
+
focusTarget = this.closeButton;
|
|
6531
|
+
}
|
|
6524
6532
|
}
|
|
6525
6533
|
}
|
|
6526
6534
|
}
|
|
6527
6535
|
|
|
6528
6536
|
if (focusTarget) {
|
|
6529
|
-
|
|
6530
|
-
focusTarget.focus();
|
|
6537
|
+
utils.DomHandler.focus(focusTarget);
|
|
6531
6538
|
}
|
|
6532
6539
|
},
|
|
6533
6540
|
maximize(event) {
|
|
@@ -6823,7 +6830,7 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
6823
6830
|
? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
|
|
6824
6831
|
key: 0,
|
|
6825
6832
|
ref: $options.maximizableRef,
|
|
6826
|
-
autofocus: $data.
|
|
6833
|
+
autofocus: $data.focusableMax,
|
|
6827
6834
|
class: "p-dialog-header-icon p-dialog-header-maximize p-link",
|
|
6828
6835
|
onClick: _cache[0] || (_cache[0] = (...args) => ($options.maximize && $options.maximize(...args))),
|
|
6829
6836
|
type: "button",
|
|
@@ -6840,7 +6847,7 @@ this.primevue.dialog = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
6840
6847
|
? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
|
|
6841
6848
|
key: 1,
|
|
6842
6849
|
ref: $options.closeButtonRef,
|
|
6843
|
-
autofocus: $data.
|
|
6850
|
+
autofocus: $data.focusableClose,
|
|
6844
6851
|
class: "p-dialog-header-icon p-dialog-header-close p-link",
|
|
6845
6852
|
onClick: _cache[1] || (_cache[1] = (...args) => ($options.close && $options.close(...args))),
|
|
6846
6853
|
"aria-label": $options.closeAriaLabel,
|