@nutui/nutui-react 2.0.0-alpha.13 → 2.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Avatar.js +1 -1
- package/dist/esm/AvatarGroup.js +1 -1
- package/dist/esm/Barrage/style/style.css +1 -1
- package/dist/esm/Barrage.js +23 -24
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/CircleProgress.js +1 -1
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Picker.js +37 -40
- package/dist/esm/Popover/style/index.js +1 -1
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popover.js +214 -166
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/SideNavBar.js +17 -15
- package/dist/esm/SideNavBarItem/style/style.css +1 -1
- package/dist/esm/SideNavBarItem.js +5 -4
- package/dist/esm/Step.js +1 -1
- package/dist/esm/Steps.js +1 -1
- package/dist/esm/SubSideNavBar/style/style.css +1 -1
- package/dist/esm/SubSideNavBar.js +12 -12
- package/dist/esm/Swiper.js +1 -1
- package/dist/esm/SwiperItem.js +1 -1
- package/dist/esm/TextArea/style/style.css +1 -1
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/context.js +16 -2
- package/dist/esm/context2.js +2 -2
- package/dist/esm/context4.js +5 -0
- package/dist/esm/index.js +11 -2
- package/dist/esm/types/src/packages/barrage/barrage.d.ts +6 -7
- package/dist/esm/types/src/packages/barrage/barrage.taro.d.ts +6 -7
- package/dist/esm/types/src/packages/barrage/index.d.ts +1 -0
- package/dist/esm/types/src/packages/barrage/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/button/button.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
- package/dist/esm/types/src/packages/input/input.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/menu/menu.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/picker/doc.en.d.ts +9 -9
- package/dist/esm/types/src/packages/popover/demo.d.ts +3 -2
- package/dist/esm/types/src/packages/popover/demo.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/popover/index.d.ts +1 -0
- package/dist/esm/types/src/packages/popover/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/popover/popover.d.ts +20 -9
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +20 -10
- package/dist/esm/types/src/packages/sidenavbar/index.d.ts +1 -0
- package/dist/esm/types/src/packages/sidenavbar/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/sidenavbar/sidenavbar.d.ts +5 -9
- package/dist/esm/types/src/packages/sidenavbar/sidenavbar.taro.d.ts +5 -9
- package/dist/esm/types/src/packages/sidenavbaritem/index.d.ts +1 -0
- package/dist/esm/types/src/packages/sidenavbaritem/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/sidenavbaritem/sidenavbaritem.d.ts +3 -3
- package/dist/esm/types/src/packages/sidenavbaritem/sidenavbaritem.taro.d.ts +3 -3
- package/dist/esm/types/src/packages/subsidenavbar/index.d.ts +1 -0
- package/dist/esm/types/src/packages/subsidenavbar/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/subsidenavbar/subsidenavbar.d.ts +3 -3
- package/dist/esm/types/src/packages/subsidenavbar/subsidenavbar.taro.d.ts +3 -3
- package/dist/esm/types/src/utils/index.d.ts +1 -0
- package/dist/esm/types/src/utils/use-click-away.d.ts +3 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/tr-TR.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +407 -269
- package/dist/nutui.react.umd.js +407 -269
- package/dist/packages/barrage/barrage.scss +0 -13
- package/dist/packages/popover/popover.scss +158 -230
- package/dist/packages/popup/popup.scss +36 -0
- package/dist/packages/sidenavbar/sidenavbar.scss +10 -16
- package/dist/packages/sidenavbaritem/sidenavbaritem.scss +7 -19
- package/dist/packages/subsidenavbar/subsidenavbar.scss +10 -19
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +35 -47
- package/dist/styles/variables.scss +45 -57
- package/dist/types/packages/barrage/barrage.d.ts +32 -9
- package/dist/types/packages/barrage/index.d.ts +1 -0
- package/dist/types/packages/button/button.d.ts +1 -0
- package/dist/types/packages/configprovider/types.d.ts +1 -1
- package/dist/types/packages/popover/index.d.ts +1 -0
- package/dist/types/packages/popover/popover.d.ts +99 -12
- package/dist/types/packages/sidenavbar/index.d.ts +1 -0
- package/dist/types/packages/sidenavbar/sidenavbar.d.ts +33 -13
- package/dist/types/packages/sidenavbaritem/index.d.ts +1 -0
- package/dist/types/packages/sidenavbaritem/sidenavbaritem.d.ts +3 -3
- package/dist/types/packages/subsidenavbar/index.d.ts +1 -0
- package/dist/types/packages/subsidenavbar/subsidenavbar.d.ts +3 -3
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/use-click-away.d.ts +3 -0
- package/package.json +1 -1
- package/dist/esm/offsetContext.js +0 -19
- package/dist/esm/types/src/packages/popover/Trigger.d.ts +0 -19
- package/dist/esm/types/src/packages/sidenavbar/type.d.ts +0 -34
- package/dist/types/packages/popover/Trigger.d.ts +0 -19
- /package/dist/esm/types/src/packages/sidenavbar/{offsetContext.d.ts → context.d.ts} +0 -0
- /package/dist/types/packages/sidenavbar/{offsetContext.d.ts → context.d.ts} +0 -0
package/dist/nutui.react.es.js
CHANGED
|
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
var _a;
|
|
8
8
|
/*!
|
|
9
|
-
* @nutui/nutui-react v2.0.0-alpha.
|
|
9
|
+
* @nutui/nutui-react v2.0.0-alpha.14 Fri Jun 02 2023 17:08:20 GMT+0800 (China Standard Time)
|
|
10
10
|
* (c) 2023 @jdf2e.
|
|
11
11
|
* Released under the MIT License.
|
|
12
12
|
*/
|
|
@@ -2486,7 +2486,7 @@ const defaultProps$1r = {
|
|
|
2486
2486
|
onClick: (event) => {
|
|
2487
2487
|
}
|
|
2488
2488
|
};
|
|
2489
|
-
const classPrefix$
|
|
2489
|
+
const classPrefix$m = "nut-cell";
|
|
2490
2490
|
const Cell = (props) => {
|
|
2491
2491
|
const {
|
|
2492
2492
|
children,
|
|
@@ -2517,19 +2517,19 @@ const Cell = (props) => {
|
|
|
2517
2517
|
return /* @__PURE__ */ React__default.createElement(
|
|
2518
2518
|
"div",
|
|
2519
2519
|
{
|
|
2520
|
-
className: classNames(classPrefix$
|
|
2520
|
+
className: classNames(classPrefix$m, 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$m}__left` }, title ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$m}__title` }, title) : null, description ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$m}__description` }, description) : null) : null, extra ? /* @__PURE__ */ React__default.createElement(
|
|
2526
2526
|
"div",
|
|
2527
2527
|
{
|
|
2528
|
-
className: `${classPrefix$
|
|
2528
|
+
className: `${classPrefix$m}__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$m}__divider` }))
|
|
2533
2533
|
);
|
|
2534
2534
|
};
|
|
2535
2535
|
Cell.defaultProps = defaultProps$1r;
|
|
@@ -2540,16 +2540,16 @@ const defaultProps$1q = {
|
|
|
2540
2540
|
description: "",
|
|
2541
2541
|
divider: true
|
|
2542
2542
|
};
|
|
2543
|
-
const classPrefix$
|
|
2543
|
+
const classPrefix$l = "nut-cell-group";
|
|
2544
2544
|
const CellGroup = (props) => {
|
|
2545
2545
|
const { children, className, style, title, description, divider, ...rest } = {
|
|
2546
2546
|
...defaultProps$1q,
|
|
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$l, className), ...rest }, title ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$l}__title` }, title) : null, description ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$l}__description` }, description) : null, /* @__PURE__ */ React__default.createElement(
|
|
2550
2550
|
"div",
|
|
2551
2551
|
{
|
|
2552
|
-
className: `${classPrefix$
|
|
2552
|
+
className: `${classPrefix$l}__wrap ${divider ? `${classPrefix$l}__wrap--divider` : ""}`
|
|
2553
2553
|
},
|
|
2554
2554
|
children
|
|
2555
2555
|
));
|
|
@@ -3026,7 +3026,7 @@ const defaultProps$1o = {
|
|
|
3026
3026
|
loading: true,
|
|
3027
3027
|
lazy: false
|
|
3028
3028
|
};
|
|
3029
|
-
const classPrefix$
|
|
3029
|
+
const classPrefix$k = "nut-image";
|
|
3030
3030
|
const Image$1 = (props) => {
|
|
3031
3031
|
const {
|
|
3032
3032
|
className,
|
|
@@ -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$k, className),
|
|
3141
3141
|
style: containerStyle,
|
|
3142
3142
|
onClick: (e) => {
|
|
3143
3143
|
imageClick(e);
|
|
@@ -3303,21 +3303,21 @@ const defaultProps$1m = {
|
|
|
3303
3303
|
contentPosition: "center",
|
|
3304
3304
|
direction: "horizontal"
|
|
3305
3305
|
};
|
|
3306
|
-
const classPrefix$
|
|
3306
|
+
const classPrefix$j = `nut-divider`;
|
|
3307
3307
|
const Divider = (props) => {
|
|
3308
3308
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
3309
3309
|
...defaultProps$1m,
|
|
3310
3310
|
...props
|
|
3311
3311
|
};
|
|
3312
3312
|
const classes = direction === "horizontal" ? classNames({
|
|
3313
|
-
[`${classPrefix$
|
|
3314
|
-
[`${classPrefix$
|
|
3315
|
-
[`${classPrefix$
|
|
3316
|
-
[`${classPrefix$
|
|
3317
|
-
[`${classPrefix$
|
|
3313
|
+
[`${classPrefix$j}`]: true,
|
|
3314
|
+
[`${classPrefix$j}__center`]: children,
|
|
3315
|
+
[`${classPrefix$j}__left`]: contentPosition === "left",
|
|
3316
|
+
[`${classPrefix$j}__right`]: contentPosition === "right",
|
|
3317
|
+
[`${classPrefix$j}__hairline`]: true
|
|
3318
3318
|
}) : classNames({
|
|
3319
|
-
[`${classPrefix$
|
|
3320
|
-
[`${classPrefix$
|
|
3319
|
+
[`${classPrefix$j}`]: true,
|
|
3320
|
+
[`${classPrefix$j}__vertical`]: direction === "vertical"
|
|
3321
3321
|
});
|
|
3322
3322
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classes} ${className || ""}`, style, ...rest }, children);
|
|
3323
3323
|
};
|
|
@@ -3475,7 +3475,7 @@ const Layout = (props) => {
|
|
|
3475
3475
|
};
|
|
3476
3476
|
Layout.defaultProps = defaultProps$1j;
|
|
3477
3477
|
Layout.displayName = "NutLayout";
|
|
3478
|
-
const classPrefix$
|
|
3478
|
+
const classPrefix$i = "nut-row";
|
|
3479
3479
|
const defaultProps$1i = {
|
|
3480
3480
|
...ComponentDefaults,
|
|
3481
3481
|
type: "",
|
|
@@ -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$i}
|
|
3514
3514
|
`;
|
|
3515
3515
|
};
|
|
3516
3516
|
const parentRow = {
|
|
@@ -3609,7 +3609,7 @@ const defaultProps$1h = {
|
|
|
3609
3609
|
threshold: 0,
|
|
3610
3610
|
zIndex: 2e3
|
|
3611
3611
|
};
|
|
3612
|
-
const classPrefix$
|
|
3612
|
+
const classPrefix$h = "nut-sticky";
|
|
3613
3613
|
const Sticky = (props) => {
|
|
3614
3614
|
const {
|
|
3615
3615
|
position,
|
|
@@ -3731,7 +3731,7 @@ const Sticky = (props) => {
|
|
|
3731
3731
|
{
|
|
3732
3732
|
ref: rootRef,
|
|
3733
3733
|
style: { ...style, ...rootStyle },
|
|
3734
|
-
className: classNames(classPrefix$
|
|
3734
|
+
className: classNames(classPrefix$h, className),
|
|
3735
3735
|
...rest
|
|
3736
3736
|
},
|
|
3737
3737
|
/* @__PURE__ */ React__default.createElement("div", { className: "nut-sticky--box", ref: stickyRef, style: stickyStyle }, children)
|
|
@@ -11242,21 +11242,22 @@ const handleClick = (e) => {
|
|
|
11242
11242
|
const isIcon = e.target.className.includes("arrow-icon");
|
|
11243
11243
|
const isTitle = e.target.className.includes("__title") || isIcon;
|
|
11244
11244
|
const currentClass = e.currentTarget.className;
|
|
11245
|
-
const isShow = currentClass.includes("
|
|
11245
|
+
const isShow = currentClass.includes("sidenavbar-show");
|
|
11246
11246
|
const arrowIcon = e.currentTarget.querySelector(".arrow-icon");
|
|
11247
11247
|
const iconClass = arrowIcon.className;
|
|
11248
11248
|
if (isTitle) {
|
|
11249
|
-
e.currentTarget.className = isShow ? currentClass.replace("
|
|
11249
|
+
e.currentTarget.className = isShow ? currentClass.replace("sidenavbar-show", "sidenavbar-hide") : currentClass.replace("sidenavbar-hide", "sidenavbar-show");
|
|
11250
11250
|
arrowIcon.className = isShow ? iconClass.replace("arrow-down", "arrow-up") : iconClass.replace("arrow-up", "arrow-down");
|
|
11251
11251
|
}
|
|
11252
11252
|
};
|
|
11253
11253
|
const OffsetContext = createContext(20);
|
|
11254
11254
|
const defaultProps$1b = {
|
|
11255
|
-
|
|
11255
|
+
...ComponentDefaults,
|
|
11256
11256
|
position: "left",
|
|
11257
11257
|
width: "80%"
|
|
11258
11258
|
};
|
|
11259
11259
|
const SideNavBar = (props) => {
|
|
11260
|
+
const classPrefix2 = "nut-sidenavbar";
|
|
11260
11261
|
const {
|
|
11261
11262
|
title,
|
|
11262
11263
|
visible,
|
|
@@ -11264,14 +11265,13 @@ const SideNavBar = (props) => {
|
|
|
11264
11265
|
position,
|
|
11265
11266
|
children,
|
|
11266
11267
|
className,
|
|
11267
|
-
showhead,
|
|
11268
11268
|
onClose,
|
|
11269
11269
|
...rest
|
|
11270
11270
|
} = {
|
|
11271
11271
|
...defaultProps$1b,
|
|
11272
11272
|
...props
|
|
11273
11273
|
};
|
|
11274
|
-
const
|
|
11274
|
+
const indent = props.indent ? Number(props.indent) : 20;
|
|
11275
11275
|
return /* @__PURE__ */ React__default.createElement(
|
|
11276
11276
|
Popup,
|
|
11277
11277
|
{
|
|
@@ -11280,37 +11280,39 @@ const SideNavBar = (props) => {
|
|
|
11280
11280
|
position,
|
|
11281
11281
|
onClose
|
|
11282
11282
|
},
|
|
11283
|
-
/* @__PURE__ */ React__default.createElement(
|
|
11283
|
+
/* @__PURE__ */ React__default.createElement("div", { className: classNames(className, classPrefix2), ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__content` }, /* @__PURE__ */ React__default.createElement(
|
|
11284
11284
|
"div",
|
|
11285
11285
|
{
|
|
11286
|
-
className:
|
|
11287
|
-
|
|
11286
|
+
className: `${classPrefix2}__list sidenavbar-show`,
|
|
11287
|
+
onClick: handleClick
|
|
11288
11288
|
},
|
|
11289
|
-
/* @__PURE__ */ React__default.createElement(
|
|
11289
|
+
/* @__PURE__ */ React__default.createElement(
|
|
11290
11290
|
"div",
|
|
11291
11291
|
{
|
|
11292
|
-
className:
|
|
11293
|
-
style: { paddingLeft: `${
|
|
11292
|
+
className: `${classPrefix2}__title ${classPrefix2}-border-bt`,
|
|
11293
|
+
style: { paddingLeft: `${indent}px` }
|
|
11294
11294
|
},
|
|
11295
11295
|
title,
|
|
11296
11296
|
" ",
|
|
11297
11297
|
/* @__PURE__ */ React__default.createElement("i", { className: "arrow-icon arrow-down" })
|
|
11298
|
-
),
|
|
11299
|
-
|
|
11298
|
+
),
|
|
11299
|
+
/* @__PURE__ */ React__default.createElement(OffsetContext.Provider, { value: indent }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__content` }, children))
|
|
11300
|
+
)))
|
|
11300
11301
|
);
|
|
11301
11302
|
};
|
|
11302
11303
|
SideNavBar.defaultProps = defaultProps$1b;
|
|
11303
11304
|
SideNavBar.displayName = "NutSideNavBar";
|
|
11304
11305
|
const SideNavBarItem = (props) => {
|
|
11305
|
-
const
|
|
11306
|
+
const classPrefix2 = "nut-subsidenavbar";
|
|
11307
|
+
const { title, value, children, onClick, ...rest } = props;
|
|
11306
11308
|
const clickFn = (e) => {
|
|
11307
11309
|
e.stopPropagation();
|
|
11308
|
-
onClick && onClick({ title,
|
|
11310
|
+
onClick && onClick({ title, value });
|
|
11309
11311
|
};
|
|
11310
11312
|
return /* @__PURE__ */ React__default.createElement(
|
|
11311
11313
|
"div",
|
|
11312
11314
|
{
|
|
11313
|
-
className:
|
|
11315
|
+
className: `${classPrefix2}__item ${classPrefix2}-border-bt`,
|
|
11314
11316
|
onClick: clickFn,
|
|
11315
11317
|
...rest
|
|
11316
11318
|
},
|
|
@@ -11321,17 +11323,17 @@ const defaultProps$1a = {
|
|
|
11321
11323
|
open: true
|
|
11322
11324
|
};
|
|
11323
11325
|
const SubSideNavBar = (props) => {
|
|
11324
|
-
const
|
|
11326
|
+
const classPrefix2 = "nut-subsidenavbar";
|
|
11327
|
+
const { title, value, children, onClick, open, ...rest } = {
|
|
11325
11328
|
...defaultProps$1a,
|
|
11326
11329
|
...props
|
|
11327
11330
|
};
|
|
11328
11331
|
const offset = useContext(OffsetContext);
|
|
11329
|
-
console.log("offset>>>>>>>", offset);
|
|
11330
11332
|
const listRef = useRef(null);
|
|
11331
11333
|
const setListLevel = useCallback(
|
|
11332
11334
|
(nodeList, level = 1) => {
|
|
11333
11335
|
const titleClass = nodeList[0].className;
|
|
11334
|
-
if (titleClass.includes(
|
|
11336
|
+
if (titleClass.includes(`${classPrefix2}__title`)) {
|
|
11335
11337
|
const left = offset * (level + 1);
|
|
11336
11338
|
nodeList[0].style.paddingLeft = `${left}px`;
|
|
11337
11339
|
}
|
|
@@ -11340,11 +11342,11 @@ const SubSideNavBar = (props) => {
|
|
|
11340
11342
|
);
|
|
11341
11343
|
childNodes.forEach((item) => {
|
|
11342
11344
|
const itemClass = item.className;
|
|
11343
|
-
if (itemClass.includes(
|
|
11345
|
+
if (itemClass.includes(`${classPrefix2}__item`)) {
|
|
11344
11346
|
const left = offset * (level + 2);
|
|
11345
11347
|
item.style.paddingLeft = `${left}px`;
|
|
11346
11348
|
}
|
|
11347
|
-
if (itemClass.includes(
|
|
11349
|
+
if (itemClass.includes(`${classPrefix2}__list`)) {
|
|
11348
11350
|
let level2 = item.getAttribute("level") ? Number(item.getAttribute("level")) : 1;
|
|
11349
11351
|
level2 += 1;
|
|
11350
11352
|
item.setAttribute("level", level2.toString());
|
|
@@ -11357,8 +11359,8 @@ const SubSideNavBar = (props) => {
|
|
|
11357
11359
|
const clickFn = (e) => {
|
|
11358
11360
|
handleClick(e);
|
|
11359
11361
|
const currentClass = e.currentTarget.className;
|
|
11360
|
-
const isShow = currentClass.includes("
|
|
11361
|
-
onClick && onClick({ title,
|
|
11362
|
+
const isShow = currentClass.includes("sidenavbar-show");
|
|
11363
|
+
onClick && onClick({ title, value, isShow });
|
|
11362
11364
|
};
|
|
11363
11365
|
useEffect(() => {
|
|
11364
11366
|
var _a2, _b;
|
|
@@ -11366,9 +11368,9 @@ const SubSideNavBar = (props) => {
|
|
|
11366
11368
|
(_b = listRef.current) == null ? void 0 : _b.setAttribute("level", "1");
|
|
11367
11369
|
childNodes && setListLevel(childNodes);
|
|
11368
11370
|
}, [setListLevel]);
|
|
11369
|
-
const divClass = open ?
|
|
11371
|
+
const divClass = open ? `${classPrefix2}__list sidenavbar-show` : `${classPrefix2}__list sidenavbar-hide`;
|
|
11370
11372
|
const iconClass = open ? "arrow-icon arrow-down" : "arrow-icon arrow-up";
|
|
11371
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest }, /* @__PURE__ */ React__default.createElement("div", { className:
|
|
11373
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: divClass, ref: listRef, onClick: clickFn, ...rest }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__title ${classPrefix2}-border-bt` }, title, " ", /* @__PURE__ */ React__default.createElement("i", { className: iconClass })), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__content` }, children));
|
|
11372
11374
|
};
|
|
11373
11375
|
function usePropsValue({
|
|
11374
11376
|
value,
|
|
@@ -11583,7 +11585,7 @@ const defaultProps$15 = {
|
|
|
11583
11585
|
duration: 300,
|
|
11584
11586
|
autoHeight: false
|
|
11585
11587
|
};
|
|
11586
|
-
const classPrefix$
|
|
11588
|
+
const classPrefix$g = "nut-tabs";
|
|
11587
11589
|
const Tabs = (props) => {
|
|
11588
11590
|
const {
|
|
11589
11591
|
activeColor,
|
|
@@ -11677,14 +11679,14 @@ const Tabs = (props) => {
|
|
|
11677
11679
|
}
|
|
11678
11680
|
}, [children]);
|
|
11679
11681
|
const classes = classNames(
|
|
11680
|
-
classPrefix$
|
|
11681
|
-
`${classPrefix$
|
|
11682
|
+
classPrefix$g,
|
|
11683
|
+
`${classPrefix$g}--${direction}`,
|
|
11682
11684
|
className
|
|
11683
11685
|
);
|
|
11684
|
-
const classesTitle = classNames(`${classPrefix$
|
|
11685
|
-
[`${classPrefix$
|
|
11686
|
-
[`${classPrefix$
|
|
11687
|
-
[`${classPrefix$
|
|
11686
|
+
const classesTitle = classNames(`${classPrefix$g}__titles`, {
|
|
11687
|
+
[`${classPrefix$g}__titles--${activeType}`]: activeType,
|
|
11688
|
+
[`${classPrefix$g}__titles--scrollable`]: true,
|
|
11689
|
+
[`${classPrefix$g}__titles--${align}`]: align
|
|
11688
11690
|
});
|
|
11689
11691
|
const tabsActiveStyle = {
|
|
11690
11692
|
color: activeType === "smile" ? activeColor : "",
|
|
@@ -11714,7 +11716,7 @@ const Tabs = (props) => {
|
|
|
11714
11716
|
onClick: () => {
|
|
11715
11717
|
tabChange(item);
|
|
11716
11718
|
},
|
|
11717
|
-
className: classNames(`${classPrefix$
|
|
11719
|
+
className: classNames(`${classPrefix$g}__titles-item`, {
|
|
11718
11720
|
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
11719
11721
|
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
11720
11722
|
[`nut-tabs__titles-item--${align}`]: align
|
|
@@ -11725,14 +11727,14 @@ const Tabs = (props) => {
|
|
|
11725
11727
|
activeType === "line" && /* @__PURE__ */ React__default.createElement(
|
|
11726
11728
|
"div",
|
|
11727
11729
|
{
|
|
11728
|
-
className: `${classPrefix$
|
|
11730
|
+
className: `${classPrefix$g}__titles-item__line`,
|
|
11729
11731
|
style: tabsActiveStyle
|
|
11730
11732
|
}
|
|
11731
11733
|
),
|
|
11732
11734
|
activeType === "smile" && /* @__PURE__ */ React__default.createElement(
|
|
11733
11735
|
"div",
|
|
11734
11736
|
{
|
|
11735
|
-
className: `${classPrefix$
|
|
11737
|
+
className: `${classPrefix$g}__titles-item__smile`,
|
|
11736
11738
|
style: tabsActiveStyle
|
|
11737
11739
|
},
|
|
11738
11740
|
/* @__PURE__ */ React__default.createElement(x$7, { color: activeColor, width: 40, height: 20 })
|
|
@@ -11744,13 +11746,13 @@ const Tabs = (props) => {
|
|
|
11744
11746
|
{
|
|
11745
11747
|
ellipsis: true
|
|
11746
11748
|
},
|
|
11747
|
-
`${classPrefix$
|
|
11749
|
+
`${classPrefix$g}__titles-item__text`
|
|
11748
11750
|
)
|
|
11749
11751
|
},
|
|
11750
11752
|
item.title
|
|
11751
11753
|
)
|
|
11752
11754
|
);
|
|
11753
|
-
})), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$
|
|
11755
|
+
})), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$g}__content__wrap` }, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$g}__content`, style: contentStyle }, React__default.Children.map(children, (child, idx) => {
|
|
11754
11756
|
if (!React__default.isValidElement(child)) {
|
|
11755
11757
|
return null;
|
|
11756
11758
|
}
|
|
@@ -13823,7 +13825,7 @@ const defaultProps$Z = {
|
|
|
13823
13825
|
},
|
|
13824
13826
|
options: []
|
|
13825
13827
|
};
|
|
13826
|
-
const classPrefix$
|
|
13828
|
+
const classPrefix$f = "nut-checkboxgroup";
|
|
13827
13829
|
const CheckboxGroup = React__default.forwardRef(
|
|
13828
13830
|
(props, ref) => {
|
|
13829
13831
|
const { children } = { ...defaultProps$Z, ...props };
|
|
@@ -13905,7 +13907,7 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
13905
13907
|
/* @__PURE__ */ React__default.createElement(
|
|
13906
13908
|
"div",
|
|
13907
13909
|
{
|
|
13908
|
-
className: classNames(classPrefix$
|
|
13910
|
+
className: classNames(classPrefix$f, className, {
|
|
13909
13911
|
[`nut-checkboxgroup--${props.direction}`]: props.direction
|
|
13910
13912
|
}),
|
|
13911
13913
|
...rest
|
|
@@ -13927,7 +13929,7 @@ const defaultProps$Y = {
|
|
|
13927
13929
|
onChange: (value) => {
|
|
13928
13930
|
}
|
|
13929
13931
|
};
|
|
13930
|
-
const classPrefix$
|
|
13932
|
+
const classPrefix$e = "nut-checkbox";
|
|
13931
13933
|
const Checkbox = (props) => {
|
|
13932
13934
|
const { children } = {
|
|
13933
13935
|
...defaultProps$Y,
|
|
@@ -13989,22 +13991,22 @@ const Checkbox = (props) => {
|
|
|
13989
13991
|
};
|
|
13990
13992
|
const color = () => {
|
|
13991
13993
|
if (innerDisabled) {
|
|
13992
|
-
return `${classPrefix$
|
|
13994
|
+
return `${classPrefix$e}__icon--disable`;
|
|
13993
13995
|
}
|
|
13994
13996
|
if (innerChecked) {
|
|
13995
13997
|
if (innerIndeterminate) {
|
|
13996
|
-
return `${classPrefix$
|
|
13998
|
+
return `${classPrefix$e}__icon--indeterminate`;
|
|
13997
13999
|
}
|
|
13998
|
-
return `${classPrefix$
|
|
14000
|
+
return `${classPrefix$e}__icon`;
|
|
13999
14001
|
}
|
|
14000
|
-
return `${classPrefix$
|
|
14002
|
+
return `${classPrefix$e}__icon--unchecked`;
|
|
14001
14003
|
};
|
|
14002
14004
|
const renderLabel = () => {
|
|
14003
14005
|
return /* @__PURE__ */ React__default.createElement(
|
|
14004
14006
|
"span",
|
|
14005
14007
|
{
|
|
14006
|
-
className: classNames(`${classPrefix$
|
|
14007
|
-
[`${classPrefix$
|
|
14008
|
+
className: classNames(`${classPrefix$e}__label `, {
|
|
14009
|
+
[`${classPrefix$e}__label--disabled`]: innerDisabled
|
|
14008
14010
|
})
|
|
14009
14011
|
},
|
|
14010
14012
|
children || label
|
|
@@ -14023,8 +14025,8 @@ const Checkbox = (props) => {
|
|
|
14023
14025
|
return /* @__PURE__ */ React__default.createElement(
|
|
14024
14026
|
"div",
|
|
14025
14027
|
{
|
|
14026
|
-
className: classNames(classPrefix$
|
|
14027
|
-
[`${classPrefix$
|
|
14028
|
+
className: classNames(classPrefix$e, className, {
|
|
14029
|
+
[`${classPrefix$e}--reverse`]: labelPosition === "left"
|
|
14028
14030
|
}),
|
|
14029
14031
|
...rest,
|
|
14030
14032
|
onClick: handleClick2
|
|
@@ -14340,6 +14342,7 @@ const defaultProps$X = {
|
|
|
14340
14342
|
const InternalPicker = (props, ref) => {
|
|
14341
14343
|
const { locale } = useConfig();
|
|
14342
14344
|
const {
|
|
14345
|
+
children,
|
|
14343
14346
|
visible,
|
|
14344
14347
|
title,
|
|
14345
14348
|
options: options2 = [],
|
|
@@ -14365,6 +14368,7 @@ const InternalPicker = (props, ref) => {
|
|
|
14365
14368
|
(_a2 = props.onConfirm) == null ? void 0 : _a2.call(props, setSelectedOptions(), val);
|
|
14366
14369
|
}
|
|
14367
14370
|
});
|
|
14371
|
+
const [innerValue, setInnerValue] = useState(selectedValue);
|
|
14368
14372
|
const [columnIndex, setColumnIndex] = useState(0);
|
|
14369
14373
|
const pickerRef = useRef(null);
|
|
14370
14374
|
const [refs, setRefs] = useRefs();
|
|
@@ -14404,41 +14408,48 @@ const InternalPicker = (props, ref) => {
|
|
|
14404
14408
|
}
|
|
14405
14409
|
return "single";
|
|
14406
14410
|
};
|
|
14407
|
-
const normalListData = () => {
|
|
14411
|
+
const normalListData = (innerValue2) => {
|
|
14408
14412
|
const type4 = columnsType();
|
|
14409
14413
|
switch (type4) {
|
|
14410
14414
|
case "multiple":
|
|
14411
14415
|
return options2;
|
|
14412
14416
|
case "cascade":
|
|
14413
|
-
return formatCascade(options2,
|
|
14417
|
+
return formatCascade(options2, innerValue2);
|
|
14414
14418
|
default:
|
|
14415
14419
|
return [options2];
|
|
14416
14420
|
}
|
|
14417
14421
|
};
|
|
14418
14422
|
const init = () => {
|
|
14419
|
-
const normalData = normalListData(
|
|
14423
|
+
const normalData = normalListData(
|
|
14424
|
+
innerValue
|
|
14425
|
+
);
|
|
14420
14426
|
setColumnsList(normalData);
|
|
14421
14427
|
const data = [];
|
|
14422
14428
|
normalData.length > 0 && normalData.map((item) => {
|
|
14423
14429
|
item[0] && data.push(item[0].value);
|
|
14424
14430
|
return item;
|
|
14425
14431
|
});
|
|
14426
|
-
if (!
|
|
14427
|
-
|
|
14432
|
+
if (!innerValue.length && innerValue.length === 0) {
|
|
14433
|
+
setInnerValue([...data]);
|
|
14428
14434
|
}
|
|
14429
14435
|
};
|
|
14430
14436
|
useEffect(() => {
|
|
14431
|
-
|
|
14432
|
-
|
|
14437
|
+
setInnerValue(innerValue !== selectedValue ? selectedValue : innerValue);
|
|
14438
|
+
}, [visible]);
|
|
14439
|
+
useEffect(() => {
|
|
14440
|
+
if (visible) {
|
|
14441
|
+
init();
|
|
14433
14442
|
}
|
|
14434
|
-
init();
|
|
14435
14443
|
}, [options2, visible]);
|
|
14444
|
+
useEffect(() => {
|
|
14445
|
+
onChange && onChange(setSelectedOptions(), innerValue, columnIndex);
|
|
14446
|
+
}, [innerValue, columnsList]);
|
|
14436
14447
|
const setSelectedOptions = () => {
|
|
14437
14448
|
const options22 = [];
|
|
14438
14449
|
let currOptions = [];
|
|
14439
14450
|
columnsList.forEach((columnOptions, index) => {
|
|
14440
14451
|
currOptions = columnOptions.filter(
|
|
14441
|
-
(item) => item.value ===
|
|
14452
|
+
(item) => item.value === innerValue[index]
|
|
14442
14453
|
);
|
|
14443
14454
|
if (currOptions[0]) {
|
|
14444
14455
|
options22.push(currOptions[0]);
|
|
@@ -14448,36 +14459,30 @@ const InternalPicker = (props, ref) => {
|
|
|
14448
14459
|
});
|
|
14449
14460
|
return options22;
|
|
14450
14461
|
};
|
|
14451
|
-
useEffect(() => {
|
|
14452
|
-
if (!visible) {
|
|
14453
|
-
return;
|
|
14454
|
-
}
|
|
14455
|
-
onChange && onChange(setSelectedOptions(), selectedValue, columnIndex);
|
|
14456
|
-
if (isConfirmEvent.current) {
|
|
14457
|
-
isConfirmEvent.current = false;
|
|
14458
|
-
onConfirm && onConfirm(setSelectedOptions(), selectedValue);
|
|
14459
|
-
}
|
|
14460
|
-
}, [selectedValue, columnsList, visible]);
|
|
14461
14462
|
const chooseItem = (columnOptions, columnIndex2) => {
|
|
14462
14463
|
var _a2, _b;
|
|
14464
|
+
const values = [];
|
|
14465
|
+
const start2 = columnIndex2;
|
|
14463
14466
|
if (columnOptions && Object.keys(columnOptions).length) {
|
|
14464
|
-
if (
|
|
14467
|
+
if (values[columnIndex2] !== columnOptions.value) {
|
|
14465
14468
|
if (columnsType() === "cascade") {
|
|
14466
|
-
|
|
14467
|
-
setSelectedValue([...selectedValue]);
|
|
14469
|
+
values[columnIndex2] = columnOptions.value || "";
|
|
14468
14470
|
while ((_a2 = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a2[0]) {
|
|
14469
|
-
|
|
14470
|
-
setSelectedValue([...selectedValue]);
|
|
14471
|
+
values[columnIndex2 + 1] = columnOptions.children[0].value;
|
|
14471
14472
|
columnIndex2++;
|
|
14472
14473
|
columnOptions = columnOptions.children[0];
|
|
14473
14474
|
}
|
|
14474
14475
|
if ((_b = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _b.length) {
|
|
14475
|
-
|
|
14476
|
-
setSelectedValue([...selectedValue]);
|
|
14476
|
+
values[columnIndex2 + 1] = "";
|
|
14477
14477
|
}
|
|
14478
|
-
|
|
14478
|
+
const combineResult = [
|
|
14479
|
+
...innerValue.slice(0, start2),
|
|
14480
|
+
...values.splice(start2)
|
|
14481
|
+
];
|
|
14482
|
+
setInnerValue(combineResult);
|
|
14483
|
+
setColumnsList(normalListData(combineResult));
|
|
14479
14484
|
} else {
|
|
14480
|
-
|
|
14485
|
+
setInnerValue((data) => {
|
|
14481
14486
|
const cdata = [...data];
|
|
14482
14487
|
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
|
|
14483
14488
|
columnOptions,
|
|
@@ -14491,16 +14496,16 @@ const InternalPicker = (props, ref) => {
|
|
|
14491
14496
|
}
|
|
14492
14497
|
};
|
|
14493
14498
|
const confirm2 = () => {
|
|
14494
|
-
let
|
|
14499
|
+
let moving = false;
|
|
14495
14500
|
refs.forEach((ref2) => {
|
|
14496
14501
|
if (ref2.moving)
|
|
14497
|
-
|
|
14502
|
+
moving = true;
|
|
14498
14503
|
ref2.stopMomentum();
|
|
14499
14504
|
});
|
|
14500
|
-
if (
|
|
14505
|
+
if (moving) {
|
|
14501
14506
|
isConfirmEvent.current = true;
|
|
14502
14507
|
} else {
|
|
14503
|
-
|
|
14508
|
+
setSelectedValue(innerValue);
|
|
14504
14509
|
closePicker();
|
|
14505
14510
|
}
|
|
14506
14511
|
setTimeout(() => {
|
|
@@ -14508,8 +14513,8 @@ const InternalPicker = (props, ref) => {
|
|
|
14508
14513
|
}, 0);
|
|
14509
14514
|
};
|
|
14510
14515
|
const closePicker = () => {
|
|
14511
|
-
onClose && onClose(setSelectedOptions(),
|
|
14512
|
-
afterClose && afterClose(setSelectedOptions(),
|
|
14516
|
+
onClose && onClose(setSelectedOptions(), innerValue);
|
|
14517
|
+
afterClose && afterClose(setSelectedOptions(), innerValue, pickerRef);
|
|
14513
14518
|
};
|
|
14514
14519
|
const renderTitleBar = () => {
|
|
14515
14520
|
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__control` }, /* @__PURE__ */ React__default.createElement(
|
|
@@ -14530,12 +14535,12 @@ const InternalPicker = (props, ref) => {
|
|
|
14530
14535
|
closePicker();
|
|
14531
14536
|
}
|
|
14532
14537
|
},
|
|
14533
|
-
/* @__PURE__ */ React__default.createElement("div", { className: classes, style, ...rest }, renderTitleBar(), /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__panel`, ref: pickerRef }, columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
14538
|
+
/* @__PURE__ */ React__default.createElement("div", { className: classes, style, ...rest }, renderTitleBar(), children, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix2}__panel`, ref: pickerRef }, columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
14534
14539
|
return /* @__PURE__ */ React__default.createElement(
|
|
14535
14540
|
PickerPanel$1,
|
|
14536
14541
|
{
|
|
14537
14542
|
ref: setRefs(index),
|
|
14538
|
-
defaultValue:
|
|
14543
|
+
defaultValue: innerValue == null ? void 0 : innerValue[index],
|
|
14539
14544
|
options: item,
|
|
14540
14545
|
threeDimensional,
|
|
14541
14546
|
chooseItem: (value, index2) => chooseItem(value, index2),
|
|
@@ -16448,7 +16453,7 @@ const defaultProps$S = {
|
|
|
16448
16453
|
digits: 0,
|
|
16449
16454
|
async: false
|
|
16450
16455
|
};
|
|
16451
|
-
const classPrefix$
|
|
16456
|
+
const classPrefix$d = `nut-inputnumber`;
|
|
16452
16457
|
const InputNumber = (props) => {
|
|
16453
16458
|
const {
|
|
16454
16459
|
children,
|
|
@@ -16491,8 +16496,8 @@ const InputNumber = (props) => {
|
|
|
16491
16496
|
}, []);
|
|
16492
16497
|
const classes = classNames(
|
|
16493
16498
|
{
|
|
16494
|
-
[`${classPrefix$
|
|
16495
|
-
[`${classPrefix$
|
|
16499
|
+
[`${classPrefix$d}`]: true,
|
|
16500
|
+
[`${classPrefix$d}--disabled`]: disabled
|
|
16496
16501
|
},
|
|
16497
16502
|
className
|
|
16498
16503
|
);
|
|
@@ -17150,7 +17155,7 @@ const defaultProps$O = {
|
|
|
17150
17155
|
direction: "vertical",
|
|
17151
17156
|
options: []
|
|
17152
17157
|
};
|
|
17153
|
-
const classPrefix$
|
|
17158
|
+
const classPrefix$c = "nut-radiogroup";
|
|
17154
17159
|
const RadioGroup = React__default.forwardRef(
|
|
17155
17160
|
(props, ref) => {
|
|
17156
17161
|
const {
|
|
@@ -17206,8 +17211,8 @@ const RadioGroup = React__default.forwardRef(
|
|
|
17206
17211
|
/* @__PURE__ */ React__default.createElement(
|
|
17207
17212
|
"div",
|
|
17208
17213
|
{
|
|
17209
|
-
className: classNames(classPrefix$
|
|
17210
|
-
[`${classPrefix$
|
|
17214
|
+
className: classNames(classPrefix$c, className, {
|
|
17215
|
+
[`${classPrefix$c}--${props.direction}`]: props.direction
|
|
17211
17216
|
}),
|
|
17212
17217
|
...rest
|
|
17213
17218
|
},
|
|
@@ -18469,6 +18474,14 @@ const isFunction = (val) => typeof val === "function";
|
|
|
18469
18474
|
const isPromise = (val) => {
|
|
18470
18475
|
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
18471
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
|
+
};
|
|
18472
18485
|
const funcInterceptor = (interceptor, {
|
|
18473
18486
|
args = [],
|
|
18474
18487
|
done,
|
|
@@ -19410,7 +19423,7 @@ const defaultProps$A = {
|
|
|
19410
19423
|
imageSize: "",
|
|
19411
19424
|
status: "empty"
|
|
19412
19425
|
};
|
|
19413
|
-
const classPrefix$
|
|
19426
|
+
const classPrefix$b = `nut-empty`;
|
|
19414
19427
|
const Empty = (props) => {
|
|
19415
19428
|
const { locale } = useConfig();
|
|
19416
19429
|
const {
|
|
@@ -19445,7 +19458,7 @@ const Empty = (props) => {
|
|
|
19445
19458
|
};
|
|
19446
19459
|
});
|
|
19447
19460
|
}, [imageSize]);
|
|
19448
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$
|
|
19461
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$b} ${className}`, ...rest }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$b}__image`, style: imgStyle }, imageNode), typeof description === "string" ? /* @__PURE__ */ React__default.createElement("div", { className: `${classPrefix$b}__description` }, description || locale.noData) : description, children));
|
|
19449
19462
|
};
|
|
19450
19463
|
Empty.defaultProps = defaultProps$A;
|
|
19451
19464
|
Empty.displayName = "NutEmpty";
|
|
@@ -20018,7 +20031,7 @@ const NoticeBar = (props) => {
|
|
|
20018
20031
|
};
|
|
20019
20032
|
NoticeBar.defaultProps = defaultProps$y;
|
|
20020
20033
|
NoticeBar.displayName = "NutNoticeBar";
|
|
20021
|
-
const classPrefix$
|
|
20034
|
+
const classPrefix$a = "nut-notify";
|
|
20022
20035
|
let Notification$1 = (_a = class extends React.PureComponent {
|
|
20023
20036
|
constructor(props) {
|
|
20024
20037
|
super(props);
|
|
@@ -20069,10 +20082,10 @@ let Notification$1 = (_a = class extends React.PureComponent {
|
|
|
20069
20082
|
const { style, message, type: type4, className, position } = this.props;
|
|
20070
20083
|
const { show: show2 } = this.state;
|
|
20071
20084
|
const classes = classNames({
|
|
20072
|
-
[`${classPrefix$
|
|
20073
|
-
[`${classPrefix$
|
|
20074
|
-
[`${classPrefix$
|
|
20075
|
-
[`${classPrefix$
|
|
20085
|
+
[`${classPrefix$a}--popup-top`]: position === "top",
|
|
20086
|
+
[`${classPrefix$a}--popup-bottom`]: position === "bottom",
|
|
20087
|
+
[`${classPrefix$a}`]: true,
|
|
20088
|
+
[`${classPrefix$a}--${type4}`]: true
|
|
20076
20089
|
});
|
|
20077
20090
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
20078
20091
|
CSSTransition$1,
|
|
@@ -20181,164 +20194,288 @@ const Notify = {
|
|
|
20181
20194
|
}
|
|
20182
20195
|
}
|
|
20183
20196
|
};
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20197
|
+
const getTargetElement = (target) => {
|
|
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;
|
|
20189
20205
|
}
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20199
|
-
|
|
20200
|
-
const childCallback = this.props.children.props[type4];
|
|
20201
|
-
if (childCallback) {
|
|
20202
|
-
childCallback(e);
|
|
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;
|
|
20203
20216
|
}
|
|
20204
|
-
|
|
20205
|
-
|
|
20206
|
-
callback(e);
|
|
20217
|
+
if (outerVar) {
|
|
20218
|
+
onClickAway();
|
|
20207
20219
|
}
|
|
20208
|
-
}
|
|
20209
|
-
|
|
20210
|
-
|
|
20211
|
-
|
|
20212
|
-
|
|
20213
|
-
|
|
20214
|
-
};
|
|
20215
|
-
if (child && child.props && child.props.className) {
|
|
20216
|
-
newChildProps.className = className;
|
|
20220
|
+
};
|
|
20221
|
+
useEffect(() => {
|
|
20222
|
+
if (isListener) {
|
|
20223
|
+
window.addEventListener(eventName, handler, true);
|
|
20224
|
+
} else {
|
|
20225
|
+
window.removeEventListener(eventName, handler, true);
|
|
20217
20226
|
}
|
|
20218
|
-
|
|
20219
|
-
|
|
20227
|
+
return () => {
|
|
20228
|
+
window.removeEventListener(eventName, handler, true);
|
|
20220
20229
|
};
|
|
20221
|
-
|
|
20222
|
-
const trigger = React__default.cloneElement(child, cloneProps);
|
|
20223
|
-
return trigger;
|
|
20224
|
-
}
|
|
20230
|
+
}, [target]);
|
|
20225
20231
|
}
|
|
20226
20232
|
const defaultProps$x = {
|
|
20227
20233
|
...ComponentDefaults,
|
|
20228
20234
|
list: [],
|
|
20229
|
-
theme: "light",
|
|
20230
20235
|
location: "bottom",
|
|
20231
20236
|
visible: false,
|
|
20232
|
-
offset:
|
|
20237
|
+
offset: [0, 12],
|
|
20238
|
+
targetId: "",
|
|
20233
20239
|
className: "",
|
|
20234
|
-
|
|
20240
|
+
background: "",
|
|
20241
|
+
color: "",
|
|
20242
|
+
showArrow: true,
|
|
20243
|
+
duration: 0.3,
|
|
20244
|
+
overlay: false,
|
|
20245
|
+
overlayClassName: "",
|
|
20246
|
+
overlayStyle: {},
|
|
20247
|
+
closeOnClickOutside: true,
|
|
20248
|
+
closeOnClickAction: true,
|
|
20249
|
+
closeOnOverlayClick: true,
|
|
20250
|
+
onClick: () => {
|
|
20235
20251
|
},
|
|
20236
|
-
|
|
20252
|
+
onOpen: () => {
|
|
20253
|
+
},
|
|
20254
|
+
onClose: () => {
|
|
20255
|
+
},
|
|
20256
|
+
onSelect: (item, index) => {
|
|
20237
20257
|
}
|
|
20238
20258
|
};
|
|
20259
|
+
const classPrefix$9 = `nut-popover`;
|
|
20239
20260
|
const Popover = (props) => {
|
|
20240
20261
|
const {
|
|
20241
20262
|
children,
|
|
20242
20263
|
list,
|
|
20243
|
-
theme,
|
|
20244
20264
|
location,
|
|
20245
20265
|
visible,
|
|
20246
20266
|
offset,
|
|
20267
|
+
targetId,
|
|
20268
|
+
overlay,
|
|
20269
|
+
overlayStyle,
|
|
20270
|
+
overlayClassName,
|
|
20271
|
+
closeOnClickOutside,
|
|
20272
|
+
closeOnClickAction,
|
|
20273
|
+
closeOnOverlayClick,
|
|
20247
20274
|
className,
|
|
20275
|
+
showArrow,
|
|
20248
20276
|
style,
|
|
20277
|
+
background,
|
|
20278
|
+
color,
|
|
20249
20279
|
onClick,
|
|
20250
|
-
|
|
20280
|
+
onOpen,
|
|
20281
|
+
onClose,
|
|
20282
|
+
onSelect,
|
|
20251
20283
|
...reset
|
|
20252
20284
|
} = {
|
|
20253
20285
|
...defaultProps$x,
|
|
20254
20286
|
...props
|
|
20255
20287
|
};
|
|
20256
|
-
const
|
|
20257
|
-
|
|
20258
|
-
|
|
20259
|
-
setElWidth(getRect(goodItem.current).width);
|
|
20260
|
-
setElHeight(getRect(goodItem.current).height);
|
|
20261
|
-
}
|
|
20262
|
-
});
|
|
20263
|
-
const [classes, setClasses] = useState("");
|
|
20288
|
+
const popoverRef = useRef(null);
|
|
20289
|
+
const popoverContentRef = useRef(null);
|
|
20290
|
+
const [showPopup, setShowPopup] = useState(false);
|
|
20264
20291
|
const [elWidth, setElWidth] = useState(0);
|
|
20265
20292
|
const [elHeight, setElHeight] = useState(0);
|
|
20266
|
-
const [
|
|
20267
|
-
const [popoverArrow, setPopoverArrow] = useState("");
|
|
20293
|
+
const [rootPosition, setRootPosition] = useState();
|
|
20268
20294
|
useEffect(() => {
|
|
20269
|
-
|
|
20270
|
-
|
|
20271
|
-
|
|
20272
|
-
|
|
20273
|
-
|
|
20274
|
-
|
|
20275
|
-
|
|
20276
|
-
|
|
20277
|
-
|
|
20278
|
-
|
|
20279
|
-
|
|
20280
|
-
|
|
20281
|
-
|
|
20295
|
+
setShowPopup(visible);
|
|
20296
|
+
if (visible) {
|
|
20297
|
+
setTimeout(() => {
|
|
20298
|
+
getContentWidth();
|
|
20299
|
+
}, 0);
|
|
20300
|
+
}
|
|
20301
|
+
}, [visible]);
|
|
20302
|
+
const targetSet = [
|
|
20303
|
+
targetId ? document.querySelector(`#${targetId}`) : popoverRef.current,
|
|
20304
|
+
popoverContentRef.current
|
|
20305
|
+
];
|
|
20306
|
+
useClickAway(
|
|
20307
|
+
() => {
|
|
20308
|
+
props.onClick && props.onClick();
|
|
20309
|
+
onClose && onClose();
|
|
20310
|
+
},
|
|
20311
|
+
targetSet,
|
|
20312
|
+
"touchstart",
|
|
20313
|
+
visible,
|
|
20314
|
+
closeOnClickOutside
|
|
20315
|
+
);
|
|
20316
|
+
const getContentWidth = () => {
|
|
20317
|
+
let rect = getRect(popoverRef.current);
|
|
20318
|
+
if (targetId) {
|
|
20319
|
+
setTimeout(() => {
|
|
20320
|
+
rect = getRect(document.querySelector(`#${targetId}`));
|
|
20321
|
+
setRootPosition({
|
|
20322
|
+
width: rect.width,
|
|
20323
|
+
height: rect.height,
|
|
20324
|
+
left: rect.left,
|
|
20325
|
+
top: rect.top,
|
|
20326
|
+
right: rect.right
|
|
20327
|
+
});
|
|
20328
|
+
if (popoverContentRef.current) {
|
|
20329
|
+
setElWidth(popoverContentRef.current.clientWidth);
|
|
20330
|
+
setElHeight(popoverContentRef.current.clientHeight);
|
|
20331
|
+
}
|
|
20332
|
+
}, 0);
|
|
20282
20333
|
} else {
|
|
20283
|
-
|
|
20334
|
+
setRootPosition({
|
|
20335
|
+
width: rect.width,
|
|
20336
|
+
height: rect.height,
|
|
20337
|
+
left: rect.left,
|
|
20338
|
+
top: rect.top,
|
|
20339
|
+
right: rect.right
|
|
20340
|
+
});
|
|
20341
|
+
if (popoverContentRef.current) {
|
|
20342
|
+
setElWidth(popoverContentRef.current.clientWidth);
|
|
20343
|
+
setElHeight(popoverContentRef.current.clientHeight);
|
|
20344
|
+
}
|
|
20284
20345
|
}
|
|
20285
|
-
return style2;
|
|
20286
|
-
};
|
|
20287
|
-
const classesSelf = () => {
|
|
20288
|
-
const prefixCls2 = "nut-popover";
|
|
20289
|
-
return `${prefixCls2} ${theme ? `${prefixCls2}--${theme}` : ""}`;
|
|
20290
20346
|
};
|
|
20291
|
-
const
|
|
20292
|
-
|
|
20293
|
-
|
|
20347
|
+
const classes = classNames(
|
|
20348
|
+
{
|
|
20349
|
+
[`${classPrefix$9}`]: true
|
|
20350
|
+
},
|
|
20351
|
+
className
|
|
20352
|
+
);
|
|
20353
|
+
const customStyle = () => {
|
|
20354
|
+
const styles = {};
|
|
20355
|
+
if (background) {
|
|
20356
|
+
styles.background = background;
|
|
20357
|
+
}
|
|
20358
|
+
if (color) {
|
|
20359
|
+
styles.color = color;
|
|
20360
|
+
}
|
|
20361
|
+
return styles;
|
|
20294
20362
|
};
|
|
20295
|
-
const
|
|
20296
|
-
const
|
|
20297
|
-
|
|
20363
|
+
const popoverArrow = () => {
|
|
20364
|
+
const prefixCls2 = "nut-popover-arrow";
|
|
20365
|
+
const loca = location;
|
|
20366
|
+
const direction = loca.split("-")[0];
|
|
20367
|
+
return `${prefixCls2} ${prefixCls2}-${direction} ${prefixCls2}--${loca}`;
|
|
20298
20368
|
};
|
|
20299
|
-
const
|
|
20300
|
-
const
|
|
20301
|
-
|
|
20369
|
+
const popoverArrowStyle = () => {
|
|
20370
|
+
const styles = {};
|
|
20371
|
+
const { background: background2 } = props;
|
|
20372
|
+
const direction = location.split("-")[0];
|
|
20373
|
+
if (background2) {
|
|
20374
|
+
styles[`border${upperCaseFirst(direction)}Color`] = background2;
|
|
20375
|
+
}
|
|
20376
|
+
return styles;
|
|
20302
20377
|
};
|
|
20303
|
-
const
|
|
20304
|
-
|
|
20305
|
-
|
|
20378
|
+
const getRootPosition = () => {
|
|
20379
|
+
let styles = {};
|
|
20380
|
+
if (!rootPosition)
|
|
20381
|
+
return {};
|
|
20382
|
+
const contentWidth = elWidth;
|
|
20383
|
+
const contentHeight = elHeight;
|
|
20384
|
+
const { width, height, left, top, right } = rootPosition;
|
|
20385
|
+
const direction = location.split("-")[0];
|
|
20386
|
+
const skew = location.split("-")[1];
|
|
20387
|
+
let cross = 0;
|
|
20388
|
+
let parallel = 0;
|
|
20389
|
+
if (Array.isArray(offset) && offset.length == 2) {
|
|
20390
|
+
cross += +offset[1];
|
|
20391
|
+
parallel += +offset[0];
|
|
20392
|
+
}
|
|
20393
|
+
if (width) {
|
|
20394
|
+
if (["bottom", "top"].includes(direction)) {
|
|
20395
|
+
const h = direction == "bottom" ? height + cross : -(contentHeight + cross);
|
|
20396
|
+
styles.top = `${top + h}px`;
|
|
20397
|
+
if (!skew) {
|
|
20398
|
+
styles.left = `${-(contentWidth - width) / 2 + left + parallel}px`;
|
|
20399
|
+
}
|
|
20400
|
+
if (skew == "start") {
|
|
20401
|
+
styles.left = `${left + parallel}px`;
|
|
20402
|
+
}
|
|
20403
|
+
if (skew == "end") {
|
|
20404
|
+
styles.left = `${right + parallel}px`;
|
|
20405
|
+
}
|
|
20406
|
+
}
|
|
20407
|
+
if (["left", "right"].includes(direction)) {
|
|
20408
|
+
const contentW = direction == "left" ? -(contentWidth + cross) : width + cross;
|
|
20409
|
+
styles.left = `${left + contentW}px`;
|
|
20410
|
+
if (!skew) {
|
|
20411
|
+
styles.top = `${top - contentHeight / 2 + height / 2 - 4 + parallel}px`;
|
|
20412
|
+
}
|
|
20413
|
+
if (skew == "start") {
|
|
20414
|
+
styles.top = `${top + parallel}px`;
|
|
20415
|
+
}
|
|
20416
|
+
if (skew == "end") {
|
|
20417
|
+
styles.top = `${top + height + parallel}px`;
|
|
20418
|
+
}
|
|
20419
|
+
}
|
|
20306
20420
|
}
|
|
20421
|
+
return styles;
|
|
20307
20422
|
};
|
|
20308
|
-
const
|
|
20423
|
+
const handleSelect = (item, index) => {
|
|
20309
20424
|
if (!item.disabled) {
|
|
20310
|
-
|
|
20425
|
+
onSelect(item, index);
|
|
20426
|
+
}
|
|
20427
|
+
if (closeOnClickAction) {
|
|
20428
|
+
props.onClick && props.onClick();
|
|
20429
|
+
onClose && onClose();
|
|
20311
20430
|
}
|
|
20312
20431
|
};
|
|
20313
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
20432
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !targetId && /* @__PURE__ */ React__default.createElement(
|
|
20314
20433
|
"div",
|
|
20315
20434
|
{
|
|
20316
|
-
className:
|
|
20317
|
-
|
|
20318
|
-
|
|
20435
|
+
className: "nut-popover-wrapper",
|
|
20436
|
+
ref: popoverRef,
|
|
20437
|
+
onClick: () => {
|
|
20438
|
+
props.onClick && props.onClick();
|
|
20439
|
+
if (!visible) {
|
|
20440
|
+
onOpen && onOpen();
|
|
20441
|
+
} else {
|
|
20442
|
+
onClose && onClose();
|
|
20443
|
+
}
|
|
20444
|
+
},
|
|
20445
|
+
style
|
|
20319
20446
|
},
|
|
20320
|
-
|
|
20447
|
+
Array.isArray(children) ? children[0] : children
|
|
20448
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: classes, style: getRootPosition(), ...reset }, /* @__PURE__ */ React__default.createElement(
|
|
20449
|
+
Popup,
|
|
20450
|
+
{
|
|
20451
|
+
className: `nut-popover-content nut-popover-content--${location}`,
|
|
20452
|
+
style: customStyle(),
|
|
20453
|
+
position: "default",
|
|
20454
|
+
overlay,
|
|
20455
|
+
overlayStyle,
|
|
20456
|
+
overlayClassName,
|
|
20457
|
+
closeOnOverlayClick,
|
|
20458
|
+
visible: showPopup
|
|
20459
|
+
},
|
|
20460
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-popover-content-group", ref: popoverContentRef }, showArrow && /* @__PURE__ */ React__default.createElement("div", { className: popoverArrow(), style: popoverArrowStyle() }), Array.isArray(children) ? children[1] : "", list.map((item, index) => {
|
|
20321
20461
|
return /* @__PURE__ */ React__default.createElement(
|
|
20322
20462
|
"div",
|
|
20323
20463
|
{
|
|
20324
|
-
|
|
20325
|
-
|
|
20326
|
-
|
|
20327
|
-
|
|
20328
|
-
|
|
20464
|
+
className: classNames(
|
|
20465
|
+
{
|
|
20466
|
+
"nut-popover-menu-item": true,
|
|
20467
|
+
"nut-popover-menu-disabled": item.disabled
|
|
20468
|
+
},
|
|
20469
|
+
item.className
|
|
20470
|
+
),
|
|
20471
|
+
key: item.key,
|
|
20472
|
+
onClick: () => handleSelect(item, index)
|
|
20329
20473
|
},
|
|
20330
20474
|
item.icon ? item.icon : null,
|
|
20331
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "popover-menu-item-name" }, item.name)
|
|
20475
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "nut-popover-menu-item-name" }, item.name)
|
|
20332
20476
|
);
|
|
20333
|
-
}))
|
|
20334
|
-
)
|
|
20335
|
-
Overlay,
|
|
20336
|
-
{
|
|
20337
|
-
visible,
|
|
20338
|
-
onClick: (e) => handleClick2(e),
|
|
20339
|
-
style: { background: "transparent" }
|
|
20340
|
-
}
|
|
20341
|
-
) : null);
|
|
20477
|
+
}))
|
|
20478
|
+
)));
|
|
20342
20479
|
};
|
|
20343
20480
|
Popover.defaultProps = defaultProps$x;
|
|
20344
20481
|
Popover.displayName = "NutPopover";
|
|
@@ -20552,7 +20689,7 @@ const defaultProps$v = {
|
|
|
20552
20689
|
src: "",
|
|
20553
20690
|
alt: ""
|
|
20554
20691
|
};
|
|
20555
|
-
const classPrefix$
|
|
20692
|
+
const classPrefix$8 = `nut-avatar`;
|
|
20556
20693
|
const Avatar = (props) => {
|
|
20557
20694
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
20558
20695
|
const {
|
|
@@ -20584,7 +20721,7 @@ const Avatar = (props) => {
|
|
|
20584
20721
|
[`nut-avatar-${((_a2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a2.size) || size || "normal"}`]: true,
|
|
20585
20722
|
[`nut-avatar-${((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || shape}`]: true
|
|
20586
20723
|
});
|
|
20587
|
-
const cls = classNames(classPrefix$
|
|
20724
|
+
const cls = classNames(classPrefix$8, classes, className);
|
|
20588
20725
|
const styles = {
|
|
20589
20726
|
width: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
20590
20727
|
height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
@@ -20900,7 +21037,7 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
20900
21037
|
});
|
|
20901
21038
|
Swipe.defaultProps = defaultProps$t;
|
|
20902
21039
|
Swipe.displayName = "NutSwipe";
|
|
20903
|
-
const classPrefix$
|
|
21040
|
+
const classPrefix$7 = "nut-toast";
|
|
20904
21041
|
class Notification extends React.PureComponent {
|
|
20905
21042
|
constructor(props) {
|
|
20906
21043
|
super(props);
|
|
@@ -20953,7 +21090,7 @@ class Notification extends React.PureComponent {
|
|
|
20953
21090
|
iconNode = /* @__PURE__ */ React.createElement(x$8, null);
|
|
20954
21091
|
break;
|
|
20955
21092
|
}
|
|
20956
|
-
return /* @__PURE__ */ React.createElement("p", { className: `${classPrefix$
|
|
21093
|
+
return /* @__PURE__ */ React.createElement("p", { className: `${classPrefix$7}__icon-wrapper` }, iconNode);
|
|
20957
21094
|
}
|
|
20958
21095
|
return icon;
|
|
20959
21096
|
}
|
|
@@ -20986,22 +21123,22 @@ class Notification extends React.PureComponent {
|
|
|
20986
21123
|
{
|
|
20987
21124
|
visible: true,
|
|
20988
21125
|
style,
|
|
20989
|
-
className: `${classPrefix$
|
|
21126
|
+
className: `${classPrefix$7}__overlay-default ${className}`,
|
|
20990
21127
|
onClick: () => {
|
|
20991
21128
|
console.log("onclick");
|
|
20992
21129
|
this.clickCover();
|
|
20993
21130
|
},
|
|
20994
21131
|
closeOnOverlayClick
|
|
20995
21132
|
},
|
|
20996
|
-
/* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
21133
|
+
/* @__PURE__ */ React.createElement("div", { className: `${classPrefix$7} ${classes}`, id: `toast-${id}` }, /* @__PURE__ */ React.createElement(
|
|
20997
21134
|
"div",
|
|
20998
21135
|
{
|
|
20999
|
-
className: `${classPrefix$
|
|
21136
|
+
className: `${classPrefix$7}__inner ${classPrefix$7}-${position} ${contentClassName}`,
|
|
21000
21137
|
style: contentStyle
|
|
21001
21138
|
},
|
|
21002
21139
|
this.renderIcon(),
|
|
21003
|
-
title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
21004
|
-
/* @__PURE__ */ React.createElement("span", { className: `${classPrefix$
|
|
21140
|
+
title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$7}-title` }, title) : null,
|
|
21141
|
+
/* @__PURE__ */ React.createElement("span", { className: `${classPrefix$7}-text` }, content)
|
|
21005
21142
|
))
|
|
21006
21143
|
));
|
|
21007
21144
|
}
|
|
@@ -21112,7 +21249,7 @@ const defaultProps$s = {
|
|
|
21112
21249
|
onClick: (event) => {
|
|
21113
21250
|
}
|
|
21114
21251
|
};
|
|
21115
|
-
const classPrefix$
|
|
21252
|
+
const classPrefix$6 = `nut-animate`;
|
|
21116
21253
|
const Animate = (props) => {
|
|
21117
21254
|
const { className, type: type4, action, loop: loop2, onClick, children, ...rest } = {
|
|
21118
21255
|
...defaultProps$s,
|
|
@@ -21121,7 +21258,7 @@ const Animate = (props) => {
|
|
|
21121
21258
|
const [clicked, setClicked] = useState(false);
|
|
21122
21259
|
const classes = classNames({
|
|
21123
21260
|
"nut-ani-container": true,
|
|
21124
|
-
[`${classPrefix$
|
|
21261
|
+
[`${classPrefix$6}-${type4}`]: action === "initial" || clicked ? type4 : false,
|
|
21125
21262
|
loop: loop2
|
|
21126
21263
|
});
|
|
21127
21264
|
const cls = classNames(classes, className);
|
|
@@ -21497,12 +21634,12 @@ const defaultProps$o = {
|
|
|
21497
21634
|
gap: "-8",
|
|
21498
21635
|
level: "left"
|
|
21499
21636
|
};
|
|
21500
|
-
const classPrefix$
|
|
21637
|
+
const classPrefix$5 = `nut-avatar-group`;
|
|
21501
21638
|
const AvatarGroup = (props) => {
|
|
21502
21639
|
const propAvatarGroup = { ...defaultProps$o, ...props };
|
|
21503
21640
|
const { className, style, children } = propAvatarGroup;
|
|
21504
21641
|
const avatarGroupRef = useRef(null);
|
|
21505
|
-
const cls = classNames(classPrefix$
|
|
21642
|
+
const cls = classNames(classPrefix$5, className);
|
|
21506
21643
|
const parentAvatar = {
|
|
21507
21644
|
propAvatarGroup,
|
|
21508
21645
|
avatarGroupRef
|
|
@@ -21520,7 +21657,7 @@ const defaultProps$n = {
|
|
|
21520
21657
|
background: "#e5e9f2",
|
|
21521
21658
|
clockwise: true
|
|
21522
21659
|
};
|
|
21523
|
-
const classPrefix$
|
|
21660
|
+
const classPrefix$4 = `nut-circleprogress`;
|
|
21524
21661
|
const CircleProgress = (props) => {
|
|
21525
21662
|
var _a2;
|
|
21526
21663
|
const {
|
|
@@ -21539,7 +21676,7 @@ const CircleProgress = (props) => {
|
|
|
21539
21676
|
...defaultProps$n,
|
|
21540
21677
|
...props
|
|
21541
21678
|
};
|
|
21542
|
-
const classes = classNames(className, classPrefix$
|
|
21679
|
+
const classes = classNames(className, classPrefix$4);
|
|
21543
21680
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
21544
21681
|
const styles = {
|
|
21545
21682
|
height: `${Number(radius) * 2}px`,
|
|
@@ -22042,7 +22179,7 @@ const defaultProps$j = {
|
|
|
22042
22179
|
symbol: "...",
|
|
22043
22180
|
lineHeight: "20"
|
|
22044
22181
|
};
|
|
22045
|
-
const classPrefix$
|
|
22182
|
+
const classPrefix$3 = `nut-ellipsis`;
|
|
22046
22183
|
const Ellipsis = (props) => {
|
|
22047
22184
|
var _a2, _b;
|
|
22048
22185
|
const {
|
|
@@ -22065,7 +22202,7 @@ const Ellipsis = (props) => {
|
|
|
22065
22202
|
const [expanded, setExpanded] = useState(false);
|
|
22066
22203
|
const ellipsis = useRef();
|
|
22067
22204
|
const root2 = useRef(null);
|
|
22068
|
-
const classes = classNames(classPrefix$
|
|
22205
|
+
const classes = classNames(classPrefix$3, className);
|
|
22069
22206
|
useLayoutEffect(() => {
|
|
22070
22207
|
if (content) {
|
|
22071
22208
|
createContainer();
|
|
@@ -22224,7 +22361,7 @@ const defaultProps$i = {
|
|
|
22224
22361
|
loop: false
|
|
22225
22362
|
}
|
|
22226
22363
|
};
|
|
22227
|
-
const classPrefix$
|
|
22364
|
+
const classPrefix$2 = `nut-video`;
|
|
22228
22365
|
const Video = (props) => {
|
|
22229
22366
|
const {
|
|
22230
22367
|
children,
|
|
@@ -22240,7 +22377,7 @@ const Video = (props) => {
|
|
|
22240
22377
|
...props
|
|
22241
22378
|
};
|
|
22242
22379
|
const rootRef = useRef(null);
|
|
22243
|
-
const classes = classNames(className, classPrefix$
|
|
22380
|
+
const classes = classNames(className, classPrefix$2);
|
|
22244
22381
|
useEffect(() => {
|
|
22245
22382
|
init();
|
|
22246
22383
|
}, []);
|
|
@@ -22294,14 +22431,14 @@ const defaultProps$h = {
|
|
|
22294
22431
|
current: 0,
|
|
22295
22432
|
direction: "horizontal"
|
|
22296
22433
|
};
|
|
22297
|
-
const classPrefix = `nut-indicator`;
|
|
22434
|
+
const classPrefix$1 = `nut-indicator`;
|
|
22298
22435
|
const Indicator = (props) => {
|
|
22299
22436
|
const { total, current, children, className, direction, ...rest } = {
|
|
22300
22437
|
...defaultProps$h,
|
|
22301
22438
|
...props
|
|
22302
22439
|
};
|
|
22303
22440
|
const classes = classNames({
|
|
22304
|
-
[`${classPrefix}__vertical`]: direction === "vertical"
|
|
22441
|
+
[`${classPrefix$1}__vertical`]: direction === "vertical"
|
|
22305
22442
|
});
|
|
22306
22443
|
const renderElement = () => {
|
|
22307
22444
|
const childs = [];
|
|
@@ -22311,9 +22448,9 @@ const Indicator = (props) => {
|
|
|
22311
22448
|
"div",
|
|
22312
22449
|
{
|
|
22313
22450
|
key: item,
|
|
22314
|
-
className: `${classPrefix}__dot ${classPrefix}__active`
|
|
22451
|
+
className: `${classPrefix$1}__dot ${classPrefix$1}__active`
|
|
22315
22452
|
}
|
|
22316
|
-
) : /* @__PURE__ */ React__default.createElement("div", { key: item, className: `${classPrefix}__dot` })
|
|
22453
|
+
) : /* @__PURE__ */ React__default.createElement("div", { key: item, className: `${classPrefix$1}__dot` })
|
|
22317
22454
|
);
|
|
22318
22455
|
}
|
|
22319
22456
|
return childs;
|
|
@@ -23822,22 +23959,24 @@ const Tag = (props) => {
|
|
|
23822
23959
|
Tag.defaultProps = defaultProps$7;
|
|
23823
23960
|
Tag.displayName = "NutTag";
|
|
23824
23961
|
const defaultProps$6 = {
|
|
23825
|
-
|
|
23826
|
-
|
|
23962
|
+
...ComponentDefaults,
|
|
23963
|
+
list: [],
|
|
23964
|
+
interval: 500,
|
|
23827
23965
|
loop: true,
|
|
23828
|
-
|
|
23966
|
+
duration: 3e3,
|
|
23829
23967
|
rows: 3,
|
|
23830
|
-
|
|
23968
|
+
gapY: 10
|
|
23831
23969
|
};
|
|
23970
|
+
const classPrefix = `nut-barrage`;
|
|
23832
23971
|
const InternalBarrage = (props, ref) => {
|
|
23833
23972
|
const {
|
|
23834
23973
|
className,
|
|
23835
|
-
|
|
23974
|
+
interval,
|
|
23836
23975
|
loop: loop2,
|
|
23837
|
-
|
|
23838
|
-
|
|
23976
|
+
list,
|
|
23977
|
+
duration,
|
|
23839
23978
|
rows,
|
|
23840
|
-
|
|
23979
|
+
gapY,
|
|
23841
23980
|
...restProps
|
|
23842
23981
|
} = {
|
|
23843
23982
|
...defaultProps$6,
|
|
@@ -23848,15 +23987,14 @@ const InternalBarrage = (props, ref) => {
|
|
|
23848
23987
|
const barrageCWidth = useRef(0);
|
|
23849
23988
|
const timer = useRef(0);
|
|
23850
23989
|
const index = useRef(0);
|
|
23851
|
-
const
|
|
23852
|
-
const classes = classNames(className, b(""));
|
|
23990
|
+
const classes = classNames(classPrefix, className);
|
|
23853
23991
|
useImperativeHandle(ref, () => ({
|
|
23854
23992
|
add: (word) => {
|
|
23855
|
-
const _index = index.current %
|
|
23856
|
-
if (!loop2 && index.current ===
|
|
23857
|
-
|
|
23993
|
+
const _index = index.current % list.length;
|
|
23994
|
+
if (!loop2 && index.current === list.length) {
|
|
23995
|
+
list.splice(list.length, 0, word);
|
|
23858
23996
|
} else {
|
|
23859
|
-
|
|
23997
|
+
list.splice(_index, 0, word);
|
|
23860
23998
|
}
|
|
23861
23999
|
}
|
|
23862
24000
|
}));
|
|
@@ -23876,27 +24014,27 @@ const InternalBarrage = (props, ref) => {
|
|
|
23876
24014
|
return () => {
|
|
23877
24015
|
clearInterval(timer.current);
|
|
23878
24016
|
};
|
|
23879
|
-
}, [
|
|
24017
|
+
}, [list]);
|
|
23880
24018
|
const run = () => {
|
|
23881
24019
|
clearInterval(timer.current);
|
|
23882
24020
|
timer.current = window.setTimeout(() => {
|
|
23883
24021
|
play();
|
|
23884
|
-
},
|
|
24022
|
+
}, interval);
|
|
23885
24023
|
};
|
|
23886
24024
|
const play = () => {
|
|
23887
|
-
if (!loop2 && index.current >=
|
|
24025
|
+
if (!loop2 && index.current >= list.length) {
|
|
23888
24026
|
return;
|
|
23889
24027
|
}
|
|
23890
|
-
const _index = loop2 ? index.current %
|
|
24028
|
+
const _index = loop2 ? index.current % list.length : index.current;
|
|
23891
24029
|
const el = document.createElement(`div`);
|
|
23892
|
-
el.innerHTML =
|
|
24030
|
+
el.innerHTML = list[_index];
|
|
23893
24031
|
el.classList.add("barrage-item");
|
|
23894
24032
|
barrageContainer.current.appendChild(el);
|
|
23895
24033
|
const width = el.offsetWidth;
|
|
23896
24034
|
const height = el.offsetHeight;
|
|
23897
24035
|
el.classList.add("move");
|
|
23898
|
-
el.style.animationDuration = `${
|
|
23899
|
-
el.style.top = `${_index % rows * (height +
|
|
24036
|
+
el.style.animationDuration = `${duration}ms`;
|
|
24037
|
+
el.style.top = `${_index % rows * (height + gapY) + 20}px`;
|
|
23900
24038
|
el.style.width = `${width}px`;
|
|
23901
24039
|
el.addEventListener("animationend", () => {
|
|
23902
24040
|
barrageContainer.current.removeChild(el);
|