@visns-studio/visns-components 2.2.0 → 2.2.1

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.
@@ -117,6 +117,12 @@ const DataGrid = forwardRef(
117
117
  const audioRef = useRef(null);
118
118
  const [audioSource, setAudioSource] = useState('');
119
119
 
120
+ useEffect(() => {
121
+ if (audioSource) {
122
+ audioRef.current.play();
123
+ }
124
+ }, [audioSource]);
125
+
120
126
  /** Modal States */
121
127
  const [formData, setFormData] = useState({});
122
128
  const [formType, setFormType] = useState('');
@@ -250,8 +256,17 @@ const DataGrid = forwardRef(
250
256
  }
251
257
  }, '');
252
258
 
253
- if (soundRelation && soundRelation[d[s.path]]) {
254
- setAudioSource(soundRelation[d[s.path]]);
259
+ if (soundRelation && soundRelation[s.key] && s.url) {
260
+ CustomFetch(
261
+ `${s.url}/${soundRelation[s.key]}`,
262
+ 'POST',
263
+ {},
264
+ (res) => {
265
+ if (res && res !== '') {
266
+ setAudioSource(res);
267
+ }
268
+ }
269
+ );
255
270
  }
256
271
  break;
257
272
  case 'update':
@@ -1808,11 +1823,9 @@ const DataGrid = forwardRef(
1808
1823
  }
1809
1824
  style={gridStyle}
1810
1825
  />
1811
- {audioSource && (
1812
- <audio src={audioSource} ref={audioRef} />
1813
- )}
1814
1826
  </>
1815
1827
  )}
1828
+ {audioSource && <audio src={audioSource} ref={audioRef} />}
1816
1829
  <Popup
1817
1830
  open={modalShow}
1818
1831
  onClose={modalClose}
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "akar-icons": "^1.9.28",
6
6
  "awesome-debounce-promise": "^2.1.0",
7
7
  "axios": "^1.4.0",
8
- "framer-motion": "^10.13.0",
8
+ "framer-motion": "^10.15.0",
9
9
  "html-react-parser": "^4.2.0",
10
10
  "lodash": "^4.17.21",
11
11
  "moment": "^2.29.4",
@@ -25,7 +25,7 @@
25
25
  "react-sortable-hoc": "^2.0.0",
26
26
  "react-toastify": "^9.1.3",
27
27
  "react-toggle": "^4.1.3",
28
- "react-tooltip": "^5.18.1",
28
+ "react-tooltip": "^5.19.0",
29
29
  "react-window": "^1.8.9",
30
30
  "reactjs-popup": "^2.0.5",
31
31
  "validator": "^13.9.0",
@@ -40,7 +40,7 @@
40
40
  "react-dom": "^17.0.1"
41
41
  },
42
42
  "name": "@visns-studio/visns-components",
43
- "version": "2.2.0",
43
+ "version": "2.2.1",
44
44
  "description": "Various packages to assist in the development of our Custom Applications.",
45
45
  "main": "index.js",
46
46
  "scripts": {