@nutui/nutui-react-taro 1.4.1 → 1.4.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 (43) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +4 -4
  3. package/dist/esm/DatePicker.js +3 -3
  4. package/dist/esm/Input.js +2 -2
  5. package/dist/esm/Picker.js +2 -2
  6. package/dist/esm/SideNavBar.js +3 -3
  7. package/dist/esm/SubSideNavBar.js +3 -3
  8. package/dist/esm/address.taro-c03b8b16.js +23 -21
  9. package/dist/esm/barrage.taro-d86c367a.js +22 -24
  10. package/dist/esm/calendaritem.taro-85a8c4fc.js +16 -18
  11. package/dist/esm/cascader.taro-459f7d45.js +234 -244
  12. package/dist/esm/{datepicker.taro-00a72ca3.js → datepicker.taro-7de67b85.js} +1 -1
  13. package/dist/esm/ellipsis.taro-c0de6ff4.js +76 -84
  14. package/dist/esm/{input.taro-65db24c3.js → input.taro-8b3f8381.js} +12 -24
  15. package/dist/esm/menuitem.taro-2f8e69a4.js +14 -16
  16. package/dist/esm/noticebar.taro-43c18dc9.js +31 -33
  17. package/dist/esm/nutui-react.es.js +6 -6
  18. package/dist/esm/offsetContext-bfb02c25.js +3 -0
  19. package/dist/esm/{picker.taro-e23bc9d1.js → picker.taro-9b7263ca.js} +11 -15
  20. package/dist/esm/popover.taro-7e5dff8c.js +15 -17
  21. package/dist/esm/pulltorefresh.taro-f26a20dd.js +75 -81
  22. package/dist/esm/range.taro-4cbe2469.js +67 -71
  23. package/dist/esm/{sidenavbar.taro-a828250a.js → sidenavbar.taro-3b1f1218.js} +13 -5
  24. package/dist/esm/{subsidenavbar.taro-4c80ad38.js → subsidenavbar.taro-f46b4c73.js} +12 -11
  25. package/dist/esm/swipe.taro-83bc248f.js +35 -37
  26. package/dist/esm/swiper.taro-852f6615.js +26 -28
  27. package/dist/esm/types/src/packages/input/input.d.ts +0 -8
  28. package/dist/esm/types/src/packages/input/input.taro.d.ts +0 -8
  29. package/dist/esm/useClientRect-bf69d7b3.js +10 -12
  30. package/dist/locales/base.js +2 -2
  31. package/dist/locales/en-US.js +2 -2
  32. package/dist/locales/id-ID.js +2 -2
  33. package/dist/locales/zh-CN.js +2 -2
  34. package/dist/locales/zh-TW.js +2 -2
  35. package/dist/locales/zh-UG.js +2 -2
  36. package/dist/nutui.react.es.js +66 -88
  37. package/dist/nutui.react.umd.js +66 -88
  38. package/dist/packages/input/input.scss +12 -12
  39. package/dist/style.css +1 -1
  40. package/dist/style.es.js +2 -2
  41. package/dist/types/index.d.ts +0 -8
  42. package/package.json +1 -1
  43. package/dist/esm/offsetContext-0e3d04b3.js +0 -16
@@ -69,18 +69,16 @@ var Ellipsis = function Ellipsis(props) {
69
69
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
70
70
  var refe;
71
71
  return _regeneratorRuntime.wrap(function _callee$(_context) {
72
- while (1) {
73
- switch (_context.prev = _context.next) {
74
- case 0:
75
- _context.next = 2;
76
- return getRectByTaro(symbolContain === null || symbolContain === void 0 ? void 0 : symbolContain.current);
77
- case 2:
78
- refe = _context.sent;
79
- symbolTextWidth = refe.width ? Math.ceil(refe.width) : Math.ceil(widthBase[0] * 0.7921);
80
- case 4:
81
- case "end":
82
- return _context.stop();
83
- }
72
+ while (1) switch (_context.prev = _context.next) {
73
+ case 0:
74
+ _context.next = 2;
75
+ return getRectByTaro(symbolContain === null || symbolContain === void 0 ? void 0 : symbolContain.current);
76
+ case 2:
77
+ refe = _context.sent;
78
+ symbolTextWidth = refe.width ? Math.ceil(refe.width) : Math.ceil(widthBase[0] * 0.7921);
79
+ case 4:
80
+ case "end":
81
+ return _context.stop();
84
82
  }
85
83
  }, _callee);
86
84
  }));
@@ -98,27 +96,25 @@ var Ellipsis = function Ellipsis(props) {
98
96
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
99
97
  var element, query;
100
98
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
101
- while (1) {
102
- switch (_context2.prev = _context2.next) {
103
- case 0:
104
- element = root.current;
105
- query = Taro.createSelectorQuery();
106
- query.select("#".concat(element.id)) && query.select("#".concat(element.id)).fields({
107
- computedStyle: ['width', 'height', 'lineHeight', 'paddingTop', 'paddingBottom', 'fontSize']
108
- }, function (res) {
109
- lineH = pxToNumber(res.lineHeight === 'normal' ? lineHeight : res.lineHeight);
110
- maxHeight = Math.floor(lineH * (Number(rows) + 0.5) + pxToNumber(res.paddingTop) + pxToNumber(res.paddingBottom));
111
- originHeight = pxToNumber(res.height);
112
- widthRef.current = res.width;
113
- // 设置基础字符
114
- var bsize = pxToNumber(res.fontSize);
115
- widthBase = [bsize, bsize * 0.72, bsize * 0.53, bsize * 0.4, bsize * 0.75];
116
- calcEllipse();
117
- }).exec();
118
- case 3:
119
- case "end":
120
- return _context2.stop();
121
- }
99
+ while (1) switch (_context2.prev = _context2.next) {
100
+ case 0:
101
+ element = root.current;
102
+ query = Taro.createSelectorQuery();
103
+ query.select("#".concat(element.id)) && query.select("#".concat(element.id)).fields({
104
+ computedStyle: ['width', 'height', 'lineHeight', 'paddingTop', 'paddingBottom', 'fontSize']
105
+ }, function (res) {
106
+ lineH = pxToNumber(res.lineHeight === 'normal' ? lineHeight : res.lineHeight);
107
+ maxHeight = Math.floor(lineH * (Number(rows) + 0.5) + pxToNumber(res.paddingTop) + pxToNumber(res.paddingBottom));
108
+ originHeight = pxToNumber(res.height);
109
+ widthRef.current = res.width;
110
+ // 设置基础字符
111
+ var bsize = pxToNumber(res.fontSize);
112
+ widthBase = [bsize, bsize * 0.72, bsize * 0.53, bsize * 0.4, bsize * 0.75];
113
+ calcEllipse();
114
+ }).exec();
115
+ case 3:
116
+ case "end":
117
+ return _context2.stop();
122
118
  }
123
119
  }, _callee2);
124
120
  }));
@@ -131,38 +127,36 @@ var Ellipsis = function Ellipsis(props) {
131
127
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
132
128
  var refe, rowNum, end, _end, start;
133
129
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
134
- while (1) {
135
- switch (_context3.prev = _context3.next) {
136
- case 0:
137
- _context3.next = 2;
138
- return getRectByTaro(rootContain.current);
139
- case 2:
140
- refe = _context3.sent;
141
- if (refe.height <= maxHeight) {
142
- setExceeded(false);
130
+ while (1) switch (_context3.prev = _context3.next) {
131
+ case 0:
132
+ _context3.next = 2;
133
+ return getRectByTaro(rootContain.current);
134
+ case 2:
135
+ refe = _context3.sent;
136
+ if (refe.height <= maxHeight) {
137
+ setExceeded(false);
138
+ } else {
139
+ rowNum = Math.floor(content.length / (originHeight / lineH - 1)); // 每行的字数
140
+ if (direction === 'middle') {
141
+ end = content.length;
142
+ ellipsis.current.leading = tailorContent(0, rowNum * (Number(rows) + 0.5), 'end');
143
+ ellipsis.current.tailing = tailorContent(content.length - rowNum * (Number(rows) + 0.5), end, 'start');
144
+ } else if (direction === 'end') {
145
+ _end = rowNum * (Number(rows) + 0.5);
146
+ ellipsis.current.leading = tailorContent(0, _end);
143
147
  } else {
144
- rowNum = Math.floor(content.length / (originHeight / lineH - 1)); // 每行的字数
145
- if (direction === 'middle') {
146
- end = content.length;
147
- ellipsis.current.leading = tailorContent(0, rowNum * (Number(rows) + 0.5), 'end');
148
- ellipsis.current.tailing = tailorContent(content.length - rowNum * (Number(rows) + 0.5), end, 'start');
149
- } else if (direction === 'end') {
150
- _end = rowNum * (Number(rows) + 0.5);
151
- ellipsis.current.leading = tailorContent(0, _end);
152
- } else {
153
- start = content.length - rowNum * (Number(rows) + 0.5) - 5;
154
- ellipsis.current.tailing = tailorContent(start, content.length);
155
- }
156
- // 进行兜底判断,是否符合要求
157
- assignContent();
158
- setTimeout(function () {
159
- verifyEllipsis();
160
- }, 100);
148
+ start = content.length - rowNum * (Number(rows) + 0.5) - 5;
149
+ ellipsis.current.tailing = tailorContent(start, content.length);
161
150
  }
162
- case 4:
163
- case "end":
164
- return _context3.stop();
165
- }
151
+ // 进行兜底判断,是否符合要求
152
+ assignContent();
153
+ setTimeout(function () {
154
+ verifyEllipsis();
155
+ }, 100);
156
+ }
157
+ case 4:
158
+ case "end":
159
+ return _context3.stop();
166
160
  }
167
161
  }, _callee3);
168
162
  }));
@@ -175,28 +169,26 @@ var Ellipsis = function Ellipsis(props) {
175
169
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
176
170
  var refe, _ellipsis$current, _ellipsis$current$lea, _ellipsis$current2, _ellipsis$current3, _ellipsis$current3$ta, _ellipsis$current4;
177
171
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
178
- while (1) {
179
- switch (_context4.prev = _context4.next) {
180
- case 0:
181
- _context4.next = 2;
182
- return getRectByTaro(rootContain.current);
183
- case 2:
184
- refe = _context4.sent;
185
- if (refe && refe.height && refe.height > maxHeight) {
186
- if (direction === 'end') {
187
- ellipsis.current.leading = (_ellipsis$current = ellipsis.current) === null || _ellipsis$current === void 0 ? void 0 : (_ellipsis$current$lea = _ellipsis$current.leading) === null || _ellipsis$current$lea === void 0 ? void 0 : _ellipsis$current$lea.slice(0, ((_ellipsis$current2 = ellipsis.current) === null || _ellipsis$current2 === void 0 ? void 0 : _ellipsis$current2.leading.length) - 1);
188
- } else {
189
- ellipsis.current.tailing = (_ellipsis$current3 = ellipsis.current) === null || _ellipsis$current3 === void 0 ? void 0 : (_ellipsis$current3$ta = _ellipsis$current3.tailing) === null || _ellipsis$current3$ta === void 0 ? void 0 : _ellipsis$current3$ta.slice(1, (_ellipsis$current4 = ellipsis.current) === null || _ellipsis$current4 === void 0 ? void 0 : _ellipsis$current4.tailing.length);
190
- }
191
- assignContent();
192
- setTimeout(function () {
193
- verifyEllipsis();
194
- }, 100);
172
+ while (1) switch (_context4.prev = _context4.next) {
173
+ case 0:
174
+ _context4.next = 2;
175
+ return getRectByTaro(rootContain.current);
176
+ case 2:
177
+ refe = _context4.sent;
178
+ if (refe && refe.height && refe.height > maxHeight) {
179
+ if (direction === 'end') {
180
+ ellipsis.current.leading = (_ellipsis$current = ellipsis.current) === null || _ellipsis$current === void 0 ? void 0 : (_ellipsis$current$lea = _ellipsis$current.leading) === null || _ellipsis$current$lea === void 0 ? void 0 : _ellipsis$current$lea.slice(0, ((_ellipsis$current2 = ellipsis.current) === null || _ellipsis$current2 === void 0 ? void 0 : _ellipsis$current2.leading.length) - 1);
181
+ } else {
182
+ ellipsis.current.tailing = (_ellipsis$current3 = ellipsis.current) === null || _ellipsis$current3 === void 0 ? void 0 : (_ellipsis$current3$ta = _ellipsis$current3.tailing) === null || _ellipsis$current3$ta === void 0 ? void 0 : _ellipsis$current3$ta.slice(1, (_ellipsis$current4 = ellipsis.current) === null || _ellipsis$current4 === void 0 ? void 0 : _ellipsis$current4.tailing.length);
195
183
  }
196
- case 4:
197
- case "end":
198
- return _context4.stop();
199
- }
184
+ assignContent();
185
+ setTimeout(function () {
186
+ verifyEllipsis();
187
+ }, 100);
188
+ }
189
+ case 4:
190
+ case "end":
191
+ return _context4.stop();
200
192
  }
201
193
  }, _callee4);
202
194
  }));
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var _excluded = ["children", "type", "name", "defaultValue", "placeholder", "label", "labelClass", "labelWidth", "labelAlign", "colon", "inputAlign", "center", "required", "disabled", "readonly", "error", "maxlength", "leftIcon", "leftIconSize", "rightIcon", "rightIconSize", "clearable", "clearIcon", "clearSize", "border", "formatTrigger", "rules", "errorMessage", "errorMessageAlign", "showWordLimit", "autofocus", "style", "className", "rows", "slotButton", "slotInput", "onChange", "onBlur", "onFocus", "onClear", "formatter", "keypress", "onClickInput", "onClickLeftIcon", "onClickRightIcon", "onClick", "change", "blur", "focus", "clear", "clickInput", "clickLeftIcon", "clickRightIcon", "click", "iconClassPrefix", "iconFontClassName"];
4
+ var _excluded = ["children", "type", "name", "defaultValue", "placeholder", "label", "labelClass", "labelWidth", "labelAlign", "colon", "inputAlign", "center", "required", "disabled", "readonly", "error", "maxlength", "leftIcon", "leftIconSize", "rightIcon", "rightIconSize", "clearable", "clearIcon", "clearSize", "border", "formatTrigger", "rules", "errorMessage", "errorMessageAlign", "showWordLimit", "autofocus", "style", "className", "rows", "slotButton", "slotInput", "onChange", "onBlur", "onFocus", "onClear", "formatter", "keypress", "onClickInput", "onClickLeftIcon", "onClickRightIcon", "onClick", "iconClassPrefix", "iconFontClassName"];
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  import React__default, { forwardRef, useState, useRef, useLayoutEffect, useEffect, useImperativeHandle, useCallback } from 'react';
@@ -119,14 +119,6 @@ var Input = forwardRef(function (props, ref) {
119
119
  onClickLeftIcon = _defaultProps$props.onClickLeftIcon,
120
120
  onClickRightIcon = _defaultProps$props.onClickRightIcon,
121
121
  _onClick = _defaultProps$props.onClick,
122
- change = _defaultProps$props.change,
123
- blur = _defaultProps$props.blur,
124
- focus = _defaultProps$props.focus,
125
- clear = _defaultProps$props.clear,
126
- clickInput = _defaultProps$props.clickInput,
127
- clickLeftIcon = _defaultProps$props.clickLeftIcon,
128
- clickRightIcon = _defaultProps$props.clickRightIcon,
129
- click = _defaultProps$props.click,
130
122
  iconClassPrefix = _defaultProps$props.iconClassPrefix,
131
123
  iconFontClassName = _defaultProps$props.iconFontClassName,
132
124
  rest = _objectWithoutProperties(_defaultProps$props, _excluded);
@@ -148,7 +140,9 @@ var Input = forwardRef(function (props, ref) {
148
140
  };
149
141
  var inputRef = useRef(null);
150
142
  useLayoutEffect(function () {
151
- updateValue(getModelValue(), formatTrigger);
143
+ if (defaultValue) {
144
+ updateValue(getModelValue(), formatTrigger);
145
+ }
152
146
  });
153
147
  useEffect(function () {
154
148
  setClasses(inputClass);
@@ -166,10 +160,15 @@ var Input = forwardRef(function (props, ref) {
166
160
  var inputClass = useCallback(function () {
167
161
  var prefixCls = 'nut-input';
168
162
  return [prefixCls, "".concat(center ? 'center' : ''), "".concat(disabled ? "".concat(prefixCls, "-disabled") : ''), "".concat(required ? "".concat(prefixCls, "-required") : ''), "".concat(error ? "".concat(prefixCls, "-error") : ''), "".concat(border ? "".concat(prefixCls, "-border") : ''), "".concat(slotButton || rightIcon ? "".concat(prefixCls, "-right-mark") : '')].filter(Boolean).join(' ');
169
- }, [disabled, required, error, border]);
163
+ }, [disabled, required, error, border, slotButton, rightIcon, center]);
164
+ // 样式状态重置
165
+ useEffect(function () {
166
+ setClasses(inputClass);
167
+ }, [disabled, required, error, border, slotButton, rightIcon, center]);
170
168
  var updateValue = function updateValue(value) {
171
169
  var _inputRef$current;
172
170
  var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'onChange';
171
+ var event = arguments.length > 2 ? arguments[2] : undefined;
173
172
  var val = value;
174
173
  if (type === 'digit' || type === 'tel') {
175
174
  val = formatNumber(val, false, false);
@@ -188,25 +187,20 @@ var Input = forwardRef(function (props, ref) {
188
187
  if ((inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value) !== val) {
189
188
  inputRef.current.value = val;
190
189
  }
191
- // if (val !== defaultValue) {
192
190
  SetInputValue(val);
193
- // }
191
+ onChange && onChange(val, event);
194
192
  };
195
-
196
193
  var handleFocus = function handleFocus(event) {
197
194
  var val = event.target.value;
198
195
  SetActive(true);
199
196
  onFocus && onFocus(val, event);
200
- focus && focus(val, event);
201
197
  };
202
198
  var handleInput = function handleInput(event) {
203
199
  var val = event.target.value;
204
200
  if (maxlength && val.length > Number(maxlength)) {
205
201
  val = val.slice(0, Number(maxlength));
206
202
  }
207
- updateValue(val);
208
- onChange && onChange(val, event);
209
- change && change(val, event);
203
+ updateValue(val, 'onChange', event);
210
204
  };
211
205
  var handleBlur = function handleBlur(event) {
212
206
  setTimeout(function () {
@@ -218,19 +212,15 @@ var Input = forwardRef(function (props, ref) {
218
212
  }
219
213
  updateValue(getModelValue(), 'onBlur');
220
214
  onBlur && onBlur(val, event);
221
- blur && blur(val, event);
222
215
  };
223
216
  var handleClickInput = function handleClickInput(event) {
224
217
  onClickInput && onClickInput(event);
225
- clickInput && clickInput(event);
226
218
  };
227
219
  var handleClickLeftIcon = function handleClickLeftIcon(event) {
228
220
  onClickLeftIcon && onClickLeftIcon(event);
229
- clickLeftIcon && clickLeftIcon(event);
230
221
  };
231
222
  var handleClickRightIcon = function handleClickRightIcon(event) {
232
223
  onClickRightIcon && onClickRightIcon(event);
233
- clickRightIcon && clickRightIcon(event);
234
224
  };
235
225
  var resetValidation = function resetValidation() {};
236
226
  var inputType = function inputType(type) {
@@ -245,14 +235,12 @@ var Input = forwardRef(function (props, ref) {
245
235
  var handleClear = function handleClear(event) {
246
236
  updateValue('');
247
237
  onClear && onClear('', event);
248
- clear && clear('', event);
249
238
  };
250
239
  return React__default.createElement("div", {
251
240
  className: "".concat(classes, " ").concat(className || ''),
252
241
  style: style,
253
242
  onClick: function onClick(e) {
254
243
  _onClick && _onClick(e);
255
- click && click(e);
256
244
  }
257
245
  }, slotInput ? React__default.createElement(React__default.Fragment, null, label ? React__default.createElement("div", {
258
246
  className: "nut-input-label ".concat(labelClass),
@@ -91,22 +91,20 @@ var MenuItem = forwardRef(function (props, ref) {
91
91
  setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
92
92
  var p, rect;
93
93
  return _regeneratorRuntime.wrap(function _callee$(_context) {
94
- while (1) {
95
- switch (_context.prev = _context.next) {
96
- case 0:
97
- p = parent.parent().current;
98
- _context.next = 3;
99
- return p.getBoundingClientRect();
100
- case 3:
101
- rect = _context.sent;
102
- setPosition({
103
- height: rect.height,
104
- top: rect.top
105
- });
106
- case 5:
107
- case "end":
108
- return _context.stop();
109
- }
94
+ while (1) switch (_context.prev = _context.next) {
95
+ case 0:
96
+ p = parent.parent().current;
97
+ _context.next = 3;
98
+ return p.getBoundingClientRect();
99
+ case 3:
100
+ rect = _context.sent;
101
+ setPosition({
102
+ height: rect.height,
103
+ top: rect.top
104
+ });
105
+ case 5:
106
+ case "end":
107
+ return _context.stop();
110
108
  }
111
109
  }, _callee);
112
110
  })));
@@ -146,39 +146,37 @@ var NoticeBar = function NoticeBar(props) {
146
146
  setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
147
147
  var warpRes, contentRes, wrapW, offsetW, canScroll;
148
148
  return _regeneratorRuntime.wrap(function _callee$(_context) {
149
- while (1) {
150
- switch (_context.prev = _context.next) {
151
- case 0:
152
- if (!(!wrap.current || !content.current)) {
153
- _context.next = 2;
154
- break;
155
- }
156
- return _context.abrupt("return");
157
- case 2:
158
- _context.next = 4;
159
- return getRectByTaro(wrap.current);
160
- case 4:
161
- warpRes = _context.sent;
162
- _context.next = 7;
163
- return getRectByTaro(content.current);
164
- case 7:
165
- contentRes = _context.sent;
166
- wrapW = warpRes.width;
167
- offsetW = contentRes.width;
168
- canScroll = scrollable == null ? offsetW > wrapW : scrollable;
169
- SetIsCanScroll(canScroll);
170
- if (canScroll) {
171
- SetWrapWidth(wrapW);
172
- SetOffsetW(offsetW);
173
- SetDuration(offsetW / speed);
174
- SetAnimationClass('play');
175
- } else {
176
- SetAnimationClass('');
177
- }
178
- case 13:
179
- case "end":
180
- return _context.stop();
181
- }
149
+ while (1) switch (_context.prev = _context.next) {
150
+ case 0:
151
+ if (!(!wrap.current || !content.current)) {
152
+ _context.next = 2;
153
+ break;
154
+ }
155
+ return _context.abrupt("return");
156
+ case 2:
157
+ _context.next = 4;
158
+ return getRectByTaro(wrap.current);
159
+ case 4:
160
+ warpRes = _context.sent;
161
+ _context.next = 7;
162
+ return getRectByTaro(content.current);
163
+ case 7:
164
+ contentRes = _context.sent;
165
+ wrapW = warpRes.width;
166
+ offsetW = contentRes.width;
167
+ canScroll = scrollable == null ? offsetW > wrapW : scrollable;
168
+ SetIsCanScroll(canScroll);
169
+ if (canScroll) {
170
+ SetWrapWidth(wrapW);
171
+ SetOffsetW(offsetW);
172
+ SetDuration(offsetW / speed);
173
+ SetAnimationClass('play');
174
+ } else {
175
+ SetAnimationClass('');
176
+ }
177
+ case 13:
178
+ case "end":
179
+ return _context.stop();
182
180
  }
183
181
  }, _callee);
184
182
  })), 0);
@@ -22,21 +22,21 @@ export { P as Pagination } from './pagination.taro-9925ffab.js';
22
22
  export { T as Tabs } from './tabs.taro-e71875fa.js';
23
23
  export { T as TabPane } from './tabpane.taro-91cd6cf4.js';
24
24
  export { I as Indicator } from './indicator.taro-183ea169.js';
25
- export { S as SideNavBar } from './sidenavbar.taro-a828250a.js';
26
- export { S as SubSideNavBar } from './subsidenavbar.taro-4c80ad38.js';
25
+ export { S as SideNavBar } from './sidenavbar.taro-3b1f1218.js';
26
+ export { S as SubSideNavBar } from './subsidenavbar.taro-f46b4c73.js';
27
27
  export { S as SideNavBarItem } from './sidenavbaritem.taro-fee11d26.js';
28
28
  export { M as Menu } from './menu.taro-4abed328.js';
29
29
  export { M as MenuItem } from './menuitem.taro-2f8e69a4.js';
30
30
  export { R as Range } from './range.taro-4cbe2469.js';
31
31
  export { C as Calendar } from './calendar.taro-93b14945.js';
32
32
  export { C as Checkbox, a as CheckboxGroup } from './checkbox.taro-0bda9796.js';
33
- export { D as DatePicker } from './datepicker.taro-00a72ca3.js';
33
+ export { D as DatePicker } from './datepicker.taro-7de67b85.js';
34
34
  export { I as InputNumber } from './inputnumber.taro-0a01f6e1.js';
35
- export { I as Input } from './input.taro-65db24c3.js';
35
+ export { I as Input } from './input.taro-8b3f8381.js';
36
36
  export { R as Radio, a as RadioGroup } from './index.taro-a36f96fb.js';
37
37
  export { R as Rate } from './rate.taro-10197384.js';
38
38
  export { C as CalendarItem } from './calendaritem.taro-85a8c4fc.js';
39
- export { P as Picker } from './picker.taro-e23bc9d1.js';
39
+ export { P as Picker } from './picker.taro-9b7263ca.js';
40
40
  export { S as ShortPassword } from './shortpassword.taro-4bd513ae.js';
41
41
  export { T as TextArea } from './textarea.taro-83d5fe73.js';
42
42
  export { U as Uploader } from './uploader.taro-a1edf38f.js';
@@ -104,7 +104,7 @@ import './UserContext-be8097d2.js';
104
104
  import './grid.taro.context-39636af9.js';
105
105
  import './configprovider-c7d60e20.js';
106
106
  import '@tarojs/components';
107
- import './offsetContext-0e3d04b3.js';
107
+ import './offsetContext-bfb02c25.js';
108
108
  import './useTouch-a2ea68c6.js';
109
109
  import './useClientRect-bf69d7b3.js';
110
110
  import './icon-8dc4de10.js';
@@ -0,0 +1,3 @@
1
+ import { createContext } from 'react';
2
+ var OffsetContext = createContext(20);
3
+ export { OffsetContext as O };
@@ -86,7 +86,6 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
86
86
  setScrollDistance(translateY);
87
87
  };
88
88
  var setMove = function setMove(move, type, time) {
89
- console.log('move');
90
89
  var updateMove = move + transformY.current;
91
90
  if (type === 'end') {
92
91
  // 限定滚动距离
@@ -201,20 +200,17 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
201
200
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
202
201
  var refe;
203
202
  return _regeneratorRuntime.wrap(function _callee$(_context) {
204
- while (1) {
205
- switch (_context.prev = _context.next) {
206
- case 0:
207
- _context.next = 2;
208
- return getRectByTaro(listbox === null || listbox === void 0 ? void 0 : listbox.current);
209
- case 2:
210
- refe = _context.sent;
211
- console.log(refe);
212
- lineSpacing.current = refe.height ? refe.height : 36;
213
- modifyStatus(true);
214
- case 6:
215
- case "end":
216
- return _context.stop();
217
- }
203
+ while (1) switch (_context.prev = _context.next) {
204
+ case 0:
205
+ _context.next = 2;
206
+ return getRectByTaro(listbox === null || listbox === void 0 ? void 0 : listbox.current);
207
+ case 2:
208
+ refe = _context.sent;
209
+ lineSpacing.current = refe.height ? refe.height : 36;
210
+ modifyStatus(true);
211
+ case 5:
212
+ case "end":
213
+ return _context.stop();
218
214
  }
219
215
  }, _callee);
220
216
  }));
@@ -113,23 +113,21 @@ var Popover = function Popover(props) {
113
113
  setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
114
114
  var res;
115
115
  return _regeneratorRuntime.wrap(function _callee$(_context) {
116
- while (1) {
117
- switch (_context.prev = _context.next) {
118
- case 0:
119
- if (!goodItem.current) {
120
- _context.next = 6;
121
- break;
122
- }
123
- _context.next = 3;
124
- return getRectByTaro(goodItem.current);
125
- case 3:
126
- res = _context.sent;
127
- setElWidth(res === null || res === void 0 ? void 0 : res.width);
128
- setElHeight(res === null || res === void 0 ? void 0 : res.height);
129
- case 6:
130
- case "end":
131
- return _context.stop();
132
- }
116
+ while (1) switch (_context.prev = _context.next) {
117
+ case 0:
118
+ if (!goodItem.current) {
119
+ _context.next = 6;
120
+ break;
121
+ }
122
+ _context.next = 3;
123
+ return getRectByTaro(goodItem.current);
124
+ case 3:
125
+ res = _context.sent;
126
+ setElWidth(res === null || res === void 0 ? void 0 : res.width);
127
+ setElHeight(res === null || res === void 0 ? void 0 : res.height);
128
+ case 6:
129
+ case "end":
130
+ return _context.stop();
133
131
  }
134
132
  }, _callee);
135
133
  })));