@nutui/nutui-react-taro 2.0.19-beta.0 → 2.0.20-beta.0
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 -0
- package/dist/esm/ActionSheet.js +2 -2
- package/dist/esm/Address.js +3 -3
- package/dist/esm/Avatar.js +3 -2
- package/dist/esm/Calendar.js +2 -2
- package/dist/esm/Cascader.js +2 -2
- package/dist/esm/DatePicker.js +3 -3
- package/dist/esm/Form.js +21 -45
- package/dist/esm/Grid.js +3 -2
- package/dist/esm/GridItem.js +2 -1
- package/dist/esm/Image.js +3 -1
- package/dist/esm/ImagePreview.js +4 -2
- package/dist/esm/Menu.js +2 -2
- package/dist/esm/MenuItem.js +1 -1
- package/dist/esm/NumberKeyboard.js +2 -2
- package/dist/esm/Picker.js +2 -2
- package/dist/esm/Popover.js +2 -2
- package/dist/esm/Popup.js +1 -1
- package/dist/esm/ShortPassword.js +2 -2
- package/dist/esm/SideNavBar.js +2 -2
- package/dist/esm/Skeleton.js +4 -3
- package/dist/esm/Swiper.js +14 -7
- package/dist/esm/TimeSelect.js +2 -2
- package/dist/esm/Tour.js +3 -3
- package/dist/esm/Uploader.js +5 -3
- package/dist/esm/{actionsheet.taro-374745a3.js → actionsheet.taro-4ce9962a.js} +1 -1
- package/dist/esm/{address.taro-7b3ad807.js → address.taro-33910001.js} +2 -2
- package/dist/esm/{avatar.taro-0e574535.js → avatar.taro-1743c7c3.js} +1 -1
- package/dist/esm/{calendar.taro-2c342d6b.js → calendar.taro-45a9c705.js} +1 -1
- package/dist/esm/{cascader.taro-6ee25349.js → cascader.taro-505e8467.js} +1 -1
- package/dist/esm/{datepicker.taro-de668a19.js → datepicker.taro-725e96f0.js} +1 -1
- package/dist/esm/{grid.taro-f72acab8.js → grid.taro-13674639.js} +2 -1
- package/dist/esm/{griditem.taro-b7abc653.js → griditem.taro-9e1c493c.js} +2 -5
- package/dist/esm/{image.taro-a7ad2272.js → image.taro-fa4a92a1.js} +6 -5
- package/dist/esm/{imagepreview.taro-78c0a7b8.js → imagepreview.taro-fcd29363.js} +4 -3
- package/dist/esm/{menu.taro-f419b9ef.js → menu.taro-cf8d7d5b.js} +1 -1
- package/dist/esm/{menuitem.taro-d598a86e.js → menuitem.taro-b73e5ed3.js} +2 -0
- package/dist/esm/{numberkeyboard.taro-bd6a9439.js → numberkeyboard.taro-ec8f8435.js} +1 -1
- package/dist/esm/nutui-react.es.js +23 -22
- package/dist/esm/{picker.taro-e08d99a3.js → picker.taro-5f86e72b.js} +1 -1
- package/dist/esm/{popover.taro-6b946803.js → popover.taro-539d15e4.js} +1 -1
- package/dist/esm/{popup.taro-1636100a.js → popup.taro-3273aa87.js} +3 -1
- package/dist/esm/px-check-f83a9dc3.js +6 -0
- package/dist/esm/{shortpassword.taro-331d270c.js → shortpassword.taro-8e8c4102.js} +1 -1
- package/dist/esm/{sidenavbar.taro-39fb8ac6.js → sidenavbar.taro-97230c40.js} +1 -1
- package/dist/esm/{skeleton.taro-1f829d87.js → skeleton.taro-5a621338.js} +1 -1
- package/dist/esm/{timeselect.taro-e02f6bf9.js → timeselect.taro-892ca807.js} +1 -1
- package/dist/esm/{tour.taro-88cf1ba9.js → tour.taro-b38e06a5.js} +1 -1
- package/dist/esm/types/src/packages/uploader/demo.taro.d.ts +0 -15
- package/dist/esm/types/src/packages/uploader/file-item.d.ts +19 -0
- package/dist/esm/types/src/packages/uploader/index.d.ts +2 -1
- package/dist/esm/types/src/packages/uploader/index.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/uploader/preview.d.ts +2 -0
- package/dist/esm/types/src/packages/uploader/preview.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/uploader/upload.d.ts +3 -0
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +5 -23
- package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +10 -26
- package/dist/esm/{uploader.taro-56b2ca0d.js → uploader.taro-da0414ba.js} +148 -134
- 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/tr-TR.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 +291 -273
- package/dist/nutui.react.umd.js +291 -273
- package/dist/style.mjs +1 -1
- package/dist/types/packages/calendar/calendar.taro.d.ts +4 -4
- package/dist/types/packages/uploader/file-item.d.ts +19 -0
- package/dist/types/packages/uploader/index.taro.d.ts +2 -1
- package/dist/types/packages/uploader/preview.taro.d.ts +2 -0
- package/dist/types/packages/uploader/upload.d.ts +3 -0
- package/dist/types/packages/uploader/uploader.taro.d.ts +10 -26
- package/package.json +1 -1
package/dist/nutui.react.umd.js
CHANGED
|
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8
8
|
return value;
|
|
9
9
|
};
|
|
10
10
|
/*!
|
|
11
|
-
* @nutui/nutui-react-taro v2.0.
|
|
11
|
+
* @nutui/nutui-react-taro v2.0.20 Fri Oct 13 2023 13:54:07 GMT+0800 (China Standard Time)
|
|
12
12
|
* (c) 2023 @jdf2e.
|
|
13
13
|
* Released under the MIT License.
|
|
14
14
|
*/
|
|
@@ -3238,6 +3238,9 @@ var __publicField = (obj, key, value) => {
|
|
|
3238
3238
|
));
|
|
3239
3239
|
};
|
|
3240
3240
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
3241
|
+
const pxCheck = (value) => {
|
|
3242
|
+
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
3243
|
+
};
|
|
3241
3244
|
const defaultProps$1r = {
|
|
3242
3245
|
src: "",
|
|
3243
3246
|
error: true,
|
|
@@ -3272,14 +3275,13 @@ var __publicField = (obj, key, value) => {
|
|
|
3272
3275
|
onError && onError(e);
|
|
3273
3276
|
}
|
|
3274
3277
|
};
|
|
3275
|
-
const pxCheck2 = (value) => {
|
|
3276
|
-
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
3277
|
-
};
|
|
3278
3278
|
const containerStyle = {
|
|
3279
|
-
|
|
3280
|
-
|
|
3279
|
+
// eslint-disable-next-line no-nested-ternary
|
|
3280
|
+
height: height ? pxCheck(height) : Taro.getEnv() === "WEB" ? "" : "100px",
|
|
3281
|
+
// eslint-disable-next-line no-nested-ternary
|
|
3282
|
+
width: width ? pxCheck(width) : Taro.getEnv() === "WEB" ? "" : "100%",
|
|
3281
3283
|
overflow: radius !== void 0 && radius !== null ? "hidden" : "",
|
|
3282
|
-
borderRadius: radius !== void 0 && radius !== null ?
|
|
3284
|
+
borderRadius: radius !== void 0 && radius !== null ? pxCheck(radius) : ""
|
|
3283
3285
|
};
|
|
3284
3286
|
const imgStyle = {
|
|
3285
3287
|
...style
|
|
@@ -5224,9 +5226,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5224
5226
|
}
|
|
5225
5227
|
};
|
|
5226
5228
|
const GridContext = React.createContext(gridContext);
|
|
5227
|
-
const pxCheck = (value) => {
|
|
5228
|
-
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
5229
|
-
};
|
|
5230
5229
|
const defaultProps$1o = {
|
|
5231
5230
|
text: "",
|
|
5232
5231
|
columns: 4,
|
|
@@ -6191,7 +6190,9 @@ var __publicField = (obj, key, value) => {
|
|
|
6191
6190
|
const open2 = () => {
|
|
6192
6191
|
if (!innerVisible) {
|
|
6193
6192
|
setInnerVisible(true);
|
|
6194
|
-
|
|
6193
|
+
if (props.zIndex === void 0) {
|
|
6194
|
+
setIndex(++_zIndex);
|
|
6195
|
+
}
|
|
6195
6196
|
}
|
|
6196
6197
|
if (destroyOnClose) {
|
|
6197
6198
|
setShowChildren(true);
|
|
@@ -10942,11 +10943,11 @@ var __publicField = (obj, key, value) => {
|
|
|
10942
10943
|
...this.store,
|
|
10943
10944
|
...newStore
|
|
10944
10945
|
};
|
|
10945
|
-
this.fieldEntities.forEach((
|
|
10946
|
-
const { name } =
|
|
10946
|
+
this.fieldEntities.forEach((entity) => {
|
|
10947
|
+
const { name } = entity.props;
|
|
10947
10948
|
Object.keys(newStore).forEach((key) => {
|
|
10948
10949
|
if (key === name) {
|
|
10949
|
-
|
|
10950
|
+
entity.onStoreChange("update");
|
|
10950
10951
|
}
|
|
10951
10952
|
});
|
|
10952
10953
|
});
|
|
@@ -10957,44 +10958,19 @@ var __publicField = (obj, key, value) => {
|
|
|
10957
10958
|
...callback
|
|
10958
10959
|
};
|
|
10959
10960
|
});
|
|
10960
|
-
__publicField(this, "
|
|
10961
|
-
|
|
10961
|
+
__publicField(this, "validateFields", async (nameList) => {
|
|
10962
|
+
var _a;
|
|
10963
|
+
let filterEntitys = [];
|
|
10964
|
+
const errs = [];
|
|
10962
10965
|
this.errors.length = 0;
|
|
10963
|
-
this.fieldEntities.forEach((entity) => {
|
|
10964
|
-
var _a;
|
|
10965
|
-
const { name, rules: rules2 = [] } = entity.props;
|
|
10966
|
-
const descriptor = {};
|
|
10967
|
-
if (rules2.length) {
|
|
10968
|
-
if (rules2.length > 1) {
|
|
10969
|
-
descriptor[name] = [];
|
|
10970
|
-
rules2.forEach((v) => {
|
|
10971
|
-
descriptor[name].push(v);
|
|
10972
|
-
});
|
|
10973
|
-
} else {
|
|
10974
|
-
descriptor[name] = rules2[0];
|
|
10975
|
-
}
|
|
10976
|
-
}
|
|
10977
|
-
const validator = new Schema(descriptor);
|
|
10978
|
-
validator.messages();
|
|
10979
|
-
validator.validate({ [name]: (_a = this.store) == null ? void 0 : _a[name] }, (errors) => {
|
|
10980
|
-
if (errors) {
|
|
10981
|
-
err.push(...errors);
|
|
10982
|
-
this.errors[name] = errors;
|
|
10983
|
-
}
|
|
10984
|
-
entity.onStoreChange("validate");
|
|
10985
|
-
});
|
|
10986
|
-
});
|
|
10987
|
-
return err;
|
|
10988
|
-
});
|
|
10989
|
-
__publicField(this, "validateFields", (nameList) => {
|
|
10990
10966
|
if (!nameList || nameList.length === 0) {
|
|
10991
|
-
this.
|
|
10992
|
-
|
|
10967
|
+
filterEntitys = this.fieldEntities;
|
|
10968
|
+
} else {
|
|
10969
|
+
filterEntitys = this.fieldEntities.filter(
|
|
10970
|
+
({ props: { name } }) => nameList.includes(name)
|
|
10971
|
+
);
|
|
10993
10972
|
}
|
|
10994
|
-
|
|
10995
|
-
return nameList.includes(name);
|
|
10996
|
-
}).forEach((entity) => {
|
|
10997
|
-
var _a;
|
|
10973
|
+
for (const entity of filterEntitys) {
|
|
10998
10974
|
const { name, rules: rules2 = [] } = entity.props;
|
|
10999
10975
|
const descriptor = {};
|
|
11000
10976
|
if (rules2.length) {
|
|
@@ -11008,19 +10984,22 @@ var __publicField = (obj, key, value) => {
|
|
|
11008
10984
|
}
|
|
11009
10985
|
}
|
|
11010
10986
|
const validator = new Schema(descriptor);
|
|
11011
|
-
|
|
11012
|
-
validator.validate({ [name]: (_a = this.store) == null ? void 0 : _a[name] }, (errors) => {
|
|
10987
|
+
try {
|
|
11013
10988
|
this.errors[name] = [];
|
|
10989
|
+
await validator.validate({ [name]: (_a = this.store) == null ? void 0 : _a[name] });
|
|
10990
|
+
} catch ({ errors }) {
|
|
11014
10991
|
if (errors) {
|
|
10992
|
+
errs.push(...errors);
|
|
11015
10993
|
this.errors[name] = errors;
|
|
11016
10994
|
}
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
}
|
|
10995
|
+
}
|
|
10996
|
+
entity.onStoreChange("validate");
|
|
10997
|
+
}
|
|
10998
|
+
return errs;
|
|
11020
10999
|
});
|
|
11021
|
-
__publicField(this, "submit", () => {
|
|
11000
|
+
__publicField(this, "submit", async () => {
|
|
11022
11001
|
var _a, _b, _c, _d;
|
|
11023
|
-
const errors = this.
|
|
11002
|
+
const errors = await this.validateFields();
|
|
11024
11003
|
if (errors.length === 0) {
|
|
11025
11004
|
(_b = (_a = this.callbacks).onFinish) == null ? void 0 : _b.call(_a, this.store);
|
|
11026
11005
|
} else if (errors.length > 0) {
|
|
@@ -11810,6 +11789,8 @@ var __publicField = (obj, key, value) => {
|
|
|
11810
11789
|
}, [showPopup]);
|
|
11811
11790
|
const windowHeight = React.useMemo(() => Taro.getSystemInfoSync().windowHeight, []);
|
|
11812
11791
|
const updateItemOffset = React.useCallback(() => {
|
|
11792
|
+
if (!parent.lockScroll)
|
|
11793
|
+
return;
|
|
11813
11794
|
const p = parent.menuRef.current;
|
|
11814
11795
|
p.getBoundingClientRect().then((rect) => {
|
|
11815
11796
|
if (rect) {
|
|
@@ -13457,80 +13438,6 @@ var __publicField = (obj, key, value) => {
|
|
|
13457
13438
|
};
|
|
13458
13439
|
TextArea.defaultProps = defaultProps$J;
|
|
13459
13440
|
TextArea.displayName = "NutTextArea";
|
|
13460
|
-
const defaultProps$I = {
|
|
13461
|
-
...ComponentDefaults,
|
|
13462
|
-
percent: 0,
|
|
13463
|
-
showText: false,
|
|
13464
|
-
animated: false,
|
|
13465
|
-
delay: 0
|
|
13466
|
-
};
|
|
13467
|
-
const Progress = (props) => {
|
|
13468
|
-
const {
|
|
13469
|
-
className,
|
|
13470
|
-
style,
|
|
13471
|
-
percent,
|
|
13472
|
-
background,
|
|
13473
|
-
color,
|
|
13474
|
-
strokeWidth,
|
|
13475
|
-
showText,
|
|
13476
|
-
animated,
|
|
13477
|
-
children,
|
|
13478
|
-
delay,
|
|
13479
|
-
...rest
|
|
13480
|
-
} = {
|
|
13481
|
-
...defaultProps$I,
|
|
13482
|
-
...props
|
|
13483
|
-
};
|
|
13484
|
-
const classPrefix2 = "nut-progress";
|
|
13485
|
-
const classesInner = classNames({
|
|
13486
|
-
[`${classPrefix2}-inner`]: true,
|
|
13487
|
-
[`${classPrefix2}-active`]: animated
|
|
13488
|
-
});
|
|
13489
|
-
const stylesOuter = {
|
|
13490
|
-
height: `${strokeWidth}px`,
|
|
13491
|
-
background
|
|
13492
|
-
};
|
|
13493
|
-
const [displayPercent, setDispalyPercent] = React.useState(0);
|
|
13494
|
-
const stylesInner = {
|
|
13495
|
-
width: `${displayPercent}%`,
|
|
13496
|
-
background: color
|
|
13497
|
-
};
|
|
13498
|
-
React.useEffect(() => {
|
|
13499
|
-
setDispalyPercent(percent);
|
|
13500
|
-
}, [percent]);
|
|
13501
|
-
React.useEffect(() => {
|
|
13502
|
-
let timer = null;
|
|
13503
|
-
if (delay) {
|
|
13504
|
-
setDispalyPercent(0);
|
|
13505
|
-
timer = setTimeout(() => {
|
|
13506
|
-
setDispalyPercent(percent);
|
|
13507
|
-
}, delay);
|
|
13508
|
-
}
|
|
13509
|
-
return () => {
|
|
13510
|
-
timer && clearTimeout(timer);
|
|
13511
|
-
};
|
|
13512
|
-
}, []);
|
|
13513
|
-
return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix2, className), style, ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-outer`, style: stylesOuter }, /* @__PURE__ */ React.createElement("div", { className: classesInner, style: stylesInner }, showText && /* @__PURE__ */ React.createElement(
|
|
13514
|
-
"div",
|
|
13515
|
-
{
|
|
13516
|
-
className: `${classPrefix2}-text`,
|
|
13517
|
-
style: { left: `${displayPercent}%` }
|
|
13518
|
-
},
|
|
13519
|
-
children || /* @__PURE__ */ React.createElement(
|
|
13520
|
-
"div",
|
|
13521
|
-
{
|
|
13522
|
-
className: `${classPrefix2}-text__inner`,
|
|
13523
|
-
style: {
|
|
13524
|
-
background: color
|
|
13525
|
-
}
|
|
13526
|
-
},
|
|
13527
|
-
percent,
|
|
13528
|
-
"%"
|
|
13529
|
-
)
|
|
13530
|
-
))));
|
|
13531
|
-
};
|
|
13532
|
-
Progress.defaultProps = defaultProps$I;
|
|
13533
|
-
Progress.displayName = "NutProgress";
|
|
13534
13441
|
class UploadOptions {
|
|
13535
13442
|
constructor() {
|
|
13536
13443
|
__publicField(this, "url", "");
|
|
@@ -13551,6 +13458,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13551
13458
|
__publicField(this, "beforeXhrUpload");
|
|
13552
13459
|
}
|
|
13553
13460
|
}
|
|
13461
|
+
const UPLOADING = "uploading";
|
|
13462
|
+
const SUCCESS = "success";
|
|
13463
|
+
const ERROR = "error";
|
|
13554
13464
|
class Upload {
|
|
13555
13465
|
constructor(options) {
|
|
13556
13466
|
__publicField(this, "options");
|
|
@@ -13672,6 +13582,179 @@ var __publicField = (obj, key, value) => {
|
|
|
13672
13582
|
done();
|
|
13673
13583
|
}
|
|
13674
13584
|
};
|
|
13585
|
+
class FileItem {
|
|
13586
|
+
constructor() {
|
|
13587
|
+
__publicField(this, "status", "ready");
|
|
13588
|
+
__publicField(this, "message", "准备中..");
|
|
13589
|
+
__publicField(this, "uid", (/* @__PURE__ */ new Date()).getTime().toString());
|
|
13590
|
+
__publicField(this, "name");
|
|
13591
|
+
__publicField(this, "url");
|
|
13592
|
+
__publicField(this, "type");
|
|
13593
|
+
__publicField(this, "path");
|
|
13594
|
+
__publicField(this, "percentage", 0);
|
|
13595
|
+
__publicField(this, "formData", {});
|
|
13596
|
+
__publicField(this, "responseText");
|
|
13597
|
+
__publicField(this, "loadingIcon");
|
|
13598
|
+
__publicField(this, "failIcon");
|
|
13599
|
+
}
|
|
13600
|
+
}
|
|
13601
|
+
const defaultProps$I = {
|
|
13602
|
+
...ComponentDefaults,
|
|
13603
|
+
percent: 0,
|
|
13604
|
+
showText: false,
|
|
13605
|
+
animated: false,
|
|
13606
|
+
delay: 0
|
|
13607
|
+
};
|
|
13608
|
+
const Progress = (props) => {
|
|
13609
|
+
const {
|
|
13610
|
+
className,
|
|
13611
|
+
style,
|
|
13612
|
+
percent,
|
|
13613
|
+
background,
|
|
13614
|
+
color,
|
|
13615
|
+
strokeWidth,
|
|
13616
|
+
showText,
|
|
13617
|
+
animated,
|
|
13618
|
+
children,
|
|
13619
|
+
delay,
|
|
13620
|
+
...rest
|
|
13621
|
+
} = {
|
|
13622
|
+
...defaultProps$I,
|
|
13623
|
+
...props
|
|
13624
|
+
};
|
|
13625
|
+
const classPrefix2 = "nut-progress";
|
|
13626
|
+
const classesInner = classNames({
|
|
13627
|
+
[`${classPrefix2}-inner`]: true,
|
|
13628
|
+
[`${classPrefix2}-active`]: animated
|
|
13629
|
+
});
|
|
13630
|
+
const stylesOuter = {
|
|
13631
|
+
height: `${strokeWidth}px`,
|
|
13632
|
+
background
|
|
13633
|
+
};
|
|
13634
|
+
const [displayPercent, setDispalyPercent] = React.useState(0);
|
|
13635
|
+
const stylesInner = {
|
|
13636
|
+
width: `${displayPercent}%`,
|
|
13637
|
+
background: color
|
|
13638
|
+
};
|
|
13639
|
+
React.useEffect(() => {
|
|
13640
|
+
setDispalyPercent(percent);
|
|
13641
|
+
}, [percent]);
|
|
13642
|
+
React.useEffect(() => {
|
|
13643
|
+
let timer = null;
|
|
13644
|
+
if (delay) {
|
|
13645
|
+
setDispalyPercent(0);
|
|
13646
|
+
timer = setTimeout(() => {
|
|
13647
|
+
setDispalyPercent(percent);
|
|
13648
|
+
}, delay);
|
|
13649
|
+
}
|
|
13650
|
+
return () => {
|
|
13651
|
+
timer && clearTimeout(timer);
|
|
13652
|
+
};
|
|
13653
|
+
}, []);
|
|
13654
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix2, className), style, ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-outer`, style: stylesOuter }, /* @__PURE__ */ React.createElement("div", { className: classesInner, style: stylesInner }, showText && /* @__PURE__ */ React.createElement(
|
|
13655
|
+
"div",
|
|
13656
|
+
{
|
|
13657
|
+
className: `${classPrefix2}-text`,
|
|
13658
|
+
style: { left: `${displayPercent}%` }
|
|
13659
|
+
},
|
|
13660
|
+
children || /* @__PURE__ */ React.createElement(
|
|
13661
|
+
"div",
|
|
13662
|
+
{
|
|
13663
|
+
className: `${classPrefix2}-text__inner`,
|
|
13664
|
+
style: {
|
|
13665
|
+
background: color
|
|
13666
|
+
}
|
|
13667
|
+
},
|
|
13668
|
+
percent,
|
|
13669
|
+
"%"
|
|
13670
|
+
)
|
|
13671
|
+
))));
|
|
13672
|
+
};
|
|
13673
|
+
Progress.defaultProps = defaultProps$I;
|
|
13674
|
+
Progress.displayName = "NutProgress";
|
|
13675
|
+
const Preview = ({
|
|
13676
|
+
fileList,
|
|
13677
|
+
previewType,
|
|
13678
|
+
deletable,
|
|
13679
|
+
onDeleteItem,
|
|
13680
|
+
handleItemClick,
|
|
13681
|
+
previewUrl,
|
|
13682
|
+
children
|
|
13683
|
+
}) => {
|
|
13684
|
+
const renderIcon = (item) => {
|
|
13685
|
+
if (item.status === ERROR) {
|
|
13686
|
+
return item.failIcon || /* @__PURE__ */ React.createElement(a$n, { color: "#fff" });
|
|
13687
|
+
}
|
|
13688
|
+
return item.loadingIcon || /* @__PURE__ */ React.createElement(r$h, { className: "nut-icon-loading", color: "#fff" });
|
|
13689
|
+
};
|
|
13690
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, fileList.length !== 0 && fileList.map((item, index) => {
|
|
13691
|
+
var _a;
|
|
13692
|
+
return /* @__PURE__ */ React.createElement(
|
|
13693
|
+
"div",
|
|
13694
|
+
{
|
|
13695
|
+
className: `nut-uploader__preview ${previewType}`,
|
|
13696
|
+
key: item.uid
|
|
13697
|
+
},
|
|
13698
|
+
previewType === "picture" && deletable && /* @__PURE__ */ React.createElement(
|
|
13699
|
+
a$n,
|
|
13700
|
+
{
|
|
13701
|
+
color: "rgba(0,0,0,0.6)",
|
|
13702
|
+
className: "close",
|
|
13703
|
+
onClick: () => onDeleteItem(item, index)
|
|
13704
|
+
}
|
|
13705
|
+
),
|
|
13706
|
+
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(
|
|
13707
|
+
components.Image,
|
|
13708
|
+
{
|
|
13709
|
+
className: "nut-uploader__preview-img__c",
|
|
13710
|
+
style: { objectFit: "fill" },
|
|
13711
|
+
mode: "aspectFit",
|
|
13712
|
+
src: item.url,
|
|
13713
|
+
onClick: () => handleItemClick(item)
|
|
13714
|
+
}
|
|
13715
|
+
)) : /* @__PURE__ */ React.createElement(React.Fragment, null, previewUrl ? /* @__PURE__ */ React.createElement(
|
|
13716
|
+
components.Image,
|
|
13717
|
+
{
|
|
13718
|
+
className: "nut-uploader__preview-img__c",
|
|
13719
|
+
mode: "aspectFit",
|
|
13720
|
+
src: previewUrl,
|
|
13721
|
+
onClick: () => handleItemClick(item)
|
|
13722
|
+
}
|
|
13723
|
+
) : /* @__PURE__ */ React.createElement("div", { className: "nut-uploader__preview-img__file" }, /* @__PURE__ */ React.createElement(
|
|
13724
|
+
"div",
|
|
13725
|
+
{
|
|
13726
|
+
onClick: () => handleItemClick(item),
|
|
13727
|
+
className: "nut-uploader__preview-img__file__name"
|
|
13728
|
+
},
|
|
13729
|
+
/* @__PURE__ */ React.createElement(a$i, { color: "#808080" }),
|
|
13730
|
+
/* @__PURE__ */ React.createElement("span", null, " ", item.name)
|
|
13731
|
+
))), item.status === "success" ? /* @__PURE__ */ React.createElement("div", { className: "tips" }, item.name) : null),
|
|
13732
|
+
previewType === "list" && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader__preview-list" }, /* @__PURE__ */ React.createElement(
|
|
13733
|
+
"div",
|
|
13734
|
+
{
|
|
13735
|
+
className: `nut-uploader__preview-img__file__name ${item.status}`,
|
|
13736
|
+
onClick: () => handleItemClick(item)
|
|
13737
|
+
},
|
|
13738
|
+
/* @__PURE__ */ React.createElement(a$i, null),
|
|
13739
|
+
/* @__PURE__ */ React.createElement("span", null, " ", item.name)
|
|
13740
|
+
), deletable && /* @__PURE__ */ React.createElement(
|
|
13741
|
+
a$p,
|
|
13742
|
+
{
|
|
13743
|
+
color: "#808080",
|
|
13744
|
+
className: "nut-uploader__preview-img__file__del",
|
|
13745
|
+
onClick: () => onDeleteItem(item, index)
|
|
13746
|
+
}
|
|
13747
|
+
), item.status === "uploading" && /* @__PURE__ */ React.createElement(
|
|
13748
|
+
Progress,
|
|
13749
|
+
{
|
|
13750
|
+
percent: item.percentage,
|
|
13751
|
+
color: "linear-gradient(270deg, rgba(18,126,255,1) 0%,rgba(32,147,255,1) 32.815625%,rgba(13,242,204,1) 100%)",
|
|
13752
|
+
showText: false
|
|
13753
|
+
}
|
|
13754
|
+
))
|
|
13755
|
+
);
|
|
13756
|
+
}));
|
|
13757
|
+
};
|
|
13675
13758
|
const defaultProps$H = {
|
|
13676
13759
|
...ComponentDefaults,
|
|
13677
13760
|
url: "",
|
|
@@ -13680,7 +13763,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13680
13763
|
sourceType: ["album", "camera"],
|
|
13681
13764
|
mediaType: ["image", "video"],
|
|
13682
13765
|
camera: "back",
|
|
13683
|
-
uploadIcon:
|
|
13766
|
+
uploadIcon: /* @__PURE__ */ React.createElement(a$a, { size: "20px", color: "#808080" }),
|
|
13684
13767
|
uploadLabel: "",
|
|
13685
13768
|
previewType: "picture",
|
|
13686
13769
|
fit: "cover",
|
|
@@ -13703,19 +13786,6 @@ var __publicField = (obj, key, value) => {
|
|
|
13703
13786
|
return true;
|
|
13704
13787
|
}
|
|
13705
13788
|
};
|
|
13706
|
-
class FileItem {
|
|
13707
|
-
constructor() {
|
|
13708
|
-
__publicField(this, "status", "ready");
|
|
13709
|
-
__publicField(this, "message", "准备中..");
|
|
13710
|
-
__publicField(this, "uid", Date.now().toString());
|
|
13711
|
-
__publicField(this, "name");
|
|
13712
|
-
__publicField(this, "url");
|
|
13713
|
-
__publicField(this, "type");
|
|
13714
|
-
__publicField(this, "path");
|
|
13715
|
-
__publicField(this, "percentage", 0);
|
|
13716
|
-
__publicField(this, "formData", {});
|
|
13717
|
-
}
|
|
13718
|
-
}
|
|
13719
13789
|
const InternalUploader = (props, ref) => {
|
|
13720
13790
|
const { locale } = useConfig$1();
|
|
13721
13791
|
const {
|
|
@@ -13761,13 +13831,15 @@ var __publicField = (obj, key, value) => {
|
|
|
13761
13831
|
beforeDelete,
|
|
13762
13832
|
...restProps
|
|
13763
13833
|
} = { ...defaultProps$H, ...props };
|
|
13764
|
-
const [fileList, setFileList] =
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13768
|
-
|
|
13834
|
+
const [fileList, setFileList] = usePropsValue({
|
|
13835
|
+
value,
|
|
13836
|
+
defaultValue,
|
|
13837
|
+
finalValue: [],
|
|
13838
|
+
onChange: (v) => {
|
|
13839
|
+
onChange == null ? void 0 : onChange(v);
|
|
13769
13840
|
}
|
|
13770
|
-
}
|
|
13841
|
+
});
|
|
13842
|
+
const [uploadQueue, setUploadQueue] = React.useState([]);
|
|
13771
13843
|
const classes = classNames(className, "nut-uploader");
|
|
13772
13844
|
React.useImperativeHandle(ref, () => ({
|
|
13773
13845
|
submit: () => {
|
|
@@ -13858,63 +13930,60 @@ var __publicField = (obj, key, value) => {
|
|
|
13858
13930
|
uploadOption.beforeXhrUpload = beforeXhrUpload;
|
|
13859
13931
|
uploadOption.onStart = (option) => {
|
|
13860
13932
|
clearUploadQueue(index);
|
|
13861
|
-
setFileList(
|
|
13862
|
-
|
|
13933
|
+
setFileList(
|
|
13934
|
+
fileList.map((item) => {
|
|
13863
13935
|
if (item.uid === fileItem.uid) {
|
|
13864
13936
|
item.status = "ready";
|
|
13865
13937
|
item.message = locale.uploader.readyUpload;
|
|
13866
13938
|
}
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13939
|
+
return item;
|
|
13940
|
+
})
|
|
13941
|
+
);
|
|
13870
13942
|
onStart && onStart(option);
|
|
13871
13943
|
};
|
|
13872
13944
|
uploadOption.onProgress = (e, option) => {
|
|
13873
|
-
setFileList(
|
|
13874
|
-
|
|
13945
|
+
setFileList(
|
|
13946
|
+
fileList.map((item) => {
|
|
13875
13947
|
if (item.uid === fileItem.uid) {
|
|
13876
|
-
item.status =
|
|
13948
|
+
item.status = UPLOADING;
|
|
13877
13949
|
item.message = locale.uploader.uploading;
|
|
13878
13950
|
item.percentage = e.progress;
|
|
13879
13951
|
onProgress && onProgress({ e, option, percentage: item.percentage });
|
|
13880
13952
|
}
|
|
13881
|
-
|
|
13882
|
-
|
|
13883
|
-
|
|
13953
|
+
return item;
|
|
13954
|
+
})
|
|
13955
|
+
);
|
|
13884
13956
|
};
|
|
13885
13957
|
uploadOption.onSuccess = (responseText, option) => {
|
|
13886
|
-
|
|
13887
|
-
|
|
13888
|
-
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
|
|
13892
|
-
|
|
13893
|
-
}
|
|
13894
|
-
});
|
|
13895
|
-
return [...fileList2];
|
|
13958
|
+
const list = fileList.map((item) => {
|
|
13959
|
+
if (item.uid === fileItem.uid) {
|
|
13960
|
+
item.status = SUCCESS;
|
|
13961
|
+
item.message = locale.uploader.success;
|
|
13962
|
+
item.responseText = responseText;
|
|
13963
|
+
}
|
|
13964
|
+
return item;
|
|
13896
13965
|
});
|
|
13897
|
-
|
|
13966
|
+
setFileList(list);
|
|
13967
|
+
onSuccess == null ? void 0 : onSuccess({
|
|
13898
13968
|
responseText,
|
|
13899
13969
|
option,
|
|
13900
|
-
fileList
|
|
13970
|
+
fileList: list
|
|
13901
13971
|
});
|
|
13902
13972
|
};
|
|
13903
13973
|
uploadOption.onFailure = (responseText, option) => {
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13909
|
-
|
|
13910
|
-
|
|
13911
|
-
});
|
|
13912
|
-
return [...fileList2];
|
|
13974
|
+
const list = fileList.map((item) => {
|
|
13975
|
+
if (item.uid === fileItem.uid) {
|
|
13976
|
+
item.status = ERROR;
|
|
13977
|
+
item.message = locale.uploader.error;
|
|
13978
|
+
item.responseText = responseText;
|
|
13979
|
+
}
|
|
13980
|
+
return item;
|
|
13913
13981
|
});
|
|
13914
|
-
|
|
13982
|
+
setFileList(list);
|
|
13983
|
+
onFailure == null ? void 0 : onFailure({
|
|
13915
13984
|
responseText,
|
|
13916
13985
|
option,
|
|
13917
|
-
fileList
|
|
13986
|
+
fileList: list
|
|
13918
13987
|
});
|
|
13919
13988
|
};
|
|
13920
13989
|
const task = new UploaderTaro(uploadOption);
|
|
@@ -13948,11 +14017,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13948
14017
|
fileItem.status = "ready";
|
|
13949
14018
|
fileItem.type = fileType;
|
|
13950
14019
|
fileItem.uid = `${fileItem.uid}_${index}`;
|
|
13951
|
-
|
|
13952
|
-
fileItem.message = locale.uploader.readyUpload;
|
|
13953
|
-
} else {
|
|
13954
|
-
fileItem.message = locale.uploader.waitingUpload;
|
|
13955
|
-
}
|
|
14020
|
+
fileItem.message = autoUpload ? locale.uploader.readyUpload : locale.uploader.waitingUpload;
|
|
13956
14021
|
if (Taro.getEnv() === "WEB") {
|
|
13957
14022
|
const formData = new FormData();
|
|
13958
14023
|
for (const [key, value2] of Object.entries(data)) {
|
|
@@ -13969,7 +14034,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13969
14034
|
fileItem.url = fileType === "video" ? file.thumbTempFilePath : filepath;
|
|
13970
14035
|
}
|
|
13971
14036
|
fileList.push(fileItem);
|
|
13972
|
-
setFileList(
|
|
14037
|
+
setFileList(fileList);
|
|
13973
14038
|
executeUpload(fileItem, index);
|
|
13974
14039
|
});
|
|
13975
14040
|
};
|
|
@@ -13994,9 +14059,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13994
14059
|
return filterFile;
|
|
13995
14060
|
};
|
|
13996
14061
|
const deleted = (file, index) => {
|
|
13997
|
-
fileList.
|
|
13998
|
-
onDelete
|
|
13999
|
-
setFileList(
|
|
14062
|
+
const deletedFileList = fileList.filter((file2, idx) => idx !== index);
|
|
14063
|
+
onDelete == null ? void 0 : onDelete(file, deletedFileList);
|
|
14064
|
+
setFileList(deletedFileList);
|
|
14000
14065
|
};
|
|
14001
14066
|
const onDeleteItem = (file, index) => {
|
|
14002
14067
|
clearUploadQueue(index);
|
|
@@ -14009,88 +14074,34 @@ var __publicField = (obj, key, value) => {
|
|
|
14009
14074
|
const { tempFiles } = res;
|
|
14010
14075
|
const _files = filterFiles(tempFiles);
|
|
14011
14076
|
readFile(_files);
|
|
14012
|
-
onChange && onChange({ fileList });
|
|
14013
14077
|
};
|
|
14014
14078
|
const onChangeImage = (res) => {
|
|
14015
14079
|
const { tempFiles } = res;
|
|
14016
14080
|
const _files = filterFiles(tempFiles);
|
|
14017
14081
|
readFile(_files);
|
|
14018
|
-
onChange && onChange({ fileList });
|
|
14019
14082
|
};
|
|
14020
14083
|
const handleItemClick = (file) => {
|
|
14021
|
-
onFileItemClick
|
|
14084
|
+
onFileItemClick == null ? void 0 : onFileItemClick(file);
|
|
14022
14085
|
};
|
|
14023
|
-
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, { size: "small", type: "primary" }, "上传文件"), maxCount > fileList.length && /* @__PURE__ */ React.createElement(Button, { className: "nut-uploader__input", onClick: _chooseImage }))),
|
|
14024
|
-
|
|
14025
|
-
|
|
14026
|
-
{
|
|
14027
|
-
|
|
14028
|
-
|
|
14029
|
-
|
|
14030
|
-
|
|
14031
|
-
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
|
|
14037
|
-
),
|
|
14038
|
-
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" }, item.failIcon !== " " && item.loadingIcon !== " " && (item.status === "error" ? item.failIcon || /* @__PURE__ */ React.createElement(a$n, { color: "#fff" }) : item.loadingIcon || /* @__PURE__ */ React.createElement(r$h, { color: "#fff" })), /* @__PURE__ */ React.createElement("div", { className: "nut-uploader__preview__progress__msg" }, item.message)), item.type.includes("image") ? /* @__PURE__ */ React.createElement(React.Fragment, null, item.url && /* @__PURE__ */ React.createElement(
|
|
14039
|
-
components.Image,
|
|
14040
|
-
{
|
|
14041
|
-
className: "nut-uploader__preview-img__c",
|
|
14042
|
-
style: { objectFit: fit },
|
|
14043
|
-
mode: "aspectFit",
|
|
14044
|
-
src: item.url,
|
|
14045
|
-
onClick: () => handleItemClick(item)
|
|
14046
|
-
}
|
|
14047
|
-
)) : /* @__PURE__ */ React.createElement(React.Fragment, null, previewUrl ? /* @__PURE__ */ React.createElement(
|
|
14048
|
-
components.Image,
|
|
14049
|
-
{
|
|
14050
|
-
className: "nut-uploader__preview-img__c",
|
|
14051
|
-
mode: "aspectFit",
|
|
14052
|
-
src: previewUrl,
|
|
14053
|
-
onClick: () => handleItemClick(item)
|
|
14054
|
-
}
|
|
14055
|
-
) : /* @__PURE__ */ React.createElement("div", { className: "nut-uploader__preview-img__file" }, /* @__PURE__ */ React.createElement(
|
|
14056
|
-
"div",
|
|
14057
|
-
{
|
|
14058
|
-
onClick: () => handleItemClick(item),
|
|
14059
|
-
className: "nut-uploader__preview-img__file__name"
|
|
14060
|
-
},
|
|
14061
|
-
/* @__PURE__ */ React.createElement(a$i, { color: "#808080" }),
|
|
14062
|
-
/* @__PURE__ */ React.createElement("span", null, " ", item.name)
|
|
14063
|
-
))), item.status === "success" ? /* @__PURE__ */ React.createElement("div", { className: "tips" }, item.name) : null),
|
|
14064
|
-
previewType === "list" && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader__preview-list" }, /* @__PURE__ */ React.createElement(
|
|
14065
|
-
"div",
|
|
14066
|
-
{
|
|
14067
|
-
className: `nut-uploader__preview-img__file__name ${item.status}`,
|
|
14068
|
-
onClick: () => handleItemClick(item)
|
|
14069
|
-
},
|
|
14070
|
-
/* @__PURE__ */ React.createElement(a$i, null),
|
|
14071
|
-
/* @__PURE__ */ React.createElement("span", null, " ", item.name)
|
|
14072
|
-
), deletable && /* @__PURE__ */ React.createElement(
|
|
14073
|
-
a$p,
|
|
14074
|
-
{
|
|
14075
|
-
color: "#808080",
|
|
14076
|
-
className: "nut-uploader__preview-img__file__del",
|
|
14077
|
-
onClick: () => onDeleteItem(item, index)
|
|
14078
|
-
}
|
|
14079
|
-
), item.status === "uploading" && /* @__PURE__ */ React.createElement(
|
|
14080
|
-
Progress,
|
|
14081
|
-
{
|
|
14082
|
-
percent: item.percentage,
|
|
14083
|
-
color: "linear-gradient(270deg, rgba(18,126,255,1) 0%,rgba(32,147,255,1) 32.815625%,rgba(13,242,204,1) 100%)",
|
|
14084
|
-
showText: false
|
|
14085
|
-
}
|
|
14086
|
-
))
|
|
14087
|
-
);
|
|
14088
|
-
}), maxCount > fileList.length && previewType === "picture" && !children && /* @__PURE__ */ React.createElement(
|
|
14086
|
+
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, { size: "small", type: "primary" }, "上传文件"), maxCount > fileList.length && /* @__PURE__ */ React.createElement(Button, { className: "nut-uploader__input", onClick: _chooseImage }))), /* @__PURE__ */ React.createElement(
|
|
14087
|
+
Preview,
|
|
14088
|
+
{
|
|
14089
|
+
...{
|
|
14090
|
+
fileList,
|
|
14091
|
+
previewType,
|
|
14092
|
+
deletable,
|
|
14093
|
+
onDeleteItem,
|
|
14094
|
+
handleItemClick,
|
|
14095
|
+
previewUrl,
|
|
14096
|
+
children
|
|
14097
|
+
}
|
|
14098
|
+
}
|
|
14099
|
+
), maxCount > fileList.length && previewType === "picture" && !children && /* @__PURE__ */ React.createElement(
|
|
14089
14100
|
"div",
|
|
14090
14101
|
{
|
|
14091
14102
|
className: `nut-uploader__upload ${previewType} ${disabled ? "nut-uploader__upload-disabled" : ""}`
|
|
14092
14103
|
},
|
|
14093
|
-
/* @__PURE__ */ React.createElement("div", { className: "nut-uploader__icon" }, uploadIcon
|
|
14104
|
+
/* @__PURE__ */ React.createElement("div", { className: "nut-uploader__icon" }, uploadIcon, /* @__PURE__ */ React.createElement("span", { className: "nut-uploader__icon-tip" }, uploadLabel)),
|
|
14094
14105
|
/* @__PURE__ */ React.createElement(Button, { className: "nut-uploader__input", onClick: _chooseImage })
|
|
14095
14106
|
));
|
|
14096
14107
|
};
|
|
@@ -17569,8 +17580,8 @@ var __publicField = (obj, key, value) => {
|
|
|
17569
17580
|
{
|
|
17570
17581
|
className: classNames(classPrefix$3, className),
|
|
17571
17582
|
style: {
|
|
17572
|
-
width: !width ? "100%" :
|
|
17573
|
-
height: !height ? "150px" :
|
|
17583
|
+
width: !width ? "100%" : pxCheck(width),
|
|
17584
|
+
height: !height ? "150px" : pxCheck(height)
|
|
17574
17585
|
}
|
|
17575
17586
|
},
|
|
17576
17587
|
/* @__PURE__ */ React.createElement(
|
|
@@ -17578,8 +17589,8 @@ var __publicField = (obj, key, value) => {
|
|
|
17578
17589
|
{
|
|
17579
17590
|
className: "nut-swiper__inner",
|
|
17580
17591
|
style: {
|
|
17581
|
-
width: !width ? "100%" :
|
|
17582
|
-
height: !height ? "150px" :
|
|
17592
|
+
width: !width ? "100%" : pxCheck(width),
|
|
17593
|
+
height: !height ? "150px" : pxCheck(height)
|
|
17583
17594
|
}
|
|
17584
17595
|
},
|
|
17585
17596
|
/* @__PURE__ */ React.createElement(
|
|
@@ -17596,12 +17607,18 @@ var __publicField = (obj, key, value) => {
|
|
|
17596
17607
|
(_a = props.onChange) == null ? void 0 : _a.call(props, e);
|
|
17597
17608
|
},
|
|
17598
17609
|
style: {
|
|
17599
|
-
width: !width ? "100%" :
|
|
17600
|
-
height: !height ? "150px" :
|
|
17610
|
+
width: !width ? "100%" : pxCheck(width),
|
|
17611
|
+
height: !height ? "150px" : pxCheck(height)
|
|
17601
17612
|
},
|
|
17602
17613
|
...rest
|
|
17603
17614
|
},
|
|
17604
|
-
React.Children.toArray(children).map((child, index) =>
|
|
17615
|
+
React.Children.toArray(children).map((child, index) => {
|
|
17616
|
+
let className2;
|
|
17617
|
+
if (React.isValidElement(child)) {
|
|
17618
|
+
className2 = child.props.className;
|
|
17619
|
+
}
|
|
17620
|
+
return /* @__PURE__ */ React.createElement(components.SwiperItem, { className: className2, key: index }, child);
|
|
17621
|
+
})
|
|
17605
17622
|
)
|
|
17606
17623
|
),
|
|
17607
17624
|
renderIndicator()
|
|
@@ -17831,13 +17848,14 @@ var __publicField = (obj, key, value) => {
|
|
|
17831
17848
|
));
|
|
17832
17849
|
}) : []).concat(
|
|
17833
17850
|
images && images.length > 0 ? images.map((item, index) => {
|
|
17834
|
-
return /* @__PURE__ */ React.createElement(SwiperItem, { key: index }, Taro.getEnv() === "WEB" ? /* @__PURE__ */ React.createElement(
|
|
17835
|
-
|
|
17851
|
+
return /* @__PURE__ */ React.createElement(SwiperItem, { key: index }, Taro.getEnv() === "WEB" ? /* @__PURE__ */ React.createElement(Image$1, { src: item.src, mode: "aspectFit" }) : /* @__PURE__ */ React.createElement(
|
|
17852
|
+
Image$1,
|
|
17836
17853
|
{
|
|
17837
17854
|
src: item.src,
|
|
17838
17855
|
mode: "aspectFit",
|
|
17839
17856
|
showMenuByLongpress: true,
|
|
17840
|
-
|
|
17857
|
+
width: "100%",
|
|
17858
|
+
height: "100%"
|
|
17841
17859
|
}
|
|
17842
17860
|
));
|
|
17843
17861
|
}) : []
|