@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.
Files changed (85) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +31 -22
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/Calculator/CalculatorContent.d.ts +38 -0
  5. package/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -1
  6. package/bundle/components/Calculator/getDefaultValues.d.ts +4 -0
  7. package/bundle/components/ProductBlock/ProductBlockContent.d.ts +1 -1
  8. package/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
  9. package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  10. package/dist/components/Calculator/CalculatorContent.d.ts +38 -0
  11. package/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -1
  12. package/dist/components/Calculator/CreditCalculatorForm.js +9 -8
  13. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  14. package/dist/components/Calculator/DepositCalculatorForm.js +6 -5
  15. package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  16. package/dist/components/Calculator/getDefaultValues.d.ts +4 -0
  17. package/dist/components/Calculator/getDefaultValues.js +20 -0
  18. package/dist/components/Calculator/getDefaultValues.js.map +1 -0
  19. package/dist/components/ProductBlock/ProductBlockContent.d.ts +1 -1
  20. package/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  21. package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  22. package/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
  23. package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  24. package/lib/components/Calculator/CalculatorContent.d.ts +38 -0
  25. package/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -1
  26. package/lib/components/Calculator/CreditCalculatorForm.js +9 -8
  27. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  28. package/lib/components/Calculator/DepositCalculatorForm.js +6 -5
  29. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  30. package/lib/components/Calculator/getDefaultValues.d.ts +4 -0
  31. package/lib/components/Calculator/getDefaultValues.js +15 -0
  32. package/lib/components/Calculator/getDefaultValues.js.map +1 -0
  33. package/lib/components/ProductBlock/ProductBlockContent.d.ts +1 -1
  34. package/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  35. package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  36. package/mobile/bundle/bundle.umd.js +31 -22
  37. package/mobile/bundle/bundle.umd.min.js +1 -1
  38. package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +38 -0
  39. package/mobile/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -1
  40. package/mobile/bundle/components/Calculator/getDefaultValues.d.ts +4 -0
  41. package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +1 -1
  42. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
  43. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  44. package/mobile/dist/components/Calculator/CalculatorContent.d.ts +38 -0
  45. package/mobile/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -1
  46. package/mobile/dist/components/Calculator/CreditCalculatorForm.js +9 -8
  47. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  48. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +6 -5
  49. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  50. package/mobile/dist/components/Calculator/getDefaultValues.d.ts +4 -0
  51. package/mobile/dist/components/Calculator/getDefaultValues.js +20 -0
  52. package/mobile/dist/components/Calculator/getDefaultValues.js.map +1 -0
  53. package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +1 -1
  54. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  55. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  56. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
  57. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  58. package/mobile/lib/components/Calculator/CalculatorContent.d.ts +38 -0
  59. package/mobile/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -1
  60. package/mobile/lib/components/Calculator/CreditCalculatorForm.js +9 -8
  61. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  62. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +6 -5
  63. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  64. package/mobile/lib/components/Calculator/getDefaultValues.d.ts +4 -0
  65. package/mobile/lib/components/Calculator/getDefaultValues.js +15 -0
  66. package/mobile/lib/components/Calculator/getDefaultValues.js.map +1 -0
  67. package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +1 -1
  68. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  69. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  70. package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +15 -6
  71. package/mobile/src/components/Calculator/CalculatorContent.ts +42 -0
  72. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +9 -9
  73. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +6 -5
  74. package/mobile/src/components/Calculator/getDefaultValues.ts +28 -0
  75. package/mobile/src/components/ProductBlock/ProductBlockContent.ts +1 -1
  76. package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -0
  77. package/package.json +1 -1
  78. package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +15 -6
  79. package/src/components/Calculator/Calculator.fixture.tsx +4 -0
  80. package/src/components/Calculator/CalculatorContent.ts +42 -0
  81. package/src/components/Calculator/CreditCalculatorForm.tsx +9 -9
  82. package/src/components/Calculator/DepositCalculatorForm.tsx +6 -5
  83. package/src/components/Calculator/getDefaultValues.ts +28 -0
  84. package/src/components/ProductBlock/ProductBlockContent.ts +1 -1
  85. package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -0
@@ -0,0 +1,15 @@
1
+ import { BUSINESS_MAX_DAYS, BUSINESS_MIN_DAYS, DEFAULT_MAX_MONTHS, DEFAULT_MAX_SUM, DEFAULT_MIN_MONTHS, DEFAULT_MIN_SUM, } from './constants.js';
2
+ export const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum && defaultParams.sum >= DEFAULT_MIN_SUM && defaultParams.sum <= DEFAULT_MAX_SUM
3
+ ? defaultParams.sum
4
+ : defaultMoney;
5
+ export const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
6
+ defaultParams.period >= DEFAULT_MIN_MONTHS &&
7
+ defaultParams.period <= DEFAULT_MAX_MONTHS
8
+ ? defaultParams.period
9
+ : defaultMonth;
10
+ export const getDaysDefaultValue = (defaultParams, defaultDays = 0) => defaultParams?.period &&
11
+ defaultParams.period >= BUSINESS_MIN_DAYS &&
12
+ defaultParams.period <= BUSINESS_MAX_DAYS
13
+ ? defaultParams.period
14
+ : defaultDays;
15
+ //# sourceMappingURL=getDefaultValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDefaultValues.js","sourceRoot":"","sources":["../../../src/components/Calculator/getDefaultValues.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,aAAmC,EAAE,YAAY,GAAG,CAAC,EAAE,EAAE,CAC5F,aAAa,EAAE,GAAG,IAAI,aAAa,CAAC,GAAG,IAAI,eAAe,IAAI,aAAa,CAAC,GAAG,IAAI,eAAe;IAChG,CAAC,CAAC,aAAa,CAAC,GAAG;IACnB,CAAC,CAAC,YAAY,CAAC;AAEnB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,aAAmC,EAAE,YAAY,GAAG,CAAC,EAAE,EAAE,CAC7F,aAAa,EAAE,MAAM;IACrB,aAAa,CAAC,MAAM,IAAI,kBAAkB;IAC1C,aAAa,CAAC,MAAM,IAAI,kBAAkB;IACxC,CAAC,CAAC,aAAa,CAAC,MAAM;IACtB,CAAC,CAAC,YAAY,CAAC;AAEnB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,aAAmC,EAAE,WAAW,GAAG,CAAC,EAAE,EAAE,CAC1F,aAAa,EAAE,MAAM;IACrB,aAAa,CAAC,MAAM,IAAI,iBAAiB;IACzC,aAAa,CAAC,MAAM,IAAI,iBAAiB;IACvC,CAAC,CAAC,aAAa,CAAC,MAAM;IACtB,CAAC,CAAC,WAAW,CAAC"}
@@ -4,7 +4,7 @@ import { type BaseProductTileContent } from '../../ui-kit/BaseProductTile/BasePr
4
4
  * @title Продуктовый блок
5
5
  */
6
6
  export declare type ProductBlockContent = UniBlockContent & BaseProductTileContent & {
7
- /** @title Отображать кнопку возврата (только для десктопной версии) */
7
+ /** @title Отображать кнопку возврата */
8
8
  backwardButton?: boolean;
9
9
  /** @title Показывать рамку вокруг блока */
10
10
  showBorder?: boolean;
@@ -9,11 +9,11 @@ import { List } from '../List/List.js';
9
9
  import { PriceList } from '../PriceList/PriceList.js';
10
10
  import { RichText } from '../RichText/RichText.js';
11
11
  import { Tags } from '../Tags/Tags.js';
12
- export 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, }) => {
12
+ export 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 }) => {
13
13
  const img = image?.src ? _jsx(Img, { image: image }) : null;
14
14
  const headline = renderHeadline({ title, description, headlineVersion, align });
15
15
  const filteredBenefits = benefits?.filter((_) => _?.type === 'rte' || 'label' in _ || 'description' in _);
16
- 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)] }) }));
16
+ 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)] }) }));
17
17
  });
18
18
  export const leftOrRightImage = (img, directionRight) => directionRight ? { rightImage: img } : { leftImage: img };
19
19
  const renderTags = (tags) => (tags?.length ? _jsx(Tags, { tags: tags }) : null);
@@ -1 +1 @@
1
- {"version":3,"file":"BaseProductTile.js","sourceRoot":"","sources":["../../../src/ui-kit/BaseProductTile/BaseProductTile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAI9D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAQpC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAChC,CAAC,EACC,SAAS,EACT,OAAO,EACP,cAAc,EACd,KAAK,EACL,WAAW,EACX,eAAe,GAAG,GAAG,EACrB,KAAK,GAAG,WAAW,EACnB,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,YAAY,EACZ,IAAI,GAAG,EAAE,EACT,OAAO,EACP,KAAK,EACL,YAAY,EAAE,EACZ,UAAU,GAAG,QAAQ,EACrB,cAAc,GAAG,IAAI,EACrB,oBAAoB,EACpB,gBAAgB,GAAG,KAAK,GACzB,GAAG,EAAE,EACN,cAAc,EACd,QAAQ,G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,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;AAE5D,MAAM,UAAU,GAAG,CAAC,IAAc,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AASpF,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,EAAkB,EAAE,EAAE,CACxF,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CACrB,KAAC,QAAQ,IACP,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,IAAI,GAChB,CACH,CAAC,CAAC,CAAC,IAAI,CAAC"}
@@ -2096,6 +2096,15 @@
2096
2096
  : 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)] })] }));
2097
2097
  });
2098
2098
 
2099
+ const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum && defaultParams.sum >= DEFAULT_MIN_SUM$1 && defaultParams.sum <= DEFAULT_MAX_SUM$1
2100
+ ? defaultParams.sum
2101
+ : defaultMoney;
2102
+ const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
2103
+ defaultParams.period >= DEFAULT_MIN_MONTHS &&
2104
+ defaultParams.period <= DEFAULT_MAX_MONTHS
2105
+ ? defaultParams.period
2106
+ : defaultMonth;
2107
+
2099
2108
  const STEP_DAYS = 1;
2100
2109
  const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
2101
2110
  const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
@@ -2198,13 +2207,13 @@
2198
2207
  }
2199
2208
  };
2200
2209
 
2201
- const BusinessDepositCalculatorForm = JSX(({ className = '', rateParams, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
2210
+ const BusinessDepositCalculatorForm = JSX(({ className = '', rateParams, buttons, footnote, bottomFootnote, isShowDepositeName, defaultParams, }) => {
2202
2211
  const [userInputParams, { field }] = useForm({
2203
- moneyValue: BUSINESS_DEFAULT_SUM,
2204
- daysValue: BUSINESS_DEFAULT_DAYS,
2205
- isReplenished: false,
2206
- isPartialWithdrawal: false,
2207
- isMonthlyInterestPayment: false,
2212
+ moneyValue: getMoneyDefaultValue(defaultParams, BUSINESS_DEFAULT_SUM),
2213
+ daysValue: getMonthsDefaultValue(defaultParams, BUSINESS_DEFAULT_DAYS),
2214
+ isReplenished: Boolean(defaultParams?.isReplenished),
2215
+ isPartialWithdrawal: Boolean(defaultParams?.isPartialWithdrawal),
2216
+ isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
2208
2217
  });
2209
2218
  const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, rateParams?.rateType && rateParams.sourceBookDir);
2210
2219
  const { income, finalSum, rate, isUnavailableByTerm, depositeName } = calculatorParams;
@@ -2344,15 +2353,15 @@
2344
2353
  }), [userInputParams, data]);
2345
2354
  };
2346
2355
 
2347
- const CreditCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
2356
+ const CreditCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings, defaultParams }) => {
2348
2357
  const [userInputParams, { field }] = useForm({
2349
- isAnnuity: true,
2350
- isInsurance: true,
2351
- isSalaryClient: false,
2352
- isPensionClient: false,
2353
- isStateEmployee: false,
2354
- moneyValue: CREDIT_DEFAULT_SUM,
2355
- monthsValue: DEFAULT_MONTHS,
2358
+ moneyValue: getMoneyDefaultValue(defaultParams, CREDIT_DEFAULT_SUM),
2359
+ monthsValue: getMonthsDefaultValue(defaultParams, DEFAULT_MONTHS),
2360
+ isAnnuity: Boolean(defaultParams?.isAnnuity),
2361
+ isInsurance: Boolean(defaultParams?.isEnableInsurance),
2362
+ isSalaryClient: Boolean(defaultParams?.isEnableSalaryClient),
2363
+ isPensionClient: Boolean(defaultParams?.isEnablePensionClient),
2364
+ isStateEmployee: Boolean(defaultParams?.isEnableStateEmployee),
2356
2365
  });
2357
2366
  const calculatorParams = useCreditCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
2358
2367
  const paymentTypeElement = renderPaymentType({
@@ -2442,12 +2451,12 @@
2442
2451
  const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
2443
2452
  const getMiddleMonth = (minMonths, maxMonths) => minMonths + Math.round((maxMonths - minMonths) / 2);
2444
2453
 
2445
- const DepositCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
2454
+ const DepositCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings, defaultParams }) => {
2446
2455
  const [userInputParams, { field }] = useForm({
2447
- moneyValue: DEPOSIT_DEFAULT_SUM,
2448
- monthsValue: 0,
2449
- isMonthlyInterestPayment: false,
2450
- isRemoteRegistration: false,
2456
+ moneyValue: getMoneyDefaultValue(defaultParams, DEPOSIT_DEFAULT_SUM),
2457
+ monthsValue: getMonthsDefaultValue(defaultParams, 0),
2458
+ isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
2459
+ isRemoteRegistration: Boolean(defaultParams?.isRemoteRegistration),
2451
2460
  });
2452
2461
  const calculatorParams = useDepositCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
2453
2462
  const { defaultMonth, rate, income, finalSum } = calculatorParams;
@@ -2975,11 +2984,11 @@
2975
2984
  const Tags = JSX(({ className, tags }) => tags?.length ? (jsx("div", { className: style('flex flex-wrap gap-xs', className), role: "list", children: tags.map(renderTag) })) : null);
2976
2985
  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)));
2977
2986
 
2978
- 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, }) => {
2987
+ 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 }) => {
2979
2988
  const img = image?.src ? jsx(Img, { image: image }) : null;
2980
2989
  const headline = renderHeadline({ title, description, headlineVersion, align });
2981
2990
  const filteredBenefits = benefits?.filter((_) => _?.type === 'rte' || 'label' in _ || 'description' in _);
2982
- 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)] }) }));
2991
+ 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)] }) }));
2983
2992
  });
2984
2993
  const leftOrRightImage = (img, directionRight) => directionRight ? { rightImage: img } : { leftImage: img };
2985
2994
  const renderTags = (tags) => (tags?.length ? jsx(Tags, { tags: tags }) : null);
@@ -5427,7 +5436,7 @@
5427
5436
 
5428
5437
  const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
5429
5438
 
5430
- const packageVersion = "0.14.52";
5439
+ const packageVersion = "0.14.54";
5431
5440
 
5432
5441
  exports.Blocks = Blocks;
5433
5442
  exports.ContentPage = ContentPage;