mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
chore(): sync with main
This commit is contained in:
@ -18,13 +18,13 @@ export class BooleanValueAccessorDirective extends ValueAccessor {
|
||||
super(injector, el);
|
||||
}
|
||||
|
||||
writeValue(value: any): void {
|
||||
writeValue(value: boolean): void {
|
||||
this.el.nativeElement.checked = this.lastValue = value;
|
||||
setIonicClasses(this.el);
|
||||
}
|
||||
|
||||
@HostListener('ionChange', ['$event.target'])
|
||||
_handleIonChange(el: any): void {
|
||||
this.handleValueChange(el, el.checked);
|
||||
_handleIonChange(el: HTMLIonCheckboxElement | HTMLIonToggleElement): void {
|
||||
this.handleChangeEvent(el, el.checked);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ export class RadioValueAccessorDirective extends ValueAccessor {
|
||||
super(injector, el);
|
||||
}
|
||||
|
||||
// TODO(FW-2827): type (HTMLIonRadioElement and HTMLElement are both missing `checked`)
|
||||
@HostListener('ionSelect', ['$event.target'])
|
||||
_handleIonSelect(el: any): void {
|
||||
this.handleValueChange(el, el.checked);
|
||||
|
||||
@ -20,7 +20,14 @@ export class SelectValueAccessorDirective extends ValueAccessor {
|
||||
}
|
||||
|
||||
@HostListener('ionChange', ['$event.target'])
|
||||
_handleChangeEvent(el: any): void {
|
||||
this.handleValueChange(el, el.value);
|
||||
_handleChangeEvent(
|
||||
el:
|
||||
| HTMLIonRangeElement
|
||||
| HTMLIonSelectElement
|
||||
| HTMLIonRadioGroupElement
|
||||
| HTMLIonSegmentElement
|
||||
| HTMLIonDatetimeElement
|
||||
): void {
|
||||
this.handleChangeEvent(el, el.value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ export class TextValueAccessorDirective extends ValueAccessor {
|
||||
}
|
||||
|
||||
@HostListener('ionInput', ['$event.target'])
|
||||
_handleInputEvent(el: any): void {
|
||||
this.handleValueChange(el, el.value);
|
||||
_handleInputEvent(el: HTMLIonInputElement | HTMLIonTextareaElement | HTMLIonSearchbarElement): void {
|
||||
this.handleChangeEvent(el, el.value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@ import { Subscription } from 'rxjs';
|
||||
|
||||
import { raf } from '../../util/util';
|
||||
|
||||
// TODO(FW-2827): types
|
||||
|
||||
@Directive()
|
||||
export class ValueAccessor implements ControlValueAccessor, AfterViewInit, OnDestroy {
|
||||
private onChange: (value: any) => void = () => {
|
||||
|
||||
@ -30,6 +30,8 @@ import { isComponentFactoryResolver } from '../../util/util';
|
||||
import { StackController } from './stack-controller';
|
||||
import { RouteView, getUrl } from './stack-utils';
|
||||
|
||||
// TODO(FW-2827): types
|
||||
|
||||
@Directive({
|
||||
selector: 'ion-router-outlet',
|
||||
exportAs: 'outlet',
|
||||
|
||||
@ -17,6 +17,8 @@ import {
|
||||
toSegments,
|
||||
} from './stack-utils';
|
||||
|
||||
// TODO(FW-2827): types
|
||||
|
||||
export class StackController {
|
||||
private views: RouteView[] = [];
|
||||
private runningTask?: Promise<any>;
|
||||
|
||||
@ -86,6 +86,7 @@ export interface StackEvent {
|
||||
tabSwitch: boolean;
|
||||
}
|
||||
|
||||
// TODO(FW-2827): types
|
||||
export interface RouteView {
|
||||
id: number;
|
||||
url: string;
|
||||
|
||||
@ -106,6 +106,7 @@ export declare interface IonModal extends Components.IonModal {
|
||||
],
|
||||
})
|
||||
export class IonModal {
|
||||
// TODO(FW-2827): type
|
||||
@ContentChild(TemplateRef, { static: false }) template: TemplateRef<any>;
|
||||
|
||||
isCmpOpen: boolean = false;
|
||||
|
||||
@ -99,6 +99,7 @@ export declare interface IonPopover extends Components.IonPopover {
|
||||
],
|
||||
})
|
||||
export class IonPopover {
|
||||
// TODO(FW-2827): type
|
||||
@ContentChild(TemplateRef, { static: false }) template: TemplateRef<any>;
|
||||
|
||||
isCmpOpen: boolean = false;
|
||||
|
||||
Reference in New Issue
Block a user