Skip to content

Commit

Permalink
chore: fix default props type
Browse files Browse the repository at this point in the history
  • Loading branch information
HelenaIsh committed Feb 7, 2022
1 parent 9140925 commit f8c6efb
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions packages/react-ui/components/Autocomplete/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -101,7 +101,7 @@ export class Autocomplete extends React.Component<AutocompleteProps, Autocomplet

public static defaultProps = {
renderItem,
size: 'small',
size: 'small' as InputSize,
disablePortal: false,
hasShadow: true,
menuMaxHeight: 300,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/components/Center/Center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class Center extends React.Component<CenterProps> {
public static __KONTUR_REACT_UI__ = 'Center';

public static defaultProps = {
align: 'center',
align: 'center' as HorizontalAlign,
};
private setRootNode!: TSetRootNode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export class CurrencyInput extends React.PureComponent<CurrencyInputProps, Curre
fractionDigits: 2,
hideTrailingZeros: false,
value: null,
inputMode: 'decimal',
};

public state: CurrencyInputState = {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const INPUT_PASS_PROPS = {

export const MIN_WIDTH = 120;

export interface DatePickerProps<T> extends CommonProps {
export interface DatePickerProps<T = string> extends CommonProps {
autoFocus?: boolean;
disabled?: boolean;
enableTodayLink?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/components/DropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class DropdownMenu extends React.Component<DropdownMenuProps> {

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<PopupMenu> = null;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/components/FxInput/FxInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class FxInput extends React.Component<FxInputProps> {

public static defaultProps = {
width: 250,
type: 'text',
type: 'text' as 'currency' | InputProps['type'],
value: '',
};

Expand Down
6 changes: 2 additions & 4 deletions packages/react-ui/components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ export interface InputState {
export class Input extends React.Component<InputProps, InputState> {
public static __KONTUR_REACT_UI__ = 'Input';

public static defaultProps: {
size: InputSize;
} = {
size: 'small',
public static defaultProps = {
size: 'small' as InputSize,
};

public state: InputState = {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/components/Kebab/Kebab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class Kebab extends React.Component<KebabProps, KebabState> {
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: <MenuKebabIcon />,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/internal/Popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class Popup extends React.Component<PopupProps, PopupState> {
disableAnimations: isTestEnv,
useWrapper: false,
ignoreHover: false,
width: 'auto',
width: 'auto' as React.CSSProperties['width'],
};

public state: PopupState = { location: this.props.opened ? DUMMY_LOCATION : null };
Expand Down

0 comments on commit f8c6efb

Please sign in to comment.