vgapp 1.4.4 → 1.4.6

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 (123) hide show
  1. package/README.md +270 -270
  2. package/app/langs/en/buttons.json +17 -17
  3. package/app/langs/en/messages.json +36 -36
  4. package/app/langs/ru/buttons.json +17 -17
  5. package/app/langs/ru/messages.json +36 -36
  6. package/app/modules/vgalert/js/vgalert.js +266 -266
  7. package/app/modules/vgalert/scss/_variables.scss +16 -16
  8. package/app/modules/vgalert/scss/vgalert.scss +107 -107
  9. package/app/modules/vgcollapse/scss/_variables.scss +7 -7
  10. package/app/modules/vgcollapse/scss/vgcollapse.scss +5 -5
  11. package/app/modules/vgdropdown/scss/_variables.scss +14 -14
  12. package/app/modules/vgdropdown/scss/vgdropdown.scss +5 -5
  13. package/app/modules/vgdynamictable/index.js +4 -4
  14. package/app/modules/vgdynamictable/js/filters.js +21 -21
  15. package/app/modules/vgdynamictable/js/fixed.js +179 -179
  16. package/app/modules/vgdynamictable/js/options.js +3 -3
  17. package/app/modules/vgdynamictable/js/pagination.js +1 -1
  18. package/app/modules/vgdynamictable/js/search.js +12 -12
  19. package/app/modules/vgdynamictable/js/skeleton.js +27 -19
  20. package/app/modules/vgdynamictable/js/sortable.js +71 -71
  21. package/app/modules/vgdynamictable/js/summary-footer.js +28 -28
  22. package/app/modules/vgdynamictable/js/table-url-state.js +31 -31
  23. package/app/modules/vgdynamictable/js/utils/common.js +48 -48
  24. package/app/modules/vgdynamictable/js/vgdynamictable.js +79 -79
  25. package/app/modules/vgdynamictable/scss/_actions.scss +19 -19
  26. package/app/modules/vgdynamictable/scss/_pagination.scss +5 -5
  27. package/app/modules/vgdynamictable/scss/_skeleton.scss +11 -11
  28. package/app/modules/vgdynamictable/scss/_sortable.scss +28 -28
  29. package/app/modules/vgdynamictable/scss/_table.scss +7 -30
  30. package/app/modules/vgdynamictable/scss/_variables.scss +46 -46
  31. package/app/modules/vgdynamictable/scss/vgdynamictable.scss +28 -36
  32. package/app/modules/vgfilepreview/js/i18n.js +56 -56
  33. package/app/modules/vgfilepreview/js/renderers/image-modal.js +145 -145
  34. package/app/modules/vgfilepreview/js/renderers/image.js +92 -92
  35. package/app/modules/vgfilepreview/js/renderers/index.js +19 -19
  36. package/app/modules/vgfilepreview/js/renderers/office-modal.js +168 -168
  37. package/app/modules/vgfilepreview/js/renderers/office.js +79 -79
  38. package/app/modules/vgfilepreview/js/renderers/pdf-modal.js +260 -260
  39. package/app/modules/vgfilepreview/js/renderers/pdf.js +76 -76
  40. package/app/modules/vgfilepreview/js/renderers/playlist.js +71 -71
  41. package/app/modules/vgfilepreview/js/renderers/text-modal.js +343 -343
  42. package/app/modules/vgfilepreview/js/renderers/text.js +83 -83
  43. package/app/modules/vgfilepreview/js/renderers/video-modal.js +272 -272
  44. package/app/modules/vgfilepreview/js/renderers/video.js +80 -80
  45. package/app/modules/vgfilepreview/js/renderers/zip-modal.js +522 -522
  46. package/app/modules/vgfilepreview/js/renderers/zip.js +89 -89
  47. package/app/modules/vgfilepreview/js/vgfilepreview.js +7 -7
  48. package/app/modules/vgfilepreview/readme.md +68 -68
  49. package/app/modules/vgfilepreview/scss/_variables.scss +115 -115
  50. package/app/modules/vgfilepreview/scss/vgfilepreview.scss +463 -463
  51. package/app/modules/vgfiles/js/droppable.js +20 -9
  52. package/app/modules/vgfiles/js/render.js +153 -153
  53. package/app/modules/vgfiles/js/vgfiles.js +104 -104
  54. package/app/modules/vgfiles/readme.md +123 -123
  55. package/app/modules/vgfiles/scss/_mixins.scss +9 -9
  56. package/app/modules/vgfiles/scss/_variables.scss +41 -41
  57. package/app/modules/vgfiles/scss/vgfiles.scss +161 -161
  58. package/app/modules/vgformsender/js/hideshowpass.js +21 -16
  59. package/app/modules/vgformsender/js/vgformsender.js +4 -6
  60. package/app/modules/vgformsender/readme.md +1 -1
  61. package/app/modules/vgformsender/scss/_variables.scss +5 -5
  62. package/app/modules/vgformsender/scss/vgformsender.scss +42 -42
  63. package/app/modules/vglawcookie/js/vglawcookie.js +11 -8
  64. package/app/modules/vglawcookie/scss/_variables.scss +13 -13
  65. package/app/modules/vglawcookie/scss/vglawcookie.scss +5 -5
  66. package/app/modules/vgmodal/js/vgmodal.interaction.js +216 -216
  67. package/app/modules/vgmodal/js/vgmodal.js +355 -355
  68. package/app/modules/vgmodal/js/vgmodal.minimized.js +227 -227
  69. package/app/modules/vgmodal/scss/_variables.scss +17 -17
  70. package/app/modules/vgmodal/scss/vgmodal.scss +77 -77
  71. package/app/modules/vgnav/js/vgnav.js +180 -180
  72. package/app/modules/vgnav/scss/_breakpoints.scss +36 -36
  73. package/app/modules/vgnav/scss/_hamburger.scss +5 -5
  74. package/app/modules/vgnav/scss/_placement.scss +5 -5
  75. package/app/modules/vgnav/scss/_toggle.scss +5 -5
  76. package/app/modules/vgnav/scss/_variables.scss +26 -26
  77. package/app/modules/vgnav/scss/vgnav.scss +41 -41
  78. package/app/modules/vgnestable/README.md +39 -39
  79. package/app/modules/vgnestable/js/vgnestable.js +358 -358
  80. package/app/modules/vgnestable/scss/_variables.scss +35 -35
  81. package/app/modules/vgnestable/scss/vgnestable.scss +55 -55
  82. package/app/modules/vgrangeslider/js/skins.js +222 -222
  83. package/app/modules/vgrangeslider/js/vgrangeslider.js +704 -704
  84. package/app/modules/vgrangeslider/scss/_variables.scss +55 -55
  85. package/app/modules/vgrangeslider/scss/vgrangeslider.scss +239 -239
  86. package/app/modules/vgrollup/scss/_variables.scss +15 -15
  87. package/app/modules/vgrollup/scss/vgrollup.scss +6 -6
  88. package/app/modules/vgselect/js/vgselect.js +129 -129
  89. package/app/modules/vgselect/readme.md +11 -11
  90. package/app/modules/vgselect/scss/_variables.scss +50 -50
  91. package/app/modules/vgselect/scss/vgselect.scss +48 -48
  92. package/app/modules/vgsidebar/js/vgsidebar.js +79 -79
  93. package/app/modules/vgsidebar/scss/_variables.scss +10 -10
  94. package/app/modules/vgsidebar/scss/vgsidebar.scss +5 -5
  95. package/app/modules/vgtabs/scss/_variables.scss +23 -23
  96. package/app/modules/vgtabs/scss/vgtabs.scss +5 -5
  97. package/app/modules/vgtoast/scss/_variables.scss +13 -13
  98. package/app/modules/vgtoast/scss/vgtoast.scss +5 -5
  99. package/app/modules/vgtooltip/js/vgtooltip.js +107 -51
  100. package/app/modules/vgtooltip/scss/_variables.scss +10 -10
  101. package/app/modules/vgtooltip/scss/vgtooltip.scss +5 -5
  102. package/app/utils/js/components/audio-metadata.js +240 -240
  103. package/app/utils/js/components/backdrop.js +116 -116
  104. package/app/utils/js/components/file-icon.js +109 -109
  105. package/app/utils/js/components/file-preview.js +304 -304
  106. package/app/utils/js/components/sanitize.js +150 -150
  107. package/app/utils/js/components/video-metadata.js +140 -140
  108. package/app/utils/scss/_backdrop.scss +5 -5
  109. package/app/utils/scss/_theme-default.scss +12 -12
  110. package/app/utils/scss/_theme.scss +7 -7
  111. package/app/utils/scss/_tokens.scss +170 -170
  112. package/app/utils/scss/default.scss +9 -9
  113. package/app/utils/scss/functions.scss +21 -21
  114. package/app/utils/scss/index.scss +4 -4
  115. package/app/utils/scss/mixin.scss +16 -16
  116. package/app/utils/scss/variables.scss +105 -105
  117. package/app/vgapp.js +295 -295
  118. package/build/vgapp.css +1 -1
  119. package/build/vgapp.css.map +1 -1
  120. package/build/vgapp.js +1 -1
  121. package/build/vgapp.js.map +1 -1
  122. package/index.scss +20 -20
  123. package/package.json +4 -2
@@ -1,222 +1,222 @@
1
- const SKIN_CLASS_DEFAULT = 'is-skin-default';
2
- const SKIN_CLASS_RULER = 'is-skin-ruler';
3
- const SKIN_CLASS_STATUS = 'is-skin-status';
4
- const SKIN_CLASS_RULER_DIM = 'is-ruler-dim-inactive';
5
- const STATUS_CLASS_SUCCESS = 'is-status-success';
6
- const STATUS_CLASS_WARNING = 'is-status-warning';
7
- const STATUS_CLASS_DANGER = 'is-status-danger';
8
-
9
- const STATUS_CLASSES = [
10
- STATUS_CLASS_SUCCESS,
11
- STATUS_CLASS_WARNING,
12
- STATUS_CLASS_DANGER,
13
- ];
14
-
15
- const resolveStatusToneByValue = (value, params, state) => {
16
- const span = state.max - state.min;
17
- const percent = span > 0 ? ((value - state.min) / span) * 100 : 0;
18
- const warningBelow = Number(params?.status?.warningBelow);
19
- const dangerBelow = Number(params?.status?.dangerBelow);
20
- const warningThreshold = Number.isFinite(warningBelow) ? warningBelow : 60;
21
- const dangerThreshold = Number.isFinite(dangerBelow) ? dangerBelow : 30;
22
-
23
- if (percent < dangerThreshold) {
24
- return 'danger';
25
- }
26
-
27
- if (percent < warningThreshold) {
28
- return 'warning';
29
- }
30
-
31
- return 'success';
32
- };
33
-
34
- const resolveStatusSourceValue = (params, state, helpers) => {
35
- if (!helpers.isRange) {
36
- return state.from;
37
- }
38
-
39
- const by = typeof params?.status?.by === 'string'
40
- ? params.status.by.toLowerCase()
41
- : 'to';
42
-
43
- if (by === 'from') {
44
- return state.from;
45
- }
46
-
47
- if (by === 'avg') {
48
- return (state.from + state.to) / 2;
49
- }
50
-
51
- return state.to;
52
- };
53
-
54
- const buildRulerValues = (params, state) => {
55
- if (Array.isArray(params?.ruler?.values) && params.ruler.values.length > 0) {
56
- return params.ruler.values
57
- .map(value => Number(value))
58
- .filter(value => Number.isFinite(value))
59
- .sort((a, b) => a - b);
60
- }
61
-
62
- const count = Math.max(2, Number(params?.ruler?.count) || 6);
63
- const span = state.max - state.min;
64
- const step = span / (count - 1);
65
- const values = [];
66
-
67
- for (let index = 0; index < count; index++) {
68
- const value = index === count - 1 ? state.max : state.min + (step * index);
69
- values.push(Number(value.toFixed(5)));
70
- }
71
-
72
- return values;
73
- };
74
-
75
- const createRulerSkin = (root, params, state, formatValue, toPositionPx) => {
76
- const values = buildRulerValues(params, state);
77
- const ruler = document.createElement('div');
78
- ruler.className = 'vg-range-slider__ruler';
79
-
80
- if (params?.ruler?.dimInactive === true) {
81
- root.classList.add(SKIN_CLASS_RULER_DIM);
82
- }
83
-
84
- const ticks = values.map((value) => {
85
- const item = document.createElement('span');
86
- item.className = 'vg-range-slider__ruler-item';
87
- item.style.left = `${toPositionPx(value)}px`;
88
- item.dataset.value = String(value);
89
-
90
- const mark = document.createElement('span');
91
- mark.className = 'vg-range-slider__ruler-mark';
92
- item.appendChild(mark);
93
-
94
- if (params?.ruler?.labels !== false) {
95
- const label = document.createElement('span');
96
- label.className = 'vg-range-slider__ruler-label';
97
- label.textContent = formatValue(value);
98
- item.appendChild(label);
99
- }
100
-
101
- ruler.appendChild(item);
102
- return item;
103
- });
104
-
105
- root.appendChild(ruler);
106
-
107
- return {
108
- type: 'ruler',
109
- root: ruler,
110
- ticks,
111
- values,
112
- };
113
- };
114
-
115
- const resolveStatusTone = (params, state, helpers) => {
116
- const value = resolveStatusSourceValue(params, state, helpers);
117
- return resolveStatusToneByValue(value, params, state);
118
- };
119
-
120
- const syncStatusClasses = (root, tone) => {
121
- root.classList.remove(...STATUS_CLASSES);
122
-
123
- if (tone === 'danger') {
124
- root.classList.add(STATUS_CLASS_DANGER);
125
- return;
126
- }
127
-
128
- if (tone === 'warning') {
129
- root.classList.add(STATUS_CLASS_WARNING);
130
- return;
131
- }
132
-
133
- root.classList.add(STATUS_CLASS_SUCCESS);
134
- };
135
-
136
- const resolveStatusLabel = (params, tone) => {
137
- if (!Array.isArray(params?.labelWords) || params.labelWords.length < 3) {
138
- return null;
139
- }
140
-
141
- if (tone === 'danger') {
142
- return params.labelWords[0] || null;
143
- }
144
-
145
- if (tone === 'warning') {
146
- return params.labelWords[1] || null;
147
- }
148
-
149
- return params.labelWords[2] || null;
150
- };
151
-
152
- const syncStatusLabels = (params, state, helpers) => {
153
- const labelFrom = helpers?.dom?.labelFrom;
154
- const labelTo = helpers?.dom?.labelTo;
155
- const fromLabel = resolveStatusLabel(params, resolveStatusToneByValue(state.from, params, state));
156
- const toLabel = resolveStatusLabel(params, resolveStatusToneByValue(state.to, params, state));
157
-
158
- if (labelFrom && fromLabel) {
159
- labelFrom.textContent = fromLabel;
160
- }
161
-
162
- if (labelTo && toLabel) {
163
- labelTo.textContent = toLabel;
164
- }
165
- };
166
-
167
- const applyRangeSliderSkin = (root, params, state, helpers) => {
168
- root.classList.add(SKIN_CLASS_DEFAULT);
169
-
170
- if (params.skin === 'ruler') {
171
- root.classList.add(SKIN_CLASS_RULER);
172
- return createRulerSkin(root, params, state, helpers.formatValue, helpers.toPositionPx);
173
- }
174
-
175
- if (params.skin === 'status') {
176
- root.classList.add(SKIN_CLASS_STATUS);
177
- syncStatusClasses(root, resolveStatusTone(params, state, helpers));
178
-
179
- return {
180
- type: 'status',
181
- root,
182
- };
183
- }
184
-
185
- if (params.skin !== 'default') {
186
- return null;
187
- }
188
-
189
- return null;
190
- };
191
-
192
- const syncRangeSliderSkin = (skin, state, helpers) => {
193
- if (!skin) {
194
- return;
195
- }
196
-
197
- if (skin.type === 'status') {
198
- syncStatusClasses(skin.root, resolveStatusTone(helpers.params, state, helpers));
199
- syncStatusLabels(helpers.params, state, helpers);
200
- return;
201
- }
202
-
203
- if (skin.type !== 'ruler') {
204
- return;
205
- }
206
-
207
- const isRange = state.from !== state.to || helpers.isRange;
208
-
209
- skin.ticks.forEach((tick, index) => {
210
- const value = skin.values[index];
211
- const isActive = isRange
212
- ? value >= state.from && value <= state.to
213
- : value <= state.from;
214
-
215
- tick.classList.toggle('is-active', isActive);
216
- });
217
- };
218
-
219
- export {
220
- applyRangeSliderSkin,
221
- syncRangeSliderSkin,
222
- };
1
+ const SKIN_CLASS_DEFAULT = 'is-skin-default';
2
+ const SKIN_CLASS_RULER = 'is-skin-ruler';
3
+ const SKIN_CLASS_STATUS = 'is-skin-status';
4
+ const SKIN_CLASS_RULER_DIM = 'is-ruler-dim-inactive';
5
+ const STATUS_CLASS_SUCCESS = 'is-status-success';
6
+ const STATUS_CLASS_WARNING = 'is-status-warning';
7
+ const STATUS_CLASS_DANGER = 'is-status-danger';
8
+
9
+ const STATUS_CLASSES = [
10
+ STATUS_CLASS_SUCCESS,
11
+ STATUS_CLASS_WARNING,
12
+ STATUS_CLASS_DANGER,
13
+ ];
14
+
15
+ const resolveStatusToneByValue = (value, params, state) => {
16
+ const span = state.max - state.min;
17
+ const percent = span > 0 ? ((value - state.min) / span) * 100 : 0;
18
+ const warningBelow = Number(params?.status?.warningBelow);
19
+ const dangerBelow = Number(params?.status?.dangerBelow);
20
+ const warningThreshold = Number.isFinite(warningBelow) ? warningBelow : 60;
21
+ const dangerThreshold = Number.isFinite(dangerBelow) ? dangerBelow : 30;
22
+
23
+ if (percent < dangerThreshold) {
24
+ return 'danger';
25
+ }
26
+
27
+ if (percent < warningThreshold) {
28
+ return 'warning';
29
+ }
30
+
31
+ return 'success';
32
+ };
33
+
34
+ const resolveStatusSourceValue = (params, state, helpers) => {
35
+ if (!helpers.isRange) {
36
+ return state.from;
37
+ }
38
+
39
+ const by = typeof params?.status?.by === 'string'
40
+ ? params.status.by.toLowerCase()
41
+ : 'to';
42
+
43
+ if (by === 'from') {
44
+ return state.from;
45
+ }
46
+
47
+ if (by === 'avg') {
48
+ return (state.from + state.to) / 2;
49
+ }
50
+
51
+ return state.to;
52
+ };
53
+
54
+ const buildRulerValues = (params, state) => {
55
+ if (Array.isArray(params?.ruler?.values) && params.ruler.values.length > 0) {
56
+ return params.ruler.values
57
+ .map(value => Number(value))
58
+ .filter(value => Number.isFinite(value))
59
+ .sort((a, b) => a - b);
60
+ }
61
+
62
+ const count = Math.max(2, Number(params?.ruler?.count) || 6);
63
+ const span = state.max - state.min;
64
+ const step = span / (count - 1);
65
+ const values = [];
66
+
67
+ for (let index = 0; index < count; index++) {
68
+ const value = index === count - 1 ? state.max : state.min + (step * index);
69
+ values.push(Number(value.toFixed(5)));
70
+ }
71
+
72
+ return values;
73
+ };
74
+
75
+ const createRulerSkin = (root, params, state, formatValue, toPositionPx) => {
76
+ const values = buildRulerValues(params, state);
77
+ const ruler = document.createElement('div');
78
+ ruler.className = 'vg-range-slider__ruler';
79
+
80
+ if (params?.ruler?.dimInactive === true) {
81
+ root.classList.add(SKIN_CLASS_RULER_DIM);
82
+ }
83
+
84
+ const ticks = values.map((value) => {
85
+ const item = document.createElement('span');
86
+ item.className = 'vg-range-slider__ruler-item';
87
+ item.style.left = `${toPositionPx(value)}px`;
88
+ item.dataset.value = String(value);
89
+
90
+ const mark = document.createElement('span');
91
+ mark.className = 'vg-range-slider__ruler-mark';
92
+ item.appendChild(mark);
93
+
94
+ if (params?.ruler?.labels !== false) {
95
+ const label = document.createElement('span');
96
+ label.className = 'vg-range-slider__ruler-label';
97
+ label.textContent = formatValue(value);
98
+ item.appendChild(label);
99
+ }
100
+
101
+ ruler.appendChild(item);
102
+ return item;
103
+ });
104
+
105
+ root.appendChild(ruler);
106
+
107
+ return {
108
+ type: 'ruler',
109
+ root: ruler,
110
+ ticks,
111
+ values,
112
+ };
113
+ };
114
+
115
+ const resolveStatusTone = (params, state, helpers) => {
116
+ const value = resolveStatusSourceValue(params, state, helpers);
117
+ return resolveStatusToneByValue(value, params, state);
118
+ };
119
+
120
+ const syncStatusClasses = (root, tone) => {
121
+ root.classList.remove(...STATUS_CLASSES);
122
+
123
+ if (tone === 'danger') {
124
+ root.classList.add(STATUS_CLASS_DANGER);
125
+ return;
126
+ }
127
+
128
+ if (tone === 'warning') {
129
+ root.classList.add(STATUS_CLASS_WARNING);
130
+ return;
131
+ }
132
+
133
+ root.classList.add(STATUS_CLASS_SUCCESS);
134
+ };
135
+
136
+ const resolveStatusLabel = (params, tone) => {
137
+ if (!Array.isArray(params?.labelWords) || params.labelWords.length < 3) {
138
+ return null;
139
+ }
140
+
141
+ if (tone === 'danger') {
142
+ return params.labelWords[0] || null;
143
+ }
144
+
145
+ if (tone === 'warning') {
146
+ return params.labelWords[1] || null;
147
+ }
148
+
149
+ return params.labelWords[2] || null;
150
+ };
151
+
152
+ const syncStatusLabels = (params, state, helpers) => {
153
+ const labelFrom = helpers?.dom?.labelFrom;
154
+ const labelTo = helpers?.dom?.labelTo;
155
+ const fromLabel = resolveStatusLabel(params, resolveStatusToneByValue(state.from, params, state));
156
+ const toLabel = resolveStatusLabel(params, resolveStatusToneByValue(state.to, params, state));
157
+
158
+ if (labelFrom && fromLabel) {
159
+ labelFrom.textContent = fromLabel;
160
+ }
161
+
162
+ if (labelTo && toLabel) {
163
+ labelTo.textContent = toLabel;
164
+ }
165
+ };
166
+
167
+ const applyRangeSliderSkin = (root, params, state, helpers) => {
168
+ root.classList.add(SKIN_CLASS_DEFAULT);
169
+
170
+ if (params.skin === 'ruler') {
171
+ root.classList.add(SKIN_CLASS_RULER);
172
+ return createRulerSkin(root, params, state, helpers.formatValue, helpers.toPositionPx);
173
+ }
174
+
175
+ if (params.skin === 'status') {
176
+ root.classList.add(SKIN_CLASS_STATUS);
177
+ syncStatusClasses(root, resolveStatusTone(params, state, helpers));
178
+
179
+ return {
180
+ type: 'status',
181
+ root,
182
+ };
183
+ }
184
+
185
+ if (params.skin !== 'default') {
186
+ return null;
187
+ }
188
+
189
+ return null;
190
+ };
191
+
192
+ const syncRangeSliderSkin = (skin, state, helpers) => {
193
+ if (!skin) {
194
+ return;
195
+ }
196
+
197
+ if (skin.type === 'status') {
198
+ syncStatusClasses(skin.root, resolveStatusTone(helpers.params, state, helpers));
199
+ syncStatusLabels(helpers.params, state, helpers);
200
+ return;
201
+ }
202
+
203
+ if (skin.type !== 'ruler') {
204
+ return;
205
+ }
206
+
207
+ const isRange = state.from !== state.to || helpers.isRange;
208
+
209
+ skin.ticks.forEach((tick, index) => {
210
+ const value = skin.values[index];
211
+ const isActive = isRange
212
+ ? value >= state.from && value <= state.to
213
+ : value <= state.from;
214
+
215
+ tick.classList.toggle('is-active', isActive);
216
+ });
217
+ };
218
+
219
+ export {
220
+ applyRangeSliderSkin,
221
+ syncRangeSliderSkin,
222
+ };