@arco-design/mobile-react 2.37.0 → 2.38.1
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 +28 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/action-sheet/index.d.ts +2 -2
- package/cjs/action-sheet/style/css/index.css +18 -0
- package/cjs/avatar/style/css/index.css +18 -0
- package/cjs/badge/index.d.ts +2 -1
- package/cjs/badge/index.js +1 -1
- package/cjs/badge/style/css/index.css +26 -4
- package/cjs/badge/style/index.less +4 -2
- package/cjs/button/style/css/index.css +18 -0
- package/cjs/carousel/style/css/index.css +18 -0
- package/cjs/cell/style/css/index.css +18 -0
- package/cjs/checkbox/style/css/index.css +18 -0
- package/cjs/circle-progress/style/css/index.css +18 -0
- package/cjs/collapse/style/css/index.css +18 -0
- package/cjs/count-down/style/css/index.css +18 -0
- package/cjs/date-picker/style/css/index.css +18 -0
- package/cjs/dialog/index.d.ts +7 -6
- package/cjs/dialog/index.js +4 -1
- package/cjs/dialog/style/css/index.css +26 -4
- package/cjs/dialog/style/index.less +4 -2
- package/cjs/divider/style/css/index.css +18 -0
- package/cjs/dropdown/style/css/index.css +18 -0
- package/cjs/dropdown-menu/style/css/index.css +18 -0
- package/cjs/ellipsis/style/css/index.css +18 -0
- package/cjs/form/style/css/index.css +18 -0
- package/cjs/grid/style/css/index.css +18 -0
- package/cjs/image/style/css/index.css +18 -0
- package/cjs/image-picker/index.d.ts +1 -1
- package/cjs/image-picker/index.js +1 -0
- package/cjs/image-picker/style/css/index.css +18 -0
- package/cjs/image-picker/type.d.ts +11 -5
- package/cjs/image-preview/style/css/index.css +18 -0
- package/cjs/index-bar/style/css/index.css +18 -0
- package/cjs/input/style/css/index.css +18 -0
- package/cjs/keyboard/style/css/index.css +18 -0
- package/cjs/load-more/style/css/index.css +18 -0
- package/cjs/loading/style/css/index.css +18 -0
- package/cjs/masking/index.d.ts +11 -5
- package/cjs/masking/index.js +2 -0
- package/cjs/masking/style/css/index.css +18 -0
- package/cjs/nav-bar/style/css/index.css +18 -0
- package/cjs/notice-bar/style/css/index.css +18 -0
- package/cjs/notify/style/css/index.css +18 -0
- package/cjs/pagination/style/css/index.css +18 -0
- package/cjs/picker/style/css/index.css +18 -0
- package/cjs/picker-view/style/css/index.css +18 -0
- package/cjs/popover/style/css/index.css +18 -0
- package/cjs/popover/style/css/menu.css +18 -0
- package/cjs/popup/index.d.ts +3 -3
- package/cjs/popup/index.js +1 -0
- package/cjs/popup/style/css/index.css +35 -0
- package/cjs/popup/style/index.less +36 -3
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/cjs/popup-swiper/index.js +20 -3
- package/cjs/popup-swiper/style/css/index.css +18 -0
- package/cjs/progress/style/css/index.css +18 -0
- package/cjs/pull-refresh/style/css/index.css +18 -0
- package/cjs/radio/style/css/index.css +18 -0
- package/cjs/rate/style/css/index.css +18 -0
- package/cjs/search-bar/style/css/index.css +18 -0
- package/cjs/skeleton/style/css/index.css +18 -0
- package/cjs/slider/style/css/index.css +18 -0
- package/cjs/stepper/style/css/index.css +18 -0
- package/cjs/steps/style/css/index.css +18 -0
- package/cjs/sticky/style/css/index.css +18 -0
- package/cjs/swipe-action/style/css/index.css +18 -0
- package/cjs/swipe-load/style/css/index.css +18 -0
- package/cjs/switch/style/css/index.css +18 -0
- package/cjs/tab-bar/style/css/index.css +18 -0
- package/cjs/tabs/index.js +7 -3
- package/cjs/tabs/style/css/index.css +18 -0
- package/cjs/tabs/tab-cell.js +9 -1
- package/cjs/tabs/type.d.ts +5 -0
- package/cjs/tag/style/css/index.css +18 -0
- package/cjs/textarea/style/css/index.css +18 -0
- package/cjs/toast/style/css/index.css +18 -0
- package/cjs/transition/index.d.ts +9 -3
- package/cjs/transition/index.js +36 -6
- package/cjs/transition/style/css/index.css +22 -4
- package/cjs/transition/style/index.less +2 -2
- package/cjs/uploader/style/css/index.css +18 -0
- package/dist/index.js +83 -22
- package/dist/index.min.js +4 -4
- package/dist/style.css +1049 -6
- package/dist/style.min.css +1 -1
- package/esm/action-sheet/index.d.ts +2 -2
- package/esm/action-sheet/style/css/index.css +18 -0
- package/esm/avatar/style/css/index.css +18 -0
- package/esm/badge/index.d.ts +2 -1
- package/esm/badge/index.js +1 -1
- package/esm/badge/style/css/index.css +26 -4
- package/esm/badge/style/index.less +4 -2
- package/esm/button/style/css/index.css +18 -0
- package/esm/carousel/style/css/index.css +18 -0
- package/esm/cell/style/css/index.css +18 -0
- package/esm/checkbox/style/css/index.css +18 -0
- package/esm/circle-progress/style/css/index.css +18 -0
- package/esm/collapse/style/css/index.css +18 -0
- package/esm/count-down/style/css/index.css +18 -0
- package/esm/date-picker/style/css/index.css +18 -0
- package/esm/dialog/index.d.ts +7 -6
- package/esm/dialog/index.js +4 -1
- package/esm/dialog/style/css/index.css +26 -4
- package/esm/dialog/style/index.less +4 -2
- package/esm/divider/style/css/index.css +18 -0
- package/esm/dropdown/style/css/index.css +18 -0
- package/esm/dropdown-menu/style/css/index.css +18 -0
- package/esm/ellipsis/style/css/index.css +18 -0
- package/esm/form/style/css/index.css +18 -0
- package/esm/grid/style/css/index.css +18 -0
- package/esm/image/style/css/index.css +18 -0
- package/esm/image-picker/index.d.ts +1 -1
- package/esm/image-picker/index.js +1 -0
- package/esm/image-picker/style/css/index.css +18 -0
- package/esm/image-picker/type.d.ts +11 -5
- package/esm/image-preview/style/css/index.css +18 -0
- package/esm/index-bar/style/css/index.css +18 -0
- package/esm/input/style/css/index.css +18 -0
- package/esm/keyboard/style/css/index.css +18 -0
- package/esm/load-more/style/css/index.css +18 -0
- package/esm/loading/style/css/index.css +18 -0
- package/esm/masking/index.d.ts +11 -5
- package/esm/masking/index.js +2 -0
- package/esm/masking/style/css/index.css +18 -0
- package/esm/nav-bar/style/css/index.css +18 -0
- package/esm/notice-bar/style/css/index.css +18 -0
- package/esm/notify/style/css/index.css +18 -0
- package/esm/pagination/style/css/index.css +18 -0
- package/esm/picker/style/css/index.css +18 -0
- package/esm/picker-view/style/css/index.css +18 -0
- package/esm/popover/style/css/index.css +18 -0
- package/esm/popover/style/css/menu.css +18 -0
- package/esm/popup/index.d.ts +3 -3
- package/esm/popup/index.js +1 -0
- package/esm/popup/style/css/index.css +35 -0
- package/esm/popup/style/index.less +36 -3
- package/esm/popup-swiper/index.d.ts +2 -2
- package/esm/popup-swiper/index.js +20 -3
- package/esm/popup-swiper/style/css/index.css +18 -0
- package/esm/progress/style/css/index.css +18 -0
- package/esm/pull-refresh/style/css/index.css +18 -0
- package/esm/radio/style/css/index.css +18 -0
- package/esm/rate/style/css/index.css +18 -0
- package/esm/search-bar/style/css/index.css +18 -0
- package/esm/skeleton/style/css/index.css +18 -0
- package/esm/slider/style/css/index.css +18 -0
- package/esm/stepper/style/css/index.css +18 -0
- package/esm/steps/style/css/index.css +18 -0
- package/esm/sticky/style/css/index.css +18 -0
- package/esm/swipe-action/style/css/index.css +18 -0
- package/esm/swipe-load/style/css/index.css +18 -0
- package/esm/switch/style/css/index.css +18 -0
- package/esm/tab-bar/style/css/index.css +18 -0
- package/esm/tabs/index.js +7 -3
- package/esm/tabs/style/css/index.css +18 -0
- package/esm/tabs/tab-cell.js +9 -1
- package/esm/tabs/type.d.ts +5 -0
- package/esm/tag/style/css/index.css +18 -0
- package/esm/textarea/style/css/index.css +18 -0
- package/esm/toast/style/css/index.css +18 -0
- package/esm/transition/index.d.ts +9 -3
- package/esm/transition/index.js +32 -7
- package/esm/transition/style/css/index.css +22 -4
- package/esm/transition/style/index.less +2 -2
- package/esm/uploader/style/css/index.css +18 -0
- package/esnext/action-sheet/index.d.ts +2 -2
- package/esnext/action-sheet/style/css/index.css +18 -0
- package/esnext/avatar/style/css/index.css +18 -0
- package/esnext/badge/index.d.ts +2 -1
- package/esnext/badge/index.js +1 -1
- package/esnext/badge/style/css/index.css +26 -4
- package/esnext/badge/style/index.less +4 -2
- package/esnext/button/style/css/index.css +18 -0
- package/esnext/carousel/style/css/index.css +18 -0
- package/esnext/cell/style/css/index.css +18 -0
- package/esnext/checkbox/style/css/index.css +18 -0
- package/esnext/circle-progress/style/css/index.css +18 -0
- package/esnext/collapse/style/css/index.css +18 -0
- package/esnext/count-down/style/css/index.css +18 -0
- package/esnext/date-picker/style/css/index.css +18 -0
- package/esnext/dialog/index.d.ts +7 -6
- package/esnext/dialog/index.js +1 -1
- package/esnext/dialog/style/css/index.css +26 -4
- package/esnext/dialog/style/index.less +4 -2
- package/esnext/divider/style/css/index.css +18 -0
- package/esnext/dropdown/style/css/index.css +18 -0
- package/esnext/dropdown-menu/style/css/index.css +18 -0
- package/esnext/ellipsis/style/css/index.css +18 -0
- package/esnext/form/style/css/index.css +18 -0
- package/esnext/grid/style/css/index.css +18 -0
- package/esnext/image/style/css/index.css +18 -0
- package/esnext/image-picker/index.d.ts +1 -1
- package/esnext/image-picker/index.js +1 -1
- package/esnext/image-picker/style/css/index.css +18 -0
- package/esnext/image-picker/type.d.ts +11 -5
- package/esnext/image-preview/style/css/index.css +18 -0
- package/esnext/index-bar/style/css/index.css +18 -0
- package/esnext/input/style/css/index.css +18 -0
- package/esnext/keyboard/style/css/index.css +18 -0
- package/esnext/load-more/style/css/index.css +18 -0
- package/esnext/loading/style/css/index.css +18 -0
- package/esnext/masking/index.d.ts +11 -5
- package/esnext/masking/index.js +3 -3
- package/esnext/masking/style/css/index.css +18 -0
- package/esnext/nav-bar/style/css/index.css +18 -0
- package/esnext/notice-bar/style/css/index.css +18 -0
- package/esnext/notify/style/css/index.css +18 -0
- package/esnext/pagination/style/css/index.css +18 -0
- package/esnext/picker/style/css/index.css +18 -0
- package/esnext/picker-view/style/css/index.css +18 -0
- package/esnext/popover/style/css/index.css +18 -0
- package/esnext/popover/style/css/menu.css +18 -0
- package/esnext/popup/index.d.ts +3 -3
- package/esnext/popup/index.js +1 -1
- package/esnext/popup/style/css/index.css +35 -0
- package/esnext/popup/style/index.less +36 -3
- package/esnext/popup-swiper/index.d.ts +2 -2
- package/esnext/popup-swiper/index.js +7 -2
- package/esnext/popup-swiper/style/css/index.css +18 -0
- package/esnext/progress/style/css/index.css +18 -0
- package/esnext/pull-refresh/style/css/index.css +18 -0
- package/esnext/radio/style/css/index.css +18 -0
- package/esnext/rate/style/css/index.css +18 -0
- package/esnext/search-bar/style/css/index.css +18 -0
- package/esnext/skeleton/style/css/index.css +18 -0
- package/esnext/slider/style/css/index.css +18 -0
- package/esnext/stepper/style/css/index.css +18 -0
- package/esnext/steps/style/css/index.css +18 -0
- package/esnext/sticky/style/css/index.css +18 -0
- package/esnext/swipe-action/style/css/index.css +18 -0
- package/esnext/swipe-load/style/css/index.css +18 -0
- package/esnext/switch/style/css/index.css +18 -0
- package/esnext/tab-bar/style/css/index.css +18 -0
- package/esnext/tabs/index.js +3 -2
- package/esnext/tabs/style/css/index.css +18 -0
- package/esnext/tabs/tab-cell.js +8 -1
- package/esnext/tabs/type.d.ts +5 -0
- package/esnext/tag/style/css/index.css +18 -0
- package/esnext/textarea/style/css/index.css +18 -0
- package/esnext/toast/style/css/index.css +18 -0
- package/esnext/transition/index.d.ts +9 -3
- package/esnext/transition/index.js +28 -3
- package/esnext/transition/style/css/index.css +22 -4
- package/esnext/transition/style/index.less +2 -2
- package/esnext/uploader/style/css/index.css +18 -0
- package/package.json +3 -3
- package/style/css/public.css +18 -0
- package/tokens/mixin/index.less +31 -2
- package/umd/action-sheet/index.d.ts +2 -2
- package/umd/action-sheet/style/css/index.css +18 -0
- package/umd/avatar/style/css/index.css +18 -0
- package/umd/badge/index.d.ts +2 -1
- package/umd/badge/index.js +1 -1
- package/umd/badge/style/css/index.css +26 -4
- package/umd/badge/style/index.less +4 -2
- package/umd/button/style/css/index.css +18 -0
- package/umd/carousel/style/css/index.css +18 -0
- package/umd/cell/style/css/index.css +18 -0
- package/umd/checkbox/style/css/index.css +18 -0
- package/umd/circle-progress/style/css/index.css +18 -0
- package/umd/collapse/style/css/index.css +18 -0
- package/umd/count-down/style/css/index.css +18 -0
- package/umd/date-picker/style/css/index.css +18 -0
- package/umd/dialog/index.d.ts +7 -6
- package/umd/dialog/index.js +4 -1
- package/umd/dialog/style/css/index.css +26 -4
- package/umd/dialog/style/index.less +4 -2
- package/umd/divider/style/css/index.css +18 -0
- package/umd/dropdown/style/css/index.css +18 -0
- package/umd/dropdown-menu/style/css/index.css +18 -0
- package/umd/ellipsis/style/css/index.css +18 -0
- package/umd/form/style/css/index.css +18 -0
- package/umd/grid/style/css/index.css +18 -0
- package/umd/image/style/css/index.css +18 -0
- package/umd/image-picker/index.d.ts +1 -1
- package/umd/image-picker/index.js +1 -0
- package/umd/image-picker/style/css/index.css +18 -0
- package/umd/image-picker/type.d.ts +11 -5
- package/umd/image-preview/style/css/index.css +18 -0
- package/umd/index-bar/style/css/index.css +18 -0
- package/umd/input/style/css/index.css +18 -0
- package/umd/keyboard/style/css/index.css +18 -0
- package/umd/load-more/style/css/index.css +18 -0
- package/umd/loading/style/css/index.css +18 -0
- package/umd/masking/index.d.ts +11 -5
- package/umd/masking/index.js +2 -0
- package/umd/masking/style/css/index.css +18 -0
- package/umd/nav-bar/style/css/index.css +18 -0
- package/umd/notice-bar/style/css/index.css +18 -0
- package/umd/notify/style/css/index.css +18 -0
- package/umd/pagination/style/css/index.css +18 -0
- package/umd/picker/style/css/index.css +18 -0
- package/umd/picker-view/style/css/index.css +18 -0
- package/umd/popover/style/css/index.css +18 -0
- package/umd/popover/style/css/menu.css +18 -0
- package/umd/popup/index.d.ts +3 -3
- package/umd/popup/index.js +1 -0
- package/umd/popup/style/css/index.css +35 -0
- package/umd/popup/style/index.less +36 -3
- package/umd/popup-swiper/index.d.ts +2 -2
- package/umd/popup-swiper/index.js +20 -3
- package/umd/popup-swiper/style/css/index.css +18 -0
- package/umd/progress/style/css/index.css +18 -0
- package/umd/pull-refresh/style/css/index.css +18 -0
- package/umd/radio/style/css/index.css +18 -0
- package/umd/rate/style/css/index.css +18 -0
- package/umd/search-bar/style/css/index.css +18 -0
- package/umd/skeleton/style/css/index.css +18 -0
- package/umd/slider/style/css/index.css +18 -0
- package/umd/stepper/style/css/index.css +18 -0
- package/umd/steps/style/css/index.css +18 -0
- package/umd/sticky/style/css/index.css +18 -0
- package/umd/swipe-action/style/css/index.css +18 -0
- package/umd/swipe-load/style/css/index.css +18 -0
- package/umd/switch/style/css/index.css +18 -0
- package/umd/tab-bar/style/css/index.css +18 -0
- package/umd/tabs/index.js +7 -3
- package/umd/tabs/style/css/index.css +18 -0
- package/umd/tabs/tab-cell.js +9 -1
- package/umd/tabs/type.d.ts +5 -0
- package/umd/tag/style/css/index.css +18 -0
- package/umd/textarea/style/css/index.css +18 -0
- package/umd/toast/style/css/index.css +18 -0
- package/umd/transition/index.d.ts +9 -3
- package/umd/transition/index.js +36 -6
- package/umd/transition/style/css/index.css +22 -4
- package/umd/transition/style/index.less +2 -2
- package/umd/uploader/style/css/index.css +18 -0
|
@@ -75,6 +75,24 @@
|
|
|
75
75
|
* }
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
+
/**
|
|
79
|
+
* 为属性设置 transition 变量
|
|
80
|
+
* @desc {en} set the transition variable for the attribute
|
|
81
|
+
* @param @transitionVariable transition 变量名
|
|
82
|
+
* @param @transitionVariable {en} transition variable name
|
|
83
|
+
* @param @backupVariable 备份变量名
|
|
84
|
+
* @param @backupVariable {en} backup variable name
|
|
85
|
+
* @param @property css属性名
|
|
86
|
+
* @param @property {en} css property
|
|
87
|
+
* @example
|
|
88
|
+
* ```
|
|
89
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
|
90
|
+
*
|
|
91
|
+
* .demo {
|
|
92
|
+
* .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
78
96
|
/**
|
|
79
97
|
* 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
|
|
80
98
|
* @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
|
package/cjs/tabs/tab-cell.js
CHANGED
|
@@ -68,7 +68,8 @@ var TabCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
68
68
|
tabBarStyle = props.tabBarStyle,
|
|
69
69
|
tabBarClass = props.tabBarClass,
|
|
70
70
|
translateZ = props.translateZ,
|
|
71
|
-
tabBarStopPropagation = props.tabBarStopPropagation
|
|
71
|
+
tabBarStopPropagation = props.tabBarStopPropagation,
|
|
72
|
+
onUnderlineFirstShow = props.onUnderlineFirstShow;
|
|
72
73
|
var prefix = prefixCls + "-tab-cell";
|
|
73
74
|
|
|
74
75
|
var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
|
|
@@ -147,6 +148,13 @@ var TabCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
147
148
|
(0, _react.useEffect)(function () {
|
|
148
149
|
updateScrollPosition();
|
|
149
150
|
}, [activeIndex, wrapSize]);
|
|
151
|
+
(0, _react.useEffect)(function () {
|
|
152
|
+
// underline 首次展示时,通知父组件启用 cellTrans
|
|
153
|
+
// @en When underline is first shown, notify parent component to enable cellTrans
|
|
154
|
+
if (showLine && onUnderlineFirstShow) {
|
|
155
|
+
onUnderlineFirstShow();
|
|
156
|
+
}
|
|
157
|
+
}, [showLine]);
|
|
150
158
|
(0, _helpers.useUpdateEffect)(function () {
|
|
151
159
|
var _underlineRef$current2;
|
|
152
160
|
|
package/cjs/tabs/type.d.ts
CHANGED
|
@@ -533,6 +533,11 @@ export interface TabCellProps extends Pick<TabsProps, 'tabs' | 'type' | 'onTabCl
|
|
|
533
533
|
* @en Does the touch event of the current TabBar require stopPropagation
|
|
534
534
|
*/
|
|
535
535
|
tabBarStopPropagation: boolean;
|
|
536
|
+
/**
|
|
537
|
+
* underline 首次展示时的回调
|
|
538
|
+
* @en Callback when underline is first shown
|
|
539
|
+
*/
|
|
540
|
+
onUnderlineFirstShow?: () => void;
|
|
536
541
|
}
|
|
537
542
|
export interface TabCellRef {
|
|
538
543
|
/**
|
|
@@ -75,6 +75,24 @@
|
|
|
75
75
|
* }
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
+
/**
|
|
79
|
+
* 为属性设置 transition 变量
|
|
80
|
+
* @desc {en} set the transition variable for the attribute
|
|
81
|
+
* @param @transitionVariable transition 变量名
|
|
82
|
+
* @param @transitionVariable {en} transition variable name
|
|
83
|
+
* @param @backupVariable 备份变量名
|
|
84
|
+
* @param @backupVariable {en} backup variable name
|
|
85
|
+
* @param @property css属性名
|
|
86
|
+
* @param @property {en} css property
|
|
87
|
+
* @example
|
|
88
|
+
* ```
|
|
89
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
|
90
|
+
*
|
|
91
|
+
* .demo {
|
|
92
|
+
* .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
78
96
|
/**
|
|
79
97
|
* 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
|
|
80
98
|
* @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
|
|
@@ -75,6 +75,24 @@
|
|
|
75
75
|
* }
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
+
/**
|
|
79
|
+
* 为属性设置 transition 变量
|
|
80
|
+
* @desc {en} set the transition variable for the attribute
|
|
81
|
+
* @param @transitionVariable transition 变量名
|
|
82
|
+
* @param @transitionVariable {en} transition variable name
|
|
83
|
+
* @param @backupVariable 备份变量名
|
|
84
|
+
* @param @backupVariable {en} backup variable name
|
|
85
|
+
* @param @property css属性名
|
|
86
|
+
* @param @property {en} css property
|
|
87
|
+
* @example
|
|
88
|
+
* ```
|
|
89
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
|
90
|
+
*
|
|
91
|
+
* .demo {
|
|
92
|
+
* .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
78
96
|
/**
|
|
79
97
|
* 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
|
|
80
98
|
* @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
|
|
@@ -75,6 +75,24 @@
|
|
|
75
75
|
* }
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
+
/**
|
|
79
|
+
* 为属性设置 transition 变量
|
|
80
|
+
* @desc {en} set the transition variable for the attribute
|
|
81
|
+
* @param @transitionVariable transition 变量名
|
|
82
|
+
* @param @transitionVariable {en} transition variable name
|
|
83
|
+
* @param @backupVariable 备份变量名
|
|
84
|
+
* @param @backupVariable {en} backup variable name
|
|
85
|
+
* @param @property css属性名
|
|
86
|
+
* @param @property {en} css property
|
|
87
|
+
* @example
|
|
88
|
+
* ```
|
|
89
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
|
90
|
+
*
|
|
91
|
+
* .demo {
|
|
92
|
+
* .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
78
96
|
/**
|
|
79
97
|
* 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
|
|
80
98
|
* @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { CSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
3
3
|
export declare type TransitionProps = Omit<CSSTransitionProps, 'timeout'> & {
|
|
4
4
|
/**
|
|
5
5
|
* 待执行动画内容
|
|
6
6
|
* @en Animation content to be executed
|
|
7
7
|
*/
|
|
8
|
-
children?:
|
|
8
|
+
children?: ReactNode;
|
|
9
9
|
/**
|
|
10
10
|
* 待执行动画css类名
|
|
11
11
|
* @en Css classname of the animation to be executed
|
|
@@ -37,6 +37,12 @@ export declare type TransitionProps = Omit<CSSTransitionProps, 'timeout'> & {
|
|
|
37
37
|
* @default true
|
|
38
38
|
*/
|
|
39
39
|
unmountOnExit?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 动画时长变量标识
|
|
42
|
+
* @en Animation duration variable identifier
|
|
43
|
+
* @default type 属性值
|
|
44
|
+
*/
|
|
45
|
+
transitionVarType?: string;
|
|
40
46
|
};
|
|
41
47
|
/**
|
|
42
48
|
* react-transition-group/CSSTransition 的简单封装。
|
package/cjs/transition/index.js
CHANGED
|
@@ -9,14 +9,19 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
|
|
12
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
14
|
var _CSSTransition = _interopRequireDefault(require("react-transition-group/CSSTransition"));
|
|
15
15
|
|
|
16
16
|
var _contextProvider = require("../context-provider");
|
|
17
17
|
|
|
18
|
-
var _excluded = ["children", "type", "in", "timeout", "mountOnEnter", "unmountOnExit"];
|
|
18
|
+
var _excluded = ["children", "type", "in", "timeout", "mountOnEnter", "unmountOnExit", "transitionVarType"];
|
|
19
19
|
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
var DEFAULT_TIMEOUT = 300;
|
|
20
25
|
/**
|
|
21
26
|
* react-transition-group/CSSTransition 的简单封装。
|
|
22
27
|
* @en Simple wrapper for react-transition-group/CSSTransition.
|
|
@@ -25,26 +30,51 @@ var _excluded = ["children", "type", "in", "timeout", "mountOnEnter", "unmountOn
|
|
|
25
30
|
* @name 动画过渡
|
|
26
31
|
* @name_en Transition
|
|
27
32
|
*/
|
|
33
|
+
|
|
28
34
|
function Transition(props) {
|
|
29
35
|
var _props$children = props.children,
|
|
30
36
|
children = _props$children === void 0 ? /*#__PURE__*/_react.default.createElement("div", null) : _props$children,
|
|
31
37
|
type = props.type,
|
|
32
38
|
transIn = props.in,
|
|
33
39
|
_props$timeout = props.timeout,
|
|
34
|
-
timeout = _props$timeout === void 0 ?
|
|
40
|
+
timeout = _props$timeout === void 0 ? DEFAULT_TIMEOUT : _props$timeout,
|
|
35
41
|
_props$mountOnEnter = props.mountOnEnter,
|
|
36
42
|
mountOnEnter = _props$mountOnEnter === void 0 ? true : _props$mountOnEnter,
|
|
37
43
|
_props$unmountOnExit = props.unmountOnExit,
|
|
38
44
|
unmountOnExit = _props$unmountOnExit === void 0 ? true : _props$unmountOnExit,
|
|
45
|
+
transitionVarType = props.transitionVarType,
|
|
39
46
|
restProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
var varPrefix = "builtin-transition-" + (transitionVarType || type); // 计算动画时长,支持对象形式的 timeout
|
|
48
|
+
|
|
49
|
+
var getDuration = function getDuration(phase) {
|
|
50
|
+
if (typeof timeout === 'number') {
|
|
51
|
+
return timeout;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return timeout[phase] || DEFAULT_TIMEOUT;
|
|
55
|
+
}; // 生成 CSS 变量样式
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
var cssVariables = (0, _react.useMemo)(function () {
|
|
59
|
+
var _ref;
|
|
60
|
+
|
|
61
|
+
var enterDuration = getDuration('enter');
|
|
62
|
+
var exitDuration = getDuration('exit');
|
|
63
|
+
var appearDuration = getDuration('appear');
|
|
64
|
+
return _ref = {}, _ref["--" + varPrefix + "-enter-duration"] = enterDuration + "ms", _ref["--" + varPrefix + "-exit-duration"] = exitDuration + "ms", _ref["--" + varPrefix + "-appear-duration"] = appearDuration + "ms", _ref;
|
|
65
|
+
}, [timeout, varPrefix]);
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref2) {
|
|
67
|
+
var _props;
|
|
68
|
+
|
|
69
|
+
var prefixCls = _ref2.prefixCls;
|
|
42
70
|
return /*#__PURE__*/_react.default.createElement(_CSSTransition.default, (0, _extends2.default)({
|
|
43
71
|
in: transIn,
|
|
44
72
|
timeout: timeout,
|
|
45
73
|
classNames: prefixCls + "-" + type,
|
|
46
74
|
mountOnEnter: mountOnEnter,
|
|
47
75
|
unmountOnExit: unmountOnExit
|
|
48
|
-
}, restProps), children
|
|
76
|
+
}, restProps), /*#__PURE__*/(0, _react.cloneElement)(children, {
|
|
77
|
+
style: (0, _extends2.default)({}, cssVariables, children == null ? void 0 : (_props = children.props) == null ? void 0 : _props.style)
|
|
78
|
+
}));
|
|
49
79
|
});
|
|
50
80
|
}
|
|
@@ -75,6 +75,24 @@
|
|
|
75
75
|
* }
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
+
/**
|
|
79
|
+
* 为属性设置 transition 变量
|
|
80
|
+
* @desc {en} set the transition variable for the attribute
|
|
81
|
+
* @param @transitionVariable transition 变量名
|
|
82
|
+
* @param @transitionVariable {en} transition variable name
|
|
83
|
+
* @param @backupVariable 备份变量名
|
|
84
|
+
* @param @backupVariable {en} backup variable name
|
|
85
|
+
* @param @property css属性名
|
|
86
|
+
* @param @property {en} css property
|
|
87
|
+
* @example
|
|
88
|
+
* ```
|
|
89
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
|
90
|
+
*
|
|
91
|
+
* .demo {
|
|
92
|
+
* .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
78
96
|
/**
|
|
79
97
|
* 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
|
|
80
98
|
* @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
|
|
@@ -517,8 +535,8 @@
|
|
|
517
535
|
opacity: 1;
|
|
518
536
|
-webkit-transition-property: opacity;
|
|
519
537
|
transition-property: opacity;
|
|
520
|
-
-webkit-transition-duration: 300ms ;
|
|
521
|
-
transition-duration: 300ms ;
|
|
538
|
+
-webkit-transition-duration: var(--builtin-transition-fade-enter-duration, 300ms );
|
|
539
|
+
transition-duration: var(--builtin-transition-fade-enter-duration, 300ms );
|
|
522
540
|
}
|
|
523
541
|
.arco-fade-exit {
|
|
524
542
|
opacity: 1;
|
|
@@ -527,8 +545,8 @@
|
|
|
527
545
|
opacity: 0;
|
|
528
546
|
-webkit-transition-property: opacity;
|
|
529
547
|
transition-property: opacity;
|
|
530
|
-
-webkit-transition-duration: 300ms ;
|
|
531
|
-
transition-duration: 300ms ;
|
|
548
|
+
-webkit-transition-duration: var(--builtin-transition-fade-exit-duration, 300ms );
|
|
549
|
+
transition-duration: var(--builtin-transition-fade-exit-duration, 300ms );
|
|
532
550
|
}
|
|
533
551
|
.arco-fade-exit-done {
|
|
534
552
|
display: none;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
&-enter-active {
|
|
10
10
|
opacity: 1;
|
|
11
11
|
transition-property: opacity;
|
|
12
|
-
.use-var(transition-duration, transition-fade-duration);
|
|
12
|
+
.use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
&-exit {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
&-exit-active {
|
|
20
20
|
opacity: 0;
|
|
21
21
|
transition-property: opacity;
|
|
22
|
-
.use-var(transition-duration, transition-fade-duration);
|
|
22
|
+
.use-transition-var(builtin-transition-fade-exit-duration, transition-fade-duration);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
&-exit-done {
|
|
@@ -75,6 +75,24 @@
|
|
|
75
75
|
* }
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
+
/**
|
|
79
|
+
* 为属性设置 transition 变量
|
|
80
|
+
* @desc {en} set the transition variable for the attribute
|
|
81
|
+
* @param @transitionVariable transition 变量名
|
|
82
|
+
* @param @transitionVariable {en} transition variable name
|
|
83
|
+
* @param @backupVariable 备份变量名
|
|
84
|
+
* @param @backupVariable {en} backup variable name
|
|
85
|
+
* @param @property css属性名
|
|
86
|
+
* @param @property {en} css property
|
|
87
|
+
* @example
|
|
88
|
+
* ```
|
|
89
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
|
90
|
+
*
|
|
91
|
+
* .demo {
|
|
92
|
+
* .use-transition-var(builtin-transition-fade-enter-duration, transition-fade-duration);
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
78
96
|
/**
|
|
79
97
|
* 在常规模式和 rtl 模式下为属性设置 arco 提供的 token 变量
|
|
80
98
|
* @desc {en} set the token variable provided by Arco for the attribute in regular mode and RTL mode
|
package/dist/index.js
CHANGED
|
@@ -5240,7 +5240,8 @@
|
|
|
5240
5240
|
tabBarStyle = props.tabBarStyle,
|
|
5241
5241
|
tabBarClass = props.tabBarClass,
|
|
5242
5242
|
translateZ = props.translateZ,
|
|
5243
|
-
tabBarStopPropagation = props.tabBarStopPropagation
|
|
5243
|
+
tabBarStopPropagation = props.tabBarStopPropagation,
|
|
5244
|
+
onUnderlineFirstShow = props.onUnderlineFirstShow;
|
|
5244
5245
|
var prefix = prefixCls + "-tab-cell";
|
|
5245
5246
|
var useRtl = React.useContext(GlobalContext).useRtl;
|
|
5246
5247
|
var domRef = React.useRef(null);
|
|
@@ -5316,6 +5317,13 @@
|
|
|
5316
5317
|
React.useEffect(function () {
|
|
5317
5318
|
updateScrollPosition();
|
|
5318
5319
|
}, [activeIndex, wrapSize]);
|
|
5320
|
+
React.useEffect(function () {
|
|
5321
|
+
// underline 首次展示时,通知父组件启用 cellTrans
|
|
5322
|
+
// @en When underline is first shown, notify parent component to enable cellTrans
|
|
5323
|
+
if (showLine && onUnderlineFirstShow) {
|
|
5324
|
+
onUnderlineFirstShow();
|
|
5325
|
+
}
|
|
5326
|
+
}, [showLine]);
|
|
5319
5327
|
useUpdateEffect(function () {
|
|
5320
5328
|
var _a;
|
|
5321
5329
|
|
|
@@ -6703,13 +6711,14 @@
|
|
|
6703
6711
|
cellRef.current && cellRef.current.scrollToCenter();
|
|
6704
6712
|
}
|
|
6705
6713
|
|
|
6714
|
+
setCellTrans(true);
|
|
6715
|
+
setPaneTrans(true);
|
|
6716
|
+
|
|
6706
6717
|
if (!touchStartedRef.current || posAdjustingRef.current || scrollingRef.current || !touchMovedRef.current) {
|
|
6707
6718
|
return;
|
|
6708
6719
|
}
|
|
6709
6720
|
|
|
6710
6721
|
touchStartedRef.current = false;
|
|
6711
|
-
setCellTrans(true);
|
|
6712
|
-
setPaneTrans(true);
|
|
6713
6722
|
var touchEndTime = new Date().getTime();
|
|
6714
6723
|
var dis = distanceRef.current;
|
|
6715
6724
|
var speed = dis / (touchEndTime - touchStartTimeRef.current) * 1000;
|
|
@@ -6843,7 +6852,10 @@
|
|
|
6843
6852
|
renderTabBarInner: renderTabBarInner,
|
|
6844
6853
|
tabBarStyle: tabBarStyle,
|
|
6845
6854
|
tabBarClass: tabBarClass,
|
|
6846
|
-
tabBarStopPropagation: tabBarStopPropagation
|
|
6855
|
+
tabBarStopPropagation: tabBarStopPropagation,
|
|
6856
|
+
onUnderlineFirstShow: function onUnderlineFirstShow() {
|
|
6857
|
+
return setCellTrans(true);
|
|
6858
|
+
}
|
|
6847
6859
|
}, commonProps);
|
|
6848
6860
|
|
|
6849
6861
|
var CellComp = /*#__PURE__*/React__default["default"].createElement(TabCell, __assign$3({}, cellProps));
|
|
@@ -8778,6 +8790,7 @@
|
|
|
8778
8790
|
};
|
|
8779
8791
|
CSSTransition.propTypes = {};
|
|
8780
8792
|
|
|
8793
|
+
var DEFAULT_TIMEOUT = 300;
|
|
8781
8794
|
/**
|
|
8782
8795
|
* react-transition-group/CSSTransition 的简单封装。
|
|
8783
8796
|
* @en Simple wrapper for react-transition-group/CSSTransition.
|
|
@@ -8793,14 +8806,36 @@
|
|
|
8793
8806
|
type = props.type,
|
|
8794
8807
|
transIn = props.in,
|
|
8795
8808
|
_b = props.timeout,
|
|
8796
|
-
timeout = _b === void 0 ?
|
|
8809
|
+
timeout = _b === void 0 ? DEFAULT_TIMEOUT : _b,
|
|
8797
8810
|
_c = props.mountOnEnter,
|
|
8798
8811
|
mountOnEnter = _c === void 0 ? true : _c,
|
|
8799
8812
|
_d = props.unmountOnExit,
|
|
8800
8813
|
unmountOnExit = _d === void 0 ? true : _d,
|
|
8801
|
-
|
|
8814
|
+
transitionVarType = props.transitionVarType,
|
|
8815
|
+
restProps = __rest$1(props, ["children", "type", "in", "timeout", "mountOnEnter", "unmountOnExit", "transitionVarType"]);
|
|
8802
8816
|
|
|
8817
|
+
var varPrefix = "builtin-transition-" + (transitionVarType || type); // 计算动画时长,支持对象形式的 timeout
|
|
8818
|
+
|
|
8819
|
+
var getDuration = function getDuration(phase) {
|
|
8820
|
+
if (typeof timeout === 'number') {
|
|
8821
|
+
return timeout;
|
|
8822
|
+
}
|
|
8823
|
+
|
|
8824
|
+
return timeout[phase] || DEFAULT_TIMEOUT;
|
|
8825
|
+
}; // 生成 CSS 变量样式
|
|
8826
|
+
|
|
8827
|
+
|
|
8828
|
+
var cssVariables = React.useMemo(function () {
|
|
8829
|
+
var _a;
|
|
8830
|
+
|
|
8831
|
+
var enterDuration = getDuration('enter');
|
|
8832
|
+
var exitDuration = getDuration('exit');
|
|
8833
|
+
var appearDuration = getDuration('appear');
|
|
8834
|
+
return _a = {}, _a["--" + varPrefix + "-enter-duration"] = enterDuration + "ms", _a["--" + varPrefix + "-exit-duration"] = exitDuration + "ms", _a["--" + varPrefix + "-appear-duration"] = appearDuration + "ms", _a;
|
|
8835
|
+
}, [timeout, varPrefix]);
|
|
8803
8836
|
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
|
|
8837
|
+
var _b, _c;
|
|
8838
|
+
|
|
8804
8839
|
var prefixCls = _a.prefixCls;
|
|
8805
8840
|
return /*#__PURE__*/React__default["default"].createElement(CSSTransition, __assign$3({
|
|
8806
8841
|
in: transIn,
|
|
@@ -8808,7 +8843,9 @@
|
|
|
8808
8843
|
classNames: prefixCls + "-" + type,
|
|
8809
8844
|
mountOnEnter: mountOnEnter,
|
|
8810
8845
|
unmountOnExit: unmountOnExit
|
|
8811
|
-
}, restProps), children
|
|
8846
|
+
}, restProps), /*#__PURE__*/React.cloneElement(children, {
|
|
8847
|
+
style: __assign$3(__assign$3({}, cssVariables), (_c = (_b = children) === null || _b === void 0 ? void 0 : _b.props) === null || _c === void 0 ? void 0 : _c.style)
|
|
8848
|
+
}));
|
|
8812
8849
|
});
|
|
8813
8850
|
}
|
|
8814
8851
|
|
|
@@ -8904,6 +8941,7 @@
|
|
|
8904
8941
|
maskTransitionType = _b === void 0 ? 'fade' : _b,
|
|
8905
8942
|
_c = props.contentTransitionType,
|
|
8906
8943
|
contentTransitionType = _c === void 0 ? 'fade' : _c,
|
|
8944
|
+
contentTransitionVarType = props.contentTransitionVarType,
|
|
8907
8945
|
_d = props.maskTransitionTimeout,
|
|
8908
8946
|
maskTransitionTimeout = _d === void 0 ? 300 : _d,
|
|
8909
8947
|
_e = props.contentTransitionTimeout,
|
|
@@ -9048,6 +9086,7 @@
|
|
|
9048
9086
|
in: innerVisible,
|
|
9049
9087
|
timeout: contentTransitionTimeout,
|
|
9050
9088
|
type: contentTransitionType,
|
|
9089
|
+
transitionVarType: contentTransitionVarType,
|
|
9051
9090
|
mountOnEnter: mountOnEnter,
|
|
9052
9091
|
unmountOnExit: unmountOnExit,
|
|
9053
9092
|
nodeRef: contentRef
|
|
@@ -9128,6 +9167,7 @@
|
|
|
9128
9167
|
translateZ: translateZ
|
|
9129
9168
|
}, maskClass),
|
|
9130
9169
|
contentTransitionType: contentTransitionType || "slide-from-" + direction,
|
|
9170
|
+
contentTransitionVarType: "popup-slide",
|
|
9131
9171
|
contentClass: cls(prefix + "-content", direction, {
|
|
9132
9172
|
'need-bottom-offset': needBottomOffset
|
|
9133
9173
|
}, {
|
|
@@ -10077,7 +10117,7 @@
|
|
|
10077
10117
|
_h = props.bordered,
|
|
10078
10118
|
bordered = _h === void 0 ? false : _h,
|
|
10079
10119
|
_j = props.timeout,
|
|
10080
|
-
timeout = _j === void 0 ?
|
|
10120
|
+
timeout = _j === void 0 ? 400 : _j;
|
|
10081
10121
|
var domRef = React.useRef(null);
|
|
10082
10122
|
React.useImperativeHandle(ref, function () {
|
|
10083
10123
|
return {
|
|
@@ -14365,7 +14405,10 @@
|
|
|
14365
14405
|
_h = props.maskTransitionTimeout,
|
|
14366
14406
|
maskTransitionTimeout = _h === void 0 ? 300 : _h,
|
|
14367
14407
|
_j = props.contentTransitionTimeout,
|
|
14368
|
-
contentTransitionTimeout = _j === void 0 ?
|
|
14408
|
+
contentTransitionTimeout = _j === void 0 ? nowSystem === 'android' ? 300 : {
|
|
14409
|
+
enter: 450,
|
|
14410
|
+
exit: 150
|
|
14411
|
+
} : _j,
|
|
14369
14412
|
extra = props.extra,
|
|
14370
14413
|
restProps = __rest$1(props, ["close", "children", "title", "footer", "footerType", "renderFooter", "footerCollapseCount", "titleAlign", "contentAlign", "className", "maskClass", "contentClass", "contentStyle", "contentTransitionType", "maskTransitionTimeout", "contentTransitionTimeout", "extra"]);
|
|
14371
14414
|
|
|
@@ -21645,6 +21688,7 @@
|
|
|
21645
21688
|
};
|
|
21646
21689
|
});
|
|
21647
21690
|
var uploadFunc = new Upload(__assign$3(__assign$3({}, props), {
|
|
21691
|
+
onUploadClick: props.onUploadClick || props.onSelectClick,
|
|
21648
21692
|
files: images
|
|
21649
21693
|
}), fileRef, cacheRef);
|
|
21650
21694
|
|
|
@@ -28294,23 +28338,33 @@
|
|
|
28294
28338
|
_onOpen = props.onOpen,
|
|
28295
28339
|
_onClose = props.onClose,
|
|
28296
28340
|
close = props.close,
|
|
28297
|
-
|
|
28341
|
+
_f = props.maskTransitionTimeout,
|
|
28342
|
+
maskTransitionTimeout = _f === void 0 ? {
|
|
28343
|
+
enter: 450,
|
|
28344
|
+
exit: 240
|
|
28345
|
+
} : _f,
|
|
28346
|
+
_g = props.contentTransitionTimeout,
|
|
28347
|
+
contentTransitionTimeout = _g === void 0 ? {
|
|
28348
|
+
enter: 450,
|
|
28349
|
+
exit: 240
|
|
28350
|
+
} : _g,
|
|
28351
|
+
otherProps = __rest$1(props, ["className", "visible", "children", "maskStyle", "contentStyle", "direction", "percentToClose", "distanceToClose", "speedToClose", "allowSwipeDirections", "exitDirection", "onTouchMove", "onTouchStart", "onTouchEnd", "onOpen", "onClose", "close", "maskTransitionTimeout", "contentTransitionTimeout"]);
|
|
28298
28352
|
|
|
28299
|
-
var
|
|
28300
|
-
opened =
|
|
28301
|
-
setOpened =
|
|
28353
|
+
var _h = React.useState(visible),
|
|
28354
|
+
opened = _h[0],
|
|
28355
|
+
setOpened = _h[1];
|
|
28302
28356
|
|
|
28303
|
-
var
|
|
28357
|
+
var _j = useRefState({
|
|
28304
28358
|
direction: 'X',
|
|
28305
28359
|
value: 0
|
|
28306
28360
|
}),
|
|
28307
|
-
distance =
|
|
28308
|
-
distanceRef =
|
|
28309
|
-
setDistance =
|
|
28361
|
+
distance = _j[0],
|
|
28362
|
+
distanceRef = _j[1],
|
|
28363
|
+
setDistance = _j[2];
|
|
28310
28364
|
|
|
28311
|
-
var
|
|
28312
|
-
hasTrans =
|
|
28313
|
-
setHasTrans =
|
|
28365
|
+
var _k = React.useState(false),
|
|
28366
|
+
hasTrans = _k[0],
|
|
28367
|
+
setHasTrans = _k[1];
|
|
28314
28368
|
|
|
28315
28369
|
var popupRef = React.useRef(null);
|
|
28316
28370
|
var touchStartXRef = React.useRef(0);
|
|
@@ -28439,7 +28493,12 @@
|
|
|
28439
28493
|
setDistance({
|
|
28440
28494
|
direction: 'X',
|
|
28441
28495
|
value: 0
|
|
28442
|
-
});
|
|
28496
|
+
}); // 动画完成后需重置
|
|
28497
|
+
// @en Reset after animation is complete
|
|
28498
|
+
|
|
28499
|
+
setTimeout(function () {
|
|
28500
|
+
setHasTrans(false);
|
|
28501
|
+
}, Math.max(typeof maskTransitionTimeout === 'number' ? maskTransitionTimeout : (maskTransitionTimeout === null || maskTransitionTimeout === void 0 ? void 0 : maskTransitionTimeout.exit) || 0, typeof contentTransitionTimeout === 'number' ? contentTransitionTimeout : (contentTransitionTimeout === null || contentTransitionTimeout === void 0 ? void 0 : contentTransitionTimeout.exit) || 0, 240));
|
|
28443
28502
|
}
|
|
28444
28503
|
|
|
28445
28504
|
touchStartTimeRef.current = 0;
|
|
@@ -28504,7 +28563,9 @@
|
|
|
28504
28563
|
maskStyle: __assign$3(__assign$3({}, maskStyle || {}), {
|
|
28505
28564
|
opacity: percent ? 1 - percent : void 0
|
|
28506
28565
|
}),
|
|
28507
|
-
contentStyle: getContentStyle()
|
|
28566
|
+
contentStyle: getContentStyle(),
|
|
28567
|
+
maskTransitionTimeout: maskTransitionTimeout,
|
|
28568
|
+
contentTransitionTimeout: contentTransitionTimeout
|
|
28508
28569
|
}, otherProps), children);
|
|
28509
28570
|
});
|
|
28510
28571
|
});
|