@nutui/nutui-react 2.0.0-beta.2 → 2.0.0-beta.3
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 +10 -0
- package/dist/esm/Avatar.js +2 -0
- package/dist/esm/Cell/style/index.js +1 -1
- package/dist/esm/Cell/style/style.css +1 -1
- package/dist/esm/Cell.js +2 -0
- package/dist/esm/CellGroup.js +47 -4
- package/dist/esm/Form.js +1 -2
- package/dist/esm/Menu.js +6 -0
- package/dist/esm/MenuItem.js +8 -153
- package/dist/esm/Swiper.js +4 -1
- package/dist/esm/menuitem2.js +156 -0
- package/dist/esm/types/src/packages/avatar/avatar.d.ts +4 -1
- package/dist/esm/types/src/packages/avatar/avatar.taro.d.ts +4 -1
- package/dist/esm/types/src/packages/cell/cell.d.ts +4 -1
- package/dist/esm/types/src/packages/cell/cell.taro.d.ts +4 -1
- package/dist/esm/types/src/packages/menu/menu.d.ts +4 -1
- package/dist/esm/types/src/packages/menu/menu.taro.d.ts +4 -1
- package/dist/esm/types/src/packages/swiper/index.d.ts +8 -2
- package/dist/esm/types/src/packages/swiper/index.taro.d.ts +8 -2
- 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 +236 -231
- package/dist/nutui.react.umd.js +236 -231
- package/dist/packages/cell/cell.scss +2 -0
- package/dist/style.mjs +1 -1
- package/dist/types/packages/avatar/avatar.d.ts +4 -1
- package/dist/types/packages/cell/cell.d.ts +4 -1
- package/dist/types/packages/menu/menu.d.ts +4 -1
- package/dist/types/packages/swiper/index.d.ts +8 -2
- package/dist/types/packages/virtuallist/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/esm/cellgroup2.js +0 -50
package/dist/nutui.react.umd.js
CHANGED
|
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9
9
|
return value;
|
|
10
10
|
};
|
|
11
11
|
/*!
|
|
12
|
-
* @nutui/nutui-react v2.0.0-beta.
|
|
12
|
+
* @nutui/nutui-react v2.0.0-beta.3 Fri Jun 30 2023 14:20:38 GMT+0800 (China Standard Time)
|
|
13
13
|
* (c) 2023 @jdf2e.
|
|
14
14
|
* Released under the MIT License.
|
|
15
15
|
*/
|
|
@@ -2498,6 +2498,28 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2498
2498
|
);
|
|
2499
2499
|
Button.displayName = "NutButton";
|
|
2500
2500
|
const defaultProps$1p = {
|
|
2501
|
+
...ComponentDefaults,
|
|
2502
|
+
title: "",
|
|
2503
|
+
description: "",
|
|
2504
|
+
divider: true
|
|
2505
|
+
};
|
|
2506
|
+
const classPrefix$n = "nut-cell-group";
|
|
2507
|
+
const CellGroup = (props) => {
|
|
2508
|
+
const { children, className, style, title, description, divider, ...rest } = {
|
|
2509
|
+
...defaultProps$1p,
|
|
2510
|
+
...props
|
|
2511
|
+
};
|
|
2512
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix$n, className), ...rest }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$n}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$n}__description` }, description) : null, /* @__PURE__ */ React.createElement(
|
|
2513
|
+
"div",
|
|
2514
|
+
{
|
|
2515
|
+
className: `${classPrefix$n}__wrap ${divider ? `${classPrefix$n}__wrap--divider` : ""}`
|
|
2516
|
+
},
|
|
2517
|
+
children
|
|
2518
|
+
));
|
|
2519
|
+
};
|
|
2520
|
+
CellGroup.defaultProps = defaultProps$1p;
|
|
2521
|
+
CellGroup.displayName = "NutCellGroup";
|
|
2522
|
+
const defaultProps$1o = {
|
|
2501
2523
|
...ComponentDefaults,
|
|
2502
2524
|
title: null,
|
|
2503
2525
|
description: null,
|
|
@@ -2507,7 +2529,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2507
2529
|
onClick: (event) => {
|
|
2508
2530
|
}
|
|
2509
2531
|
};
|
|
2510
|
-
const classPrefix$
|
|
2532
|
+
const classPrefix$m = "nut-cell";
|
|
2511
2533
|
const Cell = (props) => {
|
|
2512
2534
|
const {
|
|
2513
2535
|
children,
|
|
@@ -2521,7 +2543,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2521
2543
|
style,
|
|
2522
2544
|
...rest
|
|
2523
2545
|
} = {
|
|
2524
|
-
...defaultProps$
|
|
2546
|
+
...defaultProps$1o,
|
|
2525
2547
|
...props
|
|
2526
2548
|
};
|
|
2527
2549
|
const handleClick2 = (event) => {
|
|
@@ -2538,45 +2560,24 @@ Check the top-level render call using <` + t + ">.");
|
|
|
2538
2560
|
return /* @__PURE__ */ React.createElement(
|
|
2539
2561
|
"div",
|
|
2540
2562
|
{
|
|
2541
|
-
className: classNames(classPrefix$
|
|
2563
|
+
className: classNames(classPrefix$m, className),
|
|
2542
2564
|
onClick: (event) => handleClick2(event),
|
|
2543
2565
|
style: baseStyle,
|
|
2544
2566
|
...rest
|
|
2545
2567
|
},
|
|
2546
|
-
children || /* @__PURE__ */ React.createElement(React.Fragment, null, title || description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
2568
|
+
children || /* @__PURE__ */ React.createElement(React.Fragment, null, title || description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__left` }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__description` }, description) : null) : null, extra ? /* @__PURE__ */ React.createElement(
|
|
2547
2569
|
"div",
|
|
2548
2570
|
{
|
|
2549
|
-
className: `${classPrefix$
|
|
2571
|
+
className: `${classPrefix$m}__extra`,
|
|
2550
2572
|
style: styles
|
|
2551
2573
|
},
|
|
2552
2574
|
extra
|
|
2553
|
-
) : null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$
|
|
2575
|
+
) : null, /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__divider` }))
|
|
2554
2576
|
);
|
|
2555
2577
|
};
|
|
2556
|
-
Cell.defaultProps = defaultProps$
|
|
2578
|
+
Cell.defaultProps = defaultProps$1o;
|
|
2557
2579
|
Cell.displayName = "NutCell";
|
|
2558
|
-
|
|
2559
|
-
...ComponentDefaults,
|
|
2560
|
-
title: "",
|
|
2561
|
-
description: "",
|
|
2562
|
-
divider: true
|
|
2563
|
-
};
|
|
2564
|
-
const classPrefix$m = "nut-cell-group";
|
|
2565
|
-
const CellGroup = (props) => {
|
|
2566
|
-
const { children, className, style, title, description, divider, ...rest } = {
|
|
2567
|
-
...defaultProps$1o,
|
|
2568
|
-
...props
|
|
2569
|
-
};
|
|
2570
|
-
return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix$m, className), ...rest }, title ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__title` }, title) : null, description ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix$m}__description` }, description) : null, /* @__PURE__ */ React.createElement(
|
|
2571
|
-
"div",
|
|
2572
|
-
{
|
|
2573
|
-
className: `${classPrefix$m}__wrap ${divider ? `${classPrefix$m}__wrap--divider` : ""}`
|
|
2574
|
-
},
|
|
2575
|
-
children
|
|
2576
|
-
));
|
|
2577
|
-
};
|
|
2578
|
-
CellGroup.defaultProps = defaultProps$1o;
|
|
2579
|
-
CellGroup.displayName = "NutCellGroup";
|
|
2580
|
+
Cell.Group = CellGroup;
|
|
2580
2581
|
var INFINITY = 1 / 0;
|
|
2581
2582
|
var symbolTag = "[object Symbol]";
|
|
2582
2583
|
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
@@ -15942,7 +15943,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
15942
15943
|
resetFields();
|
|
15943
15944
|
}
|
|
15944
15945
|
},
|
|
15945
|
-
/* @__PURE__ */ React.createElement(
|
|
15946
|
+
/* @__PURE__ */ React.createElement(Cell.Group, null, /* @__PURE__ */ React.createElement(Context.Provider, { value: formInstance }, children), footer ? /* @__PURE__ */ React.createElement(Cell, null, footer) : null)
|
|
15946
15947
|
);
|
|
15947
15948
|
};
|
|
15948
15949
|
Form.defaultProps = defaultProps$T;
|
|
@@ -16389,148 +16390,6 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16389
16390
|
};
|
|
16390
16391
|
InputNumber.defaultProps = defaultProps$R;
|
|
16391
16392
|
InputNumber.displayName = "NutInputNumber";
|
|
16392
|
-
const defaultProps$Q = {
|
|
16393
|
-
...ComponentDefaults,
|
|
16394
|
-
activeColor: "",
|
|
16395
|
-
closeOnOverlayClick: true,
|
|
16396
|
-
scrollFixed: false,
|
|
16397
|
-
lockScroll: true,
|
|
16398
|
-
icon: null
|
|
16399
|
-
};
|
|
16400
|
-
const Menu = (props) => {
|
|
16401
|
-
const {
|
|
16402
|
-
className,
|
|
16403
|
-
icon,
|
|
16404
|
-
scrollFixed,
|
|
16405
|
-
lockScroll,
|
|
16406
|
-
closeOnOverlayClick,
|
|
16407
|
-
children,
|
|
16408
|
-
activeColor,
|
|
16409
|
-
...rest
|
|
16410
|
-
} = {
|
|
16411
|
-
...defaultProps$Q,
|
|
16412
|
-
...props
|
|
16413
|
-
};
|
|
16414
|
-
const menuRef = React.useRef(null);
|
|
16415
|
-
const [isScrollFixed, setIsScrollFixed] = React.useState(false);
|
|
16416
|
-
const getScrollTop = (el) => {
|
|
16417
|
-
return Math.max(0, "scrollTop" in el ? el.scrollTop : el.pageYOffset);
|
|
16418
|
-
};
|
|
16419
|
-
const onScroll = () => {
|
|
16420
|
-
const { scrollFixed: scrollFixed2 } = props;
|
|
16421
|
-
const scrollTop = getScrollTop(window);
|
|
16422
|
-
const isFixed = scrollTop > (typeof scrollFixed2 === "boolean" ? 30 : Number(scrollFixed2));
|
|
16423
|
-
setIsScrollFixed(isFixed);
|
|
16424
|
-
};
|
|
16425
|
-
React.useEffect(() => {
|
|
16426
|
-
if (scrollFixed) {
|
|
16427
|
-
window.addEventListener("scroll", onScroll);
|
|
16428
|
-
}
|
|
16429
|
-
return () => window.removeEventListener("scroll", onScroll);
|
|
16430
|
-
}, []);
|
|
16431
|
-
const [showMenuItem, setShowMenuItem] = React.useState([]);
|
|
16432
|
-
const [menuItemTitle, setMenuItemTitle] = React.useState([]);
|
|
16433
|
-
const toggleMenuItem = (index) => {
|
|
16434
|
-
showMenuItem[index] = !showMenuItem[index];
|
|
16435
|
-
const temp = showMenuItem.map(
|
|
16436
|
-
(i, idx) => idx === index ? i : false
|
|
16437
|
-
);
|
|
16438
|
-
setShowMenuItem([...temp]);
|
|
16439
|
-
};
|
|
16440
|
-
const hideMenuItem = (index) => {
|
|
16441
|
-
showMenuItem[index] = false;
|
|
16442
|
-
setShowMenuItem([...showMenuItem]);
|
|
16443
|
-
};
|
|
16444
|
-
const updateTitle = (text, index) => {
|
|
16445
|
-
menuItemTitle[index] = text;
|
|
16446
|
-
setMenuItemTitle([...menuItemTitle]);
|
|
16447
|
-
};
|
|
16448
|
-
const cloneChildren = () => {
|
|
16449
|
-
return React.Children.map(children, (child, index) => {
|
|
16450
|
-
return React.cloneElement(child, {
|
|
16451
|
-
...child.props,
|
|
16452
|
-
show: showMenuItem[index],
|
|
16453
|
-
index,
|
|
16454
|
-
activeColor,
|
|
16455
|
-
parent: {
|
|
16456
|
-
closeOnOverlayClick,
|
|
16457
|
-
lockScroll,
|
|
16458
|
-
toggleMenuItem,
|
|
16459
|
-
updateTitle,
|
|
16460
|
-
hideMenuItem,
|
|
16461
|
-
menuRef
|
|
16462
|
-
}
|
|
16463
|
-
});
|
|
16464
|
-
});
|
|
16465
|
-
};
|
|
16466
|
-
const menuTitle = () => {
|
|
16467
|
-
return React.Children.map(children, (child, index) => {
|
|
16468
|
-
if (React.isValidElement(child)) {
|
|
16469
|
-
const { title, options: options2, value, disabled, direction } = child.props;
|
|
16470
|
-
const selected = options2 == null ? void 0 : options2.filter(
|
|
16471
|
-
(option) => option.value === value
|
|
16472
|
-
);
|
|
16473
|
-
const finallyTitle = () => {
|
|
16474
|
-
if (title)
|
|
16475
|
-
return title;
|
|
16476
|
-
if (menuItemTitle && menuItemTitle[index])
|
|
16477
|
-
return menuItemTitle[index];
|
|
16478
|
-
if (selected && selected.length && selected[0].text)
|
|
16479
|
-
return selected[0].text;
|
|
16480
|
-
return "";
|
|
16481
|
-
};
|
|
16482
|
-
return /* @__PURE__ */ React.createElement(
|
|
16483
|
-
"div",
|
|
16484
|
-
{
|
|
16485
|
-
className: classNames("nut-menu__item ", className, {
|
|
16486
|
-
active: showMenuItem[index],
|
|
16487
|
-
disabled
|
|
16488
|
-
}),
|
|
16489
|
-
style: { color: showMenuItem[index] ? activeColor : "" },
|
|
16490
|
-
key: index,
|
|
16491
|
-
onClick: (e) => {
|
|
16492
|
-
e.stopPropagation();
|
|
16493
|
-
!disabled && toggleMenuItem(index);
|
|
16494
|
-
}
|
|
16495
|
-
},
|
|
16496
|
-
/* @__PURE__ */ React.createElement(
|
|
16497
|
-
"div",
|
|
16498
|
-
{
|
|
16499
|
-
className: classNames("nut-menu__title ", {
|
|
16500
|
-
active: showMenuItem[index],
|
|
16501
|
-
disabled
|
|
16502
|
-
})
|
|
16503
|
-
},
|
|
16504
|
-
/* @__PURE__ */ React.createElement("div", { className: "nut-menu__title-text" }, finallyTitle()),
|
|
16505
|
-
icon || (direction === "up" ? /* @__PURE__ */ React.createElement(x$h, { className: "nut-menu__title-icon" }) : /* @__PURE__ */ React.createElement(y$9, { className: "nut-menu__title-icon" }))
|
|
16506
|
-
)
|
|
16507
|
-
);
|
|
16508
|
-
}
|
|
16509
|
-
return null;
|
|
16510
|
-
});
|
|
16511
|
-
};
|
|
16512
|
-
return /* @__PURE__ */ React.createElement(
|
|
16513
|
-
"div",
|
|
16514
|
-
{
|
|
16515
|
-
...rest,
|
|
16516
|
-
className: classNames(`nut-menu`, className, {
|
|
16517
|
-
"scroll-fixed": isScrollFixed
|
|
16518
|
-
}),
|
|
16519
|
-
ref: menuRef
|
|
16520
|
-
},
|
|
16521
|
-
/* @__PURE__ */ React.createElement("div", { className: "nut-menu-relative" }, /* @__PURE__ */ React.createElement(
|
|
16522
|
-
"div",
|
|
16523
|
-
{
|
|
16524
|
-
className: classNames("nut-menu__bar", {
|
|
16525
|
-
opened: showMenuItem.includes(true)
|
|
16526
|
-
})
|
|
16527
|
-
},
|
|
16528
|
-
menuTitle()
|
|
16529
|
-
), cloneChildren())
|
|
16530
|
-
);
|
|
16531
|
-
};
|
|
16532
|
-
Menu.defaultProps = defaultProps$Q;
|
|
16533
|
-
Menu.displayName = "NutMenu";
|
|
16534
16393
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
16535
16394
|
const isFunction = (val) => typeof val === "function";
|
|
16536
16395
|
const isPromise = (val) => {
|
|
@@ -16571,7 +16430,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16571
16430
|
};
|
|
16572
16431
|
}, [target]);
|
|
16573
16432
|
}
|
|
16574
|
-
const defaultProps$
|
|
16433
|
+
const defaultProps$Q = {
|
|
16575
16434
|
...ComponentDefaults,
|
|
16576
16435
|
columns: 1,
|
|
16577
16436
|
direction: "down",
|
|
@@ -16600,7 +16459,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16600
16459
|
parent,
|
|
16601
16460
|
index
|
|
16602
16461
|
} = {
|
|
16603
|
-
...defaultProps$
|
|
16462
|
+
...defaultProps$Q,
|
|
16604
16463
|
...props
|
|
16605
16464
|
};
|
|
16606
16465
|
const [_showPopup, setShowPopup] = React.useState(show2);
|
|
@@ -16732,8 +16591,151 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
16732
16591
|
)
|
|
16733
16592
|
);
|
|
16734
16593
|
});
|
|
16735
|
-
MenuItem.defaultProps = defaultProps$
|
|
16594
|
+
MenuItem.defaultProps = defaultProps$Q;
|
|
16736
16595
|
MenuItem.displayName = "NutMenuItem";
|
|
16596
|
+
const defaultProps$P = {
|
|
16597
|
+
...ComponentDefaults,
|
|
16598
|
+
activeColor: "",
|
|
16599
|
+
closeOnOverlayClick: true,
|
|
16600
|
+
scrollFixed: false,
|
|
16601
|
+
lockScroll: true,
|
|
16602
|
+
icon: null
|
|
16603
|
+
};
|
|
16604
|
+
const Menu = (props) => {
|
|
16605
|
+
const {
|
|
16606
|
+
className,
|
|
16607
|
+
icon,
|
|
16608
|
+
scrollFixed,
|
|
16609
|
+
lockScroll,
|
|
16610
|
+
closeOnOverlayClick,
|
|
16611
|
+
children,
|
|
16612
|
+
activeColor,
|
|
16613
|
+
...rest
|
|
16614
|
+
} = {
|
|
16615
|
+
...defaultProps$P,
|
|
16616
|
+
...props
|
|
16617
|
+
};
|
|
16618
|
+
const menuRef = React.useRef(null);
|
|
16619
|
+
const [isScrollFixed, setIsScrollFixed] = React.useState(false);
|
|
16620
|
+
const getScrollTop = (el) => {
|
|
16621
|
+
return Math.max(0, "scrollTop" in el ? el.scrollTop : el.pageYOffset);
|
|
16622
|
+
};
|
|
16623
|
+
const onScroll = () => {
|
|
16624
|
+
const { scrollFixed: scrollFixed2 } = props;
|
|
16625
|
+
const scrollTop = getScrollTop(window);
|
|
16626
|
+
const isFixed = scrollTop > (typeof scrollFixed2 === "boolean" ? 30 : Number(scrollFixed2));
|
|
16627
|
+
setIsScrollFixed(isFixed);
|
|
16628
|
+
};
|
|
16629
|
+
React.useEffect(() => {
|
|
16630
|
+
if (scrollFixed) {
|
|
16631
|
+
window.addEventListener("scroll", onScroll);
|
|
16632
|
+
}
|
|
16633
|
+
return () => window.removeEventListener("scroll", onScroll);
|
|
16634
|
+
}, []);
|
|
16635
|
+
const [showMenuItem, setShowMenuItem] = React.useState([]);
|
|
16636
|
+
const [menuItemTitle, setMenuItemTitle] = React.useState([]);
|
|
16637
|
+
const toggleMenuItem = (index) => {
|
|
16638
|
+
showMenuItem[index] = !showMenuItem[index];
|
|
16639
|
+
const temp = showMenuItem.map(
|
|
16640
|
+
(i, idx) => idx === index ? i : false
|
|
16641
|
+
);
|
|
16642
|
+
setShowMenuItem([...temp]);
|
|
16643
|
+
};
|
|
16644
|
+
const hideMenuItem = (index) => {
|
|
16645
|
+
showMenuItem[index] = false;
|
|
16646
|
+
setShowMenuItem([...showMenuItem]);
|
|
16647
|
+
};
|
|
16648
|
+
const updateTitle = (text, index) => {
|
|
16649
|
+
menuItemTitle[index] = text;
|
|
16650
|
+
setMenuItemTitle([...menuItemTitle]);
|
|
16651
|
+
};
|
|
16652
|
+
const cloneChildren = () => {
|
|
16653
|
+
return React.Children.map(children, (child, index) => {
|
|
16654
|
+
return React.cloneElement(child, {
|
|
16655
|
+
...child.props,
|
|
16656
|
+
show: showMenuItem[index],
|
|
16657
|
+
index,
|
|
16658
|
+
activeColor,
|
|
16659
|
+
parent: {
|
|
16660
|
+
closeOnOverlayClick,
|
|
16661
|
+
lockScroll,
|
|
16662
|
+
toggleMenuItem,
|
|
16663
|
+
updateTitle,
|
|
16664
|
+
hideMenuItem,
|
|
16665
|
+
menuRef
|
|
16666
|
+
}
|
|
16667
|
+
});
|
|
16668
|
+
});
|
|
16669
|
+
};
|
|
16670
|
+
const menuTitle = () => {
|
|
16671
|
+
return React.Children.map(children, (child, index) => {
|
|
16672
|
+
if (React.isValidElement(child)) {
|
|
16673
|
+
const { title, options: options2, value, disabled, direction } = child.props;
|
|
16674
|
+
const selected = options2 == null ? void 0 : options2.filter(
|
|
16675
|
+
(option) => option.value === value
|
|
16676
|
+
);
|
|
16677
|
+
const finallyTitle = () => {
|
|
16678
|
+
if (title)
|
|
16679
|
+
return title;
|
|
16680
|
+
if (menuItemTitle && menuItemTitle[index])
|
|
16681
|
+
return menuItemTitle[index];
|
|
16682
|
+
if (selected && selected.length && selected[0].text)
|
|
16683
|
+
return selected[0].text;
|
|
16684
|
+
return "";
|
|
16685
|
+
};
|
|
16686
|
+
return /* @__PURE__ */ React.createElement(
|
|
16687
|
+
"div",
|
|
16688
|
+
{
|
|
16689
|
+
className: classNames("nut-menu__item ", className, {
|
|
16690
|
+
active: showMenuItem[index],
|
|
16691
|
+
disabled
|
|
16692
|
+
}),
|
|
16693
|
+
style: { color: showMenuItem[index] ? activeColor : "" },
|
|
16694
|
+
key: index,
|
|
16695
|
+
onClick: (e) => {
|
|
16696
|
+
e.stopPropagation();
|
|
16697
|
+
!disabled && toggleMenuItem(index);
|
|
16698
|
+
}
|
|
16699
|
+
},
|
|
16700
|
+
/* @__PURE__ */ React.createElement(
|
|
16701
|
+
"div",
|
|
16702
|
+
{
|
|
16703
|
+
className: classNames("nut-menu__title ", {
|
|
16704
|
+
active: showMenuItem[index],
|
|
16705
|
+
disabled
|
|
16706
|
+
})
|
|
16707
|
+
},
|
|
16708
|
+
/* @__PURE__ */ React.createElement("div", { className: "nut-menu__title-text" }, finallyTitle()),
|
|
16709
|
+
icon || (direction === "up" ? /* @__PURE__ */ React.createElement(x$h, { className: "nut-menu__title-icon" }) : /* @__PURE__ */ React.createElement(y$9, { className: "nut-menu__title-icon" }))
|
|
16710
|
+
)
|
|
16711
|
+
);
|
|
16712
|
+
}
|
|
16713
|
+
return null;
|
|
16714
|
+
});
|
|
16715
|
+
};
|
|
16716
|
+
return /* @__PURE__ */ React.createElement(
|
|
16717
|
+
"div",
|
|
16718
|
+
{
|
|
16719
|
+
...rest,
|
|
16720
|
+
className: classNames(`nut-menu`, className, {
|
|
16721
|
+
"scroll-fixed": isScrollFixed
|
|
16722
|
+
}),
|
|
16723
|
+
ref: menuRef
|
|
16724
|
+
},
|
|
16725
|
+
/* @__PURE__ */ React.createElement("div", { className: "nut-menu-relative" }, /* @__PURE__ */ React.createElement(
|
|
16726
|
+
"div",
|
|
16727
|
+
{
|
|
16728
|
+
className: classNames("nut-menu__bar", {
|
|
16729
|
+
opened: showMenuItem.includes(true)
|
|
16730
|
+
})
|
|
16731
|
+
},
|
|
16732
|
+
menuTitle()
|
|
16733
|
+
), cloneChildren())
|
|
16734
|
+
);
|
|
16735
|
+
};
|
|
16736
|
+
Menu.defaultProps = defaultProps$P;
|
|
16737
|
+
Menu.displayName = "NutMenu";
|
|
16738
|
+
Menu.Item = MenuItem;
|
|
16737
16739
|
const defaultProps$O = {
|
|
16738
16740
|
...ComponentDefaults,
|
|
16739
16741
|
visible: false,
|
|
@@ -20322,6 +20324,29 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20322
20324
|
PullToRefresh.displayName = "NutPullToRefresh";
|
|
20323
20325
|
const AvatarContext = React.createContext({});
|
|
20324
20326
|
const defaultProps$u = {
|
|
20327
|
+
...ComponentDefaults,
|
|
20328
|
+
maxContent: "",
|
|
20329
|
+
max: "",
|
|
20330
|
+
maxBackground: "#eee",
|
|
20331
|
+
maxColor: "#666",
|
|
20332
|
+
gap: "-8",
|
|
20333
|
+
level: "left"
|
|
20334
|
+
};
|
|
20335
|
+
const classPrefix$8 = `nut-avatar-group`;
|
|
20336
|
+
const AvatarGroup = (props) => {
|
|
20337
|
+
const propAvatarGroup = { ...defaultProps$u, ...props };
|
|
20338
|
+
const { className, style, children } = propAvatarGroup;
|
|
20339
|
+
const avatarGroupRef = React.useRef(null);
|
|
20340
|
+
const cls = classNames(classPrefix$8, className);
|
|
20341
|
+
const parentAvatar = {
|
|
20342
|
+
propAvatarGroup,
|
|
20343
|
+
avatarGroupRef
|
|
20344
|
+
};
|
|
20345
|
+
return /* @__PURE__ */ React.createElement(AvatarContext.Provider, { value: parentAvatar }, /* @__PURE__ */ React.createElement("div", { className: cls, style, ref: avatarGroupRef }, children));
|
|
20346
|
+
};
|
|
20347
|
+
AvatarGroup.defaultProps = defaultProps$u;
|
|
20348
|
+
AvatarGroup.displayName = "NutAvatarGroup";
|
|
20349
|
+
const defaultProps$t = {
|
|
20325
20350
|
...ComponentDefaults,
|
|
20326
20351
|
size: "",
|
|
20327
20352
|
shape: "round",
|
|
@@ -20332,7 +20357,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20332
20357
|
src: "",
|
|
20333
20358
|
alt: ""
|
|
20334
20359
|
};
|
|
20335
|
-
const classPrefix$
|
|
20360
|
+
const classPrefix$7 = `nut-avatar`;
|
|
20336
20361
|
const Avatar = (props) => {
|
|
20337
20362
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
20338
20363
|
const {
|
|
@@ -20351,7 +20376,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20351
20376
|
onError,
|
|
20352
20377
|
...rest
|
|
20353
20378
|
} = {
|
|
20354
|
-
...defaultProps$
|
|
20379
|
+
...defaultProps$t,
|
|
20355
20380
|
...props
|
|
20356
20381
|
};
|
|
20357
20382
|
const [maxSum, setMaxSum] = React.useState(0);
|
|
@@ -20364,7 +20389,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20364
20389
|
[`nut-avatar-${((_a2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a2.size) || size || "normal"}`]: true,
|
|
20365
20390
|
[`nut-avatar-${((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || shape}`]: true
|
|
20366
20391
|
});
|
|
20367
|
-
const cls = classNames(classPrefix$
|
|
20392
|
+
const cls = classNames(classPrefix$7, classes, className);
|
|
20368
20393
|
const styles = {
|
|
20369
20394
|
width: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
20370
20395
|
height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
@@ -20433,9 +20458,10 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20433
20458
|
showMax && /* @__PURE__ */ React.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)}`)
|
|
20434
20459
|
));
|
|
20435
20460
|
};
|
|
20436
|
-
Avatar.defaultProps = defaultProps$
|
|
20461
|
+
Avatar.defaultProps = defaultProps$t;
|
|
20437
20462
|
Avatar.displayName = "NutAvatar";
|
|
20438
|
-
|
|
20463
|
+
Avatar.Group = AvatarGroup;
|
|
20464
|
+
const defaultProps$s = {
|
|
20439
20465
|
...ComponentDefaults,
|
|
20440
20466
|
rows: 1,
|
|
20441
20467
|
animated: false,
|
|
@@ -20458,7 +20484,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20458
20484
|
avatarShape,
|
|
20459
20485
|
...rest
|
|
20460
20486
|
} = {
|
|
20461
|
-
...defaultProps$
|
|
20487
|
+
...defaultProps$s,
|
|
20462
20488
|
...props
|
|
20463
20489
|
};
|
|
20464
20490
|
const classPrefix2 = "nut-skeleton";
|
|
@@ -20494,7 +20520,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20494
20520
|
return /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__block`, key: index });
|
|
20495
20521
|
})))));
|
|
20496
20522
|
};
|
|
20497
|
-
Skeleton.defaultProps = defaultProps$
|
|
20523
|
+
Skeleton.defaultProps = defaultProps$s;
|
|
20498
20524
|
Skeleton.displayName = "NutSkeleton";
|
|
20499
20525
|
function preventDefault(event, isStopPropagation) {
|
|
20500
20526
|
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
@@ -20504,13 +20530,13 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20504
20530
|
event.stopPropagation();
|
|
20505
20531
|
}
|
|
20506
20532
|
}
|
|
20507
|
-
const defaultProps$
|
|
20533
|
+
const defaultProps$r = {
|
|
20508
20534
|
name: ""
|
|
20509
20535
|
};
|
|
20510
20536
|
const Swipe = React.forwardRef((props, instanceRef) => {
|
|
20511
20537
|
const classPrefix2 = "nut-swipe";
|
|
20512
20538
|
const touch = useTouch();
|
|
20513
|
-
const { children, className, style } = { ...defaultProps$
|
|
20539
|
+
const { children, className, style } = { ...defaultProps$r, ...props };
|
|
20514
20540
|
const root2 = React.useRef();
|
|
20515
20541
|
const opened = React.useRef(false);
|
|
20516
20542
|
const lockClick = React.useRef(false);
|
|
@@ -20678,9 +20704,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20678
20704
|
/* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}__wrapper`, style: wrapperStyle }, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef))
|
|
20679
20705
|
);
|
|
20680
20706
|
});
|
|
20681
|
-
Swipe.defaultProps = defaultProps$
|
|
20707
|
+
Swipe.defaultProps = defaultProps$r;
|
|
20682
20708
|
Swipe.displayName = "NutSwipe";
|
|
20683
|
-
const classPrefix$
|
|
20709
|
+
const classPrefix$6 = "nut-toast";
|
|
20684
20710
|
class Notification extends React__namespace.PureComponent {
|
|
20685
20711
|
constructor(props) {
|
|
20686
20712
|
super(props);
|
|
@@ -20742,7 +20768,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20742
20768
|
iconNode = /* @__PURE__ */ React__namespace.createElement(x$8, null);
|
|
20743
20769
|
break;
|
|
20744
20770
|
}
|
|
20745
|
-
return /* @__PURE__ */ React__namespace.createElement("p", { className: `${classPrefix$
|
|
20771
|
+
return /* @__PURE__ */ React__namespace.createElement("p", { className: `${classPrefix$6}__icon-wrapper` }, iconNode);
|
|
20746
20772
|
}
|
|
20747
20773
|
return icon;
|
|
20748
20774
|
}
|
|
@@ -20777,22 +20803,22 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20777
20803
|
{
|
|
20778
20804
|
visible: show2,
|
|
20779
20805
|
style,
|
|
20780
|
-
className: `${classPrefix$
|
|
20806
|
+
className: `${classPrefix$6}__overlay-default ${className}`,
|
|
20781
20807
|
onClick: () => {
|
|
20782
20808
|
this.clickCover();
|
|
20783
20809
|
},
|
|
20784
20810
|
closeOnOverlayClick,
|
|
20785
20811
|
lockScroll
|
|
20786
20812
|
},
|
|
20787
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: `${classPrefix$
|
|
20813
|
+
/* @__PURE__ */ React__namespace.createElement("div", { className: `${classPrefix$6} ${classes}`, id: `toast-${id}` }, /* @__PURE__ */ React__namespace.createElement(
|
|
20788
20814
|
"div",
|
|
20789
20815
|
{
|
|
20790
|
-
className: `${classPrefix$
|
|
20816
|
+
className: `${classPrefix$6}__inner ${classPrefix$6}-${position} ${contentClassName}`,
|
|
20791
20817
|
style: contentStyle
|
|
20792
20818
|
},
|
|
20793
20819
|
this.renderIcon(),
|
|
20794
|
-
title ? /* @__PURE__ */ React__namespace.createElement("div", { className: `${classPrefix$
|
|
20795
|
-
/* @__PURE__ */ React__namespace.createElement("span", { className: `${classPrefix$
|
|
20820
|
+
title ? /* @__PURE__ */ React__namespace.createElement("div", { className: `${classPrefix$6}-title` }, title) : null,
|
|
20821
|
+
/* @__PURE__ */ React__namespace.createElement("span", { className: `${classPrefix$6}-text` }, content)
|
|
20796
20822
|
))
|
|
20797
20823
|
));
|
|
20798
20824
|
}
|
|
@@ -20899,7 +20925,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20899
20925
|
}
|
|
20900
20926
|
}
|
|
20901
20927
|
};
|
|
20902
|
-
const defaultProps$
|
|
20928
|
+
const defaultProps$q = {
|
|
20903
20929
|
...ComponentDefaults,
|
|
20904
20930
|
type: "shake",
|
|
20905
20931
|
action: "initial",
|
|
@@ -20907,16 +20933,16 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20907
20933
|
onClick: (event) => {
|
|
20908
20934
|
}
|
|
20909
20935
|
};
|
|
20910
|
-
const classPrefix$
|
|
20936
|
+
const classPrefix$5 = `nut-animate`;
|
|
20911
20937
|
const Animate = (props) => {
|
|
20912
20938
|
const { className, type: type2, action, loop: loop2, onClick, children, ...rest } = {
|
|
20913
|
-
...defaultProps$
|
|
20939
|
+
...defaultProps$q,
|
|
20914
20940
|
...props
|
|
20915
20941
|
};
|
|
20916
20942
|
const [clicked, setClicked] = React.useState(false);
|
|
20917
20943
|
const classes = classNames({
|
|
20918
20944
|
"nut-ani-container": true,
|
|
20919
|
-
[`${classPrefix$
|
|
20945
|
+
[`${classPrefix$5}-${type2}`]: action === "initial" || clicked ? type2 : false,
|
|
20920
20946
|
loop: loop2
|
|
20921
20947
|
});
|
|
20922
20948
|
const cls = classNames(classes, className);
|
|
@@ -20931,9 +20957,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20931
20957
|
};
|
|
20932
20958
|
return /* @__PURE__ */ React.createElement("div", { className: "nut-animate" }, /* @__PURE__ */ React.createElement("div", { className: cls, onClick: handleClick2, ...rest }, children));
|
|
20933
20959
|
};
|
|
20934
|
-
Animate.defaultProps = defaultProps$
|
|
20960
|
+
Animate.defaultProps = defaultProps$q;
|
|
20935
20961
|
Animate.displayName = "NutAnimate";
|
|
20936
|
-
const defaultProps$
|
|
20962
|
+
const defaultProps$p = {
|
|
20937
20963
|
...ComponentDefaults,
|
|
20938
20964
|
length: 0,
|
|
20939
20965
|
value: "",
|
|
@@ -20952,7 +20978,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
20952
20978
|
style,
|
|
20953
20979
|
...reset
|
|
20954
20980
|
} = {
|
|
20955
|
-
...defaultProps$
|
|
20981
|
+
...defaultProps$p,
|
|
20956
20982
|
...props
|
|
20957
20983
|
};
|
|
20958
20984
|
const classPrefix2 = "nut-countup";
|
|
@@ -21016,9 +21042,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21016
21042
|
);
|
|
21017
21043
|
})));
|
|
21018
21044
|
};
|
|
21019
|
-
CountUp.defaultProps = defaultProps$
|
|
21045
|
+
CountUp.defaultProps = defaultProps$p;
|
|
21020
21046
|
CountUp.displayName = "NutCountUp";
|
|
21021
|
-
const defaultProps$
|
|
21047
|
+
const defaultProps$o = {};
|
|
21022
21048
|
class AnimatingNumbers extends React.Component {
|
|
21023
21049
|
constructor(props) {
|
|
21024
21050
|
super(props);
|
|
@@ -21028,11 +21054,11 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21028
21054
|
return /* @__PURE__ */ React.createElement("div", { className: "nut-animatingnumbers" });
|
|
21029
21055
|
}
|
|
21030
21056
|
}
|
|
21031
|
-
__publicField(AnimatingNumbers, "defaultProps", defaultProps$
|
|
21057
|
+
__publicField(AnimatingNumbers, "defaultProps", defaultProps$o);
|
|
21032
21058
|
__publicField(AnimatingNumbers, "displayName", "NutAnimatingNumbers");
|
|
21033
21059
|
__publicField(AnimatingNumbers, "CountUp", CountUp);
|
|
21034
21060
|
AnimatingNumbers.CountUp = CountUp;
|
|
21035
|
-
const defaultProps$
|
|
21061
|
+
const defaultProps$n = {
|
|
21036
21062
|
...ComponentDefaults,
|
|
21037
21063
|
src: "",
|
|
21038
21064
|
muted: false,
|
|
@@ -21075,7 +21101,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21075
21101
|
children,
|
|
21076
21102
|
...rest
|
|
21077
21103
|
} = {
|
|
21078
|
-
...defaultProps$
|
|
21104
|
+
...defaultProps$n,
|
|
21079
21105
|
...props
|
|
21080
21106
|
};
|
|
21081
21107
|
const [playing, setPlaying] = React.useState(false);
|
|
@@ -21281,31 +21307,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
21281
21307
|
/* @__PURE__ */ React.createElement("track", { kind: "captions" })
|
|
21282
21308
|
));
|
|
21283
21309
|
};
|
|
21284
|
-
Audio.defaultProps = defaultProps$
|
|
21310
|
+
Audio.defaultProps = defaultProps$n;
|
|
21285
21311
|
Audio.displayName = "NutAudio";
|
|
21286
|
-
const defaultProps$n = {
|
|
21287
|
-
...ComponentDefaults,
|
|
21288
|
-
maxContent: "",
|
|
21289
|
-
max: "",
|
|
21290
|
-
maxBackground: "#eee",
|
|
21291
|
-
maxColor: "#666",
|
|
21292
|
-
gap: "-8",
|
|
21293
|
-
level: "left"
|
|
21294
|
-
};
|
|
21295
|
-
const classPrefix$5 = `nut-avatar-group`;
|
|
21296
|
-
const AvatarGroup = (props) => {
|
|
21297
|
-
const propAvatarGroup = { ...defaultProps$n, ...props };
|
|
21298
|
-
const { className, style, children } = propAvatarGroup;
|
|
21299
|
-
const avatarGroupRef = React.useRef(null);
|
|
21300
|
-
const cls = classNames(classPrefix$5, className);
|
|
21301
|
-
const parentAvatar = {
|
|
21302
|
-
propAvatarGroup,
|
|
21303
|
-
avatarGroupRef
|
|
21304
|
-
};
|
|
21305
|
-
return /* @__PURE__ */ React.createElement(AvatarContext.Provider, { value: parentAvatar }, /* @__PURE__ */ React.createElement("div", { className: cls, style, ref: avatarGroupRef }, children));
|
|
21306
|
-
};
|
|
21307
|
-
AvatarGroup.defaultProps = defaultProps$n;
|
|
21308
|
-
AvatarGroup.displayName = "NutAvatarGroup";
|
|
21309
21312
|
const defaultProps$m = {
|
|
21310
21313
|
...ComponentDefaults,
|
|
21311
21314
|
strokeWidth: 5,
|
|
@@ -22580,6 +22583,8 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22580
22583
|
});
|
|
22581
22584
|
SwiperItem.defaultProps = defaultProps$e;
|
|
22582
22585
|
SwiperItem.displayName = "NutSwiperItem";
|
|
22586
|
+
const InnerSwiper = Swiper;
|
|
22587
|
+
InnerSwiper.Item = SwiperItem;
|
|
22583
22588
|
const defaultProps$d = {
|
|
22584
22589
|
...ComponentDefaults,
|
|
22585
22590
|
images: [],
|
|
@@ -22755,7 +22760,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
22755
22760
|
onTouchStart
|
|
22756
22761
|
},
|
|
22757
22762
|
/* @__PURE__ */ React.createElement(
|
|
22758
|
-
|
|
22763
|
+
InnerSwiper,
|
|
22759
22764
|
{
|
|
22760
22765
|
autoPlay,
|
|
22761
22766
|
className: `${classPrefix2}-swiper`,
|
|
@@ -24200,7 +24205,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
24200
24205
|
exports2.Sticky = Sticky;
|
|
24201
24206
|
exports2.SubSideNavBar = SubSideNavBar;
|
|
24202
24207
|
exports2.Swipe = Swipe;
|
|
24203
|
-
exports2.Swiper =
|
|
24208
|
+
exports2.Swiper = InnerSwiper;
|
|
24204
24209
|
exports2.SwiperItem = SwiperItem;
|
|
24205
24210
|
exports2.Switch = Switch;
|
|
24206
24211
|
exports2.TabPane = TabPane;
|