@redneckz/wildless-cms-uni-blocks 0.14.966 → 0.14.968
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 +37 -28
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/retail/components/Fields/CardCategoryField.js +18 -7
- package/dist/retail/components/Fields/CardCategoryField.js.map +1 -1
- package/dist/retail/components/Fields/CreditCalcField.js +2 -15
- package/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/dist/retail/components/Fields/RegionRetailField.js +16 -5
- package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/lib/retail/components/Fields/CardCategoryField.js +18 -7
- package/lib/retail/components/Fields/CardCategoryField.js.map +1 -1
- package/lib/retail/components/Fields/CreditCalcField.js +2 -15
- package/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/lib/retail/components/Fields/RegionRetailField.js +17 -6
- package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +37 -28
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/retail/components/Fields/CardCategoryField.js +18 -7
- package/mobile/dist/retail/components/Fields/CardCategoryField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/CreditCalcField.js +2 -15
- package/mobile/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/RegionRetailField.js +16 -5
- package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/CardCategoryField.js +18 -7
- package/mobile/lib/retail/components/Fields/CardCategoryField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/CreditCalcField.js +2 -15
- package/mobile/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/RegionRetailField.js +17 -6
- package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/src/retail/components/Fields/CardCategoryField.tsx +21 -7
- package/mobile/src/retail/components/Fields/CreditCalcField.tsx +3 -29
- package/mobile/src/retail/components/Fields/RegionRetailField.tsx +18 -7
- package/package.json +1 -1
- package/src/retail/components/Fields/CardCategoryField.tsx +21 -7
- package/src/retail/components/Fields/CreditCalcField.tsx +3 -29
- package/src/retail/components/Fields/RegionRetailField.tsx +18 -7
package/bundle/bundle.umd.js
CHANGED
|
@@ -4679,19 +4679,27 @@
|
|
|
4679
4679
|
const CardCategoryField = JSX(({ field, input }) => {
|
|
4680
4680
|
const [cardTypes, setCardTypes] = useState([]);
|
|
4681
4681
|
const [programId] = useLocalStorage('programId');
|
|
4682
|
-
const { productType } = useRetailFormStore();
|
|
4683
|
-
const isSalaryCard = programId === '38';
|
|
4682
|
+
const { productType, leadForm } = useRetailFormStore();
|
|
4684
4683
|
const isDebit = productType === 'debitCard';
|
|
4685
4684
|
const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
|
|
4686
4685
|
const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
|
|
4687
4686
|
const selectedPaymentSystem = field('paymentSystem')?.value?.key;
|
|
4688
|
-
const
|
|
4689
|
-
|
|
4687
|
+
const isOffice = leadForm?.methodObtain === 'office';
|
|
4688
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
4689
|
+
const noop = () => { };
|
|
4690
|
+
const handleChangeIsMomentDebitCard = useMemo(() => {
|
|
4691
|
+
const onChange = field('isMomentDebitCard')?.onChange;
|
|
4692
|
+
return onChange ?? noop;
|
|
4693
|
+
}, [field]);
|
|
4694
|
+
const isInstantSelectedCardCategory = field('cardCategory')
|
|
4695
|
+
?.value?.text?.toLowerCase()
|
|
4696
|
+
?.includes('неимен');
|
|
4697
|
+
const getCardCategoryValue = useCallback((fetchedCardTypes) => fetchedCardTypes.length !== 0
|
|
4690
4698
|
? {
|
|
4691
4699
|
key: fetchedCardTypes[0].key,
|
|
4692
4700
|
text: fetchedCardTypes[0].value,
|
|
4693
4701
|
}
|
|
4694
|
-
: null, []);
|
|
4702
|
+
: null, [selectedPaymentSystem]);
|
|
4695
4703
|
const onChange = useCallback((value) => {
|
|
4696
4704
|
cardCategoryChange?.(value);
|
|
4697
4705
|
handleChangeIsMomentDebitCard?.(value?.text?.toLowerCase()?.includes('неимен'));
|
|
@@ -4700,16 +4708,19 @@
|
|
|
4700
4708
|
if (selectedPaymentSystem && programId) {
|
|
4701
4709
|
(async () => {
|
|
4702
4710
|
const fetchedCardTypes = await getCardTypes(selectedPaymentSystem, programId);
|
|
4703
|
-
const actualCardTypes = isDebit && !isEsiaAuth
|
|
4711
|
+
const actualCardTypes = isDebit && (!isEsiaAuth || isOffice)
|
|
4704
4712
|
? excludeSomeСategoriesCards(fetchedCardTypes)
|
|
4705
4713
|
: fetchedCardTypes;
|
|
4706
4714
|
setCardTypes(actualCardTypes);
|
|
4707
4715
|
if (!isValidCardCategory(actualCardTypes, selectedCardCategory)) {
|
|
4708
4716
|
cardCategoryChange?.(getCardCategoryValue(actualCardTypes));
|
|
4709
4717
|
}
|
|
4718
|
+
if (isDebit) {
|
|
4719
|
+
handleChangeIsMomentDebitCard(isInstantSelectedCardCategory ?? false);
|
|
4720
|
+
}
|
|
4710
4721
|
})();
|
|
4711
4722
|
}
|
|
4712
|
-
}, [selectedPaymentSystem, getCardCategoryValue]);
|
|
4723
|
+
}, [selectedPaymentSystem, getCardCategoryValue, isInstantSelectedCardCategory]);
|
|
4713
4724
|
const description = useMemo(() => cardTypes?.find((_) => _.key === selectedCardCategory?.key)?.description, [cardTypes, selectedCardCategory]);
|
|
4714
4725
|
return (jsxs("div", { children: [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, onChange: onChange }), description ? jsx(InfoCard, { __html: description }) : null] }));
|
|
4715
4726
|
});
|
|
@@ -5073,25 +5084,12 @@
|
|
|
5073
5084
|
|
|
5074
5085
|
const FIELD_NAME = 'calculator';
|
|
5075
5086
|
const CreditCalcField = JSX(({ field, params }) => {
|
|
5087
|
+
const defaultCalcSum = params?.calcData?.defaultParams?.sum ?? 0;
|
|
5076
5088
|
const handleChange = useCallback((_) => {
|
|
5077
5089
|
field(FIELD_NAME).onChange?.(_);
|
|
5078
5090
|
}, []);
|
|
5079
|
-
return (jsx(CalculatorCredit, { ...params?.calcData, padding: "p-0",
|
|
5091
|
+
return (jsx(CalculatorCredit, { ...params?.calcData, padding: "p-0", onChange: handleChange }, defaultCalcSum));
|
|
5080
5092
|
});
|
|
5081
|
-
const PARAMS_MAP = {
|
|
5082
|
-
moneyValue: 'sum',
|
|
5083
|
-
monthsValue: 'period',
|
|
5084
|
-
isInsurance: 'isEnableInsurance',
|
|
5085
|
-
isPensionClient: 'isEnablePensionClient',
|
|
5086
|
-
isStateEmployee: 'isEnableStateEmployee',
|
|
5087
|
-
isSalaryClient: 'isEnableSalaryClient',
|
|
5088
|
-
isAnnuity: 'isAnnuity',
|
|
5089
|
-
};
|
|
5090
|
-
const defaultValueAdapter = (value, isInverse = false) => {
|
|
5091
|
-
const keysMap = isInverse ? swap(PARAMS_MAP) : PARAMS_MAP;
|
|
5092
|
-
return Object.fromEntries(Object.entries(value ?? {}).map(([k, v]) => [keysMap[k], v]));
|
|
5093
|
-
};
|
|
5094
|
-
const swap = (_) => Object.fromEntries(Object.entries(_).map(([k, v]) => [v, k]));
|
|
5095
5093
|
|
|
5096
5094
|
const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
|
|
5097
5095
|
вкладчиком с долей участия более 20% уставного капитала руководителем,
|
|
@@ -5700,24 +5698,35 @@
|
|
|
5700
5698
|
};
|
|
5701
5699
|
|
|
5702
5700
|
const RegionRetailField = JSX(({ field, input }) => {
|
|
5703
|
-
const { productType } = useRetailFormStore();
|
|
5701
|
+
const { programId, productType } = useRetailFormStore();
|
|
5704
5702
|
const { data: regions } = useLeadFormData('REGION_RF');
|
|
5705
5703
|
const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
|
|
5706
5704
|
const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
|
|
5707
|
-
const
|
|
5705
|
+
const isDebit = productType === 'debitCard';
|
|
5706
|
+
const isSalaryCard = programId === '38';
|
|
5707
|
+
const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
|
|
5708
5708
|
const formatRegions = regions?.map(({ key, value }) => ({ key, text: value }));
|
|
5709
5709
|
const isDeliveryActive = productSettings?.find((_) => _?.key === 'DELIVERY_ACTIVE')?.value === 'true';
|
|
5710
5710
|
const handleChangeRegion = field('regionRetail')?.onChange;
|
|
5711
5711
|
const handleChangeRegionHasDelivery = field('regionHasDelivery')?.onChange;
|
|
5712
5712
|
const handleChangeMethodObtain = field('methodObtain')?.onChange;
|
|
5713
5713
|
const onChange = useCallback((value) => {
|
|
5714
|
-
const regionHasDelivery =
|
|
5715
|
-
|
|
5716
|
-
|
|
5714
|
+
const regionHasDelivery = isDebit
|
|
5715
|
+
? isEsiaAuth &&
|
|
5716
|
+
!isSalaryCard &&
|
|
5717
|
+
isDeliveryActive &&
|
|
5718
|
+
regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg
|
|
5719
|
+
: isDeliveryActive && regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg;
|
|
5717
5720
|
handleChangeRegionHasDelivery?.(regionHasDelivery);
|
|
5718
5721
|
handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
|
|
5719
5722
|
handleChangeRegion?.(value);
|
|
5720
5723
|
}, [regionsDelivery, isDeliveryActive, isEsiaAuth]);
|
|
5724
|
+
useEffect(() => {
|
|
5725
|
+
if (!isEsiaAuth && isDebit) {
|
|
5726
|
+
handleChangeRegionHasDelivery?.(false);
|
|
5727
|
+
handleChangeMethodObtain?.('office');
|
|
5728
|
+
}
|
|
5729
|
+
}, []);
|
|
5721
5730
|
return (jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: formatRegions, ...field(input?.name ?? ''), onChange: onChange }));
|
|
5722
5731
|
});
|
|
5723
5732
|
const getCurrentProductSettings = (productType) => productType === 'debitCard' ? 'DEBIT_CARD_LEAD_PROCESS_SETTINGS' : 'CREDIT_LEAD_PROCESS_SETTINGS';
|
|
@@ -13034,7 +13043,7 @@
|
|
|
13034
13043
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
13035
13044
|
});
|
|
13036
13045
|
|
|
13037
|
-
const packageVersion = "0.14.
|
|
13046
|
+
const packageVersion = "0.14.967";
|
|
13038
13047
|
|
|
13039
13048
|
exports.Blocks = Blocks;
|
|
13040
13049
|
exports.ContentPage = ContentPage;
|