How to use the @rmwc/base.deprecationWarning function in @rmwc/base

To help you get started, we’ve selected a few @rmwc/base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesmfriedman / rmwc / src / card / index.tsx View on Github external
export const CardAction = (props: CardActionPropsT) => {
  /* istanbul ignore next */
  deprecationWarning(
    'The CardAction component has been removed in favor of CardActionIcon and CardActionButton due to impossible type intersections of IconButtonProps and ButtonProps'
  );

  return props.icon ? (
    // @ts-ignore
    
  ) : (
    
  );
};
github jamesmfriedman / rmwc / src / linear-progress / index.tsx View on Github external
render() {
    const { progress, buffer, determinate, ...rest } = this.props;

    if (determinate !== undefined) {
      deprecationWarning(
        'LinearProgress determinate is no longer a valid prop. Determinate is set automatically be the presence of the progress prop.'
      );
    }

    return (
      
        
        
        
          
        
        
          
        
      
    );
github jamesmfriedman / rmwc / src / textfield / index.tsx View on Github external
children,
      textarea,
      inputRef,
      characterCount,
      icon: _icon,
      trailingIcon: _trailingIcon,
      withLeadingIcon: _withLeadingIcon,
      withTrailingIcon: _withTrailingIcon,
      rootProps = {},
      ...rest
    } = this.props;

    let { icon, trailingIcon, withLeadingIcon, withTrailingIcon } = this.props;

    if (dense !== undefined) {
      deprecationWarning(
        `Textfield prop 'dense' is being removed in a future release by material-components-web.`
      );
    }

    if (withLeadingIcon !== undefined) {
      deprecationWarning(`Textfield prop 'withLeadingIcon' is now 'icon'.`);
      icon = withLeadingIcon;
    }

    if (withTrailingIcon !== undefined) {
      deprecationWarning(
        `Textfield prop 'withTrailingIcon' is now 'trailingIcon'.`
      );
      trailingIcon = withTrailingIcon;
    }
github jamesmfriedman / rmwc / src / chip / index.tsx View on Github external
onTrailingIconInteraction,
      onRemove,
      onSelect,
      icon,
      trailingIcon,
      checkmark,
      text,
      label,
      children,
      ...rest
    } = this.props;

    let labelToUse = label;

    if (text) {
      deprecationWarning('Chip `text` is now `label`');
      labelToUse = text;
    }

    return (
      
        {!!icon && (
          
        )}
        {!!checkmark && (
github jamesmfriedman / rmwc / src / select / index.tsx View on Github external
icon: _icon,
      withLeadingIcon: _withLeadingIcon,
      onChange,
      onFocus,
      onBlur,
      onKeyDown,
      invalid,
      inputRef,
      helpText,
      ...rest
    } = this.props;

    let { icon, withLeadingIcon } = this.props;

    if (withLeadingIcon !== undefined) {
      deprecationWarning(`Select prop 'withLeadingIcon' is now 'icon'.`);
      icon = withLeadingIcon;
    }

    const selectOptions = createSelectOptions(options);

    const defaultValue =
      value !== undefined ? undefined : this.props.defaultValue || '';

    const sharedEventProps = {
      onChange: this.handleChange,
      onFocus: this.handleFocus,
      onBlur: this.handleBlur,
      onTouchStart: this.handleClick,
      onMouseDown: this.handleClick
    };
github jamesmfriedman / rmwc / src / icon-button / index.tsx View on Github external
render() {
    const { icon, iconOptions, onIcon, onIconOptions, ...rest } = this.props;

    if (iconOptions || onIconOptions) {
      deprecationWarning(
        'IconButton component props iconOptions and onIconOptions must be passed directly to the icon and onIcon prop. This issue has NOT been automatically fixed for you, please update your code.'
      );
    }

    return (
      
        
        
      
    );