@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
|
@@ -122,88 +122,82 @@ var PullToRefresh = function PullToRefresh(p) {
|
|
|
122
122
|
function _doRefresh() {
|
|
123
123
|
_doRefresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
124
124
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
125
|
-
while (1) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
throw _context3.t0;
|
|
169
|
-
case 12:
|
|
170
|
-
if (!(props.completeDelay > 0)) {
|
|
171
|
-
_context3.next = 15;
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
125
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
126
|
+
case 0:
|
|
127
|
+
api.start({
|
|
128
|
+
height: headHeight
|
|
129
|
+
});
|
|
130
|
+
setStatus('refreshing');
|
|
131
|
+
_context3.prev = 2;
|
|
132
|
+
_context3.next = 5;
|
|
133
|
+
return props.onRefresh();
|
|
134
|
+
case 5:
|
|
135
|
+
setStatus('complete');
|
|
136
|
+
_context3.next = 12;
|
|
137
|
+
break;
|
|
138
|
+
case 8:
|
|
139
|
+
_context3.prev = 8;
|
|
140
|
+
_context3.t0 = _context3["catch"](2);
|
|
141
|
+
api.start({
|
|
142
|
+
to: function () {
|
|
143
|
+
var _to = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(next) {
|
|
144
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
145
|
+
while (1) switch (_context.prev = _context.next) {
|
|
146
|
+
case 0:
|
|
147
|
+
_context.next = 2;
|
|
148
|
+
return next({
|
|
149
|
+
height: 0
|
|
150
|
+
});
|
|
151
|
+
case 2:
|
|
152
|
+
setStatus('pulling');
|
|
153
|
+
case 3:
|
|
154
|
+
case "end":
|
|
155
|
+
return _context.stop();
|
|
156
|
+
}
|
|
157
|
+
}, _callee);
|
|
158
|
+
}));
|
|
159
|
+
function to(_x) {
|
|
160
|
+
return _to.apply(this, arguments);
|
|
161
|
+
}
|
|
162
|
+
return to;
|
|
163
|
+
}()
|
|
164
|
+
});
|
|
165
|
+
throw _context3.t0;
|
|
166
|
+
case 12:
|
|
167
|
+
if (!(props.completeDelay > 0)) {
|
|
174
168
|
_context3.next = 15;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
})
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
_context3.next = 15;
|
|
172
|
+
return sleep(props.completeDelay);
|
|
173
|
+
case 15:
|
|
174
|
+
api.start({
|
|
175
|
+
to: function () {
|
|
176
|
+
var _to2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(next) {
|
|
177
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
178
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
179
|
+
case 0:
|
|
180
|
+
_context2.next = 2;
|
|
181
|
+
return next({
|
|
182
|
+
height: 0
|
|
183
|
+
});
|
|
184
|
+
case 2:
|
|
185
|
+
setStatus('pulling');
|
|
186
|
+
case 3:
|
|
187
|
+
case "end":
|
|
188
|
+
return _context2.stop();
|
|
189
|
+
}
|
|
190
|
+
}, _callee2);
|
|
191
|
+
}));
|
|
192
|
+
function to(_x2) {
|
|
193
|
+
return _to2.apply(this, arguments);
|
|
194
|
+
}
|
|
195
|
+
return to;
|
|
196
|
+
}()
|
|
197
|
+
});
|
|
198
|
+
case 16:
|
|
199
|
+
case "end":
|
|
200
|
+
return _context3.stop();
|
|
207
201
|
}
|
|
208
202
|
}, _callee3, null, [[2, 8]]);
|
|
209
203
|
}));
|
|
@@ -244,43 +244,41 @@ var Range = function Range(props) {
|
|
|
244
244
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
245
245
|
var rect, delta, total, value, _currentValue, _currentValue2, left, right, middle;
|
|
246
246
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
247
|
-
while (1) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
updateValue([value, right], true);
|
|
274
|
-
} else {
|
|
275
|
-
updateValue([left, value], true);
|
|
276
|
-
}
|
|
247
|
+
while (1) switch (_context.prev = _context.next) {
|
|
248
|
+
case 0:
|
|
249
|
+
if (!(disabled || !root.current)) {
|
|
250
|
+
_context.next = 2;
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
return _context.abrupt("return");
|
|
254
|
+
case 2:
|
|
255
|
+
SetDragStatus('');
|
|
256
|
+
_context.next = 5;
|
|
257
|
+
return getRectByTaro(root.current);
|
|
258
|
+
case 5:
|
|
259
|
+
rect = _context.sent;
|
|
260
|
+
delta = (event.detail.x ? event.detail.x : event.clientX) - rect.left;
|
|
261
|
+
total = rect.width;
|
|
262
|
+
if (vertical) {
|
|
263
|
+
delta = (event.detail.y ? event.detail.y : event.clientY) - rect.top;
|
|
264
|
+
total = rect.height;
|
|
265
|
+
}
|
|
266
|
+
value = Number(min) + delta / total * scope();
|
|
267
|
+
currentValue = initValue || initValue === 0 ? initValue : modelValue;
|
|
268
|
+
if (isRange(currentValue)) {
|
|
269
|
+
_currentValue = currentValue, _currentValue2 = _slicedToArray(_currentValue, 2), left = _currentValue2[0], right = _currentValue2[1];
|
|
270
|
+
middle = (left + right) / 2;
|
|
271
|
+
if (value <= middle) {
|
|
272
|
+
updateValue([value, right], true);
|
|
277
273
|
} else {
|
|
278
|
-
updateValue(value, true);
|
|
274
|
+
updateValue([left, value], true);
|
|
279
275
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
276
|
+
} else {
|
|
277
|
+
updateValue(value, true);
|
|
278
|
+
}
|
|
279
|
+
case 12:
|
|
280
|
+
case "end":
|
|
281
|
+
return _context.stop();
|
|
284
282
|
}
|
|
285
283
|
}, _callee);
|
|
286
284
|
}));
|
|
@@ -305,43 +303,41 @@ var Range = function Range(props) {
|
|
|
305
303
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(event) {
|
|
306
304
|
var rect, delta, total, diff;
|
|
307
305
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
308
|
-
while (1) {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
306
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
307
|
+
case 0:
|
|
308
|
+
if (!(disabled || !root.current)) {
|
|
309
|
+
_context2.next = 2;
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
return _context2.abrupt("return");
|
|
313
|
+
case 2:
|
|
314
|
+
if (dragStatus === 'start') {
|
|
315
|
+
dragStart && dragStart();
|
|
316
|
+
onDragStart && onDragStart();
|
|
317
|
+
}
|
|
318
|
+
touch.move(event);
|
|
319
|
+
SetDragStatus('draging');
|
|
320
|
+
_context2.next = 7;
|
|
321
|
+
return getRectByTaro(root.current);
|
|
322
|
+
case 7:
|
|
323
|
+
rect = _context2.sent;
|
|
324
|
+
delta = touch.deltaX;
|
|
325
|
+
total = rect.width;
|
|
326
|
+
diff = delta / total * scope();
|
|
327
|
+
if (vertical) {
|
|
328
|
+
delta = touch.deltaY;
|
|
329
|
+
total = rect.height;
|
|
329
330
|
diff = delta / total * scope();
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
updateValue(currentValue);
|
|
341
|
-
case 14:
|
|
342
|
-
case "end":
|
|
343
|
-
return _context2.stop();
|
|
344
|
-
}
|
|
331
|
+
}
|
|
332
|
+
if (isRange(startValue)) {
|
|
333
|
+
currentValue[buttonIndex] = startValue[buttonIndex] + diff;
|
|
334
|
+
} else {
|
|
335
|
+
currentValue = startValue + diff;
|
|
336
|
+
}
|
|
337
|
+
updateValue(currentValue);
|
|
338
|
+
case 14:
|
|
339
|
+
case "end":
|
|
340
|
+
return _context2.stop();
|
|
345
341
|
}
|
|
346
342
|
}, _callee2);
|
|
347
343
|
}));
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
var _excluded = ["title", "visible", "width", "position", "children", "className", "showhead", "onClose"];
|
|
4
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; }
|
|
5
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; }
|
|
6
|
-
import React__default from 'react';
|
|
7
|
+
import React__default, { useState } from 'react';
|
|
7
8
|
import { u as useConfig } from './configprovider.taro-8bdb3a28.js';
|
|
8
9
|
import { P as Popup } from './popup.taro-33d0bbc8.js';
|
|
9
|
-
import {
|
|
10
|
+
import { O as OffsetContext } from './offsetContext-bfb02c25.js';
|
|
10
11
|
var defaultProps = {
|
|
11
12
|
showhead: false,
|
|
12
13
|
position: 'left',
|
|
@@ -25,6 +26,13 @@ var SideNavBar = function SideNavBar(props) {
|
|
|
25
26
|
onClose = _defaultProps$props.onClose,
|
|
26
27
|
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
27
28
|
var offset = props.offset ? Number(props.offset) : 20;
|
|
29
|
+
var _useState = useState(true),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
sidenavbarShow = _useState2[0],
|
|
32
|
+
setSidenavbarShow = _useState2[1];
|
|
33
|
+
var handleClick = function handleClick() {
|
|
34
|
+
setSidenavbarShow(!sidenavbarShow);
|
|
35
|
+
};
|
|
28
36
|
return React__default.createElement(Popup, {
|
|
29
37
|
visible: visible,
|
|
30
38
|
style: {
|
|
@@ -38,15 +46,15 @@ var SideNavBar = function SideNavBar(props) {
|
|
|
38
46
|
}, rest), React__default.createElement("div", {
|
|
39
47
|
className: "nut-sidenavbar__content"
|
|
40
48
|
}, React__default.createElement("div", {
|
|
41
|
-
className: "nut-sidenavbar__list nutShow
|
|
49
|
+
className: "nut-sidenavbar__list ".concat(sidenavbarShow ? 'nutShow' : 'nutHide'),
|
|
42
50
|
onClick: handleClick
|
|
43
51
|
}, React__default.createElement("div", {
|
|
44
52
|
className: "nut-sidenavbar__title border-bt ",
|
|
45
53
|
style: {
|
|
46
54
|
paddingLeft: "".concat(offset, "px")
|
|
47
55
|
}
|
|
48
|
-
}, title,
|
|
49
|
-
className: "arrow-icon arrow-down
|
|
56
|
+
}, title, React__default.createElement("i", {
|
|
57
|
+
className: "arrow-icon ".concat(sidenavbarShow ? 'arrow-up' : 'arrow-down')
|
|
50
58
|
})), React__default.createElement(OffsetContext.Provider, {
|
|
51
59
|
value: offset
|
|
52
60
|
}, React__default.createElement("div", {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
var _excluded = ["title", "ikey", "children", "onClick", "open"];
|
|
4
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; }
|
|
5
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; }
|
|
6
|
-
import React__default, { useContext, useRef, useCallback, useEffect } from 'react';
|
|
7
|
-
import { O as OffsetContext
|
|
7
|
+
import React__default, { useState, useContext, useRef, useCallback, useEffect } from 'react';
|
|
8
|
+
import { O as OffsetContext } from './offsetContext-bfb02c25.js';
|
|
8
9
|
var defaultProps = {
|
|
9
10
|
open: true
|
|
10
11
|
};
|
|
@@ -16,15 +17,16 @@ var SubSideNavBar = function SubSideNavBar(props) {
|
|
|
16
17
|
onClick = _defaultProps$props.onClick,
|
|
17
18
|
open = _defaultProps$props.open,
|
|
18
19
|
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
19
|
-
|
|
20
|
+
var _useState = useState(open),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
subShow = _useState2[0],
|
|
23
|
+
setSubShow = _useState2[1];
|
|
20
24
|
var offset = useContext(OffsetContext);
|
|
21
|
-
console.log('offset>>>>>>>', offset);
|
|
22
25
|
var listRef = useRef(null);
|
|
23
26
|
var setListLevel = useCallback(function (nodeList) {
|
|
24
27
|
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
25
28
|
var titleClass = nodeList[0].className;
|
|
26
29
|
if (titleClass.includes('nut-subsidenavbar__title')) {
|
|
27
|
-
// const left = 15 + offset * level
|
|
28
30
|
var left = offset * (level + 1);
|
|
29
31
|
nodeList[0].style.paddingLeft = "".concat(left, "px");
|
|
30
32
|
}
|
|
@@ -34,7 +36,6 @@ var SubSideNavBar = function SubSideNavBar(props) {
|
|
|
34
36
|
childNodes.forEach(function (item) {
|
|
35
37
|
var itemClass = item.className;
|
|
36
38
|
if (itemClass.includes('nut-subsidenavbar__item')) {
|
|
37
|
-
// const left = 15 + offset * (level + 1)
|
|
38
39
|
var _left = offset * (level + 2);
|
|
39
40
|
item.style.paddingLeft = "".concat(_left, "px");
|
|
40
41
|
}
|
|
@@ -47,9 +48,9 @@ var SubSideNavBar = function SubSideNavBar(props) {
|
|
|
47
48
|
});
|
|
48
49
|
}, [offset]);
|
|
49
50
|
var clickFn = function clickFn(e) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var isShow =
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
setSubShow(!subShow);
|
|
53
|
+
var isShow = !subShow;
|
|
53
54
|
onClick && onClick({
|
|
54
55
|
title: title,
|
|
55
56
|
ikey: ikey,
|
|
@@ -62,8 +63,8 @@ var SubSideNavBar = function SubSideNavBar(props) {
|
|
|
62
63
|
(_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 ? void 0 : _listRef$current2.setAttribute('level', '1');
|
|
63
64
|
childNodes && setListLevel(childNodes);
|
|
64
65
|
}, [setListLevel]);
|
|
65
|
-
var divClass =
|
|
66
|
-
var iconClass =
|
|
66
|
+
var divClass = subShow ? 'nut-subsidenavbar__list nutShow' : 'nut-subsidenavbar__list nutHide';
|
|
67
|
+
var iconClass = subShow ? 'arrow-icon arrow-down' : 'arrow-icon arrow-up';
|
|
67
68
|
return React__default.createElement("div", _objectSpread({
|
|
68
69
|
className: divClass,
|
|
69
70
|
ref: listRef,
|
|
@@ -60,45 +60,43 @@ var Swipe = forwardRef(function (props, instanceRef) {
|
|
|
60
60
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
61
61
|
var leftRect, rightRect;
|
|
62
62
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
63
|
-
while (1) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
left: leftRect.width
|
|
77
|
-
});
|
|
63
|
+
while (1) switch (_context.prev = _context.next) {
|
|
64
|
+
case 0:
|
|
65
|
+
if (!leftWrapper.current) {
|
|
66
|
+
_context.next = 5;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
_context.next = 3;
|
|
70
|
+
return getRectByTaro(leftWrapper.current);
|
|
71
|
+
case 3:
|
|
72
|
+
leftRect = _context.sent;
|
|
73
|
+
setActionWidth(function (v) {
|
|
74
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
75
|
+
left: leftRect.width
|
|
78
76
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
77
|
+
});
|
|
78
|
+
case 5:
|
|
79
|
+
if (!rightWrapper.current) {
|
|
80
|
+
_context.next = 10;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
_context.next = 8;
|
|
84
|
+
return getRectByTaro(rightWrapper.current);
|
|
85
|
+
case 8:
|
|
86
|
+
rightRect = _context.sent;
|
|
87
|
+
setActionWidth(function (v) {
|
|
88
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
89
|
+
right: rightRect.width
|
|
92
90
|
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
});
|
|
92
|
+
case 10:
|
|
93
|
+
if (!props.disabled) {
|
|
94
|
+
startOffset.current = state.offset;
|
|
95
|
+
touch.start(event);
|
|
96
|
+
}
|
|
97
|
+
case 11:
|
|
98
|
+
case "end":
|
|
99
|
+
return _context.stop();
|
|
102
100
|
}
|
|
103
101
|
}, _callee);
|
|
104
102
|
}));
|
|
@@ -398,34 +398,32 @@ var Swiper = React__default.forwardRef(function (props, ref) {
|
|
|
398
398
|
targetOffset,
|
|
399
399
|
_args = arguments;
|
|
400
400
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
401
|
-
while (1) {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
return _context.stop();
|
|
428
|
-
}
|
|
401
|
+
while (1) switch (_context.prev = _context.next) {
|
|
402
|
+
case 0:
|
|
403
|
+
active = _args.length > 0 && _args[0] !== undefined ? _args[0] : +propSwiper.initPage;
|
|
404
|
+
_context.next = 3;
|
|
405
|
+
return queryRect(container.current);
|
|
406
|
+
case 3:
|
|
407
|
+
rect = _context.sent;
|
|
408
|
+
_active = Math.max(Math.min(childCount - 1, active), 0);
|
|
409
|
+
_width = propSwiper.width ? +propSwiper.width : rect === null || rect === void 0 ? void 0 : rect.width;
|
|
410
|
+
_height = propSwiper.height ? +propSwiper.height : rect === null || rect === void 0 ? void 0 : rect.height;
|
|
411
|
+
size = isVertical ? _height : _width;
|
|
412
|
+
trackSize = childCount * Number(size);
|
|
413
|
+
targetOffset = getOffset(_active);
|
|
414
|
+
_swiper.current.moving = true;
|
|
415
|
+
if (ready) {
|
|
416
|
+
_swiper.current.moving = false;
|
|
417
|
+
}
|
|
418
|
+
setRect(rect);
|
|
419
|
+
setActive(_active);
|
|
420
|
+
setWidth(_width);
|
|
421
|
+
setHeight(_height);
|
|
422
|
+
setOffset(targetOffset);
|
|
423
|
+
setReady(true);
|
|
424
|
+
case 18:
|
|
425
|
+
case "end":
|
|
426
|
+
return _context.stop();
|
|
429
427
|
}
|
|
430
428
|
}, _callee);
|
|
431
429
|
}));
|
|
@@ -46,14 +46,6 @@ export interface InputProps extends BasicComponent {
|
|
|
46
46
|
slotButton?: React.ReactNode;
|
|
47
47
|
slotInput?: React.ReactNode;
|
|
48
48
|
formatter: (value: string) => void;
|
|
49
|
-
change?: (value: any, event: Event) => void;
|
|
50
|
-
blur?: (value: any, event: Event) => void;
|
|
51
|
-
focus?: (value: any, event: Event) => void;
|
|
52
|
-
clear?: (value: any, event: Event) => void;
|
|
53
|
-
clickInput?: (value: any) => void;
|
|
54
|
-
clickLeftIcon?: (value: any) => void;
|
|
55
|
-
clickRightIcon?: (value: any) => void;
|
|
56
|
-
click?: (value: any) => void;
|
|
57
49
|
onChange?: (value: any, event: Event) => void;
|
|
58
50
|
onBlur?: (value: any, event: Event) => void;
|
|
59
51
|
onFocus?: (value: any, event: Event) => void;
|
|
@@ -55,13 +55,5 @@ export interface InputProps extends BasicComponent {
|
|
|
55
55
|
onClickLeftIcon?: (value: any) => void;
|
|
56
56
|
onClickRightIcon?: (value: any) => void;
|
|
57
57
|
onClick?: (value: any) => void;
|
|
58
|
-
change?: (value: any, event: Event) => void;
|
|
59
|
-
blur?: (value: any, event: Event) => void;
|
|
60
|
-
focus?: (value: any, event: Event) => void;
|
|
61
|
-
clear?: (value: any, event: Event) => void;
|
|
62
|
-
clickInput?: (value: any) => void;
|
|
63
|
-
clickLeftIcon?: (value: any) => void;
|
|
64
|
-
clickRightIcon?: (value: any) => void;
|
|
65
|
-
click?: (value: any) => void;
|
|
66
58
|
}
|
|
67
59
|
export declare const Input: FunctionComponent<Partial<InputProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur' | 'onFocus' | 'onClick'>>;
|
|
@@ -13,18 +13,16 @@ var getRectByTaro = /*#__PURE__*/function () {
|
|
|
13
13
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(element) {
|
|
14
14
|
var res;
|
|
15
15
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
|
-
while (1) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return _context.stop();
|
|
27
|
-
}
|
|
16
|
+
while (1) switch (_context.prev = _context.next) {
|
|
17
|
+
case 0:
|
|
18
|
+
_context.next = 2;
|
|
19
|
+
return element.getBoundingClientRect();
|
|
20
|
+
case 2:
|
|
21
|
+
res = _context.sent;
|
|
22
|
+
return _context.abrupt("return", res);
|
|
23
|
+
case 4:
|
|
24
|
+
case "end":
|
|
25
|
+
return _context.stop();
|
|
28
26
|
}
|
|
29
27
|
}, _callee);
|
|
30
28
|
}));
|