mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore: expose constants for inputs and methods
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
export { IonPopover } from './overlays/popover';
|
||||
export { IonPopover, POPOVER_INPUTS, POPOVER_METHODS } from './overlays/popover';
|
||||
export * from './utils';
|
||||
|
||||
@@ -48,7 +48,7 @@ export declare interface IonPopover extends Components.IonPopover {
|
||||
}
|
||||
|
||||
|
||||
const POPOVER_INPUTS = [
|
||||
export const POPOVER_INPUTS = [
|
||||
'alignment',
|
||||
'animated',
|
||||
'arrow',
|
||||
@@ -71,9 +71,11 @@ const POPOVER_INPUTS = [
|
||||
'side',
|
||||
];
|
||||
|
||||
export const POPOVER_METHODS = ['present', 'dismiss', 'onDidDismiss', 'onWillDismiss'];
|
||||
|
||||
@ProxyCmp({
|
||||
inputs: POPOVER_INPUTS,
|
||||
methods: ['present', 'dismiss', 'onDidDismiss', 'onWillDismiss'],
|
||||
methods: POPOVER_METHODS,
|
||||
})
|
||||
@Directive()
|
||||
export class IonPopover {
|
||||
|
||||
@@ -1,61 +1,17 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { IonPopover as IonPopoverBase, ProxyCmp } from '@ionic/angular/common';
|
||||
import { IonPopover as IonPopoverBase, POPOVER_INPUTS, POPOVER_METHODS, ProxyCmp } from '@ionic/angular/common';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-popover.js';
|
||||
|
||||
@ProxyCmp({
|
||||
defineCustomElementFn: defineCustomElement,
|
||||
inputs: [
|
||||
'alignment',
|
||||
'animated',
|
||||
'arrow',
|
||||
'keepContentsMounted',
|
||||
'backdropDismiss',
|
||||
'cssClass',
|
||||
'dismissOnSelect',
|
||||
'enterAnimation',
|
||||
'event',
|
||||
'isOpen',
|
||||
'keyboardClose',
|
||||
'leaveAnimation',
|
||||
'mode',
|
||||
'showBackdrop',
|
||||
'translucent',
|
||||
'trigger',
|
||||
'triggerAction',
|
||||
'reference',
|
||||
'size',
|
||||
'side',
|
||||
],
|
||||
methods: ['present', 'dismiss', 'onDidDismiss', 'onWillDismiss'],
|
||||
inputs: POPOVER_INPUTS,
|
||||
methods: POPOVER_METHODS
|
||||
})
|
||||
@Component({
|
||||
selector: 'ion-popover',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
template: `<ng-container [ngTemplateOutlet]="template" *ngIf="isCmpOpen || keepContentsMounted"></ng-container>`,
|
||||
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
||||
inputs: [
|
||||
'alignment',
|
||||
'animated',
|
||||
'arrow',
|
||||
'keepContentsMounted',
|
||||
'backdropDismiss',
|
||||
'cssClass',
|
||||
'dismissOnSelect',
|
||||
'enterAnimation',
|
||||
'event',
|
||||
'isOpen',
|
||||
'keyboardClose',
|
||||
'leaveAnimation',
|
||||
'mode',
|
||||
'showBackdrop',
|
||||
'translucent',
|
||||
'trigger',
|
||||
'triggerAction',
|
||||
'reference',
|
||||
'size',
|
||||
'side',
|
||||
],
|
||||
standalone: true,
|
||||
imports: [CommonModule]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user