@redneckz/wildless-cms-uni-blocks 0.14.646 → 0.14.647

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 (75) hide show
  1. package/bundle/bundle.umd.js +23 -10
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationForm/renderInputs.d.ts +5 -1
  4. package/bundle/ui-kit/FormField/Fields/BirthdayField.d.ts +5 -1
  5. package/bundle/ui-kit/FormField/getField.d.ts +1 -1
  6. package/dist/components/ApplicationForm/renderInputs.d.ts +5 -1
  7. package/dist/components/ApplicationForm/renderInputs.js +2 -2
  8. package/dist/components/ApplicationForm/renderInputs.js.map +1 -1
  9. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  10. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  11. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  12. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  13. package/dist/ui-kit/FormField/Fields/BirthdayField.d.ts +5 -1
  14. package/dist/ui-kit/FormField/Fields/BirthdayField.js +16 -1
  15. package/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
  16. package/dist/ui-kit/FormField/getField.d.ts +1 -1
  17. package/dist/ui-kit/FormField/getField.js +2 -4
  18. package/dist/ui-kit/FormField/getField.js.map +1 -1
  19. package/lib/common.css +1 -1
  20. package/lib/components/ApplicationForm/renderInputs.d.ts +5 -1
  21. package/lib/components/ApplicationForm/renderInputs.js +2 -2
  22. package/lib/components/ApplicationForm/renderInputs.js.map +1 -1
  23. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  24. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  25. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  26. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  27. package/lib/ui-kit/FormField/Fields/BirthdayField.d.ts +5 -1
  28. package/lib/ui-kit/FormField/Fields/BirthdayField.js +16 -1
  29. package/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
  30. package/lib/ui-kit/FormField/getField.d.ts +1 -1
  31. package/lib/ui-kit/FormField/getField.js +2 -4
  32. package/lib/ui-kit/FormField/getField.js.map +1 -1
  33. package/mobile/bundle/bundle.umd.js +23 -10
  34. package/mobile/bundle/bundle.umd.min.js +1 -1
  35. package/mobile/bundle/components/ApplicationForm/renderInputs.d.ts +5 -1
  36. package/mobile/bundle/ui-kit/FormField/Fields/BirthdayField.d.ts +5 -1
  37. package/mobile/bundle/ui-kit/FormField/getField.d.ts +1 -1
  38. package/mobile/dist/components/ApplicationForm/renderInputs.d.ts +5 -1
  39. package/mobile/dist/components/ApplicationForm/renderInputs.js +2 -2
  40. package/mobile/dist/components/ApplicationForm/renderInputs.js.map +1 -1
  41. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  42. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  43. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  44. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  45. package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.d.ts +5 -1
  46. package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js +16 -1
  47. package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
  48. package/mobile/dist/ui-kit/FormField/getField.d.ts +1 -1
  49. package/mobile/dist/ui-kit/FormField/getField.js +2 -4
  50. package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
  51. package/mobile/lib/common.css +1 -1
  52. package/mobile/lib/components/ApplicationForm/renderInputs.d.ts +5 -1
  53. package/mobile/lib/components/ApplicationForm/renderInputs.js +2 -2
  54. package/mobile/lib/components/ApplicationForm/renderInputs.js.map +1 -1
  55. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  56. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  57. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
  58. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
  59. package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.d.ts +5 -1
  60. package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js +16 -1
  61. package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
  62. package/mobile/lib/ui-kit/FormField/getField.d.ts +1 -1
  63. package/mobile/lib/ui-kit/FormField/getField.js +2 -4
  64. package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
  65. package/mobile/src/components/ApplicationForm/renderInputs.tsx +12 -3
  66. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
  67. package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +10 -3
  68. package/mobile/src/ui-kit/FormField/Fields/BirthdayField.tsx +32 -6
  69. package/mobile/src/ui-kit/FormField/getField.tsx +4 -4
  70. package/package.json +1 -1
  71. package/src/components/ApplicationForm/renderInputs.tsx +12 -3
  72. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
  73. package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +10 -3
  74. package/src/ui-kit/FormField/Fields/BirthdayField.tsx +32 -6
  75. package/src/ui-kit/FormField/getField.tsx +4 -4
@@ -2166,7 +2166,22 @@
2166
2166
 
2167
2167
  const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...getValidation(field('beginDate'), validatorObj.beginDate, calculateIsRequired(field, input?.required)), ...input })));
2168
2168
 
2169
- const BirthdayField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, input?.required) })));
2169
+ const MIN_AGE = 23;
2170
+ const MAX_AGE = 75;
2171
+ const AGE_ERROR_MESSAGE = 'Допустимый возраст заёмщика - от 23 до 75 лет';
2172
+ const BirthdayField = JSX(({ field, input, isRetailForm = false }) => {
2173
+ const { value } = field('birthday');
2174
+ return (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, input?.required), error: isRetailForm && value && !birthdayValidate(value) ? AGE_ERROR_MESSAGE : '' }));
2175
+ });
2176
+ const birthdayValidate = (date) => {
2177
+ const today = new Date();
2178
+ const minDate = new Date(today.getFullYear() - MIN_AGE, today.getMonth(), today.getDate());
2179
+ const maxDate = new Date(today.getFullYear() - MAX_AGE, today.getMonth(), today.getDate());
2180
+ if (!date || date > minDate || date < maxDate) {
2181
+ return false;
2182
+ }
2183
+ return true;
2184
+ };
2170
2185
 
2171
2186
  const BirthPlaceField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthPlace'), validatorObj.birthPlace, input?.required), ...input })));
2172
2187
 
@@ -3266,9 +3281,7 @@
3266
3281
  const PRODUCT_REF = {
3267
3282
  $ref: '/wcms-resources/outservice-productlist.json',
3268
3283
  };
3269
- const getField =
3270
- // eslint-disable-next-line max-lines-per-function
3271
- (field, typeForm) => (input, i) => {
3284
+ const getField = (field, typeForm, isRetailForm = false) => (input, i) => {
3272
3285
  const isPremium = typeForm === 'ULTRASERVICE' || typeForm === 'PREMIUMSERVICE';
3273
3286
  const InputsMap = {
3274
3287
  surname: jsx(SurnameField, { field: field, input: input }),
@@ -3291,7 +3304,7 @@
3291
3304
  comment: jsx(CommentField, { field: field, input: input }),
3292
3305
  addressBranch: jsx(AddressBranchField, { field: field, input: input, isPremium: isPremium }),
3293
3306
  sex: jsx(SexField, { field: field, input: input }),
3294
- birthday: jsx(BirthdayField, { field: field, input: input }),
3307
+ birthday: jsx(BirthdayField, { field: field, input: input, isRetailForm: isRetailForm }),
3295
3308
  birthPlace: jsx(BirthPlaceField, { field: field, input: input }),
3296
3309
  desiredMeetingDate: jsx(DesiredMeetingDateField, { field: field, input: input }),
3297
3310
  product: jsx(ProductField, { field: field, source: PRODUCT_REF }),
@@ -3544,9 +3557,9 @@
3544
3557
  });
3545
3558
  const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", type: "button", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
3546
3559
 
3547
- const renderInputs$1 = ({ field, typeForm = '', inputs }) => {
3560
+ const renderInputs$1 = ({ field, typeForm = '', inputs, isRetailForm = false, }) => {
3548
3561
  const { consentInputs, restInputs } = splitInputs(inputs || []);
3549
- return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, typeForm)), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, typeForm)));
3562
+ return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, typeForm, isRetailForm)), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, typeForm, isRetailForm)));
3550
3563
  };
3551
3564
  const splitInputs = (inputs) => ({
3552
3565
  consentInputs: inputs?.filter((_) => Object.keys(CONSENTS).includes(_.name || '')) || [],
@@ -3901,7 +3914,7 @@
3901
3914
  }
3902
3915
  }, []);
3903
3916
  const consentText = showRefuceContent ? refuseConsentText : defaultConsentText;
3904
- return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center", children: [jsx("div", { role: "button", onClick: () => openDocument(open, CONSENT_BKI_ID, isMobile), children: jsx(Heading, { className: "text-center text-balance", title: consentText.title }) }), jsx(Paragraph, { align: "text-center", children: consentText.description }), jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: ITEMS$1, value: confirmStatus, onChange: handleConfirmChange }), jsx(Button, { disabled: !confirmStatus, type: "button", onClick: handleClose, children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C" })] }) }));
3917
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx("div", { role: "button", onClick: () => openDocument(open, CONSENT_BKI_ID, isMobile), children: jsx(Heading, { className: "text-center text-balance", headingType: "h2", title: consentText.title }) }), jsx(Paragraph, { align: "text-center", children: consentText.description }), jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: ITEMS$1, value: confirmStatus, onChange: handleConfirmChange }), jsx(Button, { disabled: !confirmStatus, type: "button", onClick: handleClose, children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C" })] }) }));
3905
3918
  });
3906
3919
  const ITEMS$1 = [
3907
3920
  { id: 'SIGNED', text: 'Подписать' },
@@ -4260,7 +4273,7 @@
4260
4273
  reset();
4261
4274
  }
4262
4275
  }, [responseType]);
4263
- return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button)] }) }));
4276
+ return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs, isRetailForm: true })] }, `section-${i}`))), renderSubmitButton(button)] }) }));
4264
4277
  });
4265
4278
 
4266
4279
  const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black', link }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion }) }), jsxs("div", { className: "", children: [jsx(RichText, { __html: __html }), link?.text ? jsx(LinkButton, { className: "text-primary-main", children: link.text }) : null] })] })));
@@ -8871,7 +8884,7 @@
8871
8884
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
8872
8885
  });
8873
8886
 
8874
- const packageVersion = "0.14.645";
8887
+ const packageVersion = "0.14.646";
8875
8888
 
8876
8889
  exports.Blocks = Blocks;
8877
8890
  exports.ContentPage = ContentPage;