@visns-studio/visns-components 1.7.2 → 1.7.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.
package/.yarnrc.yml ADDED
@@ -0,0 +1,7 @@
1
+ nodeLinker: node-modules
2
+
3
+ plugins:
4
+ - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
5
+ spec: "@yarnpkg/plugin-interactive-tools"
6
+
7
+ yarnPath: .yarn/releases/yarn-3.6.1.cjs
@@ -155,7 +155,7 @@ const DataGrid = forwardRef(
155
155
  const sqlResult = loadData(params, dSearch, ajaxSetting);
156
156
 
157
157
  if (setFilterData && params.filterValue) {
158
- setFilterData([params.filterValue]);
158
+ setFilterData(params.filterValue);
159
159
  }
160
160
 
161
161
  sqlResult.then((res) => {
@@ -189,9 +189,23 @@ const DataGrid = forwardRef(
189
189
  },
190
190
  }));
191
191
 
192
- const handleFilterChange = (d) => {
192
+ const handleFilterChange = useCallback((d) => {
193
+ // d.forEach((filterValue) => {
194
+ // if (filterValue.reset && filterValue.reset.length > 0) {
195
+ // filterValue.reset.forEach((reset) => {
196
+ // const existingIndex = d.findIndex(
197
+ // (f) => f.key === reset
198
+ // );
199
+
200
+ // if (existingIndex !== -1) {
201
+ // d[existingIndex].value = "";
202
+ // }
203
+ // });
204
+ // }
205
+ // });
206
+
193
207
  setFilterValue(d);
194
- };
208
+ }, []);
195
209
 
196
210
  const handleChangeSearch = (e) => {
197
211
  const { value } = e.target;
@@ -510,7 +524,9 @@ const DataGrid = forwardRef(
510
524
  if (s.active) {
511
525
  if (
512
526
  d.hasOwnProperty(s.active.id) &&
513
- d[s.active.id] === s.active.value
527
+ d[s.active.id] === s.active.value &&
528
+ s.active.type !== "greater" &&
529
+ s.active.type !== "not null"
514
530
  ) {
515
531
  iconStyle = {
516
532
  color: s.active.colour,
@@ -529,6 +545,10 @@ const DataGrid = forwardRef(
529
545
  iconStyle = {
530
546
  color: s.active.colour,
531
547
  };
548
+ } else {
549
+ iconStyle = {
550
+ color: "",
551
+ };
532
552
  }
533
553
  }
534
554
 
@@ -1570,6 +1590,7 @@ const DataGrid = forwardRef(
1570
1590
  operator: column.filter.operator,
1571
1591
  type: column.filter.type,
1572
1592
  value: column.filter.value ? column.filter.value : "",
1593
+ reset: column.filter.reset ? column.filter.reset : [],
1573
1594
  };
1574
1595
  });
1575
1596
 
@@ -1593,13 +1614,11 @@ const DataGrid = forwardRef(
1593
1614
  : {},
1594
1615
  (res) => {
1595
1616
  let filterName;
1596
-
1597
1617
  if (Array.isArray(column.id)) {
1598
1618
  const concatenatedIds = column.id.reduce(
1599
1619
  (acc, id) => acc + `${id}.`,
1600
1620
  ""
1601
1621
  );
1602
-
1603
1622
  filterName = column.nameFrom
1604
1623
  ? concatenatedIds + column.nameFrom
1605
1624
  : concatenatedIds;
@@ -1608,11 +1627,9 @@ const DataGrid = forwardRef(
1608
1627
  ? column.id + column.nameFrom
1609
1628
  : column.id;
1610
1629
  }
1611
-
1612
1630
  const filterIndex = filterDataSource.findIndex(
1613
1631
  (filter) => filter.id === filterName
1614
1632
  );
1615
-
1616
1633
  if (filterIndex >= 0) {
1617
1634
  const updatedFilter = {
1618
1635
  ...filterDataSource[filterIndex],
@@ -1640,16 +1657,13 @@ const DataGrid = forwardRef(
1640
1657
  let filterName = Array.isArray(column.id)
1641
1658
  ? column.id.reduce((acc, id) => acc + `${id}.`, "")
1642
1659
  : column.id;
1643
-
1644
1660
  if (column.nameFrom) {
1645
1661
  filterName += column.nameFrom;
1646
1662
  }
1647
-
1648
1663
  const newFilter = {
1649
1664
  id: filterName,
1650
1665
  dataset: column.filter.options,
1651
1666
  };
1652
-
1653
1667
  setFilterDataSource((prevState) => [
1654
1668
  ...prevState,
1655
1669
  newFilter,
@@ -1734,7 +1748,9 @@ const DataGrid = forwardRef(
1734
1748
  "-"
1735
1749
  )}`}
1736
1750
  minRowHeight={40}
1737
- onFilterValueChange={setFilterValue}
1751
+ onFilterValueChange={(filterValue) => {
1752
+ handleFilterChange(filterValue);
1753
+ }}
1738
1754
  onLimitChange={setLimit}
1739
1755
  onRenderRow={onRenderRow}
1740
1756
  pagination
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "dependencies": {
3
- "@inovua/reactdatagrid-community": "^5.9.4",
3
+ "@inovua/reactdatagrid-community": "^5.10.1",
4
4
  "akar-icons": "^1.9.28",
5
5
  "awesome-debounce-promise": "^2.1.0",
6
6
  "axios": "^1.4.0",
7
- "framer-motion": "^10.12.16",
7
+ "framer-motion": "^10.12.18",
8
8
  "html-react-parser": "^4.0.0",
9
9
  "lodash": "^4.17.21",
10
10
  "moment": "^2.29.4",
11
11
  "numeral": "^2.0.6",
12
12
  "quill-image-uploader": "^1.3.0",
13
13
  "react-confirm-alert": "^3.0.6",
14
- "react-datepicker": "^4.14.0",
14
+ "react-datepicker": "^4.15.0",
15
15
  "react-dropzone": "^14.2.3",
16
16
  "react-number-format": "^5.2.2",
17
17
  "react-promise-tracker": "^2.1.1",
@@ -21,7 +21,7 @@
21
21
  "react-sortable-hoc": "^2.0.0",
22
22
  "react-toastify": "^9.1.3",
23
23
  "react-toggle": "^4.1.3",
24
- "react-tooltip": "^5.14.0",
24
+ "react-tooltip": "^5.18.0",
25
25
  "react-window": "^1.8.9",
26
26
  "reactjs-popup": "^2.0.5"
27
27
  },
@@ -34,10 +34,9 @@
34
34
  "react-dom": "^17.0.1"
35
35
  },
36
36
  "name": "@visns-studio/visns-components",
37
- "version": "1.7.2",
37
+ "version": "1.7.4",
38
38
  "description": "Various packages to assist in the development of our Custom Applications.",
39
39
  "main": "index.js",
40
- "devDependencies": {},
41
40
  "scripts": {
42
41
  "test": "echo \"Error: no test specified\" && exit 1"
43
42
  },
@@ -50,5 +49,6 @@
50
49
  "bugs": {
51
50
  "url": "https://github.com/visnsstudio/visns-components/issues"
52
51
  },
53
- "homepage": "https://github.com/visnsstudio/visns-components#readme"
52
+ "homepage": "https://github.com/visnsstudio/visns-components#readme",
53
+ "packageManager": "yarn@3.6.1"
54
54
  }