@redneckz/wildless-cms-uni-blocks 0.14.671 → 0.14.672
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/api/RetailAPI/getCardTypes.d.ts +8 -0
- package/bundle/api/RetailAPI/getPaymentSystems.d.ts +4 -0
- package/bundle/bundle.umd.js +40 -10
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/FormField/Fields/PaymentSystemField.d.ts +0 -2
- package/dist/api/RetailAPI/doRequest.js +1 -1
- package/dist/api/RetailAPI/doRequest.js.map +1 -1
- package/dist/api/RetailAPI/getCardTypes.d.ts +8 -0
- package/dist/api/RetailAPI/getCardTypes.js +13 -0
- package/dist/api/RetailAPI/getCardTypes.js.map +1 -0
- package/dist/api/RetailAPI/getPaymentSystems.d.ts +4 -0
- package/dist/api/RetailAPI/getPaymentSystems.js +15 -0
- package/dist/api/RetailAPI/getPaymentSystems.js.map +1 -0
- package/dist/components/CreditCardForm/formStateMap.js +1 -2
- package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CardCategoryField.js +11 -3
- package/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PaymentSystemField.d.ts +0 -2
- package/dist/ui-kit/FormField/Fields/PaymentSystemField.js +11 -6
- package/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/lib/api/RetailAPI/doRequest.js +1 -1
- package/lib/api/RetailAPI/doRequest.js.map +1 -1
- package/lib/api/RetailAPI/getCardTypes.d.ts +8 -0
- package/lib/api/RetailAPI/getCardTypes.js +10 -0
- package/lib/api/RetailAPI/getCardTypes.js.map +1 -0
- package/lib/api/RetailAPI/getPaymentSystems.d.ts +4 -0
- package/lib/api/RetailAPI/getPaymentSystems.js +12 -0
- package/lib/api/RetailAPI/getPaymentSystems.js.map +1 -0
- package/lib/components/CreditCardForm/formStateMap.js +1 -2
- package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CardCategoryField.js +11 -3
- package/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PaymentSystemField.d.ts +0 -2
- package/lib/ui-kit/FormField/Fields/PaymentSystemField.js +10 -5
- package/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/getCardTypes.d.ts +8 -0
- package/mobile/bundle/api/RetailAPI/getPaymentSystems.d.ts +4 -0
- package/mobile/bundle/bundle.umd.js +40 -10
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/FormField/Fields/PaymentSystemField.d.ts +0 -2
- package/mobile/dist/api/RetailAPI/doRequest.js +1 -1
- package/mobile/dist/api/RetailAPI/doRequest.js.map +1 -1
- package/mobile/dist/api/RetailAPI/getCardTypes.d.ts +8 -0
- package/mobile/dist/api/RetailAPI/getCardTypes.js +13 -0
- package/mobile/dist/api/RetailAPI/getCardTypes.js.map +1 -0
- package/mobile/dist/api/RetailAPI/getPaymentSystems.d.ts +4 -0
- package/mobile/dist/api/RetailAPI/getPaymentSystems.js +15 -0
- package/mobile/dist/api/RetailAPI/getPaymentSystems.js.map +1 -0
- package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -2
- package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js +11 -3
- package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.d.ts +0 -2
- package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js +11 -6
- package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/lib/api/RetailAPI/doRequest.js +1 -1
- package/mobile/lib/api/RetailAPI/doRequest.js.map +1 -1
- package/mobile/lib/api/RetailAPI/getCardTypes.d.ts +8 -0
- package/mobile/lib/api/RetailAPI/getCardTypes.js +10 -0
- package/mobile/lib/api/RetailAPI/getCardTypes.js.map +1 -0
- package/mobile/lib/api/RetailAPI/getPaymentSystems.d.ts +4 -0
- package/mobile/lib/api/RetailAPI/getPaymentSystems.js +12 -0
- package/mobile/lib/api/RetailAPI/getPaymentSystems.js.map +1 -0
- package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -2
- package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js +11 -3
- package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.d.ts +0 -2
- package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js +10 -5
- package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/src/api/RetailAPI/doRequest.ts +1 -1
- package/mobile/src/api/RetailAPI/getCardTypes.ts +20 -0
- package/mobile/src/api/RetailAPI/getPaymentSystems.ts +21 -0
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -2
- package/mobile/src/ui-kit/FormField/Fields/CardCategoryField.tsx +12 -3
- package/mobile/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +12 -6
- package/package.json +1 -1
- package/src/api/RetailAPI/doRequest.ts +1 -1
- package/src/api/RetailAPI/getCardTypes.ts +20 -0
- package/src/api/RetailAPI/getPaymentSystems.ts +21 -0
- package/src/components/CreditCardForm/formStateMap.tsx +1 -2
- package/src/ui-kit/FormField/Fields/CardCategoryField.tsx +12 -3
- package/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +12 -6
package/bundle/bundle.umd.js
CHANGED
|
@@ -2027,7 +2027,7 @@
|
|
|
2027
2027
|
}
|
|
2028
2028
|
};
|
|
2029
2029
|
async function doRequest(url, method, body) {
|
|
2030
|
-
return
|
|
2030
|
+
return globalThis?.fetch?.(`${API_BASE_URI}${url}`, {
|
|
2031
2031
|
method,
|
|
2032
2032
|
headers: {
|
|
2033
2033
|
'Content-Type': 'application/json',
|
|
@@ -2885,9 +2885,25 @@
|
|
|
2885
2885
|
const FIELD_NAME$7 = 'birthPlace';
|
|
2886
2886
|
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, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$7) })));
|
|
2887
2887
|
|
|
2888
|
+
const getCardTypes = async (paymentSystemType) => {
|
|
2889
|
+
const response = await doRequest('/dictionaryFiltered', 'POST', {
|
|
2890
|
+
type: 'CARD_TYPE',
|
|
2891
|
+
presets: { paymentSystemType, creditProgramId: 13 },
|
|
2892
|
+
});
|
|
2893
|
+
const data = await response?.json();
|
|
2894
|
+
return data;
|
|
2895
|
+
};
|
|
2896
|
+
|
|
2888
2897
|
const CardCategoryField = JSX(({ field, input }) => {
|
|
2889
|
-
const
|
|
2890
|
-
|
|
2898
|
+
const [cardTypes, setCardTypes] = useState([]);
|
|
2899
|
+
const selectedPaymentSystem = field('paymentSystem').value;
|
|
2900
|
+
useEffect(() => {
|
|
2901
|
+
(async () => {
|
|
2902
|
+
const fetchedCardTypes = await getCardTypes(selectedPaymentSystem);
|
|
2903
|
+
setCardTypes(fetchedCardTypes);
|
|
2904
|
+
})();
|
|
2905
|
+
}, [selectedPaymentSystem]);
|
|
2906
|
+
return (jsx(SelectField, { field: field, source: cardTypes, label: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F \u043A\u0430\u0440\u0442\u044B", fieldName: "cardCategory", input: input }));
|
|
2891
2907
|
});
|
|
2892
2908
|
|
|
2893
2909
|
const ChildrenField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", type: "number", ...getValidation(field('children'), validatorObj.children, input?.required), ...input })));
|
|
@@ -3188,13 +3204,27 @@
|
|
|
3188
3204
|
return (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441", isTextarea: true, ...rest }));
|
|
3189
3205
|
});
|
|
3190
3206
|
|
|
3191
|
-
const
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3207
|
+
const getPaymentSystems = async () => {
|
|
3208
|
+
const response = await doRequest('/public-data/creditProgramConditions', 'POST', {
|
|
3209
|
+
creditProgramId: 13,
|
|
3210
|
+
});
|
|
3211
|
+
const data = await response?.json();
|
|
3212
|
+
return data?.paymentSystems?.map((paymentSystem) => ({
|
|
3213
|
+
id: paymentSystem.type,
|
|
3214
|
+
text: paymentSystem.name,
|
|
3215
|
+
}));
|
|
3216
|
+
};
|
|
3217
|
+
|
|
3195
3218
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
3196
3219
|
const { value, onChange } = field('paymentSystem');
|
|
3197
|
-
|
|
3220
|
+
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
3221
|
+
useEffect(() => {
|
|
3222
|
+
(async () => {
|
|
3223
|
+
const fetchedPaymentSystems = await getPaymentSystems();
|
|
3224
|
+
setPaymentSystemOptions(fetchedPaymentSystems || []);
|
|
3225
|
+
})();
|
|
3226
|
+
}, []);
|
|
3227
|
+
return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: paymentSystemOptions, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('paymentSystem'), validatorObj.paymentSystem, input?.required) }));
|
|
3198
3228
|
});
|
|
3199
3229
|
|
|
3200
3230
|
const isPlaceholder = (_) => _ === '_';
|
|
@@ -6176,7 +6206,7 @@
|
|
|
6176
6206
|
|
|
6177
6207
|
const formStateMap$1 = [
|
|
6178
6208
|
{
|
|
6179
|
-
paymentSystem:
|
|
6209
|
+
paymentSystem: '',
|
|
6180
6210
|
currency: 'rub',
|
|
6181
6211
|
codeWord: '',
|
|
6182
6212
|
},
|
|
@@ -9982,7 +10012,7 @@
|
|
|
9982
10012
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
9983
10013
|
});
|
|
9984
10014
|
|
|
9985
|
-
const packageVersion = "0.14.
|
|
10015
|
+
const packageVersion = "0.14.671";
|
|
9986
10016
|
|
|
9987
10017
|
exports.Blocks = Blocks;
|
|
9988
10018
|
exports.ContentPage = ContentPage;
|