vgapp 1.2.5 → 1.2.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 (42) hide show
  1. package/CHANGELOG.md +58 -35
  2. package/agents.md +2 -2
  3. package/app/modules/base-module.js +87 -10
  4. package/app/modules/vgalert/js/vgalert.js +3 -3
  5. package/app/modules/vgdynamictable/index.js +5 -0
  6. package/app/modules/vgdynamictable/js/editable.js +438 -0
  7. package/app/modules/vgdynamictable/js/expandable.js +248 -0
  8. package/app/modules/vgdynamictable/js/filters.js +450 -0
  9. package/app/modules/vgdynamictable/js/fixed.js +566 -0
  10. package/app/modules/vgdynamictable/js/options.js +646 -0
  11. package/app/modules/vgdynamictable/js/pagination.js +623 -0
  12. package/app/modules/vgdynamictable/js/search.js +82 -0
  13. package/app/modules/vgdynamictable/js/skeleton.js +136 -0
  14. package/app/modules/vgdynamictable/js/sortable.js +442 -0
  15. package/app/modules/vgdynamictable/js/summary-footer.js +284 -0
  16. package/app/modules/vgdynamictable/js/table-remote.js +821 -0
  17. package/app/modules/vgdynamictable/js/table-state.js +243 -0
  18. package/app/modules/vgdynamictable/js/table-url-state.js +444 -0
  19. package/app/modules/vgdynamictable/js/utils/common.js +48 -0
  20. package/app/modules/vgdynamictable/js/vgdynamictable.js +3829 -0
  21. package/app/modules/vgdynamictable/js/viewport.js +322 -0
  22. package/app/modules/vgdynamictable/readme.md +251 -0
  23. package/app/modules/vgdynamictable/scss/_actions.scss +193 -0
  24. package/app/modules/vgdynamictable/scss/_pagination.scss +183 -0
  25. package/app/modules/vgdynamictable/scss/_skeleton.scss +60 -0
  26. package/app/modules/vgdynamictable/scss/_sortable.scss +63 -0
  27. package/app/modules/vgdynamictable/scss/_table.scss +157 -0
  28. package/app/modules/vgdynamictable/scss/_variables.scss +130 -0
  29. package/app/modules/vgdynamictable/scss/vgdynamictable.scss +267 -0
  30. package/app/modules/vgrangeslider/index.js +3 -0
  31. package/app/modules/vgrangeslider/js/skins.js +222 -0
  32. package/app/modules/vgrangeslider/js/vgrangeslider.js +704 -0
  33. package/app/modules/vgrangeslider/readme.md +523 -0
  34. package/app/modules/vgrangeslider/scss/_variables.scss +53 -0
  35. package/app/modules/vgrangeslider/scss/vgrangeslider.scss +240 -0
  36. package/app/utils/js/components/ajax.js +116 -7
  37. package/build/vgapp.css +2 -3246
  38. package/build/vgapp.css.map +1 -1
  39. package/build/vgapp.js +2 -30
  40. package/index.js +2 -0
  41. package/index.scss +6 -0
  42. package/package.json +1 -1
@@ -0,0 +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
+ }