mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
chore(): update deps (#19437)
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
import { JSX, actionSheetController } from '@ionic/core';
|
||||
import { ActionSheetOptions, actionSheetController } from '@ionic/core';
|
||||
|
||||
import { createOverlayComponent } from './createOverlayComponent';
|
||||
|
||||
export type ActionSheetOptions = JSX.IonActionSheet;
|
||||
|
||||
export const IonActionSheet = /*@__PURE__*/createOverlayComponent<ActionSheetOptions, HTMLIonActionSheetElement>('IonActionSheet', actionSheetController);
|
||||
|
||||
@ -22,7 +22,7 @@ describe('createComponent - events', () => {
|
||||
|
||||
test('should add custom events', () => {
|
||||
const FakeIonFocus = jest.fn((e) => e);
|
||||
const IonInput = createReactComponent<JSX.IonInput, HTMLIonInputElement>('ion-input');
|
||||
const IonInput = createReactComponent<JSX.IonInput>('ion-input');
|
||||
|
||||
const { getByText } = render(
|
||||
<IonInput onIonFocus={FakeIonFocus}>
|
||||
|
||||
@ -8,16 +8,12 @@ import { RouterDirection } from './hrefprops';
|
||||
import { attachEventProps, createForwardRef, dashToPascalCase, isCoveredByReact } from './utils';
|
||||
import { deprecationWarning } from './utils/dev';
|
||||
|
||||
interface IonicReactInternalProps<ElementType> {
|
||||
interface IonicReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
|
||||
forwardedRef?: React.Ref<ElementType>;
|
||||
children?: React.ReactNode;
|
||||
href?: string;
|
||||
routerLink?: string;
|
||||
target?: string;
|
||||
style?: string;
|
||||
ref?: React.Ref<any>;
|
||||
routerDirection?: RouterDirection;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const createReactComponent = <PropType, ElementType>(
|
||||
@ -25,10 +21,10 @@ export const createReactComponent = <PropType, ElementType>(
|
||||
hrefComponent = false
|
||||
) => {
|
||||
const displayName = dashToPascalCase(tagName);
|
||||
const ReactComponent = class extends React.Component<IonicReactInternalProps<ElementType>> {
|
||||
const ReactComponent = class extends React.Component<IonicReactInternalProps<PropType>> {
|
||||
context!: React.ContextType<typeof NavContext>;
|
||||
|
||||
constructor(props: IonicReactInternalProps<ElementType>) {
|
||||
constructor(props: IonicReactInternalProps<PropType>) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@ -41,7 +37,7 @@ export const createReactComponent = <PropType, ElementType>(
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: IonicReactInternalProps<ElementType>) {
|
||||
componentDidUpdate(prevProps: IonicReactInternalProps<PropType>) {
|
||||
const node = ReactDom.findDOMNode(this) as HTMLElement;
|
||||
attachEventProps(node, this.props, prevProps);
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ type Props = LocalJSX.IonBackButton & ReactProps & {
|
||||
export const IonBackButton = /*@__PURE__*/(() => class extends React.Component<Props> {
|
||||
context!: React.ContextType<typeof NavContext>;
|
||||
|
||||
clickButton = (e: MouseEvent) => {
|
||||
clickButton = (e: React.MouseEvent) => {
|
||||
const defaultHref = this.props.defaultHref;
|
||||
if (this.context.hasIonicRouter()) {
|
||||
e.stopPropagation();
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
import { Platforms, getPlatforms as getPlatformsCore, isPlatform as isPlatformCore } from '@ionic/core';
|
||||
import React from 'react';
|
||||
|
||||
export type IonicReactExternalProps<PropType, ElementType> = PropType & {
|
||||
ref?: React.RefObject<ElementType>;
|
||||
children?: React.ReactNode;
|
||||
};
|
||||
export type IonicReactExternalProps<PropType, ElementType> = PropType & React.HTMLAttributes<ElementType>;
|
||||
|
||||
export const createForwardRef = <PropType, ElementType>(ReactComponent: any, displayName: string) => {
|
||||
const forwardRef = (props: IonicReactExternalProps<PropType, ElementType>, ref: React.Ref<ElementType>) => {
|
||||
|
||||
Reference in New Issue
Block a user