@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.
Files changed (148) hide show
  1. package/bundle/api/RetailAPI/updateProfileEsia.d.ts +7 -7
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +149 -49
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  6. package/bundle/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
  7. package/bundle/components/CreditForm/getInitialFormState.d.ts +1 -0
  8. package/bundle/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
  9. package/bundle/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
  10. package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  11. package/dist/api/RetailAPI/updateProfileEsia.d.ts +7 -7
  12. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  13. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  14. package/dist/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
  15. package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +52 -0
  16. package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
  17. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
  18. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  19. package/dist/components/CreditForm/creditFormStepsData.js +16 -7
  20. package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  21. package/dist/components/CreditForm/getInitialFormState.d.ts +1 -0
  22. package/dist/components/CreditForm/getInitialFormState.js +1 -0
  23. package/dist/components/CreditForm/getInitialFormState.js.map +1 -1
  24. package/dist/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
  25. package/dist/ui-kit/FormField/Fields/AddressFactField.js +42 -0
  26. package/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -0
  27. package/dist/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
  28. package/dist/ui-kit/FormField/Fields/AddressMatchField.js +11 -0
  29. package/dist/ui-kit/FormField/Fields/AddressMatchField.js.map +1 -0
  30. package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  31. package/dist/ui-kit/FormField/getField.js +4 -1
  32. package/dist/ui-kit/FormField/getField.js.map +1 -1
  33. package/dist/ui-kit/FormField/getObjectValidator.js +1 -0
  34. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  35. package/dist/ui-kit/Input/InputControl.js +2 -2
  36. package/dist/ui-kit/Input/InputControl.js.map +1 -1
  37. package/lib/api/RetailAPI/updateProfileEsia.d.ts +7 -7
  38. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  39. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  40. package/lib/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
  41. package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +49 -0
  42. package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
  43. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
  44. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  45. package/lib/components/CreditForm/creditFormStepsData.js +16 -7
  46. package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  47. package/lib/components/CreditForm/getInitialFormState.d.ts +1 -0
  48. package/lib/components/CreditForm/getInitialFormState.js +1 -0
  49. package/lib/components/CreditForm/getInitialFormState.js.map +1 -1
  50. package/lib/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
  51. package/lib/ui-kit/FormField/Fields/AddressFactField.js +40 -0
  52. package/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -0
  53. package/lib/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
  54. package/lib/ui-kit/FormField/Fields/AddressMatchField.js +9 -0
  55. package/lib/ui-kit/FormField/Fields/AddressMatchField.js.map +1 -0
  56. package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  57. package/lib/ui-kit/FormField/getField.js +4 -1
  58. package/lib/ui-kit/FormField/getField.js.map +1 -1
  59. package/lib/ui-kit/FormField/getObjectValidator.js +1 -0
  60. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  61. package/lib/ui-kit/Input/InputControl.js +2 -2
  62. package/lib/ui-kit/Input/InputControl.js.map +1 -1
  63. package/mobile/bundle/api/RetailAPI/updateProfileEsia.d.ts +7 -7
  64. package/mobile/bundle/bundle.umd.js +149 -49
  65. package/mobile/bundle/bundle.umd.min.js +1 -1
  66. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  67. package/mobile/bundle/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
  68. package/mobile/bundle/components/CreditForm/getInitialFormState.d.ts +1 -0
  69. package/mobile/bundle/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
  70. package/mobile/bundle/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
  71. package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  72. package/mobile/dist/api/RetailAPI/updateProfileEsia.d.ts +7 -7
  73. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  74. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  75. package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
  76. package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +52 -0
  77. package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
  78. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
  79. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  80. package/mobile/dist/components/CreditForm/creditFormStepsData.js +16 -7
  81. package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  82. package/mobile/dist/components/CreditForm/getInitialFormState.d.ts +1 -0
  83. package/mobile/dist/components/CreditForm/getInitialFormState.js +1 -0
  84. package/mobile/dist/components/CreditForm/getInitialFormState.js.map +1 -1
  85. package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
  86. package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js +42 -0
  87. package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -0
  88. package/mobile/dist/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
  89. package/mobile/dist/ui-kit/FormField/Fields/AddressMatchField.js +11 -0
  90. package/mobile/dist/ui-kit/FormField/Fields/AddressMatchField.js.map +1 -0
  91. package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  92. package/mobile/dist/ui-kit/FormField/getField.js +4 -1
  93. package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
  94. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -0
  95. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  96. package/mobile/dist/ui-kit/Input/InputControl.js +2 -2
  97. package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
  98. package/mobile/lib/api/RetailAPI/updateProfileEsia.d.ts +7 -7
  99. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  100. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  101. package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.d.ts +3 -0
  102. package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +49 -0
  103. package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -0
  104. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -3
  105. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  106. package/mobile/lib/components/CreditForm/creditFormStepsData.js +16 -7
  107. package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  108. package/mobile/lib/components/CreditForm/getInitialFormState.d.ts +1 -0
  109. package/mobile/lib/components/CreditForm/getInitialFormState.js +1 -0
  110. package/mobile/lib/components/CreditForm/getInitialFormState.js.map +1 -1
  111. package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.d.ts +2 -0
  112. package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js +40 -0
  113. package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -0
  114. package/mobile/lib/ui-kit/FormField/Fields/AddressMatchField.d.ts +2 -0
  115. package/mobile/lib/ui-kit/FormField/Fields/AddressMatchField.js +9 -0
  116. package/mobile/lib/ui-kit/FormField/Fields/AddressMatchField.js.map +1 -0
  117. package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  118. package/mobile/lib/ui-kit/FormField/getField.js +4 -1
  119. package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
  120. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +1 -0
  121. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  122. package/mobile/lib/ui-kit/Input/InputControl.js +2 -2
  123. package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
  124. package/mobile/src/api/RetailAPI/updateProfileEsia.ts +7 -7
  125. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -0
  126. package/mobile/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +69 -0
  127. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -3
  128. package/mobile/src/components/CreditForm/creditFormStepsData.tsx +16 -7
  129. package/mobile/src/components/CreditForm/getInitialFormState.tsx +3 -0
  130. package/mobile/src/ui-kit/FormField/Fields/AddressFactField.tsx +55 -0
  131. package/mobile/src/ui-kit/FormField/Fields/AddressMatchField.tsx +14 -0
  132. package/mobile/src/ui-kit/FormField/NameFieldDef.ts +2 -1
  133. package/mobile/src/ui-kit/FormField/getField.tsx +4 -1
  134. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
  135. package/mobile/src/ui-kit/Input/InputControl.tsx +2 -0
  136. package/package.json +1 -1
  137. package/src/api/RetailAPI/updateProfileEsia.ts +7 -7
  138. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -0
  139. package/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +69 -0
  140. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -3
  141. package/src/components/CreditForm/creditFormStepsData.tsx +16 -7
  142. package/src/components/CreditForm/getInitialFormState.tsx +3 -0
  143. package/src/ui-kit/FormField/Fields/AddressFactField.tsx +55 -0
  144. package/src/ui-kit/FormField/Fields/AddressMatchField.tsx +14 -0
  145. package/src/ui-kit/FormField/NameFieldDef.ts +2 -1
  146. package/src/ui-kit/FormField/getField.tsx +4 -1
  147. package/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
  148. 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(AddressField, { field: field, input: input }),
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 [, setEsiaData] = useLocalStorage('esiaData');
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
- setEsiaData(JSON.stringify(data));
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: [{ fieldType: 'common', name: 'addressRegistration', required: true, dadata: true }],
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
- { fieldType: 'common', name: 'addressFact', required: true, dadata: true },
6070
- { fieldType: 'common', name: 'housing' },
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: 1,
6157
- inputs: [{ fieldType: 'common', name: 'familyMembers', required: true }],
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.634";
8255
+ const packageVersion = "0.14.636";
8156
8256
 
8157
8257
  exports.Blocks = Blocks;
8158
8258
  exports.ContentPage = ContentPage;