@gravity-ui/navigation 3.0.0 → 3.1.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/Drawer/utils.d.ts +3 -2
- package/build/cjs/{index-BCTDifzU.js → index-B9MdZ4_0.js} +46 -27
- package/build/cjs/index-B9MdZ4_0.js.map +1 -0
- package/build/cjs/{index-j_wMIK-L.js → index-C2YRXtzs.js} +2 -2
- package/build/cjs/{index-j_wMIK-L.js.map → index-C2YRXtzs.js.map} +1 -1
- package/build/cjs/index.js +1 -1
- package/build/esm/components/Drawer/utils.d.ts +3 -2
- package/build/esm/{index-Bc3g7Aar.js → index-A_QXLQfD.js} +2 -2
- package/build/esm/{index-Bc3g7Aar.js.map → index-A_QXLQfD.js.map} +1 -1
- package/build/esm/{index-CQqbFH0l.js → index-gaa74rU5.js} +46 -27
- package/build/esm/index-gaa74rU5.js.map +1 -0
- package/build/esm/index.js +1 -1
- package/package.json +1 -1
- package/build/cjs/index-BCTDifzU.js.map +0 -1
- package/build/esm/index-CQqbFH0l.js.map +0 -1
|
@@ -2,14 +2,15 @@ import * as React from 'react';
|
|
|
2
2
|
export declare const DRAWER_ITEM_MIN_RESIZE_WIDTH = 200;
|
|
3
3
|
export declare const DRAWER_ITEM_MAX_RESIZE_WIDTH = 800;
|
|
4
4
|
export declare const DRAWER_ITEM_INITIAL_RESIZE_WIDTH = 400;
|
|
5
|
-
export type DrawerDirection = 'right' | 'left';
|
|
5
|
+
export type DrawerDirection = 'right' | 'left' | 'top' | 'bottom';
|
|
6
6
|
export type OnResizeHandler = (width: number) => void;
|
|
7
7
|
export interface UseResizeHandlersParams {
|
|
8
8
|
onStart: () => void;
|
|
9
9
|
onMove: (delta: number) => void;
|
|
10
10
|
onEnd: (delta: number) => void;
|
|
11
|
+
direction?: 'horizontal' | 'vertical';
|
|
11
12
|
}
|
|
12
|
-
export declare function useResizeHandlers({ onStart, onMove, onEnd }: UseResizeHandlersParams): {
|
|
13
|
+
export declare function useResizeHandlers({ onStart, onMove, onEnd, direction, }: UseResizeHandlersParams): {
|
|
13
14
|
onMouseDown: (e: React.MouseEvent | React.TouchEvent) => void;
|
|
14
15
|
onTouchStart: (e: React.MouseEvent | React.TouchEvent) => void;
|
|
15
16
|
};
|
|
@@ -140,7 +140,7 @@ function styleInject(css, ref) {
|
|
|
140
140
|
var css_248z$u = ".g-root{--gn-aside-top-panel-height:0px}.g-root_theme_light{--gn-ah-background-color:var(--g-color-private-black-50-solid);--gn-ah-decoration-background-color:var(--g-color-private-yellow-200);--gn-ah-selected-item-background-color:var(--g-color-private-orange-200);--gn-ah-hovered-item-background-color:var(--g-color-private-black-50)}.g-root_theme_light-hc{--gn-ah-background-color:var(--g-color-private-black-50-solid);--gn-ah-decoration-background-color:var(--g-color-private-yellow-300);--gn-ah-selected-item-background-color:var(--g-color-private-orange-300);--gn-ah-hovered-item-background-color:var(--g-color-private-black-150)}.g-root_theme_dark{--gn-ah-background-color:#110e11;--gn-ah-decoration-background-color:var(--g-color-private-yellow-150);--gn-ah-selected-item-background-color:var(--g-color-private-orange-200);--gn-ah-hovered-item-background-color:var(--g-color-private-white-150)}.g-root_theme_dark-hc{--gn-ah-background-color:#050505;--gn-ah-decoration-background-color:var(--g-color-private-yellow-250);--gn-ah-selected-item-background-color:var(--g-color-private-orange-250);--gn-ah-hovered-item-background-color:var(--g-color-private-white-250)}.gn-aside-header{--gn-aside-header-min-width:56px;--_--item-icon-background-size:38px;--_--background-color:var(--gn-ah-background-color);--_--decoration-collapsed-background-color:var(--gn-ah-decoration-background-color);--_--decoration-expanded-background-color:var(--gn-ah-decoration-background-color);--_--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);overflow-x:auto;width:calc(100% - var(--gn-aside-header-size));z-index:var(--gn-aside-header-content-z-index,95)}";
|
|
141
141
|
styleInject(css_248z$u);
|
|
142
142
|
|
|
143
|
-
const TopAlert$1 = React.lazy(() => Promise.resolve().then(function () { return require('./index-
|
|
143
|
+
const TopAlert$1 = React.lazy(() => Promise.resolve().then(function () { return require('./index-C2YRXtzs.js'); }).then((module) => ({ default: module.TopAlert })));
|
|
144
144
|
const Layout = ({ compact, className, children, topAlert }) => {
|
|
145
145
|
const size = compact ? ASIDE_HEADER_COMPACT_WIDTH : ASIDE_HEADER_EXPANDED_WIDTH;
|
|
146
146
|
const asideHeaderContextValue = React.useMemo(() => ({ size, compact }), [compact, size]);
|
|
@@ -4266,36 +4266,41 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, T
|
|
|
4266
4266
|
const DRAWER_ITEM_MIN_RESIZE_WIDTH = 200;
|
|
4267
4267
|
const DRAWER_ITEM_MAX_RESIZE_WIDTH = 800;
|
|
4268
4268
|
const DRAWER_ITEM_INITIAL_RESIZE_WIDTH = 400;
|
|
4269
|
-
function
|
|
4270
|
-
var _a, _b;
|
|
4271
|
-
|
|
4269
|
+
function getEventClientPosition(e, direction) {
|
|
4270
|
+
var _a, _b, _c, _d;
|
|
4271
|
+
if ('touches' in e) {
|
|
4272
|
+
return direction === 'horizontal'
|
|
4273
|
+
? ((_b = (_a = e.touches[0]) === null || _a === undefined ? undefined : _a.clientX) !== null && _b !== undefined ? _b : 0)
|
|
4274
|
+
: ((_d = (_c = e.touches[0]) === null || _c === undefined ? undefined : _c.clientY) !== null && _d !== undefined ? _d : 0);
|
|
4275
|
+
}
|
|
4276
|
+
return direction === 'horizontal' ? e.clientX : e.clientY;
|
|
4272
4277
|
}
|
|
4273
|
-
function useResizeHandlers({ onStart, onMove, onEnd }) {
|
|
4274
|
-
const
|
|
4275
|
-
const
|
|
4278
|
+
function useResizeHandlers({ onStart, onMove, onEnd, direction = 'horizontal', }) {
|
|
4279
|
+
const initialPosition = React__namespace.useRef(0);
|
|
4280
|
+
const currentPosition = React__namespace.useRef(0);
|
|
4276
4281
|
const handleMove = React__namespace.useCallback((e) => {
|
|
4277
|
-
const
|
|
4278
|
-
if (
|
|
4282
|
+
const current = getEventClientPosition(e, direction);
|
|
4283
|
+
if (currentPosition.current === current) {
|
|
4279
4284
|
return;
|
|
4280
4285
|
}
|
|
4281
|
-
|
|
4282
|
-
const delta =
|
|
4286
|
+
currentPosition.current = current;
|
|
4287
|
+
const delta = initialPosition.current - current;
|
|
4283
4288
|
onMove(delta);
|
|
4284
|
-
}, [onMove]);
|
|
4289
|
+
}, [onMove, direction]);
|
|
4285
4290
|
const handleEnd = React__namespace.useCallback((e) => {
|
|
4286
4291
|
window.removeEventListener('mousemove', handleMove);
|
|
4287
4292
|
window.removeEventListener('touchmove', handleMove);
|
|
4288
4293
|
document.body.style.removeProperty('user-select');
|
|
4289
4294
|
document.body.style.removeProperty('-webkit-user-select');
|
|
4290
4295
|
document.body.style.removeProperty('cursor');
|
|
4291
|
-
const
|
|
4292
|
-
const delta =
|
|
4296
|
+
const current = getEventClientPosition(e, direction);
|
|
4297
|
+
const delta = initialPosition.current - current;
|
|
4293
4298
|
onEnd(delta);
|
|
4294
|
-
}, [handleMove, onEnd]);
|
|
4299
|
+
}, [handleMove, onEnd, direction]);
|
|
4295
4300
|
const handleStart = React__namespace.useCallback((e) => {
|
|
4296
|
-
const
|
|
4297
|
-
|
|
4298
|
-
|
|
4301
|
+
const current = getEventClientPosition(e, direction);
|
|
4302
|
+
initialPosition.current = current;
|
|
4303
|
+
currentPosition.current = current;
|
|
4299
4304
|
window.addEventListener('mouseup', handleEnd, { once: true });
|
|
4300
4305
|
window.addEventListener('touchend', handleEnd, { once: true });
|
|
4301
4306
|
window.addEventListener('touchcancel', handleEnd, { once: true });
|
|
@@ -4305,20 +4310,20 @@ function useResizeHandlers({ onStart, onMove, onEnd }) {
|
|
|
4305
4310
|
document.body.style.setProperty('-webkit-user-select', 'none');
|
|
4306
4311
|
document.body.style.setProperty('cursor', 'col-resize');
|
|
4307
4312
|
onStart();
|
|
4308
|
-
}, [handleEnd, handleMove, onStart]);
|
|
4313
|
+
}, [handleEnd, handleMove, onStart, direction]);
|
|
4309
4314
|
return {
|
|
4310
4315
|
onMouseDown: handleStart,
|
|
4311
4316
|
onTouchStart: handleStart,
|
|
4312
4317
|
};
|
|
4313
4318
|
}
|
|
4314
4319
|
function useResizableDrawerItem(params) {
|
|
4315
|
-
const { direction, width, minResizeWidth = DRAWER_ITEM_MIN_RESIZE_WIDTH, maxResizeWidth = DRAWER_ITEM_MAX_RESIZE_WIDTH, onResizeStart, onResize, } = params;
|
|
4320
|
+
const { direction = 'left', width, minResizeWidth = DRAWER_ITEM_MIN_RESIZE_WIDTH, maxResizeWidth = DRAWER_ITEM_MAX_RESIZE_WIDTH, onResizeStart, onResize, } = params;
|
|
4316
4321
|
const [isResizing, setIsResizing] = React__namespace.useState(false);
|
|
4317
4322
|
const [resizeDelta, setResizeDelta] = React__namespace.useState(0);
|
|
4318
4323
|
const [internalWidth, setInternalWidth] = React__namespace.useState(width !== null && width !== undefined ? width : DRAWER_ITEM_INITIAL_RESIZE_WIDTH);
|
|
4319
4324
|
const getClampedWidth = React__namespace.useCallback((width) => Math.min(Math.max(width, minResizeWidth), maxResizeWidth), [minResizeWidth, maxResizeWidth]);
|
|
4320
4325
|
const getResizedWidth = React__namespace.useCallback((delta) => {
|
|
4321
|
-
const signedDelta =
|
|
4326
|
+
const signedDelta = ['right', 'bottom'].includes(direction) ? delta : -delta;
|
|
4322
4327
|
const newWidth = (width !== null && width !== undefined ? width : internalWidth) + signedDelta;
|
|
4323
4328
|
return getClampedWidth(newWidth);
|
|
4324
4329
|
}, [width, internalWidth, direction, getClampedWidth]);
|
|
@@ -4339,11 +4344,16 @@ function useResizableDrawerItem(params) {
|
|
|
4339
4344
|
const displayWidth = isResizing
|
|
4340
4345
|
? getResizedWidth(resizeDelta)
|
|
4341
4346
|
: getClampedWidth(width !== null && width !== undefined ? width : internalWidth);
|
|
4342
|
-
const handlers = useResizeHandlers({
|
|
4347
|
+
const handlers = useResizeHandlers({
|
|
4348
|
+
onStart,
|
|
4349
|
+
onMove,
|
|
4350
|
+
onEnd,
|
|
4351
|
+
direction: ['left', 'right'].includes(direction) ? 'horizontal' : 'vertical',
|
|
4352
|
+
});
|
|
4343
4353
|
return { resizedWidth: displayWidth, resizerHandlers: handlers, isResizing };
|
|
4344
4354
|
}
|
|
4345
4355
|
|
|
4346
|
-
var css_248z$l = ".gn-drawer{--_--item-shadow-default:0 1px 5px 0 var(--g-color-sfx-shadow);--_--item-position:fixed;--_--resizer-width:8px;--_--resizer-color:var(--g-color-base-generic);--_--resizer-handle-color:var(--g-color-line-generic);--_--resizer-handle-color-hover:var(--g-color-line-generic-hover);--_--resizer-z-index:100;--_--veil-background-color:var(--g-color-sfx-veil);pointer-events:none}.gn-drawer_hideVeil{--_--item-shadow:var(--gn-drawer-item-shadow,var(--_--item-shadow-default))}.gn-drawer__item{background-color:var(--g-color-base-background);bottom:0;box-shadow:var(--_--item-shadow,none);height:100%;left:var(--gn-aside-header-size,0);pointer-events:auto;position:var(--gn-drawer-item-position,var(--_--item-position));top:0;will-change:transform;z-index:var(--gn-drawer-item-z-index)}.gn-drawer__item_direction_right{left:auto;right:0}.gn-drawer__item-transition-enter{transform:translate(-100%)}.gn-drawer__item-transition_direction_right-enter{transform:translate(100%)}.gn-drawer__item-transition-enter-active,.gn-drawer__item-transition_direction_right-enter-active{transform:translate(0);transition:transform .3s}.gn-drawer__item-transition-enter-done,.gn-drawer__item-transition_direction_right-enter-done{filter:blur(0);transform:translateZ(0)}.gn-drawer__item-transition-exit,.gn-drawer__item-transition_direction_right-exit{transform:translate(0)}.gn-drawer__item-transition-exit-active,.gn-drawer__item-transition_direction_right-exit-active{transition:transform .3s}.gn-drawer__item-transition-exit-active{transform:translate(-100%)}.gn-drawer__item-transition_direction_right-exit-active{transform:translate(100%)}.gn-drawer__item-transition-exit-done,.gn-drawer__item-transition_direction_right-exit-done,.gn-drawer__item_hidden{visibility:hidden}.gn-drawer__veil{background-color:var(--gn-drawer-veil-background-color,var(--_--veil-background-color));inset:0;pointer-events:auto;position:absolute;z-index:var(--gn-drawer-veil-z-index)}.gn-drawer__veil_hidden{display:none}.gn-drawer__veil-transition-enter{opacity:0}.gn-drawer__veil-transition-enter-active{opacity:1;transition:opacity .3s}.gn-drawer__veil-transition-exit{opacity:1}.gn-drawer__veil-transition-exit-active{opacity:0;transition:opacity .3s}.gn-drawer__veil-transition-exit-done{visibility:hidden}.gn-drawer__resizer-handle{background:var(--gn-drawer-item-resizer-handle-color,var(--_--resizer-handle-color));border-radius:2px;height:28px;width:2px}.gn-drawer__resizer{align-items:center;background:var(--gn-drawer-item-resizer-color,var(--_--resizer-color));cursor:col-resize;display:flex;flex-direction:column;height:100%;justify-content:center;position:absolute;top:0;width:var(--gn-drawer-item-resizer-width,var(--_--resizer-width));z-index:var(--gn-drawer-item-resizer-z-index,var(--_--resizer-z-index))}.gn-drawer__resizer_direction_right{left:0}.gn-drawer__resizer_direction_left{right:0}.gn-drawer__resizer:hover .gn-drawer__resizer-handle{background:var(--gn-drawer-item-resizer-handle-color-hover,var(--_--resizer-handle-color-hover))}";
|
|
4356
|
+
var css_248z$l = ".gn-drawer{--_--item-shadow-default:0 1px 5px 0 var(--g-color-sfx-shadow);--_--item-position:fixed;--_--resizer-width:8px;--_--resizer-color:var(--g-color-base-generic);--_--resizer-handle-color:var(--g-color-line-generic);--_--resizer-handle-color-hover:var(--g-color-line-generic-hover);--_--resizer-z-index:100;--_--veil-background-color:var(--g-color-sfx-veil);pointer-events:none}.gn-drawer_hideVeil{--_--item-shadow:var(--gn-drawer-item-shadow,var(--_--item-shadow-default))}.gn-drawer__item{background-color:var(--g-color-base-background);bottom:0;box-shadow:var(--_--item-shadow,none);height:100%;left:var(--gn-aside-header-size,0);pointer-events:auto;position:var(--gn-drawer-item-position,var(--_--item-position));top:0;will-change:transform;z-index:var(--gn-drawer-item-z-index)}.gn-drawer__item_direction_right{left:auto;right:0}.gn-drawer__item_direction_top{bottom:auto;right:0}.gn-drawer__item_direction_bottom{right:0;top:auto}.gn-drawer__item-transition-enter{transform:translate(-100%)}.gn-drawer__item-transition_direction_right-enter{transform:translate(100%)}.gn-drawer__item-transition_direction_top-enter{transform:translateY(-100%)}.gn-drawer__item-transition_direction_bottom-enter{transform:translateY(100%)}.gn-drawer__item-transition-enter-active,.gn-drawer__item-transition_direction_bottom-enter-active,.gn-drawer__item-transition_direction_right-enter-active,.gn-drawer__item-transition_direction_top-enter-active{transform:translate(0);transition:transform .3s}.gn-drawer__item-transition-enter-done,.gn-drawer__item-transition_direction_bottom-enter-done,.gn-drawer__item-transition_direction_right-enter-done,.gn-drawer__item-transition_direction_top-enter-done{filter:blur(0);transform:translateZ(0)}.gn-drawer__item-transition-exit,.gn-drawer__item-transition_direction_bottom-exit,.gn-drawer__item-transition_direction_right-exit,.gn-drawer__item-transition_direction_top-exit{transform:translate(0)}.gn-drawer__item-transition-exit-active,.gn-drawer__item-transition_direction_bottom-exit-active,.gn-drawer__item-transition_direction_right-exit-active,.gn-drawer__item-transition_direction_top-exit-active{transition:transform .3s}.gn-drawer__item-transition-exit-active{transform:translate(-100%)}.gn-drawer__item-transition_direction_right-exit-active{transform:translate(100%)}.gn-drawer__item-transition_direction_top-exit-active{transform:translateY(-100%)}.gn-drawer__item-transition_direction_bottom-exit-active{transform:translateY(100%)}.gn-drawer__item-transition-exit-done,.gn-drawer__item-transition_direction_bottom-exit-done,.gn-drawer__item-transition_direction_right-exit-done,.gn-drawer__item-transition_direction_top-exit-done,.gn-drawer__item_hidden{visibility:hidden}.gn-drawer__veil{background-color:var(--gn-drawer-veil-background-color,var(--_--veil-background-color));inset:0;pointer-events:auto;position:absolute;z-index:var(--gn-drawer-veil-z-index)}.gn-drawer__veil_hidden{display:none}.gn-drawer__veil-transition-enter{opacity:0}.gn-drawer__veil-transition-enter-active{opacity:1;transition:opacity .3s}.gn-drawer__veil-transition-exit{opacity:1}.gn-drawer__veil-transition-exit-active{opacity:0;transition:opacity .3s}.gn-drawer__veil-transition-exit-done{visibility:hidden}.gn-drawer__resizer-handle{background:var(--gn-drawer-item-resizer-handle-color,var(--_--resizer-handle-color));border-radius:2px;height:28px;width:2px}.gn-drawer__resizer-handle_direction_bottom,.gn-drawer__resizer-handle_direction_top{height:2px;width:28px}.gn-drawer__resizer{align-items:center;background:var(--gn-drawer-item-resizer-color,var(--_--resizer-color));cursor:col-resize;display:flex;flex-direction:column;height:100%;justify-content:center;position:absolute;top:0;width:var(--gn-drawer-item-resizer-width,var(--_--resizer-width));z-index:var(--gn-drawer-item-resizer-z-index,var(--_--resizer-z-index))}.gn-drawer__resizer_direction_right{left:0}.gn-drawer__resizer_direction_left{right:0}.gn-drawer__resizer_direction_top{bottom:0;left:0;top:unset}.gn-drawer__resizer_direction_bottom{left:0;top:0}.gn-drawer__resizer_direction_bottom,.gn-drawer__resizer_direction_top{height:var(--gn-drawer-item-resizer-width,var(--_--resizer-width));width:100%}.gn-drawer__resizer:hover .gn-drawer__resizer-handle{background:var(--gn-drawer-item-resizer-handle-color-hover,var(--_--resizer-handle-color-hover))}";
|
|
4347
4357
|
styleInject(css_248z$l);
|
|
4348
4358
|
|
|
4349
4359
|
const b$m = block('drawer');
|
|
@@ -4362,17 +4372,26 @@ const DrawerItem = React.forwardRef(function DrawerItem(props, ref) {
|
|
|
4362
4372
|
onResizeStart,
|
|
4363
4373
|
onResize,
|
|
4364
4374
|
});
|
|
4375
|
+
const style = {};
|
|
4376
|
+
if (resizable) {
|
|
4377
|
+
if (['left', 'right'].includes(direction)) {
|
|
4378
|
+
style.width = `${resizedWidth}px`;
|
|
4379
|
+
}
|
|
4380
|
+
else {
|
|
4381
|
+
style.height = `${resizedWidth}px`;
|
|
4382
|
+
}
|
|
4383
|
+
}
|
|
4365
4384
|
React.useEffect(() => {
|
|
4366
4385
|
setInitialRender(true);
|
|
4367
4386
|
}, [direction]);
|
|
4368
4387
|
const resizerElement = resizable ? (React.createElement("div", Object.assign({ className: b$m('resizer', { direction }) }, resizerHandlers),
|
|
4369
|
-
React.createElement("div", { className: b$m('resizer-handle') }))) : null;
|
|
4388
|
+
React.createElement("div", { className: b$m('resizer-handle', { direction }) }))) : null;
|
|
4370
4389
|
return (React.createElement(CSSTransition, { in: visible, timeout: TIMEOUT, mountOnEnter: !keepMounted, unmountOnExit: !keepMounted, classNames: b$m('item-transition', { direction: cssDirection }), nodeRef: itemRef, onEnter: () => setInitialRender(false), onExit: () => setInitialRender(false) },
|
|
4371
4390
|
React.createElement("div", { ref: handleRef, className: b$m('item', {
|
|
4372
4391
|
direction: cssDirection,
|
|
4373
4392
|
hidden: isInitialRender && !visible,
|
|
4374
4393
|
resize: isResizing,
|
|
4375
|
-
}, [className]), style:
|
|
4394
|
+
}, [className]), style: style },
|
|
4376
4395
|
resizerElement, children !== null && children !== undefined ? children : content)));
|
|
4377
4396
|
});
|
|
4378
4397
|
const Drawer = ({ className, veilClassName, children, style, onVeilClick, onEscape, hideVeil, disablePortal = true, keepMounted = false, }) => {
|
|
@@ -5386,7 +5405,7 @@ const OverlapPanel = ({ title, renderContent, className, onClose, action, closeT
|
|
|
5386
5405
|
var css_248z$4 = ".gn-mobile-header{--mobile-header-min-heigth:50px;--mobile-header-icon-size:20px}.gn-mobile-header,.gn-mobile-header__top-alert{background-color:var(--g-color-base-background)}.gn-mobile-header__top-alert{position:sticky;top:0}.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;z-index:var(--gn-mobile-header-z-index,100)}.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__content{overflow:auto}";
|
|
5387
5406
|
styleInject(css_248z$4);
|
|
5388
5407
|
|
|
5389
|
-
const TopAlert = React.lazy(() => Promise.resolve().then(function () { return require('./index-
|
|
5408
|
+
const TopAlert = React.lazy(() => Promise.resolve().then(function () { return require('./index-C2YRXtzs.js'); }).then((module) => ({ default: module.TopAlert })));
|
|
5390
5409
|
const b$4 = block('mobile-header');
|
|
5391
5410
|
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) => {
|
|
5392
5411
|
const targetRef = useForwardRef(ref);
|
|
@@ -5702,4 +5721,4 @@ exports.styleInject = styleInject;
|
|
|
5702
5721
|
exports.useAsideHeaderContext = useAsideHeaderContext;
|
|
5703
5722
|
exports.useSettingsContext = useSettingsContext;
|
|
5704
5723
|
exports.useSettingsSelectionContext = useSettingsSelectionContext;
|
|
5705
|
-
//# sourceMappingURL=index-
|
|
5724
|
+
//# sourceMappingURL=index-B9MdZ4_0.js.map
|