@nutui/nutui-react-taro 1.4.5 → 1.4.6-beta.1

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 (162) hide show
  1. package/CHANGELOG.md +8 -8
  2. package/dist/esm/ActionSheet.js +6 -5
  3. package/dist/esm/Address.js +8 -8
  4. package/dist/esm/AnimatingNumbers.js +2 -2
  5. package/dist/esm/Audio.js +8 -8
  6. package/dist/esm/Avatar.js +3 -3
  7. package/dist/esm/BackTop.js +3 -3
  8. package/dist/esm/Badge.js +3 -3
  9. package/dist/esm/Barrage.js +2 -2
  10. package/dist/esm/Button.js +3 -3
  11. package/dist/esm/Calendar.js +8 -7
  12. package/dist/esm/CalendarItem.js +3 -3
  13. package/dist/esm/Card.js +4 -4
  14. package/dist/esm/Cascader.js +7 -6
  15. package/dist/esm/Cell.js +3 -3
  16. package/dist/esm/Checkbox.js +3 -3
  17. package/dist/esm/CheckboxGroup.js +3 -3
  18. package/dist/esm/CollapseItem.js +3 -3
  19. package/dist/esm/DatePicker.js +8 -7
  20. package/dist/esm/Dialog.js +4 -4
  21. package/dist/esm/Drag.js +2 -2
  22. package/dist/esm/Elevator.js +2 -2
  23. package/dist/esm/Ellipsis.js +3 -3
  24. package/dist/esm/FixedNav.js +5 -4
  25. package/dist/esm/Form.js +5 -5
  26. package/dist/esm/FormItem.js +4 -4
  27. package/dist/esm/GridItem.js +3 -3
  28. package/dist/esm/Icon.js +2 -2
  29. package/dist/esm/Image.js +3 -3
  30. package/dist/esm/ImagePreview.js +6 -5
  31. package/dist/esm/Infiniteloading.js +3 -3
  32. package/dist/esm/Input.js +3 -3
  33. package/dist/esm/InputNumber.js +3 -3
  34. package/dist/esm/Menu.js +3 -3
  35. package/dist/esm/MenuItem.js +5 -4
  36. package/dist/esm/NavBar.js +3 -3
  37. package/dist/esm/NoticeBar.js +4 -4
  38. package/dist/esm/NumberKeyboard.js +6 -5
  39. package/dist/esm/Overlay.js +3 -2
  40. package/dist/esm/Picker.js +7 -6
  41. package/dist/esm/Popover.js +6 -5
  42. package/dist/esm/Popup.js +5 -4
  43. package/dist/esm/Progress.js +3 -3
  44. package/dist/esm/PullToRefresh.js +3 -2
  45. package/dist/esm/Radio.js +2 -2
  46. package/dist/esm/RadioGroup.js +3 -3
  47. package/dist/esm/Range.js +5 -5
  48. package/dist/esm/Rate.js +3 -3
  49. package/dist/esm/SearchBar.js +3 -3
  50. package/dist/esm/ShortPassword.js +6 -5
  51. package/dist/esm/SideNavBar.js +6 -5
  52. package/dist/esm/Signature.js +4 -4
  53. package/dist/esm/Skeleton.js +4 -4
  54. package/dist/esm/Step.js +3 -3
  55. package/dist/esm/Sticky.js +5 -5
  56. package/dist/esm/Swipe.js +3 -3
  57. package/dist/esm/TabbarItem.js +3 -3
  58. package/dist/esm/Table.js +3 -3
  59. package/dist/esm/Tabs.js +3 -3
  60. package/dist/esm/Tag.js +3 -3
  61. package/dist/esm/TimeSelect.js +6 -5
  62. package/dist/esm/Toast.js +3 -3
  63. package/dist/esm/TrendArrow.js +3 -3
  64. package/dist/esm/Uploader.js +7 -7
  65. package/dist/esm/VirtualList.js +2 -2
  66. package/dist/esm/WaterMark.js +4 -4
  67. package/dist/esm/{actionsheet.taro-a58d3d12.js → actionsheet.taro-27121a38.js} +1 -1
  68. package/dist/esm/{address.taro-79cc7c96.js → address.taro-1765a37c.js} +14 -14
  69. package/dist/esm/{animatingnumbers.taro-6f40a2e9.js → animatingnumbers.taro-6307a3a5.js} +2 -2
  70. package/dist/esm/{audio.taro-4fadc583.js → audio.taro-cf530b91.js} +5 -5
  71. package/dist/esm/{avatar.taro-85ced995.js → avatar.taro-1d2bf09a.js} +1 -2
  72. package/dist/esm/{backtop.taro-99107c30.js → backtop.taro-e53236c7.js} +3 -3
  73. package/dist/esm/{badge.taro-fe9171ec.js → badge.taro-11e2ec95.js} +1 -1
  74. package/dist/esm/{barrage.taro-0e157b5e.js → barrage.taro-e4fe81ae.js} +2 -2
  75. package/dist/esm/{button.taro-4ce133b9.js → button.taro-b7c5f5a7.js} +1 -1
  76. package/dist/esm/{calendar.taro-4ed72058.js → calendar.taro-05c40d76.js} +2 -2
  77. package/dist/esm/{calendaritem.taro-1ebe428d.js → calendaritem.taro-3cfd4186.js} +1 -1
  78. package/dist/esm/{card.taro-39055e82.js → card.taro-7e85c3da.js} +1 -1
  79. package/dist/esm/{cascader.taro-d8cb1c3e.js → cascader.taro-66462c03.js} +3 -3
  80. package/dist/esm/{cell.taro-9a04a92e.js → cell.taro-e877cf12.js} +3 -3
  81. package/dist/esm/{checkbox.taro-0bda9796.js → checkbox.taro-04da7151.js} +1 -1
  82. package/dist/esm/{collapseitem-ce1849d2.js → collapseitem-2e864527.js} +1 -1
  83. package/dist/esm/{datepicker.taro-7220e495.js → datepicker.taro-8507d826.js} +1 -1
  84. package/dist/esm/{dialog.taro-1c03960e.js → dialog.taro-0f64e21a.js} +1 -1
  85. package/dist/esm/{drag.taro-82b6b27a.js → drag.taro-703560c4.js} +3 -3
  86. package/dist/esm/{elevator.taro-d7d65470.js → elevator.taro-68cfaaee.js} +4 -4
  87. package/dist/esm/{ellipsis.taro-49b6db0c.js → ellipsis.taro-aa39faf7.js} +3 -3
  88. package/dist/esm/{fixednav.taro-5ad15202.js → fixednav.taro-84930e08.js} +2 -2
  89. package/dist/esm/{form.taro-71d32671.js → form.taro-ce791a58.js} +1 -1
  90. package/dist/esm/{formitem.taro-3089489b.js → formitem.taro-f2ed02d4.js} +1 -1
  91. package/dist/esm/get-scroll-parent-3dcd3f53.js +28 -0
  92. package/dist/esm/{griditem.taro-4cade72e.js → griditem.taro-5406bd2c.js} +1 -1
  93. package/dist/esm/{icon-8dc4de10.js → icon-2242973e.js} +13 -4
  94. package/dist/esm/{icon.taro-1d0d4fb7.js → icon.taro-c9254a81.js} +13 -4
  95. package/dist/esm/{image.taro-e6dc5867.js → image.taro-1d867416.js} +1 -1
  96. package/dist/esm/{imagepreview.taro-3400ea03.js → imagepreview.taro-83481e13.js} +1 -1
  97. package/dist/esm/{index.taro-a36f96fb.js → index.taro-cd52b23f.js} +1 -1
  98. package/dist/esm/{infiniteloading.taro-6c2a2e95.js → infiniteloading.taro-8ead43b0.js} +3 -3
  99. package/dist/esm/{input.taro-fd566407.js → input.taro-991945d1.js} +1 -1
  100. package/dist/esm/{inputnumber.taro-dc39b853.js → inputnumber.taro-e909d932.js} +1 -1
  101. package/dist/esm/{menu.taro-4abed328.js → menu.taro-e5b84501.js} +1 -1
  102. package/dist/esm/{menuitem.taro-6e8b27c3.js → menuitem.taro-f2129be6.js} +2 -2
  103. package/dist/esm/{navbar.taro-c931c078.js → navbar.taro-70514adf.js} +1 -1
  104. package/dist/esm/{noticebar.taro-69ea7673.js → noticebar.taro-22486646.js} +2 -4
  105. package/dist/esm/{numberkeyboard.taro-194519e4.js → numberkeyboard.taro-d2ccbce5.js} +1 -1
  106. package/dist/esm/nutui-react.es.js +68 -67
  107. package/dist/esm/{overlay.taro-98367bc1.js → overlay.taro-1e74a71d.js} +5 -4
  108. package/dist/esm/{picker.taro-2a8ded7c.js → picker.taro-6128297f.js} +2 -2
  109. package/dist/esm/{popover.taro-46d813e8.js → popover.taro-fc7b9a73.js} +3 -3
  110. package/dist/esm/{popup.taro-cb777e09.js → popup.taro-89809b25.js} +6 -7
  111. package/dist/esm/{progress.taro-623bc807.js → progress.taro-18e015e4.js} +1 -1
  112. package/dist/esm/{pulltorefresh.taro-cab7b51c.js → pulltorefresh.taro-2b50fdf3.js} +1 -27
  113. package/dist/esm/{range.taro-5d6ff217.js → range.taro-b628f1ed.js} +2 -2
  114. package/dist/esm/{rate.taro-10197384.js → rate.taro-17b84a51.js} +1 -1
  115. package/dist/esm/{searchbar.taro-839dd622.js → searchbar.taro-141827e2.js} +5 -5
  116. package/dist/esm/{shortpassword.taro-182d46f7.js → shortpassword.taro-e1f53ee7.js} +2 -2
  117. package/dist/esm/{sidenavbar.taro-006cf38b.js → sidenavbar.taro-f44d12ac.js} +1 -1
  118. package/dist/esm/{signature.taro-33632585.js → signature.taro-d7a70ce0.js} +10 -10
  119. package/dist/esm/{skeleton.taro-853ce460.js → skeleton.taro-6821b2c6.js} +1 -1
  120. package/dist/esm/{step.taro-1c94e067.js → step.taro-891c020b.js} +1 -1
  121. package/dist/esm/sticky.taro-2d9b2804.js +133 -0
  122. package/dist/esm/{swipe.taro-83bc248f.js → swipe.taro-e6c2b808.js} +1 -1
  123. package/dist/esm/{tabbaritem.taro-8dfb8055.js → tabbaritem.taro-f4a91070.js} +1 -1
  124. package/dist/esm/{table.taro-cb4dd2c3.js → table.taro-d9b2794b.js} +1 -1
  125. package/dist/esm/{tabs.taro-e71875fa.js → tabs.taro-5030ce68.js} +1 -1
  126. package/dist/esm/{tag.taro-00fe554d.js → tag.taro-213ec444.js} +1 -1
  127. package/dist/esm/{timeselect.taro-3ecce65d.js → timeselect.taro-b04b1538.js} +1 -1
  128. package/dist/esm/{toast.taro-0804b6b4.js → toast.taro-0f972a92.js} +1 -1
  129. package/dist/esm/{trendarrow.taro-5a7153e4.js → trendarrow.taro-d79fc8e2.js} +1 -1
  130. package/dist/esm/types/src/packages/audio/audio.taro.d.ts +6 -6
  131. package/dist/esm/types/src/packages/image/image.d.ts +3 -0
  132. package/dist/esm/types/src/packages/overlay/overlay.taro.d.ts +3 -1
  133. package/dist/esm/types/src/packages/popover/popover.taro.d.ts +2 -1
  134. package/dist/esm/types/src/packages/popup/popup.taro.d.ts +3 -3
  135. package/dist/esm/types/src/packages/sticky/sticky.taro.d.ts +11 -2
  136. package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +1 -1
  137. package/dist/esm/{uploader.taro-f80d76d9.js → uploader.taro-1d745f4a.js} +17 -17
  138. package/dist/esm/{useClientRect-bf69d7b3.js → useClientRect-4506e52f.js} +5 -2
  139. package/dist/esm/{virtuallist.taro-e3345ced.js → virtuallist.taro-1688484f.js} +7 -8
  140. package/dist/esm/{watermark.taro-cd9db98a.js → watermark.taro-a948c735.js} +4 -4
  141. package/dist/locales/base.js +1 -1
  142. package/dist/locales/en-US.js +1 -1
  143. package/dist/locales/id-ID.js +1 -1
  144. package/dist/locales/zh-CN.js +1 -1
  145. package/dist/locales/zh-TW.js +1 -1
  146. package/dist/locales/zh-UG.js +1 -1
  147. package/dist/nutui.react.es.js +270 -125
  148. package/dist/nutui.react.umd.js +266 -121
  149. package/dist/packages/calendar/calendar.scss +19 -1
  150. package/dist/packages/image/image.scss +2 -0
  151. package/dist/packages/input/input.scss +3 -18
  152. package/dist/packages/notify/notify.scss +23 -19
  153. package/dist/packages/popup/popup.scss +130 -93
  154. package/dist/packages/searchbar/searchbar.scss +6 -20
  155. package/dist/packages/sticky/sticky.scss +3 -0
  156. package/dist/packages/tag/tag.scss +6 -1
  157. package/dist/style.css +1 -1
  158. package/dist/style.es.js +1 -1
  159. package/dist/styles/variables.scss +1 -3
  160. package/dist/types/index.d.ts +22 -15
  161. package/package.json +2 -2
  162. package/dist/esm/sticky.taro-d0553f48.js +0 -13
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.4.5 Wed Feb 01 2023 15:25:06 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react-taro v1.4.6-beta.1 Wed Feb 08 2023 14:56:45 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -100,7 +100,13 @@
100
100
  className: ""
101
101
  };
102
102
  function pxCheck$3(value) {
103
- return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
103
+ if (value === "") {
104
+ return value;
105
+ }
106
+ if (Number.isNaN(Number(value))) {
107
+ return String(value);
108
+ }
109
+ return `${value}px`;
104
110
  }
105
111
  function Icon$1(props) {
106
112
  const {
@@ -132,15 +138,18 @@
132
138
  return { src: name };
133
139
  return {};
134
140
  };
141
+ const styles = {};
142
+ const checkedSize = pxCheck$3(size);
143
+ if (checkedSize) {
144
+ styles.width = styles.height = styles.fontSize = checkedSize;
145
+ }
135
146
  return React__default["default"].createElement(
136
147
  type,
137
148
  {
138
149
  className: isImage ? `${b2("img")} ${className || ""} ` : `${fontClassName} ${b2(null)} ${classPrefix}-${name} ${className || ""}`,
139
150
  style: {
140
151
  color,
141
- fontSize: pxCheck$3(size),
142
- width: pxCheck$3(size),
143
- height: pxCheck$3(size),
152
+ ...styles,
144
153
  ...style
145
154
  },
146
155
  ...rest,
@@ -324,7 +333,7 @@
324
333
  onClick(event);
325
334
  const link = to2 || url;
326
335
  if (link) {
327
- replace ? Taro__default["default"].redirectTo({ url: link }) : Taro__default["default"].navigateTo({ url: link });
336
+ replace ? Taro.redirectTo({ url: link }) : Taro.navigateTo({ url: link });
328
337
  }
329
338
  };
330
339
  const baseStyle = {
@@ -985,6 +994,11 @@
985
994
  })();
986
995
  })(classnames);
987
996
  var classNames = classnames.exports;
997
+ var index_cjs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
998
+ __proto__: null
999
+ }, Symbol.toStringTag, { value: "Module" }));
1000
+ var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index_cjs$1);
1001
+ var index_cjs = require$$0;
988
1002
  const defaultOverlayProps = {
989
1003
  zIndex: 2e3,
990
1004
  duration: 0.3,
@@ -1004,6 +1018,7 @@
1004
1018
  visible,
1005
1019
  lockScroll,
1006
1020
  overlayStyle,
1021
+ onClick,
1007
1022
  ...rest
1008
1023
  } = {
1009
1024
  ...defaultOverlayProps,
@@ -1045,9 +1060,9 @@
1045
1060
  document.body.classList.remove("nut-overflow-hidden");
1046
1061
  }
1047
1062
  };
1048
- const handleClick = (e2) => {
1063
+ const handleClick = (event) => {
1049
1064
  if (closeOnClickOverlay) {
1050
- props.onClick && props.onClick(e2);
1065
+ onClick && onClick(event);
1051
1066
  renderRef.current = false;
1052
1067
  const id = window.setTimeout(() => {
1053
1068
  setShow(!visible);
@@ -1055,10 +1070,11 @@
1055
1070
  intervalRef.current = id;
1056
1071
  }
1057
1072
  };
1058
- return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
1073
+ return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(index_cjs.View, {
1059
1074
  className: classes,
1060
1075
  style: styles,
1061
1076
  ...rest,
1077
+ catchMove: lockScroll,
1062
1078
  onClick: handleClick
1063
1079
  }, children));
1064
1080
  };
@@ -1545,8 +1561,6 @@
1545
1561
  },
1546
1562
  onClose: () => {
1547
1563
  },
1548
- onClick: (e2) => {
1549
- },
1550
1564
  onOpened: (e2) => {
1551
1565
  },
1552
1566
  onClosed: (e2) => {
@@ -1610,15 +1624,15 @@
1610
1624
  const classes = classNames(
1611
1625
  {
1612
1626
  round,
1613
- [`popup-${position}`]: true,
1627
+ [`nut-popup-${position}`]: true,
1614
1628
  [`${popClass}`]: true,
1615
1629
  [`${className}`]: true
1616
1630
  },
1617
1631
  b2("")
1618
1632
  );
1619
1633
  const closeClasses = classNames({
1620
- "nutui-popup__close-icon": true,
1621
- [`nutui-popup__close-icon--${closeIconPosition}`]: true
1634
+ "nut-popup__close-icon": true,
1635
+ [`nut-popup__close-icon--${closeIconPosition}`]: true
1622
1636
  });
1623
1637
  const open = () => {
1624
1638
  if (!innerVisible) {
@@ -1710,7 +1724,7 @@
1710
1724
  !visible && close();
1711
1725
  }, [visible]);
1712
1726
  React.useEffect(() => {
1713
- setTransitionName(transition || `popup-slide-${position}`);
1727
+ setTransitionName(transition || `nut-popup-slide-${position}`);
1714
1728
  }, [position]);
1715
1729
  return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, renderToContainer(teleport, renderNode()));
1716
1730
  };
@@ -2058,34 +2072,173 @@
2058
2072
  };
2059
2073
  Row.defaultProps = defaultProps$1j;
2060
2074
  Row.displayName = "NutRow";
2061
- const defaultConfigRef = {
2062
- current: {
2063
- locale: zhCN
2075
+ function useWatch(dep, callback, config2 = { immediate: false }) {
2076
+ const { immediate } = config2;
2077
+ const prev = React.useRef();
2078
+ const inited = React.useRef(false);
2079
+ const stop2 = React.useRef(false);
2080
+ React.useEffect(() => {
2081
+ const execute = () => callback(prev.current);
2082
+ if (!stop2.current) {
2083
+ if (!inited.current) {
2084
+ inited.current = true;
2085
+ if (immediate) {
2086
+ execute();
2087
+ }
2088
+ } else {
2089
+ execute();
2090
+ }
2091
+ prev.current = dep;
2092
+ }
2093
+ }, [dep]);
2094
+ return () => {
2095
+ stop2.current = true;
2096
+ };
2097
+ }
2098
+ const getRectByTaro = async (element) => {
2099
+ if (element) {
2100
+ const res = await element.getBoundingClientRect();
2101
+ return res;
2064
2102
  }
2103
+ return Promise.resolve({});
2065
2104
  };
2066
- const getDefaultConfig = () => {
2067
- return defaultConfigRef.current;
2068
- };
2069
- const ConfigContext = React.createContext(null);
2070
- const useConfig = () => {
2071
- var _a;
2072
- return (_a = React.useContext(ConfigContext)) != null ? _a : getDefaultConfig();
2105
+ const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
2106
+ const defaultRoot = canUseDom ? window : void 0;
2107
+ const overflowStylePatterns = ["scroll", "auto", "overlay"];
2108
+ function isElement(node) {
2109
+ const ELEMENT_NODE_TYPE = 1;
2110
+ return node.nodeType === ELEMENT_NODE_TYPE;
2111
+ }
2112
+ function getScrollParent(el, root2 = defaultRoot) {
2113
+ let node = el;
2114
+ while (node && node !== root2 && isElement(node)) {
2115
+ if (node === document.body) {
2116
+ return root2;
2117
+ }
2118
+ const { overflowY } = window.getComputedStyle(node);
2119
+ if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
2120
+ return node;
2121
+ }
2122
+ node = node.parentNode;
2123
+ }
2124
+ return root2;
2125
+ }
2126
+ const defaultProps$1i = {
2127
+ position: "top",
2128
+ top: 0,
2129
+ bottom: 0,
2130
+ zIndex: 2e3
2073
2131
  };
2074
- const defaultProps$1i = {};
2075
2132
  const Sticky = (props) => {
2076
- useConfig();
2077
- ({ ...defaultProps$1i, ...props });
2133
+ const {
2134
+ position = "top",
2135
+ top = 0,
2136
+ bottom = 0,
2137
+ zIndex = 2e3,
2138
+ children,
2139
+ container,
2140
+ className,
2141
+ onChange,
2142
+ ...rest
2143
+ } = props;
2144
+ const stickyRef = React.useRef(null);
2145
+ const rootRef = React.useRef(null);
2146
+ const offset = position === "top" ? top : bottom;
2147
+ const [rootRect, setRootRect] = React.useState({});
2148
+ const [fixed, setFixed] = React.useState(false);
2149
+ const [transform, setTransform] = React.useState(0);
2150
+ useWatch(fixed, () => {
2151
+ onChange && onChange(fixed);
2152
+ });
2153
+ const rootStyle = React.useMemo(() => {
2154
+ if (!fixed) {
2155
+ return {
2156
+ height: "",
2157
+ width: ""
2158
+ };
2159
+ }
2160
+ const style = {};
2161
+ if (rootRect.height) {
2162
+ style.height = rootRect.height;
2163
+ }
2164
+ if (rootRect.width) {
2165
+ style.width = rootRect.width;
2166
+ }
2167
+ return style;
2168
+ }, [fixed, rootRect.height, rootRect.width]);
2169
+ const stickyStyle = React.useMemo(() => {
2170
+ if (!fixed) {
2171
+ return {
2172
+ height: "",
2173
+ width: "",
2174
+ [position]: ""
2175
+ };
2176
+ }
2177
+ let style = {};
2178
+ if (rootRect.height)
2179
+ style.height = rootRect.height;
2180
+ if (rootRect.width)
2181
+ style.width = rootRect.width;
2182
+ style.transform = `translate3d(0, ${transform}px, 0)`;
2183
+ style[position] = offset;
2184
+ style.zIndex = zIndex;
2185
+ return style;
2186
+ }, [fixed, rootRect.height, rootRect.width, transform, position]);
2187
+ const handleScroll = async (scrollTop) => {
2188
+ const curRootRect = await getRectByTaro(rootRef.current);
2189
+ const stickyRect = await getRectByTaro(stickyRef.current);
2190
+ if (curRootRect && stickyRect) {
2191
+ setRootRect(curRootRect);
2192
+ if (position === "top") {
2193
+ if (container) {
2194
+ const containerRect = await getRectByTaro(container.current);
2195
+ const difference = containerRect.bottom - top - curRootRect.height;
2196
+ const curTransform = difference < 0 ? difference : 0;
2197
+ setTransform(curTransform);
2198
+ const curFixed = top > curRootRect.top && containerRect.bottom > 0;
2199
+ setFixed(curFixed);
2200
+ } else {
2201
+ setFixed(top > curRootRect.top);
2202
+ }
2203
+ } else {
2204
+ const windowHeight = Taro.getSystemInfoSync().windowHeight;
2205
+ setFixed(windowHeight - offset < curRootRect.bottom);
2206
+ }
2207
+ } else {
2208
+ console.log("getRectByTaro\u83B7\u53D6\u5931\u8D25", { stickyRect, curRootRect });
2209
+ }
2210
+ };
2211
+ const getElement = React.useCallback(() => {
2212
+ return getScrollParent(rootRef.current);
2213
+ }, []);
2214
+ React.useEffect(() => {
2215
+ if (Taro.getEnv() === "WEB" && getElement() !== window) {
2216
+ window.addEventListener("touchmove", handleScroll, true);
2217
+ window.addEventListener("scroll", handleScroll, true);
2218
+ return () => {
2219
+ window.removeEventListener("touchmove", handleScroll);
2220
+ window.removeEventListener("scroll", handleScroll);
2221
+ };
2222
+ }
2223
+ }, []);
2224
+ Taro.usePageScroll((res) => {
2225
+ if (Taro.getEnv() === "WEAPP") {
2226
+ handleScroll(res.scrollTop);
2227
+ }
2228
+ });
2078
2229
  return /* @__PURE__ */ React__default["default"].createElement("div", {
2079
- className: "nut-sticky"
2080
- }, "Sticky");
2230
+ ref: rootRef,
2231
+ style: rootStyle,
2232
+ className: `nut-sticky ${className}`,
2233
+ ...rest
2234
+ }, /* @__PURE__ */ React__default["default"].createElement("div", {
2235
+ className: `nut-sticky-box ${fixed ? "nut-sticky-fixed" : ""}`,
2236
+ ref: stickyRef,
2237
+ style: stickyStyle
2238
+ }, children));
2081
2239
  };
2082
2240
  Sticky.defaultProps = defaultProps$1i;
2083
2241
  Sticky.displayName = "NutSticky";
2084
- var index_cjs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2085
- __proto__: null
2086
- }, Symbol.toStringTag, { value: "Module" }));
2087
- var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index_cjs$1);
2088
- var index_cjs = require$$0;
2089
2242
  const elevatorContext = React.createContext({});
2090
2243
  const defaultProps$1h = {
2091
2244
  height: "200px",
@@ -2153,7 +2306,7 @@
2153
2306
  let height2 = 0;
2154
2307
  state.current.listHeight.push(height2);
2155
2308
  for (let i = 0; i < state.current.listGroup.length; i++) {
2156
- const query = Taro__default["default"].createSelectorQuery();
2309
+ const query = Taro.createSelectorQuery();
2157
2310
  query.selectAll(`.${className} .elevator__item__${i}`).boundingClientRect();
2158
2311
  query.exec((res) => {
2159
2312
  if (res[0][0])
@@ -2211,7 +2364,7 @@
2211
2364
  };
2212
2365
  const setListGroup = () => {
2213
2366
  if (listview.current) {
2214
- Taro__default["default"].createSelectorQuery().selectAll(`.${className} .nut-elevator__list__item`).node((el) => {
2367
+ Taro.createSelectorQuery().selectAll(`.${className} .nut-elevator__list__item`).node((el) => {
2215
2368
  state.current.listGroup = [...Object.keys(el)];
2216
2369
  calculateHeight();
2217
2370
  }).exec();
@@ -2239,7 +2392,7 @@
2239
2392
  };
2240
2393
  React.useEffect(() => {
2241
2394
  if (listview.current) {
2242
- Taro__default["default"].nextTick(() => {
2395
+ Taro.nextTick(() => {
2243
2396
  setListGroup();
2244
2397
  });
2245
2398
  }
@@ -3534,10 +3687,6 @@
3534
3687
  };
3535
3688
  }
3536
3689
  var requestAniFrame$1 = requestAniFrame();
3537
- const getRectByTaro = async (element) => {
3538
- const res = await element.getBoundingClientRect();
3539
- return res;
3540
- };
3541
3690
  const defaultProps$14 = {
3542
3691
  type: "one",
3543
3692
  isAutoBackFill: false,
@@ -6762,7 +6911,13 @@
6762
6911
  className: ""
6763
6912
  };
6764
6913
  function pxCheck(value) {
6765
- return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
6914
+ if (value === "") {
6915
+ return value;
6916
+ }
6917
+ if (Number.isNaN(Number(value))) {
6918
+ return String(value);
6919
+ }
6920
+ return `${value}px`;
6766
6921
  }
6767
6922
  function Icon(props) {
6768
6923
  const {
@@ -6794,15 +6949,18 @@
6794
6949
  return { src: name };
6795
6950
  return {};
6796
6951
  };
6952
+ const styles = {};
6953
+ const checkedSize = pxCheck(size);
6954
+ if (checkedSize) {
6955
+ styles.width = styles.height = styles.fontSize = checkedSize;
6956
+ }
6797
6957
  return React__default["default"].createElement(
6798
6958
  type,
6799
6959
  {
6800
6960
  className: isImage ? `${b2("img")} ${className || ""} ` : `${fontClassName} ${b2(null)} ${classPrefix}-${name} ${className || ""}`,
6801
6961
  style: {
6802
6962
  color,
6803
- fontSize: pxCheck(size),
6804
- width: pxCheck(size),
6805
- height: pxCheck(size),
6963
+ ...styles,
6806
6964
  ...style
6807
6965
  },
6808
6966
  ...rest,
@@ -7526,7 +7684,7 @@
7526
7684
  return /* @__PURE__ */ React__default["default"].createElement("input", {
7527
7685
  className: `${searchbarBem("input")} ${searchbarBem(alignClass)} ${shape === "round" ? searchbarBem("round") : ""} ${clearable ? searchbarBem("input-clear") : ""}`,
7528
7686
  ref: searchRef,
7529
- style: { ...props.style, background: props.inputBackground },
7687
+ style: { ...props.style },
7530
7688
  value: value || "",
7531
7689
  placeholder: placeholder || locale.placeholder,
7532
7690
  disabled,
@@ -7636,13 +7794,14 @@
7636
7794
  return null;
7637
7795
  };
7638
7796
  const envClass = () => {
7639
- return Taro__default["default"].getEnv() === "WEB" ? "nut-searchbar-taro" : "";
7797
+ return Taro.getEnv() === "WEB" ? "nut-searchbar-taro" : "";
7640
7798
  };
7641
7799
  return /* @__PURE__ */ React__default["default"].createElement("div", {
7642
7800
  className: `${searchbarBem()} ${envClass()} ${disabled ? searchbarBem("disabled") : ""} ${className || ""}`,
7643
7801
  style: { ...props.style, background: props.background }
7644
7802
  }, renderLeftoutIcon(), renderLabel(), /* @__PURE__ */ React__default["default"].createElement("div", {
7645
- className: `${searchbarBem("content")}`
7803
+ className: `${searchbarBem("content")}`,
7804
+ style: { background: props.inputBackground }
7646
7805
  }, renderLeftinIcon(), /* @__PURE__ */ React__default["default"].createElement("div", {
7647
7806
  className: "nut-searchbar__input-box"
7648
7807
  }, renderField()), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
@@ -8223,7 +8382,7 @@
8223
8382
  React.useImperativeHandle(ref, () => ({
8224
8383
  submit: () => {
8225
8384
  Promise.all(uploadQueue).then((res) => {
8226
- res.forEach((i) => i.uploadTaro(Taro__default["default"].uploadFile, Taro__default["default"].getEnv()));
8385
+ res.forEach((i) => i.uploadTaro(Taro.uploadFile, Taro.getEnv()));
8227
8386
  });
8228
8387
  }
8229
8388
  }));
@@ -8235,11 +8394,11 @@
8235
8394
  setUploadQueue([]);
8236
8395
  }
8237
8396
  };
8238
- const chooseImage = () => {
8397
+ const _chooseImage = () => {
8239
8398
  if (disabled) {
8240
8399
  return;
8241
8400
  }
8242
- Taro__default["default"].chooseImage({
8401
+ Taro.chooseImage({
8243
8402
  count: maximum * 1 - fileList.length,
8244
8403
  sizeType,
8245
8404
  sourceType,
@@ -8317,7 +8476,7 @@
8317
8476
  };
8318
8477
  const task = new Upload(uploadOption);
8319
8478
  if (props.autoUpload) {
8320
- task.uploadTaro(Taro__default["default"].uploadFile, Taro__default["default"].getEnv());
8479
+ task.uploadTaro(Taro.uploadFile, Taro.getEnv());
8321
8480
  } else {
8322
8481
  uploadQueue.push(
8323
8482
  new Promise((resolve, reject) => {
@@ -8342,7 +8501,7 @@
8342
8501
  fileItem.status = "ready";
8343
8502
  fileItem.message = locale.uploader.readyUpload;
8344
8503
  fileItem.type = fileType;
8345
- if (Taro__default["default"].getEnv() == "WEB") {
8504
+ if (Taro.getEnv() === "WEB") {
8346
8505
  const formData = new FormData();
8347
8506
  for (const [key, value] of Object.entries(data)) {
8348
8507
  formData.append(key, value);
@@ -8376,7 +8535,7 @@
8376
8535
  if (oversizes.length) {
8377
8536
  onOversize && onOversize(files);
8378
8537
  }
8379
- let currentFileLength = filterFile.length + fileList.length;
8538
+ const currentFileLength = filterFile.length + fileList.length;
8380
8539
  if (currentFileLength > maximum2) {
8381
8540
  filterFile.splice(filterFile.length - (currentFileLength - maximum2));
8382
8541
  }
@@ -8415,12 +8574,12 @@
8415
8574
  className: "nut-uploader__slot"
8416
8575
  }, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children, maximum > fileList.length && /* @__PURE__ */ React__default["default"].createElement(Button, {
8417
8576
  className: "nut-uploader__input",
8418
- onClick: chooseImage
8577
+ onClick: _chooseImage
8419
8578
  }))), fileList.length !== 0 && fileList.map((item, index) => {
8420
8579
  return /* @__PURE__ */ React__default["default"].createElement("div", {
8421
8580
  className: `nut-uploader__preview ${listType}`,
8422
8581
  key: item.uid
8423
- }, listType == "picture" && !children && /* @__PURE__ */ React__default["default"].createElement("div", {
8582
+ }, listType === "picture" && !children && /* @__PURE__ */ React__default["default"].createElement("div", {
8424
8583
  className: "nut-uploader__preview-img"
8425
8584
  }, item.status === "ready" ? /* @__PURE__ */ React__default["default"].createElement("div", {
8426
8585
  className: "nut-uploader__preview__progress"
@@ -8432,7 +8591,7 @@
8432
8591
  classPrefix: props.iconClassPrefix,
8433
8592
  fontClassName: props.iconFontClassName,
8434
8593
  color: "#fff",
8435
- name: `${item.status == "error" ? "failure" : "loading"}`
8594
+ name: `${item.status === "error" ? "failure" : "loading"}`
8436
8595
  }), /* @__PURE__ */ React__default["default"].createElement("div", {
8437
8596
  className: "nut-uploader__preview__progress__msg"
8438
8597
  }, item.message)), isDeletable && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
@@ -8445,10 +8604,12 @@
8445
8604
  }), item.type.includes("image") ? /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, item.url && /* @__PURE__ */ React__default["default"].createElement("img", {
8446
8605
  className: "nut-uploader__preview-img__c",
8447
8606
  src: item.url,
8607
+ alt: "",
8448
8608
  onClick: () => handleItemClick(item)
8449
8609
  })) : /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, defaultImg ? /* @__PURE__ */ React__default["default"].createElement("img", {
8450
8610
  className: "nut-uploader__preview-img__c",
8451
8611
  src: defaultImg,
8612
+ alt: "",
8452
8613
  onClick: () => handleItemClick(item)
8453
8614
  }) : /* @__PURE__ */ React__default["default"].createElement("div", {
8454
8615
  className: "nut-uploader__preview-img__file"
@@ -8494,7 +8655,7 @@
8494
8655
  name: uploadIcon
8495
8656
  }), /* @__PURE__ */ React__default["default"].createElement(Button, {
8496
8657
  className: "nut-uploader__input",
8497
- onClick: chooseImage
8658
+ onClick: _chooseImage
8498
8659
  })));
8499
8660
  };
8500
8661
  const Uploader = React__default["default"].forwardRef(InternalUploader);
@@ -8616,7 +8777,7 @@
8616
8777
  });
8617
8778
  const goTop = (e2) => {
8618
8779
  onClick && onClick(e2);
8619
- Taro__default["default"].pageScrollTo({
8780
+ Taro.pageScrollTo({
8620
8781
  scrollTop: 0,
8621
8782
  duration: isAnimation && duration > 0 ? duration : 0
8622
8783
  });
@@ -8851,8 +9012,8 @@
8851
9012
  const el = myDrag.current;
8852
9013
  if (el) {
8853
9014
  const { top, left, bottom, right } = boundary;
8854
- const { screenWidth, windowHeight } = Taro__default["default"].getSystemInfoSync();
8855
- Taro__default["default"].createSelectorQuery().select(`.${className}`).boundingClientRect((rec) => {
9015
+ const { screenWidth, windowHeight } = Taro.getSystemInfoSync();
9016
+ Taro.createSelectorQuery().select(`.${className}`).boundingClientRect((rec) => {
8856
9017
  setBoundaryState({
8857
9018
  top: -rec.top + top,
8858
9019
  left: -rec.left + left,
@@ -8990,7 +9151,7 @@
8990
9151
  };
8991
9152
  };
8992
9153
  const getParentElement = (el) => {
8993
- return Taro__default["default"].createSelectorQuery().select(
9154
+ return Taro.createSelectorQuery().select(
8994
9155
  containerId ? `#${containerId} #${el}` : `#${el}`
8995
9156
  );
8996
9157
  };
@@ -13669,27 +13830,6 @@
13669
13830
  }
13670
13831
  });
13671
13832
  const animated = host.animated;
13672
- const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
13673
- const defaultRoot = canUseDom ? window : void 0;
13674
- const overflowStylePatterns = ["scroll", "auto", "overlay"];
13675
- function isElement(node) {
13676
- const ELEMENT_NODE_TYPE = 1;
13677
- return node.nodeType === ELEMENT_NODE_TYPE;
13678
- }
13679
- function getScrollParent(el, root2 = defaultRoot) {
13680
- let node = el;
13681
- while (node && node !== root2 && isElement(node)) {
13682
- if (node === document.body) {
13683
- return root2;
13684
- }
13685
- const { overflowY } = window.getComputedStyle(node);
13686
- if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
13687
- return node;
13688
- }
13689
- node = node.parentNode;
13690
- }
13691
- return root2;
13692
- }
13693
13833
  function bound(position, min, max) {
13694
13834
  let ret = position;
13695
13835
  if (min !== void 0) {
@@ -14192,7 +14332,7 @@
14192
14332
  const isLoaded = React.useRef(false);
14193
14333
  const setNumberTransform = () => {
14194
14334
  if (countupRef.current && numerArr.length) {
14195
- Taro__default["default"].createSelectorQuery().selectAll(".nut-countup__listitem").node((numberItems) => {
14335
+ Taro.createSelectorQuery().selectAll(".nut-countup__listitem").node((numberItems) => {
14196
14336
  const transformArrCache = [];
14197
14337
  Object.keys(numberItems).forEach((key) => {
14198
14338
  const elem = numberItems[Number(key)];
@@ -14324,7 +14464,7 @@
14324
14464
  currentDuration: "00:00:00",
14325
14465
  percent: 0
14326
14466
  });
14327
- const audioRef = React.useRef(Taro__default["default"].createInnerAudioContext());
14467
+ const audioRef = React.useRef(Taro.createInnerAudioContext());
14328
14468
  const audioCtx = audioRef.current;
14329
14469
  audioCtx.src = url;
14330
14470
  audioCtx.autoplay = autoplay || false;
@@ -14489,7 +14629,7 @@
14489
14629
  url: ""
14490
14630
  };
14491
14631
  const Avatar = (props) => {
14492
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
14632
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
14493
14633
  const {
14494
14634
  children,
14495
14635
  prefixCls,
@@ -14569,18 +14709,13 @@
14569
14709
  activeAvatar && activeAvatar(e2);
14570
14710
  onActiveAvatar && onActiveAvatar(e2);
14571
14711
  };
14572
- console.log(
14573
- "!parent?.propAvatarGroup?.maxCount",
14574
- !((_h = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _h.maxCount),
14575
- showMax
14576
- );
14577
- return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, (showMax || !((_i = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _i.maxCount) || avatarIndex <= ((_j = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _j.maxCount)) && /* @__PURE__ */ React__default["default"].createElement("div", {
14712
+ return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, (showMax || !((_h = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _h.maxCount) || avatarIndex <= ((_i = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _i.maxCount)) && /* @__PURE__ */ React__default["default"].createElement("div", {
14578
14713
  className: cls,
14579
14714
  ...rest,
14580
14715
  style: !showMax ? styles : maxStyles,
14581
14716
  onClick: clickAvatar,
14582
14717
  ref: avatarRef
14583
- }, (!((_k = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _k.maxCount) || avatarIndex <= ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxCount)) && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, url && /* @__PURE__ */ React__default["default"].createElement(index_cjs.Image, {
14718
+ }, (!((_j = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _j.maxCount) || avatarIndex <= ((_k = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _k.maxCount)) && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, url && /* @__PURE__ */ React__default["default"].createElement(index_cjs.Image, {
14584
14719
  className: "avatar-img",
14585
14720
  src: url,
14586
14721
  onError: errorEvent
@@ -14594,10 +14729,23 @@
14594
14729
  className: "text"
14595
14730
  }, children)), showMax && /* @__PURE__ */ React__default["default"].createElement("div", {
14596
14731
  className: "text"
14597
- }, ((_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent) ? (_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxContent : `+ ${avatarIndex - ((_o = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _o.maxCount)}`)));
14732
+ }, ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxCount)}`)));
14598
14733
  };
14599
14734
  Avatar.defaultProps = defaultProps$w;
14600
14735
  Avatar.displayName = "NutAvatar";
14736
+ const defaultConfigRef = {
14737
+ current: {
14738
+ locale: zhCN
14739
+ }
14740
+ };
14741
+ const getDefaultConfig = () => {
14742
+ return defaultConfigRef.current;
14743
+ };
14744
+ const ConfigContext = React.createContext(null);
14745
+ const useConfig = () => {
14746
+ var _a;
14747
+ return (_a = React.useContext(ConfigContext)) != null ? _a : getDefaultConfig();
14748
+ };
14601
14749
  const defaultProps$v = {
14602
14750
  maxContent: "",
14603
14751
  maxCount: "",
@@ -15317,7 +15465,7 @@
15317
15465
  };
15318
15466
  const getReference = async () => {
15319
15467
  const element = root2.current;
15320
- const query = Taro__default["default"].createSelectorQuery();
15468
+ const query = Taro.createSelectorQuery();
15321
15469
  query.select(`#${element.id}`) && query.select(`#${element.id}`).fields(
15322
15470
  {
15323
15471
  computedStyle: [
@@ -16331,8 +16479,6 @@
16331
16479
  }
16332
16480
  return () => {
16333
16481
  clearInterval(timer);
16334
- startRoll();
16335
- startRollEasy();
16336
16482
  };
16337
16483
  }, []);
16338
16484
  React.useEffect(() => {
@@ -17658,8 +17804,8 @@
17658
17804
  itemEqualSize: true,
17659
17805
  overscan: 2
17660
17806
  };
17661
- const clientHeight = Taro__default["default"].getSystemInfoSync().windowHeight - 5 || 667;
17662
- Taro__default["default"].getSystemInfoSync().windowWidth || 375;
17807
+ const clientHeight = Taro.getSystemInfoSync().windowHeight - 5 || 667;
17808
+ Taro.getSystemInfoSync().windowWidth || 375;
17663
17809
  const VirtualList = (props) => {
17664
17810
  const {
17665
17811
  sourceData = [],
@@ -17719,8 +17865,7 @@
17719
17865
  }, [itemSize, sourceData]);
17720
17866
  const getContainerHeight = () => {
17721
17867
  const initH = itemSize * sourceData.length;
17722
- let containerH = initH < clientHeight ? initH + overscan * itemSize - 5 : Math.min(containerSize, clientHeight);
17723
- return containerH;
17868
+ return initH < clientHeight ? initH + overscan * itemSize - 5 : Math.min(containerSize, clientHeight);
17724
17869
  };
17725
17870
  const visibleCount = () => {
17726
17871
  return Math.ceil(getContainerHeight() / itemSize) + overscan;
@@ -17856,7 +18001,7 @@
17856
18001
  }, []);
17857
18002
  const init = () => {
17858
18003
  let ratio = 1;
17859
- Taro__default["default"].getSystemInfo().then((res) => {
18004
+ Taro.getSystemInfo().then((res) => {
17860
18005
  ratio = res.pixelRatio;
17861
18006
  const canvasWidth = `${(gapX + width) * ratio}px`;
17862
18007
  const canvasHeight = `${(gapY + height) * ratio}px`;
@@ -17870,7 +18015,7 @@
17870
18015
  canvas.setAttribute("width", canvasWidth);
17871
18016
  canvas.setAttribute("height", canvasHeight);
17872
18017
  } else {
17873
- canvas = Taro__default["default"].createOffscreenCanvas({
18018
+ canvas = Taro.createOffscreenCanvas({
17874
18019
  type: "2d",
17875
18020
  width: Number(canvasWidth),
17876
18021
  height: Number(canvasHeight)
@@ -17936,7 +18081,7 @@
17936
18081
  defaultIcon: "location2",
17937
18082
  selectedIcon: "Check",
17938
18083
  isShowCustomAddress: true,
17939
- customAndExistTitle: "\u9009\u62E9\u5176\u4ED6\u5730\u5740"
18084
+ customAndExistTitle: ""
17940
18085
  };
17941
18086
  const ExistRender = (props) => {
17942
18087
  const { locale } = useConfig();
@@ -18011,7 +18156,7 @@
18011
18156
  onClick: switchModule
18012
18157
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
18013
18158
  className: b2("choose-other-btn")
18014
- }, locale.address.chooseAnotherAddress || customAndExistTitle)));
18159
+ }, customAndExistTitle || locale.address.chooseAnotherAddress)));
18015
18160
  };
18016
18161
  const defaultProps$7 = {
18017
18162
  modelValue: [],
@@ -18109,7 +18254,7 @@
18109
18254
  const lineAnimation = (index) => {
18110
18255
  setTimeout(() => {
18111
18256
  const name = tabName[index];
18112
- Taro__default["default"].createSelectorQuery().selectAll(`.${name}`).boundingClientRect((rects) => {
18257
+ Taro.createSelectorQuery().selectAll(`.${name}`).boundingClientRect((rects) => {
18113
18258
  rects && rects.length > 0 && rects.forEach((rect) => {
18114
18259
  if (rect.width > 0)
18115
18260
  setLineDistance(rect.left || 20);
@@ -18288,15 +18433,15 @@
18288
18433
  modelValue: false,
18289
18434
  modelSelect: [],
18290
18435
  type: "custom",
18291
- customAddressTitle: "\u8BF7\u9009\u62E9\u6240\u5728\u5730\u533A",
18436
+ customAddressTitle: "",
18292
18437
  province: [],
18293
18438
  city: [],
18294
18439
  country: [],
18295
18440
  town: [],
18296
18441
  isShowCustomAddress: true,
18297
18442
  existAddress: [],
18298
- existAddressTitle: "\u914D\u9001\u81F3",
18299
- customAndExistTitle: "\u9009\u62E9\u5176\u4ED6\u5730\u5740",
18443
+ existAddressTitle: "",
18444
+ customAndExistTitle: "",
18300
18445
  height: "200px",
18301
18446
  defaultIcon: "location2",
18302
18447
  selectedIcon: "Check",
@@ -18437,7 +18582,7 @@
18437
18582
  color: "#cccccc"
18438
18583
  })), /* @__PURE__ */ React__default["default"].createElement("div", {
18439
18584
  className: b2("header__title")
18440
- }, privateType === "custom" ? locale.address.selectRegion || customAddressTitle : locale.address.deliveryTo || existAddressTitle), /* @__PURE__ */ React__default["default"].createElement("div", {
18585
+ }, privateType === "custom" ? customAddressTitle || locale.address.selectRegion : existAddressTitle || locale.address.deliveryTo), /* @__PURE__ */ React__default["default"].createElement("div", {
18441
18586
  onClick: () => handClose()
18442
18587
  }, closeBtnIcon && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
18443
18588
  classPrefix: iconClassPrefix,
@@ -18487,7 +18632,7 @@
18487
18632
  selectedIcon,
18488
18633
  defaultIcon,
18489
18634
  isShowCustomAddress,
18490
- customAndExistTitle: locale.address.chooseAnotherAddress || customAndExistTitle,
18635
+ customAndExistTitle: customAndExistTitle || locale.address.chooseAnotherAddress,
18491
18636
  onSelected: selectedExist,
18492
18637
  onSwitchModule
18493
18638
  }))));
@@ -18547,7 +18692,7 @@
18547
18692
  el.innerHTML = barrageList[_index];
18548
18693
  el.classList.add("barrage-item");
18549
18694
  barrageContainer.current.appendChild(el);
18550
- Taro__default["default"].createSelectorQuery().select(".barrage-item").boundingClientRect((res) => {
18695
+ Taro.createSelectorQuery().select(".barrage-item").boundingClientRect((res) => {
18551
18696
  console.log("res", res);
18552
18697
  const height = res == null ? void 0 : res.height;
18553
18698
  el.classList.add("move");
@@ -18672,12 +18817,12 @@
18672
18817
  const evt = event.changedTouches[0];
18673
18818
  let mouseX = evt.x || evt.clientX;
18674
18819
  let mouseY = evt.y || evt.clientY;
18675
- if (Taro__default["default"].getEnv() === "WEB" && canvasRef.current) {
18820
+ if (Taro.getEnv() === "WEB" && canvasRef.current) {
18676
18821
  const coverPos = canvasRef.current.getBoundingClientRect();
18677
18822
  mouseX = evt.clientX - coverPos.left;
18678
18823
  mouseY = evt.clientY - coverPos.top;
18679
18824
  }
18680
- Taro__default["default"].nextTick(() => {
18825
+ Taro.nextTick(() => {
18681
18826
  var _a, _b;
18682
18827
  (_a = ctx2.current) == null ? void 0 : _a.lineTo(mouseX, mouseY);
18683
18828
  (_b = ctx2.current) == null ? void 0 : _b.stroke();
@@ -18698,11 +18843,11 @@
18698
18843
  onSave();
18699
18844
  };
18700
18845
  const onSave = () => {
18701
- Taro__default["default"].createSelectorQuery().select(`#${canvasId}`).fields({
18846
+ Taro.createSelectorQuery().select(`#${canvasId}`).fields({
18702
18847
  node: true,
18703
18848
  size: true
18704
18849
  }).exec((res) => {
18705
- Taro__default["default"].canvasToTempFilePath({
18850
+ Taro.canvasToTempFilePath({
18706
18851
  canvas: res[0].node,
18707
18852
  fileType: props.type,
18708
18853
  canvasId: `${canvasId}`,
@@ -18733,10 +18878,10 @@
18733
18878
  }
18734
18879
  };
18735
18880
  const initCanvas = () => {
18736
- Taro__default["default"].nextTick(() => {
18881
+ Taro.nextTick(() => {
18737
18882
  setTimeout(() => {
18738
- if (Taro__default["default"].getEnv() === "WEAPP" || Taro__default["default"].getEnv() === "JD") {
18739
- Taro__default["default"].createSelectorQuery().select(`#${canvasId}`).fields(
18883
+ if (Taro.getEnv() === "WEAPP" || Taro.getEnv() === "JD") {
18884
+ Taro.createSelectorQuery().select(`#${canvasId}`).fields(
18740
18885
  {
18741
18886
  node: true,
18742
18887
  size: true
@@ -18774,7 +18919,7 @@
18774
18919
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
18775
18920
  className: `${b2("inner")} spcanvas_WEAPP`,
18776
18921
  ref: wrapRef
18777
- }, Taro__default["default"].getEnv() === "WEAPP" || Taro__default["default"].getEnv() === "JD" ? /* @__PURE__ */ React__default["default"].createElement("canvas", {
18922
+ }, Taro.getEnv() === "WEAPP" || Taro.getEnv() === "JD" ? /* @__PURE__ */ React__default["default"].createElement("canvas", {
18778
18923
  id: canvasId,
18779
18924
  ref: canvasRef,
18780
18925
  canvasId,