@nutui/nutui-react-taro 2.6.19 → 2.6.21
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 +25 -9
- package/dist/esm/Address.js +1 -1
- package/dist/esm/Audio.js +1 -1
- package/dist/esm/AvatarCropper.js +1 -1
- package/dist/esm/BackTop.js +1 -1
- package/dist/esm/Badge.js +1 -1
- package/dist/esm/Barrage.js +1 -1
- package/dist/esm/Calendar.js +1 -1
- package/dist/esm/CalendarCard.js +1 -1
- package/dist/esm/CalendarItem.js +1 -1
- package/dist/esm/Cascader.js +1 -1
- package/dist/esm/ConfigProvider.js +2 -2
- package/dist/esm/CountDown.js +1 -1
- package/dist/esm/DatePicker.js +1 -1
- package/dist/esm/Dialog.js +1 -1
- package/dist/esm/Ellipsis.js +1 -1
- package/dist/esm/Empty.js +1 -1
- package/dist/esm/FixedNav.js +1 -1
- package/dist/esm/Grid.js +1 -1
- package/dist/esm/GridItem.js +1 -1
- package/dist/esm/InfiniteLoading.js +1 -1
- package/dist/esm/Input.js +1 -1
- package/dist/esm/NoticeBar.js +1 -1
- package/dist/esm/NumberKeyboard.js +1 -1
- package/dist/esm/Pagination.js +1 -1
- package/dist/esm/Picker.js +1 -1
- package/dist/esm/Popover.js +1 -1
- package/dist/esm/Progress.js +1 -1
- package/dist/esm/PullToRefresh.js +1 -1
- package/dist/esm/Range.js +1 -1
- package/dist/esm/SearchBar.js +1 -1
- package/dist/esm/ShortPassword.js +1 -1
- package/dist/esm/Signature.js +1 -1
- package/dist/esm/Tabbar.js +1 -1
- package/dist/esm/TabbarItem.js +1 -1
- package/dist/esm/Table.js +1 -1
- package/dist/esm/Tabs.js +1 -1
- package/dist/esm/TextArea.js +1 -1
- package/dist/esm/TimeSelect.js +1 -1
- package/dist/esm/Tour.js +1 -1
- package/dist/esm/Uploader.js +1 -1
- package/dist/esm/WaterMark.js +1 -1
- package/dist/esm/{address.taro-DErzR2nE.js → address.taro-CWr6jIYg.js} +2 -2
- package/dist/esm/{audio.taro-C8UEIiBR.js → audio.taro--yoX2oyx.js} +2 -2
- package/dist/esm/{avatarcropper.taro-Bmx6gexj.js → avatarcropper.taro-B0I9uLNp.js} +14 -5
- package/dist/esm/{backtop.taro-jWlJ1ZWG.js → backtop.taro-CpzSXDW3.js} +1 -1
- package/dist/esm/{badge.taro-BGaxpEYi.js → badge.taro-B42_7q8v.js} +1 -1
- package/dist/esm/{barrage.taro-CA-9uADD.js → barrage.taro-D2lmvcB-.js} +40 -26
- package/dist/esm/{calendar.taro-CuPrPO_2.js → calendar.taro-Csq-7imv.js} +2 -2
- package/dist/esm/{calendarcard.taro-CbvCWF1k.js → calendarcard.taro-CvWyBqnr.js} +1 -1
- package/dist/esm/{calendaritem.taro-DbaK10II.js → calendaritem.taro-BOMJjsx9.js} +1 -1
- package/dist/esm/{cascader.taro-Cad_4Sqw.js → cascader.taro-DZ_oBTm0.js} +4 -2
- package/dist/esm/{configprovider.taro-DA4GDDFu.js → configprovider.taro-C3WyeHSO.js} +4 -0
- package/dist/esm/{countdown.taro-mKXeisK0.js → countdown.taro-Dyryl4pq.js} +0 -3
- package/dist/esm/{datepicker.taro-DjTr__43.js → datepicker.taro-DibmSueg.js} +2 -2
- package/dist/esm/{dialog.taro-CzGba5-2.js → dialog.taro-Bg730q8d.js} +1 -1
- package/dist/esm/{ellipsis.taro-Ba2Kokb7.js → ellipsis.taro-fvcP85Ir.js} +1 -1
- package/dist/esm/{empty.taro-CnwDznke.js → empty.taro-Dr4eSaDg.js} +0 -2
- package/dist/esm/{fixednav.taro-eCRdeuqJ.js → fixednav.taro-BodErnYy.js} +1 -1
- package/dist/esm/{grid.taro-ZJywVaVe.js → grid.taro-Bi-DXjbo.js} +1 -1
- package/dist/esm/{griditem.taro-CcWyYchl.js → griditem.taro-DMvds46i.js} +0 -2
- package/dist/esm/{infiniteloading.taro-TbcBB0Qr.js → infiniteloading.taro-DzIrZvc0.js} +1 -1
- package/dist/esm/{input.taro-DbAbbzIX.js → input.taro-CA9ZpM9a.js} +1 -1
- package/dist/esm/{noticebar.taro-CGUTg60Q.js → noticebar.taro-BjKDC7We.js} +1 -1
- package/dist/esm/{numberkeyboard.taro-B1LfptyA.js → numberkeyboard.taro-CIlStObb.js} +1 -1
- package/dist/esm/nutui-react.es.js +41 -41
- package/dist/esm/{pagination.taro-D0HOQwW2.js → pagination.taro-BSwytb0-.js} +1 -1
- package/dist/esm/{picker.taro-D9CKPl5K.js → picker.taro-mCnxpFCY.js} +1 -1
- package/dist/esm/{popover.taro-BvMcsCRf.js → popover.taro-BHcidbZG.js} +1 -1
- package/dist/esm/{progress.taro-De9-206U.js → progress.taro-CaIUT9Uo.js} +1 -1
- package/dist/esm/{pulltorefresh.taro-DSr2dBjM.js → pulltorefresh.taro-BiSDwLpA.js} +1 -1
- package/dist/esm/{range.taro-D_qsx_j6.js → range.taro-BilM3sMH.js} +1 -1
- package/dist/esm/{searchbar.taro-C8cg7NeJ.js → searchbar.taro-LaO2Xr2t.js} +1 -1
- package/dist/esm/{shortpassword.taro-DPmvilhN.js → shortpassword.taro-ByEtEDDl.js} +1 -1
- package/dist/esm/{signature.taro-zgwaJkIE.js → signature.taro-BW4eiGIR.js} +1 -1
- package/dist/esm/{tabbar.taro-CXk0zLdz.js → tabbar.taro-BiQDgZQF.js} +1 -1
- package/dist/esm/{tabbaritem.taro-BZNabTBp.js → tabbaritem.taro-BiIVucQz.js} +1 -1
- package/dist/esm/{table.taro-B6WCKTkO.js → table.taro-1nFkDxbh.js} +1 -1
- package/dist/esm/{tabs.taro-8X51sTol.js → tabs.taro-CJiI4q_-.js} +1 -1
- package/dist/esm/{textarea.taro-DuceTjAx.js → textarea.taro-EJQxRHZR.js} +1 -1
- package/dist/esm/{timeselect.taro-BqP2APht.js → timeselect.taro-DE_a87DT.js} +1 -1
- package/dist/esm/{tour.taro-XysJDnqf.js → tour.taro-BvBZa8nq.js} +1 -1
- package/dist/esm/{uploader.taro-Do8LZqUn.js → uploader.taro-DZyZiEi2.js} +11 -14
- package/dist/esm/{watermark.taro-CZ6R5FlJ.js → watermark.taro-CbO7mKFD.js} +1 -1
- package/dist/locales/base.d.ts +7 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +5 -1
- package/dist/locales/id-ID.js +5 -1
- package/dist/locales/tr-TR.js +5 -1
- package/dist/locales/zh-CN.js +5 -1
- package/dist/locales/zh-TW.js +5 -1
- package/dist/locales/zh-UG.js +5 -1
- package/dist/nutui.react.es.js +74 -52
- package/dist/nutui.react.umd.js +74 -52
- package/dist/types/index.d.ts +196 -196
- package/dist/types/locales/base.d.ts +7 -0
- package/dist/types/packages/searchbar/searchbar.d.ts +0 -14
- package/dist/types/packages/searchbar/searchbar.taro.d.ts +14 -14
- package/dist/types/packages/uploader/uploader.d.ts +1 -0
- package/dist/types/packages/uploader/uploader.taro.d.ts +5 -3
- package/package.json +2 -2
package/dist/nutui.react.umd.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("@tarojs/taro"), require("@tarojs/components"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "@tarojs/taro", "@tarojs/components", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory((global2.nutui = global2.nutui || {}, global2.nutui.react = {}), global2.React, global2.Taro, global2.components, global2.ReactDOM));
|
|
3
3
|
})(this, function(exports2, React, Taro, components, ReactDOM) {
|
|
4
4
|
"use strict";/*!
|
|
5
|
-
* @nutui/nutui-react-taro v2.6.
|
|
5
|
+
* @nutui/nutui-react-taro v2.6.21 Fri Sep 27 2024 14:02:22 GMT+0800 (China Standard Time)
|
|
6
6
|
* (c) 2023 @jdf2e.
|
|
7
7
|
* Released under the MIT License.
|
|
8
8
|
*/
|
|
@@ -1415,6 +1415,8 @@
|
|
|
1415
1415
|
noData: "暂无数据",
|
|
1416
1416
|
placeholder: "请输入内容",
|
|
1417
1417
|
select: "请选择",
|
|
1418
|
+
edit: "编辑",
|
|
1419
|
+
reset: "重置",
|
|
1418
1420
|
video: {
|
|
1419
1421
|
errorTip: "视频加载失败",
|
|
1420
1422
|
clickRetry: "点击重试"
|
|
@@ -1452,6 +1454,7 @@
|
|
|
1452
1454
|
tips: "忘记密码"
|
|
1453
1455
|
},
|
|
1454
1456
|
uploader: {
|
|
1457
|
+
list: "上传文件",
|
|
1455
1458
|
ready: "准备完成",
|
|
1456
1459
|
readyUpload: "准备上传",
|
|
1457
1460
|
waitingUpload: "等待上传",
|
|
@@ -1518,6 +1521,7 @@
|
|
|
1518
1521
|
mute: "静音",
|
|
1519
1522
|
tips: "onPlayEnd事件在loop=false时才会触发"
|
|
1520
1523
|
},
|
|
1524
|
+
avatarCropper: { rotate: "旋转", selectImage: "选择图片" },
|
|
1521
1525
|
datepicker: {
|
|
1522
1526
|
year: "年",
|
|
1523
1527
|
month: "月",
|
|
@@ -3723,7 +3727,6 @@
|
|
|
3723
3727
|
direction: "vertical"
|
|
3724
3728
|
};
|
|
3725
3729
|
const GridItem = (props) => {
|
|
3726
|
-
useConfig$1();
|
|
3727
3730
|
const {
|
|
3728
3731
|
children,
|
|
3729
3732
|
style,
|
|
@@ -5701,6 +5704,7 @@
|
|
|
5701
5704
|
}
|
|
5702
5705
|
};
|
|
5703
5706
|
const InternalCascader = (props, ref) => {
|
|
5707
|
+
const { locale } = useConfig$1();
|
|
5704
5708
|
const {
|
|
5705
5709
|
className,
|
|
5706
5710
|
style,
|
|
@@ -6000,7 +6004,7 @@
|
|
|
6000
6004
|
className: `nut-tabs-titles-item ${tabvalue === pane.paneKey ? "nut-tabs-titles-item-active" : ""}`,
|
|
6001
6005
|
key: pane.paneKey
|
|
6002
6006
|
},
|
|
6003
|
-
/* @__PURE__ */ React.createElement("span", { className: "nut-tabs-titles-item-text" }, !state.initLoading && state.panes.length && ((_a = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a.text), !state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) &&
|
|
6007
|
+
/* @__PURE__ */ React.createElement("span", { className: "nut-tabs-titles-item-text" }, !state.initLoading && state.panes.length && ((_a = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a.text), !state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) && `${locale.select}`, !(!state.initLoading && state.panes.length) && "Loading..."),
|
|
6004
6008
|
/* @__PURE__ */ React.createElement("span", { className: "nut-tabs-titles-item-line" })
|
|
6005
6009
|
);
|
|
6006
6010
|
});
|
|
@@ -12317,7 +12321,7 @@
|
|
|
12317
12321
|
onConfirm && onConfirm(res2.tempFilePath, isSignedRef.current);
|
|
12318
12322
|
},
|
|
12319
12323
|
fail: (res2) => {
|
|
12320
|
-
console.warn("保存失败");
|
|
12324
|
+
console.warn("保存失败", res2);
|
|
12321
12325
|
}
|
|
12322
12326
|
});
|
|
12323
12327
|
});
|
|
@@ -12711,7 +12715,7 @@
|
|
|
12711
12715
|
class FileItem {
|
|
12712
12716
|
constructor() {
|
|
12713
12717
|
this.status = "ready";
|
|
12714
|
-
this.message = "
|
|
12718
|
+
this.message = "";
|
|
12715
12719
|
this.uid = (/* @__PURE__ */ new Date()).getTime().toString();
|
|
12716
12720
|
this.percentage = 0;
|
|
12717
12721
|
this.formData = {};
|
|
@@ -12874,6 +12878,7 @@
|
|
|
12874
12878
|
onDeleteItem,
|
|
12875
12879
|
handleItemClick,
|
|
12876
12880
|
previewUrl,
|
|
12881
|
+
deleteIcon,
|
|
12877
12882
|
children
|
|
12878
12883
|
}) => {
|
|
12879
12884
|
const renderIcon = (item) => {
|
|
@@ -12891,12 +12896,12 @@
|
|
|
12891
12896
|
key: item.uid
|
|
12892
12897
|
},
|
|
12893
12898
|
previewType === "picture" && !children && deletable && /* @__PURE__ */ React.createElement(
|
|
12894
|
-
|
|
12899
|
+
components.View,
|
|
12895
12900
|
{
|
|
12896
|
-
color: "rgba(0,0,0,0.6)",
|
|
12897
12901
|
className: "close",
|
|
12898
12902
|
onClick: () => onDeleteItem(item, index)
|
|
12899
|
-
}
|
|
12903
|
+
},
|
|
12904
|
+
deleteIcon
|
|
12900
12905
|
),
|
|
12901
12906
|
previewType === "picture" && !children && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-img" }, item.status === "ready" ? /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress" }, /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress-msg" }, item.message)) : item.status !== "success" && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress" }, renderIcon(item), /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-preview-progress-msg" }, item.message)), ((_a = item.type) == null ? void 0 : _a.includes("image")) ? /* @__PURE__ */ React.createElement(React.Fragment, null, item.url && /* @__PURE__ */ React.createElement(
|
|
12902
12907
|
components.Image,
|
|
@@ -12959,6 +12964,7 @@
|
|
|
12959
12964
|
mediaType: ["image", "video"],
|
|
12960
12965
|
camera: "back",
|
|
12961
12966
|
uploadIcon: /* @__PURE__ */ React.createElement(y, { size: "20px", color: "#808080" }),
|
|
12967
|
+
deleteIcon: /* @__PURE__ */ React.createElement(u$1, { color: "rgba(0,0,0,0.6)" }),
|
|
12962
12968
|
uploadLabel: "",
|
|
12963
12969
|
previewType: "picture",
|
|
12964
12970
|
fit: "cover",
|
|
@@ -12986,6 +12992,7 @@
|
|
|
12986
12992
|
const {
|
|
12987
12993
|
children,
|
|
12988
12994
|
uploadIcon,
|
|
12995
|
+
deleteIcon,
|
|
12989
12996
|
uploadLabel,
|
|
12990
12997
|
accept,
|
|
12991
12998
|
name,
|
|
@@ -13082,7 +13089,6 @@
|
|
|
13082
13089
|
}
|
|
13083
13090
|
if ((Taro.getEnv() === "WEAPP" || Taro.getEnv() === "JD") && Taro.chooseMedia) {
|
|
13084
13091
|
Taro.chooseMedia({
|
|
13085
|
-
/** 最多可以选择的文件个数 */
|
|
13086
13092
|
count: multiple ? maxCount * 1 - fileList.length : 1,
|
|
13087
13093
|
/** 文件类型 */
|
|
13088
13094
|
mediaType,
|
|
@@ -13094,16 +13100,13 @@
|
|
|
13094
13100
|
sizeType,
|
|
13095
13101
|
/** 仅在 sourceType 为 camera 时生效,使用前置或后置摄像头 */
|
|
13096
13102
|
camera,
|
|
13097
|
-
/** 接口调用失败的回调函数 */
|
|
13098
13103
|
fail: (res) => {
|
|
13099
13104
|
onFailure && onFailure(res);
|
|
13100
13105
|
},
|
|
13101
|
-
/** 接口调用成功的回调函数 */
|
|
13102
13106
|
success: onChangeMedia
|
|
13103
13107
|
});
|
|
13104
13108
|
} else {
|
|
13105
13109
|
Taro.chooseImage({
|
|
13106
|
-
// 选择数量
|
|
13107
13110
|
count: multiple ? maxCount * 1 - fileList.length : 1,
|
|
13108
13111
|
// 可以指定是原图还是压缩图,默认二者都有
|
|
13109
13112
|
sizeType,
|
|
@@ -13299,7 +13302,7 @@
|
|
|
13299
13302
|
const handleItemClick = (file, index) => {
|
|
13300
13303
|
onFileItemClick == null ? void 0 : onFileItemClick(file, index);
|
|
13301
13304
|
};
|
|
13302
|
-
return /* @__PURE__ */ React.createElement("div", { className: classes, ...restProps }, (children || previewType === "list") && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-slot" }, /* @__PURE__ */ React.createElement(React.Fragment, null, children || /* @__PURE__ */ React.createElement(Button, { nativeType: "button", size: "small", type: "primary" },
|
|
13305
|
+
return /* @__PURE__ */ React.createElement("div", { className: classes, ...restProps }, (children || previewType === "list") && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader-slot" }, /* @__PURE__ */ React.createElement(React.Fragment, null, children || /* @__PURE__ */ React.createElement(Button, { nativeType: "button", size: "small", type: "primary" }, locale.uploader.list), Number(maxCount) > fileList.length && /* @__PURE__ */ React.createElement(
|
|
13303
13306
|
Button,
|
|
13304
13307
|
{
|
|
13305
13308
|
nativeType: "button",
|
|
@@ -13316,6 +13319,7 @@
|
|
|
13316
13319
|
onDeleteItem,
|
|
13317
13320
|
handleItemClick,
|
|
13318
13321
|
previewUrl,
|
|
13322
|
+
deleteIcon,
|
|
13319
13323
|
children
|
|
13320
13324
|
}
|
|
13321
13325
|
}
|
|
@@ -13845,7 +13849,6 @@
|
|
|
13845
13849
|
};
|
|
13846
13850
|
const classPrefix$f = `nut-empty`;
|
|
13847
13851
|
const Empty = (props) => {
|
|
13848
|
-
useConfig$1();
|
|
13849
13852
|
const {
|
|
13850
13853
|
image,
|
|
13851
13854
|
imageSize,
|
|
@@ -14493,7 +14496,6 @@
|
|
|
14493
14496
|
...ComponentDefaults,
|
|
14494
14497
|
id: "",
|
|
14495
14498
|
duration: 3e3,
|
|
14496
|
-
// 时长
|
|
14497
14499
|
type: "danger",
|
|
14498
14500
|
position: "top",
|
|
14499
14501
|
visible: false,
|
|
@@ -16285,7 +16287,6 @@
|
|
|
16285
16287
|
destroy: false
|
|
16286
16288
|
};
|
|
16287
16289
|
const InternalCountDown = (props, ref) => {
|
|
16288
|
-
useConfig$1();
|
|
16289
16290
|
const {
|
|
16290
16291
|
paused,
|
|
16291
16292
|
startTime,
|
|
@@ -16314,7 +16315,6 @@
|
|
|
16314
16315
|
isIninted: false,
|
|
16315
16316
|
timer: 0,
|
|
16316
16317
|
restTime: 0,
|
|
16317
|
-
// 倒计时剩余时间时间
|
|
16318
16318
|
counting: !paused && autoStart,
|
|
16319
16319
|
// 是否处于倒计时中
|
|
16320
16320
|
handleEndTime: Date.now(),
|
|
@@ -18375,6 +18375,7 @@
|
|
|
18375
18375
|
const barrageContainer = React.useRef(null);
|
|
18376
18376
|
const barrageCWidth = React.useRef(0);
|
|
18377
18377
|
const timer = React.useRef(0);
|
|
18378
|
+
const domTimer = React.useRef(0);
|
|
18378
18379
|
const index = React.useRef(0);
|
|
18379
18380
|
const times = React.useRef([]);
|
|
18380
18381
|
const historyIndex = React.useRef(-1);
|
|
@@ -18396,28 +18397,34 @@
|
|
|
18396
18397
|
}
|
|
18397
18398
|
return 0;
|
|
18398
18399
|
};
|
|
18400
|
+
const clearDomTimeout = () => {
|
|
18401
|
+
if (domTimer.current) {
|
|
18402
|
+
clearTimeout(domTimer.current);
|
|
18403
|
+
domTimer.current = 0;
|
|
18404
|
+
}
|
|
18405
|
+
};
|
|
18399
18406
|
React.useEffect(() => {
|
|
18400
18407
|
const init = async () => {
|
|
18408
|
+
var _a;
|
|
18401
18409
|
if (barrageBody.current) {
|
|
18402
18410
|
barrageCWidth.current = await getNodeWidth(barrageBody.current);
|
|
18411
|
+
(_a = barrageBody.current) == null ? void 0 : _a.style.setProperty(
|
|
18412
|
+
"--move-distance",
|
|
18413
|
+
`-${barrageCWidth.current}px`
|
|
18414
|
+
);
|
|
18415
|
+
index.current = 0;
|
|
18416
|
+
run();
|
|
18403
18417
|
}
|
|
18404
18418
|
};
|
|
18405
|
-
|
|
18406
|
-
|
|
18407
|
-
var _a;
|
|
18408
|
-
(_a = barrageBody.current) == null ? void 0 : _a.style.setProperty(
|
|
18409
|
-
"--move-distance",
|
|
18410
|
-
`-${barrageCWidth.current}px`
|
|
18411
|
-
);
|
|
18412
|
-
index.current = 0;
|
|
18413
|
-
run();
|
|
18419
|
+
domTimer.current = window.setTimeout(() => {
|
|
18420
|
+
init();
|
|
18414
18421
|
}, 300);
|
|
18415
18422
|
return () => {
|
|
18416
|
-
|
|
18423
|
+
clearDomTimeout();
|
|
18417
18424
|
};
|
|
18418
18425
|
}, [list]);
|
|
18419
18426
|
const run = () => {
|
|
18420
|
-
|
|
18427
|
+
clearTimeout(timer.current);
|
|
18421
18428
|
let intervalCache = interval;
|
|
18422
18429
|
const _index = (loop ? index.current % list.length : index.current) % rows;
|
|
18423
18430
|
const result = times.current[_index] - rows * interval;
|
|
@@ -18428,7 +18435,30 @@
|
|
|
18428
18435
|
play();
|
|
18429
18436
|
}, intervalCache);
|
|
18430
18437
|
};
|
|
18431
|
-
const
|
|
18438
|
+
const setStyle = async (el, currentIndex) => {
|
|
18439
|
+
try {
|
|
18440
|
+
if (el) {
|
|
18441
|
+
const refe = await getRectByTaro(el);
|
|
18442
|
+
const width = refe.width;
|
|
18443
|
+
const height = refe.height;
|
|
18444
|
+
el.classList.add("move");
|
|
18445
|
+
const elScrollDuration = Math.round(
|
|
18446
|
+
width / barrageCWidth.current * duration
|
|
18447
|
+
);
|
|
18448
|
+
times.current[currentIndex] = elScrollDuration;
|
|
18449
|
+
el.style.animationDuration = `${duration + elScrollDuration}ms`;
|
|
18450
|
+
el.style.top = `${currentIndex * (height + gapY) + 20}px`;
|
|
18451
|
+
el.style.width = `${width}px`;
|
|
18452
|
+
}
|
|
18453
|
+
} catch (error) {
|
|
18454
|
+
console.log("异常自动流转到下一个", error);
|
|
18455
|
+
barrageContainer.current.removeChild(el);
|
|
18456
|
+
}
|
|
18457
|
+
el.addEventListener("animationend", () => {
|
|
18458
|
+
barrageContainer.current.removeChild(el);
|
|
18459
|
+
});
|
|
18460
|
+
};
|
|
18461
|
+
const play = () => {
|
|
18432
18462
|
if (!loop && index.current >= list.length) {
|
|
18433
18463
|
return;
|
|
18434
18464
|
}
|
|
@@ -18440,25 +18470,9 @@
|
|
|
18440
18470
|
}
|
|
18441
18471
|
historyIndex.current = currentIndex;
|
|
18442
18472
|
el.innerHTML = list[_index];
|
|
18443
|
-
el.classList.add("barrage-item");
|
|
18444
18473
|
barrageContainer.current.appendChild(el);
|
|
18445
|
-
|
|
18446
|
-
|
|
18447
|
-
const height = await getNodeWidth(el, "height");
|
|
18448
|
-
el.classList.add("move");
|
|
18449
|
-
const elScrollDuration = width / barrageCWidth.current * duration;
|
|
18450
|
-
times.current[currentIndex] = Math.ceil(elScrollDuration);
|
|
18451
|
-
el.style.animationDuration = `${(duration + elScrollDuration).toFixed(
|
|
18452
|
-
2
|
|
18453
|
-
)}ms`;
|
|
18454
|
-
el.style.top = `${currentIndex * (height + gapY) + 20}px`;
|
|
18455
|
-
el.style.width = `${width}px`;
|
|
18456
|
-
} catch (error) {
|
|
18457
|
-
console.log("异常自动流转到下一个");
|
|
18458
|
-
}
|
|
18459
|
-
el.addEventListener("animationend", () => {
|
|
18460
|
-
barrageContainer.current.removeChild(el);
|
|
18461
|
-
});
|
|
18474
|
+
el.classList.add("barrage-item");
|
|
18475
|
+
requestAnimationFrame(() => setStyle(el, currentIndex));
|
|
18462
18476
|
index.current++;
|
|
18463
18477
|
run();
|
|
18464
18478
|
};
|
|
@@ -18923,19 +18937,27 @@
|
|
|
18923
18937
|
maxZoom: 3,
|
|
18924
18938
|
space: 10,
|
|
18925
18939
|
toolbar: [
|
|
18926
|
-
/* @__PURE__ */ React.createElement(Button, { type: "danger", key: "cancel" }, "
|
|
18927
|
-
/* @__PURE__ */ React.createElement(Button, { key: "reset" }, "
|
|
18928
|
-
/* @__PURE__ */ React.createElement(Button, { key: "rotate" }, "
|
|
18929
|
-
/* @__PURE__ */ React.createElement(Button, { type: "success", key: "confirm" }, "
|
|
18940
|
+
/* @__PURE__ */ React.createElement(Button, { type: "danger", key: "cancel" }, "Cancel"),
|
|
18941
|
+
/* @__PURE__ */ React.createElement(Button, { key: "reset" }, "Reset"),
|
|
18942
|
+
/* @__PURE__ */ React.createElement(Button, { key: "rotate" }, "Rotate"),
|
|
18943
|
+
/* @__PURE__ */ React.createElement(Button, { type: "success", key: "confirm" }, "Confirm")
|
|
18930
18944
|
],
|
|
18931
18945
|
toolbarPosition: "bottom",
|
|
18932
|
-
editText: "
|
|
18946
|
+
editText: "Edit",
|
|
18933
18947
|
sizeType: ["original", "compressed"],
|
|
18934
18948
|
sourceType: ["album", "camera"],
|
|
18935
18949
|
shape: "square"
|
|
18936
18950
|
};
|
|
18937
18951
|
const classPrefix = `nut-avatar-cropper`;
|
|
18938
18952
|
const AvatarCropper = (props) => {
|
|
18953
|
+
const { locale } = useConfig$1();
|
|
18954
|
+
defaultProps.toolbar = [
|
|
18955
|
+
/* @__PURE__ */ React.createElement(Button, { type: "danger", key: "cancel" }, locale.cancel),
|
|
18956
|
+
/* @__PURE__ */ React.createElement(Button, { key: "reset" }, locale.reset),
|
|
18957
|
+
/* @__PURE__ */ React.createElement(Button, { key: "rotate" }, locale.avatarCropper.rotate),
|
|
18958
|
+
/* @__PURE__ */ React.createElement(Button, { type: "success", key: "confirm" }, locale.confirm)
|
|
18959
|
+
];
|
|
18960
|
+
defaultProps.editText = locale.edit;
|
|
18939
18961
|
const {
|
|
18940
18962
|
children,
|
|
18941
18963
|
toolbar,
|