primevue 3.22.1 → 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 +60 -51
  36. package/sidebar/sidebar.cjs.js +123 -103
  37. package/sidebar/sidebar.cjs.min.js +1 -1
  38. package/sidebar/sidebar.esm.js +124 -104
  39. package/sidebar/sidebar.esm.min.js +1 -1
  40. package/sidebar/sidebar.js +123 -103
  41. package/sidebar/sidebar.min.js +1 -1
  42. package/web-types.json +1 -1
@@ -15,7 +15,7 @@ var Ripple__default = /*#__PURE__*/_interopDefaultLegacy(Ripple);
15
15
  var script = {
16
16
  name: 'Sidebar',
17
17
  inheritAttrs: false,
18
- emits: ['update:visible', 'show', 'hide'],
18
+ emits: ['update:visible', 'show', 'hide', 'after-hide'],
19
19
  props: {
20
20
  visible: {
21
21
  type: Boolean,
@@ -51,67 +51,70 @@ var script = {
51
51
  },
52
52
  blockScroll: {
53
53
  type: Boolean,
54
- default: true
54
+ default: false
55
55
  }
56
56
  },
57
+ data() {
58
+ return {
59
+ containerVisible: this.visible
60
+ };
61
+ },
57
62
  container: null,
63
+ mask: null,
58
64
  content: null,
59
65
  headerContainer: null,
60
66
  closeButton: null,
61
67
  outsideClickListener: null,
62
- data() {
63
- return {
64
- maskVisible: false
65
- };
66
- },
67
- watch: {
68
- visible(newValue) {
69
- this.maskVisible = newValue ? newValue : this.maskVisible;
68
+ updated() {
69
+ if (this.visible) {
70
+ this.containerVisible = this.visible;
70
71
  }
71
72
  },
72
73
  beforeUnmount() {
73
- if (this.container && this.autoZIndex) {
74
- utils.ZIndexUtils.clear(this.container);
74
+ this.disableDocumentSettings();
75
+
76
+ if (this.mask && this.autoZIndex) {
77
+ utils.ZIndexUtils.clear(this.mask);
75
78
  }
76
79
 
77
- this.unbindOutsideClickListener();
78
80
  this.container = null;
81
+ this.mask = null;
79
82
  },
80
83
  methods: {
81
84
  hide() {
82
85
  this.$emit('update:visible', false);
83
-
84
- this.unbindOutsideClickListener();
85
- this.blockScroll && utils.DomHandler.removeClass(document.body, 'p-overflow-hidden');
86
86
  },
87
87
  onEnter() {
88
88
  this.$emit('show');
89
+ this.focus();
89
90
 
90
91
  if (this.autoZIndex) {
91
- 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');
92
101
  }
93
-
94
- this.maskVisible = true;
95
- this.focus();
96
102
  },
97
103
  onLeave() {
98
- utils.DomHandler.addClass(this.$refs.mask, 'p-component-overlay-leave');
99
-
100
104
  this.$emit('hide');
101
- this.unbindOutsideClickListener();
102
105
  },
103
106
  onAfterLeave() {
104
107
  if (this.autoZIndex) {
105
108
  utils.ZIndexUtils.clear(this.mask);
106
109
  }
107
110
 
108
- this.maskVisible = false;
111
+ this.containerVisible = false;
112
+ this.disableDocumentSettings();
113
+ this.$emit('after-hide');
109
114
  },
110
- onAfterEnter() {
111
- this.bindOutsideClickListener();
112
-
113
- if (this.blockScroll) {
114
- utils.DomHandler.addClass(document.body, 'p-overflow-hidden');
115
+ onMaskClick(event) {
116
+ if (this.dismissable && this.modal && this.mask === event.target) {
117
+ this.hide();
115
118
  }
116
119
  },
117
120
  focus() {
@@ -131,19 +134,33 @@ var script = {
131
134
 
132
135
  focusTarget && focusTarget.focus();
133
136
  },
134
- onKeydown(event) {
135
- if (event.code === 'Escape') {
136
- 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');
137
144
  }
138
145
  },
139
- onMaskClick(event) {
140
- 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') {
141
155
  this.hide();
142
156
  }
143
157
  },
144
158
  containerRef(el) {
145
159
  this.container = el;
146
160
  },
161
+ maskRef(el) {
162
+ this.mask = el;
163
+ },
147
164
  contentRef(el) {
148
165
  this.content = el;
149
166
  },
@@ -162,7 +179,7 @@ var script = {
162
179
  bindOutsideClickListener() {
163
180
  if (!this.outsideClickListener) {
164
181
  this.outsideClickListener = (event) => {
165
- if (!this.modal && this.isOutsideClicked(event) && this.dismissable) {
182
+ if (this.isOutsideClicked(event)) {
166
183
  this.hide();
167
184
  }
168
185
  };
@@ -197,14 +214,14 @@ var script = {
197
214
  closeAriaLabel() {
198
215
  return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
199
216
  },
200
- maskClasses() {
217
+ maskClass() {
201
218
  return [
202
219
  'p-sidebar-mask',
203
220
  this.getPositionClass(),
204
221
  {
205
222
  'p-component-overlay p-component-overlay-enter': this.modal,
206
223
  'p-sidebar-mask-scrollblocker': this.blockScroll,
207
- 'p-sidebar-visible': this.maskVisible,
224
+ 'p-sidebar-visible': this.containerVisible,
208
225
  'p-sidebar-full': this.fullScreen
209
226
  }
210
227
  ];
@@ -233,71 +250,74 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
233
250
 
234
251
  return (vue.openBlock(), vue.createBlock(_component_Portal, null, {
235
252
  default: vue.withCtx(() => [
236
- vue.createElementVNode("div", {
237
- ref: "mask",
238
- style: {},
239
- class: vue.normalizeClass($options.maskClasses),
240
- onMousedown: _cache[2] || (_cache[2] = (...args) => ($options.onMaskClick && $options.onMaskClick(...args)))
241
- }, [
242
- vue.createVNode(vue.Transition, {
243
- name: "p-sidebar",
244
- onAfterEnter: $options.onAfterEnter,
245
- onEnter: $options.onEnter,
246
- onLeave: $options.onLeave,
247
- onAfterLeave: $options.onAfterLeave,
248
- appear: ""
249
- }, {
250
- default: vue.withCtx(() => [
251
- ($props.visible)
252
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
253
- key: 0,
254
- ref: $options.containerRef,
255
- class: $options.containerClass,
256
- role: "complementary",
257
- "aria-modal": $props.modal,
258
- onKeydown: _cache[1] || (_cache[1] = (...args) => ($options.onKeydown && $options.onKeydown(...args)))
259
- }, _ctx.$attrs), [
260
- vue.createElementVNode("div", {
261
- ref: $options.headerContainerRef,
262
- class: "p-sidebar-header"
263
- }, [
264
- (_ctx.$slots.header)
265
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
266
- vue.renderSlot(_ctx.$slots, "header")
267
- ]))
268
- : vue.createCommentVNode("", true),
269
- ($props.showCloseIcon)
270
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
271
- key: 1,
272
- ref: $options.closeButtonRef,
273
- autofocus: "",
274
- type: "button",
275
- class: "p-sidebar-close p-sidebar-icon p-link",
276
- "aria-label": $options.closeAriaLabel,
277
- onClick: _cache[0] || (_cache[0] = (...args) => ($options.hide && $options.hide(...args)))
278
- }, [
279
- vue.createElementVNode("span", {
280
- class: vue.normalizeClass(['p-sidebar-close-icon', $props.closeIcon])
281
- }, null, 2)
282
- ], 8, _hoisted_3)), [
283
- [_directive_ripple]
284
- ])
285
- : vue.createCommentVNode("", true)
286
- ], 512),
287
- vue.createElementVNode("div", {
288
- ref: $options.contentRef,
289
- class: "p-sidebar-content"
290
- }, [
291
- vue.renderSlot(_ctx.$slots, "default")
292
- ], 512)
293
- ], 16, _hoisted_1)), [
294
- [_directive_focustrap]
295
- ])
296
- : vue.createCommentVNode("", true)
297
- ]),
298
- _: 3
299
- }, 8, ["onAfterEnter", "onEnter", "onLeave", "onAfterLeave"])
300
- ], 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)
301
321
  ]),
302
322
  _: 3
303
323
  }))
@@ -330,7 +350,7 @@ function styleInject(css, ref) {
330
350
  }
331
351
  }
332
352
 
333
- 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";
334
354
  styleInject(css_248z);
335
355
 
336
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",inheritAttrs:!1,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;