mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
perf(all): minify better by using arrow functions (#18730)
This commit is contained in:
@ -260,11 +260,11 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
}
|
||||
}
|
||||
|
||||
function buttonClass(button: ActionSheetButton): CssClassMap {
|
||||
const buttonClass = (button: ActionSheetButton): CssClassMap => {
|
||||
return {
|
||||
'action-sheet-button': true,
|
||||
'ion-activatable': true,
|
||||
[`action-sheet-${button.role}`]: button.role !== undefined,
|
||||
...getClassMap(button.cssClass),
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@ -3,7 +3,7 @@ import { Animation } from '../../../interface';
|
||||
/**
|
||||
* iOS Action Sheet Enter Animation
|
||||
*/
|
||||
export function iosEnterAnimation(AnimationC: Animation, baseEl: HTMLElement): Promise<Animation> {
|
||||
export const iosEnterAnimation = (AnimationC: Animation, baseEl: HTMLElement): Promise<Animation> => {
|
||||
const baseAnimation = new AnimationC();
|
||||
|
||||
const backdropAnimation = new AnimationC();
|
||||
@ -24,4 +24,4 @@ export function iosEnterAnimation(AnimationC: Animation, baseEl: HTMLElement): P
|
||||
.add(wrapperAnimation);
|
||||
|
||||
return Promise.resolve(ani);
|
||||
}
|
||||
};
|
||||
|
||||
@ -3,7 +3,7 @@ import { Animation } from '../../../interface';
|
||||
/**
|
||||
* iOS Action Sheet Leave Animation
|
||||
*/
|
||||
export function iosLeaveAnimation(AnimationC: Animation, baseEl: HTMLElement): Promise<Animation> {
|
||||
export const iosLeaveAnimation = (AnimationC: Animation, baseEl: HTMLElement): Promise<Animation> => {
|
||||
const baseAnimation = new AnimationC();
|
||||
|
||||
const backdropAnimation = new AnimationC();
|
||||
@ -24,4 +24,4 @@ export function iosLeaveAnimation(AnimationC: Animation, baseEl: HTMLElement): P
|
||||
.add(wrapperAnimation);
|
||||
|
||||
return Promise.resolve(ani);
|
||||
}
|
||||
};
|
||||
|
||||
@ -4,7 +4,7 @@ import { Animation } from '../../../interface';
|
||||
/**
|
||||
* MD Action Sheet Enter Animation
|
||||
*/
|
||||
export function mdEnterAnimation(AnimationC: Animation, baseEl: HTMLElement): Promise<Animation> {
|
||||
export const mdEnterAnimation = (AnimationC: Animation, baseEl: HTMLElement): Promise<Animation> => {
|
||||
const baseAnimation = new AnimationC();
|
||||
|
||||
const backdropAnimation = new AnimationC();
|
||||
@ -24,4 +24,4 @@ export function mdEnterAnimation(AnimationC: Animation, baseEl: HTMLElement): Pr
|
||||
.add(wrapperAnimation);
|
||||
|
||||
return Promise.resolve(ani);
|
||||
}
|
||||
};
|
||||
|
||||
@ -3,7 +3,7 @@ import { Animation } from '../../../interface';
|
||||
/**
|
||||
* MD Action Sheet Leave Animation
|
||||
*/
|
||||
export function mdLeaveAnimation(AnimationC: Animation, baseEl: HTMLElement): Promise<Animation> {
|
||||
export const mdLeaveAnimation = (AnimationC: Animation, baseEl: HTMLElement): Promise<Animation> => {
|
||||
|
||||
const baseAnimation = new AnimationC();
|
||||
|
||||
@ -24,4 +24,4 @@ export function mdLeaveAnimation(AnimationC: Animation, baseEl: HTMLElement): Pr
|
||||
.add(wrapperAnimation);
|
||||
|
||||
return Promise.resolve(ani);
|
||||
}
|
||||
};
|
||||
|
||||
@ -2,12 +2,12 @@ import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
import { generateE2EUrl } from '../../../utils/test/utils';
|
||||
|
||||
export async function testActionSheet(
|
||||
export const testActionSheet = async (
|
||||
type: string,
|
||||
selector: string,
|
||||
rtl = false,
|
||||
afterScreenshotHook = async (..._args: any[]): Promise<void> => {/**/}
|
||||
) {
|
||||
afterScreenshotHook = async (..._args: any[]): Promise<void> => {/**/ }
|
||||
) => {
|
||||
try {
|
||||
const pageUrl = generateE2EUrl('action-sheet', type, rtl);
|
||||
|
||||
@ -42,13 +42,13 @@ export async function testActionSheet(
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export async function testActionSheetBackdrop(
|
||||
export const testActionSheetBackdrop = async (
|
||||
page: any,
|
||||
screenshotCompares: any,
|
||||
actionSheet: any
|
||||
) {
|
||||
) => {
|
||||
try {
|
||||
const backdrop = await page.find('ion-backdrop');
|
||||
await backdrop.click();
|
||||
@ -57,15 +57,15 @@ export async function testActionSheetBackdrop(
|
||||
|
||||
const isVisible = await actionSheet.isVisible();
|
||||
expect(isVisible).toBe(true);
|
||||
} catch (err) {
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export async function testActionSheetAlert(
|
||||
export const testActionSheetAlert = async (
|
||||
page: any,
|
||||
screenshotCompares: any
|
||||
) {
|
||||
) => {
|
||||
try {
|
||||
const openAlertBtn = await page.find({ text: 'Open Alert' });
|
||||
await openAlertBtn.click();
|
||||
@ -81,4 +81,4 @@ export async function testActionSheetAlert(
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user