@redneckz/wildless-cms-uni-blocks 0.14.871 → 0.14.873

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 (61) hide show
  1. package/bundle/bundle.umd.js +34 -5
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
  4. package/bundle/ui-kit/Foldable/FoldableSection.d.ts +1 -0
  5. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +14 -1
  6. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  7. package/dist/components/TariffsTable/TariffsTable.js +1 -1
  8. package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
  9. package/dist/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
  10. package/dist/retail/components/NoConsentDialog/NoConsentDialog.js +27 -0
  11. package/dist/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -0
  12. package/dist/ui-kit/Foldable/FoldableSection.d.ts +1 -0
  13. package/dist/ui-kit/Foldable/FoldableSection.js +2 -2
  14. package/dist/ui-kit/Foldable/FoldableSection.js.map +1 -1
  15. package/lib/common.css +1 -1
  16. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +14 -1
  17. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  18. package/lib/components/TariffsTable/TariffsTable.js +1 -1
  19. package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
  20. package/lib/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
  21. package/lib/retail/components/NoConsentDialog/NoConsentDialog.fixture.d.ts +5 -0
  22. package/lib/retail/components/NoConsentDialog/NoConsentDialog.js +25 -0
  23. package/lib/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -0
  24. package/lib/ui-kit/Foldable/FoldableSection.d.ts +1 -0
  25. package/lib/ui-kit/Foldable/FoldableSection.js +2 -2
  26. package/lib/ui-kit/Foldable/FoldableSection.js.map +1 -1
  27. package/mobile/bundle/bundle.umd.js +34 -5
  28. package/mobile/bundle/bundle.umd.min.js +1 -1
  29. package/mobile/bundle/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
  30. package/mobile/bundle/ui-kit/Foldable/FoldableSection.d.ts +1 -0
  31. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +14 -1
  32. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  33. package/mobile/dist/components/TariffsTable/TariffsTable.js +1 -1
  34. package/mobile/dist/components/TariffsTable/TariffsTable.js.map +1 -1
  35. package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
  36. package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.js +27 -0
  37. package/mobile/dist/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -0
  38. package/mobile/dist/ui-kit/Foldable/FoldableSection.d.ts +1 -0
  39. package/mobile/dist/ui-kit/Foldable/FoldableSection.js +2 -2
  40. package/mobile/dist/ui-kit/Foldable/FoldableSection.js.map +1 -1
  41. package/mobile/lib/common.css +1 -1
  42. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +14 -1
  43. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  44. package/mobile/lib/components/TariffsTable/TariffsTable.js +1 -1
  45. package/mobile/lib/components/TariffsTable/TariffsTable.js.map +1 -1
  46. package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.d.ts +6 -0
  47. package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.js +25 -0
  48. package/mobile/lib/retail/components/NoConsentDialog/NoConsentDialog.js.map +1 -0
  49. package/mobile/lib/ui-kit/Foldable/FoldableSection.d.ts +1 -0
  50. package/mobile/lib/ui-kit/Foldable/FoldableSection.js +2 -2
  51. package/mobile/lib/ui-kit/Foldable/FoldableSection.js.map +1 -1
  52. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +16 -1
  53. package/mobile/src/components/TariffsTable/TariffsTable.tsx +3 -1
  54. package/mobile/src/retail/components/NoConsentDialog/NoConsentDialog.tsx +55 -0
  55. package/mobile/src/ui-kit/Foldable/FoldableSection.tsx +33 -26
  56. package/package.json +1 -1
  57. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +16 -1
  58. package/src/components/TariffsTable/TariffsTable.tsx +3 -1
  59. package/src/retail/components/NoConsentDialog/NoConsentDialog.fixture.tsx +7 -0
  60. package/src/retail/components/NoConsentDialog/NoConsentDialog.tsx +55 -0
  61. package/src/ui-kit/Foldable/FoldableSection.tsx +33 -26
@@ -1 +1 @@
1
- {"version":3,"file":"FoldableSection.js","sourceRoot":"","sources":["../../../src/ui-kit/Foldable/FoldableSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAM1C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAuB,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/F,MAAM,YAAY,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACzD,MAAM,kBAAkB,GAAG,iBAAiB,CAC1C,CAAC,iBAAiB,EAAE,EAAE;QACpB,IAAI,YAAY,CAAC,OAAO,EAAE;YACxB,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU;gBAC/C,CAAC,CAAC,GAAG,iBAAiB,CAAC,YAAY,IAAI;gBACvC,CAAC,CAAC,EAAE,CAAC;SACR;IACH,CAAC,EACD,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,OAAO,CACL,cACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,KA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AO,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC;SACxD,CACF,EACD,IAAI,EAAC,UAAU,gBACJ,iIAAwB,YAEnC,cAAK,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,kBAAkB,YAC/C,QAAQ,GACL,GACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -2444,6 +2444,23 @@
2444
2444
  return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm }))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
2445
2445
  });
2446
2446
 
2447
+ const NoConsentDialog = JSX(({ attempts, onClose = noop }) => {
2448
+ const navigator = locationNavigator();
2449
+ const isMaxAttempts = attempts > 1;
2450
+ const returnToMainPage = useCallback(() => {
2451
+ navigator.assign('/natural');
2452
+ }, []);
2453
+ const handleClose = useCallback(() => {
2454
+ if (isMaxAttempts) {
2455
+ returnToMainPage();
2456
+ }
2457
+ else {
2458
+ onClose();
2459
+ }
2460
+ }, [isMaxAttempts]);
2461
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl", onClose: handleClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx(Paragraph, { align: "text-center", children: "\u0423\u0432\u0430\u0436\u0430\u0435\u043C\u044B\u0439 \u043A\u043B\u0438\u0435\u043D\u0442!" }), jsx(Paragraph, { align: "text-center", children: "\u0414\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043A\u0440\u0435\u0434\u0438\u0442\u0430 \u0412\u0430\u043C \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043E\u0431\u0440\u0430\u0442\u0438\u0442\u044C\u0441\u044F \u0432 \u043E\u0444\u0438\u0441 \u0411\u0430\u043D\u043A\u0430" }), jsxs("div", { className: "flex flex-col sm:flex-row gap-xl items-center", children: [jsx(Button, { type: "button", version: "secondary", onClick: returnToMainPage, children: "\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C" }), isMaxAttempts ? null : (jsx(Button, { type: "button", onClick: onClose, children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C" }))] })] }) }));
2462
+ });
2463
+
2447
2464
  const ERROR_MESSAGE = 'Некорректно заполненное поле';
2448
2465
  const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
2449
2466
  const retailCyrillicPattern = /^[\u0400-\u04FF-\s]+$/u;
@@ -3143,7 +3160,7 @@
3143
3160
  return ref;
3144
3161
  }
3145
3162
 
3146
- const FoldableSection = JSX(({ className, isUnfolded, children }) => {
3163
+ const FoldableSection = JSX(({ className, isUnfolded, isOverflowVisible = false, children }) => {
3147
3164
  const containerRef = useRef(null);
3148
3165
  const childrenWrapperRef = useResizeObserver((childrenWrapperEl) => {
3149
3166
  if (containerRef.current) {
@@ -3152,7 +3169,7 @@
3152
3169
  : '';
3153
3170
  }
3154
3171
  }, [isUnfolded]);
3155
- return (jsx("div", { ref: containerRef, className: style('transition-max-h duration-300 overflow-hidden', {
3172
+ return (jsx("div", { ref: containerRef, className: style('transition-max-h duration-300', isOverflowVisible && isUnfolded ? 'overflow-clip' : 'overflow-hidden', {
3156
3173
  'max-h-0': Boolean(containerRef.current || !isUnfolded),
3157
3174
  }), role: "tabpanel", "aria-label": "\u0421\u0432\u043E\u0440\u0430\u0447\u0438\u0432\u0430\u044E\u0449\u0430\u044F\u0441\u044F \u0441\u0435\u043A\u0446\u0438\u044F", children: jsx("div", { className: className, ref: childrenWrapperRef, children: children }) }));
3158
3175
  });
@@ -6274,9 +6291,11 @@
6274
6291
 
6275
6292
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6276
6293
  const [esiaStatus, setEsiaStatus] = useState();
6294
+ const [attemptsWithoutConsents, setAttemptsWithoutConsents] = useState(0);
6277
6295
  const leadForm = useRef(null);
6278
6296
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6279
6297
  const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
6298
+ const noConsentDialog = useDialog(NoConsentDialog);
6280
6299
  const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
6281
6300
  const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
6282
6301
  const initialFormState = useInitApplicationLead({
@@ -6296,6 +6315,16 @@
6296
6315
  formValidator,
6297
6316
  onSubmit: handleSubmit,
6298
6317
  });
6318
+ const onSubmitWithPrecondition = (ev) => {
6319
+ if (!field('processPersonalDataFlg')?.value) {
6320
+ setAttemptsWithoutConsents((prev) => prev + 1);
6321
+ attemptsWithoutConsents > 0 &&
6322
+ noConsentDialog.open({
6323
+ attempts: attemptsWithoutConsents,
6324
+ });
6325
+ }
6326
+ onSubmit?.(ev);
6327
+ };
6299
6328
  const responseTypeDialog = useDialog(ResponseTypeDialog);
6300
6329
  useEffect(() => {
6301
6330
  if (ok !== undefined) {
@@ -6312,7 +6341,7 @@
6312
6341
  reset();
6313
6342
  }
6314
6343
  }, [leadForm?.current, esiaStatus]);
6315
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [!esiaStatus ? jsx(EsiaLoginBanner, { onChangeEsiaStatus: setEsiaStatus }) : null, jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", ref: leadForm, children: [esiaStatus === EsiaStatuses.Pending ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaStatus === EsiaStatuses.Error ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] })] }));
6344
+ return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [!esiaStatus ? jsx(EsiaLoginBanner, { onChangeEsiaStatus: setEsiaStatus }) : null, jsxs("form", { onSubmit: onSubmitWithPrecondition, className: "space-y-m relative", ref: leadForm, children: [esiaStatus === EsiaStatuses.Pending ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaStatus === EsiaStatuses.Error ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] })] }));
6316
6345
  });
6317
6346
  const getInputs = (applicationFormData) => (applicationFormData?.flatMap((_) => _?.inputs) || []);
6318
6347
  const getExtendedValidatorObj = (productType) => ({
@@ -10379,7 +10408,7 @@
10379
10408
  const rows = (rowData || []).map((row, i) => (jsx(TariffsTableRow, { row: row, ...rest }, String(i))));
10380
10409
  const [visibleRows, hiddenRows] = hiddenRowsNum > 0 ? [rows.slice(0, -hiddenRowsNum), rows.slice(-hiddenRowsNum)] : [rows, []];
10381
10410
  const [isUnfolded, { toggle }] = useBool(false);
10382
- return (jsxs(BlockWrapper, { className: style('relative space-y-xl', className), defaultPadding: "p-6xl", ...rest, children: [jsx(Headline, { title: title, description: description, headlineVersion: "M", isEmbedded: true, align: "text-center" }), jsx("div", { className: "space-y-m overflow-hidden", children: hiddenRowsNum > 0 ? (jsxs(Foldable, { children: [jsxs(TariffsTableWrapper, { children: [visibleRows, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenRows })] }), jsx(DefaultFoldButton, { className: "text-h4", isUnfolded: isUnfolded, onClick: toggle })] })) : (jsx(TariffsTableWrapper, { children: rows })) })] }));
10411
+ return (jsxs(BlockWrapper, { className: style('relative space-y-xl', className), defaultPadding: "p-6xl", ...rest, children: [jsx(Headline, { title: title, description: description, headlineVersion: "M", isEmbedded: true, align: "text-center" }), jsx("div", { className: "space-y-m overflow-hidden", children: hiddenRowsNum > 0 ? (jsxs(Foldable, { children: [jsxs(TariffsTableWrapper, { children: [visibleRows, jsx(FoldableSection, { isUnfolded: isUnfolded, isOverflowVisible: true, children: hiddenRows })] }), jsx(DefaultFoldButton, { className: "text-h4", isUnfolded: isUnfolded, onClick: toggle })] })) : (jsx(TariffsTableWrapper, { children: rows })) })] }));
10383
10412
  });
10384
10413
 
10385
10414
  const TextBlock = JSX(({ className = '', title, description, iconVersion, __html, richVersion, ...rest }) => (jsxs(BlockWrapper, { className: style('flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10', className), ...rest, children: [iconVersion === 'small' ? renderIcon() : null, jsxs("div", { className: "flex flex-col w-fit gap-2xs sm:gap-xs", children: [title ? (jsx(Text, { size: "text-l", font: "font-normal", color: "text-primary-text group-data-secondary:text-white", children: title })) : null, description ? renderDescription(description) : null, __html ? jsx(RichText, { richVersion: richVersion, __html: __html }) : null] })] })));
@@ -10548,7 +10577,7 @@
10548
10577
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10549
10578
  });
10550
10579
 
10551
- const packageVersion = "0.14.870";
10580
+ const packageVersion = "0.14.872";
10552
10581
 
10553
10582
  exports.Blocks = Blocks;
10554
10583
  exports.ContentPage = ContentPage;