mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
refactor(): remove deprecated controllers (#20165)
* remove action-sheet-controller and alert-controller * rmeove loading controller * remove popover controller * remove toast controller * remove picker-controller * remove modal controller * remove menu controller * update menu ctrl in tests * run linter * remove window refs * Update core/src/components/loading/test/standalone/index.html Co-Authored-By: Brandy Carney <brandyscarney@users.noreply.github.com> * remove window from modal tests * test * testing timeout * change timeout Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
This commit is contained in:
@ -10,6 +10,10 @@
|
||||
<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>
|
||||
<script type="module">
|
||||
import { actionSheetController } from '../../../../dist/ionic/index.esm.js';
|
||||
window.actionSheetController = actionSheetController;
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<ion-app>
|
||||
@ -57,11 +61,14 @@
|
||||
</style>
|
||||
<script>
|
||||
window.addEventListener('ionActionSheetDidDismiss', function (e) { console.log('didDismiss', e) })
|
||||
|
||||
async function openActionSheet(opts) {
|
||||
const actionSheet = await actionSheetController.create(opts);
|
||||
await actionSheet.present();
|
||||
}
|
||||
|
||||
async function presentBasic() {
|
||||
const mode = Ionic.mode;
|
||||
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
await openActionSheet({
|
||||
header: "Albums",
|
||||
buttons: [{
|
||||
text: 'Delete',
|
||||
@ -98,12 +105,10 @@
|
||||
}
|
||||
}]
|
||||
});
|
||||
document.body.append(actionSheetElement);
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentAlert() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
await openActionSheet({
|
||||
buttons: [{
|
||||
text: 'Open Alert',
|
||||
handler: async () => {
|
||||
@ -114,7 +119,7 @@
|
||||
buttons: [{
|
||||
text: 'Okay',
|
||||
handler: async () => {
|
||||
await actionSheetElement.dismiss();
|
||||
await actionSheetController.dismiss();
|
||||
return false;
|
||||
}
|
||||
}]
|
||||
@ -131,12 +136,10 @@
|
||||
}
|
||||
}]
|
||||
});
|
||||
document.body.append(actionSheetElement);
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentCancelOnly() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
await openActionSheet({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Cancel',
|
||||
@ -147,16 +150,12 @@
|
||||
}
|
||||
]
|
||||
});
|
||||
document.body.append(actionSheetElement);
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentWithCssClass(classList) {
|
||||
const addClass = classList ? classList : "my-color-class my-custom-class";
|
||||
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
async function presentWithCssClass(classList) {
|
||||
await openActionSheet({
|
||||
header: "Custom Css Class",
|
||||
cssClass: addClass,
|
||||
cssClass: classList ? classList : "my-color-class my-custom-class",
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add to Favorites',
|
||||
@ -197,14 +196,10 @@
|
||||
}
|
||||
]
|
||||
});
|
||||
document.body.append(actionSheetElement);
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentIcons() {
|
||||
const mode = Ionic.mode;
|
||||
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
await openActionSheet({
|
||||
header: "Albums",
|
||||
buttons: [{
|
||||
text: 'Delete',
|
||||
@ -241,12 +236,10 @@
|
||||
}
|
||||
}]
|
||||
});
|
||||
document.body.append(actionSheetElement);
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentNoBackdropDismiss() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
await openActionSheet({
|
||||
backdropDismiss: false,
|
||||
buttons: [{
|
||||
text: 'Archive',
|
||||
@ -267,12 +260,10 @@
|
||||
}
|
||||
}]
|
||||
});
|
||||
document.body.append(actionSheetElement);
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentScroll() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
await openActionSheet({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add Reaction',
|
||||
@ -360,12 +351,10 @@
|
||||
}
|
||||
]
|
||||
});
|
||||
document.body.append(actionSheetElement);
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentScrollNoCancel() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
await openActionSheet({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add Reaction',
|
||||
@ -431,8 +420,6 @@
|
||||
}
|
||||
]
|
||||
});
|
||||
document.body.append(actionSheetElement);
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@ -10,7 +10,10 @@
|
||||
<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>
|
||||
|
||||
<script type="module">
|
||||
import { actionSheetController } from '../../../../dist/ionic/index.esm.js';
|
||||
window.actionSheetController = actionSheetController;
|
||||
</script>
|
||||
<body>
|
||||
<ion-app>
|
||||
|
||||
@ -31,8 +34,7 @@
|
||||
|
||||
async function presentSpec() {
|
||||
const mode = Ionic.mode;
|
||||
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
const actionSheet = await actionSheetController.create({
|
||||
header: "Open in",
|
||||
buttons: [{
|
||||
text: 'Item 1',
|
||||
@ -66,8 +68,7 @@
|
||||
}
|
||||
}]
|
||||
});
|
||||
document.body.appendChild(actionSheetElement);
|
||||
await actionSheetElement.present();
|
||||
await actionSheet.present();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@ -10,7 +10,10 @@
|
||||
<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>
|
||||
|
||||
<script type="module">
|
||||
import { actionSheetController } from '../../../../dist/ionic/index.esm.js';
|
||||
window.actionSheetController = actionSheetController;
|
||||
</script>
|
||||
<body>
|
||||
<button id="basic" onclick="presentBasic()">Basic</button>
|
||||
<button id="noBackdropDismiss" onclick="presentNoBackdropDismiss()">No Backdrop Dismiss</button>
|
||||
@ -37,8 +40,13 @@
|
||||
|
||||
<script>
|
||||
window.addEventListener('ionActionSheetDidDismiss', function(e){console.log('didDismiss', e)})
|
||||
async function openActionSheet(opts) {
|
||||
const actionSheet = await actionSheetController.create(opts);
|
||||
await actionSheet.present();
|
||||
}
|
||||
|
||||
function presentBasic() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
openActionSheet({
|
||||
header: "Albums",
|
||||
buttons: [{
|
||||
text: 'Delete',
|
||||
@ -74,14 +82,10 @@
|
||||
}
|
||||
}]
|
||||
});
|
||||
document.body.appendChild(actionSheetElement);
|
||||
return actionSheetElement.present();
|
||||
}
|
||||
|
||||
function presentIcons() {
|
||||
const mode = Ionic.mode;
|
||||
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
openActionSheet({
|
||||
header: "Albums",
|
||||
buttons: [{
|
||||
text: 'Delete',
|
||||
@ -117,12 +121,10 @@
|
||||
}
|
||||
}]
|
||||
});
|
||||
document.body.appendChild(actionSheetElement);
|
||||
return actionSheetElement.present();
|
||||
}
|
||||
|
||||
function presentNoBackdropDismiss() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
openActionSheet({
|
||||
buttons: [{
|
||||
text: 'Archive',
|
||||
handler: () => {
|
||||
@ -142,12 +144,10 @@
|
||||
}
|
||||
}]
|
||||
});
|
||||
document.body.appendChild(actionSheetElement);
|
||||
return actionSheetElement.present();
|
||||
}
|
||||
|
||||
function presentAlert() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
openActionSheet({
|
||||
buttons: [{
|
||||
text: 'Open Alert',
|
||||
handler: () => {
|
||||
@ -161,12 +161,10 @@
|
||||
}
|
||||
}]
|
||||
});
|
||||
document.body.appendChild(actionSheetElement);
|
||||
return actionSheetElement.present();
|
||||
}
|
||||
|
||||
function presentScroll() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
openActionSheet({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add Reaction',
|
||||
@ -238,12 +236,10 @@
|
||||
}
|
||||
]
|
||||
});
|
||||
document.body.appendChild(actionSheetElement);
|
||||
return actionSheetElement.present();
|
||||
}
|
||||
|
||||
function presentScrollNoCancel() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
openActionSheet({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add Reaction',
|
||||
@ -309,12 +305,10 @@
|
||||
}
|
||||
]
|
||||
});
|
||||
document.body.appendChild(actionSheetElement);
|
||||
return actionSheetElement.present();
|
||||
}
|
||||
|
||||
function presentCancelOnly() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
openActionSheet({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Cancel',
|
||||
@ -325,12 +319,10 @@
|
||||
}
|
||||
]
|
||||
});
|
||||
document.body.append(actionSheetElement);
|
||||
return actionSheetElement.present();
|
||||
}
|
||||
|
||||
function presentWithCssClass() {
|
||||
const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), {
|
||||
openActionSheet({
|
||||
header: "Custom Css Class",
|
||||
cssClass: "my-class my-custom-class",
|
||||
buttons: [
|
||||
@ -344,8 +336,6 @@
|
||||
}
|
||||
]
|
||||
});
|
||||
document.body.appendChild(actionSheetElement);
|
||||
return actionSheetElement.present();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@ -10,7 +10,10 @@
|
||||
<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>
|
||||
|
||||
<script type="module">
|
||||
import { actionSheetController } from '../../../../dist/ionic/index.esm.js';
|
||||
window.actionSheetController = actionSheetController;
|
||||
</script>
|
||||
<body>
|
||||
<ion-app>
|
||||
|
||||
@ -46,12 +49,15 @@
|
||||
</ion-app>
|
||||
|
||||
<script>
|
||||
|
||||
async function openActionSheet(opts) {
|
||||
const actionSheet = await actionSheetController.create(opts);
|
||||
await actionSheet.present();
|
||||
}
|
||||
|
||||
async function presentBasic() {
|
||||
var mode = Ionic.mode;
|
||||
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
await openActionSheet({
|
||||
header: "Albums",
|
||||
buttons: [{
|
||||
text: 'Delete',
|
||||
@ -87,13 +93,11 @@
|
||||
}
|
||||
}],
|
||||
translucent: true
|
||||
})
|
||||
await actionSheetElement.present();
|
||||
});
|
||||
}
|
||||
|
||||
async function presentNoBackdropDismiss() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
await openActionSheet({
|
||||
backdropDismiss: false,
|
||||
buttons: [{
|
||||
text: 'Archive',
|
||||
@ -115,12 +119,10 @@
|
||||
}],
|
||||
translucent: true
|
||||
});
|
||||
return await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentAlert() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
await openActionSheet({
|
||||
buttons: [{
|
||||
text: 'Open Alert',
|
||||
handler: () => {
|
||||
@ -135,12 +137,10 @@
|
||||
}],
|
||||
translucent: true
|
||||
});
|
||||
return await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentScroll() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
await openActionSheet({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add Reaction',
|
||||
@ -215,12 +215,10 @@
|
||||
],
|
||||
translucent: true
|
||||
});
|
||||
return await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentScrollNoCancel() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
await openActionSheet({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add Reaction',
|
||||
@ -287,12 +285,10 @@
|
||||
],
|
||||
translucent: true
|
||||
});
|
||||
return await actionSheetElement.present();
|
||||
}
|
||||
|
||||
async function presentCancelOnly() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
await openActionSheet({
|
||||
buttons: [
|
||||
{
|
||||
text: 'Cancel',
|
||||
@ -304,7 +300,6 @@
|
||||
],
|
||||
translucent: true
|
||||
});
|
||||
return await actionSheetElement.present();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user