@nutui/nutui-react-taro 3.0.19-cpp.28 → 3.0.19-cpp.29-beta.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/dist/cjs/packages/calendar/style/calendar.scss +32 -1
- package/dist/cjs/packages/calendar/style/style.css +21 -1
- package/dist/cjs/packages/calendar/style/style.harmony.css +21 -1
- package/dist/cjs/packages/calendar/style-jmapp/calendar.scss +32 -1
- package/dist/cjs/packages/calendar/style-jmapp/style.css +21 -1
- package/dist/cjs/packages/calendar/style-jrkf/calendar.scss +32 -1
- package/dist/cjs/packages/calendar/style-jrkf/style.css +21 -1
- package/dist/cjs/packages/calendarcard/icon.js +4 -10
- package/dist/cjs/packages/calendarcard/style/calendarcard.scss +13 -0
- package/dist/cjs/packages/calendarcard/style/style.css +8 -0
- package/dist/cjs/packages/calendarcard/style/style.harmony.css +8 -0
- package/dist/cjs/packages/calendarcard/style-jmapp/calendarcard.scss +13 -0
- package/dist/cjs/packages/calendarcard/style-jmapp/style.css +8 -0
- package/dist/cjs/packages/calendarcard/style-jrkf/calendarcard.scss +13 -0
- package/dist/cjs/packages/calendarcard/style-jrkf/style.css +8 -0
- package/dist/cjs/packages/popup/popup.js +16 -8
- package/dist/cjs/types/spec/popup/base.d.ts +2 -0
- package/dist/cjs/utils/taro/ConfigurableCSSTransition copy.d.ts +15 -0
- package/dist/cjs/utils/taro/ConfigurableCSSTransition copy.js +130 -0
- package/dist/es/packages/calendar/style/calendar.scss +32 -1
- package/dist/es/packages/calendar/style/style.css +21 -1
- package/dist/es/packages/calendar/style/style.harmony.css +21 -1
- package/dist/es/packages/calendar/style-jmapp/calendar.scss +32 -1
- package/dist/es/packages/calendar/style-jmapp/style.css +21 -1
- package/dist/es/packages/calendar/style-jrkf/calendar.scss +32 -1
- package/dist/es/packages/calendar/style-jrkf/style.css +21 -1
- package/dist/es/packages/calendarcard/icon.js +5 -11
- package/dist/es/packages/calendarcard/style/calendarcard.scss +13 -0
- package/dist/es/packages/calendarcard/style/style.css +8 -0
- package/dist/es/packages/calendarcard/style/style.harmony.css +8 -0
- package/dist/es/packages/calendarcard/style-jmapp/calendarcard.scss +13 -0
- package/dist/es/packages/calendarcard/style-jmapp/style.css +8 -0
- package/dist/es/packages/calendarcard/style-jrkf/calendarcard.scss +13 -0
- package/dist/es/packages/calendarcard/style-jrkf/style.css +8 -0
- package/dist/es/packages/popup/popup.js +16 -8
- package/dist/es/types/spec/popup/base.d.ts +2 -0
- package/dist/es/utils/taro/ConfigurableCSSTransition copy.d.ts +15 -0
- package/dist/es/utils/taro/ConfigurableCSSTransition copy.js +119 -0
- package/dist/nutui.react.umd.js +20 -18
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +35 -35
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +34 -34
- package/dist/style.css +1 -1
- package/dist/style.scss +34 -34
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Image
|
|
2
|
+
import { Image } from "@tarojs/components";
|
|
3
3
|
var left = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNNi42MDUgOS40OWEuNzcxLjc3MSAwIDAgMSAwLS45OGwzLjYtNC4zNzJhLjc3MS43NzEgMCAwIDEgMS4xOS45ODFMOC4yIDlsMy4xOTcgMy44ODFhLjc3MS43NzEgMCAxIDEtMS4xOTEuOThsLTMuNi00LjM3eiIvPjwvc3ZnPg==';
|
|
4
4
|
var right = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNMTEuMzk2IDkuNDlhLjc3MS43NzEgMCAwIDAgMC0uOThsLTMuNi00LjM3MmEuNzcxLjc3MSAwIDAgMC0xLjE5MS45ODFMOS44IDlsLTMuMTk2IDMuODgxYS43NzEuNzcxIDAgMCAwIDEuMTkuOThsMy42LTQuMzd6Ii8+PC9zdmc+';
|
|
5
5
|
var doubleLeft = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48cGF0aCBkPSJNMTMuODUzIDQuMDI2YS43NzEuNzcxIDAgMCAxIC4xMiAxLjA4NUwxMC44NjQgOWwzLjExIDMuODg5YS43NzEuNzcxIDAgMSAxLTEuMjA0Ljk2M2wtMy40OTgtNC4zN2EuNzcxLjc3MSAwIDAgMSAwLS45NjRsMy40OTctNC4zNzFhLjc3MS43NzEgMCAwIDEgMS4wODQtLjEyem0tNS4yNDUgMGEuNzcxLjc3MSAwIDAgMSAuMTIgMS4wODVMNS42MTcgOWwzLjExMSAzLjg4OWEuNzcxLjc3MSAwIDAgMS0xLjIwNS45NjNsLTMuNDk3LTQuMzdhLjc3MS43NzEgMCAwIDEgMC0uOTY0bDMuNDk3LTQuMzcxYS43NzEuNzcxIDAgMCAxIDEuMDg1LS4xMnoiLz48L3N2Zz4=';
|
|
@@ -13,19 +13,13 @@ if (process.env.TARO_ENV === 'jdharmony_cpp') {
|
|
|
13
13
|
var Icon = function(param) {
|
|
14
14
|
var url = param.url;
|
|
15
15
|
var style = {
|
|
16
|
-
background: "url('".concat(url, "') no-repeat center"),
|
|
17
|
-
backgroundSize: '100% 100%',
|
|
18
16
|
width: 18,
|
|
19
17
|
height: 18
|
|
20
18
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return /*#__PURE__*/ React.createElement(View, {
|
|
28
|
-
style: style
|
|
19
|
+
return /*#__PURE__*/ React.createElement(Image, {
|
|
20
|
+
src: url,
|
|
21
|
+
style: style,
|
|
22
|
+
mode: "aspectFit"
|
|
29
23
|
});
|
|
30
24
|
};
|
|
31
25
|
export var ArrowLeft = function() {
|
|
@@ -49,6 +49,13 @@
|
|
|
49
49
|
margin-bottom: 4px;
|
|
50
50
|
text-align: center;
|
|
51
51
|
|
|
52
|
+
// 部分 Taro 机型下子节点不会稳定继承父级 color,颜色直接落到最内层文案。
|
|
53
|
+
&-top,
|
|
54
|
+
&-inner,
|
|
55
|
+
&-bottom {
|
|
56
|
+
color: $color-title;
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
&.header {
|
|
53
60
|
cursor: auto;
|
|
54
61
|
}
|
|
@@ -66,6 +73,12 @@
|
|
|
66
73
|
|
|
67
74
|
&.weekend {
|
|
68
75
|
color: $calendar-choose-color;
|
|
76
|
+
|
|
77
|
+
.nut-calendarcard-day-top,
|
|
78
|
+
.nut-calendarcard-day-inner,
|
|
79
|
+
.nut-calendarcard-day-bottom {
|
|
80
|
+
color: $calendar-choose-color;
|
|
81
|
+
}
|
|
69
82
|
}
|
|
70
83
|
|
|
71
84
|
&.active {
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
margin-bottom: 4px;
|
|
48
48
|
text-align: center;
|
|
49
49
|
}
|
|
50
|
+
.nut-calendarcard-day-top, .nut-calendarcard-day-inner, .nut-calendarcard-day-bottom {
|
|
51
|
+
color: var(--nutui-color-title, #1a1a1a);
|
|
52
|
+
}
|
|
50
53
|
.nut-calendarcard-day.header {
|
|
51
54
|
cursor: auto;
|
|
52
55
|
}
|
|
@@ -62,6 +65,11 @@
|
|
|
62
65
|
.nut-calendarcard-day.weekend {
|
|
63
66
|
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff0f23));
|
|
64
67
|
}
|
|
68
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-top,
|
|
69
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-inner,
|
|
70
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-bottom {
|
|
71
|
+
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff0f23));
|
|
72
|
+
}
|
|
65
73
|
.nut-calendarcard-day.active {
|
|
66
74
|
background-color: var(--nutui-calendar-active-background-color, var(--nutui-color-primary, #ff0f23));
|
|
67
75
|
border-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
margin-bottom: 4px;
|
|
48
48
|
text-align: center;
|
|
49
49
|
}
|
|
50
|
+
.nut-calendarcard-day-top, .nut-calendarcard-day-inner, .nut-calendarcard-day-bottom {
|
|
51
|
+
color: var(--nutui-color-title, #1a1a1a);
|
|
52
|
+
}
|
|
50
53
|
.nut-calendarcard-day.header {
|
|
51
54
|
cursor: auto;
|
|
52
55
|
}
|
|
@@ -62,6 +65,11 @@
|
|
|
62
65
|
.nut-calendarcard-day.weekend {
|
|
63
66
|
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff0f23));
|
|
64
67
|
}
|
|
68
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-top,
|
|
69
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-inner,
|
|
70
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-bottom {
|
|
71
|
+
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff0f23));
|
|
72
|
+
}
|
|
65
73
|
.nut-calendarcard-day.active {
|
|
66
74
|
background-color: var(--nutui-calendar-active-background-color, var(--nutui-color-primary, #ff0f23));
|
|
67
75
|
border-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
@@ -49,6 +49,13 @@
|
|
|
49
49
|
margin-bottom: 4px;
|
|
50
50
|
text-align: center;
|
|
51
51
|
|
|
52
|
+
// 部分 Taro 机型下子节点不会稳定继承父级 color,颜色直接落到最内层文案。
|
|
53
|
+
&-top,
|
|
54
|
+
&-inner,
|
|
55
|
+
&-bottom {
|
|
56
|
+
color: $color-title;
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
&.header {
|
|
53
60
|
cursor: auto;
|
|
54
61
|
}
|
|
@@ -66,6 +73,12 @@
|
|
|
66
73
|
|
|
67
74
|
&.weekend {
|
|
68
75
|
color: $calendar-choose-color;
|
|
76
|
+
|
|
77
|
+
.nut-calendarcard-day-top,
|
|
78
|
+
.nut-calendarcard-day-inner,
|
|
79
|
+
.nut-calendarcard-day-bottom {
|
|
80
|
+
color: $calendar-choose-color;
|
|
81
|
+
}
|
|
69
82
|
}
|
|
70
83
|
|
|
71
84
|
&.active {
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
margin-bottom: 4px;
|
|
48
48
|
text-align: center;
|
|
49
49
|
}
|
|
50
|
+
.nut-calendarcard-day-top, .nut-calendarcard-day-inner, .nut-calendarcard-day-bottom {
|
|
51
|
+
color: var(--nutui-color-title);
|
|
52
|
+
}
|
|
50
53
|
.nut-calendarcard-day.header {
|
|
51
54
|
cursor: auto;
|
|
52
55
|
}
|
|
@@ -62,6 +65,11 @@
|
|
|
62
65
|
.nut-calendarcard-day.weekend {
|
|
63
66
|
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary));
|
|
64
67
|
}
|
|
68
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-top,
|
|
69
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-inner,
|
|
70
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-bottom {
|
|
71
|
+
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary));
|
|
72
|
+
}
|
|
65
73
|
.nut-calendarcard-day.active {
|
|
66
74
|
background-color: var(--nutui-calendar-active-background-color, var(--nutui-color-primary));
|
|
67
75
|
border-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
@@ -49,6 +49,13 @@
|
|
|
49
49
|
margin-bottom: 4px;
|
|
50
50
|
text-align: center;
|
|
51
51
|
|
|
52
|
+
// 部分 Taro 机型下子节点不会稳定继承父级 color,颜色直接落到最内层文案。
|
|
53
|
+
&-top,
|
|
54
|
+
&-inner,
|
|
55
|
+
&-bottom {
|
|
56
|
+
color: $color-title;
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
&.header {
|
|
53
60
|
cursor: auto;
|
|
54
61
|
}
|
|
@@ -66,6 +73,12 @@
|
|
|
66
73
|
|
|
67
74
|
&.weekend {
|
|
68
75
|
color: $calendar-choose-color;
|
|
76
|
+
|
|
77
|
+
.nut-calendarcard-day-top,
|
|
78
|
+
.nut-calendarcard-day-inner,
|
|
79
|
+
.nut-calendarcard-day-bottom {
|
|
80
|
+
color: $calendar-choose-color;
|
|
81
|
+
}
|
|
69
82
|
}
|
|
70
83
|
|
|
71
84
|
&.active {
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
margin-bottom: 4px;
|
|
48
48
|
text-align: center;
|
|
49
49
|
}
|
|
50
|
+
.nut-calendarcard-day-top, .nut-calendarcard-day-inner, .nut-calendarcard-day-bottom {
|
|
51
|
+
color: var(--nutui-color-title);
|
|
52
|
+
}
|
|
50
53
|
.nut-calendarcard-day.header {
|
|
51
54
|
cursor: auto;
|
|
52
55
|
}
|
|
@@ -62,6 +65,11 @@
|
|
|
62
65
|
.nut-calendarcard-day.weekend {
|
|
63
66
|
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff6666));
|
|
64
67
|
}
|
|
68
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-top,
|
|
69
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-inner,
|
|
70
|
+
.nut-calendarcard-day.weekend .nut-calendarcard-day-bottom {
|
|
71
|
+
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff6666));
|
|
72
|
+
}
|
|
65
73
|
.nut-calendarcard-day.active {
|
|
66
74
|
background-color: var(--nutui-calendar-active-background-color, var(--nutui-color-primary, #ff6666));
|
|
67
75
|
border-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
@@ -42,13 +42,21 @@ var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps),
|
|
|
42
42
|
},
|
|
43
43
|
onTouchStart: function() {},
|
|
44
44
|
onTouchMove: function() {},
|
|
45
|
-
onTouchEnd: function() {}
|
|
45
|
+
onTouchEnd: function() {},
|
|
46
|
+
overlayProps: {},
|
|
47
|
+
animated: true
|
|
46
48
|
});
|
|
47
49
|
// 默认1000,参看variables
|
|
48
50
|
var _zIndex = 1100;
|
|
49
51
|
export var Popup = function(props) {
|
|
50
|
-
var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left = _$_object_spread.left, title = _$_object_spread.title, top = _$_object_spread.top, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, resizable = _$_object_spread.resizable, minHeight = _$_object_spread.minHeight, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick, onTouchStart = _$_object_spread.onTouchStart, onTouchMove = _$_object_spread.onTouchMove, onTouchEnd = _$_object_spread.onTouchEnd, closeAriaLabel = _$_object_spread.closeAriaLabel;
|
|
52
|
+
var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left = _$_object_spread.left, title = _$_object_spread.title, top = _$_object_spread.top, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, resizable = _$_object_spread.resizable, minHeight = _$_object_spread.minHeight, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick, onTouchStart = _$_object_spread.onTouchStart, onTouchMove = _$_object_spread.onTouchMove, onTouchEnd = _$_object_spread.onTouchEnd, closeAriaLabel = _$_object_spread.closeAriaLabel, overlayProps = _$_object_spread.overlayProps, animated = _$_object_spread.animated;
|
|
51
53
|
var locale = useConfig().locale;
|
|
54
|
+
var transitionDuration = useMemo(function() {
|
|
55
|
+
return animated ? Number(duration) : 0;
|
|
56
|
+
}, [
|
|
57
|
+
animated,
|
|
58
|
+
duration
|
|
59
|
+
]);
|
|
52
60
|
var _useState = _sliced_to_array(useState(zIndex || _zIndex), 2), index = _useState[0], setIndex = _useState[1];
|
|
53
61
|
var _useState1 = _sliced_to_array(useState(visible), 2), innerVisible = _useState1[0], setInnerVisible = _useState1[1];
|
|
54
62
|
var _useState2 = _sliced_to_array(useState(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
|
|
@@ -153,14 +161,14 @@ export var Popup = function(props) {
|
|
|
153
161
|
if (destroyOnClose) {
|
|
154
162
|
setTimeout(function() {
|
|
155
163
|
setShowChildren(false);
|
|
156
|
-
},
|
|
164
|
+
}, transitionDuration);
|
|
157
165
|
}
|
|
158
166
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
159
167
|
}
|
|
160
168
|
}, [
|
|
161
169
|
innerVisible,
|
|
162
170
|
destroyOnClose,
|
|
163
|
-
|
|
171
|
+
transitionDuration,
|
|
164
172
|
onClose,
|
|
165
173
|
setInnerVisible,
|
|
166
174
|
setShowChildren
|
|
@@ -340,7 +348,7 @@ export var Popup = function(props) {
|
|
|
340
348
|
classNames: transitionName,
|
|
341
349
|
mountOnEnter: true,
|
|
342
350
|
unmountOnExit: destroyOnClose,
|
|
343
|
-
timeout: Number(
|
|
351
|
+
timeout: Number(transitionDuration),
|
|
344
352
|
in: innerVisible,
|
|
345
353
|
onEntered: afterShow,
|
|
346
354
|
onExited: afterClose
|
|
@@ -359,16 +367,16 @@ export var Popup = function(props) {
|
|
|
359
367
|
}, renderTop(), renderTitle(), showChildren ? children : null));
|
|
360
368
|
};
|
|
361
369
|
var renderNode = function() {
|
|
362
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, overlay ? /*#__PURE__*/ React.createElement(Overlay, {
|
|
370
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, overlay ? /*#__PURE__*/ React.createElement(Overlay, _object_spread({
|
|
363
371
|
zIndex: index,
|
|
364
372
|
style: overlayStyles,
|
|
365
373
|
className: overlayClassName,
|
|
366
374
|
visible: innerVisible,
|
|
367
375
|
closeOnOverlayClick: closeOnOverlayClick,
|
|
368
376
|
lockScroll: lockScroll,
|
|
369
|
-
duration:
|
|
377
|
+
duration: transitionDuration,
|
|
370
378
|
onClick: handleOverlayClick
|
|
371
|
-
}) : null, renderPop());
|
|
379
|
+
}, overlayProps)) : null, renderPop());
|
|
372
380
|
};
|
|
373
381
|
var resolveContainer = function(getContainer) {
|
|
374
382
|
return (typeof getContainer === 'function' ? getContainer() : getContainer) || document.body;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TransitionStatus = 'entering' | 'entered' | 'exiting' | 'exited' | 'unmounted';
|
|
3
|
+
interface CSSTransitionProps {
|
|
4
|
+
in?: boolean;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
classNames?: string;
|
|
7
|
+
nodeRef?: React.RefObject<any>;
|
|
8
|
+
mountOnEnter?: boolean;
|
|
9
|
+
unmountOnExit?: boolean;
|
|
10
|
+
onEntered?: () => void;
|
|
11
|
+
onExited?: () => void;
|
|
12
|
+
children: React.ReactElement;
|
|
13
|
+
}
|
|
14
|
+
declare const ConfigurableCSSTransition: React.FC<CSSTransitionProps>;
|
|
15
|
+
export default ConfigurableCSSTransition;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
2
|
+
import React, { useState, useEffect, useRef, cloneElement, useCallback } from "react";
|
|
3
|
+
var ConfigurableCSSTransition = function(props) {
|
|
4
|
+
var inPhase = props.in, _props_timeout = props.timeout, timeout = _props_timeout === void 0 ? 300 : _props_timeout, tmp = props.classNames, baseClassName = tmp === void 0 ? '' : tmp, nodeRef = props.nodeRef, mountOnEnter = props.mountOnEnter, unmountOnExit = props.unmountOnExit, onEntered = props.onEntered, onExited = props.onExited, children = props.children;
|
|
5
|
+
var _useState = _sliced_to_array(useState(function() {
|
|
6
|
+
if (inPhase) return 'entered';
|
|
7
|
+
return unmountOnExit || mountOnEnter ? 'unmounted' : 'exited';
|
|
8
|
+
}), 2), status = _useState[0], setStatus = _useState[1];
|
|
9
|
+
var _useState1 = _sliced_to_array(useState(function() {
|
|
10
|
+
if (inPhase) return "".concat(baseClassName, "-enter-done");
|
|
11
|
+
return "".concat(baseClassName, "-exit-done");
|
|
12
|
+
}), 2), classes = _useState1[0], setClasses = _useState1[1];
|
|
13
|
+
var fallbackTimerRef = useRef(null);
|
|
14
|
+
var statusRef = useRef(status);
|
|
15
|
+
var prevInPhase = useRef(inPhase);
|
|
16
|
+
var latestOnAnimationEnd = useRef(children.props.onAnimationEnd);
|
|
17
|
+
useEffect(function() {
|
|
18
|
+
latestOnAnimationEnd.current = children.props.onAnimationEnd;
|
|
19
|
+
});
|
|
20
|
+
var updateStatus = useCallback(function(nextStatus) {
|
|
21
|
+
statusRef.current = nextStatus;
|
|
22
|
+
setStatus(nextStatus);
|
|
23
|
+
}, []);
|
|
24
|
+
var handleAnimationEnd = useCallback(function(e) {
|
|
25
|
+
var _latestOnAnimationEnd_current;
|
|
26
|
+
(_latestOnAnimationEnd_current = latestOnAnimationEnd.current) === null || _latestOnAnimationEnd_current === void 0 ? void 0 : _latestOnAnimationEnd_current.call(latestOnAnimationEnd, e);
|
|
27
|
+
if (e && e.target !== e.currentTarget) return;
|
|
28
|
+
if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
|
|
29
|
+
if (statusRef.current === 'entering') {
|
|
30
|
+
updateStatus('entered');
|
|
31
|
+
setClasses("".concat(baseClassName, "-enter-done"));
|
|
32
|
+
onEntered === null || onEntered === void 0 ? void 0 : onEntered();
|
|
33
|
+
} else if (statusRef.current === 'exiting') {
|
|
34
|
+
updateStatus('exited');
|
|
35
|
+
setClasses("".concat(baseClassName, "-exit-done"));
|
|
36
|
+
if (unmountOnExit) {
|
|
37
|
+
updateStatus('unmounted');
|
|
38
|
+
}
|
|
39
|
+
onExited === null || onExited === void 0 ? void 0 : onExited();
|
|
40
|
+
}
|
|
41
|
+
}, [
|
|
42
|
+
baseClassName,
|
|
43
|
+
onEntered,
|
|
44
|
+
onExited,
|
|
45
|
+
unmountOnExit,
|
|
46
|
+
updateStatus
|
|
47
|
+
]);
|
|
48
|
+
var enter = useCallback(function() {
|
|
49
|
+
if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
|
|
50
|
+
if (statusRef.current === 'unmounted') {
|
|
51
|
+
updateStatus('exited');
|
|
52
|
+
}
|
|
53
|
+
if (timeout === 0) {
|
|
54
|
+
updateStatus('entered');
|
|
55
|
+
setClasses("".concat(baseClassName, "-enter-done"));
|
|
56
|
+
onEntered === null || onEntered === void 0 ? void 0 : onEntered();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
updateStatus('entering');
|
|
60
|
+
setClasses("".concat(baseClassName, "-enter ").concat(baseClassName, "-enter-active"));
|
|
61
|
+
// Safety fallback: Give it extra time over the expected timeout in case onAnimationEnd misses
|
|
62
|
+
fallbackTimerRef.current = setTimeout(function() {
|
|
63
|
+
handleAnimationEnd(null);
|
|
64
|
+
}, timeout + 200);
|
|
65
|
+
}, [
|
|
66
|
+
baseClassName,
|
|
67
|
+
handleAnimationEnd,
|
|
68
|
+
onEntered,
|
|
69
|
+
timeout,
|
|
70
|
+
updateStatus
|
|
71
|
+
]);
|
|
72
|
+
var exit = useCallback(function() {
|
|
73
|
+
if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
|
|
74
|
+
if (timeout === 0) {
|
|
75
|
+
updateStatus('exited');
|
|
76
|
+
setClasses("".concat(baseClassName, "-exit-done"));
|
|
77
|
+
if (unmountOnExit) {
|
|
78
|
+
updateStatus('unmounted');
|
|
79
|
+
}
|
|
80
|
+
onExited === null || onExited === void 0 ? void 0 : onExited();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
updateStatus('exiting');
|
|
84
|
+
setClasses("".concat(baseClassName, "-exit ").concat(baseClassName, "-exit-active"));
|
|
85
|
+
fallbackTimerRef.current = setTimeout(function() {
|
|
86
|
+
handleAnimationEnd(null);
|
|
87
|
+
}, timeout + 200);
|
|
88
|
+
}, [
|
|
89
|
+
baseClassName,
|
|
90
|
+
handleAnimationEnd,
|
|
91
|
+
onExited,
|
|
92
|
+
timeout,
|
|
93
|
+
unmountOnExit,
|
|
94
|
+
updateStatus
|
|
95
|
+
]);
|
|
96
|
+
useEffect(function() {
|
|
97
|
+
if (prevInPhase.current !== inPhase) {
|
|
98
|
+
if (inPhase) {
|
|
99
|
+
enter();
|
|
100
|
+
} else {
|
|
101
|
+
exit();
|
|
102
|
+
}
|
|
103
|
+
prevInPhase.current = inPhase;
|
|
104
|
+
}
|
|
105
|
+
return function() {
|
|
106
|
+
if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
|
|
107
|
+
};
|
|
108
|
+
}, [
|
|
109
|
+
inPhase,
|
|
110
|
+
enter,
|
|
111
|
+
exit
|
|
112
|
+
]);
|
|
113
|
+
if (status === 'unmounted') return null;
|
|
114
|
+
return /*#__PURE__*/ cloneElement(children, {
|
|
115
|
+
className: "".concat(children.props.className || '', " ").concat(classes),
|
|
116
|
+
onAnimationEnd: handleAnimationEnd
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
export default ConfigurableCSSTransition;
|
package/dist/nutui.react.umd.js
CHANGED
|
@@ -5489,12 +5489,20 @@
|
|
|
5489
5489
|
onTouchMove: function() {
|
|
5490
5490
|
},
|
|
5491
5491
|
onTouchEnd: function() {
|
|
5492
|
-
}
|
|
5492
|
+
},
|
|
5493
|
+
overlayProps: {},
|
|
5494
|
+
animated: true
|
|
5493
5495
|
});
|
|
5494
5496
|
var _zIndex = 1100;
|
|
5495
5497
|
var Popup = function(props) {
|
|
5496
|
-
var _$_object_spread = _object_spread({}, defaultProps$1e, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left2 = _$_object_spread.left, title = _$_object_spread.title, top = _$_object_spread.top, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position2 = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, resizable = _$_object_spread.resizable, minHeight = _$_object_spread.minHeight, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick, onTouchStart = _$_object_spread.onTouchStart, onTouchMove = _$_object_spread.onTouchMove, onTouchEnd = _$_object_spread.onTouchEnd, closeAriaLabel = _$_object_spread.closeAriaLabel;
|
|
5498
|
+
var _$_object_spread = _object_spread({}, defaultProps$1e, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left2 = _$_object_spread.left, title = _$_object_spread.title, top = _$_object_spread.top, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position2 = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, resizable = _$_object_spread.resizable, minHeight = _$_object_spread.minHeight, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick, onTouchStart = _$_object_spread.onTouchStart, onTouchMove = _$_object_spread.onTouchMove, onTouchEnd = _$_object_spread.onTouchEnd, closeAriaLabel = _$_object_spread.closeAriaLabel, overlayProps = _$_object_spread.overlayProps, animated = _$_object_spread.animated;
|
|
5497
5499
|
var locale = useConfig().locale;
|
|
5500
|
+
var transitionDuration = React.useMemo(function() {
|
|
5501
|
+
return animated ? Number(duration) : 0;
|
|
5502
|
+
}, [
|
|
5503
|
+
animated,
|
|
5504
|
+
duration
|
|
5505
|
+
]);
|
|
5498
5506
|
var _useState = _sliced_to_array(React.useState(zIndex || _zIndex), 2), index2 = _useState[0], setIndex = _useState[1];
|
|
5499
5507
|
var _useState1 = _sliced_to_array(React.useState(visible), 2), innerVisible = _useState1[0], setInnerVisible = _useState1[1];
|
|
5500
5508
|
var _useState2 = _sliced_to_array(React.useState(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
|
|
@@ -5597,14 +5605,14 @@
|
|
|
5597
5605
|
if (destroyOnClose) {
|
|
5598
5606
|
setTimeout(function() {
|
|
5599
5607
|
setShowChildren(false);
|
|
5600
|
-
},
|
|
5608
|
+
}, transitionDuration);
|
|
5601
5609
|
}
|
|
5602
5610
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
5603
5611
|
}
|
|
5604
5612
|
}, [
|
|
5605
5613
|
innerVisible,
|
|
5606
5614
|
destroyOnClose,
|
|
5607
|
-
|
|
5615
|
+
transitionDuration,
|
|
5608
5616
|
onClose,
|
|
5609
5617
|
setInnerVisible,
|
|
5610
5618
|
setShowChildren
|
|
@@ -5779,7 +5787,7 @@
|
|
|
5779
5787
|
classNames: transitionName,
|
|
5780
5788
|
mountOnEnter: true,
|
|
5781
5789
|
unmountOnExit: destroyOnClose,
|
|
5782
|
-
timeout: Number(
|
|
5790
|
+
timeout: Number(transitionDuration),
|
|
5783
5791
|
in: innerVisible,
|
|
5784
5792
|
onEntered: afterShow,
|
|
5785
5793
|
onExited: afterClose
|
|
@@ -5798,16 +5806,16 @@
|
|
|
5798
5806
|
}, renderTop(), renderTitle(), showChildren ? children : null));
|
|
5799
5807
|
};
|
|
5800
5808
|
var renderNode = function() {
|
|
5801
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, overlay ? /* @__PURE__ */ React.createElement(Overlay, {
|
|
5809
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, overlay ? /* @__PURE__ */ React.createElement(Overlay, _object_spread({
|
|
5802
5810
|
zIndex: index2,
|
|
5803
5811
|
style: overlayStyles,
|
|
5804
5812
|
className: overlayClassName,
|
|
5805
5813
|
visible: innerVisible,
|
|
5806
5814
|
closeOnOverlayClick,
|
|
5807
5815
|
lockScroll,
|
|
5808
|
-
duration,
|
|
5816
|
+
duration: transitionDuration,
|
|
5809
5817
|
onClick: handleOverlayClick
|
|
5810
|
-
}) : null, renderPop());
|
|
5818
|
+
}, overlayProps)) : null, renderPop());
|
|
5811
5819
|
};
|
|
5812
5820
|
var resolveContainer = function(getContainer) {
|
|
5813
5821
|
return (typeof getContainer === "function" ? getContainer() : getContainer) || document.body;
|
|
@@ -7605,19 +7613,13 @@
|
|
|
7605
7613
|
var Icon = function(param) {
|
|
7606
7614
|
var url = param.url;
|
|
7607
7615
|
var style = {
|
|
7608
|
-
background: "url('".concat(url, "') no-repeat center"),
|
|
7609
|
-
backgroundSize: "100% 100%",
|
|
7610
7616
|
width: 18,
|
|
7611
7617
|
height: 18
|
|
7612
7618
|
};
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
});
|
|
7618
|
-
}
|
|
7619
|
-
return /* @__PURE__ */ React.createElement(components.View, {
|
|
7620
|
-
style
|
|
7619
|
+
return /* @__PURE__ */ React.createElement(components.Image, {
|
|
7620
|
+
src: url,
|
|
7621
|
+
style,
|
|
7622
|
+
mode: "aspectFit"
|
|
7621
7623
|
});
|
|
7622
7624
|
};
|
|
7623
7625
|
var ArrowLeft = function() {
|