@redneckz/wildless-cms-uni-blocks 0.14.690 → 0.14.692
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/bundle/api/dadataHints/dadataHintsType.d.ts +7 -1
- package/bundle/bundle.umd.js +62 -36
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CreditCardForm/getSixthStepData.d.ts +10 -2
- package/bundle/ui-kit/FormField/Fields/AddressField.d.ts +18 -0
- package/bundle/ui-kit/FormField/Fields/CurrencyField.d.ts +5 -0
- package/dist/api/dadataHints/dadataHintsType.d.ts +7 -1
- package/dist/components/CreditCardForm/getFourthStepData.js +1 -1
- package/dist/components/CreditCardForm/getFourthStepData.js.map +1 -1
- package/dist/components/CreditCardForm/getSixthStepData.d.ts +10 -2
- package/dist/components/CreditCardForm/getSixthStepData.js +22 -13
- package/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
- package/dist/components/CreditForm/getThirdStepData.js +1 -1
- package/dist/components/CreditForm/getThirdStepData.js.map +1 -1
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +11 -1
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/AddressField.d.ts +18 -0
- package/dist/ui-kit/FormField/Fields/AddressField.js +20 -18
- package/dist/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CurrencyField.d.ts +5 -0
- package/dist/ui-kit/FormField/Fields/CurrencyField.js +8 -2
- package/dist/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/InnField.js +2 -0
- package/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/lib/api/dadataHints/dadataHintsType.d.ts +7 -1
- package/lib/components/CreditCardForm/getFourthStepData.js +1 -1
- package/lib/components/CreditCardForm/getFourthStepData.js.map +1 -1
- package/lib/components/CreditCardForm/getSixthStepData.d.ts +10 -2
- package/lib/components/CreditCardForm/getSixthStepData.js +22 -13
- package/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
- package/lib/components/CreditForm/getThirdStepData.js +1 -1
- package/lib/components/CreditForm/getThirdStepData.js.map +1 -1
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +11 -1
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/AddressField.d.ts +18 -0
- package/lib/ui-kit/FormField/Fields/AddressField.js +18 -17
- package/lib/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CurrencyField.d.ts +5 -0
- package/lib/ui-kit/FormField/Fields/CurrencyField.js +7 -1
- package/lib/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/InnField.js +2 -0
- package/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/bundle/api/dadataHints/dadataHintsType.d.ts +7 -1
- package/mobile/bundle/bundle.umd.js +62 -36
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CreditCardForm/getSixthStepData.d.ts +10 -2
- package/mobile/bundle/ui-kit/FormField/Fields/AddressField.d.ts +18 -0
- package/mobile/bundle/ui-kit/FormField/Fields/CurrencyField.d.ts +5 -0
- package/mobile/dist/api/dadataHints/dadataHintsType.d.ts +7 -1
- package/mobile/dist/components/CreditCardForm/getFourthStepData.js +1 -1
- package/mobile/dist/components/CreditCardForm/getFourthStepData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/getSixthStepData.d.ts +10 -2
- package/mobile/dist/components/CreditCardForm/getSixthStepData.js +22 -13
- package/mobile/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
- package/mobile/dist/components/CreditForm/getThirdStepData.js +1 -1
- package/mobile/dist/components/CreditForm/getThirdStepData.js.map +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +11 -1
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressField.d.ts +18 -0
- package/mobile/dist/ui-kit/FormField/Fields/AddressField.js +20 -18
- package/mobile/dist/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CurrencyField.d.ts +5 -0
- package/mobile/dist/ui-kit/FormField/Fields/CurrencyField.js +8 -2
- package/mobile/dist/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/lib/api/dadataHints/dadataHintsType.d.ts +7 -1
- package/mobile/lib/components/CreditCardForm/getFourthStepData.js +1 -1
- package/mobile/lib/components/CreditCardForm/getFourthStepData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/getSixthStepData.d.ts +10 -2
- package/mobile/lib/components/CreditCardForm/getSixthStepData.js +22 -13
- package/mobile/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
- package/mobile/lib/components/CreditForm/getThirdStepData.js +1 -1
- package/mobile/lib/components/CreditForm/getThirdStepData.js.map +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +11 -1
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressField.d.ts +18 -0
- package/mobile/lib/ui-kit/FormField/Fields/AddressField.js +18 -17
- package/mobile/lib/ui-kit/FormField/Fields/AddressField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CurrencyField.d.ts +5 -0
- package/mobile/lib/ui-kit/FormField/Fields/CurrencyField.js +7 -1
- package/mobile/lib/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/src/api/dadataHints/dadataHintsType.ts +8 -1
- package/mobile/src/components/CreditCardForm/getFourthStepData.ts +1 -1
- package/mobile/src/components/CreditCardForm/getSixthStepData.ts +25 -13
- package/mobile/src/components/CreditForm/getThirdStepData.ts +1 -1
- package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -1
- package/mobile/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +14 -2
- package/mobile/src/ui-kit/FormField/Fields/AddressField.tsx +19 -17
- package/mobile/src/ui-kit/FormField/Fields/CurrencyField.tsx +7 -1
- package/mobile/src/ui-kit/FormField/Fields/InnField.tsx +4 -0
- package/package.json +1 -1
- package/src/api/dadataHints/dadataHintsType.ts +8 -1
- package/src/components/CreditCardForm/getFourthStepData.ts +1 -1
- package/src/components/CreditCardForm/getSixthStepData.ts +25 -13
- package/src/components/CreditForm/getThirdStepData.ts +1 -1
- package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -1
- package/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +14 -2
- package/src/ui-kit/FormField/Fields/AddressField.tsx +19 -17
- package/src/ui-kit/FormField/Fields/CurrencyField.tsx +7 -1
- package/src/ui-kit/FormField/Fields/InnField.tsx +4 -0
|
@@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-jsx/lib/hooks';
|
|
4
4
|
import { getLink } from '../../api/RetailAPI/getLink.js';
|
|
5
5
|
import { locationNavigator } from '../../external/locationNavigator.js';
|
|
6
|
+
import { useLocalStorage } from '../../hooks/useLocalStorage.js';
|
|
6
7
|
import { Button } from '../Button/Button.js';
|
|
7
8
|
import { Dialog } from '../DialogManager/Dialog.js';
|
|
8
9
|
import { Img } from '../Img/Img.js';
|
|
9
10
|
export const EsiaLoginDialog = JSX(({ onClose }) => {
|
|
10
11
|
const navigator = locationNavigator();
|
|
12
|
+
const [leadForm, setLeadForm] = useLocalStorage('leadForm');
|
|
11
13
|
const handleAuth = useCallback(async () => {
|
|
12
14
|
const resp = await getLink({
|
|
13
15
|
redirectUri: navigator.href,
|
|
@@ -16,6 +18,14 @@ export const EsiaLoginDialog = JSX(({ onClose }) => {
|
|
|
16
18
|
navigator.assign(resp.link);
|
|
17
19
|
}
|
|
18
20
|
}, []);
|
|
19
|
-
|
|
21
|
+
const handleClose = useCallback(() => {
|
|
22
|
+
if (leadForm !== null) {
|
|
23
|
+
const leadFormCopy = { ...leadForm };
|
|
24
|
+
Reflect.deleteProperty(leadFormCopy, 'esiaAccountTypeCd');
|
|
25
|
+
setLeadForm(leadFormCopy);
|
|
26
|
+
}
|
|
27
|
+
onClose?.();
|
|
28
|
+
}, []);
|
|
29
|
+
return (_jsx(Dialog, { className: "my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg", onClose: handleClose, children: _jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md", children: [_jsxs("div", { className: "flex items-center justify-around w-full", children: [_jsxs("ul", { className: "list-disc", children: [_jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), _jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), _jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), _jsx(Img, { image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "70" })] }), _jsxs("div", { className: "flex items-center justify-between w-full m-0", children: [_jsx(Button, { type: "button", onClick: handleAuth, children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), _jsx(Button, { type: "button", version: "secondary", onClick: handleClose, children: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C" })] })] }) }));
|
|
20
30
|
});
|
|
21
31
|
//# sourceMappingURL=EsiaLoginDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EsiaLoginDialog.js","sourceRoot":"","sources":["../../../src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"EsiaLoginDialog.js","sourceRoot":"","sources":["../../../src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,e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GAAG,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAC,IAAI,GAAG,IACxE,EACN,eAAK,SAAS,EAAC,8CAA8C,aAC3D,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,UAAU,6JAEhC,EACT,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,WAAW,6EAErD,IACL,IACF,GACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
+
import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
|
|
1
2
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
2
3
|
export declare const AddressField: import("@redneckz/uni-jsx").UNIComponent<CustomFieldProps, any, any>;
|
|
4
|
+
export declare const getAddressFromDaDataItem: (item?: DaDataSuggestion) => {
|
|
5
|
+
apartment: import("../../../utils/Nullable").Nullable<string>;
|
|
6
|
+
city: import("../../../utils/Nullable").Nullable<string>;
|
|
7
|
+
district: import("../../../utils/Nullable").Nullable<string>;
|
|
8
|
+
fullAddress: string | undefined;
|
|
9
|
+
fiasCode: string | undefined;
|
|
10
|
+
house: import("../../../utils/Nullable").Nullable<string>;
|
|
11
|
+
locality: import("../../../utils/Nullable").Nullable<string>;
|
|
12
|
+
okatoRegionCode: import("../../../utils/Nullable").Nullable<string>;
|
|
13
|
+
postcode: import("../../../utils/Nullable").Nullable<string>;
|
|
14
|
+
region: string | undefined;
|
|
15
|
+
regionCode: string;
|
|
16
|
+
street: import("../../../utils/Nullable").Nullable<string>;
|
|
17
|
+
qc: ("0" | "1") | undefined;
|
|
18
|
+
qcComplete: import("../../../utils/Nullable").Nullable<string>;
|
|
19
|
+
qcHouse: import("../../../utils/Nullable").Nullable<string>;
|
|
20
|
+
};
|
|
@@ -9,23 +9,7 @@ export const AddressField = JSX(({ field, input }) => {
|
|
|
9
9
|
const fieldName = input?.name || 'addressRegistration';
|
|
10
10
|
const fieldValue = field(fieldName).value;
|
|
11
11
|
const onDaDataChange = useCallback((item) => {
|
|
12
|
-
field?.(fieldName)?.onChange?.(
|
|
13
|
-
apartment: item?.data?.flat,
|
|
14
|
-
city: item?.data?.city,
|
|
15
|
-
district: item?.data?.area_with_type,
|
|
16
|
-
fullAddress: item?.value,
|
|
17
|
-
fiasCode: item?.data?.fias_id,
|
|
18
|
-
house: item?.data?.house,
|
|
19
|
-
locality: item?.data?.settlement_with_type,
|
|
20
|
-
okatoRegionCode: item?.data?.okato,
|
|
21
|
-
postcode: item?.data?.postal_code,
|
|
22
|
-
region: item?.data?.region,
|
|
23
|
-
regionCode: item?.data?.region_kladr_id ? item?.data?.region_kladr_id.substring(0, 2) : '',
|
|
24
|
-
street: item?.data?.house,
|
|
25
|
-
qc: item?.data?.qc,
|
|
26
|
-
qcComplete: item?.data?.qc_complete,
|
|
27
|
-
qcHouse: item?.data?.qc_house,
|
|
28
|
-
});
|
|
12
|
+
field?.(fieldName)?.onChange?.(getAddressFromDaDataItem(item));
|
|
29
13
|
}, []);
|
|
30
14
|
const onChange = useCallback((value) => {
|
|
31
15
|
field?.(fieldName)?.onChange?.({
|
|
@@ -48,4 +32,21 @@ export const AddressField = JSX(({ field, input }) => {
|
|
|
48
32
|
}, []);
|
|
49
33
|
return (_jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, fieldName), label: "\u0410\u0434\u0440\u0435\u0441", ...getValidation(field(fieldName), validatorObj[fieldName], input?.required), value: fieldValue.fullAddress, onChange: onChange, ...input, onDaDataChange: onDaDataChange }));
|
|
50
34
|
});
|
|
35
|
+
export const getAddressFromDaDataItem = (item) => ({
|
|
36
|
+
apartment: item?.data?.flat,
|
|
37
|
+
city: item?.data?.city,
|
|
38
|
+
district: item?.data?.area_with_type,
|
|
39
|
+
fullAddress: item?.value,
|
|
40
|
+
fiasCode: item?.data?.fias_id,
|
|
41
|
+
house: item?.data?.house,
|
|
42
|
+
locality: item?.data?.settlement_with_type,
|
|
43
|
+
okatoRegionCode: item?.data?.okato,
|
|
44
|
+
postcode: item?.data?.postal_code,
|
|
45
|
+
region: item?.data?.region,
|
|
46
|
+
regionCode: item?.data?.region_kladr_id ? item?.data?.region_kladr_id.substring(0, 2) : '',
|
|
47
|
+
street: item?.data?.house,
|
|
48
|
+
qc: item?.data?.qc,
|
|
49
|
+
qcComplete: item?.data?.qc_complete,
|
|
50
|
+
qcHouse: item?.data?.qc_house,
|
|
51
|
+
});
|
|
51
52
|
//# sourceMappingURL=AddressField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/AddressField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,SAAS,GAAG,KAAK,EAAE,IAAI,IAAI,qBAAqB,CAAC;IACvD,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC;IAE1C,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,IAAsB,EAAE,EAAE;QAC5D,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"AddressField.js","sourceRoot":"","sources":["../../../../src/ui-kit/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AI,EAAE,IAAI,EAAE,EAAE;IAClB,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW;IACnC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ;CAC9B,CAAC,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type RadioButtonItem } from '../../RadioButtonGroup/RadioButtonGroup';
|
|
2
2
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
3
|
+
export declare enum CurrencyCode {
|
|
4
|
+
'rub' = "810",
|
|
5
|
+
'dollar' = "840",
|
|
6
|
+
'euro' = "978"
|
|
7
|
+
}
|
|
3
8
|
export declare const CURRENCY_TYPES: RadioButtonItem[];
|
|
4
9
|
export declare const CurrencyField: import("@redneckz/uni-jsx").UNIComponent<CustomFieldProps, any, any>;
|
|
@@ -3,7 +3,13 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import { RadioButtonGroupControl } from '../../RadioButtonGroup/RadioButtonGroupControl.js';
|
|
4
4
|
import { validatorObj } from '../getObjectValidator.js';
|
|
5
5
|
import { getValidation } from '../getValidation.js';
|
|
6
|
-
export
|
|
6
|
+
export var CurrencyCode;
|
|
7
|
+
(function (CurrencyCode) {
|
|
8
|
+
CurrencyCode["rub"] = "810";
|
|
9
|
+
CurrencyCode["dollar"] = "840";
|
|
10
|
+
CurrencyCode["euro"] = "978";
|
|
11
|
+
})(CurrencyCode || (CurrencyCode = {}));
|
|
12
|
+
export const CURRENCY_TYPES = [{ id: CurrencyCode.rub, text: 'Рубль' }];
|
|
7
13
|
export const CurrencyField = JSX(({ field, input }) => {
|
|
8
14
|
const { value, onChange } = field('currency');
|
|
9
15
|
return (_jsx(RadioButtonGroupControl, { label: "\u0412\u0430\u043B\u044E\u0442\u0430", orientation: "horizontal", items: CURRENCY_TYPES, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('currency'), validatorObj.currency, input?.required) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/CurrencyField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,EAAE,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"CurrencyField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/CurrencyField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,2BAAa,CAAA;IACb,8BAAgB,CAAA;IAChB,4BAAc,CAAA;AAChB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IACtE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAE9C,OAAO,CACL,KAAC,uBAAuB,IACtB,KAAK,EAAC,sCAAQ,EACd,WAAW,EAAC,YAAY,EACxB,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAC1B,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,GAC5E,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -4,8 +4,10 @@ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
4
4
|
import { InputControl } from '../../Input/InputControl.js';
|
|
5
5
|
import { validatorObj } from '../getObjectValidator.js';
|
|
6
6
|
import { getValidation } from '../getValidation.js';
|
|
7
|
+
import { getAddressFromDaDataItem } from './AddressField.js';
|
|
7
8
|
export const InnField = JSX(({ field, input }) => {
|
|
8
9
|
const onDaDataChange = useCallback((item) => {
|
|
10
|
+
field?.('organizationAddress')?.onChange?.(getAddressFromDaDataItem(item.data?.address));
|
|
9
11
|
field?.('organizationName')?.onChange?.(item.data?.name?.short_with_opf);
|
|
10
12
|
field?.('legalForm')?.onChange?.(item.data?.opf?.short);
|
|
11
13
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InnField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/InnField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"InnField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/InnField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,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
|
13
15
|
interface DaDataFio {
|
|
14
16
|
surname: Nullable<string>;
|
|
15
17
|
name: Nullable<string>;
|
|
16
18
|
patronymic: Nullable<string>;
|
|
17
19
|
gender: DaDataGender;
|
|
18
|
-
qc:
|
|
20
|
+
qc: DaDataQC;
|
|
19
21
|
source: null;
|
|
20
22
|
}
|
|
21
23
|
|
|
@@ -30,6 +32,10 @@ interface DaDataPassportFms {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
interface DaDataOrganization {
|
|
35
|
+
address: {
|
|
36
|
+
data: DaDataAddress;
|
|
37
|
+
value: string;
|
|
38
|
+
};
|
|
33
39
|
inn: string;
|
|
34
40
|
name: {
|
|
35
41
|
short_with_opf: string;
|
|
@@ -52,6 +58,7 @@ export interface DaDataAddress {
|
|
|
52
58
|
settlement_with_type: Nullable<string>;
|
|
53
59
|
street: Nullable<string>;
|
|
54
60
|
fias_code: string;
|
|
61
|
+
qc: DaDataQC;
|
|
55
62
|
qc_complete: Nullable<string>;
|
|
56
63
|
qc_house: Nullable<string>;
|
|
57
64
|
}
|
|
@@ -5,25 +5,37 @@ import { getParticipantAddresses } from '../CreditForm/utils';
|
|
|
5
5
|
export const getDeliveryData = (formData: FormState) => {
|
|
6
6
|
const { methodObtain, deliveryDate = '' } = formData;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const isCourierDelivery = methodObtain === 'courier';
|
|
9
|
+
|
|
10
|
+
return isCourierDelivery
|
|
11
|
+
? {
|
|
12
|
+
courierDeliveryFlg: isCourierDelivery,
|
|
13
|
+
deliveryDate: dateToISO(deliveryDate),
|
|
14
|
+
deliveryTimeCd: { value: 'TIME_2' },
|
|
15
|
+
}
|
|
16
|
+
: {};
|
|
13
17
|
};
|
|
14
18
|
|
|
15
19
|
export const getOfficeCode = (formData: FormState) => {
|
|
16
|
-
const { addressRetail } = formData;
|
|
20
|
+
const { addressRetail, methodObtain } = formData;
|
|
21
|
+
|
|
22
|
+
const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
|
|
17
23
|
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
return isOfficeObtain
|
|
25
|
+
? {
|
|
26
|
+
office: { id: addressRetail.key },
|
|
27
|
+
}
|
|
28
|
+
: {};
|
|
21
29
|
};
|
|
22
30
|
|
|
23
31
|
export const getSixthStepData = (formData: FormState) => {
|
|
24
|
-
const { addressCourier } = formData;
|
|
32
|
+
const { addressCourier, methodObtain } = formData;
|
|
33
|
+
|
|
34
|
+
const isCourierDelivery = methodObtain === 'courier';
|
|
25
35
|
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
return isCourierDelivery
|
|
37
|
+
? {
|
|
38
|
+
participantAddresses: getParticipantAddresses({ addressCourier }),
|
|
39
|
+
}
|
|
40
|
+
: {};
|
|
29
41
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { getLink } from '../../api/RetailAPI/getLink';
|
|
4
|
+
import { type FormState } from '../../components/ApplicationLeadForm/getInitialFormState';
|
|
4
5
|
import { locationNavigator } from '../../external/locationNavigator';
|
|
6
|
+
import { useLocalStorage } from '../../hooks/useLocalStorage';
|
|
5
7
|
import { Button } from '../Button/Button';
|
|
6
8
|
import { Dialog } from '../DialogManager/Dialog';
|
|
7
9
|
import { Img } from '../Img/Img';
|
|
@@ -12,6 +14,7 @@ export interface EsiaLoginDialogProps {
|
|
|
12
14
|
|
|
13
15
|
export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(({ onClose }) => {
|
|
14
16
|
const navigator = locationNavigator();
|
|
17
|
+
const [leadForm, setLeadForm] = useLocalStorage<FormState>('leadForm');
|
|
15
18
|
const handleAuth = useCallback(async () => {
|
|
16
19
|
const resp = await getLink({
|
|
17
20
|
redirectUri: navigator.href,
|
|
@@ -22,8 +25,17 @@ export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(({ onClose }) => {
|
|
|
22
25
|
}
|
|
23
26
|
}, []);
|
|
24
27
|
|
|
28
|
+
const handleClose = useCallback(() => {
|
|
29
|
+
if (leadForm !== null) {
|
|
30
|
+
const leadFormCopy = { ...leadForm };
|
|
31
|
+
Reflect.deleteProperty(leadFormCopy, 'esiaAccountTypeCd');
|
|
32
|
+
setLeadForm(leadFormCopy);
|
|
33
|
+
}
|
|
34
|
+
onClose?.();
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
25
37
|
return (
|
|
26
|
-
<Dialog className="my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg" onClose={
|
|
38
|
+
<Dialog className="my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg" onClose={handleClose}>
|
|
27
39
|
<div className="flex flex-col gap-lg items-center rounded-md">
|
|
28
40
|
<div className="flex items-center justify-around w-full">
|
|
29
41
|
<ul className="list-disc">
|
|
@@ -37,7 +49,7 @@ export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(({ onClose }) => {
|
|
|
37
49
|
<Button type="button" onClick={handleAuth}>
|
|
38
50
|
Заполнить через Госуслуги
|
|
39
51
|
</Button>
|
|
40
|
-
<Button type="button" version="secondary" onClick={
|
|
52
|
+
<Button type="button" version="secondary" onClick={handleClose}>
|
|
41
53
|
Пропустить
|
|
42
54
|
</Button>
|
|
43
55
|
</div>
|
|
@@ -12,23 +12,7 @@ export const AddressField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
12
12
|
const fieldValue = field(fieldName).value;
|
|
13
13
|
|
|
14
14
|
const onDaDataChange = useCallback((item: DaDataSuggestion) => {
|
|
15
|
-
field?.(fieldName)?.onChange?.(
|
|
16
|
-
apartment: item?.data?.flat,
|
|
17
|
-
city: item?.data?.city,
|
|
18
|
-
district: item?.data?.area_with_type,
|
|
19
|
-
fullAddress: item?.value,
|
|
20
|
-
fiasCode: item?.data?.fias_id,
|
|
21
|
-
house: item?.data?.house,
|
|
22
|
-
locality: item?.data?.settlement_with_type,
|
|
23
|
-
okatoRegionCode: item?.data?.okato,
|
|
24
|
-
postcode: item?.data?.postal_code,
|
|
25
|
-
region: item?.data?.region,
|
|
26
|
-
regionCode: item?.data?.region_kladr_id ? item?.data?.region_kladr_id.substring(0, 2) : '',
|
|
27
|
-
street: item?.data?.house,
|
|
28
|
-
qc: item?.data?.qc,
|
|
29
|
-
qcComplete: item?.data?.qc_complete,
|
|
30
|
-
qcHouse: item?.data?.qc_house,
|
|
31
|
-
});
|
|
15
|
+
field?.(fieldName)?.onChange?.(getAddressFromDaDataItem(item));
|
|
32
16
|
}, []);
|
|
33
17
|
|
|
34
18
|
const onChange = useCallback((value: string) => {
|
|
@@ -63,3 +47,21 @@ export const AddressField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
63
47
|
/>
|
|
64
48
|
);
|
|
65
49
|
});
|
|
50
|
+
|
|
51
|
+
export const getAddressFromDaDataItem = (item?: DaDataSuggestion) => ({
|
|
52
|
+
apartment: item?.data?.flat,
|
|
53
|
+
city: item?.data?.city,
|
|
54
|
+
district: item?.data?.area_with_type,
|
|
55
|
+
fullAddress: item?.value,
|
|
56
|
+
fiasCode: item?.data?.fias_id,
|
|
57
|
+
house: item?.data?.house,
|
|
58
|
+
locality: item?.data?.settlement_with_type,
|
|
59
|
+
okatoRegionCode: item?.data?.okato,
|
|
60
|
+
postcode: item?.data?.postal_code,
|
|
61
|
+
region: item?.data?.region,
|
|
62
|
+
regionCode: item?.data?.region_kladr_id ? item?.data?.region_kladr_id.substring(0, 2) : '',
|
|
63
|
+
street: item?.data?.house,
|
|
64
|
+
qc: item?.data?.qc,
|
|
65
|
+
qcComplete: item?.data?.qc_complete,
|
|
66
|
+
qcHouse: item?.data?.qc_house,
|
|
67
|
+
});
|
|
@@ -5,7 +5,13 @@ import { type CustomFieldProps } from '../CustomFieldProps';
|
|
|
5
5
|
import { validatorObj } from '../getObjectValidator';
|
|
6
6
|
import { getValidation } from '../getValidation';
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export enum CurrencyCode {
|
|
9
|
+
'rub' = '810',
|
|
10
|
+
'dollar' = '840',
|
|
11
|
+
'euro' = '978',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const CURRENCY_TYPES: RadioButtonItem[] = [{ id: CurrencyCode.rub, text: 'Рубль' }];
|
|
9
15
|
|
|
10
16
|
export const CurrencyField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
11
17
|
const { value, onChange } = field('currency');
|
|
@@ -5,9 +5,13 @@ import { InputControl } from '../../Input/InputControl';
|
|
|
5
5
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
6
6
|
import { validatorObj } from '../getObjectValidator';
|
|
7
7
|
import { getValidation } from '../getValidation';
|
|
8
|
+
import { getAddressFromDaDataItem } from './AddressField';
|
|
8
9
|
|
|
9
10
|
export const InnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
10
11
|
const onDaDataChange = useCallback((item: DaDataSuggestion) => {
|
|
12
|
+
field?.('organizationAddress')?.onChange?.(
|
|
13
|
+
getAddressFromDaDataItem(item.data?.address as DaDataSuggestion),
|
|
14
|
+
);
|
|
11
15
|
field?.('organizationName')?.onChange?.(item.data?.name?.short_with_opf);
|
|
12
16
|
field?.('legalForm')?.onChange?.(item.data?.opf?.short);
|
|
13
17
|
}, []);
|
package/package.json
CHANGED
|
@@ -10,12 +10,14 @@ export interface DaDataSuggestion {
|
|
|
10
10
|
|
|
11
11
|
type DaDataGender = 'MALE' | 'FEMALE' | 'UNKNOWN';
|
|
12
12
|
|
|
13
|
+
type DaDataQC = '0' | '1';
|
|
14
|
+
|
|
13
15
|
interface DaDataFio {
|
|
14
16
|
surname: Nullable<string>;
|
|
15
17
|
name: Nullable<string>;
|
|
16
18
|
patronymic: Nullable<string>;
|
|
17
19
|
gender: DaDataGender;
|
|
18
|
-
qc:
|
|
20
|
+
qc: DaDataQC;
|
|
19
21
|
source: null;
|
|
20
22
|
}
|
|
21
23
|
|
|
@@ -30,6 +32,10 @@ interface DaDataPassportFms {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
interface DaDataOrganization {
|
|
35
|
+
address: {
|
|
36
|
+
data: DaDataAddress;
|
|
37
|
+
value: string;
|
|
38
|
+
};
|
|
33
39
|
inn: string;
|
|
34
40
|
name: {
|
|
35
41
|
short_with_opf: string;
|
|
@@ -52,6 +58,7 @@ export interface DaDataAddress {
|
|
|
52
58
|
settlement_with_type: Nullable<string>;
|
|
53
59
|
street: Nullable<string>;
|
|
54
60
|
fias_code: string;
|
|
61
|
+
qc: DaDataQC;
|
|
55
62
|
qc_complete: Nullable<string>;
|
|
56
63
|
qc_house: Nullable<string>;
|
|
57
64
|
}
|
|
@@ -5,25 +5,37 @@ import { getParticipantAddresses } from '../CreditForm/utils';
|
|
|
5
5
|
export const getDeliveryData = (formData: FormState) => {
|
|
6
6
|
const { methodObtain, deliveryDate = '' } = formData;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const isCourierDelivery = methodObtain === 'courier';
|
|
9
|
+
|
|
10
|
+
return isCourierDelivery
|
|
11
|
+
? {
|
|
12
|
+
courierDeliveryFlg: isCourierDelivery,
|
|
13
|
+
deliveryDate: dateToISO(deliveryDate),
|
|
14
|
+
deliveryTimeCd: { value: 'TIME_2' },
|
|
15
|
+
}
|
|
16
|
+
: {};
|
|
13
17
|
};
|
|
14
18
|
|
|
15
19
|
export const getOfficeCode = (formData: FormState) => {
|
|
16
|
-
const { addressRetail } = formData;
|
|
20
|
+
const { addressRetail, methodObtain } = formData;
|
|
21
|
+
|
|
22
|
+
const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
|
|
17
23
|
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
return isOfficeObtain
|
|
25
|
+
? {
|
|
26
|
+
office: { id: addressRetail.key },
|
|
27
|
+
}
|
|
28
|
+
: {};
|
|
21
29
|
};
|
|
22
30
|
|
|
23
31
|
export const getSixthStepData = (formData: FormState) => {
|
|
24
|
-
const { addressCourier } = formData;
|
|
32
|
+
const { addressCourier, methodObtain } = formData;
|
|
33
|
+
|
|
34
|
+
const isCourierDelivery = methodObtain === 'courier';
|
|
25
35
|
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
return isCourierDelivery
|
|
37
|
+
? {
|
|
38
|
+
participantAddresses: getParticipantAddresses({ addressCourier }),
|
|
39
|
+
}
|
|
40
|
+
: {};
|
|
29
41
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { getLink } from '../../api/RetailAPI/getLink';
|
|
4
|
+
import { type FormState } from '../../components/ApplicationLeadForm/getInitialFormState';
|
|
4
5
|
import { locationNavigator } from '../../external/locationNavigator';
|
|
6
|
+
import { useLocalStorage } from '../../hooks/useLocalStorage';
|
|
5
7
|
import { Button } from '../Button/Button';
|
|
6
8
|
import { Dialog } from '../DialogManager/Dialog';
|
|
7
9
|
import { Img } from '../Img/Img';
|
|
@@ -12,6 +14,7 @@ export interface EsiaLoginDialogProps {
|
|
|
12
14
|
|
|
13
15
|
export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(({ onClose }) => {
|
|
14
16
|
const navigator = locationNavigator();
|
|
17
|
+
const [leadForm, setLeadForm] = useLocalStorage<FormState>('leadForm');
|
|
15
18
|
const handleAuth = useCallback(async () => {
|
|
16
19
|
const resp = await getLink({
|
|
17
20
|
redirectUri: navigator.href,
|
|
@@ -22,8 +25,17 @@ export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(({ onClose }) => {
|
|
|
22
25
|
}
|
|
23
26
|
}, []);
|
|
24
27
|
|
|
28
|
+
const handleClose = useCallback(() => {
|
|
29
|
+
if (leadForm !== null) {
|
|
30
|
+
const leadFormCopy = { ...leadForm };
|
|
31
|
+
Reflect.deleteProperty(leadFormCopy, 'esiaAccountTypeCd');
|
|
32
|
+
setLeadForm(leadFormCopy);
|
|
33
|
+
}
|
|
34
|
+
onClose?.();
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
25
37
|
return (
|
|
26
|
-
<Dialog className="my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg" onClose={
|
|
38
|
+
<Dialog className="my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg" onClose={handleClose}>
|
|
27
39
|
<div className="flex flex-col gap-lg items-center rounded-md">
|
|
28
40
|
<div className="flex items-center justify-around w-full">
|
|
29
41
|
<ul className="list-disc">
|
|
@@ -37,7 +49,7 @@ export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(({ onClose }) => {
|
|
|
37
49
|
<Button type="button" onClick={handleAuth}>
|
|
38
50
|
Заполнить через Госуслуги
|
|
39
51
|
</Button>
|
|
40
|
-
<Button type="button" version="secondary" onClick={
|
|
52
|
+
<Button type="button" version="secondary" onClick={handleClose}>
|
|
41
53
|
Пропустить
|
|
42
54
|
</Button>
|
|
43
55
|
</div>
|