vgapp 1.4.4 → 1.4.6
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 +270 -270
- package/app/langs/en/buttons.json +17 -17
- package/app/langs/en/messages.json +36 -36
- package/app/langs/ru/buttons.json +17 -17
- package/app/langs/ru/messages.json +36 -36
- package/app/modules/vgalert/js/vgalert.js +266 -266
- package/app/modules/vgalert/scss/_variables.scss +16 -16
- package/app/modules/vgalert/scss/vgalert.scss +107 -107
- package/app/modules/vgcollapse/scss/_variables.scss +7 -7
- package/app/modules/vgcollapse/scss/vgcollapse.scss +5 -5
- package/app/modules/vgdropdown/scss/_variables.scss +14 -14
- package/app/modules/vgdropdown/scss/vgdropdown.scss +5 -5
- package/app/modules/vgdynamictable/index.js +4 -4
- package/app/modules/vgdynamictable/js/filters.js +21 -21
- package/app/modules/vgdynamictable/js/fixed.js +179 -179
- package/app/modules/vgdynamictable/js/options.js +3 -3
- package/app/modules/vgdynamictable/js/pagination.js +1 -1
- package/app/modules/vgdynamictable/js/search.js +12 -12
- package/app/modules/vgdynamictable/js/skeleton.js +27 -19
- package/app/modules/vgdynamictable/js/sortable.js +71 -71
- package/app/modules/vgdynamictable/js/summary-footer.js +28 -28
- package/app/modules/vgdynamictable/js/table-url-state.js +31 -31
- package/app/modules/vgdynamictable/js/utils/common.js +48 -48
- package/app/modules/vgdynamictable/js/vgdynamictable.js +79 -79
- package/app/modules/vgdynamictable/scss/_actions.scss +19 -19
- package/app/modules/vgdynamictable/scss/_pagination.scss +5 -5
- package/app/modules/vgdynamictable/scss/_skeleton.scss +11 -11
- package/app/modules/vgdynamictable/scss/_sortable.scss +28 -28
- package/app/modules/vgdynamictable/scss/_table.scss +7 -30
- package/app/modules/vgdynamictable/scss/_variables.scss +46 -46
- package/app/modules/vgdynamictable/scss/vgdynamictable.scss +28 -36
- package/app/modules/vgfilepreview/js/i18n.js +56 -56
- package/app/modules/vgfilepreview/js/renderers/image-modal.js +145 -145
- package/app/modules/vgfilepreview/js/renderers/image.js +92 -92
- package/app/modules/vgfilepreview/js/renderers/index.js +19 -19
- package/app/modules/vgfilepreview/js/renderers/office-modal.js +168 -168
- package/app/modules/vgfilepreview/js/renderers/office.js +79 -79
- package/app/modules/vgfilepreview/js/renderers/pdf-modal.js +260 -260
- package/app/modules/vgfilepreview/js/renderers/pdf.js +76 -76
- package/app/modules/vgfilepreview/js/renderers/playlist.js +71 -71
- package/app/modules/vgfilepreview/js/renderers/text-modal.js +343 -343
- package/app/modules/vgfilepreview/js/renderers/text.js +83 -83
- package/app/modules/vgfilepreview/js/renderers/video-modal.js +272 -272
- package/app/modules/vgfilepreview/js/renderers/video.js +80 -80
- package/app/modules/vgfilepreview/js/renderers/zip-modal.js +522 -522
- package/app/modules/vgfilepreview/js/renderers/zip.js +89 -89
- package/app/modules/vgfilepreview/js/vgfilepreview.js +7 -7
- package/app/modules/vgfilepreview/readme.md +68 -68
- package/app/modules/vgfilepreview/scss/_variables.scss +115 -115
- package/app/modules/vgfilepreview/scss/vgfilepreview.scss +463 -463
- package/app/modules/vgfiles/js/droppable.js +20 -9
- package/app/modules/vgfiles/js/render.js +153 -153
- package/app/modules/vgfiles/js/vgfiles.js +104 -104
- package/app/modules/vgfiles/readme.md +123 -123
- package/app/modules/vgfiles/scss/_mixins.scss +9 -9
- package/app/modules/vgfiles/scss/_variables.scss +41 -41
- package/app/modules/vgfiles/scss/vgfiles.scss +161 -161
- package/app/modules/vgformsender/js/hideshowpass.js +21 -16
- package/app/modules/vgformsender/js/vgformsender.js +4 -6
- package/app/modules/vgformsender/readme.md +1 -1
- package/app/modules/vgformsender/scss/_variables.scss +5 -5
- package/app/modules/vgformsender/scss/vgformsender.scss +42 -42
- package/app/modules/vglawcookie/js/vglawcookie.js +11 -8
- package/app/modules/vglawcookie/scss/_variables.scss +13 -13
- package/app/modules/vglawcookie/scss/vglawcookie.scss +5 -5
- package/app/modules/vgmodal/js/vgmodal.interaction.js +216 -216
- package/app/modules/vgmodal/js/vgmodal.js +355 -355
- package/app/modules/vgmodal/js/vgmodal.minimized.js +227 -227
- package/app/modules/vgmodal/scss/_variables.scss +17 -17
- package/app/modules/vgmodal/scss/vgmodal.scss +77 -77
- package/app/modules/vgnav/js/vgnav.js +180 -180
- package/app/modules/vgnav/scss/_breakpoints.scss +36 -36
- package/app/modules/vgnav/scss/_hamburger.scss +5 -5
- package/app/modules/vgnav/scss/_placement.scss +5 -5
- package/app/modules/vgnav/scss/_toggle.scss +5 -5
- package/app/modules/vgnav/scss/_variables.scss +26 -26
- package/app/modules/vgnav/scss/vgnav.scss +41 -41
- package/app/modules/vgnestable/README.md +39 -39
- package/app/modules/vgnestable/js/vgnestable.js +358 -358
- package/app/modules/vgnestable/scss/_variables.scss +35 -35
- package/app/modules/vgnestable/scss/vgnestable.scss +55 -55
- package/app/modules/vgrangeslider/js/skins.js +222 -222
- package/app/modules/vgrangeslider/js/vgrangeslider.js +704 -704
- package/app/modules/vgrangeslider/scss/_variables.scss +55 -55
- package/app/modules/vgrangeslider/scss/vgrangeslider.scss +239 -239
- package/app/modules/vgrollup/scss/_variables.scss +15 -15
- package/app/modules/vgrollup/scss/vgrollup.scss +6 -6
- package/app/modules/vgselect/js/vgselect.js +129 -129
- package/app/modules/vgselect/readme.md +11 -11
- package/app/modules/vgselect/scss/_variables.scss +50 -50
- package/app/modules/vgselect/scss/vgselect.scss +48 -48
- package/app/modules/vgsidebar/js/vgsidebar.js +79 -79
- package/app/modules/vgsidebar/scss/_variables.scss +10 -10
- package/app/modules/vgsidebar/scss/vgsidebar.scss +5 -5
- package/app/modules/vgtabs/scss/_variables.scss +23 -23
- package/app/modules/vgtabs/scss/vgtabs.scss +5 -5
- package/app/modules/vgtoast/scss/_variables.scss +13 -13
- package/app/modules/vgtoast/scss/vgtoast.scss +5 -5
- package/app/modules/vgtooltip/js/vgtooltip.js +107 -51
- package/app/modules/vgtooltip/scss/_variables.scss +10 -10
- package/app/modules/vgtooltip/scss/vgtooltip.scss +5 -5
- package/app/utils/js/components/audio-metadata.js +240 -240
- package/app/utils/js/components/backdrop.js +116 -116
- package/app/utils/js/components/file-icon.js +109 -109
- package/app/utils/js/components/file-preview.js +304 -304
- package/app/utils/js/components/sanitize.js +150 -150
- package/app/utils/js/components/video-metadata.js +140 -140
- package/app/utils/scss/_backdrop.scss +5 -5
- package/app/utils/scss/_theme-default.scss +12 -12
- package/app/utils/scss/_theme.scss +7 -7
- package/app/utils/scss/_tokens.scss +170 -170
- package/app/utils/scss/default.scss +9 -9
- package/app/utils/scss/functions.scss +21 -21
- package/app/utils/scss/index.scss +4 -4
- package/app/utils/scss/mixin.scss +16 -16
- package/app/utils/scss/variables.scss +105 -105
- package/app/vgapp.js +295 -295
- package/build/vgapp.css +1 -1
- package/build/vgapp.css.map +1 -1
- package/build/vgapp.js +1 -1
- package/build/vgapp.js.map +1 -1
- package/index.scss +20 -20
- package/package.json +4 -2
|
@@ -82,16 +82,22 @@ class VGTooltip extends BaseModule {
|
|
|
82
82
|
|
|
83
83
|
this._params = this._getParams(element, mergeDeepObject(defaultParams, params));
|
|
84
84
|
this._tooltip = null;
|
|
85
|
-
this._isHiding = false;
|
|
86
|
-
this._showTimeout = null;
|
|
87
|
-
this._hideTimeout = null;
|
|
85
|
+
this._isHiding = false;
|
|
86
|
+
this._showTimeout = null;
|
|
87
|
+
this._hideTimeout = null;
|
|
88
|
+
this._triggerObserver = null;
|
|
88
89
|
|
|
89
90
|
this._fixTitle();
|
|
90
91
|
|
|
91
|
-
this._handleUpdate = () => {
|
|
92
|
-
if (this.
|
|
93
|
-
this.
|
|
94
|
-
|
|
92
|
+
this._handleUpdate = () => {
|
|
93
|
+
if (!this._element?.isConnected) {
|
|
94
|
+
this.dispose();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (this._isShown()) {
|
|
99
|
+
this._setPlacement();
|
|
100
|
+
}
|
|
95
101
|
};
|
|
96
102
|
}
|
|
97
103
|
|
|
@@ -112,10 +118,14 @@ class VGTooltip extends BaseModule {
|
|
|
112
118
|
|
|
113
119
|
this._clearTimeouts();
|
|
114
120
|
|
|
115
|
-
this._showTimeout = setTimeout(() => {
|
|
116
|
-
this._showTimeout = null;
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
this._showTimeout = setTimeout(() => {
|
|
122
|
+
this._showTimeout = null;
|
|
123
|
+
if (!this._element?.isConnected) {
|
|
124
|
+
this.dispose();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const showEvent = EventHandler.trigger(this._element, EVENT_KEY_SHOW, { relatedTarget });
|
|
119
129
|
if (showEvent.defaultPrevented) return;
|
|
120
130
|
|
|
121
131
|
if (this._params.closeOther) {
|
|
@@ -129,10 +139,11 @@ class VGTooltip extends BaseModule {
|
|
|
129
139
|
|
|
130
140
|
this._tooltip.classList.remove(CLASS_NAME_SHOWN);
|
|
131
141
|
this._tooltip.classList.add(CLASS_NAME_SHOW);
|
|
132
|
-
this._element.classList.add(CLASS_NAME_SHOW);
|
|
133
|
-
document.body.classList.add(CLASS_NAME_OPEN);
|
|
134
|
-
|
|
135
|
-
this._addWindowListeners();
|
|
142
|
+
this._element.classList.add(CLASS_NAME_SHOW);
|
|
143
|
+
document.body.classList.add(CLASS_NAME_OPEN);
|
|
144
|
+
|
|
145
|
+
this._addWindowListeners();
|
|
146
|
+
this._observeTrigger();
|
|
136
147
|
|
|
137
148
|
requestAnimationFrame(() => {
|
|
138
149
|
if (!this._tooltip) return;
|
|
@@ -149,16 +160,20 @@ class VGTooltip extends BaseModule {
|
|
|
149
160
|
}, this._params.delay.show);
|
|
150
161
|
}
|
|
151
162
|
|
|
152
|
-
hide() {
|
|
153
|
-
if (!this._isShown() || this._isHiding || !this._tooltip) return;
|
|
154
|
-
|
|
155
|
-
this._clearTimeouts();
|
|
163
|
+
hide() {
|
|
164
|
+
if (!this._isShown() || this._isHiding || !this._tooltip) return;
|
|
165
|
+
|
|
166
|
+
this._clearTimeouts();
|
|
167
|
+
this._disconnectTriggerObserver();
|
|
156
168
|
|
|
157
169
|
this._hideTimeout = setTimeout(() => {
|
|
158
170
|
this._hideTimeout = null;
|
|
159
171
|
|
|
160
|
-
const hideEvent = EventHandler.trigger(this._element, EVENT_KEY_HIDE);
|
|
161
|
-
if (hideEvent.defaultPrevented)
|
|
172
|
+
const hideEvent = EventHandler.trigger(this._element, EVENT_KEY_HIDE);
|
|
173
|
+
if (hideEvent.defaultPrevented) {
|
|
174
|
+
this._observeTrigger();
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
162
177
|
|
|
163
178
|
this._removeWindowListeners();
|
|
164
179
|
|
|
@@ -185,21 +200,31 @@ class VGTooltip extends BaseModule {
|
|
|
185
200
|
}, this._params.delay.hide);
|
|
186
201
|
}
|
|
187
202
|
|
|
188
|
-
dispose() {
|
|
189
|
-
this._clearTimeouts();
|
|
190
|
-
this._removeWindowListeners();
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
this._tooltip
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
if (
|
|
199
|
-
this._element.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
+
dispose() {
|
|
204
|
+
this._clearTimeouts();
|
|
205
|
+
this._removeWindowListeners();
|
|
206
|
+
this._disconnectTriggerObserver();
|
|
207
|
+
|
|
208
|
+
if (this._tooltip) {
|
|
209
|
+
this._tooltip.remove();
|
|
210
|
+
this._tooltip = null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (this._element) {
|
|
214
|
+
this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_SHOWN);
|
|
215
|
+
this._element.removeAttribute('aria-describedby');
|
|
216
|
+
|
|
217
|
+
if (Object.prototype.hasOwnProperty.call(this._element.dataset, 'vgOriginalTitle')) {
|
|
218
|
+
this._element.setAttribute('title', this._element.dataset.vgOriginalTitle);
|
|
219
|
+
this._element.removeAttribute('data-vg-original-title');
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (!Selectors.find('.vg-tooltip.show')) {
|
|
224
|
+
document.body.classList.remove(CLASS_NAME_OPEN);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
super.dispose();
|
|
203
228
|
}
|
|
204
229
|
|
|
205
230
|
_isShown() {
|
|
@@ -280,10 +305,10 @@ class VGTooltip extends BaseModule {
|
|
|
280
305
|
);
|
|
281
306
|
}
|
|
282
307
|
|
|
283
|
-
_fixTitle() {
|
|
284
|
-
const title = this._element.getAttribute('title');
|
|
285
|
-
|
|
286
|
-
if (
|
|
308
|
+
_fixTitle() {
|
|
309
|
+
const title = this._element.getAttribute('title');
|
|
310
|
+
|
|
311
|
+
if (title === null) return;
|
|
287
312
|
|
|
288
313
|
this._element.setAttribute('data-vg-original-title', title);
|
|
289
314
|
this._element.removeAttribute('title');
|
|
@@ -382,17 +407,48 @@ class VGTooltip extends BaseModule {
|
|
|
382
407
|
}
|
|
383
408
|
}
|
|
384
409
|
|
|
385
|
-
_hideOpenedTooltips() {
|
|
386
|
-
Selectors.findAll('.vg-tooltip.show').forEach(tooltip => {
|
|
387
|
-
const id = tooltip.id;
|
|
388
|
-
const trigger = Selectors.find(`[aria-describedby="${id}"]`);
|
|
389
|
-
|
|
390
|
-
if (!trigger
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
410
|
+
_hideOpenedTooltips() {
|
|
411
|
+
Selectors.findAll('.vg-tooltip.show').forEach(tooltip => {
|
|
412
|
+
const id = tooltip.id;
|
|
413
|
+
const trigger = Selectors.find(`[aria-describedby="${id}"]`);
|
|
414
|
+
|
|
415
|
+
if (!trigger) {
|
|
416
|
+
tooltip.remove();
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
if (trigger === this._element) return;
|
|
421
|
+
|
|
422
|
+
const instance = VGTooltip.getInstance(trigger);
|
|
423
|
+
instance?.hide();
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
if (!Selectors.find('.vg-tooltip.show')) {
|
|
427
|
+
document.body.classList.remove(CLASS_NAME_OPEN);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
_observeTrigger() {
|
|
432
|
+
if (this._triggerObserver || !this._element?.isConnected) return;
|
|
433
|
+
|
|
434
|
+
this._triggerObserver = new MutationObserver(() => {
|
|
435
|
+
if (!this._element?.isConnected) {
|
|
436
|
+
this.dispose();
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
this._triggerObserver.observe(document.body, {
|
|
441
|
+
childList: true,
|
|
442
|
+
subtree: true
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
_disconnectTriggerObserver() {
|
|
447
|
+
if (!this._triggerObserver) return;
|
|
448
|
+
|
|
449
|
+
this._triggerObserver.disconnect();
|
|
450
|
+
this._triggerObserver = null;
|
|
451
|
+
}
|
|
396
452
|
|
|
397
453
|
_addWindowListeners() {
|
|
398
454
|
window.addEventListener('resize', this._handleUpdate);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
@use "../../../utils/scss" as vg;
|
|
2
|
-
|
|
3
|
-
$tooltip-map: (
|
|
4
|
-
zindex: 1080,
|
|
1
|
+
@use "../../../utils/scss" as vg;
|
|
2
|
+
|
|
3
|
+
$tooltip-map: (
|
|
4
|
+
zindex: 1080,
|
|
5
5
|
max-width: 260px,
|
|
6
6
|
padding: 8px 12px,
|
|
7
7
|
font-size: 13px,
|
|
8
8
|
line-height: 1.4,
|
|
9
|
-
color: var(--vg-text-inverse-color, #ffffff),
|
|
10
|
-
background: var(--vg-surface-inverse-bg, rgba(30, 30, 30, .95)),
|
|
11
|
-
border-radius: 6px,
|
|
12
|
-
box-shadow: 0 6px 20px var(--vg-shadow-soft-color, rgba(0, 0, 0, .18)),
|
|
9
|
+
color: var(--vg-text-inverse-color, #ffffff),
|
|
10
|
+
background: var(--vg-surface-inverse-bg, rgba(30, 30, 30, .95)),
|
|
11
|
+
border-radius: 6px,
|
|
12
|
+
box-shadow: 0 6px 20px var(--vg-shadow-soft-color, rgba(0, 0, 0, .18)),
|
|
13
13
|
word-break: break-word,
|
|
14
14
|
arrow-width: 8px,
|
|
15
15
|
arrow-height: 8px,
|
|
16
|
-
border-color: var(--vg-border-color, #{vg.$border-color}),
|
|
17
|
-
) !default;
|
|
16
|
+
border-color: var(--vg-border-color, #{vg.$border-color}),
|
|
17
|
+
) !default;
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*--------------------------------------------------------------------------
|
|
7
7
|
**/
|
|
8
8
|
|
|
9
|
-
@forward "variables";
|
|
10
|
-
@use "../../../utils/scss" as vg;
|
|
11
|
-
@use "variables" as vars;
|
|
9
|
+
@forward "variables";
|
|
10
|
+
@use "../../../utils/scss" as vg;
|
|
11
|
+
@use "variables" as vars;
|
|
12
12
|
|
|
13
13
|
.vg-tooltip {
|
|
14
|
-
@include vg.mix-vars('tooltip', vars.$tooltip-map);
|
|
14
|
+
@include vg.mix-vars('tooltip', vars.$tooltip-map);
|
|
15
15
|
position: absolute;
|
|
16
16
|
z-index: var(--vg-tooltip-zindex);
|
|
17
17
|
pointer-events: none;
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
}
|
|
63
|
+
}
|