@visns-studio/visns-components 4.10.44 → 4.10.45

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@emotion/is-prop-valid": "^1.3.1",
4
- "@fontsource/barlow": "^5.1.0",
4
+ "@fontsource/barlow": "^5.1.1",
5
5
  "@inovua/reactdatagrid-community": "^5.10.2",
6
6
  "@inovua/reactdatagrid-enterprise": "^5.10.2",
7
7
  "@nivo/bar": "^0.88.0",
@@ -14,45 +14,45 @@
14
14
  "akar-icons": "^1.9.31",
15
15
  "array-move": "^4.0.0",
16
16
  "awesome-debounce-promise": "^2.1.0",
17
- "axios": "^1.7.8",
17
+ "axios": "^1.7.9",
18
18
  "browser-image-compression": "^2.0.2",
19
19
  "dayjs": "^1.11.13",
20
- "fabric": "^6.5.1",
20
+ "fabric": "^6.5.4",
21
21
  "file-saver": "^2.0.5",
22
- "framer-motion": "^11.12.0",
23
- "html-react-parser": "^5.1.18",
22
+ "framer-motion": "^11.16.0",
23
+ "html-react-parser": "^5.2.2",
24
24
  "lodash": "^4.17.21",
25
25
  "lodash.debounce": "^4.0.8",
26
26
  "moment": "^2.30.1",
27
- "motion": "^11.12.0",
27
+ "motion": "^11.16.0",
28
28
  "numeral": "^2.0.6",
29
29
  "pluralize": "^8.0.0",
30
30
  "quill-image-uploader": "^1.3.0",
31
31
  "react-color": "^2.19.3",
32
32
  "react-confirm-alert": "^3.0.6",
33
33
  "react-copy-to-clipboard": "^5.1.0",
34
- "react-datepicker": "^7.5.0",
34
+ "react-datepicker": "^7.6.0",
35
35
  "react-dropzone": "^14.3.5",
36
36
  "react-grid-gallery": "^1.0.1",
37
- "react-number-format": "^5.4.2",
37
+ "react-number-format": "^5.4.3",
38
38
  "react-password-strength-bar": "^0.4.1",
39
39
  "react-promise-tracker": "^2.1.1",
40
40
  "react-quill": "^2.0.0",
41
41
  "react-reveal": "^1.2.2",
42
- "react-router-dom": "^6.27.0",
43
- "react-select": "^5.8.3",
44
- "react-signature-pad-wrapper": "^4.0.4",
42
+ "react-router-dom": "^6.28.1",
43
+ "react-select": "^5.9.0",
44
+ "react-signature-pad-wrapper": "^4.1.0",
45
45
  "react-slugify": "^4.0.1",
46
46
  "react-sortable-hoc": "^2.0.0",
47
- "react-to-print": "^3.0.2",
47
+ "react-to-print": "^3.0.4",
48
48
  "react-toastify": "^10.0.6",
49
49
  "react-toggle": "^4.1.3",
50
50
  "react-tooltip": "^5.28.0",
51
- "react-window": "^1.8.10",
51
+ "react-window": "^1.8.11",
52
52
  "reactjs-popup": "^2.0.6",
53
53
  "style-loader": "^4.0.0",
54
54
  "truncate": "^3.0.0",
55
- "uuid": "^11.0.3",
55
+ "uuid": "^11.0.4",
56
56
  "validator": "^13.12.0",
57
57
  "vite": "^5.4.11",
58
58
  "yarn": "^1.22.22"
@@ -61,7 +61,7 @@
61
61
  "@babel/core": "^7.26.0",
62
62
  "@babel/plugin-transform-runtime": "^7.25.9",
63
63
  "@babel/preset-env": "^7.26.0",
64
- "@babel/preset-react": "^7.25.9",
64
+ "@babel/preset-react": "^7.26.3",
65
65
  "babel-loader": "^9.2.1",
66
66
  "copy-webpack-plugin": "^12.0.2",
67
67
  "css-loader": "^7.1.2",
@@ -69,15 +69,15 @@
69
69
  "mini-css-extract-plugin": "^2.9.2",
70
70
  "react": "^18.3.1",
71
71
  "react-dom": "^18.3.1",
72
- "sass": "^1.81.0",
73
- "sass-loader": "^16.0.3"
72
+ "sass": "^1.83.1",
73
+ "sass-loader": "^16.0.4"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "react": "^17.0.0 || ^18.0.0",
77
77
  "react-dom": "^17.0.0 || ^18.0.0"
78
78
  },
79
79
  "name": "@visns-studio/visns-components",
80
- "version": "4.10.44",
80
+ "version": "4.10.45",
81
81
  "description": "Various packages to assist in the development of our Custom Applications.",
82
82
  "main": "src/index.js",
83
83
  "files": [
@@ -1,11 +1,12 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
- import ReactToPrint from 'react-to-print';
2
+ import { useReactToPrint } from 'react-to-print';
3
3
 
4
4
  import CustomFetch from './Fetch';
5
5
  import styles from './styles/QrCode.module.scss';
6
6
 
7
7
  const QrCode = ({ config, dataId }) => {
8
- const printComponentRef = useRef();
8
+ const contentRef = useRef(null);
9
+ const reactToPrintFn = useReactToPrint({ contentRef });
9
10
  const [qrCodeData, setQrCodeData] = useState({
10
11
  logo: '',
11
12
  qrCode: '',
@@ -26,9 +27,13 @@ const QrCode = ({ config, dataId }) => {
26
27
  fetchQrCode(config);
27
28
  }, []);
28
29
 
30
+ useEffect(() => {
31
+ console.info(qrCodeData);
32
+ }, [qrCodeData]);
33
+
29
34
  return (
30
35
  <>
31
- <div className={styles.gridtxt} ref={printComponentRef}>
36
+ <div className={styles.gridtxt} ref={contentRef}>
32
37
  {qrCodeData.logo && qrCodeData.logo !== '' && (
33
38
  <ul className={styles.customer__overview}>
34
39
  <li
@@ -52,7 +57,7 @@ const QrCode = ({ config, dataId }) => {
52
57
  textAlign: 'center',
53
58
  }}
54
59
  >
55
- {qrCodeData.title}
60
+ {qrCodeData.title || ''}
56
61
  </li>
57
62
  </ul>
58
63
  <ul className={styles.customer__overview}>
@@ -71,10 +76,9 @@ const QrCode = ({ config, dataId }) => {
71
76
  </ul>
72
77
  </div>
73
78
  <div className={styles.polActions}>
74
- <ReactToPrint
75
- trigger={() => <button className="btn">Print</button>}
76
- content={() => printComponentRef.current}
77
- />
79
+ <button className={styles.btn} onClick={() => reactToPrintFn()}>
80
+ Print
81
+ </button>
78
82
  </div>
79
83
  </>
80
84
  );
@@ -85,3 +85,21 @@
85
85
  margin: 0 0.15em;
86
86
  }
87
87
  }
88
+
89
+ .btn {
90
+ width: max-content;
91
+ display: inline-block;
92
+ position: relative;
93
+ padding: 0.65rem 1rem;
94
+ cursor: pointer;
95
+ font-size: 1rem;
96
+ color: var(--tertiary-color);
97
+ text-decoration: none;
98
+ overflow: hidden;
99
+ background: var(--primary-color);
100
+ border: 1px solid rgba(var(--primary-color--rgb), 1.1);
101
+ border-radius: var(--br);
102
+ outline: none;
103
+ transition: all 0.2s cubic-bezier(0.85, 0, 0.15, 1) 0s;
104
+ font-size: 1.25em;
105
+ }