@arco-design/mobile-react 2.23.0 → 2.24.1
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 +27 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/render.d.ts +3 -1
- package/cjs/_helpers/render.js +10 -3
- package/cjs/action-sheet/index.d.ts +5 -5
- package/cjs/action-sheet/index.js +4 -3
- package/cjs/action-sheet/methods.d.ts +1 -1
- package/cjs/badge/style/css/index.css +1 -2
- package/cjs/checkbox/checkbox.js +4 -0
- package/cjs/circle-progress/index.js +4 -0
- package/cjs/context-provider/index.d.ts +4 -0
- package/cjs/context-provider/index.js +14 -2
- package/cjs/dialog/index.d.ts +8 -8
- package/cjs/dialog/index.js +3 -2
- package/cjs/dialog/methods.d.ts +3 -3
- package/cjs/dialog/style/css/index.css +1 -2
- package/cjs/ellipsis/components/js-ellipsis.d.ts +4 -2
- package/cjs/ellipsis/components/js-ellipsis.js +14 -1
- package/cjs/ellipsis/components/native-ellipsis.d.ts +1 -1
- package/cjs/ellipsis/components/native-ellipsis.js +6 -1
- package/cjs/ellipsis/demo/style/css/mobile.css +1 -1
- package/cjs/ellipsis/demo/style/mobile.less +3 -1
- package/cjs/ellipsis/index.js +6 -2
- package/cjs/ellipsis/style/css/index.css +14 -1
- package/cjs/ellipsis/style/index.less +15 -1
- package/cjs/ellipsis/type.d.ts +22 -76
- package/cjs/image-preview/index.d.ts +3 -3
- package/cjs/image-preview/index.js +3 -2
- package/cjs/image-preview/methods.d.ts +2 -1
- package/cjs/image-preview/methods.js +2 -2
- package/cjs/input/hooks.js +1 -0
- package/cjs/input/index.d.ts +5 -0
- package/cjs/input/index.js +6 -2
- package/cjs/masking/index.d.ts +4 -14
- package/cjs/masking/index.js +3 -2
- package/cjs/masking/methods.d.ts +3 -2
- package/cjs/masking/methods.js +2 -2
- package/cjs/nav-bar/index.d.ts +12 -0
- package/cjs/nav-bar/index.js +8 -2
- package/cjs/notify/index.d.ts +12 -12
- package/cjs/notify/index.js +3 -2
- package/cjs/notify/methods.d.ts +2 -1
- package/cjs/notify/methods.js +2 -2
- package/cjs/picker-view/components/picker-cell.js +3 -1
- package/cjs/popup/index.d.ts +4 -4
- package/cjs/popup/index.js +3 -2
- package/cjs/popup/methods.d.ts +1 -1
- package/cjs/popup-swiper/index.d.ts +12 -6
- package/cjs/popup-swiper/index.js +3 -2
- package/cjs/popup-swiper/methods.d.ts +1 -1
- package/cjs/progress/index.js +4 -0
- package/cjs/rate/index.js +5 -0
- package/cjs/slider/index.js +6 -1
- package/cjs/stepper/index.js +7 -1
- package/cjs/swipe-action/index.d.ts +1 -0
- package/cjs/swipe-action/index.js +10 -0
- package/cjs/switch/index.js +4 -0
- package/cjs/toast/index.d.ts +18 -18
- package/cjs/toast/index.js +3 -2
- package/cjs/toast/methods.d.ts +2 -1
- package/cjs/toast/methods.js +2 -2
- package/dist/index.js +141 -47
- package/dist/index.min.js +3 -3
- package/dist/style.css +26 -114
- package/dist/style.min.css +1 -1
- package/esm/_helpers/render.d.ts +3 -1
- package/esm/_helpers/render.js +10 -3
- package/esm/action-sheet/index.d.ts +5 -5
- package/esm/action-sheet/index.js +4 -3
- package/esm/action-sheet/methods.d.ts +1 -1
- package/esm/badge/style/css/index.css +1 -2
- package/esm/checkbox/checkbox.js +4 -0
- package/esm/circle-progress/index.js +4 -0
- package/esm/context-provider/index.d.ts +4 -0
- package/esm/context-provider/index.js +13 -2
- package/esm/dialog/index.d.ts +8 -8
- package/esm/dialog/index.js +3 -2
- package/esm/dialog/methods.d.ts +3 -3
- package/esm/dialog/style/css/index.css +1 -2
- package/esm/ellipsis/components/js-ellipsis.d.ts +4 -2
- package/esm/ellipsis/components/js-ellipsis.js +14 -1
- package/esm/ellipsis/components/native-ellipsis.d.ts +1 -1
- package/esm/ellipsis/components/native-ellipsis.js +6 -1
- package/esm/ellipsis/demo/style/css/mobile.css +1 -1
- package/esm/ellipsis/demo/style/mobile.less +3 -1
- package/esm/ellipsis/index.js +6 -2
- package/esm/ellipsis/style/css/index.css +14 -1
- package/esm/ellipsis/style/index.less +15 -1
- package/esm/ellipsis/type.d.ts +22 -76
- package/esm/image-preview/index.d.ts +3 -3
- package/esm/image-preview/index.js +3 -2
- package/esm/image-preview/methods.d.ts +2 -1
- package/esm/image-preview/methods.js +2 -2
- package/esm/input/hooks.js +1 -0
- package/esm/input/index.d.ts +5 -0
- package/esm/input/index.js +6 -2
- package/esm/masking/index.d.ts +4 -14
- package/esm/masking/index.js +3 -2
- package/esm/masking/methods.d.ts +3 -2
- package/esm/masking/methods.js +2 -2
- package/esm/nav-bar/index.d.ts +12 -0
- package/esm/nav-bar/index.js +8 -2
- package/esm/notify/index.d.ts +12 -12
- package/esm/notify/index.js +3 -2
- package/esm/notify/methods.d.ts +2 -1
- package/esm/notify/methods.js +2 -2
- package/esm/picker-view/components/picker-cell.js +3 -1
- package/esm/popup/index.d.ts +4 -4
- package/esm/popup/index.js +3 -2
- package/esm/popup/methods.d.ts +1 -1
- package/esm/popup-swiper/index.d.ts +12 -6
- package/esm/popup-swiper/index.js +3 -2
- package/esm/popup-swiper/methods.d.ts +1 -1
- package/esm/progress/index.js +4 -0
- package/esm/rate/index.js +5 -0
- package/esm/slider/index.js +6 -1
- package/esm/stepper/index.js +7 -1
- package/esm/swipe-action/index.d.ts +1 -0
- package/esm/swipe-action/index.js +1 -0
- package/esm/switch/index.js +4 -0
- package/esm/toast/index.d.ts +18 -18
- package/esm/toast/index.js +3 -2
- package/esm/toast/methods.d.ts +2 -1
- package/esm/toast/methods.js +2 -2
- package/package.json +3 -3
- package/style/css/public.css +4 -4
- package/tokens/app/arcodesign/default/css-variables.less +2 -0
- package/tokens/app/arcodesign/default/index.d.ts +2 -0
- package/tokens/app/arcodesign/default/index.js +127 -125
- package/tokens/app/arcodesign/default/index.json +24 -0
- package/tokens/app/arcodesign/default/index.less +2 -0
- package/umd/_helpers/render.d.ts +3 -1
- package/umd/_helpers/render.js +13 -7
- package/umd/action-sheet/index.d.ts +5 -5
- package/umd/action-sheet/index.js +4 -3
- package/umd/action-sheet/methods.d.ts +1 -1
- package/umd/badge/style/css/index.css +1 -2
- package/umd/checkbox/checkbox.js +4 -0
- package/umd/circle-progress/index.js +4 -0
- package/umd/context-provider/index.d.ts +4 -0
- package/umd/context-provider/index.js +13 -1
- package/umd/dialog/index.d.ts +8 -8
- package/umd/dialog/index.js +3 -2
- package/umd/dialog/methods.d.ts +3 -3
- package/umd/dialog/style/css/index.css +1 -2
- package/umd/ellipsis/components/js-ellipsis.d.ts +4 -2
- package/umd/ellipsis/components/js-ellipsis.js +14 -1
- package/umd/ellipsis/components/native-ellipsis.d.ts +1 -1
- package/umd/ellipsis/components/native-ellipsis.js +6 -1
- package/umd/ellipsis/demo/style/css/mobile.css +1 -1
- package/umd/ellipsis/demo/style/mobile.less +3 -1
- package/umd/ellipsis/index.js +6 -2
- package/umd/ellipsis/style/css/index.css +14 -1
- package/umd/ellipsis/style/index.less +15 -1
- package/umd/ellipsis/type.d.ts +22 -76
- package/umd/image-preview/index.d.ts +3 -3
- package/umd/image-preview/index.js +3 -2
- package/umd/image-preview/methods.d.ts +2 -1
- package/umd/image-preview/methods.js +2 -2
- package/umd/input/hooks.js +1 -0
- package/umd/input/index.d.ts +5 -0
- package/umd/input/index.js +6 -2
- package/umd/masking/index.d.ts +4 -14
- package/umd/masking/index.js +3 -2
- package/umd/masking/methods.d.ts +3 -2
- package/umd/masking/methods.js +2 -2
- package/umd/nav-bar/index.d.ts +12 -0
- package/umd/nav-bar/index.js +8 -2
- package/umd/notify/index.d.ts +12 -12
- package/umd/notify/index.js +3 -2
- package/umd/notify/methods.d.ts +2 -1
- package/umd/notify/methods.js +2 -2
- package/umd/picker-view/components/picker-cell.js +3 -1
- package/umd/popup/index.d.ts +4 -4
- package/umd/popup/index.js +3 -2
- package/umd/popup/methods.d.ts +1 -1
- package/umd/popup-swiper/index.d.ts +12 -6
- package/umd/popup-swiper/index.js +3 -2
- package/umd/popup-swiper/methods.d.ts +1 -1
- package/umd/progress/index.js +4 -0
- package/umd/rate/index.js +5 -0
- package/umd/slider/index.js +6 -1
- package/umd/stepper/index.js +7 -1
- package/umd/swipe-action/index.d.ts +1 -0
- package/umd/swipe-action/index.js +11 -4
- package/umd/switch/index.js +4 -0
- package/umd/toast/index.d.ts +18 -18
- package/umd/toast/index.js +3 -2
- package/umd/toast/methods.d.ts +2 -1
- package/umd/toast/methods.js +2 -2
package/umd/ellipsis/type.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ReactNode
|
2
|
-
interface
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
export interface EllipsisBaseProps {
|
3
3
|
/**
|
4
4
|
* 需要缩略的文本内容
|
5
5
|
* @en Text content to be omitted
|
@@ -23,68 +23,17 @@ interface BaseProps {
|
|
23
23
|
* @default false
|
24
24
|
*/
|
25
25
|
dangerouslyUseInnerHTML?: boolean;
|
26
|
-
}
|
27
|
-
export interface NativeEllipsisProps extends BaseProps {
|
28
|
-
/**
|
29
|
-
* className 前缀
|
30
|
-
* @en Prefix classname
|
31
|
-
*/
|
32
|
-
prefixCls: string;
|
33
|
-
/**
|
34
|
-
* 自定义收起节点,不为空时文本展开插入文本尾部
|
35
|
-
* @en Customize the collapsed node, when the text is not empty, the text expand Text expand content inserts the end of the text
|
36
|
-
*/
|
37
|
-
collapseNode?: ReactNode;
|
38
|
-
/**
|
39
|
-
* 收起节点点击事件
|
40
|
-
* @en Collapse node click event
|
41
|
-
*/
|
42
|
-
onCollapseNodeClick?: () => void;
|
43
|
-
}
|
44
|
-
export interface JsEllipsisRef {
|
45
|
-
dom: HTMLDivElement | null;
|
46
|
-
reflow: () => void;
|
47
|
-
}
|
48
|
-
export interface JsEllipsisProps extends BaseProps {
|
49
|
-
ref: Ref<HTMLDivElement | null>;
|
50
|
-
/**
|
51
|
-
* className 前缀
|
52
|
-
* @en Prefix classname
|
53
|
-
*/
|
54
|
-
prefixCls: string;
|
55
|
-
/**
|
56
|
-
* 最大显示高度,单位 px,优先级高于 maxLine
|
57
|
-
* @en Maximum display height, unit px, priority higher than maxLine
|
58
|
-
*/
|
59
|
-
maxHeight?: number;
|
60
26
|
/**
|
61
27
|
* 自定义缩略符节点,文本缩略时插入文本尾部
|
62
|
-
* @en Customize the ellipsis node, insert the end of the text when the text is omitted
|
28
|
+
* @en Customize the ellipsis node, insert at the end of the text when the text is omitted
|
63
29
|
* @default "..."
|
64
30
|
*/
|
65
31
|
ellipsisNode?: ReactNode;
|
66
32
|
/**
|
67
33
|
* 自定义收起符节点,不为空且文本展开时插入文本尾部
|
68
|
-
* @en Customize the collapse node,
|
34
|
+
* @en Customize the collapse node, when the value is not empty and the text is expanded, the node is inserted at the end of the text
|
69
35
|
*/
|
70
36
|
collapseNode?: ReactNode;
|
71
|
-
/**
|
72
|
-
* 文本结尾处(缩略符之前)需要过滤掉的字符
|
73
|
-
* @en Characters that need to be filtered out at the end of the text (before abbreviations)
|
74
|
-
* @default []
|
75
|
-
*/
|
76
|
-
endExcludes?: string[];
|
77
|
-
/**
|
78
|
-
* 容器大小变化时是否自适应,使用原生缩略时默认为 true
|
79
|
-
* @en Whether to adapt when the container size changes, the default is true when using native ellipsis
|
80
|
-
* @default false
|
81
|
-
*/
|
82
|
-
reflowOnResize?: boolean;
|
83
|
-
/**
|
84
|
-
* 文本缩略处理的完成回调
|
85
|
-
* @en Callback when text omission processing is complete
|
86
|
-
*/
|
87
|
-
onReflow?: (ellipsis: boolean, text: string) => void;
|
88
37
|
/**
|
89
38
|
* 缩略节点点击事件
|
90
39
|
* @en Ellipsis node click event
|
@@ -108,7 +57,7 @@ export interface EllipsisRef {
|
|
108
57
|
*/
|
109
58
|
reflow: (() => void) | undefined;
|
110
59
|
}
|
111
|
-
export interface EllipsisProps extends
|
60
|
+
export interface EllipsisProps extends EllipsisBaseProps {
|
112
61
|
/**
|
113
62
|
* 自定义类名
|
114
63
|
* @en Custom classname
|
@@ -119,17 +68,6 @@ export interface EllipsisProps extends BaseProps {
|
|
119
68
|
* @en Maximum display height(unit: px), priority higher than maxLine
|
120
69
|
*/
|
121
70
|
maxHeight?: number;
|
122
|
-
/**
|
123
|
-
* 自定义缩略符节点,文本缩略时插入文本尾部
|
124
|
-
* @en Customize the ellipsis node, insert at the end of the text when the text is omitted
|
125
|
-
* @default "..."
|
126
|
-
*/
|
127
|
-
ellipsisNode?: ReactNode;
|
128
|
-
/**
|
129
|
-
* 自定义收起符节点,不为空且文本展开时插入文本尾部
|
130
|
-
* @en Customize the collapse node, when the value is not empty and the text is expanded, the node is inserted at the end of the text
|
131
|
-
*/
|
132
|
-
collapseNode?: ReactNode;
|
133
71
|
/**
|
134
72
|
* 文本结尾处(缩略符之前)需要过滤掉的字符
|
135
73
|
* @en Characters to filter out at the end of the text (before the ellipsis)
|
@@ -142,20 +80,28 @@ export interface EllipsisProps extends BaseProps {
|
|
142
80
|
* @default false
|
143
81
|
*/
|
144
82
|
reflowOnResize?: boolean;
|
83
|
+
/**
|
84
|
+
* 文本缩略时,缩略符节点是否浮在文本右下角(默认加渐变色背景)
|
85
|
+
* @en Whether the abbreviation node is floating in the lower right corner of the text (with a gradient background by default)
|
86
|
+
* @default false
|
87
|
+
*/
|
88
|
+
floatEllipsisNode?: boolean;
|
145
89
|
/**
|
146
90
|
* 文本缩略处理的完成回调
|
147
91
|
* @en Callback when text omission processing is complete
|
148
92
|
*/
|
149
93
|
onReflow?: (ellipsis: boolean, text: string) => void;
|
94
|
+
}
|
95
|
+
export declare type EllipsisCommonProps = EllipsisBaseProps & {
|
150
96
|
/**
|
151
|
-
*
|
152
|
-
* @en
|
153
|
-
*/
|
154
|
-
onEllipsisNodeClick?: () => void;
|
155
|
-
/**
|
156
|
-
* 收起节点点击事件
|
157
|
-
* @en Collapse node click event
|
97
|
+
* className 前缀
|
98
|
+
* @en Prefix classname
|
158
99
|
*/
|
159
|
-
|
100
|
+
prefixCls: string;
|
101
|
+
};
|
102
|
+
export declare type NativeEllipsisProps = EllipsisCommonProps;
|
103
|
+
export interface JsEllipsisRef {
|
104
|
+
dom: HTMLDivElement | null;
|
105
|
+
reflow: () => void;
|
160
106
|
}
|
161
|
-
export
|
107
|
+
export declare type JsEllipsisProps = EllipsisCommonProps & Pick<EllipsisProps, 'maxHeight' | 'endExcludes' | 'reflowOnResize' | 'onReflow'>;
|
@@ -252,7 +252,7 @@ export declare function methodsGenerator<P extends ImagePreviewProps>(Comp: Reac
|
|
252
252
|
* @param {ImagePreviewProps} config configuration
|
253
253
|
* @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
|
254
254
|
*/
|
255
|
-
open: (config: Pick<P, Exclude<keyof P, "close"
|
255
|
+
open: (config: Pick<P, Exclude<keyof P, "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
256
256
|
close: () => void;
|
257
257
|
update: (newConfig: Pick<P, Exclude<keyof P, "close">>) => void;
|
258
258
|
};
|
@@ -264,9 +264,9 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
|
|
264
264
|
* @param {ImagePreviewProps} config configuration
|
265
265
|
* @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
|
266
266
|
*/
|
267
|
-
open: (config: Pick<ImagePreviewProps & React.RefAttributes<ImagePreviewRef
|
267
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "getContainer" | "className" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
268
268
|
close: () => void;
|
269
|
-
update: (newConfig: Pick<ImagePreviewProps & React.RefAttributes<ImagePreviewRef
|
269
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "getContainer" | "className" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
|
270
270
|
};
|
271
271
|
};
|
272
272
|
/**
|
@@ -1009,6 +1009,8 @@
|
|
1009
1009
|
open: (0, _methods.open)(Comp)
|
1010
1010
|
};
|
1011
1011
|
}
|
1012
|
+
|
1013
|
+
var ImagePreviewWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(ImagePreview);
|
1012
1014
|
/**
|
1013
1015
|
* 图片预览组件,支持循环轮播、双指/双击缩放、缩略图放大效果。
|
1014
1016
|
* @en The image preview, supports circular rotation, two-finger/double-tap zoom, and thumbnail zoom effects.
|
@@ -1018,8 +1020,7 @@
|
|
1018
1020
|
* @name_en ImagePreview
|
1019
1021
|
*/
|
1020
1022
|
|
1021
|
-
|
1022
|
-
var _default = (0, _mobileUtils.componentWrapper)(ImagePreview, methodsGenerator(ImagePreview));
|
1023
|
+
var _default = (0, _mobileUtils.componentWrapper)(ImagePreview, methodsGenerator(ImagePreviewWithGlobalContext));
|
1023
1024
|
|
1024
1025
|
_exports.default = _default;
|
1025
1026
|
});
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { GlobalContextParams } from '../context-provider';
|
2
3
|
export interface OpenBaseProps {
|
3
4
|
onClose?: () => void;
|
4
5
|
close: (e: any) => void;
|
5
6
|
openIndex: number;
|
6
7
|
images: any[];
|
7
8
|
}
|
8
|
-
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "close"
|
9
|
+
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "close">>, context?: GlobalContextParams | undefined) => {
|
9
10
|
close: () => void;
|
10
11
|
update: (newConfig: Pick<P, Exclude<keyof P, "close">>) => void;
|
11
12
|
};
|
@@ -20,7 +20,7 @@
|
|
20
20
|
_extends2 = _interopRequireDefault(_extends2);
|
21
21
|
|
22
22
|
function open(Component) {
|
23
|
-
return function (config) {
|
23
|
+
return function (config, context) {
|
24
24
|
var baseProps = (0, _extends2.default)({
|
25
25
|
unmountOnExit: true
|
26
26
|
}, config || {}, {
|
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
var leaving = false;
|
38
38
|
|
39
|
-
var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
|
39
|
+
var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
|
40
40
|
render = _ReactDOMRender.render;
|
41
41
|
|
42
42
|
function update(newConfig) {
|
package/umd/input/hooks.js
CHANGED
package/umd/input/index.d.ts
CHANGED
@@ -27,6 +27,11 @@ export interface InputProps extends BasicInputProps {
|
|
27
27
|
* @en Other unlisted native properties have lower priority than listed component properties
|
28
28
|
*/
|
29
29
|
nativeProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
30
|
+
/**
|
31
|
+
* 无障碍label
|
32
|
+
* @en accessible label
|
33
|
+
*/
|
34
|
+
ariaLabel?: string;
|
30
35
|
}
|
31
36
|
export interface InputRef {
|
32
37
|
/**
|
package/umd/input/index.js
CHANGED
@@ -47,7 +47,9 @@
|
|
47
47
|
inputClass = props.inputClass,
|
48
48
|
inputStyle = props.inputStyle,
|
49
49
|
_props$nativeProps = props.nativeProps,
|
50
|
-
nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps
|
50
|
+
nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps,
|
51
|
+
_props$ariaLabel = props.ariaLabel,
|
52
|
+
ariaLabel = _props$ariaLabel === void 0 ? '' : _props$ariaLabel;
|
51
53
|
var inputRef = (0, _react.useRef)(null);
|
52
54
|
|
53
55
|
var _useInputLogic = (0, _hooks.useInputLogic)(props, inputRef),
|
@@ -91,7 +93,9 @@
|
|
91
93
|
onChange: handleChange,
|
92
94
|
onInput: handleInput,
|
93
95
|
onKeyDown: handleKeyDown,
|
94
|
-
onClick: handleClick
|
96
|
+
onClick: handleClick,
|
97
|
+
"aria-disabled": disabled,
|
98
|
+
"aria-label": ariaLabel
|
95
99
|
})));
|
96
100
|
}
|
97
101
|
|
package/umd/masking/index.d.ts
CHANGED
@@ -191,12 +191,7 @@ export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.Fu
|
|
191
191
|
*/
|
192
192
|
open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
193
193
|
key?: string | undefined;
|
194
|
-
}) => {
|
195
|
-
/**
|
196
|
-
* 点击蒙层是否关闭菜单
|
197
|
-
* @en Whether to click the mask to close the menu
|
198
|
-
* @default true
|
199
|
-
*/
|
194
|
+
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
200
195
|
close: () => void;
|
201
196
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
202
197
|
key?: string | undefined;
|
@@ -210,16 +205,11 @@ declare const _default: React.ForwardRefExoticComponent<MaskingProps & React.Ref
|
|
210
205
|
* @param {MaskingProps} config Configuration
|
211
206
|
* @returns {{ close: () => void; update: (newConfig: MaskingProps) => void; }}
|
212
207
|
*/
|
213
|
-
open: (config: Pick<MaskingProps & React.RefAttributes<MaskingRef
|
208
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
|
214
209
|
key?: string | undefined;
|
215
|
-
}) => {
|
216
|
-
/**
|
217
|
-
* 点击蒙层是否关闭菜单
|
218
|
-
* @en Whether to click the mask to close the menu
|
219
|
-
* @default true
|
220
|
-
*/
|
210
|
+
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
221
211
|
close: () => void;
|
222
|
-
update: (newConfig: Pick<MaskingProps & React.RefAttributes<MaskingRef
|
212
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
|
223
213
|
key?: string | undefined;
|
224
214
|
}) => void;
|
225
215
|
};
|
package/umd/masking/index.js
CHANGED
@@ -220,6 +220,8 @@
|
|
220
220
|
open: (0, _methods.open)(Comp)
|
221
221
|
};
|
222
222
|
}
|
223
|
+
|
224
|
+
var MaskingWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Masking);
|
223
225
|
/**
|
224
226
|
* 通用模态弹窗,内部内容自定义。默认做了防滚动穿透处理,如果弹层内容中需要滚动,则需将滚动容器传入`getScrollContainer`属性以在未滚动到顶部或底部时释放滚动。
|
225
227
|
* @en Generic modal popup with custom internal content. By default, anti-scroll penetration processing is performed. If scrolling is required in the content of the bullet layer, need to pass the scroll container to the `getScrollContainer` to release scrolling when it is not scrolled to the top or bottom.
|
@@ -229,8 +231,7 @@
|
|
229
231
|
* @name_en Masking
|
230
232
|
*/
|
231
233
|
|
232
|
-
|
233
|
-
var _default = (0, _mobileUtils.componentWrapper)(Masking, methodsGenerator(Masking));
|
234
|
+
var _default = (0, _mobileUtils.componentWrapper)(Masking, methodsGenerator(MaskingWithGlobalContext));
|
234
235
|
|
235
236
|
_exports.default = _default;
|
236
237
|
});
|
package/umd/masking/methods.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { GlobalContextParams } from '../context-provider';
|
2
3
|
export interface OpenBaseProps {
|
3
4
|
unmountOnExit?: boolean;
|
4
5
|
getContainer?: () => HTMLElement;
|
@@ -8,13 +9,13 @@ export interface OpenBaseProps {
|
|
8
9
|
}
|
9
10
|
export declare function getOpenMethod<T extends {
|
10
11
|
key?: string;
|
11
|
-
}, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, containerId?: string, normalize?: (config: T) => P): (config: T) => {
|
12
|
+
}, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, containerId?: string, normalize?: (config: T) => P): (config: T, context?: GlobalContextParams | undefined) => {
|
12
13
|
close: () => void;
|
13
14
|
update: (newConfig: T) => void;
|
14
15
|
};
|
15
16
|
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>, containerId?: string): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
16
17
|
key?: string | undefined;
|
17
|
-
}) => {
|
18
|
+
}, context?: GlobalContextParams | undefined) => {
|
18
19
|
close: () => void;
|
19
20
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
20
21
|
key?: string | undefined;
|
package/umd/masking/methods.js
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
};
|
28
28
|
}
|
29
29
|
|
30
|
-
return function (config) {
|
30
|
+
return function (config, context) {
|
31
31
|
var baseProps = (0, _extends2.default)({
|
32
32
|
unmountOnExit: true
|
33
33
|
}, normalize(config), {
|
@@ -43,7 +43,7 @@
|
|
43
43
|
|
44
44
|
var leaving = false;
|
45
45
|
|
46
|
-
var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
|
46
|
+
var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
|
47
47
|
render = _ReactDOMRender.render;
|
48
48
|
|
49
49
|
function update(newConfig) {
|
package/umd/nav-bar/index.d.ts
CHANGED
@@ -105,6 +105,18 @@ export interface NavBarProps {
|
|
105
105
|
* @en Set a custom style according to the scroll offset value. After setting this property, the scroll event of the scroll container will be monitored.
|
106
106
|
*/
|
107
107
|
getComputedStyleByScroll?: (offset: number) => CSSProperties;
|
108
|
+
/**
|
109
|
+
* 无障碍aria-label属性
|
110
|
+
* @en Accessibility attribute aria-label
|
111
|
+
* @default ""
|
112
|
+
*/
|
113
|
+
ariaLabel?: string;
|
114
|
+
/**
|
115
|
+
* 无障碍role属性
|
116
|
+
* @en Accessibility attribute role
|
117
|
+
* @default "banner"
|
118
|
+
*/
|
119
|
+
ariaRole?: string;
|
108
120
|
}
|
109
121
|
/**
|
110
122
|
* 导航栏组件,支持吸顶和沉浸式,支持在指定滚动位置展示,支持根据滚动位置实时更新style。
|
package/umd/nav-bar/index.js
CHANGED
@@ -59,7 +59,11 @@
|
|
59
59
|
getScrollContainer = props.getScrollContainer,
|
60
60
|
_props$showOffset = props.showOffset,
|
61
61
|
showOffset = _props$showOffset === void 0 ? 0 : _props$showOffset,
|
62
|
-
getComputedStyleByScroll = props.getComputedStyleByScroll
|
62
|
+
getComputedStyleByScroll = props.getComputedStyleByScroll,
|
63
|
+
_props$ariaLabel = props.ariaLabel,
|
64
|
+
ariaLabel = _props$ariaLabel === void 0 ? '' : _props$ariaLabel,
|
65
|
+
_props$ariaRole = props.ariaRole,
|
66
|
+
ariaRole = _props$ariaRole === void 0 ? 'banner' : _props$ariaRole;
|
63
67
|
var navBarRef = (0, _react.useRef)(null);
|
64
68
|
|
65
69
|
var _useState = (0, _react.useState)(showOffset > 0),
|
@@ -147,7 +151,9 @@
|
|
147
151
|
paddingTop: fixed && statusBarHeight ? statusBarHeight + "px" : ''
|
148
152
|
}, style || {}, relBackground ? {
|
149
153
|
background: relBackground
|
150
|
-
} : {})
|
154
|
+
} : {}),
|
155
|
+
"aria-label": ariaLabel,
|
156
|
+
role: ariaRole
|
151
157
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
152
158
|
className: (0, _mobileUtils.cls)(className, system, prefixCls + "-nav-bar-wrapper", (_cls2 = {}, _cls2[prefixCls + "-nav-bar-wrapper-fixed"] = fixed, _cls2[prefixCls + "-nav-bar-wrapper-border"] = hasBottomLine, _cls2)),
|
153
159
|
style: (0, _extends2.default)({
|
package/umd/notify/index.d.ts
CHANGED
@@ -9,7 +9,7 @@ export declare function methodsGenerator<P extends NotifyBaseProps>(Comp: React.
|
|
9
9
|
* @param {string | NotifyProps} config
|
10
10
|
* @returns {{ update: (config: NotifyProps) => void; close: () => void }}
|
11
11
|
*/
|
12
|
-
info: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close"
|
12
|
+
info: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
13
13
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
|
14
14
|
close: () => void;
|
15
15
|
};
|
@@ -19,7 +19,7 @@ export declare function methodsGenerator<P extends NotifyBaseProps>(Comp: React.
|
|
19
19
|
* @param {string | NotifyProps} config
|
20
20
|
* @returns {{ update: (config: NotifyProps) => void; close: () => void }}
|
21
21
|
*/
|
22
|
-
success: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close"
|
22
|
+
success: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
23
23
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
|
24
24
|
close: () => void;
|
25
25
|
};
|
@@ -29,7 +29,7 @@ export declare function methodsGenerator<P extends NotifyBaseProps>(Comp: React.
|
|
29
29
|
* @param {string | NotifyProps} config
|
30
30
|
* @returns {{ update: (config: NotifyProps) => void; close: () => void }}
|
31
31
|
*/
|
32
|
-
error: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close"
|
32
|
+
error: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
33
33
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
|
34
34
|
close: () => void;
|
35
35
|
};
|
@@ -39,7 +39,7 @@ export declare function methodsGenerator<P extends NotifyBaseProps>(Comp: React.
|
|
39
39
|
* @param {string | NotifyProps} config
|
40
40
|
* @returns {{ update: (config: NotifyProps) => void; close: () => void }}
|
41
41
|
*/
|
42
|
-
warn: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close"
|
42
|
+
warn: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
43
43
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
|
44
44
|
close: () => void;
|
45
45
|
};
|
@@ -51,8 +51,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
|
|
51
51
|
* @param {string | NotifyProps} config
|
52
52
|
* @returns {{ update: (config: NotifyProps) => void; close: () => void }}
|
53
53
|
*/
|
54
|
-
info: (originConfig: string | Pick<NotifyProps & React.RefAttributes<NotifyRef
|
55
|
-
update: (newConfig: Pick<NotifyProps & React.RefAttributes<NotifyRef
|
54
|
+
info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
55
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">) => void;
|
56
56
|
close: () => void;
|
57
57
|
};
|
58
58
|
/**
|
@@ -61,8 +61,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
|
|
61
61
|
* @param {string | NotifyProps} config
|
62
62
|
* @returns {{ update: (config: NotifyProps) => void; close: () => void }}
|
63
63
|
*/
|
64
|
-
success: (originConfig: string | Pick<NotifyProps & React.RefAttributes<NotifyRef
|
65
|
-
update: (newConfig: Pick<NotifyProps & React.RefAttributes<NotifyRef
|
64
|
+
success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
65
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">) => void;
|
66
66
|
close: () => void;
|
67
67
|
};
|
68
68
|
/**
|
@@ -71,8 +71,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
|
|
71
71
|
* @param {string | NotifyProps} config
|
72
72
|
* @returns {{ update: (config: NotifyProps) => void; close: () => void }}
|
73
73
|
*/
|
74
|
-
error: (originConfig: string | Pick<NotifyProps & React.RefAttributes<NotifyRef
|
75
|
-
update: (newConfig: Pick<NotifyProps & React.RefAttributes<NotifyRef
|
74
|
+
error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
75
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">) => void;
|
76
76
|
close: () => void;
|
77
77
|
};
|
78
78
|
/**
|
@@ -81,8 +81,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
|
|
81
81
|
* @param {string | NotifyProps} config
|
82
82
|
* @returns {{ update: (config: NotifyProps) => void; close: () => void }}
|
83
83
|
*/
|
84
|
-
warn: (originConfig: string | Pick<NotifyProps & React.RefAttributes<NotifyRef
|
85
|
-
update: (newConfig: Pick<NotifyProps & React.RefAttributes<NotifyRef
|
84
|
+
warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
85
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">) => void;
|
86
86
|
close: () => void;
|
87
87
|
};
|
88
88
|
};
|
package/umd/notify/index.js
CHANGED
@@ -175,6 +175,8 @@
|
|
175
175
|
warn: (0, _methods.notify)(Comp, 'warn')
|
176
176
|
};
|
177
177
|
}
|
178
|
+
|
179
|
+
var NotifyWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Notify);
|
178
180
|
/**
|
179
181
|
* 主动操作后显示的反馈信息横条,可采用方法调用或者组件调用的方式
|
180
182
|
* @en The feedback information bar displayed after active operation can be called by method or by component.
|
@@ -184,8 +186,7 @@
|
|
184
186
|
* @name_en Notify
|
185
187
|
*/
|
186
188
|
|
187
|
-
|
188
|
-
var _default = (0, _mobileUtils.componentWrapper)(Notify, methodsGenerator(Notify));
|
189
|
+
var _default = (0, _mobileUtils.componentWrapper)(Notify, methodsGenerator(NotifyWithGlobalContext));
|
189
190
|
|
190
191
|
_exports.default = _default;
|
191
192
|
});
|
package/umd/notify/methods.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { GlobalContextParams } from '../context-provider';
|
2
3
|
export interface NotifyBaseProps {
|
3
4
|
getContainer?: () => HTMLElement;
|
4
5
|
onClose?: (scene?: string) => void;
|
@@ -7,7 +8,7 @@ export interface NotifyBaseProps {
|
|
7
8
|
close?: (e: any) => void;
|
8
9
|
type?: string;
|
9
10
|
}
|
10
|
-
export declare function notify<P extends NotifyBaseProps>(Component: React.FC<P>, type?: string): (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close"
|
11
|
+
export declare function notify<P extends NotifyBaseProps>(Component: React.FC<P>, type?: string): (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: GlobalContextParams | undefined) => {
|
11
12
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
|
12
13
|
close: () => void;
|
13
14
|
};
|
package/umd/notify/methods.js
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
_extends2 = _interopRequireDefault(_extends2);
|
21
21
|
|
22
22
|
function notify(Component, type) {
|
23
|
-
return function (originConfig) {
|
23
|
+
return function (originConfig, context) {
|
24
24
|
var config = typeof originConfig === 'string' ? {
|
25
25
|
content: originConfig,
|
26
26
|
type: 'info'
|
@@ -39,7 +39,7 @@
|
|
39
39
|
document.body.appendChild(div);
|
40
40
|
}
|
41
41
|
|
42
|
-
var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
|
42
|
+
var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
|
43
43
|
render = _ReactDOMRender.render,
|
44
44
|
unmount = _ReactDOMRender.unmount;
|
45
45
|
|
@@ -368,12 +368,14 @@
|
|
368
368
|
ref: wrapRef,
|
369
369
|
onTouchStart: _handleItemTouchStart,
|
370
370
|
onTouchEnd: _handleColumnTouchEnd,
|
371
|
-
onTouchCancel: _handleColumnTouchEnd
|
371
|
+
onTouchCancel: _handleColumnTouchEnd,
|
372
|
+
"aria-disabled": disabled
|
372
373
|
}, data.map(function (item, index) {
|
373
374
|
var _cls;
|
374
375
|
|
375
376
|
var dis = Math.abs(index - currentIndex);
|
376
377
|
return /*#__PURE__*/_react.default.createElement("div", {
|
378
|
+
"aria-label": index === currentIndex ? "" + item.value : '',
|
377
379
|
key: index + "_" + item.value,
|
378
380
|
className: (0, _mobileUtils.cls)(prefixCls + "-column-item", (_cls = {
|
379
381
|
selected: index === currentIndex
|
package/umd/popup/index.d.ts
CHANGED
@@ -52,7 +52,7 @@ export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.Fu
|
|
52
52
|
*/
|
53
53
|
open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
54
54
|
key?: string | undefined;
|
55
|
-
}) => {
|
55
|
+
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
56
56
|
close: () => void;
|
57
57
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
58
58
|
key?: string | undefined;
|
@@ -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<PopupProps & React.RefAttributes<PopupRef
|
69
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ"> & {
|
70
70
|
key?: string | undefined;
|
71
|
-
}) => {
|
71
|
+
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
72
72
|
close: () => void;
|
73
|
-
update: (newConfig: Pick<PopupProps & React.RefAttributes<PopupRef
|
73
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ"> & {
|
74
74
|
key?: string | undefined;
|
75
75
|
}) => void;
|
76
76
|
};
|
package/umd/popup/index.js
CHANGED
@@ -99,6 +99,8 @@
|
|
99
99
|
open: (0, _methods.open)(Comp)
|
100
100
|
};
|
101
101
|
}
|
102
|
+
|
103
|
+
var PopupWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Popup);
|
102
104
|
/**
|
103
105
|
* 基于模态弹窗的的全屏菜单,支持各个方向。默认做了防滚动穿透处理,如果弹层内容中需要滚动,则需将滚动容器传入`getScrollContainer`属性以在未滚动到顶部或底部时释放滚动。
|
104
106
|
* @en A full-screen menu based on a modal popup, supporting all directions. By default, anti-scroll penetration processing is performed. If scrolling is required in the content of the popup layer, you need to pass the scroll container to the `getScrollContainer` property to release scrolling when it is not scrolled to the top or bottom.
|
@@ -108,8 +110,7 @@
|
|
108
110
|
* @name_en Popup
|
109
111
|
*/
|
110
112
|
|
111
|
-
|
112
|
-
var _default = (0, _mobileUtils.componentWrapper)(Popup, methodsGenerator(Popup));
|
113
|
+
var _default = (0, _mobileUtils.componentWrapper)(Popup, methodsGenerator(PopupWithGlobalContext));
|
113
114
|
|
114
115
|
_exports.default = _default;
|
115
116
|
});
|
package/umd/popup/methods.d.ts
CHANGED
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import { OpenBaseProps } from '../masking/methods';
|
3
3
|
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
4
4
|
key?: string | undefined;
|
5
|
-
}) => {
|
5
|
+
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
6
6
|
close: () => void;
|
7
7
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
8
8
|
key?: string | undefined;
|