@nutui/nutui-react 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 (126) 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/configprovider/types.d.ts +1 -1
  6. package/dist/cjs/packages/datepicker/style/style.css +3 -1
  7. package/dist/cjs/packages/datepickerview/style/style.css +3 -1
  8. package/dist/cjs/packages/empty/style/index.js +1 -0
  9. package/dist/cjs/packages/empty/style/style.css +389 -0
  10. package/dist/cjs/packages/fixednav/fixednav.js +3 -2
  11. package/dist/cjs/packages/fixednav/style/fixednav.scss +43 -39
  12. package/dist/cjs/packages/fixednav/style/style.css +56 -51
  13. package/dist/cjs/packages/imagepreview/imagepreview.js +49 -84
  14. package/dist/cjs/packages/imagepreview/style/imagepreview.scss +2 -1
  15. package/dist/cjs/packages/imagepreview/style/style.css +2 -1
  16. package/dist/cjs/packages/indicator/indicator.js +1 -1
  17. package/dist/cjs/packages/inputnumber/inputnumber.js +2 -2
  18. package/dist/cjs/packages/lottie/index.d.ts +1 -1
  19. package/dist/cjs/packages/lottie/index.js +2 -2
  20. package/dist/cjs/packages/notify/Notification.d.ts +3 -9
  21. package/dist/cjs/packages/notify/Notification.js +28 -8
  22. package/dist/cjs/packages/notify/notify.d.ts +0 -4
  23. package/dist/cjs/packages/notify/notify.js +6 -34
  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/nutui.react.d.ts +1 -0
  27. package/dist/cjs/packages/nutui.react.js +1 -0
  28. package/dist/cjs/packages/picker/style/style.css +3 -1
  29. package/dist/cjs/packages/pickerview/pickerroller.js +11 -6
  30. package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -1
  31. package/dist/cjs/packages/pickerview/style/style.css +3 -1
  32. package/dist/cjs/packages/resultpage/style/index.js +1 -0
  33. package/dist/cjs/packages/resultpage/style/style.css +389 -0
  34. package/dist/cjs/packages/skeleton/skeleton.js +64 -49
  35. package/dist/cjs/packages/skeleton/style/index.js +0 -1
  36. package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
  37. package/dist/cjs/packages/skeleton/style/style.css +32 -175
  38. package/dist/cjs/packages/switch/style/style.css +5 -0
  39. package/dist/cjs/packages/switch/style/switch.scss +5 -0
  40. package/dist/cjs/packages/switch/switch.js +22 -11
  41. package/dist/cjs/packages/tabbar/style/style.css +58 -54
  42. package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
  43. package/dist/cjs/packages/tabbar/tabbar.js +28 -10
  44. package/dist/cjs/packages/tabbaritem/style/style.css +34 -36
  45. package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
  46. package/dist/cjs/packages/tabbaritem/tabbaritem.js +34 -13
  47. package/dist/cjs/packages/toast/Notification.js +1 -1
  48. package/dist/cjs/types/spec/badge/base.d.ts +1 -0
  49. package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
  50. package/dist/cjs/types/spec/notify/base.d.ts +7 -2
  51. package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
  52. package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
  53. package/dist/cjs/types/spec/switch/base.d.ts +3 -2
  54. package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
  55. package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
  56. package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
  57. package/dist/es/packages/badge/badge.js +4 -3
  58. package/dist/es/packages/badge/style/badge.scss +7 -8
  59. package/dist/es/packages/badge/style/style.css +13 -15
  60. package/dist/es/packages/configprovider/types.d.ts +1 -1
  61. package/dist/es/packages/datepicker/style/style.css +3 -1
  62. package/dist/es/packages/datepickerview/style/style.css +3 -1
  63. package/dist/es/packages/empty/style/index.js +1 -0
  64. package/dist/es/packages/empty/style/style.css +389 -0
  65. package/dist/es/packages/fixednav/fixednav.js +3 -2
  66. package/dist/es/packages/fixednav/style/fixednav.scss +43 -39
  67. package/dist/es/packages/fixednav/style/style.css +56 -51
  68. package/dist/es/packages/imagepreview/imagepreview.js +49 -84
  69. package/dist/es/packages/imagepreview/style/imagepreview.scss +2 -1
  70. package/dist/es/packages/imagepreview/style/style.css +2 -1
  71. package/dist/es/packages/indicator/indicator.js +1 -1
  72. package/dist/es/packages/inputnumber/inputnumber.js +2 -2
  73. package/dist/es/packages/lottie/index.d.ts +1 -1
  74. package/dist/es/packages/lottie/index.js +1 -1
  75. package/dist/es/packages/notify/Notification.d.ts +3 -9
  76. package/dist/es/packages/notify/Notification.js +28 -8
  77. package/dist/es/packages/notify/notify.d.ts +0 -4
  78. package/dist/es/packages/notify/notify.js +6 -34
  79. package/dist/es/packages/notify/style/notify.scss +39 -36
  80. package/dist/es/packages/notify/style/style.css +36 -31
  81. package/dist/es/packages/picker/style/style.css +3 -1
  82. package/dist/es/packages/pickerview/pickerroller.js +10 -6
  83. package/dist/es/packages/pickerview/style/pickerview.scss +3 -1
  84. package/dist/es/packages/pickerview/style/style.css +3 -1
  85. package/dist/es/packages/resultpage/style/index.js +1 -0
  86. package/dist/es/packages/resultpage/style/style.css +389 -0
  87. package/dist/es/packages/skeleton/skeleton.js +63 -49
  88. package/dist/es/packages/skeleton/style/index.js +0 -1
  89. package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
  90. package/dist/es/packages/skeleton/style/style.css +32 -175
  91. package/dist/es/packages/switch/style/style.css +5 -0
  92. package/dist/es/packages/switch/style/switch.scss +5 -0
  93. package/dist/es/packages/switch/switch.js +21 -11
  94. package/dist/es/packages/tabbar/style/style.css +58 -54
  95. package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
  96. package/dist/es/packages/tabbar/tabbar.js +27 -10
  97. package/dist/es/packages/tabbaritem/style/style.css +34 -36
  98. package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
  99. package/dist/es/packages/tabbaritem/tabbaritem.js +34 -13
  100. package/dist/es/packages/toast/Notification.js +1 -1
  101. package/dist/es/types/spec/badge/base.d.ts +4 -0
  102. package/dist/es/types/spec/indicator/base.d.ts +1 -1
  103. package/dist/es/types/spec/notify/base.d.ts +22 -5
  104. package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
  105. package/dist/es/types/spec/skeleton/base.d.ts +19 -14
  106. package/dist/es/types/spec/switch/base.d.ts +6 -2
  107. package/dist/es/types/spec/switch/h5.d.ts +1 -1
  108. package/dist/es/types/spec/switch/taro.d.ts +1 -4
  109. package/dist/es/types/spec/tabbar/base.d.ts +7 -4
  110. package/dist/nutui.react.umd.js +394 -373
  111. package/dist/style.css +1 -1
  112. package/dist/style.scss +49 -49
  113. package/dist/styles/theme-dark.scss +2 -0
  114. package/dist/styles/theme-default.scss +2 -0
  115. package/dist/styles/themes/dark.css +1 -1
  116. package/dist/styles/themes/default.css +1 -1
  117. package/dist/styles/themes/jmapp.css +1 -1
  118. package/dist/styles/themes/jrkf.css +1 -1
  119. package/dist/styles/variables-jmapp.scss +24 -1
  120. package/dist/styles/variables-jrkf.scss +24 -1
  121. package/dist/styles/variables.scss +37 -38
  122. package/package.json +1 -1
  123. /package/dist/cjs/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
  124. /package/dist/cjs/packages/lottie/{web.js → lottie.js} +0 -0
  125. /package/dist/es/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
  126. /package/dist/es/packages/lottie/{web.js → lottie.js} +0 -0
@@ -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;
@@ -102,25 +100,16 @@
102
100
  .nut-tabbar-item {
103
101
  display: flex;
104
102
  flex-direction: column;
105
- justify-content: center;
106
103
  align-items: center;
107
104
  flex: 1;
108
- text-align: center;
109
- text-decoration: none;
105
+ padding: 6px 0 2px;
110
106
  color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
111
107
  height: 100%;
112
108
  }
113
- .nut-tabbar-item-icon-box {
114
- padding: 0px;
115
- display: flex;
116
- flex-direction: column;
117
- align-items: center;
118
- position: relative;
119
- }
120
- .nut-tabbar-item-icon-box .nut-icon {
121
- width: 22px;
122
- height: 22px;
123
- font-size: 22px;
109
+ .nut-tabbar-item .nut-icon {
110
+ width: 24px;
111
+ height: 24px;
112
+ font-size: 24px;
124
113
  /* #ifdef harmony*/
125
114
  color: var(--nutui-tabbar-inactive-color, var(--nutui-color-title, #1a1a1a));
126
115
  /* #endif*/
@@ -128,23 +117,32 @@
128
117
  color: inherit;
129
118
  /* #endif*/
130
119
  }
131
- .nut-tabbar-item-icon-box-nav {
120
+ .nut-tabbar-item-text {
132
121
  display: block;
133
122
  color: var(--nutui-color-text, #505259);
134
- font-size: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-xs, 11px));
135
- line-height: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-xs, 11px));
136
- margin-top: var(--nutui-tabbar-text-margin-top, 3px);
123
+ font-size: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-xxs, 10px));
124
+ line-height: var(--nutui-tabbar-text-font-size, var(--nutui-font-size-xxs, 10px));
125
+ margin-top: var(--nutui-tabbar-text-margin-top, 4px);
126
+ }
127
+ .nut-tabbar-item .nut-image-default {
128
+ width: 38px;
129
+ height: 38px;
130
+ border-radius: 38px;
131
+ }
132
+ .nut-tabbar-item-large {
133
+ justify-content: center;
134
+ padding: 0;
137
135
  }
138
- .nut-tabbar-item-icon-box-large {
136
+ .nut-tabbar-item-large .nut-tabbar-item-text {
139
137
  font-size: var(--nutui-tabbar-text-large-font-size, var(--nutui-font-size-l, 16px));
140
138
  margin-top: 0;
141
- line-height: var(--nutui-tabbar-text-line-height, 20px);
139
+ line-height: var(--nutui-tabbar-text-large-font-size, var(--nutui-font-size-l, 16px));
142
140
  font-weight: var(--nutui-tabbar-text-large-font-weight, var(--nutui-font-weight, 400));
143
141
  }
144
142
  .nut-tabbar-item-active {
145
143
  color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
146
144
  }
147
- .nut-tabbar-item-active .nut-tabbar-item-icon-box,
145
+ .nut-tabbar-item-active .nut-tabbar-item-text,
148
146
  .nut-tabbar-item-active .nut-icon {
149
147
  /* #ifdef harmony*/
150
148
  color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
@@ -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;
@@ -14,12 +14,13 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
14
14
  dot: false,
15
15
  max: 99,
16
16
  top: '0',
17
- right: '0'
17
+ right: '0',
18
+ direction: 'vertical'
18
19
  });
19
20
  export var TabbarItem = function(props) {
20
21
  var ctx = useContext(TabbarContext);
21
22
  var _ref = _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, // @ts-ignore
22
- index = _ref.index, rest = _object_without_properties(_ref, [
23
+ index = _ref.index, direction = _ref.direction, onActiveClick = _ref.onActiveClick, rest = _object_without_properties(_ref, [
23
24
  "className",
24
25
  "style",
25
26
  "title",
@@ -29,15 +30,19 @@ export var TabbarItem = function(props) {
29
30
  "max",
30
31
  "top",
31
32
  "right",
32
- "index"
33
+ "index",
34
+ "direction",
35
+ "onActiveClick"
33
36
  ]);
34
37
  var active = index === (ctx === null || ctx === void 0 ? void 0 : ctx.selectIndex);
35
38
  var classPrefix = 'nut-tabbar-item';
36
- var tabbarItemClass = classNames(classPrefix, _define_property({}, "".concat(classPrefix, "-active"), active), className);
37
- var boxPrefix = "".concat(classPrefix, "-icon-box");
38
- var titleClass = classNames(boxPrefix, "".concat(boxPrefix, "-nav"), _define_property({}, "".concat(boxPrefix, "-large"), !icon));
39
+ var _obj;
40
+ var tabbarItemClass = classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-active"), active), _define_property(_obj, "".concat(classPrefix, "-large"), !icon || !title), _obj), className);
41
+ var renderNodeWithActive = function(node) {
42
+ return node && typeof node === 'function' ? node(active) : node;
43
+ };
39
44
  var badgeProps = {
40
- value: value,
45
+ value: renderNodeWithActive(value),
41
46
  dot: dot,
42
47
  max: max,
43
48
  top: top,
@@ -46,8 +51,26 @@ export var TabbarItem = function(props) {
46
51
  };
47
52
  var renderTitleText = function() {
48
53
  return title && /*#__PURE__*/ React.createElement("div", {
49
- className: titleClass
50
- }, title);
54
+ className: "".concat(classPrefix, "-text")
55
+ }, renderNodeWithActive(title));
56
+ };
57
+ var renderTitle = function() {
58
+ return /*#__PURE__*/ React.createElement(Badge, _object_spread({
59
+ size: "normal"
60
+ }, badgeProps), renderTitleText());
61
+ };
62
+ var renderIcon = function() {
63
+ return renderNodeWithActive(icon);
64
+ };
65
+ var renderIconAndTitle = function() {
66
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Badge, _object_spread_props(_object_spread({
67
+ size: "normal"
68
+ }, badgeProps), {
69
+ top: 3
70
+ }), renderIcon()), renderTitleText());
71
+ };
72
+ var renderDualItem = function() {
73
+ return dot ? null : /*#__PURE__*/ React.createElement(React.Fragment, null, renderIcon(), renderTitleText(), /*#__PURE__*/ React.createElement(Badge, badgeProps));
51
74
  };
52
75
  return /*#__PURE__*/ React.createElement("div", _object_spread({
53
76
  className: tabbarItemClass,
@@ -55,9 +78,7 @@ export var TabbarItem = function(props) {
55
78
  color: active ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
56
79
  }, style),
57
80
  onClick: function() {
58
- return ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
81
+ return active ? onActiveClick === null || onActiveClick === void 0 ? void 0 : onActiveClick() : ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index);
59
82
  }
60
- }, rest), icon ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Badge, badgeProps, /*#__PURE__*/ React.createElement("div", {
61
- className: boxPrefix
62
- }, icon)), renderTitleText()) : /*#__PURE__*/ React.createElement(Badge, badgeProps, renderTitleText()));
83
+ }, rest), direction === 'horizontal' && !dot ? renderDualItem() : /*#__PURE__*/ React.createElement(React.Fragment, null, icon && renderIconAndTitle(), !icon && renderTitle()));
63
84
  };
@@ -159,7 +159,7 @@ Notification.newInstance = function(properties, callback) {
159
159
  });
160
160
  };
161
161
  var element = document.createElement('div');
162
- var id = properties.id ? properties.id : "".concat(new Date().getTime());
162
+ var id = properties.id ? properties.id : "".concat(Date.now());
163
163
  element.id = id;
164
164
  properties.id = id;
165
165
  document.body.appendChild(element);
@@ -32,4 +32,8 @@ export interface BaseBadge extends BaseProps {
32
32
  * dot 尺寸,当 dot 等于 true 时生效
33
33
  */
34
34
  size: BadgeDotSize
35
+ /**
36
+ * 是否禁用
37
+ */
38
+ disabled: boolean
35
39
  }
@@ -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
  /**
@@ -1,18 +1,35 @@
1
+ import { PositionY } from "../../base/atoms";
1
2
  import { BaseProps } from '../../base/props';
2
3
  export interface BaseNotify extends BaseProps {
3
4
  id: string;
4
5
  /**
5
- * 展示时长(ms),值为 0 时,notify 不会消失
6
+ * 距离顶部/底部距离
6
7
  */
7
- duration: number
8
+ distance: number
9
+ /**
10
+ * 顶部导航高度
11
+ */
12
+ navHeight: number
13
+ /**
14
+ * 是否启用关闭模式
15
+ */
16
+ closeable: boolean
8
17
  /**
9
- * 提示的信息类型(primary,success ,danger,warning)
18
+ * 左边的 icon
10
19
  */
11
- type: string
20
+ leftIcon: React.ReactNode
21
+ /**
22
+ * 右边的 icon,在 closeable 模式下默认为 <Close />
23
+ */
24
+ rightIcon: React.ReactNode
12
25
  /**
13
26
  * 自定义位置 (top, bottom)
14
27
  */
15
- position: string
28
+ position: PositionY
29
+ /**
30
+ * 展示时长(ms),值为 0 时,notify 不会消失
31
+ */
32
+ duration: number
16
33
  /**
17
34
  * 点击事件回调
18
35
  */
@@ -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,32 +1,37 @@
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
5
  /**
5
- * 是否开启骨架屏动画
6
+ * 设置行数
6
7
  */
7
- animated: boolean
8
+ rows: number
8
9
  /**
9
- * 设置段落行数
10
+ * 指定使用的内置高度
10
11
  */
11
- rows: number
12
+ size: Extract<UISize, 'small' | 'normal' | 'large'>
12
13
  /**
13
- * 是否显示段落标题
14
+ * 设置宽度,优先级高于 size 属性
14
15
  */
15
- title: boolean
16
+ width?: SimpleValue
16
17
  /**
17
- * 是否显示头像
18
+ * 设置高度,优先级高于 size 属性
18
19
  */
19
- avatar: boolean
20
+ height?: SimpleValue
20
21
  /**
21
- * 头像大小
22
+ * 设置形状
22
23
  */
23
- avatarSize: string
24
+ shape: UIRound | 'circle'
24
25
  /**
25
- * 是否显示骨架屏(true不显示骨架屏,false显示骨架屏)
26
+ * 是否开启骨架屏动画
26
27
  */
27
- visible: boolean
28
+ animated: boolean
29
+ /**
30
+ * 动画时长
31
+ */
32
+ duration: number
28
33
  /**
29
- * 头像形状:正方形/圆形
34
+ * 是否显示骨架屏(true不显示骨架屏,false显示骨架屏)
30
35
  */
31
- avatarShape: avatarShape
36
+ visible: boolean
32
37
  }
@@ -1,6 +1,6 @@
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
  /**
5
5
  * 开关状态,受控
6
6
  */
@@ -22,7 +22,11 @@ export interface BaseSwitch<EVENT = any> extends BaseProps {
22
22
  */
23
23
  inactiveText: ReactNode
24
24
  /**
25
+ * 受控 loading 态图标
26
+ */
27
+ loadingIcon: ReactNode
28
+ /**
25
29
  * 切换开关时触发
26
30
  */
27
- onChange: (val: boolean, event: EVENT) => void
31
+ onChange: (val: boolean) => void
28
32
  }
@@ -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,5 +1,5 @@
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
  /**
5
5
  * 默认选中的标签的索引值
@@ -21,6 +21,7 @@ export interface BaseTabbar extends BaseProps {
21
21
  * icon激活的颜色
22
22
  */
23
23
  activeColor: string
24
+ direction: Direction;
24
25
  /**
25
26
  * 是否开启iphone系列全面屏底部安全区适配
26
27
  */
@@ -31,11 +32,13 @@ export interface BaseTabbar extends BaseProps {
31
32
  onSwitch: (value: number) => void
32
33
  }
33
34
  export interface BaseTabbarItem extends BaseProps {
34
- title: ReactNode;
35
- icon: ReactNode;
36
- value: ReactNode;
35
+ title: ReactNode | ((active: boolean) => ReactNode);
36
+ icon: ReactNode | ((active: boolean) => ReactNode);
37
+ value: ReactNode | ((active: boolean) => ReactNode);
37
38
  dot: boolean;
38
39
  max: number;
39
40
  top: string;
40
41
  right: string;
42
+ direction: Direction;
43
+ onActiveClick: () => void;
41
44
  }