@redneckz/wildless-cms-uni-blocks 0.14.694 → 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.
- package/bundle/bundle.umd.js +39 -15
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/FormField/Fields/CurrencyField.d.ts +0 -7
- package/dist/components/CreditCardForm/formStateMap.js +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +9 -2
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js +9 -2
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/AddressFactField.js +14 -1
- package/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CurrencyField.d.ts +0 -7
- package/dist/ui-kit/FormField/Fields/CurrencyField.js +6 -9
- package/dist/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/components/CreditCardForm/formStateMap.js +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +9 -2
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js +9 -2
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/AddressFactField.js +14 -1
- package/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CurrencyField.d.ts +0 -7
- package/lib/ui-kit/FormField/Fields/CurrencyField.js +5 -8
- package/lib/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +1 -0
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +39 -15
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/FormField/Fields/CurrencyField.d.ts +0 -7
- package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +9 -2
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +9 -2
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js +14 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CurrencyField.d.ts +0 -7
- package/mobile/dist/ui-kit/FormField/Fields/CurrencyField.js +6 -9
- package/mobile/dist/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +9 -2
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +9 -2
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js +14 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CurrencyField.d.ts +0 -7
- package/mobile/lib/ui-kit/FormField/Fields/CurrencyField.js +5 -8
- package/mobile/lib/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +1 -0
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -1
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +10 -2
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +10 -2
- package/mobile/src/ui-kit/FormField/Fields/AddressFactField.tsx +14 -1
- package/mobile/src/ui-kit/FormField/Fields/CurrencyField.tsx +8 -8
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
- package/package.json +1 -1
- package/src/components/CreditCardForm/formStateMap.tsx +1 -1
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +10 -2
- package/src/components/CreditForm/useCreditFormAPI.tsx +10 -2
- package/src/ui-kit/FormField/Fields/AddressFactField.tsx +14 -1
- package/src/ui-kit/FormField/Fields/CurrencyField.tsx +8 -8
- package/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -1701,6 +1701,7 @@
|
|
|
1701
1701
|
addressCourier: addressDaDataValidator(),
|
|
1702
1702
|
cardCategory: defaultValidator('Укажите категорию карты'),
|
|
1703
1703
|
paymentSystem: defaultValidator('Укажите тип платежной системы'),
|
|
1704
|
+
currency: defaultValidator('Укажите валюту'),
|
|
1704
1705
|
};
|
|
1705
1706
|
const getObjectValidator = (inputs) => {
|
|
1706
1707
|
const requiredInputs = getNamesFromInput(inputs.filter((_) => Boolean(_?.required)));
|
|
@@ -1872,8 +1873,21 @@
|
|
|
1872
1873
|
}, []);
|
|
1873
1874
|
const onChange = useCallback((val) => {
|
|
1874
1875
|
field?.(fieldName)?.onChange?.({
|
|
1875
|
-
|
|
1876
|
+
apartment: '',
|
|
1877
|
+
city: '',
|
|
1878
|
+
district: '',
|
|
1876
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: '',
|
|
1877
1891
|
});
|
|
1878
1892
|
}, []);
|
|
1879
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 }));
|
|
@@ -3428,16 +3442,12 @@
|
|
|
3428
3442
|
|
|
3429
3443
|
const RadioButtonGroupControl = JSX(({ className, label, onChange, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(RadioButtonGroup, { label: getRequiredLabel({ label, errors: rest?.errors }), onChange: (_) => onChange && onChange(_), ...rest }), renderErrorText(error)] })));
|
|
3430
3444
|
|
|
3431
|
-
|
|
3432
|
-
(function (CurrencyCode) {
|
|
3433
|
-
CurrencyCode["rub"] = "810";
|
|
3434
|
-
CurrencyCode["dollar"] = "840";
|
|
3435
|
-
CurrencyCode["euro"] = "978";
|
|
3436
|
-
})(CurrencyCode || (CurrencyCode = {}));
|
|
3437
|
-
const CURRENCY_TYPES = [{ id: CurrencyCode.rub, text: 'Рубль' }];
|
|
3445
|
+
const DEFAULT_CURRENCY_TYPES = [{ id: '810', text: 'Рубли' }];
|
|
3438
3446
|
const CurrencyField = JSX(({ field, input }) => {
|
|
3439
3447
|
const { value, onChange } = field('currency');
|
|
3440
|
-
|
|
3448
|
+
const { data } = useLeadFormData('CURRENCY');
|
|
3449
|
+
const currencyTypes = data?.map((_) => ({ id: _.key, text: _.value })) ?? DEFAULT_CURRENCY_TYPES;
|
|
3450
|
+
return (jsx(RadioButtonGroupControl, { label: "\u0412\u0430\u043B\u044E\u0442\u0430", orientation: "horizontal", items: currencyTypes, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('currency'), validatorObj.currency, input?.required) }));
|
|
3441
3451
|
});
|
|
3442
3452
|
|
|
3443
3453
|
const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...getValidation(field('deliveryDate'), validatorObj.deliveryDate, input?.required) })));
|
|
@@ -6392,7 +6402,7 @@
|
|
|
6392
6402
|
const formStateMap$1 = [
|
|
6393
6403
|
{
|
|
6394
6404
|
paymentSystem: '',
|
|
6395
|
-
currency: '
|
|
6405
|
+
currency: '810',
|
|
6396
6406
|
codeWord: '',
|
|
6397
6407
|
},
|
|
6398
6408
|
{
|
|
@@ -6731,6 +6741,7 @@
|
|
|
6731
6741
|
};
|
|
6732
6742
|
|
|
6733
6743
|
const useCreditCardFormAPI = ({ step, inputs, onNextStep, saveStep, finishForm, }) => {
|
|
6744
|
+
const isFinalStep = step === 5;
|
|
6734
6745
|
const [taskId] = useLocalStorage('taskId');
|
|
6735
6746
|
const [profileId] = useLocalStorage('profileId');
|
|
6736
6747
|
const [participantId] = useLocalStorage('participantId');
|
|
@@ -6742,20 +6753,21 @@
|
|
|
6742
6753
|
saveStep(formData);
|
|
6743
6754
|
try {
|
|
6744
6755
|
if (taskId && profileId && participantId) {
|
|
6745
|
-
await updateUserTask(getCreditCardFormTaskData({
|
|
6756
|
+
const response = await updateUserTask(getCreditCardFormTaskData({
|
|
6746
6757
|
participantId,
|
|
6747
6758
|
taskId,
|
|
6748
6759
|
profileId,
|
|
6749
6760
|
step,
|
|
6750
6761
|
formData: formData,
|
|
6751
6762
|
}));
|
|
6763
|
+
resetForm$1(isFinalStep, response);
|
|
6752
6764
|
}
|
|
6753
6765
|
}
|
|
6754
6766
|
catch (ex) {
|
|
6755
6767
|
return 'Fail';
|
|
6756
6768
|
}
|
|
6757
6769
|
onNextStep();
|
|
6758
|
-
if (
|
|
6770
|
+
if (isFinalStep) {
|
|
6759
6771
|
finishForm?.(true);
|
|
6760
6772
|
}
|
|
6761
6773
|
return 'OK';
|
|
@@ -6764,6 +6776,11 @@
|
|
|
6764
6776
|
handleSubmit,
|
|
6765
6777
|
};
|
|
6766
6778
|
};
|
|
6779
|
+
const resetForm$1 = (isFinalStep, response) => {
|
|
6780
|
+
if (isFinalStep && response.ok) {
|
|
6781
|
+
globalThis.localStorage.removeItem('leadForm');
|
|
6782
|
+
}
|
|
6783
|
+
};
|
|
6767
6784
|
const getValue$2 = (formData) => (name) => formData[name];
|
|
6768
6785
|
|
|
6769
6786
|
const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, isFormFinished, finishForm }) => {
|
|
@@ -7603,6 +7620,7 @@
|
|
|
7603
7620
|
};
|
|
7604
7621
|
|
|
7605
7622
|
const useCreditFormAPI = ({ step, inputs, onNextStep, saveStep, finishForm, }) => {
|
|
7623
|
+
const isFinalStep = step === 5;
|
|
7606
7624
|
const [taskId] = useLocalStorage('taskId');
|
|
7607
7625
|
const [profileId] = useLocalStorage('profileId');
|
|
7608
7626
|
const [participantId] = useLocalStorage('participantId');
|
|
@@ -7614,20 +7632,21 @@
|
|
|
7614
7632
|
saveStep(formData);
|
|
7615
7633
|
try {
|
|
7616
7634
|
if (taskId && profileId && participantId) {
|
|
7617
|
-
await updateUserTask(getCreditFormTaskData({
|
|
7635
|
+
const response = await updateUserTask(getCreditFormTaskData({
|
|
7618
7636
|
participantId,
|
|
7619
7637
|
taskId,
|
|
7620
7638
|
profileId,
|
|
7621
7639
|
step,
|
|
7622
7640
|
formData: formData,
|
|
7623
7641
|
}));
|
|
7642
|
+
resetForm(isFinalStep, response);
|
|
7624
7643
|
}
|
|
7625
7644
|
}
|
|
7626
7645
|
catch (ex) {
|
|
7627
7646
|
return 'Fail';
|
|
7628
7647
|
}
|
|
7629
7648
|
onNextStep();
|
|
7630
|
-
if (
|
|
7649
|
+
if (isFinalStep) {
|
|
7631
7650
|
finishForm?.(true);
|
|
7632
7651
|
}
|
|
7633
7652
|
return 'OK';
|
|
@@ -7636,6 +7655,11 @@
|
|
|
7636
7655
|
handleSubmit,
|
|
7637
7656
|
};
|
|
7638
7657
|
};
|
|
7658
|
+
const resetForm = (isFinalStep, response) => {
|
|
7659
|
+
if (isFinalStep && response.ok) {
|
|
7660
|
+
globalThis.localStorage.removeItem('leadForm');
|
|
7661
|
+
}
|
|
7662
|
+
};
|
|
7639
7663
|
const getValue = (formData) => (name) => formData[name];
|
|
7640
7664
|
|
|
7641
7665
|
const CreditFormStep = JSX(({ step, sections, onPrevStep, onNextStep, isFormFinished, finishForm, programsSource }) => {
|
|
@@ -10386,7 +10410,7 @@
|
|
|
10386
10410
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10387
10411
|
});
|
|
10388
10412
|
|
|
10389
|
-
const packageVersion = "0.14.
|
|
10413
|
+
const packageVersion = "0.14.695";
|
|
10390
10414
|
|
|
10391
10415
|
exports.Blocks = Blocks;
|
|
10392
10416
|
exports.ContentPage = ContentPage;
|