@nutui/nutui-react-taro 3.0.18-cpp.beta.1 → 3.0.18

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/packages/dialog/dialog.js +10 -12
  3. package/dist/cjs/packages/ellipsis/ellipsis.js +1 -1
  4. package/dist/cjs/packages/noticebar/style/noticebar.scss +6 -0
  5. package/dist/cjs/packages/noticebar/style/style.css +6 -0
  6. package/dist/cjs/packages/noticebar/style/style.harmony.css +6 -0
  7. package/dist/cjs/packages/noticebar/style-jmapp/noticebar.scss +6 -0
  8. package/dist/cjs/packages/noticebar/style-jmapp/style.css +6 -0
  9. package/dist/cjs/packages/noticebar/style-jrkf/noticebar.scss +6 -0
  10. package/dist/cjs/packages/noticebar/style-jrkf/style.css +6 -0
  11. package/dist/cjs/packages/overlay/overlay.js +11 -17
  12. package/dist/cjs/packages/popup/popup.js +17 -29
  13. package/dist/cjs/packages/price/price.js +43 -15
  14. package/dist/cjs/types/spec/price/base.d.ts +8 -2
  15. package/dist/cjs/types/spec/price/base.js +12 -0
  16. package/dist/cjs/utils/taro/get-rect.d.ts +1 -0
  17. package/dist/cjs/utils/taro/get-rect.js +36 -0
  18. package/dist/es/packages/dialog/dialog.js +19 -23
  19. package/dist/es/packages/ellipsis/ellipsis.js +2 -2
  20. package/dist/es/packages/noticebar/style/noticebar.scss +6 -0
  21. package/dist/es/packages/noticebar/style/style.css +6 -0
  22. package/dist/es/packages/noticebar/style/style.harmony.css +6 -0
  23. package/dist/es/packages/noticebar/style-jmapp/noticebar.scss +6 -0
  24. package/dist/es/packages/noticebar/style-jmapp/style.css +6 -0
  25. package/dist/es/packages/noticebar/style-jrkf/noticebar.scss +6 -0
  26. package/dist/es/packages/noticebar/style-jrkf/style.css +6 -0
  27. package/dist/es/packages/overlay/overlay.js +11 -17
  28. package/dist/es/packages/popup/popup.js +17 -30
  29. package/dist/es/packages/price/price.js +42 -15
  30. package/dist/es/types/spec/price/base.d.ts +17 -5
  31. package/dist/es/types/spec/price/base.js +6 -1
  32. package/dist/es/utils/taro/get-rect.d.ts +1 -0
  33. package/dist/es/utils/taro/get-rect.js +34 -0
  34. package/dist/nutui.react.umd.js +10006 -9938
  35. package/dist/style-jmapp.css +1 -1
  36. package/dist/style-jmapp.scss +32 -32
  37. package/dist/style-jrkf.css +1 -1
  38. package/dist/style-jrkf.scss +29 -29
  39. package/dist/style.css +1 -1
  40. package/dist/style.scss +30 -30
  41. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # v3.0.18
2
+ `2025-08-15`
3
+
4
+
5
+ * 🏡 chore: 升级icon库 (#3330)
6
+ * 🏡 chore: 发布taro下的样式按需插件
7
+ * 📖 docs: 更新介绍部分内容 (#3324)
8
+ * :sparkles: feat: Ellipsis校验越界不走缓存配置 (#3329)
9
+ * :sparkles: feat(price): 支持自定义颜色&数据原样输出 (#3328)
10
+ * :sparkles: feat(notify): 支持promise调用notice (#3319)
11
+ * :bug: fix(noticebar): 适配鸿蒙样式修复 (#3332)
12
+ * :bug: Fix icons svg (#3331)
13
+
14
+
1
15
  # v3.0.17
2
16
 
3
17
  `2025-08-01`
@@ -29,6 +29,7 @@ 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");
32
33
  var _components = require("@tarojs/components");
33
34
  var _iconsreacttaro = require("@nutui/icons-react-taro");
34
35
  var _index = /*#__PURE__*/ _interop_require_default._(require("../button/index"));
@@ -193,20 +194,17 @@ var BaseDialog = function BaseDialog(props) {
193
194
  var renderContent = function renderContent() {
194
195
  var contentZIndex = (0, _platform.harmony)() ? zIndex + 1 : zIndex // 解决harmony层级问题
195
196
  ;
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, {
197
+ return /*#__PURE__*/ _react.default.createElement(_reacttransitiongroup.CSSTransition, {
198
+ in: visible,
199
+ timeout: 300,
200
+ classNames: "fadeDialog",
201
+ unmountOnExit: true,
202
+ appear: true
203
+ }, /*#__PURE__*/ _react.default.createElement(_content.Content, {
204
204
  className: className,
205
- style: (0, _object_spread_props._)((0, _object_spread._)({
205
+ style: (0, _object_spread._)({
206
206
  zIndex: contentZIndex
207
- }, style), {
208
- display: visible ? 'block' : 'none'
209
- }),
207
+ }, style),
210
208
  title: title,
211
209
  header: header,
212
210
  close: renderCloseIcon(),
@@ -229,7 +229,7 @@ var Ellipsis = function Ellipsis(props) {
229
229
  case 0:
230
230
  return [
231
231
  4,
232
- (0, _getrect.getRectInMultiPlatform)(rootContain.current)
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,6 +23,7 @@ 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");
26
27
  var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
27
28
  var _components = require("@tarojs/components");
28
29
  var _typings = require("../../utils/typings");
@@ -72,27 +73,20 @@ var Overlay = function Overlay(props) {
72
73
  return /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread_props._)((0, _object_spread._)({
73
74
  ref: nodeRef,
74
75
  className: classes,
75
- style: (0, _object_spread_props._)((0, _object_spread._)({}, styles), {
76
- display: innerVisible ? 'block' : 'none'
77
- })
76
+ style: styles
78
77
  }, rest), {
79
78
  catchMove: lockScroll,
80
79
  onClick: handleClick
81
80
  }), children);
82
81
  };
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
- // )
82
+ return /*#__PURE__*/ _react.default.createElement(_reacttransitiongroup.CSSTransition, {
83
+ nodeRef: nodeRef,
84
+ classNames: "".concat(classPrefix, "-slide"),
85
+ unmountOnExit: true,
86
+ timeout: duration,
87
+ in: innerVisible,
88
+ onEntered: afterShow,
89
+ onExited: afterClose
90
+ }, renderOverlay());
97
91
  };
98
92
  Overlay.displayName = 'NutOverlay';
@@ -16,6 +16,7 @@ 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");
19
20
  var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
20
21
  var _iconsreacttaro = require("@nutui/icons-react-taro");
21
22
  var _components = require("@tarojs/components");
@@ -118,39 +119,26 @@ var Popup = function Popup(props) {
118
119
  return renderCloseIcon();
119
120
  }
120
121
  };
121
- var renderPop = function renderPop() {
122
- return /*#__PURE__*/ _react.default.createElement(_components.View, {
122
+ var renderContent = function renderContent() {
123
+ return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_components.View, {
123
124
  ref: refObject,
124
- style: (0, _object_spread_props._)((0, _object_spread._)({}, popStyles), {
125
- display: innerVisible ? 'block' : 'none'
126
- }),
125
+ style: popStyles,
127
126
  className: popClassName,
128
127
  onClick: onClick,
129
128
  catchMove: lockScroll
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
- // )
129
+ }, renderTitle(), showChildren ? children : null));
130
+ };
131
+ var renderPop = function renderPop() {
132
+ return /*#__PURE__*/ _react.default.createElement(_reacttransitiongroup.CSSTransition, {
133
+ nodeRef: refObject,
134
+ classNames: transitionName,
135
+ mountOnEnter: true,
136
+ unmountOnExit: destroyOnClose,
137
+ timeout: duration,
138
+ in: innerVisible,
139
+ onEntered: afterShow,
140
+ onExited: afterClose
141
+ }, renderContent());
154
142
  };
155
143
  var renderNode = function renderNode() {
156
144
  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__*/ _interop_require_default._(require("react"));
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, price = _$_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;
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(/&quot;/g, '"');
37
58
  url = url.replace(/&amp;/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] || 0;
86
+ decimalNum = digits ? Number(decimalNum).toFixed(digits) : "".concat(decimalNum);
87
+ decimalNum = typeof decimalNum.split('.') === 'string' ? 0 : decimalNum.split('.')[1] || '';
67
88
  } else {
68
- decimalNum = 0;
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
- var result = "0.".concat(decimalNum);
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
- }, formatThousands(price)), digits ? /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_components.Text, {
88
- className: "".concat(classPrefix, "-decimal ").concat(classPrefix, "-decimal-").concat(size, " ").concat(line ? "".concat(classPrefix, "-line") : '')
89
- }, "."), /*#__PURE__*/ _react.default.createElement(_components.Text, {
90
- className: "".concat(classPrefix, "-decimal ").concat(classPrefix, "-decimal-").concat(size, " ").concat(line ? "".concat(classPrefix, "-line") : '')
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 PriceColor = 'primary' | 'gray' | 'darkgray';
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,6 +6,7 @@ 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";
9
10
  import { View } from "@tarojs/components";
10
11
  import { Failure, Close } from "@nutui/icons-react-taro";
11
12
  import Button from "../button/index";
@@ -170,29 +171,24 @@ export var BaseDialog = function(props) {
170
171
  var renderContent = function() {
171
172
  var contentZIndex = harmony() ? zIndex + 1 : zIndex // 解决harmony层级问题
172
173
  ;
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
- );
174
+ return /*#__PURE__*/ React.createElement(CSSTransition, {
175
+ in: visible,
176
+ timeout: 300,
177
+ classNames: "fadeDialog",
178
+ unmountOnExit: true,
179
+ appear: true
180
+ }, /*#__PURE__*/ React.createElement(Content, {
181
+ className: className,
182
+ style: _object_spread({
183
+ zIndex: contentZIndex
184
+ }, style),
185
+ title: title,
186
+ header: header,
187
+ close: renderCloseIcon(),
188
+ footer: renderFooter(),
189
+ footerDirection: footerDirection,
190
+ visible: visible
191
+ }, content || children));
196
192
  };
197
193
  return /*#__PURE__*/ React.createElement(View, {
198
194
  style: {