@visns-studio/visns-components 1.5.10 → 1.5.12

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.
@@ -150,7 +150,15 @@ const DataGrid = forwardRef(
150
150
  const [dataReload, setDataReload] = useState(0);
151
151
  const [dSearch, setDSearch] = useState("");
152
152
  const data = useCallback(
153
- (params) => loadData(params, dSearch, ajaxSetting),
153
+ (params) => {
154
+ const sqlResult = loadData(params, dSearch, ajaxSetting);
155
+
156
+ if (setFilterData && params.filterValue) {
157
+ setFilterData([params.filterValue]);
158
+ }
159
+
160
+ return sqlResult;
161
+ },
154
162
  [ajaxSetting, dataReload, dSearch]
155
163
  );
156
164
  const [filterDataSource, setFilterDataSource] = useState([]);
@@ -173,6 +181,10 @@ const DataGrid = forwardRef(
173
181
  },
174
182
  }));
175
183
 
184
+ const handleFilterChange = (d) => {
185
+ setFilterValue(d);
186
+ };
187
+
176
188
  const handleChangeSearch = (e) => {
177
189
  const { value } = e.target;
178
190
  setSearch(value);
@@ -1317,7 +1329,12 @@ const DataGrid = forwardRef(
1317
1329
  );
1318
1330
 
1319
1331
  result =
1320
- relationValue[column.relation.id];
1332
+ relationValue &&
1333
+ relationValue[column.relation.id]
1334
+ ? relationValue[
1335
+ column.relation.id
1336
+ ]
1337
+ : "";
1321
1338
  }
1322
1339
 
1323
1340
  return <span>{parse(result)}</span>;
@@ -1517,6 +1534,7 @@ const DataGrid = forwardRef(
1517
1534
 
1518
1535
  useEffect(() => {
1519
1536
  if (setFilterData) {
1537
+ console.info(filterValue);
1520
1538
  setFilterData(filterValue);
1521
1539
  }
1522
1540
  }, [filterValue]);
@@ -446,7 +446,7 @@ function Form(props) {
446
446
  });
447
447
  }
448
448
 
449
- if (fileUpload === true) {
449
+ if (fileUpload === true && formData[fileKey] !== null) {
450
450
  Vapor.store(formData[fileKey], {
451
451
  progress: (progress) => {
452
452
  setUploadProgress(progress * 100);
@@ -12,7 +12,7 @@ function Select(props) {
12
12
  value={inputValue}
13
13
  data-show={settings.show ? JSON.stringify(settings.show) : ""}
14
14
  >
15
- <option>Please select an option</option>
15
+ <option value="">Please select an option</option>
16
16
  {options.map((item, index) => (
17
17
  <option
18
18
  key={settings.id + "-" + item.id}
package/package.json CHANGED
@@ -35,7 +35,7 @@
35
35
  "react-dom": "^17.0.1"
36
36
  },
37
37
  "name": "@visns-studio/visns-components",
38
- "version": "1.5.10",
38
+ "version": "1.5.12",
39
39
  "description": "Various packages to assist in the development of our Custom Applications.",
40
40
  "main": "index.js",
41
41
  "devDependencies": {},