@nutui/nutui-react 2.0.17 → 2.0.18-beta.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 +17 -0
- package/dist/esm/Avatar/style/index.js +2 -1
- package/dist/esm/Avatar/style/style.css +1 -1
- package/dist/esm/BackTop.js +1 -1
- package/dist/esm/Badge/style/style.css +1 -1
- package/dist/esm/Button.js +5 -84
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Dialog.js +1 -1
- package/dist/esm/FixedNav/style/style.css +1 -1
- package/dist/esm/Form.js +8 -1235
- package/dist/esm/ImagePreview/style/index.js +2 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/Indicator.js +3 -54
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/Menu.js +16 -9
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/MenuItem.js +3 -0
- package/dist/esm/Skeleton/style/style.css +1 -1
- package/dist/esm/Sticky.js +1 -1
- package/dist/esm/Swiper/style/index.js +2 -1
- package/dist/esm/Swiper/style/style.css +1 -1
- package/dist/esm/Swiper.js +5 -5
- package/dist/esm/Tabbar/style/style.css +1 -1
- package/dist/esm/TabbarItem/style/style.css +1 -1
- package/dist/esm/Toast/style/style.css +1 -1
- package/dist/esm/Tour/style/index.js +1 -1
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/Uploader/style/style.css +1 -1
- package/dist/esm/Uploader.js +12 -8
- package/dist/esm/badge2.js +2 -2
- package/dist/esm/button2.js +87 -0
- package/dist/esm/date.js +4 -6
- package/dist/esm/formitem2.js +1288 -51
- package/dist/esm/indicator2.js +57 -0
- package/dist/esm/menuitem2.js +32 -9
- package/dist/esm/popup2.js +1 -1
- package/dist/esm/types/src/packages/badge/badge.d.ts +2 -2
- package/dist/esm/types/src/packages/badge/badge.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
- package/dist/esm/types/src/packages/form/types.d.ts +4 -4
- package/dist/esm/types/src/packages/form/useform.d.ts +2 -1
- package/dist/esm/types/src/packages/form/useform.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/menu/menu.d.ts +3 -2
- package/dist/esm/types/src/packages/menu/menu.taro.d.ts +3 -2
- package/dist/esm/types/src/packages/menuitem/menuitem.d.ts +1 -0
- package/dist/esm/types/src/packages/menuitem/menuitem.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/notify/notify.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +1 -1
- package/dist/esm/types/src/utils/date.d.ts +1 -1
- 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 +81 -46
- package/dist/nutui.react.umd.js +81 -46
- package/dist/packages/badge/badge.scss +1 -0
- package/dist/packages/dialog/dialog.scss +7 -1
- package/dist/packages/fixednav/fixednav.scss +1 -8
- package/dist/packages/menuitem/menuitem.scss +2 -2
- package/dist/packages/toast/toast.scss +2 -1
- package/dist/packages/tour/tour.scss +1 -0
- package/dist/packages/uploader/uploader.scss +12 -12
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +9 -3
- package/dist/styles/variables.scss +10 -3
- package/dist/types/packages/badge/badge.d.ts +6 -6
- package/dist/types/packages/configprovider/types.d.ts +1 -1
- package/dist/types/packages/form/types.d.ts +4 -4
- package/dist/types/packages/form/useform.d.ts +2 -1
- package/dist/types/packages/formitem/formitem.d.ts +1 -1
- package/dist/types/packages/menu/menu.d.ts +11 -2
- package/dist/types/packages/menuitem/menuitem.d.ts +6 -1
- package/dist/types/packages/shortpassword/shortpassword.d.ts +1 -1
- package/dist/types/utils/date.d.ts +1 -1
- package/package.json +1 -1
package/dist/nutui.react.es.js
CHANGED
|
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
var _a;
|
|
8
8
|
/*!
|
|
9
|
-
* @nutui/nutui-react v2.0.
|
|
9
|
+
* @nutui/nutui-react v2.0.18 Wed Sep 20 2023 14:59:05 GMT+0800 (China Standard Time)
|
|
10
10
|
* (c) 2023 @jdf2e.
|
|
11
11
|
* Released under the MIT License.
|
|
12
12
|
*/
|
|
@@ -6111,7 +6111,7 @@ const defaultProps$1h = {
|
|
|
6111
6111
|
...ComponentDefaults,
|
|
6112
6112
|
position: "top",
|
|
6113
6113
|
threshold: 0,
|
|
6114
|
-
zIndex:
|
|
6114
|
+
zIndex: 900
|
|
6115
6115
|
};
|
|
6116
6116
|
const classPrefix$j = "nut-sticky";
|
|
6117
6117
|
const Sticky = (props) => {
|
|
@@ -6247,7 +6247,7 @@ const defaultProps$1g = {
|
|
|
6247
6247
|
...ComponentDefaults,
|
|
6248
6248
|
target: "",
|
|
6249
6249
|
threshold: 200,
|
|
6250
|
-
zIndex:
|
|
6250
|
+
zIndex: 900,
|
|
6251
6251
|
duration: 1e3
|
|
6252
6252
|
};
|
|
6253
6253
|
const BackTop = (props) => {
|
|
@@ -11846,7 +11846,7 @@ const defaultProps$1c = {
|
|
|
11846
11846
|
onCloseIconClick: (e) => true,
|
|
11847
11847
|
...defaultOverlayProps
|
|
11848
11848
|
};
|
|
11849
|
-
let _zIndex =
|
|
11849
|
+
let _zIndex = 1100;
|
|
11850
11850
|
const Popup = (props) => {
|
|
11851
11851
|
const {
|
|
11852
11852
|
children,
|
|
@@ -12214,8 +12214,8 @@ const Badge = (props) => {
|
|
|
12214
12214
|
}
|
|
12215
12215
|
const getStyle = () => {
|
|
12216
12216
|
const style2 = {};
|
|
12217
|
-
style2.top = `${Number(top) || parseFloat(top) || 0}px`;
|
|
12218
|
-
style2.right = `${Number(right) || parseFloat(right) || 0}px`;
|
|
12217
|
+
style2.top = `${Number(top) || parseFloat(String(top)) || 0}px`;
|
|
12218
|
+
style2.right = `${Number(right) || parseFloat(String(right)) || 0}px`;
|
|
12219
12219
|
style2.background = color;
|
|
12220
12220
|
return style2;
|
|
12221
12221
|
};
|
|
@@ -13293,7 +13293,7 @@ const Utils = {
|
|
|
13293
13293
|
* @return {Boolse} true|false
|
|
13294
13294
|
*/
|
|
13295
13295
|
isLeapYear(y2) {
|
|
13296
|
-
return y2 % 4
|
|
13296
|
+
return y2 % 4 === 0 && y2 % 100 !== 0 || y2 % 400 === 0;
|
|
13297
13297
|
},
|
|
13298
13298
|
/**
|
|
13299
13299
|
* 返回星期数
|
|
@@ -13396,9 +13396,9 @@ const Utils = {
|
|
|
13396
13396
|
* 时间是否相等
|
|
13397
13397
|
* @return {Boolean}
|
|
13398
13398
|
*/
|
|
13399
|
-
isEqual(date1
|
|
13400
|
-
const startTime = new Date(date1.replace(
|
|
13401
|
-
const endTime = new Date(date22.replace(
|
|
13399
|
+
isEqual(date1, date22) {
|
|
13400
|
+
const startTime = new Date((date1 || "").replace(/-/g, "/")).getTime();
|
|
13401
|
+
const endTime = new Date(date22.replace(/-/g, "/")).getTime();
|
|
13402
13402
|
if (startTime === endTime) {
|
|
13403
13403
|
return true;
|
|
13404
13404
|
}
|
|
@@ -16395,6 +16395,7 @@ Schema.register = function register(type4, validator) {
|
|
|
16395
16395
|
Schema.warning = warning;
|
|
16396
16396
|
Schema.messages = messages;
|
|
16397
16397
|
Schema.validators = validators;
|
|
16398
|
+
const SECRET = "NUT_FORM_INTERNAL";
|
|
16398
16399
|
class FormStore {
|
|
16399
16400
|
constructor() {
|
|
16400
16401
|
// 初始化数据
|
|
@@ -16430,12 +16431,12 @@ class FormStore {
|
|
|
16430
16431
|
/**
|
|
16431
16432
|
* 获取全部字段
|
|
16432
16433
|
*/
|
|
16433
|
-
__publicField(this, "getFieldsValue", (
|
|
16434
|
-
if (typeof
|
|
16434
|
+
__publicField(this, "getFieldsValue", (nameList) => {
|
|
16435
|
+
if (typeof nameList === "boolean") {
|
|
16435
16436
|
return JSON.parse(JSON.stringify(this.store));
|
|
16436
16437
|
}
|
|
16437
16438
|
const fieldsValue = {};
|
|
16438
|
-
|
|
16439
|
+
nameList.forEach((field) => {
|
|
16439
16440
|
fieldsValue[field] = this.getFieldValue(field);
|
|
16440
16441
|
});
|
|
16441
16442
|
return fieldsValue;
|
|
@@ -16555,20 +16556,27 @@ class FormStore {
|
|
|
16555
16556
|
__publicField(this, "dispatch", ({ name }) => {
|
|
16556
16557
|
this.validateFields([name]);
|
|
16557
16558
|
});
|
|
16559
|
+
__publicField(this, "getInternal", (key) => {
|
|
16560
|
+
if (key === SECRET) {
|
|
16561
|
+
return {
|
|
16562
|
+
registerField: this.registerField,
|
|
16563
|
+
setCallback: this.setCallback,
|
|
16564
|
+
setInitialValues: this.setInitialValues,
|
|
16565
|
+
dispatch: this.dispatch,
|
|
16566
|
+
store: this.store,
|
|
16567
|
+
fieldEntities: this.fieldEntities
|
|
16568
|
+
};
|
|
16569
|
+
}
|
|
16570
|
+
});
|
|
16558
16571
|
__publicField(this, "getForm", () => {
|
|
16559
16572
|
return {
|
|
16560
|
-
dispatch: this.dispatch,
|
|
16561
|
-
setInitialValues: this.setInitialValues,
|
|
16562
|
-
setCallback: this.setCallback,
|
|
16563
|
-
registerField: this.registerField,
|
|
16564
16573
|
getFieldValue: this.getFieldValue,
|
|
16565
16574
|
getFieldsValue: this.getFieldsValue,
|
|
16566
16575
|
setFieldsValue: this.setFieldsValue,
|
|
16567
16576
|
resetFields: this.resetFields,
|
|
16568
16577
|
submit: this.submit,
|
|
16569
|
-
store: this.store,
|
|
16570
16578
|
errors: this.errors,
|
|
16571
|
-
|
|
16579
|
+
getInternal: this.getInternal
|
|
16572
16580
|
};
|
|
16573
16581
|
});
|
|
16574
16582
|
this.callbacks = {
|
|
@@ -16633,7 +16641,8 @@ const Form = React__default.forwardRef(
|
|
|
16633
16641
|
}
|
|
16634
16642
|
React__default.useImperativeHandle(ref, () => formInstance);
|
|
16635
16643
|
formInstance.starPosition = starPosition;
|
|
16636
|
-
const {
|
|
16644
|
+
const { submit, resetFields } = formInstance;
|
|
16645
|
+
const { setCallback, setInitialValues } = formInstance.getInternal(SECRET);
|
|
16637
16646
|
setCallback({
|
|
16638
16647
|
onFinish,
|
|
16639
16648
|
onFinishFailed
|
|
@@ -16695,7 +16704,8 @@ class FormItem extends React__default.Component {
|
|
|
16695
16704
|
// children添加value属性和onChange事件
|
|
16696
16705
|
__publicField(this, "getControlled", (children) => {
|
|
16697
16706
|
var _a2;
|
|
16698
|
-
const { setFieldsValue, getFieldValue
|
|
16707
|
+
const { setFieldsValue, getFieldValue } = this.context;
|
|
16708
|
+
const { dispatch } = this.context.getInternal(SECRET);
|
|
16699
16709
|
const { name = "" } = this.props;
|
|
16700
16710
|
if ((_a2 = children == null ? void 0 : children.props) == null ? void 0 : _a2.defaultValue) {
|
|
16701
16711
|
console.warn("通过 initialValue 设置初始值");
|
|
@@ -16804,7 +16814,8 @@ class FormItem extends React__default.Component {
|
|
|
16804
16814
|
};
|
|
16805
16815
|
}
|
|
16806
16816
|
componentDidMount() {
|
|
16807
|
-
|
|
16817
|
+
const { registerField } = this.context.getInternal(SECRET);
|
|
16818
|
+
this.cancelRegister = registerField(this);
|
|
16808
16819
|
}
|
|
16809
16820
|
componentWillUnmount() {
|
|
16810
16821
|
if (this.cancelRegister) {
|
|
@@ -17313,6 +17324,7 @@ const defaultProps$S = {
|
|
|
17313
17324
|
columns: 1,
|
|
17314
17325
|
direction: "down",
|
|
17315
17326
|
icon: null,
|
|
17327
|
+
closeOnClickAway: true,
|
|
17316
17328
|
activeTitleClass: "",
|
|
17317
17329
|
inactiveTitleClass: "",
|
|
17318
17330
|
onChange: (value) => void 0
|
|
@@ -17323,6 +17335,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17323
17335
|
style,
|
|
17324
17336
|
options: options2,
|
|
17325
17337
|
value,
|
|
17338
|
+
defaultValue,
|
|
17326
17339
|
columns,
|
|
17327
17340
|
title,
|
|
17328
17341
|
icon,
|
|
@@ -17341,7 +17354,15 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17341
17354
|
...props
|
|
17342
17355
|
};
|
|
17343
17356
|
const [showPopup, setShowPopup] = useState(show2);
|
|
17344
|
-
const [innerValue, setValue] =
|
|
17357
|
+
const [innerValue, setValue] = usePropsValue({
|
|
17358
|
+
defaultValue,
|
|
17359
|
+
value,
|
|
17360
|
+
finalValue: void 0,
|
|
17361
|
+
onChange: (v) => {
|
|
17362
|
+
const [option] = options2.filter((o) => o.value === v);
|
|
17363
|
+
onChange == null ? void 0 : onChange(option);
|
|
17364
|
+
}
|
|
17365
|
+
});
|
|
17345
17366
|
useEffect(() => {
|
|
17346
17367
|
setShowPopup(show2);
|
|
17347
17368
|
}, [show2]);
|
|
@@ -17349,7 +17370,9 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17349
17370
|
getParentOffset();
|
|
17350
17371
|
}, [showPopup]);
|
|
17351
17372
|
useImperativeHandle(ref, () => ({
|
|
17352
|
-
toggle:
|
|
17373
|
+
toggle: (s) => {
|
|
17374
|
+
s ? parent.toggleMenuItem(index) : parent.hideMenuItem(index);
|
|
17375
|
+
}
|
|
17353
17376
|
}));
|
|
17354
17377
|
const getIconCName = (optionVal, value2) => {
|
|
17355
17378
|
return classNames({
|
|
@@ -17366,7 +17389,6 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17366
17389
|
parent.toggleMenuItem(index);
|
|
17367
17390
|
setTitle(item.text);
|
|
17368
17391
|
setValue(item.value);
|
|
17369
|
-
onChange && onChange(item);
|
|
17370
17392
|
};
|
|
17371
17393
|
const isShow = () => {
|
|
17372
17394
|
if (showPopup)
|
|
@@ -17377,6 +17399,9 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17377
17399
|
top: 0,
|
|
17378
17400
|
height: 0
|
|
17379
17401
|
});
|
|
17402
|
+
const scrollParent = useMemo$1(() => {
|
|
17403
|
+
return getScrollParent(parent.menuRef, window);
|
|
17404
|
+
}, [parent.menuRef]);
|
|
17380
17405
|
const getParentOffset = () => {
|
|
17381
17406
|
setTimeout(() => {
|
|
17382
17407
|
const p = parent.menuRef.current;
|
|
@@ -17387,6 +17412,12 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17387
17412
|
});
|
|
17388
17413
|
});
|
|
17389
17414
|
};
|
|
17415
|
+
useEffect(() => {
|
|
17416
|
+
scrollParent == null ? void 0 : scrollParent.addEventListener("scroll", getParentOffset, false);
|
|
17417
|
+
return () => {
|
|
17418
|
+
scrollParent == null ? void 0 : scrollParent.removeEventListener("scroll", getParentOffset, false);
|
|
17419
|
+
};
|
|
17420
|
+
}, []);
|
|
17390
17421
|
const getPosition = () => {
|
|
17391
17422
|
return direction === "down" ? {
|
|
17392
17423
|
top: `${position.top + position.height}px`,
|
|
@@ -17418,7 +17449,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17418
17449
|
className: "nut-menu-item-container",
|
|
17419
17450
|
ref: micRef
|
|
17420
17451
|
},
|
|
17421
|
-
/* @__PURE__ */ React__default.createElement(
|
|
17452
|
+
parent.overlay ? /* @__PURE__ */ React__default.createElement(
|
|
17422
17453
|
Overlay,
|
|
17423
17454
|
{
|
|
17424
17455
|
className: "nut-menu__overlay",
|
|
@@ -17430,7 +17461,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17430
17461
|
parent.closeOnOverlayClick && parent.toggleMenuItem(index);
|
|
17431
17462
|
}
|
|
17432
17463
|
}
|
|
17433
|
-
),
|
|
17464
|
+
) : null,
|
|
17434
17465
|
/* @__PURE__ */ React__default.createElement(
|
|
17435
17466
|
"div",
|
|
17436
17467
|
{
|
|
@@ -17496,10 +17527,11 @@ const defaultProps$R = {
|
|
|
17496
17527
|
closeOnOverlayClick: true,
|
|
17497
17528
|
scrollFixed: false,
|
|
17498
17529
|
lockScroll: true,
|
|
17530
|
+
overlay: true,
|
|
17499
17531
|
icon: null,
|
|
17500
|
-
onOpen: () => {
|
|
17532
|
+
onOpen: (index) => {
|
|
17501
17533
|
},
|
|
17502
|
-
onClose: () => {
|
|
17534
|
+
onClose: (index) => {
|
|
17503
17535
|
}
|
|
17504
17536
|
};
|
|
17505
17537
|
const Menu = (props) => {
|
|
@@ -17508,6 +17540,7 @@ const Menu = (props) => {
|
|
|
17508
17540
|
icon,
|
|
17509
17541
|
scrollFixed,
|
|
17510
17542
|
lockScroll,
|
|
17543
|
+
overlay,
|
|
17511
17544
|
closeOnOverlayClick,
|
|
17512
17545
|
children,
|
|
17513
17546
|
activeColor,
|
|
@@ -17540,9 +17573,9 @@ const Menu = (props) => {
|
|
|
17540
17573
|
const toggleMenuItem = (index) => {
|
|
17541
17574
|
showMenuItem[index] = !showMenuItem[index];
|
|
17542
17575
|
if (showMenuItem[index]) {
|
|
17543
|
-
onOpen && onOpen();
|
|
17576
|
+
onOpen && onOpen(index);
|
|
17544
17577
|
} else {
|
|
17545
|
-
onClose && onClose();
|
|
17578
|
+
onClose && onClose(index);
|
|
17546
17579
|
}
|
|
17547
17580
|
const temp = showMenuItem.map(
|
|
17548
17581
|
(i, idx) => idx === index ? i : false
|
|
@@ -17552,7 +17585,7 @@ const Menu = (props) => {
|
|
|
17552
17585
|
const hideMenuItem = (index) => {
|
|
17553
17586
|
showMenuItem[index] = false;
|
|
17554
17587
|
setShowMenuItem([...showMenuItem]);
|
|
17555
|
-
onClose && onClose();
|
|
17588
|
+
onClose && onClose(index);
|
|
17556
17589
|
};
|
|
17557
17590
|
const updateTitle = (text, index) => {
|
|
17558
17591
|
menuItemTitle[index] = text;
|
|
@@ -17567,6 +17600,7 @@ const Menu = (props) => {
|
|
|
17567
17600
|
activeColor,
|
|
17568
17601
|
parent: {
|
|
17569
17602
|
closeOnOverlayClick,
|
|
17603
|
+
overlay,
|
|
17570
17604
|
lockScroll,
|
|
17571
17605
|
toggleMenuItem,
|
|
17572
17606
|
updateTitle,
|
|
@@ -17579,9 +17613,9 @@ const Menu = (props) => {
|
|
|
17579
17613
|
const menuTitle = () => {
|
|
17580
17614
|
return React__default.Children.map(children, (child, index) => {
|
|
17581
17615
|
if (React__default.isValidElement(child)) {
|
|
17582
|
-
const { title, options: options2, value, disabled, direction } = child.props;
|
|
17616
|
+
const { title, options: options2, value, defaultValue, disabled, direction } = child.props;
|
|
17583
17617
|
const selected = options2 == null ? void 0 : options2.filter(
|
|
17584
|
-
(option) => option.value === value
|
|
17618
|
+
(option) => option.value === (value !== void 0 ? value : defaultValue)
|
|
17585
17619
|
);
|
|
17586
17620
|
const finallyTitle = () => {
|
|
17587
17621
|
if (title)
|
|
@@ -17603,6 +17637,8 @@ const Menu = (props) => {
|
|
|
17603
17637
|
key: index,
|
|
17604
17638
|
onClick: (e) => {
|
|
17605
17639
|
e.stopPropagation();
|
|
17640
|
+
if ((!options2 || !options2.length) && !child.props.children)
|
|
17641
|
+
return;
|
|
17606
17642
|
!disabled && toggleMenuItem(index);
|
|
17607
17643
|
}
|
|
17608
17644
|
},
|
|
@@ -19456,7 +19492,7 @@ const InternalUploader = (props, ref) => {
|
|
|
19456
19492
|
const handleItemClick = (file) => {
|
|
19457
19493
|
onFileItemClick && onFileItemClick(file);
|
|
19458
19494
|
};
|
|
19459
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: classes, ...restProps }, children && /* @__PURE__ */ React__default.createElement("div", { className: "nut-uploader__slot" }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children, maxCount > fileList.length && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, capture ? /* @__PURE__ */ React__default.createElement(
|
|
19495
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classes, ...restProps }, (children || previewType === "list") && /* @__PURE__ */ React__default.createElement("div", { className: "nut-uploader__slot" }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children || /* @__PURE__ */ React__default.createElement(Button, { size: "small", type: "primary" }, "上传文件"), maxCount > fileList.length && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, capture ? /* @__PURE__ */ React__default.createElement(
|
|
19460
19496
|
"input",
|
|
19461
19497
|
{
|
|
19462
19498
|
className: "nut-uploader__input",
|
|
@@ -19486,14 +19522,15 @@ const InternalUploader = (props, ref) => {
|
|
|
19486
19522
|
className: `nut-uploader__preview ${previewType}`,
|
|
19487
19523
|
key: item.uid
|
|
19488
19524
|
},
|
|
19489
|
-
previewType === "picture" &&
|
|
19525
|
+
previewType === "picture" && deletable && /* @__PURE__ */ React__default.createElement(
|
|
19490
19526
|
x$9,
|
|
19491
19527
|
{
|
|
19492
19528
|
color: "rgba(0,0,0,0.6)",
|
|
19493
19529
|
className: "close",
|
|
19494
19530
|
onClick: () => onDeleteItem(item, index)
|
|
19495
19531
|
}
|
|
19496
|
-
),
|
|
19532
|
+
),
|
|
19533
|
+
previewType === "picture" && !children && /* @__PURE__ */ React__default.createElement("div", { className: "nut-uploader__preview-img" }, item.status === "ready" ? /* @__PURE__ */ React__default.createElement("div", { className: "nut-uploader__preview__progress" }, /* @__PURE__ */ React__default.createElement("div", { className: "nut-uploader__preview__progress__msg" }, item.message)) : item.status !== "success" && /* @__PURE__ */ React__default.createElement("div", { className: "nut-uploader__preview__progress" }, item.failIcon !== " " && item.loadingIcon !== " " && (item.status === "error" ? item.failIcon || /* @__PURE__ */ React__default.createElement(x$9, { color: "#fff" }) : item.loadingIcon || /* @__PURE__ */ React__default.createElement(
|
|
19497
19534
|
k$3,
|
|
19498
19535
|
{
|
|
19499
19536
|
className: "nut-icon-loading",
|
|
@@ -19523,8 +19560,7 @@ const InternalUploader = (props, ref) => {
|
|
|
19523
19560
|
className: "nut-uploader__preview-img__file__name"
|
|
19524
19561
|
},
|
|
19525
19562
|
/* @__PURE__ */ React__default.createElement(x$6, { color: "#808080" }),
|
|
19526
|
-
" ",
|
|
19527
|
-
item.name
|
|
19563
|
+
/* @__PURE__ */ React__default.createElement("span", null, " ", item.name)
|
|
19528
19564
|
))), item.status === "success" ? /* @__PURE__ */ React__default.createElement("div", { className: "tips" }, item.name) : null),
|
|
19529
19565
|
previewType === "list" && /* @__PURE__ */ React__default.createElement("div", { className: "nut-uploader__preview-list" }, /* @__PURE__ */ React__default.createElement(
|
|
19530
19566
|
"div",
|
|
@@ -19533,8 +19569,7 @@ const InternalUploader = (props, ref) => {
|
|
|
19533
19569
|
onClick: () => handleItemClick(item)
|
|
19534
19570
|
},
|
|
19535
19571
|
/* @__PURE__ */ React__default.createElement(x$6, null),
|
|
19536
|
-
" ",
|
|
19537
|
-
item.name
|
|
19572
|
+
/* @__PURE__ */ React__default.createElement("span", null, " ", item.name)
|
|
19538
19573
|
), deletable && /* @__PURE__ */ React__default.createElement(
|
|
19539
19574
|
y$8,
|
|
19540
19575
|
{
|
|
@@ -19876,7 +19911,7 @@ const DialogWrap = (props) => {
|
|
|
19876
19911
|
Overlay,
|
|
19877
19912
|
{
|
|
19878
19913
|
style: overlayStyle,
|
|
19879
|
-
className: overlayClassName,
|
|
19914
|
+
className: classNames("nut-dialog-overlay", overlayClassName),
|
|
19880
19915
|
visible,
|
|
19881
19916
|
closeOnOverlayClick,
|
|
19882
19917
|
lockScroll,
|
|
@@ -23410,10 +23445,6 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
23410
23445
|
target.style.transform = `translate3D${!isVertical ? `(${_offset}px,0,0)` : `(0,${_offset}px,0)`}`;
|
|
23411
23446
|
};
|
|
23412
23447
|
const onTouchStart = (e) => {
|
|
23413
|
-
if (props.preventDefault)
|
|
23414
|
-
e.preventDefault();
|
|
23415
|
-
if (props.stopPropagation)
|
|
23416
|
-
e.stopPropagation();
|
|
23417
23448
|
if (!props.touchable)
|
|
23418
23449
|
return;
|
|
23419
23450
|
touchStart(e);
|
|
@@ -23422,6 +23453,10 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
23422
23453
|
resetPosition();
|
|
23423
23454
|
};
|
|
23424
23455
|
const onTouchMove = (e) => {
|
|
23456
|
+
if (props.preventDefault)
|
|
23457
|
+
e.preventDefault();
|
|
23458
|
+
if (props.stopPropagation)
|
|
23459
|
+
e.stopPropagation();
|
|
23425
23460
|
if (props.touchable && swiperRef.current.moving) {
|
|
23426
23461
|
handleTouchMove(e);
|
|
23427
23462
|
if (touch.stateDirection === props.direction) {
|