@@ -11,7 +11,6 @@ import type { dxElementWrapper } from '@js/core/renderer';
1111import $ from '@js/core/renderer' ;
1212import resizeObserverSingleton from '@js/core/resize_observer' ;
1313import { EmptyTemplate } from '@js/core/templates/empty_template' ;
14- import browser from '@js/core/utils/browser' ;
1514import { noop } from '@js/core/utils/common' ;
1615import { extend } from '@js/core/utils/extend' ;
1716import { camelize } from '@js/core/utils/inflector' ;
@@ -27,7 +26,6 @@ import {
2726 getWidth ,
2827} from '@js/core/utils/size' ;
2928import { isDefined , isObject } from '@js/core/utils/type' ;
30- import { compare as compareVersions } from '@js/core/utils/version' ;
3129import Button from '@js/ui/button' ;
3230import type { dxPopupAnimation , Properties , ToolbarItem } from '@js/ui/popup' ;
3331import Resizable from '@js/ui/resizable' ;
@@ -79,8 +77,9 @@ const BUTTON_TEXT_MODE = 'text';
7977const BUTTON_CONTAINED_MODE = 'contained' ;
8078const BUTTON_OUTLINED_MODE = 'outlined' ;
8179
82- const IS_OLD_SAFARI = browser . safari && compareVersions ( browser . version , [ 11 ] ) < 0 ;
83- const HEIGHT_STRATEGIES = { static : '' , inherit : POPUP_CONTENT_INHERIT_HEIGHT_CLASS , flex : POPUP_CONTENT_FLEX_HEIGHT_CLASS } ;
80+ const HEIGHT_STRATEGIES = { static : '' , inherit : POPUP_CONTENT_INHERIT_HEIGHT_CLASS , flex : POPUP_CONTENT_FLEX_HEIGHT_CLASS } as const ;
81+
82+ type HeightStrategiesType = typeof HEIGHT_STRATEGIES [ keyof typeof HEIGHT_STRATEGIES ] ;
8483
8584const getButtonPlace = ( name ) => {
8685 const device = devices . current ( ) ;
@@ -889,16 +888,16 @@ class Popup<
889888 this . _setHeightClasses ( this . $overlayContent ( ) , currentHeightStrategyClass ) ;
890889 }
891890
892- _heightStrategyChangeOffset ( currentHeightStrategyClass , popupVerticalPaddings ) : number {
891+ _heightStrategyChangeOffset ( currentHeightStrategyClass : HeightStrategiesType , popupVerticalPaddings ) : number {
893892 return currentHeightStrategyClass === HEIGHT_STRATEGIES . flex ? - popupVerticalPaddings : 0 ;
894893 }
895894
896- _chooseHeightStrategy ( overlayContent : HTMLElement ) : string {
895+ _chooseHeightStrategy ( overlayContent : HTMLElement ) : HeightStrategiesType {
897896 const isAutoWidth = overlayContent . style . width === 'auto' || overlayContent . style . width === '' ;
898- let currentHeightStrategyClass = HEIGHT_STRATEGIES . static ;
897+ let currentHeightStrategyClass : HeightStrategiesType = HEIGHT_STRATEGIES . static ;
899898
900899 if ( this . _isAutoHeight ( ) && this . option ( 'autoResizeEnabled' ) ) {
901- if ( isAutoWidth || IS_OLD_SAFARI ) {
900+ if ( isAutoWidth ) {
902901 currentHeightStrategyClass = HEIGHT_STRATEGIES . inherit ;
903902 } else {
904903 currentHeightStrategyClass = HEIGHT_STRATEGIES . flex ;
@@ -908,7 +907,7 @@ class Popup<
908907 return currentHeightStrategyClass ;
909908 }
910909
911- _getHeightCssStyles ( currentHeightStrategyClass , overlayContent ) {
910+ _getHeightCssStyles ( currentHeightStrategyClass : HeightStrategiesType , overlayContent ) {
912911 let cssStyles = { } ;
913912 const contentMaxHeight = this . _getOptionValue ( 'maxHeight' , overlayContent ) ;
914913 const contentMinHeight = this . _getOptionValue ( 'minHeight' , overlayContent ) ;
0 commit comments