@redneckz/wildless-cms-uni-blocks 0.14.235 → 0.14.237

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 (110) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +16 -7
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  5. package/bundle/hooks/{usePremiumBranchesByRegions.d.ts → useBranchesByRegions.d.ts} +1 -1
  6. package/dist/api/LeadServiceAPI.js +2 -1
  7. package/dist/api/LeadServiceAPI.js.map +1 -1
  8. package/dist/components/ApplicationFormCustom/AddressBranchField.js +2 -2
  9. package/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  10. package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  11. package/dist/components/ApplicationFormCustom/PosTerminalField.js +1 -1
  12. package/dist/components/ApplicationFormCustom/PosTerminalField.js.map +1 -1
  13. package/dist/components/ApplicationFormCustom/RegionPremiumField.js +2 -2
  14. package/dist/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -1
  15. package/dist/components/ApplicationFormCustom/VedField.js +7 -0
  16. package/dist/components/ApplicationFormCustom/VedField.js.map +1 -1
  17. package/dist/components/ApplicationFormCustom/getField.js +1 -0
  18. package/dist/components/ApplicationFormCustom/getField.js.map +1 -1
  19. package/dist/components/ApplicationFormCustom/getInitialFormState.js +1 -0
  20. package/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  21. package/dist/hooks/{usePremiumBranchesByRegions.d.ts → useBranchesByRegions.d.ts} +1 -1
  22. package/{mobile/dist/hooks/usePremiumBranchesByRegions.js → dist/hooks/useBranchesByRegions.js} +5 -5
  23. package/dist/hooks/useBranchesByRegions.js.map +1 -0
  24. package/lib/api/LeadServiceAPI.js +2 -1
  25. package/lib/api/LeadServiceAPI.js.map +1 -1
  26. package/lib/components/ApplicationFormCustom/AddressBranchField.js +2 -2
  27. package/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  28. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.fixture.d.ts +1 -0
  29. package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  30. package/lib/components/ApplicationFormCustom/PosTerminalField.js +1 -1
  31. package/lib/components/ApplicationFormCustom/PosTerminalField.js.map +1 -1
  32. package/lib/components/ApplicationFormCustom/RegionPremiumField.js +2 -2
  33. package/lib/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -1
  34. package/lib/components/ApplicationFormCustom/VedField.js +7 -0
  35. package/lib/components/ApplicationFormCustom/VedField.js.map +1 -1
  36. package/lib/components/ApplicationFormCustom/getField.js +1 -0
  37. package/lib/components/ApplicationFormCustom/getField.js.map +1 -1
  38. package/lib/components/ApplicationFormCustom/getInitialFormState.js +1 -0
  39. package/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  40. package/lib/hooks/{usePremiumBranchesByRegions.d.ts → useBranchesByRegions.d.ts} +1 -1
  41. package/lib/hooks/{usePremiumBranchesByRegions.js → useBranchesByRegions.js} +3 -3
  42. package/lib/hooks/useBranchesByRegions.js.map +1 -0
  43. package/mobile/bundle/bundle.umd.js +16 -7
  44. package/mobile/bundle/bundle.umd.min.js +1 -1
  45. package/mobile/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  46. package/mobile/bundle/hooks/{usePremiumBranchesByRegions.d.ts → useBranchesByRegions.d.ts} +1 -1
  47. package/mobile/dist/api/LeadServiceAPI.js +2 -1
  48. package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
  49. package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.js +2 -2
  50. package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  51. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  52. package/mobile/dist/components/ApplicationFormCustom/PosTerminalField.js +1 -1
  53. package/mobile/dist/components/ApplicationFormCustom/PosTerminalField.js.map +1 -1
  54. package/mobile/dist/components/ApplicationFormCustom/RegionPremiumField.js +2 -2
  55. package/mobile/dist/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -1
  56. package/mobile/dist/components/ApplicationFormCustom/VedField.js +7 -0
  57. package/mobile/dist/components/ApplicationFormCustom/VedField.js.map +1 -1
  58. package/mobile/dist/components/ApplicationFormCustom/getField.js +1 -0
  59. package/mobile/dist/components/ApplicationFormCustom/getField.js.map +1 -1
  60. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js +1 -0
  61. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  62. package/mobile/dist/hooks/useBranchesByRegions.d.ts +8 -0
  63. package/{dist/hooks/usePremiumBranchesByRegions.js → mobile/dist/hooks/useBranchesByRegions.js} +5 -5
  64. package/mobile/dist/hooks/useBranchesByRegions.js.map +1 -0
  65. package/mobile/lib/api/LeadServiceAPI.js +2 -1
  66. package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
  67. package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.js +2 -2
  68. package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  69. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +4 -4
  70. package/mobile/lib/components/ApplicationFormCustom/PosTerminalField.js +1 -1
  71. package/mobile/lib/components/ApplicationFormCustom/PosTerminalField.js.map +1 -1
  72. package/mobile/lib/components/ApplicationFormCustom/RegionPremiumField.js +2 -2
  73. package/mobile/lib/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -1
  74. package/mobile/lib/components/ApplicationFormCustom/VedField.js +7 -0
  75. package/mobile/lib/components/ApplicationFormCustom/VedField.js.map +1 -1
  76. package/mobile/lib/components/ApplicationFormCustom/getField.js +1 -0
  77. package/mobile/lib/components/ApplicationFormCustom/getField.js.map +1 -1
  78. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js +1 -0
  79. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  80. package/mobile/lib/hooks/useBranchesByRegions.d.ts +8 -0
  81. package/mobile/lib/hooks/{usePremiumBranchesByRegions.js → useBranchesByRegions.js} +3 -3
  82. package/mobile/lib/hooks/useBranchesByRegions.js.map +1 -0
  83. package/mobile/src/api/LeadServiceAPI.ts +5 -1
  84. package/mobile/src/components/ApplicationFormCustom/AddressBranchField.tsx +2 -2
  85. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +33 -0
  86. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +4 -2
  87. package/mobile/src/components/ApplicationFormCustom/PosTerminalField.tsx +1 -1
  88. package/mobile/src/components/ApplicationFormCustom/RegionPremiumField.tsx +2 -2
  89. package/mobile/src/components/ApplicationFormCustom/VedField.tsx +7 -0
  90. package/mobile/src/components/ApplicationFormCustom/getField.tsx +6 -0
  91. package/mobile/src/components/ApplicationFormCustom/getInitialFormState.tsx +1 -0
  92. package/mobile/src/hooks/{usePremiumBranchesByRegions.ts → useBranchesByRegions.ts} +2 -2
  93. package/package.json +1 -1
  94. package/src/api/LeadServiceAPI.ts +5 -1
  95. package/src/components/ApplicationFormCustom/AddressBranchField.tsx +2 -2
  96. package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +33 -0
  97. package/src/components/ApplicationFormCustom/ApplicationFormCustom.fixture.tsx +28 -0
  98. package/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +4 -2
  99. package/src/components/ApplicationFormCustom/PosTerminalField.tsx +1 -1
  100. package/src/components/ApplicationFormCustom/RegionPremiumField.tsx +2 -2
  101. package/src/components/ApplicationFormCustom/VedField.tsx +7 -0
  102. package/src/components/ApplicationFormCustom/getField.tsx +6 -0
  103. package/src/components/ApplicationFormCustom/getInitialFormState.tsx +1 -0
  104. package/src/hooks/{usePremiumBranchesByRegions.ts → useBranchesByRegions.ts} +2 -2
  105. package/dist/hooks/usePremiumBranchesByRegions.js.map +0 -1
  106. package/lib/hooks/usePremiumBranchesByRegions.js.map +0 -1
  107. package/mobile/dist/hooks/usePremiumBranchesByRegions.d.ts +0 -8
  108. package/mobile/dist/hooks/usePremiumBranchesByRegions.js.map +0 -1
  109. package/mobile/lib/hooks/usePremiumBranchesByRegions.d.ts +0 -8
  110. package/mobile/lib/hooks/usePremiumBranchesByRegions.js.map +0 -1
@@ -833,8 +833,8 @@
833
833
  const submitBody = {
834
834
  typeForm,
835
835
  [isIndividualType ? 'regionBranch' : 'region']: region,
836
- [isIndividualType ? 'phoneNumber' : 'phone']: formatPhone(phone),
837
836
  [isIndividualType ? 'email' : 'mail']: email,
837
+ ...getPhone(phone),
838
838
  ...(isIndividualType ? { birthday: birthday?.toLocaleString() } : { inn, fullName }),
839
839
  ...(typeForm === 'FEEDBACK'
840
840
  ? {}
@@ -867,6 +867,7 @@
867
867
  send,
868
868
  };
869
869
  }
870
+ const getPhone = (phone, isIndividual) => phone ? { [isIndividual ? 'phoneNumber' : 'phone']: formatPhone(phone) } : {};
870
871
  const getSecondaryPhone = (secondaryPhone) => !secondaryPhone || secondaryPhone === '+7 ('
871
872
  ? {}
872
873
  : { secondaryPhoneNumber: formatPhone(secondaryPhone) };
@@ -1328,8 +1329,8 @@
1328
1329
  return result || EMPTY_VALUE$3;
1329
1330
  };
1330
1331
 
1331
- const REGIONS_URL$1 = '/api/v1/premiumBranchesByRegions';
1332
- function usePremiumBranchesByRegions() {
1332
+ const REGIONS_URL$1 = '/api/v1/branchesByRegions';
1333
+ function useBranchesByRegions() {
1333
1334
  const { data } = useAsyncData(REGIONS_URL$1, fetchJSONUnsafe);
1334
1335
  return Array.isArray(data) ? data : [];
1335
1336
  }
@@ -1378,7 +1379,7 @@
1378
1379
  const regionKey = field('region')?.value?.key;
1379
1380
  const regionText = field('region')?.value?.text;
1380
1381
  const addressBranch = isPremium
1381
- ? usePremiumBranchesByRegions()?.find((_) => _?.region === regionText)?.branches
1382
+ ? useBranchesByRegions()?.find((_) => _?.region === regionText)?.branches
1382
1383
  : useBranches(regionKey)?.filter((branch) => branch?.address);
1383
1384
  useEffect(() => {
1384
1385
  if (field('region')?.value?.key !== '') {
@@ -1685,10 +1686,10 @@
1685
1686
 
1686
1687
  const OnlineCheckoutField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", ...field('onlineCheckout') })) : null);
1687
1688
 
1688
- const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043A\u0443\u043F\u0438\u0442\u044C POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
1689
+ const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
1689
1690
 
1690
1691
  const RegionPremiumField = JSX(({ field, input }) => {
1691
- const branchByRegions = usePremiumBranchesByRegions();
1692
+ const branchByRegions = useBranchesByRegions();
1692
1693
  const regions = useMemo(() => branchByRegions?.map(({ region }) => ({
1693
1694
  key: region,
1694
1695
  text: region,
@@ -1717,6 +1718,12 @@
1717
1718
  ];
1718
1719
  const VedField = JSX(({ field }) => {
1719
1720
  const { value, onChange } = field('vedTypes');
1721
+ useEffect(() => {
1722
+ if (value !== 'currencyControl') {
1723
+ field?.('inn')?.onChange?.('');
1724
+ field?.('region')?.onChange?.('');
1725
+ }
1726
+ }, [value]);
1720
1727
  return (jsxs("div", { className: "py-m space-x-m grid @xl:flex @xl:items-center", children: [jsx(Radio, { name: "vedTypes", text: "\u0412\u0430\u043B\u044E\u0442\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C", value: "currencyControl", checked: value === 'currencyControl', onChange: onChange }), jsx(Radio, { name: "vedTypes", text: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0440\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", value: "documentOperations", checked: value === 'documentOperations', onChange: onChange }), jsx(Radio, { name: "vedTypes", text: "\u041A\u043E\u043D\u0432\u0435\u0440\u0441\u0438\u043E\u043D\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", value: "conversionTransactions", checked: value === 'conversionTransactions', onChange: onChange }), jsx(Radio, { name: "vedTypes", text: "\u0418\u043D\u044B\u0435 \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u0412\u042D\u0414", value: "otherIssues", checked: value === 'otherIssues', onChange: onChange })] }));
1721
1728
  });
1722
1729
 
@@ -1738,6 +1745,7 @@
1738
1745
  addressBranch: jsx(AddressBranchField, { field: field, input: input, isPremium: isPremium }),
1739
1746
  birthday: (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, required) })),
1740
1747
  isClient: (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })),
1748
+ consentToReceiveMaterials: (jsx(CheckboxWithError, { ...field('consentToReceiveMaterials'), text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435" })),
1741
1749
  partnerComments: (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441", isTextarea: true, ...rest })),
1742
1750
  collectionCount: (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0438\u043D\u043A\u0430\u0441\u0441\u0430\u0446\u0438\u0438", type: "number", ...getValidation(field('partnerComments'), validatorObj.collectionCount, required) })),
1743
1751
  acquiringType: jsx(AcquiringField, { field: field, input: input }),
@@ -1809,6 +1817,7 @@
1809
1817
  isClient: false,
1810
1818
  onlineCheckout: false,
1811
1819
  posTerminal: false,
1820
+ consentToReceiveMaterials: false,
1812
1821
  consentDataProcessing: false,
1813
1822
  };
1814
1823
  const getInitialFormState = (inputs, typeForm = '') => {
@@ -5641,7 +5650,7 @@
5641
5650
 
5642
5651
  const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
5643
5652
 
5644
- const packageVersion = "0.14.234";
5653
+ const packageVersion = "0.14.236";
5645
5654
 
5646
5655
  exports.Blocks = Blocks;
5647
5656
  exports.ContentPage = ContentPage;