@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.
@@ -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;
@@ -280,6 +280,7 @@ ComboBoxView = exports.ComboBoxView = (0, _decorator.responsiveLayout)(_class =
280
280
  _react.default.createElement(_Popup.Popup, {
281
281
  opened: true,
282
282
  hasShadow: true,
283
+ tryBestFallbackPosition: true,
283
284
  minWidth: "100%",
284
285
  anchorElement: anchorElement,
285
286
  priority: _ZIndex.ZIndex.priorities.PopupMenu,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_utils","_Input","_InputLikeText","_RenderLayer","_Spinner","_CommonWrapper","_MobilePopup","_decorator","_rootNode","_createPropsGetter","_ThemeContext","_LoadingIcon","_Popup","_getMenuPositions","_ZIndex","_MaskedInput","_MaskedInput2","_Emotion","_InternalTextareaWithLayout","_SizeDecorator","_ArrowDownIcon","_ComboBoxMenu","_CustomComboBoxTypes","_CustomComboBox","_CustomComboBox2","_getComboBoxTheme","_class","_ComboBoxView","ComboBoxViewIds","exports","menu","ComboBoxView","responsiveLayout","rootNode","withSize","_React$Component","_this$props$value","_this","_len","arguments","length","args","Array","_key","call","apply","concat","getProps","createPropsGetter","defaultProps","mobileInput","dropdownContainerRef","React","createRef","menuId","getRandomID","state","anchorElement","clearCrossShowed","props","showClearIcon","value","toString","getComboBoxMenu","_this$props","items","loading","opened","refMenu","maxMenuHeight","renderTotalCount","renderNotFound","totalCount","_this$getProps","repeatRequest","requestStatus","renderItem","itemWrapper","default","createElement","ComboBoxMenu","hasMargin","onValueChange","handleItemSelect","renderAddButton","isMobile","isMobileLayout","size","renderMenu","_this$getProps2","menuPos","menuAlign","Popup","hasShadow","minWidth","priority","ZIndex","priorities","PopupMenu","positions","getMenuPositions","disablePortal","margin","parseInt","theme","menuOffsetY","ref","renderMobileMenu","rightIcon","_this$props2","onFocus","onInputValueChange","onInputKeyDown","placeholder","textValue","renderSpinner","inputProps","autoComplete","autoFocus","width","onKeyDown","MobilePopup","headerChildComponent","Input","_extends2","refMobileInput","onCloseRequest","onMobileClose","getParent","getRootNode","handleMobileFocus","_this$mobileInput","onInputClick","focus","item","refInput","input","className","styles","spinnerWrapper","Spinner","type","caption","dimmed","getRightIcon","_this$props3","drawArrow","LoadingIcon","ArrowDownIcon","_inheritsLoose2","_proto","prototype","componentDidMount","updateAnchorElement","parent","setState","componentDidUpdate","prevProps","editing","render","_this2","ThemeContext","Consumer","getComboBoxTheme","viewMode","Provider","renderMain","_this$props4","onMouseEnter","onMouseLeave","onMouseOver","_this$getProps3","onClickOutside","onFocusOutside","renderInput","CommonWrapper","RenderLayer","active","CustomComboBoxDataTids","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","InternalTextareaWithLayout","MaskedInput","onBeforePasteValue","_this$getProps4","renderValue","InputLikeText","cx","MaskedInputStyles","onClearCrossClick","isNonNullable","Component","__KONTUR_REACT_UI__","displayName","ComboBoxRequestStatus","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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;;AAEA,IAAAC,MAAA,GAAAD,OAAA;;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;;;AAGA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;;;AAGA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;;AAEA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;;AAEA,IAAAY,YAAA,GAAAZ,OAAA;;;AAGA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,iBAAA,GAAAd,OAAA;AACA,IAAAe,OAAA,GAAAf,OAAA;;AAEA,IAAAgB,YAAA,GAAAhB,OAAA;AACA,IAAAiB,aAAA,GAAAjB,OAAA;AACA,IAAAkB,QAAA,GAAAlB,OAAA;AACA,IAAAmB,2BAAA,GAAAnB,OAAA;AACA,IAAAoB,cAAA,GAAApB,OAAA;;AAEA,IAAAqB,cAAA,GAAArB,OAAA;AACA,IAAAsB,aAAA,GAAAtB,OAAA;AACA,IAAAuB,oBAAA,GAAAvB,OAAA;AACA,IAAAwB,eAAA,GAAAxB,OAAA;AACA,IAAAyB,gBAAA,GAAAzB,OAAA;AACA,IAAA0B,iBAAA,GAAA1B,OAAA,uBAAsD,IAAA2B,MAAA,EAAAC,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,EACjB9E,WAAW,EAAEA,WAAY,EACzB1B,IAAI,EAAE,IAAI,CAACA,IAAK,EAChBgC,KAAK,EAAC,MAAM,EACZb,GAAG,EAAEsF,gBAAiB,EACtB,oBAAkBG,eAAgB,EAClC,iBAAe,IAAI,CAAC7I,MAAO,EAC3BM,aAAa,EAAEA,aAAc,EAC7B6E,SAAS,EAAE,IAAA+E,WAAE,EAACnB,IAAI,IAAIoB,oBAAiB,CAACpC,IAAI,CAAC,IAAI,CAAC7E,KAAK,CAAC,CAAE,EAC1DkH,iBAAiB,EAAE,IAAI,CAAC/J,KAAK,CAAC+J,iBAAkB,IAE/C,IAAAC,oBAAa,EAAC9J,KAAK,CAAC,IAAIyJ,WAAW,GAAGA,WAAW,CAACzJ,KAAK,CAAC,GAAG,IAC/C,CAAC,CAEpB,CAAC,QAAA9B,YAAA,GA7TkCqB,cAAK,CAACwK,SAAS,GAAAjM,aAAA,CACpCkM,mBAAmB,GAAG,cAAc,EAAAlM,aAAA,CACpCmM,WAAW,GAAG,cAAc,EAAAnM,aAAA,CAE5BsB,YAAY,GAA0B,EAClD2B,UAAU,EAAE,SAAAA,WAAC0D,IAAS,UAAKA,IAAI,IAC/BgF,WAAW,EAAE,SAAAA,YAAChF,IAAS,UAAKA,IAAI,IAChClD,eAAe,EAAE,SAAAA,gBAAA,UAAM,IAAI,IAC3BV,aAAa,EAAE,SAAAA,cAAA,UAAMiI,SAAS,IAC9BhI,aAAa,EAAEoJ,0CAAqB,CAACC,OAAO,EAC5CpD,cAAc,EAAE,SAAAA,eAAA,EAAM,CACpB,KACD,EACDC,cAAc,EAAE,SAAAA,eAAA,EAAM,CACpB,KACD,EACDtD,KAAK,EAAE,GAAG,EACV3D,aAAa,EAAE,OAAO,CACxB,CAAC,EAAAjC,aAAA,MAAAD,MAAA,KAAAA,MAAA,KAAAA,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_utils","_Input","_InputLikeText","_RenderLayer","_Spinner","_CommonWrapper","_MobilePopup","_decorator","_rootNode","_createPropsGetter","_ThemeContext","_LoadingIcon","_Popup","_getMenuPositions","_ZIndex","_MaskedInput","_MaskedInput2","_Emotion","_InternalTextareaWithLayout","_SizeDecorator","_ArrowDownIcon","_ComboBoxMenu","_CustomComboBoxTypes","_CustomComboBox","_CustomComboBox2","_getComboBoxTheme","_class","_ComboBoxView","ComboBoxViewIds","exports","menu","ComboBoxView","responsiveLayout","rootNode","withSize","_React$Component","_this$props$value","_this","_len","arguments","length","args","Array","_key","call","apply","concat","getProps","createPropsGetter","defaultProps","mobileInput","dropdownContainerRef","React","createRef","menuId","getRandomID","state","anchorElement","clearCrossShowed","props","showClearIcon","value","toString","getComboBoxMenu","_this$props","items","loading","opened","refMenu","maxMenuHeight","renderTotalCount","renderNotFound","totalCount","_this$getProps","repeatRequest","requestStatus","renderItem","itemWrapper","default","createElement","ComboBoxMenu","hasMargin","onValueChange","handleItemSelect","renderAddButton","isMobile","isMobileLayout","size","renderMenu","_this$getProps2","menuPos","menuAlign","Popup","hasShadow","tryBestFallbackPosition","minWidth","priority","ZIndex","priorities","PopupMenu","positions","getMenuPositions","disablePortal","margin","parseInt","theme","menuOffsetY","ref","renderMobileMenu","rightIcon","_this$props2","onFocus","onInputValueChange","onInputKeyDown","placeholder","textValue","renderSpinner","inputProps","autoComplete","autoFocus","width","onKeyDown","MobilePopup","headerChildComponent","Input","_extends2","refMobileInput","onCloseRequest","onMobileClose","getParent","getRootNode","handleMobileFocus","_this$mobileInput","onInputClick","focus","item","refInput","input","className","styles","spinnerWrapper","Spinner","type","caption","dimmed","getRightIcon","_this$props3","drawArrow","LoadingIcon","ArrowDownIcon","_inheritsLoose2","_proto","prototype","componentDidMount","updateAnchorElement","parent","setState","componentDidUpdate","prevProps","editing","render","_this2","ThemeContext","Consumer","getComboBoxTheme","viewMode","Provider","renderMain","_this$props4","onMouseEnter","onMouseLeave","onMouseOver","_this$getProps3","onClickOutside","onFocusOutside","renderInput","CommonWrapper","RenderLayer","active","CustomComboBoxDataTids","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","InternalTextareaWithLayout","MaskedInput","onBeforePasteValue","_this$getProps4","renderValue","InputLikeText","cx","MaskedInputStyles","onClearCrossClick","isNonNullable","Component","__KONTUR_REACT_UI__","displayName","ComboBoxRequestStatus","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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;;AAEA,IAAAC,MAAA,GAAAD,OAAA;;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;;;AAGA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;;;AAGA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;;AAEA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAV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Ac,EAAApM,aAAA,CAE5BsB,YAAY,GAA0B,EAClD2B,UAAU,EAAE,SAAAA,WAAC2D,IAAS,UAAKA,IAAI,IAC/BgF,WAAW,EAAE,SAAAA,YAAChF,IAAS,UAAKA,IAAI,IAChCnD,eAAe,EAAE,SAAAA,gBAAA,UAAM,IAAI,IAC3BV,aAAa,EAAE,SAAAA,cAAA,UAAMkI,SAAS,IAC9BjI,aAAa,EAAEqJ,0CAAqB,CAACC,OAAO,EAC5CpD,cAAc,EAAE,SAAAA,eAAA,EAAM,CACpB,KACD,EACDC,cAAc,EAAE,SAAAA,eAAA,EAAM,CACpB,KACD,EACDtD,KAAK,EAAE,GAAG,EACV5D,aAAa,EAAE,OAAO,CACxB,CAAC,EAAAjC,aAAA,MAAAD,MAAA,KAAAA,MAAA,KAAAA,MAAA","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;
@@ -176,6 +176,12 @@ var DUMMY_LOCATION = exports.DUMMY_LOCATION = {
176
176
 
177
177
 
178
178
 
179
+
180
+
181
+
182
+
183
+
184
+
179
185
 
180
186
 
181
187
 
@@ -744,6 +750,42 @@ Popup = exports.Popup = (0, _decorator.responsiveLayout)(_class = (0, _rootNode.
744
750
 
745
751
 
746
752
 
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+
764
+
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+
773
+
774
+
775
+
776
+
777
+
778
+
779
+
780
+
781
+
782
+
783
+
784
+
785
+
786
+
787
+
788
+
747
789
 
748
790
 
749
791
 
@@ -796,12 +838,12 @@ Popup = exports.Popup = (0, _decorator.responsiveLayout)(_class = (0, _rootNode.
796
838
  element.removeEventListener('mouseleave', this.handleMouseLeave); // @ts-expect-error: See the comment above
797
839
  element.removeEventListener('click', this.handleClick);element.removeEventListener('focusin', this.handleFocus);element.removeEventListener('focusout', this.handleBlur);this.hasAnchorElementListeners = false;}};_proto.renderContent = function renderContent(location) {var _this4 = this;var _this$props = this.props,maxWidth = _this$props.maxWidth,opened = _this$props.opened;var _this$getProps2 = this.getProps(),hasShadow = _this$getProps2.hasShadow,disableAnimations = _this$getProps2.disableAnimations,ignoreHover = _this$getProps2.ignoreHover;var children = this.renderChildren();var relativeShift = this.getRelativeShift();var _PopupHelper$getPosit = _PopupHelper.PopupHelper.getPositionObject(location.position),direction = _PopupHelper$getPosit.direction;var rootStyle = { maxWidth: maxWidth, top: location.coordinates.top + relativeShift.top, left: location.coordinates.left + relativeShift.left };return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, { timeout: TRANSITION_TIMEOUT, appear: !disableAnimations, in: Boolean(opened && children), mountOnEnter: true, unmountOnExit: true, enter: !disableAnimations, exit: !disableAnimations, onExited: this.resetLocation, nodeRef: this.refForTransition }, function (state) {var _this4$props$id, _extends2, _ref;return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends3.default)({}, _this4.props, { rootNodeRef: _this4.setRootNode }, _this4.prepareDataVisualState()), /*#__PURE__*/_react.default.createElement(_ZIndex.ZIndex, { id: (_this4$props$id = _this4.props.id) != null ? _this4$props$id : _this4.rootId, "data-tid": PopupDataTids.root, priority: _this4.props.priority, className: (0, _Emotion.cx)((0, _extends3.default)((_extends2 = {}, _extends2[_Popup2.styles.popup(_this4.theme)] = true, _extends2[_Popup2.styles.shadow(_this4.theme)] = hasShadow, _extends2[_Popup2.styles.popupIgnoreHover()] = ignoreHover, _extends2), disableAnimations ? {} : (_ref = {}, _ref[_Popup2.styles["transition-enter-" + direction](_this4.theme)] = true, _ref[_Popup2.styles.transitionEnter()] = state === 'entering', _ref[_Popup2.styles.transitionEnterActive()] = state === 'entered', _ref[_Popup2.styles.transitionExit()] = state === 'exiting', _ref))), style: rootStyle, onMouseEnter: _this4.handleMouseEnter, onMouseLeave: _this4.handleMouseLeave }, _this4.content(children), (!_this4.isMobileLayout || _this4.props.withoutMobile) && _this4.renderPin(location.position)));});};_proto.renderChildren = function renderChildren() {return (0, _utils.isFunction)(this.props.children) ? this.props.children() : this.props.children;};_proto.renderPin = function renderPin(positionName) {var isDefaultBorderColor = this.theme.popupBorderColor === POPUP_BORDER_DEFAULT_COLOR;var pinBorder = _client.isIE11 && isDefaultBorderColor ? 'rgba(0, 0, 0, 0.09)' : this.theme.popupBorderColor;var _this$props2 = this.props,pinSize = _this$props2.pinSize,backgroundColor = _this$props2.backgroundColor,borderColor = _this$props2.borderColor;var _this$getProps3 = this.getProps(),hasShadow = _this$getProps3.hasShadow,hasPin = _this$getProps3.hasPin;var position = _PopupHelper.PopupHelper.getPositionObject(positionName);return hasPin && !PopupNonPinnablePositions.includes(positionName) && (this.featureFlags.popupFixPinTearing ? /*#__PURE__*/_react.default.createElement(_PopupPinNew.PopupPinNew, { popupElement: this.lastPopupContentElement, popupPosition: positionName, size: pinSize || parseInt(this.theme.popupPinSize), offset: this.getPinOffset(position.align), backgroundColor: backgroundColor || this.theme.popupBackground }) : /*#__PURE__*/_react.default.createElement(_PopupPin.PopupPin, { popupElement: this.lastPopupContentElement, popupPosition: positionName, size: pinSize || parseInt(this.theme.popupPinSize), offset: this.getPinOffset(position.align), borderWidth: hasShadow ? 1 : 0, backgroundColor: backgroundColor || this.theme.popupBackground, borderColor: borderColor || pinBorder }));};_proto.delayUpdateLocation = function delayUpdateLocation() {this.cancelDelayedUpdateLocation();this.locationUpdateId = _globalObject.globalObject.requestAnimationFrame == null ? void 0 : _globalObject.globalObject.requestAnimationFrame(this.updateLocation);};_proto.cancelDelayedUpdateLocation = function cancelDelayedUpdateLocation() {if (this.locationUpdateId) {_globalObject.globalObject.cancelAnimationFrame == null || _globalObject.globalObject.cancelAnimationFrame(this.locationUpdateId);this.locationUpdateId = null;}};_proto.locationEquals = function locationEquals(x, y) {if (x === y) {return true;}if ((0, _utils.isNullable)(x) || (0, _utils.isNullable)(y)) {return false;}if (!_client.isIE11 && !_client.isEdge) {return x.coordinates.left === y.coordinates.left && x.coordinates.top === y.coordinates.top && x.position === y.position;} // Для ie/edge обновляем позицию только при разнице минимум в 1. Иначе есть вероятность
798
840
  // уйти в бесконечный ререндер
799
- return x.position === y.position && Math.abs(x.coordinates.top - y.coordinates.top) <= 1 && Math.abs(x.coordinates.left - y.coordinates.left) <= 1;};_proto.reorderPropsPositionsWithPriorityPos = function reorderPropsPositionsWithPriorityPos() {var positions = this.props.positions ? this.props.positions : PopupPinnablePositions;var pos_ = '';if (this.props.pos) {pos_ = this.props.pos;} else {pos_ = positions[0];}var index = positions.findIndex(function (position) {return position.startsWith(pos_);});if (index === -1) {(0, _warning.default)(false, 'Unexpected position ' + pos_ + ' passed to Popup. Expected one of: ' + positions.join(', '));return positions;}return [].concat(positions.slice(index), positions.slice(0, index));};_proto.getLocation = function getLocation(popupElement, location) {var _this$getProps4 = this.getProps(),tryPreserveFirstRenderedPosition = _this$getProps4.tryPreserveFirstRenderedPosition;var positions = this.reorderPropsPositionsWithPriorityPos();var anchorElement = this.anchorElement;(0, _warning.default)(anchorElement && (0, _isInstanceOf.isInstanceOf)(anchorElement, _globalObject.globalObject.Element), 'Anchor element is not defined or not instance of Element');if (!(anchorElement && (0, _isInstanceOf.isInstanceOf)(anchorElement, _globalObject.globalObject.Element))) {return location;}var anchorRect = _PopupHelper.PopupHelper.getElementAbsoluteRect(anchorElement);var popupRect = _PopupHelper.PopupHelper.getElementAbsoluteRect(popupElement);var position;var coordinates;if (location && location !== DUMMY_LOCATION && location.position) {position = location.position;coordinates = this.getCoordinates(anchorRect, popupRect, position);var isFullyVisible = _PopupHelper.PopupHelper.isFullyVisible(coordinates, popupRect);var canBecomeVisible = !isFullyVisible && _PopupHelper.PopupHelper.canBecomeFullyVisible(position, coordinates);if ( // если нужно сохранить первоначальную позицию и Попап целиком
841
+ return x.position === y.position && Math.abs(x.coordinates.top - y.coordinates.top) <= 1 && Math.abs(x.coordinates.left - y.coordinates.left) <= 1;};_proto.reorderPropsPositionsWithPriorityPos = function reorderPropsPositionsWithPriorityPos() {var positions = this.props.positions ? this.props.positions : PopupPinnablePositions;var pos_ = '';if (this.props.pos) {pos_ = this.props.pos;} else {pos_ = positions[0];}var index = positions.findIndex(function (position) {return position.startsWith(pos_);});if (index === -1) {(0, _warning.default)(false, 'Unexpected position ' + pos_ + ' passed to Popup. Expected one of: ' + positions.join(', '));return positions;}return [].concat(positions.slice(index), positions.slice(0, index));};_proto.getLocation = function getLocation(popupElement, location) {var _this$getProps4 = this.getProps(),tryPreserveFirstRenderedPosition = _this$getProps4.tryPreserveFirstRenderedPosition,tryBestFallbackPosition = _this$getProps4.tryBestFallbackPosition;var positions = this.reorderPropsPositionsWithPriorityPos();var anchorElement = this.anchorElement;(0, _warning.default)(anchorElement && (0, _isInstanceOf.isInstanceOf)(anchorElement, _globalObject.globalObject.Element), 'Anchor element is not defined or not instance of Element');if (!(anchorElement && (0, _isInstanceOf.isInstanceOf)(anchorElement, _globalObject.globalObject.Element))) {return location;}var anchorRect = _PopupHelper.PopupHelper.getElementAbsoluteRect(anchorElement);var popupRect = _PopupHelper.PopupHelper.getElementAbsoluteRect(popupElement);var position;var coordinates;if (location && location !== DUMMY_LOCATION && location.position) {position = location.position;coordinates = this.getCoordinates(anchorRect, popupRect, position);var isFullyVisible = _PopupHelper.PopupHelper.isFullyVisible(coordinates, popupRect);var canBecomeVisible = !isFullyVisible && _PopupHelper.PopupHelper.canBecomeFullyVisible(position, coordinates);if ( // если нужно сохранить первоначальную позицию и Попап целиком
800
842
  // находится в пределах вьюпорта (или может быть проскроллен в него)
801
843
  tryPreserveFirstRenderedPosition && (isFullyVisible || canBecomeVisible) || // если Попап целиком во вьюпорте и в самой приоритетной позиции
802
844
  // (иначе нужно попытаться позицию сменить)
803
845
  isFullyVisible && position === positions[0]) {// сохраняем текущую позицию
804
- return { coordinates: coordinates, position: position, isFullyVisible: true };}}for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(positions), _step; !(_step = _iterator()).done;) {position = _step.value;coordinates = this.getCoordinates(anchorRect, popupRect, position);if (_PopupHelper.PopupHelper.isFullyVisible(coordinates, popupRect)) {return { coordinates: coordinates, position: position, isFullyVisible: true };}}position = positions[0];coordinates = this.getCoordinates(anchorRect, popupRect, position);return { coordinates: coordinates, position: position, isFullyVisible: false };};_proto.getPinnedPopupOffset = function getPinnedPopupOffset(anchorRect, position) {if (!this.getProps().hasPin || /center|middle/.test(position.align)) {return 0;}var anchorSize = /top|bottom/.test(position.direction) ? anchorRect.width : anchorRect.height;var pinSize = this.props.pinSize;return Math.max(0, this.getPinOffset(position.align) + (pinSize || parseInt(this.theme.popupPinSize)) - anchorSize / 2);};_proto.getCoordinates = function getCoordinates(anchorRect, popupRect, positionName) {var marginFromProps = this.props.margin;var margin = (0, _utils.isNonNullable)(marginFromProps) && !isNaN(marginFromProps) ? marginFromProps : parseInt(this.theme.popupMargin) || 0;var position = _PopupHelper.PopupHelper.getPositionObject(positionName);var popupOffset = this.getProps().popupOffset + this.getPinnedPopupOffset(anchorRect, position);switch (position.direction) {case 'top':return { top: anchorRect.top - popupRect.height - margin, left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset) };case 'middle':return { top: anchorRect.top + anchorRect.height / 2 - popupRect.height / 2, left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset)
846
+ return { coordinates: coordinates, position: position, isFullyVisible: true };}}for (var _iterator = (0, _createForOfIteratorHelperLoose2.default)(positions), _step; !(_step = _iterator()).done;) {position = _step.value;coordinates = this.getCoordinates(anchorRect, popupRect, position);if (_PopupHelper.PopupHelper.isFullyVisible(coordinates, popupRect)) {return { coordinates: coordinates, position: position, isFullyVisible: true };}}position = tryBestFallbackPosition ? this.getBestFallbackPosition(positions, anchorRect, popupRect) : positions[0];coordinates = this.getCoordinates(anchorRect, popupRect, position);return { coordinates: coordinates, position: position, isFullyVisible: false };};_proto.getBestFallbackPosition = function getBestFallbackPosition(positions, anchorRect, popupRect) {var defaultPosition = positions[0];var coords = this.getCoordinates(anchorRect, popupRect, defaultPosition);var overflow = _PopupHelper.PopupHelper.getOverflowEdges(coords, popupRect);var preferredDirection = _PopupHelper.PopupHelper.getPreferredDirection(overflow, defaultPosition);var preferredAlignOrder = _PopupHelper.PopupHelper.getPreferredAlignOrder(overflow);var candidates = _PopupHelper.PopupHelper.buildFallbackCandidates(positions, overflow, preferredDirection, preferredAlignOrder, PopupPinnablePositions);var positionsSet = new Set(positions);var best = candidates[0];var minCount = 4;for (var _iterator2 = (0, _createForOfIteratorHelperLoose2.default)(candidates), _step2; !(_step2 = _iterator2()).done;) {var positionName = _step2.value;var _coords = this.getCoordinates(anchorRect, popupRect, positionName);var _overflow = _PopupHelper.PopupHelper.getOverflowEdges(_coords, popupRect);var count = _PopupHelper.PopupHelper.getOverflowCount(_overflow);var isBetter = count < minCount || count === minCount && positionsSet.has(positionName) && !positionsSet.has(best);if (isBetter) {minCount = count;best = positionName;}}return best;};_proto.getPinnedPopupOffset = function getPinnedPopupOffset(anchorRect, position) {if (!this.getProps().hasPin || /center|middle/.test(position.align)) {return 0;}var anchorSize = /top|bottom/.test(position.direction) ? anchorRect.width : anchorRect.height;var pinSize = this.props.pinSize;return Math.max(0, this.getPinOffset(position.align) + (pinSize || parseInt(this.theme.popupPinSize)) - anchorSize / 2);};_proto.getCoordinates = function getCoordinates(anchorRect, popupRect, positionName) {var marginFromProps = this.props.margin;var margin = (0, _utils.isNonNullable)(marginFromProps) && !isNaN(marginFromProps) ? marginFromProps : parseInt(this.theme.popupMargin) || 0;var position = _PopupHelper.PopupHelper.getPositionObject(positionName);var popupOffset = this.getProps().popupOffset + this.getPinnedPopupOffset(anchorRect, position);switch (position.direction) {case 'top':return { top: anchorRect.top - popupRect.height - margin, left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset) };case 'middle':return { top: anchorRect.top + anchorRect.height / 2 - popupRect.height / 2, left: this.getHorizontalPosition(anchorRect, popupRect, position.align, popupOffset)
805
847
  };
806
848
  case 'bottom':
807
849
  return {