@nutui/nutui-react-taro 2.0.0-alpha.12 → 2.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/AnimatingNumbers/style/style.css +1 -1
- package/dist/esm/AnimatingNumbers.js +99 -5
- package/dist/esm/Audio.js +3 -3
- package/dist/esm/AvatarGroup.js +1 -1
- package/dist/esm/Barrage/style/style.css +1 -1
- package/dist/esm/Barrage.js +2 -3
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/CircleProgress.js +2 -2
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/DatePicker.js +3 -3
- package/dist/esm/Ellipsis.js +2 -2
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/Menu.js +1 -1
- package/dist/esm/MenuItem.js +2 -2
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Picker.js +2 -2
- package/dist/esm/Popover/style/index.js +1 -1
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popover.js +9 -3
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/Range.js +2 -2
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/SideNavBar.js +3 -3
- package/dist/esm/SideNavBarItem/style/style.css +1 -1
- package/dist/esm/SideNavBarItem.js +1 -1
- package/dist/esm/Signature.js +1 -1
- package/dist/esm/Sticky.js +2 -2
- package/dist/esm/SubSideNavBar/style/style.css +1 -1
- package/dist/esm/SubSideNavBar.js +2 -2
- package/dist/esm/Swipe.js +2 -2
- package/dist/esm/TextArea/style/style.css +1 -1
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/TrendArrow/style/style.css +1 -1
- package/dist/esm/TrendArrow.js +2 -3
- package/dist/esm/Uploader.js +2 -2
- package/dist/esm/Video.js +3 -3
- package/dist/esm/WaterMark.js +2 -3
- package/dist/esm/{audio.taro-bbd39f93.js → audio.taro-73011657.js} +3 -3
- package/dist/esm/{barrage.taro-c8cb9864.js → barrage.taro-e87bc58e.js} +32 -32
- package/dist/esm/{circleprogress.taro-7149e09d.js → circleprogress.taro-9064d69c.js} +1 -1
- package/dist/esm/{datepicker.taro-65dbeceb.js → datepicker.taro-6304d59d.js} +1 -1
- package/dist/esm/{ellipsis.taro-f423affa.js → ellipsis.taro-5653d0b2.js} +12 -12
- package/dist/esm/{index-e3184f19.js → index-0a89a47b.js} +7 -1
- package/dist/esm/{menu.taro-cd0fef41.js → menu.taro-40d36e0a.js} +3 -3
- package/dist/esm/{menuitem.taro-6076bffa.js → menuitem.taro-6aa35a00.js} +1 -1
- package/dist/esm/{noticebar.taro-2f02b2ad.js → noticebar.taro-8d496dd6.js} +1 -1
- package/dist/esm/nutui-react.es.js +31 -31
- package/dist/esm/{picker.taro-0570ec32.js → picker.taro-8ba4624c.js} +44 -40
- package/dist/esm/popover.taro-ba6c323a.js +229 -0
- package/dist/esm/{range.taro-615e193a.js → range.taro-a1d1ad25.js} +1 -1
- package/dist/esm/{sidenavbar.taro-9f210df4.js → sidenavbar.taro-1aefdd3c.js} +13 -10
- package/dist/esm/sidenavbaritem.taro-7d805f92.js +13 -0
- package/dist/esm/{signature.taro-c57469aa.js → signature.taro-6e75a1ac.js} +1 -1
- package/dist/esm/{sticky.taro-f8ae8d5e.js → sticky.taro-6bc62a96.js} +2 -2
- package/dist/esm/{subsidenavbar.taro-abe07673.js → subsidenavbar.taro-47bb6e74.js} +10 -9
- package/dist/esm/{swipe.taro-de80fcd8.js → swipe.taro-966af6d3.js} +1 -1
- package/dist/esm/trendarrow.taro-253025d2.js +70 -0
- package/dist/esm/types/src/packages/animatingnumbers/countup.d.ts +7 -8
- package/dist/esm/types/src/packages/animatingnumbers/countup.taro.d.ts +7 -8
- package/dist/esm/types/src/packages/animatingnumbers/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/animatingnumbers/demo.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/animatingnumbers/index.d.ts +1 -0
- package/dist/esm/types/src/packages/animatingnumbers/index.taro.d.ts +1 -0
- package/dist/{types/packages/avatargroup/avatargroup.d.ts → esm/types/src/packages/avatargroup/avatargroup.taro.d.ts} +1 -1
- package/dist/esm/types/src/packages/avatargroup/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/barrage/barrage.d.ts +6 -7
- package/dist/esm/types/src/packages/barrage/barrage.taro.d.ts +6 -7
- package/dist/esm/types/src/packages/barrage/index.d.ts +1 -0
- package/dist/esm/types/src/packages/barrage/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/button/button.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
- package/dist/esm/types/src/packages/input/input.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/menu/menu.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/picker/doc.en.d.ts +9 -9
- package/dist/esm/types/src/packages/popover/demo.d.ts +3 -2
- package/dist/esm/types/src/packages/popover/demo.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/popover/index.d.ts +1 -0
- package/dist/esm/types/src/packages/popover/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/popover/popover.d.ts +20 -9
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +20 -10
- package/dist/esm/types/src/packages/sidenavbar/index.d.ts +1 -0
- package/dist/esm/types/src/packages/sidenavbar/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/sidenavbar/sidenavbar.d.ts +5 -9
- package/dist/esm/types/src/packages/sidenavbar/sidenavbar.taro.d.ts +5 -9
- package/dist/esm/types/src/packages/sidenavbaritem/index.d.ts +1 -0
- package/dist/esm/types/src/packages/sidenavbaritem/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/sidenavbaritem/sidenavbaritem.d.ts +3 -3
- package/dist/esm/types/src/packages/sidenavbaritem/sidenavbaritem.taro.d.ts +3 -3
- package/dist/esm/types/src/packages/subsidenavbar/index.d.ts +1 -0
- package/dist/esm/types/src/packages/subsidenavbar/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/subsidenavbar/subsidenavbar.d.ts +3 -3
- package/dist/esm/types/src/packages/subsidenavbar/subsidenavbar.taro.d.ts +3 -3
- package/dist/esm/types/src/packages/trendarrow/trendarrow.d.ts +8 -10
- package/dist/esm/types/src/packages/trendarrow/trendarrow.taro.d.ts +8 -10
- package/dist/esm/types/src/packages/video/index.d.ts +1 -0
- package/dist/esm/types/src/packages/video/index.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/video/video.d.ts +5 -9
- package/dist/esm/types/src/packages/video/video.taro.d.ts +6 -9
- package/dist/esm/types/src/packages/watermark/demo.d.ts +0 -1
- package/dist/esm/types/src/packages/watermark/demo.taro.d.ts +0 -1
- package/dist/esm/types/src/packages/watermark/index.d.ts +1 -0
- package/dist/esm/types/src/packages/watermark/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/watermark/watermark.d.ts +3 -4
- package/dist/esm/types/src/packages/watermark/watermark.taro.d.ts +3 -4
- package/dist/esm/types/src/utils/index.d.ts +1 -0
- package/dist/esm/types/src/utils/use-click-away.d.ts +3 -0
- package/dist/esm/{uploader.taro-7e38fc37.js → uploader.taro-fbd05e20.js} +1 -1
- package/dist/esm/use-client-rect-2bb6c562.js +40 -0
- package/dist/esm/video.taro-2a26d7da.js +37 -0
- package/dist/esm/{watermark.taro-cef29c03.js → watermark.taro-e2245bb1.js} +12 -13
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/tr-TR.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +551 -433
- package/dist/nutui.react.umd.js +551 -433
- package/dist/packages/animatingnumbers/countup.scss +0 -21
- package/dist/packages/barrage/barrage.scss +0 -13
- package/dist/packages/popover/popover.scss +158 -230
- package/dist/packages/popup/popup.scss +133 -46
- package/dist/packages/sidenavbar/sidenavbar.scss +10 -16
- package/dist/packages/sidenavbaritem/sidenavbaritem.scss +7 -19
- package/dist/packages/subsidenavbar/subsidenavbar.scss +10 -19
- package/dist/packages/trendarrow/trendarrow.scss +4 -3
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +37 -55
- package/dist/styles/variables.scss +47 -65
- package/dist/types/packages/actionsheet/actionsheet.taro.d.ts +40 -8
- package/dist/types/packages/animate/animate.taro.d.ts +20 -4
- package/dist/types/packages/animatingnumbers/countup.taro.d.ts +7 -8
- package/dist/types/packages/animatingnumbers/index.taro.d.ts +1 -0
- package/dist/types/packages/audio/audio.taro.d.ts +25 -5
- package/dist/types/packages/avatar/avatar.taro.d.ts +45 -9
- package/dist/types/packages/avatargroup/avatargroup.taro.d.ts +45 -0
- package/dist/types/packages/avatargroup/index.taro.d.ts +1 -1
- package/dist/types/packages/backtop/backtop.taro.d.ts +20 -4
- package/dist/types/packages/badge/badge.taro.d.ts +30 -6
- package/dist/types/packages/barrage/barrage.taro.d.ts +32 -9
- package/dist/types/packages/barrage/index.taro.d.ts +1 -0
- package/dist/types/packages/button/button.taro.d.ts +50 -10
- package/dist/types/packages/cascader/cascader.taro.d.ts +80 -16
- package/dist/types/packages/cell/cell.taro.d.ts +30 -6
- package/dist/types/packages/cellgroup/cellgroup.taro.d.ts +15 -3
- package/dist/types/packages/checkboxgroup/checkboxgroup.taro.d.ts +40 -8
- package/dist/types/packages/circleprogress/circleprogress.taro.d.ts +35 -7
- package/dist/types/packages/col/col.taro.d.ts +15 -3
- package/dist/types/packages/collapse/collapse.taro.d.ts +25 -5
- package/dist/types/packages/collapseitem/collapseitem.taro.d.ts +20 -4
- package/dist/types/packages/configprovider/configprovider.taro.d.ts +10 -2
- package/dist/types/packages/configprovider/types.d.ts +1 -1
- package/dist/types/packages/countdown/countdown.taro.d.ts +65 -13
- package/dist/types/packages/divider/divider.taro.d.ts +10 -2
- package/dist/types/packages/drag/drag.taro.d.ts +15 -3
- package/dist/types/packages/elevator/elevator.taro.d.ts +45 -9
- package/dist/types/packages/ellipsis/ellipsis.taro.d.ts +45 -9
- package/dist/types/packages/empty/empty.taro.d.ts +20 -4
- package/dist/types/packages/fixednav/fixednav.taro.d.ts +50 -10
- package/dist/types/packages/grid/grid.taro.d.ts +35 -7
- package/dist/types/packages/griditem/griditem.taro.d.ts +5 -1
- package/dist/types/packages/imagepreview/imagepreview.taro.d.ts +50 -10
- package/dist/types/packages/indicator/indicator.taro.d.ts +15 -3
- package/dist/types/packages/input/input.taro.d.ts +101 -21
- package/dist/types/packages/inputnumber/inputnumber.taro.d.ts +85 -17
- package/dist/types/packages/menu/menu.taro.d.ts +25 -5
- package/dist/types/packages/menuitem/menuitem.taro.d.ts +35 -7
- package/dist/types/packages/noticebar/noticebar.taro.d.ts +60 -12
- package/dist/types/packages/notify/notify.taro.d.ts +30 -6
- package/dist/types/packages/numberkeyboard/numberkeyboard.taro.d.ts +50 -10
- package/dist/types/packages/overlay/overlay.taro.d.ts +40 -8
- package/dist/types/packages/pagination/pagination.taro.d.ts +55 -11
- package/dist/types/packages/picker/picker.taro.d.ts +55 -11
- package/dist/types/packages/popover/index.taro.d.ts +1 -0
- package/dist/types/packages/popover/popover.taro.d.ts +99 -13
- package/dist/types/packages/popup/popup.taro.d.ts +75 -15
- package/dist/types/packages/price/price.taro.d.ts +35 -7
- package/dist/types/packages/progress/progress.taro.d.ts +35 -7
- package/dist/types/packages/pulltorefresh/pulltorefresh.taro.d.ts +55 -11
- package/dist/types/packages/radio/radio.taro.d.ts +45 -9
- package/dist/types/packages/radiogroup/radiogroup.taro.d.ts +30 -6
- package/dist/types/packages/range/range.taro.d.ts +80 -16
- package/dist/types/packages/searchbar/searchbar.taro.d.ts +72 -17
- package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +85 -17
- package/dist/types/packages/sidenavbar/index.taro.d.ts +1 -0
- package/dist/types/packages/sidenavbar/sidenavbar.taro.d.ts +33 -13
- package/dist/types/packages/sidenavbaritem/index.taro.d.ts +1 -0
- package/dist/types/packages/sidenavbaritem/sidenavbaritem.taro.d.ts +3 -3
- package/dist/types/packages/skeleton/skeleton.taro.d.ts +35 -7
- package/dist/types/packages/step/step.taro.d.ts +20 -4
- package/dist/types/packages/steps/steps.taro.d.ts +15 -3
- package/dist/types/packages/sticky/sticky.taro.d.ts +25 -5
- package/dist/types/packages/subsidenavbar/index.taro.d.ts +1 -0
- package/dist/types/packages/subsidenavbar/subsidenavbar.taro.d.ts +3 -3
- package/dist/types/packages/swipe/swipe.taro.d.ts +47 -11
- package/dist/types/packages/swiper/swiper.taro.d.ts +35 -7
- package/dist/types/packages/switch/switch.taro.d.ts +30 -6
- package/dist/types/packages/tabbar/tabbar.taro.d.ts +35 -7
- package/dist/types/packages/tabbaritem/tabbaritem.taro.d.ts +10 -2
- package/dist/types/packages/tabpane/tabpane.taro.d.ts +15 -3
- package/dist/types/packages/tabs/tabs.taro.d.ts +60 -12
- package/dist/types/packages/textarea/textarea.taro.d.ts +60 -12
- package/dist/types/packages/trendarrow/trendarrow.taro.d.ts +57 -15
- package/dist/types/packages/uploader/uploader.taro.d.ts +165 -33
- package/dist/types/packages/video/index.taro.d.ts +2 -1
- package/dist/types/packages/video/video.taro.d.ts +41 -0
- package/dist/types/packages/virtuallist/virtuallist.taro.d.ts +40 -8
- package/dist/types/packages/watermark/index.taro.d.ts +1 -0
- package/dist/types/packages/watermark/watermark.taro.d.ts +72 -17
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm/animatingnumbers.taro-c2a52dbd.js +0 -103
- package/dist/esm/popover.taro-ad483372.js +0 -162
- package/dist/esm/sidenavbaritem.taro-32a45ce6.js +0 -12
- package/dist/esm/trendarrow.taro-0cf43935.js +0 -72
- package/dist/esm/types/src/packages/popover/Trigger.d.ts +0 -19
- package/dist/esm/types/src/packages/sidenavbar/type.d.ts +0 -34
- package/dist/esm/use-client-rect-f317804e.js +0 -10
- package/dist/esm/video-5d106e33.js +0 -73
- package/dist/types/packages/popover/Trigger.d.ts +0 -19
- package/dist/types/packages/video/video.d.ts +0 -24
- /package/dist/esm/{avatargroup-ad5ffb46.js → avatargroup.taro-ad5ffb46.js} +0 -0
- /package/dist/esm/{offsetContext-f32a9246.js → context-f32a9246.js} +0 -0
- /package/dist/esm/types/src/packages/sidenavbar/{offsetContext.d.ts → context.d.ts} +0 -0
- /package/dist/types/packages/sidenavbar/{offsetContext.d.ts → context.d.ts} +0 -0
package/dist/nutui.react.es.js
CHANGED
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
/*!
|
|
8
|
-
* @nutui/nutui-react-taro v2.0.0-alpha.
|
|
8
|
+
* @nutui/nutui-react-taro v2.0.0-alpha.14 Fri Jun 02 2023 17:13:52 GMT+0800 (China Standard Time)
|
|
9
9
|
* (c) 2023 @jdf2e.
|
|
10
10
|
* Released under the MIT License.
|
|
11
11
|
*/
|
|
@@ -1958,7 +1958,7 @@ const defaultProps$1t = {
|
|
|
1958
1958
|
onClick: (event) => {
|
|
1959
1959
|
}
|
|
1960
1960
|
};
|
|
1961
|
-
const classPrefix$
|
|
1961
|
+
const classPrefix$m = "nut-cell";
|
|
1962
1962
|
const Cell = (props) => {
|
|
1963
1963
|
const {
|
|
1964
1964
|
children,
|
|
@@ -1989,19 +1989,19 @@ const Cell = (props) => {
|
|
|
1989
1989
|
return /* @__PURE__ */ React.createElement(
|
|
1990
1990
|
"div",
|
|
1991
1991
|
{
|
|
1992
|
-
className: classNames(classPrefix$
|
|
1992
|
+
className: classNames(classPrefix$m, className),
|
|
1993
1993
|
onClick: (event) => handleClick(event),
|
|
1994
1994
|
style: baseStyle,
|
|
1995
1995
|
...rest
|
|
1996
1996
|
},
|
|
1997
|
-
children || /* @__PURE__ */ React.createElement(React.Fragment, null, title || description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
1997
|
+
children || /* @__PURE__ */ React.createElement(React.Fragment, null, title || description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__left` }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__description` }, description) : null) : null, extra ? /* @__PURE__ */ React.createElement(
|
|
1998
1998
|
"div",
|
|
1999
1999
|
{
|
|
2000
|
-
className: `${classPrefix$
|
|
2000
|
+
className: `${classPrefix$m}__extra`,
|
|
2001
2001
|
style: styles
|
|
2002
2002
|
},
|
|
2003
2003
|
extra
|
|
2004
|
-
) : null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
2004
|
+
) : null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__divider` }))
|
|
2005
2005
|
);
|
|
2006
2006
|
};
|
|
2007
2007
|
Cell.defaultProps = defaultProps$1t;
|
|
@@ -2012,16 +2012,16 @@ const defaultProps$1s = {
|
|
|
2012
2012
|
description: "",
|
|
2013
2013
|
divider: true
|
|
2014
2014
|
};
|
|
2015
|
-
const classPrefix$
|
|
2015
|
+
const classPrefix$l = "nut-cell-group";
|
|
2016
2016
|
const CellGroup = (props) => {
|
|
2017
2017
|
const { children, className, style, title, description, divider, ...rest } = {
|
|
2018
2018
|
...defaultProps$1s,
|
|
2019
2019
|
...props
|
|
2020
2020
|
};
|
|
2021
|
-
return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix$
|
|
2021
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix$l, className), ...rest }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$l}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$l}__description` }, description) : null, /* @__PURE__ */ React.createElement(
|
|
2022
2022
|
"div",
|
|
2023
2023
|
{
|
|
2024
|
-
className: `${classPrefix$
|
|
2024
|
+
className: `${classPrefix$l}__wrap ${divider ? `${classPrefix$l}__wrap--divider` : ""}`
|
|
2025
2025
|
},
|
|
2026
2026
|
children
|
|
2027
2027
|
));
|
|
@@ -2716,21 +2716,21 @@ const defaultProps$1o = {
|
|
|
2716
2716
|
contentPosition: "center",
|
|
2717
2717
|
direction: "horizontal"
|
|
2718
2718
|
};
|
|
2719
|
-
const classPrefix$
|
|
2719
|
+
const classPrefix$k = `nut-divider`;
|
|
2720
2720
|
const Divider = (props) => {
|
|
2721
2721
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
2722
2722
|
...defaultProps$1o,
|
|
2723
2723
|
...props
|
|
2724
2724
|
};
|
|
2725
2725
|
const classes = direction === "horizontal" ? classNames({
|
|
2726
|
-
[`${classPrefix$
|
|
2727
|
-
[`${classPrefix$
|
|
2728
|
-
[`${classPrefix$
|
|
2729
|
-
[`${classPrefix$
|
|
2730
|
-
[`${classPrefix$
|
|
2726
|
+
[`${classPrefix$k}`]: true,
|
|
2727
|
+
[`${classPrefix$k}__center`]: children,
|
|
2728
|
+
[`${classPrefix$k}__left`]: contentPosition === "left",
|
|
2729
|
+
[`${classPrefix$k}__right`]: contentPosition === "right",
|
|
2730
|
+
[`${classPrefix$k}__hairline`]: true
|
|
2731
2731
|
}) : classNames({
|
|
2732
|
-
[`${classPrefix$
|
|
2733
|
-
[`${classPrefix$
|
|
2732
|
+
[`${classPrefix$k}`]: true,
|
|
2733
|
+
[`${classPrefix$k}__vertical`]: direction === "vertical"
|
|
2734
2734
|
});
|
|
2735
2735
|
return /* @__PURE__ */ React.createElement("div", { className: `${classes} ${className || ""}`, style, ...rest }, children);
|
|
2736
2736
|
};
|
|
@@ -2891,7 +2891,7 @@ const Layout = (props) => {
|
|
|
2891
2891
|
};
|
|
2892
2892
|
Layout.defaultProps = defaultProps$1l;
|
|
2893
2893
|
Layout.displayName = "NutLayout";
|
|
2894
|
-
const classPrefix$
|
|
2894
|
+
const classPrefix$j = "nut-row";
|
|
2895
2895
|
const defaultProps$1k = {
|
|
2896
2896
|
...ComponentDefaults,
|
|
2897
2897
|
type: "",
|
|
@@ -2926,7 +2926,7 @@ const Row = (props) => {
|
|
|
2926
2926
|
${getClass("justify", justify)}
|
|
2927
2927
|
${getClass("align", align)}
|
|
2928
2928
|
${getClass("flex", wrap)}
|
|
2929
|
-
${classPrefix$
|
|
2929
|
+
${classPrefix$j}
|
|
2930
2930
|
`;
|
|
2931
2931
|
};
|
|
2932
2932
|
const parentRow = {
|
|
@@ -2969,6 +2969,35 @@ function useWatch(dep, callback, config2 = { immediate: false }) {
|
|
|
2969
2969
|
stop.current = true;
|
|
2970
2970
|
};
|
|
2971
2971
|
}
|
|
2972
|
+
function isWindow(val) {
|
|
2973
|
+
return val === window;
|
|
2974
|
+
}
|
|
2975
|
+
const getRect = (elementRef) => {
|
|
2976
|
+
const element = elementRef;
|
|
2977
|
+
if (isWindow(element)) {
|
|
2978
|
+
const width = element.innerWidth;
|
|
2979
|
+
const height = element.innerHeight;
|
|
2980
|
+
return {
|
|
2981
|
+
top: 0,
|
|
2982
|
+
left: 0,
|
|
2983
|
+
right: width,
|
|
2984
|
+
bottom: height,
|
|
2985
|
+
width,
|
|
2986
|
+
height
|
|
2987
|
+
};
|
|
2988
|
+
}
|
|
2989
|
+
if (element && element.getBoundingClientRect) {
|
|
2990
|
+
return element.getBoundingClientRect();
|
|
2991
|
+
}
|
|
2992
|
+
return {
|
|
2993
|
+
top: 0,
|
|
2994
|
+
left: 0,
|
|
2995
|
+
right: 0,
|
|
2996
|
+
bottom: 0,
|
|
2997
|
+
width: 0,
|
|
2998
|
+
height: 0
|
|
2999
|
+
};
|
|
3000
|
+
};
|
|
2972
3001
|
const getRectByTaro = async (element) => {
|
|
2973
3002
|
if (element) {
|
|
2974
3003
|
const res = await element.getBoundingClientRect();
|
|
@@ -3002,7 +3031,7 @@ const defaultProps$1j = {
|
|
|
3002
3031
|
position: "top",
|
|
3003
3032
|
zIndex: 2e3
|
|
3004
3033
|
};
|
|
3005
|
-
const classPrefix$
|
|
3034
|
+
const classPrefix$i = "nut-sticky";
|
|
3006
3035
|
const Sticky = (props) => {
|
|
3007
3036
|
const {
|
|
3008
3037
|
position,
|
|
@@ -3078,7 +3107,7 @@ const Sticky = (props) => {
|
|
|
3078
3107
|
setFixed(windowHeight - threshold < curRootRect.bottom);
|
|
3079
3108
|
}
|
|
3080
3109
|
} else {
|
|
3081
|
-
console.
|
|
3110
|
+
console.warn("getRectByTaro获取失败", { stickyRect, curRootRect });
|
|
3082
3111
|
}
|
|
3083
3112
|
};
|
|
3084
3113
|
const getElement = useCallback(() => {
|
|
@@ -3104,7 +3133,7 @@ const Sticky = (props) => {
|
|
|
3104
3133
|
{
|
|
3105
3134
|
ref: rootRef,
|
|
3106
3135
|
style: rootStyle,
|
|
3107
|
-
className: classNames(classPrefix$
|
|
3136
|
+
className: classNames(classPrefix$i, className),
|
|
3108
3137
|
...rest
|
|
3109
3138
|
},
|
|
3110
3139
|
/* @__PURE__ */ React.createElement(
|
|
@@ -5484,11 +5513,12 @@ Popup.defaultProps = defaultProps$1e;
|
|
|
5484
5513
|
Popup.displayName = "NutPopup";
|
|
5485
5514
|
const OffsetContext = createContext(20);
|
|
5486
5515
|
const defaultProps$1d = {
|
|
5487
|
-
|
|
5516
|
+
...ComponentDefaults,
|
|
5488
5517
|
position: "left",
|
|
5489
5518
|
width: "80%"
|
|
5490
5519
|
};
|
|
5491
5520
|
const SideNavBar = (props) => {
|
|
5521
|
+
const classPrefix2 = "nut-sidenavbar";
|
|
5492
5522
|
const {
|
|
5493
5523
|
title,
|
|
5494
5524
|
visible,
|
|
@@ -5496,14 +5526,13 @@ const SideNavBar = (props) => {
|
|
|
5496
5526
|
position,
|
|
5497
5527
|
children,
|
|
5498
5528
|
className,
|
|
5499
|
-
showhead,
|
|
5500
5529
|
onClose,
|
|
5501
5530
|
...rest
|
|
5502
5531
|
} = {
|
|
5503
5532
|
...defaultProps$1d,
|
|
5504
5533
|
...props
|
|
5505
5534
|
};
|
|
5506
|
-
const
|
|
5535
|
+
const indent = props.indent ? Number(props.indent) : 20;
|
|
5507
5536
|
const [sidenavbarShow, setSidenavbarShow] = useState(true);
|
|
5508
5537
|
const handleClick = () => {
|
|
5509
5538
|
setSidenavbarShow(!sidenavbarShow);
|
|
@@ -5516,49 +5545,43 @@ const SideNavBar = (props) => {
|
|
|
5516
5545
|
position,
|
|
5517
5546
|
onClose
|
|
5518
5547
|
},
|
|
5519
|
-
/* @__PURE__ */ React.createElement(
|
|
5548
|
+
/* @__PURE__ */ React.createElement("div", { className: classNames(className, classPrefix2), ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__content` }, /* @__PURE__ */ React.createElement(
|
|
5520
5549
|
"div",
|
|
5521
5550
|
{
|
|
5522
|
-
className:
|
|
5523
|
-
|
|
5551
|
+
className: `${classPrefix2}__list ${sidenavbarShow ? "sidenavbar-show" : "sidenavbar-hide"}`,
|
|
5552
|
+
onClick: handleClick
|
|
5524
5553
|
},
|
|
5525
|
-
/* @__PURE__ */ React.createElement(
|
|
5554
|
+
/* @__PURE__ */ React.createElement(
|
|
5526
5555
|
"div",
|
|
5527
5556
|
{
|
|
5528
|
-
className:
|
|
5529
|
-
|
|
5557
|
+
className: `${classPrefix2}__title ${classPrefix2}-border-bt`,
|
|
5558
|
+
style: { paddingLeft: `${indent}px` }
|
|
5530
5559
|
},
|
|
5560
|
+
title,
|
|
5531
5561
|
/* @__PURE__ */ React.createElement(
|
|
5532
|
-
"
|
|
5562
|
+
"i",
|
|
5533
5563
|
{
|
|
5534
|
-
className:
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
{
|
|
5541
|
-
className: `arrow-icon ${sidenavbarShow ? "arrow-up" : "arrow-down"}`
|
|
5542
|
-
}
|
|
5543
|
-
)
|
|
5544
|
-
),
|
|
5545
|
-
/* @__PURE__ */ React.createElement(OffsetContext.Provider, { value: offset }, /* @__PURE__ */ React.createElement("div", { className: "nut-sidenavbar__content" }, children))
|
|
5546
|
-
))
|
|
5547
|
-
)
|
|
5564
|
+
className: `arrow-icon ${sidenavbarShow ? "arrow-up" : "arrow-down"}`
|
|
5565
|
+
}
|
|
5566
|
+
)
|
|
5567
|
+
),
|
|
5568
|
+
/* @__PURE__ */ React.createElement(OffsetContext.Provider, { value: indent }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__content` }, children))
|
|
5569
|
+
)))
|
|
5548
5570
|
);
|
|
5549
5571
|
};
|
|
5550
5572
|
SideNavBar.defaultProps = defaultProps$1d;
|
|
5551
5573
|
SideNavBar.displayName = "NutSideNavBar";
|
|
5552
5574
|
const SideNavBarItem = (props) => {
|
|
5553
|
-
const
|
|
5575
|
+
const classPrefix2 = "nut-subsidenavbar";
|
|
5576
|
+
const { title, value, children, onClick, ...rest } = props;
|
|
5554
5577
|
const clickFn = (e) => {
|
|
5555
5578
|
e.stopPropagation();
|
|
5556
|
-
onClick && onClick({ title,
|
|
5579
|
+
onClick && onClick({ title, value });
|
|
5557
5580
|
};
|
|
5558
5581
|
return /* @__PURE__ */ React.createElement(
|
|
5559
5582
|
"div",
|
|
5560
5583
|
{
|
|
5561
|
-
className:
|
|
5584
|
+
className: `${classPrefix2}__item ${classPrefix2}-border-bt`,
|
|
5562
5585
|
onClick: clickFn,
|
|
5563
5586
|
...rest
|
|
5564
5587
|
},
|
|
@@ -5569,7 +5592,8 @@ const defaultProps$1c = {
|
|
|
5569
5592
|
open: true
|
|
5570
5593
|
};
|
|
5571
5594
|
const SubSideNavBar = (props) => {
|
|
5572
|
-
const
|
|
5595
|
+
const classPrefix2 = "nut-subsidenavbar";
|
|
5596
|
+
const { title, value, children, onClick, open, ...rest } = {
|
|
5573
5597
|
...defaultProps$1c,
|
|
5574
5598
|
...props
|
|
5575
5599
|
};
|
|
@@ -5579,7 +5603,7 @@ const SubSideNavBar = (props) => {
|
|
|
5579
5603
|
const setListLevel = useCallback(
|
|
5580
5604
|
(nodeList, level = 1) => {
|
|
5581
5605
|
const titleClass = nodeList[0].className;
|
|
5582
|
-
if (titleClass.includes(
|
|
5606
|
+
if (titleClass.includes(`${classPrefix2}__title`)) {
|
|
5583
5607
|
const left = offset * (level + 1);
|
|
5584
5608
|
nodeList[0].style.paddingLeft = `${left}px`;
|
|
5585
5609
|
}
|
|
@@ -5588,11 +5612,11 @@ const SubSideNavBar = (props) => {
|
|
|
5588
5612
|
);
|
|
5589
5613
|
childNodes.forEach((item) => {
|
|
5590
5614
|
const itemClass = item.className;
|
|
5591
|
-
if (itemClass.includes(
|
|
5615
|
+
if (itemClass.includes(`${classPrefix2}__item`)) {
|
|
5592
5616
|
const left = offset * (level + 2);
|
|
5593
5617
|
item.style.paddingLeft = `${left}px`;
|
|
5594
5618
|
}
|
|
5595
|
-
if (itemClass.includes(
|
|
5619
|
+
if (itemClass.includes(`${classPrefix2}__list`)) {
|
|
5596
5620
|
let level2 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
|
|
5597
5621
|
level2 += 1;
|
|
5598
5622
|
item.setAttribute("level", level2.toString());
|
|
@@ -5606,7 +5630,7 @@ const SubSideNavBar = (props) => {
|
|
|
5606
5630
|
e.stopPropagation();
|
|
5607
5631
|
setSubShow(!subShow);
|
|
5608
5632
|
const isShow = !subShow;
|
|
5609
|
-
onClick && onClick({ title,
|
|
5633
|
+
onClick && onClick({ title, value, isShow });
|
|
5610
5634
|
};
|
|
5611
5635
|
useEffect(() => {
|
|
5612
5636
|
var _a, _b;
|
|
@@ -5614,9 +5638,9 @@ const SubSideNavBar = (props) => {
|
|
|
5614
5638
|
(_b = listRef.current) == null ? void 0 : _b.setAttribute("level", "1");
|
|
5615
5639
|
childNodes && setListLevel(childNodes);
|
|
5616
5640
|
}, [setListLevel]);
|
|
5617
|
-
const divClass = subShow ?
|
|
5641
|
+
const divClass = subShow ? `${classPrefix2}__list sidenavbar-show` : `${classPrefix2}__list sidenavbar-hide`;
|
|
5618
5642
|
const iconClass = subShow ? "arrow-icon arrow-down" : "arrow-icon arrow-up";
|
|
5619
|
-
return /* @__PURE__ */ React.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest }, /* @__PURE__ */ React.createElement("div", { className:
|
|
5643
|
+
return /* @__PURE__ */ React.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest }, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__title ${classPrefix2}-border-bt` }, title, " ", /* @__PURE__ */ React.createElement("i", { className: iconClass })), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__content` }, children));
|
|
5620
5644
|
};
|
|
5621
5645
|
function usePropsValue({
|
|
5622
5646
|
value,
|
|
@@ -5818,7 +5842,7 @@ const defaultProps$17 = {
|
|
|
5818
5842
|
duration: 300,
|
|
5819
5843
|
autoHeight: false
|
|
5820
5844
|
};
|
|
5821
|
-
const classPrefix$
|
|
5845
|
+
const classPrefix$h = "nut-tabs";
|
|
5822
5846
|
const Tabs = (props) => {
|
|
5823
5847
|
const {
|
|
5824
5848
|
activeColor,
|
|
@@ -5880,14 +5904,14 @@ const Tabs = (props) => {
|
|
|
5880
5904
|
}
|
|
5881
5905
|
}, [children]);
|
|
5882
5906
|
const classes = classNames(
|
|
5883
|
-
classPrefix$
|
|
5884
|
-
`${classPrefix$
|
|
5907
|
+
classPrefix$h,
|
|
5908
|
+
`${classPrefix$h}--${direction}`,
|
|
5885
5909
|
className
|
|
5886
5910
|
);
|
|
5887
|
-
const classesTitle = classNames(`${classPrefix$
|
|
5888
|
-
[`${classPrefix$
|
|
5889
|
-
[`${classPrefix$
|
|
5890
|
-
[`${classPrefix$
|
|
5911
|
+
const classesTitle = classNames(`${classPrefix$h}__titles`, {
|
|
5912
|
+
[`${classPrefix$h}__titles--${activeType}`]: activeType,
|
|
5913
|
+
[`${classPrefix$h}__titles--scrollable`]: true,
|
|
5914
|
+
[`${classPrefix$h}__titles--${align}`]: align
|
|
5891
5915
|
});
|
|
5892
5916
|
const tabsActiveStyle = {
|
|
5893
5917
|
color: activeType === "smile" ? activeColor : "",
|
|
@@ -5933,7 +5957,7 @@ const Tabs = (props) => {
|
|
|
5933
5957
|
onClick: (e) => {
|
|
5934
5958
|
tabChange(item);
|
|
5935
5959
|
},
|
|
5936
|
-
className: classNames(`${classPrefix$
|
|
5960
|
+
className: classNames(`${classPrefix$h}__titles-item`, {
|
|
5937
5961
|
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
5938
5962
|
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
5939
5963
|
[`nut-tabs__titles-item--${align}`]: align
|
|
@@ -5943,14 +5967,14 @@ const Tabs = (props) => {
|
|
|
5943
5967
|
activeType === "line" && /* @__PURE__ */ React.createElement(
|
|
5944
5968
|
View,
|
|
5945
5969
|
{
|
|
5946
|
-
className: `${classPrefix$
|
|
5970
|
+
className: `${classPrefix$h}__titles-item__line`,
|
|
5947
5971
|
style: tabsActiveStyle
|
|
5948
5972
|
}
|
|
5949
5973
|
),
|
|
5950
5974
|
activeType === "smile" && /* @__PURE__ */ React.createElement(
|
|
5951
5975
|
View,
|
|
5952
5976
|
{
|
|
5953
|
-
className: `${classPrefix$
|
|
5977
|
+
className: `${classPrefix$h}__titles-item__smile`,
|
|
5954
5978
|
style: tabsActiveStyle
|
|
5955
5979
|
},
|
|
5956
5980
|
/* @__PURE__ */ React.createElement(a$j, { color: activeColor, width: 40, height: 20 })
|
|
@@ -5962,14 +5986,14 @@ const Tabs = (props) => {
|
|
|
5962
5986
|
{
|
|
5963
5987
|
ellipsis: true
|
|
5964
5988
|
},
|
|
5965
|
-
`${classPrefix$
|
|
5989
|
+
`${classPrefix$h}__titles-item__text`
|
|
5966
5990
|
)
|
|
5967
5991
|
},
|
|
5968
5992
|
item.title
|
|
5969
5993
|
)
|
|
5970
5994
|
);
|
|
5971
5995
|
})
|
|
5972
|
-
), /* @__PURE__ */ React.createElement(View, { className: `${classPrefix$
|
|
5996
|
+
), /* @__PURE__ */ React.createElement(View, { className: `${classPrefix$h}__content__wrap` }, /* @__PURE__ */ React.createElement(View, { className: `${classPrefix$h}__content`, style: contentStyle }, React.Children.map(children, (child, idx) => {
|
|
5973
5997
|
if (!React.isValidElement(child)) {
|
|
5974
5998
|
return null;
|
|
5975
5999
|
}
|
|
@@ -8070,7 +8094,7 @@ const defaultProps$$ = {
|
|
|
8070
8094
|
},
|
|
8071
8095
|
options: []
|
|
8072
8096
|
};
|
|
8073
|
-
const classPrefix$
|
|
8097
|
+
const classPrefix$g = "nut-checkboxgroup";
|
|
8074
8098
|
const CheckboxGroup = React.forwardRef(
|
|
8075
8099
|
(props, ref) => {
|
|
8076
8100
|
const { children } = { ...defaultProps$$, ...props };
|
|
@@ -8152,7 +8176,7 @@ const CheckboxGroup = React.forwardRef(
|
|
|
8152
8176
|
/* @__PURE__ */ React.createElement(
|
|
8153
8177
|
"div",
|
|
8154
8178
|
{
|
|
8155
|
-
className: classNames(classPrefix$
|
|
8179
|
+
className: classNames(classPrefix$g, className, {
|
|
8156
8180
|
[`nut-checkboxgroup--${props.direction}`]: props.direction
|
|
8157
8181
|
}),
|
|
8158
8182
|
...rest
|
|
@@ -8174,7 +8198,7 @@ const defaultProps$_ = {
|
|
|
8174
8198
|
onChange: (value) => {
|
|
8175
8199
|
}
|
|
8176
8200
|
};
|
|
8177
|
-
const classPrefix$
|
|
8201
|
+
const classPrefix$f = "nut-checkbox";
|
|
8178
8202
|
const Checkbox = (props) => {
|
|
8179
8203
|
const { children } = {
|
|
8180
8204
|
...defaultProps$_,
|
|
@@ -8236,22 +8260,22 @@ const Checkbox = (props) => {
|
|
|
8236
8260
|
};
|
|
8237
8261
|
const color = () => {
|
|
8238
8262
|
if (innerDisabled) {
|
|
8239
|
-
return `${classPrefix$
|
|
8263
|
+
return `${classPrefix$f}__icon--disable`;
|
|
8240
8264
|
}
|
|
8241
8265
|
if (innerChecked) {
|
|
8242
8266
|
if (innerIndeterminate) {
|
|
8243
|
-
return `${classPrefix$
|
|
8267
|
+
return `${classPrefix$f}__icon--indeterminate`;
|
|
8244
8268
|
}
|
|
8245
|
-
return `${classPrefix$
|
|
8269
|
+
return `${classPrefix$f}__icon`;
|
|
8246
8270
|
}
|
|
8247
|
-
return `${classPrefix$
|
|
8271
|
+
return `${classPrefix$f}__icon--unchecked`;
|
|
8248
8272
|
};
|
|
8249
8273
|
const renderLabel = () => {
|
|
8250
8274
|
return /* @__PURE__ */ React.createElement(
|
|
8251
8275
|
"span",
|
|
8252
8276
|
{
|
|
8253
|
-
className: classNames(`${classPrefix$
|
|
8254
|
-
[`${classPrefix$
|
|
8277
|
+
className: classNames(`${classPrefix$f}__label `, {
|
|
8278
|
+
[`${classPrefix$f}__label--disabled`]: innerDisabled
|
|
8255
8279
|
})
|
|
8256
8280
|
},
|
|
8257
8281
|
children || label
|
|
@@ -8270,8 +8294,8 @@ const Checkbox = (props) => {
|
|
|
8270
8294
|
return /* @__PURE__ */ React.createElement(
|
|
8271
8295
|
"div",
|
|
8272
8296
|
{
|
|
8273
|
-
className: classNames(classPrefix$
|
|
8274
|
-
[`${classPrefix$
|
|
8297
|
+
className: classNames(classPrefix$f, className, {
|
|
8298
|
+
[`${classPrefix$f}--reverse`]: labelPosition === "left"
|
|
8275
8299
|
}),
|
|
8276
8300
|
...rest,
|
|
8277
8301
|
onClick: handleClick
|
|
@@ -8620,6 +8644,7 @@ const defaultProps$Z = {
|
|
|
8620
8644
|
const InternalPicker = (props, ref) => {
|
|
8621
8645
|
const { locale } = useConfig$1();
|
|
8622
8646
|
const {
|
|
8647
|
+
children,
|
|
8623
8648
|
visible,
|
|
8624
8649
|
title,
|
|
8625
8650
|
options = [],
|
|
@@ -8645,6 +8670,7 @@ const InternalPicker = (props, ref) => {
|
|
|
8645
8670
|
(_a = props.onConfirm) == null ? void 0 : _a.call(props, setSelectedOptions(), val);
|
|
8646
8671
|
}
|
|
8647
8672
|
});
|
|
8673
|
+
const [innerValue, setInnerValue] = useState(selectedValue);
|
|
8648
8674
|
const [currentValue, setCurrentValue] = useState([]);
|
|
8649
8675
|
const [columnIndex, setColumnIndex] = useState(0);
|
|
8650
8676
|
const pickerRef = useRef(null);
|
|
@@ -8685,41 +8711,52 @@ const InternalPicker = (props, ref) => {
|
|
|
8685
8711
|
}
|
|
8686
8712
|
return "single";
|
|
8687
8713
|
};
|
|
8688
|
-
const normalListData = () => {
|
|
8714
|
+
const normalListData = (innerValue2) => {
|
|
8689
8715
|
const type = columnsType();
|
|
8690
8716
|
switch (type) {
|
|
8691
8717
|
case "multiple":
|
|
8692
8718
|
return options;
|
|
8693
8719
|
case "cascade":
|
|
8694
|
-
return formatCascade(options,
|
|
8720
|
+
return formatCascade(options, innerValue2);
|
|
8695
8721
|
default:
|
|
8696
8722
|
return [options];
|
|
8697
8723
|
}
|
|
8698
8724
|
};
|
|
8699
8725
|
const init = () => {
|
|
8700
|
-
const normalData = normalListData(
|
|
8726
|
+
const normalData = normalListData(
|
|
8727
|
+
innerValue
|
|
8728
|
+
);
|
|
8701
8729
|
setColumnsList(normalData);
|
|
8702
8730
|
const data = [];
|
|
8703
8731
|
normalData.length > 0 && normalData.map((item) => {
|
|
8704
8732
|
item[0] && data.push(item[0].value);
|
|
8705
8733
|
return item;
|
|
8706
8734
|
});
|
|
8707
|
-
if (!
|
|
8708
|
-
|
|
8735
|
+
if (!innerValue.length && innerValue.length === 0) {
|
|
8736
|
+
setInnerValue([...data]);
|
|
8709
8737
|
}
|
|
8710
8738
|
};
|
|
8739
|
+
useEffect(() => {
|
|
8740
|
+
setInnerValue(innerValue !== selectedValue ? selectedValue : innerValue);
|
|
8741
|
+
}, [visible]);
|
|
8742
|
+
useEffect(() => {
|
|
8743
|
+
if (visible) {
|
|
8744
|
+
init();
|
|
8745
|
+
}
|
|
8746
|
+
}, [options, visible]);
|
|
8711
8747
|
useEffect(() => {
|
|
8712
8748
|
if (!visible) {
|
|
8713
8749
|
return;
|
|
8714
8750
|
}
|
|
8715
|
-
|
|
8716
|
-
|
|
8751
|
+
Taro.getEnv() !== "WEB" && setCurrentValue(defaultValuesConvert());
|
|
8752
|
+
onChange && onChange(setSelectedOptions(), innerValue, columnIndex);
|
|
8753
|
+
}, [innerValue, columnsList, visible]);
|
|
8717
8754
|
const setSelectedOptions = () => {
|
|
8718
8755
|
const options2 = [];
|
|
8719
8756
|
let currOptions = [];
|
|
8720
8757
|
columnsList.forEach((columnOptions, index) => {
|
|
8721
8758
|
currOptions = columnOptions.filter(
|
|
8722
|
-
(item) => item.value ===
|
|
8759
|
+
(item) => item.value === innerValue[index]
|
|
8723
8760
|
);
|
|
8724
8761
|
if (currOptions[0]) {
|
|
8725
8762
|
options2.push(currOptions[0]);
|
|
@@ -8731,8 +8768,8 @@ const InternalPicker = (props, ref) => {
|
|
|
8731
8768
|
};
|
|
8732
8769
|
const defaultValuesConvert = () => {
|
|
8733
8770
|
const defaultIndexs = [];
|
|
8734
|
-
if (
|
|
8735
|
-
|
|
8771
|
+
if (innerValue.length > 0) {
|
|
8772
|
+
innerValue.forEach((value, index) => {
|
|
8736
8773
|
var _a;
|
|
8737
8774
|
for (let i = 0; i < ((_a = columnsList == null ? void 0 : columnsList[index]) == null ? void 0 : _a.length); i++) {
|
|
8738
8775
|
if (columnsList[index][i].value === value) {
|
|
@@ -8749,37 +8786,30 @@ const InternalPicker = (props, ref) => {
|
|
|
8749
8786
|
}
|
|
8750
8787
|
return defaultIndexs;
|
|
8751
8788
|
};
|
|
8752
|
-
useEffect(() => {
|
|
8753
|
-
if (!visible) {
|
|
8754
|
-
return;
|
|
8755
|
-
}
|
|
8756
|
-
Taro.getEnv() !== "WEB" && setCurrentValue(defaultValuesConvert());
|
|
8757
|
-
onChange && onChange(setSelectedOptions(), selectedValue, columnIndex);
|
|
8758
|
-
if (isConfirmEvent.current) {
|
|
8759
|
-
isConfirmEvent.current = false;
|
|
8760
|
-
onConfirm && onConfirm(setSelectedOptions(), selectedValue);
|
|
8761
|
-
}
|
|
8762
|
-
}, [selectedValue, columnsList, visible]);
|
|
8763
8789
|
const chooseItem = (columnOptions, columnIndex2) => {
|
|
8764
8790
|
var _a, _b;
|
|
8791
|
+
const values = [];
|
|
8792
|
+
const start = columnIndex2;
|
|
8765
8793
|
if (columnOptions && Object.keys(columnOptions).length) {
|
|
8766
|
-
if (
|
|
8794
|
+
if (values[columnIndex2] !== columnOptions.value) {
|
|
8767
8795
|
if (columnsType() === "cascade") {
|
|
8768
|
-
|
|
8769
|
-
setSelectedValue([...selectedValue]);
|
|
8796
|
+
values[columnIndex2] = columnOptions.value || "";
|
|
8770
8797
|
while ((_a = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a[0]) {
|
|
8771
|
-
|
|
8772
|
-
setSelectedValue([...selectedValue]);
|
|
8798
|
+
values[columnIndex2 + 1] = columnOptions.children[0].value;
|
|
8773
8799
|
columnIndex2++;
|
|
8774
8800
|
columnOptions = columnOptions.children[0];
|
|
8775
8801
|
}
|
|
8776
8802
|
if ((_b = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _b.length) {
|
|
8777
|
-
|
|
8778
|
-
setSelectedValue([...selectedValue]);
|
|
8803
|
+
values[columnIndex2 + 1] = "";
|
|
8779
8804
|
}
|
|
8780
|
-
|
|
8805
|
+
const combineResult = [
|
|
8806
|
+
...innerValue.slice(0, start),
|
|
8807
|
+
...values.splice(start)
|
|
8808
|
+
];
|
|
8809
|
+
setInnerValue(combineResult);
|
|
8810
|
+
setColumnsList(normalListData(combineResult));
|
|
8781
8811
|
} else {
|
|
8782
|
-
|
|
8812
|
+
setInnerValue((data) => {
|
|
8783
8813
|
const cdata = [...data];
|
|
8784
8814
|
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
|
|
8785
8815
|
columnOptions,
|
|
@@ -8793,16 +8823,16 @@ const InternalPicker = (props, ref) => {
|
|
|
8793
8823
|
}
|
|
8794
8824
|
};
|
|
8795
8825
|
const confirm = () => {
|
|
8796
|
-
let
|
|
8826
|
+
let moving = false;
|
|
8797
8827
|
refs.forEach((ref2) => {
|
|
8798
8828
|
if (ref2.moving)
|
|
8799
|
-
|
|
8829
|
+
moving = true;
|
|
8800
8830
|
ref2.stopMomentum();
|
|
8801
8831
|
});
|
|
8802
|
-
if (
|
|
8832
|
+
if (moving) {
|
|
8803
8833
|
isConfirmEvent.current = true;
|
|
8804
8834
|
} else {
|
|
8805
|
-
|
|
8835
|
+
setSelectedValue(innerValue);
|
|
8806
8836
|
closePicker();
|
|
8807
8837
|
}
|
|
8808
8838
|
setTimeout(() => {
|
|
@@ -8810,8 +8840,8 @@ const InternalPicker = (props, ref) => {
|
|
|
8810
8840
|
}, 0);
|
|
8811
8841
|
};
|
|
8812
8842
|
const closePicker = () => {
|
|
8813
|
-
onClose && onClose(setSelectedOptions(),
|
|
8814
|
-
afterClose && afterClose(setSelectedOptions(),
|
|
8843
|
+
onClose && onClose(setSelectedOptions(), innerValue);
|
|
8844
|
+
afterClose && afterClose(setSelectedOptions(), innerValue, pickerRef);
|
|
8815
8845
|
};
|
|
8816
8846
|
const renderTitleBar = () => {
|
|
8817
8847
|
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__control` }, /* @__PURE__ */ React.createElement(
|
|
@@ -8823,7 +8853,7 @@ const InternalPicker = (props, ref) => {
|
|
|
8823
8853
|
locale.cancel
|
|
8824
8854
|
), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__title` }, title || ""), /* @__PURE__ */ React.createElement("span", { className: `${classPrefix2}__confirm-btn`, onClick: confirm }, locale.confirm));
|
|
8825
8855
|
};
|
|
8826
|
-
const [
|
|
8856
|
+
const [, setPickingStatus] = useState(false);
|
|
8827
8857
|
const pickerStart = () => {
|
|
8828
8858
|
setPickingStatus(true);
|
|
8829
8859
|
};
|
|
@@ -8854,12 +8884,12 @@ const InternalPicker = (props, ref) => {
|
|
|
8854
8884
|
closePicker();
|
|
8855
8885
|
}
|
|
8856
8886
|
},
|
|
8857
|
-
/* @__PURE__ */ React.createElement(View, { className: classes, style, ...rest, catchMove: true }, renderTitleBar(), /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__panel`, ref: pickerRef }, Taro.getEnv() === "WEB" ? columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
8887
|
+
/* @__PURE__ */ React.createElement(View, { className: classes, style, ...rest, catchMove: true }, renderTitleBar(), children, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__panel`, ref: pickerRef }, Taro.getEnv() === "WEB" ? columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
8858
8888
|
return /* @__PURE__ */ React.createElement(
|
|
8859
8889
|
PickerPanel$1,
|
|
8860
8890
|
{
|
|
8861
8891
|
ref: setRefs(index),
|
|
8862
|
-
defaultValue:
|
|
8892
|
+
defaultValue: innerValue == null ? void 0 : innerValue[index],
|
|
8863
8893
|
options: item,
|
|
8864
8894
|
threeDimensional,
|
|
8865
8895
|
chooseItem: (value, index2) => chooseItem(value, index2),
|
|
@@ -9709,7 +9739,7 @@ const defaultProps$U = {
|
|
|
9709
9739
|
digits: 0,
|
|
9710
9740
|
async: false
|
|
9711
9741
|
};
|
|
9712
|
-
const classPrefix$
|
|
9742
|
+
const classPrefix$e = `nut-inputnumber`;
|
|
9713
9743
|
const InputNumber = (props) => {
|
|
9714
9744
|
const {
|
|
9715
9745
|
children,
|
|
@@ -9752,8 +9782,8 @@ const InputNumber = (props) => {
|
|
|
9752
9782
|
}, []);
|
|
9753
9783
|
const classes = classNames(
|
|
9754
9784
|
{
|
|
9755
|
-
[`${classPrefix$
|
|
9756
|
-
[`${classPrefix$
|
|
9785
|
+
[`${classPrefix$e}`]: true,
|
|
9786
|
+
[`${classPrefix$e}--disabled`]: disabled
|
|
9757
9787
|
},
|
|
9758
9788
|
className
|
|
9759
9789
|
);
|
|
@@ -9926,7 +9956,7 @@ InputNumber.displayName = "NutInputNumber";
|
|
|
9926
9956
|
const defaultProps$T = {
|
|
9927
9957
|
...ComponentDefaults,
|
|
9928
9958
|
activeColor: "",
|
|
9929
|
-
|
|
9959
|
+
closeOnOverlayClick: true,
|
|
9930
9960
|
scrollFixed: false,
|
|
9931
9961
|
lockScroll: true,
|
|
9932
9962
|
icon: null
|
|
@@ -9937,7 +9967,7 @@ const Menu = (props) => {
|
|
|
9937
9967
|
icon,
|
|
9938
9968
|
scrollFixed,
|
|
9939
9969
|
lockScroll,
|
|
9940
|
-
|
|
9970
|
+
closeOnOverlayClick,
|
|
9941
9971
|
children,
|
|
9942
9972
|
activeColor,
|
|
9943
9973
|
...rest
|
|
@@ -9986,7 +10016,7 @@ const Menu = (props) => {
|
|
|
9986
10016
|
index,
|
|
9987
10017
|
activeColor,
|
|
9988
10018
|
parent: {
|
|
9989
|
-
|
|
10019
|
+
closeOnOverlayClick,
|
|
9990
10020
|
lockScroll,
|
|
9991
10021
|
toggleMenuItem,
|
|
9992
10022
|
updateTitle,
|
|
@@ -10399,7 +10429,7 @@ const defaultProps$Q = {
|
|
|
10399
10429
|
direction: "vertical",
|
|
10400
10430
|
options: []
|
|
10401
10431
|
};
|
|
10402
|
-
const classPrefix$
|
|
10432
|
+
const classPrefix$d = "nut-radiogroup";
|
|
10403
10433
|
const RadioGroup = React.forwardRef(
|
|
10404
10434
|
(props, ref) => {
|
|
10405
10435
|
const {
|
|
@@ -10455,8 +10485,8 @@ const RadioGroup = React.forwardRef(
|
|
|
10455
10485
|
/* @__PURE__ */ React.createElement(
|
|
10456
10486
|
"div",
|
|
10457
10487
|
{
|
|
10458
|
-
className: classNames(classPrefix$
|
|
10459
|
-
[`${classPrefix$
|
|
10488
|
+
className: classNames(classPrefix$d, className, {
|
|
10489
|
+
[`${classPrefix$d}--${props.direction}`]: props.direction
|
|
10460
10490
|
}),
|
|
10461
10491
|
...rest
|
|
10462
10492
|
},
|
|
@@ -11326,7 +11356,7 @@ const Signature = (props) => {
|
|
|
11326
11356
|
onConfirm && onConfirm(res2.tempFilePath);
|
|
11327
11357
|
},
|
|
11328
11358
|
fail: (res2) => {
|
|
11329
|
-
console.
|
|
11359
|
+
console.warn("保存失败");
|
|
11330
11360
|
}
|
|
11331
11361
|
});
|
|
11332
11362
|
});
|
|
@@ -11762,6 +11792,14 @@ const isFunction = (val) => typeof val === "function";
|
|
|
11762
11792
|
const isPromise = (val) => {
|
|
11763
11793
|
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
11764
11794
|
};
|
|
11795
|
+
const upperCaseFirst = (str) => {
|
|
11796
|
+
var str = str.toLowerCase();
|
|
11797
|
+
str = str.replace(
|
|
11798
|
+
/\b\w+\b/g,
|
|
11799
|
+
(word) => word.substring(0, 1).toUpperCase() + word.substring(1)
|
|
11800
|
+
);
|
|
11801
|
+
return str;
|
|
11802
|
+
};
|
|
11765
11803
|
const funcInterceptor = (interceptor, {
|
|
11766
11804
|
args = [],
|
|
11767
11805
|
done,
|
|
@@ -12589,7 +12627,7 @@ const defaultProps$C = {
|
|
|
12589
12627
|
imageSize: "",
|
|
12590
12628
|
status: "empty"
|
|
12591
12629
|
};
|
|
12592
|
-
const classPrefix$
|
|
12630
|
+
const classPrefix$c = `nut-empty`;
|
|
12593
12631
|
const Empty = (props) => {
|
|
12594
12632
|
const { locale } = useConfig$1();
|
|
12595
12633
|
defaultProps$C.description = locale.noData || defaultProps$C.description;
|
|
@@ -12625,7 +12663,7 @@ const Empty = (props) => {
|
|
|
12625
12663
|
};
|
|
12626
12664
|
});
|
|
12627
12665
|
}, [imageSize]);
|
|
12628
|
-
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
12666
|
+
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$c} ${className}`, ...rest }, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$c}__image`, style: imgStyle }, imageNode), typeof description === "string" ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$c}__description` }, description) : description, children));
|
|
12629
12667
|
};
|
|
12630
12668
|
Empty.defaultProps = defaultProps$C;
|
|
12631
12669
|
Empty.displayName = "NutEmpty";
|
|
@@ -13191,7 +13229,7 @@ const defaultProps$z = {
|
|
|
13191
13229
|
onClick: () => {
|
|
13192
13230
|
}
|
|
13193
13231
|
};
|
|
13194
|
-
const classPrefix$
|
|
13232
|
+
const classPrefix$b = "nut-notify";
|
|
13195
13233
|
const Notify = (props) => {
|
|
13196
13234
|
const {
|
|
13197
13235
|
id,
|
|
@@ -13242,10 +13280,10 @@ const Notify = (props) => {
|
|
|
13242
13280
|
onClose();
|
|
13243
13281
|
};
|
|
13244
13282
|
const classes = classNames({
|
|
13245
|
-
[`${classPrefix$
|
|
13246
|
-
[`${classPrefix$
|
|
13247
|
-
[`${classPrefix$
|
|
13248
|
-
[`${classPrefix$
|
|
13283
|
+
[`${classPrefix$b}--popup-top`]: position === "top",
|
|
13284
|
+
[`${classPrefix$b}--popup-bottom`]: position === "bottom",
|
|
13285
|
+
[`${classPrefix$b}`]: true,
|
|
13286
|
+
[`${classPrefix$b}--${type}`]: true
|
|
13249
13287
|
});
|
|
13250
13288
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
13251
13289
|
CSSTransition$1,
|
|
@@ -13271,165 +13309,264 @@ const Notify = (props) => {
|
|
|
13271
13309
|
};
|
|
13272
13310
|
Notify.defaultProps = defaultProps$z;
|
|
13273
13311
|
Notify.displayName = "NutNotify";
|
|
13274
|
-
function fillRef(ref, node) {
|
|
13275
|
-
if (typeof ref === "function") {
|
|
13276
|
-
ref(node);
|
|
13277
|
-
} else if (typeof ref === "object" && ref && "current" in ref) {
|
|
13278
|
-
ref.current = node;
|
|
13279
|
-
}
|
|
13280
|
-
}
|
|
13281
|
-
function composeRef(...refs) {
|
|
13282
|
-
return (node) => {
|
|
13283
|
-
refs.forEach((ref) => {
|
|
13284
|
-
fillRef(ref, node);
|
|
13285
|
-
});
|
|
13286
|
-
};
|
|
13287
|
-
}
|
|
13288
|
-
class Trigger extends React.Component {
|
|
13289
|
-
fireEvents(type, e) {
|
|
13290
|
-
const childCallback = this.props.children.props[type];
|
|
13291
|
-
if (childCallback) {
|
|
13292
|
-
childCallback(e);
|
|
13293
|
-
}
|
|
13294
|
-
const callback = this.props[type];
|
|
13295
|
-
if (callback) {
|
|
13296
|
-
callback(e);
|
|
13297
|
-
}
|
|
13298
|
-
}
|
|
13299
|
-
render() {
|
|
13300
|
-
const { children, className = "" } = this.props;
|
|
13301
|
-
const child = React.Children.only(children);
|
|
13302
|
-
const newChildProps = {
|
|
13303
|
-
key: "trigger"
|
|
13304
|
-
};
|
|
13305
|
-
if (child && child.props && child.props.className) {
|
|
13306
|
-
newChildProps.className = className;
|
|
13307
|
-
}
|
|
13308
|
-
const cloneProps = {
|
|
13309
|
-
...newChildProps
|
|
13310
|
-
};
|
|
13311
|
-
cloneProps.ref = composeRef(this.props.forwardedRef, child.ref);
|
|
13312
|
-
const trigger = React.cloneElement(child, cloneProps);
|
|
13313
|
-
return trigger;
|
|
13314
|
-
}
|
|
13315
|
-
}
|
|
13316
13312
|
const defaultProps$y = {
|
|
13317
13313
|
...ComponentDefaults,
|
|
13318
13314
|
list: [],
|
|
13319
|
-
theme: "light",
|
|
13320
13315
|
location: "bottom",
|
|
13321
13316
|
visible: false,
|
|
13322
|
-
offset:
|
|
13317
|
+
offset: [0, 12],
|
|
13318
|
+
targetId: "",
|
|
13323
13319
|
className: "",
|
|
13324
|
-
|
|
13320
|
+
background: "",
|
|
13321
|
+
color: "",
|
|
13322
|
+
showArrow: true,
|
|
13323
|
+
duration: 0.3,
|
|
13324
|
+
overlay: false,
|
|
13325
|
+
overlayClassName: "",
|
|
13326
|
+
overlayStyle: {},
|
|
13327
|
+
closeOnClickOutside: true,
|
|
13328
|
+
closeOnClickAction: true,
|
|
13329
|
+
closeOnOverlayClick: true,
|
|
13330
|
+
onClick: () => {
|
|
13331
|
+
},
|
|
13332
|
+
onOpen: () => {
|
|
13333
|
+
},
|
|
13334
|
+
onClose: () => {
|
|
13325
13335
|
},
|
|
13326
|
-
|
|
13336
|
+
onSelect: (item, index) => {
|
|
13327
13337
|
}
|
|
13328
13338
|
};
|
|
13339
|
+
const classPrefix$a = `nut-popover`;
|
|
13329
13340
|
const Popover = (props) => {
|
|
13330
13341
|
const {
|
|
13331
13342
|
children,
|
|
13332
13343
|
list,
|
|
13333
|
-
theme,
|
|
13334
13344
|
location,
|
|
13335
13345
|
visible,
|
|
13336
13346
|
offset,
|
|
13347
|
+
targetId,
|
|
13348
|
+
overlay,
|
|
13349
|
+
overlayStyle,
|
|
13350
|
+
overlayClassName,
|
|
13351
|
+
closeOnClickOutside,
|
|
13352
|
+
closeOnClickAction,
|
|
13353
|
+
closeOnOverlayClick,
|
|
13337
13354
|
className,
|
|
13355
|
+
showArrow,
|
|
13338
13356
|
style,
|
|
13357
|
+
background,
|
|
13358
|
+
color,
|
|
13339
13359
|
onClick,
|
|
13340
|
-
|
|
13360
|
+
onOpen,
|
|
13361
|
+
onClose,
|
|
13362
|
+
onSelect,
|
|
13341
13363
|
...reset
|
|
13342
13364
|
} = {
|
|
13343
13365
|
...defaultProps$y,
|
|
13344
13366
|
...props
|
|
13345
13367
|
};
|
|
13346
|
-
const
|
|
13347
|
-
|
|
13348
|
-
|
|
13349
|
-
const res = await getRectByTaro(goodItem.current);
|
|
13350
|
-
setElWidth(res == null ? void 0 : res.width);
|
|
13351
|
-
setElHeight(res == null ? void 0 : res.height);
|
|
13352
|
-
}
|
|
13353
|
-
});
|
|
13354
|
-
const [classes, setClasses] = useState("");
|
|
13368
|
+
const popoverRef = useRef(null);
|
|
13369
|
+
const popoverContentRef = useRef(null);
|
|
13370
|
+
const [showPopup, setShowPopup] = useState(false);
|
|
13355
13371
|
const [elWidth, setElWidth] = useState(0);
|
|
13356
13372
|
const [elHeight, setElHeight] = useState(0);
|
|
13357
|
-
const [
|
|
13358
|
-
const [popoverArrow, setPopoverArrow] = useState("");
|
|
13373
|
+
const [rootPosition, setRootPosition] = useState();
|
|
13359
13374
|
useEffect(() => {
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
const offNumer = Number(offset) ? Number(offset) : 0;
|
|
13366
|
-
const style2 = {};
|
|
13367
|
-
if (location.includes("top")) {
|
|
13368
|
-
style2.bottom = `${elHeight + offNumer}px`;
|
|
13369
|
-
} else if (location.includes("right")) {
|
|
13370
|
-
style2.left = `${elWidth + offNumer}px`;
|
|
13371
|
-
} else if (location.includes("left")) {
|
|
13372
|
-
style2.right = `${elWidth + offNumer}px`;
|
|
13373
|
-
} else {
|
|
13374
|
-
style2.top = `${elHeight + offNumer}px`;
|
|
13375
|
+
setShowPopup(visible);
|
|
13376
|
+
if (visible) {
|
|
13377
|
+
setTimeout(() => {
|
|
13378
|
+
getContentWidth();
|
|
13379
|
+
}, 0);
|
|
13375
13380
|
}
|
|
13376
|
-
|
|
13381
|
+
}, [visible]);
|
|
13382
|
+
const getContentWidth = async () => {
|
|
13383
|
+
let rect;
|
|
13384
|
+
if (targetId) {
|
|
13385
|
+
if (Taro.getEnv() == Taro.ENV_TYPE.WEB) {
|
|
13386
|
+
rect = getRect(document.querySelector(`#${targetId}`));
|
|
13387
|
+
} else {
|
|
13388
|
+
rect = await getRectTaro(targetId);
|
|
13389
|
+
}
|
|
13390
|
+
} else {
|
|
13391
|
+
rect = await getRectByTaro(popoverRef.current);
|
|
13392
|
+
}
|
|
13393
|
+
setRootPosition({
|
|
13394
|
+
width: rect.width,
|
|
13395
|
+
height: rect.height,
|
|
13396
|
+
left: rect.left,
|
|
13397
|
+
top: rect.top,
|
|
13398
|
+
right: rect.right
|
|
13399
|
+
});
|
|
13400
|
+
setTimeout(() => {
|
|
13401
|
+
getPopoverContentW();
|
|
13402
|
+
}, 300);
|
|
13377
13403
|
};
|
|
13378
|
-
const
|
|
13379
|
-
|
|
13380
|
-
|
|
13404
|
+
const getRectTaro = async (targetId2) => {
|
|
13405
|
+
return new Promise((resolve) => {
|
|
13406
|
+
const query = Taro.createSelectorQuery();
|
|
13407
|
+
query.select(`#${targetId2}`) && query.select(`#${targetId2}`).boundingClientRect();
|
|
13408
|
+
query.exec(function(res) {
|
|
13409
|
+
resolve(res[0]);
|
|
13410
|
+
});
|
|
13411
|
+
});
|
|
13381
13412
|
};
|
|
13382
|
-
const
|
|
13383
|
-
|
|
13384
|
-
|
|
13413
|
+
const getPopoverContentW = async () => {
|
|
13414
|
+
let rectContent = await getRectByTaro(popoverContentRef.current);
|
|
13415
|
+
setElWidth(rectContent.width);
|
|
13416
|
+
setElHeight(rectContent.height);
|
|
13385
13417
|
};
|
|
13386
|
-
const
|
|
13387
|
-
|
|
13388
|
-
|
|
13418
|
+
const clickAway = () => {
|
|
13419
|
+
if (closeOnClickOutside) {
|
|
13420
|
+
props.onClick && props.onClick();
|
|
13421
|
+
onClose && onClose();
|
|
13422
|
+
}
|
|
13389
13423
|
};
|
|
13390
|
-
const
|
|
13391
|
-
|
|
13392
|
-
|
|
13424
|
+
const classes = classNames(
|
|
13425
|
+
{
|
|
13426
|
+
[`${classPrefix$a}`]: true
|
|
13427
|
+
},
|
|
13428
|
+
className
|
|
13429
|
+
);
|
|
13430
|
+
const customStyle = () => {
|
|
13431
|
+
const styles = {};
|
|
13432
|
+
if (background) {
|
|
13433
|
+
styles.background = background;
|
|
13434
|
+
}
|
|
13435
|
+
if (color) {
|
|
13436
|
+
styles.color = color;
|
|
13437
|
+
}
|
|
13438
|
+
return styles;
|
|
13393
13439
|
};
|
|
13394
|
-
const
|
|
13395
|
-
|
|
13396
|
-
|
|
13440
|
+
const popoverArrow = () => {
|
|
13441
|
+
const prefixCls2 = "nut-popover-arrow";
|
|
13442
|
+
const loca = location;
|
|
13443
|
+
const direction = loca.split("-")[0];
|
|
13444
|
+
return `${prefixCls2} ${prefixCls2}-${direction} ${prefixCls2}--${loca}`;
|
|
13445
|
+
};
|
|
13446
|
+
const popoverArrowStyle = () => {
|
|
13447
|
+
const styles = {};
|
|
13448
|
+
const { background: background2 } = props;
|
|
13449
|
+
const direction = location.split("-")[0];
|
|
13450
|
+
if (background2) {
|
|
13451
|
+
styles[`border${upperCaseFirst(direction)}Color`] = background2;
|
|
13397
13452
|
}
|
|
13453
|
+
return styles;
|
|
13398
13454
|
};
|
|
13399
|
-
const
|
|
13455
|
+
const getRootPosition = () => {
|
|
13456
|
+
let styles = {};
|
|
13457
|
+
if (!rootPosition) {
|
|
13458
|
+
styles.visibility = "hidden";
|
|
13459
|
+
return styles;
|
|
13460
|
+
}
|
|
13461
|
+
const contentWidth = elWidth;
|
|
13462
|
+
const contentHeight = elHeight;
|
|
13463
|
+
const { width, height, left, top, right } = rootPosition;
|
|
13464
|
+
const direction = location.split("-")[0];
|
|
13465
|
+
const skew = location.split("-")[1];
|
|
13466
|
+
let cross = 0;
|
|
13467
|
+
let parallel = 0;
|
|
13468
|
+
if (Array.isArray(offset) && offset.length == 2) {
|
|
13469
|
+
cross += +offset[1];
|
|
13470
|
+
parallel += +offset[0];
|
|
13471
|
+
}
|
|
13472
|
+
if (width) {
|
|
13473
|
+
if (["bottom", "top"].includes(direction)) {
|
|
13474
|
+
const h = direction == "bottom" ? height + cross : -(contentHeight + cross);
|
|
13475
|
+
styles.top = `${top + h}px`;
|
|
13476
|
+
if (!skew) {
|
|
13477
|
+
styles.left = `${-(contentWidth - width) / 2 + left + parallel}px`;
|
|
13478
|
+
}
|
|
13479
|
+
if (skew == "start") {
|
|
13480
|
+
styles.left = `${left + parallel}px`;
|
|
13481
|
+
}
|
|
13482
|
+
if (skew == "end") {
|
|
13483
|
+
styles.left = `${right + parallel}px`;
|
|
13484
|
+
}
|
|
13485
|
+
}
|
|
13486
|
+
if (["left", "right"].includes(direction)) {
|
|
13487
|
+
const contentW = direction == "left" ? -(contentWidth + cross) : width + cross;
|
|
13488
|
+
styles.left = `${left + contentW}px`;
|
|
13489
|
+
if (!skew) {
|
|
13490
|
+
styles.top = `${top - contentHeight / 2 + height / 2 - 4 + parallel}px`;
|
|
13491
|
+
}
|
|
13492
|
+
if (skew == "start") {
|
|
13493
|
+
styles.top = `${top + parallel}px`;
|
|
13494
|
+
}
|
|
13495
|
+
if (skew == "end") {
|
|
13496
|
+
styles.top = `${top + height + parallel}px`;
|
|
13497
|
+
}
|
|
13498
|
+
}
|
|
13499
|
+
}
|
|
13500
|
+
if (elWidth === 0) {
|
|
13501
|
+
styles.visibility = "hidden";
|
|
13502
|
+
} else {
|
|
13503
|
+
styles.visibility = "initial";
|
|
13504
|
+
}
|
|
13505
|
+
return styles;
|
|
13506
|
+
};
|
|
13507
|
+
const handleSelect = (item, index) => {
|
|
13400
13508
|
if (!item.disabled) {
|
|
13401
|
-
|
|
13509
|
+
onSelect(item, index);
|
|
13510
|
+
}
|
|
13511
|
+
if (closeOnClickAction) {
|
|
13512
|
+
props.onClick && props.onClick();
|
|
13513
|
+
onClose && onClose();
|
|
13402
13514
|
}
|
|
13403
13515
|
};
|
|
13404
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
13516
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, !targetId && /* @__PURE__ */ React.createElement(
|
|
13405
13517
|
"div",
|
|
13406
13518
|
{
|
|
13407
|
-
className:
|
|
13408
|
-
|
|
13409
|
-
|
|
13519
|
+
className: "nut-popover-wrapper",
|
|
13520
|
+
ref: popoverRef,
|
|
13521
|
+
onClick: () => {
|
|
13522
|
+
props.onClick && props.onClick();
|
|
13523
|
+
if (!visible) {
|
|
13524
|
+
onOpen && onOpen();
|
|
13525
|
+
} else {
|
|
13526
|
+
onClose && onClose();
|
|
13527
|
+
}
|
|
13528
|
+
},
|
|
13529
|
+
style
|
|
13530
|
+
},
|
|
13531
|
+
Array.isArray(children) ? children[0] : children
|
|
13532
|
+
), /* @__PURE__ */ React.createElement("div", { className: classes, style: getRootPosition(), ...reset }, /* @__PURE__ */ React.createElement(
|
|
13533
|
+
Popup,
|
|
13534
|
+
{
|
|
13535
|
+
className: `nut-popover-content nut-popover-content--${location}`,
|
|
13536
|
+
style: customStyle(),
|
|
13537
|
+
position: "default",
|
|
13538
|
+
overlay,
|
|
13539
|
+
overlayStyle,
|
|
13540
|
+
overlayClassName,
|
|
13541
|
+
closeOnOverlayClick,
|
|
13542
|
+
visible: showPopup
|
|
13410
13543
|
},
|
|
13411
|
-
/* @__PURE__ */ React.createElement(
|
|
13544
|
+
/* @__PURE__ */ React.createElement("div", { className: "nut-popover-content-group", ref: popoverContentRef }, showArrow && /* @__PURE__ */ React.createElement("div", { className: popoverArrow(), style: popoverArrowStyle() }), Array.isArray(children) ? children[1] : "", list.map((item, index) => {
|
|
13412
13545
|
return /* @__PURE__ */ React.createElement(
|
|
13413
13546
|
"div",
|
|
13414
13547
|
{
|
|
13415
|
-
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13548
|
+
className: classNames(
|
|
13549
|
+
{
|
|
13550
|
+
"nut-popover-menu-item": true,
|
|
13551
|
+
"nut-popover-menu-disabled": item.disabled
|
|
13552
|
+
},
|
|
13553
|
+
item.className
|
|
13554
|
+
),
|
|
13555
|
+
key: item.key,
|
|
13556
|
+
onClick: () => handleSelect(item, index)
|
|
13420
13557
|
},
|
|
13421
13558
|
item.icon ? item.icon : null,
|
|
13422
|
-
/* @__PURE__ */ React.createElement("div", { className: "popover-menu-item-name" }, item.name)
|
|
13559
|
+
/* @__PURE__ */ React.createElement("div", { className: "nut-popover-menu-item-name" }, item.name)
|
|
13423
13560
|
);
|
|
13424
|
-
}))
|
|
13425
|
-
),
|
|
13426
|
-
|
|
13561
|
+
}))
|
|
13562
|
+
), showPopup && /* @__PURE__ */ React.createElement(
|
|
13563
|
+
"div",
|
|
13427
13564
|
{
|
|
13428
|
-
|
|
13429
|
-
onClick:
|
|
13430
|
-
|
|
13565
|
+
className: "nut-popover-content-bg",
|
|
13566
|
+
onClick: clickAway,
|
|
13567
|
+
onTouchMove: clickAway
|
|
13431
13568
|
}
|
|
13432
|
-
)
|
|
13569
|
+
)));
|
|
13433
13570
|
};
|
|
13434
13571
|
Popover.defaultProps = defaultProps$y;
|
|
13435
13572
|
Popover.displayName = "NutPopover";
|
|
@@ -13589,7 +13726,7 @@ const defaultProps$w = {
|
|
|
13589
13726
|
src: "",
|
|
13590
13727
|
alt: ""
|
|
13591
13728
|
};
|
|
13592
|
-
const classPrefix$
|
|
13729
|
+
const classPrefix$9 = `nut-avatar`;
|
|
13593
13730
|
const Avatar = (props) => {
|
|
13594
13731
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
13595
13732
|
const {
|
|
@@ -13621,7 +13758,7 @@ const Avatar = (props) => {
|
|
|
13621
13758
|
[`nut-avatar-${((_a = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a.size) || size || "normal"}`]: true,
|
|
13622
13759
|
[`nut-avatar-${((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || shape}`]: true
|
|
13623
13760
|
});
|
|
13624
|
-
const cls = classNames(classPrefix$
|
|
13761
|
+
const cls = classNames(classPrefix$9, classes, className);
|
|
13625
13762
|
const styles = {
|
|
13626
13763
|
width: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
13627
13764
|
height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
@@ -14042,7 +14179,7 @@ const defaultProps$t = {
|
|
|
14042
14179
|
}
|
|
14043
14180
|
// 未实现
|
|
14044
14181
|
};
|
|
14045
|
-
const classPrefix$
|
|
14182
|
+
const classPrefix$8 = "nut-toast";
|
|
14046
14183
|
const Toast = (props) => {
|
|
14047
14184
|
const {
|
|
14048
14185
|
children,
|
|
@@ -14123,21 +14260,21 @@ const Toast = (props) => {
|
|
|
14123
14260
|
{
|
|
14124
14261
|
visible: openState,
|
|
14125
14262
|
style,
|
|
14126
|
-
className: `${classPrefix$
|
|
14263
|
+
className: `${classPrefix$8}__overlay-default ${className}`,
|
|
14127
14264
|
closeOnOverlayClick,
|
|
14128
14265
|
onClick: () => {
|
|
14129
14266
|
clickCover();
|
|
14130
14267
|
}
|
|
14131
14268
|
},
|
|
14132
|
-
/* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
14269
|
+
/* @__PURE__ */ React.createElement("div", { className: `${classPrefix$8} ${classes}`, id }, /* @__PURE__ */ React.createElement(
|
|
14133
14270
|
"div",
|
|
14134
14271
|
{
|
|
14135
|
-
className: `${classPrefix$
|
|
14272
|
+
className: `${classPrefix$8}__inner ${classPrefix$8}-${position} ${contentClassName}`,
|
|
14136
14273
|
style: contentStyle
|
|
14137
14274
|
},
|
|
14138
|
-
hasIcon() ? /* @__PURE__ */ React.createElement("p", { className: `${classPrefix$
|
|
14139
|
-
title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
14140
|
-
/* @__PURE__ */ React.createElement("span", { className: `${classPrefix$
|
|
14275
|
+
hasIcon() ? /* @__PURE__ */ React.createElement("p", { className: `${classPrefix$8}__icon-wrapper` }, iconName()) : null,
|
|
14276
|
+
title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$8}-title` }, title) : null,
|
|
14277
|
+
/* @__PURE__ */ React.createElement("span", { className: `${classPrefix$8}-text` }, msg)
|
|
14141
14278
|
))
|
|
14142
14279
|
) : null);
|
|
14143
14280
|
};
|
|
@@ -14151,7 +14288,7 @@ const defaultProps$s = {
|
|
|
14151
14288
|
onClick: (event) => {
|
|
14152
14289
|
}
|
|
14153
14290
|
};
|
|
14154
|
-
const classPrefix$
|
|
14291
|
+
const classPrefix$7 = `nut-animate`;
|
|
14155
14292
|
const Animate = (props) => {
|
|
14156
14293
|
const { className, type, action, loop, onClick, children, ...rest } = {
|
|
14157
14294
|
...defaultProps$s,
|
|
@@ -14160,7 +14297,7 @@ const Animate = (props) => {
|
|
|
14160
14297
|
const [clicked, setClicked] = useState(false);
|
|
14161
14298
|
const classes = classNames({
|
|
14162
14299
|
"nut-ani-container": true,
|
|
14163
|
-
[`${classPrefix$
|
|
14300
|
+
[`${classPrefix$7}-${type}`]: action === "initial" || clicked ? type : false,
|
|
14164
14301
|
loop
|
|
14165
14302
|
});
|
|
14166
14303
|
const cls = classNames(classes, className);
|
|
@@ -14178,33 +14315,34 @@ const Animate = (props) => {
|
|
|
14178
14315
|
Animate.defaultProps = defaultProps$s;
|
|
14179
14316
|
Animate.displayName = "NutAnimate";
|
|
14180
14317
|
const defaultProps$r = {
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14318
|
+
...ComponentDefaults,
|
|
14319
|
+
length: 0,
|
|
14320
|
+
value: "",
|
|
14321
|
+
delay: 300,
|
|
14322
|
+
duration: 1,
|
|
14323
|
+
thousands: false
|
|
14187
14324
|
};
|
|
14188
14325
|
const CountUp = (props) => {
|
|
14189
14326
|
const {
|
|
14190
|
-
|
|
14191
|
-
|
|
14192
|
-
|
|
14193
|
-
|
|
14327
|
+
length,
|
|
14328
|
+
value,
|
|
14329
|
+
delay,
|
|
14330
|
+
duration,
|
|
14194
14331
|
className,
|
|
14195
14332
|
thousands,
|
|
14333
|
+
style,
|
|
14196
14334
|
...reset
|
|
14197
14335
|
} = {
|
|
14198
14336
|
...defaultProps$r,
|
|
14199
14337
|
...props
|
|
14200
14338
|
};
|
|
14201
|
-
const
|
|
14339
|
+
const classPrefix2 = "nut-countup";
|
|
14202
14340
|
const countupRef = useRef(null);
|
|
14203
14341
|
const timerRef = useRef(0);
|
|
14204
14342
|
const numbers = Array.from({ length: 10 }, (v, i) => i);
|
|
14205
14343
|
const getShowNumber = () => {
|
|
14206
|
-
const splitArr =
|
|
14207
|
-
const intNumber =
|
|
14344
|
+
const splitArr = value.split(".");
|
|
14345
|
+
const intNumber = length && splitArr[0].length < length ? (Array(length).join("0") + splitArr[0]).slice(-length) : splitArr[0];
|
|
14208
14346
|
const currNumber = `${thousands ? intNumber.replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") : intNumber}${splitArr[1] ? "." : ""}${splitArr[1] || ""}`;
|
|
14209
14347
|
return currNumber.split("");
|
|
14210
14348
|
};
|
|
@@ -14229,7 +14367,7 @@ const CountUp = (props) => {
|
|
|
14229
14367
|
};
|
|
14230
14368
|
const numberEaseStyle = (idx) => {
|
|
14231
14369
|
return {
|
|
14232
|
-
transition: `transform ${
|
|
14370
|
+
transition: `transform ${duration}s ease-in-out`,
|
|
14233
14371
|
transform: transformArr[idx] ? transformArr[idx] : null
|
|
14234
14372
|
};
|
|
14235
14373
|
};
|
|
@@ -14241,26 +14379,31 @@ const CountUp = (props) => {
|
|
|
14241
14379
|
isLoaded.current = true;
|
|
14242
14380
|
timerRef.current = window.setTimeout(() => {
|
|
14243
14381
|
setNumerArr(getShowNumber());
|
|
14244
|
-
},
|
|
14382
|
+
}, delay);
|
|
14245
14383
|
} else {
|
|
14246
14384
|
setNumerArr(getShowNumber());
|
|
14247
14385
|
}
|
|
14248
14386
|
return () => {
|
|
14249
14387
|
window.clearTimeout(timerRef.current);
|
|
14250
14388
|
};
|
|
14251
|
-
}, [
|
|
14252
|
-
return /* @__PURE__ */ React.createElement("div", { className: `${
|
|
14389
|
+
}, [value]);
|
|
14390
|
+
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2} ${className}`, ref: countupRef }, /* @__PURE__ */ React.createElement("ul", { className: `${classPrefix2}__list` }, numerArr.map((item, idx) => {
|
|
14253
14391
|
return /* @__PURE__ */ React.createElement(
|
|
14254
14392
|
"li",
|
|
14255
14393
|
{
|
|
14256
|
-
className: `${
|
|
14257
|
-
number: !Number.isNaN(Number(item))
|
|
14258
|
-
})}`,
|
|
14394
|
+
className: `${classPrefix2}__listitem ${!Number.isNaN(Number(item)) ? `${classPrefix2}__listitem--number` : ""}`,
|
|
14259
14395
|
key: idx
|
|
14260
14396
|
},
|
|
14261
|
-
!Number.isNaN(Number(item)) ? /* @__PURE__ */ React.createElement(
|
|
14262
|
-
|
|
14263
|
-
|
|
14397
|
+
!Number.isNaN(Number(item)) ? /* @__PURE__ */ React.createElement(
|
|
14398
|
+
"span",
|
|
14399
|
+
{
|
|
14400
|
+
className: `${classPrefix2}__number`,
|
|
14401
|
+
style: numberEaseStyle(idx)
|
|
14402
|
+
},
|
|
14403
|
+
[...numbers, ...numbers].map((number, subidx) => {
|
|
14404
|
+
return /* @__PURE__ */ React.createElement("span", { key: subidx }, number);
|
|
14405
|
+
})
|
|
14406
|
+
) : /* @__PURE__ */ React.createElement("span", { className: `${classPrefix2}__separator` }, item)
|
|
14264
14407
|
);
|
|
14265
14408
|
})));
|
|
14266
14409
|
};
|
|
@@ -14279,6 +14422,7 @@ class AnimatingNumbers extends Component {
|
|
|
14279
14422
|
__publicField(AnimatingNumbers, "defaultProps", defaultProps$q);
|
|
14280
14423
|
__publicField(AnimatingNumbers, "displayName", "NutAnimatingNumbers");
|
|
14281
14424
|
__publicField(AnimatingNumbers, "CountUp", CountUp);
|
|
14425
|
+
AnimatingNumbers.CountUp = CountUp;
|
|
14282
14426
|
const b = cn("audio");
|
|
14283
14427
|
const warn = console.warn;
|
|
14284
14428
|
const defaultProps$p = {
|
|
@@ -14375,8 +14519,8 @@ const Audio = (props) => {
|
|
|
14375
14519
|
setCurrentDuration(formatSeconds(audioCtx.currentTime.toString()));
|
|
14376
14520
|
});
|
|
14377
14521
|
audioCtx.onError((res) => {
|
|
14378
|
-
console.
|
|
14379
|
-
console.
|
|
14522
|
+
console.warn("code", res.errCode);
|
|
14523
|
+
console.warn("message", res.errMsg);
|
|
14380
14524
|
});
|
|
14381
14525
|
function formatSeconds(value) {
|
|
14382
14526
|
if (!value) {
|
|
@@ -14492,12 +14636,12 @@ const defaultProps$o = {
|
|
|
14492
14636
|
gap: "-8",
|
|
14493
14637
|
level: "left"
|
|
14494
14638
|
};
|
|
14495
|
-
const classPrefix$
|
|
14639
|
+
const classPrefix$6 = `nut-avatar-group`;
|
|
14496
14640
|
const AvatarGroup = (props) => {
|
|
14497
14641
|
const propAvatarGroup = { ...defaultProps$o, ...props };
|
|
14498
14642
|
const { className, style, children } = propAvatarGroup;
|
|
14499
14643
|
const avatarGroupRef = useRef(null);
|
|
14500
|
-
const cls = classNames(classPrefix$
|
|
14644
|
+
const cls = classNames(classPrefix$6, className);
|
|
14501
14645
|
const parentAvatar = {
|
|
14502
14646
|
propAvatarGroup,
|
|
14503
14647
|
avatarGroupRef
|
|
@@ -14515,7 +14659,7 @@ const defaultProps$n = {
|
|
|
14515
14659
|
background: "#e5e9f2",
|
|
14516
14660
|
clockwise: true
|
|
14517
14661
|
};
|
|
14518
|
-
const classPrefix$
|
|
14662
|
+
const classPrefix$5 = `nut-circleprogress`;
|
|
14519
14663
|
const CircleProgress = (props) => {
|
|
14520
14664
|
const {
|
|
14521
14665
|
children,
|
|
@@ -14534,7 +14678,7 @@ const CircleProgress = (props) => {
|
|
|
14534
14678
|
...props
|
|
14535
14679
|
};
|
|
14536
14680
|
const [oldValue, setOldValue] = useState(percent);
|
|
14537
|
-
const classes = classNames(className, classPrefix$
|
|
14681
|
+
const classes = classNames(className, classPrefix$5);
|
|
14538
14682
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
14539
14683
|
const animateIdRef = useRef(0);
|
|
14540
14684
|
const styles = {
|
|
@@ -14677,7 +14821,7 @@ const CollapseItem = (props) => {
|
|
|
14677
14821
|
const [wrapperHeight, setWrapperHeight] = useState(
|
|
14678
14822
|
() => expanded ? "auto" : "0px"
|
|
14679
14823
|
);
|
|
14680
|
-
const
|
|
14824
|
+
const getRect2 = (selector) => {
|
|
14681
14825
|
return new Promise((resolve) => {
|
|
14682
14826
|
Taro.createSelectorQuery().select(selector).boundingClientRect().exec((rect = []) => {
|
|
14683
14827
|
resolve(rect[0]);
|
|
@@ -14686,7 +14830,7 @@ const CollapseItem = (props) => {
|
|
|
14686
14830
|
};
|
|
14687
14831
|
useEffect(() => {
|
|
14688
14832
|
setTimeout(() => {
|
|
14689
|
-
|
|
14833
|
+
getRect2(target).then((res) => {
|
|
14690
14834
|
if (res == null ? void 0 : res.height) {
|
|
14691
14835
|
setCurrentHeight(`${res.height}px`);
|
|
14692
14836
|
}
|
|
@@ -14695,7 +14839,7 @@ const CollapseItem = (props) => {
|
|
|
14695
14839
|
}, [children]);
|
|
14696
14840
|
useEffect(() => {
|
|
14697
14841
|
setTimeout(() => {
|
|
14698
|
-
|
|
14842
|
+
getRect2(target).then((res) => {
|
|
14699
14843
|
if (res == null ? void 0 : res.height) {
|
|
14700
14844
|
setCurrentHeight(`${res.height}px`);
|
|
14701
14845
|
}
|
|
@@ -15092,7 +15236,7 @@ const defaultProps$j = {
|
|
|
15092
15236
|
lineHeight: "20",
|
|
15093
15237
|
width: "auto"
|
|
15094
15238
|
};
|
|
15095
|
-
const classPrefix$
|
|
15239
|
+
const classPrefix$4 = `nut-ellipsis`;
|
|
15096
15240
|
const Ellipsis = (props) => {
|
|
15097
15241
|
var _a, _b, _c, _d;
|
|
15098
15242
|
const {
|
|
@@ -15110,7 +15254,7 @@ const Ellipsis = (props) => {
|
|
|
15110
15254
|
onChange,
|
|
15111
15255
|
...rest
|
|
15112
15256
|
} = { ...defaultProps$j, ...props };
|
|
15113
|
-
|
|
15257
|
+
const maxHeight = useRef(0);
|
|
15114
15258
|
const [exceeded, setExceeded] = useState(false);
|
|
15115
15259
|
const [expanded, setExpanded] = useState(false);
|
|
15116
15260
|
const ellipsis = useRef({
|
|
@@ -15121,8 +15265,8 @@ const Ellipsis = (props) => {
|
|
|
15121
15265
|
const rootContain = useRef(null);
|
|
15122
15266
|
const symbolContain = useRef(null);
|
|
15123
15267
|
const [contentCopy, setContentCopy] = useState(content);
|
|
15124
|
-
|
|
15125
|
-
|
|
15268
|
+
const lineH = useRef(0);
|
|
15269
|
+
const originHeight = useRef(0);
|
|
15126
15270
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
15127
15271
|
const widthRef = useRef("auto");
|
|
15128
15272
|
let widthBase = [14, 10, 7, 8.4, 10];
|
|
@@ -15132,9 +15276,9 @@ const Ellipsis = (props) => {
|
|
|
15132
15276
|
const letterUpperReg = /^[A-Z]+$/;
|
|
15133
15277
|
const letterLowerReg = /^[a-z]+$/;
|
|
15134
15278
|
const classes = classNames(
|
|
15135
|
-
classPrefix$
|
|
15279
|
+
classPrefix$4,
|
|
15136
15280
|
className,
|
|
15137
|
-
width ? `${classPrefix$
|
|
15281
|
+
width ? `${classPrefix$4}-width` : ""
|
|
15138
15282
|
);
|
|
15139
15283
|
const init = () => {
|
|
15140
15284
|
setExceeded(false);
|
|
@@ -15146,7 +15290,10 @@ const Ellipsis = (props) => {
|
|
|
15146
15290
|
});
|
|
15147
15291
|
};
|
|
15148
15292
|
useReady(() => init());
|
|
15149
|
-
useEffect(
|
|
15293
|
+
useEffect(
|
|
15294
|
+
() => init(),
|
|
15295
|
+
[content, lineH.current, maxHeight.current, originHeight.current]
|
|
15296
|
+
);
|
|
15150
15297
|
const getSymbolInfo = async () => {
|
|
15151
15298
|
const refe = await getRectByTaro(symbolContain == null ? void 0 : symbolContain.current);
|
|
15152
15299
|
symbolTextWidth = refe.width ? Math.ceil(refe.width) : Math.ceil(widthBase[0] * 0.7921);
|
|
@@ -15174,13 +15321,13 @@ const Ellipsis = (props) => {
|
|
|
15174
15321
|
(res) => {
|
|
15175
15322
|
if (!res)
|
|
15176
15323
|
return;
|
|
15177
|
-
lineH = pxToNumber(
|
|
15324
|
+
lineH.current = pxToNumber(
|
|
15178
15325
|
res.lineHeight === "normal" ? lineHeight : res.lineHeight
|
|
15179
15326
|
);
|
|
15180
|
-
maxHeight = Math.floor(
|
|
15181
|
-
lineH * (Number(rows) + 0.5) + pxToNumber(res.paddingTop) + pxToNumber(res.paddingBottom)
|
|
15327
|
+
maxHeight.current = Math.floor(
|
|
15328
|
+
lineH.current * (Number(rows) + 0.5) + pxToNumber(res.paddingTop) + pxToNumber(res.paddingBottom)
|
|
15182
15329
|
);
|
|
15183
|
-
originHeight = pxToNumber(res.height);
|
|
15330
|
+
originHeight.current = pxToNumber(res.height);
|
|
15184
15331
|
widthRef.current = res.width;
|
|
15185
15332
|
const bsize = pxToNumber(res.fontSize);
|
|
15186
15333
|
widthBase = [
|
|
@@ -15196,10 +15343,12 @@ const Ellipsis = (props) => {
|
|
|
15196
15343
|
};
|
|
15197
15344
|
const calcEllipse = async () => {
|
|
15198
15345
|
const refe = await getRectByTaro(rootContain.current);
|
|
15199
|
-
if (refe.height <= maxHeight) {
|
|
15346
|
+
if (refe.height <= maxHeight.current) {
|
|
15200
15347
|
setExceeded(false);
|
|
15201
15348
|
} else {
|
|
15202
|
-
const rowNum = Math.floor(
|
|
15349
|
+
const rowNum = Math.floor(
|
|
15350
|
+
content.length / (originHeight.current / lineH.current - 1)
|
|
15351
|
+
);
|
|
15203
15352
|
if (direction === "middle") {
|
|
15204
15353
|
const end = content.length;
|
|
15205
15354
|
ellipsis.current.leading = tailorContent(
|
|
@@ -15228,7 +15377,7 @@ const Ellipsis = (props) => {
|
|
|
15228
15377
|
const verifyEllipsis = async () => {
|
|
15229
15378
|
var _a2, _b2, _c2, _d2, _e, _f;
|
|
15230
15379
|
const refe = await getRectByTaro(rootContain.current);
|
|
15231
|
-
if (refe && refe.height && refe.height > maxHeight) {
|
|
15380
|
+
if (refe && refe.height && refe.height > maxHeight.current) {
|
|
15232
15381
|
if (direction === "end") {
|
|
15233
15382
|
ellipsis.current.leading = (_c2 = (_a2 = ellipsis.current) == null ? void 0 : _a2.leading) == null ? void 0 : _c2.slice(
|
|
15234
15383
|
0,
|
|
@@ -15395,14 +15544,14 @@ const defaultProps$i = {
|
|
|
15395
15544
|
current: 0,
|
|
15396
15545
|
direction: "horizontal"
|
|
15397
15546
|
};
|
|
15398
|
-
const classPrefix$
|
|
15547
|
+
const classPrefix$3 = `nut-indicator`;
|
|
15399
15548
|
const Indicator = (props) => {
|
|
15400
15549
|
const { total, current, children, className, direction, ...rest } = {
|
|
15401
15550
|
...defaultProps$i,
|
|
15402
15551
|
...props
|
|
15403
15552
|
};
|
|
15404
15553
|
const classes = classNames({
|
|
15405
|
-
[`${classPrefix$
|
|
15554
|
+
[`${classPrefix$3}__vertical`]: direction === "vertical"
|
|
15406
15555
|
});
|
|
15407
15556
|
const renderElement = () => {
|
|
15408
15557
|
const childs = [];
|
|
@@ -15412,9 +15561,9 @@ const Indicator = (props) => {
|
|
|
15412
15561
|
"div",
|
|
15413
15562
|
{
|
|
15414
15563
|
key: item,
|
|
15415
|
-
className: `${classPrefix$
|
|
15564
|
+
className: `${classPrefix$3}__dot ${classPrefix$3}__active`
|
|
15416
15565
|
}
|
|
15417
|
-
) : /* @__PURE__ */ React.createElement("div", { key: item, className: `${classPrefix$
|
|
15566
|
+
) : /* @__PURE__ */ React.createElement("div", { key: item, className: `${classPrefix$3}__dot` })
|
|
15418
15567
|
);
|
|
15419
15568
|
}
|
|
15420
15569
|
return childs;
|
|
@@ -15430,7 +15579,7 @@ const defaultProps$h = {
|
|
|
15430
15579
|
loop: false,
|
|
15431
15580
|
defaultValue: 0
|
|
15432
15581
|
};
|
|
15433
|
-
const classPrefix = "nut-swiper";
|
|
15582
|
+
const classPrefix$2 = "nut-swiper";
|
|
15434
15583
|
const Swiper = forwardRef((props, ref) => {
|
|
15435
15584
|
const {
|
|
15436
15585
|
width,
|
|
@@ -15461,8 +15610,8 @@ const Swiper = forwardRef((props, ref) => {
|
|
|
15461
15610
|
"div",
|
|
15462
15611
|
{
|
|
15463
15612
|
className: classNames({
|
|
15464
|
-
[`${classPrefix}__indicator`]: true,
|
|
15465
|
-
[`${classPrefix}__indicator-vertical`]: direction === "vertical"
|
|
15613
|
+
[`${classPrefix$2}__indicator`]: true,
|
|
15614
|
+
[`${classPrefix$2}__indicator-vertical`]: direction === "vertical"
|
|
15466
15615
|
})
|
|
15467
15616
|
},
|
|
15468
15617
|
/* @__PURE__ */ React.createElement(
|
|
@@ -15504,7 +15653,7 @@ const Swiper = forwardRef((props, ref) => {
|
|
|
15504
15653
|
return /* @__PURE__ */ React.createElement(
|
|
15505
15654
|
View,
|
|
15506
15655
|
{
|
|
15507
|
-
className: classNames(classPrefix, className),
|
|
15656
|
+
className: classNames(classPrefix$2, className),
|
|
15508
15657
|
style: {
|
|
15509
15658
|
width: !width ? "100%" : `${width}px`,
|
|
15510
15659
|
height: !height ? "150px" : `${height}px`
|
|
@@ -16556,6 +16705,7 @@ const Tag = (props) => {
|
|
|
16556
16705
|
Tag.defaultProps = defaultProps$8;
|
|
16557
16706
|
Tag.displayName = "NutTag";
|
|
16558
16707
|
const defaultProps$7 = {
|
|
16708
|
+
...ComponentDefaults,
|
|
16559
16709
|
source: {
|
|
16560
16710
|
type: {},
|
|
16561
16711
|
src: ""
|
|
@@ -16570,15 +16720,13 @@ const defaultProps$7 = {
|
|
|
16570
16720
|
loop: false
|
|
16571
16721
|
}
|
|
16572
16722
|
};
|
|
16723
|
+
const classPrefix$1 = `nut-video`;
|
|
16573
16724
|
const Video = (props) => {
|
|
16574
16725
|
const {
|
|
16575
16726
|
children,
|
|
16576
16727
|
source,
|
|
16577
16728
|
options,
|
|
16578
16729
|
className,
|
|
16579
|
-
play,
|
|
16580
|
-
pause,
|
|
16581
|
-
playend,
|
|
16582
16730
|
onPlay,
|
|
16583
16731
|
onPause,
|
|
16584
16732
|
onPlayEnd,
|
|
@@ -16587,92 +16735,58 @@ const Video = (props) => {
|
|
|
16587
16735
|
...defaultProps$7,
|
|
16588
16736
|
...props
|
|
16589
16737
|
};
|
|
16590
|
-
const
|
|
16591
|
-
const b2 = cn("video");
|
|
16592
|
-
const classes = classNames(className, b2(""));
|
|
16593
|
-
useEffect(() => {
|
|
16594
|
-
init();
|
|
16595
|
-
}, []);
|
|
16596
|
-
const init = () => {
|
|
16597
|
-
if (rootRef.current) {
|
|
16598
|
-
const videoRef = rootRef.current;
|
|
16599
|
-
if (options.autoplay) {
|
|
16600
|
-
setTimeout(() => {
|
|
16601
|
-
videoRef.play();
|
|
16602
|
-
}, 200);
|
|
16603
|
-
}
|
|
16604
|
-
if (options.playsinline) {
|
|
16605
|
-
videoRef.setAttribute("playsinline", String(options.playsinline));
|
|
16606
|
-
videoRef.setAttribute("webkit-playsinline", String(options.playsinline));
|
|
16607
|
-
videoRef.setAttribute("x5-video-player-type", "h5-page");
|
|
16608
|
-
videoRef.setAttribute("x5-video-player-fullscreen", "false");
|
|
16609
|
-
}
|
|
16610
|
-
videoRef.addEventListener("play", () => {
|
|
16611
|
-
onPlay && onPlay(videoRef);
|
|
16612
|
-
play && play(videoRef);
|
|
16613
|
-
});
|
|
16614
|
-
videoRef.addEventListener("pause", () => {
|
|
16615
|
-
onPause && onPause(videoRef);
|
|
16616
|
-
pause && pause(videoRef);
|
|
16617
|
-
});
|
|
16618
|
-
videoRef.addEventListener("ended", () => {
|
|
16619
|
-
videoRef.currentTime = 0;
|
|
16620
|
-
onPlayEnd && onPlayEnd(videoRef);
|
|
16621
|
-
playend && playend(videoRef);
|
|
16622
|
-
});
|
|
16623
|
-
}
|
|
16624
|
-
};
|
|
16738
|
+
const classes = classNames(className, classPrefix$1);
|
|
16625
16739
|
return /* @__PURE__ */ React.createElement("div", { className: classes, ...restProps }, /* @__PURE__ */ React.createElement(
|
|
16626
|
-
|
|
16740
|
+
Video$1,
|
|
16627
16741
|
{
|
|
16628
16742
|
className: "nut-video-player",
|
|
16629
16743
|
muted: options.muted,
|
|
16630
|
-
|
|
16744
|
+
autoplay: options.autoplay,
|
|
16631
16745
|
loop: options.loop,
|
|
16632
16746
|
poster: options.poster,
|
|
16633
16747
|
controls: options.controls,
|
|
16634
|
-
|
|
16635
|
-
|
|
16636
|
-
|
|
16637
|
-
|
|
16638
|
-
|
|
16748
|
+
src: source.src,
|
|
16749
|
+
onPlay,
|
|
16750
|
+
onPause,
|
|
16751
|
+
onEnded: onPlayEnd
|
|
16752
|
+
}
|
|
16639
16753
|
));
|
|
16640
16754
|
};
|
|
16641
16755
|
Video.defaultProps = defaultProps$7;
|
|
16642
16756
|
Video.displayName = "NutVideo";
|
|
16643
16757
|
const defaultProps$6 = {
|
|
16644
|
-
|
|
16645
|
-
|
|
16758
|
+
...ComponentDefaults,
|
|
16759
|
+
list: [],
|
|
16760
|
+
interval: 500,
|
|
16646
16761
|
loop: true,
|
|
16647
|
-
|
|
16762
|
+
duration: 3e3,
|
|
16648
16763
|
rows: 3,
|
|
16649
|
-
|
|
16764
|
+
gapY: 10
|
|
16650
16765
|
};
|
|
16766
|
+
const classPrefix = `nut-barrage`;
|
|
16651
16767
|
const InternalBarrage = (props, ref) => {
|
|
16652
16768
|
const {
|
|
16653
16769
|
className,
|
|
16654
|
-
|
|
16770
|
+
interval,
|
|
16655
16771
|
loop,
|
|
16656
|
-
|
|
16657
|
-
|
|
16772
|
+
list,
|
|
16773
|
+
duration,
|
|
16658
16774
|
rows,
|
|
16659
|
-
|
|
16775
|
+
gapY,
|
|
16660
16776
|
...restProps
|
|
16661
16777
|
} = {
|
|
16662
16778
|
...defaultProps$6,
|
|
16663
16779
|
...props
|
|
16664
16780
|
};
|
|
16665
16781
|
const [styleList, setStyleList] = useState([]);
|
|
16666
|
-
const [baItemList, setBaItemList] = useState(
|
|
16667
|
-
const barrageListSet = useRef(
|
|
16782
|
+
const [baItemList, setBaItemList] = useState(list);
|
|
16783
|
+
const barrageListSet = useRef(list);
|
|
16668
16784
|
const barrageBody = useRef(null);
|
|
16669
16785
|
const barrageContainer = useRef(null);
|
|
16670
16786
|
const timeId = useRef((/* @__PURE__ */ new Date()).getTime());
|
|
16671
16787
|
const timer = useRef(0);
|
|
16672
|
-
|
|
16673
|
-
|
|
16674
|
-
const classes = classNames(className, b2(""), {
|
|
16675
|
-
[`nut-barrage__body${timeId.current}`]: true
|
|
16788
|
+
const classes = classNames(className, classPrefix, {
|
|
16789
|
+
[`${classPrefix}__body${timeId.current}`]: true
|
|
16676
16790
|
});
|
|
16677
16791
|
useImperativeHandle(ref, () => ({
|
|
16678
16792
|
add: (word) => {
|
|
@@ -16681,53 +16795,53 @@ const InternalBarrage = (props, ref) => {
|
|
|
16681
16795
|
}
|
|
16682
16796
|
}));
|
|
16683
16797
|
useEffect(() => {
|
|
16684
|
-
barrageListSet.current = [...
|
|
16798
|
+
barrageListSet.current = [...list];
|
|
16685
16799
|
run();
|
|
16686
16800
|
return () => {
|
|
16687
16801
|
clearInterval(timer.current);
|
|
16688
16802
|
};
|
|
16689
|
-
}, [
|
|
16803
|
+
}, [list]);
|
|
16690
16804
|
const run = () => {
|
|
16691
16805
|
setBaItemList(barrageListSet.current);
|
|
16692
|
-
barrageListSet.current.forEach((item,
|
|
16693
|
-
getNode(
|
|
16806
|
+
barrageListSet.current.forEach((item, index) => {
|
|
16807
|
+
getNode(index);
|
|
16694
16808
|
});
|
|
16695
16809
|
};
|
|
16696
|
-
const getNode = (
|
|
16810
|
+
const getNode = (index) => {
|
|
16697
16811
|
const query = createSelectorQuery();
|
|
16698
16812
|
setTimeout(() => {
|
|
16699
16813
|
let width = 100;
|
|
16700
|
-
query.select(
|
|
16814
|
+
query.select(`.${classPrefix}__body` + timeId.current).boundingClientRect((rec) => {
|
|
16701
16815
|
width = rec.width || 300;
|
|
16702
16816
|
});
|
|
16703
|
-
query.select(
|
|
16817
|
+
query.select(`.${classPrefix}__item` + index).boundingClientRect((recs) => {
|
|
16704
16818
|
let height = recs.height;
|
|
16705
|
-
let nodeTop =
|
|
16706
|
-
styleInfo(
|
|
16819
|
+
let nodeTop = index % rows * (height + gapY) + 20 + "px";
|
|
16820
|
+
styleInfo(index, nodeTop, width);
|
|
16707
16821
|
}).exec();
|
|
16708
16822
|
}, 500);
|
|
16709
16823
|
};
|
|
16710
|
-
const styleInfo = (
|
|
16711
|
-
let timeIndex =
|
|
16712
|
-
let
|
|
16713
|
-
let time =
|
|
16824
|
+
const styleInfo = (index, nodeTop, width) => {
|
|
16825
|
+
let timeIndex = index - rows > 0 ? index - rows : 0;
|
|
16826
|
+
let list2 = styleList;
|
|
16827
|
+
let time = list2[timeIndex] ? Number(list2[timeIndex]["--time"]) : 0;
|
|
16714
16828
|
let obj = {
|
|
16715
16829
|
top: nodeTop,
|
|
16716
|
-
"--time": `${
|
|
16717
|
-
animationDuration: `${
|
|
16830
|
+
"--time": `${interval * index + time}`,
|
|
16831
|
+
animationDuration: `${duration}ms`,
|
|
16718
16832
|
animationIterationCount: `${loop ? "infinite" : 1}`,
|
|
16719
|
-
animationDelay: `${
|
|
16833
|
+
animationDelay: `${interval * index + time}ms`,
|
|
16720
16834
|
"--move-distance": `-${width}px`
|
|
16721
16835
|
};
|
|
16722
|
-
|
|
16723
|
-
setStyleList([...
|
|
16836
|
+
list2.push(obj);
|
|
16837
|
+
setStyleList([...list2]);
|
|
16724
16838
|
};
|
|
16725
|
-
return /* @__PURE__ */ React.createElement("div", { className: classes, ref: barrageBody, ...restProps }, /* @__PURE__ */ React.createElement("div", { ref: barrageContainer, className: "bContainer" }, baItemList.map((item,
|
|
16839
|
+
return /* @__PURE__ */ React.createElement("div", { className: classes, ref: barrageBody, ...restProps }, /* @__PURE__ */ React.createElement("div", { ref: barrageContainer, className: "bContainer" }, baItemList.map((item, index) => {
|
|
16726
16840
|
return /* @__PURE__ */ React.createElement(
|
|
16727
16841
|
"div",
|
|
16728
16842
|
{
|
|
16729
|
-
className: `barrage-item
|
|
16730
|
-
style: styleList[
|
|
16843
|
+
className: `barrage-item ${classPrefix}__item${index} move`,
|
|
16844
|
+
style: styleList[index]
|
|
16731
16845
|
},
|
|
16732
16846
|
item.length > 8 ? item.substr(0, 8) + "..." : item
|
|
16733
16847
|
);
|
|
@@ -16982,43 +17096,42 @@ const TimeSelect = (props) => {
|
|
|
16982
17096
|
TimeSelect.defaultProps = defaultProps$2;
|
|
16983
17097
|
TimeSelect.displayName = "NutTimeSelect";
|
|
16984
17098
|
const defaultProps$1 = {
|
|
16985
|
-
|
|
17099
|
+
...ComponentDefaults,
|
|
17100
|
+
value: 0,
|
|
16986
17101
|
digits: 2,
|
|
16987
|
-
|
|
16988
|
-
|
|
17102
|
+
symbol: false,
|
|
17103
|
+
zero: false,
|
|
16989
17104
|
arrowLeft: false,
|
|
16990
|
-
|
|
16991
|
-
|
|
17105
|
+
syncColor: true,
|
|
17106
|
+
color: "#333",
|
|
16992
17107
|
riseColor: "#fa2c19",
|
|
16993
17108
|
dropColor: "#64b578",
|
|
16994
|
-
|
|
16995
|
-
downIcon: null
|
|
16996
|
-
className: ""
|
|
17109
|
+
riseIcon: null,
|
|
17110
|
+
downIcon: null
|
|
16997
17111
|
};
|
|
16998
17112
|
const TrendArrow = (props) => {
|
|
16999
17113
|
const {
|
|
17000
|
-
|
|
17114
|
+
value,
|
|
17001
17115
|
digits,
|
|
17002
|
-
|
|
17003
|
-
|
|
17116
|
+
symbol,
|
|
17117
|
+
zero,
|
|
17004
17118
|
arrowLeft,
|
|
17005
|
-
|
|
17006
|
-
|
|
17119
|
+
syncColor,
|
|
17120
|
+
color,
|
|
17007
17121
|
riseColor,
|
|
17008
17122
|
dropColor,
|
|
17009
|
-
|
|
17123
|
+
riseIcon,
|
|
17010
17124
|
downIcon,
|
|
17011
17125
|
className,
|
|
17126
|
+
style,
|
|
17012
17127
|
children,
|
|
17013
17128
|
...rest
|
|
17014
17129
|
} = { ...defaultProps$1, ...props };
|
|
17015
|
-
const
|
|
17016
|
-
const
|
|
17017
|
-
};
|
|
17018
|
-
const rateTrend = useRef(rate > 0);
|
|
17130
|
+
const classPrefix2 = "nut-trendarrow";
|
|
17131
|
+
const rateTrend = useRef(value > 0);
|
|
17019
17132
|
const myFixed = (num, digit = 2) => {
|
|
17020
17133
|
if (Object.is(parseFloat(num), NaN)) {
|
|
17021
|
-
return console.
|
|
17134
|
+
return console.warn(`传入的值:${num}不是一个数字`);
|
|
17022
17135
|
}
|
|
17023
17136
|
num = parseFloat(num);
|
|
17024
17137
|
const numPow = Math.pow(10, digit);
|
|
@@ -17026,20 +17139,20 @@ const TrendArrow = (props) => {
|
|
|
17026
17139
|
};
|
|
17027
17140
|
const calcStyle = (() => {
|
|
17028
17141
|
const arrowColor = rateTrend.current ? riseColor : dropColor;
|
|
17029
|
-
const textEquArrowColor =
|
|
17030
|
-
const
|
|
17031
|
-
color:
|
|
17142
|
+
const textEquArrowColor = syncColor ? arrowColor : color;
|
|
17143
|
+
const style2 = {
|
|
17144
|
+
color: value === 0 ? color : textEquArrowColor
|
|
17032
17145
|
};
|
|
17033
|
-
return
|
|
17146
|
+
return style2;
|
|
17034
17147
|
})();
|
|
17035
17148
|
const calcRate = (() => {
|
|
17036
|
-
rateTrend.current =
|
|
17037
|
-
const absRate = Math.abs(
|
|
17038
|
-
if (!
|
|
17149
|
+
rateTrend.current = value > 0;
|
|
17150
|
+
const absRate = Math.abs(value);
|
|
17151
|
+
if (!zero && value === 0) {
|
|
17039
17152
|
return "--";
|
|
17040
17153
|
}
|
|
17041
17154
|
const resultRate = `${// eslint-disable-next-line no-nested-ternary
|
|
17042
|
-
|
|
17155
|
+
symbol && value !== 0 ? rateTrend.current ? "+" : "-" : ""}${myFixed(Number(absRate), digits)}%`;
|
|
17043
17156
|
return resultRate;
|
|
17044
17157
|
})();
|
|
17045
17158
|
const calcIconProps = (() => {
|
|
@@ -17050,13 +17163,21 @@ const TrendArrow = (props) => {
|
|
|
17050
17163
|
})();
|
|
17051
17164
|
const renderContent = (arrowLeft2) => {
|
|
17052
17165
|
const classNameSuffix = !arrowLeft2 ? "icon-after" : "icon-before";
|
|
17053
|
-
return /* @__PURE__ */ React.createElement(
|
|
17166
|
+
return /* @__PURE__ */ React.createElement(
|
|
17167
|
+
"span",
|
|
17168
|
+
{
|
|
17169
|
+
className: `${classPrefix2}__${classNameSuffix} ${classPrefix2}__value`,
|
|
17170
|
+
style: calcStyle
|
|
17171
|
+
},
|
|
17172
|
+
calcRate
|
|
17173
|
+
);
|
|
17054
17174
|
};
|
|
17055
|
-
return /* @__PURE__ */ React.createElement("div", { className: `${
|
|
17175
|
+
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, !arrowLeft && renderContent(!arrowLeft), Number(value) !== 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, rateTrend.current ? /* @__PURE__ */ React.createElement(React.Fragment, null, riseIcon || /* @__PURE__ */ React.createElement(a, { color: calcIconProps.color })) : /* @__PURE__ */ React.createElement(React.Fragment, null, downIcon || /* @__PURE__ */ React.createElement(a$1, { color: calcIconProps.color }))), arrowLeft && renderContent(!arrowLeft));
|
|
17056
17176
|
};
|
|
17057
17177
|
TrendArrow.defaultProps = defaultProps$1;
|
|
17058
17178
|
TrendArrow.displayName = "NutTrendArrow";
|
|
17059
17179
|
const defaultProps = {
|
|
17180
|
+
...ComponentDefaults,
|
|
17060
17181
|
content: "",
|
|
17061
17182
|
fullPage: true,
|
|
17062
17183
|
zIndex: 2e3,
|
|
@@ -17068,9 +17189,8 @@ const defaultProps = {
|
|
|
17068
17189
|
imageWidth: 120,
|
|
17069
17190
|
imageHeight: 64,
|
|
17070
17191
|
rotate: -22,
|
|
17071
|
-
|
|
17192
|
+
color: "rgba(0,0,0,.15)",
|
|
17072
17193
|
fontStyle: "normal",
|
|
17073
|
-
fontFamily: "PingFang SC",
|
|
17074
17194
|
fontWeight: "normal",
|
|
17075
17195
|
fontSize: 14
|
|
17076
17196
|
};
|
|
@@ -17089,22 +17209,20 @@ const WaterMark = (props) => {
|
|
|
17089
17209
|
imageWidth,
|
|
17090
17210
|
imageHeight,
|
|
17091
17211
|
rotate,
|
|
17092
|
-
|
|
17212
|
+
color,
|
|
17093
17213
|
fontStyle,
|
|
17094
17214
|
fontFamily,
|
|
17095
17215
|
fontWeight,
|
|
17096
17216
|
fontSize,
|
|
17097
|
-
style
|
|
17098
|
-
children
|
|
17217
|
+
style
|
|
17099
17218
|
} = {
|
|
17100
17219
|
...defaultProps,
|
|
17101
17220
|
...props
|
|
17102
17221
|
};
|
|
17103
17222
|
const [base64Url, setBase64Url] = useState("");
|
|
17104
|
-
const
|
|
17105
|
-
const classes = classNames({
|
|
17106
|
-
[`${
|
|
17107
|
-
[`${b2("")}-full-page`]: fullPage
|
|
17223
|
+
const classPrefix2 = "nut-watermark";
|
|
17224
|
+
const classes = classNames(classPrefix2, {
|
|
17225
|
+
[`${classPrefix2}-full-page`]: fullPage
|
|
17108
17226
|
});
|
|
17109
17227
|
const cls = classNames(classes, className);
|
|
17110
17228
|
useEffect(() => {
|
|
@@ -17114,8 +17232,8 @@ const WaterMark = (props) => {
|
|
|
17114
17232
|
let ratio = 1;
|
|
17115
17233
|
getSystemInfo().then((res) => {
|
|
17116
17234
|
ratio = res.pixelRatio;
|
|
17117
|
-
const canvasWidth = `${(gapX + width) * ratio}
|
|
17118
|
-
const canvasHeight = `${(gapY + height) * ratio}
|
|
17235
|
+
const canvasWidth = `${(gapX + width) * ratio}`;
|
|
17236
|
+
const canvasHeight = `${(gapY + height) * ratio}`;
|
|
17119
17237
|
const markWidth = width * ratio;
|
|
17120
17238
|
const markHeight = height * ratio;
|
|
17121
17239
|
let ctx;
|
|
@@ -17123,8 +17241,8 @@ const WaterMark = (props) => {
|
|
|
17123
17241
|
if (process.env.TARO_ENV === "h5") {
|
|
17124
17242
|
canvas = document.createElement("canvas");
|
|
17125
17243
|
ctx = canvas.getContext("2d");
|
|
17126
|
-
canvas.setAttribute("width", canvasWidth);
|
|
17127
|
-
canvas.setAttribute("height", canvasHeight);
|
|
17244
|
+
canvas.setAttribute("width", `${canvasWidth}px`);
|
|
17245
|
+
canvas.setAttribute("height", `${canvasHeight}px`);
|
|
17128
17246
|
} else {
|
|
17129
17247
|
canvas = createOffscreenCanvas({
|
|
17130
17248
|
type: "2d",
|
|
@@ -17164,7 +17282,7 @@ const WaterMark = (props) => {
|
|
|
17164
17282
|
ctx.rotate(Math.PI / 180 * Number(rotate));
|
|
17165
17283
|
const markSize = Number(fontSize) * ratio;
|
|
17166
17284
|
ctx.font = `${fontStyle} normal ${fontWeight} ${markSize}px/${markHeight}px ${fontFamily}`;
|
|
17167
|
-
ctx.fillStyle =
|
|
17285
|
+
ctx.fillStyle = color;
|
|
17168
17286
|
ctx.fillText(content, 0, 0);
|
|
17169
17287
|
ctx.restore();
|
|
17170
17288
|
setBase64Url(canvas.toDataURL());
|