@nutui/nutui-react-taro 2.0.0-alpha.13 → 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 +16 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Audio.js +3 -3
- 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/Uploader.js +2 -2
- 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 +21 -21
- 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/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/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/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 +466 -324
- package/dist/nutui.react.umd.js +466 -324
- package/dist/packages/barrage/barrage.scss +0 -13
- package/dist/packages/popover/popover.scss +158 -230
- package/dist/packages/popup/popup.scss +36 -0
- 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/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +35 -47
- package/dist/styles/variables.scss +45 -57
- 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/configprovider/types.d.ts +1 -1
- package/dist/types/packages/input/input.taro.d.ts +1 -1
- package/dist/types/packages/menu/menu.taro.d.ts +5 -1
- 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/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/subsidenavbar/index.taro.d.ts +1 -0
- package/dist/types/packages/subsidenavbar/subsidenavbar.taro.d.ts +3 -3
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm/popover.taro-ad483372.js +0 -162
- package/dist/esm/sidenavbaritem.taro-32a45ce6.js +0 -12
- 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/types/packages/popover/Trigger.d.ts +0 -19
- /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.umd.js
CHANGED
|
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8
8
|
return value;
|
|
9
9
|
};
|
|
10
10
|
/*!
|
|
11
|
-
* @nutui/nutui-react-taro v2.0.0-alpha.
|
|
11
|
+
* @nutui/nutui-react-taro v2.0.0-alpha.14 Fri Jun 02 2023 17:13:52 GMT+0800 (China Standard Time)
|
|
12
12
|
* (c) 2023 @jdf2e.
|
|
13
13
|
* Released under the MIT License.
|
|
14
14
|
*/
|
|
@@ -1958,7 +1958,7 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 = React.useCallback(() => {
|
|
@@ -3104,7 +3133,7 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
5484
5513
|
Popup.displayName = "NutPopup";
|
|
5485
5514
|
const OffsetContext = React.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 @@ var __publicField = (obj, key, value) => {
|
|
|
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] = React.useState(true);
|
|
5508
5537
|
const handleClick = () => {
|
|
5509
5538
|
setSidenavbarShow(!sidenavbarShow);
|
|
@@ -5516,49 +5545,43 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
5579
5603
|
const setListLevel = React.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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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
|
React.useEffect(() => {
|
|
5612
5636
|
var _a, _b;
|
|
@@ -5614,9 +5638,9 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
5943
5967
|
activeType === "line" && /* @__PURE__ */ React.createElement(
|
|
5944
5968
|
components.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
|
components.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 @@ var __publicField = (obj, key, value) => {
|
|
|
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(components.View, { className: `${classPrefix$
|
|
5996
|
+
), /* @__PURE__ */ React.createElement(components.View, { className: `${classPrefix$h}__content__wrap` }, /* @__PURE__ */ React.createElement(components.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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
8645
8670
|
(_a = props.onConfirm) == null ? void 0 : _a.call(props, setSelectedOptions(), val);
|
|
8646
8671
|
}
|
|
8647
8672
|
});
|
|
8673
|
+
const [innerValue, setInnerValue] = React.useState(selectedValue);
|
|
8648
8674
|
const [currentValue, setCurrentValue] = React.useState([]);
|
|
8649
8675
|
const [columnIndex, setColumnIndex] = React.useState(0);
|
|
8650
8676
|
const pickerRef = React.useRef(null);
|
|
@@ -8685,41 +8711,52 @@ var __publicField = (obj, key, value) => {
|
|
|
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
|
+
React.useEffect(() => {
|
|
8740
|
+
setInnerValue(innerValue !== selectedValue ? selectedValue : innerValue);
|
|
8741
|
+
}, [visible]);
|
|
8742
|
+
React.useEffect(() => {
|
|
8743
|
+
if (visible) {
|
|
8744
|
+
init();
|
|
8745
|
+
}
|
|
8746
|
+
}, [options, visible]);
|
|
8711
8747
|
React.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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
8749
8786
|
}
|
|
8750
8787
|
return defaultIndexs;
|
|
8751
8788
|
};
|
|
8752
|
-
React.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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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] = React.useState(false);
|
|
8827
8857
|
const pickerStart = () => {
|
|
8828
8858
|
setPickingStatus(true);
|
|
8829
8859
|
};
|
|
@@ -8854,12 +8884,12 @@ var __publicField = (obj, key, value) => {
|
|
|
8854
8884
|
closePicker();
|
|
8855
8885
|
}
|
|
8856
8886
|
},
|
|
8857
|
-
/* @__PURE__ */ React.createElement(components.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(components.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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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: () => {
|
|
13325
13331
|
},
|
|
13326
|
-
|
|
13332
|
+
onOpen: () => {
|
|
13333
|
+
},
|
|
13334
|
+
onClose: () => {
|
|
13335
|
+
},
|
|
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] = React.useState("");
|
|
13368
|
+
const popoverRef = React.useRef(null);
|
|
13369
|
+
const popoverContentRef = React.useRef(null);
|
|
13370
|
+
const [showPopup, setShowPopup] = React.useState(false);
|
|
13355
13371
|
const [elWidth, setElWidth] = React.useState(0);
|
|
13356
13372
|
const [elHeight, setElHeight] = React.useState(0);
|
|
13357
|
-
const [
|
|
13358
|
-
const [popoverArrow, setPopoverArrow] = React.useState("");
|
|
13373
|
+
const [rootPosition, setRootPosition] = React.useState();
|
|
13359
13374
|
React.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;
|
|
13452
|
+
}
|
|
13453
|
+
return styles;
|
|
13454
|
+
};
|
|
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
|
+
}
|
|
13397
13499
|
}
|
|
13500
|
+
if (elWidth === 0) {
|
|
13501
|
+
styles.visibility = "hidden";
|
|
13502
|
+
} else {
|
|
13503
|
+
styles.visibility = "initial";
|
|
13504
|
+
}
|
|
13505
|
+
return styles;
|
|
13398
13506
|
};
|
|
13399
|
-
const
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
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 @@ var __publicField = (obj, key, value) => {
|
|
|
14160
14297
|
const [clicked, setClicked] = React.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);
|
|
@@ -14382,8 +14519,8 @@ var __publicField = (obj, key, value) => {
|
|
|
14382
14519
|
setCurrentDuration(formatSeconds(audioCtx.currentTime.toString()));
|
|
14383
14520
|
});
|
|
14384
14521
|
audioCtx.onError((res) => {
|
|
14385
|
-
console.
|
|
14386
|
-
console.
|
|
14522
|
+
console.warn("code", res.errCode);
|
|
14523
|
+
console.warn("message", res.errMsg);
|
|
14387
14524
|
});
|
|
14388
14525
|
function formatSeconds(value) {
|
|
14389
14526
|
if (!value) {
|
|
@@ -14499,12 +14636,12 @@ var __publicField = (obj, key, value) => {
|
|
|
14499
14636
|
gap: "-8",
|
|
14500
14637
|
level: "left"
|
|
14501
14638
|
};
|
|
14502
|
-
const classPrefix$
|
|
14639
|
+
const classPrefix$6 = `nut-avatar-group`;
|
|
14503
14640
|
const AvatarGroup = (props) => {
|
|
14504
14641
|
const propAvatarGroup = { ...defaultProps$o, ...props };
|
|
14505
14642
|
const { className, style, children } = propAvatarGroup;
|
|
14506
14643
|
const avatarGroupRef = React.useRef(null);
|
|
14507
|
-
const cls = classNames(classPrefix$
|
|
14644
|
+
const cls = classNames(classPrefix$6, className);
|
|
14508
14645
|
const parentAvatar = {
|
|
14509
14646
|
propAvatarGroup,
|
|
14510
14647
|
avatarGroupRef
|
|
@@ -14522,7 +14659,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14522
14659
|
background: "#e5e9f2",
|
|
14523
14660
|
clockwise: true
|
|
14524
14661
|
};
|
|
14525
|
-
const classPrefix$
|
|
14662
|
+
const classPrefix$5 = `nut-circleprogress`;
|
|
14526
14663
|
const CircleProgress = (props) => {
|
|
14527
14664
|
const {
|
|
14528
14665
|
children,
|
|
@@ -14541,7 +14678,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14541
14678
|
...props
|
|
14542
14679
|
};
|
|
14543
14680
|
const [oldValue, setOldValue] = React.useState(percent);
|
|
14544
|
-
const classes = classNames(className, classPrefix$
|
|
14681
|
+
const classes = classNames(className, classPrefix$5);
|
|
14545
14682
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
14546
14683
|
const animateIdRef = React.useRef(0);
|
|
14547
14684
|
const styles = {
|
|
@@ -14684,7 +14821,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14684
14821
|
const [wrapperHeight, setWrapperHeight] = React.useState(
|
|
14685
14822
|
() => expanded ? "auto" : "0px"
|
|
14686
14823
|
);
|
|
14687
|
-
const
|
|
14824
|
+
const getRect2 = (selector) => {
|
|
14688
14825
|
return new Promise((resolve) => {
|
|
14689
14826
|
Taro.createSelectorQuery().select(selector).boundingClientRect().exec((rect = []) => {
|
|
14690
14827
|
resolve(rect[0]);
|
|
@@ -14693,7 +14830,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14693
14830
|
};
|
|
14694
14831
|
React.useEffect(() => {
|
|
14695
14832
|
setTimeout(() => {
|
|
14696
|
-
|
|
14833
|
+
getRect2(target).then((res) => {
|
|
14697
14834
|
if (res == null ? void 0 : res.height) {
|
|
14698
14835
|
setCurrentHeight(`${res.height}px`);
|
|
14699
14836
|
}
|
|
@@ -14702,7 +14839,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14702
14839
|
}, [children]);
|
|
14703
14840
|
React.useEffect(() => {
|
|
14704
14841
|
setTimeout(() => {
|
|
14705
|
-
|
|
14842
|
+
getRect2(target).then((res) => {
|
|
14706
14843
|
if (res == null ? void 0 : res.height) {
|
|
14707
14844
|
setCurrentHeight(`${res.height}px`);
|
|
14708
14845
|
}
|
|
@@ -15099,7 +15236,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15099
15236
|
lineHeight: "20",
|
|
15100
15237
|
width: "auto"
|
|
15101
15238
|
};
|
|
15102
|
-
const classPrefix$
|
|
15239
|
+
const classPrefix$4 = `nut-ellipsis`;
|
|
15103
15240
|
const Ellipsis = (props) => {
|
|
15104
15241
|
var _a, _b, _c, _d;
|
|
15105
15242
|
const {
|
|
@@ -15117,7 +15254,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15117
15254
|
onChange,
|
|
15118
15255
|
...rest
|
|
15119
15256
|
} = { ...defaultProps$j, ...props };
|
|
15120
|
-
|
|
15257
|
+
const maxHeight = React.useRef(0);
|
|
15121
15258
|
const [exceeded, setExceeded] = React.useState(false);
|
|
15122
15259
|
const [expanded, setExpanded] = React.useState(false);
|
|
15123
15260
|
const ellipsis = React.useRef({
|
|
@@ -15128,8 +15265,8 @@ var __publicField = (obj, key, value) => {
|
|
|
15128
15265
|
const rootContain = React.useRef(null);
|
|
15129
15266
|
const symbolContain = React.useRef(null);
|
|
15130
15267
|
const [contentCopy, setContentCopy] = React.useState(content);
|
|
15131
|
-
|
|
15132
|
-
|
|
15268
|
+
const lineH = React.useRef(0);
|
|
15269
|
+
const originHeight = React.useRef(0);
|
|
15133
15270
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
15134
15271
|
const widthRef = React.useRef("auto");
|
|
15135
15272
|
let widthBase = [14, 10, 7, 8.4, 10];
|
|
@@ -15139,9 +15276,9 @@ var __publicField = (obj, key, value) => {
|
|
|
15139
15276
|
const letterUpperReg = /^[A-Z]+$/;
|
|
15140
15277
|
const letterLowerReg = /^[a-z]+$/;
|
|
15141
15278
|
const classes = classNames(
|
|
15142
|
-
classPrefix$
|
|
15279
|
+
classPrefix$4,
|
|
15143
15280
|
className,
|
|
15144
|
-
width ? `${classPrefix$
|
|
15281
|
+
width ? `${classPrefix$4}-width` : ""
|
|
15145
15282
|
);
|
|
15146
15283
|
const init = () => {
|
|
15147
15284
|
setExceeded(false);
|
|
@@ -15153,7 +15290,10 @@ var __publicField = (obj, key, value) => {
|
|
|
15153
15290
|
});
|
|
15154
15291
|
};
|
|
15155
15292
|
Taro.useReady(() => init());
|
|
15156
|
-
React.useEffect(
|
|
15293
|
+
React.useEffect(
|
|
15294
|
+
() => init(),
|
|
15295
|
+
[content, lineH.current, maxHeight.current, originHeight.current]
|
|
15296
|
+
);
|
|
15157
15297
|
const getSymbolInfo = async () => {
|
|
15158
15298
|
const refe = await getRectByTaro(symbolContain == null ? void 0 : symbolContain.current);
|
|
15159
15299
|
symbolTextWidth = refe.width ? Math.ceil(refe.width) : Math.ceil(widthBase[0] * 0.7921);
|
|
@@ -15181,13 +15321,13 @@ var __publicField = (obj, key, value) => {
|
|
|
15181
15321
|
(res) => {
|
|
15182
15322
|
if (!res)
|
|
15183
15323
|
return;
|
|
15184
|
-
lineH = pxToNumber(
|
|
15324
|
+
lineH.current = pxToNumber(
|
|
15185
15325
|
res.lineHeight === "normal" ? lineHeight : res.lineHeight
|
|
15186
15326
|
);
|
|
15187
|
-
maxHeight = Math.floor(
|
|
15188
|
-
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)
|
|
15189
15329
|
);
|
|
15190
|
-
originHeight = pxToNumber(res.height);
|
|
15330
|
+
originHeight.current = pxToNumber(res.height);
|
|
15191
15331
|
widthRef.current = res.width;
|
|
15192
15332
|
const bsize = pxToNumber(res.fontSize);
|
|
15193
15333
|
widthBase = [
|
|
@@ -15203,10 +15343,12 @@ var __publicField = (obj, key, value) => {
|
|
|
15203
15343
|
};
|
|
15204
15344
|
const calcEllipse = async () => {
|
|
15205
15345
|
const refe = await getRectByTaro(rootContain.current);
|
|
15206
|
-
if (refe.height <= maxHeight) {
|
|
15346
|
+
if (refe.height <= maxHeight.current) {
|
|
15207
15347
|
setExceeded(false);
|
|
15208
15348
|
} else {
|
|
15209
|
-
const rowNum = Math.floor(
|
|
15349
|
+
const rowNum = Math.floor(
|
|
15350
|
+
content.length / (originHeight.current / lineH.current - 1)
|
|
15351
|
+
);
|
|
15210
15352
|
if (direction === "middle") {
|
|
15211
15353
|
const end = content.length;
|
|
15212
15354
|
ellipsis.current.leading = tailorContent(
|
|
@@ -15235,7 +15377,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15235
15377
|
const verifyEllipsis = async () => {
|
|
15236
15378
|
var _a2, _b2, _c2, _d2, _e, _f;
|
|
15237
15379
|
const refe = await getRectByTaro(rootContain.current);
|
|
15238
|
-
if (refe && refe.height && refe.height > maxHeight) {
|
|
15380
|
+
if (refe && refe.height && refe.height > maxHeight.current) {
|
|
15239
15381
|
if (direction === "end") {
|
|
15240
15382
|
ellipsis.current.leading = (_c2 = (_a2 = ellipsis.current) == null ? void 0 : _a2.leading) == null ? void 0 : _c2.slice(
|
|
15241
15383
|
0,
|
|
@@ -15402,14 +15544,14 @@ var __publicField = (obj, key, value) => {
|
|
|
15402
15544
|
current: 0,
|
|
15403
15545
|
direction: "horizontal"
|
|
15404
15546
|
};
|
|
15405
|
-
const classPrefix$
|
|
15547
|
+
const classPrefix$3 = `nut-indicator`;
|
|
15406
15548
|
const Indicator = (props) => {
|
|
15407
15549
|
const { total, current, children, className, direction, ...rest } = {
|
|
15408
15550
|
...defaultProps$i,
|
|
15409
15551
|
...props
|
|
15410
15552
|
};
|
|
15411
15553
|
const classes = classNames({
|
|
15412
|
-
[`${classPrefix$
|
|
15554
|
+
[`${classPrefix$3}__vertical`]: direction === "vertical"
|
|
15413
15555
|
});
|
|
15414
15556
|
const renderElement = () => {
|
|
15415
15557
|
const childs = [];
|
|
@@ -15419,9 +15561,9 @@ var __publicField = (obj, key, value) => {
|
|
|
15419
15561
|
"div",
|
|
15420
15562
|
{
|
|
15421
15563
|
key: item,
|
|
15422
|
-
className: `${classPrefix$
|
|
15564
|
+
className: `${classPrefix$3}__dot ${classPrefix$3}__active`
|
|
15423
15565
|
}
|
|
15424
|
-
) : /* @__PURE__ */ React.createElement("div", { key: item, className: `${classPrefix$
|
|
15566
|
+
) : /* @__PURE__ */ React.createElement("div", { key: item, className: `${classPrefix$3}__dot` })
|
|
15425
15567
|
);
|
|
15426
15568
|
}
|
|
15427
15569
|
return childs;
|
|
@@ -15437,7 +15579,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15437
15579
|
loop: false,
|
|
15438
15580
|
defaultValue: 0
|
|
15439
15581
|
};
|
|
15440
|
-
const classPrefix$
|
|
15582
|
+
const classPrefix$2 = "nut-swiper";
|
|
15441
15583
|
const Swiper = React.forwardRef((props, ref) => {
|
|
15442
15584
|
const {
|
|
15443
15585
|
width,
|
|
@@ -15468,8 +15610,8 @@ var __publicField = (obj, key, value) => {
|
|
|
15468
15610
|
"div",
|
|
15469
15611
|
{
|
|
15470
15612
|
className: classNames({
|
|
15471
|
-
[`${classPrefix$
|
|
15472
|
-
[`${classPrefix$
|
|
15613
|
+
[`${classPrefix$2}__indicator`]: true,
|
|
15614
|
+
[`${classPrefix$2}__indicator-vertical`]: direction === "vertical"
|
|
15473
15615
|
})
|
|
15474
15616
|
},
|
|
15475
15617
|
/* @__PURE__ */ React.createElement(
|
|
@@ -15511,7 +15653,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15511
15653
|
return /* @__PURE__ */ React.createElement(
|
|
15512
15654
|
components.View,
|
|
15513
15655
|
{
|
|
15514
|
-
className: classNames(classPrefix$
|
|
15656
|
+
className: classNames(classPrefix$2, className),
|
|
15515
15657
|
style: {
|
|
15516
15658
|
width: !width ? "100%" : `${width}px`,
|
|
15517
15659
|
height: !height ? "150px" : `${height}px`
|
|
@@ -16578,7 +16720,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16578
16720
|
loop: false
|
|
16579
16721
|
}
|
|
16580
16722
|
};
|
|
16581
|
-
const classPrefix = `nut-video`;
|
|
16723
|
+
const classPrefix$1 = `nut-video`;
|
|
16582
16724
|
const Video = (props) => {
|
|
16583
16725
|
const {
|
|
16584
16726
|
children,
|
|
@@ -16593,7 +16735,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16593
16735
|
...defaultProps$7,
|
|
16594
16736
|
...props
|
|
16595
16737
|
};
|
|
16596
|
-
const classes = classNames(className, classPrefix);
|
|
16738
|
+
const classes = classNames(className, classPrefix$1);
|
|
16597
16739
|
return /* @__PURE__ */ React.createElement("div", { className: classes, ...restProps }, /* @__PURE__ */ React.createElement(
|
|
16598
16740
|
components.Video,
|
|
16599
16741
|
{
|
|
@@ -16613,38 +16755,38 @@ var __publicField = (obj, key, value) => {
|
|
|
16613
16755
|
Video.defaultProps = defaultProps$7;
|
|
16614
16756
|
Video.displayName = "NutVideo";
|
|
16615
16757
|
const defaultProps$6 = {
|
|
16616
|
-
|
|
16617
|
-
|
|
16758
|
+
...ComponentDefaults,
|
|
16759
|
+
list: [],
|
|
16760
|
+
interval: 500,
|
|
16618
16761
|
loop: true,
|
|
16619
|
-
|
|
16762
|
+
duration: 3e3,
|
|
16620
16763
|
rows: 3,
|
|
16621
|
-
|
|
16764
|
+
gapY: 10
|
|
16622
16765
|
};
|
|
16766
|
+
const classPrefix = `nut-barrage`;
|
|
16623
16767
|
const InternalBarrage = (props, ref) => {
|
|
16624
16768
|
const {
|
|
16625
16769
|
className,
|
|
16626
|
-
|
|
16770
|
+
interval,
|
|
16627
16771
|
loop,
|
|
16628
|
-
|
|
16629
|
-
|
|
16772
|
+
list,
|
|
16773
|
+
duration,
|
|
16630
16774
|
rows,
|
|
16631
|
-
|
|
16775
|
+
gapY,
|
|
16632
16776
|
...restProps
|
|
16633
16777
|
} = {
|
|
16634
16778
|
...defaultProps$6,
|
|
16635
16779
|
...props
|
|
16636
16780
|
};
|
|
16637
16781
|
const [styleList, setStyleList] = React.useState([]);
|
|
16638
|
-
const [baItemList, setBaItemList] = React.useState(
|
|
16639
|
-
const barrageListSet = React.useRef(
|
|
16782
|
+
const [baItemList, setBaItemList] = React.useState(list);
|
|
16783
|
+
const barrageListSet = React.useRef(list);
|
|
16640
16784
|
const barrageBody = React.useRef(null);
|
|
16641
16785
|
const barrageContainer = React.useRef(null);
|
|
16642
16786
|
const timeId = React.useRef((/* @__PURE__ */ new Date()).getTime());
|
|
16643
16787
|
const timer = React.useRef(0);
|
|
16644
|
-
|
|
16645
|
-
|
|
16646
|
-
const classes = classNames(className, b2(""), {
|
|
16647
|
-
[`nut-barrage__body${timeId.current}`]: true
|
|
16788
|
+
const classes = classNames(className, classPrefix, {
|
|
16789
|
+
[`${classPrefix}__body${timeId.current}`]: true
|
|
16648
16790
|
});
|
|
16649
16791
|
React.useImperativeHandle(ref, () => ({
|
|
16650
16792
|
add: (word) => {
|
|
@@ -16653,53 +16795,53 @@ var __publicField = (obj, key, value) => {
|
|
|
16653
16795
|
}
|
|
16654
16796
|
}));
|
|
16655
16797
|
React.useEffect(() => {
|
|
16656
|
-
barrageListSet.current = [...
|
|
16798
|
+
barrageListSet.current = [...list];
|
|
16657
16799
|
run();
|
|
16658
16800
|
return () => {
|
|
16659
16801
|
clearInterval(timer.current);
|
|
16660
16802
|
};
|
|
16661
|
-
}, [
|
|
16803
|
+
}, [list]);
|
|
16662
16804
|
const run = () => {
|
|
16663
16805
|
setBaItemList(barrageListSet.current);
|
|
16664
|
-
barrageListSet.current.forEach((item,
|
|
16665
|
-
getNode(
|
|
16806
|
+
barrageListSet.current.forEach((item, index) => {
|
|
16807
|
+
getNode(index);
|
|
16666
16808
|
});
|
|
16667
16809
|
};
|
|
16668
|
-
const getNode = (
|
|
16810
|
+
const getNode = (index) => {
|
|
16669
16811
|
const query = Taro.createSelectorQuery();
|
|
16670
16812
|
setTimeout(() => {
|
|
16671
16813
|
let width = 100;
|
|
16672
|
-
query.select(
|
|
16814
|
+
query.select(`.${classPrefix}__body` + timeId.current).boundingClientRect((rec) => {
|
|
16673
16815
|
width = rec.width || 300;
|
|
16674
16816
|
});
|
|
16675
|
-
query.select(
|
|
16817
|
+
query.select(`.${classPrefix}__item` + index).boundingClientRect((recs) => {
|
|
16676
16818
|
let height = recs.height;
|
|
16677
|
-
let nodeTop =
|
|
16678
|
-
styleInfo(
|
|
16819
|
+
let nodeTop = index % rows * (height + gapY) + 20 + "px";
|
|
16820
|
+
styleInfo(index, nodeTop, width);
|
|
16679
16821
|
}).exec();
|
|
16680
16822
|
}, 500);
|
|
16681
16823
|
};
|
|
16682
|
-
const styleInfo = (
|
|
16683
|
-
let timeIndex =
|
|
16684
|
-
let
|
|
16685
|
-
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;
|
|
16686
16828
|
let obj = {
|
|
16687
16829
|
top: nodeTop,
|
|
16688
|
-
"--time": `${
|
|
16689
|
-
animationDuration: `${
|
|
16830
|
+
"--time": `${interval * index + time}`,
|
|
16831
|
+
animationDuration: `${duration}ms`,
|
|
16690
16832
|
animationIterationCount: `${loop ? "infinite" : 1}`,
|
|
16691
|
-
animationDelay: `${
|
|
16833
|
+
animationDelay: `${interval * index + time}ms`,
|
|
16692
16834
|
"--move-distance": `-${width}px`
|
|
16693
16835
|
};
|
|
16694
|
-
|
|
16695
|
-
setStyleList([...
|
|
16836
|
+
list2.push(obj);
|
|
16837
|
+
setStyleList([...list2]);
|
|
16696
16838
|
};
|
|
16697
|
-
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) => {
|
|
16698
16840
|
return /* @__PURE__ */ React.createElement(
|
|
16699
16841
|
"div",
|
|
16700
16842
|
{
|
|
16701
|
-
className: `barrage-item
|
|
16702
|
-
style: styleList[
|
|
16843
|
+
className: `barrage-item ${classPrefix}__item${index} move`,
|
|
16844
|
+
style: styleList[index]
|
|
16703
16845
|
},
|
|
16704
16846
|
item.length > 8 ? item.substr(0, 8) + "..." : item
|
|
16705
16847
|
);
|