@nutui/nutui-react-taro 3.0.4 → 3.0.6

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 (140) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/cjs/packages/badge/badge.js +4 -3
  3. package/dist/cjs/packages/badge/style/badge.scss +7 -8
  4. package/dist/cjs/packages/badge/style/style.css +13 -15
  5. package/dist/cjs/packages/badge/style/style.harmony.css +7 -9
  6. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  7. package/dist/cjs/packages/datepicker/style/style.css +3 -1
  8. package/dist/cjs/packages/datepickerview/style/style.css +3 -1
  9. package/dist/cjs/packages/empty/style/index.js +1 -0
  10. package/dist/cjs/packages/empty/style/style.css +389 -0
  11. package/dist/cjs/packages/fixednav/fixednav.js +3 -3
  12. package/dist/cjs/packages/fixednav/style/fixednav.scss +43 -39
  13. package/dist/cjs/packages/fixednav/style/style.css +56 -51
  14. package/dist/cjs/packages/fixednav/style/style.harmony.css +43 -36
  15. package/dist/cjs/packages/imagepreview/imagepreview.js +58 -91
  16. package/dist/cjs/packages/imagepreview/style/imagepreview.scss +2 -1
  17. package/dist/cjs/packages/imagepreview/style/style.css +2 -1
  18. package/dist/cjs/packages/imagepreview/style/style.harmony.css +2 -1
  19. package/dist/cjs/packages/indicator/indicator.js +1 -1
  20. package/dist/cjs/packages/inputnumber/inputnumber.js +2 -2
  21. package/dist/cjs/packages/lottie/index.js +5 -5
  22. package/dist/cjs/packages/lottie/{mp.js → lottiemp.js} +1 -1
  23. package/dist/cjs/packages/notify/notify.js +44 -13
  24. package/dist/cjs/packages/notify/style/notify.scss +39 -36
  25. package/dist/cjs/packages/notify/style/style.css +36 -31
  26. package/dist/cjs/packages/notify/style/style.harmony.css +36 -31
  27. package/dist/cjs/packages/nutui.react.d.ts +1 -0
  28. package/dist/cjs/packages/nutui.react.js +1 -0
  29. package/dist/cjs/packages/picker/style/style.css +3 -1
  30. package/dist/cjs/packages/pickerview/pickerroller.js +81 -11
  31. package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -1
  32. package/dist/cjs/packages/pickerview/style/style.css +3 -1
  33. package/dist/cjs/packages/pickerview/style/style.harmony.css +3 -0
  34. package/dist/cjs/packages/resultpage/style/index.js +1 -0
  35. package/dist/cjs/packages/resultpage/style/style.css +389 -0
  36. package/dist/cjs/packages/searchbar/searchbar.js +8 -2
  37. package/dist/cjs/packages/skeleton/skeleton.js +63 -52
  38. package/dist/cjs/packages/skeleton/style/index.js +0 -1
  39. package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
  40. package/dist/cjs/packages/skeleton/style/style.css +32 -175
  41. package/dist/cjs/packages/skeleton/style/style.harmony.css +32 -42
  42. package/dist/cjs/packages/switch/style/style.css +5 -0
  43. package/dist/cjs/packages/switch/style/style.harmony.css +5 -0
  44. package/dist/cjs/packages/switch/style/switch.scss +5 -0
  45. package/dist/cjs/packages/switch/switch.js +22 -11
  46. package/dist/cjs/packages/tabbar/style/style.css +58 -54
  47. package/dist/cjs/packages/tabbar/style/style.harmony.css +24 -18
  48. package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
  49. package/dist/cjs/packages/tabbar/tabbar.js +28 -10
  50. package/dist/cjs/packages/tabbaritem/style/style.css +34 -36
  51. package/dist/cjs/packages/tabbaritem/style/style.harmony.css +21 -21
  52. package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
  53. package/dist/cjs/packages/tabbaritem/tabbaritem.js +38 -14
  54. package/dist/cjs/types/spec/badge/base.d.ts +1 -0
  55. package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
  56. package/dist/cjs/types/spec/notify/base.d.ts +7 -2
  57. package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
  58. package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
  59. package/dist/cjs/types/spec/switch/base.d.ts +3 -2
  60. package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
  61. package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
  62. package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
  63. package/dist/es/packages/badge/badge.js +4 -3
  64. package/dist/es/packages/badge/style/badge.scss +7 -8
  65. package/dist/es/packages/badge/style/style.css +13 -15
  66. package/dist/es/packages/badge/style/style.harmony.css +7 -9
  67. package/dist/es/packages/configprovider/types.d.ts +1 -1
  68. package/dist/es/packages/datepicker/style/style.css +3 -1
  69. package/dist/es/packages/datepickerview/style/style.css +3 -1
  70. package/dist/es/packages/empty/style/index.js +1 -0
  71. package/dist/es/packages/empty/style/style.css +389 -0
  72. package/dist/es/packages/fixednav/fixednav.js +4 -4
  73. package/dist/es/packages/fixednav/style/fixednav.scss +43 -39
  74. package/dist/es/packages/fixednav/style/style.css +56 -51
  75. package/dist/es/packages/fixednav/style/style.harmony.css +43 -36
  76. package/dist/es/packages/imagepreview/imagepreview.js +58 -91
  77. package/dist/es/packages/imagepreview/style/imagepreview.scss +2 -1
  78. package/dist/es/packages/imagepreview/style/style.css +2 -1
  79. package/dist/es/packages/imagepreview/style/style.harmony.css +2 -1
  80. package/dist/es/packages/indicator/indicator.js +1 -1
  81. package/dist/es/packages/inputnumber/inputnumber.js +2 -2
  82. package/dist/es/packages/lottie/index.js +3 -3
  83. package/dist/es/packages/lottie/{mp.js → lottiemp.js} +1 -1
  84. package/dist/es/packages/notify/notify.js +45 -14
  85. package/dist/es/packages/notify/style/notify.scss +39 -36
  86. package/dist/es/packages/notify/style/style.css +36 -31
  87. package/dist/es/packages/notify/style/style.harmony.css +36 -31
  88. package/dist/es/packages/picker/style/style.css +3 -1
  89. package/dist/es/packages/pickerview/pickerroller.js +80 -11
  90. package/dist/es/packages/pickerview/style/pickerview.scss +3 -1
  91. package/dist/es/packages/pickerview/style/style.css +3 -1
  92. package/dist/es/packages/pickerview/style/style.harmony.css +3 -0
  93. package/dist/es/packages/resultpage/style/index.js +1 -0
  94. package/dist/es/packages/resultpage/style/style.css +389 -0
  95. package/dist/es/packages/searchbar/searchbar.js +7 -2
  96. package/dist/es/packages/skeleton/skeleton.js +62 -52
  97. package/dist/es/packages/skeleton/style/index.js +0 -1
  98. package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
  99. package/dist/es/packages/skeleton/style/style.css +32 -175
  100. package/dist/es/packages/skeleton/style/style.harmony.css +32 -42
  101. package/dist/es/packages/switch/style/style.css +5 -0
  102. package/dist/es/packages/switch/style/style.harmony.css +5 -0
  103. package/dist/es/packages/switch/style/switch.scss +5 -0
  104. package/dist/es/packages/switch/switch.js +21 -11
  105. package/dist/es/packages/tabbar/style/style.css +58 -54
  106. package/dist/es/packages/tabbar/style/style.harmony.css +24 -18
  107. package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
  108. package/dist/es/packages/tabbar/tabbar.js +27 -10
  109. package/dist/es/packages/tabbaritem/style/style.css +34 -36
  110. package/dist/es/packages/tabbaritem/style/style.harmony.css +21 -21
  111. package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
  112. package/dist/es/packages/tabbaritem/tabbaritem.js +38 -14
  113. package/dist/es/types/spec/badge/base.d.ts +4 -0
  114. package/dist/es/types/spec/indicator/base.d.ts +1 -1
  115. package/dist/es/types/spec/notify/base.d.ts +22 -5
  116. package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
  117. package/dist/es/types/spec/skeleton/base.d.ts +19 -14
  118. package/dist/es/types/spec/switch/base.d.ts +6 -2
  119. package/dist/es/types/spec/switch/h5.d.ts +1 -1
  120. package/dist/es/types/spec/switch/taro.d.ts +1 -4
  121. package/dist/es/types/spec/tabbar/base.d.ts +7 -4
  122. package/dist/nutui.react.umd.js +549 -395
  123. package/dist/style.css +1 -1
  124. package/dist/style.scss +51 -51
  125. package/dist/styles/theme-dark.scss +2 -0
  126. package/dist/styles/theme-default.scss +2 -0
  127. package/dist/styles/themes/dark.css +1 -1
  128. package/dist/styles/themes/default.css +1 -1
  129. package/dist/styles/themes/jmapp.css +1 -1
  130. package/dist/styles/themes/jrkf.css +1 -1
  131. package/dist/styles/variables-jmapp.scss +24 -1
  132. package/dist/styles/variables-jrkf.scss +24 -1
  133. package/dist/styles/variables.scss +37 -38
  134. package/package.json +1 -1
  135. /package/dist/cjs/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
  136. /package/dist/cjs/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
  137. /package/dist/cjs/packages/lottie/{web.js → lottieweb.js} +0 -0
  138. /package/dist/es/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
  139. /package/dist/es/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
  140. /package/dist/es/packages/lottie/{web.js → lottieweb.js} +0 -0
@@ -5,25 +5,16 @@
5
5
  .nut-tabbar-item {
6
6
  display: flex;
7
7
  flex-direction: column;
8
- justify-content: center;
9
8
  align-items: center;
10
9
  flex: 1;
11
- text-align: center;
12
- text-decoration: none;
10
+ padding: 6px 0 2px;
13
11
  color: #1a1a1a;
14
12
  height: 100%;
15
13
  }
16
- .nut-tabbar-item-icon-box {
17
- padding: 0px;
18
- display: flex;
19
- flex-direction: column;
20
- align-items: center;
21
- position: relative;
22
- }
23
- .nut-tabbar-item-icon-box .nut-icon {
24
- width: 22px;
25
- height: 22px;
26
- font-size: 22px;
14
+ .nut-tabbar-item .nut-icon {
15
+ width: 24px;
16
+ height: 24px;
17
+ font-size: 24px;
27
18
  /* #ifdef harmony*/
28
19
  color: #1a1a1a;
29
20
  /* #endif*/
@@ -31,23 +22,32 @@
31
22
  color: inherit;
32
23
  /* #endif*/
33
24
  }
34
- .nut-tabbar-item-icon-box-nav {
25
+ .nut-tabbar-item-text {
35
26
  display: block;
36
27
  color: #505259;
37
- font-size: 11px;
38
- line-height: 11px;
39
- margin-top: 3px;
28
+ font-size: 10px;
29
+ line-height: 10px;
30
+ margin-top: 4px;
31
+ }
32
+ .nut-tabbar-item .nut-image-default {
33
+ width: 38px;
34
+ height: 38px;
35
+ border-radius: 38px;
36
+ }
37
+ .nut-tabbar-item-large {
38
+ justify-content: center;
39
+ padding: 0;
40
40
  }
41
- .nut-tabbar-item-icon-box-large {
41
+ .nut-tabbar-item-large .nut-tabbar-item-text {
42
42
  font-size: 16px;
43
43
  margin-top: 0;
44
- line-height: 20px;
44
+ line-height: 16px;
45
45
  font-weight: 400;
46
46
  }
47
47
  .nut-tabbar-item-active {
48
48
  color: #ff0f23;
49
49
  }
50
- .nut-tabbar-item-active .nut-tabbar-item-icon-box {
50
+ .nut-tabbar-item-active .nut-tabbar-item-text {
51
51
  /* #ifdef harmony*/
52
52
  color: #ff0f23;
53
53
  /* #endif*/
@@ -1,45 +1,48 @@
1
1
  .nut-tabbar-item {
2
2
  display: flex;
3
3
  flex-direction: column;
4
- justify-content: center;
5
4
  align-items: center;
6
5
  flex: 1;
7
- text-align: center;
8
- text-decoration: none;
6
+ padding: 6px 0 2px;
9
7
  color: $tabbar-inactive-color;
10
8
  height: 100%;
11
9
 
12
- &-icon-box {
13
- padding: 0px;
14
- display: flex;
15
- flex-direction: column;
16
- align-items: center;
17
- position: relative;
10
+ .nut-icon {
11
+ width: 24px;
12
+ height: 24px;
13
+ font-size: 24px;
14
+ /* #ifdef harmony*/
15
+ color: $tabbar-inactive-color;
16
+ /* #endif*/
17
+ /* #ifndef harmony*/
18
+ color: inherit;
19
+ /* #endif*/
20
+ }
18
21
 
19
- .nut-icon {
20
- width: 22px;
21
- height: 22px;
22
- font-size: 22px;
23
- /* #ifdef harmony*/
24
- color: $tabbar-inactive-color;
25
- /* #endif*/
26
- /* #ifndef harmony*/
27
- color: inherit;
28
- /* #endif*/
29
- }
22
+ &-text {
23
+ display: block;
24
+ color: $color-text;
25
+ font-size: $tabbar-text-font-size;
26
+ line-height: $tabbar-text-font-size;
27
+ margin-top: $tabbar-text-margin-top;
28
+ }
30
29
 
31
- &-nav {
32
- display: block;
33
- color: $color-text;
34
- font-size: $tabbar-text-font-size;
35
- line-height: $tabbar-text-font-size;
36
- margin-top: $tabbar-text-margin-top;
30
+ .nut-image {
31
+ &-default {
32
+ width: 38px;
33
+ height: 38px;
34
+ border-radius: 38px;
37
35
  }
36
+ }
37
+
38
+ &-large {
39
+ justify-content: center;
40
+ padding: 0;
38
41
 
39
- &-large {
42
+ .nut-tabbar-item-text {
40
43
  font-size: $tabbar-text-large-font-size;
41
44
  margin-top: 0;
42
- line-height: $tabbar-text-line-height;
45
+ line-height: $tabbar-text-large-font-size;
43
46
  font-weight: $tabbar-text-large-font-weight;
44
47
  }
45
48
  }
@@ -47,7 +50,7 @@
47
50
  &-active {
48
51
  color: $tabbar-active-color;
49
52
 
50
- .nut-tabbar-item-icon-box,
53
+ .nut-tabbar-item-text,
51
54
  .nut-icon {
52
55
  /* #ifdef harmony*/
53
56
  color: $tabbar-active-color;
@@ -20,7 +20,6 @@ var _components = require("@tarojs/components");
20
20
  var _typings = require("../../utils/typings");
21
21
  var _index = /*#__PURE__*/ _interop_require_default._(require("../badge/index"));
22
22
  var _context = /*#__PURE__*/ _interop_require_default._(require("../tabbar/context"));
23
- var _addcolorforharmony = /*#__PURE__*/ _interop_require_default._(require("../../utils/add-color-for-harmony"));
24
23
  var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
25
24
  title: '',
26
25
  icon: null,
@@ -28,11 +27,12 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
28
27
  dot: false,
29
28
  max: 99,
30
29
  top: '0',
31
- right: '0'
30
+ right: '0',
31
+ direction: 'vertical'
32
32
  });
33
33
  var TabbarItem = function TabbarItem(props) {
34
34
  var ctx = (0, _react.useContext)(_context.default);
35
- var _ref = (0, _object_spread._)({}, defaultProps, props), className = _ref.className, style = _ref.style, title = _ref.title, icon = _ref.icon, value = _ref.value, dot = _ref.dot, max = _ref.max, top = _ref.top, right = _ref.right, index = _ref.index, rest = (0, _object_without_properties._)(_ref, [
35
+ var _ref = (0, _object_spread._)({}, defaultProps, props), className = _ref.className, style = _ref.style, title = _ref.title, icon = _ref.icon, value = _ref.value, dot = _ref.dot, max = _ref.max, top = _ref.top, right = _ref.right, index = _ref.index, direction = _ref.direction, onActiveClick = _ref.onActiveClick, rest = (0, _object_without_properties._)(_ref, [
36
36
  "className",
37
37
  "style",
38
38
  "title",
@@ -42,15 +42,19 @@ var TabbarItem = function TabbarItem(props) {
42
42
  "max",
43
43
  "top",
44
44
  "right",
45
- "index"
45
+ "index",
46
+ "direction",
47
+ "onActiveClick"
46
48
  ]);
47
49
  var active = index === (ctx === null || ctx === void 0 ? void 0 : ctx.selectIndex);
48
50
  var classPrefix = 'nut-tabbar-item';
49
- var tabbarItemClass = (0, _classnames.default)(classPrefix, (0, _define_property._)({}, "".concat(classPrefix, "-active"), active), className);
50
- var boxPrefix = "".concat(classPrefix, "-icon-box");
51
- var titleClass = (0, _classnames.default)(boxPrefix, "".concat(boxPrefix, "-nav"), (0, _define_property._)({}, "".concat(boxPrefix, "-large"), !icon));
51
+ var _obj;
52
+ var tabbarItemClass = (0, _classnames.default)(classPrefix, (_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-active"), active), (0, _define_property._)(_obj, "".concat(classPrefix, "-large"), !icon || !title), _obj), className);
53
+ var renderNodeWithActive = function renderNodeWithActive(node) {
54
+ return node && typeof node === 'function' ? node(active) : node;
55
+ };
52
56
  var badgeProps = {
53
- value: value,
57
+ value: renderNodeWithActive(value),
54
58
  dot: dot,
55
59
  max: max,
56
60
  top: top,
@@ -59,11 +63,33 @@ var TabbarItem = function TabbarItem(props) {
59
63
  };
60
64
  var renderTitleText = function renderTitleText() {
61
65
  return title && /*#__PURE__*/ _react.default.createElement(_components.View, {
62
- className: titleClass,
66
+ className: "".concat(classPrefix, "-text"),
63
67
  style: {
64
68
  color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
65
69
  }
66
- }, title);
70
+ }, renderNodeWithActive(title));
71
+ };
72
+ var renderTitle = function renderTitle() {
73
+ return /*#__PURE__*/ _react.default.createElement(_index.default, (0, _object_spread._)({
74
+ size: "normal"
75
+ }, badgeProps), renderTitleText());
76
+ };
77
+ var renderIcon = function renderIcon() {
78
+ var distIcon = renderNodeWithActive(icon);
79
+ // 鸿蒙差异处理,需要手动给icon一个color
80
+ return /*#__PURE__*/ _react.default.isValidElement(distIcon) ? /*#__PURE__*/ _react.default.cloneElement(distIcon, (0, _object_spread_props._)((0, _object_spread._)({}, distIcon.props), {
81
+ color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
82
+ })) : null;
83
+ };
84
+ var renderIconAndTitle = function renderIconAndTitle() {
85
+ return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_index.default, (0, _object_spread_props._)((0, _object_spread._)({
86
+ size: "normal"
87
+ }, badgeProps), {
88
+ top: 3
89
+ }), renderIcon()), renderTitleText());
90
+ };
91
+ var renderDualItem = function renderDualItem() {
92
+ return dot ? null : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, renderIcon(), renderTitleText(), /*#__PURE__*/ _react.default.createElement(_index.default, badgeProps));
67
93
  };
68
94
  return /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread._)({
69
95
  className: tabbarItemClass,
@@ -71,9 +97,7 @@ var TabbarItem = function TabbarItem(props) {
71
97
  color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
72
98
  }, style),
73
99
  onClick: function onClick() {
74
- return ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
100
+ return active ? onActiveClick === null || onActiveClick === void 0 ? void 0 : onActiveClick() : ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
75
101
  }
76
- }, rest), icon ? /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_index.default, badgeProps, /*#__PURE__*/ _react.default.createElement(_components.View, {
77
- className: boxPrefix
78
- }, (0, _addcolorforharmony.default)(icon, active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor))), renderTitleText()) : /*#__PURE__*/ _react.default.createElement(_index.default, badgeProps, renderTitleText()));
102
+ }, rest), direction === 'horizontal' && !dot ? renderDualItem() : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, icon && renderIconAndTitle(), !icon && renderTitle()));
79
103
  };
@@ -11,4 +11,5 @@ export interface BaseBadge extends BaseProps {
11
11
  right: SimpleValue;
12
12
  fill: BadgeFill;
13
13
  size: BadgeDotSize;
14
+ disabled: boolean;
14
15
  }
@@ -1,6 +1,6 @@
1
1
  import { BaseProps } from '../../base/props';
2
2
  import { UIType } from '../../base/atoms';
3
- export type IndicatorType = 'anchor' | 'slide';
3
+ export type IndicatorType = 'anchor' | 'slide' | 'dualScreen';
4
4
  export type IndicatorColor = Extract<UIType, 'primary' | 'default'>;
5
5
  export interface BaseIndicator extends BaseProps {
6
6
  total: number;
@@ -1,9 +1,14 @@
1
+ import { PositionY } from "../../base/atoms";
1
2
  import { BaseProps } from '../../base/props';
2
3
  export interface BaseNotify extends BaseProps {
3
4
  id: string;
5
+ distance: number;
6
+ navHeight: number;
7
+ closeable: boolean;
8
+ leftIcon: React.ReactNode;
9
+ rightIcon: React.ReactNode;
10
+ position: PositionY;
4
11
  duration: number;
5
- type: string;
6
- position: string;
7
12
  onClick: () => void;
8
13
  onClose: () => void;
9
14
  }
@@ -1,10 +1,13 @@
1
- import type { ChangeEvent, FocusEvent, MouseEvent } from 'react';
2
- import { ITouchEvent } from '@tarojs/components';
1
+ import { BaseEventOrig, ITouchEvent, InputProps } from '@tarojs/components';
3
2
  import { BaseSearchBar } from './base';
3
+ type inputEventDetail = InputProps.inputEventDetail;
4
+ type inputForceEventDetail = InputProps.inputForceEventDetail;
5
+ type inputValueEventDetail = InputProps.inputValueEventDetail;
4
6
  export interface TaroSearchBarProps extends Omit<BaseSearchBar, 'onChange' | 'onFocus' | 'onBlur' | 'onClear' | 'onInputClick'> {
5
- onChange?: (value: string, event?: ChangeEvent<HTMLInputElement>) => void;
6
- onFocus?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
7
- onBlur?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
8
- onClear?: (event: React.MouseEvent<Element, MouseEvent> | ITouchEvent) => void;
9
- onInputClick?: (event: MouseEvent<HTMLInputElement>) => void;
7
+ onChange?: (value: string, event?: BaseEventOrig<inputEventDetail>) => void;
8
+ onFocus?: (value: string, event: BaseEventOrig<inputForceEventDetail>) => void;
9
+ onBlur?: (value: string, event: BaseEventOrig<inputValueEventDetail>) => void;
10
+ onClear?: (event: ITouchEvent) => void;
11
+ onInputClick?: (event: ITouchEvent) => void;
10
12
  }
13
+ export {};
@@ -1,11 +1,13 @@
1
1
  import { BaseProps } from '../../base/props';
2
+ import { SimpleValue, UIRound, UISize } from '../../base/atoms';
2
3
  export type avatarShape = 'round' | 'square';
3
4
  export interface BaseSkeleton extends BaseProps {
4
- animated: boolean;
5
5
  rows: number;
6
- title: boolean;
7
- avatar: boolean;
8
- avatarSize: string;
6
+ size: Extract<UISize, 'small' | 'normal' | 'large'>;
7
+ width?: SimpleValue;
8
+ height?: SimpleValue;
9
+ shape: UIRound | 'circle';
10
+ animated: boolean;
11
+ duration: number;
9
12
  visible: boolean;
10
- avatarShape: avatarShape;
11
13
  }
@@ -1,10 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BaseProps } from '../../base/props';
3
- export interface BaseSwitch<EVENT = any> extends BaseProps {
3
+ export interface BaseSwitch extends BaseProps {
4
4
  checked: boolean;
5
5
  defaultChecked: boolean;
6
6
  disabled: boolean;
7
7
  activeText: ReactNode;
8
8
  inactiveText: ReactNode;
9
- onChange: (val: boolean, event: EVENT) => void;
9
+ loadingIcon: ReactNode;
10
+ onChange: (val: boolean) => void;
10
11
  }
@@ -1,3 +1,3 @@
1
1
  import { BaseSwitch } from '../switch/base';
2
- export interface WebSwitchProps extends BaseSwitch<React.MouseEvent> {
2
+ export interface WebSwitchProps extends BaseSwitch {
3
3
  }
@@ -1,6 +1,3 @@
1
- import { ITouchEvent } from '@tarojs/components';
2
1
  import { BaseSwitch } from './base';
3
- type UnionEvent = React.MouseEvent<Element, MouseEvent> | ITouchEvent;
4
- export interface TaroSwitchProps extends BaseSwitch<UnionEvent> {
2
+ export interface TaroSwitchProps extends BaseSwitch {
5
3
  }
6
- export {};
@@ -1,20 +1,23 @@
1
1
  import { ReactNode } from 'react';
2
- import { BaseProps } from '../../base/props';
2
+ import { BaseProps, Direction } from "../../../types";
3
3
  export interface BaseTabbar extends BaseProps {
4
4
  defaultValue: number;
5
5
  value?: number;
6
6
  fixed: boolean;
7
7
  inactiveColor: string;
8
8
  activeColor: string;
9
+ direction: Direction;
9
10
  safeArea: boolean;
10
11
  onSwitch: (value: number) => void;
11
12
  }
12
13
  export interface BaseTabbarItem extends BaseProps {
13
- title: ReactNode;
14
- icon: ReactNode;
15
- value: ReactNode;
14
+ title: ReactNode | ((active: boolean) => ReactNode);
15
+ icon: ReactNode | ((active: boolean) => ReactNode);
16
+ value: ReactNode | ((active: boolean) => ReactNode);
16
17
  dot: boolean;
17
18
  max: number;
18
19
  top: string;
19
20
  right: string;
21
+ direction: Direction;
22
+ onActiveClick: () => void;
20
23
  }
@@ -19,7 +19,8 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
19
19
  top: 0,
20
20
  right: 0,
21
21
  fill: 'solid',
22
- size: 'large'
22
+ size: 'large',
23
+ disabled: false
23
24
  });
24
25
  export var Badge = function(props) {
25
26
  var getContent = function getContent() {
@@ -40,14 +41,14 @@ export var Badge = function(props) {
40
41
  };
41
42
  var _this;
42
43
  var rtl = useRtl();
43
- var _$_object_spread = _object_spread({}, defaultProps, props), className = _$_object_spread.className, style = _$_object_spread.style, value = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size;
44
+ var _$_object_spread = _object_spread({}, defaultProps, props), className = _$_object_spread.className, style = _$_object_spread.style, value = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size, disabled = _$_object_spread.disabled;
44
45
  var classPrefix = 'nut-badge';
45
46
  var isHarmony = harmony();
46
47
  var classes = classNames(classPrefix, className);
47
48
  var badgeRef = useRef(null);
48
49
  var _useState = _sliced_to_array(useState({}), 2), contentStyle = _useState[0], setContentStyle = _useState[1];
49
50
  var _obj;
50
- var contentClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix, "-number"), isNumber()), _define_property(_obj, "".concat(classPrefix, "-one"), typeof getContent() === 'string' && ((_this = "".concat(getContent())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix, "-dot"), dot), _define_property(_obj, "".concat(classPrefix, "-dot-").concat(size), dot), _define_property(_obj, "".concat(classPrefix, "-").concat(fill), fill === 'outline'), _define_property(_obj, "".concat(classPrefix, "-content"), children), _obj));
51
+ var contentClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix, "-number"), isNumber()), _define_property(_obj, "".concat(classPrefix, "-one"), typeof getContent() === 'string' && ((_this = "".concat(getContent())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix, "-dot"), dot), _define_property(_obj, "".concat(classPrefix, "-dot-").concat(size), dot), _define_property(_obj, "".concat(classPrefix, "-").concat(fill), fill === 'outline'), _define_property(_obj, "".concat(classPrefix, "-content"), children), _define_property(_obj, "".concat(classPrefix, "-disabled"), disabled), _obj));
51
52
  useEffect(function() {
52
53
  if (badgeRef.current) {
53
54
  getPositionStyle();
@@ -1,6 +1,8 @@
1
1
  .nut-badge {
2
2
  position: relative;
3
3
  display: inline-flex;
4
+ vertical-align: middle;
5
+ box-sizing: content-box;
4
6
  width: auto;
5
7
 
6
8
  &-icon {
@@ -37,8 +39,7 @@
37
39
 
38
40
  &-sup {
39
41
  display: inline-flex;
40
- justify-content: center;
41
- height: $badge-height;
42
+ text-align: center;
42
43
  min-width: $badge-min-width;
43
44
  padding: $badge-padding;
44
45
  box-sizing: border-box;
@@ -52,14 +53,12 @@
52
53
  z-index: 1;
53
54
  }
54
55
 
56
+ &-disabled {
57
+ background: $badge-background-disabled-color;
58
+ }
59
+
55
60
  &-number {
56
61
  font-family: 'JD';
57
- /* #ifdef harmony */
58
- line-height: 12px;
59
- /* #endif */
60
- /* #ifndef harmony */
61
- line-height: 13px;
62
- /* #endif */
63
62
  }
64
63
 
65
64
  &-one {
@@ -5,6 +5,8 @@
5
5
  .nut-badge {
6
6
  position: relative;
7
7
  display: inline-flex;
8
+ vertical-align: middle;
9
+ box-sizing: content-box;
8
10
  width: auto;
9
11
  }
10
12
  .nut-badge-icon {
@@ -37,13 +39,12 @@
37
39
  }
38
40
  .nut-badge-sup {
39
41
  display: inline-flex;
40
- justify-content: center;
41
- height: var(--nutui-badge-height, 14px);
42
+ text-align: center;
42
43
  min-width: var(--nutui-badge-min-width, 6px);
43
44
  padding: var(--nutui-badge-padding, 1px 4px);
44
45
  box-sizing: border-box;
45
46
  color: var(--nutui-badge-color, #ffffff);
46
- font-size: var(--nutui-badge-font-size, var(--nutui-font-size-xxs, 10px));
47
+ font-size: var(--nutui-badge-font-size, var(--nutui-font-size-xxxs, 9px));
47
48
  line-height: 12px;
48
49
  white-space: nowrap;
49
50
  font-weight: normal;
@@ -51,14 +52,11 @@
51
52
  background: var(--nutui-badge-background-color, var(--nutui-color-primary, #ff0f23));
52
53
  z-index: 1;
53
54
  }
55
+ .nut-badge-disabled {
56
+ background: var(--nutui-badge-background-disabled-color, var(--nutui-color-text-disabled, #c2c4cc));
57
+ }
54
58
  .nut-badge-number {
55
59
  font-family: "JD";
56
- /* #ifdef harmony */
57
- line-height: 12px;
58
- /* #endif */
59
- /* #ifndef harmony */
60
- line-height: 13px;
61
- /* #endif */
62
60
  }
63
61
  .nut-badge-one {
64
62
  height: var(--nutui-badge-height, 14px);
@@ -82,14 +80,14 @@
82
80
  height: var(--nutui-badge-dot-width, 6px);
83
81
  }
84
82
  .nut-badge-dot-small {
85
- min-width: var(--nutui-badge-dot-width, 4px);
86
- width: var(--nutui-badge-dot-width, 4px);
87
- height: var(--nutui-badge-dot-width, 4px);
83
+ min-width: var(--nutui-badge-dot-small-width, 4px);
84
+ width: var(--nutui-badge-dot-small-width, 4px);
85
+ height: var(--nutui-badge-dot-small-width, 4px);
88
86
  }
89
87
  .nut-badge-dot-large {
90
- min-width: var(--nutui-badge-dot-width, 8px);
91
- width: var(--nutui-badge-dot-width, 8px);
92
- height: var(--nutui-badge-dot-width, 8px);
88
+ min-width: var(--nutui-badge-dot-large-width, 8px);
89
+ width: var(--nutui-badge-dot-large-width, 8px);
90
+ height: var(--nutui-badge-dot-large-width, 8px);
93
91
  }
94
92
  .nut-badge-outline {
95
93
  background: #ffffff;
@@ -5,6 +5,8 @@
5
5
  .nut-badge {
6
6
  position: relative;
7
7
  display: inline-flex;
8
+ vertical-align: middle;
9
+ box-sizing: content-box;
8
10
  width: auto;
9
11
  }
10
12
  .nut-badge-icon {
@@ -51,13 +53,12 @@
51
53
  }
52
54
  .nut-badge-sup {
53
55
  display: inline-flex;
54
- justify-content: center;
55
- height: 14px;
56
+ text-align: center;
56
57
  min-width: 6px;
57
58
  padding: 1px 4px;
58
59
  box-sizing: border-box;
59
60
  color: #ffffff;
60
- font-size: 10px;
61
+ font-size: 9px;
61
62
  line-height: 12px;
62
63
  white-space: nowrap;
63
64
  font-weight: normal;
@@ -65,14 +66,11 @@
65
66
  background: #ff0f23;
66
67
  z-index: 1;
67
68
  }
69
+ .nut-badge-disabled {
70
+ background: #c2c4cc;
71
+ }
68
72
  .nut-badge-number {
69
73
  font-family: "JD";
70
- /* #ifdef harmony */
71
- line-height: 12px;
72
- /* #endif */
73
- /* #ifndef harmony */
74
- line-height: 13px;
75
- /* #endif */
76
74
  }
77
75
  .nut-badge-one {
78
76
  height: 14px;