@nutui/nutui-react 2.0.18-beta.0 → 2.0.18
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 +11 -4
- 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 +29 -8
- 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 +1 -0
- package/dist/esm/types/src/packages/menu/menu.taro.d.ts +1 -0
- 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/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 +73 -40
- package/dist/nutui.react.umd.js +73 -40
- 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/menu/menu.d.ts +1 -0
- 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.umd.js
CHANGED
|
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9
9
|
return value;
|
|
10
10
|
};
|
|
11
11
|
/*!
|
|
12
|
-
* @nutui/nutui-react v2.0.18
|
|
12
|
+
* @nutui/nutui-react v2.0.18 Wed Sep 20 2023 15:07:55 GMT+0800 (China Standard Time)
|
|
13
13
|
* (c) 2023 @jdf2e.
|
|
14
14
|
* Released under the MIT License.
|
|
15
15
|
*/
|
|
@@ -6129,7 +6129,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
6129
6129
|
...ComponentDefaults,
|
|
6130
6130
|
position: "top",
|
|
6131
6131
|
threshold: 0,
|
|
6132
|
-
zIndex:
|
|
6132
|
+
zIndex: 900
|
|
6133
6133
|
};
|
|
6134
6134
|
const classPrefix$j = "nut-sticky";
|
|
6135
6135
|
const Sticky = (props) => {
|
|
@@ -6265,7 +6265,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
6265
6265
|
...ComponentDefaults,
|
|
6266
6266
|
target: "",
|
|
6267
6267
|
threshold: 200,
|
|
6268
|
-
zIndex:
|
|
6268
|
+
zIndex: 900,
|
|
6269
6269
|
duration: 1e3
|
|
6270
6270
|
};
|
|
6271
6271
|
const BackTop = (props) => {
|
|
@@ -11864,7 +11864,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
11864
11864
|
onCloseIconClick: (e) => true,
|
|
11865
11865
|
...defaultOverlayProps
|
|
11866
11866
|
};
|
|
11867
|
-
let _zIndex =
|
|
11867
|
+
let _zIndex = 1100;
|
|
11868
11868
|
const Popup = (props) => {
|
|
11869
11869
|
const {
|
|
11870
11870
|
children,
|
|
@@ -12232,8 +12232,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
12232
12232
|
}
|
|
12233
12233
|
const getStyle = () => {
|
|
12234
12234
|
const style2 = {};
|
|
12235
|
-
style2.top = `${Number(top) || parseFloat(top) || 0}px`;
|
|
12236
|
-
style2.right = `${Number(right) || parseFloat(right) || 0}px`;
|
|
12235
|
+
style2.top = `${Number(top) || parseFloat(String(top)) || 0}px`;
|
|
12236
|
+
style2.right = `${Number(right) || parseFloat(String(right)) || 0}px`;
|
|
12237
12237
|
style2.background = color;
|
|
12238
12238
|
return style2;
|
|
12239
12239
|
};
|
|
@@ -13311,7 +13311,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13311
13311
|
* @return {Boolse} true|false
|
|
13312
13312
|
*/
|
|
13313
13313
|
isLeapYear(y2) {
|
|
13314
|
-
return y2 % 4
|
|
13314
|
+
return y2 % 4 === 0 && y2 % 100 !== 0 || y2 % 400 === 0;
|
|
13315
13315
|
},
|
|
13316
13316
|
/**
|
|
13317
13317
|
* 返回星期数
|
|
@@ -13414,9 +13414,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
13414
13414
|
* 时间是否相等
|
|
13415
13415
|
* @return {Boolean}
|
|
13416
13416
|
*/
|
|
13417
|
-
isEqual(date1
|
|
13418
|
-
const startTime = new Date(date1.replace(
|
|
13419
|
-
const endTime = new Date(date2.replace(
|
|
13417
|
+
isEqual(date1, date2) {
|
|
13418
|
+
const startTime = new Date((date1 || "").replace(/-/g, "/")).getTime();
|
|
13419
|
+
const endTime = new Date(date2.replace(/-/g, "/")).getTime();
|
|
13420
13420
|
if (startTime === endTime) {
|
|
13421
13421
|
return true;
|
|
13422
13422
|
}
|
|
@@ -16413,6 +16413,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16413
16413
|
Schema.warning = warning;
|
|
16414
16414
|
Schema.messages = messages;
|
|
16415
16415
|
Schema.validators = validators;
|
|
16416
|
+
const SECRET = "NUT_FORM_INTERNAL";
|
|
16416
16417
|
class FormStore {
|
|
16417
16418
|
constructor() {
|
|
16418
16419
|
// 初始化数据
|
|
@@ -16448,12 +16449,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16448
16449
|
/**
|
|
16449
16450
|
* 获取全部字段
|
|
16450
16451
|
*/
|
|
16451
|
-
__publicField(this, "getFieldsValue", (
|
|
16452
|
-
if (typeof
|
|
16452
|
+
__publicField(this, "getFieldsValue", (nameList) => {
|
|
16453
|
+
if (typeof nameList === "boolean") {
|
|
16453
16454
|
return JSON.parse(JSON.stringify(this.store));
|
|
16454
16455
|
}
|
|
16455
16456
|
const fieldsValue = {};
|
|
16456
|
-
|
|
16457
|
+
nameList.forEach((field) => {
|
|
16457
16458
|
fieldsValue[field] = this.getFieldValue(field);
|
|
16458
16459
|
});
|
|
16459
16460
|
return fieldsValue;
|
|
@@ -16573,20 +16574,27 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16573
16574
|
__publicField(this, "dispatch", ({ name }) => {
|
|
16574
16575
|
this.validateFields([name]);
|
|
16575
16576
|
});
|
|
16577
|
+
__publicField(this, "getInternal", (key) => {
|
|
16578
|
+
if (key === SECRET) {
|
|
16579
|
+
return {
|
|
16580
|
+
registerField: this.registerField,
|
|
16581
|
+
setCallback: this.setCallback,
|
|
16582
|
+
setInitialValues: this.setInitialValues,
|
|
16583
|
+
dispatch: this.dispatch,
|
|
16584
|
+
store: this.store,
|
|
16585
|
+
fieldEntities: this.fieldEntities
|
|
16586
|
+
};
|
|
16587
|
+
}
|
|
16588
|
+
});
|
|
16576
16589
|
__publicField(this, "getForm", () => {
|
|
16577
16590
|
return {
|
|
16578
|
-
dispatch: this.dispatch,
|
|
16579
|
-
setInitialValues: this.setInitialValues,
|
|
16580
|
-
setCallback: this.setCallback,
|
|
16581
|
-
registerField: this.registerField,
|
|
16582
16591
|
getFieldValue: this.getFieldValue,
|
|
16583
16592
|
getFieldsValue: this.getFieldsValue,
|
|
16584
16593
|
setFieldsValue: this.setFieldsValue,
|
|
16585
16594
|
resetFields: this.resetFields,
|
|
16586
16595
|
submit: this.submit,
|
|
16587
|
-
store: this.store,
|
|
16588
16596
|
errors: this.errors,
|
|
16589
|
-
|
|
16597
|
+
getInternal: this.getInternal
|
|
16590
16598
|
};
|
|
16591
16599
|
});
|
|
16592
16600
|
this.callbacks = {
|
|
@@ -16651,7 +16659,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16651
16659
|
}
|
|
16652
16660
|
React.useImperativeHandle(ref, () => formInstance);
|
|
16653
16661
|
formInstance.starPosition = starPosition;
|
|
16654
|
-
const {
|
|
16662
|
+
const { submit, resetFields } = formInstance;
|
|
16663
|
+
const { setCallback, setInitialValues } = formInstance.getInternal(SECRET);
|
|
16655
16664
|
setCallback({
|
|
16656
16665
|
onFinish,
|
|
16657
16666
|
onFinishFailed
|
|
@@ -16713,7 +16722,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16713
16722
|
// children添加value属性和onChange事件
|
|
16714
16723
|
__publicField(this, "getControlled", (children) => {
|
|
16715
16724
|
var _a2;
|
|
16716
|
-
const { setFieldsValue, getFieldValue
|
|
16725
|
+
const { setFieldsValue, getFieldValue } = this.context;
|
|
16726
|
+
const { dispatch } = this.context.getInternal(SECRET);
|
|
16717
16727
|
const { name = "" } = this.props;
|
|
16718
16728
|
if ((_a2 = children == null ? void 0 : children.props) == null ? void 0 : _a2.defaultValue) {
|
|
16719
16729
|
console.warn("通过 initialValue 设置初始值");
|
|
@@ -16822,7 +16832,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16822
16832
|
};
|
|
16823
16833
|
}
|
|
16824
16834
|
componentDidMount() {
|
|
16825
|
-
|
|
16835
|
+
const { registerField } = this.context.getInternal(SECRET);
|
|
16836
|
+
this.cancelRegister = registerField(this);
|
|
16826
16837
|
}
|
|
16827
16838
|
componentWillUnmount() {
|
|
16828
16839
|
if (this.cancelRegister) {
|
|
@@ -17331,6 +17342,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17331
17342
|
columns: 1,
|
|
17332
17343
|
direction: "down",
|
|
17333
17344
|
icon: null,
|
|
17345
|
+
closeOnClickAway: true,
|
|
17334
17346
|
activeTitleClass: "",
|
|
17335
17347
|
inactiveTitleClass: "",
|
|
17336
17348
|
onChange: (value) => void 0
|
|
@@ -17341,6 +17353,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17341
17353
|
style,
|
|
17342
17354
|
options: options2,
|
|
17343
17355
|
value,
|
|
17356
|
+
defaultValue,
|
|
17344
17357
|
columns,
|
|
17345
17358
|
title,
|
|
17346
17359
|
icon,
|
|
@@ -17359,7 +17372,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17359
17372
|
...props
|
|
17360
17373
|
};
|
|
17361
17374
|
const [showPopup, setShowPopup] = React.useState(show2);
|
|
17362
|
-
const [innerValue, setValue] =
|
|
17375
|
+
const [innerValue, setValue] = usePropsValue({
|
|
17376
|
+
defaultValue,
|
|
17377
|
+
value,
|
|
17378
|
+
finalValue: void 0,
|
|
17379
|
+
onChange: (v) => {
|
|
17380
|
+
const [option] = options2.filter((o) => o.value === v);
|
|
17381
|
+
onChange == null ? void 0 : onChange(option);
|
|
17382
|
+
}
|
|
17383
|
+
});
|
|
17363
17384
|
React.useEffect(() => {
|
|
17364
17385
|
setShowPopup(show2);
|
|
17365
17386
|
}, [show2]);
|
|
@@ -17386,7 +17407,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17386
17407
|
parent.toggleMenuItem(index);
|
|
17387
17408
|
setTitle(item.text);
|
|
17388
17409
|
setValue(item.value);
|
|
17389
|
-
onChange && onChange(item);
|
|
17390
17410
|
};
|
|
17391
17411
|
const isShow = () => {
|
|
17392
17412
|
if (showPopup)
|
|
@@ -17397,6 +17417,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17397
17417
|
top: 0,
|
|
17398
17418
|
height: 0
|
|
17399
17419
|
});
|
|
17420
|
+
const scrollParent = React.useMemo(() => {
|
|
17421
|
+
return getScrollParent(parent.menuRef, window);
|
|
17422
|
+
}, [parent.menuRef]);
|
|
17400
17423
|
const getParentOffset = () => {
|
|
17401
17424
|
setTimeout(() => {
|
|
17402
17425
|
const p = parent.menuRef.current;
|
|
@@ -17407,6 +17430,12 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17407
17430
|
});
|
|
17408
17431
|
});
|
|
17409
17432
|
};
|
|
17433
|
+
React.useEffect(() => {
|
|
17434
|
+
scrollParent == null ? void 0 : scrollParent.addEventListener("scroll", getParentOffset, false);
|
|
17435
|
+
return () => {
|
|
17436
|
+
scrollParent == null ? void 0 : scrollParent.removeEventListener("scroll", getParentOffset, false);
|
|
17437
|
+
};
|
|
17438
|
+
}, []);
|
|
17410
17439
|
const getPosition = () => {
|
|
17411
17440
|
return direction === "down" ? {
|
|
17412
17441
|
top: `${position.top + position.height}px`,
|
|
@@ -17438,7 +17467,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17438
17467
|
className: "nut-menu-item-container",
|
|
17439
17468
|
ref: micRef
|
|
17440
17469
|
},
|
|
17441
|
-
/* @__PURE__ */ React.createElement(
|
|
17470
|
+
parent.overlay ? /* @__PURE__ */ React.createElement(
|
|
17442
17471
|
Overlay,
|
|
17443
17472
|
{
|
|
17444
17473
|
className: "nut-menu__overlay",
|
|
@@ -17450,7 +17479,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17450
17479
|
parent.closeOnOverlayClick && parent.toggleMenuItem(index);
|
|
17451
17480
|
}
|
|
17452
17481
|
}
|
|
17453
|
-
),
|
|
17482
|
+
) : null,
|
|
17454
17483
|
/* @__PURE__ */ React.createElement(
|
|
17455
17484
|
"div",
|
|
17456
17485
|
{
|
|
@@ -17516,6 +17545,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17516
17545
|
closeOnOverlayClick: true,
|
|
17517
17546
|
scrollFixed: false,
|
|
17518
17547
|
lockScroll: true,
|
|
17548
|
+
overlay: true,
|
|
17519
17549
|
icon: null,
|
|
17520
17550
|
onOpen: (index) => {
|
|
17521
17551
|
},
|
|
@@ -17528,6 +17558,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17528
17558
|
icon,
|
|
17529
17559
|
scrollFixed,
|
|
17530
17560
|
lockScroll,
|
|
17561
|
+
overlay,
|
|
17531
17562
|
closeOnOverlayClick,
|
|
17532
17563
|
children,
|
|
17533
17564
|
activeColor,
|
|
@@ -17587,6 +17618,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17587
17618
|
activeColor,
|
|
17588
17619
|
parent: {
|
|
17589
17620
|
closeOnOverlayClick,
|
|
17621
|
+
overlay,
|
|
17590
17622
|
lockScroll,
|
|
17591
17623
|
toggleMenuItem,
|
|
17592
17624
|
updateTitle,
|
|
@@ -17599,9 +17631,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17599
17631
|
const menuTitle = () => {
|
|
17600
17632
|
return React.Children.map(children, (child, index) => {
|
|
17601
17633
|
if (React.isValidElement(child)) {
|
|
17602
|
-
const { title, options: options2, value, disabled, direction } = child.props;
|
|
17634
|
+
const { title, options: options2, value, defaultValue, disabled, direction } = child.props;
|
|
17603
17635
|
const selected = options2 == null ? void 0 : options2.filter(
|
|
17604
|
-
(option) => option.value === value
|
|
17636
|
+
(option) => option.value === (value !== void 0 ? value : defaultValue)
|
|
17605
17637
|
);
|
|
17606
17638
|
const finallyTitle = () => {
|
|
17607
17639
|
if (title)
|
|
@@ -17623,6 +17655,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17623
17655
|
key: index,
|
|
17624
17656
|
onClick: (e) => {
|
|
17625
17657
|
e.stopPropagation();
|
|
17658
|
+
if ((!options2 || !options2.length) && !child.props.children)
|
|
17659
|
+
return;
|
|
17626
17660
|
!disabled && toggleMenuItem(index);
|
|
17627
17661
|
}
|
|
17628
17662
|
},
|
|
@@ -19476,7 +19510,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19476
19510
|
const handleItemClick = (file) => {
|
|
19477
19511
|
onFileItemClick && onFileItemClick(file);
|
|
19478
19512
|
};
|
|
19479
|
-
return /* @__PURE__ */ React.createElement("div", { className: classes, ...restProps }, children && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader__slot" }, /* @__PURE__ */ React.createElement(React.Fragment, null, children, maxCount > fileList.length && /* @__PURE__ */ React.createElement(React.Fragment, null, capture ? /* @__PURE__ */ React.createElement(
|
|
19513
|
+
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(React.Fragment, null, capture ? /* @__PURE__ */ React.createElement(
|
|
19480
19514
|
"input",
|
|
19481
19515
|
{
|
|
19482
19516
|
className: "nut-uploader__input",
|
|
@@ -19506,14 +19540,15 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19506
19540
|
className: `nut-uploader__preview ${previewType}`,
|
|
19507
19541
|
key: item.uid
|
|
19508
19542
|
},
|
|
19509
|
-
previewType === "picture" &&
|
|
19543
|
+
previewType === "picture" && deletable && /* @__PURE__ */ React.createElement(
|
|
19510
19544
|
x$9,
|
|
19511
19545
|
{
|
|
19512
19546
|
color: "rgba(0,0,0,0.6)",
|
|
19513
19547
|
className: "close",
|
|
19514
19548
|
onClick: () => onDeleteItem(item, index)
|
|
19515
19549
|
}
|
|
19516
|
-
),
|
|
19550
|
+
),
|
|
19551
|
+
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(x$9, { color: "#fff" }) : item.loadingIcon || /* @__PURE__ */ React.createElement(
|
|
19517
19552
|
k$3,
|
|
19518
19553
|
{
|
|
19519
19554
|
className: "nut-icon-loading",
|
|
@@ -19543,8 +19578,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19543
19578
|
className: "nut-uploader__preview-img__file__name"
|
|
19544
19579
|
},
|
|
19545
19580
|
/* @__PURE__ */ React.createElement(x$6, { color: "#808080" }),
|
|
19546
|
-
" ",
|
|
19547
|
-
item.name
|
|
19581
|
+
/* @__PURE__ */ React.createElement("span", null, " ", item.name)
|
|
19548
19582
|
))), item.status === "success" ? /* @__PURE__ */ React.createElement("div", { className: "tips" }, item.name) : null),
|
|
19549
19583
|
previewType === "list" && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader__preview-list" }, /* @__PURE__ */ React.createElement(
|
|
19550
19584
|
"div",
|
|
@@ -19553,8 +19587,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19553
19587
|
onClick: () => handleItemClick(item)
|
|
19554
19588
|
},
|
|
19555
19589
|
/* @__PURE__ */ React.createElement(x$6, null),
|
|
19556
|
-
" ",
|
|
19557
|
-
item.name
|
|
19590
|
+
/* @__PURE__ */ React.createElement("span", null, " ", item.name)
|
|
19558
19591
|
), deletable && /* @__PURE__ */ React.createElement(
|
|
19559
19592
|
y$8,
|
|
19560
19593
|
{
|
|
@@ -19896,7 +19929,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
19896
19929
|
Overlay,
|
|
19897
19930
|
{
|
|
19898
19931
|
style: overlayStyle,
|
|
19899
|
-
className: overlayClassName,
|
|
19932
|
+
className: classNames("nut-dialog-overlay", overlayClassName),
|
|
19900
19933
|
visible,
|
|
19901
19934
|
closeOnOverlayClick,
|
|
19902
19935
|
lockScroll,
|
|
@@ -23430,10 +23463,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
23430
23463
|
target.style.transform = `translate3D${!isVertical ? `(${_offset}px,0,0)` : `(0,${_offset}px,0)`}`;
|
|
23431
23464
|
};
|
|
23432
23465
|
const onTouchStart = (e) => {
|
|
23433
|
-
if (props.preventDefault)
|
|
23434
|
-
e.preventDefault();
|
|
23435
|
-
if (props.stopPropagation)
|
|
23436
|
-
e.stopPropagation();
|
|
23437
23466
|
if (!props.touchable)
|
|
23438
23467
|
return;
|
|
23439
23468
|
touchStart(e);
|
|
@@ -23442,6 +23471,10 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
23442
23471
|
resetPosition();
|
|
23443
23472
|
};
|
|
23444
23473
|
const onTouchMove = (e) => {
|
|
23474
|
+
if (props.preventDefault)
|
|
23475
|
+
e.preventDefault();
|
|
23476
|
+
if (props.stopPropagation)
|
|
23477
|
+
e.stopPropagation();
|
|
23445
23478
|
if (props.touchable && swiperRef.current.moving) {
|
|
23446
23479
|
handleTouchMove(e);
|
|
23447
23480
|
if (touch.stateDirection === props.direction) {
|
|
@@ -9,12 +9,18 @@
|
|
|
9
9
|
padding: $dialog-padding;
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
|
|
12
|
+
&-overlay {
|
|
13
|
+
--nutui-overlay-zIndex: 1200;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
&__outer {
|
|
13
17
|
position: fixed;
|
|
14
18
|
max-height: 100%;
|
|
15
19
|
overflow-y: auto;
|
|
16
20
|
background-color: $white;
|
|
17
|
-
transition:
|
|
21
|
+
transition:
|
|
22
|
+
transform 0.2s,
|
|
23
|
+
-webkit-transform 0.2s;
|
|
18
24
|
-webkit-overflow-scrolling: touch;
|
|
19
25
|
top: 50%;
|
|
20
26
|
left: 50%;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
.nut-menu-item__wrap-up {
|
|
39
39
|
position: absolute;
|
|
40
40
|
width: 100%;
|
|
41
|
-
z-index:
|
|
41
|
+
z-index: $menu-item-z-index;
|
|
42
42
|
overflow: hidden;
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
.overlay-fade-enter-active.nut-menu__overlay {
|
|
50
50
|
top: auto;
|
|
51
|
-
z-index:
|
|
51
|
+
z-index: $menu-item-z-index;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.nut-menu__pop.nut-popup {
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
position: relative;
|
|
69
69
|
margin-right: $uploader-preview-margin-right;
|
|
70
70
|
margin-bottom: $uploader-preview-margin-bottom;
|
|
71
|
+
border-radius: $uploader-picture-border-radius;
|
|
71
72
|
box-shadow: 0 2px 10px 0 rgb(0 0 0 / 10%);
|
|
72
73
|
|
|
73
74
|
&__progress {
|
|
@@ -103,23 +104,20 @@
|
|
|
103
104
|
&-list {
|
|
104
105
|
width: 100%;
|
|
105
106
|
height: 32px;
|
|
107
|
+
box-sizing: border-box;
|
|
106
108
|
display: flex;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: space-between;
|
|
111
|
+
padding: 0 10px;
|
|
109
112
|
background-color: $gray5;
|
|
110
113
|
|
|
111
114
|
.nut-uploader__preview-img__file__name {
|
|
115
|
+
display: flex;
|
|
112
116
|
-webkit-line-clamp: 1;
|
|
113
117
|
padding: 2px;
|
|
114
118
|
height: 24px;
|
|
115
119
|
}
|
|
116
120
|
|
|
117
|
-
.nut-uploader__preview-img__file__del {
|
|
118
|
-
position: absolute;
|
|
119
|
-
right: 4px;
|
|
120
|
-
top: 6px;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
121
|
.nut-progress {
|
|
124
122
|
position: absolute;
|
|
125
123
|
left: 0;
|
|
@@ -137,6 +135,7 @@
|
|
|
137
135
|
right: $uploader-preview-close-right;
|
|
138
136
|
top: $uploader-preview-close-top;
|
|
139
137
|
transform: translate(50%, -50%);
|
|
138
|
+
z-index: 1;
|
|
140
139
|
}
|
|
141
140
|
|
|
142
141
|
&-img {
|
|
@@ -144,6 +143,7 @@
|
|
|
144
143
|
width: $uploader-picture-width;
|
|
145
144
|
height: $uploader-picture-height;
|
|
146
145
|
border-radius: $uploader-picture-border-radius;
|
|
146
|
+
overflow: hidden;
|
|
147
147
|
|
|
148
148
|
i {
|
|
149
149
|
color: $gray1;
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
width: 100%;
|
|
172
172
|
height: 100%;
|
|
173
173
|
position: initial;
|
|
174
|
-
border-radius:
|
|
174
|
+
border-radius: $uploader-picture-border-radius;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
&__file {
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
|
|
185
185
|
&__name {
|
|
186
186
|
display: flex;
|
|
187
|
-
width:
|
|
187
|
+
width: 90%;
|
|
188
188
|
font-size: 12px;
|
|
189
189
|
color: $text-color;
|
|
190
190
|
|
|
@@ -198,8 +198,8 @@
|
|
|
198
198
|
|
|
199
199
|
.nut-icon-link {
|
|
200
200
|
&::before {
|
|
201
|
-
margin-left: -
|
|
202
|
-
margin-top: -
|
|
201
|
+
margin-left: -45%;
|
|
202
|
+
margin-top: -45%;
|
|
203
203
|
transform: none;
|
|
204
204
|
}
|
|
205
205
|
}
|