@gravity-ui/page-constructor 4.34.1 → 4.35.1
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/Form/Form.css +1 -6
- package/build/cjs/blocks/Form/Form.js +2 -4
- package/build/cjs/blocks/Table/Table.css +1 -1
- package/build/cjs/components/Control/Control.d.ts +2 -0
- package/build/cjs/components/Control/Control.js +5 -3
- package/build/cjs/components/Table/Table.css +0 -1
- package/build/esm/blocks/Form/Form.css +1 -6
- package/build/esm/blocks/Form/Form.js +2 -4
- package/build/esm/blocks/Table/Table.css +1 -1
- package/build/esm/components/Control/Control.d.ts +2 -0
- package/build/esm/components/Control/Control.js +4 -3
- package/build/esm/components/Table/Table.css +0 -1
- package/package.json +1 -1
- package/widget/index.js +1 -1
|
@@ -118,14 +118,9 @@ unpredictable css rules order in build */
|
|
|
118
118
|
padding: 0 8px;
|
|
119
119
|
}
|
|
120
120
|
.pc-form-block_with-background .pc-form-block__row {
|
|
121
|
-
padding-top:
|
|
122
|
-
}
|
|
123
|
-
.pc-form-block_with-background .pc-form-block__row_padding-bottom_m {
|
|
121
|
+
padding-top: 32px;
|
|
124
122
|
padding-bottom: 32px;
|
|
125
123
|
}
|
|
126
|
-
.pc-form-block_with-background .pc-form-block__row_padding-bottom_l {
|
|
127
|
-
padding-bottom: 48px;
|
|
128
|
-
}
|
|
129
124
|
.pc-form-block_with-background .pc-form-block__row_direction_form-content .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_content-form .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_center .pc-form-block__content-wrapper {
|
|
130
125
|
padding-right: 16px;
|
|
131
126
|
padding-left: 16px;
|
|
@@ -16,8 +16,7 @@ const FormBlock = (props) => {
|
|
|
16
16
|
const { formData, title, textContent, direction = models_1.FormBlockDirection.Center, background } = props;
|
|
17
17
|
const [contentLoaded, setContentLoaded] = (0, react_1.useState)(false);
|
|
18
18
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
19
|
-
const
|
|
20
|
-
const paddingBottom = background && ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) && !hasImage ? 'l' : 'm'; // bigger padding for case with background color and no image
|
|
19
|
+
const withBackground = Boolean(background && (background.src || background.desktop || ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor)));
|
|
21
20
|
const onContentLoad = (0, react_1.useCallback)(() => {
|
|
22
21
|
setContentLoaded(true);
|
|
23
22
|
}, []);
|
|
@@ -32,7 +31,7 @@ const FormBlock = (props) => {
|
|
|
32
31
|
formType = models_1.FormBlockDataTypes.HUBSPOT;
|
|
33
32
|
}
|
|
34
33
|
return (react_1.default.createElement("div", { className: b({
|
|
35
|
-
'with-background':
|
|
34
|
+
'with-background': withBackground,
|
|
36
35
|
'form-type': formType,
|
|
37
36
|
}) },
|
|
38
37
|
background && (react_1.default.createElement(components_1.BackgroundImage, Object.assign({}, background, { className: b('media'), imageClassName: b('image') }))),
|
|
@@ -41,7 +40,6 @@ const FormBlock = (props) => {
|
|
|
41
40
|
? grid_1.GridAlignItems.Center
|
|
42
41
|
: grid_1.GridAlignItems.Start, className: b('row', {
|
|
43
42
|
direction,
|
|
44
|
-
'padding-bottom': paddingBottom,
|
|
45
43
|
}) },
|
|
46
44
|
react_1.default.createElement(grid_1.Col, { sizes: colSizes, className: b('content-col') }, textContent && (react_1.default.createElement("div", { className: b('content-wrapper') },
|
|
47
45
|
react_1.default.createElement(sub_blocks_1.Content, Object.assign({ theme: "default" }, textContent, { centered: direction === models_1.FormBlockDirection.Center, colSizes: { all: 12 }, className: b('content') }))))),
|
|
@@ -9,7 +9,7 @@ unpredictable css rules order in build */
|
|
|
9
9
|
line-height: var(--g-text-display-2-line-height);
|
|
10
10
|
color: var(--pc-text-header-color);
|
|
11
11
|
font-weight: var(--g-text-accent-font-weight);
|
|
12
|
-
top: calc(var(--header-height) +
|
|
12
|
+
top: calc(var(--header-height) + 0px);
|
|
13
13
|
position: sticky;
|
|
14
14
|
margin-right: 32px;
|
|
15
15
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SVGIconData } from '@gravity-ui/uikit/build/esm/components/Icon/types';
|
|
3
|
+
export declare const defaultIconId = "icon-test-id";
|
|
3
4
|
export interface ControlProps {
|
|
4
5
|
icon: SVGIconData;
|
|
5
6
|
theme?: 'primary' | 'secondary' | 'link' | 'accent';
|
|
@@ -8,6 +9,7 @@ export interface ControlProps {
|
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
className?: string;
|
|
10
11
|
onClick?: (event: React.MouseEvent) => void;
|
|
12
|
+
qa?: string;
|
|
11
13
|
}
|
|
12
14
|
declare const Control: (props: ControlProps) => JSX.Element;
|
|
13
15
|
export default Control;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultIconId = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
7
|
const utils_1 = require("../../utils");
|
|
7
8
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
8
9
|
const b = (0, utils_1.block)('control');
|
|
10
|
+
exports.defaultIconId = 'icon-test-id';
|
|
9
11
|
const Control = (props) => {
|
|
10
|
-
const { icon, theme = 'primary', size = 's', iconSize = 16, disabled = false, onClick, className, } = props;
|
|
11
|
-
return (react_1.default.createElement("button", { type: "button", "aria-label": (0, i18n_1.default)('aria-label'), className: b({ size, theme, disabled }, className), onClick: disabled ? undefined : onClick, disabled: disabled },
|
|
12
|
-
react_1.default.createElement(uikit_1.Icon, { data: icon, size: iconSize })));
|
|
12
|
+
const { icon, theme = 'primary', size = 's', iconSize = 16, disabled = false, onClick, className, qa, } = props;
|
|
13
|
+
return (react_1.default.createElement("button", { type: "button", "aria-label": (0, i18n_1.default)('aria-label'), className: b({ size, theme, disabled }, className), onClick: disabled ? undefined : onClick, disabled: disabled, "data-qa": qa },
|
|
14
|
+
react_1.default.createElement(uikit_1.Icon, { data: icon, size: iconSize, qa: exports.defaultIconId })));
|
|
13
15
|
};
|
|
14
16
|
exports.default = Control;
|
|
@@ -118,14 +118,9 @@ unpredictable css rules order in build */
|
|
|
118
118
|
padding: 0 8px;
|
|
119
119
|
}
|
|
120
120
|
.pc-form-block_with-background .pc-form-block__row {
|
|
121
|
-
padding-top:
|
|
122
|
-
}
|
|
123
|
-
.pc-form-block_with-background .pc-form-block__row_padding-bottom_m {
|
|
121
|
+
padding-top: 32px;
|
|
124
122
|
padding-bottom: 32px;
|
|
125
123
|
}
|
|
126
|
-
.pc-form-block_with-background .pc-form-block__row_padding-bottom_l {
|
|
127
|
-
padding-bottom: 48px;
|
|
128
|
-
}
|
|
129
124
|
.pc-form-block_with-background .pc-form-block__row_direction_form-content .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_content-form .pc-form-block__content-wrapper, .pc-form-block_with-background .pc-form-block__row_direction_center .pc-form-block__content-wrapper {
|
|
130
125
|
padding-right: 16px;
|
|
131
126
|
padding-left: 16px;
|
|
@@ -14,8 +14,7 @@ const FormBlock = (props) => {
|
|
|
14
14
|
const { formData, title, textContent, direction = FormBlockDirection.Center, background } = props;
|
|
15
15
|
const [contentLoaded, setContentLoaded] = useState(false);
|
|
16
16
|
const isMobile = useContext(MobileContext);
|
|
17
|
-
const
|
|
18
|
-
const paddingBottom = background && ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) && !hasImage ? 'l' : 'm'; // bigger padding for case with background color and no image
|
|
17
|
+
const withBackground = Boolean(background && (background.src || background.desktop || ((_a = background.style) === null || _a === void 0 ? void 0 : _a.backgroundColor)));
|
|
19
18
|
const onContentLoad = useCallback(() => {
|
|
20
19
|
setContentLoaded(true);
|
|
21
20
|
}, []);
|
|
@@ -30,7 +29,7 @@ const FormBlock = (props) => {
|
|
|
30
29
|
formType = FormBlockDataTypes.HUBSPOT;
|
|
31
30
|
}
|
|
32
31
|
return (React.createElement("div", { className: b({
|
|
33
|
-
'with-background':
|
|
32
|
+
'with-background': withBackground,
|
|
34
33
|
'form-type': formType,
|
|
35
34
|
}) },
|
|
36
35
|
background && (React.createElement(BackgroundImage, Object.assign({}, background, { className: b('media'), imageClassName: b('image') }))),
|
|
@@ -39,7 +38,6 @@ const FormBlock = (props) => {
|
|
|
39
38
|
? GridAlignItems.Center
|
|
40
39
|
: GridAlignItems.Start, className: b('row', {
|
|
41
40
|
direction,
|
|
42
|
-
'padding-bottom': paddingBottom,
|
|
43
41
|
}) },
|
|
44
42
|
React.createElement(Col, { sizes: colSizes, className: b('content-col') }, textContent && (React.createElement("div", { className: b('content-wrapper') },
|
|
45
43
|
React.createElement(Content, Object.assign({ theme: "default" }, textContent, { centered: direction === FormBlockDirection.Center, colSizes: { all: 12 }, className: b('content') }))))),
|
|
@@ -9,7 +9,7 @@ unpredictable css rules order in build */
|
|
|
9
9
|
line-height: var(--g-text-display-2-line-height);
|
|
10
10
|
color: var(--pc-text-header-color);
|
|
11
11
|
font-weight: var(--g-text-accent-font-weight);
|
|
12
|
-
top: calc(var(--header-height) +
|
|
12
|
+
top: calc(var(--header-height) + 0px);
|
|
13
13
|
position: sticky;
|
|
14
14
|
margin-right: 32px;
|
|
15
15
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SVGIconData } from '@gravity-ui/uikit/build/esm/components/Icon/types';
|
|
3
3
|
import './Control.css';
|
|
4
|
+
export declare const defaultIconId = "icon-test-id";
|
|
4
5
|
export interface ControlProps {
|
|
5
6
|
icon: SVGIconData;
|
|
6
7
|
theme?: 'primary' | 'secondary' | 'link' | 'accent';
|
|
@@ -9,6 +10,7 @@ export interface ControlProps {
|
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
className?: string;
|
|
11
12
|
onClick?: (event: React.MouseEvent) => void;
|
|
13
|
+
qa?: string;
|
|
12
14
|
}
|
|
13
15
|
declare const Control: (props: ControlProps) => JSX.Element;
|
|
14
16
|
export default Control;
|
|
@@ -4,9 +4,10 @@ import { block } from '../../utils';
|
|
|
4
4
|
import i18n from './i18n';
|
|
5
5
|
import './Control.css';
|
|
6
6
|
const b = block('control');
|
|
7
|
+
export const defaultIconId = 'icon-test-id';
|
|
7
8
|
const Control = (props) => {
|
|
8
|
-
const { icon, theme = 'primary', size = 's', iconSize = 16, disabled = false, onClick, className, } = props;
|
|
9
|
-
return (React.createElement("button", { type: "button", "aria-label": i18n('aria-label'), className: b({ size, theme, disabled }, className), onClick: disabled ? undefined : onClick, disabled: disabled },
|
|
10
|
-
React.createElement(Icon, { data: icon, size: iconSize })));
|
|
9
|
+
const { icon, theme = 'primary', size = 's', iconSize = 16, disabled = false, onClick, className, qa, } = props;
|
|
10
|
+
return (React.createElement("button", { type: "button", "aria-label": i18n('aria-label'), className: b({ size, theme, disabled }, className), onClick: disabled ? undefined : onClick, disabled: disabled, "data-qa": qa },
|
|
11
|
+
React.createElement(Icon, { data: icon, size: iconSize, qa: defaultIconId })));
|
|
11
12
|
};
|
|
12
13
|
export default Control;
|