vgapp 0.1.1 → 0.1.2

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 (40) hide show
  1. package/app/modules/base-module.js +6 -1
  2. package/app/modules/module-fn.js +5 -7
  3. package/app/modules/vgdropdown/js/vgdropdown.js +16 -10
  4. package/app/modules/vgdropdown/scss/vgdropdown.css +47 -0
  5. package/app/modules/vgdropdown/scss/vgdropdown.css.map +1 -0
  6. package/app/modules/vgformsender/js/vgformsender.js +1 -1
  7. package/app/modules/vgformsender/scss/vgformsender.css +13 -0
  8. package/app/modules/vgformsender/scss/vgformsender.css.map +1 -0
  9. package/app/modules/vglawcookie/js/vglawcookie.js +182 -0
  10. package/app/modules/vglawcookie/scss/_variables.scss +14 -0
  11. package/app/modules/vglawcookie/scss/vglawcookie.css +87 -0
  12. package/app/modules/vglawcookie/scss/vglawcookie.css.map +1 -0
  13. package/app/modules/vglawcookie/scss/vglawcookie.scss +91 -0
  14. package/app/modules/vgmodal/js/vgmodal.js +22 -28
  15. package/app/modules/vgmodal/scss/vgmodal.css +3824 -0
  16. package/app/modules/vgmodal/scss/vgmodal.css.map +1 -0
  17. package/app/modules/vgnav/scss/vgnav.css +309 -0
  18. package/app/modules/vgnav/scss/vgnav.css.map +1 -0
  19. package/app/modules/vgrollup/js/vgrollup.js +10 -10
  20. package/app/modules/vgrollup/scss/vgrollup.css +41 -0
  21. package/app/modules/vgrollup/scss/vgrollup.css.map +1 -0
  22. package/app/modules/vgsidebar/js/vgsidebar.js +16 -5
  23. package/app/modules/vgsidebar/scss/vgsidebar.css +86 -0
  24. package/app/modules/vgsidebar/scss/vgsidebar.css.map +1 -0
  25. package/app/utils/js/components/alert.js +8 -0
  26. package/app/utils/js/components/animation.js +53 -0
  27. package/app/utils/js/components/backdrop.js +7 -5
  28. package/app/utils/js/dom/cookie.js +127 -0
  29. package/app/utils/js/dom/data.js +1 -1
  30. package/app/utils/scss/default.css +275 -0
  31. package/app/utils/scss/default.css.map +1 -0
  32. package/app/utils/scss/variables.scss +5 -4
  33. package/build/vgapp.css +1 -0
  34. package/build/vgapp.css.map +1 -1
  35. package/build/vgapp.js +2 -1
  36. package/build/vgapp.js.LICENSE.txt +1 -0
  37. package/build/vgapp.js.map +1 -1
  38. package/index.js +5 -1
  39. package/package.json +1 -1
  40. package/app/modules/vgsidebar/js/!oldjs.txt +0 -143
@@ -1,11 +1,10 @@
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, isVisible, mergeDeepObject, reflow} from "../../../utils/js/functions";
7
+ import {execute, isDisabled, isRTL, mergeDeepObject, reflow} from "../../../utils/js/functions";
9
8
  import {dismissTrigger} from "../../module-fn";
10
9
 
11
10
  /**
@@ -54,10 +53,10 @@ class VGModal extends BaseModule {
54
53
  loader: false
55
54
  },
56
55
  animation: {
57
- name: ['animate__backInUp', 'animate__backOutUp'], // до / после не более двух элементов
58
- duration: 1000, // ms
59
- delay: 1000, // ms
60
- repeat: 1
56
+ enable: false,
57
+ in: 'animate__rollIn',
58
+ out: 'animate__rollOut',
59
+ delay: 800,
61
60
  },
62
61
  classes: {
63
62
  general: 'vg-modal',
@@ -67,9 +66,9 @@ class VGModal extends BaseModule {
67
66
  title: 'vg-modal-title',
68
67
  body: 'vg-modal-body',
69
68
  footer: 'vg-modal-footer',
70
- animated: 'animate__animated'
71
69
  }
72
70
  }, params));
71
+
73
72
  this._button = null;
74
73
  this._dialog = Selectors.find(SELECTOR_DIALOG, this._element);
75
74
  this._isShown = false;
@@ -78,6 +77,9 @@ class VGModal extends BaseModule {
78
77
 
79
78
  this._addEventListeners();
80
79
  this._dismissElement();
80
+
81
+ this._params.animation.delay = !this._params.animation.enable ? 0 : this._params.animation.delay;
82
+ this._animation(this._element, VGModal.NAME_KEY, this._params.animation);
81
83
  }
82
84
 
83
85
  static get NAME() {
@@ -161,9 +163,10 @@ class VGModal extends BaseModule {
161
163
  this._isShown = false;
162
164
  this._isTransitioning = true;
163
165
 
164
- this._element.classList.remove(CLASS_NAME_SHOW);
165
-
166
- this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
166
+ setTimeout(() => {
167
+ this._element.classList.remove(CLASS_NAME_SHOW);
168
+ this._queueCallback(() => this._hideModal(), this._element, this._isAnimatedFade());
169
+ }, this._params.animation.delay);
167
170
  }
168
171
 
169
172
  _hideModal() {
@@ -177,6 +180,7 @@ class VGModal extends BaseModule {
177
180
  document.body.classList.remove(CLASS_NAME_OPEN);
178
181
  this._resetAdjustments();
179
182
  this._scrollBar.reset();
183
+
180
184
  EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
181
185
  })
182
186
  }
@@ -202,20 +206,16 @@ class VGModal extends BaseModule {
202
206
  this._element.classList.add(CLASS_NAME_SHOW)
203
207
 
204
208
  const transitionComplete = () => {
205
- if (this._params.focus) {
206
- // TODO сделать фокус
207
- }
208
-
209
- this._isTransitioning = false
209
+ this._isTransitioning = false;
210
210
  EventHandler.trigger(this._element, EVENT_KEY_SHOWN, {
211
211
  relatedTarget
212
- })
212
+ });
213
213
  }
214
214
 
215
- this._queueCallback(transitionComplete, this._dialog, this._isAnimated())
215
+ this._queueCallback(transitionComplete, this._dialog, this._isAnimatedFade())
216
216
  }
217
217
 
218
- _isAnimated() {
218
+ _isAnimatedFade() {
219
219
  return this._element.classList.contains(CLASS_NAME_FADE)
220
220
  }
221
221
 
@@ -250,11 +250,11 @@ class VGModal extends BaseModule {
250
250
  }
251
251
 
252
252
  this._triggerBackdropTransition();
253
- })
253
+ });
254
254
 
255
255
  EventHandler.on(window, EVENT_KEY_RESIZE, () => {
256
256
  if (this._isShown && !this._isTransitioning) this._adjustDialog();
257
- })
257
+ });
258
258
 
259
259
  EventHandler.on(this._element, EVENT_KEY_MOUSEDOWN_DISMISS, event => {
260
260
  EventHandler.one(this._element, EVENT_KEY_CLICK_DISMISS, event2 => {
@@ -269,7 +269,7 @@ class VGModal extends BaseModule {
269
269
  this.hide();
270
270
  }
271
271
  })
272
- })
272
+ });
273
273
  }
274
274
 
275
275
  _triggerBackdropTransition() {
@@ -290,8 +290,6 @@ class VGModal extends BaseModule {
290
290
  this._element.style.overflowY = initialOverflowY;
291
291
  }, this._dialog);
292
292
  }, this._dialog);
293
-
294
- //this._element.focus();
295
293
  }
296
294
 
297
295
  _addFieldsInModal(relatedTarget) {
@@ -330,10 +328,6 @@ EventHandler.on(document, EVENT_KEY_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, functi
330
328
 
331
329
  EventHandler.one(target, EVENT_KEY_SHOW, showEvent => {
332
330
  if (showEvent.defaultPrevented) return;
333
- /*
334
- EventHandler.one(target, EVENT_KEY_HIDDEN, () => {
335
- if (isVisible(this)) this.focus();
336
- });*/
337
331
  });
338
332
 
339
333
  const alreadyOpen = Selectors.find(OPEN_SELECTOR);
@@ -343,4 +337,4 @@ EventHandler.on(document, EVENT_KEY_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, functi
343
337
  data.toggle(this);
344
338
  })
345
339
 
346
- export default VGModal;
340
+ export default VGModal;