@tap-payments/auth-jsconnect 2.1.89-test → 2.1.91-test

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.
@@ -15,6 +15,7 @@ import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
17
17
  import { FieldType } from '../../../../@types';
18
+ import { getFutureDate } from '../../../../utils';
18
19
  import { styled, alpha } from '@mui/material/styles';
19
20
  import Text from '../../../../components/Text';
20
21
  import Collapse from '../../../../components/Collapse';
@@ -44,6 +45,6 @@ var ExpiryDate = function (_a) {
44
45
  return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
45
46
  var spacing = _a.spacing;
46
47
  return spacing(2.5, 2.5, 2.5, 2.5);
47
- } } }, { children: t('enter_expiry_date') })), _jsx(DatePicker, { readOnly: true, disabled: disabled, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: disabled ? undefined : function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleBirthDateChange })] }) })));
48
+ } } }, { children: t('enter_expiry_date') })), _jsx(DatePicker, { readOnly: true, disabled: disabled, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', maxDate: getFutureDate(), onClick: disabled ? undefined : function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleBirthDateChange })] }) })));
48
49
  };
49
50
  export default React.memo(ExpiryDate);
@@ -90,9 +90,9 @@ export var findCountryByIddPrefix = function (countries, iddPrefix) {
90
90
  export var mapSalesChannel = function (salesChannel) {
91
91
  return salesChannel.map(function (item) {
92
92
  var hasSub = item.sub && item.sub.length > 0;
93
- return __assign(__assign(__assign({}, item), { address: (item.address || '').replaceAll('https://', '').replaceAll('@', '') }), (hasSub && {
93
+ return __assign(__assign(__assign({}, item), { address: (item.address || '').replaceAll('https://', '').replaceAll('www.', '').replaceAll('@', '') }), (hasSub && {
94
94
  sub: item.sub.map(function (subItem) {
95
- return __assign(__assign({}, subItem), { address: (subItem.address || '').replaceAll('https://', '').replaceAll('@', '') });
95
+ return __assign(__assign({}, subItem), { address: (subItem.address || '').replaceAll('https://', '').replaceAll('www.', '').replaceAll('@', '') });
96
96
  })
97
97
  }));
98
98
  });
@@ -1 +1,2 @@
1
1
  export declare const dateFormat: (date: Date, fmt?: string) => string;
2
+ export declare const getFutureDate: (years?: number) => Date;
@@ -3,3 +3,9 @@ export var dateFormat = function (date, fmt) {
3
3
  if (fmt === void 0) { fmt = 'YYYY-MM-DD'; }
4
4
  return moment(date).format(fmt);
5
5
  };
6
+ export var getFutureDate = function (years) {
7
+ var futureY = years || 20;
8
+ var maxDate = new Date();
9
+ maxDate.setFullYear(maxDate.getFullYear() + futureY);
10
+ return maxDate;
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.1.89-test",
3
+ "version": "2.1.91-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",