@redneckz/wildless-cms-uni-blocks 0.14.695 → 0.14.696

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 (35) hide show
  1. package/bundle/bundle.umd.js +33 -6
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/CreditCardForm/useCreditCardFormAPI.js +9 -2
  4. package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  5. package/dist/components/CreditForm/useCreditFormAPI.js +9 -2
  6. package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
  7. package/dist/ui-kit/FormField/Fields/AddressFactField.js +14 -1
  8. package/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
  9. package/lib/components/CreditCardForm/useCreditCardFormAPI.js +9 -2
  10. package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  11. package/lib/components/CreditForm/useCreditFormAPI.js +9 -2
  12. package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
  13. package/lib/ui-kit/FormField/Fields/AddressFactField.js +14 -1
  14. package/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
  15. package/mobile/bundle/bundle.umd.js +33 -6
  16. package/mobile/bundle/bundle.umd.min.js +1 -1
  17. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +9 -2
  18. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  19. package/mobile/dist/components/CreditForm/useCreditFormAPI.js +9 -2
  20. package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
  21. package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js +14 -1
  22. package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
  23. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +9 -2
  24. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  25. package/mobile/lib/components/CreditForm/useCreditFormAPI.js +9 -2
  26. package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
  27. package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js +14 -1
  28. package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
  29. package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +10 -2
  30. package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +10 -2
  31. package/mobile/src/ui-kit/FormField/Fields/AddressFactField.tsx +14 -1
  32. package/package.json +1 -1
  33. package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +10 -2
  34. package/src/components/CreditForm/useCreditFormAPI.tsx +10 -2
  35. package/src/ui-kit/FormField/Fields/AddressFactField.tsx +14 -1
@@ -1873,8 +1873,21 @@
1873
1873
  }, []);
1874
1874
  const onChange = useCallback((val) => {
1875
1875
  field?.(fieldName)?.onChange?.({
1876
- ...field(fieldName).value,
1876
+ apartment: '',
1877
+ city: '',
1878
+ district: '',
1877
1879
  fullAddress: val,
1880
+ fiasCode: '',
1881
+ house: '',
1882
+ locality: '',
1883
+ okatoRegionCode: '',
1884
+ postcode: '',
1885
+ region: '',
1886
+ regionCode: '',
1887
+ street: '',
1888
+ qc: '',
1889
+ qcComplete: '',
1890
+ qcHouse: '',
1878
1891
  });
1879
1892
  }, []);
1880
1893
  return (jsx(InputControl, { label: "\u0410\u0434\u0440\u0435\u0441", disabled: value, ...getValidation(field(fieldName), validatorObj[fieldName], input?.required), value: fieldValue.fullAddress, onChange: onChange, ...input, onDaDataChange: onDaDataChange }));
@@ -6728,6 +6741,7 @@
6728
6741
  };
6729
6742
 
6730
6743
  const useCreditCardFormAPI = ({ step, inputs, onNextStep, saveStep, finishForm, }) => {
6744
+ const isFinalStep = step === 5;
6731
6745
  const [taskId] = useLocalStorage('taskId');
6732
6746
  const [profileId] = useLocalStorage('profileId');
6733
6747
  const [participantId] = useLocalStorage('participantId');
@@ -6739,20 +6753,21 @@
6739
6753
  saveStep(formData);
6740
6754
  try {
6741
6755
  if (taskId && profileId && participantId) {
6742
- await updateUserTask(getCreditCardFormTaskData({
6756
+ const response = await updateUserTask(getCreditCardFormTaskData({
6743
6757
  participantId,
6744
6758
  taskId,
6745
6759
  profileId,
6746
6760
  step,
6747
6761
  formData: formData,
6748
6762
  }));
6763
+ resetForm$1(isFinalStep, response);
6749
6764
  }
6750
6765
  }
6751
6766
  catch (ex) {
6752
6767
  return 'Fail';
6753
6768
  }
6754
6769
  onNextStep();
6755
- if (step === 5) {
6770
+ if (isFinalStep) {
6756
6771
  finishForm?.(true);
6757
6772
  }
6758
6773
  return 'OK';
@@ -6761,6 +6776,11 @@
6761
6776
  handleSubmit,
6762
6777
  };
6763
6778
  };
6779
+ const resetForm$1 = (isFinalStep, response) => {
6780
+ if (isFinalStep && response.ok) {
6781
+ globalThis.localStorage.removeItem('leadForm');
6782
+ }
6783
+ };
6764
6784
  const getValue$2 = (formData) => (name) => formData[name];
6765
6785
 
6766
6786
  const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, isFormFinished, finishForm }) => {
@@ -7600,6 +7620,7 @@
7600
7620
  };
7601
7621
 
7602
7622
  const useCreditFormAPI = ({ step, inputs, onNextStep, saveStep, finishForm, }) => {
7623
+ const isFinalStep = step === 5;
7603
7624
  const [taskId] = useLocalStorage('taskId');
7604
7625
  const [profileId] = useLocalStorage('profileId');
7605
7626
  const [participantId] = useLocalStorage('participantId');
@@ -7611,20 +7632,21 @@
7611
7632
  saveStep(formData);
7612
7633
  try {
7613
7634
  if (taskId && profileId && participantId) {
7614
- await updateUserTask(getCreditFormTaskData({
7635
+ const response = await updateUserTask(getCreditFormTaskData({
7615
7636
  participantId,
7616
7637
  taskId,
7617
7638
  profileId,
7618
7639
  step,
7619
7640
  formData: formData,
7620
7641
  }));
7642
+ resetForm(isFinalStep, response);
7621
7643
  }
7622
7644
  }
7623
7645
  catch (ex) {
7624
7646
  return 'Fail';
7625
7647
  }
7626
7648
  onNextStep();
7627
- if (step === 5) {
7649
+ if (isFinalStep) {
7628
7650
  finishForm?.(true);
7629
7651
  }
7630
7652
  return 'OK';
@@ -7633,6 +7655,11 @@
7633
7655
  handleSubmit,
7634
7656
  };
7635
7657
  };
7658
+ const resetForm = (isFinalStep, response) => {
7659
+ if (isFinalStep && response.ok) {
7660
+ globalThis.localStorage.removeItem('leadForm');
7661
+ }
7662
+ };
7636
7663
  const getValue = (formData) => (name) => formData[name];
7637
7664
 
7638
7665
  const CreditFormStep = JSX(({ step, sections, onPrevStep, onNextStep, isFormFinished, finishForm, programsSource }) => {
@@ -10383,7 +10410,7 @@
10383
10410
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10384
10411
  });
10385
10412
 
10386
- const packageVersion = "0.14.694";
10413
+ const packageVersion = "0.14.695";
10387
10414
 
10388
10415
  exports.Blocks = Blocks;
10389
10416
  exports.ContentPage = ContentPage;