@gravity-ui/page-constructor 3.18.0-alpha.1 → 3.19.0
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/HeaderSlider/HeaderSlider.css +0 -3
- package/build/cjs/blocks/Slider/Slider.css +1 -3
- package/build/cjs/components/CardBase/CardBase.css +4 -4
- package/build/cjs/constructor-items.d.ts +2 -2
- package/build/cjs/models/constructor-items/common.d.ts +1 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -4
- package/build/cjs/schema/constants.d.ts +162 -78
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +81 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +10 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +3 -3
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +81 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +10 -0
- package/build/cjs/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
- package/build/cjs/sub-blocks/MediaCard/MediaCard.js +2 -2
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +81 -78
- package/build/cjs/sub-blocks/MediaCard/schema.js +11 -1
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +2 -2
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +2 -2
- package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +7 -4
- package/build/cjs/sub-blocks/PriceDetailed/schema.js +11 -1
- package/build/cjs/sub-blocks/Quote/Quote.css +0 -3
- package/build/esm/blocks/HeaderSlider/HeaderSlider.css +0 -3
- package/build/esm/blocks/Slider/Slider.css +1 -3
- package/build/esm/components/CardBase/CardBase.css +4 -4
- package/build/esm/constructor-items.d.ts +2 -2
- package/build/esm/models/constructor-items/common.d.ts +1 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -4
- package/build/esm/schema/constants.d.ts +162 -78
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +81 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.js +10 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +3 -3
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +81 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +10 -0
- package/build/esm/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
- package/build/esm/sub-blocks/MediaCard/MediaCard.js +2 -2
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +81 -78
- package/build/esm/sub-blocks/MediaCard/schema.js +11 -1
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +2 -2
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +2 -2
- package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +8 -4
- package/build/esm/sub-blocks/PriceDetailed/schema.js +11 -1
- package/build/esm/sub-blocks/Quote/Quote.css +0 -3
- package/package.json +1 -1
- package/server/models/constructor-items/common.d.ts +1 -1
- package/server/models/constructor-items/sub-blocks.d.ts +4 -4
- package/styles/mixins.scss +3 -1
- package/widget/index.js +1 -1
|
@@ -41,6 +41,87 @@ export declare const BackgroundCard: {
|
|
|
41
41
|
type: string;
|
|
42
42
|
enum: string[];
|
|
43
43
|
};
|
|
44
|
+
analyticsEvents: {
|
|
45
|
+
oneOf: ({
|
|
46
|
+
optionName: string;
|
|
47
|
+
type: string;
|
|
48
|
+
additionalProperties: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
required: string[];
|
|
52
|
+
properties: {
|
|
53
|
+
name: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
type: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
counters: {
|
|
60
|
+
type: string;
|
|
61
|
+
additionalProperties: boolean;
|
|
62
|
+
required: never[];
|
|
63
|
+
properties: {
|
|
64
|
+
include: {
|
|
65
|
+
type: string;
|
|
66
|
+
items: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
exclude: {
|
|
71
|
+
type: string;
|
|
72
|
+
items: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
context: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
items?: undefined;
|
|
83
|
+
} | {
|
|
84
|
+
type: string;
|
|
85
|
+
items: {
|
|
86
|
+
type: string;
|
|
87
|
+
additionalProperties: {
|
|
88
|
+
type: string;
|
|
89
|
+
};
|
|
90
|
+
required: string[];
|
|
91
|
+
properties: {
|
|
92
|
+
name: {
|
|
93
|
+
type: string;
|
|
94
|
+
};
|
|
95
|
+
type: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
counters: {
|
|
99
|
+
type: string;
|
|
100
|
+
additionalProperties: boolean;
|
|
101
|
+
required: never[];
|
|
102
|
+
properties: {
|
|
103
|
+
include: {
|
|
104
|
+
type: string;
|
|
105
|
+
items: {
|
|
106
|
+
type: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
exclude: {
|
|
110
|
+
type: string;
|
|
111
|
+
items: {
|
|
112
|
+
type: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
context: {
|
|
118
|
+
type: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
optionName: string;
|
|
123
|
+
})[];
|
|
124
|
+
};
|
|
44
125
|
title: {
|
|
45
126
|
oneOf: ({
|
|
46
127
|
type: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { ImageObjectProps } from '../../components/Image/schema';
|
|
3
3
|
import { BaseProps, CardBase, withTheme } from '../../schema/validators/common';
|
|
4
|
+
import { AnalyticsEventSchema } from '../../schema/validators/event';
|
|
4
5
|
import { ContentBase } from '../Content/schema';
|
|
5
6
|
const BackgroundCardContentProps = _.omit(ContentBase, ['size']);
|
|
6
7
|
export const BackgroundCard = {
|
|
@@ -14,6 +15,15 @@ export const BackgroundCard = {
|
|
|
14
15
|
}, paddingBottom: {
|
|
15
16
|
type: 'string',
|
|
16
17
|
enum: ['s', 'm', 'l', 'xl'],
|
|
18
|
+
}, analyticsEvents: {
|
|
19
|
+
oneOf: [
|
|
20
|
+
Object.assign(Object.assign({}, AnalyticsEventSchema), { optionName: 'single' }),
|
|
21
|
+
{
|
|
22
|
+
type: 'array',
|
|
23
|
+
items: AnalyticsEventSchema,
|
|
24
|
+
optionName: 'list',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
17
27
|
} }),
|
|
18
28
|
},
|
|
19
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LayoutItemProps } from '../../models';
|
|
2
2
|
import './LayoutItem.css';
|
|
3
|
-
declare const LayoutItem: ({ content: { links, ...content }, metaInfo, media, border, fullscreen, className, }: LayoutItemProps) => JSX.Element;
|
|
3
|
+
declare const LayoutItem: ({ content: { links, ...content }, metaInfo, media, border, fullscreen, className, analyticsEvents, }: LayoutItemProps) => JSX.Element;
|
|
4
4
|
export default LayoutItem;
|
|
@@ -7,12 +7,12 @@ import { getLayoutItemLinks, hasFullscreen, showFullscreenIcon } from './utils';
|
|
|
7
7
|
import './LayoutItem.css';
|
|
8
8
|
const b = block('layout-item');
|
|
9
9
|
const LayoutItem = (_a) => {
|
|
10
|
-
var _b = _a.content, { links } = _b, content = __rest(_b, ["links"]), { metaInfo, media, border, fullscreen, className } = _a;
|
|
10
|
+
var _b = _a.content, { links } = _b, content = __rest(_b, ["links"]), { metaInfo, media, border, fullscreen, className, analyticsEvents } = _a;
|
|
11
11
|
return (React.createElement("div", { className: b(null, className) },
|
|
12
12
|
fullscreen && hasFullscreen(media) ? (React.createElement(FullscreenMedia, { showFullscreenIcon: showFullscreenIcon(media) }, (_a = {}) => {
|
|
13
13
|
var { className: mediaClassName, fullscreen: _fullscreen } = _a, fullscreenMediaProps = __rest(_a, ["className", "fullscreen"]);
|
|
14
|
-
return (React.createElement(Media, Object.assign({}, media, fullscreenMediaProps, { className: b('media', { border }, mediaClassName) })));
|
|
15
|
-
})) : (React.createElement(Media, Object.assign({}, media, { className: b('media', { border }) }))),
|
|
14
|
+
return (React.createElement(Media, Object.assign({}, media, fullscreenMediaProps, { className: b('media', { border }, mediaClassName), analyticsEvents: analyticsEvents })));
|
|
15
|
+
})) : (React.createElement(Media, Object.assign({}, media, { className: b('media', { border }), analyticsEvents: analyticsEvents }))),
|
|
16
16
|
metaInfo && React.createElement(MetaInfo, { items: metaInfo, className: b('meta-info') }),
|
|
17
17
|
React.createElement("div", { className: b('content') },
|
|
18
18
|
React.createElement(Content, Object.assign({}, content, { links: getLayoutItemLinks(links), size: "s", colSizes: { all: 12, md: 12 } })))));
|
|
@@ -318,6 +318,87 @@ export declare const LayoutItem: {
|
|
|
318
318
|
fullscreen: {
|
|
319
319
|
type: string;
|
|
320
320
|
};
|
|
321
|
+
analyticsEvents: {
|
|
322
|
+
oneOf: ({
|
|
323
|
+
optionName: string;
|
|
324
|
+
type: string;
|
|
325
|
+
additionalProperties: {
|
|
326
|
+
type: string;
|
|
327
|
+
};
|
|
328
|
+
required: string[];
|
|
329
|
+
properties: {
|
|
330
|
+
name: {
|
|
331
|
+
type: string;
|
|
332
|
+
};
|
|
333
|
+
type: {
|
|
334
|
+
type: string;
|
|
335
|
+
};
|
|
336
|
+
counters: {
|
|
337
|
+
type: string;
|
|
338
|
+
additionalProperties: boolean;
|
|
339
|
+
required: never[];
|
|
340
|
+
properties: {
|
|
341
|
+
include: {
|
|
342
|
+
type: string;
|
|
343
|
+
items: {
|
|
344
|
+
type: string;
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
exclude: {
|
|
348
|
+
type: string;
|
|
349
|
+
items: {
|
|
350
|
+
type: string;
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
context: {
|
|
356
|
+
type: string;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
items?: undefined;
|
|
360
|
+
} | {
|
|
361
|
+
type: string;
|
|
362
|
+
items: {
|
|
363
|
+
type: string;
|
|
364
|
+
additionalProperties: {
|
|
365
|
+
type: string;
|
|
366
|
+
};
|
|
367
|
+
required: string[];
|
|
368
|
+
properties: {
|
|
369
|
+
name: {
|
|
370
|
+
type: string;
|
|
371
|
+
};
|
|
372
|
+
type: {
|
|
373
|
+
type: string;
|
|
374
|
+
};
|
|
375
|
+
counters: {
|
|
376
|
+
type: string;
|
|
377
|
+
additionalProperties: boolean;
|
|
378
|
+
required: never[];
|
|
379
|
+
properties: {
|
|
380
|
+
include: {
|
|
381
|
+
type: string;
|
|
382
|
+
items: {
|
|
383
|
+
type: string;
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
exclude: {
|
|
387
|
+
type: string;
|
|
388
|
+
items: {
|
|
389
|
+
type: string;
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
context: {
|
|
395
|
+
type: string;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
optionName: string;
|
|
400
|
+
})[];
|
|
401
|
+
};
|
|
321
402
|
type: {};
|
|
322
403
|
when: {
|
|
323
404
|
type: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { omit } from 'lodash';
|
|
2
2
|
import metaInfo from '../../components/MetaInfo/schema';
|
|
3
3
|
import { BaseProps, MediaProps } from '../../schema/validators/common';
|
|
4
|
+
import { AnalyticsEventSchema } from '../../schema/validators/event';
|
|
4
5
|
import { ContentBase } from '../../sub-blocks/Content/schema';
|
|
5
6
|
export const LayoutItem = {
|
|
6
7
|
type: 'object',
|
|
@@ -10,5 +11,14 @@ export const LayoutItem = {
|
|
|
10
11
|
type: 'boolean',
|
|
11
12
|
}, fullscreen: {
|
|
12
13
|
type: 'boolean',
|
|
14
|
+
}, analyticsEvents: {
|
|
15
|
+
oneOf: [
|
|
16
|
+
Object.assign(Object.assign({}, AnalyticsEventSchema), { optionName: 'single' }),
|
|
17
|
+
{
|
|
18
|
+
type: 'array',
|
|
19
|
+
items: AnalyticsEventSchema,
|
|
20
|
+
optionName: 'list',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
13
23
|
} }),
|
|
14
24
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MediaCardProps } from '../../models';
|
|
2
2
|
import './MediaCard.css';
|
|
3
|
-
declare const MediaCard: ({ border, ...mediaProps }: MediaCardProps) => JSX.Element;
|
|
3
|
+
declare const MediaCard: ({ border, analyticsEvents, ...mediaProps }: MediaCardProps) => JSX.Element;
|
|
4
4
|
export default MediaCard;
|
|
@@ -5,8 +5,8 @@ import { block } from '../../utils';
|
|
|
5
5
|
import './MediaCard.css';
|
|
6
6
|
const b = block('MediaCard');
|
|
7
7
|
const MediaCard = (_a) => {
|
|
8
|
-
var { border } = _a, mediaProps = __rest(_a, ["border"]);
|
|
9
|
-
return (React.createElement(CardBase, { className: b(), bodyClassName: b('body'), border: border },
|
|
8
|
+
var { border, analyticsEvents } = _a, mediaProps = __rest(_a, ["border", "analyticsEvents"]);
|
|
9
|
+
return (React.createElement(CardBase, { className: b(), bodyClassName: b('body'), border: border, analyticsEvents: analyticsEvents },
|
|
10
10
|
React.createElement(CardBase.Content, null,
|
|
11
11
|
React.createElement(Media, Object.assign({}, mediaProps)))));
|
|
12
12
|
};
|
|
@@ -3,6 +3,87 @@ export declare const MediaCardBlock: {
|
|
|
3
3
|
additionalProperties: boolean;
|
|
4
4
|
required: never[];
|
|
5
5
|
properties: {
|
|
6
|
+
analyticsEvents: {
|
|
7
|
+
oneOf: ({
|
|
8
|
+
optionName: string;
|
|
9
|
+
type: string;
|
|
10
|
+
additionalProperties: {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
required: string[];
|
|
14
|
+
properties: {
|
|
15
|
+
name: {
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
type: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
counters: {
|
|
22
|
+
type: string;
|
|
23
|
+
additionalProperties: boolean;
|
|
24
|
+
required: never[];
|
|
25
|
+
properties: {
|
|
26
|
+
include: {
|
|
27
|
+
type: string;
|
|
28
|
+
items: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exclude: {
|
|
33
|
+
type: string;
|
|
34
|
+
items: {
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
context: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
items?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
type: string;
|
|
47
|
+
items: {
|
|
48
|
+
type: string;
|
|
49
|
+
additionalProperties: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
properties: {
|
|
54
|
+
name: {
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
type: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
counters: {
|
|
61
|
+
type: string;
|
|
62
|
+
additionalProperties: boolean;
|
|
63
|
+
required: never[];
|
|
64
|
+
properties: {
|
|
65
|
+
include: {
|
|
66
|
+
type: string;
|
|
67
|
+
items: {
|
|
68
|
+
type: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
exclude: {
|
|
72
|
+
type: string;
|
|
73
|
+
items: {
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
context: {
|
|
80
|
+
type: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
optionName: string;
|
|
85
|
+
})[];
|
|
86
|
+
};
|
|
6
87
|
animated: {
|
|
7
88
|
type: string;
|
|
8
89
|
};
|
|
@@ -147,84 +228,6 @@ export declare const MediaCardBlock: {
|
|
|
147
228
|
fullscreen: {
|
|
148
229
|
type: string;
|
|
149
230
|
};
|
|
150
|
-
analyticsEvents: {
|
|
151
|
-
anyOf: ({
|
|
152
|
-
type: string;
|
|
153
|
-
additionalProperties: {
|
|
154
|
-
type: string;
|
|
155
|
-
};
|
|
156
|
-
required: string[];
|
|
157
|
-
properties: {
|
|
158
|
-
name: {
|
|
159
|
-
type: string;
|
|
160
|
-
};
|
|
161
|
-
type: {
|
|
162
|
-
type: string;
|
|
163
|
-
};
|
|
164
|
-
counters: {
|
|
165
|
-
type: string;
|
|
166
|
-
additionalProperties: boolean;
|
|
167
|
-
required: never[];
|
|
168
|
-
properties: {
|
|
169
|
-
include: {
|
|
170
|
-
type: string;
|
|
171
|
-
items: {
|
|
172
|
-
type: string;
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
exclude: {
|
|
176
|
-
type: string;
|
|
177
|
-
items: {
|
|
178
|
-
type: string;
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
context: {
|
|
184
|
-
type: string;
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
} | {
|
|
188
|
-
type: string;
|
|
189
|
-
items: {
|
|
190
|
-
type: string;
|
|
191
|
-
additionalProperties: {
|
|
192
|
-
type: string;
|
|
193
|
-
};
|
|
194
|
-
required: string[];
|
|
195
|
-
properties: {
|
|
196
|
-
name: {
|
|
197
|
-
type: string;
|
|
198
|
-
};
|
|
199
|
-
type: {
|
|
200
|
-
type: string;
|
|
201
|
-
};
|
|
202
|
-
counters: {
|
|
203
|
-
type: string;
|
|
204
|
-
additionalProperties: boolean;
|
|
205
|
-
required: never[];
|
|
206
|
-
properties: {
|
|
207
|
-
include: {
|
|
208
|
-
type: string;
|
|
209
|
-
items: {
|
|
210
|
-
type: string;
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
exclude: {
|
|
214
|
-
type: string;
|
|
215
|
-
items: {
|
|
216
|
-
type: string;
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
context: {
|
|
222
|
-
type: string;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
})[];
|
|
227
|
-
};
|
|
228
231
|
border: {
|
|
229
232
|
type: string;
|
|
230
233
|
enum: string[];
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { AnimatableProps, BaseProps, CardBase, MediaProps } from '../../schema/validators/common';
|
|
2
|
+
import { AnalyticsEventSchema } from '../../schema/validators/event';
|
|
2
3
|
export const MediaCardBlock = {
|
|
3
4
|
'media-card': {
|
|
4
5
|
additionalProperties: false,
|
|
5
6
|
required: [],
|
|
6
|
-
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, BaseProps), CardBase), MediaProps), AnimatableProps),
|
|
7
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, BaseProps), CardBase), MediaProps), AnimatableProps), { analyticsEvents: {
|
|
8
|
+
oneOf: [
|
|
9
|
+
Object.assign(Object.assign({}, AnalyticsEventSchema), { optionName: 'single' }),
|
|
10
|
+
{
|
|
11
|
+
type: 'array',
|
|
12
|
+
items: AnalyticsEventSchema,
|
|
13
|
+
optionName: 'list',
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
} }),
|
|
7
17
|
},
|
|
8
18
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CardBorder, PriceDescriptionProps, PriceDetailsListProps, PriceDetailsSettingsProps, PriceItemProps } from '../../../models';
|
|
2
|
+
import { AnalyticsEventsBase, CardBorder, PriceDescriptionProps, PriceDetailsListProps, PriceDetailsSettingsProps, PriceItemProps } from '../../../models';
|
|
3
3
|
import './CombinedPriceDetailed.css';
|
|
4
|
-
interface CombinedPriceDetailedProps {
|
|
4
|
+
interface CombinedPriceDetailedProps extends AnalyticsEventsBase {
|
|
5
5
|
items: PriceItemProps[];
|
|
6
6
|
numberGroupItems: number;
|
|
7
7
|
useMixedView?: boolean;
|
|
@@ -12,7 +12,7 @@ const CombinedPricesGroupSize = {
|
|
|
12
12
|
[GridColumnSize.Lg]: 3,
|
|
13
13
|
};
|
|
14
14
|
const CombinedPriceDetailed = (props) => {
|
|
15
|
-
const { items, numberGroupItems, border, useMixedView, getDescriptionComponent, getDetailsComponent, } = props;
|
|
15
|
+
const { items, numberGroupItems, border, useMixedView, getDescriptionComponent, getDetailsComponent, analyticsEvents, } = props;
|
|
16
16
|
const [groupItemsSize, setGroupItemsSize] = useState(numberGroupItems);
|
|
17
17
|
const updateGroupItemsSize = useCallback((windowWidth) => {
|
|
18
18
|
if (windowWidth >= BREAKPOINTS.lg) {
|
|
@@ -49,7 +49,7 @@ const CombinedPriceDetailed = (props) => {
|
|
|
49
49
|
React.createElement("div", { className: b('description', { delimiter: useMixedView }) }, detailsComponents)));
|
|
50
50
|
};
|
|
51
51
|
const chunkedItems = _.chunk(items, groupItemsSize);
|
|
52
|
-
return (React.createElement(CardBase, { className: b(), border: border },
|
|
52
|
+
return (React.createElement(CardBase, { className: b(), border: border, analyticsEvents: analyticsEvents },
|
|
53
53
|
React.createElement(CardBase.Content, null,
|
|
54
54
|
React.createElement(Grid, null, chunkedItems.map((chunk, id) => {
|
|
55
55
|
return (React.createElement(Row, { key: id, className: b('row') }, getPrice(chunk)));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
1
2
|
import React, { Fragment } from 'react';
|
|
2
3
|
import { CardBase } from '../../../components';
|
|
3
4
|
import { block } from '../../../utils';
|
|
@@ -5,9 +6,12 @@ import './SeparatePriceDetailed.css';
|
|
|
5
6
|
const b = block('separate-price-detailed-block');
|
|
6
7
|
const SeparatePriceDetailed = (props) => {
|
|
7
8
|
const { items, border, getDescriptionComponent, getDetailsComponent } = props;
|
|
8
|
-
return (React.createElement(Fragment, null, items.map((
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
return (React.createElement(Fragment, null, items.map((_a, id) => {
|
|
10
|
+
var { analyticsEvents } = _a, item = __rest(_a, ["analyticsEvents"]);
|
|
11
|
+
return (React.createElement(CardBase, { key: id, className: b(), border: border, analyticsEvents: analyticsEvents },
|
|
12
|
+
React.createElement(CardBase.Content, null,
|
|
13
|
+
getDescriptionComponent(item),
|
|
14
|
+
getDetailsComponent(item.items))));
|
|
15
|
+
})));
|
|
12
16
|
};
|
|
13
17
|
export default SeparatePriceDetailed;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnimatableProps, BaseProps, textSize } from '../../schema/validators/common';
|
|
2
|
+
import { AnalyticsEventSchema } from '../../schema/validators/event';
|
|
2
3
|
import { filteredArray } from '../../schema/validators/utils';
|
|
3
4
|
const PriceDetailedDetailsType = ['marked-list', 'settings'];
|
|
4
5
|
const PriceDetailedDescriptionColor = ['cornflower', 'black'];
|
|
@@ -134,7 +135,16 @@ const PriceItem = {
|
|
|
134
135
|
type: 'object',
|
|
135
136
|
additionalProperties: false,
|
|
136
137
|
required: ['title', 'description'],
|
|
137
|
-
properties: Object.assign(Object.assign({}, PriceDetailsProps), PriceDescriptionProps),
|
|
138
|
+
properties: Object.assign(Object.assign(Object.assign({}, PriceDetailsProps), PriceDescriptionProps), { analyticsEvents: {
|
|
139
|
+
oneOf: [
|
|
140
|
+
Object.assign(Object.assign({}, AnalyticsEventSchema), { optionName: 'single' }),
|
|
141
|
+
{
|
|
142
|
+
type: 'array',
|
|
143
|
+
items: AnalyticsEventSchema,
|
|
144
|
+
optionName: 'list',
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
} }),
|
|
138
148
|
};
|
|
139
149
|
export const PriceDetailedBlock = {
|
|
140
150
|
'price-detailed': {
|
|
@@ -31,9 +31,6 @@ unpredictable css rules order in build */
|
|
|
31
31
|
.pc-quote_border_line {
|
|
32
32
|
border: 1px solid var(--yc-color-line-generic);
|
|
33
33
|
}
|
|
34
|
-
.pc-quote_border_line, .pc-quote_border_none {
|
|
35
|
-
cursor: default;
|
|
36
|
-
}
|
|
37
34
|
@media (min-width: 577px) {
|
|
38
35
|
.slick-slide:not(.slick-active) .pc-quote {
|
|
39
36
|
box-shadow: none;
|
package/package.json
CHANGED
|
@@ -284,7 +284,7 @@ export interface PriceDetailsListProps {
|
|
|
284
284
|
export interface PriceDetailsProps {
|
|
285
285
|
items?: PriceDetailsSettingsProps[] | PriceDetailsListProps[];
|
|
286
286
|
}
|
|
287
|
-
export interface PriceItemProps extends PriceDetailsProps, PriceDescriptionProps {
|
|
287
|
+
export interface PriceItemProps extends PriceDetailsProps, PriceDescriptionProps, AnalyticsEventsBase {
|
|
288
288
|
}
|
|
289
289
|
export interface PriceFoldableDetailsProps {
|
|
290
290
|
title: string;
|
|
@@ -71,13 +71,13 @@ export interface QuoteProps extends Themable, CardBaseProps {
|
|
|
71
71
|
buttonText?: string;
|
|
72
72
|
theme?: TextTheme;
|
|
73
73
|
}
|
|
74
|
-
export interface BackgroundCardProps extends CardBaseProps, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
74
|
+
export interface BackgroundCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered'> {
|
|
75
75
|
url?: string;
|
|
76
76
|
background?: ThemeSupporting<ImageObjectProps>;
|
|
77
77
|
paddingBottom?: 's' | 'm' | 'l' | 'xl';
|
|
78
78
|
backgroundColor?: string;
|
|
79
79
|
}
|
|
80
|
-
export interface BasicCardProps extends CardBaseProps, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
|
|
80
|
+
export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
|
|
81
81
|
url: string;
|
|
82
82
|
icon?: ImageProps;
|
|
83
83
|
target?: string;
|
|
@@ -92,9 +92,9 @@ export interface BannerCardProps {
|
|
|
92
92
|
theme?: TextTheme;
|
|
93
93
|
button: Pick<ButtonProps, 'text' | 'url' | 'target'>;
|
|
94
94
|
}
|
|
95
|
-
export interface MediaCardProps extends MediaProps, CardBaseProps {
|
|
95
|
+
export interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {
|
|
96
96
|
}
|
|
97
|
-
export interface LayoutItemProps extends ClassNameProps {
|
|
97
|
+
export interface LayoutItemProps extends ClassNameProps, AnalyticsEventsBase {
|
|
98
98
|
content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;
|
|
99
99
|
media: MediaProps;
|
|
100
100
|
metaInfo?: string[];
|