@redneckz/wildless-cms-uni-blocks 0.14.3 → 0.14.4

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 (94) hide show
  1. package/bin/migration-scripts/0.14.4.js +37 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +39 -27
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Calculator/CalculatorContent.d.ts +27 -1
  6. package/bundle/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
  7. package/bundle/model/EmptyOptionType.d.ts +1 -1
  8. package/dist/components/Calculator/BonusCalculatorForm.js +1 -1
  9. package/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  10. package/dist/components/Calculator/BusinessDepositCalculatorForm.js +2 -2
  11. package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  12. package/dist/components/Calculator/Calculator.js +16 -4
  13. package/dist/components/Calculator/Calculator.js.map +1 -1
  14. package/dist/components/Calculator/CalculatorContent.d.ts +27 -1
  15. package/dist/components/Calculator/CreditCalculatorForm.js +6 -6
  16. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  17. package/dist/components/Calculator/DepositCalculatorForm.js +8 -8
  18. package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  19. package/dist/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
  20. package/dist/components/Calculator/useBonusCalculatorParams.js.map +1 -1
  21. package/dist/content-page-repository/transformHTML.js +32 -2
  22. package/dist/content-page-repository/transformHTML.js.map +1 -1
  23. package/dist/model/EmptyOptionType.d.ts +1 -1
  24. package/lib/components/Calculator/BonusCalculatorForm.js +1 -1
  25. package/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  26. package/lib/components/Calculator/BusinessDepositCalculatorForm.js +2 -2
  27. package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  28. package/lib/components/Calculator/Calculator.js +16 -4
  29. package/lib/components/Calculator/Calculator.js.map +1 -1
  30. package/lib/components/Calculator/CalculatorContent.d.ts +27 -1
  31. package/lib/components/Calculator/CreditCalculatorForm.js +6 -6
  32. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  33. package/lib/components/Calculator/DepositCalculatorForm.js +8 -8
  34. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  35. package/lib/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
  36. package/lib/components/Calculator/useBonusCalculatorParams.js.map +1 -1
  37. package/lib/content-page-repository/transformHTML.js +9 -2
  38. package/lib/content-page-repository/transformHTML.js.map +1 -1
  39. package/lib/model/EmptyOptionType.d.ts +1 -1
  40. package/mobile/bundle/bundle.umd.js +21 -21
  41. package/mobile/bundle/bundle.umd.min.js +1 -1
  42. package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +27 -1
  43. package/mobile/bundle/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
  44. package/mobile/bundle/model/EmptyOptionType.d.ts +1 -1
  45. package/mobile/dist/components/Calculator/BonusCalculatorForm.js +1 -1
  46. package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
  47. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +2 -2
  48. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  49. package/mobile/dist/components/Calculator/CalculatorContent.d.ts +27 -1
  50. package/mobile/dist/components/Calculator/CreditCalculatorForm.js +6 -6
  51. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  52. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +8 -8
  53. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  54. package/mobile/dist/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
  55. package/mobile/dist/components/Calculator/useBonusCalculatorParams.js.map +1 -1
  56. package/mobile/dist/content-page-repository/transformHTML.js +32 -2
  57. package/mobile/dist/content-page-repository/transformHTML.js.map +1 -1
  58. package/mobile/dist/model/EmptyOptionType.d.ts +1 -1
  59. package/mobile/lib/components/Calculator/BonusCalculatorForm.js +1 -1
  60. package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
  61. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +2 -2
  62. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  63. package/mobile/lib/components/Calculator/CalculatorContent.d.ts +27 -1
  64. package/mobile/lib/components/Calculator/CreditCalculatorForm.js +6 -6
  65. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  66. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +8 -8
  67. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  68. package/mobile/lib/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
  69. package/mobile/lib/components/Calculator/useBonusCalculatorParams.js.map +1 -1
  70. package/mobile/lib/content-page-repository/transformHTML.js +9 -2
  71. package/mobile/lib/content-page-repository/transformHTML.js.map +1 -1
  72. package/mobile/lib/model/EmptyOptionType.d.ts +1 -1
  73. package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +1 -1
  74. package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +5 -2
  75. package/mobile/src/components/Calculator/Calculator.example.json +1 -0
  76. package/mobile/src/components/Calculator/Calculator.ui.json +8 -0
  77. package/mobile/src/components/Calculator/CalculatorContent.ts +31 -1
  78. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +6 -6
  79. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +8 -8
  80. package/mobile/src/components/Calculator/useBonusCalculatorParams.ts +1 -1
  81. package/mobile/src/content-page-repository/transformHTML.ts +10 -2
  82. package/mobile/src/model/EmptyOptionType.ts +1 -1
  83. package/package.json +1 -1
  84. package/src/components/Calculator/BonusCalculatorForm.tsx +1 -1
  85. package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +5 -2
  86. package/src/components/Calculator/Calculator.example.json +1 -0
  87. package/src/components/Calculator/Calculator.tsx +19 -4
  88. package/src/components/Calculator/Calculator.ui.json +8 -0
  89. package/src/components/Calculator/CalculatorContent.ts +31 -1
  90. package/src/components/Calculator/CreditCalculatorForm.tsx +6 -6
  91. package/src/components/Calculator/DepositCalculatorForm.tsx +8 -8
  92. package/src/components/Calculator/useBonusCalculatorParams.ts +1 -1
  93. package/src/content-page-repository/transformHTML.ts +10 -2
  94. package/src/model/EmptyOptionType.ts +1 -1
@@ -1507,13 +1507,13 @@
1507
1507
 
1508
1508
  const BusinessBlock = JSX(({ className, title, cards, ...rest }) => (jsxs(BlockWrapper, { className: className, defaultPadding: "p-6xl space-y-3xl", ...rest, children: [jsx(Heading, { headingType: "h3", title: title, className: "text-center" }), jsx("div", { className: "flex gap-lg", children: cards?.length ? cards.map((_, i) => jsx(BusinessCard, { ..._ }, String(i))) : null })] })));
1509
1509
 
1510
- const alignStyleMap = {
1510
+ const alignStyleMap$1 = {
1511
1511
  start: 'justify-start',
1512
1512
  center: 'justify-center',
1513
1513
  end: 'justify-end',
1514
1514
  };
1515
1515
  const ButtonsBlock = JSX(({ buttons, className = '', align, ...rest }) => {
1516
- const alignStyle = align ? style('flex', alignStyleMap[align]) : '';
1516
+ const alignStyle = align ? style('flex', alignStyleMap$1[align]) : '';
1517
1517
  return (jsx(BlockWrapper, { className: style('!bg-transparent', alignStyle, className), defaultPadding: "p-0", ...rest, children: renderButtonsSection(buttons) }));
1518
1518
  });
1519
1519
 
@@ -1687,7 +1687,7 @@
1687
1687
  };
1688
1688
  };
1689
1689
 
1690
- const BonusCalculatorForm = JSX(({ className = '', sourceBookDir = '', buttons, footnote }) => {
1690
+ const BonusCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote }) => {
1691
1691
  const [userInputParams, { field }] = useForm({
1692
1692
  travelExpenseValue: DEFAULT_TRAVEL_MIN_SUM,
1693
1693
  restExpenseValue: DEFAULT_REST_MIN_SUM,
@@ -1856,7 +1856,7 @@
1856
1856
  }
1857
1857
  };
1858
1858
 
1859
- const BusinessDepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
1859
+ const BusinessDepositCalculatorForm = JSX(({ className = '', rateParams, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
1860
1860
  const [userInputParams, { field }] = useForm({
1861
1861
  moneyValue: BUSINESS_DEFAULT_SUM,
1862
1862
  daysValue: BUSINESS_DEFAULT_DAYS,
@@ -1865,7 +1865,7 @@
1865
1865
  isSmallBusiness: false,
1866
1866
  isMonthlyInterestPayment: false,
1867
1867
  });
1868
- const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
1868
+ const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, rateParams?.sourceBookDir);
1869
1869
  const { income, finalSum, rate, isUnavailableByTerm, depositeName } = calculatorParams;
1870
1870
  return (jsxs("section", { className: style('flex flex-col justify-between @5xl:flex-row gap-m', className), children: [jsxs("div", { className: "flex flex-col gap-y-m sm:max-w-md gap-2xl", children: [renderWantedSumInput({
1871
1871
  title: 'Сумма, ₽',
@@ -1898,6 +1898,15 @@
1898
1898
  const renderMonthsInput = ({ min = 0, max = 0, availableMonths, ...rest }) => (jsx(InputRange, { items: [`От ${monthText(min)}`, `До ${monthText(max)}`], step: STEP_MONTHS, ...(availableMonths?.length ? { list: availableMonths } : { min, max }), ...rest }));
1899
1899
  const monthText = (month) => `${month} ${Number(month) % 10 === 1 ? 'месяца' : 'месяцев'}`;
1900
1900
 
1901
+ const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
1902
+ ...props,
1903
+ radioGroupClassName: 'sm:flex-col',
1904
+ items: [
1905
+ { id: 'annuity', text: 'Аннуитетный' },
1906
+ { id: 'differential', text: 'Дифференцированный' },
1907
+ ],
1908
+ });
1909
+
1901
1910
  const checkCreditSourceBookRowCommonParams = (props) => checkRowParam$1({
1902
1911
  ...props,
1903
1912
  fieldKey: 'isSalaryClient',
@@ -1994,15 +2003,6 @@
1994
2003
  }), [userInputParams, data]);
1995
2004
  };
1996
2005
 
1997
- const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
1998
- ...props,
1999
- radioGroupClassName: 'sm:flex-col',
2000
- items: [
2001
- { id: 'annuity', text: 'Аннуитетный' },
2002
- { id: 'differential', text: 'Дифференцированный' },
2003
- ],
2004
- });
2005
-
2006
2006
  const CreditCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings, isMobile }) => {
2007
2007
  const [userInputParams, { field }] = useForm({
2008
2008
  isAnnuity: true,
@@ -2038,6 +2038,14 @@
2038
2038
  });
2039
2039
  const renderCreditParamsForm$1 = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: `Получаю зарплату на счёт\nв Россельхозбанке`, ...field('isSalaryClient'), value: params.isSalaryClient, className: "whitespace-pre-line sm:whitespace-normal" })) : null, params.isShowStateEmployee ? (jsx(Checkbox, { text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null] }));
2040
2040
 
2041
+ const renderRegistrationType = (props) => renderBinaryRadioButtonGroup({
2042
+ ...props,
2043
+ items: [
2044
+ { id: 'remote', text: 'Дистанционно' },
2045
+ { id: 'office', text: 'Офис Банка' },
2046
+ ],
2047
+ });
2048
+
2041
2049
  const arrayByRange = (start, stop, step = 1) => Array.from({ length: Math.abs(stop - start) / step + 1 }, (value, index) => stop >= start ? start + index * step : start - index * step);
2042
2050
 
2043
2051
  const useDepositCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
@@ -2092,14 +2100,6 @@
2092
2100
  const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
2093
2101
  const getMiddleMonth = (minMonths, maxMonths) => minMonths + Math.round((maxMonths - minMonths) / 2);
2094
2102
 
2095
- const renderRegistrationType = (props) => renderBinaryRadioButtonGroup({
2096
- ...props,
2097
- items: [
2098
- { id: 'remote', text: 'Дистанционно' },
2099
- { id: 'office', text: 'Офис Банка' },
2100
- ],
2101
- });
2102
-
2103
2103
  const DepositCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
2104
2104
  const [userInputParams, { field }] = useForm({
2105
2105
  moneyValue: DEPOSIT_DEFAULT_SUM,
@@ -2280,7 +2280,12 @@
2280
2280
  return (jsx("section", { className: "box-border relative bg-white flex shrink-0 self-start basis-full", role: "listitem", children: jsxs("div", { className: "box-border p-4xl w-full space-y-xl", children: [block?.title ? jsx(Heading, { className: "text-center", title: block.title }) : null, jsx(EmbeddedBlock, { ...block })] }) }, String(i)));
2281
2281
  };
2282
2282
 
2283
- const Calculator = JSX(({ className = '', calculatorTabs = [], ...rest }) => {
2283
+ const alignStyleMap = {
2284
+ start: 'justify-start',
2285
+ center: 'justify-center',
2286
+ end: 'justify-end',
2287
+ };
2288
+ const Calculator = JSX(({ className = '', tabAlign, calculatorTabs = [], ...rest }) => {
2284
2289
  const tabsNav = calculatorTabs.map((_) => _.nav || {});
2285
2290
  const calculatorBlocks = calculatorTabs.map(({ calculatorBlock }) => calculatorBlock || {});
2286
2291
  const [slideIndexShift, setSlideIndexShift] = useState(0);
@@ -2291,7 +2296,13 @@
2291
2296
  visibleItemCount: COLUMNS_FOR_SCROLL,
2292
2297
  });
2293
2298
  return (jsxs(BlockWrapper, { className: style('box-border overflow-hidden relative', className), defaultPadding: "p-0", ...rest, children: [jsxs("div", { className: "bg-white", children: [tabsNav.length > 1
2294
- ? renderTabs$1({ activeIndex, tabsNav, slideIndexShift, onClick: handleSlideIndexShift })
2299
+ ? renderTabs$1({
2300
+ activeIndex,
2301
+ tabsNav,
2302
+ tabAlign,
2303
+ slideIndexShift,
2304
+ onClick: handleSlideIndexShift,
2305
+ })
2295
2306
  : null, renderArrows({
2296
2307
  ...controls,
2297
2308
  btnClass: ['left-3', 'right-3'],
@@ -2314,9 +2325,10 @@
2314
2325
  iconVersion: iconVersion ?? activeIconStyle,
2315
2326
  }, width: "24", height: "24" }), jsxs("div", { className: "border-0", children: [jsx("div", { className: btnTitleClassName, children: tab?.title }), jsx("div", { className: btnDescClassName, children: tab.description })] })] }, String(i)));
2316
2327
  }
2317
- function renderTabs$1({ activeIndex, tabsNav, slideIndexShift, onClick }) {
2328
+ function renderTabs$1({ activeIndex, tabsNav, tabAlign, slideIndexShift, onClick }) {
2318
2329
  const CARD_SHIFT = 388;
2319
- return (jsxs("div", { children: [jsx("div", { style: { transform: `translateX(-${activeIndex * CARD_SHIFT}px)` }, className: "flex flex-col justify-end items-center h-32 pt-4xl box-border duration-1000", children: jsx("div", { className: "w-full flex flex-nowrap items-end gap-xs", children: tabsNav.map((tab, i) => renderNavButton$3({
2330
+ const alignStyle = tabAlign ? alignStyleMap[tabAlign] : '';
2331
+ return (jsxs("div", { children: [jsx("div", { style: { transform: `translateX(-${activeIndex * CARD_SHIFT}px)` }, className: "flex flex-col justify-end items-center h-32 pt-4xl box-border duration-1000", children: jsx("div", { className: style('w-full flex flex-nowrap items-end gap-xs', alignStyle), children: tabsNav.map((tab, i) => renderNavButton$3({
2320
2332
  tab,
2321
2333
  i,
2322
2334
  isActive: Boolean(i === slideIndexShift),
@@ -5367,7 +5379,7 @@
5367
5379
  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" }) }));
5368
5380
  }
5369
5381
 
5370
- const packageVersion = "0.14.3";
5382
+ const packageVersion = "0.14.4";
5371
5383
 
5372
5384
  exports.Blocks = Blocks;
5373
5385
  exports.ContentPage = ContentPage;