@arco-design/mobile-react 2.30.4 → 2.30.6
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 +26 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/checkbox/style/css/index.css +3 -0
- package/cjs/checkbox/style/index.less +5 -0
- package/cjs/date-picker/index.js +46 -29
- package/cjs/dialog/style/css/index.css +88 -0
- package/cjs/dialog/style/index.less +16 -4
- package/cjs/dropdown-menu/helper.d.ts +1 -6
- package/cjs/dropdown-menu/helper.js +0 -10
- package/cjs/ellipsis/components/js-ellipsis.js +14 -17
- package/cjs/ellipsis/index.d.ts +2 -2
- package/cjs/ellipsis/index.js +2 -2
- package/cjs/image-preview/index.js +1 -0
- package/cjs/index-bar/style/css/index.css +28 -5
- package/cjs/index-bar/style/index.less +10 -10
- package/cjs/pagination/arrow.js +6 -3
- package/cjs/pagination/style/css/index.css +21 -6
- package/cjs/pagination/style/index.less +9 -9
- package/cjs/picker/style/css/index.css +8 -0
- package/cjs/picker/style/index.less +2 -2
- package/cjs/progress/style/css/index.css +20 -0
- package/cjs/progress/style/index.less +5 -5
- package/cjs/radio/style/css/index.css +3 -0
- package/cjs/radio/style/index.less +5 -0
- package/cjs/search-bar/style/css/index.css +18 -0
- package/cjs/search-bar/style/index.less +5 -5
- package/cjs/show-monitor/index.d.ts +5 -0
- package/cjs/show-monitor/index.js +1 -0
- package/cjs/slider/hooks/index.d.ts +1 -1
- package/cjs/slider/index.d.ts +10 -0
- package/cjs/slider/index.js +1 -0
- package/cjs/slider/thumb.d.ts +6 -5
- package/cjs/slider/thumb.js +19 -20
- package/dist/index.js +86 -57
- package/dist/index.min.js +2 -2
- package/dist/style.css +152 -11
- package/dist/style.min.css +1 -1
- package/esm/checkbox/style/css/index.css +3 -0
- package/esm/checkbox/style/index.less +5 -0
- package/esm/date-picker/index.js +44 -26
- package/esm/dialog/style/css/index.css +88 -0
- package/esm/dialog/style/index.less +16 -4
- package/esm/dropdown-menu/helper.d.ts +1 -6
- package/esm/dropdown-menu/helper.js +0 -8
- package/esm/ellipsis/components/js-ellipsis.js +14 -17
- package/esm/ellipsis/index.d.ts +2 -2
- package/esm/ellipsis/index.js +2 -2
- package/esm/image-preview/index.js +1 -0
- package/esm/index-bar/style/css/index.css +28 -5
- package/esm/index-bar/style/index.less +10 -10
- package/esm/pagination/arrow.js +6 -3
- package/esm/pagination/style/css/index.css +21 -6
- package/esm/pagination/style/index.less +9 -9
- package/esm/picker/style/css/index.css +8 -0
- package/esm/picker/style/index.less +2 -2
- package/esm/progress/style/css/index.css +20 -0
- package/esm/progress/style/index.less +5 -5
- package/esm/radio/style/css/index.css +3 -0
- package/esm/radio/style/index.less +5 -0
- package/esm/search-bar/style/css/index.css +18 -0
- package/esm/search-bar/style/index.less +5 -5
- package/esm/show-monitor/index.d.ts +5 -0
- package/esm/show-monitor/index.js +1 -0
- package/esm/slider/hooks/index.d.ts +1 -1
- package/esm/slider/index.d.ts +10 -0
- package/esm/slider/index.js +1 -0
- package/esm/slider/thumb.d.ts +6 -5
- package/esm/slider/thumb.js +19 -17
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +3 -4
- package/tokens/app/arcodesign/default/index.d.ts +0 -1
- package/tokens/app/arcodesign/default/index.js +3 -4
- package/tokens/app/arcodesign/default/index.json +9 -21
- package/tokens/app/arcodesign/default/index.less +3 -4
- package/umd/checkbox/style/css/index.css +3 -0
- package/umd/checkbox/style/index.less +5 -0
- package/umd/date-picker/index.js +47 -30
- package/umd/dialog/style/css/index.css +88 -0
- package/umd/dialog/style/index.less +16 -4
- package/umd/dropdown-menu/helper.d.ts +1 -6
- package/umd/dropdown-menu/helper.js +0 -10
- package/umd/ellipsis/components/js-ellipsis.js +14 -17
- package/umd/ellipsis/index.d.ts +2 -2
- package/umd/ellipsis/index.js +2 -2
- package/umd/image-preview/index.js +1 -0
- package/umd/index-bar/style/css/index.css +28 -5
- package/umd/index-bar/style/index.less +10 -10
- package/umd/pagination/arrow.js +6 -3
- package/umd/pagination/style/css/index.css +21 -6
- package/umd/pagination/style/index.less +9 -9
- package/umd/picker/style/css/index.css +8 -0
- package/umd/picker/style/index.less +2 -2
- package/umd/progress/style/css/index.css +20 -0
- package/umd/progress/style/index.less +5 -5
- package/umd/radio/style/css/index.css +3 -0
- package/umd/radio/style/index.less +5 -0
- package/umd/search-bar/style/css/index.css +18 -0
- package/umd/search-bar/style/index.less +5 -5
- package/umd/show-monitor/index.d.ts +5 -0
- package/umd/show-monitor/index.js +1 -0
- package/umd/slider/hooks/index.d.ts +1 -1
- package/umd/slider/index.d.ts +10 -0
- package/umd/slider/index.js +1 -0
- package/umd/slider/thumb.d.ts +6 -5
- package/umd/slider/thumb.js +23 -23
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,32 @@
|
|
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.30.6](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.30.5...@arco-design/mobile-react@2.30.6) (2023-12-26)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* optimize `Ellipsis` height calculation ([#216](https://github.com/arco-design/arco-design-mobile/issues/216)) ([555723f](https://github.com/arco-design/arco-design-mobile/commit/555723f0091b6f0e28523a0aa37394bceacd6dc5))
|
12
|
+
* remove system default outline on iOS low-end machine of `Radio` & `Checkbox` ([#215](https://github.com/arco-design/arco-design-mobile/issues/215)) ([76dc29a](https://github.com/arco-design/arco-design-mobile/commit/76dc29ad26a1dcd37ab8935d8fbcebaa9ebe134f))
|
13
|
+
* resolve `DatePicker` rangeTs computed error ([#214](https://github.com/arco-design/arco-design-mobile/issues/214)) ([3dede0b](https://github.com/arco-design/arco-design-mobile/commit/3dede0bca7f0214d5e2b802038cafcc9390b2727))
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
## [2.30.5](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.30.4...@arco-design/mobile-react@2.30.5) (2023-12-19)
|
20
|
+
|
21
|
+
|
22
|
+
### Bug Fixes
|
23
|
+
|
24
|
+
* `ImagePreview` disable duplicate preventDefault ([#212](https://github.com/arco-design/arco-design-mobile/issues/212)) ([d91d251](https://github.com/arco-design/arco-design-mobile/commit/d91d251a64bd64ae914e88c119dda442bd72d722))
|
25
|
+
* `Slider` support custom "Popover" element ([#211](https://github.com/arco-design/arco-design-mobile/issues/211)) ([716dda1](https://github.com/arco-design/arco-design-mobile/commit/716dda1d273d3b77aa5072d2b3849776790c01e3))
|
26
|
+
* rtl for `Progress`, `Pagination`, `Picker`, `SearchBar`, `Dialog`, `IndexBar` ([#213](https://github.com/arco-design/arco-design-mobile/issues/213)) ([498a777](https://github.com/arco-design/arco-design-mobile/commit/498a777992fc44410944ddc17bd2090c9b06a2f2))
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
6
32
|
## [2.30.4](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.30.3...@arco-design/mobile-react@2.30.4) (2023-12-14)
|
7
33
|
|
8
34
|
|
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.30.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.30.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.30.5/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.30.5/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.30.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.30.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.30.5/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.30.5/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
package/cjs/date-picker/index.js
CHANGED
@@ -8,7 +8,7 @@ var _exportNames = {
|
|
8
8
|
};
|
9
9
|
exports.default = exports.YEAR = void 0;
|
10
10
|
|
11
|
-
var
|
11
|
+
var _extends4 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
12
12
|
|
13
13
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
14
14
|
|
@@ -100,10 +100,8 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
100
100
|
});
|
101
101
|
|
102
102
|
function _getColumns() {
|
103
|
-
var dateObj =
|
104
|
-
|
105
|
-
dateObj[type] = _getActualArray(type, currentDateObjRef.current);
|
106
|
-
});
|
103
|
+
var dateObj = _getActualArray();
|
104
|
+
|
107
105
|
var columns = keyOptions.map(function (opt) {
|
108
106
|
return dateObj[opt];
|
109
107
|
});
|
@@ -147,32 +145,51 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
147
145
|
// @en Dynamically change the options of other columns based on the currently selected date
|
148
146
|
|
149
147
|
|
150
|
-
function _getActualArray(
|
151
|
-
var
|
152
|
-
|
153
|
-
var range = [];
|
154
|
-
|
155
|
-
switch (type) {
|
156
|
-
case 'year':
|
157
|
-
range = [minDateObjRef.current.year, maxDateObjRef.current.year];
|
158
|
-
break;
|
159
|
-
|
160
|
-
default:
|
161
|
-
{
|
162
|
-
var checkKeys = allTypes.slice(0, allTypes.indexOf(type));
|
163
|
-
range = normalRange;
|
164
|
-
|
165
|
-
if ((0, _helper.judgeObj)(nowDateObj, minDateObjRef.current, checkKeys)) {
|
166
|
-
range[0] = minDateObjRef.current[type];
|
167
|
-
}
|
148
|
+
function _getActualArray() {
|
149
|
+
var dateObj = {}; // 当前时间对象
|
150
|
+
// @en current Date object
|
168
151
|
|
169
|
-
|
170
|
-
|
152
|
+
var currentDateObj = (0, _extends4.default)({}, currentDateObjRef.current);
|
153
|
+
allTypes.forEach(function (type) {
|
154
|
+
// 根据日期类型,计算出默认的日期范围
|
155
|
+
// @en According to the date type, calculate the default date range.
|
156
|
+
var normalRange = _getNormalRange(type, currentDateObj);
|
157
|
+
|
158
|
+
var range = [];
|
159
|
+
|
160
|
+
switch (type) {
|
161
|
+
case 'year':
|
162
|
+
// 默认使用minTs和maxTs年份区间
|
163
|
+
// @en Default use minTs and maxTs years.
|
164
|
+
range = [minDateObjRef.current.year, maxDateObjRef.current.year];
|
165
|
+
break;
|
166
|
+
|
167
|
+
default:
|
168
|
+
{
|
169
|
+
// 除了年份外,其他日期类型都需要判断上一级日期是否相同
|
170
|
+
// @en In addition to the year, other date types need to check if the upper-level date is the same.
|
171
|
+
var checkKeys = allTypes.slice(0, allTypes.indexOf(type));
|
172
|
+
range = normalRange;
|
173
|
+
|
174
|
+
if ((0, _helper.judgeObj)(currentDateObj, minDateObjRef.current, checkKeys)) {
|
175
|
+
var _extends2;
|
176
|
+
|
177
|
+
range[0] = minDateObjRef.current[type];
|
178
|
+
currentDateObj = (0, _extends4.default)({}, currentDateObj, (_extends2 = {}, _extends2[type] = Math.max(minDateObjRef.current[type], currentDateObj[type]), _extends2));
|
179
|
+
}
|
180
|
+
|
181
|
+
if ((0, _helper.judgeObj)(currentDateObj, maxDateObjRef.current, checkKeys)) {
|
182
|
+
var _extends3;
|
183
|
+
|
184
|
+
range[range.length - 1] = maxDateObjRef.current[type];
|
185
|
+
currentDateObj = (0, _extends4.default)({}, currentDateObj, (_extends3 = {}, _extends3[type] = Math.min(maxDateObjRef.current[type], currentDateObj[type]), _extends3));
|
186
|
+
}
|
171
187
|
}
|
172
|
-
|
173
|
-
}
|
188
|
+
}
|
174
189
|
|
175
|
-
|
190
|
+
dateObj[type] = _convertRangeToArr(type, range);
|
191
|
+
});
|
192
|
+
return dateObj;
|
176
193
|
}
|
177
194
|
|
178
195
|
function _convertRangeToArr(type, range) {
|
@@ -320,7 +337,7 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
320
337
|
}, [visible]);
|
321
338
|
return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
|
322
339
|
var prefixCls = _ref.prefixCls;
|
323
|
-
return /*#__PURE__*/_react.default.createElement(_picker.default, (0,
|
340
|
+
return /*#__PURE__*/_react.default.createElement(_picker.default, (0, _extends4.default)({}, otherProps, {
|
324
341
|
ref: pickerRef,
|
325
342
|
visible: visible,
|
326
343
|
className: (0, _mobileUtils.cls)(className, prefixCls + "-date-picker"),
|
@@ -655,6 +655,10 @@
|
|
655
655
|
.arco-dialog-body.left {
|
656
656
|
text-align: left;
|
657
657
|
}
|
658
|
+
[dir="rtl"] .arco-dialog-header.left,
|
659
|
+
[dir="rtl"] .arco-dialog-body.left {
|
660
|
+
text-align: right;
|
661
|
+
}
|
658
662
|
.arco-dialog-header.center,
|
659
663
|
.arco-dialog-body.center {
|
660
664
|
text-align: center;
|
@@ -663,6 +667,10 @@
|
|
663
667
|
.arco-dialog-body.right {
|
664
668
|
text-align: right;
|
665
669
|
}
|
670
|
+
[dir="rtl"] .arco-dialog-header.right,
|
671
|
+
[dir="rtl"] .arco-dialog-body.right {
|
672
|
+
text-align: left;
|
673
|
+
}
|
666
674
|
.arco-dialog-header.android,
|
667
675
|
.arco-dialog-body.sub-title.android {
|
668
676
|
padding-top: 0.4rem ;
|
@@ -693,6 +701,9 @@
|
|
693
701
|
justify-content: flex-end;
|
694
702
|
text-align: right;
|
695
703
|
}
|
704
|
+
[dir="rtl"] .arco-dialog-footer.android {
|
705
|
+
text-align: left;
|
706
|
+
}
|
696
707
|
.arco-dialog-footer.android .dialog-footer-button {
|
697
708
|
color: #1a74ff ;
|
698
709
|
font-size: 0.3rem ;
|
@@ -701,6 +712,10 @@
|
|
701
712
|
.arco-dialog-footer.android .dialog-footer-button:not(:last-child) {
|
702
713
|
margin-right: 0.56rem ;
|
703
714
|
}
|
715
|
+
[dir="rtl"] .arco-dialog-footer.android .dialog-footer-button:not(:last-child) {
|
716
|
+
margin-right: initial;
|
717
|
+
margin-left: 0.56rem ;
|
718
|
+
}
|
704
719
|
.arco-dialog-footer.ios {
|
705
720
|
overflow: hidden;
|
706
721
|
}
|
@@ -793,6 +808,44 @@
|
|
793
808
|
border-radius: 0;
|
794
809
|
}
|
795
810
|
}
|
811
|
+
[dir='rtl'] .arco-dialog-footer.ios:not(.collapsed):not(.type-button) .dialog-footer-button:not(:last-child) {
|
812
|
+
position: relative;
|
813
|
+
border-width: 0;
|
814
|
+
}
|
815
|
+
[dir='rtl'] .arco-dialog-footer.ios:not(.collapsed):not(.type-button) .dialog-footer-button:not(:last-child)::before {
|
816
|
+
content: '';
|
817
|
+
width: 1PX;
|
818
|
+
height: 100%;
|
819
|
+
position: absolute;
|
820
|
+
left: 0;
|
821
|
+
top: 0;
|
822
|
+
z-index: 1;
|
823
|
+
border-left-style: solid;
|
824
|
+
border-left-width: 1PX;
|
825
|
+
border-left-color: #e5e6eb;
|
826
|
+
box-sizing: border-box;
|
827
|
+
transform-origin: left top;
|
828
|
+
-webkit-transform-origin: left top;
|
829
|
+
pointer-events: none;
|
830
|
+
border-radius: 0;
|
831
|
+
}
|
832
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
833
|
+
[dir='rtl'] .arco-dialog-footer.ios:not(.collapsed):not(.type-button) .dialog-footer-button:not(:last-child)::before {
|
834
|
+
transform: scaleX(0.5);
|
835
|
+
-webkit-transform: scaleX(0.5);
|
836
|
+
border-radius: 0;
|
837
|
+
}
|
838
|
+
}
|
839
|
+
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
|
840
|
+
[dir='rtl'] .arco-dialog-footer.ios:not(.collapsed):not(.type-button) .dialog-footer-button:not(:last-child)::before {
|
841
|
+
transform: scaleX(0.33333333);
|
842
|
+
-webkit-transform: scaleX(0.33333333);
|
843
|
+
border-radius: 0;
|
844
|
+
}
|
845
|
+
}
|
846
|
+
[dir='rtl'] .arco-dialog-footer.ios:not(.collapsed):not(.type-button) .dialog-footer-button:not(:last-child)::after {
|
847
|
+
display: none;
|
848
|
+
}
|
796
849
|
.arco-dialog-footer.ios.collapsed {
|
797
850
|
-webkit-box-orient: vertical;
|
798
851
|
-webkit-box-direction: normal;
|
@@ -962,6 +1015,41 @@
|
|
962
1015
|
border-radius: 0;
|
963
1016
|
}
|
964
1017
|
}
|
1018
|
+
.arco-theme-dark [dir='rtl'] .arco-dialog-footer.ios:not(.collapsed):not(.type-button) .dialog-footer-button:not(:last-child) {
|
1019
|
+
position: relative;
|
1020
|
+
border-width: 0;
|
1021
|
+
}
|
1022
|
+
.arco-theme-dark [dir='rtl'] .arco-dialog-footer.ios:not(.collapsed):not(.type-button) .dialog-footer-button:not(:last-child)::before {
|
1023
|
+
content: '';
|
1024
|
+
width: 1PX;
|
1025
|
+
height: 100%;
|
1026
|
+
position: absolute;
|
1027
|
+
left: 0;
|
1028
|
+
top: 0;
|
1029
|
+
z-index: 1;
|
1030
|
+
border-left-style: solid;
|
1031
|
+
border-left-width: 1PX;
|
1032
|
+
border-left-color: #484849;
|
1033
|
+
box-sizing: border-box;
|
1034
|
+
transform-origin: left top;
|
1035
|
+
-webkit-transform-origin: left top;
|
1036
|
+
pointer-events: none;
|
1037
|
+
border-radius: 0;
|
1038
|
+
}
|
1039
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
1040
|
+
.arco-theme-dark [dir='rtl'] .arco-dialog-footer.ios:not(.collapsed):not(.type-button) .dialog-footer-button:not(:last-child)::before {
|
1041
|
+
transform: scaleX(0.5);
|
1042
|
+
-webkit-transform: scaleX(0.5);
|
1043
|
+
border-radius: 0;
|
1044
|
+
}
|
1045
|
+
}
|
1046
|
+
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
|
1047
|
+
.arco-theme-dark [dir='rtl'] .arco-dialog-footer.ios:not(.collapsed):not(.type-button) .dialog-footer-button:not(:last-child)::before {
|
1048
|
+
transform: scaleX(0.33333333);
|
1049
|
+
-webkit-transform: scaleX(0.33333333);
|
1050
|
+
border-radius: 0;
|
1051
|
+
}
|
1052
|
+
}
|
965
1053
|
.arco-theme-dark .arco-dialog-footer.ios.collapsed .dialog-footer-button {
|
966
1054
|
position: relative;
|
967
1055
|
border-width: 0;
|
@@ -147,7 +147,7 @@
|
|
147
147
|
&-body {
|
148
148
|
|
149
149
|
&.left {
|
150
|
-
text-align
|
150
|
+
.set-value-with-rtl(text-align, left);
|
151
151
|
}
|
152
152
|
|
153
153
|
&.center {
|
@@ -155,7 +155,7 @@
|
|
155
155
|
}
|
156
156
|
|
157
157
|
&.right {
|
158
|
-
text-align
|
158
|
+
.set-value-with-rtl(text-align, right);
|
159
159
|
}
|
160
160
|
}
|
161
161
|
|
@@ -185,7 +185,7 @@
|
|
185
185
|
.use-var(padding-top, dialog-android-body-footer-gutter);
|
186
186
|
.use-var(padding-bottom, dialog-android-vertical-padding);
|
187
187
|
justify-content: flex-end;
|
188
|
-
text-align
|
188
|
+
.set-value-with-rtl(text-align, right);
|
189
189
|
|
190
190
|
.dialog-footer-button {
|
191
191
|
.use-var(color, dialog-footer-android-color);
|
@@ -193,7 +193,7 @@
|
|
193
193
|
.use-var(line-height, dialog-footer-android-line-height);
|
194
194
|
|
195
195
|
&:not(:last-child) {
|
196
|
-
.use-var(margin-right, dialog-footer-android-button-gutter);
|
196
|
+
.use-var-with-rtl(margin-right, dialog-footer-android-button-gutter);
|
197
197
|
}
|
198
198
|
}
|
199
199
|
}
|
@@ -218,6 +218,13 @@
|
|
218
218
|
|
219
219
|
&:not(:last-child) {
|
220
220
|
.onepx-border-var(right, line-color);
|
221
|
+
|
222
|
+
[dir='rtl'] & {
|
223
|
+
.onepx-border-var(left, line-color);
|
224
|
+
&::after {
|
225
|
+
display: none;
|
226
|
+
}
|
227
|
+
}
|
221
228
|
}
|
222
229
|
}
|
223
230
|
}
|
@@ -332,6 +339,11 @@
|
|
332
339
|
@{arco-dark-mode-selector} & {
|
333
340
|
.onepx-border-var(right, dark-line-color);
|
334
341
|
}
|
342
|
+
[dir='rtl'] & {
|
343
|
+
@{arco-dark-mode-selector} & {
|
344
|
+
.onepx-border-var(left, dark-line-color);
|
345
|
+
}
|
346
|
+
}
|
335
347
|
}
|
336
348
|
}
|
337
349
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React
|
1
|
+
import React from 'react';
|
2
2
|
import { OptionsItem } from '../dropdown';
|
3
3
|
import { CascadeOptions, ValueType } from './type';
|
4
4
|
/**
|
@@ -11,11 +11,6 @@ export declare function isStringArray(options: string[] | OptionsItem[][] | Casc
|
|
11
11
|
* @en Determine if it is a nested array
|
12
12
|
* */
|
13
13
|
export declare function isCascadeArray(options: string[] | OptionsItem[][] | CascadeOptions[]): options is CascadeOptions[];
|
14
|
-
/**
|
15
|
-
* 判断是否为string类型
|
16
|
-
* @en Determine whether it is of type string
|
17
|
-
*/
|
18
|
-
export declare function isString(icon: string | ReactNode): icon is string;
|
19
14
|
/**
|
20
15
|
* 格式化传入的数组
|
21
16
|
* @en format the input array
|
@@ -6,7 +6,6 @@ exports.__esModule = true;
|
|
6
6
|
exports.getFormattedOptions = void 0;
|
7
7
|
exports.isCascadeArray = isCascadeArray;
|
8
8
|
exports.isRefDom = exports.isClassNameDom = void 0;
|
9
|
-
exports.isString = isString;
|
10
9
|
exports.isStringArray = isStringArray;
|
11
10
|
|
12
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
@@ -29,15 +28,6 @@ function isStringArray(options) {
|
|
29
28
|
function isCascadeArray(options) {
|
30
29
|
return typeof options[0] === 'object' && !(0, _mobileUtils.isArray)(options[0]);
|
31
30
|
}
|
32
|
-
/**
|
33
|
-
* 判断是否为string类型
|
34
|
-
* @en Determine whether it is of type string
|
35
|
-
*/
|
36
|
-
|
37
|
-
|
38
|
-
function isString(icon) {
|
39
|
-
return typeof icon === 'string';
|
40
|
-
}
|
41
31
|
/**
|
42
32
|
* 格式化传入的数组
|
43
33
|
* @en format the input array
|
@@ -50,6 +50,13 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
50
50
|
}
|
51
51
|
}
|
52
52
|
|
53
|
+
function getActualHeight(container) {
|
54
|
+
var _container$getBoundin = container.getBoundingClientRect(),
|
55
|
+
height = _container$getBoundin.height;
|
56
|
+
|
57
|
+
return Math.round(height);
|
58
|
+
}
|
59
|
+
|
53
60
|
function truncateText(container, textContainer, max) {
|
54
61
|
var content = textContainer.textContent || '';
|
55
62
|
var currentText = '';
|
@@ -65,11 +72,9 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
65
72
|
|
66
73
|
var temp = content.slice(l, m);
|
67
74
|
textContainer.innerText = currentText + temp;
|
75
|
+
var actualHeight = getActualHeight(container);
|
68
76
|
|
69
|
-
|
70
|
-
height = _container$getBoundin.height;
|
71
|
-
|
72
|
-
if (height > max) {
|
77
|
+
if (actualHeight > max) {
|
73
78
|
r = m;
|
74
79
|
} else {
|
75
80
|
currentText += temp;
|
@@ -90,6 +95,7 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
90
95
|
function truncateHTML(container, textContainer, max) {
|
91
96
|
// only enter this function when container overflow.
|
92
97
|
var children = textContainer.childNodes;
|
98
|
+
var actualHeight = getActualHeight(container);
|
93
99
|
|
94
100
|
if (children.length === 1) {
|
95
101
|
var node = children[0];
|
@@ -101,10 +107,7 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
101
107
|
|
102
108
|
node.innerHTML = '';
|
103
109
|
|
104
|
-
|
105
|
-
height = _container$getBoundin2.height;
|
106
|
-
|
107
|
-
if (height > max) {
|
110
|
+
if (actualHeight > max) {
|
108
111
|
// return after remove the node, if overflow with empty node.
|
109
112
|
textContainer.removeChild(node);
|
110
113
|
handleOnReflow(true, textContainer.innerHTML);
|
@@ -123,10 +126,7 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
123
126
|
while (i < nodes.length) {
|
124
127
|
textContainer.appendChild(nodes[i]);
|
125
128
|
|
126
|
-
|
127
|
-
_height = _container$getBoundin3.height;
|
128
|
-
|
129
|
-
if (_height > max) {
|
129
|
+
if (actualHeight > max) {
|
130
130
|
if (nodes[i].childNodes && nodes[i].childNodes.length) {
|
131
131
|
break;
|
132
132
|
} else {
|
@@ -166,13 +166,10 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
166
166
|
}
|
167
167
|
|
168
168
|
textRef.current.classList.remove(prefixCls + "-js-content-text-pre");
|
169
|
-
|
170
|
-
var _domRef$current$getBo = domRef.current.getBoundingClientRect(),
|
171
|
-
height = _domRef$current$getBo.height;
|
172
|
-
|
169
|
+
var actualHeight = getActualHeight(domRef.current);
|
173
170
|
var max = isNaN(Number(maxHeight)) ? lineHeightRef.current * maxLine : Number(maxHeight);
|
174
171
|
|
175
|
-
if (
|
172
|
+
if (actualHeight <= max) {
|
176
173
|
handleOnReflow(false, text);
|
177
174
|
return;
|
178
175
|
}
|
package/cjs/ellipsis/index.d.ts
CHANGED
@@ -2,8 +2,8 @@ import React from 'react';
|
|
2
2
|
import { EllipsisProps, EllipsisRef } from './type';
|
3
3
|
export * from './type';
|
4
4
|
/**
|
5
|
-
*
|
6
|
-
* @en Text ellipsis component supports multi-line abbreviations, rich text, custom abbreviations, tail character filtering, etc.
|
5
|
+
* 文本缩略组件,支持多行缩略、富文本、自定义缩略符、尾字符过滤等。如果传入的文本内容中包含换行符号`\n`,建议将`\n`替换为`<br/>`,并设置`dangerouslyUseInnerHTML=true`。
|
6
|
+
* @en Text ellipsis component supports multi-line abbreviations, rich text, custom abbreviations, tail character filtering, etc. If the incoming text contains newline characters `\n`, it is recommended to replace `\n` with `<br/>`, and set `dangerouslyUseInnerHTML=true`.
|
7
7
|
* @type 信息展示
|
8
8
|
* @type_en Data Display
|
9
9
|
* @name 文本缩略
|
package/cjs/ellipsis/index.js
CHANGED
@@ -32,8 +32,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
32
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
33
33
|
|
34
34
|
/**
|
35
|
-
*
|
36
|
-
* @en Text ellipsis component supports multi-line abbreviations, rich text, custom abbreviations, tail character filtering, etc.
|
35
|
+
* 文本缩略组件,支持多行缩略、富文本、自定义缩略符、尾字符过滤等。如果传入的文本内容中包含换行符号`\n`,建议将`\n`替换为`<br/>`,并设置`dangerouslyUseInnerHTML=true`。
|
36
|
+
* @en Text ellipsis component supports multi-line abbreviations, rich text, custom abbreviations, tail character filtering, etc. If the incoming text contains newline characters `\n`, it is recommended to replace `\n` with `<br/>`, and set `dangerouslyUseInnerHTML=true`.
|
37
37
|
* @type 信息展示
|
38
38
|
* @type_en Data Display
|
39
39
|
* @name 文本缩略
|
@@ -522,6 +522,10 @@
|
|
522
522
|
-webkit-align-items: center;
|
523
523
|
align-items: center;
|
524
524
|
}
|
525
|
+
[dir="rtl"] .arco-index-bar-group-title {
|
526
|
+
padding-left: initial;
|
527
|
+
padding-right: 0.32rem ;
|
528
|
+
}
|
525
529
|
.arco-index-bar-group-item {
|
526
530
|
height: 1.08rem ;
|
527
531
|
display: -webkit-box;
|
@@ -533,6 +537,10 @@
|
|
533
537
|
margin-left: 0.32rem ;
|
534
538
|
font-size: 0.32rem ;
|
535
539
|
}
|
540
|
+
[dir="rtl"] .arco-index-bar-group-item {
|
541
|
+
margin-left: initial;
|
542
|
+
margin-right: 0.32rem ;
|
543
|
+
}
|
536
544
|
.arco-index-bar-group-item:not(:last-child) {
|
537
545
|
position: relative;
|
538
546
|
border-width: 0;
|
@@ -578,9 +586,13 @@
|
|
578
586
|
-webkit-user-select: none;
|
579
587
|
user-select: none;
|
580
588
|
}
|
581
|
-
.arco-index-bar-sidebar
|
589
|
+
[dir="rtl"] .arco-index-bar-sidebar {
|
590
|
+
right: initial;
|
582
591
|
left: 0;
|
583
592
|
}
|
593
|
+
.arco-index-bar-sidebar-touching {
|
594
|
+
width: 100%;
|
595
|
+
}
|
584
596
|
.arco-index-bar-sidebar-item {
|
585
597
|
display: -webkit-box;
|
586
598
|
display: -webkit-flex;
|
@@ -623,25 +635,36 @@
|
|
623
635
|
border-radius: 9999px;
|
624
636
|
text-align: center;
|
625
637
|
padding: 0 0.16rem ;
|
626
|
-
background:
|
638
|
+
background: #333333 ;
|
627
639
|
right: 0.72rem ;
|
628
640
|
font-size: 0.48rem ;
|
629
641
|
color: #FFFFFF ;
|
630
642
|
}
|
643
|
+
[dir="rtl"] .arco-index-bar-sidebar-sweat {
|
644
|
+
right: initial;
|
645
|
+
left: 0.72rem ;
|
646
|
+
}
|
631
647
|
.arco-index-bar-sidebar-sweat::before {
|
632
648
|
content: '';
|
633
649
|
position: absolute;
|
634
650
|
top: 0;
|
635
651
|
bottom: 0;
|
636
652
|
margin: auto;
|
637
|
-
right: -0.
|
653
|
+
right: -0.56rem ;
|
638
654
|
width: 0;
|
639
655
|
height: 0;
|
640
656
|
border: 0.36rem solid transparent ;
|
641
|
-
border:
|
642
|
-
border-left-color: rgba(0, 0, 0, 0.8) ;
|
657
|
+
border-left-color: #333333 ;
|
643
658
|
border-radius: 4px;
|
644
659
|
}
|
660
|
+
[dir="rtl"] .arco-index-bar-sidebar-sweat::before {
|
661
|
+
right: initial;
|
662
|
+
left: -0.56rem ;
|
663
|
+
}
|
664
|
+
[dir="rtl"] .arco-index-bar-sidebar-sweat::before {
|
665
|
+
border-left-color: initial;
|
666
|
+
border-right-color: #333333 ;
|
667
|
+
}
|
645
668
|
.arco-index-bar-sidebar-toast {
|
646
669
|
position: absolute;
|
647
670
|
background: rgba(0, 0, 0, 0.8) ;
|
@@ -18,7 +18,7 @@
|
|
18
18
|
.use-var(color, index-bar-group-active-color);
|
19
19
|
}
|
20
20
|
&-title {
|
21
|
-
.use-var(padding-left, index-bar-group-left-spacing);
|
21
|
+
.use-var-with-rtl(padding-left, index-bar-group-left-spacing);
|
22
22
|
.use-var(height, index-bar-group-title-height);
|
23
23
|
.use-var(background, index-bar-group-title-background);
|
24
24
|
.use-var(font-size, index-bar-group-title-font-size);
|
@@ -30,7 +30,7 @@
|
|
30
30
|
.use-var(height, index-bar-group-item-height);
|
31
31
|
display: flex;
|
32
32
|
align-items: center;
|
33
|
-
.use-var(margin-left, index-bar-group-left-spacing);
|
33
|
+
.use-var-with-rtl(margin-left, index-bar-group-left-spacing);
|
34
34
|
.use-var(font-size, index-bar-group-item-font-size);
|
35
35
|
|
36
36
|
&:not(:last-child) {
|
@@ -40,16 +40,17 @@
|
|
40
40
|
}
|
41
41
|
|
42
42
|
&-sidebar {
|
43
|
-
&-touching {
|
44
|
-
left: 0;
|
45
|
-
}
|
46
43
|
position: absolute;
|
47
44
|
z-index: 2;
|
48
|
-
right
|
45
|
+
.set-prop-with-rtl(right, 0);
|
49
46
|
top: 50%;
|
50
47
|
transform: translateY(-50%) translateZ(0);
|
51
48
|
user-select: none;
|
52
49
|
|
50
|
+
&-touching {
|
51
|
+
width: 100%;
|
52
|
+
}
|
53
|
+
|
53
54
|
&-item {
|
54
55
|
display: flex;
|
55
56
|
justify-content: flex-end;
|
@@ -84,7 +85,7 @@
|
|
84
85
|
text-align: center;
|
85
86
|
.use-var(padding, index-bar-sidebar-sweat-padding);
|
86
87
|
.use-var(background, index-bar-sidebar-sweat-background);
|
87
|
-
.use-var(right, index-bar-sidebar-sweat-right);
|
88
|
+
.use-var-with-rtl(right, index-bar-sidebar-sweat-right);
|
88
89
|
.use-var(font-size, index-bar-sidebar-sweat-font-size);
|
89
90
|
.use-var(color, index-bar-sidebar-sweat-color);
|
90
91
|
&::before {
|
@@ -93,12 +94,11 @@
|
|
93
94
|
top: 0;
|
94
95
|
bottom: 0;
|
95
96
|
margin: auto;
|
96
|
-
.use-var(right, index-bar-sidebar-sweat-triangle-position);
|
97
|
+
.use-var-with-rtl(right, index-bar-sidebar-sweat-triangle-position);
|
97
98
|
width: 0;
|
98
99
|
height: 0;
|
99
100
|
.use-var(border, index-bar-sidebar-sweat-triangle-border);
|
100
|
-
border
|
101
|
-
.use-var(border-left-color, index-bar-sidebar-sweat-background);
|
101
|
+
.use-var-with-rtl(border-left-color, index-bar-sidebar-sweat-background);
|
102
102
|
border-radius: 4px;
|
103
103
|
}
|
104
104
|
}
|