@nutui/nutui-react 1.2.3-beta.2 → 2.0.0-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/dist/esm/Avatar.js +7 -5
- package/dist/esm/CalendarItem.js +19 -15
- package/dist/esm/CheckboxGroup.js +0 -1
- package/dist/esm/Drag.js +1 -1
- package/dist/esm/Icon/style/index.js +1 -0
- package/dist/esm/Icon.js +2 -2
- package/dist/esm/Infiniteloading.js +6 -5
- package/dist/esm/Input.js +8 -2
- package/dist/esm/InputNumber.js +11 -11
- package/dist/esm/NoticeBar.js +67 -28
- package/dist/esm/Notify.js +17 -3
- package/dist/esm/Picker.js +9 -4
- package/dist/esm/Popover.js +56 -72
- package/dist/esm/Price.js +14 -3
- package/dist/esm/Progress.js +1 -1
- package/dist/esm/Range.js +9 -3
- package/dist/esm/ShortPassword.js +22 -17
- package/dist/esm/TabbarItem.js +1 -1
- package/dist/esm/Tag.js +1 -1
- package/dist/esm/TextArea.js +3 -0
- package/dist/esm/Toast.js +22 -12
- package/dist/esm/Uploader.js +16 -6
- package/dist/esm/{icon-62bd7379.js → icon-8dc4de10.js} +9 -9
- 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/nutui.react.es.js +240 -173
- package/dist/nutui.react.umd.js +16771 -28
- package/dist/packages/col/col.scss +2 -2
- package/dist/packages/collapseitem/collapseitem.scss +1 -2
- package/dist/packages/icon/icon.scss +104 -12
- package/dist/packages/noticebar/noticebar.scss +31 -15
- package/dist/packages/notify/notify.scss +9 -0
- package/dist/packages/popover/popover.scss +205 -83
- package/dist/packages/rate/rate.scss +14 -13
- package/dist/packages/toast/toast.scss +16 -13
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/animation/icon.scss +245 -0
- package/dist/styles/animation/index.scss +1 -0
- package/dist/styles/font/config.json +169 -0
- package/dist/styles/font/demo_index.html +210 -3
- package/dist/styles/font/iconfont.css +39 -3
- package/dist/styles/font/iconfont.js +32 -32
- package/dist/styles/font/iconfont.json +63 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/variables.scss +23 -8
- package/dist/types/actionsheet/actionsheet.taro.d.ts +20 -0
- package/dist/types/actionsheet/index.taro.d.ts +2 -0
- package/dist/types/address/address.taro.d.ts +34 -0
- package/dist/types/address/index.taro.d.ts +2 -0
- package/dist/types/animatingnumbers/animatingnumbers.taro.d.ts +12 -0
- package/dist/types/animatingnumbers/countup.taro.d.ts +11 -0
- package/dist/types/animatingnumbers/index.taro.d.ts +2 -0
- package/dist/types/avatar/avatar.taro.d.ts +17 -0
- package/dist/types/avatar/index.taro.d.ts +2 -0
- package/dist/types/avatargroup/index.taro.d.ts +2 -0
- package/dist/types/backtop/backtop.taro.d.ts +15 -0
- package/dist/types/backtop/index.taro.d.ts +2 -0
- package/dist/types/badge/badge.taro.d.ts +14 -0
- package/dist/types/badge/index.taro.d.ts +2 -0
- package/dist/types/barrage/barrage.taro.d.ts +12 -0
- package/dist/types/barrage/index.taro.d.ts +2 -0
- package/dist/types/button/button.taro.d.ts +20 -0
- package/dist/types/button/index.taro.d.ts +2 -0
- package/dist/types/calendar/calendar.taro.d.ts +14 -0
- package/dist/types/calendar/index.taro.d.ts +2 -0
- package/dist/types/calendaritem/calendaritem.taro.d.ts +17 -0
- package/dist/types/calendaritem/index.taro.d.ts +2 -0
- package/dist/types/card/card.taro.d.ts +17 -0
- package/dist/types/card/index.taro.d.ts +2 -0
- package/dist/types/cell/cell.taro.d.ts +20 -0
- package/dist/types/cell/index.taro.d.ts +2 -0
- package/dist/types/cellgroup/cellgroup.taro.d.ts +10 -0
- package/dist/types/cellgroup/index.taro.d.ts +2 -0
- package/dist/types/checkbox/checkbox.taro.d.ts +19 -0
- package/dist/types/checkbox/index.taro.d.ts +2 -0
- package/dist/types/checkboxgroup/checkboxgroup.taro.d.ts +8 -0
- package/dist/types/checkboxgroup/index.taro.d.ts +2 -0
- package/dist/types/circleprogress/circleprogress.taro.d.ts +15 -0
- package/dist/types/circleprogress/index.taro.d.ts +2 -0
- package/dist/types/col/col.taro.d.ts +10 -0
- package/dist/types/col/index.taro.d.ts +2 -0
- package/dist/types/collapse/collapse.taro.d.ts +12 -0
- package/dist/types/collapse/index.taro.d.ts +2 -0
- package/dist/types/collapseitem/index.taro.d.ts +2 -0
- package/dist/types/configprovider/configprovider.taro.d.ts +12 -0
- package/dist/types/configprovider/index.taro.d.ts +2 -0
- package/dist/types/countdown/countdown.taro.d.ts +15 -0
- package/dist/types/countdown/index.taro.d.ts +2 -0
- package/dist/types/datepicker/datepicker.taro.d.ts +27 -0
- package/dist/types/datepicker/index.taro.d.ts +2 -0
- package/dist/types/dialog/dialog.taro.d.ts +2 -0
- package/dist/types/dialog/index.taro.d.ts +2 -0
- package/dist/types/divider/divider.taro.d.ts +12 -0
- package/dist/types/divider/index.taro.d.ts +2 -0
- package/dist/types/drag/drag.taro.d.ts +14 -0
- package/dist/types/drag/index.taro.d.ts +2 -0
- package/dist/types/elevator/elevator.taro.d.ts +22 -0
- package/dist/types/elevator/index.taro.d.ts +2 -0
- package/dist/types/empty/empty.taro.d.ts +8 -0
- package/dist/types/empty/index.taro.d.ts +2 -0
- package/dist/types/fixednav/fixednav.taro.d.ts +22 -0
- package/dist/types/fixednav/index.taro.d.ts +2 -0
- package/dist/types/icon/icon.d.ts +9 -3
- package/dist/types/icon/icon.taro.d.ts +19 -0
- package/dist/types/icon/index.taro.d.ts +2 -0
- package/dist/types/indicator/index.taro.d.ts +2 -0
- package/dist/types/indicator/indicator.taro.d.ts +10 -0
- package/dist/types/infiniteloading/index.taro.d.ts +2 -0
- package/dist/types/infiniteloading/infiniteloading.taro.d.ts +20 -0
- package/dist/types/input/index.taro.d.ts +2 -0
- package/dist/types/input/input.taro.d.ts +57 -0
- package/dist/types/inputnumber/index.taro.d.ts +2 -0
- package/dist/types/inputnumber/inputnumber.taro.d.ts +22 -0
- package/dist/types/layout/index.taro.d.ts +2 -0
- package/dist/types/layout/layout.taro.d.ts +4 -0
- package/dist/types/navbar/index.taro.d.ts +2 -0
- package/dist/types/navbar/navbar.taro.d.ts +21 -0
- package/dist/types/noticebar/demo.d.ts +1 -0
- package/dist/types/noticebar/index.taro.d.ts +2 -0
- package/dist/types/noticebar/noticebar.d.ts +1 -1
- package/dist/types/noticebar/noticebar.taro.d.ts +23 -0
- package/dist/types/notify/Notification.d.ts +8 -7
- package/dist/types/notify/index.taro.d.ts +2 -0
- package/dist/types/notify/notify.taro.d.ts +10 -0
- package/dist/types/numberkeyboard/index.taro.d.ts +2 -0
- package/dist/types/numberkeyboard/numberkeyboard.taro.d.ts +20 -0
- package/dist/types/overlay/index.taro.d.ts +2 -0
- package/dist/types/overlay/overlay.taro.d.ts +12 -0
- package/dist/types/pagination/index.taro.d.ts +2 -0
- package/dist/types/pagination/pagination.taro.d.ts +19 -0
- package/dist/types/picker/index.taro.d.ts +2 -0
- package/dist/types/picker/picker.d.ts +1 -0
- package/dist/types/picker/picker.taro.d.ts +24 -0
- package/dist/types/picker/pickerSlot.d.ts +1 -0
- package/dist/types/popover/__tests__/popover.spec.d.ts +1 -0
- package/dist/types/popover/index.taro.d.ts +2 -0
- package/dist/types/popover/popover.d.ts +14 -7
- package/dist/types/popover/popover.taro.d.ts +21 -0
- package/dist/types/popup/index.taro.d.ts +2 -0
- package/dist/types/popup/popup.taro.d.ts +25 -0
- package/dist/types/price/index.taro.d.ts +2 -0
- package/dist/types/price/price.taro.d.ts +11 -0
- package/dist/types/progress/index.taro.d.ts +2 -0
- package/dist/types/progress/progress.taro.d.ts +26 -0
- package/dist/types/radio/index.taro.d.ts +2 -0
- package/dist/types/radio/radio.taro.d.ts +21 -0
- package/dist/types/radiogroup/index.taro.d.ts +2 -0
- package/dist/types/range/index.taro.d.ts +2 -0
- package/dist/types/range/range.taro.d.ts +25 -0
- package/dist/types/rate/index.taro.d.ts +2 -0
- package/dist/types/rate/rate.taro.d.ts +17 -0
- package/dist/types/row/index.taro.d.ts +2 -0
- package/dist/types/row/row.taro.d.ts +12 -0
- package/dist/types/searchbar/index.taro.d.ts +2 -0
- package/dist/types/searchbar/searchbar.taro.d.ts +60 -0
- package/dist/types/shortpassword/_test_/index.spec.d.ts +1 -0
- package/dist/types/shortpassword/index.taro.d.ts +2 -0
- package/dist/types/shortpassword/shortpassword.d.ts +3 -3
- package/dist/types/shortpassword/shortpassword.taro.d.ts +21 -0
- package/dist/types/sidenavbar/index.taro.d.ts +2 -0
- package/dist/types/sidenavbar/sidenavbar.taro.d.ts +3 -0
- package/dist/types/sidenavbaritem/index.taro.d.ts +2 -0
- package/dist/types/sidenavbaritem/sidenavbaritem.taro.d.ts +3 -0
- package/dist/types/signature/index.taro.d.ts +2 -0
- package/dist/types/signature/signature.taro.d.ts +11 -0
- package/dist/types/skeleton/index.taro.d.ts +2 -0
- package/dist/types/skeleton/skeleton.taro.d.ts +19 -0
- package/dist/types/step/index.taro.d.ts +2 -0
- package/dist/types/steps/index.taro.d.ts +2 -0
- package/dist/types/steps/steps.taro.d.ts +10 -0
- package/dist/types/subsidenavbar/index.taro.d.ts +2 -0
- package/dist/types/subsidenavbar/subsidenavbar.taro.d.ts +3 -0
- package/dist/types/swiper/index.taro.d.ts +2 -0
- package/dist/types/swiper/swiper.taro.d.ts +27 -0
- package/dist/types/swiperitem/index.taro.d.ts +2 -0
- package/dist/types/switch/index.taro.d.ts +2 -0
- package/dist/types/switch/switch.taro.d.ts +14 -0
- package/dist/types/tabbar/index.taro.d.ts +2 -0
- package/dist/types/tabbar/tabbar.taro.d.ts +14 -0
- package/dist/types/tabbaritem/index.taro.d.ts +2 -0
- package/dist/types/tabbaritem/tabbaritem.taro.d.ts +17 -0
- package/dist/types/table/index.taro.d.ts +2 -0
- package/dist/types/table/table.taro.d.ts +3 -0
- package/dist/types/tabpane/index.taro.d.ts +2 -0
- package/dist/types/tabpane/tabpane.taro.d.ts +10 -0
- package/dist/types/tabs/index.taro.d.ts +2 -0
- package/dist/types/tabs/tabs.taro.d.ts +30 -0
- package/dist/types/tag/index.taro.d.ts +2 -0
- package/dist/types/tag/tag.taro.d.ts +16 -0
- package/dist/types/textarea/index.taro.d.ts +2 -0
- package/dist/types/textarea/textarea.taro.d.ts +18 -0
- package/dist/types/timedetail/index.taro.d.ts +2 -0
- package/dist/types/timedetail/timedetail.taro.d.ts +13 -0
- package/dist/types/timepannel/index.taro.d.ts +2 -0
- package/dist/types/timepannel/timepannel.taro.d.ts +8 -0
- package/dist/types/timeselect/index.taro.d.ts +2 -0
- package/dist/types/timeselect/timeselect.taro.d.ts +21 -0
- package/dist/types/toast/Notification.d.ts +6 -4
- package/dist/types/toast/__test__/toast.spec.d.ts +1 -0
- package/dist/types/toast/index.taro.d.ts +2 -0
- package/dist/types/toast/toast.taro.d.ts +11 -0
- package/dist/types/uploader/index.taro.d.ts +2 -0
- package/dist/types/uploader/uploader.d.ts +2 -2
- package/dist/types/uploader/uploader.taro.d.ts +68 -0
- package/dist/types/video/index.taro.d.ts +2 -0
- package/dist/types/virtuallist/index.taro.d.ts +2 -0
- package/dist/types/virtuallist/virtuallist.taro.d.ts +3 -0
- package/package.json +22 -4
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react
|
|
2
|
+
* @nutui/nutui-react v2.0.0-beta.0 Wed Aug 24 2022 13:54:14 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -48,18 +48,18 @@ const cn = classname.exports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" })
|
|
|
48
48
|
const defaultProps$1a = {
|
|
49
49
|
name: "",
|
|
50
50
|
size: "",
|
|
51
|
-
classPrefix: "
|
|
51
|
+
classPrefix: "nut-icon",
|
|
52
52
|
fontClassName: "nutui-iconfont",
|
|
53
53
|
color: "",
|
|
54
54
|
tag: "i",
|
|
55
|
-
|
|
55
|
+
onClick: (e2) => {
|
|
56
56
|
},
|
|
57
57
|
className: ""
|
|
58
58
|
};
|
|
59
59
|
function pxCheck$2(value) {
|
|
60
60
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
function Icon(props) {
|
|
63
63
|
const {
|
|
64
64
|
name,
|
|
65
65
|
size,
|
|
@@ -70,7 +70,7 @@ const Icon = (props) => {
|
|
|
70
70
|
className,
|
|
71
71
|
fontClassName,
|
|
72
72
|
style,
|
|
73
|
-
|
|
73
|
+
onClick,
|
|
74
74
|
...rest
|
|
75
75
|
} = {
|
|
76
76
|
...defaultProps$1a,
|
|
@@ -80,8 +80,8 @@ const Icon = (props) => {
|
|
|
80
80
|
const type = isImage ? "img" : tag;
|
|
81
81
|
const b2 = cn("icon");
|
|
82
82
|
const handleClick2 = (e2) => {
|
|
83
|
-
if (
|
|
84
|
-
|
|
83
|
+
if (onClick) {
|
|
84
|
+
onClick(e2);
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
const hasSrc = () => {
|
|
@@ -92,9 +92,7 @@ const Icon = (props) => {
|
|
|
92
92
|
return React__default.createElement(
|
|
93
93
|
type,
|
|
94
94
|
{
|
|
95
|
-
className: isImage ? `${
|
|
96
|
-
classPrefix
|
|
97
|
-
])} nut-icon-${name} `,
|
|
95
|
+
className: isImage ? `${b2("img")} ${className || ""} ` : `${fontClassName} ${b2(null)} ${classPrefix}-${name} ${className || ""}`,
|
|
98
96
|
style: {
|
|
99
97
|
color,
|
|
100
98
|
fontSize: pxCheck$2(size),
|
|
@@ -108,7 +106,7 @@ const Icon = (props) => {
|
|
|
108
106
|
},
|
|
109
107
|
children
|
|
110
108
|
);
|
|
111
|
-
}
|
|
109
|
+
}
|
|
112
110
|
Icon.defaultProps = defaultProps$1a;
|
|
113
111
|
Icon.displayName = "NutIcon";
|
|
114
112
|
const defaultProps$19 = {
|
|
@@ -2789,7 +2787,7 @@ Tabbar.displayName = "NutTabbar";
|
|
|
2789
2787
|
const defaultProps$Z = {
|
|
2790
2788
|
dot: false,
|
|
2791
2789
|
size: "",
|
|
2792
|
-
classPrefix: "
|
|
2790
|
+
classPrefix: "nut-icon",
|
|
2793
2791
|
tabTitle: "",
|
|
2794
2792
|
icon: "",
|
|
2795
2793
|
href: "",
|
|
@@ -3722,8 +3720,11 @@ class Notification$1 extends React.PureComponent {
|
|
|
3722
3720
|
}
|
|
3723
3721
|
render() {
|
|
3724
3722
|
const {
|
|
3723
|
+
id,
|
|
3725
3724
|
style,
|
|
3726
3725
|
icon,
|
|
3726
|
+
iconSize,
|
|
3727
|
+
title,
|
|
3727
3728
|
msg,
|
|
3728
3729
|
bottom,
|
|
3729
3730
|
center,
|
|
@@ -3741,14 +3742,16 @@ class Notification$1 extends React.PureComponent {
|
|
|
3741
3742
|
"nut-toast-has-icon": icon,
|
|
3742
3743
|
"nut-toast-cover": cover,
|
|
3743
3744
|
"nut-toast-loading": type === "loading",
|
|
3744
|
-
customClass,
|
|
3745
|
+
[`${customClass}`]: true,
|
|
3745
3746
|
[`nut-toast-${size}`]: true
|
|
3746
3747
|
});
|
|
3747
3748
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
3748
3749
|
className: `${toastBem()} ${classes}`,
|
|
3750
|
+
id: `toast-${id}`,
|
|
3749
3751
|
style: {
|
|
3750
|
-
bottom: center ? "auto" : `${bottom}
|
|
3751
|
-
backgroundColor: cover ? coverColor : ""
|
|
3752
|
+
bottom: center ? "auto" : `${bottom}`,
|
|
3753
|
+
backgroundColor: cover ? coverColor : "",
|
|
3754
|
+
...style
|
|
3752
3755
|
},
|
|
3753
3756
|
onClick: () => {
|
|
3754
3757
|
this.clickCover();
|
|
@@ -3763,8 +3766,11 @@ class Notification$1 extends React.PureComponent {
|
|
|
3763
3766
|
className: toastBem("icon-wrapper")
|
|
3764
3767
|
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
3765
3768
|
name: icon || "",
|
|
3766
|
-
|
|
3767
|
-
|
|
3769
|
+
color: "#ffffff",
|
|
3770
|
+
size: iconSize
|
|
3771
|
+
})) : null, title ? /* @__PURE__ */ React.createElement("div", {
|
|
3772
|
+
className: "nut-toast-title"
|
|
3773
|
+
}, title) : null, /* @__PURE__ */ React.createElement("span", {
|
|
3768
3774
|
className: toastBem("text")
|
|
3769
3775
|
}, msg))));
|
|
3770
3776
|
}
|
|
@@ -3798,13 +3804,16 @@ let messageInstance$1 = null;
|
|
|
3798
3804
|
const options$1 = {
|
|
3799
3805
|
msg: "",
|
|
3800
3806
|
id: "",
|
|
3807
|
+
style: {},
|
|
3801
3808
|
duration: 1.5,
|
|
3802
3809
|
center: true,
|
|
3803
3810
|
type: "text",
|
|
3811
|
+
title: "",
|
|
3804
3812
|
customClass: "",
|
|
3805
|
-
bottom:
|
|
3813
|
+
bottom: "30px",
|
|
3806
3814
|
size: "base",
|
|
3807
|
-
icon:
|
|
3815
|
+
icon: null,
|
|
3816
|
+
iconSize: "20",
|
|
3808
3817
|
textAlignCenter: true,
|
|
3809
3818
|
loadingRotate: true,
|
|
3810
3819
|
bgColor: "rgba(0, 0, 0, .8)",
|
|
@@ -3896,9 +3905,6 @@ const Range = (props) => {
|
|
|
3896
3905
|
buttonColor,
|
|
3897
3906
|
hiddenRange,
|
|
3898
3907
|
hiddenTag,
|
|
3899
|
-
min,
|
|
3900
|
-
max,
|
|
3901
|
-
step,
|
|
3902
3908
|
modelValue,
|
|
3903
3909
|
button,
|
|
3904
3910
|
vertical,
|
|
@@ -3907,6 +3913,10 @@ const Range = (props) => {
|
|
|
3907
3913
|
dragStart,
|
|
3908
3914
|
dragEnd
|
|
3909
3915
|
} = { ...defaultProps$R, ...props };
|
|
3916
|
+
let { min, max, step } = { ...defaultProps$R, ...props };
|
|
3917
|
+
min = Number(min);
|
|
3918
|
+
max = Number(max);
|
|
3919
|
+
step = Number(step);
|
|
3910
3920
|
const [buttonIndex, SetButtonIndex] = useState(0);
|
|
3911
3921
|
const [initValue, SetInitValue] = useState();
|
|
3912
3922
|
const [dragStatus, SetDragStatus] = useState("start");
|
|
@@ -4432,7 +4442,7 @@ const CalendarItem = (props) => {
|
|
|
4432
4442
|
if (startDate && Utils.compareDate(currDate, startDate) || endDate && Utils.compareDate(endDate, currDate)) {
|
|
4433
4443
|
return `${state.dayPrefix}-disabled`;
|
|
4434
4444
|
}
|
|
4435
|
-
if (state.isRange && Array.isArray(state.currDate) && Object.values(state.currDate).length
|
|
4445
|
+
if (state.isRange && Array.isArray(state.currDate) && Object.values(state.currDate).length === 2 && Utils.compareDate(state.currDate[0], currDate) && Utils.compareDate(currDate, state.currDate[1])) {
|
|
4436
4446
|
return `${state.dayPrefix}-choose`;
|
|
4437
4447
|
}
|
|
4438
4448
|
return null;
|
|
@@ -4440,14 +4450,14 @@ const CalendarItem = (props) => {
|
|
|
4440
4450
|
return `${state.dayPrefix}-disabled`;
|
|
4441
4451
|
};
|
|
4442
4452
|
const isActive = (day, month) => {
|
|
4443
|
-
return state.isRange && day.type
|
|
4453
|
+
return state.isRange && day.type === "curr" && getClass(day, month) === "calendar-month-day-active";
|
|
4444
4454
|
};
|
|
4445
4455
|
const isCurrDay = (month, day) => {
|
|
4446
4456
|
const date = `${month.curData[0]}-${month.curData[1]}-${day}`;
|
|
4447
4457
|
return Utils.isEqual(date, Utils.date2Str(new Date()));
|
|
4448
4458
|
};
|
|
4449
4459
|
const confirm2 = () => {
|
|
4450
|
-
if (state.isRange && state.chooseData.length
|
|
4460
|
+
if (state.isRange && state.chooseData.length === 2 || !state.isRange) {
|
|
4451
4461
|
onChoose && onChoose(state.chooseData);
|
|
4452
4462
|
if (poppable) {
|
|
4453
4463
|
onUpdate && onUpdate();
|
|
@@ -4455,7 +4465,7 @@ const CalendarItem = (props) => {
|
|
|
4455
4465
|
}
|
|
4456
4466
|
};
|
|
4457
4467
|
const chooseDay = (day, month, isFirst, isRange) => {
|
|
4458
|
-
if (getClass(day, month, isRange)
|
|
4468
|
+
if (getClass(day, month, isRange) !== `${state.dayPrefix}-disabled`) {
|
|
4459
4469
|
let days = [...month.curData];
|
|
4460
4470
|
days = isRange ? days.splice(3) : days.splice(0, 3);
|
|
4461
4471
|
days[2] = typeof day.day === "number" ? Utils.getNumTwoBit(day.day) : day.day;
|
|
@@ -4472,7 +4482,7 @@ const CalendarItem = (props) => {
|
|
|
4472
4482
|
} else {
|
|
4473
4483
|
Array.isArray(state.currDate) && state.currDate.unshift(days[3]);
|
|
4474
4484
|
}
|
|
4475
|
-
if (state.chooseData.length
|
|
4485
|
+
if (state.chooseData.length === 2 || !state.chooseData.length) {
|
|
4476
4486
|
state.chooseData = [...days];
|
|
4477
4487
|
} else if (Utils.compareDate(state.chooseData[3], days[3])) {
|
|
4478
4488
|
state.chooseData = [[...state.chooseData], [...days]];
|
|
@@ -4493,20 +4503,23 @@ const CalendarItem = (props) => {
|
|
|
4493
4503
|
return false;
|
|
4494
4504
|
};
|
|
4495
4505
|
const isEndTip = (day, month) => {
|
|
4506
|
+
if (isStartTip(day, month)) {
|
|
4507
|
+
return false;
|
|
4508
|
+
}
|
|
4496
4509
|
return isActive(day, month);
|
|
4497
4510
|
};
|
|
4498
4511
|
const getCurrData = (type2) => {
|
|
4499
|
-
const monthData = type2
|
|
4512
|
+
const monthData = type2 === "prev" ? state.monthsData[0] : state.monthsData[state.monthsData.length - 1];
|
|
4500
4513
|
let year = parseInt(monthData.curData[0]);
|
|
4501
4514
|
let month = parseInt(monthData.curData[1].toString().replace(/^0/, ""));
|
|
4502
4515
|
switch (type2) {
|
|
4503
4516
|
case "prev":
|
|
4504
|
-
month
|
|
4505
|
-
month = month
|
|
4517
|
+
month === 1 && (year -= 1);
|
|
4518
|
+
month = month === 1 ? 12 : --month;
|
|
4506
4519
|
break;
|
|
4507
4520
|
case "next":
|
|
4508
|
-
month
|
|
4509
|
-
month = month
|
|
4521
|
+
month === 12 && (year += 1);
|
|
4522
|
+
month = month === 12 ? 1 : ++month;
|
|
4510
4523
|
break;
|
|
4511
4524
|
}
|
|
4512
4525
|
return [
|
|
@@ -4516,7 +4529,7 @@ const CalendarItem = (props) => {
|
|
|
4516
4529
|
];
|
|
4517
4530
|
};
|
|
4518
4531
|
const getDaysStatus = (days, type2) => {
|
|
4519
|
-
if (type2
|
|
4532
|
+
if (type2 === "prev" && days >= 7) {
|
|
4520
4533
|
days -= 7;
|
|
4521
4534
|
}
|
|
4522
4535
|
return Array.from(Array(days), (v2, k2) => {
|
|
@@ -4541,7 +4554,7 @@ const CalendarItem = (props) => {
|
|
|
4541
4554
|
...getDaysStatus(currMonthDays, "curr")
|
|
4542
4555
|
]
|
|
4543
4556
|
};
|
|
4544
|
-
if (type2
|
|
4557
|
+
if (type2 === "next") {
|
|
4545
4558
|
if (!state.endData || !Utils.compareDate(
|
|
4546
4559
|
`${state.endData[0]}-${state.endData[1]}-${Utils.getMonthDays(
|
|
4547
4560
|
state.endData[0],
|
|
@@ -4607,7 +4620,7 @@ const CalendarItem = (props) => {
|
|
|
4607
4620
|
if (updateMove < 0 && updateMove < -offsetHeight + h2) {
|
|
4608
4621
|
updateMove = -offsetHeight + h2;
|
|
4609
4622
|
}
|
|
4610
|
-
if (offsetHeight <= h2 && state.monthsData.length
|
|
4623
|
+
if (offsetHeight <= h2 && state.monthsData.length === 1) {
|
|
4611
4624
|
updateMove = 0;
|
|
4612
4625
|
}
|
|
4613
4626
|
setTransform(updateMove, type2, time);
|
|
@@ -4618,7 +4631,7 @@ const CalendarItem = (props) => {
|
|
|
4618
4631
|
if (updateMove < -offsetHeight + h2 - 100 && state.monthsData.length > 1) {
|
|
4619
4632
|
updateMove = -offsetHeight + h2 - 100;
|
|
4620
4633
|
}
|
|
4621
|
-
if (updateMove < 0 && updateMove < -100 && state.monthsData.length
|
|
4634
|
+
if (updateMove < 0 && updateMove < -100 && state.monthsData.length === 1) {
|
|
4622
4635
|
updateMove = -100;
|
|
4623
4636
|
}
|
|
4624
4637
|
setTransform(updateMove);
|
|
@@ -4777,7 +4790,7 @@ const CalendarItem = (props) => {
|
|
|
4777
4790
|
className: "calendar-curr-tips"
|
|
4778
4791
|
}, locale.calendaritem.today) : "", isStartTip(day, month) ? /* @__PURE__ */ React__default.createElement("div", {
|
|
4779
4792
|
className: "calendar-day-tip"
|
|
4780
|
-
}, locale.calendaritem.start) : isEndTip(day, month) ? /* @__PURE__ */ React__default.createElement("div", {
|
|
4793
|
+
}, locale.calendaritem.start) : "", isEndTip(day, month) ? /* @__PURE__ */ React__default.createElement("div", {
|
|
4781
4794
|
className: "calendar-day-tip"
|
|
4782
4795
|
}, locale.calendaritem.end) : "")))))))), poppable && !isAutoBackFill ? /* @__PURE__ */ React__default.createElement("div", {
|
|
4783
4796
|
className: "nut-calendar-footer"
|
|
@@ -4883,7 +4896,6 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
4883
4896
|
const childrenLabel = [];
|
|
4884
4897
|
React__default.Children.map(children, (child) => {
|
|
4885
4898
|
const childProps = child.props;
|
|
4886
|
-
console.log(child);
|
|
4887
4899
|
childrenLabel.push(childProps.label || child.children);
|
|
4888
4900
|
});
|
|
4889
4901
|
setInnerValue(childrenLabel);
|
|
@@ -5054,9 +5066,11 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
5054
5066
|
defaultValue,
|
|
5055
5067
|
listData = [],
|
|
5056
5068
|
threeDimensional = true,
|
|
5069
|
+
swipeDuration = 1e3,
|
|
5057
5070
|
chooseItem
|
|
5058
5071
|
} = props;
|
|
5059
5072
|
const touch = useTouch();
|
|
5073
|
+
const DEFAULT_DURATION = 200;
|
|
5060
5074
|
const INERTIA_TIME = 300;
|
|
5061
5075
|
const INERTIA_DISTANCE = 15;
|
|
5062
5076
|
const [currIndex, setCurrIndex] = useState(1);
|
|
@@ -5076,7 +5090,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
5076
5090
|
}
|
|
5077
5091
|
return false;
|
|
5078
5092
|
};
|
|
5079
|
-
const setTransform = (translateY = 0, type, time =
|
|
5093
|
+
const setTransform = (translateY = 0, type, time = DEFAULT_DURATION, deg) => {
|
|
5080
5094
|
let nTime = time;
|
|
5081
5095
|
if (type !== "end") {
|
|
5082
5096
|
nTime = 0;
|
|
@@ -5136,7 +5150,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
5136
5150
|
const moveTime = Date.now() - startTime;
|
|
5137
5151
|
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
5138
5152
|
const distance = momentum(move, moveTime);
|
|
5139
|
-
setMove(distance, "end",
|
|
5153
|
+
setMove(distance, "end", +swipeDuration);
|
|
5140
5154
|
} else {
|
|
5141
5155
|
setMove(move, "end");
|
|
5142
5156
|
}
|
|
@@ -5236,6 +5250,7 @@ const InternalPicker = (props, ref) => {
|
|
|
5236
5250
|
className,
|
|
5237
5251
|
style,
|
|
5238
5252
|
threeDimensional,
|
|
5253
|
+
swipeDuration,
|
|
5239
5254
|
...rest
|
|
5240
5255
|
} = props;
|
|
5241
5256
|
const [chooseValueData, setchooseValueData] = useState([]);
|
|
@@ -5400,6 +5415,7 @@ const InternalPicker = (props, ref) => {
|
|
|
5400
5415
|
listData: item,
|
|
5401
5416
|
threeDimensional,
|
|
5402
5417
|
chooseItem: (value, index22) => chooseItem(value, index22),
|
|
5418
|
+
swipeDuration,
|
|
5403
5419
|
key: index2,
|
|
5404
5420
|
keyIndex: index2
|
|
5405
5421
|
});
|
|
@@ -5777,23 +5793,23 @@ const InputNumber = (props) => {
|
|
|
5777
5793
|
return Number(v2).toFixed(Number(decimalPlaces));
|
|
5778
5794
|
};
|
|
5779
5795
|
const emitChange = (value, e2) => {
|
|
5780
|
-
const
|
|
5781
|
-
change && change(
|
|
5796
|
+
const outputValue = fixedDecimalPlaces(value);
|
|
5797
|
+
change && change(outputValue, e2);
|
|
5782
5798
|
if (!isAsync) {
|
|
5783
|
-
if (Number(
|
|
5799
|
+
if (Number(outputValue) < Number(min)) {
|
|
5784
5800
|
setInputValue(Number(min));
|
|
5785
|
-
} else if (Number(
|
|
5801
|
+
} else if (Number(outputValue) > Number(max)) {
|
|
5786
5802
|
setInputValue(Number(max));
|
|
5787
5803
|
} else {
|
|
5788
|
-
setInputValue(
|
|
5804
|
+
setInputValue(outputValue);
|
|
5789
5805
|
}
|
|
5790
5806
|
}
|
|
5791
5807
|
};
|
|
5792
5808
|
const reduceNumber = (e2) => {
|
|
5793
5809
|
reduce && reduce(e2);
|
|
5794
5810
|
if (reduceAllow()) {
|
|
5795
|
-
const
|
|
5796
|
-
emitChange(
|
|
5811
|
+
const outputValue = Number(inputValue) - Number(step);
|
|
5812
|
+
emitChange(outputValue, e2);
|
|
5797
5813
|
} else {
|
|
5798
5814
|
overlimit && overlimit(e2);
|
|
5799
5815
|
}
|
|
@@ -5801,8 +5817,8 @@ const InputNumber = (props) => {
|
|
|
5801
5817
|
const addNumber = (e2) => {
|
|
5802
5818
|
add && add(e2);
|
|
5803
5819
|
if (addAllow()) {
|
|
5804
|
-
const
|
|
5805
|
-
emitChange(
|
|
5820
|
+
const outputValue = Number(inputValue) + Number(step);
|
|
5821
|
+
emitChange(outputValue, e2);
|
|
5806
5822
|
} else {
|
|
5807
5823
|
overlimit && overlimit(e2);
|
|
5808
5824
|
}
|
|
@@ -5848,7 +5864,7 @@ const InputNumber = (props) => {
|
|
|
5848
5864
|
className: iconMinusClasses,
|
|
5849
5865
|
size: buttonSize,
|
|
5850
5866
|
name: "minus",
|
|
5851
|
-
|
|
5867
|
+
onClick: reduceNumber
|
|
5852
5868
|
}), /* @__PURE__ */ React__default.createElement("input", {
|
|
5853
5869
|
type: "number",
|
|
5854
5870
|
min,
|
|
@@ -5864,7 +5880,7 @@ const InputNumber = (props) => {
|
|
|
5864
5880
|
className: iconAddClasses,
|
|
5865
5881
|
size: buttonSize,
|
|
5866
5882
|
name: "plus",
|
|
5867
|
-
|
|
5883
|
+
onClick: addNumber
|
|
5868
5884
|
}));
|
|
5869
5885
|
};
|
|
5870
5886
|
InputNumber.defaultProps = defaultProps$L;
|
|
@@ -6012,12 +6028,17 @@ const Input = (props) => {
|
|
|
6012
6028
|
const updateValue = (value, trigger = "onChange") => {
|
|
6013
6029
|
var _a;
|
|
6014
6030
|
let val = value;
|
|
6015
|
-
if (type === "digit") {
|
|
6031
|
+
if (type === "digit" || type === "tel") {
|
|
6016
6032
|
val = formatNumber(val, false, false);
|
|
6017
6033
|
}
|
|
6018
6034
|
if (type === "number") {
|
|
6019
6035
|
val = formatNumber(val, true, true);
|
|
6020
6036
|
}
|
|
6037
|
+
if (type === "tel" && !formatter) {
|
|
6038
|
+
const regTel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
|
|
6039
|
+
const regNumber = /[^-0-9]/g;
|
|
6040
|
+
val = !regTel.test(val) && val.length > 11 ? val.substring(0, 11) : val.replace(regNumber, "");
|
|
6041
|
+
}
|
|
6021
6042
|
if (formatter && trigger === formatTrigger) {
|
|
6022
6043
|
val = formatter(val);
|
|
6023
6044
|
}
|
|
@@ -6159,7 +6180,7 @@ const Input = (props) => {
|
|
|
6159
6180
|
className: "nut-input-clear",
|
|
6160
6181
|
name: clearIcon,
|
|
6161
6182
|
size: clearSize,
|
|
6162
|
-
|
|
6183
|
+
onClick: (e2) => {
|
|
6163
6184
|
handleClear(e2);
|
|
6164
6185
|
}
|
|
6165
6186
|
}) : null, rightIcon && rightIcon.length > 0 ? /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -6426,9 +6447,9 @@ const Rate = (props) => {
|
|
|
6426
6447
|
Rate.defaultProps = defaultProps$H;
|
|
6427
6448
|
Rate.displayName = "NutRate";
|
|
6428
6449
|
const defaultProps$G = {
|
|
6429
|
-
title: "
|
|
6430
|
-
desc: "
|
|
6431
|
-
tips: "
|
|
6450
|
+
title: "",
|
|
6451
|
+
desc: "",
|
|
6452
|
+
tips: "",
|
|
6432
6453
|
visible: false,
|
|
6433
6454
|
modelValue: "",
|
|
6434
6455
|
errorMsg: "",
|
|
@@ -6436,7 +6457,7 @@ const defaultProps$G = {
|
|
|
6436
6457
|
closeOnClickOverlay: true,
|
|
6437
6458
|
length: 6,
|
|
6438
6459
|
className: "",
|
|
6439
|
-
|
|
6460
|
+
onChange: (value) => {
|
|
6440
6461
|
},
|
|
6441
6462
|
onOk: (value) => {
|
|
6442
6463
|
},
|
|
@@ -6446,7 +6467,7 @@ const defaultProps$G = {
|
|
|
6446
6467
|
},
|
|
6447
6468
|
onTips: () => {
|
|
6448
6469
|
},
|
|
6449
|
-
|
|
6470
|
+
onComplete: (value) => {
|
|
6450
6471
|
}
|
|
6451
6472
|
};
|
|
6452
6473
|
const ShortPassword = (props) => {
|
|
@@ -6463,12 +6484,12 @@ const ShortPassword = (props) => {
|
|
|
6463
6484
|
length,
|
|
6464
6485
|
style,
|
|
6465
6486
|
className,
|
|
6466
|
-
|
|
6487
|
+
onChange,
|
|
6467
6488
|
onOk,
|
|
6468
6489
|
onTips,
|
|
6469
6490
|
onCancel,
|
|
6470
6491
|
onClose,
|
|
6471
|
-
|
|
6492
|
+
onComplete,
|
|
6472
6493
|
...reset
|
|
6473
6494
|
} = props;
|
|
6474
6495
|
const b2 = cn("shortpassword");
|
|
@@ -6483,7 +6504,7 @@ const ShortPassword = (props) => {
|
|
|
6483
6504
|
setInnerVisible(visible);
|
|
6484
6505
|
}, [visible]);
|
|
6485
6506
|
useEffect(() => {
|
|
6486
|
-
if (modelValue) {
|
|
6507
|
+
if (typeof modelValue !== "undefined") {
|
|
6487
6508
|
setInputValue(modelValue);
|
|
6488
6509
|
}
|
|
6489
6510
|
}, [modelValue]);
|
|
@@ -6494,25 +6515,28 @@ const ShortPassword = (props) => {
|
|
|
6494
6515
|
}
|
|
6495
6516
|
setInputValue(inputValue2);
|
|
6496
6517
|
if (String(inputValue2).length === comLen) {
|
|
6497
|
-
|
|
6518
|
+
onComplete && onComplete(inputValue2);
|
|
6498
6519
|
}
|
|
6499
|
-
|
|
6520
|
+
onChange && onChange(inputValue2);
|
|
6500
6521
|
};
|
|
6501
6522
|
const systemStyle = () => {
|
|
6502
6523
|
const u = navigator.userAgent;
|
|
6503
6524
|
const isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1;
|
|
6504
6525
|
const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
6526
|
+
let style2 = {};
|
|
6527
|
+
console.log(isIOS, isAndroid);
|
|
6505
6528
|
if (isIOS) {
|
|
6506
|
-
|
|
6529
|
+
style2 = {
|
|
6507
6530
|
paddingRight: "1200px"
|
|
6508
6531
|
};
|
|
6509
6532
|
}
|
|
6510
6533
|
if (isAndroid) {
|
|
6511
|
-
|
|
6534
|
+
style2 = {
|
|
6512
6535
|
opacity: 0,
|
|
6513
6536
|
zIndex: 10
|
|
6514
6537
|
};
|
|
6515
6538
|
}
|
|
6539
|
+
return style2;
|
|
6516
6540
|
};
|
|
6517
6541
|
const focus = () => {
|
|
6518
6542
|
if (textInput.current) {
|
|
@@ -6539,9 +6563,9 @@ const ShortPassword = (props) => {
|
|
|
6539
6563
|
...reset
|
|
6540
6564
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6541
6565
|
className: b2("title")
|
|
6542
|
-
}, locale.shortpassword.title
|
|
6566
|
+
}, title || locale.shortpassword.title), /* @__PURE__ */ React__default.createElement("div", {
|
|
6543
6567
|
className: b2("subtitle")
|
|
6544
|
-
}, locale.shortpassword.desc
|
|
6568
|
+
}, desc || locale.shortpassword.desc), /* @__PURE__ */ React__default.createElement("div", {
|
|
6545
6569
|
className: b2("input")
|
|
6546
6570
|
}, /* @__PURE__ */ React__default.createElement("input", {
|
|
6547
6571
|
ref: textInput,
|
|
@@ -6567,7 +6591,7 @@ const ShortPassword = (props) => {
|
|
|
6567
6591
|
className: b2("message")
|
|
6568
6592
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6569
6593
|
className: b2("message__error")
|
|
6570
|
-
}, errorMsg2), tips ? /* @__PURE__ */ React__default.createElement("div", {
|
|
6594
|
+
}, errorMsg2), tips || locale.shortpassword.tips ? /* @__PURE__ */ React__default.createElement("div", {
|
|
6571
6595
|
className: b2("message__forget")
|
|
6572
6596
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6573
6597
|
className: "icon",
|
|
@@ -6575,7 +6599,7 @@ const ShortPassword = (props) => {
|
|
|
6575
6599
|
name: "tips"
|
|
6576
6600
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
6577
6601
|
onClick: onTips
|
|
6578
|
-
}, locale.shortpassword.tips
|
|
6602
|
+
}, tips || locale.shortpassword.tips)) : null), !noButton ? /* @__PURE__ */ React__default.createElement("div", {
|
|
6579
6603
|
className: b2("footer")
|
|
6580
6604
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6581
6605
|
className: b2("footer__cancel"),
|
|
@@ -6663,6 +6687,9 @@ const TextArea = (props) => {
|
|
|
6663
6687
|
disabled,
|
|
6664
6688
|
readOnly: readonly,
|
|
6665
6689
|
value: inputValue,
|
|
6690
|
+
onInput: (e2) => {
|
|
6691
|
+
textChange(e2);
|
|
6692
|
+
},
|
|
6666
6693
|
onChange: (e2) => {
|
|
6667
6694
|
textChange(e2);
|
|
6668
6695
|
},
|
|
@@ -6856,6 +6883,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6856
6883
|
item.status = "ready";
|
|
6857
6884
|
item.message = locale.uploader.readyUpload;
|
|
6858
6885
|
}
|
|
6886
|
+
return item;
|
|
6859
6887
|
});
|
|
6860
6888
|
return [...fileList2];
|
|
6861
6889
|
});
|
|
@@ -6868,6 +6896,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6868
6896
|
item.status = "uploading";
|
|
6869
6897
|
item.message = locale.uploader.uploading;
|
|
6870
6898
|
}
|
|
6899
|
+
return item;
|
|
6871
6900
|
});
|
|
6872
6901
|
return [...fileList2];
|
|
6873
6902
|
});
|
|
@@ -6881,6 +6910,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6881
6910
|
item.status = "success";
|
|
6882
6911
|
item.message = locale.uploader.success;
|
|
6883
6912
|
}
|
|
6913
|
+
return item;
|
|
6884
6914
|
});
|
|
6885
6915
|
return [...fileList2];
|
|
6886
6916
|
});
|
|
@@ -6896,6 +6926,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6896
6926
|
item.status = "error";
|
|
6897
6927
|
item.message = locale.uploader.error;
|
|
6898
6928
|
}
|
|
6929
|
+
return item;
|
|
6899
6930
|
});
|
|
6900
6931
|
return [...fileList2];
|
|
6901
6932
|
});
|
|
@@ -7025,7 +7056,7 @@ const InternalUploader = (props, ref) => {
|
|
|
7025
7056
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
7026
7057
|
className: `nut-uploader__preview ${listType}`,
|
|
7027
7058
|
key: item.uid
|
|
7028
|
-
}, listType
|
|
7059
|
+
}, listType === "picture" && !children && /* @__PURE__ */ React__default.createElement("div", {
|
|
7029
7060
|
className: "nut-uploader__preview-img"
|
|
7030
7061
|
}, item.status === "ready" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
7031
7062
|
className: "nut-uploader__preview__progress"
|
|
@@ -7035,21 +7066,23 @@ const InternalUploader = (props, ref) => {
|
|
|
7035
7066
|
className: "nut-uploader__preview__progress"
|
|
7036
7067
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
7037
7068
|
color: "#fff",
|
|
7038
|
-
name: `${item.status
|
|
7069
|
+
name: `${item.status === "error" ? "failure" : "loading"}`
|
|
7039
7070
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
7040
7071
|
className: "nut-uploader__preview__progress__msg"
|
|
7041
7072
|
}, item.message)), isDeletable && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
7042
7073
|
color: "rgba(0,0,0,0.6)",
|
|
7043
7074
|
className: "close",
|
|
7044
7075
|
name: "failure",
|
|
7045
|
-
|
|
7076
|
+
onClick: () => onDelete(item, index2)
|
|
7046
7077
|
}), item.type.includes("image") ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.url && /* @__PURE__ */ React__default.createElement("img", {
|
|
7047
7078
|
className: "nut-uploader__preview-img__c",
|
|
7048
7079
|
src: item.url,
|
|
7080
|
+
alt: "",
|
|
7049
7081
|
onClick: () => handleItemClick(item)
|
|
7050
7082
|
})) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, defaultImg ? /* @__PURE__ */ React__default.createElement("img", {
|
|
7051
7083
|
className: "nut-uploader__preview-img__c",
|
|
7052
7084
|
src: defaultImg,
|
|
7085
|
+
alt: "",
|
|
7053
7086
|
onClick: () => handleItemClick(item)
|
|
7054
7087
|
}) : /* @__PURE__ */ React__default.createElement("div", {
|
|
7055
7088
|
className: "nut-uploader__preview-img__file"
|
|
@@ -7061,7 +7094,7 @@ const InternalUploader = (props, ref) => {
|
|
|
7061
7094
|
name: "link"
|
|
7062
7095
|
}), "\xA0", item.name))), /* @__PURE__ */ React__default.createElement("div", {
|
|
7063
7096
|
className: "tips"
|
|
7064
|
-
}, item.name)), listType
|
|
7097
|
+
}, item.name)), listType === "list" && /* @__PURE__ */ React__default.createElement("div", {
|
|
7065
7098
|
className: "nut-uploader__preview-list"
|
|
7066
7099
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
7067
7100
|
className: `nut-uploader__preview-img__file__name ${item.status}`,
|
|
@@ -7072,9 +7105,9 @@ const InternalUploader = (props, ref) => {
|
|
|
7072
7105
|
color: "#808080",
|
|
7073
7106
|
className: "nut-uploader__preview-img__file__del",
|
|
7074
7107
|
name: "del",
|
|
7075
|
-
|
|
7108
|
+
onClick: () => onDelete(item, index2)
|
|
7076
7109
|
})));
|
|
7077
|
-
}), maximum > fileList.length && listType
|
|
7110
|
+
}), maximum > fileList.length && listType === "picture" && !children && /* @__PURE__ */ React__default.createElement("div", {
|
|
7078
7111
|
className: `nut-uploader__upload ${listType}`
|
|
7079
7112
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
7080
7113
|
size: uploadIconSize,
|
|
@@ -12126,7 +12159,7 @@ const Drag = (props) => {
|
|
|
12126
12159
|
({ down, last, offset: [x2, y2] }) => {
|
|
12127
12160
|
api.start({ x: x2, y: y2, immediate: down });
|
|
12128
12161
|
if (last) {
|
|
12129
|
-
if (props.direction
|
|
12162
|
+
if (props.direction !== "y" && props.attract) {
|
|
12130
12163
|
if (x2 < middleLine.current) {
|
|
12131
12164
|
api.start({ x: boundaryState.left, y: y2, immediate: down });
|
|
12132
12165
|
} else {
|
|
@@ -12529,6 +12562,7 @@ const Infiniteloading = (props) => {
|
|
|
12529
12562
|
}
|
|
12530
12563
|
setIsInfiniting(true);
|
|
12531
12564
|
loadMore && loadMore(infiniteDone);
|
|
12565
|
+
return true;
|
|
12532
12566
|
});
|
|
12533
12567
|
};
|
|
12534
12568
|
const infiniteDone = () => {
|
|
@@ -12572,7 +12606,7 @@ const Infiniteloading = (props) => {
|
|
|
12572
12606
|
}
|
|
12573
12607
|
};
|
|
12574
12608
|
const requestAniFrame2 = () => {
|
|
12575
|
-
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
|
|
12609
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function fn(callback) {
|
|
12576
12610
|
window.setTimeout(callback, 1e3 / 60);
|
|
12577
12611
|
};
|
|
12578
12612
|
};
|
|
@@ -12604,7 +12638,7 @@ const Infiniteloading = (props) => {
|
|
|
12604
12638
|
}
|
|
12605
12639
|
beforeScrollTop.current = resScrollTop;
|
|
12606
12640
|
scrollChange && scrollChange(resScrollTop);
|
|
12607
|
-
return offsetDistance <= threshold && direction
|
|
12641
|
+
return offsetDistance <= threshold && direction === "down";
|
|
12608
12642
|
};
|
|
12609
12643
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
12610
12644
|
className: classes,
|
|
@@ -12624,7 +12658,7 @@ const Infiniteloading = (props) => {
|
|
|
12624
12658
|
name: pullIcon
|
|
12625
12659
|
}), /* @__PURE__ */ React__default.createElement("span", {
|
|
12626
12660
|
className: "top-text"
|
|
12627
|
-
}, locale.infiniteloading.pullRefreshText
|
|
12661
|
+
}, pullTxt || locale.infiniteloading.pullRefreshText))), /* @__PURE__ */ React__default.createElement("div", {
|
|
12628
12662
|
className: "nut-infinite-container"
|
|
12629
12663
|
}, children), /* @__PURE__ */ React__default.createElement("div", {
|
|
12630
12664
|
className: "nut-infinite-bottom"
|
|
@@ -12635,9 +12669,9 @@ const Infiniteloading = (props) => {
|
|
|
12635
12669
|
name: loadIcon
|
|
12636
12670
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
12637
12671
|
className: "bottom-text"
|
|
12638
|
-
}, locale.infiniteloading.loadText
|
|
12672
|
+
}, loadTxt || locale.infiniteloading.loadText)) : !hasMore && /* @__PURE__ */ React__default.createElement("div", {
|
|
12639
12673
|
className: "tips"
|
|
12640
|
-
}, locale.infiniteloading.loadMoreText
|
|
12674
|
+
}, loadMoreTxt || locale.infiniteloading.loadMoreText)));
|
|
12641
12675
|
};
|
|
12642
12676
|
Infiniteloading.defaultProps = defaultProps$x;
|
|
12643
12677
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
@@ -12687,11 +12721,22 @@ class Notification extends React.PureComponent {
|
|
|
12687
12721
|
this.clearCloseTimer();
|
|
12688
12722
|
}
|
|
12689
12723
|
render() {
|
|
12690
|
-
const {
|
|
12724
|
+
const {
|
|
12725
|
+
children,
|
|
12726
|
+
style,
|
|
12727
|
+
msg,
|
|
12728
|
+
color,
|
|
12729
|
+
background,
|
|
12730
|
+
type,
|
|
12731
|
+
className,
|
|
12732
|
+
position,
|
|
12733
|
+
isWrapTeleport
|
|
12734
|
+
} = this.props;
|
|
12691
12735
|
this.state;
|
|
12692
12736
|
cn("notify");
|
|
12693
12737
|
const classes = classNames({
|
|
12694
|
-
"popup-top":
|
|
12738
|
+
"popup-top": position === "top",
|
|
12739
|
+
"popup-bottom": position === "bottom",
|
|
12695
12740
|
"nut-notify": true,
|
|
12696
12741
|
[`nut-notify--${type}`]: true
|
|
12697
12742
|
});
|
|
@@ -12700,7 +12745,9 @@ class Notification extends React.PureComponent {
|
|
|
12700
12745
|
timeout: 300,
|
|
12701
12746
|
classNames: "fade",
|
|
12702
12747
|
unmountOnExit: true,
|
|
12703
|
-
appear: true
|
|
12748
|
+
appear: true,
|
|
12749
|
+
position,
|
|
12750
|
+
isWrapTeleport
|
|
12704
12751
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
12705
12752
|
className: `${classes} ${className}`,
|
|
12706
12753
|
style: {
|
|
@@ -12743,8 +12790,11 @@ const options = {
|
|
|
12743
12790
|
msg: "",
|
|
12744
12791
|
id: "",
|
|
12745
12792
|
duration: 3e3,
|
|
12793
|
+
color: "",
|
|
12746
12794
|
type: "danger",
|
|
12747
12795
|
className: "",
|
|
12796
|
+
position: "top",
|
|
12797
|
+
isWrapTeleport: true,
|
|
12748
12798
|
onClosed: () => {
|
|
12749
12799
|
},
|
|
12750
12800
|
onClick: () => {
|
|
@@ -12988,7 +13038,7 @@ const defaultProps$u = {
|
|
|
12988
13038
|
color: "",
|
|
12989
13039
|
background: "",
|
|
12990
13040
|
delay: 1,
|
|
12991
|
-
scrollable:
|
|
13041
|
+
scrollable: null,
|
|
12992
13042
|
speed: 50
|
|
12993
13043
|
};
|
|
12994
13044
|
const NoticeBar = (props) => {
|
|
@@ -13026,6 +13076,7 @@ const NoticeBar = (props) => {
|
|
|
13026
13076
|
const [animate, SetAnimate] = useState(false);
|
|
13027
13077
|
const [distance, SetDistance] = useState(0);
|
|
13028
13078
|
const [timer, SetTimer] = useState(0);
|
|
13079
|
+
const [isCanScroll, SetIsCanScroll] = useState(null);
|
|
13029
13080
|
useState(0);
|
|
13030
13081
|
useEffect(() => {
|
|
13031
13082
|
if (direction === "vertical") {
|
|
@@ -13052,12 +13103,13 @@ const NoticeBar = (props) => {
|
|
|
13052
13103
|
}, []);
|
|
13053
13104
|
const cloneChild = (listItem, listIndex) => {
|
|
13054
13105
|
return React__default.Children.map(children, function(child, index2) {
|
|
13055
|
-
if (child && index2
|
|
13106
|
+
if (child && index2 === listIndex) {
|
|
13056
13107
|
return React__default.cloneElement(child, {
|
|
13057
13108
|
key: listIndex,
|
|
13058
13109
|
children: listItem
|
|
13059
13110
|
});
|
|
13060
13111
|
}
|
|
13112
|
+
return null;
|
|
13061
13113
|
});
|
|
13062
13114
|
};
|
|
13063
13115
|
useEffect(() => {
|
|
@@ -13078,7 +13130,9 @@ const NoticeBar = (props) => {
|
|
|
13078
13130
|
}
|
|
13079
13131
|
const wrapW = wrap.current.getBoundingClientRect().width;
|
|
13080
13132
|
const offsetW = content.current.getBoundingClientRect().width;
|
|
13081
|
-
|
|
13133
|
+
const canScroll = scrollable == null ? offsetW > wrapW : scrollable;
|
|
13134
|
+
SetIsCanScroll(canScroll);
|
|
13135
|
+
if (canScroll) {
|
|
13082
13136
|
SetWrapWidth(wrapW);
|
|
13083
13137
|
SetOffsetW(offsetW);
|
|
13084
13138
|
SetDuration(offsetW / speed);
|
|
@@ -13086,7 +13140,7 @@ const NoticeBar = (props) => {
|
|
|
13086
13140
|
} else {
|
|
13087
13141
|
SetAnimationClass("");
|
|
13088
13142
|
}
|
|
13089
|
-
});
|
|
13143
|
+
}, 0);
|
|
13090
13144
|
};
|
|
13091
13145
|
const handleClick2 = (event) => {
|
|
13092
13146
|
click && click(event);
|
|
@@ -13148,19 +13202,39 @@ const NoticeBar = (props) => {
|
|
|
13148
13202
|
const handleClickIcon = () => {
|
|
13149
13203
|
close && close(scrollList[0]);
|
|
13150
13204
|
};
|
|
13205
|
+
const iconShow = () => {
|
|
13206
|
+
if (leftIcon === "close") {
|
|
13207
|
+
return false;
|
|
13208
|
+
}
|
|
13209
|
+
return true;
|
|
13210
|
+
};
|
|
13211
|
+
const iconBg = () => {
|
|
13212
|
+
let iconBg2 = "";
|
|
13213
|
+
if (leftIcon) {
|
|
13214
|
+
iconBg2 = leftIcon;
|
|
13215
|
+
}
|
|
13216
|
+
return iconBg2;
|
|
13217
|
+
};
|
|
13218
|
+
const isEllipsis = () => {
|
|
13219
|
+
if (isCanScroll == null) {
|
|
13220
|
+
return wrapable;
|
|
13221
|
+
}
|
|
13222
|
+
return !isCanScroll && !wrapable;
|
|
13223
|
+
};
|
|
13151
13224
|
const contentStyle = {
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13225
|
+
animationDelay: `${firstRound ? delay : 0}s`,
|
|
13226
|
+
animationDuration: `${duration}s`,
|
|
13227
|
+
transform: `translateX(${firstRound ? 0 : `${wrapWidth}px`})`
|
|
13155
13228
|
};
|
|
13156
13229
|
const barStyle = {
|
|
13157
13230
|
color,
|
|
13158
13231
|
background,
|
|
13159
|
-
height: direction
|
|
13232
|
+
height: direction === "vertical" ? `${height}px` : ""
|
|
13160
13233
|
};
|
|
13234
|
+
const duringTime = ~~(height / speed / 4);
|
|
13161
13235
|
const horseLampStyle = {
|
|
13162
13236
|
transform: complexAm ? `translateY(${distance}px)` : "",
|
|
13163
|
-
transition: animate ? `all ${~~(height / speed
|
|
13237
|
+
transition: animate ? `all ${duringTime === 0 ? ~~(height / speed) : duringTime}s` : "",
|
|
13164
13238
|
marginTop: animate ? `-${height}px` : ""
|
|
13165
13239
|
};
|
|
13166
13240
|
const b2 = cn("noticebar");
|
|
@@ -13173,32 +13247,32 @@ const NoticeBar = (props) => {
|
|
|
13173
13247
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13174
13248
|
className: `${b2()} ${className || ""}`,
|
|
13175
13249
|
style
|
|
13176
|
-
}, showNoticeBar && direction
|
|
13250
|
+
}, showNoticeBar && direction === "across" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13177
13251
|
className: noticebarClass,
|
|
13178
13252
|
style: barStyle,
|
|
13179
13253
|
onClick: handleClick2
|
|
13180
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13254
|
+
}, iconShow() ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13181
13255
|
className: "left-icon",
|
|
13182
|
-
style: { backgroundImage: `url(${
|
|
13183
|
-
}, !
|
|
13256
|
+
style: { backgroundImage: `url(${iconBg() || ""})` }
|
|
13257
|
+
}, !iconBg() ? /* @__PURE__ */ React__default.createElement(Icon, {
|
|
13184
13258
|
name: "notice",
|
|
13185
13259
|
size: "16",
|
|
13186
13260
|
color
|
|
13187
|
-
}) : null), /* @__PURE__ */ React__default.createElement("div", {
|
|
13261
|
+
}) : null) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
13188
13262
|
ref: wrap,
|
|
13189
13263
|
className: "wrap"
|
|
13190
13264
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13191
13265
|
ref: content,
|
|
13192
|
-
className: `content ${animationClass} ${
|
|
13266
|
+
className: `content ${animationClass} ${isEllipsis() && "nut-ellipsis"}`,
|
|
13193
13267
|
style: contentStyle,
|
|
13194
13268
|
onAnimationEnd
|
|
13195
|
-
}, children, text)), closeMode ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13269
|
+
}, children, text)), closeMode || rightIcon ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13196
13270
|
className: "right-icon",
|
|
13197
13271
|
onClick: onClickIcon
|
|
13198
13272
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
13199
|
-
name: "close",
|
|
13273
|
+
name: rightIcon || "close",
|
|
13200
13274
|
color
|
|
13201
|
-
})) : null) : scrollList.current.length > 0 && direction
|
|
13275
|
+
})) : null) : null, scrollList.current.length > 0 && direction === "vertical" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13202
13276
|
className: "nut-noticebar-vertical",
|
|
13203
13277
|
style: barStyle
|
|
13204
13278
|
}, children ? /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -13861,8 +13935,8 @@ const Avatar = (props) => {
|
|
|
13861
13935
|
height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
13862
13936
|
backgroundColor: `${bgColor}`,
|
|
13863
13937
|
color: `${color}`,
|
|
13864
|
-
marginLeft: avatarIndex
|
|
13865
|
-
zIndex: ((_e = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _e.zIndex)
|
|
13938
|
+
marginLeft: avatarIndex !== 1 && ((_c = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c.span) ? `${(_d = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _d.span}px` : "",
|
|
13939
|
+
zIndex: ((_e = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _e.zIndex) === "right" ? `${Math.abs(maxSum - avatarIndex)}` : "",
|
|
13866
13940
|
...style
|
|
13867
13941
|
};
|
|
13868
13942
|
const maxStyles = {
|
|
@@ -13880,15 +13954,16 @@ const Avatar = (props) => {
|
|
|
13880
13954
|
const avatarLength = (children2) => {
|
|
13881
13955
|
var _a2, _b2, _c2;
|
|
13882
13956
|
for (let i = 0; i < children2.length; i++) {
|
|
13883
|
-
|
|
13957
|
+
console.log("child", children2[i], children2[i].classList);
|
|
13958
|
+
if (children2[i] && children2[i].classList && children2[i].classList[0] === "nut-avatar") {
|
|
13884
13959
|
children2[i].setAttribute("data-index", i + 1);
|
|
13885
13960
|
}
|
|
13886
13961
|
}
|
|
13887
|
-
const index2 = (_b2 = (_a2 = avatarRef == null ? void 0 : avatarRef.current) == null ? void 0 : _a2.dataset) == null ? void 0 : _b2.index;
|
|
13962
|
+
const index2 = Number((_b2 = (_a2 = avatarRef == null ? void 0 : avatarRef.current) == null ? void 0 : _a2.dataset) == null ? void 0 : _b2.index);
|
|
13888
13963
|
const maxCount = (_c2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c2.maxCount;
|
|
13889
13964
|
setMaxSum(children2.length);
|
|
13890
13965
|
setAvatarIndex(index2);
|
|
13891
|
-
if (index2
|
|
13966
|
+
if (index2 === children2.length && index2 !== maxCount && children2.length > maxCount) {
|
|
13892
13967
|
setShowMax(true);
|
|
13893
13968
|
}
|
|
13894
13969
|
};
|
|
@@ -13976,14 +14051,24 @@ const Price = (props) => {
|
|
|
13976
14051
|
...props
|
|
13977
14052
|
};
|
|
13978
14053
|
const b2 = cn("price");
|
|
14054
|
+
const replaceSpecialChar = (symbol2) => {
|
|
14055
|
+
let desSymbol = symbol2;
|
|
14056
|
+
desSymbol = symbol2.replace(/"/g, '"');
|
|
14057
|
+
desSymbol = symbol2.replace(/&/g, "&");
|
|
14058
|
+
desSymbol = symbol2.replace(/</g, "<");
|
|
14059
|
+
desSymbol = symbol2.replace(/>/g, ">");
|
|
14060
|
+
desSymbol = symbol2.replace(/ /g, " ");
|
|
14061
|
+
desSymbol = symbol2.replace(/¥/g, "\uFFE5");
|
|
14062
|
+
return desSymbol;
|
|
14063
|
+
};
|
|
13979
14064
|
const showSymbol = () => {
|
|
13980
|
-
return { __html: (needSymbol ? symbol : "") || "" };
|
|
14065
|
+
return { __html: (needSymbol ? replaceSpecialChar(symbol) : "") || "" };
|
|
13981
14066
|
};
|
|
13982
14067
|
const checkPoint = (price2) => {
|
|
13983
14068
|
return String(price2).indexOf(".") > 0;
|
|
13984
14069
|
};
|
|
13985
14070
|
const formatThousands = (num) => {
|
|
13986
|
-
if (Number(num)
|
|
14071
|
+
if (Number(num) === 0) {
|
|
13987
14072
|
num = 0;
|
|
13988
14073
|
}
|
|
13989
14074
|
if (checkPoint(num)) {
|
|
@@ -13998,7 +14083,7 @@ const Price = (props) => {
|
|
|
13998
14083
|
return num;
|
|
13999
14084
|
};
|
|
14000
14085
|
const formatDecimal = (decimalNum) => {
|
|
14001
|
-
if (Number(decimalNum)
|
|
14086
|
+
if (Number(decimalNum) === 0) {
|
|
14002
14087
|
decimalNum = 0;
|
|
14003
14088
|
}
|
|
14004
14089
|
if (checkPoint(decimalNum)) {
|
|
@@ -14162,7 +14247,7 @@ const Tag = (props) => {
|
|
|
14162
14247
|
className: "_icon",
|
|
14163
14248
|
name: "close",
|
|
14164
14249
|
size: "12",
|
|
14165
|
-
|
|
14250
|
+
onClick: (e2) => {
|
|
14166
14251
|
setIsTagShow(false);
|
|
14167
14252
|
if (props.onClose) {
|
|
14168
14253
|
props.onClose(e2);
|
|
@@ -14220,12 +14305,6 @@ class Trigger extends React__default.Component {
|
|
|
14220
14305
|
return trigger;
|
|
14221
14306
|
}
|
|
14222
14307
|
}
|
|
14223
|
-
function findDOMNode(node) {
|
|
14224
|
-
if (node instanceof HTMLElement) {
|
|
14225
|
-
return node;
|
|
14226
|
-
}
|
|
14227
|
-
return ReactDOM__default.findDOMNode(node);
|
|
14228
|
-
}
|
|
14229
14308
|
const getEleAttr = (ele) => {
|
|
14230
14309
|
if (ele && ele.getBoundingClientRect) {
|
|
14231
14310
|
return ele.getBoundingClientRect();
|
|
@@ -14237,8 +14316,11 @@ const defaultProps$k = {
|
|
|
14237
14316
|
theme: "light",
|
|
14238
14317
|
location: "bottom",
|
|
14239
14318
|
visible: false,
|
|
14319
|
+
offset: 20,
|
|
14240
14320
|
className: "",
|
|
14241
14321
|
onClick: (e2) => {
|
|
14322
|
+
},
|
|
14323
|
+
onChoose: (item, index2) => {
|
|
14242
14324
|
}
|
|
14243
14325
|
};
|
|
14244
14326
|
const Popover = (props) => {
|
|
@@ -14248,20 +14330,21 @@ const Popover = (props) => {
|
|
|
14248
14330
|
theme,
|
|
14249
14331
|
location,
|
|
14250
14332
|
visible,
|
|
14333
|
+
offset,
|
|
14251
14334
|
className,
|
|
14252
14335
|
style,
|
|
14253
14336
|
onClick,
|
|
14337
|
+
onChoose,
|
|
14254
14338
|
...reset
|
|
14255
14339
|
} = {
|
|
14256
14340
|
...defaultProps$k,
|
|
14257
14341
|
...props
|
|
14258
14342
|
};
|
|
14259
14343
|
const goodItem = useRef(null);
|
|
14260
|
-
const aa = goodItem.current && findDOMNode(goodItem.current);
|
|
14261
14344
|
setTimeout(() => {
|
|
14262
|
-
if (
|
|
14263
|
-
setElWidth(getEleAttr(
|
|
14264
|
-
setElHeight(getEleAttr(
|
|
14345
|
+
if (goodItem.current && getEleAttr(goodItem.current)) {
|
|
14346
|
+
setElWidth(getEleAttr(goodItem.current).width);
|
|
14347
|
+
setElHeight(getEleAttr(goodItem.current).height);
|
|
14265
14348
|
}
|
|
14266
14349
|
});
|
|
14267
14350
|
const [classes, setClasses] = useState("");
|
|
@@ -14275,68 +14358,46 @@ const Popover = (props) => {
|
|
|
14275
14358
|
setPopoverArrow(popoverArrowSelf());
|
|
14276
14359
|
}, [list, theme]);
|
|
14277
14360
|
const getStyle = () => {
|
|
14361
|
+
const offNumer = Number(offset) ? Number(offset) : 0;
|
|
14278
14362
|
const style2 = {};
|
|
14279
|
-
if (location
|
|
14280
|
-
style2.bottom = elHeight +
|
|
14281
|
-
|
|
14282
|
-
|
|
14283
|
-
|
|
14284
|
-
style2.right =
|
|
14285
|
-
} else if (location === "left") {
|
|
14286
|
-
style2.top = 0;
|
|
14287
|
-
style2.left = -elWidth - 20;
|
|
14288
|
-
} else {
|
|
14289
|
-
style2.top = elHeight + 20;
|
|
14290
|
-
style2.left = 0;
|
|
14291
|
-
}
|
|
14292
|
-
style2.top += "px";
|
|
14293
|
-
style2.left += "px";
|
|
14294
|
-
style2.bottom += "px";
|
|
14295
|
-
style2.right += "px";
|
|
14296
|
-
return style2;
|
|
14297
|
-
};
|
|
14298
|
-
const getArrowStyle = () => {
|
|
14299
|
-
const style2 = {};
|
|
14300
|
-
if (location === "top") {
|
|
14301
|
-
style2.bottom = -20;
|
|
14302
|
-
style2.left = elWidth / 2;
|
|
14303
|
-
} else if (location === "right") {
|
|
14304
|
-
style2.top = 20;
|
|
14305
|
-
style2.left = -20;
|
|
14306
|
-
} else if (location === "left") {
|
|
14307
|
-
style2.top = 20;
|
|
14308
|
-
style2.right = -20;
|
|
14363
|
+
if (location.includes("top")) {
|
|
14364
|
+
style2.bottom = `${elHeight + offNumer}px`;
|
|
14365
|
+
} else if (location.includes("right")) {
|
|
14366
|
+
style2.left = `${elWidth + offNumer}px`;
|
|
14367
|
+
} else if (location.includes("left")) {
|
|
14368
|
+
style2.right = `${elWidth + offNumer}px`;
|
|
14309
14369
|
} else {
|
|
14310
|
-
style2.
|
|
14311
|
-
style2.top = -20;
|
|
14370
|
+
style2.top = `${elHeight + offNumer}px`;
|
|
14312
14371
|
}
|
|
14313
|
-
style2.top += "px";
|
|
14314
|
-
style2.left += "px";
|
|
14315
|
-
style2.bottom += "px";
|
|
14316
|
-
style2.right += "px";
|
|
14317
14372
|
return style2;
|
|
14318
14373
|
};
|
|
14319
14374
|
const classesSelf = () => {
|
|
14320
14375
|
const prefixCls = "nut-popover";
|
|
14321
|
-
return `${prefixCls}
|
|
14322
|
-
${theme ? `${prefixCls}--${theme}` : ""}`;
|
|
14376
|
+
return `${prefixCls} ${theme ? `${prefixCls}--${theme}` : ""}`;
|
|
14323
14377
|
};
|
|
14324
14378
|
const popoverContentSelf = () => {
|
|
14325
|
-
const prefixCls = "
|
|
14326
|
-
return `${prefixCls}
|
|
14327
|
-
|
|
14379
|
+
const prefixCls = "popover-content";
|
|
14380
|
+
return `${prefixCls}-show ${prefixCls} ${location ? `${prefixCls}--${location}` : ""}`;
|
|
14381
|
+
};
|
|
14382
|
+
const filter = () => {
|
|
14383
|
+
const ms = ["top", "bottom", "left", "right"];
|
|
14384
|
+
return ms.filter((m2) => location.includes(m2))[0];
|
|
14328
14385
|
};
|
|
14329
14386
|
const popoverArrowSelf = () => {
|
|
14330
|
-
const prefixCls = "
|
|
14331
|
-
return `${prefixCls}
|
|
14332
|
-
${location ? `${prefixCls}--${location}` : ""}`;
|
|
14387
|
+
const prefixCls = "popover-arrow";
|
|
14388
|
+
return `${prefixCls} ${prefixCls}-${filter()} ${location ? `${prefixCls}--${location}` : ""}`;
|
|
14333
14389
|
};
|
|
14334
14390
|
const handleClick2 = (e2) => {
|
|
14335
14391
|
if (props.onClick) {
|
|
14336
14392
|
props.onClick(e2);
|
|
14337
14393
|
}
|
|
14338
14394
|
};
|
|
14339
|
-
|
|
14395
|
+
const handleChoose = (item, index2) => {
|
|
14396
|
+
if (!item.disabled) {
|
|
14397
|
+
onChoose(item, index2);
|
|
14398
|
+
}
|
|
14399
|
+
};
|
|
14400
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
14340
14401
|
className: `${classes} ${className}`,
|
|
14341
14402
|
style: { ...style },
|
|
14342
14403
|
...reset
|
|
@@ -14348,19 +14409,25 @@ const Popover = (props) => {
|
|
|
14348
14409
|
className: `${popoverContent}`,
|
|
14349
14410
|
style: getStyle()
|
|
14350
14411
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14351
|
-
className: `${popoverArrow}
|
|
14352
|
-
|
|
14353
|
-
}, " "), Array.isArray(children) ? children[1] : "", list.map((item) => {
|
|
14412
|
+
className: `${popoverArrow}`
|
|
14413
|
+
}), Array.isArray(children) ? children[1] : "", list.map((item, i) => {
|
|
14354
14414
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14355
14415
|
key: item.name,
|
|
14356
|
-
className: `
|
|
14416
|
+
className: `popover-menu-item ${item.disabled ? "disabled" : ""}`,
|
|
14417
|
+
onClick: () => {
|
|
14418
|
+
handleChoose(item, i);
|
|
14419
|
+
}
|
|
14357
14420
|
}, item.icon ? /* @__PURE__ */ React__default.createElement(Icon, {
|
|
14358
|
-
className: "item-img",
|
|
14421
|
+
className: "popover-menu-item-img",
|
|
14359
14422
|
name: item.icon
|
|
14360
14423
|
}) : "", /* @__PURE__ */ React__default.createElement("div", {
|
|
14361
|
-
className: "
|
|
14424
|
+
className: "popover-menu-item-name"
|
|
14362
14425
|
}, item.name));
|
|
14363
|
-
})) : null)))
|
|
14426
|
+
})) : null))), visible ? /* @__PURE__ */ React__default.createElement(Overlay, {
|
|
14427
|
+
visible,
|
|
14428
|
+
onClick: (e2) => handleClick2(e2),
|
|
14429
|
+
style: { background: "transparent" }
|
|
14430
|
+
}) : "");
|
|
14364
14431
|
};
|
|
14365
14432
|
Popover.defaultProps = defaultProps$k;
|
|
14366
14433
|
Popover.displayName = "NutPopover";
|