@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
package/bundle/bundle.umd.js
CHANGED
|
@@ -1975,7 +1975,7 @@
|
|
|
1975
1975
|
// Сейчас реализован поиск среди тестовых данных
|
|
1976
1976
|
// TODO: Также выяснить что делать когда ничего не найдено
|
|
1977
1977
|
// TODO: На макетах также когда есть поле поиска нет кнопки открыть на карте.
|
|
1978
|
-
const YandexMap = JSX(({ points, className = '', zoom = 5, isLoad }) => {
|
|
1978
|
+
const YandexMap = JSX(({ points, className = '', zoom = 5, isLoad, selectedAddress }) => {
|
|
1979
1979
|
const map = useRef(null);
|
|
1980
1980
|
const parentDiv = useRef(null);
|
|
1981
1981
|
const yandexMaps = useYandexMaps();
|
|
@@ -1999,7 +1999,16 @@
|
|
|
1999
1999
|
renderClusterer({ yandexMaps, map: map.current, points, isLoad });
|
|
2000
2000
|
});
|
|
2001
2001
|
}
|
|
2002
|
-
|
|
2002
|
+
// zoom к выбранному отделению банка в рамках задачи по retail
|
|
2003
|
+
if (map.current && selectedAddress) {
|
|
2004
|
+
yandexMaps?.geocode(selectedAddress).then((res) => {
|
|
2005
|
+
const firstGeoObject = res.geoObjects.get(0);
|
|
2006
|
+
const coords = firstGeoObject.geometry.getCoordinates();
|
|
2007
|
+
map.current.setCenter(coords);
|
|
2008
|
+
map.current.setZoom(18);
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
}, [yandexMaps, points, zoom, isLoad, selectedAddress]);
|
|
2003
2012
|
if (!yandexMaps) {
|
|
2004
2013
|
return null;
|
|
2005
2014
|
}
|
|
@@ -2027,7 +2036,7 @@
|
|
|
2027
2036
|
}
|
|
2028
2037
|
};
|
|
2029
2038
|
async function doRequest(url, method, body) {
|
|
2030
|
-
return
|
|
2039
|
+
return globalThis?.fetch?.(`${API_BASE_URI}${url}`, {
|
|
2031
2040
|
method,
|
|
2032
2041
|
headers: {
|
|
2033
2042
|
'Content-Type': 'application/json',
|
|
@@ -2475,7 +2484,7 @@
|
|
|
2475
2484
|
const { data } = useLeadFormData('REGION_RF');
|
|
2476
2485
|
const regionValue = field('regionRetail')?.value || {};
|
|
2477
2486
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2478
|
-
field('addressRetail');
|
|
2487
|
+
const fieldBranch = field('addressRetail');
|
|
2479
2488
|
useEffect(() => {
|
|
2480
2489
|
(async () => {
|
|
2481
2490
|
const officesList = await fetchRegionOffices(regionValue?.key ?? '');
|
|
@@ -2494,7 +2503,7 @@
|
|
|
2494
2503
|
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 = '' }) => ({
|
|
2495
2504
|
key: id?.toString() || '',
|
|
2496
2505
|
text: address,
|
|
2497
|
-
})), ...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" }) }) })] }));
|
|
2506
|
+
})), ...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 }) }) })] }));
|
|
2498
2507
|
});
|
|
2499
2508
|
|
|
2500
2509
|
const useNormalizedInput = (props, { normalize, format }) => {
|
|
@@ -2885,9 +2894,25 @@
|
|
|
2885
2894
|
const FIELD_NAME$7 = 'birthPlace';
|
|
2886
2895
|
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
2896
|
|
|
2897
|
+
const getCardTypes = async (paymentSystemType) => {
|
|
2898
|
+
const response = await doRequest('/dictionaryFiltered', 'POST', {
|
|
2899
|
+
type: 'CARD_TYPE',
|
|
2900
|
+
presets: { paymentSystemType, creditProgramId: 13 },
|
|
2901
|
+
});
|
|
2902
|
+
const data = await response?.json();
|
|
2903
|
+
return data;
|
|
2904
|
+
};
|
|
2905
|
+
|
|
2888
2906
|
const CardCategoryField = JSX(({ field, input }) => {
|
|
2889
|
-
const
|
|
2890
|
-
|
|
2907
|
+
const [cardTypes, setCardTypes] = useState([]);
|
|
2908
|
+
const selectedPaymentSystem = field('paymentSystem').value;
|
|
2909
|
+
useEffect(() => {
|
|
2910
|
+
(async () => {
|
|
2911
|
+
const fetchedCardTypes = await getCardTypes(selectedPaymentSystem);
|
|
2912
|
+
setCardTypes(fetchedCardTypes);
|
|
2913
|
+
})();
|
|
2914
|
+
}, [selectedPaymentSystem]);
|
|
2915
|
+
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
2916
|
});
|
|
2892
2917
|
|
|
2893
2918
|
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 +3213,27 @@
|
|
|
3188
3213
|
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
3214
|
});
|
|
3190
3215
|
|
|
3191
|
-
const
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3216
|
+
const getPaymentSystems = async () => {
|
|
3217
|
+
const response = await doRequest('/public-data/creditProgramConditions', 'POST', {
|
|
3218
|
+
creditProgramId: 13,
|
|
3219
|
+
});
|
|
3220
|
+
const data = await response?.json();
|
|
3221
|
+
return data?.paymentSystems?.map((paymentSystem) => ({
|
|
3222
|
+
id: paymentSystem.type,
|
|
3223
|
+
text: paymentSystem.name,
|
|
3224
|
+
}));
|
|
3225
|
+
};
|
|
3226
|
+
|
|
3195
3227
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
3196
3228
|
const { value, onChange } = field('paymentSystem');
|
|
3197
|
-
|
|
3229
|
+
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
3230
|
+
useEffect(() => {
|
|
3231
|
+
(async () => {
|
|
3232
|
+
const fetchedPaymentSystems = await getPaymentSystems();
|
|
3233
|
+
setPaymentSystemOptions(fetchedPaymentSystems || []);
|
|
3234
|
+
})();
|
|
3235
|
+
}, []);
|
|
3236
|
+
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
3237
|
});
|
|
3199
3238
|
|
|
3200
3239
|
const isPlaceholder = (_) => _ === '_';
|
|
@@ -6176,7 +6215,7 @@
|
|
|
6176
6215
|
|
|
6177
6216
|
const formStateMap$1 = [
|
|
6178
6217
|
{
|
|
6179
|
-
paymentSystem:
|
|
6218
|
+
paymentSystem: '',
|
|
6180
6219
|
currency: 'rub',
|
|
6181
6220
|
codeWord: '',
|
|
6182
6221
|
},
|
|
@@ -9982,7 +10021,7 @@
|
|
|
9982
10021
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
9983
10022
|
});
|
|
9984
10023
|
|
|
9985
|
-
const packageVersion = "0.14.
|
|
10024
|
+
const packageVersion = "0.14.672";
|
|
9986
10025
|
|
|
9987
10026
|
exports.Blocks = Blocks;
|
|
9988
10027
|
exports.ContentPage = ContentPage;
|