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.
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 +28 -36
  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 +21 -16
  59. package/app/modules/vgformsender/js/vgformsender.js +4 -6
  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 +11 -8
  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 +107 -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
@@ -1,227 +1,227 @@
1
- import Backdrop from "../../../utils/js/components/backdrop";
2
- import Selectors from "../../../utils/js/dom/selectors";
3
- import EventHandler from "../../../utils/js/dom/event";
4
- import {reflow} from "../../../utils/js/functions";
5
-
6
- const NAME_KEY = 'vg.modal';
7
-
8
- const OPEN_SELECTOR = '.vg-modal.show:not([data-vg-persistent="true"])';
9
-
10
- const CLASS_NAME_OPEN = 'vg-modal-open';
11
- const CLASS_NAME_SHOW = 'show';
12
- const CLASS_NAME_MINIMIZED = 'vg-modal-minimized-state';
13
- const CLASS_NAME_MINIMIZE_BUTTON = 'vg-btn-minimize';
14
- const CLASS_NAME_MINIMIZED_CONTAINER = 'vg-modal-minimized-container';
15
- const CLASS_NAME_MINIMIZED_ITEM = 'vg-modal-minimized';
16
-
17
- const EVENT_KEY_MINIMIZE = `${NAME_KEY}.minimize`;
18
- const EVENT_KEY_MINIMIZED = `${NAME_KEY}.minimized`;
19
- const EVENT_KEY_RESTORE = `${NAME_KEY}.restore`;
20
- const EVENT_KEY_RESTORED = `${NAME_KEY}.restored`;
21
-
22
- class VGModalMinimized {
23
- constructor(modal) {
24
- this._modal = modal;
25
- this._element = modal._element;
26
- this._dialog = modal._dialog;
27
- this._content = modal._content;
28
- this._minimizedElement = null;
29
- this._isMinimized = false;
30
- }
31
-
32
- setup() {
33
- const minimizeConfig = this._getConfig();
34
- if (!minimizeConfig.enable || !this._content) return;
35
- if (Selectors.find(`.${CLASS_NAME_MINIMIZE_BUTTON}`, this._content)) return;
36
-
37
- const button = document.createElement('button');
38
- button.type = 'button';
39
- button.className = CLASS_NAME_MINIMIZE_BUTTON;
40
- button.setAttribute('aria-label', minimizeConfig.label || 'Minimize');
41
- button.innerHTML = '<span aria-hidden="true"></span>';
42
-
43
- const closeButton = Selectors.find('.vg-btn-close', this._content);
44
- if (closeButton && closeButton.parentNode) {
45
- closeButton.parentNode.insertBefore(button, closeButton);
46
- } else {
47
- this._content.prepend(button);
48
- }
49
-
50
- EventHandler.on(button, `click.${NAME_KEY}.minimize`, (event) => {
51
- event.preventDefault();
52
- this.minimize(button);
53
- });
54
- }
55
-
56
- isMinimized() {
57
- return this._isMinimized;
58
- }
59
-
60
- minimize(relatedTarget) {
61
- if (!this._getConfig().enable || !this._modal._isShown || this._isMinimized || this._modal._isTransitioning) return;
62
-
63
- const minimizeEvent = EventHandler.trigger(this._element, EVENT_KEY_MINIMIZE, { relatedTarget });
64
- if (minimizeEvent.defaultPrevented) return;
65
-
66
- this._isMinimized = true;
67
- this._modal._disableInteractionHandlers();
68
- this._element.classList.remove(CLASS_NAME_SHOW);
69
- this._element.classList.add(CLASS_NAME_MINIMIZED);
70
- this._element.style.display = 'none';
71
- this._element.removeAttribute('aria-modal');
72
- this._element.removeAttribute('role');
73
-
74
- const remainingOpenModals = Selectors.findAll(OPEN_SELECTOR).filter(modal => modal !== this._element);
75
- if (!remainingOpenModals.length) {
76
- document.body.classList.remove(CLASS_NAME_OPEN);
77
- }
78
-
79
- const finish = () => {
80
- if (!Backdrop.isActive()) {
81
- this._modal._scrollBar.reset();
82
- }
83
-
84
- this._ensureElement(relatedTarget);
85
- EventHandler.trigger(this._element, EVENT_KEY_MINIMIZED, { relatedTarget });
86
- };
87
-
88
- if (this._modal._backdropElement) {
89
- this._modal._hideBackdrop(finish);
90
- return;
91
- }
92
-
93
- finish();
94
- }
95
-
96
- restore(relatedTarget) {
97
- if (!this._isMinimized || this._modal._isTransitioning) return;
98
-
99
- const restoreEvent = EventHandler.trigger(this._element, EVENT_KEY_RESTORE, { relatedTarget });
100
- if (restoreEvent.defaultPrevented) return;
101
-
102
- const restoreElement = () => {
103
- this.removeElement();
104
- this._isMinimized = false;
105
- this._element.classList.remove(CLASS_NAME_MINIMIZED);
106
- this._element.style.display = 'block';
107
- this._element.setAttribute('aria-modal', true);
108
- this._element.setAttribute('role', 'dialog');
109
- document.body.classList.add(CLASS_NAME_OPEN);
110
-
111
- reflow(this._element);
112
- this._element.classList.add(CLASS_NAME_SHOW);
113
- this._modal._toggleInteractionHandlers();
114
- this._modal._syncInteractiveBounds();
115
- EventHandler.trigger(this._element, EVENT_KEY_RESTORED, { relatedTarget });
116
- };
117
-
118
- if (this._modal._params.backdrop) {
119
- this._modal._scrollBar.hide();
120
- this._modal._showBackdrop(restoreElement);
121
- return;
122
- }
123
-
124
- restoreElement();
125
- }
126
-
127
- reset() {
128
- this.removeElement();
129
- this._isMinimized = false;
130
- this._element.classList.remove(CLASS_NAME_MINIMIZED);
131
- }
132
-
133
- dispose() {
134
- this.removeElement();
135
- }
136
-
137
- _getConfig() {
138
- const value = this._modal._params.minimize;
139
- const defaults = {
140
- enable: false,
141
- title: '',
142
- text: '',
143
- label: 'Minimize',
144
- };
145
-
146
- if (typeof value === 'boolean') {
147
- return {...defaults, enable: value};
148
- }
149
-
150
- if (value && typeof value === 'object') {
151
- const hasEnable = Object.prototype.hasOwnProperty.call(value, 'enable');
152
- return {
153
- ...defaults,
154
- ...value,
155
- enable: hasEnable ? Boolean(value.enable) : true,
156
- };
157
- }
158
-
159
- return defaults;
160
- }
161
-
162
- _ensureElement(relatedTarget) {
163
- if (this._minimizedElement && this._minimizedElement.isConnected) return this._minimizedElement;
164
-
165
- const minimizeConfig = this._getConfig();
166
- const container = VGModalMinimized.getContainer();
167
- const button = document.createElement('button');
168
- button.type = 'button';
169
- button.className = CLASS_NAME_MINIMIZED_ITEM;
170
- button.setAttribute('data-vg-modal-target', `#${this._element.id}`);
171
-
172
- const title = document.createElement('span');
173
- title.className = `${CLASS_NAME_MINIMIZED_ITEM}__title`;
174
- title.textContent = this._getTitle(minimizeConfig);
175
- button.append(title);
176
-
177
- const text = String(minimizeConfig.text || '').trim();
178
- if (text) {
179
- const description = document.createElement('span');
180
- description.className = `${CLASS_NAME_MINIMIZED_ITEM}__text`;
181
- description.textContent = text;
182
- button.append(description);
183
- }
184
-
185
- EventHandler.on(button, `click.${NAME_KEY}.restore`, (event) => {
186
- event.preventDefault();
187
- this.restore(button || relatedTarget);
188
- });
189
-
190
- container.append(button);
191
- this._minimizedElement = button;
192
- return button;
193
- }
194
-
195
- _getTitle(minimizeConfig) {
196
- const configuredTitle = String(minimizeConfig.title || '').trim();
197
- if (configuredTitle) return configuredTitle;
198
-
199
- const titleElement = Selectors.find('.vg-modal-title, .vg-modal-chat__name, [data-vg-modal-title]', this._element);
200
- const title = String(titleElement ? titleElement.textContent : '').trim();
201
- return title || this._element.id || 'Modal';
202
- }
203
-
204
- removeElement() {
205
- if (this._minimizedElement) {
206
- this._minimizedElement.remove();
207
- this._minimizedElement = null;
208
- }
209
-
210
- const container = Selectors.find(`.${CLASS_NAME_MINIMIZED_CONTAINER}`);
211
- if (container && !container.children.length) {
212
- container.remove();
213
- }
214
- }
215
-
216
- static getContainer() {
217
- let container = Selectors.find(`.${CLASS_NAME_MINIMIZED_CONTAINER}`);
218
- if (container) return container;
219
-
220
- container = document.createElement('div');
221
- container.className = CLASS_NAME_MINIMIZED_CONTAINER;
222
- document.body.append(container);
223
- return container;
224
- }
225
- }
226
-
227
- export default VGModalMinimized;
1
+ import Backdrop from "../../../utils/js/components/backdrop";
2
+ import Selectors from "../../../utils/js/dom/selectors";
3
+ import EventHandler from "../../../utils/js/dom/event";
4
+ import {reflow} from "../../../utils/js/functions";
5
+
6
+ const NAME_KEY = 'vg.modal';
7
+
8
+ const OPEN_SELECTOR = '.vg-modal.show:not([data-vg-persistent="true"])';
9
+
10
+ const CLASS_NAME_OPEN = 'vg-modal-open';
11
+ const CLASS_NAME_SHOW = 'show';
12
+ const CLASS_NAME_MINIMIZED = 'vg-modal-minimized-state';
13
+ const CLASS_NAME_MINIMIZE_BUTTON = 'vg-btn-minimize';
14
+ const CLASS_NAME_MINIMIZED_CONTAINER = 'vg-modal-minimized-container';
15
+ const CLASS_NAME_MINIMIZED_ITEM = 'vg-modal-minimized';
16
+
17
+ const EVENT_KEY_MINIMIZE = `${NAME_KEY}.minimize`;
18
+ const EVENT_KEY_MINIMIZED = `${NAME_KEY}.minimized`;
19
+ const EVENT_KEY_RESTORE = `${NAME_KEY}.restore`;
20
+ const EVENT_KEY_RESTORED = `${NAME_KEY}.restored`;
21
+
22
+ class VGModalMinimized {
23
+ constructor(modal) {
24
+ this._modal = modal;
25
+ this._element = modal._element;
26
+ this._dialog = modal._dialog;
27
+ this._content = modal._content;
28
+ this._minimizedElement = null;
29
+ this._isMinimized = false;
30
+ }
31
+
32
+ setup() {
33
+ const minimizeConfig = this._getConfig();
34
+ if (!minimizeConfig.enable || !this._content) return;
35
+ if (Selectors.find(`.${CLASS_NAME_MINIMIZE_BUTTON}`, this._content)) return;
36
+
37
+ const button = document.createElement('button');
38
+ button.type = 'button';
39
+ button.className = CLASS_NAME_MINIMIZE_BUTTON;
40
+ button.setAttribute('aria-label', minimizeConfig.label || 'Minimize');
41
+ button.innerHTML = '<span aria-hidden="true"></span>';
42
+
43
+ const closeButton = Selectors.find('.vg-btn-close', this._content);
44
+ if (closeButton && closeButton.parentNode) {
45
+ closeButton.parentNode.insertBefore(button, closeButton);
46
+ } else {
47
+ this._content.prepend(button);
48
+ }
49
+
50
+ EventHandler.on(button, `click.${NAME_KEY}.minimize`, (event) => {
51
+ event.preventDefault();
52
+ this.minimize(button);
53
+ });
54
+ }
55
+
56
+ isMinimized() {
57
+ return this._isMinimized;
58
+ }
59
+
60
+ minimize(relatedTarget) {
61
+ if (!this._getConfig().enable || !this._modal._isShown || this._isMinimized || this._modal._isTransitioning) return;
62
+
63
+ const minimizeEvent = EventHandler.trigger(this._element, EVENT_KEY_MINIMIZE, { relatedTarget });
64
+ if (minimizeEvent.defaultPrevented) return;
65
+
66
+ this._isMinimized = true;
67
+ this._modal._disableInteractionHandlers();
68
+ this._element.classList.remove(CLASS_NAME_SHOW);
69
+ this._element.classList.add(CLASS_NAME_MINIMIZED);
70
+ this._element.style.display = 'none';
71
+ this._element.removeAttribute('aria-modal');
72
+ this._element.removeAttribute('role');
73
+
74
+ const remainingOpenModals = Selectors.findAll(OPEN_SELECTOR).filter(modal => modal !== this._element);
75
+ if (!remainingOpenModals.length) {
76
+ document.body.classList.remove(CLASS_NAME_OPEN);
77
+ }
78
+
79
+ const finish = () => {
80
+ if (!Backdrop.isActive()) {
81
+ this._modal._scrollBar.reset();
82
+ }
83
+
84
+ this._ensureElement(relatedTarget);
85
+ EventHandler.trigger(this._element, EVENT_KEY_MINIMIZED, { relatedTarget });
86
+ };
87
+
88
+ if (this._modal._backdropElement) {
89
+ this._modal._hideBackdrop(finish);
90
+ return;
91
+ }
92
+
93
+ finish();
94
+ }
95
+
96
+ restore(relatedTarget) {
97
+ if (!this._isMinimized || this._modal._isTransitioning) return;
98
+
99
+ const restoreEvent = EventHandler.trigger(this._element, EVENT_KEY_RESTORE, { relatedTarget });
100
+ if (restoreEvent.defaultPrevented) return;
101
+
102
+ const restoreElement = () => {
103
+ this.removeElement();
104
+ this._isMinimized = false;
105
+ this._element.classList.remove(CLASS_NAME_MINIMIZED);
106
+ this._element.style.display = 'block';
107
+ this._element.setAttribute('aria-modal', true);
108
+ this._element.setAttribute('role', 'dialog');
109
+ document.body.classList.add(CLASS_NAME_OPEN);
110
+
111
+ reflow(this._element);
112
+ this._element.classList.add(CLASS_NAME_SHOW);
113
+ this._modal._toggleInteractionHandlers();
114
+ this._modal._syncInteractiveBounds();
115
+ EventHandler.trigger(this._element, EVENT_KEY_RESTORED, { relatedTarget });
116
+ };
117
+
118
+ if (this._modal._params.backdrop) {
119
+ this._modal._scrollBar.hide();
120
+ this._modal._showBackdrop(restoreElement);
121
+ return;
122
+ }
123
+
124
+ restoreElement();
125
+ }
126
+
127
+ reset() {
128
+ this.removeElement();
129
+ this._isMinimized = false;
130
+ this._element.classList.remove(CLASS_NAME_MINIMIZED);
131
+ }
132
+
133
+ dispose() {
134
+ this.removeElement();
135
+ }
136
+
137
+ _getConfig() {
138
+ const value = this._modal._params.minimize;
139
+ const defaults = {
140
+ enable: false,
141
+ title: '',
142
+ text: '',
143
+ label: 'Minimize',
144
+ };
145
+
146
+ if (typeof value === 'boolean') {
147
+ return {...defaults, enable: value};
148
+ }
149
+
150
+ if (value && typeof value === 'object') {
151
+ const hasEnable = Object.prototype.hasOwnProperty.call(value, 'enable');
152
+ return {
153
+ ...defaults,
154
+ ...value,
155
+ enable: hasEnable ? Boolean(value.enable) : true,
156
+ };
157
+ }
158
+
159
+ return defaults;
160
+ }
161
+
162
+ _ensureElement(relatedTarget) {
163
+ if (this._minimizedElement && this._minimizedElement.isConnected) return this._minimizedElement;
164
+
165
+ const minimizeConfig = this._getConfig();
166
+ const container = VGModalMinimized.getContainer();
167
+ const button = document.createElement('button');
168
+ button.type = 'button';
169
+ button.className = CLASS_NAME_MINIMIZED_ITEM;
170
+ button.setAttribute('data-vg-modal-target', `#${this._element.id}`);
171
+
172
+ const title = document.createElement('span');
173
+ title.className = `${CLASS_NAME_MINIMIZED_ITEM}__title`;
174
+ title.textContent = this._getTitle(minimizeConfig);
175
+ button.append(title);
176
+
177
+ const text = String(minimizeConfig.text || '').trim();
178
+ if (text) {
179
+ const description = document.createElement('span');
180
+ description.className = `${CLASS_NAME_MINIMIZED_ITEM}__text`;
181
+ description.textContent = text;
182
+ button.append(description);
183
+ }
184
+
185
+ EventHandler.on(button, `click.${NAME_KEY}.restore`, (event) => {
186
+ event.preventDefault();
187
+ this.restore(button || relatedTarget);
188
+ });
189
+
190
+ container.append(button);
191
+ this._minimizedElement = button;
192
+ return button;
193
+ }
194
+
195
+ _getTitle(minimizeConfig) {
196
+ const configuredTitle = String(minimizeConfig.title || '').trim();
197
+ if (configuredTitle) return configuredTitle;
198
+
199
+ const titleElement = Selectors.find('.vg-modal-title, .vg-modal-chat__name, [data-vg-modal-title]', this._element);
200
+ const title = String(titleElement ? titleElement.textContent : '').trim();
201
+ return title || this._element.id || 'Modal';
202
+ }
203
+
204
+ removeElement() {
205
+ if (this._minimizedElement) {
206
+ this._minimizedElement.remove();
207
+ this._minimizedElement = null;
208
+ }
209
+
210
+ const container = Selectors.find(`.${CLASS_NAME_MINIMIZED_CONTAINER}`);
211
+ if (container && !container.children.length) {
212
+ container.remove();
213
+ }
214
+ }
215
+
216
+ static getContainer() {
217
+ let container = Selectors.find(`.${CLASS_NAME_MINIMIZED_CONTAINER}`);
218
+ if (container) return container;
219
+
220
+ container = document.createElement('div');
221
+ container.className = CLASS_NAME_MINIMIZED_CONTAINER;
222
+ document.body.append(container);
223
+ return container;
224
+ }
225
+ }
226
+
227
+ export default VGModalMinimized;
@@ -1,27 +1,27 @@
1
- @use "../../../utils/scss" as vg;
2
-
3
- $modal-sm: 300px !default;
1
+ @use "../../../utils/scss" as vg;
2
+
3
+ $modal-sm: 300px !default;
4
4
  $modal-md: 500px !default;
5
5
  $modal-lg: 800px !default;
6
6
  $modal-xl: 1140px !default;
7
7
 
8
8
  $modal-dialog-margin-y-sm-up: 1.75rem !default;
9
- $modal-content-box-shadow-sm-up: var(--vg-box-shadow, #{vg.$box-shadow}) !default;
10
-
11
- $modal-map: (
12
- z-index: vg.$modal-index,
9
+ $modal-content-box-shadow-sm-up: var(--vg-box-shadow, #{vg.$box-shadow}) !default;
10
+
11
+ $modal-map: (
12
+ z-index: vg.$modal-index,
13
13
  margin: .5rem,
14
14
  padding: 1rem,
15
15
  width: $modal-md,
16
- color: var(--vg-text-color, #{vg.$color}),
17
- background-color: var(--vg-surface-bg, #{vg.$surface-bg}),
18
- border-width: vg.$border-width,
19
- border-color: transparent,
20
- border-style: vg.$border-style,
21
- border-radius: vg.$border-radius,
22
- box-shadow: var(--vg-box-shadow, #{vg.$box-shadow}),
23
- transition: vg.$transition-base,
16
+ color: var(--vg-text-color, #{vg.$color}),
17
+ background-color: var(--vg-surface-bg, #{vg.$surface-bg}),
18
+ border-width: vg.$border-width,
19
+ border-color: transparent,
20
+ border-style: vg.$border-style,
21
+ border-radius: vg.$border-radius,
22
+ box-shadow: var(--vg-box-shadow, #{vg.$box-shadow}),
23
+ transition: vg.$transition-base,
24
24
  fade-transform: translate(0, -50px),
25
25
  show-transform: none,
26
- scale-transform: scale(1.02),
27
- ) !default;
26
+ scale-transform: scale(1.02),
27
+ ) !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-modal {
14
- @include vg.mix-vars('modal', vars.$modal-map);
14
+ @include vg.mix-vars('modal', vars.$modal-map);
15
15
  position: fixed;
16
16
  left: 0;
17
17
  top: 0;
@@ -90,77 +90,77 @@
90
90
  border: 0;
91
91
  border-radius: 0;
92
92
  }
93
- }
94
- }
95
-
96
- .vg-btn-minimize {
97
- position: absolute;
98
- width: 30px;
99
- height: 30px;
100
- right: 55px;
101
- top: 15px;
102
- border: none;
103
- background: transparent;
104
- border-radius: 50%;
105
- padding: 0;
106
- display: flex;
107
- align-items: center;
108
- justify-content: center;
109
- cursor: pointer;
110
- z-index: 2;
111
-
112
- span {
113
- width: 14px;
114
- height: 2px;
115
- background: currentColor;
116
- display: block;
117
- }
118
- }
119
-
120
- .vg-modal-minimized-container {
121
- position: fixed;
122
- right: 20px;
123
- bottom: 20px;
124
- z-index: calc(var(--vg-modal-z-index, #{vg.$modal-index}) + 1);
125
- display: flex;
126
- flex-direction: column;
127
- align-items: flex-end;
128
- gap: 10px;
129
- pointer-events: none;
130
- }
131
-
132
- .vg-modal-minimized {
133
- min-width: 220px;
134
- max-width: 320px;
135
- border: var(--vg-modal-border-width) var(--vg-modal-border-style) var(--vg-modal-border-color);
136
- border-radius: var(--vg-modal-border-radius);
137
- background: var(--vg-modal-background-color);
138
- color: var(--vg-modal-color);
139
- box-shadow: var(--vg-modal-box-shadow);
140
- padding: .75rem 1rem;
141
- cursor: pointer;
142
- pointer-events: auto;
143
- text-align: left;
144
- display: flex;
145
- flex-direction: column;
146
- gap: .25rem;
147
-
148
- &__title {
149
- font-weight: 600;
150
- line-height: 1.2;
151
- }
152
-
153
- &__text {
154
- font-size: .875rem;
155
- opacity: .75;
156
- line-height: 1.2;
157
- }
158
- }
159
-
160
- @media screen and (min-width: 576px){
93
+ }
94
+ }
95
+
96
+ .vg-btn-minimize {
97
+ position: absolute;
98
+ width: 30px;
99
+ height: 30px;
100
+ right: 55px;
101
+ top: 15px;
102
+ border: none;
103
+ background: transparent;
104
+ border-radius: 50%;
105
+ padding: 0;
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ cursor: pointer;
110
+ z-index: 2;
111
+
112
+ span {
113
+ width: 14px;
114
+ height: 2px;
115
+ background: currentColor;
116
+ display: block;
117
+ }
118
+ }
119
+
120
+ .vg-modal-minimized-container {
121
+ position: fixed;
122
+ right: 20px;
123
+ bottom: 20px;
124
+ z-index: calc(var(--vg-modal-z-index, #{vg.$modal-index}) + 1);
125
+ display: flex;
126
+ flex-direction: column;
127
+ align-items: flex-end;
128
+ gap: 10px;
129
+ pointer-events: none;
130
+ }
131
+
132
+ .vg-modal-minimized {
133
+ min-width: 220px;
134
+ max-width: 320px;
135
+ border: var(--vg-modal-border-width) var(--vg-modal-border-style) var(--vg-modal-border-color);
136
+ border-radius: var(--vg-modal-border-radius);
137
+ background: var(--vg-modal-background-color);
138
+ color: var(--vg-modal-color);
139
+ box-shadow: var(--vg-modal-box-shadow);
140
+ padding: .75rem 1rem;
141
+ cursor: pointer;
142
+ pointer-events: auto;
143
+ text-align: left;
144
+ display: flex;
145
+ flex-direction: column;
146
+ gap: .25rem;
147
+
148
+ &__title {
149
+ font-weight: 600;
150
+ line-height: 1.2;
151
+ }
152
+
153
+ &__text {
154
+ font-size: .875rem;
155
+ opacity: .75;
156
+ line-height: 1.2;
157
+ }
158
+ }
159
+
160
+ @media screen and (min-width: 576px){
161
161
  .vg-modal {
162
- --vg-modal-margin: #{vars.$modal-dialog-margin-y-sm-up};
163
- --vg-modal-box-shadow: #{vars.$modal-content-box-shadow-sm-up};
162
+ --vg-modal-margin: #{vars.$modal-dialog-margin-y-sm-up};
163
+ --vg-modal-box-shadow: #{vars.$modal-content-box-shadow-sm-up};
164
164
  }
165
165
 
166
166
  .vg-modal-dialog {
@@ -170,18 +170,18 @@
170
170
  }
171
171
 
172
172
  .vg-modal-sm {
173
- --vg-modal-width: #{vars.$modal-sm};
173
+ --vg-modal-width: #{vars.$modal-sm};
174
174
  }
175
175
  }
176
176
 
177
177
  @media screen and (min-width: 992px){
178
178
  .vg-modal-lg, .vg-modal-xl {
179
- --vg-modal-width: #{vars.$modal-lg};
179
+ --vg-modal-width: #{vars.$modal-lg};
180
180
  }
181
181
  }
182
182
 
183
183
  @media screen and (min-width: 1399px) {
184
184
  .vg-modal-xl {
185
- --vg-modal-width: #{vars.$modal-xl};
185
+ --vg-modal-width: #{vars.$modal-xl};
186
186
  }
187
187
  }