@nutui/nutui-react-taro 1.3.0 → 1.3.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Address.js +4 -4
- package/dist/esm/Audio/style/index.js +4 -0
- package/dist/esm/Audio.js +18 -0
- package/dist/esm/AvatarGroup.js +4 -4
- package/dist/esm/Calendar/style/index.js +1 -2
- package/dist/esm/Calendar.js +6 -5
- package/dist/esm/CalendarItem.js +5 -5
- package/dist/esm/Cascader/style/index.js +2 -0
- package/dist/esm/Cascader.js +14 -0
- package/dist/esm/ConfigProvider.js +3 -3
- package/dist/esm/CountDown.js +4 -4
- package/dist/esm/DatePicker.js +4 -4
- package/dist/esm/Dialog.js +4 -4
- package/dist/esm/Empty.js +4 -4
- package/dist/esm/FixedNav.js +4 -4
- package/dist/esm/Grid/style/index.js +2 -0
- package/dist/esm/Grid.js +7 -0
- package/dist/esm/GridItem/style/index.js +2 -0
- package/dist/esm/GridItem.js +8 -0
- package/dist/esm/ImagePreview/style/index.js +2 -0
- package/dist/esm/ImagePreview.js +15 -0
- package/dist/esm/Infiniteloading.js +4 -4
- package/dist/esm/Input.js +4 -4
- package/dist/esm/Menu/style/index.js +3 -0
- package/dist/esm/Menu.js +7 -0
- package/dist/esm/MenuItem/style/index.js +3 -0
- package/dist/esm/MenuItem.js +11 -0
- package/dist/esm/NoticeBar.js +3 -2
- package/dist/esm/{Notification-dccc7625.js → Notification-422905bd.js} +2 -1
- package/dist/esm/Notify.js +3 -2
- package/dist/esm/NumberKeyboard.js +4 -4
- package/dist/esm/Pagination.js +4 -4
- package/dist/esm/Picker.js +4 -4
- package/dist/esm/Popover.js +3 -2
- package/dist/esm/Range.js +7 -5
- package/dist/esm/SearchBar.js +4 -4
- package/dist/esm/ShortPassword.js +4 -4
- package/dist/esm/SideNavBar.js +4 -4
- package/dist/esm/Signature.js +4 -4
- package/dist/esm/Swipe/style/index.js +2 -0
- package/dist/esm/Swipe.js +7 -0
- package/dist/esm/Swiper.js +3 -2
- package/dist/esm/Table.js +4 -4
- package/dist/esm/TextArea.js +4 -4
- package/dist/esm/TimeDetail.js +4 -4
- package/dist/esm/TimePannel.js +4 -4
- package/dist/esm/TimeSelect.js +4 -4
- package/dist/esm/Toast.js +4 -3
- package/dist/esm/Uploader.js +4 -4
- package/dist/esm/VirtualList.js +4 -4
- package/dist/esm/{address.taro-a1092e30.js → address.taro-4765a826.js} +17 -6
- package/dist/esm/audio.taro-cd6cc93b.js +292 -0
- package/dist/esm/{avatargroup-65173caa.js → avatargroup-1ca79066.js} +1 -1
- package/dist/esm/calendar.taro-1abb1925.js +89 -0
- package/dist/esm/{calendaritem.taro-fe84d94b.js → calendaritem.taro-3c06a809.js} +130 -5
- package/dist/esm/cascader.taro-31dbc60e.js +786 -0
- package/dist/esm/{configprovider-18657611.js → configprovider-9c393a29.js} +1 -1
- package/dist/esm/{configprovider.taro-98343012.js → configprovider.taro-1ff7f150.js} +2 -2
- package/dist/esm/{countdown.taro-cd6a1bd4.js → countdown.taro-b00d0d46.js} +1 -1
- package/dist/esm/{datepicker.taro-c1249537.js → datepicker.taro-e385849d.js} +1 -1
- package/dist/esm/{dialog.taro-5b850861.js → dialog.taro-c80b7b5f.js} +12 -18
- package/dist/esm/{empty.taro-6f86eda5.js → empty.taro-20b8adac.js} +1 -1
- package/dist/esm/{fixednav.taro-ca94fd6a.js → fixednav.taro-75e35339.js} +1 -1
- package/dist/esm/grid.taro-7fb43d02.js +90 -0
- package/dist/esm/griditem.taro-8020b409.js +98 -0
- package/dist/esm/imagepreview.taro-a0ddd8a2.js +813 -0
- package/dist/esm/{infiniteloading.taro-d2c0ca14.js → infiniteloading.taro-0a86819e.js} +1 -1
- package/dist/esm/{input.taro-2e31ebbb.js → input.taro-1d23861d.js} +1 -1
- package/dist/esm/menu.taro-03e3b011.js +153 -0
- package/dist/esm/menuitem.taro-56bf3205.js +195 -0
- package/dist/esm/{noticebar.taro-ae593896.js → noticebar.taro-1890c693.js} +3 -2
- package/dist/esm/{notify.taro-95b5f97e.js → notify.taro-22b8f4cd.js} +2 -1
- package/dist/esm/{numberkeyboard.taro-71b2e0eb.js → numberkeyboard.taro-5d685c76.js} +1 -1
- package/dist/esm/nutui-react.es.js +45 -36
- package/dist/esm/{pagination.taro-abc4a71e.js → pagination.taro-10449c4a.js} +1 -1
- package/dist/esm/{picker.taro-0eb8bfa3.js → picker.taro-216cc3cb.js} +1 -1
- package/dist/esm/{popover.taro-4c102df6.js → popover.taro-9b3da0fa.js} +17 -71
- package/dist/esm/{range.taro-034fcf7a.js → range.taro-fe08c5f4.js} +118 -110
- package/dist/esm/render-4a3856cb.js +32 -0
- package/dist/esm/{searchbar.taro-4c6091cb.js → searchbar.taro-450d2f88.js} +1 -1
- package/dist/esm/{shortpassword.taro-ce46b9cd.js → shortpassword.taro-08a05360.js} +23 -18
- package/dist/esm/{sidenavbar.taro-36f1e118.js → sidenavbar.taro-dd471476.js} +1 -1
- package/dist/esm/{signature.taro-45aedfa9.js → signature.taro-7cb77bab.js} +1 -1
- package/dist/esm/swipe.taro-dfb9a049.js +264 -0
- package/dist/esm/{swiper.taro-59bf2777.js → swiper.taro-7a2ef124.js} +2 -1
- package/dist/esm/{table.taro-49009dfc.js → table.taro-305e0317.js} +1 -1
- package/dist/esm/{textarea.taro-0c40e966.js → textarea.taro-700b04c2.js} +1 -1
- package/dist/esm/{timedetail.taro-0e31b4a5.js → timedetail.taro-7cc00243.js} +1 -1
- package/dist/esm/{timepannel.taro-2d54b3db.js → timepannel.taro-e24537e4.js} +1 -1
- package/dist/esm/{timeselect.taro-c35d3490.js → timeselect.taro-210fd548.js} +1 -1
- package/dist/esm/{toast.taro-48539c09.js → toast.taro-bb181833.js} +1 -1
- package/dist/esm/{uploader.taro-ece83a00.js → uploader.taro-f7528535.js} +1 -1
- package/dist/esm/useClientRect-8b7cc406.js +74 -0
- package/dist/esm/{virtuallist.taro-2ff1a5ad.js → virtuallist.taro-ce9619f9.js} +1 -1
- package/dist/esm/{zh-CN-f5124686.js → zh-CN-91090ae2.js} +16 -0
- package/dist/locales/base.d.ts +16 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +17 -1
- package/dist/locales/id-ID.js +17 -1
- package/dist/locales/zh-CN.js +17 -1
- package/dist/locales/zh-TW.js +17 -1
- package/dist/nutui.react.es.js +5595 -4062
- package/dist/nutui.react.umd.js +20243 -30
- package/dist/packages/audio/audio.scss +80 -0
- package/dist/packages/calendar/calendar.scss +57 -36
- package/dist/packages/calendaritem/calendaritem.scss +0 -191
- package/dist/packages/cascader/cascader.scss +69 -0
- package/dist/packages/grid/grid.scss +10 -0
- package/dist/packages/griditem/griditem.scss +103 -0
- package/dist/packages/imagepreview/imagepreview.scss +51 -0
- package/dist/packages/menu/menu.scss +72 -0
- package/dist/packages/menuitem/menuitem.scss +90 -0
- package/dist/packages/popup/popup.scss +1 -1
- package/dist/packages/searchbar/searchbar.scss +1 -0
- package/dist/packages/shortpassword/shortpassword.scss +6 -1
- package/dist/packages/swipe/swipe.scss +33 -0
- package/dist/packages/textarea/textarea.scss +16 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/iconfont.js +20 -18
- package/dist/styles/themes/default.scss +8 -0
- package/dist/styles/variables.scss +59 -8
- package/dist/types/audio/audio.taro.d.ts +18 -0
- package/dist/types/audio/index.taro.d.ts +2 -0
- package/dist/types/cascader/cascader.taro.d.ts +25 -0
- package/dist/types/cascader/cascaderItem.taro.d.ts +25 -0
- package/dist/types/cascader/index.taro.d.ts +2 -0
- package/dist/types/checkbox/checkbox.taro.d.ts +2 -2
- package/dist/types/checkboxgroup/checkboxgroup.taro.d.ts +2 -2
- package/dist/types/dialog/dialog.taro.d.ts +2 -1
- package/dist/types/grid/grid.taro.d.ts +16 -0
- package/dist/types/grid/index.taro.d.ts +2 -0
- package/dist/types/griditem/griditem.taro.d.ts +20 -0
- package/dist/types/griditem/index.taro.d.ts +2 -0
- package/dist/types/icon/icon.taro.d.ts +1 -2
- package/dist/types/imagepreview/imagepreview.taro.d.ts +26 -0
- package/dist/types/imagepreview/index.taro.d.ts +2 -0
- package/dist/types/menu/index.taro.d.ts +2 -0
- package/dist/types/menu/menu.taro.d.ts +12 -0
- package/dist/types/menuitem/index.taro.d.ts +2 -0
- package/dist/types/menuitem/menuitem.taro.d.ts +23 -0
- package/dist/types/notify/notify.taro.d.ts +13 -0
- package/dist/types/nutui.react.d.ts +95 -1
- package/dist/types/picker/picker.taro.d.ts +2 -2
- package/dist/types/popup/popup.taro.d.ts +1 -1
- package/dist/types/shortpassword/shortpassword.taro.d.ts +3 -3
- package/dist/types/sidenavbar/sidenavbar.taro.d.ts +14 -2
- package/dist/types/sidenavbaritem/sidenavbaritem.taro.d.ts +10 -2
- package/dist/types/subsidenavbar/subsidenavbar.taro.d.ts +13 -3
- package/dist/types/swipe/index.taro.d.ts +2 -0
- package/dist/types/swipe/swipe.taro.d.ts +41 -0
- package/dist/types/table/table.taro.d.ts +2 -1
- package/dist/types/toast/toast.taro.d.ts +18 -0
- package/dist/types/virtuallist/virtuallist.taro.d.ts +2 -1
- package/package.json +4 -4
- package/dist/esm/calendar.taro-4b2103c1.js +0 -621
- package/dist/esm/raf-3fbb5f92.js +0 -126
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
6
6
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -22,6 +22,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
22
22
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
23
23
|
import { I as Icon } from './icon-8dc4de10.js';
|
|
24
24
|
import { O as Overlay } from './overlay-ed3eb37d.js';
|
|
25
|
+
import { g as getRectByTaro } from './useClientRect-8b7cc406.js';
|
|
25
26
|
/**
|
|
26
27
|
* 过滤ref
|
|
27
28
|
*/
|
|
@@ -103,41 +104,6 @@ var Trigger = /*#__PURE__*/function (_React__default$Compo) {
|
|
|
103
104
|
return Trigger;
|
|
104
105
|
}(React__default.Component);
|
|
105
106
|
|
|
106
|
-
var getEleAttr = /*#__PURE__*/function () {
|
|
107
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ele) {
|
|
108
|
-
var res;
|
|
109
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
110
|
-
while (1) {
|
|
111
|
-
switch (_context.prev = _context.next) {
|
|
112
|
-
case 0:
|
|
113
|
-
if (!(ele && ele.getBoundingClientRect)) {
|
|
114
|
-
_context.next = 5;
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
_context.next = 3;
|
|
119
|
-
return ele.getBoundingClientRect();
|
|
120
|
-
|
|
121
|
-
case 3:
|
|
122
|
-
res = _context.sent;
|
|
123
|
-
return _context.abrupt("return", res);
|
|
124
|
-
|
|
125
|
-
case 5:
|
|
126
|
-
return _context.abrupt("return", null);
|
|
127
|
-
|
|
128
|
-
case 6:
|
|
129
|
-
case "end":
|
|
130
|
-
return _context.stop();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}, _callee);
|
|
134
|
-
}));
|
|
135
|
-
|
|
136
|
-
return function getEleAttr(_x) {
|
|
137
|
-
return _ref.apply(this, arguments);
|
|
138
|
-
};
|
|
139
|
-
}();
|
|
140
|
-
|
|
141
107
|
var defaultProps = {
|
|
142
108
|
list: [],
|
|
143
109
|
theme: 'light',
|
|
@@ -164,51 +130,31 @@ var Popover = function Popover(props) {
|
|
|
164
130
|
reset = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
165
131
|
|
|
166
132
|
var goodItem = useRef(null);
|
|
167
|
-
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
168
|
-
|
|
133
|
+
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
134
|
+
var res;
|
|
135
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
169
136
|
while (1) {
|
|
170
|
-
switch (
|
|
137
|
+
switch (_context.prev = _context.next) {
|
|
171
138
|
case 0:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if (!_context2.t0) {
|
|
175
|
-
_context2.next = 5;
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
_context2.next = 4;
|
|
180
|
-
return getEleAttr(goodItem.current);
|
|
181
|
-
|
|
182
|
-
case 4:
|
|
183
|
-
_context2.t0 = _context2.sent;
|
|
184
|
-
|
|
185
|
-
case 5:
|
|
186
|
-
if (!_context2.t0) {
|
|
187
|
-
_context2.next = 16;
|
|
139
|
+
if (!goodItem.current) {
|
|
140
|
+
_context.next = 6;
|
|
188
141
|
break;
|
|
189
142
|
}
|
|
190
143
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return getEleAttr(goodItem.current);
|
|
194
|
-
|
|
195
|
-
case 9:
|
|
196
|
-
_context2.t2 = _context2.sent.width;
|
|
197
|
-
(0, _context2.t1)(_context2.t2);
|
|
198
|
-
_context2.t3 = setElHeight;
|
|
199
|
-
_context2.next = 14;
|
|
200
|
-
return getEleAttr(goodItem.current);
|
|
144
|
+
_context.next = 3;
|
|
145
|
+
return getRectByTaro(goodItem.current);
|
|
201
146
|
|
|
202
|
-
case
|
|
203
|
-
|
|
204
|
-
(0
|
|
147
|
+
case 3:
|
|
148
|
+
res = _context.sent;
|
|
149
|
+
setElWidth(res === null || res === void 0 ? void 0 : res.width);
|
|
150
|
+
setElHeight(res === null || res === void 0 ? void 0 : res.height);
|
|
205
151
|
|
|
206
|
-
case
|
|
152
|
+
case 6:
|
|
207
153
|
case "end":
|
|
208
|
-
return
|
|
154
|
+
return _context.stop();
|
|
209
155
|
}
|
|
210
156
|
}
|
|
211
|
-
},
|
|
157
|
+
}, _callee);
|
|
212
158
|
})));
|
|
213
159
|
|
|
214
160
|
var _useState = useState(''),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
5
|
|
|
4
6
|
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
7
|
|
|
@@ -7,52 +9,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
9
|
|
|
8
10
|
import React__default, { useState, useRef, useEffect, useCallback } from 'react';
|
|
9
11
|
import { u as useTouch } from './useTouch-a2ea68c6.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
获取元素的大小及其相对于视口的位置,等价于 Element.getBoundingClientRect。
|
|
14
|
-
width 宽度 number
|
|
15
|
-
height 高度 number
|
|
16
|
-
top 顶部与视图窗口左上角的距离 number
|
|
17
|
-
left 左侧与视图窗口左上角的距离 number
|
|
18
|
-
right 右侧与视图窗口左上角的距离 number
|
|
19
|
-
bottom 底部与视图窗口左上角的距离 number
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
function isWindow(val) {
|
|
23
|
-
return val === window;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var getRect = function getRect(elementRef) {
|
|
27
|
-
var element = elementRef;
|
|
28
|
-
|
|
29
|
-
if (isWindow(element)) {
|
|
30
|
-
var width = element.innerWidth;
|
|
31
|
-
var height = element.innerHeight;
|
|
32
|
-
return {
|
|
33
|
-
top: 0,
|
|
34
|
-
left: 0,
|
|
35
|
-
right: width,
|
|
36
|
-
bottom: height,
|
|
37
|
-
width: width,
|
|
38
|
-
height: height
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (element && element.getBoundingClientRect) {
|
|
43
|
-
return element.getBoundingClientRect();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
top: 0,
|
|
48
|
-
left: 0,
|
|
49
|
-
right: 0,
|
|
50
|
-
bottom: 0,
|
|
51
|
-
width: 0,
|
|
52
|
-
height: 0
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
12
|
+
import { g as getRectByTaro } from './useClientRect-8b7cc406.js';
|
|
13
|
+
import { N as Notification } from './Notification-422905bd.js';
|
|
14
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
56
15
|
var messageInstance = null;
|
|
57
16
|
var options = {
|
|
58
17
|
msg: '',
|
|
@@ -430,41 +389,64 @@ var Range = function Range(props) {
|
|
|
430
389
|
}
|
|
431
390
|
};
|
|
432
391
|
|
|
433
|
-
var click = function
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
392
|
+
var click = /*#__PURE__*/function () {
|
|
393
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
394
|
+
var rect, delta, total, value, _currentValue, _currentValue2, left, right, middle;
|
|
395
|
+
|
|
396
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
397
|
+
while (1) {
|
|
398
|
+
switch (_context.prev = _context.next) {
|
|
399
|
+
case 0:
|
|
400
|
+
if (!(disabled || !root.current)) {
|
|
401
|
+
_context.next = 2;
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return _context.abrupt("return");
|
|
406
|
+
|
|
407
|
+
case 2:
|
|
408
|
+
SetDragStatus('');
|
|
409
|
+
_context.next = 5;
|
|
410
|
+
return getRectByTaro(root.current);
|
|
411
|
+
|
|
412
|
+
case 5:
|
|
413
|
+
rect = _context.sent;
|
|
414
|
+
delta = event.detail.x - rect.left;
|
|
415
|
+
total = rect.width;
|
|
416
|
+
|
|
417
|
+
if (vertical) {
|
|
418
|
+
delta = event.detail.y - rect.top;
|
|
419
|
+
total = rect.height;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
value = Number(min) + delta / total * scope();
|
|
423
|
+
currentValue = initValue || initValue === 0 ? initValue : modelValue;
|
|
424
|
+
|
|
425
|
+
if (isRange(currentValue)) {
|
|
426
|
+
_currentValue = currentValue, _currentValue2 = _slicedToArray(_currentValue, 2), left = _currentValue2[0], right = _currentValue2[1];
|
|
427
|
+
middle = (left + right) / 2;
|
|
428
|
+
|
|
429
|
+
if (value <= middle) {
|
|
430
|
+
updateValue([value, right], true);
|
|
431
|
+
} else {
|
|
432
|
+
updateValue([left, value], true);
|
|
433
|
+
}
|
|
434
|
+
} else {
|
|
435
|
+
updateValue(value, true);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
case 12:
|
|
439
|
+
case "end":
|
|
440
|
+
return _context.stop();
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}, _callee);
|
|
444
|
+
}));
|
|
458
445
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
} else {
|
|
465
|
-
updateValue(value, true);
|
|
466
|
-
}
|
|
467
|
-
};
|
|
446
|
+
return function click(_x) {
|
|
447
|
+
return _ref.apply(this, arguments);
|
|
448
|
+
};
|
|
449
|
+
}();
|
|
468
450
|
|
|
469
451
|
var _onTouchStart = function onTouchStart(event) {
|
|
470
452
|
if (disabled) {
|
|
@@ -483,36 +465,62 @@ var Range = function Range(props) {
|
|
|
483
465
|
SetDragStatus('start');
|
|
484
466
|
};
|
|
485
467
|
|
|
486
|
-
var _onTouchMove = function
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
468
|
+
var _onTouchMove = /*#__PURE__*/function () {
|
|
469
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(event) {
|
|
470
|
+
var rect, delta, total, diff;
|
|
471
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
472
|
+
while (1) {
|
|
473
|
+
switch (_context2.prev = _context2.next) {
|
|
474
|
+
case 0:
|
|
475
|
+
if (!(disabled || !root.current)) {
|
|
476
|
+
_context2.next = 2;
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
return _context2.abrupt("return");
|
|
481
|
+
|
|
482
|
+
case 2:
|
|
483
|
+
if (dragStatus === 'start') {
|
|
484
|
+
dragStart && dragStart();
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
touch.move(event);
|
|
488
|
+
SetDragStatus('draging');
|
|
489
|
+
_context2.next = 7;
|
|
490
|
+
return getRectByTaro(root.current);
|
|
491
|
+
|
|
492
|
+
case 7:
|
|
493
|
+
rect = _context2.sent;
|
|
494
|
+
delta = touch.deltaX;
|
|
495
|
+
total = rect.width;
|
|
496
|
+
diff = delta / total * scope();
|
|
497
|
+
|
|
498
|
+
if (vertical) {
|
|
499
|
+
delta = touch.deltaY;
|
|
500
|
+
total = rect.height;
|
|
501
|
+
diff = delta / total * scope();
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
if (isRange(startValue)) {
|
|
505
|
+
currentValue[buttonIndex] = startValue[buttonIndex] + diff;
|
|
506
|
+
} else {
|
|
507
|
+
currentValue = startValue + diff;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
updateValue(currentValue);
|
|
511
|
+
|
|
512
|
+
case 14:
|
|
513
|
+
case "end":
|
|
514
|
+
return _context2.stop();
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}, _callee2);
|
|
518
|
+
}));
|
|
513
519
|
|
|
514
|
-
|
|
515
|
-
|
|
520
|
+
return function onTouchMove(_x2) {
|
|
521
|
+
return _ref2.apply(this, arguments);
|
|
522
|
+
};
|
|
523
|
+
}();
|
|
516
524
|
|
|
517
525
|
var _onTouchEnd = function onTouchEnd(event) {
|
|
518
526
|
if (disabled) {
|
|
@@ -562,7 +570,7 @@ var Range = function Range(props) {
|
|
|
562
570
|
return React__default.createElement("div", {
|
|
563
571
|
role: "slider",
|
|
564
572
|
key: index,
|
|
565
|
-
className: "".concat(index === 0 ? 'nut-range-button-wrapper-left' : '', "\n
|
|
573
|
+
className: "".concat(index === 0 ? 'nut-range-button-wrapper-left' : '', "\n ").concat(index === 1 ? 'nut-range-button-wrapper-right' : ''),
|
|
566
574
|
tabIndex: disabled ? -1 : 0,
|
|
567
575
|
"aria-valuemin": +min,
|
|
568
576
|
"aria-valuenow": curValue(index),
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as ReactDOM from 'react-dom';
|
|
2
|
+
var createRoot;
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
var mainVersion = Number((ReactDOM.version || '').split('.')[0]);
|
|
6
|
+
|
|
7
|
+
if (mainVersion >= 18 && ReactDOM.createRoot) {
|
|
8
|
+
createRoot = ReactDOM.createRoot;
|
|
9
|
+
}
|
|
10
|
+
} catch (e) {
|
|
11
|
+
console.log(e);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function legacyRender(node, container) {
|
|
15
|
+
ReactDOM.render(node, container);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function concurrentRender(node, container) {
|
|
19
|
+
var root = ReactDOM.createRoot(container);
|
|
20
|
+
root.render(node);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function render(node, container) {
|
|
24
|
+
if (createRoot) {
|
|
25
|
+
concurrentRender(node, container);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
legacyRender(node, container);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { render as r };
|
|
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
9
9
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
|
-
import { u as useConfig } from './configprovider-
|
|
10
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
11
11
|
import { I as Icon } from './icon-8dc4de10.js';
|
|
12
12
|
var defaultProps = {
|
|
13
13
|
placeholder: '',
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["title", "desc", "tips", "visible", "modelValue", "errorMsg", "noButton", "closeOnClickOverlay", "length", "style", "className", "
|
|
5
|
+
var _excluded = ["title", "desc", "tips", "visible", "modelValue", "errorMsg", "noButton", "closeOnClickOverlay", "length", "style", "className", "onChange", "onOk", "onTips", "onCancel", "onClose", "onComplete"];
|
|
6
6
|
|
|
7
7
|
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; }
|
|
8
8
|
|
|
@@ -12,11 +12,11 @@ import React__default, { useRef, useState, useEffect } from 'react';
|
|
|
12
12
|
import { c as cn } from './bem-893ad28d.js';
|
|
13
13
|
import { P as Popup } from './popup-67173ec6.js';
|
|
14
14
|
import { I as Icon } from './icon-8dc4de10.js';
|
|
15
|
-
import { u as useConfig } from './configprovider-
|
|
15
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
16
16
|
var defaultProps = {
|
|
17
|
-
title: '
|
|
18
|
-
desc: '
|
|
19
|
-
tips: '
|
|
17
|
+
title: '',
|
|
18
|
+
desc: '',
|
|
19
|
+
tips: '',
|
|
20
20
|
visible: false,
|
|
21
21
|
modelValue: '',
|
|
22
22
|
errorMsg: '',
|
|
@@ -24,12 +24,12 @@ var defaultProps = {
|
|
|
24
24
|
closeOnClickOverlay: true,
|
|
25
25
|
length: 6,
|
|
26
26
|
className: '',
|
|
27
|
-
|
|
27
|
+
onChange: function onChange(value) {},
|
|
28
28
|
onOk: function onOk(value) {},
|
|
29
29
|
onCancel: function onCancel() {},
|
|
30
30
|
onClose: function onClose() {},
|
|
31
31
|
onTips: function onTips() {},
|
|
32
|
-
|
|
32
|
+
onComplete: function onComplete(value) {}
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
var ShortPassword = function ShortPassword(props) {
|
|
@@ -47,12 +47,12 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
47
47
|
length = props.length,
|
|
48
48
|
style = props.style,
|
|
49
49
|
className = props.className,
|
|
50
|
-
|
|
50
|
+
onChange = props.onChange,
|
|
51
51
|
onOk = props.onOk,
|
|
52
52
|
onTips = props.onTips,
|
|
53
53
|
onCancel = props.onCancel,
|
|
54
54
|
onClose = props.onClose,
|
|
55
|
-
|
|
55
|
+
onComplete = props.onComplete,
|
|
56
56
|
reset = _objectWithoutProperties(props, _excluded);
|
|
57
57
|
|
|
58
58
|
var b = cn('shortpassword');
|
|
@@ -81,7 +81,7 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
81
81
|
setInnerVisible(visible);
|
|
82
82
|
}, [visible]);
|
|
83
83
|
useEffect(function () {
|
|
84
|
-
if (modelValue) {
|
|
84
|
+
if (typeof modelValue !== 'undefined') {
|
|
85
85
|
setInputValue(modelValue);
|
|
86
86
|
}
|
|
87
87
|
}, [modelValue]);
|
|
@@ -96,10 +96,10 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
96
96
|
setInputValue(inputValue);
|
|
97
97
|
|
|
98
98
|
if (String(inputValue).length === comLen) {
|
|
99
|
-
|
|
99
|
+
onComplete && onComplete(inputValue);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
onChange && onChange(inputValue);
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
var systemStyle = function systemStyle() {
|
|
@@ -108,18 +108,23 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
108
108
|
|
|
109
109
|
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
|
|
110
110
|
|
|
111
|
+
var style = {};
|
|
112
|
+
console.log(isIOS, isAndroid);
|
|
113
|
+
|
|
111
114
|
if (isIOS) {
|
|
112
|
-
|
|
115
|
+
style = {
|
|
113
116
|
paddingRight: '1200px'
|
|
114
117
|
};
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
if (isAndroid) {
|
|
118
|
-
|
|
121
|
+
style = {
|
|
119
122
|
opacity: 0,
|
|
120
123
|
zIndex: 10
|
|
121
124
|
};
|
|
122
125
|
}
|
|
126
|
+
|
|
127
|
+
return style;
|
|
123
128
|
};
|
|
124
129
|
|
|
125
130
|
var focus = function focus() {
|
|
@@ -148,9 +153,9 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
148
153
|
style: _objectSpread({}, style)
|
|
149
154
|
}, reset), React__default.createElement("div", {
|
|
150
155
|
className: b('title')
|
|
151
|
-
}, locale.shortpassword.title
|
|
156
|
+
}, title || locale.shortpassword.title), React__default.createElement("div", {
|
|
152
157
|
className: b('subtitle')
|
|
153
|
-
}, locale.shortpassword.desc
|
|
158
|
+
}, desc || locale.shortpassword.desc), React__default.createElement("div", {
|
|
154
159
|
className: b('input')
|
|
155
160
|
}, React__default.createElement("input", {
|
|
156
161
|
ref: textInput,
|
|
@@ -180,7 +185,7 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
180
185
|
className: b('message')
|
|
181
186
|
}, React__default.createElement("div", {
|
|
182
187
|
className: b('message__error')
|
|
183
|
-
}, errorMsg), tips ? React__default.createElement("div", {
|
|
188
|
+
}, errorMsg), tips || locale.shortpassword.tips ? React__default.createElement("div", {
|
|
184
189
|
className: b('message__forget')
|
|
185
190
|
}, React__default.createElement(Icon, {
|
|
186
191
|
className: "icon",
|
|
@@ -188,7 +193,7 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
188
193
|
name: "tips"
|
|
189
194
|
}), React__default.createElement("div", {
|
|
190
195
|
onClick: onTips
|
|
191
|
-
}, locale.shortpassword.tips
|
|
196
|
+
}, tips || locale.shortpassword.tips)) : null), !noButton ? React__default.createElement("div", {
|
|
192
197
|
className: b('footer')
|
|
193
198
|
}, React__default.createElement("div", {
|
|
194
199
|
className: b('footer__cancel'),
|
|
@@ -7,7 +7,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
7
7
|
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; }
|
|
8
8
|
|
|
9
9
|
import React__default from 'react';
|
|
10
|
-
import { u as useConfig } from './configprovider-
|
|
10
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
11
11
|
import { P as Popup } from './popup-67173ec6.js';
|
|
12
12
|
import { h as handleClick, O as OffsetContext } from './offsetContext-0e3d04b3.js';
|
|
13
13
|
var defaultProps = {
|
|
@@ -10,7 +10,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
10
10
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
11
11
|
import { B as Button } from './button-521a516b.js';
|
|
12
12
|
import { c as cn } from './bem-893ad28d.js';
|
|
13
|
-
import { u as useConfig } from './configprovider-
|
|
13
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
14
14
|
var defaultProps = {
|
|
15
15
|
type: 'png',
|
|
16
16
|
lineWidth: 2,
|