vgapp 1.5.7 → 1.5.9

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 (111) hide show
  1. package/app/langs/en/buttons.json +17 -17
  2. package/app/langs/en/messages.json +36 -36
  3. package/app/langs/ru/buttons.json +17 -17
  4. package/app/langs/ru/messages.json +1 -1
  5. package/app/modules/vgalert/js/vgalert.js +15 -12
  6. package/app/modules/vgalert/scss/_variables.scss +16 -16
  7. package/app/modules/vgalert/scss/vgalert.scss +13 -6
  8. package/app/modules/vgcollapse/scss/_variables.scss +7 -7
  9. package/app/modules/vgcollapse/scss/vgcollapse.scss +5 -5
  10. package/app/modules/vgdropdown/scss/_variables.scss +14 -14
  11. package/app/modules/vgdropdown/scss/vgdropdown.scss +5 -5
  12. package/app/modules/vgfilepreview/js/i18n.js +56 -56
  13. package/app/modules/vgfilepreview/js/renderers/image-modal.js +145 -145
  14. package/app/modules/vgfilepreview/js/renderers/image.js +92 -92
  15. package/app/modules/vgfilepreview/js/renderers/index.js +19 -19
  16. package/app/modules/vgfilepreview/js/renderers/office-modal.js +168 -168
  17. package/app/modules/vgfilepreview/js/renderers/office.js +79 -79
  18. package/app/modules/vgfilepreview/js/renderers/pdf-modal.js +260 -260
  19. package/app/modules/vgfilepreview/js/renderers/pdf.js +76 -76
  20. package/app/modules/vgfilepreview/js/renderers/playlist.js +71 -71
  21. package/app/modules/vgfilepreview/js/renderers/text-modal.js +343 -343
  22. package/app/modules/vgfilepreview/js/renderers/text.js +83 -83
  23. package/app/modules/vgfilepreview/js/renderers/zip-modal.js +522 -522
  24. package/app/modules/vgfilepreview/js/renderers/zip.js +89 -89
  25. package/app/modules/vgfilepreview/readme.md +68 -68
  26. package/app/modules/vgfiles/js/base.js +198 -198
  27. package/app/modules/vgfiles/js/droppable.js +17 -17
  28. package/app/modules/vgfiles/js/render.js +153 -153
  29. package/app/modules/vgfiles/js/sortable.js +52 -52
  30. package/app/modules/vgfiles/js/vgfiles.js +43 -43
  31. package/app/modules/vgfiles/readme.md +123 -123
  32. package/app/modules/vgfiles/scss/_mixins.scss +13 -13
  33. package/app/modules/vgfiles/scss/_variables.scss +10 -10
  34. package/app/modules/vgfiles/scss/vgfiles.scss +28 -28
  35. package/app/modules/vgformsender/js/hideshowpass.js +22 -22
  36. package/app/modules/vgformsender/readme.md +1 -1
  37. package/app/modules/vgformsender/scss/_variables.scss +5 -5
  38. package/app/modules/vgformsender/scss/vgformsender.scss +42 -42
  39. package/app/modules/vglawcookie/js/vglawcookie.js +19 -19
  40. package/app/modules/vglawcookie/scss/_variables.scss +13 -13
  41. package/app/modules/vglawcookie/scss/vglawcookie.scss +5 -5
  42. package/app/modules/vgmodal/js/vgmodal.interaction.js +216 -216
  43. package/app/modules/vgmodal/js/vgmodal.js +9 -9
  44. package/app/modules/vgmodal/js/vgmodal.minimized.js +227 -227
  45. package/app/modules/vgmodal/scss/_variables.scss +17 -17
  46. package/app/modules/vgmodal/scss/vgmodal.scss +77 -77
  47. package/app/modules/vgnav/js/vgnav.js +137 -84
  48. package/app/modules/vgnav/scss/_breakpoints.scss +36 -36
  49. package/app/modules/vgnav/scss/_hamburger.scss +5 -5
  50. package/app/modules/vgnav/scss/_placement.scss +5 -5
  51. package/app/modules/vgnav/scss/_toggle.scss +5 -5
  52. package/app/modules/vgnav/scss/_variables.scss +26 -26
  53. package/app/modules/vgnav/scss/vgnav.scss +41 -41
  54. package/app/modules/vgnestable/README.md +39 -39
  55. package/app/modules/vgrangeslider/js/skins.js +8 -8
  56. package/app/modules/vgrangeslider/js/vgrangeslider.js +29 -29
  57. package/app/modules/vgrangeslider/scss/_variables.scss +55 -55
  58. package/app/modules/vgrangeslider/scss/vgrangeslider.scss +239 -239
  59. package/app/modules/vgrollup/js/vgrollup.js +15 -15
  60. package/app/modules/vgrollup/scss/_variables.scss +15 -15
  61. package/app/modules/vgrollup/scss/vgrollup.scss +6 -6
  62. package/app/modules/vgselect/js/handlers.js +6 -6
  63. package/app/modules/vgselect/js/vgselect.js +167 -123
  64. package/app/modules/vgselect/readme.md +11 -11
  65. package/app/modules/vgselect/scss/_variables.scss +51 -51
  66. package/app/modules/vgselect/scss/vgselect.scss +1 -1
  67. package/app/modules/vgsidebar/js/vgsidebar.js +21 -21
  68. package/app/modules/vgsidebar/scss/_variables.scss +10 -10
  69. package/app/modules/vgsidebar/scss/vgsidebar.scss +5 -5
  70. package/app/modules/vgspy/js/vgspy.js +43 -43
  71. package/app/modules/vgtable/js/_filters.js +10 -6
  72. package/app/modules/vgtable/js/_options.js +16 -16
  73. package/app/modules/vgtable/js/_pagination.js +118 -118
  74. package/app/modules/vgtable/js/_responsive.js +79 -79
  75. package/app/modules/vgtable/js/_sticky-header.js +349 -280
  76. package/app/modules/vgtable/js/vgtable.js +98 -98
  77. package/app/modules/vgtable/scss/_fixed-columns.scss +23 -25
  78. package/app/modules/vgtable/scss/_sorting.scss +6 -6
  79. package/app/modules/vgtable/scss/_sticky-header.scss +31 -31
  80. package/app/modules/vgtable/scss/_variables.scss +6 -4
  81. package/app/modules/vgtable/scss/vgtable.scss +8 -4
  82. package/app/modules/vgtabs/js/vgtabs.js +91 -91
  83. package/app/modules/vgtabs/scss/_variables.scss +23 -23
  84. package/app/modules/vgtabs/scss/vgtabs.scss +5 -5
  85. package/app/modules/vgtoast/js/vgtoast.js +4 -4
  86. package/app/modules/vgtoast/scss/_variables.scss +13 -13
  87. package/app/modules/vgtoast/scss/vgtoast.scss +5 -5
  88. package/app/modules/vgtooltip/js/vgtooltip.js +127 -127
  89. package/app/modules/vgtooltip/scss/_variables.scss +10 -10
  90. package/app/modules/vgtooltip/scss/vgtooltip.scss +5 -5
  91. package/app/utils/js/components/audio-metadata.js +240 -240
  92. package/app/utils/js/components/backdrop.js +116 -116
  93. package/app/utils/js/components/file-icon.js +7 -7
  94. package/app/utils/js/components/file-preview.js +304 -304
  95. package/app/utils/js/components/responsive.js +165 -165
  96. package/app/utils/js/components/sanitize.js +150 -150
  97. package/app/utils/js/components/video-metadata.js +140 -140
  98. package/app/utils/scss/_backdrop.scss +5 -5
  99. package/app/utils/scss/_theme-default.scss +12 -12
  100. package/app/utils/scss/_theme.scss +7 -7
  101. package/app/utils/scss/default.scss +9 -9
  102. package/app/utils/scss/functions.scss +21 -21
  103. package/app/utils/scss/index.scss +4 -4
  104. package/app/utils/scss/mixin.scss +16 -16
  105. package/app/utils/scss/variables.scss +147 -147
  106. package/build/vgapp.css +1 -1
  107. package/build/vgapp.css.map +1 -1
  108. package/build/vgapp.js +1 -1
  109. package/build/vgapp.js.map +1 -1
  110. package/index.js +7 -7
  111. package/package.json +1 -1
@@ -1,145 +1,145 @@
1
- import VGModal from "../../../vgmodal";
2
-
3
- class ImageModal {
4
- constructor() {
5
- this._modalId = 'vg-filepreview-image-modal';
6
- }
7
-
8
- static getInstance() {
9
- if (!ImageModal._instance) {
10
- ImageModal._instance = new ImageModal();
11
- }
12
-
13
- return ImageModal._instance;
14
- }
15
-
16
- open(payload = {}) {
17
- const src = String(payload.src || '').trim();
18
- if (!src) {
19
- return;
20
- }
21
-
22
- this._ensureModal();
23
- if (!this._modal || !this._image) {
24
- return;
25
- }
26
-
27
- const defaultTitle = String(payload.defaultTitle || '').trim();
28
- const title = String(payload.title || '').trim();
29
- this._title.textContent = title || defaultTitle;
30
- this._image.src = src;
31
- this._image.alt = title || defaultTitle;
32
-
33
- this._modal.show();
34
- }
35
-
36
- close() {
37
- if (!this._modal) {
38
- return;
39
- }
40
-
41
- this._modal.hide();
42
- }
43
-
44
- _ensureModal() {
45
- if (this._modal && this._root) {
46
- return;
47
- }
48
-
49
- this._initModal();
50
- }
51
-
52
- _initModal() {
53
- const params = {
54
- centered: true,
55
- dismiss: true,
56
- backdrop: true,
57
- keyboard: true,
58
- sizes: {
59
- width: 'fit-content',
60
- },
61
- animation: {
62
- enable: false
63
- }
64
- };
65
-
66
- const existed = document.getElementById(this._modalId);
67
- if (existed) {
68
- this._root = existed;
69
- this._modal = VGModal.getOrCreateInstance(existed, params);
70
- this._bindElements(existed);
71
- this._bindLifecycle(existed);
72
- return;
73
- }
74
-
75
- this._modal = VGModal.build(this._modalId, params, (modalInstance) => {
76
- const element = modalInstance._element;
77
- this._root = element;
78
- element.classList.add('vg-filepreview-image-modal');
79
-
80
- const body = element.querySelector('.vg-modal-body');
81
- const content = element.querySelector('.vg-modal-content');
82
- if (!body || !content) {
83
- return;
84
- }
85
-
86
- body.classList.add('vg-filepreview-image-modal__body');
87
- body.innerHTML = '';
88
-
89
- let header = element.querySelector('.vg-modal-header');
90
- if (!header) {
91
- header = document.createElement('div');
92
- header.className = 'vg-modal-header';
93
- content.prepend(header);
94
- }
95
-
96
- this._title = document.createElement('div');
97
- this._title.className = 'vg-modal-title';
98
- this._title.textContent = '';
99
-
100
- this._image = document.createElement('img');
101
- this._image.className = 'vg-filepreview-image-modal__img';
102
- this._image.loading = 'eager';
103
- this._image.decoding = 'async';
104
-
105
- header.appendChild(this._title);
106
- body.appendChild(this._image);
107
-
108
- this._bindLifecycle(element);
109
- });
110
- }
111
-
112
- _bindElements(root) {
113
- this._title = root.querySelector('.vg-filepreview-image-modal__title');
114
- this._image = root.querySelector('.vg-filepreview-image-modal__img');
115
- }
116
-
117
- _bindLifecycle(root) {
118
- if (!root || root.hasAttribute('data-vg-filepreview-image-lifecycle-bind')) {
119
- return;
120
- }
121
-
122
- root.setAttribute('data-vg-filepreview-image-lifecycle-bind', 'true');
123
- root.addEventListener('vg.modal.hidden', () => {
124
- this._destroyModal();
125
- });
126
- }
127
-
128
- _destroyModal() {
129
- if (this._modal && typeof this._modal.dispose === 'function') {
130
- this._modal.dispose();
131
- }
132
-
133
- if (this._root && this._root.parentNode) {
134
- this._root.parentNode.removeChild(this._root);
135
- }
136
-
137
- this._root = null;
138
- this._modal = null;
139
- this._title = null;
140
- this._image = null;
141
- }
142
-
143
- }
144
-
145
- export default ImageModal;
1
+ import VGModal from "../../../vgmodal";
2
+
3
+ class ImageModal {
4
+ constructor() {
5
+ this._modalId = 'vg-filepreview-image-modal';
6
+ }
7
+
8
+ static getInstance() {
9
+ if (!ImageModal._instance) {
10
+ ImageModal._instance = new ImageModal();
11
+ }
12
+
13
+ return ImageModal._instance;
14
+ }
15
+
16
+ open(payload = {}) {
17
+ const src = String(payload.src || '').trim();
18
+ if (!src) {
19
+ return;
20
+ }
21
+
22
+ this._ensureModal();
23
+ if (!this._modal || !this._image) {
24
+ return;
25
+ }
26
+
27
+ const defaultTitle = String(payload.defaultTitle || '').trim();
28
+ const title = String(payload.title || '').trim();
29
+ this._title.textContent = title || defaultTitle;
30
+ this._image.src = src;
31
+ this._image.alt = title || defaultTitle;
32
+
33
+ this._modal.show();
34
+ }
35
+
36
+ close() {
37
+ if (!this._modal) {
38
+ return;
39
+ }
40
+
41
+ this._modal.hide();
42
+ }
43
+
44
+ _ensureModal() {
45
+ if (this._modal && this._root) {
46
+ return;
47
+ }
48
+
49
+ this._initModal();
50
+ }
51
+
52
+ _initModal() {
53
+ const params = {
54
+ centered: true,
55
+ dismiss: true,
56
+ backdrop: true,
57
+ keyboard: true,
58
+ sizes: {
59
+ width: 'fit-content',
60
+ },
61
+ animation: {
62
+ enable: false
63
+ }
64
+ };
65
+
66
+ const existed = document.getElementById(this._modalId);
67
+ if (existed) {
68
+ this._root = existed;
69
+ this._modal = VGModal.getOrCreateInstance(existed, params);
70
+ this._bindElements(existed);
71
+ this._bindLifecycle(existed);
72
+ return;
73
+ }
74
+
75
+ this._modal = VGModal.build(this._modalId, params, (modalInstance) => {
76
+ const element = modalInstance._element;
77
+ this._root = element;
78
+ element.classList.add('vg-filepreview-image-modal');
79
+
80
+ const body = element.querySelector('.vg-modal-body');
81
+ const content = element.querySelector('.vg-modal-content');
82
+ if (!body || !content) {
83
+ return;
84
+ }
85
+
86
+ body.classList.add('vg-filepreview-image-modal__body');
87
+ body.innerHTML = '';
88
+
89
+ let header = element.querySelector('.vg-modal-header');
90
+ if (!header) {
91
+ header = document.createElement('div');
92
+ header.className = 'vg-modal-header';
93
+ content.prepend(header);
94
+ }
95
+
96
+ this._title = document.createElement('div');
97
+ this._title.className = 'vg-modal-title';
98
+ this._title.textContent = '';
99
+
100
+ this._image = document.createElement('img');
101
+ this._image.className = 'vg-filepreview-image-modal__img';
102
+ this._image.loading = 'eager';
103
+ this._image.decoding = 'async';
104
+
105
+ header.appendChild(this._title);
106
+ body.appendChild(this._image);
107
+
108
+ this._bindLifecycle(element);
109
+ });
110
+ }
111
+
112
+ _bindElements(root) {
113
+ this._title = root.querySelector('.vg-filepreview-image-modal__title');
114
+ this._image = root.querySelector('.vg-filepreview-image-modal__img');
115
+ }
116
+
117
+ _bindLifecycle(root) {
118
+ if (!root || root.hasAttribute('data-vg-filepreview-image-lifecycle-bind')) {
119
+ return;
120
+ }
121
+
122
+ root.setAttribute('data-vg-filepreview-image-lifecycle-bind', 'true');
123
+ root.addEventListener('vg.modal.hidden', () => {
124
+ this._destroyModal();
125
+ });
126
+ }
127
+
128
+ _destroyModal() {
129
+ if (this._modal && typeof this._modal.dispose === 'function') {
130
+ this._modal.dispose();
131
+ }
132
+
133
+ if (this._root && this._root.parentNode) {
134
+ this._root.parentNode.removeChild(this._root);
135
+ }
136
+
137
+ this._root = null;
138
+ this._modal = null;
139
+ this._title = null;
140
+ this._image = null;
141
+ }
142
+
143
+ }
144
+
145
+ export default ImageModal;
@@ -1,92 +1,92 @@
1
- import ImageModal from "./image-modal";
2
-
3
- const IMAGE_EXTENSIONS = new Set([
4
- '.png',
5
- '.jpg',
6
- '.jpeg',
7
- '.gif',
8
- '.webp',
9
- '.svg',
10
- '.bmp',
11
- '.tif',
12
- '.tiff',
13
- '.heic',
14
- '.heif',
15
- '.avif'
16
- ]);
17
-
18
- class ImageFilePreviewRenderer {
19
- constructor() {
20
- this.name = 'image';
21
- this._modal = ImageModal.getInstance();
22
- }
23
-
24
- canRender(context = {}) {
25
- const ext = String(context?.fileMeta?.ext || '').toLowerCase();
26
- return IMAGE_EXTENSIONS.has(ext);
27
- }
28
-
29
- render(context = {}) {
30
- const container = context?.previewContainer;
31
- const nameOnly = Boolean(context?.ui?.nameOnly);
32
- const i18n = context?.i18n;
33
-
34
- const src = context?.fileUrl?.href || context?.filePath || '';
35
- if (!src) {
36
- return false;
37
- }
38
-
39
- const openImage = (event) => {
40
- if (event) {
41
- event.preventDefault();
42
- }
43
-
44
- this._modal.open({
45
- src,
46
- title: context?.fileMeta?.name || i18n?.message('image_title') || '',
47
- defaultTitle: i18n?.message('image_title') || ''
48
- });
49
- };
50
-
51
- const titleLink = context?.element?.querySelector('.name');
52
- if (titleLink && !titleLink.hasAttribute('data-vg-filepreview-image-bind')) {
53
- titleLink.setAttribute('data-vg-filepreview-image-bind', 'true');
54
- titleLink.classList.add('is-preview-action');
55
- titleLink.addEventListener('click', openImage);
56
- }
57
-
58
- const listImage = context?.element?.closest('.file')?.querySelector('.file-image .file-preview');
59
- if (listImage && !listImage.hasAttribute('data-vg-filepreview-image-bind')) {
60
- listImage.setAttribute('data-vg-filepreview-image-bind', 'true');
61
- listImage.classList.add('is-preview-action');
62
- listImage.addEventListener('click', openImage);
63
- }
64
-
65
- if (nameOnly) {
66
- return Boolean(titleLink || listImage);
67
- }
68
-
69
- if (!container) {
70
- return false;
71
- }
72
-
73
- const trigger = document.createElement('button');
74
- trigger.type = 'button';
75
- trigger.className = 'vg-filepreview-image-trigger';
76
- trigger.textContent = i18n?.button('open_image') || '';
77
- trigger.addEventListener('click', openImage);
78
- container.appendChild(trigger);
79
-
80
- const thumbnail = document.createElement('img');
81
- thumbnail.className = 'vg-filepreview-image-thumb';
82
- thumbnail.src = src;
83
- thumbnail.alt = context?.fileMeta?.name || i18n?.message('image_thumbnail_alt') || '';
84
- thumbnail.loading = 'lazy';
85
- thumbnail.addEventListener('click', openImage);
86
- container.appendChild(thumbnail);
87
-
88
- return true;
89
- }
90
- }
91
-
92
- export default ImageFilePreviewRenderer;
1
+ import ImageModal from "./image-modal";
2
+
3
+ const IMAGE_EXTENSIONS = new Set([
4
+ '.png',
5
+ '.jpg',
6
+ '.jpeg',
7
+ '.gif',
8
+ '.webp',
9
+ '.svg',
10
+ '.bmp',
11
+ '.tif',
12
+ '.tiff',
13
+ '.heic',
14
+ '.heif',
15
+ '.avif'
16
+ ]);
17
+
18
+ class ImageFilePreviewRenderer {
19
+ constructor() {
20
+ this.name = 'image';
21
+ this._modal = ImageModal.getInstance();
22
+ }
23
+
24
+ canRender(context = {}) {
25
+ const ext = String(context?.fileMeta?.ext || '').toLowerCase();
26
+ return IMAGE_EXTENSIONS.has(ext);
27
+ }
28
+
29
+ render(context = {}) {
30
+ const container = context?.previewContainer;
31
+ const nameOnly = Boolean(context?.ui?.nameOnly);
32
+ const i18n = context?.i18n;
33
+
34
+ const src = context?.fileUrl?.href || context?.filePath || '';
35
+ if (!src) {
36
+ return false;
37
+ }
38
+
39
+ const openImage = (event) => {
40
+ if (event) {
41
+ event.preventDefault();
42
+ }
43
+
44
+ this._modal.open({
45
+ src,
46
+ title: context?.fileMeta?.name || i18n?.message('image_title') || '',
47
+ defaultTitle: i18n?.message('image_title') || ''
48
+ });
49
+ };
50
+
51
+ const titleLink = context?.element?.querySelector('.name');
52
+ if (titleLink && !titleLink.hasAttribute('data-vg-filepreview-image-bind')) {
53
+ titleLink.setAttribute('data-vg-filepreview-image-bind', 'true');
54
+ titleLink.classList.add('is-preview-action');
55
+ titleLink.addEventListener('click', openImage);
56
+ }
57
+
58
+ const listImage = context?.element?.closest('.file')?.querySelector('.file-image .file-preview');
59
+ if (listImage && !listImage.hasAttribute('data-vg-filepreview-image-bind')) {
60
+ listImage.setAttribute('data-vg-filepreview-image-bind', 'true');
61
+ listImage.classList.add('is-preview-action');
62
+ listImage.addEventListener('click', openImage);
63
+ }
64
+
65
+ if (nameOnly) {
66
+ return Boolean(titleLink || listImage);
67
+ }
68
+
69
+ if (!container) {
70
+ return false;
71
+ }
72
+
73
+ const trigger = document.createElement('button');
74
+ trigger.type = 'button';
75
+ trigger.className = 'vg-filepreview-image-trigger';
76
+ trigger.textContent = i18n?.button('open_image') || '';
77
+ trigger.addEventListener('click', openImage);
78
+ container.appendChild(trigger);
79
+
80
+ const thumbnail = document.createElement('img');
81
+ thumbnail.className = 'vg-filepreview-image-thumb';
82
+ thumbnail.src = src;
83
+ thumbnail.alt = context?.fileMeta?.name || i18n?.message('image_thumbnail_alt') || '';
84
+ thumbnail.loading = 'lazy';
85
+ thumbnail.addEventListener('click', openImage);
86
+ container.appendChild(thumbnail);
87
+
88
+ return true;
89
+ }
90
+ }
91
+
92
+ export default ImageFilePreviewRenderer;
@@ -1,19 +1,19 @@
1
- import ImageFilePreviewRenderer from "./image";
2
- import OfficeFilePreviewRenderer from "./office";
3
- import PdfFilePreviewRenderer from "./pdf";
4
- import TextFilePreviewRenderer from "./text";
5
- import VideoFilePreviewRenderer from "./video";
6
- import ZipFilePreviewRenderer from "./zip";
7
-
8
- const createFilePreviewRenderers = () => {
9
- return [
10
- new ImageFilePreviewRenderer(),
11
- new VideoFilePreviewRenderer(),
12
- new PdfFilePreviewRenderer(),
13
- new OfficeFilePreviewRenderer(),
14
- new ZipFilePreviewRenderer(),
15
- new TextFilePreviewRenderer()
16
- ];
17
- };
18
-
19
- export default createFilePreviewRenderers;
1
+ import ImageFilePreviewRenderer from "./image";
2
+ import OfficeFilePreviewRenderer from "./office";
3
+ import PdfFilePreviewRenderer from "./pdf";
4
+ import TextFilePreviewRenderer from "./text";
5
+ import VideoFilePreviewRenderer from "./video";
6
+ import ZipFilePreviewRenderer from "./zip";
7
+
8
+ const createFilePreviewRenderers = () => {
9
+ return [
10
+ new ImageFilePreviewRenderer(),
11
+ new VideoFilePreviewRenderer(),
12
+ new PdfFilePreviewRenderer(),
13
+ new OfficeFilePreviewRenderer(),
14
+ new ZipFilePreviewRenderer(),
15
+ new TextFilePreviewRenderer()
16
+ ];
17
+ };
18
+
19
+ export default createFilePreviewRenderers;