@nutui/nutui-react 2.0.0-alpha.13 → 2.0.0-alpha.15
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/Avatar.js +1 -1
- package/dist/esm/AvatarGroup.js +1 -1
- package/dist/esm/Barrage/style/style.css +1 -1
- package/dist/esm/Barrage.js +23 -24
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Card/style/style.css +1 -1
- package/dist/esm/Card.js +35 -22
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/CircleProgress.js +1 -1
- package/dist/esm/ConfigProvider.js +1 -1
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/InfiniteLoading/style/style.css +1 -0
- package/dist/esm/{Infiniteloading.js → InfiniteLoading.js} +25 -37
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Picker.js +37 -40
- package/dist/esm/Popover/style/index.js +1 -1
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popover.js +214 -166
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/SideNavBar.js +17 -15
- package/dist/esm/SideNavBarItem/style/style.css +1 -1
- package/dist/esm/SideNavBarItem.js +5 -4
- package/dist/esm/Signature/style/index.js +1 -1
- package/dist/esm/Signature/style/style.css +1 -1
- package/dist/esm/Signature.js +27 -35
- package/dist/esm/Step.js +1 -1
- package/dist/esm/Steps.js +1 -1
- package/dist/esm/SubSideNavBar/style/style.css +1 -1
- package/dist/esm/SubSideNavBar.js +12 -12
- package/dist/esm/Swiper.js +1 -1
- package/dist/esm/SwiperItem.js +1 -1
- package/dist/esm/Tag/style/style.css +1 -1
- package/dist/esm/Tag.js +26 -30
- package/dist/esm/TextArea/style/style.css +1 -1
- package/dist/esm/TimeDetail/style/style.css +1 -1
- package/dist/esm/TimeDetail.js +39 -41
- package/dist/esm/TimeSelect/style/index.js +0 -1
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/TimeSelect.js +91 -114
- package/dist/esm/context.js +16 -2
- package/dist/esm/context2.js +2 -2
- package/dist/esm/context4.js +5 -0
- package/dist/esm/index.js +11 -2
- package/dist/esm/nutui-react.es.js +8 -10
- package/dist/esm/types/src/locales/base.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/card/card.d.ts +8 -9
- package/dist/esm/types/src/packages/card/card.taro.d.ts +8 -9
- package/dist/esm/types/src/packages/card/index.d.ts +1 -0
- package/dist/esm/types/src/packages/card/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
- package/dist/esm/types/src/packages/imagepreview/imagepreview.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/infiniteloading/demo.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/infiniteloading/index.d.ts +3 -2
- package/dist/esm/types/src/packages/infiniteloading/index.taro.d.ts +3 -2
- package/dist/esm/types/src/packages/infiniteloading/infiniteloading.d.ts +9 -14
- package/dist/esm/types/src/packages/infiniteloading/infiniteloading.taro.d.ts +8 -12
- 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/nutui.react.build.d.ts +2 -3
- package/dist/esm/types/src/packages/nutui.react.d.ts +2 -4
- package/dist/esm/types/src/packages/nutui.react.scss.d.ts +0 -1
- package/dist/esm/types/src/packages/nutui.react.taro.d.ts +1 -3
- package/dist/esm/types/src/packages/nutui.react.taro.scss.d.ts +0 -1
- package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +1 -2
- 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/signature/index.d.ts +1 -0
- package/dist/esm/types/src/packages/signature/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/signature/signature.d.ts +10 -8
- package/dist/esm/types/src/packages/signature/signature.taro.d.ts +7 -12
- 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/tag/index.d.ts +1 -0
- package/dist/esm/types/src/packages/tag/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/tag/tag.d.ts +4 -6
- package/dist/esm/types/src/packages/tag/tag.taro.d.ts +4 -6
- package/dist/esm/types/src/packages/timedetail/index.d.ts +1 -2
- package/dist/esm/types/src/packages/timedetail/timedetail.d.ts +9 -11
- package/dist/esm/types/src/packages/timedetail/timedetail.taro.d.ts +9 -11
- package/dist/esm/types/src/packages/timeselect/demo.taro.d.ts +0 -4
- package/dist/esm/types/src/packages/timeselect/index.d.ts +1 -0
- package/dist/esm/types/src/packages/timeselect/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/timeselect/timeselect.d.ts +25 -20
- package/dist/esm/types/src/packages/timeselect/timeselect.taro.d.ts +25 -20
- 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/locales/base.d.ts +1 -1
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +2 -2
- package/dist/locales/id-ID.js +2 -2
- package/dist/locales/tr-TR.js +2 -2
- package/dist/locales/zh-CN.js +2 -2
- package/dist/locales/zh-TW.js +2 -2
- package/dist/locales/zh-UG.js +2 -2
- package/dist/nutui.react.es.js +909 -820
- package/dist/nutui.react.umd.js +909 -820
- package/dist/packages/barrage/barrage.scss +0 -13
- package/dist/packages/card/card.scss +8 -14
- package/dist/packages/infiniteloading/infiniteloading.scss +2 -25
- 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/signature/signature.scss +1 -18
- package/dist/packages/subsidenavbar/subsidenavbar.scss +10 -19
- package/dist/packages/tag/tag.scss +10 -17
- package/dist/packages/timedetail/timedetail.scss +12 -37
- package/dist/packages/timeselect/timeselect.scss +15 -44
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +0 -1
- package/dist/styles/variables-jmapp.scss +85 -144
- package/dist/styles/variables.scss +96 -155
- package/dist/types/index.d.ts +2 -3
- package/dist/types/locales/base.d.ts +1 -1
- package/dist/types/packages/barrage/barrage.d.ts +32 -9
- package/dist/types/packages/barrage/index.d.ts +1 -0
- package/dist/types/packages/button/button.d.ts +1 -0
- package/dist/types/packages/card/card.d.ts +57 -14
- package/dist/types/packages/card/index.d.ts +1 -0
- package/dist/types/packages/configprovider/types.d.ts +1 -1
- package/dist/types/packages/infiniteloading/index.d.ts +3 -2
- package/dist/types/packages/infiniteloading/infiniteloading.d.ts +57 -18
- package/dist/types/packages/popover/index.d.ts +1 -0
- package/dist/types/packages/popover/popover.d.ts +99 -12
- package/dist/types/packages/sidenavbar/index.d.ts +1 -0
- package/dist/types/packages/sidenavbar/sidenavbar.d.ts +33 -13
- package/dist/types/packages/sidenavbaritem/index.d.ts +1 -0
- package/dist/types/packages/sidenavbaritem/sidenavbaritem.d.ts +3 -3
- package/dist/types/packages/signature/index.d.ts +1 -0
- package/dist/types/packages/signature/signature.d.ts +38 -12
- package/dist/types/packages/subsidenavbar/index.d.ts +1 -0
- package/dist/types/packages/subsidenavbar/subsidenavbar.d.ts +3 -3
- package/dist/types/packages/tag/index.d.ts +1 -0
- package/dist/types/packages/tag/tag.d.ts +52 -14
- package/dist/types/packages/timedetail/index.d.ts +1 -2
- package/dist/types/packages/timedetail/timedetail.d.ts +9 -11
- package/dist/types/packages/timeselect/index.d.ts +1 -0
- package/dist/types/packages/timeselect/timeselect.d.ts +62 -21
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/use-click-away.d.ts +3 -0
- package/package.json +1 -1
- package/dist/esm/Infiniteloading/style/style.css +0 -1
- package/dist/esm/TimePannel/style/css.js +0 -1
- package/dist/esm/TimePannel/style/index.js +0 -2
- package/dist/esm/TimePannel/style/style.css +0 -1
- package/dist/esm/TimePannel.js +0 -47
- package/dist/esm/offsetContext.js +0 -19
- 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/types/src/packages/timedetail/demo.d.ts +0 -3
- package/dist/esm/types/src/packages/timedetail/demo.taro.d.ts +0 -3
- package/dist/esm/types/src/packages/timepannel/demo.d.ts +0 -3
- package/dist/esm/types/src/packages/timepannel/demo.taro.d.ts +0 -3
- package/dist/esm/types/src/packages/timepannel/index.d.ts +0 -2
- package/dist/esm/types/src/packages/timepannel/index.taro.d.ts +0 -2
- package/dist/esm/types/src/packages/timepannel/timepannel.d.ts +0 -8
- package/dist/esm/types/src/packages/timepannel/timepannel.taro.d.ts +0 -8
- package/dist/packages/timepannel/timepannel.scss +0 -17
- package/dist/types/packages/popover/Trigger.d.ts +0 -19
- package/dist/types/packages/timepannel/index.d.ts +0 -2
- package/dist/types/packages/timepannel/timepannel.d.ts +0 -8
- /package/dist/esm/{Infiniteloading → InfiniteLoading}/style/css.js +0 -0
- /package/dist/esm/{Infiniteloading → InfiniteLoading}/style/index.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
|
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
var _a;
|
|
8
8
|
/*!
|
|
9
|
-
* @nutui/nutui-react v2.0.0-alpha.
|
|
9
|
+
* @nutui/nutui-react v2.0.0-alpha.15 Wed Jun 07 2023 16:11:56 GMT+0800 (China Standard Time)
|
|
10
10
|
* (c) 2023 @jdf2e.
|
|
11
11
|
* Released under the MIT License.
|
|
12
12
|
*/
|
|
@@ -2391,7 +2391,7 @@ const ComponentDefaults = {
|
|
|
2391
2391
|
style: {}
|
|
2392
2392
|
};
|
|
2393
2393
|
const prefixCls = "nut-button";
|
|
2394
|
-
const defaultProps$
|
|
2394
|
+
const defaultProps$1r = {
|
|
2395
2395
|
...ComponentDefaults,
|
|
2396
2396
|
color: "",
|
|
2397
2397
|
type: "default",
|
|
@@ -2423,7 +2423,7 @@ const Button = React__default.forwardRef(
|
|
|
2423
2423
|
style,
|
|
2424
2424
|
...rest
|
|
2425
2425
|
} = {
|
|
2426
|
-
...defaultProps$
|
|
2426
|
+
...defaultProps$1r,
|
|
2427
2427
|
...props
|
|
2428
2428
|
};
|
|
2429
2429
|
const getStyle = useCallback(() => {
|
|
@@ -2476,7 +2476,7 @@ const Button = React__default.forwardRef(
|
|
|
2476
2476
|
}
|
|
2477
2477
|
);
|
|
2478
2478
|
Button.displayName = "NutButton";
|
|
2479
|
-
const defaultProps$
|
|
2479
|
+
const defaultProps$1q = {
|
|
2480
2480
|
...ComponentDefaults,
|
|
2481
2481
|
title: null,
|
|
2482
2482
|
description: null,
|
|
@@ -2486,7 +2486,7 @@ const defaultProps$1r = {
|
|
|
2486
2486
|
onClick: (event) => {
|
|
2487
2487
|
}
|
|
2488
2488
|
};
|
|
2489
|
-
const classPrefix$
|
|
2489
|
+
const classPrefix$n = "nut-cell";
|
|
2490
2490
|
const Cell = (props) => {
|
|
2491
2491
|
const {
|
|
2492
2492
|
children,
|
|
@@ -2500,7 +2500,7 @@ const Cell = (props) => {
|
|
|
2500
2500
|
style,
|
|
2501
2501
|
...rest
|
|
2502
2502
|
} = {
|
|
2503
|
-
...defaultProps$
|
|
2503
|
+
...defaultProps$1q,
|
|
2504
2504
|
...props
|
|
2505
2505
|
};
|
|
2506
2506
|
const handleClick2 = (event) => {
|
|
@@ -2517,44 +2517,44 @@ const Cell = (props) => {
|
|
|
2517
2517
|
return /* @__PURE__ */ React__default.createElement(
|
|
2518
2518
|
"div",
|
|
2519
2519
|
{
|
|
2520
|
-
className: classNames(classPrefix$
|
|
2520
|
+
className: classNames(classPrefix$n, className),
|
|
2521
2521
|
onClick: (event) => handleClick2(event),
|
|
2522
2522
|
style: baseStyle,
|
|
2523
2523
|
...rest
|
|
2524
2524
|
},
|
|
2525
|
-
children || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, title || description ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$
|
|
2525
|
+
children || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, title || description ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$n}__left` }, title ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$n}__title` }, title) : null, description ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$n}__description` }, description) : null) : null, extra ? /* @__PURE__ */ React__default.createElement(
|
|
2526
2526
|
"div",
|
|
2527
2527
|
{
|
|
2528
|
-
className: `${classPrefix$
|
|
2528
|
+
className: `${classPrefix$n}__extra`,
|
|
2529
2529
|
style: styles
|
|
2530
2530
|
},
|
|
2531
2531
|
extra
|
|
2532
|
-
) : null, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$
|
|
2532
|
+
) : null, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$n}__divider` }))
|
|
2533
2533
|
);
|
|
2534
2534
|
};
|
|
2535
|
-
Cell.defaultProps = defaultProps$
|
|
2535
|
+
Cell.defaultProps = defaultProps$1q;
|
|
2536
2536
|
Cell.displayName = "NutCell";
|
|
2537
|
-
const defaultProps$
|
|
2537
|
+
const defaultProps$1p = {
|
|
2538
2538
|
...ComponentDefaults,
|
|
2539
2539
|
title: "",
|
|
2540
2540
|
description: "",
|
|
2541
2541
|
divider: true
|
|
2542
2542
|
};
|
|
2543
|
-
const classPrefix$
|
|
2543
|
+
const classPrefix$m = "nut-cell-group";
|
|
2544
2544
|
const CellGroup = (props) => {
|
|
2545
2545
|
const { children, className, style, title, description, divider, ...rest } = {
|
|
2546
|
-
...defaultProps$
|
|
2546
|
+
...defaultProps$1p,
|
|
2547
2547
|
...props
|
|
2548
2548
|
};
|
|
2549
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix$
|
|
2549
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix$m, className), ...rest }, title ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$m}__title` }, title) : null, description ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$m}__description` }, description) : null, /* @__PURE__ */ React__default.createElement(
|
|
2550
2550
|
"div",
|
|
2551
2551
|
{
|
|
2552
|
-
className: `${classPrefix$
|
|
2552
|
+
className: `${classPrefix$m}__wrap ${divider ? `${classPrefix$m}__wrap--divider` : ""}`
|
|
2553
2553
|
},
|
|
2554
2554
|
children
|
|
2555
2555
|
));
|
|
2556
2556
|
};
|
|
2557
|
-
CellGroup.defaultProps = defaultProps$
|
|
2557
|
+
CellGroup.defaultProps = defaultProps$1p;
|
|
2558
2558
|
CellGroup.displayName = "NutCellGroup";
|
|
2559
2559
|
var INFINITY = 1 / 0;
|
|
2560
2560
|
var symbolTag = "[object Symbol]";
|
|
@@ -2906,7 +2906,7 @@ const zhCN = {
|
|
|
2906
2906
|
},
|
|
2907
2907
|
signature: {
|
|
2908
2908
|
reSign: "重签",
|
|
2909
|
-
|
|
2909
|
+
unsupported: "对不起,当前浏览器不支持Canvas,无法使用本控件!"
|
|
2910
2910
|
},
|
|
2911
2911
|
ecard: {
|
|
2912
2912
|
chooseText: "请选择电子卡面值",
|
|
@@ -2969,7 +2969,7 @@ const zhCN = {
|
|
|
2969
2969
|
errorCanvasTips: "当前环境不支持Canvas"
|
|
2970
2970
|
}
|
|
2971
2971
|
};
|
|
2972
|
-
const defaultProps$
|
|
2972
|
+
const defaultProps$1o = {
|
|
2973
2973
|
locale: zhCN
|
|
2974
2974
|
};
|
|
2975
2975
|
const defaultConfigRef = {
|
|
@@ -2992,7 +2992,7 @@ function convertThemeVarsToCSSVars(themeVars) {
|
|
|
2992
2992
|
return cssVars;
|
|
2993
2993
|
}
|
|
2994
2994
|
const ConfigProvider = (props) => {
|
|
2995
|
-
const { children, ...config2 } = { ...defaultProps$
|
|
2995
|
+
const { children, ...config2 } = { ...defaultProps$1o, ...props };
|
|
2996
2996
|
const parentConfig = useConfig();
|
|
2997
2997
|
const theme = config2.theme || {};
|
|
2998
2998
|
const style = useMemo(
|
|
@@ -3010,12 +3010,12 @@ const ConfigProvider = (props) => {
|
|
|
3010
3010
|
/* @__PURE__ */ React__default.createElement("div", { style }, children)
|
|
3011
3011
|
);
|
|
3012
3012
|
};
|
|
3013
|
-
ConfigProvider.defaultProps = defaultProps$
|
|
3013
|
+
ConfigProvider.defaultProps = defaultProps$1o;
|
|
3014
3014
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
3015
3015
|
const pxCheck = (value) => {
|
|
3016
3016
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
3017
3017
|
};
|
|
3018
|
-
const defaultProps$
|
|
3018
|
+
const defaultProps$1n = {
|
|
3019
3019
|
...ComponentDefaults,
|
|
3020
3020
|
fit: "fill",
|
|
3021
3021
|
position: "center",
|
|
@@ -3026,7 +3026,7 @@ const defaultProps$1o = {
|
|
|
3026
3026
|
loading: true,
|
|
3027
3027
|
lazy: false
|
|
3028
3028
|
};
|
|
3029
|
-
const classPrefix$
|
|
3029
|
+
const classPrefix$l = "nut-image";
|
|
3030
3030
|
const Image$1 = (props) => {
|
|
3031
3031
|
const {
|
|
3032
3032
|
className,
|
|
@@ -3044,7 +3044,7 @@ const Image$1 = (props) => {
|
|
|
3044
3044
|
onClick,
|
|
3045
3045
|
onLoad,
|
|
3046
3046
|
onError
|
|
3047
|
-
} = { ...defaultProps$
|
|
3047
|
+
} = { ...defaultProps$1n, ...props };
|
|
3048
3048
|
const [innerLoading, setInnerLoading] = useState(true);
|
|
3049
3049
|
const [isError, setIsError] = useState(false);
|
|
3050
3050
|
const imgRef = useRef(null);
|
|
@@ -3137,7 +3137,7 @@ const Image$1 = (props) => {
|
|
|
3137
3137
|
return /* @__PURE__ */ React__default.createElement(
|
|
3138
3138
|
"div",
|
|
3139
3139
|
{
|
|
3140
|
-
className: classNames(classPrefix$
|
|
3140
|
+
className: classNames(classPrefix$l, className),
|
|
3141
3141
|
style: containerStyle,
|
|
3142
3142
|
onClick: (e) => {
|
|
3143
3143
|
imageClick(e);
|
|
@@ -3171,7 +3171,7 @@ const Image$1 = (props) => {
|
|
|
3171
3171
|
renderErrorImg()
|
|
3172
3172
|
);
|
|
3173
3173
|
};
|
|
3174
|
-
Image$1.defaultProps = defaultProps$
|
|
3174
|
+
Image$1.defaultProps = defaultProps$1n;
|
|
3175
3175
|
Image$1.displayName = "NutImage";
|
|
3176
3176
|
const defaultOverlayProps = {
|
|
3177
3177
|
...ComponentDefaults,
|
|
@@ -3256,7 +3256,7 @@ const Overlay = (props) => {
|
|
|
3256
3256
|
Overlay.defaultProps = defaultOverlayProps;
|
|
3257
3257
|
Overlay.displayName = "NutOverlay";
|
|
3258
3258
|
const DataContext$2 = createContext({});
|
|
3259
|
-
const defaultProps$
|
|
3259
|
+
const defaultProps$1m = {
|
|
3260
3260
|
...ComponentDefaults,
|
|
3261
3261
|
span: "24",
|
|
3262
3262
|
offset: "0",
|
|
@@ -3264,7 +3264,7 @@ const defaultProps$1n = {
|
|
|
3264
3264
|
};
|
|
3265
3265
|
const Col = (props) => {
|
|
3266
3266
|
const { className, style, span, offset, children, onClick } = {
|
|
3267
|
-
...defaultProps$
|
|
3267
|
+
...defaultProps$1m,
|
|
3268
3268
|
...props
|
|
3269
3269
|
};
|
|
3270
3270
|
const [colName, setColName] = useState("");
|
|
@@ -3296,39 +3296,39 @@ const Col = (props) => {
|
|
|
3296
3296
|
children
|
|
3297
3297
|
);
|
|
3298
3298
|
};
|
|
3299
|
-
Col.defaultProps = defaultProps$
|
|
3299
|
+
Col.defaultProps = defaultProps$1m;
|
|
3300
3300
|
Col.displayName = "NutCol";
|
|
3301
|
-
const defaultProps$
|
|
3301
|
+
const defaultProps$1l = {
|
|
3302
3302
|
...ComponentDefaults,
|
|
3303
3303
|
contentPosition: "center",
|
|
3304
3304
|
direction: "horizontal"
|
|
3305
3305
|
};
|
|
3306
|
-
const classPrefix$
|
|
3306
|
+
const classPrefix$k = `nut-divider`;
|
|
3307
3307
|
const Divider = (props) => {
|
|
3308
3308
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
3309
|
-
...defaultProps$
|
|
3309
|
+
...defaultProps$1l,
|
|
3310
3310
|
...props
|
|
3311
3311
|
};
|
|
3312
3312
|
const classes = direction === "horizontal" ? classNames({
|
|
3313
|
-
[`${classPrefix$
|
|
3314
|
-
[`${classPrefix$
|
|
3315
|
-
[`${classPrefix$
|
|
3316
|
-
[`${classPrefix$
|
|
3317
|
-
[`${classPrefix$
|
|
3313
|
+
[`${classPrefix$k}`]: true,
|
|
3314
|
+
[`${classPrefix$k}__center`]: children,
|
|
3315
|
+
[`${classPrefix$k}__left`]: contentPosition === "left",
|
|
3316
|
+
[`${classPrefix$k}__right`]: contentPosition === "right",
|
|
3317
|
+
[`${classPrefix$k}__hairline`]: true
|
|
3318
3318
|
}) : classNames({
|
|
3319
|
-
[`${classPrefix$
|
|
3320
|
-
[`${classPrefix$
|
|
3319
|
+
[`${classPrefix$k}`]: true,
|
|
3320
|
+
[`${classPrefix$k}__vertical`]: direction === "vertical"
|
|
3321
3321
|
});
|
|
3322
3322
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classes} ${className || ""}`, style, ...rest }, children);
|
|
3323
3323
|
};
|
|
3324
|
-
Divider.defaultProps = defaultProps$
|
|
3324
|
+
Divider.defaultProps = defaultProps$1l;
|
|
3325
3325
|
Divider.displayName = "NutDivider";
|
|
3326
3326
|
const gridContext = {
|
|
3327
3327
|
onClick: (item, index) => {
|
|
3328
3328
|
}
|
|
3329
3329
|
};
|
|
3330
3330
|
const GridContext = React__default.createContext(gridContext);
|
|
3331
|
-
const defaultProps$
|
|
3331
|
+
const defaultProps$1k = {
|
|
3332
3332
|
text: "",
|
|
3333
3333
|
columns: 4,
|
|
3334
3334
|
gap: 0,
|
|
@@ -3354,7 +3354,7 @@ const GridItem = (props) => {
|
|
|
3354
3354
|
onClick,
|
|
3355
3355
|
...rest
|
|
3356
3356
|
} = {
|
|
3357
|
-
...defaultProps$
|
|
3357
|
+
...defaultProps$1k,
|
|
3358
3358
|
...props
|
|
3359
3359
|
};
|
|
3360
3360
|
const classPrefix2 = "nut-grid-item";
|
|
@@ -3412,9 +3412,9 @@ const GridItem = (props) => {
|
|
|
3412
3412
|
/* @__PURE__ */ React__default.createElement("div", { className: contentClass() }, children && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children), text && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__text` }, text))
|
|
3413
3413
|
);
|
|
3414
3414
|
};
|
|
3415
|
-
GridItem.defaultProps = defaultProps$
|
|
3415
|
+
GridItem.defaultProps = defaultProps$1k;
|
|
3416
3416
|
GridItem.displayName = "NutGridItem";
|
|
3417
|
-
const defaultProps$
|
|
3417
|
+
const defaultProps$1j = {
|
|
3418
3418
|
columns: 4,
|
|
3419
3419
|
gap: 0,
|
|
3420
3420
|
center: true,
|
|
@@ -3435,7 +3435,7 @@ const Grid = (props) => {
|
|
|
3435
3435
|
className,
|
|
3436
3436
|
onClick,
|
|
3437
3437
|
...rest
|
|
3438
|
-
} = { ...defaultProps$
|
|
3438
|
+
} = { ...defaultProps$1j, ...props };
|
|
3439
3439
|
const childrenDom = React__default.Children.toArray(children);
|
|
3440
3440
|
const classPrefix2 = "nut-grid";
|
|
3441
3441
|
const rootClass = () => {
|
|
@@ -3465,18 +3465,18 @@ const Grid = (props) => {
|
|
|
3465
3465
|
});
|
|
3466
3466
|
})));
|
|
3467
3467
|
};
|
|
3468
|
-
Grid.defaultProps = defaultProps$
|
|
3468
|
+
Grid.defaultProps = defaultProps$1j;
|
|
3469
3469
|
Grid.displayName = "NutGrid";
|
|
3470
3470
|
Grid.Item = GridItem;
|
|
3471
|
-
const defaultProps$
|
|
3471
|
+
const defaultProps$1i = {};
|
|
3472
3472
|
const Layout = (props) => {
|
|
3473
|
-
({ ...defaultProps$
|
|
3473
|
+
({ ...defaultProps$1i, ...props });
|
|
3474
3474
|
return /* @__PURE__ */ React__default.createElement("div", { className: "nut-layout" }, "Layout");
|
|
3475
3475
|
};
|
|
3476
|
-
Layout.defaultProps = defaultProps$
|
|
3476
|
+
Layout.defaultProps = defaultProps$1i;
|
|
3477
3477
|
Layout.displayName = "NutLayout";
|
|
3478
|
-
const classPrefix$
|
|
3479
|
-
const defaultProps$
|
|
3478
|
+
const classPrefix$j = "nut-row";
|
|
3479
|
+
const defaultProps$1h = {
|
|
3480
3480
|
...ComponentDefaults,
|
|
3481
3481
|
type: "",
|
|
3482
3482
|
justify: "start",
|
|
@@ -3496,7 +3496,7 @@ const Row = (props) => {
|
|
|
3496
3496
|
gutter,
|
|
3497
3497
|
onClick
|
|
3498
3498
|
} = {
|
|
3499
|
-
...defaultProps$
|
|
3499
|
+
...defaultProps$1h,
|
|
3500
3500
|
...props
|
|
3501
3501
|
};
|
|
3502
3502
|
const getClass = (prefix2, type22) => {
|
|
@@ -3510,7 +3510,7 @@ const Row = (props) => {
|
|
|
3510
3510
|
${getClass("justify", justify)}
|
|
3511
3511
|
${getClass("align", align)}
|
|
3512
3512
|
${getClass("flex", wrap)}
|
|
3513
|
-
${classPrefix$
|
|
3513
|
+
${classPrefix$j}
|
|
3514
3514
|
`;
|
|
3515
3515
|
};
|
|
3516
3516
|
const parentRow = {
|
|
@@ -3528,7 +3528,7 @@ const Row = (props) => {
|
|
|
3528
3528
|
children
|
|
3529
3529
|
));
|
|
3530
3530
|
};
|
|
3531
|
-
Row.defaultProps = defaultProps$
|
|
3531
|
+
Row.defaultProps = defaultProps$1h;
|
|
3532
3532
|
Row.displayName = "NutRow";
|
|
3533
3533
|
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
3534
3534
|
const defaultRoot = canUseDom ? window : void 0;
|
|
@@ -3603,13 +3603,13 @@ function useWatch(dep, callback, config2 = { immediate: false }) {
|
|
|
3603
3603
|
stop2.current = true;
|
|
3604
3604
|
};
|
|
3605
3605
|
}
|
|
3606
|
-
const defaultProps$
|
|
3606
|
+
const defaultProps$1g = {
|
|
3607
3607
|
...ComponentDefaults,
|
|
3608
3608
|
position: "top",
|
|
3609
3609
|
threshold: 0,
|
|
3610
3610
|
zIndex: 2e3
|
|
3611
3611
|
};
|
|
3612
|
-
const classPrefix$
|
|
3612
|
+
const classPrefix$i = "nut-sticky";
|
|
3613
3613
|
const Sticky = (props) => {
|
|
3614
3614
|
const {
|
|
3615
3615
|
position,
|
|
@@ -3621,7 +3621,7 @@ const Sticky = (props) => {
|
|
|
3621
3621
|
threshold,
|
|
3622
3622
|
onChange,
|
|
3623
3623
|
...rest
|
|
3624
|
-
} = { ...defaultProps$
|
|
3624
|
+
} = { ...defaultProps$1g, ...props };
|
|
3625
3625
|
const stickyRef = useRef(null);
|
|
3626
3626
|
const rootRef = useRef(null);
|
|
3627
3627
|
const [isFixed, setIsFixed] = useState(false);
|
|
@@ -3731,15 +3731,15 @@ const Sticky = (props) => {
|
|
|
3731
3731
|
{
|
|
3732
3732
|
ref: rootRef,
|
|
3733
3733
|
style: { ...style, ...rootStyle },
|
|
3734
|
-
className: classNames(classPrefix$
|
|
3734
|
+
className: classNames(classPrefix$i, className),
|
|
3735
3735
|
...rest
|
|
3736
3736
|
},
|
|
3737
3737
|
/* @__PURE__ */ React__default.createElement("div", { className: "nut-sticky--box", ref: stickyRef, style: stickyStyle }, children)
|
|
3738
3738
|
);
|
|
3739
3739
|
};
|
|
3740
|
-
Sticky.defaultProps = defaultProps$
|
|
3740
|
+
Sticky.defaultProps = defaultProps$1g;
|
|
3741
3741
|
Sticky.displayName = "NutSticky";
|
|
3742
|
-
const defaultProps$
|
|
3742
|
+
const defaultProps$1f = {
|
|
3743
3743
|
...ComponentDefaults,
|
|
3744
3744
|
target: "",
|
|
3745
3745
|
threshold: 200,
|
|
@@ -3757,7 +3757,7 @@ const BackTop = (props) => {
|
|
|
3757
3757
|
style,
|
|
3758
3758
|
onClick
|
|
3759
3759
|
} = {
|
|
3760
|
-
...defaultProps$
|
|
3760
|
+
...defaultProps$1f,
|
|
3761
3761
|
...props
|
|
3762
3762
|
};
|
|
3763
3763
|
const classPrefix2 = "nut-backtop";
|
|
@@ -3855,7 +3855,7 @@ const BackTop = (props) => {
|
|
|
3855
3855
|
children || /* @__PURE__ */ React__default.createElement(y$2, { width: 19, height: 19, className: "nut-backtop-main" })
|
|
3856
3856
|
);
|
|
3857
3857
|
};
|
|
3858
|
-
BackTop.defaultProps = defaultProps$
|
|
3858
|
+
BackTop.defaultProps = defaultProps$1f;
|
|
3859
3859
|
BackTop.displayName = "NutBackTop";
|
|
3860
3860
|
function clamp$1(v, min, max) {
|
|
3861
3861
|
return Math.max(min, Math.min(v, max));
|
|
@@ -8973,7 +8973,7 @@ const host = createHost(primitives, {
|
|
|
8973
8973
|
});
|
|
8974
8974
|
const animated = host.animated;
|
|
8975
8975
|
const elevatorContext = createContext({});
|
|
8976
|
-
const defaultProps$
|
|
8976
|
+
const defaultProps$1e = {
|
|
8977
8977
|
...ComponentDefaults,
|
|
8978
8978
|
height: "200px",
|
|
8979
8979
|
floorKey: "title",
|
|
@@ -8999,7 +8999,7 @@ const Elevator = (props) => {
|
|
|
8999
8999
|
children,
|
|
9000
9000
|
...rest
|
|
9001
9001
|
} = {
|
|
9002
|
-
...defaultProps$
|
|
9002
|
+
...defaultProps$1e,
|
|
9003
9003
|
...props
|
|
9004
9004
|
};
|
|
9005
9005
|
const classPrefix2 = "nut-elevator";
|
|
@@ -9174,10 +9174,10 @@ const Elevator = (props) => {
|
|
|
9174
9174
|
})
|
|
9175
9175
|
))) : null);
|
|
9176
9176
|
};
|
|
9177
|
-
Elevator.defaultProps = defaultProps$
|
|
9177
|
+
Elevator.defaultProps = defaultProps$1e;
|
|
9178
9178
|
Elevator.displayName = "NutElevator";
|
|
9179
9179
|
Elevator.Context = elevatorContext;
|
|
9180
|
-
const defaultProps$
|
|
9180
|
+
const defaultProps$1d = {
|
|
9181
9181
|
...ComponentDefaults,
|
|
9182
9182
|
activeText: "",
|
|
9183
9183
|
inactiveText: "",
|
|
@@ -9205,7 +9205,7 @@ const FixedNav = (props) => {
|
|
|
9205
9205
|
content,
|
|
9206
9206
|
...rest
|
|
9207
9207
|
} = {
|
|
9208
|
-
...defaultProps$
|
|
9208
|
+
...defaultProps$1d,
|
|
9209
9209
|
...props
|
|
9210
9210
|
};
|
|
9211
9211
|
const classPrefix2 = "nut-fixednav";
|
|
@@ -9257,9 +9257,9 @@ const FixedNav = (props) => {
|
|
|
9257
9257
|
/* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__btn`, onClick: () => onUpdateValue() }, content || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(y$6, { color: "#fff" }), /* @__PURE__ */ React__default.createElement("div", { className: "text" }, visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText)))
|
|
9258
9258
|
);
|
|
9259
9259
|
};
|
|
9260
|
-
FixedNav.defaultProps = defaultProps$
|
|
9260
|
+
FixedNav.defaultProps = defaultProps$1d;
|
|
9261
9261
|
FixedNav.displayName = "NutFixedNav";
|
|
9262
|
-
const defaultProps$
|
|
9262
|
+
const defaultProps$1c = {
|
|
9263
9263
|
...ComponentDefaults,
|
|
9264
9264
|
left: "",
|
|
9265
9265
|
right: "",
|
|
@@ -9282,7 +9282,7 @@ const NavBar = (props) => {
|
|
|
9282
9282
|
zIndex,
|
|
9283
9283
|
onClickBack
|
|
9284
9284
|
} = {
|
|
9285
|
-
...defaultProps$
|
|
9285
|
+
...defaultProps$1c,
|
|
9286
9286
|
...props
|
|
9287
9287
|
};
|
|
9288
9288
|
const classPrefix2 = "nut-navbar";
|
|
@@ -9319,7 +9319,7 @@ const NavBar = (props) => {
|
|
|
9319
9319
|
const cls = classNames(classPrefix2, classes, className);
|
|
9320
9320
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, fixed && placeholder ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}--placeholder` }, renderWrapper()) : renderWrapper());
|
|
9321
9321
|
};
|
|
9322
|
-
NavBar.defaultProps = defaultProps$
|
|
9322
|
+
NavBar.defaultProps = defaultProps$1c;
|
|
9323
9323
|
NavBar.displayName = "NutNavBar";
|
|
9324
9324
|
function _extends$1() {
|
|
9325
9325
|
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
|
|
@@ -11062,7 +11062,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$1({},
|
|
|
11062
11062
|
onExited: propTypesExports.func
|
|
11063
11063
|
}) : {};
|
|
11064
11064
|
const CSSTransition$1 = CSSTransition;
|
|
11065
|
-
const defaultProps$
|
|
11065
|
+
const defaultProps$1b = {
|
|
11066
11066
|
...ComponentDefaults,
|
|
11067
11067
|
position: "center",
|
|
11068
11068
|
transition: "",
|
|
@@ -11235,28 +11235,29 @@ const Popup = (props) => {
|
|
|
11235
11235
|
}, [position, transition]);
|
|
11236
11236
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderToContainer(portal, renderNode()));
|
|
11237
11237
|
};
|
|
11238
|
-
Popup.defaultProps = defaultProps$
|
|
11238
|
+
Popup.defaultProps = defaultProps$1b;
|
|
11239
11239
|
Popup.displayName = "NutPopup";
|
|
11240
11240
|
const handleClick = (e) => {
|
|
11241
11241
|
e.stopPropagation();
|
|
11242
11242
|
const isIcon = e.target.className.includes("arrow-icon");
|
|
11243
11243
|
const isTitle = e.target.className.includes("__title") || isIcon;
|
|
11244
11244
|
const currentClass = e.currentTarget.className;
|
|
11245
|
-
const isShow = currentClass.includes("
|
|
11245
|
+
const isShow = currentClass.includes("sidenavbar-show");
|
|
11246
11246
|
const arrowIcon = e.currentTarget.querySelector(".arrow-icon");
|
|
11247
11247
|
const iconClass = arrowIcon.className;
|
|
11248
11248
|
if (isTitle) {
|
|
11249
|
-
e.currentTarget.className = isShow ? currentClass.replace("
|
|
11249
|
+
e.currentTarget.className = isShow ? currentClass.replace("sidenavbar-show", "sidenavbar-hide") : currentClass.replace("sidenavbar-hide", "sidenavbar-show");
|
|
11250
11250
|
arrowIcon.className = isShow ? iconClass.replace("arrow-down", "arrow-up") : iconClass.replace("arrow-up", "arrow-down");
|
|
11251
11251
|
}
|
|
11252
11252
|
};
|
|
11253
11253
|
const OffsetContext = createContext(20);
|
|
11254
|
-
const defaultProps$
|
|
11255
|
-
|
|
11254
|
+
const defaultProps$1a = {
|
|
11255
|
+
...ComponentDefaults,
|
|
11256
11256
|
position: "left",
|
|
11257
11257
|
width: "80%"
|
|
11258
11258
|
};
|
|
11259
11259
|
const SideNavBar = (props) => {
|
|
11260
|
+
const classPrefix2 = "nut-sidenavbar";
|
|
11260
11261
|
const {
|
|
11261
11262
|
title,
|
|
11262
11263
|
visible,
|
|
@@ -11264,14 +11265,13 @@ const SideNavBar = (props) => {
|
|
|
11264
11265
|
position,
|
|
11265
11266
|
children,
|
|
11266
11267
|
className,
|
|
11267
|
-
showhead,
|
|
11268
11268
|
onClose,
|
|
11269
11269
|
...rest
|
|
11270
11270
|
} = {
|
|
11271
|
-
...defaultProps$
|
|
11271
|
+
...defaultProps$1a,
|
|
11272
11272
|
...props
|
|
11273
11273
|
};
|
|
11274
|
-
const
|
|
11274
|
+
const indent = props.indent ? Number(props.indent) : 20;
|
|
11275
11275
|
return /* @__PURE__ */ React__default.createElement(
|
|
11276
11276
|
Popup,
|
|
11277
11277
|
{
|
|
@@ -11280,58 +11280,60 @@ const SideNavBar = (props) => {
|
|
|
11280
11280
|
position,
|
|
11281
11281
|
onClose
|
|
11282
11282
|
},
|
|
11283
|
-
/* @__PURE__ */ React__default.createElement(
|
|
11283
|
+
/* @__PURE__ */ React__default.createElement("div", { className: classNames(className, classPrefix2), ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__content` }, /* @__PURE__ */ React__default.createElement(
|
|
11284
11284
|
"div",
|
|
11285
11285
|
{
|
|
11286
|
-
className:
|
|
11287
|
-
|
|
11286
|
+
className: `${classPrefix2}__list sidenavbar-show`,
|
|
11287
|
+
onClick: handleClick
|
|
11288
11288
|
},
|
|
11289
|
-
/* @__PURE__ */ React__default.createElement(
|
|
11289
|
+
/* @__PURE__ */ React__default.createElement(
|
|
11290
11290
|
"div",
|
|
11291
11291
|
{
|
|
11292
|
-
className:
|
|
11293
|
-
style: { paddingLeft: `${
|
|
11292
|
+
className: `${classPrefix2}__title ${classPrefix2}-border-bt`,
|
|
11293
|
+
style: { paddingLeft: `${indent}px` }
|
|
11294
11294
|
},
|
|
11295
11295
|
title,
|
|
11296
11296
|
" ",
|
|
11297
11297
|
/* @__PURE__ */ React__default.createElement("i", { className: "arrow-icon arrow-down" })
|
|
11298
|
-
),
|
|
11299
|
-
|
|
11298
|
+
),
|
|
11299
|
+
/* @__PURE__ */ React__default.createElement(OffsetContext.Provider, { value: indent }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__content` }, children))
|
|
11300
|
+
)))
|
|
11300
11301
|
);
|
|
11301
11302
|
};
|
|
11302
|
-
SideNavBar.defaultProps = defaultProps$
|
|
11303
|
+
SideNavBar.defaultProps = defaultProps$1a;
|
|
11303
11304
|
SideNavBar.displayName = "NutSideNavBar";
|
|
11304
11305
|
const SideNavBarItem = (props) => {
|
|
11305
|
-
const
|
|
11306
|
+
const classPrefix2 = "nut-subsidenavbar";
|
|
11307
|
+
const { title, value, children, onClick, ...rest } = props;
|
|
11306
11308
|
const clickFn = (e) => {
|
|
11307
11309
|
e.stopPropagation();
|
|
11308
|
-
onClick && onClick({ title,
|
|
11310
|
+
onClick && onClick({ title, value });
|
|
11309
11311
|
};
|
|
11310
11312
|
return /* @__PURE__ */ React__default.createElement(
|
|
11311
11313
|
"div",
|
|
11312
11314
|
{
|
|
11313
|
-
className:
|
|
11315
|
+
className: `${classPrefix2}__item ${classPrefix2}-border-bt`,
|
|
11314
11316
|
onClick: clickFn,
|
|
11315
11317
|
...rest
|
|
11316
11318
|
},
|
|
11317
11319
|
title
|
|
11318
11320
|
);
|
|
11319
11321
|
};
|
|
11320
|
-
const defaultProps$
|
|
11322
|
+
const defaultProps$19 = {
|
|
11321
11323
|
open: true
|
|
11322
11324
|
};
|
|
11323
11325
|
const SubSideNavBar = (props) => {
|
|
11324
|
-
const
|
|
11325
|
-
|
|
11326
|
+
const classPrefix2 = "nut-subsidenavbar";
|
|
11327
|
+
const { title, value, children, onClick, open, ...rest } = {
|
|
11328
|
+
...defaultProps$19,
|
|
11326
11329
|
...props
|
|
11327
11330
|
};
|
|
11328
11331
|
const offset = useContext(OffsetContext);
|
|
11329
|
-
console.log("offset>>>>>>>", offset);
|
|
11330
11332
|
const listRef = useRef(null);
|
|
11331
11333
|
const setListLevel = useCallback(
|
|
11332
11334
|
(nodeList, level = 1) => {
|
|
11333
11335
|
const titleClass = nodeList[0].className;
|
|
11334
|
-
if (titleClass.includes(
|
|
11336
|
+
if (titleClass.includes(`${classPrefix2}__title`)) {
|
|
11335
11337
|
const left = offset * (level + 1);
|
|
11336
11338
|
nodeList[0].style.paddingLeft = `${left}px`;
|
|
11337
11339
|
}
|
|
@@ -11340,11 +11342,11 @@ const SubSideNavBar = (props) => {
|
|
|
11340
11342
|
);
|
|
11341
11343
|
childNodes.forEach((item) => {
|
|
11342
11344
|
const itemClass = item.className;
|
|
11343
|
-
if (itemClass.includes(
|
|
11345
|
+
if (itemClass.includes(`${classPrefix2}__item`)) {
|
|
11344
11346
|
const left = offset * (level + 2);
|
|
11345
11347
|
item.style.paddingLeft = `${left}px`;
|
|
11346
11348
|
}
|
|
11347
|
-
if (itemClass.includes(
|
|
11349
|
+
if (itemClass.includes(`${classPrefix2}__list`)) {
|
|
11348
11350
|
let level2 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
|
|
11349
11351
|
level2 += 1;
|
|
11350
11352
|
item.setAttribute("level", level2.toString());
|
|
@@ -11357,8 +11359,8 @@ const SubSideNavBar = (props) => {
|
|
|
11357
11359
|
const clickFn = (e) => {
|
|
11358
11360
|
handleClick(e);
|
|
11359
11361
|
const currentClass = e.currentTarget.className;
|
|
11360
|
-
const isShow = currentClass.includes("
|
|
11361
|
-
onClick && onClick({ title,
|
|
11362
|
+
const isShow = currentClass.includes("sidenavbar-show");
|
|
11363
|
+
onClick && onClick({ title, value, isShow });
|
|
11362
11364
|
};
|
|
11363
11365
|
useEffect(() => {
|
|
11364
11366
|
var _a2, _b;
|
|
@@ -11366,9 +11368,9 @@ const SubSideNavBar = (props) => {
|
|
|
11366
11368
|
(_b = listRef.current) == null ? void 0 : _b.setAttribute("level", "1");
|
|
11367
11369
|
childNodes && setListLevel(childNodes);
|
|
11368
11370
|
}, [setListLevel]);
|
|
11369
|
-
const divClass = open ?
|
|
11371
|
+
const divClass = open ? `${classPrefix2}__list sidenavbar-show` : `${classPrefix2}__list sidenavbar-hide`;
|
|
11370
11372
|
const iconClass = open ? "arrow-icon arrow-down" : "arrow-icon arrow-up";
|
|
11371
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest }, /* @__PURE__ */ React__default.createElement("div", { className:
|
|
11373
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__title ${classPrefix2}-border-bt` }, title, " ", /* @__PURE__ */ React__default.createElement("i", { className: iconClass })), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__content` }, children));
|
|
11372
11374
|
};
|
|
11373
11375
|
function usePropsValue({
|
|
11374
11376
|
value,
|
|
@@ -11389,7 +11391,7 @@ function usePropsValue({
|
|
|
11389
11391
|
}
|
|
11390
11392
|
return [uncontrolled, handleUncontrolledChange];
|
|
11391
11393
|
}
|
|
11392
|
-
const defaultProps$
|
|
11394
|
+
const defaultProps$18 = {
|
|
11393
11395
|
...ComponentDefaults,
|
|
11394
11396
|
value: "",
|
|
11395
11397
|
dot: false,
|
|
@@ -11400,7 +11402,7 @@ const defaultProps$19 = {
|
|
|
11400
11402
|
};
|
|
11401
11403
|
const Badge = (props) => {
|
|
11402
11404
|
const { className, style, value, max, children, dot, top, right, color } = {
|
|
11403
|
-
...defaultProps$
|
|
11405
|
+
...defaultProps$18,
|
|
11404
11406
|
...props
|
|
11405
11407
|
};
|
|
11406
11408
|
const classPrefix2 = "nut-badge";
|
|
@@ -11427,9 +11429,9 @@ const Badge = (props) => {
|
|
|
11427
11429
|
};
|
|
11428
11430
|
return /* @__PURE__ */ React__default.createElement("div", { className: classes, style }, typeof value === "object" && value && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__icon` }, value), /* @__PURE__ */ React__default.createElement("div", null, children), /* @__PURE__ */ React__default.createElement("div", { className: contentClasses, style: getStyle() }, content()));
|
|
11429
11431
|
};
|
|
11430
|
-
Badge.defaultProps = defaultProps$
|
|
11432
|
+
Badge.defaultProps = defaultProps$18;
|
|
11431
11433
|
Badge.displayName = "NutBadge";
|
|
11432
|
-
const defaultProps$
|
|
11434
|
+
const defaultProps$17 = {
|
|
11433
11435
|
...ComponentDefaults,
|
|
11434
11436
|
title: "",
|
|
11435
11437
|
icon: null,
|
|
@@ -11451,7 +11453,7 @@ const TabbarItem = (props) => {
|
|
|
11451
11453
|
handleClick: handleClick2,
|
|
11452
11454
|
...rest
|
|
11453
11455
|
} = {
|
|
11454
|
-
...defaultProps$
|
|
11456
|
+
...defaultProps$17,
|
|
11455
11457
|
...props
|
|
11456
11458
|
};
|
|
11457
11459
|
const classPrefix2 = "nut-tabbar-item";
|
|
@@ -11475,7 +11477,7 @@ const TabbarItem = (props) => {
|
|
|
11475
11477
|
icon ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Badge, { ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: boxPrefix }, icon)), /* @__PURE__ */ React__default.createElement("div", { className: titleClass }, title)) : /* @__PURE__ */ React__default.createElement(Badge, { ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: titleClass }, title))
|
|
11476
11478
|
);
|
|
11477
11479
|
};
|
|
11478
|
-
const defaultProps$
|
|
11480
|
+
const defaultProps$16 = {
|
|
11479
11481
|
...ComponentDefaults,
|
|
11480
11482
|
defaultValue: 0,
|
|
11481
11483
|
fixed: false,
|
|
@@ -11498,7 +11500,7 @@ const Tabbar = (props) => {
|
|
|
11498
11500
|
style,
|
|
11499
11501
|
onSwitch
|
|
11500
11502
|
} = {
|
|
11501
|
-
...defaultProps$
|
|
11503
|
+
...defaultProps$16,
|
|
11502
11504
|
...props
|
|
11503
11505
|
};
|
|
11504
11506
|
const classPrefix2 = "nut-tabbar";
|
|
@@ -11533,17 +11535,17 @@ const Tabbar = (props) => {
|
|
|
11533
11535
|
(fixed || safeArea) && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__safe-area` })
|
|
11534
11536
|
);
|
|
11535
11537
|
};
|
|
11536
|
-
Tabbar.defaultProps = defaultProps$
|
|
11538
|
+
Tabbar.defaultProps = defaultProps$16;
|
|
11537
11539
|
Tabbar.displayName = "NutTabbar";
|
|
11538
11540
|
Tabbar.Item = TabbarItem;
|
|
11539
|
-
const defaultProps$
|
|
11541
|
+
const defaultProps$15 = {
|
|
11540
11542
|
title: "",
|
|
11541
11543
|
value: "",
|
|
11542
11544
|
disabled: false
|
|
11543
11545
|
};
|
|
11544
11546
|
const TabPane = (props) => {
|
|
11545
11547
|
const { children, autoHeightClassName, className, disabled } = {
|
|
11546
|
-
...defaultProps$
|
|
11548
|
+
...defaultProps$15,
|
|
11547
11549
|
...props
|
|
11548
11550
|
};
|
|
11549
11551
|
const classPrefix2 = "nut-tabpane";
|
|
@@ -11574,7 +11576,7 @@ function useForceUpdate() {
|
|
|
11574
11576
|
const [, updateState] = React__default.useState();
|
|
11575
11577
|
return React__default.useCallback(() => updateState({}), []);
|
|
11576
11578
|
}
|
|
11577
|
-
const defaultProps$
|
|
11579
|
+
const defaultProps$14 = {
|
|
11578
11580
|
...ComponentDefaults,
|
|
11579
11581
|
tabStyle: {},
|
|
11580
11582
|
activeColor: "",
|
|
@@ -11583,7 +11585,7 @@ const defaultProps$15 = {
|
|
|
11583
11585
|
duration: 300,
|
|
11584
11586
|
autoHeight: false
|
|
11585
11587
|
};
|
|
11586
|
-
const classPrefix$
|
|
11588
|
+
const classPrefix$h = "nut-tabs";
|
|
11587
11589
|
const Tabs = (props) => {
|
|
11588
11590
|
const {
|
|
11589
11591
|
activeColor,
|
|
@@ -11600,7 +11602,7 @@ const Tabs = (props) => {
|
|
|
11600
11602
|
autoHeight,
|
|
11601
11603
|
...rest
|
|
11602
11604
|
} = {
|
|
11603
|
-
...defaultProps$
|
|
11605
|
+
...defaultProps$14,
|
|
11604
11606
|
...props
|
|
11605
11607
|
};
|
|
11606
11608
|
const [value, setValue] = usePropsValue({
|
|
@@ -11677,14 +11679,14 @@ const Tabs = (props) => {
|
|
|
11677
11679
|
}
|
|
11678
11680
|
}, [children]);
|
|
11679
11681
|
const classes = classNames(
|
|
11680
|
-
classPrefix$
|
|
11681
|
-
`${classPrefix$
|
|
11682
|
+
classPrefix$h,
|
|
11683
|
+
`${classPrefix$h}--${direction}`,
|
|
11682
11684
|
className
|
|
11683
11685
|
);
|
|
11684
|
-
const classesTitle = classNames(`${classPrefix$
|
|
11685
|
-
[`${classPrefix$
|
|
11686
|
-
[`${classPrefix$
|
|
11687
|
-
[`${classPrefix$
|
|
11686
|
+
const classesTitle = classNames(`${classPrefix$h}__titles`, {
|
|
11687
|
+
[`${classPrefix$h}__titles--${activeType}`]: activeType,
|
|
11688
|
+
[`${classPrefix$h}__titles--scrollable`]: true,
|
|
11689
|
+
[`${classPrefix$h}__titles--${align}`]: align
|
|
11688
11690
|
});
|
|
11689
11691
|
const tabsActiveStyle = {
|
|
11690
11692
|
color: activeType === "smile" ? activeColor : "",
|
|
@@ -11714,7 +11716,7 @@ const Tabs = (props) => {
|
|
|
11714
11716
|
onClick: () => {
|
|
11715
11717
|
tabChange(item);
|
|
11716
11718
|
},
|
|
11717
|
-
className: classNames(`${classPrefix$
|
|
11719
|
+
className: classNames(`${classPrefix$h}__titles-item`, {
|
|
11718
11720
|
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
11719
11721
|
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
11720
11722
|
[`nut-tabs__titles-item--${align}`]: align
|
|
@@ -11725,14 +11727,14 @@ const Tabs = (props) => {
|
|
|
11725
11727
|
activeType === "line" && /* @__PURE__ */ React__default.createElement(
|
|
11726
11728
|
"div",
|
|
11727
11729
|
{
|
|
11728
|
-
className: `${classPrefix$
|
|
11730
|
+
className: `${classPrefix$h}__titles-item__line`,
|
|
11729
11731
|
style: tabsActiveStyle
|
|
11730
11732
|
}
|
|
11731
11733
|
),
|
|
11732
11734
|
activeType === "smile" && /* @__PURE__ */ React__default.createElement(
|
|
11733
11735
|
"div",
|
|
11734
11736
|
{
|
|
11735
|
-
className: `${classPrefix$
|
|
11737
|
+
className: `${classPrefix$h}__titles-item__smile`,
|
|
11736
11738
|
style: tabsActiveStyle
|
|
11737
11739
|
},
|
|
11738
11740
|
/* @__PURE__ */ React__default.createElement(x$7, { color: activeColor, width: 40, height: 20 })
|
|
@@ -11744,13 +11746,13 @@ const Tabs = (props) => {
|
|
|
11744
11746
|
{
|
|
11745
11747
|
ellipsis: true
|
|
11746
11748
|
},
|
|
11747
|
-
`${classPrefix$
|
|
11749
|
+
`${classPrefix$h}__titles-item__text`
|
|
11748
11750
|
)
|
|
11749
11751
|
},
|
|
11750
11752
|
item.title
|
|
11751
11753
|
)
|
|
11752
11754
|
);
|
|
11753
|
-
})), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$
|
|
11755
|
+
})), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$h}__content__wrap` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$h}__content`, style: contentStyle }, React__default.Children.map(children, (child, idx) => {
|
|
11754
11756
|
if (!React__default.isValidElement(child)) {
|
|
11755
11757
|
return null;
|
|
11756
11758
|
}
|
|
@@ -11767,7 +11769,7 @@ const Tabs = (props) => {
|
|
|
11767
11769
|
return React__default.cloneElement(child, childProps);
|
|
11768
11770
|
}))));
|
|
11769
11771
|
};
|
|
11770
|
-
Tabs.defaultProps = defaultProps$
|
|
11772
|
+
Tabs.defaultProps = defaultProps$14;
|
|
11771
11773
|
Tabs.displayName = "NutTabs";
|
|
11772
11774
|
Tabs.TabPane = TabPane;
|
|
11773
11775
|
var classnameExports = {};
|
|
@@ -11890,7 +11892,7 @@ function requireClassname_development() {
|
|
|
11890
11892
|
}
|
|
11891
11893
|
})(classname);
|
|
11892
11894
|
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
11893
|
-
const defaultProps$
|
|
11895
|
+
const defaultProps$13 = {
|
|
11894
11896
|
type: "custom",
|
|
11895
11897
|
existAddress: [],
|
|
11896
11898
|
defaultIcon: null,
|
|
@@ -11912,7 +11914,7 @@ const ExistRender = (props) => {
|
|
|
11912
11914
|
onClose,
|
|
11913
11915
|
onSwitchModule,
|
|
11914
11916
|
...rest
|
|
11915
|
-
} = { ...defaultProps$
|
|
11917
|
+
} = { ...defaultProps$13, ...props };
|
|
11916
11918
|
const b = cn("address");
|
|
11917
11919
|
const selectedExist = (item) => {
|
|
11918
11920
|
const copyExistAdd = existAddress;
|
|
@@ -11942,7 +11944,7 @@ const ExistRender = (props) => {
|
|
|
11942
11944
|
return /* @__PURE__ */ React__default.createElement("li", { className: b("exist-item"), key: index }, /* @__PURE__ */ React__default.createElement("div", { onClick: () => selectedExist(item) }, item.selectedAddress ? selectedIcon : defaultIcon, /* @__PURE__ */ React__default.createElement("div", { className: b("exist-item-info") }, item.name && item.phone && /* @__PURE__ */ React__default.createElement("div", { className: "exist-item-info-top" }, /* @__PURE__ */ React__default.createElement("div", { className: "exist-item-info-name" }, item.name), /* @__PURE__ */ React__default.createElement("div", { className: "exist-item-info-phone" }, item.phone)), /* @__PURE__ */ React__default.createElement("div", { className: "exist-item-info-bottom" }, /* @__PURE__ */ React__default.createElement("div", null, item.provinceName + item.cityName + item.countyName + item.townName + item.addressDetail)))));
|
|
11943
11945
|
}))), isShowCustomAddress && /* @__PURE__ */ React__default.createElement("div", { className: b("choose-other"), onClick: onSwitch }, /* @__PURE__ */ React__default.createElement("div", { className: b("choose-other-btn") }, customAndExistTitle || locale.address.chooseAnotherAddress)));
|
|
11944
11946
|
};
|
|
11945
|
-
const defaultProps$
|
|
11947
|
+
const defaultProps$12 = {
|
|
11946
11948
|
modelValue: [],
|
|
11947
11949
|
type: "custom",
|
|
11948
11950
|
province: [],
|
|
@@ -11967,7 +11969,7 @@ const CustomRender = (props) => {
|
|
|
11967
11969
|
onClose,
|
|
11968
11970
|
...rest
|
|
11969
11971
|
} = {
|
|
11970
|
-
...defaultProps$
|
|
11972
|
+
...defaultProps$12,
|
|
11971
11973
|
...props
|
|
11972
11974
|
};
|
|
11973
11975
|
const b = cn("address");
|
|
@@ -12136,28 +12138,28 @@ const CustomRender = (props) => {
|
|
|
12136
12138
|
nextAreaList(item);
|
|
12137
12139
|
};
|
|
12138
12140
|
useEffect(() => {
|
|
12139
|
-
const { province: province2 } = { ...defaultProps$
|
|
12141
|
+
const { province: province2 } = { ...defaultProps$12, ...props };
|
|
12140
12142
|
setRegionList({
|
|
12141
12143
|
...regionList,
|
|
12142
12144
|
province: isCustom2() ? transformData(province2) : province2
|
|
12143
12145
|
});
|
|
12144
12146
|
}, [province]);
|
|
12145
12147
|
useEffect(() => {
|
|
12146
|
-
const { city: city2 } = { ...defaultProps$
|
|
12148
|
+
const { city: city2 } = { ...defaultProps$12, ...props };
|
|
12147
12149
|
setRegionList({
|
|
12148
12150
|
...regionList,
|
|
12149
12151
|
city: isCustom2() ? transformData(city2) : city2
|
|
12150
12152
|
});
|
|
12151
12153
|
}, [city]);
|
|
12152
12154
|
useEffect(() => {
|
|
12153
|
-
const { country: country2 } = { ...defaultProps$
|
|
12155
|
+
const { country: country2 } = { ...defaultProps$12, ...props };
|
|
12154
12156
|
setRegionList({
|
|
12155
12157
|
...regionList,
|
|
12156
12158
|
country: isCustom2() ? transformData(country2) : country2
|
|
12157
12159
|
});
|
|
12158
12160
|
}, [country]);
|
|
12159
12161
|
useEffect(() => {
|
|
12160
|
-
const { town: town2 } = { ...defaultProps$
|
|
12162
|
+
const { town: town2 } = { ...defaultProps$12, ...props };
|
|
12161
12163
|
setRegionList({
|
|
12162
12164
|
...regionList,
|
|
12163
12165
|
town: isCustom2() ? transformData(town2) : town2
|
|
@@ -12223,7 +12225,7 @@ const CustomRender = (props) => {
|
|
|
12223
12225
|
}
|
|
12224
12226
|
)));
|
|
12225
12227
|
};
|
|
12226
|
-
const defaultProps$
|
|
12228
|
+
const defaultProps$11 = {
|
|
12227
12229
|
...ComponentDefaults,
|
|
12228
12230
|
modelValue: false,
|
|
12229
12231
|
modelSelect: [],
|
|
@@ -12274,7 +12276,7 @@ const Address = (props) => {
|
|
|
12274
12276
|
className,
|
|
12275
12277
|
...rest
|
|
12276
12278
|
} = {
|
|
12277
|
-
...defaultProps$
|
|
12279
|
+
...defaultProps$11,
|
|
12278
12280
|
...props
|
|
12279
12281
|
};
|
|
12280
12282
|
const b = cn("address");
|
|
@@ -12426,7 +12428,7 @@ const Address = (props) => {
|
|
|
12426
12428
|
)
|
|
12427
12429
|
));
|
|
12428
12430
|
};
|
|
12429
|
-
Address.defaultProps = defaultProps$
|
|
12431
|
+
Address.defaultProps = defaultProps$11;
|
|
12430
12432
|
Address.displayName = "NutAddress";
|
|
12431
12433
|
const Utils = {
|
|
12432
12434
|
/**
|
|
@@ -12546,7 +12548,7 @@ const Utils = {
|
|
|
12546
12548
|
return false;
|
|
12547
12549
|
}
|
|
12548
12550
|
};
|
|
12549
|
-
const defaultProps$
|
|
12551
|
+
const defaultProps$10 = {
|
|
12550
12552
|
type: "one",
|
|
12551
12553
|
isAutoBackFill: false,
|
|
12552
12554
|
poppable: true,
|
|
@@ -12598,7 +12600,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
12598
12600
|
onUpdate,
|
|
12599
12601
|
onSelected,
|
|
12600
12602
|
onYearMonthChange
|
|
12601
|
-
} = { ...defaultProps$
|
|
12603
|
+
} = { ...defaultProps$10, ...props };
|
|
12602
12604
|
const weeks = locale.calendaritem.weekdays;
|
|
12603
12605
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
12604
12606
|
const [monthsData, setMonthsData] = useState([]);
|
|
@@ -13180,9 +13182,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
13180
13182
|
))
|
|
13181
13183
|
), poppable && !isAutoBackFill ? /* @__PURE__ */ React__default.createElement("div", { className: "nut-calendar-footer" }, /* @__PURE__ */ React__default.createElement("div", { className: "calendar-confirm-btn", onClick: confirm2 }, confirmText || locale.confirm)) : ""));
|
|
13182
13184
|
});
|
|
13183
|
-
CalendarItem.defaultProps = defaultProps$
|
|
13185
|
+
CalendarItem.defaultProps = defaultProps$10;
|
|
13184
13186
|
CalendarItem.displayName = "NutCalendarItem";
|
|
13185
|
-
const defaultProps
|
|
13187
|
+
const defaultProps$$ = {
|
|
13186
13188
|
type: "one",
|
|
13187
13189
|
isAutoBackFill: false,
|
|
13188
13190
|
poppable: true,
|
|
@@ -13237,7 +13239,7 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
13237
13239
|
onChoose,
|
|
13238
13240
|
onSelected,
|
|
13239
13241
|
onYearMonthChange
|
|
13240
|
-
} = { ...defaultProps
|
|
13242
|
+
} = { ...defaultProps$$, ...props };
|
|
13241
13243
|
const calendarRef = useRef(null);
|
|
13242
13244
|
const close = () => {
|
|
13243
13245
|
onClose && onClose();
|
|
@@ -13307,9 +13309,9 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
13307
13309
|
renderItem()
|
|
13308
13310
|
) : renderItem());
|
|
13309
13311
|
});
|
|
13310
|
-
Calendar.defaultProps = defaultProps
|
|
13312
|
+
Calendar.defaultProps = defaultProps$$;
|
|
13311
13313
|
Calendar.displayName = "NutCalendar";
|
|
13312
|
-
const defaultProps
|
|
13314
|
+
const defaultProps$_ = {
|
|
13313
13315
|
data: {
|
|
13314
13316
|
text: "",
|
|
13315
13317
|
value: "",
|
|
@@ -13326,7 +13328,7 @@ const defaultProps$$ = {
|
|
|
13326
13328
|
};
|
|
13327
13329
|
const InternalCascaderItem = (props, ref) => {
|
|
13328
13330
|
const { data, checked, activeIcon, chooseItem, activeColor } = {
|
|
13329
|
-
...defaultProps
|
|
13331
|
+
...defaultProps$_,
|
|
13330
13332
|
...props
|
|
13331
13333
|
};
|
|
13332
13334
|
const classPrefix2 = "nut-cascader-item";
|
|
@@ -13368,7 +13370,7 @@ const InternalCascaderItem = (props, ref) => {
|
|
|
13368
13370
|
);
|
|
13369
13371
|
};
|
|
13370
13372
|
const CascaderItem = React__default.forwardRef(InternalCascaderItem);
|
|
13371
|
-
CascaderItem.defaultProps = defaultProps
|
|
13373
|
+
CascaderItem.defaultProps = defaultProps$_;
|
|
13372
13374
|
CascaderItem.displayName = "NutCascaderItem";
|
|
13373
13375
|
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
13374
13376
|
const {
|
|
@@ -13506,7 +13508,7 @@ class Tree {
|
|
|
13506
13508
|
}
|
|
13507
13509
|
}
|
|
13508
13510
|
const Tree$1 = Tree;
|
|
13509
|
-
const defaultProps$
|
|
13511
|
+
const defaultProps$Z = {
|
|
13510
13512
|
...ComponentDefaults,
|
|
13511
13513
|
activeColor: "",
|
|
13512
13514
|
activeIcon: "checklist",
|
|
@@ -13549,7 +13551,7 @@ const InternalCascader = (props, ref) => {
|
|
|
13549
13551
|
onClose,
|
|
13550
13552
|
onChange,
|
|
13551
13553
|
onPathChange
|
|
13552
|
-
} = { ...defaultProps$
|
|
13554
|
+
} = { ...defaultProps$Z, ...props };
|
|
13553
13555
|
const [tabvalue, setTabvalue] = useState("c1");
|
|
13554
13556
|
const [optionsData, setOptionsData] = useState([]);
|
|
13555
13557
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
|
|
@@ -13811,11 +13813,11 @@ const InternalCascader = (props, ref) => {
|
|
|
13811
13813
|
) : renderItem());
|
|
13812
13814
|
};
|
|
13813
13815
|
const Cascader = React__default.forwardRef(InternalCascader);
|
|
13814
|
-
Cascader.defaultProps = defaultProps$
|
|
13816
|
+
Cascader.defaultProps = defaultProps$Z;
|
|
13815
13817
|
Cascader.displayName = "NutCascader";
|
|
13816
13818
|
const CheckboxGroupContext = createContext(null);
|
|
13817
13819
|
const Context = CheckboxGroupContext;
|
|
13818
|
-
const defaultProps$
|
|
13820
|
+
const defaultProps$Y = {
|
|
13819
13821
|
max: void 0,
|
|
13820
13822
|
labelPosition: "right",
|
|
13821
13823
|
direction: "vertical",
|
|
@@ -13823,10 +13825,10 @@ const defaultProps$Z = {
|
|
|
13823
13825
|
},
|
|
13824
13826
|
options: []
|
|
13825
13827
|
};
|
|
13826
|
-
const classPrefix$
|
|
13828
|
+
const classPrefix$g = "nut-checkboxgroup";
|
|
13827
13829
|
const CheckboxGroup = React__default.forwardRef(
|
|
13828
13830
|
(props, ref) => {
|
|
13829
|
-
const { children } = { ...defaultProps$
|
|
13831
|
+
const { children } = { ...defaultProps$Y, ...props };
|
|
13830
13832
|
const {
|
|
13831
13833
|
className,
|
|
13832
13834
|
disabled,
|
|
@@ -13905,7 +13907,7 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
13905
13907
|
/* @__PURE__ */ React__default.createElement(
|
|
13906
13908
|
"div",
|
|
13907
13909
|
{
|
|
13908
|
-
className: classNames(classPrefix$
|
|
13910
|
+
className: classNames(classPrefix$g, className, {
|
|
13909
13911
|
[`nut-checkboxgroup--${props.direction}`]: props.direction
|
|
13910
13912
|
}),
|
|
13911
13913
|
...rest
|
|
@@ -13915,9 +13917,9 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
13915
13917
|
);
|
|
13916
13918
|
}
|
|
13917
13919
|
);
|
|
13918
|
-
CheckboxGroup.defaultProps = defaultProps$
|
|
13920
|
+
CheckboxGroup.defaultProps = defaultProps$Y;
|
|
13919
13921
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
13920
|
-
const defaultProps$
|
|
13922
|
+
const defaultProps$X = {
|
|
13921
13923
|
...ComponentDefaults,
|
|
13922
13924
|
disabled: false,
|
|
13923
13925
|
labelPosition: "right",
|
|
@@ -13927,10 +13929,10 @@ const defaultProps$Y = {
|
|
|
13927
13929
|
onChange: (value) => {
|
|
13928
13930
|
}
|
|
13929
13931
|
};
|
|
13930
|
-
const classPrefix$
|
|
13932
|
+
const classPrefix$f = "nut-checkbox";
|
|
13931
13933
|
const Checkbox = (props) => {
|
|
13932
13934
|
const { children } = {
|
|
13933
|
-
...defaultProps$
|
|
13935
|
+
...defaultProps$X,
|
|
13934
13936
|
...props
|
|
13935
13937
|
};
|
|
13936
13938
|
const {
|
|
@@ -13989,22 +13991,22 @@ const Checkbox = (props) => {
|
|
|
13989
13991
|
};
|
|
13990
13992
|
const color = () => {
|
|
13991
13993
|
if (innerDisabled) {
|
|
13992
|
-
return `${classPrefix$
|
|
13994
|
+
return `${classPrefix$f}__icon--disable`;
|
|
13993
13995
|
}
|
|
13994
13996
|
if (innerChecked) {
|
|
13995
13997
|
if (innerIndeterminate) {
|
|
13996
|
-
return `${classPrefix$
|
|
13998
|
+
return `${classPrefix$f}__icon--indeterminate`;
|
|
13997
13999
|
}
|
|
13998
|
-
return `${classPrefix$
|
|
14000
|
+
return `${classPrefix$f}__icon`;
|
|
13999
14001
|
}
|
|
14000
|
-
return `${classPrefix$
|
|
14002
|
+
return `${classPrefix$f}__icon--unchecked`;
|
|
14001
14003
|
};
|
|
14002
14004
|
const renderLabel = () => {
|
|
14003
14005
|
return /* @__PURE__ */ React__default.createElement(
|
|
14004
14006
|
"span",
|
|
14005
14007
|
{
|
|
14006
|
-
className: classNames(`${classPrefix$
|
|
14007
|
-
[`${classPrefix$
|
|
14008
|
+
className: classNames(`${classPrefix$f}__label `, {
|
|
14009
|
+
[`${classPrefix$f}__label--disabled`]: innerDisabled
|
|
14008
14010
|
})
|
|
14009
14011
|
},
|
|
14010
14012
|
children || label
|
|
@@ -14023,8 +14025,8 @@ const Checkbox = (props) => {
|
|
|
14023
14025
|
return /* @__PURE__ */ React__default.createElement(
|
|
14024
14026
|
"div",
|
|
14025
14027
|
{
|
|
14026
|
-
className: classNames(classPrefix$
|
|
14027
|
-
[`${classPrefix$
|
|
14028
|
+
className: classNames(classPrefix$f, className, {
|
|
14029
|
+
[`${classPrefix$f}--reverse`]: labelPosition === "left"
|
|
14028
14030
|
}),
|
|
14029
14031
|
...rest,
|
|
14030
14032
|
onClick: handleClick2
|
|
@@ -14033,7 +14035,7 @@ const Checkbox = (props) => {
|
|
|
14033
14035
|
renderLabel()
|
|
14034
14036
|
);
|
|
14035
14037
|
};
|
|
14036
|
-
Checkbox.defaultProps = defaultProps$
|
|
14038
|
+
Checkbox.defaultProps = defaultProps$X;
|
|
14037
14039
|
Checkbox.displayName = "NutCheckBox";
|
|
14038
14040
|
Checkbox.Group = CheckboxGroup;
|
|
14039
14041
|
const MIN_DISTANCE = 10;
|
|
@@ -14327,7 +14329,7 @@ function useRefs() {
|
|
|
14327
14329
|
}, []);
|
|
14328
14330
|
return [refs.current, setRefs, reset];
|
|
14329
14331
|
}
|
|
14330
|
-
const defaultProps$
|
|
14332
|
+
const defaultProps$W = {
|
|
14331
14333
|
...ComponentDefaults,
|
|
14332
14334
|
visible: false,
|
|
14333
14335
|
title: "",
|
|
@@ -14340,6 +14342,7 @@ const defaultProps$X = {
|
|
|
14340
14342
|
const InternalPicker = (props, ref) => {
|
|
14341
14343
|
const { locale } = useConfig();
|
|
14342
14344
|
const {
|
|
14345
|
+
children,
|
|
14343
14346
|
visible,
|
|
14344
14347
|
title,
|
|
14345
14348
|
options: options2 = [],
|
|
@@ -14353,7 +14356,7 @@ const InternalPicker = (props, ref) => {
|
|
|
14353
14356
|
afterClose,
|
|
14354
14357
|
onChange,
|
|
14355
14358
|
...rest
|
|
14356
|
-
} = { ...defaultProps$
|
|
14359
|
+
} = { ...defaultProps$W, ...props };
|
|
14357
14360
|
const classPrefix2 = "nut-picker";
|
|
14358
14361
|
const classes = classNames(classPrefix2, className);
|
|
14359
14362
|
const [selectedValue, setSelectedValue] = usePropsValue({
|
|
@@ -14365,6 +14368,7 @@ const InternalPicker = (props, ref) => {
|
|
|
14365
14368
|
(_a2 = props.onConfirm) == null ? void 0 : _a2.call(props, setSelectedOptions(), val);
|
|
14366
14369
|
}
|
|
14367
14370
|
});
|
|
14371
|
+
const [innerValue, setInnerValue] = useState(selectedValue);
|
|
14368
14372
|
const [columnIndex, setColumnIndex] = useState(0);
|
|
14369
14373
|
const pickerRef = useRef(null);
|
|
14370
14374
|
const [refs, setRefs] = useRefs();
|
|
@@ -14404,41 +14408,48 @@ const InternalPicker = (props, ref) => {
|
|
|
14404
14408
|
}
|
|
14405
14409
|
return "single";
|
|
14406
14410
|
};
|
|
14407
|
-
const normalListData = () => {
|
|
14411
|
+
const normalListData = (innerValue2) => {
|
|
14408
14412
|
const type4 = columnsType();
|
|
14409
14413
|
switch (type4) {
|
|
14410
14414
|
case "multiple":
|
|
14411
14415
|
return options2;
|
|
14412
14416
|
case "cascade":
|
|
14413
|
-
return formatCascade(options2,
|
|
14417
|
+
return formatCascade(options2, innerValue2);
|
|
14414
14418
|
default:
|
|
14415
14419
|
return [options2];
|
|
14416
14420
|
}
|
|
14417
14421
|
};
|
|
14418
14422
|
const init = () => {
|
|
14419
|
-
const normalData = normalListData(
|
|
14423
|
+
const normalData = normalListData(
|
|
14424
|
+
innerValue
|
|
14425
|
+
);
|
|
14420
14426
|
setColumnsList(normalData);
|
|
14421
14427
|
const data = [];
|
|
14422
14428
|
normalData.length > 0 && normalData.map((item) => {
|
|
14423
14429
|
item[0] && data.push(item[0].value);
|
|
14424
14430
|
return item;
|
|
14425
14431
|
});
|
|
14426
|
-
if (!
|
|
14427
|
-
|
|
14432
|
+
if (!innerValue.length && innerValue.length === 0) {
|
|
14433
|
+
setInnerValue([...data]);
|
|
14428
14434
|
}
|
|
14429
14435
|
};
|
|
14430
14436
|
useEffect(() => {
|
|
14431
|
-
|
|
14432
|
-
|
|
14437
|
+
setInnerValue(innerValue !== selectedValue ? selectedValue : innerValue);
|
|
14438
|
+
}, [visible]);
|
|
14439
|
+
useEffect(() => {
|
|
14440
|
+
if (visible) {
|
|
14441
|
+
init();
|
|
14433
14442
|
}
|
|
14434
|
-
init();
|
|
14435
14443
|
}, [options2, visible]);
|
|
14444
|
+
useEffect(() => {
|
|
14445
|
+
onChange && onChange(setSelectedOptions(), innerValue, columnIndex);
|
|
14446
|
+
}, [innerValue, columnsList]);
|
|
14436
14447
|
const setSelectedOptions = () => {
|
|
14437
14448
|
const options22 = [];
|
|
14438
14449
|
let currOptions = [];
|
|
14439
14450
|
columnsList.forEach((columnOptions, index) => {
|
|
14440
14451
|
currOptions = columnOptions.filter(
|
|
14441
|
-
(item) => item.value ===
|
|
14452
|
+
(item) => item.value === innerValue[index]
|
|
14442
14453
|
);
|
|
14443
14454
|
if (currOptions[0]) {
|
|
14444
14455
|
options22.push(currOptions[0]);
|
|
@@ -14448,36 +14459,30 @@ const InternalPicker = (props, ref) => {
|
|
|
14448
14459
|
});
|
|
14449
14460
|
return options22;
|
|
14450
14461
|
};
|
|
14451
|
-
useEffect(() => {
|
|
14452
|
-
if (!visible) {
|
|
14453
|
-
return;
|
|
14454
|
-
}
|
|
14455
|
-
onChange && onChange(setSelectedOptions(), selectedValue, columnIndex);
|
|
14456
|
-
if (isConfirmEvent.current) {
|
|
14457
|
-
isConfirmEvent.current = false;
|
|
14458
|
-
onConfirm && onConfirm(setSelectedOptions(), selectedValue);
|
|
14459
|
-
}
|
|
14460
|
-
}, [selectedValue, columnsList, visible]);
|
|
14461
14462
|
const chooseItem = (columnOptions, columnIndex2) => {
|
|
14462
14463
|
var _a2, _b;
|
|
14464
|
+
const values = [];
|
|
14465
|
+
const start2 = columnIndex2;
|
|
14463
14466
|
if (columnOptions && Object.keys(columnOptions).length) {
|
|
14464
|
-
if (
|
|
14467
|
+
if (values[columnIndex2] !== columnOptions.value) {
|
|
14465
14468
|
if (columnsType() === "cascade") {
|
|
14466
|
-
|
|
14467
|
-
setSelectedValue([...selectedValue]);
|
|
14469
|
+
values[columnIndex2] = columnOptions.value || "";
|
|
14468
14470
|
while ((_a2 = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a2[0]) {
|
|
14469
|
-
|
|
14470
|
-
setSelectedValue([...selectedValue]);
|
|
14471
|
+
values[columnIndex2 + 1] = columnOptions.children[0].value;
|
|
14471
14472
|
columnIndex2++;
|
|
14472
14473
|
columnOptions = columnOptions.children[0];
|
|
14473
14474
|
}
|
|
14474
14475
|
if ((_b = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _b.length) {
|
|
14475
|
-
|
|
14476
|
-
setSelectedValue([...selectedValue]);
|
|
14476
|
+
values[columnIndex2 + 1] = "";
|
|
14477
14477
|
}
|
|
14478
|
-
|
|
14478
|
+
const combineResult = [
|
|
14479
|
+
...innerValue.slice(0, start2),
|
|
14480
|
+
...values.splice(start2)
|
|
14481
|
+
];
|
|
14482
|
+
setInnerValue(combineResult);
|
|
14483
|
+
setColumnsList(normalListData(combineResult));
|
|
14479
14484
|
} else {
|
|
14480
|
-
|
|
14485
|
+
setInnerValue((data) => {
|
|
14481
14486
|
const cdata = [...data];
|
|
14482
14487
|
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
|
|
14483
14488
|
columnOptions,
|
|
@@ -14491,16 +14496,16 @@ const InternalPicker = (props, ref) => {
|
|
|
14491
14496
|
}
|
|
14492
14497
|
};
|
|
14493
14498
|
const confirm2 = () => {
|
|
14494
|
-
let
|
|
14499
|
+
let moving = false;
|
|
14495
14500
|
refs.forEach((ref2) => {
|
|
14496
14501
|
if (ref2.moving)
|
|
14497
|
-
|
|
14502
|
+
moving = true;
|
|
14498
14503
|
ref2.stopMomentum();
|
|
14499
14504
|
});
|
|
14500
|
-
if (
|
|
14505
|
+
if (moving) {
|
|
14501
14506
|
isConfirmEvent.current = true;
|
|
14502
14507
|
} else {
|
|
14503
|
-
|
|
14508
|
+
setSelectedValue(innerValue);
|
|
14504
14509
|
closePicker();
|
|
14505
14510
|
}
|
|
14506
14511
|
setTimeout(() => {
|
|
@@ -14508,8 +14513,8 @@ const InternalPicker = (props, ref) => {
|
|
|
14508
14513
|
}, 0);
|
|
14509
14514
|
};
|
|
14510
14515
|
const closePicker = () => {
|
|
14511
|
-
onClose && onClose(setSelectedOptions(),
|
|
14512
|
-
afterClose && afterClose(setSelectedOptions(),
|
|
14516
|
+
onClose && onClose(setSelectedOptions(), innerValue);
|
|
14517
|
+
afterClose && afterClose(setSelectedOptions(), innerValue, pickerRef);
|
|
14513
14518
|
};
|
|
14514
14519
|
const renderTitleBar = () => {
|
|
14515
14520
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__control` }, /* @__PURE__ */ React__default.createElement(
|
|
@@ -14530,12 +14535,12 @@ const InternalPicker = (props, ref) => {
|
|
|
14530
14535
|
closePicker();
|
|
14531
14536
|
}
|
|
14532
14537
|
},
|
|
14533
|
-
/* @__PURE__ */ React__default.createElement("div", { className: classes, style, ...rest }, renderTitleBar(), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__panel`, ref: pickerRef }, columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
14538
|
+
/* @__PURE__ */ React__default.createElement("div", { className: classes, style, ...rest }, renderTitleBar(), children, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__panel`, ref: pickerRef }, columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
14534
14539
|
return /* @__PURE__ */ React__default.createElement(
|
|
14535
14540
|
PickerPanel$1,
|
|
14536
14541
|
{
|
|
14537
14542
|
ref: setRefs(index),
|
|
14538
|
-
defaultValue:
|
|
14543
|
+
defaultValue: innerValue == null ? void 0 : innerValue[index],
|
|
14539
14544
|
options: item,
|
|
14540
14545
|
threeDimensional,
|
|
14541
14546
|
chooseItem: (value, index2) => chooseItem(value, index2),
|
|
@@ -14550,7 +14555,7 @@ const InternalPicker = (props, ref) => {
|
|
|
14550
14555
|
const Picker = React__default.forwardRef(InternalPicker);
|
|
14551
14556
|
const Picker$1 = Picker;
|
|
14552
14557
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
14553
|
-
const defaultProps$
|
|
14558
|
+
const defaultProps$V = {
|
|
14554
14559
|
modelValue: null,
|
|
14555
14560
|
visible: false,
|
|
14556
14561
|
title: "",
|
|
@@ -14581,7 +14586,7 @@ const DatePicker = (props) => {
|
|
|
14581
14586
|
style,
|
|
14582
14587
|
...rest
|
|
14583
14588
|
} = {
|
|
14584
|
-
...defaultProps$
|
|
14589
|
+
...defaultProps$V,
|
|
14585
14590
|
...props
|
|
14586
14591
|
};
|
|
14587
14592
|
const { locale } = useConfig();
|
|
@@ -14858,7 +14863,7 @@ const DatePicker = (props) => {
|
|
|
14858
14863
|
)
|
|
14859
14864
|
);
|
|
14860
14865
|
};
|
|
14861
|
-
DatePicker.defaultProps = defaultProps$
|
|
14866
|
+
DatePicker.defaultProps = defaultProps$V;
|
|
14862
14867
|
DatePicker.displayName = "NutDatePicker";
|
|
14863
14868
|
const FormItemContext = createContext({});
|
|
14864
14869
|
function _extends() {
|
|
@@ -16049,7 +16054,7 @@ const useForm = (form) => {
|
|
|
16049
16054
|
}
|
|
16050
16055
|
return [formRef.current];
|
|
16051
16056
|
};
|
|
16052
|
-
const defaultProps$
|
|
16057
|
+
const defaultProps$U = {
|
|
16053
16058
|
...ComponentDefaults,
|
|
16054
16059
|
name: "",
|
|
16055
16060
|
label: "",
|
|
@@ -16111,7 +16116,7 @@ class FormItem extends React__default.Component {
|
|
|
16111
16116
|
showErrorLine,
|
|
16112
16117
|
showErrorMessage
|
|
16113
16118
|
} = {
|
|
16114
|
-
...defaultProps$
|
|
16119
|
+
...defaultProps$U,
|
|
16115
16120
|
...this.props
|
|
16116
16121
|
};
|
|
16117
16122
|
const item = ((_a2 = this.context.errList) == null ? void 0 : _a2.length) > 0 && ((_b = this.context.errList) == null ? void 0 : _b.filter((item2) => {
|
|
@@ -16166,9 +16171,9 @@ class FormItem extends React__default.Component {
|
|
|
16166
16171
|
return this.renderLayout(returnChildNode);
|
|
16167
16172
|
}
|
|
16168
16173
|
}
|
|
16169
|
-
__publicField(FormItem, "defaultProps", defaultProps$
|
|
16174
|
+
__publicField(FormItem, "defaultProps", defaultProps$U);
|
|
16170
16175
|
__publicField(FormItem, "contextType", FormItemContext);
|
|
16171
|
-
const defaultProps$
|
|
16176
|
+
const defaultProps$T = {
|
|
16172
16177
|
...ComponentDefaults,
|
|
16173
16178
|
className: "",
|
|
16174
16179
|
style: void 0,
|
|
@@ -16196,7 +16201,7 @@ const Form = (props) => {
|
|
|
16196
16201
|
form,
|
|
16197
16202
|
...rest
|
|
16198
16203
|
} = {
|
|
16199
|
-
...defaultProps$
|
|
16204
|
+
...defaultProps$T,
|
|
16200
16205
|
...props
|
|
16201
16206
|
};
|
|
16202
16207
|
let formInstance = {};
|
|
@@ -16228,7 +16233,7 @@ const Form = (props) => {
|
|
|
16228
16233
|
/* @__PURE__ */ React__default.createElement(CellGroup, null, /* @__PURE__ */ React__default.createElement(FormItemContext.Provider, { value: formInstance }, children))
|
|
16229
16234
|
);
|
|
16230
16235
|
};
|
|
16231
|
-
Form.defaultProps = defaultProps$
|
|
16236
|
+
Form.defaultProps = defaultProps$T;
|
|
16232
16237
|
Form.displayName = "NutForm";
|
|
16233
16238
|
Form.Item = FormItem;
|
|
16234
16239
|
Form.useForm = useForm;
|
|
@@ -16256,7 +16261,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
16256
16261
|
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
16257
16262
|
return value.replace(regExp, "");
|
|
16258
16263
|
}
|
|
16259
|
-
const defaultProps$
|
|
16264
|
+
const defaultProps$S = {
|
|
16260
16265
|
...ComponentDefaults,
|
|
16261
16266
|
type: "text",
|
|
16262
16267
|
name: "",
|
|
@@ -16299,7 +16304,7 @@ const Input = forwardRef(
|
|
|
16299
16304
|
value: _value,
|
|
16300
16305
|
...rest
|
|
16301
16306
|
} = {
|
|
16302
|
-
...defaultProps$
|
|
16307
|
+
...defaultProps$S,
|
|
16303
16308
|
...props
|
|
16304
16309
|
};
|
|
16305
16310
|
const [value, setValue] = usePropsValue({
|
|
@@ -16434,9 +16439,9 @@ const Input = forwardRef(
|
|
|
16434
16439
|
);
|
|
16435
16440
|
}
|
|
16436
16441
|
);
|
|
16437
|
-
Input.defaultProps = defaultProps$
|
|
16442
|
+
Input.defaultProps = defaultProps$S;
|
|
16438
16443
|
Input.displayName = "NutInput";
|
|
16439
|
-
const defaultProps$
|
|
16444
|
+
const defaultProps$R = {
|
|
16440
16445
|
...ComponentDefaults,
|
|
16441
16446
|
disabled: false,
|
|
16442
16447
|
min: 1,
|
|
@@ -16448,7 +16453,7 @@ const defaultProps$S = {
|
|
|
16448
16453
|
digits: 0,
|
|
16449
16454
|
async: false
|
|
16450
16455
|
};
|
|
16451
|
-
const classPrefix$
|
|
16456
|
+
const classPrefix$e = `nut-inputnumber`;
|
|
16452
16457
|
const InputNumber = (props) => {
|
|
16453
16458
|
const {
|
|
16454
16459
|
children,
|
|
@@ -16473,7 +16478,7 @@ const InputNumber = (props) => {
|
|
|
16473
16478
|
onChange,
|
|
16474
16479
|
...restProps
|
|
16475
16480
|
} = {
|
|
16476
|
-
...defaultProps$
|
|
16481
|
+
...defaultProps$R,
|
|
16477
16482
|
...props
|
|
16478
16483
|
};
|
|
16479
16484
|
const inputRef = useRef("");
|
|
@@ -16491,8 +16496,8 @@ const InputNumber = (props) => {
|
|
|
16491
16496
|
}, []);
|
|
16492
16497
|
const classes = classNames(
|
|
16493
16498
|
{
|
|
16494
|
-
[`${classPrefix$
|
|
16495
|
-
[`${classPrefix$
|
|
16499
|
+
[`${classPrefix$e}`]: true,
|
|
16500
|
+
[`${classPrefix$e}--disabled`]: disabled
|
|
16496
16501
|
},
|
|
16497
16502
|
className
|
|
16498
16503
|
);
|
|
@@ -16670,9 +16675,9 @@ const InputNumber = (props) => {
|
|
|
16670
16675
|
}
|
|
16671
16676
|
)), /* @__PURE__ */ React__default.createElement("div", { className: "nut-input-add" }, /* @__PURE__ */ React__default.createElement(y$4, { className: iconAddClasses, onClick: (e) => addNumber(e) })));
|
|
16672
16677
|
};
|
|
16673
|
-
InputNumber.defaultProps = defaultProps$
|
|
16678
|
+
InputNumber.defaultProps = defaultProps$R;
|
|
16674
16679
|
InputNumber.displayName = "NutInputNumber";
|
|
16675
|
-
const defaultProps$
|
|
16680
|
+
const defaultProps$Q = {
|
|
16676
16681
|
...ComponentDefaults,
|
|
16677
16682
|
activeColor: "",
|
|
16678
16683
|
closeOnOverlayClick: true,
|
|
@@ -16691,7 +16696,7 @@ const Menu = (props) => {
|
|
|
16691
16696
|
activeColor,
|
|
16692
16697
|
...rest
|
|
16693
16698
|
} = {
|
|
16694
|
-
...defaultProps$
|
|
16699
|
+
...defaultProps$Q,
|
|
16695
16700
|
...props
|
|
16696
16701
|
};
|
|
16697
16702
|
const menuRef = useRef(null);
|
|
@@ -16810,9 +16815,9 @@ const Menu = (props) => {
|
|
|
16810
16815
|
), cloneChildren())
|
|
16811
16816
|
);
|
|
16812
16817
|
};
|
|
16813
|
-
Menu.defaultProps = defaultProps$
|
|
16818
|
+
Menu.defaultProps = defaultProps$Q;
|
|
16814
16819
|
Menu.displayName = "NutMenu";
|
|
16815
|
-
const defaultProps$
|
|
16820
|
+
const defaultProps$P = {
|
|
16816
16821
|
...ComponentDefaults,
|
|
16817
16822
|
columns: 1,
|
|
16818
16823
|
direction: "down",
|
|
@@ -16842,7 +16847,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
16842
16847
|
parent,
|
|
16843
16848
|
index
|
|
16844
16849
|
} = {
|
|
16845
|
-
...defaultProps$
|
|
16850
|
+
...defaultProps$P,
|
|
16846
16851
|
...props
|
|
16847
16852
|
};
|
|
16848
16853
|
const [_showPopup, setShowPopup] = useState(show2);
|
|
@@ -16987,9 +16992,9 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
16987
16992
|
)
|
|
16988
16993
|
));
|
|
16989
16994
|
});
|
|
16990
|
-
MenuItem.defaultProps = defaultProps$
|
|
16995
|
+
MenuItem.defaultProps = defaultProps$P;
|
|
16991
16996
|
MenuItem.displayName = "NutMenuItem";
|
|
16992
|
-
const defaultProps$
|
|
16997
|
+
const defaultProps$O = {
|
|
16993
16998
|
...ComponentDefaults,
|
|
16994
16999
|
visible: false,
|
|
16995
17000
|
type: "default",
|
|
@@ -17140,17 +17145,17 @@ const NumberKeyboard = (props) => {
|
|
|
17140
17145
|
))))
|
|
17141
17146
|
);
|
|
17142
17147
|
};
|
|
17143
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
17148
|
+
NumberKeyboard.defaultProps = defaultProps$O;
|
|
17144
17149
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
17145
17150
|
const RadioContext = React__default.createContext(null);
|
|
17146
|
-
const defaultProps$
|
|
17151
|
+
const defaultProps$N = {
|
|
17147
17152
|
labelPosition: "right",
|
|
17148
17153
|
onChange: (value) => {
|
|
17149
17154
|
},
|
|
17150
17155
|
direction: "vertical",
|
|
17151
17156
|
options: []
|
|
17152
17157
|
};
|
|
17153
|
-
const classPrefix$
|
|
17158
|
+
const classPrefix$d = "nut-radiogroup";
|
|
17154
17159
|
const RadioGroup = React__default.forwardRef(
|
|
17155
17160
|
(props, ref) => {
|
|
17156
17161
|
const {
|
|
@@ -17164,7 +17169,7 @@ const RadioGroup = React__default.forwardRef(
|
|
|
17164
17169
|
options: options2,
|
|
17165
17170
|
disabled,
|
|
17166
17171
|
...rest
|
|
17167
|
-
} = { ...defaultProps$
|
|
17172
|
+
} = { ...defaultProps$N, ...props };
|
|
17168
17173
|
const [val2State, setVal2State] = usePropsValue({
|
|
17169
17174
|
defaultValue: props.defaultValue,
|
|
17170
17175
|
value: props.value,
|
|
@@ -17206,8 +17211,8 @@ const RadioGroup = React__default.forwardRef(
|
|
|
17206
17211
|
/* @__PURE__ */ React__default.createElement(
|
|
17207
17212
|
"div",
|
|
17208
17213
|
{
|
|
17209
|
-
className: classNames(classPrefix$
|
|
17210
|
-
[`${classPrefix$
|
|
17214
|
+
className: classNames(classPrefix$d, className, {
|
|
17215
|
+
[`${classPrefix$d}--${props.direction}`]: props.direction
|
|
17211
17216
|
}),
|
|
17212
17217
|
...rest
|
|
17213
17218
|
},
|
|
@@ -17216,9 +17221,9 @@ const RadioGroup = React__default.forwardRef(
|
|
|
17216
17221
|
);
|
|
17217
17222
|
}
|
|
17218
17223
|
);
|
|
17219
|
-
RadioGroup.defaultProps = defaultProps$
|
|
17224
|
+
RadioGroup.defaultProps = defaultProps$N;
|
|
17220
17225
|
RadioGroup.displayName = "NutRadioGroup";
|
|
17221
|
-
const defaultProps$
|
|
17226
|
+
const defaultProps$M = {
|
|
17222
17227
|
...ComponentDefaults,
|
|
17223
17228
|
disabled: false,
|
|
17224
17229
|
shape: "round",
|
|
@@ -17244,7 +17249,7 @@ const Radio = (props) => {
|
|
|
17244
17249
|
onChange,
|
|
17245
17250
|
...others
|
|
17246
17251
|
} = {
|
|
17247
|
-
...defaultProps$
|
|
17252
|
+
...defaultProps$M,
|
|
17248
17253
|
...props
|
|
17249
17254
|
};
|
|
17250
17255
|
let { labelPosition, disabled, ...rest } = others;
|
|
@@ -17340,10 +17345,10 @@ const Radio = (props) => {
|
|
|
17340
17345
|
renderRadioItem()
|
|
17341
17346
|
);
|
|
17342
17347
|
};
|
|
17343
|
-
Radio.defaultProps = defaultProps$
|
|
17348
|
+
Radio.defaultProps = defaultProps$M;
|
|
17344
17349
|
Radio.displayName = "NutRadio";
|
|
17345
17350
|
Radio.Group = RadioGroup;
|
|
17346
|
-
const defaultProps$
|
|
17351
|
+
const defaultProps$L = {
|
|
17347
17352
|
...ComponentDefaults,
|
|
17348
17353
|
range: false,
|
|
17349
17354
|
min: 0,
|
|
@@ -17371,7 +17376,7 @@ const Range = (props) => {
|
|
|
17371
17376
|
step,
|
|
17372
17377
|
value,
|
|
17373
17378
|
defaultValue
|
|
17374
|
-
} = { ...defaultProps$
|
|
17379
|
+
} = { ...defaultProps$L, ...props };
|
|
17375
17380
|
const classPrefix2 = "nut-range";
|
|
17376
17381
|
const [buttonIndex, setButtonIndex] = useState(0);
|
|
17377
17382
|
const [dragStatus, setDragStatus] = useState("start");
|
|
@@ -17635,9 +17640,9 @@ const Range = (props) => {
|
|
|
17635
17640
|
renderButton()
|
|
17636
17641
|
))), maxDescription !== null && /* @__PURE__ */ React__default.createElement("div", { className: "max" }, maxDescription || max));
|
|
17637
17642
|
};
|
|
17638
|
-
Range.defaultProps = defaultProps$
|
|
17643
|
+
Range.defaultProps = defaultProps$L;
|
|
17639
17644
|
Range.displayName = "NutRange";
|
|
17640
|
-
const defaultProps$
|
|
17645
|
+
const defaultProps$K = {
|
|
17641
17646
|
...ComponentDefaults,
|
|
17642
17647
|
count: 5,
|
|
17643
17648
|
min: 0,
|
|
@@ -17662,7 +17667,7 @@ const Rate = (props) => {
|
|
|
17662
17667
|
allowHalf,
|
|
17663
17668
|
onChange
|
|
17664
17669
|
} = {
|
|
17665
|
-
...defaultProps$
|
|
17670
|
+
...defaultProps$K,
|
|
17666
17671
|
...props
|
|
17667
17672
|
};
|
|
17668
17673
|
const classPrefix2 = "nut-rate";
|
|
@@ -17745,9 +17750,9 @@ const Rate = (props) => {
|
|
|
17745
17750
|
})
|
|
17746
17751
|
);
|
|
17747
17752
|
};
|
|
17748
|
-
Rate.defaultProps = defaultProps$
|
|
17753
|
+
Rate.defaultProps = defaultProps$K;
|
|
17749
17754
|
Rate.displayName = "NutRate";
|
|
17750
|
-
const defaultProps$
|
|
17755
|
+
const defaultProps$J = {
|
|
17751
17756
|
...ComponentDefaults,
|
|
17752
17757
|
placeholder: "",
|
|
17753
17758
|
shape: "square",
|
|
@@ -17786,7 +17791,7 @@ const SearchBar = (props) => {
|
|
|
17786
17791
|
onSearch,
|
|
17787
17792
|
onClickInput
|
|
17788
17793
|
} = {
|
|
17789
|
-
...defaultProps$
|
|
17794
|
+
...defaultProps$J,
|
|
17790
17795
|
...props
|
|
17791
17796
|
};
|
|
17792
17797
|
const forceFocus = () => {
|
|
@@ -17895,9 +17900,9 @@ const SearchBar = (props) => {
|
|
|
17895
17900
|
renderRight()
|
|
17896
17901
|
);
|
|
17897
17902
|
};
|
|
17898
|
-
SearchBar.defaultProps = defaultProps$
|
|
17903
|
+
SearchBar.defaultProps = defaultProps$J;
|
|
17899
17904
|
SearchBar.displayName = "NutSearchBar";
|
|
17900
|
-
const defaultProps$
|
|
17905
|
+
const defaultProps$I = {
|
|
17901
17906
|
...ComponentDefaults,
|
|
17902
17907
|
value: "",
|
|
17903
17908
|
visible: false,
|
|
@@ -17934,7 +17939,7 @@ const ShortPassword = (props) => {
|
|
|
17934
17939
|
onClickCloseIcon,
|
|
17935
17940
|
...rest
|
|
17936
17941
|
} = {
|
|
17937
|
-
...defaultProps$
|
|
17942
|
+
...defaultProps$I,
|
|
17938
17943
|
...props
|
|
17939
17944
|
};
|
|
17940
17945
|
const classPrefix2 = "nut-shortpassword";
|
|
@@ -17991,33 +17996,32 @@ const ShortPassword = (props) => {
|
|
|
17991
17996
|
), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__footer__sure`, onClick: sure }, locale.confirm)))
|
|
17992
17997
|
);
|
|
17993
17998
|
};
|
|
17994
|
-
ShortPassword.defaultProps = defaultProps$
|
|
17999
|
+
ShortPassword.defaultProps = defaultProps$I;
|
|
17995
18000
|
ShortPassword.displayName = "NutShortPassword";
|
|
17996
|
-
const defaultProps$
|
|
18001
|
+
const defaultProps$H = {
|
|
18002
|
+
...ComponentDefaults,
|
|
17997
18003
|
type: "png",
|
|
17998
18004
|
lineWidth: 2,
|
|
17999
18005
|
strokeStyle: "#000",
|
|
18000
|
-
|
|
18001
|
-
className: ""
|
|
18006
|
+
unsupported: ""
|
|
18002
18007
|
};
|
|
18003
|
-
const
|
|
18008
|
+
const InternalSignature = (props, ref) => {
|
|
18004
18009
|
const { locale } = useConfig();
|
|
18005
18010
|
const {
|
|
18006
18011
|
type: type4,
|
|
18007
18012
|
lineWidth,
|
|
18008
18013
|
strokeStyle,
|
|
18009
|
-
|
|
18014
|
+
unsupported,
|
|
18010
18015
|
className,
|
|
18011
|
-
|
|
18012
|
-
clear,
|
|
18016
|
+
style,
|
|
18013
18017
|
onConfirm,
|
|
18014
18018
|
onClear,
|
|
18015
18019
|
...rest
|
|
18016
18020
|
} = {
|
|
18017
|
-
...defaultProps$
|
|
18021
|
+
...defaultProps$H,
|
|
18018
18022
|
...props
|
|
18019
18023
|
};
|
|
18020
|
-
const
|
|
18024
|
+
const classPrefix2 = `nut-signature`;
|
|
18021
18025
|
const canvasRef = useRef(null);
|
|
18022
18026
|
const wrapRef = useRef(null);
|
|
18023
18027
|
const [canvasHeight, setCanvasHeight] = useState(0);
|
|
@@ -18084,12 +18088,8 @@ const Signature = (props) => {
|
|
|
18084
18088
|
ctx2.current.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
18085
18089
|
ctx2.current.closePath();
|
|
18086
18090
|
}
|
|
18087
|
-
clear && clear();
|
|
18088
18091
|
onClear && onClear();
|
|
18089
18092
|
};
|
|
18090
|
-
const handleConfirmBtn = () => {
|
|
18091
|
-
onSave(canvasRef.current);
|
|
18092
|
-
};
|
|
18093
18093
|
const onSave = (canvas) => {
|
|
18094
18094
|
let dataurl;
|
|
18095
18095
|
switch (type4) {
|
|
@@ -18103,30 +18103,22 @@ const Signature = (props) => {
|
|
|
18103
18103
|
dataurl = canvas.toDataURL("image/png");
|
|
18104
18104
|
}
|
|
18105
18105
|
handleClearBtn();
|
|
18106
|
-
confirm2 && confirm2(canvas, dataurl);
|
|
18107
18106
|
onConfirm && onConfirm(canvas, dataurl);
|
|
18108
18107
|
};
|
|
18109
|
-
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
className: `${b("btn")}`,
|
|
18113
|
-
type: "default",
|
|
18114
|
-
onClick: () => handleClearBtn()
|
|
18115
|
-
},
|
|
18116
|
-
locale.signature.reSign
|
|
18117
|
-
), /* @__PURE__ */ React__default.createElement(
|
|
18118
|
-
Button,
|
|
18119
|
-
{
|
|
18120
|
-
className: `${b("btn")}`,
|
|
18121
|
-
type: "primary",
|
|
18122
|
-
onClick: () => handleConfirmBtn()
|
|
18108
|
+
useImperativeHandle(ref, () => ({
|
|
18109
|
+
confirm: () => {
|
|
18110
|
+
onSave(canvasRef.current);
|
|
18123
18111
|
},
|
|
18124
|
-
|
|
18125
|
-
|
|
18112
|
+
clear: () => {
|
|
18113
|
+
handleClearBtn();
|
|
18114
|
+
}
|
|
18115
|
+
}));
|
|
18116
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2} ${className}`, style, ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__inner`, ref: wrapRef }, isCanvasSupported() ? /* @__PURE__ */ React__default.createElement("canvas", { ref: canvasRef, height: canvasHeight, width: canvasWidth }) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, unsupported || /* @__PURE__ */ React__default.createElement("p", { className: `${classPrefix2}__unsupport` }, locale.signature.unsupported))));
|
|
18126
18117
|
};
|
|
18127
|
-
Signature
|
|
18118
|
+
const Signature = React__default.forwardRef(InternalSignature);
|
|
18119
|
+
Signature.defaultProps = defaultProps$H;
|
|
18128
18120
|
Signature.displayName = "NutSignature";
|
|
18129
|
-
const defaultProps$
|
|
18121
|
+
const defaultProps$G = {
|
|
18130
18122
|
...ComponentDefaults,
|
|
18131
18123
|
disabled: false,
|
|
18132
18124
|
activeText: "",
|
|
@@ -18143,7 +18135,7 @@ const Switch = (props) => {
|
|
|
18143
18135
|
style,
|
|
18144
18136
|
onChange
|
|
18145
18137
|
} = {
|
|
18146
|
-
...defaultProps$
|
|
18138
|
+
...defaultProps$G,
|
|
18147
18139
|
...props
|
|
18148
18140
|
};
|
|
18149
18141
|
const classPrefix2 = "nut-switch";
|
|
@@ -18162,9 +18154,9 @@ const Switch = (props) => {
|
|
|
18162
18154
|
};
|
|
18163
18155
|
return /* @__PURE__ */ React__default.createElement("div", { className: classes(), onClick: (e) => onClick(e), style }, /* @__PURE__ */ React__default.createElement("div", { className: "switch-button" }, !value && /* @__PURE__ */ React__default.createElement("div", { className: "close-line" }), activeText && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, value ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__label open` }, activeText) : /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__label close` }, inactiveText))));
|
|
18164
18156
|
};
|
|
18165
|
-
Switch.defaultProps = defaultProps$
|
|
18157
|
+
Switch.defaultProps = defaultProps$G;
|
|
18166
18158
|
Switch.displayName = "NutSwitch";
|
|
18167
|
-
const defaultProps$
|
|
18159
|
+
const defaultProps$F = {
|
|
18168
18160
|
...ComponentDefaults,
|
|
18169
18161
|
defaultValue: "",
|
|
18170
18162
|
showCount: false,
|
|
@@ -18193,7 +18185,7 @@ const TextArea = (props) => {
|
|
|
18193
18185
|
onBlur,
|
|
18194
18186
|
onFocus,
|
|
18195
18187
|
...rest
|
|
18196
|
-
} = { ...defaultProps$
|
|
18188
|
+
} = { ...defaultProps$F, ...props };
|
|
18197
18189
|
const classPrefix2 = "nut-textarea";
|
|
18198
18190
|
const textareaRef = useRef(null);
|
|
18199
18191
|
const compositionRef = useRef(false);
|
|
@@ -18277,9 +18269,9 @@ const TextArea = (props) => {
|
|
|
18277
18269
|
showCount && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__limit` }, inputValue.length, "/", maxLength < 0 ? 0 : maxLength)
|
|
18278
18270
|
);
|
|
18279
18271
|
};
|
|
18280
|
-
TextArea.defaultProps = defaultProps$
|
|
18272
|
+
TextArea.defaultProps = defaultProps$F;
|
|
18281
18273
|
TextArea.displayName = "NutTextArea";
|
|
18282
|
-
const defaultProps$
|
|
18274
|
+
const defaultProps$E = {
|
|
18283
18275
|
...ComponentDefaults,
|
|
18284
18276
|
percent: 0,
|
|
18285
18277
|
showText: false,
|
|
@@ -18302,7 +18294,7 @@ const Progress = (props) => {
|
|
|
18302
18294
|
delay,
|
|
18303
18295
|
...rest
|
|
18304
18296
|
} = {
|
|
18305
|
-
...defaultProps$
|
|
18297
|
+
...defaultProps$E,
|
|
18306
18298
|
...props
|
|
18307
18299
|
};
|
|
18308
18300
|
const classPrefix2 = "nut-progress";
|
|
@@ -18397,7 +18389,7 @@ const Progress = (props) => {
|
|
|
18397
18389
|
)))
|
|
18398
18390
|
);
|
|
18399
18391
|
};
|
|
18400
|
-
Progress.defaultProps = defaultProps$
|
|
18392
|
+
Progress.defaultProps = defaultProps$E;
|
|
18401
18393
|
Progress.displayName = "NutProgress";
|
|
18402
18394
|
class UploadOptions {
|
|
18403
18395
|
constructor() {
|
|
@@ -18469,6 +18461,14 @@ const isFunction = (val) => typeof val === "function";
|
|
|
18469
18461
|
const isPromise = (val) => {
|
|
18470
18462
|
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
18471
18463
|
};
|
|
18464
|
+
const upperCaseFirst = (str) => {
|
|
18465
|
+
var str = str.toLowerCase();
|
|
18466
|
+
str = str.replace(
|
|
18467
|
+
/\b\w+\b/g,
|
|
18468
|
+
(word) => word.substring(0, 1).toUpperCase() + word.substring(1)
|
|
18469
|
+
);
|
|
18470
|
+
return str;
|
|
18471
|
+
};
|
|
18472
18472
|
const funcInterceptor = (interceptor, {
|
|
18473
18473
|
args = [],
|
|
18474
18474
|
done,
|
|
@@ -18494,7 +18494,7 @@ const funcInterceptor = (interceptor, {
|
|
|
18494
18494
|
done();
|
|
18495
18495
|
}
|
|
18496
18496
|
};
|
|
18497
|
-
const defaultProps$
|
|
18497
|
+
const defaultProps$D = {
|
|
18498
18498
|
...ComponentDefaults,
|
|
18499
18499
|
url: "",
|
|
18500
18500
|
maxCount: 1,
|
|
@@ -18576,7 +18576,7 @@ const InternalUploader = (props, ref) => {
|
|
|
18576
18576
|
beforeXhrUpload,
|
|
18577
18577
|
beforeDelete,
|
|
18578
18578
|
...restProps
|
|
18579
|
-
} = { ...defaultProps$
|
|
18579
|
+
} = { ...defaultProps$D, ...props };
|
|
18580
18580
|
const [fileList, setFileList] = useState(defaultValue || []);
|
|
18581
18581
|
const [uploadQueue, setUploadQueue] = useState([]);
|
|
18582
18582
|
useEffect(() => {
|
|
@@ -18917,9 +18917,9 @@ const InternalUploader = (props, ref) => {
|
|
|
18917
18917
|
));
|
|
18918
18918
|
};
|
|
18919
18919
|
const Uploader = React__default.forwardRef(InternalUploader);
|
|
18920
|
-
Uploader.defaultProps = defaultProps$
|
|
18920
|
+
Uploader.defaultProps = defaultProps$D;
|
|
18921
18921
|
Uploader.displayName = "NutUploader";
|
|
18922
|
-
const defaultProps$
|
|
18922
|
+
const defaultProps$C = {
|
|
18923
18923
|
...ComponentDefaults,
|
|
18924
18924
|
visible: false,
|
|
18925
18925
|
title: "",
|
|
@@ -18946,7 +18946,7 @@ const ActionSheet = (props) => {
|
|
|
18946
18946
|
className,
|
|
18947
18947
|
style,
|
|
18948
18948
|
...rest
|
|
18949
|
-
} = { ...defaultProps$
|
|
18949
|
+
} = { ...defaultProps$C, ...props };
|
|
18950
18950
|
const classPrefix2 = "nut-actionsheet";
|
|
18951
18951
|
const cancelActionSheet = () => {
|
|
18952
18952
|
onCancel && onCancel();
|
|
@@ -18987,7 +18987,7 @@ const ActionSheet = (props) => {
|
|
|
18987
18987
|
))
|
|
18988
18988
|
);
|
|
18989
18989
|
};
|
|
18990
|
-
ActionSheet.defaultProps = defaultProps$
|
|
18990
|
+
ActionSheet.defaultProps = defaultProps$C;
|
|
18991
18991
|
ActionSheet.displayName = "NutActionSheet";
|
|
18992
18992
|
const fullClone = {
|
|
18993
18993
|
...ReactDOM
|
|
@@ -19220,7 +19220,7 @@ const DialogWrap = (props) => {
|
|
|
19220
19220
|
};
|
|
19221
19221
|
DialogWrap.defaultProps = defaultDialogProps;
|
|
19222
19222
|
DialogWrap.displayName = "NutDialogWrap";
|
|
19223
|
-
const defaultProps$
|
|
19223
|
+
const defaultProps$B = {
|
|
19224
19224
|
confirmText: "",
|
|
19225
19225
|
cancelText: "",
|
|
19226
19226
|
overlay: true,
|
|
@@ -19319,9 +19319,9 @@ Dialog.confirm = (props) => {
|
|
|
19319
19319
|
});
|
|
19320
19320
|
};
|
|
19321
19321
|
});
|
|
19322
|
-
Dialog.defaultProps = defaultProps$
|
|
19322
|
+
Dialog.defaultProps = defaultProps$B;
|
|
19323
19323
|
Dialog.displayName = "NutDialog";
|
|
19324
|
-
const defaultProps$
|
|
19324
|
+
const defaultProps$A = {
|
|
19325
19325
|
...ComponentDefaults,
|
|
19326
19326
|
attract: false,
|
|
19327
19327
|
direction: void 0,
|
|
@@ -19334,7 +19334,7 @@ const defaultProps$B = {
|
|
|
19334
19334
|
};
|
|
19335
19335
|
const Drag = (props) => {
|
|
19336
19336
|
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
19337
|
-
...defaultProps$
|
|
19337
|
+
...defaultProps$A,
|
|
19338
19338
|
...props
|
|
19339
19339
|
};
|
|
19340
19340
|
const classPrefix2 = "nut-drag";
|
|
@@ -19397,20 +19397,20 @@ const Drag = (props) => {
|
|
|
19397
19397
|
/* @__PURE__ */ React__default.createElement(animated.div, { style: currstyle, ...bind() }, children)
|
|
19398
19398
|
);
|
|
19399
19399
|
};
|
|
19400
|
-
Drag.defaultProps = defaultProps$
|
|
19400
|
+
Drag.defaultProps = defaultProps$A;
|
|
19401
19401
|
Drag.displayName = "NutDrag";
|
|
19402
19402
|
const defaultStatus = {
|
|
19403
19403
|
empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
|
|
19404
19404
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
19405
19405
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
19406
19406
|
};
|
|
19407
|
-
const defaultProps$
|
|
19407
|
+
const defaultProps$z = {
|
|
19408
19408
|
...ComponentDefaults,
|
|
19409
19409
|
description: "",
|
|
19410
19410
|
imageSize: "",
|
|
19411
19411
|
status: "empty"
|
|
19412
19412
|
};
|
|
19413
|
-
const classPrefix$
|
|
19413
|
+
const classPrefix$c = `nut-empty`;
|
|
19414
19414
|
const Empty = (props) => {
|
|
19415
19415
|
const { locale } = useConfig();
|
|
19416
19416
|
const {
|
|
@@ -19422,7 +19422,7 @@ const Empty = (props) => {
|
|
|
19422
19422
|
status,
|
|
19423
19423
|
...rest
|
|
19424
19424
|
} = {
|
|
19425
|
-
...defaultProps$
|
|
19425
|
+
...defaultProps$z,
|
|
19426
19426
|
...props
|
|
19427
19427
|
};
|
|
19428
19428
|
const [imgStyle, setImgStyle] = useState({});
|
|
@@ -19445,46 +19445,38 @@ const Empty = (props) => {
|
|
|
19445
19445
|
};
|
|
19446
19446
|
});
|
|
19447
19447
|
}, [imageSize]);
|
|
19448
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$
|
|
19448
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$c} ${className}`, ...rest }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$c}__image`, style: imgStyle }, imageNode), typeof description === "string" ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$c}__description` }, description || locale.noData) : description, children));
|
|
19449
19449
|
};
|
|
19450
|
-
Empty.defaultProps = defaultProps$
|
|
19450
|
+
Empty.defaultProps = defaultProps$z;
|
|
19451
19451
|
Empty.displayName = "NutEmpty";
|
|
19452
|
-
const defaultProps$
|
|
19452
|
+
const defaultProps$y = {
|
|
19453
19453
|
...ComponentDefaults,
|
|
19454
19454
|
hasMore: true,
|
|
19455
19455
|
threshold: 200,
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
loadIcon: null,
|
|
19463
|
-
loadingText: "加载中···",
|
|
19464
|
-
loadMoreText: "哎呀,这里是底部了啦"
|
|
19465
|
-
};
|
|
19466
|
-
const Infiniteloading = (props) => {
|
|
19456
|
+
target: "",
|
|
19457
|
+
capture: false,
|
|
19458
|
+
pullRefresh: false
|
|
19459
|
+
};
|
|
19460
|
+
const classPrefix$b = `nut-infiniteloading`;
|
|
19461
|
+
const InfiniteLoading = (props) => {
|
|
19467
19462
|
const { locale } = useConfig();
|
|
19468
19463
|
const {
|
|
19469
19464
|
children,
|
|
19470
19465
|
hasMore,
|
|
19471
19466
|
threshold,
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
|
|
19475
|
-
|
|
19476
|
-
pullIcon,
|
|
19477
|
-
pullText,
|
|
19478
|
-
loadIcon,
|
|
19467
|
+
target,
|
|
19468
|
+
capture,
|
|
19469
|
+
pullRefresh,
|
|
19470
|
+
pullingText,
|
|
19479
19471
|
loadingText,
|
|
19480
19472
|
loadMoreText,
|
|
19481
19473
|
className,
|
|
19482
19474
|
onRefresh,
|
|
19483
19475
|
onLoadMore,
|
|
19484
|
-
|
|
19476
|
+
onScroll,
|
|
19485
19477
|
...restProps
|
|
19486
19478
|
} = {
|
|
19487
|
-
...defaultProps$
|
|
19479
|
+
...defaultProps$y,
|
|
19488
19480
|
...props
|
|
19489
19481
|
};
|
|
19490
19482
|
const [isInfiniting, setIsInfiniting] = useState(false);
|
|
@@ -19496,16 +19488,16 @@ const Infiniteloading = (props) => {
|
|
|
19496
19488
|
const refreshMaxH = useRef(0);
|
|
19497
19489
|
const y2 = useRef(0);
|
|
19498
19490
|
const distance = useRef(0);
|
|
19499
|
-
const
|
|
19500
|
-
const classes = classNames(className, b());
|
|
19491
|
+
const classes = classNames(className, classPrefix$b);
|
|
19501
19492
|
useEffect(() => {
|
|
19502
|
-
|
|
19503
|
-
|
|
19504
|
-
|
|
19505
|
-
|
|
19506
|
-
|
|
19493
|
+
if (target && document.getElementById(target)) {
|
|
19494
|
+
scrollEl.current = document.getElementById(target);
|
|
19495
|
+
} else {
|
|
19496
|
+
scrollEl.current = window;
|
|
19497
|
+
}
|
|
19498
|
+
scrollEl.current.addEventListener("scroll", handleScroll, capture);
|
|
19507
19499
|
return () => {
|
|
19508
|
-
scrollEl.current.removeEventListener("scroll", handleScroll,
|
|
19500
|
+
scrollEl.current.removeEventListener("scroll", handleScroll, capture);
|
|
19509
19501
|
};
|
|
19510
19502
|
}, [hasMore, isInfiniting]);
|
|
19511
19503
|
useEffect(() => {
|
|
@@ -19523,9 +19515,6 @@ const Infiniteloading = (props) => {
|
|
|
19523
19515
|
transition: isTouching.current ? `height 0s cubic-bezier(0.25,0.1,0.25,1)` : `height 0.2s cubic-bezier(0.25,0.1,0.25,1)`
|
|
19524
19516
|
};
|
|
19525
19517
|
};
|
|
19526
|
-
const getParentElement = (el) => {
|
|
19527
|
-
return containerId ? document.querySelector(`#${containerId}`) : el && el.parentNode;
|
|
19528
|
-
};
|
|
19529
19518
|
const handleScroll = () => {
|
|
19530
19519
|
requestAniFrame2()(() => {
|
|
19531
19520
|
if (!isScrollAtBottom() || !hasMore || isInfiniting) {
|
|
@@ -19545,7 +19534,7 @@ const Infiniteloading = (props) => {
|
|
|
19545
19534
|
isTouching.current = false;
|
|
19546
19535
|
};
|
|
19547
19536
|
const touchStart = (event) => {
|
|
19548
|
-
if (beforeScrollTop.current === 0 && !isTouching.current &&
|
|
19537
|
+
if (beforeScrollTop.current === 0 && !isTouching.current && pullRefresh) {
|
|
19549
19538
|
y2.current = event.touches[0].pageY;
|
|
19550
19539
|
isTouching.current = true;
|
|
19551
19540
|
const childHeight = refreshTop.current.firstElementChild.offsetHeight;
|
|
@@ -19577,12 +19566,12 @@ const Infiniteloading = (props) => {
|
|
|
19577
19566
|
}
|
|
19578
19567
|
};
|
|
19579
19568
|
const requestAniFrame2 = () => {
|
|
19580
|
-
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function fn(callback) {
|
|
19569
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function fn(callback) {
|
|
19581
19570
|
window.setTimeout(callback, 1e3 / 60);
|
|
19582
19571
|
};
|
|
19583
19572
|
};
|
|
19584
19573
|
const getWindowScrollTop = () => {
|
|
19585
|
-
return window.
|
|
19574
|
+
return window.scrollY !== void 0 ? window.scrollY : (document.documentElement || document.body.parentNode || document.body).scrollTop;
|
|
19586
19575
|
};
|
|
19587
19576
|
const calculateTopPosition = (el) => {
|
|
19588
19577
|
return !el ? 0 : el.offsetTop + calculateTopPosition(el.offsetParent);
|
|
@@ -19592,7 +19581,7 @@ const Infiniteloading = (props) => {
|
|
|
19592
19581
|
let resScrollTop = 0;
|
|
19593
19582
|
let direction = "down";
|
|
19594
19583
|
const windowScrollTop = getWindowScrollTop();
|
|
19595
|
-
if (
|
|
19584
|
+
if (!target || !document.getElementById(target)) {
|
|
19596
19585
|
if (scroller.current) {
|
|
19597
19586
|
offsetDistance = calculateTopPosition(scroller.current) + scroller.current.offsetHeight - windowScrollTop - window.innerHeight;
|
|
19598
19587
|
}
|
|
@@ -19608,7 +19597,7 @@ const Infiniteloading = (props) => {
|
|
|
19608
19597
|
direction = "down";
|
|
19609
19598
|
}
|
|
19610
19599
|
beforeScrollTop.current = resScrollTop;
|
|
19611
|
-
|
|
19600
|
+
onScroll && onScroll(resScrollTop);
|
|
19612
19601
|
return offsetDistance <= threshold && direction === "down";
|
|
19613
19602
|
};
|
|
19614
19603
|
return /* @__PURE__ */ React__default.createElement(
|
|
@@ -19620,14 +19609,14 @@ const Infiniteloading = (props) => {
|
|
|
19620
19609
|
onTouchEnd: touchEnd,
|
|
19621
19610
|
...restProps
|
|
19622
19611
|
},
|
|
19623
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "nut-infinite-top", ref: refreshTop, style: getStyle() }, /* @__PURE__ */ React__default.createElement("div", { className: "top-box" },
|
|
19612
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-infinite-top", ref: refreshTop, style: getStyle() }, /* @__PURE__ */ React__default.createElement("div", { className: "top-box" }, pullingText || locale.infiniteloading.pullRefreshText)),
|
|
19624
19613
|
/* @__PURE__ */ React__default.createElement("div", { className: "nut-infinite-container" }, children),
|
|
19625
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "nut-infinite-bottom" }, isInfiniting ? /* @__PURE__ */ React__default.createElement("div", { className: "bottom-box" },
|
|
19614
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-infinite-bottom" }, isInfiniting ? /* @__PURE__ */ React__default.createElement("div", { className: "bottom-box" }, loadingText || locale.infiniteloading.loadText) : !hasMore && /* @__PURE__ */ React__default.createElement("div", { className: "tips" }, loadMoreText || locale.infiniteloading.loadMoreText))
|
|
19626
19615
|
);
|
|
19627
19616
|
};
|
|
19628
|
-
|
|
19629
|
-
|
|
19630
|
-
const defaultProps$
|
|
19617
|
+
InfiniteLoading.defaultProps = defaultProps$y;
|
|
19618
|
+
InfiniteLoading.displayName = "NutInfiniteLoading";
|
|
19619
|
+
const defaultProps$x = {
|
|
19631
19620
|
...ComponentDefaults,
|
|
19632
19621
|
direction: "horizontal",
|
|
19633
19622
|
list: [],
|
|
@@ -19665,7 +19654,7 @@ const NoticeBar = (props) => {
|
|
|
19665
19654
|
onClick,
|
|
19666
19655
|
onClickItem
|
|
19667
19656
|
} = {
|
|
19668
|
-
...defaultProps$
|
|
19657
|
+
...defaultProps$x,
|
|
19669
19658
|
...props
|
|
19670
19659
|
};
|
|
19671
19660
|
const classPrefix2 = "nut-noticebar";
|
|
@@ -20016,9 +20005,9 @@ const NoticeBar = (props) => {
|
|
|
20016
20005
|
)
|
|
20017
20006
|
) : null);
|
|
20018
20007
|
};
|
|
20019
|
-
NoticeBar.defaultProps = defaultProps$
|
|
20008
|
+
NoticeBar.defaultProps = defaultProps$x;
|
|
20020
20009
|
NoticeBar.displayName = "NutNoticeBar";
|
|
20021
|
-
const classPrefix$
|
|
20010
|
+
const classPrefix$a = "nut-notify";
|
|
20022
20011
|
let Notification$1 = (_a = class extends React.PureComponent {
|
|
20023
20012
|
constructor(props) {
|
|
20024
20013
|
super(props);
|
|
@@ -20069,10 +20058,10 @@ let Notification$1 = (_a = class extends React.PureComponent {
|
|
|
20069
20058
|
const { style, message, type: type4, className, position } = this.props;
|
|
20070
20059
|
const { show: show2 } = this.state;
|
|
20071
20060
|
const classes = classNames({
|
|
20072
|
-
[`${classPrefix$
|
|
20073
|
-
[`${classPrefix$
|
|
20074
|
-
[`${classPrefix$
|
|
20075
|
-
[`${classPrefix$
|
|
20061
|
+
[`${classPrefix$a}--popup-top`]: position === "top",
|
|
20062
|
+
[`${classPrefix$a}--popup-bottom`]: position === "bottom",
|
|
20063
|
+
[`${classPrefix$a}`]: true,
|
|
20064
|
+
[`${classPrefix$a}--${type4}`]: true
|
|
20076
20065
|
});
|
|
20077
20066
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
20078
20067
|
CSSTransition$1,
|
|
@@ -20181,166 +20170,290 @@ const Notify = {
|
|
|
20181
20170
|
}
|
|
20182
20171
|
}
|
|
20183
20172
|
};
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20173
|
+
const getTargetElement = (target) => {
|
|
20174
|
+
let targetElement;
|
|
20175
|
+
if (isFunction(target)) {
|
|
20176
|
+
targetElement = target();
|
|
20177
|
+
} else if ("current" in target) {
|
|
20178
|
+
targetElement = target.current;
|
|
20179
|
+
} else {
|
|
20180
|
+
targetElement = target;
|
|
20189
20181
|
}
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20199
|
-
|
|
20200
|
-
const childCallback = this.props.children.props[type4];
|
|
20201
|
-
if (childCallback) {
|
|
20202
|
-
childCallback(e);
|
|
20182
|
+
return targetElement;
|
|
20183
|
+
};
|
|
20184
|
+
function useClickAway(onClickAway, target, eventName = "click", isListener, outerVar) {
|
|
20185
|
+
const handler = (event) => {
|
|
20186
|
+
const targets = Array.isArray(target) ? target : [target];
|
|
20187
|
+
if (targets.some((item) => {
|
|
20188
|
+
const targetElement = getTargetElement(item);
|
|
20189
|
+
return !targetElement || targetElement.contains(event.target);
|
|
20190
|
+
})) {
|
|
20191
|
+
return;
|
|
20203
20192
|
}
|
|
20204
|
-
|
|
20205
|
-
|
|
20206
|
-
callback(e);
|
|
20193
|
+
if (outerVar) {
|
|
20194
|
+
onClickAway();
|
|
20207
20195
|
}
|
|
20208
|
-
}
|
|
20209
|
-
|
|
20210
|
-
|
|
20211
|
-
|
|
20212
|
-
|
|
20213
|
-
|
|
20214
|
-
};
|
|
20215
|
-
if (child && child.props && child.props.className) {
|
|
20216
|
-
newChildProps.className = className;
|
|
20196
|
+
};
|
|
20197
|
+
useEffect(() => {
|
|
20198
|
+
if (isListener) {
|
|
20199
|
+
window.addEventListener(eventName, handler, true);
|
|
20200
|
+
} else {
|
|
20201
|
+
window.removeEventListener(eventName, handler, true);
|
|
20217
20202
|
}
|
|
20218
|
-
|
|
20219
|
-
|
|
20203
|
+
return () => {
|
|
20204
|
+
window.removeEventListener(eventName, handler, true);
|
|
20220
20205
|
};
|
|
20221
|
-
|
|
20222
|
-
const trigger = React__default.cloneElement(child, cloneProps);
|
|
20223
|
-
return trigger;
|
|
20224
|
-
}
|
|
20206
|
+
}, [target]);
|
|
20225
20207
|
}
|
|
20226
|
-
const defaultProps$
|
|
20208
|
+
const defaultProps$w = {
|
|
20227
20209
|
...ComponentDefaults,
|
|
20228
20210
|
list: [],
|
|
20229
|
-
theme: "light",
|
|
20230
20211
|
location: "bottom",
|
|
20231
20212
|
visible: false,
|
|
20232
|
-
offset:
|
|
20213
|
+
offset: [0, 12],
|
|
20214
|
+
targetId: "",
|
|
20233
20215
|
className: "",
|
|
20234
|
-
|
|
20216
|
+
background: "",
|
|
20217
|
+
color: "",
|
|
20218
|
+
showArrow: true,
|
|
20219
|
+
duration: 0.3,
|
|
20220
|
+
overlay: false,
|
|
20221
|
+
overlayClassName: "",
|
|
20222
|
+
overlayStyle: {},
|
|
20223
|
+
closeOnClickOutside: true,
|
|
20224
|
+
closeOnClickAction: true,
|
|
20225
|
+
closeOnOverlayClick: true,
|
|
20226
|
+
onClick: () => {
|
|
20227
|
+
},
|
|
20228
|
+
onOpen: () => {
|
|
20229
|
+
},
|
|
20230
|
+
onClose: () => {
|
|
20235
20231
|
},
|
|
20236
|
-
|
|
20232
|
+
onSelect: (item, index) => {
|
|
20237
20233
|
}
|
|
20238
20234
|
};
|
|
20235
|
+
const classPrefix$9 = `nut-popover`;
|
|
20239
20236
|
const Popover = (props) => {
|
|
20240
20237
|
const {
|
|
20241
20238
|
children,
|
|
20242
20239
|
list,
|
|
20243
|
-
theme,
|
|
20244
20240
|
location,
|
|
20245
20241
|
visible,
|
|
20246
20242
|
offset,
|
|
20243
|
+
targetId,
|
|
20244
|
+
overlay,
|
|
20245
|
+
overlayStyle,
|
|
20246
|
+
overlayClassName,
|
|
20247
|
+
closeOnClickOutside,
|
|
20248
|
+
closeOnClickAction,
|
|
20249
|
+
closeOnOverlayClick,
|
|
20247
20250
|
className,
|
|
20251
|
+
showArrow,
|
|
20248
20252
|
style,
|
|
20253
|
+
background,
|
|
20254
|
+
color,
|
|
20249
20255
|
onClick,
|
|
20250
|
-
|
|
20256
|
+
onOpen,
|
|
20257
|
+
onClose,
|
|
20258
|
+
onSelect,
|
|
20251
20259
|
...reset
|
|
20252
20260
|
} = {
|
|
20253
|
-
...defaultProps$
|
|
20261
|
+
...defaultProps$w,
|
|
20254
20262
|
...props
|
|
20255
20263
|
};
|
|
20256
|
-
const
|
|
20257
|
-
|
|
20258
|
-
|
|
20259
|
-
setElWidth(getRect(goodItem.current).width);
|
|
20260
|
-
setElHeight(getRect(goodItem.current).height);
|
|
20261
|
-
}
|
|
20262
|
-
});
|
|
20263
|
-
const [classes, setClasses] = useState("");
|
|
20264
|
+
const popoverRef = useRef(null);
|
|
20265
|
+
const popoverContentRef = useRef(null);
|
|
20266
|
+
const [showPopup, setShowPopup] = useState(false);
|
|
20264
20267
|
const [elWidth, setElWidth] = useState(0);
|
|
20265
20268
|
const [elHeight, setElHeight] = useState(0);
|
|
20266
|
-
const [
|
|
20267
|
-
const [popoverArrow, setPopoverArrow] = useState("");
|
|
20269
|
+
const [rootPosition, setRootPosition] = useState();
|
|
20268
20270
|
useEffect(() => {
|
|
20269
|
-
|
|
20270
|
-
|
|
20271
|
-
|
|
20272
|
-
|
|
20273
|
-
|
|
20274
|
-
|
|
20275
|
-
|
|
20276
|
-
|
|
20277
|
-
|
|
20278
|
-
|
|
20279
|
-
|
|
20280
|
-
|
|
20281
|
-
|
|
20271
|
+
setShowPopup(visible);
|
|
20272
|
+
if (visible) {
|
|
20273
|
+
setTimeout(() => {
|
|
20274
|
+
getContentWidth();
|
|
20275
|
+
}, 0);
|
|
20276
|
+
}
|
|
20277
|
+
}, [visible]);
|
|
20278
|
+
const targetSet = [
|
|
20279
|
+
targetId ? document.querySelector(`#${targetId}`) : popoverRef.current,
|
|
20280
|
+
popoverContentRef.current
|
|
20281
|
+
];
|
|
20282
|
+
useClickAway(
|
|
20283
|
+
() => {
|
|
20284
|
+
props.onClick && props.onClick();
|
|
20285
|
+
onClose && onClose();
|
|
20286
|
+
},
|
|
20287
|
+
targetSet,
|
|
20288
|
+
"touchstart",
|
|
20289
|
+
visible,
|
|
20290
|
+
closeOnClickOutside
|
|
20291
|
+
);
|
|
20292
|
+
const getContentWidth = () => {
|
|
20293
|
+
let rect = getRect(popoverRef.current);
|
|
20294
|
+
if (targetId) {
|
|
20295
|
+
setTimeout(() => {
|
|
20296
|
+
rect = getRect(document.querySelector(`#${targetId}`));
|
|
20297
|
+
setRootPosition({
|
|
20298
|
+
width: rect.width,
|
|
20299
|
+
height: rect.height,
|
|
20300
|
+
left: rect.left,
|
|
20301
|
+
top: rect.top,
|
|
20302
|
+
right: rect.right
|
|
20303
|
+
});
|
|
20304
|
+
if (popoverContentRef.current) {
|
|
20305
|
+
setElWidth(popoverContentRef.current.clientWidth);
|
|
20306
|
+
setElHeight(popoverContentRef.current.clientHeight);
|
|
20307
|
+
}
|
|
20308
|
+
}, 0);
|
|
20282
20309
|
} else {
|
|
20283
|
-
|
|
20310
|
+
setRootPosition({
|
|
20311
|
+
width: rect.width,
|
|
20312
|
+
height: rect.height,
|
|
20313
|
+
left: rect.left,
|
|
20314
|
+
top: rect.top,
|
|
20315
|
+
right: rect.right
|
|
20316
|
+
});
|
|
20317
|
+
if (popoverContentRef.current) {
|
|
20318
|
+
setElWidth(popoverContentRef.current.clientWidth);
|
|
20319
|
+
setElHeight(popoverContentRef.current.clientHeight);
|
|
20320
|
+
}
|
|
20284
20321
|
}
|
|
20285
|
-
return style2;
|
|
20286
|
-
};
|
|
20287
|
-
const classesSelf = () => {
|
|
20288
|
-
const prefixCls2 = "nut-popover";
|
|
20289
|
-
return `${prefixCls2} ${theme ? `${prefixCls2}--${theme}` : ""}`;
|
|
20290
20322
|
};
|
|
20291
|
-
const
|
|
20292
|
-
|
|
20293
|
-
|
|
20323
|
+
const classes = classNames(
|
|
20324
|
+
{
|
|
20325
|
+
[`${classPrefix$9}`]: true
|
|
20326
|
+
},
|
|
20327
|
+
className
|
|
20328
|
+
);
|
|
20329
|
+
const customStyle = () => {
|
|
20330
|
+
const styles = {};
|
|
20331
|
+
if (background) {
|
|
20332
|
+
styles.background = background;
|
|
20333
|
+
}
|
|
20334
|
+
if (color) {
|
|
20335
|
+
styles.color = color;
|
|
20336
|
+
}
|
|
20337
|
+
return styles;
|
|
20294
20338
|
};
|
|
20295
|
-
const
|
|
20296
|
-
const
|
|
20297
|
-
|
|
20339
|
+
const popoverArrow = () => {
|
|
20340
|
+
const prefixCls2 = "nut-popover-arrow";
|
|
20341
|
+
const loca = location;
|
|
20342
|
+
const direction = loca.split("-")[0];
|
|
20343
|
+
return `${prefixCls2} ${prefixCls2}-${direction} ${prefixCls2}--${loca}`;
|
|
20298
20344
|
};
|
|
20299
|
-
const
|
|
20300
|
-
const
|
|
20301
|
-
|
|
20345
|
+
const popoverArrowStyle = () => {
|
|
20346
|
+
const styles = {};
|
|
20347
|
+
const { background: background2 } = props;
|
|
20348
|
+
const direction = location.split("-")[0];
|
|
20349
|
+
if (background2) {
|
|
20350
|
+
styles[`border${upperCaseFirst(direction)}Color`] = background2;
|
|
20351
|
+
}
|
|
20352
|
+
return styles;
|
|
20302
20353
|
};
|
|
20303
|
-
const
|
|
20304
|
-
|
|
20305
|
-
|
|
20354
|
+
const getRootPosition = () => {
|
|
20355
|
+
let styles = {};
|
|
20356
|
+
if (!rootPosition)
|
|
20357
|
+
return {};
|
|
20358
|
+
const contentWidth = elWidth;
|
|
20359
|
+
const contentHeight = elHeight;
|
|
20360
|
+
const { width, height, left, top, right } = rootPosition;
|
|
20361
|
+
const direction = location.split("-")[0];
|
|
20362
|
+
const skew = location.split("-")[1];
|
|
20363
|
+
let cross = 0;
|
|
20364
|
+
let parallel = 0;
|
|
20365
|
+
if (Array.isArray(offset) && offset.length == 2) {
|
|
20366
|
+
cross += +offset[1];
|
|
20367
|
+
parallel += +offset[0];
|
|
20368
|
+
}
|
|
20369
|
+
if (width) {
|
|
20370
|
+
if (["bottom", "top"].includes(direction)) {
|
|
20371
|
+
const h = direction == "bottom" ? height + cross : -(contentHeight + cross);
|
|
20372
|
+
styles.top = `${top + h}px`;
|
|
20373
|
+
if (!skew) {
|
|
20374
|
+
styles.left = `${-(contentWidth - width) / 2 + left + parallel}px`;
|
|
20375
|
+
}
|
|
20376
|
+
if (skew == "start") {
|
|
20377
|
+
styles.left = `${left + parallel}px`;
|
|
20378
|
+
}
|
|
20379
|
+
if (skew == "end") {
|
|
20380
|
+
styles.left = `${right + parallel}px`;
|
|
20381
|
+
}
|
|
20382
|
+
}
|
|
20383
|
+
if (["left", "right"].includes(direction)) {
|
|
20384
|
+
const contentW = direction == "left" ? -(contentWidth + cross) : width + cross;
|
|
20385
|
+
styles.left = `${left + contentW}px`;
|
|
20386
|
+
if (!skew) {
|
|
20387
|
+
styles.top = `${top - contentHeight / 2 + height / 2 - 4 + parallel}px`;
|
|
20388
|
+
}
|
|
20389
|
+
if (skew == "start") {
|
|
20390
|
+
styles.top = `${top + parallel}px`;
|
|
20391
|
+
}
|
|
20392
|
+
if (skew == "end") {
|
|
20393
|
+
styles.top = `${top + height + parallel}px`;
|
|
20394
|
+
}
|
|
20395
|
+
}
|
|
20306
20396
|
}
|
|
20397
|
+
return styles;
|
|
20307
20398
|
};
|
|
20308
|
-
const
|
|
20399
|
+
const handleSelect = (item, index) => {
|
|
20309
20400
|
if (!item.disabled) {
|
|
20310
|
-
|
|
20401
|
+
onSelect(item, index);
|
|
20402
|
+
}
|
|
20403
|
+
if (closeOnClickAction) {
|
|
20404
|
+
props.onClick && props.onClick();
|
|
20405
|
+
onClose && onClose();
|
|
20311
20406
|
}
|
|
20312
20407
|
};
|
|
20313
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
20408
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !targetId && /* @__PURE__ */ React__default.createElement(
|
|
20314
20409
|
"div",
|
|
20315
20410
|
{
|
|
20316
|
-
className:
|
|
20317
|
-
|
|
20318
|
-
|
|
20411
|
+
className: "nut-popover-wrapper",
|
|
20412
|
+
ref: popoverRef,
|
|
20413
|
+
onClick: () => {
|
|
20414
|
+
props.onClick && props.onClick();
|
|
20415
|
+
if (!visible) {
|
|
20416
|
+
onOpen && onOpen();
|
|
20417
|
+
} else {
|
|
20418
|
+
onClose && onClose();
|
|
20419
|
+
}
|
|
20420
|
+
},
|
|
20421
|
+
style
|
|
20422
|
+
},
|
|
20423
|
+
Array.isArray(children) ? children[0] : children
|
|
20424
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: classes, style: getRootPosition(), ...reset }, /* @__PURE__ */ React__default.createElement(
|
|
20425
|
+
Popup,
|
|
20426
|
+
{
|
|
20427
|
+
className: `nut-popover-content nut-popover-content--${location}`,
|
|
20428
|
+
style: customStyle(),
|
|
20429
|
+
position: "default",
|
|
20430
|
+
overlay,
|
|
20431
|
+
overlayStyle,
|
|
20432
|
+
overlayClassName,
|
|
20433
|
+
closeOnOverlayClick,
|
|
20434
|
+
visible: showPopup
|
|
20319
20435
|
},
|
|
20320
|
-
/* @__PURE__ */ React__default.createElement(
|
|
20436
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-popover-content-group", ref: popoverContentRef }, showArrow && /* @__PURE__ */ React__default.createElement("div", { className: popoverArrow(), style: popoverArrowStyle() }), Array.isArray(children) ? children[1] : "", list.map((item, index) => {
|
|
20321
20437
|
return /* @__PURE__ */ React__default.createElement(
|
|
20322
20438
|
"div",
|
|
20323
20439
|
{
|
|
20324
|
-
|
|
20325
|
-
|
|
20326
|
-
|
|
20327
|
-
|
|
20328
|
-
|
|
20440
|
+
className: classNames(
|
|
20441
|
+
{
|
|
20442
|
+
"nut-popover-menu-item": true,
|
|
20443
|
+
"nut-popover-menu-disabled": item.disabled
|
|
20444
|
+
},
|
|
20445
|
+
item.className
|
|
20446
|
+
),
|
|
20447
|
+
key: item.key,
|
|
20448
|
+
onClick: () => handleSelect(item, index)
|
|
20329
20449
|
},
|
|
20330
20450
|
item.icon ? item.icon : null,
|
|
20331
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "popover-menu-item-name" }, item.name)
|
|
20451
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-popover-menu-item-name" }, item.name)
|
|
20332
20452
|
);
|
|
20333
|
-
}))
|
|
20334
|
-
)
|
|
20335
|
-
Overlay,
|
|
20336
|
-
{
|
|
20337
|
-
visible,
|
|
20338
|
-
onClick: (e) => handleClick2(e),
|
|
20339
|
-
style: { background: "transparent" }
|
|
20340
|
-
}
|
|
20341
|
-
) : null);
|
|
20453
|
+
}))
|
|
20454
|
+
)));
|
|
20342
20455
|
};
|
|
20343
|
-
Popover.defaultProps = defaultProps$
|
|
20456
|
+
Popover.defaultProps = defaultProps$w;
|
|
20344
20457
|
Popover.displayName = "NutPopover";
|
|
20345
20458
|
function bound(position, min, max) {
|
|
20346
20459
|
let ret = position;
|
|
@@ -20378,7 +20491,7 @@ if (canUseDom) {
|
|
|
20378
20491
|
console.log(e);
|
|
20379
20492
|
}
|
|
20380
20493
|
}
|
|
20381
|
-
const defaultProps$
|
|
20494
|
+
const defaultProps$v = {
|
|
20382
20495
|
...ComponentDefaults,
|
|
20383
20496
|
pullingText: "",
|
|
20384
20497
|
canReleaseText: "",
|
|
@@ -20395,7 +20508,7 @@ const PullToRefresh = (p) => {
|
|
|
20395
20508
|
const classPrefix2 = "nut-pulltorefresh";
|
|
20396
20509
|
const { locale } = useConfig();
|
|
20397
20510
|
const props = {
|
|
20398
|
-
...defaultProps$
|
|
20511
|
+
...defaultProps$v,
|
|
20399
20512
|
...p,
|
|
20400
20513
|
...{
|
|
20401
20514
|
pullingText: p.pullingText || locale.pullToRefresh.pullingText,
|
|
@@ -20538,10 +20651,10 @@ const PullToRefresh = (p) => {
|
|
|
20538
20651
|
/* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-content` }, props.children)
|
|
20539
20652
|
);
|
|
20540
20653
|
};
|
|
20541
|
-
PullToRefresh.defaultProps = defaultProps$
|
|
20654
|
+
PullToRefresh.defaultProps = defaultProps$v;
|
|
20542
20655
|
PullToRefresh.displayName = "NutPullToRefresh";
|
|
20543
20656
|
const AvatarContext = createContext({});
|
|
20544
|
-
const defaultProps$
|
|
20657
|
+
const defaultProps$u = {
|
|
20545
20658
|
...ComponentDefaults,
|
|
20546
20659
|
size: "",
|
|
20547
20660
|
shape: "round",
|
|
@@ -20552,7 +20665,7 @@ const defaultProps$v = {
|
|
|
20552
20665
|
src: "",
|
|
20553
20666
|
alt: ""
|
|
20554
20667
|
};
|
|
20555
|
-
const classPrefix$
|
|
20668
|
+
const classPrefix$8 = `nut-avatar`;
|
|
20556
20669
|
const Avatar = (props) => {
|
|
20557
20670
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
20558
20671
|
const {
|
|
@@ -20571,7 +20684,7 @@ const Avatar = (props) => {
|
|
|
20571
20684
|
onError,
|
|
20572
20685
|
...rest
|
|
20573
20686
|
} = {
|
|
20574
|
-
...defaultProps$
|
|
20687
|
+
...defaultProps$u,
|
|
20575
20688
|
...props
|
|
20576
20689
|
};
|
|
20577
20690
|
const [maxSum, setMaxSum] = useState(0);
|
|
@@ -20584,7 +20697,7 @@ const Avatar = (props) => {
|
|
|
20584
20697
|
[`nut-avatar-${((_a2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a2.size) || size || "normal"}`]: true,
|
|
20585
20698
|
[`nut-avatar-${((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || shape}`]: true
|
|
20586
20699
|
});
|
|
20587
|
-
const cls = classNames(classPrefix$
|
|
20700
|
+
const cls = classNames(classPrefix$8, classes, className);
|
|
20588
20701
|
const styles = {
|
|
20589
20702
|
width: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
20590
20703
|
height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
@@ -20653,9 +20766,9 @@ const Avatar = (props) => {
|
|
|
20653
20766
|
showMax && /* @__PURE__ */ React__default.createElement("div", { className: "text" }, ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.max)}`)
|
|
20654
20767
|
));
|
|
20655
20768
|
};
|
|
20656
|
-
Avatar.defaultProps = defaultProps$
|
|
20769
|
+
Avatar.defaultProps = defaultProps$u;
|
|
20657
20770
|
Avatar.displayName = "NutAvatar";
|
|
20658
|
-
const defaultProps$
|
|
20771
|
+
const defaultProps$t = {
|
|
20659
20772
|
...ComponentDefaults,
|
|
20660
20773
|
rows: 1,
|
|
20661
20774
|
animated: false,
|
|
@@ -20678,7 +20791,7 @@ const Skeleton = (props) => {
|
|
|
20678
20791
|
avatarShape,
|
|
20679
20792
|
...rest
|
|
20680
20793
|
} = {
|
|
20681
|
-
...defaultProps$
|
|
20794
|
+
...defaultProps$t,
|
|
20682
20795
|
...props
|
|
20683
20796
|
};
|
|
20684
20797
|
const classPrefix2 = "nut-skeleton";
|
|
@@ -20714,7 +20827,7 @@ const Skeleton = (props) => {
|
|
|
20714
20827
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__block`, key: index });
|
|
20715
20828
|
})))));
|
|
20716
20829
|
};
|
|
20717
|
-
Skeleton.defaultProps = defaultProps$
|
|
20830
|
+
Skeleton.defaultProps = defaultProps$t;
|
|
20718
20831
|
Skeleton.displayName = "NutSkeleton";
|
|
20719
20832
|
function preventDefault(event, isStopPropagation) {
|
|
20720
20833
|
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
@@ -20724,13 +20837,13 @@ function preventDefault(event, isStopPropagation) {
|
|
|
20724
20837
|
event.stopPropagation();
|
|
20725
20838
|
}
|
|
20726
20839
|
}
|
|
20727
|
-
const defaultProps$
|
|
20840
|
+
const defaultProps$s = {
|
|
20728
20841
|
name: ""
|
|
20729
20842
|
};
|
|
20730
20843
|
const Swipe = forwardRef((props, instanceRef) => {
|
|
20731
20844
|
const swipeBem = cn("swipe");
|
|
20732
20845
|
const touch = useTouch();
|
|
20733
|
-
const { children, className, style } = { ...defaultProps$
|
|
20846
|
+
const { children, className, style } = { ...defaultProps$s, ...props };
|
|
20734
20847
|
const root2 = useRef();
|
|
20735
20848
|
const opened = useRef(false);
|
|
20736
20849
|
const lockClick = useRef(false);
|
|
@@ -20898,9 +21011,9 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
20898
21011
|
/* @__PURE__ */ React__default.createElement("div", { className: `${swipeBem("wrapper")}`, style: wrapperStyle }, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef))
|
|
20899
21012
|
);
|
|
20900
21013
|
});
|
|
20901
|
-
Swipe.defaultProps = defaultProps$
|
|
21014
|
+
Swipe.defaultProps = defaultProps$s;
|
|
20902
21015
|
Swipe.displayName = "NutSwipe";
|
|
20903
|
-
const classPrefix$
|
|
21016
|
+
const classPrefix$7 = "nut-toast";
|
|
20904
21017
|
class Notification extends React.PureComponent {
|
|
20905
21018
|
constructor(props) {
|
|
20906
21019
|
super(props);
|
|
@@ -20953,7 +21066,7 @@ class Notification extends React.PureComponent {
|
|
|
20953
21066
|
iconNode = /* @__PURE__ */ React.createElement(x$8, null);
|
|
20954
21067
|
break;
|
|
20955
21068
|
}
|
|
20956
|
-
return /* @__PURE__ */ React.createElement("p", { className: `${classPrefix$
|
|
21069
|
+
return /* @__PURE__ */ React.createElement("p", { className: `${classPrefix$7}__icon-wrapper` }, iconNode);
|
|
20957
21070
|
}
|
|
20958
21071
|
return icon;
|
|
20959
21072
|
}
|
|
@@ -20986,22 +21099,22 @@ class Notification extends React.PureComponent {
|
|
|
20986
21099
|
{
|
|
20987
21100
|
visible: true,
|
|
20988
21101
|
style,
|
|
20989
|
-
className: `${classPrefix$
|
|
21102
|
+
className: `${classPrefix$7}__overlay-default ${className}`,
|
|
20990
21103
|
onClick: () => {
|
|
20991
21104
|
console.log("onclick");
|
|
20992
21105
|
this.clickCover();
|
|
20993
21106
|
},
|
|
20994
21107
|
closeOnOverlayClick
|
|
20995
21108
|
},
|
|
20996
|
-
/* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
21109
|
+
/* @__PURE__ */ React.createElement("div", { className: `${classPrefix$7} ${classes}`, id: `toast-${id}` }, /* @__PURE__ */ React.createElement(
|
|
20997
21110
|
"div",
|
|
20998
21111
|
{
|
|
20999
|
-
className: `${classPrefix$
|
|
21112
|
+
className: `${classPrefix$7}__inner ${classPrefix$7}-${position} ${contentClassName}`,
|
|
21000
21113
|
style: contentStyle
|
|
21001
21114
|
},
|
|
21002
21115
|
this.renderIcon(),
|
|
21003
|
-
title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
21004
|
-
/* @__PURE__ */ React.createElement("span", { className: `${classPrefix$
|
|
21116
|
+
title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$7}-title` }, title) : null,
|
|
21117
|
+
/* @__PURE__ */ React.createElement("span", { className: `${classPrefix$7}-text` }, content)
|
|
21005
21118
|
))
|
|
21006
21119
|
));
|
|
21007
21120
|
}
|
|
@@ -21104,7 +21217,7 @@ const Toast = {
|
|
|
21104
21217
|
}
|
|
21105
21218
|
}
|
|
21106
21219
|
};
|
|
21107
|
-
const defaultProps$
|
|
21220
|
+
const defaultProps$r = {
|
|
21108
21221
|
...ComponentDefaults,
|
|
21109
21222
|
type: "shake",
|
|
21110
21223
|
action: "initial",
|
|
@@ -21112,16 +21225,16 @@ const defaultProps$s = {
|
|
|
21112
21225
|
onClick: (event) => {
|
|
21113
21226
|
}
|
|
21114
21227
|
};
|
|
21115
|
-
const classPrefix$
|
|
21228
|
+
const classPrefix$6 = `nut-animate`;
|
|
21116
21229
|
const Animate = (props) => {
|
|
21117
21230
|
const { className, type: type4, action, loop: loop2, onClick, children, ...rest } = {
|
|
21118
|
-
...defaultProps$
|
|
21231
|
+
...defaultProps$r,
|
|
21119
21232
|
...props
|
|
21120
21233
|
};
|
|
21121
21234
|
const [clicked, setClicked] = useState(false);
|
|
21122
21235
|
const classes = classNames({
|
|
21123
21236
|
"nut-ani-container": true,
|
|
21124
|
-
[`${classPrefix$
|
|
21237
|
+
[`${classPrefix$6}-${type4}`]: action === "initial" || clicked ? type4 : false,
|
|
21125
21238
|
loop: loop2
|
|
21126
21239
|
});
|
|
21127
21240
|
const cls = classNames(classes, className);
|
|
@@ -21136,9 +21249,9 @@ const Animate = (props) => {
|
|
|
21136
21249
|
};
|
|
21137
21250
|
return /* @__PURE__ */ React__default.createElement("div", { className: "nut-animate" }, /* @__PURE__ */ React__default.createElement("div", { className: cls, onClick: handleClick2, ...rest }, children));
|
|
21138
21251
|
};
|
|
21139
|
-
Animate.defaultProps = defaultProps$
|
|
21252
|
+
Animate.defaultProps = defaultProps$r;
|
|
21140
21253
|
Animate.displayName = "NutAnimate";
|
|
21141
|
-
const defaultProps$
|
|
21254
|
+
const defaultProps$q = {
|
|
21142
21255
|
...ComponentDefaults,
|
|
21143
21256
|
length: 0,
|
|
21144
21257
|
value: "",
|
|
@@ -21157,7 +21270,7 @@ const CountUp = (props) => {
|
|
|
21157
21270
|
style,
|
|
21158
21271
|
...reset
|
|
21159
21272
|
} = {
|
|
21160
|
-
...defaultProps$
|
|
21273
|
+
...defaultProps$q,
|
|
21161
21274
|
...props
|
|
21162
21275
|
};
|
|
21163
21276
|
const classPrefix2 = "nut-countup";
|
|
@@ -21221,9 +21334,9 @@ const CountUp = (props) => {
|
|
|
21221
21334
|
);
|
|
21222
21335
|
})));
|
|
21223
21336
|
};
|
|
21224
|
-
CountUp.defaultProps = defaultProps$
|
|
21337
|
+
CountUp.defaultProps = defaultProps$q;
|
|
21225
21338
|
CountUp.displayName = "NutCountUp";
|
|
21226
|
-
const defaultProps$
|
|
21339
|
+
const defaultProps$p = {};
|
|
21227
21340
|
class AnimatingNumbers extends Component {
|
|
21228
21341
|
constructor(props) {
|
|
21229
21342
|
super(props);
|
|
@@ -21233,11 +21346,11 @@ class AnimatingNumbers extends Component {
|
|
|
21233
21346
|
return /* @__PURE__ */ React__default.createElement("div", { className: "nut-animatingnumbers" });
|
|
21234
21347
|
}
|
|
21235
21348
|
}
|
|
21236
|
-
__publicField(AnimatingNumbers, "defaultProps", defaultProps$
|
|
21349
|
+
__publicField(AnimatingNumbers, "defaultProps", defaultProps$p);
|
|
21237
21350
|
__publicField(AnimatingNumbers, "displayName", "NutAnimatingNumbers");
|
|
21238
21351
|
__publicField(AnimatingNumbers, "CountUp", CountUp);
|
|
21239
21352
|
AnimatingNumbers.CountUp = CountUp;
|
|
21240
|
-
const defaultProps$
|
|
21353
|
+
const defaultProps$o = {
|
|
21241
21354
|
...ComponentDefaults,
|
|
21242
21355
|
src: "",
|
|
21243
21356
|
muted: false,
|
|
@@ -21280,7 +21393,7 @@ const Audio = (props) => {
|
|
|
21280
21393
|
children,
|
|
21281
21394
|
...rest
|
|
21282
21395
|
} = {
|
|
21283
|
-
...defaultProps$
|
|
21396
|
+
...defaultProps$o,
|
|
21284
21397
|
...props
|
|
21285
21398
|
};
|
|
21286
21399
|
const [playing, setPlaying] = useState(false);
|
|
@@ -21486,9 +21599,9 @@ const Audio = (props) => {
|
|
|
21486
21599
|
/* @__PURE__ */ React__default.createElement("track", { kind: "captions" })
|
|
21487
21600
|
));
|
|
21488
21601
|
};
|
|
21489
|
-
Audio.defaultProps = defaultProps$
|
|
21602
|
+
Audio.defaultProps = defaultProps$o;
|
|
21490
21603
|
Audio.displayName = "NutAudio";
|
|
21491
|
-
const defaultProps$
|
|
21604
|
+
const defaultProps$n = {
|
|
21492
21605
|
...ComponentDefaults,
|
|
21493
21606
|
maxContent: "",
|
|
21494
21607
|
max: "",
|
|
@@ -21497,21 +21610,21 @@ const defaultProps$o = {
|
|
|
21497
21610
|
gap: "-8",
|
|
21498
21611
|
level: "left"
|
|
21499
21612
|
};
|
|
21500
|
-
const classPrefix$
|
|
21613
|
+
const classPrefix$5 = `nut-avatar-group`;
|
|
21501
21614
|
const AvatarGroup = (props) => {
|
|
21502
|
-
const propAvatarGroup = { ...defaultProps$
|
|
21615
|
+
const propAvatarGroup = { ...defaultProps$n, ...props };
|
|
21503
21616
|
const { className, style, children } = propAvatarGroup;
|
|
21504
21617
|
const avatarGroupRef = useRef(null);
|
|
21505
|
-
const cls = classNames(classPrefix$
|
|
21618
|
+
const cls = classNames(classPrefix$5, className);
|
|
21506
21619
|
const parentAvatar = {
|
|
21507
21620
|
propAvatarGroup,
|
|
21508
21621
|
avatarGroupRef
|
|
21509
21622
|
};
|
|
21510
21623
|
return /* @__PURE__ */ React__default.createElement(AvatarContext.Provider, { value: parentAvatar }, /* @__PURE__ */ React__default.createElement("div", { className: cls, style, ref: avatarGroupRef }, children));
|
|
21511
21624
|
};
|
|
21512
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
21625
|
+
AvatarGroup.defaultProps = defaultProps$n;
|
|
21513
21626
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
21514
|
-
const defaultProps$
|
|
21627
|
+
const defaultProps$m = {
|
|
21515
21628
|
...ComponentDefaults,
|
|
21516
21629
|
strokeWidth: 5,
|
|
21517
21630
|
radius: 50,
|
|
@@ -21520,7 +21633,7 @@ const defaultProps$n = {
|
|
|
21520
21633
|
background: "#e5e9f2",
|
|
21521
21634
|
clockwise: true
|
|
21522
21635
|
};
|
|
21523
|
-
const classPrefix$
|
|
21636
|
+
const classPrefix$4 = `nut-circleprogress`;
|
|
21524
21637
|
const CircleProgress = (props) => {
|
|
21525
21638
|
var _a2;
|
|
21526
21639
|
const {
|
|
@@ -21536,10 +21649,10 @@ const CircleProgress = (props) => {
|
|
|
21536
21649
|
strokeLinecap,
|
|
21537
21650
|
...restProps
|
|
21538
21651
|
} = {
|
|
21539
|
-
...defaultProps$
|
|
21652
|
+
...defaultProps$m,
|
|
21540
21653
|
...props
|
|
21541
21654
|
};
|
|
21542
|
-
const classes = classNames(className, classPrefix$
|
|
21655
|
+
const classes = classNames(className, classPrefix$4);
|
|
21543
21656
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
21544
21657
|
const styles = {
|
|
21545
21658
|
height: `${Number(radius) * 2}px`,
|
|
@@ -21605,7 +21718,7 @@ const CircleProgress = (props) => {
|
|
|
21605
21718
|
}
|
|
21606
21719
|
)), /* @__PURE__ */ React__default.createElement("div", { className: "nut-circleprogress-text" }, children));
|
|
21607
21720
|
};
|
|
21608
|
-
CircleProgress.defaultProps = defaultProps$
|
|
21721
|
+
CircleProgress.defaultProps = defaultProps$m;
|
|
21609
21722
|
CircleProgress.displayName = "NutCircleProgress";
|
|
21610
21723
|
const collapseContext = {
|
|
21611
21724
|
isOpen: (name) => {
|
|
@@ -21617,7 +21730,7 @@ const collapseContext = {
|
|
|
21617
21730
|
rotate: 180
|
|
21618
21731
|
};
|
|
21619
21732
|
const CollapseContext = createContext(collapseContext);
|
|
21620
|
-
const defaultProps$
|
|
21733
|
+
const defaultProps$l = {
|
|
21621
21734
|
...ComponentDefaults,
|
|
21622
21735
|
title: null,
|
|
21623
21736
|
name: "",
|
|
@@ -21639,7 +21752,7 @@ const CollapseItem = (props) => {
|
|
|
21639
21752
|
extra,
|
|
21640
21753
|
...rest
|
|
21641
21754
|
} = {
|
|
21642
|
-
...defaultProps$
|
|
21755
|
+
...defaultProps$l,
|
|
21643
21756
|
...props
|
|
21644
21757
|
};
|
|
21645
21758
|
const classPrefix2 = "nut-collapse-item";
|
|
@@ -21706,9 +21819,9 @@ const CollapseItem = (props) => {
|
|
|
21706
21819
|
/* @__PURE__ */ React__default.createElement("div", { ref: contentRef, className: `${classPrefix2}__content-text` }, children)
|
|
21707
21820
|
));
|
|
21708
21821
|
};
|
|
21709
|
-
CollapseItem.defaultProps = defaultProps$
|
|
21822
|
+
CollapseItem.defaultProps = defaultProps$l;
|
|
21710
21823
|
CollapseItem.displayName = "NutCollapseItem";
|
|
21711
|
-
const defaultProps$
|
|
21824
|
+
const defaultProps$k = {
|
|
21712
21825
|
...ComponentDefaults,
|
|
21713
21826
|
defaultActiveName: [],
|
|
21714
21827
|
accordion: false,
|
|
@@ -21727,7 +21840,7 @@ const Collapse = (props) => {
|
|
|
21727
21840
|
rotate,
|
|
21728
21841
|
onChange
|
|
21729
21842
|
} = {
|
|
21730
|
-
...defaultProps$
|
|
21843
|
+
...defaultProps$k,
|
|
21731
21844
|
...props
|
|
21732
21845
|
};
|
|
21733
21846
|
const classPrefix2 = "nut-collapse";
|
|
@@ -21784,10 +21897,10 @@ const Collapse = (props) => {
|
|
|
21784
21897
|
/* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix2, className), style }, children)
|
|
21785
21898
|
);
|
|
21786
21899
|
};
|
|
21787
|
-
Collapse.defaultProps = defaultProps$
|
|
21900
|
+
Collapse.defaultProps = defaultProps$k;
|
|
21788
21901
|
Collapse.displayName = "NutCollapse";
|
|
21789
21902
|
Collapse.Item = CollapseItem;
|
|
21790
|
-
const defaultProps$
|
|
21903
|
+
const defaultProps$j = {
|
|
21791
21904
|
...ComponentDefaults,
|
|
21792
21905
|
paused: false,
|
|
21793
21906
|
startTime: Date.now(),
|
|
@@ -21819,7 +21932,7 @@ const InternalCountDown = (props, ref) => {
|
|
|
21819
21932
|
onUpdate,
|
|
21820
21933
|
children,
|
|
21821
21934
|
...rest
|
|
21822
|
-
} = { ...defaultProps$
|
|
21935
|
+
} = { ...defaultProps$j, ...props };
|
|
21823
21936
|
const classPrefix2 = "nut-countdown";
|
|
21824
21937
|
const [restTimeStamp, setRestTime] = useState(0);
|
|
21825
21938
|
const stateRef = useRef({
|
|
@@ -22030,9 +22143,9 @@ const InternalCountDown = (props, ref) => {
|
|
|
22030
22143
|
);
|
|
22031
22144
|
};
|
|
22032
22145
|
const CountDown = React__default.forwardRef(InternalCountDown);
|
|
22033
|
-
CountDown.defaultProps = defaultProps$
|
|
22146
|
+
CountDown.defaultProps = defaultProps$j;
|
|
22034
22147
|
CountDown.displayName = "NutCountDown";
|
|
22035
|
-
const defaultProps$
|
|
22148
|
+
const defaultProps$i = {
|
|
22036
22149
|
...ComponentDefaults,
|
|
22037
22150
|
content: "",
|
|
22038
22151
|
direction: "end",
|
|
@@ -22042,7 +22155,7 @@ const defaultProps$j = {
|
|
|
22042
22155
|
symbol: "...",
|
|
22043
22156
|
lineHeight: "20"
|
|
22044
22157
|
};
|
|
22045
|
-
const classPrefix$
|
|
22158
|
+
const classPrefix$3 = `nut-ellipsis`;
|
|
22046
22159
|
const Ellipsis = (props) => {
|
|
22047
22160
|
var _a2, _b;
|
|
22048
22161
|
const {
|
|
@@ -22058,14 +22171,14 @@ const Ellipsis = (props) => {
|
|
|
22058
22171
|
onClick,
|
|
22059
22172
|
onChange,
|
|
22060
22173
|
...rest
|
|
22061
|
-
} = { ...defaultProps$
|
|
22174
|
+
} = { ...defaultProps$i, ...props };
|
|
22062
22175
|
let container = null;
|
|
22063
22176
|
let maxHeight = 0;
|
|
22064
22177
|
const [exceeded, setExceeded] = useState(false);
|
|
22065
22178
|
const [expanded, setExpanded] = useState(false);
|
|
22066
22179
|
const ellipsis = useRef();
|
|
22067
22180
|
const root2 = useRef(null);
|
|
22068
|
-
const classes = classNames(classPrefix$
|
|
22181
|
+
const classes = classNames(classPrefix$3, className);
|
|
22069
22182
|
useLayoutEffect(() => {
|
|
22070
22183
|
if (content) {
|
|
22071
22184
|
createContainer();
|
|
@@ -22206,9 +22319,9 @@ const Ellipsis = (props) => {
|
|
|
22206
22319
|
collapseText
|
|
22207
22320
|
) : null) : null));
|
|
22208
22321
|
};
|
|
22209
|
-
Ellipsis.defaultProps = defaultProps$
|
|
22322
|
+
Ellipsis.defaultProps = defaultProps$i;
|
|
22210
22323
|
Ellipsis.displayName = "NutEllipsis";
|
|
22211
|
-
const defaultProps$
|
|
22324
|
+
const defaultProps$h = {
|
|
22212
22325
|
...ComponentDefaults,
|
|
22213
22326
|
source: {
|
|
22214
22327
|
type: {},
|
|
@@ -22224,7 +22337,7 @@ const defaultProps$i = {
|
|
|
22224
22337
|
loop: false
|
|
22225
22338
|
}
|
|
22226
22339
|
};
|
|
22227
|
-
const classPrefix$
|
|
22340
|
+
const classPrefix$2 = `nut-video`;
|
|
22228
22341
|
const Video = (props) => {
|
|
22229
22342
|
const {
|
|
22230
22343
|
children,
|
|
@@ -22236,11 +22349,11 @@ const Video = (props) => {
|
|
|
22236
22349
|
onPlayEnd,
|
|
22237
22350
|
...restProps
|
|
22238
22351
|
} = {
|
|
22239
|
-
...defaultProps$
|
|
22352
|
+
...defaultProps$h,
|
|
22240
22353
|
...props
|
|
22241
22354
|
};
|
|
22242
22355
|
const rootRef = useRef(null);
|
|
22243
|
-
const classes = classNames(className, classPrefix$
|
|
22356
|
+
const classes = classNames(className, classPrefix$2);
|
|
22244
22357
|
useEffect(() => {
|
|
22245
22358
|
init();
|
|
22246
22359
|
}, []);
|
|
@@ -22286,22 +22399,22 @@ const Video = (props) => {
|
|
|
22286
22399
|
/* @__PURE__ */ React__default.createElement("track", { kind: "captions" })
|
|
22287
22400
|
));
|
|
22288
22401
|
};
|
|
22289
|
-
Video.defaultProps = defaultProps$
|
|
22402
|
+
Video.defaultProps = defaultProps$h;
|
|
22290
22403
|
Video.displayName = "NutVideo";
|
|
22291
22404
|
const DataContext$1 = createContext({});
|
|
22292
|
-
const defaultProps$
|
|
22405
|
+
const defaultProps$g = {
|
|
22293
22406
|
total: 3,
|
|
22294
22407
|
current: 0,
|
|
22295
22408
|
direction: "horizontal"
|
|
22296
22409
|
};
|
|
22297
|
-
const classPrefix = `nut-indicator`;
|
|
22410
|
+
const classPrefix$1 = `nut-indicator`;
|
|
22298
22411
|
const Indicator = (props) => {
|
|
22299
22412
|
const { total, current, children, className, direction, ...rest } = {
|
|
22300
|
-
...defaultProps$
|
|
22413
|
+
...defaultProps$g,
|
|
22301
22414
|
...props
|
|
22302
22415
|
};
|
|
22303
22416
|
const classes = classNames({
|
|
22304
|
-
[`${classPrefix}__vertical`]: direction === "vertical"
|
|
22417
|
+
[`${classPrefix$1}__vertical`]: direction === "vertical"
|
|
22305
22418
|
});
|
|
22306
22419
|
const renderElement = () => {
|
|
22307
22420
|
const childs = [];
|
|
@@ -22311,18 +22424,18 @@ const Indicator = (props) => {
|
|
|
22311
22424
|
"div",
|
|
22312
22425
|
{
|
|
22313
22426
|
key: item,
|
|
22314
|
-
className: `${classPrefix}__dot ${classPrefix}__active`
|
|
22427
|
+
className: `${classPrefix$1}__dot ${classPrefix$1}__active`
|
|
22315
22428
|
}
|
|
22316
|
-
) : /* @__PURE__ */ React__default.createElement("div", { key: item, className: `${classPrefix}__dot` })
|
|
22429
|
+
) : /* @__PURE__ */ React__default.createElement("div", { key: item, className: `${classPrefix$1}__dot` })
|
|
22317
22430
|
);
|
|
22318
22431
|
}
|
|
22319
22432
|
return childs;
|
|
22320
22433
|
};
|
|
22321
22434
|
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(classes, className), ...rest }, renderElement());
|
|
22322
22435
|
};
|
|
22323
|
-
Indicator.defaultProps = defaultProps$
|
|
22436
|
+
Indicator.defaultProps = defaultProps$g;
|
|
22324
22437
|
Indicator.displayName = "NutIndicator";
|
|
22325
|
-
const defaultProps$
|
|
22438
|
+
const defaultProps$f = {
|
|
22326
22439
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
22327
22440
|
height: 0,
|
|
22328
22441
|
duration: 500,
|
|
@@ -22339,7 +22452,7 @@ const defaultProps$g = {
|
|
|
22339
22452
|
};
|
|
22340
22453
|
const DISTANCE = 5;
|
|
22341
22454
|
const Swiper = React__default.forwardRef((props, ref) => {
|
|
22342
|
-
const propSwiper = { ...defaultProps$
|
|
22455
|
+
const propSwiper = { ...defaultProps$f, ...props };
|
|
22343
22456
|
const {
|
|
22344
22457
|
children,
|
|
22345
22458
|
direction,
|
|
@@ -22752,13 +22865,13 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
22752
22865
|
renderIndicator()
|
|
22753
22866
|
));
|
|
22754
22867
|
});
|
|
22755
|
-
Swiper.defaultProps = defaultProps$
|
|
22868
|
+
Swiper.defaultProps = defaultProps$f;
|
|
22756
22869
|
Swiper.displayName = "NutSwiper";
|
|
22757
|
-
const defaultProps$
|
|
22870
|
+
const defaultProps$e = {
|
|
22758
22871
|
direction: "horizontal"
|
|
22759
22872
|
};
|
|
22760
22873
|
const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
22761
|
-
const _props = { ...defaultProps$
|
|
22874
|
+
const _props = { ...defaultProps$e, ...props };
|
|
22762
22875
|
const { className, style, children, direction, size } = _props;
|
|
22763
22876
|
const parent = useContext(DataContext$1);
|
|
22764
22877
|
const b = cn("swiper-item");
|
|
@@ -22774,9 +22887,9 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
|
22774
22887
|
};
|
|
22775
22888
|
return /* @__PURE__ */ React__default.createElement("div", { className: classes, style: { ...style, ...getStyle() } }, children);
|
|
22776
22889
|
});
|
|
22777
|
-
SwiperItem.defaultProps = defaultProps$
|
|
22890
|
+
SwiperItem.defaultProps = defaultProps$e;
|
|
22778
22891
|
SwiperItem.displayName = "NutSwiperItem";
|
|
22779
|
-
const defaultProps$
|
|
22892
|
+
const defaultProps$d = {
|
|
22780
22893
|
...ComponentDefaults,
|
|
22781
22894
|
images: [],
|
|
22782
22895
|
videos: [],
|
|
@@ -22978,7 +23091,7 @@ const ImagePreview = (props) => {
|
|
|
22978
23091
|
/* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0))
|
|
22979
23092
|
);
|
|
22980
23093
|
};
|
|
22981
|
-
ImagePreview.defaultProps = defaultProps$
|
|
23094
|
+
ImagePreview.defaultProps = defaultProps$d;
|
|
22982
23095
|
ImagePreview.displayName = "NutImagePreview";
|
|
22983
23096
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
22984
23097
|
let index = 0;
|
|
@@ -23091,7 +23204,7 @@ const updateItemSize = (positions, items, sizeKey) => {
|
|
|
23091
23204
|
}
|
|
23092
23205
|
});
|
|
23093
23206
|
};
|
|
23094
|
-
const defaultProps$
|
|
23207
|
+
const defaultProps$c = {
|
|
23095
23208
|
...ComponentDefaults,
|
|
23096
23209
|
list: [],
|
|
23097
23210
|
itemHeight: 66,
|
|
@@ -23113,7 +23226,7 @@ const VirtualList = (props) => {
|
|
|
23113
23226
|
containerHeight,
|
|
23114
23227
|
...rest
|
|
23115
23228
|
} = {
|
|
23116
|
-
...defaultProps$
|
|
23229
|
+
...defaultProps$c,
|
|
23117
23230
|
...props
|
|
23118
23231
|
};
|
|
23119
23232
|
const horizontal = direction === "horizontal";
|
|
@@ -23277,9 +23390,9 @@ const VirtualList = (props) => {
|
|
|
23277
23390
|
)
|
|
23278
23391
|
);
|
|
23279
23392
|
};
|
|
23280
|
-
VirtualList.defaultProps = defaultProps$
|
|
23393
|
+
VirtualList.defaultProps = defaultProps$c;
|
|
23281
23394
|
VirtualList.displayName = "NutVirtualList";
|
|
23282
|
-
const defaultProps$
|
|
23395
|
+
const defaultProps$b = {
|
|
23283
23396
|
...ComponentDefaults,
|
|
23284
23397
|
defaultValue: 1,
|
|
23285
23398
|
mode: "multi",
|
|
@@ -23307,7 +23420,7 @@ const Pagination = (props) => {
|
|
|
23307
23420
|
className,
|
|
23308
23421
|
...rest
|
|
23309
23422
|
} = {
|
|
23310
|
-
...defaultProps$
|
|
23423
|
+
...defaultProps$b,
|
|
23311
23424
|
...props
|
|
23312
23425
|
};
|
|
23313
23426
|
const classPrefix2 = "nut-pagination";
|
|
@@ -23389,9 +23502,9 @@ const Pagination = (props) => {
|
|
|
23389
23502
|
next || locale.pagination.next
|
|
23390
23503
|
));
|
|
23391
23504
|
};
|
|
23392
|
-
Pagination.defaultProps = defaultProps$
|
|
23505
|
+
Pagination.defaultProps = defaultProps$b;
|
|
23393
23506
|
Pagination.displayName = "NutPagination";
|
|
23394
|
-
const defaultProps$
|
|
23507
|
+
const defaultProps$a = {
|
|
23395
23508
|
...ComponentDefaults,
|
|
23396
23509
|
price: 0,
|
|
23397
23510
|
symbol: "¥",
|
|
@@ -23414,7 +23527,7 @@ const Price = (props) => {
|
|
|
23414
23527
|
style,
|
|
23415
23528
|
...rest
|
|
23416
23529
|
} = {
|
|
23417
|
-
...defaultProps$
|
|
23530
|
+
...defaultProps$a,
|
|
23418
23531
|
...props
|
|
23419
23532
|
};
|
|
23420
23533
|
const classPrefix2 = "nut-price";
|
|
@@ -23494,10 +23607,10 @@ const Price = (props) => {
|
|
|
23494
23607
|
symbol && position === "after" ? renderSymbol() : null
|
|
23495
23608
|
);
|
|
23496
23609
|
};
|
|
23497
|
-
Price.defaultProps = defaultProps$
|
|
23610
|
+
Price.defaultProps = defaultProps$a;
|
|
23498
23611
|
Price.displayName = "NutPrice";
|
|
23499
23612
|
const DataContext = createContext({});
|
|
23500
|
-
const defaultProps$
|
|
23613
|
+
const defaultProps$9 = {
|
|
23501
23614
|
...ComponentDefaults,
|
|
23502
23615
|
title: "",
|
|
23503
23616
|
description: "",
|
|
@@ -23506,7 +23619,7 @@ const defaultProps$a = {
|
|
|
23506
23619
|
};
|
|
23507
23620
|
const Step = (props) => {
|
|
23508
23621
|
const { children, title, description, value, icon, className, ...restProps } = {
|
|
23509
|
-
...defaultProps$
|
|
23622
|
+
...defaultProps$9,
|
|
23510
23623
|
...props
|
|
23511
23624
|
};
|
|
23512
23625
|
const parent = useContext(DataContext);
|
|
@@ -23540,16 +23653,16 @@ const Step = (props) => {
|
|
|
23540
23653
|
};
|
|
23541
23654
|
return /* @__PURE__ */ React__default.createElement("div", { className: classes, ...restProps, onClick: handleClickStep }, /* @__PURE__ */ React__default.createElement("div", { className: "nut-step-head" }, /* @__PURE__ */ React__default.createElement("div", { className: "nut-step-line" }), /* @__PURE__ */ React__default.createElement("div", { className: renderIconClass() }, icon || !dot && /* @__PURE__ */ React__default.createElement("span", { className: "nut-step-inner" }, value))), /* @__PURE__ */ React__default.createElement("div", { className: "nut-step-main" }, /* @__PURE__ */ React__default.createElement("span", { className: "nut-step-title" }, title), description && /* @__PURE__ */ React__default.createElement("span", { className: "nut-step-description" }, description)));
|
|
23542
23655
|
};
|
|
23543
|
-
Step.defaultProps = defaultProps$
|
|
23656
|
+
Step.defaultProps = defaultProps$9;
|
|
23544
23657
|
Step.displayName = "NutStep";
|
|
23545
|
-
const defaultProps$
|
|
23658
|
+
const defaultProps$8 = {
|
|
23546
23659
|
...ComponentDefaults,
|
|
23547
23660
|
value: 0,
|
|
23548
23661
|
direction: "horizontal",
|
|
23549
23662
|
dot: false
|
|
23550
23663
|
};
|
|
23551
23664
|
const Steps = (props) => {
|
|
23552
|
-
const propSteps = { ...defaultProps$
|
|
23665
|
+
const propSteps = { ...defaultProps$8, ...props };
|
|
23553
23666
|
const {
|
|
23554
23667
|
children,
|
|
23555
23668
|
value,
|
|
@@ -23580,9 +23693,9 @@ const Steps = (props) => {
|
|
|
23580
23693
|
children
|
|
23581
23694
|
));
|
|
23582
23695
|
};
|
|
23583
|
-
Steps.defaultProps = defaultProps$
|
|
23696
|
+
Steps.defaultProps = defaultProps$8;
|
|
23584
23697
|
Steps.displayName = "NutSteps";
|
|
23585
|
-
const defaultProps$
|
|
23698
|
+
const defaultProps$7 = {
|
|
23586
23699
|
...ComponentDefaults,
|
|
23587
23700
|
columns: [],
|
|
23588
23701
|
data: [],
|
|
@@ -23594,7 +23707,7 @@ const defaultProps$8 = {
|
|
|
23594
23707
|
};
|
|
23595
23708
|
const Table = (props) => {
|
|
23596
23709
|
const { locale } = useConfig();
|
|
23597
|
-
defaultProps$
|
|
23710
|
+
defaultProps$7.noData = locale.noData;
|
|
23598
23711
|
const {
|
|
23599
23712
|
children,
|
|
23600
23713
|
className,
|
|
@@ -23610,7 +23723,7 @@ const Table = (props) => {
|
|
|
23610
23723
|
onSort,
|
|
23611
23724
|
...rest
|
|
23612
23725
|
} = {
|
|
23613
|
-
...defaultProps$
|
|
23726
|
+
...defaultProps$7,
|
|
23614
23727
|
...props
|
|
23615
23728
|
};
|
|
23616
23729
|
const [curData, setCurData] = useState(data);
|
|
@@ -23693,19 +23806,18 @@ const Table = (props) => {
|
|
|
23693
23806
|
/* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__main__body` }, renderBoyTrs())
|
|
23694
23807
|
), (summary || curData.length === 0) && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__summary` }, summary || noData));
|
|
23695
23808
|
};
|
|
23696
|
-
Table.defaultProps = defaultProps$
|
|
23809
|
+
Table.defaultProps = defaultProps$7;
|
|
23697
23810
|
Table.displayName = "NutTable";
|
|
23698
|
-
const defaultProps$
|
|
23811
|
+
const defaultProps$6 = {
|
|
23699
23812
|
...ComponentDefaults,
|
|
23700
23813
|
type: "default",
|
|
23814
|
+
background: "",
|
|
23701
23815
|
color: "",
|
|
23702
|
-
textColor: "",
|
|
23703
23816
|
plain: false,
|
|
23704
23817
|
round: false,
|
|
23705
23818
|
mark: false,
|
|
23706
23819
|
closeable: false,
|
|
23707
23820
|
closeIcon: null,
|
|
23708
|
-
prefixCls: "nut-tag",
|
|
23709
23821
|
onClose: (e) => {
|
|
23710
23822
|
},
|
|
23711
23823
|
onClick: (e) => {
|
|
@@ -23715,86 +23827,70 @@ const Tag = (props) => {
|
|
|
23715
23827
|
const {
|
|
23716
23828
|
className,
|
|
23717
23829
|
style,
|
|
23718
|
-
|
|
23830
|
+
background,
|
|
23719
23831
|
plain,
|
|
23720
23832
|
type: type4,
|
|
23721
23833
|
round,
|
|
23722
|
-
prefixCls: prefixCls2,
|
|
23723
23834
|
children,
|
|
23724
23835
|
mark,
|
|
23725
23836
|
closeable,
|
|
23726
23837
|
closeIcon,
|
|
23727
|
-
|
|
23838
|
+
color,
|
|
23728
23839
|
onClick,
|
|
23729
23840
|
onClose
|
|
23730
23841
|
} = {
|
|
23731
|
-
...defaultProps$
|
|
23842
|
+
...defaultProps$6,
|
|
23732
23843
|
...props
|
|
23733
23844
|
};
|
|
23734
|
-
const [
|
|
23735
|
-
const [
|
|
23736
|
-
|
|
23737
|
-
setBtnName(classes());
|
|
23738
|
-
}, [
|
|
23739
|
-
type4,
|
|
23740
|
-
color,
|
|
23741
|
-
textColor,
|
|
23742
|
-
plain,
|
|
23743
|
-
round,
|
|
23744
|
-
mark,
|
|
23745
|
-
closeable,
|
|
23746
|
-
prefixCls2,
|
|
23747
|
-
onClick,
|
|
23748
|
-
onClose,
|
|
23749
|
-
className
|
|
23750
|
-
]);
|
|
23845
|
+
const [tagClass, setTagClass] = useState("");
|
|
23846
|
+
const [visible, setVisible] = useState(true);
|
|
23847
|
+
const classPrefix2 = "nut-tag";
|
|
23751
23848
|
const classes = () => {
|
|
23752
|
-
const prefixCls22 = "nut-tag";
|
|
23753
23849
|
return classNames({
|
|
23754
|
-
[
|
|
23755
|
-
[`${
|
|
23756
|
-
[`${
|
|
23757
|
-
[`${
|
|
23758
|
-
[`${
|
|
23759
|
-
[`${
|
|
23850
|
+
[classPrefix2]: true,
|
|
23851
|
+
[`${classPrefix2}--${type4}`]: type4,
|
|
23852
|
+
[`${classPrefix2}--plain`]: plain,
|
|
23853
|
+
[`${classPrefix2}--round`]: round,
|
|
23854
|
+
[`${classPrefix2}--mark`]: mark,
|
|
23855
|
+
[`${classPrefix2}--close`]: closeable,
|
|
23760
23856
|
[`${className}`]: className
|
|
23761
23857
|
});
|
|
23762
23858
|
};
|
|
23859
|
+
useEffect(() => {
|
|
23860
|
+
setTagClass(classes());
|
|
23861
|
+
}, [type4, background, color, plain, round, mark, closeable, className]);
|
|
23763
23862
|
const handleClick2 = (e) => {
|
|
23764
|
-
|
|
23765
|
-
props.onClick(e);
|
|
23766
|
-
}
|
|
23863
|
+
onClick && onClick(e);
|
|
23767
23864
|
};
|
|
23768
23865
|
const getStyle = () => {
|
|
23769
23866
|
const style2 = {};
|
|
23770
|
-
if (
|
|
23771
|
-
style2.color = textColor;
|
|
23772
|
-
} else if (color && plain) {
|
|
23867
|
+
if (color) {
|
|
23773
23868
|
style2.color = color;
|
|
23869
|
+
} else if (background && plain) {
|
|
23870
|
+
style2.color = background;
|
|
23774
23871
|
}
|
|
23775
23872
|
if (plain) {
|
|
23776
|
-
style2.
|
|
23777
|
-
|
|
23778
|
-
|
|
23779
|
-
style2.background = color;
|
|
23873
|
+
style2.borderColor = background;
|
|
23874
|
+
} else if (background) {
|
|
23875
|
+
style2.background = background;
|
|
23780
23876
|
}
|
|
23781
23877
|
return style2;
|
|
23782
23878
|
};
|
|
23783
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, closeable ?
|
|
23879
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, closeable ? visible && /* @__PURE__ */ React__default.createElement(
|
|
23784
23880
|
"div",
|
|
23785
23881
|
{
|
|
23786
|
-
className:
|
|
23882
|
+
className: tagClass,
|
|
23787
23883
|
style: { ...style, ...getStyle() },
|
|
23788
23884
|
onClick: (e) => handleClick2(e)
|
|
23789
23885
|
},
|
|
23790
|
-
children && /* @__PURE__ */ React__default.createElement("span", { className:
|
|
23886
|
+
children && /* @__PURE__ */ React__default.createElement("span", { className: `${classPrefix2}-text` }, children),
|
|
23791
23887
|
React__default.isValidElement(closeIcon) ? /* @__PURE__ */ React__default.createElement(
|
|
23792
23888
|
"i",
|
|
23793
23889
|
{
|
|
23794
|
-
className:
|
|
23890
|
+
className: `${classPrefix2}-custom-icon`,
|
|
23795
23891
|
onClick: (e) => {
|
|
23796
|
-
|
|
23797
|
-
|
|
23892
|
+
setVisible(false);
|
|
23893
|
+
onClose && onClose(e);
|
|
23798
23894
|
}
|
|
23799
23895
|
},
|
|
23800
23896
|
closeIcon
|
|
@@ -23804,43 +23900,45 @@ const Tag = (props) => {
|
|
|
23804
23900
|
width: 12,
|
|
23805
23901
|
height: 12,
|
|
23806
23902
|
onClick: (e) => {
|
|
23807
|
-
|
|
23808
|
-
|
|
23903
|
+
setVisible(false);
|
|
23904
|
+
onClose && onClose(e);
|
|
23809
23905
|
}
|
|
23810
23906
|
}
|
|
23811
23907
|
)
|
|
23812
23908
|
) : /* @__PURE__ */ React__default.createElement(
|
|
23813
23909
|
"div",
|
|
23814
23910
|
{
|
|
23815
|
-
className:
|
|
23911
|
+
className: tagClass,
|
|
23816
23912
|
style: { ...style, ...getStyle() },
|
|
23817
23913
|
onClick: (e) => handleClick2(e)
|
|
23818
23914
|
},
|
|
23819
|
-
children && /* @__PURE__ */ React__default.createElement("span", { className:
|
|
23915
|
+
children && /* @__PURE__ */ React__default.createElement("span", { className: `${classPrefix2}-text` }, children)
|
|
23820
23916
|
));
|
|
23821
23917
|
};
|
|
23822
|
-
Tag.defaultProps = defaultProps$
|
|
23918
|
+
Tag.defaultProps = defaultProps$6;
|
|
23823
23919
|
Tag.displayName = "NutTag";
|
|
23824
|
-
const defaultProps$
|
|
23825
|
-
|
|
23826
|
-
|
|
23920
|
+
const defaultProps$5 = {
|
|
23921
|
+
...ComponentDefaults,
|
|
23922
|
+
list: [],
|
|
23923
|
+
interval: 500,
|
|
23827
23924
|
loop: true,
|
|
23828
|
-
|
|
23925
|
+
duration: 3e3,
|
|
23829
23926
|
rows: 3,
|
|
23830
|
-
|
|
23927
|
+
gapY: 10
|
|
23831
23928
|
};
|
|
23929
|
+
const classPrefix = `nut-barrage`;
|
|
23832
23930
|
const InternalBarrage = (props, ref) => {
|
|
23833
23931
|
const {
|
|
23834
23932
|
className,
|
|
23835
|
-
|
|
23933
|
+
interval,
|
|
23836
23934
|
loop: loop2,
|
|
23837
|
-
|
|
23838
|
-
|
|
23935
|
+
list,
|
|
23936
|
+
duration,
|
|
23839
23937
|
rows,
|
|
23840
|
-
|
|
23938
|
+
gapY,
|
|
23841
23939
|
...restProps
|
|
23842
23940
|
} = {
|
|
23843
|
-
...defaultProps$
|
|
23941
|
+
...defaultProps$5,
|
|
23844
23942
|
...props
|
|
23845
23943
|
};
|
|
23846
23944
|
const barrageBody = useRef(null);
|
|
@@ -23848,15 +23946,14 @@ const InternalBarrage = (props, ref) => {
|
|
|
23848
23946
|
const barrageCWidth = useRef(0);
|
|
23849
23947
|
const timer = useRef(0);
|
|
23850
23948
|
const index = useRef(0);
|
|
23851
|
-
const
|
|
23852
|
-
const classes = classNames(className, b(""));
|
|
23949
|
+
const classes = classNames(classPrefix, className);
|
|
23853
23950
|
useImperativeHandle(ref, () => ({
|
|
23854
23951
|
add: (word) => {
|
|
23855
|
-
const _index = index.current %
|
|
23856
|
-
if (!loop2 && index.current ===
|
|
23857
|
-
|
|
23952
|
+
const _index = index.current % list.length;
|
|
23953
|
+
if (!loop2 && index.current === list.length) {
|
|
23954
|
+
list.splice(list.length, 0, word);
|
|
23858
23955
|
} else {
|
|
23859
|
-
|
|
23956
|
+
list.splice(_index, 0, word);
|
|
23860
23957
|
}
|
|
23861
23958
|
}
|
|
23862
23959
|
}));
|
|
@@ -23876,27 +23973,27 @@ const InternalBarrage = (props, ref) => {
|
|
|
23876
23973
|
return () => {
|
|
23877
23974
|
clearInterval(timer.current);
|
|
23878
23975
|
};
|
|
23879
|
-
}, [
|
|
23976
|
+
}, [list]);
|
|
23880
23977
|
const run = () => {
|
|
23881
23978
|
clearInterval(timer.current);
|
|
23882
23979
|
timer.current = window.setTimeout(() => {
|
|
23883
23980
|
play();
|
|
23884
|
-
},
|
|
23981
|
+
}, interval);
|
|
23885
23982
|
};
|
|
23886
23983
|
const play = () => {
|
|
23887
|
-
if (!loop2 && index.current >=
|
|
23984
|
+
if (!loop2 && index.current >= list.length) {
|
|
23888
23985
|
return;
|
|
23889
23986
|
}
|
|
23890
|
-
const _index = loop2 ? index.current %
|
|
23987
|
+
const _index = loop2 ? index.current % list.length : index.current;
|
|
23891
23988
|
const el = document.createElement(`div`);
|
|
23892
|
-
el.innerHTML =
|
|
23989
|
+
el.innerHTML = list[_index];
|
|
23893
23990
|
el.classList.add("barrage-item");
|
|
23894
23991
|
barrageContainer.current.appendChild(el);
|
|
23895
23992
|
const width = el.offsetWidth;
|
|
23896
23993
|
const height = el.offsetHeight;
|
|
23897
23994
|
el.classList.add("move");
|
|
23898
|
-
el.style.animationDuration = `${
|
|
23899
|
-
el.style.top = `${_index % rows * (height +
|
|
23995
|
+
el.style.animationDuration = `${duration}ms`;
|
|
23996
|
+
el.style.top = `${_index % rows * (height + gapY) + 20}px`;
|
|
23900
23997
|
el.style.width = `${width}px`;
|
|
23901
23998
|
el.addEventListener("animationend", () => {
|
|
23902
23999
|
barrageContainer.current.removeChild(el);
|
|
@@ -23907,250 +24004,243 @@ const InternalBarrage = (props, ref) => {
|
|
|
23907
24004
|
return /* @__PURE__ */ React__default.createElement("div", { className: classes, ref: barrageBody, ...restProps }, /* @__PURE__ */ React__default.createElement("div", { ref: barrageContainer, className: "bContainer" }));
|
|
23908
24005
|
};
|
|
23909
24006
|
const Barrage = React__default.forwardRef(InternalBarrage);
|
|
23910
|
-
Barrage.defaultProps = defaultProps$
|
|
24007
|
+
Barrage.defaultProps = defaultProps$5;
|
|
23911
24008
|
Barrage.displayName = "NutBarrage";
|
|
23912
|
-
const defaultProps$
|
|
24009
|
+
const defaultProps$4 = {
|
|
24010
|
+
...ComponentDefaults,
|
|
24011
|
+
src: "",
|
|
24012
|
+
title: "",
|
|
24013
|
+
price: "",
|
|
24014
|
+
vipPrice: "",
|
|
24015
|
+
shopDescription: "",
|
|
24016
|
+
delivery: "",
|
|
24017
|
+
shopName: "",
|
|
24018
|
+
description: "",
|
|
24019
|
+
tag: "",
|
|
24020
|
+
priceTag: "",
|
|
24021
|
+
extra: ""
|
|
24022
|
+
};
|
|
23913
24023
|
const Card = (props) => {
|
|
23914
24024
|
const {
|
|
23915
24025
|
className,
|
|
23916
24026
|
style,
|
|
23917
|
-
|
|
24027
|
+
src,
|
|
23918
24028
|
title,
|
|
23919
24029
|
price,
|
|
23920
24030
|
vipPrice,
|
|
23921
|
-
|
|
24031
|
+
shopDescription,
|
|
23922
24032
|
delivery,
|
|
23923
24033
|
shopName,
|
|
23924
|
-
|
|
23925
|
-
|
|
23926
|
-
|
|
23927
|
-
|
|
24034
|
+
tag,
|
|
24035
|
+
priceTag,
|
|
24036
|
+
description,
|
|
24037
|
+
extra,
|
|
23928
24038
|
...rest
|
|
23929
24039
|
} = {
|
|
23930
|
-
...defaultProps$
|
|
24040
|
+
...defaultProps$4,
|
|
23931
24041
|
...props
|
|
23932
24042
|
};
|
|
23933
|
-
const
|
|
23934
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(
|
|
24043
|
+
const classPrefix2 = "nut-card";
|
|
24044
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix2, className), style, ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__left` }, /* @__PURE__ */ React__default.createElement("img", { src, alt: "" })), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__right` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__right-title` }, title), description, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}right-price` }, /* @__PURE__ */ React__default.createElement(Price, { size: "normal", price }), priceTag || /* @__PURE__ */ React__default.createElement(
|
|
24045
|
+
Price,
|
|
24046
|
+
{
|
|
24047
|
+
size: "normal",
|
|
24048
|
+
className: `${classPrefix2}right-price-origin`,
|
|
24049
|
+
price: vipPrice
|
|
24050
|
+
}
|
|
24051
|
+
)), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}right-other` }, tag || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Tag, { type: "danger" }, shopDescription), /* @__PURE__ */ React__default.createElement(Tag, { plain: true }, delivery))), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}right-shop` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}right-shop-name` }, shopName), extra)));
|
|
23935
24052
|
};
|
|
23936
|
-
Card.defaultProps = defaultProps$
|
|
24053
|
+
Card.defaultProps = defaultProps$4;
|
|
23937
24054
|
Card.displayName = "NutCard";
|
|
23938
|
-
const defaultProps$
|
|
23939
|
-
|
|
23940
|
-
|
|
23941
|
-
|
|
23942
|
-
|
|
23943
|
-
|
|
24055
|
+
const defaultProps$3 = {
|
|
24056
|
+
...ComponentDefaults,
|
|
24057
|
+
activeDate: "",
|
|
24058
|
+
activeTime: [],
|
|
24059
|
+
options: [],
|
|
24060
|
+
optionKey: {
|
|
24061
|
+
valueKey: "value",
|
|
24062
|
+
textKey: "text",
|
|
24063
|
+
childrenKey: "children"
|
|
24064
|
+
},
|
|
24065
|
+
onSelect: () => {
|
|
24066
|
+
}
|
|
23944
24067
|
};
|
|
23945
24068
|
const TimeDetail = (props) => {
|
|
23946
|
-
|
|
23947
|
-
|
|
23948
|
-
...defaultProps$4,
|
|
24069
|
+
const { options: options2, optionKey, className, activeDate, activeTime, onSelect } = {
|
|
24070
|
+
...defaultProps$3,
|
|
23949
24071
|
...props
|
|
23950
24072
|
};
|
|
23951
|
-
const
|
|
23952
|
-
const
|
|
23953
|
-
|
|
23954
|
-
|
|
23955
|
-
|
|
23956
|
-
|
|
23957
|
-
|
|
23958
|
-
|
|
23959
|
-
|
|
23960
|
-
|
|
23961
|
-
|
|
23962
|
-
|
|
23963
|
-
|
|
23964
|
-
|
|
23965
|
-
|
|
23966
|
-
|
|
23967
|
-
|
|
23968
|
-
|
|
23969
|
-
|
|
23970
|
-
|
|
23971
|
-
|
|
23972
|
-
|
|
23973
|
-
|
|
24073
|
+
const classPrefix2 = "nut-timedetail";
|
|
24074
|
+
const timeList = useMemo(() => {
|
|
24075
|
+
return (options2 == null ? void 0 : options2.find(
|
|
24076
|
+
(item) => item[optionKey.valueKey] === activeDate
|
|
24077
|
+
)) || {
|
|
24078
|
+
[optionKey.childrenKey]: []
|
|
24079
|
+
};
|
|
24080
|
+
}, [options2, optionKey, activeDate]);
|
|
24081
|
+
const isActive = useCallback(
|
|
24082
|
+
(timeKey) => {
|
|
24083
|
+
const date4 = activeTime.find((item) => {
|
|
24084
|
+
return item[optionKey.valueKey] === activeDate;
|
|
24085
|
+
});
|
|
24086
|
+
if (date4 == null ? void 0 : date4[optionKey.childrenKey]) {
|
|
24087
|
+
const time = date4 == null ? void 0 : date4[optionKey.childrenKey].find((time2) => {
|
|
24088
|
+
return time2[optionKey.valueKey] === timeKey;
|
|
24089
|
+
});
|
|
24090
|
+
return time;
|
|
24091
|
+
}
|
|
24092
|
+
return false;
|
|
24093
|
+
},
|
|
24094
|
+
[activeTime, optionKey, activeDate]
|
|
24095
|
+
);
|
|
24096
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix2, className) }, timeList[optionKey.childrenKey].map((item) => /* @__PURE__ */ React__default.createElement(
|
|
23974
24097
|
"span",
|
|
23975
24098
|
{
|
|
23976
|
-
className:
|
|
23977
|
-
|
|
23978
|
-
|
|
24099
|
+
className: classNames(`${classPrefix2}__item`, {
|
|
24100
|
+
active: isActive(item[optionKey.valueKey])
|
|
24101
|
+
}),
|
|
24102
|
+
key: item[optionKey.valueKey],
|
|
24103
|
+
onClick: () => onSelect(item)
|
|
23979
24104
|
},
|
|
23980
|
-
item
|
|
24105
|
+
item[optionKey.textKey]
|
|
23981
24106
|
)));
|
|
23982
24107
|
};
|
|
23983
|
-
TimeDetail.defaultProps = defaultProps$
|
|
24108
|
+
TimeDetail.defaultProps = defaultProps$3;
|
|
23984
24109
|
TimeDetail.displayName = "NutTimeDetail";
|
|
23985
|
-
const defaultProps$3 = {
|
|
23986
|
-
className: "",
|
|
23987
|
-
date: "",
|
|
23988
|
-
curKey: 0
|
|
23989
|
-
};
|
|
23990
|
-
const TimePannel = (props) => {
|
|
23991
|
-
useConfig();
|
|
23992
|
-
const { children, className, date: date4, curKey, change } = {
|
|
23993
|
-
...defaultProps$3,
|
|
23994
|
-
...props
|
|
23995
|
-
};
|
|
23996
|
-
const b = cn("timepannel");
|
|
23997
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${b()} ${className || ""}`, onClick: () => change(curKey) }, date4);
|
|
23998
|
-
};
|
|
23999
|
-
TimePannel.defaultProps = defaultProps$3;
|
|
24000
|
-
TimePannel.displayName = "NutTimePannel";
|
|
24001
24110
|
const defaultProps$2 = {
|
|
24002
|
-
|
|
24003
|
-
style: {},
|
|
24111
|
+
...ComponentDefaults,
|
|
24004
24112
|
visible: false,
|
|
24005
|
-
height: "20%",
|
|
24006
24113
|
multiple: false,
|
|
24007
|
-
|
|
24008
|
-
|
|
24009
|
-
|
|
24010
|
-
|
|
24011
|
-
|
|
24114
|
+
defaultValue: [],
|
|
24115
|
+
options: [],
|
|
24116
|
+
optionKey: {
|
|
24117
|
+
valueKey: "value",
|
|
24118
|
+
textKey: "text",
|
|
24119
|
+
childrenKey: "children"
|
|
24120
|
+
}
|
|
24012
24121
|
};
|
|
24013
24122
|
const TimeSelect = (props) => {
|
|
24014
|
-
useConfig();
|
|
24123
|
+
const { locale } = useConfig();
|
|
24015
24124
|
const {
|
|
24016
24125
|
visible,
|
|
24017
24126
|
className,
|
|
24018
|
-
|
|
24127
|
+
style,
|
|
24019
24128
|
title,
|
|
24020
|
-
|
|
24021
|
-
|
|
24022
|
-
|
|
24023
|
-
times,
|
|
24129
|
+
defaultValue,
|
|
24130
|
+
options: options2,
|
|
24131
|
+
optionKey,
|
|
24024
24132
|
multiple,
|
|
24025
|
-
select,
|
|
24026
|
-
pannelChange,
|
|
24027
|
-
timeChange,
|
|
24028
24133
|
onSelect,
|
|
24029
|
-
|
|
24030
|
-
onTimeChange
|
|
24134
|
+
onDateChange,
|
|
24135
|
+
onTimeChange,
|
|
24136
|
+
...rest
|
|
24031
24137
|
} = {
|
|
24032
24138
|
...defaultProps$2,
|
|
24033
24139
|
...props
|
|
24034
24140
|
};
|
|
24035
|
-
const [
|
|
24141
|
+
const [activeDate, setActiveDate] = useState(() => {
|
|
24142
|
+
if (defaultValue == null ? void 0 : defaultValue.length) {
|
|
24143
|
+
return defaultValue[0][optionKey.valueKey];
|
|
24144
|
+
}
|
|
24145
|
+
if (options2 == null ? void 0 : options2.length) {
|
|
24146
|
+
return options2[0][optionKey.valueKey];
|
|
24147
|
+
}
|
|
24148
|
+
return "";
|
|
24149
|
+
});
|
|
24036
24150
|
const [activeTime, setActiveTime] = useState(
|
|
24037
|
-
|
|
24038
|
-
{
|
|
24039
|
-
key: currentKey,
|
|
24040
|
-
list: []
|
|
24041
|
-
}
|
|
24042
|
-
]
|
|
24151
|
+
() => defaultValue || []
|
|
24043
24152
|
);
|
|
24044
|
-
const
|
|
24045
|
-
const popStyle = {
|
|
24046
|
-
width: "100%",
|
|
24047
|
-
height
|
|
24048
|
-
};
|
|
24049
|
-
const b = cn("timeselect");
|
|
24153
|
+
const classPrefix2 = "nut-timeselect";
|
|
24050
24154
|
const closeFun = () => {
|
|
24051
|
-
|
|
24052
|
-
|
|
24053
|
-
|
|
24054
|
-
|
|
24055
|
-
|
|
24056
|
-
|
|
24057
|
-
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
|
|
24061
|
-
|
|
24062
|
-
curTimeData = activeTime[i];
|
|
24063
|
-
curIndex = i;
|
|
24064
|
-
break;
|
|
24065
|
-
}
|
|
24066
|
-
}
|
|
24067
|
-
const curTimeIndex = curTimeData.list.findIndex(
|
|
24068
|
-
(item) => String(item) === String(time)
|
|
24069
|
-
);
|
|
24070
|
-
if (curTimeIndex === -1) {
|
|
24071
|
-
curTimeData.list.push(time);
|
|
24072
|
-
} else {
|
|
24073
|
-
curTimeData.list.splice(curTimeIndex, 1);
|
|
24074
|
-
}
|
|
24075
|
-
const resultTimeData = [...activeTime];
|
|
24076
|
-
resultTimeData.splice(curIndex, 1, curTimeData);
|
|
24077
|
-
setActiveTime(resultTimeData);
|
|
24078
|
-
if (onTimeChange) {
|
|
24079
|
-
onTimeChange(time, resultTimeData);
|
|
24080
|
-
} else if (timeChange) {
|
|
24081
|
-
timeChange(time, resultTimeData);
|
|
24082
|
-
}
|
|
24083
|
-
};
|
|
24084
|
-
const handleChange = (pannelKey) => {
|
|
24085
|
-
const resultTimeData = [...activeTime];
|
|
24086
|
-
if (String(pannelKey) !== String(activeKey)) {
|
|
24087
|
-
setActiveKey == null ? void 0 : setActiveKey(pannelKey);
|
|
24088
|
-
if (multiple) {
|
|
24089
|
-
const curTimeDataIndex = activeTime.findIndex(
|
|
24090
|
-
(item) => String(item.key) === String(pannelKey)
|
|
24091
|
-
);
|
|
24092
|
-
if (curTimeDataIndex === -1) {
|
|
24093
|
-
resultTimeData.push({
|
|
24094
|
-
key: pannelKey,
|
|
24095
|
-
list: []
|
|
24096
|
-
});
|
|
24097
|
-
setActiveTime(resultTimeData);
|
|
24155
|
+
onSelect && onSelect(activeTime);
|
|
24156
|
+
};
|
|
24157
|
+
const handleSelectTime = (selectTime) => {
|
|
24158
|
+
let newActiveTime = [...activeTime];
|
|
24159
|
+
const date4 = newActiveTime.find((item) => {
|
|
24160
|
+
return item[optionKey.valueKey] === activeDate;
|
|
24161
|
+
});
|
|
24162
|
+
if (date4) {
|
|
24163
|
+
const timeIndex = date4[optionKey.childrenKey].findIndex(
|
|
24164
|
+
(time) => {
|
|
24165
|
+
return time[optionKey.valueKey] === selectTime[optionKey.valueKey];
|
|
24098
24166
|
}
|
|
24167
|
+
);
|
|
24168
|
+
if (timeIndex > -1) {
|
|
24169
|
+
if (multiple) {
|
|
24170
|
+
date4[optionKey.childrenKey].splice(timeIndex, 1);
|
|
24171
|
+
} else {
|
|
24172
|
+
newActiveTime = [];
|
|
24173
|
+
}
|
|
24174
|
+
} else if (multiple) {
|
|
24175
|
+
date4[optionKey.childrenKey].push({ ...selectTime });
|
|
24099
24176
|
} else {
|
|
24100
|
-
|
|
24177
|
+
newActiveTime = [
|
|
24101
24178
|
{
|
|
24102
|
-
|
|
24103
|
-
|
|
24179
|
+
[optionKey.valueKey]: activeDate,
|
|
24180
|
+
[optionKey.childrenKey]: [{ ...selectTime }]
|
|
24104
24181
|
}
|
|
24105
|
-
]
|
|
24182
|
+
];
|
|
24106
24183
|
}
|
|
24184
|
+
} else if (multiple) {
|
|
24185
|
+
newActiveTime.push({
|
|
24186
|
+
[optionKey.valueKey]: activeDate,
|
|
24187
|
+
[optionKey.childrenKey]: [{ ...selectTime }]
|
|
24188
|
+
});
|
|
24189
|
+
} else {
|
|
24190
|
+
newActiveTime = [
|
|
24191
|
+
{
|
|
24192
|
+
[optionKey.valueKey]: activeDate,
|
|
24193
|
+
[optionKey.childrenKey]: [{ ...selectTime }]
|
|
24194
|
+
}
|
|
24195
|
+
];
|
|
24107
24196
|
}
|
|
24108
|
-
|
|
24109
|
-
|
|
24110
|
-
|
|
24111
|
-
|
|
24112
|
-
|
|
24197
|
+
newActiveTime = newActiveTime.filter((item) => {
|
|
24198
|
+
var _a2;
|
|
24199
|
+
return ((_a2 = item[optionKey.childrenKey]) == null ? void 0 : _a2.length) > 0;
|
|
24200
|
+
});
|
|
24201
|
+
setActiveTime(newActiveTime);
|
|
24202
|
+
onTimeChange && onTimeChange(selectTime, newActiveTime);
|
|
24113
24203
|
};
|
|
24114
|
-
const
|
|
24115
|
-
|
|
24116
|
-
|
|
24117
|
-
}
|
|
24118
|
-
return "";
|
|
24204
|
+
const handleChange = (date4) => {
|
|
24205
|
+
setActiveDate(date4[optionKey.valueKey]);
|
|
24206
|
+
onDateChange && onDateChange(date4, activeTime);
|
|
24119
24207
|
};
|
|
24120
|
-
|
|
24121
|
-
setPopVisible(visible);
|
|
24122
|
-
}, [visible]);
|
|
24123
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
24208
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
24124
24209
|
Popup,
|
|
24125
24210
|
{
|
|
24126
24211
|
closeable: true,
|
|
24127
24212
|
round: true,
|
|
24128
|
-
visible
|
|
24213
|
+
visible,
|
|
24129
24214
|
position: "bottom",
|
|
24130
|
-
style:
|
|
24131
|
-
|
|
24132
|
-
|
|
24133
|
-
|
|
24215
|
+
style: {
|
|
24216
|
+
width: "100%",
|
|
24217
|
+
height: "20%",
|
|
24218
|
+
...style
|
|
24219
|
+
},
|
|
24220
|
+
onClose: closeFun,
|
|
24221
|
+
...rest
|
|
24134
24222
|
},
|
|
24135
|
-
/* @__PURE__ */ React__default.createElement("div", { className:
|
|
24136
|
-
|
|
24223
|
+
/* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix2, className) }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__title` }, title || locale.timeselect.pickupTime), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__content` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__content-left` }, options2.map((item) => /* @__PURE__ */ React__default.createElement(
|
|
24224
|
+
"div",
|
|
24137
24225
|
{
|
|
24138
|
-
|
|
24139
|
-
className:
|
|
24140
|
-
|
|
24141
|
-
|
|
24142
|
-
|
|
24143
|
-
}
|
|
24226
|
+
key: item[optionKey.valueKey],
|
|
24227
|
+
className: classNames("nut-timepannel", {
|
|
24228
|
+
active: item[optionKey.valueKey] === activeDate
|
|
24229
|
+
}),
|
|
24230
|
+
onClick: () => handleChange(item)
|
|
24231
|
+
},
|
|
24232
|
+
item[optionKey.textKey]
|
|
24144
24233
|
))), /* @__PURE__ */ React__default.createElement(
|
|
24145
24234
|
TimeDetail,
|
|
24146
24235
|
{
|
|
24147
|
-
|
|
24148
|
-
|
|
24149
|
-
|
|
24150
|
-
|
|
24236
|
+
options: options2,
|
|
24237
|
+
optionKey,
|
|
24238
|
+
activeDate,
|
|
24239
|
+
activeTime,
|
|
24240
|
+
onSelect: handleSelectTime
|
|
24151
24241
|
}
|
|
24152
24242
|
)))
|
|
24153
|
-
)
|
|
24243
|
+
);
|
|
24154
24244
|
};
|
|
24155
24245
|
TimeSelect.defaultProps = defaultProps$2;
|
|
24156
24246
|
TimeSelect.displayName = "NutTimeSelect";
|
|
@@ -24388,7 +24478,7 @@ export {
|
|
|
24388
24478
|
Image$1 as Image,
|
|
24389
24479
|
ImagePreview,
|
|
24390
24480
|
Indicator,
|
|
24391
|
-
|
|
24481
|
+
InfiniteLoading,
|
|
24392
24482
|
Input,
|
|
24393
24483
|
InputNumber,
|
|
24394
24484
|
Layout,
|
|
@@ -24433,7 +24523,6 @@ export {
|
|
|
24433
24523
|
Tag,
|
|
24434
24524
|
TextArea,
|
|
24435
24525
|
TimeDetail,
|
|
24436
|
-
TimePannel,
|
|
24437
24526
|
TimeSelect,
|
|
24438
24527
|
Toast,
|
|
24439
24528
|
TrendArrow,
|