@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.
Files changed (191) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/render.d.ts +3 -1
  5. package/cjs/_helpers/render.js +10 -3
  6. package/cjs/action-sheet/index.d.ts +5 -5
  7. package/cjs/action-sheet/index.js +4 -3
  8. package/cjs/action-sheet/methods.d.ts +1 -1
  9. package/cjs/badge/style/css/index.css +1 -2
  10. package/cjs/checkbox/checkbox.js +4 -0
  11. package/cjs/circle-progress/index.js +4 -0
  12. package/cjs/context-provider/index.d.ts +4 -0
  13. package/cjs/context-provider/index.js +14 -2
  14. package/cjs/dialog/index.d.ts +8 -8
  15. package/cjs/dialog/index.js +3 -2
  16. package/cjs/dialog/methods.d.ts +3 -3
  17. package/cjs/dialog/style/css/index.css +1 -2
  18. package/cjs/ellipsis/components/js-ellipsis.d.ts +4 -2
  19. package/cjs/ellipsis/components/js-ellipsis.js +14 -1
  20. package/cjs/ellipsis/components/native-ellipsis.d.ts +1 -1
  21. package/cjs/ellipsis/components/native-ellipsis.js +6 -1
  22. package/cjs/ellipsis/demo/style/css/mobile.css +1 -1
  23. package/cjs/ellipsis/demo/style/mobile.less +3 -1
  24. package/cjs/ellipsis/index.js +6 -2
  25. package/cjs/ellipsis/style/css/index.css +14 -1
  26. package/cjs/ellipsis/style/index.less +15 -1
  27. package/cjs/ellipsis/type.d.ts +22 -76
  28. package/cjs/image-preview/index.d.ts +3 -3
  29. package/cjs/image-preview/index.js +3 -2
  30. package/cjs/image-preview/methods.d.ts +2 -1
  31. package/cjs/image-preview/methods.js +2 -2
  32. package/cjs/input/hooks.js +1 -0
  33. package/cjs/input/index.d.ts +5 -0
  34. package/cjs/input/index.js +6 -2
  35. package/cjs/masking/index.d.ts +4 -14
  36. package/cjs/masking/index.js +3 -2
  37. package/cjs/masking/methods.d.ts +3 -2
  38. package/cjs/masking/methods.js +2 -2
  39. package/cjs/nav-bar/index.d.ts +12 -0
  40. package/cjs/nav-bar/index.js +8 -2
  41. package/cjs/notify/index.d.ts +12 -12
  42. package/cjs/notify/index.js +3 -2
  43. package/cjs/notify/methods.d.ts +2 -1
  44. package/cjs/notify/methods.js +2 -2
  45. package/cjs/picker-view/components/picker-cell.js +3 -1
  46. package/cjs/popup/index.d.ts +4 -4
  47. package/cjs/popup/index.js +3 -2
  48. package/cjs/popup/methods.d.ts +1 -1
  49. package/cjs/popup-swiper/index.d.ts +12 -6
  50. package/cjs/popup-swiper/index.js +3 -2
  51. package/cjs/popup-swiper/methods.d.ts +1 -1
  52. package/cjs/progress/index.js +4 -0
  53. package/cjs/rate/index.js +5 -0
  54. package/cjs/slider/index.js +6 -1
  55. package/cjs/stepper/index.js +7 -1
  56. package/cjs/swipe-action/index.d.ts +1 -0
  57. package/cjs/swipe-action/index.js +10 -0
  58. package/cjs/switch/index.js +4 -0
  59. package/cjs/toast/index.d.ts +18 -18
  60. package/cjs/toast/index.js +3 -2
  61. package/cjs/toast/methods.d.ts +2 -1
  62. package/cjs/toast/methods.js +2 -2
  63. package/dist/index.js +141 -47
  64. package/dist/index.min.js +3 -3
  65. package/dist/style.css +26 -114
  66. package/dist/style.min.css +1 -1
  67. package/esm/_helpers/render.d.ts +3 -1
  68. package/esm/_helpers/render.js +10 -3
  69. package/esm/action-sheet/index.d.ts +5 -5
  70. package/esm/action-sheet/index.js +4 -3
  71. package/esm/action-sheet/methods.d.ts +1 -1
  72. package/esm/badge/style/css/index.css +1 -2
  73. package/esm/checkbox/checkbox.js +4 -0
  74. package/esm/circle-progress/index.js +4 -0
  75. package/esm/context-provider/index.d.ts +4 -0
  76. package/esm/context-provider/index.js +13 -2
  77. package/esm/dialog/index.d.ts +8 -8
  78. package/esm/dialog/index.js +3 -2
  79. package/esm/dialog/methods.d.ts +3 -3
  80. package/esm/dialog/style/css/index.css +1 -2
  81. package/esm/ellipsis/components/js-ellipsis.d.ts +4 -2
  82. package/esm/ellipsis/components/js-ellipsis.js +14 -1
  83. package/esm/ellipsis/components/native-ellipsis.d.ts +1 -1
  84. package/esm/ellipsis/components/native-ellipsis.js +6 -1
  85. package/esm/ellipsis/demo/style/css/mobile.css +1 -1
  86. package/esm/ellipsis/demo/style/mobile.less +3 -1
  87. package/esm/ellipsis/index.js +6 -2
  88. package/esm/ellipsis/style/css/index.css +14 -1
  89. package/esm/ellipsis/style/index.less +15 -1
  90. package/esm/ellipsis/type.d.ts +22 -76
  91. package/esm/image-preview/index.d.ts +3 -3
  92. package/esm/image-preview/index.js +3 -2
  93. package/esm/image-preview/methods.d.ts +2 -1
  94. package/esm/image-preview/methods.js +2 -2
  95. package/esm/input/hooks.js +1 -0
  96. package/esm/input/index.d.ts +5 -0
  97. package/esm/input/index.js +6 -2
  98. package/esm/masking/index.d.ts +4 -14
  99. package/esm/masking/index.js +3 -2
  100. package/esm/masking/methods.d.ts +3 -2
  101. package/esm/masking/methods.js +2 -2
  102. package/esm/nav-bar/index.d.ts +12 -0
  103. package/esm/nav-bar/index.js +8 -2
  104. package/esm/notify/index.d.ts +12 -12
  105. package/esm/notify/index.js +3 -2
  106. package/esm/notify/methods.d.ts +2 -1
  107. package/esm/notify/methods.js +2 -2
  108. package/esm/picker-view/components/picker-cell.js +3 -1
  109. package/esm/popup/index.d.ts +4 -4
  110. package/esm/popup/index.js +3 -2
  111. package/esm/popup/methods.d.ts +1 -1
  112. package/esm/popup-swiper/index.d.ts +12 -6
  113. package/esm/popup-swiper/index.js +3 -2
  114. package/esm/popup-swiper/methods.d.ts +1 -1
  115. package/esm/progress/index.js +4 -0
  116. package/esm/rate/index.js +5 -0
  117. package/esm/slider/index.js +6 -1
  118. package/esm/stepper/index.js +7 -1
  119. package/esm/swipe-action/index.d.ts +1 -0
  120. package/esm/swipe-action/index.js +1 -0
  121. package/esm/switch/index.js +4 -0
  122. package/esm/toast/index.d.ts +18 -18
  123. package/esm/toast/index.js +3 -2
  124. package/esm/toast/methods.d.ts +2 -1
  125. package/esm/toast/methods.js +2 -2
  126. package/package.json +3 -3
  127. package/style/css/public.css +4 -4
  128. package/tokens/app/arcodesign/default/css-variables.less +2 -0
  129. package/tokens/app/arcodesign/default/index.d.ts +2 -0
  130. package/tokens/app/arcodesign/default/index.js +127 -125
  131. package/tokens/app/arcodesign/default/index.json +24 -0
  132. package/tokens/app/arcodesign/default/index.less +2 -0
  133. package/umd/_helpers/render.d.ts +3 -1
  134. package/umd/_helpers/render.js +13 -7
  135. package/umd/action-sheet/index.d.ts +5 -5
  136. package/umd/action-sheet/index.js +4 -3
  137. package/umd/action-sheet/methods.d.ts +1 -1
  138. package/umd/badge/style/css/index.css +1 -2
  139. package/umd/checkbox/checkbox.js +4 -0
  140. package/umd/circle-progress/index.js +4 -0
  141. package/umd/context-provider/index.d.ts +4 -0
  142. package/umd/context-provider/index.js +13 -1
  143. package/umd/dialog/index.d.ts +8 -8
  144. package/umd/dialog/index.js +3 -2
  145. package/umd/dialog/methods.d.ts +3 -3
  146. package/umd/dialog/style/css/index.css +1 -2
  147. package/umd/ellipsis/components/js-ellipsis.d.ts +4 -2
  148. package/umd/ellipsis/components/js-ellipsis.js +14 -1
  149. package/umd/ellipsis/components/native-ellipsis.d.ts +1 -1
  150. package/umd/ellipsis/components/native-ellipsis.js +6 -1
  151. package/umd/ellipsis/demo/style/css/mobile.css +1 -1
  152. package/umd/ellipsis/demo/style/mobile.less +3 -1
  153. package/umd/ellipsis/index.js +6 -2
  154. package/umd/ellipsis/style/css/index.css +14 -1
  155. package/umd/ellipsis/style/index.less +15 -1
  156. package/umd/ellipsis/type.d.ts +22 -76
  157. package/umd/image-preview/index.d.ts +3 -3
  158. package/umd/image-preview/index.js +3 -2
  159. package/umd/image-preview/methods.d.ts +2 -1
  160. package/umd/image-preview/methods.js +2 -2
  161. package/umd/input/hooks.js +1 -0
  162. package/umd/input/index.d.ts +5 -0
  163. package/umd/input/index.js +6 -2
  164. package/umd/masking/index.d.ts +4 -14
  165. package/umd/masking/index.js +3 -2
  166. package/umd/masking/methods.d.ts +3 -2
  167. package/umd/masking/methods.js +2 -2
  168. package/umd/nav-bar/index.d.ts +12 -0
  169. package/umd/nav-bar/index.js +8 -2
  170. package/umd/notify/index.d.ts +12 -12
  171. package/umd/notify/index.js +3 -2
  172. package/umd/notify/methods.d.ts +2 -1
  173. package/umd/notify/methods.js +2 -2
  174. package/umd/picker-view/components/picker-cell.js +3 -1
  175. package/umd/popup/index.d.ts +4 -4
  176. package/umd/popup/index.js +3 -2
  177. package/umd/popup/methods.d.ts +1 -1
  178. package/umd/popup-swiper/index.d.ts +12 -6
  179. package/umd/popup-swiper/index.js +3 -2
  180. package/umd/popup-swiper/methods.d.ts +1 -1
  181. package/umd/progress/index.js +4 -0
  182. package/umd/rate/index.js +5 -0
  183. package/umd/slider/index.js +6 -1
  184. package/umd/stepper/index.js +7 -1
  185. package/umd/swipe-action/index.d.ts +1 -0
  186. package/umd/swipe-action/index.js +11 -4
  187. package/umd/switch/index.js +4 -0
  188. package/umd/toast/index.d.ts +18 -18
  189. package/umd/toast/index.js +3 -2
  190. package/umd/toast/methods.d.ts +2 -1
  191. package/umd/toast/methods.js +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.24.1](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.24.0...@arco-design/mobile-react@2.24.1) (2023-01-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * `Ellipsis` support floatEllipsisNode ([#76](https://github.com/arco-design/arco-design-mobile/issues/76)) ([cc8e3d6](https://github.com/arco-design/arco-design-mobile/commit/cc8e3d6df1eec5a528a47c255c49ca94a326ca18))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.24.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.23.0...@arco-design/mobile-react@2.24.0) (2022-12-20)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * support accessibility mode ([#65](https://github.com/arco-design/arco-design-mobile/issues/65)) ([fa7789c](https://github.com/arco-design/arco-design-mobile/commit/fa7789c1866341244cbffcbef1d1be375880bd82))
23
+
24
+
25
+ ### Features
26
+
27
+ * component function support custom context ([#52](https://github.com/arco-design/arco-design-mobile/issues/52)) ([e5bd260](https://github.com/arco-design/arco-design-mobile/commit/e5bd260f6df128f8cd44e26464f1b5e5e6deff11))
28
+
29
+
30
+
31
+
32
+
6
33
  # [2.23.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.22.3...@arco-design/mobile-react@2.23.0) (2022-11-29)
7
34
 
8
35
 
package/README.en-US.md CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="_b
59
59
  React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">Click here</a>**
60
60
 
61
61
  ```
62
- <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.22.3/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.22.3/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.24.0/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.24.0/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## Full import
package/README.md CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="
59
59
  React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">戳这里获取</a>**
60
60
 
61
61
  ```
62
- <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.22.3/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.22.3/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.24.0/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.24.0/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## 引入全部
@@ -1,10 +1,12 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { RootType } from './react-dom';
3
+ import { GlobalContextParams } from '../context-provider';
3
4
  export declare class ReactDOMRender {
4
5
  root: RootType | undefined;
5
6
  app: FunctionComponent;
6
7
  container: Element | DocumentFragment;
7
- constructor(app: FunctionComponent, container: Element | DocumentFragment);
8
+ context: GlobalContextParams | undefined;
9
+ constructor(app: FunctionComponent, container: Element | DocumentFragment, context?: GlobalContextParams);
8
10
  render: (props: any) => void;
9
11
  unmount: () => void;
10
12
  }
@@ -5,24 +5,30 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.ReactDOMRender = void 0;
7
7
 
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
8
10
  var _react = _interopRequireDefault(require("react"));
9
11
 
10
12
  var _reactDom = require("./react-dom");
11
13
 
12
- var ReactDOMRender = function ReactDOMRender(app, container) {
14
+ var ReactDOMRender = function ReactDOMRender(app, container, context) {
13
15
  var _this = this;
14
16
 
15
17
  this.root = void 0;
16
18
  this.app = void 0;
17
19
  this.container = void 0;
20
+ this.context = void 0;
18
21
 
19
22
  this.render = function (props) {
20
23
  var CustomApp = _this.app;
24
+ var propsWithContext = (0, _extends2.default)({}, props, {
25
+ context: _this.context
26
+ });
21
27
 
22
28
  if (_this.root) {
23
- _this.root.render( /*#__PURE__*/_react.default.createElement(CustomApp, props));
29
+ _this.root.render( /*#__PURE__*/_react.default.createElement(CustomApp, propsWithContext));
24
30
  } else {
25
- _this.root = (0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(CustomApp, props), _this.container);
31
+ _this.root = (0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(CustomApp, propsWithContext), _this.container);
26
32
  }
27
33
  };
28
34
 
@@ -35,6 +41,7 @@ var ReactDOMRender = function ReactDOMRender(app, container) {
35
41
 
36
42
  this.app = app;
37
43
  this.container = container;
44
+ this.context = context;
38
45
  };
39
46
 
40
47
  exports.ReactDOMRender = ReactDOMRender;
@@ -72,7 +72,7 @@ export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.Fu
72
72
  */
73
73
  open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
74
74
  key?: string | undefined;
75
- }) => {
75
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
76
76
  close: () => void;
77
77
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
78
78
  key?: string | undefined;
@@ -86,18 +86,18 @@ declare const _default: React.ForwardRefExoticComponent<ActionSheetProps & React
86
86
  * @param {ActionSheetProps} config setting
87
87
  * @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => void; }}
88
88
  */
89
- open: (config: Pick<ActionSheetProps & React.RefAttributes<ActionSheetRef>, "title" | "ref" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
89
+ open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
90
90
  key?: string | undefined;
91
- }) => {
91
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
92
92
  close: () => void;
93
- update: (newConfig: Pick<ActionSheetProps & React.RefAttributes<ActionSheetRef>, "title" | "ref" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
93
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
94
94
  key?: string | undefined;
95
95
  }) => void;
96
96
  };
97
97
  };
98
98
  /**
99
99
  * 动作面板组件
100
- * @en ActionSheet Commponent
100
+ * @en ActionSheet Component
101
101
  * @type 反馈
102
102
  * @type_en FeedBack
103
103
  * @name 动作面板
@@ -107,16 +107,17 @@ function methodsGenerator(Comp) {
107
107
  open: (0, _methods.open)(Comp)
108
108
  };
109
109
  }
110
+
111
+ var ActionSheetWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(ActionSheet);
110
112
  /**
111
113
  * 动作面板组件
112
- * @en ActionSheet Commponent
114
+ * @en ActionSheet Component
113
115
  * @type 反馈
114
116
  * @type_en FeedBack
115
117
  * @name 动作面板
116
118
  * @name_en ActionSheet
117
119
  */
118
120
 
119
-
120
- var _default = (0, _mobileUtils.componentWrapper)(ActionSheet, methodsGenerator(ActionSheet));
121
+ var _default = (0, _mobileUtils.componentWrapper)(ActionSheet, methodsGenerator(ActionSheetWithGlobalContext));
121
122
 
122
123
  exports.default = _default;
@@ -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;
@@ -9,8 +9,7 @@
9
9
  transform: scale(1);
10
10
  opacity: 1;
11
11
  }
12
- }
13
- @keyframes scale-on {
12
+ }@keyframes scale-on {
14
13
  0% {
15
14
  -webkit-transform: scale(0);
16
15
  transform: scale(0);
@@ -158,6 +158,10 @@ var Checkbox = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
158
158
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
159
159
  var prefixCls = _ref.prefixCls;
160
160
  return /*#__PURE__*/_react.default.createElement("div", {
161
+ role: "checkbox",
162
+ "aria-checked": checked,
163
+ "aria-disabled": disabled,
164
+ tabIndex: 0,
161
165
  ref: domRef,
162
166
  style: style,
163
167
  className: (0, _mobileUtils.cls)(className, prefixCls + "-" + componentName, "shape-" + shape, {
@@ -164,6 +164,10 @@ var CircleProgress = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
164
164
  function renderCircleProgress(_ref) {
165
165
  var prefixCls = _ref.prefixCls;
166
166
  return /*#__PURE__*/_react.default.createElement("div", {
167
+ role: "progressbar",
168
+ "aria-valuemin": 0,
169
+ "aria-valuemax": 100,
170
+ "aria-valuenow": percentage,
167
171
  className: (0, _mobileUtils.cls)(prefixCls + "-circle-progress", disabled ? prefixCls + "-circle-progress-disabled" : '', "" + className),
168
172
  style: (0, _extends2.default)({
169
173
  width: circleSize,
@@ -41,6 +41,9 @@ export declare const GlobalContext: React.Context<GlobalContextParams>;
41
41
  export interface ContextProviderProps extends GlobalContextParams {
42
42
  children: React.ReactNode;
43
43
  }
44
+ export declare type WithGlobalContext<T> = T & {
45
+ context?: GlobalContextParams;
46
+ };
44
47
  /**
45
48
  * 全局数据控制组件,用于替换全局数据。
46
49
  * @en Global data control component, used to replace global data.
@@ -51,3 +54,4 @@ export interface ContextProviderProps extends GlobalContextParams {
51
54
  */
52
55
  export default function ContextProvider(props: ContextProviderProps): JSX.Element;
53
56
  export declare const ContextLayout: React.Consumer<GlobalContextParams>;
57
+ export declare function CompWithGlobalContext<P extends JSX.IntrinsicAttributes>(Component: React.FunctionComponent<P>): (props: WithGlobalContext<P>) => JSX.Element;
@@ -3,6 +3,7 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
5
  exports.__esModule = true;
6
+ exports.CompWithGlobalContext = CompWithGlobalContext;
6
7
  exports.GlobalContext = exports.ContextLayout = void 0;
7
8
  exports.default = ContextProvider;
8
9
  exports.defaultContext = void 0;
@@ -15,7 +16,8 @@ var _react = _interopRequireWildcard(require("react"));
15
16
 
16
17
  var _mobileUtils = require("@arco-design/mobile-utils");
17
18
 
18
- var _excluded = ["children", "useDarkMode", "isDarkMode", "theme", "locale"];
19
+ var _excluded = ["children", "useDarkMode", "isDarkMode", "theme", "locale"],
20
+ _excluded2 = ["context"];
19
21
 
20
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
23
 
@@ -100,4 +102,14 @@ function ContextProvider(props) {
100
102
  }
101
103
 
102
104
  var ContextLayout = GlobalContext.Consumer;
103
- exports.ContextLayout = ContextLayout;
105
+ exports.ContextLayout = ContextLayout;
106
+
107
+ function CompWithGlobalContext(Component) {
108
+ return function (props) {
109
+ var propsContext = props.context,
110
+ others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
111
+ return /*#__PURE__*/_react.default.createElement(ContextLayout, null, function (context) {
112
+ return /*#__PURE__*/_react.default.createElement(ContextProvider, (0, _extends2.default)({}, context, propsContext), /*#__PURE__*/_react.default.createElement(Component, others));
113
+ });
114
+ };
115
+ }
@@ -137,7 +137,7 @@ export declare function methodsGenerator<P extends OpenBaseProps, A = AlertOptio
137
137
  * @param {AlertOptions & DialogProps} config Configuration
138
138
  * @returns {{ close: () => void; update: (newConfig: AlertOptions & DialogProps) => void; }}
139
139
  */
140
- alert: (config: A) => {
140
+ alert: (config: A, context?: import("../context-provider").GlobalContextParams | undefined) => {
141
141
  close: () => void;
142
142
  update: (newConfig: A) => void;
143
143
  };
@@ -147,7 +147,7 @@ export declare function methodsGenerator<P extends OpenBaseProps, A = AlertOptio
147
147
  * @param {ConfirmOptions & AlertOptions} config Configuration
148
148
  * @returns {{ close: () => void; update: (newConfig: ConfirmOptions & AlertOptions) => void; }}
149
149
  */
150
- confirm: (config: C) => {
150
+ confirm: (config: C, context?: import("../context-provider").GlobalContextParams | undefined) => {
151
151
  close: () => void;
152
152
  update: (newConfig: C) => void;
153
153
  };
@@ -159,7 +159,7 @@ export declare function methodsGenerator<P extends OpenBaseProps, A = AlertOptio
159
159
  */
160
160
  open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
161
161
  key?: string | undefined;
162
- }) => {
162
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
163
163
  close: () => void;
164
164
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
165
165
  key?: string | undefined;
@@ -173,7 +173,7 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
173
173
  * @param {AlertOptions & DialogProps} config Configuration
174
174
  * @returns {{ close: () => void; update: (newConfig: AlertOptions & DialogProps) => void; }}
175
175
  */
176
- alert: (config: AlertOptions) => {
176
+ alert: (config: AlertOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
177
177
  close: () => void;
178
178
  update: (newConfig: AlertOptions) => void;
179
179
  };
@@ -183,7 +183,7 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
183
183
  * @param {ConfirmOptions & AlertOptions} config Configuration
184
184
  * @returns {{ close: () => void; update: (newConfig: ConfirmOptions & AlertOptions) => void; }}
185
185
  */
186
- confirm: (config: ConfirmOptions) => {
186
+ confirm: (config: ConfirmOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
187
187
  close: () => void;
188
188
  update: (newConfig: ConfirmOptions) => void;
189
189
  };
@@ -193,11 +193,11 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
193
193
  * @param {DialogProps} config Configuration
194
194
  * @returns {{ close: () => void; update: (newConfig: DialogProps) => void; }}
195
195
  */
196
- open: (config: Pick<DialogProps & React.RefAttributes<DialogRef>, "platform" | "footer" | "title" | "ref" | "children" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
196
+ open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "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" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
197
197
  key?: string | undefined;
198
- }) => {
198
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
199
199
  close: () => void;
200
- update: (newConfig: Pick<DialogProps & React.RefAttributes<DialogRef>, "platform" | "footer" | "title" | "ref" | "children" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
200
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "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" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
201
201
  key?: string | undefined;
202
202
  }) => void;
203
203
  };
@@ -172,6 +172,8 @@ function methodsGenerator(Comp) {
172
172
  open: (0, _methods.open)(Comp)
173
173
  };
174
174
  }
175
+
176
+ var DialogWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Dialog);
175
177
  /**
176
178
  * 模态对话框,在浮层中显示,引导用户进行相关操作。默认做了防滚动穿透处理,如果弹层内容中需要滚动,则需将滚动容器传入`getScrollContainer`属性以在未滚动到顶部或底部时释放滚动。
177
179
  * @en A modal dialog, displayed in a floating layer, guides the user to perform related operations. By default, anti-scroll penetration processing is performed. If scrolling is required in the content of the bullet layer, you need to pass the scroll container to `getScrollContainer` to release scrolling when it is not scrolled to the top or bottom.
@@ -181,7 +183,6 @@ function methodsGenerator(Comp) {
181
183
  * @name_en Dialog
182
184
  */
183
185
 
184
-
185
- var _default = (0, _mobileUtils.componentWrapper)(Dialog, methodsGenerator(Dialog));
186
+ var _default = (0, _mobileUtils.componentWrapper)(Dialog, methodsGenerator(DialogWithGlobalContext));
186
187
 
187
188
  exports.default = _default;
@@ -2,17 +2,17 @@ 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, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: AlertOptions) => {
5
+ export declare function alert<AlertOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: AlertOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
6
6
  close: () => void;
7
7
  update: (newConfig: AlertOptions) => void;
8
8
  };
9
- export declare function confirm<ConfirmOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: ConfirmOptions) => {
9
+ export declare function confirm<ConfirmOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: ConfirmOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
10
10
  close: () => void;
11
11
  update: (newConfig: ConfirmOptions) => void;
12
12
  };
13
13
  export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
14
14
  key?: string | undefined;
15
- }) => {
15
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
16
16
  close: () => void;
17
17
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
18
18
  key?: string | undefined;
@@ -9,8 +9,7 @@
9
9
  -webkit-transform: scale(1);
10
10
  transform: scale(1);
11
11
  }
12
- }
13
- @keyframes fade-scale-on {
12
+ }@keyframes fade-scale-on {
14
13
  0% {
15
14
  opacity: 0;
16
15
  -webkit-transform: scale(0.5);
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
- import { JsEllipsisProps, JsEllipsisRef } from '../type';
3
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<JsEllipsisProps, "text" | "ellipsis" | "maxHeight" | "prefixCls" | "ellipsisNode" | "collapseNode" | "endExcludes" | "reflowOnResize" | "onReflow" | "onEllipsisNodeClick" | "onCollapseNodeClick" | "maxLine" | "dangerouslyUseInnerHTML"> & React.RefAttributes<JsEllipsisRef>>>;
2
+ import { JsEllipsisRef } from '../type';
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("../type").EllipsisBaseProps & {
4
+ prefixCls: string;
5
+ } & Pick<import("../type").EllipsisProps, "maxHeight" | "endExcludes" | "reflowOnResize" | "onReflow"> & React.RefAttributes<JsEllipsisRef>>>;
4
6
  export default _default;
@@ -220,7 +220,20 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
220
220
  }, /*#__PURE__*/_react.default.createElement("span", {
221
221
  ref: textRef,
222
222
  className: prefixCls + "-js-content"
223
- }), /*#__PURE__*/_react.default.createElement("span", {
223
+ }, dangerouslyUseInnerHTML ? /*#__PURE__*/_react.default.createElement("span", {
224
+ className: prefixCls + "-js-content-initial",
225
+ style: {
226
+ WebkitLineClamp: maxLine
227
+ },
228
+ dangerouslySetInnerHTML: {
229
+ __html: text
230
+ }
231
+ }) : /*#__PURE__*/_react.default.createElement("span", {
232
+ className: prefixCls + "-js-content-initial",
233
+ style: {
234
+ WebkitLineClamp: maxLine
235
+ }
236
+ }, text)), /*#__PURE__*/_react.default.createElement("span", {
224
237
  ref: ellipsisRef,
225
238
  className: prefixCls + "-js-content-ellipsis",
226
239
  onClick: onEllipsisNodeClick
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { NativeEllipsisProps } from '../type';
3
- declare function NativeEllipsis({ prefixCls, ellipsis, dangerouslyUseInnerHTML, text, maxLine, collapseNode, onCollapseNodeClick, }: NativeEllipsisProps): JSX.Element;
3
+ declare function NativeEllipsis({ prefixCls, ellipsis, dangerouslyUseInnerHTML, text, maxLine, ellipsisNode, collapseNode, onEllipsisNodeClick, onCollapseNodeClick, }: NativeEllipsisProps): JSX.Element;
4
4
  declare const _default: React.MemoExoticComponent<typeof NativeEllipsis>;
5
5
  export default _default;
@@ -15,8 +15,10 @@ function NativeEllipsis(_ref) {
15
15
  dangerouslyUseInnerHTML = _ref.dangerouslyUseInnerHTML,
16
16
  text = _ref.text,
17
17
  maxLine = _ref.maxLine,
18
+ ellipsisNode = _ref.ellipsisNode,
18
19
  _ref$collapseNode = _ref.collapseNode,
19
20
  collapseNode = _ref$collapseNode === void 0 ? '' : _ref$collapseNode,
21
+ onEllipsisNodeClick = _ref.onEllipsisNodeClick,
20
22
  onCollapseNodeClick = _ref.onCollapseNodeClick;
21
23
  return /*#__PURE__*/_react.default.createElement("div", {
22
24
  className: (0, _mobileUtils.cls)(prefixCls + "-native", {
@@ -35,7 +37,10 @@ function NativeEllipsis(_ref) {
35
37
  }) : /*#__PURE__*/_react.default.createElement("span", null, text), !ellipsis && collapseNode && /*#__PURE__*/_react.default.createElement("span", {
36
38
  onClick: onCollapseNodeClick,
37
39
  className: (0, _mobileUtils.cls)(prefixCls + "-native-collapse")
38
- }, collapseNode));
40
+ }, collapseNode), ellipsis && (ellipsisNode !== '...' || onEllipsisNodeClick) ? /*#__PURE__*/_react.default.createElement("span", {
41
+ onClick: onEllipsisNodeClick,
42
+ className: (0, _mobileUtils.cls)(prefixCls + "-native-ellipsis-node")
43
+ }, ellipsisNode) : null);
39
44
  }
40
45
 
41
46
  var _default = /*#__PURE__*/_react.default.memo(NativeEllipsis);
@@ -1,4 +1,4 @@
1
- #demo-ellipsis {
1
+ #demo-ellipsis .arco-ellipsis {
2
2
  line-height: 26px;
3
3
  }
4
4
  #demo-ellipsis .demo-link,
@@ -1,7 +1,9 @@
1
1
  @import '../../../../style/mixin.less';
2
2
 
3
3
  #demo-ellipsis {
4
- line-height: 26px;
4
+ .@{prefix}-ellipsis {
5
+ line-height: 26px;
6
+ }
5
7
  .demo-link,
6
8
  .demo-link-line {
7
9
  .use-var(color, primary-color);
@@ -52,15 +52,17 @@ var Ellipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
52
52
  ellipsisNode = _props$ellipsisNode === void 0 ? '...' : _props$ellipsisNode,
53
53
  _props$collapseNode = props.collapseNode,
54
54
  collapseNode = _props$collapseNode === void 0 ? '' : _props$collapseNode,
55
- onCollapseNodeClick = props.onCollapseNodeClick,
56
55
  endExcludes = props.endExcludes,
57
56
  _props$reflowOnResize = props.reflowOnResize,
58
57
  reflowOnResize = _props$reflowOnResize === void 0 ? false : _props$reflowOnResize,
58
+ _props$floatEllipsisN = props.floatEllipsisNode,
59
+ floatEllipsisNode = _props$floatEllipsisN === void 0 ? false : _props$floatEllipsisN,
59
60
  onReflow = props.onReflow,
61
+ onCollapseNodeClick = props.onCollapseNodeClick,
60
62
  onEllipsisNodeClick = props.onEllipsisNodeClick;
61
63
  var domRef = (0, _react.useRef)(null);
62
64
  var jsEllipsisRef = (0, _react.useRef)(null);
63
- var useNativeEllipsis = (0, _is.isSupportWebkitLineClamp)() && maxHeight === void 0 && ellipsisNode === '...' && (!endExcludes || endExcludes.length === 0) && !onReflow && !onEllipsisNodeClick;
65
+ var useNativeEllipsis = (0, _is.isSupportWebkitLineClamp)() && maxHeight === void 0 && (!endExcludes || endExcludes.length === 0) && !onReflow && (floatEllipsisNode || ellipsisNode === '...' && !onEllipsisNodeClick);
64
66
  (0, _react.useImperativeHandle)(ref, function () {
65
67
  var _jsEllipsisRef$curren;
66
68
 
@@ -80,7 +82,9 @@ var Ellipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
80
82
  dangerouslyUseInnerHTML: dangerouslyUseInnerHTML,
81
83
  text: text,
82
84
  maxLine: maxLine,
85
+ ellipsisNode: ellipsisNode,
83
86
  collapseNode: collapseNode,
87
+ onEllipsisNodeClick: onEllipsisNodeClick,
84
88
  onCollapseNodeClick: onCollapseNodeClick
85
89
  }) : /*#__PURE__*/_react.default.createElement(_jsEllipsis.default, {
86
90
  ref: jsEllipsisRef,
@@ -1,10 +1,23 @@
1
1
  .arco-ellipsis {
2
2
  font-size: 0.32rem ;
3
3
  }
4
- .arco-ellipsis-native.ellipsis {
4
+ .arco-ellipsis-native.ellipsis,
5
+ .arco-ellipsis-js-content-initial {
5
6
  display: -webkit-box;
6
7
  overflow: hidden;
7
8
  text-overflow: ellipsis;
8
9
  word-break: break-word;
9
10
  -webkit-box-orient: vertical;
11
+ position: relative;
12
+ }
13
+ .arco-ellipsis-native-ellipsis-node {
14
+ position: absolute;
15
+ right: 0;
16
+ bottom: 0;
17
+ background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0), #ffffff 20PX, #ffffff) ;
18
+ background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ffffff 20PX, #ffffff) ;
19
+ padding-left: 20PX ;
20
+ }
21
+ .arco-ellipsis-js-content-ellipsis {
22
+ display: none;
10
23
  }
@@ -3,11 +3,25 @@
3
3
  .@{prefix}-ellipsis {
4
4
  .use-var(font-size, ellipsis-default-text-size);
5
5
 
6
- &-native.ellipsis {
6
+ &-native.ellipsis,
7
+ &-js-content-initial {
7
8
  display: -webkit-box;
8
9
  overflow: hidden;
9
10
  text-overflow: ellipsis;
10
11
  word-break: break-word;
11
12
  -webkit-box-orient: vertical;
13
+ position: relative;
14
+ }
15
+
16
+ &-native-ellipsis-node {
17
+ position: absolute;
18
+ right: 0;
19
+ bottom: 0;
20
+ .use-var(background, ellipsis-float-ellipsis-node-background);
21
+ .use-var(padding-left, ellipsis-float-ellipsis-node-padding-left);
22
+ }
23
+
24
+ &-js-content-ellipsis {
25
+ display: none;
12
26
  }
13
27
  }