@skbkontur/side-menu 1.4.0 → 1.4.2
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.4.2](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@1.4.1...@skbkontur/side-menu@1.4.2) (2023-08-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @skbkontur/side-menu
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.4.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@1.4.0...@skbkontur/side-menu@1.4.1) (2023-08-25)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @skbkontur/side-menu
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [1.4.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@1.3.0...@skbkontur/side-menu@1.4.0) (2023-08-24)
|
|
7
23
|
|
|
8
24
|
|
|
@@ -223,7 +223,7 @@ var SideMenuTheme = /** @class */ (function (_super) {
|
|
|
223
223
|
SideMenuTheme.sideMenuLogotypePaddingTop = '2px';
|
|
224
224
|
SideMenuTheme.sideMenuLogotypePaddingBottom = '6px';
|
|
225
225
|
SideMenuTheme.sideMenuLogotypePaddingYForTouchScreens = '8px';
|
|
226
|
-
SideMenuTheme.sideMenuLogotypeHiddenIconPaddingLeft = '
|
|
226
|
+
SideMenuTheme.sideMenuLogotypeHiddenIconPaddingLeft = '0';
|
|
227
227
|
//#endregion
|
|
228
228
|
//#region Footer
|
|
229
229
|
SideMenuTheme.sideMenuFooterPaddingBottom = '24px';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skbkontur/side-menu",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@skbkontur/react-ui": "4.13.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@skbkontur/icons": "^1.
|
|
25
|
+
"@skbkontur/icons": "^1.5.0",
|
|
26
26
|
"@skbkontur/react-ui-addons": "^4.9.1",
|
|
27
27
|
"tslib": "^1"
|
|
28
28
|
}
|
|
@@ -31,21 +31,21 @@ var getStaticIconPath = function (productName) {
|
|
|
31
31
|
* @visibleName SideMenu.Logotype
|
|
32
32
|
*/
|
|
33
33
|
var SideMenuLogotype = forwardRef(function (_a, ref) {
|
|
34
|
-
var _b, _c;
|
|
34
|
+
var _b, _c, _d;
|
|
35
35
|
var productLogo = _a.productLogo, withWidget = _a.withWidget, konturLogo = _a.konturLogo, iconUrl = _a.iconUrl, rest = __rest(_a, ["productLogo", "withWidget", "konturLogo", "iconUrl"]);
|
|
36
36
|
var context = useContext(SideMenuContext);
|
|
37
37
|
var theme = getSideMenuTheme(useContext(ThemeContext));
|
|
38
38
|
var productName = getProductName(productLogo);
|
|
39
39
|
var refLogotype = useRef(null);
|
|
40
|
-
var
|
|
41
|
-
var
|
|
40
|
+
var _e = useState(28), size = _e[0], setSize = _e[1];
|
|
41
|
+
var _f = useState(getStaticIconPath(productName)), productIconUrl = _f[0], setProductIconUrl = _f[1];
|
|
42
42
|
useEffect(function () {
|
|
43
43
|
var _a, _b;
|
|
44
44
|
var logotypeWidth = (_b = (_a = refLogotype.current) === null || _a === void 0 ? void 0 : _a.logotypeRef) === null || _b === void 0 ? void 0 : _b.clientWidth;
|
|
45
45
|
var maxWidth = parseInt(theme.sideMenuWidth) -
|
|
46
46
|
2 * parseInt(theme.sideMenuMarginX) -
|
|
47
47
|
parseInt(theme.sideMenuLogotypePaddingLeft);
|
|
48
|
-
if (logotypeWidth && logotypeWidth > maxWidth) {
|
|
48
|
+
if (logotypeWidth && logotypeWidth > maxWidth && !rest.size) {
|
|
49
49
|
setSize(24);
|
|
50
50
|
}
|
|
51
51
|
}, []);
|
|
@@ -64,16 +64,19 @@ var SideMenuLogotype = forwardRef(function (_a, ref) {
|
|
|
64
64
|
var handleError = function () {
|
|
65
65
|
setProductIconUrl(getStaticIconPath('kontur'));
|
|
66
66
|
};
|
|
67
|
-
return (React.createElement("div", { className:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
_c[jsStyles.
|
|
74
|
-
_c
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
return (React.createElement("div", { className: cx((_b = {},
|
|
68
|
+
_b[jsStyles.root()] = true,
|
|
69
|
+
_b[jsStyles.rootForTabletsOrMobiles()] = context.isMobile || context.isTablet,
|
|
70
|
+
_b)), ref: ref },
|
|
71
|
+
!context.isMobile && !context.isTablet && (React.createElement("img", { className: cx((_c = {},
|
|
72
|
+
_c[jsStyles.iconHidden(theme)] = true,
|
|
73
|
+
_c[jsStyles.icon()] = context.isMinimized,
|
|
74
|
+
_c)), src: iconUrl || productIconUrl, alt: productName, onError: handleError })),
|
|
75
|
+
React.createElement("div", { className: cx((_d = {},
|
|
76
|
+
_d[jsStyles.logoWrapper(theme)] = true,
|
|
77
|
+
_d[jsStyles.logoWrapperForTabletsOrMobiles(theme)] = context.isMobile || context.isTablet,
|
|
78
|
+
_d[jsStyles.logoWrapperHidden()] = context.isMinimized,
|
|
79
|
+
_d)) },
|
|
77
80
|
(context.isTablet || context.isMobile) && React.createElement(Burger, null),
|
|
78
81
|
React.createElement(Logotype, __assign({ ref: refLogotype, size: size, productLogo: productLogo, konturLogo: konturLogo, withWidget: getWidget(withWidget, context.isTouchScreen, context.isMinimized && context.isNarrowDesktop, context.showWidget) }, rest)))));
|
|
79
82
|
});
|
|
@@ -3,6 +3,7 @@ export declare const sideMenuLogotypeIconSize = "32px";
|
|
|
3
3
|
export declare const sideMenuLogotypeGapBetweenIconAndLogo = "50px";
|
|
4
4
|
export declare const jsStyles: {
|
|
5
5
|
root(): string;
|
|
6
|
+
rootForTabletsOrMobiles(): string;
|
|
6
7
|
icon(): string;
|
|
7
8
|
iconHidden(t: SideMenuTheme): string;
|
|
8
9
|
logoWrapper(t: SideMenuTheme): string;
|
|
@@ -6,23 +6,26 @@ export var sideMenuLogotypeIconSize = '32px';
|
|
|
6
6
|
export var sideMenuLogotypeGapBetweenIconAndLogo = '50px';
|
|
7
7
|
var styles = {
|
|
8
8
|
root: function () {
|
|
9
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n "], ["\n display: flex;\n "])));
|
|
9
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n padding-left: 4px;\n "], ["\n display: flex;\n padding-left: 4px;\n "])));
|
|
10
|
+
},
|
|
11
|
+
rootForTabletsOrMobiles: function () {
|
|
12
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: 0;\n "], ["\n padding-left: 0;\n "])));
|
|
10
13
|
},
|
|
11
14
|
icon: function () {
|
|
12
|
-
return css(
|
|
15
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n opacity: 1;\n width: auto;\n "], ["\n opacity: 1;\n width: auto;\n "])));
|
|
13
16
|
},
|
|
14
17
|
iconHidden: function (t) {
|
|
15
|
-
return css(
|
|
18
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: block;\n width: 0;\n padding-left: ", ";\n opacity: 0;\n transition: all ", "ms ease-out;\n "], ["\n display: block;\n width: 0;\n padding-left: ", ";\n opacity: 0;\n transition: all ", "ms ease-out;\n "])), t.sideMenuLogotypeHiddenIconPaddingLeft, transitionDuration);
|
|
16
19
|
},
|
|
17
20
|
logoWrapper: function (t) {
|
|
18
|
-
return css(
|
|
21
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n display: flex;\n opacity: 1;\n transition: all ", "ms ease-out;\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n display: flex;\n opacity: 1;\n transition: all ", "ms ease-out;\n "])), t.sideMenuLogotypePaddingTop, t.sideMenuLogotypePaddingBottom, t.sideMenuLogotypePaddingLeft, transitionDuration);
|
|
19
22
|
},
|
|
20
23
|
logoWrapperForTabletsOrMobiles: function (t) {
|
|
21
|
-
return css(
|
|
24
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n "])), t.sideMenuLogotypePaddingYForTouchScreens, t.sideMenuLogotypePaddingYForTouchScreens);
|
|
22
25
|
},
|
|
23
26
|
logoWrapperHidden: function () {
|
|
24
|
-
return css(
|
|
27
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n opacity: 0;\n "], ["\n opacity: 0;\n "])));
|
|
25
28
|
},
|
|
26
29
|
};
|
|
27
30
|
export var jsStyles = memoizeStyle(styles);
|
|
28
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
31
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|