vgapp 0.7.2 → 0.7.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.
@@ -17,10 +17,12 @@ const getSVG = (name) => {
17
17
  success: '<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-error" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(117, 183, 152, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-success-circle" id="Oval-2" stroke="#A5DC86" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><polyline class="ui-success-path" id="Path-2" stroke="#A5DC86" stroke-width="4" points="19 38.8036813 31.1020744 54.8046875 63.299221 28"></polyline></g></g></svg>',
18
18
  waiting: '<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-waiting" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(255, 218, 106, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-waiting-circle" id="Oval-2" stroke="#ffda6a" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><path class="ui-waiting-line1" d="M43 63C54.598 63 64 53.598 64 42C64 30.402 54.598 21 43 21C31.402 21 22 30.402 22 42C22 53.598 31.402 63 43 63Z" stroke-width="3" stroke="#ffda6a" stroke-linecap="round" stroke-linejoin="round"/><path class="ui-waiting-line2" d="M40.6667 32.6641V44.3307H52.3334" stroke="#ffda6a" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></g></g></svg>',
19
19
  dots: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-three-dots-vertical" viewBox="0 0 16 16"><path d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></svg>',
20
- cross: '<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path style="mix-blend-mode:plus-darker" d="M15.3149 0.340332C15.4478 0.20752 15.6027 0.118978 15.7798 0.074707C15.9569 0.0249023 16.134 0.0249023 16.311 0.074707C16.4881 0.118978 16.6431 0.20752 16.7759 0.340332C16.9142 0.473145 17.0055 0.630859 17.0498 0.813477C17.0941 0.99056 17.0941 1.16764 17.0498 1.34473C17.0055 1.52181 16.917 1.67676 16.7842 1.80957L1.80127 16.8008C1.67399 16.9281 1.52181 17.0111 1.34473 17.0498C1.16764 17.0941 0.987793 17.0941 0.805176 17.0498C0.628092 17.0111 0.470378 16.9253 0.332031 16.7925C0.199219 16.6597 0.110677 16.502 0.0664062 16.3193C0.0221354 16.1423 0.0221354 15.9652 0.0664062 15.7881C0.110677 15.611 0.196452 15.4588 0.32373 15.3315L15.3149 0.340332ZM16.7842 15.3232C16.917 15.4561 17.0028 15.6082 17.0415 15.7798C17.0858 15.9569 17.0858 16.134 17.0415 16.311C17.0028 16.4937 16.9142 16.6541 16.7759 16.7925C16.6431 16.9253 16.4881 17.0138 16.311 17.0581C16.134 17.1024 15.9569 17.1024 15.7798 17.0581C15.6027 17.0138 15.4478 16.9253 15.3149 16.7925L0.32373 1.80127C0.201986 1.67952 0.116211 1.53011 0.0664062 1.35303C0.0221354 1.17594 0.0221354 0.996094 0.0664062 0.813477C0.116211 0.630859 0.204753 0.473145 0.332031 0.340332C0.464844 0.20752 0.622559 0.118978 0.805176 0.074707C0.987793 0.0304362 1.16488 0.0304362 1.33643 0.074707C1.51351 0.118978 1.66846 0.204753 1.80127 0.332031L16.7842 15.3232Z" fill="#000"/></svg>'
20
+ cross: '<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path style="mix-blend-mode:plus-darker" d="M15.3149 0.340332C15.4478 0.20752 15.6027 0.118978 15.7798 0.074707C15.9569 0.0249023 16.134 0.0249023 16.311 0.074707C16.4881 0.118978 16.6431 0.20752 16.7759 0.340332C16.9142 0.473145 17.0055 0.630859 17.0498 0.813477C17.0941 0.99056 17.0941 1.16764 17.0498 1.34473C17.0055 1.52181 16.917 1.67676 16.7842 1.80957L1.80127 16.8008C1.67399 16.9281 1.52181 17.0111 1.34473 17.0498C1.16764 17.0941 0.987793 17.0941 0.805176 17.0498C0.628092 17.0111 0.470378 16.9253 0.332031 16.7925C0.199219 16.6597 0.110677 16.502 0.0664062 16.3193C0.0221354 16.1423 0.0221354 15.9652 0.0664062 15.7881C0.110677 15.611 0.196452 15.4588 0.32373 15.3315L15.3149 0.340332ZM16.7842 15.3232C16.917 15.4561 17.0028 15.6082 17.0415 15.7798C17.0858 15.9569 17.0858 16.134 17.0415 16.311C17.0028 16.4937 16.9142 16.6541 16.7759 16.7925C16.6431 16.9253 16.4881 17.0138 16.311 17.0581C16.134 17.1024 15.9569 17.1024 15.7798 17.0581C15.6027 17.0138 15.4478 16.9253 15.3149 16.7925L0.32373 1.80127C0.201986 1.67952 0.116211 1.53011 0.0664062 1.35303C0.0221354 1.17594 0.0221354 0.996094 0.0664062 0.813477C0.116211 0.630859 0.204753 0.473145 0.332031 0.340332C0.464844 0.20752 0.622559 0.118978 0.805176 0.074707C0.987793 0.0304362 1.16488 0.0304362 1.33643 0.074707C1.51351 0.118978 1.66846 0.204753 1.80127 0.332031L16.7842 15.3232Z" fill="#000"/></svg>',
21
+ danger: '',
22
+ info: ''
21
23
  };
22
24
 
23
- return svg[name] ?? {};
25
+ return svg[name] ?? '';
24
26
  }
25
27
 
26
28
  /**
@@ -51,6 +51,7 @@ class VGModal extends BaseModule {
51
51
  fields: [],
52
52
  hash: false,
53
53
  centered: false,
54
+ dismiss: true,
54
55
  ajax: {
55
56
  route: '',
56
57
  target: '',
@@ -106,8 +107,11 @@ class VGModal extends BaseModule {
106
107
  if (typeof id !== "string") return;
107
108
 
108
109
  let _element = document.createElement('div');
109
- _element.classList.add('vg-modal', 'fade');
110
- _element.id = id;let dialog = document.createElement('div');
110
+ _element.classList.add('vg-modal');
111
+ _element.classList.add('fade');
112
+ _element.id = id;
113
+
114
+ let dialog = document.createElement('div');
111
115
  dialog.classList.add('vg-modal-dialog');
112
116
 
113
117
  if ('centered' in params && params.centered) {
@@ -117,14 +121,16 @@ class VGModal extends BaseModule {
117
121
  let content = document.createElement('div');
118
122
  content.classList.add('vg-modal-content');
119
123
 
120
- let btnClose = document.createElement('button');
121
- Manipulator.set(btnClose, 'type', 'button');
122
- Manipulator.set(btnClose, 'data-vg-dismiss', 'modal');
123
- Manipulator.set(btnClose, 'data-vg-target', '#' + id);
124
- Manipulator.set(btnClose, 'aria-label', 'close');
125
- btnClose.classList.add('vg-btn-close');
124
+ if ('dismiss' in params && params.dismiss) {
125
+ let btnClose = document.createElement('button');
126
+ Manipulator.set(btnClose, 'type', 'button');
127
+ Manipulator.set(btnClose, 'data-vg-dismiss', 'modal');
128
+ Manipulator.set(btnClose, 'data-vg-target', '#' + id);
129
+ Manipulator.set(btnClose, 'aria-label', 'close');
130
+ btnClose.classList.add('vg-btn-close');
126
131
 
127
- content.append(btnClose);
132
+ content.append(btnClose);
133
+ }
128
134
 
129
135
  let body = document.createElement('div');
130
136
  body.classList.add('vg-modal-body');
@@ -136,6 +142,9 @@ class VGModal extends BaseModule {
136
142
  document.body.append(_element);
137
143
 
138
144
  const modal = VGModal.getOrCreateInstance(_element, params);
145
+ if ('animation' in params) {
146
+ modal._animation(_element, VGModal.NAME_KEY, params.animation);
147
+ }
139
148
 
140
149
  execute(callback, [modal]);
141
150
 
@@ -308,12 +308,13 @@ class VGSelect extends BaseModule {
308
308
  let observer = new MutationObserver(() => {
309
309
  clearTimeout(observerTimout);
310
310
  observerTimout = setTimeout(() => {
311
+ console.log('asdas')
311
312
  VGSelect.build(select, true);
312
313
  }, 10);
313
314
  });
314
315
 
315
316
  observer.observe(select, {
316
- attributeFilter: ['disabled', 'required', 'style', 'hidden'],
317
+ attributeFilter: ['disabled', 'required', 'style', 'hidden', 'value', 'selected'],
317
318
  childList: true,
318
319
  subtree: true,
319
320
  characterDataOldValue: true,
@@ -30,6 +30,8 @@ class Animation {
30
30
 
31
31
  this._element.classList.add(this.classes.duration);
32
32
 
33
+ if (this._element.classList.contains('fade')) this._element.classList.remove('fade');
34
+
33
35
  this._triggers();
34
36
  }
35
37
 
@@ -37,6 +39,8 @@ class Animation {
37
39
  EventHandler.on(this._element, this._name_key + '.show', () => {
38
40
  this._element.classList.remove(this._params.out);
39
41
  this._element.classList.add(this._params.in);
42
+ });
43
+ EventHandler.on(this._element, this._name_key + '.shown', () => {
40
44
  this._element.classList.add(this.classes.animated);
41
45
  });
42
46
 
@@ -46,8 +50,11 @@ class Animation {
46
50
  });
47
51
 
48
52
  EventHandler.on(this._element, this._name_key + '.hidden', () => {
49
- this._element.classList.remove(this._params.out);
50
- this._element.classList.remove(this.classes.animated);
53
+ [... this._element.classList].forEach((cl) => {
54
+ if (cl.indexOf('animate__') !== -1) {
55
+ this._element.classList.remove(cl);
56
+ }
57
+ })
51
58
  });
52
59
  }
53
60
  }
@@ -4,6 +4,7 @@ $bg-color-active: #c7dcf6 !default;
4
4
 
5
5
  // -- Colors
6
6
  $color: #000000 !default;
7
+ $color-emphasis: #3c3c3c !default;
7
8
  $color-active: #0065ff !default;
8
9
  $color-disabled: rgba(#000000, .5) !default;
9
10