@nutui/nutui-react 3.0.19 → 3.0.20

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 (108) hide show
  1. package/CHANGELOG.md +65 -54
  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/vi-VN.d.ts +3 -0
  6. package/dist/cjs/locales/vi-VN.js +170 -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/calendar/utils.js +8 -8
  11. package/dist/cjs/packages/calendarcard/icon.js +5 -5
  12. package/dist/cjs/packages/calendarcard/utils.js +6 -6
  13. package/dist/cjs/packages/cascader/cascader.js +12 -21
  14. package/dist/cjs/packages/cascader/utils.js +3 -3
  15. package/dist/cjs/packages/collapseitem/collapseitem.js +4 -7
  16. package/dist/cjs/packages/configprovider/configprovider.js +7 -7
  17. package/dist/cjs/packages/configprovider/index.js +6 -6
  18. package/dist/cjs/packages/countdown/countdown.js +1 -2
  19. package/dist/cjs/packages/datepicker/utils.js +9 -9
  20. package/dist/cjs/packages/dialog/content.js +3 -3
  21. package/dist/cjs/packages/dialog/dialog.js +4 -7
  22. package/dist/cjs/packages/elevator/elevator.js +3 -3
  23. package/dist/cjs/packages/form/index.js +0 -2
  24. package/dist/cjs/packages/form/useform.js +50 -57
  25. package/dist/cjs/packages/infiniteloading/infiniteloading.js +8 -14
  26. package/dist/cjs/packages/inputnumber/inputnumber.js +16 -28
  27. package/dist/cjs/packages/lottie/types.js +0 -2
  28. package/dist/cjs/packages/nutui.react.build.js +105 -105
  29. package/dist/cjs/packages/nutui.react.js +105 -105
  30. package/dist/cjs/packages/overlay/overlay.js +3 -3
  31. package/dist/cjs/packages/pickerview/pickerview.js +1 -2
  32. package/dist/cjs/packages/pickerview/utils.js +3 -3
  33. package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +41 -51
  34. package/dist/cjs/packages/radio/index.js +0 -2
  35. package/dist/cjs/packages/range/utils.js +3 -3
  36. package/dist/cjs/packages/safearea/safearea.js +12 -3
  37. package/dist/cjs/packages/safearea/style/safearea.scss +6 -0
  38. package/dist/cjs/packages/safearea/style/style.css +2 -0
  39. package/dist/cjs/packages/safearea/style-jmapp/safearea.scss +6 -0
  40. package/dist/cjs/packages/safearea/style-jmapp/style.css +2 -0
  41. package/dist/cjs/packages/safearea/style-jrkf/safearea.scss +6 -0
  42. package/dist/cjs/packages/safearea/style-jrkf/style.css +2 -0
  43. package/dist/cjs/packages/shortpassword/shortpassword.js +3 -3
  44. package/dist/cjs/packages/skeleton/skeleton.js +2 -4
  45. package/dist/cjs/packages/swiper/effects/focus.js +4 -4
  46. package/dist/cjs/packages/swiper/index.js +0 -1
  47. package/dist/cjs/packages/switch/switch.js +4 -7
  48. package/dist/cjs/packages/uploader/uploader.js +30 -37
  49. package/dist/cjs/packages/virtuallist/utils.js +6 -6
  50. package/dist/cjs/packages/watermark/watermark.js +4 -8
  51. package/dist/cjs/types/spec/address/base.js +0 -2
  52. package/dist/cjs/utils/date.js +5 -5
  53. package/dist/cjs/utils/event-mocker.js +10 -18
  54. package/dist/cjs/utils/get-rect.js +4 -4
  55. package/dist/cjs/utils/get-scroll-parent.js +3 -3
  56. package/dist/cjs/utils/merge-props.js +3 -3
  57. package/dist/cjs/utils/merge.js +6 -6
  58. package/dist/cjs/utils/raf.js +3 -3
  59. package/dist/cjs/utils/render.js +5 -9
  60. package/dist/cjs/utils/rubberband.js +3 -3
  61. package/dist/cjs/utils/taro/ConfigurableCSSTransition copy.d.ts +15 -0
  62. package/dist/cjs/utils/taro/ConfigurableCSSTransition copy.js +130 -0
  63. package/dist/cjs/utils/taro/get-rect.js +14 -24
  64. package/dist/cjs/utils/taro/get-system-info.js +4 -4
  65. package/dist/cjs/utils/taro/platform.js +5 -5
  66. package/dist/es/hooks/use-touch.js +1 -1
  67. package/dist/es/locales/vi-VN.d.ts +3 -0
  68. package/dist/es/locales/vi-VN.js +160 -0
  69. package/dist/es/packages/avatarcropper/avatarcropper.js +4 -7
  70. package/dist/es/packages/cascader/cascader.js +12 -21
  71. package/dist/es/packages/collapseitem/collapseitem.js +4 -7
  72. package/dist/es/packages/countdown/countdown.js +1 -2
  73. package/dist/es/packages/dialog/dialog.js +4 -7
  74. package/dist/es/packages/form/index.js +0 -1
  75. package/dist/es/packages/form/useform.js +46 -53
  76. package/dist/es/packages/infiniteloading/infiniteloading.js +8 -14
  77. package/dist/es/packages/inputnumber/inputnumber.js +16 -28
  78. package/dist/es/packages/lottie/types.js +1 -1
  79. package/dist/es/packages/pickerview/pickerview.js +1 -2
  80. package/dist/es/packages/pulltorefresh/pulltorefresh.js +41 -51
  81. package/dist/es/packages/radio/index.js +0 -1
  82. package/dist/es/packages/safearea/safearea.js +12 -3
  83. package/dist/es/packages/safearea/style/safearea.scss +6 -0
  84. package/dist/es/packages/safearea/style/style.css +2 -0
  85. package/dist/es/packages/safearea/style-jmapp/safearea.scss +6 -0
  86. package/dist/es/packages/safearea/style-jmapp/style.css +2 -0
  87. package/dist/es/packages/safearea/style-jrkf/safearea.scss +6 -0
  88. package/dist/es/packages/safearea/style-jrkf/style.css +2 -0
  89. package/dist/es/packages/skeleton/skeleton.js +2 -4
  90. package/dist/es/packages/swiper/index.js +0 -1
  91. package/dist/es/packages/switch/switch.js +4 -7
  92. package/dist/es/packages/uploader/uploader.js +30 -37
  93. package/dist/es/packages/watermark/watermark.js +4 -8
  94. package/dist/es/types/spec/address/base.js +1 -1
  95. package/dist/es/utils/event-mocker.js +4 -12
  96. package/dist/es/utils/render.js +2 -6
  97. package/dist/es/utils/taro/ConfigurableCSSTransition copy.d.ts +15 -0
  98. package/dist/es/utils/taro/ConfigurableCSSTransition copy.js +119 -0
  99. package/dist/es/utils/taro/get-rect.js +10 -20
  100. package/dist/nutui.react.umd.js +405 -595
  101. package/dist/style-jmapp.css +1 -1
  102. package/dist/style-jmapp.scss +30 -30
  103. package/dist/style-jrkf.css +1 -1
  104. package/dist/style-jrkf.scss +37 -37
  105. package/dist/style.css +1 -1
  106. package/dist/style.scss +35 -35
  107. package/package.json +1 -1
  108. package/postinstall.js +9 -0
@@ -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
  ;
@@ -30,40 +30,7 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
30
30
  });
31
31
  export var PullToRefresh = function(p) {
32
32
  var doRefresh = function doRefresh() {
33
- return _doRefresh.apply(this, arguments);
34
- };
35
- var classPrefix = 'nut-pulltorefresh';
36
- var locale = useConfig().locale;
37
- var props = _object_spread({}, defaultProps, p, {
38
- pullingText: p.pullingText || locale.pullToRefresh.pullingText,
39
- canReleaseText: p.canReleaseText || locale.pullToRefresh.canReleaseText,
40
- refreshingText: p.refreshingText || locale.pullToRefresh.refreshingText,
41
- completeText: p.completeText || locale.pullToRefresh.completeText
42
- });
43
- var classes = classNames(classPrefix, props.className, "".concat(classPrefix, "-").concat(props.type));
44
- var headHeight = props.headHeight;
45
- var threshold = props.threshold;
46
- var _useState = _sliced_to_array(useState('pulling'), 2), status = _useState[0], setStatus = _useState[1];
47
- var _useSpring = _sliced_to_array(useSpring(function() {
48
- return {
49
- from: {
50
- height: 0
51
- },
52
- config: {
53
- tension: 300,
54
- friction: 30,
55
- clamp: true
56
- }
57
- };
58
- }), 2), springStyles = _useSpring[0], api = _useSpring[1];
59
- var elementRef = useRef(null);
60
- var pullingRef = useRef(false);
61
- useEffect(function() {
62
- var _elementRef_current;
63
- (_elementRef_current = elementRef.current) === null || _elementRef_current === void 0 ? void 0 : _elementRef_current.addEventListener('touchmove', function() {});
64
- }, []);
65
- function _doRefresh() {
66
- _doRefresh = _async_to_generator(function() {
33
+ return _async_to_generator(function() {
67
34
  var e;
68
35
  return _ts_generator(this, function(_state) {
69
36
  switch(_state.label){
@@ -94,8 +61,8 @@ export var PullToRefresh = function(p) {
94
61
  case 3:
95
62
  e = _state.sent();
96
63
  api.start({
97
- to: /*#__PURE__*/ function() {
98
- var _ref = _async_to_generator(function(next) {
64
+ to: function(next) {
65
+ return _async_to_generator(function() {
99
66
  return _ts_generator(this, function(_state) {
100
67
  switch(_state.label){
101
68
  case 0:
@@ -113,11 +80,8 @@ export var PullToRefresh = function(p) {
113
80
  ];
114
81
  }
115
82
  });
116
- });
117
- return function(next) {
118
- return _ref.apply(this, arguments);
119
- };
120
- }()
83
+ })();
84
+ }
121
85
  });
122
86
  throw e;
123
87
  case 4:
@@ -134,8 +98,8 @@ export var PullToRefresh = function(p) {
134
98
  _state.label = 6;
135
99
  case 6:
136
100
  api.start({
137
- to: /*#__PURE__*/ function() {
138
- var _ref = _async_to_generator(function(next) {
101
+ to: function(next) {
102
+ return _async_to_generator(function() {
139
103
  return _ts_generator(this, function(_state) {
140
104
  switch(_state.label){
141
105
  case 0:
@@ -153,20 +117,46 @@ export var PullToRefresh = function(p) {
153
117
  ];
154
118
  }
155
119
  });
156
- });
157
- return function(next) {
158
- return _ref.apply(this, arguments);
159
- };
160
- }()
120
+ })();
121
+ }
161
122
  });
162
123
  return [
163
124
  2
164
125
  ];
165
126
  }
166
127
  });
167
- });
168
- return _doRefresh.apply(this, arguments);
169
- }
128
+ })();
129
+ };
130
+ var classPrefix = 'nut-pulltorefresh';
131
+ var locale = useConfig().locale;
132
+ var props = _object_spread({}, defaultProps, p, {
133
+ pullingText: p.pullingText || locale.pullToRefresh.pullingText,
134
+ canReleaseText: p.canReleaseText || locale.pullToRefresh.canReleaseText,
135
+ refreshingText: p.refreshingText || locale.pullToRefresh.refreshingText,
136
+ completeText: p.completeText || locale.pullToRefresh.completeText
137
+ });
138
+ var classes = classNames(classPrefix, props.className, "".concat(classPrefix, "-").concat(props.type));
139
+ var headHeight = props.headHeight;
140
+ var threshold = props.threshold;
141
+ var _useState = _sliced_to_array(useState('pulling'), 2), status = _useState[0], setStatus = _useState[1];
142
+ var _useSpring = _sliced_to_array(useSpring(function() {
143
+ return {
144
+ from: {
145
+ height: 0
146
+ },
147
+ config: {
148
+ tension: 300,
149
+ friction: 30,
150
+ clamp: true
151
+ }
152
+ };
153
+ }), 2), springStyles = _useSpring[0], api = _useSpring[1];
154
+ var elementRef = useRef(null);
155
+ var pullingRef = useRef(false);
156
+ useEffect(function() {
157
+ var _elementRef_current;
158
+ (_elementRef_current = elementRef.current) === null || _elementRef_current === void 0 ? void 0 : _elementRef_current.addEventListener('touchmove', function() {});
159
+ }, []);
170
160
  useDrag(function(state) {
171
161
  var getScrollTop = function getScrollTop(element) {
172
162
  return 'scrollTop' in element ? element.scrollTop : element.scrollY;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Radio } from "./radio";
3
2
  import { RadioGroup } from "../radiogroup/radiogroup";
4
3
  var InnerRadio = Radio;
@@ -1,9 +1,18 @@
1
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
+ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
+ import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
1
4
  import React from "react";
2
5
  import classNames from "classnames";
3
6
  var classPrefix = 'nut-safe-area';
4
7
  export var SafeArea = function(props) {
5
- return /*#__PURE__*/ React.createElement("div", {
6
- className: classNames(classPrefix, "".concat(classPrefix, "-position-").concat(props.position))
7
- });
8
+ var className = props.className, style = props.style, position = props.position, rest = _object_without_properties(props, [
9
+ "className",
10
+ "style",
11
+ "position"
12
+ ]);
13
+ return /*#__PURE__*/ React.createElement("div", _object_spread_props(_object_spread({}, rest), {
14
+ className: classNames(classPrefix, "".concat(classPrefix, "-position-").concat(position), className),
15
+ style: style
16
+ }));
8
17
  };
9
18
  SafeArea.displayName = 'NutSafeArea';
@@ -3,12 +3,18 @@
3
3
  width: 100%;
4
4
 
5
5
  &-position-top {
6
+ padding-top: calc(
7
+ constant(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1)
8
+ );
6
9
  padding-top: calc(
7
10
  env(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1)
8
11
  );
9
12
  }
10
13
 
11
14
  &-position-bottom {
15
+ padding-bottom: calc(
16
+ constant(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1)
17
+ );
12
18
  padding-bottom: calc(
13
19
  env(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1)
14
20
  );
@@ -7,8 +7,10 @@
7
7
  width: 100%;
8
8
  }
9
9
  .nut-safe-area-position-top {
10
+ padding-top: calc(constant(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1));
10
11
  padding-top: calc(env(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1));
11
12
  }
12
13
  .nut-safe-area-position-bottom {
14
+ padding-bottom: calc(constant(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1));
13
15
  padding-bottom: calc(env(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1));
14
16
  }
@@ -3,12 +3,18 @@
3
3
  width: 100%;
4
4
 
5
5
  &-position-top {
6
+ padding-top: calc(
7
+ constant(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1)
8
+ );
6
9
  padding-top: calc(
7
10
  env(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1)
8
11
  );
9
12
  }
10
13
 
11
14
  &-position-bottom {
15
+ padding-bottom: calc(
16
+ constant(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1)
17
+ );
12
18
  padding-bottom: calc(
13
19
  env(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1)
14
20
  );
@@ -7,8 +7,10 @@
7
7
  width: 100%;
8
8
  }
9
9
  .nut-safe-area-position-top {
10
+ padding-top: calc(constant(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1));
10
11
  padding-top: calc(env(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1));
11
12
  }
12
13
  .nut-safe-area-position-bottom {
14
+ padding-bottom: calc(constant(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1));
13
15
  padding-bottom: calc(env(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1));
14
16
  }
@@ -3,12 +3,18 @@
3
3
  width: 100%;
4
4
 
5
5
  &-position-top {
6
+ padding-top: calc(
7
+ constant(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1)
8
+ );
6
9
  padding-top: calc(
7
10
  env(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1)
8
11
  );
9
12
  }
10
13
 
11
14
  &-position-bottom {
15
+ padding-bottom: calc(
16
+ constant(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1)
17
+ );
12
18
  padding-bottom: calc(
13
19
  env(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1)
14
20
  );
@@ -7,8 +7,10 @@
7
7
  width: 100%;
8
8
  }
9
9
  .nut-safe-area-position-top {
10
+ padding-top: calc(constant(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1));
10
11
  padding-top: calc(env(safe-area-inset-top) * var(--nutui-safe-area-multiple, 1));
11
12
  }
12
13
  .nut-safe-area-position-bottom {
14
+ padding-bottom: calc(constant(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1));
13
15
  padding-bottom: calc(env(safe-area-inset-bottom) * var(--nutui-safe-area-multiple, 1));
14
16
  }
@@ -52,11 +52,9 @@ export var Skeleton = function(props) {
52
52
  };
53
53
  var _useState = _sliced_to_array(useState(false), 2), animate = _useState[0], setAnimate = _useState[1];
54
54
  var playAnimation = function() {
55
- setAnimate(false) // 首先将 animate 设置为 false
56
- ;
55
+ setAnimate(false); // 首先将 animate 设置为 false
57
56
  setTimeout(function() {
58
- setAnimate(true) // 1 毫秒后再设置为 true,触发动画
59
- ;
57
+ setAnimate(true); // 1 毫秒后再设置为 true,触发动画
60
58
  }, 10);
61
59
  };
62
60
  useEffect(function() {
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Swiper } from "./swiper";
3
2
  import SwiperItem from "../swiperitem";
4
3
  var InnerSwiper = Swiper;
@@ -62,8 +62,8 @@ export var Switch = function(props) {
62
62
  (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-close"), !value), _define_property(_obj, "".concat(classPrefix, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix, "-disabled-close"), disabled && !value), _obj)
63
63
  ]);
64
64
  };
65
- var onClick = /*#__PURE__*/ function() {
66
- var _ref = _async_to_generator(function() {
65
+ var onClick = function() {
66
+ return _async_to_generator(function() {
67
67
  var e;
68
68
  return _ts_generator(this, function(_state) {
69
69
  switch(_state.label){
@@ -108,11 +108,8 @@ export var Switch = function(props) {
108
108
  ];
109
109
  }
110
110
  });
111
- });
112
- return function onClick() {
113
- return _ref.apply(this, arguments);
114
- };
115
- }();
111
+ })();
112
+ };
116
113
  var _obj, _obj1;
117
114
  return /*#__PURE__*/ React.createElement("div", _object_spread_props(_object_spread({
118
115
  className: classes(),