@gravity-ui/navigation 3.4.0 → 3.5.0
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/AsideHeader/__stories__/AsideHeader.stories.d.ts +1 -0
- package/build/cjs/components/AsideHeader/__stories__/moc.d.ts +7 -0
- package/build/cjs/components/AsideHeader/components/CollapseButton/CollapseButton.d.ts +1 -1
- package/build/cjs/components/AsideHeader/types.d.ts +4 -0
- package/build/cjs/components/Drawer/Drawer.d.ts +4 -2
- package/build/cjs/{index-Duvas6w0.js → index-CCk1YYhe.js} +2 -2
- package/build/cjs/{index-Duvas6w0.js.map → index-CCk1YYhe.js.map} +1 -1
- package/build/cjs/{index-D40EbfWh.js → index-xx_lPj0v.js} +39 -19
- package/build/cjs/index-xx_lPj0v.js.map +1 -0
- package/build/cjs/index.js +1 -1
- package/build/esm/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +1 -0
- package/build/esm/components/AsideHeader/__stories__/moc.d.ts +7 -0
- package/build/esm/components/AsideHeader/components/CollapseButton/CollapseButton.d.ts +1 -1
- package/build/esm/components/AsideHeader/types.d.ts +4 -0
- package/build/esm/components/Drawer/Drawer.d.ts +4 -2
- package/build/esm/{index-BHcJfNP_.js → index-B84DSZte.js} +2 -2
- package/build/esm/{index-BHcJfNP_.js.map → index-B84DSZte.js.map} +1 -1
- package/build/esm/{index-DWA-PD7D.js → index-C5bzWe6L.js} +39 -19
- package/build/esm/index-C5bzWe6L.js.map +1 -0
- package/build/esm/index.js +1 -1
- package/package.json +1 -1
- package/build/cjs/index-D40EbfWh.js.map +0 -1
- package/build/esm/index-DWA-PD7D.js.map +0 -1
|
@@ -16,3 +16,4 @@ export declare const Fallback: import("@storybook/csf").AnnotatedStoryFn<import(
|
|
|
16
16
|
}>;
|
|
17
17
|
/** @type {StoryFn} */
|
|
18
18
|
export declare function LineClamp(): React.JSX.Element;
|
|
19
|
+
export declare const CollapseButtonWrapper: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/csf").Args>;
|
|
@@ -3,4 +3,11 @@ import { AsideHeaderProps } from '../types';
|
|
|
3
3
|
export declare const EMPTY_CONTEXT_VALUE: AsideHeaderContextType;
|
|
4
4
|
export declare const menuItemsShowcase: AsideHeaderProps['menuItems'];
|
|
5
5
|
export declare const text = "\nDid you attend? He sang by grove ripe -\nThe bard of love, the singer of his mourning.\nWhen fields were silent by the early morning,\nTo sad and simple sounds of a pipe\nDid you attend?\n\nDid you behold in dark of forest leaf\nThe bard of love, the singer of his sadness?\nThe trace of tears, the smile, the utter paleness,\nThe quiet look, full of eternal grief,\nDid you behold?\n\nThen did you sigh when hearing how cries\nThe bard of love, the singer of his dole?\nWhen in the woods you saw the young man, sole,\nAnd met the look of his extinguished eyes,\nThen did you sigh?\n";
|
|
6
|
+
export declare const DEFAULT_LOGO: {
|
|
7
|
+
text: string;
|
|
8
|
+
icon: import("node_modules/@gravity-ui/uikit/build/esm/components/Icon/types").SVGIconData;
|
|
9
|
+
href: string;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
'aria-label': string;
|
|
12
|
+
};
|
|
6
13
|
export declare const menuItemsClamped: import("../..").MenuItem[];
|
|
@@ -3,4 +3,4 @@ import './CollapseButton.scss';
|
|
|
3
3
|
export interface CollapseButtonProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const CollapseButton: ({ className }: CollapseButtonProps) => React.JSX.Element;
|
|
6
|
+
export declare const CollapseButton: ({ className }: CollapseButtonProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
@@ -32,6 +32,10 @@ export interface AsideHeaderGeneralProps extends QAProps {
|
|
|
32
32
|
compact: boolean;
|
|
33
33
|
asideRef: React.RefObject<HTMLDivElement>;
|
|
34
34
|
}) => React.ReactNode;
|
|
35
|
+
collapseButtonWrapper?: (defaultButton: React.ReactNode, data: {
|
|
36
|
+
compact: boolean;
|
|
37
|
+
onChangeCompact?: (compact: boolean) => void;
|
|
38
|
+
}) => React.ReactNode;
|
|
35
39
|
editMenuProps?: EditMenuProps;
|
|
36
40
|
onClosePanel?: () => void;
|
|
37
41
|
onChangeCompact?: (compact: boolean) => void;
|
|
@@ -49,6 +49,8 @@ export interface DrawerItemProps {
|
|
|
49
49
|
* @default false
|
|
50
50
|
* */
|
|
51
51
|
keepMounted?: boolean;
|
|
52
|
+
/** Optional inline styles to be applied to the DrawerItem component. */
|
|
53
|
+
style?: React.CSSProperties;
|
|
52
54
|
}
|
|
53
55
|
export declare const DrawerItem: React.ForwardRefExoticComponent<DrawerItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
56
|
type DrawerChild = React.ReactElement<DrawerItemProps>;
|
|
@@ -63,11 +65,11 @@ export interface DrawerProps {
|
|
|
63
65
|
veilClassName?: string;
|
|
64
66
|
/** Optional callback function that is called when the veil (overlay) is clicked. */
|
|
65
67
|
onVeilClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
66
|
-
/** Optional callback function that is called when the escape key is pressed
|
|
68
|
+
/** Optional callback function that is called when the escape key is pressed if the drawer is open. */
|
|
67
69
|
onEscape?: (event: KeyboardEvent) => void;
|
|
68
70
|
/** Optional flag to hide the background darkening */
|
|
69
71
|
hideVeil?: boolean;
|
|
70
|
-
/** Optional flag to
|
|
72
|
+
/** Optional flag to doesn't use `Portal` for drawer */
|
|
71
73
|
disablePortal?: boolean;
|
|
72
74
|
/**
|
|
73
75
|
* Keep child components mounted when closed
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var uikit = require('@gravity-ui/uikit');
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-xx_lPj0v.js');
|
|
6
6
|
require('@bem-react/classname');
|
|
7
7
|
require('@gravity-ui/icons');
|
|
8
8
|
require('@gravity-ui/uikit/i18n');
|
|
@@ -67,4 +67,4 @@ const TopAlert = ({ alert, className, mobileView = false }) => {
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
exports.TopAlert = TopAlert;
|
|
70
|
-
//# sourceMappingURL=index-
|
|
70
|
+
//# sourceMappingURL=index-CCk1YYhe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-CCk1YYhe.js","sources":["../../../src/components/TopAlert/useTopAlertHeight.ts","../../../src/components/TopAlert/TopAlert.tsx"],"sourcesContent":["import React from 'react';\n\nimport debounceFn from 'lodash/debounce';\n\nimport {TopAlertProps} from '../types';\n\ntype TopAlertHeightControls = {\n alertRef: React.RefObject<HTMLDivElement>;\n updateTopSize: () => void;\n};\n\nconst G_ROOT_CLASS_NAME = 'g-root';\n\nexport const useTopAlertHeight = ({alert}: {alert?: TopAlertProps}): TopAlertHeightControls => {\n const alertRef = React.useRef<HTMLDivElement>(null);\n\n const setAsideTopPanelHeight = React.useCallback((clientHeight: number) => {\n const gRootElement = document\n .getElementsByClassName(G_ROOT_CLASS_NAME)\n .item(0) as HTMLElement | null;\n gRootElement?.style.setProperty('--gn-top-alert-height', clientHeight + 'px');\n }, []);\n\n const updateTopSize = React.useCallback(() => {\n setAsideTopPanelHeight(alertRef.current?.clientHeight || 0);\n }, [setAsideTopPanelHeight]);\n\n React.useLayoutEffect(() => {\n const updateTopSizeDebounce = debounceFn(updateTopSize, 200, {leading: true});\n\n if (alert) {\n window.addEventListener('resize', updateTopSizeDebounce);\n updateTopSizeDebounce();\n }\n return () => {\n window.removeEventListener('resize', updateTopSizeDebounce);\n setAsideTopPanelHeight(0);\n };\n }, [alert, alertRef, updateTopSize, setAsideTopPanelHeight]);\n\n return {\n alertRef,\n updateTopSize,\n };\n};\n","import React from 'react';\n\nimport {Alert, Text} from '@gravity-ui/uikit';\n\nimport {TopAlertProps} from '../types';\nimport {block} from '../utils/cn';\n\nimport {useTopAlertHeight} from './useTopAlertHeight';\n\nimport './TopAlert.scss';\n\nconst b = block('top-alert');\n\ntype Props = {\n alert?: TopAlertProps;\n className?: string;\n mobileView?: boolean;\n};\n\nexport const TopAlert = ({alert, className, mobileView = false}: Props) => {\n const {alertRef, updateTopSize} = useTopAlertHeight({alert});\n\n const [opened, setOpened] = React.useState(true);\n\n const handleClose = React.useCallback(() => {\n setOpened(false);\n alert?.onCloseTopAlert?.();\n }, [alert]);\n\n React.useEffect(() => {\n if (!opened) {\n updateTopSize();\n }\n }, [opened, updateTopSize]);\n\n if (!alert || !alert.message) {\n return null;\n }\n\n return (\n <div\n ref={alertRef}\n className={b('wrapper', {'with-bottom-border': !mobileView && opened}, className)}\n >\n {opened && (\n <Alert\n className={b('', {\n centered: alert.centered,\n dense: alert.dense,\n })}\n corners=\"square\"\n layout=\"horizontal\"\n align={alert.align}\n theme={alert.theme || 'warning'}\n view={alert.view}\n icon={alert.icon}\n title={alert.title}\n message={\n mobileView ? (\n <Text ellipsisLines={5} variant=\"body-2\">\n {alert.message}\n </Text>\n ) : (\n alert.message\n )\n }\n actions={alert.actions}\n onClose={alert.closable ? handleClose : undefined}\n />\n )}\n </div>\n );\n};\n"],"names":["debounceFn","block","Alert","Text"],"mappings":";;;;;;;;;;;;AAWA,MAAM,iBAAiB,GAAG,QAAQ;AAE3B,MAAM,iBAAiB,GAAG,CAAC,EAAC,KAAK,EAA0B,KAA4B;IAC1F,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC;IAEnD,MAAM,sBAAsB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,YAAoB,KAAI;QACtE,MAAM,YAAY,GAAG;aAChB,sBAAsB,CAAC,iBAAiB;aACxC,IAAI,CAAC,CAAC,CAAuB;AAClC,QAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,SAAA,GAAA,SAAA,GAAA,YAAY,CAAE,KAAK,CAAC,WAAW,CAAC,uBAAuB,EAAE,YAAY,GAAG,IAAI,CAAC;KAChF,EAAE,EAAE,CAAC;AA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SAAS,EACnD,CAAA,CACL,CACC;AAEd;;;;"}
|
|
@@ -141,7 +141,7 @@ function styleInject(css, ref) {
|
|
|
141
141
|
var css_248z$u = ".g-root{--gn-aside-top-panel-height:0px}.gn-aside-header{--gn-aside-header-min-width:56px;--_--item-icon-background-size:38px;--_--background-color:var(--g-color-base-background);--_--decoration-collapsed-background-color:var(--g-color-base-warning-light);--_--decoration-expanded-background-color:var(--g-color-base-warning-light);--_--vertical-divider-line-color:var(--g-color-line-generic);--_--horizontal-divider-line-color:var(--g-color-line-generic);background-color:var(--g-color-base-background);height:100%;position:relative;width:100%}.gn-aside-header__aside{background-color:var(--gn-aside-header-expanded-background-color,var(--gn-aside-header-background-color,var(--_--background-color)));box-sizing:border-box;display:flex;flex-direction:column;height:100vh;left:0;margin-top:var(--gn-top-alert-height,0);max-height:calc(100vh - var(--gn-top-alert-height, 0));position:sticky;top:var(--gn-top-alert-height,0);width:inherit;z-index:var(--gn-aside-header-z-index,100)}.gn-aside-header__aside:after{background-color:var(--gn-aside-header-divider-vertical-color,var(--_--vertical-divider-line-color));content:\"\";height:100%;position:absolute;right:0;top:0;width:1px;z-index:2}.gn-aside-header__aside-popup-anchor{inset:0;position:absolute;z-index:1}.gn-aside-header__aside-content{--gradient-height:334px;display:flex;flex-direction:column;height:inherit;overflow-x:hidden;padding-top:var(--gn-aside-header-padding-top);position:relative;user-select:none;width:inherit;z-index:2}.gn-aside-header__aside-content>.gn-aside-header-logo{margin:8px 0}.gn-aside-header__aside-content_with-decoration{background:linear-gradient(180deg,var(--gn-aside-header-decoration-expanded-background-color,var(--_--decoration-expanded-background-color)) calc(var(--gradient-height)*.33),transparent calc(var(--gradient-height)*.88))}.gn-aside-header__aside-custom-background{bottom:0;display:flex;position:absolute;top:0;width:var(--gn-aside-header-size);z-index:-1}.gn-aside-header_compact .gn-aside-header__aside{background-color:var(--gn-aside-header-collapsed-background-color,var(--gn-aside-header-background-color,var(--_--background-color)))}.gn-aside-header_compact .gn-aside-header__aside-content{background:transparent}.gn-aside-header__header{--gn-aside-header-header-divider-height:29px;box-sizing:border-box;flex:none;padding-bottom:22px;padding-top:8px;position:relative;width:100%;z-index:1}.gn-aside-header__header .gn-aside-header__header-divider{bottom:0;color:var(--gn-aside-header-decoration-collapsed-background-color,var(--_--decoration-collapsed-background-color));display:none;left:0;position:absolute;z-index:-2}.gn-aside-header__header_with-decoration:before{background-color:var(--gn-aside-header-decoration-collapsed-background-color,var(--_--decoration-collapsed-background-color));content:\"\";display:none;height:calc(100% - var(--gn-aside-header-header-divider-height));left:0;position:absolute;top:0;width:100%;z-index:-2}.gn-aside-header__header:after{background-color:var(--gn-aside-header-divider-horizontal-color,var(--_--horizontal-divider-line-color));bottom:12px;content:\"\";height:1px;left:0;position:absolute;width:100%;z-index:-2}.gn-aside-header_compact .gn-aside-header__header:before,.gn-aside-header_compact .gn-aside-header__header_with-decoration .gn-aside-header__header-divider{display:block}.gn-aside-header_compact .gn-aside-header__header_with-decoration:after{display:none}.gn-aside-header__logo-button .gn-aside-header__logo-icon-place{height:var(--gn-aside-header-item-icon-background-size,var(--_--item-icon-background-size));width:var(--gn-aside-header-min-width)}.gn-aside-header__menu-items{flex-grow:1}.gn-aside-header__footer{display:flex;flex-direction:column;flex-shrink:0;margin:8px 0;width:100%}.gn-aside-header__panels{inset:var(--gn-top-alert-height,0) 0 0;max-height:calc(100vh - var(--gn-top-alert-height, 0));overflow:auto;position:fixed;z-index:var(--gn-aside-header-panel-z-index,98)}.gn-aside-header__panel{height:100%}.gn-aside-header__pane-container{display:flex;flex-direction:row;outline:none;overflow:visible;user-select:text}.gn-aside-header__top-alert{background:var(--g-color-base-background);position:fixed;top:0;width:100%;z-index:var(--gn-aside-header-pane-top-z-index,98)}.gn-aside-header__content{margin-top:var(--gn-top-alert-height,0);width:calc(100% - var(--gn-aside-header-size));z-index:var(--gn-aside-header-content-z-index,95)}";
|
|
142
142
|
styleInject(css_248z$u);
|
|
143
143
|
|
|
144
|
-
const TopAlert$1 = React.lazy(() => Promise.resolve().then(function () { return require('./index-
|
|
144
|
+
const TopAlert$1 = React.lazy(() => Promise.resolve().then(function () { return require('./index-CCk1YYhe.js'); }).then((module) => ({ default: module.TopAlert })));
|
|
145
145
|
const Layout = ({ compact, className, children, topAlert }) => {
|
|
146
146
|
const size = compact ? ASIDE_HEADER_COMPACT_WIDTH : ASIDE_HEADER_EXPANDED_WIDTH;
|
|
147
147
|
const asideHeaderContextValue = React.useMemo(() => ({ size, compact }), [compact, size]);
|
|
@@ -1898,15 +1898,19 @@ styleInject(css_248z$n);
|
|
|
1898
1898
|
|
|
1899
1899
|
const b$o = block('collapse-button');
|
|
1900
1900
|
const CollapseButton = ({ className }) => {
|
|
1901
|
-
const { onChangeCompact, compact, expandTitle, collapseTitle } = useAsideHeaderInnerContext();
|
|
1901
|
+
const { onChangeCompact, compact, expandTitle, collapseTitle, collapseButtonWrapper } = useAsideHeaderInnerContext();
|
|
1902
1902
|
const onCollapseButtonClick = React.useCallback(() => {
|
|
1903
1903
|
onChangeCompact === null || onChangeCompact === undefined ? undefined : onChangeCompact(!compact);
|
|
1904
1904
|
}, [compact, onChangeCompact]);
|
|
1905
1905
|
const buttonTitle = compact
|
|
1906
1906
|
? expandTitle || i18n$3('button_expand')
|
|
1907
1907
|
: collapseTitle || i18n$3('button_collapse');
|
|
1908
|
-
|
|
1908
|
+
const defaultButton = (React.createElement("button", { className: b$o({ compact }, className), onClick: onCollapseButtonClick, title: buttonTitle },
|
|
1909
1909
|
React.createElement(uikit.Icon, { data: SvgControlMenuButton, className: b$o('icon'), width: "16", height: "10" })));
|
|
1910
|
+
if (collapseButtonWrapper) {
|
|
1911
|
+
return collapseButtonWrapper(defaultButton, { compact, onChangeCompact });
|
|
1912
|
+
}
|
|
1913
|
+
return defaultButton;
|
|
1910
1914
|
};
|
|
1911
1915
|
|
|
1912
1916
|
var css_248z$m = ".gn-logo{height:40px}.gn-logo,.gn-logo__btn-logo{align-items:center;display:flex}.gn-logo__btn-logo{cursor:pointer;flex-shrink:0;justify-content:center}.gn-logo__btn-logo,.gn-logo__btn-logo:active,.gn-logo__btn-logo:focus,.gn-logo__btn-logo:hover,.gn-logo__btn-logo:visited{color:inherit;outline:none;text-decoration:none}.gn-logo__btn-logo:focus-visible{outline:solid var(--g-color-line-misc);outline-offset:-2px}.gn-logo__logo-icon-place{align-items:center;display:flex;justify-content:center;width:36px}";
|
|
@@ -4491,7 +4495,7 @@ styleInject(css_248z$l);
|
|
|
4491
4495
|
const b$m = block('drawer');
|
|
4492
4496
|
const TIMEOUT = 300;
|
|
4493
4497
|
const DrawerItem = React.forwardRef(function DrawerItem(props, ref) {
|
|
4494
|
-
const { visible, content, children, direction = 'left', className, resizable, width, minResizeWidth, maxResizeWidth, onResizeStart, onResizeContinue, onResize, keepMounted = false, } = props;
|
|
4498
|
+
const { visible, content, children, direction = 'left', className, resizable, width, minResizeWidth, maxResizeWidth, onResizeStart, onResizeContinue, onResize, keepMounted = false, style = {}, } = props;
|
|
4495
4499
|
const [isInitialRender, setInitialRender] = React.useState(true);
|
|
4496
4500
|
const itemRef = React.useRef(null);
|
|
4497
4501
|
const handleRef = uikit.useForkRef(ref, itemRef);
|
|
@@ -4505,15 +4509,18 @@ const DrawerItem = React.forwardRef(function DrawerItem(props, ref) {
|
|
|
4505
4509
|
onResize,
|
|
4506
4510
|
onResizeContinue,
|
|
4507
4511
|
});
|
|
4508
|
-
const
|
|
4509
|
-
|
|
4510
|
-
if (
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4512
|
+
const innerStyle = React.useMemo(() => {
|
|
4513
|
+
const css = Object.assign({}, style);
|
|
4514
|
+
if (resizable) {
|
|
4515
|
+
if (['left', 'right'].includes(direction)) {
|
|
4516
|
+
css.width = `${resizedWidth}px`;
|
|
4517
|
+
}
|
|
4518
|
+
else {
|
|
4519
|
+
css.height = `${resizedWidth}px`;
|
|
4520
|
+
}
|
|
4515
4521
|
}
|
|
4516
|
-
|
|
4522
|
+
return css;
|
|
4523
|
+
}, [direction, resizable, resizedWidth, style]);
|
|
4517
4524
|
React.useEffect(() => {
|
|
4518
4525
|
setInitialRender(true);
|
|
4519
4526
|
}, [direction]);
|
|
@@ -4524,7 +4531,7 @@ const DrawerItem = React.forwardRef(function DrawerItem(props, ref) {
|
|
|
4524
4531
|
direction: cssDirection,
|
|
4525
4532
|
hidden: isInitialRender && !visible,
|
|
4526
4533
|
resize: isResizing,
|
|
4527
|
-
}, [className]), style:
|
|
4534
|
+
}, [className]), style: innerStyle },
|
|
4528
4535
|
resizerElement, children !== null && children !== undefined ? children : content)));
|
|
4529
4536
|
});
|
|
4530
4537
|
const Drawer = ({ className, veilClassName, children, style, onVeilClick, onEscape, hideVeil, disablePortal = true, keepMounted = false, scrollLock = false, }) => {
|
|
@@ -5647,10 +5654,23 @@ styleInject(css_248z$5);
|
|
|
5647
5654
|
|
|
5648
5655
|
const b$5 = block('mobile-overlap-panel');
|
|
5649
5656
|
const OverlapPanel = ({ title, renderContent, className, onClose, action, closeTitle = i18n('overlap_button_close'), visible, topOffset, }) => {
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5657
|
+
const topOffsetValue = typeof topOffset === 'number' ? `${topOffset}px` : topOffset;
|
|
5658
|
+
const [itemPosition, setItemPosition] = React.useState();
|
|
5659
|
+
const drawerStyle = React.useMemo(() => ({ top: `calc(${topOffsetValue} + var(--gn-top-alert-height, 0px))` }), [topOffsetValue]);
|
|
5660
|
+
const drawerItemStyle = React.useMemo(() => itemPosition === 'absolute'
|
|
5661
|
+
? {}
|
|
5662
|
+
: { top: `calc(${topOffsetValue} + var(--gn-top-alert-height, 0px))` }, [topOffsetValue, itemPosition]);
|
|
5663
|
+
const itemRef = React.useRef(null);
|
|
5664
|
+
// It is necessary to determine the position of the DrawerItem in order to correctly set the top offset
|
|
5665
|
+
React.useLayoutEffect(() => {
|
|
5666
|
+
if (itemRef.current) {
|
|
5667
|
+
const style = getComputedStyle(itemRef.current);
|
|
5668
|
+
const position = style.position;
|
|
5669
|
+
setItemPosition(position);
|
|
5670
|
+
}
|
|
5671
|
+
}, []);
|
|
5672
|
+
return (React.createElement(Drawer, { className: b$5('', { action: Boolean(action) }, className), onVeilClick: onClose, onEscape: onClose, style: drawerStyle },
|
|
5673
|
+
React.createElement(DrawerItem, { id: "overlap", ref: itemRef, visible: visible, className: b$5('drawer-item'), style: drawerItemStyle },
|
|
5654
5674
|
React.createElement("div", { className: b$5('header') },
|
|
5655
5675
|
React.createElement(uikit.Button, { size: "l", view: "flat", className: b$5('close'), onClick: onClose, "aria-label": closeTitle },
|
|
5656
5676
|
React.createElement(uikit.Icon, { className: b$5('icon'), data: icons.ArrowLeft, size: MOBILE_HEADER_ICON_SIZE })),
|
|
@@ -5663,7 +5683,7 @@ const OverlapPanel = ({ title, renderContent, className, onClose, action, closeT
|
|
|
5663
5683
|
var css_248z$4 = ".gn-mobile-header{--mobile-header-min-heigth:50px;--mobile-header-icon-size:20px;background-color:var(--g-color-base-background)}.gn-mobile-header__header-container{background-color:var(--g-color-base-background);position:sticky;top:0;z-index:var(--gn-mobile-header-z-index,100)}.gn-mobile-header__header{align-items:center;border-bottom:1px solid var(--g-color-line-generic);box-sizing:border-box;display:flex;justify-content:space-between;padding:0 10px}.gn-mobile-header__burger{padding:12px}.gn-mobile-header__panel-item{--gn-drawer-item-position:var(--gn-mobile-header-panel-position,absolute)}.gn-mobile-header__burger-menu,.gn-mobile-header__panel-item{background-color:var(--g-color-base-background);max-height:100%;max-width:90vw;width:320px}.gn-mobile-header__user-menu{overflow-y:auto}.gn-mobile-header__overlap-panel,.gn-mobile-header__panels{z-index:var(--gn-mobile-header-panel-z-index,98)}.gn-mobile-header__panels{inset:var(--mobile-header-min-heigth) 0 0;overflow:hidden;position:fixed}.gn-mobile-header__panel-item{top:unset}.gn-mobile-header__content{overflow:auto}";
|
|
5664
5684
|
styleInject(css_248z$4);
|
|
5665
5685
|
|
|
5666
|
-
const TopAlert = React.lazy(() => Promise.resolve().then(function () { return require('./index-
|
|
5686
|
+
const TopAlert = React.lazy(() => Promise.resolve().then(function () { return require('./index-CCk1YYhe.js'); }).then((module) => ({ default: module.TopAlert })));
|
|
5667
5687
|
const b$4 = block('mobile-header');
|
|
5668
5688
|
const MobileHeader = React.forwardRef(({ logo, burgerMenu, burgerCloseTitle = i18n('burger_button_close'), burgerOpenTitle = i18n('burger_button_open'), panelItems = [], renderContent, sideItemRenderContent, onClosePanel, onEvent, className, contentClassName, overlapPanel, topAlert, }, ref) => {
|
|
5669
5689
|
const targetRef = useForwardRef(ref);
|
|
@@ -5979,4 +5999,4 @@ exports.styleInject = styleInject;
|
|
|
5979
5999
|
exports.useAsideHeaderContext = useAsideHeaderContext;
|
|
5980
6000
|
exports.useSettingsContext = useSettingsContext;
|
|
5981
6001
|
exports.useSettingsSelectionContext = useSettingsSelectionContext;
|
|
5982
|
-
//# sourceMappingURL=index-
|
|
6002
|
+
//# sourceMappingURL=index-xx_lPj0v.js.map
|