@redneckz/wildless-cms-uni-blocks 0.14.985 → 0.14.987
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 +57 -32
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CalculatorCredit/utils.d.ts +12 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -3
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/CalculatorCredit/CalculatorCredit.js +4 -14
- package/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
- package/dist/components/CalculatorCredit/utils.d.ts +12 -0
- package/dist/components/CalculatorCredit/utils.js +18 -0
- package/dist/components/CalculatorCredit/utils.js.map +1 -0
- package/dist/retail/api/getClaimChannel.js +4 -2
- package/dist/retail/api/getClaimChannel.js.map +1 -1
- package/dist/retail/components/Fields/CreditCalcField.js +16 -5
- package/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -3
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/CalculatorCredit/CalculatorCredit.js +4 -14
- package/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
- package/lib/components/CalculatorCredit/utils.d.ts +12 -0
- package/lib/components/CalculatorCredit/utils.js +15 -0
- package/lib/components/CalculatorCredit/utils.js.map +1 -0
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/retail/api/getClaimChannel.js +4 -2
- package/lib/retail/api/getClaimChannel.js.map +1 -1
- package/lib/retail/components/Fields/CreditCalcField.js +17 -6
- package/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +57 -32
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CalculatorCredit/utils.d.ts +12 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -3
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js +4 -14
- package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
- package/mobile/dist/components/CalculatorCredit/utils.d.ts +12 -0
- package/mobile/dist/components/CalculatorCredit/utils.js +18 -0
- package/mobile/dist/components/CalculatorCredit/utils.js.map +1 -0
- package/mobile/dist/retail/api/getClaimChannel.js +4 -2
- package/mobile/dist/retail/api/getClaimChannel.js.map +1 -1
- package/mobile/dist/retail/components/Fields/CreditCalcField.js +16 -5
- package/mobile/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +3 -3
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js +4 -14
- package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
- package/mobile/lib/components/CalculatorCredit/utils.d.ts +12 -0
- package/mobile/lib/components/CalculatorCredit/utils.js +15 -0
- package/mobile/lib/components/CalculatorCredit/utils.js.map +1 -0
- package/mobile/lib/retail/api/getClaimChannel.js +4 -2
- package/mobile/lib/retail/api/getClaimChannel.js.map +1 -1
- package/mobile/lib/retail/components/Fields/CreditCalcField.js +17 -6
- package/mobile/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -3
- package/mobile/src/components/CalculatorCredit/CalculatorCredit.tsx +4 -21
- package/mobile/src/components/CalculatorCredit/utils.ts +20 -0
- package/mobile/src/retail/api/getClaimChannel.ts +8 -6
- package/mobile/src/retail/components/Fields/CreditCalcField.tsx +23 -7
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -3
- package/src/components/CalculatorCredit/CalculatorCredit.tsx +4 -21
- package/src/components/CalculatorCredit/utils.ts +20 -0
- package/src/retail/api/getClaimChannel.ts +8 -6
- package/src/retail/components/Fields/CreditCalcField.tsx +23 -7
|
@@ -4809,12 +4809,6 @@
|
|
|
4809
4809
|
return input && input.name ? (jsx(CheckboxWithDoc, { text: consents?.[input.name]?.text, docId: consents?.[input.name]?.docId, ...field(input.name) })) : null;
|
|
4810
4810
|
});
|
|
4811
4811
|
|
|
4812
|
-
const MONTHS_IN_YEAR$1 = 12;
|
|
4813
|
-
const MONTHLY_INTEREST_RATE = MONTHS_IN_YEAR$1 * 100;
|
|
4814
|
-
const DEFAULT_MIN_MONTHS = 1;
|
|
4815
|
-
const DEFAULT_MAX_MONTHS = 60;
|
|
4816
|
-
const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
4817
|
-
|
|
4818
4812
|
const CalculatorLayout = JSX(({ className, title, children, ...rest }) => (jsxs(BlockWrapper, { className: style('space-y-xl', className), defaultPadding: "p-4xl", ...rest, children: [title ? jsx(Heading, { className: "text-center", title: title }) : null, children] })));
|
|
4819
4813
|
|
|
4820
4814
|
const CalculatorStyle = {
|
|
@@ -4859,13 +4853,6 @@
|
|
|
4859
4853
|
return rates[0];
|
|
4860
4854
|
};
|
|
4861
4855
|
|
|
4862
|
-
const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum ? defaultParams.sum : defaultMoney;
|
|
4863
|
-
const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
|
|
4864
|
-
defaultParams.period >= DEFAULT_MIN_MONTHS &&
|
|
4865
|
-
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
4866
|
-
? defaultParams.period
|
|
4867
|
-
: defaultMonth;
|
|
4868
|
-
|
|
4869
4856
|
const renderFootnote = (text, key) => text ? (jsx(Paragraph, { size: "text-xs", font: "font-light", color: "text-secondary-text", children: text }, String(key))) : null;
|
|
4870
4857
|
|
|
4871
4858
|
const STEP_MONTHS = 1;
|
|
@@ -4900,6 +4887,12 @@
|
|
|
4900
4887
|
field?.('monthsValue')?.onChange?.(clamp(defParams?.[monthsValue], calcParams.minMonths, calcParams.maxMonths));
|
|
4901
4888
|
};
|
|
4902
4889
|
|
|
4890
|
+
const MONTHS_IN_YEAR$1 = 12;
|
|
4891
|
+
const MONTHLY_INTEREST_RATE = MONTHS_IN_YEAR$1 * 100;
|
|
4892
|
+
const DEFAULT_MIN_MONTHS = 1;
|
|
4893
|
+
const DEFAULT_MAX_MONTHS = 60;
|
|
4894
|
+
const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
4895
|
+
|
|
4903
4896
|
/**
|
|
4904
4897
|
* Формулы расчёта аннуитетных и дифференцированных платежей:
|
|
4905
4898
|
* https://finuslugi.ru/potrebitelskie_kredity/stat_annuitetnye_i_differentsirovannye_platezhi
|
|
@@ -5034,7 +5027,26 @@
|
|
|
5034
5027
|
|
|
5035
5028
|
const isDefaultParams = (defaultParams = {}) => Boolean(Object.values(defaultParams).filter((_) => _).length);
|
|
5036
5029
|
|
|
5030
|
+
const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum ? defaultParams.sum : defaultMoney;
|
|
5031
|
+
const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
|
|
5032
|
+
defaultParams.period >= DEFAULT_MIN_MONTHS &&
|
|
5033
|
+
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
5034
|
+
? defaultParams.period
|
|
5035
|
+
: defaultMonth;
|
|
5036
|
+
|
|
5037
5037
|
const CREDIT_DEFAULT_SUM = 200000;
|
|
5038
|
+
const getCalcParams = (defaultParams) => ({
|
|
5039
|
+
moneyValue: getMoneyDefaultValue(defaultParams, CREDIT_DEFAULT_SUM),
|
|
5040
|
+
monthsValue: getMonthsDefaultValue(defaultParams, DEFAULT_MONTHS),
|
|
5041
|
+
monthlyPayment: 0,
|
|
5042
|
+
rate: 0,
|
|
5043
|
+
isAnnuity: Boolean(defaultParams?.isAnnuity),
|
|
5044
|
+
isInsurance: Boolean(defaultParams?.isEnableInsurance),
|
|
5045
|
+
isSalaryClient: Boolean(defaultParams?.isEnableSalaryClient),
|
|
5046
|
+
isPensionClient: Boolean(defaultParams?.isEnablePensionClient),
|
|
5047
|
+
isStateEmployee: Boolean(defaultParams?.isEnableStateEmployee),
|
|
5048
|
+
});
|
|
5049
|
+
|
|
5038
5050
|
const MAP$1 = {
|
|
5039
5051
|
isSalaryClient: 'isSalaryClient',
|
|
5040
5052
|
isStateEmployee: 'isStateEmployee',
|
|
@@ -5052,17 +5064,9 @@
|
|
|
5052
5064
|
rate: defaultParamsCals?.rate ?? 0,
|
|
5053
5065
|
});
|
|
5054
5066
|
}, [paramsViewSettings, calcSource]);
|
|
5055
|
-
const [userInputParams, { field }] = useForm({
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
monthlyPayment: 0,
|
|
5059
|
-
rate: 0,
|
|
5060
|
-
isAnnuity: Boolean(defaultParams?.isAnnuity),
|
|
5061
|
-
isInsurance: Boolean(defaultParams?.isEnableInsurance),
|
|
5062
|
-
isSalaryClient: Boolean(defaultParams?.isEnableSalaryClient),
|
|
5063
|
-
isPensionClient: Boolean(defaultParams?.isEnablePensionClient),
|
|
5064
|
-
isStateEmployee: Boolean(defaultParams?.isEnableStateEmployee),
|
|
5065
|
-
}, { onChange: handleChange });
|
|
5067
|
+
const [userInputParams, { field }] = useForm(getCalcParams(defaultParams), {
|
|
5068
|
+
onChange: handleChange,
|
|
5069
|
+
});
|
|
5066
5070
|
const calcParams = getCreditCalculatorParams(userInputParams, calcSource, paramsViewSettings);
|
|
5067
5071
|
const paymentTypeElement = renderPaymentType({
|
|
5068
5072
|
...field('isAnnuity'),
|
|
@@ -5107,15 +5111,24 @@
|
|
|
5107
5111
|
|
|
5108
5112
|
const FIELD_NAME = 'calculator';
|
|
5109
5113
|
const CreditCalcField = JSX(({ field, params }) => {
|
|
5114
|
+
const [defaultParams, setDefaultParams] = useState();
|
|
5110
5115
|
const calcValue = field(FIELD_NAME)?.value;
|
|
5111
|
-
const defaultParams = calcValue
|
|
5112
|
-
? defaultValueAdapter(field(FIELD_NAME).value)
|
|
5113
|
-
: params?.calcData?.defaultParams;
|
|
5114
|
-
const defaultCalcSum = params?.calcData?.defaultParams?.sum ?? 0;
|
|
5115
5116
|
const handleChange = useCallback((_) => {
|
|
5116
5117
|
field(FIELD_NAME).onChange?.(_);
|
|
5117
5118
|
}, []);
|
|
5118
|
-
|
|
5119
|
+
useEffect(() => {
|
|
5120
|
+
if (params?.calcData?.defaultParams) {
|
|
5121
|
+
setDefaultParams(calcValue
|
|
5122
|
+
? defaultValueAdapter(field(FIELD_NAME).value)
|
|
5123
|
+
: params?.calcData?.defaultParams);
|
|
5124
|
+
}
|
|
5125
|
+
}, [params?.calcData?.defaultParams]);
|
|
5126
|
+
useEffect(() => {
|
|
5127
|
+
if (defaultParams) {
|
|
5128
|
+
handleChange(getCalcParams(defaultParams));
|
|
5129
|
+
}
|
|
5130
|
+
}, [defaultParams]);
|
|
5131
|
+
return defaultParams ? (jsx(CalculatorCredit, { ...params?.calcData, defaultParams: defaultParams, padding: "p-0", onChange: handleChange })) : (jsx(Loader, {}));
|
|
5119
5132
|
});
|
|
5120
5133
|
const PARAMS_MAP = {
|
|
5121
5134
|
moneyValue: 'sum',
|
|
@@ -6011,6 +6024,18 @@
|
|
|
6011
6024
|
return res || {};
|
|
6012
6025
|
};
|
|
6013
6026
|
|
|
6027
|
+
const getClaimChannel = async () => {
|
|
6028
|
+
const claimChannelCode = await fetchRetailJSON('/claim-channel/', 'GET')
|
|
6029
|
+
.then((res) => {
|
|
6030
|
+
const url = globalThis.location.href;
|
|
6031
|
+
const code = res?.find((_) => _ && url.includes(_.key))?.code;
|
|
6032
|
+
globalThis.sessionStorage.setItem('claimChannelCode', code ?? '');
|
|
6033
|
+
return code;
|
|
6034
|
+
})
|
|
6035
|
+
.catch(() => undefined);
|
|
6036
|
+
return claimChannelCode;
|
|
6037
|
+
};
|
|
6038
|
+
|
|
6014
6039
|
const getLastTaskStatus = async (body) => {
|
|
6015
6040
|
const res = await fetchRetailJSON('/user-data/getLastStatus', 'POST', body);
|
|
6016
6041
|
return res?.statusCd === 'DRAFT' ? res?.taskId : null;
|
|
@@ -6935,12 +6960,12 @@
|
|
|
6935
6960
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
6936
6961
|
try {
|
|
6937
6962
|
if (productType === 'debitCard') {
|
|
6938
|
-
|
|
6963
|
+
const claimChannelCode = await getClaimChannel();
|
|
6939
6964
|
const debitData = await createUserTaskDebit(getDebitLeadFormTaskData({
|
|
6940
6965
|
formData,
|
|
6941
6966
|
programId,
|
|
6942
6967
|
marketingInfo,
|
|
6943
|
-
|
|
6968
|
+
claimChannelCode,
|
|
6944
6969
|
}));
|
|
6945
6970
|
taskId = debitData.taskId;
|
|
6946
6971
|
participantId = debitData.participantId;
|
|
@@ -12912,7 +12937,7 @@
|
|
|
12912
12937
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
12913
12938
|
});
|
|
12914
12939
|
|
|
12915
|
-
const packageVersion = "0.14.
|
|
12940
|
+
const packageVersion = "0.14.986";
|
|
12916
12941
|
|
|
12917
12942
|
exports.Blocks = Blocks;
|
|
12918
12943
|
exports.ContentPage = ContentPage;
|