@skbkontur/side-menu 0.9.0 → 0.9.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,25 @@
|
|
|
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
|
+
## [0.9.2](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@0.9.1...@skbkontur/side-menu@0.9.2) (2023-05-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @skbkontur/side-menu
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.9.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@0.9.0...@skbkontur/side-menu@0.9.1) (2023-05-15)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **Logotype,ProductWidget:** reinit widget on remount ([b1bbaab](https://git.skbkontur.ru/ui/ui-parking/commits/b1bbaab83a1b0a34edebc33904f9821f9588e0de))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [0.9.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/side-menu@0.8.1...@skbkontur/side-menu@0.9.0) (2023-05-02)
|
|
7
26
|
|
|
8
27
|
|
package/README.md
CHANGED
|
@@ -130,7 +130,7 @@ const renderModal = () => {
|
|
|
130
130
|
|
|
131
131
|
<div style={{height: '600px', width: '100%', position: 'relative', display: 'flex'}}>
|
|
132
132
|
<SideMenu isSeparatedMenu={true}>
|
|
133
|
-
<SideMenu.Header konturLogo={<Kontur/>} productLogo={<Buhgalteria/>}/>
|
|
133
|
+
<SideMenu.Header konturLogo={<Kontur/>} productLogo={<Buhgalteria/>} withWidget={false}/>
|
|
134
134
|
<SideMenu.Body>
|
|
135
135
|
<SideMenu.Item icon={<DocTextIcon24Regular/>} caption={'Документы'} marker={'новое'}>
|
|
136
136
|
<SideMenu.SubItem caption={'Входящие'} marker={'5'}>
|
|
@@ -253,7 +253,7 @@ const renderModal = () => {
|
|
|
253
253
|
|
|
254
254
|
<div style={{height: '600px', width: '100%', position: 'relative', display: 'flex'}}>
|
|
255
255
|
<SideMenu isSeparatedMenu={true} separatedMenuWithOverlay={true}>
|
|
256
|
-
<SideMenu.Header konturLogo={<Kontur/>} productLogo={<Buhgalteria/>}/>
|
|
256
|
+
<SideMenu.Header konturLogo={<Kontur/>} productLogo={<Buhgalteria/>} withWidget={false}/>
|
|
257
257
|
<SideMenu.Body>
|
|
258
258
|
<SideMenu.Item icon={<DocTextIcon24Regular/>} caption={'Документы'} marker={'новое'}>
|
|
259
259
|
<SideMenu.SubItem caption={'Входящие'} marker={'5'}>
|
|
@@ -375,7 +375,7 @@ const items = [
|
|
|
375
375
|
|
|
376
376
|
<div style={{height: '600px', display: 'flex', position: 'relative'}}>
|
|
377
377
|
<SideMenu value={activeItem} onValueChange={setActiveItem} isSeparatedMenu={isSeparatedMenu}>
|
|
378
|
-
<SideMenu.Header konturLogo={<Kontur/>} productLogo={<Ofd/>}/>
|
|
378
|
+
<SideMenu.Header konturLogo={<Kontur/>} productLogo={<Ofd/>} withWidget={false}/>
|
|
379
379
|
<SideMenu.Body>
|
|
380
380
|
<SideMenu.Item icon={<DocTextIcon24Regular/>} caption={'Документы к подписанию id=100'} marker={'новое'} id={'100'}>
|
|
381
381
|
<SideMenu.SubItem caption={'Входящие id=110'} id={'110'}/>
|
|
@@ -513,7 +513,7 @@ const items = [
|
|
|
513
513
|
|
|
514
514
|
<div style={{height: '600px', display: 'flex', position: 'relative'}}>
|
|
515
515
|
<SideMenu value={activeItem} onValueChange={setActiveItem} isSeparatedMenu={isSeparatedMenu}>
|
|
516
|
-
<SideMenu.Header konturLogo={<Kontur/>} productLogo={<Ofd/>}/>
|
|
516
|
+
<SideMenu.Header konturLogo={<Kontur/>} productLogo={<Ofd/>} withWidget={false}/>
|
|
517
517
|
<SideMenu.Body>
|
|
518
518
|
<SideMenu.Item icon={<DocTextIcon24Regular/>} caption={'Документы к подписанию'} marker={'новое'} id={'documents'}>
|
|
519
519
|
<SideMenu.SubItem caption={'Входящие'} id={'my-id-for-incoming-documents'}/>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isBrowser } from '../utils/scripts';
|
|
1
2
|
export var useNumberOfTextLinesInItem = function (textRef, setLinesNumber, text, marker, size) {
|
|
2
3
|
if (text === void 0) { text = ''; }
|
|
3
4
|
if (marker === void 0) { marker = ''; }
|
|
@@ -25,7 +26,7 @@ export var useNumberOfTextLinesInItem = function (textRef, setLinesNumber, text,
|
|
|
25
26
|
return lineCount;
|
|
26
27
|
};
|
|
27
28
|
var fontSize = size === 'small' ? 14 : 16; //TODO после перехода на переменные темы заменить на side-menu-font-size-small и side-menu-font-size-large
|
|
28
|
-
var fontFamily = textRef.current &&
|
|
29
|
+
var fontFamily = textRef.current && isBrowser
|
|
29
30
|
? window.getComputedStyle(textRef.current).getPropertyValue('font-family')
|
|
30
31
|
: "'Lab Grotesque', 'Segoe UI', 'Helvetica Neue', Roboto, Arial, sans-serif";
|
|
31
32
|
var canvas = document.createElement('canvas');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skbkontur/side-menu",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"author": "Kontur",
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@skbkontur/react-ui": ">=4.5.0 <5",
|
|
18
|
-
"@skbkontur/react-ui-addons": ">=4.0.1",
|
|
19
18
|
"react": ">=16.9",
|
|
20
19
|
"react-dom": ">=16.9"
|
|
21
20
|
},
|
|
@@ -24,6 +23,7 @@
|
|
|
24
23
|
},
|
|
25
24
|
"dependencies": {
|
|
26
25
|
"@skbkontur/icons": "^0.16.0",
|
|
26
|
+
"@skbkontur/react-ui-addons": "^4.6.2",
|
|
27
27
|
"tslib": "^1"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -2,7 +2,7 @@ import { __makeTemplateObject } from "tslib";
|
|
|
2
2
|
import { css, memoizeStyle } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
3
3
|
var styles = {
|
|
4
4
|
root: function () {
|
|
5
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 0 8px;\n min-height: 32px;\n line-height: 20px;\n flex-shrink: 0;\n "], ["\n display: flex;\n align-items: center;\n padding: 0 8px;\n min-height: 32px;\n line-height: 20px;\n flex-shrink: 0;\n "])));
|
|
5
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 0 8px;\n min-height: 32px;\n line-height: 20px;\n flex-shrink: 0;\n box-sizing: content-box;\n "], ["\n display: flex;\n align-items: center;\n padding: 0 8px;\n min-height: 32px;\n line-height: 20px;\n flex-shrink: 0;\n box-sizing: content-box;\n "])));
|
|
6
6
|
},
|
|
7
7
|
rootMultiline: function () {
|
|
8
8
|
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: flex-start;\n align-items: flex-start;\n "], ["\n align-self: flex-start;\n align-items: flex-start;\n "])));
|
package/utils/scripts.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ export declare const getChildrenIdArray: (childrenArray: FlattedArrayElementType
|
|
|
8
8
|
export declare const getElementsChildren: (element: ReactElement, levelIndex: string) => FlattedArrayElementType[];
|
|
9
9
|
export declare const isParentOpened: (id: string | undefined, generatedId: string | undefined, openedParents: string[] | undefined) => boolean | "" | undefined;
|
|
10
10
|
export declare const isElementActive: (id: string | undefined, activeMenuItem: string | undefined | null) => boolean;
|
|
11
|
+
export declare const isBrowser: boolean;
|
|
11
12
|
export declare const isTouchDevice: () => boolean;
|
|
12
13
|
export declare const getIconSize: (_isSubMenu?: boolean | undefined, _isBackButton?: boolean | undefined) => 24 | 16 | undefined;
|
package/utils/scripts.js
CHANGED
|
@@ -73,8 +73,9 @@ export var isParentOpened = function (id, generatedId, openedParents) {
|
|
|
73
73
|
export var isElementActive = function (id, activeMenuItem) {
|
|
74
74
|
return !!id && !!activeMenuItem && id === activeMenuItem;
|
|
75
75
|
};
|
|
76
|
+
export var isBrowser = typeof window !== 'undefined';
|
|
76
77
|
export var isTouchDevice = function () {
|
|
77
|
-
return
|
|
78
|
+
return isBrowser && ('ontouchstart' in window || navigator.maxTouchPoints > 0);
|
|
78
79
|
};
|
|
79
80
|
export var getIconSize = function (_isSubMenu, _isBackButton) {
|
|
80
81
|
if (!_isSubMenu) {
|