feat(toast): add ability to use toast inline (#26215)

This commit is contained in:
Amanda Johnston
2022-11-07 16:21:35 -06:00
committed by GitHub
parent 92b763a538
commit 003de44d92
12 changed files with 322 additions and 26 deletions

View File

@ -23,7 +23,6 @@ function generateOverlays() {
},
{
tag: 'ion-toast',
controller: 'toastController',
name: 'IonToast'
},
{

View File

@ -7,7 +7,6 @@ import {
JSX,
alertController,
pickerController,
toastController,
} from '@ionic/core/components';
import { defineCustomElement as defineIonActionSheetCustomElement } from '@ionic/core/components/ion-action-sheet.js'
@ -28,7 +27,7 @@ export const IonLoading = /*@__PURE__*/ defineOverlayContainer<JSX.IonLoading>('
export const IonPicker = /*@__PURE__*/ defineOverlayContainer<JSX.IonPicker>('ion-picker', defineIonPickerCustomElement, ['animated', 'backdropDismiss', 'buttons', 'columns', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'keyboardClose', 'leaveAnimation', 'mode', 'showBackdrop'], pickerController);
export const IonToast = /*@__PURE__*/ defineOverlayContainer<JSX.IonToast>('ion-toast', defineIonToastCustomElement, ['animated', 'buttons', 'color', 'cssClass', 'duration', 'enterAnimation', 'header', 'htmlAttributes', 'icon', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'position', 'translucent'], toastController);
export const IonToast = /*@__PURE__*/ defineOverlayContainer<JSX.IonToast>('ion-toast', defineIonToastCustomElement, ['animated', 'buttons', 'color', 'cssClass', 'duration', 'enterAnimation', 'header', 'htmlAttributes', 'icon', 'isOpen', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'position', 'translucent', 'trigger']);
export const IonModal = /*@__PURE__*/ defineOverlayContainer<JSX.IonModal>('ion-modal', defineIonModalCustomElement, ['animated', 'backdropBreakpoint', 'backdropDismiss', 'breakpoints', 'canDismiss', 'enterAnimation', 'handle', 'handleBehavior', 'htmlAttributes', 'initialBreakpoint', 'isOpen', 'keepContentsMounted', 'keyboardClose', 'leaveAnimation', 'mode', 'presentingElement', 'showBackdrop', 'trigger']);

View File

@ -86,11 +86,11 @@ describe('Overlays', () => {
cy.get('ion-radio#controller').click();
cy.get('ion-button#present-overlay').click();
cy.get('ion-toast').should('exist');
cy.get('ion-toast.ion-toast-controller').should('exist');
cy.get('ion-toast').shadow().find('button').click();
cy.get('ion-toast.ion-toast-controller').shadow().find('button').click();
cy.get('ion-toast').should('not.exist');
cy.get('ion-toast.ion-toast-controller').should('not.exist');
});
it(`should open and close ion-alert via component`, () => {
@ -122,7 +122,7 @@ describe('Overlays', () => {
cy.get('ion-toast').shadow().find('button').click();
cy.get('ion-toast').should('not.exist');
cy.get('ion-toast').should('not.be.visible');
});
it('should pass props to modal via controller', () => {