@doyourjob/gravity-ui-page-constructor 5.31.142-dev.4 → 5.31.142-dev.6
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/build/cjs/blocks/BannerMinify/BannerMinify.css +3 -0
- package/build/cjs/blocks/BannerMinify/BannerMinify.js +1 -3
- package/build/cjs/blocks/BannerMinify/Button/Button.css +2 -1
- package/build/cjs/blocks/BannerMinify/schema.d.ts +0 -138
- package/build/cjs/blocks/BannerMinify/schema.js +3 -1
- package/build/cjs/blocks/Benefits/Benefits.js +3 -10
- package/build/cjs/blocks/Benefits/BenefitsLabel/BenefitsLabel.css +1 -0
- package/build/cjs/blocks/Benefits/BenefitsLabel/BenefitsLabel.d.ts +2 -0
- package/build/cjs/blocks/Benefits/BenefitsLabel/BenefitsLabel.js +4 -3
- package/build/cjs/blocks/Benefits/schema.d.ts +0 -3
- package/build/cjs/blocks/Benefits/schema.js +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -2
- package/build/cjs/text-transform/config.js +0 -7
- package/build/esm/blocks/BannerMinify/BannerMinify.css +3 -0
- package/build/esm/blocks/BannerMinify/BannerMinify.js +1 -3
- package/build/esm/blocks/BannerMinify/Button/Button.css +2 -1
- package/build/esm/blocks/BannerMinify/schema.d.ts +0 -138
- package/build/esm/blocks/BannerMinify/schema.js +4 -2
- package/build/esm/blocks/Benefits/Benefits.js +4 -11
- package/build/esm/blocks/Benefits/BenefitsLabel/BenefitsLabel.css +1 -0
- package/build/esm/blocks/Benefits/BenefitsLabel/BenefitsLabel.d.ts +2 -0
- package/build/esm/blocks/Benefits/BenefitsLabel/BenefitsLabel.js +4 -3
- package/build/esm/blocks/Benefits/schema.d.ts +0 -3
- package/build/esm/blocks/Benefits/schema.js +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +1 -2
- package/build/esm/text-transform/config.js +0 -7
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +1 -2
- package/server/text-transform/config.js +0 -7
- package/widget/290.index.js +1 -1
- package/widget/index.js +1 -1
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BannerMinifyBlock = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const TitleItem_1 = tslib_1.__importDefault(require("../../components/Title/TitleItem"));
|
|
7
6
|
const grid_1 = require("../../grid");
|
|
8
7
|
const utils_1 = require("../../utils");
|
|
9
8
|
const Button_1 = tslib_1.__importDefault(require("./Button/Button"));
|
|
@@ -12,10 +11,9 @@ const leftColSizes = { lg: 5, all: 12 };
|
|
|
12
11
|
const rightColSizes = { lg: 7, all: 12 };
|
|
13
12
|
const BannerMinifyBlock = (props) => {
|
|
14
13
|
const { title, text, buttons, theme } = props;
|
|
15
|
-
const titleProps = !title || typeof title === 'string' ? { text: title } : title;
|
|
16
14
|
return (react_1.default.createElement(grid_1.Row, { className: b({ theme }) },
|
|
17
15
|
react_1.default.createElement(grid_1.Col, { sizes: leftColSizes },
|
|
18
|
-
title && react_1.default.createElement(
|
|
16
|
+
title && react_1.default.createElement("div", { className: b('title') }, title),
|
|
19
17
|
text && react_1.default.createElement("div", { className: b('text') }, text)),
|
|
20
18
|
react_1.default.createElement(grid_1.Col, { sizes: rightColSizes },
|
|
21
19
|
react_1.default.createElement("div", { className: b('buttons') }, buttons === null || buttons === void 0 ? void 0 : buttons.map((button, index) => (react_1.default.createElement(Button_1.default, Object.assign({ key: index }, button))))))));
|
|
@@ -8,144 +8,6 @@ export declare const BannerMinifyBlock: {
|
|
|
8
8
|
};
|
|
9
9
|
title: {
|
|
10
10
|
type: string;
|
|
11
|
-
additionalProperties: boolean;
|
|
12
|
-
required: string[];
|
|
13
|
-
properties: {
|
|
14
|
-
text: {
|
|
15
|
-
type: string;
|
|
16
|
-
contentType: string;
|
|
17
|
-
};
|
|
18
|
-
link: {
|
|
19
|
-
type: string;
|
|
20
|
-
additionalProperties: boolean;
|
|
21
|
-
required: string[];
|
|
22
|
-
properties: {
|
|
23
|
-
text: {
|
|
24
|
-
type: string;
|
|
25
|
-
contentType: string;
|
|
26
|
-
};
|
|
27
|
-
url: {
|
|
28
|
-
type: string;
|
|
29
|
-
};
|
|
30
|
-
urlTitle: {
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
arrow: {
|
|
34
|
-
type: string;
|
|
35
|
-
};
|
|
36
|
-
theme: {
|
|
37
|
-
type: string;
|
|
38
|
-
enum: string[];
|
|
39
|
-
};
|
|
40
|
-
textSize: {
|
|
41
|
-
type: string;
|
|
42
|
-
enum: string[];
|
|
43
|
-
};
|
|
44
|
-
target: {
|
|
45
|
-
type: string;
|
|
46
|
-
enum: string[];
|
|
47
|
-
};
|
|
48
|
-
analyticsEvents: {
|
|
49
|
-
oneOf: ({
|
|
50
|
-
optionName: string;
|
|
51
|
-
type: string;
|
|
52
|
-
additionalProperties: {
|
|
53
|
-
type: string;
|
|
54
|
-
};
|
|
55
|
-
required: string[];
|
|
56
|
-
properties: {
|
|
57
|
-
name: {
|
|
58
|
-
type: string;
|
|
59
|
-
};
|
|
60
|
-
type: {
|
|
61
|
-
type: string;
|
|
62
|
-
};
|
|
63
|
-
counters: {
|
|
64
|
-
type: string;
|
|
65
|
-
additionalProperties: boolean;
|
|
66
|
-
required: never[];
|
|
67
|
-
properties: {
|
|
68
|
-
include: {
|
|
69
|
-
type: string;
|
|
70
|
-
items: {
|
|
71
|
-
type: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
exclude: {
|
|
75
|
-
type: string;
|
|
76
|
-
items: {
|
|
77
|
-
type: string;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
context: {
|
|
83
|
-
type: string;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
items?: undefined;
|
|
87
|
-
} | {
|
|
88
|
-
type: string;
|
|
89
|
-
items: {
|
|
90
|
-
type: string;
|
|
91
|
-
additionalProperties: {
|
|
92
|
-
type: string;
|
|
93
|
-
};
|
|
94
|
-
required: string[];
|
|
95
|
-
properties: {
|
|
96
|
-
name: {
|
|
97
|
-
type: string;
|
|
98
|
-
};
|
|
99
|
-
type: {
|
|
100
|
-
type: string;
|
|
101
|
-
};
|
|
102
|
-
counters: {
|
|
103
|
-
type: string;
|
|
104
|
-
additionalProperties: boolean;
|
|
105
|
-
required: never[];
|
|
106
|
-
properties: {
|
|
107
|
-
include: {
|
|
108
|
-
type: string;
|
|
109
|
-
items: {
|
|
110
|
-
type: string;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
exclude: {
|
|
114
|
-
type: string;
|
|
115
|
-
items: {
|
|
116
|
-
type: string;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
context: {
|
|
122
|
-
type: string;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
optionName: string;
|
|
127
|
-
})[];
|
|
128
|
-
};
|
|
129
|
-
type: {};
|
|
130
|
-
when: {
|
|
131
|
-
type: string;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
textSize: {
|
|
136
|
-
type: string;
|
|
137
|
-
enum: string[];
|
|
138
|
-
};
|
|
139
|
-
url: {
|
|
140
|
-
type: string;
|
|
141
|
-
};
|
|
142
|
-
urlTitle: {
|
|
143
|
-
type: string;
|
|
144
|
-
};
|
|
145
|
-
resetMargin: {
|
|
146
|
-
type: string;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
11
|
};
|
|
150
12
|
text: {
|
|
151
13
|
type: string;
|
|
@@ -8,7 +8,9 @@ exports.BannerMinifyBlock = {
|
|
|
8
8
|
properties: Object.assign(Object.assign({}, common_1.BlockBaseProps), { theme: {
|
|
9
9
|
type: 'string',
|
|
10
10
|
enum: ['light', 'dark'],
|
|
11
|
-
}, title:
|
|
11
|
+
}, title: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
}, text: {
|
|
12
14
|
type: 'string',
|
|
13
15
|
}, buttons: {
|
|
14
16
|
type: 'array',
|
|
@@ -9,17 +9,10 @@ const BenefitsCard_1 = tslib_1.__importDefault(require("./BenefitsCard/BenefitsC
|
|
|
9
9
|
const BenefitsLabel_1 = tslib_1.__importDefault(require("./BenefitsLabel/BenefitsLabel"));
|
|
10
10
|
const b = (0, utils_1.block)('benefits-block');
|
|
11
11
|
const BenefitsBlock = (props) => {
|
|
12
|
-
const { titleOne, postTitleOne, textOne, titleTwo, postTitleTwo, textTwo, background, cards, items, theme, accentColor,
|
|
12
|
+
const { titleOne, postTitleOne, textOne, titleTwo, postTitleTwo, textTwo, background, cards, items, theme, accentColor, } = props;
|
|
13
13
|
const [activeIndex, setActiveIndex] = (0, react_1.useState)(0);
|
|
14
14
|
const data = items === null || items === void 0 ? void 0 : items[activeIndex];
|
|
15
|
-
(0, react_1.
|
|
16
|
-
const interval = setInterval(() => {
|
|
17
|
-
if (items === null || items === void 0 ? void 0 : items.length) {
|
|
18
|
-
setActiveIndex((prev) => (prev + 1) % items.length);
|
|
19
|
-
}
|
|
20
|
-
}, time || 2000);
|
|
21
|
-
return () => clearInterval(interval);
|
|
22
|
-
}, [items === null || items === void 0 ? void 0 : items.length, time]);
|
|
15
|
+
const handleClick = (0, react_1.useCallback)((index) => setActiveIndex(index), []);
|
|
23
16
|
const styles = (0, react_1.useMemo)(() => accentColor
|
|
24
17
|
? {
|
|
25
18
|
['--local-accent-color']: accentColor,
|
|
@@ -38,7 +31,7 @@ const BenefitsBlock = (props) => {
|
|
|
38
31
|
titleTwo,
|
|
39
32
|
react_1.default.createElement("span", null, postTitleTwo))),
|
|
40
33
|
textTwo && react_1.default.createElement(components_1.HTML, { className: b('text') }, textTwo))),
|
|
41
|
-
Boolean(items === null || items === void 0 ? void 0 : items.length) && (react_1.default.createElement("div", { className: b('labels') }, items === null || items === void 0 ? void 0 : items.map((item, index) => (react_1.default.createElement(BenefitsLabel_1.default, Object.assign({ key: index }, item, { active: index === activeIndex })))))),
|
|
34
|
+
Boolean(items === null || items === void 0 ? void 0 : items.length) && (react_1.default.createElement("div", { className: b('labels') }, items === null || items === void 0 ? void 0 : items.map((item, index) => (react_1.default.createElement(BenefitsLabel_1.default, Object.assign({ key: index }, item, { active: index === activeIndex, index: index, onClick: handleClick })))))),
|
|
42
35
|
data && (react_1.default.createElement("div", { className: b('images') }, data.images.map((image, index) => (react_1.default.createElement("div", { key: index, style: {
|
|
43
36
|
gridColumn: `span ${data.columns[index]}`,
|
|
44
37
|
gridRow: `span ${data.rows[index]}`,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BenefitsBlockItemLabel } from '../../../models';
|
|
2
2
|
type BenefitsLabelProps = BenefitsBlockItemLabel & {
|
|
3
|
+
index: number;
|
|
3
4
|
active?: boolean;
|
|
5
|
+
onClick?: (index: number) => void;
|
|
4
6
|
};
|
|
5
7
|
export declare const BenefitsLabel: (props: BenefitsLabelProps) => JSX.Element;
|
|
6
8
|
export default BenefitsLabel;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BenefitsLabel = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const utils_1 = require("../../../utils");
|
|
7
7
|
const b = (0, utils_1.block)('benefits-label');
|
|
8
8
|
const BenefitsLabel = (props) => {
|
|
9
|
-
const { title, text, active } = props;
|
|
10
|
-
|
|
9
|
+
const { index, title, text, active, onClick } = props;
|
|
10
|
+
const handleClick = (0, react_1.useCallback)(() => onClick === null || onClick === void 0 ? void 0 : onClick(index), [onClick, index]);
|
|
11
|
+
return (react_1.default.createElement("button", { className: b({ active }), onClick: handleClick },
|
|
11
12
|
react_1.default.createElement("div", { className: b('title') }, title),
|
|
12
13
|
react_1.default.createElement("div", { className: b('text') }, text)));
|
|
13
14
|
};
|
|
@@ -320,7 +320,6 @@ export interface BenefitsBlockProps extends Themable {
|
|
|
320
320
|
cards?: BenefitsBlockCard[];
|
|
321
321
|
items?: BenefitsBlockItem[];
|
|
322
322
|
accentColor?: string;
|
|
323
|
-
time?: number;
|
|
324
323
|
}
|
|
325
324
|
export interface ScrollerBlockProps extends Childable {
|
|
326
325
|
title?: string;
|
|
@@ -645,7 +644,7 @@ export interface BannerMinifyButtonProps {
|
|
|
645
644
|
theme: 'outline' | 'normal';
|
|
646
645
|
}
|
|
647
646
|
export interface BannerMinifyBlockProps {
|
|
648
|
-
title?:
|
|
647
|
+
title?: string;
|
|
649
648
|
text?: string;
|
|
650
649
|
buttons?: BannerMinifyButtonProps[];
|
|
651
650
|
theme?: ContentTheme;
|
|
@@ -414,13 +414,6 @@ exports.config = {
|
|
|
414
414
|
},
|
|
415
415
|
],
|
|
416
416
|
[models_1.BlockType.CardLayoutBlock]: exports.blockHeaderTransformer,
|
|
417
|
-
[models_1.BlockType.BenchmarkBlock]: [
|
|
418
|
-
{
|
|
419
|
-
fields: ['title'],
|
|
420
|
-
transformer: common_1.typografTransformer,
|
|
421
|
-
parser: parseTitle,
|
|
422
|
-
},
|
|
423
|
-
],
|
|
424
417
|
[models_1.BlockType.FilterBlock]: exports.blockHeaderTransformer,
|
|
425
418
|
[models_1.BlockType.FilterCardLayoutBlock]: [
|
|
426
419
|
...exports.blockHeaderTransformer,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import TitleItem from '../../components/Title/TitleItem';
|
|
3
2
|
import { Col, Row } from '../../grid';
|
|
4
3
|
import { block } from '../../utils';
|
|
5
4
|
import Button from './Button/Button';
|
|
@@ -9,10 +8,9 @@ const leftColSizes = { lg: 5, all: 12 };
|
|
|
9
8
|
const rightColSizes = { lg: 7, all: 12 };
|
|
10
9
|
export const BannerMinifyBlock = (props) => {
|
|
11
10
|
const { title, text, buttons, theme } = props;
|
|
12
|
-
const titleProps = !title || typeof title === 'string' ? { text: title } : title;
|
|
13
11
|
return (React.createElement(Row, { className: b({ theme }) },
|
|
14
12
|
React.createElement(Col, { sizes: leftColSizes },
|
|
15
|
-
title && React.createElement(
|
|
13
|
+
title && React.createElement("div", { className: b('title') }, title),
|
|
16
14
|
text && React.createElement("div", { className: b('text') }, text)),
|
|
17
15
|
React.createElement(Col, { sizes: rightColSizes },
|
|
18
16
|
React.createElement("div", { className: b('buttons') }, buttons === null || buttons === void 0 ? void 0 : buttons.map((button, index) => (React.createElement(Button, Object.assign({ key: index }, button))))))));
|
|
@@ -8,144 +8,6 @@ export declare const BannerMinifyBlock: {
|
|
|
8
8
|
};
|
|
9
9
|
title: {
|
|
10
10
|
type: string;
|
|
11
|
-
additionalProperties: boolean;
|
|
12
|
-
required: string[];
|
|
13
|
-
properties: {
|
|
14
|
-
text: {
|
|
15
|
-
type: string;
|
|
16
|
-
contentType: string;
|
|
17
|
-
};
|
|
18
|
-
link: {
|
|
19
|
-
type: string;
|
|
20
|
-
additionalProperties: boolean;
|
|
21
|
-
required: string[];
|
|
22
|
-
properties: {
|
|
23
|
-
text: {
|
|
24
|
-
type: string;
|
|
25
|
-
contentType: string;
|
|
26
|
-
};
|
|
27
|
-
url: {
|
|
28
|
-
type: string;
|
|
29
|
-
};
|
|
30
|
-
urlTitle: {
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
arrow: {
|
|
34
|
-
type: string;
|
|
35
|
-
};
|
|
36
|
-
theme: {
|
|
37
|
-
type: string;
|
|
38
|
-
enum: string[];
|
|
39
|
-
};
|
|
40
|
-
textSize: {
|
|
41
|
-
type: string;
|
|
42
|
-
enum: string[];
|
|
43
|
-
};
|
|
44
|
-
target: {
|
|
45
|
-
type: string;
|
|
46
|
-
enum: string[];
|
|
47
|
-
};
|
|
48
|
-
analyticsEvents: {
|
|
49
|
-
oneOf: ({
|
|
50
|
-
optionName: string;
|
|
51
|
-
type: string;
|
|
52
|
-
additionalProperties: {
|
|
53
|
-
type: string;
|
|
54
|
-
};
|
|
55
|
-
required: string[];
|
|
56
|
-
properties: {
|
|
57
|
-
name: {
|
|
58
|
-
type: string;
|
|
59
|
-
};
|
|
60
|
-
type: {
|
|
61
|
-
type: string;
|
|
62
|
-
};
|
|
63
|
-
counters: {
|
|
64
|
-
type: string;
|
|
65
|
-
additionalProperties: boolean;
|
|
66
|
-
required: never[];
|
|
67
|
-
properties: {
|
|
68
|
-
include: {
|
|
69
|
-
type: string;
|
|
70
|
-
items: {
|
|
71
|
-
type: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
exclude: {
|
|
75
|
-
type: string;
|
|
76
|
-
items: {
|
|
77
|
-
type: string;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
context: {
|
|
83
|
-
type: string;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
items?: undefined;
|
|
87
|
-
} | {
|
|
88
|
-
type: string;
|
|
89
|
-
items: {
|
|
90
|
-
type: string;
|
|
91
|
-
additionalProperties: {
|
|
92
|
-
type: string;
|
|
93
|
-
};
|
|
94
|
-
required: string[];
|
|
95
|
-
properties: {
|
|
96
|
-
name: {
|
|
97
|
-
type: string;
|
|
98
|
-
};
|
|
99
|
-
type: {
|
|
100
|
-
type: string;
|
|
101
|
-
};
|
|
102
|
-
counters: {
|
|
103
|
-
type: string;
|
|
104
|
-
additionalProperties: boolean;
|
|
105
|
-
required: never[];
|
|
106
|
-
properties: {
|
|
107
|
-
include: {
|
|
108
|
-
type: string;
|
|
109
|
-
items: {
|
|
110
|
-
type: string;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
exclude: {
|
|
114
|
-
type: string;
|
|
115
|
-
items: {
|
|
116
|
-
type: string;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
context: {
|
|
122
|
-
type: string;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
optionName: string;
|
|
127
|
-
})[];
|
|
128
|
-
};
|
|
129
|
-
type: {};
|
|
130
|
-
when: {
|
|
131
|
-
type: string;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
textSize: {
|
|
136
|
-
type: string;
|
|
137
|
-
enum: string[];
|
|
138
|
-
};
|
|
139
|
-
url: {
|
|
140
|
-
type: string;
|
|
141
|
-
};
|
|
142
|
-
urlTitle: {
|
|
143
|
-
type: string;
|
|
144
|
-
};
|
|
145
|
-
resetMargin: {
|
|
146
|
-
type: string;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
11
|
};
|
|
150
12
|
text: {
|
|
151
13
|
type: string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { BlockBaseProps
|
|
1
|
+
import { BlockBaseProps } from '../../schema/validators/common';
|
|
2
2
|
export const BannerMinifyBlock = {
|
|
3
3
|
'banner-minify-block': {
|
|
4
4
|
additionalProperties: false,
|
|
5
5
|
properties: Object.assign(Object.assign({}, BlockBaseProps), { theme: {
|
|
6
6
|
type: 'string',
|
|
7
7
|
enum: ['light', 'dark'],
|
|
8
|
-
}, title:
|
|
8
|
+
}, title: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
}, text: {
|
|
9
11
|
type: 'string',
|
|
10
12
|
}, buttons: {
|
|
11
13
|
type: 'array',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { HTML, ImageBase } from '../../components';
|
|
3
3
|
import { block } from '../../utils';
|
|
4
4
|
import BenefitsCard from './BenefitsCard/BenefitsCard';
|
|
@@ -6,17 +6,10 @@ import BenefitsLabel from './BenefitsLabel/BenefitsLabel';
|
|
|
6
6
|
import './Benefits.css';
|
|
7
7
|
const b = block('benefits-block');
|
|
8
8
|
export const BenefitsBlock = (props) => {
|
|
9
|
-
const { titleOne, postTitleOne, textOne, titleTwo, postTitleTwo, textTwo, background, cards, items, theme, accentColor,
|
|
9
|
+
const { titleOne, postTitleOne, textOne, titleTwo, postTitleTwo, textTwo, background, cards, items, theme, accentColor, } = props;
|
|
10
10
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
11
11
|
const data = items === null || items === void 0 ? void 0 : items[activeIndex];
|
|
12
|
-
|
|
13
|
-
const interval = setInterval(() => {
|
|
14
|
-
if (items === null || items === void 0 ? void 0 : items.length) {
|
|
15
|
-
setActiveIndex((prev) => (prev + 1) % items.length);
|
|
16
|
-
}
|
|
17
|
-
}, time || 2000);
|
|
18
|
-
return () => clearInterval(interval);
|
|
19
|
-
}, [items === null || items === void 0 ? void 0 : items.length, time]);
|
|
12
|
+
const handleClick = useCallback((index) => setActiveIndex(index), []);
|
|
20
13
|
const styles = useMemo(() => accentColor
|
|
21
14
|
? {
|
|
22
15
|
['--local-accent-color']: accentColor,
|
|
@@ -35,7 +28,7 @@ export const BenefitsBlock = (props) => {
|
|
|
35
28
|
titleTwo,
|
|
36
29
|
React.createElement("span", null, postTitleTwo))),
|
|
37
30
|
textTwo && React.createElement(HTML, { className: b('text') }, textTwo))),
|
|
38
|
-
Boolean(items === null || items === void 0 ? void 0 : items.length) && (React.createElement("div", { className: b('labels') }, items === null || items === void 0 ? void 0 : items.map((item, index) => (React.createElement(BenefitsLabel, Object.assign({ key: index }, item, { active: index === activeIndex })))))),
|
|
31
|
+
Boolean(items === null || items === void 0 ? void 0 : items.length) && (React.createElement("div", { className: b('labels') }, items === null || items === void 0 ? void 0 : items.map((item, index) => (React.createElement(BenefitsLabel, Object.assign({ key: index }, item, { active: index === activeIndex, index: index, onClick: handleClick })))))),
|
|
39
32
|
data && (React.createElement("div", { className: b('images') }, data.images.map((image, index) => (React.createElement("div", { key: index, style: {
|
|
40
33
|
gridColumn: `span ${data.columns[index]}`,
|
|
41
34
|
gridRow: `span ${data.rows[index]}`,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BenefitsBlockItemLabel } from '../../../models';
|
|
2
2
|
import './BenefitsLabel.css';
|
|
3
3
|
type BenefitsLabelProps = BenefitsBlockItemLabel & {
|
|
4
|
+
index: number;
|
|
4
5
|
active?: boolean;
|
|
6
|
+
onClick?: (index: number) => void;
|
|
5
7
|
};
|
|
6
8
|
export declare const BenefitsLabel: (props: BenefitsLabelProps) => JSX.Element;
|
|
7
9
|
export default BenefitsLabel;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
2
|
import { block } from '../../../utils';
|
|
3
3
|
import './BenefitsLabel.css';
|
|
4
4
|
const b = block('benefits-label');
|
|
5
5
|
export const BenefitsLabel = (props) => {
|
|
6
|
-
const { title, text, active } = props;
|
|
7
|
-
|
|
6
|
+
const { index, title, text, active, onClick } = props;
|
|
7
|
+
const handleClick = useCallback(() => onClick === null || onClick === void 0 ? void 0 : onClick(index), [onClick, index]);
|
|
8
|
+
return (React.createElement("button", { className: b({ active }), onClick: handleClick },
|
|
8
9
|
React.createElement("div", { className: b('title') }, title),
|
|
9
10
|
React.createElement("div", { className: b('text') }, text)));
|
|
10
11
|
};
|
|
@@ -320,7 +320,6 @@ export interface BenefitsBlockProps extends Themable {
|
|
|
320
320
|
cards?: BenefitsBlockCard[];
|
|
321
321
|
items?: BenefitsBlockItem[];
|
|
322
322
|
accentColor?: string;
|
|
323
|
-
time?: number;
|
|
324
323
|
}
|
|
325
324
|
export interface ScrollerBlockProps extends Childable {
|
|
326
325
|
title?: string;
|
|
@@ -645,7 +644,7 @@ export interface BannerMinifyButtonProps {
|
|
|
645
644
|
theme: 'outline' | 'normal';
|
|
646
645
|
}
|
|
647
646
|
export interface BannerMinifyBlockProps {
|
|
648
|
-
title?:
|
|
647
|
+
title?: string;
|
|
649
648
|
text?: string;
|
|
650
649
|
buttons?: BannerMinifyButtonProps[];
|
|
651
650
|
theme?: ContentTheme;
|
|
@@ -411,13 +411,6 @@ export const config = {
|
|
|
411
411
|
},
|
|
412
412
|
],
|
|
413
413
|
[BlockType.CardLayoutBlock]: blockHeaderTransformer,
|
|
414
|
-
[BlockType.BenchmarkBlock]: [
|
|
415
|
-
{
|
|
416
|
-
fields: ['title'],
|
|
417
|
-
transformer: typografTransformer,
|
|
418
|
-
parser: parseTitle,
|
|
419
|
-
},
|
|
420
|
-
],
|
|
421
414
|
[BlockType.FilterBlock]: blockHeaderTransformer,
|
|
422
415
|
[BlockType.FilterCardLayoutBlock]: [
|
|
423
416
|
...blockHeaderTransformer,
|