@arco-design/mobile-react 2.25.2 → 2.25.4
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 +24 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/ellipsis/type.d.ts +3 -3
- package/cjs/image-preview/index.js +6 -3
- package/cjs/nav-bar/index.d.ts +5 -0
- package/cjs/nav-bar/index.js +4 -2
- package/cjs/search-bar/style/css/index.css +1 -0
- package/cjs/search-bar/style/index.less +1 -0
- package/dist/index.js +11 -6
- package/dist/index.min.js +1 -1
- package/dist/style.css +1 -0
- package/dist/style.min.css +1 -1
- package/esm/ellipsis/type.d.ts +3 -3
- package/esm/image-preview/index.js +6 -3
- package/esm/nav-bar/index.d.ts +5 -0
- package/esm/nav-bar/index.js +4 -2
- package/esm/search-bar/style/css/index.css +1 -0
- package/esm/search-bar/style/index.less +1 -0
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +14 -0
- package/tokens/app/arcodesign/default/index.d.ts +14 -0
- package/tokens/app/arcodesign/default/index.js +15 -1
- package/tokens/app/arcodesign/default/index.json +168 -0
- package/tokens/app/arcodesign/default/index.less +14 -0
- package/umd/ellipsis/type.d.ts +3 -3
- package/umd/image-preview/index.js +6 -3
- package/umd/nav-bar/index.d.ts +5 -0
- package/umd/nav-bar/index.js +4 -2
- package/umd/search-bar/style/css/index.css +1 -0
- package/umd/search-bar/style/index.less +1 -0
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,30 @@
|
|
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.25.4](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.25.3...@arco-design/mobile-react@2.25.4) (2023-02-27)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* `Ellipsis` optimize click event type ([#94](https://github.com/arco-design/arco-design-mobile/issues/94)) ([e0e0369](https://github.com/arco-design/arco-design-mobile/commit/e0e03691d48f5a0f78e3be339a3f28b6f70c9798))
|
12
|
+
* `SearchBar` disable default appearance of search input ([#97](https://github.com/arco-design/arco-design-mobile/issues/97)) ([648ccb3](https://github.com/arco-design/arco-design-mobile/commit/648ccb3024c092dd48c4c79c0c36b3b9ef61fb08))
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
## [2.25.3](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.25.2...@arco-design/mobile-react@2.25.3) (2023-02-10)
|
19
|
+
|
20
|
+
|
21
|
+
### Bug Fixes
|
22
|
+
|
23
|
+
* `ImagePreview` fix display problems when passing fit layout ([#91](https://github.com/arco-design/arco-design-mobile/issues/91)) ([244107f](https://github.com/arco-design/arco-design-mobile/commit/244107fa4764141e8e57e871cad60f19f0592706))
|
24
|
+
* `NavBar` support the prop 'onScrollChange' ([46f2a5c](https://github.com/arco-design/arco-design-mobile/commit/46f2a5cf6afa5abec235d9d6311f40c19f8c1bc0))
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
6
30
|
## [2.25.2](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.25.1...@arco-design/mobile-react@2.25.2) (2023-02-08)
|
7
31
|
|
8
32
|
|
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.25.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.25.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.25.3/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.25.3/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.25.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.25.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.25.3/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.25.3/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
package/cjs/ellipsis/type.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
1
|
+
import React, { ReactNode } from 'react';
|
2
2
|
export interface EllipsisBaseProps {
|
3
3
|
/**
|
4
4
|
* 需要缩略的文本内容
|
@@ -38,12 +38,12 @@ export interface EllipsisBaseProps {
|
|
38
38
|
* 缩略节点点击事件
|
39
39
|
* @en Ellipsis node click event
|
40
40
|
*/
|
41
|
-
onEllipsisNodeClick?: () => void;
|
41
|
+
onEllipsisNodeClick?: (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
42
42
|
/**
|
43
43
|
* 收起节点点击事件
|
44
44
|
* @en Collapse node click event
|
45
45
|
*/
|
46
|
-
onCollapseNodeClick?: () => void;
|
46
|
+
onCollapseNodeClick?: (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
47
47
|
}
|
48
48
|
export interface EllipsisRef {
|
49
49
|
/**
|
@@ -752,7 +752,7 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
752
752
|
// @en In iOS when resetting the style, the image will disappear and cause flickering, so put a image at the bottom
|
753
753
|
// 优先过渡图,其次用原图
|
754
754
|
// @en Prioritize the transition image, followed by the original image
|
755
|
-
function renderImagePlaceholder(src, index) {
|
755
|
+
function renderImagePlaceholder(src, index, fitCss) {
|
756
756
|
var _ref2 = imagesStatus[index] || {},
|
757
757
|
originWidth = _ref2.originWidth,
|
758
758
|
originHeight = _ref2.originHeight,
|
@@ -762,6 +762,9 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
762
762
|
var trans = hasOverflow ? {} : (0, _helpers.getStyleWithVendor)({
|
763
763
|
transform: 'translateY(-50%)'
|
764
764
|
});
|
765
|
+
var fitObj = fitCss ? {
|
766
|
+
objectFit: fitCss
|
767
|
+
} : {};
|
765
768
|
return system === 'ios' && showPlaceholders[index] && originWidth && originHeight ? /*#__PURE__*/_react.default.createElement("img", {
|
766
769
|
src: src,
|
767
770
|
style: (0, _extends5.default)({
|
@@ -770,7 +773,7 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
770
773
|
height: originHeight,
|
771
774
|
left: originLeft,
|
772
775
|
top: originTop
|
773
|
-
}, trans)
|
776
|
+
}, fitObj, trans)
|
774
777
|
}) : null;
|
775
778
|
}
|
776
779
|
function renderLoadingArea(index) {
|
@@ -836,7 +839,7 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
836
839
|
animateDuration: transImageInfo ? 0 : void 0,
|
837
840
|
style: getImageStyle(),
|
838
841
|
className: getImageClass(index),
|
839
|
-
bottomOverlap: renderImagePlaceholder(image.fallbackSrc || image.src, index),
|
842
|
+
bottomOverlap: renderImagePlaceholder(image.fallbackSrc || image.src, index, image.fit || fit),
|
840
843
|
onLoad: function onLoad(_, imageEle) {
|
841
844
|
imageDomsRef.current[index] = imageEle;
|
842
845
|
setImagesStatusByIndex(index, {
|
package/cjs/nav-bar/index.d.ts
CHANGED
@@ -105,6 +105,11 @@ 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
|
+
* 滚动时回调,设置该属性后将监听滚动容器的滚动事件
|
110
|
+
* @en Callback when scrolling. After setting this property, the scroll event of the scroll container will be monitored.
|
111
|
+
*/
|
112
|
+
onScrollChange?: (offset: number) => void;
|
108
113
|
/**
|
109
114
|
* 无障碍aria-label属性
|
110
115
|
* @en Accessibility attribute aria-label
|
package/cjs/nav-bar/index.js
CHANGED
@@ -45,6 +45,7 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
45
45
|
getScrollContainer = props.getScrollContainer,
|
46
46
|
_props$showOffset = props.showOffset,
|
47
47
|
showOffset = _props$showOffset === void 0 ? 0 : _props$showOffset,
|
48
|
+
onScrollChange = props.onScrollChange,
|
48
49
|
getComputedStyleByScroll = props.getComputedStyleByScroll,
|
49
50
|
_props$ariaLabel = props.ariaLabel,
|
50
51
|
ariaLabel = _props$ariaLabel === void 0 ? '' : _props$ariaLabel,
|
@@ -61,6 +62,7 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
61
62
|
var system = (0, _helpers.useSystem)();
|
62
63
|
var onElementScroll = function onElementScroll(curOffset) {
|
63
64
|
setScrollToggleHide(curOffset < showOffset);
|
65
|
+
onScrollChange == null ? void 0 : onScrollChange(curOffset);
|
64
66
|
if (getComputedStyleByScroll) {
|
65
67
|
var cstyle = getComputedStyleByScroll(curOffset);
|
66
68
|
setCustomStyle(cstyle);
|
@@ -80,7 +82,7 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
80
82
|
onElementScroll(top);
|
81
83
|
};
|
82
84
|
(0, _react.useEffect)(function () {
|
83
|
-
var needBind = showOffset || getComputedStyleByScroll;
|
85
|
+
var needBind = showOffset || getComputedStyleByScroll || onScrollChange;
|
84
86
|
var container = (0, _mobileUtils.getValidScrollContainer)(getScrollContainer);
|
85
87
|
handleEleScroll();
|
86
88
|
if (needBind && container) {
|
@@ -91,7 +93,7 @@ var NavBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
91
93
|
container.removeEventListener('scroll', handleEleScroll, false);
|
92
94
|
}
|
93
95
|
};
|
94
|
-
}, [showOffset, getComputedStyleByScroll, getScrollContainer]);
|
96
|
+
}, [showOffset, getComputedStyleByScroll, onScrollChange, getScrollContainer]);
|
95
97
|
function handleClickLeft(e) {
|
96
98
|
if (onClickLeft) {
|
97
99
|
onClickLeft(e);
|
package/dist/index.js
CHANGED
@@ -20308,7 +20308,7 @@
|
|
20308
20308
|
// @en In iOS when resetting the style, the image will disappear and cause flickering, so put a image at the bottom
|
20309
20309
|
// 优先过渡图,其次用原图
|
20310
20310
|
// @en Prioritize the transition image, followed by the original image
|
20311
|
-
function renderImagePlaceholder(src, index) {
|
20311
|
+
function renderImagePlaceholder(src, index, fitCss) {
|
20312
20312
|
var _a = imagesStatus[index] || {},
|
20313
20313
|
originWidth = _a.originWidth,
|
20314
20314
|
originHeight = _a.originHeight,
|
@@ -20318,15 +20318,18 @@
|
|
20318
20318
|
var trans = hasOverflow ? {} : getStyleWithVendor({
|
20319
20319
|
transform: 'translateY(-50%)'
|
20320
20320
|
});
|
20321
|
+
var fitObj = fitCss ? {
|
20322
|
+
objectFit: fitCss
|
20323
|
+
} : {};
|
20321
20324
|
return system === 'ios' && showPlaceholders[index] && originWidth && originHeight ? /*#__PURE__*/React__default["default"].createElement("img", {
|
20322
20325
|
src: src,
|
20323
|
-
style: __assign$2({
|
20326
|
+
style: __assign$2(__assign$2({
|
20324
20327
|
position: 'absolute',
|
20325
20328
|
width: originWidth,
|
20326
20329
|
height: originHeight,
|
20327
20330
|
left: originLeft,
|
20328
20331
|
top: originTop
|
20329
|
-
}, trans)
|
20332
|
+
}, fitObj), trans)
|
20330
20333
|
}) : null;
|
20331
20334
|
}
|
20332
20335
|
function renderLoadingArea(index) {
|
@@ -20392,7 +20395,7 @@
|
|
20392
20395
|
animateDuration: transImageInfo ? 0 : void 0,
|
20393
20396
|
style: getImageStyle(),
|
20394
20397
|
className: getImageClass(index),
|
20395
|
-
bottomOverlap: renderImagePlaceholder(image.fallbackSrc || image.src, index),
|
20398
|
+
bottomOverlap: renderImagePlaceholder(image.fallbackSrc || image.src, index, image.fit || fit),
|
20396
20399
|
onLoad: function onLoad(_, imageEle) {
|
20397
20400
|
imageDomsRef.current[index] = imageEle;
|
20398
20401
|
setImagesStatusByIndex(index, {
|
@@ -20676,6 +20679,7 @@
|
|
20676
20679
|
getScrollContainer = props.getScrollContainer,
|
20677
20680
|
_h = props.showOffset,
|
20678
20681
|
showOffset = _h === void 0 ? 0 : _h,
|
20682
|
+
onScrollChange = props.onScrollChange,
|
20679
20683
|
getComputedStyleByScroll = props.getComputedStyleByScroll,
|
20680
20684
|
_j = props.ariaLabel,
|
20681
20685
|
ariaLabel = _j === void 0 ? '' : _j,
|
@@ -20692,6 +20696,7 @@
|
|
20692
20696
|
var system = useSystem();
|
20693
20697
|
var onElementScroll = function onElementScroll(curOffset) {
|
20694
20698
|
setScrollToggleHide(curOffset < showOffset);
|
20699
|
+
onScrollChange === null || onScrollChange === void 0 ? void 0 : onScrollChange(curOffset);
|
20695
20700
|
if (getComputedStyleByScroll) {
|
20696
20701
|
var cstyle = getComputedStyleByScroll(curOffset);
|
20697
20702
|
setCustomStyle(cstyle);
|
@@ -20711,7 +20716,7 @@
|
|
20711
20716
|
onElementScroll(top);
|
20712
20717
|
};
|
20713
20718
|
React.useEffect(function () {
|
20714
|
-
var needBind = showOffset || getComputedStyleByScroll;
|
20719
|
+
var needBind = showOffset || getComputedStyleByScroll || onScrollChange;
|
20715
20720
|
var container = getValidScrollContainer(getScrollContainer);
|
20716
20721
|
handleEleScroll();
|
20717
20722
|
if (needBind && container) {
|
@@ -20722,7 +20727,7 @@
|
|
20722
20727
|
container.removeEventListener('scroll', handleEleScroll, false);
|
20723
20728
|
}
|
20724
20729
|
};
|
20725
|
-
}, [showOffset, getComputedStyleByScroll, getScrollContainer]);
|
20730
|
+
}, [showOffset, getComputedStyleByScroll, onScrollChange, getScrollContainer]);
|
20726
20731
|
function handleClickLeft(e) {
|
20727
20732
|
if (onClickLeft) {
|
20728
20733
|
onClickLeft(e);
|