@hh.ru/magritte-ui-modal 8.1.3 → 8.1.4
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/Modal.js +2 -2
- package/Modal.js.map +1 -1
- package/{ModalContentWithHeader-B9LldtIr.js → ModalContentWithHeader-DaoBh99L.js} +6 -4
- package/ModalContentWithHeader-DaoBh99L.js.map +1 -0
- package/ModalContentWithHeader.d.ts +2 -1
- package/ModalContentWithHeader.js +1 -1
- package/ModalHeader.js +1 -1
- package/index.css +77 -73
- package/index.js +1 -1
- package/package.json +2 -2
- package/types.d.ts +2 -1
- package/ModalContentWithHeader-B9LldtIr.js.map +0 -1
package/Modal.js
CHANGED
|
@@ -12,7 +12,7 @@ import { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';
|
|
|
12
12
|
import { isActionBarComponent } from '@hh.ru/magritte-ui-action-bar';
|
|
13
13
|
import { Breakpoint, useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
|
|
14
14
|
import { Layer } from '@hh.ru/magritte-ui-layer';
|
|
15
|
-
import { s as styles, M as ModalContentWithHeader } from './ModalContentWithHeader-
|
|
15
|
+
import { s as styles, M as ModalContentWithHeader } from './ModalContentWithHeader-DaoBh99L.js';
|
|
16
16
|
import { useModalOrder } from './useModalOrder.js';
|
|
17
17
|
import { isValidTreeSelectorWrapper } from '@hh.ru/magritte-ui-tree-selector';
|
|
18
18
|
import '@hh.ru/magritte-common-func-utils';
|
|
@@ -186,7 +186,7 @@ const Modal = forwardRef(({ visible, size = 'medium', title, titleAlignment = 'l
|
|
|
186
186
|
minHeight: typeof minHeight === 'number'
|
|
187
187
|
? `min(calc(100vh - 12px * 2), ${minHeight}px)`
|
|
188
188
|
: undefined,
|
|
189
|
-
}, children: [jsx(ModalContentWithHeader, { ...modalHeaderProps, labelId: labelId, isTreeSelectorChild: isTreeSelectorChild, children: children }), !!footer && (jsx("div", { className: styles.modalFooter, "data-qa": "modal-footer", children: isActionBarComponent(footer)
|
|
189
|
+
}, children: [jsx(ModalContentWithHeader, { ...modalHeaderProps, labelId: labelId, isTreeSelectorChild: isTreeSelectorChild, height: height, children: children }), !!footer && (jsx("div", { className: styles.modalFooter, "data-qa": "modal-footer", children: isActionBarComponent(footer)
|
|
190
190
|
? cloneElement(footer, { type: footer.props.type || 'modal' })
|
|
191
191
|
: footer }))] }) }) }) }), host || document.body);
|
|
192
192
|
});
|
package/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../src/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useLayoutEffect,\n useRef,\n useState,\n useCallback,\n useId,\n useEffect,\n cloneElement,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport { keyboardMatch, keyboardKeys } from '@hh.ru/magritte-common-keyboard';\nimport { disableScroll, TimeoutCallback } from '@hh.ru/magritte-common-modal-helper';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';\nimport { isActionBarComponent } from '@hh.ru/magritte-ui-action-bar';\nimport { useBreakpoint, Breakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { ModalContentWithHeader } from '@hh.ru/magritte-ui-modal/ModalContentWithHeader';\nimport { ModalHeaderProps, ModalProps } from '@hh.ru/magritte-ui-modal/types';\nimport { useModalOrder } from '@hh.ru/magritte-ui-modal/useModalOrder';\nimport { isValidTreeSelectorWrapper } from '@hh.ru/magritte-ui-tree-selector';\n\nimport styles from './modal.less';\n\nconst noop = () => undefined;\n\nconst toNumber = (value: string) => {\n const result = parseInt(value, 10);\n return Number.isInteger(result) ? result : 0;\n};\n\nconst CSS_CLASSES = {\n center: {\n appear: styles.animationEnterCenter,\n appearActive: styles.animationEnterCenterActive,\n enter: styles.animationEnterCenter,\n enterActive: styles.animationEnterCenterActive,\n exit: styles.animationExitCenter,\n exitActive: styles.animationExitCenterActive,\n },\n left: {\n appear: styles.animationEnterLeft,\n appearActive: styles.animationEnterLeftActive,\n enter: styles.animationEnterLeft,\n enterActive: styles.animationEnterLeftActive,\n exit: styles.animationExitLeft,\n exitActive: styles.animationExitLeftActive,\n },\n right: {\n appear: styles.animationEnterRight,\n appearActive: styles.animationEnterRightActive,\n enter: styles.animationEnterRight,\n enterActive: styles.animationEnterRightActive,\n exit: styles.animationExitRight,\n exitActive: styles.animationExitRightActive,\n },\n};\n\nconst INVISIBLE_FOR_BREAKPOINTS = [Breakpoint.XS, Breakpoint.S];\n\nexport const Modal = forwardRef<\n HTMLDivElement,\n ModalProps &\n Omit<HTMLAttributes<HTMLDivElement>, keyof ModalProps | 'role' | 'tabindex' | 'className' | 'aria-labeledby'>\n>(\n (\n {\n visible,\n size = 'medium',\n title,\n titleAlignment = 'left',\n titleSize = 'large',\n titleMaxLines,\n titleElement = 'h2',\n titleDescription,\n titleDescriptionMaxLines,\n titleStyle,\n titleDescriptionStyle,\n children,\n onClose = noop,\n headerImageUrl,\n headerImage,\n headerHeight,\n host,\n options,\n actions,\n actionLink,\n footer,\n disableVerticalPaddings = false,\n disableHorizontalPaddings = false,\n closeByClickOutside = true,\n onAppear,\n onBeforeExit,\n onAfterExit,\n position = 'center',\n height = position === 'center' ? 'content' : 'full-screen',\n minHeight,\n ...rest\n },\n ref\n ) => {\n const isServerEnv = useServerEnv();\n const enableScrollRef = useRef<TimeoutCallback>();\n const onAfterExitRef = useRef(onAfterExit);\n const onBeforeExitRef = useRef(onBeforeExit);\n onAfterExitRef.current = onAfterExit;\n onBeforeExitRef.current = onBeforeExit;\n const [animationTimeout, setAnimationTimeout] = useState<{ enter: number; exit: number }>({\n enter: 0,\n exit: 0,\n });\n const animationTimeoutExitRef = useRef(animationTimeout.exit);\n animationTimeoutExitRef.current = animationTimeout.exit;\n const labelId = useId();\n const additionalProps: { 'aria-labelledby'?: string } = {};\n if (title) {\n additionalProps['aria-labelledby'] = labelId;\n }\n const modalRef = useRef<HTMLDivElement>(null);\n const overlayRef = useRef<HTMLDivElement>(null);\n const modalRefCallback = useMultipleRefs(ref, modalRef);\n\n const isPaddingsDisableAllowed =\n !title &&\n !headerImageUrl &&\n !headerImage &&\n !titleDescription &&\n !footer &&\n !options &&\n !actionLink &&\n !actions;\n const isVerticalPaddingsDisabled = disableVerticalPaddings && isPaddingsDisableAllowed;\n const isHorizontalPaddingsDisabled = disableHorizontalPaddings && isPaddingsDisableAllowed;\n\n const onEntering = useCallback(() => {\n if (!enableScrollRef.current) {\n enableScrollRef.current = disableScroll();\n }\n if (modalRef.current && !modalRef.current.contains(document.activeElement)) {\n modalRef.current.focus();\n }\n }, []);\n\n const onEntered = useCallback(() => {\n onAppear?.();\n }, [onAppear]);\n\n const onExit = useCallback(() => {\n onBeforeExitRef.current?.();\n }, []);\n const onExited = useCallback(() => {\n // оставляем обработку скрола еще и тут\n // чтобы обработать историю со сменой breakpoint\n enableScrollRef.current?.();\n enableScrollRef.current = undefined;\n onAfterExitRef.current?.();\n }, []);\n\n useModalOrder(!!visible && !isServerEnv, modalRef);\n\n const { breakpoint } = useBreakpoint();\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const currentBreakpointVisible = !INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint);\n if (!currentBreakpointVisible) {\n onExit();\n onExited();\n return;\n }\n\n onEntering();\n // visible не должно быть в зависимостях, т.к. этот эффект обрабатывает только изменение брейкпоинта\n // visible обрабатывается CSSTransition\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n }, [breakpoint, onEntering, onExited, onExit]);\n\n useEffect(\n () => () => {\n enableScrollRef.current?.(animationTimeoutExitRef.current);\n enableScrollRef.current = undefined;\n },\n [visible]\n );\n\n useLayoutEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.animationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n setAnimationTimeout({\n enter: toNumber(style.getPropertyValue('--enter-animation-duration')),\n exit: toNumber(style.getPropertyValue('--exit-animation-duration')),\n });\n document.body.removeChild(animationTimeoutElement);\n }, [setAnimationTimeout]);\n\n const overlayEventHandlers = useNoBubbling({\n onKeyDown: (event) => {\n if (keyboardMatch(event.nativeEvent as KeyboardEvent, keyboardKeys.Escape)) {\n onClose(event);\n }\n },\n onMouseDown: (event) => {\n if (!closeByClickOutside || modalRef.current?.contains(event.target as HTMLElement)) {\n return;\n }\n onClose(event);\n },\n });\n\n if (INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint) || isServerEnv) {\n return null;\n }\n\n const modalHeaderProps = {\n title,\n titleElement,\n titleAlignment,\n titleSize,\n titleMaxLines,\n titleDescription,\n titleDescriptionMaxLines,\n titleStyle,\n titleDescriptionStyle,\n headerImageUrl,\n headerImage,\n headerHeight,\n options,\n actions,\n actionLink,\n } as ModalHeaderProps;\n\n const isTreeSelectorChild = isValidTreeSelectorWrapper(children);\n\n return createPortal(\n <CSSTransition\n appear\n in={visible && !isServerEnv}\n nodeRef={overlayRef}\n onEntering={onEntering}\n onEntered={onEntered}\n onExit={onExit}\n onExited={onExited}\n classNames={CSS_CLASSES[position]}\n timeout={animationTimeout}\n unmountOnExit\n >\n <Layer layer=\"modal\">\n <div\n {...overlayEventHandlers}\n ref={overlayRef}\n className={classnames(styles.modalOverlay, {\n [styles.overlayLeft]: position === 'left',\n [styles.overlayRight]: position === 'right',\n })}\n data-qa=\"modal-overlay\"\n >\n <div\n {...rest}\n {...additionalProps}\n role=\"dialog\"\n className={classnames(styles.modal, {\n [styles.sizeSmall]: size === 'small',\n [styles.sizeMedium]: size === 'medium',\n [styles.modalFullHeight]: height === 'full-screen' || isTreeSelectorChild,\n [styles.noVerticalPaddings]: isVerticalPaddingsDisabled,\n [styles.noHorizontalPaddings]: isHorizontalPaddingsDisabled,\n })}\n ref={modalRefCallback}\n tabIndex={0}\n style={{\n height: typeof height === 'number' ? `${height}px` : undefined,\n minHeight:\n typeof minHeight === 'number'\n ? `min(calc(100vh - 12px * 2), ${minHeight}px)`\n : undefined,\n }}\n >\n <ModalContentWithHeader\n {...modalHeaderProps}\n labelId={labelId}\n isTreeSelectorChild={isTreeSelectorChild}\n >\n {children}\n </ModalContentWithHeader>\n {!!footer && (\n <div className={styles.modalFooter} data-qa=\"modal-footer\">\n {isActionBarComponent(footer)\n ? cloneElement(footer, { type: footer.props.type || 'modal' })\n : footer}\n </div>\n )}\n </div>\n </div>\n </Layer>\n </CSSTransition>,\n host || document.body\n );\n }\n);\n\nModal.displayName = 'Modal';\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC;AAE7B,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAI;IAC/B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,IAAA,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG;AAChB,IAAA,MAAM,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC,oBAAoB;QACnC,YAAY,EAAE,MAAM,CAAC,0BAA0B;QAC/C,KAAK,EAAE,MAAM,CAAC,oBAAoB;QAClC,WAAW,EAAE,MAAM,CAAC,0BAA0B;QAC9C,IAAI,EAAE,MAAM,CAAC,mBAAmB;QAChC,UAAU,EAAE,MAAM,CAAC,yBAAyB;AAC/C,KAAA;AACD,IAAA,IAAI,EAAE;QACF,MAAM,EAAE,MAAM,CAAC,kBAAkB;QACjC,YAAY,EAAE,MAAM,CAAC,wBAAwB;QAC7C,KAAK,EAAE,MAAM,CAAC,kBAAkB;QAChC,WAAW,EAA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,EACH;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../src/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useLayoutEffect,\n useRef,\n useState,\n useCallback,\n useId,\n useEffect,\n cloneElement,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport { keyboardMatch, keyboardKeys } from '@hh.ru/magritte-common-keyboard';\nimport { disableScroll, TimeoutCallback } from '@hh.ru/magritte-common-modal-helper';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';\nimport { isActionBarComponent } from '@hh.ru/magritte-ui-action-bar';\nimport { useBreakpoint, Breakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { ModalContentWithHeader } from '@hh.ru/magritte-ui-modal/ModalContentWithHeader';\nimport { ModalHeaderProps, ModalProps } from '@hh.ru/magritte-ui-modal/types';\nimport { useModalOrder } from '@hh.ru/magritte-ui-modal/useModalOrder';\nimport { isValidTreeSelectorWrapper } from '@hh.ru/magritte-ui-tree-selector';\n\nimport styles from './modal.less';\n\nconst noop = () => undefined;\n\nconst toNumber = (value: string) => {\n const result = parseInt(value, 10);\n return Number.isInteger(result) ? result : 0;\n};\n\nconst CSS_CLASSES = {\n center: {\n appear: styles.animationEnterCenter,\n appearActive: styles.animationEnterCenterActive,\n enter: styles.animationEnterCenter,\n enterActive: styles.animationEnterCenterActive,\n exit: styles.animationExitCenter,\n exitActive: styles.animationExitCenterActive,\n },\n left: {\n appear: styles.animationEnterLeft,\n appearActive: styles.animationEnterLeftActive,\n enter: styles.animationEnterLeft,\n enterActive: styles.animationEnterLeftActive,\n exit: styles.animationExitLeft,\n exitActive: styles.animationExitLeftActive,\n },\n right: {\n appear: styles.animationEnterRight,\n appearActive: styles.animationEnterRightActive,\n enter: styles.animationEnterRight,\n enterActive: styles.animationEnterRightActive,\n exit: styles.animationExitRight,\n exitActive: styles.animationExitRightActive,\n },\n};\n\nconst INVISIBLE_FOR_BREAKPOINTS = [Breakpoint.XS, Breakpoint.S];\n\nexport const Modal = forwardRef<\n HTMLDivElement,\n ModalProps &\n Omit<HTMLAttributes<HTMLDivElement>, keyof ModalProps | 'role' | 'tabindex' | 'className' | 'aria-labeledby'>\n>(\n (\n {\n visible,\n size = 'medium',\n title,\n titleAlignment = 'left',\n titleSize = 'large',\n titleMaxLines,\n titleElement = 'h2',\n titleDescription,\n titleDescriptionMaxLines,\n titleStyle,\n titleDescriptionStyle,\n children,\n onClose = noop,\n headerImageUrl,\n headerImage,\n headerHeight,\n host,\n options,\n actions,\n actionLink,\n footer,\n disableVerticalPaddings = false,\n disableHorizontalPaddings = false,\n closeByClickOutside = true,\n onAppear,\n onBeforeExit,\n onAfterExit,\n position = 'center',\n height = position === 'center' ? 'content' : 'full-screen',\n minHeight,\n ...rest\n },\n ref\n ) => {\n const isServerEnv = useServerEnv();\n const enableScrollRef = useRef<TimeoutCallback>();\n const onAfterExitRef = useRef(onAfterExit);\n const onBeforeExitRef = useRef(onBeforeExit);\n onAfterExitRef.current = onAfterExit;\n onBeforeExitRef.current = onBeforeExit;\n const [animationTimeout, setAnimationTimeout] = useState<{ enter: number; exit: number }>({\n enter: 0,\n exit: 0,\n });\n const animationTimeoutExitRef = useRef(animationTimeout.exit);\n animationTimeoutExitRef.current = animationTimeout.exit;\n const labelId = useId();\n const additionalProps: { 'aria-labelledby'?: string } = {};\n if (title) {\n additionalProps['aria-labelledby'] = labelId;\n }\n const modalRef = useRef<HTMLDivElement>(null);\n const overlayRef = useRef<HTMLDivElement>(null);\n const modalRefCallback = useMultipleRefs(ref, modalRef);\n\n const isPaddingsDisableAllowed =\n !title &&\n !headerImageUrl &&\n !headerImage &&\n !titleDescription &&\n !footer &&\n !options &&\n !actionLink &&\n !actions;\n const isVerticalPaddingsDisabled = disableVerticalPaddings && isPaddingsDisableAllowed;\n const isHorizontalPaddingsDisabled = disableHorizontalPaddings && isPaddingsDisableAllowed;\n\n const onEntering = useCallback(() => {\n if (!enableScrollRef.current) {\n enableScrollRef.current = disableScroll();\n }\n if (modalRef.current && !modalRef.current.contains(document.activeElement)) {\n modalRef.current.focus();\n }\n }, []);\n\n const onEntered = useCallback(() => {\n onAppear?.();\n }, [onAppear]);\n\n const onExit = useCallback(() => {\n onBeforeExitRef.current?.();\n }, []);\n const onExited = useCallback(() => {\n // оставляем обработку скрола еще и тут\n // чтобы обработать историю со сменой breakpoint\n enableScrollRef.current?.();\n enableScrollRef.current = undefined;\n onAfterExitRef.current?.();\n }, []);\n\n useModalOrder(!!visible && !isServerEnv, modalRef);\n\n const { breakpoint } = useBreakpoint();\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const currentBreakpointVisible = !INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint);\n if (!currentBreakpointVisible) {\n onExit();\n onExited();\n return;\n }\n\n onEntering();\n // visible не должно быть в зависимостях, т.к. этот эффект обрабатывает только изменение брейкпоинта\n // visible обрабатывается CSSTransition\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n }, [breakpoint, onEntering, onExited, onExit]);\n\n useEffect(\n () => () => {\n enableScrollRef.current?.(animationTimeoutExitRef.current);\n enableScrollRef.current = undefined;\n },\n [visible]\n );\n\n useLayoutEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.animationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n setAnimationTimeout({\n enter: toNumber(style.getPropertyValue('--enter-animation-duration')),\n exit: toNumber(style.getPropertyValue('--exit-animation-duration')),\n });\n document.body.removeChild(animationTimeoutElement);\n }, [setAnimationTimeout]);\n\n const overlayEventHandlers = useNoBubbling({\n onKeyDown: (event) => {\n if (keyboardMatch(event.nativeEvent as KeyboardEvent, keyboardKeys.Escape)) {\n onClose(event);\n }\n },\n onMouseDown: (event) => {\n if (!closeByClickOutside || modalRef.current?.contains(event.target as HTMLElement)) {\n return;\n }\n onClose(event);\n },\n });\n\n if (INVISIBLE_FOR_BREAKPOINTS.includes(breakpoint) || isServerEnv) {\n return null;\n }\n\n const modalHeaderProps = {\n title,\n titleElement,\n titleAlignment,\n titleSize,\n titleMaxLines,\n titleDescription,\n titleDescriptionMaxLines,\n titleStyle,\n titleDescriptionStyle,\n headerImageUrl,\n headerImage,\n headerHeight,\n options,\n actions,\n actionLink,\n } as ModalHeaderProps;\n\n const isTreeSelectorChild = isValidTreeSelectorWrapper(children);\n\n return createPortal(\n <CSSTransition\n appear\n in={visible && !isServerEnv}\n nodeRef={overlayRef}\n onEntering={onEntering}\n onEntered={onEntered}\n onExit={onExit}\n onExited={onExited}\n classNames={CSS_CLASSES[position]}\n timeout={animationTimeout}\n unmountOnExit\n >\n <Layer layer=\"modal\">\n <div\n {...overlayEventHandlers}\n ref={overlayRef}\n className={classnames(styles.modalOverlay, {\n [styles.overlayLeft]: position === 'left',\n [styles.overlayRight]: position === 'right',\n })}\n data-qa=\"modal-overlay\"\n >\n <div\n {...rest}\n {...additionalProps}\n role=\"dialog\"\n className={classnames(styles.modal, {\n [styles.sizeSmall]: size === 'small',\n [styles.sizeMedium]: size === 'medium',\n [styles.modalFullHeight]: height === 'full-screen' || isTreeSelectorChild,\n [styles.noVerticalPaddings]: isVerticalPaddingsDisabled,\n [styles.noHorizontalPaddings]: isHorizontalPaddingsDisabled,\n })}\n ref={modalRefCallback}\n tabIndex={0}\n style={{\n height: typeof height === 'number' ? `${height}px` : undefined,\n minHeight:\n typeof minHeight === 'number'\n ? `min(calc(100vh - 12px * 2), ${minHeight}px)`\n : undefined,\n }}\n >\n <ModalContentWithHeader\n {...modalHeaderProps}\n labelId={labelId}\n isTreeSelectorChild={isTreeSelectorChild}\n height={height}\n >\n {children}\n </ModalContentWithHeader>\n {!!footer && (\n <div className={styles.modalFooter} data-qa=\"modal-footer\">\n {isActionBarComponent(footer)\n ? cloneElement(footer, { type: footer.props.type || 'modal' })\n : footer}\n </div>\n )}\n </div>\n </div>\n </Layer>\n </CSSTransition>,\n host || document.body\n );\n }\n);\n\nModal.displayName = 'Modal';\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC;AAE7B,MAAM,QAAQ,GAAG,CAAC,KAAa,KAAI;IAC/B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,IAAA,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG;AAChB,IAAA,MAAM,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC,oBAAoB;QACnC,YAAY,EAAE,MAAM,CAAC,0BAA0B;QAC/C,KAAK,EAAE,MAAM,CAAC,oBAAoB;QAClC,WAAW,EAAE,MAAM,CAAC,0BAA0B;QAC9C,IAAI,EAAE,MAAM,CAAC,mBAAmB;QAChC,UAAU,EAAE,MAAM,CAAC,yBAAyB;AAC/C,KAAA;AACD,IAAA,IAAI,EAAE;QACF,MAAM,EAAE,MAAM,CAAC,kBAAkB;QACjC,YAAY,EAAE,MAAM,CAAC,wBAAwB;QAC7C,KAAK,EAAE,MAAM,CAAC,kBAAkB;QAChC,WAAW,EAAE,MAAM,CAAC,wBAAwB;QAC5C,IAAI,EAAE,MAAM,CAAC,iBAAiB;QAC9B,UAAU,EAAE,MAAM,CAAC,uBAAuB;AAC7C,KAAA;AACD,IAAA,KAAK,EAAE;QACH,MAAM,EAAE,MAAM,CAAC,mBAAmB;QAClC,YAAY,EAAE,MAAM,CAAC,yBAAyB;QAC9C,KAAK,EAAE,MAAM,CAAC,mBAAmB;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zE,wBAAA,CAAC,MAAM,CAAC,kBAAkB,GAAG,0BAA0B;AACvD,wBAAA,CAAC,MAAM,CAAC,oBAAoB,GAAG,4BAA4B;qBAC9D,CAAC,EACF,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,CAAC,EACX,KAAK,EAAE;AACH,wBAAA,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,GAAG,CAAA,EAAG,MAAM,CAAA,EAAA,CAAI,GAAG,SAAS;AAC9D,wBAAA,SAAS,EACL,OAAO,SAAS,KAAK,QAAQ;8BACvB,CAA+B,4BAAA,EAAA,SAAS,CAAK,GAAA,CAAA;AAC/C,8BAAE,SAAS;AACtB,qBAAA,EAAA,QAAA,EAAA,CAEDD,IAAC,sBAAsB,EAAA,EAAA,GACf,gBAAgB,EACpB,OAAO,EAAE,OAAO,EAChB,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,MAAM,EAEb,QAAA,EAAA,QAAQ,EACY,CAAA,EACxB,CAAC,CAAC,MAAM,KACLA,aAAK,SAAS,EAAE,MAAM,CAAC,WAAW,EAAU,SAAA,EAAA,cAAc,YACrD,oBAAoB,CAAC,MAAM,CAAC;AACzB,kCAAE,YAAY,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;AAC9D,kCAAE,MAAM,EACV,CAAA,CACT,IACC,EACJ,CAAA,EAAA,CACF,EACI,CAAA,EAChB,IAAI,IAAI,QAAQ,CAAC,IAAI,CACxB,CAAC;AACN,CAAC,EACH;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -6,7 +6,7 @@ import { requestAnimation } from '@hh.ru/magritte-common-func-utils';
|
|
|
6
6
|
import { Divider } from '@hh.ru/magritte-ui-divider';
|
|
7
7
|
import { ModalHeader } from './ModalHeader.js';
|
|
8
8
|
|
|
9
|
-
var styles = {"modal-overlay":"magritte-modal-overlay___lK22l_8-1-
|
|
9
|
+
var styles = {"modal-overlay":"magritte-modal-overlay___lK22l_8-1-4","modalOverlay":"magritte-modal-overlay___lK22l_8-1-4","overlay-left":"magritte-overlay-left___JtHK4_8-1-4","overlayLeft":"magritte-overlay-left___JtHK4_8-1-4","overlay-right":"magritte-overlay-right___uKTDt_8-1-4","overlayRight":"magritte-overlay-right___uKTDt_8-1-4","modal":"magritte-modal___RAW6S_8-1-4","size-small":"magritte-size-small___2JTM2_8-1-4","sizeSmall":"magritte-size-small___2JTM2_8-1-4","size-medium":"magritte-size-medium___cWCe7_8-1-4","sizeMedium":"magritte-size-medium___cWCe7_8-1-4","no-vertical-paddings":"magritte-no-vertical-paddings___Z3-oM_8-1-4","noVerticalPaddings":"magritte-no-vertical-paddings___Z3-oM_8-1-4","no-horizontal-paddings":"magritte-no-horizontal-paddings___aT95Y_8-1-4","noHorizontalPaddings":"magritte-no-horizontal-paddings___aT95Y_8-1-4","modal-full-height":"magritte-modal-full-height___gIM4E_8-1-4","modalFullHeight":"magritte-modal-full-height___gIM4E_8-1-4","modal-content":"magritte-modal-content___46QFS_8-1-4","modalContent":"magritte-modal-content___46QFS_8-1-4","modal-content-wrapper":"magritte-modal-content-wrapper___23XFT_8-1-4","modalContentWrapper":"magritte-modal-content-wrapper___23XFT_8-1-4","modal-content-wrapper__one-line":"magritte-modal-content-wrapper__one-line___tYg8d_8-1-4","modalContentWrapperOneLine":"magritte-modal-content-wrapper__one-line___tYg8d_8-1-4","divider-container":"magritte-divider-container___qP3VK_8-1-4","dividerContainer":"magritte-divider-container___qP3VK_8-1-4","divider-container-hidden":"magritte-divider-container-hidden___EIxB-_8-1-4","dividerContainerHidden":"magritte-divider-container-hidden___EIxB-_8-1-4","modal-footer":"magritte-modal-footer___8xPqQ_8-1-4","modalFooter":"magritte-modal-footer___8xPqQ_8-1-4","modal-buttons-container":"magritte-modal-buttons-container___1O1Nr_8-1-4","modalButtonsContainer":"magritte-modal-buttons-container___1O1Nr_8-1-4","animation-timeout":"magritte-animation-timeout___w-j7K_8-1-4","animationTimeout":"magritte-animation-timeout___w-j7K_8-1-4","animation-enter-center":"magritte-animation-enter-center___7jogC_8-1-4","animationEnterCenter":"magritte-animation-enter-center___7jogC_8-1-4","animation-enter-center-active":"magritte-animation-enter-center-active___fywwW_8-1-4","animationEnterCenterActive":"magritte-animation-enter-center-active___fywwW_8-1-4","animation-exit-center":"magritte-animation-exit-center___3Fa6x_8-1-4","animationExitCenter":"magritte-animation-exit-center___3Fa6x_8-1-4","animation-exit-center-active":"magritte-animation-exit-center-active___tY0UA_8-1-4","animationExitCenterActive":"magritte-animation-exit-center-active___tY0UA_8-1-4","animation-enter-left":"magritte-animation-enter-left___5YB8B_8-1-4","animationEnterLeft":"magritte-animation-enter-left___5YB8B_8-1-4","animation-enter-left-active":"magritte-animation-enter-left-active___5GK8s_8-1-4","animationEnterLeftActive":"magritte-animation-enter-left-active___5GK8s_8-1-4","animation-exit-left":"magritte-animation-exit-left___OnkQE_8-1-4","animationExitLeft":"magritte-animation-exit-left___OnkQE_8-1-4","animation-exit-left-active":"magritte-animation-exit-left-active___AEGxY_8-1-4","animationExitLeftActive":"magritte-animation-exit-left-active___AEGxY_8-1-4","animation-enter-right":"magritte-animation-enter-right___2aXOm_8-1-4","animationEnterRight":"magritte-animation-enter-right___2aXOm_8-1-4","animation-enter-right-active":"magritte-animation-enter-right-active___8wX4-_8-1-4","animationEnterRightActive":"magritte-animation-enter-right-active___8wX4-_8-1-4","animation-exit-right":"magritte-animation-exit-right___iczoc_8-1-4","animationExitRight":"magritte-animation-exit-right___iczoc_8-1-4","animation-exit-right-active":"magritte-animation-exit-right-active___eFS4O_8-1-4","animationExitRightActive":"magritte-animation-exit-right-active___eFS4O_8-1-4","content-scroll-preserver":"magritte-content-scroll-preserver___Tw5Px_8-1-4","contentScrollPreserver":"magritte-content-scroll-preserver___Tw5Px_8-1-4","content-sticky-container":"magritte-content-sticky-container___nqEXj_8-1-4","contentStickyContainer":"magritte-content-sticky-container___nqEXj_8-1-4","content-sticky-container_full-height":"magritte-content-sticky-container_full-height___Gl9x8_8-1-4","contentStickyContainerFullHeight":"magritte-content-sticky-container_full-height___Gl9x8_8-1-4"};
|
|
10
10
|
|
|
11
11
|
const checkIsScrolledToBottom = (el) => {
|
|
12
12
|
return Math.abs(el.scrollHeight - el.scrollTop - el.clientHeight) < 1;
|
|
@@ -41,7 +41,7 @@ const shrinkByDelta = (headerImageContainer, headerWrapper, headerMinHeight, hea
|
|
|
41
41
|
Math.floor(headerMaxHeight - scrollDeltaY + HEADER_MARGIN_HEIGHT_DELTA), headerMinHeight, headerMaxHeight);
|
|
42
42
|
headerImageContainer.style.height = `${headerHeight}px`;
|
|
43
43
|
};
|
|
44
|
-
const ModalContentWithHeader = ({ labelId, children, headerHeight: _headerHeight = 0, isTreeSelectorChild, ...modalHeaderProps }) => {
|
|
44
|
+
const ModalContentWithHeader = ({ labelId, children, headerHeight: _headerHeight = 0, isTreeSelectorChild, height, ...modalHeaderProps }) => {
|
|
45
45
|
const { title, headerImageUrl, headerImage, actions, actionLink, options } = modalHeaderProps;
|
|
46
46
|
const bottomDividerVisibleRef = useRef(false);
|
|
47
47
|
const contentContainerRef = useRef(null);
|
|
@@ -123,10 +123,12 @@ const ModalContentWithHeader = ({ labelId, children, headerHeight: _headerHeight
|
|
|
123
123
|
[styles.modalContentWrapperOneLine]: onlyActions,
|
|
124
124
|
}), children: [jsx(ModalHeader, { ...modalHeaderProps, headerHeight: headerHeightRef.current, labelId: labelId, wrapperRef: headerWrapperRef, ref: headerImageContainerRef }), jsx("div", { className: classnames(styles.dividerContainer, {
|
|
125
125
|
[styles.dividerContainerHidden]: !isTopDividerVisible(),
|
|
126
|
-
}), ref: topDividerContainerRef, children: jsx(Divider, {}) }), jsx("div", { className: classnames(styles.modalContent), ref: contentContainerRef, onScroll: handleScroll, "data-qa": "modal-content-scroll-container", children: isTreeSelectorChild ? (children) : (jsxs(Fragment, { children: [jsx("div", { className:
|
|
126
|
+
}), ref: topDividerContainerRef, children: jsx(Divider, {}) }), jsx("div", { className: classnames(styles.modalContent), ref: contentContainerRef, onScroll: handleScroll, "data-qa": "modal-content-scroll-container", children: isTreeSelectorChild ? (children) : (jsxs(Fragment, { children: [jsx("div", { className: classnames(styles.contentStickyContainer, {
|
|
127
|
+
[styles.contentStickyContainerFullHeight]: height === 'full-screen',
|
|
128
|
+
}), ref: stickyContainerRef, children: children }), jsx("div", { ref: spacePreserverRef })] })) })] }), jsx("div", { className: classnames(styles.dividerContainer, {
|
|
127
129
|
[styles.dividerContainerHidden]: !bottomDividerVisibleRef.current,
|
|
128
130
|
}), ref: bottomDividerContainerRef, children: jsx(Divider, {}) })] }));
|
|
129
131
|
};
|
|
130
132
|
|
|
131
133
|
export { ModalContentWithHeader as M, styles as s };
|
|
132
|
-
//# sourceMappingURL=ModalContentWithHeader-
|
|
134
|
+
//# sourceMappingURL=ModalContentWithHeader-DaoBh99L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalContentWithHeader-DaoBh99L.js","sources":["../src/ModalContentWithHeader.tsx"],"sourcesContent":["import { FC, PropsWithChildren, useCallback, useLayoutEffect, useRef } from 'react';\nimport classnames from 'classnames';\n\nimport { requestAnimation } from '@hh.ru/magritte-common-func-utils';\nimport { Divider } from '@hh.ru/magritte-ui-divider';\nimport { ModalHeader } from '@hh.ru/magritte-ui-modal/ModalHeader';\nimport { ModalHeaderProps, ModalHeight } from '@hh.ru/magritte-ui-modal/types';\n\nimport styles from './modal.less';\n\nconst checkIsScrolledToBottom = (el: HTMLElement) => {\n return Math.abs(el.scrollHeight - el.scrollTop - el.clientHeight) < 1;\n};\n\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\n// Минимальная высота до которой может сжаться хедер\nconst HEADER_SHRINK_MIN_HEIGHT = 148;\n// Минимальная высота отступа между хедером и контентом\nconst HEADER_MARGIN_MIN_HEIGHT = 12;\n// Максимальная высота отступа между хедером и контентом\nconst HEADER_MARGIN_MAX_HEIGHT = 24;\nconst HEADER_MARGIN_HEIGHT_DELTA = HEADER_MARGIN_MAX_HEIGHT - HEADER_MARGIN_MIN_HEIGHT;\n\n// Вычисляет минимальную высоту до которой может сжаться хедер с учетом высоты контента, чтобы не спровоцировать\n// изменение размера модалки\nconst calcHeaderShrinkLimit = (\n headerHeight: number,\n headerMaxHeight: number,\n contentHeight: number,\n contentScrollHeight: number,\n marginHeight: number\n) => {\n // Высота контента скрытого под скроллом когда хедер и марджин под ним имеет максимальную допустимую высоту\n const contentScrollDelta =\n contentScrollHeight - // Высота контента скрытого под скроллом в текущем состоянии\n contentHeight + // Высота контейнера содержащего контент\n (HEADER_MARGIN_MAX_HEIGHT - marginHeight) + // Дельта между текущей высотой марджина и максимальной допустимой\n (headerMaxHeight - headerHeight); // Дельта между текущей высотой хедера и максимальной допустимой\n\n const headerShrinkMinHeight = headerMaxHeight - (contentScrollDelta - HEADER_MARGIN_HEIGHT_DELTA);\n\n return Math.max(headerShrinkMinHeight, HEADER_SHRINK_MIN_HEIGHT);\n};\n\nconst shrinkByDelta = (\n headerImageContainer: HTMLDivElement | null,\n headerWrapper: HTMLDivElement | null,\n headerMinHeight: number,\n headerMaxHeight: number,\n scrollDeltaY: number\n) => {\n if (!headerImageContainer || !headerWrapper) {\n return;\n }\n\n const marginHeight = clamp(\n HEADER_MARGIN_MAX_HEIGHT - scrollDeltaY,\n HEADER_MARGIN_MIN_HEIGHT,\n HEADER_MARGIN_MAX_HEIGHT\n );\n headerWrapper.style.marginBottom = `${marginHeight}px`;\n\n const headerHeight = clamp(\n // Тут прибаляем дельту марджина потому что сначала должен сжаться отступ\n Math.floor(headerMaxHeight - scrollDeltaY + HEADER_MARGIN_HEIGHT_DELTA),\n headerMinHeight,\n headerMaxHeight\n );\n headerImageContainer.style.height = `${headerHeight}px`;\n};\n\nexport const ModalContentWithHeader: FC<\n PropsWithChildren<ModalHeaderProps & { labelId: string; isTreeSelectorChild: boolean; height?: ModalHeight }>\n> = ({ labelId, children, headerHeight: _headerHeight = 0, isTreeSelectorChild, height, ...modalHeaderProps }) => {\n const { title, headerImageUrl, headerImage, actions, actionLink, options } = modalHeaderProps;\n\n const bottomDividerVisibleRef = useRef(false);\n const contentContainerRef = useRef<HTMLDivElement>(null);\n const headerImageContainerRef = useRef<HTMLDivElement>(null);\n const headerWrapperRef = useRef<HTMLDivElement>(null);\n const spacePreserverRef = useRef<HTMLDivElement>(null);\n const stickyContainerRef = useRef<HTMLDivElement>(null);\n const hasHeaderImageRef = useRef(!!headerImageUrl || !!headerImage);\n hasHeaderImageRef.current = !!headerImageUrl || !!headerImage;\n const headerHeightRef = useRef(0);\n headerHeightRef.current = hasHeaderImageRef.current ? Math.max(_headerHeight, 200) : 0;\n const minHeaderHeightRef = useRef(0);\n\n const bottomDividerContainerRef = useRef<HTMLDivElement>(null);\n const topDividerContainerRef = useRef<HTMLDivElement>(null);\n\n const withoutHeader = !title && !hasHeaderImageRef.current && !actions && !actionLink && !options;\n const onlyActions = !title && !hasHeaderImageRef.current && !options && (actions || actionLink);\n\n const isTopDividerVisible = () => {\n if (!contentContainerRef.current) {\n return false;\n }\n\n const topDividerVisible = hasHeaderImageRef.current\n ? contentContainerRef.current.scrollTop >\n headerHeightRef.current - minHeaderHeightRef.current + HEADER_MARGIN_HEIGHT_DELTA\n : contentContainerRef.current.scrollTop !== 0;\n\n return topDividerVisible && (options || !hasHeaderImageRef.current) && !onlyActions && !withoutHeader;\n };\n\n const updateHeaderDimensions = useCallback(() => {\n if (\n !headerImageContainerRef.current ||\n !headerWrapperRef.current ||\n !stickyContainerRef.current ||\n !spacePreserverRef.current ||\n !contentContainerRef.current\n ) {\n return;\n }\n\n if (!hasHeaderImageRef.current) {\n spacePreserverRef.current.style.height = '0';\n return;\n }\n\n minHeaderHeightRef.current = calcHeaderShrinkLimit(\n headerImageContainerRef.current.clientHeight,\n headerHeightRef.current,\n contentContainerRef.current.clientHeight,\n stickyContainerRef.current.scrollHeight,\n parseInt(headerWrapperRef.current.style.marginBottom || '0', 10)\n );\n\n shrinkByDelta(\n headerImageContainerRef.current,\n headerWrapperRef.current,\n minHeaderHeightRef.current,\n headerHeightRef.current,\n contentContainerRef.current.scrollTop\n );\n const preserverSize = headerHeightRef.current - minHeaderHeightRef.current + HEADER_MARGIN_HEIGHT_DELTA;\n spacePreserverRef.current.style.height = `${preserverSize}px`;\n }, []);\n\n useLayoutEffect(() => {\n if (contentContainerRef.current) {\n const observer = new ResizeObserver(\n requestAnimation(() => {\n if (!contentContainerRef.current) {\n return;\n }\n const isScrollable =\n contentContainerRef.current.scrollHeight > contentContainerRef.current.clientHeight;\n const hasScroll = isScrollable && !checkIsScrolledToBottom(contentContainerRef.current);\n bottomDividerVisibleRef.current = hasScroll;\n bottomDividerContainerRef.current?.classList.toggle(\n styles.dividerContainerHidden,\n !bottomDividerVisibleRef.current\n );\n updateHeaderDimensions();\n })\n );\n observer.observe(contentContainerRef.current);\n return () => observer.disconnect();\n }\n\n return undefined;\n }, [updateHeaderDimensions]);\n\n useLayoutEffect(() => {\n updateHeaderDimensions();\n if (!options && (headerImageUrl || headerImage)) {\n topDividerContainerRef.current?.classList.toggle(styles.dividerContainerHidden, true);\n }\n }, [headerImageUrl, headerImage, updateHeaderDimensions, options]);\n\n const handleScroll = () => {\n if (!contentContainerRef.current) {\n return;\n }\n\n bottomDividerVisibleRef.current = !checkIsScrolledToBottom(contentContainerRef.current);\n bottomDividerContainerRef.current?.classList.toggle(\n styles.dividerContainerHidden,\n !bottomDividerVisibleRef.current\n );\n topDividerContainerRef.current?.classList.toggle(styles.dividerContainerHidden, !isTopDividerVisible());\n if (hasHeaderImageRef.current) {\n shrinkByDelta(\n headerImageContainerRef.current,\n headerWrapperRef.current,\n minHeaderHeightRef.current,\n headerHeightRef.current,\n contentContainerRef.current.scrollTop\n );\n }\n };\n\n return (\n <>\n <div\n className={classnames(styles.modalContentWrapper, {\n [styles.modalContentWrapperOneLine]: onlyActions,\n })}\n >\n <ModalHeader\n {...modalHeaderProps}\n headerHeight={headerHeightRef.current}\n labelId={labelId}\n wrapperRef={headerWrapperRef}\n ref={headerImageContainerRef}\n />\n <div\n className={classnames(styles.dividerContainer, {\n [styles.dividerContainerHidden]: !isTopDividerVisible(),\n })}\n ref={topDividerContainerRef}\n >\n <Divider />\n </div>\n <div\n className={classnames(styles.modalContent)}\n ref={contentContainerRef}\n onScroll={handleScroll}\n data-qa=\"modal-content-scroll-container\"\n >\n {isTreeSelectorChild ? (\n children\n ) : (\n <>\n <div\n className={classnames(styles.contentStickyContainer, {\n [styles.contentStickyContainerFullHeight]: height === 'full-screen',\n })}\n ref={stickyContainerRef}\n >\n {children}\n </div>\n <div ref={spacePreserverRef} />\n </>\n )}\n </div>\n </div>\n <div\n className={classnames(styles.dividerContainer, {\n [styles.dividerContainerHidden]: !bottomDividerVisibleRef.current,\n })}\n ref={bottomDividerContainerRef}\n >\n <Divider />\n </div>\n </>\n );\n};\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;AAUA,MAAM,uBAAuB,GAAG,CAAC,EAAe,KAAI;AAChD,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAE/F;AACA,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC;AACA,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC;AACA,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC,MAAM,0BAA0B,GAAG,wBAAwB,GAAG,wBAAwB,CAAC;AAEvF;AACA;AACA,MAAM,qBAAqB,GAAG,CAC1B,YAAoB,EACp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ildren } from 'react';
|
|
2
|
-
import { ModalHeaderProps } from '@hh.ru/magritte-ui-modal/types';
|
|
2
|
+
import { ModalHeaderProps, ModalHeight } from '@hh.ru/magritte-ui-modal/types';
|
|
3
3
|
export declare const ModalContentWithHeader: FC<PropsWithChildren<ModalHeaderProps & {
|
|
4
4
|
labelId: string;
|
|
5
5
|
isTreeSelectorChild: boolean;
|
|
6
|
+
height?: ModalHeight;
|
|
6
7
|
}>>;
|
|
@@ -5,7 +5,7 @@ import 'classnames';
|
|
|
5
5
|
import '@hh.ru/magritte-common-func-utils';
|
|
6
6
|
import '@hh.ru/magritte-ui-divider';
|
|
7
7
|
import './ModalHeader.js';
|
|
8
|
-
export { M as ModalContentWithHeader } from './ModalContentWithHeader-
|
|
8
|
+
export { M as ModalContentWithHeader } from './ModalContentWithHeader-DaoBh99L.js';
|
|
9
9
|
import '@hh.ru/magritte-ui-icon';
|
|
10
10
|
import '@hh.ru/magritte-ui-title';
|
|
11
11
|
//# sourceMappingURL=ModalContentWithHeader.js.map
|
package/ModalHeader.js
CHANGED
|
@@ -5,7 +5,7 @@ import classnames from 'classnames';
|
|
|
5
5
|
import { isIconComponent } from '@hh.ru/magritte-ui-icon';
|
|
6
6
|
import { Title } from '@hh.ru/magritte-ui-title';
|
|
7
7
|
|
|
8
|
-
var styles = {"content":"magritte-content___o6ktq_8-1-
|
|
8
|
+
var styles = {"content":"magritte-content___o6ktq_8-1-4","options":"magritte-options___qfErQ_8-1-4","actions":"magritte-actions___nQILV_8-1-4","actions-with-link":"magritte-actions-with-link___hnDux_8-1-4","actionsWithLink":"magritte-actions-with-link___hnDux_8-1-4","content-with-image":"magritte-content-with-image___YarBO_8-1-4","contentWithImage":"magritte-content-with-image___YarBO_8-1-4","actions-single":"magritte-actions-single___usfKu_8-1-4","actionsSingle":"magritte-actions-single___usfKu_8-1-4","image-container":"magritte-image-container___ioL3y_8-1-4","imageContainer":"magritte-image-container___ioL3y_8-1-4","title-wrapper":"magritte-title-wrapper___O--QR_8-1-4","titleWrapper":"magritte-title-wrapper___O--QR_8-1-4","wrapper":"magritte-wrapper___zH8vB_8-1-4"};
|
|
9
9
|
|
|
10
10
|
const ModalHeader = forwardRef(({ title, headerImageUrl, headerImage, headerHeight, titleAlignment, titleElement, titleMaxLines, titleSize, titleDescription, titleDescriptionMaxLines, titleStyle, titleDescriptionStyle, options, actions: _actions, actionLink, labelId, wrapperRef, }, ref) => {
|
|
11
11
|
const actions = Array.isArray(_actions) ? _actions.slice(0, 5) : _actions;
|
package/index.css
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
--magritte-color-component-modal-background-action-v21-4-5:#20262b99;
|
|
11
11
|
--magritte-gradient-component-modal-background-fade-v21-4-5:linear-gradient(180deg, #00000000 0%, #0000007a 100%);
|
|
12
12
|
}
|
|
13
|
-
.magritte-content___o6ktq_8-1-
|
|
13
|
+
.magritte-content___o6ktq_8-1-4{
|
|
14
14
|
display:flex;
|
|
15
15
|
align-items:flex-start;
|
|
16
16
|
}
|
|
17
|
-
.magritte-content___o6ktq_8-1-
|
|
17
|
+
.magritte-content___o6ktq_8-1-4 + .magritte-options___qfErQ_8-1-4{
|
|
18
18
|
margin-top:24px;
|
|
19
19
|
}
|
|
20
|
-
.magritte-actions___nQILV_8-1-
|
|
20
|
+
.magritte-actions___nQILV_8-1-4{
|
|
21
21
|
position:relative;
|
|
22
22
|
z-index:1;
|
|
23
23
|
display:flex;
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
margin-left:auto;
|
|
27
27
|
--magritte-ui-link-padding-override:9px;
|
|
28
28
|
}
|
|
29
|
-
.magritte-actions-with-link___hnDux_8-1-
|
|
29
|
+
.magritte-actions-with-link___hnDux_8-1-4{
|
|
30
30
|
padding:0 8px 0 28px;
|
|
31
31
|
}
|
|
32
|
-
.magritte-content-with-image___YarBO_8-1-
|
|
32
|
+
.magritte-content-with-image___YarBO_8-1-4{
|
|
33
33
|
position:relative;
|
|
34
34
|
flex-direction:column;
|
|
35
35
|
justify-content:flex-end;
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
padding:12px 24px 24px;
|
|
40
40
|
box-sizing:border-box;
|
|
41
41
|
}
|
|
42
|
-
.magritte-content-with-image___YarBO_8-1-
|
|
42
|
+
.magritte-content-with-image___YarBO_8-1-4 .magritte-actions___nQILV_8-1-4{
|
|
43
43
|
order:-1;
|
|
44
44
|
gap:0;
|
|
45
45
|
margin-right:-16px;
|
|
46
46
|
margin-top:-4px;
|
|
47
47
|
margin-bottom:auto;
|
|
48
48
|
}
|
|
49
|
-
.magritte-content-with-image___YarBO_8-1-
|
|
49
|
+
.magritte-content-with-image___YarBO_8-1-4 .magritte-actions___nQILV_8-1-4:not(.magritte-actions-with-link___hnDux_8-1-4){
|
|
50
50
|
padding:0 4px;
|
|
51
51
|
background-color:var(--magritte-color-component-modal-background-action-v21-4-5);
|
|
52
52
|
border-radius:var(--magritte-static-border-radius-300-v21-4-5);
|
|
53
53
|
}
|
|
54
|
-
.magritte-content-with-image___YarBO_8-1-
|
|
54
|
+
.magritte-content-with-image___YarBO_8-1-4 .magritte-actions___nQILV_8-1-4.magritte-actions-single___usfKu_8-1-4:not(.magritte-actions-with-link___hnDux_8-1-4){
|
|
55
55
|
padding:0;
|
|
56
56
|
}
|
|
57
|
-
.magritte-image-container___ioL3y_8-1-
|
|
57
|
+
.magritte-image-container___ioL3y_8-1-4{
|
|
58
58
|
position:absolute;
|
|
59
59
|
left:0;
|
|
60
60
|
bottom:0;
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
background-size:cover;
|
|
63
63
|
--modal-header-gradient:var(--magritte-gradient-component-modal-background-fade-v21-4-5);
|
|
64
64
|
}
|
|
65
|
-
.magritte-title-wrapper___O--QR_8-1-
|
|
65
|
+
.magritte-title-wrapper___O--QR_8-1-4{
|
|
66
66
|
position:relative;
|
|
67
67
|
width:100%;
|
|
68
68
|
}
|
|
69
|
-
.magritte-wrapper___zH8vB_8-1-
|
|
69
|
+
.magritte-wrapper___zH8vB_8-1-4{
|
|
70
70
|
margin-bottom:24px;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
--magritte-color-background-overlay-v21-4-5:#20262b99;
|
|
86
86
|
--magritte-color-component-modal-background-content-v21-4-5:#1B1B1B;
|
|
87
87
|
}
|
|
88
|
-
.magritte-modal-overlay___lK22l_8-1-
|
|
88
|
+
.magritte-modal-overlay___lK22l_8-1-4{
|
|
89
89
|
position:fixed;
|
|
90
90
|
top:0;
|
|
91
91
|
right:0;
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
user-select:text;
|
|
100
100
|
transition-property:opacity, transform;
|
|
101
101
|
}
|
|
102
|
-
.magritte-overlay-left___JtHK4_8-1-
|
|
102
|
+
.magritte-overlay-left___JtHK4_8-1-4{
|
|
103
103
|
justify-content:flex-start;
|
|
104
104
|
}
|
|
105
|
-
.magritte-overlay-right___uKTDt_8-1-
|
|
105
|
+
.magritte-overlay-right___uKTDt_8-1-4{
|
|
106
106
|
justify-content:flex-end;
|
|
107
107
|
}
|
|
108
|
-
.magritte-modal___RAW6S_8-1-
|
|
108
|
+
.magritte-modal___RAW6S_8-1-4{
|
|
109
109
|
display:flex;
|
|
110
110
|
box-sizing:border-box;
|
|
111
111
|
margin:0 12px;
|
|
@@ -120,229 +120,233 @@
|
|
|
120
120
|
width:800px;
|
|
121
121
|
transition-property:opacity, transform;
|
|
122
122
|
}
|
|
123
|
-
.magritte-modal___RAW6S_8-1-
|
|
123
|
+
.magritte-modal___RAW6S_8-1-4.magritte-size-small___2JTM2_8-1-4{
|
|
124
124
|
width:480px;
|
|
125
125
|
}
|
|
126
|
-
.magritte-modal___RAW6S_8-1-
|
|
126
|
+
.magritte-modal___RAW6S_8-1-4.magritte-size-medium___cWCe7_8-1-4{
|
|
127
127
|
width:620px;
|
|
128
128
|
}
|
|
129
|
-
.magritte-no-vertical-paddings___Z3-oM_8-1-
|
|
129
|
+
.magritte-no-vertical-paddings___Z3-oM_8-1-4{
|
|
130
130
|
padding-top:0;
|
|
131
131
|
padding-bottom:0;
|
|
132
132
|
}
|
|
133
|
-
.magritte-no-horizontal-paddings___aT95Y_8-1-
|
|
133
|
+
.magritte-no-horizontal-paddings___aT95Y_8-1-4{
|
|
134
134
|
padding-left:0;
|
|
135
135
|
padding-right:0;
|
|
136
136
|
}
|
|
137
|
-
.magritte-modal-full-height___gIM4E_8-1-
|
|
137
|
+
.magritte-modal-full-height___gIM4E_8-1-4{
|
|
138
138
|
height:100%;
|
|
139
139
|
}
|
|
140
|
-
.magritte-modal-content___46QFS_8-1-
|
|
140
|
+
.magritte-modal-content___46QFS_8-1-4{
|
|
141
141
|
flex:1 1;
|
|
142
142
|
overflow-y:auto;
|
|
143
143
|
padding:0 5px;
|
|
144
144
|
margin:0 -5px;
|
|
145
145
|
overscroll-behavior:none;
|
|
146
146
|
}
|
|
147
|
-
.magritte-modal-content-wrapper___23XFT_8-1-
|
|
147
|
+
.magritte-modal-content-wrapper___23XFT_8-1-4{
|
|
148
148
|
display:flex;
|
|
149
149
|
flex-direction:column;
|
|
150
150
|
min-height:0;
|
|
151
151
|
flex:1 1;
|
|
152
152
|
}
|
|
153
|
-
.magritte-modal-content-wrapper__one-line___tYg8d_8-1-
|
|
153
|
+
.magritte-modal-content-wrapper__one-line___tYg8d_8-1-4{
|
|
154
154
|
flex-direction:row-reverse;
|
|
155
155
|
}
|
|
156
|
-
.magritte-divider-container___qP3VK_8-1-
|
|
156
|
+
.magritte-divider-container___qP3VK_8-1-4{
|
|
157
157
|
margin:0 -24px;
|
|
158
158
|
}
|
|
159
|
-
.magritte-divider-container___qP3VK_8-1-
|
|
159
|
+
.magritte-divider-container___qP3VK_8-1-4.magritte-divider-container-hidden___EIxB-_8-1-4{
|
|
160
160
|
display:none;
|
|
161
161
|
}
|
|
162
|
-
.magritte-modal-footer___8xPqQ_8-1-
|
|
162
|
+
.magritte-modal-footer___8xPqQ_8-1-4{
|
|
163
163
|
margin:0 -24px -24px;
|
|
164
164
|
background-color:var(--magritte-color-component-modal-background-content-v21-4-5);
|
|
165
165
|
z-index:1;
|
|
166
166
|
}
|
|
167
|
-
.magritte-modal-buttons-container___1O1Nr_8-1-
|
|
167
|
+
.magritte-modal-buttons-container___1O1Nr_8-1-4{
|
|
168
168
|
display:flex;
|
|
169
169
|
gap:12px;
|
|
170
170
|
}
|
|
171
|
-
.magritte-animation-timeout___w-j7K_8-1-
|
|
171
|
+
.magritte-animation-timeout___w-j7K_8-1-4{
|
|
172
172
|
--enter-animation-duration:0;
|
|
173
173
|
--exit-animation-duration:0;
|
|
174
174
|
}
|
|
175
175
|
@media (prefers-reduced-motion: no-preference){
|
|
176
|
-
.magritte-animation-timeout___w-j7K_8-1-
|
|
176
|
+
.magritte-animation-timeout___w-j7K_8-1-4{
|
|
177
177
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-5);
|
|
178
178
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v21-4-5);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
.magritte-animation-enter-center___7jogC_8-1-
|
|
181
|
+
.magritte-animation-enter-center___7jogC_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
182
182
|
opacity:0;
|
|
183
183
|
}
|
|
184
|
-
.magritte-animation-enter-center___7jogC_8-1-
|
|
184
|
+
.magritte-animation-enter-center___7jogC_8-1-4 .magritte-modal___RAW6S_8-1-4{
|
|
185
185
|
opacity:0;
|
|
186
186
|
transform:scale(0.96);
|
|
187
187
|
}
|
|
188
|
-
.magritte-animation-enter-center-active___fywwW_8-1-
|
|
188
|
+
.magritte-animation-enter-center-active___fywwW_8-1-4{
|
|
189
189
|
--enter-animation-duration:0;
|
|
190
190
|
--exit-animation-duration:0;
|
|
191
191
|
}
|
|
192
192
|
@media (prefers-reduced-motion: no-preference){
|
|
193
|
-
.magritte-animation-enter-center-active___fywwW_8-1-
|
|
193
|
+
.magritte-animation-enter-center-active___fywwW_8-1-4{
|
|
194
194
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-5);
|
|
195
195
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v21-4-5);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
.magritte-animation-enter-center-active___fywwW_8-1-
|
|
199
|
-
.magritte-animation-enter-center-active___fywwW_8-1-
|
|
198
|
+
.magritte-animation-enter-center-active___fywwW_8-1-4 .magritte-modal___RAW6S_8-1-4,
|
|
199
|
+
.magritte-animation-enter-center-active___fywwW_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
200
200
|
opacity:1;
|
|
201
201
|
transition-duration:var(--enter-animation-duration);
|
|
202
202
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v21-4-5);
|
|
203
203
|
transform:scale(1);
|
|
204
204
|
}
|
|
205
|
-
.magritte-animation-exit-center___3Fa6x_8-1-
|
|
205
|
+
.magritte-animation-exit-center___3Fa6x_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
206
206
|
opacity:1;
|
|
207
207
|
}
|
|
208
|
-
.magritte-animation-exit-center___3Fa6x_8-1-
|
|
208
|
+
.magritte-animation-exit-center___3Fa6x_8-1-4 .magritte-modal___RAW6S_8-1-4{
|
|
209
209
|
opacity:1;
|
|
210
210
|
transform:scale(1);
|
|
211
211
|
}
|
|
212
|
-
.magritte-animation-exit-center-active___tY0UA_8-1-
|
|
212
|
+
.magritte-animation-exit-center-active___tY0UA_8-1-4{
|
|
213
213
|
--enter-animation-duration:0;
|
|
214
214
|
--exit-animation-duration:0;
|
|
215
215
|
}
|
|
216
216
|
@media (prefers-reduced-motion: no-preference){
|
|
217
|
-
.magritte-animation-exit-center-active___tY0UA_8-1-
|
|
217
|
+
.magritte-animation-exit-center-active___tY0UA_8-1-4{
|
|
218
218
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-5);
|
|
219
219
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v21-4-5);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
.magritte-animation-exit-center-active___tY0UA_8-1-
|
|
222
|
+
.magritte-animation-exit-center-active___tY0UA_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
223
223
|
opacity:0;
|
|
224
224
|
}
|
|
225
|
-
.magritte-animation-exit-center-active___tY0UA_8-1-
|
|
225
|
+
.magritte-animation-exit-center-active___tY0UA_8-1-4 .magritte-modal___RAW6S_8-1-4{
|
|
226
226
|
opacity:0;
|
|
227
227
|
transform:scale(0.96);
|
|
228
228
|
}
|
|
229
|
-
.magritte-animation-exit-center-active___tY0UA_8-1-
|
|
230
|
-
.magritte-animation-exit-center-active___tY0UA_8-1-
|
|
229
|
+
.magritte-animation-exit-center-active___tY0UA_8-1-4 .magritte-modal___RAW6S_8-1-4,
|
|
230
|
+
.magritte-animation-exit-center-active___tY0UA_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
231
231
|
transition-duration:var(--exit-animation-duration);
|
|
232
232
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v21-4-5);
|
|
233
233
|
}
|
|
234
|
-
.magritte-animation-enter-left___5YB8B_8-1-
|
|
234
|
+
.magritte-animation-enter-left___5YB8B_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
235
235
|
opacity:0;
|
|
236
236
|
}
|
|
237
|
-
.magritte-animation-enter-left___5YB8B_8-1-
|
|
237
|
+
.magritte-animation-enter-left___5YB8B_8-1-4 .magritte-modal___RAW6S_8-1-4{
|
|
238
238
|
opacity:0;
|
|
239
239
|
transform:translateX(-100%);
|
|
240
240
|
}
|
|
241
|
-
.magritte-animation-enter-left-active___5GK8s_8-1-
|
|
241
|
+
.magritte-animation-enter-left-active___5GK8s_8-1-4{
|
|
242
242
|
--enter-animation-duration:0;
|
|
243
243
|
--exit-animation-duration:0;
|
|
244
244
|
}
|
|
245
245
|
@media (prefers-reduced-motion: no-preference){
|
|
246
|
-
.magritte-animation-enter-left-active___5GK8s_8-1-
|
|
246
|
+
.magritte-animation-enter-left-active___5GK8s_8-1-4{
|
|
247
247
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-5);
|
|
248
248
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v21-4-5);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
.magritte-animation-enter-left-active___5GK8s_8-1-
|
|
252
|
-
.magritte-animation-enter-left-active___5GK8s_8-1-
|
|
251
|
+
.magritte-animation-enter-left-active___5GK8s_8-1-4 .magritte-modal___RAW6S_8-1-4,
|
|
252
|
+
.magritte-animation-enter-left-active___5GK8s_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
253
253
|
opacity:1;
|
|
254
254
|
transition-duration:var(--enter-animation-duration);
|
|
255
255
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v21-4-5);
|
|
256
256
|
transform:translateX(0);
|
|
257
257
|
}
|
|
258
|
-
.magritte-animation-exit-left___OnkQE_8-1-
|
|
258
|
+
.magritte-animation-exit-left___OnkQE_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
259
259
|
opacity:1;
|
|
260
260
|
}
|
|
261
|
-
.magritte-animation-exit-left___OnkQE_8-1-
|
|
261
|
+
.magritte-animation-exit-left___OnkQE_8-1-4 .magritte-modal___RAW6S_8-1-4{
|
|
262
262
|
opacity:1;
|
|
263
263
|
transform:translateX(0);
|
|
264
264
|
}
|
|
265
|
-
.magritte-animation-exit-left-active___AEGxY_8-1-
|
|
265
|
+
.magritte-animation-exit-left-active___AEGxY_8-1-4{
|
|
266
266
|
--enter-animation-duration:0;
|
|
267
267
|
--exit-animation-duration:0;
|
|
268
268
|
}
|
|
269
269
|
@media (prefers-reduced-motion: no-preference){
|
|
270
|
-
.magritte-animation-exit-left-active___AEGxY_8-1-
|
|
270
|
+
.magritte-animation-exit-left-active___AEGxY_8-1-4{
|
|
271
271
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-5);
|
|
272
272
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v21-4-5);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
.magritte-animation-exit-left-active___AEGxY_8-1-
|
|
275
|
+
.magritte-animation-exit-left-active___AEGxY_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
276
276
|
opacity:0;
|
|
277
277
|
}
|
|
278
|
-
.magritte-animation-exit-left-active___AEGxY_8-1-
|
|
278
|
+
.magritte-animation-exit-left-active___AEGxY_8-1-4 .magritte-modal___RAW6S_8-1-4{
|
|
279
279
|
opacity:0;
|
|
280
280
|
transform:translateX(-100%);
|
|
281
281
|
}
|
|
282
|
-
.magritte-animation-exit-left-active___AEGxY_8-1-
|
|
283
|
-
.magritte-animation-exit-left-active___AEGxY_8-1-
|
|
282
|
+
.magritte-animation-exit-left-active___AEGxY_8-1-4 .magritte-modal___RAW6S_8-1-4,
|
|
283
|
+
.magritte-animation-exit-left-active___AEGxY_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
284
284
|
transition-duration:var(--exit-animation-duration);
|
|
285
285
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v21-4-5);
|
|
286
286
|
}
|
|
287
|
-
.magritte-animation-enter-right___2aXOm_8-1-
|
|
287
|
+
.magritte-animation-enter-right___2aXOm_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
288
288
|
opacity:0;
|
|
289
289
|
}
|
|
290
|
-
.magritte-animation-enter-right___2aXOm_8-1-
|
|
290
|
+
.magritte-animation-enter-right___2aXOm_8-1-4 .magritte-modal___RAW6S_8-1-4{
|
|
291
291
|
opacity:0;
|
|
292
292
|
transform:translateX(100%);
|
|
293
293
|
}
|
|
294
|
-
.magritte-animation-enter-right-active___8wX4-_8-1-
|
|
294
|
+
.magritte-animation-enter-right-active___8wX4-_8-1-4{
|
|
295
295
|
--enter-animation-duration:0;
|
|
296
296
|
--exit-animation-duration:0;
|
|
297
297
|
}
|
|
298
298
|
@media (prefers-reduced-motion: no-preference){
|
|
299
|
-
.magritte-animation-enter-right-active___8wX4-_8-1-
|
|
299
|
+
.magritte-animation-enter-right-active___8wX4-_8-1-4{
|
|
300
300
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-5);
|
|
301
301
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v21-4-5);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
.magritte-animation-enter-right-active___8wX4-_8-1-
|
|
305
|
-
.magritte-animation-enter-right-active___8wX4-_8-1-
|
|
304
|
+
.magritte-animation-enter-right-active___8wX4-_8-1-4 .magritte-modal___RAW6S_8-1-4,
|
|
305
|
+
.magritte-animation-enter-right-active___8wX4-_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
306
306
|
opacity:1;
|
|
307
307
|
transition-duration:var(--enter-animation-duration);
|
|
308
308
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-300-timing-function-v21-4-5);
|
|
309
309
|
transform:translateX(0);
|
|
310
310
|
}
|
|
311
|
-
.magritte-animation-exit-right___iczoc_8-1-
|
|
311
|
+
.magritte-animation-exit-right___iczoc_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
312
312
|
opacity:1;
|
|
313
313
|
}
|
|
314
|
-
.magritte-animation-exit-right___iczoc_8-1-
|
|
314
|
+
.magritte-animation-exit-right___iczoc_8-1-4 .magritte-modal___RAW6S_8-1-4{
|
|
315
315
|
opacity:1;
|
|
316
316
|
transform:translateX(0);
|
|
317
317
|
}
|
|
318
|
-
.magritte-animation-exit-right-active___eFS4O_8-1-
|
|
318
|
+
.magritte-animation-exit-right-active___eFS4O_8-1-4{
|
|
319
319
|
--enter-animation-duration:0;
|
|
320
320
|
--exit-animation-duration:0;
|
|
321
321
|
}
|
|
322
322
|
@media (prefers-reduced-motion: no-preference){
|
|
323
|
-
.magritte-animation-exit-right-active___eFS4O_8-1-
|
|
323
|
+
.magritte-animation-exit-right-active___eFS4O_8-1-4{
|
|
324
324
|
--enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-5);
|
|
325
325
|
--exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v21-4-5);
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
.magritte-animation-exit-right-active___eFS4O_8-1-
|
|
328
|
+
.magritte-animation-exit-right-active___eFS4O_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
329
329
|
opacity:0;
|
|
330
330
|
}
|
|
331
|
-
.magritte-animation-exit-right-active___eFS4O_8-1-
|
|
331
|
+
.magritte-animation-exit-right-active___eFS4O_8-1-4 .magritte-modal___RAW6S_8-1-4{
|
|
332
332
|
opacity:0;
|
|
333
333
|
transform:translateX(100%);
|
|
334
334
|
}
|
|
335
|
-
.magritte-animation-exit-right-active___eFS4O_8-1-
|
|
336
|
-
.magritte-animation-exit-right-active___eFS4O_8-1-
|
|
335
|
+
.magritte-animation-exit-right-active___eFS4O_8-1-4 .magritte-modal___RAW6S_8-1-4,
|
|
336
|
+
.magritte-animation-exit-right-active___eFS4O_8-1-4.magritte-modal-overlay___lK22l_8-1-4{
|
|
337
337
|
transition-duration:var(--exit-animation-duration);
|
|
338
338
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v21-4-5);
|
|
339
339
|
}
|
|
340
|
-
.magritte-content-scroll-preserver___Tw5Px_8-1-
|
|
340
|
+
.magritte-content-scroll-preserver___Tw5Px_8-1-4{
|
|
341
341
|
width:100%;
|
|
342
342
|
height:0;
|
|
343
343
|
}
|
|
344
|
-
.magritte-content-sticky-container___nqEXj_8-1-
|
|
344
|
+
.magritte-content-sticky-container___nqEXj_8-1-4{
|
|
345
345
|
position:sticky;
|
|
346
346
|
top:0;
|
|
347
347
|
min-height:100%;
|
|
348
348
|
}
|
|
349
|
+
.magritte-content-sticky-container_full-height___Gl9x8_8-1-4{
|
|
350
|
+
display:flex;
|
|
351
|
+
flex-direction:column;
|
|
352
|
+
}
|
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import '@hh.ru/magritte-common-use-no-bubbling';
|
|
|
14
14
|
import '@hh.ru/magritte-ui-action-bar';
|
|
15
15
|
import '@hh.ru/magritte-ui-breakpoint';
|
|
16
16
|
import '@hh.ru/magritte-ui-layer';
|
|
17
|
-
import './ModalContentWithHeader-
|
|
17
|
+
import './ModalContentWithHeader-DaoBh99L.js';
|
|
18
18
|
import '@hh.ru/magritte-common-func-utils';
|
|
19
19
|
import '@hh.ru/magritte-ui-divider';
|
|
20
20
|
import './ModalHeader.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-modal",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.4",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "dfab2c63aaadcc6005489524881450f308073550"
|
|
51
51
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode, PropsWithChildren, SyntheticEvent } from 'react';
|
|
2
2
|
import { TitleProps } from '@hh.ru/magritte-ui-title';
|
|
3
|
+
export type ModalHeight = 'content' | 'full-screen' | number;
|
|
3
4
|
export interface ModalHeaderBaseProps {
|
|
4
5
|
/** Текст заголовка */
|
|
5
6
|
title?: TitleProps['children'];
|
|
@@ -33,7 +34,7 @@ export interface ModalHeaderBaseProps {
|
|
|
33
34
|
/** Положение компонента на экране, определяет дефолтное значение пропа height */
|
|
34
35
|
position?: 'center' | 'left' | 'right';
|
|
35
36
|
/** Высота (по контенту, во весь экран или фиксированная в пикселях) */
|
|
36
|
-
height?:
|
|
37
|
+
height?: ModalHeight;
|
|
37
38
|
/** Минимальная высота в пикселях. Имеет приоритет перед height. */
|
|
38
39
|
minHeight?: number;
|
|
39
40
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContentWithHeader-B9LldtIr.js","sources":["../src/ModalContentWithHeader.tsx"],"sourcesContent":["import { FC, PropsWithChildren, useCallback, useLayoutEffect, useRef } from 'react';\nimport classnames from 'classnames';\n\nimport { requestAnimation } from '@hh.ru/magritte-common-func-utils';\nimport { Divider } from '@hh.ru/magritte-ui-divider';\nimport { ModalHeader } from '@hh.ru/magritte-ui-modal/ModalHeader';\nimport { ModalHeaderProps } from '@hh.ru/magritte-ui-modal/types';\n\nimport styles from './modal.less';\n\nconst checkIsScrolledToBottom = (el: HTMLElement) => {\n return Math.abs(el.scrollHeight - el.scrollTop - el.clientHeight) < 1;\n};\n\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\n// Минимальная высота до которой может сжаться хедер\nconst HEADER_SHRINK_MIN_HEIGHT = 148;\n// Минимальная высота отступа между хедером и контентом\nconst HEADER_MARGIN_MIN_HEIGHT = 12;\n// Максимальная высота отступа между хедером и контентом\nconst HEADER_MARGIN_MAX_HEIGHT = 24;\nconst HEADER_MARGIN_HEIGHT_DELTA = HEADER_MARGIN_MAX_HEIGHT - HEADER_MARGIN_MIN_HEIGHT;\n\n// Вычисляет минимальную высоту до которой может сжаться хедер с учетом высоты контента, чтобы не спровоцировать\n// изменение размера модалки\nconst calcHeaderShrinkLimit = (\n headerHeight: number,\n headerMaxHeight: number,\n contentHeight: number,\n contentScrollHeight: number,\n marginHeight: number\n) => {\n // Высота контента скрытого под скроллом когда хедер и марджин под ним имеет максимальную допустимую высоту\n const contentScrollDelta =\n contentScrollHeight - // Высота контента скрытого под скроллом в текущем состоянии\n contentHeight + // Высота контейнера содержащего контент\n (HEADER_MARGIN_MAX_HEIGHT - marginHeight) + // Дельта между текущей высотой марджина и максимальной допустимой\n (headerMaxHeight - headerHeight); // Дельта между текущей высотой хедера и максимальной допустимой\n\n const headerShrinkMinHeight = headerMaxHeight - (contentScrollDelta - HEADER_MARGIN_HEIGHT_DELTA);\n\n return Math.max(headerShrinkMinHeight, HEADER_SHRINK_MIN_HEIGHT);\n};\n\nconst shrinkByDelta = (\n headerImageContainer: HTMLDivElement | null,\n headerWrapper: HTMLDivElement | null,\n headerMinHeight: number,\n headerMaxHeight: number,\n scrollDeltaY: number\n) => {\n if (!headerImageContainer || !headerWrapper) {\n return;\n }\n\n const marginHeight = clamp(\n HEADER_MARGIN_MAX_HEIGHT - scrollDeltaY,\n HEADER_MARGIN_MIN_HEIGHT,\n HEADER_MARGIN_MAX_HEIGHT\n );\n headerWrapper.style.marginBottom = `${marginHeight}px`;\n\n const headerHeight = clamp(\n // Тут прибаляем дельту марджина потому что сначала должен сжаться отступ\n Math.floor(headerMaxHeight - scrollDeltaY + HEADER_MARGIN_HEIGHT_DELTA),\n headerMinHeight,\n headerMaxHeight\n );\n headerImageContainer.style.height = `${headerHeight}px`;\n};\n\nexport const ModalContentWithHeader: FC<\n PropsWithChildren<ModalHeaderProps & { labelId: string; isTreeSelectorChild: boolean }>\n> = ({ labelId, children, headerHeight: _headerHeight = 0, isTreeSelectorChild, ...modalHeaderProps }) => {\n const { title, headerImageUrl, headerImage, actions, actionLink, options } = modalHeaderProps;\n\n const bottomDividerVisibleRef = useRef(false);\n const contentContainerRef = useRef<HTMLDivElement>(null);\n const headerImageContainerRef = useRef<HTMLDivElement>(null);\n const headerWrapperRef = useRef<HTMLDivElement>(null);\n const spacePreserverRef = useRef<HTMLDivElement>(null);\n const stickyContainerRef = useRef<HTMLDivElement>(null);\n const hasHeaderImageRef = useRef(!!headerImageUrl || !!headerImage);\n hasHeaderImageRef.current = !!headerImageUrl || !!headerImage;\n const headerHeightRef = useRef(0);\n headerHeightRef.current = hasHeaderImageRef.current ? Math.max(_headerHeight, 200) : 0;\n const minHeaderHeightRef = useRef(0);\n\n const bottomDividerContainerRef = useRef<HTMLDivElement>(null);\n const topDividerContainerRef = useRef<HTMLDivElement>(null);\n\n const withoutHeader = !title && !hasHeaderImageRef.current && !actions && !actionLink && !options;\n const onlyActions = !title && !hasHeaderImageRef.current && !options && (actions || actionLink);\n\n const isTopDividerVisible = () => {\n if (!contentContainerRef.current) {\n return false;\n }\n\n const topDividerVisible = hasHeaderImageRef.current\n ? contentContainerRef.current.scrollTop >\n headerHeightRef.current - minHeaderHeightRef.current + HEADER_MARGIN_HEIGHT_DELTA\n : contentContainerRef.current.scrollTop !== 0;\n\n return topDividerVisible && (options || !hasHeaderImageRef.current) && !onlyActions && !withoutHeader;\n };\n\n const updateHeaderDimensions = useCallback(() => {\n if (\n !headerImageContainerRef.current ||\n !headerWrapperRef.current ||\n !stickyContainerRef.current ||\n !spacePreserverRef.current ||\n !contentContainerRef.current\n ) {\n return;\n }\n\n if (!hasHeaderImageRef.current) {\n spacePreserverRef.current.style.height = '0';\n return;\n }\n\n minHeaderHeightRef.current = calcHeaderShrinkLimit(\n headerImageContainerRef.current.clientHeight,\n headerHeightRef.current,\n contentContainerRef.current.clientHeight,\n stickyContainerRef.current.scrollHeight,\n parseInt(headerWrapperRef.current.style.marginBottom || '0', 10)\n );\n\n shrinkByDelta(\n headerImageContainerRef.current,\n headerWrapperRef.current,\n minHeaderHeightRef.current,\n headerHeightRef.current,\n contentContainerRef.current.scrollTop\n );\n const preserverSize = headerHeightRef.current - minHeaderHeightRef.current + HEADER_MARGIN_HEIGHT_DELTA;\n spacePreserverRef.current.style.height = `${preserverSize}px`;\n }, []);\n\n useLayoutEffect(() => {\n if (contentContainerRef.current) {\n const observer = new ResizeObserver(\n requestAnimation(() => {\n if (!contentContainerRef.current) {\n return;\n }\n const isScrollable =\n contentContainerRef.current.scrollHeight > contentContainerRef.current.clientHeight;\n const hasScroll = isScrollable && !checkIsScrolledToBottom(contentContainerRef.current);\n bottomDividerVisibleRef.current = hasScroll;\n bottomDividerContainerRef.current?.classList.toggle(\n styles.dividerContainerHidden,\n !bottomDividerVisibleRef.current\n );\n updateHeaderDimensions();\n })\n );\n observer.observe(contentContainerRef.current);\n return () => observer.disconnect();\n }\n\n return undefined;\n }, [updateHeaderDimensions]);\n\n useLayoutEffect(() => {\n updateHeaderDimensions();\n if (!options && (headerImageUrl || headerImage)) {\n topDividerContainerRef.current?.classList.toggle(styles.dividerContainerHidden, true);\n }\n }, [headerImageUrl, headerImage, updateHeaderDimensions, options]);\n\n const handleScroll = () => {\n if (!contentContainerRef.current) {\n return;\n }\n\n bottomDividerVisibleRef.current = !checkIsScrolledToBottom(contentContainerRef.current);\n bottomDividerContainerRef.current?.classList.toggle(\n styles.dividerContainerHidden,\n !bottomDividerVisibleRef.current\n );\n topDividerContainerRef.current?.classList.toggle(styles.dividerContainerHidden, !isTopDividerVisible());\n if (hasHeaderImageRef.current) {\n shrinkByDelta(\n headerImageContainerRef.current,\n headerWrapperRef.current,\n minHeaderHeightRef.current,\n headerHeightRef.current,\n contentContainerRef.current.scrollTop\n );\n }\n };\n\n return (\n <>\n <div\n className={classnames(styles.modalContentWrapper, {\n [styles.modalContentWrapperOneLine]: onlyActions,\n })}\n >\n <ModalHeader\n {...modalHeaderProps}\n headerHeight={headerHeightRef.current}\n labelId={labelId}\n wrapperRef={headerWrapperRef}\n ref={headerImageContainerRef}\n />\n <div\n className={classnames(styles.dividerContainer, {\n [styles.dividerContainerHidden]: !isTopDividerVisible(),\n })}\n ref={topDividerContainerRef}\n >\n <Divider />\n </div>\n <div\n className={classnames(styles.modalContent)}\n ref={contentContainerRef}\n onScroll={handleScroll}\n data-qa=\"modal-content-scroll-container\"\n >\n {isTreeSelectorChild ? (\n children\n ) : (\n <>\n <div className={styles.contentStickyContainer} ref={stickyContainerRef}>\n {children}\n </div>\n <div ref={spacePreserverRef} />\n </>\n )}\n </div>\n </div>\n <div\n className={classnames(styles.dividerContainer, {\n [styles.dividerContainerHidden]: !bottomDividerVisibleRef.current,\n })}\n ref={bottomDividerContainerRef}\n >\n <Divider />\n </div>\n </>\n );\n};\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;AAUA,MAAM,uBAAuB,GAAG,CAAC,EAAe,KAAI;AAChD,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAE/F;AACA,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC;AACA,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC;AACA,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC,MAAM,0BAA0B,GAAG,wBAAwB,GAAG,wBAAwB,CAAC;AAEvF;AACA;AACA,MAAM,qBAAqB,GAAG,CAC1B,YAAoB,EACpB,eAAuB,EACvB,aAAqB,EACrB,mBAA2B,EAC3B,YAAoB,KACpB;;AAEA,IAAA,MAAM,kBAAkB,GACpB,mBAAmB;AACnB,QAAA,aAAa;AACb,SAAC,wBAAwB,GAAG,YAAY,CAAC;AACzC,SAAC,eAAe,GAAG,YAAY,CAAC,CAAC;IAErC,MAAM,qBAAqB,GAAG,eAAe,IAAI,kBAAkB,GAAG,0BAA0B,CAAC,CAAC;IAElG,OAAO,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,CAAC;AACrE,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAClB,oBAA2C,EAC3C,aAAoC,EACpC,eAAuB,EACvB,eAAuB,EACvB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