@visns-studio/visns-components 3.4.1 → 3.4.4

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.
@@ -2034,6 +2034,7 @@ const DataGrid = forwardRef(
2034
2034
  });
2035
2035
 
2036
2036
  setFilterValue(newFilterValue);
2037
+ setSelected([]);
2037
2038
  }, [columns, filterDataSource]);
2038
2039
 
2039
2040
  useEffect(() => {
@@ -2114,6 +2115,8 @@ const DataGrid = forwardRef(
2114
2115
  updateFilterDataSource(filterName, column.filter.options);
2115
2116
  }
2116
2117
  });
2118
+
2119
+ setSelected([]);
2117
2120
  }, [columns]);
2118
2121
 
2119
2122
  // Data Grid Styling
@@ -621,7 +621,31 @@ function Form({
621
621
  }
622
622
  }
623
623
 
624
- const res = await CustomFetch(url, method, formData);
624
+ const fieldMap = formSettings.fields.reduce((acc, field) => {
625
+ acc[field.id] = field;
626
+ return acc;
627
+ }, {});
628
+
629
+ let payload = { ...formData };
630
+
631
+ Object.keys(formData).forEach((key) => {
632
+ const value = formData[key];
633
+ const field = fieldMap[key];
634
+
635
+ // Check if the field exists and is of type 'multi-dropdown-ajax'
636
+ if (field && field.type === 'multi-dropdown-ajax') {
637
+ // Check if 'value' and 'label' exist
638
+ if (value && 'value' in value && 'label' in value) {
639
+ console.info(
640
+ `Updating payload for key ${key}:`,
641
+ value
642
+ );
643
+ payload[key] = value.value;
644
+ }
645
+ }
646
+ });
647
+
648
+ const res = await CustomFetch(url, method, payload);
625
649
 
626
650
  if (res.data.error === '') {
627
651
  if (fetchTable) {
@@ -41,6 +41,7 @@ function MultiSelect({
41
41
 
42
42
  return (
43
43
  <Select
44
+ closeMenuOnSelect={multi ? false : true}
44
45
  isClearable
45
46
  isSearchable
46
47
  isMulti={multi}
package/package.json CHANGED
@@ -49,7 +49,7 @@
49
49
  "react-dom": "^17.0.1"
50
50
  },
51
51
  "name": "@visns-studio/visns-components",
52
- "version": "3.4.1",
52
+ "version": "3.4.4",
53
53
  "description": "Various packages to assist in the development of our Custom Applications.",
54
54
  "main": "index.js",
55
55
  "scripts": {