@arco-design/mobile-react 2.33.0 → 2.34.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 +19 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/hooks.js +2 -0
- package/cjs/divider/style/css/index.css +6 -4
- package/cjs/divider/style/index.less +3 -1
- package/cjs/notice-bar/index.js +11 -8
- package/cjs/popover/popover-inner.js +9 -2
- package/dist/index.js +22 -10
- package/dist/index.min.js +2 -2
- package/dist/style.css +5 -3
- package/dist/style.min.css +1 -1
- package/esm/_helpers/hooks.js +2 -0
- package/esm/divider/style/css/index.css +6 -4
- package/esm/divider/style/index.less +3 -1
- package/esm/notice-bar/index.js +12 -9
- package/esm/popover/popover-inner.js +9 -2
- package/esnext/_helpers/hooks.js +6 -2
- package/esnext/divider/style/css/index.css +6 -4
- package/esnext/divider/style/index.less +3 -1
- package/esnext/notice-bar/index.js +6 -6
- package/esnext/popover/popover-inner.js +7 -2
- package/package.json +3 -3
- package/umd/_helpers/hooks.js +2 -0
- package/umd/divider/style/css/index.css +6 -4
- package/umd/divider/style/index.less +3 -1
- package/umd/notice-bar/index.js +11 -8
- package/umd/popover/popover-inner.js +9 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,25 @@
|
|
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.34.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.33.0...@arco-design/mobile-react@2.34.0) (2024-11-21)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* `Popover` custom show transition animation ([#297](https://github.com/arco-design/arco-design-mobile/issues/297)) ([c3ceaf2](https://github.com/arco-design/arco-design-mobile/commit/c3ceaf2a7571626c298132b2c486d7128a748007))
|
12
|
+
* fix `useMountedState` in `hooks.ts` not correct init leavingRef in StrictMode. ([#292](https://github.com/arco-design/arco-design-mobile/issues/292)) ([af2bf5d](https://github.com/arco-design/arco-design-mobile/commit/af2bf5d5428eec252cac565ef708b2af6e0106a2))
|
13
|
+
|
14
|
+
|
15
|
+
### Features
|
16
|
+
|
17
|
+
* add a FAQ in the `Dialog`. ([#302](https://github.com/arco-design/arco-design-mobile/issues/302)) ([55f6940](https://github.com/arco-design/arco-design-mobile/commit/55f69406a3411faf5e67b2ef05a552121a9d3c04))
|
18
|
+
* optimize `Divider` hairline style ([99b1604](https://github.com/arco-design/arco-design-mobile/commit/99b16041aa8e4b71a82ffb5744f180ee9273ef3b))
|
19
|
+
* optimize `NoticeBar` close ([#294](https://github.com/arco-design/arco-design-mobile/issues/294)) ([a717540](https://github.com/arco-design/arco-design-mobile/commit/a7175403158c43c209b58c27cd994643f822aeeb))
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
6
25
|
# [2.33.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.32.0...@arco-design/mobile-react@2.33.0) (2024-10-24)
|
7
26
|
|
8
27
|
|
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.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.33.0/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.33.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.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.33.0/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.33.0/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
package/cjs/_helpers/hooks.js
CHANGED
@@ -101,6 +101,8 @@ function useMountedState(initialState) {
|
|
101
101
|
setState(value);
|
102
102
|
}, []);
|
103
103
|
(0, _react.useEffect)(function () {
|
104
|
+
// see: https://github.com/arco-design/arco-design-mobile/pull/292
|
105
|
+
leavingRef.current = false;
|
104
106
|
return function () {
|
105
107
|
leavingRef.current = true;
|
106
108
|
};
|
@@ -542,10 +542,12 @@
|
|
542
542
|
.arco-divider::before {
|
543
543
|
content: '';
|
544
544
|
}
|
545
|
-
|
546
|
-
.arco-divider--hairline::
|
547
|
-
-
|
548
|
-
|
545
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
546
|
+
.arco-divider--hairline::before,
|
547
|
+
.arco-divider--hairline::after {
|
548
|
+
-webkit-transform: scaleY(0.5);
|
549
|
+
transform: scaleY(0.5);
|
550
|
+
}
|
549
551
|
}
|
550
552
|
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
|
551
553
|
.arco-divider--hairline::before,
|
@@ -27,7 +27,9 @@
|
|
27
27
|
&--hairline {
|
28
28
|
&::before,
|
29
29
|
&::after {
|
30
|
-
|
30
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
31
|
+
transform: scaleY(0.5);
|
32
|
+
}
|
31
33
|
|
32
34
|
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
|
33
35
|
transform: scaleY(0.33333333);
|
package/cjs/notice-bar/index.js
CHANGED
@@ -57,9 +57,13 @@ var NoticeBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
57
57
|
var contentRef = (0, _react.useRef)(null);
|
58
58
|
var timerRef = (0, _react.useRef)(null);
|
59
59
|
|
60
|
-
var _useState = (0, _react.useState)(
|
61
|
-
|
62
|
-
|
60
|
+
var _useState = (0, _react.useState)(true),
|
61
|
+
visible = _useState[0],
|
62
|
+
setVisible = _useState[1];
|
63
|
+
|
64
|
+
var _useState2 = (0, _react.useState)(false),
|
65
|
+
needMarquee = _useState2[0],
|
66
|
+
setNeedMarquee = _useState2[1];
|
63
67
|
|
64
68
|
var extraClass = (0, _react.useMemo)(function () {
|
65
69
|
var classList = []; // 字幕可滚动时,或不可滚动且不可以换行时,添加不换行效果
|
@@ -100,9 +104,8 @@ var NoticeBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
100
104
|
}, [useRtl]);
|
101
105
|
|
102
106
|
function close() {
|
103
|
-
|
104
|
-
|
105
|
-
}
|
107
|
+
setVisible(false);
|
108
|
+
clear();
|
106
109
|
}
|
107
110
|
|
108
111
|
function handleClose(e) {
|
@@ -167,7 +170,7 @@ var NoticeBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
167
170
|
}
|
168
171
|
|
169
172
|
function renderNoticeBar(prefix) {
|
170
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
173
|
+
return visible ? /*#__PURE__*/_react.default.createElement("div", {
|
171
174
|
className: (0, _mobileUtils.cls)(prefix, className, extraClass),
|
172
175
|
style: style,
|
173
176
|
ref: domRef,
|
@@ -193,7 +196,7 @@ var NoticeBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
193
196
|
}, rightContent) : null, closeable ? /*#__PURE__*/_react.default.createElement("div", {
|
194
197
|
className: prefix + "-close",
|
195
198
|
onClick: handleClose
|
196
|
-
}, closeIcon) : null);
|
199
|
+
}, closeIcon) : null) : null;
|
197
200
|
}
|
198
201
|
|
199
202
|
return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
|
@@ -63,7 +63,15 @@ var PopoverInner = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
63
63
|
if (left || width || top || height || bottom) {
|
64
64
|
if (!show) {
|
65
65
|
setTimeout(function () {
|
66
|
-
setShow(
|
66
|
+
setShow(function () {
|
67
|
+
var _domRef$current;
|
68
|
+
|
69
|
+
// bugfix:
|
70
|
+
// 外层CSSTransition使用dom API而非通过react className属性修改class
|
71
|
+
// 如果内部通过react className属性动态修改class会覆盖CSSTransition的设置,导致CSSTransition enter相关的class无法应用到组件
|
72
|
+
(_domRef$current = domRef.current) == null ? void 0 : _domRef$current.classList.add('show');
|
73
|
+
return true;
|
74
|
+
});
|
67
75
|
}, 0);
|
68
76
|
}
|
69
77
|
}
|
@@ -115,7 +123,6 @@ var PopoverInner = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
115
123
|
return /*#__PURE__*/_react.default.createElement("div", {
|
116
124
|
ref: domRef,
|
117
125
|
className: (0, _mobileUtils.cls)(prefixCls + "-popover-inner", 'popover-inner', 'all-border-box', mode + "-mode", className, {
|
118
|
-
show: show,
|
119
126
|
'with-shadow': needShadow,
|
120
127
|
'with-suffix': showCloseIcon || textSuffix,
|
121
128
|
'custom-content': typeof content !== 'string'
|
package/dist/index.js
CHANGED
@@ -3981,6 +3981,8 @@
|
|
3981
3981
|
setState(value);
|
3982
3982
|
}, []);
|
3983
3983
|
React.useEffect(function () {
|
3984
|
+
// see: https://github.com/arco-design/arco-design-mobile/pull/292
|
3985
|
+
leavingRef.current = false;
|
3984
3986
|
return function () {
|
3985
3987
|
leavingRef.current = true;
|
3986
3988
|
};
|
@@ -23516,9 +23518,13 @@
|
|
23516
23518
|
var contentRef = React.useRef(null);
|
23517
23519
|
var timerRef = React.useRef(null);
|
23518
23520
|
|
23519
|
-
var _j = React.useState(
|
23520
|
-
|
23521
|
-
|
23521
|
+
var _j = React.useState(true),
|
23522
|
+
visible = _j[0],
|
23523
|
+
setVisible = _j[1];
|
23524
|
+
|
23525
|
+
var _k = React.useState(false),
|
23526
|
+
needMarquee = _k[0],
|
23527
|
+
setNeedMarquee = _k[1];
|
23522
23528
|
|
23523
23529
|
var extraClass = React.useMemo(function () {
|
23524
23530
|
var classList = []; // 字幕可滚动时,或不可滚动且不可以换行时,添加不换行效果
|
@@ -23559,9 +23565,8 @@
|
|
23559
23565
|
}, [useRtl]);
|
23560
23566
|
|
23561
23567
|
function close() {
|
23562
|
-
|
23563
|
-
|
23564
|
-
}
|
23568
|
+
setVisible(false);
|
23569
|
+
clear();
|
23565
23570
|
}
|
23566
23571
|
|
23567
23572
|
function handleClose(e) {
|
@@ -23626,7 +23631,7 @@
|
|
23626
23631
|
}
|
23627
23632
|
|
23628
23633
|
function renderNoticeBar(prefix) {
|
23629
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
23634
|
+
return visible ? /*#__PURE__*/React__default["default"].createElement("div", {
|
23630
23635
|
className: cls(prefix, className, extraClass),
|
23631
23636
|
style: style,
|
23632
23637
|
ref: domRef,
|
@@ -23652,7 +23657,7 @@
|
|
23652
23657
|
}, rightContent) : null, closeable ? /*#__PURE__*/React__default["default"].createElement("div", {
|
23653
23658
|
className: prefix + "-close",
|
23654
23659
|
onClick: handleClose
|
23655
|
-
}, closeIcon) : null);
|
23660
|
+
}, closeIcon) : null) : null;
|
23656
23661
|
}
|
23657
23662
|
|
23658
23663
|
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
|
@@ -24253,7 +24258,15 @@
|
|
24253
24258
|
if (left || width || top || height || bottom) {
|
24254
24259
|
if (!show) {
|
24255
24260
|
setTimeout(function () {
|
24256
|
-
setShow(
|
24261
|
+
setShow(function () {
|
24262
|
+
var _a; // bugfix:
|
24263
|
+
// 外层CSSTransition使用dom API而非通过react className属性修改class
|
24264
|
+
// 如果内部通过react className属性动态修改class会覆盖CSSTransition的设置,导致CSSTransition enter相关的class无法应用到组件
|
24265
|
+
|
24266
|
+
|
24267
|
+
(_a = domRef.current) === null || _a === void 0 ? void 0 : _a.classList.add('show');
|
24268
|
+
return true;
|
24269
|
+
});
|
24257
24270
|
}, 0);
|
24258
24271
|
}
|
24259
24272
|
}
|
@@ -24305,7 +24318,6 @@
|
|
24305
24318
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
24306
24319
|
ref: domRef,
|
24307
24320
|
className: cls(prefixCls + "-popover-inner", 'popover-inner', 'all-border-box', mode + "-mode", className, {
|
24308
|
-
show: show,
|
24309
24321
|
'with-shadow': needShadow,
|
24310
24322
|
'with-suffix': showCloseIcon || textSuffix,
|
24311
24323
|
'custom-content': typeof content !== 'string'
|