mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 17:42:15 +08:00
fix(react): overlays now define internal ionic components (#25967)
resolves #25962
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
import { AlertOptions, alertController } from '@ionic/core/components';
|
||||
import { IonAlert as IonAlertCmp } from '@ionic/core/components/ion-alert.js';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-alert.js';
|
||||
|
||||
import { createControllerComponent } from './createControllerComponent';
|
||||
|
||||
export const IonAlert = /*@__PURE__*/ createControllerComponent<AlertOptions, HTMLIonAlertElement>(
|
||||
'ion-alert',
|
||||
alertController,
|
||||
IonAlertCmp
|
||||
defineCustomElement
|
||||
);
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { LoadingOptions, loadingController } from '@ionic/core/components';
|
||||
import { IonLoading as IonLoadingCmp } from '@ionic/core/components/ion-loading.js';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-loading.js';
|
||||
|
||||
import { createControllerComponent } from './createControllerComponent';
|
||||
|
||||
export const IonLoading = /*@__PURE__*/ createControllerComponent<
|
||||
LoadingOptions,
|
||||
HTMLIonLoadingElement
|
||||
>('ion-loading', loadingController, IonLoadingCmp);
|
||||
>('ion-loading', loadingController, defineCustomElement);
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { PickerOptions, pickerController } from '@ionic/core/components';
|
||||
import { IonPicker as IonPickerCmp } from '@ionic/core/components/ion-picker.js';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-picker.js';
|
||||
|
||||
import { createControllerComponent } from './createControllerComponent';
|
||||
|
||||
export const IonPicker = /*@__PURE__*/ createControllerComponent<
|
||||
PickerOptions,
|
||||
HTMLIonPickerElement
|
||||
>('ion-picker', pickerController, IonPickerCmp);
|
||||
>('ion-picker', pickerController, defineCustomElement);
|
||||
|
@ -3,7 +3,7 @@ import {
|
||||
ToastOptions as ToastOptionsCore,
|
||||
toastController as toastControllerCore,
|
||||
} from '@ionic/core/components';
|
||||
import { IonToast as IonToastCmp } from '@ionic/core/components/ion-toast.js';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-toast.js';
|
||||
|
||||
import { createControllerComponent } from './createControllerComponent';
|
||||
|
||||
@ -30,5 +30,5 @@ const toastController = {
|
||||
export const IonToast = /*@__PURE__*/ createControllerComponent<ToastOptions, HTMLIonToastElement>(
|
||||
'ion-toast',
|
||||
toastController,
|
||||
IonToastCmp
|
||||
defineCustomElement
|
||||
);
|
||||
|
@ -4,7 +4,6 @@ import React from 'react';
|
||||
import {
|
||||
attachProps,
|
||||
dashToPascalCase,
|
||||
defineCustomElement,
|
||||
setRef,
|
||||
} from './react-component-lib/utils';
|
||||
|
||||
@ -27,9 +26,11 @@ export const createControllerComponent = <
|
||||
>(
|
||||
tagName: string,
|
||||
controller: { create: (options: OptionsType) => Promise<OverlayType> },
|
||||
customElement?: any
|
||||
defineCustomElement?: () => void
|
||||
) => {
|
||||
defineCustomElement(tagName, customElement);
|
||||
if (defineCustomElement) {
|
||||
defineCustomElement();
|
||||
}
|
||||
|
||||
const displayName = dashToPascalCase(tagName);
|
||||
const didDismissEventName = `on${displayName}DidDismiss`;
|
||||
|
Reference in New Issue
Block a user