vgapp 0.7.3 → 0.7.4
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 +10 -0
- package/app/modules/module-fn.js +7 -7
- package/app/modules/vgalert/index.js +3 -0
- package/app/modules/vgalert/js/!old/!vgalert.js +153 -0
- package/app/modules/vgalert/js/vgalert.js +337 -0
- package/app/modules/vgalert/scss/_variables.scss +1 -0
- package/app/modules/vgalert/scss/vgalert.scss +66 -0
- package/app/modules/vgformsender/js/vgformsender.js +14 -10
- package/app/modules/vgformsender/scss/_variables.scss +1 -1
- package/app/modules/vgformsender/scss/vgformsender.scss +53 -4
- package/app/modules/vgloadmore/js/vgloadmore.js +2 -2
- package/app/modules/vgrollup/js/vgrollup.js +1 -1
- package/app/modules/vgselect/js/vgselect.js +0 -1
- package/app/modules/vgspy/js/vgspy.js +0 -1
- package/app/utils/scss/animation.scss +11 -0
- package/app/utils/scss/default.scss +3 -141
- package/app/utils/scss/functions.scss +18 -0
- package/app/utils/scss/mixin.scss +12 -0
- package/app/utils/scss/variables.scss +19 -15
- package/build/vgapp.css +3 -1743
- package/build/vgapp.css.map +1 -1
- package/build/vgapp.js +2 -30
- package/index.js +1 -1
- package/package.json +1 -1
- package/app/utils/scss/animate.scss +0 -4081
|
@@ -31,6 +31,8 @@ const NAME_KEY = 'vg.fs';
|
|
|
31
31
|
/**
|
|
32
32
|
* Constants Events
|
|
33
33
|
*/
|
|
34
|
+
const CLASS_NAME_ALERT = 'vg-form-sender-alert';
|
|
35
|
+
|
|
34
36
|
const EVENT_KEY_SUCCESS = 'vg.fs.success';
|
|
35
37
|
const EVENT_KEY_ERROR = 'vg.fs.error';
|
|
36
38
|
const EVENT_KEY_BEFORE = 'vg.fs.before';
|
|
@@ -297,7 +299,7 @@ class VGFormSender extends BaseModule {
|
|
|
297
299
|
}
|
|
298
300
|
} else {
|
|
299
301
|
if ('errors' in response && normalizeData(response.errors)) {
|
|
300
|
-
status = normalizeData(response.errors) ? '
|
|
302
|
+
status = normalizeData(response.errors) ? 'danger' : 'success';
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
305
|
}
|
|
@@ -388,7 +390,9 @@ class VGFormSender extends BaseModule {
|
|
|
388
390
|
}
|
|
389
391
|
|
|
390
392
|
setDataRelationStatus($element, status, data, type) {
|
|
391
|
-
|
|
393
|
+
if (status === 'error') status = 'danger';
|
|
394
|
+
|
|
395
|
+
let $alert = Selectors.find('.'+ CLASS_NAME_ALERT +'-' + status, $element);
|
|
392
396
|
|
|
393
397
|
if (isObject(data)) {
|
|
394
398
|
if (status === 'error') {
|
|
@@ -435,11 +439,11 @@ class VGFormSender extends BaseModule {
|
|
|
435
439
|
code = ' ' + data.text + ' (' + data.code + ')';
|
|
436
440
|
}
|
|
437
441
|
|
|
438
|
-
if (!title) txt += '<h4 class="
|
|
439
|
-
else txt += '<h4 class="
|
|
442
|
+
if (!title) txt += '<h4 class="'+ CLASS_NAME_ALERT +'-content--title">' + code + '</h4>';
|
|
443
|
+
else txt += '<h4 class="'+ CLASS_NAME_ALERT +'-content--title">' + title + '</h4>';
|
|
440
444
|
|
|
441
445
|
if ('message' in response) {
|
|
442
|
-
txt += '<div class="
|
|
446
|
+
txt += '<div class="'+ CLASS_NAME_ALERT +'-content--message">' + response.message + '</div>'
|
|
443
447
|
}
|
|
444
448
|
|
|
445
449
|
if ('errors' in response && this._params.alert.errors) {
|
|
@@ -469,13 +473,13 @@ class VGFormSender extends BaseModule {
|
|
|
469
473
|
|
|
470
474
|
if (!$alert) {
|
|
471
475
|
$alert = document.createElement('div');
|
|
472
|
-
$alert.classList.add(
|
|
476
|
+
$alert.classList.add(CLASS_NAME_ALERT, CLASS_NAME_ALERT + '-' + status, CLASS_NAME_ALERT + '-' + type);
|
|
473
477
|
|
|
474
478
|
let content = document.createElement('div');
|
|
475
|
-
content.classList.add('
|
|
479
|
+
content.classList.add(CLASS_NAME_ALERT + '-content');
|
|
476
480
|
|
|
477
481
|
let icon = document.createElement('div');
|
|
478
|
-
icon.classList.add('
|
|
482
|
+
icon.classList.add(CLASS_NAME_ALERT + '-content--icon');
|
|
479
483
|
|
|
480
484
|
let i = document.createElement('i');
|
|
481
485
|
i.innerHTML = getSVG(status);
|
|
@@ -484,13 +488,13 @@ class VGFormSender extends BaseModule {
|
|
|
484
488
|
content.append(icon);
|
|
485
489
|
|
|
486
490
|
let text = document.createElement('div');
|
|
487
|
-
text.classList.add('
|
|
491
|
+
text.classList.add(CLASS_NAME_ALERT + '-content--text');
|
|
488
492
|
text.innerHTML = data.view;
|
|
489
493
|
|
|
490
494
|
content.append(text);
|
|
491
495
|
$alert.append(content);
|
|
492
496
|
} else {
|
|
493
|
-
let text = Selectors.find('.
|
|
497
|
+
let text = Selectors.find('.'+ CLASS_NAME_ALERT +'-content--text', $alert);
|
|
494
498
|
text.innerHTML = data.view;
|
|
495
499
|
}
|
|
496
500
|
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*--------------------------------------------------------------------------
|
|
7
7
|
**/
|
|
8
8
|
|
|
9
|
-
@import
|
|
10
|
-
@import
|
|
11
|
-
@import
|
|
12
|
-
@import
|
|
9
|
+
@import '../../../utils/scss/functions';
|
|
10
|
+
@import '../../../utils/scss/mixin';
|
|
11
|
+
@import '../../../utils/scss/variables';
|
|
12
|
+
@import 'variables';
|
|
13
13
|
|
|
14
14
|
.vg-form-sender {
|
|
15
15
|
@include mix-vars('form-sender', $form-sender-map);
|
|
@@ -45,4 +45,53 @@
|
|
|
45
45
|
right: 34px;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.vg-form-sender-alert {
|
|
51
|
+
@include mix-alert-color-mode($class: vg-form-sender-alert);
|
|
52
|
+
|
|
53
|
+
background-color: var(--vg-form-sender-alert-background-color);
|
|
54
|
+
border: 1px solid var(--vg-form-sender-alert-border-color) ;
|
|
55
|
+
border-radius: var(--vg-border-radius);
|
|
56
|
+
|
|
57
|
+
&.vg-form-sender-alert-modal {
|
|
58
|
+
height: 260px;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
|
|
63
|
+
.vg-form-sender-alert-content {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 1.5rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.vg-form-sender-alert-content--text {
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.vg-form-sender-alert-collapse {
|
|
76
|
+
margin-bottom: 2rem;
|
|
77
|
+
padding: 2rem;
|
|
78
|
+
|
|
79
|
+
.vg-form-sender-alert-content {
|
|
80
|
+
display: flex;
|
|
81
|
+
gap: 2rem;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.vg-form-sender-alert-content--icon {
|
|
87
|
+
svg {
|
|
88
|
+
path {
|
|
89
|
+
fill: var(--vg-form-sender-alert-icon);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.vg-form-sender-alert-content--text {
|
|
95
|
+
font-size: 1.25rem;
|
|
96
|
+
color: var(--vg-form-sender-alert-color);
|
|
48
97
|
}
|
|
@@ -70,12 +70,12 @@ class VGLoadMore extends BaseModule{
|
|
|
70
70
|
buttonParams = normalizeData(el.dataset.button);
|
|
71
71
|
|
|
72
72
|
if (!isObject(buttonParams)) {
|
|
73
|
-
console.
|
|
73
|
+
console.error('Дата атрибут data-button должен быть в формате json и передавать объект');
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
if (limit < offset) {
|
|
78
|
-
console.
|
|
78
|
+
console.error('Параметр offset должен быть меньше или равен параметру limit');
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -167,7 +167,7 @@ class VGRollup extends BaseModule {
|
|
|
167
167
|
element.classList.add(_this.classes.ellipsis);
|
|
168
168
|
element.style.webkitLineClamp = line;
|
|
169
169
|
} else {
|
|
170
|
-
console.
|
|
170
|
+
console.error("Переменная [data-line] или параметр[line] не должны быть пустыми");
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@import "../../utils/scss/functions";
|
|
2
|
-
@import "../../utils/scss/mixin";
|
|
3
2
|
@import "../../utils/scss/variables";
|
|
3
|
+
@import "../../utils/scss/mixin";
|
|
4
|
+
@import "../../utils/scss/animation";
|
|
4
5
|
|
|
5
6
|
.vg-backdrop {
|
|
6
7
|
@include mix-vars('backdrop', $backdrop-map);
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
width: 7em;
|
|
61
62
|
height: 7em;
|
|
62
63
|
}
|
|
64
|
+
|
|
63
65
|
.vg-loader {
|
|
64
66
|
@include mix-vars('loader', $loader-map);
|
|
65
67
|
margin: var(--vg-loader-margin);
|
|
@@ -72,144 +74,4 @@
|
|
|
72
74
|
border-left: var(--vg-loader-border-width) var(--vg-loader-border-style) var(--vg-loader-color);
|
|
73
75
|
transform: var(--vg-loader-transform);
|
|
74
76
|
animation: var(--vg-loader-animation);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* UI before Animation
|
|
79
|
-
*/
|
|
80
|
-
.ui-success {
|
|
81
|
-
&-circle {
|
|
82
|
-
stroke-dasharray: 260.75219024795285px, 260.75219024795285px;
|
|
83
|
-
stroke-dashoffset: 270.75219024795285px;
|
|
84
|
-
transform: rotate(0);
|
|
85
|
-
transform-origin: center center;
|
|
86
|
-
stroke-linecap: round;
|
|
87
|
-
animation: ani-success-circle 1s ease-in both;
|
|
88
|
-
}
|
|
89
|
-
&-path {
|
|
90
|
-
stroke-dasharray: 60px 64px;
|
|
91
|
-
stroke-dashoffset: 62px;
|
|
92
|
-
stroke-linecap: round;
|
|
93
|
-
animation: ani-success-path 0.4s 1s ease-in both;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.ui-error {
|
|
98
|
-
&-circle {
|
|
99
|
-
stroke-dasharray: 260.75219024795285px, 260.75219024795285px;
|
|
100
|
-
stroke-dashoffset: 260.75219024795285px;
|
|
101
|
-
animation: ani-error-circle 1.2s linear;
|
|
102
|
-
}
|
|
103
|
-
&-line1 {
|
|
104
|
-
stroke-dasharray: 54px 55px;
|
|
105
|
-
stroke-dashoffset: 55px;
|
|
106
|
-
stroke-linecap: round;
|
|
107
|
-
animation: ani-error-line 0.15s 1.2s linear both;
|
|
108
|
-
}
|
|
109
|
-
&-line2 {
|
|
110
|
-
stroke-dasharray: 54px 55px;
|
|
111
|
-
stroke-dashoffset: 55px;
|
|
112
|
-
stroke-linecap: round;
|
|
113
|
-
animation: ani-error-line 0.2s 0.9s linear both;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.ui-waiting {
|
|
118
|
-
&-circle {
|
|
119
|
-
stroke-dasharray: 260.75219024795285px, 260.75219024795285px;
|
|
120
|
-
stroke-dashoffset: 260.75219024795285px;
|
|
121
|
-
animation: ani-waiting-circle 1.2s linear;
|
|
122
|
-
}
|
|
123
|
-
&-line1 {
|
|
124
|
-
stroke-dasharray: 280.75219024795285px, 200.75219024795285px;
|
|
125
|
-
stroke-dashoffset: 280.75219024795285px;
|
|
126
|
-
animation: ani-waiting-line 0.8s 0.3s linear both;
|
|
127
|
-
transform: rotate(0);
|
|
128
|
-
transform-origin: center center;
|
|
129
|
-
}
|
|
130
|
-
&-line2 {
|
|
131
|
-
stroke-dasharray: 54px 55px;
|
|
132
|
-
stroke-dashoffset: 55px;
|
|
133
|
-
animation: ani-waiting-line2 0.85s .6s ease-in both;
|
|
134
|
-
transform: rotate(0) scale(0.9);
|
|
135
|
-
transform-origin: center center;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Animation Loader
|
|
141
|
-
*/
|
|
142
|
-
@keyframes vgLoader {
|
|
143
|
-
0% {
|
|
144
|
-
transform: rotate(0deg);
|
|
145
|
-
}
|
|
146
|
-
100% {
|
|
147
|
-
transform: rotate(360deg);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// success animation
|
|
152
|
-
@keyframes ani-success-circle {
|
|
153
|
-
to {
|
|
154
|
-
stroke-dashoffset: 782.2565707438586px;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
@keyframes ani-success-path {
|
|
159
|
-
0% {
|
|
160
|
-
stroke-dashoffset: 62px;
|
|
161
|
-
}
|
|
162
|
-
65% {
|
|
163
|
-
stroke-dashoffset: -5px;
|
|
164
|
-
}
|
|
165
|
-
84% {
|
|
166
|
-
stroke-dashoffset: 4px;
|
|
167
|
-
}
|
|
168
|
-
100% {
|
|
169
|
-
stroke-dashoffset: -2px;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// error animation
|
|
174
|
-
@keyframes ani-error-line {
|
|
175
|
-
to {
|
|
176
|
-
stroke-dashoffset: 0;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
@keyframes ani-error-circle {
|
|
181
|
-
0% {
|
|
182
|
-
stroke-dasharray: 0, 260.75219024795285px;
|
|
183
|
-
stroke-dashoffset: 0;
|
|
184
|
-
}
|
|
185
|
-
35% {
|
|
186
|
-
stroke-dasharray: 120px, 120px;
|
|
187
|
-
stroke-dashoffset: -120px;
|
|
188
|
-
}
|
|
189
|
-
70% {
|
|
190
|
-
stroke-dasharray: 0, 260.75219024795285px;
|
|
191
|
-
stroke-dashoffset: -260.75219024795285px;
|
|
192
|
-
}
|
|
193
|
-
100% {
|
|
194
|
-
stroke-dasharray: 260.75219024795285px, 0;
|
|
195
|
-
stroke-dashoffset: -260.75219024795285px;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// waiting animation
|
|
200
|
-
@keyframes ani-waiting-circle {
|
|
201
|
-
to {
|
|
202
|
-
stroke-dashoffset: 782.2565707438586px;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
@keyframes ani-waiting-line {
|
|
206
|
-
to {
|
|
207
|
-
stroke-dashoffset: 0;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
@keyframes ani-waiting-line2 {
|
|
211
|
-
to {
|
|
212
|
-
stroke-dashoffset: 0;
|
|
213
|
-
transform: rotate(360deg) scale(1);
|
|
214
|
-
}
|
|
215
77
|
}
|
|
@@ -19,4 +19,22 @@
|
|
|
19
19
|
|
|
20
20
|
@function tint-color($color, $weight) {
|
|
21
21
|
@return mix(white, $color, $weight);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@function get-alert-color($type) {
|
|
25
|
+
@if $type == success {
|
|
26
|
+
@return $success-map;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@if $type == danger {
|
|
30
|
+
@return $danger-map;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@if $type == warning {
|
|
34
|
+
@return $warning-map;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@if $type == info {
|
|
38
|
+
@return $info-map;
|
|
39
|
+
}
|
|
22
40
|
}
|
|
@@ -8,4 +8,16 @@
|
|
|
8
8
|
--vg-#{$module}-#{$key}: #{$value}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin mix-alert-color-mode($class) {
|
|
14
|
+
$colors: ['success', 'info', 'warning', 'danger'];
|
|
15
|
+
|
|
16
|
+
@each $value in $colors {
|
|
17
|
+
&.#{$class}-#{$value} {
|
|
18
|
+
@each $property, $val in get-alert-color($value) {
|
|
19
|
+
--#{$class}-#{$property}: #{$val};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
11
23
|
}
|
|
@@ -54,25 +54,25 @@ $loader-map: (
|
|
|
54
54
|
);
|
|
55
55
|
|
|
56
56
|
// Colors Status
|
|
57
|
-
$danger: #
|
|
58
|
-
$danger-border:
|
|
59
|
-
$danger-text:
|
|
60
|
-
$danger-bg:
|
|
57
|
+
$danger: #FF2A2C !default;
|
|
58
|
+
$danger-border: #FFCCC7 !default;
|
|
59
|
+
$danger-text: #DF0306 !default;
|
|
60
|
+
$danger-bg: #FFF2F0 !default;
|
|
61
61
|
|
|
62
|
-
$success: #
|
|
63
|
-
$success-border:
|
|
64
|
-
$success-text:
|
|
65
|
-
$success-bg:
|
|
62
|
+
$success: #4FD90B;
|
|
63
|
+
$success-border: #BAF98A !default;
|
|
64
|
+
$success-text: #40BE02 !default;
|
|
65
|
+
$success-bg: #F6FFED !default;
|
|
66
66
|
|
|
67
67
|
$warning: #FFC107;
|
|
68
|
-
$warning-border:
|
|
69
|
-
$warning-text:
|
|
70
|
-
$warning-bg:
|
|
68
|
+
$warning-border: #FFDE79 !default;
|
|
69
|
+
$warning-text: #FFC107 !default;
|
|
70
|
+
$warning-bg: #FFF6DA !default;
|
|
71
71
|
|
|
72
|
-
$info: #
|
|
73
|
-
$info-border:
|
|
74
|
-
$info-text:
|
|
75
|
-
$info-bg:
|
|
72
|
+
$info: #1F8BFF;
|
|
73
|
+
$info-border: #F0FAFF !default;
|
|
74
|
+
$info-text: #0471E5 !default;
|
|
75
|
+
$info-bg: #ADDDFF !default;
|
|
76
76
|
|
|
77
77
|
$dark: #232323;
|
|
78
78
|
$dark-border: shade-color($dark, 60%) !default;
|
|
@@ -80,24 +80,28 @@ $dark-text: tint-color($dark, 60%) !default;
|
|
|
80
80
|
$dark-bg: shade-color($dark, 80%) !default;
|
|
81
81
|
|
|
82
82
|
$success-map: (
|
|
83
|
+
icon: $success,
|
|
83
84
|
color: $success-text,
|
|
84
85
|
border-color: $success-border,
|
|
85
86
|
background-color: $success-bg
|
|
86
87
|
);
|
|
87
88
|
|
|
88
89
|
$danger-map: (
|
|
90
|
+
icon: $danger,
|
|
89
91
|
color: $danger-text,
|
|
90
92
|
border-color: $danger-border,
|
|
91
93
|
background-color: $danger-bg
|
|
92
94
|
);
|
|
93
95
|
|
|
94
96
|
$warning-map: (
|
|
97
|
+
icon: $warning,
|
|
95
98
|
color: $warning-text,
|
|
96
99
|
border-color: $warning-border,
|
|
97
100
|
background-color: $warning-bg
|
|
98
101
|
);
|
|
99
102
|
|
|
100
103
|
$info-map: (
|
|
104
|
+
icon: $info,
|
|
101
105
|
color: $info-text,
|
|
102
106
|
border-color: $info-border,
|
|
103
107
|
background-color: $info-bg
|