@redneckz/wildless-cms-uni-blocks 0.14.671 → 0.14.673
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 +53 -14
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/FormField/Fields/PaymentSystemField.d.ts +0 -2
- package/bundle/ui-kit/YandexMap/YandexMap.d.ts +1 -0
- 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/AddressRetailField.js +1 -1
- package/dist/ui-kit/FormField/Fields/AddressRetailField.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/dist/ui-kit/YandexMap/YandexMap.d.ts +1 -0
- package/dist/ui-kit/YandexMap/YandexMap.js +11 -2
- package/dist/ui-kit/YandexMap/YandexMap.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/AddressRetailField.js +1 -1
- package/lib/ui-kit/FormField/Fields/AddressRetailField.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/lib/ui-kit/YandexMap/YandexMap.d.ts +1 -0
- package/lib/ui-kit/YandexMap/YandexMap.js +11 -2
- package/lib/ui-kit/YandexMap/YandexMap.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 +53 -14
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/FormField/Fields/PaymentSystemField.d.ts +0 -2
- package/mobile/bundle/ui-kit/YandexMap/YandexMap.d.ts +1 -0
- 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/AddressRetailField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressRetailField.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/dist/ui-kit/YandexMap/YandexMap.d.ts +1 -0
- package/mobile/dist/ui-kit/YandexMap/YandexMap.js +11 -2
- package/mobile/dist/ui-kit/YandexMap/YandexMap.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/AddressRetailField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressRetailField.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/lib/ui-kit/YandexMap/YandexMap.d.ts +1 -0
- package/mobile/lib/ui-kit/YandexMap/YandexMap.js +11 -2
- package/mobile/lib/ui-kit/YandexMap/YandexMap.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/AddressRetailField.tsx +6 -1
- package/mobile/src/ui-kit/FormField/Fields/CardCategoryField.tsx +12 -3
- package/mobile/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +12 -6
- package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +58 -45
- 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/AddressRetailField.tsx +6 -1
- package/src/ui-kit/FormField/Fields/CardCategoryField.tsx +12 -3
- package/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +12 -6
- package/src/ui-kit/YandexMap/YandexMap.tsx +58 -45
|
@@ -1983,7 +1983,7 @@
|
|
|
1983
1983
|
// Сейчас реализован поиск среди тестовых данных
|
|
1984
1984
|
// TODO: Также выяснить что делать когда ничего не найдено
|
|
1985
1985
|
// TODO: На макетах также когда есть поле поиска нет кнопки открыть на карте.
|
|
1986
|
-
const YandexMap = JSX(({ points, className = '', zoom = 5, isLoad }) => {
|
|
1986
|
+
const YandexMap = JSX(({ points, className = '', zoom = 5, isLoad, selectedAddress }) => {
|
|
1987
1987
|
const map = useRef(null);
|
|
1988
1988
|
const parentDiv = useRef(null);
|
|
1989
1989
|
const yandexMaps = useYandexMaps();
|
|
@@ -2007,7 +2007,16 @@
|
|
|
2007
2007
|
renderClusterer({ yandexMaps, map: map.current, points, isLoad });
|
|
2008
2008
|
});
|
|
2009
2009
|
}
|
|
2010
|
-
|
|
2010
|
+
// zoom к выбранному отделению банка в рамках задачи по retail
|
|
2011
|
+
if (map.current && selectedAddress) {
|
|
2012
|
+
yandexMaps?.geocode(selectedAddress).then((res) => {
|
|
2013
|
+
const firstGeoObject = res.geoObjects.get(0);
|
|
2014
|
+
const coords = firstGeoObject.geometry.getCoordinates();
|
|
2015
|
+
map.current.setCenter(coords);
|
|
2016
|
+
map.current.setZoom(18);
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
}, [yandexMaps, points, zoom, isLoad, selectedAddress]);
|
|
2011
2020
|
if (!yandexMaps) {
|
|
2012
2021
|
return null;
|
|
2013
2022
|
}
|
|
@@ -2035,7 +2044,7 @@
|
|
|
2035
2044
|
}
|
|
2036
2045
|
};
|
|
2037
2046
|
async function doRequest(url, method, body) {
|
|
2038
|
-
return
|
|
2047
|
+
return globalThis?.fetch?.(`${API_BASE_URI}${url}`, {
|
|
2039
2048
|
method,
|
|
2040
2049
|
headers: {
|
|
2041
2050
|
'Content-Type': 'application/json',
|
|
@@ -2483,7 +2492,7 @@
|
|
|
2483
2492
|
const { data } = useLeadFormData('REGION_RF');
|
|
2484
2493
|
const regionValue = field('regionRetail')?.value || {};
|
|
2485
2494
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2486
|
-
field('addressRetail');
|
|
2495
|
+
const fieldBranch = field('addressRetail');
|
|
2487
2496
|
useEffect(() => {
|
|
2488
2497
|
(async () => {
|
|
2489
2498
|
const officesList = await fetchRegionOffices(regionValue?.key ?? '');
|
|
@@ -2502,7 +2511,7 @@
|
|
|
2502
2511
|
return (jsxs("div", { children: [jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435", options: offices.map(({ id, address = '' }) => ({
|
|
2503
2512
|
key: id?.toString() || '',
|
|
2504
2513
|
text: address,
|
|
2505
|
-
})), ...getValidation(field('addressRetail'), validatorObj.addressRetail, input?.required && isRegionSelected), isSearch: true }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: !data, className: "h-full" }) }) })] }));
|
|
2514
|
+
})), ...getValidation(field('addressRetail'), validatorObj.addressRetail, input?.required && isRegionSelected), isSearch: true }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: !data, className: "h-full", selectedAddress: fieldBranch?.value?.text }) }) })] }));
|
|
2506
2515
|
});
|
|
2507
2516
|
|
|
2508
2517
|
const useNormalizedInput = (props, { normalize, format }) => {
|
|
@@ -2893,9 +2902,25 @@
|
|
|
2893
2902
|
const FIELD_NAME$7 = 'birthPlace';
|
|
2894
2903
|
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) })));
|
|
2895
2904
|
|
|
2905
|
+
const getCardTypes = async (paymentSystemType) => {
|
|
2906
|
+
const response = await doRequest('/dictionaryFiltered', 'POST', {
|
|
2907
|
+
type: 'CARD_TYPE',
|
|
2908
|
+
presets: { paymentSystemType, creditProgramId: 13 },
|
|
2909
|
+
});
|
|
2910
|
+
const data = await response?.json();
|
|
2911
|
+
return data;
|
|
2912
|
+
};
|
|
2913
|
+
|
|
2896
2914
|
const CardCategoryField = JSX(({ field, input }) => {
|
|
2897
|
-
const
|
|
2898
|
-
|
|
2915
|
+
const [cardTypes, setCardTypes] = useState([]);
|
|
2916
|
+
const selectedPaymentSystem = field('paymentSystem').value;
|
|
2917
|
+
useEffect(() => {
|
|
2918
|
+
(async () => {
|
|
2919
|
+
const fetchedCardTypes = await getCardTypes(selectedPaymentSystem);
|
|
2920
|
+
setCardTypes(fetchedCardTypes);
|
|
2921
|
+
})();
|
|
2922
|
+
}, [selectedPaymentSystem]);
|
|
2923
|
+
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 }));
|
|
2899
2924
|
});
|
|
2900
2925
|
|
|
2901
2926
|
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 })));
|
|
@@ -3196,13 +3221,27 @@
|
|
|
3196
3221
|
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 }));
|
|
3197
3222
|
});
|
|
3198
3223
|
|
|
3199
|
-
const
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3224
|
+
const getPaymentSystems = async () => {
|
|
3225
|
+
const response = await doRequest('/public-data/creditProgramConditions', 'POST', {
|
|
3226
|
+
creditProgramId: 13,
|
|
3227
|
+
});
|
|
3228
|
+
const data = await response?.json();
|
|
3229
|
+
return data?.paymentSystems?.map((paymentSystem) => ({
|
|
3230
|
+
id: paymentSystem.type,
|
|
3231
|
+
text: paymentSystem.name,
|
|
3232
|
+
}));
|
|
3233
|
+
};
|
|
3234
|
+
|
|
3203
3235
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
3204
3236
|
const { value, onChange } = field('paymentSystem');
|
|
3205
|
-
|
|
3237
|
+
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
3238
|
+
useEffect(() => {
|
|
3239
|
+
(async () => {
|
|
3240
|
+
const fetchedPaymentSystems = await getPaymentSystems();
|
|
3241
|
+
setPaymentSystemOptions(fetchedPaymentSystems || []);
|
|
3242
|
+
})();
|
|
3243
|
+
}, []);
|
|
3244
|
+
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) }));
|
|
3206
3245
|
});
|
|
3207
3246
|
|
|
3208
3247
|
const isPlaceholder = (_) => _ === '_';
|
|
@@ -6156,7 +6195,7 @@
|
|
|
6156
6195
|
|
|
6157
6196
|
const formStateMap$1 = [
|
|
6158
6197
|
{
|
|
6159
|
-
paymentSystem:
|
|
6198
|
+
paymentSystem: '',
|
|
6160
6199
|
currency: 'rub',
|
|
6161
6200
|
codeWord: '',
|
|
6162
6201
|
},
|
|
@@ -9596,7 +9635,7 @@
|
|
|
9596
9635
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
9597
9636
|
});
|
|
9598
9637
|
|
|
9599
|
-
const packageVersion = "0.14.
|
|
9638
|
+
const packageVersion = "0.14.672";
|
|
9600
9639
|
|
|
9601
9640
|
exports.Blocks = Blocks;
|
|
9602
9641
|
exports.ContentPage = ContentPage;
|