@nutui/nutui-react 1.2.3-beta.4 → 1.3.0-beta.5
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/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/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 +215 -152
- package/dist/nutui.react.umd.js +215 -152
- 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 -7
- 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/index.taro.d.ts +2 -0
- 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 +15 -4
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.
|
|
2
|
+
* @nutui/nutui-react v1.3.0-beta.5 Wed Aug 24 2022 15:56:45 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", {
|
|
@@ -6666,6 +6687,9 @@ const TextArea = (props) => {
|
|
|
6666
6687
|
disabled,
|
|
6667
6688
|
readOnly: readonly,
|
|
6668
6689
|
value: inputValue,
|
|
6690
|
+
onInput: (e2) => {
|
|
6691
|
+
textChange(e2);
|
|
6692
|
+
},
|
|
6669
6693
|
onChange: (e2) => {
|
|
6670
6694
|
textChange(e2);
|
|
6671
6695
|
},
|
|
@@ -6859,6 +6883,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6859
6883
|
item.status = "ready";
|
|
6860
6884
|
item.message = locale.uploader.readyUpload;
|
|
6861
6885
|
}
|
|
6886
|
+
return item;
|
|
6862
6887
|
});
|
|
6863
6888
|
return [...fileList2];
|
|
6864
6889
|
});
|
|
@@ -6871,6 +6896,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6871
6896
|
item.status = "uploading";
|
|
6872
6897
|
item.message = locale.uploader.uploading;
|
|
6873
6898
|
}
|
|
6899
|
+
return item;
|
|
6874
6900
|
});
|
|
6875
6901
|
return [...fileList2];
|
|
6876
6902
|
});
|
|
@@ -6884,6 +6910,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6884
6910
|
item.status = "success";
|
|
6885
6911
|
item.message = locale.uploader.success;
|
|
6886
6912
|
}
|
|
6913
|
+
return item;
|
|
6887
6914
|
});
|
|
6888
6915
|
return [...fileList2];
|
|
6889
6916
|
});
|
|
@@ -6899,6 +6926,7 @@ const InternalUploader = (props, ref) => {
|
|
|
6899
6926
|
item.status = "error";
|
|
6900
6927
|
item.message = locale.uploader.error;
|
|
6901
6928
|
}
|
|
6929
|
+
return item;
|
|
6902
6930
|
});
|
|
6903
6931
|
return [...fileList2];
|
|
6904
6932
|
});
|
|
@@ -7028,7 +7056,7 @@ const InternalUploader = (props, ref) => {
|
|
|
7028
7056
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
7029
7057
|
className: `nut-uploader__preview ${listType}`,
|
|
7030
7058
|
key: item.uid
|
|
7031
|
-
}, listType
|
|
7059
|
+
}, listType === "picture" && !children && /* @__PURE__ */ React__default.createElement("div", {
|
|
7032
7060
|
className: "nut-uploader__preview-img"
|
|
7033
7061
|
}, item.status === "ready" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
7034
7062
|
className: "nut-uploader__preview__progress"
|
|
@@ -7038,21 +7066,23 @@ const InternalUploader = (props, ref) => {
|
|
|
7038
7066
|
className: "nut-uploader__preview__progress"
|
|
7039
7067
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
7040
7068
|
color: "#fff",
|
|
7041
|
-
name: `${item.status
|
|
7069
|
+
name: `${item.status === "error" ? "failure" : "loading"}`
|
|
7042
7070
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
7043
7071
|
className: "nut-uploader__preview__progress__msg"
|
|
7044
7072
|
}, item.message)), isDeletable && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
7045
7073
|
color: "rgba(0,0,0,0.6)",
|
|
7046
7074
|
className: "close",
|
|
7047
7075
|
name: "failure",
|
|
7048
|
-
|
|
7076
|
+
onClick: () => onDelete(item, index2)
|
|
7049
7077
|
}), item.type.includes("image") ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.url && /* @__PURE__ */ React__default.createElement("img", {
|
|
7050
7078
|
className: "nut-uploader__preview-img__c",
|
|
7051
7079
|
src: item.url,
|
|
7080
|
+
alt: "",
|
|
7052
7081
|
onClick: () => handleItemClick(item)
|
|
7053
7082
|
})) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, defaultImg ? /* @__PURE__ */ React__default.createElement("img", {
|
|
7054
7083
|
className: "nut-uploader__preview-img__c",
|
|
7055
7084
|
src: defaultImg,
|
|
7085
|
+
alt: "",
|
|
7056
7086
|
onClick: () => handleItemClick(item)
|
|
7057
7087
|
}) : /* @__PURE__ */ React__default.createElement("div", {
|
|
7058
7088
|
className: "nut-uploader__preview-img__file"
|
|
@@ -7064,7 +7094,7 @@ const InternalUploader = (props, ref) => {
|
|
|
7064
7094
|
name: "link"
|
|
7065
7095
|
}), "\xA0", item.name))), /* @__PURE__ */ React__default.createElement("div", {
|
|
7066
7096
|
className: "tips"
|
|
7067
|
-
}, item.name)), listType
|
|
7097
|
+
}, item.name)), listType === "list" && /* @__PURE__ */ React__default.createElement("div", {
|
|
7068
7098
|
className: "nut-uploader__preview-list"
|
|
7069
7099
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
7070
7100
|
className: `nut-uploader__preview-img__file__name ${item.status}`,
|
|
@@ -7075,9 +7105,9 @@ const InternalUploader = (props, ref) => {
|
|
|
7075
7105
|
color: "#808080",
|
|
7076
7106
|
className: "nut-uploader__preview-img__file__del",
|
|
7077
7107
|
name: "del",
|
|
7078
|
-
|
|
7108
|
+
onClick: () => onDelete(item, index2)
|
|
7079
7109
|
})));
|
|
7080
|
-
}), maximum > fileList.length && listType
|
|
7110
|
+
}), maximum > fileList.length && listType === "picture" && !children && /* @__PURE__ */ React__default.createElement("div", {
|
|
7081
7111
|
className: `nut-uploader__upload ${listType}`
|
|
7082
7112
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
7083
7113
|
size: uploadIconSize,
|
|
@@ -12129,7 +12159,7 @@ const Drag = (props) => {
|
|
|
12129
12159
|
({ down, last, offset: [x2, y2] }) => {
|
|
12130
12160
|
api.start({ x: x2, y: y2, immediate: down });
|
|
12131
12161
|
if (last) {
|
|
12132
|
-
if (props.direction
|
|
12162
|
+
if (props.direction !== "y" && props.attract) {
|
|
12133
12163
|
if (x2 < middleLine.current) {
|
|
12134
12164
|
api.start({ x: boundaryState.left, y: y2, immediate: down });
|
|
12135
12165
|
} else {
|
|
@@ -12691,11 +12721,22 @@ class Notification extends React.PureComponent {
|
|
|
12691
12721
|
this.clearCloseTimer();
|
|
12692
12722
|
}
|
|
12693
12723
|
render() {
|
|
12694
|
-
const {
|
|
12724
|
+
const {
|
|
12725
|
+
children,
|
|
12726
|
+
style,
|
|
12727
|
+
msg,
|
|
12728
|
+
color,
|
|
12729
|
+
background,
|
|
12730
|
+
type,
|
|
12731
|
+
className,
|
|
12732
|
+
position,
|
|
12733
|
+
isWrapTeleport
|
|
12734
|
+
} = this.props;
|
|
12695
12735
|
this.state;
|
|
12696
12736
|
cn("notify");
|
|
12697
12737
|
const classes = classNames({
|
|
12698
|
-
"popup-top":
|
|
12738
|
+
"popup-top": position === "top",
|
|
12739
|
+
"popup-bottom": position === "bottom",
|
|
12699
12740
|
"nut-notify": true,
|
|
12700
12741
|
[`nut-notify--${type}`]: true
|
|
12701
12742
|
});
|
|
@@ -12704,7 +12745,9 @@ class Notification extends React.PureComponent {
|
|
|
12704
12745
|
timeout: 300,
|
|
12705
12746
|
classNames: "fade",
|
|
12706
12747
|
unmountOnExit: true,
|
|
12707
|
-
appear: true
|
|
12748
|
+
appear: true,
|
|
12749
|
+
position,
|
|
12750
|
+
isWrapTeleport
|
|
12708
12751
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
12709
12752
|
className: `${classes} ${className}`,
|
|
12710
12753
|
style: {
|
|
@@ -12747,8 +12790,11 @@ const options = {
|
|
|
12747
12790
|
msg: "",
|
|
12748
12791
|
id: "",
|
|
12749
12792
|
duration: 3e3,
|
|
12793
|
+
color: "",
|
|
12750
12794
|
type: "danger",
|
|
12751
12795
|
className: "",
|
|
12796
|
+
position: "top",
|
|
12797
|
+
isWrapTeleport: true,
|
|
12752
12798
|
onClosed: () => {
|
|
12753
12799
|
},
|
|
12754
12800
|
onClick: () => {
|
|
@@ -12992,7 +13038,7 @@ const defaultProps$u = {
|
|
|
12992
13038
|
color: "",
|
|
12993
13039
|
background: "",
|
|
12994
13040
|
delay: 1,
|
|
12995
|
-
scrollable:
|
|
13041
|
+
scrollable: null,
|
|
12996
13042
|
speed: 50
|
|
12997
13043
|
};
|
|
12998
13044
|
const NoticeBar = (props) => {
|
|
@@ -13030,6 +13076,7 @@ const NoticeBar = (props) => {
|
|
|
13030
13076
|
const [animate, SetAnimate] = useState(false);
|
|
13031
13077
|
const [distance, SetDistance] = useState(0);
|
|
13032
13078
|
const [timer, SetTimer] = useState(0);
|
|
13079
|
+
const [isCanScroll, SetIsCanScroll] = useState(null);
|
|
13033
13080
|
useState(0);
|
|
13034
13081
|
useEffect(() => {
|
|
13035
13082
|
if (direction === "vertical") {
|
|
@@ -13056,12 +13103,13 @@ const NoticeBar = (props) => {
|
|
|
13056
13103
|
}, []);
|
|
13057
13104
|
const cloneChild = (listItem, listIndex) => {
|
|
13058
13105
|
return React__default.Children.map(children, function(child, index2) {
|
|
13059
|
-
if (child && index2
|
|
13106
|
+
if (child && index2 === listIndex) {
|
|
13060
13107
|
return React__default.cloneElement(child, {
|
|
13061
13108
|
key: listIndex,
|
|
13062
13109
|
children: listItem
|
|
13063
13110
|
});
|
|
13064
13111
|
}
|
|
13112
|
+
return null;
|
|
13065
13113
|
});
|
|
13066
13114
|
};
|
|
13067
13115
|
useEffect(() => {
|
|
@@ -13082,7 +13130,9 @@ const NoticeBar = (props) => {
|
|
|
13082
13130
|
}
|
|
13083
13131
|
const wrapW = wrap.current.getBoundingClientRect().width;
|
|
13084
13132
|
const offsetW = content.current.getBoundingClientRect().width;
|
|
13085
|
-
|
|
13133
|
+
const canScroll = scrollable == null ? offsetW > wrapW : scrollable;
|
|
13134
|
+
SetIsCanScroll(canScroll);
|
|
13135
|
+
if (canScroll) {
|
|
13086
13136
|
SetWrapWidth(wrapW);
|
|
13087
13137
|
SetOffsetW(offsetW);
|
|
13088
13138
|
SetDuration(offsetW / speed);
|
|
@@ -13090,7 +13140,7 @@ const NoticeBar = (props) => {
|
|
|
13090
13140
|
} else {
|
|
13091
13141
|
SetAnimationClass("");
|
|
13092
13142
|
}
|
|
13093
|
-
});
|
|
13143
|
+
}, 0);
|
|
13094
13144
|
};
|
|
13095
13145
|
const handleClick2 = (event) => {
|
|
13096
13146
|
click && click(event);
|
|
@@ -13152,19 +13202,39 @@ const NoticeBar = (props) => {
|
|
|
13152
13202
|
const handleClickIcon = () => {
|
|
13153
13203
|
close && close(scrollList[0]);
|
|
13154
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
|
+
};
|
|
13155
13224
|
const contentStyle = {
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13225
|
+
animationDelay: `${firstRound ? delay : 0}s`,
|
|
13226
|
+
animationDuration: `${duration}s`,
|
|
13227
|
+
transform: `translateX(${firstRound ? 0 : `${wrapWidth}px`})`
|
|
13159
13228
|
};
|
|
13160
13229
|
const barStyle = {
|
|
13161
13230
|
color,
|
|
13162
13231
|
background,
|
|
13163
|
-
height: direction
|
|
13232
|
+
height: direction === "vertical" ? `${height}px` : ""
|
|
13164
13233
|
};
|
|
13234
|
+
const duringTime = ~~(height / speed / 4);
|
|
13165
13235
|
const horseLampStyle = {
|
|
13166
13236
|
transform: complexAm ? `translateY(${distance}px)` : "",
|
|
13167
|
-
transition: animate ? `all ${~~(height / speed
|
|
13237
|
+
transition: animate ? `all ${duringTime === 0 ? ~~(height / speed) : duringTime}s` : "",
|
|
13168
13238
|
marginTop: animate ? `-${height}px` : ""
|
|
13169
13239
|
};
|
|
13170
13240
|
const b2 = cn("noticebar");
|
|
@@ -13177,32 +13247,32 @@ const NoticeBar = (props) => {
|
|
|
13177
13247
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13178
13248
|
className: `${b2()} ${className || ""}`,
|
|
13179
13249
|
style
|
|
13180
|
-
}, showNoticeBar && direction
|
|
13250
|
+
}, showNoticeBar && direction === "across" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13181
13251
|
className: noticebarClass,
|
|
13182
13252
|
style: barStyle,
|
|
13183
13253
|
onClick: handleClick2
|
|
13184
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13254
|
+
}, iconShow() ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13185
13255
|
className: "left-icon",
|
|
13186
|
-
style: { backgroundImage: `url(${
|
|
13187
|
-
}, !
|
|
13256
|
+
style: { backgroundImage: `url(${iconBg() || ""})` }
|
|
13257
|
+
}, !iconBg() ? /* @__PURE__ */ React__default.createElement(Icon, {
|
|
13188
13258
|
name: "notice",
|
|
13189
13259
|
size: "16",
|
|
13190
13260
|
color
|
|
13191
|
-
}) : null), /* @__PURE__ */ React__default.createElement("div", {
|
|
13261
|
+
}) : null) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
13192
13262
|
ref: wrap,
|
|
13193
13263
|
className: "wrap"
|
|
13194
13264
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13195
13265
|
ref: content,
|
|
13196
|
-
className: `content ${animationClass} ${
|
|
13266
|
+
className: `content ${animationClass} ${isEllipsis() && "nut-ellipsis"}`,
|
|
13197
13267
|
style: contentStyle,
|
|
13198
13268
|
onAnimationEnd
|
|
13199
|
-
}, children, text)), closeMode ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13269
|
+
}, children, text)), closeMode || rightIcon ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13200
13270
|
className: "right-icon",
|
|
13201
13271
|
onClick: onClickIcon
|
|
13202
13272
|
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
13203
|
-
name: "close",
|
|
13273
|
+
name: rightIcon || "close",
|
|
13204
13274
|
color
|
|
13205
|
-
})) : null) : scrollList.current.length > 0 && direction
|
|
13275
|
+
})) : null) : null, scrollList.current.length > 0 && direction === "vertical" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13206
13276
|
className: "nut-noticebar-vertical",
|
|
13207
13277
|
style: barStyle
|
|
13208
13278
|
}, children ? /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -13865,8 +13935,8 @@ const Avatar = (props) => {
|
|
|
13865
13935
|
height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
13866
13936
|
backgroundColor: `${bgColor}`,
|
|
13867
13937
|
color: `${color}`,
|
|
13868
|
-
marginLeft: avatarIndex
|
|
13869
|
-
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)}` : "",
|
|
13870
13940
|
...style
|
|
13871
13941
|
};
|
|
13872
13942
|
const maxStyles = {
|
|
@@ -13884,15 +13954,16 @@ const Avatar = (props) => {
|
|
|
13884
13954
|
const avatarLength = (children2) => {
|
|
13885
13955
|
var _a2, _b2, _c2;
|
|
13886
13956
|
for (let i = 0; i < children2.length; i++) {
|
|
13887
|
-
|
|
13957
|
+
console.log("child", children2[i], children2[i].classList);
|
|
13958
|
+
if (children2[i] && children2[i].classList && children2[i].classList[0] === "nut-avatar") {
|
|
13888
13959
|
children2[i].setAttribute("data-index", i + 1);
|
|
13889
13960
|
}
|
|
13890
13961
|
}
|
|
13891
|
-
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);
|
|
13892
13963
|
const maxCount = (_c2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c2.maxCount;
|
|
13893
13964
|
setMaxSum(children2.length);
|
|
13894
13965
|
setAvatarIndex(index2);
|
|
13895
|
-
if (index2
|
|
13966
|
+
if (index2 === children2.length && index2 !== maxCount && children2.length > maxCount) {
|
|
13896
13967
|
setShowMax(true);
|
|
13897
13968
|
}
|
|
13898
13969
|
};
|
|
@@ -13980,14 +14051,24 @@ const Price = (props) => {
|
|
|
13980
14051
|
...props
|
|
13981
14052
|
};
|
|
13982
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
|
+
};
|
|
13983
14064
|
const showSymbol = () => {
|
|
13984
|
-
return { __html: (needSymbol ? symbol : "") || "" };
|
|
14065
|
+
return { __html: (needSymbol ? replaceSpecialChar(symbol) : "") || "" };
|
|
13985
14066
|
};
|
|
13986
14067
|
const checkPoint = (price2) => {
|
|
13987
14068
|
return String(price2).indexOf(".") > 0;
|
|
13988
14069
|
};
|
|
13989
14070
|
const formatThousands = (num) => {
|
|
13990
|
-
if (Number(num)
|
|
14071
|
+
if (Number(num) === 0) {
|
|
13991
14072
|
num = 0;
|
|
13992
14073
|
}
|
|
13993
14074
|
if (checkPoint(num)) {
|
|
@@ -14002,7 +14083,7 @@ const Price = (props) => {
|
|
|
14002
14083
|
return num;
|
|
14003
14084
|
};
|
|
14004
14085
|
const formatDecimal = (decimalNum) => {
|
|
14005
|
-
if (Number(decimalNum)
|
|
14086
|
+
if (Number(decimalNum) === 0) {
|
|
14006
14087
|
decimalNum = 0;
|
|
14007
14088
|
}
|
|
14008
14089
|
if (checkPoint(decimalNum)) {
|
|
@@ -14166,7 +14247,7 @@ const Tag = (props) => {
|
|
|
14166
14247
|
className: "_icon",
|
|
14167
14248
|
name: "close",
|
|
14168
14249
|
size: "12",
|
|
14169
|
-
|
|
14250
|
+
onClick: (e2) => {
|
|
14170
14251
|
setIsTagShow(false);
|
|
14171
14252
|
if (props.onClose) {
|
|
14172
14253
|
props.onClose(e2);
|
|
@@ -14224,12 +14305,6 @@ class Trigger extends React__default.Component {
|
|
|
14224
14305
|
return trigger;
|
|
14225
14306
|
}
|
|
14226
14307
|
}
|
|
14227
|
-
function findDOMNode(node) {
|
|
14228
|
-
if (node instanceof HTMLElement) {
|
|
14229
|
-
return node;
|
|
14230
|
-
}
|
|
14231
|
-
return ReactDOM__default.findDOMNode(node);
|
|
14232
|
-
}
|
|
14233
14308
|
const getEleAttr = (ele) => {
|
|
14234
14309
|
if (ele && ele.getBoundingClientRect) {
|
|
14235
14310
|
return ele.getBoundingClientRect();
|
|
@@ -14241,8 +14316,11 @@ const defaultProps$k = {
|
|
|
14241
14316
|
theme: "light",
|
|
14242
14317
|
location: "bottom",
|
|
14243
14318
|
visible: false,
|
|
14319
|
+
offset: 20,
|
|
14244
14320
|
className: "",
|
|
14245
14321
|
onClick: (e2) => {
|
|
14322
|
+
},
|
|
14323
|
+
onChoose: (item, index2) => {
|
|
14246
14324
|
}
|
|
14247
14325
|
};
|
|
14248
14326
|
const Popover = (props) => {
|
|
@@ -14252,20 +14330,21 @@ const Popover = (props) => {
|
|
|
14252
14330
|
theme,
|
|
14253
14331
|
location,
|
|
14254
14332
|
visible,
|
|
14333
|
+
offset,
|
|
14255
14334
|
className,
|
|
14256
14335
|
style,
|
|
14257
14336
|
onClick,
|
|
14337
|
+
onChoose,
|
|
14258
14338
|
...reset
|
|
14259
14339
|
} = {
|
|
14260
14340
|
...defaultProps$k,
|
|
14261
14341
|
...props
|
|
14262
14342
|
};
|
|
14263
14343
|
const goodItem = useRef(null);
|
|
14264
|
-
const aa = goodItem.current && findDOMNode(goodItem.current);
|
|
14265
14344
|
setTimeout(() => {
|
|
14266
|
-
if (
|
|
14267
|
-
setElWidth(getEleAttr(
|
|
14268
|
-
setElHeight(getEleAttr(
|
|
14345
|
+
if (goodItem.current && getEleAttr(goodItem.current)) {
|
|
14346
|
+
setElWidth(getEleAttr(goodItem.current).width);
|
|
14347
|
+
setElHeight(getEleAttr(goodItem.current).height);
|
|
14269
14348
|
}
|
|
14270
14349
|
});
|
|
14271
14350
|
const [classes, setClasses] = useState("");
|
|
@@ -14279,68 +14358,46 @@ const Popover = (props) => {
|
|
|
14279
14358
|
setPopoverArrow(popoverArrowSelf());
|
|
14280
14359
|
}, [list, theme]);
|
|
14281
14360
|
const getStyle = () => {
|
|
14361
|
+
const offNumer = Number(offset) ? Number(offset) : 0;
|
|
14282
14362
|
const style2 = {};
|
|
14283
|
-
if (location
|
|
14284
|
-
style2.bottom = elHeight +
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
style2.right =
|
|
14289
|
-
} else if (location === "left") {
|
|
14290
|
-
style2.top = 0;
|
|
14291
|
-
style2.left = -elWidth - 20;
|
|
14292
|
-
} else {
|
|
14293
|
-
style2.top = elHeight + 20;
|
|
14294
|
-
style2.left = 0;
|
|
14295
|
-
}
|
|
14296
|
-
style2.top += "px";
|
|
14297
|
-
style2.left += "px";
|
|
14298
|
-
style2.bottom += "px";
|
|
14299
|
-
style2.right += "px";
|
|
14300
|
-
return style2;
|
|
14301
|
-
};
|
|
14302
|
-
const getArrowStyle = () => {
|
|
14303
|
-
const style2 = {};
|
|
14304
|
-
if (location === "top") {
|
|
14305
|
-
style2.bottom = -20;
|
|
14306
|
-
style2.left = elWidth / 2;
|
|
14307
|
-
} else if (location === "right") {
|
|
14308
|
-
style2.top = 20;
|
|
14309
|
-
style2.left = -20;
|
|
14310
|
-
} else if (location === "left") {
|
|
14311
|
-
style2.top = 20;
|
|
14312
|
-
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`;
|
|
14313
14369
|
} else {
|
|
14314
|
-
style2.
|
|
14315
|
-
style2.top = -20;
|
|
14370
|
+
style2.top = `${elHeight + offNumer}px`;
|
|
14316
14371
|
}
|
|
14317
|
-
style2.top += "px";
|
|
14318
|
-
style2.left += "px";
|
|
14319
|
-
style2.bottom += "px";
|
|
14320
|
-
style2.right += "px";
|
|
14321
14372
|
return style2;
|
|
14322
14373
|
};
|
|
14323
14374
|
const classesSelf = () => {
|
|
14324
14375
|
const prefixCls = "nut-popover";
|
|
14325
|
-
return `${prefixCls}
|
|
14326
|
-
${theme ? `${prefixCls}--${theme}` : ""}`;
|
|
14376
|
+
return `${prefixCls} ${theme ? `${prefixCls}--${theme}` : ""}`;
|
|
14327
14377
|
};
|
|
14328
14378
|
const popoverContentSelf = () => {
|
|
14329
|
-
const prefixCls = "
|
|
14330
|
-
return `${prefixCls}
|
|
14331
|
-
|
|
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];
|
|
14332
14385
|
};
|
|
14333
14386
|
const popoverArrowSelf = () => {
|
|
14334
|
-
const prefixCls = "
|
|
14335
|
-
return `${prefixCls}
|
|
14336
|
-
${location ? `${prefixCls}--${location}` : ""}`;
|
|
14387
|
+
const prefixCls = "popover-arrow";
|
|
14388
|
+
return `${prefixCls} ${prefixCls}-${filter()} ${location ? `${prefixCls}--${location}` : ""}`;
|
|
14337
14389
|
};
|
|
14338
14390
|
const handleClick2 = (e2) => {
|
|
14339
14391
|
if (props.onClick) {
|
|
14340
14392
|
props.onClick(e2);
|
|
14341
14393
|
}
|
|
14342
14394
|
};
|
|
14343
|
-
|
|
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", {
|
|
14344
14401
|
className: `${classes} ${className}`,
|
|
14345
14402
|
style: { ...style },
|
|
14346
14403
|
...reset
|
|
@@ -14352,19 +14409,25 @@ const Popover = (props) => {
|
|
|
14352
14409
|
className: `${popoverContent}`,
|
|
14353
14410
|
style: getStyle()
|
|
14354
14411
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14355
|
-
className: `${popoverArrow}
|
|
14356
|
-
|
|
14357
|
-
}, " "), Array.isArray(children) ? children[1] : "", list.map((item) => {
|
|
14412
|
+
className: `${popoverArrow}`
|
|
14413
|
+
}), Array.isArray(children) ? children[1] : "", list.map((item, i) => {
|
|
14358
14414
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14359
14415
|
key: item.name,
|
|
14360
|
-
className: `
|
|
14416
|
+
className: `popover-menu-item ${item.disabled ? "disabled" : ""}`,
|
|
14417
|
+
onClick: () => {
|
|
14418
|
+
handleChoose(item, i);
|
|
14419
|
+
}
|
|
14361
14420
|
}, item.icon ? /* @__PURE__ */ React__default.createElement(Icon, {
|
|
14362
|
-
className: "item-img",
|
|
14421
|
+
className: "popover-menu-item-img",
|
|
14363
14422
|
name: item.icon
|
|
14364
14423
|
}) : "", /* @__PURE__ */ React__default.createElement("div", {
|
|
14365
|
-
className: "
|
|
14424
|
+
className: "popover-menu-item-name"
|
|
14366
14425
|
}, item.name));
|
|
14367
|
-
})) : null)))
|
|
14426
|
+
})) : null))), visible ? /* @__PURE__ */ React__default.createElement(Overlay, {
|
|
14427
|
+
visible,
|
|
14428
|
+
onClick: (e2) => handleClick2(e2),
|
|
14429
|
+
style: { background: "transparent" }
|
|
14430
|
+
}) : "");
|
|
14368
14431
|
};
|
|
14369
14432
|
Popover.defaultProps = defaultProps$k;
|
|
14370
14433
|
Popover.displayName = "NutPopover";
|