vgapp 1.2.6 → 1.3.1
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 +113 -2
- 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/base-module.js +104 -87
- package/app/modules/vgalert/readme.md +105 -105
- package/app/modules/vgdynamictable/index.js +5 -5
- package/app/modules/vgdynamictable/js/editable.js +19 -19
- package/app/modules/vgdynamictable/js/filters.js +21 -21
- package/app/modules/vgdynamictable/js/fixed.js +179 -179
- package/app/modules/vgdynamictable/js/pagination.js +1 -1
- package/app/modules/vgdynamictable/js/search.js +12 -12
- 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-remote.js +79 -79
- 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 +268 -268
- package/app/modules/vgdynamictable/readme.md +250 -250
- package/app/modules/vgdynamictable/scss/_skeleton.scss +6 -6
- package/app/modules/vgdynamictable/scss/_sortable.scss +24 -24
- package/app/modules/vgdynamictable/scss/_table.scss +4 -4
- package/app/modules/vgdynamictable/scss/_variables.scss +79 -79
- package/app/modules/vgdynamictable/scss/vgdynamictable.scss +27 -27
- 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 +113 -113
- package/app/modules/vgfilepreview/scss/vgfilepreview.scss +464 -464
- package/app/modules/vgfiles/js/base.js +26 -26
- package/app/modules/vgfiles/js/droppable.js +260 -260
- 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/_variables.scss +18 -18
- package/app/modules/vgfiles/scss/vgfiles.scss +148 -148
- package/app/modules/vgformsender/js/hideshowpass.js +16 -16
- package/app/modules/vgformsender/scss/vgformsender.scss +34 -34
- package/app/modules/vgmodal/js/vgmodal.drag.js +332 -332
- package/app/modules/vgmodal/js/vgmodal.js +188 -188
- package/app/modules/vgmodal/js/vgmodal.resize.js +27 -27
- package/app/modules/vgmodal/scss/vgmodal.scss +14 -14
- package/app/modules/vgnav/js/vgnav.js +135 -135
- package/app/modules/vgnav/readme.md +67 -67
- package/app/modules/vgnestable/README.md +307 -307
- package/app/modules/vgnestable/scss/_variables.scss +60 -60
- package/app/modules/vgnestable/scss/vgnestable.scss +163 -163
- package/app/modules/vgrangeslider/js/skins.js +222 -222
- package/app/modules/vgrangeslider/js/vgrangeslider.js +704 -704
- package/app/modules/vgrangeslider/readme.md +523 -523
- package/app/modules/vgrangeslider/scss/_variables.scss +53 -53
- package/app/modules/vgrangeslider/scss/vgrangeslider.scss +240 -240
- package/app/modules/vgselect/js/vgselect.js +39 -39
- package/app/modules/vgselect/scss/vgselect.scss +22 -22
- package/app/modules/vgspy/readme.md +28 -28
- package/app/modules/vgtoast/readme.md +18 -18
- package/app/modules/vgtoast/scss/vgtoast.scss +48 -48
- package/app/modules/vgtooltip/js/vgtooltip.js +89 -89
- package/app/modules/vgtooltip/readme.md +181 -181
- package/app/utils/js/components/ajax.js +117 -117
- package/app/utils/js/components/audio-metadata.js +240 -240
- package/app/utils/js/components/backdrop.js +17 -17
- 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/vgapp.js +130 -0
- package/build/vgapp.css +2 -2
- package/build/vgapp.css.map +1 -1
- package/build/vgapp.js +2 -1
- package/build/vgapp.js.LICENSE.txt +1 -0
- package/build/vgapp.js.map +1 -1
- package/index.js +5 -0
- package/package.json +21 -1
- package/.gitattributes +0 -1
- package/CHANGELOG.md +0 -392
- package/agents.md +0 -14
- package/webpack.config.js +0 -63
|
@@ -4,10 +4,10 @@ import Backdrop from "../../../utils/js/components/backdrop";
|
|
|
4
4
|
import Selectors from "../../../utils/js/dom/selectors";
|
|
5
5
|
import EventHandler from "../../../utils/js/dom/event";
|
|
6
6
|
import {Manipulator} from "../../../utils/js/dom/manipulator";
|
|
7
|
-
import {execute, isDisabled, isRTL, mergeDeepObject, reflow} from "../../../utils/js/functions";
|
|
8
|
-
import {dismissTrigger} from "../../module-fn";
|
|
9
|
-
import VGModalDrag from "./vgmodal.drag";
|
|
10
|
-
import VGModalResize from "./vgmodal.resize";
|
|
7
|
+
import {execute, isDisabled, isRTL, mergeDeepObject, reflow} from "../../../utils/js/functions";
|
|
8
|
+
import {dismissTrigger} from "../../module-fn";
|
|
9
|
+
import VGModalDrag from "./vgmodal.drag";
|
|
10
|
+
import VGModalResize from "./vgmodal.resize";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Constants
|
|
@@ -17,15 +17,15 @@ const NAME_KEY = 'vg.modal';
|
|
|
17
17
|
|
|
18
18
|
const ESCAPE_KEY = 'Escape';
|
|
19
19
|
|
|
20
|
-
const OPEN_SELECTOR = '.vg-modal.show:not([data-vg-persistent="true"])';
|
|
20
|
+
const OPEN_SELECTOR = '.vg-modal.show:not([data-vg-persistent="true"])';
|
|
21
21
|
const SELECTOR_DIALOG = '.vg-modal-dialog';
|
|
22
22
|
const SELECTOR_MODAL_BODY = '.vg-modal-body';
|
|
23
23
|
const SELECTOR_DATA_TOGGLE = '[data-vg-toggle="modal"]';
|
|
24
24
|
|
|
25
|
-
const CLASS_NAME_OPEN = 'vg-modal-open';
|
|
26
|
-
const CLASS_NAME_SHOW = 'show';
|
|
27
|
-
const CLASS_NAME_FADE = 'fade';
|
|
28
|
-
const CLASS_NAME_STATIC = 'vg-modal-static';
|
|
25
|
+
const CLASS_NAME_OPEN = 'vg-modal-open';
|
|
26
|
+
const CLASS_NAME_SHOW = 'show';
|
|
27
|
+
const CLASS_NAME_FADE = 'fade';
|
|
28
|
+
const CLASS_NAME_STATIC = 'vg-modal-static';
|
|
29
29
|
|
|
30
30
|
const EVENT_KEY_HIDE = `${NAME_KEY}.hide`;
|
|
31
31
|
const EVENT_KEY_HIDDEN = `${NAME_KEY}.hidden`;
|
|
@@ -54,31 +54,31 @@ class VGModal extends BaseModule {
|
|
|
54
54
|
resizeEdgeSize: 8,
|
|
55
55
|
debug: false,
|
|
56
56
|
},
|
|
57
|
-
resize: {
|
|
58
|
-
enable: false,
|
|
59
|
-
edgeSize: 8,
|
|
60
|
-
minWidth: 300,
|
|
61
|
-
minHeight: 160,
|
|
62
|
-
debug: false,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
this._params = this._getParams(element, mergeDeepObject({
|
|
67
|
-
backdrop: true,
|
|
68
|
-
persistent: false,
|
|
69
|
-
focus: true,
|
|
70
|
-
keyboard: true,
|
|
57
|
+
resize: {
|
|
58
|
+
enable: false,
|
|
59
|
+
edgeSize: 8,
|
|
60
|
+
minWidth: 300,
|
|
61
|
+
minHeight: 160,
|
|
62
|
+
debug: false,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
this._params = this._getParams(element, mergeDeepObject({
|
|
67
|
+
backdrop: true,
|
|
68
|
+
persistent: false,
|
|
69
|
+
focus: true,
|
|
70
|
+
keyboard: true,
|
|
71
71
|
fields: [],
|
|
72
72
|
hash: false,
|
|
73
73
|
centered: false,
|
|
74
74
|
dismiss: true,
|
|
75
|
-
resize: {
|
|
76
|
-
enable: false,
|
|
77
|
-
edgeSize: 8,
|
|
78
|
-
minWidth: 300,
|
|
79
|
-
minHeight: 160,
|
|
80
|
-
debug: false,
|
|
81
|
-
},
|
|
75
|
+
resize: {
|
|
76
|
+
enable: false,
|
|
77
|
+
edgeSize: 8,
|
|
78
|
+
minWidth: 300,
|
|
79
|
+
minHeight: 160,
|
|
80
|
+
debug: false,
|
|
81
|
+
},
|
|
82
82
|
state: {
|
|
83
83
|
enable: true,
|
|
84
84
|
key: '',
|
|
@@ -124,25 +124,25 @@ class VGModal extends BaseModule {
|
|
|
124
124
|
this._dialog = Selectors.find(SELECTOR_DIALOG, this._element);
|
|
125
125
|
this._content = Selectors.find('.vg-modal-content', this._dialog);
|
|
126
126
|
this._isShown = false;
|
|
127
|
-
this._isTransitioning = false;
|
|
128
|
-
this._scrollBar = new ScrollBarHelper();
|
|
129
|
-
this._dragHandler = new VGModalDrag(this._element, this._dialog);
|
|
130
|
-
this._resizeHandler = new VGModalResize(this._element, this._dialog);
|
|
131
|
-
this._interactionConfig = this._resolveInteractionConfig();
|
|
132
|
-
this._dragHandler.setOptions(this._interactionConfig.drag);
|
|
133
|
-
this._resizeHandler.setOptions(this._interactionConfig.resize);
|
|
127
|
+
this._isTransitioning = false;
|
|
128
|
+
this._scrollBar = new ScrollBarHelper();
|
|
129
|
+
this._dragHandler = new VGModalDrag(this._element, this._dialog);
|
|
130
|
+
this._resizeHandler = new VGModalResize(this._element, this._dialog);
|
|
131
|
+
this._interactionConfig = this._resolveInteractionConfig();
|
|
132
|
+
this._dragHandler.setOptions(this._interactionConfig.drag);
|
|
133
|
+
this._resizeHandler.setOptions(this._interactionConfig.resize);
|
|
134
134
|
|
|
135
135
|
this._addEventListeners();
|
|
136
136
|
this._dismissElement();
|
|
137
137
|
|
|
138
|
-
this._params.animation.delay = !this._params.animation.enable ? 0 : this._params.animation.delay;
|
|
139
|
-
this._animation(this._element, VGModal.NAME_KEY, this._params.animation);
|
|
140
|
-
if (this._params.persistent) {
|
|
141
|
-
this._element.setAttribute('data-vg-persistent', 'true');
|
|
142
|
-
} else {
|
|
143
|
-
this._element.removeAttribute('data-vg-persistent');
|
|
144
|
-
}
|
|
145
|
-
}
|
|
138
|
+
this._params.animation.delay = !this._params.animation.enable ? 0 : this._params.animation.delay;
|
|
139
|
+
this._animation(this._element, VGModal.NAME_KEY, this._params.animation);
|
|
140
|
+
if (this._params.persistent) {
|
|
141
|
+
this._element.setAttribute('data-vg-persistent', 'true');
|
|
142
|
+
} else {
|
|
143
|
+
this._element.removeAttribute('data-vg-persistent');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
146
|
|
|
147
147
|
static get NAME() {
|
|
148
148
|
return NAME;
|
|
@@ -238,28 +238,28 @@ class VGModal extends BaseModule {
|
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
this._scrollBar.hide();
|
|
242
|
-
|
|
243
|
-
document.body.classList.add(CLASS_NAME_OPEN);
|
|
241
|
+
this._scrollBar.hide();
|
|
242
|
+
|
|
243
|
+
document.body.classList.add(CLASS_NAME_OPEN);
|
|
244
244
|
|
|
245
245
|
this._addFieldsInModal(relatedTarget);
|
|
246
246
|
this._adjustDialog();
|
|
247
247
|
|
|
248
|
-
if (this._params.backdrop) {
|
|
249
|
-
Backdrop.show(() => {
|
|
250
|
-
const backdrop = Selectors.find('.vg-backdrop');
|
|
251
|
-
if (backdrop) {
|
|
252
|
-
EventHandler.one(backdrop, 'mousedown.vg.backdrop', () => {
|
|
253
|
-
this.hide();
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
this._showElement(relatedTarget);
|
|
258
|
-
});
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
this._showElement(relatedTarget);
|
|
248
|
+
if (this._params.backdrop) {
|
|
249
|
+
Backdrop.show(() => {
|
|
250
|
+
const backdrop = Selectors.find('.vg-backdrop');
|
|
251
|
+
if (backdrop) {
|
|
252
|
+
EventHandler.one(backdrop, 'mousedown.vg.backdrop', () => {
|
|
253
|
+
this.hide();
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
this._showElement(relatedTarget);
|
|
258
|
+
});
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
this._showElement(relatedTarget);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
hide(openedModals = [], isLeaveBackDrop = false) {
|
|
@@ -268,50 +268,50 @@ class VGModal extends BaseModule {
|
|
|
268
268
|
const hideEvent = EventHandler.trigger(this._element, EVENT_KEY_HIDE);
|
|
269
269
|
if (hideEvent.defaultPrevented) return;
|
|
270
270
|
|
|
271
|
-
this._isShown = false;
|
|
272
|
-
this._isTransitioning = true;
|
|
273
|
-
|
|
274
|
-
setTimeout(() => {
|
|
275
|
-
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
276
|
-
this._queueCallback(() => this._hideModal(openedModals, isLeaveBackDrop), this._element, this._isAnimatedFade());
|
|
271
|
+
this._isShown = false;
|
|
272
|
+
this._isTransitioning = true;
|
|
273
|
+
|
|
274
|
+
setTimeout(() => {
|
|
275
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
276
|
+
this._queueCallback(() => this._hideModal(openedModals, isLeaveBackDrop), this._element, this._isAnimatedFade());
|
|
277
277
|
}, this._params.animation.delay);
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
_hideModal(openedModals, isLeaveBackDrop) {
|
|
281
|
-
if (!isLeaveBackDrop) {
|
|
282
|
-
this._saveInteractionState();
|
|
283
|
-
this._disableInteractionHandlers();
|
|
284
|
-
this._element.style.display = 'none';
|
|
285
|
-
this._element.removeAttribute('aria-modal');
|
|
286
|
-
this._element.removeAttribute('role');
|
|
287
|
-
this._isTransitioning = false;
|
|
288
|
-
|
|
289
|
-
const remainingOpenModals = Selectors.findAll(OPEN_SELECTOR).filter(modal => modal !== this._element);
|
|
290
|
-
if (remainingOpenModals.length || openedModals.length) {
|
|
291
|
-
EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
document.body.classList.remove(CLASS_NAME_OPEN);
|
|
296
|
-
|
|
297
|
-
if (this._params.hash) {
|
|
298
|
-
history.pushState("", document.title, window.location.pathname + window.location.search);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (!this._params.backdrop) {
|
|
302
|
-
this._resetAdjustments();
|
|
303
|
-
this._scrollBar.reset();
|
|
304
|
-
|
|
305
|
-
EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
Backdrop.hide(() => {
|
|
310
|
-
this._resetAdjustments();
|
|
311
|
-
this._scrollBar.reset();
|
|
312
|
-
|
|
313
|
-
EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
|
|
314
|
-
})
|
|
280
|
+
_hideModal(openedModals, isLeaveBackDrop) {
|
|
281
|
+
if (!isLeaveBackDrop) {
|
|
282
|
+
this._saveInteractionState();
|
|
283
|
+
this._disableInteractionHandlers();
|
|
284
|
+
this._element.style.display = 'none';
|
|
285
|
+
this._element.removeAttribute('aria-modal');
|
|
286
|
+
this._element.removeAttribute('role');
|
|
287
|
+
this._isTransitioning = false;
|
|
288
|
+
|
|
289
|
+
const remainingOpenModals = Selectors.findAll(OPEN_SELECTOR).filter(modal => modal !== this._element);
|
|
290
|
+
if (remainingOpenModals.length || openedModals.length) {
|
|
291
|
+
EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
document.body.classList.remove(CLASS_NAME_OPEN);
|
|
296
|
+
|
|
297
|
+
if (this._params.hash) {
|
|
298
|
+
history.pushState("", document.title, window.location.pathname + window.location.search);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (!this._params.backdrop) {
|
|
302
|
+
this._resetAdjustments();
|
|
303
|
+
this._scrollBar.reset();
|
|
304
|
+
|
|
305
|
+
EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
Backdrop.hide(() => {
|
|
310
|
+
this._resetAdjustments();
|
|
311
|
+
this._scrollBar.reset();
|
|
312
|
+
|
|
313
|
+
EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
|
|
314
|
+
})
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
|
|
@@ -335,32 +335,32 @@ class VGModal extends BaseModule {
|
|
|
335
335
|
this._element.classList.add(CLASS_NAME_SHOW);
|
|
336
336
|
this._toggleInteractionHandlers();
|
|
337
337
|
|
|
338
|
-
const transitionComplete = () => {
|
|
339
|
-
this._isTransitioning = false;
|
|
340
|
-
EventHandler.trigger(this._element, EVENT_KEY_SHOWN, {
|
|
341
|
-
relatedTarget
|
|
342
|
-
});
|
|
343
|
-
this._syncInteractiveBounds();
|
|
344
|
-
|
|
345
|
-
this._params = this._getParams(relatedTarget, this._params);
|
|
346
|
-
this._restoreInteractionState();
|
|
347
|
-
this._syncInteractiveBounds();
|
|
348
|
-
this._route((status, data) => {
|
|
349
|
-
EventHandler.trigger(this._element, EVENT_KEY_LOADED, {stats: status, data: data, relatedTarget: relatedTarget});
|
|
350
|
-
this._syncInteractiveBounds();
|
|
351
|
-
});
|
|
352
|
-
}
|
|
338
|
+
const transitionComplete = () => {
|
|
339
|
+
this._isTransitioning = false;
|
|
340
|
+
EventHandler.trigger(this._element, EVENT_KEY_SHOWN, {
|
|
341
|
+
relatedTarget
|
|
342
|
+
});
|
|
343
|
+
this._syncInteractiveBounds();
|
|
344
|
+
|
|
345
|
+
this._params = this._getParams(relatedTarget, this._params);
|
|
346
|
+
this._restoreInteractionState();
|
|
347
|
+
this._syncInteractiveBounds();
|
|
348
|
+
this._route((status, data) => {
|
|
349
|
+
EventHandler.trigger(this._element, EVENT_KEY_LOADED, {stats: status, data: data, relatedTarget: relatedTarget});
|
|
350
|
+
this._syncInteractiveBounds();
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
353
|
|
|
354
354
|
this._queueCallback(transitionComplete, this._dialog, this._isAnimatedFade())
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
-
_bindInteractionHandlers() {
|
|
358
|
-
this._dragHandler.setOptions(this._interactionConfig.drag);
|
|
359
|
-
this._resizeHandler.setOptions(this._interactionConfig.resize);
|
|
360
|
-
}
|
|
361
|
-
_toggleInteractionHandlers() {
|
|
362
|
-
this._interactionConfig = this._resolveInteractionConfig();
|
|
363
|
-
this._bindInteractionHandlers();
|
|
357
|
+
_bindInteractionHandlers() {
|
|
358
|
+
this._dragHandler.setOptions(this._interactionConfig.drag);
|
|
359
|
+
this._resizeHandler.setOptions(this._interactionConfig.resize);
|
|
360
|
+
}
|
|
361
|
+
_toggleInteractionHandlers() {
|
|
362
|
+
this._interactionConfig = this._resolveInteractionConfig();
|
|
363
|
+
this._bindInteractionHandlers();
|
|
364
364
|
|
|
365
365
|
if (this._interactionConfig.drag.enable) {
|
|
366
366
|
this._dragHandler.enable();
|
|
@@ -368,34 +368,34 @@ class VGModal extends BaseModule {
|
|
|
368
368
|
this._dragHandler.disable();
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
if (this._interactionConfig.resize.enable) {
|
|
372
|
-
this._resizeHandler.enable();
|
|
373
|
-
} else {
|
|
374
|
-
this._resizeHandler.disable();
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
_disableInteractionHandlers() {
|
|
379
|
-
this._dragHandler.disable();
|
|
380
|
-
this._resizeHandler.disable();
|
|
381
|
-
}
|
|
371
|
+
if (this._interactionConfig.resize.enable) {
|
|
372
|
+
this._resizeHandler.enable();
|
|
373
|
+
} else {
|
|
374
|
+
this._resizeHandler.disable();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
_disableInteractionHandlers() {
|
|
379
|
+
this._dragHandler.disable();
|
|
380
|
+
this._resizeHandler.disable();
|
|
381
|
+
}
|
|
382
382
|
|
|
383
383
|
_syncInteractiveBounds() {
|
|
384
384
|
if (this._interactionConfig.resize.enable) {
|
|
385
385
|
this._resizeHandler.syncToViewport();
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
if (this._interactionConfig.drag.enable) {
|
|
389
|
-
this._dragHandler.syncPosition();
|
|
390
|
-
}
|
|
391
|
-
}
|
|
388
|
+
if (this._interactionConfig.drag.enable) {
|
|
389
|
+
this._dragHandler.syncPosition();
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
392
|
|
|
393
|
-
_resolveInteractionConfig() {
|
|
394
|
-
return {
|
|
395
|
-
drag: this._normalizeInteractionParams(this._params.drag, this._interactionDefaults.drag),
|
|
396
|
-
resize: this._normalizeInteractionParams(this._params.resize, this._interactionDefaults.resize),
|
|
397
|
-
};
|
|
398
|
-
}
|
|
393
|
+
_resolveInteractionConfig() {
|
|
394
|
+
return {
|
|
395
|
+
drag: this._normalizeInteractionParams(this._params.drag, this._interactionDefaults.drag),
|
|
396
|
+
resize: this._normalizeInteractionParams(this._params.resize, this._interactionDefaults.resize),
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
399
|
|
|
400
400
|
_normalizeInteractionParams(paramsValue, defaults) {
|
|
401
401
|
if (typeof paramsValue === 'boolean') {
|
|
@@ -466,27 +466,27 @@ class VGModal extends BaseModule {
|
|
|
466
466
|
maxWidth: dialogStyle.maxWidth,
|
|
467
467
|
maxHeight: dialogStyle.maxHeight,
|
|
468
468
|
minHeight: dialogStyle.minHeight,
|
|
469
|
-
overflow: dialogStyle.overflow,
|
|
470
|
-
pointerEvents: dialogStyle.pointerEvents,
|
|
471
|
-
transition: dialogStyle.transition,
|
|
472
|
-
willChange: dialogStyle.willChange,
|
|
473
|
-
} : {},
|
|
474
|
-
content: contentStyle ? {
|
|
475
|
-
height: contentStyle.height,
|
|
476
|
-
maxHeight: contentStyle.maxHeight,
|
|
477
|
-
overflow: contentStyle.overflow,
|
|
478
|
-
} : {},
|
|
479
|
-
};
|
|
480
|
-
}
|
|
469
|
+
overflow: dialogStyle.overflow,
|
|
470
|
+
pointerEvents: dialogStyle.pointerEvents,
|
|
471
|
+
transition: dialogStyle.transition,
|
|
472
|
+
willChange: dialogStyle.willChange,
|
|
473
|
+
} : {},
|
|
474
|
+
content: contentStyle ? {
|
|
475
|
+
height: contentStyle.height,
|
|
476
|
+
maxHeight: contentStyle.maxHeight,
|
|
477
|
+
overflow: contentStyle.overflow,
|
|
478
|
+
} : {},
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
481
|
|
|
482
482
|
_applyInteractionState(state) {
|
|
483
483
|
if (!state || typeof state !== 'object') return;
|
|
484
484
|
|
|
485
485
|
const dialogState = state.dialog && typeof state.dialog === 'object' ? state.dialog : {};
|
|
486
486
|
const contentState = state.content && typeof state.content === 'object' ? state.content : {};
|
|
487
|
-
if (this._dialog) {
|
|
488
|
-
Object.keys(dialogState).forEach(propertyName => {
|
|
489
|
-
this._dialog.style[propertyName] = dialogState[propertyName] || '';
|
|
487
|
+
if (this._dialog) {
|
|
488
|
+
Object.keys(dialogState).forEach(propertyName => {
|
|
489
|
+
this._dialog.style[propertyName] = dialogState[propertyName] || '';
|
|
490
490
|
});
|
|
491
491
|
}
|
|
492
492
|
|
|
@@ -498,16 +498,16 @@ class VGModal extends BaseModule {
|
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
|
|
501
|
-
_saveInteractionState() {
|
|
502
|
-
const stateConfig = this._getStateConfig();
|
|
503
|
-
const storageKey = this._getStateStorageKey(stateConfig);
|
|
504
|
-
if (!stateConfig.enable || !storageKey || typeof window === 'undefined' || !window.localStorage) return;
|
|
501
|
+
_saveInteractionState() {
|
|
502
|
+
const stateConfig = this._getStateConfig();
|
|
503
|
+
const storageKey = this._getStateStorageKey(stateConfig);
|
|
504
|
+
if (!stateConfig.enable || !storageKey || typeof window === 'undefined' || !window.localStorage) return;
|
|
505
505
|
|
|
506
|
-
try {
|
|
507
|
-
window.localStorage.setItem(storageKey, JSON.stringify(this._captureInteractionState()));
|
|
508
|
-
} catch (error) {
|
|
509
|
-
}
|
|
510
|
-
}
|
|
506
|
+
try {
|
|
507
|
+
window.localStorage.setItem(storageKey, JSON.stringify(this._captureInteractionState()));
|
|
508
|
+
} catch (error) {
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
511
|
|
|
512
512
|
_restoreInteractionState() {
|
|
513
513
|
const stateConfig = this._getStateConfig();
|
|
@@ -635,26 +635,26 @@ dismissTrigger(VGModal);
|
|
|
635
635
|
/**
|
|
636
636
|
* Data API implementation
|
|
637
637
|
*/
|
|
638
|
-
EventHandler.on(document, EVENT_KEY_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
|
639
|
-
const target = Selectors.getElementFromSelector(this);
|
|
638
|
+
EventHandler.on(document, EVENT_KEY_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
|
639
|
+
const target = Selectors.getElementFromSelector(this);
|
|
640
640
|
|
|
641
641
|
if (['A', 'AREA'].includes(this.tagName)) event.preventDefault();
|
|
642
642
|
|
|
643
|
-
EventHandler.one(target, EVENT_KEY_SHOW, showEvent => {
|
|
644
|
-
if (showEvent.defaultPrevented) return;
|
|
645
|
-
});
|
|
646
|
-
|
|
647
|
-
const alreadyOpen = Selectors.find(OPEN_SELECTOR);
|
|
648
|
-
if (alreadyOpen) {
|
|
649
|
-
const alreadyOpenInstance = VGModal.getInstance(alreadyOpen);
|
|
650
|
-
if (alreadyOpenInstance && !alreadyOpenInstance._params.persistent) {
|
|
651
|
-
alreadyOpenInstance.hide([alreadyOpen]);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
const data = VGModal.getOrCreateInstance(target);
|
|
656
|
-
data.toggle(this);
|
|
657
|
-
});
|
|
643
|
+
EventHandler.one(target, EVENT_KEY_SHOW, showEvent => {
|
|
644
|
+
if (showEvent.defaultPrevented) return;
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
const alreadyOpen = Selectors.find(OPEN_SELECTOR);
|
|
648
|
+
if (alreadyOpen) {
|
|
649
|
+
const alreadyOpenInstance = VGModal.getInstance(alreadyOpen);
|
|
650
|
+
if (alreadyOpenInstance && !alreadyOpenInstance._params.persistent) {
|
|
651
|
+
alreadyOpenInstance.hide([alreadyOpen]);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
const data = VGModal.getOrCreateInstance(target);
|
|
656
|
+
data.toggle(this);
|
|
657
|
+
});
|
|
658
658
|
|
|
659
659
|
EventHandler.on(document, EVENT_KEY_DOM_LOADED_DATA_API, function () {
|
|
660
660
|
let targetHash = window.location.hash.slice(1);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const DEFAULT_OPTIONS = {
|
|
2
2
|
enable: false,
|
|
3
|
-
minWidth: 300,
|
|
4
|
-
minHeight: 160,
|
|
5
|
-
edgeSize: 8,
|
|
6
|
-
debug: false,
|
|
7
|
-
};
|
|
3
|
+
minWidth: 300,
|
|
4
|
+
minHeight: 160,
|
|
5
|
+
edgeSize: 8,
|
|
6
|
+
debug: false,
|
|
7
|
+
};
|
|
8
8
|
|
|
9
9
|
const DIRECTION_TO_CURSOR = {
|
|
10
10
|
n: 'ns-resize',
|
|
@@ -228,13 +228,13 @@ class VGModalResize {
|
|
|
228
228
|
document.removeEventListener('pointercancel', this._onPointerUp);
|
|
229
229
|
this._cancelResizeFrame();
|
|
230
230
|
this._applyResizePosition();
|
|
231
|
-
this._pointerId = null;
|
|
232
|
-
this._direction = '';
|
|
233
|
-
delete this._modalElement.dataset.vgModalResizing;
|
|
234
|
-
this._unlockEmbeddedFrames();
|
|
235
|
-
this._setDebugVisibility(this._options.debug);
|
|
236
|
-
this._updateDebugValues();
|
|
237
|
-
}
|
|
231
|
+
this._pointerId = null;
|
|
232
|
+
this._direction = '';
|
|
233
|
+
delete this._modalElement.dataset.vgModalResizing;
|
|
234
|
+
this._unlockEmbeddedFrames();
|
|
235
|
+
this._setDebugVisibility(this._options.debug);
|
|
236
|
+
this._updateDebugValues();
|
|
237
|
+
}
|
|
238
238
|
|
|
239
239
|
_onPointerLeave() {
|
|
240
240
|
if (this._pointerId !== null) return;
|
|
@@ -336,23 +336,23 @@ class VGModalResize {
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
_restoreResizeStyles() {
|
|
340
|
-
this._dialogElement.style.maxWidth = this._previousMaxWidth;
|
|
341
|
-
this._dialogElement.style.maxHeight = this._previousMaxHeight;
|
|
342
|
-
this._dialogElement.style.pointerEvents = this._previousPointerEvents;
|
|
339
|
+
_restoreResizeStyles() {
|
|
340
|
+
this._dialogElement.style.maxWidth = this._previousMaxWidth;
|
|
341
|
+
this._dialogElement.style.maxHeight = this._previousMaxHeight;
|
|
342
|
+
this._dialogElement.style.pointerEvents = this._previousPointerEvents;
|
|
343
343
|
this._dialogElement.style.minHeight = this._previousMinHeight;
|
|
344
344
|
this._dialogElement.style.overflow = this._previousOverflow;
|
|
345
345
|
this._dialogElement.style.transition = this._previousTransition;
|
|
346
346
|
this._dialogElement.style.willChange = this._previousWillChange;
|
|
347
347
|
|
|
348
|
-
if (this._contentElement) {
|
|
349
|
-
this._contentElement.style.height = this._previousContentHeight;
|
|
350
|
-
this._contentElement.style.maxHeight = this._previousContentMaxHeight;
|
|
351
|
-
this._contentElement.style.overflow = this._previousContentOverflow;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
_normalizeOptions(options, base = DEFAULT_OPTIONS) {
|
|
348
|
+
if (this._contentElement) {
|
|
349
|
+
this._contentElement.style.height = this._previousContentHeight;
|
|
350
|
+
this._contentElement.style.maxHeight = this._previousContentMaxHeight;
|
|
351
|
+
this._contentElement.style.overflow = this._previousContentOverflow;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
_normalizeOptions(options, base = DEFAULT_OPTIONS) {
|
|
356
356
|
const merged = {...base, ...options};
|
|
357
357
|
const minWidth = Number(merged.minWidth);
|
|
358
358
|
const minHeight = Number(merged.minHeight);
|
|
@@ -417,9 +417,9 @@ class VGModalResize {
|
|
|
417
417
|
this._dialogElement.append(this._debugElement);
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
-
this._setDebugVisibility(true);
|
|
421
|
-
this._updateDebugValues();
|
|
422
|
-
}
|
|
420
|
+
this._setDebugVisibility(true);
|
|
421
|
+
this._updateDebugValues();
|
|
422
|
+
}
|
|
423
423
|
|
|
424
424
|
_setDebugVisibility(visible) {
|
|
425
425
|
if (!this._debugElement) return;
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
@import "../../../utils/scss/variables";
|
|
12
12
|
@import "variables";
|
|
13
13
|
|
|
14
|
-
.vg-modal {
|
|
15
|
-
@include mix-vars('modal', $modal-map);
|
|
16
|
-
position: fixed;
|
|
17
|
-
left: 0;
|
|
18
|
-
top: 0;
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100%;
|
|
21
|
-
z-index: var(--vg-modal-z-index);
|
|
22
|
-
display: none;
|
|
23
|
-
pointer-events: none;
|
|
24
|
-
overflow-x: hidden;
|
|
25
|
-
overflow-y: auto;
|
|
26
|
-
outline: 0;
|
|
14
|
+
.vg-modal {
|
|
15
|
+
@include mix-vars('modal', $modal-map);
|
|
16
|
+
position: fixed;
|
|
17
|
+
left: 0;
|
|
18
|
+
top: 0;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
z-index: var(--vg-modal-z-index);
|
|
22
|
+
display: none;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
overflow-x: hidden;
|
|
25
|
+
overflow-y: auto;
|
|
26
|
+
outline: 0;
|
|
27
27
|
|
|
28
28
|
&-dialog {
|
|
29
29
|
position: relative;
|
|
@@ -121,4 +121,4 @@
|
|
|
121
121
|
.vg-modal-xl {
|
|
122
122
|
--vg-modal-width: #{$modal-xl};
|
|
123
123
|
}
|
|
124
|
-
}
|
|
124
|
+
}
|