@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","getRandomID","isNonNullable","Input","InputLikeText","RenderLayer","Spinner","CommonWrapper","MobilePopup","responsiveLayout","rootNode","getRootNode","createPropsGetter","ThemeContext","LoadingIcon","Popup","getMenuPositions","ZIndex","MaskedInput","styles","MaskedInputStyles","cx","InternalTextareaWithLayout","withSize","ArrowDownIcon","ComboBoxMenu","ComboBoxRequestStatus","CustomComboBoxDataTids","getComboBoxTheme","ComboBoxViewIds","menu","ComboBoxView","_class","_ComboBoxView","_React$Component","_this$props$value","_this","_len","arguments","length","args","Array","_key","call","apply","concat","getProps","defaultProps","mobileInput","dropdownContainerRef","createRef","menuId","state","anchorElement","clearCrossShowed","props","showClearIcon","value","toString","getComboBoxMenu","_this$props","items","loading","opened","refMenu","maxMenuHeight","renderTotalCount","renderNotFound","totalCount","_this$getProps","repeatRequest","requestStatus","renderItem","itemWrapper","createElement","hasMargin","onValueChange","handleItemSelect","renderAddButton","isMobile","isMobileLayout","size","renderMenu","_this$getProps2","menuPos","menuAlign","hasShadow","minWidth","priority","priorities","PopupMenu","positions","disablePortal","margin","parseInt","theme","menuOffsetY","ref","renderMobileMenu","rightIcon","_this$props2","onFocus","onInputValueChange","onInputKeyDown","placeholder","textValue","renderSpinner","inputProps","autoComplete","autoFocus","width","onKeyDown","headerChildComponent","_extends","refMobileInput","onCloseRequest","onMobileClose","getParent","handleMobileFocus","_this$mobileInput","onInputClick","focus","item","refInput","input","className","spinnerWrapper","type","caption","dimmed","getRightIcon","_this$props3","drawArrow","_inheritsLoose","_proto","prototype","componentDidMount","updateAnchorElement","parent","setState","componentDidUpdate","prevProps","editing","render","_this2","Consumer","viewMode","Provider","renderMain","_this$props4","onMouseEnter","onMouseLeave","onMouseOver","_this$getProps3","onClickOutside","onFocusOutside","renderInput","active","comboBoxView","style","root","setRootNode","_this$props5","id","align","borderless","disabled","error","onInputBlur","onInputFocus","warning","refInputLikeText","leftIcon","inputMode","ariaDescribedby","ariaLabel","mask","maskChar","formatChars","onBeforePasteInMask","maxLength","onBlur","undefined","onClick","multilineTextareaProps","autoResize","rows","extraRow","maxRows","onBeforePasteValue","_this$getProps4","renderValue","onClearCrossClick","Component","__KONTUR_REACT_UI__","displayName","Unknown"],"sources":["ComboBoxView.tsx"],"sourcesContent":["import type { AriaAttributes, HTMLAttributes } from 'react';\nimport React from 'react';\n\nimport { getRandomID, isNonNullable } from '../../lib/utils';\nimport type { InputIconType, InputProps, ShowClearIcon } from '../../components/Input';\nimport { Input } from '../../components/Input';\nimport { InputLikeText } from '../InputLikeText';\nimport type { Menu } from '../Menu';\nimport type { MenuItemState } from '../../components/MenuItem';\nimport { RenderLayer } from '../RenderLayer';\nimport { Spinner } from '../../components/Spinner';\nimport type { Nullable } from '../../typings/utility-types';\nimport type { CommonProps } from '../CommonWrapper';\nimport { CommonWrapper } from '../CommonWrapper';\nimport { MobilePopup } from '../MobilePopup';\nimport { responsiveLayout } from '../../components/ResponsiveLayout/decorator';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { rootNode, getRootNode } from '../../lib/rootNode';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { LoadingIcon } from '../icons2022/LoadingIcon';\nimport type { ComboBoxExtendedItem, ComboBoxViewMode } from '../../components/ComboBox';\nimport type { SizeProp } from '../../lib/types/props';\nimport { Popup } from '../Popup';\nimport { getMenuPositions } from '../../lib/getMenuPositions';\nimport { ZIndex } from '../ZIndex';\nimport type { MaskedInputOnBeforePasteValue, MaskedInputProps } from '../../components/MaskedInput';\nimport { MaskedInput } from '../../components/MaskedInput';\nimport { styles as MaskedInputStyles } from '../../components/MaskedInput/MaskedInput.styles';\nimport { cx } from '../../lib/theming/Emotion';\nimport { InternalTextareaWithLayout } from '../InternalTextareaWithLayout/InternalTextareaWithLayout';\nimport { withSize } from '../../lib/size/SizeDecorator';\n\nimport { ArrowDownIcon } from './ArrowDownIcon';\nimport { ComboBoxMenu } from './ComboBoxMenu';\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes';\nimport { styles } from './CustomComboBox.styles';\nimport { CustomComboBoxDataTids } from './CustomComboBox';\nimport { getComboBoxTheme } from './getComboBoxTheme';\n\ninterface ComboBoxViewProps<T>\n extends Pick<AriaAttributes, 'aria-describedby' | 'aria-label'>,\n Pick<HTMLAttributes<HTMLElement>, 'id'>,\n CommonProps,\n Partial<Pick<MaskedInputProps, 'mask' | 'maskChar' | 'formatChars'>> {\n align?: 'left' | 'center' | 'right';\n autoFocus?: boolean;\n borderless?: boolean;\n disablePortal?: boolean;\n disabled?: boolean;\n editing?: boolean;\n /**\n * Cостояние валидации при ошибке.\n */\n error?: boolean;\n items?: Nullable<Array<ComboBoxExtendedItem<T>>>;\n loading?: boolean;\n /**\n * Позволяет вручную задать текущую позицию выпадающего окна\n */\n menuPos?: 'top' | 'bottom';\n menuAlign?: 'left' | 'right';\n opened?: boolean;\n drawArrow?: boolean;\n placeholder?: string;\n size?: SizeProp;\n textValue?: string;\n totalCount?: number;\n value?: Nullable<T>;\n showClearIcon?: ShowClearIcon;\n /**\n * Cостояние валидации при предупреждении.\n */\n warning?: boolean;\n width?: string | number;\n maxLength?: number;\n maxMenuHeight?: number | string;\n leftIcon?: InputIconType;\n rightIcon?: InputIconType;\n inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];\n\n onBeforePasteInMask?: MaskedInputOnBeforePasteValue;\n onValueChange?: (value: T) => void;\n onClickOutside?: (e: Event) => void;\n onFocus?: () => void;\n onMobileClose?: () => void;\n onFocusOutside?: () => void;\n onInputBlur?: () => void;\n onInputValueChange?: (value: string) => void;\n onInputFocus?: () => void;\n onInputClick?: () => void;\n onClearCrossClick?: () => void;\n onInputKeyDown?: (e: React.KeyboardEvent) => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseOver?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n renderItem?: (item: T, state: MenuItemState) => React.ReactNode;\n itemWrapper?: (item: T) => React.ComponentType;\n renderNotFound?: () => React.ReactNode;\n renderTotalCount?: (found: number, total: number) => React.ReactNode;\n renderValue?: (item: T) => React.ReactNode;\n renderAddButton?: (query?: string) => React.ReactNode;\n repeatRequest?: () => void;\n requestStatus?: ComboBoxRequestStatus;\n refInput?: (input: Nullable<Input | InternalTextareaWithLayout>) => void;\n refMenu?: (menu: Nullable<Menu>) => void;\n refInputLikeText?: (inputLikeText: Nullable<InputLikeText>) => void;\n viewMode?: ComboBoxViewMode;\n maxRows?: number;\n}\n\ntype DefaultProps<T> = Required<\n Pick<\n ComboBoxViewProps<T>,\n | 'renderItem'\n | 'renderValue'\n | 'renderAddButton'\n | 'repeatRequest'\n | 'requestStatus'\n | 'onClickOutside'\n | 'onFocusOutside'\n | 'width'\n | 'showClearIcon'\n >\n>;\n\nexport const ComboBoxViewIds = {\n menu: 'ComboBoxView__menu',\n};\n\ninterface ComboBoxViewState {\n anchorElement: Nullable<Element>;\n clearCrossShowed: boolean;\n}\n\n@responsiveLayout\n@rootNode\n@withSize\nexport class ComboBoxView<T> extends React.Component<ComboBoxViewProps<T>, ComboBoxViewState> {\n public static __KONTUR_REACT_UI__ = 'ComboBoxView';\n public static displayName = 'ComboBoxView';\n\n public static defaultProps: DefaultProps<unknown> = {\n renderItem: (item: any) => item,\n renderValue: (item: any) => item,\n renderAddButton: () => null,\n repeatRequest: () => undefined,\n requestStatus: ComboBoxRequestStatus.Unknown,\n onClickOutside: () => {\n /**/\n },\n onFocusOutside: () => {\n /**/\n },\n width: 250,\n showClearIcon: 'never',\n };\n\n private getProps = createPropsGetter(ComboBoxView.defaultProps);\n\n public getRootNode!: TGetRootNode;\n private input: Nullable<Input | InternalTextareaWithLayout>;\n private setRootNode!: TSetRootNode;\n private mobileInput: Nullable<Input> = null;\n private isMobileLayout!: boolean;\n private dropdownContainerRef = React.createRef<Popup>();\n private theme!: Theme;\n private size!: SizeProp;\n private menuId = ComboBoxViewIds.menu + getRandomID();\n\n public state = {\n anchorElement: null,\n clearCrossShowed: this.props.showClearIcon === 'always' && !!this.props.value?.toString(),\n };\n\n public componentDidMount() {\n this.updateAnchorElement();\n\n if (this.props.autoFocus && this.props.onFocus) {\n this.props.onFocus();\n }\n }\n\n updateAnchorElement() {\n const parent = this.getParent();\n const anchorElement = this.state.anchorElement;\n\n if (anchorElement !== parent) {\n this.setState({\n anchorElement: parent,\n });\n }\n }\n\n public componentDidUpdate(prevProps: ComboBoxViewProps<T>) {\n const { input, props } = this;\n\n this.updateAnchorElement();\n\n if (props.editing && !prevProps.editing && input) {\n input.focus();\n }\n }\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = getComboBoxTheme(theme, this.props.viewMode);\n return <ThemeContext.Provider value={this.theme}>{this.renderMain()}</ThemeContext.Provider>;\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public renderMain() {\n const { onMouseEnter, onMouseLeave, onMouseOver, opened } = this.props;\n const { onClickOutside, onFocusOutside, width } = this.getProps();\n\n const isMobile = this.isMobileLayout;\n\n const input = this.renderInput();\n\n return (\n <CommonWrapper {...this.props}>\n <RenderLayer onClickOutside={onClickOutside} onFocusOutside={onFocusOutside} active={opened}>\n <span\n data-tid={CustomComboBoxDataTids.comboBoxView}\n style={{ width }}\n className={styles.root()}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onMouseOver={onMouseOver}\n ref={this.setRootNode}\n >\n {input}\n {isMobile ? this.renderMobileMenu() : this.renderMenu()}\n </span>\n </RenderLayer>\n </CommonWrapper>\n );\n }\n\n private getComboBoxMenu = () => {\n const { items, loading, opened, refMenu, maxMenuHeight, renderTotalCount, renderNotFound, totalCount } = this.props;\n\n const { repeatRequest, requestStatus, renderItem, itemWrapper } = this.getProps();\n return (\n <ComboBoxMenu\n hasMargin={false}\n menuId={this.menuId}\n items={items}\n loading={loading}\n maxMenuHeight={maxMenuHeight}\n onValueChange={this.handleItemSelect}\n opened={opened}\n refMenu={refMenu}\n renderTotalCount={renderTotalCount}\n renderItem={renderItem}\n renderNotFound={renderNotFound}\n itemWrapper={itemWrapper}\n renderAddButton={this.renderAddButton}\n repeatRequest={repeatRequest}\n requestStatus={requestStatus}\n totalCount={totalCount}\n isMobile={this.isMobileLayout}\n size={this.size}\n />\n );\n };\n\n private renderMenu = () => {\n const { opened, menuPos, menuAlign } = this.getProps();\n const { anchorElement } = this.state;\n\n return (\n opened &&\n anchorElement && (\n <Popup\n opened\n hasShadow\n minWidth=\"100%\"\n anchorElement={anchorElement}\n priority={ZIndex.priorities.PopupMenu}\n positions={getMenuPositions(menuPos, menuAlign)}\n disablePortal={this.props.disablePortal}\n margin={parseInt(this.theme.menuOffsetY) - 1}\n ref={this.dropdownContainerRef}\n >\n {this.getComboBoxMenu()}\n </Popup>\n )\n );\n };\n\n private renderMobileMenu = () => {\n let rightIcon = null;\n\n const { loading, items, opened, onFocus, onInputValueChange, onInputKeyDown, placeholder, textValue } = this.props;\n if (loading && items && !!items.length) {\n rightIcon = this.renderSpinner();\n }\n\n const inputProps: InputProps = {\n autoComplete: 'off',\n autoFocus: true,\n width: '100%',\n onFocus,\n onValueChange: onInputValueChange,\n onKeyDown: onInputKeyDown,\n value: textValue,\n placeholder,\n rightIcon,\n };\n\n return (\n opened && (\n <MobilePopup\n headerChildComponent={<Input ref={this.refMobileInput} {...inputProps} />}\n onCloseRequest={this.props.onMobileClose}\n opened\n >\n {this.getComboBoxMenu()}\n </MobilePopup>\n )\n );\n };\n\n private getParent = () => {\n return getRootNode(this);\n };\n\n private renderAddButton = (): React.ReactNode => {\n return this.getProps().renderAddButton(this.props.textValue);\n };\n\n private renderInput(): React.ReactNode {\n const isMobile = this.isMobileLayout;\n\n const {\n id,\n align,\n borderless,\n disabled,\n editing,\n error,\n onFocus,\n onInputBlur,\n onInputValueChange,\n onInputFocus,\n onInputClick,\n onInputKeyDown,\n placeholder,\n textValue,\n value,\n warning,\n refInputLikeText,\n leftIcon,\n inputMode,\n 'aria-describedby': ariaDescribedby,\n 'aria-label': ariaLabel,\n showClearIcon,\n mask,\n maskChar,\n formatChars,\n onBeforePasteInMask,\n } = this.props;\n\n const rightIcon = this.getRightIcon();\n\n const inputProps = {\n id,\n align,\n borderless,\n disabled,\n error,\n maxLength: this.props.maxLength,\n onBlur: isMobile ? undefined : onInputBlur,\n onValueChange: onInputValueChange,\n onFocus: onInputFocus,\n onClick: isMobile ? this.handleMobileFocus : onInputClick,\n leftIcon,\n rightIcon,\n value: textValue || '',\n onKeyDown: onInputKeyDown,\n placeholder,\n width: '100%',\n ref: this.refInput,\n warning,\n inputMode,\n autoComplete: 'off',\n 'aria-describedby': ariaDescribedby,\n 'aria-controls': this.menuId,\n 'aria-label': ariaLabel,\n showClearIcon,\n size: this.size,\n };\n\n const multilineTextareaProps = {\n autoResize: true,\n rows: 1,\n extraRow: false,\n maxRows: this.props.maxRows,\n };\n\n if (this.props.viewMode === 'multiline' && !mask) {\n return <InternalTextareaWithLayout {...inputProps} {...multilineTextareaProps} />;\n }\n\n if (editing) {\n if (mask) {\n return (\n <MaskedInput\n {...inputProps}\n type=\"text\"\n mask={mask}\n maskChar={maskChar}\n formatChars={formatChars}\n onBeforePasteValue={onBeforePasteInMask}\n />\n );\n }\n\n if (this.props.viewMode === 'multiline-editing') {\n return <InternalTextareaWithLayout {...inputProps} {...multilineTextareaProps} />;\n }\n\n return <Input {...inputProps} />;\n }\n\n const { renderValue } = this.getProps();\n return (\n <InputLikeText\n id={id}\n align={align}\n borderless={borderless}\n error={error}\n onFocus={onFocus}\n leftIcon={leftIcon}\n rightIcon={rightIcon}\n disabled={disabled}\n warning={warning}\n placeholder={placeholder}\n size={this.size}\n width=\"100%\"\n ref={refInputLikeText}\n aria-describedby={ariaDescribedby}\n aria-controls={this.menuId}\n showClearIcon={showClearIcon}\n className={cx(mask && MaskedInputStyles.root(this.theme))}\n onClearCrossClick={this.props.onClearCrossClick}\n >\n {isNonNullable(value) && renderValue ? renderValue(value) : null}\n </InputLikeText>\n );\n }\n\n private handleMobileFocus = () => {\n this.props.onInputClick?.();\n\n this.mobileInput?.focus();\n };\n\n private handleItemSelect = (item: T) => {\n if (this.props.onValueChange) {\n this.props.onValueChange(item);\n }\n\n if (this.isMobileLayout) {\n this.props.onMobileClose?.();\n }\n };\n\n private refInput = (input: Nullable<Input | InternalTextareaWithLayout>) => {\n if (this.props.refInput) {\n this.props.refInput(input);\n }\n this.input = input;\n };\n\n private renderSpinner = () => (\n <span className={styles.spinnerWrapper()}>\n <Spinner type=\"mini\" caption=\"\" dimmed />\n </span>\n );\n\n private getRightIcon = () => {\n const { loading, items, drawArrow, rightIcon } = this.props;\n const size = this.size;\n\n if (loading && items && !!items.length) {\n return <LoadingIcon size={size} />;\n }\n\n if (rightIcon || drawArrow) {\n return rightIcon || <ArrowDownIcon size={size} />;\n }\n\n return null;\n };\n\n private refMobileInput = (input: Nullable<Input>) => {\n this.mobileInput = input;\n };\n}\n"],"mappings":";AACA,OAAOA,KAAK,MAAM,OAAO;;AAEzB,SAASC,WAAW,EAAEC,aAAa,QAAQ,iBAAiB;;AAE5D,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,aAAa,QAAQ,kBAAkB;;;AAGhD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,OAAO,QAAQ,0BAA0B;;;AAGlD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,gBAAgB,QAAQ,6CAA6C;;AAE9E,SAASC,QAAQ,EAAEC,WAAW,QAAQ,oBAAoB;AAC1D,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,SAASC,YAAY,QAAQ,gCAAgC;;AAE7D,SAASC,WAAW,QAAQ,0BAA0B;;;AAGtD,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,MAAM,QAAQ,WAAW;;AAElC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,MAAM,IAAIC,iBAAiB,QAAQ,iDAAiD;AAC7F,SAASC,EAAE,QAAQ,2BAA2B;AAC9C,SAASC,0BAA0B,QAAQ,0DAA0D;AACrG,SAASC,QAAQ,QAAQ,8BAA8B;;AAEvD,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,qBAAqB,QAAQ,uBAAuB;AAC7D,SAASP,MAAM,QAAQ,yBAAyB;AAChD,SAASQ,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;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UAAU,EAAE,SAAAA,WAACkD,IAAS,UAAKA,IAAI,IAC/BqE,WAAW,EAAE,SAAAA,YAACrE,IAAS,UAAKA,IAAI,IAChC5C,eAAe,EAAE,SAAAA,gBAAA,UAAM,IAAI,IAC3BR,aAAa,EAAE,SAAAA,cAAA,UAAMgH,SAAS,IAC9B/G,aAAa,EAAE7C,qBAAqB,CAAC0K,OAAO,EAC5C1C,cAAc,EAAE,SAAAA,eAAA,EAAM,CACpB,KACD,EACDC,cAAc,EAAE,SAAAA,eAAA,EAAM,CACpB,KACD,EACD7C,KAAK,EAAE,GAAG,EACVtD,aAAa,EAAE,OAAO,CACxB,CAAC,EAAAvB,aAAA,MAAAD,MAAA,KAAAA,MAAA,KAAAA,MAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","getRandomID","isNonNullable","Input","InputLikeText","RenderLayer","Spinner","CommonWrapper","MobilePopup","responsiveLayout","rootNode","getRootNode","createPropsGetter","ThemeContext","LoadingIcon","Popup","getMenuPositions","ZIndex","MaskedInput","styles","MaskedInputStyles","cx","InternalTextareaWithLayout","withSize","ArrowDownIcon","ComboBoxMenu","ComboBoxRequestStatus","CustomComboBoxDataTids","getComboBoxTheme","ComboBoxViewIds","menu","ComboBoxView","_class","_ComboBoxView","_React$Component","_this$props$value","_this","_len","arguments","length","args","Array","_key","call","apply","concat","getProps","defaultProps","mobileInput","dropdownContainerRef","createRef","menuId","state","anchorElement","clearCrossShowed","props","showClearIcon","value","toString","getComboBoxMenu","_this$props","items","loading","opened","refMenu","maxMenuHeight","renderTotalCount","renderNotFound","totalCount","_this$getProps","repeatRequest","requestStatus","renderItem","itemWrapper","createElement","hasMargin","onValueChange","handleItemSelect","renderAddButton","isMobile","isMobileLayout","size","renderMenu","_this$getProps2","menuPos","menuAlign","hasShadow","tryBestFallbackPosition","minWidth","priority","priorities","PopupMenu","positions","disablePortal","margin","parseInt","theme","menuOffsetY","ref","renderMobileMenu","rightIcon","_this$props2","onFocus","onInputValueChange","onInputKeyDown","placeholder","textValue","renderSpinner","inputProps","autoComplete","autoFocus","width","onKeyDown","headerChildComponent","_extends","refMobileInput","onCloseRequest","onMobileClose","getParent","handleMobileFocus","_this$mobileInput","onInputClick","focus","item","refInput","input","className","spinnerWrapper","type","caption","dimmed","getRightIcon","_this$props3","drawArrow","_inheritsLoose","_proto","prototype","componentDidMount","updateAnchorElement","parent","setState","componentDidUpdate","prevProps","editing","render","_this2","Consumer","viewMode","Provider","renderMain","_this$props4","onMouseEnter","onMouseLeave","onMouseOver","_this$getProps3","onClickOutside","onFocusOutside","renderInput","active","comboBoxView","style","root","setRootNode","_this$props5","id","align","borderless","disabled","error","onInputBlur","onInputFocus","warning","refInputLikeText","leftIcon","inputMode","ariaDescribedby","ariaLabel","mask","maskChar","formatChars","onBeforePasteInMask","maxLength","onBlur","undefined","onClick","multilineTextareaProps","autoResize","rows","extraRow","maxRows","onBeforePasteValue","_this$getProps4","renderValue","onClearCrossClick","Component","__KONTUR_REACT_UI__","displayName","Unknown"],"sources":["ComboBoxView.tsx"],"sourcesContent":["import type { AriaAttributes, HTMLAttributes } from 'react';\nimport React from 'react';\n\nimport { getRandomID, isNonNullable } from '../../lib/utils';\nimport type { InputIconType, InputProps, ShowClearIcon } from '../../components/Input';\nimport { Input } from '../../components/Input';\nimport { InputLikeText } from '../InputLikeText';\nimport type { Menu } from '../Menu';\nimport type { MenuItemState } from '../../components/MenuItem';\nimport { RenderLayer } from '../RenderLayer';\nimport { Spinner } from '../../components/Spinner';\nimport type { Nullable } from '../../typings/utility-types';\nimport type { CommonProps } from '../CommonWrapper';\nimport { CommonWrapper } from '../CommonWrapper';\nimport { MobilePopup } from '../MobilePopup';\nimport { responsiveLayout } from '../../components/ResponsiveLayout/decorator';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { rootNode, getRootNode } from '../../lib/rootNode';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { LoadingIcon } from '../icons2022/LoadingIcon';\nimport type { ComboBoxExtendedItem, ComboBoxViewMode } from '../../components/ComboBox';\nimport type { SizeProp } from '../../lib/types/props';\nimport { Popup } from '../Popup';\nimport { getMenuPositions } from '../../lib/getMenuPositions';\nimport { ZIndex } from '../ZIndex';\nimport type { MaskedInputOnBeforePasteValue, MaskedInputProps } from '../../components/MaskedInput';\nimport { MaskedInput } from '../../components/MaskedInput';\nimport { styles as MaskedInputStyles } from '../../components/MaskedInput/MaskedInput.styles';\nimport { cx } from '../../lib/theming/Emotion';\nimport { InternalTextareaWithLayout } from '../InternalTextareaWithLayout/InternalTextareaWithLayout';\nimport { withSize } from '../../lib/size/SizeDecorator';\n\nimport { ArrowDownIcon } from './ArrowDownIcon';\nimport { ComboBoxMenu } from './ComboBoxMenu';\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes';\nimport { styles } from './CustomComboBox.styles';\nimport { CustomComboBoxDataTids } from './CustomComboBox';\nimport { getComboBoxTheme } from './getComboBoxTheme';\n\ninterface ComboBoxViewProps<T>\n extends Pick<AriaAttributes, 'aria-describedby' | 'aria-label'>,\n Pick<HTMLAttributes<HTMLElement>, 'id'>,\n CommonProps,\n Partial<Pick<MaskedInputProps, 'mask' | 'maskChar' | 'formatChars'>> {\n align?: 'left' | 'center' | 'right';\n autoFocus?: boolean;\n borderless?: boolean;\n disablePortal?: boolean;\n disabled?: boolean;\n editing?: boolean;\n /**\n * Cостояние валидации при ошибке.\n */\n error?: boolean;\n items?: Nullable<Array<ComboBoxExtendedItem<T>>>;\n loading?: boolean;\n /**\n * Позволяет вручную задать текущую позицию выпадающего окна\n */\n menuPos?: 'top' | 'bottom';\n menuAlign?: 'left' | 'right';\n opened?: boolean;\n drawArrow?: boolean;\n placeholder?: string;\n size?: SizeProp;\n textValue?: string;\n totalCount?: number;\n value?: Nullable<T>;\n showClearIcon?: ShowClearIcon;\n /**\n * Cостояние валидации при предупреждении.\n */\n warning?: boolean;\n width?: string | number;\n maxLength?: number;\n maxMenuHeight?: number | string;\n leftIcon?: InputIconType;\n rightIcon?: InputIconType;\n inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];\n\n onBeforePasteInMask?: MaskedInputOnBeforePasteValue;\n onValueChange?: (value: T) => void;\n onClickOutside?: (e: Event) => void;\n onFocus?: () => void;\n onMobileClose?: () => void;\n onFocusOutside?: () => void;\n onInputBlur?: () => void;\n onInputValueChange?: (value: string) => void;\n onInputFocus?: () => void;\n onInputClick?: () => void;\n onClearCrossClick?: () => void;\n onInputKeyDown?: (e: React.KeyboardEvent) => void;\n onMouseEnter?: (e: React.MouseEvent) => void;\n onMouseOver?: (e: React.MouseEvent) => void;\n onMouseLeave?: (e: React.MouseEvent) => void;\n renderItem?: (item: T, state: MenuItemState) => React.ReactNode;\n itemWrapper?: (item: T) => React.ComponentType;\n renderNotFound?: () => React.ReactNode;\n renderTotalCount?: (found: number, total: number) => React.ReactNode;\n renderValue?: (item: T) => React.ReactNode;\n renderAddButton?: (query?: string) => React.ReactNode;\n repeatRequest?: () => void;\n requestStatus?: ComboBoxRequestStatus;\n refInput?: (input: Nullable<Input | InternalTextareaWithLayout>) => void;\n refMenu?: (menu: Nullable<Menu>) => void;\n refInputLikeText?: (inputLikeText: Nullable<InputLikeText>) => void;\n viewMode?: ComboBoxViewMode;\n maxRows?: number;\n}\n\ntype DefaultProps<T> = Required<\n Pick<\n ComboBoxViewProps<T>,\n | 'renderItem'\n | 'renderValue'\n | 'renderAddButton'\n | 'repeatRequest'\n | 'requestStatus'\n | 'onClickOutside'\n | 'onFocusOutside'\n | 'width'\n | 'showClearIcon'\n >\n>;\n\nexport const ComboBoxViewIds = {\n menu: 'ComboBoxView__menu',\n};\n\ninterface ComboBoxViewState {\n anchorElement: Nullable<Element>;\n clearCrossShowed: boolean;\n}\n\n@responsiveLayout\n@rootNode\n@withSize\nexport class ComboBoxView<T> extends React.Component<ComboBoxViewProps<T>, ComboBoxViewState> {\n public static __KONTUR_REACT_UI__ = 'ComboBoxView';\n public static displayName = 'ComboBoxView';\n\n public static defaultProps: DefaultProps<unknown> = {\n renderItem: (item: any) => item,\n renderValue: (item: any) => item,\n renderAddButton: () => null,\n repeatRequest: () => undefined,\n requestStatus: ComboBoxRequestStatus.Unknown,\n onClickOutside: () => {\n /**/\n },\n onFocusOutside: () => {\n /**/\n },\n width: 250,\n showClearIcon: 'never',\n };\n\n private getProps = createPropsGetter(ComboBoxView.defaultProps);\n\n public getRootNode!: TGetRootNode;\n private input: Nullable<Input | InternalTextareaWithLayout>;\n private setRootNode!: TSetRootNode;\n private mobileInput: Nullable<Input> = null;\n private isMobileLayout!: boolean;\n private dropdownContainerRef = React.createRef<Popup>();\n private theme!: Theme;\n private size!: SizeProp;\n private menuId = ComboBoxViewIds.menu + getRandomID();\n\n public state: ComboBoxViewState = {\n anchorElement: null,\n clearCrossShowed: this.props.showClearIcon === 'always' && !!this.props.value?.toString(),\n };\n\n public componentDidMount() {\n this.updateAnchorElement();\n\n if (this.props.autoFocus && this.props.onFocus) {\n this.props.onFocus();\n }\n }\n\n updateAnchorElement() {\n const parent = this.getParent();\n const anchorElement = this.state.anchorElement;\n\n if (anchorElement !== parent) {\n this.setState({\n anchorElement: parent,\n });\n }\n }\n\n public componentDidUpdate(prevProps: ComboBoxViewProps<T>) {\n const { input, props } = this;\n\n this.updateAnchorElement();\n\n if (props.editing && !prevProps.editing && input) {\n input.focus();\n }\n }\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = getComboBoxTheme(theme, this.props.viewMode);\n return <ThemeContext.Provider value={this.theme}>{this.renderMain()}</ThemeContext.Provider>;\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public renderMain() {\n const { onMouseEnter, onMouseLeave, onMouseOver, opened } = this.props;\n const { onClickOutside, onFocusOutside, width } = this.getProps();\n\n const isMobile = this.isMobileLayout;\n\n const input = this.renderInput();\n\n return (\n <CommonWrapper {...this.props}>\n <RenderLayer onClickOutside={onClickOutside} onFocusOutside={onFocusOutside} active={opened}>\n <span\n data-tid={CustomComboBoxDataTids.comboBoxView}\n style={{ width }}\n className={styles.root()}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onMouseOver={onMouseOver}\n ref={this.setRootNode}\n >\n {input}\n {isMobile ? this.renderMobileMenu() : this.renderMenu()}\n </span>\n </RenderLayer>\n </CommonWrapper>\n );\n }\n\n private getComboBoxMenu = () => {\n const { items, loading, opened, refMenu, maxMenuHeight, renderTotalCount, renderNotFound, totalCount } = this.props;\n\n const { repeatRequest, requestStatus, renderItem, itemWrapper } = this.getProps();\n return (\n <ComboBoxMenu\n hasMargin={false}\n menuId={this.menuId}\n items={items}\n loading={loading}\n maxMenuHeight={maxMenuHeight}\n onValueChange={this.handleItemSelect}\n opened={opened}\n refMenu={refMenu}\n renderTotalCount={renderTotalCount}\n renderItem={renderItem}\n renderNotFound={renderNotFound}\n itemWrapper={itemWrapper}\n renderAddButton={this.renderAddButton}\n repeatRequest={repeatRequest}\n requestStatus={requestStatus}\n totalCount={totalCount}\n isMobile={this.isMobileLayout}\n size={this.size}\n />\n );\n };\n\n private renderMenu = () => {\n const { opened, menuPos, menuAlign } = this.getProps();\n const { anchorElement } = this.state;\n\n return (\n opened &&\n anchorElement && (\n <Popup\n opened\n hasShadow\n tryBestFallbackPosition\n minWidth=\"100%\"\n anchorElement={anchorElement}\n priority={ZIndex.priorities.PopupMenu}\n positions={getMenuPositions(menuPos, menuAlign)}\n disablePortal={this.props.disablePortal}\n margin={parseInt(this.theme.menuOffsetY) - 1}\n ref={this.dropdownContainerRef}\n >\n {this.getComboBoxMenu()}\n </Popup>\n )\n );\n };\n\n private renderMobileMenu = () => {\n let rightIcon = null;\n\n const { loading, items, opened, onFocus, onInputValueChange, onInputKeyDown, placeholder, textValue } = this.props;\n if (loading && items && !!items.length) {\n rightIcon = this.renderSpinner();\n }\n\n const inputProps: InputProps = {\n autoComplete: 'off',\n autoFocus: true,\n width: '100%',\n onFocus,\n onValueChange: onInputValueChange,\n onKeyDown: onInputKeyDown,\n value: textValue,\n placeholder,\n rightIcon,\n };\n\n return (\n opened && (\n <MobilePopup\n headerChildComponent={<Input ref={this.refMobileInput} {...inputProps} />}\n onCloseRequest={this.props.onMobileClose}\n opened\n >\n {this.getComboBoxMenu()}\n </MobilePopup>\n )\n );\n };\n\n private getParent = () => {\n return getRootNode(this);\n };\n\n private renderAddButton = (): React.ReactNode => {\n return this.getProps().renderAddButton(this.props.textValue);\n };\n\n private renderInput(): React.ReactNode {\n const isMobile = this.isMobileLayout;\n\n const {\n id,\n align,\n borderless,\n disabled,\n editing,\n error,\n onFocus,\n onInputBlur,\n onInputValueChange,\n onInputFocus,\n onInputClick,\n onInputKeyDown,\n placeholder,\n textValue,\n value,\n warning,\n refInputLikeText,\n leftIcon,\n inputMode,\n 'aria-describedby': ariaDescribedby,\n 'aria-label': ariaLabel,\n showClearIcon,\n mask,\n maskChar,\n formatChars,\n onBeforePasteInMask,\n } = this.props;\n\n const rightIcon = this.getRightIcon();\n\n const inputProps = {\n id,\n align,\n borderless,\n disabled,\n error,\n maxLength: this.props.maxLength,\n onBlur: isMobile ? undefined : onInputBlur,\n onValueChange: onInputValueChange,\n onFocus: onInputFocus,\n onClick: isMobile ? this.handleMobileFocus : onInputClick,\n leftIcon,\n rightIcon,\n value: textValue || '',\n onKeyDown: onInputKeyDown,\n placeholder,\n width: '100%',\n ref: this.refInput,\n warning,\n inputMode,\n autoComplete: 'off',\n 'aria-describedby': ariaDescribedby,\n 'aria-controls': this.menuId,\n 'aria-label': ariaLabel,\n showClearIcon,\n size: this.size,\n };\n\n const multilineTextareaProps = {\n autoResize: true,\n rows: 1,\n extraRow: false,\n maxRows: this.props.maxRows,\n };\n\n if (this.props.viewMode === 'multiline' && !mask) {\n return <InternalTextareaWithLayout {...inputProps} {...multilineTextareaProps} />;\n }\n\n if (editing) {\n if (mask) {\n return (\n <MaskedInput\n {...inputProps}\n type=\"text\"\n mask={mask}\n maskChar={maskChar}\n formatChars={formatChars}\n onBeforePasteValue={onBeforePasteInMask}\n />\n );\n }\n\n if (this.props.viewMode === 'multiline-editing') {\n return <InternalTextareaWithLayout {...inputProps} {...multilineTextareaProps} />;\n }\n\n return <Input {...inputProps} />;\n }\n\n const { renderValue } = this.getProps();\n return (\n <InputLikeText\n id={id}\n align={align}\n borderless={borderless}\n error={error}\n onFocus={onFocus}\n leftIcon={leftIcon}\n rightIcon={rightIcon}\n disabled={disabled}\n warning={warning}\n placeholder={placeholder}\n size={this.size}\n width=\"100%\"\n ref={refInputLikeText}\n aria-describedby={ariaDescribedby}\n aria-controls={this.menuId}\n showClearIcon={showClearIcon}\n className={cx(mask && MaskedInputStyles.root(this.theme))}\n onClearCrossClick={this.props.onClearCrossClick}\n >\n {isNonNullable(value) && renderValue ? renderValue(value) : null}\n </InputLikeText>\n );\n }\n\n private handleMobileFocus = () => {\n this.props.onInputClick?.();\n\n this.mobileInput?.focus();\n };\n\n private handleItemSelect = (item: T) => {\n if (this.props.onValueChange) {\n this.props.onValueChange(item);\n }\n\n if (this.isMobileLayout) {\n this.props.onMobileClose?.();\n }\n };\n\n private refInput = (input: Nullable<Input | InternalTextareaWithLayout>) => {\n if (this.props.refInput) {\n this.props.refInput(input);\n }\n this.input = input;\n };\n\n private renderSpinner = () => (\n <span className={styles.spinnerWrapper()}>\n <Spinner type=\"mini\" caption=\"\" dimmed />\n </span>\n );\n\n private getRightIcon = () => {\n const { loading, items, drawArrow, rightIcon } = this.props;\n const size = this.size;\n\n if (loading && items && !!items.length) {\n return <LoadingIcon size={size} />;\n }\n\n if (rightIcon || drawArrow) {\n return rightIcon || <ArrowDownIcon size={size} />;\n }\n\n return null;\n };\n\n private refMobileInput = (input: Nullable<Input>) => {\n this.mobileInput = input;\n };\n}\n"],"mappings":";AACA,OAAOA,KAAK,MAAM,OAAO;;AAEzB,SAASC,WAAW,EAAEC,aAAa,QAAQ,iBAAiB;;AAE5D,SAASC,KAAK,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eAAA,EAAM,CACpB,KACD,EACDC,cAAc,EAAE,SAAAA,eAAA,EAAM,CACpB,KACD,EACD7C,KAAK,EAAE,GAAG,EACVvD,aAAa,EAAE,OAAO,CACxB,CAAC,EAAAvB,aAAA,MAAAD,MAAA,KAAAA,MAAA,KAAAA,MAAA","ignoreList":[]}
|
|
@@ -100,10 +100,7 @@ export declare class ComboBoxView<T> extends React.Component<ComboBoxViewProps<T
|
|
|
100
100
|
private theme;
|
|
101
101
|
private size;
|
|
102
102
|
private menuId;
|
|
103
|
-
state:
|
|
104
|
-
anchorElement: null;
|
|
105
|
-
clearCrossShowed: boolean;
|
|
106
|
-
};
|
|
103
|
+
state: ComboBoxViewState;
|
|
107
104
|
componentDidMount(): void;
|
|
108
105
|
updateAnchorElement(): void;
|
|
109
106
|
componentDidUpdate(prevProps: ComboBoxViewProps<T>): void;
|
|
@@ -459,7 +459,8 @@ export var Popup = responsiveLayout(_class = rootNode(_class = (_Popup = /*#__PU
|
|
|
459
459
|
};
|
|
460
460
|
_proto.getLocation = function getLocation(popupElement, location) {
|
|
461
461
|
var _this$getProps4 = this.getProps(),
|
|
462
|
-
tryPreserveFirstRenderedPosition = _this$getProps4.tryPreserveFirstRenderedPosition
|
|
462
|
+
tryPreserveFirstRenderedPosition = _this$getProps4.tryPreserveFirstRenderedPosition,
|
|
463
|
+
tryBestFallbackPosition = _this$getProps4.tryBestFallbackPosition;
|
|
463
464
|
var positions = this.reorderPropsPositionsWithPriorityPos();
|
|
464
465
|
var anchorElement = this.anchorElement;
|
|
465
466
|
warning(anchorElement && isInstanceOf(anchorElement, globalObject.Element), 'Anchor element is not defined or not instance of Element');
|
|
@@ -501,7 +502,7 @@ export var Popup = responsiveLayout(_class = rootNode(_class = (_Popup = /*#__PU
|
|
|
501
502
|
};
|
|
502
503
|
}
|
|
503
504
|
}
|
|
504
|
-
position = positions[0];
|
|
505
|
+
position = tryBestFallbackPosition ? this.getBestFallbackPosition(positions, anchorRect, popupRect) : positions[0];
|
|
505
506
|
coordinates = this.getCoordinates(anchorRect, popupRect, position);
|
|
506
507
|
return {
|
|
507
508
|
coordinates: coordinates,
|
|
@@ -509,6 +510,29 @@ export var Popup = responsiveLayout(_class = rootNode(_class = (_Popup = /*#__PU
|
|
|
509
510
|
isFullyVisible: false
|
|
510
511
|
};
|
|
511
512
|
};
|
|
513
|
+
_proto.getBestFallbackPosition = function getBestFallbackPosition(positions, anchorRect, popupRect) {
|
|
514
|
+
var defaultPosition = positions[0];
|
|
515
|
+
var coords = this.getCoordinates(anchorRect, popupRect, defaultPosition);
|
|
516
|
+
var overflow = PopupHelper.getOverflowEdges(coords, popupRect);
|
|
517
|
+
var preferredDirection = PopupHelper.getPreferredDirection(overflow, defaultPosition);
|
|
518
|
+
var preferredAlignOrder = PopupHelper.getPreferredAlignOrder(overflow);
|
|
519
|
+
var candidates = PopupHelper.buildFallbackCandidates(positions, overflow, preferredDirection, preferredAlignOrder, PopupPinnablePositions);
|
|
520
|
+
var positionsSet = new Set(positions);
|
|
521
|
+
var best = candidates[0];
|
|
522
|
+
var minCount = 4;
|
|
523
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(candidates), _step2; !(_step2 = _iterator2()).done;) {
|
|
524
|
+
var positionName = _step2.value;
|
|
525
|
+
var _coords = this.getCoordinates(anchorRect, popupRect, positionName);
|
|
526
|
+
var _overflow = PopupHelper.getOverflowEdges(_coords, popupRect);
|
|
527
|
+
var count = PopupHelper.getOverflowCount(_overflow);
|
|
528
|
+
var isBetter = count < minCount || count === minCount && positionsSet.has(positionName) && !positionsSet.has(best);
|
|
529
|
+
if (isBetter) {
|
|
530
|
+
minCount = count;
|
|
531
|
+
best = positionName;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
return best;
|
|
535
|
+
};
|
|
512
536
|
_proto.getPinnedPopupOffset = function getPinnedPopupOffset(anchorRect, position) {
|
|
513
537
|
if (!this.getProps().hasPin || /center|middle/.test(position.align)) {
|
|
514
538
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Transition","warning","globalObject","getDOMRect","LayoutEvents","ZIndex","RenderContainer","getRandomID","isFunction","isNonNullable","isNullable","isRefableElement","isIE11","isEdge","ThemeContext","isTestEnv","CommonWrapper","cx","responsiveLayout","MobilePopup","getRootNode","rootNode","isInstanceWithAnchorElement","createPropsGetter","isInstanceOf","getFullReactUIFlagsContext","ReactUIFeatureFlagsContext","mergeRefs","getVisualStateDataAttributes","PopupPinNew","PopupHelper","styles","PopupPin","POPUP_BORDER_DEFAULT_COLOR","TRANSITION_TIMEOUT","enter","exit","PopupNonPinnablePositions","PopupPinnablePositions","PopupPositions","concat","DefaultPosition","DUMMY_LOCATION","position","coordinates","top","left","isFullyVisible","PopupDataTids","root","content","contentInner","popupPin","PopupIds","Popup","_class","_Popup","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","getProps","defaultProps","state","location","props","opened","locationUpdateId","refForTransition","createRef","hasAnchorElementListeners","rootId","anchorElement","absoluteParent","renderInPortal","anchor","ref","createElement","isMobileLayout","withoutMobile","renderMobile","renderContent","renderWithoutPortal","EmptyWrapper","updateAbsoluteElement","className","updateAnchorElement","instance","childDomNode","getAnchorElement","removeEventListeners","addEventListeners","handleMouseEnter","event","onMouseEnter","handleMouseLeave","onMouseLeave","handleClick","onClick","handleFocus","onFocus","handleBlur","onBlur","calculateWidth","width","includes","anchorWidth","replace","percent","parseFloat","children","backgroundColor","_this$getProps","minWidth","theme","refPopupContentElement","style","prepareDataVisualState","_this$state$location","_getVisualStateDataAt","attrName","resetLocation","cancelDelayedUpdateLocation","setState","element","lastPopupContentElement","handleLayoutEvent","updateLocation","popupContentElement","getLocation","onPositionChange","locationEquals","getRelativeShift","_this2","disablePortal","rect","getElementAbsoluteRect","_inheritsLoose","_proto","prototype","componentDidMount","layoutEventsToken","addListener","getDerivedStateFromProps","componentDidUpdate","prevProps","prevState","hadNoLocation","hasLocation","wasClosed","onOpen","onClose","delayUpdateLocation","componentWillUnmount","remove","render","_this3","Consumer","flags","featureFlags","renderMain","renderChildren","rootNodeRef","setRootNode","withoutRenderContainer","onCloseRequest","mobileOnCloseRequest","_anchor","useWrapper","Element","isValidElement","anchorWithRef","cloneElement","canGetAnchorNode","renderRef","renderAnchor","addEventListener","removeEventListener","_this4","_this$props","maxWidth","_this$getProps2","hasShadow","disableAnimations","ignoreHover","relativeShift","_PopupHelper$getPosit","getPositionObject","direction","rootStyle","timeout","appear","Boolean","mountOnEnter","unmountOnExit","onExited","nodeRef","_this4$props$id","_extends2","_ref","_extends","id","priority","popup","shadow","popupIgnoreHover","transitionEnter","transitionEnterActive","transitionExit","renderPin","positionName","isDefaultBorderColor","popupBorderColor","pinBorder","_this$props2","pinSize","borderColor","_this$getProps3","hasPin","popupFixPinTearing","popupElement","popupPosition","size","parseInt","popupPinSize","offset","getPinOffset","align","popupBackground","borderWidth","requestAnimationFrame","cancelAnimationFrame","x","y","Math","abs","reorderPropsPositionsWithPriorityPos","positions","pos_","pos","index","findIndex","startsWith","join","slice","_this$getProps4","tryPreserveFirstRenderedPosition","anchorRect","popupRect","getCoordinates","canBecomeVisible","canBecomeFullyVisible","_iterator","_createForOfIteratorHelperLoose","_step","done","value","getPinnedPopupOffset","test","anchorSize","height","max","marginFromProps","margin","isNaN","popupMargin","popupOffset","getHorizontalPosition","getVerticalPosition","Error","pinOffset","popupPinOffsetY","popupPinOffsetX","Component","__KONTUR_REACT_UI__","displayName","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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,OAAO,MAAM,SAAS;AAC7B,SAASC,YAAY,QAAQ,0BAA0B;;AAEvD,SAASC,UAAU,QAAQ,0BAA0B;;AAErD,OAAO,KAAKC,YAAY,MAAM,wBAAwB;;AAEtD,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,eAAe,QAAQ,oBAAoB;;AAEpD,SAASC,WAAW,EAAE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AA1N,KAAA,OAAAN,SAAA,WAAAmF,cAAA,CAAAtD,YAAA,EAAAmM,iBAAA,MAAAC,OAAA,GAAApM,YAAA,CAAAwD,SAAA,CAAA4I,OAAA;EACT5H,MAAM,GAAb,SAAAA,OAAA,EAAgB;IACd,OAAO,IAAI,CAAC1F,KAAK,CAAC6C,QAAQ;EAC5B,CAAC,QAAA3B,YAAA,GAHwB1F,KAAK,CAACwR,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Transition","warning","globalObject","getDOMRect","LayoutEvents","ZIndex","RenderContainer","getRandomID","isFunction","isNonNullable","isNullable","isRefableElement","isIE11","isEdge","ThemeContext","isTestEnv","CommonWrapper","cx","responsiveLayout","MobilePopup","getRootNode","rootNode","isInstanceWithAnchorElement","createPropsGetter","isInstanceOf","getFullReactUIFlagsContext","ReactUIFeatureFlagsContext","mergeRefs","getVisualStateDataAttributes","PopupPinNew","PopupHelper","styles","PopupPin","POPUP_BORDER_DEFAULT_COLOR","TRANSITION_TIMEOUT","enter","exit","PopupNonPinnablePositions","PopupPinnablePositions","PopupPositions","concat","DefaultPosition","DUMMY_LOCATION","position","coordinates","top","left","isFullyVisible","PopupDataTids","root","content","contentInner","popupPin","PopupIds","Popup","_class","_Popup","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","getProps","defaultProps","state","location","props","opened","locationUpdateId","refForTransition","createRef","hasAnchorElementListeners","rootId","anchorElement","absoluteParent","renderInPortal","anchor","ref","createElement","isMobileLayout","withoutMobile","renderMobile","renderContent","renderWithoutPortal","EmptyWrapper","updateAbsoluteElement","className","updateAnchorElement","instance","childDomNode","getAnchorElement","removeEventListeners","addEventListeners","handleMouseEnter","event","onMouseEnter","handleMouseLeave","onMouseLeave","handleClick","onClick","handleFocus","onFocus","handleBlur","onBlur","calculateWidth","width","includes","anchorWidth","replace","percent","parseFloat","children","backgroundColor","_this$getProps","minWidth","theme","refPopupContentElement","style","prepareDataVisualState","_this$state$location","_getVisualStateDataAt","attrName","resetLocation","cancelDelayedUpdateLocation","setState","element","lastPopupContentElement","handleLayoutEvent","updateLocation","popupContentElement","getLocation","onPositionChange","locationEquals","getRelativeShift","_this2","disablePortal","rect","getElementAbsoluteRect","_inheritsLoose","_proto","prototype","componentDidMount","layoutEventsToken","addListener","getDerivedStateFromProps","componentDidUpdate","prevProps","prevState","hadNoLocation","hasLocation","wasClosed","onOpen","onClose","delayUpdateLocation","componentWillUnmount","remove","render","_this3","Consumer","flags","featureFlags","renderMain","renderChildren","rootNodeRef","setRootNode","withoutRenderContainer","onCloseRequest","mobileOnCloseRequest","_anchor","useWrapper","Element","isValidElement","anchorWithRef","cloneElement","canGetAnchorNode","renderRef","renderAnchor","addEventListener","removeEventListener","_this4","_this$props","maxWidth","_this$getProps2","hasShadow","disableAnimations","ignoreHover","relativeShift","_PopupHelper$getPosit","getPositionObject","direction","rootStyle","timeout","appear","Boolean","mountOnEnter","unmountOnExit","onExited","nodeRef","_this4$props$id","_extends2","_ref","_extends","id","priority","popup","shadow","popupIgnoreHover","transitionEnter","transitionEnterActive","transitionExit","renderPin","positionName","isDefaultBorderColor","popupBorderColor","pinBorder","_this$props2","pinSize","borderColor","_this$getProps3","hasPin","popupFixPinTearing","popupElement","popupPosition","size","parseInt","popupPinSize","offset","getPinOffset","align","popupBackground","borderWidth","requestAnimationFrame","cancelAnimationFrame","x","y","Math","abs","reorderPropsPositionsWithPriorityPos","positions","pos_","pos","index","findIndex","startsWith","join","slice","_this$getProps4","tryPreserveFirstRenderedPosition","tryBestFallbackPosition","anchorRect","popupRect","getCoordinates","canBecomeVisible","canBecomeFullyVisible","_iterator","_createForOfIteratorHelperLoose","_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","isNaN","popupMargin","popupOffset","getHorizontalPosition","getVerticalPosition","Error","pinOffset","popupPinOffsetY","popupPinOffsetX","Component","__KONTUR_REACT_UI__","displayName","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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,OAAO,MAAM,SAAS;AAC7B,SAASC,YAAY,QAAQ,0BAA0B;;AAEvD,SAASC,UAAU,QAAQ,0BAA0B;;AAErD,OAAO,KAAKC,YAAY,MAAM,wBAAwB;;AAEtD,SAASC,MAAM,QA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vP,MAAA,CAErBY,YAAY,GAAiB,EACzCkO,WAAW,EAAE,CAAC,EACdtE,MAAM,EAAE,KAAK,EACbpC,SAAS,EAAE,KAAK,EAChBC,iBAAiB,EAAE9K,SAAS,EAC5B+J,UAAU,EAAE,KAAK,EACjBgB,WAAW,EAAE,KAAK,EAClBlD,aAAa,EAAE,KAAK,EACpB9B,KAAK,EAAE,MAAM,EACbkG,QAAQ,EAAE3M,MAAM,CAAC2S,UAAU,CAAC1P,KAAK,CACnC,CAAC,EAAAE,MAAA,CAKsByP,eAAe,GAAG,IAAI,EAAAzP,MAAA,MAAAD,MAAA,KAAAA,MAAA;;;AAkqB/C;AAAA;;;;AAKMkC,YAAY,0BAAAyN,iBAAA,YAAAzN,aAAA,UAAAyN,iBAAA,CAAAhP,KAAA,OAAAN,SAAA,WAAAmF,cAAA,CAAAtD,YAAA,EAAAyN,iBAAA,MAAAC,OAAA,GAAA1N,YAAA,CAAAwD,SAAA,CAAAkK,OAAA;EACTlJ,MAAM,GAAb,SAAAA,OAAA,EAAgB;IACd,OAAO,IAAI,CAAC1F,KAAK,CAAC6C,QAAQ;EAC5B,CAAC,QAAA3B,YAAA,GAHwB1F,KAAK,CAAC8S,SAAS","ignoreList":[]}
|
|
@@ -96,6 +96,12 @@ export interface PopupProps extends Omit<CommonProps, 'children'>, PopupHandlerP
|
|
|
96
96
|
* @see https://github.com/skbkontur/retail-ui/pull/1195
|
|
97
97
|
*/
|
|
98
98
|
tryPreserveFirstRenderedPosition?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Если ни одна позиция попапа не влезает во вьюпорт — выбираем наиболее подходящий fallback.
|
|
101
|
+
* Так чтобы попап было видно пользователю, если попап у нижнего края — открыть сверху элемента,
|
|
102
|
+
* у верхнего — снизу; горизонтально сохраняем читаемость слева направо.
|
|
103
|
+
*/
|
|
104
|
+
tryBestFallbackPosition?: boolean;
|
|
99
105
|
withoutMobile?: boolean;
|
|
100
106
|
/** @ignore */
|
|
101
107
|
disablePortal?: boolean;
|
|
@@ -179,6 +185,7 @@ export declare class Popup extends React.Component<PopupProps, PopupState> {
|
|
|
179
185
|
private locationEquals;
|
|
180
186
|
private reorderPropsPositionsWithPriorityPos;
|
|
181
187
|
private getLocation;
|
|
188
|
+
private getBestFallbackPosition;
|
|
182
189
|
private getPinnedPopupOffset;
|
|
183
190
|
private getRelativeShift;
|
|
184
191
|
private getCoordinates;
|