Skip to content

Commit

Permalink
refactor(stepper-item)!: Remove deprecated properties (#5869)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Removed deprecated properties.

- Removed the property `active`, use `selected` instead.
- Removed the property `itemTitle`, use `heading` instead.
- Removed the property `itemSubtitle`, use `description` instead.
  • Loading branch information
driskull authored Dec 5, 2022
1 parent f7a5de2 commit 23259f2
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 306 deletions.
42 changes: 4 additions & 38 deletions src/components/stepper-item/stepper-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,13 @@ export class StepperItem implements InteractiveComponent, LocalizedComponent, Lo
//
//--------------------------------------------------------------------------

/**
* When `true`, the component is selected.
*
* @deprecated Use `selected` instead.
*/
@Prop({ reflect: true, mutable: true }) active = false;

@Watch("active")
activeHandler(value: boolean): void {
this.selected = value;
}

/**
* When `true`, the component is selected.
*/
@Prop({ reflect: true, mutable: true }) selected = false;

@Watch("selected")
selectedHandler(value: boolean): void {
this.active = value;
selectedHandler(): void {
if (this.selected) {
this.emitRequestedItem();
}
Expand All @@ -90,23 +77,9 @@ export class StepperItem implements InteractiveComponent, LocalizedComponent, Lo
/** When `true`, interaction is prevented and the component is displayed with lower opacity. */
@Prop({ reflect: true }) disabled = false;

/**
* The component header text.
*
* @deprecated use `heading` instead.
*/
@Prop() itemTitle?: string;

/** The component header text. */
@Prop() heading?: string;

/**
* A description for the component. Displays below the header text.
*
* @deprecated use `description` instead.
*/
@Prop() itemSubtitle?: string;

/** A description for the component. Displays below the header text. */
@Prop() description: string;

Expand Down Expand Up @@ -191,13 +164,6 @@ export class StepperItem implements InteractiveComponent, LocalizedComponent, Lo

connectedCallback(): void {
connectLocalized(this);
const { selected, active } = this;

if (selected) {
this.active = selected;
} else if (active) {
this.selected = active;
}
}

componentWillLoad(): void {
Expand Down Expand Up @@ -236,7 +202,7 @@ export class StepperItem implements InteractiveComponent, LocalizedComponent, Lo
render(): VNode {
return (
<Host
aria-expanded={toAriaBoolean(this.active)}
aria-expanded={toAriaBoolean(this.selected)}
onClick={this.handleItemClick}
onKeyDown={this.keyDownHandler}
>
Expand All @@ -256,8 +222,8 @@ export class StepperItem implements InteractiveComponent, LocalizedComponent, Lo
</div>
) : null}
<div class="stepper-item-header-text">
<span class="stepper-item-heading">{this.heading || this.itemTitle}</span>
<span class="stepper-item-description">{this.description || this.itemSubtitle}</span>
<span class="stepper-item-heading">{this.heading}</span>
<span class="stepper-item-description">{this.description}</span>
</div>
</div>
<div class="stepper-item-content">
Expand Down
Loading

0 comments on commit 23259f2

Please sign in to comment.