@redneckz/wildless-cms-uni-blocks 0.14.1039 → 0.14.1040

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 (70) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +17 -23
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ReferalForm/ReferalFormContent.d.ts +2 -2
  5. package/bundle/components/ReferalForm/referalFormData.d.ts +2 -2
  6. package/dist/components/ReferalForm/ReferalForm.js +6 -6
  7. package/dist/components/ReferalForm/ReferalForm.js.map +1 -1
  8. package/dist/components/ReferalForm/ReferalFormContent.d.ts +2 -2
  9. package/dist/components/ReferalForm/referalFormData.d.ts +2 -2
  10. package/dist/components/ReferalForm/referalFormData.js +8 -14
  11. package/dist/components/ReferalForm/referalFormData.js.map +1 -1
  12. package/dist/components/ReferalForm/renderLinkInput.js +4 -1
  13. package/dist/components/ReferalForm/renderLinkInput.js.map +1 -1
  14. package/lib/components/ReferalForm/ReferalForm.js +6 -6
  15. package/lib/components/ReferalForm/ReferalForm.js.map +1 -1
  16. package/lib/components/ReferalForm/ReferalFormContent.d.ts +2 -2
  17. package/lib/components/ReferalForm/referalFormData.d.ts +2 -2
  18. package/lib/components/ReferalForm/referalFormData.js +7 -13
  19. package/lib/components/ReferalForm/referalFormData.js.map +1 -1
  20. package/lib/components/ReferalForm/renderLinkInput.js +4 -1
  21. package/lib/components/ReferalForm/renderLinkInput.js.map +1 -1
  22. package/mobile/bundle/bundle.umd.js +17 -23
  23. package/mobile/bundle/bundle.umd.min.js +1 -1
  24. package/mobile/bundle/components/ReferalForm/ReferalFormContent.d.ts +2 -2
  25. package/mobile/bundle/components/ReferalForm/referalFormData.d.ts +2 -2
  26. package/mobile/dist/components/ReferalForm/ReferalForm.js +6 -6
  27. package/mobile/dist/components/ReferalForm/ReferalForm.js.map +1 -1
  28. package/mobile/dist/components/ReferalForm/ReferalFormContent.d.ts +2 -2
  29. package/mobile/dist/components/ReferalForm/referalFormData.d.ts +2 -2
  30. package/mobile/dist/components/ReferalForm/referalFormData.js +8 -14
  31. package/mobile/dist/components/ReferalForm/referalFormData.js.map +1 -1
  32. package/mobile/dist/components/ReferalForm/renderLinkInput.js +4 -1
  33. package/mobile/dist/components/ReferalForm/renderLinkInput.js.map +1 -1
  34. package/mobile/lib/components/ReferalForm/ReferalForm.js +6 -6
  35. package/mobile/lib/components/ReferalForm/ReferalForm.js.map +1 -1
  36. package/mobile/lib/components/ReferalForm/ReferalFormContent.d.ts +2 -2
  37. package/mobile/lib/components/ReferalForm/referalFormData.d.ts +2 -2
  38. package/mobile/lib/components/ReferalForm/referalFormData.js +7 -13
  39. package/mobile/lib/components/ReferalForm/referalFormData.js.map +1 -1
  40. package/mobile/lib/components/ReferalForm/renderLinkInput.js +4 -1
  41. package/mobile/lib/components/ReferalForm/renderLinkInput.js.map +1 -1
  42. package/mobile/src/components/ReferalForm/ReferalForm.example.json +3 -1
  43. package/mobile/src/components/ReferalForm/ReferalForm.tsx +11 -11
  44. package/mobile/src/components/ReferalForm/ReferalFormContent.ts +11 -9
  45. package/mobile/src/components/ReferalForm/referalFormData.ts +8 -14
  46. package/mobile/src/components/ReferalForm/renderLinkInput.tsx +5 -1
  47. package/package.json +1 -1
  48. package/src/components/ReferalForm/ReferalForm.example.json +3 -1
  49. package/src/components/ReferalForm/ReferalForm.fixture.mobile.tsx +2 -0
  50. package/src/components/ReferalForm/ReferalForm.fixture.tsx +2 -0
  51. package/src/components/ReferalForm/ReferalForm.tsx +11 -11
  52. package/src/components/ReferalForm/ReferalFormContent.ts +11 -9
  53. package/src/components/ReferalForm/referalFormData.ts +8 -14
  54. package/src/components/ReferalForm/renderLinkInput.tsx +5 -1
  55. package/bundle/components/ReferalForm/renderSections.d.ts +0 -3
  56. package/dist/components/ReferalForm/renderSections.d.ts +0 -3
  57. package/dist/components/ReferalForm/renderSections.js +0 -10
  58. package/dist/components/ReferalForm/renderSections.js.map +0 -1
  59. package/lib/components/ReferalForm/renderSections.d.ts +0 -3
  60. package/lib/components/ReferalForm/renderSections.js +0 -7
  61. package/lib/components/ReferalForm/renderSections.js.map +0 -1
  62. package/mobile/bundle/components/ReferalForm/renderSections.d.ts +0 -3
  63. package/mobile/dist/components/ReferalForm/renderSections.d.ts +0 -3
  64. package/mobile/dist/components/ReferalForm/renderSections.js +0 -10
  65. package/mobile/dist/components/ReferalForm/renderSections.js.map +0 -1
  66. package/mobile/lib/components/ReferalForm/renderSections.d.ts +0 -3
  67. package/mobile/lib/components/ReferalForm/renderSections.js +0 -7
  68. package/mobile/lib/components/ReferalForm/renderSections.js.map +0 -1
  69. package/mobile/src/components/ReferalForm/renderSections.tsx +0 -18
  70. package/src/components/ReferalForm/renderSections.tsx +0 -18
@@ -3833,7 +3833,7 @@
3833
3833
 
3834
3834
  const renderTitle = (title) => title ? (jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: title }) })) : null;
3835
3835
 
3836
- const renderSections$1 = (sections, field, { typeForm, additionalParams }) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm, ...additionalParams }))] }, `section-${i}`)));
3836
+ const renderSections = (sections, field, { typeForm, additionalParams }) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm, ...additionalParams }))] }, `section-${i}`)));
3837
3837
 
3838
3838
  const useInterval = (handler, period) => {
3839
3839
  const timer = useRef(null);
@@ -4042,7 +4042,7 @@
4042
4042
  });
4043
4043
  const fieldName = getConsentDataProcessing(inputs)?.name;
4044
4044
  const consentDataProcessing = fieldName ? field('consentDataProcessing') : undefined;
4045
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [renderSections$1(sections, field, { typeForm, additionalParams }), renderAgreementSubmit({
4045
+ return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [renderSections(sections, field, { typeForm, additionalParams }), renderAgreementSubmit({
4046
4046
  consentDataProcessing,
4047
4047
  link,
4048
4048
  additionalLink,
@@ -14186,25 +14186,20 @@
14186
14186
  return (jsxs(BlockWrapper, { className: style('p-6xl space-y-xl', className), defaultPadding: "p-0", ...rest, children: [jsx(Heading, { className: "mb-xl", children: title }), isArchive ? renderDataPickForm() : null, ratesList.map((list, i) => (jsx(RatesTableItem, { list: list, isRatesValid: isRatesValid, isArchive: isArchive, infoMessage: infoMessage }, String(i)))), href ? renderLink(href) : null] }));
14187
14187
  });
14188
14188
 
14189
- const sections = [
14190
- { title: 'Заполните ваши данные и получите персональную ссылку', inputs: [] },
14189
+ const inputs = [
14191
14190
  {
14192
- columns: 2,
14193
- inputs: [
14194
- {
14195
- name: 'dadataPartyInnSelect',
14196
- required: true,
14197
- },
14198
- {
14199
- name: 'email',
14200
- required: true,
14201
- },
14202
- ],
14191
+ name: 'dadataPartyInnSelect',
14192
+ required: true,
14193
+ },
14194
+ {
14195
+ name: 'email',
14196
+ required: true,
14203
14197
  },
14204
14198
  ];
14205
14199
 
14206
- const renderSections = (sections, field) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field))] }, `section-${i}`)));
14207
-
14200
+ const defaultIcon = {
14201
+ icon: 'CopyIcon',
14202
+ };
14208
14203
  const renderLinkInput = JSX(({ className, value = '', copyIcon }) => {
14209
14204
  const onClick = useCallback(async () => {
14210
14205
  try {
@@ -14214,7 +14209,7 @@
14214
14209
  console.log('Ошибка копирования');
14215
14210
  }
14216
14211
  }, []);
14217
- return (jsxs("div", { className: style('relative flex items-center max-w-lg m-auto', className), children: [jsx("input", { className: style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle$1), type: "text", value: value, disabled: true }), jsx("div", { role: "button", className: "absolute right-3", onClick: onClick, children: jsx(Img, { image: copyIcon }) })] }));
14212
+ return (jsxs("div", { className: style('relative flex items-center max-w-lg m-auto', className), children: [jsx("input", { className: style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle$1), type: "text", value: value, disabled: true }), jsx("div", { role: "button", className: "absolute right-3", onClick: onClick, children: jsx(Img, { image: copyIcon ?? defaultIcon, width: "20px" }) })] }));
14218
14213
  });
14219
14214
 
14220
14215
  const ResultLink = JSX(({ link, copyIcon }) => {
@@ -14224,10 +14219,9 @@
14224
14219
  })] }));
14225
14220
  });
14226
14221
 
14227
- const ReferalForm = UniBlock(({ link = '', button, copyIcon, ...rest }) => {
14222
+ const ReferalForm = UniBlock(({ title, description, link = '', button, copyIcon, ...rest }) => {
14228
14223
  const [isShowResultLink, setIsShowResultLink] = useState(false);
14229
14224
  const [referalLink, setReferalLink] = useState('');
14230
- const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
14231
14225
  const formValidator = useMemo(() => getFormValidator(inputs), [inputs]);
14232
14226
  const handleSubmit = useCallback(async (formData) => {
14233
14227
  setReferalLink(`${link}?utm_source=${formData.dadataPartyInnSelect?.text}&utm_mail=${formData.email}`);
@@ -14238,9 +14232,9 @@
14238
14232
  formValidator,
14239
14233
  onSubmit: handleSubmit,
14240
14234
  });
14241
- return (jsx(ApplicationFormLayout, { className: "container space-y-m col-span-12", title: getTitle(isShowResultLink), ...rest, children: isShowResultLink ? (jsx(ResultLink, { link: referalLink, copyIcon: copyIcon })) : (jsxs("form", { onSubmit: onSubmit, children: [renderSections(sections, field), jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: "\u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u0441 " }), jsx(Link, { href: "/privacy-policy", target: "_blank", ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F\u043C\u0438 \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(SubmitButton$1, { className: "w-full @xl:w-auto mt-xs", children: button?.text ?? 'Получить ссылку' })] })) }));
14235
+ return (jsx(ApplicationFormLayout, { className: "container space-y-m col-span-12", title: getTitle(title, isShowResultLink), ...rest, children: isShowResultLink ? (jsx(ResultLink, { link: referalLink, copyIcon: copyIcon })) : (jsxs("form", { onSubmit: onSubmit, children: [jsxs("div", { className: "grid @xl:grid-cols-2 gap-x-m", children: [renderTitle(description), inputs.map(getField(field))] }), jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: "\u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u0441 " }), jsx(Link, { href: "/privacy-policy", target: "_blank", ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F\u043C\u0438 \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(SubmitButton$1, { className: "w-full @xl:w-auto mt-xs", children: button?.text ?? 'Получить ссылку' })] })) }));
14242
14236
  });
14243
- const getTitle = (isShowResultLink = false) => isShowResultLink ? 'Ваша личная ссылка' : 'Как получить бесплатное обслуживание счёта';
14237
+ const getTitle = (title = '', isShowResultLink = false) => isShowResultLink ? 'Ваша личная ссылка' : title;
14244
14238
 
14245
14239
  const RichTextBlock = UniBlock((props) => {
14246
14240
  const { __html, dynamicQueryParamText = {}, dynamicTextSource, richVersion = '', ...rest } = props;
@@ -14782,7 +14776,7 @@
14782
14776
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
14783
14777
  });
14784
14778
 
14785
- const packageVersion = "0.14.1038";
14779
+ const packageVersion = "0.14.1039";
14786
14780
 
14787
14781
  exports.Blocks = Blocks;
14788
14782
  exports.ContentPage = ContentPage;