@redneckz/wildless-cms-uni-blocks 0.14.739 → 0.14.741

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 (78) hide show
  1. package/bundle/bundle.umd.js +36 -39
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
  4. package/bundle/components/CreditForm/CreditFormStep.d.ts +0 -1
  5. package/dist/components/CreditCardForm/CreditCardForm.js +2 -1
  6. package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  7. package/dist/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
  8. package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -3
  9. package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  10. package/dist/components/CreditCardForm/useCreditCardFormAPI.js +1 -4
  11. package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  12. package/dist/components/CreditForm/CreditForm.js +2 -1
  13. package/dist/components/CreditForm/CreditForm.js.map +1 -1
  14. package/dist/components/CreditForm/CreditFormStep.d.ts +0 -1
  15. package/dist/components/CreditForm/CreditFormStep.js +2 -3
  16. package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  17. package/dist/ui-kit/FormField/validators.js +1 -1
  18. package/dist/ui-kit/FormField/validators.js.map +1 -1
  19. package/lib/components/CreditCardForm/CreditCardForm.js +2 -1
  20. package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  21. package/lib/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
  22. package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -3
  23. package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  24. package/lib/components/CreditCardForm/useCreditCardFormAPI.js +1 -4
  25. package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  26. package/lib/components/CreditForm/CreditForm.js +2 -1
  27. package/lib/components/CreditForm/CreditForm.js.map +1 -1
  28. package/lib/components/CreditForm/CreditFormStep.d.ts +0 -1
  29. package/lib/components/CreditForm/CreditFormStep.js +2 -3
  30. package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  31. package/lib/ui-kit/FormField/Fields/AddressField.d.ts +1 -1
  32. package/lib/ui-kit/FormField/validators.js +1 -1
  33. package/lib/ui-kit/FormField/validators.js.map +1 -1
  34. package/mobile/bundle/bundle.umd.js +36 -39
  35. package/mobile/bundle/bundle.umd.min.js +1 -1
  36. package/mobile/bundle/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
  37. package/mobile/bundle/components/CreditForm/CreditFormStep.d.ts +0 -1
  38. package/mobile/dist/components/CreditCardForm/CreditCardForm.js +2 -1
  39. package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  40. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
  41. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -3
  42. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  43. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +1 -4
  44. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  45. package/mobile/dist/components/CreditForm/CreditForm.js +2 -1
  46. package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
  47. package/mobile/dist/components/CreditForm/CreditFormStep.d.ts +0 -1
  48. package/mobile/dist/components/CreditForm/CreditFormStep.js +2 -3
  49. package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  50. package/mobile/dist/ui-kit/FormField/validators.js +1 -1
  51. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  52. package/mobile/lib/components/CreditCardForm/CreditCardForm.js +2 -1
  53. package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  54. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
  55. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -3
  56. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  57. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +1 -4
  58. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  59. package/mobile/lib/components/CreditForm/CreditForm.js +2 -1
  60. package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
  61. package/mobile/lib/components/CreditForm/CreditFormStep.d.ts +0 -1
  62. package/mobile/lib/components/CreditForm/CreditFormStep.js +2 -3
  63. package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  64. package/mobile/lib/ui-kit/FormField/validators.js +1 -1
  65. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  66. package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +13 -9
  67. package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -6
  68. package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +1 -4
  69. package/mobile/src/components/CreditForm/CreditForm.tsx +14 -10
  70. package/mobile/src/components/CreditForm/CreditFormStep.tsx +2 -6
  71. package/mobile/src/ui-kit/FormField/validators.ts +1 -3
  72. package/package.json +1 -1
  73. package/src/components/CreditCardForm/CreditCardForm.tsx +13 -9
  74. package/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -6
  75. package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +1 -4
  76. package/src/components/CreditForm/CreditForm.tsx +14 -10
  77. package/src/components/CreditForm/CreditFormStep.tsx +2 -6
  78. package/src/ui-kit/FormField/validators.ts +1 -3
@@ -2563,7 +2563,7 @@
2563
2563
  const AGE_ERROR_MESSAGE = 'Допустимый возраст заёмщика - от 23 до 75 лет';
2564
2564
  const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE);
2565
2565
  const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE);
2566
- const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 0 && _.length <= 2)(errorMsg ?? ERROR_MESSAGE);
2566
+ const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && /^[0-9]{1,2}$/g.test(_))(errorMsg ?? ERROR_MESSAGE);
2567
2567
  const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE);
2568
2568
  const lengthStringValidator = (inputLength, errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= inputLength)(errorMsg ?? ERROR_MESSAGE);
2569
2569
  const serieValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 4)(errorMsg);
@@ -6808,33 +6808,6 @@
6808
6808
  return (jsx("div", { className: "py-lg px-5xl bg-white col-span-12", children: jsxs("div", { children: [jsxs("span", { className: "font-bold mr-s", children: ["\u0428\u0430\u0433 ", step + 1, " \u0438\u0437 ", totalSteps, "."] }), stepsTitles[step] || null, jsx(ProgressBar, { step: progress, showPercentage: false })] }) }));
6809
6809
  });
6810
6810
 
6811
- const calculateInputs = (getValue) => (inputs, step) => inputs
6812
- .filter((_) => _)
6813
- .map((_) => {
6814
- if ([
6815
- checkIsRetiree(step, getValue),
6816
- checkBusinessOwner(_, getValue),
6817
- checkConsentPfrFlg(_, getValue),
6818
- checkAddressFillFromESIA(_, getValue),
6819
- checkAddressFact(_, getValue),
6820
- checkCondition(_, getValue),
6821
- ].some(Boolean)) {
6822
- return { ..._, required: false };
6823
- }
6824
- return _;
6825
- });
6826
- const checkIsRetiree = (step, getValue) => step === 2 && getValue('employment')?.key === 'RETIREE';
6827
- const checkBusinessOwner = ({ name }, getValue) => name === 'partInBusiness' && getValue('positionOrganization')?.key !== 'BUSINESS_OWNER';
6828
- const checkAddressFillFromESIA = ({ name, filledByEsia }, getValue) => name?.startsWith('address') && getValue('esiaAccountTypeCd')?.key && filledByEsia;
6829
- const checkAddressFact = ({ name }, getValue) => name === 'addressFact' && getValue('addressMatch');
6830
- const checkCondition = ({ condition }, getValue) => condition?.name &&
6831
- condition?.values?.some((_) => {
6832
- const dataValue = getValue(condition?.name);
6833
- return _ !== (dataValue?.key ?? dataValue);
6834
- });
6835
- const checkConsentPfrFlg = ({ name }, getValue) => name === 'snils' && isSnilsRequired(getValue);
6836
- const isSnilsRequired = (getValue) => getValue('confirmationIncome')?.key !== 'PFR_CERTIFICATE';
6837
-
6838
6811
  var STATUS_TYPE;
6839
6812
  (function (STATUS_TYPE) {
6840
6813
  STATUS_TYPE["process"] = "IN_PROCESS";
@@ -6992,6 +6965,33 @@
6992
6965
  return statusesMap[status] || jsx(ReworkStatusContent$1, {});
6993
6966
  };
6994
6967
 
6968
+ const calculateInputs = (getValue) => (inputs, step) => inputs
6969
+ .filter((_) => _)
6970
+ .map((_) => {
6971
+ if ([
6972
+ checkIsRetiree(step, getValue),
6973
+ checkBusinessOwner(_, getValue),
6974
+ checkConsentPfrFlg(_, getValue),
6975
+ checkAddressFillFromESIA(_, getValue),
6976
+ checkAddressFact(_, getValue),
6977
+ checkCondition(_, getValue),
6978
+ ].some(Boolean)) {
6979
+ return { ..._, required: false };
6980
+ }
6981
+ return _;
6982
+ });
6983
+ const checkIsRetiree = (step, getValue) => step === 2 && getValue('employment')?.key === 'RETIREE';
6984
+ const checkBusinessOwner = ({ name }, getValue) => name === 'partInBusiness' && getValue('positionOrganization')?.key !== 'BUSINESS_OWNER';
6985
+ const checkAddressFillFromESIA = ({ name, filledByEsia }, getValue) => name?.startsWith('address') && getValue('esiaAccountTypeCd')?.key && filledByEsia;
6986
+ const checkAddressFact = ({ name }, getValue) => name === 'addressFact' && getValue('addressMatch');
6987
+ const checkCondition = ({ condition }, getValue) => condition?.name &&
6988
+ condition?.values?.some((_) => {
6989
+ const dataValue = getValue(condition?.name);
6990
+ return _ !== (dataValue?.key ?? dataValue);
6991
+ });
6992
+ const checkConsentPfrFlg = ({ name }, getValue) => name === 'snils' && isSnilsRequired(getValue);
6993
+ const isSnilsRequired = (getValue) => getValue('confirmationIncome')?.key !== 'PFR_CERTIFICATE';
6994
+
6995
6995
  const InputsMap = { ...InputsRetailMap, ...InputRetailCardMap };
6996
6996
  const renderInputs$1 = ({ field, inputs, params }) => inputs.map(getField(field, params, InputsMap));
6997
6997
 
@@ -7298,10 +7298,7 @@
7298
7298
  }));
7299
7299
  resetForm(response);
7300
7300
  }
7301
- onNextStep();
7302
- if (isFinalStep) {
7303
- onFinish?.();
7304
- }
7301
+ isFinalStep ? onFinish?.() : onNextStep();
7305
7302
  }
7306
7303
  catch (ex) {
7307
7304
  // Do nothing
@@ -7313,7 +7310,7 @@
7313
7310
  return [initialState, handleSubmit, isSending];
7314
7311
  };
7315
7312
 
7316
- const CreditCardFormStep = JSX(({ step, sections, isFormFinished, onPrevStep, onNextStep, onFinish }) => {
7313
+ const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, onFinish }) => {
7317
7314
  const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs || []), [sections]);
7318
7315
  const formValidator = useCallback((formState) =>
7319
7316
  // TODO Слишком сложно
@@ -7327,7 +7324,7 @@
7327
7324
  formValidator,
7328
7325
  onSubmit,
7329
7326
  });
7330
- return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$2({ sections, field, step }), jsx(StepsNavigationButtons$1, { isSending: isSending, step: step, onPrevStep: onPrevStep })] }));
7327
+ return (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$2({ sections, field, step }), jsx(StepsNavigationButtons$1, { isSending: isSending, step: step, onPrevStep: onPrevStep })] }));
7331
7328
  });
7332
7329
 
7333
7330
  const PERSONAL_INFO_CONTENT = [
@@ -7731,7 +7728,7 @@
7731
7728
  }, []);
7732
7729
  const sections = stepsSectionsMap$1[step];
7733
7730
  const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
7734
- return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditCardFormStep, { step: step, sections: sections, isFormFinished: isFormFinished, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step)) })] }) }));
7731
+ return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsx(CreditCardFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step))) })] }) }));
7735
7732
  });
7736
7733
 
7737
7734
  const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
@@ -8105,7 +8102,7 @@
8105
8102
  return [initialState, handleSubmit, isSending];
8106
8103
  };
8107
8104
 
8108
- const CreditFormStep = JSX(({ step, sections, isFormFinished, programsSource, onPrevStep, onNextStep, onFinish }) => {
8105
+ const CreditFormStep = JSX(({ step, sections, programsSource, onPrevStep, onNextStep, onFinish }) => {
8109
8106
  const { programId } = useRetailFormStore();
8110
8107
  const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
8111
8108
  const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs ?? []), [sections]);
@@ -8121,7 +8118,7 @@
8121
8118
  formValidator,
8122
8119
  onSubmit,
8123
8120
  });
8124
- return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, isSending: isSending, onPrevStep: onPrevStep })] }));
8121
+ return (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, isSending: isSending, onPrevStep: onPrevStep })] }));
8125
8122
  });
8126
8123
 
8127
8124
  const stepsSectionsMap = [
@@ -8156,7 +8153,7 @@
8156
8153
  const sections = stepsSectionsMap[step];
8157
8154
  const isStartStep = step === 0;
8158
8155
  const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
8159
- return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, sections: sections, isFormFinished: isFormFinished, programsSource: programsSource, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step)) })] }) }));
8156
+ return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsx(CreditFormStep, { step: step, sections: sections, programsSource: programsSource, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step))) })] }) }));
8160
8157
  });
8161
8158
 
8162
8159
  const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
@@ -10433,7 +10430,7 @@
10433
10430
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10434
10431
  });
10435
10432
 
10436
- const packageVersion = "0.14.738";
10433
+ const packageVersion = "0.14.740";
10437
10434
 
10438
10435
  exports.Blocks = Blocks;
10439
10436
  exports.ContentPage = ContentPage;