feat(base-components): add ability to remove ios and md theme (#26669)

This commit is contained in:
Liam DeBeasi
2023-01-24 16:18:35 -05:00
committed by GitHub
parent 4d24b328e2
commit 18f109c7da
114 changed files with 1585 additions and 383 deletions

View File

@ -1,7 +1,7 @@
import { printIonWarning } from '@utils/logging';
import { config } from '../global/config';
import { getIonMode } from '../global/ionic-global';
import { getIonBehavior } from '../global/ionic-global';
import type {
ActionSheetOptions,
AlertOptions,
@ -421,11 +421,11 @@ export const present = async <OverlayPresentOptions>(
overlay.willPresent.emit();
overlay.willPresentShorthand?.emit();
const mode = getIonMode(overlay);
const platform = getIonBehavior(overlay);
// get the user's animation fn if one was provided
const animationBuilder = overlay.enterAnimation
? overlay.enterAnimation
: config.get(name, mode === 'ios' ? iosEnterAnimation : mdEnterAnimation);
: config.get(name, platform === 'ios' ? iosEnterAnimation : mdEnterAnimation);
const completed = await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
if (completed) {
@ -505,10 +505,10 @@ export const dismiss = async <OverlayDismissOptions>(
overlay.willDismiss.emit({ data, role });
overlay.willDismissShorthand?.emit({ data, role });
const mode = getIonMode(overlay);
const platform = getIonBehavior(overlay);
const animationBuilder = overlay.leaveAnimation
? overlay.leaveAnimation
: config.get(name, mode === 'ios' ? iosLeaveAnimation : mdLeaveAnimation);
: config.get(name, platform === 'ios' ? iosLeaveAnimation : mdLeaveAnimation);
// If dismissed via gesture, no need to play leaving animation again
if (role !== GESTURE) {