@redneckz/wildless-cms-uni-blocks 0.7.7 → 0.7.8
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/bin/migration-scripts/0.7.8.js +29 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +29 -12
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/PictureText/renderBenefit.d.ts +4 -0
- package/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/dist/components/PictureText/PictureText.js +2 -3
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/PictureText/renderBenefit.d.ts +4 -0
- package/dist/components/PictureText/renderBenefit.js +25 -0
- package/dist/components/PictureText/renderBenefit.js.map +1 -0
- package/dist/components/ProductTile/renderBenefit.js +1 -1
- package/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/lib/components/PictureText/PictureText.fixture.d.ts +2 -0
- package/lib/components/PictureText/PictureText.js +1 -2
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/PictureText/renderBenefit.d.ts +4 -0
- package/lib/components/PictureText/renderBenefit.js +22 -0
- package/lib/components/PictureText/renderBenefit.js.map +1 -0
- package/lib/components/ProductTile/renderBenefit.js +1 -1
- package/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/PictureText/renderBenefit.d.ts +4 -0
- package/mobile/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/dist/components/PictureText/PictureText.js +2 -3
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/PictureText/renderBenefit.d.ts +4 -0
- package/mobile/dist/components/PictureText/renderBenefit.js +25 -0
- package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js +1 -1
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/lib/components/PictureText/PictureText.js +1 -2
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/PictureText/renderBenefit.d.ts +4 -0
- package/mobile/lib/components/PictureText/renderBenefit.js +22 -0
- package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js +1 -1
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/src/components/PictureText/PictureText.tsx +1 -14
- package/mobile/src/components/PictureText/PictureText.ui.json +10 -0
- package/mobile/src/components/PictureText/renderBenefit.tsx +33 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +5 -1
- package/mobile/src/ui-kit/BenefitItem/BenefitItemProps.ts +28 -3
- package/package.json +1 -1
- package/src/components/PictureText/PictureText.fixture.tsx +37 -0
- package/src/components/PictureText/PictureText.tsx +1 -14
- package/src/components/PictureText/PictureText.ui.json +10 -0
- package/src/components/PictureText/renderBenefit.tsx +33 -0
- package/src/components/ProductTile/renderBenefit.tsx +5 -1
- package/src/ui-kit/BenefitItem/BenefitItemProps.ts +28 -3
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
+
import type { ComplexBenefitProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
|
|
4
|
+
export declare const renderBenefit: (version: BlockVersion) => (benefit: ComplexBenefitProps, i: number) => JSX.Element | null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { IconProps } from '../../model/Picture';
|
|
2
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import type { IconVersion } from '../../model/IconVersion';
|
|
4
2
|
import type { DescriptionProps, LabelProps } from '../../model/HeadlineType';
|
|
3
|
+
import type { IconVersion } from '../../model/IconVersion';
|
|
4
|
+
import type { IconProps } from '../../model/Picture';
|
|
5
|
+
import { RichTextProps } from '../RichText/RichTextProps';
|
|
5
6
|
export interface BenefitItemCommonProps {
|
|
6
7
|
/** @hidden */
|
|
7
8
|
benefitsVersion?: IconVersion;
|
|
@@ -11,10 +12,32 @@ export interface BenefitItemCommonProps {
|
|
|
11
12
|
className?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare type BenefitItemProps = DescriptionProps & LabelProps & IconProps;
|
|
15
|
+
/**
|
|
16
|
+
* @title Стандартный бенефит
|
|
17
|
+
*/
|
|
18
|
+
declare type DefaultBenefit = BenefitItemProps & {
|
|
19
|
+
/** @default default */
|
|
20
|
+
type: 'default';
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @title Форматированный текст
|
|
24
|
+
*/
|
|
25
|
+
declare type RichText = RichTextProps & {
|
|
26
|
+
/** @default rte */
|
|
27
|
+
type: 'rte';
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @title Преимущество
|
|
31
|
+
* @default{
|
|
32
|
+
* "type": "default"
|
|
33
|
+
* }
|
|
34
|
+
*/
|
|
35
|
+
export declare type ComplexBenefitProps = DefaultBenefit | RichText;
|
|
14
36
|
/**
|
|
15
37
|
* @title Преимущество
|
|
16
38
|
*/
|
|
17
39
|
export declare type BenefitsProps = BenefitItemCommonProps & {
|
|
18
40
|
/** @title Список преимуществ */
|
|
19
|
-
benefits?:
|
|
41
|
+
benefits?: ComplexBenefitProps[];
|
|
20
42
|
};
|
|
43
|
+
export {};
|
|
@@ -2,13 +2,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.PictureText = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const BenefitItem_1 = require("../../ui-kit/BenefitItem/BenefitItem");
|
|
6
5
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
7
6
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
8
7
|
const addSpacesBetweenNumbers_1 = require("../../utils/addSpacesBetweenNumbers");
|
|
9
8
|
const Headline_1 = require("../Headline/Headline");
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const renderBenefit_1 = require("./renderBenefit");
|
|
10
|
+
exports.PictureText = (0, uni_jsx_1.JSX)(({ className = '', title, description, image, benefits, sum, monthLimit, directionRight = false, version = 'primary', ...rest }) => ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: `relative py-12 px-24 ${className}`, version: version, ...rest, children: [(0, jsx_runtime_1.jsx)(Headline_1.Headline, { className: "!p-0", title: title, description: description, headlineVersion: "M" }), (0, jsx_runtime_1.jsxs)("div", { className: 'flex justify-center gap-[122px] mt-[30px]', children: [image?.src ? (0, jsx_runtime_1.jsx)(Img_1.Img, { className: directionRight ? 'order-2' : '', image: image }) : null, (0, jsx_runtime_1.jsxs)("div", { className: "w-[558px] m-auto", children: [benefits?.length ? ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-4", children: benefits.map((0, renderBenefit_1.renderBenefit)(version)) })) : null, renderInsuranceSumMonth(Number(sum), Number(monthLimit))] })] })] })));
|
|
12
11
|
function renderInsuranceSumMonth(sum, monthLimit) {
|
|
13
12
|
return sum || monthLimit ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-main-divider rounded-md flex mt-7 gap-6 px-5 py-4", children: [Number(sum) > 0 ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null, Number(monthLimit) > 0
|
|
14
13
|
? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PictureText.js","sourceRoot":"","sources":["../../../src/components/PictureText/PictureText.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;
|
|
1
|
+
{"version":3,"file":"PictureText.js","sourceRoot":"","sources":["../../../src/components/PictureText/PictureText.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,4DAAyD;AACzD,8CAA2C;AAC3C,iFAA8E;AAC9E,mDAAgD;AAEhD,mDAAgD;AAInC,QAAA,WAAW,GAAG,IAAA,aAAG,EAC5B,CAAC,EACC,SAAS,GAAG,EAAE,EACd,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,GAAG,EACH,UAAU,EACV,cAAc,GAAG,KAAK,EACtB,OAAO,GAAG,SAAS,EACnB,GAAG,IAAI,EACR,EAAE,EAAE,CAAC,CACJ,wBAAC,2BAAY,IAAC,SAAS,EAAE,wBAAwB,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,KAAM,IAAI,aACtF,uBAAC,mBAAQ,IAAC,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAC,GAAG,GAAG,EACzF,iCAAK,SAAS,EAAE,2CAA2C,aACxD,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,uBAAC,SAAG,IAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,EACtF,iCAAK,SAAS,EAAC,kBAAkB,aAC9B,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAClB,gCAAK,SAAS,EAAC,qBAAqB,YAAE,QAAQ,CAAC,GAAG,CAAC,IAAA,6BAAa,EAAC,OAAO,CAAC,CAAC,GAAO,CAClF,CAAC,CAAC,CAAC,IAAI,EACP,uBAAuB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,IACrD,IACF,IACO,CAChB,CACF,CAAC;AAEF,SAAS,uBAAuB,CAAC,GAAY,EAAE,UAAmB;IAChE,OAAO,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CACzB,iCAAK,SAAS,EAAC,sDAAsD,aAClE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EACvF,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;gBACrB,CAAC,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;gBAClE,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa,EAAE,GAAG,GAAG,CAAC,EAAE,cAAc,GAAG,KAAK;IACtE,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEvD,OAAO,CACL,iCAAK,SAAS,EAAE,iEAAiE,UAAU,EAAE,aAC3F,iCAAM,SAAS,EAAC,kCAAkC,YAAE,KAAK,GAAQ,EACjE,kCAAM,SAAS,EAAC,2BAA2B,aAAE,IAAA,iDAAuB,EAAC,GAAG,CAAC,eAAU,IAC/E,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
+
import type { ComplexBenefitProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
|
|
4
|
+
export declare const renderBenefit: (version: BlockVersion) => (benefit: ComplexBenefitProps, i: number) => JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.renderBenefit = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const BenefitItem_1 = require("../../ui-kit/BenefitItem/BenefitItem");
|
|
5
|
+
const RichText_1 = require("../../ui-kit/RichText/RichText");
|
|
6
|
+
const assertUnreachable_1 = require("../../utils/assertUnreachable");
|
|
7
|
+
const renderBenefit =
|
|
8
|
+
// Linter doesn't understand that switch processes all cases
|
|
9
|
+
// eslint-disable-next-line consistent-return
|
|
10
|
+
(version) => (benefit, i) => {
|
|
11
|
+
const { type } = benefit;
|
|
12
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
switch (type) {
|
|
16
|
+
case 'default':
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(BenefitItem_1.BenefitItem, { icon: benefit.icon, label: benefit.label, description: benefit.description, version: version }, String(i)));
|
|
18
|
+
case 'rte':
|
|
19
|
+
return (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: benefit.__html });
|
|
20
|
+
default:
|
|
21
|
+
(0, assertUnreachable_1.assertUnreachable)(benefit);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.renderBenefit = renderBenefit;
|
|
25
|
+
//# sourceMappingURL=renderBenefit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/PictureText/renderBenefit.tsx"],"names":[],"mappings":";;;AACA,sEAAmE;AAEnE,6DAA0D;AAC1D,qEAAkE;AAE3D,MAAM,aAAa;AACxB,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,OAAqB,EAAE,EAAE,CAAC,CAAC,OAA4B,EAAE,CAAS,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IAED,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,CACL,uBAAC,yBAAW,IAEV,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,OAAO,EAAE,OAAO,IAJX,MAAM,CAAC,CAAC,CAAC,CAKd,CACH,CAAC;QACJ,KAAK,KAAK;YACR,OAAO,uBAAC,mBAAQ,IAAC,MAAM,EAAE,OAAO,CAAC,MAAM,GAAI,CAAC;QAC9C;YACE,IAAA,qCAAiB,EAAC,OAAO,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC;AA1BS,QAAA,aAAa,iBA0BtB"}
|
|
@@ -19,7 +19,7 @@ const renderBenefit =
|
|
|
19
19
|
(0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-m", font: "font-light", color: "group-data-primary:text-secondary-text", children: benefit.description }, `desc-${i}`),
|
|
20
20
|
];
|
|
21
21
|
case 'rte':
|
|
22
|
-
return (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: benefit.__html });
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: benefit.__html }) }));
|
|
23
23
|
default:
|
|
24
24
|
(0, assertUnreachable_1.assertUnreachable)(benefit);
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/ProductTile/renderBenefit.tsx"],"names":[],"mappings":";;;AAAA,6DAA0D;AAC1D,iDAA8C;AAC9C,qEAAkE;AAG3D,MAAM,aAAa;AACxB,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,OAAgB,EAAE,CAAS,EAAE,EAAE;IAC9B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,K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,mBAAQ,IAAC,MAAM,EAAE,OAAO,CAAC,MAAM,GAAI,GAChC,CACP,CAAC;QACJ;YACE,IAAA,qCAAiB,EAAC,OAAO,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC;AAlCS,QAAA,aAAa,iBAkCtB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { IconProps } from '../../model/Picture';
|
|
2
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import type { IconVersion } from '../../model/IconVersion';
|
|
4
2
|
import type { DescriptionProps, LabelProps } from '../../model/HeadlineType';
|
|
3
|
+
import type { IconVersion } from '../../model/IconVersion';
|
|
4
|
+
import type { IconProps } from '../../model/Picture';
|
|
5
|
+
import { RichTextProps } from '../RichText/RichTextProps';
|
|
5
6
|
export interface BenefitItemCommonProps {
|
|
6
7
|
/** @hidden */
|
|
7
8
|
benefitsVersion?: IconVersion;
|
|
@@ -11,10 +12,32 @@ export interface BenefitItemCommonProps {
|
|
|
11
12
|
className?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare type BenefitItemProps = DescriptionProps & LabelProps & IconProps;
|
|
15
|
+
/**
|
|
16
|
+
* @title Стандартный бенефит
|
|
17
|
+
*/
|
|
18
|
+
declare type DefaultBenefit = BenefitItemProps & {
|
|
19
|
+
/** @default default */
|
|
20
|
+
type: 'default';
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @title Форматированный текст
|
|
24
|
+
*/
|
|
25
|
+
declare type RichText = RichTextProps & {
|
|
26
|
+
/** @default rte */
|
|
27
|
+
type: 'rte';
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @title Преимущество
|
|
31
|
+
* @default{
|
|
32
|
+
* "type": "default"
|
|
33
|
+
* }
|
|
34
|
+
*/
|
|
35
|
+
export declare type ComplexBenefitProps = DefaultBenefit | RichText;
|
|
14
36
|
/**
|
|
15
37
|
* @title Преимущество
|
|
16
38
|
*/
|
|
17
39
|
export declare type BenefitsProps = BenefitItemCommonProps & {
|
|
18
40
|
/** @title Список преимуществ */
|
|
19
|
-
benefits?:
|
|
41
|
+
benefits?: ComplexBenefitProps[];
|
|
20
42
|
};
|
|
43
|
+
export {};
|
|
@@ -3,10 +3,12 @@ import '../../setup-fixture';
|
|
|
3
3
|
import type { PictureTextContent } from './PictureTextContent';
|
|
4
4
|
export declare const PICTURE_TEXT: PictureTextContent;
|
|
5
5
|
export declare const INSURANCE_TEXT: PictureTextContent;
|
|
6
|
+
export declare const BENEFITS_HTML_TEXT: PictureTextContent;
|
|
6
7
|
declare const _default: {
|
|
7
8
|
default: JSX.Element;
|
|
8
9
|
secondary: JSX.Element;
|
|
9
10
|
'insurance sum': JSX.Element;
|
|
10
11
|
'insurance monthPay': JSX.Element;
|
|
12
|
+
'benefits as html': JSX.Element;
|
|
11
13
|
};
|
|
12
14
|
export default _default;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import { BenefitItem } from '../../ui-kit/BenefitItem/BenefitItem.js';
|
|
4
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
5
4
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
6
5
|
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers.js';
|
|
7
6
|
import { Headline } from '../Headline/Headline.js';
|
|
7
|
+
import { renderBenefit } from './renderBenefit.js';
|
|
8
8
|
export const PictureText = JSX(({ className = '', title, description, image, benefits, sum, monthLimit, directionRight = false, version = 'primary', ...rest }) => (_jsxs(BlockWrapper, { className: `relative py-12 px-24 ${className}`, version: version, ...rest, children: [_jsx(Headline, { className: "!p-0", title: title, description: description, headlineVersion: "M" }), _jsxs("div", { className: 'flex justify-center gap-[122px] mt-[30px]', children: [image?.src ? _jsx(Img, { className: directionRight ? 'order-2' : '', image: image }) : null, _jsxs("div", { className: "w-[558px] m-auto", children: [benefits?.length ? (_jsx("div", { className: "flex flex-col gap-4", children: benefits.map(renderBenefit(version)) })) : null, renderInsuranceSumMonth(Number(sum), Number(monthLimit))] })] })] })));
|
|
9
|
-
const renderBenefit = (version) => (benefit, i) => (_jsx(BenefitItem, { icon: benefit.icon, label: benefit.label, description: benefit.description, version: version }, String(i)));
|
|
10
9
|
function renderInsuranceSumMonth(sum, monthLimit) {
|
|
11
10
|
return sum || monthLimit ? (_jsxs("div", { className: "bg-main-divider rounded-md flex mt-7 gap-6 px-5 py-4", children: [Number(sum) > 0 ? renderValueBlock('Страховая сумма:', sum, Boolean(monthLimit)) : null, Number(monthLimit) > 0
|
|
12
11
|
? renderValueBlock('Ежемесячный лимит:', monthLimit, Boolean(sum))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PictureText.js","sourceRoot":"","sources":["../../../src/components/PictureText/PictureText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"PictureText.js","sourceRoot":"","sources":["../../../src/components/PictureText/PictureText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAC5B,CAAC,EACC,SAAS,GAAG,EAAE,EACd,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,GAAG,EACH,UAAU,EACV,cAAc,GAAG,KAAK,EACtB,OAAO,GAAG,SAAS,E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ACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa,EAAE,GAAG,GAAG,CAAC,EAAE,cAAc,GAAG,KAAK;IACtE,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEvD,OAAO,CACL,eAAK,SAAS,EAAE,iEAAiE,UAAU,EAAE,aAC3F,eAAM,SAAS,EAAC,kCAAkC,YAAE,KAAK,GAAQ,EACjE,gBAAM,SAAS,EAAC,2BAA2B,aAAE,uBAAuB,CAAC,GAAG,CAAC,eAAU,IAC/E,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
+
import type { ComplexBenefitProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
|
|
4
|
+
export declare const renderBenefit: (version: BlockVersion) => (benefit: ComplexBenefitProps, i: number) => JSX.Element | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { BenefitItem } from '../../ui-kit/BenefitItem/BenefitItem.js';
|
|
3
|
+
import { RichText } from '../../ui-kit/RichText/RichText.js';
|
|
4
|
+
import { assertUnreachable } from '../../utils/assertUnreachable.js';
|
|
5
|
+
export const renderBenefit =
|
|
6
|
+
// Linter doesn't understand that switch processes all cases
|
|
7
|
+
// eslint-disable-next-line consistent-return
|
|
8
|
+
(version) => (benefit, i) => {
|
|
9
|
+
const { type } = benefit;
|
|
10
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
switch (type) {
|
|
14
|
+
case 'default':
|
|
15
|
+
return (_jsx(BenefitItem, { icon: benefit.icon, label: benefit.label, description: benefit.description, version: version }, String(i)));
|
|
16
|
+
case 'rte':
|
|
17
|
+
return _jsx(RichText, { __html: benefit.__html });
|
|
18
|
+
default:
|
|
19
|
+
assertUnreachable(benefit);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=renderBenefit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/PictureText/renderBenefit.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,CAAC,MAAM,aAAa;AACxB,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,OAAqB,EAAE,EAAE,CAAC,CAAC,OAA4B,EAAE,CAAS,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IAED,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,CACL,KAAC,WAAW,IAEV,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,OAAO,EAAE,OAAO,IAJX,MAAM,CAAC,CAAC,CAAC,CAKd,CACH,CAAC;QACJ,KAAK,KAAK;YACR,OAAO,KAAC,QAAQ,IAAC,MAAM,EAAE,OAAO,CAAC,MAAM,GAAI,CAAC;QAC9C;YACE,iBAAiB,CAAC,OAAO,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC"}
|
|
@@ -17,7 +17,7 @@ export const renderBenefit =
|
|
|
17
17
|
_jsx(Text, { size: "text-m", font: "font-light", color: "group-data-primary:text-secondary-text", children: benefit.description }, `desc-${i}`),
|
|
18
18
|
];
|
|
19
19
|
case 'rte':
|
|
20
|
-
return _jsx(RichText, { __html: benefit.__html });
|
|
20
|
+
return (_jsx("div", { className: "col-span-2", children: _jsx(RichText, { __html: benefit.__html }) }));
|
|
21
21
|
default:
|
|
22
22
|
assertUnreachable(benefit);
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/ProductTile/renderBenefit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,MAAM,CAAC,MAAM,aAAa;AACxB,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,OAAgB,EAAE,CAAS,EAAE,EAAE;IAC9B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IAED,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO;gBACL,KAAC,IAAI,IAAoB,IAAI,EAAC,SAAS,YACpC,OAAO,CAAC,KAAK,IADL,SAAS,CAAC,EAAE,CAEhB;gBACP,KAAC,IAAI,IAEH,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,YAAY,EACjB,KAAK,EAAC,wCAAwC,YAE7C,OAAO,CAAC,WAAW,IALf,QAAQ,CAAC,EAAE,CAMX;aACR,CAAC;QACJ,KAAK,KAAK;YACR,OAAO,KAAC,QAAQ,IAAC,MAAM,EAAE,OAAO,CAAC,MAAM,GAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/ProductTile/renderBenefit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,MAAM,CAAC,MAAM,aAAa;AACxB,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,OAAgB,EAAE,CAAS,EAAE,EAAE;IAC9B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IAED,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO;gBACL,KAAC,IAAI,IAAoB,IAAI,EAAC,SAAS,YACpC,OAAO,CAAC,KAAK,IADL,SAAS,CAAC,EAAE,CAEhB;gBACP,KAAC,IAAI,IAEH,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,YAAY,EACjB,KAAK,EAAC,wCAAwC,YAE7C,OAAO,CAAC,WAAW,IALf,QAAQ,CAAC,EAAE,CAMX;aACR,CAAC;QACJ,KAAK,KAAK;YACR,OAAO,CACL,cAAK,SAAS,EAAC,YAAY,YACzB,KAAC,QAAQ,IAAC,MAAM,EAAE,OAAO,CAAC,MAAM,GAAI,GAChC,CACP,CAAC;QACJ;YACE,iBAAiB,CAAC,OAAO,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { IconProps } from '../../model/Picture';
|
|
2
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import type { IconVersion } from '../../model/IconVersion';
|
|
4
2
|
import type { DescriptionProps, LabelProps } from '../../model/HeadlineType';
|
|
3
|
+
import type { IconVersion } from '../../model/IconVersion';
|
|
4
|
+
import type { IconProps } from '../../model/Picture';
|
|
5
|
+
import { RichTextProps } from '../RichText/RichTextProps';
|
|
5
6
|
export interface BenefitItemCommonProps {
|
|
6
7
|
/** @hidden */
|
|
7
8
|
benefitsVersion?: IconVersion;
|
|
@@ -11,10 +12,32 @@ export interface BenefitItemCommonProps {
|
|
|
11
12
|
className?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare type BenefitItemProps = DescriptionProps & LabelProps & IconProps;
|
|
15
|
+
/**
|
|
16
|
+
* @title Стандартный бенефит
|
|
17
|
+
*/
|
|
18
|
+
declare type DefaultBenefit = BenefitItemProps & {
|
|
19
|
+
/** @default default */
|
|
20
|
+
type: 'default';
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @title Форматированный текст
|
|
24
|
+
*/
|
|
25
|
+
declare type RichText = RichTextProps & {
|
|
26
|
+
/** @default rte */
|
|
27
|
+
type: 'rte';
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @title Преимущество
|
|
31
|
+
* @default{
|
|
32
|
+
* "type": "default"
|
|
33
|
+
* }
|
|
34
|
+
*/
|
|
35
|
+
export declare type ComplexBenefitProps = DefaultBenefit | RichText;
|
|
14
36
|
/**
|
|
15
37
|
* @title Преимущество
|
|
16
38
|
*/
|
|
17
39
|
export declare type BenefitsProps = BenefitItemCommonProps & {
|
|
18
40
|
/** @title Список преимуществ */
|
|
19
|
-
benefits?:
|
|
41
|
+
benefits?: ComplexBenefitProps[];
|
|
20
42
|
};
|
|
43
|
+
export {};
|
|
@@ -1764,7 +1764,7 @@
|
|
|
1764
1764
|
return (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: i }, el) : [el]), []);
|
|
1765
1765
|
}
|
|
1766
1766
|
|
|
1767
|
-
const packageVersion = "0.7.
|
|
1767
|
+
const packageVersion = "0.7.8";
|
|
1768
1768
|
|
|
1769
1769
|
exports.Blocks = Blocks;
|
|
1770
1770
|
exports.ContentPage = ContentPage;
|