@tap-payments/auth-jsconnect 2.3.0 → 2.3.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.
- package/build/app/settings.d.ts +3 -1
- package/build/app/settings.js +10 -5
- package/build/assets/locales/ar.json +3 -1
- package/build/assets/locales/en.json +3 -1
- package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +5 -2
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +36 -19
- package/build/components/ArabicDatePicker/style.css +44 -5
- package/build/components/DatePicker/DatePicker.d.ts +2 -1
- package/build/components/DatePicker/DatePicker.js +12 -7
- package/build/constants/assets.d.ts +2 -0
- package/build/constants/assets.js +2 -0
- package/build/features/app/connect/connectStore.d.ts +13 -0
- package/build/features/app/connect/connectStore.js +114 -39
- package/build/features/app/connectExpress/connectExpressStore.js +1 -2
- package/build/features/app/entity/entityStore.js +1 -1
- package/build/features/brand/screens/BrandActivities/validation.d.ts +30 -30
- package/build/features/brand/screens/BrandActivities/validation.js +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/Activities/validation.d.ts +90 -90
- package/build/features/business/screens/Activities/validation.js +2 -2
- package/build/features/business/screens/IDBOD/DOB.js +2 -2
- package/build/features/connect/Connect.js +55 -4
- package/build/features/connect/screens/NID/DOB.js +3 -3
- package/build/features/connectExpress/ConnectExpress.js +2 -5
- package/build/features/connectExpress/screens/NID/DOB.js +2 -2
- package/build/features/connectExpress/screens/NIDMissed/DOB.js +2 -2
- package/build/features/entity/screens/EntityCapital/validation.d.ts +90 -90
- package/build/features/entity/screens/EntityCapital/validation.js +2 -2
- package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
- package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +2 -2
- package/build/features/shared/Calender/Calender.d.ts +13 -0
- package/build/features/shared/Calender/Calender.js +56 -0
- package/build/features/shared/Calender/index.d.ts +2 -0
- package/build/features/shared/Calender/index.js +2 -0
- package/package.json +1 -1
package/build/app/settings.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export interface SettingsData {
|
|
|
33
33
|
boardMaturity: boolean;
|
|
34
34
|
merchant?: MerchantInfo;
|
|
35
35
|
isMaturityExpress: boolean;
|
|
36
|
+
isHijri: boolean;
|
|
36
37
|
}
|
|
37
38
|
export interface SettingsState extends SharedState<SettingsData> {
|
|
38
39
|
}
|
|
@@ -43,6 +44,7 @@ export declare const settingsSlice: import("@reduxjs/toolkit").Slice<SettingsSta
|
|
|
43
44
|
handleSkin: (state: SettingsState, action: ActionState<ThemeMode>) => void;
|
|
44
45
|
handleLanguage: (state: SettingsState, action: ActionState<LanguageMode>) => void;
|
|
45
46
|
handlePublicKey: (state: SettingsState, action: ActionState<string>) => void;
|
|
47
|
+
handleSwitchCalender: (state: SettingsState, action: ActionState<boolean>) => void;
|
|
46
48
|
handleNextScreenStep: (state: SettingsState, action: ActionState<string | undefined>) => void;
|
|
47
49
|
handleCurrentActiveScreen: (state: SettingsState, action: ActionState<string>) => void;
|
|
48
50
|
handlePrevScreenStep: (state: SettingsState, action: ActionState<string | undefined>) => void;
|
|
@@ -50,7 +52,7 @@ export declare const settingsSlice: import("@reduxjs/toolkit").Slice<SettingsSta
|
|
|
50
52
|
handleSetAppConfig: (state: SettingsState, action: ActionState<LibConfig>) => void;
|
|
51
53
|
handleSetCountryByIso2: (state: SettingsState, action: ActionState<string>) => void;
|
|
52
54
|
}, "settings">;
|
|
53
|
-
export declare const handleSkin: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeMode, "settings/handleSkin">, handleLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<LanguageMode, "settings/handleLanguage">, handleActiveFlowScreens: import("@reduxjs/toolkit").ActionCreatorWithPayload<ScreenStepNavigation[], "settings/handleActiveFlowScreens">, handleNextScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "settings/handleNextScreenStep">, handlePrevScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "settings/handlePrevScreenStep">, handleCurrentActiveScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "settings/handleCurrentActiveScreen">, handleSetAppConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<LibConfig, "settings/handleSetAppConfig">, handleOpen: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "settings/handleOpen">, handleSetCountryByIso2: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "settings/handleSetCountryByIso2">, handleIsTapOrigin: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "settings/handleIsTapOrigin">, handelBoardMaturity: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "settings/handelBoardMaturity">, handlePublicKey: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "settings/handlePublicKey">;
|
|
55
|
+
export declare const handleSkin: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeMode, "settings/handleSkin">, handleLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<LanguageMode, "settings/handleLanguage">, handleActiveFlowScreens: import("@reduxjs/toolkit").ActionCreatorWithPayload<ScreenStepNavigation[], "settings/handleActiveFlowScreens">, handleNextScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "settings/handleNextScreenStep">, handlePrevScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "settings/handlePrevScreenStep">, handleCurrentActiveScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "settings/handleCurrentActiveScreen">, handleSetAppConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<LibConfig, "settings/handleSetAppConfig">, handleOpen: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "settings/handleOpen">, handleSetCountryByIso2: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "settings/handleSetCountryByIso2">, handleIsTapOrigin: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "settings/handleIsTapOrigin">, handelBoardMaturity: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "settings/handelBoardMaturity">, handlePublicKey: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "settings/handlePublicKey">, handleSwitchCalender: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "settings/handleSwitchCalender">;
|
|
54
56
|
declare const _default: import("redux").Reducer<SettingsState, import("redux").AnyAction>;
|
|
55
57
|
export default _default;
|
|
56
58
|
export declare const settingsSelector: (state: RootState) => SettingsState;
|
package/build/app/settings.js
CHANGED
|
@@ -47,13 +47,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
var _a;
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
|
-
import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString, dangerousMessage, isKW, isSA } from '../utils';
|
|
50
|
+
import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString, dangerousMessage, isKW, isSA, getParameterByName } from '../utils';
|
|
51
51
|
import { DefaultDeviceInfo, LOCAL_STORAGE_KEYS } from '../constants';
|
|
52
52
|
import i18n from '../i18n';
|
|
53
53
|
import { updateLocale } from '../utils/locale';
|
|
54
54
|
import API, { setAxiosGlobalHeaders } from '../api';
|
|
55
55
|
export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, domain, language_1, country, scope, public_key, maturity_1, board_maturity, deviceInfo, isValidOperator, countries, countryCode, isKWOrSA, businessCountry;
|
|
56
|
+
var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, lang, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, domain, language_1, country, scope, public_key, maturity_1, board_maturity, deviceInfo, isValidOperator, countries, countryCode, isKWOrSA, businessCountry;
|
|
57
57
|
return __generator(this, function (_f) {
|
|
58
58
|
switch (_f.label) {
|
|
59
59
|
case 0:
|
|
@@ -66,6 +66,7 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
66
66
|
_c = _f.sent(), visitorId = _c[0].visitorId, locale = _c[1];
|
|
67
67
|
configInfo = appConfig;
|
|
68
68
|
matureData = maturity;
|
|
69
|
+
lang = getParameterByName('lang');
|
|
69
70
|
setAxiosGlobalHeaders({
|
|
70
71
|
bi: visitorId || '',
|
|
71
72
|
mdn: encryptString(params.mdn || window.location.origin),
|
|
@@ -85,7 +86,7 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
85
86
|
if (typeof maturity_1 === 'boolean')
|
|
86
87
|
matureData = maturity_1 ? 'full' : 'express';
|
|
87
88
|
thunkApi.dispatch(handleSetAppConfig(configInfo));
|
|
88
|
-
thunkApi.dispatch(handleLanguage(config.language));
|
|
89
|
+
thunkApi.dispatch(handleLanguage(config.language || lang));
|
|
89
90
|
if (typeof board_maturity === 'boolean')
|
|
90
91
|
thunkApi.dispatch(handelBoardMaturity(board_maturity));
|
|
91
92
|
onVerifyConfigTokenSuccess === null || onVerifyConfigTokenSuccess === void 0 ? void 0 : onVerifyConfigTokenSuccess(config);
|
|
@@ -154,7 +155,8 @@ var initialState = {
|
|
|
154
155
|
appConfig: {},
|
|
155
156
|
businessCountry: {},
|
|
156
157
|
countries: [],
|
|
157
|
-
isValidOperator: false
|
|
158
|
+
isValidOperator: false,
|
|
159
|
+
isHijri: false
|
|
158
160
|
}
|
|
159
161
|
};
|
|
160
162
|
export var settingsSlice = createSlice({
|
|
@@ -189,6 +191,9 @@ export var settingsSlice = createSlice({
|
|
|
189
191
|
return;
|
|
190
192
|
state.data.appConfig.publicKey = action.payload;
|
|
191
193
|
},
|
|
194
|
+
handleSwitchCalender: function (state, action) {
|
|
195
|
+
state.data.isHijri = action.payload;
|
|
196
|
+
},
|
|
192
197
|
handleNextScreenStep: function (state, action) {
|
|
193
198
|
var next = state.data.activeScreen.next;
|
|
194
199
|
var appConfig = state.data.appConfig;
|
|
@@ -290,6 +295,6 @@ export var settingsSlice = createSlice({
|
|
|
290
295
|
});
|
|
291
296
|
}
|
|
292
297
|
});
|
|
293
|
-
export var handleSkin = (_a = settingsSlice.actions, _a.handleSkin), handleLanguage = _a.handleLanguage, handleActiveFlowScreens = _a.handleActiveFlowScreens, handleNextScreenStep = _a.handleNextScreenStep, handlePrevScreenStep = _a.handlePrevScreenStep, handleCurrentActiveScreen = _a.handleCurrentActiveScreen, handleSetAppConfig = _a.handleSetAppConfig, handleOpen = _a.handleOpen, handleSetCountryByIso2 = _a.handleSetCountryByIso2, handleIsTapOrigin = _a.handleIsTapOrigin, handelBoardMaturity = _a.handelBoardMaturity, handlePublicKey = _a.handlePublicKey;
|
|
298
|
+
export var handleSkin = (_a = settingsSlice.actions, _a.handleSkin), handleLanguage = _a.handleLanguage, handleActiveFlowScreens = _a.handleActiveFlowScreens, handleNextScreenStep = _a.handleNextScreenStep, handlePrevScreenStep = _a.handlePrevScreenStep, handleCurrentActiveScreen = _a.handleCurrentActiveScreen, handleSetAppConfig = _a.handleSetAppConfig, handleOpen = _a.handleOpen, handleSetCountryByIso2 = _a.handleSetCountryByIso2, handleIsTapOrigin = _a.handleIsTapOrigin, handelBoardMaturity = _a.handelBoardMaturity, handlePublicKey = _a.handlePublicKey, handleSwitchCalender = _a.handleSwitchCalender;
|
|
294
299
|
export default settingsSlice.reducer;
|
|
295
300
|
export var settingsSelector = function (state) { return state.settings; };
|
|
@@ -414,5 +414,7 @@
|
|
|
414
414
|
"segment_profit_title": "الربح",
|
|
415
415
|
"alert_choose_segment_location": "يُرجى تحديد الموقع",
|
|
416
416
|
"alert_choose_segment_profit": "يُرجى تحديد الربح",
|
|
417
|
-
"alert_choose_segment_tech": "الرجاء تحديد التقنية"
|
|
417
|
+
"alert_choose_segment_tech": "الرجاء تحديد التقنية",
|
|
418
|
+
"switch_to_islamic_calendar": "التبديل إلى التقويم الهجرى",
|
|
419
|
+
"switch_to_gregorian_calendar": "التبديل إلى التقويم الميلادي"
|
|
418
420
|
}
|
|
@@ -444,5 +444,7 @@
|
|
|
444
444
|
"segment_profit_title": "Segment Profit",
|
|
445
445
|
"alert_choose_segment_location": "Please select segment location",
|
|
446
446
|
"alert_choose_segment_profit": "Please select segment profit",
|
|
447
|
-
"alert_choose_segment_tech": "Please select segment tech"
|
|
447
|
+
"alert_choose_segment_tech": "Please select segment tech",
|
|
448
|
+
"switch_to_islamic_calendar": "Switch to Islamic Calendar",
|
|
449
|
+
"switch_to_gregorian_calendar": "Switch to Gregorian Calendar"
|
|
448
450
|
}
|
|
@@ -2,12 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import { CalendarProps } from 'react-multi-date-picker';
|
|
3
3
|
import './style.css';
|
|
4
4
|
export interface DatePickerProps extends CalendarProps {
|
|
5
|
+
open?: boolean;
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
readOnly?: boolean;
|
|
7
8
|
dir?: string;
|
|
8
9
|
onDateChange?: (date: string) => void;
|
|
9
|
-
onClick?: (
|
|
10
|
+
onClick?: () => void;
|
|
10
11
|
onDatePicked?: () => void;
|
|
12
|
+
isDob?: boolean;
|
|
13
|
+
isVerified?: boolean;
|
|
11
14
|
}
|
|
12
|
-
declare const _default: React.MemoExoticComponent<({ disabled, dir, readOnly, onDateChange, onClick, onDatePicked, value, ...rest }: DatePickerProps) => JSX.Element>;
|
|
15
|
+
declare const _default: React.MemoExoticComponent<({ open, disabled, dir, readOnly, onDateChange, onClick, onDatePicked, value, isDob, isVerified, ...rest }: DatePickerProps) => JSX.Element>;
|
|
13
16
|
export default _default;
|
|
@@ -25,23 +25,27 @@ import React, { memo } from 'react';
|
|
|
25
25
|
import { Calendar, toDateObject } from 'react-multi-date-picker';
|
|
26
26
|
import arabic from 'react-date-object/calendars/arabic';
|
|
27
27
|
import arabic_ar from 'react-date-object/locales/arabic_ar';
|
|
28
|
+
import arabic_en from 'react-date-object/locales/arabic_en';
|
|
28
29
|
import Box from '@mui/material/Box';
|
|
29
30
|
import { styled } from '@mui/material/styles';
|
|
30
31
|
import Divider from '@mui/material/Divider';
|
|
31
32
|
import Collapse from '../Collapse';
|
|
32
|
-
import
|
|
33
|
-
import
|
|
33
|
+
import Icon from '../Icon';
|
|
34
|
+
import { ICONS_NAMES } from '../../constants';
|
|
35
|
+
import { getEighteenYearsAgo } from '../../utils';
|
|
36
|
+
import { EndAdornmentExpanded } from '../../features/shared/EndAdornment';
|
|
34
37
|
import Input from '../Input';
|
|
35
38
|
import Text from '../Text';
|
|
36
39
|
import './style.css';
|
|
37
|
-
var ContainerIcon = styled(
|
|
38
|
-
var theme = _a.theme;
|
|
39
|
-
return (__assign(__assign({ marginInlineStart: theme.spacing(2.5) }, theme.typography.h6), { cursor: 'pointer', width: theme.spacing(2
|
|
40
|
+
var ContainerIcon = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
|
|
41
|
+
var theme = _a.theme, disabled = _a.disabled;
|
|
42
|
+
return (__assign(__assign({ marginInlineStart: theme.spacing(2.5) }, theme.typography.h6), { cursor: disabled ? 'auto' : 'pointer', width: theme.spacing(2), height: theme.spacing(2) }));
|
|
40
43
|
});
|
|
41
44
|
var Container = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
|
|
42
45
|
var theme = _a.theme, disabled = _a.disabled;
|
|
43
46
|
return ({
|
|
44
47
|
cursor: disabled ? 'auto' : 'pointer',
|
|
48
|
+
opacity: disabled ? '0.6' : '1',
|
|
45
49
|
fontFamily: theme.typography.fontFamily
|
|
46
50
|
});
|
|
47
51
|
});
|
|
@@ -51,7 +55,8 @@ var InputFieldStyled = styled(Input)(function (_a) {
|
|
|
51
55
|
cursor: disabled ? 'auto' : 'pointer',
|
|
52
56
|
'&::placeholder': __assign(__assign({ opacity: 1, color: theme.palette.text.primary, lineHeight: theme.spacing(2.125) }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight }),
|
|
53
57
|
'& .MuiInputBase-input': {
|
|
54
|
-
WebkitTextFillColor: 'inherit'
|
|
58
|
+
WebkitTextFillColor: 'inherit',
|
|
59
|
+
cursor: disabled ? 'auto' : 'pointer'
|
|
55
60
|
}
|
|
56
61
|
});
|
|
57
62
|
});
|
|
@@ -59,36 +64,48 @@ var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop
|
|
|
59
64
|
var theme = _a.theme, disabled = _a.disabled;
|
|
60
65
|
return ({
|
|
61
66
|
cursor: disabled ? 'auto' : 'pointer',
|
|
62
|
-
marginInlineEnd: theme.spacing(2.5)
|
|
67
|
+
marginInlineEnd: theme.spacing(2.5),
|
|
68
|
+
display: 'flex'
|
|
63
69
|
});
|
|
64
70
|
});
|
|
65
71
|
var DatePicker = function (_a) {
|
|
66
|
-
var disabled = _a.disabled, dir = _a.dir, readOnly = _a.readOnly, onDateChange = _a.onDateChange, onClick = _a.onClick, onDatePicked = _a.onDatePicked, value = _a.value, rest = __rest(_a, ["disabled", "dir", "readOnly", "onDateChange", "onClick", "onDatePicked", "value"]);
|
|
67
|
-
var
|
|
68
|
-
var
|
|
72
|
+
var _b = _a.open, open = _b === void 0 ? false : _b, disabled = _a.disabled, dir = _a.dir, readOnly = _a.readOnly, onDateChange = _a.onDateChange, onClick = _a.onClick, onDatePicked = _a.onDatePicked, value = _a.value, isDob = _a.isDob, isVerified = _a.isVerified, rest = __rest(_a, ["open", "disabled", "dir", "readOnly", "onDateChange", "onClick", "onDatePicked", "value", "isDob", "isVerified"]);
|
|
73
|
+
var _c = React.useState(), date = _c[0], setDate = _c[1];
|
|
74
|
+
var _d = React.useState(null), anchor = _d[0], setAnchor = _d[1];
|
|
75
|
+
var _e = React.useState(open), openCalender = _e[0], setOpenCalender = _e[1];
|
|
76
|
+
var calenderIcon = _jsx(ContainerIcon, { disabled: disabled, src: ICONS_NAMES.SWITCH_HIJRI_CALENDER });
|
|
69
77
|
var defaultMax = new Date();
|
|
70
78
|
var defaultMin = new Date('1900-01-01');
|
|
71
79
|
var DATE_FORMAT = 'YYYY-MM-DD';
|
|
80
|
+
React.useEffect(function () {
|
|
81
|
+
if (value)
|
|
82
|
+
setDate(value);
|
|
83
|
+
}, [value]);
|
|
72
84
|
var toggleCalender = function (event) {
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
setAnchor(null);
|
|
78
|
-
return;
|
|
85
|
+
if (anchor || openCalender) {
|
|
86
|
+
onDatePicked === null || onDatePicked === void 0 ? void 0 : onDatePicked();
|
|
87
|
+
setOpenCalender(false);
|
|
88
|
+
return setAnchor(null);
|
|
79
89
|
}
|
|
80
90
|
setAnchor(event.currentTarget);
|
|
81
|
-
|
|
91
|
+
setOpenCalender(true);
|
|
92
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
93
|
+
};
|
|
94
|
+
var getEndAdornment = function () {
|
|
95
|
+
if (disabled && !isVerified)
|
|
96
|
+
return '';
|
|
97
|
+
return _jsx(EndAdornmentExpanded, { isVerified: isVerified, anchorEl: anchor });
|
|
82
98
|
};
|
|
83
99
|
var handleOnDateChange = function (date) {
|
|
84
|
-
onDateChange
|
|
100
|
+
onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(date.toDate().toLocaleDateString('en-CA'));
|
|
85
101
|
setAnchor(null);
|
|
102
|
+
setOpenCalender(false);
|
|
86
103
|
onDatePicked === null || onDatePicked === void 0 ? void 0 : onDatePicked();
|
|
87
104
|
};
|
|
88
105
|
var formateDate = function (date) {
|
|
89
106
|
var dateObject = toDateObject(date);
|
|
90
107
|
return dateObject.convert(arabic).format(DATE_FORMAT);
|
|
91
108
|
};
|
|
92
|
-
return (_jsxs(Container, __assign({ disabled: disabled, id: 'container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children:
|
|
109
|
+
return (_jsxs(Container, __assign({ disabled: disabled, id: 'arabic-container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: getEndAdornment() })), value: date ? formateDate(date) : '', placeholder: DATE_FORMAT, onClick: toggleCalender, startAdornment: calenderIcon, disabled: !disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({ calendar: arabic, locale: dir === 'rtl' ? arabic_ar : arabic_en, maxDate: rest.maxDate || defaultMax, minDate: defaultMin, format: DATE_FORMAT, onChange: handleOnDateChange, value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), className: 'custom-container' }, rest)), _jsx(Divider, {})] }))] })));
|
|
93
110
|
};
|
|
94
111
|
export default memo(DatePicker);
|
|
@@ -7,18 +7,57 @@
|
|
|
7
7
|
.rmdp-day-picker > div {
|
|
8
8
|
width: 100%;
|
|
9
9
|
}
|
|
10
|
+
.rmdp-day {
|
|
11
|
+
color: #3a4154 !important;
|
|
12
|
+
}
|
|
10
13
|
|
|
11
14
|
.rmdp-calendar {
|
|
12
15
|
width: 100%;
|
|
13
16
|
}
|
|
14
|
-
/* .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover {
|
|
15
|
-
background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
|
|
16
|
-
color: black !important;
|
|
17
|
-
background-color: unset !important;
|
|
18
|
-
} */
|
|
19
17
|
|
|
20
18
|
.rmdp-day.rmdp-selected span:not(.highlight) {
|
|
21
19
|
/* background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%) !important; */
|
|
22
20
|
color: #ffffff !important;
|
|
23
21
|
background-color: black !important;
|
|
24
22
|
}
|
|
23
|
+
|
|
24
|
+
.rmdp-week-day {
|
|
25
|
+
color: #abaeb6 !important;
|
|
26
|
+
font-weight: 400 !important;
|
|
27
|
+
font-size: 0.75em !important;
|
|
28
|
+
text-transform: uppercase;
|
|
29
|
+
}
|
|
30
|
+
.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover {
|
|
31
|
+
background-color: #fafafa !important;
|
|
32
|
+
/* border-radius: 50%; */
|
|
33
|
+
color: #3a4154 !important;
|
|
34
|
+
/* background: radial-gradient(circle closest-side, #fafafa 0, #fafafa 98%, transparent 100%) !important; */
|
|
35
|
+
}
|
|
36
|
+
.rmdp-day.rmdp-selected span:not(.highlight):hover {
|
|
37
|
+
color: #ffffff !important;
|
|
38
|
+
background-color: black !important;
|
|
39
|
+
}
|
|
40
|
+
.rmdp-arrow-container:hover {
|
|
41
|
+
background-color: unset !important;
|
|
42
|
+
box-shadow: unset !important;
|
|
43
|
+
}
|
|
44
|
+
.rmdp-arrow {
|
|
45
|
+
border: solid #000 !important;
|
|
46
|
+
border-width: 0 1px 1px 0 !important;
|
|
47
|
+
}
|
|
48
|
+
.rmdp-day.rmdp-today span {
|
|
49
|
+
background-color: unset !important;
|
|
50
|
+
color: #000 !important;
|
|
51
|
+
}
|
|
52
|
+
.rmdp-header {
|
|
53
|
+
margin-bottom: 12px;
|
|
54
|
+
margin-top: 10px !important;
|
|
55
|
+
}
|
|
56
|
+
.rmdp-day-picker .rmdp-day {
|
|
57
|
+
height: 36px !important;
|
|
58
|
+
width: 36px !important;
|
|
59
|
+
}
|
|
60
|
+
.rmdp-day-picker .rmdp-day span {
|
|
61
|
+
height: 36px !important;
|
|
62
|
+
width: 36px !important;
|
|
63
|
+
}
|
|
@@ -3,6 +3,7 @@ import { CalendarProps } from 'react-calendar';
|
|
|
3
3
|
import 'react-calendar/dist/Calendar.css';
|
|
4
4
|
import './customStyle.css';
|
|
5
5
|
export interface DatePickerProps extends CalendarProps {
|
|
6
|
+
open?: boolean;
|
|
6
7
|
onDateChange?: (date: string) => void;
|
|
7
8
|
onClick?: () => void;
|
|
8
9
|
onDatePicked?: () => void;
|
|
@@ -12,5 +13,5 @@ export interface DatePickerProps extends CalendarProps {
|
|
|
12
13
|
isDob?: boolean;
|
|
13
14
|
isVerified?: boolean;
|
|
14
15
|
}
|
|
15
|
-
declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, isVerified, ...rest }: DatePickerProps) => JSX.Element>;
|
|
16
|
+
declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, isVerified, open, ...rest }: DatePickerProps) => JSX.Element>;
|
|
16
17
|
export default _default;
|
|
@@ -28,15 +28,16 @@ import Box from '@mui/material/Box';
|
|
|
28
28
|
import { styled } from '@mui/material/styles';
|
|
29
29
|
import Divider from '@mui/material/Divider';
|
|
30
30
|
import Collapse from '../Collapse';
|
|
31
|
-
import
|
|
31
|
+
import Icon from '../Icon';
|
|
32
|
+
import { ICONS_NAMES } from '../../constants';
|
|
32
33
|
import { convertToEnglishDateFormat, getEighteenYearsAgo, scrollDown, scrollUp } from '../../utils';
|
|
33
34
|
import { EndAdornmentExpanded } from '../../features/shared/EndAdornment';
|
|
34
35
|
import Input from '../Input';
|
|
35
36
|
import Text from '../Text';
|
|
36
37
|
import './customStyle.css';
|
|
37
|
-
var ContainerIcon = styled(
|
|
38
|
+
var ContainerIcon = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
|
|
38
39
|
var theme = _a.theme, disabled = _a.disabled;
|
|
39
|
-
return (__assign(__assign({ marginInlineStart: theme.spacing(2.5) }, theme.typography.h6), { cursor: disabled ? 'auto' : 'pointer', width: theme.spacing(2.
|
|
40
|
+
return (__assign(__assign({ marginInlineStart: theme.spacing(2.5) }, theme.typography.h6), { cursor: disabled ? 'auto' : 'pointer', width: theme.spacing(2.25), height: theme.spacing(2.25) }));
|
|
40
41
|
});
|
|
41
42
|
var Container = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
|
|
42
43
|
var theme = _a.theme, disabled = _a.disabled;
|
|
@@ -66,24 +67,27 @@ var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop
|
|
|
66
67
|
});
|
|
67
68
|
});
|
|
68
69
|
var DatePicker = function (_a) {
|
|
69
|
-
var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, isVerified = _a.isVerified, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob", "isVerified"]);
|
|
70
|
+
var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, isVerified = _a.isVerified, open = _a.open, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob", "isVerified", "open"]);
|
|
70
71
|
var _b = useState(), date = _b[0], setDate = _b[1];
|
|
71
72
|
var _c = React.useState(null), anchor = _c[0], setAnchor = _c[1];
|
|
73
|
+
var _d = React.useState(open), openCalender = _d[0], setOpenCalender = _d[1];
|
|
72
74
|
useEffect(function () {
|
|
73
75
|
if (defaultValue)
|
|
74
76
|
setDate(defaultValue);
|
|
75
77
|
}, [defaultValue]);
|
|
76
|
-
var calenderIcon = _jsx(ContainerIcon, { disabled: disabled });
|
|
78
|
+
var calenderIcon = _jsx(ContainerIcon, { disabled: disabled, src: ICONS_NAMES.SWITCH_CALENDER });
|
|
77
79
|
var defaultMax = new Date();
|
|
78
80
|
var defaultMin = new Date('1900-01-01');
|
|
79
81
|
var toggleCalender = function (event) {
|
|
80
82
|
var elementId = 'animation-flow-template-content';
|
|
81
|
-
if (anchor) {
|
|
83
|
+
if (anchor || openCalender) {
|
|
82
84
|
onDatePicked === null || onDatePicked === void 0 ? void 0 : onDatePicked();
|
|
83
85
|
setTimeout(function () { return scrollDown(elementId); }, 500);
|
|
86
|
+
setOpenCalender(false);
|
|
84
87
|
return setAnchor(null);
|
|
85
88
|
}
|
|
86
89
|
setAnchor(event.currentTarget);
|
|
90
|
+
setOpenCalender(true);
|
|
87
91
|
setTimeout(function () { return scrollUp(elementId); }, 550);
|
|
88
92
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
89
93
|
};
|
|
@@ -91,6 +95,7 @@ var DatePicker = function (_a) {
|
|
|
91
95
|
setDate(date);
|
|
92
96
|
onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(convertToEnglishDateFormat(date));
|
|
93
97
|
setAnchor(null);
|
|
98
|
+
setOpenCalender(false);
|
|
94
99
|
onDatePicked === null || onDatePicked === void 0 ? void 0 : onDatePicked();
|
|
95
100
|
};
|
|
96
101
|
var getEndAdornment = function () {
|
|
@@ -101,6 +106,6 @@ var DatePicker = function (_a) {
|
|
|
101
106
|
return (_jsxs(Container, __assign({ disabled: disabled, id: 'container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: getEndAdornment() })), value: date ? convertToEnglishDateFormat(date) : '', placeholder: 'YYYY-MM-DD', onClick: function (e) {
|
|
102
107
|
if (!disabled)
|
|
103
108
|
toggleCalender(e);
|
|
104
|
-
}, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in:
|
|
109
|
+
}, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: openCalender }, { children: [_jsx(Calendar, __assign({}, rest, { value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), calendarType: 'Hebrew', onChange: handleOnDateChange, locale: rest.locale, maxDate: rest.maxDate || defaultMax, minDate: rest.minDate || defaultMin })), _jsx(Divider, {})] }))] })));
|
|
105
110
|
};
|
|
106
111
|
export default memo(DatePicker);
|
|
@@ -72,6 +72,8 @@ export declare const ICONS_NAMES: {
|
|
|
72
72
|
CLOSE_ICON: string;
|
|
73
73
|
PACI_ICON: string;
|
|
74
74
|
SIGNED_UP_SUCCESS: string;
|
|
75
|
+
SWITCH_HIJRI_CALENDER: string;
|
|
76
|
+
SWITCH_CALENDER: string;
|
|
75
77
|
GMAIL_Filled_ICON: string;
|
|
76
78
|
GMAIL_White_ICON: string;
|
|
77
79
|
outlook_Filled_ICON: string;
|
|
@@ -72,6 +72,8 @@ export var ICONS_NAMES = {
|
|
|
72
72
|
CLOSE_ICON: 'https://dash.b-cdn.net/icons/menu/close-btn.svg',
|
|
73
73
|
PACI_ICON: 'https://dash.b-cdn.net/icons/menu/PACI-filled.svg',
|
|
74
74
|
SIGNED_UP_SUCCESS: 'https://dash.b-cdn.net/icons/menu/signed_up_success.svg',
|
|
75
|
+
SWITCH_HIJRI_CALENDER: 'https://dash.b-cdn.net/icons/menu/switch_hijri_calender.svg',
|
|
76
|
+
SWITCH_CALENDER: 'https://dash.b-cdn.net/icons/menu/calender_icon.svg',
|
|
75
77
|
GMAIL_Filled_ICON: 'https://dash.b-cdn.net/icons/menu/Gmail-filled.svg',
|
|
76
78
|
GMAIL_White_ICON: 'https://dash.b-cdn.net/icons/menu/Gmail-white.svg',
|
|
77
79
|
outlook_Filled_ICON: 'https://dash.b-cdn.net/icons/menu/Outlook-filled.svg',
|
|
@@ -109,6 +109,19 @@ export declare const updateLeadIndividual: import("@reduxjs/toolkit").AsyncThunk
|
|
|
109
109
|
fulfilledMeta?: unknown;
|
|
110
110
|
rejectedMeta?: unknown;
|
|
111
111
|
}>;
|
|
112
|
+
export declare const retrieveLead: import("@reduxjs/toolkit").AsyncThunk<{
|
|
113
|
+
data: any;
|
|
114
|
+
countryCode: CountryCode;
|
|
115
|
+
}, string, {
|
|
116
|
+
state?: unknown;
|
|
117
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
118
|
+
extra?: unknown;
|
|
119
|
+
rejectValue?: unknown;
|
|
120
|
+
serializedErrorType?: unknown;
|
|
121
|
+
pendingMeta?: unknown;
|
|
122
|
+
fulfilledMeta?: unknown;
|
|
123
|
+
rejectedMeta?: unknown;
|
|
124
|
+
}>;
|
|
112
125
|
export declare const retrieveSegmentDataList: import("@reduxjs/toolkit").AsyncThunk<{
|
|
113
126
|
segmentLocation: any;
|
|
114
127
|
segmentProfit: any;
|