@gravity-ui/page-constructor 2.11.0 → 2.12.0-alpha
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/components/OverflowScroller/OverflowScroller.d.ts +2 -0
- package/build/cjs/components/OverflowScroller/OverflowScroller.js +4 -3
- package/build/esm/components/OverflowScroller/OverflowScroller.d.ts +2 -0
- package/build/esm/components/OverflowScroller/OverflowScroller.js +4 -3
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ const utils_1 = require("../../utils");
|
|
|
8
8
|
const b = (0, utils_1.block)('overflow-scroller');
|
|
9
9
|
const TRANSITION_TIME = 300;
|
|
10
10
|
const PADDING_SIZE = 24;
|
|
11
|
+
const DEFAULT_ARROW_SIZE = 18;
|
|
11
12
|
class OverflowScroller extends react_1.default.Component {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
@@ -72,7 +73,7 @@ class OverflowScroller extends react_1.default.Component {
|
|
|
72
73
|
window.removeEventListener('resize', this.checkOverflow);
|
|
73
74
|
}
|
|
74
75
|
render() {
|
|
75
|
-
const { className, children } = this.props;
|
|
76
|
+
const { className, arrowClassName, children, arrowSize = DEFAULT_ARROW_SIZE } = this.props;
|
|
76
77
|
const { arrows, scrollValue } = this.state;
|
|
77
78
|
const wrapperStyle = arrows.length ? { left: -scrollValue } : { left: 0 };
|
|
78
79
|
const paddingLeft = arrows.includes('left');
|
|
@@ -83,8 +84,8 @@ class OverflowScroller extends react_1.default.Component {
|
|
|
83
84
|
}) },
|
|
84
85
|
react_1.default.createElement("div", { className: b(null, className), ref: this.containerRef },
|
|
85
86
|
react_1.default.createElement("div", { className: b('wrapper'), style: wrapperStyle, ref: this.wrapperRef }, children)),
|
|
86
|
-
arrows.map((direction) => (react_1.default.createElement("div", { key: direction, className: b('arrow', { type: direction }), onClick: (e) => this.handleScrollClick(e, direction) },
|
|
87
|
-
react_1.default.createElement(__1.ToggleArrow, { size:
|
|
87
|
+
arrows.map((direction) => (react_1.default.createElement("div", { key: direction, className: b('arrow', { type: direction }, arrowClassName), onClick: (e) => this.handleScrollClick(e, direction) },
|
|
88
|
+
react_1.default.createElement(__1.ToggleArrow, { size: arrowSize, type: 'horizontal', iconType: "navigation" }))))));
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
exports.default = OverflowScroller;
|
|
@@ -6,6 +6,7 @@ import './OverflowScroller.css';
|
|
|
6
6
|
const b = block('overflow-scroller');
|
|
7
7
|
const TRANSITION_TIME = 300;
|
|
8
8
|
const PADDING_SIZE = 24;
|
|
9
|
+
const DEFAULT_ARROW_SIZE = 18;
|
|
9
10
|
export default class OverflowScroller extends React.Component {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
@@ -70,7 +71,7 @@ export default class OverflowScroller extends React.Component {
|
|
|
70
71
|
window.removeEventListener('resize', this.checkOverflow);
|
|
71
72
|
}
|
|
72
73
|
render() {
|
|
73
|
-
const { className, children } = this.props;
|
|
74
|
+
const { className, arrowClassName, children, arrowSize = DEFAULT_ARROW_SIZE } = this.props;
|
|
74
75
|
const { arrows, scrollValue } = this.state;
|
|
75
76
|
const wrapperStyle = arrows.length ? { left: -scrollValue } : { left: 0 };
|
|
76
77
|
const paddingLeft = arrows.includes('left');
|
|
@@ -81,7 +82,7 @@ export default class OverflowScroller extends React.Component {
|
|
|
81
82
|
}) },
|
|
82
83
|
React.createElement("div", { className: b(null, className), ref: this.containerRef },
|
|
83
84
|
React.createElement("div", { className: b('wrapper'), style: wrapperStyle, ref: this.wrapperRef }, children)),
|
|
84
|
-
arrows.map((direction) => (React.createElement("div", { key: direction, className: b('arrow', { type: direction }), onClick: (e) => this.handleScrollClick(e, direction) },
|
|
85
|
-
React.createElement(ToggleArrow, { size:
|
|
85
|
+
arrows.map((direction) => (React.createElement("div", { key: direction, className: b('arrow', { type: direction }, arrowClassName), onClick: (e) => this.handleScrollClick(e, direction) },
|
|
86
|
+
React.createElement(ToggleArrow, { size: arrowSize, type: 'horizontal', iconType: "navigation" }))))));
|
|
86
87
|
}
|
|
87
88
|
}
|