mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
refactor(chip): update styles, remove chip-icon and chip-button (#16264)
This reimplements chip, removing the extraneous chip-button and chip-icon components and updating the design to match the updated Material Design spec.
This commit is contained in:
@ -20,7 +20,6 @@ A list of the breaking changes introduced to each component in Ionic Angular v4.
|
||||
- [Alert](#alert)
|
||||
- [Back Button](#back-button)
|
||||
- [Button](#button)
|
||||
- [Chip](#chip)
|
||||
- [Colors](#colors)
|
||||
- [Content](#content)
|
||||
- [Datetime](#datetime)
|
||||
@ -250,34 +249,6 @@ The `small` and `large` attributes are now combined under the `size` attribute.
|
||||
</ion-button>
|
||||
```
|
||||
|
||||
## Chip
|
||||
|
||||
### Markup Changed
|
||||
|
||||
Buttons inside of an `<ion-chip>` container should now be written as an `<ion-chip-button>` element. Ionic will determine when to render an anchor tag based on the presence of an `href` attribute.
|
||||
|
||||
**Old Usage Example:**
|
||||
|
||||
```html
|
||||
<ion-chip>
|
||||
<ion-label>Default</ion-label>
|
||||
<ion-button clear color="light">
|
||||
<ion-icon name="close-circle"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-chip>
|
||||
```
|
||||
|
||||
**New Usage Example:**
|
||||
|
||||
```html
|
||||
<ion-chip>
|
||||
<ion-label>Default</ion-label>
|
||||
<ion-chip-button fill="clear" color="light">
|
||||
<ion-icon name="close-circle"></ion-icon>
|
||||
</ion-chip-button>
|
||||
</ion-chip>
|
||||
```
|
||||
|
||||
|
||||
## Colors
|
||||
|
||||
|
@ -16,8 +16,6 @@ export const DIRECTIVES = [
|
||||
d.CardTitle,
|
||||
d.Checkbox,
|
||||
d.Chip,
|
||||
d.ChipButton,
|
||||
d.ChipIcon,
|
||||
d.Col,
|
||||
d.Content,
|
||||
d.Datetime,
|
||||
|
@ -168,35 +168,13 @@ export class Checkbox {
|
||||
}
|
||||
|
||||
export declare interface Chip extends StencilComponents<'IonChip'> {}
|
||||
@Component({ selector: 'ion-chip', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['color', 'mode'] })
|
||||
@Component({ selector: 'ion-chip', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['color', 'mode', 'outline'] })
|
||||
export class Chip {
|
||||
|
||||
constructor(c: ChangeDetectorRef, r: ElementRef) {
|
||||
c.detach();
|
||||
const el = r.nativeElement;
|
||||
proxyInputs(this, el, ['color', 'mode']);
|
||||
}
|
||||
}
|
||||
|
||||
export declare interface ChipButton extends StencilComponents<'IonChipButton'> {}
|
||||
@Component({ selector: 'ion-chip-button', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['color', 'mode', 'disabled', 'fill', 'href'] })
|
||||
export class ChipButton {
|
||||
|
||||
constructor(c: ChangeDetectorRef, r: ElementRef) {
|
||||
c.detach();
|
||||
const el = r.nativeElement;
|
||||
proxyInputs(this, el, ['color', 'mode', 'disabled', 'fill', 'href']);
|
||||
}
|
||||
}
|
||||
|
||||
export declare interface ChipIcon extends StencilComponents<'IonChipIcon'> {}
|
||||
@Component({ selector: 'ion-chip-icon', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: '<ng-content></ng-content>', inputs: ['color', 'mode', 'fill', 'name', 'src'] })
|
||||
export class ChipIcon {
|
||||
|
||||
constructor(c: ChangeDetectorRef, r: ElementRef) {
|
||||
c.detach();
|
||||
const el = r.nativeElement;
|
||||
proxyInputs(this, el, ['color', 'mode', 'fill', 'name', 'src']);
|
||||
proxyInputs(this, el, ['color', 'mode', 'outline']);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user