@nutui/nutui-react-taro 2.0.0-alpha.0 → 2.0.0-alpha.1
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 +24 -630
- package/dist/esm/ActionSheet.js +3 -3
- package/dist/esm/Address.js +3 -3
- package/dist/esm/Calendar.js +5 -5
- package/dist/esm/Cascader.js +4 -4
- package/dist/esm/Col.js +2 -1
- package/dist/esm/DatePicker.js +5 -5
- package/dist/esm/ImagePreview.js +5 -5
- package/dist/esm/NumberKeyboard.js +3 -3
- package/dist/esm/Picker.js +4 -4
- package/dist/esm/Popup.js +2 -4
- package/dist/esm/Row.js +2 -1
- package/dist/esm/ShortPassword.js +3 -3
- package/dist/esm/SideNavBar.js +3 -8
- package/dist/esm/TimeSelect.js +4 -4
- package/dist/esm/Uploader.js +1 -1
- package/dist/esm/{actionsheet.taro-b76a342e.js → actionsheet.taro-10cc53ee.js} +1 -1
- package/dist/esm/{address.taro-1812caeb.js → address.taro-632ca799.js} +1 -1
- package/dist/esm/{calendar.taro-b6b147ca.js → calendar.taro-099cb4a2.js} +1 -1
- package/dist/esm/{cascader.taro-9c0a1a38.js → cascader.taro-62e764a7.js} +2 -2
- package/dist/esm/{col.taro-53eed3cc.js → col.taro-a99a9171.js} +3 -1
- package/dist/esm/{datepicker.taro-439e2080.js → datepicker.taro-0f2bcf42.js} +1 -1
- package/dist/esm/{imagepreview.taro-867ee24a.js → imagepreview.taro-b88fcf41.js} +2 -2
- package/dist/esm/{numberkeyboard.taro-81b36e5e.js → numberkeyboard.taro-ed9b2149.js} +2 -2
- package/dist/esm/nutui-react.es.js +17 -17
- package/dist/esm/{picker.taro-5c9030a7.js → picker.taro-5028afcb.js} +1 -1
- package/dist/esm/{popup.taro-124b9bab.js → popup.taro-020bf791.js} +27 -30
- package/dist/esm/{row.taro-f64d4a13.js → row.taro-75039d53.js} +5 -3
- package/dist/esm/{shortpassword.taro-9a2c98ad.js → shortpassword.taro-681a33a1.js} +1 -1
- package/dist/esm/{sidenavbar.taro-0265812f.js → sidenavbar.taro-d5c5b331.js} +1 -3
- package/dist/esm/{timeselect.taro-5b047850.js → timeselect.taro-a4b86771.js} +1 -1
- package/dist/esm/{uploader.taro-0cca7e97.js → uploader.taro-2151eec6.js} +34 -36
- 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.mjs +240 -244
- package/dist/nutui.react.umd.js +240 -244
- package/dist/packages/audio/audio.scss +2 -15
- package/dist/packages/calendar/calendar.scss +0 -30
- package/dist/packages/popup/popup.scss +0 -16
- package/dist/packages/row/row.scss +13 -31
- package/dist/packages/sidenavbar/sidenavbar.scss +0 -19
- package/dist/packages/uploader/uploader.scss +2 -28
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/types/index.d.ts +25 -27
- 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.0-alpha.
|
|
11
|
+
* @nutui/nutui-react-taro v2.0.0-alpha.1 Fri Apr 21 2023 18:02:35 GMT+0800 (China Standard Time)
|
|
12
12
|
* (c) 2023 @jdf2e.
|
|
13
13
|
* Released under the MIT License.
|
|
14
14
|
*/
|
|
@@ -2812,7 +2812,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2812
2812
|
onClick: (event) => {
|
|
2813
2813
|
}
|
|
2814
2814
|
};
|
|
2815
|
-
const classPrefix$
|
|
2815
|
+
const classPrefix$7 = "nut-cell";
|
|
2816
2816
|
const Cell = (props) => {
|
|
2817
2817
|
const {
|
|
2818
2818
|
children,
|
|
@@ -2841,26 +2841,26 @@ var __publicField = (obj, key, value) => {
|
|
|
2841
2841
|
flex: 1
|
|
2842
2842
|
};
|
|
2843
2843
|
return /* @__PURE__ */ jsx("div", {
|
|
2844
|
-
className: classNames(classPrefix$
|
|
2844
|
+
className: classNames(classPrefix$7, className),
|
|
2845
2845
|
onClick: (event) => handleClick(event),
|
|
2846
2846
|
style: baseStyle,
|
|
2847
2847
|
...rest,
|
|
2848
2848
|
children: children || /* @__PURE__ */ jsxs(Fragment, {
|
|
2849
2849
|
children: [title || description ? /* @__PURE__ */ jsxs("div", {
|
|
2850
|
-
className: `${classPrefix$
|
|
2850
|
+
className: `${classPrefix$7}__left`,
|
|
2851
2851
|
children: [title ? /* @__PURE__ */ jsx("div", {
|
|
2852
|
-
className: `${classPrefix$
|
|
2852
|
+
className: `${classPrefix$7}__title`,
|
|
2853
2853
|
children: title
|
|
2854
2854
|
}) : null, description ? /* @__PURE__ */ jsx("div", {
|
|
2855
|
-
className: `${classPrefix$
|
|
2855
|
+
className: `${classPrefix$7}__description`,
|
|
2856
2856
|
children: description
|
|
2857
2857
|
}) : null]
|
|
2858
2858
|
}) : null, extra ? /* @__PURE__ */ jsx("div", {
|
|
2859
|
-
className: `${classPrefix$
|
|
2859
|
+
className: `${classPrefix$7}__extra`,
|
|
2860
2860
|
style: styles,
|
|
2861
2861
|
children: extra
|
|
2862
2862
|
}) : null, /* @__PURE__ */ jsx("div", {
|
|
2863
|
-
className: `${classPrefix$
|
|
2863
|
+
className: `${classPrefix$7}__divider`
|
|
2864
2864
|
})]
|
|
2865
2865
|
})
|
|
2866
2866
|
});
|
|
@@ -2872,7 +2872,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2872
2872
|
title: "",
|
|
2873
2873
|
description: ""
|
|
2874
2874
|
};
|
|
2875
|
-
const classPrefix$
|
|
2875
|
+
const classPrefix$6 = "nut-cell-group";
|
|
2876
2876
|
const CellGroup = (props) => {
|
|
2877
2877
|
const {
|
|
2878
2878
|
children,
|
|
@@ -2886,16 +2886,16 @@ var __publicField = (obj, key, value) => {
|
|
|
2886
2886
|
...props
|
|
2887
2887
|
};
|
|
2888
2888
|
return /* @__PURE__ */ jsxs("div", {
|
|
2889
|
-
className: classNames(classPrefix$
|
|
2889
|
+
className: classNames(classPrefix$6, className),
|
|
2890
2890
|
...rest,
|
|
2891
2891
|
children: [title ? /* @__PURE__ */ jsx("div", {
|
|
2892
|
-
className: `${classPrefix$
|
|
2892
|
+
className: `${classPrefix$6}__title`,
|
|
2893
2893
|
children: title
|
|
2894
2894
|
}) : null, description ? /* @__PURE__ */ jsx("div", {
|
|
2895
|
-
className: `${classPrefix$
|
|
2895
|
+
className: `${classPrefix$6}__description`,
|
|
2896
2896
|
children: description
|
|
2897
2897
|
}) : null, /* @__PURE__ */ jsx("div", {
|
|
2898
|
-
className: `${classPrefix$
|
|
2898
|
+
className: `${classPrefix$6}__wrap`,
|
|
2899
2899
|
children
|
|
2900
2900
|
})]
|
|
2901
2901
|
});
|
|
@@ -3462,7 +3462,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3462
3462
|
visible: false,
|
|
3463
3463
|
lockScroll: true
|
|
3464
3464
|
};
|
|
3465
|
-
const classPrefix$
|
|
3465
|
+
const classPrefix$5 = `nut-overlay`;
|
|
3466
3466
|
const Overlay = (props) => {
|
|
3467
3467
|
const {
|
|
3468
3468
|
children,
|
|
@@ -3506,7 +3506,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3506
3506
|
"overlay-fade-enter-active": visible,
|
|
3507
3507
|
"first-render": renderRef.current && !visible,
|
|
3508
3508
|
"hidden-render": !visible
|
|
3509
|
-
}, className, classPrefix$
|
|
3509
|
+
}, className, classPrefix$5);
|
|
3510
3510
|
const styles = {
|
|
3511
3511
|
zIndex,
|
|
3512
3512
|
animationDuration: `${props.duration}s`,
|
|
@@ -5283,152 +5283,25 @@ var __publicField = (obj, key, value) => {
|
|
|
5283
5283
|
onExited: propTypesExports.func
|
|
5284
5284
|
}) : {};
|
|
5285
5285
|
const CSSTransition$1 = CSSTransition;
|
|
5286
|
-
var classnameExports = {};
|
|
5287
|
-
var classname = {
|
|
5288
|
-
get exports() {
|
|
5289
|
-
return classnameExports;
|
|
5290
|
-
},
|
|
5291
|
-
set exports(v) {
|
|
5292
|
-
classnameExports = v;
|
|
5293
|
-
}
|
|
5294
|
-
};
|
|
5295
|
-
var classname_production_min = {};
|
|
5296
|
-
var hasRequiredClassname_production_min;
|
|
5297
|
-
function requireClassname_production_min() {
|
|
5298
|
-
if (hasRequiredClassname_production_min)
|
|
5299
|
-
return classname_production_min;
|
|
5300
|
-
hasRequiredClassname_production_min = 1;
|
|
5301
|
-
function r2(r3) {
|
|
5302
|
-
function t2(t3, i, a2, o) {
|
|
5303
|
-
var f = i ? e + t3 + r3.e + i : e + t3, v = f;
|
|
5304
|
-
if (a2) {
|
|
5305
|
-
var s = " " + v + r3.m;
|
|
5306
|
-
for (var u in a2)
|
|
5307
|
-
if (a2.hasOwnProperty(u)) {
|
|
5308
|
-
var p = a2[u];
|
|
5309
|
-
true === p ? v += s + u : p && (v += s + u + n + p);
|
|
5310
|
-
}
|
|
5311
|
-
}
|
|
5312
|
-
if (void 0 !== o)
|
|
5313
|
-
for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
|
|
5314
|
-
var l = o[y2];
|
|
5315
|
-
if (l && "string" == typeof l.valueOf())
|
|
5316
|
-
for (var g = l.valueOf().split(" "), d = 0; d < g.length; d++) {
|
|
5317
|
-
var h = g[d];
|
|
5318
|
-
h !== f && (v += " " + h);
|
|
5319
|
-
}
|
|
5320
|
-
}
|
|
5321
|
-
return v;
|
|
5322
|
-
}
|
|
5323
|
-
var e = r3.n || "", n = r3.v || r3.m;
|
|
5324
|
-
return function(r4, e2) {
|
|
5325
|
-
return function(n2, i, a2) {
|
|
5326
|
-
return "string" == typeof n2 ? "string" == typeof i || Array.isArray(i) ? t2(r4, n2, void 0, i) : t2(r4, n2, i, a2) : t2(r4, e2, n2, i);
|
|
5327
|
-
};
|
|
5328
|
-
};
|
|
5329
|
-
}
|
|
5330
|
-
Object.defineProperty(classname_production_min, "__esModule", { value: true });
|
|
5331
|
-
var t = r2({ e: "-", m: "_" });
|
|
5332
|
-
classname_production_min.cn = t, classname_production_min.withNaming = r2;
|
|
5333
|
-
return classname_production_min;
|
|
5334
|
-
}
|
|
5335
|
-
var classname_development = {};
|
|
5336
|
-
var hasRequiredClassname_development;
|
|
5337
|
-
function requireClassname_development() {
|
|
5338
|
-
if (hasRequiredClassname_development)
|
|
5339
|
-
return classname_development;
|
|
5340
|
-
hasRequiredClassname_development = 1;
|
|
5341
|
-
Object.defineProperty(classname_development, "__esModule", { value: true });
|
|
5342
|
-
function withNaming(preset) {
|
|
5343
|
-
var nameSpace = preset.n || "";
|
|
5344
|
-
var modValueDelimiter = preset.v || preset.m;
|
|
5345
|
-
function stringify(b2, e, m, mix) {
|
|
5346
|
-
var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
|
|
5347
|
-
var className = entityName;
|
|
5348
|
-
if (m) {
|
|
5349
|
-
var modPrefix = " " + className + preset.m;
|
|
5350
|
-
for (var k in m) {
|
|
5351
|
-
if (m.hasOwnProperty(k)) {
|
|
5352
|
-
var modVal = m[k];
|
|
5353
|
-
if (modVal === true) {
|
|
5354
|
-
className += modPrefix + k;
|
|
5355
|
-
} else if (modVal) {
|
|
5356
|
-
className += modPrefix + k + modValueDelimiter + modVal;
|
|
5357
|
-
}
|
|
5358
|
-
}
|
|
5359
|
-
}
|
|
5360
|
-
}
|
|
5361
|
-
if (mix !== void 0) {
|
|
5362
|
-
mix = Array.isArray(mix) ? mix : [mix];
|
|
5363
|
-
for (var i = 0, len = mix.length; i < len; i++) {
|
|
5364
|
-
var value = mix[i];
|
|
5365
|
-
if (!value || typeof value.valueOf() !== "string")
|
|
5366
|
-
continue;
|
|
5367
|
-
var mixes = value.valueOf().split(" ");
|
|
5368
|
-
for (var j = 0; j < mixes.length; j++) {
|
|
5369
|
-
var val = mixes[j];
|
|
5370
|
-
if (val !== entityName) {
|
|
5371
|
-
className += " " + val;
|
|
5372
|
-
}
|
|
5373
|
-
}
|
|
5374
|
-
}
|
|
5375
|
-
}
|
|
5376
|
-
return className;
|
|
5377
|
-
}
|
|
5378
|
-
return function cnGenerator(b2, e) {
|
|
5379
|
-
return function(elemOrMods, elemModsOrBlockMix, elemMix) {
|
|
5380
|
-
if (typeof elemOrMods === "string") {
|
|
5381
|
-
if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
|
|
5382
|
-
return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
|
|
5383
|
-
}
|
|
5384
|
-
return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
|
|
5385
|
-
}
|
|
5386
|
-
return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
|
|
5387
|
-
};
|
|
5388
|
-
};
|
|
5389
|
-
}
|
|
5390
|
-
var cn2 = withNaming({
|
|
5391
|
-
e: "-",
|
|
5392
|
-
m: "_"
|
|
5393
|
-
});
|
|
5394
|
-
classname_development.cn = cn2;
|
|
5395
|
-
classname_development.withNaming = withNaming;
|
|
5396
|
-
return classname_development;
|
|
5397
|
-
}
|
|
5398
|
-
(function(module2) {
|
|
5399
|
-
if (process.env.NODE_ENV === "production") {
|
|
5400
|
-
module2.exports = requireClassname_production_min();
|
|
5401
|
-
} else {
|
|
5402
|
-
module2.exports = requireClassname_development();
|
|
5403
|
-
}
|
|
5404
|
-
})(classname);
|
|
5405
|
-
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
5406
5286
|
const defaultProps$1o = {
|
|
5407
5287
|
...ComponentDefaults,
|
|
5408
5288
|
position: "center",
|
|
5409
5289
|
transition: "",
|
|
5410
5290
|
overlayStyle: {},
|
|
5411
|
-
|
|
5412
|
-
popClass: "",
|
|
5291
|
+
overlayClassName: "",
|
|
5413
5292
|
closeable: false,
|
|
5414
5293
|
closeIconPosition: "top-right",
|
|
5415
5294
|
closeIcon: "close",
|
|
5416
|
-
destroyOnClose:
|
|
5417
|
-
|
|
5295
|
+
destroyOnClose: false,
|
|
5296
|
+
portal: null,
|
|
5418
5297
|
overlay: true,
|
|
5419
5298
|
round: false,
|
|
5420
5299
|
onOpen: () => {
|
|
5421
5300
|
},
|
|
5422
5301
|
onClose: () => {
|
|
5423
5302
|
},
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
onClosed: (e) => {
|
|
5427
|
-
},
|
|
5428
|
-
onClickOverlay: (e) => {
|
|
5429
|
-
},
|
|
5430
|
-
onClickCloseIcon: (e) => {
|
|
5431
|
-
},
|
|
5303
|
+
onClickOverlay: (e) => true,
|
|
5304
|
+
onClickCloseIcon: (e) => true,
|
|
5432
5305
|
...defaultOverlayProps
|
|
5433
5306
|
};
|
|
5434
5307
|
let _zIndex = 2e3;
|
|
@@ -5439,7 +5312,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5439
5312
|
overlay,
|
|
5440
5313
|
closeOnOverlayClick,
|
|
5441
5314
|
overlayStyle,
|
|
5442
|
-
|
|
5315
|
+
overlayClassName,
|
|
5443
5316
|
zIndex,
|
|
5444
5317
|
lockScroll,
|
|
5445
5318
|
duration,
|
|
@@ -5450,23 +5323,22 @@ var __publicField = (obj, key, value) => {
|
|
|
5450
5323
|
transition,
|
|
5451
5324
|
round,
|
|
5452
5325
|
position,
|
|
5453
|
-
popClass,
|
|
5454
5326
|
className,
|
|
5455
5327
|
destroyOnClose,
|
|
5456
|
-
|
|
5328
|
+
portal,
|
|
5457
5329
|
onOpen,
|
|
5458
5330
|
onClose,
|
|
5459
5331
|
onClickOverlay,
|
|
5460
5332
|
onClickCloseIcon,
|
|
5461
|
-
|
|
5462
|
-
|
|
5333
|
+
afterShow,
|
|
5334
|
+
afterClose,
|
|
5463
5335
|
onClick
|
|
5464
5336
|
} = props;
|
|
5465
5337
|
const [index, setIndex] = React.useState(zIndex || _zIndex);
|
|
5466
5338
|
const [innerVisible, setInnerVisible] = React.useState(visible);
|
|
5467
5339
|
const [showChildren, setShowChildren] = React.useState(true);
|
|
5468
5340
|
const [transitionName, setTransitionName] = React.useState("");
|
|
5469
|
-
const
|
|
5341
|
+
const classPrefix2 = "nut-popup";
|
|
5470
5342
|
const baseStyle = {
|
|
5471
5343
|
zIndex: index,
|
|
5472
5344
|
animationDuration: `${duration}s`
|
|
@@ -5479,15 +5351,15 @@ var __publicField = (obj, key, value) => {
|
|
|
5479
5351
|
...style,
|
|
5480
5352
|
...baseStyle
|
|
5481
5353
|
};
|
|
5482
|
-
const
|
|
5354
|
+
const popClassName = classNames({
|
|
5483
5355
|
round,
|
|
5484
|
-
[
|
|
5485
|
-
[`${
|
|
5356
|
+
[`${classPrefix2}`]: true,
|
|
5357
|
+
[`${classPrefix2}-${position}`]: true,
|
|
5486
5358
|
[`${className || ""}`]: true
|
|
5487
|
-
}
|
|
5359
|
+
});
|
|
5488
5360
|
const closeClasses = classNames({
|
|
5489
|
-
|
|
5490
|
-
[
|
|
5361
|
+
[`${classPrefix2}__close-icon`]: true,
|
|
5362
|
+
[`${classPrefix2}__close-icon--${closeIconPosition}`]: true
|
|
5491
5363
|
});
|
|
5492
5364
|
const open = () => {
|
|
5493
5365
|
if (!innerVisible) {
|
|
@@ -5505,29 +5377,29 @@ var __publicField = (obj, key, value) => {
|
|
|
5505
5377
|
if (destroyOnClose) {
|
|
5506
5378
|
setTimeout(() => {
|
|
5507
5379
|
setShowChildren(false);
|
|
5508
|
-
onClose && onClose();
|
|
5509
5380
|
}, Number(duration) * 1e3);
|
|
5510
5381
|
}
|
|
5382
|
+
onClose && onClose();
|
|
5511
5383
|
}
|
|
5512
5384
|
};
|
|
5513
5385
|
const onHandleClickOverlay = (e) => {
|
|
5514
5386
|
if (closeOnOverlayClick) {
|
|
5515
|
-
onClickOverlay && onClickOverlay(e);
|
|
5516
|
-
close();
|
|
5387
|
+
const closed = onClickOverlay && onClickOverlay(e);
|
|
5388
|
+
closed && close();
|
|
5517
5389
|
}
|
|
5518
5390
|
};
|
|
5519
5391
|
const onHandleClick = (e) => {
|
|
5520
5392
|
onClick && onClick(e);
|
|
5521
5393
|
};
|
|
5522
5394
|
const onHandleClickCloseIcon = (e) => {
|
|
5523
|
-
onClickCloseIcon && onClickCloseIcon(e);
|
|
5524
|
-
close();
|
|
5395
|
+
const closed = onClickCloseIcon && onClickCloseIcon(e);
|
|
5396
|
+
closed && close();
|
|
5525
5397
|
};
|
|
5526
5398
|
const onHandleOpened = (e) => {
|
|
5527
|
-
|
|
5399
|
+
afterShow && afterShow();
|
|
5528
5400
|
};
|
|
5529
5401
|
const onHandleClosed = (e) => {
|
|
5530
|
-
|
|
5402
|
+
afterClose && afterClose();
|
|
5531
5403
|
};
|
|
5532
5404
|
const resolveContainer = (getContainer) => {
|
|
5533
5405
|
const container = typeof getContainer === "function" ? getContainer() : getContainer;
|
|
@@ -5542,7 +5414,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5542
5414
|
};
|
|
5543
5415
|
const renderIcon = () => {
|
|
5544
5416
|
if (closeable) {
|
|
5545
|
-
return /* @__PURE__ */ jsx(
|
|
5417
|
+
return /* @__PURE__ */ jsx(components.View, {
|
|
5546
5418
|
className: closeClasses,
|
|
5547
5419
|
onClick: onHandleClickCloseIcon,
|
|
5548
5420
|
children: React.isValidElement(closeIcon) ? closeIcon : /* @__PURE__ */ jsx(a$p, {
|
|
@@ -5561,9 +5433,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5561
5433
|
in: innerVisible,
|
|
5562
5434
|
onEntered: onHandleOpened,
|
|
5563
5435
|
onExited: onHandleClosed,
|
|
5564
|
-
children: /* @__PURE__ */ jsxs(
|
|
5436
|
+
children: /* @__PURE__ */ jsxs(components.View, {
|
|
5565
5437
|
style: popStyles,
|
|
5566
|
-
className:
|
|
5438
|
+
className: popClassName,
|
|
5567
5439
|
onClick: onHandleClick,
|
|
5568
5440
|
children: [showChildren ? children : "", renderIcon()]
|
|
5569
5441
|
})
|
|
@@ -5574,7 +5446,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5574
5446
|
children: overlay ? /* @__PURE__ */ jsxs(Fragment, {
|
|
5575
5447
|
children: [/* @__PURE__ */ jsx(Overlay, {
|
|
5576
5448
|
style: overlayStyles,
|
|
5577
|
-
className:
|
|
5449
|
+
className: overlayClassName,
|
|
5578
5450
|
visible: innerVisible,
|
|
5579
5451
|
closeOnOverlayClick,
|
|
5580
5452
|
zIndex,
|
|
@@ -5592,16 +5464,17 @@ var __publicField = (obj, key, value) => {
|
|
|
5592
5464
|
!visible && close();
|
|
5593
5465
|
}, [visible]);
|
|
5594
5466
|
React.useEffect(() => {
|
|
5595
|
-
setTransitionName(transition ||
|
|
5596
|
-
}, [position]);
|
|
5467
|
+
setTransitionName(transition || `${classPrefix2}-slide-${position}`);
|
|
5468
|
+
}, [position, transition]);
|
|
5597
5469
|
return /* @__PURE__ */ jsx(Fragment, {
|
|
5598
|
-
children: renderToContainer(
|
|
5470
|
+
children: renderToContainer(portal, renderNode())
|
|
5599
5471
|
});
|
|
5600
5472
|
};
|
|
5601
5473
|
Popup.defaultProps = defaultProps$1o;
|
|
5602
5474
|
Popup.displayName = "NutPopup";
|
|
5603
5475
|
const DataContext$2 = React.createContext({});
|
|
5604
5476
|
const defaultProps$1n = {
|
|
5477
|
+
...ComponentDefaults,
|
|
5605
5478
|
span: "24",
|
|
5606
5479
|
offset: "0",
|
|
5607
5480
|
gutter: "0"
|
|
@@ -5609,7 +5482,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5609
5482
|
const Col = (props) => {
|
|
5610
5483
|
const {
|
|
5611
5484
|
className,
|
|
5612
|
-
style
|
|
5485
|
+
style,
|
|
5613
5486
|
span,
|
|
5614
5487
|
offset,
|
|
5615
5488
|
children,
|
|
@@ -5655,7 +5528,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5655
5528
|
contentPosition: "center",
|
|
5656
5529
|
direction: "horizontal"
|
|
5657
5530
|
};
|
|
5658
|
-
const classPrefix$
|
|
5531
|
+
const classPrefix$4 = `nut-divider`;
|
|
5659
5532
|
const Divider = (props) => {
|
|
5660
5533
|
const {
|
|
5661
5534
|
children,
|
|
@@ -5669,14 +5542,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5669
5542
|
...props
|
|
5670
5543
|
};
|
|
5671
5544
|
const classes = direction === "horizontal" ? classNames({
|
|
5672
|
-
[`${classPrefix$
|
|
5673
|
-
[`${classPrefix$
|
|
5674
|
-
[`${classPrefix$
|
|
5675
|
-
[`${classPrefix$
|
|
5676
|
-
[`${classPrefix$
|
|
5545
|
+
[`${classPrefix$4}`]: true,
|
|
5546
|
+
[`${classPrefix$4}__center`]: children,
|
|
5547
|
+
[`${classPrefix$4}__left`]: contentPosition === "left",
|
|
5548
|
+
[`${classPrefix$4}__right`]: contentPosition === "right",
|
|
5549
|
+
[`${classPrefix$4}__hairline`]: true
|
|
5677
5550
|
}) : classNames({
|
|
5678
|
-
[`${classPrefix$
|
|
5679
|
-
[`${classPrefix$
|
|
5551
|
+
[`${classPrefix$4}`]: true,
|
|
5552
|
+
[`${classPrefix$4}__vertical`]: direction === "vertical"
|
|
5680
5553
|
});
|
|
5681
5554
|
return /* @__PURE__ */ jsx("div", {
|
|
5682
5555
|
className: `${classes} ${className || ""}`,
|
|
@@ -5863,7 +5736,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5863
5736
|
};
|
|
5864
5737
|
Layout.defaultProps = defaultProps$1j;
|
|
5865
5738
|
Layout.displayName = "NutLayout";
|
|
5739
|
+
const classPrefix$3 = "nut-row";
|
|
5866
5740
|
const defaultProps$1i = {
|
|
5741
|
+
...ComponentDefaults,
|
|
5867
5742
|
type: "",
|
|
5868
5743
|
justify: "start",
|
|
5869
5744
|
align: "flex-start",
|
|
@@ -5873,7 +5748,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5873
5748
|
const Row = (props) => {
|
|
5874
5749
|
const {
|
|
5875
5750
|
className,
|
|
5876
|
-
style
|
|
5751
|
+
style,
|
|
5877
5752
|
children,
|
|
5878
5753
|
type,
|
|
5879
5754
|
justify,
|
|
@@ -5885,7 +5760,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5885
5760
|
...defaultProps$1i,
|
|
5886
5761
|
...props
|
|
5887
5762
|
};
|
|
5888
|
-
const prefixCls2 = "nut-row";
|
|
5889
5763
|
const getClass = (prefix2, type2) => {
|
|
5890
5764
|
const classType = type2 ? `nut-row-${prefix2}-${type2}` : "";
|
|
5891
5765
|
const className2 = prefix2 ? classType : `nut-row-${type2}`;
|
|
@@ -5897,7 +5771,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5897
5771
|
${getClass("justify", justify)}
|
|
5898
5772
|
${getClass("align", align)}
|
|
5899
5773
|
${getClass("flex", wrap)}
|
|
5900
|
-
${
|
|
5774
|
+
${classPrefix$3}
|
|
5901
5775
|
`;
|
|
5902
5776
|
};
|
|
5903
5777
|
const parentRow = {
|
|
@@ -6096,6 +5970,126 @@ var __publicField = (obj, key, value) => {
|
|
|
6096
5970
|
};
|
|
6097
5971
|
Sticky.defaultProps = defaultProps$1h;
|
|
6098
5972
|
Sticky.displayName = "NutSticky";
|
|
5973
|
+
var classnameExports = {};
|
|
5974
|
+
var classname = {
|
|
5975
|
+
get exports() {
|
|
5976
|
+
return classnameExports;
|
|
5977
|
+
},
|
|
5978
|
+
set exports(v) {
|
|
5979
|
+
classnameExports = v;
|
|
5980
|
+
}
|
|
5981
|
+
};
|
|
5982
|
+
var classname_production_min = {};
|
|
5983
|
+
var hasRequiredClassname_production_min;
|
|
5984
|
+
function requireClassname_production_min() {
|
|
5985
|
+
if (hasRequiredClassname_production_min)
|
|
5986
|
+
return classname_production_min;
|
|
5987
|
+
hasRequiredClassname_production_min = 1;
|
|
5988
|
+
function r2(r3) {
|
|
5989
|
+
function t2(t3, i, a2, o) {
|
|
5990
|
+
var f = i ? e + t3 + r3.e + i : e + t3, v = f;
|
|
5991
|
+
if (a2) {
|
|
5992
|
+
var s = " " + v + r3.m;
|
|
5993
|
+
for (var u in a2)
|
|
5994
|
+
if (a2.hasOwnProperty(u)) {
|
|
5995
|
+
var p = a2[u];
|
|
5996
|
+
true === p ? v += s + u : p && (v += s + u + n + p);
|
|
5997
|
+
}
|
|
5998
|
+
}
|
|
5999
|
+
if (void 0 !== o)
|
|
6000
|
+
for (var y2 = 0, c = (o = Array.isArray(o) ? o : [o]).length; y2 < c; y2++) {
|
|
6001
|
+
var l = o[y2];
|
|
6002
|
+
if (l && "string" == typeof l.valueOf())
|
|
6003
|
+
for (var g = l.valueOf().split(" "), d = 0; d < g.length; d++) {
|
|
6004
|
+
var h = g[d];
|
|
6005
|
+
h !== f && (v += " " + h);
|
|
6006
|
+
}
|
|
6007
|
+
}
|
|
6008
|
+
return v;
|
|
6009
|
+
}
|
|
6010
|
+
var e = r3.n || "", n = r3.v || r3.m;
|
|
6011
|
+
return function(r4, e2) {
|
|
6012
|
+
return function(n2, i, a2) {
|
|
6013
|
+
return "string" == typeof n2 ? "string" == typeof i || Array.isArray(i) ? t2(r4, n2, void 0, i) : t2(r4, n2, i, a2) : t2(r4, e2, n2, i);
|
|
6014
|
+
};
|
|
6015
|
+
};
|
|
6016
|
+
}
|
|
6017
|
+
Object.defineProperty(classname_production_min, "__esModule", { value: true });
|
|
6018
|
+
var t = r2({ e: "-", m: "_" });
|
|
6019
|
+
classname_production_min.cn = t, classname_production_min.withNaming = r2;
|
|
6020
|
+
return classname_production_min;
|
|
6021
|
+
}
|
|
6022
|
+
var classname_development = {};
|
|
6023
|
+
var hasRequiredClassname_development;
|
|
6024
|
+
function requireClassname_development() {
|
|
6025
|
+
if (hasRequiredClassname_development)
|
|
6026
|
+
return classname_development;
|
|
6027
|
+
hasRequiredClassname_development = 1;
|
|
6028
|
+
Object.defineProperty(classname_development, "__esModule", { value: true });
|
|
6029
|
+
function withNaming(preset) {
|
|
6030
|
+
var nameSpace = preset.n || "";
|
|
6031
|
+
var modValueDelimiter = preset.v || preset.m;
|
|
6032
|
+
function stringify(b2, e, m, mix) {
|
|
6033
|
+
var entityName = e ? nameSpace + b2 + preset.e + e : nameSpace + b2;
|
|
6034
|
+
var className = entityName;
|
|
6035
|
+
if (m) {
|
|
6036
|
+
var modPrefix = " " + className + preset.m;
|
|
6037
|
+
for (var k in m) {
|
|
6038
|
+
if (m.hasOwnProperty(k)) {
|
|
6039
|
+
var modVal = m[k];
|
|
6040
|
+
if (modVal === true) {
|
|
6041
|
+
className += modPrefix + k;
|
|
6042
|
+
} else if (modVal) {
|
|
6043
|
+
className += modPrefix + k + modValueDelimiter + modVal;
|
|
6044
|
+
}
|
|
6045
|
+
}
|
|
6046
|
+
}
|
|
6047
|
+
}
|
|
6048
|
+
if (mix !== void 0) {
|
|
6049
|
+
mix = Array.isArray(mix) ? mix : [mix];
|
|
6050
|
+
for (var i = 0, len = mix.length; i < len; i++) {
|
|
6051
|
+
var value = mix[i];
|
|
6052
|
+
if (!value || typeof value.valueOf() !== "string")
|
|
6053
|
+
continue;
|
|
6054
|
+
var mixes = value.valueOf().split(" ");
|
|
6055
|
+
for (var j = 0; j < mixes.length; j++) {
|
|
6056
|
+
var val = mixes[j];
|
|
6057
|
+
if (val !== entityName) {
|
|
6058
|
+
className += " " + val;
|
|
6059
|
+
}
|
|
6060
|
+
}
|
|
6061
|
+
}
|
|
6062
|
+
}
|
|
6063
|
+
return className;
|
|
6064
|
+
}
|
|
6065
|
+
return function cnGenerator(b2, e) {
|
|
6066
|
+
return function(elemOrMods, elemModsOrBlockMix, elemMix) {
|
|
6067
|
+
if (typeof elemOrMods === "string") {
|
|
6068
|
+
if (typeof elemModsOrBlockMix === "string" || Array.isArray(elemModsOrBlockMix)) {
|
|
6069
|
+
return stringify(b2, elemOrMods, void 0, elemModsOrBlockMix);
|
|
6070
|
+
}
|
|
6071
|
+
return stringify(b2, elemOrMods, elemModsOrBlockMix, elemMix);
|
|
6072
|
+
}
|
|
6073
|
+
return stringify(b2, e, elemOrMods, elemModsOrBlockMix);
|
|
6074
|
+
};
|
|
6075
|
+
};
|
|
6076
|
+
}
|
|
6077
|
+
var cn2 = withNaming({
|
|
6078
|
+
e: "-",
|
|
6079
|
+
m: "_"
|
|
6080
|
+
});
|
|
6081
|
+
classname_development.cn = cn2;
|
|
6082
|
+
classname_development.withNaming = withNaming;
|
|
6083
|
+
return classname_development;
|
|
6084
|
+
}
|
|
6085
|
+
(function(module2) {
|
|
6086
|
+
if (process.env.NODE_ENV === "production") {
|
|
6087
|
+
module2.exports = requireClassname_production_min();
|
|
6088
|
+
} else {
|
|
6089
|
+
module2.exports = requireClassname_development();
|
|
6090
|
+
}
|
|
6091
|
+
})(classname);
|
|
6092
|
+
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
6099
6093
|
const elevatorContext = React.createContext({});
|
|
6100
6094
|
const defaultProps$1g = {
|
|
6101
6095
|
height: "200px",
|
|
@@ -7018,7 +7012,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7018
7012
|
width: "80%"
|
|
7019
7013
|
};
|
|
7020
7014
|
const SideNavBar = (props) => {
|
|
7021
|
-
useConfig$1();
|
|
7022
7015
|
const {
|
|
7023
7016
|
title,
|
|
7024
7017
|
visible,
|
|
@@ -8949,7 +8942,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8949
8942
|
};
|
|
8950
8943
|
return /* @__PURE__ */ jsx(Fragment, {
|
|
8951
8944
|
children: poppable ? /* @__PURE__ */ jsx(Popup, {
|
|
8952
|
-
|
|
8945
|
+
className: "cascadar-popup",
|
|
8953
8946
|
visible,
|
|
8954
8947
|
position: "bottom",
|
|
8955
8948
|
round: true,
|
|
@@ -11057,7 +11050,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11057
11050
|
visible: show,
|
|
11058
11051
|
overlay,
|
|
11059
11052
|
position: "bottom",
|
|
11060
|
-
popClass,
|
|
11053
|
+
className: popClass,
|
|
11061
11054
|
onClickOverlay: onClose,
|
|
11062
11055
|
onClickCloseIcon: onClose,
|
|
11063
11056
|
overlayStyle: {
|
|
@@ -12848,31 +12841,31 @@ var __publicField = (obj, key, value) => {
|
|
|
12848
12841
|
const defaultProps$K = {
|
|
12849
12842
|
...ComponentDefaults,
|
|
12850
12843
|
url: "",
|
|
12851
|
-
|
|
12844
|
+
maxCount: 1,
|
|
12852
12845
|
sizeType: ["original", "compressed"],
|
|
12853
12846
|
sourceType: ["album", "camera"],
|
|
12854
12847
|
mediaType: ["image", "video"],
|
|
12855
12848
|
camera: "back",
|
|
12856
12849
|
uploadIcon: null,
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12850
|
+
uploadLabel: "",
|
|
12851
|
+
previewType: "picture",
|
|
12852
|
+
imageFit: "cover",
|
|
12860
12853
|
name: "file",
|
|
12861
12854
|
accept: "*",
|
|
12862
12855
|
disabled: false,
|
|
12863
12856
|
autoUpload: true,
|
|
12864
12857
|
multiple: false,
|
|
12865
|
-
|
|
12858
|
+
maxFileSize: Number.MAX_VALUE,
|
|
12866
12859
|
data: {},
|
|
12867
12860
|
headers: {},
|
|
12868
12861
|
method: "post",
|
|
12869
|
-
|
|
12862
|
+
previewUrl: "",
|
|
12870
12863
|
xhrState: 200,
|
|
12871
12864
|
timeout: 1e3 * 30,
|
|
12872
|
-
|
|
12873
|
-
|
|
12865
|
+
preview: true,
|
|
12866
|
+
deletable: true,
|
|
12874
12867
|
maxDuration: 10,
|
|
12875
|
-
|
|
12868
|
+
beforeDelete: (file, files) => {
|
|
12876
12869
|
return true;
|
|
12877
12870
|
}
|
|
12878
12871
|
};
|
|
@@ -12896,26 +12889,27 @@ var __publicField = (obj, key, value) => {
|
|
|
12896
12889
|
const {
|
|
12897
12890
|
children,
|
|
12898
12891
|
uploadIcon,
|
|
12899
|
-
|
|
12900
|
-
uploadIconTip,
|
|
12892
|
+
uploadLabel,
|
|
12901
12893
|
accept,
|
|
12902
12894
|
name,
|
|
12903
12895
|
camera,
|
|
12904
|
-
|
|
12905
|
-
|
|
12896
|
+
defaultValue,
|
|
12897
|
+
value,
|
|
12898
|
+
previewType,
|
|
12899
|
+
imageFit,
|
|
12906
12900
|
disabled,
|
|
12907
12901
|
multiple,
|
|
12908
12902
|
url,
|
|
12909
|
-
|
|
12903
|
+
previewUrl,
|
|
12910
12904
|
headers,
|
|
12911
12905
|
timeout,
|
|
12912
12906
|
method,
|
|
12913
12907
|
xhrState,
|
|
12914
12908
|
data,
|
|
12915
|
-
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
|
|
12909
|
+
preview,
|
|
12910
|
+
deletable,
|
|
12911
|
+
maxCount,
|
|
12912
|
+
maxFileSize,
|
|
12919
12913
|
mediaType,
|
|
12920
12914
|
className,
|
|
12921
12915
|
autoUpload,
|
|
@@ -12923,7 +12917,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12923
12917
|
sourceType,
|
|
12924
12918
|
maxDuration,
|
|
12925
12919
|
onStart,
|
|
12926
|
-
|
|
12920
|
+
onDelete,
|
|
12927
12921
|
onChange,
|
|
12928
12922
|
onFileItemClick,
|
|
12929
12923
|
onProgress,
|
|
@@ -12931,22 +12925,21 @@ var __publicField = (obj, key, value) => {
|
|
|
12931
12925
|
onUpdate,
|
|
12932
12926
|
onFailure,
|
|
12933
12927
|
onOversize,
|
|
12934
|
-
|
|
12935
|
-
|
|
12928
|
+
beforeXhrUpload,
|
|
12929
|
+
beforeDelete,
|
|
12936
12930
|
...restProps
|
|
12937
12931
|
} = {
|
|
12938
12932
|
...defaultProps$K,
|
|
12939
12933
|
...props
|
|
12940
12934
|
};
|
|
12941
|
-
const [fileList, setFileList] = React.useState([]);
|
|
12935
|
+
const [fileList, setFileList] = React.useState(defaultValue || []);
|
|
12942
12936
|
const [uploadQueue, setUploadQueue] = React.useState([]);
|
|
12943
12937
|
React.useEffect(() => {
|
|
12944
|
-
if (
|
|
12945
|
-
setFileList(
|
|
12938
|
+
if (value) {
|
|
12939
|
+
setFileList(value);
|
|
12946
12940
|
}
|
|
12947
|
-
}, [
|
|
12948
|
-
const
|
|
12949
|
-
const classes = classNames(className, b2(""));
|
|
12941
|
+
}, [value]);
|
|
12942
|
+
const classes = classNames(className, "nut-uploader");
|
|
12950
12943
|
React.useImperativeHandle(ref, () => ({
|
|
12951
12944
|
submit: () => {
|
|
12952
12945
|
Promise.all(uploadQueue).then((res) => {
|
|
@@ -12987,7 +12980,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12987
12980
|
if (Taro.getEnv() === "WEAPP") {
|
|
12988
12981
|
Taro.chooseMedia({
|
|
12989
12982
|
/** 最多可以选择的文件个数 */
|
|
12990
|
-
count: multiple ?
|
|
12983
|
+
count: multiple ? maxCount * 1 - fileList.length : 1,
|
|
12991
12984
|
/** 文件类型 */
|
|
12992
12985
|
mediaType,
|
|
12993
12986
|
/** 图片和视频选择的来源 */
|
|
@@ -13008,7 +13001,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13008
13001
|
} else {
|
|
13009
13002
|
Taro.chooseImage({
|
|
13010
13003
|
// 选择数量
|
|
13011
|
-
count: multiple ?
|
|
13004
|
+
count: multiple ? maxCount * 1 - fileList.length : 1,
|
|
13012
13005
|
// 可以指定是原图还是压缩图,默认二者都有
|
|
13013
13006
|
sizeType,
|
|
13014
13007
|
sourceType,
|
|
@@ -13030,7 +13023,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13030
13023
|
uploadOption.xhrState = xhrState;
|
|
13031
13024
|
uploadOption.headers = headers;
|
|
13032
13025
|
uploadOption.taroFilePath = fileItem.path;
|
|
13033
|
-
uploadOption.beforeXhrUpload =
|
|
13026
|
+
uploadOption.beforeXhrUpload = beforeXhrUpload;
|
|
13034
13027
|
uploadOption.onStart = (option) => {
|
|
13035
13028
|
clearUploadQueue(index);
|
|
13036
13029
|
setFileList((fileList2) => {
|
|
@@ -13129,8 +13122,8 @@ var __publicField = (obj, key, value) => {
|
|
|
13129
13122
|
}
|
|
13130
13123
|
if (Taro.getEnv() === "WEB") {
|
|
13131
13124
|
const formData = new FormData();
|
|
13132
|
-
for (const [key,
|
|
13133
|
-
formData.append(key,
|
|
13125
|
+
for (const [key, value2] of Object.entries(data)) {
|
|
13126
|
+
formData.append(key, value2);
|
|
13134
13127
|
}
|
|
13135
13128
|
formData.append(name, file.originalFileObj);
|
|
13136
13129
|
fileItem.name = (_a = file.originalFileObj) == null ? void 0 : _a.name;
|
|
@@ -13139,7 +13132,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13139
13132
|
} else {
|
|
13140
13133
|
fileItem.formData = data;
|
|
13141
13134
|
}
|
|
13142
|
-
if (
|
|
13135
|
+
if (preview) {
|
|
13143
13136
|
fileItem.url = fileType == "video" ? file.thumbTempFilePath : filepath;
|
|
13144
13137
|
}
|
|
13145
13138
|
fileList.push(fileItem);
|
|
@@ -13148,11 +13141,11 @@ var __publicField = (obj, key, value) => {
|
|
|
13148
13141
|
});
|
|
13149
13142
|
};
|
|
13150
13143
|
const filterFiles = (files) => {
|
|
13151
|
-
const
|
|
13152
|
-
const
|
|
13144
|
+
const maximum = props.maxCount * 1;
|
|
13145
|
+
const maximize = props.maxFileSize * 1;
|
|
13153
13146
|
const oversizes = new Array();
|
|
13154
13147
|
const filterFile = files.filter((file) => {
|
|
13155
|
-
if (file.size >
|
|
13148
|
+
if (file.size > maximize) {
|
|
13156
13149
|
oversizes.push(file);
|
|
13157
13150
|
return false;
|
|
13158
13151
|
}
|
|
@@ -13162,19 +13155,19 @@ var __publicField = (obj, key, value) => {
|
|
|
13162
13155
|
onOversize && onOversize(files);
|
|
13163
13156
|
}
|
|
13164
13157
|
const currentFileLength = filterFile.length + fileList.length;
|
|
13165
|
-
if (currentFileLength >
|
|
13166
|
-
filterFile.splice(filterFile.length - (currentFileLength -
|
|
13158
|
+
if (currentFileLength > maximum) {
|
|
13159
|
+
filterFile.splice(filterFile.length - (currentFileLength - maximum));
|
|
13167
13160
|
}
|
|
13168
13161
|
return filterFile;
|
|
13169
13162
|
};
|
|
13170
13163
|
const deleted = (file, index) => {
|
|
13171
13164
|
fileList.splice(index, 1);
|
|
13172
|
-
|
|
13165
|
+
onDelete && onDelete(file, fileList);
|
|
13173
13166
|
setFileList([...fileList]);
|
|
13174
13167
|
};
|
|
13175
|
-
const
|
|
13168
|
+
const onDeleteItem = (file, index) => {
|
|
13176
13169
|
clearUploadQueue(index);
|
|
13177
|
-
funcInterceptor(
|
|
13170
|
+
funcInterceptor(beforeDelete, {
|
|
13178
13171
|
args: [file, fileList],
|
|
13179
13172
|
done: () => deleted(file, index)
|
|
13180
13173
|
});
|
|
@@ -13208,20 +13201,20 @@ var __publicField = (obj, key, value) => {
|
|
|
13208
13201
|
children: [children && /* @__PURE__ */ jsx("div", {
|
|
13209
13202
|
className: "nut-uploader__slot",
|
|
13210
13203
|
children: /* @__PURE__ */ jsxs(Fragment, {
|
|
13211
|
-
children: [children,
|
|
13204
|
+
children: [children, maxCount > fileList.length && /* @__PURE__ */ jsx(Button, {
|
|
13212
13205
|
className: "nut-uploader__input",
|
|
13213
13206
|
onClick: _chooseImage
|
|
13214
13207
|
})]
|
|
13215
13208
|
})
|
|
13216
13209
|
}), fileList.length !== 0 && fileList.map((item, index) => {
|
|
13217
13210
|
return /* @__PURE__ */ jsxs("div", {
|
|
13218
|
-
className: `nut-uploader__preview ${
|
|
13219
|
-
children: [
|
|
13211
|
+
className: `nut-uploader__preview ${previewType}`,
|
|
13212
|
+
children: [previewType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
|
|
13220
13213
|
className: "nut-uploader__preview-img",
|
|
13221
|
-
children: [
|
|
13214
|
+
children: [deletable && /* @__PURE__ */ jsx(a$m, {
|
|
13222
13215
|
color: "rgba(0,0,0,0.6)",
|
|
13223
13216
|
className: "close",
|
|
13224
|
-
onClick: () =>
|
|
13217
|
+
onClick: () => onDeleteItem(item, index)
|
|
13225
13218
|
}), item.status === "ready" ? /* @__PURE__ */ jsx("div", {
|
|
13226
13219
|
className: "nut-uploader__preview__progress",
|
|
13227
13220
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -13241,15 +13234,18 @@ var __publicField = (obj, key, value) => {
|
|
|
13241
13234
|
}), item.type.includes("image") ? /* @__PURE__ */ jsx(Fragment, {
|
|
13242
13235
|
children: item.url && /* @__PURE__ */ jsx(components.Image, {
|
|
13243
13236
|
className: "nut-uploader__preview-img__c",
|
|
13237
|
+
style: {
|
|
13238
|
+
objectFit: imageFit
|
|
13239
|
+
},
|
|
13244
13240
|
mode: "aspectFit",
|
|
13245
13241
|
src: item.url,
|
|
13246
13242
|
onClick: () => handleItemClick(item)
|
|
13247
13243
|
})
|
|
13248
13244
|
}) : /* @__PURE__ */ jsx(Fragment, {
|
|
13249
|
-
children:
|
|
13245
|
+
children: previewUrl ? /* @__PURE__ */ jsx(components.Image, {
|
|
13250
13246
|
className: "nut-uploader__preview-img__c",
|
|
13251
13247
|
mode: "aspectFit",
|
|
13252
|
-
src:
|
|
13248
|
+
src: previewUrl,
|
|
13253
13249
|
onClick: () => handleItemClick(item)
|
|
13254
13250
|
}) : /* @__PURE__ */ jsx("div", {
|
|
13255
13251
|
className: "nut-uploader__preview-img__file",
|
|
@@ -13265,16 +13261,16 @@ var __publicField = (obj, key, value) => {
|
|
|
13265
13261
|
className: "tips",
|
|
13266
13262
|
children: item.name
|
|
13267
13263
|
}) : null]
|
|
13268
|
-
}),
|
|
13264
|
+
}), previewType === "list" && /* @__PURE__ */ jsxs("div", {
|
|
13269
13265
|
className: "nut-uploader__preview-list",
|
|
13270
13266
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
13271
13267
|
className: `nut-uploader__preview-img__file__name ${item.status}`,
|
|
13272
13268
|
onClick: () => handleItemClick(item),
|
|
13273
13269
|
children: [/* @__PURE__ */ jsx(a$h, {}), " ", item.name]
|
|
13274
|
-
}),
|
|
13270
|
+
}), deletable && /* @__PURE__ */ jsx(a$o, {
|
|
13275
13271
|
color: "#808080",
|
|
13276
13272
|
className: "nut-uploader__preview-img__file__del",
|
|
13277
|
-
onClick: () =>
|
|
13273
|
+
onClick: () => onDeleteItem(item, index)
|
|
13278
13274
|
}), item.status === "uploading" && /* @__PURE__ */ jsx(Progress, {
|
|
13279
13275
|
size: "small",
|
|
13280
13276
|
percentage: item.percentage,
|
|
@@ -13283,16 +13279,16 @@ var __publicField = (obj, key, value) => {
|
|
|
13283
13279
|
})]
|
|
13284
13280
|
})]
|
|
13285
13281
|
}, item.uid);
|
|
13286
|
-
}),
|
|
13287
|
-
className: `nut-uploader__upload ${
|
|
13282
|
+
}), maxCount > fileList.length && previewType === "picture" && !children && /* @__PURE__ */ jsxs("div", {
|
|
13283
|
+
className: `nut-uploader__upload ${previewType} ${disabled ? "nut-uploader__upload-disabled" : ""}`,
|
|
13288
13284
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
13289
13285
|
className: "nut-uploader__icon",
|
|
13290
13286
|
children: [uploadIcon || /* @__PURE__ */ jsx(a$b, {
|
|
13291
|
-
size:
|
|
13287
|
+
size: "20px",
|
|
13292
13288
|
color: "#808080"
|
|
13293
13289
|
}), /* @__PURE__ */ jsx("span", {
|
|
13294
13290
|
className: "nut-uploader__icon-tip",
|
|
13295
|
-
children:
|
|
13291
|
+
children: uploadLabel
|
|
13296
13292
|
})]
|
|
13297
13293
|
}), /* @__PURE__ */ jsx(Button, {
|
|
13298
13294
|
className: "nut-uploader__input",
|
|
@@ -21252,7 +21248,7 @@ This message will only show in development mode. It won't appear in production.
|
|
|
21252
21248
|
};
|
|
21253
21249
|
return /* @__PURE__ */ jsxs(Popup, {
|
|
21254
21250
|
visible: showPop,
|
|
21255
|
-
|
|
21251
|
+
className: "custom-pop",
|
|
21256
21252
|
style: {
|
|
21257
21253
|
width: "100%"
|
|
21258
21254
|
},
|