@nutui/nutui-react-taro 3.0.17 → 3.0.18-cpp
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 +10 -0
- package/dist/cjs/packages/dialog/dialog.js +12 -10
- package/dist/cjs/packages/ellipsis/ellipsis.js +1 -1
- package/dist/cjs/packages/noticebar/style/noticebar.scss +6 -0
- package/dist/cjs/packages/noticebar/style/style.css +6 -0
- package/dist/cjs/packages/noticebar/style/style.harmony.css +6 -0
- package/dist/cjs/packages/noticebar/style-jmapp/noticebar.scss +6 -0
- package/dist/cjs/packages/noticebar/style-jmapp/style.css +6 -0
- package/dist/cjs/packages/noticebar/style-jrkf/noticebar.scss +6 -0
- package/dist/cjs/packages/noticebar/style-jrkf/style.css +6 -0
- package/dist/cjs/packages/overlay/overlay.js +17 -11
- package/dist/cjs/packages/popup/popup.js +29 -17
- package/dist/cjs/packages/price/price.js +43 -15
- package/dist/cjs/types/spec/price/base.d.ts +8 -2
- package/dist/cjs/types/spec/price/base.js +12 -0
- package/dist/cjs/utils/taro/get-rect.d.ts +1 -0
- package/dist/cjs/utils/taro/get-rect.js +36 -0
- package/dist/es/packages/dialog/dialog.js +23 -19
- package/dist/es/packages/ellipsis/ellipsis.js +2 -2
- package/dist/es/packages/noticebar/style/noticebar.scss +6 -0
- package/dist/es/packages/noticebar/style/style.css +6 -0
- package/dist/es/packages/noticebar/style/style.harmony.css +6 -0
- package/dist/es/packages/noticebar/style-jmapp/noticebar.scss +6 -0
- package/dist/es/packages/noticebar/style-jmapp/style.css +6 -0
- package/dist/es/packages/noticebar/style-jrkf/noticebar.scss +6 -0
- package/dist/es/packages/noticebar/style-jrkf/style.css +6 -0
- package/dist/es/packages/overlay/overlay.js +17 -11
- package/dist/es/packages/popup/popup.js +30 -17
- package/dist/es/packages/price/price.js +42 -15
- package/dist/es/types/spec/price/base.d.ts +17 -5
- package/dist/es/types/spec/price/base.js +6 -1
- package/dist/es/utils/taro/get-rect.d.ts +1 -0
- package/dist/es/utils/taro/get-rect.js +34 -0
- package/dist/nutui.react.umd.js +9958 -9892
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +45 -45
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +39 -39
- package/dist/style.css +1 -1
- package/dist/style.scss +27 -27
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
# v3.0.17
|
|
2
|
+
|
|
3
|
+
`2025-08-01`
|
|
4
|
+
|
|
5
|
+
- :sparkles: feat: add plugin for bizui using nutui (#3318)
|
|
6
|
+
- :bug: fix(skeleton): correct v3 update docs (#3313)
|
|
7
|
+
- :bug: fix(pulltorefresh): 增加 catchMove 属性,用于显示控制 (#3311)
|
|
8
|
+
- :bug: fix: 修复日历只有一个月的情况 (#3306)
|
|
9
|
+
- 🏡 chore(harmonycss): 每个组件构建全量的css (#3316)
|
|
10
|
+
|
|
1
11
|
# v3.0.16
|
|
2
12
|
|
|
3
13
|
`2025-07-04`
|
|
@@ -29,7 +29,6 @@ var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
|
29
29
|
var _ts_generator = require("@swc/helpers/_/_ts_generator");
|
|
30
30
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
31
31
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
32
|
-
var _reacttransitiongroup = require("react-transition-group");
|
|
33
32
|
var _components = require("@tarojs/components");
|
|
34
33
|
var _iconsreacttaro = require("@nutui/icons-react-taro");
|
|
35
34
|
var _index = /*#__PURE__*/ _interop_require_default._(require("../button/index"));
|
|
@@ -194,17 +193,20 @@ var BaseDialog = function BaseDialog(props) {
|
|
|
194
193
|
var renderContent = function renderContent() {
|
|
195
194
|
var contentZIndex = (0, _platform.harmony)() ? zIndex + 1 : zIndex // 解决harmony层级问题
|
|
196
195
|
;
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
196
|
+
return(// <CSSTransition
|
|
197
|
+
// in={visible}
|
|
198
|
+
// timeout={300}
|
|
199
|
+
// classNames="fadeDialog"
|
|
200
|
+
// unmountOnExit
|
|
201
|
+
// appear
|
|
202
|
+
// >
|
|
203
|
+
/*#__PURE__*/ /*#__PURE__*/ _react.default.createElement(_content.Content, {
|
|
204
204
|
className: className,
|
|
205
|
-
style: (0, _object_spread._)({
|
|
205
|
+
style: (0, _object_spread_props._)((0, _object_spread._)({
|
|
206
206
|
zIndex: contentZIndex
|
|
207
|
-
}, style),
|
|
207
|
+
}, style), {
|
|
208
|
+
display: visible ? 'block' : 'none'
|
|
209
|
+
}),
|
|
208
210
|
title: title,
|
|
209
211
|
header: header,
|
|
210
212
|
close: renderCloseIcon(),
|
|
@@ -229,7 +229,7 @@ var Ellipsis = function Ellipsis(props) {
|
|
|
229
229
|
case 0:
|
|
230
230
|
return [
|
|
231
231
|
4,
|
|
232
|
-
(0, _getrect.
|
|
232
|
+
(0, _getrect.getRectInMultiPlatformWithoutCache)(rootContain.current)
|
|
233
233
|
];
|
|
234
234
|
case 1:
|
|
235
235
|
refe = _state.sent();
|
|
@@ -51,6 +51,9 @@
|
|
|
51
51
|
min-width: $noticebar-left-icon-width;
|
|
52
52
|
margin-right: $noticebar-icon-gap;
|
|
53
53
|
background-size: 100% 100%;
|
|
54
|
+
.nut-icon {
|
|
55
|
+
color: $noticebar-color;
|
|
56
|
+
}
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
&-right-icon {
|
|
@@ -63,12 +66,14 @@
|
|
|
63
66
|
.nut-icon {
|
|
64
67
|
width: 12px;
|
|
65
68
|
height: 12px;
|
|
69
|
+
color: $noticebar-color;
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
&-wrap {
|
|
70
74
|
display: flex;
|
|
71
75
|
flex: 1;
|
|
76
|
+
align-items: center;
|
|
72
77
|
height: $noticebar-line-height;
|
|
73
78
|
line-height: $noticebar-line-height;
|
|
74
79
|
overflow: hidden;
|
|
@@ -77,6 +82,7 @@
|
|
|
77
82
|
.nut-noticebar-box-wrap-content {
|
|
78
83
|
position: absolute;
|
|
79
84
|
white-space: nowrap;
|
|
85
|
+
color: $noticebar-color;
|
|
80
86
|
|
|
81
87
|
&.nut-ellipsis {
|
|
82
88
|
max-width: 100%;
|
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
margin-right: var(--nutui-noticebar-icon-gap, 4px);
|
|
46
46
|
background-size: 100% 100%;
|
|
47
47
|
}
|
|
48
|
+
.nut-noticebar .nut-noticebar-box-left-icon .nut-icon {
|
|
49
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
50
|
+
}
|
|
48
51
|
.nut-noticebar .nut-noticebar-box-right-icon {
|
|
49
52
|
display: flex;
|
|
50
53
|
align-items: center;
|
|
@@ -55,10 +58,12 @@
|
|
|
55
58
|
.nut-noticebar .nut-noticebar-box-right-icon .nut-icon {
|
|
56
59
|
width: 12px;
|
|
57
60
|
height: 12px;
|
|
61
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
58
62
|
}
|
|
59
63
|
.nut-noticebar .nut-noticebar-box-wrap {
|
|
60
64
|
display: flex;
|
|
61
65
|
flex: 1;
|
|
66
|
+
align-items: center;
|
|
62
67
|
height: var(--nutui-noticebar-line-height, 24px);
|
|
63
68
|
line-height: var(--nutui-noticebar-line-height, 24px);
|
|
64
69
|
overflow: hidden;
|
|
@@ -67,6 +72,7 @@
|
|
|
67
72
|
.nut-noticebar .nut-noticebar-box-wrap .nut-noticebar-box-wrap-content {
|
|
68
73
|
position: absolute;
|
|
69
74
|
white-space: nowrap;
|
|
75
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
70
76
|
}
|
|
71
77
|
.nut-noticebar .nut-noticebar-box-wrap .nut-noticebar-box-wrap-content.nut-ellipsis {
|
|
72
78
|
max-width: 100%;
|
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
margin-right: var(--nutui-noticebar-icon-gap, 4px);
|
|
46
46
|
background-size: 100% 100%;
|
|
47
47
|
}
|
|
48
|
+
.nut-noticebar .nut-noticebar-box-left-icon .nut-icon {
|
|
49
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
50
|
+
}
|
|
48
51
|
.nut-noticebar .nut-noticebar-box-right-icon {
|
|
49
52
|
display: flex;
|
|
50
53
|
align-items: center;
|
|
@@ -55,10 +58,12 @@
|
|
|
55
58
|
.nut-noticebar .nut-noticebar-box-right-icon .nut-icon {
|
|
56
59
|
width: 12px;
|
|
57
60
|
height: 12px;
|
|
61
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
58
62
|
}
|
|
59
63
|
.nut-noticebar .nut-noticebar-box-wrap {
|
|
60
64
|
display: flex;
|
|
61
65
|
flex: 1;
|
|
66
|
+
align-items: center;
|
|
62
67
|
height: var(--nutui-noticebar-line-height, 24px);
|
|
63
68
|
line-height: var(--nutui-noticebar-line-height, 24px);
|
|
64
69
|
overflow: hidden;
|
|
@@ -67,6 +72,7 @@
|
|
|
67
72
|
.nut-noticebar .nut-noticebar-box-wrap .nut-noticebar-box-wrap-content {
|
|
68
73
|
position: absolute;
|
|
69
74
|
white-space: nowrap;
|
|
75
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
70
76
|
}
|
|
71
77
|
.nut-noticebar .nut-noticebar-box-wrap .nut-noticebar-box-wrap-content.nut-ellipsis {
|
|
72
78
|
max-width: 100%;
|
|
@@ -51,6 +51,9 @@
|
|
|
51
51
|
min-width: $noticebar-left-icon-width;
|
|
52
52
|
margin-right: $noticebar-icon-gap;
|
|
53
53
|
background-size: 100% 100%;
|
|
54
|
+
.nut-icon {
|
|
55
|
+
color: $noticebar-color;
|
|
56
|
+
}
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
&-right-icon {
|
|
@@ -63,12 +66,14 @@
|
|
|
63
66
|
.nut-icon {
|
|
64
67
|
width: 12px;
|
|
65
68
|
height: 12px;
|
|
69
|
+
color: $noticebar-color;
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
&-wrap {
|
|
70
74
|
display: flex;
|
|
71
75
|
flex: 1;
|
|
76
|
+
align-items: center;
|
|
72
77
|
height: $noticebar-line-height;
|
|
73
78
|
line-height: $noticebar-line-height;
|
|
74
79
|
overflow: hidden;
|
|
@@ -77,6 +82,7 @@
|
|
|
77
82
|
.nut-noticebar-box-wrap-content {
|
|
78
83
|
position: absolute;
|
|
79
84
|
white-space: nowrap;
|
|
85
|
+
color: $noticebar-color;
|
|
80
86
|
|
|
81
87
|
&.nut-ellipsis {
|
|
82
88
|
max-width: 100%;
|
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
margin-right: var(--nutui-noticebar-icon-gap, 4px);
|
|
46
46
|
background-size: 100% 100%;
|
|
47
47
|
}
|
|
48
|
+
.nut-noticebar .nut-noticebar-box-left-icon .nut-icon {
|
|
49
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
50
|
+
}
|
|
48
51
|
.nut-noticebar .nut-noticebar-box-right-icon {
|
|
49
52
|
display: flex;
|
|
50
53
|
align-items: center;
|
|
@@ -55,10 +58,12 @@
|
|
|
55
58
|
.nut-noticebar .nut-noticebar-box-right-icon .nut-icon {
|
|
56
59
|
width: 12px;
|
|
57
60
|
height: 12px;
|
|
61
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
58
62
|
}
|
|
59
63
|
.nut-noticebar .nut-noticebar-box-wrap {
|
|
60
64
|
display: flex;
|
|
61
65
|
flex: 1;
|
|
66
|
+
align-items: center;
|
|
62
67
|
height: var(--nutui-noticebar-line-height, 24px);
|
|
63
68
|
line-height: var(--nutui-noticebar-line-height, 24px);
|
|
64
69
|
overflow: hidden;
|
|
@@ -67,6 +72,7 @@
|
|
|
67
72
|
.nut-noticebar .nut-noticebar-box-wrap .nut-noticebar-box-wrap-content {
|
|
68
73
|
position: absolute;
|
|
69
74
|
white-space: nowrap;
|
|
75
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
70
76
|
}
|
|
71
77
|
.nut-noticebar .nut-noticebar-box-wrap .nut-noticebar-box-wrap-content.nut-ellipsis {
|
|
72
78
|
max-width: 100%;
|
|
@@ -51,6 +51,9 @@
|
|
|
51
51
|
min-width: $noticebar-left-icon-width;
|
|
52
52
|
margin-right: $noticebar-icon-gap;
|
|
53
53
|
background-size: 100% 100%;
|
|
54
|
+
.nut-icon {
|
|
55
|
+
color: $noticebar-color;
|
|
56
|
+
}
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
&-right-icon {
|
|
@@ -63,12 +66,14 @@
|
|
|
63
66
|
.nut-icon {
|
|
64
67
|
width: 12px;
|
|
65
68
|
height: 12px;
|
|
69
|
+
color: $noticebar-color;
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
&-wrap {
|
|
70
74
|
display: flex;
|
|
71
75
|
flex: 1;
|
|
76
|
+
align-items: center;
|
|
72
77
|
height: $noticebar-line-height;
|
|
73
78
|
line-height: $noticebar-line-height;
|
|
74
79
|
overflow: hidden;
|
|
@@ -77,6 +82,7 @@
|
|
|
77
82
|
.nut-noticebar-box-wrap-content {
|
|
78
83
|
position: absolute;
|
|
79
84
|
white-space: nowrap;
|
|
85
|
+
color: $noticebar-color;
|
|
80
86
|
|
|
81
87
|
&.nut-ellipsis {
|
|
82
88
|
max-width: 100%;
|
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
margin-right: var(--nutui-noticebar-icon-gap, 4px);
|
|
46
46
|
background-size: 100% 100%;
|
|
47
47
|
}
|
|
48
|
+
.nut-noticebar .nut-noticebar-box-left-icon .nut-icon {
|
|
49
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
50
|
+
}
|
|
48
51
|
.nut-noticebar .nut-noticebar-box-right-icon {
|
|
49
52
|
display: flex;
|
|
50
53
|
align-items: center;
|
|
@@ -55,10 +58,12 @@
|
|
|
55
58
|
.nut-noticebar .nut-noticebar-box-right-icon .nut-icon {
|
|
56
59
|
width: 12px;
|
|
57
60
|
height: 12px;
|
|
61
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
58
62
|
}
|
|
59
63
|
.nut-noticebar .nut-noticebar-box-wrap {
|
|
60
64
|
display: flex;
|
|
61
65
|
flex: 1;
|
|
66
|
+
align-items: center;
|
|
62
67
|
height: var(--nutui-noticebar-line-height, 24px);
|
|
63
68
|
line-height: var(--nutui-noticebar-line-height, 24px);
|
|
64
69
|
overflow: hidden;
|
|
@@ -67,6 +72,7 @@
|
|
|
67
72
|
.nut-noticebar .nut-noticebar-box-wrap .nut-noticebar-box-wrap-content {
|
|
68
73
|
position: absolute;
|
|
69
74
|
white-space: nowrap;
|
|
75
|
+
color: var(--nutui-noticebar-color, #d9500b);
|
|
70
76
|
}
|
|
71
77
|
.nut-noticebar .nut-noticebar-box-wrap .nut-noticebar-box-wrap-content.nut-ellipsis {
|
|
72
78
|
max-width: 100%;
|
|
@@ -23,7 +23,6 @@ var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
|
23
23
|
var _object_without_properties = require("@swc/helpers/_/_object_without_properties");
|
|
24
24
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
25
25
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
26
|
-
var _reacttransitiongroup = require("react-transition-group");
|
|
27
26
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
28
27
|
var _components = require("@tarojs/components");
|
|
29
28
|
var _typings = require("../../utils/typings");
|
|
@@ -73,20 +72,27 @@ var Overlay = function Overlay(props) {
|
|
|
73
72
|
return /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread_props._)((0, _object_spread._)({
|
|
74
73
|
ref: nodeRef,
|
|
75
74
|
className: classes,
|
|
76
|
-
style: styles
|
|
75
|
+
style: (0, _object_spread_props._)((0, _object_spread._)({}, styles), {
|
|
76
|
+
display: innerVisible ? 'block' : 'none'
|
|
77
|
+
})
|
|
77
78
|
}, rest), {
|
|
78
79
|
catchMove: lockScroll,
|
|
79
80
|
onClick: handleClick
|
|
80
81
|
}), children);
|
|
81
82
|
};
|
|
82
|
-
return /*#__PURE__*/ _react.default.createElement(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, renderOverlay());
|
|
84
|
+
// return (
|
|
85
|
+
// <CSSTransition
|
|
86
|
+
// nodeRef={nodeRef}
|
|
87
|
+
// classNames={`${classPrefix}-slide`}
|
|
88
|
+
// unmountOnExit
|
|
89
|
+
// timeout={duration}
|
|
90
|
+
// in={innerVisible}
|
|
91
|
+
// onEntered={afterShow}
|
|
92
|
+
// onExited={afterClose}
|
|
93
|
+
// >
|
|
94
|
+
// {renderOverlay()}
|
|
95
|
+
// </CSSTransition>
|
|
96
|
+
// )
|
|
91
97
|
};
|
|
92
98
|
Overlay.displayName = 'NutOverlay';
|
|
@@ -16,7 +16,6 @@ var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
|
16
16
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
17
17
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
18
18
|
var _reactdom = require("react-dom");
|
|
19
|
-
var _reacttransitiongroup = require("react-transition-group");
|
|
20
19
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
21
20
|
var _iconsreacttaro = require("@nutui/icons-react-taro");
|
|
22
21
|
var _components = require("@tarojs/components");
|
|
@@ -119,26 +118,39 @@ var Popup = function Popup(props) {
|
|
|
119
118
|
return renderCloseIcon();
|
|
120
119
|
}
|
|
121
120
|
};
|
|
122
|
-
var
|
|
123
|
-
return /*#__PURE__*/ _react.default.createElement(
|
|
121
|
+
var renderPop = function renderPop() {
|
|
122
|
+
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
124
123
|
ref: refObject,
|
|
125
|
-
style: popStyles,
|
|
124
|
+
style: (0, _object_spread_props._)((0, _object_spread._)({}, popStyles), {
|
|
125
|
+
display: innerVisible ? 'block' : 'none'
|
|
126
|
+
}),
|
|
126
127
|
className: popClassName,
|
|
127
128
|
onClick: onClick,
|
|
128
129
|
catchMove: lockScroll
|
|
129
|
-
}, renderTitle(), showChildren ? children : null)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
130
|
+
}, renderTitle(), showChildren ? children : null);
|
|
131
|
+
// return (
|
|
132
|
+
// <CSSTransition
|
|
133
|
+
// nodeRef={refObject}
|
|
134
|
+
// classNames={transitionName}
|
|
135
|
+
// mountOnEnter
|
|
136
|
+
// unmountOnExit={destroyOnClose}
|
|
137
|
+
// timeout={duration}
|
|
138
|
+
// in={innerVisible}
|
|
139
|
+
// onEntered={afterShow}
|
|
140
|
+
// onExited={afterClose}
|
|
141
|
+
// >
|
|
142
|
+
// <View
|
|
143
|
+
// ref={refObject}
|
|
144
|
+
// style={popStyles}
|
|
145
|
+
// className={popClassName}
|
|
146
|
+
// onClick={onClick}
|
|
147
|
+
// catchMove={lockScroll}
|
|
148
|
+
// >
|
|
149
|
+
// {renderTitle()}
|
|
150
|
+
// {showChildren ? children : null}
|
|
151
|
+
// </View>
|
|
152
|
+
// </CSSTransition>
|
|
153
|
+
// )
|
|
142
154
|
};
|
|
143
155
|
var renderNode = function renderNode() {
|
|
144
156
|
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, overlay ? /*#__PURE__*/ _react.default.createElement(_index.default, {
|
|
@@ -9,14 +9,16 @@ Object.defineProperty(exports, "Price", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
13
|
var _define_property = require("@swc/helpers/_/_define_property");
|
|
13
14
|
var _object_spread = require("@swc/helpers/_/_object_spread");
|
|
14
15
|
var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
15
|
-
var _react = /*#__PURE__*/
|
|
16
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
16
17
|
var _components = require("@tarojs/components");
|
|
17
18
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
18
19
|
var _typings = require("../../utils/typings");
|
|
19
20
|
var _index = require("../configprovider/index");
|
|
21
|
+
var _types = require("../../types");
|
|
20
22
|
var _platform = require("../../utils/taro/platform");
|
|
21
23
|
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
22
24
|
color: 'primary',
|
|
@@ -29,9 +31,28 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
|
|
|
29
31
|
line: false
|
|
30
32
|
});
|
|
31
33
|
var Price = function Price(props) {
|
|
32
|
-
var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), color = _$_object_spread.color,
|
|
34
|
+
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;
|
|
33
35
|
var classPrefix = 'nut-price';
|
|
34
36
|
var rtl = (0, _index.useRtl)();
|
|
37
|
+
var price = (0, _react.useMemo)(function() {
|
|
38
|
+
return originalPrice.toString().replace(/[^\d.]/g, '');
|
|
39
|
+
}, [
|
|
40
|
+
originalPrice
|
|
41
|
+
]);
|
|
42
|
+
var isCustomPriceColor = (0, _react.useMemo)(function() {
|
|
43
|
+
var specificPriceColor = Object.values(_types.PriceColorEnum);
|
|
44
|
+
return !specificPriceColor.includes(color);
|
|
45
|
+
}, [
|
|
46
|
+
color
|
|
47
|
+
]);
|
|
48
|
+
var priceColorStyle = (0, _react.useMemo)(function() {
|
|
49
|
+
return isCustomPriceColor ? {
|
|
50
|
+
color: color
|
|
51
|
+
} : {};
|
|
52
|
+
}, [
|
|
53
|
+
isCustomPriceColor,
|
|
54
|
+
color
|
|
55
|
+
]);
|
|
35
56
|
var replaceSpecialChar = function replaceSpecialChar(url) {
|
|
36
57
|
url = url.replace(/"/g, '"');
|
|
37
58
|
url = url.replace(/&/g, '&');
|
|
@@ -48,8 +69,8 @@ var Price = function Price(props) {
|
|
|
48
69
|
if (Number(num) === 0) {
|
|
49
70
|
num = 0;
|
|
50
71
|
}
|
|
51
|
-
num = num.toString();
|
|
52
72
|
if (checkPoint(num)) {
|
|
73
|
+
num = num.toString();
|
|
53
74
|
num = typeof num.split('.') === 'string' ? num.split('.') : num.split('.')[0];
|
|
54
75
|
}
|
|
55
76
|
if (thousands) {
|
|
@@ -62,14 +83,17 @@ var Price = function Price(props) {
|
|
|
62
83
|
decimalNum = 0;
|
|
63
84
|
}
|
|
64
85
|
if (checkPoint(decimalNum)) {
|
|
65
|
-
decimalNum = Number(decimalNum).toFixed(digits);
|
|
66
|
-
decimalNum = typeof decimalNum.split('.') === 'string' ? 0 : decimalNum.split('.')[1] ||
|
|
86
|
+
decimalNum = digits ? Number(decimalNum).toFixed(digits) : "".concat(decimalNum);
|
|
87
|
+
decimalNum = typeof decimalNum.split('.') === 'string' ? 0 : decimalNum.split('.')[1] || '';
|
|
67
88
|
} else {
|
|
68
|
-
decimalNum =
|
|
89
|
+
decimalNum = '';
|
|
90
|
+
}
|
|
91
|
+
if (digits) {
|
|
92
|
+
var result = "0.".concat(decimalNum);
|
|
93
|
+
var resultFixed = Number(result).toFixed(digits);
|
|
94
|
+
return String(resultFixed).substring(2, resultFixed.length);
|
|
69
95
|
}
|
|
70
|
-
|
|
71
|
-
var resultFixed = Number(result).toFixed(digits);
|
|
72
|
-
return String(resultFixed).substring(2, resultFixed.length);
|
|
96
|
+
return decimalNum;
|
|
73
97
|
};
|
|
74
98
|
var renderSymbol = function renderSymbol() {
|
|
75
99
|
var _obj;
|
|
@@ -78,16 +102,20 @@ var Price = function Price(props) {
|
|
|
78
102
|
"".concat(classPrefix, "-symbol"),
|
|
79
103
|
"".concat(classPrefix, "-symbol-").concat(size),
|
|
80
104
|
(_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-line"), line), (0, _define_property._)(_obj, "".concat(classPrefix, "-rtl"), rtl), _obj)
|
|
81
|
-
])
|
|
105
|
+
]),
|
|
106
|
+
style: priceColorStyle
|
|
82
107
|
}, symbol ? replaceSpecialChar(symbol) : '');
|
|
83
108
|
};
|
|
84
109
|
var renderInner = function renderInner() {
|
|
85
110
|
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, symbol && position === 'before' ? renderSymbol() : null, /*#__PURE__*/ _react.default.createElement(_components.Text, {
|
|
86
|
-
className: "".concat(classPrefix, "-integer ").concat(classPrefix, "-integer-").concat(size, " ").concat(line ? "".concat(classPrefix, "-line") : '')
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
111
|
+
className: "".concat(classPrefix, "-integer ").concat(classPrefix, "-integer-").concat(size, " ").concat(line ? "".concat(classPrefix, "-line") : ''),
|
|
112
|
+
style: priceColorStyle
|
|
113
|
+
}, formatThousands(price)), digits !== 0 ? /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, checkPoint(price) || digits ? /*#__PURE__*/ _react.default.createElement(_components.Text, {
|
|
114
|
+
className: "".concat(classPrefix, "-decimal ").concat(classPrefix, "-decimal-").concat(size, " ").concat(line ? "".concat(classPrefix, "-line") : ''),
|
|
115
|
+
style: priceColorStyle
|
|
116
|
+
}, ".") : null, /*#__PURE__*/ _react.default.createElement(_components.Text, {
|
|
117
|
+
className: "".concat(classPrefix, "-decimal ").concat(classPrefix, "-decimal-").concat(size, " ").concat(line ? "".concat(classPrefix, "-line") : ''),
|
|
118
|
+
style: priceColorStyle
|
|
91
119
|
}, formatDecimal(price))) : null, symbol && position === 'after' ? renderSymbol() : null);
|
|
92
120
|
};
|
|
93
121
|
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (0, _platform.harmony)() ? /*#__PURE__*/ _react.default.createElement(_components.Text, {
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { BaseProps } from '../../base/props';
|
|
2
2
|
import { SimpleValue, UISize } from '../../base/atoms';
|
|
3
3
|
export type PriceSize = Exclude<UISize, 'mini'>;
|
|
4
|
-
export type
|
|
4
|
+
export type SpecificPriceColor = 'primary' | 'gray' | 'darkgray';
|
|
5
|
+
export type PriceColor = SpecificPriceColor | string;
|
|
6
|
+
export declare enum PriceColorEnum {
|
|
7
|
+
Primary = "primary",
|
|
8
|
+
Gray = "gray",
|
|
9
|
+
Darkgray = "darkgray"
|
|
10
|
+
}
|
|
5
11
|
export interface BasePrice extends BaseProps {
|
|
6
12
|
color: PriceColor;
|
|
7
13
|
price: SimpleValue;
|
|
8
14
|
symbol: string;
|
|
9
|
-
digits: number;
|
|
15
|
+
digits: number | null;
|
|
10
16
|
thousands: boolean;
|
|
11
17
|
position: string;
|
|
12
18
|
size: PriceSize;
|
|
@@ -2,3 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
Object.defineProperty(exports, "PriceColorEnum", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PriceColorEnum;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var PriceColorEnum = /*#__PURE__*/ function(PriceColorEnum) {
|
|
12
|
+
PriceColorEnum["Primary"] = "primary";
|
|
13
|
+
PriceColorEnum["Gray"] = "gray";
|
|
14
|
+
PriceColorEnum["Darkgray"] = "darkgray";
|
|
15
|
+
return PriceColorEnum;
|
|
16
|
+
}({});
|
|
@@ -10,3 +10,4 @@ export interface Rect {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function makeRect(width: number, height: number): Rect;
|
|
12
12
|
export declare const getRectInMultiPlatform: (element: any, harmonyId?: string) => Promise<Rect>;
|
|
13
|
+
export declare const getRectInMultiPlatformWithoutCache: (element: any, harmonyId?: string) => Promise<Rect>;
|
|
@@ -12,6 +12,9 @@ _export(exports, {
|
|
|
12
12
|
getRectInMultiPlatform: function() {
|
|
13
13
|
return getRectInMultiPlatform;
|
|
14
14
|
},
|
|
15
|
+
getRectInMultiPlatformWithoutCache: function() {
|
|
16
|
+
return getRectInMultiPlatformWithoutCache;
|
|
17
|
+
},
|
|
15
18
|
makeRect: function() {
|
|
16
19
|
return makeRect;
|
|
17
20
|
}
|
|
@@ -74,3 +77,36 @@ var getRectInMultiPlatform = /*#__PURE__*/ function() {
|
|
|
74
77
|
return _ref.apply(this, arguments);
|
|
75
78
|
};
|
|
76
79
|
}();
|
|
80
|
+
var getRectInMultiPlatformWithoutCache = /*#__PURE__*/ function() {
|
|
81
|
+
var _ref = (0, _async_to_generator._)(function(element) {
|
|
82
|
+
var harmonyId;
|
|
83
|
+
var _arguments = arguments;
|
|
84
|
+
return (0, _ts_generator._)(this, function(_state) {
|
|
85
|
+
harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
|
|
86
|
+
if (element) {
|
|
87
|
+
if (_getrect.inBrowser) {
|
|
88
|
+
return [
|
|
89
|
+
2,
|
|
90
|
+
Promise.resolve((0, _getrect.getRect)(element))
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
return [
|
|
94
|
+
2,
|
|
95
|
+
new Promise(function(resolve, reject) {
|
|
96
|
+
(0, _taro.createSelectorQuery)().select("#".concat(harmonyId || element.uid)).boundingClientRect().exec(function(param) {
|
|
97
|
+
var _param = (0, _sliced_to_array._)(param, 1), rects = _param[0];
|
|
98
|
+
resolve(rects);
|
|
99
|
+
});
|
|
100
|
+
})
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
return [
|
|
104
|
+
2,
|
|
105
|
+
Promise.resolve(makeRect(0, 0))
|
|
106
|
+
];
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
return function getRectInMultiPlatformWithoutCache(element) {
|
|
110
|
+
return _ref.apply(this, arguments);
|
|
111
|
+
};
|
|
112
|
+
}();
|
|
@@ -6,7 +6,6 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
|
6
6
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
7
7
|
import React, { useState } from "react";
|
|
8
8
|
import classNames from "classnames";
|
|
9
|
-
import { CSSTransition } from "react-transition-group";
|
|
10
9
|
import { View } from "@tarojs/components";
|
|
11
10
|
import { Failure, Close } from "@nutui/icons-react-taro";
|
|
12
11
|
import Button from "../button/index";
|
|
@@ -171,24 +170,29 @@ export var BaseDialog = function(props) {
|
|
|
171
170
|
var renderContent = function() {
|
|
172
171
|
var contentZIndex = harmony() ? zIndex + 1 : zIndex // 解决harmony层级问题
|
|
173
172
|
;
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
173
|
+
return (
|
|
174
|
+
// <CSSTransition
|
|
175
|
+
// in={visible}
|
|
176
|
+
// timeout={300}
|
|
177
|
+
// classNames="fadeDialog"
|
|
178
|
+
// unmountOnExit
|
|
179
|
+
// appear
|
|
180
|
+
// >
|
|
181
|
+
/*#__PURE__*/ (React.createElement(Content, {
|
|
182
|
+
className: className,
|
|
183
|
+
style: _object_spread_props(_object_spread({
|
|
184
|
+
zIndex: contentZIndex
|
|
185
|
+
}, style), {
|
|
186
|
+
display: visible ? 'block' : 'none'
|
|
187
|
+
}),
|
|
188
|
+
title: title,
|
|
189
|
+
header: header,
|
|
190
|
+
close: renderCloseIcon(),
|
|
191
|
+
footer: renderFooter(),
|
|
192
|
+
footerDirection: footerDirection,
|
|
193
|
+
visible: visible
|
|
194
|
+
}, content || children))
|
|
195
|
+
);
|
|
192
196
|
};
|
|
193
197
|
return /*#__PURE__*/ React.createElement(View, {
|
|
194
198
|
style: {
|