vgapp 0.1.1 → 0.1.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.
- package/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/app/modules/base-module.js +6 -1
- package/app/modules/module-fn.js +5 -7
- package/app/modules/vgdropdown/js/vgdropdown.js +16 -10
- package/app/modules/vgdropdown/scss/vgdropdown.css +47 -0
- package/app/modules/vgdropdown/scss/vgdropdown.css.map +1 -0
- package/app/modules/vgformsender/js/vgformsender.js +1 -1
- package/app/modules/vgformsender/scss/vgformsender.css +13 -0
- package/app/modules/vgformsender/scss/vgformsender.css.map +1 -0
- package/app/modules/vglawcookie/js/vglawcookie.js +182 -0
- package/app/modules/vglawcookie/scss/_variables.scss +14 -0
- package/app/modules/vglawcookie/scss/vglawcookie.css +87 -0
- package/app/modules/vglawcookie/scss/vglawcookie.css.map +1 -0
- package/app/modules/vglawcookie/scss/vglawcookie.scss +91 -0
- package/app/modules/vgmodal/js/vgmodal.js +24 -28
- package/app/modules/vgmodal/scss/vgmodal.css +3824 -0
- package/app/modules/vgmodal/scss/vgmodal.css.map +1 -0
- package/app/modules/vgnav/scss/vgnav.css +309 -0
- package/app/modules/vgnav/scss/vgnav.css.map +1 -0
- package/app/modules/vgnotify/scss/vgnotify.css +3 -0
- package/app/modules/vgnotify/scss/vgnotify.css.map +1 -0
- package/app/modules/vgrollup/js/vgrollup.js +10 -10
- package/app/modules/vgrollup/scss/vgrollup.css +41 -0
- package/app/modules/vgrollup/scss/vgrollup.css.map +1 -0
- package/app/modules/vgselect/js/vgselect.js +341 -0
- package/app/modules/vgselect/scss/_variables.scss +74 -0
- package/app/modules/vgselect/scss/vgselect.css +243 -0
- package/app/modules/vgselect/scss/vgselect.css.map +1 -0
- package/app/modules/vgselect/scss/vgselect.scss +216 -0
- package/app/modules/vgsidebar/js/vgsidebar.js +21 -9
- package/app/modules/vgsidebar/scss/vgsidebar.css +86 -0
- package/app/modules/vgsidebar/scss/vgsidebar.css.map +1 -0
- package/app/utils/js/components/alert.js +8 -0
- package/app/utils/js/components/animation.js +53 -0
- package/app/utils/js/components/backdrop.js +7 -5
- package/app/utils/js/dom/cookie.js +127 -0
- package/app/utils/js/dom/data.js +1 -1
- package/app/utils/js/dom/manipulator.js +9 -1
- package/app/utils/js/functions.js +20 -1
- package/app/utils/scss/default.css +275 -0
- package/app/utils/scss/default.css.map +1 -0
- package/app/utils/scss/variables.scss +5 -4
- package/build/vgapp.css +2 -0
- 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 +9 -1
- package/package.json +1 -1
- package/app/modules/vgsidebar/js/!oldjs.txt +0 -143
- /package/app/modules/vgnotify/scss/{vgnotify.sass → vgnotify.scss} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import BaseModule from "../../base-module";
|
|
2
2
|
import ScrollBarHelper from "../../../utils/js/components/scrollbar";
|
|
3
3
|
import Backdrop from "../../../utils/js/components/backdrop";
|
|
4
|
-
import Overflow from "../../../utils/js/components/overflow";
|
|
5
4
|
import Selectors from "../../../utils/js/dom/selectors";
|
|
6
5
|
import EventHandler from "../../../utils/js/dom/event";
|
|
7
6
|
import {Manipulator} from "../../../utils/js/dom/manipulator";
|
|
8
|
-
import {execute, isDisabled, isRTL,
|
|
7
|
+
import {execute, isDisabled, isRTL, mergeDeepObject, reflow} from "../../../utils/js/functions";
|
|
9
8
|
import {dismissTrigger} from "../../module-fn";
|
|
9
|
+
import Params from "../../../utils/js/components/params";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Constants
|
|
@@ -54,10 +54,10 @@ class VGModal extends BaseModule {
|
|
|
54
54
|
loader: false
|
|
55
55
|
},
|
|
56
56
|
animation: {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
enable: false,
|
|
58
|
+
in: 'animate__rollIn',
|
|
59
|
+
out: 'animate__rollOut',
|
|
60
|
+
delay: 800,
|
|
61
61
|
},
|
|
62
62
|
classes: {
|
|
63
63
|
general: 'vg-modal',
|
|
@@ -67,9 +67,9 @@ class VGModal extends BaseModule {
|
|
|
67
67
|
title: 'vg-modal-title',
|
|
68
68
|
body: 'vg-modal-body',
|
|
69
69
|
footer: 'vg-modal-footer',
|
|
70
|
-
animated: 'animate__animated'
|
|
71
70
|
}
|
|
72
71
|
}, params));
|
|
72
|
+
|
|
73
73
|
this._button = null;
|
|
74
74
|
this._dialog = Selectors.find(SELECTOR_DIALOG, this._element);
|
|
75
75
|
this._isShown = false;
|
|
@@ -78,6 +78,9 @@ class VGModal extends BaseModule {
|
|
|
78
78
|
|
|
79
79
|
this._addEventListeners();
|
|
80
80
|
this._dismissElement();
|
|
81
|
+
|
|
82
|
+
this._params.animation.delay = !this._params.animation.enable ? 0 : this._params.animation.delay;
|
|
83
|
+
this._animation(this._element, VGModal.NAME_KEY, this._params.animation);
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
static get NAME() {
|
|
@@ -134,6 +137,7 @@ class VGModal extends BaseModule {
|
|
|
134
137
|
const _this = this;
|
|
135
138
|
if (isDisabled(_this._element)) return;
|
|
136
139
|
|
|
140
|
+
this._params = this._getParams(relatedTarget, this._params);
|
|
137
141
|
this._route();
|
|
138
142
|
|
|
139
143
|
const showEvent = EventHandler.trigger(this._element, EVENT_KEY_SHOW, { relatedTarget })
|
|
@@ -161,9 +165,10 @@ class VGModal extends BaseModule {
|
|
|
161
165
|
this._isShown = false;
|
|
162
166
|
this._isTransitioning = true;
|
|
163
167
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
setTimeout(() => {
|
|
169
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
170
|
+
this._queueCallback(() => this._hideModal(), this._element, this._isAnimatedFade());
|
|
171
|
+
}, this._params.animation.delay);
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
_hideModal() {
|
|
@@ -177,6 +182,7 @@ class VGModal extends BaseModule {
|
|
|
177
182
|
document.body.classList.remove(CLASS_NAME_OPEN);
|
|
178
183
|
this._resetAdjustments();
|
|
179
184
|
this._scrollBar.reset();
|
|
185
|
+
|
|
180
186
|
EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
|
|
181
187
|
})
|
|
182
188
|
}
|
|
@@ -202,20 +208,16 @@ class VGModal extends BaseModule {
|
|
|
202
208
|
this._element.classList.add(CLASS_NAME_SHOW)
|
|
203
209
|
|
|
204
210
|
const transitionComplete = () => {
|
|
205
|
-
|
|
206
|
-
// TODO сделать фокус
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
this._isTransitioning = false
|
|
211
|
+
this._isTransitioning = false;
|
|
210
212
|
EventHandler.trigger(this._element, EVENT_KEY_SHOWN, {
|
|
211
213
|
relatedTarget
|
|
212
|
-
})
|
|
214
|
+
});
|
|
213
215
|
}
|
|
214
216
|
|
|
215
|
-
this._queueCallback(transitionComplete, this._dialog, this.
|
|
217
|
+
this._queueCallback(transitionComplete, this._dialog, this._isAnimatedFade())
|
|
216
218
|
}
|
|
217
219
|
|
|
218
|
-
|
|
220
|
+
_isAnimatedFade() {
|
|
219
221
|
return this._element.classList.contains(CLASS_NAME_FADE)
|
|
220
222
|
}
|
|
221
223
|
|
|
@@ -250,11 +252,11 @@ class VGModal extends BaseModule {
|
|
|
250
252
|
}
|
|
251
253
|
|
|
252
254
|
this._triggerBackdropTransition();
|
|
253
|
-
})
|
|
255
|
+
});
|
|
254
256
|
|
|
255
257
|
EventHandler.on(window, EVENT_KEY_RESIZE, () => {
|
|
256
258
|
if (this._isShown && !this._isTransitioning) this._adjustDialog();
|
|
257
|
-
})
|
|
259
|
+
});
|
|
258
260
|
|
|
259
261
|
EventHandler.on(this._element, EVENT_KEY_MOUSEDOWN_DISMISS, event => {
|
|
260
262
|
EventHandler.one(this._element, EVENT_KEY_CLICK_DISMISS, event2 => {
|
|
@@ -269,7 +271,7 @@ class VGModal extends BaseModule {
|
|
|
269
271
|
this.hide();
|
|
270
272
|
}
|
|
271
273
|
})
|
|
272
|
-
})
|
|
274
|
+
});
|
|
273
275
|
}
|
|
274
276
|
|
|
275
277
|
_triggerBackdropTransition() {
|
|
@@ -290,8 +292,6 @@ class VGModal extends BaseModule {
|
|
|
290
292
|
this._element.style.overflowY = initialOverflowY;
|
|
291
293
|
}, this._dialog);
|
|
292
294
|
}, this._dialog);
|
|
293
|
-
|
|
294
|
-
//this._element.focus();
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
_addFieldsInModal(relatedTarget) {
|
|
@@ -330,10 +330,6 @@ EventHandler.on(document, EVENT_KEY_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, functi
|
|
|
330
330
|
|
|
331
331
|
EventHandler.one(target, EVENT_KEY_SHOW, showEvent => {
|
|
332
332
|
if (showEvent.defaultPrevented) return;
|
|
333
|
-
/*
|
|
334
|
-
EventHandler.one(target, EVENT_KEY_HIDDEN, () => {
|
|
335
|
-
if (isVisible(this)) this.focus();
|
|
336
|
-
});*/
|
|
337
333
|
});
|
|
338
334
|
|
|
339
335
|
const alreadyOpen = Selectors.find(OPEN_SELECTOR);
|
|
@@ -343,4 +339,4 @@ EventHandler.on(document, EVENT_KEY_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, functi
|
|
|
343
339
|
data.toggle(this);
|
|
344
340
|
})
|
|
345
341
|
|
|
346
|
-
export default VGModal;
|
|
342
|
+
export default VGModal;
|