@arco-design/mobile-react 2.36.2 → 2.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/hooks.d.ts +1 -1
- package/cjs/_helpers/hooks.js +1 -1
- package/cjs/_helpers/react-dom.d.ts +5 -5
- package/cjs/_helpers/react-dom.js +49 -32
- package/cjs/_helpers/render.js +6 -3
- package/cjs/action-sheet/index.d.ts +3 -2
- package/cjs/action-sheet/index.js +2 -2
- package/cjs/checkbox/checkbox.d.ts +1 -1
- package/cjs/checkbox/group.d.ts +1 -1
- package/cjs/checkbox/hooks/useMergeProps.d.ts +1 -1
- package/cjs/checkbox/index.d.ts +2 -2
- package/cjs/context-provider/index.d.ts +8 -2
- package/cjs/count-down/hooks.js +2 -2
- package/cjs/dialog/index.d.ts +8 -3
- package/cjs/dialog/methods.d.ts +6 -2
- package/cjs/dropdown-menu/helper.d.ts +2 -2
- package/cjs/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/cjs/ellipsis/components/native-ellipsis.js +1 -2
- package/cjs/form/type.d.ts +5 -5
- package/cjs/image-preview/index.d.ts +2 -2
- package/cjs/index-bar/group.js +3 -1
- package/cjs/index-bar/index.d.ts +2 -2
- package/cjs/index-bar/utils.d.ts +1 -1
- package/cjs/masking/index.d.ts +2 -2
- package/cjs/notify/index.d.ts +8 -8
- package/cjs/notify/index.js +2 -2
- package/cjs/picker-view/components/cascader.js +3 -1
- package/cjs/picker-view/components/picker-cell.js +1 -1
- package/cjs/picker-view/index.js +3 -1
- package/cjs/popup/index.d.ts +2 -2
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/cjs/pull-refresh/hooks.d.ts +2 -2
- package/cjs/radio/group.d.ts +1 -1
- package/cjs/radio/index.d.ts +2 -2
- package/cjs/radio/radio.d.ts +1 -1
- package/cjs/skeleton/elements.js +9 -3
- package/cjs/slider/hooks/index.d.ts +1 -1
- package/cjs/slider/hooks/useSliderEvents.d.ts +1 -1
- package/cjs/stepper/hooks/useValue.d.ts +2 -1
- package/cjs/steps/index.d.ts +1 -1
- package/cjs/tabs/type.d.ts +2 -2
- package/cjs/toast/index.d.ts +12 -12
- package/cjs/toast/index.js +1 -1
- package/dist/index.js +103 -75
- package/dist/index.min.js +4 -4
- package/esm/_helpers/hooks.d.ts +1 -1
- package/esm/_helpers/hooks.js +1 -1
- package/esm/_helpers/react-dom.d.ts +5 -5
- package/esm/_helpers/react-dom.js +49 -30
- package/esm/_helpers/render.js +6 -3
- package/esm/action-sheet/index.d.ts +3 -2
- package/esm/action-sheet/index.js +2 -2
- package/esm/checkbox/checkbox.d.ts +1 -1
- package/esm/checkbox/group.d.ts +1 -1
- package/esm/checkbox/hooks/useMergeProps.d.ts +1 -1
- package/esm/checkbox/index.d.ts +2 -2
- package/esm/context-provider/index.d.ts +8 -2
- package/esm/count-down/hooks.js +2 -2
- package/esm/dialog/index.d.ts +8 -3
- package/esm/dialog/methods.d.ts +6 -2
- package/esm/dropdown-menu/helper.d.ts +2 -2
- package/esm/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/esm/ellipsis/components/native-ellipsis.js +1 -1
- package/esm/form/type.d.ts +5 -5
- package/esm/image-preview/index.d.ts +2 -2
- package/esm/index-bar/group.js +3 -1
- package/esm/index-bar/index.d.ts +2 -2
- package/esm/index-bar/utils.d.ts +1 -1
- package/esm/masking/index.d.ts +2 -2
- package/esm/notify/index.d.ts +8 -8
- package/esm/notify/index.js +2 -2
- package/esm/picker-view/components/cascader.js +3 -1
- package/esm/picker-view/components/picker-cell.js +1 -1
- package/esm/picker-view/index.js +3 -1
- package/esm/popup/index.d.ts +2 -2
- package/esm/popup-swiper/index.d.ts +2 -2
- package/esm/pull-refresh/hooks.d.ts +2 -2
- package/esm/radio/group.d.ts +1 -1
- package/esm/radio/index.d.ts +2 -2
- package/esm/radio/radio.d.ts +1 -1
- package/esm/skeleton/elements.js +9 -3
- package/esm/slider/hooks/index.d.ts +1 -1
- package/esm/slider/hooks/useSliderEvents.d.ts +1 -1
- package/esm/stepper/hooks/useValue.d.ts +2 -1
- package/esm/steps/index.d.ts +1 -1
- package/esm/tabs/type.d.ts +2 -2
- package/esm/toast/index.d.ts +12 -12
- package/esm/toast/index.js +1 -1
- package/esnext/_helpers/hooks.js +1 -1
- package/esnext/_helpers/react-dom.d.ts +5 -5
- package/esnext/_helpers/react-dom.js +47 -28
- package/esnext/_helpers/render.js +3 -2
- package/esnext/action-sheet/index.d.ts +3 -2
- package/esnext/action-sheet/index.js +1 -1
- package/esnext/context-provider/index.d.ts +8 -2
- package/esnext/context-provider/index.js +1 -1
- package/esnext/count-down/hooks.js +2 -2
- package/esnext/dialog/index.d.ts +8 -3
- package/esnext/dialog/methods.d.ts +6 -2
- package/esnext/dropdown-menu/helper.d.ts +1 -1
- package/esnext/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/esnext/ellipsis/components/native-ellipsis.js +1 -1
- package/esnext/form/type.d.ts +5 -5
- package/esnext/image-preview/index.d.ts +2 -2
- package/esnext/index-bar/group.js +5 -1
- package/esnext/index-bar/index.d.ts +2 -2
- package/esnext/masking/index.d.ts +2 -2
- package/esnext/notify/index.d.ts +8 -8
- package/esnext/notify/index.js +2 -2
- package/esnext/picker-view/components/cascader.js +5 -1
- package/esnext/picker-view/components/picker-cell.js +1 -1
- package/esnext/picker-view/index.js +5 -1
- package/esnext/popup/index.d.ts +2 -2
- package/esnext/popup-swiper/index.d.ts +2 -2
- package/esnext/pull-refresh/hooks.d.ts +2 -2
- package/esnext/skeleton/elements.js +15 -3
- package/esnext/slider/hooks/useSliderEvents.d.ts +1 -1
- package/esnext/tabs/type.d.ts +2 -2
- package/esnext/toast/index.d.ts +12 -12
- package/esnext/toast/index.js +1 -1
- package/package.json +3 -3
- package/umd/_helpers/hooks.d.ts +1 -1
- package/umd/_helpers/hooks.js +1 -1
- package/umd/_helpers/react-dom.d.ts +5 -5
- package/umd/_helpers/react-dom.js +53 -35
- package/umd/_helpers/render.js +6 -3
- package/umd/action-sheet/index.d.ts +3 -2
- package/umd/action-sheet/index.js +2 -2
- package/umd/checkbox/checkbox.d.ts +1 -1
- package/umd/checkbox/group.d.ts +1 -1
- package/umd/checkbox/hooks/useMergeProps.d.ts +1 -1
- package/umd/checkbox/index.d.ts +2 -2
- package/umd/context-provider/index.d.ts +8 -2
- package/umd/count-down/hooks.js +2 -2
- package/umd/dialog/index.d.ts +8 -3
- package/umd/dialog/methods.d.ts +6 -2
- package/umd/dropdown-menu/helper.d.ts +2 -2
- package/umd/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/umd/ellipsis/components/native-ellipsis.js +1 -2
- package/umd/form/type.d.ts +5 -5
- package/umd/image-preview/index.d.ts +2 -2
- package/umd/index-bar/group.js +3 -1
- package/umd/index-bar/index.d.ts +2 -2
- package/umd/index-bar/utils.d.ts +1 -1
- package/umd/masking/index.d.ts +2 -2
- package/umd/notify/index.d.ts +8 -8
- package/umd/notify/index.js +2 -2
- package/umd/picker-view/components/cascader.js +3 -1
- package/umd/picker-view/components/picker-cell.js +1 -1
- package/umd/picker-view/index.js +3 -1
- package/umd/popup/index.d.ts +2 -2
- package/umd/popup-swiper/index.d.ts +2 -2
- package/umd/pull-refresh/hooks.d.ts +2 -2
- package/umd/radio/group.d.ts +1 -1
- package/umd/radio/index.d.ts +2 -2
- package/umd/radio/radio.d.ts +1 -1
- package/umd/skeleton/elements.js +9 -3
- package/umd/slider/hooks/index.d.ts +1 -1
- package/umd/slider/hooks/useSliderEvents.d.ts +1 -1
- package/umd/stepper/hooks/useValue.d.ts +2 -1
- package/umd/steps/index.d.ts +1 -1
- package/umd/tabs/type.d.ts +2 -2
- package/umd/toast/index.d.ts +12 -12
- package/umd/toast/index.js +1 -1
package/esm/popup/index.d.ts
CHANGED
@@ -66,11 +66,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupProps & React.RefAt
|
|
66
66
|
* @param {PopupProps} config Configuration
|
67
67
|
* @returns {{ close: () => void; update: (newConfig: PopupProps) => void; }}
|
68
68
|
*/
|
69
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "
|
69
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "ref" | "className" | "children" | "direction" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
|
70
70
|
key?: string | undefined;
|
71
71
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
72
72
|
close: () => void;
|
73
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "
|
73
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "ref" | "className" | "children" | "direction" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
|
74
74
|
key?: string | undefined;
|
75
75
|
}) => void;
|
76
76
|
};
|
@@ -73,11 +73,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React
|
|
73
73
|
* @param {string | PopupSwiperProps} config Configuration
|
74
74
|
* @returns {{ close: () => void; update: (newConfig: PopupSwiperProps) => void; }}
|
75
75
|
*/
|
76
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "
|
76
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "ref" | "className" | "children" | "direction" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
|
77
77
|
key?: string | undefined;
|
78
78
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
79
79
|
close: () => void;
|
80
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "
|
80
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "ref" | "className" | "children" | "direction" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
|
81
81
|
key?: string | undefined;
|
82
82
|
}) => void;
|
83
83
|
};
|
@@ -17,14 +17,14 @@ export declare const useCommonState: ({ onRefresh, loosingMinHeight, }: {
|
|
17
17
|
tipsHeight: number;
|
18
18
|
};
|
19
19
|
export declare const useAddScrollEvents: ({ domRef, handleTouchStart, handleTouchMove, handleTouchEnd, }: {
|
20
|
-
domRef: RefObject<HTMLDivElement>;
|
20
|
+
domRef: RefObject<HTMLDivElement | null>;
|
21
21
|
handleTouchStart: (evt: HTMLElementEventMap['touchstart']) => void;
|
22
22
|
handleTouchMove: (evt: HTMLElementEventMap['touchmove']) => void;
|
23
23
|
handleTouchEnd: (evt: HTMLElementEventMap['touchend']) => void;
|
24
24
|
}) => void;
|
25
25
|
export declare const useCheckAsStart: ({ allowPullWhenNotTop, domRef, }: {
|
26
26
|
allowPullWhenNotTop: boolean;
|
27
|
-
domRef: RefObject<HTMLDivElement>;
|
27
|
+
domRef: RefObject<HTMLDivElement | null>;
|
28
28
|
}) => {
|
29
29
|
ifShouldHandle: () => boolean | null;
|
30
30
|
};
|
package/esm/radio/group.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { RadioGroupProps, RadioGroupRef, RadioProps, RadioRef, ValueType } from './type';
|
3
3
|
import { GroupContextParams } from '../checkbox';
|
4
|
-
export declare const RadioGroupContext: React.Context<GroupContextParams<
|
4
|
+
export declare const RadioGroupContext: React.Context<GroupContextParams<React.ReactText>>;
|
5
5
|
export declare function componentGenerator<T extends ValueType = ValueType, P extends RadioProps<T> = RadioProps<T>, R extends RadioRef = RadioRef>(Comp: React.ForwardRefExoticComponent<P & React.RefAttributes<R>>): React.ForwardRefExoticComponent<RadioGroupProps<T, P> & React.RefAttributes<RadioGroupRef>>;
|
package/esm/radio/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
export * from './type';
|
3
|
-
declare const _default: import("react").ForwardRefExoticComponent<import("./type").RadioProps<
|
4
|
-
Group: import("react").ForwardRefExoticComponent<import("./type").RadioGroupProps<
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<import("./type").RadioProps<import("react").ReactText> & import("react").RefAttributes<import("./type").RadioRef>> & {
|
4
|
+
Group: import("react").ForwardRefExoticComponent<import("./type").RadioGroupProps<import("react").ReactText, import("./type").RadioProps<import("react").ReactText> & import("react").RefAttributes<import("./type").RadioRef>> & import("react").RefAttributes<import("./type").RadioGroupRef>> & {
|
5
5
|
displayName?: string | undefined;
|
6
6
|
};
|
7
7
|
} & {
|
package/esm/radio/radio.d.ts
CHANGED
@@ -2,4 +2,4 @@ import React from 'react';
|
|
2
2
|
import { CheckboxProps, CheckboxRef } from '../checkbox';
|
3
3
|
import { RadioProps, RadioRef, ValueType } from './type';
|
4
4
|
export declare function componentGenerator<T extends ValueType = ValueType, P extends CheckboxProps<T> = CheckboxProps<T>, R extends CheckboxRef = CheckboxRef>(Comp: React.ForwardRefExoticComponent<P & React.RefAttributes<R>>): React.ForwardRefExoticComponent<RadioProps<T> & React.RefAttributes<RadioRef>>;
|
5
|
-
export declare const Radio: React.ForwardRefExoticComponent<RadioProps<
|
5
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioProps<React.ReactText> & React.RefAttributes<RadioRef>>;
|
package/esm/skeleton/elements.js
CHANGED
@@ -170,7 +170,9 @@ export var SkeletonParagraph = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
170
170
|
backgroundColor: backgroundColor
|
171
171
|
},
|
172
172
|
ref: function ref(el) {
|
173
|
-
|
173
|
+
if (el) {
|
174
|
+
lineDomRefs.current[idx] = el;
|
175
|
+
}
|
174
176
|
}
|
175
177
|
}, isGradientAnimation && offsets !== undefined && /*#__PURE__*/React.createElement("div", {
|
176
178
|
className: prefixCls + "-skeleton-animation-item",
|
@@ -256,7 +258,9 @@ export var SkeletonGrid = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
256
258
|
backgroundColor: backgroundColor
|
257
259
|
},
|
258
260
|
ref: function ref(el) {
|
259
|
-
|
261
|
+
if (el) {
|
262
|
+
iconDomRefs.current[idx] = el;
|
263
|
+
}
|
260
264
|
}
|
261
265
|
}, isGradientAnimation && iconOffsets !== undefined && /*#__PURE__*/React.createElement("div", {
|
262
266
|
className: prefixCls + "-skeleton-animation-item",
|
@@ -269,7 +273,9 @@ export var SkeletonGrid = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
269
273
|
backgroundColor: backgroundColor
|
270
274
|
},
|
271
275
|
ref: function ref(el) {
|
272
|
-
|
276
|
+
if (el) {
|
277
|
+
textDomRefs.current[idx] = el;
|
278
|
+
}
|
273
279
|
}
|
274
280
|
}, isGradientAnimation && textOffsets !== undefined && /*#__PURE__*/React.createElement("div", {
|
275
281
|
className: prefixCls + "-skeleton-animation-item",
|
@@ -5,7 +5,7 @@ export declare type LinePosition = {
|
|
5
5
|
length: number;
|
6
6
|
start: number;
|
7
7
|
};
|
8
|
-
export declare const SliderContext: React.Context<Required<Pick<SliderProps, "
|
8
|
+
export declare const SliderContext: React.Context<Required<Pick<SliderProps, "className" | "style" | "disabled" | "step" | "size" | "type" | "onChange" | "onAfterChange" | "max" | "min" | "suffixLabel" | "prefixLabel" | "useRange" | "useAnimation" | "showTooltip" | "showMarks" | "useMarkOnly" | "draggableTrackOnly" | "formatTooltip" | "renderThumb">> & Pick<SliderProps, "value" | "defaultValue" | "marks" | "renderThumbPopover">>;
|
9
9
|
export * from './useSliderIcon';
|
10
10
|
export * from './useSliderInit';
|
11
11
|
export * from './useSliderStyle';
|
@@ -7,7 +7,7 @@ declare enum IsTouchingStatus {
|
|
7
7
|
}
|
8
8
|
export declare const useSliderEvents: ({ getLinePosition, lineRef, valueGroup, setValueGroup, setCommonIsTouching, }: {
|
9
9
|
getLinePosition: () => LinePosition;
|
10
|
-
lineRef: RefObject<HTMLDivElement>;
|
10
|
+
lineRef: RefObject<HTMLDivElement | null>;
|
11
11
|
valueGroup: number | number[];
|
12
12
|
setValueGroup: React.Dispatch<React.SetStateAction<number | [number, number]>>;
|
13
13
|
setCommonIsTouching: React.Dispatch<React.SetStateAction<number>>;
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { StepperProps } from '..';
|
2
3
|
export default function useValue(params: Required<Pick<StepperProps, 'defaultValue' | 'min' | 'max' | 'digits'>> & Pick<StepperProps, 'formatter' | 'value'>): {
|
3
4
|
updateValue: (updater: number | ((oldValue: number) => number)) => void;
|
4
5
|
actualInputValue: number;
|
5
|
-
showValue:
|
6
|
+
showValue: import("react").ReactText;
|
6
7
|
innerValue: number;
|
7
8
|
};
|
package/esm/steps/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { StepsProps, StepsRef } from './type';
|
3
3
|
export * from './type';
|
4
|
-
export declare const StepsContext: React.Context<Pick<StepsProps, "
|
4
|
+
export declare const StepsContext: React.Context<Pick<StepsProps, "status" | "direction" | "align" | "iconType" | "current" | "reverseOrder"> & {
|
5
5
|
index?: number | undefined;
|
6
6
|
changeIndex: (newIndex: number) => void;
|
7
7
|
}>;
|
package/esm/tabs/type.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CSSProperties, ReactNode
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
2
2
|
export declare type TabData = string | {
|
3
3
|
title: ReactNode;
|
4
4
|
[x: string]: any;
|
@@ -573,7 +573,7 @@ export interface TabCellRef {
|
|
573
573
|
}
|
574
574
|
export interface TabPaneProps extends Pick<TabsProps, 'duration' | 'transitionDuration' | 'lazyloadCount' | 'hideContentStyle' | 'renderHideContent' | 'mode' | 'tabPaneClass' | 'tabPaneStyle' | 'tabPaneExtra' | 'getScrollContainer' | 'scrollThrottle' | 'scrollOffset' | 'goLastWhenScrollBottom' | 'scrollVertical' | 'translateZ' | 'fullScreen' | 'autoHeight' | 'onScroll' | 'swipeEnergySaving'> {
|
575
575
|
prefixCls?: string;
|
576
|
-
panes:
|
576
|
+
panes: ReactNode[];
|
577
577
|
activeIndex: number;
|
578
578
|
activeIndexRef: React.MutableRefObject<number>;
|
579
579
|
tabDirection: 'horizontal' | 'vertical';
|
package/esm/toast/index.d.ts
CHANGED
@@ -185,8 +185,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
185
185
|
* @param {string | ToastProps} config Configuration
|
186
186
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
187
187
|
*/
|
188
|
-
toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
189
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
188
|
+
toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
189
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
190
190
|
close: () => void;
|
191
191
|
hide: () => void;
|
192
192
|
};
|
@@ -196,8 +196,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
196
196
|
* @param {string | ToastProps} config Configuration
|
197
197
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
198
198
|
*/
|
199
|
-
info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
200
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
199
|
+
info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
200
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
201
201
|
close: () => void;
|
202
202
|
hide: () => void;
|
203
203
|
};
|
@@ -207,8 +207,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
207
207
|
* @param {string | ToastProps} config Configuration
|
208
208
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
209
209
|
*/
|
210
|
-
success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
211
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
210
|
+
success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
211
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
212
212
|
close: () => void;
|
213
213
|
hide: () => void;
|
214
214
|
};
|
@@ -218,8 +218,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
218
218
|
* @param {string | ToastProps} config Configuration
|
219
219
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
220
220
|
*/
|
221
|
-
error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
222
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
221
|
+
error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
222
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
223
223
|
close: () => void;
|
224
224
|
hide: () => void;
|
225
225
|
};
|
@@ -229,8 +229,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
229
229
|
* @param {string | ToastProps} config Configuration
|
230
230
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
231
231
|
*/
|
232
|
-
loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
233
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
232
|
+
loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
233
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
234
234
|
close: () => void;
|
235
235
|
hide: () => void;
|
236
236
|
};
|
@@ -240,8 +240,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
240
240
|
* @param {string | ToastProps} config Configuration
|
241
241
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
242
242
|
*/
|
243
|
-
warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
244
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "
|
243
|
+
warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
244
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "ref" | "className" | "duration" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose" | "initialBodyOverflow" | "loading" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
|
245
245
|
close: () => void;
|
246
246
|
hide: () => void;
|
247
247
|
};
|
package/esm/toast/index.js
CHANGED
@@ -37,7 +37,7 @@ var Toast = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
37
37
|
direction = _props$direction === void 0 ? 'center' : _props$direction,
|
38
38
|
typeIconMap = props.typeIconMap,
|
39
39
|
initialBodyOverflow = props.initialBodyOverflow;
|
40
|
-
var closeTimerRef = useRef();
|
40
|
+
var closeTimerRef = useRef(undefined);
|
41
41
|
var domRef = useRef(null);
|
42
42
|
var wrapDomRef = useRef(null);
|
43
43
|
var isInitialMount = useRef(false);
|
package/esnext/_helpers/hooks.js
CHANGED
@@ -626,7 +626,7 @@ export function useProgress(mountedTransition, percentage, duration, mountedBezi
|
|
626
626
|
*/
|
627
627
|
export function useSingleAndDoubleClick(onClick, onDoubleClick, delay = 200) {
|
628
628
|
const [clickTimes, setClickTimes] = useState(0);
|
629
|
-
const eventRef = useRef();
|
629
|
+
const eventRef = useRef(undefined);
|
630
630
|
useEffect(() => {
|
631
631
|
const timer = setTimeout(() => {
|
632
632
|
if (clickTimes === 1)
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { ReactElement } from 'react';
|
2
2
|
export interface RootType {
|
3
|
-
render: (
|
3
|
+
render: (element: ReactElement) => void;
|
4
4
|
_unmount: () => void;
|
5
5
|
}
|
6
6
|
export interface RootTypeReact extends RootType {
|
7
7
|
unmount?: () => void;
|
8
8
|
}
|
9
|
-
export declare type CreateRootFnType = (container: Element | DocumentFragment) =>
|
10
|
-
|
11
|
-
|
12
|
-
_unmount: () => void;
|
9
|
+
export declare type CreateRootFnType = (container: Element | DocumentFragment) => {
|
10
|
+
render: (element: ReactElement) => void;
|
11
|
+
unmount?: () => void;
|
13
12
|
};
|
13
|
+
export declare const render: (app: ReactElement, container: Element | DocumentFragment, createRootFunction?: CreateRootFnType | undefined) => RootType;
|
@@ -2,50 +2,69 @@ import * as ReactDOM from 'react-dom';
|
|
2
2
|
function isObject(obj) {
|
3
3
|
return Object.prototype.toString.call(obj) === '[object Object]';
|
4
4
|
}
|
5
|
-
|
6
|
-
|
7
|
-
};
|
5
|
+
// Cast ReactDOM to a version that might have createRoot and other properties
|
6
|
+
const typedReactDOM = ReactDOM;
|
8
7
|
let copyRender;
|
9
|
-
const { version, render: reactRender, unmountComponentAtNode } = CopyReactDOM;
|
10
|
-
const isReact18 = Number((version || '').split('.')[0]) > 17;
|
11
8
|
const updateUsingClientEntryPoint = (skipWarning) => {
|
12
9
|
// https://github.com/facebook/react/blob/17806594cc28284fe195f918e8d77de3516848ec/packages/react-dom/npm/client.js#L10
|
13
10
|
// Avoid console warning
|
14
|
-
const
|
15
|
-
if (isObject(
|
16
|
-
|
11
|
+
const secretInternals = typedReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
12
|
+
if (isObject(secretInternals)) {
|
13
|
+
secretInternals.usingClientEntryPoint = skipWarning;
|
17
14
|
}
|
18
15
|
};
|
19
|
-
|
20
|
-
|
21
|
-
(
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
root._unmount = function () {
|
16
|
+
const createRootFn = typedReactDOM.createRoot;
|
17
|
+
const getRender = (createRootFunction) => (app, container) => {
|
18
|
+
updateUsingClientEntryPoint(true);
|
19
|
+
const root = createRootFunction(container);
|
20
|
+
updateUsingClientEntryPoint(false);
|
21
|
+
root.render(app);
|
22
|
+
return {
|
23
|
+
render: (elementToRender) => {
|
24
|
+
root.render(elementToRender);
|
25
|
+
},
|
26
|
+
_unmount() {
|
31
27
|
setTimeout(() => {
|
32
|
-
root
|
28
|
+
if (root && typeof root.unmount === 'function') {
|
29
|
+
root.unmount();
|
30
|
+
}
|
33
31
|
});
|
34
|
-
}
|
35
|
-
return root;
|
32
|
+
},
|
36
33
|
};
|
34
|
+
};
|
35
|
+
if (createRootFn) {
|
36
|
+
// React 18
|
37
|
+
copyRender = getRender(createRootFn);
|
37
38
|
}
|
38
|
-
else
|
39
|
+
else if (typeof typedReactDOM.render === 'function' &&
|
40
|
+
typeof typedReactDOM.unmountComponentAtNode === 'function') {
|
41
|
+
// React 16/17
|
39
42
|
copyRender = function (app, container) {
|
40
|
-
|
43
|
+
typedReactDOM.render(app, container); // Use non-null assertion
|
41
44
|
return {
|
42
|
-
render: (
|
43
|
-
|
45
|
+
render: (elementToRender) => {
|
46
|
+
typedReactDOM.render(elementToRender, container); // Use non-null assertion
|
44
47
|
},
|
45
48
|
_unmount() {
|
46
|
-
unmountComponentAtNode(container);
|
49
|
+
typedReactDOM.unmountComponentAtNode(container); // Use non-null assertion
|
47
50
|
},
|
48
51
|
};
|
49
52
|
};
|
50
53
|
}
|
54
|
+
else {
|
55
|
+
copyRender = (app, container, createRootFunction) => {
|
56
|
+
const defaultCb = () => {
|
57
|
+
// Fallback if no rendering method is found
|
58
|
+
console.error('ArcoDesign: ReactDOM.createRoot() or ReactDOM.render() not found. ' +
|
59
|
+
'This usually means you are using an unsupported version of React, ' +
|
60
|
+
'or ReactDOM is not properly initialized. ' +
|
61
|
+
'ArcoDesign Mobile React requires React 16, 17, 18, or 19.');
|
62
|
+
return { render: (_element) => { }, _unmount: () => { } };
|
63
|
+
};
|
64
|
+
if (createRootFunction) {
|
65
|
+
return getRender(createRootFunction)(app, container);
|
66
|
+
}
|
67
|
+
return defaultCb();
|
68
|
+
};
|
69
|
+
}
|
51
70
|
export const render = copyRender;
|
@@ -6,12 +6,13 @@ export class ReactDOMRender {
|
|
6
6
|
root) {
|
7
7
|
this.render = props => {
|
8
8
|
const CustomApp = this.app;
|
9
|
-
const propsWithContext = {
|
9
|
+
const propsWithContext = { context: this.context, ...props };
|
10
10
|
if (this.root) {
|
11
11
|
this.root.render(React.createElement(CustomApp, Object.assign({}, propsWithContext)));
|
12
12
|
}
|
13
13
|
else {
|
14
|
-
|
14
|
+
const { createRoot } = this.context || {};
|
15
|
+
this.root = copyRender(React.createElement(CustomApp, Object.assign({}, propsWithContext)), this.container, createRoot);
|
15
16
|
}
|
16
17
|
};
|
17
18
|
this.setRootCache = () => {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { ReactNode, CSSProperties } from 'react';
|
2
|
+
import { Promise } from 'es6-promise';
|
2
3
|
import { PopupProps } from '../popup';
|
3
4
|
import { OpenBaseProps } from '../masking';
|
4
5
|
export interface ActionSheetItemOptions {
|
@@ -86,11 +87,11 @@ declare const _default: React.ForwardRefExoticComponent<ActionSheetProps & React
|
|
86
87
|
* @param {ActionSheetProps} config setting
|
87
88
|
* @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => void; }}
|
88
89
|
*/
|
89
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "
|
90
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "className" | "context" | "translateZ" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
|
90
91
|
key?: string | undefined;
|
91
92
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
92
93
|
close: () => void;
|
93
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "
|
94
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "className" | "context" | "translateZ" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
|
94
95
|
key?: string | undefined;
|
95
96
|
}) => void;
|
96
97
|
};
|
@@ -24,7 +24,7 @@ const ActionSheet = forwardRef((props, ref) => {
|
|
24
24
|
title || subTitle ? (React.createElement("div", { className: `${prefixCls}-action-sheet-header` },
|
25
25
|
title ? (React.createElement("div", { className: `${prefixCls}-action-sheet-title` }, title)) : null,
|
26
26
|
subTitle ? (React.createElement("div", { className: `${prefixCls}-action-sheet-sub-title` }, subTitle)) : null)) : null,
|
27
|
-
React.createElement("div", { className: `${prefixCls}-action-sheet-list` }, (items || []).map((item, index) => (React.createElement("div", { className: cls(`${prefixCls}-action-sheet-item`, item.className, item.status || 'normal'), key: index, style: item.style, onClick: e => handleItemClick(e, item) }, item.content)))),
|
27
|
+
React.createElement("div", { className: `${prefixCls}-action-sheet-list` }, (items || []).map((item, index) => item.content ? (React.createElement("div", { className: cls(`${prefixCls}-action-sheet-item`, item.className, item.status || 'normal'), key: index, style: item.style, onClick: e => handleItemClick(e, item) }, item.content)) : null)),
|
28
28
|
cancelText ? (React.createElement("div", { className: `${prefixCls}-action-sheet-item cancel-item`, onClick: e => {
|
29
29
|
e.stopPropagation();
|
30
30
|
close?.(e);
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { Attributes } from 'react';
|
2
2
|
import { ILocale } from '@arco-design/mobile-utils';
|
3
|
+
import { CreateRootFnType } from '../_helpers';
|
3
4
|
export interface GlobalContextParams {
|
4
5
|
/**
|
5
6
|
* 组件类名前缀
|
@@ -52,6 +53,11 @@ export interface GlobalContextParams {
|
|
52
53
|
* @en Triggered when the system's native dark mode changes, valid when useDarkMode=true
|
53
54
|
*/
|
54
55
|
onDarkModeChange?: (isDark: boolean) => void;
|
56
|
+
/**
|
57
|
+
* React19 修改了 createRoot 的引入路径,导致组件内部无法直接引入(低react版本会找不到模块)。因此使用 react 19 的用户需从外部传入 createRoot 方法
|
58
|
+
* @en Users using react 19 need to pass in the createRoot method from outside
|
59
|
+
*/
|
60
|
+
createRoot?: CreateRootFnType;
|
55
61
|
}
|
56
62
|
export declare const defaultContext: GlobalContextParams;
|
57
63
|
export declare const GlobalContext: React.Context<GlobalContextParams>;
|
@@ -71,4 +77,4 @@ export declare type WithGlobalContext<T> = T & {
|
|
71
77
|
*/
|
72
78
|
export default function ContextProvider(props: ContextProviderProps): JSX.Element;
|
73
79
|
export declare const ContextLayout: React.Consumer<GlobalContextParams>;
|
74
|
-
export declare function CompWithGlobalContext<P extends
|
80
|
+
export declare function CompWithGlobalContext<P extends Attributes>(Component: React.FunctionComponent<P>): (props: WithGlobalContext<P>) => JSX.Element;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { createContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
1
|
+
import React, { createContext, useState, useEffect, useCallback, useMemo, useRef, } from 'react';
|
2
2
|
import { addCssRules, removeCssStyleDom, defaultLocale } from '@arco-design/mobile-utils';
|
3
3
|
const DEFAULT_DARK_MODE_SELECTOR = 'arco-theme-dark';
|
4
4
|
export const defaultContext = {
|
@@ -4,8 +4,8 @@ import { startTask, stopTask } from './singleton';
|
|
4
4
|
import { parseTime } from './util';
|
5
5
|
export const useCountDown = (options) => {
|
6
6
|
const taskIdRef = useRef(0);
|
7
|
-
const endTimeRef = useRef();
|
8
|
-
const countingRef = useRef();
|
7
|
+
const endTimeRef = useRef(undefined);
|
8
|
+
const countingRef = useRef(undefined);
|
9
9
|
const [remain, remainRef, setRemain] = useRefState(options.time);
|
10
10
|
const [current, setCurrent] = useState(parseTime(options.time));
|
11
11
|
const taskType = options.millisecond ? 'micro' : 'macro';
|
package/esnext/dialog/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
2
|
import { ILocale } from '@arco-design/mobile-utils';
|
3
|
+
import { Promise } from 'es6-promise';
|
3
4
|
import { MaskingCommonProps, MaskingRef, OpenBaseProps } from '../masking';
|
4
5
|
export * from './methods';
|
5
6
|
export interface FooterButtonOptions {
|
@@ -130,7 +131,11 @@ export interface ConfirmOptions extends AlertOptions {
|
|
130
131
|
* */
|
131
132
|
cancelText?: ReactNode;
|
132
133
|
}
|
133
|
-
export declare function methodsGenerator<P extends OpenBaseProps, A
|
134
|
+
export declare function methodsGenerator<P extends OpenBaseProps, A extends {
|
135
|
+
key?: string;
|
136
|
+
} = AlertOptions, C extends {
|
137
|
+
key?: string;
|
138
|
+
} = ConfirmOptions>(Comp: React.FunctionComponent<P>): {
|
134
139
|
/**
|
135
140
|
* 打开确认框(含一个确认按钮)
|
136
141
|
* @desc {en} Open a confirmation dialog (with a confirmation button)
|
@@ -193,11 +198,11 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
|
|
193
198
|
* @param {DialogProps} config Configuration
|
194
199
|
* @returns {{ close: () => void; update: (newConfig: DialogProps) => void; }}
|
195
200
|
*/
|
196
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "
|
201
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "className" | "context" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
|
197
202
|
key?: string | undefined;
|
198
203
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
199
204
|
close: () => void;
|
200
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "
|
205
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "className" | "context" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
|
201
206
|
key?: string | undefined;
|
202
207
|
}) => void;
|
203
208
|
};
|
@@ -2,11 +2,15 @@ import React from 'react';
|
|
2
2
|
import { OpenBaseProps } from '../masking/methods';
|
3
3
|
export declare function normalizeAlert<AlertOptions, P>(config: AlertOptions): P;
|
4
4
|
export declare function normalizeConfirm<ConfirmOptions, P>(config: ConfirmOptions): P;
|
5
|
-
export declare function alert<AlertOptions
|
5
|
+
export declare function alert<AlertOptions extends {
|
6
|
+
key?: string;
|
7
|
+
}, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: AlertOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
6
8
|
close: () => void;
|
7
9
|
update: (newConfig: AlertOptions) => void;
|
8
10
|
};
|
9
|
-
export declare function confirm<ConfirmOptions
|
11
|
+
export declare function confirm<ConfirmOptions extends {
|
12
|
+
key?: string;
|
13
|
+
}, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: ConfirmOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
10
14
|
close: () => void;
|
11
15
|
update: (newConfig: ConfirmOptions) => void;
|
12
16
|
};
|
@@ -26,7 +26,7 @@ export declare const getFormattedOptions: (options: OptionsItem[][] | string[] |
|
|
26
26
|
* 判断是否为指定ref内的元素
|
27
27
|
* @en Determine whether it is an element within the specified ref
|
28
28
|
*/
|
29
|
-
export declare const isRefDom: (dom: any, ref: React.RefObject<HTMLDivElement>) => boolean;
|
29
|
+
export declare const isRefDom: (dom: any, ref: React.RefObject<HTMLDivElement | null>) => boolean;
|
30
30
|
/**
|
31
31
|
* 判断是否为指定类名下的元素
|
32
32
|
* @en Determine whether it is an element under the specified classname
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
2
|
import { NativeEllipsisProps } from '../type';
|
3
3
|
declare function NativeEllipsis({ prefixCls, ellipsis, dangerouslyUseInnerHTML, text, maxLine, ellipsisNode, collapseNode, onEllipsisNodeClick, onCollapseNodeClick, }: NativeEllipsisProps): JSX.Element;
|
4
|
-
|
5
|
-
export default _default;
|
4
|
+
export default NativeEllipsis;
|