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
package/index.js CHANGED
@@ -28,6 +28,10 @@ import VGFormSender from "./app/modules/vgformsender/js/vgformsender";
28
28
  import "./app/modules/vgrollup/scss/vgrollup.scss";
29
29
  import VGRollup from "./app/modules/vgrollup/js/vgrollup";
30
30
 
31
+ // law cookie
32
+ import "./app/modules/vglawcookie/scss/vglawcookie.scss";
33
+ import VGLawCookie from "./app/modules/vglawcookie/js/vglawcookie";
34
+
31
35
  export {
32
- VGSidebar, VGCollapse, VGNav, VGDropdown, VGModal, VGFormSender, VGRollup
36
+ VGSidebar, VGCollapse, VGNav, VGDropdown, VGModal, VGFormSender, VGRollup, VGLawCookie
33
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vgapp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "author": {
6
6
  "name": "Vegas Studio",
@@ -1,143 +0,0 @@
1
- build(isFirstInit = true) {
2
- let self_height = this._element.clientHeight,
3
- set_height = parseInt(this._params.height) || (self_height / 2);
4
-
5
- if (isFirstInit) this._element.classList.add('vg-rollup');
6
-
7
- if (self_height > set_height && this._params.content === 'text') {
8
- this._element.classList.add(this._params.classes.hidden);
9
- this._element.style.height = set_height + "px";
10
-
11
- this.ellipsis();
12
- this.fade();
13
- if (isFirstInit) this.button();
14
- } else if (this._params.content === 'elements') {
15
- let elementClass = this._params.elements,
16
- items = this._element.querySelectorAll('.' + elementClass),
17
- cnt = this._params.cnt,
18
- i = 1;
19
-
20
- this.total = items.length;
21
- this.count = cnt;
22
-
23
- for (const item of items) {
24
- if (i > cnt) {
25
- item.classList.add(CLASS_NAME_HIDE)
26
- }
27
-
28
- i++;
29
- }
30
-
31
- if (this._params.button === true) this._params.button = (i - 1) > cnt;
32
-
33
- this.ellipsis();
34
- this.fade();
35
- if (isFirstInit) this.button();
36
- }
37
-
38
- if (isFirstInit) {
39
- this._button = document.querySelector('[data-vg-target="'+ this._element.id +'"]');
40
- execute(this._params.callback.afterInit, [this]);
41
- }
42
- }
43
-
44
- ellipsis() {
45
- if (this._params.ellipsis.line) {
46
- this._element.classList.add(this._params.classes.ellipsis);
47
- this._element.style.webkitLineClamp = this._params.ellipsis.line;
48
- }
49
- }
50
-
51
- fade() {
52
- if (this._params.fade) {
53
- if (this._element.classList.contains(this._params.classes.ellipsis)) {
54
- this._element.classList.remove(this._params.classes.fade)
55
- } else {
56
- this._element.classList.add(this._params.classes.fade);
57
- }
58
- }
59
- }
60
-
61
- button() {
62
- if (this._params.button) {
63
- let target = this._element.id,
64
- button = document.querySelector('[data-vg-target="'+ target +'"]');
65
-
66
- console.log(button)
67
-
68
- if (!button) {
69
- let textShowNum = '', btnTextShow = this._params.text.show;
70
-
71
- if (this._params.number) {
72
- let sum = (this.total) - (this.count);
73
-
74
- if (sum > 0) {
75
- textShowNum = this._params.text.more + sum;
76
- }
77
- }
78
-
79
- this._element.insertAdjacentHTML("afterend", '<div class="' + this._params.classes.button + '"><a href="#" aria-expanded="false" data-vg-target="#' + target + '" data-vg-toggle="rollup">' + btnTextShow + textShowNum + '</a></div>');
80
- }
81
- }
82
- }
83
-
84
- toggle(relatedTarget) {
85
- return !this._isShown() ? this.show(relatedTarget) : this.hide();
86
- }
87
-
88
- show(relatedTarget) {
89
- if (isDisabled(this._element)) return;
90
-
91
- const showEvent = EventHandler.trigger(this._element, EVENT_KEY_SHOW, { relatedTarget })
92
- if (showEvent.defaultPrevented) return;
93
-
94
- this._element.classList.add(CLASS_NAME_SHOW);
95
-
96
- const completeCallBack = () => {
97
- if (this._params.content === 'elements') {
98
- [... Selectors.findAll('.' + this._params.elements, this._element)].forEach(el => {
99
- if (el.classList.contains(CLASS_NAME_HIDE)) {
100
- el.classList.remove(CLASS_NAME_HIDE)
101
- }
102
- });
103
- } else {
104
- this._element.style.height = this.self_height + "px";
105
- this._element.classList.remove(this._params.classes.fade);
106
-
107
- if (this._element.classList.contains(this._params.classes.ellipsis)) {
108
- this._element.classList.remove(this._params.classes.ellipsis)
109
- }
110
- }
111
-
112
- relatedTarget.innerHTML = this._params.text.hide;
113
-
114
- EventHandler.trigger(this._element, EVENT_KEY_SHOWN, { relatedTarget });
115
- }
116
-
117
- this._button = relatedTarget;
118
- execute(this._params.callback.show, [this]);
119
- this._queueCallback(completeCallBack, this._element, true, 50)
120
- }
121
-
122
- hide() {
123
- if (isDisabled(this._element)) return;
124
-
125
- const hideEvent = EventHandler.trigger(this._element, EVENT_KEY_HIDE);
126
- if (hideEvent.defaultPrevented) return;
127
-
128
- this._element.setAttribute('aria-expanded', 'false');
129
-
130
- this.build(false)
131
-
132
- const completeCallback = () => {
133
- this._element.classList.remove(CLASS_NAME_SHOW);
134
- EventHandler.trigger(this._element, EVENT_KEY_HIDDEN)
135
- };
136
-
137
- execute(this._params.callback.hide, [this]);
138
- this._queueCallback(completeCallback, this._element, true);
139
- }
140
-
141
- _isShown() {
142
- return this._element.classList.contains(CLASS_NAME_SHOW);
143
- }