@hh.ru/magritte-ui-drop 7.1.4 → 7.2.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/Drop.js +31 -3
- package/Drop.js.map +1 -1
- package/{DropContainer-BlQVdh6y.js → DropContainer-WqghLfSI.js} +2 -2
- package/{DropContainer-BlQVdh6y.js.map → DropContainer-WqghLfSI.js.map} +1 -1
- package/DropContainer.js +1 -1
- package/index.css +37 -37
- package/index.js +1 -1
- package/package.json +3 -3
package/Drop.js
CHANGED
|
@@ -5,7 +5,7 @@ import classnames from 'classnames';
|
|
|
5
5
|
import { DropBase } from '@hh.ru/magritte-internal-drop-base';
|
|
6
6
|
import { InternalLayerName } from '@hh.ru/magritte-internal-layer-name';
|
|
7
7
|
import { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
|
|
8
|
-
import { s as styles, D as DropContainer } from './DropContainer-
|
|
8
|
+
import { s as styles, D as DropContainer } from './DropContainer-WqghLfSI.js';
|
|
9
9
|
import { PureChildren } from './PureChildren.js';
|
|
10
10
|
import { Layer } from '@hh.ru/magritte-ui-layer';
|
|
11
11
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
@@ -21,9 +21,17 @@ const PLACEMENTS_LIST = [
|
|
|
21
21
|
'bottom-left',
|
|
22
22
|
'bottom-right',
|
|
23
23
|
];
|
|
24
|
+
const isKeyboardInput = (element) => {
|
|
25
|
+
const tagName = element.tagName.toLowerCase();
|
|
26
|
+
const keyboardInputTypes = ['text', 'password', 'email', 'number', 'tel', 'url', 'search'];
|
|
27
|
+
return ((tagName === 'input' && keyboardInputTypes.includes(element.type)) ||
|
|
28
|
+
tagName === 'textarea' ||
|
|
29
|
+
element.hasAttribute('contenteditable'));
|
|
30
|
+
};
|
|
24
31
|
const DropComponent = ({ visible, activatorRef, onClose, maxWidth = 320, minHeight = 200, width, space = 600, children, footer, role = 'dialog', dividerState = 'show', widthEqualToActivator = false, allowShrinkHeightToFitIntoViewport = true, autoFocusWhenOpened, closeByClickOutside = true, 'data-qa': dataQA = 'drop', onAppear, onBeforeExit, onAfterExit, placement, forcePlacement, ignoreIntersections, ...props }, ref) => {
|
|
25
32
|
const { isMobile } = useBreakpoint();
|
|
26
33
|
const [animationTimeout, setAnimationTimeout] = useState(200);
|
|
34
|
+
const [isPlacementLocked, setPlacementLocked] = useState(false);
|
|
27
35
|
const forceUpdateDropMetricsRef = useRef();
|
|
28
36
|
const actualIgnoreIntersections = ignoreIntersections === undefined ? !allowShrinkHeightToFitIntoViewport : ignoreIntersections;
|
|
29
37
|
const placementsList = useMemo(() => {
|
|
@@ -46,6 +54,26 @@ const DropComponent = ({ visible, activatorRef, onClose, maxWidth = 320, minHeig
|
|
|
46
54
|
useEffect(() => {
|
|
47
55
|
forceUpdateDropMetricsRef.current?.();
|
|
48
56
|
}, [maxWidth, space, footer]);
|
|
57
|
+
const focusHandler = (event) => {
|
|
58
|
+
const target = event.target;
|
|
59
|
+
if (!target || !isKeyboardInput(target)) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
setPlacementLocked(true);
|
|
63
|
+
};
|
|
64
|
+
const blurHandler = () => setPlacementLocked(false);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!visible || isMobile || !activatorRef.current) {
|
|
67
|
+
return void 0;
|
|
68
|
+
}
|
|
69
|
+
const activatorElement = activatorRef.current;
|
|
70
|
+
activatorElement.addEventListener('focus', focusHandler);
|
|
71
|
+
activatorElement.addEventListener('blur', blurHandler);
|
|
72
|
+
return () => {
|
|
73
|
+
activatorElement.removeEventListener('focus', focusHandler);
|
|
74
|
+
activatorElement.removeEventListener('blur', blurHandler);
|
|
75
|
+
};
|
|
76
|
+
}, [visible, activatorRef, isMobile]);
|
|
49
77
|
if (isMobile) {
|
|
50
78
|
return null;
|
|
51
79
|
}
|
|
@@ -61,12 +89,12 @@ const DropComponent = ({ visible, activatorRef, onClose, maxWidth = 320, minHeig
|
|
|
61
89
|
enterActive: styles.dropEnterActive,
|
|
62
90
|
exit: styles.dropExit,
|
|
63
91
|
exitActive: styles.dropExitActive,
|
|
64
|
-
}, animationTimeout: animationTimeout, widthEqualToActivator: widthEqualToActivator, allowShrinkHeightToFitIntoViewport: allowShrinkHeightToFitIntoViewport, ignoreIntersections: actualIgnoreIntersections, minHeight: minHeight, ref: ref, onAppear: onAppear, onBeforeExit: onBeforeExit, onAfterExit: onAfterExit, forceDropMetricsUpdate: forceUpdateDropMetricsRef, children: (resizeRefCallbackFactory) => (jsxs("div", { className: classnames(styles.drop, {
|
|
92
|
+
}, animationTimeout: animationTimeout, widthEqualToActivator: widthEqualToActivator, allowShrinkHeightToFitIntoViewport: allowShrinkHeightToFitIntoViewport, ignoreIntersections: actualIgnoreIntersections, minHeight: minHeight, ref: ref, onAppear: onAppear, onBeforeExit: onBeforeExit, onAfterExit: onAfterExit, forceDropMetricsUpdate: forceUpdateDropMetricsRef, lockPlacement: isPlacementLocked, children: (resizeRefCallbackFactory) => (jsxs("div", { className: classnames(styles.drop, {
|
|
65
93
|
[styles.dropSpace300]: space === 300,
|
|
66
94
|
[styles.dropSpace400]: space === 400,
|
|
67
95
|
[styles.dropSpace600]: space === 600,
|
|
68
96
|
[styles.dropWithFooter]: !!footer,
|
|
69
|
-
}), style: widthStyle, "data-qa": dataQA, children: [jsx(DropContainer, { dividerState: !footer ? 'hide' : dividerState, ref: resizeRefCallbackFactory('scroll-container', false, true), children: jsx("div", { ref: resizeRefCallbackFactory('drop-content'), children: jsx(PureChildren, { children: children }) }) }, "drop-container"), footer && (jsx("div", { ref: resizeRefCallbackFactory('drop-footer'), className: styles.dropFooter, children: jsx(PureChildren, { children: footer }) }))] }, "drop-outer-container")) }) }));
|
|
97
|
+
}), style: widthStyle, "data-qa": dataQA, onFocus: focusHandler, onBlur: blurHandler, children: [jsx(DropContainer, { dividerState: !footer ? 'hide' : dividerState, ref: resizeRefCallbackFactory('scroll-container', false, true), children: jsx("div", { ref: resizeRefCallbackFactory('drop-content'), children: jsx(PureChildren, { children: children }) }) }, "drop-container"), footer && (jsx("div", { ref: resizeRefCallbackFactory('drop-footer'), className: styles.dropFooter, children: jsx(PureChildren, { children: footer }) }))] }, "drop-outer-container")) }) }));
|
|
70
98
|
};
|
|
71
99
|
const Drop = forwardRef(DropComponent);
|
|
72
100
|
|
package/Drop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drop.js","sources":["../src/Drop.tsx"],"sourcesContent":["import {\n useMemo,\n useEffect,\n useState,\n type ReactElement,\n ForwardedRef,\n forwardRef,\n useRef,\n RefObject,\n CSSProperties,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { DropBase, type Placement } from '@hh.ru/magritte-internal-drop-base';\nimport { InternalLayerName } from '@hh.ru/magritte-internal-layer-name';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { DropContainer } from '@hh.ru/magritte-ui-drop/DropContainer';\nimport { PureChildren } from '@hh.ru/magritte-ui-drop/PureChildren';\nimport type { DropProps, DropPlacement } from '@hh.ru/magritte-ui-drop/types';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\n\nimport styles from './drop.less';\n\nconst PLACEMENTS_LIST: Placement[] = [\n 'left-top',\n 'left-bottom',\n 'right-top',\n 'right-bottom',\n 'top-left',\n 'top-right',\n 'bottom-left',\n 'bottom-right',\n];\n\nconst DropComponent = (\n {\n visible,\n activatorRef,\n onClose,\n maxWidth = 320,\n minHeight = 200,\n width,\n space = 600,\n children,\n footer,\n role = 'dialog',\n dividerState = 'show',\n widthEqualToActivator = false,\n allowShrinkHeightToFitIntoViewport = true,\n autoFocusWhenOpened,\n closeByClickOutside = true,\n 'data-qa': dataQA = 'drop',\n onAppear,\n onBeforeExit,\n onAfterExit,\n placement,\n forcePlacement,\n ignoreIntersections,\n ...props\n }: DropProps,\n ref: ForwardedRef<HTMLElement>\n): ReactElement | null => {\n const { isMobile } = useBreakpoint();\n const [animationTimeout, setAnimationTimeout] = useState(200);\n const forceUpdateDropMetricsRef = useRef<VoidFunction>();\n\n const actualIgnoreIntersections =\n ignoreIntersections === undefined ? !allowShrinkHeightToFitIntoViewport : ignoreIntersections;\n\n const placementsList = useMemo(() => {\n const placementsArray: DropPlacement[] = Array.isArray(placement) ? placement : [placement];\n return (\n forcePlacement\n ? placementsArray\n : [...placementsArray, ...PLACEMENTS_LIST.filter((place) => !placement.includes(place))]\n ) as Placement[];\n }, [placement, forcePlacement]);\n\n useEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.dropAnimationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n const animationTimeout = parseInt(style.getPropertyValue(`--animation-duration`), 10);\n if (Number.isInteger(animationTimeout)) {\n setAnimationTimeout(animationTimeout);\n }\n document.body.removeChild(animationTimeoutElement);\n }, []);\n\n useEffect(() => {\n forceUpdateDropMetricsRef.current?.();\n }, [maxWidth, space, footer]);\n\n if (isMobile) {\n return null;\n }\n\n let widthStyle: CSSProperties;\n if (widthEqualToActivator) {\n widthStyle = { width: '100%' };\n } else {\n widthStyle = width ? { width } : { maxWidth };\n }\n\n return (\n <Layer layer={InternalLayerName.Drop}>\n <DropBase\n {...props}\n visible={visible}\n placement={placementsList}\n activatorRef={activatorRef}\n closeByClickOutside={closeByClickOutside}\n onClose={onClose}\n autoFocusWhenOpened={autoFocusWhenOpened ?? role !== 'status'}\n animationClassNames={{\n enter: styles.dropEnter,\n enterActive: styles.dropEnterActive,\n exit: styles.dropExit,\n exitActive: styles.dropExitActive,\n }}\n animationTimeout={animationTimeout}\n widthEqualToActivator={widthEqualToActivator}\n allowShrinkHeightToFitIntoViewport={allowShrinkHeightToFitIntoViewport}\n ignoreIntersections={actualIgnoreIntersections}\n minHeight={minHeight}\n ref={ref}\n onAppear={onAppear}\n onBeforeExit={onBeforeExit}\n onAfterExit={onAfterExit}\n forceDropMetricsUpdate={forceUpdateDropMetricsRef as RefObject<VoidFunction>}\n >\n {(resizeRefCallbackFactory) => (\n <div\n className={classnames(styles.drop, {\n [styles.dropSpace300]: space === 300,\n [styles.dropSpace400]: space === 400,\n [styles.dropSpace600]: space === 600,\n [styles.dropWithFooter]: !!footer,\n })}\n style={widthStyle}\n data-qa={dataQA}\n key=\"drop-outer-container\"\n >\n <DropContainer\n key=\"drop-container\"\n dividerState={!footer ? 'hide' : dividerState}\n ref={resizeRefCallbackFactory('scroll-container', false, true)}\n >\n <div ref={resizeRefCallbackFactory('drop-content')}>\n <PureChildren>{children}</PureChildren>\n </div>\n </DropContainer>\n {footer && (\n <div ref={resizeRefCallbackFactory('drop-footer')} className={styles.dropFooter}>\n <PureChildren>{footer}</PureChildren>\n </div>\n )}\n </div>\n )}\n </DropBase>\n </Layer>\n );\n};\n\nconst Drop = forwardRef<HTMLElement, DropProps>(DropComponent);\nexport { Drop };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;AAuBA,MAAM,eAAe,GAAgB;IACjC,UAAU;IACV,aAAa;IACb,WAAW;IACX,cAAc;IACd,UAAU;IACV,WAAW;IACX,aAAa;IACb,cAAc;CACjB,CAAC;AAEF,MAAM,aAAa,GAAG,CAClB,EACI,OAAO,EACP,YAAY,EACZ,OAAO,EACP,QAAQ,GAAG,GAAG,EACd,SAAS,GAAG,GAAG,EACf,KAAK,EACL,KAAK,GAAG,GAAG,EACX,QAAQ,EACR,MAAM,EACN,IAAI,GAAG,QAAQ,EACf,YAAY,GAAG,MAAM,EACrB,qBAAqB,GAAG,KAAK,EAC7B,kCAAkC,GAAG,IAAI,EACzC,mBAAmB,EACnB,mBAAmB,GAAG,IAAI,EAC1B,SAAS,EAAE,MAAM,GAAG,MAAM,EAC1B,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,GAAG,KAAK,EACA,EACZ,GAA8B,KACT;AACrB,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,C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type ReactElement,\n ForwardedRef,\n forwardRef,\n useRef,\n RefObject,\n CSSProperties,\n type FocusEvent,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { DropBase, type Placement } from '@hh.ru/magritte-internal-drop-base';\nimport { InternalLayerName } from '@hh.ru/magritte-internal-layer-name';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { DropContainer } from '@hh.ru/magritte-ui-drop/DropContainer';\nimport { PureChildren } from '@hh.ru/magritte-ui-drop/PureChildren';\nimport type { DropProps, DropPlacement } from '@hh.ru/magritte-ui-drop/types';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\n\nimport styles from './drop.less';\n\nconst PLACEMENTS_LIST: Placement[] = [\n 'left-top',\n 'left-bottom',\n 'right-top',\n 'right-bottom',\n 'top-left',\n 'top-right',\n 'bottom-left',\n 'bottom-right',\n];\n\nconst isKeyboardInput = (element: HTMLElement): boolean => {\n const tagName = element.tagName.toLowerCase();\n const keyboardInputTypes = ['text', 'password', 'email', 'number', 'tel', 'url', 'search'];\n return (\n (tagName === 'input' && keyboardInputTypes.includes((element as HTMLInputElement).type)) ||\n tagName === 'textarea' ||\n element.hasAttribute('contenteditable')\n );\n};\n\nconst DropComponent = (\n {\n visible,\n activatorRef,\n onClose,\n maxWidth = 320,\n minHeight = 200,\n width,\n space = 600,\n children,\n footer,\n role = 'dialog',\n dividerState = 'show',\n widthEqualToActivator = false,\n allowShrinkHeightToFitIntoViewport = true,\n autoFocusWhenOpened,\n closeByClickOutside = true,\n 'data-qa': dataQA = 'drop',\n onAppear,\n onBeforeExit,\n onAfterExit,\n placement,\n forcePlacement,\n ignoreIntersections,\n ...props\n }: DropProps,\n ref: ForwardedRef<HTMLElement>\n): ReactElement | null => {\n const { isMobile } = useBreakpoint();\n const [animationTimeout, setAnimationTimeout] = useState(200);\n const [isPlacementLocked, setPlacementLocked] = useState(false);\n const forceUpdateDropMetricsRef = useRef<VoidFunction>();\n\n const actualIgnoreIntersections =\n ignoreIntersections === undefined ? !allowShrinkHeightToFitIntoViewport : ignoreIntersections;\n\n const placementsList = useMemo(() => {\n const placementsArray: DropPlacement[] = Array.isArray(placement) ? placement : [placement];\n return (\n forcePlacement\n ? placementsArray\n : [...placementsArray, ...PLACEMENTS_LIST.filter((place) => !placement.includes(place))]\n ) as Placement[];\n }, [placement, forcePlacement]);\n\n useEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.dropAnimationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n const animationTimeout = parseInt(style.getPropertyValue(`--animation-duration`), 10);\n if (Number.isInteger(animationTimeout)) {\n setAnimationTimeout(animationTimeout);\n }\n document.body.removeChild(animationTimeoutElement);\n }, []);\n\n useEffect(() => {\n forceUpdateDropMetricsRef.current?.();\n }, [maxWidth, space, footer]);\n\n const focusHandler = (event: Event | FocusEvent) => {\n const target = event.target;\n if (!target || !isKeyboardInput(target as HTMLElement)) {\n return;\n }\n setPlacementLocked(true);\n };\n const blurHandler = () => setPlacementLocked(false);\n\n useEffect(() => {\n if (!visible || isMobile || !activatorRef.current) {\n return void 0;\n }\n\n const activatorElement = activatorRef.current;\n activatorElement.addEventListener('focus', focusHandler);\n activatorElement.addEventListener('blur', blurHandler);\n return () => {\n activatorElement.removeEventListener('focus', focusHandler);\n activatorElement.removeEventListener('blur', blurHandler);\n };\n }, [visible, activatorRef, isMobile]);\n\n if (isMobile) {\n return null;\n }\n\n let widthStyle: CSSProperties;\n if (widthEqualToActivator) {\n widthStyle = { width: '100%' };\n } else {\n widthStyle = width ? { width } : { maxWidth };\n }\n\n return (\n <Layer layer={InternalLayerName.Drop}>\n <DropBase\n {...props}\n visible={visible}\n placement={placementsList}\n activatorRef={activatorRef}\n closeByClickOutside={closeByClickOutside}\n onClose={onClose}\n autoFocusWhenOpened={autoFocusWhenOpened ?? role !== 'status'}\n animationClassNames={{\n enter: styles.dropEnter,\n enterActive: styles.dropEnterActive,\n exit: styles.dropExit,\n exitActive: styles.dropExitActive,\n }}\n animationTimeout={animationTimeout}\n widthEqualToActivator={widthEqualToActivator}\n allowShrinkHeightToFitIntoViewport={allowShrinkHeightToFitIntoViewport}\n ignoreIntersections={actualIgnoreIntersections}\n minHeight={minHeight}\n ref={ref}\n onAppear={onAppear}\n onBeforeExit={onBeforeExit}\n onAfterExit={onAfterExit}\n forceDropMetricsUpdate={forceUpdateDropMetricsRef as RefObject<VoidFunction>}\n lockPlacement={isPlacementLocked}\n >\n {(resizeRefCallbackFactory) => (\n <div\n className={classnames(styles.drop, {\n [styles.dropSpace300]: space === 300,\n [styles.dropSpace400]: space === 400,\n [styles.dropSpace600]: space === 600,\n [styles.dropWithFooter]: !!footer,\n })}\n style={widthStyle}\n data-qa={dataQA}\n key=\"drop-outer-container\"\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <DropContainer\n key=\"drop-container\"\n dividerState={!footer ? 'hide' : dividerState}\n ref={resizeRefCallbackFactory('scroll-container', false, true)}\n >\n <div ref={resizeRefCallbackFactory('drop-content')}>\n <PureChildren>{children}</PureChildren>\n </div>\n </DropContainer>\n {footer && (\n <div ref={resizeRefCallbackFactory('drop-footer')} className={styles.dropFooter}>\n <PureChildren>{footer}</PureChildren>\n </div>\n )}\n </div>\n )}\n </DropBase>\n </Layer>\n );\n};\n\nconst Drop = forwardRef<HTMLElement, DropProps>(DropComponent);\nexport { Drop };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;AAwBA,MAAM,eAAe,GAAgB;IACjC,UAAU;IACV,aAAa;IACb,WAAW;IACX,cAAc;IACd,UAAU;IACV,WAAW;IACX,aAAa;IACb,cAAc;CACjB,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAoB,KAAa;IACtD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;AAC9C,IAAA,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAA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AAC,EAAA,QAAA,EAE9DA,aAAK,GAAG,EAAE,wBAAwB,CAAC,cAAc,CAAC,EAC9C,QAAA,EAAAA,GAAA,CAAC,YAAY,EAAE,EAAA,QAAA,EAAA,QAAQ,GAAgB,EACrC,CAAA,EAAA,EANF,gBAAgB,CAOR,EACf,MAAM,KACHA,aAAK,GAAG,EAAE,wBAAwB,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,EAC3E,QAAA,EAAAA,GAAA,CAAC,YAAY,EAAE,EAAA,QAAA,EAAA,MAAM,GAAgB,EACnC,CAAA,CACT,KAjBG,sBAAsB,CAkBxB,CACT,EACM,CAAA,EAAA,CACP,EACV;AACN,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,UAAU,CAAyB,aAAa;;;;"}
|
|
@@ -4,7 +4,7 @@ import { forwardRef, useRef, useCallback, useEffect } from 'react';
|
|
|
4
4
|
import { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';
|
|
5
5
|
import { Divider } from '@hh.ru/magritte-ui-divider';
|
|
6
6
|
|
|
7
|
-
var styles = {"drop":"magritte-drop___Z10P4_7-
|
|
7
|
+
var styles = {"drop":"magritte-drop___Z10P4_7-2-0","drop-container":"magritte-drop-container___dbMt9_7-2-0","dropContainer":"magritte-drop-container___dbMt9_7-2-0","divider-container":"magritte-divider-container___ZCdDW_7-2-0","dividerContainer":"magritte-divider-container___ZCdDW_7-2-0","drop-footer":"magritte-drop-footer___v8ZEO_7-2-0","dropFooter":"magritte-drop-footer___v8ZEO_7-2-0","drop-space-300":"magritte-drop-space-300___41acH_7-2-0","dropSpace300":"magritte-drop-space-300___41acH_7-2-0","drop-space-400":"magritte-drop-space-400___XX1RM_7-2-0","dropSpace400":"magritte-drop-space-400___XX1RM_7-2-0","drop-padding":"magritte-drop-padding___xBiJO_7-2-0","dropPadding":"magritte-drop-padding___xBiJO_7-2-0","drop-space-600":"magritte-drop-space-600___6B1i0_7-2-0","dropSpace600":"magritte-drop-space-600___6B1i0_7-2-0","drop-with-footer":"magritte-drop-with-footer___CgBIV_7-2-0","dropWithFooter":"magritte-drop-with-footer___CgBIV_7-2-0","drop-enter":"magritte-drop-enter___4vEuH_7-2-0","dropEnter":"magritte-drop-enter___4vEuH_7-2-0","drop-exit":"magritte-drop-exit___brFjz_7-2-0","dropExit":"magritte-drop-exit___brFjz_7-2-0","drop-enter-active":"magritte-drop-enter-active___SQUog_7-2-0","dropEnterActive":"magritte-drop-enter-active___SQUog_7-2-0","drop-exit-active":"magritte-drop-exit-active___GB0ET_7-2-0","dropExitActive":"magritte-drop-exit-active___GB0ET_7-2-0","drop-animation-timeout":"magritte-drop-animation-timeout___uO7LF_7-2-0","dropAnimationTimeout":"magritte-drop-animation-timeout___uO7LF_7-2-0"};
|
|
8
8
|
|
|
9
9
|
const DropContainer = forwardRef(({ children, dividerState }, ref) => {
|
|
10
10
|
const dividerRef = useRef(null);
|
|
@@ -55,4 +55,4 @@ const DropContainer = forwardRef(({ children, dividerState }, ref) => {
|
|
|
55
55
|
DropContainer.displayName = 'DropContainer';
|
|
56
56
|
|
|
57
57
|
export { DropContainer as D, styles as s };
|
|
58
|
-
//# sourceMappingURL=DropContainer-
|
|
58
|
+
//# sourceMappingURL=DropContainer-WqghLfSI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropContainer-
|
|
1
|
+
{"version":3,"file":"DropContainer-WqghLfSI.js","sources":["../src/DropContainer.tsx"],"sourcesContent":["import { useRef, type PropsWithChildren, useEffect, useCallback, forwardRef } from 'react';\n\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { Divider } from '@hh.ru/magritte-ui-divider';\nimport type { DividerState } from '@hh.ru/magritte-ui-drop/types';\n\nimport styles from './drop.less';\n\nexport const DropContainer = forwardRef<\n HTMLDivElement,\n PropsWithChildren<{\n dividerState: DividerState;\n }>\n>(({ children, dividerState }, ref) => {\n const dividerRef = useRef<HTMLDivElement>(null);\n const showDividerRef = useRef(false);\n showDividerRef.current = dividerState !== 'hide';\n const contentContainerRef = useRef<HTMLDivElement>(null);\n const contentContainerRefMulti = useMultipleRefs(contentContainerRef, ref);\n\n const updateDividerVisibility = useCallback(\n (showDivider: boolean) => {\n if (!contentContainerRef.current || !dividerRef.current) {\n return;\n }\n if (!showDivider) {\n dividerRef.current.style.visibility = 'hidden';\n return;\n }\n if (contentContainerRef?.current !== null && dividerRef.current) {\n const hasScroll =\n contentContainerRef.current.scrollHeight - contentContainerRef.current.clientHeight > 0;\n dividerRef.current.style.visibility = hasScroll ? 'visible' : 'hidden';\n }\n },\n [contentContainerRef, dividerRef]\n );\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n updateDividerVisibility(showDividerRef.current);\n });\n observer.observe(contentContainerRef.current as Element);\n return () => observer.disconnect();\n }, [updateDividerVisibility]);\n\n useEffect(() => {\n updateDividerVisibility(showDividerRef.current);\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n }, [updateDividerVisibility, showDividerRef.current]);\n\n const props = showDividerRef.current\n ? {\n onScroll: ({ target }: { target: EventTarget }) => {\n const scrollableContainer = target as HTMLDivElement;\n\n if (dividerRef.current && dividerState !== 'showWhenFullyScrolled') {\n const scrollEnded =\n scrollableContainer.scrollTop +\n scrollableContainer.offsetHeight -\n scrollableContainer.scrollHeight ===\n 0;\n\n dividerRef.current.style.visibility = scrollEnded ? 'hidden' : 'visible';\n }\n },\n }\n : {};\n\n return (\n <>\n <div ref={contentContainerRefMulti} className={styles.dropContainer} {...props}>\n {children}\n </div>\n <div ref={dividerRef} className={styles.dividerContainer} data-qa=\"drop-divider\">\n <Divider />\n </div>\n </>\n );\n});\n\nDropContainer.displayName = 'DropContainer';\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;AAQO,MAAM,aAAa,GAAG,UAAU,CAKrC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,GAAG,KAAI;AAClC,IAAA,MAAM,UAA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
3
|
import 'react';
|
|
4
4
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
5
5
|
import '@hh.ru/magritte-ui-divider';
|
|
6
|
-
export { D as DropContainer } from './DropContainer-
|
|
6
|
+
export { D as DropContainer } from './DropContainer-WqghLfSI.js';
|
|
7
7
|
//# sourceMappingURL=DropContainer.js.map
|
package/index.css
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
--magritte-shadow-level-2-blur-v19-1-0:16px;
|
|
24
24
|
--magritte-shadow-level-2-spread-v19-1-0:0px;
|
|
25
25
|
}
|
|
26
|
-
.magritte-drop___Z10P4_7-
|
|
26
|
+
.magritte-drop___Z10P4_7-2-0{
|
|
27
27
|
position:relative;
|
|
28
28
|
display:flex;
|
|
29
29
|
flex-direction:column;
|
|
@@ -34,97 +34,97 @@
|
|
|
34
34
|
height:100%;
|
|
35
35
|
overflow:hidden;
|
|
36
36
|
}
|
|
37
|
-
.magritte-drop-container___dbMt9_7-
|
|
37
|
+
.magritte-drop-container___dbMt9_7-2-0{
|
|
38
38
|
display:block;
|
|
39
39
|
overflow:auto;
|
|
40
40
|
}
|
|
41
|
-
.magritte-divider-container___ZCdDW_7-
|
|
41
|
+
.magritte-divider-container___ZCdDW_7-2-0{
|
|
42
42
|
visibility:hidden;
|
|
43
43
|
}
|
|
44
|
-
.magritte-drop-footer___v8ZEO_7-
|
|
44
|
+
.magritte-drop-footer___v8ZEO_7-2-0{
|
|
45
45
|
display:flex;
|
|
46
46
|
flex-flow:column;
|
|
47
47
|
gap:12px;
|
|
48
48
|
}
|
|
49
|
-
.magritte-drop-space-300___41acH_7-
|
|
50
|
-
.magritte-drop-space-300___41acH_7-
|
|
49
|
+
.magritte-drop-space-300___41acH_7-2-0 .magritte-drop-container___dbMt9_7-2-0,
|
|
50
|
+
.magritte-drop-space-300___41acH_7-2-0 .magritte-drop-footer___v8ZEO_7-2-0{
|
|
51
51
|
padding:var(--magritte-static-space-300-v19-1-0);
|
|
52
52
|
}
|
|
53
|
-
.magritte-drop-space-400___XX1RM_7-
|
|
54
|
-
.magritte-drop-space-400___XX1RM_7-
|
|
55
|
-
.magritte-drop-space-400___XX1RM_7-
|
|
53
|
+
.magritte-drop-space-400___XX1RM_7-2-0 .magritte-drop-padding___xBiJO_7-2-0,
|
|
54
|
+
.magritte-drop-space-400___XX1RM_7-2-0 .magritte-drop-container___dbMt9_7-2-0,
|
|
55
|
+
.magritte-drop-space-400___XX1RM_7-2-0 .magritte-drop-footer___v8ZEO_7-2-0{
|
|
56
56
|
padding:var(--magritte-static-space-400-v19-1-0);
|
|
57
57
|
}
|
|
58
|
-
.magritte-drop-space-600___6B1i0_7-
|
|
59
|
-
.magritte-drop-space-600___6B1i0_7-
|
|
60
|
-
.magritte-drop-space-600___6B1i0_7-
|
|
58
|
+
.magritte-drop-space-600___6B1i0_7-2-0 .magritte-drop-padding___xBiJO_7-2-0,
|
|
59
|
+
.magritte-drop-space-600___6B1i0_7-2-0 .magritte-drop-container___dbMt9_7-2-0,
|
|
60
|
+
.magritte-drop-space-600___6B1i0_7-2-0 .magritte-drop-footer___v8ZEO_7-2-0{
|
|
61
61
|
padding:var(--magritte-static-space-600-v19-1-0);
|
|
62
62
|
}
|
|
63
|
-
.magritte-drop-with-footer___CgBIV_7-
|
|
63
|
+
.magritte-drop-with-footer___CgBIV_7-2-0 .magritte-drop-container___dbMt9_7-2-0{
|
|
64
64
|
padding-bottom:0;
|
|
65
65
|
}
|
|
66
66
|
@media (prefers-reduced-motion: no-preference){
|
|
67
|
-
.magritte-drop-enter___4vEuH_7-
|
|
67
|
+
.magritte-drop-enter___4vEuH_7-2-0 .magritte-drop___Z10P4_7-2-0{
|
|
68
68
|
opacity:0;
|
|
69
69
|
}
|
|
70
|
-
.magritte-drop-exit___brFjz_7-
|
|
71
|
-
.magritte-drop-enter-active___SQUog_7-
|
|
70
|
+
.magritte-drop-exit___brFjz_7-2-0 .magritte-drop___Z10P4_7-2-0,
|
|
71
|
+
.magritte-drop-enter-active___SQUog_7-2-0 .magritte-drop___Z10P4_7-2-0{
|
|
72
72
|
opacity:1;
|
|
73
73
|
}
|
|
74
|
-
.magritte-drop-exit-active___GB0ET_7-
|
|
74
|
+
.magritte-drop-exit-active___GB0ET_7-2-0 .magritte-drop___Z10P4_7-2-0{
|
|
75
75
|
opacity:0;
|
|
76
76
|
}
|
|
77
|
-
.magritte-drop-animation-timeout___uO7LF_7-
|
|
78
|
-
.magritte-drop-enter-active___SQUog_7-
|
|
77
|
+
.magritte-drop-animation-timeout___uO7LF_7-2-0,
|
|
78
|
+
.magritte-drop-enter-active___SQUog_7-2-0 .magritte-drop___Z10P4_7-2-0{
|
|
79
79
|
transition-property:opacity, transform;
|
|
80
80
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v19-1-0);
|
|
81
81
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v19-1-0);
|
|
82
82
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v19-1-0);
|
|
83
83
|
}
|
|
84
|
-
.magritte-drop-animation-timeout___uO7LF_7-
|
|
85
|
-
.magritte-drop-exit-active___GB0ET_7-
|
|
84
|
+
.magritte-drop-animation-timeout___uO7LF_7-2-0,
|
|
85
|
+
.magritte-drop-exit-active___GB0ET_7-2-0 .magritte-drop___Z10P4_7-2-0{
|
|
86
86
|
transition-property:opacity, transform;
|
|
87
87
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v19-1-0);
|
|
88
88
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v19-1-0);
|
|
89
89
|
}
|
|
90
|
-
.magritte-drop-enter___4vEuH_7-
|
|
90
|
+
.magritte-drop-enter___4vEuH_7-2-0[data-magritte-drop-base-direction='top'] .magritte-drop___Z10P4_7-2-0{
|
|
91
91
|
transform:translateY(-4px);
|
|
92
92
|
}
|
|
93
|
-
.magritte-drop-exit-active___GB0ET_7-
|
|
93
|
+
.magritte-drop-exit-active___GB0ET_7-2-0[data-magritte-drop-base-direction='top'] .magritte-drop___Z10P4_7-2-0{
|
|
94
94
|
transform:translateY(-4px);
|
|
95
95
|
}
|
|
96
|
-
.magritte-drop-enter___4vEuH_7-
|
|
96
|
+
.magritte-drop-enter___4vEuH_7-2-0[data-magritte-drop-base-direction='bottom'] .magritte-drop___Z10P4_7-2-0{
|
|
97
97
|
transform:translateY(4px);
|
|
98
98
|
}
|
|
99
|
-
.magritte-drop-exit-active___GB0ET_7-
|
|
99
|
+
.magritte-drop-exit-active___GB0ET_7-2-0[data-magritte-drop-base-direction='bottom'] .magritte-drop___Z10P4_7-2-0{
|
|
100
100
|
transform:translateY(4px);
|
|
101
101
|
}
|
|
102
|
-
.magritte-drop-enter___4vEuH_7-
|
|
102
|
+
.magritte-drop-enter___4vEuH_7-2-0[data-magritte-drop-base-direction='left'] .magritte-drop___Z10P4_7-2-0{
|
|
103
103
|
transform:translateX(-4px);
|
|
104
104
|
}
|
|
105
|
-
.magritte-drop-exit-active___GB0ET_7-
|
|
105
|
+
.magritte-drop-exit-active___GB0ET_7-2-0[data-magritte-drop-base-direction='left'] .magritte-drop___Z10P4_7-2-0{
|
|
106
106
|
transform:translateX(4px);
|
|
107
107
|
}
|
|
108
|
-
.magritte-drop-enter___4vEuH_7-
|
|
108
|
+
.magritte-drop-enter___4vEuH_7-2-0[data-magritte-drop-base-direction='right'] .magritte-drop___Z10P4_7-2-0{
|
|
109
109
|
transform:translateX(4px);
|
|
110
110
|
}
|
|
111
|
-
.magritte-drop-exit-active___GB0ET_7-
|
|
111
|
+
.magritte-drop-exit-active___GB0ET_7-2-0[data-magritte-drop-base-direction='right'] .magritte-drop___Z10P4_7-2-0{
|
|
112
112
|
transform:translateX(4px);
|
|
113
113
|
}
|
|
114
|
-
.magritte-drop-exit___brFjz_7-
|
|
115
|
-
.magritte-drop-enter-active___SQUog_7-
|
|
114
|
+
.magritte-drop-exit___brFjz_7-2-0[data-magritte-drop-base-direction='left'] .magritte-drop___Z10P4_7-2-0,
|
|
115
|
+
.magritte-drop-enter-active___SQUog_7-2-0[data-magritte-drop-base-direction='left'] .magritte-drop___Z10P4_7-2-0{
|
|
116
116
|
transform:translateX(0%);
|
|
117
117
|
}
|
|
118
|
-
.magritte-drop-exit___brFjz_7-
|
|
119
|
-
.magritte-drop-enter-active___SQUog_7-
|
|
118
|
+
.magritte-drop-exit___brFjz_7-2-0[data-magritte-drop-base-direction='bottom'] .magritte-drop___Z10P4_7-2-0,
|
|
119
|
+
.magritte-drop-enter-active___SQUog_7-2-0[data-magritte-drop-base-direction='bottom'] .magritte-drop___Z10P4_7-2-0{
|
|
120
120
|
transform:translateY(0%);
|
|
121
121
|
}
|
|
122
|
-
.magritte-drop-exit___brFjz_7-
|
|
123
|
-
.magritte-drop-enter-active___SQUog_7-
|
|
122
|
+
.magritte-drop-exit___brFjz_7-2-0[data-magritte-drop-base-direction='right'] .magritte-drop___Z10P4_7-2-0,
|
|
123
|
+
.magritte-drop-enter-active___SQUog_7-2-0[data-magritte-drop-base-direction='right'] .magritte-drop___Z10P4_7-2-0{
|
|
124
124
|
transform:translateX(0%);
|
|
125
125
|
}
|
|
126
|
-
.magritte-drop-exit___brFjz_7-
|
|
127
|
-
.magritte-drop-enter-active___SQUog_7-
|
|
126
|
+
.magritte-drop-exit___brFjz_7-2-0[data-magritte-drop-base-direction='top'] .magritte-drop___Z10P4_7-2-0,
|
|
127
|
+
.magritte-drop-enter-active___SQUog_7-2-0[data-magritte-drop-base-direction='top'] .magritte-drop___Z10P4_7-2-0{
|
|
128
128
|
transform:translateY(0%);
|
|
129
129
|
}
|
|
130
130
|
}
|
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import 'classnames';
|
|
|
7
7
|
import '@hh.ru/magritte-internal-drop-base';
|
|
8
8
|
import '@hh.ru/magritte-internal-layer-name';
|
|
9
9
|
import '@hh.ru/magritte-ui-breakpoint';
|
|
10
|
-
import './DropContainer-
|
|
10
|
+
import './DropContainer-WqghLfSI.js';
|
|
11
11
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
12
12
|
import '@hh.ru/magritte-ui-divider';
|
|
13
13
|
import './PureChildren.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-drop",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.4",
|
|
24
24
|
"@hh.ru/magritte-design-tokens": "19.1.0",
|
|
25
|
-
"@hh.ru/magritte-internal-drop-base": "7.0.
|
|
25
|
+
"@hh.ru/magritte-internal-drop-base": "7.0.7",
|
|
26
26
|
"@hh.ru/magritte-internal-layer-name": "2.2.0",
|
|
27
27
|
"@hh.ru/magritte-ui-breakpoint": "4.0.3",
|
|
28
28
|
"@hh.ru/magritte-ui-divider": "1.1.33",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "12abe2b68f9a64a35f1233c0cf03e3951c1193e6"
|
|
40
40
|
}
|