Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react): fixing type of icon in ToastOptions, ActionSheetOptions, f…
…ixes #20100
- Loading branch information
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
import { ActionSheetOptions, actionSheetController } from '@ionic/core'; | ||
import { ActionSheetButton as ActionSheetButtonCore, ActionSheetOptions as ActionSheetOptionsCore, actionSheetController as actionSheetControllerCore } from '@ionic/core'; | ||
|
||
import { createOverlayComponent } from './createOverlayComponent'; | ||
|
||
export interface ActionSheetButton extends Omit<ActionSheetButtonCore, 'icon'> { | ||
icon?: { | ||
ios: string; | ||
md: string; | ||
}; | ||
} | ||
|
||
export interface ActionSheetOptions extends Omit<ActionSheetOptionsCore, 'buttons'> { | ||
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, HTMLIonActionSheetElement>('IonActionSheet', actionSheetController); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
import { ToastOptions, toastController } from '@ionic/core'; | ||
import { ToastButton as ToastButtonCore, ToastOptions as ToastOptionsCore, toastController as toastControllerCore } from '@ionic/core'; | ||
|
||
import { createControllerComponent } from './createControllerComponent'; | ||
|
||
export interface ToastButton extends Omit<ToastButtonCore, 'icon'> { | ||
icon?: { | ||
ios: string; | ||
md: string; | ||
}; | ||
} | ||
|
||
export interface ToastOptions extends Omit<ToastOptionsCore, 'buttons'> { | ||
buttons?: (ToastButton | string)[]; | ||
} | ||
|
||
const toastController = { | ||
create: (options: ToastOptions) => toastControllerCore.create(options as any), | ||
dismiss: (data?: any, role?: string | undefined, id?: string | undefined) => toastControllerCore.dismiss(data, role, id), | ||
getTop: () => toastControllerCore.getTop() | ||
}; | ||
|
||
export const IonToast = /*@__PURE__*/createControllerComponent<ToastOptions, HTMLIonToastElement>('IonToast', toastController); |