@doyourjob/gravity-ui-page-constructor 5.31.121 → 5.31.122
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/Header/BackgroundEffect/BackgroundEffect.css +24 -0
- package/build/cjs/blocks/Header/BackgroundEffect/BackgroundEffect.d.ts +6 -0
- package/build/cjs/blocks/Header/BackgroundEffect/BackgroundEffect.js +76 -0
- package/build/cjs/blocks/Header/Header.css +4 -0
- package/build/cjs/blocks/Header/Header.js +4 -1
- package/build/cjs/blocks/Header/schema.d.ts +32 -0
- package/build/cjs/blocks/Header/schema.js +12 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +16 -0
- package/build/cjs/blocks/HighlightTable/Cell.d.ts +10 -0
- package/build/cjs/blocks/HighlightTable/Cell.js +25 -0
- package/build/cjs/blocks/HighlightTable/HighlightTable.css +25 -0
- package/build/cjs/blocks/HighlightTable/HighlightTable.d.ts +1 -1
- package/build/cjs/blocks/HighlightTable/HighlightTable.js +16 -15
- package/build/cjs/blocks/HighlightTable/Row.d.ts +12 -0
- package/build/cjs/blocks/HighlightTable/Row.js +18 -0
- package/build/cjs/blocks/HighlightTable/schema.d.ts +62 -2
- package/build/cjs/blocks/HighlightTable/schema.js +29 -1
- package/build/cjs/blocks/LogoRotator/Item.d.ts +11 -0
- package/build/cjs/blocks/LogoRotator/Item.js +18 -0
- package/build/cjs/blocks/LogoRotator/LogoRotator.css +44 -0
- package/build/cjs/blocks/LogoRotator/LogoRotator.d.ts +3 -0
- package/build/cjs/blocks/LogoRotator/LogoRotator.js +56 -0
- package/build/cjs/blocks/LogoRotator/schema.d.ts +42 -0
- package/build/cjs/blocks/LogoRotator/schema.js +27 -0
- package/build/cjs/blocks/index.d.ts +1 -0
- package/build/cjs/blocks/index.js +3 -1
- package/build/cjs/components/Media/Video/utils.d.ts +1 -0
- package/build/cjs/components/Media/Video/utils.js +2 -1
- package/build/cjs/constructor-items.d.ts +2 -1
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +29 -3
- package/build/cjs/models/constructor-items/blocks.js +1 -0
- package/build/cjs/schema/constants.js +2 -1
- package/build/cjs/schema/validators/blocks.d.ts +1 -0
- package/build/cjs/schema/validators/blocks.js +1 -0
- package/build/cjs/text-transform/config.js +3 -2
- package/build/esm/blocks/Header/BackgroundEffect/BackgroundEffect.css +24 -0
- package/build/esm/blocks/Header/BackgroundEffect/BackgroundEffect.d.ts +7 -0
- package/build/esm/blocks/Header/BackgroundEffect/BackgroundEffect.js +72 -0
- package/build/esm/blocks/Header/Header.css +4 -0
- package/build/esm/blocks/Header/Header.js +4 -1
- package/build/esm/blocks/Header/schema.d.ts +32 -0
- package/build/esm/blocks/Header/schema.js +12 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +16 -0
- package/build/esm/blocks/HighlightTable/Cell.d.ts +11 -0
- package/build/esm/blocks/HighlightTable/Cell.js +21 -0
- package/build/esm/blocks/HighlightTable/HighlightTable.css +25 -0
- package/build/esm/blocks/HighlightTable/HighlightTable.d.ts +1 -1
- package/build/esm/blocks/HighlightTable/HighlightTable.js +17 -16
- package/build/esm/blocks/HighlightTable/Row.d.ts +13 -0
- package/build/esm/blocks/HighlightTable/Row.js +14 -0
- package/build/esm/blocks/HighlightTable/schema.d.ts +62 -2
- package/build/esm/blocks/HighlightTable/schema.js +29 -1
- package/build/esm/blocks/LogoRotator/Item.d.ts +12 -0
- package/build/esm/blocks/LogoRotator/Item.js +14 -0
- package/build/esm/blocks/LogoRotator/LogoRotator.css +44 -0
- package/build/esm/blocks/LogoRotator/LogoRotator.d.ts +4 -0
- package/build/esm/blocks/LogoRotator/LogoRotator.js +52 -0
- package/build/esm/blocks/LogoRotator/schema.d.ts +42 -0
- package/build/esm/blocks/LogoRotator/schema.js +24 -0
- package/build/esm/blocks/index.d.ts +1 -0
- package/build/esm/blocks/index.js +1 -0
- package/build/esm/components/Media/Video/utils.d.ts +1 -0
- package/build/esm/components/Media/Video/utils.js +1 -1
- package/build/esm/constructor-items.d.ts +2 -1
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/models/constructor-items/blocks.d.ts +29 -3
- package/build/esm/models/constructor-items/blocks.js +1 -0
- package/build/esm/schema/constants.js +3 -2
- package/build/esm/schema/validators/blocks.d.ts +1 -0
- package/build/esm/schema/validators/blocks.js +1 -0
- package/build/esm/text-transform/config.js +3 -2
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +29 -3
- package/server/models/constructor-items/blocks.js +1 -0
- package/server/text-transform/config.js +3 -2
- package/widget/index.js +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-background-effect {
|
|
4
|
+
position: absolute;
|
|
5
|
+
inset: 0;
|
|
6
|
+
}
|
|
7
|
+
.pc-background-effect__left {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
.pc-background-effect__right {
|
|
12
|
+
position: absolute;
|
|
13
|
+
inset: 0;
|
|
14
|
+
clip-path: inset(0 0 0 99.99%);
|
|
15
|
+
transition: clip-path 1.5s ease;
|
|
16
|
+
}
|
|
17
|
+
.pc-header-block:hover .pc-background-effect__right {
|
|
18
|
+
clip-path: inset(0 0 0 0.01%);
|
|
19
|
+
}
|
|
20
|
+
.pc-background-effect__video {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
object-fit: cover;
|
|
24
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BackgroundEffect = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const utils_1 = require("../../../components/Media/Video/utils");
|
|
7
|
+
const utils_2 = require("../../../utils");
|
|
8
|
+
const b = (0, utils_2.block)('background-effect');
|
|
9
|
+
const SYNC_THRESHOLD = 0.03;
|
|
10
|
+
const MAX_DESYNC = 0.5;
|
|
11
|
+
const FAST_RATE = 1.05;
|
|
12
|
+
const SLOW_RATE = 0.95;
|
|
13
|
+
const BackgroundEffect = ({ firstSrc, secondSrc }) => {
|
|
14
|
+
const master = (0, react_1.useRef)(null);
|
|
15
|
+
const driven = (0, react_1.useRef)(null);
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
const m = master.current;
|
|
18
|
+
const d = driven.current;
|
|
19
|
+
let rafId;
|
|
20
|
+
if (m && d) {
|
|
21
|
+
const syncMaster = () => {
|
|
22
|
+
if (m.paused) {
|
|
23
|
+
m.play().catch(() => { });
|
|
24
|
+
}
|
|
25
|
+
const delta = m.currentTime - d.currentTime;
|
|
26
|
+
if (d.paused) {
|
|
27
|
+
d.play().catch(() => { });
|
|
28
|
+
}
|
|
29
|
+
if (Math.abs(delta) > MAX_DESYNC) {
|
|
30
|
+
d.currentTime = m.currentTime;
|
|
31
|
+
d.playbackRate = 1;
|
|
32
|
+
}
|
|
33
|
+
else if (Math.abs(delta) > SYNC_THRESHOLD) {
|
|
34
|
+
d.playbackRate = delta > 0 ? FAST_RATE : SLOW_RATE;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
d.playbackRate = 1;
|
|
38
|
+
}
|
|
39
|
+
rafId = m.requestVideoFrameCallback(syncMaster);
|
|
40
|
+
};
|
|
41
|
+
rafId = m.requestVideoFrameCallback(syncMaster);
|
|
42
|
+
}
|
|
43
|
+
const handleVisibility = () => {
|
|
44
|
+
if (!document.hidden && m && d) {
|
|
45
|
+
m.play().catch(() => { });
|
|
46
|
+
d.play().catch(() => { });
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
document.addEventListener('visibilitychange', handleVisibility);
|
|
50
|
+
return () => {
|
|
51
|
+
var _a;
|
|
52
|
+
document.removeEventListener('visibilitychange', handleVisibility);
|
|
53
|
+
if (rafId && m) {
|
|
54
|
+
(_a = m.cancelVideoFrameCallback) === null || _a === void 0 ? void 0 : _a.call(m, rafId);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
58
|
+
if (!firstSrc || !secondSrc) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return (react_1.default.createElement("div", { className: b() },
|
|
62
|
+
react_1.default.createElement("div", { className: b('left') },
|
|
63
|
+
react_1.default.createElement("video", { ref: master, disablePictureInPicture: true, playsInline: true,
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
66
|
+
pip: "false", autoPlay: true, loop: true, preload: "auto", muted: true, className: b('video') },
|
|
67
|
+
react_1.default.createElement("source", { src: firstSrc, type: (0, utils_1.parseVideoType)(firstSrc) }))),
|
|
68
|
+
react_1.default.createElement("div", { className: b('right') },
|
|
69
|
+
react_1.default.createElement("video", { ref: driven, disablePictureInPicture: true, playsInline: true,
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
72
|
+
pip: "false", autoPlay: true, loop: true, preload: "auto", muted: true, className: b('video') },
|
|
73
|
+
react_1.default.createElement("source", { src: secondSrc, type: (0, utils_1.parseVideoType)(secondSrc) })))));
|
|
74
|
+
};
|
|
75
|
+
exports.BackgroundEffect = BackgroundEffect;
|
|
76
|
+
exports.default = exports.BackgroundEffect;
|
|
@@ -13,6 +13,10 @@ unpredictable css rules order in build */
|
|
|
13
13
|
padding: 16px 0;
|
|
14
14
|
margin: 0 0 16px;
|
|
15
15
|
}
|
|
16
|
+
.pc-header-block_header-space {
|
|
17
|
+
padding-top: var(--header-height);
|
|
18
|
+
margin-top: calc(var(--header-height) * -1);
|
|
19
|
+
}
|
|
16
20
|
.pc-header-block__content-wrapper {
|
|
17
21
|
margin: 0 8px;
|
|
18
22
|
height: 100%;
|
|
@@ -12,6 +12,7 @@ const theme_1 = require("../../context/theme");
|
|
|
12
12
|
const grid_1 = require("../../grid");
|
|
13
13
|
const utils_2 = require("../../utils");
|
|
14
14
|
const BackButton_1 = tslib_1.__importDefault(require("./BackButton/BackButton"));
|
|
15
|
+
const BackgroundEffect_1 = tslib_1.__importDefault(require("./BackgroundEffect/BackgroundEffect"));
|
|
15
16
|
const Breadcrumbs_1 = tslib_1.__importDefault(require("./Breadcrumbs/Breadcrumbs"));
|
|
16
17
|
const HeaderButtons_1 = tslib_1.__importDefault(require("./HeaderButtons/HeaderButtons"));
|
|
17
18
|
const HeaderDescription_1 = tslib_1.__importDefault(require("./HeaderDescription/HeaderDescription"));
|
|
@@ -30,7 +31,7 @@ const Background = ({ background, isMobile }) => {
|
|
|
30
31
|
const FullWidthBackground = ({ background }) => (react_1.default.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
|
|
31
32
|
// eslint-disable-next-line complexity
|
|
32
33
|
const HeaderBlock = (props) => {
|
|
33
|
-
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', } = props;
|
|
34
|
+
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', backgroundEffect, headerSpace, } = props;
|
|
34
35
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
35
36
|
const { backButton, blockTag } = (0, react_1.useContext)(headerContext_1.HeaderContext);
|
|
36
37
|
const theme = (0, theme_1.useTheme)();
|
|
@@ -48,9 +49,11 @@ const HeaderBlock = (props) => {
|
|
|
48
49
|
['full-width']: fullWidth,
|
|
49
50
|
['media-view']: mediaView,
|
|
50
51
|
['controls-view']: textTheme,
|
|
52
|
+
['header-space']: headerSpace,
|
|
51
53
|
}, className) },
|
|
52
54
|
backgroundThemed && fullWidth && react_1.default.createElement(FullWidthBackground, { background: backgroundThemed }),
|
|
53
55
|
backgroundThemed && react_1.default.createElement(Background, { background: backgroundThemed, isMobile: isMobile }),
|
|
56
|
+
backgroundEffect && backgroundEffect.firstSrc && backgroundEffect.secondSrc && (react_1.default.createElement(BackgroundEffect_1.default, Object.assign({}, backgroundEffect))),
|
|
54
57
|
react_1.default.createElement(grid_1.Grid, { containerClass: b('container-fluid') },
|
|
55
58
|
react_1.default.createElement(Breadcrumbs_1.default, { breadcrumbs: breadcrumbs, theme: textTheme }),
|
|
56
59
|
react_1.default.createElement(BackButton_1.default, { backButton: verticalOffset !== '0' && !breadcrumbs ? backButton : undefined, theme: textTheme }),
|
|
@@ -979,6 +979,22 @@ export declare const HeaderProperties: {
|
|
|
979
979
|
};
|
|
980
980
|
};
|
|
981
981
|
};
|
|
982
|
+
backgroundEffect: {
|
|
983
|
+
type: string;
|
|
984
|
+
additionalProperties: boolean;
|
|
985
|
+
required: boolean;
|
|
986
|
+
properties: {
|
|
987
|
+
firstSrc: {
|
|
988
|
+
type: string;
|
|
989
|
+
};
|
|
990
|
+
secondSrc: {
|
|
991
|
+
type: string;
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
headerSpace: {
|
|
996
|
+
type: string;
|
|
997
|
+
};
|
|
982
998
|
};
|
|
983
999
|
export declare const HeaderBlock: {
|
|
984
1000
|
'header-block': {
|
|
@@ -1648,6 +1664,22 @@ export declare const HeaderBlock: {
|
|
|
1648
1664
|
};
|
|
1649
1665
|
};
|
|
1650
1666
|
};
|
|
1667
|
+
backgroundEffect: {
|
|
1668
|
+
type: string;
|
|
1669
|
+
additionalProperties: boolean;
|
|
1670
|
+
required: boolean;
|
|
1671
|
+
properties: {
|
|
1672
|
+
firstSrc: {
|
|
1673
|
+
type: string;
|
|
1674
|
+
};
|
|
1675
|
+
secondSrc: {
|
|
1676
|
+
type: string;
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
};
|
|
1680
|
+
headerSpace: {
|
|
1681
|
+
type: string;
|
|
1682
|
+
};
|
|
1651
1683
|
anchor: {
|
|
1652
1684
|
type: string;
|
|
1653
1685
|
additionalProperties: boolean;
|
|
@@ -190,6 +190,18 @@ exports.HeaderProperties = {
|
|
|
190
190
|
},
|
|
191
191
|
},
|
|
192
192
|
},
|
|
193
|
+
backgroundEffect: {
|
|
194
|
+
type: 'object',
|
|
195
|
+
additionalProperties: false,
|
|
196
|
+
required: true,
|
|
197
|
+
properties: {
|
|
198
|
+
firstSrc: { type: 'string' },
|
|
199
|
+
secondSrc: { type: 'string' },
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
headerSpace: {
|
|
203
|
+
type: 'boolean',
|
|
204
|
+
},
|
|
193
205
|
};
|
|
194
206
|
exports.HeaderBlock = {
|
|
195
207
|
'header-block': {
|
|
@@ -673,6 +673,22 @@ export declare const HeaderSliderBlock: {
|
|
|
673
673
|
};
|
|
674
674
|
};
|
|
675
675
|
};
|
|
676
|
+
backgroundEffect: {
|
|
677
|
+
type: string;
|
|
678
|
+
additionalProperties: boolean;
|
|
679
|
+
required: boolean;
|
|
680
|
+
properties: {
|
|
681
|
+
firstSrc: {
|
|
682
|
+
type: string;
|
|
683
|
+
};
|
|
684
|
+
secondSrc: {
|
|
685
|
+
type: string;
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
};
|
|
689
|
+
headerSpace: {
|
|
690
|
+
type: string;
|
|
691
|
+
};
|
|
676
692
|
};
|
|
677
693
|
};
|
|
678
694
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HighlightTableCell } from '../../models';
|
|
3
|
+
type Props = {
|
|
4
|
+
cell: HighlightTableCell | string;
|
|
5
|
+
justify?: 'left' | 'center' | 'right';
|
|
6
|
+
columnWidth?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const Cell: ({ cell, justify, columnWidth }: Props) => JSX.Element;
|
|
9
|
+
declare const _default: React.MemoExoticComponent<({ cell, justify, columnWidth }: Props) => JSX.Element>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Cell = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const components_1 = require("../../components");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const b = (0, utils_1.block)('highlight-table-block');
|
|
9
|
+
const justifyMap = {
|
|
10
|
+
left: 'flex-start',
|
|
11
|
+
center: 'center',
|
|
12
|
+
right: 'flex-end',
|
|
13
|
+
};
|
|
14
|
+
const Cell = ({ cell, justify, columnWidth }) => {
|
|
15
|
+
const style = (0, react_1.useMemo)(() => ({
|
|
16
|
+
textAlign: justify !== null && justify !== void 0 ? justify : 'left',
|
|
17
|
+
alignItems: justify ? justifyMap[justify] : 'flex-start',
|
|
18
|
+
width: `calc(var(--block-width) * ${1 / (12 / ((typeof cell === 'object' && cell.columnWidth) || columnWidth || 2))})`,
|
|
19
|
+
}), [cell, columnWidth, justify]);
|
|
20
|
+
return (react_1.default.createElement("div", { className: b('cell'), style: style },
|
|
21
|
+
react_1.default.createElement(components_1.HTML, null, typeof cell === 'object' ? cell.cell : cell),
|
|
22
|
+
typeof cell === 'object' && cell.buttonText && (react_1.default.createElement(components_1.Button, { url: cell.buttonUrl, text: cell.buttonText, theme: "action", className: b('button') }))));
|
|
23
|
+
};
|
|
24
|
+
exports.Cell = Cell;
|
|
25
|
+
exports.default = react_1.default.memo(exports.Cell);
|
|
@@ -68,11 +68,29 @@ unpredictable css rules order in build */
|
|
|
68
68
|
.pc-highlight-table-block__row {
|
|
69
69
|
display: flex;
|
|
70
70
|
padding: 12px;
|
|
71
|
+
transition: padding 0.8s ease 0.5s, background-color 0.5s ease;
|
|
72
|
+
background-color: var(--ps-ht-color);
|
|
71
73
|
}
|
|
72
74
|
.pc-highlight-table-block__row + .pc-highlight-table-block__row {
|
|
73
75
|
border-top: 1px solid var(--g-color-private-black-100);
|
|
74
76
|
}
|
|
77
|
+
.pc-highlight-table-block__body .pc-highlight-table-block__row:hover {
|
|
78
|
+
transition: padding 0.8s ease, background-color 0.5s ease;
|
|
79
|
+
background-color: var(--ps-ht-hover-color, var(--ps-ht-color));
|
|
80
|
+
}
|
|
81
|
+
.pc-highlight-table-block__body .pc-highlight-table-block__row:hover .pc-highlight-table-block__button {
|
|
82
|
+
opacity: 1;
|
|
83
|
+
transform: translateY(4px);
|
|
84
|
+
max-height: 100px;
|
|
85
|
+
transition: transform 0.5s ease, max-height 0.5s ease, opacity 0.3s ease 0.5s;
|
|
86
|
+
}
|
|
87
|
+
.pc-highlight-table-block__body .pc-highlight-table-block__row_increase:hover {
|
|
88
|
+
padding-top: 20px;
|
|
89
|
+
padding-bottom: 20px;
|
|
90
|
+
}
|
|
75
91
|
.pc-highlight-table-block__cell {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
76
94
|
padding-right: 8px;
|
|
77
95
|
padding-left: 8px;
|
|
78
96
|
}
|
|
@@ -103,4 +121,11 @@ unpredictable css rules order in build */
|
|
|
103
121
|
background-color: var(--g-color-private-black-400);
|
|
104
122
|
transition: transform ease 50ms;
|
|
105
123
|
}
|
|
124
|
+
}
|
|
125
|
+
.pc-highlight-table-block__button {
|
|
126
|
+
opacity: 0;
|
|
127
|
+
max-height: 0;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
display: block;
|
|
130
|
+
transition: transform 0.5s ease 0.3s, max-height 0.5s ease 0.3s, opacity 0.3s ease;
|
|
106
131
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { HighlightTableBlockProps } from '../../models';
|
|
2
|
-
export declare const HighlightTableBlock: ({ title, description, table, legend, contentSize, legendPosition, legendAlign, }: HighlightTableBlockProps) => JSX.Element;
|
|
2
|
+
export declare const HighlightTableBlock: ({ title, description, table, legend, contentSize, legendPosition, legendAlign, rowHoverColor, rowHoverIncrease, }: HighlightTableBlockProps) => JSX.Element;
|
|
3
3
|
export default HighlightTableBlock;
|
|
@@ -7,6 +7,8 @@ const uikit_1 = require("@gravity-ui/uikit");
|
|
|
7
7
|
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
8
8
|
const components_1 = require("../../components");
|
|
9
9
|
const utils_1 = require("../../utils");
|
|
10
|
+
const Cell_1 = tslib_1.__importDefault(require("./Cell"));
|
|
11
|
+
const Row_1 = tslib_1.__importDefault(require("./Row"));
|
|
10
12
|
const b = (0, utils_1.block)('highlight-table-block');
|
|
11
13
|
const getTextStyles = (contentSize) => {
|
|
12
14
|
switch (contentSize) {
|
|
@@ -16,7 +18,7 @@ const getTextStyles = (contentSize) => {
|
|
|
16
18
|
return 'body-1';
|
|
17
19
|
}
|
|
18
20
|
};
|
|
19
|
-
const HighlightTableBlock = ({ title, description, table, legend = [], contentSize = 's', legendPosition = 'top', legendAlign = 'center', }) => {
|
|
21
|
+
const HighlightTableBlock = ({ title, description, table, legend = [], contentSize = 's', legendPosition = 'top', legendAlign = 'center', rowHoverColor, rowHoverIncrease, }) => {
|
|
20
22
|
const firstRow = table.content[0] || [];
|
|
21
23
|
const otherRows = table.content.slice(1);
|
|
22
24
|
const customColumnWidth = table.customColumnWidth || [];
|
|
@@ -74,30 +76,29 @@ const HighlightTableBlock = ({ title, description, table, legend = [], contentSi
|
|
|
74
76
|
window.removeEventListener('resize', updateProgress);
|
|
75
77
|
};
|
|
76
78
|
}, []);
|
|
77
|
-
const renderRow = (0, react_1.useCallback)((row, index) => {
|
|
78
|
-
var _a, _b;
|
|
79
|
-
return (react_1.default.createElement("div", { key: index, className: b('row'), style: { backgroundColor: (_b = (_a = table.highlighter) === null || _a === void 0 ? void 0 : _a[index]) !== null && _b !== void 0 ? _b : '' } }, row.map((cell, cellIndex) => {
|
|
80
|
-
var _a, _b, _c;
|
|
81
|
-
return (react_1.default.createElement("div", { key: cellIndex, className: b('cell'), style: {
|
|
82
|
-
textAlign: (_b = (_a = table.justify) === null || _a === void 0 ? void 0 : _a[cellIndex]) !== null && _b !== void 0 ? _b : 'left',
|
|
83
|
-
width: `calc(var(--block-width) * ${1 / (12 / (((_c = table.customColumnWidth) === null || _c === void 0 ? void 0 : _c[cellIndex]) || 2))})`,
|
|
84
|
-
} },
|
|
85
|
-
react_1.default.createElement(components_1.HTML, null, cell)));
|
|
86
|
-
})));
|
|
87
|
-
}, [table.customColumnWidth, table.highlighter, table.justify]);
|
|
88
79
|
const renderLegend = (0, react_1.useMemo)(() => Boolean(legend.length) && (react_1.default.createElement("div", { className: `${b('legend', {
|
|
89
80
|
left: legendAlign === 'left',
|
|
90
81
|
right: legendAlign === 'right',
|
|
91
82
|
'position-top': legendPosition === 'top',
|
|
92
83
|
'position-bottom': legendPosition === 'bottom',
|
|
93
84
|
})} ${textStyles}` }, legend.map((item, index) => (react_1.default.createElement(components_1.HTML, { className: b('legend-item'), block: true, key: String(index) }, item))))), [legend, legendAlign, legendPosition, textStyles]);
|
|
94
|
-
|
|
85
|
+
const rootStyle = (0, react_1.useMemo)(() => ({
|
|
86
|
+
['--ps-ht-hover-color']: rowHoverColor,
|
|
87
|
+
}), [rowHoverColor]);
|
|
88
|
+
return (react_1.default.createElement("div", { ref: blockRef, className: b(), style: rootStyle },
|
|
95
89
|
(title || description) && (react_1.default.createElement(components_1.Title, { className: b('title'), title: title, subtitle: description })),
|
|
96
90
|
legendPosition === 'top' && renderLegend,
|
|
97
91
|
react_1.default.createElement("div", { ref: tableRef, className: `${b('table')} ${textStyles}` },
|
|
98
92
|
react_1.default.createElement("div", { ref: tableContentRef, className: b('content') },
|
|
99
|
-
react_1.default.createElement("div", { className: b('head') },
|
|
100
|
-
|
|
93
|
+
react_1.default.createElement("div", { className: b('head') },
|
|
94
|
+
react_1.default.createElement("div", { className: b('row') }, firstRow.map((cell, index) => {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
return (react_1.default.createElement(Cell_1.default, { key: index, cell: cell, justify: (_a = table.justify) === null || _a === void 0 ? void 0 : _a[index], columnWidth: (_b = table.customColumnWidth) === null || _b === void 0 ? void 0 : _b[index] }));
|
|
97
|
+
}))),
|
|
98
|
+
react_1.default.createElement("div", { className: b('body') }, otherRows.map((row, index) => {
|
|
99
|
+
var _a;
|
|
100
|
+
return (react_1.default.createElement(Row_1.default, { key: index, row: row, rowHoverIncrease: rowHoverIncrease, color: (_a = table.highlighter) === null || _a === void 0 ? void 0 : _a[index], justify: table.justify, customColumnWidth: table.customColumnWidth }));
|
|
101
|
+
})))),
|
|
101
102
|
react_1.default.createElement("div", { ref: scrollBarRef, className: b('scrollbar') },
|
|
102
103
|
react_1.default.createElement("div", { ref: scrollThumbRef })),
|
|
103
104
|
legendPosition === 'bottom' && renderLegend));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HighlightTableCell } from '../../models';
|
|
3
|
+
type Props = {
|
|
4
|
+
row: HighlightTableCell[];
|
|
5
|
+
rowHoverIncrease?: boolean;
|
|
6
|
+
color?: string;
|
|
7
|
+
justify?: ('left' | 'center' | 'right')[];
|
|
8
|
+
customColumnWidth?: number[];
|
|
9
|
+
};
|
|
10
|
+
export declare const Row: ({ row, rowHoverIncrease, color, justify, customColumnWidth }: Props) => JSX.Element;
|
|
11
|
+
declare const _default: React.MemoExoticComponent<({ row, rowHoverIncrease, color, justify, customColumnWidth }: Props) => JSX.Element>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Row = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const Cell_1 = tslib_1.__importDefault(require("./Cell"));
|
|
8
|
+
const b = (0, utils_1.block)('highlight-table-block');
|
|
9
|
+
const Row = ({ row, rowHoverIncrease, color, justify, customColumnWidth }) => {
|
|
10
|
+
const style = (0, react_1.useMemo)(() => color
|
|
11
|
+
? {
|
|
12
|
+
['--ps-ht-color']: color,
|
|
13
|
+
}
|
|
14
|
+
: {}, [color]);
|
|
15
|
+
return (react_1.default.createElement("div", { className: b('row', { increase: rowHoverIncrease }), style: style }, row.map((cell, cellIndex) => (react_1.default.createElement(Cell_1.default, { key: cellIndex, cell: cell, justify: justify === null || justify === void 0 ? void 0 : justify[cellIndex], columnWidth: customColumnWidth === null || customColumnWidth === void 0 ? void 0 : customColumnWidth[cellIndex] })))));
|
|
16
|
+
};
|
|
17
|
+
exports.Row = Row;
|
|
18
|
+
exports.default = react_1.default.memo(exports.Row);
|
|
@@ -32,7 +32,31 @@ export declare const HighlightTable: {
|
|
|
32
32
|
items: {
|
|
33
33
|
type: string;
|
|
34
34
|
items: {
|
|
35
|
-
|
|
35
|
+
oneOf: ({
|
|
36
|
+
type: string;
|
|
37
|
+
additionalProperties: boolean;
|
|
38
|
+
required: string[];
|
|
39
|
+
properties: {
|
|
40
|
+
cell: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
buttonText: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
buttonUrl: {
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
49
|
+
columnWidth: {
|
|
50
|
+
type: string;
|
|
51
|
+
enum: number[];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
} | {
|
|
55
|
+
type: string;
|
|
56
|
+
additionalProperties?: undefined;
|
|
57
|
+
required?: undefined;
|
|
58
|
+
properties?: undefined;
|
|
59
|
+
})[];
|
|
36
60
|
};
|
|
37
61
|
};
|
|
38
62
|
};
|
|
@@ -56,6 +80,12 @@ export declare const HighlightTable: {
|
|
|
56
80
|
enum: number[];
|
|
57
81
|
};
|
|
58
82
|
};
|
|
83
|
+
rowHoverColor: {
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
rowHoverIncrease: {
|
|
87
|
+
type: string;
|
|
88
|
+
};
|
|
59
89
|
type: {};
|
|
60
90
|
when: {
|
|
61
91
|
type: string;
|
|
@@ -101,7 +131,31 @@ export declare const HighlightTableBlock: {
|
|
|
101
131
|
items: {
|
|
102
132
|
type: string;
|
|
103
133
|
items: {
|
|
104
|
-
|
|
134
|
+
oneOf: ({
|
|
135
|
+
type: string;
|
|
136
|
+
additionalProperties: boolean;
|
|
137
|
+
required: string[];
|
|
138
|
+
properties: {
|
|
139
|
+
cell: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
buttonText: {
|
|
143
|
+
type: string;
|
|
144
|
+
};
|
|
145
|
+
buttonUrl: {
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
148
|
+
columnWidth: {
|
|
149
|
+
type: string;
|
|
150
|
+
enum: number[];
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
} | {
|
|
154
|
+
type: string;
|
|
155
|
+
additionalProperties?: undefined;
|
|
156
|
+
required?: undefined;
|
|
157
|
+
properties?: undefined;
|
|
158
|
+
})[];
|
|
105
159
|
};
|
|
106
160
|
};
|
|
107
161
|
};
|
|
@@ -125,6 +179,12 @@ export declare const HighlightTableBlock: {
|
|
|
125
179
|
enum: number[];
|
|
126
180
|
};
|
|
127
181
|
};
|
|
182
|
+
rowHoverColor: {
|
|
183
|
+
type: string;
|
|
184
|
+
};
|
|
185
|
+
rowHoverIncrease: {
|
|
186
|
+
type: string;
|
|
187
|
+
};
|
|
128
188
|
type: {};
|
|
129
189
|
when: {
|
|
130
190
|
type: string;
|
|
@@ -35,7 +35,31 @@ exports.HighlightTable = {
|
|
|
35
35
|
items: {
|
|
36
36
|
type: 'array',
|
|
37
37
|
items: {
|
|
38
|
-
|
|
38
|
+
oneOf: [
|
|
39
|
+
{
|
|
40
|
+
type: 'object',
|
|
41
|
+
additionalProperties: false,
|
|
42
|
+
required: ['cell'],
|
|
43
|
+
properties: {
|
|
44
|
+
cell: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
},
|
|
47
|
+
buttonText: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
},
|
|
50
|
+
buttonUrl: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
},
|
|
53
|
+
columnWidth: {
|
|
54
|
+
type: 'number',
|
|
55
|
+
enum: [12, 6, 4, 3, 2],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: 'string',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
39
63
|
},
|
|
40
64
|
},
|
|
41
65
|
}, justify: {
|
|
@@ -55,6 +79,10 @@ exports.HighlightTable = {
|
|
|
55
79
|
type: 'string',
|
|
56
80
|
enum: [12, 6, 4, 3, 2],
|
|
57
81
|
},
|
|
82
|
+
}, rowHoverColor: {
|
|
83
|
+
type: 'string',
|
|
84
|
+
}, rowHoverIncrease: {
|
|
85
|
+
type: 'boolean',
|
|
58
86
|
} }),
|
|
59
87
|
},
|
|
60
88
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LogoRotatorBlockProps } from '../../models';
|
|
3
|
+
type Props = {
|
|
4
|
+
src: string;
|
|
5
|
+
url: string;
|
|
6
|
+
hidden: boolean;
|
|
7
|
+
colSizes: LogoRotatorBlockProps['colSizes'];
|
|
8
|
+
};
|
|
9
|
+
export declare const Item: ({ url, src, hidden, colSizes }: Props) => JSX.Element;
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ url, src, hidden, colSizes }: Props) => JSX.Element>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Item = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
+
const components_1 = require("../../components");
|
|
8
|
+
const grid_1 = require("../../grid");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const b = (0, utils_1.block)('logo-rotator-block');
|
|
11
|
+
const defaultColSizes = { all: 3 };
|
|
12
|
+
const Item = ({ url, src, hidden, colSizes }) => {
|
|
13
|
+
const renderItem = react_1.default.useMemo(() => (react_1.default.createElement(uikit_1.Link, { href: url, className: b('item', { hidden }) },
|
|
14
|
+
react_1.default.createElement(components_1.Image, { src: src, className: b('image'), alt: "", "aria-hidden": "true" }))), [hidden, src, url]);
|
|
15
|
+
return react_1.default.createElement(grid_1.Col, { sizes: colSizes || defaultColSizes }, renderItem);
|
|
16
|
+
};
|
|
17
|
+
exports.Item = Item;
|
|
18
|
+
exports.default = react_1.default.memo(exports.Item);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
@media (min-width: 769px) {
|
|
4
|
+
.pc-logo-rotator-block.pc-AnimateBlock, .pc-AnimateBlock .pc-logo-rotator-block {
|
|
5
|
+
position: relative;
|
|
6
|
+
top: 100px;
|
|
7
|
+
opacity: 0;
|
|
8
|
+
}
|
|
9
|
+
.pc-logo-rotator-block.pc-AnimateBlock.animate, .pc-AnimateBlock .pc-logo-rotator-block.animate {
|
|
10
|
+
top: 0;
|
|
11
|
+
opacity: 1;
|
|
12
|
+
transition: top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
13
|
+
transition-delay: 0s;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
.pc-logo-rotator-block__row {
|
|
17
|
+
justify-content: center;
|
|
18
|
+
}
|
|
19
|
+
.pc-logo-rotator-block__items {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
justify-content: space-around;
|
|
23
|
+
gap: 16px;
|
|
24
|
+
}
|
|
25
|
+
.pc-logo-rotator-block__item {
|
|
26
|
+
display: block;
|
|
27
|
+
height: 100px;
|
|
28
|
+
transition: opacity 0.5s ease 0.1s;
|
|
29
|
+
opacity: 1;
|
|
30
|
+
}
|
|
31
|
+
.pc-logo-rotator-block__item_hidden {
|
|
32
|
+
opacity: 0;
|
|
33
|
+
}
|
|
34
|
+
@media (max-width: 769px) {
|
|
35
|
+
.pc-logo-rotator-block__item {
|
|
36
|
+
height: 80px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
.pc-logo-rotator-block__image {
|
|
40
|
+
display: block;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
object-fit: contain;
|
|
44
|
+
}
|