diff --git a/packages/react-ui/components/Autocomplete/Autocomplete.tsx b/packages/react-ui/components/Autocomplete/Autocomplete.tsx index 0f7d9923970..0e87567b393 100644 --- a/packages/react-ui/components/Autocomplete/Autocomplete.tsx +++ b/packages/react-ui/components/Autocomplete/Autocomplete.tsx @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import { ThemeContext } from '../../lib/theming/ThemeContext'; import { Theme } from '../../lib/theming/Theme'; import { isKeyArrowDown, isKeyArrowUp, isKeyEnter, isKeyEscape } from '../../lib/events/keyboard/identifiers'; -import { Input, InputProps } from '../Input'; +import { Input, InputProps, InputSize } from '../Input'; import { DropdownContainer } from '../../internal/DropdownContainer'; import { Menu } from '../../internal/Menu'; import { MenuItem } from '../MenuItem'; @@ -101,7 +101,7 @@ export class Autocomplete extends React.Component { public static __KONTUR_REACT_UI__ = 'Center'; public static defaultProps = { - align: 'center', + align: 'center' as HorizontalAlign, }; private setRootNode!: TSetRootNode; diff --git a/packages/react-ui/components/CurrencyInput/CurrencyInput.tsx b/packages/react-ui/components/CurrencyInput/CurrencyInput.tsx index 99b21056745..59bbbda7241 100644 --- a/packages/react-ui/components/CurrencyInput/CurrencyInput.tsx +++ b/packages/react-ui/components/CurrencyInput/CurrencyInput.tsx @@ -87,7 +87,6 @@ export class CurrencyInput extends React.PureComponent extends CommonProps { +export interface DatePickerProps extends CommonProps { autoFocus?: boolean; disabled?: boolean; enableTodayLink?: boolean; diff --git a/packages/react-ui/components/DropdownMenu/DropdownMenu.tsx b/packages/react-ui/components/DropdownMenu/DropdownMenu.tsx index 5396d8f2bc0..9eeacb3e58f 100644 --- a/packages/react-ui/components/DropdownMenu/DropdownMenu.tsx +++ b/packages/react-ui/components/DropdownMenu/DropdownMenu.tsx @@ -65,7 +65,7 @@ export class DropdownMenu extends React.Component { public static defaultProps = { disableAnimations: isTestEnv, - positions: ['bottom left', 'bottom right', 'top left', 'top right'], + positions: ['bottom left', 'bottom right', 'top left', 'top right'] as PopupPositionsType[], }; private popupMenu: Nullable = null; diff --git a/packages/react-ui/components/FxInput/FxInput.tsx b/packages/react-ui/components/FxInput/FxInput.tsx index b7fa770025a..d7113130629 100644 --- a/packages/react-ui/components/FxInput/FxInput.tsx +++ b/packages/react-ui/components/FxInput/FxInput.tsx @@ -45,7 +45,7 @@ export class FxInput extends React.Component { public static defaultProps = { width: 250, - type: 'text', + type: 'text' as 'currency' | InputProps['type'], value: '', }; diff --git a/packages/react-ui/components/Input/Input.tsx b/packages/react-ui/components/Input/Input.tsx index 9a2efea4529..76476a641dd 100644 --- a/packages/react-ui/components/Input/Input.tsx +++ b/packages/react-ui/components/Input/Input.tsx @@ -115,10 +115,8 @@ export interface InputState { export class Input extends React.Component { public static __KONTUR_REACT_UI__ = 'Input'; - public static defaultProps: { - size: InputSize; - } = { - size: 'small', + public static defaultProps = { + size: 'small' as InputSize, }; public state: InputState = { diff --git a/packages/react-ui/components/Kebab/Kebab.tsx b/packages/react-ui/components/Kebab/Kebab.tsx index 5679f3f2938..35feab6a113 100644 --- a/packages/react-ui/components/Kebab/Kebab.tsx +++ b/packages/react-ui/components/Kebab/Kebab.tsx @@ -66,7 +66,7 @@ export class Kebab extends React.Component { public static defaultProps = { onOpen: () => undefined, onClose: () => undefined, - positions: ['bottom left', 'bottom right', 'top left', 'top right'], + positions: ['bottom left', 'bottom right', 'top left', 'top right'] as PopupPositionsType[], size: 'small', disableAnimations: isTestEnv, icon: , diff --git a/packages/react-ui/components/PasswordInput/PasswordInput.tsx b/packages/react-ui/components/PasswordInput/PasswordInput.tsx index 2d8e9b946f8..e7b16207252 100644 --- a/packages/react-ui/components/PasswordInput/PasswordInput.tsx +++ b/packages/react-ui/components/PasswordInput/PasswordInput.tsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { isKeyCapsLock } from '../../lib/events/keyboard/identifiers'; import { KeyboardEventCodes as Codes } from '../../lib/events/keyboard/KeyboardEventCodes'; -import { Input, InputProps } from '../Input'; +import { Input, InputProps, InputSize } from '../Input'; import { Nullable } from '../../typings/utility-types'; import { EyeClosedIcon, EyeOpenedIcon } from '../../internal/icons/16px'; import { isIE11 } from '../../lib/client'; @@ -39,7 +39,7 @@ export class PasswordInput extends React.PureComponent { public static defaultProps = { invert: false, - scrollBehaviour: 'auto', + scrollBehaviour: 'auto' as ScrollBehaviour, preventWindowScroll: false, }; diff --git a/packages/react-ui/components/Select/Select.tsx b/packages/react-ui/components/Select/Select.tsx index 964466f4948..621574e741e 100644 --- a/packages/react-ui/components/Select/Select.tsx +++ b/packages/react-ui/components/Select/Select.tsx @@ -181,7 +181,7 @@ export class Select extends React.Component { }; public static defaultProps: SpinnerProps = { - type: 'normal', + type: 'normal' as SpinnerType, }; public static Types: typeof types = types; diff --git a/packages/react-ui/components/TokenInput/TokenInput.tsx b/packages/react-ui/components/TokenInput/TokenInput.tsx index b54b8ee2eb8..9e2493e9302 100644 --- a/packages/react-ui/components/TokenInput/TokenInput.tsx +++ b/packages/react-ui/components/TokenInput/TokenInput.tsx @@ -188,8 +188,8 @@ export class TokenInput extends React.PureComponent = DefaultState; diff --git a/packages/react-ui/components/Tooltip/Tooltip.tsx b/packages/react-ui/components/Tooltip/Tooltip.tsx index f76feceda1e..7cad04a25e8 100644 --- a/packages/react-ui/components/Tooltip/Tooltip.tsx +++ b/packages/react-ui/components/Tooltip/Tooltip.tsx @@ -166,12 +166,11 @@ export class Tooltip extends React.PureComponent { }; public static defaultProps = { - pos: DefaultPosition, - trigger: 'hover', + pos: DefaultPosition as PopupPositionsType, + trigger: 'hover' as TooltipTrigger, allowedPositions: Positions, disableAnimations: isTestEnv, useWrapper: false, - closeOnChildrenMouseLeave: false, }; public static delay = 100; diff --git a/packages/react-ui/internal/Calendar/Calendar.tsx b/packages/react-ui/internal/Calendar/Calendar.tsx index 836cc7116d6..904be850945 100644 --- a/packages/react-ui/internal/Calendar/Calendar.tsx +++ b/packages/react-ui/internal/Calendar/Calendar.tsx @@ -49,17 +49,16 @@ export class Calendar extends React.Component { public static __KONTUR_REACT_UI__ = 'Calendar'; public static defaultProps = { - holidays: [], minDate: { year: MIN_YEAR, month: MIN_MONTH, date: MIN_DATE, - }, + } as CalendarDateShape, maxDate: { year: MAX_YEAR, month: MAX_MONTH, date: MAX_DATE, - }, + } as CalendarDateShape, }; private theme!: Theme; diff --git a/packages/react-ui/internal/InputLikeText/InputLikeText.tsx b/packages/react-ui/internal/InputLikeText/InputLikeText.tsx index f3f67cd6265..8c11646bd26 100644 --- a/packages/react-ui/internal/InputLikeText/InputLikeText.tsx +++ b/packages/react-ui/internal/InputLikeText/InputLikeText.tsx @@ -6,7 +6,7 @@ import { MouseDrag, MouseDragEventHandler } from '../../lib/events/MouseDrag'; import { isEdge, isIE11, isMobile } from '../../lib/client'; import { Nullable } from '../../typings/utility-types'; import { removeAllSelections, selectNodeContents } from '../../components/DateInput/helpers/SelectionHelpers'; -import { InputProps, InputIconType, InputState } from '../../components/Input'; +import { InputProps, InputIconType, InputState, InputSize } from '../../components/Input'; import { styles as jsInputStyles } from '../../components/Input/Input.styles'; import { ThemeContext } from '../../lib/theming/ThemeContext'; import { Theme } from '../../lib/theming/Theme'; @@ -34,7 +34,7 @@ export type InputLikeTextState = Omit; export class InputLikeText extends React.Component { public static __KONTUR_REACT_UI__ = 'InputLikeText'; - public static defaultProps = { size: 'small' }; + public static defaultProps = { size: 'small' as InputSize }; public state = { blinking: false, focused: false }; diff --git a/packages/react-ui/internal/Popup/Popup.tsx b/packages/react-ui/internal/Popup/Popup.tsx index 88504a7535f..c037c86bd8c 100644 --- a/packages/react-ui/internal/Popup/Popup.tsx +++ b/packages/react-ui/internal/Popup/Popup.tsx @@ -181,7 +181,7 @@ export class Popup extends React.Component { disableAnimations: isTestEnv, useWrapper: false, ignoreHover: false, - width: 'auto', + width: 'auto' as React.CSSProperties['width'], }; public state: PopupState = { location: this.props.opened ? DUMMY_LOCATION : null }; diff --git a/packages/react-ui/internal/ZIndex/ZIndex.tsx b/packages/react-ui/internal/ZIndex/ZIndex.tsx index e7555a39d24..760e4cac0f4 100644 --- a/packages/react-ui/internal/ZIndex/ZIndex.tsx +++ b/packages/react-ui/internal/ZIndex/ZIndex.tsx @@ -31,7 +31,7 @@ export class ZIndex extends React.Component { public static defaultProps = { delta: 10, priority: 0, - style: {}, + style: {} as React.CSSProperties, applyZIndex: true, coverChildren: false, createStackingContext: false,