mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 02:31:34 +08:00
chore: sync
This commit is contained in:
@ -5,17 +5,17 @@ export { IonRouterOutlet } from './navigation/router-outlet';
|
||||
export { IonRouterLink, IonRouterLinkWithHref } from './navigation/router-link-delegate';
|
||||
export { IonTabs } from './navigation/tabs';
|
||||
export { provideIonicAngular } from './providers/ionic-angular';
|
||||
export { ActionSheetController } from './providers/action-sheet-controller';
|
||||
export { AlertController } from './providers/alert-controller';
|
||||
export { AnimationController } from './providers/animation-controller';
|
||||
export { GestureController } from './providers/gesture-controller';
|
||||
export { LoadingController } from './providers/loading-controller';
|
||||
export { MenuController } from './providers/menu-controller';
|
||||
export { ModalController } from './providers/modal-controller';
|
||||
export { PickerController } from './providers/picker-controller';
|
||||
export { PopoverController } from './providers/popover-controller';
|
||||
export { ToastController } from './providers/toast-controller';
|
||||
export {
|
||||
ActionSheetController,
|
||||
AlertController,
|
||||
LoadingController,
|
||||
ModalController,
|
||||
PickerController,
|
||||
PopoverController,
|
||||
ToastController,
|
||||
AnimationController,
|
||||
GestureController,
|
||||
DomController,
|
||||
NavController,
|
||||
Config,
|
||||
|
@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OverlayBaseController } from '@ionic/angular/common';
|
||||
import type { ActionSheetOptions } from '@ionic/core/components';
|
||||
import { actionSheetController } from '@ionic/core/components';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-action-sheet.js';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ActionSheetController extends OverlayBaseController<ActionSheetOptions, HTMLIonActionSheetElement> {
|
||||
constructor() {
|
||||
super(actionSheetController);
|
||||
defineCustomElement();
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OverlayBaseController } from '@ionic/angular/common';
|
||||
import type { AlertOptions } from '@ionic/core/components';
|
||||
import { alertController } from '@ionic/core/components';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-alert.js';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class AlertController extends OverlayBaseController<AlertOptions, HTMLIonAlertElement> {
|
||||
constructor() {
|
||||
super(alertController);
|
||||
defineCustomElement();
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import type { Animation } from '@ionic/core';
|
||||
import { createAnimation, getTimeGivenProgression } from '@ionic/core/components';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class AnimationController {
|
||||
/**
|
||||
* Create a new animation
|
||||
*/
|
||||
create(animationId?: string): Animation {
|
||||
return createAnimation(animationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* EXPERIMENTAL
|
||||
*
|
||||
* Given a progression and a cubic bezier function,
|
||||
* this utility returns the time value(s) at which the
|
||||
* cubic bezier reaches the given time progression.
|
||||
*
|
||||
* If the cubic bezier never reaches the progression
|
||||
* the result will be an empty array.
|
||||
*
|
||||
* This is most useful for switching between easing curves
|
||||
* when doing a gesture animation (i.e. going from linear easing
|
||||
* during a drag, to another easing when `progressEnd` is called)
|
||||
*/
|
||||
easingTime(p0: number[], p1: number[], p2: number[], p3: number[], progression: number): number[] {
|
||||
return getTimeGivenProgression(p0, p1, p2, p3, progression);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
import { Injectable, NgZone } from '@angular/core';
|
||||
import type { Gesture, GestureConfig } from '@ionic/core/components';
|
||||
import { createGesture } from '@ionic/core/components';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class GestureController {
|
||||
constructor(private zone: NgZone) {}
|
||||
/**
|
||||
* Create a new gesture
|
||||
*/
|
||||
create(opts: GestureConfig, runInsideAngularZone = false): Gesture {
|
||||
if (runInsideAngularZone) {
|
||||
Object.getOwnPropertyNames(opts).forEach((key) => {
|
||||
if (typeof opts[key] === 'function') {
|
||||
const fn = opts[key];
|
||||
opts[key] = (...props: any[]) => this.zone.run(() => fn(...props));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return createGesture(opts);
|
||||
}
|
||||
}
|
@ -1,16 +1,13 @@
|
||||
import { DOCUMENT } from '@angular/common';
|
||||
import { APP_INITIALIZER } from '@angular/core';
|
||||
import type { Provider } from '@angular/core';
|
||||
import {
|
||||
AngularDelegate,
|
||||
ConfigToken,
|
||||
ModalController,
|
||||
PopoverController,
|
||||
provideComponentInputBinding,
|
||||
} from '@ionic/angular/common';
|
||||
import { AngularDelegate, ConfigToken, provideComponentInputBinding } from '@ionic/angular/common';
|
||||
import { initialize } from '@ionic/core/components';
|
||||
import type { IonicConfig } from '@ionic/core/components';
|
||||
|
||||
import { ModalController } from './modal-controller';
|
||||
import { PopoverController } from './popover-controller';
|
||||
|
||||
export const provideIonicAngular = (config?: IonicConfig): Provider[] => {
|
||||
/**
|
||||
* TODO FW-4967
|
||||
|
@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OverlayBaseController } from '@ionic/angular/common';
|
||||
import type { LoadingOptions } from '@ionic/core/components';
|
||||
import { loadingController } from '@ionic/core/components';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-loading.js';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class LoadingController extends OverlayBaseController<LoadingOptions, HTMLIonLoadingElement> {
|
||||
constructor() {
|
||||
super(loadingController);
|
||||
defineCustomElement();
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
import { Injector, Injectable, EnvironmentInjector, inject } from '@angular/core';
|
||||
import { AngularDelegate, OverlayBaseController } from '@ionic/angular/common';
|
||||
import type { ModalOptions } from '@ionic/core/components';
|
||||
import { modalController } from '@ionic/core/components';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-modal.js';
|
||||
|
||||
@Injectable()
|
||||
export class ModalController extends OverlayBaseController<ModalOptions, HTMLIonModalElement> {
|
||||
private angularDelegate = inject(AngularDelegate);
|
||||
private injector = inject(Injector);
|
||||
private environmentInjector = inject(EnvironmentInjector);
|
||||
|
||||
constructor() {
|
||||
super(modalController);
|
||||
defineCustomElement();
|
||||
}
|
||||
|
||||
create(opts: ModalOptions): Promise<HTMLIonModalElement> {
|
||||
return super.create({
|
||||
...opts,
|
||||
delegate: this.angularDelegate.create(this.environmentInjector, this.injector, 'modal'),
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OverlayBaseController } from '@ionic/angular/common';
|
||||
import type { PickerOptions } from '@ionic/core/components';
|
||||
import { pickerController } from '@ionic/core/components';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-picker.js';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PickerController extends OverlayBaseController<PickerOptions, HTMLIonPickerElement> {
|
||||
constructor() {
|
||||
super(pickerController);
|
||||
defineCustomElement();
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
import { Injector, inject, EnvironmentInjector } from '@angular/core';
|
||||
import { AngularDelegate, OverlayBaseController } from '@ionic/angular/common';
|
||||
import type { PopoverOptions } from '@ionic/core/components';
|
||||
import { popoverController } from '@ionic/core/components';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-popover.js';
|
||||
|
||||
export class PopoverController extends OverlayBaseController<PopoverOptions, HTMLIonPopoverElement> {
|
||||
private angularDelegate = inject(AngularDelegate);
|
||||
private injector = inject(Injector);
|
||||
private environmentInjector = inject(EnvironmentInjector);
|
||||
|
||||
constructor() {
|
||||
super(popoverController);
|
||||
defineCustomElement();
|
||||
}
|
||||
|
||||
create(opts: PopoverOptions): Promise<HTMLIonPopoverElement> {
|
||||
return super.create({
|
||||
...opts,
|
||||
delegate: this.angularDelegate.create(this.environmentInjector, this.injector, 'popover'),
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { OverlayBaseController } from '@ionic/angular/common';
|
||||
import type { ToastOptions } from '@ionic/core/components';
|
||||
import { toastController } from '@ionic/core/components';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-toast.js';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ToastController extends OverlayBaseController<ToastOptions, HTMLIonToastElement> {
|
||||
constructor() {
|
||||
super(toastController);
|
||||
defineCustomElement();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user