@visns-studio/visns-components 2.3.9 → 2.3.11
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/components/cms/DataGrid.jsx +51 -40
- package/package.json +4 -4
|
@@ -133,6 +133,10 @@ const DataGrid = ({
|
|
|
133
133
|
setModalShow(false);
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
setFormData(form);
|
|
138
|
+
}, [form]);
|
|
139
|
+
|
|
136
140
|
/** Table States */
|
|
137
141
|
const [dataReload, setDataReload] = useState(0);
|
|
138
142
|
const [dSearch, setDSearch] = useState('');
|
|
@@ -263,51 +267,58 @@ const DataGrid = ({
|
|
|
263
267
|
setDataReload(randomNumber);
|
|
264
268
|
};
|
|
265
269
|
|
|
266
|
-
const onRowClick = useCallback(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
270
|
+
const onRowClick = useCallback(
|
|
271
|
+
(rowProps, event) => {
|
|
272
|
+
const cellElement = event.target.closest(
|
|
273
|
+
'.InovuaReactDataGrid__cell'
|
|
274
|
+
);
|
|
275
|
+
const columnIndex = Array.from(
|
|
276
|
+
cellElement.parentNode.children
|
|
277
|
+
).indexOf(cellElement);
|
|
278
|
+
|
|
279
|
+
let proceed = true;
|
|
280
|
+
|
|
281
|
+
columns.forEach((a, b) => {
|
|
282
|
+
if (
|
|
283
|
+
a.id === rowProps.columns[columnIndex].id &&
|
|
284
|
+
a.type === 'toggle'
|
|
285
|
+
) {
|
|
286
|
+
proceed = false;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
282
289
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
rowProps.data[rowProps.columns[columnIndex].link.key] +
|
|
292
|
-
'/' +
|
|
293
|
-
rowProps.columns[columnIndex].link.folder;
|
|
294
|
-
} else {
|
|
295
|
-
navigate(
|
|
296
|
-
`${rowProps.columns[columnIndex].link.url}${
|
|
290
|
+
if (proceed) {
|
|
291
|
+
if (
|
|
292
|
+
rowProps.columns[columnIndex].link &&
|
|
293
|
+
rowProps.columns[columnIndex].link.url
|
|
294
|
+
) {
|
|
295
|
+
if (rowProps.columns[columnIndex].link.folder) {
|
|
296
|
+
window.location.href =
|
|
297
|
+
rowProps.columns[columnIndex].link.url +
|
|
297
298
|
rowProps.data[
|
|
298
299
|
rowProps.columns[columnIndex].link.key
|
|
299
|
-
]
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
300
|
+
] +
|
|
301
|
+
'/' +
|
|
302
|
+
rowProps.columns[columnIndex].link.folder;
|
|
303
|
+
} else {
|
|
304
|
+
navigate(
|
|
305
|
+
`${rowProps.columns[columnIndex].link.url}${
|
|
306
|
+
rowProps.data[
|
|
307
|
+
rowProps.columns[columnIndex].link.key
|
|
308
|
+
]
|
|
309
|
+
}`,
|
|
310
|
+
{
|
|
311
|
+
state: {
|
|
312
|
+
form: form,
|
|
313
|
+
},
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
}
|
|
307
317
|
}
|
|
308
318
|
}
|
|
309
|
-
}
|
|
310
|
-
|
|
319
|
+
},
|
|
320
|
+
[form]
|
|
321
|
+
);
|
|
311
322
|
|
|
312
323
|
const onRenderRow = useCallback((rowProps) => {
|
|
313
324
|
// save the original handlers to be called later
|
package/package.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"array-move": "^4.0.0",
|
|
7
7
|
"awesome-debounce-promise": "^2.1.0",
|
|
8
8
|
"axios": "^1.4.0",
|
|
9
|
-
"framer-motion": "^10.15.
|
|
10
|
-
"html-react-parser": "^4.2.
|
|
9
|
+
"framer-motion": "^10.15.2",
|
|
10
|
+
"html-react-parser": "^4.2.1",
|
|
11
11
|
"lodash": "^4.17.21",
|
|
12
12
|
"moment": "^2.29.4",
|
|
13
13
|
"motion": "^10.16.2",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"react-confirm-alert": "^3.0.6",
|
|
18
18
|
"react-datepicker": "^4.16.0",
|
|
19
19
|
"react-dropzone": "^14.2.3",
|
|
20
|
-
"react-number-format": "^5.
|
|
20
|
+
"react-number-format": "^5.3.0",
|
|
21
21
|
"react-password-strength-bar": "^0.4.1",
|
|
22
22
|
"react-promise-tracker": "^2.1.1",
|
|
23
23
|
"react-quill": "^2.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"react-dom": "^17.0.1"
|
|
43
43
|
},
|
|
44
44
|
"name": "@visns-studio/visns-components",
|
|
45
|
-
"version": "2.3.
|
|
45
|
+
"version": "2.3.11",
|
|
46
46
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
47
47
|
"main": "index.js",
|
|
48
48
|
"scripts": {
|