vgapp 1.4.5 → 1.4.7

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 (123) hide show
  1. package/README.md +270 -270
  2. package/app/langs/en/buttons.json +17 -17
  3. package/app/langs/en/messages.json +36 -36
  4. package/app/langs/ru/buttons.json +17 -17
  5. package/app/langs/ru/messages.json +36 -36
  6. package/app/modules/vgalert/js/vgalert.js +266 -266
  7. package/app/modules/vgalert/scss/_variables.scss +16 -16
  8. package/app/modules/vgalert/scss/vgalert.scss +107 -107
  9. package/app/modules/vgcollapse/scss/_variables.scss +7 -7
  10. package/app/modules/vgcollapse/scss/vgcollapse.scss +5 -5
  11. package/app/modules/vgdropdown/scss/_variables.scss +14 -14
  12. package/app/modules/vgdropdown/scss/vgdropdown.scss +5 -5
  13. package/app/modules/vgdynamictable/index.js +4 -4
  14. package/app/modules/vgdynamictable/js/filters.js +21 -21
  15. package/app/modules/vgdynamictable/js/fixed.js +179 -179
  16. package/app/modules/vgdynamictable/js/options.js +3 -3
  17. package/app/modules/vgdynamictable/js/pagination.js +1 -1
  18. package/app/modules/vgdynamictable/js/search.js +12 -12
  19. package/app/modules/vgdynamictable/js/skeleton.js +27 -19
  20. package/app/modules/vgdynamictable/js/sortable.js +71 -71
  21. package/app/modules/vgdynamictable/js/summary-footer.js +28 -28
  22. package/app/modules/vgdynamictable/js/table-url-state.js +31 -31
  23. package/app/modules/vgdynamictable/js/utils/common.js +48 -48
  24. package/app/modules/vgdynamictable/js/vgdynamictable.js +79 -79
  25. package/app/modules/vgdynamictable/scss/_actions.scss +19 -19
  26. package/app/modules/vgdynamictable/scss/_pagination.scss +5 -5
  27. package/app/modules/vgdynamictable/scss/_skeleton.scss +11 -11
  28. package/app/modules/vgdynamictable/scss/_sortable.scss +28 -28
  29. package/app/modules/vgdynamictable/scss/_table.scss +7 -30
  30. package/app/modules/vgdynamictable/scss/_variables.scss +46 -46
  31. package/app/modules/vgdynamictable/scss/vgdynamictable.scss +27 -37
  32. package/app/modules/vgfilepreview/js/i18n.js +56 -56
  33. package/app/modules/vgfilepreview/js/renderers/image-modal.js +145 -145
  34. package/app/modules/vgfilepreview/js/renderers/image.js +92 -92
  35. package/app/modules/vgfilepreview/js/renderers/index.js +19 -19
  36. package/app/modules/vgfilepreview/js/renderers/office-modal.js +168 -168
  37. package/app/modules/vgfilepreview/js/renderers/office.js +79 -79
  38. package/app/modules/vgfilepreview/js/renderers/pdf-modal.js +260 -260
  39. package/app/modules/vgfilepreview/js/renderers/pdf.js +76 -76
  40. package/app/modules/vgfilepreview/js/renderers/playlist.js +71 -71
  41. package/app/modules/vgfilepreview/js/renderers/text-modal.js +343 -343
  42. package/app/modules/vgfilepreview/js/renderers/text.js +83 -83
  43. package/app/modules/vgfilepreview/js/renderers/video-modal.js +272 -272
  44. package/app/modules/vgfilepreview/js/renderers/video.js +80 -80
  45. package/app/modules/vgfilepreview/js/renderers/zip-modal.js +522 -522
  46. package/app/modules/vgfilepreview/js/renderers/zip.js +89 -89
  47. package/app/modules/vgfilepreview/js/vgfilepreview.js +7 -7
  48. package/app/modules/vgfilepreview/readme.md +68 -68
  49. package/app/modules/vgfilepreview/scss/_variables.scss +115 -115
  50. package/app/modules/vgfilepreview/scss/vgfilepreview.scss +463 -463
  51. package/app/modules/vgfiles/js/droppable.js +20 -9
  52. package/app/modules/vgfiles/js/render.js +153 -153
  53. package/app/modules/vgfiles/js/vgfiles.js +104 -104
  54. package/app/modules/vgfiles/readme.md +123 -123
  55. package/app/modules/vgfiles/scss/_mixins.scss +9 -9
  56. package/app/modules/vgfiles/scss/_variables.scss +41 -41
  57. package/app/modules/vgfiles/scss/vgfiles.scss +161 -161
  58. package/app/modules/vgformsender/js/hideshowpass.js +22 -22
  59. package/app/modules/vgformsender/js/vgformsender.js +7 -7
  60. package/app/modules/vgformsender/readme.md +1 -1
  61. package/app/modules/vgformsender/scss/_variables.scss +5 -5
  62. package/app/modules/vgformsender/scss/vgformsender.scss +42 -42
  63. package/app/modules/vglawcookie/js/vglawcookie.js +19 -19
  64. package/app/modules/vglawcookie/scss/_variables.scss +13 -13
  65. package/app/modules/vglawcookie/scss/vglawcookie.scss +5 -5
  66. package/app/modules/vgmodal/js/vgmodal.interaction.js +216 -216
  67. package/app/modules/vgmodal/js/vgmodal.js +355 -355
  68. package/app/modules/vgmodal/js/vgmodal.minimized.js +227 -227
  69. package/app/modules/vgmodal/scss/_variables.scss +17 -17
  70. package/app/modules/vgmodal/scss/vgmodal.scss +77 -77
  71. package/app/modules/vgnav/js/vgnav.js +180 -180
  72. package/app/modules/vgnav/scss/_breakpoints.scss +36 -36
  73. package/app/modules/vgnav/scss/_hamburger.scss +5 -5
  74. package/app/modules/vgnav/scss/_placement.scss +5 -5
  75. package/app/modules/vgnav/scss/_toggle.scss +5 -5
  76. package/app/modules/vgnav/scss/_variables.scss +26 -26
  77. package/app/modules/vgnav/scss/vgnav.scss +41 -41
  78. package/app/modules/vgnestable/README.md +39 -39
  79. package/app/modules/vgnestable/js/vgnestable.js +358 -358
  80. package/app/modules/vgnestable/scss/_variables.scss +35 -35
  81. package/app/modules/vgnestable/scss/vgnestable.scss +55 -55
  82. package/app/modules/vgrangeslider/js/skins.js +222 -222
  83. package/app/modules/vgrangeslider/js/vgrangeslider.js +704 -704
  84. package/app/modules/vgrangeslider/scss/_variables.scss +55 -55
  85. package/app/modules/vgrangeslider/scss/vgrangeslider.scss +239 -239
  86. package/app/modules/vgrollup/scss/_variables.scss +15 -15
  87. package/app/modules/vgrollup/scss/vgrollup.scss +6 -6
  88. package/app/modules/vgselect/js/vgselect.js +129 -129
  89. package/app/modules/vgselect/readme.md +11 -11
  90. package/app/modules/vgselect/scss/_variables.scss +50 -50
  91. package/app/modules/vgselect/scss/vgselect.scss +48 -48
  92. package/app/modules/vgsidebar/js/vgsidebar.js +79 -79
  93. package/app/modules/vgsidebar/scss/_variables.scss +10 -10
  94. package/app/modules/vgsidebar/scss/vgsidebar.scss +5 -5
  95. package/app/modules/vgtabs/scss/_variables.scss +23 -23
  96. package/app/modules/vgtabs/scss/vgtabs.scss +5 -5
  97. package/app/modules/vgtoast/scss/_variables.scss +13 -13
  98. package/app/modules/vgtoast/scss/vgtoast.scss +5 -5
  99. package/app/modules/vgtooltip/js/vgtooltip.js +108 -51
  100. package/app/modules/vgtooltip/scss/_variables.scss +10 -10
  101. package/app/modules/vgtooltip/scss/vgtooltip.scss +5 -5
  102. package/app/utils/js/components/audio-metadata.js +240 -240
  103. package/app/utils/js/components/backdrop.js +116 -116
  104. package/app/utils/js/components/file-icon.js +109 -109
  105. package/app/utils/js/components/file-preview.js +304 -304
  106. package/app/utils/js/components/sanitize.js +150 -150
  107. package/app/utils/js/components/video-metadata.js +140 -140
  108. package/app/utils/scss/_backdrop.scss +5 -5
  109. package/app/utils/scss/_theme-default.scss +12 -12
  110. package/app/utils/scss/_theme.scss +7 -7
  111. package/app/utils/scss/_tokens.scss +170 -170
  112. package/app/utils/scss/default.scss +9 -9
  113. package/app/utils/scss/functions.scss +21 -21
  114. package/app/utils/scss/index.scss +4 -4
  115. package/app/utils/scss/mixin.scss +16 -16
  116. package/app/utils/scss/variables.scss +105 -105
  117. package/app/vgapp.js +295 -295
  118. package/build/vgapp.css +1 -1
  119. package/build/vgapp.css.map +1 -1
  120. package/build/vgapp.js +1 -1
  121. package/build/vgapp.js.map +1 -1
  122. package/index.scss +20 -20
  123. 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._isShown()) {
93
- this._setPlacement();
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
- const showEvent = EventHandler.trigger(this._element, EVENT_KEY_SHOW, { relatedTarget });
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,21 @@ 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
+ this._clearTimeouts();
165
+
166
+ if (!this._isShown() || this._isHiding || !this._tooltip) return;
167
+
168
+ this._disconnectTriggerObserver();
156
169
 
157
170
  this._hideTimeout = setTimeout(() => {
158
171
  this._hideTimeout = null;
159
172
 
160
- const hideEvent = EventHandler.trigger(this._element, EVENT_KEY_HIDE);
161
- if (hideEvent.defaultPrevented) return;
173
+ const hideEvent = EventHandler.trigger(this._element, EVENT_KEY_HIDE);
174
+ if (hideEvent.defaultPrevented) {
175
+ this._observeTrigger();
176
+ return;
177
+ }
162
178
 
163
179
  this._removeWindowListeners();
164
180
 
@@ -185,21 +201,31 @@ class VGTooltip extends BaseModule {
185
201
  }, this._params.delay.hide);
186
202
  }
187
203
 
188
- dispose() {
189
- this._clearTimeouts();
190
- this._removeWindowListeners();
191
-
192
- if (this._tooltip) {
193
- this._tooltip.remove();
194
- this._tooltip = null;
195
- }
196
-
197
- const originalTitle = this._element.dataset.vgOriginalTitle;
198
- if (originalTitle) {
199
- this._element.setAttribute('title', originalTitle);
200
- }
201
-
202
- super.dispose();
204
+ dispose() {
205
+ this._clearTimeouts();
206
+ this._removeWindowListeners();
207
+ this._disconnectTriggerObserver();
208
+
209
+ if (this._tooltip) {
210
+ this._tooltip.remove();
211
+ this._tooltip = null;
212
+ }
213
+
214
+ if (this._element) {
215
+ this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_SHOWN);
216
+ this._element.removeAttribute('aria-describedby');
217
+
218
+ if (Object.prototype.hasOwnProperty.call(this._element.dataset, 'vgOriginalTitle')) {
219
+ this._element.setAttribute('title', this._element.dataset.vgOriginalTitle);
220
+ this._element.removeAttribute('data-vg-original-title');
221
+ }
222
+ }
223
+
224
+ if (!Selectors.find('.vg-tooltip.show')) {
225
+ document.body.classList.remove(CLASS_NAME_OPEN);
226
+ }
227
+
228
+ super.dispose();
203
229
  }
204
230
 
205
231
  _isShown() {
@@ -280,10 +306,10 @@ class VGTooltip extends BaseModule {
280
306
  );
281
307
  }
282
308
 
283
- _fixTitle() {
284
- const title = this._element.getAttribute('title');
285
-
286
- if (!title) return;
309
+ _fixTitle() {
310
+ const title = this._element.getAttribute('title');
311
+
312
+ if (title === null) return;
287
313
 
288
314
  this._element.setAttribute('data-vg-original-title', title);
289
315
  this._element.removeAttribute('title');
@@ -382,17 +408,48 @@ class VGTooltip extends BaseModule {
382
408
  }
383
409
  }
384
410
 
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 || trigger === this._element) return;
391
-
392
- const instance = VGTooltip.getInstance(trigger);
393
- instance?.hide();
394
- });
395
- }
411
+ _hideOpenedTooltips() {
412
+ Selectors.findAll('.vg-tooltip.show').forEach(tooltip => {
413
+ const id = tooltip.id;
414
+ const trigger = Selectors.find(`[aria-describedby="${id}"]`);
415
+
416
+ if (!trigger) {
417
+ tooltip.remove();
418
+ return;
419
+ }
420
+
421
+ if (trigger === this._element) return;
422
+
423
+ const instance = VGTooltip.getInstance(trigger);
424
+ instance?.hide();
425
+ });
426
+
427
+ if (!Selectors.find('.vg-tooltip.show')) {
428
+ document.body.classList.remove(CLASS_NAME_OPEN);
429
+ }
430
+ }
431
+
432
+ _observeTrigger() {
433
+ if (this._triggerObserver || !this._element?.isConnected) return;
434
+
435
+ this._triggerObserver = new MutationObserver(() => {
436
+ if (!this._element?.isConnected) {
437
+ this.dispose();
438
+ }
439
+ });
440
+
441
+ this._triggerObserver.observe(document.body, {
442
+ childList: true,
443
+ subtree: true
444
+ });
445
+ }
446
+
447
+ _disconnectTriggerObserver() {
448
+ if (!this._triggerObserver) return;
449
+
450
+ this._triggerObserver.disconnect();
451
+ this._triggerObserver = null;
452
+ }
396
453
 
397
454
  _addWindowListeners() {
398
455
  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
+ }