@arco-design/mobile-react 2.27.4 → 2.28.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 +33 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/hooks.d.ts +1 -0
- package/cjs/_helpers/hooks.js +44 -28
- package/cjs/action-sheet/index.d.ts +2 -2
- package/cjs/badge/index.js +2 -1
- package/cjs/badge/style/css/index.css +12 -0
- package/cjs/badge/style/index.less +3 -3
- package/cjs/button/style/css/index.css +4 -0
- package/cjs/button/style/index.less +1 -1
- package/cjs/cell/style/css/index.css +7 -0
- package/cjs/cell/style/index.less +4 -1
- package/cjs/checkbox/style/css/index.css +13 -0
- package/cjs/checkbox/style/index.less +3 -3
- package/cjs/collapse/collapse.js +12 -6
- package/cjs/dialog/index.d.ts +2 -2
- package/cjs/form/style/css/index.css +16 -0
- package/cjs/form/style/index.less +4 -4
- package/cjs/image-preview/index.d.ts +2 -2
- package/cjs/image-preview/index.js +4 -2
- package/cjs/image-preview/style/css/index.css +3 -0
- package/cjs/image-preview/style/index.less +4 -0
- package/cjs/index.d.ts +12 -12
- package/cjs/index.js +46 -46
- package/cjs/load-more/index.d.ts +5 -0
- package/cjs/load-more/index.js +2 -1
- package/cjs/masking/index.d.ts +2 -2
- package/cjs/masking/index.js +4 -2
- package/cjs/notify/index.d.ts +8 -8
- package/cjs/popover/popover.js +10 -2
- package/cjs/popup/index.d.ts +2 -2
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/cjs/radio/style/css/index.css +8 -0
- package/cjs/radio/style/index.less +2 -2
- package/cjs/rate/index.js +5 -3
- package/cjs/rate/style/css/index.css +4 -0
- package/cjs/rate/style/index.less +4 -0
- package/cjs/slider/hooks/index.d.ts +1 -1
- package/cjs/slider/popover.js +6 -2
- package/cjs/stepper/hooks/useButtonClick.js +8 -9
- package/cjs/sticky/index.d.ts +5 -0
- package/cjs/sticky/index.js +20 -7
- package/cjs/style.d.ts +13 -13
- package/cjs/style.js +24 -24
- package/cjs/switch/index.js +7 -2
- package/cjs/switch/style/css/index.css +44 -0
- package/cjs/switch/style/index.less +19 -7
- package/cjs/tabs/demo/style/css/mobile.css +11 -0
- package/cjs/tabs/demo/style/mobile.less +5 -1
- package/cjs/tabs/index.js +14 -5
- package/cjs/tabs/style/css/index.css +32 -7
- package/cjs/tabs/style/index.less +9 -14
- package/cjs/tabs/tab-cell-underline.js +14 -5
- package/cjs/tabs/tab-cell.js +15 -7
- package/cjs/tabs/tab-pane.js +4 -3
- package/cjs/tabs/type.d.ts +1 -0
- package/cjs/toast/index.d.ts +12 -12
- package/cjs/toast/index.js +5 -2
- package/dist/index.js +13914 -13836
- package/dist/index.min.js +4 -4
- package/dist/style.css +3366 -3236
- package/dist/style.min.css +1 -1
- package/esm/_helpers/hooks.d.ts +1 -0
- package/esm/_helpers/hooks.js +43 -29
- package/esm/action-sheet/index.d.ts +2 -2
- package/esm/badge/index.js +2 -1
- package/esm/badge/style/css/index.css +12 -0
- package/esm/badge/style/index.less +3 -3
- package/esm/button/style/css/index.css +4 -0
- package/esm/button/style/index.less +1 -1
- package/esm/cell/style/css/index.css +7 -0
- package/esm/cell/style/index.less +4 -1
- package/esm/checkbox/style/css/index.css +13 -0
- package/esm/checkbox/style/index.less +3 -3
- package/esm/collapse/collapse.js +14 -8
- package/esm/dialog/index.d.ts +2 -2
- package/esm/form/style/css/index.css +16 -0
- package/esm/form/style/index.less +4 -4
- package/esm/image-preview/index.d.ts +2 -2
- package/esm/image-preview/index.js +4 -2
- package/esm/image-preview/style/css/index.css +3 -0
- package/esm/image-preview/style/index.less +4 -0
- package/esm/index.d.ts +12 -12
- package/esm/index.js +12 -12
- package/esm/load-more/index.d.ts +5 -0
- package/esm/load-more/index.js +2 -1
- package/esm/masking/index.d.ts +2 -2
- package/esm/masking/index.js +4 -2
- package/esm/notify/index.d.ts +8 -8
- package/esm/popover/popover.js +10 -2
- package/esm/popup/index.d.ts +2 -2
- package/esm/popup-swiper/index.d.ts +2 -2
- package/esm/radio/style/css/index.css +8 -0
- package/esm/radio/style/index.less +2 -2
- package/esm/rate/index.js +5 -3
- package/esm/rate/style/css/index.css +4 -0
- package/esm/rate/style/index.less +4 -0
- package/esm/slider/hooks/index.d.ts +1 -1
- package/esm/slider/popover.js +7 -3
- package/esm/stepper/hooks/useButtonClick.js +8 -9
- package/esm/sticky/index.d.ts +5 -0
- package/esm/sticky/index.js +20 -7
- package/esm/style.d.ts +13 -13
- package/esm/style.js +13 -13
- package/esm/switch/index.js +9 -4
- package/esm/switch/style/css/index.css +44 -0
- package/esm/switch/style/index.less +19 -7
- package/esm/tabs/demo/style/css/mobile.css +11 -0
- package/esm/tabs/demo/style/mobile.less +5 -1
- package/esm/tabs/index.js +16 -7
- package/esm/tabs/style/css/index.css +32 -7
- package/esm/tabs/style/index.less +9 -14
- package/esm/tabs/tab-cell-underline.js +14 -6
- package/esm/tabs/tab-cell.js +15 -8
- package/esm/tabs/tab-pane.js +4 -3
- package/esm/tabs/type.d.ts +1 -0
- package/esm/toast/index.d.ts +12 -12
- package/esm/toast/index.js +5 -2
- package/package.json +3 -3
- package/umd/_helpers/hooks.d.ts +1 -0
- package/umd/_helpers/hooks.js +44 -28
- package/umd/action-sheet/index.d.ts +2 -2
- package/umd/badge/index.js +2 -1
- package/umd/badge/style/css/index.css +12 -0
- package/umd/badge/style/index.less +3 -3
- package/umd/button/style/css/index.css +4 -0
- package/umd/button/style/index.less +1 -1
- package/umd/cell/style/css/index.css +7 -0
- package/umd/cell/style/index.less +4 -1
- package/umd/checkbox/style/css/index.css +13 -0
- package/umd/checkbox/style/index.less +3 -3
- package/umd/collapse/collapse.js +12 -6
- package/umd/dialog/index.d.ts +2 -2
- package/umd/form/style/css/index.css +16 -0
- package/umd/form/style/index.less +4 -4
- package/umd/image-preview/index.d.ts +2 -2
- package/umd/image-preview/index.js +4 -2
- package/umd/image-preview/style/css/index.css +3 -0
- package/umd/image-preview/style/index.less +4 -0
- package/umd/index.d.ts +12 -12
- package/umd/index.js +28 -28
- package/umd/load-more/index.d.ts +5 -0
- package/umd/load-more/index.js +2 -1
- package/umd/masking/index.d.ts +2 -2
- package/umd/masking/index.js +4 -2
- package/umd/notify/index.d.ts +8 -8
- package/umd/popover/popover.js +10 -2
- package/umd/popup/index.d.ts +2 -2
- package/umd/popup-swiper/index.d.ts +2 -2
- package/umd/radio/style/css/index.css +8 -0
- package/umd/radio/style/index.less +2 -2
- package/umd/rate/index.js +5 -3
- package/umd/rate/style/css/index.css +4 -0
- package/umd/rate/style/index.less +4 -0
- package/umd/slider/hooks/index.d.ts +1 -1
- package/umd/slider/popover.js +6 -2
- package/umd/stepper/hooks/useButtonClick.js +8 -9
- package/umd/sticky/index.d.ts +5 -0
- package/umd/sticky/index.js +20 -7
- package/umd/style.d.ts +13 -13
- package/umd/style.js +2 -2
- package/umd/switch/index.js +7 -2
- package/umd/switch/style/css/index.css +44 -0
- package/umd/switch/style/index.less +19 -7
- package/umd/tabs/demo/style/css/mobile.css +11 -0
- package/umd/tabs/demo/style/mobile.less +5 -1
- package/umd/tabs/index.js +14 -5
- package/umd/tabs/style/css/index.css +32 -7
- package/umd/tabs/style/index.less +9 -14
- package/umd/tabs/tab-cell-underline.js +16 -9
- package/umd/tabs/tab-cell.js +17 -11
- package/umd/tabs/tab-pane.js +4 -3
- package/umd/tabs/type.d.ts +1 -0
- package/umd/toast/index.d.ts +12 -12
- package/umd/toast/index.js +5 -2
package/esm/_helpers/hooks.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
* @name_en General Hooks
|
5
5
|
*/
|
6
6
|
import { useState, useRef, useEffect, useCallback, useContext } from 'react';
|
7
|
-
import { getSystem, scrollWithAnimation } from '@arco-design/mobile-utils';
|
7
|
+
import { getSystem, scrollWithAnimation, safeGetComputedStyle } from '@arco-design/mobile-utils';
|
8
8
|
import { GlobalContext } from '../context-provider';
|
9
9
|
export function useListenResize(resizeHandler, deps, needListen) {
|
10
10
|
if (deps === void 0) {
|
@@ -58,11 +58,25 @@ export function useMountedState(initialState) {
|
|
58
58
|
var result = [state, setValidState];
|
59
59
|
return result;
|
60
60
|
}
|
61
|
-
export function
|
61
|
+
export function useSameRefState(initialValue) {
|
62
62
|
var _useState2 = useState(initialValue),
|
63
63
|
state = _useState2[0],
|
64
64
|
setState = _useState2[1];
|
65
65
|
|
66
|
+
var stateRef = useRef(state);
|
67
|
+
|
68
|
+
var setStateProxy = function setStateProxy(data) {
|
69
|
+
stateRef.current = data;
|
70
|
+
setState(data);
|
71
|
+
};
|
72
|
+
|
73
|
+
return [state, stateRef, setStateProxy];
|
74
|
+
}
|
75
|
+
export function useRefState(initialValue) {
|
76
|
+
var _useState3 = useState(initialValue),
|
77
|
+
state = _useState3[0],
|
78
|
+
setState = _useState3[1];
|
79
|
+
|
66
80
|
var stateRef = useRef(state);
|
67
81
|
useEffect(function () {
|
68
82
|
stateRef.current = state;
|
@@ -95,8 +109,8 @@ export function useUpdateEffect(effect, dependencies) {
|
|
95
109
|
}, dependencies);
|
96
110
|
}
|
97
111
|
export function useForceUpdate() {
|
98
|
-
var
|
99
|
-
setTick =
|
112
|
+
var _useState4 = useState(0),
|
113
|
+
setTick = _useState4[1];
|
100
114
|
|
101
115
|
var update = useCallback(function () {
|
102
116
|
setTick(function (tick) {
|
@@ -116,11 +130,11 @@ export function useSystem() {
|
|
116
130
|
var _useContext = useContext(GlobalContext),
|
117
131
|
currentSystem = _useContext.system;
|
118
132
|
|
119
|
-
var
|
133
|
+
var _useState5 = useState(function () {
|
120
134
|
return currentSystem || getSystem();
|
121
135
|
}),
|
122
|
-
system =
|
123
|
-
setSystem =
|
136
|
+
system = _useState5[0],
|
137
|
+
setSystem = _useState5[1];
|
124
138
|
|
125
139
|
useEffect(function () {
|
126
140
|
setSystem(currentSystem || getSystem());
|
@@ -128,13 +142,13 @@ export function useSystem() {
|
|
128
142
|
return system;
|
129
143
|
}
|
130
144
|
export function useWindowSize(listenResize) {
|
131
|
-
var _useState5 = useState(0),
|
132
|
-
windowWidth = _useState5[0],
|
133
|
-
setWindowWidth = _useState5[1];
|
134
|
-
|
135
145
|
var _useState6 = useState(0),
|
136
|
-
|
137
|
-
|
146
|
+
windowWidth = _useState6[0],
|
147
|
+
setWindowWidth = _useState6[1];
|
148
|
+
|
149
|
+
var _useState7 = useState(0),
|
150
|
+
windowHeight = _useState7[0],
|
151
|
+
setWindowHeight = _useState7[1];
|
138
152
|
|
139
153
|
function setSize() {
|
140
154
|
setWindowWidth(window.innerWidth);
|
@@ -178,7 +192,7 @@ export function usePopupScroll(visible, popupDom, getScrollContainer, orientatio
|
|
178
192
|
if (ele) {
|
179
193
|
var actualEle = Array.isArray(ele) ? ele : [ele];
|
180
194
|
scrollRef.current = actualEle.reduce(function (acc, nowEle) {
|
181
|
-
return [].concat(acc, nowEle &&
|
195
|
+
return [].concat(acc, nowEle && safeGetComputedStyle(nowEle).overflow !== 'hidden' ? [{
|
182
196
|
ele: nowEle,
|
183
197
|
maxScrollX: orientationDirection === 'left' || orientationDirection === 'right' ? nowEle.scrollHeight - nowEle.clientHeight : nowEle.scrollWidth - nowEle.clientWidth,
|
184
198
|
maxScrollY: orientationDirection === 'left' || orientationDirection === 'right' ? nowEle.scrollWidth - nowEle.clientWidth : nowEle.scrollHeight - nowEle.clientHeight
|
@@ -436,17 +450,17 @@ export function usePreventBodyScroll(visible, preventBodyScroll, initialBodyOver
|
|
436
450
|
}, [visible]);
|
437
451
|
}
|
438
452
|
export var useProgress = function useProgress(mountedTransition, percentage, duration, mountedBezier, step) {
|
439
|
-
var
|
440
|
-
currentPercentage =
|
441
|
-
setCurrentPercentage =
|
453
|
+
var _useState8 = useState(0),
|
454
|
+
currentPercentage = _useState8[0],
|
455
|
+
setCurrentPercentage = _useState8[1];
|
442
456
|
|
443
|
-
var
|
444
|
-
transitionControl =
|
445
|
-
setTransitionControl =
|
457
|
+
var _useState9 = useState(false),
|
458
|
+
transitionControl = _useState9[0],
|
459
|
+
setTransitionControl = _useState9[1];
|
446
460
|
|
447
|
-
var
|
448
|
-
count =
|
449
|
-
setCount =
|
461
|
+
var _useState10 = useState(0),
|
462
|
+
count = _useState10[0],
|
463
|
+
setCount = _useState10[1];
|
450
464
|
|
451
465
|
var latestPercentage = useRef(percentage);
|
452
466
|
useEffect(function () {
|
@@ -475,9 +489,9 @@ export function useSingleAndDoubleClick(onClick, onDoubleClick, delay) {
|
|
475
489
|
delay = 200;
|
476
490
|
}
|
477
491
|
|
478
|
-
var
|
479
|
-
clickTimes =
|
480
|
-
setClickTimes =
|
492
|
+
var _useState11 = useState(0),
|
493
|
+
clickTimes = _useState11[0],
|
494
|
+
setClickTimes = _useState11[1];
|
481
495
|
|
482
496
|
var eventRef = useRef();
|
483
497
|
useEffect(function () {
|
@@ -499,9 +513,9 @@ export function useSingleAndDoubleClick(onClick, onDoubleClick, delay) {
|
|
499
513
|
}
|
500
514
|
var arcoSvgKeyCount = 0;
|
501
515
|
export function useGenSvgKey(userSetSvgKey) {
|
502
|
-
var
|
503
|
-
innerSvgKey =
|
504
|
-
setInnerSvgKey =
|
516
|
+
var _useState12 = useState(''),
|
517
|
+
innerSvgKey = _useState12[0],
|
518
|
+
setInnerSvgKey = _useState12[1];
|
505
519
|
|
506
520
|
var svgKey = userSetSvgKey || innerSvgKey;
|
507
521
|
useEffect(function () {
|
@@ -86,11 +86,11 @@ 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<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "
|
89
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "translateZ" | "className" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "items" | "cancelText" | "subTitle"> & {
|
90
90
|
key?: string | undefined;
|
91
91
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
92
92
|
close: () => void;
|
93
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "
|
93
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "translateZ" | "className" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "items" | "cancelText" | "subTitle"> & {
|
94
94
|
key?: string | undefined;
|
95
95
|
}) => void;
|
96
96
|
};
|
package/esm/badge/index.js
CHANGED
@@ -51,7 +51,8 @@ var Badge = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
51
51
|
return /*#__PURE__*/React.createElement(Transition, {
|
52
52
|
in: visible,
|
53
53
|
timeout: timeout,
|
54
|
-
type: "scale"
|
54
|
+
type: "scale",
|
55
|
+
nodeRef: domRef
|
55
56
|
}, /*#__PURE__*/React.createElement("div", {
|
56
57
|
className: cls(prefixCls + "-badge", className, (_cls = {}, _cls[prefixCls + "-badge-dot dot"] = dot, _cls[prefixCls + "-badge-bordered bordered"] = bordered, _cls[prefixCls + "-badge-absolute absolute"] = absolute, _cls)),
|
57
58
|
style: style,
|
@@ -89,7 +89,19 @@
|
|
89
89
|
margin-left: -8PX ;
|
90
90
|
margin-top: -8PX ;
|
91
91
|
}
|
92
|
+
[dir="rtl"] .arco-badge-absolute {
|
93
|
+
left: initial;
|
94
|
+
right: 100%;
|
95
|
+
}
|
96
|
+
[dir="rtl"] .arco-badge-absolute {
|
97
|
+
margin-left: initial;
|
98
|
+
margin-right: -8PX ;
|
99
|
+
}
|
92
100
|
.arco-badge-absolute.arco-badge-dot {
|
93
101
|
margin-left: -4PX ;
|
94
102
|
margin-top: -4PX ;
|
95
103
|
}
|
104
|
+
[dir="rtl"] .arco-badge-absolute.arco-badge-dot {
|
105
|
+
margin-left: initial;
|
106
|
+
margin-right: -4PX ;
|
107
|
+
}
|
@@ -60,13 +60,13 @@
|
|
60
60
|
&-absolute {
|
61
61
|
position: absolute;
|
62
62
|
top: 0;
|
63
|
-
left
|
64
|
-
.use-var(margin-left, badge-text-deviation);
|
63
|
+
.set-prop-with-rtl(left, 100%);
|
64
|
+
.use-var-with-rtl(margin-left, badge-text-deviation);
|
65
65
|
.use-var(margin-top, badge-text-deviation);
|
66
66
|
}
|
67
67
|
|
68
68
|
&-absolute&-dot {
|
69
|
-
.use-var(margin-left, badge-dot-deviation);
|
69
|
+
.use-var-with-rtl(margin-left, badge-dot-deviation);
|
70
70
|
.use-var(margin-top, badge-dot-deviation);
|
71
71
|
}
|
72
72
|
}
|
@@ -210,6 +210,10 @@
|
|
210
210
|
.arco-button-text-has-icon {
|
211
211
|
margin-left: 0.08rem ;
|
212
212
|
}
|
213
|
+
[dir="rtl"] .arco-button-text-has-icon {
|
214
|
+
margin-left: initial;
|
215
|
+
margin-right: 0.08rem ;
|
216
|
+
}
|
213
217
|
.arco-button-loading-icon {
|
214
218
|
display: inline-block;
|
215
219
|
vertical-align: middle;
|
@@ -164,6 +164,9 @@
|
|
164
164
|
-webkit-box-orient: vertical;
|
165
165
|
white-space: normal;
|
166
166
|
}
|
167
|
+
[dir="rtl"] .arco-cell .cell-content .cell-text {
|
168
|
+
text-align: left;
|
169
|
+
}
|
167
170
|
.arco-cell .cell-label-icon {
|
168
171
|
margin-right: 0.24rem ;
|
169
172
|
font-size: 0;
|
@@ -181,6 +184,10 @@
|
|
181
184
|
margin-left: 0.16rem ;
|
182
185
|
font-size: 0;
|
183
186
|
}
|
187
|
+
[dir="rtl"] .arco-cell .cell-arrow-icon {
|
188
|
+
-webkit-transform: scale(-1);
|
189
|
+
transform: scale(-1);
|
190
|
+
}
|
184
191
|
[dir="rtl"] .arco-cell .cell-arrow-icon {
|
185
192
|
margin-left: initial;
|
186
193
|
margin-right: 0.16rem ;
|
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
.cell-text {
|
56
56
|
width: 100%;
|
57
|
-
text-align
|
57
|
+
.set-value-with-rtl(text-align, right);
|
58
58
|
.use-var(font-size, cell-content-font-size);
|
59
59
|
.text-overflow(2);
|
60
60
|
}
|
@@ -71,6 +71,9 @@
|
|
71
71
|
}
|
72
72
|
|
73
73
|
.cell-arrow-icon {
|
74
|
+
[dir="rtl"] & {
|
75
|
+
transform: scale(-1);
|
76
|
+
}
|
74
77
|
.use-var-with-rtl(margin-left, cell-arrow-gutter);
|
75
78
|
font-size: 0;
|
76
79
|
.@{prefix}-icon {
|
@@ -32,6 +32,10 @@
|
|
32
32
|
.arco-checkbox .checkbox-icon + .checkbox-text {
|
33
33
|
margin-left: 0.16rem ;
|
34
34
|
}
|
35
|
+
[dir="rtl"] .arco-checkbox .checkbox-icon + .checkbox-text {
|
36
|
+
margin-left: initial;
|
37
|
+
margin-right: 0.16rem ;
|
38
|
+
}
|
35
39
|
.arco-checkbox.disabled .checkbox-text {
|
36
40
|
opacity: 0.5 ;
|
37
41
|
}
|
@@ -47,7 +51,16 @@
|
|
47
51
|
.arco-checkbox-group .arco-checkbox:not(:last-child) {
|
48
52
|
margin-right: 0.48rem ;
|
49
53
|
}
|
54
|
+
[dir="rtl"] .arco-checkbox-group .arco-checkbox:not(:last-child) {
|
55
|
+
margin-right: initial;
|
56
|
+
margin-left: 0.48rem ;
|
57
|
+
}
|
50
58
|
.arco-checkbox-group .arco-checkbox:not(:last-child).block,
|
51
59
|
.arco-checkbox-group .arco-checkbox:not(:last-child).justify {
|
52
60
|
margin-right: 0;
|
53
61
|
}
|
62
|
+
[dir="rtl"] .arco-checkbox-group .arco-checkbox:not(:last-child).block,
|
63
|
+
[dir="rtl"] .arco-checkbox-group .arco-checkbox:not(:last-child).justify {
|
64
|
+
margin-right: initial;
|
65
|
+
margin-left: 0;
|
66
|
+
}
|
@@ -29,7 +29,7 @@
|
|
29
29
|
}
|
30
30
|
|
31
31
|
.checkbox-icon + .checkbox-text {
|
32
|
-
.use-var(margin-left, checkbox-icon-margin-right);
|
32
|
+
.use-var-with-rtl(margin-left, checkbox-icon-margin-right);
|
33
33
|
}
|
34
34
|
|
35
35
|
&.disabled .checkbox-text {
|
@@ -48,11 +48,11 @@
|
|
48
48
|
|
49
49
|
.@{prefix}-checkbox-group {
|
50
50
|
.@{prefix}-checkbox:not(:last-child) {
|
51
|
-
.use-var(margin-right, checkbox-group-gutter);
|
51
|
+
.use-var-with-rtl(margin-right, checkbox-group-gutter);
|
52
52
|
|
53
53
|
&.block,
|
54
54
|
&.justify {
|
55
|
-
margin-right
|
55
|
+
.set-prop-with-rtl(margin-right, 0);
|
56
56
|
}
|
57
57
|
}
|
58
58
|
}
|
package/esm/collapse/collapse.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import React, { useRef, forwardRef, useImperativeHandle, useState, useEffect, useContext
|
1
|
+
import React, { useRef, forwardRef, useImperativeHandle, useState, useEffect, useContext } from 'react';
|
2
2
|
import { cls, convertCssDuration, nextTick } from '@arco-design/mobile-utils';
|
3
3
|
import { ContextLayout } from '../context-provider';
|
4
|
-
import { useRefState, useUpdateEffect } from '../_helpers';
|
4
|
+
import { useRefState, useSameRefState, useUpdateEffect } from '../_helpers';
|
5
5
|
import IconArrowDown from '../icon/IconArrowDown';
|
6
6
|
import { allContexts, CollapseKeyContext } from './utils';
|
7
7
|
export var Collapse = /*#__PURE__*/forwardRef(function (props, ref) {
|
@@ -46,7 +46,13 @@ export var Collapse = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
46
46
|
|
47
47
|
var CollapseContext = allContexts[groupKey] || {};
|
48
48
|
var groupContext = useContext(CollapseContext) || {};
|
49
|
-
|
49
|
+
|
50
|
+
var _useSameRefState = useSameRefState(false),
|
51
|
+
opened = _useSameRefState[0],
|
52
|
+
openedRef = _useSameRefState[1],
|
53
|
+
setOpened = _useSameRefState[2];
|
54
|
+
|
55
|
+
useEffect(function () {
|
50
56
|
var show = false; // 优先级: group > children
|
51
57
|
// @en Priority: group > children
|
52
58
|
|
@@ -60,7 +66,7 @@ export var Collapse = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
60
66
|
show = itemActive;
|
61
67
|
}
|
62
68
|
|
63
|
-
|
69
|
+
setOpened(show);
|
64
70
|
}, [value, active, itemActive, groupContext.isGroup, groupContext.value]);
|
65
71
|
|
66
72
|
var getContentHeight = function getContentHeight() {
|
@@ -78,8 +84,8 @@ export var Collapse = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
78
84
|
contentWrapRef.current.style.height = newHeight;
|
79
85
|
var transTimeout = convertCssDuration(contentWrapRef.current, 'transitionDuration');
|
80
86
|
setTimeout(function () {
|
81
|
-
return contentWrapRef.current && (contentWrapRef.current.style.height =
|
82
|
-
},
|
87
|
+
return contentWrapRef.current && (contentWrapRef.current.style.height = openedRef.current ? 'auto' : '0px');
|
88
|
+
}, openedRef.current ? transTimeout : 20);
|
83
89
|
};
|
84
90
|
|
85
91
|
var toggleOpened = function toggleOpened() {
|
@@ -102,10 +108,10 @@ export var Collapse = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
102
108
|
}
|
103
109
|
|
104
110
|
var height = getContentHeight();
|
105
|
-
contentWrapRef.current.style.height =
|
111
|
+
contentWrapRef.current.style.height = openedRef.current ? contentHeightRef.current + "px" : '0px';
|
106
112
|
nextTick(function () {
|
107
113
|
contentHeightRef.current = height;
|
108
|
-
resetHeight(
|
114
|
+
resetHeight(openedRef.current ? height + "px" : '0px');
|
109
115
|
});
|
110
116
|
};
|
111
117
|
|
package/esm/dialog/index.d.ts
CHANGED
@@ -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<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "
|
196
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "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<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "
|
200
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
|
201
201
|
key?: string | undefined;
|
202
202
|
}) => void;
|
203
203
|
};
|
@@ -27,6 +27,10 @@
|
|
27
27
|
padding-right: 0.32rem ;
|
28
28
|
width: 1.92rem ;
|
29
29
|
}
|
30
|
+
[dir="rtl"] .arco-form-label-item {
|
31
|
+
padding-right: initial;
|
32
|
+
padding-left: 0.32rem ;
|
33
|
+
}
|
30
34
|
.arco-form-label-item-required-asterisk {
|
31
35
|
position: absolute;
|
32
36
|
left: -0.6em;
|
@@ -35,6 +39,10 @@
|
|
35
39
|
line-height: 1.08rem ;
|
36
40
|
color: #f53f3f ;
|
37
41
|
}
|
42
|
+
[dir="rtl"] .arco-form-label-item-required-asterisk {
|
43
|
+
left: initial;
|
44
|
+
right: -0.6em;
|
45
|
+
}
|
38
46
|
.disabled .arco-form-label-item {
|
39
47
|
color: #c9cdd4 ;
|
40
48
|
}
|
@@ -68,6 +76,10 @@
|
|
68
76
|
.arco-form-item-message svg {
|
69
77
|
margin-right: 0.08rem;
|
70
78
|
}
|
79
|
+
[dir="rtl"] .arco-form-item-message svg {
|
80
|
+
margin-right: initial;
|
81
|
+
margin-left: 0.08rem;
|
82
|
+
}
|
71
83
|
.arco-form-item-error-message {
|
72
84
|
color: #f53f3f ;
|
73
85
|
}
|
@@ -80,6 +92,10 @@
|
|
80
92
|
.arco-form-item.arco-form-item-vertical .arco-input-wrap {
|
81
93
|
padding-left: 0;
|
82
94
|
}
|
95
|
+
[dir="rtl"] .arco-form-item.arco-form-item-vertical .arco-input-wrap {
|
96
|
+
padding-left: initial;
|
97
|
+
padding-right: 0;
|
98
|
+
}
|
83
99
|
.arco-form-item.arco-form-item-vertical .arco-form-label-item {
|
84
100
|
width: auto;
|
85
101
|
margin-top: 16px;
|
@@ -20,12 +20,12 @@
|
|
20
20
|
.use-var(font-size, form-item-label-item-font-size);
|
21
21
|
.use-var(line-height, form-item-label-item-line-height);
|
22
22
|
.use-var(color, form-item-label-item-color);
|
23
|
-
.use-var(padding-right, form-item-label-item-gutter);
|
23
|
+
.use-var-with-rtl(padding-right, form-item-label-item-gutter);
|
24
24
|
.use-var(width, form-item-label-item-width);
|
25
25
|
|
26
26
|
&-required-asterisk {
|
27
27
|
position: absolute;
|
28
|
-
left
|
28
|
+
.set-prop-with-rtl(left, -0.6em);
|
29
29
|
top: 0;
|
30
30
|
|
31
31
|
.use-var(font-size, form-item-label-item-font-size);
|
@@ -60,7 +60,7 @@
|
|
60
60
|
}
|
61
61
|
|
62
62
|
svg {
|
63
|
-
.rem(margin-right, 4);
|
63
|
+
.rem-with-rtl(margin-right, 4);
|
64
64
|
}
|
65
65
|
margin-bottom: 16px;
|
66
66
|
}
|
@@ -75,7 +75,7 @@
|
|
75
75
|
&-item.@{prefix}-form-item-vertical {
|
76
76
|
display: block;
|
77
77
|
.arco-input-wrap {
|
78
|
-
padding-left
|
78
|
+
.set-prop-with-rtl(padding-left, 0);
|
79
79
|
}
|
80
80
|
.@{prefix}-form-label-item {
|
81
81
|
width: auto;
|
@@ -269,9 +269,9 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
|
|
269
269
|
* @param {ImagePreviewProps} config configuration
|
270
270
|
* @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
|
271
271
|
*/
|
272
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "
|
272
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
273
273
|
close: () => void;
|
274
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "
|
274
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
|
275
275
|
};
|
276
276
|
};
|
277
277
|
/**
|
@@ -766,7 +766,8 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
766
766
|
return /*#__PURE__*/React.createElement(Carousel, _extends({
|
767
767
|
autoPlay: false,
|
768
768
|
loop: loop,
|
769
|
-
lazyloadCount: lazyloadCount
|
769
|
+
lazyloadCount: lazyloadCount,
|
770
|
+
stopPropagation: false
|
770
771
|
}, carouselProps), (allImages || []).map(function (image, index) {
|
771
772
|
var innerNode = /*#__PURE__*/React.createElement("div", {
|
772
773
|
key: index,
|
@@ -875,7 +876,8 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
875
876
|
timeout: displayDuration,
|
876
877
|
type: "fade",
|
877
878
|
mountOnEnter: true,
|
878
|
-
unmountOnExit: true
|
879
|
+
unmountOnExit: true,
|
880
|
+
nodeRef: domRef
|
879
881
|
}, /*#__PURE__*/React.createElement("div", {
|
880
882
|
className: cls(prefixCls + "-image-preview", 'all-border-box', {
|
881
883
|
noselect: noselect
|
package/esm/index.d.ts
CHANGED
@@ -1,34 +1,31 @@
|
|
1
|
-
export { default as
|
1
|
+
export { default as Tabs } from './tabs';
|
2
|
+
export { default as Sticky } from './sticky';
|
3
|
+
export { default as LoadMore } from './load-more';
|
4
|
+
export { default as Cell } from './cell';
|
2
5
|
export { default as ActionSheet } from './action-sheet';
|
3
6
|
export { default as Avatar } from './avatar';
|
4
7
|
export { default as Badge } from './badge';
|
8
|
+
export { default as Button } from './button';
|
5
9
|
export { default as Carousel } from './carousel';
|
6
|
-
export { default as Cell } from './cell';
|
7
10
|
export { default as Checkbox } from './checkbox';
|
8
11
|
export { default as CircleProgress } from './circle-progress';
|
9
12
|
export { default as Collapse } from './collapse';
|
10
13
|
export { default as ContextProvider } from './context-provider';
|
11
14
|
export { default as CountDown } from './count-down';
|
12
15
|
export { default as DatePicker } from './date-picker';
|
13
|
-
export { default as Divider } from './divider';
|
14
16
|
export { default as Dialog } from './dialog';
|
17
|
+
export { default as Divider } from './divider';
|
15
18
|
export { default as Dropdown } from './dropdown';
|
16
19
|
export { default as DropdownMenu } from './dropdown-menu';
|
17
20
|
export { default as Ellipsis } from './ellipsis';
|
18
21
|
export { default as Form } from './form';
|
19
|
-
export { default as Input } from './input';
|
20
|
-
export { default as Textarea } from './textarea';
|
21
|
-
export { default as Radio } from './radio';
|
22
|
-
export { default as Rate } from './rate';
|
23
|
-
export { default as Slider } from './slider';
|
24
22
|
export { default as Grid } from './grid';
|
25
23
|
export { default as Image } from './image';
|
26
|
-
export { default as ShowMonitor } from './show-monitor';
|
27
24
|
export { default as ImagePicker } from './image-picker';
|
28
25
|
export { default as ImagePreview } from './image-preview';
|
29
26
|
export { default as IndexBar } from './index-bar';
|
27
|
+
export { default as Input } from './input';
|
30
28
|
export { default as Keyboard } from './keyboard';
|
31
|
-
export { default as LoadMore } from './load-more';
|
32
29
|
export { default as Loading } from './loading';
|
33
30
|
export { default as Masking } from './masking';
|
34
31
|
export { default as NavBar } from './nav-bar';
|
@@ -43,15 +40,18 @@ export { default as PopupSwiper } from './popup-swiper';
|
|
43
40
|
export { default as Portal } from './portal';
|
44
41
|
export { default as Progress } from './progress';
|
45
42
|
export { default as PullRefresh } from './pull-refresh';
|
43
|
+
export { default as Radio } from './radio';
|
44
|
+
export { default as Rate } from './rate';
|
46
45
|
export { default as SearchBar } from './search-bar';
|
46
|
+
export { default as ShowMonitor } from './show-monitor';
|
47
|
+
export { default as Slider } from './slider';
|
47
48
|
export { default as Stepper } from './stepper';
|
48
49
|
export { default as Steps } from './steps';
|
49
|
-
export { default as Sticky } from './sticky';
|
50
50
|
export { default as SwipeAction } from './swipe-action';
|
51
51
|
export { default as SwipeLoad } from './swipe-load';
|
52
52
|
export { default as Switch } from './switch';
|
53
53
|
export { default as TabBar } from './tab-bar';
|
54
|
-
export { default as Tabs } from './tabs';
|
55
54
|
export { default as Tag } from './tag';
|
55
|
+
export { default as Textarea } from './textarea';
|
56
56
|
export { default as Toast } from './toast';
|
57
57
|
export { default as Transition } from './transition';
|