@digigov/ui 1.1.3 → 1.1.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/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log - @digigov/ui
2
2
 
3
- This log was last generated on Fri, 16 Feb 2024 10:23:15 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 16 Feb 2024 10:49:05 GMT and should not be manually modified.
4
+
5
+ ## 1.1.4
6
+ Fri, 16 Feb 2024 10:49:05 GMT
7
+
8
+ ### Patches
9
+
10
+ - Avoid handlers and validator running all the time when no data is parsed
4
11
 
5
12
  ## 1.1.3
6
13
  Fri, 16 Feb 2024 10:23:15 GMT
@@ -45,13 +45,13 @@ export var QrCodeScanner = function QrCodeScanner(_ref) {
45
45
  return onError(new Error('@digigov-ui XSS Validation failed: qr code payload should follow the pattern `https://dilosi.services.gov.gr/show/:reference_code`'), data);
46
46
  }
47
47
  }
48
+ // run a validator function provided by the application code
49
+ if (validate && !validate(data)) {
50
+ return onError(new Error('Custom QR Code payload validation failed'), data);
51
+ }
52
+ // proceed with application defined callback function
53
+ onScan(data);
48
54
  }
49
- // run a validator function provided by the application code
50
- if (validate && !validate(data)) {
51
- return onError(new Error('Custom QR Code payload validation failed'), data);
52
- }
53
- // proceed with application defined callback function
54
- onScan(data);
55
55
  };
56
56
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(QrReader, _extends({
57
57
  delay: 100,
@@ -57,13 +57,13 @@ var QrCodeScanner = exports.QrCodeScanner = function QrCodeScanner(_ref) {
57
57
  return onError(new Error('@digigov-ui XSS Validation failed: qr code payload should follow the pattern `https://dilosi.services.gov.gr/show/:reference_code`'), data);
58
58
  }
59
59
  }
60
+ // run a validator function provided by the application code
61
+ if (validate && !validate(data)) {
62
+ return onError(new Error('Custom QR Code payload validation failed'), data);
63
+ }
64
+ // proceed with application defined callback function
65
+ onScan(data);
60
66
  }
61
- // run a validator function provided by the application code
62
- if (validate && !validate(data)) {
63
- return onError(new Error('Custom QR Code payload validation failed'), data);
64
- }
65
- // proceed with application defined callback function
66
- onScan(data);
67
67
  };
68
68
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(QrReader, (0, _extends2["default"])({
69
69
  delay: 100,
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Digigov v1.1.3
1
+ /** @license Digigov v1.1.4
2
2
  *
3
3
  * This source code is licensed under the BSD-2-Clause license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digigov/ui",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "@digigov reusable components toolkit",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -68,13 +68,13 @@ In order to be safe, you can:
68
68
  );
69
69
  }
70
70
  }
71
+ // run a validator function provided by the application code
72
+ if (validate && !validate(data)) {
73
+ return onError(new Error('Custom QR Code payload validation failed'), data);
74
+ }
75
+ // proceed with application defined callback function
76
+ onScan(data);
71
77
  }
72
- // run a validator function provided by the application code
73
- if (validate && !validate(data)) {
74
- return onError(new Error('Custom QR Code payload validation failed'), data);
75
- }
76
- // proceed with application defined callback function
77
- onScan(data);
78
78
  }
79
79
  return (
80
80
  <>