@redneckz/wildless-cms-uni-blocks 0.9.14 → 0.9.15
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 +23 -14
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/constants.d.ts +3 -2
- package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/bundle/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/dist/components/Calculator/CreditCalculatorForm.js +1 -1
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +6 -3
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/constants.d.ts +3 -2
- package/dist/components/Calculator/constants.js +7 -6
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/dist/components/Calculator/useDepositCalculatorParams.js +6 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/dist/components/LinkDocs/LinkDocsListItemBase.js +1 -1
- package/dist/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/dist/components/TariffsTable/TableTileHeader.js +1 -1
- package/dist/components/TariffsTable/TableTileHeader.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTableRow.js +1 -1
- package/dist/components/TariffsTable/TariffsTableRow.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/lib/components/Calculator/CreditCalculatorForm.js +2 -2
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +8 -5
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/constants.d.ts +3 -2
- package/lib/components/Calculator/constants.js +6 -5
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/lib/components/Calculator/useDepositCalculatorParams.js +6 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/lib/components/LinkDocs/LinkDocsListItemBase.js +1 -1
- package/lib/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/lib/components/TariffsTable/TableTileHeader.js +1 -1
- package/lib/components/TariffsTable/TableTileHeader.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTableRow.js +1 -1
- package/lib/components/TariffsTable/TariffsTableRow.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +3 -3
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/constants.d.ts +3 -2
- package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/bundle/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +1 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +6 -3
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.d.ts +3 -2
- package/mobile/dist/components/Calculator/constants.js +7 -6
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +6 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsListItemBase.js +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/mobile/dist/components/TariffsTable/TableTileHeader.js +1 -1
- package/mobile/dist/components/TariffsTable/TableTileHeader.js.map +1 -1
- package/mobile/dist/components/TariffsTable/TariffsTableRow.js +1 -1
- package/mobile/dist/components/TariffsTable/TariffsTableRow.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +2 -2
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +8 -5
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.d.ts +3 -2
- package/mobile/lib/components/Calculator/constants.js +6 -5
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +6 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsListItemBase.js +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/mobile/lib/components/TariffsTable/TableTileHeader.js +1 -1
- package/mobile/lib/components/TariffsTable/TableTileHeader.js.map +1 -1
- package/mobile/lib/components/TariffsTable/TariffsTableRow.js +1 -1
- package/mobile/lib/components/TariffsTable/TariffsTableRow.js.map +1 -1
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +2 -2
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +2 -2
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +8 -5
- package/mobile/src/components/Calculator/constants.ts +6 -5
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +9 -1
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.example.json +6 -6
- package/mobile/src/components/CarouselRichTextCard/CarouselRichTextCardContent.ts +1 -1
- package/mobile/src/components/LinkDocs/LinkDocsListItemBase.tsx +2 -2
- package/mobile/src/components/TariffsTable/TableTileHeader.tsx +1 -3
- package/mobile/src/components/TariffsTable/TariffsTableRow.tsx +3 -3
- package/package.json +1 -1
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +2 -2
- package/src/components/Calculator/CreditCalculatorForm.tsx +2 -2
- package/src/components/Calculator/DepositCalculatorForm.tsx +8 -5
- package/src/components/Calculator/constants.ts +6 -5
- package/src/components/Calculator/useDepositCalculatorParams.ts +9 -1
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.example.json +6 -6
- package/src/components/CarouselRichTextCard/CarouselRichTextCardContent.ts +1 -1
- package/src/components/LinkDocs/LinkDocsListItemBase.tsx +2 -2
- package/src/components/TariffsTable/TableTileHeader.tsx +1 -3
- package/src/components/TariffsTable/TariffsTableRow.tsx +3 -3
- package/bundle/components/Calculator/getDefaultSum.d.ts +0 -1
- package/dist/components/Calculator/getDefaultSum.d.ts +0 -1
- package/dist/components/Calculator/getDefaultSum.js +0 -6
- package/dist/components/Calculator/getDefaultSum.js.map +0 -1
- package/lib/components/Calculator/getDefaultSum.d.ts +0 -1
- package/lib/components/Calculator/getDefaultSum.js +0 -3
- package/lib/components/Calculator/getDefaultSum.js.map +0 -1
- package/mobile/bundle/components/Calculator/getDefaultSum.d.ts +0 -1
- package/mobile/dist/components/Calculator/getDefaultSum.d.ts +0 -1
- package/mobile/dist/components/Calculator/getDefaultSum.js +0 -6
- package/mobile/dist/components/Calculator/getDefaultSum.js.map +0 -1
- package/mobile/lib/components/Calculator/getDefaultSum.d.ts +0 -1
- package/mobile/lib/components/Calculator/getDefaultSum.js +0 -3
- package/mobile/lib/components/Calculator/getDefaultSum.js.map +0 -1
- package/mobile/src/components/Calculator/getDefaultSum.ts +0 -4
- package/src/components/Calculator/getDefaultSum.ts +0 -4
package/bundle/bundle.umd.js
CHANGED
|
@@ -1178,7 +1178,7 @@
|
|
|
1178
1178
|
|
|
1179
1179
|
const BonusBenefitsBlock = JSX(({ bonusBenefits, cardTextAlign = 'center', className = '', columnsCount = '4', subtitle, title, ...rest }) => (jsxs(BlockWrapper, { className: `font-sans text-primary-text bg-white p-12 flex flex-col text-center ${className}`, ...rest, children: [jsx(Headline, { className: "!p-0 mb-8", title: title, description: subtitle, headlineVersion: "M" }), bonusBenefits?.length ? (jsx("div", { className: `grid gap-1 ${AlignText[cardTextAlign]} ${getElementsColsValue(columnsCount)}`, children: bonusBenefits.map(renderBonusBenefit) })) : null] })));
|
|
1180
1180
|
const renderBonusBenefit = ({ icon, title, description }, i) => {
|
|
1181
|
-
return (jsxs("div", { className: style('flex flex-col items-center text-h6', !description && !title ? 'justify-center' : ''), children: [title ? jsx("span", { children: title }) : null, icon ? jsx(ImgInner, { image: icon, height: "180",
|
|
1181
|
+
return (jsxs("div", { className: style('flex flex-col items-center text-h6', !description && !title ? 'justify-center' : ''), children: [title ? jsx("span", { children: title }) : null, icon ? jsx(ImgInner, { image: icon, height: "180", className: "w-auto" }) : null, description ? jsx("span", { children: description }) : null] }, String(i)));
|
|
1182
1182
|
};
|
|
1183
1183
|
const getElementsColsValue = (colValue) => {
|
|
1184
1184
|
switch (colValue) {
|
|
@@ -1242,9 +1242,10 @@
|
|
|
1242
1242
|
|
|
1243
1243
|
const CalculatorValueBlock = JSX(({ title, value, postfix = '', prefix, className = '' }) => (jsxs("div", { className: style('mb-7', className), children: [title ? (jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title })) : null, value ? (jsx("div", { children: jsxs(Text, { size: "text-h3", children: [prefix, " ", addSpacesBetweenNumbers(Math.round(value)), " ", postfix] }) })) : (jsx("div", { children: jsx(Text, { size: "text-h3", children: "-" }) }))] })));
|
|
1244
1244
|
|
|
1245
|
-
const DEFAULT_MIN_SUM =
|
|
1245
|
+
const DEFAULT_MIN_SUM = 10000;
|
|
1246
1246
|
const DEFAULT_MAX_SUM = 5000000;
|
|
1247
|
-
const
|
|
1247
|
+
const CREDIT_DEFAULT_SUM = 200000;
|
|
1248
|
+
const DEPOSIT_DEFAULT_SUM = 20000;
|
|
1248
1249
|
const DEFAULT_MIN_MONTHS = 13;
|
|
1249
1250
|
const DEFAULT_MAX_MONTHS = 60;
|
|
1250
1251
|
const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
@@ -1262,10 +1263,10 @@
|
|
|
1262
1263
|
maxSum: DEFAULT_MAX_SUM,
|
|
1263
1264
|
minMonths: DEFAULT_MIN_MONTHS,
|
|
1264
1265
|
maxMonths: DEFAULT_MAX_MONTHS,
|
|
1265
|
-
rate:
|
|
1266
|
-
isSalaryClient:
|
|
1266
|
+
rate: 12.5,
|
|
1267
|
+
isSalaryClient: false,
|
|
1267
1268
|
isPensionClient: false,
|
|
1268
|
-
isStateEmployee:
|
|
1269
|
+
isStateEmployee: false,
|
|
1269
1270
|
isInsurance: true,
|
|
1270
1271
|
};
|
|
1271
1272
|
const DEFAULT_TRAVEL_MIN_SUM = 6000;
|
|
@@ -1662,7 +1663,7 @@
|
|
|
1662
1663
|
const handleIsPensionClient = useCallback((_) => toggleIsPensionClient(_), []);
|
|
1663
1664
|
const [isInsurance, toggleIsInsurance] = useState(true);
|
|
1664
1665
|
const handleIsInsurance = useCallback((_) => toggleIsInsurance(_), []);
|
|
1665
|
-
const [moneyValue, setMoneyValue] = useState(
|
|
1666
|
+
const [moneyValue, setMoneyValue] = useState(CREDIT_DEFAULT_SUM);
|
|
1666
1667
|
const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
|
|
1667
1668
|
const [monthsValue, setMonthsValue] = useState(DEFAULT_MONTHS);
|
|
1668
1669
|
const handleMonthsValue = useCallback((_) => setMonthsValue(_), []);
|
|
@@ -1713,6 +1714,9 @@
|
|
|
1713
1714
|
const useDepositCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
|
|
1714
1715
|
const { moneyValue, monthsValue } = userInputParams;
|
|
1715
1716
|
const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
|
|
1717
|
+
const defaultMonth = data?.rows[0]
|
|
1718
|
+
? getMiddleMonth(data.rows[0].minMonths, data.rows[0].maxMonths)
|
|
1719
|
+
: 1;
|
|
1716
1720
|
const isExcludeMonthlyInterestPayment = !paramsViewSettings?.isShowMonthlyInterestPayment;
|
|
1717
1721
|
const isExcludeRemoteRegistration = !paramsViewSettings?.isShowRemoteRegistration;
|
|
1718
1722
|
const depositCalculatorSourceBookParams = data?.rows?.find((row) => checkRowByParam({
|
|
@@ -1728,7 +1732,7 @@
|
|
|
1728
1732
|
isExclude: isExcludeRemoteRegistration,
|
|
1729
1733
|
}) &&
|
|
1730
1734
|
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
1731
|
-
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
1735
|
+
checkRangeByKeys(monthsValue || defaultMonth, ['minMonths', 'maxMonths'], row)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
1732
1736
|
const { rate } = depositCalculatorSourceBookParams;
|
|
1733
1737
|
const income = getDepositIncome(rate, userInputParams);
|
|
1734
1738
|
const finalSum = moneyValue + income;
|
|
@@ -1739,6 +1743,7 @@
|
|
|
1739
1743
|
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
1740
1744
|
availableMonths: mergeIntervals(sourceBookRows.map((row) => [row['minMonths'], row['maxMonths']])).flatMap(([start, end]) => arrayByRange(start, end)),
|
|
1741
1745
|
...userInputParams,
|
|
1746
|
+
defaultMonth,
|
|
1742
1747
|
income,
|
|
1743
1748
|
finalSum,
|
|
1744
1749
|
};
|
|
@@ -1756,11 +1761,12 @@
|
|
|
1756
1761
|
}
|
|
1757
1762
|
};
|
|
1758
1763
|
const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
|
|
1764
|
+
const getMiddleMonth = (minMonths, maxMonths) => Math.round((maxMonths - minMonths) / 2);
|
|
1759
1765
|
|
|
1760
1766
|
const DepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
1761
|
-
const [moneyValue, setMoneyValue] = useState(
|
|
1767
|
+
const [moneyValue, setMoneyValue] = useState(DEPOSIT_DEFAULT_SUM);
|
|
1762
1768
|
const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
|
|
1763
|
-
const [monthsValue, setMonthsValue] = useState(
|
|
1769
|
+
const [monthsValue, setMonthsValue] = useState(0);
|
|
1764
1770
|
const [isMonthlyInterestPayment, toggleIsMonthlyInterestPayment] = useState(false);
|
|
1765
1771
|
const handleIsMonthlyInterestPayment = useCallback((_) => toggleIsMonthlyInterestPayment(_), []);
|
|
1766
1772
|
const [isRemoteRegistration, toggleIsRemoteRegistration] = useState(false);
|
|
@@ -1773,7 +1779,10 @@
|
|
|
1773
1779
|
};
|
|
1774
1780
|
const handleMonthsValue = useCallback((_) => setMonthsValue(_), []);
|
|
1775
1781
|
const calculatorParams = useDepositCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
|
|
1776
|
-
const { income, finalSum, rate } = calculatorParams;
|
|
1782
|
+
const { defaultMonth, income, finalSum, rate } = calculatorParams;
|
|
1783
|
+
useEffect(() => {
|
|
1784
|
+
setMonthsValue(defaultMonth);
|
|
1785
|
+
}, [defaultMonth]);
|
|
1777
1786
|
return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput('Сумма вклада, ₽', {
|
|
1778
1787
|
...calculatorParams,
|
|
1779
1788
|
}, handleMoneyValue), renderMonthsInput('Срок вклада, месяцев', {
|
|
@@ -3551,7 +3560,7 @@
|
|
|
3551
3560
|
|
|
3552
3561
|
const LinkDocsListItemBase = JSX(({ className, iconClassName, textClassName, suffixClassName, doc, icon }) => {
|
|
3553
3562
|
const { text, fileSize, ...linkProps } = doc;
|
|
3554
|
-
return (jsxs("a", { className: className, role: "link", ...linkProps, children: [icon ? (jsx(ImgInner, { className: iconClassName, image: getIconWithVersion(icon), width: "
|
|
3563
|
+
return (jsxs("a", { className: className, role: "link", ...linkProps, children: [icon ? (jsx(ImgInner, { className: iconClassName, image: getIconWithVersion(icon), width: "24", height: "24", asSVG: true })) : null, text ? (jsxs("span", { className: textClassName, children: [text, jsx("span", { className: suffixClassName, children: linkProps?.href && formatSuffix(getExtFromHref(linkProps.href), fileSize) })] })) : null] }));
|
|
3555
3564
|
});
|
|
3556
3565
|
const formatSuffix = (ext, fileSize) => {
|
|
3557
3566
|
const prefix = ext || fileSize ? ',' : '';
|
|
@@ -4713,7 +4722,7 @@
|
|
|
4713
4722
|
const [openTableInnerIdx, setOpenTableInnerIdx] = useState(undefined);
|
|
4714
4723
|
const handleOpenTableInnerIdx = useCallback((_) => setOpenTableInnerIdx(_), []);
|
|
4715
4724
|
const onHideContentClick = () => setTableInner(undefined);
|
|
4716
|
-
return (jsxs(TariffsTableRowContainer, { onHideContentClick: onHideContentClick, tableInner: tableInner, ...rest, children: [jsx("div", { className: `text-s py-5 ${FIRST_CELL_CLASSES} ${DIVIDER_CLASSES}`, children: jsxs("div", { className: "flex items-center text-primary-text", role: "cell", children: [header?.icon ? (jsx(ImgInner, { className: "mr-3.5 max-w-6
|
|
4725
|
+
return (jsxs(TariffsTableRowContainer, { onHideContentClick: onHideContentClick, tableInner: tableInner, ...rest, children: [jsx("div", { className: `text-s py-5 ${FIRST_CELL_CLASSES} ${DIVIDER_CLASSES}`, children: jsxs("div", { className: "flex items-center text-primary-text", role: "cell", children: [header?.icon ? (jsx(ImgInner, { className: "mr-3.5 max-w-6", image: getIconWithVersion(header.icon), width: "24", height: "24", asSVG: true })) : null, header?.title ? jsx("div", { className: "text-m-light", children: header?.title }) : null] }) }), data?.length ? (jsx(TableCarouselContainer, { activeIndex: activeIndex, columnWidth: COLUMN_WIDTH$1, version: "tariff", children: data.map((cells, i) => (jsx(TariffsTableCell, { cells: cells, rowIdx: rowIdx, cellIdx: i, setTableInner: handleSetTableInner, tableInner: tableInner, openTableInnerIdx: openTableInnerIdx, setOpenTableInnerIdx: handleOpenTableInnerIdx, ...rest }, String(i)))) })) : null] }));
|
|
4717
4726
|
});
|
|
4718
4727
|
|
|
4719
4728
|
const TariffsTable = JSX(({ className = '', title, description, rowHeaders, tariffsColumns: columns, hiddenRowsNum = 0, ...rest }) => {
|
|
@@ -4974,7 +4983,7 @@
|
|
|
4974
4983
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
|
|
4975
4984
|
}
|
|
4976
4985
|
|
|
4977
|
-
const packageVersion = "0.9.
|
|
4986
|
+
const packageVersion = "0.9.15";
|
|
4978
4987
|
|
|
4979
4988
|
exports.Blocks = Blocks;
|
|
4980
4989
|
exports.ContentPage = ContentPage;
|