@nutui/nutui-react-taro 3.0.4 → 3.0.6

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 (140) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/cjs/packages/badge/badge.js +4 -3
  3. package/dist/cjs/packages/badge/style/badge.scss +7 -8
  4. package/dist/cjs/packages/badge/style/style.css +13 -15
  5. package/dist/cjs/packages/badge/style/style.harmony.css +7 -9
  6. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  7. package/dist/cjs/packages/datepicker/style/style.css +3 -1
  8. package/dist/cjs/packages/datepickerview/style/style.css +3 -1
  9. package/dist/cjs/packages/empty/style/index.js +1 -0
  10. package/dist/cjs/packages/empty/style/style.css +389 -0
  11. package/dist/cjs/packages/fixednav/fixednav.js +3 -3
  12. package/dist/cjs/packages/fixednav/style/fixednav.scss +43 -39
  13. package/dist/cjs/packages/fixednav/style/style.css +56 -51
  14. package/dist/cjs/packages/fixednav/style/style.harmony.css +43 -36
  15. package/dist/cjs/packages/imagepreview/imagepreview.js +58 -91
  16. package/dist/cjs/packages/imagepreview/style/imagepreview.scss +2 -1
  17. package/dist/cjs/packages/imagepreview/style/style.css +2 -1
  18. package/dist/cjs/packages/imagepreview/style/style.harmony.css +2 -1
  19. package/dist/cjs/packages/indicator/indicator.js +1 -1
  20. package/dist/cjs/packages/inputnumber/inputnumber.js +2 -2
  21. package/dist/cjs/packages/lottie/index.js +5 -5
  22. package/dist/cjs/packages/lottie/{mp.js → lottiemp.js} +1 -1
  23. package/dist/cjs/packages/notify/notify.js +44 -13
  24. package/dist/cjs/packages/notify/style/notify.scss +39 -36
  25. package/dist/cjs/packages/notify/style/style.css +36 -31
  26. package/dist/cjs/packages/notify/style/style.harmony.css +36 -31
  27. package/dist/cjs/packages/nutui.react.d.ts +1 -0
  28. package/dist/cjs/packages/nutui.react.js +1 -0
  29. package/dist/cjs/packages/picker/style/style.css +3 -1
  30. package/dist/cjs/packages/pickerview/pickerroller.js +81 -11
  31. package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -1
  32. package/dist/cjs/packages/pickerview/style/style.css +3 -1
  33. package/dist/cjs/packages/pickerview/style/style.harmony.css +3 -0
  34. package/dist/cjs/packages/resultpage/style/index.js +1 -0
  35. package/dist/cjs/packages/resultpage/style/style.css +389 -0
  36. package/dist/cjs/packages/searchbar/searchbar.js +8 -2
  37. package/dist/cjs/packages/skeleton/skeleton.js +63 -52
  38. package/dist/cjs/packages/skeleton/style/index.js +0 -1
  39. package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
  40. package/dist/cjs/packages/skeleton/style/style.css +32 -175
  41. package/dist/cjs/packages/skeleton/style/style.harmony.css +32 -42
  42. package/dist/cjs/packages/switch/style/style.css +5 -0
  43. package/dist/cjs/packages/switch/style/style.harmony.css +5 -0
  44. package/dist/cjs/packages/switch/style/switch.scss +5 -0
  45. package/dist/cjs/packages/switch/switch.js +22 -11
  46. package/dist/cjs/packages/tabbar/style/style.css +58 -54
  47. package/dist/cjs/packages/tabbar/style/style.harmony.css +24 -18
  48. package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
  49. package/dist/cjs/packages/tabbar/tabbar.js +28 -10
  50. package/dist/cjs/packages/tabbaritem/style/style.css +34 -36
  51. package/dist/cjs/packages/tabbaritem/style/style.harmony.css +21 -21
  52. package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
  53. package/dist/cjs/packages/tabbaritem/tabbaritem.js +38 -14
  54. package/dist/cjs/types/spec/badge/base.d.ts +1 -0
  55. package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
  56. package/dist/cjs/types/spec/notify/base.d.ts +7 -2
  57. package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
  58. package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
  59. package/dist/cjs/types/spec/switch/base.d.ts +3 -2
  60. package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
  61. package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
  62. package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
  63. package/dist/es/packages/badge/badge.js +4 -3
  64. package/dist/es/packages/badge/style/badge.scss +7 -8
  65. package/dist/es/packages/badge/style/style.css +13 -15
  66. package/dist/es/packages/badge/style/style.harmony.css +7 -9
  67. package/dist/es/packages/configprovider/types.d.ts +1 -1
  68. package/dist/es/packages/datepicker/style/style.css +3 -1
  69. package/dist/es/packages/datepickerview/style/style.css +3 -1
  70. package/dist/es/packages/empty/style/index.js +1 -0
  71. package/dist/es/packages/empty/style/style.css +389 -0
  72. package/dist/es/packages/fixednav/fixednav.js +4 -4
  73. package/dist/es/packages/fixednav/style/fixednav.scss +43 -39
  74. package/dist/es/packages/fixednav/style/style.css +56 -51
  75. package/dist/es/packages/fixednav/style/style.harmony.css +43 -36
  76. package/dist/es/packages/imagepreview/imagepreview.js +58 -91
  77. package/dist/es/packages/imagepreview/style/imagepreview.scss +2 -1
  78. package/dist/es/packages/imagepreview/style/style.css +2 -1
  79. package/dist/es/packages/imagepreview/style/style.harmony.css +2 -1
  80. package/dist/es/packages/indicator/indicator.js +1 -1
  81. package/dist/es/packages/inputnumber/inputnumber.js +2 -2
  82. package/dist/es/packages/lottie/index.js +3 -3
  83. package/dist/es/packages/lottie/{mp.js → lottiemp.js} +1 -1
  84. package/dist/es/packages/notify/notify.js +45 -14
  85. package/dist/es/packages/notify/style/notify.scss +39 -36
  86. package/dist/es/packages/notify/style/style.css +36 -31
  87. package/dist/es/packages/notify/style/style.harmony.css +36 -31
  88. package/dist/es/packages/picker/style/style.css +3 -1
  89. package/dist/es/packages/pickerview/pickerroller.js +80 -11
  90. package/dist/es/packages/pickerview/style/pickerview.scss +3 -1
  91. package/dist/es/packages/pickerview/style/style.css +3 -1
  92. package/dist/es/packages/pickerview/style/style.harmony.css +3 -0
  93. package/dist/es/packages/resultpage/style/index.js +1 -0
  94. package/dist/es/packages/resultpage/style/style.css +389 -0
  95. package/dist/es/packages/searchbar/searchbar.js +7 -2
  96. package/dist/es/packages/skeleton/skeleton.js +62 -52
  97. package/dist/es/packages/skeleton/style/index.js +0 -1
  98. package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
  99. package/dist/es/packages/skeleton/style/style.css +32 -175
  100. package/dist/es/packages/skeleton/style/style.harmony.css +32 -42
  101. package/dist/es/packages/switch/style/style.css +5 -0
  102. package/dist/es/packages/switch/style/style.harmony.css +5 -0
  103. package/dist/es/packages/switch/style/switch.scss +5 -0
  104. package/dist/es/packages/switch/switch.js +21 -11
  105. package/dist/es/packages/tabbar/style/style.css +58 -54
  106. package/dist/es/packages/tabbar/style/style.harmony.css +24 -18
  107. package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
  108. package/dist/es/packages/tabbar/tabbar.js +27 -10
  109. package/dist/es/packages/tabbaritem/style/style.css +34 -36
  110. package/dist/es/packages/tabbaritem/style/style.harmony.css +21 -21
  111. package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
  112. package/dist/es/packages/tabbaritem/tabbaritem.js +38 -14
  113. package/dist/es/types/spec/badge/base.d.ts +4 -0
  114. package/dist/es/types/spec/indicator/base.d.ts +1 -1
  115. package/dist/es/types/spec/notify/base.d.ts +22 -5
  116. package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
  117. package/dist/es/types/spec/skeleton/base.d.ts +19 -14
  118. package/dist/es/types/spec/switch/base.d.ts +6 -2
  119. package/dist/es/types/spec/switch/h5.d.ts +1 -1
  120. package/dist/es/types/spec/switch/taro.d.ts +1 -4
  121. package/dist/es/types/spec/tabbar/base.d.ts +7 -4
  122. package/dist/nutui.react.umd.js +549 -395
  123. package/dist/style.css +1 -1
  124. package/dist/style.scss +51 -51
  125. package/dist/styles/theme-dark.scss +2 -0
  126. package/dist/styles/theme-default.scss +2 -0
  127. package/dist/styles/themes/dark.css +1 -1
  128. package/dist/styles/themes/default.css +1 -1
  129. package/dist/styles/themes/jmapp.css +1 -1
  130. package/dist/styles/themes/jrkf.css +1 -1
  131. package/dist/styles/variables-jmapp.scss +24 -1
  132. package/dist/styles/variables-jrkf.scss +24 -1
  133. package/dist/styles/variables.scss +37 -38
  134. package/package.json +1 -1
  135. /package/dist/cjs/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
  136. /package/dist/cjs/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
  137. /package/dist/cjs/packages/lottie/{web.js → lottieweb.js} +0 -0
  138. /package/dist/es/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
  139. /package/dist/es/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
  140. /package/dist/es/packages/lottie/{web.js → lottieweb.js} +0 -0
@@ -4454,7 +4454,8 @@
4454
4454
  top: 0,
4455
4455
  right: 0,
4456
4456
  fill: "solid",
4457
- size: "large"
4457
+ size: "large",
4458
+ disabled: false
4458
4459
  });
4459
4460
  var Badge = function(props) {
4460
4461
  var getContent = function getContent2() {
@@ -4475,14 +4476,14 @@
4475
4476
  };
4476
4477
  var _this;
4477
4478
  var rtl = useRtl();
4478
- var _$_object_spread = _object_spread({}, defaultProps$1l, props), className = _$_object_spread.className, style = _$_object_spread.style, value2 = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right2 = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size;
4479
+ var _$_object_spread = _object_spread({}, defaultProps$1l, props), className = _$_object_spread.className, style = _$_object_spread.style, value2 = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right2 = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size, disabled = _$_object_spread.disabled;
4479
4480
  var classPrefix2 = "nut-badge";
4480
4481
  var isHarmony2 = harmony();
4481
4482
  var classes = classNames(classPrefix2, className);
4482
4483
  var badgeRef = React.useRef(null);
4483
4484
  var _useState = _sliced_to_array(React.useState({}), 2), contentStyle = _useState[0], setContentStyle = _useState[1];
4484
4485
  var _obj;
4485
- var contentClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix2, "-number"), isNumber()), _define_property(_obj, "".concat(classPrefix2, "-one"), typeof getContent() === "string" && ((_this = "".concat(getContent())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix2, "-dot"), dot), _define_property(_obj, "".concat(classPrefix2, "-dot-").concat(size), dot), _define_property(_obj, "".concat(classPrefix2, "-").concat(fill), fill === "outline"), _define_property(_obj, "".concat(classPrefix2, "-content"), children), _obj));
4486
+ var contentClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix2, "-number"), isNumber()), _define_property(_obj, "".concat(classPrefix2, "-one"), typeof getContent() === "string" && ((_this = "".concat(getContent())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix2, "-dot"), dot), _define_property(_obj, "".concat(classPrefix2, "-dot-").concat(size), dot), _define_property(_obj, "".concat(classPrefix2, "-").concat(fill), fill === "outline"), _define_property(_obj, "".concat(classPrefix2, "-content"), children), _define_property(_obj, "".concat(classPrefix2, "-disabled"), disabled), _obj));
4486
4487
  React.useEffect(function() {
4487
4488
  if (badgeRef.current) {
4488
4489
  getPositionStyle();
@@ -4541,7 +4542,7 @@
4541
4542
  var classPrefix2 = "nut-fixednav";
4542
4543
  var classes = classNames(classPrefix2, {
4543
4544
  active: visible
4544
- }, type2, className);
4545
+ }, "".concat(classPrefix2, "-").concat(type2), className);
4545
4546
  var renderListItem = function(item, index2) {
4546
4547
  return /* @__PURE__ */ React.createElement(components.View, {
4547
4548
  className: "".concat(classPrefix2, "-list-item"),
@@ -4549,9 +4550,9 @@
4549
4550
  return onSelect(item, event);
4550
4551
  },
4551
4552
  key: item.id || index2
4552
- }, /* @__PURE__ */ React.isValidElement(item.icon) ? item.icon : /* @__PURE__ */ React.createElement("img", {
4553
+ }, /* @__PURE__ */ React.isValidElement(item.icon) ? item.icon : /* @__PURE__ */ React.createElement(components.Image, {
4553
4554
  src: item.icon,
4554
- alt: ""
4555
+ className: "".concat(classPrefix2, "-list-image")
4555
4556
  }), /* @__PURE__ */ React.createElement(components.View, {
4556
4557
  className: "".concat(classPrefix2, "-list-text")
4557
4558
  }, item.text));
@@ -4898,14 +4899,6 @@
4898
4899
  SideBar.displayName = "NutSideBar";
4899
4900
  SideBar.Item = SideBarItem;
4900
4901
  const TabbarContext = React.createContext(null);
4901
- function addColorForHarmony(maybeElement, color) {
4902
- if (React.isValidElement(maybeElement) && harmony()) {
4903
- return React.cloneElement(maybeElement, {
4904
- color
4905
- });
4906
- }
4907
- return maybeElement;
4908
- }
4909
4902
  var defaultProps$1g = _object_spread_props(_object_spread({}, ComponentDefaults), {
4910
4903
  title: "",
4911
4904
  icon: null,
@@ -4913,11 +4906,12 @@
4913
4906
  dot: false,
4914
4907
  max: 99,
4915
4908
  top: "0",
4916
- right: "0"
4909
+ right: "0",
4910
+ direction: "vertical"
4917
4911
  });
4918
4912
  var TabbarItem = function(props) {
4919
4913
  var ctx = React.useContext(TabbarContext);
4920
- var _ref = _object_spread({}, defaultProps$1g, props), className = _ref.className, style = _ref.style, title = _ref.title, icon = _ref.icon, value2 = _ref.value, dot = _ref.dot, max = _ref.max, top = _ref.top, right2 = _ref.right, index2 = _ref.index, rest = _object_without_properties(_ref, [
4914
+ var _ref = _object_spread({}, defaultProps$1g, props), className = _ref.className, style = _ref.style, title = _ref.title, icon = _ref.icon, value2 = _ref.value, dot = _ref.dot, max = _ref.max, top = _ref.top, right2 = _ref.right, index2 = _ref.index, direction = _ref.direction, onActiveClick = _ref.onActiveClick, rest = _object_without_properties(_ref, [
4921
4915
  "className",
4922
4916
  "style",
4923
4917
  "title",
@@ -4927,15 +4921,19 @@
4927
4921
  "max",
4928
4922
  "top",
4929
4923
  "right",
4930
- "index"
4924
+ "index",
4925
+ "direction",
4926
+ "onActiveClick"
4931
4927
  ]);
4932
4928
  var active2 = index2 === (ctx === null || ctx === void 0 ? void 0 : ctx.selectIndex);
4933
4929
  var classPrefix2 = "nut-tabbar-item";
4934
- var tabbarItemClass = classNames(classPrefix2, _define_property({}, "".concat(classPrefix2, "-active"), active2), className);
4935
- var boxPrefix = "".concat(classPrefix2, "-icon-box");
4936
- var titleClass = classNames(boxPrefix, "".concat(boxPrefix, "-nav"), _define_property({}, "".concat(boxPrefix, "-large"), !icon));
4930
+ var _obj;
4931
+ var tabbarItemClass = classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-active"), active2), _define_property(_obj, "".concat(classPrefix2, "-large"), !icon || !title), _obj), className);
4932
+ var renderNodeWithActive = function(node) {
4933
+ return node && typeof node === "function" ? node(active2) : node;
4934
+ };
4937
4935
  var badgeProps = {
4938
- value: value2,
4936
+ value: renderNodeWithActive(value2),
4939
4937
  dot,
4940
4938
  max,
4941
4939
  top,
@@ -4944,11 +4942,32 @@
4944
4942
  };
4945
4943
  var renderTitleText = function() {
4946
4944
  return title && /* @__PURE__ */ React.createElement(components.View, {
4947
- className: titleClass,
4945
+ className: "".concat(classPrefix2, "-text"),
4948
4946
  style: {
4949
4947
  color: active2 ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
4950
4948
  }
4951
- }, title);
4949
+ }, renderNodeWithActive(title));
4950
+ };
4951
+ var renderTitle = function() {
4952
+ return /* @__PURE__ */ React.createElement(Badge, _object_spread({
4953
+ size: "normal"
4954
+ }, badgeProps), renderTitleText());
4955
+ };
4956
+ var renderIcon = function() {
4957
+ var distIcon = renderNodeWithActive(icon);
4958
+ return /* @__PURE__ */ React.isValidElement(distIcon) ? /* @__PURE__ */ React.cloneElement(distIcon, _object_spread_props(_object_spread({}, distIcon.props), {
4959
+ color: active2 ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
4960
+ })) : null;
4961
+ };
4962
+ var renderIconAndTitle = function() {
4963
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Badge, _object_spread_props(_object_spread({
4964
+ size: "normal"
4965
+ }, badgeProps), {
4966
+ top: 3
4967
+ }), renderIcon()), renderTitleText());
4968
+ };
4969
+ var renderDualItem = function() {
4970
+ return dot ? null : /* @__PURE__ */ React.createElement(React.Fragment, null, renderIcon(), renderTitleText(), /* @__PURE__ */ React.createElement(Badge, badgeProps));
4952
4971
  };
4953
4972
  return /* @__PURE__ */ React.createElement(components.View, _object_spread({
4954
4973
  className: tabbarItemClass,
@@ -4956,23 +4975,22 @@
4956
4975
  color: active2 ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor
4957
4976
  }, style),
4958
4977
  onClick: function() {
4959
- return ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index2);
4978
+ return active2 ? onActiveClick === null || onActiveClick === void 0 ? void 0 : onActiveClick() : ctx === null || ctx === void 0 ? void 0 : ctx.handleClick(index2);
4960
4979
  }
4961
- }, rest), icon ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Badge, badgeProps, /* @__PURE__ */ React.createElement(components.View, {
4962
- className: boxPrefix
4963
- }, addColorForHarmony(icon, active2 ? ctx === null || ctx === void 0 ? void 0 : ctx.activeColor : ctx === null || ctx === void 0 ? void 0 : ctx.inactiveColor))), renderTitleText()) : /* @__PURE__ */ React.createElement(Badge, badgeProps, renderTitleText()));
4980
+ }, rest), direction === "horizontal" && !dot ? renderDualItem() : /* @__PURE__ */ React.createElement(React.Fragment, null, icon && renderIconAndTitle(), !icon && renderTitle()));
4964
4981
  };
4965
4982
  var defaultProps$1f = _object_spread_props(_object_spread({}, ComponentDefaults), {
4966
4983
  defaultValue: 0,
4967
4984
  fixed: false,
4968
4985
  inactiveColor: "",
4969
4986
  activeColor: "",
4987
+ direction: "vertical",
4970
4988
  safeArea: false,
4971
- onSwitch: function(value2) {
4989
+ onSwitch: function() {
4972
4990
  }
4973
4991
  });
4974
4992
  var Tabbar = function(props) {
4975
- var _$_object_spread = _object_spread({}, defaultProps$1f, props), children = _$_object_spread.children, defaultValue = _$_object_spread.defaultValue, value2 = _$_object_spread.value, fixed = _$_object_spread.fixed, activeColor = _$_object_spread.activeColor, inactiveColor = _$_object_spread.inactiveColor, safeArea = _$_object_spread.safeArea, className = _$_object_spread.className, style = _$_object_spread.style, onSwitch = _$_object_spread.onSwitch;
4993
+ var _$_object_spread = _object_spread({}, defaultProps$1f, props), children = _$_object_spread.children, defaultValue = _$_object_spread.defaultValue, value2 = _$_object_spread.value, fixed = _$_object_spread.fixed, activeColor = _$_object_spread.activeColor, inactiveColor = _$_object_spread.inactiveColor, direction = _$_object_spread.direction, safeArea = _$_object_spread.safeArea, className = _$_object_spread.className, style = _$_object_spread.style, onSwitch = _$_object_spread.onSwitch;
4976
4994
  var classPrefix2 = "nut-tabbar";
4977
4995
  var _usePropsValue = _sliced_to_array(usePropsValue({
4978
4996
  value: value2,
@@ -4980,11 +4998,26 @@
4980
4998
  finalValue: 0,
4981
4999
  onChange: onSwitch
4982
5000
  }), 2), selectIndex = _usePropsValue[0], setSelectIndex = _usePropsValue[1];
5001
+ var sizeCls = React.useMemo(function() {
5002
+ var size = React.Children.count(children);
5003
+ var _obj;
5004
+ return size > 3 ? "" : classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-wrap-3"), size === 3), _define_property(_obj, "".concat(classPrefix2, "-wrap-2"), size === 2), _define_property(_obj, "".concat(classPrefix2, "-wrap-").concat(direction), size === 2 && direction !== "vertical"), _obj));
5005
+ }, [
5006
+ children,
5007
+ direction
5008
+ ]);
5009
+ var itemDirection = React.useMemo(function() {
5010
+ var size = React.Children.count(children);
5011
+ return size === 2 && direction !== "vertical" && direction;
5012
+ }, [
5013
+ direction,
5014
+ children
5015
+ ]);
4983
5016
  return /* @__PURE__ */ React.createElement(components.View, {
4984
5017
  className: classNames(classPrefix2, _define_property({}, "".concat(classPrefix2, "-fixed"), fixed), className),
4985
5018
  style
4986
5019
  }, /* @__PURE__ */ React.createElement(components.View, {
4987
- className: "".concat(classPrefix2, "-wrap")
5020
+ className: "".concat(classPrefix2, "-wrap ").concat(sizeCls)
4988
5021
  }, /* @__PURE__ */ React.createElement(TabbarContext.Provider, {
4989
5022
  value: {
4990
5023
  selectIndex,
@@ -4993,12 +5026,12 @@
4993
5026
  handleClick: setSelectIndex
4994
5027
  }
4995
5028
  }, React.Children.map(children, function(child, index2) {
4996
- if (!/* @__PURE__ */ React.isValidElement(child)) return null;
4997
- return /* @__PURE__ */ React.cloneElement(child, _object_spread_props(_object_spread({}, child.props), {
4998
- index: index2
4999
- }));
5000
- }))), (fixed || safeArea) && /* @__PURE__ */ React.createElement(components.View, {
5001
- className: "".concat(classPrefix2, "-safe-area")
5029
+ return /* @__PURE__ */ React.isValidElement(child) ? /* @__PURE__ */ React.cloneElement(child, _object_spread_props(_object_spread({}, child.props), {
5030
+ index: index2,
5031
+ direction: itemDirection
5032
+ })) : null;
5033
+ }))), (fixed || safeArea) && /* @__PURE__ */ React.createElement(SafeArea, {
5034
+ position: "bottom"
5002
5035
  }));
5003
5036
  };
5004
5037
  Tabbar.displayName = "NutTabbar";
@@ -7856,22 +7889,26 @@
7856
7889
  var _props_keyIndex = props.keyIndex, keyIndex = _props_keyIndex === void 0 ? 0 : _props_keyIndex, _props_options = props.options, options = _props_options === void 0 ? [] : _props_options, _props_threeDimensional = props.threeDimensional, threeDimensional = _props_threeDimensional === void 0 ? true : _props_threeDimensional, _props_duration = props.duration, duration = _props_duration === void 0 ? 1e3 : _props_duration, onSelect = props.onSelect, _props_renderLabel = props.renderLabel, renderLabel = _props_renderLabel === void 0 ? function(item) {
7857
7890
  return item.label;
7858
7891
  } : _props_renderLabel;
7892
+ var classPrefix2 = "nut-pickerview-roller";
7893
+ var uuid = useUuid();
7859
7894
  var DEFAULT_DURATION = 200;
7860
7895
  var INERTIA_TIME = 300;
7861
7896
  var INERTIA_DISTANCE = 15;
7862
7897
  var ROTATION = 20;
7863
7898
  var touch = useTouch();
7864
- var _useState = _sliced_to_array(React.useState(1), 2), currentIndex = _useState[0], setCurrentIndex = _useState[1];
7899
+ var _useState = _sliced_to_array(React.useState(0), 2), currentIndex = _useState[0], setCurrentIndex = _useState[1];
7865
7900
  var lineSpacing = React.useRef(36);
7866
7901
  var _useState1 = _sliced_to_array(React.useState(0), 2), touchTime = _useState1[0], setTouchTime = _useState1[1];
7867
7902
  var _useState2 = _sliced_to_array(React.useState("0deg"), 2), touchDeg = _useState2[0], setTouchDeg = _useState2[1];
7868
7903
  var isMoving = React.useRef(false);
7869
7904
  var rollerRef = React.useRef(null);
7870
7905
  var pickerRollerRef = React.useRef(null);
7906
+ var placeholderRef = React.useRef(null);
7871
7907
  var _useState3 = _sliced_to_array(React.useState(0), 2), startTime = _useState3[0], setStartTime = _useState3[1];
7872
7908
  var _useState4 = _sliced_to_array(React.useState(0), 2), startY = _useState4[0], setStartY = _useState4[1];
7873
7909
  var transformY = React.useRef(0);
7874
7910
  var _useState5 = _sliced_to_array(React.useState(0), 2), scrollDistance = _useState5[0], setScrollDistance = _useState5[1];
7911
+ var _useState6 = _sliced_to_array(React.useState(web()), 2), isGetLineSpacing = _useState6[0], setGetStatus = _useState6[1];
7875
7912
  var _useStyles = useStyles(touchTime, touchDeg, scrollDistance, lineSpacing), touchRollerStyle = _useStyles.touchRollerStyle, touchTiledStyle = _useStyles.touchTiledStyle, rollerStyle = _useStyles.rollerStyle;
7876
7913
  var isItemHidden = function(index2) {
7877
7914
  return index2 >= currentIndex + 8 || index2 <= currentIndex - 8;
@@ -7895,7 +7932,7 @@
7895
7932
  var deg1 = Math.min(Math.max(currentDeg, 0), (options.length + 1) * ROTATION);
7896
7933
  if (deg1 >= 0 && deg1 < (options.length + 1) * ROTATION) {
7897
7934
  applyTransform("", "".concat(deg1, "deg"), void 0, updatedMove);
7898
- setCurrentIndex(Math.abs(Math.round(updatedMove / lineSpacing.current)) + 1);
7935
+ deg1 > 0 && setCurrentIndex(Math.abs(Math.round(updatedMove / lineSpacing.current)) + 1);
7899
7936
  }
7900
7937
  }
7901
7938
  };
@@ -7936,7 +7973,7 @@
7936
7973
  var index2 = options.findIndex(function(item) {
7937
7974
  return item.value === selectedValue;
7938
7975
  });
7939
- setCurrentIndex(index2 === -1 ? 1 : index2 + 1);
7976
+ setCurrentIndex(index2 === -1 ? 0 : index2 + 1);
7940
7977
  var move = index2 * lineSpacing.current;
7941
7978
  handleMove(-move);
7942
7979
  };
@@ -7945,15 +7982,68 @@
7945
7982
  setTouchTime(0);
7946
7983
  selectValue(scrollDistance);
7947
7984
  };
7985
+ var getReactHeight = /* @__PURE__ */ function() {
7986
+ var _ref = _async_to_generator(function() {
7987
+ var placeholder, placeholderHeight, error;
7988
+ return __generator(this, function(_state) {
7989
+ switch (_state.label) {
7990
+ case 0:
7991
+ _state.trys.push([
7992
+ 0,
7993
+ 2,
7994
+ ,
7995
+ 3
7996
+ ]);
7997
+ return [
7998
+ 4,
7999
+ getRectByTaro(placeholderRef.current)
8000
+ ];
8001
+ case 1:
8002
+ placeholder = _state.sent();
8003
+ placeholderHeight = placeholder.height || 0;
8004
+ return [
8005
+ 2,
8006
+ placeholderHeight
8007
+ ];
8008
+ case 2:
8009
+ error = _state.sent();
8010
+ console.error("获取高度失败:", error);
8011
+ return [
8012
+ 2,
8013
+ 0
8014
+ ];
8015
+ case 3:
8016
+ return [
8017
+ 2
8018
+ ];
8019
+ }
8020
+ });
8021
+ });
8022
+ return function getReactHeight2() {
8023
+ return _ref.apply(this, arguments);
8024
+ };
8025
+ }();
7948
8026
  React.useEffect(function() {
7949
8027
  var element = pickerRollerRef.current;
8028
+ var currentLineSpacing;
7950
8029
  if (element && web()) {
7951
8030
  var computedStyle = getComputedStyle(element);
7952
- var currentLineSpacing = computedStyle.getPropertyValue("--nutui-picker-item-height");
7953
- !!currentLineSpacing && (lineSpacing.current = parseFloat(currentLineSpacing));
8031
+ currentLineSpacing = computedStyle.getPropertyValue("--nutui-picker-item-height");
8032
+ if (currentLineSpacing) {
8033
+ lineSpacing.current = parseFloat(currentLineSpacing);
8034
+ }
8035
+ } else {
8036
+ getReactHeight().then(function(height2) {
8037
+ currentLineSpacing = height2;
8038
+ if (currentLineSpacing) {
8039
+ lineSpacing.current = currentLineSpacing;
8040
+ setGetStatus(true);
8041
+ }
8042
+ });
7954
8043
  }
7955
8044
  }, [
7956
- pickerRollerRef.current
8045
+ pickerRollerRef.current,
8046
+ placeholderRef.current
7957
8047
  ]);
7958
8048
  React.useEffect(function() {
7959
8049
  isMoving.current = false;
@@ -7995,21 +8085,27 @@
7995
8085
  className: "nut-pickerview-list",
7996
8086
  ref: pickerRollerRef
7997
8087
  }, /* @__PURE__ */ React.createElement(components.View, {
7998
- className: "nut-pickerview-roller",
8088
+ className: "".concat(classPrefix2, "-placeholder"),
8089
+ ref: placeholderRef,
8090
+ id: "".concat(classPrefix2, "-placeholder-").concat(uuid)
8091
+ }), /* @__PURE__ */ React.createElement(components.View, {
8092
+ className: classPrefix2,
8093
+ id: "".concat(classPrefix2, "-").concat(uuid),
7999
8094
  ref: rollerRef,
8000
8095
  style: threeDimensional ? touchRollerStyle() : touchTiledStyle(),
8001
8096
  onTransitionEnd: stopMomentumScroll
8002
8097
  }, threeDimensional && options.map(function(item, index2) {
8003
8098
  var _item_value;
8004
- return /* @__PURE__ */ React.createElement(components.View, {
8005
- className: "nut-pickerview-roller-item ".concat(isItemHidden(index2 + 1) && "nut-pickerview-roller-item-hidden"),
8099
+ var _obj;
8100
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, isGetLineSpacing ? /* @__PURE__ */ React.createElement(components.View, {
8101
+ className: classNames("".concat(classPrefix2, "-item"), (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-item-hidden"), isItemHidden(index2 + 1)), _define_property(_obj, "".concat(classPrefix2, "-item-active"), index2 + 1 === currentIndex), _obj)),
8006
8102
  style: rollerStyle(index2),
8007
8103
  key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index2
8008
- }, renderLabel(item));
8104
+ }, renderLabel(item)) : null);
8009
8105
  }), !threeDimensional && options.map(function(item, index2) {
8010
8106
  var _item_value;
8011
8107
  return /* @__PURE__ */ React.createElement(components.View, {
8012
- className: "nut-pickerview-roller-item-tiled",
8108
+ className: classNames("".concat(classPrefix2, "-item-tiled"), _define_property({}, "".concat(classPrefix2, "-item-active"), index2 + 1 === currentIndex)),
8013
8109
  key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index2
8014
8110
  }, renderLabel(item));
8015
8111
  })));
@@ -11084,7 +11180,7 @@
11084
11180
  onClick: handleReduce
11085
11181
  }, /* @__PURE__ */ React.createElement(IconSVG$e, {
11086
11182
  size: 10,
11087
- className: classNames("".concat(classPrefix$h, "-icon ").concat(classPrefix$h, "-icon-minus"), _define_property({}, "".concat(classPrefix$h, "-icon-disabled"), shadowValue === min || disabled))
11183
+ className: classNames("".concat(classPrefix$h, "-icon ").concat(classPrefix$h, "-icon-minus"), _define_property({}, "".concat(classPrefix$h, "-icon-disabled"), Number(shadowValue) <= Number(min) || disabled))
11088
11184
  })), /* @__PURE__ */ React.createElement("input", {
11089
11185
  className: classNames("".concat(classPrefix$h, "-input"), _define_property({}, "".concat(classPrefix$h, "-input-disabled"), disabled)),
11090
11186
  type: type2,
@@ -11101,7 +11197,7 @@
11101
11197
  onClick: handlePlus
11102
11198
  }, /* @__PURE__ */ React.createElement(IconSVG$a, {
11103
11199
  size: 10,
11104
- className: classNames("".concat(classPrefix$h, "-icon ").concat(classPrefix$h, "-icon-plus"), _define_property({}, "".concat(classPrefix$h, "-icon-disabled"), shadowValue === max || disabled))
11200
+ className: classNames("".concat(classPrefix$h, "-icon ").concat(classPrefix$h, "-icon-plus"), _define_property({}, "".concat(classPrefix$h, "-icon-disabled"), Number(shadowValue) >= Number(max) || disabled))
11105
11201
  })));
11106
11202
  };
11107
11203
  InputNumber.displayName = "NutInputNumber";
@@ -12601,7 +12697,9 @@
12601
12697
  outerValue
12602
12698
  ]);
12603
12699
  React.useEffect(function() {
12604
- autoFocus && forceFocus();
12700
+ if (Taro.getEnv() === "WEB") {
12701
+ autoFocus && forceFocus();
12702
+ }
12605
12703
  }, [
12606
12704
  autoFocus
12607
12705
  ]);
@@ -12609,10 +12707,12 @@
12609
12707
  return /* @__PURE__ */ React.createElement(components.Input, {
12610
12708
  className: "".concat(classPrefix2, "-input ").concat(clearable ? "".concat(classPrefix2, "-input-clear") : ""),
12611
12709
  ref: searchRef,
12612
- value: value2 || "",
12710
+ style,
12711
+ value: (value2 || "").toString(),
12613
12712
  placeholder: placeholder || locale.placeholder,
12614
12713
  disabled: disabled || readOnly,
12615
12714
  maxlength: maxLength,
12715
+ autoFocus,
12616
12716
  onInput,
12617
12717
  onFocus: focus,
12618
12718
  onBlur: blur,
@@ -12983,15 +13083,19 @@
12983
13083
  var defaultProps$M = _object_spread_props(_object_spread({}, ComponentDefaults), {
12984
13084
  disabled: false,
12985
13085
  activeText: "",
12986
- inactiveText: ""
13086
+ inactiveText: "",
13087
+ loadingIcon: /* @__PURE__ */ React.createElement(IconSVG$h, null)
12987
13088
  });
12988
13089
  var Switch = function(props) {
12989
- var _ref = _object_spread({}, defaultProps$M, props), checked = _ref.checked, defaultChecked = _ref.defaultChecked, disabled = _ref.disabled, activeText = _ref.activeText, inactiveText = _ref.inactiveText, className = _ref.className, style = _ref.style, onChange = _ref.onChange, rest = _object_without_properties(_ref, [
13090
+ var _ref = _object_spread({}, defaultProps$M, props), checked = _ref.checked, defaultChecked = _ref.defaultChecked, disabled = _ref.disabled, activeText = _ref.activeText, inactiveText = _ref.inactiveText, loadingIcon = _ref.loadingIcon, className = _ref.className, style = _ref.style;
13091
+ _ref.onChange;
13092
+ var rest = _object_without_properties(_ref, [
12990
13093
  "checked",
12991
13094
  "defaultChecked",
12992
13095
  "disabled",
12993
13096
  "activeText",
12994
13097
  "inactiveText",
13098
+ "loadingIcon",
12995
13099
  "className",
12996
13100
  "style",
12997
13101
  "onChange"
@@ -13002,6 +13106,12 @@
13002
13106
  value: checked,
13003
13107
  defaultValue: defaultChecked
13004
13108
  }), 2), value2 = _usePropsValue[0], setValue = _usePropsValue[1];
13109
+ React.useEffect(function() {
13110
+ changing && setChanging(false);
13111
+ }, [
13112
+ value2
13113
+ ]);
13114
+ var _useState = _sliced_to_array(React.useState(false), 2), changing = _useState[0], setChanging = _useState[1];
13005
13115
  var classes = function() {
13006
13116
  var _obj2;
13007
13117
  return classNames([
@@ -13010,17 +13120,18 @@
13010
13120
  (_obj2 = {}, _define_property(_obj2, "".concat(classPrefix2, "-close"), !value2), _define_property(_obj2, "".concat(classPrefix2, "-disabled"), disabled), _define_property(_obj2, "".concat(classPrefix2, "-disabled-close"), disabled && !value2), _obj2)
13011
13121
  ]);
13012
13122
  };
13013
- var onClick = function(event) {
13014
- if (disabled) return;
13015
- onChange && onChange(!value2, event);
13123
+ var onClick = function() {
13124
+ if (disabled || changing) return;
13125
+ if (props.onChange) {
13126
+ setChanging(true);
13127
+ props.onChange(!value2);
13128
+ }
13016
13129
  setValue(!value2);
13017
13130
  };
13018
13131
  var _obj, _obj1;
13019
13132
  return /* @__PURE__ */ React.createElement(components.View, _object_spread({
13020
13133
  className: classes(),
13021
- onClick: function(e) {
13022
- return onClick(e);
13023
- },
13134
+ onClick,
13024
13135
  style
13025
13136
  }, rest), /* @__PURE__ */ React.createElement(components.View, {
13026
13137
  className: classNames([
@@ -13032,9 +13143,9 @@
13032
13143
  ],
13033
13144
  (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-button-open-rtl"), rtl && value2), _define_property(_obj, "".concat(classPrefix2, "-button-close-rtl"), rtl && !value2), _obj)
13034
13145
  ])
13035
- }, !value2 && !activeText && /* @__PURE__ */ React.createElement(components.View, {
13146
+ }, changing && loadingIcon ? /* @__PURE__ */ React.createElement(React.Fragment, null, loadingIcon) : /* @__PURE__ */ React.createElement(React.Fragment, null, !value2 && !activeText && /* @__PURE__ */ React.createElement(components.View, {
13036
13147
  className: "".concat(classPrefix2, "-close-line")
13037
- })), activeText && /* @__PURE__ */ React.createElement(components.View, {
13148
+ }))), activeText && /* @__PURE__ */ React.createElement(components.View, {
13038
13149
  className: classNames("".concat(classPrefix2, "-label"), (_obj1 = {}, _define_property(_obj1, "".concat(classPrefix2, "-label-open"), value2), _define_property(_obj1, "".concat(classPrefix2, "-label-close"), !value2), _define_property(_obj1, "".concat(classPrefix2, "-label-open-rtl"), rtl && value2), _define_property(_obj1, "".concat(classPrefix2, "-label-close-rtl"), rtl && !value2), _define_property(_obj1, "".concat(classPrefix2, "-label-close-disabled"), disabled && !value2), _obj1))
13039
13150
  }, value2 ? activeText : inactiveText));
13040
13151
  };
@@ -31520,83 +31631,110 @@
31520
31631
  return Object.prototype.hasOwnProperty.call(t2, e2);
31521
31632
  }, r.p = "", r(r.s = 1);
31522
31633
  }([function(t, e, r) {
31523
- function i2(t2, e2) {
31634
+ function i2() {
31635
+ var t2 = { request: function() {
31636
+ }, getSystemInfoSync: function() {
31637
+ return {};
31638
+ } };
31639
+ return "undefined" != typeof wx && (t2 = wx), "undefined" != typeof jd && (t2 = jd), t2;
31640
+ }
31641
+ function s(t2) {
31642
+ return (s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t3) {
31643
+ return typeof t3;
31644
+ } : function(t3) {
31645
+ return t3 && "function" == typeof Symbol && t3.constructor === Symbol && t3 !== Symbol.prototype ? "symbol" : typeof t3;
31646
+ })(t2);
31647
+ }
31648
+ function a(t2, e2) {
31524
31649
  for (var r2 = 0; r2 < e2.length; r2++) {
31525
31650
  var i3 = e2[r2];
31526
- i3.enumerable = i3.enumerable || false, i3.configurable = true, "value" in i3 && (i3.writable = true), Object.defineProperty(t2, i3.key, i3);
31651
+ i3.enumerable = i3.enumerable || false, i3.configurable = true, "value" in i3 && (i3.writable = true), Object.defineProperty(t2, o(i3.key), i3);
31527
31652
  }
31528
31653
  }
31529
- function s(t2, e2, r2) {
31530
- return e2 in t2 ? Object.defineProperty(t2, e2, { value: r2, enumerable: true, configurable: true, writable: true }) : t2[e2] = r2, t2;
31654
+ function n(t2, e2, r2) {
31655
+ return (e2 = o(e2)) in t2 ? Object.defineProperty(t2, e2, { value: r2, enumerable: true, configurable: true, writable: true }) : t2[e2] = r2, t2;
31656
+ }
31657
+ function o(t2) {
31658
+ var e2 = function(t3, e3) {
31659
+ if ("object" != s(t3) || !t3) return t3;
31660
+ var r2 = t3[Symbol.toPrimitive];
31661
+ if (void 0 !== r2) {
31662
+ var i3 = r2.call(t3, e3 || "default");
31663
+ if ("object" != s(i3)) return i3;
31664
+ throw new TypeError("@@toPrimitive must return a primitive value.");
31665
+ }
31666
+ return ("string" === e3 ? String : Number)(t3);
31667
+ }(t2, "string");
31668
+ return "symbol" == s(e2) ? e2 : e2 + "";
31531
31669
  }
31532
31670
  r.d(e, "c", function() {
31533
- return _;
31671
+ return E;
31534
31672
  }), r.d(e, "b", function() {
31535
- return x;
31673
+ return T;
31536
31674
  }), r.d(e, "a", function() {
31537
- return P;
31675
+ return S;
31538
31676
  });
31539
- var a = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap();
31540
- function p(t2) {
31677
+ var h = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap();
31678
+ function c(t2) {
31541
31679
  if ("function" == typeof this["on".concat(t2)]) {
31542
31680
  for (var e2 = arguments.length, r2 = new Array(e2 > 1 ? e2 - 1 : 0), i3 = 1; i3 < e2; i3++) r2[i3 - 1] = arguments[i3];
31543
31681
  this["on".concat(t2)].apply(this, r2);
31544
31682
  }
31545
31683
  }
31546
- function f(t2) {
31547
- this.readyState = t2, p.call(this, "readystatechange");
31684
+ function d(t2) {
31685
+ this.readyState = t2, c.call(this, "readystatechange");
31548
31686
  }
31549
- var m = function() {
31687
+ var u = function() {
31550
31688
  function t2() {
31551
31689
  !function(t3, e3) {
31552
31690
  if (!(t3 instanceof e3)) throw new TypeError("Cannot call a class as a function");
31553
- }(this, t2), s(this, "onabort", null), s(this, "onerror", null), s(this, "onload", null), s(this, "onloadstart", null), s(this, "onprogress", null), s(this, "ontimeout", null), s(this, "onloadend", null), s(this, "onreadystatechange", null), s(this, "readyState", 0), s(this, "response", null), s(this, "responseText", null), s(this, "responseType", ""), s(this, "responseXML", null), s(this, "status", 0), s(this, "statusText", ""), s(this, "upload", {}), s(this, "withCredentials", false), o.set(this, { "content-type": "application/x-www-form-urlencoded" }), h.set(this, {});
31691
+ }(this, t2), n(this, "onabort", null), n(this, "onerror", null), n(this, "onload", null), n(this, "onloadstart", null), n(this, "onprogress", null), n(this, "ontimeout", null), n(this, "onloadend", null), n(this, "onreadystatechange", null), n(this, "readyState", 0), n(this, "response", null), n(this, "responseText", null), n(this, "responseType", ""), n(this, "responseXML", null), n(this, "status", 0), n(this, "statusText", ""), n(this, "upload", {}), n(this, "withCredentials", false), p.set(this, { "content-type": "application/x-www-form-urlencoded" }), f.set(this, {});
31554
31692
  }
31555
- var e2, r2;
31556
31693
  return e2 = t2, (r2 = [{ key: "abort", value: function() {
31557
- var t3 = l.get(this);
31694
+ var t3 = m.get(this);
31558
31695
  t3 && t3.abort();
31559
31696
  } }, { key: "getAllResponseHeaders", value: function() {
31560
- var t3 = h.get(this);
31697
+ var t3 = f.get(this);
31561
31698
  return Object.keys(t3).map(function(e3) {
31562
31699
  return "".concat(e3, ": ").concat(t3[e3]);
31563
31700
  }).join("\n");
31564
31701
  } }, { key: "getResponseHeader", value: function(t3) {
31565
- return h.get(this)[t3];
31702
+ return f.get(this)[t3];
31566
31703
  } }, { key: "open", value: function(e3, r3) {
31567
- n.set(this, e3), a.set(this, r3), f.call(this, t2.OPENED);
31704
+ l.set(this, e3), h.set(this, r3), d.call(this, t2.OPENED);
31568
31705
  } }, { key: "overrideMimeType", value: function() {
31569
31706
  } }, { key: "send", value: function() {
31570
31707
  var e3 = this, r3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
31571
31708
  if (this.readyState !== t2.OPENED) throw new Error("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.");
31572
- wx.request({ data: r3, url: a.get(this), method: n.get(this), header: o.get(this), success: function(r4) {
31573
- var i3 = r4.data, s2 = r4.statusCode, a2 = r4.header;
31709
+ i2().request({ data: r3, url: h.get(this), method: l.get(this), header: p.get(this), success: function(r4) {
31710
+ var i3 = r4.data, s3 = r4.statusCode, a2 = r4.header;
31574
31711
  if ("string" != typeof i3 && !(i3 instanceof ArrayBuffer)) try {
31575
31712
  i3 = JSON.stringify(i3);
31576
31713
  } catch (t3) {
31577
31714
  }
31578
- if (e3.status = s2, h.set(e3, a2), p.call(e3, "loadstart"), f.call(e3, t2.HEADERS_RECEIVED), f.call(e3, t2.LOADING), e3.response = i3, i3 instanceof ArrayBuffer) {
31715
+ if (e3.status = s3, f.set(e3, a2), c.call(e3, "loadstart"), d.call(e3, t2.HEADERS_RECEIVED), d.call(e3, t2.LOADING), e3.response = i3, i3 instanceof ArrayBuffer) {
31579
31716
  e3.responseText = "";
31580
- for (var n2 = new Uint8Array(i3), o2 = n2.byteLength, l2 = 0; l2 < o2; l2++) e3.responseText += String.fromCharCode(n2[l2]);
31717
+ for (var n2 = new Uint8Array(i3), o2 = n2.byteLength, h2 = 0; h2 < o2; h2++) e3.responseText += String.fromCharCode(n2[h2]);
31581
31718
  } else e3.responseText = i3;
31582
- f.call(e3, t2.DONE), p.call(e3, "load"), p.call(e3, "loadend");
31719
+ d.call(e3, t2.DONE), c.call(e3, "load"), c.call(e3, "loadend");
31583
31720
  }, fail: function(t3) {
31584
31721
  var r4 = t3.errMsg;
31585
- -1 !== r4.indexOf("abort") ? p.call(e3, "abort") : p.call(e3, "error", r4), p.call(e3, "loadend");
31722
+ -1 !== r4.indexOf("abort") ? c.call(e3, "abort") : c.call(e3, "error", r4), c.call(e3, "loadend");
31586
31723
  } });
31587
31724
  } }, { key: "setRequestHeader", value: function(t3, e3) {
31588
- var r3 = o.get(this);
31589
- r3[t3] = e3, o.set(this, r3);
31590
- } }]) && i2(e2.prototype, r2), t2;
31725
+ var r3 = p.get(this);
31726
+ r3[t3] = e3, p.set(this, r3);
31727
+ } }]) && a(e2.prototype, r2), s2 && a(e2, s2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
31728
+ var e2, r2, s2;
31591
31729
  }();
31592
- function c() {
31730
+ function y() {
31593
31731
  }
31594
- function d() {
31732
+ function g() {
31595
31733
  console.error("小程序由于不支持动态创建 canvas 的能力,故 lottie 中有关图片处理的操作无法支持,请保持图片的原始宽高与 JSON 描述的一致,避免需要对图片处理");
31596
31734
  }
31597
- function u(t2) {
31735
+ function v(t2) {
31598
31736
  return "canvas" === t2 ? (console.warn("发现 Lottie 动态创建 canvas 组件,但小程序不支持动态创建组件,接下来可能会出现异常"), { getContext: function() {
31599
- return { fillRect: c, createImage: d, drawImage: d };
31737
+ return { fillRect: y, createImage: g, drawImage: g };
31600
31738
  } }) : "img" === t2 ? function(t3) {
31601
31739
  if (void 0 === t3.createImage) return {};
31602
31740
  var e2 = t3.createImage();
@@ -31607,42 +31745,42 @@
31607
31745
  }, e2;
31608
31746
  }(this) : void 0;
31609
31747
  }
31610
- function y(t2, e2) {
31748
+ function b(t2, e2) {
31611
31749
  return function(r2) {
31612
31750
  return e2.call(t2, Array.from(r2));
31613
31751
  };
31614
31752
  }
31615
- function g(t2, e2) {
31753
+ function P(t2, e2) {
31616
31754
  return function() {
31617
31755
  return e2.call(t2);
31618
31756
  };
31619
31757
  }
31620
- function v(t2, e2, r2) {
31758
+ function _(t2, e2, r2) {
31621
31759
  var i3 = t2[e2];
31622
31760
  t2[e2] = r2(t2, i3);
31623
31761
  }
31624
- s(m, "UNSEND", 0), s(m, "OPENED", 1), s(m, "HEADERS_RECEIVED", 2), s(m, "LOADING", 3), s(m, "DONE", 4);
31625
- var b = wx.getSystemInfoSync(), P = { requestAnimationFrame: function(t2) {
31762
+ n(u, "UNSEND", 0), n(u, "OPENED", 1), n(u, "HEADERS_RECEIVED", 2), n(u, "LOADING", 3), n(u, "DONE", 4);
31763
+ var x = i2().getSystemInfoSync(), S = { requestAnimationFrame: function(t2) {
31626
31764
  setTimeout(function() {
31627
31765
  "function" == typeof t2 && t2(Date.now());
31628
31766
  }, 16);
31629
31767
  } };
31630
- P.window = { devicePixelRatio: b.pixelRatio }, P.document = P.window.document = { body: {}, createElement: u }, P.navigator = P.window.navigator = { userAgent: "" }, XMLHttpRequest = m;
31631
- var _ = function(t2) {
31632
- var e2 = P.window, r2 = P.document;
31633
- P._requestAnimationFrame = e2.requestAnimationFrame, P._cancelAnimationFrame = e2.cancelAnimationFrame, e2.requestAnimationFrame = function(e3) {
31768
+ S.window = { devicePixelRatio: x.pixelRatio }, S.document = S.window.document = { body: {}, createElement: v }, S.navigator = S.window.navigator = { userAgent: "" }, XMLHttpRequest = u;
31769
+ var E = function(t2) {
31770
+ var e2 = S.window, r2 = S.document;
31771
+ S._requestAnimationFrame = e2.requestAnimationFrame, S._cancelAnimationFrame = e2.cancelAnimationFrame, e2.requestAnimationFrame = function(e3) {
31634
31772
  var r3 = false;
31635
31773
  setTimeout(function() {
31636
31774
  r3 || (r3 = true, "function" == typeof e3 && e3(Date.now()));
31637
31775
  }, 100), t2.requestAnimationFrame(function(t3) {
31638
31776
  r3 || (r3 = true, "function" == typeof e3 && e3(t3));
31639
31777
  });
31640
- }, e2.cancelAnimationFrame = t2.cancelAnimationFrame.bind(t2), P._body = r2.body, P._createElement = r2.createElement, r2.body = {}, r2.createElement = u.bind(t2);
31778
+ }, e2.cancelAnimationFrame = t2.cancelAnimationFrame.bind(t2), S._body = r2.body, S._createElement = r2.createElement, r2.body = {}, r2.createElement = v.bind(t2);
31641
31779
  var i3 = t2.getContext("2d");
31642
- i3.canvas || (i3.canvas = t2), v(i3, "setLineDash", y), v(i3, "fill", g);
31643
- }, x = function() {
31644
- var t2 = P.window, e2 = P.document;
31645
- t2.requestAnimationFrame = P._requestAnimationFrame, t2.cancelAnimationFrame = P._cancelAnimationFrame, e2.body = P._body, e2.createElement = P._createElement;
31780
+ i3.canvas || (i3.canvas = t2), _(i3, "setLineDash", b), _(i3, "fill", P);
31781
+ }, T = function() {
31782
+ var t2 = S.window, e2 = S.document;
31783
+ t2.requestAnimationFrame = S._requestAnimationFrame, t2.cancelAnimationFrame = S._cancelAnimationFrame, e2.body = S._body, e2.createElement = S._createElement;
31646
31784
  };
31647
31785
  }, function(module, __webpack_exports__, __webpack_require__) {
31648
31786
  __webpack_require__.r(__webpack_exports__), (function(module) {
@@ -35201,7 +35339,7 @@
35201
35339
  var implementation;
35202
35340
  if (process.env.TARO_ENV === "h5") {
35203
35341
  implementation = Lottie$2;
35204
- } else if (process.env.TARO_ENV === "weapp") {
35342
+ } else if (process.env.TARO_ENV === "weapp" || process.env.TARO_ENV === "jd") {
35205
35343
  implementation = Lottie$1;
35206
35344
  } else {
35207
35345
  implementation = function(props) {
@@ -35701,10 +35839,14 @@
35701
35839
  NoticeBar.displayName = "NutNoticeBar";
35702
35840
  var defaultProps$B = _object_spread_props(_object_spread({}, ComponentDefaults), {
35703
35841
  id: "",
35704
- duration: 3e3,
35705
- type: "danger",
35842
+ distance: 8,
35843
+ navHeight: 57,
35706
35844
  position: "top",
35707
35845
  visible: false,
35846
+ closeable: false,
35847
+ leftIcon: null,
35848
+ rightIcon: null,
35849
+ duration: 3e3,
35708
35850
  onClose: function() {
35709
35851
  },
35710
35852
  onClick: function() {
@@ -35712,13 +35854,12 @@
35712
35854
  });
35713
35855
  var classPrefix$c = "nut-notify";
35714
35856
  var Notify = function(props) {
35715
- var _mergeProps = mergeProps(defaultProps$B, props), id = _mergeProps.id, children = _mergeProps.children, style = _mergeProps.style, type2 = _mergeProps.type, className = _mergeProps.className, position2 = _mergeProps.position, visible = _mergeProps.visible, duration = _mergeProps.duration, onClose = _mergeProps.onClose, onClick = _mergeProps.onClick;
35857
+ var _mergeProps = mergeProps(defaultProps$B, props), id = _mergeProps.id, style = _mergeProps.style, children = _mergeProps.children, distance = _mergeProps.distance, navHeight = _mergeProps.navHeight, closeable = _mergeProps.closeable, leftIcon = _mergeProps.leftIcon, rightIcon = _mergeProps.rightIcon, position2 = _mergeProps.position, visible = _mergeProps.visible, duration = _mergeProps.duration, className = _mergeProps.className, onClose = _mergeProps.onClose, onClick = _mergeProps.onClick;
35716
35858
  useCustomEvent(id, function(status) {
35717
35859
  status ? show2() : hide2();
35718
35860
  });
35719
35861
  var timer;
35720
35862
  var _useState = _sliced_to_array(React.useState(false), 2), showNotify = _useState[0], setShowNotify = _useState[1];
35721
- var cssRef = React.useRef(null);
35722
35863
  React.useEffect(function() {
35723
35864
  if (visible) {
35724
35865
  show2();
@@ -35728,9 +35869,6 @@
35728
35869
  }, [
35729
35870
  visible
35730
35871
  ]);
35731
- var clickHandle = function() {
35732
- onClick();
35733
- };
35734
35872
  var show2 = function() {
35735
35873
  setShowNotify(true);
35736
35874
  clearTimer();
@@ -35750,10 +35888,29 @@
35750
35888
  setShowNotify(false);
35751
35889
  onClose();
35752
35890
  };
35891
+ var getDistance = React.useMemo(function() {
35892
+ if (position2 === "top") {
35893
+ return {
35894
+ top: pxTransform(web() ? Number(distance) + navHeight : Number(distance))
35895
+ };
35896
+ }
35897
+ return {
35898
+ bottom: pxTransform(Number(distance))
35899
+ };
35900
+ }, [
35901
+ distance,
35902
+ position2
35903
+ ]);
35753
35904
  var _obj;
35754
- var classes = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix$c, "-popup-top"), position2 === "top"), _define_property(_obj, "".concat(classPrefix$c, "-popup-bottom"), position2 === "bottom"), _define_property(_obj, "".concat(classPrefix$c), true), _define_property(_obj, "".concat(classPrefix$c, "-").concat(type2), true), _obj));
35905
+ var classes = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix$c), true), _define_property(_obj, "".concat(className), true), _obj));
35906
+ var handleClick = function() {
35907
+ onClick === null || onClick === void 0 ? void 0 : onClick();
35908
+ };
35909
+ var handleClickIcon = function() {
35910
+ hide2();
35911
+ };
35912
+ var _obj1;
35755
35913
  return /* @__PURE__ */ React.createElement(CSSTransition, {
35756
- nodeRef: cssRef,
35757
35914
  in: showNotify,
35758
35915
  timeout: 300,
35759
35916
  classNames: "fade",
@@ -35762,10 +35919,19 @@
35762
35919
  position: position2,
35763
35920
  id
35764
35921
  }, /* @__PURE__ */ React.createElement(components.View, {
35765
- className: "".concat(classes, " ").concat(className),
35766
- style,
35767
- onClick: clickHandle
35768
- }, children));
35922
+ className: classes,
35923
+ style: _object_spread({}, style, getDistance),
35924
+ onClick: handleClick
35925
+ }, leftIcon ? /* @__PURE__ */ React.createElement(components.View, {
35926
+ className: "".concat(classPrefix$c, "-left-icon")
35927
+ }, leftIcon) : null, /* @__PURE__ */ React.createElement(components.View, {
35928
+ className: classNames((_obj1 = {}, _define_property(_obj1, "".concat(classPrefix$c, "-content"), true), _define_property(_obj1, "".concat(classPrefix$c, "-ellipsis"), closeable || rightIcon), _define_property(_obj1, "".concat(classPrefix$c, "-layout-left"), leftIcon || rightIcon), _obj1))
35929
+ }, children), rightIcon || closeable ? /* @__PURE__ */ React.createElement(components.View, {
35930
+ className: "".concat(classPrefix$c, "-right-icon"),
35931
+ onClick: handleClickIcon
35932
+ }, rightIcon || (closeable ? /* @__PURE__ */ React.createElement(IconSVG$p, {
35933
+ size: 12
35934
+ }) : null)) : null));
35769
35935
  };
35770
35936
  function open(selector) {
35771
35937
  var path = useCustomEventsPath(selector);
@@ -36365,203 +36531,83 @@
36365
36531
  })) : null, children);
36366
36532
  };
36367
36533
  ResultPage.displayName = "NutResultPage";
36368
- var AvatarContext = React.createContext({});
36369
36534
  var defaultProps$x = _object_spread_props(_object_spread({}, ComponentDefaults), {
36370
- maxContent: "",
36371
- max: "",
36372
- maxBackground: "#eee",
36373
- maxColor: "#666",
36374
- gap: "-8",
36375
- level: "left"
36376
- });
36377
- var classPrefix$a = "nut-avatar-group";
36378
- var AvatarGroup = function(props) {
36379
- var propAvatarGroup = _object_spread({}, defaultProps$x, props);
36380
- var className = propAvatarGroup.className, style = propAvatarGroup.style, children = propAvatarGroup.children;
36381
- var avatarGroupRef = React.useRef(null);
36382
- var cls = classNames(classPrefix$a, className);
36383
- var parentAvatar = {
36384
- propAvatarGroup: _object_spread({
36385
- avatarCount: React.Children.count(children) || 0
36386
- }, propAvatarGroup),
36387
- avatarGroupRef
36388
- };
36389
- return /* @__PURE__ */ React.createElement(AvatarContext.Provider, {
36390
- value: parentAvatar
36391
- }, /* @__PURE__ */ React.createElement(components.View, {
36392
- className: cls,
36393
- style,
36394
- ref: avatarGroupRef
36395
- }, React.Children.map(children, function(child, index2) {
36396
- var _child_type;
36397
- return (child === null || child === void 0 ? void 0 : (_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type.displayName) === "NutAvatar" ? /* @__PURE__ */ React.cloneElement(child, {
36398
- avatarIndex: index2 + 1,
36399
- className: "nut-avatar-group-avatar"
36400
- }) : child;
36401
- })));
36402
- };
36403
- AvatarGroup.displayName = "NutAvatarGroup";
36404
- var defaultProps$w = _object_spread_props(_object_spread({}, ComponentDefaults), {
36405
- size: harmony() ? "40" : "",
36406
- shape: "round",
36407
- icon: "",
36408
- background: "#eee",
36409
- color: "#666",
36410
- fit: "cover",
36411
- src: "",
36412
- alt: "",
36413
- avatarIndex: 0
36414
- });
36415
- var classPrefix$9 = "nut-avatar";
36416
- var Avatar = function(props) {
36417
- var _$_object_spread = _object_spread({}, defaultProps$w, props), children = _$_object_spread.children, size = _$_object_spread.size, shape = _$_object_spread.shape, background = _$_object_spread.background, color = _$_object_spread.color, src = _$_object_spread.src, icon = _$_object_spread.icon, fit = _$_object_spread.fit, avatarIndex = _$_object_spread.avatarIndex, className = _$_object_spread.className, style = _$_object_spread.style, onClick = _$_object_spread.onClick, onError = _$_object_spread.onError;
36418
- var _useState = _sliced_to_array(React.useState(false), 2), showMax = _useState[0], setShowMax = _useState[1];
36419
- var avatarRef = React.useRef(null);
36420
- var parent2 = React.useContext(AvatarContext);
36421
- var sizeValue = [
36422
- "large",
36423
- "normal",
36424
- "small"
36425
- ];
36426
- var propAvatarGroup = parent2.propAvatarGroup;
36427
- var groupSize = propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.size;
36428
- var groupShape = propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.shape;
36429
- var groupCount = propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.avatarCount;
36430
- var groupMax = propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max;
36431
- var _obj;
36432
- var classes = classNames((_obj = {}, _define_property(_obj, "nut-avatar-".concat(groupSize || size || "normal"), true), _define_property(_obj, "nut-avatar-".concat(groupShape || shape), true), _define_property(_obj, "nut-avatar-".concat(groupSize || size || "normal", "-round"), shape === "round" && true), _obj));
36433
- var nativeClasses = classNames(_define_property({}, "nut-avatar-first-child", avatarIndex === 1));
36434
- var cls = classNames(classPrefix$9, classes, className, nativeClasses);
36435
- var _obj1;
36436
- var styles = _object_spread((_obj1 = {
36437
- width: sizeValue.indexOf(size) > -1 ? "" : pxTransform(parseInt(size)),
36438
- height: sizeValue.indexOf(size) > -1 ? "" : pxTransform(parseInt(size)),
36439
- backgroundColor: "".concat(background),
36440
- color
36441
- }, _define_property(_obj1, harmony() ? "marginRight" : "marginLeft", avatarIndex !== 1 && (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.gap) ? "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.gap, "px") : ""), _define_property(_obj1, "zIndex", (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.level) === "right" ? Math.abs(groupCount - avatarIndex) : ""), _obj1), style);
36442
- var maxStyles = {
36443
- backgroundColor: "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxBackground),
36444
- color: "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxColor)
36445
- };
36446
- React.useEffect(function() {
36447
- var maxCount = groupMax || groupCount;
36448
- if (avatarIndex === groupCount && avatarIndex !== maxCount && groupCount > maxCount) {
36449
- setShowMax(true);
36450
- }
36451
- }, [
36452
- avatarIndex,
36453
- groupCount
36454
- ]);
36455
- var errorEvent = function() {
36456
- onError && onError();
36457
- };
36458
- var clickAvatar = function(e) {
36459
- onClick && onClick(e);
36460
- };
36461
- return /* @__PURE__ */ React.createElement(React.Fragment, null, (showMax || !groupMax || avatarIndex <= groupMax) && /* @__PURE__ */ React.createElement(components.View, {
36462
- className: cls,
36463
- style: !showMax ? styles : maxStyles,
36464
- onClick: clickAvatar,
36465
- ref: avatarRef
36466
- }, (!groupMax || avatarIndex <= groupMax) && /* @__PURE__ */ React.createElement(React.Fragment, null, src && /* @__PURE__ */ React.createElement(components.Image, {
36467
- className: "nut-avatar-img nut-avatar-".concat(groupSize || size || "normal", "-img"),
36468
- src,
36469
- style: {
36470
- objectFit: fit
36471
- },
36472
- onError: errorEvent
36473
- }), /* @__PURE__ */ React.isValidElement(icon) ? /* @__PURE__ */ React.createElement(components.View, {
36474
- className: "nut-avatar-text"
36475
- }, /* @__PURE__ */ React.cloneElement(icon, _object_spread_props(_object_spread({}, icon.props), {
36476
- color,
36477
- className: "".concat(icon.props.className || "", " nut-avatar-icon nut-avatar-").concat(groupSize || size || "normal", "-icon")
36478
- }))) : null, children && /* @__PURE__ */ React.createElement(components.View, {
36479
- style: {
36480
- color
36481
- },
36482
- className: "nut-avatar-text nut-avatar-".concat(groupSize || size || "normal", "-text")
36483
- }, children), !src && !icon && !children && /* @__PURE__ */ React.createElement(components.View, {
36484
- className: "nut-avatar-text"
36485
- }, /* @__PURE__ */ React.createElement(IconSVG$1, {
36486
- style: {
36487
- color
36488
- },
36489
- className: "nut-avatar-icon nut-avatar-".concat(groupSize || size || "normal", "-icon")
36490
- }))), showMax && /* @__PURE__ */ React.createElement(components.View, {
36491
- className: "nut-avatar-text nut-avatar-".concat(groupSize || "normal", "-text"),
36492
- style: _object_spread({}, maxStyles)
36493
- }, (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxContent) ? propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxContent : "+ ".concat(avatarIndex - Number(groupMax || 0)))));
36494
- };
36495
- Avatar.displayName = "NutAvatar";
36496
- Avatar.Group = AvatarGroup;
36497
- var defaultProps$v = _object_spread_props(_object_spread({}, ComponentDefaults), {
36498
36535
  rows: 1,
36499
- animated: false,
36500
- title: false,
36501
- avatar: false,
36502
- avatarSize: "50px",
36536
+ animated: true,
36503
36537
  visible: false,
36504
- avatarShape: "round"
36538
+ size: "normal",
36539
+ shape: "round",
36540
+ duration: 0.6,
36541
+ inline: false
36505
36542
  });
36506
36543
  var Skeleton = function(props) {
36507
- var _ref = _object_spread({}, defaultProps$v, props), className = _ref.className, animated = _ref.animated, rows = _ref.rows, title = _ref.title, avatar = _ref.avatar, avatarSize = _ref.avatarSize, visible = _ref.visible, children = _ref.children, avatarShape = _ref.avatarShape, rest = _object_without_properties(_ref, [
36544
+ var shapeStyle = function shapeStyle2() {
36545
+ if (shape === "circle") return {
36546
+ borderRadius: "50%"
36547
+ };
36548
+ if (shape === "square") return {
36549
+ borderRadius: "0"
36550
+ };
36551
+ return {};
36552
+ };
36553
+ var durationStyle = function durationStyle2() {
36554
+ if (typeof duration !== "undefined") return {
36555
+ animationDuration: "".concat(duration, "s")
36556
+ };
36557
+ return {};
36558
+ };
36559
+ var _ref = _object_spread({}, defaultProps$x, props), className = _ref.className, width2 = _ref.width, height2 = _ref.height, shape = _ref.shape, animated = _ref.animated, rows = _ref.rows, visible = _ref.visible, size = _ref.size, duration = _ref.duration, children = _ref.children, rest = _object_without_properties(_ref, [
36508
36560
  "className",
36561
+ "width",
36562
+ "height",
36563
+ "shape",
36509
36564
  "animated",
36510
36565
  "rows",
36511
- "title",
36512
- "avatar",
36513
- "avatarSize",
36514
36566
  "visible",
36515
- "children",
36516
- "avatarShape"
36567
+ "size",
36568
+ "duration",
36569
+ "children"
36517
36570
  ]);
36518
36571
  var classPrefix2 = "nut-skeleton";
36519
36572
  var classes = classNames(classPrefix2, className);
36520
- var _obj;
36521
- var avatarClass = classNames((_obj = {}, _define_property(_obj, "nut-avatar", true), _define_property(_obj, "nut-skeleton-content-avatar", true), _define_property(_obj, "avatar-".concat(avatarShape), avatarShape), _obj));
36522
- var repeatLines = function(num) {
36573
+ var repeatCount = function(num) {
36523
36574
  return Array.from({
36524
36575
  length: num
36525
36576
  }, function(v, i2) {
36526
36577
  return i2;
36527
36578
  });
36528
36579
  };
36529
- var getStyle = function() {
36530
- if (avatarSize) {
36531
- return {
36532
- width: pxTransform(parseInt(avatarSize)),
36533
- height: pxTransform(parseInt(avatarSize))
36534
- };
36535
- }
36536
- return {
36537
- width: pxTransform(50),
36538
- height: pxTransform(50)
36539
- };
36580
+ var _useState = _sliced_to_array(React.useState(false), 2), animate = _useState[0], setAnimate = _useState[1];
36581
+ var playAnimation = function() {
36582
+ setAnimate(false);
36583
+ setTimeout(function() {
36584
+ setAnimate(true);
36585
+ }, 10);
36540
36586
  };
36541
- return /* @__PURE__ */ React.createElement(React.Fragment, null, visible ? /* @__PURE__ */ React.createElement(React.Fragment, null, children) : /* @__PURE__ */ React.createElement(components.View, _object_spread({
36587
+ React.useEffect(function() {
36588
+ if (!animated) return;
36589
+ playAnimation();
36590
+ var intervalId = setInterval(playAnimation, 1e3 + duration * 1e3);
36591
+ return function() {
36592
+ return clearInterval(intervalId);
36593
+ };
36594
+ }, []);
36595
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, visible ? children : /* @__PURE__ */ React.createElement(components.View, _object_spread({
36542
36596
  className: classes
36543
- }, rest), animated && /* @__PURE__ */ React.createElement(components.View, {
36544
- className: "".concat(classPrefix2, "-animation")
36545
- }), /* @__PURE__ */ React.createElement(components.View, {
36546
- className: "".concat(classPrefix2, "-content")
36547
- }, avatar && /* @__PURE__ */ React.createElement(Avatar, {
36548
- className: avatarClass,
36549
- background: "rgb(239, 239, 239)",
36550
- shape: avatarShape,
36551
- style: getStyle(),
36552
- icon: "null"
36553
- }), rows === 1 ? /* @__PURE__ */ React.createElement(components.View, {
36554
- className: "".concat(classPrefix2, "-content-block")
36555
- }) : /* @__PURE__ */ React.createElement(components.View, {
36556
- className: "".concat(classPrefix2, "-content-line")
36557
- }, title && /* @__PURE__ */ React.createElement(components.View, {
36558
- className: "".concat(classPrefix2, "-content-title")
36559
- }), repeatLines(rows).map(function(item, index2) {
36597
+ }, rest), repeatCount(rows).map(function(item, index2) {
36598
+ var contentClass = "".concat(classPrefix2, "-content ").concat(classPrefix2, "-content-").concat(size, " ").concat(classPrefix2, "-content-").concat(size, "-").concat(index2);
36560
36599
  return /* @__PURE__ */ React.createElement(components.View, {
36561
- className: "".concat(classPrefix2, "-content-block ").concat(index2 === repeatLines(rows).length - 1 ? "".concat(classPrefix2, "-content-block-last-child") : ""),
36562
- key: index2
36563
- });
36564
- })))));
36600
+ className: "".concat(contentClass),
36601
+ key: index2,
36602
+ style: _object_spread({
36603
+ width: width2,
36604
+ height: height2
36605
+ }, shapeStyle())
36606
+ }, animated && /* @__PURE__ */ React.createElement(components.View, {
36607
+ className: "".concat(classPrefix2, "-animated ").concat(animate ? "".concat(classPrefix2, "-animation") : ""),
36608
+ style: durationStyle()
36609
+ }));
36610
+ })));
36565
36611
  };
36566
36612
  Skeleton.displayName = "NutSkeleton";
36567
36613
  function preventDefault(event, isStopPropagation) {
@@ -36572,7 +36618,7 @@
36572
36618
  event.stopPropagation();
36573
36619
  }
36574
36620
  }
36575
- var defaultProps$u = _object_spread_props(_object_spread({}, ComponentDefaults), {
36621
+ var defaultProps$w = _object_spread_props(_object_spread({}, ComponentDefaults), {
36576
36622
  name: ""
36577
36623
  });
36578
36624
  var Swipe = /* @__PURE__ */ React.forwardRef(function(props, instanceRef) {
@@ -36636,7 +36682,7 @@
36636
36682
  return getWidth();
36637
36683
  });
36638
36684
  });
36639
- var _$_object_spread = _object_spread({}, defaultProps$u, props), children = _$_object_spread.children, className = _$_object_spread.className, style = _$_object_spread.style;
36685
+ var _$_object_spread = _object_spread({}, defaultProps$w, props), children = _$_object_spread.children, className = _$_object_spread.className, style = _$_object_spread.style;
36640
36686
  var root2 = React.useRef();
36641
36687
  var opened = React.useRef(false);
36642
36688
  var lockClick = React.useRef(false);
@@ -36870,7 +36916,7 @@
36870
36916
  }, renderActionContent("left"), children, renderActionContent("right")));
36871
36917
  });
36872
36918
  Swipe.displayName = "NutSwipe";
36873
- var defaultProps$t = _object_spread_props(_object_spread({}, defaultOverlayProps), {
36919
+ var defaultProps$v = _object_spread_props(_object_spread({}, defaultOverlayProps), {
36874
36920
  id: "",
36875
36921
  duration: 2,
36876
36922
  position: "middle",
@@ -36889,7 +36935,7 @@
36889
36935
  }
36890
36936
  });
36891
36937
  var Toast = function(props) {
36892
- var _useParams = useParams(mergeProps(defaultProps$t, props)), _useParams_params = _useParams.params, id = _useParams_params.id, position2 = _useParams_params.position, contentStyle = _useParams_params.contentStyle, icon = _useParams_params.icon, content2 = _useParams_params.content, duration = _useParams_params.duration, title = _useParams_params.title, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, lockScroll = _useParams_params.lockScroll, contentClassName = _useParams_params.contentClassName, visible = _useParams_params.visible, size = _useParams_params.size, className = _useParams_params.className, style = _useParams_params.style, wordBreak = _useParams_params.wordBreak, zIndex = _useParams_params.zIndex, onClose = _useParams_params.onClose, setParams = _useParams.setParams;
36938
+ var _useParams = useParams(mergeProps(defaultProps$v, props)), _useParams_params = _useParams.params, id = _useParams_params.id, position2 = _useParams_params.position, contentStyle = _useParams_params.contentStyle, icon = _useParams_params.icon, content2 = _useParams_params.content, duration = _useParams_params.duration, title = _useParams_params.title, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, lockScroll = _useParams_params.lockScroll, contentClassName = _useParams_params.contentClassName, visible = _useParams_params.visible, size = _useParams_params.size, className = _useParams_params.className, style = _useParams_params.style, wordBreak = _useParams_params.wordBreak, zIndex = _useParams_params.zIndex, onClose = _useParams_params.onClose, setParams = _useParams.setParams;
36893
36939
  var classPrefix2 = "nut-toast";
36894
36940
  var timer = React.useRef(-1);
36895
36941
  var rtl = useRtl();
@@ -37013,21 +37059,21 @@
37013
37059
  Toast.displayName = "NutToast";
37014
37060
  Toast.show = show;
37015
37061
  Toast.hide = hide;
37016
- var defaultProps$s = _object_spread_props(_object_spread({}, ComponentDefaults), {
37062
+ var defaultProps$u = _object_spread_props(_object_spread({}, ComponentDefaults), {
37017
37063
  type: "shake",
37018
37064
  action: "initial",
37019
37065
  loop: false,
37020
37066
  onClick: function(event) {
37021
37067
  }
37022
37068
  });
37023
- var classPrefix$8 = "nut-animate";
37069
+ var classPrefix$a = "nut-animate";
37024
37070
  var Animate = function(props) {
37025
- var _$_object_spread = _object_spread({}, defaultProps$s, props), className = _$_object_spread.className, type2 = _$_object_spread.type, action = _$_object_spread.action, loop = _$_object_spread.loop, onClick = _$_object_spread.onClick, children = _$_object_spread.children, style = _$_object_spread.style;
37071
+ var _$_object_spread = _object_spread({}, defaultProps$u, props), className = _$_object_spread.className, type2 = _$_object_spread.type, action = _$_object_spread.action, loop = _$_object_spread.loop, onClick = _$_object_spread.onClick, children = _$_object_spread.children, style = _$_object_spread.style;
37026
37072
  var _useState = _sliced_to_array(React.useState(false), 2), clicked = _useState[0], setClicked = _useState[1];
37027
37073
  var _obj;
37028
37074
  var classes = classNames((_obj = {
37029
37075
  "nut-ani-container": true
37030
- }, _define_property(_obj, "".concat(classPrefix$8, "-").concat(type2), action === "initial" || clicked), _define_property(_obj, "loop", loop), _obj), className);
37076
+ }, _define_property(_obj, "".concat(classPrefix$a, "-").concat(type2), action === "initial" || clicked), _define_property(_obj, "loop", loop), _obj), className);
37031
37077
  var handleClick = function(event) {
37032
37078
  setClicked(true);
37033
37079
  if (!loop) {
@@ -37046,7 +37092,7 @@
37046
37092
  }, children));
37047
37093
  };
37048
37094
  Animate.displayName = "NutAnimate";
37049
- var defaultProps$r = _object_spread_props(_object_spread({}, ComponentDefaults), {
37095
+ var defaultProps$t = _object_spread_props(_object_spread({}, ComponentDefaults), {
37050
37096
  length: 0,
37051
37097
  value: "",
37052
37098
  delay: 300,
@@ -37054,7 +37100,7 @@
37054
37100
  thousands: false
37055
37101
  });
37056
37102
  var CountUp = function(props) {
37057
- var _mergeProps = mergeProps(defaultProps$r, props), length2 = _mergeProps.length, value2 = _mergeProps.value, delay = _mergeProps.delay, duration = _mergeProps.duration, className = _mergeProps.className, thousands = _mergeProps.thousands;
37103
+ var _mergeProps = mergeProps(defaultProps$t, props), length2 = _mergeProps.length, value2 = _mergeProps.value, delay = _mergeProps.delay, duration = _mergeProps.duration, className = _mergeProps.className, thousands = _mergeProps.thousands;
37058
37104
  _mergeProps.style;
37059
37105
  var rest = _object_without_properties(_mergeProps, [
37060
37106
  "length",
@@ -37157,7 +37203,7 @@
37157
37203
  })));
37158
37204
  };
37159
37205
  CountUp.displayName = "NutCountUp";
37160
- var defaultProps$q = {};
37206
+ var defaultProps$s = {};
37161
37207
  var AnimatingNumbers = /* @__PURE__ */ function(Component) {
37162
37208
  _inherits(AnimatingNumbers2, Component);
37163
37209
  function AnimatingNumbers2(props) {
@@ -37181,11 +37227,11 @@
37181
37227
  ]);
37182
37228
  return AnimatingNumbers2;
37183
37229
  }(React.Component);
37184
- _define_property(AnimatingNumbers, "defaultProps", defaultProps$q);
37230
+ _define_property(AnimatingNumbers, "defaultProps", defaultProps$s);
37185
37231
  _define_property(AnimatingNumbers, "displayName", "NutAnimatingNumbers");
37186
37232
  _define_property(AnimatingNumbers, "CountUp", CountUp);
37187
37233
  AnimatingNumbers.CountUp = CountUp;
37188
- var defaultProps$p = _object_spread_props(_object_spread({}, ComponentDefaults), {
37234
+ var defaultProps$r = _object_spread_props(_object_spread({}, ComponentDefaults), {
37189
37235
  className: "",
37190
37236
  src: "",
37191
37237
  style: {},
@@ -37222,7 +37268,7 @@
37222
37268
  };
37223
37269
  var classPrefix2 = "nut-audio";
37224
37270
  var locale = useConfig().locale;
37225
- var _ref = _object_spread({}, defaultProps$p, props), className = _ref.className, src = _ref.src, style = _ref.style, autoplay = _ref.autoplay, loop = _ref.loop, type2 = _ref.type, onFastBack = _ref.onFastBack, onForward = _ref.onForward, onPause = _ref.onPause, onPlay = _ref.onPlay, onPlayEnd = _ref.onPlayEnd, onCanPlay = _ref.onCanPlay, children = _ref.children;
37271
+ var _ref = _object_spread({}, defaultProps$r, props), className = _ref.className, src = _ref.src, style = _ref.style, autoplay = _ref.autoplay, loop = _ref.loop, type2 = _ref.type, onFastBack = _ref.onFastBack, onForward = _ref.onForward, onPause = _ref.onPause, onPlay = _ref.onPlay, onPlayEnd = _ref.onPlayEnd, onCanPlay = _ref.onCanPlay, children = _ref.children;
37226
37272
  _ref.iconClassPrefix;
37227
37273
  _ref.iconFontClassName;
37228
37274
  var rest = _object_without_properties(_ref, [
@@ -37385,6 +37431,135 @@
37385
37431
  }, rest), renderAudio());
37386
37432
  };
37387
37433
  Audio.displayName = "NutAudio";
37434
+ var AvatarContext = React.createContext({});
37435
+ var defaultProps$q = _object_spread_props(_object_spread({}, ComponentDefaults), {
37436
+ maxContent: "",
37437
+ max: "",
37438
+ maxBackground: "#eee",
37439
+ maxColor: "#666",
37440
+ gap: "-8",
37441
+ level: "left"
37442
+ });
37443
+ var classPrefix$9 = "nut-avatar-group";
37444
+ var AvatarGroup = function(props) {
37445
+ var propAvatarGroup = _object_spread({}, defaultProps$q, props);
37446
+ var className = propAvatarGroup.className, style = propAvatarGroup.style, children = propAvatarGroup.children;
37447
+ var avatarGroupRef = React.useRef(null);
37448
+ var cls = classNames(classPrefix$9, className);
37449
+ var parentAvatar = {
37450
+ propAvatarGroup: _object_spread({
37451
+ avatarCount: React.Children.count(children) || 0
37452
+ }, propAvatarGroup),
37453
+ avatarGroupRef
37454
+ };
37455
+ return /* @__PURE__ */ React.createElement(AvatarContext.Provider, {
37456
+ value: parentAvatar
37457
+ }, /* @__PURE__ */ React.createElement(components.View, {
37458
+ className: cls,
37459
+ style,
37460
+ ref: avatarGroupRef
37461
+ }, React.Children.map(children, function(child, index2) {
37462
+ var _child_type;
37463
+ return (child === null || child === void 0 ? void 0 : (_child_type = child.type) === null || _child_type === void 0 ? void 0 : _child_type.displayName) === "NutAvatar" ? /* @__PURE__ */ React.cloneElement(child, {
37464
+ avatarIndex: index2 + 1,
37465
+ className: "nut-avatar-group-avatar"
37466
+ }) : child;
37467
+ })));
37468
+ };
37469
+ AvatarGroup.displayName = "NutAvatarGroup";
37470
+ var defaultProps$p = _object_spread_props(_object_spread({}, ComponentDefaults), {
37471
+ size: harmony() ? "40" : "",
37472
+ shape: "round",
37473
+ icon: "",
37474
+ background: "#eee",
37475
+ color: "#666",
37476
+ fit: "cover",
37477
+ src: "",
37478
+ alt: "",
37479
+ avatarIndex: 0
37480
+ });
37481
+ var classPrefix$8 = "nut-avatar";
37482
+ var Avatar = function(props) {
37483
+ var _$_object_spread = _object_spread({}, defaultProps$p, props), children = _$_object_spread.children, size = _$_object_spread.size, shape = _$_object_spread.shape, background = _$_object_spread.background, color = _$_object_spread.color, src = _$_object_spread.src, icon = _$_object_spread.icon, fit = _$_object_spread.fit, avatarIndex = _$_object_spread.avatarIndex, className = _$_object_spread.className, style = _$_object_spread.style, onClick = _$_object_spread.onClick, onError = _$_object_spread.onError;
37484
+ var _useState = _sliced_to_array(React.useState(false), 2), showMax = _useState[0], setShowMax = _useState[1];
37485
+ var avatarRef = React.useRef(null);
37486
+ var parent2 = React.useContext(AvatarContext);
37487
+ var sizeValue = [
37488
+ "large",
37489
+ "normal",
37490
+ "small"
37491
+ ];
37492
+ var propAvatarGroup = parent2.propAvatarGroup;
37493
+ var groupSize = propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.size;
37494
+ var groupShape = propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.shape;
37495
+ var groupCount = propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.avatarCount;
37496
+ var groupMax = propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.max;
37497
+ var _obj;
37498
+ var classes = classNames((_obj = {}, _define_property(_obj, "nut-avatar-".concat(groupSize || size || "normal"), true), _define_property(_obj, "nut-avatar-".concat(groupShape || shape), true), _define_property(_obj, "nut-avatar-".concat(groupSize || size || "normal", "-round"), shape === "round" && true), _obj));
37499
+ var nativeClasses = classNames(_define_property({}, "nut-avatar-first-child", avatarIndex === 1));
37500
+ var cls = classNames(classPrefix$8, classes, className, nativeClasses);
37501
+ var _obj1;
37502
+ var styles = _object_spread((_obj1 = {
37503
+ width: sizeValue.indexOf(size) > -1 ? "" : pxTransform(parseInt(size)),
37504
+ height: sizeValue.indexOf(size) > -1 ? "" : pxTransform(parseInt(size)),
37505
+ backgroundColor: "".concat(background),
37506
+ color
37507
+ }, _define_property(_obj1, harmony() ? "marginRight" : "marginLeft", avatarIndex !== 1 && (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.gap) ? "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.gap, "px") : ""), _define_property(_obj1, "zIndex", (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.level) === "right" ? Math.abs(groupCount - avatarIndex) : ""), _obj1), style);
37508
+ var maxStyles = {
37509
+ backgroundColor: "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxBackground),
37510
+ color: "".concat(propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxColor)
37511
+ };
37512
+ React.useEffect(function() {
37513
+ var maxCount = groupMax || groupCount;
37514
+ if (avatarIndex === groupCount && avatarIndex !== maxCount && groupCount > maxCount) {
37515
+ setShowMax(true);
37516
+ }
37517
+ }, [
37518
+ avatarIndex,
37519
+ groupCount
37520
+ ]);
37521
+ var errorEvent = function() {
37522
+ onError && onError();
37523
+ };
37524
+ var clickAvatar = function(e) {
37525
+ onClick && onClick(e);
37526
+ };
37527
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, (showMax || !groupMax || avatarIndex <= groupMax) && /* @__PURE__ */ React.createElement(components.View, {
37528
+ className: cls,
37529
+ style: !showMax ? styles : maxStyles,
37530
+ onClick: clickAvatar,
37531
+ ref: avatarRef
37532
+ }, (!groupMax || avatarIndex <= groupMax) && /* @__PURE__ */ React.createElement(React.Fragment, null, src && /* @__PURE__ */ React.createElement(components.Image, {
37533
+ className: "nut-avatar-img nut-avatar-".concat(groupSize || size || "normal", "-img"),
37534
+ src,
37535
+ style: {
37536
+ objectFit: fit
37537
+ },
37538
+ onError: errorEvent
37539
+ }), /* @__PURE__ */ React.isValidElement(icon) ? /* @__PURE__ */ React.createElement(components.View, {
37540
+ className: "nut-avatar-text"
37541
+ }, /* @__PURE__ */ React.cloneElement(icon, _object_spread_props(_object_spread({}, icon.props), {
37542
+ color,
37543
+ className: "".concat(icon.props.className || "", " nut-avatar-icon nut-avatar-").concat(groupSize || size || "normal", "-icon")
37544
+ }))) : null, children && /* @__PURE__ */ React.createElement(components.View, {
37545
+ style: {
37546
+ color
37547
+ },
37548
+ className: "nut-avatar-text nut-avatar-".concat(groupSize || size || "normal", "-text")
37549
+ }, children), !src && !icon && !children && /* @__PURE__ */ React.createElement(components.View, {
37550
+ className: "nut-avatar-text"
37551
+ }, /* @__PURE__ */ React.createElement(IconSVG$1, {
37552
+ style: {
37553
+ color
37554
+ },
37555
+ className: "nut-avatar-icon nut-avatar-".concat(groupSize || size || "normal", "-icon")
37556
+ }))), showMax && /* @__PURE__ */ React.createElement(components.View, {
37557
+ className: "nut-avatar-text nut-avatar-".concat(groupSize || "normal", "-text"),
37558
+ style: _object_spread({}, maxStyles)
37559
+ }, (propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxContent) ? propAvatarGroup === null || propAvatarGroup === void 0 ? void 0 : propAvatarGroup.maxContent : "+ ".concat(avatarIndex - Number(groupMax || 0)))));
37560
+ };
37561
+ Avatar.displayName = "NutAvatar";
37562
+ Avatar.Group = AvatarGroup;
37388
37563
  var defaultProps$o = _object_spread_props(_object_spread({}, ComponentDefaults), {
37389
37564
  strokeWidth: 5,
37390
37565
  radius: 50,
@@ -38279,7 +38454,7 @@
38279
38454
  var classPrefix$5 = "nut-indicator";
38280
38455
  var Indicator = function(props) {
38281
38456
  var maybeFixedWidth = function maybeFixedWidth2() {
38282
- if (total === 2 || type2 === "slide") {
38457
+ if (type2 === "dualScreen" || type2 === "slide") {
38283
38458
  return "".concat(classPrefix$5, "-fixed-width");
38284
38459
  }
38285
38460
  return "";
@@ -38477,7 +38652,7 @@
38477
38652
  closeIcon: false,
38478
38653
  closeIconPosition: "top-right",
38479
38654
  showMenuByLongpress: false,
38480
- onChange: function(value2) {
38655
+ onChange: function() {
38481
38656
  },
38482
38657
  onClose: function() {
38483
38658
  }
@@ -38490,71 +38665,50 @@
38490
38665
  value: value2,
38491
38666
  defaultValue,
38492
38667
  finalValue: defaultValue,
38493
- onChange: function(val2) {
38494
- onChange === null || onChange === void 0 ? void 0 : onChange(val2);
38495
- }
38668
+ onChange
38496
38669
  }), 2), innerNo = _usePropsValue[0], setInnerNo = _usePropsValue[1];
38497
38670
  var _useState = _sliced_to_array(React.useState(visible), 2), showPop = _useState[0], setShowPop = _useState[1];
38498
38671
  var _useState1 = _sliced_to_array(React.useState(0), 2), active2 = _useState1[0], setActive = _useState1[1];
38499
- var _useState2 = _sliced_to_array(React.useState((images === null || images === void 0 ? void 0 : images.length) || 0 + ((videos === null || videos === void 0 ? void 0 : videos.length) || 0)), 2), maxNo = _useState2[0], setMaxNo = _useState2[1];
38672
+ var _useState2 = _sliced_to_array(React.useState(images.length + videos.length), 2), maxNo = _useState2[0], setMaxNo = _useState2[1];
38500
38673
  var _useState3 = _sliced_to_array(React.useState({
38501
38674
  scale: 1,
38502
- moveable: false
38675
+ moveable: false,
38676
+ oriDistance: 0,
38677
+ originScale: 1
38503
38678
  }), 2), store = _useState3[0], setStore = _useState3[1];
38504
- var _useState4 = _sliced_to_array(React.useState(0), 2), lastTouchEndTime = _useState4[0], setLastTouchEndTime = _useState4[1];
38679
+ var lastTouchEndTime = React.useRef(0);
38505
38680
  var onTouchStart = function(event) {
38506
38681
  var touches = event.touches;
38507
38682
  var events = touches[0];
38508
38683
  var events2 = touches[1];
38509
- var curTouchTime = (/* @__PURE__ */ new Date()).getTime();
38510
- if (curTouchTime - lastTouchEndTime < 300) {
38684
+ var curTouchTime = Date.now();
38685
+ if (curTouchTime - lastTouchEndTime.current < 100) {
38511
38686
  var store1 = store;
38512
- if (store1.scale > 1) {
38513
- store1.scale = 1;
38514
- } else if (store1.scale === 1) {
38515
- store1.scale = 2;
38516
- }
38687
+ store1.scale = store1.scale === 1 ? 2 : 1;
38517
38688
  scaleNow();
38518
38689
  }
38519
38690
  var store11 = store;
38520
38691
  store11.moveable = true;
38521
38692
  if (events2) {
38522
- store11.oriDistance = getDistance({
38523
- x: events.pageX,
38524
- y: events.pageY
38525
- }, {
38526
- x: events2.pageX,
38527
- y: events2.pageY
38528
- });
38693
+ store11.oriDistance = getDistance(events, events2);
38529
38694
  }
38530
- store11.originScale = store11.scale || 1;
38695
+ store11.originScale = store11.scale;
38531
38696
  };
38532
38697
  var onTouchMove = function(event) {
38698
+ if (!store.moveable) return;
38533
38699
  var touches = event.touches;
38534
38700
  var events = touches[0];
38535
38701
  var events2 = touches[1];
38536
- if (!store.moveable) {
38537
- return;
38538
- }
38539
38702
  var store1 = store;
38540
38703
  if (events2) {
38541
- var curDistance = getDistance({
38542
- x: events.pageX,
38543
- y: events.pageY
38544
- }, {
38545
- x: events2.pageX,
38546
- y: events2.pageY
38547
- });
38704
+ var curDistance = getDistance(events, events2);
38548
38705
  var curScale = curDistance / store1.oriDistance;
38549
- store1.scale = store1.originScale * curScale;
38550
- if (store1.scale > 3) {
38551
- store1.scale = 3;
38552
- }
38706
+ store1.scale = Math.min(store1.originScale * curScale, 3);
38553
38707
  scaleNow();
38554
38708
  }
38555
38709
  };
38556
38710
  var onTouchEnd = function() {
38557
- setLastTouchEndTime((/* @__PURE__ */ new Date()).getTime());
38711
+ lastTouchEndTime.current = Date.now();
38558
38712
  var store1 = store;
38559
38713
  store1.moveable = false;
38560
38714
  if (store1.scale < 1.1 && store1.scale > 1 || store1.scale < 1) {
@@ -38569,6 +38723,11 @@
38569
38723
  document.addEventListener("touchmove", onTouchMove);
38570
38724
  document.addEventListener("touchend", onTouchEnd);
38571
38725
  document.addEventListener("touchcancel", onTouchEnd);
38726
+ return function() {
38727
+ document.removeEventListener("touchcancel", onTouchEnd);
38728
+ document.removeEventListener("touchmove", onTouchMove);
38729
+ document.removeEventListener("touchend", onTouchEnd);
38730
+ };
38572
38731
  };
38573
38732
  React.useEffect(function() {
38574
38733
  setShowPop(visible);
@@ -38586,7 +38745,7 @@
38586
38745
  innerNo
38587
38746
  ]);
38588
38747
  React.useEffect(function() {
38589
- setMaxNo((images === null || images === void 0 ? void 0 : images.length) || 0 + ((videos === null || videos === void 0 ? void 0 : videos.length) || 0));
38748
+ setMaxNo(images.length + videos.length);
38590
38749
  }, [
38591
38750
  images,
38592
38751
  videos
@@ -38597,7 +38756,7 @@
38597
38756
  }
38598
38757
  };
38599
38758
  var getDistance = function(first, second) {
38600
- return Math.hypot(Math.abs(second.x - first.x), Math.abs(second.y - first.y));
38759
+ return Math.hypot(Math.abs(second.pageX - first.pageX), Math.abs(second.pageY - first.pageY));
38601
38760
  };
38602
38761
  var slideChangeEnd = function(page) {
38603
38762
  setActive(page + 1);
@@ -38608,29 +38767,27 @@
38608
38767
  setShowPop(false);
38609
38768
  setActive(innerNo);
38610
38769
  scaleNow();
38611
- onClose && onClose();
38770
+ onClose === null || onClose === void 0 ? void 0 : onClose();
38612
38771
  setStore(_object_spread_props(_object_spread({}, store), {
38613
38772
  scale: 1
38614
38773
  }));
38615
38774
  };
38616
38775
  var closeOnImg = function(e) {
38617
38776
  e.stopPropagation();
38618
- if (closeOnContentClick) {
38619
- onCloseInner(e);
38620
- }
38777
+ if (closeOnContentClick) onCloseInner(e);
38621
38778
  };
38622
38779
  return /* @__PURE__ */ React.createElement(Popup, {
38623
38780
  visible: showPop,
38624
38781
  className: "".concat(classPrefix2, "-pop"),
38625
- style: {
38626
- width: "100%"
38627
- },
38628
38782
  onClick: onCloseInner
38629
38783
  }, /* @__PURE__ */ React.createElement(components.View, {
38630
38784
  className: classNames(classPrefix2, className),
38631
38785
  style,
38632
38786
  ref,
38633
- onTouchStart
38787
+ onTouchStart,
38788
+ onTouchMove,
38789
+ onTouchEnd,
38790
+ onTouchCancel: onTouchEnd
38634
38791
  }, /* @__PURE__ */ React.createElement(InnerSwiper, {
38635
38792
  autoPlay,
38636
38793
  className: "".concat(classPrefix2, "-swiper"),
@@ -38648,60 +38805,57 @@
38648
38805
  },
38649
38806
  defaultValue: innerNo && (innerNo > maxNo ? maxNo - 1 : innerNo - 1),
38650
38807
  indicator
38651
- }, (videos !== null && videos !== void 0 ? videos : []).map(function(item) {
38808
+ }, _to_consumable_array(videos.map(function(item) {
38652
38809
  return {
38653
38810
  type: "video",
38654
38811
  data: item
38655
38812
  };
38656
- }).concat((images !== null && images !== void 0 ? images : []).map(function(item) {
38813
+ })).concat(_to_consumable_array(images.map(function(item) {
38657
38814
  return {
38658
38815
  type: "image",
38659
38816
  data: item
38660
38817
  };
38661
- })).sort(function(a, b) {
38818
+ }))).sort(function(a, b) {
38662
38819
  var _a_data, _b_data;
38663
38820
  var _a_data_index, _b_data_index;
38664
38821
  return ((_a_data_index = (_a_data = a.data) === null || _a_data === void 0 ? void 0 : _a_data.index) !== null && _a_data_index !== void 0 ? _a_data_index : 0) - ((_b_data_index = (_b_data = b.data) === null || _b_data === void 0 ? void 0 : _b_data.index) !== null && _b_data_index !== void 0 ? _b_data_index : 0);
38665
38822
  }).map(function(item, index2) {
38666
- if (item.type === "video") {
38667
- var _item_data = item.data, source = _item_data.source, options = _item_data.options;
38668
- return /* @__PURE__ */ React.createElement(SwiperItem, {
38669
- key: index2,
38670
- className: "nut-imagepreview-swiper-item"
38671
- }, /* @__PURE__ */ React.createElement(components.Video, {
38672
- src: source.src,
38673
- onClick: closeOnImg,
38674
- controls: options.controls,
38675
- autoplay: false,
38676
- loop: false,
38677
- muted: options.muted
38678
- }));
38679
- }
38680
- if (item.type === "image") {
38681
- var src = item.data.src;
38682
- return /* @__PURE__ */ React.createElement(SwiperItem, {
38683
- key: index2,
38684
- className: "nut-imagepreview-swiper-item"
38685
- }, /* @__PURE__ */ React.createElement(Image$1, _object_spread({
38686
- src,
38687
- mode: "widthFix",
38688
- onClick: closeOnImg,
38689
- style: {
38690
- width: "100%"
38691
- }
38692
- }, Taro.getEnv() !== "WEB" && {
38693
- showMenuByLongpress
38694
- })));
38695
- }
38696
- return null;
38697
- }))), pagination ? /* @__PURE__ */ React.createElement(components.View, {
38823
+ return /* @__PURE__ */ React.createElement(SwiperItem, {
38824
+ key: index2,
38825
+ className: "nut-imagepreview-swiper-item"
38826
+ }, item.type === "video" ? /* @__PURE__ */ React.createElement(components.Video, {
38827
+ src: item.data.source.src,
38828
+ onClick: closeOnImg,
38829
+ controls: item.data.options.controls,
38830
+ autoplay: false,
38831
+ loop: false,
38832
+ muted: item.data.options.muted
38833
+ }) : /* @__PURE__ */ React.createElement(Image$1, _object_spread({
38834
+ src: item.data.src,
38835
+ mode: "widthFix",
38836
+ onClick: closeOnImg,
38837
+ style: {
38838
+ width: "100%"
38839
+ }
38840
+ }, Taro.getEnv() !== "WEB" && {
38841
+ showMenuByLongpress
38842
+ })));
38843
+ }))), pagination && /* @__PURE__ */ React.createElement(components.View, {
38698
38844
  className: "".concat(classPrefix2, "-index")
38699
- }, active2, "/", (images ? images.length : 0) + (videos ? videos.length : 0)) : null, closeIcon !== false ? /* @__PURE__ */ React.createElement(components.View, {
38845
+ }, active2, "/", maxNo), closeIcon !== false && /* @__PURE__ */ React.createElement(components.View, {
38700
38846
  className: "".concat(classPrefix2, "-close ").concat(closeIconPosition),
38701
38847
  onClick: onCloseInner
38702
- }, closeIcon === true ? /* @__PURE__ */ React.createElement(IconSVG$p, null) : closeIcon) : null);
38848
+ }, closeIcon === true ? /* @__PURE__ */ React.createElement(IconSVG$p, null) : closeIcon));
38703
38849
  };
38704
38850
  ImagePreview.displayName = "NutImagePreview";
38851
+ function addColorForHarmony(maybeElement, color) {
38852
+ if (React.isValidElement(maybeElement) && harmony()) {
38853
+ return React.cloneElement(maybeElement, {
38854
+ color
38855
+ });
38856
+ }
38857
+ return maybeElement;
38858
+ }
38705
38859
  var defaultPaginationOptions = {
38706
38860
  current: 0,
38707
38861
  itemsPerPage: 10,