mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 01:03:03 +08:00
feat(divider): add new ion-divider component (#30270)
Issue number: internal --------- ## What is the new behavior? - Introduces a new component, `ion-divider` which has two props, `spacing` and `inset`. - Adds e2e tests to both `spacing` and `inset` props ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information - As discussed with the PO, using this new component inside an `ion-item` is out of scope , for now. --------- Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com> Co-authored-by: Gonçalo M. <goncalo.martins@outsystems.com> Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
This commit is contained in:
@ -25,6 +25,7 @@ export const DIRECTIVES = [
|
||||
d.IonContent,
|
||||
d.IonDatetime,
|
||||
d.IonDatetimeButton,
|
||||
d.IonDivider,
|
||||
d.IonFab,
|
||||
d.IonFabButton,
|
||||
d.IonFabList,
|
||||
|
@ -703,6 +703,28 @@ export class IonDatetimeButton {
|
||||
export declare interface IonDatetimeButton extends Components.IonDatetimeButton {}
|
||||
|
||||
|
||||
@ProxyCmp({
|
||||
inputs: ['inset', 'spacing']
|
||||
})
|
||||
@Component({
|
||||
selector: 'ion-divider',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
template: '<ng-content></ng-content>',
|
||||
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
||||
inputs: ['inset', 'spacing'],
|
||||
})
|
||||
export class IonDivider {
|
||||
protected el: HTMLIonDividerElement;
|
||||
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
|
||||
c.detach();
|
||||
this.el = r.nativeElement;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export declare interface IonDivider extends Components.IonDivider {}
|
||||
|
||||
|
||||
@ProxyCmp({
|
||||
inputs: ['activated', 'edge', 'horizontal', 'mode', 'theme', 'vertical'],
|
||||
methods: ['close']
|
||||
|
@ -27,6 +27,7 @@ import { defineCustomElement as defineIonChip } from '@ionic/core/components/ion
|
||||
import { defineCustomElement as defineIonCol } from '@ionic/core/components/ion-col.js';
|
||||
import { defineCustomElement as defineIonContent } from '@ionic/core/components/ion-content.js';
|
||||
import { defineCustomElement as defineIonDatetimeButton } from '@ionic/core/components/ion-datetime-button.js';
|
||||
import { defineCustomElement as defineIonDivider } from '@ionic/core/components/ion-divider.js';
|
||||
import { defineCustomElement as defineIonFab } from '@ionic/core/components/ion-fab.js';
|
||||
import { defineCustomElement as defineIonFabButton } from '@ionic/core/components/ion-fab-button.js';
|
||||
import { defineCustomElement as defineIonFabList } from '@ionic/core/components/ion-fab-list.js';
|
||||
@ -732,6 +733,30 @@ export class IonDatetimeButton {
|
||||
export declare interface IonDatetimeButton extends Components.IonDatetimeButton {}
|
||||
|
||||
|
||||
@ProxyCmp({
|
||||
defineCustomElementFn: defineIonDivider,
|
||||
inputs: ['inset', 'spacing']
|
||||
})
|
||||
@Component({
|
||||
selector: 'ion-divider',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
template: '<ng-content></ng-content>',
|
||||
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
||||
inputs: ['inset', 'spacing'],
|
||||
standalone: true
|
||||
})
|
||||
export class IonDivider {
|
||||
protected el: HTMLIonDividerElement;
|
||||
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
|
||||
c.detach();
|
||||
this.el = r.nativeElement;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export declare interface IonDivider extends Components.IonDivider {}
|
||||
|
||||
|
||||
@ProxyCmp({
|
||||
defineCustomElementFn: defineIonFab,
|
||||
inputs: ['activated', 'edge', 'horizontal', 'mode', 'theme', 'vertical'],
|
||||
|
Reference in New Issue
Block a user