@tap-payments/os-micro-frontend-shared 0.1.261-test.3 → 0.1.261-test.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/build/components/Error/Error.d.ts +1 -1
- package/build/components/Inputs/CountriesDropDown/CountriesDropdown.d.ts +4 -5
- package/build/components/Inputs/CountriesDropDown/CountriesDropdown.js +3 -3
- package/build/components/TableHeader/FiltersRow.d.ts +1 -1
- package/build/components/TableHeader/FiltersRow.js +19 -4
- package/build/components/TableHeader/FiltersRowWrapper.d.ts +5 -0
- package/build/components/TableHeader/FiltersRowWrapper.js +18 -0
- package/build/components/TableHeader/TableHeader.d.ts +5 -4
- package/build/components/TableHeader/TableHeader.js +21 -6
- package/build/components/TableHeader/TableHeaderWrapper.d.ts +5 -0
- package/build/components/TableHeader/TableHeaderWrapper.js +18 -0
- package/build/components/TableHeader/TableView/ColumnItem.d.ts +14 -0
- package/build/components/TableHeader/TableView/ColumnItem.js +29 -0
- package/build/components/TableHeader/TableView/CustomViews.d.ts +5 -0
- package/build/components/TableHeader/TableView/CustomViews.js +21 -0
- package/build/components/TableHeader/TableView/DefaultViews.d.ts +13 -0
- package/build/components/TableHeader/TableView/DefaultViews.js +22 -0
- package/build/components/TableHeader/TableView/TableView.d.ts +12 -0
- package/build/components/TableHeader/TableView/TableView.js +55 -0
- package/build/components/TableHeader/TableView/hooks/index.d.ts +3 -0
- package/build/components/TableHeader/TableView/hooks/index.js +3 -0
- package/build/components/TableHeader/TableView/hooks/useColumnItem.d.ts +21 -0
- package/build/components/TableHeader/TableView/hooks/useColumnItem.js +29 -0
- package/build/components/TableHeader/TableView/hooks/useSubMenu.d.ts +10 -0
- package/build/components/TableHeader/TableView/hooks/useSubMenu.js +31 -0
- package/build/components/TableHeader/TableView/hooks/useViewColumns.d.ts +13 -0
- package/build/components/TableHeader/TableView/hooks/useViewColumns.js +45 -0
- package/build/components/TableHeader/TableView/index.d.ts +3 -0
- package/build/components/TableHeader/TableView/index.js +3 -0
- package/build/components/TableHeader/TableView/style.d.ts +24 -0
- package/build/components/TableHeader/TableView/style.js +102 -0
- package/build/components/TableHeader/TableView/type.d.ts +10 -0
- package/build/components/TableHeader/TableView/type.js +1 -0
- package/build/components/TableHeader/data.d.ts +5 -0
- package/build/components/TableHeader/data.js +7 -0
- package/build/components/TableHeader/index.d.ts +6 -2
- package/build/components/TableHeader/index.js +6 -2
- package/build/components/TableHeader/style.d.ts +1 -1
- package/build/components/TableHeader/style.js +1 -1
- package/build/components/TableHeader/type.d.ts +19 -10
- package/build/components/TableHeader/type.js +0 -7
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/types/tsUtils.d.ts +1 -0
- package/package.json +18 -19
- package/build/components/Customer/CustomerDropdown/CustomerDropdown.d.ts +0 -8
- package/build/components/Customer/CustomerDropdown/CustomerDropdown.js +0 -39
- package/build/components/Customer/CustomerDropdown/index.d.ts +0 -1
- package/build/components/Customer/CustomerDropdown/index.js +0 -1
- package/build/components/Customer/CustomerDropdown/style.d.ts +0 -10
- package/build/components/Customer/CustomerDropdown/style.js +0 -30
- package/build/components/Customer/CustomerForms/EmailForm.d.ts +0 -12
- package/build/components/Customer/CustomerForms/EmailForm.js +0 -76
- package/build/components/Customer/CustomerForms/FullInfo.d.ts +0 -13
- package/build/components/Customer/CustomerForms/FullInfo.js +0 -72
- package/build/components/Customer/CustomerForms/FullInfoForm.d.ts +0 -12
- package/build/components/Customer/CustomerForms/FullInfoForm.js +0 -74
- package/build/components/Customer/CustomerForms/PhoneNumberForm.d.ts +0 -12
- package/build/components/Customer/CustomerForms/PhoneNumberForm.js +0 -71
- package/build/components/Customer/CustomerForms/index.d.ts +0 -9
- package/build/components/Customer/CustomerForms/index.js +0 -9
- package/build/components/Customer/CustomerForms/style.d.ts +0 -25
- package/build/components/Customer/CustomerForms/style.js +0 -71
- package/build/components/Customer/CustomerForms/validation.d.ts +0 -30
- package/build/components/Customer/CustomerForms/validation.js +0 -42
- package/build/components/Customer/index.d.ts +0 -1
- package/build/components/Customer/index.js +0 -1
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { memo, useEffect, useRef } from 'react';
|
|
14
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
15
|
-
import Box from '@mui/material/Box';
|
|
16
|
-
import { Controller, useForm } from 'react-hook-form';
|
|
17
|
-
import { useTranslation } from 'react-i18next';
|
|
18
|
-
import { InputNumberStyled, MobileWrapper } from '../../index.js';
|
|
19
|
-
import { FormWrapper, SubmitButton, InputStyled, ErrorStyled } from './style';
|
|
20
|
-
import { validationFullInfoSchema } from './validation';
|
|
21
|
-
import CountriesDropdown from '../../Inputs/CountriesDropDown';
|
|
22
|
-
function FullInfoForm({ submitButtonText, onSubmit, customer, country, items, isItemsNotValid, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }) {
|
|
23
|
-
const firstNameRef = useRef();
|
|
24
|
-
const lastNameRef = useRef();
|
|
25
|
-
const emailRef = useRef();
|
|
26
|
-
const phoneNumberRef = useRef();
|
|
27
|
-
const { t } = useTranslation();
|
|
28
|
-
const { control, watch, trigger, formState: { isValid, errors }, } = useForm({
|
|
29
|
-
mode: 'onChange',
|
|
30
|
-
resolver: yupResolver(validationFullInfoSchema(country.max_digits)),
|
|
31
|
-
defaultValues: {
|
|
32
|
-
firstName: customer.firstName,
|
|
33
|
-
email: customer.email,
|
|
34
|
-
lastName: customer.lastName,
|
|
35
|
-
phoneNumber: customer.phoneNumber,
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
watch(({ firstName = '', lastName = '', email = '', phoneNumber = '' }) => {
|
|
40
|
-
onCustomerChange({
|
|
41
|
-
email,
|
|
42
|
-
firstName,
|
|
43
|
-
lastName,
|
|
44
|
-
phoneNumber,
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
}, [watch, errors, customer]);
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
// revalidate default values
|
|
50
|
-
if (customer.firstName && customer.lastName && (customer.email || customer.phoneNumber)) {
|
|
51
|
-
trigger();
|
|
52
|
-
}
|
|
53
|
-
}, []);
|
|
54
|
-
return (_jsxs(FormWrapper, Object.assign({ onMouseLeave: (e) => {
|
|
55
|
-
e.stopPropagation();
|
|
56
|
-
} }, { children: [_jsx(Controller, { control: control, name: "firstName", render: (_a) => {
|
|
57
|
-
var _b = _a.field, { ref } = _b, field = __rest(_b, ["ref"]), { fieldState: { error } } = _a;
|
|
58
|
-
return (_jsxs(Box, Object.assign({ ref: firstNameRef }, { children: [_jsx(InputStyled, Object.assign({}, field, { placeholder: t('firstName'), inputProps: { autoComplete: 'off' }, error: Boolean(error === null || error === void 0 ? void 0 : error.message) })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message) })] })));
|
|
59
|
-
} }, "fullInfoFormFirstName"), _jsx(Controller, { control: control, name: "lastName", render: (_a) => {
|
|
60
|
-
var _b = _a.field, { ref } = _b, field = __rest(_b, ["ref"]), { fieldState: { error } } = _a;
|
|
61
|
-
return (_jsxs(Box, Object.assign({ ref: lastNameRef }, { children: [_jsx(InputStyled, Object.assign({}, field, { placeholder: t('lastName'), inputProps: { autoComplete: 'off' }, error: Boolean(error === null || error === void 0 ? void 0 : error.message) })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message) })] })));
|
|
62
|
-
} }, "fullInfoFormLastName"), _jsx(Controller, { control: control, name: "email", render: (_a) => {
|
|
63
|
-
var _b = _a.field, { ref } = _b, field = __rest(_b, ["ref"]), { fieldState: { error } } = _a;
|
|
64
|
-
return (_jsxs(Box, Object.assign({ ref: emailRef }, { children: [_jsx(InputStyled, Object.assign({}, field, { placeholder: t('email'), inputProps: { autoComplete: 'off' }, error: Boolean(error === null || error === void 0 ? void 0 : error.message) })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message) })] })));
|
|
65
|
-
} }, "fullInfoFormEmail"), _jsx(Controller, { control: control, name: "phoneNumber", render: (_a) => {
|
|
66
|
-
var _b, _c;
|
|
67
|
-
var _d = _a.field, { ref } = _d, field = __rest(_d, ["ref"]), { fieldState: { error } } = _a;
|
|
68
|
-
return (_jsxs(Box, Object.assign({ ref: phoneNumberRef }, { children: [_jsxs(MobileWrapper, Object.assign({ sx: Object.assign({}, ((error === null || error === void 0 ? void 0 : error.message) && { borderBottom: 'none' })) }, { children: [_jsx(CountriesDropdown, { defaultCountry: (_c = (_b = country === null || country === void 0 ? void 0 : country.iso2) !== null && _b !== void 0 ? _b : defaultCountry === null || defaultCountry === void 0 ? void 0 : defaultCountry.code) !== null && _c !== void 0 ? _c : 'SA', value: country, onChangeCountry: onCountryChange, countries: countries, isLoading: isCountriesLoading }), _jsx(InputNumberStyled, Object.assign({}, field, { placeholder: t('mobile'), inputProps: { autoComplete: 'off' }, error: Boolean(error === null || error === void 0 ? void 0 : error.message), sx: {
|
|
69
|
-
border: 'none',
|
|
70
|
-
paddingInlineEnd: 0,
|
|
71
|
-
}, hideArrows: true }))] })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message, { numberLen: country.max_digits }) })] })));
|
|
72
|
-
} }), _jsx(SubmitButton, Object.assign({ onClick: onSubmit, disabled: !isValid || isItemsNotValid || !items.length }, { children: submitButtonText }))] })));
|
|
73
|
-
}
|
|
74
|
-
export default memo(FullInfoForm);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Item } from '../../../types/index.js';
|
|
3
|
-
import { FullInfoProps } from './FullInfo';
|
|
4
|
-
export interface PhoneNumberFormProps extends Pick<FullInfoProps, 'customer' | 'country' | 'onCountryChange' | 'onCustomerChange' | 'defaultCountry' | 'countries' | 'isCountriesLoading'> {
|
|
5
|
-
isItemsNotValid: boolean;
|
|
6
|
-
items: Item[];
|
|
7
|
-
submitButtonText: string;
|
|
8
|
-
onSubmit: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare function PhoneNumberForm({ submitButtonText, onSubmit, customer, country, isItemsNotValid, items, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }: Readonly<PhoneNumberFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare const _default: import("react").MemoExoticComponent<typeof PhoneNumberForm>;
|
|
12
|
-
export default _default;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { memo, useEffect, useRef } from 'react';
|
|
14
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
15
|
-
import Box from '@mui/material/Box';
|
|
16
|
-
import { Controller, useForm } from 'react-hook-form';
|
|
17
|
-
import { useTranslation } from 'react-i18next';
|
|
18
|
-
import { CountriesDropdown, InputNumberStyled, MobileWrapper } from '../../index.js';
|
|
19
|
-
import { FormWrapper, SubmitButton, InputStyled, ErrorStyled } from './style';
|
|
20
|
-
import { validationPhoneNumberSchema } from './validation';
|
|
21
|
-
function PhoneNumberForm({ submitButtonText, onSubmit, customer, country, isItemsNotValid, items, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }) {
|
|
22
|
-
const firstNameRef = useRef();
|
|
23
|
-
const lastNameRef = useRef();
|
|
24
|
-
const phoneNumberRef = useRef();
|
|
25
|
-
const { t } = useTranslation();
|
|
26
|
-
const { control, formState: { isValid, errors }, watch, trigger, } = useForm({
|
|
27
|
-
mode: 'onChange',
|
|
28
|
-
resolver: yupResolver(validationPhoneNumberSchema(country.max_digits)),
|
|
29
|
-
defaultValues: {
|
|
30
|
-
firstName: customer.firstName,
|
|
31
|
-
phoneNumber: customer.phoneNumber,
|
|
32
|
-
lastName: customer.lastName,
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
// revalidate default values
|
|
37
|
-
if (customer.firstName && customer.phoneNumber && customer.lastName) {
|
|
38
|
-
trigger();
|
|
39
|
-
}
|
|
40
|
-
}, []);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
watch(({ firstName = '', lastName = '', phoneNumber = '' }) => {
|
|
43
|
-
onCustomerChange(Object.assign(Object.assign({}, customer), { firstName,
|
|
44
|
-
lastName,
|
|
45
|
-
phoneNumber }));
|
|
46
|
-
});
|
|
47
|
-
}, [watch, errors, customer]);
|
|
48
|
-
const onMouseLeave = (e) => {
|
|
49
|
-
e.stopPropagation();
|
|
50
|
-
};
|
|
51
|
-
return (_jsxs(FormWrapper, Object.assign({ onMouseLeave: onMouseLeave }, { children: [_jsx(Controller, { control: control, name: "phoneNumber", render: (_a) => {
|
|
52
|
-
var _b, _c;
|
|
53
|
-
var _d = _a.field, { ref } = _d, field = __rest(_d, ["ref"]), { fieldState: { error } } = _a;
|
|
54
|
-
return (_jsxs(Box, Object.assign({ ref: phoneNumberRef }, { children: [_jsxs(MobileWrapper, Object.assign({ sx: Object.assign({}, ((error === null || error === void 0 ? void 0 : error.message) && { borderBottom: 'none' })) }, { children: [_jsx(CountriesDropdown, { defaultCountry: (_c = (_b = country === null || country === void 0 ? void 0 : country.iso2) !== null && _b !== void 0 ? _b : defaultCountry === null || defaultCountry === void 0 ? void 0 : defaultCountry.code) !== null && _c !== void 0 ? _c : 'SA', value: country, onChangeCountry: onCountryChange, countries: countries, isLoading: isCountriesLoading }), _jsx(InputNumberStyled, Object.assign({}, field, { placeholder: t('mobile'), error: Boolean(error === null || error === void 0 ? void 0 : error.message), sx: {
|
|
55
|
-
border: 'none',
|
|
56
|
-
paddingInlineEnd: 0,
|
|
57
|
-
}, inputProps: {
|
|
58
|
-
autoComplete: 'off',
|
|
59
|
-
form: {
|
|
60
|
-
autoComplete: 'off',
|
|
61
|
-
},
|
|
62
|
-
}, hideArrows: true }))] })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message, { numberLen: country.max_digits }) })] })));
|
|
63
|
-
} }, "phoneNumberFormPhone"), _jsx(Controller, { control: control, name: "firstName", render: (_a) => {
|
|
64
|
-
var _b = _a.field, { ref } = _b, field = __rest(_b, ["ref"]), { fieldState: { error } } = _a;
|
|
65
|
-
return (_jsxs(Box, Object.assign({ ref: firstNameRef }, { children: [_jsx(InputStyled, Object.assign({}, field, { placeholder: t('firstName'), inputProps: { autoComplete: 'off' }, error: Boolean(error === null || error === void 0 ? void 0 : error.message) })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message) })] })));
|
|
66
|
-
} }, "phoneNumberFormFirstName"), _jsx(Controller, { control: control, name: "lastName", render: (_a) => {
|
|
67
|
-
var _b = _a.field, { ref } = _b, field = __rest(_b, ["ref"]), { fieldState: { error } } = _a;
|
|
68
|
-
return (_jsxs(Box, Object.assign({ ref: lastNameRef }, { children: [_jsx(InputStyled, Object.assign({}, field, { placeholder: t('lastName'), inputProps: { autoComplete: 'off' }, error: Boolean(error === null || error === void 0 ? void 0 : error.message) })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message) })] })));
|
|
69
|
-
} }, "phoneNumberFormLastName"), _jsx(SubmitButton, Object.assign({ onClick: onSubmit, disabled: !isValid || isItemsNotValid || !items.length }, { children: submitButtonText }))] })));
|
|
70
|
-
}
|
|
71
|
-
export default memo(PhoneNumberForm);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './validation';
|
|
2
|
-
export * from './EmailForm';
|
|
3
|
-
export { default as EmailForm } from './EmailForm';
|
|
4
|
-
export * from './FullInfo';
|
|
5
|
-
export { default as FullInfo } from './FullInfo';
|
|
6
|
-
export * from './FullInfoForm';
|
|
7
|
-
export { default as FullInfoForm } from './FullInfoForm';
|
|
8
|
-
export * from './PhoneNumberForm';
|
|
9
|
-
export { default as PhoneNumberForm } from './PhoneNumberForm';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './validation';
|
|
2
|
-
export * from './EmailForm';
|
|
3
|
-
export { default as EmailForm } from './EmailForm';
|
|
4
|
-
export * from './FullInfo';
|
|
5
|
-
export { default as FullInfo } from './FullInfo';
|
|
6
|
-
export * from './FullInfoForm';
|
|
7
|
-
export { default as FullInfoForm } from './FullInfoForm';
|
|
8
|
-
export * from './PhoneNumberForm';
|
|
9
|
-
export { default as PhoneNumberForm } from './PhoneNumberForm';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const MobileWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
|
-
export declare const SearchWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
7
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
8
|
-
export declare const FormWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
9
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
10
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
11
|
-
export declare const SubmitButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
12
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
13
|
-
}, "color" | "disabled" | "classes" | "className" | "style" | "tabIndex" | "children" | "sx" | "variant" | "size" | "fullWidth" | "href" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
14
|
-
export declare const InputStyled: import("@emotion/styled").StyledComponent<Readonly<import("@mui/material").InputProps & {
|
|
15
|
-
isError?: boolean | undefined;
|
|
16
|
-
}> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
17
|
-
error?: boolean | undefined;
|
|
18
|
-
}, {}, {}>;
|
|
19
|
-
export declare const InputNumberStyled: import("@emotion/styled").StyledComponent<Omit<Readonly<import("@mui/material").InputProps & {
|
|
20
|
-
isError?: boolean | undefined;
|
|
21
|
-
hideArrows?: boolean | undefined;
|
|
22
|
-
}>, "ref"> & import("react").RefAttributes<HTMLInputElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
23
|
-
error?: boolean | undefined;
|
|
24
|
-
}, {}, {}>;
|
|
25
|
-
export declare const ErrorStyled: import("@emotion/styled").StyledComponent<import("../../Error/Error").ErrorI & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import Box from '@mui/material/Box';
|
|
2
|
-
import Button from '@mui/material/Button';
|
|
3
|
-
import { styled, alpha } from '@mui/material/styles';
|
|
4
|
-
import { Input, InputNumber, Error } from '../../index.js';
|
|
5
|
-
export const MobileWrapper = styled(Box)(({ theme }) => ({
|
|
6
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
7
|
-
display: 'flex',
|
|
8
|
-
position: 'relative',
|
|
9
|
-
paddingInline: '8px',
|
|
10
|
-
alignItems: 'center',
|
|
11
|
-
borderRadius: '4px',
|
|
12
|
-
height: '40px',
|
|
13
|
-
}));
|
|
14
|
-
export const SearchWrapper = styled(Box)(() => ({
|
|
15
|
-
display: 'flex',
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
}));
|
|
18
|
-
export const FormWrapper = styled(Box)(({ theme }) => ({
|
|
19
|
-
padding: '8px',
|
|
20
|
-
display: 'flex',
|
|
21
|
-
flexDirection: 'column',
|
|
22
|
-
gap: '8px',
|
|
23
|
-
position: 'relative',
|
|
24
|
-
background: theme.palette.common.white,
|
|
25
|
-
borderRadius: '4px',
|
|
26
|
-
width: 'max-content',
|
|
27
|
-
maxWidth: 230,
|
|
28
|
-
boxShadow: theme.shadows[3],
|
|
29
|
-
}));
|
|
30
|
-
export const SubmitButton = styled(Button)(({ theme }) => ({
|
|
31
|
-
display: 'flex',
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
justifyContent: 'center',
|
|
34
|
-
textTransform: 'capitalize',
|
|
35
|
-
padding: '8px 13px',
|
|
36
|
-
minWidth: 89,
|
|
37
|
-
height: 32,
|
|
38
|
-
fontSize: '11px',
|
|
39
|
-
borderRadius: '4px',
|
|
40
|
-
fontWeight: 700,
|
|
41
|
-
background: theme.palette.info.dark,
|
|
42
|
-
color: theme.palette.common.white,
|
|
43
|
-
textAlign: 'center',
|
|
44
|
-
'&.Mui-disabled': {
|
|
45
|
-
backgroundColor: alpha(theme.palette.grey[700], 0.5),
|
|
46
|
-
color: theme.palette.common.white,
|
|
47
|
-
cursor: 'not-allowed',
|
|
48
|
-
},
|
|
49
|
-
'&:hover': {
|
|
50
|
-
background: theme.palette.info.dark,
|
|
51
|
-
},
|
|
52
|
-
}));
|
|
53
|
-
export const InputStyled = styled(Input, { shouldForwardProp: (props) => props !== 'error' })(({ error }) => (Object.assign({ img: {
|
|
54
|
-
cursor: 'pointer',
|
|
55
|
-
} }, (error && {
|
|
56
|
-
borderBottomLeftRadius: 0,
|
|
57
|
-
borderBottomRightRadius: 0,
|
|
58
|
-
borderBottom: 'none',
|
|
59
|
-
}))));
|
|
60
|
-
export const InputNumberStyled = styled(InputNumber, { shouldForwardProp: (props) => props !== 'error' })(({ error }) => (Object.assign({ img: {
|
|
61
|
-
cursor: 'pointer',
|
|
62
|
-
} }, (error && {
|
|
63
|
-
borderBottomLeftRadius: 0,
|
|
64
|
-
borderBottomRightRadius: 0,
|
|
65
|
-
borderBottom: 'none',
|
|
66
|
-
}))));
|
|
67
|
-
export const ErrorStyled = styled(Error)(() => ({
|
|
68
|
-
borderTopLeftRadius: 0,
|
|
69
|
-
borderTopRightRadius: 0,
|
|
70
|
-
height: 25,
|
|
71
|
-
}));
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as Yup from 'yup';
|
|
2
|
-
export declare const validationEmailFromSchema: Yup.ObjectSchema<{
|
|
3
|
-
email: string;
|
|
4
|
-
firstName: string;
|
|
5
|
-
lastName: string;
|
|
6
|
-
}, Yup.AnyObject, {
|
|
7
|
-
email: undefined;
|
|
8
|
-
firstName: undefined;
|
|
9
|
-
lastName: undefined;
|
|
10
|
-
}, "">;
|
|
11
|
-
export declare const validationFullInfoSchema: (numberLen: number) => Yup.ObjectSchema<{
|
|
12
|
-
email: string | undefined;
|
|
13
|
-
phoneNumber: string | undefined;
|
|
14
|
-
firstName: string;
|
|
15
|
-
lastName: string;
|
|
16
|
-
}, Yup.AnyObject, {
|
|
17
|
-
email: undefined;
|
|
18
|
-
phoneNumber: undefined;
|
|
19
|
-
firstName: undefined;
|
|
20
|
-
lastName: undefined;
|
|
21
|
-
}, "">;
|
|
22
|
-
export declare const validationPhoneNumberSchema: (numberLen: number) => Yup.ObjectSchema<{
|
|
23
|
-
firstName: string;
|
|
24
|
-
lastName: string;
|
|
25
|
-
phoneNumber: string;
|
|
26
|
-
}, Yup.AnyObject, {
|
|
27
|
-
firstName: undefined;
|
|
28
|
-
lastName: undefined;
|
|
29
|
-
phoneNumber: undefined;
|
|
30
|
-
}, "">;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as Yup from 'yup';
|
|
2
|
-
export const validationEmailFromSchema = Yup.object().shape({
|
|
3
|
-
email: Yup.string()
|
|
4
|
-
.matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i, 'invalidEmail')
|
|
5
|
-
.required('requiredEmail'),
|
|
6
|
-
firstName: Yup.string().required('requiredFirstName').min(3, 'invalidFirstName'),
|
|
7
|
-
lastName: Yup.string().required('requiredLastName').min(3, 'invalidLastName'),
|
|
8
|
-
});
|
|
9
|
-
export const validationFullInfoSchema = (numberLen) => Yup.object()
|
|
10
|
-
.shape({
|
|
11
|
-
email: Yup.string()
|
|
12
|
-
.transform((value, originalValue) => {
|
|
13
|
-
if (originalValue === '')
|
|
14
|
-
return undefined;
|
|
15
|
-
return value;
|
|
16
|
-
})
|
|
17
|
-
.matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{1,}$/i, 'invalidEmail')
|
|
18
|
-
.optional(),
|
|
19
|
-
phoneNumber: Yup.string()
|
|
20
|
-
.transform((value, originalValue) => {
|
|
21
|
-
if (!originalValue)
|
|
22
|
-
return undefined;
|
|
23
|
-
return value;
|
|
24
|
-
})
|
|
25
|
-
.length(numberLen, `invalidMobile`)
|
|
26
|
-
.optional(),
|
|
27
|
-
firstName: Yup.string().min(3, 'invalidFirstName').required('requiredFirstName'),
|
|
28
|
-
lastName: Yup.string().min(3, 'invalidLastName').required('requiredLastName'),
|
|
29
|
-
})
|
|
30
|
-
.test('atLeastOne', 'atLeastOne', function testAtLeastOne(_, ctx) {
|
|
31
|
-
var _a;
|
|
32
|
-
const { email, phoneNumber } = (_a = this.originalValue) !== null && _a !== void 0 ? _a : {};
|
|
33
|
-
if (!email && !phoneNumber) {
|
|
34
|
-
return ctx.createError({ message: 'atLeastOne' });
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
});
|
|
38
|
-
export const validationPhoneNumberSchema = (numberLen) => Yup.object().shape({
|
|
39
|
-
firstName: Yup.string().required('requiredFirstName').min(3, 'invalidFirstName'),
|
|
40
|
-
lastName: Yup.string().required('requiredLastName').min(3, 'invalidLastName'),
|
|
41
|
-
phoneNumber: Yup.string().length(numberLen, `invalidMobile`).required('requiredMobile'),
|
|
42
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as CustomerDropdown } from './CustomerDropdown';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as CustomerDropdown } from './CustomerDropdown';
|