@skbkontur/react-ui 5.6.6 → 5.6.7-aa2dc.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/cjs/internal/CustomComboBox/ComboBoxView.d.ts +1 -4
- package/cjs/internal/CustomComboBox/ComboBoxView.js +1 -0
- package/cjs/internal/CustomComboBox/ComboBoxView.js.map +1 -1
- package/cjs/internal/Popup/Popup.d.ts +7 -0
- package/cjs/internal/Popup/Popup.js +44 -2
- package/cjs/internal/Popup/Popup.js.map +1 -1
- package/cjs/internal/Popup/PopupHelper.d.ts +27 -0
- package/cjs/internal/Popup/PopupHelper.js +125 -2
- package/cjs/internal/Popup/PopupHelper.js.map +1 -1
- package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js +1 -0
- package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js.map +1 -1
- package/internal/CustomComboBox/ComboBoxView.d.ts +1 -4
- package/internal/Popup/Popup/Popup.js +26 -2
- package/internal/Popup/Popup/Popup.js.map +1 -1
- package/internal/Popup/Popup.d.ts +7 -0
- package/internal/Popup/PopupHelper/PopupHelper.js +114 -1
- package/internal/Popup/PopupHelper/PopupHelper.js.map +1 -1
- package/internal/Popup/PopupHelper.d.ts +27 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactTransitionGroup","_warning","_globalObject","_getDOMRect","LayoutEvents","_interopRequireWildcard","_ZIndex","_RenderContainer","_utils","_client","_ThemeContext","_currentEnvironment","_CommonWrapper","_Emotion","_decorator","_MobilePopup","_rootNode","_InstanceWithAnchorElement","_createPropsGetter","_isInstanceOf","_featureFlagsContext","_mergeRefs","_getVisualStateDataAttributes","_PopupPinNew","_PopupHelper","_Popup2","_PopupPin","_class","_Popup","POPUP_BORDER_DEFAULT_COLOR","TRANSITION_TIMEOUT","enter","exit","PopupNonPinnablePositions","exports","PopupPinnablePositions","PopupPositions","concat","DefaultPosition","DUMMY_LOCATION","position","coordinates","top","left","isFullyVisible","PopupDataTids","root","content","contentInner","popupPin","PopupIds","Popup","responsiveLayout","rootNode","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","getProps","createPropsGetter","defaultProps","state","location","props","opened","locationUpdateId","refForTransition","React","createRef","hasAnchorElementListeners","rootId","getRandomID","anchorElement","absoluteParent","renderInPortal","anchor","ref","default","createElement","RenderContainer","isMobileLayout","withoutMobile","renderMobile","renderContent","renderWithoutPortal","EmptyWrapper","updateAbsoluteElement","className","styles","updateAnchorElement","instance","childDomNode","isInstanceWithAnchorElement","getAnchorElement","getRootNode","removeEventListeners","addEventListeners","handleMouseEnter","event","onMouseEnter","handleMouseLeave","onMouseLeave","handleClick","onClick","handleFocus","onFocus","handleBlur","onBlur","calculateWidth","width","includes","anchorWidth","getDOMRect","replace","percent","parseFloat","children","backgroundColor","_this$getProps","minWidth","theme","mergeRefs","refPopupContentElement","style","prepareDataVisualState","_this$state$location","_getVisualStateDataAt","attrName","getVisualStateDataAttributes","resetLocation","cancelDelayedUpdateLocation","setState","element","lastPopupContentElement","handleLayoutEvent","updateLocation","popupContentElement","getLocation","onPositionChange","locationEquals","getRelativeShift","_this2","disablePortal","rect","PopupHelper","getElementAbsoluteRect","_inheritsLoose2","_proto","prototype","componentDidMount","layoutEventsToken","addListener","getDerivedStateFromProps","componentDidUpdate","prevProps","prevState","hadNoLocation","hasLocation","wasClosed","onOpen","onClose","delayUpdateLocation","componentWillUnmount","remove","render","_this3","ReactUIFeatureFlagsContext","Consumer","flags","featureFlags","getFullReactUIFlagsContext","ThemeContext","renderMain","renderChildren","CommonWrapper","rootNodeRef","setRootNode","MobilePopup","withoutRenderContainer","onCloseRequest","mobileOnCloseRequest","_anchor","useWrapper","isInstanceOf","globalObject","Element","isValidElement","anchorWithRef","isRefableElement","cloneElement","canGetAnchorNode","renderRef","renderAnchor","addEventListener","removeEventListener","_this4","_this$props","maxWidth","_this$getProps2","hasShadow","disableAnimations","ignoreHover","relativeShift","_PopupHelper$getPosit","getPositionObject","direction","rootStyle","Transition","timeout","appear","in","Boolean","mountOnEnter","unmountOnExit","onExited","nodeRef","_this4$props$id","_extends2","_ref","_extends3","ZIndex","id","priority","cx","popup","shadow","popupIgnoreHover","transitionEnter","transitionEnterActive","transitionExit","renderPin","isFunction","positionName","isDefaultBorderColor","popupBorderColor","pinBorder","isIE11","_this$props2","pinSize","borderColor","_this$getProps3","hasPin","popupFixPinTearing","PopupPinNew","popupElement","popupPosition","size","parseInt","popupPinSize","offset","getPinOffset","align","popupBackground","PopupPin","borderWidth","requestAnimationFrame","cancelAnimationFrame","x","y","isNullable","isEdge","Math","abs","reorderPropsPositionsWithPriorityPos","positions","pos_","pos","index","findIndex","startsWith","warning","join","slice","_this$getProps4","tryPreserveFirstRenderedPosition","anchorRect","popupRect","getCoordinates","canBecomeVisible","canBecomeFullyVisible","_iterator","_createForOfIteratorHelperLoose2","_step","done","value","getPinnedPopupOffset","test","anchorSize","height","max","marginFromProps","margin","isNonNullable","isNaN","popupMargin","popupOffset","getHorizontalPosition","getVerticalPosition","Error","pinOffset","popupPinOffsetY","popupPinOffsetX","Component","__KONTUR_REACT_UI__","displayName","isTestEnv","priorities","defaultRootNode","_React$Component2","_proto2"],"sources":["Popup.tsx"],"sourcesContent":["import type { HTMLAttributes, LegacyRef } from 'react';\nimport React from 'react';\nimport { Transition } from 'react-transition-group';\nimport warning from 'warning';\nimport { globalObject } from '@skbkontur/global-object';\n\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\nimport type { Nullable } from '../../typings/utility-types';\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport type { Priority } from '../ZIndex';\nimport { ZIndex } from '../ZIndex';\nimport { RenderContainer } from '../RenderContainer';\nimport type { FocusEventType, MouseEventType } from '../../typings/event-types';\nimport { getRandomID, isFunction, isNonNullable, isNullable, isRefableElement } from '../../lib/utils';\nimport { isIE11, isEdge } from '../../lib/client';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { isTestEnv } from '../../lib/currentEnvironment';\nimport type { CommonProps } from '../CommonWrapper';\nimport { CommonWrapper } from '../CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { responsiveLayout } from '../../components/ResponsiveLayout/decorator';\nimport { MobilePopup } from '../MobilePopup';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getRootNode, rootNode } from '../../lib/rootNode';\nimport { isInstanceWithAnchorElement } from '../../lib/InstanceWithAnchorElement';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { isInstanceOf } from '../../lib/isInstanceOf';\nimport type { ReactUIFeatureFlags } from '../../lib/featureFlagsContext';\nimport { getFullReactUIFlagsContext, ReactUIFeatureFlagsContext } from '../../lib/featureFlagsContext';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { getVisualStateDataAttributes } from '../CommonWrapper/utils/getVisualStateDataAttributes';\n\nimport { PopupPinNew } from './PopupPinNew';\nimport type { Offset, PositionObject, Rect } from './PopupHelper';\nimport { PopupHelper } from './PopupHelper';\nimport { styles } from './Popup.styles';\nimport { PopupPin } from './PopupPin';\n\nconst POPUP_BORDER_DEFAULT_COLOR = 'transparent';\nconst TRANSITION_TIMEOUT = { enter: 0, exit: 200 };\n\nexport const PopupNonPinnablePositions = ['middle center', 'middle left', 'middle right'];\n\nexport const PopupPinnablePositions = [\n 'top center',\n 'top left',\n 'top right',\n 'bottom center',\n 'bottom left',\n 'bottom right',\n 'left middle',\n 'left top',\n 'left bottom',\n 'right middle',\n 'right top',\n 'right bottom',\n];\n\nexport const PopupPositions = [...PopupPinnablePositions, ...PopupNonPinnablePositions] as const;\n\nexport const DefaultPosition = PopupPositions[0];\n\nexport type PopupPositionsType = (typeof PopupPositions)[number];\nexport type PopupPinnablePositionsType = (typeof PopupPinnablePositions)[number];\nexport type ShortPopupPositionsType = 'top' | 'bottom' | 'left' | 'right';\n\nexport const DUMMY_LOCATION: PopupLocation = {\n position: DefaultPosition,\n coordinates: {\n top: -9999,\n left: -9999,\n },\n isFullyVisible: false,\n};\n\nexport interface PopupHandlerProps {\n onMouseEnter?: (event: MouseEventType) => void;\n onMouseLeave?: (event: MouseEventType) => void;\n onClick?: (event: MouseEventType) => void;\n onFocus?: (event: FocusEventType) => void;\n onBlur?: (event: FocusEventType) => void;\n onOpen?: () => void;\n onClose?: () => void;\n}\n\nexport interface PopupProps\n extends Omit<CommonProps, 'children'>,\n PopupHandlerProps,\n Pick<HTMLAttributes<HTMLDivElement>, 'id'> {\n /**\n * Ссылка (ref) на элемент или React компонент, для которого рисуется попап\n */\n anchorElement: React.ReactNode | Element;\n /**\n * Фон попапа и пина\n */\n backgroundColor?: React.CSSProperties['backgroundColor'];\n borderColor?: React.CSSProperties['borderColor'];\n children: React.ReactNode | (() => React.ReactNode);\n /**\n * Показывать ли пин\n */\n hasPin?: boolean;\n /**\n * Применять ли box-shadow на попапе. При false отключает границу на пине\n */\n hasShadow?: boolean;\n disableAnimations?: boolean;\n /**\n * Отступ попапа от элемента\n */\n margin?: number;\n maxWidth?: number | string;\n /**\n * Показан или скрыт попап\n */\n opened: boolean;\n /**\n * Смещение пина от края попапа. Край задаётся в пропе position вторым словом\n */\n pinOffset?: number;\n /**\n * Сторона пина без учёта границы.\n * Пин представляет собой равносторонний треугольник, высота от попапа\n * до \"носика\" пина будет соответствовать формуле (size* √3)/2\n */\n pinSize?: number;\n /**\n * смещение попапа относительно родительского элемента\n */\n popupOffset?: number;\n priority?: Priority;\n /**\n * С какой стороны показывать попап и край попапа,\n * на котором будет отображаться пин\n */\n positions?: Readonly<PopupPositionsType[]>;\n /**\n * Приоритетная позиция попапа\n */\n pos?: PopupPositionsType | ShortPopupPositionsType;\n /**\n * Явно указывает, что вложенные элементы должны быть обёрнуты в `<span/>`. <br/> Используется для корректного позиционирования тултипа при двух и более вложенных элементах.\n *\n * _Примечание_: при **двух и более** вложенных элементах обёртка будет добавлена автоматически.\n */\n useWrapper?: boolean;\n /**\n * Игнорировать ли события hover/click\n */\n ignoreHover?: boolean;\n width?: React.CSSProperties['width'];\n minWidth?: React.CSSProperties['minWidth'];\n /**\n * При очередном рендере пытаться сохранить первоначальную позицию попапа\n * (в том числе, когда он выходит за пределы экрана, но может быть проскролен в него).\n *\n * Нужен только для Tooltip. В остальных случаях позиция перестраивается автоматически.\n * @see https://github.com/skbkontur/retail-ui/pull/1195\n */\n tryPreserveFirstRenderedPosition?: boolean;\n withoutMobile?: boolean;\n /** @ignore */\n disablePortal?: boolean;\n mobileOnCloseRequest?: () => void;\n /**\n * Возвращает текущую позицию попапа\n */\n onPositionChange?: (pos: PopupPositionsType, isFullyVisible: boolean) => void;\n}\n\ninterface PopupLocation {\n coordinates: {\n left: number;\n top: number;\n };\n position: PopupPositionsType;\n isFullyVisible: boolean;\n}\n\nexport interface PopupState {\n location: Nullable<PopupLocation>;\n}\n\nexport const PopupDataTids = {\n root: 'Popup__root',\n content: 'PopupContent',\n contentInner: 'PopupContentInner',\n popupPin: 'PopupPin__root',\n} as const;\n\nexport const PopupIds = {\n root: PopupDataTids.root,\n};\n\ntype DefaultProps = Required<\n Pick<\n PopupProps,\n | 'popupOffset'\n | 'hasPin'\n | 'hasShadow'\n | 'disablePortal'\n | 'disableAnimations'\n | 'useWrapper'\n | 'ignoreHover'\n | 'width'\n | 'priority'\n >\n>;\n\n@responsiveLayout\n@rootNode\nexport class Popup extends React.Component<PopupProps, PopupState> {\n public static __KONTUR_REACT_UI__ = 'Popup';\n public static displayName = 'Popup';\n\n public static defaultProps: DefaultProps = {\n popupOffset: 0,\n hasPin: false,\n hasShadow: false,\n disableAnimations: isTestEnv,\n useWrapper: false,\n ignoreHover: false,\n disablePortal: false,\n width: 'auto',\n priority: ZIndex.priorities.Popup,\n };\n\n private getProps = createPropsGetter(Popup.defaultProps);\n\n // see #2873 and #2895\n public static readonly defaultRootNode = null;\n\n public state: PopupState = { location: this.props.opened ? DUMMY_LOCATION : null };\n private theme!: Theme;\n public featureFlags!: ReactUIFeatureFlags;\n private layoutEventsToken: Nullable<ReturnType<typeof LayoutEvents.addListener>>;\n private locationUpdateId: Nullable<number> = null;\n private lastPopupContentElement: Nullable<Element>;\n private isMobileLayout!: boolean;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private refForTransition = React.createRef<HTMLDivElement>();\n private hasAnchorElementListeners = false;\n private rootId = PopupIds.root + getRandomID();\n\n public anchorElement: Nullable<Element> = null;\n private absoluteParent: Nullable<HTMLDivElement> = null;\n\n public componentDidMount() {\n this.updateLocation();\n this.layoutEventsToken = LayoutEvents.addListener(this.handleLayoutEvent);\n\n if (!this.hasAnchorElementListeners) {\n this.addEventListeners(this.anchorElement);\n }\n }\n\n public static getDerivedStateFromProps(props: Readonly<PopupProps>, state: PopupState) {\n /**\n * Delaying updateLocation to ensure it happens after props update\n */\n if (props.opened) {\n if (!state.location) {\n return { location: DUMMY_LOCATION };\n }\n } else if (state.location) {\n return { location: DUMMY_LOCATION };\n }\n return state;\n }\n\n public componentDidUpdate(prevProps: PopupProps, prevState: PopupState) {\n const hadNoLocation = prevState.location === DUMMY_LOCATION;\n const hasLocation = this.state.location !== DUMMY_LOCATION;\n const wasClosed = prevProps.opened && !this.props.opened;\n\n if (this.isMobileLayout && prevState.location === null && this.state.location === null) {\n this.setState({ location: DUMMY_LOCATION });\n }\n\n if (this.props.opened && hadNoLocation && hasLocation && this.props.onOpen) {\n this.props.onOpen();\n }\n if (wasClosed && !hasLocation && this.props.onClose) {\n this.props.onClose();\n }\n if (this.props.opened) {\n this.delayUpdateLocation();\n }\n }\n\n public componentWillUnmount() {\n this.cancelDelayedUpdateLocation();\n if (this.hasAnchorElementListeners) {\n this.removeEventListeners(this.anchorElement);\n }\n if (this.layoutEventsToken) {\n this.layoutEventsToken.remove();\n this.layoutEventsToken = null;\n }\n if (this.state.location && this.props.onClose) {\n this.props.onClose();\n }\n }\n\n public render() {\n return (\n <ReactUIFeatureFlagsContext.Consumer>\n {(flags) => {\n this.featureFlags = getFullReactUIFlagsContext(flags);\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }}\n </ReactUIFeatureFlagsContext.Consumer>\n );\n }\n\n private renderMobile() {\n const { opened } = this.props;\n const children = this.renderChildren();\n\n return children ? (\n <CommonWrapper rootNodeRef={this.setRootNode}>\n <MobilePopup opened={opened} withoutRenderContainer onCloseRequest={this.props.mobileOnCloseRequest}>\n {this.content(children)}\n </MobilePopup>\n </CommonWrapper>\n ) : null;\n }\n\n private renderMain() {\n const { anchorElement } = this.props;\n const useWrapper = this.getProps().useWrapper;\n\n let anchor: Nullable<React.ReactNode> = null;\n if (isInstanceOf(anchorElement, globalObject.Element)) {\n this.updateAnchorElement(anchorElement);\n } else if (React.isValidElement(anchorElement)) {\n anchor = useWrapper ? <span>{anchorElement}</span> : anchorElement;\n } else {\n anchor = <span>{anchorElement}</span>;\n }\n\n const anchorWithRef =\n anchor && React.isValidElement(anchor) && isRefableElement(anchor)\n ? React.cloneElement(anchor, {\n ref: mergeRefs(\n (anchor as React.RefAttributes<typeof anchor>)?.ref as React.RefCallback<any>,\n this.updateAnchorElement,\n ),\n } as { ref: (instance: Nullable<React.ReactInstance>) => void })\n : null;\n // we need to get anchor's DOM node\n // so we either set our own ref on it via cloning\n // or relay on findDOMNode (inside getRootNode)\n // which should be called within updateAnchorElement\n // in the case when the anchor is not refable\n\n const canGetAnchorNode = !!anchorWithRef || isInstanceOf(anchorElement, globalObject.Element);\n const renderRef = canGetAnchorNode ? null : this.updateAnchorElement;\n const renderAnchor = anchorWithRef || anchor;\n\n return this.props.disablePortal\n ? this.renderWithoutPortal(renderAnchor, renderRef)\n : this.renderInPortal(renderAnchor, renderRef);\n }\n\n private renderInPortal = (anchor: React.ReactNode, ref: null | LegacyRef<RenderContainer>) => {\n const { location } = this.state;\n\n return (\n <RenderContainer anchor={anchor} ref={ref}>\n {this.isMobileLayout && !this.props.withoutMobile\n ? this.renderMobile()\n : location && this.renderContent(location)}\n </RenderContainer>\n );\n };\n\n private renderWithoutPortal = (anchor: React.ReactNode, ref: null | LegacyRef<EmptyWrapper>) => {\n const { location } = this.state;\n\n return (\n <EmptyWrapper ref={ref}>\n {anchor}\n {location && (\n <div ref={this.updateAbsoluteElement} className={styles.absoluteParent()}>\n {this.renderContent(location)}\n </div>\n )}\n </EmptyWrapper>\n );\n };\n\n private updateAnchorElement = (instance: Nullable<React.ReactInstance>) => {\n const childDomNode = isInstanceWithAnchorElement(instance) ? instance.getAnchorElement() : getRootNode(instance);\n const anchorElement = this.anchorElement;\n\n if (childDomNode !== anchorElement) {\n this.removeEventListeners(anchorElement);\n this.anchorElement = childDomNode;\n this.addEventListeners(childDomNode);\n }\n };\n\n private updateAbsoluteElement = (instance: HTMLDivElement) => {\n this.absoluteParent = instance;\n };\n\n private addEventListeners(element: Nullable<Element>) {\n if (element && isInstanceOf(element, globalObject.Element)) {\n // @ts-expect-error: Type ElementEventMap is missing events: https://github.com/skbkontur/retail-ui/pull/2946#discussion_r931072657\n element.addEventListener('mouseenter', this.handleMouseEnter);\n // @ts-expect-error: See the comment above\n element.addEventListener('mouseleave', this.handleMouseLeave);\n // @ts-expect-error: See the comment above\n element.addEventListener('click', this.handleClick);\n element.addEventListener('focusin', this.handleFocus as EventListener);\n element.addEventListener('focusout', this.handleBlur as EventListener);\n\n this.hasAnchorElementListeners = true;\n }\n }\n\n private removeEventListeners(element: Nullable<Element>) {\n if (element && isInstanceOf(element, globalObject.Element)) {\n // @ts-expect-error: Type ElementEventMap is missing events: https://github.com/skbkontur/retail-ui/pull/2946#discussion_r931072657\n element.removeEventListener('mouseenter', this.handleMouseEnter);\n // @ts-expect-error: See the comment above\n element.removeEventListener('mouseleave', this.handleMouseLeave);\n // @ts-expect-error: See the comment above\n element.removeEventListener('click', this.handleClick);\n element.removeEventListener('focusin', this.handleFocus as EventListener);\n element.removeEventListener('focusout', this.handleBlur as EventListener);\n\n this.hasAnchorElementListeners = false;\n }\n }\n\n private handleMouseEnter = (event: MouseEventType) => {\n if (this.props.onMouseEnter) {\n this.props.onMouseEnter(event);\n }\n };\n\n private handleMouseLeave = (event: MouseEventType) => {\n if (this.props.onMouseLeave) {\n this.props.onMouseLeave(event);\n }\n };\n\n private handleClick = (event: MouseEventType) => {\n if (this.props.onClick) {\n this.props.onClick(event);\n }\n };\n\n private handleFocus = (event: FocusEventType) => {\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n\n private handleBlur = (event: FocusEventType) => {\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n };\n\n private calculateWidth = (width: PopupProps['width']) => {\n if (typeof width === 'string' && width.includes('%')) {\n const anchorWidth = getDOMRect(this.anchorElement).width;\n\n return width.replace(/(\\d)+%/g, (percent: string) => `${(anchorWidth * parseFloat(percent)) / 100}px`);\n }\n return width;\n };\n\n private content = (children: React.ReactNode) => {\n const { backgroundColor } = this.props;\n const { width, minWidth } = this.getProps();\n\n return (\n <div\n className={styles.content(this.theme)}\n data-tid={PopupDataTids.content}\n ref={mergeRefs(this.refForTransition, this.refPopupContentElement)}\n >\n <div\n className={styles.contentInner(this.theme)}\n style={{ backgroundColor, width: this.calculateWidth(width), minWidth: this.calculateWidth(minWidth) }}\n data-tid={PopupDataTids.contentInner}\n >\n {children}\n </div>\n </div>\n );\n };\n\n private renderContent(location: PopupLocation) {\n const { maxWidth, opened } = this.props;\n const { hasShadow, disableAnimations, ignoreHover } = this.getProps();\n const children = this.renderChildren();\n\n const relativeShift = this.getRelativeShift();\n const { direction } = PopupHelper.getPositionObject(location.position);\n const rootStyle: React.CSSProperties = {\n maxWidth,\n top: location.coordinates.top + relativeShift.top,\n left: location.coordinates.left + relativeShift.left,\n };\n\n return (\n <Transition\n timeout={TRANSITION_TIMEOUT}\n appear={!disableAnimations}\n in={Boolean(opened && children)}\n mountOnEnter\n unmountOnExit\n enter={!disableAnimations}\n exit={!disableAnimations}\n onExited={this.resetLocation}\n nodeRef={this.refForTransition}\n >\n {(state: string) => (\n <CommonWrapper {...this.props} rootNodeRef={this.setRootNode} {...this.prepareDataVisualState()}>\n <ZIndex\n id={this.props.id ?? this.rootId}\n data-tid={PopupDataTids.root}\n priority={this.props.priority}\n className={cx({\n [styles.popup(this.theme)]: true,\n [styles.shadow(this.theme)]: hasShadow,\n [styles.popupIgnoreHover()]: ignoreHover,\n ...(disableAnimations\n ? {}\n : {\n [styles[`transition-enter-${direction}` as keyof typeof styles](this.theme)]: true,\n [styles.transitionEnter()]: state === 'entering',\n [styles.transitionEnterActive()]: state === 'entered',\n [styles.transitionExit()]: state === 'exiting',\n }),\n })}\n style={rootStyle}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n >\n {this.content(children)}\n {(!this.isMobileLayout || this.props.withoutMobile) && this.renderPin(location.position)}\n </ZIndex>\n </CommonWrapper>\n )}\n </Transition>\n );\n }\n\n private prepareDataVisualState = () => {\n const position = this.state.location?.position;\n if (position) {\n const attrName = `position-` + position.replace(' ', '-');\n return getVisualStateDataAttributes({ [attrName]: true });\n }\n return {};\n };\n\n private resetLocation = () => {\n this.cancelDelayedUpdateLocation();\n this.state.location !== null && this.setState({ location: null });\n };\n\n private renderChildren() {\n return isFunction(this.props.children) ? this.props.children() : this.props.children;\n }\n\n private refPopupContentElement = (element: HTMLDivElement) => {\n this.lastPopupContentElement = element;\n };\n\n private renderPin(positionName: string): React.ReactNode {\n const isDefaultBorderColor = this.theme.popupBorderColor === POPUP_BORDER_DEFAULT_COLOR;\n const pinBorder = isIE11 && isDefaultBorderColor ? 'rgba(0, 0, 0, 0.09)' : this.theme.popupBorderColor;\n\n const { pinSize, backgroundColor, borderColor } = this.props;\n const { hasShadow, hasPin } = this.getProps();\n const position = PopupHelper.getPositionObject(positionName);\n\n return (\n hasPin &&\n !PopupNonPinnablePositions.includes(positionName) &&\n (this.featureFlags.popupFixPinTearing ? (\n <PopupPinNew\n popupElement={this.lastPopupContentElement}\n popupPosition={positionName}\n size={pinSize || parseInt(this.theme.popupPinSize)}\n offset={this.getPinOffset(position.align)}\n backgroundColor={backgroundColor || this.theme.popupBackground}\n />\n ) : (\n <PopupPin\n popupElement={this.lastPopupContentElement}\n popupPosition={positionName}\n size={pinSize || parseInt(this.theme.popupPinSize)}\n offset={this.getPinOffset(position.align)}\n borderWidth={hasShadow ? 1 : 0}\n backgroundColor={backgroundColor || this.theme.popupBackground}\n borderColor={borderColor || pinBorder}\n />\n ))\n );\n }\n\n private handleLayoutEvent = () => {\n if (!this.state.location) {\n return;\n }\n this.updateLocation();\n };\n\n private delayUpdateLocation() {\n this.cancelDelayedUpdateLocation();\n this.locationUpdateId = globalObject.requestAnimationFrame?.(this.updateLocation);\n }\n\n private cancelDelayedUpdateLocation() {\n if (this.locationUpdateId) {\n globalObject.cancelAnimationFrame?.(this.locationUpdateId);\n this.locationUpdateId = null;\n }\n }\n\n private updateLocation = () => {\n const popupContentElement = this.lastPopupContentElement;\n\n if (!popupContentElement) {\n return;\n }\n\n const location = this.getLocation(popupContentElement, this.state.location);\n if (location) {\n this.props.onPositionChange?.(location.position, location.isFullyVisible);\n }\n\n if (!this.locationEquals(this.state.location, location)) {\n this.setState({ location });\n }\n };\n\n private locationEquals(x: Nullable<PopupLocation>, y: Nullable<PopupLocation>) {\n if (x === y) {\n return true;\n }\n\n if (isNullable(x) || isNullable(y)) {\n return false;\n }\n\n if (!isIE11 && !isEdge) {\n return (\n x.coordinates.left === y.coordinates.left &&\n x.coordinates.top === y.coordinates.top &&\n x.position === y.position\n );\n }\n\n // Для ie/edge обновляем позицию только при разнице минимум в 1. Иначе есть вероятность\n // уйти в бесконечный ререндер\n\n return (\n x.position === y.position &&\n Math.abs(x.coordinates.top - y.coordinates.top) <= 1 &&\n Math.abs(x.coordinates.left - y.coordinates.left) <= 1\n );\n }\n\n private reorderPropsPositionsWithPriorityPos() {\n const positions = this.props.positions ? this.props.positions : PopupPinnablePositions;\n let pos_ = '';\n if (this.props.pos) {\n pos_ = this.props.pos;\n } else {\n pos_ = positions[0];\n }\n const index = positions.findIndex((position) => position.startsWith(pos_));\n if (index === -1) {\n warning(false, 'Unexpected position ' + pos_ + ' passed to Popup. Expected one of: ' + positions.join(', '));\n return positions;\n }\n return [...positions.slice(index), ...positions.slice(0, index)];\n }\n\n private getLocation(popupElement: Element, location?: Nullable<PopupLocation>): Nullable<PopupLocation> {\n const { tryPreserveFirstRenderedPosition } = this.getProps();\n const positions = this.reorderPropsPositionsWithPriorityPos();\n\n const anchorElement = this.anchorElement;\n\n warning(\n anchorElement && isInstanceOf(anchorElement, globalObject.Element),\n 'Anchor element is not defined or not instance of Element',\n );\n\n if (!(anchorElement && isInstanceOf(anchorElement, globalObject.Element))) {\n return location;\n }\n\n const anchorRect = PopupHelper.getElementAbsoluteRect(anchorElement);\n const popupRect = PopupHelper.getElementAbsoluteRect(popupElement);\n\n let position: PopupPositionsType;\n let coordinates: Offset;\n\n if (location && location !== DUMMY_LOCATION && location.position) {\n position = location.position;\n coordinates = this.getCoordinates(anchorRect, popupRect, position);\n\n const isFullyVisible = PopupHelper.isFullyVisible(coordinates, popupRect);\n const canBecomeVisible = !isFullyVisible && PopupHelper.canBecomeFullyVisible(position, coordinates);\n\n if (\n // если нужно сохранить первоначальную позицию и Попап целиком\n // находится в пределах вьюпорта (или может быть проскроллен в него)\n (tryPreserveFirstRenderedPosition && (isFullyVisible || canBecomeVisible)) ||\n // если Попап целиком во вьюпорте и в самой приоритетной позиции\n // (иначе нужно попытаться позицию сменить)\n (isFullyVisible && position === positions[0])\n ) {\n // сохраняем текущую позицию\n return { coordinates, position, isFullyVisible: true };\n }\n }\n\n for (position of positions) {\n coordinates = this.getCoordinates(anchorRect, popupRect, position);\n if (PopupHelper.isFullyVisible(coordinates, popupRect)) {\n return { coordinates, position, isFullyVisible: true };\n }\n }\n\n position = positions[0];\n coordinates = this.getCoordinates(anchorRect, popupRect, position);\n\n return { coordinates, position, isFullyVisible: false };\n }\n\n private getPinnedPopupOffset(anchorRect: Rect, position: PositionObject) {\n if (!this.getProps().hasPin || /center|middle/.test(position.align)) {\n return 0;\n }\n\n const anchorSize = /top|bottom/.test(position.direction) ? anchorRect.width : anchorRect.height;\n\n const { pinSize } = this.props;\n\n return Math.max(\n 0,\n this.getPinOffset(position.align) + (pinSize || parseInt(this.theme.popupPinSize)) - anchorSize / 2,\n );\n }\n\n private getRelativeShift = () => {\n const { absoluteParent } = this;\n\n if (!this.props.disablePortal || !absoluteParent) {\n return {\n top: 0,\n left: 0,\n };\n }\n\n const rect = PopupHelper.getElementAbsoluteRect(absoluteParent);\n\n return {\n top: -rect.top,\n left: -rect.left,\n };\n };\n\n private getCoordinates(anchorRect: Rect, popupRect: Rect, positionName: string) {\n const { margin: marginFromProps } = this.props;\n const margin =\n isNonNullable(marginFromProps) && !isNaN(marginFromProps)\n ? marginFromProps\n : parseInt(this.theme.popupMargin) || 0;\n const position = PopupHelper.getPositionObject(positionName);\n const popupOffset = this.getProps().popupOffset + this.getPinnedPopupOffset(anchorRect, position);\n\n switch (position.direction) {\n case 'top':\n return {\n top: anchorRect.top - popupRect.height - margin,\n left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset),\n };\n case 'middle':\n return {\n top: anchorRect.top + anchorRect.height / 2 - popupRect.height / 2,\n left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset),\n };\n case 'bottom':\n return {\n top: anchorRect.top + anchorRect.height + margin,\n left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset),\n };\n case 'left':\n return {\n top: this.getVerticalPosition(anchorRect, popupRect, position.align, popupOffset),\n left: anchorRect.left - popupRect.width - margin,\n };\n case 'right':\n return {\n top: this.getVerticalPosition(anchorRect, popupRect, position.align, popupOffset),\n left: anchorRect.left + anchorRect.width + margin,\n };\n default:\n throw new Error(`Unexpected direction '${position.direction}'`);\n }\n }\n\n private getPinOffset(align: string) {\n const { pinOffset } = this.props;\n\n switch (align) {\n case 'top':\n case 'bottom':\n return pinOffset || parseInt(this.theme.popupPinOffsetY);\n case 'left':\n case 'right':\n return pinOffset || parseInt(this.theme.popupPinOffsetX);\n case 'center':\n case 'middle':\n return 0;\n default:\n throw new Error(`Unexpected align '${align}'`);\n }\n }\n\n private getHorizontalPosition(anchorRect: Rect, popupRect: Rect, align: string, popupOffset: number) {\n switch (align) {\n case 'left':\n return anchorRect.left - popupOffset;\n case 'center':\n return anchorRect.left - (popupRect.width - anchorRect.width) / 2;\n case 'right':\n return anchorRect.left - (popupRect.width - anchorRect.width) + popupOffset;\n default:\n throw new Error(`Unexpected align '${align}'`);\n }\n }\n\n private getVerticalPosition(anchorRect: Rect, popupRect: Rect, align: string, popupOffset: number) {\n switch (align) {\n case 'top':\n return anchorRect.top - popupOffset;\n case 'middle':\n return anchorRect.top - (popupRect.height - anchorRect.height) / 2;\n case 'bottom':\n return anchorRect.top - (popupRect.height - anchorRect.height) + popupOffset;\n default:\n throw new Error(`Unexpected align '${align}'`);\n }\n }\n}\n\n// Нужно, чтобы получать по рефу dom-элемент, в который зарендерится anchor\ntype EmptyWrapperProps = Readonly<{\n children: React.ReactNode;\n}>;\n\nclass EmptyWrapper extends React.Component<EmptyWrapperProps> {\n public render() {\n return this.props.children;\n }\n}\n"],"mappings":";AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;;AAEA,IAAAI,WAAA,GAAAJ,OAAA;;AAEA,IAAAK,YAAA,GAAAC,uBAAA,CAAAN,OAAA;;AAEA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAR,OAAA;;AAEA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;;AAEA,IAAAY,mBAAA,GAAAZ,OAAA;;AAEA,IAA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AG,OAAO,EAAAzR,MAAA,CAC7B0R,WAAW,GAAG,OAAO,EAAA1R,MAAA,CAErBsC,YAAY,GAAiB,EACzC2O,WAAW,EAAE,CAAC,EACdtD,MAAM,EAAE,KAAK,EACb1C,SAAS,EAAE,KAAK,EAChBC,iBAAiB,EAAEyG,6BAAS,EAC5B3H,UAAU,EAAE,KAAK,EACjBmB,WAAW,EAAE,KAAK,EAClB3D,aAAa,EAAE,KAAK,EACpBjC,KAAK,EAAE,MAAM,EACbiH,QAAQ,EAAEF,cAAM,CAACsF,UAAU,CAACrQ,KAAK,CACnC,CAAC,EAAAvB,MAAA,CAKsB6R,eAAe,GAAG,IAAI,EAAA7R,MAAA,MAAAD,MAAA,KAAAA,MAAA;;;AA8nB/C;AAAA;;;;AAKMgE,YAAY,0BAAA+N,iBAAA,YAAA/N,aAAA,UAAA+N,iBAAA,CAAA3P,KAAA,OAAAN,SAAA,eAAA+F,eAAA,CAAArE,OAAA,EAAAQ,YAAA,EAAA+N,iBAAA,MAAAC,OAAA,GAAAhO,YAAA,CAAA+D,SAAA,CAAAiK,OAAA;EACTjJ,MAAM,GAAb,SAAAA,OAAA,EAAgB;IACd,OAAO,IAAI,CAACrG,KAAK,CAACqD,QAAQ;EAC5B,CAAC,QAAA/B,YAAA,GAHwBlB,cAAK,CAAC2O,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactTransitionGroup","_warning","_globalObject","_getDOMRect","LayoutEvents","_interopRequireWildcard","_ZIndex","_RenderContainer","_utils","_client","_ThemeContext","_currentEnvironment","_CommonWrapper","_Emotion","_decorator","_MobilePopup","_rootNode","_InstanceWithAnchorElement","_createPropsGetter","_isInstanceOf","_featureFlagsContext","_mergeRefs","_getVisualStateDataAttributes","_PopupPinNew","_PopupHelper","_Popup2","_PopupPin","_class","_Popup","POPUP_BORDER_DEFAULT_COLOR","TRANSITION_TIMEOUT","enter","exit","PopupNonPinnablePositions","exports","PopupPinnablePositions","PopupPositions","concat","DefaultPosition","DUMMY_LOCATION","position","coordinates","top","left","isFullyVisible","PopupDataTids","root","content","contentInner","popupPin","PopupIds","Popup","responsiveLayout","rootNode","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","getProps","createPropsGetter","defaultProps","state","location","props","opened","locationUpdateId","refForTransition","React","createRef","hasAnchorElementListeners","rootId","getRandomID","anchorElement","absoluteParent","renderInPortal","anchor","ref","default","createElement","RenderContainer","isMobileLayout","withoutMobile","renderMobile","renderContent","renderWithoutPortal","EmptyWrapper","updateAbsoluteElement","className","styles","updateAnchorElement","instance","childDomNode","isInstanceWithAnchorElement","getAnchorElement","getRootNode","removeEventListeners","addEventListeners","handleMouseEnter","event","onMouseEnter","handleMouseLeave","onMouseLeave","handleClick","onClick","handleFocus","onFocus","handleBlur","onBlur","calculateWidth","width","includes","anchorWidth","getDOMRect","replace","percent","parseFloat","children","backgroundColor","_this$getProps","minWidth","theme","mergeRefs","refPopupContentElement","style","prepareDataVisualState","_this$state$location","_getVisualStateDataAt","attrName","getVisualStateDataAttributes","resetLocation","cancelDelayedUpdateLocation","setState","element","lastPopupContentElement","handleLayoutEvent","updateLocation","popupContentElement","getLocation","onPositionChange","locationEquals","getRelativeShift","_this2","disablePortal","rect","PopupHelper","getElementAbsoluteRect","_inheritsLoose2","_proto","prototype","componentDidMount","layoutEventsToken","addListener","getDerivedStateFromProps","componentDidUpdate","prevProps","prevState","hadNoLocation","hasLocation","wasClosed","onOpen","onClose","delayUpdateLocation","componentWillUnmount","remove","render","_this3","ReactUIFeatureFlagsContext","Consumer","flags","featureFlags","getFullReactUIFlagsContext","ThemeContext","renderMain","renderChildren","CommonWrapper","rootNodeRef","setRootNode","MobilePopup","withoutRenderContainer","onCloseRequest","mobileOnCloseRequest","_anchor","useWrapper","isInstanceOf","globalObject","Element","isValidElement","anchorWithRef","isRefableElement","cloneElement","canGetAnchorNode","renderRef","renderAnchor","addEventListener","removeEventListener","_this4","_this$props","maxWidth","_this$getProps2","hasShadow","disableAnimations","ignoreHover","relativeShift","_PopupHelper$getPosit","getPositionObject","direction","rootStyle","Transition","timeout","appear","in","Boolean","mountOnEnter","unmountOnExit","onExited","nodeRef","_this4$props$id","_extends2","_ref","_extends3","ZIndex","id","priority","cx","popup","shadow","popupIgnoreHover","transitionEnter","transitionEnterActive","transitionExit","renderPin","isFunction","positionName","isDefaultBorderColor","popupBorderColor","pinBorder","isIE11","_this$props2","pinSize","borderColor","_this$getProps3","hasPin","popupFixPinTearing","PopupPinNew","popupElement","popupPosition","size","parseInt","popupPinSize","offset","getPinOffset","align","popupBackground","PopupPin","borderWidth","requestAnimationFrame","cancelAnimationFrame","x","y","isNullable","isEdge","Math","abs","reorderPropsPositionsWithPriorityPos","positions","pos_","pos","index","findIndex","startsWith","warning","join","slice","_this$getProps4","tryPreserveFirstRenderedPosition","tryBestFallbackPosition","anchorRect","popupRect","getCoordinates","canBecomeVisible","canBecomeFullyVisible","_iterator","_createForOfIteratorHelperLoose2","_step","done","value","getBestFallbackPosition","defaultPosition","coords","overflow","getOverflowEdges","preferredDirection","getPreferredDirection","preferredAlignOrder","getPreferredAlignOrder","candidates","buildFallbackCandidates","positionsSet","Set","best","minCount","_iterator2","_step2","count","getOverflowCount","isBetter","has","getPinnedPopupOffset","test","anchorSize","height","max","marginFromProps","margin","isNonNullable","isNaN","popupMargin","popupOffset","getHorizontalPosition","getVerticalPosition","Error","pinOffset","popupPinOffsetY","popupPinOffsetX","Component","__KONTUR_REACT_UI__","displayName","isTestEnv","priorities","defaultRootNode","_React$Component2","_proto2"],"sources":["Popup.tsx"],"sourcesContent":["import type { HTMLAttributes, LegacyRef } from 'react';\nimport React from 'react';\nimport { Transition } from 'react-transition-group';\nimport warning from 'warning';\nimport { globalObject } from '@skbkontur/global-object';\n\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\nimport type { Nullable } from '../../typings/utility-types';\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport type { Priority } from '../ZIndex';\nimport { ZIndex } from '../ZIndex';\nimport { RenderContainer } from '../RenderContainer';\nimport type { FocusEventType, MouseEventType } from '../../typings/event-types';\nimport { getRandomID, isFunction, isNonNullable, isNullable, isRefableElement } from '../../lib/utils';\nimport { isIE11, isEdge } from '../../lib/client';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { isTestEnv } from '../../lib/currentEnvironment';\nimport type { CommonProps } from '../CommonWrapper';\nimport { CommonWrapper } from '../CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { responsiveLayout } from '../../components/ResponsiveLayout/decorator';\nimport { MobilePopup } from '../MobilePopup';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getRootNode, rootNode } from '../../lib/rootNode';\nimport { isInstanceWithAnchorElement } from '../../lib/InstanceWithAnchorElement';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { isInstanceOf } from '../../lib/isInstanceOf';\nimport type { ReactUIFeatureFlags } from '../../lib/featureFlagsContext';\nimport { getFullReactUIFlagsContext, ReactUIFeatureFlagsContext } from '../../lib/featureFlagsContext';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { getVisualStateDataAttributes } from '../CommonWrapper/utils/getVisualStateDataAttributes';\n\nimport { PopupPinNew } from './PopupPinNew';\nimport type { Offset, PositionObject, Rect } from './PopupHelper';\nimport { PopupHelper } from './PopupHelper';\nimport { styles } from './Popup.styles';\nimport { PopupPin } from './PopupPin';\n\nconst POPUP_BORDER_DEFAULT_COLOR = 'transparent';\nconst TRANSITION_TIMEOUT = { enter: 0, exit: 200 };\n\nexport const PopupNonPinnablePositions = ['middle center', 'middle left', 'middle right'];\n\nexport const PopupPinnablePositions = [\n 'top center',\n 'top left',\n 'top right',\n 'bottom center',\n 'bottom left',\n 'bottom right',\n 'left middle',\n 'left top',\n 'left bottom',\n 'right middle',\n 'right top',\n 'right bottom',\n];\n\nexport const PopupPositions = [...PopupPinnablePositions, ...PopupNonPinnablePositions] as const;\n\nexport const DefaultPosition = PopupPositions[0];\n\nexport type PopupPositionsType = (typeof PopupPositions)[number];\nexport type PopupPinnablePositionsType = (typeof PopupPinnablePositions)[number];\nexport type ShortPopupPositionsType = 'top' | 'bottom' | 'left' | 'right';\n\nexport const DUMMY_LOCATION: PopupLocation = {\n position: DefaultPosition,\n coordinates: {\n top: -9999,\n left: -9999,\n },\n isFullyVisible: false,\n};\n\nexport interface PopupHandlerProps {\n onMouseEnter?: (event: MouseEventType) => void;\n onMouseLeave?: (event: MouseEventType) => void;\n onClick?: (event: MouseEventType) => void;\n onFocus?: (event: FocusEventType) => void;\n onBlur?: (event: FocusEventType) => void;\n onOpen?: () => void;\n onClose?: () => void;\n}\n\nexport interface PopupProps\n extends Omit<CommonProps, 'children'>,\n PopupHandlerProps,\n Pick<HTMLAttributes<HTMLDivElement>, 'id'> {\n /**\n * Ссылка (ref) на элемент или React компонент, для которого рисуется попап\n */\n anchorElement: React.ReactNode | Element;\n /**\n * Фон попапа и пина\n */\n backgroundColor?: React.CSSProperties['backgroundColor'];\n borderColor?: React.CSSProperties['borderColor'];\n children: React.ReactNode | (() => React.ReactNode);\n /**\n * Показывать ли пин\n */\n hasPin?: boolean;\n /**\n * Применять ли box-shadow на попапе. При false отключает границу на пине\n */\n hasShadow?: boolean;\n disableAnimations?: boolean;\n /**\n * Отступ попапа от элемента\n */\n margin?: number;\n maxWidth?: number | string;\n /**\n * Показан или скрыт попап\n */\n opened: boolean;\n /**\n * Смещение пина от края попапа. Край задаётся в пропе position вторым словом\n */\n pinOffset?: number;\n /**\n * Сторона пина без учёта границы.\n * Пин представляет собой равносторонний треугольник, высота от попапа\n * до \"носика\" пина будет соответствовать формуле (size* √3)/2\n */\n pinSize?: number;\n /**\n * смещение попапа относительно родительского элемента\n */\n popupOffset?: number;\n priority?: Priority;\n /**\n * С какой стороны показывать попап и край попапа,\n * на котором будет отображаться пин\n */\n positions?: Readonly<PopupPositionsType[]>;\n /**\n * Приоритетная позиция попапа\n */\n pos?: PopupPositionsType | ShortPopupPositionsType;\n /**\n * Явно указывает, что вложенные элементы должны быть обёрнуты в `<span/>`. <br/> Используется для корректного позиционирования тултипа при двух и более вложенных элементах.\n *\n * _Примечание_: при **двух и более** вложенных элементах обёртка будет добавлена автоматически.\n */\n useWrapper?: boolean;\n /**\n * Игнорировать ли события hover/click\n */\n ignoreHover?: boolean;\n width?: React.CSSProperties['width'];\n minWidth?: React.CSSProperties['minWidth'];\n /**\n * При очередном рендере пытаться сохранить первоначальную позицию попапа\n * (в том числе, когда он выходит за пределы экрана, но может быть проскролен в него).\n *\n * Нужен только для Tooltip. В остальных случаях позиция перестраивается автоматически.\n * @see https://github.com/skbkontur/retail-ui/pull/1195\n */\n tryPreserveFirstRenderedPosition?: boolean;\n /**\n * Если ни одна позиция попапа не влезает во вьюпорт — выбираем наиболее подходящий fallback.\n * Так чтобы попап было видно пользователю, если попап у нижнего края — открыть сверху элемента,\n * у верхнего — снизу; горизонтально сохраняем читаемость слева направо.\n */\n tryBestFallbackPosition?: boolean;\n withoutMobile?: boolean;\n /** @ignore */\n disablePortal?: boolean;\n mobileOnCloseRequest?: () => void;\n /**\n * Возвращает текущую позицию попапа\n */\n onPositionChange?: (pos: PopupPositionsType, isFullyVisible: boolean) => void;\n}\n\ninterface PopupLocation {\n coordinates: {\n left: number;\n top: number;\n };\n position: PopupPositionsType;\n isFullyVisible: boolean;\n}\n\nexport interface PopupState {\n location: Nullable<PopupLocation>;\n}\n\nexport const PopupDataTids = {\n root: 'Popup__root',\n content: 'PopupContent',\n contentInner: 'PopupContentInner',\n popupPin: 'PopupPin__root',\n} as const;\n\nexport const PopupIds = {\n root: PopupDataTids.root,\n};\n\ntype DefaultProps = Required<\n Pick<\n PopupProps,\n | 'popupOffset'\n | 'hasPin'\n | 'hasShadow'\n | 'disablePortal'\n | 'disableAnimations'\n | 'useWrapper'\n | 'ignoreHover'\n | 'width'\n | 'priority'\n >\n>;\n\n@responsiveLayout\n@rootNode\nexport class Popup extends React.Component<PopupProps, PopupState> {\n public static __KONTUR_REACT_UI__ = 'Popup';\n public static displayName = 'Popup';\n\n public static defaultProps: DefaultProps = {\n popupOffset: 0,\n hasPin: false,\n hasShadow: false,\n disableAnimations: isTestEnv,\n useWrapper: false,\n ignoreHover: false,\n disablePortal: false,\n width: 'auto',\n priority: ZIndex.priorities.Popup,\n };\n\n private getProps = createPropsGetter(Popup.defaultProps);\n\n // see #2873 and #2895\n public static readonly defaultRootNode = null;\n\n public state: PopupState = { location: this.props.opened ? DUMMY_LOCATION : null };\n private theme!: Theme;\n public featureFlags!: ReactUIFeatureFlags;\n private layoutEventsToken: Nullable<ReturnType<typeof LayoutEvents.addListener>>;\n private locationUpdateId: Nullable<number> = null;\n private lastPopupContentElement: Nullable<Element>;\n private isMobileLayout!: boolean;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private refForTransition = React.createRef<HTMLDivElement>();\n private hasAnchorElementListeners = false;\n private rootId = PopupIds.root + getRandomID();\n\n public anchorElement: Nullable<Element> = null;\n private absoluteParent: Nullable<HTMLDivElement> = null;\n\n public componentDidMount() {\n this.updateLocation();\n this.layoutEventsToken = LayoutEvents.addListener(this.handleLayoutEvent);\n\n if (!this.hasAnchorElementListeners) {\n this.addEventListeners(this.anchorElement);\n }\n }\n\n public static getDerivedStateFromProps(props: Readonly<PopupProps>, state: PopupState) {\n /**\n * Delaying updateLocation to ensure it happens after props update\n */\n if (props.opened) {\n if (!state.location) {\n return { location: DUMMY_LOCATION };\n }\n } else if (state.location) {\n return { location: DUMMY_LOCATION };\n }\n return state;\n }\n\n public componentDidUpdate(prevProps: PopupProps, prevState: PopupState) {\n const hadNoLocation = prevState.location === DUMMY_LOCATION;\n const hasLocation = this.state.location !== DUMMY_LOCATION;\n const wasClosed = prevProps.opened && !this.props.opened;\n\n if (this.isMobileLayout && prevState.location === null && this.state.location === null) {\n this.setState({ location: DUMMY_LOCATION });\n }\n\n if (this.props.opened && hadNoLocation && hasLocation && this.props.onOpen) {\n this.props.onOpen();\n }\n if (wasClosed && !hasLocation && this.props.onClose) {\n this.props.onClose();\n }\n if (this.props.opened) {\n this.delayUpdateLocation();\n }\n }\n\n public componentWillUnmount() {\n this.cancelDelayedUpdateLocation();\n if (this.hasAnchorElementListeners) {\n this.removeEventListeners(this.anchorElement);\n }\n if (this.layoutEventsToken) {\n this.layoutEventsToken.remove();\n this.layoutEventsToken = null;\n }\n if (this.state.location && this.props.onClose) {\n this.props.onClose();\n }\n }\n\n public render() {\n return (\n <ReactUIFeatureFlagsContext.Consumer>\n {(flags) => {\n this.featureFlags = getFullReactUIFlagsContext(flags);\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }}\n </ReactUIFeatureFlagsContext.Consumer>\n );\n }\n\n private renderMobile() {\n const { opened } = this.props;\n const children = this.renderChildren();\n\n return children ? (\n <CommonWrapper rootNodeRef={this.setRootNode}>\n <MobilePopup opened={opened} withoutRenderContainer onCloseRequest={this.props.mobileOnCloseRequest}>\n {this.content(children)}\n </MobilePopup>\n </CommonWrapper>\n ) : null;\n }\n\n private renderMain() {\n const { anchorElement } = this.props;\n const useWrapper = this.getProps().useWrapper;\n\n let anchor: Nullable<React.ReactNode> = null;\n if (isInstanceOf(anchorElement, globalObject.Element)) {\n this.updateAnchorElement(anchorElement);\n } else if (React.isValidElement(anchorElement)) {\n anchor = useWrapper ? <span>{anchorElement}</span> : anchorElement;\n } else {\n anchor = <span>{anchorElement}</span>;\n }\n\n const anchorWithRef =\n anchor && React.isValidElement(anchor) && isRefableElement(anchor)\n ? React.cloneElement(anchor, {\n ref: mergeRefs(\n (anchor as React.RefAttributes<typeof anchor>)?.ref as React.RefCallback<any>,\n this.updateAnchorElement,\n ),\n } as { ref: (instance: Nullable<React.ReactInstance>) => void })\n : null;\n // we need to get anchor's DOM node\n // so we either set our own ref on it via cloning\n // or relay on findDOMNode (inside getRootNode)\n // which should be called within updateAnchorElement\n // in the case when the anchor is not refable\n\n const canGetAnchorNode = !!anchorWithRef || isInstanceOf(anchorElement, globalObject.Element);\n const renderRef = canGetAnchorNode ? null : this.updateAnchorElement;\n const renderAnchor = anchorWithRef || anchor;\n\n return this.props.disablePortal\n ? this.renderWithoutPortal(renderAnchor, renderRef)\n : this.renderInPortal(renderAnchor, renderRef);\n }\n\n private renderInPortal = (anchor: React.ReactNode, ref: null | LegacyRef<RenderContainer>) => {\n const { location } = this.state;\n\n return (\n <RenderContainer anchor={anchor} ref={ref}>\n {this.isMobileLayout && !this.props.withoutMobile\n ? this.renderMobile()\n : location && this.renderContent(location)}\n </RenderContainer>\n );\n };\n\n private renderWithoutPortal = (anchor: React.ReactNode, ref: null | LegacyRef<EmptyWrapper>) => {\n const { location } = this.state;\n\n return (\n <EmptyWrapper ref={ref}>\n {anchor}\n {location && (\n <div ref={this.updateAbsoluteElement} className={styles.absoluteParent()}>\n {this.renderContent(location)}\n </div>\n )}\n </EmptyWrapper>\n );\n };\n\n private updateAnchorElement = (instance: Nullable<React.ReactInstance>) => {\n const childDomNode = isInstanceWithAnchorElement(instance) ? instance.getAnchorElement() : getRootNode(instance);\n const anchorElement = this.anchorElement;\n\n if (childDomNode !== anchorElement) {\n this.removeEventListeners(anchorElement);\n this.anchorElement = childDomNode;\n this.addEventListeners(childDomNode);\n }\n };\n\n private updateAbsoluteElement = (instance: HTMLDivElement) => {\n this.absoluteParent = instance;\n };\n\n private addEventListeners(element: Nullable<Element>) {\n if (element && isInstanceOf(element, globalObject.Element)) {\n // @ts-expect-error: Type ElementEventMap is missing events: https://github.com/skbkontur/retail-ui/pull/2946#discussion_r931072657\n element.addEventListener('mouseenter', this.handleMouseEnter);\n // @ts-expect-error: See the comment above\n element.addEventListener('mouseleave', this.handleMouseLeave);\n // @ts-expect-error: See the comment above\n element.addEventListener('click', this.handleClick);\n element.addEventListener('focusin', this.handleFocus as EventListener);\n element.addEventListener('focusout', this.handleBlur as EventListener);\n\n this.hasAnchorElementListeners = true;\n }\n }\n\n private removeEventListeners(element: Nullable<Element>) {\n if (element && isInstanceOf(element, globalObject.Element)) {\n // @ts-expect-error: Type ElementEventMap is missing events: https://github.com/skbkontur/retail-ui/pull/2946#discussion_r931072657\n element.removeEventListener('mouseenter', this.handleMouseEnter);\n // @ts-expect-error: See the comment above\n element.removeEventListener('mouseleave', this.handleMouseLeave);\n // @ts-expect-error: See the comment above\n element.removeEventListener('click', this.handleClick);\n element.removeEventListener('focusin', this.handleFocus as EventListener);\n element.removeEventListener('focusout', this.handleBlur as EventListener);\n\n this.hasAnchorElementListeners = false;\n }\n }\n\n private handleMouseEnter = (event: MouseEventType) => {\n if (this.props.onMouseEnter) {\n this.props.onMouseEnter(event);\n }\n };\n\n private handleMouseLeave = (event: MouseEventType) => {\n if (this.props.onMouseLeave) {\n this.props.onMouseLeave(event);\n }\n };\n\n private handleClick = (event: MouseEventType) => {\n if (this.props.onClick) {\n this.props.onClick(event);\n }\n };\n\n private handleFocus = (event: FocusEventType) => {\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n\n private handleBlur = (event: FocusEventType) => {\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n };\n\n private calculateWidth = (width: PopupProps['width']) => {\n if (typeof width === 'string' && width.includes('%')) {\n const anchorWidth = getDOMRect(this.anchorElement).width;\n\n return width.replace(/(\\d)+%/g, (percent: string) => `${(anchorWidth * parseFloat(percent)) / 100}px`);\n }\n return width;\n };\n\n private content = (children: React.ReactNode) => {\n const { backgroundColor } = this.props;\n const { width, minWidth } = this.getProps();\n\n return (\n <div\n className={styles.content(this.theme)}\n data-tid={PopupDataTids.content}\n ref={mergeRefs(this.refForTransition, this.refPopupContentElement)}\n >\n <div\n className={styles.contentInner(this.theme)}\n style={{ backgroundColor, width: this.calculateWidth(width), minWidth: this.calculateWidth(minWidth) }}\n data-tid={PopupDataTids.contentInner}\n >\n {children}\n </div>\n </div>\n );\n };\n\n private renderContent(location: PopupLocation) {\n const { maxWidth, opened } = this.props;\n const { hasShadow, disableAnimations, ignoreHover } = this.getProps();\n const children = this.renderChildren();\n\n const relativeShift = this.getRelativeShift();\n const { direction } = PopupHelper.getPositionObject(location.position);\n const rootStyle: React.CSSProperties = {\n maxWidth,\n top: location.coordinates.top + relativeShift.top,\n left: location.coordinates.left + relativeShift.left,\n };\n\n return (\n <Transition\n timeout={TRANSITION_TIMEOUT}\n appear={!disableAnimations}\n in={Boolean(opened && children)}\n mountOnEnter\n unmountOnExit\n enter={!disableAnimations}\n exit={!disableAnimations}\n onExited={this.resetLocation}\n nodeRef={this.refForTransition}\n >\n {(state: string) => (\n <CommonWrapper {...this.props} rootNodeRef={this.setRootNode} {...this.prepareDataVisualState()}>\n <ZIndex\n id={this.props.id ?? this.rootId}\n data-tid={PopupDataTids.root}\n priority={this.props.priority}\n className={cx({\n [styles.popup(this.theme)]: true,\n [styles.shadow(this.theme)]: hasShadow,\n [styles.popupIgnoreHover()]: ignoreHover,\n ...(disableAnimations\n ? {}\n : {\n [styles[`transition-enter-${direction}` as keyof typeof styles](this.theme)]: true,\n [styles.transitionEnter()]: state === 'entering',\n [styles.transitionEnterActive()]: state === 'entered',\n [styles.transitionExit()]: state === 'exiting',\n }),\n })}\n style={rootStyle}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n >\n {this.content(children)}\n {(!this.isMobileLayout || this.props.withoutMobile) && this.renderPin(location.position)}\n </ZIndex>\n </CommonWrapper>\n )}\n </Transition>\n );\n }\n\n private prepareDataVisualState = () => {\n const position = this.state.location?.position;\n if (position) {\n const attrName = `position-` + position.replace(' ', '-');\n return getVisualStateDataAttributes({ [attrName]: true });\n }\n return {};\n };\n\n private resetLocation = () => {\n this.cancelDelayedUpdateLocation();\n this.state.location !== null && this.setState({ location: null });\n };\n\n private renderChildren() {\n return isFunction(this.props.children) ? this.props.children() : this.props.children;\n }\n\n private refPopupContentElement = (element: HTMLDivElement) => {\n this.lastPopupContentElement = element;\n };\n\n private renderPin(positionName: string): React.ReactNode {\n const isDefaultBorderColor = this.theme.popupBorderColor === POPUP_BORDER_DEFAULT_COLOR;\n const pinBorder = isIE11 && isDefaultBorderColor ? 'rgba(0, 0, 0, 0.09)' : this.theme.popupBorderColor;\n\n const { pinSize, backgroundColor, borderColor } = this.props;\n const { hasShadow, hasPin } = this.getProps();\n const position = PopupHelper.getPositionObject(positionName);\n\n return (\n hasPin &&\n !PopupNonPinnablePositions.includes(positionName) &&\n (this.featureFlags.popupFixPinTearing ? (\n <PopupPinNew\n popupElement={this.lastPopupContentElement}\n popupPosition={positionName}\n size={pinSize || parseInt(this.theme.popupPinSize)}\n offset={this.getPinOffset(position.align)}\n backgroundColor={backgroundColor || this.theme.popupBackground}\n />\n ) : (\n <PopupPin\n popupElement={this.lastPopupContentElement}\n popupPosition={positionName}\n size={pinSize || parseInt(this.theme.popupPinSize)}\n offset={this.getPinOffset(position.align)}\n borderWidth={hasShadow ? 1 : 0}\n backgroundColor={backgroundColor || this.theme.popupBackground}\n borderColor={borderColor || pinBorder}\n />\n ))\n );\n }\n\n private handleLayoutEvent = () => {\n if (!this.state.location) {\n return;\n }\n this.updateLocation();\n };\n\n private delayUpdateLocation() {\n this.cancelDelayedUpdateLocation();\n this.locationUpdateId = globalObject.requestAnimationFrame?.(this.updateLocation);\n }\n\n private cancelDelayedUpdateLocation() {\n if (this.locationUpdateId) {\n globalObject.cancelAnimationFrame?.(this.locationUpdateId);\n this.locationUpdateId = null;\n }\n }\n\n private updateLocation = () => {\n const popupContentElement = this.lastPopupContentElement;\n\n if (!popupContentElement) {\n return;\n }\n\n const location = this.getLocation(popupContentElement, this.state.location);\n if (location) {\n this.props.onPositionChange?.(location.position, location.isFullyVisible);\n }\n\n if (!this.locationEquals(this.state.location, location)) {\n this.setState({ location });\n }\n };\n\n private locationEquals(x: Nullable<PopupLocation>, y: Nullable<PopupLocation>) {\n if (x === y) {\n return true;\n }\n\n if (isNullable(x) || isNullable(y)) {\n return false;\n }\n\n if (!isIE11 && !isEdge) {\n return (\n x.coordinates.left === y.coordinates.left &&\n x.coordinates.top === y.coordinates.top &&\n x.position === y.position\n );\n }\n\n // Для ie/edge обновляем позицию только при разнице минимум в 1. Иначе есть вероятность\n // уйти в бесконечный ререндер\n\n return (\n x.position === y.position &&\n Math.abs(x.coordinates.top - y.coordinates.top) <= 1 &&\n Math.abs(x.coordinates.left - y.coordinates.left) <= 1\n );\n }\n\n private reorderPropsPositionsWithPriorityPos() {\n const positions = this.props.positions ? this.props.positions : PopupPinnablePositions;\n let pos_ = '';\n if (this.props.pos) {\n pos_ = this.props.pos;\n } else {\n pos_ = positions[0];\n }\n const index = positions.findIndex((position) => position.startsWith(pos_));\n if (index === -1) {\n warning(false, 'Unexpected position ' + pos_ + ' passed to Popup. Expected one of: ' + positions.join(', '));\n return positions;\n }\n return [...positions.slice(index), ...positions.slice(0, index)];\n }\n\n private getLocation(popupElement: Element, location?: Nullable<PopupLocation>): Nullable<PopupLocation> {\n const { tryPreserveFirstRenderedPosition, tryBestFallbackPosition } = this.getProps();\n const positions = this.reorderPropsPositionsWithPriorityPos();\n\n const anchorElement = this.anchorElement;\n\n warning(\n anchorElement && isInstanceOf(anchorElement, globalObject.Element),\n 'Anchor element is not defined or not instance of Element',\n );\n\n if (!(anchorElement && isInstanceOf(anchorElement, globalObject.Element))) {\n return location;\n }\n\n const anchorRect = PopupHelper.getElementAbsoluteRect(anchorElement);\n const popupRect = PopupHelper.getElementAbsoluteRect(popupElement);\n\n let position: PopupPositionsType;\n let coordinates: Offset;\n\n if (location && location !== DUMMY_LOCATION && location.position) {\n position = location.position;\n coordinates = this.getCoordinates(anchorRect, popupRect, position);\n\n const isFullyVisible = PopupHelper.isFullyVisible(coordinates, popupRect);\n const canBecomeVisible = !isFullyVisible && PopupHelper.canBecomeFullyVisible(position, coordinates);\n\n if (\n // если нужно сохранить первоначальную позицию и Попап целиком\n // находится в пределах вьюпорта (или может быть проскроллен в него)\n (tryPreserveFirstRenderedPosition && (isFullyVisible || canBecomeVisible)) ||\n // если Попап целиком во вьюпорте и в самой приоритетной позиции\n // (иначе нужно попытаться позицию сменить)\n (isFullyVisible && position === positions[0])\n ) {\n // сохраняем текущую позицию\n return { coordinates, position, isFullyVisible: true };\n }\n }\n\n for (position of positions) {\n coordinates = this.getCoordinates(anchorRect, popupRect, position);\n if (PopupHelper.isFullyVisible(coordinates, popupRect)) {\n return { coordinates, position, isFullyVisible: true };\n }\n }\n\n position = tryBestFallbackPosition ? this.getBestFallbackPosition(positions, anchorRect, popupRect) : positions[0];\n coordinates = this.getCoordinates(anchorRect, popupRect, position);\n\n return { coordinates, position, isFullyVisible: false };\n }\n\n private getBestFallbackPosition(\n positions: Readonly<PopupPositionsType[]>,\n anchorRect: Rect,\n popupRect: Rect,\n ): PopupPositionsType {\n const defaultPosition = positions[0];\n const coords = this.getCoordinates(anchorRect, popupRect, defaultPosition);\n const overflow = PopupHelper.getOverflowEdges(coords, popupRect);\n const preferredDirection = PopupHelper.getPreferredDirection(overflow, defaultPosition);\n const preferredAlignOrder = PopupHelper.getPreferredAlignOrder(overflow);\n const candidates = PopupHelper.buildFallbackCandidates(\n positions,\n overflow,\n preferredDirection,\n preferredAlignOrder,\n PopupPinnablePositions,\n );\n\n const positionsSet = new Set(positions);\n let best = candidates[0];\n let minCount = 4;\n\n for (const positionName of candidates) {\n const coords = this.getCoordinates(anchorRect, popupRect, positionName);\n const overflow = PopupHelper.getOverflowEdges(coords, popupRect);\n const count = PopupHelper.getOverflowCount(overflow);\n const isBetter =\n count < minCount || (count === minCount && positionsSet.has(positionName) && !positionsSet.has(best));\n if (isBetter) {\n minCount = count;\n best = positionName;\n }\n }\n return best;\n }\n\n private getPinnedPopupOffset(anchorRect: Rect, position: PositionObject) {\n if (!this.getProps().hasPin || /center|middle/.test(position.align)) {\n return 0;\n }\n\n const anchorSize = /top|bottom/.test(position.direction) ? anchorRect.width : anchorRect.height;\n\n const { pinSize } = this.props;\n\n return Math.max(\n 0,\n this.getPinOffset(position.align) + (pinSize || parseInt(this.theme.popupPinSize)) - anchorSize / 2,\n );\n }\n\n private getRelativeShift = () => {\n const { absoluteParent } = this;\n\n if (!this.props.disablePortal || !absoluteParent) {\n return {\n top: 0,\n left: 0,\n };\n }\n\n const rect = PopupHelper.getElementAbsoluteRect(absoluteParent);\n\n return {\n top: -rect.top,\n left: -rect.left,\n };\n };\n\n private getCoordinates(anchorRect: Rect, popupRect: Rect, positionName: string) {\n const { margin: marginFromProps } = this.props;\n const margin =\n isNonNullable(marginFromProps) && !isNaN(marginFromProps)\n ? marginFromProps\n : parseInt(this.theme.popupMargin) || 0;\n const position = PopupHelper.getPositionObject(positionName);\n const popupOffset = this.getProps().popupOffset + this.getPinnedPopupOffset(anchorRect, position);\n\n switch (position.direction) {\n case 'top':\n return {\n top: anchorRect.top - popupRect.height - margin,\n left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset),\n };\n case 'middle':\n return {\n top: anchorRect.top + anchorRect.height / 2 - popupRect.height / 2,\n left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset),\n };\n case 'bottom':\n return {\n top: anchorRect.top + anchorRect.height + margin,\n left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset),\n };\n case 'left':\n return {\n top: this.getVerticalPosition(anchorRect, popupRect, position.align, popupOffset),\n left: anchorRect.left - popupRect.width - margin,\n };\n case 'right':\n return {\n top: this.getVerticalPosition(anchorRect, popupRect, position.align, popupOffset),\n left: anchorRect.left + anchorRect.width + margin,\n };\n default:\n throw new Error(`Unexpected direction '${position.direction}'`);\n }\n }\n\n private getPinOffset(align: string) {\n const { pinOffset } = this.props;\n\n switch (align) {\n case 'top':\n case 'bottom':\n return pinOffset || parseInt(this.theme.popupPinOffsetY);\n case 'left':\n case 'right':\n return pinOffset || parseInt(this.theme.popupPinOffsetX);\n case 'center':\n case 'middle':\n return 0;\n default:\n throw new Error(`Unexpected align '${align}'`);\n }\n }\n\n private getHorizontalPosition(anchorRect: Rect, popupRect: Rect, align: string, popupOffset: number) {\n switch (align) {\n case 'left':\n return anchorRect.left - popupOffset;\n case 'center':\n return anchorRect.left - (popupRect.width - anchorRect.width) / 2;\n case 'right':\n return anchorRect.left - (popupRect.width - anchorRect.width) + popupOffset;\n default:\n throw new Error(`Unexpected align '${align}'`);\n }\n }\n\n private getVerticalPosition(anchorRect: Rect, popupRect: Rect, align: string, popupOffset: number) {\n switch (align) {\n case 'top':\n return anchorRect.top - popupOffset;\n case 'middle':\n return anchorRect.top - (popupRect.height - anchorRect.height) / 2;\n case 'bottom':\n return anchorRect.top - (popupRect.height - anchorRect.height) + popupOffset;\n default:\n throw new Error(`Unexpected align '${align}'`);\n }\n }\n}\n\n// Нужно, чтобы получать по рефу dom-элемент, в который зарендерится anchor\ntype EmptyWrapperProps = Readonly<{\n children: React.ReactNode;\n}>;\n\nclass EmptyWrapper extends React.Component<EmptyWrapperProps> {\n public render() {\n return this.props.children;\n }\n}\n"],"mappings":";AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;;AAEA,IAAAI,WAAA,GAAAJ,OAAA;;AAEA,IAAAK,YAAA,GAAAC,uBAAA,CAAAN,OAAA;;AAEA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAR,OAAA;;AAEA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;;AAEA,IAAAY,mBAAA,GAAAZ,OAAA;;AAEA,IAAAa,cAAA,GAAAb,OAAA;AACA,IAAAc,QAAA,GAAAd,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AACA,IAAAgB,YAAA,GAAAhB,OAAA;;AAEA,IAAAiB,SAAA,GAAAjB,OAAA;AACA,IAAAkB,0BAAA,GAAA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,CAAChP,GAAG,IAAIiP,SAAS,CAACiC,MAAM,GAAGlC,UAAU,CAACkC,MAAM,CAAC,GAAGO,WAAW;MAC9E;QACE,MAAM,IAAIG,KAAK,wBAAsBrE,KAAK,MAAG,CAAC;IAClD;EACF,CAAC,QAAA9M,KAAA,GAlrBwBsB,cAAK,CAACiQ,SAAS,GAAA9S,MAAA,CAC1B+S,mBAAmB,GAAG,OAAO,EAAA/S,MAAA,CAC7BgT,WAAW,GAAG,OAAO,EAAAhT,MAAA,CAErBsC,YAAY,GAAiB,EACzCiQ,WAAW,EAAE,CAAC,EACd5E,MAAM,EAAE,KAAK,EACb1C,SAAS,EAAE,KAAK,EAChBC,iBAAiB,EAAE+H,6BAAS,EAC5BjJ,UAAU,EAAE,KAAK,EACjBmB,WAAW,EAAE,KAAK,EAClB3D,aAAa,EAAE,KAAK,EACpBjC,KAAK,EAAE,MAAM,EACbiH,QAAQ,EAAEF,cAAM,CAAC4G,UAAU,CAAC3R,KAAK,CACnC,CAAC,EAAAvB,MAAA,CAKsBmT,eAAe,GAAG,IAAI,EAAAnT,MAAA,MAAAD,MAAA,KAAAA,MAAA;;;AAkqB/C;AAAA;;;;AAKMgE,YAAY,0BAAAqP,iBAAA,YAAArP,aAAA,UAAAqP,iBAAA,CAAAjR,KAAA,OAAAN,SAAA,eAAA+F,eAAA,CAAArE,OAAA,EAAAQ,YAAA,EAAAqP,iBAAA,MAAAC,OAAA,GAAAtP,YAAA,CAAA+D,SAAA,CAAAuL,OAAA;EACTvK,MAAM,GAAb,SAAAA,OAAA,EAAgB;IACd,OAAO,IAAI,CAACrG,KAAK,CAACqD,QAAQ;EAC5B,CAAC,QAAA/B,YAAA,GAHwBlB,cAAK,CAACiQ,SAAS","ignoreList":[]}
|
|
@@ -17,10 +17,37 @@ declare function getPositionObject(position: string): PositionObject;
|
|
|
17
17
|
declare function getElementAbsoluteRect(element: Element): Rect;
|
|
18
18
|
declare function isAbsoluteRectFullyVisible(coordinates: Offset, popupRect: Rect): boolean;
|
|
19
19
|
declare function canBecomeFullyVisible(positionName: PopupPositionsType, coordinates: Offset): boolean;
|
|
20
|
+
/** Viewport rect in document (absolute) coordinates */
|
|
21
|
+
declare function getViewportAbsoluteRect(): Rect;
|
|
22
|
+
export interface OverflowEdges {
|
|
23
|
+
top: boolean;
|
|
24
|
+
bottom: boolean;
|
|
25
|
+
left: boolean;
|
|
26
|
+
right: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Which edges of the popup (with given coordinates) overflow the viewport */
|
|
29
|
+
declare function getOverflowEdges(coordinates: Offset, popupRect: Rect): OverflowEdges;
|
|
30
|
+
/** Количество сторон, по которым попап выходит за вьюпорт (0–4) */
|
|
31
|
+
declare function getOverflowCount(overflow: OverflowEdges): number;
|
|
32
|
+
/** Предпочтительное направление по вертикали при переполнении */
|
|
33
|
+
declare function getPreferredDirection(overflow: OverflowEdges, defaultPosition: PopupPositionsType): string;
|
|
34
|
+
/** Порядок выравнивания при переполнении: при left/right — сначала right (попап влево/вправо) */
|
|
35
|
+
declare function getPreferredAlignOrder(overflow: OverflowEdges): string[];
|
|
36
|
+
/**
|
|
37
|
+
* Упорядоченный список кандидатов для fallback-позиции: при горизонтальном переполнении
|
|
38
|
+
* сначала позиции с нужным align (в т.ч. из pinnablePositions), затем по direction и positions.
|
|
39
|
+
*/
|
|
40
|
+
declare function buildFallbackCandidates(positions: Readonly<PopupPositionsType[]>, overflow: OverflowEdges, preferredDirection: string, preferredAlignOrder: string[], pinnablePositions: Readonly<PopupPositionsType[]>): PopupPositionsType[];
|
|
20
41
|
export declare const PopupHelper: {
|
|
21
42
|
getPositionObject: typeof getPositionObject;
|
|
22
43
|
getElementAbsoluteRect: typeof getElementAbsoluteRect;
|
|
23
44
|
isFullyVisible: typeof isAbsoluteRectFullyVisible;
|
|
24
45
|
canBecomeFullyVisible: typeof canBecomeFullyVisible;
|
|
46
|
+
getViewportAbsoluteRect: typeof getViewportAbsoluteRect;
|
|
47
|
+
getOverflowEdges: typeof getOverflowEdges;
|
|
48
|
+
getOverflowCount: typeof getOverflowCount;
|
|
49
|
+
getPreferredDirection: typeof getPreferredDirection;
|
|
50
|
+
getPreferredAlignOrder: typeof getPreferredAlignOrder;
|
|
51
|
+
buildFallbackCandidates: typeof buildFallbackCandidates;
|
|
25
52
|
};
|
|
26
53
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.__esModule = true;exports.PopupHelper = void 0;var _globalObject = require("@skbkontur/global-object");
|
|
1
|
+
"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.PopupHelper = void 0;var _createForOfIteratorHelperLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelperLoose"));var _globalObject = require("@skbkontur/global-object");
|
|
2
2
|
|
|
3
3
|
var _getDOMRect = require("../../lib/dom/getDOMRect");
|
|
4
4
|
|
|
@@ -122,6 +122,123 @@ function _rectContainsRect(outerRect, innerRect) {
|
|
|
122
122
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
/** Viewport rect in document (absolute) coordinates */
|
|
126
|
+
function getViewportAbsoluteRect() {
|
|
127
|
+
return convertRectToAbsolute(_getWindowRelativeRect());
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
/** Which edges of the popup (with given coordinates) overflow the viewport */
|
|
138
|
+
function getOverflowEdges(coordinates, popupRect) {
|
|
139
|
+
var viewport = getViewportAbsoluteRect();
|
|
140
|
+
var popup = {
|
|
141
|
+
top: coordinates.top,
|
|
142
|
+
left: coordinates.left,
|
|
143
|
+
width: popupRect.width,
|
|
144
|
+
height: popupRect.height
|
|
145
|
+
};
|
|
146
|
+
return {
|
|
147
|
+
top: popup.top < viewport.top,
|
|
148
|
+
bottom: popup.top + popup.height > viewport.top + viewport.height,
|
|
149
|
+
left: popup.left < viewport.left,
|
|
150
|
+
right: popup.left + popup.width > viewport.left + viewport.width
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Количество сторон, по которым попап выходит за вьюпорт (0–4) */
|
|
155
|
+
function getOverflowCount(overflow) {
|
|
156
|
+
return [overflow.top, overflow.bottom, overflow.left, overflow.right].filter(Boolean).length;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Предпочтительное направление по вертикали при переполнении */
|
|
160
|
+
function getPreferredDirection(overflow, defaultPosition) {
|
|
161
|
+
if (overflow.bottom) {
|
|
162
|
+
return 'top';
|
|
163
|
+
}
|
|
164
|
+
if (overflow.top) {
|
|
165
|
+
return 'bottom';
|
|
166
|
+
}
|
|
167
|
+
return getPositionObject(defaultPosition).direction;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Порядок выравнивания при переполнении: при left/right — сначала right (попап влево/вправо) */
|
|
171
|
+
function getPreferredAlignOrder(overflow) {
|
|
172
|
+
if (overflow.left || overflow.right) {
|
|
173
|
+
return ['right', 'center', 'left'];
|
|
174
|
+
}
|
|
175
|
+
return ['center', 'left', 'right'];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
var VERTICAL_DIRECTIONS = ['bottom', 'top'];
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Упорядоченный список кандидатов для fallback-позиции: при горизонтальном переполнении
|
|
182
|
+
* сначала позиции с нужным align (в т.ч. из pinnablePositions), затем по direction и positions.
|
|
183
|
+
*/
|
|
184
|
+
function buildFallbackCandidates(
|
|
185
|
+
positions,
|
|
186
|
+
overflow,
|
|
187
|
+
preferredDirection,
|
|
188
|
+
preferredAlignOrder,
|
|
189
|
+
pinnablePositions)
|
|
190
|
+
{
|
|
191
|
+
var seen = new Set();
|
|
192
|
+
var add = function add(p) {
|
|
193
|
+
if (!seen.has(p)) {
|
|
194
|
+
seen.add(p);
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
return false;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
var candidates = [];
|
|
201
|
+
var hasHorizontalOverflow = overflow.left || overflow.right;
|
|
202
|
+
|
|
203
|
+
if (hasHorizontalOverflow) {
|
|
204
|
+
var preferredAlign = preferredAlignOrder[0];
|
|
205
|
+
for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(VERTICAL_DIRECTIONS), _step; !(_step = _iterator()).done;) {var dir = _step.value;
|
|
206
|
+
var p = dir + " " + preferredAlign;
|
|
207
|
+
if (pinnablePositions.includes(p) && add(p)) {
|
|
208
|
+
candidates.push(p);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
for (var _iterator2 = (0, _createForOfIteratorHelperLoose2.default)(preferredAlignOrder), _step2; !(_step2 = _iterator2()).done;) {var align = _step2.value;
|
|
212
|
+
for (var _iterator3 = (0, _createForOfIteratorHelperLoose2.default)(positions), _step3; !(_step3 = _iterator3()).done;) {var _p = _step3.value;
|
|
213
|
+
if (getPositionObject(_p).align === align && add(_p)) {
|
|
214
|
+
candidates.push(_p);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
for (var _iterator4 = (0, _createForOfIteratorHelperLoose2.default)(preferredAlignOrder), _step4; !(_step4 = _iterator4()).done;) {var _align = _step4.value;
|
|
221
|
+
for (var _iterator7 = (0, _createForOfIteratorHelperLoose2.default)(positions), _step7; !(_step7 = _iterator7()).done;) {var _p2 = _step7.value;
|
|
222
|
+
var pos = getPositionObject(_p2);
|
|
223
|
+
if (pos.direction === preferredDirection && pos.align === _align && add(_p2)) {
|
|
224
|
+
candidates.push(_p2);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
for (var _iterator5 = (0, _createForOfIteratorHelperLoose2.default)(positions), _step5; !(_step5 = _iterator5()).done;) {var _p3 = _step5.value;
|
|
229
|
+
if (getPositionObject(_p3).direction === preferredDirection && add(_p3)) {
|
|
230
|
+
candidates.push(_p3);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
for (var _iterator6 = (0, _createForOfIteratorHelperLoose2.default)(positions), _step6; !(_step6 = _iterator6()).done;) {var _p4 = _step6.value;
|
|
234
|
+
if (add(_p4)) {
|
|
235
|
+
candidates.push(_p4);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return candidates;
|
|
240
|
+
}
|
|
241
|
+
|
|
125
242
|
function _getViewProperty(getProperty) {var _globalObject$documen, _globalObject$documen2;
|
|
126
243
|
var views = [(_globalObject$documen = _globalObject.globalObject.document) == null ? void 0 : _globalObject$documen.documentElement, (_globalObject$documen2 = _globalObject.globalObject.document) == null ? void 0 : _globalObject$documen2.body];
|
|
127
244
|
return views.map(function (x) {return x && getProperty(x);}).find(Boolean) || 0;
|
|
@@ -131,5 +248,11 @@ var PopupHelper = exports.PopupHelper = {
|
|
|
131
248
|
getPositionObject: getPositionObject,
|
|
132
249
|
getElementAbsoluteRect: getElementAbsoluteRect,
|
|
133
250
|
isFullyVisible: isAbsoluteRectFullyVisible,
|
|
134
|
-
canBecomeFullyVisible: canBecomeFullyVisible
|
|
251
|
+
canBecomeFullyVisible: canBecomeFullyVisible,
|
|
252
|
+
getViewportAbsoluteRect: getViewportAbsoluteRect,
|
|
253
|
+
getOverflowEdges: getOverflowEdges,
|
|
254
|
+
getOverflowCount: getOverflowCount,
|
|
255
|
+
getPreferredDirection: getPreferredDirection,
|
|
256
|
+
getPreferredAlignOrder: getPreferredAlignOrder,
|
|
257
|
+
buildFallbackCandidates: buildFallbackCandidates
|
|
135
258
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_globalObject","require","_getDOMRect","getPositionObject","position","x","split","direction","align","getElementAbsoluteRect","element","rect","_getElementRelativeRect","convertRectToAbsolute","isAbsoluteRectFullyVisible","coordinates","popupRect","windowRelativeRect","_getWindowRelativeRect","windowAbsoluteRect","absoluteRect","top","left","height","width","_rectContainsRect","canBecomeFullyVisible","positionName","availableScrollDistances","getDOMRect","right","bottom","_getViewProperty","clientWidth","globalObject","innerWidth","clientHeight","innerHeight","offset","_getAbsoluteOffset","scrollTop","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","outerRect","innerRect","getProperty","_globalObject$documen","_globalObject$documen2","views","document","documentElement","body","map","find","Boolean","PopupHelper","exports","isFullyVisible"],"sources":["PopupHelper.tsx"],"sourcesContent":["import { globalObject } from '@skbkontur/global-object';\n\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\n\nimport type { PopupPositionsType } from './Popup';\n\nexport interface Rect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nexport interface Offset {\n top: number;\n left: number;\n}\n\nexport interface PositionObject {\n direction: string;\n align: string;\n}\n\nfunction getPositionObject(position: string): PositionObject {\n const x = position.split(' ');\n\n return {\n direction: x[0],\n align: x[1],\n };\n}\n\nfunction getElementAbsoluteRect(element: Element): Rect {\n const rect = _getElementRelativeRect(element);\n return convertRectToAbsolute(rect);\n}\n\nfunction isAbsoluteRectFullyVisible(coordinates: Offset, popupRect: Rect): boolean {\n const windowRelativeRect = _getWindowRelativeRect();\n const windowAbsoluteRect = convertRectToAbsolute(windowRelativeRect);\n const absoluteRect = {\n top: coordinates.top,\n left: coordinates.left,\n height: popupRect.height,\n width: popupRect.width,\n };\n\n return _rectContainsRect(windowAbsoluteRect, absoluteRect);\n}\n\n// Can become fully visible by scrolling into viewport\nfunction canBecomeFullyVisible(positionName: PopupPositionsType, coordinates: Offset) {\n const position = getPositionObject(positionName);\n\n if (position.direction === 'top') {\n const availableScrollDistances = convertRectToAbsolute(_getWindowRelativeRect());\n return coordinates.top + availableScrollDistances.top >= 0;\n }\n\n if (position.direction === 'left') {\n const availableScrollDistances = convertRectToAbsolute(_getWindowRelativeRect());\n return coordinates.left + availableScrollDistances.left >= 0;\n }\n\n // NOTE: for bottom/right cases browser will always expand document size\n return true;\n}\n\nfunction _getElementRelativeRect(element: Element) {\n const rect = getDOMRect(element);\n\n return {\n top: rect.top,\n left: rect.left,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n}\n\nfunction _getWindowRelativeRect(): Rect {\n return {\n top: 0,\n left: 0,\n width: _getViewProperty((x) => x.clientWidth) || globalObject.innerWidth || 0,\n height: _getViewProperty((x) => x.clientHeight) || globalObject.innerHeight || 0,\n };\n}\n\nfunction convertRectToAbsolute(rect: Rect): Rect {\n const offset = _getAbsoluteOffset();\n\n return {\n top: rect.top + offset.top,\n left: rect.left + offset.left,\n width: rect.width,\n height: rect.height,\n };\n}\n\nfunction _getAbsoluteOffset(): Offset {\n const scrollTop = globalObject.pageYOffset || _getViewProperty((x) => x.scrollTop);\n const scrollLeft = globalObject.pageXOffset || _getViewProperty((x) => x.scrollLeft);\n\n const clientTop = _getViewProperty((x) => x.clientTop);\n const clientLeft = _getViewProperty((x) => x.clientLeft);\n\n const top = scrollTop - clientTop;\n const left = scrollLeft - clientLeft;\n\n return {\n top,\n left,\n };\n}\n\nfunction _rectContainsRect(outerRect: Rect, innerRect: Rect): boolean {\n return (\n innerRect.top > outerRect.top &&\n innerRect.top + innerRect.height < outerRect.top + outerRect.height &&\n innerRect.left > outerRect.left &&\n innerRect.left + innerRect.width < outerRect.left + outerRect.width\n );\n}\n\nfunction _getViewProperty(getProperty: (e: Element) => number): number {\n const views = [globalObject.document?.documentElement, globalObject.document?.body];\n return views.map((x) => x && getProperty(x)).find(Boolean) || 0;\n}\n\nexport const PopupHelper = {\n getPositionObject,\n getElementAbsoluteRect,\n isFullyVisible: isAbsoluteRectFullyVisible,\n canBecomeFullyVisible,\n};\n"],"mappings":"oEAAA,IAAAA,aAAA,GAAAC,OAAA;;AAEA,IAAAC,WAAA,GAAAD,OAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,SAASE,iBAAiBA,CAACC,QAAgB,EAAkB;EAC3D,IAAMC,CAAC,GAAGD,QAAQ,CAACE,KAAK,CAAC,GAAG,CAAC;;EAE7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AA,GAAG;EACzBvD,iBAAiB,EAAjBA,iBAAiB;EACjBM,sBAAsB,EAAtBA,sBAAsB;EACtBmD,cAAc,EAAE9C,0BAA0B;EAC1CY,qBAAqB,EAArBA;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_globalObject","require","_getDOMRect","getPositionObject","position","x","split","direction","align","getElementAbsoluteRect","element","rect","_getElementRelativeRect","convertRectToAbsolute","isAbsoluteRectFullyVisible","coordinates","popupRect","windowRelativeRect","_getWindowRelativeRect","windowAbsoluteRect","absoluteRect","top","left","height","width","_rectContainsRect","canBecomeFullyVisible","positionName","availableScrollDistances","getDOMRect","right","bottom","_getViewProperty","clientWidth","globalObject","innerWidth","clientHeight","innerHeight","offset","_getAbsoluteOffset","scrollTop","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","outerRect","innerRect","getViewportAbsoluteRect","getOverflowEdges","viewport","popup","getOverflowCount","overflow","filter","Boolean","length","getPreferredDirection","defaultPosition","getPreferredAlignOrder","VERTICAL_DIRECTIONS","buildFallbackCandidates","positions","preferredDirection","preferredAlignOrder","pinnablePositions","seen","Set","add","p","has","candidates","hasHorizontalOverflow","preferredAlign","_iterator","_createForOfIteratorHelperLoose2","default","_step","done","dir","value","includes","push","_iterator2","_step2","_iterator3","_step3","_iterator4","_step4","_iterator7","_step7","pos","_iterator5","_step5","_iterator6","_step6","getProperty","_globalObject$documen","_globalObject$documen2","views","document","documentElement","body","map","find","PopupHelper","exports","isFullyVisible"],"sources":["PopupHelper.tsx"],"sourcesContent":["import { globalObject } from '@skbkontur/global-object';\n\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\n\nimport type { PopupPositionsType } from './Popup';\n\nexport interface Rect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nexport interface Offset {\n top: number;\n left: number;\n}\n\nexport interface PositionObject {\n direction: string;\n align: string;\n}\n\nfunction getPositionObject(position: string): PositionObject {\n const x = position.split(' ');\n\n return {\n direction: x[0],\n align: x[1],\n };\n}\n\nfunction getElementAbsoluteRect(element: Element): Rect {\n const rect = _getElementRelativeRect(element);\n return convertRectToAbsolute(rect);\n}\n\nfunction isAbsoluteRectFullyVisible(coordinates: Offset, popupRect: Rect): boolean {\n const windowRelativeRect = _getWindowRelativeRect();\n const windowAbsoluteRect = convertRectToAbsolute(windowRelativeRect);\n const absoluteRect = {\n top: coordinates.top,\n left: coordinates.left,\n height: popupRect.height,\n width: popupRect.width,\n };\n\n return _rectContainsRect(windowAbsoluteRect, absoluteRect);\n}\n\n// Can become fully visible by scrolling into viewport\nfunction canBecomeFullyVisible(positionName: PopupPositionsType, coordinates: Offset) {\n const position = getPositionObject(positionName);\n\n if (position.direction === 'top') {\n const availableScrollDistances = convertRectToAbsolute(_getWindowRelativeRect());\n return coordinates.top + availableScrollDistances.top >= 0;\n }\n\n if (position.direction === 'left') {\n const availableScrollDistances = convertRectToAbsolute(_getWindowRelativeRect());\n return coordinates.left + availableScrollDistances.left >= 0;\n }\n\n // NOTE: for bottom/right cases browser will always expand document size\n return true;\n}\n\nfunction _getElementRelativeRect(element: Element) {\n const rect = getDOMRect(element);\n\n return {\n top: rect.top,\n left: rect.left,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n}\n\nfunction _getWindowRelativeRect(): Rect {\n return {\n top: 0,\n left: 0,\n width: _getViewProperty((x) => x.clientWidth) || globalObject.innerWidth || 0,\n height: _getViewProperty((x) => x.clientHeight) || globalObject.innerHeight || 0,\n };\n}\n\nfunction convertRectToAbsolute(rect: Rect): Rect {\n const offset = _getAbsoluteOffset();\n\n return {\n top: rect.top + offset.top,\n left: rect.left + offset.left,\n width: rect.width,\n height: rect.height,\n };\n}\n\nfunction _getAbsoluteOffset(): Offset {\n const scrollTop = globalObject.pageYOffset || _getViewProperty((x) => x.scrollTop);\n const scrollLeft = globalObject.pageXOffset || _getViewProperty((x) => x.scrollLeft);\n\n const clientTop = _getViewProperty((x) => x.clientTop);\n const clientLeft = _getViewProperty((x) => x.clientLeft);\n\n const top = scrollTop - clientTop;\n const left = scrollLeft - clientLeft;\n\n return {\n top,\n left,\n };\n}\n\nfunction _rectContainsRect(outerRect: Rect, innerRect: Rect): boolean {\n return (\n innerRect.top > outerRect.top &&\n innerRect.top + innerRect.height < outerRect.top + outerRect.height &&\n innerRect.left > outerRect.left &&\n innerRect.left + innerRect.width < outerRect.left + outerRect.width\n );\n}\n\n/** Viewport rect in document (absolute) coordinates */\nfunction getViewportAbsoluteRect(): Rect {\n return convertRectToAbsolute(_getWindowRelativeRect());\n}\n\nexport interface OverflowEdges {\n top: boolean;\n bottom: boolean;\n left: boolean;\n right: boolean;\n}\n\n/** Which edges of the popup (with given coordinates) overflow the viewport */\nfunction getOverflowEdges(coordinates: Offset, popupRect: Rect): OverflowEdges {\n const viewport = getViewportAbsoluteRect();\n const popup = {\n top: coordinates.top,\n left: coordinates.left,\n width: popupRect.width,\n height: popupRect.height,\n };\n return {\n top: popup.top < viewport.top,\n bottom: popup.top + popup.height > viewport.top + viewport.height,\n left: popup.left < viewport.left,\n right: popup.left + popup.width > viewport.left + viewport.width,\n };\n}\n\n/** Количество сторон, по которым попап выходит за вьюпорт (0–4) */\nfunction getOverflowCount(overflow: OverflowEdges): number {\n return [overflow.top, overflow.bottom, overflow.left, overflow.right].filter(Boolean).length;\n}\n\n/** Предпочтительное направление по вертикали при переполнении */\nfunction getPreferredDirection(overflow: OverflowEdges, defaultPosition: PopupPositionsType): string {\n if (overflow.bottom) {\n return 'top';\n }\n if (overflow.top) {\n return 'bottom';\n }\n return getPositionObject(defaultPosition).direction;\n}\n\n/** Порядок выравнивания при переполнении: при left/right — сначала right (попап влево/вправо) */\nfunction getPreferredAlignOrder(overflow: OverflowEdges): string[] {\n if (overflow.left || overflow.right) {\n return ['right', 'center', 'left'];\n }\n return ['center', 'left', 'right'];\n}\n\nconst VERTICAL_DIRECTIONS = ['bottom', 'top'] as const;\n\n/**\n * Упорядоченный список кандидатов для fallback-позиции: при горизонтальном переполнении\n * сначала позиции с нужным align (в т.ч. из pinnablePositions), затем по direction и positions.\n */\nfunction buildFallbackCandidates(\n positions: Readonly<PopupPositionsType[]>,\n overflow: OverflowEdges,\n preferredDirection: string,\n preferredAlignOrder: string[],\n pinnablePositions: Readonly<PopupPositionsType[]>,\n): PopupPositionsType[] {\n const seen = new Set<PopupPositionsType>();\n const add = (p: PopupPositionsType) => {\n if (!seen.has(p)) {\n seen.add(p);\n return true;\n }\n return false;\n };\n\n const candidates: PopupPositionsType[] = [];\n const hasHorizontalOverflow = overflow.left || overflow.right;\n\n if (hasHorizontalOverflow) {\n const preferredAlign = preferredAlignOrder[0];\n for (const dir of VERTICAL_DIRECTIONS) {\n const p = `${dir} ${preferredAlign}` as PopupPositionsType;\n if (pinnablePositions.includes(p) && add(p)) {\n candidates.push(p);\n }\n }\n for (const align of preferredAlignOrder) {\n for (const p of positions) {\n if (getPositionObject(p).align === align && add(p)) {\n candidates.push(p);\n }\n }\n }\n }\n\n for (const align of preferredAlignOrder) {\n for (const p of positions) {\n const pos = getPositionObject(p);\n if (pos.direction === preferredDirection && pos.align === align && add(p)) {\n candidates.push(p);\n }\n }\n }\n for (const p of positions) {\n if (getPositionObject(p).direction === preferredDirection && add(p)) {\n candidates.push(p);\n }\n }\n for (const p of positions) {\n if (add(p)) {\n candidates.push(p);\n }\n }\n\n return candidates;\n}\n\nfunction _getViewProperty(getProperty: (e: Element) => number): number {\n const views = [globalObject.document?.documentElement, globalObject.document?.body];\n return views.map((x) => x && getProperty(x)).find(Boolean) || 0;\n}\n\nexport const PopupHelper = {\n getPositionObject,\n getElementAbsoluteRect,\n isFullyVisible: isAbsoluteRectFullyVisible,\n canBecomeFullyVisible,\n getViewportAbsoluteRect,\n getOverflowEdges,\n getOverflowCount,\n getPreferredDirection,\n getPreferredAlignOrder,\n buildFallbackCandidates,\n};\n"],"mappings":"iSAAA,IAAAA,aAAA,GAAAC,OAAA;;AAEA,IAAAC,WAAA,GAAAD,OAAA;;;;;;;;;;;;;;;;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AAC,OAAA,EAAgBd,SAAS,GAAAiC,MAAA,IAAAA,MAAA,GAAAD,UAAA,IAAAhB,IAAA,GAAE,KAAhBT,GAAC,GAAA0B,MAAA,CAAAf,KAAA;IACV,IAAIZ,GAAG,CAACC,GAAC,CAAC,EAAE;MACVE,UAAU,CAACW,IAAI,CAACb,GAAC,CAAC;IACpB;EACF;;EAEA,OAAOE,UAAU;AACnB;;AAEA,SAASvC,gBAAgBA,CAACgE,WAAmC,EAAU,KAAAC,qBAAA,EAAAC,sBAAA;EACrE,IAAMC,KAAK,GAAG,EAAAF,qBAAA,GAAC/D,0BAAY,CAACkE,QAAQ,qBAArBH,qBAAA,CAAuBI,eAAe,GAAAH,sBAAA,GAAEhE,0BAAY,CAACkE,QAAQ,qBAArBF,sBAAA,CAAuBI,IAAI,CAAC;EACnF,OAAOH,KAAK,CAACI,GAAG,CAAC,UAAClG,CAAC,UAAKA,CAAC,IAAI2F,WAAW,CAAC3F,CAAC,CAAC,GAAC,CAACmG,IAAI,CAACjD,OAAO,CAAC,IAAI,CAAC;AACjE;;AAEO,IAAMkD,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACzBtG,iBAAiB,EAAjBA,iBAAiB;EACjBM,sBAAsB,EAAtBA,sBAAsB;EACtBkG,cAAc,EAAE7F,0BAA0B;EAC1CY,qBAAqB,EAArBA,qBAAqB;EACrBsB,uBAAuB,EAAvBA,uBAAuB;EACvBC,gBAAgB,EAAhBA,gBAAgB;EAChBG,gBAAgB,EAAhBA,gBAAgB;EAChBK,qBAAqB,EAArBA,qBAAqB;EACrBE,sBAAsB,EAAtBA,sBAAsB;EACtBE,uBAAuB,EAAvBA;AACF,CAAC","ignoreList":[]}
|
|
@@ -95,6 +95,7 @@ export var ComboBoxView = responsiveLayout(_class = rootNode(_class = withSize(_
|
|
|
95
95
|
React.createElement(Popup, {
|
|
96
96
|
opened: true,
|
|
97
97
|
hasShadow: true,
|
|
98
|
+
tryBestFallbackPosition: true,
|
|
98
99
|
minWidth: "100%",
|
|
99
100
|
anchorElement: anchorElement,
|
|
100
101
|
priority: ZIndex.priorities.PopupMenu,
|