@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.
- package/CHANGELOG.md +7 -0
- package/README.md +4 -4
- package/dist/esm/DatePicker.js +3 -3
- package/dist/esm/Input.js +2 -2
- package/dist/esm/Picker.js +2 -2
- package/dist/esm/SideNavBar.js +3 -3
- package/dist/esm/SubSideNavBar.js +3 -3
- package/dist/esm/address.taro-c03b8b16.js +23 -21
- package/dist/esm/barrage.taro-d86c367a.js +22 -24
- package/dist/esm/calendaritem.taro-85a8c4fc.js +16 -18
- package/dist/esm/cascader.taro-459f7d45.js +234 -244
- package/dist/esm/{datepicker.taro-00a72ca3.js → datepicker.taro-7de67b85.js} +1 -1
- package/dist/esm/ellipsis.taro-c0de6ff4.js +76 -84
- package/dist/esm/{input.taro-65db24c3.js → input.taro-8b3f8381.js} +12 -24
- package/dist/esm/menuitem.taro-2f8e69a4.js +14 -16
- package/dist/esm/noticebar.taro-43c18dc9.js +31 -33
- package/dist/esm/nutui-react.es.js +6 -6
- package/dist/esm/offsetContext-bfb02c25.js +3 -0
- package/dist/esm/{picker.taro-e23bc9d1.js → picker.taro-9b7263ca.js} +11 -15
- package/dist/esm/popover.taro-7e5dff8c.js +15 -17
- package/dist/esm/pulltorefresh.taro-f26a20dd.js +75 -81
- package/dist/esm/range.taro-4cbe2469.js +67 -71
- package/dist/esm/{sidenavbar.taro-a828250a.js → sidenavbar.taro-3b1f1218.js} +13 -5
- package/dist/esm/{subsidenavbar.taro-4c80ad38.js → subsidenavbar.taro-f46b4c73.js} +12 -11
- package/dist/esm/swipe.taro-83bc248f.js +35 -37
- package/dist/esm/swiper.taro-852f6615.js +26 -28
- package/dist/esm/types/src/packages/input/input.d.ts +0 -8
- package/dist/esm/types/src/packages/input/input.taro.d.ts +0 -8
- package/dist/esm/useClientRect-bf69d7b3.js +10 -12
- package/dist/locales/base.js +2 -2
- package/dist/locales/en-US.js +2 -2
- package/dist/locales/id-ID.js +2 -2
- package/dist/locales/zh-CN.js +2 -2
- package/dist/locales/zh-TW.js +2 -2
- package/dist/locales/zh-UG.js +2 -2
- package/dist/nutui.react.es.js +66 -88
- package/dist/nutui.react.umd.js +66 -88
- package/dist/packages/input/input.scss +12 -12
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -2
- package/dist/types/index.d.ts +0 -8
- package/package.json +1 -1
- 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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
145
|
-
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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", "
|
|
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
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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-
|
|
26
|
-
export { S as SubSideNavBar } from './subsidenavbar.taro-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
107
|
+
import './offsetContext-bfb02c25.js';
|
|
108
108
|
import './useTouch-a2ea68c6.js';
|
|
109
109
|
import './useClientRect-bf69d7b3.js';
|
|
110
110
|
import './icon-8dc4de10.js';
|
|
@@ -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
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
})));
|