primevue 3.22.0 → 3.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/core/core.js +15 -12
  2. package/core/core.min.js +2 -2
  3. package/divider/Divider.vue +1 -1
  4. package/divider/divider.cjs.js +1 -1
  5. package/divider/divider.cjs.min.js +1 -1
  6. package/divider/divider.esm.js +1 -1
  7. package/divider/divider.esm.min.js +1 -1
  8. package/divider/divider.js +1 -1
  9. package/divider/divider.min.js +1 -1
  10. package/menu/Menu.vue +1 -1
  11. package/menu/menu.cjs.js +1 -1
  12. package/menu/menu.cjs.min.js +1 -1
  13. package/menu/menu.esm.js +1 -1
  14. package/menu/menu.esm.min.js +1 -1
  15. package/menu/menu.js +1 -1
  16. package/menu/menu.min.js +1 -1
  17. package/package.json +1 -1
  18. package/paginator/JumpToPageInput.vue +11 -8
  19. package/paginator/Paginator.vue +1 -1
  20. package/paginator/paginator.cjs.js +14 -11
  21. package/paginator/paginator.cjs.min.js +1 -1
  22. package/paginator/paginator.esm.js +14 -11
  23. package/paginator/paginator.esm.min.js +1 -1
  24. package/paginator/paginator.js +14 -11
  25. package/paginator/paginator.min.js +1 -1
  26. package/rating/Rating.vue +1 -0
  27. package/rating/rating.cjs.js +1 -1
  28. package/rating/rating.cjs.min.js +1 -1
  29. package/rating/rating.esm.js +1 -1
  30. package/rating/rating.esm.min.js +1 -1
  31. package/rating/rating.js +1 -1
  32. package/rating/rating.min.js +1 -1
  33. package/resources/primevue.css +1 -0
  34. package/resources/primevue.min.css +1 -1
  35. package/sidebar/Sidebar.vue +61 -51
  36. package/sidebar/sidebar.cjs.js +124 -103
  37. package/sidebar/sidebar.cjs.min.js +1 -1
  38. package/sidebar/sidebar.esm.js +125 -104
  39. package/sidebar/sidebar.esm.min.js +1 -1
  40. package/sidebar/sidebar.js +124 -103
  41. package/sidebar/sidebar.min.js +1 -1
  42. package/web-types.json +1 -1
@@ -14,7 +14,8 @@ var Ripple__default = /*#__PURE__*/_interopDefaultLegacy(Ripple);
14
14
 
15
15
  var script = {
16
16
  name: 'Sidebar',
17
- emits: ['update:visible', 'show', 'hide'],
17
+ inheritAttrs: false,
18
+ emits: ['update:visible', 'show', 'hide', 'after-hide'],
18
19
  props: {
19
20
  visible: {
20
21
  type: Boolean,
@@ -50,67 +51,70 @@ var script = {
50
51
  },
51
52
  blockScroll: {
52
53
  type: Boolean,
53
- default: true
54
+ default: false
54
55
  }
55
56
  },
57
+ data() {
58
+ return {
59
+ containerVisible: this.visible
60
+ };
61
+ },
56
62
  container: null,
63
+ mask: null,
57
64
  content: null,
58
65
  headerContainer: null,
59
66
  closeButton: null,
60
67
  outsideClickListener: null,
61
- data() {
62
- return {
63
- maskVisible: false
64
- };
65
- },
66
- watch: {
67
- visible(newValue) {
68
- this.maskVisible = newValue ? newValue : this.maskVisible;
68
+ updated() {
69
+ if (this.visible) {
70
+ this.containerVisible = this.visible;
69
71
  }
70
72
  },
71
73
  beforeUnmount() {
72
- if (this.container && this.autoZIndex) {
73
- utils.ZIndexUtils.clear(this.container);
74
+ this.disableDocumentSettings();
75
+
76
+ if (this.mask && this.autoZIndex) {
77
+ utils.ZIndexUtils.clear(this.mask);
74
78
  }
75
79
 
76
- this.unbindOutsideClickListener();
77
80
  this.container = null;
81
+ this.mask = null;
78
82
  },
79
83
  methods: {
80
84
  hide() {
81
85
  this.$emit('update:visible', false);
82
-
83
- this.unbindOutsideClickListener();
84
- this.blockScroll && utils.DomHandler.removeClass(document.body, 'p-overflow-hidden');
85
86
  },
86
87
  onEnter() {
87
88
  this.$emit('show');
89
+ this.focus();
88
90
 
89
91
  if (this.autoZIndex) {
90
- utils.ZIndexUtils.set('modal', this.$refs.mask, this.baseZIndex || this.$primevue.config.zIndex.modal);
92
+ utils.ZIndexUtils.set('modal', this.mask, this.baseZIndex || this.$primevue.config.zIndex.modal);
93
+ }
94
+ },
95
+ onAfterEnter() {
96
+ this.enableDocumentSettings();
97
+ },
98
+ onBeforeLeave() {
99
+ if (this.modal) {
100
+ utils.DomHandler.addClass(this.mask, 'p-component-overlay-leave');
91
101
  }
92
-
93
- this.maskVisible = true;
94
- this.focus();
95
102
  },
96
103
  onLeave() {
97
- utils.DomHandler.addClass(this.$refs.mask, 'p-component-overlay-leave');
98
-
99
104
  this.$emit('hide');
100
- this.unbindOutsideClickListener();
101
105
  },
102
106
  onAfterLeave() {
103
107
  if (this.autoZIndex) {
104
108
  utils.ZIndexUtils.clear(this.mask);
105
109
  }
106
110
 
107
- this.maskVisible = false;
111
+ this.containerVisible = false;
112
+ this.disableDocumentSettings();
113
+ this.$emit('after-hide');
108
114
  },
109
- onAfterEnter() {
110
- this.bindOutsideClickListener();
111
-
112
- if (this.blockScroll) {
113
- utils.DomHandler.addClass(document.body, 'p-overflow-hidden');
115
+ onMaskClick(event) {
116
+ if (this.dismissable && this.modal && this.mask === event.target) {
117
+ this.hide();
114
118
  }
115
119
  },
116
120
  focus() {
@@ -130,19 +134,33 @@ var script = {
130
134
 
131
135
  focusTarget && focusTarget.focus();
132
136
  },
133
- onKeydown(event) {
134
- if (event.code === 'Escape') {
135
- this.hide();
137
+ enableDocumentSettings() {
138
+ if (this.dismissable && !this.modal) {
139
+ this.bindOutsideClickListener();
140
+ }
141
+
142
+ if (this.blockScroll) {
143
+ utils.DomHandler.addClass(document.body, 'p-overflow-hidden');
136
144
  }
137
145
  },
138
- onMaskClick(event) {
139
- if (this.dismissable && this.modal && this.$refs.mask === event.target) {
146
+ disableDocumentSettings() {
147
+ this.unbindOutsideClickListener();
148
+
149
+ if (this.blockScroll) {
150
+ utils.DomHandler.removeClass(document.body, 'p-overflow-hidden');
151
+ }
152
+ },
153
+ onKeydown(event) {
154
+ if (event.code === 'Escape') {
140
155
  this.hide();
141
156
  }
142
157
  },
143
158
  containerRef(el) {
144
159
  this.container = el;
145
160
  },
161
+ maskRef(el) {
162
+ this.mask = el;
163
+ },
146
164
  contentRef(el) {
147
165
  this.content = el;
148
166
  },
@@ -161,7 +179,7 @@ var script = {
161
179
  bindOutsideClickListener() {
162
180
  if (!this.outsideClickListener) {
163
181
  this.outsideClickListener = (event) => {
164
- if (!this.modal && this.isOutsideClicked(event) && this.dismissable) {
182
+ if (this.isOutsideClicked(event)) {
165
183
  this.hide();
166
184
  }
167
185
  };
@@ -196,14 +214,14 @@ var script = {
196
214
  closeAriaLabel() {
197
215
  return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
198
216
  },
199
- maskClasses() {
217
+ maskClass() {
200
218
  return [
201
219
  'p-sidebar-mask',
202
220
  this.getPositionClass(),
203
221
  {
204
222
  'p-component-overlay p-component-overlay-enter': this.modal,
205
223
  'p-sidebar-mask-scrollblocker': this.blockScroll,
206
- 'p-sidebar-visible': this.maskVisible,
224
+ 'p-sidebar-visible': this.containerVisible,
207
225
  'p-sidebar-full': this.fullScreen
208
226
  }
209
227
  ];
@@ -232,71 +250,74 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
232
250
 
233
251
  return (vue.openBlock(), vue.createBlock(_component_Portal, null, {
234
252
  default: vue.withCtx(() => [
235
- vue.createElementVNode("div", {
236
- ref: "mask",
237
- style: {},
238
- class: vue.normalizeClass($options.maskClasses),
239
- onMousedown: _cache[2] || (_cache[2] = (...args) => ($options.onMaskClick && $options.onMaskClick(...args)))
240
- }, [
241
- vue.createVNode(vue.Transition, {
242
- name: "p-sidebar",
243
- onAfterEnter: $options.onAfterEnter,
244
- onEnter: $options.onEnter,
245
- onLeave: $options.onLeave,
246
- onAfterLeave: $options.onAfterLeave,
247
- appear: ""
248
- }, {
249
- default: vue.withCtx(() => [
250
- ($props.visible)
251
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
252
- key: 0,
253
- ref: $options.containerRef,
254
- class: $options.containerClass,
255
- role: "complementary",
256
- "aria-modal": $props.modal,
257
- onKeydown: _cache[1] || (_cache[1] = (...args) => ($options.onKeydown && $options.onKeydown(...args)))
258
- }, _ctx.$attrs), [
259
- vue.createElementVNode("div", {
260
- ref: $options.headerContainerRef,
261
- class: "p-sidebar-header"
262
- }, [
263
- (_ctx.$slots.header)
264
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
265
- vue.renderSlot(_ctx.$slots, "header")
266
- ]))
267
- : vue.createCommentVNode("", true),
268
- ($props.showCloseIcon)
269
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
270
- key: 1,
271
- ref: $options.closeButtonRef,
272
- autofocus: "",
273
- type: "button",
274
- class: "p-sidebar-close p-sidebar-icon p-link",
275
- "aria-label": $options.closeAriaLabel,
276
- onClick: _cache[0] || (_cache[0] = (...args) => ($options.hide && $options.hide(...args)))
277
- }, [
278
- vue.createElementVNode("span", {
279
- class: vue.normalizeClass(['p-sidebar-close-icon', $props.closeIcon])
280
- }, null, 2)
281
- ], 8, _hoisted_3)), [
282
- [_directive_ripple]
283
- ])
284
- : vue.createCommentVNode("", true)
285
- ], 512),
286
- vue.createElementVNode("div", {
287
- ref: $options.contentRef,
288
- class: "p-sidebar-content"
289
- }, [
290
- vue.renderSlot(_ctx.$slots, "default")
291
- ], 512)
292
- ], 16, _hoisted_1)), [
293
- [_directive_focustrap]
294
- ])
295
- : vue.createCommentVNode("", true)
296
- ]),
297
- _: 3
298
- }, 8, ["onAfterEnter", "onEnter", "onLeave", "onAfterLeave"])
299
- ], 34)
253
+ ($data.containerVisible)
254
+ ? (vue.openBlock(), vue.createElementBlock("div", {
255
+ key: 0,
256
+ ref: $options.maskRef,
257
+ class: vue.normalizeClass($options.maskClass),
258
+ onMousedown: _cache[2] || (_cache[2] = (...args) => ($options.onMaskClick && $options.onMaskClick(...args)))
259
+ }, [
260
+ vue.createVNode(vue.Transition, {
261
+ name: "p-sidebar",
262
+ onEnter: $options.onEnter,
263
+ onAfterEnter: $options.onAfterEnter,
264
+ onBeforeLeave: $options.onBeforeLeave,
265
+ onLeave: $options.onLeave,
266
+ onAfterLeave: $options.onAfterLeave,
267
+ appear: ""
268
+ }, {
269
+ default: vue.withCtx(() => [
270
+ ($props.visible)
271
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
272
+ key: 0,
273
+ ref: $options.containerRef,
274
+ class: $options.containerClass,
275
+ role: "complementary",
276
+ "aria-modal": $props.modal,
277
+ onKeydown: _cache[1] || (_cache[1] = (...args) => ($options.onKeydown && $options.onKeydown(...args)))
278
+ }, _ctx.$attrs), [
279
+ vue.createElementVNode("div", {
280
+ ref: $options.headerContainerRef,
281
+ class: "p-sidebar-header"
282
+ }, [
283
+ (_ctx.$slots.header)
284
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
285
+ vue.renderSlot(_ctx.$slots, "header")
286
+ ]))
287
+ : vue.createCommentVNode("", true),
288
+ ($props.showCloseIcon)
289
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
290
+ key: 1,
291
+ ref: $options.closeButtonRef,
292
+ autofocus: "",
293
+ type: "button",
294
+ class: "p-sidebar-close p-sidebar-icon p-link",
295
+ "aria-label": $options.closeAriaLabel,
296
+ onClick: _cache[0] || (_cache[0] = (...args) => ($options.hide && $options.hide(...args)))
297
+ }, [
298
+ vue.createElementVNode("span", {
299
+ class: vue.normalizeClass(['p-sidebar-close-icon', $props.closeIcon])
300
+ }, null, 2)
301
+ ], 8, _hoisted_3)), [
302
+ [_directive_ripple]
303
+ ])
304
+ : vue.createCommentVNode("", true)
305
+ ], 512),
306
+ vue.createElementVNode("div", {
307
+ ref: $options.contentRef,
308
+ class: "p-sidebar-content"
309
+ }, [
310
+ vue.renderSlot(_ctx.$slots, "default")
311
+ ], 512)
312
+ ], 16, _hoisted_1)), [
313
+ [_directive_focustrap]
314
+ ])
315
+ : vue.createCommentVNode("", true)
316
+ ]),
317
+ _: 3
318
+ }, 8, ["onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])
319
+ ], 34))
320
+ : vue.createCommentVNode("", true)
300
321
  ]),
301
322
  _: 3
302
323
  }))
@@ -329,7 +350,7 @@ function styleInject(css, ref) {
329
350
  }
330
351
  }
331
352
 
332
- var css_248z = "\n.p-sidebar-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n.p-sidebar-visible {\n display: flex;\n}\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Position */\n.p-sidebar-left {\n justify-content: flex-start;\n}\n.p-sidebar-right {\n justify-content: flex-end;\n}\n.p-sidebar-top {\n align-items: flex-start;\n}\n.p-sidebar-bottom {\n align-items: flex-end;\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n.p-sidebar-left .p-sidebar-view,\n.p-sidebar-right .p-sidebar-view,\n.p-sidebar-top .p-sidebar-view,\n.p-sidebar-bottom .p-sidebar-view {\n width: 100%;\n height: 100%;\n}\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n@media screen and (max-width: 64em) {\n.p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n}\n}\n";
353
+ var css_248z = "\n.p-sidebar-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-sidebar-visible {\n display: flex;\n}\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Position */\n.p-sidebar-left {\n justify-content: flex-start;\n}\n.p-sidebar-right {\n justify-content: flex-end;\n}\n.p-sidebar-top {\n align-items: flex-start;\n}\n.p-sidebar-bottom {\n align-items: flex-end;\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n@media screen and (max-width: 64em) {\n.p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n}\n}\n";
333
354
  styleInject(css_248z);
334
355
 
335
356
  script.render = render;
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/focustrap"),t=require("primevue/portal"),n=require("primevue/ripple"),i=require("primevue/utils"),s=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(e),o=r(t),l=r(n),d={name:"Sidebar",emits:["update:visible","show","hide"],props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:"pi pi-times"},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0}},container:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,data:()=>({maskVisible:!1}),watch:{visible(e){this.maskVisible=e||this.maskVisible}},beforeUnmount(){this.container&&this.autoZIndex&&i.ZIndexUtils.clear(this.container),this.unbindOutsideClickListener(),this.container=null},methods:{hide(){this.$emit("update:visible",!1),this.unbindOutsideClickListener(),this.blockScroll&&i.DomHandler.removeClass(document.body,"p-overflow-hidden")},onEnter(){this.$emit("show"),this.autoZIndex&&i.ZIndexUtils.set("modal",this.$refs.mask,this.baseZIndex||this.$primevue.config.zIndex.modal),this.maskVisible=!0,this.focus()},onLeave(){i.DomHandler.addClass(this.$refs.mask,"p-component-overlay-leave"),this.$emit("hide"),this.unbindOutsideClickListener()},onAfterLeave(){this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.maskVisible=!1},onAfterEnter(){this.bindOutsideClickListener(),this.blockScroll&&i.DomHandler.addClass(document.body,"p-overflow-hidden")},focus(){const e=e=>e.querySelector("[autofocus]");let t=this.$slots.default&&e(this.content);t||(t=this.$slots.header&&e(this.headerContainer),t||(t=e(this.container))),t&&t.focus()},onKeydown(e){"Escape"===e.code&&this.hide()},onMaskClick(e){this.dismissable&&this.modal&&this.$refs.mask===e.target&&this.hide()},containerRef(e){this.container=e},contentRef(e){this.content=e},headerContainerRef(e){this.headerContainer=e},closeButtonRef(e){this.closeButton=e},getPositionClass(){const e=["left","right","top","bottom"].find((e=>e===this.position));return e?`p-sidebar-${e}`:""},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{!this.modal&&this.isOutsideClicked(e)&&this.dismissable&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked(e){return this.container&&!this.container.contains(e.target)}},computed:{containerClass(){return["p-sidebar p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple,"p-sidebar-full":this.fullScreen}]},fullScreen(){return"full"===this.position},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},maskClasses(){return["p-sidebar-mask",this.getPositionClass(),{"p-component-overlay p-component-overlay-enter":this.modal,"p-sidebar-mask-scrollblocker":this.blockScroll,"p-sidebar-visible":this.maskVisible,"p-sidebar-full":this.fullScreen}]}},directives:{focustrap:a.default,ripple:l.default},components:{Portal:o.default}};const p=["aria-modal"],c={key:0,class:"p-sidebar-header-content"},b=["aria-label"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-sidebar-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n.p-sidebar-visible {\n display: flex;\n}\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Position */\n.p-sidebar-left {\n justify-content: flex-start;\n}\n.p-sidebar-right {\n justify-content: flex-end;\n}\n.p-sidebar-top {\n align-items: flex-start;\n}\n.p-sidebar-bottom {\n align-items: flex-end;\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n.p-sidebar-left .p-sidebar-view,\n.p-sidebar-right .p-sidebar-view,\n.p-sidebar-top .p-sidebar-view,\n.p-sidebar-bottom .p-sidebar-view {\n width: 100%;\n height: 100%;\n}\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n@media screen and (max-width: 64em) {\n.p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n}\n}\n"),d.render=function(e,t,n,i,r,a){const o=s.resolveComponent("Portal"),l=s.resolveDirective("ripple"),d=s.resolveDirective("focustrap");return s.openBlock(),s.createBlock(o,null,{default:s.withCtx((()=>[s.createElementVNode("div",{ref:"mask",style:{},class:s.normalizeClass(a.maskClasses),onMousedown:t[2]||(t[2]=(...e)=>a.onMaskClick&&a.onMaskClick(...e))},[s.createVNode(s.Transition,{name:"p-sidebar",onAfterEnter:a.onAfterEnter,onEnter:a.onEnter,onLeave:a.onLeave,onAfterLeave:a.onAfterLeave,appear:""},{default:s.withCtx((()=>[n.visible?s.withDirectives((s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:a.containerRef,class:a.containerClass,role:"complementary","aria-modal":n.modal,onKeydown:t[1]||(t[1]=(...e)=>a.onKeydown&&a.onKeydown(...e))},e.$attrs),[s.createElementVNode("div",{ref:a.headerContainerRef,class:"p-sidebar-header"},[e.$slots.header?(s.openBlock(),s.createElementBlock("div",c,[s.renderSlot(e.$slots,"header")])):s.createCommentVNode("",!0),n.showCloseIcon?s.withDirectives((s.openBlock(),s.createElementBlock("button",{key:1,ref:a.closeButtonRef,autofocus:"",type:"button",class:"p-sidebar-close p-sidebar-icon p-link","aria-label":a.closeAriaLabel,onClick:t[0]||(t[0]=(...e)=>a.hide&&a.hide(...e))},[s.createElementVNode("span",{class:s.normalizeClass(["p-sidebar-close-icon",n.closeIcon])},null,2)],8,b)),[[l]]):s.createCommentVNode("",!0)],512),s.createElementVNode("div",{ref:a.contentRef,class:"p-sidebar-content"},[s.renderSlot(e.$slots,"default")],512)],16,p)),[[d]]):s.createCommentVNode("",!0)])),_:3},8,["onAfterEnter","onEnter","onLeave","onAfterLeave"])],34)])),_:3})},module.exports=d;
1
+ "use strict";var e=require("primevue/focustrap"),t=require("primevue/portal"),n=require("primevue/ripple"),i=require("primevue/utils"),s=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e),a=r(t),l=r(n),d={name:"Sidebar",inheritAttrs:!1,emits:["update:visible","show","hide","after-hide"],props:{visible:{type:Boolean,default:!1},position:{type:String,default:"left"},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},dismissable:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},closeIcon:{type:String,default:"pi pi-times"},modal:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!1}},data(){return{containerVisible:this.visible}},container:null,mask:null,content:null,headerContainer:null,closeButton:null,outsideClickListener:null,updated(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.disableDocumentSettings(),this.mask&&this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},methods:{hide(){this.$emit("update:visible",!1)},onEnter(){this.$emit("show"),this.focus(),this.autoZIndex&&i.ZIndexUtils.set("modal",this.mask,this.baseZIndex||this.$primevue.config.zIndex.modal)},onAfterEnter(){this.enableDocumentSettings()},onBeforeLeave(){this.modal&&i.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide")},onAfterLeave(){this.autoZIndex&&i.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.disableDocumentSettings(),this.$emit("after-hide")},onMaskClick(e){this.dismissable&&this.modal&&this.mask===e.target&&this.hide()},focus(){const e=e=>e.querySelector("[autofocus]");let t=this.$slots.default&&e(this.content);t||(t=this.$slots.header&&e(this.headerContainer),t||(t=e(this.container))),t&&t.focus()},enableDocumentSettings(){this.dismissable&&!this.modal&&this.bindOutsideClickListener(),this.blockScroll&&i.DomHandler.addClass(document.body,"p-overflow-hidden")},disableDocumentSettings(){this.unbindOutsideClickListener(),this.blockScroll&&i.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeydown(e){"Escape"===e.code&&this.hide()},containerRef(e){this.container=e},maskRef(e){this.mask=e},contentRef(e){this.content=e},headerContainerRef(e){this.headerContainer=e},closeButtonRef(e){this.closeButton=e},getPositionClass(){const e=["left","right","top","bottom"].find((e=>e===this.position));return e?`p-sidebar-${e}`:""},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},isOutsideClicked(e){return this.container&&!this.container.contains(e.target)}},computed:{containerClass(){return["p-sidebar p-component",{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple,"p-sidebar-full":this.fullScreen}]},fullScreen(){return"full"===this.position},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},maskClass(){return["p-sidebar-mask",this.getPositionClass(),{"p-component-overlay p-component-overlay-enter":this.modal,"p-sidebar-mask-scrollblocker":this.blockScroll,"p-sidebar-visible":this.containerVisible,"p-sidebar-full":this.fullScreen}]}},directives:{focustrap:o.default,ripple:l.default},components:{Portal:a.default}};const p=["aria-modal"],c={key:0,class:"p-sidebar-header-content"},m=["aria-label"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-sidebar-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n background-color: transparent;\n transition-property: background-color;\n}\n.p-sidebar-mask.p-component-overlay {\n pointer-events: auto;\n}\n.p-sidebar-visible {\n display: flex;\n}\n.p-sidebar {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n}\n.p-sidebar-content {\n overflow-y: auto;\n flex-grow: 1;\n}\n.p-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n.p-sidebar-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n.p-sidebar-full .p-sidebar {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n}\n\n/* Animation */\n/* Center */\n.p-sidebar-left .p-sidebar-enter-from,\n.p-sidebar-left .p-sidebar-leave-to {\n transform: translateX(-100%);\n}\n.p-sidebar-right .p-sidebar-enter-from,\n.p-sidebar-right .p-sidebar-leave-to {\n transform: translateX(100%);\n}\n.p-sidebar-top .p-sidebar-enter-from,\n.p-sidebar-top .p-sidebar-leave-to {\n transform: translateY(-100%);\n}\n.p-sidebar-bottom .p-sidebar-enter-from,\n.p-sidebar-bottom .p-sidebar-leave-to {\n transform: translateY(100%);\n}\n.p-sidebar-full .p-sidebar-enter-from,\n.p-sidebar-full .p-sidebar-leave-to {\n opacity: 0;\n}\n.p-sidebar-full .p-sidebar-enter-active,\n.p-sidebar-full .p-sidebar-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n/* Position */\n.p-sidebar-left {\n justify-content: flex-start;\n}\n.p-sidebar-right {\n justify-content: flex-end;\n}\n.p-sidebar-top {\n align-items: flex-start;\n}\n.p-sidebar-bottom {\n align-items: flex-end;\n}\n\n/* Size */\n.p-sidebar-left .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n.p-sidebar-right .p-sidebar {\n width: 20rem;\n height: 100%;\n}\n.p-sidebar-top .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n.p-sidebar-bottom .p-sidebar {\n height: 10rem;\n width: 100%;\n}\n.p-sidebar-left .p-sidebar-sm,\n.p-sidebar-right .p-sidebar-sm {\n width: 20rem;\n}\n.p-sidebar-left .p-sidebar-md,\n.p-sidebar-right .p-sidebar-md {\n width: 40rem;\n}\n.p-sidebar-left .p-sidebar-lg,\n.p-sidebar-right .p-sidebar-lg {\n width: 60rem;\n}\n.p-sidebar-top .p-sidebar-sm,\n.p-sidebar-bottom .p-sidebar-sm {\n height: 10rem;\n}\n.p-sidebar-top .p-sidebar-md,\n.p-sidebar-bottom .p-sidebar-md {\n height: 20rem;\n}\n.p-sidebar-top .p-sidebar-lg,\n.p-sidebar-bottom .p-sidebar-lg {\n height: 30rem;\n}\n.p-sidebar-left .p-sidebar-content,\n.p-sidebar-right .p-sidebar-content,\n.p-sidebar-top .p-sidebar-content,\n.p-sidebar-bottom .p-sidebar-content {\n width: 100%;\n height: 100%;\n}\n@media screen and (max-width: 64em) {\n.p-sidebar-left .p-sidebar-lg,\n .p-sidebar-left .p-sidebar-md,\n .p-sidebar-right .p-sidebar-lg,\n .p-sidebar-right .p-sidebar-md {\n width: 20rem;\n}\n}\n"),d.render=function(e,t,n,i,r,o){const a=s.resolveComponent("Portal"),l=s.resolveDirective("ripple"),d=s.resolveDirective("focustrap");return s.openBlock(),s.createBlock(a,null,{default:s.withCtx((()=>[r.containerVisible?(s.openBlock(),s.createElementBlock("div",{key:0,ref:o.maskRef,class:s.normalizeClass(o.maskClass),onMousedown:t[2]||(t[2]=(...e)=>o.onMaskClick&&o.onMaskClick(...e))},[s.createVNode(s.Transition,{name:"p-sidebar",onEnter:o.onEnter,onAfterEnter:o.onAfterEnter,onBeforeLeave:o.onBeforeLeave,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave,appear:""},{default:s.withCtx((()=>[n.visible?s.withDirectives((s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:o.containerRef,class:o.containerClass,role:"complementary","aria-modal":n.modal,onKeydown:t[1]||(t[1]=(...e)=>o.onKeydown&&o.onKeydown(...e))},e.$attrs),[s.createElementVNode("div",{ref:o.headerContainerRef,class:"p-sidebar-header"},[e.$slots.header?(s.openBlock(),s.createElementBlock("div",c,[s.renderSlot(e.$slots,"header")])):s.createCommentVNode("",!0),n.showCloseIcon?s.withDirectives((s.openBlock(),s.createElementBlock("button",{key:1,ref:o.closeButtonRef,autofocus:"",type:"button",class:"p-sidebar-close p-sidebar-icon p-link","aria-label":o.closeAriaLabel,onClick:t[0]||(t[0]=(...e)=>o.hide&&o.hide(...e))},[s.createElementVNode("span",{class:s.normalizeClass(["p-sidebar-close-icon",n.closeIcon])},null,2)],8,m)),[[l]]):s.createCommentVNode("",!0)],512),s.createElementVNode("div",{ref:o.contentRef,class:"p-sidebar-content"},[s.renderSlot(e.$slots,"default")],512)],16,p)),[[d]]):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],34)):s.createCommentVNode("",!0)])),_:3})},module.exports=d;