Skip to content

Commit

Permalink
fix: undo unwanted commit
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinLaubenstein committed Apr 18, 2023
1 parent 77d6575 commit 2c8819f
Showing 1 changed file with 12 additions and 33 deletions.
45 changes: 12 additions & 33 deletions packages/components/src/components/chip/chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import {
} from '@stencil/core';
import classNames from 'classnames';
import { emitEvent } from '../../utils/utils';
import statusNote from '../../utils/status-note';

@Component({
tag: 'scale-chip',
styleUrl: './chip.css',
Expand All @@ -39,7 +37,7 @@ export class Chip {
@Prop() ariaRoleTitle?: string;
/** (optional) chip aria-checked */
@Prop() ariaCheckedState?: boolean;
/** @deprecated - label slot should label prop */
/** (optional) chip label */
@Prop() label?: string;
/** (optional) chip disabled */
@Prop() disabled?: boolean = false;
Expand Down Expand Up @@ -77,16 +75,6 @@ export class Chip {
iconSlot.children[0].setAttribute('selected', String(false));
}
}

// handle deprecated props
if (this.label !== '') {
statusNote({
tag: 'deprecated',
message: 'Property "label" is deprecated. Please use the slot!',
type: 'warn',
source: this.hostElement,
});
}
}
disconnectedCallback() {}

Expand All @@ -100,14 +88,6 @@ export class Chip {
};

handleClick = (event: MouseEvent) => {
this.handleScaleChangeEvent(event);
};

handleKeyPress = (event: KeyboardEvent) => {
this.handleScaleChangeEvent(event);
};

handleScaleChangeEvent = (event) => {
if (this.type !== 'dynamic') {
this.selected = !this.selected;
}
Expand Down Expand Up @@ -157,9 +137,14 @@ export class Chip {
{this.type === 'dynamic' && this.selected ? (
<span
role={this.ariaRoleTitle}
tabindex="-1"
tabindex={this.selected ? '0' : '-1'}
part={this.getBasePartMap()}
class={this.getCssClassMap()}
onClick={
!this.disabled || this.type === 'dynamic'
? this.handleClick
: null
}
>
<slot name="chip-icon"></slot>
<span class="chip-label">
Expand All @@ -173,20 +158,14 @@ export class Chip {
aria-checked={
this.ariaCheckedState ? this.ariaCheckedState : this.selected
}
tabindex="0"
tabindex={this.selected ? '0' : '-1'}
part={this.getBasePartMap()}
class={this.getCssClassMap()}
onClick={(event) => {
onClick={
!this.disabled || this.type === 'dynamic'
? this.handleClick(event)
: null;
}}
onKeyDown={(event) => {
(!this.disabled && ['Enter', ' '].includes(event.key)) ||
(this.type === 'dynamic' && ['Enter', ' '].includes(event.key))
? this.handleKeyPress(event)
: null;
}}
? this.handleClick
: null
}
>
<slot name="chip-icon"></slot>
<span class="chip-label">
Expand Down

0 comments on commit 2c8819f

Please sign in to comment.