@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.
Files changed (124) hide show
  1. package/bundle/bundle.umd.js +23 -14
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/Calculator/constants.d.ts +3 -2
  4. package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  5. package/bundle/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
  6. package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
  7. package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  8. package/dist/components/Calculator/CreditCalculatorForm.js +1 -1
  9. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  10. package/dist/components/Calculator/DepositCalculatorForm.js +6 -3
  11. package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  12. package/dist/components/Calculator/constants.d.ts +3 -2
  13. package/dist/components/Calculator/constants.js +7 -6
  14. package/dist/components/Calculator/constants.js.map +1 -1
  15. package/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  16. package/dist/components/Calculator/useDepositCalculatorParams.js +6 -1
  17. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  18. package/dist/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
  19. package/dist/components/LinkDocs/LinkDocsListItemBase.js +1 -1
  20. package/dist/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
  21. package/dist/components/TariffsTable/TableTileHeader.js +1 -1
  22. package/dist/components/TariffsTable/TableTileHeader.js.map +1 -1
  23. package/dist/components/TariffsTable/TariffsTableRow.js +1 -1
  24. package/dist/components/TariffsTable/TariffsTableRow.js.map +1 -1
  25. package/lib/common.css +1 -1
  26. package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
  27. package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  28. package/lib/components/Calculator/CreditCalculatorForm.js +2 -2
  29. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  30. package/lib/components/Calculator/DepositCalculatorForm.js +8 -5
  31. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  32. package/lib/components/Calculator/constants.d.ts +3 -2
  33. package/lib/components/Calculator/constants.js +6 -5
  34. package/lib/components/Calculator/constants.js.map +1 -1
  35. package/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  36. package/lib/components/Calculator/useDepositCalculatorParams.js +6 -1
  37. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  38. package/lib/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
  39. package/lib/components/LinkDocs/LinkDocsListItemBase.js +1 -1
  40. package/lib/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
  41. package/lib/components/TariffsTable/TableTileHeader.js +1 -1
  42. package/lib/components/TariffsTable/TableTileHeader.js.map +1 -1
  43. package/lib/components/TariffsTable/TariffsTableRow.js +1 -1
  44. package/lib/components/TariffsTable/TariffsTableRow.js.map +1 -1
  45. package/mobile/bundle/bundle.umd.js +3 -3
  46. package/mobile/bundle/bundle.umd.min.js +1 -1
  47. package/mobile/bundle/components/Calculator/constants.d.ts +3 -2
  48. package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  49. package/mobile/bundle/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
  50. package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
  51. package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  52. package/mobile/dist/components/Calculator/CreditCalculatorForm.js +1 -1
  53. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  54. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +6 -3
  55. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  56. package/mobile/dist/components/Calculator/constants.d.ts +3 -2
  57. package/mobile/dist/components/Calculator/constants.js +7 -6
  58. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  59. package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  60. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +6 -1
  61. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  62. package/mobile/dist/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
  63. package/mobile/dist/components/LinkDocs/LinkDocsListItemBase.js +1 -1
  64. package/mobile/dist/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
  65. package/mobile/dist/components/TariffsTable/TableTileHeader.js +1 -1
  66. package/mobile/dist/components/TariffsTable/TableTileHeader.js.map +1 -1
  67. package/mobile/dist/components/TariffsTable/TariffsTableRow.js +1 -1
  68. package/mobile/dist/components/TariffsTable/TariffsTableRow.js.map +1 -1
  69. package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
  70. package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
  71. package/mobile/lib/components/Calculator/CreditCalculatorForm.js +2 -2
  72. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  73. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +8 -5
  74. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  75. package/mobile/lib/components/Calculator/constants.d.ts +3 -2
  76. package/mobile/lib/components/Calculator/constants.js +6 -5
  77. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  78. package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  79. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +6 -1
  80. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  81. package/mobile/lib/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
  82. package/mobile/lib/components/LinkDocs/LinkDocsListItemBase.js +1 -1
  83. package/mobile/lib/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
  84. package/mobile/lib/components/TariffsTable/TableTileHeader.js +1 -1
  85. package/mobile/lib/components/TariffsTable/TableTileHeader.js.map +1 -1
  86. package/mobile/lib/components/TariffsTable/TariffsTableRow.js +1 -1
  87. package/mobile/lib/components/TariffsTable/TariffsTableRow.js.map +1 -1
  88. package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +2 -2
  89. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +2 -2
  90. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +8 -5
  91. package/mobile/src/components/Calculator/constants.ts +6 -5
  92. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +9 -1
  93. package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.example.json +6 -6
  94. package/mobile/src/components/CarouselRichTextCard/CarouselRichTextCardContent.ts +1 -1
  95. package/mobile/src/components/LinkDocs/LinkDocsListItemBase.tsx +2 -2
  96. package/mobile/src/components/TariffsTable/TableTileHeader.tsx +1 -3
  97. package/mobile/src/components/TariffsTable/TariffsTableRow.tsx +3 -3
  98. package/package.json +1 -1
  99. package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +2 -2
  100. package/src/components/Calculator/CreditCalculatorForm.tsx +2 -2
  101. package/src/components/Calculator/DepositCalculatorForm.tsx +8 -5
  102. package/src/components/Calculator/constants.ts +6 -5
  103. package/src/components/Calculator/useDepositCalculatorParams.ts +9 -1
  104. package/src/components/CarouselProgramsCard/CarouselProgramsCard.example.json +6 -6
  105. package/src/components/CarouselRichTextCard/CarouselRichTextCardContent.ts +1 -1
  106. package/src/components/LinkDocs/LinkDocsListItemBase.tsx +2 -2
  107. package/src/components/TariffsTable/TableTileHeader.tsx +1 -3
  108. package/src/components/TariffsTable/TariffsTableRow.tsx +3 -3
  109. package/bundle/components/Calculator/getDefaultSum.d.ts +0 -1
  110. package/dist/components/Calculator/getDefaultSum.d.ts +0 -1
  111. package/dist/components/Calculator/getDefaultSum.js +0 -6
  112. package/dist/components/Calculator/getDefaultSum.js.map +0 -1
  113. package/lib/components/Calculator/getDefaultSum.d.ts +0 -1
  114. package/lib/components/Calculator/getDefaultSum.js +0 -3
  115. package/lib/components/Calculator/getDefaultSum.js.map +0 -1
  116. package/mobile/bundle/components/Calculator/getDefaultSum.d.ts +0 -1
  117. package/mobile/dist/components/Calculator/getDefaultSum.d.ts +0 -1
  118. package/mobile/dist/components/Calculator/getDefaultSum.js +0 -6
  119. package/mobile/dist/components/Calculator/getDefaultSum.js.map +0 -1
  120. package/mobile/lib/components/Calculator/getDefaultSum.d.ts +0 -1
  121. package/mobile/lib/components/Calculator/getDefaultSum.js +0 -3
  122. package/mobile/lib/components/Calculator/getDefaultSum.js.map +0 -1
  123. package/mobile/src/components/Calculator/getDefaultSum.ts +0 -4
  124. package/src/components/Calculator/getDefaultSum.ts +0 -4
@@ -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", width: "auto", className: "w-auto" }) : null, description ? jsx("span", { children: description }) : null] }, String(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", 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 = 30000;
1245
+ const DEFAULT_MIN_SUM = 10000;
1246
1246
  const DEFAULT_MAX_SUM = 5000000;
1247
- const DEFAULT_SUM = (DEFAULT_MAX_SUM - DEFAULT_MIN_SUM) / 2;
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: 0,
1266
- isSalaryClient: true,
1266
+ rate: 12.5,
1267
+ isSalaryClient: false,
1267
1268
  isPensionClient: false,
1268
- isStateEmployee: true,
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(DEFAULT_SUM);
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(DEFAULT_SUM);
1767
+ const [moneyValue, setMoneyValue] = useState(DEPOSIT_DEFAULT_SUM);
1762
1768
  const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
1763
- const [monthsValue, setMonthsValue] = useState(DEFAULT_MONTHS);
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: "24px", height: "24px", asSVG: true })) : null, text ? (jsxs("span", { className: textClassName, children: [text, jsx("span", { className: suffixClassName, children: linkProps?.href && formatSuffix(getExtFromHref(linkProps.href), fileSize) })] })) : null] }));
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 max-h-6", image: getIconWithVersion(header.icon), width: "24px", height: "24px", 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] }));
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.14";
4986
+ const packageVersion = "0.9.15";
4978
4987
 
4979
4988
  exports.Blocks = Blocks;
4980
4989
  exports.ContentPage = ContentPage;