feat(action-sheet): use action sheet overlay inline (#26172)

This commit is contained in:
Sean Perkins
2022-11-02 16:47:43 -04:00
committed by GitHub
parent 84990cec88
commit 92b763a538
12 changed files with 409 additions and 39 deletions

View File

@ -1,11 +1,11 @@
import {
ActionSheetButton as ActionSheetButtonCore,
ActionSheetOptions as ActionSheetOptionsCore,
actionSheetController as actionSheetControllerCore,
JSX
} from '@ionic/core/components';
import { defineCustomElement } from '@ionic/core/components/ion-action-sheet.js';
import { createOverlayComponent } from './createOverlayComponent';
import { createInlineOverlayComponent } from './createInlineOverlayComponent';
export interface ActionSheetButton extends Omit<ActionSheetButtonCore, 'icon'> {
icon?:
@ -20,14 +20,7 @@ export interface ActionSheetOptions extends Omit<ActionSheetOptionsCore, 'button
buttons?: (ActionSheetButton | string)[];
}
const actionSheetController = {
create: (options: ActionSheetOptions) => actionSheetControllerCore.create(options as any),
dismiss: (data?: any, role?: string | undefined, id?: string | undefined) =>
actionSheetControllerCore.dismiss(data, role, id),
getTop: () => actionSheetControllerCore.getTop(),
};
export const IonActionSheet = /*@__PURE__*/ createOverlayComponent<
ActionSheetOptions,
export const IonActionSheet = /*@__PURE__*/ createInlineOverlayComponent<
JSX.IonActionSheet,
HTMLIonActionSheetElement
>('ion-action-sheet', actionSheetController, defineCustomElement);
>('ion-action-sheet', defineCustomElement);