@redneckz/wildless-cms-uni-blocks 0.14.654 → 0.14.656

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 (119) hide show
  1. package/bundle/bundle.umd.js +99 -66
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/CreditCardForm/formStateMap.d.ts +10 -10
  4. package/bundle/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
  5. package/bundle/components/CreditCardForm/renderInfo.d.ts +2 -1
  6. package/bundle/components/CreditCardForm/renderStep.d.ts +3 -4
  7. package/dist/api/RetailAPI/updateRefreshToken.js +12 -5
  8. package/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
  9. package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -4
  10. package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  11. package/dist/components/CreditCardForm/creditCardFormStepsData.js +61 -34
  12. package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  13. package/dist/components/CreditCardForm/formStateMap.d.ts +10 -10
  14. package/dist/components/CreditCardForm/formStateMap.js +3 -7
  15. package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  16. package/dist/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
  17. package/dist/components/CreditCardForm/getFilteredInputs.js +11 -0
  18. package/dist/components/CreditCardForm/getFilteredInputs.js.map +1 -0
  19. package/dist/components/CreditCardForm/getInitialFormState.js +3 -0
  20. package/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
  21. package/dist/components/CreditCardForm/renderInfo.d.ts +2 -1
  22. package/dist/components/CreditCardForm/renderInfo.js +5 -3
  23. package/dist/components/CreditCardForm/renderInfo.js.map +1 -1
  24. package/dist/components/CreditCardForm/renderStep.d.ts +3 -4
  25. package/dist/components/CreditCardForm/renderStep.js +1 -9
  26. package/dist/components/CreditCardForm/renderStep.js.map +1 -1
  27. package/dist/components/CreditCardForm/useCreditCardFormAPI.js +3 -1
  28. package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  29. package/lib/api/RetailAPI/updateRefreshToken.js +12 -5
  30. package/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
  31. package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -4
  32. package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  33. package/lib/components/CreditCardForm/creditCardFormStepsData.js +61 -34
  34. package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  35. package/lib/components/CreditCardForm/formStateMap.d.ts +10 -10
  36. package/lib/components/CreditCardForm/formStateMap.js +3 -7
  37. package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  38. package/lib/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
  39. package/lib/components/CreditCardForm/getFilteredInputs.js +8 -0
  40. package/lib/components/CreditCardForm/getFilteredInputs.js.map +1 -0
  41. package/lib/components/CreditCardForm/getInitialFormState.js +3 -0
  42. package/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
  43. package/lib/components/CreditCardForm/renderInfo.d.ts +2 -1
  44. package/lib/components/CreditCardForm/renderInfo.js +5 -3
  45. package/lib/components/CreditCardForm/renderInfo.js.map +1 -1
  46. package/lib/components/CreditCardForm/renderStep.d.ts +3 -4
  47. package/lib/components/CreditCardForm/renderStep.js +1 -9
  48. package/lib/components/CreditCardForm/renderStep.js.map +1 -1
  49. package/lib/components/CreditCardForm/useCreditCardFormAPI.js +3 -1
  50. package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  51. package/mobile/bundle/bundle.umd.js +99 -66
  52. package/mobile/bundle/bundle.umd.min.js +1 -1
  53. package/mobile/bundle/components/CreditCardForm/formStateMap.d.ts +10 -10
  54. package/mobile/bundle/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
  55. package/mobile/bundle/components/CreditCardForm/renderInfo.d.ts +2 -1
  56. package/mobile/bundle/components/CreditCardForm/renderStep.d.ts +3 -4
  57. package/mobile/dist/api/RetailAPI/updateRefreshToken.js +12 -5
  58. package/mobile/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
  59. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -4
  60. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  61. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +61 -34
  62. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  63. package/mobile/dist/components/CreditCardForm/formStateMap.d.ts +10 -10
  64. package/mobile/dist/components/CreditCardForm/formStateMap.js +3 -7
  65. package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  66. package/mobile/dist/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
  67. package/mobile/dist/components/CreditCardForm/getFilteredInputs.js +11 -0
  68. package/mobile/dist/components/CreditCardForm/getFilteredInputs.js.map +1 -0
  69. package/mobile/dist/components/CreditCardForm/getInitialFormState.js +3 -0
  70. package/mobile/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
  71. package/mobile/dist/components/CreditCardForm/renderInfo.d.ts +2 -1
  72. package/mobile/dist/components/CreditCardForm/renderInfo.js +5 -3
  73. package/mobile/dist/components/CreditCardForm/renderInfo.js.map +1 -1
  74. package/mobile/dist/components/CreditCardForm/renderStep.d.ts +3 -4
  75. package/mobile/dist/components/CreditCardForm/renderStep.js +1 -9
  76. package/mobile/dist/components/CreditCardForm/renderStep.js.map +1 -1
  77. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +3 -1
  78. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  79. package/mobile/lib/api/RetailAPI/updateRefreshToken.js +12 -5
  80. package/mobile/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
  81. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -4
  82. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  83. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +61 -34
  84. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  85. package/mobile/lib/components/CreditCardForm/formStateMap.d.ts +10 -10
  86. package/mobile/lib/components/CreditCardForm/formStateMap.js +3 -7
  87. package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  88. package/mobile/lib/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
  89. package/mobile/lib/components/CreditCardForm/getFilteredInputs.js +8 -0
  90. package/mobile/lib/components/CreditCardForm/getFilteredInputs.js.map +1 -0
  91. package/mobile/lib/components/CreditCardForm/getInitialFormState.js +3 -0
  92. package/mobile/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
  93. package/mobile/lib/components/CreditCardForm/renderInfo.d.ts +2 -1
  94. package/mobile/lib/components/CreditCardForm/renderInfo.js +5 -3
  95. package/mobile/lib/components/CreditCardForm/renderInfo.js.map +1 -1
  96. package/mobile/lib/components/CreditCardForm/renderStep.d.ts +3 -4
  97. package/mobile/lib/components/CreditCardForm/renderStep.js +1 -9
  98. package/mobile/lib/components/CreditCardForm/renderStep.js.map +1 -1
  99. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +3 -1
  100. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  101. package/mobile/src/api/RetailAPI/updateRefreshToken.ts +15 -5
  102. package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +3 -6
  103. package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +61 -34
  104. package/mobile/src/components/CreditCardForm/formStateMap.tsx +14 -17
  105. package/mobile/src/components/CreditCardForm/getFilteredInputs.tsx +18 -0
  106. package/mobile/src/components/CreditCardForm/getInitialFormState.tsx +3 -0
  107. package/mobile/src/components/CreditCardForm/renderInfo.tsx +9 -3
  108. package/mobile/src/components/CreditCardForm/renderStep.tsx +5 -22
  109. package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +3 -1
  110. package/package.json +1 -1
  111. package/src/api/RetailAPI/updateRefreshToken.ts +15 -5
  112. package/src/components/CreditCardForm/CreditCardFormStep.tsx +3 -6
  113. package/src/components/CreditCardForm/creditCardFormStepsData.tsx +61 -34
  114. package/src/components/CreditCardForm/formStateMap.tsx +14 -17
  115. package/src/components/CreditCardForm/getFilteredInputs.tsx +18 -0
  116. package/src/components/CreditCardForm/getInitialFormState.tsx +3 -0
  117. package/src/components/CreditCardForm/renderInfo.tsx +9 -3
  118. package/src/components/CreditCardForm/renderStep.tsx +5 -22
  119. package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +3 -1
@@ -3545,7 +3545,7 @@
3545
3545
  const [responseType, setResponseType] = useState('');
3546
3546
  const responseTypeDialog = useResponseTypeDialog({ typeForm });
3547
3547
  const handleSubmit = useCallback(async (formData, ev) => {
3548
- const inputsFiltered = getFilteredInputs(inputs, formData);
3548
+ const inputsFiltered = getFilteredInputs$1(inputs, formData);
3549
3549
  const feedbackValidator = objectValidator(getObjectValidator(inputsFiltered));
3550
3550
  if (!isValidationSuccess(feedbackValidator(formData))) {
3551
3551
  return console.warn('validation fail');
@@ -3572,7 +3572,7 @@
3572
3572
  }, [responseType]);
3573
3573
  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] }));
3574
3574
  });
3575
- const getFilteredInputs = (inputs, data) => inputs
3575
+ const getFilteredInputs$1 = (inputs, data) => inputs
3576
3576
  .filter((_) => (_?.name === 'secondaryPhone' ? Boolean(data.secondaryPhone) : _))
3577
3577
  .filter((input) => !input?.condition ||
3578
3578
  input?.condition.values.find((_) => {
@@ -6143,11 +6143,6 @@
6143
6143
  fiasCode: '',
6144
6144
  },
6145
6145
  housing: '',
6146
- methodObtain: 'office',
6147
- addressCourier: {
6148
- fullAddress: '',
6149
- fiasCode: '',
6150
- },
6151
6146
  },
6152
6147
  2: {
6153
6148
  amountWorkers: { key: '', text: '' },
@@ -6174,6 +6169,7 @@
6174
6169
  familyStatus: { key: '', text: '' },
6175
6170
  dependents: undefined,
6176
6171
  familyMembers: undefined,
6172
+ confirmationIncome: { key: '', text: '' },
6177
6173
  mandatoryIncome: undefined,
6178
6174
  otherPayments: undefined,
6179
6175
  snils: '',
@@ -6192,11 +6188,11 @@
6192
6188
  fullAddress: '',
6193
6189
  fiasCode: '',
6194
6190
  },
6195
- bankEmployeeCode: '',
6196
- addressCoutier: {
6191
+ addressCourier: {
6197
6192
  fullAddress: '',
6198
6193
  fiasCode: '',
6199
6194
  },
6195
+ bankEmployeeCode: '',
6200
6196
  methodObtain: 'office',
6201
6197
  deliveryDate: undefined,
6202
6198
  },
@@ -6218,6 +6214,9 @@
6218
6214
  localStorageData.beginDate = localStorageData?.beginDate
6219
6215
  ? new Date(localStorageData.beginDate)
6220
6216
  : undefined;
6217
+ localStorageData.deliveryDate = localStorageData?.deliveryDate
6218
+ ? new Date(localStorageData.deliveryDate)
6219
+ : undefined;
6221
6220
  }
6222
6221
  return {
6223
6222
  ...formStateMap$1[step],
@@ -6225,24 +6224,25 @@
6225
6224
  };
6226
6225
  };
6227
6226
 
6228
- const renderInfo$2 = (inputs = []) => {
6227
+ const getFilteredInputs = (inputs, data) => inputs
6228
+ .filter((_) => _)
6229
+ .filter((input) => !input?.condition ||
6230
+ input?.condition.values.find((_) => {
6231
+ const dataValue = data?.[input?.condition?.name ?? ''];
6232
+ return _ === (dataValue?.key ?? dataValue);
6233
+ }));
6234
+
6235
+ const renderInfo$2 = (state, inputs = []) => {
6229
6236
  const infoInputs = inputs.filter((_) => _.fieldType === 'info');
6230
- return infoInputs.length
6231
- ? infoInputs.map(({ text, name }, i) => jsx(InfoCard, { __html: text }, `${name}_${i}`))
6237
+ const filteredInputs = getFilteredInputs(infoInputs, state);
6238
+ return filteredInputs.length
6239
+ ? filteredInputs.map(({ text, name }, i) => jsx(InfoCard, { __html: text }, `${name}_${i}`))
6232
6240
  : null;
6233
6241
  };
6234
6242
 
6235
6243
  const renderInputs$1 = ({ field, inputs }) => (inputs || [])?.map(getField(field, ''));
6236
6244
 
6237
- const renderLastStep = ({ sections, field, methodObtain }) => sections
6238
- ?.filter(({ type }) => type === methodObtain || !type)
6239
- .map(({ inputs, columns, title }, i) => (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(inputs), renderTitle(title), renderInputs$1({ field, inputs })] }, `section-${i}`)));
6240
- const renderStep$2 = ({ sections, field, isLastStep, methodObtain }) => {
6241
- if (isLastStep) {
6242
- return renderLastStep({ sections, field, methodObtain });
6243
- }
6244
- return sections?.map(({ inputs, columns, title }, i) => (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(inputs), renderTitle(title), renderInputs$1({ field, inputs })] }, `section-${i}`)));
6245
- };
6245
+ const renderStep$2 = ({ sections, field, userInputParams }) => sections?.map(({ inputs, columns, title }, i) => (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(userInputParams, inputs), renderTitle(title), renderInputs$1({ field, inputs })] }, `section-${i}`)));
6246
6246
 
6247
6247
  const StepsNavigationButtons$1 = JSX(({ step, onPrevStep }) => {
6248
6248
  const isFirstStep = step === 0;
@@ -6387,7 +6387,8 @@
6387
6387
  const [profileId] = useLocalStorage('profileId');
6388
6388
  const [participantId] = useLocalStorage('participantId');
6389
6389
  const handleSubmit = useCallback(async (formData) => {
6390
- const feedbackValidator = objectValidator(getObjectValidator(calculateInputs$1(formData, inputs, step)));
6390
+ const inputsFiltered = getFilteredInputs(inputs, formData);
6391
+ const feedbackValidator = objectValidator(getObjectValidator(calculateInputs$1(formData, inputsFiltered, step)));
6391
6392
  if (!isValidationSuccess(feedbackValidator(formData))) {
6392
6393
  return console.warn('validation fail');
6393
6394
  }
@@ -6432,18 +6433,16 @@
6432
6433
  saveStep,
6433
6434
  finishForm,
6434
6435
  });
6435
- const [state, { field, onSubmit }] = useForm(initialState, {
6436
+ const [userInputParams, { field, onSubmit }] = useForm(initialState, {
6436
6437
  onSubmit: (formData, ev) => {
6437
6438
  handleSubmit({ ...formData, ...customSubmit.current?.(ev) });
6438
6439
  },
6439
6440
  });
6440
- const methodObtain = 'methodObtain' in state ? state.methodObtain : undefined;
6441
6441
  return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep$2({
6442
6442
  sections,
6443
6443
  field,
6444
6444
  registerSubmit,
6445
- methodObtain,
6446
- isLastStep: step === 5,
6445
+ userInputParams: userInputParams,
6447
6446
  }), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
6448
6447
  });
6449
6448
 
@@ -6702,56 +6701,83 @@
6702
6701
  inputs: [{ fieldType: 'common', name: 'methodObtain' }],
6703
6702
  },
6704
6703
  {
6705
- type: 'courier',
6706
6704
  title: 'Адрес',
6707
6705
  columns: 1,
6708
6706
  inputs: [],
6709
6707
  },
6710
6708
  {
6711
- type: 'courier',
6712
- inputs: [{ fieldType: 'common', name: 'addressCourier', dadata: true }],
6713
- },
6714
- {
6715
- type: 'courier',
6716
- inputs: [{ fieldType: 'common', name: 'deliveryDate' }],
6717
- },
6718
- {
6719
- type: 'courier',
6720
- inputs: [{ fieldType: 'common', name: 'comment' }],
6721
- },
6722
- {
6723
- type: 'office',
6724
- title: 'Отделение Банка',
6725
- columns: 1,
6726
- inputs: [],
6727
- },
6728
- {
6729
- type: 'office',
6730
- inputs: [{ fieldType: 'common', name: 'regionRetail', required: true }],
6731
- },
6732
- {
6733
- type: 'office',
6734
- inputs: [{ fieldType: 'common', name: 'addressRetail', required: true }],
6709
+ inputs: [
6710
+ {
6711
+ fieldType: 'common',
6712
+ name: 'addressCourier',
6713
+ dadata: true,
6714
+ condition: {
6715
+ name: 'methodObtain',
6716
+ values: ['courier'],
6717
+ },
6718
+ required: true,
6719
+ },
6720
+ {
6721
+ fieldType: 'common',
6722
+ name: 'deliveryDate',
6723
+ condition: {
6724
+ name: 'methodObtain',
6725
+ values: ['courier'],
6726
+ },
6727
+ required: true,
6728
+ },
6729
+ {
6730
+ fieldType: 'common',
6731
+ name: 'comment',
6732
+ condition: {
6733
+ name: 'methodObtain',
6734
+ values: ['courier'],
6735
+ },
6736
+ },
6737
+ ],
6735
6738
  },
6736
6739
  {
6737
- type: 'office',
6738
- title: 'Код представителя Банка',
6739
- columns: 1,
6740
- inputs: [],
6740
+ inputs: [
6741
+ {
6742
+ fieldType: 'common',
6743
+ name: 'regionRetail',
6744
+ required: true,
6745
+ condition: {
6746
+ name: 'methodObtain',
6747
+ values: ['office'],
6748
+ },
6749
+ },
6750
+ {
6751
+ fieldType: 'common',
6752
+ name: 'addressRetail',
6753
+ required: true,
6754
+ condition: {
6755
+ name: 'methodObtain',
6756
+ values: ['office'],
6757
+ },
6758
+ },
6759
+ ],
6741
6760
  },
6742
6761
  {
6743
- type: 'office',
6744
6762
  inputs: [
6745
6763
  {
6746
6764
  fieldType: 'info',
6747
6765
  text: 'Если представитель Банка помогал Вам в заведении заявки, введите здесь его код',
6766
+ condition: {
6767
+ name: 'methodObtain',
6768
+ values: ['office'],
6769
+ },
6770
+ },
6771
+ {
6772
+ fieldType: 'common',
6773
+ name: 'bankEmployeeCode',
6774
+ condition: {
6775
+ name: 'methodObtain',
6776
+ values: ['office'],
6777
+ },
6748
6778
  },
6749
6779
  ],
6750
6780
  },
6751
- {
6752
- type: 'office',
6753
- inputs: [{ fieldType: 'common', name: 'bankEmployeeCode' }],
6754
- },
6755
6781
  ],
6756
6782
  ];
6757
6783
 
@@ -6789,7 +6815,7 @@
6789
6815
  globalThis.location.href = PORTAL_NATURAL_URL;
6790
6816
  return () => null;
6791
6817
  }
6792
- const timer = setInterval(async () => {
6818
+ const updateTokenRequest = async () => {
6793
6819
  const res = await doRequest('/auth/refresh', 'POST', {
6794
6820
  // eslint-disable-next-line camelcase
6795
6821
  refresh_token: refreshToken,
@@ -6797,14 +6823,21 @@
6797
6823
  access_token: accessToken,
6798
6824
  });
6799
6825
  if (res instanceof Response) {
6800
- globalThis.location.href = PORTAL_NATURAL_URL;
6826
+ handleStatus(res.status);
6801
6827
  return;
6802
6828
  }
6803
- sessionStorage.setItem('refreshToken', res.refresh_token);
6804
- sessionStorage.setItem('accessToken', res.access_token);
6805
- }, UPDATING_INTERVAL);
6829
+ globalThis.sessionStorage.setItem('refreshToken', res.refresh_token);
6830
+ globalThis.sessionStorage.setItem('accessToken', res.access_token);
6831
+ };
6832
+ updateTokenRequest();
6833
+ const timer = setInterval(updateTokenRequest, UPDATING_INTERVAL);
6806
6834
  return () => clearInterval(timer);
6807
6835
  };
6836
+ const handleStatus = (status) => {
6837
+ if (status == 401) {
6838
+ globalThis.location.href = PORTAL_NATURAL_URL;
6839
+ }
6840
+ };
6808
6841
 
6809
6842
  const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
6810
6843
  const progress = useMemo(() => (step / totalSteps) * 100, [step, totalSteps]);
@@ -9820,7 +9853,7 @@
9820
9853
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
9821
9854
  });
9822
9855
 
9823
- const packageVersion = "0.14.653";
9856
+ const packageVersion = "0.14.655";
9824
9857
 
9825
9858
  exports.Blocks = Blocks;
9826
9859
  exports.ContentPage = ContentPage;