@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
@@ -1323,7 +1323,7 @@
1323
1323
  return inputRef;
1324
1324
  }
1325
1325
 
1326
- const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onDaDataChange, onBlur, isTextarea, type, name = '', daDataQueryPrefix, inputLength, dadata = false, }) => {
1326
+ const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onDaDataChange, onBlur, isTextarea, type, name = '', daDataQueryPrefix, inputLength, dadata = false, disabled = false, }) => {
1327
1327
  const [isOpen, { setFalse: close, setTrue: open }] = useBool();
1328
1328
  const popupRef = useOutsideClick(close);
1329
1329
  const handleChange = useCallback((v) => (inputLength ? v.length <= inputLength && onChange(v) : onChange(v)), [onChange]);
@@ -1335,7 +1335,7 @@
1335
1335
  onChange,
1336
1336
  onDaDataChange,
1337
1337
  });
1338
- 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)] }));
1338
+ 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)] }));
1339
1339
  });
1340
1340
  const getPlaceholder = (placeholder, errors, label) => errors && !label ? `${placeholder}*` : placeholder;
1341
1341
 
@@ -1530,6 +1530,7 @@
1530
1530
  partInBusiness: defaultValidator(),
1531
1531
  regionRetail: defaultSelectValidator('Выберите филиал банка'),
1532
1532
  addressRetail: defaultSelectValidator('Выберите адрес банка'),
1533
+ addressMatch: defaultValidator(),
1533
1534
  };
1534
1535
  const getObjectValidator = (inputs) => {
1535
1536
  const requiredInputs = getNamesFromInput(inputs.filter((_) => Boolean(_?.required)));
@@ -1671,6 +1672,40 @@
1671
1672
  })), ...getValidation(field('addressBranch'), validatorObj.addressBranch, input?.required), isSearch: true }));
1672
1673
  });
1673
1674
 
1675
+ const AddressFactField = JSX(({ field, input }) => {
1676
+ const fieldName = 'addressFact';
1677
+ const fieldValue = field(fieldName).value;
1678
+ const { value } = field('addressMatch');
1679
+ useEffect(() => {
1680
+ if (value) {
1681
+ field('addressFact')?.onChange?.(field('addressRegistration').value);
1682
+ }
1683
+ }, [value]);
1684
+ const onDaDataChange = useCallback((item) => {
1685
+ field?.(fieldName)?.onChange?.({
1686
+ apartment: item?.data?.flat,
1687
+ city: item?.data?.city,
1688
+ district: item?.data?.area_with_type,
1689
+ fullAddress: item?.value,
1690
+ fiasCode: item?.data?.fias_id,
1691
+ house: item?.data?.house,
1692
+ locality: item?.data?.settlement_with_type,
1693
+ okatoRegionCode: item?.data?.okato,
1694
+ postcode: item?.data?.postal_code,
1695
+ region: item?.data?.region,
1696
+ regionCode: item?.data?.region_kladr_id ? item?.data?.region_kladr_id.substring(0, 2) : '',
1697
+ street: item?.data?.house,
1698
+ });
1699
+ }, []);
1700
+ const onChange = useCallback((val) => {
1701
+ field?.(fieldName)?.onChange?.({
1702
+ ...field(fieldName).value,
1703
+ fullAddress: val,
1704
+ });
1705
+ }, []);
1706
+ 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 }));
1707
+ });
1708
+
1674
1709
  const AddressField = JSX(({ field, input }) => {
1675
1710
  const fieldName = input?.name || 'addressRegistration';
1676
1711
  const fieldValue = field(fieldName).value;
@@ -1699,6 +1734,45 @@
1699
1734
  return (jsx(InputControl, { label: "\u0410\u0434\u0440\u0435\u0441", ...getValidation(field(fieldName), validatorObj[fieldName], input?.required), value: fieldValue.fullAddress, onChange: onChange, ...input, onDaDataChange: onDaDataChange }));
1700
1735
  });
1701
1736
 
1737
+ const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1738
+ 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) => {
1739
+ const resultOptions = { ...commonOptions, ...options };
1740
+ return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1741
+ }) }));
1742
+ });
1743
+
1744
+ const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
1745
+
1746
+ const CHECK_PATHS = [
1747
+ {
1748
+ 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',
1749
+ fillRule: 'evenodd',
1750
+ clipRule: 'evenodd',
1751
+ fill: 'white',
1752
+ },
1753
+ ];
1754
+ const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1755
+ const handleChange = useCallback((e) => {
1756
+ if (disabled) {
1757
+ return;
1758
+ }
1759
+ e.preventDefault();
1760
+ onChange && onChange(!value);
1761
+ }, [onChange, disabled, value]);
1762
+ 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" }));
1763
+ 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$2(text)] }) }));
1764
+ });
1765
+ const renderText$2 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
1766
+ const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
1767
+ const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
1768
+ const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
1769
+
1770
+ 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)] })));
1771
+
1772
+ const AddressMatchField = JSX(({ field }) => {
1773
+ 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) }));
1774
+ });
1775
+
1702
1776
  const useNormalizedInput = (props, { normalize, format }) => {
1703
1777
  const { value, onFocus, onBlur, onChange } = props;
1704
1778
  const [isFocused, setIsFocused] = useState(false);
@@ -1791,41 +1865,6 @@
1791
1865
 
1792
1866
  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) })));
1793
1867
 
1794
- const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1795
- 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) => {
1796
- const resultOptions = { ...commonOptions, ...options };
1797
- return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1798
- }) }));
1799
- });
1800
-
1801
- const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
1802
-
1803
- const CHECK_PATHS = [
1804
- {
1805
- 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',
1806
- fillRule: 'evenodd',
1807
- clipRule: 'evenodd',
1808
- fill: 'white',
1809
- },
1810
- ];
1811
- const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1812
- const handleChange = useCallback((e) => {
1813
- if (disabled) {
1814
- return;
1815
- }
1816
- e.preventDefault();
1817
- onChange && onChange(!value);
1818
- }, [onChange, disabled, value]);
1819
- 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" }));
1820
- 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$2(text)] }) }));
1821
- });
1822
- const renderText$2 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
1823
- const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
1824
- const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
1825
- const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
1826
-
1827
- 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)] })));
1828
-
1829
1868
  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) })));
1830
1869
 
1831
1870
  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 })));
@@ -3204,7 +3243,7 @@
3204
3243
  experience5Years: jsx(Experience5YearsField, { field: field, input: input }),
3205
3244
  jobsNumber: jsx(JobsNumberField, { field: field, input: input }),
3206
3245
  beginDate: jsx(BeginDateField, { field: field, input: input }),
3207
- addressFact: jsx(AddressField, { field: field, input: input }),
3246
+ addressFact: jsx(AddressFactField, { field: field, input: input }),
3208
3247
  organizationAddress: jsx(AddressField, { field: field, input: input }),
3209
3248
  comment: jsx(CommentField, { field: field, input: input }),
3210
3249
  addressBranch: jsx(AddressBranchField, { field: field, input: input, isPremium: isPremium }),
@@ -3274,6 +3313,7 @@
3274
3313
  partInBusiness: jsx(PartInBusinessField, { field: field, input: input }),
3275
3314
  regionRetail: jsx(RetailRegionField, { field: field, input: input }),
3276
3315
  addressRetail: jsx(RetailAddressField, { field: field, input: input }),
3316
+ addressMatch: jsx(AddressMatchField, { field: field, input: input }),
3277
3317
  };
3278
3318
  return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name || ''] }, String(i))) : null;
3279
3319
  };
@@ -4065,10 +4105,58 @@
4065
4105
 
4066
4106
  const updateProfileEsia = (body) => doRequest('/esia/updateProfileEsia', 'POST', body);
4067
4107
 
4108
+ const parseEsiaProfile = (esiaProfile) => {
4109
+ const { profile, addInfo, document, addressRegistration, addressFact } = esiaProfile;
4110
+ return {
4111
+ name: profile?.name,
4112
+ surname: profile?.surname,
4113
+ middleName: profile?.midname,
4114
+ birthday: profile?.birthDate,
4115
+ phone: normalizePhone(profile?.phone),
4116
+ email: profile?.email,
4117
+ dulIssueDateField: document?.dulIssueDate,
4118
+ dulIssuedBy: document?.dulIssuedBy,
4119
+ dulNumber: document?.dulNumber,
4120
+ dulSerie: document?.dulSerie,
4121
+ dulSubdivisionCode: document?.dulSubdivisionCode,
4122
+ snils: addInfo?.snils,
4123
+ birthPlace: addInfo?.birthPlace,
4124
+ addressRegistration: buildAddress(addressRegistration),
4125
+ addressFact: buildAddress(addressFact),
4126
+ };
4127
+ };
4128
+ const concatFullAddress = (address) => {
4129
+ return address.reduce((acc, value) => {
4130
+ if (value) {
4131
+ return acc ? `${acc}, ${value}` : value;
4132
+ }
4133
+ return acc;
4134
+ }, '');
4135
+ };
4136
+ const buildAddress = (fields) => {
4137
+ const { postcode, region, regionCode, locality, city, street, house, building, block, apartment, } = fields;
4138
+ const place = locality || city;
4139
+ const fullAddress = concatFullAddress([
4140
+ postcode,
4141
+ region,
4142
+ place,
4143
+ street ? `ул ${street}` : undefined,
4144
+ house ? `д ${house}` : undefined,
4145
+ block ? `к ${block}` : undefined,
4146
+ building ? `стр ${building}` : undefined,
4147
+ apartment ? `кв ${apartment}` : undefined,
4148
+ ]);
4149
+ return {
4150
+ ...fields,
4151
+ regionCode: regionCode?.key,
4152
+ fullAddress,
4153
+ };
4154
+ };
4155
+
4068
4156
  const useInitApplicationLead = (nextStepLink) => {
4069
4157
  const [isLoading, setIsLoading] = useState(false);
4070
4158
  const [profileId] = useLocalStorage('profileId');
4071
- const [, setEsiaData] = useLocalStorage('esiaData');
4159
+ const [leadForm, setLeadForm] = useLocalStorage('leadForm');
4072
4160
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
4073
4161
  const code = params.get('code');
4074
4162
  const state = params.get('state');
@@ -4080,7 +4168,10 @@
4080
4168
  state,
4081
4169
  redirectUri: globalThis.location?.href,
4082
4170
  });
4083
- setEsiaData(JSON.stringify(data));
4171
+ setLeadForm({
4172
+ ...leadForm,
4173
+ ...parseEsiaProfile(data),
4174
+ });
4084
4175
  globalThis.location.href = nextStepLink;
4085
4176
  }
4086
4177
  }, []);
@@ -4090,7 +4181,6 @@
4090
4181
  updateEsiaProfile();
4091
4182
  }
4092
4183
  else {
4093
- setEsiaData('');
4094
4184
  sessionStorage.removeItem('accessToken');
4095
4185
  sessionStorage.removeItem('refreshToken');
4096
4186
  }
@@ -5799,6 +5889,7 @@
5799
5889
  fullAddress: '',
5800
5890
  fiasCode: '',
5801
5891
  },
5892
+ addressMatch: false,
5802
5893
  participantDateRegistration: undefined,
5803
5894
  addressFact: {
5804
5895
  fullAddress: '',
@@ -6084,7 +6175,10 @@
6084
6175
  inputs: [],
6085
6176
  },
6086
6177
  {
6087
- inputs: [{ fieldType: 'common', name: 'addressRegistration', required: true, dadata: true }],
6178
+ inputs: [
6179
+ { fieldType: 'common', name: 'addressRegistration', required: true, dadata: true },
6180
+ { fieldType: 'common', name: 'addressMatch' },
6181
+ ],
6088
6182
  },
6089
6183
  {
6090
6184
  columns: 2,
@@ -6092,11 +6186,14 @@
6092
6186
  },
6093
6187
  {
6094
6188
  title: 'Адрес фактического проживания (место пребывания РФ)',
6189
+ inputs: [],
6190
+ },
6191
+ {
6095
6192
  columns: 2,
6096
- inputs: [
6097
- { fieldType: 'common', name: 'addressFact', required: true, dadata: true },
6098
- { fieldType: 'common', name: 'housing' },
6099
- ],
6193
+ inputs: [{ fieldType: 'common', name: 'housing' }],
6194
+ },
6195
+ {
6196
+ inputs: [{ fieldType: 'common', name: 'addressFact', required: true, dadata: true }],
6100
6197
  },
6101
6198
  ],
6102
6199
  [
@@ -6181,8 +6278,11 @@
6181
6278
  inputs: [{ fieldType: 'common', name: 'dependents', required: true }],
6182
6279
  },
6183
6280
  {
6184
- columns: 1,
6185
- inputs: [{ fieldType: 'common', name: 'familyMembers', required: true }],
6281
+ columns: 2,
6282
+ inputs: [
6283
+ { fieldType: 'common', name: 'familyMembers', required: true },
6284
+ { fieldType: 'common', name: 'children', required: true },
6285
+ ],
6186
6286
  },
6187
6287
  {
6188
6288
  title: 'Совокупный доход',
@@ -8546,7 +8646,7 @@
8546
8646
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
8547
8647
  });
8548
8648
 
8549
- const packageVersion = "0.14.634";
8649
+ const packageVersion = "0.14.636";
8550
8650
 
8551
8651
  exports.Blocks = Blocks;
8552
8652
  exports.ContentPage = ContentPage;