@nutui/nutui-react-taro 2.6.20 → 2.6.22

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +30 -5
  2. package/dist/esm/Address.js +1 -1
  3. package/dist/esm/AnimatingNumbers.js +7 -7
  4. package/dist/esm/Audio/style/style.css +1 -1
  5. package/dist/esm/Audio.js +1 -1
  6. package/dist/esm/Avatar.js +1 -1
  7. package/dist/esm/AvatarCropper.js +1 -1
  8. package/dist/esm/BackTop.js +1 -1
  9. package/dist/esm/Barrage.js +1 -1
  10. package/dist/esm/Button.js +1 -1
  11. package/dist/esm/Calendar.js +1 -1
  12. package/dist/esm/CalendarItem.js +1 -1
  13. package/dist/esm/Cascader.js +1 -1
  14. package/dist/esm/Dialog.js +1 -1
  15. package/dist/esm/Empty.js +1 -1
  16. package/dist/esm/Menu.js +1 -1
  17. package/dist/esm/MenuItem.js +1 -1
  18. package/dist/esm/NavBar/style/style.css +1 -1
  19. package/dist/esm/NavBar.js +1 -1
  20. package/dist/esm/Radio.js +1 -1
  21. package/dist/esm/RadioGroup.js +1 -1
  22. package/dist/esm/Range/style/style.css +1 -1
  23. package/dist/esm/Range.js +1 -1
  24. package/dist/esm/Skeleton.js +1 -1
  25. package/dist/esm/Tabs.js +1 -1
  26. package/dist/esm/Uploader.js +1 -1
  27. package/dist/esm/{address.taro-CWr6jIYg.js → address.taro-Ai6DQF3D.js} +1 -1
  28. package/dist/esm/{audio.taro--yoX2oyx.js → audio.taro-qK1wq4IH.js} +4 -5
  29. package/dist/esm/avatar.taro-9dU2KeWv.js +82 -0
  30. package/dist/esm/{avatarcropper.taro-B0I9uLNp.js → avatarcropper.taro-meD2sizv.js} +1 -1
  31. package/dist/esm/{backtop.taro-CpzSXDW3.js → backtop.taro-D3Lo3jFO.js} +8 -10
  32. package/dist/esm/{barrage.taro-CA-9uADD.js → barrage.taro-D2lmvcB-.js} +40 -26
  33. package/dist/esm/{button.taro-1kEru6r9.js → button.taro-CixO32Hw.js} +2 -2
  34. package/dist/esm/{calendar.taro-Csq-7imv.js → calendar.taro-C52T1TFf.js} +1 -1
  35. package/dist/esm/{calendaritem.taro-BOMJjsx9.js → calendaritem.taro-CHdJXKkc.js} +1 -1
  36. package/dist/esm/{cascader.taro-DZ_oBTm0.js → cascader.taro-CMOCzo0m.js} +1 -1
  37. package/dist/esm/{dialog.taro-Bg730q8d.js → dialog.taro-yjDaaRHA.js} +1 -1
  38. package/dist/esm/{empty.taro-Dr4eSaDg.js → empty.taro-Dt07kty5.js} +1 -1
  39. package/dist/esm/{menu.taro-BFc4uUxG.js → menu.taro-BmjnA_YM.js} +13 -13
  40. package/dist/esm/{menuitem.taro-D6KQvdRw.js → menuitem.taro-DCqPC4Nu.js} +13 -13
  41. package/dist/esm/{navbar.taro-Dea0-s9Q.js → navbar.taro-HRFRDGii.js} +7 -2
  42. package/dist/esm/nutui-react.es.js +20 -20
  43. package/dist/esm/{radio.taro-CzOHqD3O.js → radio.taro-M2in687s.js} +24 -20
  44. package/dist/esm/{raf-zwv-SBjP.js → raf-Di10dXPS.js} +2 -1
  45. package/dist/esm/{range.taro-BilM3sMH.js → range.taro-D4U2Q7Wx.js} +49 -44
  46. package/dist/esm/{skeleton.taro-bD6fHZop.js → skeleton.taro-D9Vkgsyx.js} +1 -1
  47. package/dist/esm/{tabs.taro-CJiI4q_-.js → tabs.taro-D8bDfm4x.js} +1 -1
  48. package/dist/esm/{uploader.taro-C-8Jf7un.js → uploader.taro-CceZ5Y4t.js} +8 -7
  49. package/dist/locales/base.js +1 -1
  50. package/dist/locales/en-US.js +1 -1
  51. package/dist/locales/id-ID.js +1 -1
  52. package/dist/locales/tr-TR.js +1 -1
  53. package/dist/locales/zh-CN.js +1 -1
  54. package/dist/locales/zh-TW.js +1 -1
  55. package/dist/locales/zh-UG.js +1 -1
  56. package/dist/nutui.react.es.js +262 -284
  57. package/dist/nutui.react.umd.js +262 -284
  58. package/dist/packages/navbar/navbar.scss +0 -5
  59. package/dist/packages/range/range.scss +2 -0
  60. package/dist/style.css +1 -1
  61. package/dist/types/packages/avatar/avatar.d.ts +1 -1
  62. package/dist/types/packages/overlay/overlay.d.ts +1 -1
  63. package/dist/types/packages/uploader/uploader.d.ts +1 -0
  64. package/dist/types/packages/uploader/uploader.taro.d.ts +5 -0
  65. package/package.json +1 -1
  66. package/dist/esm/avatar.taro-DSL3ErmC.js +0 -85
@@ -12,6 +12,7 @@ const InternalBarrage = (props, ref) => {
12
12
  const barrageContainer = useRef(null);
13
13
  const barrageCWidth = useRef(0);
14
14
  const timer = useRef(0);
15
+ const domTimer = useRef(0);
15
16
  const index = useRef(0);
16
17
  const times = useRef([]);
17
18
  const historyIndex = useRef(-1);
@@ -33,25 +34,31 @@ const InternalBarrage = (props, ref) => {
33
34
  }
34
35
  return 0;
35
36
  });
37
+ const clearDomTimeout = () => {
38
+ if (domTimer.current) {
39
+ clearTimeout(domTimer.current);
40
+ domTimer.current = 0;
41
+ }
42
+ };
36
43
  useEffect(() => {
37
44
  const init = () => __awaiter(void 0, void 0, void 0, function* () {
45
+ var _a2;
38
46
  if (barrageBody.current) {
39
47
  barrageCWidth.current = yield getNodeWidth(barrageBody.current);
48
+ (_a2 = barrageBody.current) === null || _a2 === void 0 ? void 0 : _a2.style.setProperty("--move-distance", `-${barrageCWidth.current}px`);
49
+ index.current = 0;
50
+ run();
40
51
  }
41
52
  });
42
- init();
43
- setTimeout(() => {
44
- var _a2;
45
- (_a2 = barrageBody.current) === null || _a2 === void 0 ? void 0 : _a2.style.setProperty("--move-distance", `-${barrageCWidth.current}px`);
46
- index.current = 0;
47
- run();
53
+ domTimer.current = window.setTimeout(() => {
54
+ init();
48
55
  }, 300);
49
56
  return () => {
50
- clearInterval(timer.current);
57
+ clearDomTimeout();
51
58
  };
52
59
  }, [list]);
53
60
  const run = () => {
54
- clearInterval(timer.current);
61
+ clearTimeout(timer.current);
55
62
  let intervalCache = interval;
56
63
  const _index = (loop ? index.current % list.length : index.current) % rows;
57
64
  const result = times.current[_index] - rows * interval;
@@ -62,7 +69,28 @@ const InternalBarrage = (props, ref) => {
62
69
  play();
63
70
  }, intervalCache);
64
71
  };
65
- const play = () => __awaiter(void 0, void 0, void 0, function* () {
72
+ const setStyle = (el, currentIndex) => __awaiter(void 0, void 0, void 0, function* () {
73
+ try {
74
+ if (el) {
75
+ const refe = yield getRectByTaro(el);
76
+ const width = refe.width;
77
+ const height = refe.height;
78
+ el.classList.add("move");
79
+ const elScrollDuration = Math.round(width / barrageCWidth.current * duration);
80
+ times.current[currentIndex] = elScrollDuration;
81
+ el.style.animationDuration = `${duration + elScrollDuration}ms`;
82
+ el.style.top = `${currentIndex * (height + gapY) + 20}px`;
83
+ el.style.width = `${width}px`;
84
+ }
85
+ } catch (error) {
86
+ console.log("异常自动流转到下一个", error);
87
+ barrageContainer.current.removeChild(el);
88
+ }
89
+ el.addEventListener("animationend", () => {
90
+ barrageContainer.current.removeChild(el);
91
+ });
92
+ });
93
+ const play = () => {
66
94
  if (!loop && index.current >= list.length) {
67
95
  return;
68
96
  }
@@ -74,26 +102,12 @@ const InternalBarrage = (props, ref) => {
74
102
  }
75
103
  historyIndex.current = currentIndex;
76
104
  el.innerHTML = list[_index];
77
- el.classList.add("barrage-item");
78
105
  barrageContainer.current.appendChild(el);
79
- try {
80
- const width = yield getNodeWidth(el);
81
- const height = yield getNodeWidth(el, "height");
82
- el.classList.add("move");
83
- const elScrollDuration = width / barrageCWidth.current * duration;
84
- times.current[currentIndex] = Math.ceil(elScrollDuration);
85
- el.style.animationDuration = `${(duration + elScrollDuration).toFixed(2)}ms`;
86
- el.style.top = `${currentIndex * (height + gapY) + 20}px`;
87
- el.style.width = `${width}px`;
88
- } catch (error) {
89
- console.log("异常自动流转到下一个");
90
- }
91
- el.addEventListener("animationend", () => {
92
- barrageContainer.current.removeChild(el);
93
- });
106
+ el.classList.add("barrage-item");
107
+ requestAnimationFrame(() => setStyle(el, currentIndex));
94
108
  index.current++;
95
109
  run();
96
- });
110
+ };
97
111
  return React__default.createElement(
98
112
  View,
99
113
  Object.assign({ className: classes, ref: barrageBody }, restProps),
@@ -11,7 +11,7 @@ const Button = React__default.forwardRef((props, ref) => {
11
11
  const _a = Object.assign(Object.assign({}, defaultProps), props), { color, shape, fill, loading, disabled, type, size, block, icon, rightIcon, children, className, style, nativeType, onClick } = _a, rest = __rest(_a, ["color", "shape", "fill", "loading", "disabled", "type", "size", "block", "icon", "rightIcon", "children", "className", "style", "nativeType", "onClick"]);
12
12
  const getStyle = useCallback(() => {
13
13
  const style2 = {};
14
- if (props.color) {
14
+ if (color) {
15
15
  if (props.fill === "outline" || props.fill === "dashed") {
16
16
  style2.color = color;
17
17
  if (!(color === null || color === void 0 ? void 0 : color.includes("gradient"))) {
@@ -24,7 +24,7 @@ const Button = React__default.forwardRef((props, ref) => {
24
24
  }
25
25
  }
26
26
  return style2;
27
- }, [color]);
27
+ }, [color, props.fill]);
28
28
  const handleClick = (e) => {
29
29
  if (!loading && !disabled && onClick) {
30
30
  onClick(e);
@@ -1,6 +1,6 @@
1
1
  import React__default, { useRef } from "react";
2
2
  import { P as Popup } from "./popup.taro-DV32k5dP.js";
3
- import { C as CalendarItem } from "./calendaritem.taro-BOMJjsx9.js";
3
+ import { C as CalendarItem } from "./calendaritem.taro-CHdJXKkc.js";
4
4
  import { U as Utils } from "./date-CYwRNlGq.js";
5
5
  import { u as useConfig } from "./configprovider.taro-C3WyeHSO.js";
6
6
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
@@ -4,7 +4,7 @@ import { ScrollView } from "@tarojs/components";
4
4
  import Taro, { nextTick } from "@tarojs/taro";
5
5
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
6
6
  import { U as Utils, g as getPreMonthDates, a as getDaysStatus, b as getCurrMonthData } from "./date-CYwRNlGq.js";
7
- import { r as requestAniFrame } from "./raf-zwv-SBjP.js";
7
+ import { r as requestAniFrame } from "./raf-Di10dXPS.js";
8
8
  import { u as useConfig } from "./configprovider.taro-C3WyeHSO.js";
9
9
  import { u as usePropsValue } from "./use-props-value-SH9krhkx.js";
10
10
  const splitDate = (date) => {
@@ -4,7 +4,7 @@ import classNames from "classnames";
4
4
  import { Loading, Checklist } from "@nutui/icons-react-taro";
5
5
  import { ScrollView } from "@tarojs/components";
6
6
  import { P as Popup } from "./popup.taro-DV32k5dP.js";
7
- import { T as Tabs } from "./tabs.taro-CJiI4q_-.js";
7
+ import { T as Tabs } from "./tabs.taro-D8bDfm4x.js";
8
8
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
9
9
  import { u as usePropsValue } from "./use-props-value-SH9krhkx.js";
10
10
  import { u as useConfig } from "./configprovider.taro-C3WyeHSO.js";
@@ -4,7 +4,7 @@ import classNames from "classnames";
4
4
  import { CSSTransition } from "react-transition-group";
5
5
  import { View } from "@tarojs/components";
6
6
  import { Close } from "@nutui/icons-react-taro";
7
- import { B as Button } from "./button.taro-1kEru6r9.js";
7
+ import { B as Button } from "./button.taro-CixO32Hw.js";
8
8
  import { u as useConfig } from "./configprovider.taro-C3WyeHSO.js";
9
9
  import { u as useLockScrollTaro, O as Overlay } from "./overlay.taro-C8eXSsJH.js";
10
10
  import { b as useParams, u as useCustomEvent, a as useCustomEventsPath, c as customEvents } from "./use-custom-event-DuP4onEm.js";
@@ -2,7 +2,7 @@ import { _ as __rest } from "./tslib.es6-iWu3F_1J.js";
2
2
  import React__default, { useState, useEffect } from "react";
3
3
  import classNames from "classnames";
4
4
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
5
- import { B as Button } from "./button.taro-1kEru6r9.js";
5
+ import { B as Button } from "./button.taro-CixO32Hw.js";
6
6
  const defaultStatus = {
7
7
  empty: "https://storage.360buyimg.com/imgtools/30186cfda0-0d3eee40-c0ac-11ee-9382-9125782aa3b8.png",
8
8
  error: "https://storage.360buyimg.com/imgtools/f3278d0ebb-0ce360c0-c0ac-11ee-8375-193101bb1a46.png",
@@ -1,8 +1,8 @@
1
1
  import { _ as __rest } from "./tslib.es6-iWu3F_1J.js";
2
- import React__default, { useRef, useState, useEffect } from "react";
2
+ import React__default, { useRef, useState, useCallback, useEffect } from "react";
3
3
  import classNames from "classnames";
4
4
  import { ArrowUp, ArrowDown } from "@nutui/icons-react-taro";
5
- import { M as MenuItem } from "./menuitem.taro-D6KQvdRw.js";
5
+ import { M as MenuItem } from "./menuitem.taro-DCqPC4Nu.js";
6
6
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
7
7
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { activeColor: "", closeOnOverlayClick: true, scrollFixed: false, lockScroll: true, overlay: true, icon: null, onOpen: (index, from) => {
8
8
  }, onClose: (index, from) => {
@@ -10,24 +10,26 @@ const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { activ
10
10
  const Menu = (props) => {
11
11
  const _a = Object.assign(Object.assign({}, defaultProps), props), { className, icon, scrollFixed, lockScroll, overlay, closeOnOverlayClick, children, activeColor, onClose, onOpen } = _a, rest = __rest(_a, ["className", "icon", "scrollFixed", "lockScroll", "overlay", "closeOnOverlayClick", "children", "activeColor", "onClose", "onOpen"]);
12
12
  const menuRef = useRef(null);
13
+ const [showMenuItem, setShowMenuItem] = useState([]);
14
+ const [menuItemTitle, setMenuItemTitle] = useState([]);
13
15
  const [isScrollFixed, setIsScrollFixed] = useState(false);
16
+ const cls = classNames(`nut-menu`, className, {
17
+ "scroll-fixed": isScrollFixed
18
+ });
14
19
  const getScrollTop = (el) => {
15
- return Math.max(0, "scrollTop" in el ? el.scrollTop : el.pageYOffset);
20
+ return Math.max(0, el === window ? window.scrollY : el.scrollTop);
16
21
  };
17
- const onScroll = () => {
18
- const { scrollFixed: scrollFixed2 } = props;
22
+ const onScroll = useCallback(() => {
19
23
  const scrollTop = getScrollTop(window);
20
- const isFixed = scrollTop > (typeof scrollFixed2 === "boolean" ? 30 : Number(scrollFixed2));
24
+ const isFixed = scrollTop > (typeof scrollFixed === "boolean" ? 30 : Number(scrollFixed));
21
25
  setIsScrollFixed(isFixed);
22
- };
26
+ }, [scrollFixed]);
23
27
  useEffect(() => {
24
28
  if (scrollFixed) {
25
29
  window.addEventListener("scroll", onScroll);
26
30
  }
27
31
  return () => window.removeEventListener("scroll", onScroll);
28
- }, []);
29
- const [showMenuItem, setShowMenuItem] = useState([]);
30
- const [menuItemTitle, setMenuItemTitle] = useState([]);
32
+ }, [scrollFixed, onScroll]);
31
33
  const toggleMenuItem = (index, from = "NORMAL") => {
32
34
  showMenuItem[index] = !showMenuItem[index];
33
35
  if (showMenuItem[index]) {
@@ -105,9 +107,7 @@ const Menu = (props) => {
105
107
  };
106
108
  return React__default.createElement(
107
109
  "div",
108
- Object.assign({}, rest, { className: classNames(`nut-menu`, className, {
109
- "scroll-fixed": isScrollFixed
110
- }), ref: menuRef }),
110
+ Object.assign({}, rest, { className: cls, ref: menuRef }),
111
111
  React__default.createElement("div", { className: classNames("nut-menu-bar", {
112
112
  opened: showMenuItem.includes(true)
113
113
  }) }, menuTitle()),
@@ -1,5 +1,5 @@
1
1
  import { a as __awaiter } from "./tslib.es6-iWu3F_1J.js";
2
- import React__default, { forwardRef, useState, useRef, useEffect, useMemo, useCallback, useImperativeHandle } from "react";
2
+ import React__default, { forwardRef, useState, useRef, useEffect, useCallback, useMemo, useImperativeHandle } from "react";
3
3
  import classNames from "classnames";
4
4
  import { getSystemInfoSync, usePageScroll } from "@tarojs/taro";
5
5
  import { View } from "@tarojs/components";
@@ -26,9 +26,19 @@ const MenuItem = forwardRef((props, ref) => {
26
26
  useEffect(() => {
27
27
  setShowPopup(show);
28
28
  }, [show]);
29
+ const getParentOffset = useCallback(() => {
30
+ setTimeout(() => __awaiter(void 0, void 0, void 0, function* () {
31
+ const p = parent.menuRef.current;
32
+ const rect = yield getRectByTaro(p);
33
+ setPosition({
34
+ height: rect.height,
35
+ top: rect.top
36
+ });
37
+ }), 100);
38
+ }, [parent.menuRef]);
29
39
  useEffect(() => {
30
40
  getParentOffset();
31
- }, [showPopup]);
41
+ }, [showPopup, getParentOffset]);
32
42
  const windowHeight = useMemo(() => getSystemInfoSync().windowHeight, []);
33
43
  const updateItemOffset = useCallback(() => {
34
44
  if (!parent.lockScroll)
@@ -42,7 +52,7 @@ const MenuItem = forwardRef((props, ref) => {
42
52
  });
43
53
  }
44
54
  });
45
- }, [direction, windowHeight]);
55
+ }, [direction, windowHeight, parent.lockScroll, parent.menuRef]);
46
56
  usePageScroll(updateItemOffset);
47
57
  useImperativeHandle(ref, () => ({
48
58
  toggle: (s) => {
@@ -70,16 +80,6 @@ const MenuItem = forwardRef((props, ref) => {
70
80
  top: 0,
71
81
  height: 0
72
82
  });
73
- const getParentOffset = () => {
74
- setTimeout(() => __awaiter(void 0, void 0, void 0, function* () {
75
- const p = parent.menuRef.current;
76
- const rect = yield getRectByTaro(p);
77
- setPosition({
78
- height: rect.height,
79
- top: rect.top
80
- });
81
- }), 100);
82
- };
83
83
  const isShow = () => {
84
84
  if (showPopup)
85
85
  return {};
@@ -4,6 +4,7 @@ import classNames from "classnames";
4
4
  import { View } from "@tarojs/components";
5
5
  import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
6
6
  import { g as getRectByTaro } from "./get-rect-by-taro-THaHH07X.js";
7
+ import { S as SafeArea } from "./safearea.taro-BJpvFsMf.js";
7
8
  const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { left: "", right: "", titleAlign: "center", back: "", fixed: false, safeAreaInsetTop: false, placeholder: false, zIndex: 10 });
8
9
  const NavBar = (props) => {
9
10
  const { right, left, titleAlign, className, style, back, fixed, safeAreaInsetTop, placeholder, zIndex, onBackClick } = Object.assign(Object.assign({}, defaultProps), props);
@@ -77,11 +78,15 @@ const NavBar = (props) => {
77
78
  };
78
79
  const classes = classNames({
79
80
  [`${classPrefix}-fixed`]: fixed,
80
- [`${classPrefix}-safe-area-inset-top`]: safeAreaInsetTop,
81
81
  [`${classPrefix}-title-align-${titleAlign}`]: true
82
82
  });
83
83
  const cls = classNames(classPrefix, classes, className);
84
- return React__default.createElement(React__default.Fragment, null, fixed && placeholder ? React__default.createElement(View, { className: `${classPrefix}-placeholder` }, renderWrapper()) : renderWrapper());
84
+ return React__default.createElement(
85
+ React__default.Fragment,
86
+ null,
87
+ safeAreaInsetTop && React__default.createElement(SafeArea, { position: "top" }),
88
+ fixed && placeholder ? React__default.createElement(View, { className: `${classPrefix}-placeholder` }, renderWrapper()) : renderWrapper()
89
+ );
85
90
  };
86
91
  NavBar.displayName = "NutNavBar";
87
92
  export {
@@ -1,4 +1,4 @@
1
- import { B } from "./button.taro-1kEru6r9.js";
1
+ import { B } from "./button.taro-CixO32Hw.js";
2
2
  import { C } from "./cell.taro-DWLhb5m6.js";
3
3
  import { C as C2 } from "./cellgroup.taro-DTLGMR_c.js";
4
4
  import { C as C3, g, s, u, a } from "./configprovider.taro-C3WyeHSO.js";
@@ -13,46 +13,46 @@ import { R } from "./row.taro-ItEq1Bi5.js";
13
13
  import { S } from "./space.taro-B1KsEPZL.js";
14
14
  import { S as S2 } from "./sticky.taro-DC98CdU7.js";
15
15
  import { S as S3 } from "./safearea.taro-BJpvFsMf.js";
16
- import { B as B2 } from "./backtop.taro-CpzSXDW3.js";
16
+ import { B as B2 } from "./backtop.taro-D3Lo3jFO.js";
17
17
  import { E } from "./elevator.taro-Bsc8PcT0.js";
18
18
  import { F } from "./fixednav.taro-BodErnYy.js";
19
- import { N } from "./navbar.taro-Dea0-s9Q.js";
19
+ import { N } from "./navbar.taro-HRFRDGii.js";
20
20
  import { S as S4 } from "./sidenavbar.taro-DNwoQw9u.js";
21
21
  import { S as S5 } from "./sidenavbaritem.taro-BKpzXpzG.js";
22
22
  import { S as S6 } from "./subsidenavbar.taro-CSU3DhNq.js";
23
23
  import { T } from "./tabbar.taro-BiQDgZQF.js";
24
24
  import { T as T2 } from "./tabbaritem.taro-BiIVucQz.js";
25
25
  import { T as T3 } from "./tabpane.taro-BAe86j3t.js";
26
- import { T as T4 } from "./tabs.taro-CJiI4q_-.js";
27
- import { A } from "./address.taro-CWr6jIYg.js";
28
- import { C as C5 } from "./calendar.taro-Csq-7imv.js";
29
- import { C as C6 } from "./calendaritem.taro-BOMJjsx9.js";
26
+ import { T as T4 } from "./tabs.taro-D8bDfm4x.js";
27
+ import { A } from "./address.taro-Ai6DQF3D.js";
28
+ import { C as C5 } from "./calendar.taro-C52T1TFf.js";
29
+ import { C as C6 } from "./calendaritem.taro-CHdJXKkc.js";
30
30
  import { C as C7 } from "./calendarcard.taro-CvWyBqnr.js";
31
- import { C as C8 } from "./cascader.taro-DZ_oBTm0.js";
31
+ import { C as C8 } from "./cascader.taro-CMOCzo0m.js";
32
32
  import { C as C9, a as a2 } from "./checkbox.taro-CgqJyhrh.js";
33
33
  import { D as D2 } from "./datepicker.taro-DibmSueg.js";
34
34
  import { default as default2 } from "./Form.js";
35
35
  import { F as F2 } from "./formitem.taro-CEWRz5EJ.js";
36
36
  import { I as I2 } from "./input.taro-CA9ZpM9a.js";
37
37
  import { I as I3 } from "./inputnumber.taro-DPRZtV42.js";
38
- import { M } from "./menu.taro-BFc4uUxG.js";
39
- import { M as M2 } from "./menuitem.taro-D6KQvdRw.js";
38
+ import { M } from "./menu.taro-BmjnA_YM.js";
39
+ import { M as M2 } from "./menuitem.taro-DCqPC4Nu.js";
40
40
  import { N as N2 } from "./numberkeyboard.taro-CIlStObb.js";
41
41
  import { P } from "./picker.taro-mCnxpFCY.js";
42
- import { R as R2, a as a3 } from "./radio.taro-CzOHqD3O.js";
43
- import { R as R3 } from "./range.taro-BilM3sMH.js";
42
+ import { R as R2, a as a3 } from "./radio.taro-M2in687s.js";
43
+ import { R as R3 } from "./range.taro-D4U2Q7Wx.js";
44
44
  import { R as R4 } from "./rate.taro-CPGkjYYu.js";
45
45
  import { S as S7 } from "./searchbar.taro-LaO2Xr2t.js";
46
46
  import { S as S8 } from "./shortpassword.taro-ByEtEDDl.js";
47
47
  import { S as S9 } from "./signature.taro-BW4eiGIR.js";
48
48
  import { S as S10 } from "./switch.taro-CdBmDo18.js";
49
49
  import { T as T5 } from "./textarea.taro-EJQxRHZR.js";
50
- import { U } from "./uploader.taro-C-8Jf7un.js";
50
+ import { U } from "./uploader.taro-CceZ5Y4t.js";
51
51
  import { A as A2 } from "./actionsheet.taro-CgfXnK1M.js";
52
52
  import { B as B3 } from "./badge.taro-B42_7q8v.js";
53
- import { B as B4 } from "./dialog.taro-Bg730q8d.js";
53
+ import { B as B4 } from "./dialog.taro-yjDaaRHA.js";
54
54
  import { D as D3 } from "./drag.taro-B_sfzmtW.js";
55
- import { E as E2 } from "./empty.taro-Dr4eSaDg.js";
55
+ import { E as E2 } from "./empty.taro-Dt07kty5.js";
56
56
  import { I as I4 } from "./infiniteloading.taro-DzIrZvc0.js";
57
57
  import { L as L2 } from "./loading.taro-n_qoNgCW.js";
58
58
  import { N as N3 } from "./noticebar.taro-BjKDC7We.js";
@@ -60,13 +60,13 @@ import { N as N4 } from "./notify.taro-BVXg7xTI.js";
60
60
  import { P as P2 } from "./popover.taro-BHcidbZG.js";
61
61
  import { P as P3 } from "./popup.taro-DV32k5dP.js";
62
62
  import { P as P4 } from "./pulltorefresh.taro-BiSDwLpA.js";
63
- import { S as S11 } from "./skeleton.taro-bD6fHZop.js";
63
+ import { S as S11 } from "./skeleton.taro-D9Vkgsyx.js";
64
64
  import { S as S12 } from "./swipe.taro-Bsk2fnEl.js";
65
65
  import { T as T6 } from "./toast.taro-Tx0IHbsl.js";
66
66
  import { A as A3 } from "./animate.taro-CQVEyDKL.js";
67
67
  import { default as default3 } from "./AnimatingNumbers.js";
68
- import { A as A4 } from "./audio.taro--yoX2oyx.js";
69
- import { A as A5 } from "./avatar.taro-DSL3ErmC.js";
68
+ import { A as A4 } from "./audio.taro-qK1wq4IH.js";
69
+ import { A as A5 } from "./avatar.taro-9dU2KeWv.js";
70
70
  import { A as A6 } from "./avatargroup.taro-ScakjsY1.js";
71
71
  import { C as C10 } from "./circleprogress.taro-BTRyQG5T.js";
72
72
  import { C as C11 } from "./collapse.taro-wqL6MWZr.js";
@@ -87,13 +87,13 @@ import { T as T8 } from "./tag.taro-CFt28RLm.js";
87
87
  import { T as T9 } from "./tour.taro-BvBZa8nq.js";
88
88
  import { V } from "./video.taro-CecLv4sr.js";
89
89
  import { V as V2 } from "./virtuallist.taro-BlPW8ibd.js";
90
- import { B as B5 } from "./barrage.taro-CA-9uADD.js";
90
+ import { B as B5 } from "./barrage.taro-D2lmvcB-.js";
91
91
  import { C as C14 } from "./card.taro-DxcIi5qH.js";
92
92
  import { T as T10 } from "./timedetail.taro-ya5JNy2L.js";
93
93
  import { T as T11 } from "./timeselect.taro-DE_a87DT.js";
94
94
  import { T as T12 } from "./trendarrow.taro-DKx5cGIh.js";
95
95
  import { W } from "./watermark.taro-CbO7mKFD.js";
96
- import { A as A7 } from "./avatarcropper.taro-B0I9uLNp.js";
96
+ import { A as A7 } from "./avatarcropper.taro-meD2sizv.js";
97
97
  export {
98
98
  A2 as ActionSheet,
99
99
  A as Address,
@@ -15,6 +15,9 @@ const defaultProps$1 = {
15
15
  const classPrefix = "nut-radiogroup";
16
16
  const RadioGroup = React__default.forwardRef((props, ref) => {
17
17
  const _a = Object.assign(Object.assign({}, defaultProps$1), props), { children, className, value, defaultValue, onChange, shape, labelPosition, direction, options, disabled } = _a, rest = __rest(_a, ["children", "className", "value", "defaultValue", "onChange", "shape", "labelPosition", "direction", "options", "disabled"]);
18
+ const cls = classNames(classPrefix, {
19
+ [`${classPrefix}-${props.direction}`]: props.direction
20
+ }, className);
18
21
  const [val2State, setVal2State] = usePropsValue({
19
22
  defaultValue: props.defaultValue,
20
23
  value: props.value,
@@ -26,7 +29,7 @@ const RadioGroup = React__default.forwardRef((props, ref) => {
26
29
  var { label, value: value2, disabled: disabled2, onChange: onChange2 } = _a2, rest2 = __rest(_a2, ["label", "value", "disabled", "onChange"]);
27
30
  return React__default.createElement(Radio, Object.assign({}, rest2, { key: value2 === null || value2 === void 0 ? void 0 : value2.toString(), children: label, value: value2, disabled: disabled2, onChange: onChange2, labelPosition, checked: value2 === val2State }));
28
31
  });
29
- }, [options]);
32
+ }, [options, labelPosition, val2State]);
30
33
  return React__default.createElement(
31
34
  RadioContext.Provider,
32
35
  { value: {
@@ -41,9 +44,7 @@ const RadioGroup = React__default.forwardRef((props, ref) => {
41
44
  setVal2State("");
42
45
  }
43
46
  } },
44
- React__default.createElement("div", Object.assign({ className: classNames(classPrefix, {
45
- [`${classPrefix}-${props.direction}`]: props.direction
46
- }, className) }, rest), (options === null || options === void 0 ? void 0 : options.length) ? renderOptionsChildren() : children)
47
+ React__default.createElement("div", Object.assign({ className: cls }, rest), (options === null || options === void 0 ? void 0 : options.length) ? renderOptionsChildren() : children)
47
48
  );
48
49
  });
49
50
  RadioGroup.displayName = "NutRadioGroup";
@@ -79,17 +80,6 @@ const Radio = (props) => {
79
80
  }
80
81
  };
81
82
  }
82
- const renderLabel = () => {
83
- return React__default.createElement("div", { className: classNames(`${classPrefix2}-label`, {
84
- [`${classPrefix2}-label-disabled`]: disabled
85
- }) }, children);
86
- };
87
- const renderButton = () => {
88
- return React__default.createElement("div", { className: classNames(`${classPrefix2}-button`, {
89
- [`${classPrefix2}-button-active`]: checkedStatement,
90
- [`${classPrefix2}-button-disabled`]: disabled
91
- }) }, children);
92
- };
93
83
  const color = () => {
94
84
  return {
95
85
  [`${classPrefix2}-icon-disabled`]: disabled,
@@ -107,14 +97,27 @@ const Radio = (props) => {
107
97
  }
108
98
  return React__default.isValidElement(icon2) ? React__default.cloneElement(icon2, Object.assign(Object.assign({}, icon2.props), { className: classNames(color()) })) : React__default.createElement(CheckNormal, { className: classNames(color()) });
109
99
  };
110
- const renderByShape = (shape2) => {
111
- return shape2 === "button" ? renderButton() : React__default.createElement(
100
+ const renderLabel = () => {
101
+ const labelcls = classNames(`${classPrefix2}-label`, {
102
+ [`${classPrefix2}-label-disabled`]: disabled
103
+ });
104
+ return React__default.createElement(
112
105
  React__default.Fragment,
113
106
  null,
114
107
  renderIcon(),
115
- renderLabel()
108
+ React__default.createElement("div", { className: labelcls }, children)
116
109
  );
117
110
  };
111
+ const renderButton = () => {
112
+ const buttoncls = classNames(`${classPrefix2}-button`, {
113
+ [`${classPrefix2}-button-active`]: checkedStatement,
114
+ [`${classPrefix2}-button-disabled`]: disabled
115
+ });
116
+ return React__default.createElement("div", { className: buttoncls }, children);
117
+ };
118
+ const renderByShape = (shape2) => {
119
+ return shape2 === "button" ? renderButton() : renderLabel();
120
+ };
118
121
  const renderRadioItem = () => {
119
122
  return renderByShape(context && context.shape ? context.shape : shape);
120
123
  };
@@ -123,9 +126,10 @@ const Radio = (props) => {
123
126
  return;
124
127
  setCheckedStatement(!checkedStatement);
125
128
  };
126
- return React__default.createElement("div", Object.assign({ className: classNames(classPrefix2, {
129
+ const cls = classNames(classPrefix2, {
127
130
  [`${classPrefix2}-reverse`]: labelPosition === "left"
128
- }, className), style, onClick: handleClick }, rest), renderRadioItem());
131
+ }, className);
132
+ return React__default.createElement("div", Object.assign({ className: cls, style, onClick: handleClick }, rest), renderRadioItem());
129
133
  };
130
134
  Radio.displayName = "NutRadio";
131
135
  Radio.Group = RadioGroup;
@@ -1,5 +1,6 @@
1
+ const inBrowser = typeof window !== "undefined";
1
2
  function requestAniFrame() {
2
- if (typeof window !== "undefined") {
3
+ if (inBrowser) {
3
4
  const _window = window;
4
5
  return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
5
6
  _window.setTimeout(callback, 1e3 / 60);