mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
chore(test): remove unused preview tests (#18608)
This commit is contained in:
@ -1,367 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="ltr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Action Sheet</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet">
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet">
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script></head>
|
||||
|
||||
<body>
|
||||
<ion-app>
|
||||
|
||||
<ion-header translucent>
|
||||
<ion-toolbar>
|
||||
<ion-title>Action Sheet</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="ion-padding" fullscreen>
|
||||
<ion-action-sheet-controller></ion-action-sheet-controller>
|
||||
|
||||
<ion-button expand="block" id="basic" onclick="presentBasic()">Basic</ion-button>
|
||||
<ion-button expand="block" id="noBackdropDismiss" onclick="presentNoBackdropDismiss()">No Backdrop Dismiss</ion-button>
|
||||
<ion-button expand="block" id="alertFromActionSheet" onclick="presentAlert()">Alert from Action Sheet</ion-button>
|
||||
<ion-button expand="block" id="scrollableOptions" onclick="presentScroll()">Scrollable Options</ion-button>
|
||||
<ion-button expand="block" id="scrollWithoutCancel" onclick="presentScrollNoCancel()">Scroll Without Cancel</ion-button>
|
||||
<ion-button expand="block" id="cancelOnly" onclick="presentCancelOnly()">Cancel Only</ion-button>
|
||||
<ion-button expand="block" id="icons" onclick="presentIcons()">Icons</ion-button>
|
||||
<ion-button expand="block" id="cssClass" onclick="presentWithCssClass()">Custom CSS Class</ion-button>
|
||||
|
||||
</ion-content>
|
||||
</ion-app>
|
||||
|
||||
<script>
|
||||
window.addEventListener('ionActionSheetDidDismiss', function (e) { console.log('didDismiss', e) })
|
||||
|
||||
async function presentBasic() {
|
||||
const mode = Ionic.mode;
|
||||
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
await actionSheetController.componentOnReady();
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
header: "Albums",
|
||||
buttons: [{
|
||||
text: 'Delete',
|
||||
role: 'destructive',
|
||||
icon: 'trash',
|
||||
handler: () => {
|
||||
console.log('Delete clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Share',
|
||||
icon: 'share',
|
||||
handler: () => {
|
||||
console.log('Share clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Play (open modal)',
|
||||
icon: 'arrow-dropright-circle',
|
||||
handler: () => {
|
||||
console.log('Play clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Favorite',
|
||||
icon: mode === 'md' ? 'heart' : null,
|
||||
handler: () => {
|
||||
console.log('Favorite clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Cancel',
|
||||
icon: mode === 'md' ? 'close' : null,
|
||||
role: 'cancel',
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
}]
|
||||
});
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentIcons() {
|
||||
const mode = Ionic.mode;
|
||||
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
await actionSheetController.componentOnReady();
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
header: "Albums",
|
||||
buttons: [{
|
||||
text: 'Delete',
|
||||
role: 'destructive',
|
||||
icon: 'trash',
|
||||
handler: () => {
|
||||
console.log('Delete clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Share',
|
||||
icon: 'share',
|
||||
handler: () => {
|
||||
console.log('Share clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Play (open modal)',
|
||||
icon: 'arrow-dropright-circle',
|
||||
handler: () => {
|
||||
console.log('Play clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Favorite',
|
||||
icon: 'heart',
|
||||
role: 'selected',
|
||||
handler: () => {
|
||||
console.log('Favorite clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Cancel',
|
||||
role: 'cancel',
|
||||
icon: 'close',
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
}]
|
||||
})
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentNoBackdropDismiss() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
await actionSheetController.componentOnReady();
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
backdropDismiss: false,
|
||||
buttons: [{
|
||||
text: 'Archive',
|
||||
handler: () => {
|
||||
console.log('Archive clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Destructive',
|
||||
role: 'destructive',
|
||||
handler: () => {
|
||||
console.log('Destructive clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Cancel',
|
||||
role: 'cancel',
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
}]
|
||||
});
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentAlert() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
await actionSheetController.componentOnReady();
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
buttons: [{
|
||||
text: 'Open Alert',
|
||||
handler: () => {
|
||||
console.log('Open Alert clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Cancel',
|
||||
role: 'cancel',
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
}]
|
||||
});
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentScroll() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
await actionSheetController.componentOnReady();
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add Reaction',
|
||||
handler: () => {
|
||||
console.log('Add Reaction clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Copy Text',
|
||||
handler: () => {
|
||||
console.log('Copy Text clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Share Text',
|
||||
handler: () => {
|
||||
console.log('Share Text clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Copy Link to Message',
|
||||
handler: () => {
|
||||
console.log('Copy Link to Message clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Remind Me',
|
||||
handler: () => {
|
||||
console.log('Remind Me clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Pin File',
|
||||
handler: () => {
|
||||
console.log('Pin File clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Star File',
|
||||
handler: () => {
|
||||
console.log('Star File clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Mark Unread',
|
||||
handler: () => {
|
||||
console.log('Mark Unread clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Edit Title',
|
||||
handler: () => {
|
||||
console.log('Edit Title clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Save Image',
|
||||
handler: () => {
|
||||
console.log('Save Image clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Copy Image',
|
||||
handler: () => {
|
||||
console.log('Copy Image clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Delete File',
|
||||
role: 'destructive',
|
||||
handler: () => {
|
||||
console.log('Delete File clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Cancel',
|
||||
role: 'cancel', // will always sort to be on the bottom
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentScrollNoCancel() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
await actionSheetController.componentOnReady();
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add Reaction',
|
||||
handler: () => {
|
||||
console.log('Add Reaction clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Copy Text',
|
||||
handler: () => {
|
||||
console.log('Copy Text clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Share Text',
|
||||
handler: () => {
|
||||
console.log('Share Text clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Copy Link to Message',
|
||||
handler: () => {
|
||||
console.log('Copy Link to Message clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Remind Me',
|
||||
handler: () => {
|
||||
console.log('Remind Me clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Pin File',
|
||||
handler: () => {
|
||||
console.log('Pin File clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Star File',
|
||||
handler: () => {
|
||||
console.log('Star File clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Mark Unread',
|
||||
handler: () => {
|
||||
console.log('Mark Unread clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Edit Title',
|
||||
handler: () => {
|
||||
console.log('Edit Title clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Save Image',
|
||||
handler: () => {
|
||||
console.log('Save Image clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Copy Image',
|
||||
handler: () => {
|
||||
console.log('Copy Image clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Delete File',
|
||||
role: 'destructive',
|
||||
handler: () => {
|
||||
console.log('Delete File clicked');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentCancelOnly() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
await actionSheetController.componentOnReady();
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Cancel',
|
||||
role: 'cancel', // will always sort to be on the bottom
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentWithCssClass() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
await actionSheetController.componentOnReady();
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
header: "Custom Css Class",
|
||||
cssClass: "my-class my-custom-class",
|
||||
buttons: [
|
||||
{
|
||||
text: 'Test',
|
||||
role: 'test',
|
||||
cssClass: 'my-cancel-button my-custom-button customClass',
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user