@visns-studio/visns-components 5.7.13 → 5.7.14

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
@@ -82,7 +82,7 @@
82
82
  "react-dom": "^17.0.0 || ^18.0.0"
83
83
  },
84
84
  "name": "@visns-studio/visns-components",
85
- "version": "5.7.13",
85
+ "version": "5.7.14",
86
86
  "description": "Various packages to assist in the development of our Custom Applications.",
87
87
  "main": "src/index.js",
88
88
  "files": [
@@ -515,66 +515,27 @@ const DataGrid = forwardRef(
515
515
  (typeof param.selected === 'object' &&
516
516
  Object.keys(param.selected).length > 0)
517
517
  ) {
518
- // Show confirmation dialog for selection
519
- const selectedCount =
520
- param.selected === true ? param.data.length : 1;
521
- const itemText = selectedCount === 1 ? 'item' : 'items';
522
-
523
- confirmDialog({
524
- title: 'Selection Confirmation',
525
- message: `You have selected ${selectedCount} ${itemText}. Do you want to proceed with this selection?`,
526
- data:
527
- param.selected === true
528
- ? param.data
529
- : param.selected, // Pass the selected data
530
- buttons: [
531
- {
532
- label: 'Yes',
533
- onClick: () => {
534
- // Process the selection as before
535
- if (param.selected === true) {
536
- const s = {};
537
- param.data.forEach((obj) => {
538
- s[obj.id] = obj;
539
- });
540
- setSelected(s);
541
- } else if (
542
- typeof param.selected === 'object'
543
- ) {
544
- const selectedKey = Object.keys(
545
- param.selected
546
- )[0];
547
- const isSelectedAlready =
548
- selected.hasOwnProperty(
549
- selectedKey
550
- );
551
-
552
- if (isSelectedAlready) {
553
- setSelected({});
554
- } else {
555
- setSelected((prevSelected) => ({
556
- ...prevSelected,
557
- [selectedKey]:
558
- param.selected[selectedKey],
559
- }));
560
- }
561
- }
562
-
563
- // Show a success message
564
- toast.success(
565
- `Selection of ${selectedCount} ${itemText} confirmed`
566
- );
567
- },
568
- },
569
- {
570
- label: 'No',
571
- onClick: () => {
572
- // Clear selection if user cancels
573
- setSelected({});
574
- },
575
- },
576
- ],
577
- });
518
+ // Process the selection directly without confirmation
519
+ if (param.selected === true) {
520
+ const s = {};
521
+ param.data.forEach((obj) => {
522
+ s[obj.id] = obj;
523
+ });
524
+ setSelected(s);
525
+ } else if (typeof param.selected === 'object') {
526
+ const selectedKey = Object.keys(param.selected)[0];
527
+ const isSelectedAlready =
528
+ selected.hasOwnProperty(selectedKey);
529
+
530
+ if (isSelectedAlready) {
531
+ setSelected({});
532
+ } else {
533
+ setSelected((prevSelected) => ({
534
+ ...prevSelected,
535
+ [selectedKey]: param.selected[selectedKey],
536
+ }));
537
+ }
538
+ }
578
539
  } else {
579
540
  // Handle deselection directly without confirmation
580
541
  setSelected(param.selected);