vgapp 1.2.2 → 1.2.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/README.md +48 -48
  3. package/app/langs/en/buttons.json +17 -17
  4. package/app/langs/en/messages.json +36 -36
  5. package/app/langs/ru/buttons.json +17 -17
  6. package/app/langs/ru/messages.json +36 -36
  7. package/app/modules/vgfilepreview/js/i18n.js +56 -56
  8. package/app/modules/vgfilepreview/js/renderers/image-modal.js +145 -145
  9. package/app/modules/vgfilepreview/js/renderers/image.js +92 -92
  10. package/app/modules/vgfilepreview/js/renderers/index.js +19 -19
  11. package/app/modules/vgfilepreview/js/renderers/office-modal.js +168 -168
  12. package/app/modules/vgfilepreview/js/renderers/office.js +79 -79
  13. package/app/modules/vgfilepreview/js/renderers/pdf-modal.js +260 -260
  14. package/app/modules/vgfilepreview/js/renderers/pdf.js +76 -76
  15. package/app/modules/vgfilepreview/js/renderers/playlist.js +71 -71
  16. package/app/modules/vgfilepreview/js/renderers/text-modal.js +343 -343
  17. package/app/modules/vgfilepreview/js/renderers/text.js +83 -83
  18. package/app/modules/vgfilepreview/js/renderers/video-modal.js +272 -272
  19. package/app/modules/vgfilepreview/js/renderers/video.js +80 -80
  20. package/app/modules/vgfilepreview/js/renderers/zip-modal.js +522 -522
  21. package/app/modules/vgfilepreview/js/renderers/zip.js +89 -89
  22. package/app/modules/vgfilepreview/js/vgfilepreview.js +7 -7
  23. package/app/modules/vgfilepreview/readme.md +68 -68
  24. package/app/modules/vgfilepreview/scss/_variables.scss +113 -113
  25. package/app/modules/vgfilepreview/scss/vgfilepreview.scss +464 -464
  26. package/app/modules/vgfiles/js/base.js +26 -26
  27. package/app/modules/vgfiles/js/droppable.js +260 -260
  28. package/app/modules/vgfiles/js/render.js +153 -153
  29. package/app/modules/vgfiles/js/vgfiles.js +104 -104
  30. package/app/modules/vgfiles/readme.md +123 -123
  31. package/app/modules/vgfiles/scss/_variables.scss +18 -18
  32. package/app/modules/vgfiles/scss/vgfiles.scss +148 -148
  33. package/app/modules/vgformsender/js/hideshowpass.js +16 -16
  34. package/app/modules/vgformsender/js/vgformsender.js +144 -144
  35. package/app/modules/vgformsender/scss/vgformsender.scss +34 -34
  36. package/app/modules/vgmodal/js/vgmodal.drag.js +332 -332
  37. package/app/modules/vgmodal/js/vgmodal.js +1 -1
  38. package/app/modules/vgmodal/js/vgmodal.resize.js +435 -435
  39. package/app/modules/vgnav/js/vgnav.js +135 -135
  40. package/app/modules/vgnav/readme.md +67 -67
  41. package/app/modules/vgnestable/README.md +307 -307
  42. package/app/modules/vgnestable/scss/_variables.scss +60 -60
  43. package/app/modules/vgnestable/scss/vgnestable.scss +163 -163
  44. package/app/modules/vgselect/js/vgselect.js +39 -39
  45. package/app/modules/vgselect/scss/vgselect.scss +22 -22
  46. package/app/modules/vgspy/readme.md +28 -28
  47. package/app/modules/vgtoast/js/vgtoast.js +166 -135
  48. package/app/modules/vgtoast/readme.md +18 -18
  49. package/app/modules/vgtoast/scss/vgtoast.scss +48 -48
  50. package/app/utils/js/components/audio-metadata.js +240 -240
  51. package/app/utils/js/components/file-icon.js +109 -109
  52. package/app/utils/js/components/file-preview.js +304 -304
  53. package/app/utils/js/components/sanitize.js +150 -150
  54. package/app/utils/js/components/video-metadata.js +140 -140
  55. package/build/vgapp.css +1 -1
  56. package/build/vgapp.css.map +1 -1
  57. package/build/vgapp.js.map +1 -1
  58. package/index.scss +9 -9
  59. package/package.json +1 -1
@@ -47,10 +47,10 @@
47
47
  |--------|------|-------------|----------|
48
48
  | `offset` | `number` | `null` | *(устарело)* Смещение активации (в пикселях). Используйте `rootMargin` вместо этого. |
49
49
  | `rootMargin` | `string` | `'0px 0px -25%'` | Отступы для `IntersectionObserver`. Управляет, насколько "внутрь" должна зайти секция, чтобы стать активной. |
50
- | `smoothScroll` | `boolean` | `true` | Включить плавную прокрутку при клике на якорные ссылки. |
51
- | `target` | `HTMLElement \| string` | элемент с `data-vg-toggle="spy"` | Контейнер, внутри которого происходит прокрутка. Если не указан — используется `window`. |
52
- | `scrollbar` | `Object \| null` | `null` | Инстанс `smooth-scrollbar` или Scrollbar API (если `smooth-scrollbar` импортирован как модуль и не лежит в `window.Scrollbar`). |
53
- | `threshold` | `number[] \| string` | `[0.1, 0.5, 1]` | Пороги видимости (от 0 до 1), при которых срабатывает активация. Можно передать строку: `'0.1, 0.5, 1'`. |
50
+ | `smoothScroll` | `boolean` | `true` | Включить плавную прокрутку при клике на якорные ссылки. |
51
+ | `target` | `HTMLElement \| string` | элемент с `data-vg-toggle="spy"` | Контейнер, внутри которого происходит прокрутка. Если не указан — используется `window`. |
52
+ | `scrollbar` | `Object \| null` | `null` | Инстанс `smooth-scrollbar` или Scrollbar API (если `smooth-scrollbar` импортирован как модуль и не лежит в `window.Scrollbar`). |
53
+ | `threshold` | `number[] \| string` | `[0.1, 0.5, 1]` | Пороги видимости (от 0 до 1), при которых срабатывает активация. Можно передать строку: `'0.1, 0.5, 1'`. |
54
54
 
55
55
  ---
56
56
 
@@ -86,29 +86,29 @@
86
86
 
87
87
  ---
88
88
 
89
- ## 📚 Заметки
90
-
91
- - Убедитесь, что все целевые секции имеют `id`, соответствующий `href` ссылки.
92
- - Секции должны быть видимы (`display: block`, `visibility: visible`).
93
- - Работает с динамически добавленным контентом, но требует вызова `refresh()` после вставки.
94
- - Если прокрутка виртуальная (например, `smooth-scrollbar`), передайте `target` как контейнер, на который был инициализирован `smooth-scrollbar`, и при модульном импорте также передайте `scrollbar`.
95
-
96
- Пример (модульный импорт `smooth-scrollbar`):
97
-
98
- ```js
99
- import Scrollbar from 'smooth-scrollbar';
100
- import VGSpy from './app/modules/vgspy';
101
-
102
- const scrollRoot = document.querySelector('.my-scroll-root');
103
- Scrollbar.init(scrollRoot);
104
-
105
- VGSpy.getOrCreateInstance(document.querySelector('[data-vg-toggle="spy"]'), {
106
- target: scrollRoot,
107
- scrollbar: Scrollbar,
108
- });
109
- ```
110
-
111
- ---
89
+ ## 📚 Заметки
90
+
91
+ - Убедитесь, что все целевые секции имеют `id`, соответствующий `href` ссылки.
92
+ - Секции должны быть видимы (`display: block`, `visibility: visible`).
93
+ - Работает с динамически добавленным контентом, но требует вызова `refresh()` после вставки.
94
+ - Если прокрутка виртуальная (например, `smooth-scrollbar`), передайте `target` как контейнер, на который был инициализирован `smooth-scrollbar`, и при модульном импорте также передайте `scrollbar`.
95
+
96
+ Пример (модульный импорт `smooth-scrollbar`):
97
+
98
+ ```js
99
+ import Scrollbar from 'smooth-scrollbar';
100
+ import VGSpy from './app/modules/vgspy';
101
+
102
+ const scrollRoot = document.querySelector('.my-scroll-root');
103
+ Scrollbar.init(scrollRoot);
104
+
105
+ VGSpy.getOrCreateInstance(document.querySelector('[data-vg-toggle="spy"]'), {
106
+ target: scrollRoot,
107
+ scrollbar: Scrollbar,
108
+ });
109
+ ```
110
+
111
+ ---
112
112
 
113
113
 
114
114
  ## 📝 Лицензия
@@ -119,4 +119,4 @@ MIT. Свободно использовать и модифицировать.
119
119
 
120
120
  📌 *Разработано в рамках фронтенд-системы VG Modules.*
121
121
  > 🚀 Автор: VEGAS STUDIO (vegas-dev.com)
122
- > 📍 Поддерживается в проектах VEGAS
122
+ > 📍 Поддерживается в проектах VEGAS
@@ -1,11 +1,11 @@
1
1
  import BaseModule from "../../base-module";
2
- import EventHandler from "../../../utils/js/dom/event";
3
- import {dismissTrigger, getSVG} from "../../module-fn";
4
- import Sanitize from "../../../utils/js/components/sanitize";
5
- import {execute, isDisabled, makeRandomString, mergeDeepObject} from "../../../utils/js/functions";
6
- import Selectors from "../../../utils/js/dom/selectors";
7
- import VGToastDrag from "./vgtoast.drag";
8
- import VGToastResize from "./vgtoast.resize";
2
+ import EventHandler from "../../../utils/js/dom/event";
3
+ import {dismissTrigger, getSVG} from "../../module-fn";
4
+ import Sanitize from "../../../utils/js/components/sanitize";
5
+ import {execute, isDisabled, makeRandomString, mergeDeepObject} from "../../../utils/js/functions";
6
+ import Selectors from "../../../utils/js/dom/selectors";
7
+ import VGToastDrag from "./vgtoast.drag";
8
+ import VGToastResize from "./vgtoast.resize";
9
9
 
10
10
  /**
11
11
  * @constant {string} NAME - Имя модуля.
@@ -55,15 +55,15 @@ const EVENT_KEY_LOADED = `${NAME_KEY}.loaded`;
55
55
  const EVENT_KEY_KEYDOWN_DISMISS = `keydown.dismiss.${NAME_KEY}`;
56
56
  const EVENT_KEY_HIDE_PREVENTED = `hidePrevented.${NAME_KEY}`;
57
57
  const EVENT_KEY_CLICK_DATA_API = `click.${NAME_KEY}.data.api`;
58
- const EVENT_KEY_POINTERDOWN_INTERACTION = `pointerdown.interaction.${NAME_KEY}`;
59
- const EVENT_KEY_POINTERUP_INTERACTION = `pointerup.interaction.${NAME_KEY}`;
60
- const EVENT_KEY_POINTERCANCEL_INTERACTION = `pointercancel.interaction.${NAME_KEY}`;
61
- const TOAST_ICON_MAP = {
62
- success: 'success',
63
- error: 'danger',
64
- warning: 'warning',
65
- info: 'info',
66
- };
58
+ const EVENT_KEY_POINTERDOWN_INTERACTION = `pointerdown.interaction.${NAME_KEY}`;
59
+ const EVENT_KEY_POINTERUP_INTERACTION = `pointerup.interaction.${NAME_KEY}`;
60
+ const EVENT_KEY_POINTERCANCEL_INTERACTION = `pointercancel.interaction.${NAME_KEY}`;
61
+ const TOAST_ICON_MAP = {
62
+ success: 'success',
63
+ error: 'danger',
64
+ warning: 'warning',
65
+ info: 'info',
66
+ };
67
67
 
68
68
  /**
69
69
  * @typedef {Object} ToastParams
@@ -72,13 +72,13 @@ const TOAST_ICON_MAP = {
72
72
  * @property {boolean} autohide - Автоматически скрывать.
73
73
  * @property {number} delay - Задержка перед авто-скрытием (мс).
74
74
  * @property {boolean} enableClickToast - Закрывать по клику на тост.
75
- * @property {boolean} enableButtonClose - Добавить кнопку закрытия.
76
- * @property {boolean} keyboard - Закрывать по Esc.
77
- * @property {string} theme - Тема: 'dark', 'light' и т.д.
78
- * @property {('success'|'error'|'warning'|'info'|null)} type - Тип уведомления для вывода иконки.
79
- * @property {Object} stack - Настройки стека уведомлений.
80
- * @property {boolean} stack.enable - Разрешить стек.
81
- * @property {number} stack.max - Макс. количество тостов одновременно.
75
+ * @property {boolean} enableButtonClose - Добавить кнопку закрытия.
76
+ * @property {boolean} keyboard - Закрывать по Esc.
77
+ * @property {string} theme - Тема: 'dark', 'light' и т.д.
78
+ * @property {('success'|'error'|'warning'|'info'|null)} type - Тип уведомления для вывода иконки.
79
+ * @property {Object} stack - Настройки стека уведомлений.
80
+ * @property {boolean} stack.enable - Разрешить стек.
81
+ * @property {number} stack.max - Макс. количество тостов одновременно.
82
82
  * @property {Object} animation - Анимация.
83
83
  * @property {boolean} animation.enable - Включить анимацию.
84
84
  * @property {string} animation.in - Анимация входа (Animate.css).
@@ -104,13 +104,13 @@ const defaultParams = {
104
104
  autohide: false,
105
105
  delay: 3000,
106
106
  enableClickToast: true,
107
- enableButtonClose: false,
108
- keyboard: true,
109
- theme: 'dark',
110
- type: null,
111
- stack: {
112
- enable: true,
113
- max: 5
107
+ enableButtonClose: false,
108
+ keyboard: true,
109
+ theme: 'dark',
110
+ type: null,
111
+ stack: {
112
+ enable: true,
113
+ max: 5
114
114
  },
115
115
  drag: {
116
116
  enable: false,
@@ -184,9 +184,11 @@ class VGToast extends BaseModule {
184
184
  this._dismissElement();
185
185
  this._addEventListeners();
186
186
 
187
- /** @private */
188
- this._timeout = null;
189
- }
187
+ /** @private */
188
+ this._timeout = null;
189
+ this._hideTimeout = null;
190
+ this._isHiding = false;
191
+ }
190
192
 
191
193
  /**
192
194
  * Имя модуля
@@ -248,24 +250,24 @@ class VGToast extends BaseModule {
248
250
  const wrapper = document.createElement('div');
249
251
  wrapper.classList.add('vg-toast-wrapper');
250
252
 
251
- // Иконка (если задан тип)
252
- if (params.type) {
253
- const iconName = TOAST_ICON_MAP[params.type];
254
- const iconSvg = iconName ? getSVG(iconName) : '';
255
-
256
- if (iconSvg) {
257
- const icon = document.createElement('div');
258
- icon.classList.add('vg-toast-icon');
259
- const safeIconSvg = Sanitize.toSafeHtmlString(iconSvg);
260
- const fragment = document.createRange().createContextualFragment(safeIconSvg);
261
- const svgElement = fragment.firstElementChild;
262
-
263
- if (svgElement) {
264
- icon.append(svgElement);
265
- }
266
- wrapper.append(icon);
267
- }
268
- }
253
+ // Иконка (если задан тип)
254
+ if (params.type) {
255
+ const iconName = TOAST_ICON_MAP[params.type];
256
+ const iconSvg = iconName ? getSVG(iconName) : '';
257
+
258
+ if (iconSvg) {
259
+ const icon = document.createElement('div');
260
+ icon.classList.add('vg-toast-icon');
261
+ const safeIconSvg = Sanitize.toSafeHtmlString(iconSvg);
262
+ const fragment = document.createRange().createContextualFragment(safeIconSvg);
263
+ const svgElement = fragment.firstElementChild;
264
+
265
+ if (svgElement) {
266
+ icon.append(svgElement);
267
+ }
268
+ wrapper.append(icon);
269
+ }
270
+ }
269
271
 
270
272
  const content = document.createElement('div');
271
273
  content.classList.add('vg-toast-content');
@@ -289,14 +291,14 @@ class VGToast extends BaseModule {
289
291
 
290
292
  wrapper.append(content);
291
293
 
292
- // Кнопка закрытия
293
- if (params.enableButtonClose) {
294
- target.classList.add('vg-toast-has-button');
295
- const button = document.createElement('div');
296
- button.classList.add('vg-toast-button');
297
- button.innerHTML = '<button class="vg-btn-close" data-vg-dismiss="toast"></button>';
298
- wrapper.append(button);
299
- }
294
+ // Кнопка закрытия
295
+ if (params.enableButtonClose) {
296
+ target.classList.add('vg-toast-has-button');
297
+ const button = document.createElement('div');
298
+ button.classList.add('vg-toast-button');
299
+ button.innerHTML = '<button class="vg-btn-close" data-vg-dismiss="toast"></button>';
300
+ wrapper.append(button);
301
+ }
300
302
 
301
303
  target.append(wrapper);
302
304
  document.body.append(target);
@@ -327,83 +329,105 @@ class VGToast extends BaseModule {
327
329
  * @param {Element} [relatedTarget] - Элемент, инициировавший показ.
328
330
  * @returns {void}
329
331
  */
330
- show(relatedTarget) {
331
- if (isDisabled(this._element)) return;
332
-
333
- this._clearTimeout();
334
- this._disableInteractionHandlers();
335
-
336
- this._params = this._getParams(relatedTarget || {}, this._params);
337
- this._route((status, data) => {
338
- EventHandler.trigger(this._element, EVENT_KEY_LOADED, { stats: status, data });
339
- });
340
-
341
- const showEvent = EventHandler.trigger(this._element, EVENT_KEY_SHOW, { relatedTarget });
342
- if (showEvent.defaultPrevented) return;
343
-
344
- this._element.classList.remove(CLASS_NAME_SHOWN);
345
- this._element.classList.add(CLASS_NAME_SHOW);
346
- document.body.classList.add(CLASS_NAME_OPEN);
347
-
348
- this._setPlacement();
349
-
350
- const completeCallBack = () => {
351
- this._element.classList.add(CLASS_NAME_SHOWN);
352
- this._toggleInteractionHandlers();
353
- this._syncInteractiveBounds();
354
- this._scheduleHide();
355
- EventHandler.trigger(this._element, EVENT_KEY_SHOWN, { relatedTarget });
356
- };
357
-
358
- this._queueCallback(completeCallBack, this._element, true, this._params.animation.delay);
359
- }
332
+ show(relatedTarget) {
333
+ if (isDisabled(this._element)) return;
334
+
335
+ const element = this._element;
336
+ this._clearTimeout();
337
+ this._clearHideTimeout();
338
+ this._isHiding = false;
339
+ this._disableInteractionHandlers();
340
+
341
+ this._params = this._getParams(relatedTarget || {}, this._params);
342
+ this._route((status, data) => {
343
+ if (this._element !== element) return;
344
+ EventHandler.trigger(element, EVENT_KEY_LOADED, { stats: status, data });
345
+ });
346
+
347
+ const showEvent = EventHandler.trigger(element, EVENT_KEY_SHOW, { relatedTarget });
348
+ if (showEvent.defaultPrevented) return;
349
+
350
+ element.classList.remove(CLASS_NAME_SHOWN);
351
+ element.classList.add(CLASS_NAME_SHOW);
352
+ document.body.classList.add(CLASS_NAME_OPEN);
353
+
354
+ this._setPlacement();
355
+
356
+ const completeCallBack = () => {
357
+ if (this._element !== element || this._isHiding) return;
358
+
359
+ element.classList.add(CLASS_NAME_SHOWN);
360
+ this._toggleInteractionHandlers();
361
+ this._syncInteractiveBounds();
362
+ this._scheduleHide();
363
+ EventHandler.trigger(element, EVENT_KEY_SHOWN, { relatedTarget });
364
+ };
365
+
366
+ this._queueCallback(completeCallBack, element, true, this._params.animation.delay);
367
+ }
360
368
 
361
369
  /**
362
370
  * Скрывает тост
363
371
  * @returns {void}
364
372
  */
365
- hide() {
366
- if (isDisabled(this._element)) return;
367
- this._clearTimeout();
368
-
369
- const hideEvent = EventHandler.trigger(this._element, EVENT_KEY_HIDE);
370
- if (hideEvent.defaultPrevented) return;
371
-
372
- this._element.classList.remove(CLASS_NAME_SHOWN);
373
- this._disableInteractionHandlers();
374
-
375
- setTimeout(() => {
376
- this._element.classList.remove(CLASS_NAME_SHOW);
377
- if (this._params.stack.enable) {
378
- this._setPlacement();
379
- }
380
-
381
- const completeCallback = () => {
382
- if (!Selectors.find('.vg-toast.show')) {
383
- document.body.classList.remove(CLASS_NAME_OPEN);
384
- }
385
- EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
386
-
387
- if (!this._params.static) {
388
- this.dispose();
389
- }
390
- };
391
-
392
- this._queueCallback(completeCallback, this._element, false, this._params.animation.delay);
393
- }, this._params.animation.delay);
394
- }
373
+ hide() {
374
+ if (isDisabled(this._element) || this._isHiding) return;
375
+
376
+ const element = this._element;
377
+ this._clearTimeout();
378
+ this._clearHideTimeout();
379
+
380
+ const hideEvent = EventHandler.trigger(element, EVENT_KEY_HIDE);
381
+ if (hideEvent.defaultPrevented) return;
382
+
383
+ this._isHiding = true;
384
+ element.classList.remove(CLASS_NAME_SHOWN);
385
+ this._disableInteractionHandlers();
386
+
387
+ this._hideTimeout = setTimeout(() => {
388
+ this._hideTimeout = null;
389
+ if (this._element !== element) return;
390
+
391
+ element.classList.remove(CLASS_NAME_SHOW);
392
+ if (this._params.stack.enable) {
393
+ this._setPlacement();
394
+ }
395
+
396
+ const completeCallback = () => {
397
+ if (this._element !== element) return;
398
+
399
+ if (!Selectors.find('.vg-toast.show')) {
400
+ document.body.classList.remove(CLASS_NAME_OPEN);
401
+ }
402
+
403
+ const shouldDispose = !this._params.static;
404
+ this._isHiding = false;
405
+ EventHandler.trigger(element, EVENT_KEY_HIDDEN);
406
+
407
+ if (this._element !== element) return;
408
+ if (shouldDispose) {
409
+ this.dispose();
410
+ }
411
+ };
412
+
413
+ this._queueCallback(completeCallback, element, false, this._params.animation.delay);
414
+ }, this._params.animation.delay);
415
+ }
395
416
 
396
417
  /**
397
418
  * Удаляет тост из DOM и снимает обработчики
398
419
  * @override
399
420
  */
400
- dispose() {
401
- this._clearTimeout();
402
- this._disableInteractionHandlers();
403
- if (!this._params.static) {
404
- this._element.remove();
405
- }
406
- super.dispose();
421
+ dispose() {
422
+ if (!this._element) return;
423
+
424
+ this._clearTimeout();
425
+ this._clearHideTimeout();
426
+ this._disableInteractionHandlers();
427
+ if (!this._params.static) {
428
+ this._element.remove();
429
+ }
430
+ super.dispose();
407
431
  }
408
432
 
409
433
  /**
@@ -422,9 +446,9 @@ class VGToast extends BaseModule {
422
446
  * @private
423
447
  * @returns {boolean}
424
448
  */
425
- _isShown() {
426
- return this._element.classList.contains(CLASS_NAME_SHOW);
427
- }
449
+ _isShown() {
450
+ return !!this._element && this._element.classList.contains(CLASS_NAME_SHOW);
451
+ }
428
452
 
429
453
  /**
430
454
  * Возвращает список активных тостов с вертикальными смещениями
@@ -617,12 +641,19 @@ class VGToast extends BaseModule {
617
641
  return effectValue.trim();
618
642
  }
619
643
 
620
- _clearTimeout() {
621
- if (this._timeout) {
622
- clearTimeout(this._timeout);
623
- this._timeout = null;
624
- }
625
- }
644
+ _clearTimeout() {
645
+ if (this._timeout) {
646
+ clearTimeout(this._timeout);
647
+ this._timeout = null;
648
+ }
649
+ }
650
+
651
+ _clearHideTimeout() {
652
+ if (this._hideTimeout) {
653
+ clearTimeout(this._hideTimeout);
654
+ this._hideTimeout = null;
655
+ }
656
+ }
626
657
 
627
658
  /**
628
659
  * Назначает обработчики событий
@@ -66,9 +66,9 @@ VGToast.run('Ошибка подключения', {
66
66
  | `animation.enable` | `boolean` | `true` | Включить анимации |
67
67
  | `animation.in` | `string` | `'animate__backInUp'` | Анимация появления |
68
68
  | `animation.out` | `string` | `'animate__backOutDown'` | Анимация исчезновения |
69
- | `animation.delay` | `number` | `300` | Длительность анимации (мс) |
70
- | `animation.effect` | `string \| string[]` | `'none'` | Доп. CSS-эффект отображения: `none`, `fade`, `zoom`, `blur`, `slide-up`, `slide-down` или кастомный класс |
71
- | `ajax.route` | `string` | `''` | URL для загрузки |
69
+ | `animation.delay` | `number` | `300` | Длительность анимации (мс) |
70
+ | `animation.effect` | `string \| string[]` | `'none'` | Доп. CSS-эффект отображения: `none`, `fade`, `zoom`, `blur`, `slide-up`, `slide-down` или кастомный класс |
71
+ | `ajax.route` | `string` | `''` | URL для загрузки |
72
72
  | `ajax.target` | `string` | `''` | Селектор контейнера (если используется) |
73
73
  | `ajax.method` | `string` | `'get'` | HTTP-метод |
74
74
  | `ajax.loader` | `boolean` | `false` | Показывать лоадер |
@@ -90,20 +90,20 @@ VGToast.run('Появилось!', {
90
90
  });
91
91
  ```
92
92
 
93
- ### 2. AJAX-уведомление
94
- ### 2.1. Дополнительные эффекты отображения
95
- ```js
96
- VGToast.run('Сообщение', {
97
- animation: {
98
- in: 'animate__fadeIn',
99
- out: 'animate__fadeOut',
100
- effect: ['zoom', 'blur']
101
- }
102
- });
103
- ```
104
-
105
- ```js
106
- VGToast.run('Загрузка...', {
93
+ ### 2. AJAX-уведомление
94
+ ### 2.1. Дополнительные эффекты отображения
95
+ ```js
96
+ VGToast.run('Сообщение', {
97
+ animation: {
98
+ in: 'animate__fadeIn',
99
+ out: 'animate__fadeOut',
100
+ effect: ['zoom', 'blur']
101
+ }
102
+ });
103
+ ```
104
+
105
+ ```js
106
+ VGToast.run('Загрузка...', {
107
107
  ajax: {
108
108
  route: '/api/notify',
109
109
  method: 'post',
@@ -153,4 +153,4 @@ MIT. Свободно использовать и модифицировать.
153
153
 
154
154
  📌 *Разработано в рамках фронтенд-системы VG Modules.*
155
155
  > 🚀 Автор: VEGAS STUDIO (vegas-dev.com)
156
- > 📍 Поддерживается в проектах VEGAS
156
+ > 📍 Поддерживается в проектах VEGAS
@@ -11,7 +11,7 @@
11
11
  @import "../../../utils/scss/variables";
12
12
  @import "variables";
13
13
 
14
- .vg-toast {
14
+ .vg-toast {
15
15
  @include mix-vars('toast', $toast-map);
16
16
  @include mix-alert-color-mode($class: vg-toast);
17
17
  position: fixed;
@@ -64,52 +64,52 @@
64
64
  font-weight: var(--vg-toast-body-font-weight);
65
65
  }
66
66
 
67
- &-pointer {
68
- cursor: pointer;
69
- }
70
-
71
- &[class*='vg-toast-effect-'] {
72
- .vg-toast-wrapper {
73
- transition: opacity .25s ease, transform .25s ease, filter .25s ease;
74
- will-change: opacity, transform, filter;
75
- }
76
- }
77
-
78
- &.vg-toast-effect-fade {
79
- &:not(.shown) .vg-toast-wrapper {
80
- opacity: 0;
81
- }
82
- }
83
-
84
- &.vg-toast-effect-zoom {
85
- &:not(.shown) .vg-toast-wrapper {
86
- opacity: 0;
87
- transform: scale(.92);
88
- }
89
- }
90
-
91
- &.vg-toast-effect-blur {
92
- &:not(.shown) .vg-toast-wrapper {
93
- opacity: 0;
94
- filter: blur(6px);
95
- }
96
- }
97
-
98
- &.vg-toast-effect-slide-up {
99
- &:not(.shown) .vg-toast-wrapper {
100
- opacity: 0;
101
- transform: translateY(14px);
102
- }
103
- }
104
-
105
- &.vg-toast-effect-slide-down {
106
- &:not(.shown) .vg-toast-wrapper {
107
- opacity: 0;
108
- transform: translateY(-14px);
109
- }
110
- }
111
-
112
- &-button {
67
+ &-pointer {
68
+ cursor: pointer;
69
+ }
70
+
71
+ &[class*='vg-toast-effect-'] {
72
+ .vg-toast-wrapper {
73
+ transition: opacity .25s ease, transform .25s ease, filter .25s ease;
74
+ will-change: opacity, transform, filter;
75
+ }
76
+ }
77
+
78
+ &.vg-toast-effect-fade {
79
+ &:not(.shown) .vg-toast-wrapper {
80
+ opacity: 0;
81
+ }
82
+ }
83
+
84
+ &.vg-toast-effect-zoom {
85
+ &:not(.shown) .vg-toast-wrapper {
86
+ opacity: 0;
87
+ transform: scale(.92);
88
+ }
89
+ }
90
+
91
+ &.vg-toast-effect-blur {
92
+ &:not(.shown) .vg-toast-wrapper {
93
+ opacity: 0;
94
+ filter: blur(6px);
95
+ }
96
+ }
97
+
98
+ &.vg-toast-effect-slide-up {
99
+ &:not(.shown) .vg-toast-wrapper {
100
+ opacity: 0;
101
+ transform: translateY(14px);
102
+ }
103
+ }
104
+
105
+ &.vg-toast-effect-slide-down {
106
+ &:not(.shown) .vg-toast-wrapper {
107
+ opacity: 0;
108
+ transform: translateY(-14px);
109
+ }
110
+ }
111
+
112
+ &-button {
113
113
  width: auto;
114
114
  height: 100%;
115
115
  display: flex;
@@ -136,4 +136,4 @@
136
136
  }
137
137
  }
138
138
  }
139
- }
139
+ }