@redneckz/wildless-cms-uni-blocks 0.14.53 → 0.14.55
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +31 -22
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CalculatorContent.d.ts +38 -0
- package/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/bundle/components/Calculator/getDefaultValues.d.ts +4 -0
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +1 -1
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/CalculatorContent.d.ts +38 -0
- package/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/dist/components/Calculator/CreditCalculatorForm.js +9 -8
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +6 -5
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/getDefaultValues.d.ts +4 -0
- package/dist/components/Calculator/getDefaultValues.js +20 -0
- package/dist/components/Calculator/getDefaultValues.js.map +1 -0
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +1 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +38 -0
- package/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/lib/components/Calculator/CreditCalculatorForm.js +9 -8
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +6 -5
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/getDefaultValues.d.ts +4 -0
- package/lib/components/Calculator/getDefaultValues.js +15 -0
- package/lib/components/Calculator/getDefaultValues.js.map +1 -0
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +1 -1
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +31 -22
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +38 -0
- package/mobile/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/mobile/bundle/components/Calculator/getDefaultValues.d.ts +4 -0
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +1 -1
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +38 -0
- package/mobile/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +9 -8
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +6 -5
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/getDefaultValues.d.ts +4 -0
- package/mobile/dist/components/Calculator/getDefaultValues.js +20 -0
- package/mobile/dist/components/Calculator/getDefaultValues.js.map +1 -0
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +1 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +38 -0
- package/mobile/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +9 -8
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +6 -5
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/getDefaultValues.d.ts +4 -0
- package/mobile/lib/components/Calculator/getDefaultValues.js +15 -0
- package/mobile/lib/components/Calculator/getDefaultValues.js.map +1 -0
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +1 -1
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +15 -6
- package/mobile/src/components/Calculator/CalculatorContent.ts +42 -0
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +9 -9
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +6 -5
- package/mobile/src/components/Calculator/getDefaultValues.ts +28 -0
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +1 -1
- package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -0
- package/package.json +1 -1
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +15 -6
- package/src/components/Calculator/Calculator.fixture.tsx +4 -0
- package/src/components/Calculator/CalculatorContent.ts +42 -0
- package/src/components/Calculator/CreditCalculatorForm.tsx +9 -9
- package/src/components/Calculator/DepositCalculatorForm.tsx +6 -5
- package/src/components/Calculator/getDefaultValues.ts +28 -0
- package/src/components/ProductBlock/ProductBlockContent.ts +1 -1
- package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -1910,6 +1910,15 @@
|
|
|
1910
1910
|
: null, jsxs("div", { className: "flex flex-col gap-y-4xl @xl:w-96", children: [yearBonus >= 0 ? jsx(CalculatorValueBlock, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus }) : null, renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }));
|
|
1911
1911
|
});
|
|
1912
1912
|
|
|
1913
|
+
const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum && defaultParams.sum >= DEFAULT_MIN_SUM$1 && defaultParams.sum <= DEFAULT_MAX_SUM$1
|
|
1914
|
+
? defaultParams.sum
|
|
1915
|
+
: defaultMoney;
|
|
1916
|
+
const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
|
|
1917
|
+
defaultParams.period >= DEFAULT_MIN_MONTHS &&
|
|
1918
|
+
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
1919
|
+
? defaultParams.period
|
|
1920
|
+
: defaultMonth;
|
|
1921
|
+
|
|
1913
1922
|
const STEP_DAYS = 1;
|
|
1914
1923
|
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
1915
1924
|
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
@@ -2019,13 +2028,13 @@
|
|
|
2019
2028
|
}
|
|
2020
2029
|
};
|
|
2021
2030
|
|
|
2022
|
-
const BusinessDepositCalculatorForm = JSX(({ className = '', rateParams, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
|
|
2031
|
+
const BusinessDepositCalculatorForm = JSX(({ className = '', rateParams, buttons, footnote, bottomFootnote, isShowDepositeName, defaultParams, }) => {
|
|
2023
2032
|
const [userInputParams, { field }] = useForm({
|
|
2024
|
-
moneyValue: BUSINESS_DEFAULT_SUM,
|
|
2025
|
-
daysValue: BUSINESS_DEFAULT_DAYS,
|
|
2026
|
-
isReplenished:
|
|
2027
|
-
isPartialWithdrawal:
|
|
2028
|
-
isMonthlyInterestPayment:
|
|
2033
|
+
moneyValue: getMoneyDefaultValue(defaultParams, BUSINESS_DEFAULT_SUM),
|
|
2034
|
+
daysValue: getMonthsDefaultValue(defaultParams, BUSINESS_DEFAULT_DAYS),
|
|
2035
|
+
isReplenished: Boolean(defaultParams?.isReplenished),
|
|
2036
|
+
isPartialWithdrawal: Boolean(defaultParams?.isPartialWithdrawal),
|
|
2037
|
+
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
2029
2038
|
});
|
|
2030
2039
|
const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, rateParams?.rateType && rateParams.sourceBookDir);
|
|
2031
2040
|
const { income, finalSum, rate, isUnavailableByTerm, depositeName } = calculatorParams;
|
|
@@ -2165,15 +2174,15 @@
|
|
|
2165
2174
|
}), [userInputParams, data]);
|
|
2166
2175
|
};
|
|
2167
2176
|
|
|
2168
|
-
const CreditCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
2177
|
+
const CreditCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings, defaultParams }) => {
|
|
2169
2178
|
const [userInputParams, { field }] = useForm({
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2179
|
+
moneyValue: getMoneyDefaultValue(defaultParams, CREDIT_DEFAULT_SUM),
|
|
2180
|
+
monthsValue: getMonthsDefaultValue(defaultParams, DEFAULT_MONTHS),
|
|
2181
|
+
isAnnuity: Boolean(defaultParams?.isAnnuity),
|
|
2182
|
+
isInsurance: Boolean(defaultParams?.isEnableInsurance),
|
|
2183
|
+
isSalaryClient: Boolean(defaultParams?.isEnableSalaryClient),
|
|
2184
|
+
isPensionClient: Boolean(defaultParams?.isEnablePensionClient),
|
|
2185
|
+
isStateEmployee: Boolean(defaultParams?.isEnableStateEmployee),
|
|
2177
2186
|
});
|
|
2178
2187
|
const calculatorParams = useCreditCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
|
|
2179
2188
|
const paymentTypeElement = renderPaymentType({
|
|
@@ -2263,12 +2272,12 @@
|
|
|
2263
2272
|
const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
|
|
2264
2273
|
const getMiddleMonth = (minMonths, maxMonths) => minMonths + Math.round((maxMonths - minMonths) / 2);
|
|
2265
2274
|
|
|
2266
|
-
const DepositCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
2275
|
+
const DepositCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings, defaultParams }) => {
|
|
2267
2276
|
const [userInputParams, { field }] = useForm({
|
|
2268
|
-
moneyValue: DEPOSIT_DEFAULT_SUM,
|
|
2269
|
-
monthsValue: 0,
|
|
2270
|
-
isMonthlyInterestPayment:
|
|
2271
|
-
isRemoteRegistration:
|
|
2277
|
+
moneyValue: getMoneyDefaultValue(defaultParams, DEPOSIT_DEFAULT_SUM),
|
|
2278
|
+
monthsValue: getMonthsDefaultValue(defaultParams, 0),
|
|
2279
|
+
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
2280
|
+
isRemoteRegistration: Boolean(defaultParams?.isRemoteRegistration),
|
|
2272
2281
|
});
|
|
2273
2282
|
const calculatorParams = useDepositCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
|
|
2274
2283
|
const { defaultMonth, rate, income, finalSum } = calculatorParams;
|
|
@@ -2974,11 +2983,11 @@
|
|
|
2974
2983
|
const Tags = JSX(({ className, tags }) => tags?.length ? (jsx("div", { className: style('flex flex-wrap gap-xs', className), role: "list", children: tags.map(renderTag) })) : null);
|
|
2975
2984
|
const renderTag = (tag, key) => (jsx("div", { className: "p-xs border-solid border rounded-md border-gray", role: "listitem", children: jsx(Text, { size: "text-m", font: "font-light", children: tag }) }, String(key)));
|
|
2976
2985
|
|
|
2977
|
-
const BaseProductTile = JSX(({ className, padding, defaultPadding, title, description, headlineVersion = 'L', align = 'text-left', benefitsVersion, isTabularBenefits, benefits, __html, isFullWidthTitle, items, isDotted = true, priceList = [], listItemSize, tags = [], buttons, image, imageOptions: { imageAlign = 'center', directionRight = true, isImageAlwaysOnRight, isImageSecondary = false, } = {}, backwardButton, children, }) => {
|
|
2986
|
+
const BaseProductTile = JSX(({ className, padding, defaultPadding, title, description, headlineVersion = 'L', align = 'text-left', benefitsVersion, isTabularBenefits, benefits, __html, isFullWidthTitle, items, isDotted = true, priceList = [], listItemSize, tags = [], buttons, image, imageOptions: { imageAlign = 'center', directionRight = true, isImageAlwaysOnRight, isImageSecondary = false, } = {}, backwardButton, children, ...rest }) => {
|
|
2978
2987
|
const img = image?.src ? jsx(Img, { image: image }) : null;
|
|
2979
2988
|
const headline = renderHeadline({ title, description, headlineVersion, align });
|
|
2980
2989
|
const filteredBenefits = benefits?.filter((_) => _?.type === 'rte' || 'label' in _ || 'description' in _);
|
|
2981
|
-
return (jsx(BaseTile, { className: className, padding: padding, defaultPadding: defaultPadding, ...(isFullWidthTitle ? { title: headline } : { insetTitle: headline }), ...leftOrRightImage(img, directionRight), isImageSecondary: isImageSecondary, imageAlign: imageAlign, isImageAlwaysOnRight: isImageAlwaysOnRight, buttons: renderButtonsSection(buttons), backwardButton: backwardButton, children: jsxs("div", { className: "flex flex-col sm:gap-xl gap-4xl", children: [filteredBenefits?.length ? (jsx(BenefitsList, { benefitsVersion: benefitsVersion, isTabularBenefits: isTabularBenefits, benefits: filteredBenefits })) : null, __html ? jsx(RichText, { __html: __html }) : null, items?.length ? (jsx(List, { items: items, isDotted: isDotted, listItemSize: listItemSize })) : null, children, priceList?.length ? jsx(PriceList, { priceList: priceList }) : null, renderTags(tags)] }) }));
|
|
2990
|
+
return (jsx(BaseTile, { className: className, padding: padding, defaultPadding: defaultPadding, ...(isFullWidthTitle ? { title: headline } : { insetTitle: headline }), ...leftOrRightImage(img, directionRight), isImageSecondary: isImageSecondary, imageAlign: imageAlign, isImageAlwaysOnRight: isImageAlwaysOnRight, buttons: renderButtonsSection(buttons), backwardButton: backwardButton, ...rest, children: jsxs("div", { className: "flex flex-col sm:gap-xl gap-4xl", children: [filteredBenefits?.length ? (jsx(BenefitsList, { benefitsVersion: benefitsVersion, isTabularBenefits: isTabularBenefits, benefits: filteredBenefits })) : null, __html ? jsx(RichText, { __html: __html }) : null, items?.length ? (jsx(List, { items: items, isDotted: isDotted, listItemSize: listItemSize })) : null, children, priceList?.length ? jsx(PriceList, { priceList: priceList }) : null, renderTags(tags)] }) }));
|
|
2982
2991
|
});
|
|
2983
2992
|
const leftOrRightImage = (img, directionRight) => directionRight ? { rightImage: img } : { leftImage: img };
|
|
2984
2993
|
const renderTags = (tags) => (tags?.length ? jsx(Tags, { tags: tags }) : null);
|
|
@@ -5798,7 +5807,7 @@
|
|
|
5798
5807
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
|
|
5799
5808
|
}
|
|
5800
5809
|
|
|
5801
|
-
const packageVersion = "0.14.
|
|
5810
|
+
const packageVersion = "0.14.54";
|
|
5802
5811
|
|
|
5803
5812
|
exports.Blocks = Blocks;
|
|
5804
5813
|
exports.ContentPage = ContentPage;
|