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
@@ -10,7 +10,8 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
10
10
 
11
11
  var script = {
12
12
  name: 'Sidebar',
13
- emits: ['update:visible', 'show', 'hide'],
13
+ inheritAttrs: false,
14
+ emits: ['update:visible', 'show', 'hide', 'after-hide'],
14
15
  props: {
15
16
  visible: {
16
17
  type: Boolean,
@@ -46,67 +47,70 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
46
47
  },
47
48
  blockScroll: {
48
49
  type: Boolean,
49
- default: true
50
+ default: false
50
51
  }
51
52
  },
53
+ data() {
54
+ return {
55
+ containerVisible: this.visible
56
+ };
57
+ },
52
58
  container: null,
59
+ mask: null,
53
60
  content: null,
54
61
  headerContainer: null,
55
62
  closeButton: null,
56
63
  outsideClickListener: null,
57
- data() {
58
- return {
59
- maskVisible: false
60
- };
61
- },
62
- watch: {
63
- visible(newValue) {
64
- this.maskVisible = newValue ? newValue : this.maskVisible;
64
+ updated() {
65
+ if (this.visible) {
66
+ this.containerVisible = this.visible;
65
67
  }
66
68
  },
67
69
  beforeUnmount() {
68
- if (this.container && this.autoZIndex) {
69
- utils.ZIndexUtils.clear(this.container);
70
+ this.disableDocumentSettings();
71
+
72
+ if (this.mask && this.autoZIndex) {
73
+ utils.ZIndexUtils.clear(this.mask);
70
74
  }
71
75
 
72
- this.unbindOutsideClickListener();
73
76
  this.container = null;
77
+ this.mask = null;
74
78
  },
75
79
  methods: {
76
80
  hide() {
77
81
  this.$emit('update:visible', false);
78
-
79
- this.unbindOutsideClickListener();
80
- this.blockScroll && utils.DomHandler.removeClass(document.body, 'p-overflow-hidden');
81
82
  },
82
83
  onEnter() {
83
84
  this.$emit('show');
85
+ this.focus();
84
86
 
85
87
  if (this.autoZIndex) {
86
- utils.ZIndexUtils.set('modal', this.$refs.mask, this.baseZIndex || this.$primevue.config.zIndex.modal);
88
+ utils.ZIndexUtils.set('modal', this.mask, this.baseZIndex || this.$primevue.config.zIndex.modal);
89
+ }
90
+ },
91
+ onAfterEnter() {
92
+ this.enableDocumentSettings();
93
+ },
94
+ onBeforeLeave() {
95
+ if (this.modal) {
96
+ utils.DomHandler.addClass(this.mask, 'p-component-overlay-leave');
87
97
  }
88
-
89
- this.maskVisible = true;
90
- this.focus();
91
98
  },
92
99
  onLeave() {
93
- utils.DomHandler.addClass(this.$refs.mask, 'p-component-overlay-leave');
94
-
95
100
  this.$emit('hide');
96
- this.unbindOutsideClickListener();
97
101
  },
98
102
  onAfterLeave() {
99
103
  if (this.autoZIndex) {
100
104
  utils.ZIndexUtils.clear(this.mask);
101
105
  }
102
106
 
103
- this.maskVisible = false;
107
+ this.containerVisible = false;
108
+ this.disableDocumentSettings();
109
+ this.$emit('after-hide');
104
110
  },
105
- onAfterEnter() {
106
- this.bindOutsideClickListener();
107
-
108
- if (this.blockScroll) {
109
- utils.DomHandler.addClass(document.body, 'p-overflow-hidden');
111
+ onMaskClick(event) {
112
+ if (this.dismissable && this.modal && this.mask === event.target) {
113
+ this.hide();
110
114
  }
111
115
  },
112
116
  focus() {
@@ -126,19 +130,33 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
126
130
 
127
131
  focusTarget && focusTarget.focus();
128
132
  },
129
- onKeydown(event) {
130
- if (event.code === 'Escape') {
131
- this.hide();
133
+ enableDocumentSettings() {
134
+ if (this.dismissable && !this.modal) {
135
+ this.bindOutsideClickListener();
136
+ }
137
+
138
+ if (this.blockScroll) {
139
+ utils.DomHandler.addClass(document.body, 'p-overflow-hidden');
132
140
  }
133
141
  },
134
- onMaskClick(event) {
135
- if (this.dismissable && this.modal && this.$refs.mask === event.target) {
142
+ disableDocumentSettings() {
143
+ this.unbindOutsideClickListener();
144
+
145
+ if (this.blockScroll) {
146
+ utils.DomHandler.removeClass(document.body, 'p-overflow-hidden');
147
+ }
148
+ },
149
+ onKeydown(event) {
150
+ if (event.code === 'Escape') {
136
151
  this.hide();
137
152
  }
138
153
  },
139
154
  containerRef(el) {
140
155
  this.container = el;
141
156
  },
157
+ maskRef(el) {
158
+ this.mask = el;
159
+ },
142
160
  contentRef(el) {
143
161
  this.content = el;
144
162
  },
@@ -157,7 +175,7 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
157
175
  bindOutsideClickListener() {
158
176
  if (!this.outsideClickListener) {
159
177
  this.outsideClickListener = (event) => {
160
- if (!this.modal && this.isOutsideClicked(event) && this.dismissable) {
178
+ if (this.isOutsideClicked(event)) {
161
179
  this.hide();
162
180
  }
163
181
  };
@@ -192,14 +210,14 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
192
210
  closeAriaLabel() {
193
211
  return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
194
212
  },
195
- maskClasses() {
213
+ maskClass() {
196
214
  return [
197
215
  'p-sidebar-mask',
198
216
  this.getPositionClass(),
199
217
  {
200
218
  'p-component-overlay p-component-overlay-enter': this.modal,
201
219
  'p-sidebar-mask-scrollblocker': this.blockScroll,
202
- 'p-sidebar-visible': this.maskVisible,
220
+ 'p-sidebar-visible': this.containerVisible,
203
221
  'p-sidebar-full': this.fullScreen
204
222
  }
205
223
  ];
@@ -228,71 +246,74 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
228
246
 
229
247
  return (vue.openBlock(), vue.createBlock(_component_Portal, null, {
230
248
  default: vue.withCtx(() => [
231
- vue.createElementVNode("div", {
232
- ref: "mask",
233
- style: {},
234
- class: vue.normalizeClass($options.maskClasses),
235
- onMousedown: _cache[2] || (_cache[2] = (...args) => ($options.onMaskClick && $options.onMaskClick(...args)))
236
- }, [
237
- vue.createVNode(vue.Transition, {
238
- name: "p-sidebar",
239
- onAfterEnter: $options.onAfterEnter,
240
- onEnter: $options.onEnter,
241
- onLeave: $options.onLeave,
242
- onAfterLeave: $options.onAfterLeave,
243
- appear: ""
244
- }, {
245
- default: vue.withCtx(() => [
246
- ($props.visible)
247
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
248
- key: 0,
249
- ref: $options.containerRef,
250
- class: $options.containerClass,
251
- role: "complementary",
252
- "aria-modal": $props.modal,
253
- onKeydown: _cache[1] || (_cache[1] = (...args) => ($options.onKeydown && $options.onKeydown(...args)))
254
- }, _ctx.$attrs), [
255
- vue.createElementVNode("div", {
256
- ref: $options.headerContainerRef,
257
- class: "p-sidebar-header"
258
- }, [
259
- (_ctx.$slots.header)
260
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
261
- vue.renderSlot(_ctx.$slots, "header")
262
- ]))
263
- : vue.createCommentVNode("", true),
264
- ($props.showCloseIcon)
265
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
266
- key: 1,
267
- ref: $options.closeButtonRef,
268
- autofocus: "",
269
- type: "button",
270
- class: "p-sidebar-close p-sidebar-icon p-link",
271
- "aria-label": $options.closeAriaLabel,
272
- onClick: _cache[0] || (_cache[0] = (...args) => ($options.hide && $options.hide(...args)))
273
- }, [
274
- vue.createElementVNode("span", {
275
- class: vue.normalizeClass(['p-sidebar-close-icon', $props.closeIcon])
276
- }, null, 2)
277
- ], 8, _hoisted_3)), [
278
- [_directive_ripple]
279
- ])
280
- : vue.createCommentVNode("", true)
281
- ], 512),
282
- vue.createElementVNode("div", {
283
- ref: $options.contentRef,
284
- class: "p-sidebar-content"
285
- }, [
286
- vue.renderSlot(_ctx.$slots, "default")
287
- ], 512)
288
- ], 16, _hoisted_1)), [
289
- [_directive_focustrap]
290
- ])
291
- : vue.createCommentVNode("", true)
292
- ]),
293
- _: 3
294
- }, 8, ["onAfterEnter", "onEnter", "onLeave", "onAfterLeave"])
295
- ], 34)
249
+ ($data.containerVisible)
250
+ ? (vue.openBlock(), vue.createElementBlock("div", {
251
+ key: 0,
252
+ ref: $options.maskRef,
253
+ class: vue.normalizeClass($options.maskClass),
254
+ onMousedown: _cache[2] || (_cache[2] = (...args) => ($options.onMaskClick && $options.onMaskClick(...args)))
255
+ }, [
256
+ vue.createVNode(vue.Transition, {
257
+ name: "p-sidebar",
258
+ onEnter: $options.onEnter,
259
+ onAfterEnter: $options.onAfterEnter,
260
+ onBeforeLeave: $options.onBeforeLeave,
261
+ onLeave: $options.onLeave,
262
+ onAfterLeave: $options.onAfterLeave,
263
+ appear: ""
264
+ }, {
265
+ default: vue.withCtx(() => [
266
+ ($props.visible)
267
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
268
+ key: 0,
269
+ ref: $options.containerRef,
270
+ class: $options.containerClass,
271
+ role: "complementary",
272
+ "aria-modal": $props.modal,
273
+ onKeydown: _cache[1] || (_cache[1] = (...args) => ($options.onKeydown && $options.onKeydown(...args)))
274
+ }, _ctx.$attrs), [
275
+ vue.createElementVNode("div", {
276
+ ref: $options.headerContainerRef,
277
+ class: "p-sidebar-header"
278
+ }, [
279
+ (_ctx.$slots.header)
280
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
281
+ vue.renderSlot(_ctx.$slots, "header")
282
+ ]))
283
+ : vue.createCommentVNode("", true),
284
+ ($props.showCloseIcon)
285
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
286
+ key: 1,
287
+ ref: $options.closeButtonRef,
288
+ autofocus: "",
289
+ type: "button",
290
+ class: "p-sidebar-close p-sidebar-icon p-link",
291
+ "aria-label": $options.closeAriaLabel,
292
+ onClick: _cache[0] || (_cache[0] = (...args) => ($options.hide && $options.hide(...args)))
293
+ }, [
294
+ vue.createElementVNode("span", {
295
+ class: vue.normalizeClass(['p-sidebar-close-icon', $props.closeIcon])
296
+ }, null, 2)
297
+ ], 8, _hoisted_3)), [
298
+ [_directive_ripple]
299
+ ])
300
+ : vue.createCommentVNode("", true)
301
+ ], 512),
302
+ vue.createElementVNode("div", {
303
+ ref: $options.contentRef,
304
+ class: "p-sidebar-content"
305
+ }, [
306
+ vue.renderSlot(_ctx.$slots, "default")
307
+ ], 512)
308
+ ], 16, _hoisted_1)), [
309
+ [_directive_focustrap]
310
+ ])
311
+ : vue.createCommentVNode("", true)
312
+ ]),
313
+ _: 3
314
+ }, 8, ["onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])
315
+ ], 34))
316
+ : vue.createCommentVNode("", true)
296
317
  ]),
297
318
  _: 3
298
319
  }))
@@ -325,7 +346,7 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
325
346
  }
326
347
  }
327
348
 
328
- 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";
349
+ 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";
329
350
  styleInject(css_248z);
330
351
 
331
352
  script.render = render;
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.sidebar=function(e,t,n,i,s){"use strict";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"];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],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})},d}(primevue.focustrap,primevue.portal,primevue.ripple,primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.sidebar=function(e,t,n,i,s){"use strict";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","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:a.default,ripple:l.default},components:{Portal:o.default}};const p=["aria-modal"],c={key:0,class:"p-sidebar-header-content"},h=["aria-label"];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],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,a){const o=s.resolveComponent("Portal"),l=s.resolveDirective("ripple"),d=s.resolveDirective("focustrap");return s.openBlock(),s.createBlock(o,null,{default:s.withCtx((()=>[r.containerVisible?(s.openBlock(),s.createElementBlock("div",{key:0,ref:a.maskRef,class:s.normalizeClass(a.maskClass),onMousedown:t[2]||(t[2]=(...e)=>a.onMaskClick&&a.onMaskClick(...e))},[s.createVNode(s.Transition,{name:"p-sidebar",onEnter:a.onEnter,onAfterEnter:a.onAfterEnter,onBeforeLeave:a.onBeforeLeave,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,h)),[[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,["onEnter","onAfterEnter","onBeforeLeave","onLeave","onAfterLeave"])],34)):s.createCommentVNode("",!0)])),_:3})},d}(primevue.focustrap,primevue.portal,primevue.ripple,primevue.utils,Vue);
package/web-types.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "PrimeVue",
5
- "version": "3.22.0",
5
+ "version": "3.22.2",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",