Skip to content

Commit

Permalink
remove deprecated rendererClass and justify args
Browse files Browse the repository at this point in the history
  • Loading branch information
telamonian committed Feb 24, 2020
1 parent fd332d1 commit dd9a3d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
7 changes: 1 addition & 6 deletions packages/ui-components/src/icon/labicon.tsx
Expand Up @@ -601,12 +601,7 @@ export namespace LabIcon {
* Interface defining the parameters to be passed to the LabIcon
* constructor
*/
export interface IOptions extends IIcon, Partial<VirtualElement.IRenderer> {
/**
* @deprecated does nothing
*/
rendererClass?: typeof Private.Renderer;
}
export interface IOptions extends IIcon, Partial<VirtualElement.IRenderer> {}

/**
* The input props for creating a new LabIcon
Expand Down
23 changes: 5 additions & 18 deletions packages/ui-components/src/style/icon.ts
Expand Up @@ -134,11 +134,6 @@ export namespace LabIconStyle {
* the kind of the icon, associated with a builtin stylesheet
*/
kind?: IStyleResolvable | IStyleResolvable[];

/**
* @deprecated use elementPosition instead
*/
justify?: IPosition;
}

/**
Expand Down Expand Up @@ -512,10 +507,12 @@ export namespace LabIconStyle {
...styles.map(s => s.options)
);

// add the position style (if any) with lowest precedence
if (options.elementPosition) {
styles.unshift(positionStyles[options.elementPosition]);
}

// add the size style (if any) with lowest precedence
if (options.elementSize) {
styles.unshift(sizeStyles[options.elementSize]);
}
Expand Down Expand Up @@ -548,18 +545,7 @@ export namespace LabIconStyle {
return '';
}

let {
elementPosition,
elementSize,
kind,
justify,
...elementStyle
} = props;

// DEPRECATED: alias justify => elementPosition
if (!elementPosition) {
elementPosition = justify;
}
let { elementPosition, elementSize, kind, ...elementStyle } = props;

// add option args with defined values to overrides
const options = {
Expand All @@ -579,7 +565,8 @@ export namespace LabIconStyle {
const styles = resolveKind(kind);
styles.push({ elementStyle, options });

// apply style options/merge styles, then convert to typestyle class
// merge styles (while applying any style options),
// then convert to typestyle class
const cls = resolveStyleClass(resolveStyles(styles));

if (cacheable) {
Expand Down

0 comments on commit dd9a3d3

Please sign in to comment.