@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.umd.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
|
*/
|
|
@@ -75,18 +75,18 @@
|
|
|
75
75
|
const defaultProps$1a = {
|
|
76
76
|
name: "",
|
|
77
77
|
size: "",
|
|
78
|
-
classPrefix: "
|
|
78
|
+
classPrefix: "nut-icon",
|
|
79
79
|
fontClassName: "nutui-iconfont",
|
|
80
80
|
color: "",
|
|
81
81
|
tag: "i",
|
|
82
|
-
|
|
82
|
+
onClick: (e2) => {
|
|
83
83
|
},
|
|
84
84
|
className: ""
|
|
85
85
|
};
|
|
86
86
|
function pxCheck$2(value) {
|
|
87
87
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
function Icon(props) {
|
|
90
90
|
const {
|
|
91
91
|
name,
|
|
92
92
|
size,
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
className,
|
|
98
98
|
fontClassName,
|
|
99
99
|
style,
|
|
100
|
-
|
|
100
|
+
onClick,
|
|
101
101
|
...rest
|
|
102
102
|
} = {
|
|
103
103
|
...defaultProps$1a,
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
const type = isImage ? "img" : tag;
|
|
108
108
|
const b2 = cn("icon");
|
|
109
109
|
const handleClick2 = (e2) => {
|
|
110
|
-
if (
|
|
111
|
-
|
|
110
|
+
if (onClick) {
|
|
111
|
+
onClick(e2);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
const hasSrc = () => {
|
|
@@ -119,9 +119,7 @@
|
|
|
119
119
|
return React__default["default"].createElement(
|
|
120
120
|
type,
|
|
121
121
|
{
|
|
122
|
-
className: isImage ? `${
|
|
123
|
-
classPrefix
|
|
124
|
-
])} nut-icon-${name} `,
|
|
122
|
+
className: isImage ? `${b2("img")} ${className || ""} ` : `${fontClassName} ${b2(null)} ${classPrefix}-${name} ${className || ""}`,
|
|
125
123
|
style: {
|
|
126
124
|
color,
|
|
127
125
|
fontSize: pxCheck$2(size),
|
|
@@ -135,7 +133,7 @@
|
|
|
135
133
|
},
|
|
136
134
|
children
|
|
137
135
|
);
|
|
138
|
-
}
|
|
136
|
+
}
|
|
139
137
|
Icon.defaultProps = defaultProps$1a;
|
|
140
138
|
Icon.displayName = "NutIcon";
|
|
141
139
|
const defaultProps$19 = {
|
|
@@ -2816,7 +2814,7 @@
|
|
|
2816
2814
|
const defaultProps$Z = {
|
|
2817
2815
|
dot: false,
|
|
2818
2816
|
size: "",
|
|
2819
|
-
classPrefix: "
|
|
2817
|
+
classPrefix: "nut-icon",
|
|
2820
2818
|
tabTitle: "",
|
|
2821
2819
|
icon: "",
|
|
2822
2820
|
href: "",
|
|
@@ -3749,8 +3747,11 @@
|
|
|
3749
3747
|
}
|
|
3750
3748
|
render() {
|
|
3751
3749
|
const {
|
|
3750
|
+
id,
|
|
3752
3751
|
style,
|
|
3753
3752
|
icon,
|
|
3753
|
+
iconSize,
|
|
3754
|
+
title,
|
|
3754
3755
|
msg,
|
|
3755
3756
|
bottom,
|
|
3756
3757
|
center,
|
|
@@ -3768,14 +3769,16 @@
|
|
|
3768
3769
|
"nut-toast-has-icon": icon,
|
|
3769
3770
|
"nut-toast-cover": cover,
|
|
3770
3771
|
"nut-toast-loading": type === "loading",
|
|
3771
|
-
customClass,
|
|
3772
|
+
[`${customClass}`]: true,
|
|
3772
3773
|
[`nut-toast-${size}`]: true
|
|
3773
3774
|
});
|
|
3774
3775
|
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("div", {
|
|
3775
3776
|
className: `${toastBem()} ${classes}`,
|
|
3777
|
+
id: `toast-${id}`,
|
|
3776
3778
|
style: {
|
|
3777
|
-
bottom: center ? "auto" : `${bottom}
|
|
3778
|
-
backgroundColor: cover ? coverColor : ""
|
|
3779
|
+
bottom: center ? "auto" : `${bottom}`,
|
|
3780
|
+
backgroundColor: cover ? coverColor : "",
|
|
3781
|
+
...style
|
|
3779
3782
|
},
|
|
3780
3783
|
onClick: () => {
|
|
3781
3784
|
this.clickCover();
|
|
@@ -3790,8 +3793,11 @@
|
|
|
3790
3793
|
className: toastBem("icon-wrapper")
|
|
3791
3794
|
}, /* @__PURE__ */ React__namespace.createElement(Icon, {
|
|
3792
3795
|
name: icon || "",
|
|
3793
|
-
|
|
3794
|
-
|
|
3796
|
+
color: "#ffffff",
|
|
3797
|
+
size: iconSize
|
|
3798
|
+
})) : null, title ? /* @__PURE__ */ React__namespace.createElement("div", {
|
|
3799
|
+
className: "nut-toast-title"
|
|
3800
|
+
}, title) : null, /* @__PURE__ */ React__namespace.createElement("span", {
|
|
3795
3801
|
className: toastBem("text")
|
|
3796
3802
|
}, msg))));
|
|
3797
3803
|
}
|
|
@@ -3825,13 +3831,16 @@
|
|
|
3825
3831
|
const options$1 = {
|
|
3826
3832
|
msg: "",
|
|
3827
3833
|
id: "",
|
|
3834
|
+
style: {},
|
|
3828
3835
|
duration: 1.5,
|
|
3829
3836
|
center: true,
|
|
3830
3837
|
type: "text",
|
|
3838
|
+
title: "",
|
|
3831
3839
|
customClass: "",
|
|
3832
|
-
bottom:
|
|
3840
|
+
bottom: "30px",
|
|
3833
3841
|
size: "base",
|
|
3834
|
-
icon:
|
|
3842
|
+
icon: null,
|
|
3843
|
+
iconSize: "20",
|
|
3835
3844
|
textAlignCenter: true,
|
|
3836
3845
|
loadingRotate: true,
|
|
3837
3846
|
bgColor: "rgba(0, 0, 0, .8)",
|
|
@@ -3923,9 +3932,6 @@
|
|
|
3923
3932
|
buttonColor,
|
|
3924
3933
|
hiddenRange,
|
|
3925
3934
|
hiddenTag,
|
|
3926
|
-
min,
|
|
3927
|
-
max,
|
|
3928
|
-
step,
|
|
3929
3935
|
modelValue,
|
|
3930
3936
|
button,
|
|
3931
3937
|
vertical,
|
|
@@ -3934,6 +3940,10 @@
|
|
|
3934
3940
|
dragStart,
|
|
3935
3941
|
dragEnd
|
|
3936
3942
|
} = { ...defaultProps$R, ...props };
|
|
3943
|
+
let { min, max, step } = { ...defaultProps$R, ...props };
|
|
3944
|
+
min = Number(min);
|
|
3945
|
+
max = Number(max);
|
|
3946
|
+
step = Number(step);
|
|
3937
3947
|
const [buttonIndex, SetButtonIndex] = React.useState(0);
|
|
3938
3948
|
const [initValue, SetInitValue] = React.useState();
|
|
3939
3949
|
const [dragStatus, SetDragStatus] = React.useState("start");
|
|
@@ -4459,7 +4469,7 @@
|
|
|
4459
4469
|
if (startDate && Utils.compareDate(currDate, startDate) || endDate && Utils.compareDate(endDate, currDate)) {
|
|
4460
4470
|
return `${state.dayPrefix}-disabled`;
|
|
4461
4471
|
}
|
|
4462
|
-
if (state.isRange && Array.isArray(state.currDate) && Object.values(state.currDate).length
|
|
4472
|
+
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])) {
|
|
4463
4473
|
return `${state.dayPrefix}-choose`;
|
|
4464
4474
|
}
|
|
4465
4475
|
return null;
|
|
@@ -4467,14 +4477,14 @@
|
|
|
4467
4477
|
return `${state.dayPrefix}-disabled`;
|
|
4468
4478
|
};
|
|
4469
4479
|
const isActive = (day, month) => {
|
|
4470
|
-
return state.isRange && day.type
|
|
4480
|
+
return state.isRange && day.type === "curr" && getClass(day, month) === "calendar-month-day-active";
|
|
4471
4481
|
};
|
|
4472
4482
|
const isCurrDay = (month, day) => {
|
|
4473
4483
|
const date = `${month.curData[0]}-${month.curData[1]}-${day}`;
|
|
4474
4484
|
return Utils.isEqual(date, Utils.date2Str(new Date()));
|
|
4475
4485
|
};
|
|
4476
4486
|
const confirm2 = () => {
|
|
4477
|
-
if (state.isRange && state.chooseData.length
|
|
4487
|
+
if (state.isRange && state.chooseData.length === 2 || !state.isRange) {
|
|
4478
4488
|
onChoose && onChoose(state.chooseData);
|
|
4479
4489
|
if (poppable) {
|
|
4480
4490
|
onUpdate && onUpdate();
|
|
@@ -4482,7 +4492,7 @@
|
|
|
4482
4492
|
}
|
|
4483
4493
|
};
|
|
4484
4494
|
const chooseDay = (day, month, isFirst, isRange) => {
|
|
4485
|
-
if (getClass(day, month, isRange)
|
|
4495
|
+
if (getClass(day, month, isRange) !== `${state.dayPrefix}-disabled`) {
|
|
4486
4496
|
let days = [...month.curData];
|
|
4487
4497
|
days = isRange ? days.splice(3) : days.splice(0, 3);
|
|
4488
4498
|
days[2] = typeof day.day === "number" ? Utils.getNumTwoBit(day.day) : day.day;
|
|
@@ -4499,7 +4509,7 @@
|
|
|
4499
4509
|
} else {
|
|
4500
4510
|
Array.isArray(state.currDate) && state.currDate.unshift(days[3]);
|
|
4501
4511
|
}
|
|
4502
|
-
if (state.chooseData.length
|
|
4512
|
+
if (state.chooseData.length === 2 || !state.chooseData.length) {
|
|
4503
4513
|
state.chooseData = [...days];
|
|
4504
4514
|
} else if (Utils.compareDate(state.chooseData[3], days[3])) {
|
|
4505
4515
|
state.chooseData = [[...state.chooseData], [...days]];
|
|
@@ -4520,20 +4530,23 @@
|
|
|
4520
4530
|
return false;
|
|
4521
4531
|
};
|
|
4522
4532
|
const isEndTip = (day, month) => {
|
|
4533
|
+
if (isStartTip(day, month)) {
|
|
4534
|
+
return false;
|
|
4535
|
+
}
|
|
4523
4536
|
return isActive(day, month);
|
|
4524
4537
|
};
|
|
4525
4538
|
const getCurrData = (type2) => {
|
|
4526
|
-
const monthData = type2
|
|
4539
|
+
const monthData = type2 === "prev" ? state.monthsData[0] : state.monthsData[state.monthsData.length - 1];
|
|
4527
4540
|
let year = parseInt(monthData.curData[0]);
|
|
4528
4541
|
let month = parseInt(monthData.curData[1].toString().replace(/^0/, ""));
|
|
4529
4542
|
switch (type2) {
|
|
4530
4543
|
case "prev":
|
|
4531
|
-
month
|
|
4532
|
-
month = month
|
|
4544
|
+
month === 1 && (year -= 1);
|
|
4545
|
+
month = month === 1 ? 12 : --month;
|
|
4533
4546
|
break;
|
|
4534
4547
|
case "next":
|
|
4535
|
-
month
|
|
4536
|
-
month = month
|
|
4548
|
+
month === 12 && (year += 1);
|
|
4549
|
+
month = month === 12 ? 1 : ++month;
|
|
4537
4550
|
break;
|
|
4538
4551
|
}
|
|
4539
4552
|
return [
|
|
@@ -4543,7 +4556,7 @@
|
|
|
4543
4556
|
];
|
|
4544
4557
|
};
|
|
4545
4558
|
const getDaysStatus = (days, type2) => {
|
|
4546
|
-
if (type2
|
|
4559
|
+
if (type2 === "prev" && days >= 7) {
|
|
4547
4560
|
days -= 7;
|
|
4548
4561
|
}
|
|
4549
4562
|
return Array.from(Array(days), (v2, k2) => {
|
|
@@ -4568,7 +4581,7 @@
|
|
|
4568
4581
|
...getDaysStatus(currMonthDays, "curr")
|
|
4569
4582
|
]
|
|
4570
4583
|
};
|
|
4571
|
-
if (type2
|
|
4584
|
+
if (type2 === "next") {
|
|
4572
4585
|
if (!state.endData || !Utils.compareDate(
|
|
4573
4586
|
`${state.endData[0]}-${state.endData[1]}-${Utils.getMonthDays(
|
|
4574
4587
|
state.endData[0],
|
|
@@ -4634,7 +4647,7 @@
|
|
|
4634
4647
|
if (updateMove < 0 && updateMove < -offsetHeight + h2) {
|
|
4635
4648
|
updateMove = -offsetHeight + h2;
|
|
4636
4649
|
}
|
|
4637
|
-
if (offsetHeight <= h2 && state.monthsData.length
|
|
4650
|
+
if (offsetHeight <= h2 && state.monthsData.length === 1) {
|
|
4638
4651
|
updateMove = 0;
|
|
4639
4652
|
}
|
|
4640
4653
|
setTransform(updateMove, type2, time);
|
|
@@ -4645,7 +4658,7 @@
|
|
|
4645
4658
|
if (updateMove < -offsetHeight + h2 - 100 && state.monthsData.length > 1) {
|
|
4646
4659
|
updateMove = -offsetHeight + h2 - 100;
|
|
4647
4660
|
}
|
|
4648
|
-
if (updateMove < 0 && updateMove < -100 && state.monthsData.length
|
|
4661
|
+
if (updateMove < 0 && updateMove < -100 && state.monthsData.length === 1) {
|
|
4649
4662
|
updateMove = -100;
|
|
4650
4663
|
}
|
|
4651
4664
|
setTransform(updateMove);
|
|
@@ -4804,7 +4817,7 @@
|
|
|
4804
4817
|
className: "calendar-curr-tips"
|
|
4805
4818
|
}, locale.calendaritem.today) : "", isStartTip(day, month) ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4806
4819
|
className: "calendar-day-tip"
|
|
4807
|
-
}, locale.calendaritem.start) : isEndTip(day, month) ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4820
|
+
}, locale.calendaritem.start) : "", isEndTip(day, month) ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4808
4821
|
className: "calendar-day-tip"
|
|
4809
4822
|
}, locale.calendaritem.end) : "")))))))), poppable && !isAutoBackFill ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4810
4823
|
className: "nut-calendar-footer"
|
|
@@ -4910,7 +4923,6 @@
|
|
|
4910
4923
|
const childrenLabel = [];
|
|
4911
4924
|
React__default["default"].Children.map(children, (child) => {
|
|
4912
4925
|
const childProps = child.props;
|
|
4913
|
-
console.log(child);
|
|
4914
4926
|
childrenLabel.push(childProps.label || child.children);
|
|
4915
4927
|
});
|
|
4916
4928
|
setInnerValue(childrenLabel);
|
|
@@ -5081,9 +5093,11 @@
|
|
|
5081
5093
|
defaultValue,
|
|
5082
5094
|
listData = [],
|
|
5083
5095
|
threeDimensional = true,
|
|
5096
|
+
swipeDuration = 1e3,
|
|
5084
5097
|
chooseItem
|
|
5085
5098
|
} = props;
|
|
5086
5099
|
const touch = useTouch();
|
|
5100
|
+
const DEFAULT_DURATION = 200;
|
|
5087
5101
|
const INERTIA_TIME = 300;
|
|
5088
5102
|
const INERTIA_DISTANCE = 15;
|
|
5089
5103
|
const [currIndex, setCurrIndex] = React.useState(1);
|
|
@@ -5103,7 +5117,7 @@
|
|
|
5103
5117
|
}
|
|
5104
5118
|
return false;
|
|
5105
5119
|
};
|
|
5106
|
-
const setTransform = (translateY = 0, type, time =
|
|
5120
|
+
const setTransform = (translateY = 0, type, time = DEFAULT_DURATION, deg) => {
|
|
5107
5121
|
let nTime = time;
|
|
5108
5122
|
if (type !== "end") {
|
|
5109
5123
|
nTime = 0;
|
|
@@ -5163,7 +5177,7 @@
|
|
|
5163
5177
|
const moveTime = Date.now() - startTime;
|
|
5164
5178
|
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
5165
5179
|
const distance = momentum(move, moveTime);
|
|
5166
|
-
setMove(distance, "end",
|
|
5180
|
+
setMove(distance, "end", +swipeDuration);
|
|
5167
5181
|
} else {
|
|
5168
5182
|
setMove(move, "end");
|
|
5169
5183
|
}
|
|
@@ -5263,6 +5277,7 @@
|
|
|
5263
5277
|
className,
|
|
5264
5278
|
style,
|
|
5265
5279
|
threeDimensional,
|
|
5280
|
+
swipeDuration,
|
|
5266
5281
|
...rest
|
|
5267
5282
|
} = props;
|
|
5268
5283
|
const [chooseValueData, setchooseValueData] = React.useState([]);
|
|
@@ -5427,6 +5442,7 @@
|
|
|
5427
5442
|
listData: item,
|
|
5428
5443
|
threeDimensional,
|
|
5429
5444
|
chooseItem: (value, index22) => chooseItem(value, index22),
|
|
5445
|
+
swipeDuration,
|
|
5430
5446
|
key: index2,
|
|
5431
5447
|
keyIndex: index2
|
|
5432
5448
|
});
|
|
@@ -5804,23 +5820,23 @@
|
|
|
5804
5820
|
return Number(v2).toFixed(Number(decimalPlaces));
|
|
5805
5821
|
};
|
|
5806
5822
|
const emitChange = (value, e2) => {
|
|
5807
|
-
const
|
|
5808
|
-
change && change(
|
|
5823
|
+
const outputValue = fixedDecimalPlaces(value);
|
|
5824
|
+
change && change(outputValue, e2);
|
|
5809
5825
|
if (!isAsync) {
|
|
5810
|
-
if (Number(
|
|
5826
|
+
if (Number(outputValue) < Number(min)) {
|
|
5811
5827
|
setInputValue(Number(min));
|
|
5812
|
-
} else if (Number(
|
|
5828
|
+
} else if (Number(outputValue) > Number(max)) {
|
|
5813
5829
|
setInputValue(Number(max));
|
|
5814
5830
|
} else {
|
|
5815
|
-
setInputValue(
|
|
5831
|
+
setInputValue(outputValue);
|
|
5816
5832
|
}
|
|
5817
5833
|
}
|
|
5818
5834
|
};
|
|
5819
5835
|
const reduceNumber = (e2) => {
|
|
5820
5836
|
reduce && reduce(e2);
|
|
5821
5837
|
if (reduceAllow()) {
|
|
5822
|
-
const
|
|
5823
|
-
emitChange(
|
|
5838
|
+
const outputValue = Number(inputValue) - Number(step);
|
|
5839
|
+
emitChange(outputValue, e2);
|
|
5824
5840
|
} else {
|
|
5825
5841
|
overlimit && overlimit(e2);
|
|
5826
5842
|
}
|
|
@@ -5828,8 +5844,8 @@
|
|
|
5828
5844
|
const addNumber = (e2) => {
|
|
5829
5845
|
add && add(e2);
|
|
5830
5846
|
if (addAllow()) {
|
|
5831
|
-
const
|
|
5832
|
-
emitChange(
|
|
5847
|
+
const outputValue = Number(inputValue) + Number(step);
|
|
5848
|
+
emitChange(outputValue, e2);
|
|
5833
5849
|
} else {
|
|
5834
5850
|
overlimit && overlimit(e2);
|
|
5835
5851
|
}
|
|
@@ -5875,7 +5891,7 @@
|
|
|
5875
5891
|
className: iconMinusClasses,
|
|
5876
5892
|
size: buttonSize,
|
|
5877
5893
|
name: "minus",
|
|
5878
|
-
|
|
5894
|
+
onClick: reduceNumber
|
|
5879
5895
|
}), /* @__PURE__ */ React__default["default"].createElement("input", {
|
|
5880
5896
|
type: "number",
|
|
5881
5897
|
min,
|
|
@@ -5891,7 +5907,7 @@
|
|
|
5891
5907
|
className: iconAddClasses,
|
|
5892
5908
|
size: buttonSize,
|
|
5893
5909
|
name: "plus",
|
|
5894
|
-
|
|
5910
|
+
onClick: addNumber
|
|
5895
5911
|
}));
|
|
5896
5912
|
};
|
|
5897
5913
|
InputNumber.defaultProps = defaultProps$L;
|
|
@@ -6039,12 +6055,17 @@
|
|
|
6039
6055
|
const updateValue = (value, trigger = "onChange") => {
|
|
6040
6056
|
var _a;
|
|
6041
6057
|
let val = value;
|
|
6042
|
-
if (type === "digit") {
|
|
6058
|
+
if (type === "digit" || type === "tel") {
|
|
6043
6059
|
val = formatNumber(val, false, false);
|
|
6044
6060
|
}
|
|
6045
6061
|
if (type === "number") {
|
|
6046
6062
|
val = formatNumber(val, true, true);
|
|
6047
6063
|
}
|
|
6064
|
+
if (type === "tel" && !formatter) {
|
|
6065
|
+
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}$/;
|
|
6066
|
+
const regNumber = /[^-0-9]/g;
|
|
6067
|
+
val = !regTel.test(val) && val.length > 11 ? val.substring(0, 11) : val.replace(regNumber, "");
|
|
6068
|
+
}
|
|
6048
6069
|
if (formatter && trigger === formatTrigger) {
|
|
6049
6070
|
val = formatter(val);
|
|
6050
6071
|
}
|
|
@@ -6186,7 +6207,7 @@
|
|
|
6186
6207
|
className: "nut-input-clear",
|
|
6187
6208
|
name: clearIcon,
|
|
6188
6209
|
size: clearSize,
|
|
6189
|
-
|
|
6210
|
+
onClick: (e2) => {
|
|
6190
6211
|
handleClear(e2);
|
|
6191
6212
|
}
|
|
6192
6213
|
}) : null, rightIcon && rightIcon.length > 0 ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -6693,6 +6714,9 @@
|
|
|
6693
6714
|
disabled,
|
|
6694
6715
|
readOnly: readonly,
|
|
6695
6716
|
value: inputValue,
|
|
6717
|
+
onInput: (e2) => {
|
|
6718
|
+
textChange(e2);
|
|
6719
|
+
},
|
|
6696
6720
|
onChange: (e2) => {
|
|
6697
6721
|
textChange(e2);
|
|
6698
6722
|
},
|
|
@@ -6886,6 +6910,7 @@
|
|
|
6886
6910
|
item.status = "ready";
|
|
6887
6911
|
item.message = locale.uploader.readyUpload;
|
|
6888
6912
|
}
|
|
6913
|
+
return item;
|
|
6889
6914
|
});
|
|
6890
6915
|
return [...fileList2];
|
|
6891
6916
|
});
|
|
@@ -6898,6 +6923,7 @@
|
|
|
6898
6923
|
item.status = "uploading";
|
|
6899
6924
|
item.message = locale.uploader.uploading;
|
|
6900
6925
|
}
|
|
6926
|
+
return item;
|
|
6901
6927
|
});
|
|
6902
6928
|
return [...fileList2];
|
|
6903
6929
|
});
|
|
@@ -6911,6 +6937,7 @@
|
|
|
6911
6937
|
item.status = "success";
|
|
6912
6938
|
item.message = locale.uploader.success;
|
|
6913
6939
|
}
|
|
6940
|
+
return item;
|
|
6914
6941
|
});
|
|
6915
6942
|
return [...fileList2];
|
|
6916
6943
|
});
|
|
@@ -6926,6 +6953,7 @@
|
|
|
6926
6953
|
item.status = "error";
|
|
6927
6954
|
item.message = locale.uploader.error;
|
|
6928
6955
|
}
|
|
6956
|
+
return item;
|
|
6929
6957
|
});
|
|
6930
6958
|
return [...fileList2];
|
|
6931
6959
|
});
|
|
@@ -7055,7 +7083,7 @@
|
|
|
7055
7083
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7056
7084
|
className: `nut-uploader__preview ${listType}`,
|
|
7057
7085
|
key: item.uid
|
|
7058
|
-
}, listType
|
|
7086
|
+
}, listType === "picture" && !children && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7059
7087
|
className: "nut-uploader__preview-img"
|
|
7060
7088
|
}, item.status === "ready" ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7061
7089
|
className: "nut-uploader__preview__progress"
|
|
@@ -7065,21 +7093,23 @@
|
|
|
7065
7093
|
className: "nut-uploader__preview__progress"
|
|
7066
7094
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
7067
7095
|
color: "#fff",
|
|
7068
|
-
name: `${item.status
|
|
7096
|
+
name: `${item.status === "error" ? "failure" : "loading"}`
|
|
7069
7097
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7070
7098
|
className: "nut-uploader__preview__progress__msg"
|
|
7071
7099
|
}, item.message)), isDeletable && /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
7072
7100
|
color: "rgba(0,0,0,0.6)",
|
|
7073
7101
|
className: "close",
|
|
7074
7102
|
name: "failure",
|
|
7075
|
-
|
|
7103
|
+
onClick: () => onDelete(item, index2)
|
|
7076
7104
|
}), item.type.includes("image") ? /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, item.url && /* @__PURE__ */ React__default["default"].createElement("img", {
|
|
7077
7105
|
className: "nut-uploader__preview-img__c",
|
|
7078
7106
|
src: item.url,
|
|
7107
|
+
alt: "",
|
|
7079
7108
|
onClick: () => handleItemClick(item)
|
|
7080
7109
|
})) : /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, defaultImg ? /* @__PURE__ */ React__default["default"].createElement("img", {
|
|
7081
7110
|
className: "nut-uploader__preview-img__c",
|
|
7082
7111
|
src: defaultImg,
|
|
7112
|
+
alt: "",
|
|
7083
7113
|
onClick: () => handleItemClick(item)
|
|
7084
7114
|
}) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7085
7115
|
className: "nut-uploader__preview-img__file"
|
|
@@ -7091,7 +7121,7 @@
|
|
|
7091
7121
|
name: "link"
|
|
7092
7122
|
}), "\xA0", item.name))), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7093
7123
|
className: "tips"
|
|
7094
|
-
}, item.name)), listType
|
|
7124
|
+
}, item.name)), listType === "list" && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7095
7125
|
className: "nut-uploader__preview-list"
|
|
7096
7126
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7097
7127
|
className: `nut-uploader__preview-img__file__name ${item.status}`,
|
|
@@ -7102,9 +7132,9 @@
|
|
|
7102
7132
|
color: "#808080",
|
|
7103
7133
|
className: "nut-uploader__preview-img__file__del",
|
|
7104
7134
|
name: "del",
|
|
7105
|
-
|
|
7135
|
+
onClick: () => onDelete(item, index2)
|
|
7106
7136
|
})));
|
|
7107
|
-
}), maximum > fileList.length && listType
|
|
7137
|
+
}), maximum > fileList.length && listType === "picture" && !children && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7108
7138
|
className: `nut-uploader__upload ${listType}`
|
|
7109
7139
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
7110
7140
|
size: uploadIconSize,
|
|
@@ -12156,7 +12186,7 @@
|
|
|
12156
12186
|
({ down, last, offset: [x2, y2] }) => {
|
|
12157
12187
|
api.start({ x: x2, y: y2, immediate: down });
|
|
12158
12188
|
if (last) {
|
|
12159
|
-
if (props.direction
|
|
12189
|
+
if (props.direction !== "y" && props.attract) {
|
|
12160
12190
|
if (x2 < middleLine.current) {
|
|
12161
12191
|
api.start({ x: boundaryState.left, y: y2, immediate: down });
|
|
12162
12192
|
} else {
|
|
@@ -12718,11 +12748,22 @@
|
|
|
12718
12748
|
this.clearCloseTimer();
|
|
12719
12749
|
}
|
|
12720
12750
|
render() {
|
|
12721
|
-
const {
|
|
12751
|
+
const {
|
|
12752
|
+
children,
|
|
12753
|
+
style,
|
|
12754
|
+
msg,
|
|
12755
|
+
color,
|
|
12756
|
+
background,
|
|
12757
|
+
type,
|
|
12758
|
+
className,
|
|
12759
|
+
position,
|
|
12760
|
+
isWrapTeleport
|
|
12761
|
+
} = this.props;
|
|
12722
12762
|
this.state;
|
|
12723
12763
|
cn("notify");
|
|
12724
12764
|
const classes = classNames({
|
|
12725
|
-
"popup-top":
|
|
12765
|
+
"popup-top": position === "top",
|
|
12766
|
+
"popup-bottom": position === "bottom",
|
|
12726
12767
|
"nut-notify": true,
|
|
12727
12768
|
[`nut-notify--${type}`]: true
|
|
12728
12769
|
});
|
|
@@ -12731,7 +12772,9 @@
|
|
|
12731
12772
|
timeout: 300,
|
|
12732
12773
|
classNames: "fade",
|
|
12733
12774
|
unmountOnExit: true,
|
|
12734
|
-
appear: true
|
|
12775
|
+
appear: true,
|
|
12776
|
+
position,
|
|
12777
|
+
isWrapTeleport
|
|
12735
12778
|
}, /* @__PURE__ */ React__namespace.createElement("div", {
|
|
12736
12779
|
className: `${classes} ${className}`,
|
|
12737
12780
|
style: {
|
|
@@ -12774,8 +12817,11 @@
|
|
|
12774
12817
|
msg: "",
|
|
12775
12818
|
id: "",
|
|
12776
12819
|
duration: 3e3,
|
|
12820
|
+
color: "",
|
|
12777
12821
|
type: "danger",
|
|
12778
12822
|
className: "",
|
|
12823
|
+
position: "top",
|
|
12824
|
+
isWrapTeleport: true,
|
|
12779
12825
|
onClosed: () => {
|
|
12780
12826
|
},
|
|
12781
12827
|
onClick: () => {
|
|
@@ -13019,7 +13065,7 @@
|
|
|
13019
13065
|
color: "",
|
|
13020
13066
|
background: "",
|
|
13021
13067
|
delay: 1,
|
|
13022
|
-
scrollable:
|
|
13068
|
+
scrollable: null,
|
|
13023
13069
|
speed: 50
|
|
13024
13070
|
};
|
|
13025
13071
|
const NoticeBar = (props) => {
|
|
@@ -13057,6 +13103,7 @@
|
|
|
13057
13103
|
const [animate, SetAnimate] = React.useState(false);
|
|
13058
13104
|
const [distance, SetDistance] = React.useState(0);
|
|
13059
13105
|
const [timer, SetTimer] = React.useState(0);
|
|
13106
|
+
const [isCanScroll, SetIsCanScroll] = React.useState(null);
|
|
13060
13107
|
React.useState(0);
|
|
13061
13108
|
React.useEffect(() => {
|
|
13062
13109
|
if (direction === "vertical") {
|
|
@@ -13083,12 +13130,13 @@
|
|
|
13083
13130
|
}, []);
|
|
13084
13131
|
const cloneChild = (listItem, listIndex) => {
|
|
13085
13132
|
return React__default["default"].Children.map(children, function(child, index2) {
|
|
13086
|
-
if (child && index2
|
|
13133
|
+
if (child && index2 === listIndex) {
|
|
13087
13134
|
return React__default["default"].cloneElement(child, {
|
|
13088
13135
|
key: listIndex,
|
|
13089
13136
|
children: listItem
|
|
13090
13137
|
});
|
|
13091
13138
|
}
|
|
13139
|
+
return null;
|
|
13092
13140
|
});
|
|
13093
13141
|
};
|
|
13094
13142
|
React.useEffect(() => {
|
|
@@ -13109,7 +13157,9 @@
|
|
|
13109
13157
|
}
|
|
13110
13158
|
const wrapW = wrap.current.getBoundingClientRect().width;
|
|
13111
13159
|
const offsetW = content.current.getBoundingClientRect().width;
|
|
13112
|
-
|
|
13160
|
+
const canScroll = scrollable == null ? offsetW > wrapW : scrollable;
|
|
13161
|
+
SetIsCanScroll(canScroll);
|
|
13162
|
+
if (canScroll) {
|
|
13113
13163
|
SetWrapWidth(wrapW);
|
|
13114
13164
|
SetOffsetW(offsetW);
|
|
13115
13165
|
SetDuration(offsetW / speed);
|
|
@@ -13117,7 +13167,7 @@
|
|
|
13117
13167
|
} else {
|
|
13118
13168
|
SetAnimationClass("");
|
|
13119
13169
|
}
|
|
13120
|
-
});
|
|
13170
|
+
}, 0);
|
|
13121
13171
|
};
|
|
13122
13172
|
const handleClick2 = (event) => {
|
|
13123
13173
|
click && click(event);
|
|
@@ -13179,19 +13229,39 @@
|
|
|
13179
13229
|
const handleClickIcon = () => {
|
|
13180
13230
|
close && close(scrollList[0]);
|
|
13181
13231
|
};
|
|
13232
|
+
const iconShow = () => {
|
|
13233
|
+
if (leftIcon === "close") {
|
|
13234
|
+
return false;
|
|
13235
|
+
}
|
|
13236
|
+
return true;
|
|
13237
|
+
};
|
|
13238
|
+
const iconBg = () => {
|
|
13239
|
+
let iconBg2 = "";
|
|
13240
|
+
if (leftIcon) {
|
|
13241
|
+
iconBg2 = leftIcon;
|
|
13242
|
+
}
|
|
13243
|
+
return iconBg2;
|
|
13244
|
+
};
|
|
13245
|
+
const isEllipsis = () => {
|
|
13246
|
+
if (isCanScroll == null) {
|
|
13247
|
+
return wrapable;
|
|
13248
|
+
}
|
|
13249
|
+
return !isCanScroll && !wrapable;
|
|
13250
|
+
};
|
|
13182
13251
|
const contentStyle = {
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13252
|
+
animationDelay: `${firstRound ? delay : 0}s`,
|
|
13253
|
+
animationDuration: `${duration}s`,
|
|
13254
|
+
transform: `translateX(${firstRound ? 0 : `${wrapWidth}px`})`
|
|
13186
13255
|
};
|
|
13187
13256
|
const barStyle = {
|
|
13188
13257
|
color,
|
|
13189
13258
|
background,
|
|
13190
|
-
height: direction
|
|
13259
|
+
height: direction === "vertical" ? `${height}px` : ""
|
|
13191
13260
|
};
|
|
13261
|
+
const duringTime = ~~(height / speed / 4);
|
|
13192
13262
|
const horseLampStyle = {
|
|
13193
13263
|
transform: complexAm ? `translateY(${distance}px)` : "",
|
|
13194
|
-
transition: animate ? `all ${~~(height / speed
|
|
13264
|
+
transition: animate ? `all ${duringTime === 0 ? ~~(height / speed) : duringTime}s` : "",
|
|
13195
13265
|
marginTop: animate ? `-${height}px` : ""
|
|
13196
13266
|
};
|
|
13197
13267
|
const b2 = cn("noticebar");
|
|
@@ -13204,32 +13274,32 @@
|
|
|
13204
13274
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13205
13275
|
className: `${b2()} ${className || ""}`,
|
|
13206
13276
|
style
|
|
13207
|
-
}, showNoticeBar && direction
|
|
13277
|
+
}, showNoticeBar && direction === "across" ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13208
13278
|
className: noticebarClass,
|
|
13209
13279
|
style: barStyle,
|
|
13210
13280
|
onClick: handleClick2
|
|
13211
|
-
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13281
|
+
}, iconShow() ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13212
13282
|
className: "left-icon",
|
|
13213
|
-
style: { backgroundImage: `url(${
|
|
13214
|
-
}, !
|
|
13283
|
+
style: { backgroundImage: `url(${iconBg() || ""})` }
|
|
13284
|
+
}, !iconBg() ? /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
13215
13285
|
name: "notice",
|
|
13216
13286
|
size: "16",
|
|
13217
13287
|
color
|
|
13218
|
-
}) : null), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13288
|
+
}) : null) : null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13219
13289
|
ref: wrap,
|
|
13220
13290
|
className: "wrap"
|
|
13221
13291
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13222
13292
|
ref: content,
|
|
13223
|
-
className: `content ${animationClass} ${
|
|
13293
|
+
className: `content ${animationClass} ${isEllipsis() && "nut-ellipsis"}`,
|
|
13224
13294
|
style: contentStyle,
|
|
13225
13295
|
onAnimationEnd
|
|
13226
|
-
}, children, text)), closeMode ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13296
|
+
}, children, text)), closeMode || rightIcon ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13227
13297
|
className: "right-icon",
|
|
13228
13298
|
onClick: onClickIcon
|
|
13229
13299
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
13230
|
-
name: "close",
|
|
13300
|
+
name: rightIcon || "close",
|
|
13231
13301
|
color
|
|
13232
|
-
})) : null) : scrollList.current.length > 0 && direction
|
|
13302
|
+
})) : null) : null, scrollList.current.length > 0 && direction === "vertical" ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
13233
13303
|
className: "nut-noticebar-vertical",
|
|
13234
13304
|
style: barStyle
|
|
13235
13305
|
}, children ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -13892,8 +13962,8 @@
|
|
|
13892
13962
|
height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
13893
13963
|
backgroundColor: `${bgColor}`,
|
|
13894
13964
|
color: `${color}`,
|
|
13895
|
-
marginLeft: avatarIndex
|
|
13896
|
-
zIndex: ((_e = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _e.zIndex)
|
|
13965
|
+
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` : "",
|
|
13966
|
+
zIndex: ((_e = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _e.zIndex) === "right" ? `${Math.abs(maxSum - avatarIndex)}` : "",
|
|
13897
13967
|
...style
|
|
13898
13968
|
};
|
|
13899
13969
|
const maxStyles = {
|
|
@@ -13911,15 +13981,16 @@
|
|
|
13911
13981
|
const avatarLength = (children2) => {
|
|
13912
13982
|
var _a2, _b2, _c2;
|
|
13913
13983
|
for (let i = 0; i < children2.length; i++) {
|
|
13914
|
-
|
|
13984
|
+
console.log("child", children2[i], children2[i].classList);
|
|
13985
|
+
if (children2[i] && children2[i].classList && children2[i].classList[0] === "nut-avatar") {
|
|
13915
13986
|
children2[i].setAttribute("data-index", i + 1);
|
|
13916
13987
|
}
|
|
13917
13988
|
}
|
|
13918
|
-
const index2 = (_b2 = (_a2 = avatarRef == null ? void 0 : avatarRef.current) == null ? void 0 : _a2.dataset) == null ? void 0 : _b2.index;
|
|
13989
|
+
const index2 = Number((_b2 = (_a2 = avatarRef == null ? void 0 : avatarRef.current) == null ? void 0 : _a2.dataset) == null ? void 0 : _b2.index);
|
|
13919
13990
|
const maxCount = (_c2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c2.maxCount;
|
|
13920
13991
|
setMaxSum(children2.length);
|
|
13921
13992
|
setAvatarIndex(index2);
|
|
13922
|
-
if (index2
|
|
13993
|
+
if (index2 === children2.length && index2 !== maxCount && children2.length > maxCount) {
|
|
13923
13994
|
setShowMax(true);
|
|
13924
13995
|
}
|
|
13925
13996
|
};
|
|
@@ -14007,14 +14078,24 @@
|
|
|
14007
14078
|
...props
|
|
14008
14079
|
};
|
|
14009
14080
|
const b2 = cn("price");
|
|
14081
|
+
const replaceSpecialChar = (symbol2) => {
|
|
14082
|
+
let desSymbol = symbol2;
|
|
14083
|
+
desSymbol = symbol2.replace(/"/g, '"');
|
|
14084
|
+
desSymbol = symbol2.replace(/&/g, "&");
|
|
14085
|
+
desSymbol = symbol2.replace(/</g, "<");
|
|
14086
|
+
desSymbol = symbol2.replace(/>/g, ">");
|
|
14087
|
+
desSymbol = symbol2.replace(/ /g, " ");
|
|
14088
|
+
desSymbol = symbol2.replace(/¥/g, "\uFFE5");
|
|
14089
|
+
return desSymbol;
|
|
14090
|
+
};
|
|
14010
14091
|
const showSymbol = () => {
|
|
14011
|
-
return { __html: (needSymbol ? symbol : "") || "" };
|
|
14092
|
+
return { __html: (needSymbol ? replaceSpecialChar(symbol) : "") || "" };
|
|
14012
14093
|
};
|
|
14013
14094
|
const checkPoint = (price2) => {
|
|
14014
14095
|
return String(price2).indexOf(".") > 0;
|
|
14015
14096
|
};
|
|
14016
14097
|
const formatThousands = (num) => {
|
|
14017
|
-
if (Number(num)
|
|
14098
|
+
if (Number(num) === 0) {
|
|
14018
14099
|
num = 0;
|
|
14019
14100
|
}
|
|
14020
14101
|
if (checkPoint(num)) {
|
|
@@ -14029,7 +14110,7 @@
|
|
|
14029
14110
|
return num;
|
|
14030
14111
|
};
|
|
14031
14112
|
const formatDecimal = (decimalNum) => {
|
|
14032
|
-
if (Number(decimalNum)
|
|
14113
|
+
if (Number(decimalNum) === 0) {
|
|
14033
14114
|
decimalNum = 0;
|
|
14034
14115
|
}
|
|
14035
14116
|
if (checkPoint(decimalNum)) {
|
|
@@ -14193,7 +14274,7 @@
|
|
|
14193
14274
|
className: "_icon",
|
|
14194
14275
|
name: "close",
|
|
14195
14276
|
size: "12",
|
|
14196
|
-
|
|
14277
|
+
onClick: (e2) => {
|
|
14197
14278
|
setIsTagShow(false);
|
|
14198
14279
|
if (props.onClose) {
|
|
14199
14280
|
props.onClose(e2);
|
|
@@ -14251,12 +14332,6 @@
|
|
|
14251
14332
|
return trigger;
|
|
14252
14333
|
}
|
|
14253
14334
|
}
|
|
14254
|
-
function findDOMNode(node) {
|
|
14255
|
-
if (node instanceof HTMLElement) {
|
|
14256
|
-
return node;
|
|
14257
|
-
}
|
|
14258
|
-
return ReactDOM__default["default"].findDOMNode(node);
|
|
14259
|
-
}
|
|
14260
14335
|
const getEleAttr = (ele) => {
|
|
14261
14336
|
if (ele && ele.getBoundingClientRect) {
|
|
14262
14337
|
return ele.getBoundingClientRect();
|
|
@@ -14268,8 +14343,11 @@
|
|
|
14268
14343
|
theme: "light",
|
|
14269
14344
|
location: "bottom",
|
|
14270
14345
|
visible: false,
|
|
14346
|
+
offset: 20,
|
|
14271
14347
|
className: "",
|
|
14272
14348
|
onClick: (e2) => {
|
|
14349
|
+
},
|
|
14350
|
+
onChoose: (item, index2) => {
|
|
14273
14351
|
}
|
|
14274
14352
|
};
|
|
14275
14353
|
const Popover = (props) => {
|
|
@@ -14279,20 +14357,21 @@
|
|
|
14279
14357
|
theme,
|
|
14280
14358
|
location,
|
|
14281
14359
|
visible,
|
|
14360
|
+
offset,
|
|
14282
14361
|
className,
|
|
14283
14362
|
style,
|
|
14284
14363
|
onClick,
|
|
14364
|
+
onChoose,
|
|
14285
14365
|
...reset
|
|
14286
14366
|
} = {
|
|
14287
14367
|
...defaultProps$k,
|
|
14288
14368
|
...props
|
|
14289
14369
|
};
|
|
14290
14370
|
const goodItem = React.useRef(null);
|
|
14291
|
-
const aa = goodItem.current && findDOMNode(goodItem.current);
|
|
14292
14371
|
setTimeout(() => {
|
|
14293
|
-
if (
|
|
14294
|
-
setElWidth(getEleAttr(
|
|
14295
|
-
setElHeight(getEleAttr(
|
|
14372
|
+
if (goodItem.current && getEleAttr(goodItem.current)) {
|
|
14373
|
+
setElWidth(getEleAttr(goodItem.current).width);
|
|
14374
|
+
setElHeight(getEleAttr(goodItem.current).height);
|
|
14296
14375
|
}
|
|
14297
14376
|
});
|
|
14298
14377
|
const [classes, setClasses] = React.useState("");
|
|
@@ -14306,68 +14385,46 @@
|
|
|
14306
14385
|
setPopoverArrow(popoverArrowSelf());
|
|
14307
14386
|
}, [list, theme]);
|
|
14308
14387
|
const getStyle = () => {
|
|
14388
|
+
const offNumer = Number(offset) ? Number(offset) : 0;
|
|
14309
14389
|
const style2 = {};
|
|
14310
|
-
if (location
|
|
14311
|
-
style2.bottom = elHeight +
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
style2.right =
|
|
14316
|
-
} else if (location === "left") {
|
|
14317
|
-
style2.top = 0;
|
|
14318
|
-
style2.left = -elWidth - 20;
|
|
14319
|
-
} else {
|
|
14320
|
-
style2.top = elHeight + 20;
|
|
14321
|
-
style2.left = 0;
|
|
14322
|
-
}
|
|
14323
|
-
style2.top += "px";
|
|
14324
|
-
style2.left += "px";
|
|
14325
|
-
style2.bottom += "px";
|
|
14326
|
-
style2.right += "px";
|
|
14327
|
-
return style2;
|
|
14328
|
-
};
|
|
14329
|
-
const getArrowStyle = () => {
|
|
14330
|
-
const style2 = {};
|
|
14331
|
-
if (location === "top") {
|
|
14332
|
-
style2.bottom = -20;
|
|
14333
|
-
style2.left = elWidth / 2;
|
|
14334
|
-
} else if (location === "right") {
|
|
14335
|
-
style2.top = 20;
|
|
14336
|
-
style2.left = -20;
|
|
14337
|
-
} else if (location === "left") {
|
|
14338
|
-
style2.top = 20;
|
|
14339
|
-
style2.right = -20;
|
|
14390
|
+
if (location.includes("top")) {
|
|
14391
|
+
style2.bottom = `${elHeight + offNumer}px`;
|
|
14392
|
+
} else if (location.includes("right")) {
|
|
14393
|
+
style2.left = `${elWidth + offNumer}px`;
|
|
14394
|
+
} else if (location.includes("left")) {
|
|
14395
|
+
style2.right = `${elWidth + offNumer}px`;
|
|
14340
14396
|
} else {
|
|
14341
|
-
style2.
|
|
14342
|
-
style2.top = -20;
|
|
14397
|
+
style2.top = `${elHeight + offNumer}px`;
|
|
14343
14398
|
}
|
|
14344
|
-
style2.top += "px";
|
|
14345
|
-
style2.left += "px";
|
|
14346
|
-
style2.bottom += "px";
|
|
14347
|
-
style2.right += "px";
|
|
14348
14399
|
return style2;
|
|
14349
14400
|
};
|
|
14350
14401
|
const classesSelf = () => {
|
|
14351
14402
|
const prefixCls = "nut-popover";
|
|
14352
|
-
return `${prefixCls}
|
|
14353
|
-
${theme ? `${prefixCls}--${theme}` : ""}`;
|
|
14403
|
+
return `${prefixCls} ${theme ? `${prefixCls}--${theme}` : ""}`;
|
|
14354
14404
|
};
|
|
14355
14405
|
const popoverContentSelf = () => {
|
|
14356
|
-
const prefixCls = "
|
|
14357
|
-
return `${prefixCls}
|
|
14358
|
-
|
|
14406
|
+
const prefixCls = "popover-content";
|
|
14407
|
+
return `${prefixCls}-show ${prefixCls} ${location ? `${prefixCls}--${location}` : ""}`;
|
|
14408
|
+
};
|
|
14409
|
+
const filter = () => {
|
|
14410
|
+
const ms = ["top", "bottom", "left", "right"];
|
|
14411
|
+
return ms.filter((m2) => location.includes(m2))[0];
|
|
14359
14412
|
};
|
|
14360
14413
|
const popoverArrowSelf = () => {
|
|
14361
|
-
const prefixCls = "
|
|
14362
|
-
return `${prefixCls}
|
|
14363
|
-
${location ? `${prefixCls}--${location}` : ""}`;
|
|
14414
|
+
const prefixCls = "popover-arrow";
|
|
14415
|
+
return `${prefixCls} ${prefixCls}-${filter()} ${location ? `${prefixCls}--${location}` : ""}`;
|
|
14364
14416
|
};
|
|
14365
14417
|
const handleClick2 = (e2) => {
|
|
14366
14418
|
if (props.onClick) {
|
|
14367
14419
|
props.onClick(e2);
|
|
14368
14420
|
}
|
|
14369
14421
|
};
|
|
14370
|
-
|
|
14422
|
+
const handleChoose = (item, index2) => {
|
|
14423
|
+
if (!item.disabled) {
|
|
14424
|
+
onChoose(item, index2);
|
|
14425
|
+
}
|
|
14426
|
+
};
|
|
14427
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14371
14428
|
className: `${classes} ${className}`,
|
|
14372
14429
|
style: { ...style },
|
|
14373
14430
|
...reset
|
|
@@ -14379,19 +14436,25 @@
|
|
|
14379
14436
|
className: `${popoverContent}`,
|
|
14380
14437
|
style: getStyle()
|
|
14381
14438
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14382
|
-
className: `${popoverArrow}
|
|
14383
|
-
|
|
14384
|
-
}, " "), Array.isArray(children) ? children[1] : "", list.map((item) => {
|
|
14439
|
+
className: `${popoverArrow}`
|
|
14440
|
+
}), Array.isArray(children) ? children[1] : "", list.map((item, i) => {
|
|
14385
14441
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14386
14442
|
key: item.name,
|
|
14387
|
-
className: `
|
|
14443
|
+
className: `popover-menu-item ${item.disabled ? "disabled" : ""}`,
|
|
14444
|
+
onClick: () => {
|
|
14445
|
+
handleChoose(item, i);
|
|
14446
|
+
}
|
|
14388
14447
|
}, item.icon ? /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
14389
|
-
className: "item-img",
|
|
14448
|
+
className: "popover-menu-item-img",
|
|
14390
14449
|
name: item.icon
|
|
14391
14450
|
}) : "", /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14392
|
-
className: "
|
|
14451
|
+
className: "popover-menu-item-name"
|
|
14393
14452
|
}, item.name));
|
|
14394
|
-
})) : null)))
|
|
14453
|
+
})) : null))), visible ? /* @__PURE__ */ React__default["default"].createElement(Overlay, {
|
|
14454
|
+
visible,
|
|
14455
|
+
onClick: (e2) => handleClick2(e2),
|
|
14456
|
+
style: { background: "transparent" }
|
|
14457
|
+
}) : "");
|
|
14395
14458
|
};
|
|
14396
14459
|
Popover.defaultProps = defaultProps$k;
|
|
14397
14460
|
Popover.displayName = "NutPopover";
|