@nutui/nutui-react 2.0.0-alpha.14 → 2.0.0-alpha.16
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 +28 -0
- package/dist/esm/Card/style/style.css +1 -1
- package/dist/esm/Card.js +35 -22
- package/dist/esm/ConfigProvider.js +1 -1
- package/dist/esm/DatePicker.js +54 -58
- package/dist/esm/Dialog/style/index.js +1 -0
- package/dist/esm/Dialog/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/Menu/style/style.css +1 -1
- package/dist/esm/Menu.js +5 -3
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/MenuItem.js +31 -44
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/Picker.js +1 -1
- package/dist/esm/Popover.js +3 -40
- package/dist/esm/Popup.js +1 -1
- 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/Tag/style/style.css +1 -1
- package/dist/esm/Tag.js +26 -30
- 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/Toast.js +16 -7
- package/dist/esm/Uploader.js +1 -1
- package/dist/esm/index.js +2 -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/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/datepicker/datepicker.d.ts +11 -17
- package/dist/esm/types/src/packages/datepicker/datepicker.taro.d.ts +11 -17
- package/dist/esm/types/src/packages/datepicker/index.d.ts +1 -0
- package/dist/esm/types/src/packages/datepicker/index.taro.d.ts +1 -0
- 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/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 +2 -4
- 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 +2 -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/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/packages/toast/Notification.d.ts +4 -1
- package/dist/esm/use-click-away.js +43 -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 +765 -828
- package/dist/nutui.react.umd.js +765 -828
- package/dist/packages/card/card.scss +8 -14
- package/dist/packages/infiniteloading/infiniteloading.scss +2 -25
- package/dist/packages/menuitem/menuitem.scss +1 -1
- package/dist/packages/noticebar/noticebar.scss +0 -3
- package/dist/packages/signature/signature.scss +1 -18
- 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 +50 -97
- package/dist/styles/variables.scss +51 -98
- package/dist/types/index.d.ts +2 -3
- package/dist/types/locales/base.d.ts +1 -1
- 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/datepicker/datepicker.d.ts +79 -25
- package/dist/types/packages/datepicker/index.d.ts +1 -0
- package/dist/types/packages/infiniteloading/index.d.ts +3 -2
- package/dist/types/packages/infiniteloading/infiniteloading.d.ts +57 -18
- package/dist/types/packages/signature/index.d.ts +1 -0
- package/dist/types/packages/signature/signature.d.ts +38 -12
- 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/packages/toast/Notification.d.ts +4 -1
- 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/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/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/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.16 Fri Jun 09 2023 18:29:35 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: "",
|
|
@@ -11203,7 +11203,7 @@ const Popup = (props) => {
|
|
|
11203
11203
|
{
|
|
11204
11204
|
classNames: transitionName,
|
|
11205
11205
|
unmountOnExit: true,
|
|
11206
|
-
timeout:
|
|
11206
|
+
timeout: 300,
|
|
11207
11207
|
in: innerVisible,
|
|
11208
11208
|
onEntered: onHandleOpened,
|
|
11209
11209
|
onExited: onHandleClosed
|
|
@@ -11235,7 +11235,7 @@ 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();
|
|
@@ -11251,7 +11251,7 @@ const handleClick = (e) => {
|
|
|
11251
11251
|
}
|
|
11252
11252
|
};
|
|
11253
11253
|
const OffsetContext = createContext(20);
|
|
11254
|
-
const defaultProps$
|
|
11254
|
+
const defaultProps$1a = {
|
|
11255
11255
|
...ComponentDefaults,
|
|
11256
11256
|
position: "left",
|
|
11257
11257
|
width: "80%"
|
|
@@ -11268,7 +11268,7 @@ const SideNavBar = (props) => {
|
|
|
11268
11268
|
onClose,
|
|
11269
11269
|
...rest
|
|
11270
11270
|
} = {
|
|
11271
|
-
...defaultProps$
|
|
11271
|
+
...defaultProps$1a,
|
|
11272
11272
|
...props
|
|
11273
11273
|
};
|
|
11274
11274
|
const indent = props.indent ? Number(props.indent) : 20;
|
|
@@ -11300,7 +11300,7 @@ const SideNavBar = (props) => {
|
|
|
11300
11300
|
)))
|
|
11301
11301
|
);
|
|
11302
11302
|
};
|
|
11303
|
-
SideNavBar.defaultProps = defaultProps$
|
|
11303
|
+
SideNavBar.defaultProps = defaultProps$1a;
|
|
11304
11304
|
SideNavBar.displayName = "NutSideNavBar";
|
|
11305
11305
|
const SideNavBarItem = (props) => {
|
|
11306
11306
|
const classPrefix2 = "nut-subsidenavbar";
|
|
@@ -11319,13 +11319,13 @@ const SideNavBarItem = (props) => {
|
|
|
11319
11319
|
title
|
|
11320
11320
|
);
|
|
11321
11321
|
};
|
|
11322
|
-
const defaultProps$
|
|
11322
|
+
const defaultProps$19 = {
|
|
11323
11323
|
open: true
|
|
11324
11324
|
};
|
|
11325
11325
|
const SubSideNavBar = (props) => {
|
|
11326
11326
|
const classPrefix2 = "nut-subsidenavbar";
|
|
11327
11327
|
const { title, value, children, onClick, open, ...rest } = {
|
|
11328
|
-
...defaultProps$
|
|
11328
|
+
...defaultProps$19,
|
|
11329
11329
|
...props
|
|
11330
11330
|
};
|
|
11331
11331
|
const offset = useContext(OffsetContext);
|
|
@@ -11391,7 +11391,7 @@ function usePropsValue({
|
|
|
11391
11391
|
}
|
|
11392
11392
|
return [uncontrolled, handleUncontrolledChange];
|
|
11393
11393
|
}
|
|
11394
|
-
const defaultProps$
|
|
11394
|
+
const defaultProps$18 = {
|
|
11395
11395
|
...ComponentDefaults,
|
|
11396
11396
|
value: "",
|
|
11397
11397
|
dot: false,
|
|
@@ -11402,7 +11402,7 @@ const defaultProps$19 = {
|
|
|
11402
11402
|
};
|
|
11403
11403
|
const Badge = (props) => {
|
|
11404
11404
|
const { className, style, value, max, children, dot, top, right, color } = {
|
|
11405
|
-
...defaultProps$
|
|
11405
|
+
...defaultProps$18,
|
|
11406
11406
|
...props
|
|
11407
11407
|
};
|
|
11408
11408
|
const classPrefix2 = "nut-badge";
|
|
@@ -11429,9 +11429,9 @@ const Badge = (props) => {
|
|
|
11429
11429
|
};
|
|
11430
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()));
|
|
11431
11431
|
};
|
|
11432
|
-
Badge.defaultProps = defaultProps$
|
|
11432
|
+
Badge.defaultProps = defaultProps$18;
|
|
11433
11433
|
Badge.displayName = "NutBadge";
|
|
11434
|
-
const defaultProps$
|
|
11434
|
+
const defaultProps$17 = {
|
|
11435
11435
|
...ComponentDefaults,
|
|
11436
11436
|
title: "",
|
|
11437
11437
|
icon: null,
|
|
@@ -11453,7 +11453,7 @@ const TabbarItem = (props) => {
|
|
|
11453
11453
|
handleClick: handleClick2,
|
|
11454
11454
|
...rest
|
|
11455
11455
|
} = {
|
|
11456
|
-
...defaultProps$
|
|
11456
|
+
...defaultProps$17,
|
|
11457
11457
|
...props
|
|
11458
11458
|
};
|
|
11459
11459
|
const classPrefix2 = "nut-tabbar-item";
|
|
@@ -11477,7 +11477,7 @@ const TabbarItem = (props) => {
|
|
|
11477
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))
|
|
11478
11478
|
);
|
|
11479
11479
|
};
|
|
11480
|
-
const defaultProps$
|
|
11480
|
+
const defaultProps$16 = {
|
|
11481
11481
|
...ComponentDefaults,
|
|
11482
11482
|
defaultValue: 0,
|
|
11483
11483
|
fixed: false,
|
|
@@ -11500,7 +11500,7 @@ const Tabbar = (props) => {
|
|
|
11500
11500
|
style,
|
|
11501
11501
|
onSwitch
|
|
11502
11502
|
} = {
|
|
11503
|
-
...defaultProps$
|
|
11503
|
+
...defaultProps$16,
|
|
11504
11504
|
...props
|
|
11505
11505
|
};
|
|
11506
11506
|
const classPrefix2 = "nut-tabbar";
|
|
@@ -11535,17 +11535,17 @@ const Tabbar = (props) => {
|
|
|
11535
11535
|
(fixed || safeArea) && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__safe-area` })
|
|
11536
11536
|
);
|
|
11537
11537
|
};
|
|
11538
|
-
Tabbar.defaultProps = defaultProps$
|
|
11538
|
+
Tabbar.defaultProps = defaultProps$16;
|
|
11539
11539
|
Tabbar.displayName = "NutTabbar";
|
|
11540
11540
|
Tabbar.Item = TabbarItem;
|
|
11541
|
-
const defaultProps$
|
|
11541
|
+
const defaultProps$15 = {
|
|
11542
11542
|
title: "",
|
|
11543
11543
|
value: "",
|
|
11544
11544
|
disabled: false
|
|
11545
11545
|
};
|
|
11546
11546
|
const TabPane = (props) => {
|
|
11547
11547
|
const { children, autoHeightClassName, className, disabled } = {
|
|
11548
|
-
...defaultProps$
|
|
11548
|
+
...defaultProps$15,
|
|
11549
11549
|
...props
|
|
11550
11550
|
};
|
|
11551
11551
|
const classPrefix2 = "nut-tabpane";
|
|
@@ -11576,7 +11576,7 @@ function useForceUpdate() {
|
|
|
11576
11576
|
const [, updateState] = React__default.useState();
|
|
11577
11577
|
return React__default.useCallback(() => updateState({}), []);
|
|
11578
11578
|
}
|
|
11579
|
-
const defaultProps$
|
|
11579
|
+
const defaultProps$14 = {
|
|
11580
11580
|
...ComponentDefaults,
|
|
11581
11581
|
tabStyle: {},
|
|
11582
11582
|
activeColor: "",
|
|
@@ -11585,7 +11585,7 @@ const defaultProps$15 = {
|
|
|
11585
11585
|
duration: 300,
|
|
11586
11586
|
autoHeight: false
|
|
11587
11587
|
};
|
|
11588
|
-
const classPrefix$
|
|
11588
|
+
const classPrefix$h = "nut-tabs";
|
|
11589
11589
|
const Tabs = (props) => {
|
|
11590
11590
|
const {
|
|
11591
11591
|
activeColor,
|
|
@@ -11602,7 +11602,7 @@ const Tabs = (props) => {
|
|
|
11602
11602
|
autoHeight,
|
|
11603
11603
|
...rest
|
|
11604
11604
|
} = {
|
|
11605
|
-
...defaultProps$
|
|
11605
|
+
...defaultProps$14,
|
|
11606
11606
|
...props
|
|
11607
11607
|
};
|
|
11608
11608
|
const [value, setValue] = usePropsValue({
|
|
@@ -11679,14 +11679,14 @@ const Tabs = (props) => {
|
|
|
11679
11679
|
}
|
|
11680
11680
|
}, [children]);
|
|
11681
11681
|
const classes = classNames(
|
|
11682
|
-
classPrefix$
|
|
11683
|
-
`${classPrefix$
|
|
11682
|
+
classPrefix$h,
|
|
11683
|
+
`${classPrefix$h}--${direction}`,
|
|
11684
11684
|
className
|
|
11685
11685
|
);
|
|
11686
|
-
const classesTitle = classNames(`${classPrefix$
|
|
11687
|
-
[`${classPrefix$
|
|
11688
|
-
[`${classPrefix$
|
|
11689
|
-
[`${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
|
|
11690
11690
|
});
|
|
11691
11691
|
const tabsActiveStyle = {
|
|
11692
11692
|
color: activeType === "smile" ? activeColor : "",
|
|
@@ -11716,7 +11716,7 @@ const Tabs = (props) => {
|
|
|
11716
11716
|
onClick: () => {
|
|
11717
11717
|
tabChange(item);
|
|
11718
11718
|
},
|
|
11719
|
-
className: classNames(`${classPrefix$
|
|
11719
|
+
className: classNames(`${classPrefix$h}__titles-item`, {
|
|
11720
11720
|
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
11721
11721
|
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
11722
11722
|
[`nut-tabs__titles-item--${align}`]: align
|
|
@@ -11727,14 +11727,14 @@ const Tabs = (props) => {
|
|
|
11727
11727
|
activeType === "line" && /* @__PURE__ */ React__default.createElement(
|
|
11728
11728
|
"div",
|
|
11729
11729
|
{
|
|
11730
|
-
className: `${classPrefix$
|
|
11730
|
+
className: `${classPrefix$h}__titles-item__line`,
|
|
11731
11731
|
style: tabsActiveStyle
|
|
11732
11732
|
}
|
|
11733
11733
|
),
|
|
11734
11734
|
activeType === "smile" && /* @__PURE__ */ React__default.createElement(
|
|
11735
11735
|
"div",
|
|
11736
11736
|
{
|
|
11737
|
-
className: `${classPrefix$
|
|
11737
|
+
className: `${classPrefix$h}__titles-item__smile`,
|
|
11738
11738
|
style: tabsActiveStyle
|
|
11739
11739
|
},
|
|
11740
11740
|
/* @__PURE__ */ React__default.createElement(x$7, { color: activeColor, width: 40, height: 20 })
|
|
@@ -11746,13 +11746,13 @@ const Tabs = (props) => {
|
|
|
11746
11746
|
{
|
|
11747
11747
|
ellipsis: true
|
|
11748
11748
|
},
|
|
11749
|
-
`${classPrefix$
|
|
11749
|
+
`${classPrefix$h}__titles-item__text`
|
|
11750
11750
|
)
|
|
11751
11751
|
},
|
|
11752
11752
|
item.title
|
|
11753
11753
|
)
|
|
11754
11754
|
);
|
|
11755
|
-
})), /* @__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) => {
|
|
11756
11756
|
if (!React__default.isValidElement(child)) {
|
|
11757
11757
|
return null;
|
|
11758
11758
|
}
|
|
@@ -11769,7 +11769,7 @@ const Tabs = (props) => {
|
|
|
11769
11769
|
return React__default.cloneElement(child, childProps);
|
|
11770
11770
|
}))));
|
|
11771
11771
|
};
|
|
11772
|
-
Tabs.defaultProps = defaultProps$
|
|
11772
|
+
Tabs.defaultProps = defaultProps$14;
|
|
11773
11773
|
Tabs.displayName = "NutTabs";
|
|
11774
11774
|
Tabs.TabPane = TabPane;
|
|
11775
11775
|
var classnameExports = {};
|
|
@@ -11892,7 +11892,7 @@ function requireClassname_development() {
|
|
|
11892
11892
|
}
|
|
11893
11893
|
})(classname);
|
|
11894
11894
|
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
11895
|
-
const defaultProps$
|
|
11895
|
+
const defaultProps$13 = {
|
|
11896
11896
|
type: "custom",
|
|
11897
11897
|
existAddress: [],
|
|
11898
11898
|
defaultIcon: null,
|
|
@@ -11914,7 +11914,7 @@ const ExistRender = (props) => {
|
|
|
11914
11914
|
onClose,
|
|
11915
11915
|
onSwitchModule,
|
|
11916
11916
|
...rest
|
|
11917
|
-
} = { ...defaultProps$
|
|
11917
|
+
} = { ...defaultProps$13, ...props };
|
|
11918
11918
|
const b = cn("address");
|
|
11919
11919
|
const selectedExist = (item) => {
|
|
11920
11920
|
const copyExistAdd = existAddress;
|
|
@@ -11944,7 +11944,7 @@ const ExistRender = (props) => {
|
|
|
11944
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)))));
|
|
11945
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)));
|
|
11946
11946
|
};
|
|
11947
|
-
const defaultProps$
|
|
11947
|
+
const defaultProps$12 = {
|
|
11948
11948
|
modelValue: [],
|
|
11949
11949
|
type: "custom",
|
|
11950
11950
|
province: [],
|
|
@@ -11969,7 +11969,7 @@ const CustomRender = (props) => {
|
|
|
11969
11969
|
onClose,
|
|
11970
11970
|
...rest
|
|
11971
11971
|
} = {
|
|
11972
|
-
...defaultProps$
|
|
11972
|
+
...defaultProps$12,
|
|
11973
11973
|
...props
|
|
11974
11974
|
};
|
|
11975
11975
|
const b = cn("address");
|
|
@@ -12138,28 +12138,28 @@ const CustomRender = (props) => {
|
|
|
12138
12138
|
nextAreaList(item);
|
|
12139
12139
|
};
|
|
12140
12140
|
useEffect(() => {
|
|
12141
|
-
const { province: province2 } = { ...defaultProps$
|
|
12141
|
+
const { province: province2 } = { ...defaultProps$12, ...props };
|
|
12142
12142
|
setRegionList({
|
|
12143
12143
|
...regionList,
|
|
12144
12144
|
province: isCustom2() ? transformData(province2) : province2
|
|
12145
12145
|
});
|
|
12146
12146
|
}, [province]);
|
|
12147
12147
|
useEffect(() => {
|
|
12148
|
-
const { city: city2 } = { ...defaultProps$
|
|
12148
|
+
const { city: city2 } = { ...defaultProps$12, ...props };
|
|
12149
12149
|
setRegionList({
|
|
12150
12150
|
...regionList,
|
|
12151
12151
|
city: isCustom2() ? transformData(city2) : city2
|
|
12152
12152
|
});
|
|
12153
12153
|
}, [city]);
|
|
12154
12154
|
useEffect(() => {
|
|
12155
|
-
const { country: country2 } = { ...defaultProps$
|
|
12155
|
+
const { country: country2 } = { ...defaultProps$12, ...props };
|
|
12156
12156
|
setRegionList({
|
|
12157
12157
|
...regionList,
|
|
12158
12158
|
country: isCustom2() ? transformData(country2) : country2
|
|
12159
12159
|
});
|
|
12160
12160
|
}, [country]);
|
|
12161
12161
|
useEffect(() => {
|
|
12162
|
-
const { town: town2 } = { ...defaultProps$
|
|
12162
|
+
const { town: town2 } = { ...defaultProps$12, ...props };
|
|
12163
12163
|
setRegionList({
|
|
12164
12164
|
...regionList,
|
|
12165
12165
|
town: isCustom2() ? transformData(town2) : town2
|
|
@@ -12225,7 +12225,7 @@ const CustomRender = (props) => {
|
|
|
12225
12225
|
}
|
|
12226
12226
|
)));
|
|
12227
12227
|
};
|
|
12228
|
-
const defaultProps$
|
|
12228
|
+
const defaultProps$11 = {
|
|
12229
12229
|
...ComponentDefaults,
|
|
12230
12230
|
modelValue: false,
|
|
12231
12231
|
modelSelect: [],
|
|
@@ -12276,7 +12276,7 @@ const Address = (props) => {
|
|
|
12276
12276
|
className,
|
|
12277
12277
|
...rest
|
|
12278
12278
|
} = {
|
|
12279
|
-
...defaultProps$
|
|
12279
|
+
...defaultProps$11,
|
|
12280
12280
|
...props
|
|
12281
12281
|
};
|
|
12282
12282
|
const b = cn("address");
|
|
@@ -12428,7 +12428,7 @@ const Address = (props) => {
|
|
|
12428
12428
|
)
|
|
12429
12429
|
));
|
|
12430
12430
|
};
|
|
12431
|
-
Address.defaultProps = defaultProps$
|
|
12431
|
+
Address.defaultProps = defaultProps$11;
|
|
12432
12432
|
Address.displayName = "NutAddress";
|
|
12433
12433
|
const Utils = {
|
|
12434
12434
|
/**
|
|
@@ -12548,7 +12548,7 @@ const Utils = {
|
|
|
12548
12548
|
return false;
|
|
12549
12549
|
}
|
|
12550
12550
|
};
|
|
12551
|
-
const defaultProps$
|
|
12551
|
+
const defaultProps$10 = {
|
|
12552
12552
|
type: "one",
|
|
12553
12553
|
isAutoBackFill: false,
|
|
12554
12554
|
poppable: true,
|
|
@@ -12600,7 +12600,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
12600
12600
|
onUpdate,
|
|
12601
12601
|
onSelected,
|
|
12602
12602
|
onYearMonthChange
|
|
12603
|
-
} = { ...defaultProps$
|
|
12603
|
+
} = { ...defaultProps$10, ...props };
|
|
12604
12604
|
const weeks = locale.calendaritem.weekdays;
|
|
12605
12605
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
12606
12606
|
const [monthsData, setMonthsData] = useState([]);
|
|
@@ -13182,9 +13182,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
13182
13182
|
))
|
|
13183
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)) : ""));
|
|
13184
13184
|
});
|
|
13185
|
-
CalendarItem.defaultProps = defaultProps$
|
|
13185
|
+
CalendarItem.defaultProps = defaultProps$10;
|
|
13186
13186
|
CalendarItem.displayName = "NutCalendarItem";
|
|
13187
|
-
const defaultProps
|
|
13187
|
+
const defaultProps$$ = {
|
|
13188
13188
|
type: "one",
|
|
13189
13189
|
isAutoBackFill: false,
|
|
13190
13190
|
poppable: true,
|
|
@@ -13239,7 +13239,7 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
13239
13239
|
onChoose,
|
|
13240
13240
|
onSelected,
|
|
13241
13241
|
onYearMonthChange
|
|
13242
|
-
} = { ...defaultProps
|
|
13242
|
+
} = { ...defaultProps$$, ...props };
|
|
13243
13243
|
const calendarRef = useRef(null);
|
|
13244
13244
|
const close = () => {
|
|
13245
13245
|
onClose && onClose();
|
|
@@ -13309,9 +13309,9 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
13309
13309
|
renderItem()
|
|
13310
13310
|
) : renderItem());
|
|
13311
13311
|
});
|
|
13312
|
-
Calendar.defaultProps = defaultProps
|
|
13312
|
+
Calendar.defaultProps = defaultProps$$;
|
|
13313
13313
|
Calendar.displayName = "NutCalendar";
|
|
13314
|
-
const defaultProps
|
|
13314
|
+
const defaultProps$_ = {
|
|
13315
13315
|
data: {
|
|
13316
13316
|
text: "",
|
|
13317
13317
|
value: "",
|
|
@@ -13328,7 +13328,7 @@ const defaultProps$$ = {
|
|
|
13328
13328
|
};
|
|
13329
13329
|
const InternalCascaderItem = (props, ref) => {
|
|
13330
13330
|
const { data, checked, activeIcon, chooseItem, activeColor } = {
|
|
13331
|
-
...defaultProps
|
|
13331
|
+
...defaultProps$_,
|
|
13332
13332
|
...props
|
|
13333
13333
|
};
|
|
13334
13334
|
const classPrefix2 = "nut-cascader-item";
|
|
@@ -13370,7 +13370,7 @@ const InternalCascaderItem = (props, ref) => {
|
|
|
13370
13370
|
);
|
|
13371
13371
|
};
|
|
13372
13372
|
const CascaderItem = React__default.forwardRef(InternalCascaderItem);
|
|
13373
|
-
CascaderItem.defaultProps = defaultProps
|
|
13373
|
+
CascaderItem.defaultProps = defaultProps$_;
|
|
13374
13374
|
CascaderItem.displayName = "NutCascaderItem";
|
|
13375
13375
|
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
13376
13376
|
const {
|
|
@@ -13508,7 +13508,7 @@ class Tree {
|
|
|
13508
13508
|
}
|
|
13509
13509
|
}
|
|
13510
13510
|
const Tree$1 = Tree;
|
|
13511
|
-
const defaultProps$
|
|
13511
|
+
const defaultProps$Z = {
|
|
13512
13512
|
...ComponentDefaults,
|
|
13513
13513
|
activeColor: "",
|
|
13514
13514
|
activeIcon: "checklist",
|
|
@@ -13551,7 +13551,7 @@ const InternalCascader = (props, ref) => {
|
|
|
13551
13551
|
onClose,
|
|
13552
13552
|
onChange,
|
|
13553
13553
|
onPathChange
|
|
13554
|
-
} = { ...defaultProps$
|
|
13554
|
+
} = { ...defaultProps$Z, ...props };
|
|
13555
13555
|
const [tabvalue, setTabvalue] = useState("c1");
|
|
13556
13556
|
const [optionsData, setOptionsData] = useState([]);
|
|
13557
13557
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
|
|
@@ -13813,11 +13813,11 @@ const InternalCascader = (props, ref) => {
|
|
|
13813
13813
|
) : renderItem());
|
|
13814
13814
|
};
|
|
13815
13815
|
const Cascader = React__default.forwardRef(InternalCascader);
|
|
13816
|
-
Cascader.defaultProps = defaultProps$
|
|
13816
|
+
Cascader.defaultProps = defaultProps$Z;
|
|
13817
13817
|
Cascader.displayName = "NutCascader";
|
|
13818
13818
|
const CheckboxGroupContext = createContext(null);
|
|
13819
13819
|
const Context = CheckboxGroupContext;
|
|
13820
|
-
const defaultProps$
|
|
13820
|
+
const defaultProps$Y = {
|
|
13821
13821
|
max: void 0,
|
|
13822
13822
|
labelPosition: "right",
|
|
13823
13823
|
direction: "vertical",
|
|
@@ -13825,10 +13825,10 @@ const defaultProps$Z = {
|
|
|
13825
13825
|
},
|
|
13826
13826
|
options: []
|
|
13827
13827
|
};
|
|
13828
|
-
const classPrefix$
|
|
13828
|
+
const classPrefix$g = "nut-checkboxgroup";
|
|
13829
13829
|
const CheckboxGroup = React__default.forwardRef(
|
|
13830
13830
|
(props, ref) => {
|
|
13831
|
-
const { children } = { ...defaultProps$
|
|
13831
|
+
const { children } = { ...defaultProps$Y, ...props };
|
|
13832
13832
|
const {
|
|
13833
13833
|
className,
|
|
13834
13834
|
disabled,
|
|
@@ -13907,7 +13907,7 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
13907
13907
|
/* @__PURE__ */ React__default.createElement(
|
|
13908
13908
|
"div",
|
|
13909
13909
|
{
|
|
13910
|
-
className: classNames(classPrefix$
|
|
13910
|
+
className: classNames(classPrefix$g, className, {
|
|
13911
13911
|
[`nut-checkboxgroup--${props.direction}`]: props.direction
|
|
13912
13912
|
}),
|
|
13913
13913
|
...rest
|
|
@@ -13917,9 +13917,9 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
13917
13917
|
);
|
|
13918
13918
|
}
|
|
13919
13919
|
);
|
|
13920
|
-
CheckboxGroup.defaultProps = defaultProps$
|
|
13920
|
+
CheckboxGroup.defaultProps = defaultProps$Y;
|
|
13921
13921
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
13922
|
-
const defaultProps$
|
|
13922
|
+
const defaultProps$X = {
|
|
13923
13923
|
...ComponentDefaults,
|
|
13924
13924
|
disabled: false,
|
|
13925
13925
|
labelPosition: "right",
|
|
@@ -13929,10 +13929,10 @@ const defaultProps$Y = {
|
|
|
13929
13929
|
onChange: (value) => {
|
|
13930
13930
|
}
|
|
13931
13931
|
};
|
|
13932
|
-
const classPrefix$
|
|
13932
|
+
const classPrefix$f = "nut-checkbox";
|
|
13933
13933
|
const Checkbox = (props) => {
|
|
13934
13934
|
const { children } = {
|
|
13935
|
-
...defaultProps$
|
|
13935
|
+
...defaultProps$X,
|
|
13936
13936
|
...props
|
|
13937
13937
|
};
|
|
13938
13938
|
const {
|
|
@@ -13991,22 +13991,22 @@ const Checkbox = (props) => {
|
|
|
13991
13991
|
};
|
|
13992
13992
|
const color = () => {
|
|
13993
13993
|
if (innerDisabled) {
|
|
13994
|
-
return `${classPrefix$
|
|
13994
|
+
return `${classPrefix$f}__icon--disable`;
|
|
13995
13995
|
}
|
|
13996
13996
|
if (innerChecked) {
|
|
13997
13997
|
if (innerIndeterminate) {
|
|
13998
|
-
return `${classPrefix$
|
|
13998
|
+
return `${classPrefix$f}__icon--indeterminate`;
|
|
13999
13999
|
}
|
|
14000
|
-
return `${classPrefix$
|
|
14000
|
+
return `${classPrefix$f}__icon`;
|
|
14001
14001
|
}
|
|
14002
|
-
return `${classPrefix$
|
|
14002
|
+
return `${classPrefix$f}__icon--unchecked`;
|
|
14003
14003
|
};
|
|
14004
14004
|
const renderLabel = () => {
|
|
14005
14005
|
return /* @__PURE__ */ React__default.createElement(
|
|
14006
14006
|
"span",
|
|
14007
14007
|
{
|
|
14008
|
-
className: classNames(`${classPrefix$
|
|
14009
|
-
[`${classPrefix$
|
|
14008
|
+
className: classNames(`${classPrefix$f}__label `, {
|
|
14009
|
+
[`${classPrefix$f}__label--disabled`]: innerDisabled
|
|
14010
14010
|
})
|
|
14011
14011
|
},
|
|
14012
14012
|
children || label
|
|
@@ -14025,8 +14025,8 @@ const Checkbox = (props) => {
|
|
|
14025
14025
|
return /* @__PURE__ */ React__default.createElement(
|
|
14026
14026
|
"div",
|
|
14027
14027
|
{
|
|
14028
|
-
className: classNames(classPrefix$
|
|
14029
|
-
[`${classPrefix$
|
|
14028
|
+
className: classNames(classPrefix$f, className, {
|
|
14029
|
+
[`${classPrefix$f}--reverse`]: labelPosition === "left"
|
|
14030
14030
|
}),
|
|
14031
14031
|
...rest,
|
|
14032
14032
|
onClick: handleClick2
|
|
@@ -14035,7 +14035,7 @@ const Checkbox = (props) => {
|
|
|
14035
14035
|
renderLabel()
|
|
14036
14036
|
);
|
|
14037
14037
|
};
|
|
14038
|
-
Checkbox.defaultProps = defaultProps$
|
|
14038
|
+
Checkbox.defaultProps = defaultProps$X;
|
|
14039
14039
|
Checkbox.displayName = "NutCheckBox";
|
|
14040
14040
|
Checkbox.Group = CheckboxGroup;
|
|
14041
14041
|
const MIN_DISTANCE = 10;
|
|
@@ -14329,7 +14329,7 @@ function useRefs() {
|
|
|
14329
14329
|
}, []);
|
|
14330
14330
|
return [refs.current, setRefs, reset];
|
|
14331
14331
|
}
|
|
14332
|
-
const defaultProps$
|
|
14332
|
+
const defaultProps$W = {
|
|
14333
14333
|
...ComponentDefaults,
|
|
14334
14334
|
visible: false,
|
|
14335
14335
|
title: "",
|
|
@@ -14356,7 +14356,7 @@ const InternalPicker = (props, ref) => {
|
|
|
14356
14356
|
afterClose,
|
|
14357
14357
|
onChange,
|
|
14358
14358
|
...rest
|
|
14359
|
-
} = { ...defaultProps$
|
|
14359
|
+
} = { ...defaultProps$W, ...props };
|
|
14360
14360
|
const classPrefix2 = "nut-picker";
|
|
14361
14361
|
const classes = classNames(classPrefix2, className);
|
|
14362
14362
|
const [selectedValue, setSelectedValue] = usePropsValue({
|
|
@@ -14531,7 +14531,7 @@ const InternalPicker = (props, ref) => {
|
|
|
14531
14531
|
{
|
|
14532
14532
|
visible,
|
|
14533
14533
|
position: "bottom",
|
|
14534
|
-
|
|
14534
|
+
afterClose: () => {
|
|
14535
14535
|
closePicker();
|
|
14536
14536
|
}
|
|
14537
14537
|
},
|
|
@@ -14555,30 +14555,30 @@ const InternalPicker = (props, ref) => {
|
|
|
14555
14555
|
const Picker = React__default.forwardRef(InternalPicker);
|
|
14556
14556
|
const Picker$1 = Picker;
|
|
14557
14557
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
14558
|
-
const defaultProps$
|
|
14559
|
-
|
|
14558
|
+
const defaultProps$V = {
|
|
14559
|
+
...ComponentDefaults,
|
|
14560
14560
|
visible: false,
|
|
14561
14561
|
title: "",
|
|
14562
14562
|
type: "date",
|
|
14563
|
-
|
|
14563
|
+
showChinese: false,
|
|
14564
14564
|
threeDimensional: true,
|
|
14565
14565
|
minuteStep: 1,
|
|
14566
|
-
|
|
14567
|
-
|
|
14566
|
+
startDate: new Date(currentYear - 10, 0, 1),
|
|
14567
|
+
endDate: new Date(currentYear + 10, 11, 31)
|
|
14568
14568
|
};
|
|
14569
14569
|
const DatePicker = (props) => {
|
|
14570
14570
|
const {
|
|
14571
|
-
|
|
14572
|
-
|
|
14571
|
+
startDate,
|
|
14572
|
+
endDate,
|
|
14573
14573
|
type: type4,
|
|
14574
|
-
|
|
14574
|
+
showChinese,
|
|
14575
14575
|
minuteStep,
|
|
14576
|
-
modelValue,
|
|
14577
14576
|
visible,
|
|
14578
14577
|
title,
|
|
14578
|
+
defaultValue,
|
|
14579
14579
|
formatter,
|
|
14580
|
-
|
|
14581
|
-
|
|
14580
|
+
onClose,
|
|
14581
|
+
onConfirm,
|
|
14582
14582
|
filter,
|
|
14583
14583
|
onChange,
|
|
14584
14584
|
threeDimensional,
|
|
@@ -14586,18 +14586,10 @@ const DatePicker = (props) => {
|
|
|
14586
14586
|
style,
|
|
14587
14587
|
...rest
|
|
14588
14588
|
} = {
|
|
14589
|
-
...defaultProps$
|
|
14589
|
+
...defaultProps$V,
|
|
14590
14590
|
...props
|
|
14591
14591
|
};
|
|
14592
14592
|
const { locale } = useConfig();
|
|
14593
|
-
const [show2, setShow] = useState(false);
|
|
14594
|
-
const [currentDate, setCurrentDate] = useState(modelValue);
|
|
14595
|
-
const [defaultValue, setDefaultValue] = useState([]);
|
|
14596
|
-
const [options2, setListData] = useState([]);
|
|
14597
|
-
const pickerRef = useRef(null);
|
|
14598
|
-
const isDate = (val) => {
|
|
14599
|
-
return Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
|
14600
|
-
};
|
|
14601
14593
|
const datepickerLang = locale.datepicker;
|
|
14602
14594
|
const zhCNType = {
|
|
14603
14595
|
day: datepickerLang.day,
|
|
@@ -14607,20 +14599,32 @@ const DatePicker = (props) => {
|
|
|
14607
14599
|
minute: datepickerLang.min,
|
|
14608
14600
|
seconds: datepickerLang.seconds
|
|
14609
14601
|
};
|
|
14602
|
+
const [defaultValueOfPicker, setDefaultValueOfPicker] = useState([]);
|
|
14603
|
+
const [options2, setOptions] = useState([]);
|
|
14604
|
+
const isDate = (val) => {
|
|
14605
|
+
return Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
|
14606
|
+
};
|
|
14610
14607
|
const formatValue = (value) => {
|
|
14611
14608
|
let cvalue = value;
|
|
14612
14609
|
if (!cvalue || cvalue && !isDate(cvalue)) {
|
|
14613
|
-
cvalue =
|
|
14610
|
+
cvalue = startDate;
|
|
14614
14611
|
}
|
|
14615
|
-
let timestmp = Math.max(cvalue.getTime(),
|
|
14616
|
-
timestmp = Math.min(timestmp,
|
|
14612
|
+
let timestmp = Math.max(cvalue.getTime(), startDate.getTime());
|
|
14613
|
+
timestmp = Math.min(timestmp, endDate.getTime());
|
|
14617
14614
|
return new Date(timestmp);
|
|
14618
14615
|
};
|
|
14616
|
+
const [currentDate, setCurrentDate] = usePropsValue({
|
|
14617
|
+
value: props.value && formatValue(props.value),
|
|
14618
|
+
defaultValue: formatValue(props.defaultValue || null),
|
|
14619
|
+
finalValue: null,
|
|
14620
|
+
onChange: (val) => {
|
|
14621
|
+
}
|
|
14622
|
+
});
|
|
14619
14623
|
function getMonthEndDay(year, month) {
|
|
14620
14624
|
return new Date(year, month, 0).getDate();
|
|
14621
14625
|
}
|
|
14622
14626
|
const getBoundary = (type22, value) => {
|
|
14623
|
-
const boundary = type22 === "min" ?
|
|
14627
|
+
const boundary = type22 === "min" ? startDate : endDate;
|
|
14624
14628
|
const year = boundary.getFullYear();
|
|
14625
14629
|
let month = 1;
|
|
14626
14630
|
let date4 = 1;
|
|
@@ -14654,12 +14658,12 @@ const DatePicker = (props) => {
|
|
|
14654
14658
|
[`${type22}Seconds`]: seconds
|
|
14655
14659
|
};
|
|
14656
14660
|
};
|
|
14657
|
-
const ranges = (
|
|
14658
|
-
const curDate =
|
|
14661
|
+
const ranges = () => {
|
|
14662
|
+
const curDate = currentDate;
|
|
14659
14663
|
if (!curDate)
|
|
14660
14664
|
return [];
|
|
14661
|
-
const { maxYear, maxDate
|
|
14662
|
-
const { minYear, minDate
|
|
14665
|
+
const { maxYear, maxDate, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", curDate);
|
|
14666
|
+
const { minYear, minDate, minMonth, minHour, minMinute, minSeconds } = getBoundary("min", curDate);
|
|
14663
14667
|
let result = [
|
|
14664
14668
|
{
|
|
14665
14669
|
type: "year",
|
|
@@ -14671,7 +14675,7 @@ const DatePicker = (props) => {
|
|
|
14671
14675
|
},
|
|
14672
14676
|
{
|
|
14673
14677
|
type: "day",
|
|
14674
|
-
range: [
|
|
14678
|
+
range: [minDate, maxDate]
|
|
14675
14679
|
},
|
|
14676
14680
|
{
|
|
14677
14681
|
type: "hour",
|
|
@@ -14711,7 +14715,7 @@ const DatePicker = (props) => {
|
|
|
14711
14715
|
}
|
|
14712
14716
|
return result;
|
|
14713
14717
|
};
|
|
14714
|
-
const updateChooseValueCustmer = (
|
|
14718
|
+
const updateChooseValueCustmer = (selectedOptions, selectedValue, index) => {
|
|
14715
14719
|
if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
|
|
14716
14720
|
type4.toLocaleLowerCase()
|
|
14717
14721
|
)) {
|
|
@@ -14721,11 +14725,13 @@ const DatePicker = (props) => {
|
|
|
14721
14725
|
});
|
|
14722
14726
|
if (type4.toLocaleLowerCase() === "month-day" && formatDate.length < 3) {
|
|
14723
14727
|
formatDate.unshift(
|
|
14724
|
-
new Date(
|
|
14728
|
+
new Date(defaultValue || startDate || endDate).getFullYear()
|
|
14725
14729
|
);
|
|
14726
14730
|
}
|
|
14727
14731
|
if (type4.toLocaleLowerCase() === "year-month" && formatDate.length < 3) {
|
|
14728
|
-
formatDate.push(
|
|
14732
|
+
formatDate.push(
|
|
14733
|
+
new Date(defaultValue || startDate || endDate).getDate()
|
|
14734
|
+
);
|
|
14729
14735
|
}
|
|
14730
14736
|
const year = Number(formatDate[0]);
|
|
14731
14737
|
const month = Number(formatDate[1]) - 1;
|
|
@@ -14750,7 +14756,7 @@ const DatePicker = (props) => {
|
|
|
14750
14756
|
const isEqual2 = (currentDate == null ? void 0 : currentDate.getTime()) === (date4 == null ? void 0 : date4.getTime());
|
|
14751
14757
|
date4 && isDate(date4) && !isEqual2 && setCurrentDate(formatValue(date4));
|
|
14752
14758
|
}
|
|
14753
|
-
props.onChange && props.onChange(
|
|
14759
|
+
props.onChange && props.onChange(selectedOptions, selectedValue, index);
|
|
14754
14760
|
};
|
|
14755
14761
|
const padZero = (num, targetLength = 2) => {
|
|
14756
14762
|
let str = `${num}`;
|
|
@@ -14768,12 +14774,13 @@ const DatePicker = (props) => {
|
|
|
14768
14774
|
});
|
|
14769
14775
|
} else {
|
|
14770
14776
|
const padMin = padZero(value, 2);
|
|
14771
|
-
const fatter =
|
|
14777
|
+
const fatter = showChinese ? zhCNType[type22] : "";
|
|
14772
14778
|
fOption = { text: padMin + fatter, value: padMin };
|
|
14773
14779
|
}
|
|
14774
14780
|
return fOption;
|
|
14775
14781
|
};
|
|
14776
14782
|
const generateValue = (min, max, val, type22, columnIndex) => {
|
|
14783
|
+
var _a2;
|
|
14777
14784
|
let cmin = min;
|
|
14778
14785
|
const arr = [];
|
|
14779
14786
|
let index = 0;
|
|
@@ -14788,8 +14795,8 @@ const DatePicker = (props) => {
|
|
|
14788
14795
|
index++;
|
|
14789
14796
|
}
|
|
14790
14797
|
}
|
|
14791
|
-
|
|
14792
|
-
|
|
14798
|
+
defaultValueOfPicker[columnIndex] = (_a2 = arr[index]) == null ? void 0 : _a2.value;
|
|
14799
|
+
setDefaultValueOfPicker([...defaultValueOfPicker]);
|
|
14793
14800
|
if (props.filter && props.filter(type22, arr)) {
|
|
14794
14801
|
return props.filter(type22, arr);
|
|
14795
14802
|
}
|
|
@@ -14814,8 +14821,8 @@ const DatePicker = (props) => {
|
|
|
14814
14821
|
}
|
|
14815
14822
|
return d;
|
|
14816
14823
|
};
|
|
14817
|
-
const columns = (
|
|
14818
|
-
const val = ranges(
|
|
14824
|
+
const columns = () => {
|
|
14825
|
+
const val = ranges().map((res, columnIndex) => {
|
|
14819
14826
|
return generateValue(
|
|
14820
14827
|
res.range[0],
|
|
14821
14828
|
res.range[1],
|
|
@@ -14826,44 +14833,26 @@ const DatePicker = (props) => {
|
|
|
14826
14833
|
});
|
|
14827
14834
|
return val || [];
|
|
14828
14835
|
};
|
|
14829
|
-
useEffect(() => {
|
|
14830
|
-
setCurrentDate(formatValue(modelValue));
|
|
14831
|
-
}, []);
|
|
14832
|
-
useEffect(() => {
|
|
14833
|
-
setCurrentDate(formatValue(modelValue));
|
|
14834
|
-
}, [modelValue]);
|
|
14835
|
-
useEffect(() => {
|
|
14836
|
-
setShow(visible);
|
|
14837
|
-
}, [visible]);
|
|
14838
14836
|
useEffect(() => {
|
|
14839
14837
|
if (currentDate) {
|
|
14840
|
-
|
|
14838
|
+
setOptions(columns());
|
|
14841
14839
|
}
|
|
14842
|
-
}, [
|
|
14843
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
14844
|
-
|
|
14840
|
+
}, []);
|
|
14841
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: `nut-datepicker ${className}`, style, ...rest }, options2.length && /* @__PURE__ */ React__default.createElement(
|
|
14842
|
+
Picker$1,
|
|
14845
14843
|
{
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
|
|
14850
|
-
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
|
|
14854
|
-
|
|
14855
|
-
|
|
14856
|
-
onClose: onCloseDatePicker,
|
|
14857
|
-
defaultValue,
|
|
14858
|
-
onConfirm: (options22, values) => onConfirmDatePicker && onConfirmDatePicker(options22, values),
|
|
14859
|
-
onChange: (list, value, index) => updateChooseValueCustmer(list, value, index),
|
|
14860
|
-
threeDimensional,
|
|
14861
|
-
ref: pickerRef
|
|
14862
|
-
}
|
|
14863
|
-
)
|
|
14864
|
-
);
|
|
14844
|
+
title,
|
|
14845
|
+
visible,
|
|
14846
|
+
options: options2,
|
|
14847
|
+
onClose,
|
|
14848
|
+
defaultValue: defaultValueOfPicker,
|
|
14849
|
+
onConfirm: (options22, value) => onConfirm && onConfirm(options22, value),
|
|
14850
|
+
onChange: (options22, value, index) => updateChooseValueCustmer(options22, value, index),
|
|
14851
|
+
threeDimensional
|
|
14852
|
+
}
|
|
14853
|
+
));
|
|
14865
14854
|
};
|
|
14866
|
-
DatePicker.defaultProps = defaultProps$
|
|
14855
|
+
DatePicker.defaultProps = defaultProps$V;
|
|
14867
14856
|
DatePicker.displayName = "NutDatePicker";
|
|
14868
14857
|
const FormItemContext = createContext({});
|
|
14869
14858
|
function _extends() {
|
|
@@ -16054,7 +16043,7 @@ const useForm = (form) => {
|
|
|
16054
16043
|
}
|
|
16055
16044
|
return [formRef.current];
|
|
16056
16045
|
};
|
|
16057
|
-
const defaultProps$
|
|
16046
|
+
const defaultProps$U = {
|
|
16058
16047
|
...ComponentDefaults,
|
|
16059
16048
|
name: "",
|
|
16060
16049
|
label: "",
|
|
@@ -16116,7 +16105,7 @@ class FormItem extends React__default.Component {
|
|
|
16116
16105
|
showErrorLine,
|
|
16117
16106
|
showErrorMessage
|
|
16118
16107
|
} = {
|
|
16119
|
-
...defaultProps$
|
|
16108
|
+
...defaultProps$U,
|
|
16120
16109
|
...this.props
|
|
16121
16110
|
};
|
|
16122
16111
|
const item = ((_a2 = this.context.errList) == null ? void 0 : _a2.length) > 0 && ((_b = this.context.errList) == null ? void 0 : _b.filter((item2) => {
|
|
@@ -16171,9 +16160,9 @@ class FormItem extends React__default.Component {
|
|
|
16171
16160
|
return this.renderLayout(returnChildNode);
|
|
16172
16161
|
}
|
|
16173
16162
|
}
|
|
16174
|
-
__publicField(FormItem, "defaultProps", defaultProps$
|
|
16163
|
+
__publicField(FormItem, "defaultProps", defaultProps$U);
|
|
16175
16164
|
__publicField(FormItem, "contextType", FormItemContext);
|
|
16176
|
-
const defaultProps$
|
|
16165
|
+
const defaultProps$T = {
|
|
16177
16166
|
...ComponentDefaults,
|
|
16178
16167
|
className: "",
|
|
16179
16168
|
style: void 0,
|
|
@@ -16201,7 +16190,7 @@ const Form = (props) => {
|
|
|
16201
16190
|
form,
|
|
16202
16191
|
...rest
|
|
16203
16192
|
} = {
|
|
16204
|
-
...defaultProps$
|
|
16193
|
+
...defaultProps$T,
|
|
16205
16194
|
...props
|
|
16206
16195
|
};
|
|
16207
16196
|
let formInstance = {};
|
|
@@ -16233,7 +16222,7 @@ const Form = (props) => {
|
|
|
16233
16222
|
/* @__PURE__ */ React__default.createElement(CellGroup, null, /* @__PURE__ */ React__default.createElement(FormItemContext.Provider, { value: formInstance }, children))
|
|
16234
16223
|
);
|
|
16235
16224
|
};
|
|
16236
|
-
Form.defaultProps = defaultProps$
|
|
16225
|
+
Form.defaultProps = defaultProps$T;
|
|
16237
16226
|
Form.displayName = "NutForm";
|
|
16238
16227
|
Form.Item = FormItem;
|
|
16239
16228
|
Form.useForm = useForm;
|
|
@@ -16261,7 +16250,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
16261
16250
|
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
16262
16251
|
return value.replace(regExp, "");
|
|
16263
16252
|
}
|
|
16264
|
-
const defaultProps$
|
|
16253
|
+
const defaultProps$S = {
|
|
16265
16254
|
...ComponentDefaults,
|
|
16266
16255
|
type: "text",
|
|
16267
16256
|
name: "",
|
|
@@ -16304,7 +16293,7 @@ const Input = forwardRef(
|
|
|
16304
16293
|
value: _value,
|
|
16305
16294
|
...rest
|
|
16306
16295
|
} = {
|
|
16307
|
-
...defaultProps$
|
|
16296
|
+
...defaultProps$S,
|
|
16308
16297
|
...props
|
|
16309
16298
|
};
|
|
16310
16299
|
const [value, setValue] = usePropsValue({
|
|
@@ -16439,9 +16428,9 @@ const Input = forwardRef(
|
|
|
16439
16428
|
);
|
|
16440
16429
|
}
|
|
16441
16430
|
);
|
|
16442
|
-
Input.defaultProps = defaultProps$
|
|
16431
|
+
Input.defaultProps = defaultProps$S;
|
|
16443
16432
|
Input.displayName = "NutInput";
|
|
16444
|
-
const defaultProps$
|
|
16433
|
+
const defaultProps$R = {
|
|
16445
16434
|
...ComponentDefaults,
|
|
16446
16435
|
disabled: false,
|
|
16447
16436
|
min: 1,
|
|
@@ -16453,7 +16442,7 @@ const defaultProps$S = {
|
|
|
16453
16442
|
digits: 0,
|
|
16454
16443
|
async: false
|
|
16455
16444
|
};
|
|
16456
|
-
const classPrefix$
|
|
16445
|
+
const classPrefix$e = `nut-inputnumber`;
|
|
16457
16446
|
const InputNumber = (props) => {
|
|
16458
16447
|
const {
|
|
16459
16448
|
children,
|
|
@@ -16478,7 +16467,7 @@ const InputNumber = (props) => {
|
|
|
16478
16467
|
onChange,
|
|
16479
16468
|
...restProps
|
|
16480
16469
|
} = {
|
|
16481
|
-
...defaultProps$
|
|
16470
|
+
...defaultProps$R,
|
|
16482
16471
|
...props
|
|
16483
16472
|
};
|
|
16484
16473
|
const inputRef = useRef("");
|
|
@@ -16496,8 +16485,8 @@ const InputNumber = (props) => {
|
|
|
16496
16485
|
}, []);
|
|
16497
16486
|
const classes = classNames(
|
|
16498
16487
|
{
|
|
16499
|
-
[`${classPrefix$
|
|
16500
|
-
[`${classPrefix$
|
|
16488
|
+
[`${classPrefix$e}`]: true,
|
|
16489
|
+
[`${classPrefix$e}--disabled`]: disabled
|
|
16501
16490
|
},
|
|
16502
16491
|
className
|
|
16503
16492
|
);
|
|
@@ -16675,9 +16664,9 @@ const InputNumber = (props) => {
|
|
|
16675
16664
|
}
|
|
16676
16665
|
)), /* @__PURE__ */ React__default.createElement("div", { className: "nut-input-add" }, /* @__PURE__ */ React__default.createElement(y$4, { className: iconAddClasses, onClick: (e) => addNumber(e) })));
|
|
16677
16666
|
};
|
|
16678
|
-
InputNumber.defaultProps = defaultProps$
|
|
16667
|
+
InputNumber.defaultProps = defaultProps$R;
|
|
16679
16668
|
InputNumber.displayName = "NutInputNumber";
|
|
16680
|
-
const defaultProps$
|
|
16669
|
+
const defaultProps$Q = {
|
|
16681
16670
|
...ComponentDefaults,
|
|
16682
16671
|
activeColor: "",
|
|
16683
16672
|
closeOnOverlayClick: true,
|
|
@@ -16696,7 +16685,7 @@ const Menu = (props) => {
|
|
|
16696
16685
|
activeColor,
|
|
16697
16686
|
...rest
|
|
16698
16687
|
} = {
|
|
16699
|
-
...defaultProps$
|
|
16688
|
+
...defaultProps$Q,
|
|
16700
16689
|
...props
|
|
16701
16690
|
};
|
|
16702
16691
|
const menuRef = useRef(null);
|
|
@@ -16727,6 +16716,7 @@ const Menu = (props) => {
|
|
|
16727
16716
|
};
|
|
16728
16717
|
const hideMenuItem = (index) => {
|
|
16729
16718
|
showMenuItem[index] = false;
|
|
16719
|
+
console.log([...showMenuItem]);
|
|
16730
16720
|
setShowMenuItem([...showMenuItem]);
|
|
16731
16721
|
};
|
|
16732
16722
|
const updateTitle = (text, index) => {
|
|
@@ -16736,6 +16726,7 @@ const Menu = (props) => {
|
|
|
16736
16726
|
const cloneChildren = () => {
|
|
16737
16727
|
return React__default.Children.map(children, (child, index) => {
|
|
16738
16728
|
return React__default.cloneElement(child, {
|
|
16729
|
+
...child.props,
|
|
16739
16730
|
show: showMenuItem[index],
|
|
16740
16731
|
index,
|
|
16741
16732
|
activeColor,
|
|
@@ -16775,7 +16766,8 @@ const Menu = (props) => {
|
|
|
16775
16766
|
}),
|
|
16776
16767
|
style: { color: showMenuItem[index] ? activeColor : "" },
|
|
16777
16768
|
key: index,
|
|
16778
|
-
onClick: () => {
|
|
16769
|
+
onClick: (e) => {
|
|
16770
|
+
e.stopPropagation();
|
|
16779
16771
|
!disabled && toggleMenuItem(index);
|
|
16780
16772
|
}
|
|
16781
16773
|
},
|
|
@@ -16815,14 +16807,61 @@ const Menu = (props) => {
|
|
|
16815
16807
|
), cloneChildren())
|
|
16816
16808
|
);
|
|
16817
16809
|
};
|
|
16818
|
-
Menu.defaultProps = defaultProps$
|
|
16810
|
+
Menu.defaultProps = defaultProps$Q;
|
|
16819
16811
|
Menu.displayName = "NutMenu";
|
|
16820
|
-
const
|
|
16812
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
16813
|
+
const isFunction = (val) => typeof val === "function";
|
|
16814
|
+
const isPromise = (val) => {
|
|
16815
|
+
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
16816
|
+
};
|
|
16817
|
+
const upperCaseFirst = (str) => {
|
|
16818
|
+
var str = str.toLowerCase();
|
|
16819
|
+
str = str.replace(
|
|
16820
|
+
/\b\w+\b/g,
|
|
16821
|
+
(word) => word.substring(0, 1).toUpperCase() + word.substring(1)
|
|
16822
|
+
);
|
|
16823
|
+
return str;
|
|
16824
|
+
};
|
|
16825
|
+
const getTargetElement = (target) => {
|
|
16826
|
+
let targetElement;
|
|
16827
|
+
if (isFunction(target)) {
|
|
16828
|
+
targetElement = target();
|
|
16829
|
+
} else if ("current" in target) {
|
|
16830
|
+
targetElement = target.current;
|
|
16831
|
+
} else {
|
|
16832
|
+
targetElement = target;
|
|
16833
|
+
}
|
|
16834
|
+
return targetElement;
|
|
16835
|
+
};
|
|
16836
|
+
function useClickAway(onClickAway, target, eventName = "click", isListener, outerVar) {
|
|
16837
|
+
const handler = (event) => {
|
|
16838
|
+
const targets = Array.isArray(target) ? target : [target];
|
|
16839
|
+
if (targets.some((item) => {
|
|
16840
|
+
const targetElement = getTargetElement(item);
|
|
16841
|
+
return !targetElement || targetElement.contains(event.target);
|
|
16842
|
+
})) {
|
|
16843
|
+
return;
|
|
16844
|
+
}
|
|
16845
|
+
if (outerVar) {
|
|
16846
|
+
onClickAway();
|
|
16847
|
+
}
|
|
16848
|
+
};
|
|
16849
|
+
useEffect(() => {
|
|
16850
|
+
if (isListener) {
|
|
16851
|
+
window.addEventListener(eventName, handler, false);
|
|
16852
|
+
} else {
|
|
16853
|
+
window.removeEventListener(eventName, handler, false);
|
|
16854
|
+
}
|
|
16855
|
+
return () => {
|
|
16856
|
+
window.removeEventListener(eventName, handler, true);
|
|
16857
|
+
};
|
|
16858
|
+
}, [target]);
|
|
16859
|
+
}
|
|
16860
|
+
const defaultProps$P = {
|
|
16821
16861
|
...ComponentDefaults,
|
|
16822
16862
|
columns: 1,
|
|
16823
16863
|
direction: "down",
|
|
16824
16864
|
icon: null,
|
|
16825
|
-
closeOnClickAway: false,
|
|
16826
16865
|
activeTitleClass: "",
|
|
16827
16866
|
inactiveTitleClass: "",
|
|
16828
16867
|
onChange: (value) => void 0
|
|
@@ -16847,7 +16886,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
16847
16886
|
parent,
|
|
16848
16887
|
index
|
|
16849
16888
|
} = {
|
|
16850
|
-
...defaultProps$
|
|
16889
|
+
...defaultProps$P,
|
|
16851
16890
|
...props
|
|
16852
16891
|
};
|
|
16853
16892
|
const [_showPopup, setShowPopup] = useState(show2);
|
|
@@ -16855,9 +16894,6 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
16855
16894
|
useEffect(() => {
|
|
16856
16895
|
setShowPopup(show2);
|
|
16857
16896
|
}, [show2]);
|
|
16858
|
-
useEffect(() => {
|
|
16859
|
-
getParentOffset();
|
|
16860
|
-
}, [_showPopup]);
|
|
16861
16897
|
useImperativeHandle(ref, () => ({
|
|
16862
16898
|
toggle: parent.toggleMenuItem
|
|
16863
16899
|
}));
|
|
@@ -16878,123 +16914,112 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
16878
16914
|
setValue(item.value);
|
|
16879
16915
|
onChange && onChange(item);
|
|
16880
16916
|
};
|
|
16881
|
-
const [position, setPosition] = useState({
|
|
16882
|
-
top: 0,
|
|
16883
|
-
height: 0
|
|
16884
|
-
});
|
|
16885
|
-
const getParentOffset = () => {
|
|
16886
|
-
setTimeout(() => {
|
|
16887
|
-
const p = parent.menuRef.current;
|
|
16888
|
-
const rect = p.getBoundingClientRect();
|
|
16889
|
-
setPosition({
|
|
16890
|
-
height: rect.height,
|
|
16891
|
-
top: rect.top
|
|
16892
|
-
});
|
|
16893
|
-
});
|
|
16894
|
-
};
|
|
16895
16917
|
const isShow = () => {
|
|
16896
16918
|
if (_showPopup)
|
|
16897
16919
|
return {};
|
|
16898
16920
|
return { display: "none" };
|
|
16899
16921
|
};
|
|
16900
16922
|
const getPosition = () => {
|
|
16901
|
-
return direction === "down" ? {
|
|
16902
|
-
|
|
16903
|
-
|
|
16904
|
-
if (direction === "down") {
|
|
16905
|
-
return {
|
|
16906
|
-
height: `${position.top + position.height}px`,
|
|
16907
|
-
top: 0,
|
|
16908
|
-
...isShow()
|
|
16909
|
-
};
|
|
16910
|
-
}
|
|
16911
|
-
return {
|
|
16912
|
-
height: `${window.innerHeight - position.top}px`,
|
|
16913
|
-
bottom: `0px`,
|
|
16923
|
+
return direction === "down" ? { position: "absolute", height: `${window.innerHeight}px` } : {
|
|
16924
|
+
position: "absolute",
|
|
16925
|
+
bottom: "100%",
|
|
16914
16926
|
top: "auto",
|
|
16915
|
-
|
|
16927
|
+
height: `${window.innerHeight}px`
|
|
16916
16928
|
};
|
|
16917
16929
|
};
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
|
|
16926
|
-
|
|
16927
|
-
|
|
16928
|
-
|
|
16929
|
-
|
|
16930
|
-
|
|
16931
|
-
|
|
16932
|
-
lockScroll: parent.lockScroll,
|
|
16933
|
-
visible: _showPopup,
|
|
16934
|
-
closeOnOverlayClick: parent.closeOnOverlayClick,
|
|
16935
|
-
onClick: () => {
|
|
16936
|
-
parent.closeOnOverlayClick && parent.toggleMenuItem(index);
|
|
16937
|
-
}
|
|
16938
|
-
}
|
|
16939
|
-
), /* @__PURE__ */ React__default.createElement(
|
|
16930
|
+
const micRef = useRef(null);
|
|
16931
|
+
const targetSet = [micRef.current];
|
|
16932
|
+
useClickAway(
|
|
16933
|
+
() => {
|
|
16934
|
+
parent.hideMenuItem(index);
|
|
16935
|
+
},
|
|
16936
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
16937
|
+
// @ts-ignore
|
|
16938
|
+
targetSet,
|
|
16939
|
+
"click",
|
|
16940
|
+
_showPopup,
|
|
16941
|
+
closeOnClickAway
|
|
16942
|
+
);
|
|
16943
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
16940
16944
|
"div",
|
|
16941
16945
|
{
|
|
16942
|
-
className:
|
|
16943
|
-
|
|
16944
|
-
|
|
16945
|
-
}),
|
|
16946
|
-
style: {
|
|
16947
|
-
...style,
|
|
16948
|
-
...isShow()
|
|
16949
|
-
}
|
|
16946
|
+
className: "nut-menu-item-container",
|
|
16947
|
+
ref: micRef,
|
|
16948
|
+
style: { position: "absolute", left: 0, right: 0 }
|
|
16950
16949
|
},
|
|
16951
16950
|
/* @__PURE__ */ React__default.createElement(
|
|
16952
|
-
|
|
16951
|
+
Overlay,
|
|
16953
16952
|
{
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16953
|
+
className: "nut-menu__overlay",
|
|
16954
|
+
style: getPosition(),
|
|
16955
|
+
lockScroll: parent.lockScroll,
|
|
16956
|
+
visible: _showPopup,
|
|
16957
|
+
closeOnOverlayClick: parent.closeOnOverlayClick,
|
|
16958
|
+
onClick: () => {
|
|
16959
|
+
parent.closeOnOverlayClick && parent.toggleMenuItem(index);
|
|
16960
|
+
}
|
|
16961
|
+
}
|
|
16962
|
+
),
|
|
16963
|
+
/* @__PURE__ */ React__default.createElement(
|
|
16964
|
+
"div",
|
|
16965
|
+
{
|
|
16966
|
+
className: classNames(className, {
|
|
16967
|
+
"nut-menu-item__wrap": direction === "down",
|
|
16968
|
+
"nut-menu-item__wrap-up": direction !== "down"
|
|
16969
|
+
}),
|
|
16970
|
+
style: {
|
|
16971
|
+
...style,
|
|
16972
|
+
...isShow()
|
|
16973
|
+
}
|
|
16957
16974
|
},
|
|
16958
|
-
/* @__PURE__ */ React__default.createElement(
|
|
16959
|
-
|
|
16960
|
-
|
|
16961
|
-
|
|
16962
|
-
|
|
16963
|
-
|
|
16964
|
-
|
|
16965
|
-
|
|
16966
|
-
|
|
16967
|
-
flexBasis: `${100 / columns}%`
|
|
16968
|
-
},
|
|
16969
|
-
onClick: () => {
|
|
16970
|
-
handleClick2(item);
|
|
16971
|
-
}
|
|
16972
|
-
},
|
|
16973
|
-
item.value === _value ? /* @__PURE__ */ React__default.createElement("i", null, icon || /* @__PURE__ */ React__default.createElement(
|
|
16974
|
-
x$f,
|
|
16975
|
-
{
|
|
16976
|
-
color: activeColor,
|
|
16977
|
-
className: getIconCName(item.value, value)
|
|
16978
|
-
}
|
|
16979
|
-
)) : null,
|
|
16980
|
-
/* @__PURE__ */ React__default.createElement(
|
|
16975
|
+
/* @__PURE__ */ React__default.createElement(
|
|
16976
|
+
CSSTransition$1,
|
|
16977
|
+
{
|
|
16978
|
+
in: _showPopup,
|
|
16979
|
+
timeout: 100,
|
|
16980
|
+
classNames: direction === "down" ? "menu-item" : "menu-item-up"
|
|
16981
|
+
},
|
|
16982
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-menu-item__content" }, options2 == null ? void 0 : options2.map((item) => {
|
|
16983
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
16981
16984
|
"div",
|
|
16982
16985
|
{
|
|
16983
|
-
className:
|
|
16986
|
+
className: `nut-menu-item__option ${classNames({
|
|
16987
|
+
active: item.value === _value
|
|
16988
|
+
})}`,
|
|
16989
|
+
key: item.text,
|
|
16984
16990
|
style: {
|
|
16985
|
-
|
|
16991
|
+
flexBasis: `${100 / columns}%`
|
|
16992
|
+
},
|
|
16993
|
+
onClick: () => {
|
|
16994
|
+
handleClick2(item);
|
|
16986
16995
|
}
|
|
16987
16996
|
},
|
|
16988
|
-
item.
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16997
|
+
item.value === _value ? /* @__PURE__ */ React__default.createElement("i", null, icon || /* @__PURE__ */ React__default.createElement(
|
|
16998
|
+
x$f,
|
|
16999
|
+
{
|
|
17000
|
+
color: activeColor,
|
|
17001
|
+
className: getIconCName(item.value, value)
|
|
17002
|
+
}
|
|
17003
|
+
)) : null,
|
|
17004
|
+
/* @__PURE__ */ React__default.createElement(
|
|
17005
|
+
"div",
|
|
17006
|
+
{
|
|
17007
|
+
className: getIconCName(item.value, value),
|
|
17008
|
+
style: {
|
|
17009
|
+
color: `${item.value === _value ? activeColor : ""}`
|
|
17010
|
+
}
|
|
17011
|
+
},
|
|
17012
|
+
item.text
|
|
17013
|
+
)
|
|
17014
|
+
);
|
|
17015
|
+
}), children)
|
|
17016
|
+
)
|
|
16992
17017
|
)
|
|
16993
|
-
)
|
|
17018
|
+
);
|
|
16994
17019
|
});
|
|
16995
|
-
MenuItem.defaultProps = defaultProps$
|
|
17020
|
+
MenuItem.defaultProps = defaultProps$P;
|
|
16996
17021
|
MenuItem.displayName = "NutMenuItem";
|
|
16997
|
-
const defaultProps$
|
|
17022
|
+
const defaultProps$O = {
|
|
16998
17023
|
...ComponentDefaults,
|
|
16999
17024
|
visible: false,
|
|
17000
17025
|
type: "default",
|
|
@@ -17145,17 +17170,17 @@ const NumberKeyboard = (props) => {
|
|
|
17145
17170
|
))))
|
|
17146
17171
|
);
|
|
17147
17172
|
};
|
|
17148
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
17173
|
+
NumberKeyboard.defaultProps = defaultProps$O;
|
|
17149
17174
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
17150
17175
|
const RadioContext = React__default.createContext(null);
|
|
17151
|
-
const defaultProps$
|
|
17176
|
+
const defaultProps$N = {
|
|
17152
17177
|
labelPosition: "right",
|
|
17153
17178
|
onChange: (value) => {
|
|
17154
17179
|
},
|
|
17155
17180
|
direction: "vertical",
|
|
17156
17181
|
options: []
|
|
17157
17182
|
};
|
|
17158
|
-
const classPrefix$
|
|
17183
|
+
const classPrefix$d = "nut-radiogroup";
|
|
17159
17184
|
const RadioGroup = React__default.forwardRef(
|
|
17160
17185
|
(props, ref) => {
|
|
17161
17186
|
const {
|
|
@@ -17169,7 +17194,7 @@ const RadioGroup = React__default.forwardRef(
|
|
|
17169
17194
|
options: options2,
|
|
17170
17195
|
disabled,
|
|
17171
17196
|
...rest
|
|
17172
|
-
} = { ...defaultProps$
|
|
17197
|
+
} = { ...defaultProps$N, ...props };
|
|
17173
17198
|
const [val2State, setVal2State] = usePropsValue({
|
|
17174
17199
|
defaultValue: props.defaultValue,
|
|
17175
17200
|
value: props.value,
|
|
@@ -17211,8 +17236,8 @@ const RadioGroup = React__default.forwardRef(
|
|
|
17211
17236
|
/* @__PURE__ */ React__default.createElement(
|
|
17212
17237
|
"div",
|
|
17213
17238
|
{
|
|
17214
|
-
className: classNames(classPrefix$
|
|
17215
|
-
[`${classPrefix$
|
|
17239
|
+
className: classNames(classPrefix$d, className, {
|
|
17240
|
+
[`${classPrefix$d}--${props.direction}`]: props.direction
|
|
17216
17241
|
}),
|
|
17217
17242
|
...rest
|
|
17218
17243
|
},
|
|
@@ -17221,9 +17246,9 @@ const RadioGroup = React__default.forwardRef(
|
|
|
17221
17246
|
);
|
|
17222
17247
|
}
|
|
17223
17248
|
);
|
|
17224
|
-
RadioGroup.defaultProps = defaultProps$
|
|
17249
|
+
RadioGroup.defaultProps = defaultProps$N;
|
|
17225
17250
|
RadioGroup.displayName = "NutRadioGroup";
|
|
17226
|
-
const defaultProps$
|
|
17251
|
+
const defaultProps$M = {
|
|
17227
17252
|
...ComponentDefaults,
|
|
17228
17253
|
disabled: false,
|
|
17229
17254
|
shape: "round",
|
|
@@ -17249,7 +17274,7 @@ const Radio = (props) => {
|
|
|
17249
17274
|
onChange,
|
|
17250
17275
|
...others
|
|
17251
17276
|
} = {
|
|
17252
|
-
...defaultProps$
|
|
17277
|
+
...defaultProps$M,
|
|
17253
17278
|
...props
|
|
17254
17279
|
};
|
|
17255
17280
|
let { labelPosition, disabled, ...rest } = others;
|
|
@@ -17345,10 +17370,10 @@ const Radio = (props) => {
|
|
|
17345
17370
|
renderRadioItem()
|
|
17346
17371
|
);
|
|
17347
17372
|
};
|
|
17348
|
-
Radio.defaultProps = defaultProps$
|
|
17373
|
+
Radio.defaultProps = defaultProps$M;
|
|
17349
17374
|
Radio.displayName = "NutRadio";
|
|
17350
17375
|
Radio.Group = RadioGroup;
|
|
17351
|
-
const defaultProps$
|
|
17376
|
+
const defaultProps$L = {
|
|
17352
17377
|
...ComponentDefaults,
|
|
17353
17378
|
range: false,
|
|
17354
17379
|
min: 0,
|
|
@@ -17376,7 +17401,7 @@ const Range = (props) => {
|
|
|
17376
17401
|
step,
|
|
17377
17402
|
value,
|
|
17378
17403
|
defaultValue
|
|
17379
|
-
} = { ...defaultProps$
|
|
17404
|
+
} = { ...defaultProps$L, ...props };
|
|
17380
17405
|
const classPrefix2 = "nut-range";
|
|
17381
17406
|
const [buttonIndex, setButtonIndex] = useState(0);
|
|
17382
17407
|
const [dragStatus, setDragStatus] = useState("start");
|
|
@@ -17640,9 +17665,9 @@ const Range = (props) => {
|
|
|
17640
17665
|
renderButton()
|
|
17641
17666
|
))), maxDescription !== null && /* @__PURE__ */ React__default.createElement("div", { className: "max" }, maxDescription || max));
|
|
17642
17667
|
};
|
|
17643
|
-
Range.defaultProps = defaultProps$
|
|
17668
|
+
Range.defaultProps = defaultProps$L;
|
|
17644
17669
|
Range.displayName = "NutRange";
|
|
17645
|
-
const defaultProps$
|
|
17670
|
+
const defaultProps$K = {
|
|
17646
17671
|
...ComponentDefaults,
|
|
17647
17672
|
count: 5,
|
|
17648
17673
|
min: 0,
|
|
@@ -17667,7 +17692,7 @@ const Rate = (props) => {
|
|
|
17667
17692
|
allowHalf,
|
|
17668
17693
|
onChange
|
|
17669
17694
|
} = {
|
|
17670
|
-
...defaultProps$
|
|
17695
|
+
...defaultProps$K,
|
|
17671
17696
|
...props
|
|
17672
17697
|
};
|
|
17673
17698
|
const classPrefix2 = "nut-rate";
|
|
@@ -17750,9 +17775,9 @@ const Rate = (props) => {
|
|
|
17750
17775
|
})
|
|
17751
17776
|
);
|
|
17752
17777
|
};
|
|
17753
|
-
Rate.defaultProps = defaultProps$
|
|
17778
|
+
Rate.defaultProps = defaultProps$K;
|
|
17754
17779
|
Rate.displayName = "NutRate";
|
|
17755
|
-
const defaultProps$
|
|
17780
|
+
const defaultProps$J = {
|
|
17756
17781
|
...ComponentDefaults,
|
|
17757
17782
|
placeholder: "",
|
|
17758
17783
|
shape: "square",
|
|
@@ -17791,7 +17816,7 @@ const SearchBar = (props) => {
|
|
|
17791
17816
|
onSearch,
|
|
17792
17817
|
onClickInput
|
|
17793
17818
|
} = {
|
|
17794
|
-
...defaultProps$
|
|
17819
|
+
...defaultProps$J,
|
|
17795
17820
|
...props
|
|
17796
17821
|
};
|
|
17797
17822
|
const forceFocus = () => {
|
|
@@ -17900,9 +17925,9 @@ const SearchBar = (props) => {
|
|
|
17900
17925
|
renderRight()
|
|
17901
17926
|
);
|
|
17902
17927
|
};
|
|
17903
|
-
SearchBar.defaultProps = defaultProps$
|
|
17928
|
+
SearchBar.defaultProps = defaultProps$J;
|
|
17904
17929
|
SearchBar.displayName = "NutSearchBar";
|
|
17905
|
-
const defaultProps$
|
|
17930
|
+
const defaultProps$I = {
|
|
17906
17931
|
...ComponentDefaults,
|
|
17907
17932
|
value: "",
|
|
17908
17933
|
visible: false,
|
|
@@ -17939,7 +17964,7 @@ const ShortPassword = (props) => {
|
|
|
17939
17964
|
onClickCloseIcon,
|
|
17940
17965
|
...rest
|
|
17941
17966
|
} = {
|
|
17942
|
-
...defaultProps$
|
|
17967
|
+
...defaultProps$I,
|
|
17943
17968
|
...props
|
|
17944
17969
|
};
|
|
17945
17970
|
const classPrefix2 = "nut-shortpassword";
|
|
@@ -17996,33 +18021,32 @@ const ShortPassword = (props) => {
|
|
|
17996
18021
|
), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__footer__sure`, onClick: sure }, locale.confirm)))
|
|
17997
18022
|
);
|
|
17998
18023
|
};
|
|
17999
|
-
ShortPassword.defaultProps = defaultProps$
|
|
18024
|
+
ShortPassword.defaultProps = defaultProps$I;
|
|
18000
18025
|
ShortPassword.displayName = "NutShortPassword";
|
|
18001
|
-
const defaultProps$
|
|
18026
|
+
const defaultProps$H = {
|
|
18027
|
+
...ComponentDefaults,
|
|
18002
18028
|
type: "png",
|
|
18003
18029
|
lineWidth: 2,
|
|
18004
18030
|
strokeStyle: "#000",
|
|
18005
|
-
|
|
18006
|
-
className: ""
|
|
18031
|
+
unsupported: ""
|
|
18007
18032
|
};
|
|
18008
|
-
const
|
|
18033
|
+
const InternalSignature = (props, ref) => {
|
|
18009
18034
|
const { locale } = useConfig();
|
|
18010
18035
|
const {
|
|
18011
18036
|
type: type4,
|
|
18012
18037
|
lineWidth,
|
|
18013
18038
|
strokeStyle,
|
|
18014
|
-
|
|
18039
|
+
unsupported,
|
|
18015
18040
|
className,
|
|
18016
|
-
|
|
18017
|
-
clear,
|
|
18041
|
+
style,
|
|
18018
18042
|
onConfirm,
|
|
18019
18043
|
onClear,
|
|
18020
18044
|
...rest
|
|
18021
18045
|
} = {
|
|
18022
|
-
...defaultProps$
|
|
18046
|
+
...defaultProps$H,
|
|
18023
18047
|
...props
|
|
18024
18048
|
};
|
|
18025
|
-
const
|
|
18049
|
+
const classPrefix2 = `nut-signature`;
|
|
18026
18050
|
const canvasRef = useRef(null);
|
|
18027
18051
|
const wrapRef = useRef(null);
|
|
18028
18052
|
const [canvasHeight, setCanvasHeight] = useState(0);
|
|
@@ -18089,12 +18113,8 @@ const Signature = (props) => {
|
|
|
18089
18113
|
ctx2.current.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
18090
18114
|
ctx2.current.closePath();
|
|
18091
18115
|
}
|
|
18092
|
-
clear && clear();
|
|
18093
18116
|
onClear && onClear();
|
|
18094
18117
|
};
|
|
18095
|
-
const handleConfirmBtn = () => {
|
|
18096
|
-
onSave(canvasRef.current);
|
|
18097
|
-
};
|
|
18098
18118
|
const onSave = (canvas) => {
|
|
18099
18119
|
let dataurl;
|
|
18100
18120
|
switch (type4) {
|
|
@@ -18108,30 +18128,22 @@ const Signature = (props) => {
|
|
|
18108
18128
|
dataurl = canvas.toDataURL("image/png");
|
|
18109
18129
|
}
|
|
18110
18130
|
handleClearBtn();
|
|
18111
|
-
confirm2 && confirm2(canvas, dataurl);
|
|
18112
18131
|
onConfirm && onConfirm(canvas, dataurl);
|
|
18113
18132
|
};
|
|
18114
|
-
|
|
18115
|
-
|
|
18116
|
-
|
|
18117
|
-
className: `${b("btn")}`,
|
|
18118
|
-
type: "default",
|
|
18119
|
-
onClick: () => handleClearBtn()
|
|
18120
|
-
},
|
|
18121
|
-
locale.signature.reSign
|
|
18122
|
-
), /* @__PURE__ */ React__default.createElement(
|
|
18123
|
-
Button,
|
|
18124
|
-
{
|
|
18125
|
-
className: `${b("btn")}`,
|
|
18126
|
-
type: "primary",
|
|
18127
|
-
onClick: () => handleConfirmBtn()
|
|
18133
|
+
useImperativeHandle(ref, () => ({
|
|
18134
|
+
confirm: () => {
|
|
18135
|
+
onSave(canvasRef.current);
|
|
18128
18136
|
},
|
|
18129
|
-
|
|
18130
|
-
|
|
18137
|
+
clear: () => {
|
|
18138
|
+
handleClearBtn();
|
|
18139
|
+
}
|
|
18140
|
+
}));
|
|
18141
|
+
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))));
|
|
18131
18142
|
};
|
|
18132
|
-
Signature
|
|
18143
|
+
const Signature = React__default.forwardRef(InternalSignature);
|
|
18144
|
+
Signature.defaultProps = defaultProps$H;
|
|
18133
18145
|
Signature.displayName = "NutSignature";
|
|
18134
|
-
const defaultProps$
|
|
18146
|
+
const defaultProps$G = {
|
|
18135
18147
|
...ComponentDefaults,
|
|
18136
18148
|
disabled: false,
|
|
18137
18149
|
activeText: "",
|
|
@@ -18148,7 +18160,7 @@ const Switch = (props) => {
|
|
|
18148
18160
|
style,
|
|
18149
18161
|
onChange
|
|
18150
18162
|
} = {
|
|
18151
|
-
...defaultProps$
|
|
18163
|
+
...defaultProps$G,
|
|
18152
18164
|
...props
|
|
18153
18165
|
};
|
|
18154
18166
|
const classPrefix2 = "nut-switch";
|
|
@@ -18167,9 +18179,9 @@ const Switch = (props) => {
|
|
|
18167
18179
|
};
|
|
18168
18180
|
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))));
|
|
18169
18181
|
};
|
|
18170
|
-
Switch.defaultProps = defaultProps$
|
|
18182
|
+
Switch.defaultProps = defaultProps$G;
|
|
18171
18183
|
Switch.displayName = "NutSwitch";
|
|
18172
|
-
const defaultProps$
|
|
18184
|
+
const defaultProps$F = {
|
|
18173
18185
|
...ComponentDefaults,
|
|
18174
18186
|
defaultValue: "",
|
|
18175
18187
|
showCount: false,
|
|
@@ -18198,7 +18210,7 @@ const TextArea = (props) => {
|
|
|
18198
18210
|
onBlur,
|
|
18199
18211
|
onFocus,
|
|
18200
18212
|
...rest
|
|
18201
|
-
} = { ...defaultProps$
|
|
18213
|
+
} = { ...defaultProps$F, ...props };
|
|
18202
18214
|
const classPrefix2 = "nut-textarea";
|
|
18203
18215
|
const textareaRef = useRef(null);
|
|
18204
18216
|
const compositionRef = useRef(false);
|
|
@@ -18282,9 +18294,9 @@ const TextArea = (props) => {
|
|
|
18282
18294
|
showCount && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__limit` }, inputValue.length, "/", maxLength < 0 ? 0 : maxLength)
|
|
18283
18295
|
);
|
|
18284
18296
|
};
|
|
18285
|
-
TextArea.defaultProps = defaultProps$
|
|
18297
|
+
TextArea.defaultProps = defaultProps$F;
|
|
18286
18298
|
TextArea.displayName = "NutTextArea";
|
|
18287
|
-
const defaultProps$
|
|
18299
|
+
const defaultProps$E = {
|
|
18288
18300
|
...ComponentDefaults,
|
|
18289
18301
|
percent: 0,
|
|
18290
18302
|
showText: false,
|
|
@@ -18307,7 +18319,7 @@ const Progress = (props) => {
|
|
|
18307
18319
|
delay,
|
|
18308
18320
|
...rest
|
|
18309
18321
|
} = {
|
|
18310
|
-
...defaultProps$
|
|
18322
|
+
...defaultProps$E,
|
|
18311
18323
|
...props
|
|
18312
18324
|
};
|
|
18313
18325
|
const classPrefix2 = "nut-progress";
|
|
@@ -18402,7 +18414,7 @@ const Progress = (props) => {
|
|
|
18402
18414
|
)))
|
|
18403
18415
|
);
|
|
18404
18416
|
};
|
|
18405
|
-
Progress.defaultProps = defaultProps$
|
|
18417
|
+
Progress.defaultProps = defaultProps$E;
|
|
18406
18418
|
Progress.displayName = "NutProgress";
|
|
18407
18419
|
class UploadOptions {
|
|
18408
18420
|
constructor() {
|
|
@@ -18469,19 +18481,6 @@ class Upload {
|
|
|
18469
18481
|
}
|
|
18470
18482
|
}
|
|
18471
18483
|
}
|
|
18472
|
-
const isObject = (val) => val !== null && typeof val === "object";
|
|
18473
|
-
const isFunction = (val) => typeof val === "function";
|
|
18474
|
-
const isPromise = (val) => {
|
|
18475
|
-
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
18476
|
-
};
|
|
18477
|
-
const upperCaseFirst = (str) => {
|
|
18478
|
-
var str = str.toLowerCase();
|
|
18479
|
-
str = str.replace(
|
|
18480
|
-
/\b\w+\b/g,
|
|
18481
|
-
(word) => word.substring(0, 1).toUpperCase() + word.substring(1)
|
|
18482
|
-
);
|
|
18483
|
-
return str;
|
|
18484
|
-
};
|
|
18485
18484
|
const funcInterceptor = (interceptor, {
|
|
18486
18485
|
args = [],
|
|
18487
18486
|
done,
|
|
@@ -18507,7 +18506,7 @@ const funcInterceptor = (interceptor, {
|
|
|
18507
18506
|
done();
|
|
18508
18507
|
}
|
|
18509
18508
|
};
|
|
18510
|
-
const defaultProps$
|
|
18509
|
+
const defaultProps$D = {
|
|
18511
18510
|
...ComponentDefaults,
|
|
18512
18511
|
url: "",
|
|
18513
18512
|
maxCount: 1,
|
|
@@ -18589,7 +18588,7 @@ const InternalUploader = (props, ref) => {
|
|
|
18589
18588
|
beforeXhrUpload,
|
|
18590
18589
|
beforeDelete,
|
|
18591
18590
|
...restProps
|
|
18592
|
-
} = { ...defaultProps$
|
|
18591
|
+
} = { ...defaultProps$D, ...props };
|
|
18593
18592
|
const [fileList, setFileList] = useState(defaultValue || []);
|
|
18594
18593
|
const [uploadQueue, setUploadQueue] = useState([]);
|
|
18595
18594
|
useEffect(() => {
|
|
@@ -18930,9 +18929,9 @@ const InternalUploader = (props, ref) => {
|
|
|
18930
18929
|
));
|
|
18931
18930
|
};
|
|
18932
18931
|
const Uploader = React__default.forwardRef(InternalUploader);
|
|
18933
|
-
Uploader.defaultProps = defaultProps$
|
|
18932
|
+
Uploader.defaultProps = defaultProps$D;
|
|
18934
18933
|
Uploader.displayName = "NutUploader";
|
|
18935
|
-
const defaultProps$
|
|
18934
|
+
const defaultProps$C = {
|
|
18936
18935
|
...ComponentDefaults,
|
|
18937
18936
|
visible: false,
|
|
18938
18937
|
title: "",
|
|
@@ -18959,7 +18958,7 @@ const ActionSheet = (props) => {
|
|
|
18959
18958
|
className,
|
|
18960
18959
|
style,
|
|
18961
18960
|
...rest
|
|
18962
|
-
} = { ...defaultProps$
|
|
18961
|
+
} = { ...defaultProps$C, ...props };
|
|
18963
18962
|
const classPrefix2 = "nut-actionsheet";
|
|
18964
18963
|
const cancelActionSheet = () => {
|
|
18965
18964
|
onCancel && onCancel();
|
|
@@ -19000,7 +18999,7 @@ const ActionSheet = (props) => {
|
|
|
19000
18999
|
))
|
|
19001
19000
|
);
|
|
19002
19001
|
};
|
|
19003
|
-
ActionSheet.defaultProps = defaultProps$
|
|
19002
|
+
ActionSheet.defaultProps = defaultProps$C;
|
|
19004
19003
|
ActionSheet.displayName = "NutActionSheet";
|
|
19005
19004
|
const fullClone = {
|
|
19006
19005
|
...ReactDOM
|
|
@@ -19233,7 +19232,7 @@ const DialogWrap = (props) => {
|
|
|
19233
19232
|
};
|
|
19234
19233
|
DialogWrap.defaultProps = defaultDialogProps;
|
|
19235
19234
|
DialogWrap.displayName = "NutDialogWrap";
|
|
19236
|
-
const defaultProps$
|
|
19235
|
+
const defaultProps$B = {
|
|
19237
19236
|
confirmText: "",
|
|
19238
19237
|
cancelText: "",
|
|
19239
19238
|
overlay: true,
|
|
@@ -19332,9 +19331,9 @@ Dialog.confirm = (props) => {
|
|
|
19332
19331
|
});
|
|
19333
19332
|
};
|
|
19334
19333
|
});
|
|
19335
|
-
Dialog.defaultProps = defaultProps$
|
|
19334
|
+
Dialog.defaultProps = defaultProps$B;
|
|
19336
19335
|
Dialog.displayName = "NutDialog";
|
|
19337
|
-
const defaultProps$
|
|
19336
|
+
const defaultProps$A = {
|
|
19338
19337
|
...ComponentDefaults,
|
|
19339
19338
|
attract: false,
|
|
19340
19339
|
direction: void 0,
|
|
@@ -19347,7 +19346,7 @@ const defaultProps$B = {
|
|
|
19347
19346
|
};
|
|
19348
19347
|
const Drag = (props) => {
|
|
19349
19348
|
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
19350
|
-
...defaultProps$
|
|
19349
|
+
...defaultProps$A,
|
|
19351
19350
|
...props
|
|
19352
19351
|
};
|
|
19353
19352
|
const classPrefix2 = "nut-drag";
|
|
@@ -19410,20 +19409,20 @@ const Drag = (props) => {
|
|
|
19410
19409
|
/* @__PURE__ */ React__default.createElement(animated.div, { style: currstyle, ...bind() }, children)
|
|
19411
19410
|
);
|
|
19412
19411
|
};
|
|
19413
|
-
Drag.defaultProps = defaultProps$
|
|
19412
|
+
Drag.defaultProps = defaultProps$A;
|
|
19414
19413
|
Drag.displayName = "NutDrag";
|
|
19415
19414
|
const defaultStatus = {
|
|
19416
19415
|
empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
|
|
19417
19416
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
19418
19417
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
19419
19418
|
};
|
|
19420
|
-
const defaultProps$
|
|
19419
|
+
const defaultProps$z = {
|
|
19421
19420
|
...ComponentDefaults,
|
|
19422
19421
|
description: "",
|
|
19423
19422
|
imageSize: "",
|
|
19424
19423
|
status: "empty"
|
|
19425
19424
|
};
|
|
19426
|
-
const classPrefix$
|
|
19425
|
+
const classPrefix$c = `nut-empty`;
|
|
19427
19426
|
const Empty = (props) => {
|
|
19428
19427
|
const { locale } = useConfig();
|
|
19429
19428
|
const {
|
|
@@ -19435,7 +19434,7 @@ const Empty = (props) => {
|
|
|
19435
19434
|
status,
|
|
19436
19435
|
...rest
|
|
19437
19436
|
} = {
|
|
19438
|
-
...defaultProps$
|
|
19437
|
+
...defaultProps$z,
|
|
19439
19438
|
...props
|
|
19440
19439
|
};
|
|
19441
19440
|
const [imgStyle, setImgStyle] = useState({});
|
|
@@ -19458,46 +19457,38 @@ const Empty = (props) => {
|
|
|
19458
19457
|
};
|
|
19459
19458
|
});
|
|
19460
19459
|
}, [imageSize]);
|
|
19461
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$
|
|
19460
|
+
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));
|
|
19462
19461
|
};
|
|
19463
|
-
Empty.defaultProps = defaultProps$
|
|
19462
|
+
Empty.defaultProps = defaultProps$z;
|
|
19464
19463
|
Empty.displayName = "NutEmpty";
|
|
19465
|
-
const defaultProps$
|
|
19464
|
+
const defaultProps$y = {
|
|
19466
19465
|
...ComponentDefaults,
|
|
19467
19466
|
hasMore: true,
|
|
19468
19467
|
threshold: 200,
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
|
|
19475
|
-
loadIcon: null,
|
|
19476
|
-
loadingText: "加载中···",
|
|
19477
|
-
loadMoreText: "哎呀,这里是底部了啦"
|
|
19478
|
-
};
|
|
19479
|
-
const Infiniteloading = (props) => {
|
|
19468
|
+
target: "",
|
|
19469
|
+
capture: false,
|
|
19470
|
+
pullRefresh: false
|
|
19471
|
+
};
|
|
19472
|
+
const classPrefix$b = `nut-infiniteloading`;
|
|
19473
|
+
const InfiniteLoading = (props) => {
|
|
19480
19474
|
const { locale } = useConfig();
|
|
19481
19475
|
const {
|
|
19482
19476
|
children,
|
|
19483
19477
|
hasMore,
|
|
19484
19478
|
threshold,
|
|
19485
|
-
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
pullIcon,
|
|
19490
|
-
pullText,
|
|
19491
|
-
loadIcon,
|
|
19479
|
+
target,
|
|
19480
|
+
capture,
|
|
19481
|
+
pullRefresh,
|
|
19482
|
+
pullingText,
|
|
19492
19483
|
loadingText,
|
|
19493
19484
|
loadMoreText,
|
|
19494
19485
|
className,
|
|
19495
19486
|
onRefresh,
|
|
19496
19487
|
onLoadMore,
|
|
19497
|
-
|
|
19488
|
+
onScroll,
|
|
19498
19489
|
...restProps
|
|
19499
19490
|
} = {
|
|
19500
|
-
...defaultProps$
|
|
19491
|
+
...defaultProps$y,
|
|
19501
19492
|
...props
|
|
19502
19493
|
};
|
|
19503
19494
|
const [isInfiniting, setIsInfiniting] = useState(false);
|
|
@@ -19509,16 +19500,16 @@ const Infiniteloading = (props) => {
|
|
|
19509
19500
|
const refreshMaxH = useRef(0);
|
|
19510
19501
|
const y2 = useRef(0);
|
|
19511
19502
|
const distance = useRef(0);
|
|
19512
|
-
const
|
|
19513
|
-
const classes = classNames(className, b());
|
|
19503
|
+
const classes = classNames(className, classPrefix$b);
|
|
19514
19504
|
useEffect(() => {
|
|
19515
|
-
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19519
|
-
|
|
19505
|
+
if (target && document.getElementById(target)) {
|
|
19506
|
+
scrollEl.current = document.getElementById(target);
|
|
19507
|
+
} else {
|
|
19508
|
+
scrollEl.current = window;
|
|
19509
|
+
}
|
|
19510
|
+
scrollEl.current.addEventListener("scroll", handleScroll, capture);
|
|
19520
19511
|
return () => {
|
|
19521
|
-
scrollEl.current.removeEventListener("scroll", handleScroll,
|
|
19512
|
+
scrollEl.current.removeEventListener("scroll", handleScroll, capture);
|
|
19522
19513
|
};
|
|
19523
19514
|
}, [hasMore, isInfiniting]);
|
|
19524
19515
|
useEffect(() => {
|
|
@@ -19536,9 +19527,6 @@ const Infiniteloading = (props) => {
|
|
|
19536
19527
|
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)`
|
|
19537
19528
|
};
|
|
19538
19529
|
};
|
|
19539
|
-
const getParentElement = (el) => {
|
|
19540
|
-
return containerId ? document.querySelector(`#${containerId}`) : el && el.parentNode;
|
|
19541
|
-
};
|
|
19542
19530
|
const handleScroll = () => {
|
|
19543
19531
|
requestAniFrame2()(() => {
|
|
19544
19532
|
if (!isScrollAtBottom() || !hasMore || isInfiniting) {
|
|
@@ -19558,7 +19546,7 @@ const Infiniteloading = (props) => {
|
|
|
19558
19546
|
isTouching.current = false;
|
|
19559
19547
|
};
|
|
19560
19548
|
const touchStart = (event) => {
|
|
19561
|
-
if (beforeScrollTop.current === 0 && !isTouching.current &&
|
|
19549
|
+
if (beforeScrollTop.current === 0 && !isTouching.current && pullRefresh) {
|
|
19562
19550
|
y2.current = event.touches[0].pageY;
|
|
19563
19551
|
isTouching.current = true;
|
|
19564
19552
|
const childHeight = refreshTop.current.firstElementChild.offsetHeight;
|
|
@@ -19590,12 +19578,12 @@ const Infiniteloading = (props) => {
|
|
|
19590
19578
|
}
|
|
19591
19579
|
};
|
|
19592
19580
|
const requestAniFrame2 = () => {
|
|
19593
|
-
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function fn(callback) {
|
|
19581
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function fn(callback) {
|
|
19594
19582
|
window.setTimeout(callback, 1e3 / 60);
|
|
19595
19583
|
};
|
|
19596
19584
|
};
|
|
19597
19585
|
const getWindowScrollTop = () => {
|
|
19598
|
-
return window.
|
|
19586
|
+
return window.scrollY !== void 0 ? window.scrollY : (document.documentElement || document.body.parentNode || document.body).scrollTop;
|
|
19599
19587
|
};
|
|
19600
19588
|
const calculateTopPosition = (el) => {
|
|
19601
19589
|
return !el ? 0 : el.offsetTop + calculateTopPosition(el.offsetParent);
|
|
@@ -19605,7 +19593,7 @@ const Infiniteloading = (props) => {
|
|
|
19605
19593
|
let resScrollTop = 0;
|
|
19606
19594
|
let direction = "down";
|
|
19607
19595
|
const windowScrollTop = getWindowScrollTop();
|
|
19608
|
-
if (
|
|
19596
|
+
if (!target || !document.getElementById(target)) {
|
|
19609
19597
|
if (scroller.current) {
|
|
19610
19598
|
offsetDistance = calculateTopPosition(scroller.current) + scroller.current.offsetHeight - windowScrollTop - window.innerHeight;
|
|
19611
19599
|
}
|
|
@@ -19621,7 +19609,7 @@ const Infiniteloading = (props) => {
|
|
|
19621
19609
|
direction = "down";
|
|
19622
19610
|
}
|
|
19623
19611
|
beforeScrollTop.current = resScrollTop;
|
|
19624
|
-
|
|
19612
|
+
onScroll && onScroll(resScrollTop);
|
|
19625
19613
|
return offsetDistance <= threshold && direction === "down";
|
|
19626
19614
|
};
|
|
19627
19615
|
return /* @__PURE__ */ React__default.createElement(
|
|
@@ -19633,14 +19621,14 @@ const Infiniteloading = (props) => {
|
|
|
19633
19621
|
onTouchEnd: touchEnd,
|
|
19634
19622
|
...restProps
|
|
19635
19623
|
},
|
|
19636
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "nut-infinite-top", ref: refreshTop, style: getStyle() }, /* @__PURE__ */ React__default.createElement("div", { className: "top-box" },
|
|
19624
|
+
/* @__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)),
|
|
19637
19625
|
/* @__PURE__ */ React__default.createElement("div", { className: "nut-infinite-container" }, children),
|
|
19638
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "nut-infinite-bottom" }, isInfiniting ? /* @__PURE__ */ React__default.createElement("div", { className: "bottom-box" },
|
|
19626
|
+
/* @__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))
|
|
19639
19627
|
);
|
|
19640
19628
|
};
|
|
19641
|
-
|
|
19642
|
-
|
|
19643
|
-
const defaultProps$
|
|
19629
|
+
InfiniteLoading.defaultProps = defaultProps$y;
|
|
19630
|
+
InfiniteLoading.displayName = "NutInfiniteLoading";
|
|
19631
|
+
const defaultProps$x = {
|
|
19644
19632
|
...ComponentDefaults,
|
|
19645
19633
|
direction: "horizontal",
|
|
19646
19634
|
list: [],
|
|
@@ -19678,7 +19666,7 @@ const NoticeBar = (props) => {
|
|
|
19678
19666
|
onClick,
|
|
19679
19667
|
onClickItem
|
|
19680
19668
|
} = {
|
|
19681
|
-
...defaultProps$
|
|
19669
|
+
...defaultProps$x,
|
|
19682
19670
|
...props
|
|
19683
19671
|
};
|
|
19684
19672
|
const classPrefix2 = "nut-noticebar";
|
|
@@ -19987,7 +19975,7 @@ const NoticeBar = (props) => {
|
|
|
19987
19975
|
onClick: handleClick2
|
|
19988
19976
|
},
|
|
19989
19977
|
leftIcon ? /* @__PURE__ */ React__default.createElement("div", { className: "left-icon" }, leftIcon) : null,
|
|
19990
|
-
children ? /* @__PURE__ */ React__default.createElement(
|
|
19978
|
+
children ? /* @__PURE__ */ React__default.createElement("div", { className: "nut-noticebar__inner", ref: innerRef }, scrollList.current.map((item, index) => {
|
|
19991
19979
|
return /* @__PURE__ */ React__default.createElement(
|
|
19992
19980
|
"div",
|
|
19993
19981
|
{
|
|
@@ -20000,7 +19988,7 @@ const NoticeBar = (props) => {
|
|
|
20000
19988
|
},
|
|
20001
19989
|
item
|
|
20002
19990
|
);
|
|
20003
|
-
}))
|
|
19991
|
+
})) : /* @__PURE__ */ React__default.createElement("div", { className: "horseLamp_list", style: horseLampStyle }, scrollList.current.map((item, index) => {
|
|
20004
19992
|
return (
|
|
20005
19993
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
20006
19994
|
/* @__PURE__ */ React__default.createElement(
|
|
@@ -20029,7 +20017,7 @@ const NoticeBar = (props) => {
|
|
|
20029
20017
|
)
|
|
20030
20018
|
) : null);
|
|
20031
20019
|
};
|
|
20032
|
-
NoticeBar.defaultProps = defaultProps$
|
|
20020
|
+
NoticeBar.defaultProps = defaultProps$x;
|
|
20033
20021
|
NoticeBar.displayName = "NutNoticeBar";
|
|
20034
20022
|
const classPrefix$a = "nut-notify";
|
|
20035
20023
|
let Notification$1 = (_a = class extends React.PureComponent {
|
|
@@ -20194,42 +20182,7 @@ const Notify = {
|
|
|
20194
20182
|
}
|
|
20195
20183
|
}
|
|
20196
20184
|
};
|
|
20197
|
-
const
|
|
20198
|
-
let targetElement;
|
|
20199
|
-
if (isFunction(target)) {
|
|
20200
|
-
targetElement = target();
|
|
20201
|
-
} else if ("current" in target) {
|
|
20202
|
-
targetElement = target.current;
|
|
20203
|
-
} else {
|
|
20204
|
-
targetElement = target;
|
|
20205
|
-
}
|
|
20206
|
-
return targetElement;
|
|
20207
|
-
};
|
|
20208
|
-
function useClickAway(onClickAway, target, eventName = "click", isListener, outerVar) {
|
|
20209
|
-
const handler = (event) => {
|
|
20210
|
-
const targets = Array.isArray(target) ? target : [target];
|
|
20211
|
-
if (targets.some((item) => {
|
|
20212
|
-
const targetElement = getTargetElement(item);
|
|
20213
|
-
return !targetElement || targetElement.contains(event.target);
|
|
20214
|
-
})) {
|
|
20215
|
-
return;
|
|
20216
|
-
}
|
|
20217
|
-
if (outerVar) {
|
|
20218
|
-
onClickAway();
|
|
20219
|
-
}
|
|
20220
|
-
};
|
|
20221
|
-
useEffect(() => {
|
|
20222
|
-
if (isListener) {
|
|
20223
|
-
window.addEventListener(eventName, handler, true);
|
|
20224
|
-
} else {
|
|
20225
|
-
window.removeEventListener(eventName, handler, true);
|
|
20226
|
-
}
|
|
20227
|
-
return () => {
|
|
20228
|
-
window.removeEventListener(eventName, handler, true);
|
|
20229
|
-
};
|
|
20230
|
-
}, [target]);
|
|
20231
|
-
}
|
|
20232
|
-
const defaultProps$x = {
|
|
20185
|
+
const defaultProps$w = {
|
|
20233
20186
|
...ComponentDefaults,
|
|
20234
20187
|
list: [],
|
|
20235
20188
|
location: "bottom",
|
|
@@ -20282,7 +20235,7 @@ const Popover = (props) => {
|
|
|
20282
20235
|
onSelect,
|
|
20283
20236
|
...reset
|
|
20284
20237
|
} = {
|
|
20285
|
-
...defaultProps$
|
|
20238
|
+
...defaultProps$w,
|
|
20286
20239
|
...props
|
|
20287
20240
|
};
|
|
20288
20241
|
const popoverRef = useRef(null);
|
|
@@ -20477,7 +20430,7 @@ const Popover = (props) => {
|
|
|
20477
20430
|
}))
|
|
20478
20431
|
)));
|
|
20479
20432
|
};
|
|
20480
|
-
Popover.defaultProps = defaultProps$
|
|
20433
|
+
Popover.defaultProps = defaultProps$w;
|
|
20481
20434
|
Popover.displayName = "NutPopover";
|
|
20482
20435
|
function bound(position, min, max) {
|
|
20483
20436
|
let ret = position;
|
|
@@ -20515,7 +20468,7 @@ if (canUseDom) {
|
|
|
20515
20468
|
console.log(e);
|
|
20516
20469
|
}
|
|
20517
20470
|
}
|
|
20518
|
-
const defaultProps$
|
|
20471
|
+
const defaultProps$v = {
|
|
20519
20472
|
...ComponentDefaults,
|
|
20520
20473
|
pullingText: "",
|
|
20521
20474
|
canReleaseText: "",
|
|
@@ -20532,7 +20485,7 @@ const PullToRefresh = (p) => {
|
|
|
20532
20485
|
const classPrefix2 = "nut-pulltorefresh";
|
|
20533
20486
|
const { locale } = useConfig();
|
|
20534
20487
|
const props = {
|
|
20535
|
-
...defaultProps$
|
|
20488
|
+
...defaultProps$v,
|
|
20536
20489
|
...p,
|
|
20537
20490
|
...{
|
|
20538
20491
|
pullingText: p.pullingText || locale.pullToRefresh.pullingText,
|
|
@@ -20675,10 +20628,10 @@ const PullToRefresh = (p) => {
|
|
|
20675
20628
|
/* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-content` }, props.children)
|
|
20676
20629
|
);
|
|
20677
20630
|
};
|
|
20678
|
-
PullToRefresh.defaultProps = defaultProps$
|
|
20631
|
+
PullToRefresh.defaultProps = defaultProps$v;
|
|
20679
20632
|
PullToRefresh.displayName = "NutPullToRefresh";
|
|
20680
20633
|
const AvatarContext = createContext({});
|
|
20681
|
-
const defaultProps$
|
|
20634
|
+
const defaultProps$u = {
|
|
20682
20635
|
...ComponentDefaults,
|
|
20683
20636
|
size: "",
|
|
20684
20637
|
shape: "round",
|
|
@@ -20708,7 +20661,7 @@ const Avatar = (props) => {
|
|
|
20708
20661
|
onError,
|
|
20709
20662
|
...rest
|
|
20710
20663
|
} = {
|
|
20711
|
-
...defaultProps$
|
|
20664
|
+
...defaultProps$u,
|
|
20712
20665
|
...props
|
|
20713
20666
|
};
|
|
20714
20667
|
const [maxSum, setMaxSum] = useState(0);
|
|
@@ -20790,9 +20743,9 @@ const Avatar = (props) => {
|
|
|
20790
20743
|
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)}`)
|
|
20791
20744
|
));
|
|
20792
20745
|
};
|
|
20793
|
-
Avatar.defaultProps = defaultProps$
|
|
20746
|
+
Avatar.defaultProps = defaultProps$u;
|
|
20794
20747
|
Avatar.displayName = "NutAvatar";
|
|
20795
|
-
const defaultProps$
|
|
20748
|
+
const defaultProps$t = {
|
|
20796
20749
|
...ComponentDefaults,
|
|
20797
20750
|
rows: 1,
|
|
20798
20751
|
animated: false,
|
|
@@ -20815,7 +20768,7 @@ const Skeleton = (props) => {
|
|
|
20815
20768
|
avatarShape,
|
|
20816
20769
|
...rest
|
|
20817
20770
|
} = {
|
|
20818
|
-
...defaultProps$
|
|
20771
|
+
...defaultProps$t,
|
|
20819
20772
|
...props
|
|
20820
20773
|
};
|
|
20821
20774
|
const classPrefix2 = "nut-skeleton";
|
|
@@ -20851,7 +20804,7 @@ const Skeleton = (props) => {
|
|
|
20851
20804
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__block`, key: index });
|
|
20852
20805
|
})))));
|
|
20853
20806
|
};
|
|
20854
|
-
Skeleton.defaultProps = defaultProps$
|
|
20807
|
+
Skeleton.defaultProps = defaultProps$t;
|
|
20855
20808
|
Skeleton.displayName = "NutSkeleton";
|
|
20856
20809
|
function preventDefault(event, isStopPropagation) {
|
|
20857
20810
|
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
@@ -20861,13 +20814,13 @@ function preventDefault(event, isStopPropagation) {
|
|
|
20861
20814
|
event.stopPropagation();
|
|
20862
20815
|
}
|
|
20863
20816
|
}
|
|
20864
|
-
const defaultProps$
|
|
20817
|
+
const defaultProps$s = {
|
|
20865
20818
|
name: ""
|
|
20866
20819
|
};
|
|
20867
20820
|
const Swipe = forwardRef((props, instanceRef) => {
|
|
20868
20821
|
const swipeBem = cn("swipe");
|
|
20869
20822
|
const touch = useTouch();
|
|
20870
|
-
const { children, className, style } = { ...defaultProps$
|
|
20823
|
+
const { children, className, style } = { ...defaultProps$s, ...props };
|
|
20871
20824
|
const root2 = useRef();
|
|
20872
20825
|
const opened = useRef(false);
|
|
20873
20826
|
const lockClick = useRef(false);
|
|
@@ -21035,7 +20988,7 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
21035
20988
|
/* @__PURE__ */ React__default.createElement("div", { className: `${swipeBem("wrapper")}`, style: wrapperStyle }, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef))
|
|
21036
20989
|
);
|
|
21037
20990
|
});
|
|
21038
|
-
Swipe.defaultProps = defaultProps$
|
|
20991
|
+
Swipe.defaultProps = defaultProps$s;
|
|
21039
20992
|
Swipe.displayName = "NutSwipe";
|
|
21040
20993
|
const classPrefix$7 = "nut-toast";
|
|
21041
20994
|
class Notification extends React.PureComponent {
|
|
@@ -21045,11 +20998,20 @@ class Notification extends React.PureComponent {
|
|
|
21045
20998
|
this.close = this.close.bind(this);
|
|
21046
20999
|
this.startCloseTimer = this.startCloseTimer.bind(this);
|
|
21047
21000
|
this.clearCloseTimer = this.clearCloseTimer.bind(this);
|
|
21048
|
-
this.close = this.close.bind(this);
|
|
21049
21001
|
this.clickCover = this.clickCover.bind(this);
|
|
21002
|
+
this.state = {
|
|
21003
|
+
show: true
|
|
21004
|
+
};
|
|
21050
21005
|
}
|
|
21051
21006
|
close() {
|
|
21007
|
+
this.setState({
|
|
21008
|
+
show: false
|
|
21009
|
+
});
|
|
21052
21010
|
this.clearCloseTimer();
|
|
21011
|
+
if (this.props.id) {
|
|
21012
|
+
const element = document.getElementById(this.props.id);
|
|
21013
|
+
element && element.parentNode && element.parentNode.removeChild(element);
|
|
21014
|
+
}
|
|
21053
21015
|
this.props.onClose();
|
|
21054
21016
|
}
|
|
21055
21017
|
startCloseTimer() {
|
|
@@ -21114,6 +21076,7 @@ class Notification extends React.PureComponent {
|
|
|
21114
21076
|
contentClassName,
|
|
21115
21077
|
contentStyle
|
|
21116
21078
|
} = this.props;
|
|
21079
|
+
const { show: show2 } = this.state;
|
|
21117
21080
|
const classes = classNames({
|
|
21118
21081
|
"nut-toast-has-icon": icon,
|
|
21119
21082
|
[`nut-toast-${size}`]: true
|
|
@@ -21121,11 +21084,10 @@ class Notification extends React.PureComponent {
|
|
|
21121
21084
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
21122
21085
|
Overlay,
|
|
21123
21086
|
{
|
|
21124
|
-
visible:
|
|
21087
|
+
visible: show2,
|
|
21125
21088
|
style,
|
|
21126
21089
|
className: `${classPrefix$7}__overlay-default ${className}`,
|
|
21127
21090
|
onClick: () => {
|
|
21128
|
-
console.log("onclick");
|
|
21129
21091
|
this.clickCover();
|
|
21130
21092
|
},
|
|
21131
21093
|
closeOnOverlayClick
|
|
@@ -21146,9 +21108,9 @@ class Notification extends React.PureComponent {
|
|
|
21146
21108
|
__publicField(Notification, "newInstance");
|
|
21147
21109
|
Notification.newInstance = (properties, callback) => {
|
|
21148
21110
|
const element = document.createElement("div");
|
|
21149
|
-
|
|
21150
|
-
|
|
21151
|
-
|
|
21111
|
+
const id = properties.id ? properties.id : `${(/* @__PURE__ */ new Date()).getTime()}`;
|
|
21112
|
+
element.id = id;
|
|
21113
|
+
properties.id = id;
|
|
21152
21114
|
document.body.appendChild(element);
|
|
21153
21115
|
let called = false;
|
|
21154
21116
|
function ref(instance) {
|
|
@@ -21241,7 +21203,7 @@ const Toast = {
|
|
|
21241
21203
|
}
|
|
21242
21204
|
}
|
|
21243
21205
|
};
|
|
21244
|
-
const defaultProps$
|
|
21206
|
+
const defaultProps$r = {
|
|
21245
21207
|
...ComponentDefaults,
|
|
21246
21208
|
type: "shake",
|
|
21247
21209
|
action: "initial",
|
|
@@ -21252,7 +21214,7 @@ const defaultProps$s = {
|
|
|
21252
21214
|
const classPrefix$6 = `nut-animate`;
|
|
21253
21215
|
const Animate = (props) => {
|
|
21254
21216
|
const { className, type: type4, action, loop: loop2, onClick, children, ...rest } = {
|
|
21255
|
-
...defaultProps$
|
|
21217
|
+
...defaultProps$r,
|
|
21256
21218
|
...props
|
|
21257
21219
|
};
|
|
21258
21220
|
const [clicked, setClicked] = useState(false);
|
|
@@ -21273,9 +21235,9 @@ const Animate = (props) => {
|
|
|
21273
21235
|
};
|
|
21274
21236
|
return /* @__PURE__ */ React__default.createElement("div", { className: "nut-animate" }, /* @__PURE__ */ React__default.createElement("div", { className: cls, onClick: handleClick2, ...rest }, children));
|
|
21275
21237
|
};
|
|
21276
|
-
Animate.defaultProps = defaultProps$
|
|
21238
|
+
Animate.defaultProps = defaultProps$r;
|
|
21277
21239
|
Animate.displayName = "NutAnimate";
|
|
21278
|
-
const defaultProps$
|
|
21240
|
+
const defaultProps$q = {
|
|
21279
21241
|
...ComponentDefaults,
|
|
21280
21242
|
length: 0,
|
|
21281
21243
|
value: "",
|
|
@@ -21294,7 +21256,7 @@ const CountUp = (props) => {
|
|
|
21294
21256
|
style,
|
|
21295
21257
|
...reset
|
|
21296
21258
|
} = {
|
|
21297
|
-
...defaultProps$
|
|
21259
|
+
...defaultProps$q,
|
|
21298
21260
|
...props
|
|
21299
21261
|
};
|
|
21300
21262
|
const classPrefix2 = "nut-countup";
|
|
@@ -21358,9 +21320,9 @@ const CountUp = (props) => {
|
|
|
21358
21320
|
);
|
|
21359
21321
|
})));
|
|
21360
21322
|
};
|
|
21361
|
-
CountUp.defaultProps = defaultProps$
|
|
21323
|
+
CountUp.defaultProps = defaultProps$q;
|
|
21362
21324
|
CountUp.displayName = "NutCountUp";
|
|
21363
|
-
const defaultProps$
|
|
21325
|
+
const defaultProps$p = {};
|
|
21364
21326
|
class AnimatingNumbers extends Component {
|
|
21365
21327
|
constructor(props) {
|
|
21366
21328
|
super(props);
|
|
@@ -21370,11 +21332,11 @@ class AnimatingNumbers extends Component {
|
|
|
21370
21332
|
return /* @__PURE__ */ React__default.createElement("div", { className: "nut-animatingnumbers" });
|
|
21371
21333
|
}
|
|
21372
21334
|
}
|
|
21373
|
-
__publicField(AnimatingNumbers, "defaultProps", defaultProps$
|
|
21335
|
+
__publicField(AnimatingNumbers, "defaultProps", defaultProps$p);
|
|
21374
21336
|
__publicField(AnimatingNumbers, "displayName", "NutAnimatingNumbers");
|
|
21375
21337
|
__publicField(AnimatingNumbers, "CountUp", CountUp);
|
|
21376
21338
|
AnimatingNumbers.CountUp = CountUp;
|
|
21377
|
-
const defaultProps$
|
|
21339
|
+
const defaultProps$o = {
|
|
21378
21340
|
...ComponentDefaults,
|
|
21379
21341
|
src: "",
|
|
21380
21342
|
muted: false,
|
|
@@ -21417,7 +21379,7 @@ const Audio = (props) => {
|
|
|
21417
21379
|
children,
|
|
21418
21380
|
...rest
|
|
21419
21381
|
} = {
|
|
21420
|
-
...defaultProps$
|
|
21382
|
+
...defaultProps$o,
|
|
21421
21383
|
...props
|
|
21422
21384
|
};
|
|
21423
21385
|
const [playing, setPlaying] = useState(false);
|
|
@@ -21623,9 +21585,9 @@ const Audio = (props) => {
|
|
|
21623
21585
|
/* @__PURE__ */ React__default.createElement("track", { kind: "captions" })
|
|
21624
21586
|
));
|
|
21625
21587
|
};
|
|
21626
|
-
Audio.defaultProps = defaultProps$
|
|
21588
|
+
Audio.defaultProps = defaultProps$o;
|
|
21627
21589
|
Audio.displayName = "NutAudio";
|
|
21628
|
-
const defaultProps$
|
|
21590
|
+
const defaultProps$n = {
|
|
21629
21591
|
...ComponentDefaults,
|
|
21630
21592
|
maxContent: "",
|
|
21631
21593
|
max: "",
|
|
@@ -21636,7 +21598,7 @@ const defaultProps$o = {
|
|
|
21636
21598
|
};
|
|
21637
21599
|
const classPrefix$5 = `nut-avatar-group`;
|
|
21638
21600
|
const AvatarGroup = (props) => {
|
|
21639
|
-
const propAvatarGroup = { ...defaultProps$
|
|
21601
|
+
const propAvatarGroup = { ...defaultProps$n, ...props };
|
|
21640
21602
|
const { className, style, children } = propAvatarGroup;
|
|
21641
21603
|
const avatarGroupRef = useRef(null);
|
|
21642
21604
|
const cls = classNames(classPrefix$5, className);
|
|
@@ -21646,9 +21608,9 @@ const AvatarGroup = (props) => {
|
|
|
21646
21608
|
};
|
|
21647
21609
|
return /* @__PURE__ */ React__default.createElement(AvatarContext.Provider, { value: parentAvatar }, /* @__PURE__ */ React__default.createElement("div", { className: cls, style, ref: avatarGroupRef }, children));
|
|
21648
21610
|
};
|
|
21649
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
21611
|
+
AvatarGroup.defaultProps = defaultProps$n;
|
|
21650
21612
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
21651
|
-
const defaultProps$
|
|
21613
|
+
const defaultProps$m = {
|
|
21652
21614
|
...ComponentDefaults,
|
|
21653
21615
|
strokeWidth: 5,
|
|
21654
21616
|
radius: 50,
|
|
@@ -21673,7 +21635,7 @@ const CircleProgress = (props) => {
|
|
|
21673
21635
|
strokeLinecap,
|
|
21674
21636
|
...restProps
|
|
21675
21637
|
} = {
|
|
21676
|
-
...defaultProps$
|
|
21638
|
+
...defaultProps$m,
|
|
21677
21639
|
...props
|
|
21678
21640
|
};
|
|
21679
21641
|
const classes = classNames(className, classPrefix$4);
|
|
@@ -21742,7 +21704,7 @@ const CircleProgress = (props) => {
|
|
|
21742
21704
|
}
|
|
21743
21705
|
)), /* @__PURE__ */ React__default.createElement("div", { className: "nut-circleprogress-text" }, children));
|
|
21744
21706
|
};
|
|
21745
|
-
CircleProgress.defaultProps = defaultProps$
|
|
21707
|
+
CircleProgress.defaultProps = defaultProps$m;
|
|
21746
21708
|
CircleProgress.displayName = "NutCircleProgress";
|
|
21747
21709
|
const collapseContext = {
|
|
21748
21710
|
isOpen: (name) => {
|
|
@@ -21754,7 +21716,7 @@ const collapseContext = {
|
|
|
21754
21716
|
rotate: 180
|
|
21755
21717
|
};
|
|
21756
21718
|
const CollapseContext = createContext(collapseContext);
|
|
21757
|
-
const defaultProps$
|
|
21719
|
+
const defaultProps$l = {
|
|
21758
21720
|
...ComponentDefaults,
|
|
21759
21721
|
title: null,
|
|
21760
21722
|
name: "",
|
|
@@ -21776,7 +21738,7 @@ const CollapseItem = (props) => {
|
|
|
21776
21738
|
extra,
|
|
21777
21739
|
...rest
|
|
21778
21740
|
} = {
|
|
21779
|
-
...defaultProps$
|
|
21741
|
+
...defaultProps$l,
|
|
21780
21742
|
...props
|
|
21781
21743
|
};
|
|
21782
21744
|
const classPrefix2 = "nut-collapse-item";
|
|
@@ -21843,9 +21805,9 @@ const CollapseItem = (props) => {
|
|
|
21843
21805
|
/* @__PURE__ */ React__default.createElement("div", { ref: contentRef, className: `${classPrefix2}__content-text` }, children)
|
|
21844
21806
|
));
|
|
21845
21807
|
};
|
|
21846
|
-
CollapseItem.defaultProps = defaultProps$
|
|
21808
|
+
CollapseItem.defaultProps = defaultProps$l;
|
|
21847
21809
|
CollapseItem.displayName = "NutCollapseItem";
|
|
21848
|
-
const defaultProps$
|
|
21810
|
+
const defaultProps$k = {
|
|
21849
21811
|
...ComponentDefaults,
|
|
21850
21812
|
defaultActiveName: [],
|
|
21851
21813
|
accordion: false,
|
|
@@ -21864,7 +21826,7 @@ const Collapse = (props) => {
|
|
|
21864
21826
|
rotate,
|
|
21865
21827
|
onChange
|
|
21866
21828
|
} = {
|
|
21867
|
-
...defaultProps$
|
|
21829
|
+
...defaultProps$k,
|
|
21868
21830
|
...props
|
|
21869
21831
|
};
|
|
21870
21832
|
const classPrefix2 = "nut-collapse";
|
|
@@ -21921,10 +21883,10 @@ const Collapse = (props) => {
|
|
|
21921
21883
|
/* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix2, className), style }, children)
|
|
21922
21884
|
);
|
|
21923
21885
|
};
|
|
21924
|
-
Collapse.defaultProps = defaultProps$
|
|
21886
|
+
Collapse.defaultProps = defaultProps$k;
|
|
21925
21887
|
Collapse.displayName = "NutCollapse";
|
|
21926
21888
|
Collapse.Item = CollapseItem;
|
|
21927
|
-
const defaultProps$
|
|
21889
|
+
const defaultProps$j = {
|
|
21928
21890
|
...ComponentDefaults,
|
|
21929
21891
|
paused: false,
|
|
21930
21892
|
startTime: Date.now(),
|
|
@@ -21956,7 +21918,7 @@ const InternalCountDown = (props, ref) => {
|
|
|
21956
21918
|
onUpdate,
|
|
21957
21919
|
children,
|
|
21958
21920
|
...rest
|
|
21959
|
-
} = { ...defaultProps$
|
|
21921
|
+
} = { ...defaultProps$j, ...props };
|
|
21960
21922
|
const classPrefix2 = "nut-countdown";
|
|
21961
21923
|
const [restTimeStamp, setRestTime] = useState(0);
|
|
21962
21924
|
const stateRef = useRef({
|
|
@@ -22167,9 +22129,9 @@ const InternalCountDown = (props, ref) => {
|
|
|
22167
22129
|
);
|
|
22168
22130
|
};
|
|
22169
22131
|
const CountDown = React__default.forwardRef(InternalCountDown);
|
|
22170
|
-
CountDown.defaultProps = defaultProps$
|
|
22132
|
+
CountDown.defaultProps = defaultProps$j;
|
|
22171
22133
|
CountDown.displayName = "NutCountDown";
|
|
22172
|
-
const defaultProps$
|
|
22134
|
+
const defaultProps$i = {
|
|
22173
22135
|
...ComponentDefaults,
|
|
22174
22136
|
content: "",
|
|
22175
22137
|
direction: "end",
|
|
@@ -22195,7 +22157,7 @@ const Ellipsis = (props) => {
|
|
|
22195
22157
|
onClick,
|
|
22196
22158
|
onChange,
|
|
22197
22159
|
...rest
|
|
22198
|
-
} = { ...defaultProps$
|
|
22160
|
+
} = { ...defaultProps$i, ...props };
|
|
22199
22161
|
let container = null;
|
|
22200
22162
|
let maxHeight = 0;
|
|
22201
22163
|
const [exceeded, setExceeded] = useState(false);
|
|
@@ -22343,9 +22305,9 @@ const Ellipsis = (props) => {
|
|
|
22343
22305
|
collapseText
|
|
22344
22306
|
) : null) : null));
|
|
22345
22307
|
};
|
|
22346
|
-
Ellipsis.defaultProps = defaultProps$
|
|
22308
|
+
Ellipsis.defaultProps = defaultProps$i;
|
|
22347
22309
|
Ellipsis.displayName = "NutEllipsis";
|
|
22348
|
-
const defaultProps$
|
|
22310
|
+
const defaultProps$h = {
|
|
22349
22311
|
...ComponentDefaults,
|
|
22350
22312
|
source: {
|
|
22351
22313
|
type: {},
|
|
@@ -22373,7 +22335,7 @@ const Video = (props) => {
|
|
|
22373
22335
|
onPlayEnd,
|
|
22374
22336
|
...restProps
|
|
22375
22337
|
} = {
|
|
22376
|
-
...defaultProps$
|
|
22338
|
+
...defaultProps$h,
|
|
22377
22339
|
...props
|
|
22378
22340
|
};
|
|
22379
22341
|
const rootRef = useRef(null);
|
|
@@ -22423,10 +22385,10 @@ const Video = (props) => {
|
|
|
22423
22385
|
/* @__PURE__ */ React__default.createElement("track", { kind: "captions" })
|
|
22424
22386
|
));
|
|
22425
22387
|
};
|
|
22426
|
-
Video.defaultProps = defaultProps$
|
|
22388
|
+
Video.defaultProps = defaultProps$h;
|
|
22427
22389
|
Video.displayName = "NutVideo";
|
|
22428
22390
|
const DataContext$1 = createContext({});
|
|
22429
|
-
const defaultProps$
|
|
22391
|
+
const defaultProps$g = {
|
|
22430
22392
|
total: 3,
|
|
22431
22393
|
current: 0,
|
|
22432
22394
|
direction: "horizontal"
|
|
@@ -22434,7 +22396,7 @@ const defaultProps$h = {
|
|
|
22434
22396
|
const classPrefix$1 = `nut-indicator`;
|
|
22435
22397
|
const Indicator = (props) => {
|
|
22436
22398
|
const { total, current, children, className, direction, ...rest } = {
|
|
22437
|
-
...defaultProps$
|
|
22399
|
+
...defaultProps$g,
|
|
22438
22400
|
...props
|
|
22439
22401
|
};
|
|
22440
22402
|
const classes = classNames({
|
|
@@ -22457,9 +22419,9 @@ const Indicator = (props) => {
|
|
|
22457
22419
|
};
|
|
22458
22420
|
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(classes, className), ...rest }, renderElement());
|
|
22459
22421
|
};
|
|
22460
|
-
Indicator.defaultProps = defaultProps$
|
|
22422
|
+
Indicator.defaultProps = defaultProps$g;
|
|
22461
22423
|
Indicator.displayName = "NutIndicator";
|
|
22462
|
-
const defaultProps$
|
|
22424
|
+
const defaultProps$f = {
|
|
22463
22425
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
22464
22426
|
height: 0,
|
|
22465
22427
|
duration: 500,
|
|
@@ -22476,7 +22438,7 @@ const defaultProps$g = {
|
|
|
22476
22438
|
};
|
|
22477
22439
|
const DISTANCE = 5;
|
|
22478
22440
|
const Swiper = React__default.forwardRef((props, ref) => {
|
|
22479
|
-
const propSwiper = { ...defaultProps$
|
|
22441
|
+
const propSwiper = { ...defaultProps$f, ...props };
|
|
22480
22442
|
const {
|
|
22481
22443
|
children,
|
|
22482
22444
|
direction,
|
|
@@ -22889,13 +22851,13 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
22889
22851
|
renderIndicator()
|
|
22890
22852
|
));
|
|
22891
22853
|
});
|
|
22892
|
-
Swiper.defaultProps = defaultProps$
|
|
22854
|
+
Swiper.defaultProps = defaultProps$f;
|
|
22893
22855
|
Swiper.displayName = "NutSwiper";
|
|
22894
|
-
const defaultProps$
|
|
22856
|
+
const defaultProps$e = {
|
|
22895
22857
|
direction: "horizontal"
|
|
22896
22858
|
};
|
|
22897
22859
|
const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
22898
|
-
const _props = { ...defaultProps$
|
|
22860
|
+
const _props = { ...defaultProps$e, ...props };
|
|
22899
22861
|
const { className, style, children, direction, size } = _props;
|
|
22900
22862
|
const parent = useContext(DataContext$1);
|
|
22901
22863
|
const b = cn("swiper-item");
|
|
@@ -22911,9 +22873,9 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
|
22911
22873
|
};
|
|
22912
22874
|
return /* @__PURE__ */ React__default.createElement("div", { className: classes, style: { ...style, ...getStyle() } }, children);
|
|
22913
22875
|
});
|
|
22914
|
-
SwiperItem.defaultProps = defaultProps$
|
|
22876
|
+
SwiperItem.defaultProps = defaultProps$e;
|
|
22915
22877
|
SwiperItem.displayName = "NutSwiperItem";
|
|
22916
|
-
const defaultProps$
|
|
22878
|
+
const defaultProps$d = {
|
|
22917
22879
|
...ComponentDefaults,
|
|
22918
22880
|
images: [],
|
|
22919
22881
|
videos: [],
|
|
@@ -23115,7 +23077,7 @@ const ImagePreview = (props) => {
|
|
|
23115
23077
|
/* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0))
|
|
23116
23078
|
);
|
|
23117
23079
|
};
|
|
23118
|
-
ImagePreview.defaultProps = defaultProps$
|
|
23080
|
+
ImagePreview.defaultProps = defaultProps$d;
|
|
23119
23081
|
ImagePreview.displayName = "NutImagePreview";
|
|
23120
23082
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
23121
23083
|
let index = 0;
|
|
@@ -23228,7 +23190,7 @@ const updateItemSize = (positions, items, sizeKey) => {
|
|
|
23228
23190
|
}
|
|
23229
23191
|
});
|
|
23230
23192
|
};
|
|
23231
|
-
const defaultProps$
|
|
23193
|
+
const defaultProps$c = {
|
|
23232
23194
|
...ComponentDefaults,
|
|
23233
23195
|
list: [],
|
|
23234
23196
|
itemHeight: 66,
|
|
@@ -23250,7 +23212,7 @@ const VirtualList = (props) => {
|
|
|
23250
23212
|
containerHeight,
|
|
23251
23213
|
...rest
|
|
23252
23214
|
} = {
|
|
23253
|
-
...defaultProps$
|
|
23215
|
+
...defaultProps$c,
|
|
23254
23216
|
...props
|
|
23255
23217
|
};
|
|
23256
23218
|
const horizontal = direction === "horizontal";
|
|
@@ -23414,9 +23376,9 @@ const VirtualList = (props) => {
|
|
|
23414
23376
|
)
|
|
23415
23377
|
);
|
|
23416
23378
|
};
|
|
23417
|
-
VirtualList.defaultProps = defaultProps$
|
|
23379
|
+
VirtualList.defaultProps = defaultProps$c;
|
|
23418
23380
|
VirtualList.displayName = "NutVirtualList";
|
|
23419
|
-
const defaultProps$
|
|
23381
|
+
const defaultProps$b = {
|
|
23420
23382
|
...ComponentDefaults,
|
|
23421
23383
|
defaultValue: 1,
|
|
23422
23384
|
mode: "multi",
|
|
@@ -23444,7 +23406,7 @@ const Pagination = (props) => {
|
|
|
23444
23406
|
className,
|
|
23445
23407
|
...rest
|
|
23446
23408
|
} = {
|
|
23447
|
-
...defaultProps$
|
|
23409
|
+
...defaultProps$b,
|
|
23448
23410
|
...props
|
|
23449
23411
|
};
|
|
23450
23412
|
const classPrefix2 = "nut-pagination";
|
|
@@ -23526,9 +23488,9 @@ const Pagination = (props) => {
|
|
|
23526
23488
|
next || locale.pagination.next
|
|
23527
23489
|
));
|
|
23528
23490
|
};
|
|
23529
|
-
Pagination.defaultProps = defaultProps$
|
|
23491
|
+
Pagination.defaultProps = defaultProps$b;
|
|
23530
23492
|
Pagination.displayName = "NutPagination";
|
|
23531
|
-
const defaultProps$
|
|
23493
|
+
const defaultProps$a = {
|
|
23532
23494
|
...ComponentDefaults,
|
|
23533
23495
|
price: 0,
|
|
23534
23496
|
symbol: "¥",
|
|
@@ -23551,7 +23513,7 @@ const Price = (props) => {
|
|
|
23551
23513
|
style,
|
|
23552
23514
|
...rest
|
|
23553
23515
|
} = {
|
|
23554
|
-
...defaultProps$
|
|
23516
|
+
...defaultProps$a,
|
|
23555
23517
|
...props
|
|
23556
23518
|
};
|
|
23557
23519
|
const classPrefix2 = "nut-price";
|
|
@@ -23631,10 +23593,10 @@ const Price = (props) => {
|
|
|
23631
23593
|
symbol && position === "after" ? renderSymbol() : null
|
|
23632
23594
|
);
|
|
23633
23595
|
};
|
|
23634
|
-
Price.defaultProps = defaultProps$
|
|
23596
|
+
Price.defaultProps = defaultProps$a;
|
|
23635
23597
|
Price.displayName = "NutPrice";
|
|
23636
23598
|
const DataContext = createContext({});
|
|
23637
|
-
const defaultProps$
|
|
23599
|
+
const defaultProps$9 = {
|
|
23638
23600
|
...ComponentDefaults,
|
|
23639
23601
|
title: "",
|
|
23640
23602
|
description: "",
|
|
@@ -23643,7 +23605,7 @@ const defaultProps$a = {
|
|
|
23643
23605
|
};
|
|
23644
23606
|
const Step = (props) => {
|
|
23645
23607
|
const { children, title, description, value, icon, className, ...restProps } = {
|
|
23646
|
-
...defaultProps$
|
|
23608
|
+
...defaultProps$9,
|
|
23647
23609
|
...props
|
|
23648
23610
|
};
|
|
23649
23611
|
const parent = useContext(DataContext);
|
|
@@ -23677,16 +23639,16 @@ const Step = (props) => {
|
|
|
23677
23639
|
};
|
|
23678
23640
|
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)));
|
|
23679
23641
|
};
|
|
23680
|
-
Step.defaultProps = defaultProps$
|
|
23642
|
+
Step.defaultProps = defaultProps$9;
|
|
23681
23643
|
Step.displayName = "NutStep";
|
|
23682
|
-
const defaultProps$
|
|
23644
|
+
const defaultProps$8 = {
|
|
23683
23645
|
...ComponentDefaults,
|
|
23684
23646
|
value: 0,
|
|
23685
23647
|
direction: "horizontal",
|
|
23686
23648
|
dot: false
|
|
23687
23649
|
};
|
|
23688
23650
|
const Steps = (props) => {
|
|
23689
|
-
const propSteps = { ...defaultProps$
|
|
23651
|
+
const propSteps = { ...defaultProps$8, ...props };
|
|
23690
23652
|
const {
|
|
23691
23653
|
children,
|
|
23692
23654
|
value,
|
|
@@ -23717,9 +23679,9 @@ const Steps = (props) => {
|
|
|
23717
23679
|
children
|
|
23718
23680
|
));
|
|
23719
23681
|
};
|
|
23720
|
-
Steps.defaultProps = defaultProps$
|
|
23682
|
+
Steps.defaultProps = defaultProps$8;
|
|
23721
23683
|
Steps.displayName = "NutSteps";
|
|
23722
|
-
const defaultProps$
|
|
23684
|
+
const defaultProps$7 = {
|
|
23723
23685
|
...ComponentDefaults,
|
|
23724
23686
|
columns: [],
|
|
23725
23687
|
data: [],
|
|
@@ -23731,7 +23693,7 @@ const defaultProps$8 = {
|
|
|
23731
23693
|
};
|
|
23732
23694
|
const Table = (props) => {
|
|
23733
23695
|
const { locale } = useConfig();
|
|
23734
|
-
defaultProps$
|
|
23696
|
+
defaultProps$7.noData = locale.noData;
|
|
23735
23697
|
const {
|
|
23736
23698
|
children,
|
|
23737
23699
|
className,
|
|
@@ -23747,7 +23709,7 @@ const Table = (props) => {
|
|
|
23747
23709
|
onSort,
|
|
23748
23710
|
...rest
|
|
23749
23711
|
} = {
|
|
23750
|
-
...defaultProps$
|
|
23712
|
+
...defaultProps$7,
|
|
23751
23713
|
...props
|
|
23752
23714
|
};
|
|
23753
23715
|
const [curData, setCurData] = useState(data);
|
|
@@ -23830,19 +23792,18 @@ const Table = (props) => {
|
|
|
23830
23792
|
/* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__main__body` }, renderBoyTrs())
|
|
23831
23793
|
), (summary || curData.length === 0) && /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__summary` }, summary || noData));
|
|
23832
23794
|
};
|
|
23833
|
-
Table.defaultProps = defaultProps$
|
|
23795
|
+
Table.defaultProps = defaultProps$7;
|
|
23834
23796
|
Table.displayName = "NutTable";
|
|
23835
|
-
const defaultProps$
|
|
23797
|
+
const defaultProps$6 = {
|
|
23836
23798
|
...ComponentDefaults,
|
|
23837
23799
|
type: "default",
|
|
23800
|
+
background: "",
|
|
23838
23801
|
color: "",
|
|
23839
|
-
textColor: "",
|
|
23840
23802
|
plain: false,
|
|
23841
23803
|
round: false,
|
|
23842
23804
|
mark: false,
|
|
23843
23805
|
closeable: false,
|
|
23844
23806
|
closeIcon: null,
|
|
23845
|
-
prefixCls: "nut-tag",
|
|
23846
23807
|
onClose: (e) => {
|
|
23847
23808
|
},
|
|
23848
23809
|
onClick: (e) => {
|
|
@@ -23852,86 +23813,70 @@ const Tag = (props) => {
|
|
|
23852
23813
|
const {
|
|
23853
23814
|
className,
|
|
23854
23815
|
style,
|
|
23855
|
-
|
|
23816
|
+
background,
|
|
23856
23817
|
plain,
|
|
23857
23818
|
type: type4,
|
|
23858
23819
|
round,
|
|
23859
|
-
prefixCls: prefixCls2,
|
|
23860
23820
|
children,
|
|
23861
23821
|
mark,
|
|
23862
23822
|
closeable,
|
|
23863
23823
|
closeIcon,
|
|
23864
|
-
|
|
23824
|
+
color,
|
|
23865
23825
|
onClick,
|
|
23866
23826
|
onClose
|
|
23867
23827
|
} = {
|
|
23868
|
-
...defaultProps$
|
|
23828
|
+
...defaultProps$6,
|
|
23869
23829
|
...props
|
|
23870
23830
|
};
|
|
23871
|
-
const [
|
|
23872
|
-
const [
|
|
23873
|
-
|
|
23874
|
-
setBtnName(classes());
|
|
23875
|
-
}, [
|
|
23876
|
-
type4,
|
|
23877
|
-
color,
|
|
23878
|
-
textColor,
|
|
23879
|
-
plain,
|
|
23880
|
-
round,
|
|
23881
|
-
mark,
|
|
23882
|
-
closeable,
|
|
23883
|
-
prefixCls2,
|
|
23884
|
-
onClick,
|
|
23885
|
-
onClose,
|
|
23886
|
-
className
|
|
23887
|
-
]);
|
|
23831
|
+
const [tagClass, setTagClass] = useState("");
|
|
23832
|
+
const [visible, setVisible] = useState(true);
|
|
23833
|
+
const classPrefix2 = "nut-tag";
|
|
23888
23834
|
const classes = () => {
|
|
23889
|
-
const prefixCls22 = "nut-tag";
|
|
23890
23835
|
return classNames({
|
|
23891
|
-
[
|
|
23892
|
-
[`${
|
|
23893
|
-
[`${
|
|
23894
|
-
[`${
|
|
23895
|
-
[`${
|
|
23896
|
-
[`${
|
|
23836
|
+
[classPrefix2]: true,
|
|
23837
|
+
[`${classPrefix2}--${type4}`]: type4,
|
|
23838
|
+
[`${classPrefix2}--plain`]: plain,
|
|
23839
|
+
[`${classPrefix2}--round`]: round,
|
|
23840
|
+
[`${classPrefix2}--mark`]: mark,
|
|
23841
|
+
[`${classPrefix2}--close`]: closeable,
|
|
23897
23842
|
[`${className}`]: className
|
|
23898
23843
|
});
|
|
23899
23844
|
};
|
|
23845
|
+
useEffect(() => {
|
|
23846
|
+
setTagClass(classes());
|
|
23847
|
+
}, [type4, background, color, plain, round, mark, closeable, className]);
|
|
23900
23848
|
const handleClick2 = (e) => {
|
|
23901
|
-
|
|
23902
|
-
props.onClick(e);
|
|
23903
|
-
}
|
|
23849
|
+
onClick && onClick(e);
|
|
23904
23850
|
};
|
|
23905
23851
|
const getStyle = () => {
|
|
23906
23852
|
const style2 = {};
|
|
23907
|
-
if (
|
|
23908
|
-
style2.color = textColor;
|
|
23909
|
-
} else if (color && plain) {
|
|
23853
|
+
if (color) {
|
|
23910
23854
|
style2.color = color;
|
|
23855
|
+
} else if (background && plain) {
|
|
23856
|
+
style2.color = background;
|
|
23911
23857
|
}
|
|
23912
23858
|
if (plain) {
|
|
23913
|
-
style2.
|
|
23914
|
-
|
|
23915
|
-
|
|
23916
|
-
style2.background = color;
|
|
23859
|
+
style2.borderColor = background;
|
|
23860
|
+
} else if (background) {
|
|
23861
|
+
style2.background = background;
|
|
23917
23862
|
}
|
|
23918
23863
|
return style2;
|
|
23919
23864
|
};
|
|
23920
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, closeable ?
|
|
23865
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, closeable ? visible && /* @__PURE__ */ React__default.createElement(
|
|
23921
23866
|
"div",
|
|
23922
23867
|
{
|
|
23923
|
-
className:
|
|
23868
|
+
className: tagClass,
|
|
23924
23869
|
style: { ...style, ...getStyle() },
|
|
23925
23870
|
onClick: (e) => handleClick2(e)
|
|
23926
23871
|
},
|
|
23927
|
-
children && /* @__PURE__ */ React__default.createElement("span", { className:
|
|
23872
|
+
children && /* @__PURE__ */ React__default.createElement("span", { className: `${classPrefix2}-text` }, children),
|
|
23928
23873
|
React__default.isValidElement(closeIcon) ? /* @__PURE__ */ React__default.createElement(
|
|
23929
23874
|
"i",
|
|
23930
23875
|
{
|
|
23931
|
-
className:
|
|
23876
|
+
className: `${classPrefix2}-custom-icon`,
|
|
23932
23877
|
onClick: (e) => {
|
|
23933
|
-
|
|
23934
|
-
|
|
23878
|
+
setVisible(false);
|
|
23879
|
+
onClose && onClose(e);
|
|
23935
23880
|
}
|
|
23936
23881
|
},
|
|
23937
23882
|
closeIcon
|
|
@@ -23941,24 +23886,24 @@ const Tag = (props) => {
|
|
|
23941
23886
|
width: 12,
|
|
23942
23887
|
height: 12,
|
|
23943
23888
|
onClick: (e) => {
|
|
23944
|
-
|
|
23945
|
-
|
|
23889
|
+
setVisible(false);
|
|
23890
|
+
onClose && onClose(e);
|
|
23946
23891
|
}
|
|
23947
23892
|
}
|
|
23948
23893
|
)
|
|
23949
23894
|
) : /* @__PURE__ */ React__default.createElement(
|
|
23950
23895
|
"div",
|
|
23951
23896
|
{
|
|
23952
|
-
className:
|
|
23897
|
+
className: tagClass,
|
|
23953
23898
|
style: { ...style, ...getStyle() },
|
|
23954
23899
|
onClick: (e) => handleClick2(e)
|
|
23955
23900
|
},
|
|
23956
|
-
children && /* @__PURE__ */ React__default.createElement("span", { className:
|
|
23901
|
+
children && /* @__PURE__ */ React__default.createElement("span", { className: `${classPrefix2}-text` }, children)
|
|
23957
23902
|
));
|
|
23958
23903
|
};
|
|
23959
|
-
Tag.defaultProps = defaultProps$
|
|
23904
|
+
Tag.defaultProps = defaultProps$6;
|
|
23960
23905
|
Tag.displayName = "NutTag";
|
|
23961
|
-
const defaultProps$
|
|
23906
|
+
const defaultProps$5 = {
|
|
23962
23907
|
...ComponentDefaults,
|
|
23963
23908
|
list: [],
|
|
23964
23909
|
interval: 500,
|
|
@@ -23979,7 +23924,7 @@ const InternalBarrage = (props, ref) => {
|
|
|
23979
23924
|
gapY,
|
|
23980
23925
|
...restProps
|
|
23981
23926
|
} = {
|
|
23982
|
-
...defaultProps$
|
|
23927
|
+
...defaultProps$5,
|
|
23983
23928
|
...props
|
|
23984
23929
|
};
|
|
23985
23930
|
const barrageBody = useRef(null);
|
|
@@ -24045,250 +23990,243 @@ const InternalBarrage = (props, ref) => {
|
|
|
24045
23990
|
return /* @__PURE__ */ React__default.createElement("div", { className: classes, ref: barrageBody, ...restProps }, /* @__PURE__ */ React__default.createElement("div", { ref: barrageContainer, className: "bContainer" }));
|
|
24046
23991
|
};
|
|
24047
23992
|
const Barrage = React__default.forwardRef(InternalBarrage);
|
|
24048
|
-
Barrage.defaultProps = defaultProps$
|
|
23993
|
+
Barrage.defaultProps = defaultProps$5;
|
|
24049
23994
|
Barrage.displayName = "NutBarrage";
|
|
24050
|
-
const defaultProps$
|
|
23995
|
+
const defaultProps$4 = {
|
|
23996
|
+
...ComponentDefaults,
|
|
23997
|
+
src: "",
|
|
23998
|
+
title: "",
|
|
23999
|
+
price: "",
|
|
24000
|
+
vipPrice: "",
|
|
24001
|
+
shopDescription: "",
|
|
24002
|
+
delivery: "",
|
|
24003
|
+
shopName: "",
|
|
24004
|
+
description: "",
|
|
24005
|
+
tag: "",
|
|
24006
|
+
priceTag: "",
|
|
24007
|
+
extra: ""
|
|
24008
|
+
};
|
|
24051
24009
|
const Card = (props) => {
|
|
24052
24010
|
const {
|
|
24053
24011
|
className,
|
|
24054
24012
|
style,
|
|
24055
|
-
|
|
24013
|
+
src,
|
|
24056
24014
|
title,
|
|
24057
24015
|
price,
|
|
24058
24016
|
vipPrice,
|
|
24059
|
-
|
|
24017
|
+
shopDescription,
|
|
24060
24018
|
delivery,
|
|
24061
24019
|
shopName,
|
|
24062
|
-
|
|
24063
|
-
|
|
24064
|
-
|
|
24065
|
-
|
|
24020
|
+
tag,
|
|
24021
|
+
priceTag,
|
|
24022
|
+
description,
|
|
24023
|
+
extra,
|
|
24066
24024
|
...rest
|
|
24067
24025
|
} = {
|
|
24068
|
-
...defaultProps$
|
|
24026
|
+
...defaultProps$4,
|
|
24069
24027
|
...props
|
|
24070
24028
|
};
|
|
24071
|
-
const
|
|
24072
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(
|
|
24029
|
+
const classPrefix2 = "nut-card";
|
|
24030
|
+
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(
|
|
24031
|
+
Price,
|
|
24032
|
+
{
|
|
24033
|
+
size: "normal",
|
|
24034
|
+
className: `${classPrefix2}right-price-origin`,
|
|
24035
|
+
price: vipPrice
|
|
24036
|
+
}
|
|
24037
|
+
)), /* @__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)));
|
|
24073
24038
|
};
|
|
24074
|
-
Card.defaultProps = defaultProps$
|
|
24039
|
+
Card.defaultProps = defaultProps$4;
|
|
24075
24040
|
Card.displayName = "NutCard";
|
|
24076
|
-
const defaultProps$
|
|
24077
|
-
|
|
24078
|
-
|
|
24079
|
-
|
|
24080
|
-
|
|
24081
|
-
|
|
24041
|
+
const defaultProps$3 = {
|
|
24042
|
+
...ComponentDefaults,
|
|
24043
|
+
activeDate: "",
|
|
24044
|
+
activeTime: [],
|
|
24045
|
+
options: [],
|
|
24046
|
+
optionKey: {
|
|
24047
|
+
valueKey: "value",
|
|
24048
|
+
textKey: "text",
|
|
24049
|
+
childrenKey: "children"
|
|
24050
|
+
},
|
|
24051
|
+
onSelect: () => {
|
|
24052
|
+
}
|
|
24082
24053
|
};
|
|
24083
24054
|
const TimeDetail = (props) => {
|
|
24084
|
-
|
|
24085
|
-
|
|
24086
|
-
...defaultProps$4,
|
|
24055
|
+
const { options: options2, optionKey, className, activeDate, activeTime, onSelect } = {
|
|
24056
|
+
...defaultProps$3,
|
|
24087
24057
|
...props
|
|
24088
24058
|
};
|
|
24089
|
-
const
|
|
24090
|
-
const
|
|
24091
|
-
|
|
24092
|
-
|
|
24093
|
-
|
|
24094
|
-
|
|
24095
|
-
|
|
24096
|
-
|
|
24097
|
-
|
|
24098
|
-
|
|
24099
|
-
|
|
24100
|
-
|
|
24101
|
-
|
|
24102
|
-
|
|
24103
|
-
|
|
24104
|
-
|
|
24105
|
-
|
|
24106
|
-
|
|
24107
|
-
|
|
24108
|
-
|
|
24109
|
-
|
|
24110
|
-
|
|
24111
|
-
|
|
24059
|
+
const classPrefix2 = "nut-timedetail";
|
|
24060
|
+
const timeList = useMemo(() => {
|
|
24061
|
+
return (options2 == null ? void 0 : options2.find(
|
|
24062
|
+
(item) => item[optionKey.valueKey] === activeDate
|
|
24063
|
+
)) || {
|
|
24064
|
+
[optionKey.childrenKey]: []
|
|
24065
|
+
};
|
|
24066
|
+
}, [options2, optionKey, activeDate]);
|
|
24067
|
+
const isActive = useCallback(
|
|
24068
|
+
(timeKey) => {
|
|
24069
|
+
const date4 = activeTime.find((item) => {
|
|
24070
|
+
return item[optionKey.valueKey] === activeDate;
|
|
24071
|
+
});
|
|
24072
|
+
if (date4 == null ? void 0 : date4[optionKey.childrenKey]) {
|
|
24073
|
+
const time = date4 == null ? void 0 : date4[optionKey.childrenKey].find((time2) => {
|
|
24074
|
+
return time2[optionKey.valueKey] === timeKey;
|
|
24075
|
+
});
|
|
24076
|
+
return time;
|
|
24077
|
+
}
|
|
24078
|
+
return false;
|
|
24079
|
+
},
|
|
24080
|
+
[activeTime, optionKey, activeDate]
|
|
24081
|
+
);
|
|
24082
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(classPrefix2, className) }, timeList[optionKey.childrenKey].map((item) => /* @__PURE__ */ React__default.createElement(
|
|
24112
24083
|
"span",
|
|
24113
24084
|
{
|
|
24114
|
-
className:
|
|
24115
|
-
|
|
24116
|
-
|
|
24085
|
+
className: classNames(`${classPrefix2}__item`, {
|
|
24086
|
+
active: isActive(item[optionKey.valueKey])
|
|
24087
|
+
}),
|
|
24088
|
+
key: item[optionKey.valueKey],
|
|
24089
|
+
onClick: () => onSelect(item)
|
|
24117
24090
|
},
|
|
24118
|
-
item
|
|
24091
|
+
item[optionKey.textKey]
|
|
24119
24092
|
)));
|
|
24120
24093
|
};
|
|
24121
|
-
TimeDetail.defaultProps = defaultProps$
|
|
24094
|
+
TimeDetail.defaultProps = defaultProps$3;
|
|
24122
24095
|
TimeDetail.displayName = "NutTimeDetail";
|
|
24123
|
-
const defaultProps$3 = {
|
|
24124
|
-
className: "",
|
|
24125
|
-
date: "",
|
|
24126
|
-
curKey: 0
|
|
24127
|
-
};
|
|
24128
|
-
const TimePannel = (props) => {
|
|
24129
|
-
useConfig();
|
|
24130
|
-
const { children, className, date: date4, curKey, change } = {
|
|
24131
|
-
...defaultProps$3,
|
|
24132
|
-
...props
|
|
24133
|
-
};
|
|
24134
|
-
const b = cn("timepannel");
|
|
24135
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${b()} ${className || ""}`, onClick: () => change(curKey) }, date4);
|
|
24136
|
-
};
|
|
24137
|
-
TimePannel.defaultProps = defaultProps$3;
|
|
24138
|
-
TimePannel.displayName = "NutTimePannel";
|
|
24139
24096
|
const defaultProps$2 = {
|
|
24140
|
-
|
|
24141
|
-
style: {},
|
|
24097
|
+
...ComponentDefaults,
|
|
24142
24098
|
visible: false,
|
|
24143
|
-
height: "20%",
|
|
24144
24099
|
multiple: false,
|
|
24145
|
-
|
|
24146
|
-
|
|
24147
|
-
|
|
24148
|
-
|
|
24149
|
-
|
|
24100
|
+
defaultValue: [],
|
|
24101
|
+
options: [],
|
|
24102
|
+
optionKey: {
|
|
24103
|
+
valueKey: "value",
|
|
24104
|
+
textKey: "text",
|
|
24105
|
+
childrenKey: "children"
|
|
24106
|
+
}
|
|
24150
24107
|
};
|
|
24151
24108
|
const TimeSelect = (props) => {
|
|
24152
|
-
useConfig();
|
|
24109
|
+
const { locale } = useConfig();
|
|
24153
24110
|
const {
|
|
24154
24111
|
visible,
|
|
24155
24112
|
className,
|
|
24156
|
-
|
|
24113
|
+
style,
|
|
24157
24114
|
title,
|
|
24158
|
-
|
|
24159
|
-
|
|
24160
|
-
|
|
24161
|
-
times,
|
|
24115
|
+
defaultValue,
|
|
24116
|
+
options: options2,
|
|
24117
|
+
optionKey,
|
|
24162
24118
|
multiple,
|
|
24163
|
-
select,
|
|
24164
|
-
pannelChange,
|
|
24165
|
-
timeChange,
|
|
24166
24119
|
onSelect,
|
|
24167
|
-
|
|
24168
|
-
onTimeChange
|
|
24120
|
+
onDateChange,
|
|
24121
|
+
onTimeChange,
|
|
24122
|
+
...rest
|
|
24169
24123
|
} = {
|
|
24170
24124
|
...defaultProps$2,
|
|
24171
24125
|
...props
|
|
24172
24126
|
};
|
|
24173
|
-
const [
|
|
24127
|
+
const [activeDate, setActiveDate] = useState(() => {
|
|
24128
|
+
if (defaultValue == null ? void 0 : defaultValue.length) {
|
|
24129
|
+
return defaultValue[0][optionKey.valueKey];
|
|
24130
|
+
}
|
|
24131
|
+
if (options2 == null ? void 0 : options2.length) {
|
|
24132
|
+
return options2[0][optionKey.valueKey];
|
|
24133
|
+
}
|
|
24134
|
+
return "";
|
|
24135
|
+
});
|
|
24174
24136
|
const [activeTime, setActiveTime] = useState(
|
|
24175
|
-
|
|
24176
|
-
{
|
|
24177
|
-
key: currentKey,
|
|
24178
|
-
list: []
|
|
24179
|
-
}
|
|
24180
|
-
]
|
|
24137
|
+
() => defaultValue || []
|
|
24181
24138
|
);
|
|
24182
|
-
const
|
|
24183
|
-
const popStyle = {
|
|
24184
|
-
width: "100%",
|
|
24185
|
-
height
|
|
24186
|
-
};
|
|
24187
|
-
const b = cn("timeselect");
|
|
24139
|
+
const classPrefix2 = "nut-timeselect";
|
|
24188
24140
|
const closeFun = () => {
|
|
24189
|
-
|
|
24190
|
-
|
|
24191
|
-
|
|
24192
|
-
|
|
24193
|
-
|
|
24194
|
-
|
|
24195
|
-
|
|
24196
|
-
|
|
24197
|
-
|
|
24198
|
-
|
|
24199
|
-
|
|
24200
|
-
|
|
24201
|
-
|
|
24202
|
-
|
|
24203
|
-
|
|
24204
|
-
|
|
24205
|
-
|
|
24206
|
-
|
|
24207
|
-
);
|
|
24208
|
-
if (curTimeIndex === -1) {
|
|
24209
|
-
curTimeData.list.push(time);
|
|
24210
|
-
} else {
|
|
24211
|
-
curTimeData.list.splice(curTimeIndex, 1);
|
|
24212
|
-
}
|
|
24213
|
-
const resultTimeData = [...activeTime];
|
|
24214
|
-
resultTimeData.splice(curIndex, 1, curTimeData);
|
|
24215
|
-
setActiveTime(resultTimeData);
|
|
24216
|
-
if (onTimeChange) {
|
|
24217
|
-
onTimeChange(time, resultTimeData);
|
|
24218
|
-
} else if (timeChange) {
|
|
24219
|
-
timeChange(time, resultTimeData);
|
|
24220
|
-
}
|
|
24221
|
-
};
|
|
24222
|
-
const handleChange = (pannelKey) => {
|
|
24223
|
-
const resultTimeData = [...activeTime];
|
|
24224
|
-
if (String(pannelKey) !== String(activeKey)) {
|
|
24225
|
-
setActiveKey == null ? void 0 : setActiveKey(pannelKey);
|
|
24226
|
-
if (multiple) {
|
|
24227
|
-
const curTimeDataIndex = activeTime.findIndex(
|
|
24228
|
-
(item) => String(item.key) === String(pannelKey)
|
|
24229
|
-
);
|
|
24230
|
-
if (curTimeDataIndex === -1) {
|
|
24231
|
-
resultTimeData.push({
|
|
24232
|
-
key: pannelKey,
|
|
24233
|
-
list: []
|
|
24234
|
-
});
|
|
24235
|
-
setActiveTime(resultTimeData);
|
|
24141
|
+
onSelect && onSelect(activeTime);
|
|
24142
|
+
};
|
|
24143
|
+
const handleSelectTime = (selectTime) => {
|
|
24144
|
+
let newActiveTime = [...activeTime];
|
|
24145
|
+
const date4 = newActiveTime.find((item) => {
|
|
24146
|
+
return item[optionKey.valueKey] === activeDate;
|
|
24147
|
+
});
|
|
24148
|
+
if (date4) {
|
|
24149
|
+
const timeIndex = date4[optionKey.childrenKey].findIndex(
|
|
24150
|
+
(time) => {
|
|
24151
|
+
return time[optionKey.valueKey] === selectTime[optionKey.valueKey];
|
|
24152
|
+
}
|
|
24153
|
+
);
|
|
24154
|
+
if (timeIndex > -1) {
|
|
24155
|
+
if (multiple) {
|
|
24156
|
+
date4[optionKey.childrenKey].splice(timeIndex, 1);
|
|
24157
|
+
} else {
|
|
24158
|
+
newActiveTime = [];
|
|
24236
24159
|
}
|
|
24160
|
+
} else if (multiple) {
|
|
24161
|
+
date4[optionKey.childrenKey].push({ ...selectTime });
|
|
24237
24162
|
} else {
|
|
24238
|
-
|
|
24163
|
+
newActiveTime = [
|
|
24239
24164
|
{
|
|
24240
|
-
|
|
24241
|
-
|
|
24165
|
+
[optionKey.valueKey]: activeDate,
|
|
24166
|
+
[optionKey.childrenKey]: [{ ...selectTime }]
|
|
24242
24167
|
}
|
|
24243
|
-
]
|
|
24168
|
+
];
|
|
24244
24169
|
}
|
|
24170
|
+
} else if (multiple) {
|
|
24171
|
+
newActiveTime.push({
|
|
24172
|
+
[optionKey.valueKey]: activeDate,
|
|
24173
|
+
[optionKey.childrenKey]: [{ ...selectTime }]
|
|
24174
|
+
});
|
|
24175
|
+
} else {
|
|
24176
|
+
newActiveTime = [
|
|
24177
|
+
{
|
|
24178
|
+
[optionKey.valueKey]: activeDate,
|
|
24179
|
+
[optionKey.childrenKey]: [{ ...selectTime }]
|
|
24180
|
+
}
|
|
24181
|
+
];
|
|
24245
24182
|
}
|
|
24246
|
-
|
|
24247
|
-
|
|
24248
|
-
|
|
24249
|
-
|
|
24250
|
-
|
|
24183
|
+
newActiveTime = newActiveTime.filter((item) => {
|
|
24184
|
+
var _a2;
|
|
24185
|
+
return ((_a2 = item[optionKey.childrenKey]) == null ? void 0 : _a2.length) > 0;
|
|
24186
|
+
});
|
|
24187
|
+
setActiveTime(newActiveTime);
|
|
24188
|
+
onTimeChange && onTimeChange(selectTime, newActiveTime);
|
|
24251
24189
|
};
|
|
24252
|
-
const
|
|
24253
|
-
|
|
24254
|
-
|
|
24255
|
-
}
|
|
24256
|
-
return "";
|
|
24190
|
+
const handleChange = (date4) => {
|
|
24191
|
+
setActiveDate(date4[optionKey.valueKey]);
|
|
24192
|
+
onDateChange && onDateChange(date4, activeTime);
|
|
24257
24193
|
};
|
|
24258
|
-
|
|
24259
|
-
setPopVisible(visible);
|
|
24260
|
-
}, [visible]);
|
|
24261
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
24194
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
24262
24195
|
Popup,
|
|
24263
24196
|
{
|
|
24264
24197
|
closeable: true,
|
|
24265
24198
|
round: true,
|
|
24266
|
-
visible
|
|
24199
|
+
visible,
|
|
24267
24200
|
position: "bottom",
|
|
24268
|
-
style:
|
|
24269
|
-
|
|
24270
|
-
|
|
24271
|
-
|
|
24201
|
+
style: {
|
|
24202
|
+
width: "100%",
|
|
24203
|
+
height: "20%",
|
|
24204
|
+
...style
|
|
24205
|
+
},
|
|
24206
|
+
onClose: closeFun,
|
|
24207
|
+
...rest
|
|
24272
24208
|
},
|
|
24273
|
-
/* @__PURE__ */ React__default.createElement("div", { className:
|
|
24274
|
-
|
|
24209
|
+
/* @__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(
|
|
24210
|
+
"div",
|
|
24275
24211
|
{
|
|
24276
|
-
|
|
24277
|
-
className:
|
|
24278
|
-
|
|
24279
|
-
|
|
24280
|
-
|
|
24281
|
-
}
|
|
24212
|
+
key: item[optionKey.valueKey],
|
|
24213
|
+
className: classNames("nut-timepannel", {
|
|
24214
|
+
active: item[optionKey.valueKey] === activeDate
|
|
24215
|
+
}),
|
|
24216
|
+
onClick: () => handleChange(item)
|
|
24217
|
+
},
|
|
24218
|
+
item[optionKey.textKey]
|
|
24282
24219
|
))), /* @__PURE__ */ React__default.createElement(
|
|
24283
24220
|
TimeDetail,
|
|
24284
24221
|
{
|
|
24285
|
-
|
|
24286
|
-
|
|
24287
|
-
|
|
24288
|
-
|
|
24222
|
+
options: options2,
|
|
24223
|
+
optionKey,
|
|
24224
|
+
activeDate,
|
|
24225
|
+
activeTime,
|
|
24226
|
+
onSelect: handleSelectTime
|
|
24289
24227
|
}
|
|
24290
24228
|
)))
|
|
24291
|
-
)
|
|
24229
|
+
);
|
|
24292
24230
|
};
|
|
24293
24231
|
TimeSelect.defaultProps = defaultProps$2;
|
|
24294
24232
|
TimeSelect.displayName = "NutTimeSelect";
|
|
@@ -24526,7 +24464,7 @@ export {
|
|
|
24526
24464
|
Image$1 as Image,
|
|
24527
24465
|
ImagePreview,
|
|
24528
24466
|
Indicator,
|
|
24529
|
-
|
|
24467
|
+
InfiniteLoading,
|
|
24530
24468
|
Input,
|
|
24531
24469
|
InputNumber,
|
|
24532
24470
|
Layout,
|
|
@@ -24571,7 +24509,6 @@ export {
|
|
|
24571
24509
|
Tag,
|
|
24572
24510
|
TextArea,
|
|
24573
24511
|
TimeDetail,
|
|
24574
|
-
TimePannel,
|
|
24575
24512
|
TimeSelect,
|
|
24576
24513
|
Toast,
|
|
24577
24514
|
TrendArrow,
|