@nutui/nutui-react-taro 3.0.19-cpp.28-beta.1 → 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/CHANGELOG.md +7 -0
- 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/packages/price/price.js +14 -3
- package/dist/cjs/types/spec/popup/base.d.ts +2 -0
- package/dist/cjs/utils/should-render-price-raw.d.ts +1 -0
- package/dist/cjs/utils/should-render-price-raw.js +34 -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/packages/price/price.js +14 -3
- package/dist/es/types/spec/popup/base.d.ts +2 -0
- package/dist/es/utils/should-render-price-raw.d.ts +1 -0
- package/dist/es/utils/should-render-price-raw.js +24 -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 +57 -21
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +27 -27
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +27 -27
- package/dist/style.css +1 -1
- package/dist/style.scss +33 -33
- package/package.json +1 -1
|
@@ -54,13 +54,21 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _overla
|
|
|
54
54
|
},
|
|
55
55
|
onTouchStart: function onTouchStart() {},
|
|
56
56
|
onTouchMove: function onTouchMove() {},
|
|
57
|
-
onTouchEnd: function onTouchEnd() {}
|
|
57
|
+
onTouchEnd: function onTouchEnd() {},
|
|
58
|
+
overlayProps: {},
|
|
59
|
+
animated: true
|
|
58
60
|
});
|
|
59
61
|
// 默认1000,参看variables
|
|
60
62
|
var _zIndex = 1100;
|
|
61
63
|
var Popup = function Popup(props) {
|
|
62
|
-
var _$_object_spread = (0, _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;
|
|
64
|
+
var _$_object_spread = (0, _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;
|
|
63
65
|
var locale = (0, _configprovider.useConfig)().locale;
|
|
66
|
+
var transitionDuration = (0, _react.useMemo)(function() {
|
|
67
|
+
return animated ? Number(duration) : 0;
|
|
68
|
+
}, [
|
|
69
|
+
animated,
|
|
70
|
+
duration
|
|
71
|
+
]);
|
|
64
72
|
var _useState = (0, _sliced_to_array._)((0, _react.useState)(zIndex || _zIndex), 2), index = _useState[0], setIndex = _useState[1];
|
|
65
73
|
var _useState1 = (0, _sliced_to_array._)((0, _react.useState)(visible), 2), innerVisible = _useState1[0], setInnerVisible = _useState1[1];
|
|
66
74
|
var _useState2 = (0, _sliced_to_array._)((0, _react.useState)(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
|
|
@@ -165,14 +173,14 @@ var Popup = function Popup(props) {
|
|
|
165
173
|
if (destroyOnClose) {
|
|
166
174
|
setTimeout(function() {
|
|
167
175
|
setShowChildren(false);
|
|
168
|
-
},
|
|
176
|
+
}, transitionDuration);
|
|
169
177
|
}
|
|
170
178
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
171
179
|
}
|
|
172
180
|
}, [
|
|
173
181
|
innerVisible,
|
|
174
182
|
destroyOnClose,
|
|
175
|
-
|
|
183
|
+
transitionDuration,
|
|
176
184
|
onClose,
|
|
177
185
|
setInnerVisible,
|
|
178
186
|
setShowChildren
|
|
@@ -352,7 +360,7 @@ var Popup = function Popup(props) {
|
|
|
352
360
|
classNames: transitionName,
|
|
353
361
|
mountOnEnter: true,
|
|
354
362
|
unmountOnExit: destroyOnClose,
|
|
355
|
-
timeout: Number(
|
|
363
|
+
timeout: Number(transitionDuration),
|
|
356
364
|
in: innerVisible,
|
|
357
365
|
onEntered: afterShow,
|
|
358
366
|
onExited: afterClose
|
|
@@ -371,16 +379,16 @@ var Popup = function Popup(props) {
|
|
|
371
379
|
}, renderTop(), renderTitle(), showChildren ? children : null));
|
|
372
380
|
};
|
|
373
381
|
var renderNode = function renderNode() {
|
|
374
|
-
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, overlay ? /*#__PURE__*/ _react.default.createElement(_index.default, {
|
|
382
|
+
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, overlay ? /*#__PURE__*/ _react.default.createElement(_index.default, (0, _object_spread._)({
|
|
375
383
|
zIndex: index,
|
|
376
384
|
style: overlayStyles,
|
|
377
385
|
className: overlayClassName,
|
|
378
386
|
visible: innerVisible,
|
|
379
387
|
closeOnOverlayClick: closeOnOverlayClick,
|
|
380
388
|
lockScroll: lockScroll,
|
|
381
|
-
duration:
|
|
389
|
+
duration: transitionDuration,
|
|
382
390
|
onClick: handleOverlayClick
|
|
383
|
-
}) : null, renderPop());
|
|
391
|
+
}, overlayProps)) : null, renderPop());
|
|
384
392
|
};
|
|
385
393
|
var resolveContainer = function resolveContainer(getContainer) {
|
|
386
394
|
return (typeof getContainer === 'function' ? getContainer() : getContainer) || document.body;
|
|
@@ -20,6 +20,7 @@ var _typings = require("../../utils/typings");
|
|
|
20
20
|
var _index = require("../configprovider/index");
|
|
21
21
|
var _types = require("../../types");
|
|
22
22
|
var _platform = require("../../utils/taro/platform");
|
|
23
|
+
var _shouldrenderpriceraw = require("../../utils/should-render-price-raw");
|
|
23
24
|
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
24
25
|
color: 'primary',
|
|
25
26
|
price: 0,
|
|
@@ -34,10 +35,17 @@ var Price = function Price(props) {
|
|
|
34
35
|
var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), color = _$_object_spread.color, originalPrice = _$_object_spread.price, symbol = _$_object_spread.symbol, digits = _$_object_spread.digits, thousands = _$_object_spread.thousands, position = _$_object_spread.position, size = _$_object_spread.size, line = _$_object_spread.line, className = _$_object_spread.className, style = _$_object_spread.style;
|
|
35
36
|
var classPrefix = 'nut-price';
|
|
36
37
|
var rtl = (0, _index.useRtl)();
|
|
38
|
+
var isRenderPriceRaw = (0, _react.useMemo)(function() {
|
|
39
|
+
return typeof originalPrice === 'string' && (0, _shouldrenderpriceraw.shouldRenderPriceAsRaw)(originalPrice);
|
|
40
|
+
}, [
|
|
41
|
+
originalPrice
|
|
42
|
+
]);
|
|
37
43
|
var price = (0, _react.useMemo)(function() {
|
|
44
|
+
if (isRenderPriceRaw) return '';
|
|
38
45
|
return originalPrice.toString().replace(/[^\d.]/g, '');
|
|
39
46
|
}, [
|
|
40
|
-
originalPrice
|
|
47
|
+
originalPrice,
|
|
48
|
+
isRenderPriceRaw
|
|
41
49
|
]);
|
|
42
50
|
var isCustomPriceColor = (0, _react.useMemo)(function() {
|
|
43
51
|
var specificPriceColor = Object.values(_types.PriceColorEnum);
|
|
@@ -118,12 +126,15 @@ var Price = function Price(props) {
|
|
|
118
126
|
style: priceColorStyle
|
|
119
127
|
}, formatDecimal(price))) : null, symbol && position === 'after' ? renderSymbol() : null);
|
|
120
128
|
};
|
|
129
|
+
var renderRawContent = function renderRawContent() {
|
|
130
|
+
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, originalPrice);
|
|
131
|
+
};
|
|
121
132
|
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (0, _platform.harmony)() || process.env.TARO_ENV === 'dynamic' ? /*#__PURE__*/ _react.default.createElement(_components.Text, {
|
|
122
133
|
className: "".concat(classPrefix, " ").concat(classPrefix, "-").concat(color, " ").concat(className),
|
|
123
134
|
style: style
|
|
124
|
-
}, renderInner()) : /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
135
|
+
}, isRenderPriceRaw ? renderRawContent() : renderInner()) : /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
125
136
|
className: "".concat(classPrefix, " ").concat(classPrefix, "-").concat(color, " ").concat(className),
|
|
126
137
|
style: style
|
|
127
|
-
}, renderInner()));
|
|
138
|
+
}, isRenderPriceRaw ? renderRawContent() : renderInner()));
|
|
128
139
|
};
|
|
129
140
|
Price.displayName = 'NutPrice';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function shouldRenderPriceAsRaw(s: string): boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "shouldRenderPriceAsRaw", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return shouldRenderPriceAsRaw;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var CJK = /[\u4E00-\u9FFF]/;
|
|
12
|
+
var RE_NUM = /\d+(?:\.\d+)?/g;
|
|
13
|
+
function hasNoExtractablePrice(s) {
|
|
14
|
+
var t = s.trim();
|
|
15
|
+
if (!t) return true;
|
|
16
|
+
if (!/\d/.test(t)) return true;
|
|
17
|
+
if (t.replace(/[^\d.]/g, '') === '') return true;
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
function shouldRenderPriceAsRaw(s) {
|
|
21
|
+
if (hasNoExtractablePrice(s)) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
var t = s.trim();
|
|
25
|
+
if (!CJK.test(t)) return false;
|
|
26
|
+
var matches = Array.from(t.matchAll(RE_NUM));
|
|
27
|
+
if (matches.length < 2) return false;
|
|
28
|
+
var a = matches[0];
|
|
29
|
+
var b = matches[1];
|
|
30
|
+
var i0 = a.index;
|
|
31
|
+
var i1 = b.index;
|
|
32
|
+
var between = t.slice(i0 + a[0].length, i1);
|
|
33
|
+
return CJK.test(between);
|
|
34
|
+
}
|
|
@@ -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,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
13
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
|
+
var ConfigurableCSSTransition = function ConfigurableCSSTransition(props) {
|
|
15
|
+
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;
|
|
16
|
+
var _useState = (0, _sliced_to_array._)((0, _react.useState)(function() {
|
|
17
|
+
if (inPhase) return 'entered';
|
|
18
|
+
return unmountOnExit || mountOnEnter ? 'unmounted' : 'exited';
|
|
19
|
+
}), 2), status = _useState[0], setStatus = _useState[1];
|
|
20
|
+
var _useState1 = (0, _sliced_to_array._)((0, _react.useState)(function() {
|
|
21
|
+
if (inPhase) return "".concat(baseClassName, "-enter-done");
|
|
22
|
+
return "".concat(baseClassName, "-exit-done");
|
|
23
|
+
}), 2), classes = _useState1[0], setClasses = _useState1[1];
|
|
24
|
+
var fallbackTimerRef = (0, _react.useRef)(null);
|
|
25
|
+
var statusRef = (0, _react.useRef)(status);
|
|
26
|
+
var prevInPhase = (0, _react.useRef)(inPhase);
|
|
27
|
+
var latestOnAnimationEnd = (0, _react.useRef)(children.props.onAnimationEnd);
|
|
28
|
+
(0, _react.useEffect)(function() {
|
|
29
|
+
latestOnAnimationEnd.current = children.props.onAnimationEnd;
|
|
30
|
+
});
|
|
31
|
+
var updateStatus = (0, _react.useCallback)(function(nextStatus) {
|
|
32
|
+
statusRef.current = nextStatus;
|
|
33
|
+
setStatus(nextStatus);
|
|
34
|
+
}, []);
|
|
35
|
+
var handleAnimationEnd = (0, _react.useCallback)(function(e) {
|
|
36
|
+
var _latestOnAnimationEnd_current;
|
|
37
|
+
(_latestOnAnimationEnd_current = latestOnAnimationEnd.current) === null || _latestOnAnimationEnd_current === void 0 ? void 0 : _latestOnAnimationEnd_current.call(latestOnAnimationEnd, e);
|
|
38
|
+
if (e && e.target !== e.currentTarget) return;
|
|
39
|
+
if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
|
|
40
|
+
if (statusRef.current === 'entering') {
|
|
41
|
+
updateStatus('entered');
|
|
42
|
+
setClasses("".concat(baseClassName, "-enter-done"));
|
|
43
|
+
onEntered === null || onEntered === void 0 ? void 0 : onEntered();
|
|
44
|
+
} else if (statusRef.current === 'exiting') {
|
|
45
|
+
updateStatus('exited');
|
|
46
|
+
setClasses("".concat(baseClassName, "-exit-done"));
|
|
47
|
+
if (unmountOnExit) {
|
|
48
|
+
updateStatus('unmounted');
|
|
49
|
+
}
|
|
50
|
+
onExited === null || onExited === void 0 ? void 0 : onExited();
|
|
51
|
+
}
|
|
52
|
+
}, [
|
|
53
|
+
baseClassName,
|
|
54
|
+
onEntered,
|
|
55
|
+
onExited,
|
|
56
|
+
unmountOnExit,
|
|
57
|
+
updateStatus
|
|
58
|
+
]);
|
|
59
|
+
var enter = (0, _react.useCallback)(function() {
|
|
60
|
+
if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
|
|
61
|
+
if (statusRef.current === 'unmounted') {
|
|
62
|
+
updateStatus('exited');
|
|
63
|
+
}
|
|
64
|
+
if (timeout === 0) {
|
|
65
|
+
updateStatus('entered');
|
|
66
|
+
setClasses("".concat(baseClassName, "-enter-done"));
|
|
67
|
+
onEntered === null || onEntered === void 0 ? void 0 : onEntered();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
updateStatus('entering');
|
|
71
|
+
setClasses("".concat(baseClassName, "-enter ").concat(baseClassName, "-enter-active"));
|
|
72
|
+
// Safety fallback: Give it extra time over the expected timeout in case onAnimationEnd misses
|
|
73
|
+
fallbackTimerRef.current = setTimeout(function() {
|
|
74
|
+
handleAnimationEnd(null);
|
|
75
|
+
}, timeout + 200);
|
|
76
|
+
}, [
|
|
77
|
+
baseClassName,
|
|
78
|
+
handleAnimationEnd,
|
|
79
|
+
onEntered,
|
|
80
|
+
timeout,
|
|
81
|
+
updateStatus
|
|
82
|
+
]);
|
|
83
|
+
var exit = (0, _react.useCallback)(function() {
|
|
84
|
+
if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
|
|
85
|
+
if (timeout === 0) {
|
|
86
|
+
updateStatus('exited');
|
|
87
|
+
setClasses("".concat(baseClassName, "-exit-done"));
|
|
88
|
+
if (unmountOnExit) {
|
|
89
|
+
updateStatus('unmounted');
|
|
90
|
+
}
|
|
91
|
+
onExited === null || onExited === void 0 ? void 0 : onExited();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
updateStatus('exiting');
|
|
95
|
+
setClasses("".concat(baseClassName, "-exit ").concat(baseClassName, "-exit-active"));
|
|
96
|
+
fallbackTimerRef.current = setTimeout(function() {
|
|
97
|
+
handleAnimationEnd(null);
|
|
98
|
+
}, timeout + 200);
|
|
99
|
+
}, [
|
|
100
|
+
baseClassName,
|
|
101
|
+
handleAnimationEnd,
|
|
102
|
+
onExited,
|
|
103
|
+
timeout,
|
|
104
|
+
unmountOnExit,
|
|
105
|
+
updateStatus
|
|
106
|
+
]);
|
|
107
|
+
(0, _react.useEffect)(function() {
|
|
108
|
+
if (prevInPhase.current !== inPhase) {
|
|
109
|
+
if (inPhase) {
|
|
110
|
+
enter();
|
|
111
|
+
} else {
|
|
112
|
+
exit();
|
|
113
|
+
}
|
|
114
|
+
prevInPhase.current = inPhase;
|
|
115
|
+
}
|
|
116
|
+
return function() {
|
|
117
|
+
if (fallbackTimerRef.current) clearTimeout(fallbackTimerRef.current);
|
|
118
|
+
};
|
|
119
|
+
}, [
|
|
120
|
+
inPhase,
|
|
121
|
+
enter,
|
|
122
|
+
exit
|
|
123
|
+
]);
|
|
124
|
+
if (status === 'unmounted') return null;
|
|
125
|
+
return /*#__PURE__*/ (0, _react.cloneElement)(children, {
|
|
126
|
+
className: "".concat(children.props.className || '', " ").concat(classes),
|
|
127
|
+
onAnimationEnd: handleAnimationEnd
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
var _default = ConfigurableCSSTransition;
|
|
@@ -125,9 +125,20 @@
|
|
|
125
125
|
font-weight: $calendar-day-font-weight;
|
|
126
126
|
margin-bottom: 4px;
|
|
127
127
|
|
|
128
|
+
// 部分 Taro 机型下子节点不会稳定继承父级 color,颜色直接落到最内层文案。
|
|
129
|
+
&-day,
|
|
130
|
+
&-info-curr {
|
|
131
|
+
color: $color-title;
|
|
132
|
+
}
|
|
133
|
+
|
|
128
134
|
&:nth-child(7n + 0),
|
|
129
135
|
&:nth-child(7n + 1) {
|
|
130
136
|
color: $color-primary;
|
|
137
|
+
|
|
138
|
+
.nut-calendar-day-day,
|
|
139
|
+
.nut-calendar-day-info-curr {
|
|
140
|
+
color: $color-primary;
|
|
141
|
+
}
|
|
131
142
|
}
|
|
132
143
|
|
|
133
144
|
&-info,
|
|
@@ -168,7 +179,12 @@
|
|
|
168
179
|
border-bottom-right-radius: $calendar-day-active-border-radius;
|
|
169
180
|
}
|
|
170
181
|
|
|
171
|
-
.nut-calendar-day-info {
|
|
182
|
+
&.nut-calendar-day-active .nut-calendar-day-info {
|
|
183
|
+
color: $color-primary-text;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&.nut-calendar-day-active .nut-calendar-day-day,
|
|
187
|
+
&.nut-calendar-day-active .nut-calendar-day-info-curr {
|
|
172
188
|
color: $color-primary-text;
|
|
173
189
|
}
|
|
174
190
|
}
|
|
@@ -176,6 +192,11 @@
|
|
|
176
192
|
&-disabled {
|
|
177
193
|
color: $calendar-disable-color !important;
|
|
178
194
|
|
|
195
|
+
&.nut-calendar-day-disabled .nut-calendar-day-day,
|
|
196
|
+
&.nut-calendar-day-disabled .nut-calendar-day-info-curr {
|
|
197
|
+
color: $calendar-disable-color;
|
|
198
|
+
}
|
|
199
|
+
|
|
179
200
|
.nut-calendar-day-info-curr {
|
|
180
201
|
display: none;
|
|
181
202
|
}
|
|
@@ -185,10 +206,20 @@
|
|
|
185
206
|
background-color: $calendar-choose-background-color;
|
|
186
207
|
color: $calendar-choose-color;
|
|
187
208
|
|
|
209
|
+
&.nut-calendar-day-choose .nut-calendar-day-day,
|
|
210
|
+
&.nut-calendar-day-choose .nut-calendar-day-info-curr {
|
|
211
|
+
color: $calendar-choose-color;
|
|
212
|
+
}
|
|
213
|
+
|
|
188
214
|
&-disabled {
|
|
189
215
|
background-color: $calendar-choose-disable-background-color;
|
|
190
216
|
color: $calendar-disable-color !important;
|
|
191
217
|
|
|
218
|
+
&.nut-calendar-day-choose-disabled .nut-calendar-day-day,
|
|
219
|
+
&.nut-calendar-day-choose-disabled .nut-calendar-day-info-curr {
|
|
220
|
+
color: $calendar-disable-color;
|
|
221
|
+
}
|
|
222
|
+
|
|
192
223
|
.nut-calendar-day-info-curr {
|
|
193
224
|
display: none;
|
|
194
225
|
}
|
|
@@ -104,9 +104,17 @@
|
|
|
104
104
|
font-weight: var(--nutui-calendar-day-font-weight, var(--nutui-font-weight-bold, 600));
|
|
105
105
|
margin-bottom: 4px;
|
|
106
106
|
}
|
|
107
|
+
.nut-calendar-day-day, .nut-calendar-day-info-curr {
|
|
108
|
+
color: var(--nutui-color-title, #1a1a1a);
|
|
109
|
+
}
|
|
107
110
|
.nut-calendar-day:nth-child(7n+0), .nut-calendar-day:nth-child(7n+1) {
|
|
108
111
|
color: var(--nutui-color-primary, #ff0f23);
|
|
109
112
|
}
|
|
113
|
+
.nut-calendar-day:nth-child(7n+0) .nut-calendar-day-day,
|
|
114
|
+
.nut-calendar-day:nth-child(7n+0) .nut-calendar-day-info-curr, .nut-calendar-day:nth-child(7n+1) .nut-calendar-day-day,
|
|
115
|
+
.nut-calendar-day:nth-child(7n+1) .nut-calendar-day-info-curr {
|
|
116
|
+
color: var(--nutui-color-primary, #ff0f23);
|
|
117
|
+
}
|
|
110
118
|
.nut-calendar-day-info, .nut-calendar-day-info-curr {
|
|
111
119
|
position: absolute;
|
|
112
120
|
bottom: 5px;
|
|
@@ -139,12 +147,18 @@
|
|
|
139
147
|
border-top-right-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
140
148
|
border-bottom-right-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
141
149
|
}
|
|
142
|
-
.nut-calendar-day-active .nut-calendar-day-info {
|
|
150
|
+
.nut-calendar-day-active.nut-calendar-day-active .nut-calendar-day-info {
|
|
151
|
+
color: #ffffff;
|
|
152
|
+
}
|
|
153
|
+
.nut-calendar-day-active.nut-calendar-day-active .nut-calendar-day-day, .nut-calendar-day-active.nut-calendar-day-active .nut-calendar-day-info-curr {
|
|
143
154
|
color: #ffffff;
|
|
144
155
|
}
|
|
145
156
|
.nut-calendar-day-disabled {
|
|
146
157
|
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled, #c2c4cc)) !important;
|
|
147
158
|
}
|
|
159
|
+
.nut-calendar-day-disabled.nut-calendar-day-disabled .nut-calendar-day-day, .nut-calendar-day-disabled.nut-calendar-day-disabled .nut-calendar-day-info-curr {
|
|
160
|
+
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled, #c2c4cc));
|
|
161
|
+
}
|
|
148
162
|
.nut-calendar-day-disabled .nut-calendar-day-info-curr {
|
|
149
163
|
display: none;
|
|
150
164
|
}
|
|
@@ -152,10 +166,16 @@
|
|
|
152
166
|
background-color: var(--nutui-calendar-choose-background-color, var(--nutui-color-primary-light-pressed, #ffebf1));
|
|
153
167
|
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff0f23));
|
|
154
168
|
}
|
|
169
|
+
.nut-calendar-day-choose.nut-calendar-day-choose .nut-calendar-day-day, .nut-calendar-day-choose.nut-calendar-day-choose .nut-calendar-day-info-curr {
|
|
170
|
+
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff0f23));
|
|
171
|
+
}
|
|
155
172
|
.nut-calendar-day-choose-disabled {
|
|
156
173
|
background-color: var(--nutui-calendar-choose-disable-background-color, rgba(191, 191, 191, 0.09));
|
|
157
174
|
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled, #c2c4cc)) !important;
|
|
158
175
|
}
|
|
176
|
+
.nut-calendar-day-choose-disabled.nut-calendar-day-choose-disabled .nut-calendar-day-day, .nut-calendar-day-choose-disabled.nut-calendar-day-choose-disabled .nut-calendar-day-info-curr {
|
|
177
|
+
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled, #c2c4cc));
|
|
178
|
+
}
|
|
159
179
|
.nut-calendar-day-choose-disabled .nut-calendar-day-info-curr {
|
|
160
180
|
display: none;
|
|
161
181
|
}
|
|
@@ -505,9 +505,17 @@
|
|
|
505
505
|
font-weight: var(--nutui-calendar-day-font-weight, var(--nutui-font-weight-bold, 600));
|
|
506
506
|
margin-bottom: 4px;
|
|
507
507
|
}
|
|
508
|
+
.nut-calendar-day-day, .nut-calendar-day-info-curr {
|
|
509
|
+
color: var(--nutui-color-title, #1a1a1a);
|
|
510
|
+
}
|
|
508
511
|
.nut-calendar-day:nth-child(7n+0), .nut-calendar-day:nth-child(7n+1) {
|
|
509
512
|
color: var(--nutui-color-primary, #ff0f23);
|
|
510
513
|
}
|
|
514
|
+
.nut-calendar-day:nth-child(7n+0) .nut-calendar-day-day,
|
|
515
|
+
.nut-calendar-day:nth-child(7n+0) .nut-calendar-day-info-curr, .nut-calendar-day:nth-child(7n+1) .nut-calendar-day-day,
|
|
516
|
+
.nut-calendar-day:nth-child(7n+1) .nut-calendar-day-info-curr {
|
|
517
|
+
color: var(--nutui-color-primary, #ff0f23);
|
|
518
|
+
}
|
|
511
519
|
.nut-calendar-day-info, .nut-calendar-day-info-curr {
|
|
512
520
|
position: absolute;
|
|
513
521
|
bottom: 5px;
|
|
@@ -540,12 +548,18 @@
|
|
|
540
548
|
border-top-right-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
541
549
|
border-bottom-right-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
542
550
|
}
|
|
543
|
-
.nut-calendar-day-active .nut-calendar-day-info {
|
|
551
|
+
.nut-calendar-day-active.nut-calendar-day-active .nut-calendar-day-info {
|
|
552
|
+
color: #ffffff;
|
|
553
|
+
}
|
|
554
|
+
.nut-calendar-day-active.nut-calendar-day-active .nut-calendar-day-day, .nut-calendar-day-active.nut-calendar-day-active .nut-calendar-day-info-curr {
|
|
544
555
|
color: #ffffff;
|
|
545
556
|
}
|
|
546
557
|
.nut-calendar-day-disabled {
|
|
547
558
|
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled, #c2c4cc)) !important;
|
|
548
559
|
}
|
|
560
|
+
.nut-calendar-day-disabled.nut-calendar-day-disabled .nut-calendar-day-day, .nut-calendar-day-disabled.nut-calendar-day-disabled .nut-calendar-day-info-curr {
|
|
561
|
+
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled, #c2c4cc));
|
|
562
|
+
}
|
|
549
563
|
.nut-calendar-day-disabled .nut-calendar-day-info-curr {
|
|
550
564
|
display: none;
|
|
551
565
|
}
|
|
@@ -553,10 +567,16 @@
|
|
|
553
567
|
background-color: var(--nutui-calendar-choose-background-color, var(--nutui-color-primary-light-pressed, #ffebf1));
|
|
554
568
|
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff0f23));
|
|
555
569
|
}
|
|
570
|
+
.nut-calendar-day-choose.nut-calendar-day-choose .nut-calendar-day-day, .nut-calendar-day-choose.nut-calendar-day-choose .nut-calendar-day-info-curr {
|
|
571
|
+
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary, #ff0f23));
|
|
572
|
+
}
|
|
556
573
|
.nut-calendar-day-choose-disabled {
|
|
557
574
|
background-color: var(--nutui-calendar-choose-disable-background-color, rgba(191, 191, 191, 0.09));
|
|
558
575
|
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled, #c2c4cc)) !important;
|
|
559
576
|
}
|
|
577
|
+
.nut-calendar-day-choose-disabled.nut-calendar-day-choose-disabled .nut-calendar-day-day, .nut-calendar-day-choose-disabled.nut-calendar-day-choose-disabled .nut-calendar-day-info-curr {
|
|
578
|
+
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled, #c2c4cc));
|
|
579
|
+
}
|
|
560
580
|
.nut-calendar-day-choose-disabled .nut-calendar-day-info-curr {
|
|
561
581
|
display: none;
|
|
562
582
|
}
|
|
@@ -125,9 +125,20 @@
|
|
|
125
125
|
font-weight: $calendar-day-font-weight;
|
|
126
126
|
margin-bottom: 4px;
|
|
127
127
|
|
|
128
|
+
// 部分 Taro 机型下子节点不会稳定继承父级 color,颜色直接落到最内层文案。
|
|
129
|
+
&-day,
|
|
130
|
+
&-info-curr {
|
|
131
|
+
color: $color-title;
|
|
132
|
+
}
|
|
133
|
+
|
|
128
134
|
&:nth-child(7n + 0),
|
|
129
135
|
&:nth-child(7n + 1) {
|
|
130
136
|
color: $color-primary;
|
|
137
|
+
|
|
138
|
+
.nut-calendar-day-day,
|
|
139
|
+
.nut-calendar-day-info-curr {
|
|
140
|
+
color: $color-primary;
|
|
141
|
+
}
|
|
131
142
|
}
|
|
132
143
|
|
|
133
144
|
&-info,
|
|
@@ -168,7 +179,12 @@
|
|
|
168
179
|
border-bottom-right-radius: $calendar-day-active-border-radius;
|
|
169
180
|
}
|
|
170
181
|
|
|
171
|
-
.nut-calendar-day-info {
|
|
182
|
+
&.nut-calendar-day-active .nut-calendar-day-info {
|
|
183
|
+
color: $color-primary-text;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&.nut-calendar-day-active .nut-calendar-day-day,
|
|
187
|
+
&.nut-calendar-day-active .nut-calendar-day-info-curr {
|
|
172
188
|
color: $color-primary-text;
|
|
173
189
|
}
|
|
174
190
|
}
|
|
@@ -176,6 +192,11 @@
|
|
|
176
192
|
&-disabled {
|
|
177
193
|
color: $calendar-disable-color !important;
|
|
178
194
|
|
|
195
|
+
&.nut-calendar-day-disabled .nut-calendar-day-day,
|
|
196
|
+
&.nut-calendar-day-disabled .nut-calendar-day-info-curr {
|
|
197
|
+
color: $calendar-disable-color;
|
|
198
|
+
}
|
|
199
|
+
|
|
179
200
|
.nut-calendar-day-info-curr {
|
|
180
201
|
display: none;
|
|
181
202
|
}
|
|
@@ -185,10 +206,20 @@
|
|
|
185
206
|
background-color: $calendar-choose-background-color;
|
|
186
207
|
color: $calendar-choose-color;
|
|
187
208
|
|
|
209
|
+
&.nut-calendar-day-choose .nut-calendar-day-day,
|
|
210
|
+
&.nut-calendar-day-choose .nut-calendar-day-info-curr {
|
|
211
|
+
color: $calendar-choose-color;
|
|
212
|
+
}
|
|
213
|
+
|
|
188
214
|
&-disabled {
|
|
189
215
|
background-color: $calendar-choose-disable-background-color;
|
|
190
216
|
color: $calendar-disable-color !important;
|
|
191
217
|
|
|
218
|
+
&.nut-calendar-day-choose-disabled .nut-calendar-day-day,
|
|
219
|
+
&.nut-calendar-day-choose-disabled .nut-calendar-day-info-curr {
|
|
220
|
+
color: $calendar-disable-color;
|
|
221
|
+
}
|
|
222
|
+
|
|
192
223
|
.nut-calendar-day-info-curr {
|
|
193
224
|
display: none;
|
|
194
225
|
}
|
|
@@ -104,9 +104,17 @@
|
|
|
104
104
|
font-weight: var(--nutui-calendar-day-font-weight, var(--nutui-font-weight-bold));
|
|
105
105
|
margin-bottom: 4px;
|
|
106
106
|
}
|
|
107
|
+
.nut-calendar-day-day, .nut-calendar-day-info-curr {
|
|
108
|
+
color: var(--nutui-color-title);
|
|
109
|
+
}
|
|
107
110
|
.nut-calendar-day:nth-child(7n+0), .nut-calendar-day:nth-child(7n+1) {
|
|
108
111
|
color: var(--nutui-color-primary);
|
|
109
112
|
}
|
|
113
|
+
.nut-calendar-day:nth-child(7n+0) .nut-calendar-day-day,
|
|
114
|
+
.nut-calendar-day:nth-child(7n+0) .nut-calendar-day-info-curr, .nut-calendar-day:nth-child(7n+1) .nut-calendar-day-day,
|
|
115
|
+
.nut-calendar-day:nth-child(7n+1) .nut-calendar-day-info-curr {
|
|
116
|
+
color: var(--nutui-color-primary);
|
|
117
|
+
}
|
|
110
118
|
.nut-calendar-day-info, .nut-calendar-day-info-curr {
|
|
111
119
|
position: absolute;
|
|
112
120
|
bottom: 5px;
|
|
@@ -139,12 +147,18 @@
|
|
|
139
147
|
border-top-right-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
140
148
|
border-bottom-right-radius: var(--nutui-calendar-day-active-border-radius, 4px);
|
|
141
149
|
}
|
|
142
|
-
.nut-calendar-day-active .nut-calendar-day-info {
|
|
150
|
+
.nut-calendar-day-active.nut-calendar-day-active .nut-calendar-day-info {
|
|
151
|
+
color: var(--nutui-color-text-dark);
|
|
152
|
+
}
|
|
153
|
+
.nut-calendar-day-active.nut-calendar-day-active .nut-calendar-day-day, .nut-calendar-day-active.nut-calendar-day-active .nut-calendar-day-info-curr {
|
|
143
154
|
color: var(--nutui-color-text-dark);
|
|
144
155
|
}
|
|
145
156
|
.nut-calendar-day-disabled {
|
|
146
157
|
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled)) !important;
|
|
147
158
|
}
|
|
159
|
+
.nut-calendar-day-disabled.nut-calendar-day-disabled .nut-calendar-day-day, .nut-calendar-day-disabled.nut-calendar-day-disabled .nut-calendar-day-info-curr {
|
|
160
|
+
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled));
|
|
161
|
+
}
|
|
148
162
|
.nut-calendar-day-disabled .nut-calendar-day-info-curr {
|
|
149
163
|
display: none;
|
|
150
164
|
}
|
|
@@ -152,10 +166,16 @@
|
|
|
152
166
|
background-color: var(--nutui-calendar-choose-background-color, var(--nutui-color-primary-light-pressed));
|
|
153
167
|
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary));
|
|
154
168
|
}
|
|
169
|
+
.nut-calendar-day-choose.nut-calendar-day-choose .nut-calendar-day-day, .nut-calendar-day-choose.nut-calendar-day-choose .nut-calendar-day-info-curr {
|
|
170
|
+
color: var(--nutui-calendar-choose-color, var(--nutui-color-primary));
|
|
171
|
+
}
|
|
155
172
|
.nut-calendar-day-choose-disabled {
|
|
156
173
|
background-color: var(--nutui-calendar-choose-disable-background-color, rgba(191, 191, 191, 0.09));
|
|
157
174
|
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled)) !important;
|
|
158
175
|
}
|
|
176
|
+
.nut-calendar-day-choose-disabled.nut-calendar-day-choose-disabled .nut-calendar-day-day, .nut-calendar-day-choose-disabled.nut-calendar-day-choose-disabled .nut-calendar-day-info-curr {
|
|
177
|
+
color: var(--nutui-calendar-disable-color, var(--nutui-color-text-disabled));
|
|
178
|
+
}
|
|
159
179
|
.nut-calendar-day-choose-disabled .nut-calendar-day-info-curr {
|
|
160
180
|
display: none;
|
|
161
181
|
}
|