@visns-studio/visns-components 5.15.22 → 5.15.24

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/package.json CHANGED
@@ -3,17 +3,17 @@
3
3
  "@dnd-kit/core": "^6.3.1",
4
4
  "@dnd-kit/sortable": "^10.0.0",
5
5
  "@dnd-kit/utilities": "^3.2.2",
6
- "@emotion/is-prop-valid": "^1.3.1",
7
- "@fontsource/barlow": "^5.2.6",
6
+ "@emotion/is-prop-valid": "^1.4.0",
7
+ "@fontsource/barlow": "^5.2.8",
8
8
  "@inovua/reactdatagrid-community": "^5.10.2",
9
9
  "@inovua/reactdatagrid-enterprise": "^5.10.2",
10
- "@mapbox/mapbox-gl-geocoder": "^5.1.1",
10
+ "@mapbox/mapbox-gl-geocoder": "^5.1.2",
11
11
  "@nivo/bar": "^0.99.0",
12
12
  "@nivo/core": "^0.99.0",
13
13
  "@nivo/line": "^0.99.0",
14
14
  "@nivo/pie": "^0.99.0",
15
15
  "@react-pdf/renderer": "^4.3.0",
16
- "@tanstack/react-query": "^5.85.5",
16
+ "@tanstack/react-query": "^5.89.0",
17
17
  "@tinymce/miniature": "^6.0.0",
18
18
  "@tinymce/tinymce-react": "^6.3.0",
19
19
  "@uiw/react-color": "^2.8.0",
@@ -24,18 +24,18 @@
24
24
  "array-move": "^4.0.0",
25
25
  "awesome-debounce-promise": "^2.1.0",
26
26
  "browser-image-compression": "^2.0.2",
27
- "dayjs": "^1.11.15",
27
+ "dayjs": "^1.11.18",
28
28
  "fabric": "^6.7.1",
29
29
  "file-saver": "^2.0.5",
30
- "framer-motion": "^12.23.12",
30
+ "framer-motion": "^12.23.14",
31
31
  "html-react-parser": "^5.2.6",
32
32
  "html2canvas": "^1.4.1",
33
33
  "lodash": "^4.17.21",
34
34
  "lodash.debounce": "^4.0.8",
35
- "lucide-react": "^0.542.0",
36
- "mapbox-gl": "^3.14.0",
35
+ "lucide-react": "^0.544.0",
36
+ "mapbox-gl": "^3.15.0",
37
37
  "moment": "^2.30.1",
38
- "motion": "^12.23.12",
38
+ "motion": "^12.23.14",
39
39
  "numeral": "^2.0.6",
40
40
  "pluralize": "^8.0.0",
41
41
  "qrcode.react": "^4.2.0",
@@ -64,18 +64,18 @@
64
64
  "reactjs-popup": "^2.0.6",
65
65
  "style-loader": "^4.0.0",
66
66
  "swapy": "^1.0.5",
67
- "sweetalert2": "^11.22.5",
67
+ "sweetalert2": "^11.23.0",
68
68
  "tesseract.js": "^6.0.1",
69
69
  "truncate": "^3.0.0",
70
70
  "uuid": "^11.1.0",
71
71
  "validator": "^13.15.15",
72
- "vite": "^6.3.5",
72
+ "vite": "^6.3.6",
73
73
  "xlsx": "^0.18.5",
74
74
  "yarn": "^1.22.22",
75
75
  "yet-another-react-lightbox": "^3.25.0"
76
76
  },
77
77
  "devDependencies": {
78
- "@babel/core": "^7.28.3",
78
+ "@babel/core": "^7.28.4",
79
79
  "@babel/plugin-transform-runtime": "^7.28.3",
80
80
  "@babel/preset-env": "^7.28.3",
81
81
  "@babel/preset-react": "^7.27.1",
@@ -86,7 +86,7 @@
86
86
  "mini-css-extract-plugin": "^2.9.4",
87
87
  "react": "^18.3.1",
88
88
  "react-dom": "^18.3.1",
89
- "sass": "^1.91.0",
89
+ "sass": "^1.92.1",
90
90
  "sass-loader": "^16.0.5"
91
91
  },
92
92
  "peerDependencies": {
@@ -94,7 +94,7 @@
94
94
  "react-dom": "^17.0.0 || ^18.0.0"
95
95
  },
96
96
  "name": "@visns-studio/visns-components",
97
- "version": "5.15.22",
97
+ "version": "5.15.24",
98
98
  "description": "Various packages to assist in the development of our Custom Applications.",
99
99
  "main": "src/index.js",
100
100
  "files": [
@@ -52,12 +52,15 @@ const generateCacheKey = (url, method, formData) => {
52
52
  };
53
53
 
54
54
  // Helper to determine if request should be cached
55
- const shouldCache = (method, url) => {
55
+ const shouldCache = (method, url, cacheOption = true) => {
56
56
  const normalizedMethod = method.toUpperCase();
57
-
57
+
58
+ // If caching is explicitly disabled via option, return false
59
+ if (cacheOption === false) return false;
60
+
58
61
  // Don't cache GET requests
59
62
  if (normalizedMethod === 'GET') return false;
60
-
63
+
61
64
  // Cache specific safe POST endpoints that return reference data
62
65
  const cacheableEndpoints = [
63
66
  '/dropdown', // Dropdown data (industries, facilities, etc.)
@@ -69,7 +72,7 @@ const shouldCache = (method, url) => {
69
72
  '/getWharfUsage',
70
73
  '/getFloatingWharfUsage',
71
74
  ];
72
-
75
+
73
76
  return cacheableEndpoints.some(endpoint => url.includes(endpoint));
74
77
  };
75
78
 
@@ -292,11 +295,14 @@ const CustomFetch = (
292
295
  method,
293
296
  formData,
294
297
  successCallback = null,
295
- errorCallback = null
298
+ errorCallback = null,
299
+ options = {}
296
300
  ) => {
297
301
  const queryClient = getQueryClient();
298
302
  const cacheKey = generateCacheKey(url, method, formData);
299
- const useCache = shouldCache(method, url);
303
+ // Default cache to true, allow override via options.cache
304
+ const cacheEnabled = options.cache !== undefined ? options.cache : true;
305
+ const useCache = shouldCache(method, url, cacheEnabled);
300
306
 
301
307
  if (useCache) {
302
308
  // Use TanStack Query for cacheable requests
@@ -645,10 +645,16 @@ function GenericDashboard({ setting, userProfile, dynamicDashboard = false }) {
645
645
  ...widgetFilters,
646
646
  };
647
647
 
648
+ // Check for cache option in widget.api (default: true)
649
+ const cacheOption = widget.api.cache !== undefined ? widget.api.cache : true;
650
+
648
651
  return CustomFetch(
649
652
  widget.api.url,
650
653
  widget.api.method,
651
- requestParams
654
+ requestParams,
655
+ null,
656
+ null,
657
+ { cache: cacheOption }
652
658
  );
653
659
  }
654
660
  return null;
@@ -1595,6 +1595,10 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
1595
1595
  optionKey
1596
1596
  ].label =
1597
1597
  e.target.value;
1598
+ newOptions[
1599
+ optionKey
1600
+ ].id =
1601
+ `${slugify(e.target.value)}-`;
1598
1602
  setDataField(
1599
1603
  (
1600
1604
  items
@@ -1732,6 +1736,10 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
1732
1736
  optionKey
1733
1737
  ].label =
1734
1738
  e.target.value;
1739
+ newOptions[
1740
+ optionKey
1741
+ ].id =
1742
+ `${slugify(e.target.value)}-`;
1735
1743
  setDataField(
1736
1744
  (
1737
1745
  items
@@ -2093,6 +2101,10 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
2093
2101
  rowKey
2094
2102
  ].label =
2095
2103
  e.target.value;
2104
+ newRows[
2105
+ rowKey
2106
+ ].id =
2107
+ `${slugify(e.target.value)}-`;
2096
2108
  setDataField(
2097
2109
  (
2098
2110
  items