@gravity-ui/page-constructor 1.7.1-alpha.2 → 1.7.1-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/blocks/Tabs/Tabs.css +8 -1
- package/build/cjs/blocks/Tabs/Tabs.js +1 -1
- package/build/cjs/blocks/Tabs/schema.d.ts +61 -18
- package/build/cjs/blocks/Tabs/schema.js +11 -19
- package/build/cjs/models/constructor-items/blocks.d.ts +0 -1
- package/build/esm/blocks/Tabs/Tabs.css +8 -1
- package/build/esm/blocks/Tabs/Tabs.js +1 -1
- package/build/esm/blocks/Tabs/schema.d.ts +61 -18
- package/build/esm/blocks/Tabs/schema.js +10 -19
- package/build/esm/models/constructor-items/blocks.d.ts +0 -1
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +0 -1
|
@@ -8,12 +8,17 @@ unpredictable css rules order in build */
|
|
|
8
8
|
margin-bottom: 24px;
|
|
9
9
|
}
|
|
10
10
|
.pc-tabs-block__block-title_centered {
|
|
11
|
-
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
margin-left: auto;
|
|
15
|
+
margin-right: auto;
|
|
12
16
|
text-align: center;
|
|
13
17
|
}
|
|
14
18
|
.pc-tabs-block__tabs_centered {
|
|
15
19
|
display: flex;
|
|
16
20
|
justify-content: center;
|
|
21
|
+
flex-wrap: wrap;
|
|
17
22
|
}
|
|
18
23
|
.pc-tabs-block__row_reverse {
|
|
19
24
|
flex-direction: row-reverse;
|
|
@@ -64,6 +69,8 @@ unpredictable css rules order in build */
|
|
|
64
69
|
@media (max-width: 769px) {
|
|
65
70
|
.pc-tabs-block__tabs {
|
|
66
71
|
display: flex;
|
|
72
|
+
flex-wrap: nowrap;
|
|
73
|
+
justify-content: flex-start;
|
|
67
74
|
overflow: auto;
|
|
68
75
|
margin-left: -48px;
|
|
69
76
|
margin-right: -48px;
|
|
@@ -45,7 +45,7 @@ const TabsBlock = ({ items, title, description, animated, tabsColSizes, centered
|
|
|
45
45
|
react_1.default.createElement(FullscreenImage_1.default, Object.assign({}, imageProps, { imageClassName: b('image') })),
|
|
46
46
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (react_1.default.createElement("p", { className: b('caption') }, activeTabData.caption))))));
|
|
47
47
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(), onScroll: () => setPlay(true), animate: animated },
|
|
48
|
-
react_1.default.createElement(BlockHeader_1.default, { title: title, description: description, className: b('block-title', { centered: centered })
|
|
48
|
+
react_1.default.createElement(BlockHeader_1.default, { title: title, description: description, className: b('block-title', { centered: centered }) }),
|
|
49
49
|
react_1.default.createElement(grid_1.Row, null,
|
|
50
50
|
react_1.default.createElement(grid_1.Col, { sizes: tabsColSizes },
|
|
51
51
|
react_1.default.createElement(ButtonTabs_1.default, { items: tabs, onSelectTab: setActiveTab, activeTab: activeTab, className: b('tabs', { centered: centered }) }))),
|
|
@@ -6,12 +6,6 @@ export declare const tabsItem: {
|
|
|
6
6
|
tabName: {
|
|
7
7
|
type: string;
|
|
8
8
|
};
|
|
9
|
-
title: {
|
|
10
|
-
type: string;
|
|
11
|
-
};
|
|
12
|
-
text: {
|
|
13
|
-
type: string;
|
|
14
|
-
};
|
|
15
9
|
caption: {
|
|
16
10
|
type: string;
|
|
17
11
|
};
|
|
@@ -184,17 +178,6 @@ export declare const tabsItem: {
|
|
|
184
178
|
when: {};
|
|
185
179
|
};
|
|
186
180
|
};
|
|
187
|
-
links: {
|
|
188
|
-
type: string;
|
|
189
|
-
items: {
|
|
190
|
-
type: string;
|
|
191
|
-
properties: {
|
|
192
|
-
when: {
|
|
193
|
-
type: string;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
181
|
image: {
|
|
199
182
|
oneOf: ({
|
|
200
183
|
oneOf: ({
|
|
@@ -215,6 +198,66 @@ export declare const tabsItem: {
|
|
|
215
198
|
properties: {};
|
|
216
199
|
})[];
|
|
217
200
|
};
|
|
201
|
+
title?: {
|
|
202
|
+
oneOf: ({
|
|
203
|
+
type: string;
|
|
204
|
+
additionalProperties: boolean;
|
|
205
|
+
required: string[];
|
|
206
|
+
properties: {
|
|
207
|
+
text: {
|
|
208
|
+
type: string;
|
|
209
|
+
};
|
|
210
|
+
textSize: {
|
|
211
|
+
type: string;
|
|
212
|
+
enum: string[];
|
|
213
|
+
};
|
|
214
|
+
url: {
|
|
215
|
+
type: string;
|
|
216
|
+
};
|
|
217
|
+
resetMargin: {
|
|
218
|
+
type: string;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
} | {
|
|
222
|
+
type: string;
|
|
223
|
+
})[];
|
|
224
|
+
} | undefined;
|
|
225
|
+
text?: {
|
|
226
|
+
type: string;
|
|
227
|
+
} | undefined;
|
|
228
|
+
additionalInfo?: {
|
|
229
|
+
type: string;
|
|
230
|
+
} | undefined;
|
|
231
|
+
size?: {
|
|
232
|
+
type: string;
|
|
233
|
+
enum: string[];
|
|
234
|
+
} | undefined;
|
|
235
|
+
links?: {
|
|
236
|
+
type: string;
|
|
237
|
+
items: {
|
|
238
|
+
type: string;
|
|
239
|
+
properties: {
|
|
240
|
+
when: {
|
|
241
|
+
type: string;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
} | undefined;
|
|
246
|
+
buttons?: {
|
|
247
|
+
type: string;
|
|
248
|
+
items: {
|
|
249
|
+
type: string;
|
|
250
|
+
properties: {
|
|
251
|
+
when: {
|
|
252
|
+
type: string;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
} | undefined;
|
|
257
|
+
theme?: {
|
|
258
|
+
type: string;
|
|
259
|
+
enum: string[];
|
|
260
|
+
} | undefined;
|
|
218
261
|
};
|
|
219
262
|
};
|
|
220
263
|
export declare const TabsBlock: {
|
|
@@ -245,7 +288,7 @@ export declare const TabsBlock: {
|
|
|
245
288
|
description: {
|
|
246
289
|
type: string;
|
|
247
290
|
};
|
|
248
|
-
|
|
291
|
+
tabsColSizes: {};
|
|
249
292
|
direction: {
|
|
250
293
|
type: string;
|
|
251
294
|
enum: string[];
|
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TabsBlock = exports.tabsItem = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const utils_1 = require("../../schema/validators/utils");
|
|
5
6
|
const common_1 = require("../../schema/validators/common");
|
|
6
7
|
const schema_1 = require("../../components/Image/schema");
|
|
8
|
+
const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
|
|
9
|
+
const schema_2 = require("../../sub-blocks/Content/schema");
|
|
10
|
+
const TabsItemContentProps = lodash_1.default.omit(schema_2.ContentBase, ['size', 'colSizes', 'centered', 'theme']);
|
|
7
11
|
exports.tabsItem = {
|
|
8
12
|
type: 'object',
|
|
9
13
|
additionalProperties: false,
|
|
10
|
-
required: ['tabName'
|
|
11
|
-
properties: {
|
|
12
|
-
tabName: {
|
|
14
|
+
required: ['tabName'],
|
|
15
|
+
properties: Object.assign(Object.assign({}, TabsItemContentProps), { tabName: {
|
|
13
16
|
type: 'string',
|
|
14
|
-
},
|
|
15
|
-
title: {
|
|
17
|
+
}, caption: {
|
|
16
18
|
type: 'string',
|
|
17
|
-
},
|
|
18
|
-
text: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
},
|
|
21
|
-
caption: {
|
|
22
|
-
type: 'string',
|
|
23
|
-
},
|
|
24
|
-
media: (0, common_1.withTheme)({
|
|
19
|
+
}, media: (0, common_1.withTheme)({
|
|
25
20
|
type: 'object',
|
|
26
21
|
properties: common_1.MediaProps,
|
|
27
|
-
}),
|
|
22
|
+
}),
|
|
28
23
|
//TODO deprecated
|
|
29
|
-
link: common_1.LinkProps,
|
|
30
|
-
links: (0, utils_1.filteredArray)(common_1.LinkProps),
|
|
31
|
-
image: (0, common_1.withTheme)(schema_1.ImageProps),
|
|
32
|
-
},
|
|
24
|
+
link: common_1.LinkProps, image: (0, common_1.withTheme)(schema_1.ImageProps) }),
|
|
33
25
|
};
|
|
34
26
|
exports.TabsBlock = {
|
|
35
27
|
'tabs-block': {
|
|
@@ -37,7 +29,7 @@ exports.TabsBlock = {
|
|
|
37
29
|
required: ['title', 'items'],
|
|
38
30
|
properties: Object.assign(Object.assign({}, common_1.BlockBaseProps), { title: common_1.TitleProps, description: {
|
|
39
31
|
type: 'string',
|
|
40
|
-
},
|
|
32
|
+
}, tabsColSizes: common_1.containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: common_1.sizeNumber })), {}), direction: {
|
|
41
33
|
type: 'string',
|
|
42
34
|
enum: common_1.mediaDirection,
|
|
43
35
|
}, centered: { type: 'boolean' }, items: (0, utils_1.filteredArray)(exports.tabsItem) }),
|
|
@@ -8,12 +8,17 @@ unpredictable css rules order in build */
|
|
|
8
8
|
margin-bottom: 24px;
|
|
9
9
|
}
|
|
10
10
|
.pc-tabs-block__block-title_centered {
|
|
11
|
-
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
margin-left: auto;
|
|
15
|
+
margin-right: auto;
|
|
12
16
|
text-align: center;
|
|
13
17
|
}
|
|
14
18
|
.pc-tabs-block__tabs_centered {
|
|
15
19
|
display: flex;
|
|
16
20
|
justify-content: center;
|
|
21
|
+
flex-wrap: wrap;
|
|
17
22
|
}
|
|
18
23
|
.pc-tabs-block__row_reverse {
|
|
19
24
|
flex-direction: row-reverse;
|
|
@@ -64,6 +69,8 @@ unpredictable css rules order in build */
|
|
|
64
69
|
@media (max-width: 769px) {
|
|
65
70
|
.pc-tabs-block__tabs {
|
|
66
71
|
display: flex;
|
|
72
|
+
flex-wrap: nowrap;
|
|
73
|
+
justify-content: flex-start;
|
|
67
74
|
overflow: auto;
|
|
68
75
|
margin-left: -48px;
|
|
69
76
|
margin-right: -48px;
|
|
@@ -42,7 +42,7 @@ export const TabsBlock = ({ items, title, description, animated, tabsColSizes, c
|
|
|
42
42
|
React.createElement(FullScreenImage, Object.assign({}, imageProps, { imageClassName: b('image') })),
|
|
43
43
|
(activeTabData === null || activeTabData === void 0 ? void 0 : activeTabData.caption) && (React.createElement("p", { className: b('caption') }, activeTabData.caption))))));
|
|
44
44
|
return (React.createElement(AnimateBlock, { className: b(), onScroll: () => setPlay(true), animate: animated },
|
|
45
|
-
React.createElement(BlockHeader, { title: title, description: description, className: b('block-title', { centered: centered })
|
|
45
|
+
React.createElement(BlockHeader, { title: title, description: description, className: b('block-title', { centered: centered }) }),
|
|
46
46
|
React.createElement(Row, null,
|
|
47
47
|
React.createElement(Col, { sizes: tabsColSizes },
|
|
48
48
|
React.createElement(ButtonTabs, { items: tabs, onSelectTab: setActiveTab, activeTab: activeTab, className: b('tabs', { centered: centered }) }))),
|
|
@@ -6,12 +6,6 @@ export declare const tabsItem: {
|
|
|
6
6
|
tabName: {
|
|
7
7
|
type: string;
|
|
8
8
|
};
|
|
9
|
-
title: {
|
|
10
|
-
type: string;
|
|
11
|
-
};
|
|
12
|
-
text: {
|
|
13
|
-
type: string;
|
|
14
|
-
};
|
|
15
9
|
caption: {
|
|
16
10
|
type: string;
|
|
17
11
|
};
|
|
@@ -184,17 +178,6 @@ export declare const tabsItem: {
|
|
|
184
178
|
when: {};
|
|
185
179
|
};
|
|
186
180
|
};
|
|
187
|
-
links: {
|
|
188
|
-
type: string;
|
|
189
|
-
items: {
|
|
190
|
-
type: string;
|
|
191
|
-
properties: {
|
|
192
|
-
when: {
|
|
193
|
-
type: string;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
181
|
image: {
|
|
199
182
|
oneOf: ({
|
|
200
183
|
oneOf: ({
|
|
@@ -215,6 +198,66 @@ export declare const tabsItem: {
|
|
|
215
198
|
properties: {};
|
|
216
199
|
})[];
|
|
217
200
|
};
|
|
201
|
+
title?: {
|
|
202
|
+
oneOf: ({
|
|
203
|
+
type: string;
|
|
204
|
+
additionalProperties: boolean;
|
|
205
|
+
required: string[];
|
|
206
|
+
properties: {
|
|
207
|
+
text: {
|
|
208
|
+
type: string;
|
|
209
|
+
};
|
|
210
|
+
textSize: {
|
|
211
|
+
type: string;
|
|
212
|
+
enum: string[];
|
|
213
|
+
};
|
|
214
|
+
url: {
|
|
215
|
+
type: string;
|
|
216
|
+
};
|
|
217
|
+
resetMargin: {
|
|
218
|
+
type: string;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
} | {
|
|
222
|
+
type: string;
|
|
223
|
+
})[];
|
|
224
|
+
} | undefined;
|
|
225
|
+
text?: {
|
|
226
|
+
type: string;
|
|
227
|
+
} | undefined;
|
|
228
|
+
additionalInfo?: {
|
|
229
|
+
type: string;
|
|
230
|
+
} | undefined;
|
|
231
|
+
size?: {
|
|
232
|
+
type: string;
|
|
233
|
+
enum: string[];
|
|
234
|
+
} | undefined;
|
|
235
|
+
links?: {
|
|
236
|
+
type: string;
|
|
237
|
+
items: {
|
|
238
|
+
type: string;
|
|
239
|
+
properties: {
|
|
240
|
+
when: {
|
|
241
|
+
type: string;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
} | undefined;
|
|
246
|
+
buttons?: {
|
|
247
|
+
type: string;
|
|
248
|
+
items: {
|
|
249
|
+
type: string;
|
|
250
|
+
properties: {
|
|
251
|
+
when: {
|
|
252
|
+
type: string;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
} | undefined;
|
|
257
|
+
theme?: {
|
|
258
|
+
type: string;
|
|
259
|
+
enum: string[];
|
|
260
|
+
} | undefined;
|
|
218
261
|
};
|
|
219
262
|
};
|
|
220
263
|
export declare const TabsBlock: {
|
|
@@ -245,7 +288,7 @@ export declare const TabsBlock: {
|
|
|
245
288
|
description: {
|
|
246
289
|
type: string;
|
|
247
290
|
};
|
|
248
|
-
|
|
291
|
+
tabsColSizes: {};
|
|
249
292
|
direction: {
|
|
250
293
|
type: string;
|
|
251
294
|
enum: string[];
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
import { filteredArray } from '../../schema/validators/utils';
|
|
2
2
|
import { LinkProps, withTheme, BlockBaseProps, TitleProps, MediaProps, containerSizesArray, sizeNumber, mediaDirection, } from '../../schema/validators/common';
|
|
3
3
|
import { ImageProps } from '../../components/Image/schema';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import { ContentBase } from '../../sub-blocks/Content/schema';
|
|
6
|
+
const TabsItemContentProps = _.omit(ContentBase, ['size', 'colSizes', 'centered', 'theme']);
|
|
4
7
|
export const tabsItem = {
|
|
5
8
|
type: 'object',
|
|
6
9
|
additionalProperties: false,
|
|
7
|
-
required: ['tabName'
|
|
8
|
-
properties: {
|
|
9
|
-
tabName: {
|
|
10
|
+
required: ['tabName'],
|
|
11
|
+
properties: Object.assign(Object.assign({}, TabsItemContentProps), { tabName: {
|
|
10
12
|
type: 'string',
|
|
11
|
-
},
|
|
12
|
-
title: {
|
|
13
|
+
}, caption: {
|
|
13
14
|
type: 'string',
|
|
14
|
-
},
|
|
15
|
-
text: {
|
|
16
|
-
type: 'string',
|
|
17
|
-
},
|
|
18
|
-
caption: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
},
|
|
21
|
-
media: withTheme({
|
|
15
|
+
}, media: withTheme({
|
|
22
16
|
type: 'object',
|
|
23
17
|
properties: MediaProps,
|
|
24
|
-
}),
|
|
18
|
+
}),
|
|
25
19
|
//TODO deprecated
|
|
26
|
-
link: LinkProps,
|
|
27
|
-
links: filteredArray(LinkProps),
|
|
28
|
-
image: withTheme(ImageProps),
|
|
29
|
-
},
|
|
20
|
+
link: LinkProps, image: withTheme(ImageProps) }),
|
|
30
21
|
};
|
|
31
22
|
export const TabsBlock = {
|
|
32
23
|
'tabs-block': {
|
|
@@ -34,7 +25,7 @@ export const TabsBlock = {
|
|
|
34
25
|
required: ['title', 'items'],
|
|
35
26
|
properties: Object.assign(Object.assign({}, BlockBaseProps), { title: TitleProps, description: {
|
|
36
27
|
type: 'string',
|
|
37
|
-
},
|
|
28
|
+
}, tabsColSizes: containerSizesArray.reduce((acc, size) => (Object.assign(Object.assign({}, acc), { [size]: sizeNumber })), {}), direction: {
|
|
38
29
|
type: 'string',
|
|
39
30
|
enum: mediaDirection,
|
|
40
31
|
}, centered: { type: 'boolean' }, items: filteredArray(tabsItem) }),
|
package/package.json
CHANGED