@nutui/nutui-react-taro 1.4.2 → 1.4.3
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 +12 -0
- package/dist/esm/ActionSheet.js +4 -4
- package/dist/esm/Address.js +4 -4
- package/dist/esm/Audio.js +4 -4
- package/dist/esm/Badge.js +2 -2
- package/dist/esm/Barrage.js +2 -2
- package/dist/esm/Calendar.js +5 -5
- package/dist/esm/CalendarItem.js +2 -2
- package/dist/esm/Cascader.js +4 -4
- package/dist/esm/CircleProgress.js +2 -2
- package/dist/esm/DatePicker.js +5 -5
- package/dist/esm/Dialog.js +2 -2
- package/dist/esm/Drag.js +2 -2
- package/dist/esm/FixedNav.js +3 -3
- package/dist/esm/ImagePreview.js +4 -4
- package/dist/esm/InputNumber.js +2 -2
- package/dist/esm/MenuItem.js +3 -3
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/Notify.js +2 -2
- package/dist/esm/NumberKeyboard.js +4 -4
- package/dist/esm/Overlay.js +2 -2
- package/dist/esm/Picker.js +4 -4
- package/dist/esm/Popover.js +3 -3
- package/dist/esm/Popup.js +3 -3
- package/dist/esm/Range.js +3 -3
- package/dist/esm/ShortPassword.js +4 -4
- package/dist/esm/SideNavBar.js +4 -4
- package/dist/esm/Signature.js +2 -2
- package/dist/esm/TimeSelect.js +4 -4
- package/dist/esm/Toast.js +2 -2
- package/dist/esm/WaterMark.js +2 -2
- package/dist/esm/{actionsheet.taro-360d8d34.js → actionsheet.taro-a58d3d12.js} +1 -1
- package/dist/esm/{address.taro-c03b8b16.js → address.taro-1e2aea24.js} +22 -24
- package/dist/esm/{audio.taro-20890c93.js → audio.taro-fddcdfc0.js} +1 -1
- package/dist/esm/{badge.taro-9f72d846.js → badge.taro-fe9171ec.js} +1 -1
- package/dist/esm/{barrage.taro-d86c367a.js → barrage.taro-0e157b5e.js} +25 -23
- package/dist/esm/{calendar.taro-93b14945.js → calendar.taro-72974415.js} +2 -2
- package/dist/esm/{calendaritem.taro-85a8c4fc.js → calendaritem.taro-84e889eb.js} +19 -17
- package/dist/esm/{cascader.taro-459f7d45.js → cascader.taro-d8cb1c3e.js} +245 -235
- package/dist/esm/{circleprogress.taro-3c89a157.js → circleprogress.taro-47db537c.js} +2 -13
- package/dist/esm/{datepicker.taro-7de67b85.js → datepicker.taro-7199f521.js} +1 -1
- package/dist/esm/{dialog.taro-cf9e3087.js → dialog.taro-f54cfbf0.js} +1 -1
- package/dist/esm/{drag.taro-0717c783.js → drag.taro-82b6b27a.js} +4 -8
- package/dist/esm/ellipsis.taro-c0de6ff4.js +84 -76
- package/dist/esm/{fixednav.taro-005765f4.js → fixednav.taro-9e759320.js} +1 -1
- package/dist/esm/{imagepreview.taro-68e776f5.js → imagepreview.taro-3400ea03.js} +1 -1
- package/dist/esm/{inputnumber.taro-0a01f6e1.js → inputnumber.taro-dc39b853.js} +1 -0
- package/dist/esm/{menuitem.taro-2f8e69a4.js → menuitem.taro-216e9f7d.js} +17 -15
- package/dist/esm/{noticebar.taro-43c18dc9.js → noticebar.taro-94002898.js} +35 -33
- package/dist/esm/{notify.taro-d9c48fae.js → notify.taro-308e5892.js} +1 -1
- package/dist/esm/{numberkeyboard.taro-9635ecc9.js → numberkeyboard.taro-5e8f0ddf.js} +1 -1
- package/dist/esm/nutui-react.es.js +30 -30
- package/dist/esm/{overlay.taro-be45fed5.js → overlay.taro-98367bc1.js} +1 -1
- package/dist/esm/{picker.taro-9b7263ca.js → picker.taro-3b5cc054.js} +14 -12
- package/dist/esm/{popover.taro-7e5dff8c.js → popover.taro-46d813e8.js} +18 -16
- package/dist/esm/{popup.taro-33d0bbc8.js → popup.taro-cb777e09.js} +1 -1
- package/dist/esm/pulltorefresh.taro-f26a20dd.js +81 -75
- package/dist/esm/{range.taro-4cbe2469.js → range.taro-c41e9b90.js} +72 -68
- package/dist/esm/{shortpassword.taro-4bd513ae.js → shortpassword.taro-3a3bf412.js} +1 -1
- package/dist/esm/{sidenavbar.taro-3b1f1218.js → sidenavbar.taro-06026f31.js} +1 -1
- package/dist/esm/{signature.taro-504357dc.js → signature.taro-17648cac.js} +79 -39
- package/dist/esm/swipe.taro-83bc248f.js +37 -35
- package/dist/esm/swiper.taro-852f6615.js +28 -26
- package/dist/esm/{timeselect.taro-000060af.js → timeselect.taro-fc7ec6ee.js} +1 -1
- package/dist/esm/{toast.taro-86862dff.js → toast.taro-0804b6b4.js} +1 -1
- package/dist/esm/useClientRect-bf69d7b3.js +12 -10
- package/dist/esm/{watermark.taro-d1f38563.js → watermark.taro-323d1cf3.js} +53 -41
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +160 -111
- package/dist/nutui.react.umd.js +159 -110
- package/dist/packages/drag/drag.scss +1 -0
- package/dist/packages/inputnumber/inputnumber.scss +4 -1
- package/dist/packages/signature/signature.scss +10 -3
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/variables.scss +1 -1
- package/package.json +1 -1
|
@@ -398,32 +398,34 @@ 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
|
-
|
|
401
|
+
while (1) {
|
|
402
|
+
switch (_context.prev = _context.next) {
|
|
403
|
+
case 0:
|
|
404
|
+
active = _args.length > 0 && _args[0] !== undefined ? _args[0] : +propSwiper.initPage;
|
|
405
|
+
_context.next = 3;
|
|
406
|
+
return queryRect(container.current);
|
|
407
|
+
case 3:
|
|
408
|
+
rect = _context.sent;
|
|
409
|
+
_active = Math.max(Math.min(childCount - 1, active), 0);
|
|
410
|
+
_width = propSwiper.width ? +propSwiper.width : rect === null || rect === void 0 ? void 0 : rect.width;
|
|
411
|
+
_height = propSwiper.height ? +propSwiper.height : rect === null || rect === void 0 ? void 0 : rect.height;
|
|
412
|
+
size = isVertical ? _height : _width;
|
|
413
|
+
trackSize = childCount * Number(size);
|
|
414
|
+
targetOffset = getOffset(_active);
|
|
415
|
+
_swiper.current.moving = true;
|
|
416
|
+
if (ready) {
|
|
417
|
+
_swiper.current.moving = false;
|
|
418
|
+
}
|
|
419
|
+
setRect(rect);
|
|
420
|
+
setActive(_active);
|
|
421
|
+
setWidth(_width);
|
|
422
|
+
setHeight(_height);
|
|
423
|
+
setOffset(targetOffset);
|
|
424
|
+
setReady(true);
|
|
425
|
+
case 18:
|
|
426
|
+
case "end":
|
|
427
|
+
return _context.stop();
|
|
428
|
+
}
|
|
427
429
|
}
|
|
428
430
|
}, _callee);
|
|
429
431
|
}));
|
|
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
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
5
|
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
6
|
import React__default, { useState, useEffect } from 'react';
|
|
7
|
-
import { P as Popup } from './popup.taro-
|
|
7
|
+
import { P as Popup } from './popup.taro-cb777e09.js';
|
|
8
8
|
import { T as TimePannel } from './timepannel.taro-c66c63dd.js';
|
|
9
9
|
import { T as TimeDetail } from './timedetail.taro-105f5380.js';
|
|
10
10
|
import { c as cn } from './bem-893ad28d.js';
|
|
@@ -13,16 +13,18 @@ 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
|
-
|
|
16
|
+
while (1) {
|
|
17
|
+
switch (_context.prev = _context.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
_context.next = 2;
|
|
20
|
+
return element.getBoundingClientRect();
|
|
21
|
+
case 2:
|
|
22
|
+
res = _context.sent;
|
|
23
|
+
return _context.abrupt("return", res);
|
|
24
|
+
case 4:
|
|
25
|
+
case "end":
|
|
26
|
+
return _context.stop();
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
29
|
}, _callee);
|
|
28
30
|
}));
|
|
@@ -61,50 +61,62 @@ var WaterMark = function WaterMark(props) {
|
|
|
61
61
|
}, []);
|
|
62
62
|
var init = function init() {
|
|
63
63
|
var ratio = 1;
|
|
64
|
-
Taro.getSystemInfo({
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
Taro.getSystemInfo().then(function (res) {
|
|
65
|
+
ratio = res.pixelRatio;
|
|
66
|
+
var canvasWidth = "".concat((gapX + width) * ratio, "px");
|
|
67
|
+
var canvasHeight = "".concat((gapY + height) * ratio, "px");
|
|
68
|
+
var markWidth = width * ratio;
|
|
69
|
+
var markHeight = height * ratio;
|
|
70
|
+
var ctx;
|
|
71
|
+
var canvas;
|
|
72
|
+
if (process.env.TARO_ENV === 'h5') {
|
|
73
|
+
canvas = document.createElement('canvas');
|
|
74
|
+
ctx = canvas.getContext('2d');
|
|
75
|
+
canvas.setAttribute('width', canvasWidth);
|
|
76
|
+
canvas.setAttribute('height', canvasHeight);
|
|
77
|
+
} else {
|
|
78
|
+
canvas = Taro.createOffscreenCanvas({
|
|
79
|
+
type: '2d',
|
|
80
|
+
width: Number(canvasWidth),
|
|
81
|
+
height: Number(canvasHeight)
|
|
82
|
+
});
|
|
83
|
+
ctx = canvas.getContext('2d');
|
|
67
84
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
ctx.
|
|
89
|
-
|
|
85
|
+
if (ctx) {
|
|
86
|
+
if (image) {
|
|
87
|
+
ctx.translate(markWidth / 2, markHeight / 2);
|
|
88
|
+
ctx.rotate(Math.PI / 180 * Number(rotate));
|
|
89
|
+
var img;
|
|
90
|
+
if (process.env.TARO_ENV === 'h5') {
|
|
91
|
+
img = new Image();
|
|
92
|
+
} else {
|
|
93
|
+
img = canvas.createImage();
|
|
94
|
+
}
|
|
95
|
+
img.crossOrigin = 'anonymous';
|
|
96
|
+
img.referrerPolicy = 'no-referrer';
|
|
97
|
+
img.src = image;
|
|
98
|
+
img.onload = function () {
|
|
99
|
+
ctx.drawImage(img, -imageWidth * ratio / 2, -imageHeight * ratio / 2, imageWidth * ratio, imageHeight * ratio);
|
|
100
|
+
ctx.restore();
|
|
101
|
+
setBase64Url(canvas.toDataURL());
|
|
102
|
+
};
|
|
103
|
+
} else if (content) {
|
|
104
|
+
ctx.textBaseline = 'middle'; // 设置或返回在绘制文本时使用的当前文本基线。(正中)
|
|
105
|
+
ctx.textAlign = 'center'; // 设置或返回文本内容的当前对齐方式。
|
|
106
|
+
// 文字绕中间旋转
|
|
107
|
+
ctx.translate(markWidth / 2, markHeight / 2);
|
|
108
|
+
ctx.rotate(Math.PI / 180 * Number(rotate));
|
|
109
|
+
var markSize = Number(fontSize) * ratio;
|
|
110
|
+
ctx.font = "".concat(fontStyle, " normal ").concat(fontWeight, " ").concat(markSize, "px/").concat(markHeight, "px ").concat(fontFamily);
|
|
111
|
+
ctx.fillStyle = fontColor;
|
|
112
|
+
ctx.fillText(content, 0, 0); // 在画布上绘制"被填充的"文本。
|
|
113
|
+
ctx.restore(); // 返回之前保存过的路径状态和属性。
|
|
90
114
|
setBase64Url(canvas.toDataURL());
|
|
91
|
-
}
|
|
92
|
-
} else
|
|
93
|
-
|
|
94
|
-
ctx.textAlign = 'center'; // 设置或返回文本内容的当前对齐方式。
|
|
95
|
-
// 文字绕中间旋转
|
|
96
|
-
ctx.translate(markWidth / 2, markHeight / 2);
|
|
97
|
-
ctx.rotate(Math.PI / 180 * Number(rotate));
|
|
98
|
-
var markSize = Number(fontSize) * ratio;
|
|
99
|
-
ctx.font = "".concat(fontStyle, " normal ").concat(fontWeight, " ").concat(markSize, "px/").concat(markHeight, "px ").concat(fontFamily);
|
|
100
|
-
ctx.fillStyle = fontColor;
|
|
101
|
-
ctx.fillText(content, 0, 0); // 在画布上绘制"被填充的"文本。
|
|
102
|
-
ctx.restore(); // 返回之前保存过的路径状态和属性。
|
|
103
|
-
setBase64Url(canvas.toDataURL());
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
throw new Error(locale.watermark.errorCanvasTips);
|
|
104
118
|
}
|
|
105
|
-
}
|
|
106
|
-
throw new Error(locale.watermark.errorCanvasTips);
|
|
107
|
-
}
|
|
119
|
+
});
|
|
108
120
|
};
|
|
109
121
|
return React__default.createElement("div", {
|
|
110
122
|
className: cls,
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED