@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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arco-design/mobile-react",
|
3
|
-
"version": "2.25.
|
3
|
+
"version": "2.25.4",
|
4
4
|
"description": "",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "esm/index.js",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
"author": "taoyiyue@bytedance.com",
|
16
16
|
"license": "ISC",
|
17
17
|
"dependencies": {
|
18
|
-
"@arco-design/mobile-utils": "2.13.
|
18
|
+
"@arco-design/mobile-utils": "2.13.4",
|
19
19
|
"@arco-design/transformable": "^1.0.0",
|
20
20
|
"lodash.throttle": "^4.1.1",
|
21
21
|
"resize-observer-polyfill": "^1.5.1"
|
@@ -35,5 +35,5 @@
|
|
35
35
|
"publishConfig": {
|
36
36
|
"access": "public"
|
37
37
|
},
|
38
|
-
"gitHead": "
|
38
|
+
"gitHead": "156c02f85026ec594e9d5c83edfb1728e97dc13b"
|
39
39
|
}
|
@@ -728,4 +728,18 @@
|
|
728
728
|
--form-item-label-item-required-asterisk-color: var(--danger-color);
|
729
729
|
--form-item-error-message-color: var(--danger-color);
|
730
730
|
--form-item-warning-message-color: var(--warning-color);
|
731
|
+
--time-line-dot-width: ~`pxtorem(9)`;
|
732
|
+
--time-line-dot-border-color: var(--primary-color);
|
733
|
+
--time-line-dot-background-color: var(--background-color);
|
734
|
+
--time-line-axis-width: ~`pxtorem(1)`;
|
735
|
+
--time-line-axis-color: var(--line-color);
|
736
|
+
--time-line-label-font-size: ~`pxtorem(12)`;
|
737
|
+
--time-line-label-color: var(--sub-info-font-color);
|
738
|
+
--time-line-content-margin-top: ~`pxtorem(7)`;
|
739
|
+
--time-line-content-margin-bottom: ~`pxtorem(19)`;
|
740
|
+
--time-line-content-margin-left: ~`pxtorem(8)`;
|
741
|
+
--time-line-content-border-radius: ~`pxtorem(4)`;
|
742
|
+
--time-line-content-font-size: ~`pxtorem(16)`;
|
743
|
+
--time-line-content-background-color: var(--line-color);
|
744
|
+
--time-line-content-color: var(--font-color);
|
731
745
|
}
|
@@ -727,6 +727,20 @@ export interface ArcodesignToken extends Record<string, string> {
|
|
727
727
|
'form-item-label-item-required-asterisk-color': string;
|
728
728
|
'form-item-error-message-color': string;
|
729
729
|
'form-item-warning-message-color': string;
|
730
|
+
'time-line-dot-width': string;
|
731
|
+
'time-line-dot-border-color': string;
|
732
|
+
'time-line-dot-background-color': string;
|
733
|
+
'time-line-axis-width': string;
|
734
|
+
'time-line-axis-color': string;
|
735
|
+
'time-line-label-font-size': string;
|
736
|
+
'time-line-label-color': string;
|
737
|
+
'time-line-content-margin-top': string;
|
738
|
+
'time-line-content-margin-bottom': string;
|
739
|
+
'time-line-content-margin-left': string;
|
740
|
+
'time-line-content-border-radius': string;
|
741
|
+
'time-line-content-font-size': string;
|
742
|
+
'time-line-content-background-color': string;
|
743
|
+
'time-line-content-color': string;
|
730
744
|
}
|
731
745
|
declare const tokens: ArcodesignToken;
|
732
746
|
export default tokens;
|
@@ -736,7 +736,21 @@ var tokens = {
|
|
736
736
|
"form-item-border-divider-color": "rgba(0, 0, 0, 0.08)",
|
737
737
|
"form-item-label-item-required-asterisk-color": "var(--danger-color)",
|
738
738
|
"form-item-error-message-color": "var(--danger-color)",
|
739
|
-
"form-item-warning-message-color": "var(--warning-color)"
|
739
|
+
"form-item-warning-message-color": "var(--warning-color)",
|
740
|
+
"time-line-dot-width": "0.18rem",
|
741
|
+
"time-line-dot-border-color": "var(--primary-color)",
|
742
|
+
"time-line-dot-background-color": "var(--background-color)",
|
743
|
+
"time-line-axis-width": "0.02rem",
|
744
|
+
"time-line-axis-color": "var(--line-color)",
|
745
|
+
"time-line-label-font-size": "0.24rem",
|
746
|
+
"time-line-label-color": "var(--sub-info-font-color)",
|
747
|
+
"time-line-content-margin-top": "0.14rem",
|
748
|
+
"time-line-content-margin-bottom": "0.38rem",
|
749
|
+
"time-line-content-margin-left": "0.16rem",
|
750
|
+
"time-line-content-border-radius": "0.08rem",
|
751
|
+
"time-line-content-font-size": "0.32rem",
|
752
|
+
"time-line-content-background-color": "var(--line-color)",
|
753
|
+
"time-line-content-color": "var(--font-color)"
|
740
754
|
};
|
741
755
|
var _default = tokens;
|
742
756
|
exports["default"] = _default;
|
@@ -8481,6 +8481,174 @@
|
|
8481
8481
|
"en": "Textareaword count font size"
|
8482
8482
|
}
|
8483
8483
|
},
|
8484
|
+
"timeLineAxisColor": {
|
8485
|
+
"cssKey": "time-line-axis-color",
|
8486
|
+
"desc": "时间轴轴线的颜色",
|
8487
|
+
"override": "",
|
8488
|
+
"value": "@line-color",
|
8489
|
+
"jsValue": "@global@lineColor",
|
8490
|
+
"staticValue": "#e5e6eb",
|
8491
|
+
"localeDesc": {
|
8492
|
+
"ch": "时间轴轴线的颜色",
|
8493
|
+
"en": "Color of the Axis of TimeLine"
|
8494
|
+
}
|
8495
|
+
},
|
8496
|
+
"timeLineAxisWidth": {
|
8497
|
+
"cssKey": "time-line-axis-width",
|
8498
|
+
"desc": "时间轴轴线的宽度",
|
8499
|
+
"override": "",
|
8500
|
+
"value": "~`pxtorem(1)`",
|
8501
|
+
"jsValue": "@getRem@1",
|
8502
|
+
"staticValue": "0.02rem",
|
8503
|
+
"localeDesc": {
|
8504
|
+
"ch": "时间轴轴线的宽度",
|
8505
|
+
"en": "Width of the Axis of TimeLine"
|
8506
|
+
}
|
8507
|
+
},
|
8508
|
+
"timeLineContentBackgroundColor": {
|
8509
|
+
"cssKey": "time-line-content-background-color",
|
8510
|
+
"desc": "时间轴content的背景色",
|
8511
|
+
"override": "",
|
8512
|
+
"value": "@line-color",
|
8513
|
+
"jsValue": "@global@lineColor",
|
8514
|
+
"staticValue": "#e5e6eb",
|
8515
|
+
"localeDesc": {
|
8516
|
+
"ch": "时间轴content的背景色",
|
8517
|
+
"en": "Background color of the Content of TimeLine"
|
8518
|
+
}
|
8519
|
+
},
|
8520
|
+
"timeLineContentBorderRadius": {
|
8521
|
+
"cssKey": "time-line-content-border-radius",
|
8522
|
+
"desc": "时间轴content的圆角值",
|
8523
|
+
"override": "",
|
8524
|
+
"value": "~`pxtorem(4)`",
|
8525
|
+
"jsValue": "@getRem@4",
|
8526
|
+
"staticValue": "0.08rem",
|
8527
|
+
"localeDesc": {
|
8528
|
+
"ch": "时间轴content的圆角值",
|
8529
|
+
"en": "Border radius of the Content of TimeLine"
|
8530
|
+
}
|
8531
|
+
},
|
8532
|
+
"timeLineContentColor": {
|
8533
|
+
"cssKey": "time-line-content-color",
|
8534
|
+
"desc": "时间轴content的字体颜色",
|
8535
|
+
"override": "",
|
8536
|
+
"value": "@font-color",
|
8537
|
+
"jsValue": "@global@fontColor",
|
8538
|
+
"staticValue": "#1d2129",
|
8539
|
+
"localeDesc": {
|
8540
|
+
"ch": "时间轴content的字体颜色",
|
8541
|
+
"en": "Font color of the Content of TimeLine"
|
8542
|
+
}
|
8543
|
+
},
|
8544
|
+
"timeLineContentFontSize": {
|
8545
|
+
"cssKey": "time-line-content-font-size",
|
8546
|
+
"desc": "时间轴content的字体大小",
|
8547
|
+
"override": "",
|
8548
|
+
"value": "~`pxtorem(16)`",
|
8549
|
+
"jsValue": "@getRem@16",
|
8550
|
+
"staticValue": "0.32rem",
|
8551
|
+
"localeDesc": {
|
8552
|
+
"ch": "时间轴content的字体大小",
|
8553
|
+
"en": "Font size of the content of TimeLine"
|
8554
|
+
}
|
8555
|
+
},
|
8556
|
+
"timeLineContentMarginBottom": {
|
8557
|
+
"cssKey": "time-line-content-margin-bottom",
|
8558
|
+
"desc": "时间轴content的下外边距(13 + 12 / 2)",
|
8559
|
+
"override": "",
|
8560
|
+
"value": "~`pxtorem(19)`",
|
8561
|
+
"jsValue": "@getRem@19",
|
8562
|
+
"staticValue": "0.38rem",
|
8563
|
+
"localeDesc": {
|
8564
|
+
"ch": "时间轴content的下外边距(13 + 12 / 2)",
|
8565
|
+
"en": "Bottom margin of the Content of TimeLine"
|
8566
|
+
}
|
8567
|
+
},
|
8568
|
+
"timeLineContentMarginLeft": {
|
8569
|
+
"cssKey": "time-line-content-margin-left",
|
8570
|
+
"desc": "时间轴content的左外边距",
|
8571
|
+
"override": "",
|
8572
|
+
"value": "~`pxtorem(8)`",
|
8573
|
+
"jsValue": "@getRem@8",
|
8574
|
+
"staticValue": "0.16rem",
|
8575
|
+
"localeDesc": {
|
8576
|
+
"ch": "时间轴content的左外边距",
|
8577
|
+
"en": "Left margin of the Content of TimeLine"
|
8578
|
+
}
|
8579
|
+
},
|
8580
|
+
"timeLineContentMarginTop": {
|
8581
|
+
"cssKey": "time-line-content-margin-top",
|
8582
|
+
"desc": "时间轴content的上外边距(13 - 12 / 2)",
|
8583
|
+
"override": "",
|
8584
|
+
"value": "~`pxtorem(7)`",
|
8585
|
+
"jsValue": "@getRem@7",
|
8586
|
+
"staticValue": "0.14rem",
|
8587
|
+
"localeDesc": {
|
8588
|
+
"ch": "时间轴content的上外边距(13 - 12 / 2)",
|
8589
|
+
"en": "Top margin of the Content of TimeLine"
|
8590
|
+
}
|
8591
|
+
},
|
8592
|
+
"timeLineDotBackgroundColor": {
|
8593
|
+
"cssKey": "time-line-dot-background-color",
|
8594
|
+
"desc": "时间轴节点的背景色",
|
8595
|
+
"override": "",
|
8596
|
+
"value": "@background-color",
|
8597
|
+
"jsValue": "@global@backgroundColor",
|
8598
|
+
"staticValue": "#ffffff",
|
8599
|
+
"localeDesc": {
|
8600
|
+
"ch": "时间轴节点的背景色",
|
8601
|
+
"en": "Background color of the dot of TimeLine"
|
8602
|
+
}
|
8603
|
+
},
|
8604
|
+
"timeLineDotBorderColor": {
|
8605
|
+
"cssKey": "time-line-dot-border-color",
|
8606
|
+
"desc": "时间轴节点的线颜色",
|
8607
|
+
"override": "",
|
8608
|
+
"value": "@primary-color",
|
8609
|
+
"jsValue": "@global@primaryColor",
|
8610
|
+
"staticValue": "#165dff",
|
8611
|
+
"localeDesc": {
|
8612
|
+
"ch": "时间轴节点的线颜色",
|
8613
|
+
"en": "Border color of the dot of TimeLine"
|
8614
|
+
}
|
8615
|
+
},
|
8616
|
+
"timeLineDotWidth": {
|
8617
|
+
"cssKey": "time-line-dot-width",
|
8618
|
+
"desc": "时间轴节点的宽度",
|
8619
|
+
"override": "",
|
8620
|
+
"value": "~`pxtorem(9)`",
|
8621
|
+
"jsValue": "@getRem@9",
|
8622
|
+
"staticValue": "0.18rem",
|
8623
|
+
"localeDesc": {
|
8624
|
+
"ch": "时间轴节点的宽度",
|
8625
|
+
"en": "Width of the dot of TimeLine"
|
8626
|
+
}
|
8627
|
+
},
|
8628
|
+
"timeLineLabelColor": {
|
8629
|
+
"cssKey": "time-line-label-color",
|
8630
|
+
"desc": "时间轴label的字体颜色",
|
8631
|
+
"override": "",
|
8632
|
+
"value": "@sub-info-font-color",
|
8633
|
+
"jsValue": "@global@subInfoFontColor",
|
8634
|
+
"staticValue": "#86909c",
|
8635
|
+
"localeDesc": {
|
8636
|
+
"ch": "时间轴label的字体颜色",
|
8637
|
+
"en": "Font color of the label of TimeLine"
|
8638
|
+
}
|
8639
|
+
},
|
8640
|
+
"timeLineLabelFontSize": {
|
8641
|
+
"cssKey": "time-line-label-font-size",
|
8642
|
+
"desc": "时间轴label的字体大小",
|
8643
|
+
"override": "",
|
8644
|
+
"value": "~`pxtorem(12)`",
|
8645
|
+
"jsValue": "@getRem@12",
|
8646
|
+
"staticValue": "0.24rem",
|
8647
|
+
"localeDesc": {
|
8648
|
+
"ch": "时间轴label的字体大小",
|
8649
|
+
"en": "Font size of the label of TimeLine"
|
8650
|
+
}
|
8651
|
+
},
|
8484
8652
|
"toastBackground": {
|
8485
8653
|
"cssKey": "toast-background",
|
8486
8654
|
"desc": "toast 背景色",
|
@@ -727,4 +727,18 @@
|
|
727
727
|
@form-item-label-item-required-asterisk-color: @danger-color;
|
728
728
|
@form-item-error-message-color: @danger-color;
|
729
729
|
@form-item-warning-message-color: @warning-color;
|
730
|
+
@time-line-dot-width: ~`pxtorem(9)`;
|
731
|
+
@time-line-dot-border-color: @primary-color;
|
732
|
+
@time-line-dot-background-color: @background-color;
|
733
|
+
@time-line-axis-width: ~`pxtorem(1)`;
|
734
|
+
@time-line-axis-color: @line-color;
|
735
|
+
@time-line-label-font-size: ~`pxtorem(12)`;
|
736
|
+
@time-line-label-color: @sub-info-font-color;
|
737
|
+
@time-line-content-margin-top: ~`pxtorem(7)`;
|
738
|
+
@time-line-content-margin-bottom: ~`pxtorem(19)`;
|
739
|
+
@time-line-content-margin-left: ~`pxtorem(8)`;
|
740
|
+
@time-line-content-border-radius: ~`pxtorem(4)`;
|
741
|
+
@time-line-content-font-size: ~`pxtorem(16)`;
|
742
|
+
@time-line-content-background-color: @line-color;
|
743
|
+
@time-line-content-color: @font-color;
|
730
744
|
|
package/umd/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
|
/**
|
@@ -761,7 +761,7 @@
|
|
761
761
|
// @en In iOS when resetting the style, the image will disappear and cause flickering, so put a image at the bottom
|
762
762
|
// 优先过渡图,其次用原图
|
763
763
|
// @en Prioritize the transition image, followed by the original image
|
764
|
-
function renderImagePlaceholder(src, index) {
|
764
|
+
function renderImagePlaceholder(src, index, fitCss) {
|
765
765
|
var _ref2 = imagesStatus[index] || {},
|
766
766
|
originWidth = _ref2.originWidth,
|
767
767
|
originHeight = _ref2.originHeight,
|
@@ -771,6 +771,9 @@
|
|
771
771
|
var trans = hasOverflow ? {} : (0, _helpers.getStyleWithVendor)({
|
772
772
|
transform: 'translateY(-50%)'
|
773
773
|
});
|
774
|
+
var fitObj = fitCss ? {
|
775
|
+
objectFit: fitCss
|
776
|
+
} : {};
|
774
777
|
return system === 'ios' && showPlaceholders[index] && originWidth && originHeight ? /*#__PURE__*/_react.default.createElement("img", {
|
775
778
|
src: src,
|
776
779
|
style: (0, _extends5.default)({
|
@@ -779,7 +782,7 @@
|
|
779
782
|
height: originHeight,
|
780
783
|
left: originLeft,
|
781
784
|
top: originTop
|
782
|
-
}, trans)
|
785
|
+
}, fitObj, trans)
|
783
786
|
}) : null;
|
784
787
|
}
|
785
788
|
function renderLoadingArea(index) {
|
@@ -845,7 +848,7 @@
|
|
845
848
|
animateDuration: transImageInfo ? 0 : void 0,
|
846
849
|
style: getImageStyle(),
|
847
850
|
className: getImageClass(index),
|
848
|
-
bottomOverlap: renderImagePlaceholder(image.fallbackSrc || image.src, index),
|
851
|
+
bottomOverlap: renderImagePlaceholder(image.fallbackSrc || image.src, index, image.fit || fit),
|
849
852
|
onLoad: function onLoad(_, imageEle) {
|
850
853
|
imageDomsRef.current[index] = imageEle;
|
851
854
|
setImagesStatusByIndex(index, {
|
package/umd/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/umd/nav-bar/index.js
CHANGED
@@ -55,6 +55,7 @@
|
|
55
55
|
getScrollContainer = props.getScrollContainer,
|
56
56
|
_props$showOffset = props.showOffset,
|
57
57
|
showOffset = _props$showOffset === void 0 ? 0 : _props$showOffset,
|
58
|
+
onScrollChange = props.onScrollChange,
|
58
59
|
getComputedStyleByScroll = props.getComputedStyleByScroll,
|
59
60
|
_props$ariaLabel = props.ariaLabel,
|
60
61
|
ariaLabel = _props$ariaLabel === void 0 ? '' : _props$ariaLabel,
|
@@ -71,6 +72,7 @@
|
|
71
72
|
var system = (0, _helpers.useSystem)();
|
72
73
|
var onElementScroll = function onElementScroll(curOffset) {
|
73
74
|
setScrollToggleHide(curOffset < showOffset);
|
75
|
+
onScrollChange == null ? void 0 : onScrollChange(curOffset);
|
74
76
|
if (getComputedStyleByScroll) {
|
75
77
|
var cstyle = getComputedStyleByScroll(curOffset);
|
76
78
|
setCustomStyle(cstyle);
|
@@ -90,7 +92,7 @@
|
|
90
92
|
onElementScroll(top);
|
91
93
|
};
|
92
94
|
(0, _react.useEffect)(function () {
|
93
|
-
var needBind = showOffset || getComputedStyleByScroll;
|
95
|
+
var needBind = showOffset || getComputedStyleByScroll || onScrollChange;
|
94
96
|
var container = (0, _mobileUtils.getValidScrollContainer)(getScrollContainer);
|
95
97
|
handleEleScroll();
|
96
98
|
if (needBind && container) {
|
@@ -101,7 +103,7 @@
|
|
101
103
|
container.removeEventListener('scroll', handleEleScroll, false);
|
102
104
|
}
|
103
105
|
};
|
104
|
-
}, [showOffset, getComputedStyleByScroll, getScrollContainer]);
|
106
|
+
}, [showOffset, getComputedStyleByScroll, onScrollChange, getScrollContainer]);
|
105
107
|
function handleClickLeft(e) {
|
106
108
|
if (onClickLeft) {
|
107
109
|
onClickLeft(e);
|