@visns-studio/visns-components 5.3.7 → 5.3.8

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
@@ -54,8 +54,8 @@
54
54
  "swapy": "^1.0.5",
55
55
  "truncate": "^3.0.0",
56
56
  "uuid": "^10.0.0",
57
- "validator": "^13.12.0",
58
- "vite": "^5.4.14",
57
+ "validator": "^13.15.0",
58
+ "vite": "^5.4.15",
59
59
  "yarn": "^1.22.22"
60
60
  },
61
61
  "devDependencies": {
@@ -78,7 +78,7 @@
78
78
  "react-dom": "^17.0.0 || ^18.0.0"
79
79
  },
80
80
  "name": "@visns-studio/visns-components",
81
- "version": "5.3.7",
81
+ "version": "5.3.8",
82
82
  "description": "Various packages to assist in the development of our Custom Applications.",
83
83
  "main": "src/index.js",
84
84
  "files": [
@@ -242,6 +242,27 @@ const DataGrid = forwardRef(
242
242
  },
243
243
  }));
244
244
 
245
+ const getRowStyle = useCallback(
246
+ (rowProps) => {
247
+ const { data } = rowProps;
248
+
249
+ if (ajaxSetting?.rowColours?.length > 0) {
250
+ const colorConfig = ajaxSetting.rowColours.find(
251
+ (config) => data[config.id] === config.value
252
+ );
253
+
254
+ if (colorConfig) {
255
+ return {
256
+ backgroundColor: colorConfig.colour,
257
+ };
258
+ }
259
+ }
260
+
261
+ return null;
262
+ },
263
+ [ajaxSetting]
264
+ );
265
+
245
266
  const handleDownload = async (d) => {
246
267
  const toastId = toast.loading('Starting download please wait...');
247
268
 
@@ -2859,6 +2880,7 @@ const DataGrid = forwardRef(
2859
2880
  renderColumnContextMenu={renderColumnContextMenu}
2860
2881
  rowClassName="vs-datagrid--row"
2861
2882
  rowHeight={null}
2883
+ rowStyle={getRowStyle}
2862
2884
  selected={selected}
2863
2885
  showZebraRows={true}
2864
2886
  showActiveRowIndicator={false}