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
@@ -8,11 +8,11 @@ class Sortable {
8
8
  ascLabel: 'Сортировка по возрастанию',
9
9
  descLabel: 'Сортировка по убыванию',
10
10
  isColumnSortable: null,
11
- onChange: null,
12
- multiSort: false,
13
- multiSortWithShift: true,
14
- hideUnsortedArrows: false,
15
- }, options);
11
+ onChange: null,
12
+ multiSort: false,
13
+ multiSortWithShift: true,
14
+ hideUnsortedArrows: false,
15
+ }, options);
16
16
 
17
17
  this._headers = [];
18
18
  this._sorts = [];
@@ -21,12 +21,12 @@ class Sortable {
21
21
  this._boundKeyDown = this._handleKeyDown.bind(this);
22
22
  }
23
23
 
24
- init() {
25
- this._headers = this._getHeaders();
26
- if (!this._headers.length) {
27
- return;
28
- }
29
- this._syncControlsVisibilityMode();
24
+ init() {
25
+ this._headers = this._getHeaders();
26
+ if (!this._headers.length) {
27
+ return;
28
+ }
29
+ this._syncControlsVisibilityMode();
30
30
 
31
31
  this._headers.forEach((header, index) => {
32
32
  if (!this._isSortable(header, index)) {
@@ -64,12 +64,12 @@ class Sortable {
64
64
  this._setSorts([{ index, dir: this._normalizeDir(payload.dir) }], false);
65
65
  }
66
66
 
67
- refresh(payload = {}) {
68
- this._headers = this._getHeaders();
69
- if (!this._headers.length) {
70
- return;
71
- }
72
- this._syncControlsVisibilityMode();
67
+ refresh(payload = {}) {
68
+ this._headers = this._getHeaders();
69
+ if (!this._headers.length) {
70
+ return;
71
+ }
72
+ this._syncControlsVisibilityMode();
73
73
 
74
74
  this._headers.forEach((header, index) => {
75
75
  if (!this._isSortable(header, index)) {
@@ -97,17 +97,17 @@ class Sortable {
97
97
  this._setSorts(this._normalizeSorts(this._sorts), false);
98
98
  }
99
99
 
100
- _applyInitialState() {
101
- const index = this._resolveIndex({
102
- field: this._options.initialField,
103
- columnIndex: -1,
104
- });
105
- if (index < 0 || !this._isSortable(this._headers[index], index)) {
106
- this._setSorts([], false);
107
- return;
108
- }
109
- this._setSorts([{ index, dir: this._normalizeDir(this._options.initialDir) }], false);
110
- }
100
+ _applyInitialState() {
101
+ const index = this._resolveIndex({
102
+ field: this._options.initialField,
103
+ columnIndex: -1,
104
+ });
105
+ if (index < 0 || !this._isSortable(this._headers[index], index)) {
106
+ this._setSorts([], false);
107
+ return;
108
+ }
109
+ this._setSorts([{ index, dir: this._normalizeDir(this._options.initialDir) }], false);
110
+ }
111
111
 
112
112
  _getHeaders() {
113
113
  const head = this._table.tHead || this._table.querySelector('thead');
@@ -221,29 +221,29 @@ class Sortable {
221
221
  });
222
222
  });
223
223
 
224
- this._headers.forEach((header, headerIndex) => {
225
- const sort = sortByIndex.has(headerIndex) ? sortByIndex.get(headerIndex) : null;
226
- if (!this._isSortable(header, headerIndex)) {
227
- header.removeAttribute('data-sort-direction');
228
- header.removeAttribute('data-sort-priority');
229
- header.setAttribute('aria-sort', 'none');
230
- return;
231
- }
232
-
233
- const controls = this._getHeaderControls(header);
234
- const controlsNode = controls.controlsNode;
235
- const ascButton = controls.ascButton;
236
- const descButton = controls.descButton;
237
- const shouldHideControls = Boolean(this._options.hideUnsortedArrows && !sort);
238
-
239
- if (controlsNode) {
240
- controlsNode.hidden = shouldHideControls;
241
- }
242
-
243
- if (sort) {
244
- header.dataset.sortDirection = sort.dir;
245
- header.dataset.sortPriority = String(sort.priority);
246
- header.setAttribute('aria-sort', sort.dir === 'asc' ? 'ascending' : 'descending');
224
+ this._headers.forEach((header, headerIndex) => {
225
+ const sort = sortByIndex.has(headerIndex) ? sortByIndex.get(headerIndex) : null;
226
+ if (!this._isSortable(header, headerIndex)) {
227
+ header.removeAttribute('data-sort-direction');
228
+ header.removeAttribute('data-sort-priority');
229
+ header.setAttribute('aria-sort', 'none');
230
+ return;
231
+ }
232
+
233
+ const controls = this._getHeaderControls(header);
234
+ const controlsNode = controls.controlsNode;
235
+ const ascButton = controls.ascButton;
236
+ const descButton = controls.descButton;
237
+ const shouldHideControls = Boolean(this._options.hideUnsortedArrows && !sort);
238
+
239
+ if (controlsNode) {
240
+ controlsNode.hidden = shouldHideControls;
241
+ }
242
+
243
+ if (sort) {
244
+ header.dataset.sortDirection = sort.dir;
245
+ header.dataset.sortPriority = String(sort.priority);
246
+ header.setAttribute('aria-sort', sort.dir === 'asc' ? 'ascending' : 'descending');
247
247
  if (ascButton) ascButton.setAttribute('aria-pressed', sort.dir === 'asc' ? 'true' : 'false');
248
248
  if (descButton) descButton.setAttribute('aria-pressed', sort.dir === 'desc' ? 'true' : 'false');
249
249
  } else {
@@ -370,11 +370,11 @@ class Sortable {
370
370
  if (this._headerControls.has(header)) {
371
371
  return this._headerControls.get(header);
372
372
  }
373
- const controls = {
374
- controlsNode: header.querySelector('.vgdt-sort-controls'),
375
- ascButton: header.querySelector('[data-sort-arrow="asc"]'),
376
- descButton: header.querySelector('[data-sort-arrow="desc"]'),
377
- };
373
+ const controls = {
374
+ controlsNode: header.querySelector('.vgdt-sort-controls'),
375
+ ascButton: header.querySelector('[data-sort-arrow="asc"]'),
376
+ descButton: header.querySelector('[data-sort-arrow="desc"]'),
377
+ };
378
378
  this._headerControls.set(header, controls);
379
379
  return controls;
380
380
  }
@@ -412,21 +412,21 @@ class Sortable {
412
412
  return directions.includes(normalized) ? normalized : directions[0];
413
413
  }
414
414
 
415
- _getDirections() {
416
- const list = Array.isArray(this._options.directions) ? this._options.directions : ['asc', 'desc'];
417
- const normalized = list
418
- .map((item) => String(item).toLowerCase().trim())
419
- .filter((item) => item === 'asc' || item === 'desc');
420
- return normalized.length ? Array.from(new Set(normalized)) : ['asc', 'desc'];
421
- }
422
-
423
- _syncControlsVisibilityMode() {
424
- if (this._options.hideUnsortedArrows) {
425
- this._table.setAttribute('data-sort-hide-unsorted-arrows', '1');
426
- return;
427
- }
428
- this._table.removeAttribute('data-sort-hide-unsorted-arrows');
429
- }
415
+ _getDirections() {
416
+ const list = Array.isArray(this._options.directions) ? this._options.directions : ['asc', 'desc'];
417
+ const normalized = list
418
+ .map((item) => String(item).toLowerCase().trim())
419
+ .filter((item) => item === 'asc' || item === 'desc');
420
+ return normalized.length ? Array.from(new Set(normalized)) : ['asc', 'desc'];
421
+ }
422
+
423
+ _syncControlsVisibilityMode() {
424
+ if (this._options.hideUnsortedArrows) {
425
+ this._table.setAttribute('data-sort-hide-unsorted-arrows', '1');
426
+ return;
427
+ }
428
+ this._table.removeAttribute('data-sort-hide-unsorted-arrows');
429
+ }
430
430
 
431
431
  _escapeAttr(value) {
432
432
  return String(value)
@@ -1,6 +1,6 @@
1
- import {normalizeBooleanOption, normalizeEnabledFlag, safeQuerySelector} from "./utils/common";
2
-
3
- const summaryFooterMethods = {
1
+ import {normalizeBooleanOption, normalizeEnabledFlag, safeQuerySelector} from "./utils/common";
2
+
3
+ const summaryFooterMethods = {
4
4
  _renderSummary(meta = {}) {
5
5
  if (!this._isSummaryEnabled() || !this._summaryNode || !this._isRemote) {
6
6
  return;
@@ -28,14 +28,14 @@ const summaryFooterMethods = {
28
28
  this._summaryNode.hidden = false;
29
29
  },
30
30
 
31
- _isSummaryEnabled() {
32
- const options = this._params.summary || {};
33
- if (options.enable !== undefined && options.enable !== null) {
34
- return normalizeBooleanOption(options.enable, false);
35
- }
36
-
37
- const attr = this._element.getAttribute('data-summary-enable');
38
- return normalizeEnabledFlag(attr, false);
31
+ _isSummaryEnabled() {
32
+ const options = this._params.summary || {};
33
+ if (options.enable !== undefined && options.enable !== null) {
34
+ return normalizeBooleanOption(options.enable, false);
35
+ }
36
+
37
+ const attr = this._element.getAttribute('data-summary-enable');
38
+ return normalizeEnabledFlag(attr, false);
39
39
  },
40
40
 
41
41
  _getActiveCriteria() {
@@ -69,14 +69,14 @@ const summaryFooterMethods = {
69
69
  return '';
70
70
  }
71
71
 
72
- const shouldRefreshFormCache = this._filtersFormCacheSelector !== selector
73
- || !this._filtersFormCacheNode
74
- || !this._filtersFormCacheNode.isConnected;
75
- if (shouldRefreshFormCache) {
76
- this._filtersFormCacheSelector = selector;
77
- this._filtersFormCacheNode = safeQuerySelector(selector);
78
- this._filtersLabelCache = {};
79
- }
72
+ const shouldRefreshFormCache = this._filtersFormCacheSelector !== selector
73
+ || !this._filtersFormCacheNode
74
+ || !this._filtersFormCacheNode.isConnected;
75
+ if (shouldRefreshFormCache) {
76
+ this._filtersFormCacheSelector = selector;
77
+ this._filtersFormCacheNode = safeQuerySelector(selector);
78
+ this._filtersLabelCache = {};
79
+ }
80
80
 
81
81
  const form = this._filtersFormCacheNode;
82
82
  if (!form) {
@@ -237,15 +237,15 @@ const summaryFooterMethods = {
237
237
  `;
238
238
  },
239
239
 
240
- _isFooterEnabled() {
241
- const options = this._params.footer || {};
242
- if (options.enable !== undefined && options.enable !== null) {
243
- return normalizeBooleanOption(options.enable, false);
244
- }
245
-
246
- const attr = this._element.getAttribute('data-footer-enable');
247
- return normalizeEnabledFlag(attr, false);
248
- },
240
+ _isFooterEnabled() {
241
+ const options = this._params.footer || {};
242
+ if (options.enable !== undefined && options.enable !== null) {
243
+ return normalizeBooleanOption(options.enable, false);
244
+ }
245
+
246
+ const attr = this._element.getAttribute('data-footer-enable');
247
+ return normalizeEnabledFlag(attr, false);
248
+ },
249
249
 
250
250
  _applyFooterVisibility() {
251
251
  const foot = this._element.tFoot || this._element.querySelector('tfoot');
@@ -1,6 +1,6 @@
1
- import {normalizeBooleanOption, normalizeEnabledFlag, safeQuerySelector, toQueryParamValue} from "./utils/common";
2
-
3
- const tableUrlStateMethods = {
1
+ import {normalizeBooleanOption, normalizeEnabledFlag, safeQuerySelector, toQueryParamValue} from "./utils/common";
2
+
3
+ const tableUrlStateMethods = {
4
4
  _syncUrlState() {
5
5
  if (!this._isFiltersUrlStateEnabled() || !this._isFiltersUrlStateWriteOnChange()) {
6
6
  return;
@@ -26,12 +26,12 @@ const tableUrlStateMethods = {
26
26
  url.searchParams.delete(key);
27
27
  });
28
28
 
29
- Object.keys(nextState).forEach((key) => {
30
- const rawValue = nextState[key];
31
- const value = toQueryParamValue(rawValue);
32
- if (value === undefined || value === null || value === '') {
33
- return;
34
- }
29
+ Object.keys(nextState).forEach((key) => {
30
+ const rawValue = nextState[key];
31
+ const value = toQueryParamValue(rawValue);
32
+ if (value === undefined || value === null || value === '') {
33
+ return;
34
+ }
35
35
  url.searchParams.set(key, String(value));
36
36
  });
37
37
 
@@ -200,8 +200,8 @@ const tableUrlStateMethods = {
200
200
  },
201
201
 
202
202
  _isUrlStatePopStateEnabled() {
203
- const attr = this._element.getAttribute('data-filters-urlstate-listen-popstate');
204
- return normalizeEnabledFlag(attr, true);
203
+ const attr = this._element.getAttribute('data-filters-urlstate-listen-popstate');
204
+ return normalizeEnabledFlag(attr, true);
205
205
  },
206
206
 
207
207
  _getInitialRemoteParams() {
@@ -393,15 +393,15 @@ const tableUrlStateMethods = {
393
393
  this._filterParamKeysCache = null;
394
394
  return null;
395
395
  }
396
- const shouldRefresh = this._filtersFormCacheSelector !== selector
397
- || !this._filtersFormCacheNode
398
- || !this._filtersFormCacheNode.isConnected;
399
- if (shouldRefresh) {
400
- this._filtersFormCacheSelector = selector;
401
- this._filtersFormCacheNode = safeQuerySelector(selector);
402
- this._filterParamKeysCache = null;
403
- }
404
- return this._filtersFormCacheNode;
396
+ const shouldRefresh = this._filtersFormCacheSelector !== selector
397
+ || !this._filtersFormCacheNode
398
+ || !this._filtersFormCacheNode.isConnected;
399
+ if (shouldRefresh) {
400
+ this._filtersFormCacheSelector = selector;
401
+ this._filtersFormCacheNode = safeQuerySelector(selector);
402
+ this._filterParamKeysCache = null;
403
+ }
404
+ return this._filtersFormCacheNode;
405
405
  },
406
406
 
407
407
  _getFiltersUrlStateConfig() {
@@ -421,24 +421,24 @@ const tableUrlStateMethods = {
421
421
 
422
422
  _isFiltersUrlStateEnabled() {
423
423
  const config = this._getFiltersUrlStateConfig();
424
- const attr = this._element.getAttribute('data-filters-urlstate-enable');
425
- const raw = attr !== null ? attr : config.enable;
426
- return normalizeBooleanOption(raw, false);
424
+ const attr = this._element.getAttribute('data-filters-urlstate-enable');
425
+ const raw = attr !== null ? attr : config.enable;
426
+ return normalizeBooleanOption(raw, false);
427
427
  },
428
428
 
429
429
  _isFiltersUrlStateReadOnInit() {
430
430
  const config = this._getFiltersUrlStateConfig();
431
- const attr = this._element.getAttribute('data-filters-urlstate-read-on-init');
432
- const raw = attr !== null ? attr : config.readOnInit;
433
- return normalizeEnabledFlag(raw, true);
431
+ const attr = this._element.getAttribute('data-filters-urlstate-read-on-init');
432
+ const raw = attr !== null ? attr : config.readOnInit;
433
+ return normalizeEnabledFlag(raw, true);
434
434
  },
435
435
 
436
436
  _isFiltersUrlStateWriteOnChange() {
437
437
  const config = this._getFiltersUrlStateConfig();
438
- const attr = this._element.getAttribute('data-filters-urlstate-write-on-change');
439
- const raw = attr !== null ? attr : config.writeOnChange;
440
- return normalizeEnabledFlag(raw, true);
441
- },
442
- };
438
+ const attr = this._element.getAttribute('data-filters-urlstate-write-on-change');
439
+ const raw = attr !== null ? attr : config.writeOnChange;
440
+ return normalizeEnabledFlag(raw, true);
441
+ },
442
+ };
443
443
 
444
444
  export default tableUrlStateMethods;
@@ -1,48 +1,48 @@
1
- export function normalizeNonNegativeInt(value, fallback = 0) {
2
- const parsed = Number.parseInt(value, 10);
3
- return Number.isFinite(parsed) && parsed >= 0 ? parsed : fallback;
4
- }
5
-
6
- export function normalizeBooleanOption(value, fallback = false) {
7
- if (value === undefined || value === null) {
8
- return fallback;
9
- }
10
- const normalized = String(value).toLowerCase().trim();
11
- if (normalized === 'true' || normalized === '1') {
12
- return true;
13
- }
14
- if (normalized === 'false' || normalized === '0') {
15
- return false;
16
- }
17
- return Boolean(value);
18
- }
19
-
20
- export function normalizeEnabledFlag(value, fallback = true) {
21
- if (value === undefined || value === null) {
22
- return fallback;
23
- }
24
- const normalized = String(value).toLowerCase().trim();
25
- return normalized !== 'false' && normalized !== '0';
26
- }
27
-
28
- export function safeQuerySelector(selector, root = document) {
29
- const normalized = String(selector || '').trim();
30
- if (!normalized || !root || typeof root.querySelector !== 'function') {
31
- return null;
32
- }
33
- try {
34
- return root.querySelector(normalized);
35
- } catch (error) {
36
- return null;
37
- }
38
- }
39
-
40
- export function toQueryParamValue(value) {
41
- if (!Array.isArray(value)) {
42
- return value;
43
- }
44
- return value
45
- .map((item) => String(item || '').trim())
46
- .filter((item) => item !== '')
47
- .join(',');
48
- }
1
+ export function normalizeNonNegativeInt(value, fallback = 0) {
2
+ const parsed = Number.parseInt(value, 10);
3
+ return Number.isFinite(parsed) && parsed >= 0 ? parsed : fallback;
4
+ }
5
+
6
+ export function normalizeBooleanOption(value, fallback = false) {
7
+ if (value === undefined || value === null) {
8
+ return fallback;
9
+ }
10
+ const normalized = String(value).toLowerCase().trim();
11
+ if (normalized === 'true' || normalized === '1') {
12
+ return true;
13
+ }
14
+ if (normalized === 'false' || normalized === '0') {
15
+ return false;
16
+ }
17
+ return Boolean(value);
18
+ }
19
+
20
+ export function normalizeEnabledFlag(value, fallback = true) {
21
+ if (value === undefined || value === null) {
22
+ return fallback;
23
+ }
24
+ const normalized = String(value).toLowerCase().trim();
25
+ return normalized !== 'false' && normalized !== '0';
26
+ }
27
+
28
+ export function safeQuerySelector(selector, root = document) {
29
+ const normalized = String(selector || '').trim();
30
+ if (!normalized || !root || typeof root.querySelector !== 'function') {
31
+ return null;
32
+ }
33
+ try {
34
+ return root.querySelector(normalized);
35
+ } catch (error) {
36
+ return null;
37
+ }
38
+ }
39
+
40
+ export function toQueryParamValue(value) {
41
+ if (!Array.isArray(value)) {
42
+ return value;
43
+ }
44
+ return value
45
+ .map((item) => String(item || '').trim())
46
+ .filter((item) => item !== '')
47
+ .join(',');
48
+ }
@@ -3026,34 +3026,34 @@ class VGDynamicTable extends BaseModule {
3026
3026
  return false;
3027
3027
  }
3028
3028
 
3029
- _isCloneStickyHeaderEnabled() {
3030
- const sticky = this._params.stickyHeader || {};
3031
- const cloneAttr = this._element.getAttribute('data-sticky-header-clone');
3032
- if (cloneAttr !== null) {
3033
- const normalized = String(cloneAttr).toLowerCase().trim();
3034
- return normalized !== 'false' && normalized !== '0';
3035
- }
3036
-
3037
- if (sticky.clone !== undefined && sticky.clone !== null) {
3038
- const normalized = String(sticky.clone).toLowerCase().trim();
3039
- if (normalized === 'true' || normalized === '1') {
3040
- return true;
3041
- }
3042
- if (normalized === 'false' || normalized === '0') {
3043
- return false;
3044
- }
3045
- return Boolean(sticky.clone);
3046
- }
3047
-
3048
- if (this._parent && this._parent.classList.contains('table-sticky')) {
3049
- return true;
3050
- }
3051
- if (this._element && this._element.classList.contains('table-sticky')) {
3052
- return true;
3053
- }
3054
-
3055
- return this._isStickyHeaderEnabled();
3056
- }
3029
+ _isCloneStickyHeaderEnabled() {
3030
+ const sticky = this._params.stickyHeader || {};
3031
+ const cloneAttr = this._element.getAttribute('data-sticky-header-clone');
3032
+ if (cloneAttr !== null) {
3033
+ const normalized = String(cloneAttr).toLowerCase().trim();
3034
+ return normalized !== 'false' && normalized !== '0';
3035
+ }
3036
+
3037
+ if (sticky.clone !== undefined && sticky.clone !== null) {
3038
+ const normalized = String(sticky.clone).toLowerCase().trim();
3039
+ if (normalized === 'true' || normalized === '1') {
3040
+ return true;
3041
+ }
3042
+ if (normalized === 'false' || normalized === '0') {
3043
+ return false;
3044
+ }
3045
+ return Boolean(sticky.clone);
3046
+ }
3047
+
3048
+ if (this._parent && this._parent.classList.contains('table-sticky')) {
3049
+ return true;
3050
+ }
3051
+ if (this._element && this._element.classList.contains('table-sticky')) {
3052
+ return true;
3053
+ }
3054
+
3055
+ return this._isStickyHeaderEnabled();
3056
+ }
3057
3057
 
3058
3058
  _refreshStickyAndFixedLayout(options = {}) {
3059
3059
  const immediate = Boolean(options && options.immediate);
@@ -3159,13 +3159,13 @@ class VGDynamicTable extends BaseModule {
3159
3159
  };
3160
3160
  }
3161
3161
 
3162
- _getCloneStickyHeaderOffsets() {
3163
- const configured = this._getStickyHeaderOffsets();
3164
- return {
3165
- top: configured.top || this._readCssSizeVar('--vgdt-sticky-top', 0),
3166
- maxHeight: configured.maxHeight || this._readCssSizeVar('--vgdt-sticky-max-height', 0),
3167
- };
3168
- }
3162
+ _getCloneStickyHeaderOffsets() {
3163
+ const configured = this._getStickyHeaderOffsets();
3164
+ return {
3165
+ top: configured.top || this._readCssSizeVar('--vgdt-sticky-top', 0),
3166
+ maxHeight: configured.maxHeight || this._readCssSizeVar('--vgdt-sticky-max-height', 0),
3167
+ };
3168
+ }
3169
3169
 
3170
3170
  _readCssSizeVar(name, fallback = 0) {
3171
3171
  const sources = [this._parent, this._element, this._tableViewport].filter(Boolean);
@@ -3258,13 +3258,13 @@ class VGDynamicTable extends BaseModule {
3258
3258
  }
3259
3259
  if (state && state.headerWrap && state.headerWrap.parentElement) {
3260
3260
  state.headerWrap.parentElement.removeChild(state.headerWrap);
3261
- }
3262
- this._cloneStickyState = null;
3263
- this._parent.style.removeProperty('--vgdt-sticky-clone-height');
3264
- this._parent.style.removeProperty('--vgdt-sticky-top');
3265
- if (scrollTarget && !this._isStickyHeaderEnabled()) {
3266
- scrollTarget.classList.remove('table-sticky-scroll');
3267
- scrollTarget.style.removeProperty('--vgdt-sticky-max-height');
3261
+ }
3262
+ this._cloneStickyState = null;
3263
+ this._parent.style.removeProperty('--vgdt-sticky-clone-height');
3264
+ this._parent.style.removeProperty('--vgdt-sticky-top');
3265
+ if (scrollTarget && !this._isStickyHeaderEnabled()) {
3266
+ scrollTarget.classList.remove('table-sticky-scroll');
3267
+ scrollTarget.style.removeProperty('--vgdt-sticky-max-height');
3268
3268
  }
3269
3269
  this._updateLayoutResizeBinding();
3270
3270
  return;
@@ -3276,11 +3276,11 @@ class VGDynamicTable extends BaseModule {
3276
3276
 
3277
3277
  const offsets = this._getCloneStickyHeaderOffsets();
3278
3278
 
3279
- if (scrollTarget) {
3280
- this._parent.style.setProperty('--vgdt-sticky-top', `${offsets.top}px`);
3281
- if (offsets.maxHeight > 0) {
3282
- scrollTarget.classList.add('table-sticky-scroll');
3283
- scrollTarget.style.setProperty('--vgdt-sticky-max-height', `${offsets.maxHeight}px`);
3279
+ if (scrollTarget) {
3280
+ this._parent.style.setProperty('--vgdt-sticky-top', `${offsets.top}px`);
3281
+ if (offsets.maxHeight > 0) {
3282
+ scrollTarget.classList.add('table-sticky-scroll');
3283
+ scrollTarget.style.setProperty('--vgdt-sticky-max-height', `${offsets.maxHeight}px`);
3284
3284
  } else {
3285
3285
  scrollTarget.classList.remove('table-sticky-scroll');
3286
3286
  scrollTarget.style.removeProperty('--vgdt-sticky-max-height');
@@ -3718,20 +3718,20 @@ class VGDynamicTable extends BaseModule {
3718
3718
  this._refreshStickyAndFixedLayout();
3719
3719
  }
3720
3720
 
3721
- _scrollToPaginationTop() {
3722
- if (!this._isPaginationScrollToTopEnabled()) {
3723
- return;
3724
- }
3725
- if (this._tableViewport) {
3726
- this._tableViewport.scrollTop = 0;
3727
- this._tableViewport.scrollLeft = 0;
3728
- }
3729
- if (this._hasFixedHeightViewport()) {
3730
- return;
3731
- }
3732
- if (typeof window === 'undefined' || !this._parent) {
3733
- return;
3734
- }
3721
+ _scrollToPaginationTop() {
3722
+ if (!this._isPaginationScrollToTopEnabled()) {
3723
+ return;
3724
+ }
3725
+ if (this._tableViewport) {
3726
+ this._tableViewport.scrollTop = 0;
3727
+ this._tableViewport.scrollLeft = 0;
3728
+ }
3729
+ if (this._hasFixedHeightViewport()) {
3730
+ return;
3731
+ }
3732
+ if (typeof window === 'undefined' || !this._parent) {
3733
+ return;
3734
+ }
3735
3735
 
3736
3736
  const targetTop = this._getPaginationScrollTopTarget();
3737
3737
  const currentTop = window.pageYOffset || window.scrollY || 0;
@@ -3748,24 +3748,24 @@ class VGDynamicTable extends BaseModule {
3748
3748
  window.scrollTo({
3749
3749
  top: Math.max(0, Math.round(targetTop)),
3750
3750
  behavior: prefersReducedMotion ? 'auto' : 'smooth',
3751
- });
3752
- }
3753
-
3754
- _hasFixedHeightViewport() {
3755
- if (this._tableViewport && this._tableViewport.classList.contains('table-sticky-scroll')) {
3756
- return true;
3757
- }
3758
-
3759
- const offsets = this._getStickyHeaderOffsets();
3760
- if (offsets.maxHeight > 0) {
3761
- return true;
3762
- }
3763
-
3764
- return this._readCssSizeVar('--vgdt-sticky-max-height', 0) > 0;
3765
- }
3766
-
3767
- _getPaginationScrollTopTarget() {
3768
- if (this._isPaginationScrollToWindowTopEnabled()) {
3751
+ });
3752
+ }
3753
+
3754
+ _hasFixedHeightViewport() {
3755
+ if (this._tableViewport && this._tableViewport.classList.contains('table-sticky-scroll')) {
3756
+ return true;
3757
+ }
3758
+
3759
+ const offsets = this._getStickyHeaderOffsets();
3760
+ if (offsets.maxHeight > 0) {
3761
+ return true;
3762
+ }
3763
+
3764
+ return this._readCssSizeVar('--vgdt-sticky-max-height', 0) > 0;
3765
+ }
3766
+
3767
+ _getPaginationScrollTopTarget() {
3768
+ if (this._isPaginationScrollToWindowTopEnabled()) {
3769
3769
  return 0;
3770
3770
  }
3771
3771
  const rect = this._parent.getBoundingClientRect();