@tap-payments/auth-jsconnect 2.8.73-development → 2.8.74-development

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.
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useController, useFormContext } from 'react-hook-form';
5
5
  import { KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH, LICENSE_NUMBER_MAX_LENGTH, LICENSE_NUMBER_MIN_LENGTH } from '../../../../constants';
6
- import { removeAllOtherThanCharsAndNumber, isSA } from '../../../../utils';
6
+ import { isSA, cleanFLandCRNumber } from '../../../../utils';
7
7
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
8
8
  import ClearIcon from '../../../shared/ClearIcon';
9
9
  import CheckIcon from '../../../shared/CheckIcon';
@@ -19,7 +19,7 @@ var LicenseNumber = function () {
19
19
  var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
20
20
  var handleFLNumberChange = function (_a) {
21
21
  var target = _a.target;
22
- var value = removeAllOtherThanCharsAndNumber(target.value);
22
+ var value = cleanFLandCRNumber(target.value);
23
23
  licenseNumberControl.field.onChange(value);
24
24
  };
25
25
  var clearLicenseNumber = function () {
@@ -14,7 +14,7 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { CR_MIN_LICENSE_LENGTH, CR_NUMBER_MAX_LENGTH, FL_MIN_LICENSE_LENGTH, FL_NUMBER_MAX_LENGTH, KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH } from '../../../../constants';
17
- import { removeAllOtherThanCharsAndNumber, isOtherLicense, isKW, isOtherThanKWOrSA } from '../../../../utils';
17
+ import { isOtherLicense, isKW, isOtherThanKWOrSA, cleanFLandCRNumber } from '../../../../utils';
18
18
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
19
19
  import ClearIcon from '../../../shared/ClearIcon';
20
20
  import CheckIcon from '../../../shared/CheckIcon';
@@ -38,7 +38,7 @@ var LicenseNumber = function (_a) {
38
38
  var readOnly = !isOtherLicense(selectedLicense) || (selectedEntityLicense && !isOtherLicense(selectedEntityLicense));
39
39
  var handleFLNumberChange = function (_a) {
40
40
  var target = _a.target;
41
- var value = removeAllOtherThanCharsAndNumber(target.value);
41
+ var value = cleanFLandCRNumber(target.value);
42
42
  licenseNumberControl.field.onChange(value);
43
43
  };
44
44
  var clearLicenseNumber = function () {
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useController, useFormContext } from 'react-hook-form';
5
5
  import { KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH, LICENSE_NUMBER_MAX_LENGTH, LICENSE_NUMBER_MIN_LENGTH } from '../../../../constants';
6
- import { removeAllOtherThanCharsNumberSlashAndHyphen, isSA } from '../../../../utils';
6
+ import { isSA, cleanFLandCRNumber } from '../../../../utils';
7
7
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
8
8
  import ClearIcon from '../../../shared/ClearIcon';
9
9
  import CheckIcon from '../../../shared/CheckIcon';
@@ -19,7 +19,7 @@ var LicenseNumber = function () {
19
19
  var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
20
20
  var handleFLNumberChange = function (_a) {
21
21
  var target = _a.target;
22
- var value = removeAllOtherThanCharsNumberSlashAndHyphen(target.value);
22
+ var value = cleanFLandCRNumber(target.value);
23
23
  licenseNumberControl.field.onChange(value);
24
24
  };
25
25
  var clearLicenseNumber = function () {
@@ -14,7 +14,7 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { CR_MIN_LICENSE_LENGTH, CR_NUMBER_MAX_LENGTH, FL_MIN_LICENSE_LENGTH, FL_NUMBER_MAX_LENGTH, KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH } from '../../../../constants';
17
- import { removeAllOtherThanCharsAndNumber, isKW, isOtherThanKWOrSA } from '../../../../utils';
17
+ import { isKW, isOtherThanKWOrSA, cleanFLandCRNumber } from '../../../../utils';
18
18
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
19
19
  import ClearIcon from '../../../shared/ClearIcon';
20
20
  import CheckIcon from '../../../shared/CheckIcon';
@@ -36,7 +36,7 @@ var LicenseNumber = function (_a) {
36
36
  var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
37
37
  var handleFLNumberChange = function (_a) {
38
38
  var target = _a.target;
39
- var value = removeAllOtherThanCharsAndNumber(target.value);
39
+ var value = cleanFLandCRNumber(target.value);
40
40
  licenseNumberControl.field.onChange(value);
41
41
  };
42
42
  var clearLicenseNumber = function () {
@@ -6,6 +6,7 @@ export declare const removeAllOtherThanAlphabetAndSpace: (str: string) => string
6
6
  export declare const removeAllNumberFromChars: (str: string) => string;
7
7
  export declare const keepEmailCharacters: (str: string) => string;
8
8
  export declare const removeAllOtherThanCharsAndNumber: (str: string) => string;
9
+ export declare const cleanFLandCRNumber: (str: string) => string;
9
10
  export declare const removeAllOtherThanCharsNumberSlashAndHyphen: (str: string) => string;
10
11
  export declare const removeAllOtherThanCharsNumbersAtAndDot: (str: string) => string;
11
12
  export declare const removeAllOtherThanCharsNumbersAndSpace: (str: string) => string;
@@ -22,6 +22,9 @@ export var keepEmailCharacters = function (str) {
22
22
  export var removeAllOtherThanCharsAndNumber = function (str) {
23
23
  return str.replace(/[^A-Za-z0-9]/g, '');
24
24
  };
25
+ export var cleanFLandCRNumber = function (str) {
26
+ return str.replace(/[^a-zA-Z0-9_-]/g, '');
27
+ };
25
28
  export var removeAllOtherThanCharsNumberSlashAndHyphen = function (str) {
26
29
  return str.replace(/[^A-Za-z0-9/-]/g, '');
27
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.73-development",
3
+ "version": "2.8.74-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",