@nutui/nutui-react 3.0.18 → 3.0.19-beta.2

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 (189) hide show
  1. package/CHANGELOG.md +9 -10
  2. package/dist/cjs/hooks/taro/use-custom-event.js +5 -5
  3. package/dist/cjs/hooks/use-ref-state.js +3 -3
  4. package/dist/cjs/hooks/use-touch.js +1 -2
  5. package/dist/cjs/locales/ja-JP.d.ts +3 -0
  6. package/dist/cjs/locales/ja-JP.js +168 -0
  7. package/dist/cjs/packages/address/address.js +3 -3
  8. package/dist/cjs/packages/address/utils.js +3 -3
  9. package/dist/cjs/packages/avatarcropper/avatarcropper.js +4 -7
  10. package/dist/cjs/packages/badge/style/badge.scss +1 -1
  11. package/dist/cjs/packages/badge/style/style.css +1 -1
  12. package/dist/cjs/packages/badge/style-jmapp/badge.scss +1 -1
  13. package/dist/cjs/packages/badge/style-jmapp/style.css +1 -1
  14. package/dist/cjs/packages/badge/style-jrkf/badge.scss +1 -1
  15. package/dist/cjs/packages/badge/style-jrkf/style.css +1 -1
  16. package/dist/cjs/packages/calendar/utils.js +8 -8
  17. package/dist/cjs/packages/calendarcard/icon.js +5 -5
  18. package/dist/cjs/packages/calendarcard/utils.js +6 -6
  19. package/dist/cjs/packages/cascader/cascader.js +12 -21
  20. package/dist/cjs/packages/cascader/utils.js +3 -3
  21. package/dist/cjs/packages/col/col.js +16 -11
  22. package/dist/cjs/packages/collapseitem/collapseitem.js +4 -7
  23. package/dist/cjs/packages/configprovider/configprovider.js +7 -7
  24. package/dist/cjs/packages/configprovider/index.js +6 -6
  25. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  26. package/dist/cjs/packages/countdown/countdown.js +1 -2
  27. package/dist/cjs/packages/countdown/style/countdown.scss +1 -1
  28. package/dist/cjs/packages/countdown/style/style.css +1 -1
  29. package/dist/cjs/packages/countdown/style-jmapp/countdown.scss +1 -1
  30. package/dist/cjs/packages/countdown/style-jmapp/style.css +1 -1
  31. package/dist/cjs/packages/countdown/style-jrkf/countdown.scss +1 -1
  32. package/dist/cjs/packages/countdown/style-jrkf/style.css +1 -1
  33. package/dist/cjs/packages/datepicker/datepicker.js +1 -1
  34. package/dist/cjs/packages/datepicker/utils.js +9 -9
  35. package/dist/cjs/packages/dialog/content.js +3 -3
  36. package/dist/cjs/packages/dialog/dialog.js +4 -7
  37. package/dist/cjs/packages/dialog/style/dialog.scss +9 -1
  38. package/dist/cjs/packages/dialog/style/style.css +8 -1
  39. package/dist/cjs/packages/dialog/style-jmapp/dialog.scss +9 -1
  40. package/dist/cjs/packages/dialog/style-jmapp/style.css +8 -1
  41. package/dist/cjs/packages/dialog/style-jrkf/dialog.scss +9 -1
  42. package/dist/cjs/packages/dialog/style-jrkf/style.css +8 -1
  43. package/dist/cjs/packages/elevator/elevator.js +3 -3
  44. package/dist/cjs/packages/form/index.js +0 -2
  45. package/dist/cjs/packages/form/useform.js +50 -57
  46. package/dist/cjs/packages/infiniteloading/infiniteloading.js +8 -14
  47. package/dist/cjs/packages/inputnumber/inputnumber.js +16 -28
  48. package/dist/cjs/packages/lottie/types.js +0 -2
  49. package/dist/cjs/packages/nutui.react.build.js +105 -105
  50. package/dist/cjs/packages/nutui.react.js +105 -105
  51. package/dist/cjs/packages/overlay/overlay.js +3 -3
  52. package/dist/cjs/packages/pickerview/pickerview.js +1 -2
  53. package/dist/cjs/packages/pickerview/utils.js +3 -3
  54. package/dist/cjs/packages/popup/popup.d.ts +1 -1
  55. package/dist/cjs/packages/popup/popup.js +59 -4
  56. package/dist/cjs/packages/popup/style/popup.scss +0 -5
  57. package/dist/cjs/packages/popup/style/style.css +0 -3
  58. package/dist/cjs/packages/popup/style-jmapp/popup.scss +0 -5
  59. package/dist/cjs/packages/popup/style-jmapp/style.css +0 -3
  60. package/dist/cjs/packages/popup/style-jrkf/popup.scss +0 -5
  61. package/dist/cjs/packages/popup/style-jrkf/style.css +0 -3
  62. package/dist/cjs/packages/price/style/price.scss +3 -3
  63. package/dist/cjs/packages/price/style/style.css +3 -3
  64. package/dist/cjs/packages/price/style-jmapp/price.scss +3 -3
  65. package/dist/cjs/packages/price/style-jmapp/style.css +3 -3
  66. package/dist/cjs/packages/price/style-jrkf/price.scss +3 -3
  67. package/dist/cjs/packages/price/style-jrkf/style.css +3 -3
  68. package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +41 -51
  69. package/dist/cjs/packages/radio/index.js +0 -2
  70. package/dist/cjs/packages/range/utils.js +3 -3
  71. package/dist/cjs/packages/rate/style/rate.scss +1 -1
  72. package/dist/cjs/packages/rate/style/style.css +1 -1
  73. package/dist/cjs/packages/rate/style-jmapp/rate.scss +1 -1
  74. package/dist/cjs/packages/rate/style-jmapp/style.css +1 -1
  75. package/dist/cjs/packages/rate/style-jrkf/rate.scss +1 -1
  76. package/dist/cjs/packages/rate/style-jrkf/style.css +1 -1
  77. package/dist/cjs/packages/searchbar/searchbar.js +3 -3
  78. package/dist/cjs/packages/shortpassword/shortpassword.js +3 -3
  79. package/dist/cjs/packages/skeleton/skeleton.js +2 -4
  80. package/dist/cjs/packages/swiper/effects/focus.js +4 -4
  81. package/dist/cjs/packages/swiper/index.js +0 -1
  82. package/dist/cjs/packages/switch/switch.js +4 -7
  83. package/dist/cjs/packages/uploader/uploader.js +31 -39
  84. package/dist/cjs/packages/virtuallist/utils.js +6 -6
  85. package/dist/cjs/packages/watermark/watermark.js +4 -8
  86. package/dist/cjs/types/spec/address/base.js +0 -2
  87. package/dist/cjs/types/spec/avatar/taro.d.ts +7 -1
  88. package/dist/cjs/types/spec/popup/base.d.ts +5 -0
  89. package/dist/cjs/types/spec/searchbar/h5.d.ts +2 -1
  90. package/dist/cjs/types/spec/searchbar/taro.d.ts +1 -0
  91. package/dist/cjs/utils/date.js +5 -5
  92. package/dist/cjs/utils/event-mocker.js +10 -18
  93. package/dist/cjs/utils/get-rect.js +4 -4
  94. package/dist/cjs/utils/get-scroll-parent.js +3 -3
  95. package/dist/cjs/utils/merge-props.js +3 -3
  96. package/dist/cjs/utils/merge.js +6 -6
  97. package/dist/cjs/utils/raf.js +3 -3
  98. package/dist/cjs/utils/render.js +5 -9
  99. package/dist/cjs/utils/rubberband.js +3 -3
  100. package/dist/cjs/utils/taro/get-rect.js +14 -24
  101. package/dist/cjs/utils/taro/get-system-info.js +4 -4
  102. package/dist/cjs/utils/taro/platform.js +5 -5
  103. package/dist/es/hooks/use-touch.js +1 -1
  104. package/dist/es/locales/ja-JP.d.ts +3 -0
  105. package/dist/es/locales/ja-JP.js +158 -0
  106. package/dist/es/packages/avatarcropper/avatarcropper.js +4 -7
  107. package/dist/es/packages/badge/style/badge.scss +1 -1
  108. package/dist/es/packages/badge/style/style.css +1 -1
  109. package/dist/es/packages/badge/style-jmapp/badge.scss +1 -1
  110. package/dist/es/packages/badge/style-jmapp/style.css +1 -1
  111. package/dist/es/packages/badge/style-jrkf/badge.scss +1 -1
  112. package/dist/es/packages/badge/style-jrkf/style.css +1 -1
  113. package/dist/es/packages/cascader/cascader.js +12 -21
  114. package/dist/es/packages/col/col.js +17 -12
  115. package/dist/es/packages/collapseitem/collapseitem.js +4 -7
  116. package/dist/es/packages/configprovider/types.d.ts +1 -1
  117. package/dist/es/packages/countdown/countdown.js +1 -2
  118. package/dist/es/packages/countdown/style/countdown.scss +1 -1
  119. package/dist/es/packages/countdown/style/style.css +1 -1
  120. package/dist/es/packages/countdown/style-jmapp/countdown.scss +1 -1
  121. package/dist/es/packages/countdown/style-jmapp/style.css +1 -1
  122. package/dist/es/packages/countdown/style-jrkf/countdown.scss +1 -1
  123. package/dist/es/packages/countdown/style-jrkf/style.css +1 -1
  124. package/dist/es/packages/datepicker/datepicker.js +1 -1
  125. package/dist/es/packages/dialog/dialog.js +4 -7
  126. package/dist/es/packages/dialog/style/dialog.scss +9 -1
  127. package/dist/es/packages/dialog/style/style.css +8 -1
  128. package/dist/es/packages/dialog/style-jmapp/dialog.scss +9 -1
  129. package/dist/es/packages/dialog/style-jmapp/style.css +8 -1
  130. package/dist/es/packages/dialog/style-jrkf/dialog.scss +9 -1
  131. package/dist/es/packages/dialog/style-jrkf/style.css +8 -1
  132. package/dist/es/packages/form/index.js +0 -1
  133. package/dist/es/packages/form/useform.js +46 -53
  134. package/dist/es/packages/infiniteloading/infiniteloading.js +8 -14
  135. package/dist/es/packages/inputnumber/inputnumber.js +16 -28
  136. package/dist/es/packages/lottie/types.js +1 -1
  137. package/dist/es/packages/pickerview/pickerview.js +1 -2
  138. package/dist/es/packages/popup/popup.d.ts +1 -1
  139. package/dist/es/packages/popup/popup.js +60 -5
  140. package/dist/es/packages/popup/style/popup.scss +0 -5
  141. package/dist/es/packages/popup/style/style.css +0 -3
  142. package/dist/es/packages/popup/style-jmapp/popup.scss +0 -5
  143. package/dist/es/packages/popup/style-jmapp/style.css +0 -3
  144. package/dist/es/packages/popup/style-jrkf/popup.scss +0 -5
  145. package/dist/es/packages/popup/style-jrkf/style.css +0 -3
  146. package/dist/es/packages/price/style/price.scss +3 -3
  147. package/dist/es/packages/price/style/style.css +3 -3
  148. package/dist/es/packages/price/style-jmapp/price.scss +3 -3
  149. package/dist/es/packages/price/style-jmapp/style.css +3 -3
  150. package/dist/es/packages/price/style-jrkf/price.scss +3 -3
  151. package/dist/es/packages/price/style-jrkf/style.css +3 -3
  152. package/dist/es/packages/pulltorefresh/pulltorefresh.js +41 -51
  153. package/dist/es/packages/radio/index.js +0 -1
  154. package/dist/es/packages/rate/style/rate.scss +1 -1
  155. package/dist/es/packages/rate/style/style.css +1 -1
  156. package/dist/es/packages/rate/style-jmapp/rate.scss +1 -1
  157. package/dist/es/packages/rate/style-jmapp/style.css +1 -1
  158. package/dist/es/packages/rate/style-jrkf/rate.scss +1 -1
  159. package/dist/es/packages/rate/style-jrkf/style.css +1 -1
  160. package/dist/es/packages/searchbar/searchbar.js +3 -3
  161. package/dist/es/packages/skeleton/skeleton.js +2 -4
  162. package/dist/es/packages/swiper/index.js +0 -1
  163. package/dist/es/packages/switch/switch.js +4 -7
  164. package/dist/es/packages/uploader/uploader.js +31 -39
  165. package/dist/es/packages/watermark/watermark.js +4 -8
  166. package/dist/es/types/spec/address/base.js +1 -1
  167. package/dist/es/types/spec/avatar/taro.d.ts +7 -1
  168. package/dist/es/types/spec/popup/base.d.ts +20 -0
  169. package/dist/es/types/spec/searchbar/h5.d.ts +2 -1
  170. package/dist/es/types/spec/searchbar/taro.d.ts +1 -0
  171. package/dist/es/utils/event-mocker.js +4 -12
  172. package/dist/es/utils/render.js +2 -6
  173. package/dist/es/utils/taro/get-rect.js +10 -20
  174. package/dist/nutui.react.umd.js +470 -610
  175. package/dist/style-jmapp.css +1 -1
  176. package/dist/style-jmapp.scss +39 -39
  177. package/dist/style-jrkf.css +1 -1
  178. package/dist/style-jrkf.scss +38 -38
  179. package/dist/style.css +1 -1
  180. package/dist/style.scss +43 -43
  181. package/dist/styles/jd-font.scss +4 -4
  182. package/dist/styles/theme-dark.scss +90 -56
  183. package/dist/styles/theme-default.scss +94 -60
  184. package/dist/styles/themes/dark.css +1 -1
  185. package/dist/styles/themes/default.css +1 -1
  186. package/dist/styles/variables-jmapp.scss +4 -0
  187. package/dist/styles/variables-jrkf.scss +4 -0
  188. package/dist/styles/variables.scss +4 -0
  189. package/package.json +1 -1
@@ -18,7 +18,7 @@
18
18
  .nut-dialog-outer {
19
19
  position: fixed;
20
20
  max-height: 100%;
21
- background-color: #ffffff;
21
+ background-color: var(--nutui-dialog-background, var(--nutui-color-surface-2));
22
22
  transition: transform 0.2s, -webkit-transform 0.2s;
23
23
  -webkit-overflow-scrolling: touch;
24
24
  top: 50%;
@@ -119,11 +119,18 @@
119
119
  .nut-dialog-footer-cancel.nut-dialog-footer-cancel {
120
120
  margin-right: var(--nutui-dialog-footer-cancel-margin-right, 12px);
121
121
  background: var(--nutui-dialog-footer-cancel-bg, var(--nutui-button-default-background-color, var(--nutui-color-default)));
122
+ color: var(--nutui-button-default-color, var(--nutui-color-text));
123
+ }
124
+ .nut-dialog-footer-cancel.nut-dialog-footer-cancel .nut-button-children {
125
+ color: var(--nutui-button-default-color, var(--nutui-color-text));
122
126
  }
123
127
  .nut-dialog-footer-ok {
124
128
  max-width: var(--nutui-dialog-footer-ok-max-width, 128px);
125
129
  font-weight: var(--nutui-font-weight-bold);
126
130
  }
131
+ .nut-dialog-footer-ok .nut-button-children {
132
+ font-weight: var(--nutui-font-weight-bold);
133
+ }
127
134
  .nut-dialog-footer-block.nut-button {
128
135
  min-width: 100%;
129
136
  }
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Form } from "./form";
3
2
  import { FormItem } from "../formitem/formitem";
4
3
  import { useForm, useWatch } from "./useform";
@@ -18,7 +18,6 @@ export var SECRET = 'NUT_FORM_INTERNAL';
18
18
  var _this = this;
19
19
  var _this1 = this;
20
20
  _class_call_check(this, FormStore);
21
- var _this2 = this;
22
21
  // 初始化数据
23
22
  _define_property(this, "initialValues", {});
24
23
  _define_property(this, "updateList", []);
@@ -106,8 +105,8 @@ export var SECRET = 'NUT_FORM_INTERNAL';
106
105
  _define_property(this, "setCallback", function(callback) {
107
106
  _this.callbacks = _object_spread({}, _this.callbacks, callback);
108
107
  });
109
- _define_property(this, "validateEntities", /*#__PURE__*/ function() {
110
- var _ref = _async_to_generator(function(entity, errs) {
108
+ _define_property(this, "validateEntities", function(entity, errs) {
109
+ return _async_to_generator(function() {
111
110
  var _entity_props, name, _entity_props_rules, rules, descriptor, validator, _this_store, param, errors, _errs;
112
111
  return _ts_generator(this, function(_state) {
113
112
  switch(_state.label){
@@ -142,7 +141,7 @@ export var SECRET = 'NUT_FORM_INTERNAL';
142
141
  ]);
143
142
  return [
144
143
  4,
145
- validator.validate(_define_property({}, name, (_this_store = _this2.store) === null || _this_store === void 0 ? void 0 : _this_store[name]))
144
+ validator.validate(_define_property({}, name, (_this_store = this.store) === null || _this_store === void 0 ? void 0 : _this_store[name]))
146
145
  ];
147
146
  case 2:
148
147
  _state.sent();
@@ -156,7 +155,7 @@ export var SECRET = 'NUT_FORM_INTERNAL';
156
155
  if (errors) {
157
156
  ;
158
157
  (_errs = errs).push.apply(_errs, _to_consumable_array(errors));
159
- _this2.errors[name] = errors;
158
+ this.errors[name] = errors;
160
159
  }
161
160
  return [
162
161
  3,
@@ -164,7 +163,7 @@ export var SECRET = 'NUT_FORM_INTERNAL';
164
163
  ];
165
164
  case 4:
166
165
  if (!errs || errs.length === 0) {
167
- _this2.errors[name] = [];
166
+ this.errors[name] = [];
168
167
  }
169
168
  return [
170
169
  7
@@ -176,23 +175,21 @@ export var SECRET = 'NUT_FORM_INTERNAL';
176
175
  ];
177
176
  }
178
177
  });
179
- });
180
- return function(entity, errs) {
181
- return _ref.apply(this, arguments);
182
- };
183
- }());
184
- _define_property(this, "validateFields", /*#__PURE__*/ function() {
185
- var _ref = _async_to_generator(function(nameList) {
186
- var filterEntities, errs;
178
+ }).call(_this);
179
+ });
180
+ _define_property(this, "validateFields", function(nameList) {
181
+ return _async_to_generator(function() {
182
+ var _this, filterEntities, errs;
187
183
  return _ts_generator(this, function(_state) {
188
184
  switch(_state.label){
189
185
  case 0:
186
+ _this = this;
190
187
  filterEntities = [];
191
188
  // this.errors.length = 0
192
189
  if (!nameList || nameList.length === 0) {
193
- filterEntities = _this2.fieldEntities;
190
+ filterEntities = this.fieldEntities;
194
191
  } else {
195
- filterEntities = _this2.fieldEntities.filter(function(param) {
192
+ filterEntities = this.fieldEntities.filter(function(param) {
196
193
  var name = param.props.name;
197
194
  return nameList.includes(name);
198
195
  });
@@ -200,14 +197,14 @@ export var SECRET = 'NUT_FORM_INTERNAL';
200
197
  errs = [];
201
198
  return [
202
199
  4,
203
- Promise.all(filterEntities.map(/*#__PURE__*/ function() {
204
- var _ref = _async_to_generator(function(entity) {
200
+ Promise.all(filterEntities.map(function(entity) {
201
+ return _async_to_generator(function() {
205
202
  return _ts_generator(this, function(_state) {
206
203
  switch(_state.label){
207
204
  case 0:
208
205
  return [
209
206
  4,
210
- _this2.validateEntities(entity, errs)
207
+ this.validateEntities(entity, errs)
211
208
  ];
212
209
  case 1:
213
210
  _state.sent();
@@ -216,11 +213,8 @@ export var SECRET = 'NUT_FORM_INTERNAL';
216
213
  ];
217
214
  }
218
215
  });
219
- });
220
- return function(entity) {
221
- return _ref.apply(this, arguments);
222
- };
223
- }()))
216
+ }).call(_this);
217
+ }))
224
218
  ];
225
219
  case 1:
226
220
  _state.sent();
@@ -230,35 +224,34 @@ export var SECRET = 'NUT_FORM_INTERNAL';
230
224
  ];
231
225
  }
232
226
  });
233
- });
234
- return function(nameList) {
235
- return _ref.apply(this, arguments);
236
- };
237
- }());
238
- _define_property(this, "submit", /*#__PURE__*/ _async_to_generator(function() {
239
- var errors, _this_callbacks_onFinish, _this_callbacks, _this_callbacks_onFinishFailed, _this_callbacks1;
240
- return _ts_generator(this, function(_state) {
241
- switch(_state.label){
242
- case 0:
243
- return [
244
- 4,
245
- _this2.validateFields()
246
- ];
247
- case 1:
248
- errors = _state.sent();
249
- if (errors.length === 0) {
250
- ;
251
- (_this_callbacks_onFinish = (_this_callbacks = _this2.callbacks).onFinish) === null || _this_callbacks_onFinish === void 0 ? void 0 : _this_callbacks_onFinish.call(_this_callbacks, _this2.store);
252
- } else if (errors.length > 0) {
253
- ;
254
- (_this_callbacks_onFinishFailed = (_this_callbacks1 = _this2.callbacks).onFinishFailed) === null || _this_callbacks_onFinishFailed === void 0 ? void 0 : _this_callbacks_onFinishFailed.call(_this_callbacks1, _this2.store, errors);
255
- }
256
- return [
257
- 2
258
- ];
259
- }
260
- });
261
- }));
227
+ }).call(_this);
228
+ });
229
+ _define_property(this, "submit", function() {
230
+ return _async_to_generator(function() {
231
+ var errors, _this_callbacks_onFinish, _this_callbacks, _this_callbacks_onFinishFailed, _this_callbacks1;
232
+ return _ts_generator(this, function(_state) {
233
+ switch(_state.label){
234
+ case 0:
235
+ return [
236
+ 4,
237
+ this.validateFields()
238
+ ];
239
+ case 1:
240
+ errors = _state.sent();
241
+ if (errors.length === 0) {
242
+ ;
243
+ (_this_callbacks_onFinish = (_this_callbacks = this.callbacks).onFinish) === null || _this_callbacks_onFinish === void 0 ? void 0 : _this_callbacks_onFinish.call(_this_callbacks, this.store);
244
+ } else if (errors.length > 0) {
245
+ ;
246
+ (_this_callbacks_onFinishFailed = (_this_callbacks1 = this.callbacks).onFinishFailed) === null || _this_callbacks_onFinishFailed === void 0 ? void 0 : _this_callbacks_onFinishFailed.call(_this_callbacks1, this.store, errors);
247
+ }
248
+ return [
249
+ 2
250
+ ];
251
+ }
252
+ });
253
+ }).call(_this);
254
+ });
262
255
  _define_property(this, "resetFields", function(namePaths) {
263
256
  if (namePaths && namePaths.length) {
264
257
  namePaths.forEach(function(path) {
@@ -88,8 +88,8 @@ export var InfiniteLoading = function(props) {
88
88
  transition: isTouching.current ? "height 0s cubic-bezier(0.25,0.1,0.25,1)" : "height 0.2s cubic-bezier(0.25,0.1,0.25,1)"
89
89
  };
90
90
  };
91
- var handleScroll = /*#__PURE__*/ function() {
92
- var _ref = _async_to_generator(function() {
91
+ var handleScroll = function() {
92
+ return _async_to_generator(function() {
93
93
  return _ts_generator(this, function(_state) {
94
94
  switch(_state.label){
95
95
  case 0:
@@ -111,11 +111,8 @@ export var InfiniteLoading = function(props) {
111
111
  ];
112
112
  }
113
113
  });
114
- });
115
- return function handleScroll() {
116
- return _ref.apply(this, arguments);
117
- };
118
- }();
114
+ })();
115
+ };
119
116
  var infiniteDone = function() {
120
117
  setIsInfiniting(false);
121
118
  };
@@ -151,8 +148,8 @@ export var InfiniteLoading = function(props) {
151
148
  isTouching.current = false;
152
149
  }
153
150
  };
154
- var touchEnd = /*#__PURE__*/ function() {
155
- var _ref = _async_to_generator(function() {
151
+ var touchEnd = function() {
152
+ return _async_to_generator(function() {
156
153
  return _ts_generator(this, function(_state) {
157
154
  switch(_state.label){
158
155
  case 0:
@@ -182,11 +179,8 @@ export var InfiniteLoading = function(props) {
182
179
  ];
183
180
  }
184
181
  });
185
- });
186
- return function touchEnd() {
187
- return _ref.apply(this, arguments);
188
- };
189
- }();
182
+ })();
183
+ };
190
184
  var getWindowScrollTop = function() {
191
185
  return window.scrollY !== undefined ? window.scrollY : (document.documentElement || document.body.parentNode || document.body).scrollTop;
192
186
  };
@@ -93,8 +93,8 @@ export var InputNumber = function(props) {
93
93
  var stepAmount = parseFloat(stepValue) * symbol;
94
94
  return (currentValue * dig + stepAmount * dig) / dig;
95
95
  };
96
- var update = /*#__PURE__*/ function() {
97
- var _ref = _async_to_generator(function(negative, e) {
96
+ var update = function(negative, e) {
97
+ return _async_to_generator(function() {
98
98
  var shouldOverBoundary, maybeResume, nextValue;
99
99
  return _ts_generator(this, function(_state) {
100
100
  switch(_state.label){
@@ -125,13 +125,10 @@ export var InputNumber = function(props) {
125
125
  ];
126
126
  }
127
127
  });
128
- });
129
- return function update(negative, e) {
130
- return _ref.apply(this, arguments);
131
- };
132
- }();
133
- var handleReduce = /*#__PURE__*/ function() {
134
- var _ref = _async_to_generator(function(e) {
128
+ })();
129
+ };
130
+ var handleReduce = function(e) {
131
+ return _async_to_generator(function() {
135
132
  return _ts_generator(this, function(_state) {
136
133
  switch(_state.label){
137
134
  case 0:
@@ -149,13 +146,10 @@ export var InputNumber = function(props) {
149
146
  ];
150
147
  }
151
148
  });
152
- });
153
- return function handleReduce(e) {
154
- return _ref.apply(this, arguments);
155
- };
156
- }();
157
- var handlePlus = /*#__PURE__*/ function() {
158
- var _ref = _async_to_generator(function(e) {
149
+ })();
150
+ };
151
+ var handlePlus = function(e) {
152
+ return _async_to_generator(function() {
159
153
  return _ts_generator(this, function(_state) {
160
154
  switch(_state.label){
161
155
  case 0:
@@ -173,18 +167,15 @@ export var InputNumber = function(props) {
173
167
  ];
174
168
  }
175
169
  });
176
- });
177
- return function handlePlus(e) {
178
- return _ref.apply(this, arguments);
179
- };
180
- }();
170
+ })();
171
+ };
181
172
  var parseValue = function(text) {
182
173
  if (text === '') return null;
183
174
  if (text === '-') return null;
184
175
  return text;
185
176
  };
186
- var handleInputChange = /*#__PURE__*/ function() {
187
- var _ref = _async_to_generator(function(e) {
177
+ var handleInputChange = function(e) {
178
+ return _async_to_generator(function() {
188
179
  var valueStr, maybeResume;
189
180
  return _ts_generator(this, function(_state) {
190
181
  switch(_state.label){
@@ -213,11 +204,8 @@ export var InputNumber = function(props) {
213
204
  ];
214
205
  }
215
206
  });
216
- });
217
- return function handleInputChange(e) {
218
- return _ref.apply(this, arguments);
219
- };
220
- }();
207
+ })();
208
+ };
221
209
  var handleFocus = function(e) {
222
210
  setFocused(true);
223
211
  setInputValue(shadowValue !== undefined && shadowValue !== null ? bound(Number(shadowValue), Number(min), Number(max)).toString() : '');
@@ -1 +1 @@
1
- import React from "react";
1
+ export { };
@@ -53,8 +53,7 @@ var InternalPickerView = function(props, ref) {
53
53
  var index = currentOptions.findIndex(function(columnItem) {
54
54
  return columnItem.value === currentValue;
55
55
  });
56
- columnOptions = currentOptions[index === -1 ? 0 : index] // 如果未找到,默认取第一个
57
- ;
56
+ columnOptions = currentOptions[index === -1 ? 0 : index]; // 如果未找到,默认取第一个
58
57
  } else {
59
58
  return "break" // 如果 currentValue 不存在,终止循环
60
59
  ;
@@ -1,3 +1,3 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { WebPopupProps } from "../../types";
3
- export declare const Popup: FunctionComponent<Partial<WebPopupProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>>;
3
+ export declare const Popup: FunctionComponent<Partial<WebPopupProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'onTouchStart' | 'onTouchMove' | 'onTouchEnd'>>;
@@ -2,7 +2,7 @@ import { _ as _define_property } from "@swc/helpers/_/_define_property";
2
2
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
3
3
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
4
4
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
5
- import React, { useEffect, useState } from "react";
5
+ import React, { useEffect, useState, useRef } from "react";
6
6
  import { createPortal } from "react-dom";
7
7
  import { CSSTransition } from "react-transition-group";
8
8
  import classNames from "classnames";
@@ -22,6 +22,8 @@ var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps),
22
22
  portal: null,
23
23
  overlay: true,
24
24
  round: false,
25
+ resizable: false,
26
+ minHeight: '',
25
27
  onOpen: function() {},
26
28
  onClose: function() {},
27
29
  onOverlayClick: function() {
@@ -29,28 +31,42 @@ var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps),
29
31
  },
30
32
  onCloseIconClick: function() {
31
33
  return true;
32
- }
34
+ },
35
+ onTouchStart: function() {},
36
+ onTouchMove: function() {},
37
+ onTouchEnd: function() {}
33
38
  });
34
39
  // 默认1000,参看variables
35
40
  var _zIndex = 1100;
36
41
  export var Popup = function(props) {
37
- var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left = _$_object_spread.left, title = _$_object_spread.title, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick;
42
+ var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left = _$_object_spread.left, title = _$_object_spread.title, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, resizable = _$_object_spread.resizable, minHeight = _$_object_spread.minHeight, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick, onTouchStart = _$_object_spread.onTouchStart, onTouchMove = _$_object_spread.onTouchMove, onTouchEnd = _$_object_spread.onTouchEnd;
38
43
  var nodeRef = React.useRef(null);
39
44
  var innerIndex = zIndex || _zIndex;
40
45
  var _useState = _sliced_to_array(useState(innerIndex), 2), index = _useState[0], setIndex = _useState[1];
41
46
  var _useState1 = _sliced_to_array(useState(visible), 2), innerVisible = _useState1[0], setInnerVisible = _useState1[1];
42
47
  var _useState2 = _sliced_to_array(useState(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
43
48
  var _useState3 = _sliced_to_array(useState(''), 2), transitionName = _useState3[0], setTransitionName = _useState3[1];
49
+ var touchStartRef = useRef(0);
50
+ var touchMoveDistanceRef = useRef(0);
51
+ var heightRef = useRef(0);
52
+ // 首次可调整时记录的默认高度
53
+ var defaultHeightRef = useRef(0);
54
+ var isTouching = useRef(false);
44
55
  useLockScroll(nodeRef, innerVisible && lockScroll);
45
56
  var classPrefix = 'nut-popup';
46
57
  var overlayStyles = _object_spread({}, overlayStyle);
47
58
  var popStyles = _object_spread_props(_object_spread({}, style), {
48
- zIndex: index
59
+ zIndex: index,
60
+ minHeight: minHeight
49
61
  });
50
62
  var _obj;
51
63
  var popClassName = classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-round"), round || position === 'bottom'), _define_property(_obj, "".concat(classPrefix, "-").concat(position), true), _obj), className);
52
64
  var open = function() {
53
65
  if (!innerVisible) {
66
+ // 当高度改变后,再次打开时,将高度置为初始高度
67
+ if (position === 'bottom' && resizable && nodeRef.current && heightRef.current) {
68
+ nodeRef.current.style.height = "".concat(defaultHeightRef.current, "px");
69
+ }
54
70
  setInnerVisible(true);
55
71
  setIndex(++innerIndex);
56
72
  }
@@ -104,6 +120,41 @@ export var Popup = function(props) {
104
120
  return renderCloseIcon();
105
121
  }
106
122
  };
123
+ var handleTouchStart = function(event) {
124
+ var _nodeRef_current;
125
+ if (position !== 'bottom' || !resizable || !nodeRef.current) return;
126
+ // 开始touch,记录下touch的pageY,用以判断是向上滑动还是向下滑动
127
+ touchStartRef.current = event.touches[0].pageY;
128
+ // 标记开始滑动
129
+ isTouching.current = true;
130
+ // 标记当前popup的高度
131
+ heightRef.current = ((_nodeRef_current = nodeRef.current) === null || _nodeRef_current === void 0 ? void 0 : _nodeRef_current.offsetHeight) || 0;
132
+ if (!defaultHeightRef.current) defaultHeightRef.current = heightRef.current;
133
+ onTouchStart === null || onTouchStart === void 0 ? void 0 : onTouchStart(heightRef.current, event);
134
+ };
135
+ var handleTouchMove = function(event) {
136
+ if (position !== 'bottom' || !resizable || !nodeRef.current) return;
137
+ event.stopPropagation();
138
+ // move过程中,当前的pageY 与 start值比较
139
+ touchMoveDistanceRef.current = event.touches[0].pageY - touchStartRef.current;
140
+ var min = typeof minHeight === 'number' ? minHeight : parseInt(String(minHeight || 0), 10) || 0;
141
+ var currentHeight = Math.max(min, heightRef.current - touchMoveDistanceRef.current);
142
+ nodeRef.current.style.height = "".concat(currentHeight, "px");
143
+ // 向下滑动
144
+ if (touchMoveDistanceRef.current > 0) {
145
+ onTouchMove === null || onTouchMove === void 0 ? void 0 : onTouchMove(currentHeight, event, 'down');
146
+ } else {
147
+ // 向上滑动
148
+ onTouchMove === null || onTouchMove === void 0 ? void 0 : onTouchMove(currentHeight, event, 'up');
149
+ }
150
+ };
151
+ var handleTouchEnd = function(event) {
152
+ if (position !== 'bottom' || !resizable || !nodeRef.current) return;
153
+ isTouching.current = false;
154
+ var min = typeof minHeight === 'number' ? minHeight : parseInt(String(minHeight || 0), 10) || 0;
155
+ var currentHeight = Math.max(min, heightRef.current - touchMoveDistanceRef.current);
156
+ onTouchEnd === null || onTouchEnd === void 0 ? void 0 : onTouchEnd(currentHeight, event);
157
+ };
107
158
  var renderPop = function() {
108
159
  return /*#__PURE__*/ React.createElement(CSSTransition, {
109
160
  nodeRef: nodeRef,
@@ -118,7 +169,11 @@ export var Popup = function(props) {
118
169
  ref: nodeRef,
119
170
  style: popStyles,
120
171
  className: popClassName,
121
- onClick: onClick
172
+ onClick: onClick,
173
+ onTouchStart: handleTouchStart,
174
+ onTouchMove: handleTouchMove,
175
+ onTouchEnd: handleTouchEnd,
176
+ onTouchCancel: handleTouchEnd
122
177
  }, renderTitle(), showChildren && children));
123
178
  };
124
179
  var renderNode = function() {
@@ -88,11 +88,6 @@
88
88
  }
89
89
  }
90
90
 
91
- &-bottom,
92
- &-top {
93
- max-height: 87%;
94
- }
95
-
96
91
  &-bottom {
97
92
  bottom: 0;
98
93
  left: 0;
@@ -80,9 +80,6 @@
80
80
  .nut-popup-center.nut-popup-round {
81
81
  border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px));
82
82
  }
83
- .nut-popup-bottom, .nut-popup-top {
84
- max-height: 87%;
85
- }
86
83
  .nut-popup-bottom {
87
84
  bottom: 0;
88
85
  left: 0;
@@ -88,11 +88,6 @@
88
88
  }
89
89
  }
90
90
 
91
- &-bottom,
92
- &-top {
93
- max-height: 87%;
94
- }
95
-
96
91
  &-bottom {
97
92
  bottom: 0;
98
93
  left: 0;
@@ -80,9 +80,6 @@
80
80
  .nut-popup-center.nut-popup-round {
81
81
  border-radius: var(--nutui-popup-border-radius, 12px);
82
82
  }
83
- .nut-popup-bottom, .nut-popup-top {
84
- max-height: 87%;
85
- }
86
83
  .nut-popup-bottom {
87
84
  bottom: 0;
88
85
  left: 0;
@@ -88,11 +88,6 @@
88
88
  }
89
89
  }
90
90
 
91
- &-bottom,
92
- &-top {
93
- max-height: 87%;
94
- }
95
-
96
91
  &-bottom {
97
92
  bottom: 0;
98
93
  left: 0;
@@ -80,9 +80,6 @@
80
80
  .nut-popup-center.nut-popup-round {
81
81
  border-radius: var(--nutui-popup-border-radius, 12px);
82
82
  }
83
- .nut-popup-bottom, .nut-popup-top {
84
- max-height: 87%;
85
- }
86
83
  .nut-popup-bottom {
87
84
  bottom: 0;
88
85
  left: 0;
@@ -9,7 +9,7 @@
9
9
  &-integer,
10
10
  &-decimal {
11
11
  color: $price-color;
12
- font-family: 'JD';
12
+ font-family: 'JDZH-Bold';
13
13
  line-height: 1;
14
14
  }
15
15
 
@@ -18,7 +18,7 @@
18
18
  &-symbol,
19
19
  &-integer,
20
20
  &-decimal {
21
- font-family: 'JD-Bold';
21
+ font-family: 'JDZH-Bold';
22
22
  color: $price-darkgray-color;
23
23
  }
24
24
  }
@@ -29,7 +29,7 @@
29
29
  &-symbol,
30
30
  &-integer,
31
31
  &-decimal {
32
- font-family: 'JD-Bold';
32
+ font-family: 'JDZH-Bold';
33
33
  color: $price-primary-color;
34
34
  }
35
35
  }
@@ -11,15 +11,15 @@
11
11
  }
12
12
  .nut-price-symbol, .nut-price-integer, .nut-price-decimal {
13
13
  color: var(--nutui-price-color, var(--nutui-color-text-help));
14
- font-family: "JD";
14
+ font-family: "JDZH-Bold";
15
15
  line-height: 1;
16
16
  }
17
17
  .nut-price-darkgray .nut-price-symbol, .nut-price-darkgray .nut-price-integer, .nut-price-darkgray .nut-price-decimal {
18
- font-family: "JD-Bold";
18
+ font-family: "JDZH-Bold";
19
19
  color: var(--nutui-price-darkgray-color, var(--nutui-gray-7));
20
20
  }
21
21
  .nut-price-primary .nut-price-symbol, .nut-price-primary .nut-price-integer, .nut-price-primary .nut-price-decimal {
22
- font-family: "JD-Bold";
22
+ font-family: "JDZH-Bold";
23
23
  color: var(--nutui-price-color, var(--nutui-color-primary, #ff0f23));
24
24
  }
25
25
  .nut-price-symbol {
@@ -9,7 +9,7 @@
9
9
  &-integer,
10
10
  &-decimal {
11
11
  color: $price-color;
12
- font-family: 'JD';
12
+ font-family: 'JDZH-Bold';
13
13
  line-height: 1;
14
14
  }
15
15
 
@@ -18,7 +18,7 @@
18
18
  &-symbol,
19
19
  &-integer,
20
20
  &-decimal {
21
- font-family: 'JD-Bold';
21
+ font-family: 'JDZH-Bold';
22
22
  color: $price-darkgray-color;
23
23
  }
24
24
  }
@@ -29,7 +29,7 @@
29
29
  &-symbol,
30
30
  &-integer,
31
31
  &-decimal {
32
- font-family: 'JD-Bold';
32
+ font-family: 'JDZH-Bold';
33
33
  color: $price-primary-color;
34
34
  }
35
35
  }
@@ -11,15 +11,15 @@
11
11
  }
12
12
  .nut-price-symbol, .nut-price-integer, .nut-price-decimal {
13
13
  color: var(--nutui-price-color, var(--nutui-color-text-help));
14
- font-family: "JD";
14
+ font-family: "JDZH-Bold";
15
15
  line-height: 1;
16
16
  }
17
17
  .nut-price-darkgray .nut-price-symbol, .nut-price-darkgray .nut-price-integer, .nut-price-darkgray .nut-price-decimal {
18
- font-family: "JD-Bold";
18
+ font-family: "JDZH-Bold";
19
19
  color: var(--nutui-price-darkgray-color, var(--nutui-gray-7));
20
20
  }
21
21
  .nut-price-primary .nut-price-symbol, .nut-price-primary .nut-price-integer, .nut-price-primary .nut-price-decimal {
22
- font-family: "JD-Bold";
22
+ font-family: "JDZH-Bold";
23
23
  color: var(--nutui-price-color, var(--nutui-color-primary));
24
24
  }
25
25
  .nut-price-symbol {