primevue 3.22.1 → 3.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/core/core.js +25 -20
- package/core/core.min.js +4 -4
- package/divider/Divider.vue +1 -1
- package/divider/divider.cjs.js +1 -1
- package/divider/divider.cjs.min.js +1 -1
- package/divider/divider.esm.js +1 -1
- package/divider/divider.esm.min.js +1 -1
- package/divider/divider.js +1 -1
- package/divider/divider.min.js +1 -1
- package/menu/Menu.vue +1 -1
- package/menu/menu.cjs.js +1 -1
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +1 -1
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +1 -1
- package/menu/menu.min.js +1 -1
- package/package.json +1 -1
- package/paginator/JumpToPageInput.vue +11 -8
- package/paginator/Paginator.vue +1 -1
- package/paginator/paginator.cjs.js +14 -11
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +14 -11
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +14 -11
- package/paginator/paginator.min.js +1 -1
- package/rating/Rating.vue +1 -0
- package/rating/rating.cjs.js +1 -1
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +1 -1
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +1 -1
- package/rating/rating.min.js +1 -1
- package/resources/primevue.css +1 -0
- package/resources/primevue.min.css +1 -1
- package/sidebar/Sidebar.vue +60 -51
- package/sidebar/sidebar.cjs.js +123 -103
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +124 -104
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +123 -103
- package/sidebar/sidebar.min.js +1 -1
- package/tooltip/tooltip.cjs.js +0 -2
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +1 -3
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +0 -2
- package/tooltip/tooltip.min.js +1 -1
- package/utils/utils.cjs.js +10 -6
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +10 -6
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +10 -6
- package/utils/utils.min.js +1 -1
- package/web-types.json +1 -1
package/sidebar/sidebar.js
CHANGED
|
@@ -11,7 +11,7 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
11
11
|
var script = {
|
|
12
12
|
name: 'Sidebar',
|
|
13
13
|
inheritAttrs: false,
|
|
14
|
-
emits: ['update:visible', 'show', 'hide'],
|
|
14
|
+
emits: ['update:visible', 'show', 'hide', 'after-hide'],
|
|
15
15
|
props: {
|
|
16
16
|
visible: {
|
|
17
17
|
type: Boolean,
|
|
@@ -47,67 +47,70 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
47
47
|
},
|
|
48
48
|
blockScroll: {
|
|
49
49
|
type: Boolean,
|
|
50
|
-
default:
|
|
50
|
+
default: false
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
containerVisible: this.visible
|
|
56
|
+
};
|
|
57
|
+
},
|
|
53
58
|
container: null,
|
|
59
|
+
mask: null,
|
|
54
60
|
content: null,
|
|
55
61
|
headerContainer: null,
|
|
56
62
|
closeButton: null,
|
|
57
63
|
outsideClickListener: null,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
watch: {
|
|
64
|
-
visible(newValue) {
|
|
65
|
-
this.maskVisible = newValue ? newValue : this.maskVisible;
|
|
64
|
+
updated() {
|
|
65
|
+
if (this.visible) {
|
|
66
|
+
this.containerVisible = this.visible;
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
69
|
beforeUnmount() {
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
this.disableDocumentSettings();
|
|
71
|
+
|
|
72
|
+
if (this.mask && this.autoZIndex) {
|
|
73
|
+
utils.ZIndexUtils.clear(this.mask);
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
this.unbindOutsideClickListener();
|
|
74
76
|
this.container = null;
|
|
77
|
+
this.mask = null;
|
|
75
78
|
},
|
|
76
79
|
methods: {
|
|
77
80
|
hide() {
|
|
78
81
|
this.$emit('update:visible', false);
|
|
79
|
-
|
|
80
|
-
this.unbindOutsideClickListener();
|
|
81
|
-
this.blockScroll && utils.DomHandler.removeClass(document.body, 'p-overflow-hidden');
|
|
82
82
|
},
|
|
83
83
|
onEnter() {
|
|
84
84
|
this.$emit('show');
|
|
85
|
+
this.focus();
|
|
85
86
|
|
|
86
87
|
if (this.autoZIndex) {
|
|
87
|
-
utils.ZIndexUtils.set('modal', this
|
|
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');
|
|
88
97
|
}
|
|
89
|
-
|
|
90
|
-
this.maskVisible = true;
|
|
91
|
-
this.focus();
|
|
92
98
|
},
|
|
93
99
|
onLeave() {
|
|
94
|
-
utils.DomHandler.addClass(this.$refs.mask, 'p-component-overlay-leave');
|
|
95
|
-
|
|
96
100
|
this.$emit('hide');
|
|
97
|
-
this.unbindOutsideClickListener();
|
|
98
101
|
},
|
|
99
102
|
onAfterLeave() {
|
|
100
103
|
if (this.autoZIndex) {
|
|
101
104
|
utils.ZIndexUtils.clear(this.mask);
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
this.
|
|
107
|
+
this.containerVisible = false;
|
|
108
|
+
this.disableDocumentSettings();
|
|
109
|
+
this.$emit('after-hide');
|
|
105
110
|
},
|
|
106
|
-
|
|
107
|
-
this.
|
|
108
|
-
|
|
109
|
-
if (this.blockScroll) {
|
|
110
|
-
utils.DomHandler.addClass(document.body, 'p-overflow-hidden');
|
|
111
|
+
onMaskClick(event) {
|
|
112
|
+
if (this.dismissable && this.modal && this.mask === event.target) {
|
|
113
|
+
this.hide();
|
|
111
114
|
}
|
|
112
115
|
},
|
|
113
116
|
focus() {
|
|
@@ -127,19 +130,33 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
127
130
|
|
|
128
131
|
focusTarget && focusTarget.focus();
|
|
129
132
|
},
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
this.
|
|
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');
|
|
133
140
|
}
|
|
134
141
|
},
|
|
135
|
-
|
|
136
|
-
|
|
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') {
|
|
137
151
|
this.hide();
|
|
138
152
|
}
|
|
139
153
|
},
|
|
140
154
|
containerRef(el) {
|
|
141
155
|
this.container = el;
|
|
142
156
|
},
|
|
157
|
+
maskRef(el) {
|
|
158
|
+
this.mask = el;
|
|
159
|
+
},
|
|
143
160
|
contentRef(el) {
|
|
144
161
|
this.content = el;
|
|
145
162
|
},
|
|
@@ -158,7 +175,7 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
158
175
|
bindOutsideClickListener() {
|
|
159
176
|
if (!this.outsideClickListener) {
|
|
160
177
|
this.outsideClickListener = (event) => {
|
|
161
|
-
if (
|
|
178
|
+
if (this.isOutsideClicked(event)) {
|
|
162
179
|
this.hide();
|
|
163
180
|
}
|
|
164
181
|
};
|
|
@@ -193,14 +210,14 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
193
210
|
closeAriaLabel() {
|
|
194
211
|
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
|
|
195
212
|
},
|
|
196
|
-
|
|
213
|
+
maskClass() {
|
|
197
214
|
return [
|
|
198
215
|
'p-sidebar-mask',
|
|
199
216
|
this.getPositionClass(),
|
|
200
217
|
{
|
|
201
218
|
'p-component-overlay p-component-overlay-enter': this.modal,
|
|
202
219
|
'p-sidebar-mask-scrollblocker': this.blockScroll,
|
|
203
|
-
'p-sidebar-visible': this.
|
|
220
|
+
'p-sidebar-visible': this.containerVisible,
|
|
204
221
|
'p-sidebar-full': this.fullScreen
|
|
205
222
|
}
|
|
206
223
|
];
|
|
@@ -229,71 +246,74 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
229
246
|
|
|
230
247
|
return (vue.openBlock(), vue.createBlock(_component_Portal, null, {
|
|
231
248
|
default: vue.withCtx(() => [
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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)
|
|
297
317
|
]),
|
|
298
318
|
_: 3
|
|
299
319
|
}))
|
|
@@ -326,7 +346,7 @@ this.primevue.sidebar = (function (FocusTrap, Portal, Ripple, utils, vue) {
|
|
|
326
346
|
}
|
|
327
347
|
}
|
|
328
348
|
|
|
329
|
-
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-
|
|
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";
|
|
330
350
|
styleInject(css_248z);
|
|
331
351
|
|
|
332
352
|
script.render = render;
|
package/sidebar/sidebar.min.js
CHANGED
|
@@ -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",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:!
|
|
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/tooltip/tooltip.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils");function t(e){e.$_ptooltipModifiers.focus?(e.addEventListener("focus",i),e.addEventListener("blur",p)):(e.addEventListener("mouseenter",l),e.addEventListener("mouseleave",n),e.addEventListener("click",r)),e.addEventListener("keydown",a)}function o(e){e.$_ptooltipModifiers.focus?(e.removeEventListener("focus",i),e.removeEventListener("blur",p)):(e.removeEventListener("mouseenter",l),e.removeEventListener("mouseleave",n),e.removeEventListener("click",r)),e.removeEventListener("keydown",a)}function l(e){u(e.currentTarget)}function n(e){d(e.currentTarget)}function i(e){u(e.currentTarget)}function p(e){d(e.currentTarget)}function r(e){d(e.currentTarget)}function a(e){"Escape"===e.code&&d(e.currentTarget)}function u(t){if(t.$_ptooltipDisabled)return;let o=function(t){const o=""!==t.$_ptooltipIdAttr?t.$_ptooltipIdAttr:e.UniqueComponentId()+"_tooltip";t.$_ptooltipId=o;let l=document.createElement("div");l.id=o;let n=document.createElement("div");n.className="p-tooltip-arrow",l.appendChild(n);let i=document.createElement("div");i.className="p-tooltip-text",t.$_ptooltipEscape?i.innerHTML=t.$_ptooltipValue:(i.innerHTML="",i.appendChild(document.createTextNode(t.$_ptooltipValue)));l.setAttribute("role","tooltip"),l.appendChild(i),document.body.appendChild(l),l.style.display="inline-block",t.$_ptooltipFitContent&&(l.style.width="fit-content");return l}(t);!function(e){const t=e.$_ptooltipModifiers;t.top?($(e),H(e)&&(_(e),H(e)&&$(e))):t.left?(m(e),H(e)&&(v(e),H(e)&&($(e),H(e)&&(_(e),H(e)&&m(e))))):t.bottom?(_(e),H(e)&&($(e),H(e)&&_(e))):(v(e),H(e)&&(m(e),H(e)&&($(e),H(e)&&(_(e),H(e)&&v(e)))))}(t),e.DomHandler.fadeIn(o,250),window.addEventListener("resize",(function o(){e.DomHandler.isTouchDevice()||d(t),this.removeEventListener("resize",o)})),function(t){t.$_ptooltipScrollHandler||(t.$_ptooltipScrollHandler=new e.ConnectedOverlayScrollHandler(t,(function(){d(t)}))),t.$_ptooltipScrollHandler.bindScrollListener()}(t),e.ZIndexUtils.set("tooltip",o,t.$_ptooltipZIndex)}function d(e){c(e),function(e){e.$_ptooltipScrollHandler&&e.$_ptooltipScrollHandler.unbindScrollListener()}(e)}function s(e){return document.getElementById(e.$_ptooltipId)}function c(t){if(t){let o=s(t);o&&o.parentElement&&(e.ZIndexUtils.clear(o),document.body.removeChild(o)),t.$_ptooltipId=null}}function f(t){let o=t.getBoundingClientRect();return{left:o.left+e.DomHandler.getWindowScrollLeft(),top:o.top+e.DomHandler.getWindowScrollTop()}}function v(t){g(t,"right");let o=s(t),l=f(t),n=l.left+e.DomHandler.getOuterWidth(t),i=l.top+(e.DomHandler.getOuterHeight(t)-e.DomHandler.getOuterHeight(o))/2;o.style.left=n+"px",o.style.top=i+"px"}function m(t){g(t,"left");let o=s(t),l=f(t),n=l.left-e.DomHandler.getOuterWidth(o),i=l.top+(e.DomHandler.getOuterHeight(t)-e.DomHandler.getOuterHeight(o))/2;o.style.left=n+"px",o.style.top=i+"px"}function $(t){g(t,"top");let o=s(t),l=f(t),n=l.left+(e.DomHandler.getOuterWidth(t)-e.DomHandler.getOuterWidth(o))/2,i=l.top-e.DomHandler.getOuterHeight(o);o.style.left=n+"px",o.style.top=i+"px"}function _(t){g(t,"bottom");let o=s(t),l=f(t),n=l.left+(e.DomHandler.getOuterWidth(t)-e.DomHandler.getOuterWidth(o))/2,i=l.top+e.DomHandler.getOuterHeight(t);o.style.left=n+"px",o.style.top=i+"px"}function g(e,t){let o=s(e);o.style.left="-999px",o.style.top="-999px",o.className=`p-tooltip p-component p-tooltip-${t} ${e.$_ptooltipClass||""}`}function H(t){let o=s(t),l=o.getBoundingClientRect(),n=l.top,i=l.left,p=e.DomHandler.getOuterWidth(o),r=e.DomHandler.getOuterHeight(o),a=e.DomHandler.getViewport();return i+p>a.width||i<0||n<0||n+r>a.height}function b(t){return e.DomHandler.hasClass(t,"p-inputwrapper")?e.DomHandler.findSingle(t,"input"):t}function h(e){return e.modifiers&&Object.keys(e.modifiers).length?e.modifiers:e.arg&&"object"==typeof e.arg?Object.entries(e.arg).reduce(((e,[t,o])=>("event"!==t&&"position"!==t||(e[o]=!0),e)),{}):{}}const y={beforeMount(o,l){let n=b(o);if(n.$_ptooltipModifiers=h(l),l.value){if("string"==typeof l.value)n.$_ptooltipValue=l.value,n.$_ptooltipDisabled=!1,n.$_ptooltipEscape=!1,n.$_ptooltipClass=null,n.$_ptooltipFitContent=!0,n.$_ptooltipIdAttr="";else if("object"==typeof l.value&&l.value){if(e.ObjectUtils.isEmpty(l.value.value)||""===l.value.value.trim())return;n.$_ptooltipValue=l.value.value,n.$_ptooltipDisabled=!!l.value.disabled===l.value.disabled&&l.value.disabled,n.$_ptooltipEscape=!!l.value.escape===l.value.escape&&l.value.escape,n.$_ptooltipClass=l.value.class,n.$_ptooltipFitContent=!!l.value.fitContent!==l.value.fitContent||l.value.fitContent,n.$_ptooltipIdAttr=l.value.id||""}n.$_ptooltipZIndex=l.instance.$primevue&&l.instance.$primevue.config&&l.instance.$primevue.config.zIndex.tooltip,t(n)}},unmounted(
|
|
1
|
+
"use strict";var e=require("primevue/utils");function t(e){e.$_ptooltipModifiers.focus?(e.addEventListener("focus",i),e.addEventListener("blur",p)):(e.addEventListener("mouseenter",l),e.addEventListener("mouseleave",n),e.addEventListener("click",r)),e.addEventListener("keydown",a)}function o(e){e.$_ptooltipModifiers.focus?(e.removeEventListener("focus",i),e.removeEventListener("blur",p)):(e.removeEventListener("mouseenter",l),e.removeEventListener("mouseleave",n),e.removeEventListener("click",r)),e.removeEventListener("keydown",a)}function l(e){u(e.currentTarget)}function n(e){d(e.currentTarget)}function i(e){u(e.currentTarget)}function p(e){d(e.currentTarget)}function r(e){d(e.currentTarget)}function a(e){"Escape"===e.code&&d(e.currentTarget)}function u(t){if(t.$_ptooltipDisabled)return;let o=function(t){const o=""!==t.$_ptooltipIdAttr?t.$_ptooltipIdAttr:e.UniqueComponentId()+"_tooltip";t.$_ptooltipId=o;let l=document.createElement("div");l.id=o;let n=document.createElement("div");n.className="p-tooltip-arrow",l.appendChild(n);let i=document.createElement("div");i.className="p-tooltip-text",t.$_ptooltipEscape?i.innerHTML=t.$_ptooltipValue:(i.innerHTML="",i.appendChild(document.createTextNode(t.$_ptooltipValue)));l.setAttribute("role","tooltip"),l.appendChild(i),document.body.appendChild(l),l.style.display="inline-block",t.$_ptooltipFitContent&&(l.style.width="fit-content");return l}(t);!function(e){const t=e.$_ptooltipModifiers;t.top?($(e),H(e)&&(_(e),H(e)&&$(e))):t.left?(m(e),H(e)&&(v(e),H(e)&&($(e),H(e)&&(_(e),H(e)&&m(e))))):t.bottom?(_(e),H(e)&&($(e),H(e)&&_(e))):(v(e),H(e)&&(m(e),H(e)&&($(e),H(e)&&(_(e),H(e)&&v(e)))))}(t),e.DomHandler.fadeIn(o,250),window.addEventListener("resize",(function o(){e.DomHandler.isTouchDevice()||d(t),this.removeEventListener("resize",o)})),function(t){t.$_ptooltipScrollHandler||(t.$_ptooltipScrollHandler=new e.ConnectedOverlayScrollHandler(t,(function(){d(t)}))),t.$_ptooltipScrollHandler.bindScrollListener()}(t),e.ZIndexUtils.set("tooltip",o,t.$_ptooltipZIndex)}function d(e){c(e),function(e){e.$_ptooltipScrollHandler&&e.$_ptooltipScrollHandler.unbindScrollListener()}(e)}function s(e){return document.getElementById(e.$_ptooltipId)}function c(t){if(t){let o=s(t);o&&o.parentElement&&(e.ZIndexUtils.clear(o),document.body.removeChild(o)),t.$_ptooltipId=null}}function f(t){let o=t.getBoundingClientRect();return{left:o.left+e.DomHandler.getWindowScrollLeft(),top:o.top+e.DomHandler.getWindowScrollTop()}}function v(t){g(t,"right");let o=s(t),l=f(t),n=l.left+e.DomHandler.getOuterWidth(t),i=l.top+(e.DomHandler.getOuterHeight(t)-e.DomHandler.getOuterHeight(o))/2;o.style.left=n+"px",o.style.top=i+"px"}function m(t){g(t,"left");let o=s(t),l=f(t),n=l.left-e.DomHandler.getOuterWidth(o),i=l.top+(e.DomHandler.getOuterHeight(t)-e.DomHandler.getOuterHeight(o))/2;o.style.left=n+"px",o.style.top=i+"px"}function $(t){g(t,"top");let o=s(t),l=f(t),n=l.left+(e.DomHandler.getOuterWidth(t)-e.DomHandler.getOuterWidth(o))/2,i=l.top-e.DomHandler.getOuterHeight(o);o.style.left=n+"px",o.style.top=i+"px"}function _(t){g(t,"bottom");let o=s(t),l=f(t),n=l.left+(e.DomHandler.getOuterWidth(t)-e.DomHandler.getOuterWidth(o))/2,i=l.top+e.DomHandler.getOuterHeight(t);o.style.left=n+"px",o.style.top=i+"px"}function g(e,t){let o=s(e);o.style.left="-999px",o.style.top="-999px",o.className=`p-tooltip p-component p-tooltip-${t} ${e.$_ptooltipClass||""}`}function H(t){let o=s(t),l=o.getBoundingClientRect(),n=l.top,i=l.left,p=e.DomHandler.getOuterWidth(o),r=e.DomHandler.getOuterHeight(o),a=e.DomHandler.getViewport();return i+p>a.width||i<0||n<0||n+r>a.height}function b(t){return e.DomHandler.hasClass(t,"p-inputwrapper")?e.DomHandler.findSingle(t,"input"):t}function h(e){return e.modifiers&&Object.keys(e.modifiers).length?e.modifiers:e.arg&&"object"==typeof e.arg?Object.entries(e.arg).reduce(((e,[t,o])=>("event"!==t&&"position"!==t||(e[o]=!0),e)),{}):{}}const y={beforeMount(o,l){let n=b(o);if(n.$_ptooltipModifiers=h(l),l.value){if("string"==typeof l.value)n.$_ptooltipValue=l.value,n.$_ptooltipDisabled=!1,n.$_ptooltipEscape=!1,n.$_ptooltipClass=null,n.$_ptooltipFitContent=!0,n.$_ptooltipIdAttr="";else if("object"==typeof l.value&&l.value){if(e.ObjectUtils.isEmpty(l.value.value)||""===l.value.value.trim())return;n.$_ptooltipValue=l.value.value,n.$_ptooltipDisabled=!!l.value.disabled===l.value.disabled&&l.value.disabled,n.$_ptooltipEscape=!!l.value.escape===l.value.escape&&l.value.escape,n.$_ptooltipClass=l.value.class,n.$_ptooltipFitContent=!!l.value.fitContent!==l.value.fitContent||l.value.fitContent,n.$_ptooltipIdAttr=l.value.id||""}n.$_ptooltipZIndex=l.instance.$primevue&&l.instance.$primevue.config&&l.instance.$primevue.config.zIndex.tooltip,t(n)}},unmounted(e){let t=b(e);c(t),o(t),t.$_ptooltipScrollHandler&&(t.$_ptooltipScrollHandler.destroy(),t.$_ptooltipScrollHandler=null)},updated(l,n){let i=b(l);if(i.$_ptooltipModifiers=h(n),n.value){if("string"==typeof n.value)i.$_ptooltipValue=n.value,i.$_ptooltipDisabled=!1,i.$_ptooltipEscape=!1,i.$_ptooltipClass=null,i.$_ptooltipIdAttr="",t(i);else if("object"==typeof n.value&&n.value){if(e.ObjectUtils.isEmpty(n.value.value||""===n.value.value.trim()))return void o(i);i.$_ptooltipValue=n.value.value,i.$_ptooltipDisabled=!!n.value.disabled===n.value.disabled&&n.value.disabled,i.$_ptooltipEscape=!!n.value.escape===n.value.escape&&n.value.escape,i.$_ptooltipClass=n.value.class,i.$_ptooltipFitContent=!!n.value.fitContent!==n.value.fitContent||n.value.fitContent,i.$_ptooltipIdAttr=n.value.id||"",t(i)}}else o(i)}};module.exports=y;
|
package/tooltip/tooltip.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ObjectUtils,
|
|
1
|
+
import { ObjectUtils, DomHandler, ZIndexUtils, UniqueComponentId, ConnectedOverlayScrollHandler } from 'primevue/utils';
|
|
2
2
|
|
|
3
3
|
function bindEvents(el) {
|
|
4
4
|
const modifiers = el.$_ptooltipModifiers;
|
|
@@ -347,8 +347,6 @@ const Tooltip = {
|
|
|
347
347
|
target.$_ptooltipScrollHandler.destroy();
|
|
348
348
|
target.$_ptooltipScrollHandler = null;
|
|
349
349
|
}
|
|
350
|
-
|
|
351
|
-
ZIndexUtils.clear(el);
|
|
352
350
|
},
|
|
353
351
|
updated(el, options) {
|
|
354
352
|
let target = getTarget(el);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ObjectUtils as t,
|
|
1
|
+
import{ObjectUtils as t,DomHandler as e,ZIndexUtils as o,UniqueComponentId as l,ConnectedOverlayScrollHandler as i}from"primevue/utils";function n(t){t.$_ptooltipModifiers.focus?(t.addEventListener("focus",a),t.addEventListener("blur",s)):(t.addEventListener("mouseenter",r),t.addEventListener("mouseleave",u),t.addEventListener("click",d)),t.addEventListener("keydown",c)}function p(t){t.$_ptooltipModifiers.focus?(t.removeEventListener("focus",a),t.removeEventListener("blur",s)):(t.removeEventListener("mouseenter",r),t.removeEventListener("mouseleave",u),t.removeEventListener("click",d)),t.removeEventListener("keydown",c)}function r(t){f(t.currentTarget)}function u(t){v(t.currentTarget)}function a(t){f(t.currentTarget)}function s(t){v(t.currentTarget)}function d(t){v(t.currentTarget)}function c(t){"Escape"===t.code&&v(t.currentTarget)}function f(t){if(t.$_ptooltipDisabled)return;let n=function(t){const e=""!==t.$_ptooltipIdAttr?t.$_ptooltipIdAttr:l()+"_tooltip";t.$_ptooltipId=e;let o=document.createElement("div");o.id=e;let i=document.createElement("div");i.className="p-tooltip-arrow",o.appendChild(i);let n=document.createElement("div");n.className="p-tooltip-text",t.$_ptooltipEscape?n.innerHTML=t.$_ptooltipValue:(n.innerHTML="",n.appendChild(document.createTextNode(t.$_ptooltipValue)));o.setAttribute("role","tooltip"),o.appendChild(n),document.body.appendChild(o),o.style.display="inline-block",t.$_ptooltipFitContent&&(o.style.width="fit-content");return o}(t);!function(t){const e=t.$_ptooltipModifiers;e.top?(b(t),C(t)&&(y(t),C(t)&&b(t))):e.left?(h(t),C(t)&&(m(t),C(t)&&(b(t),C(t)&&(y(t),C(t)&&h(t))))):e.bottom?(y(t),C(t)&&(b(t),C(t)&&y(t))):(m(t),C(t)&&(h(t),C(t)&&(b(t),C(t)&&(y(t),C(t)&&m(t)))))}(t),e.fadeIn(n,250),window.addEventListener("resize",(function o(){e.isTouchDevice()||v(t),this.removeEventListener("resize",o)})),function(t){t.$_ptooltipScrollHandler||(t.$_ptooltipScrollHandler=new i(t,(function(){v(t)}))),t.$_ptooltipScrollHandler.bindScrollListener()}(t),o.set("tooltip",n,t.$_ptooltipZIndex)}function v(t){_(t),function(t){t.$_ptooltipScrollHandler&&t.$_ptooltipScrollHandler.unbindScrollListener()}(t)}function $(t){return document.getElementById(t.$_ptooltipId)}function _(t){if(t){let e=$(t);e&&e.parentElement&&(o.clear(e),document.body.removeChild(e)),t.$_ptooltipId=null}}function g(t){let o=t.getBoundingClientRect();return{left:o.left+e.getWindowScrollLeft(),top:o.top+e.getWindowScrollTop()}}function m(t){E(t,"right");let o=$(t),l=g(t),i=l.left+e.getOuterWidth(t),n=l.top+(e.getOuterHeight(t)-e.getOuterHeight(o))/2;o.style.left=i+"px",o.style.top=n+"px"}function h(t){E(t,"left");let o=$(t),l=g(t),i=l.left-e.getOuterWidth(o),n=l.top+(e.getOuterHeight(t)-e.getOuterHeight(o))/2;o.style.left=i+"px",o.style.top=n+"px"}function b(t){E(t,"top");let o=$(t),l=g(t),i=l.left+(e.getOuterWidth(t)-e.getOuterWidth(o))/2,n=l.top-e.getOuterHeight(o);o.style.left=i+"px",o.style.top=n+"px"}function y(t){E(t,"bottom");let o=$(t),l=g(t),i=l.left+(e.getOuterWidth(t)-e.getOuterWidth(o))/2,n=l.top+e.getOuterHeight(t);o.style.left=i+"px",o.style.top=n+"px"}function E(t,e){let o=$(t);o.style.left="-999px",o.style.top="-999px",o.className=`p-tooltip p-component p-tooltip-${e} ${t.$_ptooltipClass||""}`}function C(t){let o=$(t),l=o.getBoundingClientRect(),i=l.top,n=l.left,p=e.getOuterWidth(o),r=e.getOuterHeight(o),u=e.getViewport();return n+p>u.width||n<0||i<0||i+r>u.height}function L(t){return e.hasClass(t,"p-inputwrapper")?e.findSingle(t,"input"):t}function H(t){return t.modifiers&&Object.keys(t.modifiers).length?t.modifiers:t.arg&&"object"==typeof t.arg?Object.entries(t.arg).reduce(((t,[e,o])=>("event"!==e&&"position"!==e||(t[o]=!0),t)),{}):{}}const x={beforeMount(e,o){let l=L(e);if(l.$_ptooltipModifiers=H(o),o.value){if("string"==typeof o.value)l.$_ptooltipValue=o.value,l.$_ptooltipDisabled=!1,l.$_ptooltipEscape=!1,l.$_ptooltipClass=null,l.$_ptooltipFitContent=!0,l.$_ptooltipIdAttr="";else if("object"==typeof o.value&&o.value){if(t.isEmpty(o.value.value)||""===o.value.value.trim())return;l.$_ptooltipValue=o.value.value,l.$_ptooltipDisabled=!!o.value.disabled===o.value.disabled&&o.value.disabled,l.$_ptooltipEscape=!!o.value.escape===o.value.escape&&o.value.escape,l.$_ptooltipClass=o.value.class,l.$_ptooltipFitContent=!!o.value.fitContent!==o.value.fitContent||o.value.fitContent,l.$_ptooltipIdAttr=o.value.id||""}l.$_ptooltipZIndex=o.instance.$primevue&&o.instance.$primevue.config&&o.instance.$primevue.config.zIndex.tooltip,n(l)}},unmounted(t){let e=L(t);_(e),p(e),e.$_ptooltipScrollHandler&&(e.$_ptooltipScrollHandler.destroy(),e.$_ptooltipScrollHandler=null)},updated(e,o){let l=L(e);if(l.$_ptooltipModifiers=H(o),o.value){if("string"==typeof o.value)l.$_ptooltipValue=o.value,l.$_ptooltipDisabled=!1,l.$_ptooltipEscape=!1,l.$_ptooltipClass=null,l.$_ptooltipIdAttr="",n(l);else if("object"==typeof o.value&&o.value){if(t.isEmpty(o.value.value||""===o.value.value.trim()))return void p(l);l.$_ptooltipValue=o.value.value,l.$_ptooltipDisabled=!!o.value.disabled===o.value.disabled&&o.value.disabled,l.$_ptooltipEscape=!!o.value.escape===o.value.escape&&o.value.escape,l.$_ptooltipClass=o.value.class,l.$_ptooltipFitContent=!!o.value.fitContent!==o.value.fitContent||o.value.fitContent,l.$_ptooltipIdAttr=o.value.id||"",n(l)}}else p(l)}};export{x as default};
|
package/tooltip/tooltip.js
CHANGED
package/tooltip/tooltip.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.tooltip=function(t){"use strict";function e(t){t.$_ptooltipModifiers.focus?(t.addEventListener("focus",n),t.addEventListener("blur",p)):(t.addEventListener("mouseenter",l),t.addEventListener("mouseleave",i),t.addEventListener("click",r)),t.addEventListener("keydown",a)}function o(t){t.$_ptooltipModifiers.focus?(t.removeEventListener("focus",n),t.removeEventListener("blur",p)):(t.removeEventListener("mouseenter",l),t.removeEventListener("mouseleave",i),t.removeEventListener("click",r)),t.removeEventListener("keydown",a)}function l(t){u(t.currentTarget)}function i(t){d(t.currentTarget)}function n(t){u(t.currentTarget)}function p(t){d(t.currentTarget)}function r(t){d(t.currentTarget)}function a(t){"Escape"===t.code&&d(t.currentTarget)}function u(e){if(e.$_ptooltipDisabled)return;let o=function(e){const o=""!==e.$_ptooltipIdAttr?e.$_ptooltipIdAttr:t.UniqueComponentId()+"_tooltip";e.$_ptooltipId=o;let l=document.createElement("div");l.id=o;let i=document.createElement("div");i.className="p-tooltip-arrow",l.appendChild(i);let n=document.createElement("div");n.className="p-tooltip-text",e.$_ptooltipEscape?n.innerHTML=e.$_ptooltipValue:(n.innerHTML="",n.appendChild(document.createTextNode(e.$_ptooltipValue)));l.setAttribute("role","tooltip"),l.appendChild(n),document.body.appendChild(l),l.style.display="inline-block",e.$_ptooltipFitContent&&(l.style.width="fit-content");return l}(e);!function(t){const e=t.$_ptooltipModifiers;e.top?($(t),H(t)&&(_(t),H(t)&&$(t))):e.left?(m(t),H(t)&&(v(t),H(t)&&($(t),H(t)&&(_(t),H(t)&&m(t))))):e.bottom?(_(t),H(t)&&($(t),H(t)&&_(t))):(v(t),H(t)&&(m(t),H(t)&&($(t),H(t)&&(_(t),H(t)&&v(t)))))}(e),t.DomHandler.fadeIn(o,250),window.addEventListener("resize",(function o(){t.DomHandler.isTouchDevice()||d(e),this.removeEventListener("resize",o)})),function(e){e.$_ptooltipScrollHandler||(e.$_ptooltipScrollHandler=new t.ConnectedOverlayScrollHandler(e,(function(){d(e)}))),e.$_ptooltipScrollHandler.bindScrollListener()}(e),t.ZIndexUtils.set("tooltip",o,e.$_ptooltipZIndex)}function d(t){c(t),function(t){t.$_ptooltipScrollHandler&&t.$_ptooltipScrollHandler.unbindScrollListener()}(t)}function s(t){return document.getElementById(t.$_ptooltipId)}function c(e){if(e){let o=s(e);o&&o.parentElement&&(t.ZIndexUtils.clear(o),document.body.removeChild(o)),e.$_ptooltipId=null}}function f(e){let o=e.getBoundingClientRect();return{left:o.left+t.DomHandler.getWindowScrollLeft(),top:o.top+t.DomHandler.getWindowScrollTop()}}function v(e){g(e,"right");let o=s(e),l=f(e),i=l.left+t.DomHandler.getOuterWidth(e),n=l.top+(t.DomHandler.getOuterHeight(e)-t.DomHandler.getOuterHeight(o))/2;o.style.left=i+"px",o.style.top=n+"px"}function m(e){g(e,"left");let o=s(e),l=f(e),i=l.left-t.DomHandler.getOuterWidth(o),n=l.top+(t.DomHandler.getOuterHeight(e)-t.DomHandler.getOuterHeight(o))/2;o.style.left=i+"px",o.style.top=n+"px"}function $(e){g(e,"top");let o=s(e),l=f(e),i=l.left+(t.DomHandler.getOuterWidth(e)-t.DomHandler.getOuterWidth(o))/2,n=l.top-t.DomHandler.getOuterHeight(o);o.style.left=i+"px",o.style.top=n+"px"}function _(e){g(e,"bottom");let o=s(e),l=f(e),i=l.left+(t.DomHandler.getOuterWidth(e)-t.DomHandler.getOuterWidth(o))/2,n=l.top+t.DomHandler.getOuterHeight(e);o.style.left=i+"px",o.style.top=n+"px"}function g(t,e){let o=s(t);o.style.left="-999px",o.style.top="-999px",o.className=`p-tooltip p-component p-tooltip-${e} ${t.$_ptooltipClass||""}`}function H(e){let o=s(e),l=o.getBoundingClientRect(),i=l.top,n=l.left,p=t.DomHandler.getOuterWidth(o),r=t.DomHandler.getOuterHeight(o),a=t.DomHandler.getViewport();return n+p>a.width||n<0||i<0||i+r>a.height}function h(e){return t.DomHandler.hasClass(e,"p-inputwrapper")?t.DomHandler.findSingle(e,"input"):e}function b(t){return t.modifiers&&Object.keys(t.modifiers).length?t.modifiers:t.arg&&"object"==typeof t.arg?Object.entries(t.arg).reduce(((t,[e,o])=>("event"!==e&&"position"!==e||(t[o]=!0),t)),{}):{}}return{beforeMount(o,l){let i=h(o);if(i.$_ptooltipModifiers=b(l),l.value){if("string"==typeof l.value)i.$_ptooltipValue=l.value,i.$_ptooltipDisabled=!1,i.$_ptooltipEscape=!1,i.$_ptooltipClass=null,i.$_ptooltipFitContent=!0,i.$_ptooltipIdAttr="";else if("object"==typeof l.value&&l.value){if(t.ObjectUtils.isEmpty(l.value.value)||""===l.value.value.trim())return;i.$_ptooltipValue=l.value.value,i.$_ptooltipDisabled=!!l.value.disabled===l.value.disabled&&l.value.disabled,i.$_ptooltipEscape=!!l.value.escape===l.value.escape&&l.value.escape,i.$_ptooltipClass=l.value.class,i.$_ptooltipFitContent=!!l.value.fitContent!==l.value.fitContent||l.value.fitContent,i.$_ptooltipIdAttr=l.value.id||""}i.$_ptooltipZIndex=l.instance.$primevue&&l.instance.$primevue.config&&l.instance.$primevue.config.zIndex.tooltip,e(i)}},unmounted(
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.tooltip=function(t){"use strict";function e(t){t.$_ptooltipModifiers.focus?(t.addEventListener("focus",n),t.addEventListener("blur",p)):(t.addEventListener("mouseenter",l),t.addEventListener("mouseleave",i),t.addEventListener("click",r)),t.addEventListener("keydown",a)}function o(t){t.$_ptooltipModifiers.focus?(t.removeEventListener("focus",n),t.removeEventListener("blur",p)):(t.removeEventListener("mouseenter",l),t.removeEventListener("mouseleave",i),t.removeEventListener("click",r)),t.removeEventListener("keydown",a)}function l(t){u(t.currentTarget)}function i(t){d(t.currentTarget)}function n(t){u(t.currentTarget)}function p(t){d(t.currentTarget)}function r(t){d(t.currentTarget)}function a(t){"Escape"===t.code&&d(t.currentTarget)}function u(e){if(e.$_ptooltipDisabled)return;let o=function(e){const o=""!==e.$_ptooltipIdAttr?e.$_ptooltipIdAttr:t.UniqueComponentId()+"_tooltip";e.$_ptooltipId=o;let l=document.createElement("div");l.id=o;let i=document.createElement("div");i.className="p-tooltip-arrow",l.appendChild(i);let n=document.createElement("div");n.className="p-tooltip-text",e.$_ptooltipEscape?n.innerHTML=e.$_ptooltipValue:(n.innerHTML="",n.appendChild(document.createTextNode(e.$_ptooltipValue)));l.setAttribute("role","tooltip"),l.appendChild(n),document.body.appendChild(l),l.style.display="inline-block",e.$_ptooltipFitContent&&(l.style.width="fit-content");return l}(e);!function(t){const e=t.$_ptooltipModifiers;e.top?($(t),H(t)&&(_(t),H(t)&&$(t))):e.left?(m(t),H(t)&&(v(t),H(t)&&($(t),H(t)&&(_(t),H(t)&&m(t))))):e.bottom?(_(t),H(t)&&($(t),H(t)&&_(t))):(v(t),H(t)&&(m(t),H(t)&&($(t),H(t)&&(_(t),H(t)&&v(t)))))}(e),t.DomHandler.fadeIn(o,250),window.addEventListener("resize",(function o(){t.DomHandler.isTouchDevice()||d(e),this.removeEventListener("resize",o)})),function(e){e.$_ptooltipScrollHandler||(e.$_ptooltipScrollHandler=new t.ConnectedOverlayScrollHandler(e,(function(){d(e)}))),e.$_ptooltipScrollHandler.bindScrollListener()}(e),t.ZIndexUtils.set("tooltip",o,e.$_ptooltipZIndex)}function d(t){c(t),function(t){t.$_ptooltipScrollHandler&&t.$_ptooltipScrollHandler.unbindScrollListener()}(t)}function s(t){return document.getElementById(t.$_ptooltipId)}function c(e){if(e){let o=s(e);o&&o.parentElement&&(t.ZIndexUtils.clear(o),document.body.removeChild(o)),e.$_ptooltipId=null}}function f(e){let o=e.getBoundingClientRect();return{left:o.left+t.DomHandler.getWindowScrollLeft(),top:o.top+t.DomHandler.getWindowScrollTop()}}function v(e){g(e,"right");let o=s(e),l=f(e),i=l.left+t.DomHandler.getOuterWidth(e),n=l.top+(t.DomHandler.getOuterHeight(e)-t.DomHandler.getOuterHeight(o))/2;o.style.left=i+"px",o.style.top=n+"px"}function m(e){g(e,"left");let o=s(e),l=f(e),i=l.left-t.DomHandler.getOuterWidth(o),n=l.top+(t.DomHandler.getOuterHeight(e)-t.DomHandler.getOuterHeight(o))/2;o.style.left=i+"px",o.style.top=n+"px"}function $(e){g(e,"top");let o=s(e),l=f(e),i=l.left+(t.DomHandler.getOuterWidth(e)-t.DomHandler.getOuterWidth(o))/2,n=l.top-t.DomHandler.getOuterHeight(o);o.style.left=i+"px",o.style.top=n+"px"}function _(e){g(e,"bottom");let o=s(e),l=f(e),i=l.left+(t.DomHandler.getOuterWidth(e)-t.DomHandler.getOuterWidth(o))/2,n=l.top+t.DomHandler.getOuterHeight(e);o.style.left=i+"px",o.style.top=n+"px"}function g(t,e){let o=s(t);o.style.left="-999px",o.style.top="-999px",o.className=`p-tooltip p-component p-tooltip-${e} ${t.$_ptooltipClass||""}`}function H(e){let o=s(e),l=o.getBoundingClientRect(),i=l.top,n=l.left,p=t.DomHandler.getOuterWidth(o),r=t.DomHandler.getOuterHeight(o),a=t.DomHandler.getViewport();return n+p>a.width||n<0||i<0||i+r>a.height}function h(e){return t.DomHandler.hasClass(e,"p-inputwrapper")?t.DomHandler.findSingle(e,"input"):e}function b(t){return t.modifiers&&Object.keys(t.modifiers).length?t.modifiers:t.arg&&"object"==typeof t.arg?Object.entries(t.arg).reduce(((t,[e,o])=>("event"!==e&&"position"!==e||(t[o]=!0),t)),{}):{}}return{beforeMount(o,l){let i=h(o);if(i.$_ptooltipModifiers=b(l),l.value){if("string"==typeof l.value)i.$_ptooltipValue=l.value,i.$_ptooltipDisabled=!1,i.$_ptooltipEscape=!1,i.$_ptooltipClass=null,i.$_ptooltipFitContent=!0,i.$_ptooltipIdAttr="";else if("object"==typeof l.value&&l.value){if(t.ObjectUtils.isEmpty(l.value.value)||""===l.value.value.trim())return;i.$_ptooltipValue=l.value.value,i.$_ptooltipDisabled=!!l.value.disabled===l.value.disabled&&l.value.disabled,i.$_ptooltipEscape=!!l.value.escape===l.value.escape&&l.value.escape,i.$_ptooltipClass=l.value.class,i.$_ptooltipFitContent=!!l.value.fitContent!==l.value.fitContent||l.value.fitContent,i.$_ptooltipIdAttr=l.value.id||""}i.$_ptooltipZIndex=l.instance.$primevue&&l.instance.$primevue.config&&l.instance.$primevue.config.zIndex.tooltip,e(i)}},unmounted(t){let e=h(t);c(e),o(e),e.$_ptooltipScrollHandler&&(e.$_ptooltipScrollHandler.destroy(),e.$_ptooltipScrollHandler=null)},updated(l,i){let n=h(l);if(n.$_ptooltipModifiers=b(i),i.value){if("string"==typeof i.value)n.$_ptooltipValue=i.value,n.$_ptooltipDisabled=!1,n.$_ptooltipEscape=!1,n.$_ptooltipClass=null,n.$_ptooltipIdAttr="",e(n);else if("object"==typeof i.value&&i.value){if(t.ObjectUtils.isEmpty(i.value.value||""===i.value.value.trim()))return void o(n);n.$_ptooltipValue=i.value.value,n.$_ptooltipDisabled=!!i.value.disabled===i.value.disabled&&i.value.disabled,n.$_ptooltipEscape=!!i.value.escape===i.value.escape&&i.value.escape,n.$_ptooltipClass=i.value.class,n.$_ptooltipFitContent=!!i.value.fitContent!==i.value.fitContent||i.value.fitContent,n.$_ptooltipIdAttr=i.value.id||"",e(n)}}else o(n)}}}(primevue.utils);
|
package/utils/utils.cjs.js
CHANGED
|
@@ -981,9 +981,9 @@ function UniqueComponentId (prefix = 'pv_id_') {
|
|
|
981
981
|
function handler() {
|
|
982
982
|
let zIndexes = [];
|
|
983
983
|
|
|
984
|
-
const generateZIndex = (key, baseZIndex) => {
|
|
985
|
-
|
|
986
|
-
|
|
984
|
+
const generateZIndex = (key, baseZIndex = 999) => {
|
|
985
|
+
const lastZIndex = getLastZIndex(key, baseZIndex);
|
|
986
|
+
const newZIndex = lastZIndex.value + (lastZIndex.key === key ? 0 : baseZIndex) + 1;
|
|
987
987
|
|
|
988
988
|
zIndexes.push({ key, value: newZIndex });
|
|
989
989
|
|
|
@@ -994,8 +994,12 @@ function handler() {
|
|
|
994
994
|
zIndexes = zIndexes.filter((obj) => obj.value !== zIndex);
|
|
995
995
|
};
|
|
996
996
|
|
|
997
|
-
const getCurrentZIndex = () => {
|
|
998
|
-
return
|
|
997
|
+
const getCurrentZIndex = (key) => {
|
|
998
|
+
return getLastZIndex(key).value;
|
|
999
|
+
};
|
|
1000
|
+
|
|
1001
|
+
const getLastZIndex = (key, baseZIndex = 0) => {
|
|
1002
|
+
return [...zIndexes].reverse().find((obj) => obj.key === key) || { key, value: baseZIndex };
|
|
999
1003
|
};
|
|
1000
1004
|
|
|
1001
1005
|
const getZIndex = (el) => {
|
|
@@ -1015,7 +1019,7 @@ function handler() {
|
|
|
1015
1019
|
el.style.zIndex = '';
|
|
1016
1020
|
}
|
|
1017
1021
|
},
|
|
1018
|
-
getCurrent: () => getCurrentZIndex()
|
|
1022
|
+
getCurrent: (key) => getCurrentZIndex(key)
|
|
1019
1023
|
};
|
|
1020
1024
|
}
|
|
1021
1025
|
|