@redneckz/wildless-cms-uni-blocks 0.14.635 → 0.14.637
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/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +149 -49
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/bundle/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/bundle/components/CreditForm/getInitialFormState.d.ts +1 -0
- package/bundle/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +52 -0
- package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js +16 -7
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/getInitialFormState.d.ts +1 -0
- package/dist/components/CreditForm/getInitialFormState.js +1 -0
- package/dist/components/CreditForm/getInitialFormState.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/AddressFactField.js +42 -0
- package/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/AddressMatchField.js +11 -0
- package/dist/ui-kit/FormField/Fields/AddressMatchField.js.map +1 -0
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/getField.js +4 -1
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/Input/InputControl.js +2 -2
- package/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/lib/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +49 -0
- package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js +16 -7
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/getInitialFormState.d.ts +1 -0
- package/lib/components/CreditForm/getInitialFormState.js +1 -0
- package/lib/components/CreditForm/getInitialFormState.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/AddressFactField.js +40 -0
- package/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/AddressMatchField.js +9 -0
- package/lib/ui-kit/FormField/Fields/AddressMatchField.js.map +1 -0
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/getField.js +4 -1
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +1 -0
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/Input/InputControl.js +2 -2
- package/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/mobile/bundle/bundle.umd.js +149 -49
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/bundle/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/mobile/bundle/components/CreditForm/getInitialFormState.d.ts +1 -0
- package/mobile/bundle/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +52 -0
- package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +16 -7
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/getInitialFormState.d.ts +1 -0
- package/mobile/dist/components/CreditForm/getInitialFormState.js +1 -0
- package/mobile/dist/components/CreditForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js +42 -0
- package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/AddressMatchField.js +11 -0
- package/mobile/dist/ui-kit/FormField/Fields/AddressMatchField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +4 -1
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputControl.js +2 -2
- package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateProfileEsia.d.ts +7 -7
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +49 -0
- package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +16 -7
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/getInitialFormState.d.ts +1 -0
- package/mobile/lib/components/CreditForm/getInitialFormState.js +1 -0
- package/mobile/lib/components/CreditForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js +40 -0
- package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/AddressMatchField.js +9 -0
- package/mobile/lib/ui-kit/FormField/Fields/AddressMatchField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +4 -1
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +1 -0
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputControl.js +2 -2
- package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/src/api/RetailAPI/updateProfileEsia.ts +7 -7
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -0
- package/mobile/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +69 -0
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -3
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +16 -7
- package/mobile/src/components/CreditForm/getInitialFormState.tsx +3 -0
- package/mobile/src/ui-kit/FormField/Fields/AddressFactField.tsx +55 -0
- package/mobile/src/ui-kit/FormField/Fields/AddressMatchField.tsx +14 -0
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +2 -1
- package/mobile/src/ui-kit/FormField/getField.tsx +4 -1
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
- package/mobile/src/ui-kit/Input/InputControl.tsx +2 -0
- package/package.json +1 -1
- package/src/api/RetailAPI/updateProfileEsia.ts +7 -7
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -0
- package/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +69 -0
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -3
- package/src/components/CreditForm/creditFormStepsData.tsx +16 -7
- package/src/components/CreditForm/getInitialFormState.tsx +3 -0
- package/src/ui-kit/FormField/Fields/AddressFactField.tsx +55 -0
- package/src/ui-kit/FormField/Fields/AddressMatchField.tsx +14 -0
- package/src/ui-kit/FormField/NameFieldDef.ts +2 -1
- package/src/ui-kit/FormField/getField.tsx +4 -1
- package/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
- package/src/ui-kit/Input/InputControl.tsx +2 -0
|
@@ -1331,7 +1331,7 @@
|
|
|
1331
1331
|
return inputRef;
|
|
1332
1332
|
}
|
|
1333
1333
|
|
|
1334
|
-
const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onDaDataChange, onBlur, isTextarea, type, name = '', daDataQueryPrefix, inputLength, dadata = false, }) => {
|
|
1334
|
+
const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onDaDataChange, onBlur, isTextarea, type, name = '', daDataQueryPrefix, inputLength, dadata = false, disabled = false, }) => {
|
|
1335
1335
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
1336
1336
|
const popupRef = useOutsideClick(close);
|
|
1337
1337
|
const handleChange = useCallback((v) => (inputLength ? v.length <= inputLength && onChange(v) : onChange(v)), [onChange]);
|
|
@@ -1343,7 +1343,7 @@
|
|
|
1343
1343
|
onChange,
|
|
1344
1344
|
onDaDataChange,
|
|
1345
1345
|
});
|
|
1346
|
-
return (jsxs("div", { className: style('shrink-0 w-full', className), ref: popupRef, onBlur: close, onFocus: open, children: [jsx("div", { ref: inputRef, children: jsx(Input, { type: type || 'text', "aria-label": label, label: getRequiredLabel({ label, errors }), valid: Boolean(!error), value: value, onChange: handleChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: getPlaceholder(placeholder, errors, label) }) }), renderErrorText(error)] }));
|
|
1346
|
+
return (jsxs("div", { className: style('shrink-0 w-full', className), ref: popupRef, onBlur: close, onFocus: open, children: [jsx("div", { ref: inputRef, children: jsx(Input, { disabled: disabled, type: type || 'text', "aria-label": label, label: getRequiredLabel({ label, errors }), valid: Boolean(!error), value: value, onChange: handleChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: getPlaceholder(placeholder, errors, label) }) }), renderErrorText(error)] }));
|
|
1347
1347
|
});
|
|
1348
1348
|
const getPlaceholder = (placeholder, errors, label) => errors && !label ? `${placeholder}*` : placeholder;
|
|
1349
1349
|
|
|
@@ -1538,6 +1538,7 @@
|
|
|
1538
1538
|
partInBusiness: defaultValidator(),
|
|
1539
1539
|
regionRetail: defaultSelectValidator('Выберите филиал банка'),
|
|
1540
1540
|
addressRetail: defaultSelectValidator('Выберите адрес банка'),
|
|
1541
|
+
addressMatch: defaultValidator(),
|
|
1541
1542
|
};
|
|
1542
1543
|
const getObjectValidator = (inputs) => {
|
|
1543
1544
|
const requiredInputs = getNamesFromInput(inputs.filter((_) => Boolean(_?.required)));
|
|
@@ -1679,6 +1680,40 @@
|
|
|
1679
1680
|
})), ...getValidation(field('addressBranch'), validatorObj.addressBranch, input?.required), isSearch: true }));
|
|
1680
1681
|
});
|
|
1681
1682
|
|
|
1683
|
+
const AddressFactField = JSX(({ field, input }) => {
|
|
1684
|
+
const fieldName = 'addressFact';
|
|
1685
|
+
const fieldValue = field(fieldName).value;
|
|
1686
|
+
const { value } = field('addressMatch');
|
|
1687
|
+
useEffect(() => {
|
|
1688
|
+
if (value) {
|
|
1689
|
+
field('addressFact')?.onChange?.(field('addressRegistration').value);
|
|
1690
|
+
}
|
|
1691
|
+
}, [value]);
|
|
1692
|
+
const onDaDataChange = useCallback((item) => {
|
|
1693
|
+
field?.(fieldName)?.onChange?.({
|
|
1694
|
+
apartment: item?.data?.flat,
|
|
1695
|
+
city: item?.data?.city,
|
|
1696
|
+
district: item?.data?.area_with_type,
|
|
1697
|
+
fullAddress: item?.value,
|
|
1698
|
+
fiasCode: item?.data?.fias_id,
|
|
1699
|
+
house: item?.data?.house,
|
|
1700
|
+
locality: item?.data?.settlement_with_type,
|
|
1701
|
+
okatoRegionCode: item?.data?.okato,
|
|
1702
|
+
postcode: item?.data?.postal_code,
|
|
1703
|
+
region: item?.data?.region,
|
|
1704
|
+
regionCode: item?.data?.region_kladr_id ? item?.data?.region_kladr_id.substring(0, 2) : '',
|
|
1705
|
+
street: item?.data?.house,
|
|
1706
|
+
});
|
|
1707
|
+
}, []);
|
|
1708
|
+
const onChange = useCallback((val) => {
|
|
1709
|
+
field?.(fieldName)?.onChange?.({
|
|
1710
|
+
...field(fieldName).value,
|
|
1711
|
+
fullAddress: val,
|
|
1712
|
+
});
|
|
1713
|
+
}, []);
|
|
1714
|
+
return (jsx(InputControl, { label: "\u0410\u0434\u0440\u0435\u0441", disabled: value, ...getValidation(field(fieldName), validatorObj[fieldName], input?.required), value: fieldValue.fullAddress, onChange: onChange, ...input, onDaDataChange: onDaDataChange }));
|
|
1715
|
+
});
|
|
1716
|
+
|
|
1682
1717
|
const AddressField = JSX(({ field, input }) => {
|
|
1683
1718
|
const fieldName = input?.name || 'addressRegistration';
|
|
1684
1719
|
const fieldValue = field(fieldName).value;
|
|
@@ -1707,6 +1742,45 @@
|
|
|
1707
1742
|
return (jsx(InputControl, { label: "\u0410\u0434\u0440\u0435\u0441", ...getValidation(field(fieldName), validatorObj[fieldName], input?.required), value: fieldValue.fullAddress, onChange: onChange, ...input, onDaDataChange: onDaDataChange }));
|
|
1708
1743
|
});
|
|
1709
1744
|
|
|
1745
|
+
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
1746
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
|
|
1747
|
+
const resultOptions = { ...commonOptions, ...options };
|
|
1748
|
+
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
1749
|
+
}) }));
|
|
1750
|
+
});
|
|
1751
|
+
|
|
1752
|
+
const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
|
|
1753
|
+
|
|
1754
|
+
const CHECK_PATHS = [
|
|
1755
|
+
{
|
|
1756
|
+
d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
|
|
1757
|
+
fillRule: 'evenodd',
|
|
1758
|
+
clipRule: 'evenodd',
|
|
1759
|
+
fill: 'white',
|
|
1760
|
+
},
|
|
1761
|
+
];
|
|
1762
|
+
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
1763
|
+
const handleChange = useCallback((e) => {
|
|
1764
|
+
if (disabled) {
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
e.preventDefault();
|
|
1768
|
+
onChange && onChange(!value);
|
|
1769
|
+
}, [onChange, disabled, value]);
|
|
1770
|
+
const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
|
|
1771
|
+
return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled), "aria-label": text }), value ? icon : null, renderText$3(text)] }) }));
|
|
1772
|
+
});
|
|
1773
|
+
const renderText$3 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
|
|
1774
|
+
const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
|
|
1775
|
+
const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
|
|
1776
|
+
const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
|
|
1777
|
+
|
|
1778
|
+
const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
|
|
1779
|
+
|
|
1780
|
+
const AddressMatchField = JSX(({ field }) => {
|
|
1781
|
+
return (jsx(CheckboxWithError, { text: "\u0410\u0434\u0440\u0435\u0441 \u0444\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043C\u0435\u0441\u0442\u0430 \u0436\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u0435\u0442 \u0441 \u0430\u0434\u0440\u0435\u0441\u043E\u043C \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438", ...getValidation(field('addressMatch'), validatorObj.addressMatch) }));
|
|
1782
|
+
});
|
|
1783
|
+
|
|
1710
1784
|
const useNormalizedInput = (props, { normalize, format }) => {
|
|
1711
1785
|
const { value, onFocus, onBlur, onChange } = props;
|
|
1712
1786
|
const [isFocused, setIsFocused] = useState(false);
|
|
@@ -1799,41 +1873,6 @@
|
|
|
1799
1873
|
|
|
1800
1874
|
const AnnualRevenueField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...getValidation(field('annualRevenue'), validatorObj.annualRevenue, input?.required) })));
|
|
1801
1875
|
|
|
1802
|
-
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
1803
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
|
|
1804
|
-
const resultOptions = { ...commonOptions, ...options };
|
|
1805
|
-
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
1806
|
-
}) }));
|
|
1807
|
-
});
|
|
1808
|
-
|
|
1809
|
-
const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
|
|
1810
|
-
|
|
1811
|
-
const CHECK_PATHS = [
|
|
1812
|
-
{
|
|
1813
|
-
d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
|
|
1814
|
-
fillRule: 'evenodd',
|
|
1815
|
-
clipRule: 'evenodd',
|
|
1816
|
-
fill: 'white',
|
|
1817
|
-
},
|
|
1818
|
-
];
|
|
1819
|
-
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
1820
|
-
const handleChange = useCallback((e) => {
|
|
1821
|
-
if (disabled) {
|
|
1822
|
-
return;
|
|
1823
|
-
}
|
|
1824
|
-
e.preventDefault();
|
|
1825
|
-
onChange && onChange(!value);
|
|
1826
|
-
}, [onChange, disabled, value]);
|
|
1827
|
-
const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
|
|
1828
|
-
return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled), "aria-label": text }), value ? icon : null, renderText$3(text)] }) }));
|
|
1829
|
-
});
|
|
1830
|
-
const renderText$3 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
|
|
1831
|
-
const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
|
|
1832
|
-
const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
|
|
1833
|
-
const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
|
|
1834
|
-
|
|
1835
|
-
const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
|
|
1836
|
-
|
|
1837
1876
|
const ArmyIdFlgField = JSX(({ field }) => (jsx(CheckboxWithError, { text: "\u041D\u0430\u043B\u0438\u0447\u0438\u0435 \u0432\u043E\u0435\u043D\u043D\u043E\u0433\u043E \u0431\u0438\u043B\u0435\u0442\u0430", ...getValidation(field('armyIdFlg'), validatorObj.armyIdFlg) })));
|
|
1838
1877
|
|
|
1839
1878
|
const BankEmpoleeCodeField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u0434 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044F \u0411\u0430\u043D\u043A\u0430", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0434", type: "number", ...getValidation(field('bankEmployeeCode'), validatorObj.bankEmployeeCode, input?.required), ...input })));
|
|
@@ -3212,7 +3251,7 @@
|
|
|
3212
3251
|
experience5Years: jsx(Experience5YearsField, { field: field, input: input }),
|
|
3213
3252
|
jobsNumber: jsx(JobsNumberField, { field: field, input: input }),
|
|
3214
3253
|
beginDate: jsx(BeginDateField, { field: field, input: input }),
|
|
3215
|
-
addressFact: jsx(
|
|
3254
|
+
addressFact: jsx(AddressFactField, { field: field, input: input }),
|
|
3216
3255
|
organizationAddress: jsx(AddressField, { field: field, input: input }),
|
|
3217
3256
|
comment: jsx(CommentField, { field: field, input: input }),
|
|
3218
3257
|
addressBranch: jsx(AddressBranchField, { field: field, input: input, isPremium: isPremium }),
|
|
@@ -3282,6 +3321,7 @@
|
|
|
3282
3321
|
partInBusiness: jsx(PartInBusinessField, { field: field, input: input }),
|
|
3283
3322
|
regionRetail: jsx(RetailRegionField, { field: field, input: input }),
|
|
3284
3323
|
addressRetail: jsx(RetailAddressField, { field: field, input: input }),
|
|
3324
|
+
addressMatch: jsx(AddressMatchField, { field: field, input: input }),
|
|
3285
3325
|
};
|
|
3286
3326
|
return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name || ''] }, String(i))) : null;
|
|
3287
3327
|
};
|
|
@@ -4073,10 +4113,58 @@
|
|
|
4073
4113
|
|
|
4074
4114
|
const updateProfileEsia = (body) => doRequest('/esia/updateProfileEsia', 'POST', body);
|
|
4075
4115
|
|
|
4116
|
+
const parseEsiaProfile = (esiaProfile) => {
|
|
4117
|
+
const { profile, addInfo, document, addressRegistration, addressFact } = esiaProfile;
|
|
4118
|
+
return {
|
|
4119
|
+
name: profile?.name,
|
|
4120
|
+
surname: profile?.surname,
|
|
4121
|
+
middleName: profile?.midname,
|
|
4122
|
+
birthday: profile?.birthDate,
|
|
4123
|
+
phone: normalizePhone(profile?.phone),
|
|
4124
|
+
email: profile?.email,
|
|
4125
|
+
dulIssueDateField: document?.dulIssueDate,
|
|
4126
|
+
dulIssuedBy: document?.dulIssuedBy,
|
|
4127
|
+
dulNumber: document?.dulNumber,
|
|
4128
|
+
dulSerie: document?.dulSerie,
|
|
4129
|
+
dulSubdivisionCode: document?.dulSubdivisionCode,
|
|
4130
|
+
snils: addInfo?.snils,
|
|
4131
|
+
birthPlace: addInfo?.birthPlace,
|
|
4132
|
+
addressRegistration: buildAddress(addressRegistration),
|
|
4133
|
+
addressFact: buildAddress(addressFact),
|
|
4134
|
+
};
|
|
4135
|
+
};
|
|
4136
|
+
const concatFullAddress = (address) => {
|
|
4137
|
+
return address.reduce((acc, value) => {
|
|
4138
|
+
if (value) {
|
|
4139
|
+
return acc ? `${acc}, ${value}` : value;
|
|
4140
|
+
}
|
|
4141
|
+
return acc;
|
|
4142
|
+
}, '');
|
|
4143
|
+
};
|
|
4144
|
+
const buildAddress = (fields) => {
|
|
4145
|
+
const { postcode, region, regionCode, locality, city, street, house, building, block, apartment, } = fields;
|
|
4146
|
+
const place = locality || city;
|
|
4147
|
+
const fullAddress = concatFullAddress([
|
|
4148
|
+
postcode,
|
|
4149
|
+
region,
|
|
4150
|
+
place,
|
|
4151
|
+
street ? `ул ${street}` : undefined,
|
|
4152
|
+
house ? `д ${house}` : undefined,
|
|
4153
|
+
block ? `к ${block}` : undefined,
|
|
4154
|
+
building ? `стр ${building}` : undefined,
|
|
4155
|
+
apartment ? `кв ${apartment}` : undefined,
|
|
4156
|
+
]);
|
|
4157
|
+
return {
|
|
4158
|
+
...fields,
|
|
4159
|
+
regionCode: regionCode?.key,
|
|
4160
|
+
fullAddress,
|
|
4161
|
+
};
|
|
4162
|
+
};
|
|
4163
|
+
|
|
4076
4164
|
const useInitApplicationLead = (nextStepLink) => {
|
|
4077
4165
|
const [isLoading, setIsLoading] = useState(false);
|
|
4078
4166
|
const [profileId] = useLocalStorage('profileId');
|
|
4079
|
-
const [,
|
|
4167
|
+
const [leadForm, setLeadForm] = useLocalStorage('leadForm');
|
|
4080
4168
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
4081
4169
|
const code = params.get('code');
|
|
4082
4170
|
const state = params.get('state');
|
|
@@ -4088,7 +4176,10 @@
|
|
|
4088
4176
|
state,
|
|
4089
4177
|
redirectUri: globalThis.location?.href,
|
|
4090
4178
|
});
|
|
4091
|
-
|
|
4179
|
+
setLeadForm({
|
|
4180
|
+
...leadForm,
|
|
4181
|
+
...parseEsiaProfile(data),
|
|
4182
|
+
});
|
|
4092
4183
|
globalThis.location.href = nextStepLink;
|
|
4093
4184
|
}
|
|
4094
4185
|
}, []);
|
|
@@ -4098,7 +4189,6 @@
|
|
|
4098
4189
|
updateEsiaProfile();
|
|
4099
4190
|
}
|
|
4100
4191
|
else {
|
|
4101
|
-
setEsiaData('');
|
|
4102
4192
|
sessionStorage.removeItem('accessToken');
|
|
4103
4193
|
sessionStorage.removeItem('refreshToken');
|
|
4104
4194
|
}
|
|
@@ -5771,6 +5861,7 @@
|
|
|
5771
5861
|
fullAddress: '',
|
|
5772
5862
|
fiasCode: '',
|
|
5773
5863
|
},
|
|
5864
|
+
addressMatch: false,
|
|
5774
5865
|
participantDateRegistration: undefined,
|
|
5775
5866
|
addressFact: {
|
|
5776
5867
|
fullAddress: '',
|
|
@@ -6056,7 +6147,10 @@
|
|
|
6056
6147
|
inputs: [],
|
|
6057
6148
|
},
|
|
6058
6149
|
{
|
|
6059
|
-
inputs: [
|
|
6150
|
+
inputs: [
|
|
6151
|
+
{ fieldType: 'common', name: 'addressRegistration', required: true, dadata: true },
|
|
6152
|
+
{ fieldType: 'common', name: 'addressMatch' },
|
|
6153
|
+
],
|
|
6060
6154
|
},
|
|
6061
6155
|
{
|
|
6062
6156
|
columns: 2,
|
|
@@ -6064,11 +6158,14 @@
|
|
|
6064
6158
|
},
|
|
6065
6159
|
{
|
|
6066
6160
|
title: 'Адрес фактического проживания (место пребывания РФ)',
|
|
6161
|
+
inputs: [],
|
|
6162
|
+
},
|
|
6163
|
+
{
|
|
6067
6164
|
columns: 2,
|
|
6068
|
-
inputs: [
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
],
|
|
6165
|
+
inputs: [{ fieldType: 'common', name: 'housing' }],
|
|
6166
|
+
},
|
|
6167
|
+
{
|
|
6168
|
+
inputs: [{ fieldType: 'common', name: 'addressFact', required: true, dadata: true }],
|
|
6072
6169
|
},
|
|
6073
6170
|
],
|
|
6074
6171
|
[
|
|
@@ -6153,8 +6250,11 @@
|
|
|
6153
6250
|
inputs: [{ fieldType: 'common', name: 'dependents', required: true }],
|
|
6154
6251
|
},
|
|
6155
6252
|
{
|
|
6156
|
-
columns:
|
|
6157
|
-
inputs: [
|
|
6253
|
+
columns: 2,
|
|
6254
|
+
inputs: [
|
|
6255
|
+
{ fieldType: 'common', name: 'familyMembers', required: true },
|
|
6256
|
+
{ fieldType: 'common', name: 'children', required: true },
|
|
6257
|
+
],
|
|
6158
6258
|
},
|
|
6159
6259
|
{
|
|
6160
6260
|
title: 'Совокупный доход',
|
|
@@ -8152,7 +8252,7 @@
|
|
|
8152
8252
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
8153
8253
|
});
|
|
8154
8254
|
|
|
8155
|
-
const packageVersion = "0.14.
|
|
8255
|
+
const packageVersion = "0.14.636";
|
|
8156
8256
|
|
|
8157
8257
|
exports.Blocks = Blocks;
|
|
8158
8258
|
exports.ContentPage = ContentPage;
|