antd-mobile 5.2.0 → 5.3.0

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 (281) hide show
  1. package/2x/cjs/components/calendar/calendar.d.ts +1 -28
  2. package/2x/cjs/components/capsule-tabs/capsule-tabs.d.ts +1 -0
  3. package/2x/cjs/components/capsule-tabs/capsule-tabs.js +14 -17
  4. package/2x/cjs/components/cascade-picker/prompt.d.ts +2 -1
  5. package/2x/cjs/components/collapse/collapse.js +5 -3
  6. package/2x/cjs/components/date-picker/date-picker.js +7 -1
  7. package/2x/cjs/components/dialog/dialog.css +27 -18
  8. package/2x/cjs/components/dialog/dialog.js +39 -42
  9. package/2x/cjs/components/dropdown/dropdown.css +2 -1
  10. package/2x/cjs/components/dropdown/item.js +2 -2
  11. package/2x/cjs/components/ellipsis/ellipsis.d.ts +2 -0
  12. package/2x/cjs/components/ellipsis/ellipsis.js +8 -5
  13. package/2x/cjs/components/form/context.d.ts +2 -1
  14. package/2x/cjs/components/form/context.js +6 -5
  15. package/2x/cjs/components/form/form-item.css +27 -1
  16. package/2x/cjs/components/form/form-item.d.ts +1 -0
  17. package/2x/cjs/components/form/form-item.js +44 -13
  18. package/2x/cjs/components/form/form.d.ts +2 -2
  19. package/2x/cjs/components/form/form.js +18 -9
  20. package/2x/cjs/components/form/index.css +27 -1
  21. package/2x/cjs/components/form/index.d.ts +2 -2
  22. package/2x/cjs/components/image-viewer/image-viewer.d.ts +1 -1
  23. package/2x/cjs/components/image-viewer/index.d.ts +1 -1
  24. package/2x/cjs/components/input/input.d.ts +2 -2
  25. package/2x/cjs/components/input/input.js +2 -2
  26. package/2x/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
  27. package/2x/cjs/components/jumbo-tabs/jumbo-tabs.js +14 -17
  28. package/2x/cjs/components/mask/mask.js +2 -2
  29. package/2x/cjs/components/modal/modal.css +27 -21
  30. package/2x/cjs/components/modal/modal.js +39 -36
  31. package/2x/cjs/components/passcode-input/passcode-input.d.ts +1 -1
  32. package/2x/cjs/components/picker/prompt.d.ts +2 -2
  33. package/2x/cjs/components/popover/arrow.js +1 -2
  34. package/2x/cjs/components/popover/index.d.ts +3 -3
  35. package/2x/cjs/components/popover/popover-menu.d.ts +1 -1
  36. package/2x/cjs/components/popover/popover.d.ts +1 -1
  37. package/2x/cjs/components/popup/popup.js +2 -2
  38. package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
  39. package/2x/cjs/components/search-bar/search-bar.js +1 -0
  40. package/2x/cjs/components/selector/selector.d.ts +3 -1
  41. package/2x/cjs/components/stepper/stepper.d.ts +11 -2
  42. package/2x/cjs/components/swiper/index.d.ts +3 -3
  43. package/2x/cjs/components/swiper/swiper.d.ts +3 -3
  44. package/2x/cjs/components/switch/spin-icon.d.ts +3 -0
  45. package/2x/cjs/components/switch/spin-icon.js +37 -0
  46. package/2x/cjs/components/switch/switch.css +1 -1
  47. package/2x/cjs/components/switch/switch.js +4 -6
  48. package/2x/cjs/components/tabs/tabs.d.ts +1 -0
  49. package/2x/cjs/components/tabs/tabs.js +17 -19
  50. package/2x/cjs/components/virtual-input/virtual-input.d.ts +2 -2
  51. package/2x/cjs/locales/base.d.ts +51 -0
  52. package/2x/cjs/locales/base.js +52 -0
  53. package/2x/cjs/locales/en-US.d.ts +51 -0
  54. package/2x/cjs/locales/zh-CN.d.ts +51 -0
  55. package/2x/cjs/locales/zh-CN.js +52 -0
  56. package/2x/cjs/utils/measure-css-length.js +3 -1
  57. package/2x/cjs/utils/native-props.d.ts +1 -1
  58. package/2x/cjs/utils/render-to-container.d.ts +1 -1
  59. package/2x/cjs/utils/should-render.d.ts +10 -0
  60. package/{cjs/utils/use-should-render.js → 2x/cjs/utils/should-render.js} +8 -0
  61. package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -2
  62. package/2x/cjs/utils/use-isomorphic-update-layout-effect.js +1 -3
  63. package/2x/cjs/utils/use-props-value.d.ts +1 -1
  64. package/2x/cjs/utils/use-tab-list-scroll.js +3 -1
  65. package/2x/cjs/utils/use-touch.d.ts +0 -1
  66. package/2x/cjs/utils/validate.js +1 -1
  67. package/2x/cjs/utils/with-stop-propagation.d.ts +1 -1
  68. package/2x/es/components/calendar/calendar.d.ts +1 -28
  69. package/2x/es/components/capsule-tabs/capsule-tabs.d.ts +1 -0
  70. package/2x/es/components/capsule-tabs/capsule-tabs.js +13 -17
  71. package/2x/es/components/cascade-picker/prompt.d.ts +2 -1
  72. package/2x/es/components/collapse/collapse.js +4 -3
  73. package/2x/es/components/date-picker/date-picker.js +6 -1
  74. package/2x/es/components/dialog/dialog.css +27 -18
  75. package/2x/es/components/dialog/dialog.js +37 -41
  76. package/2x/es/components/dropdown/dropdown.css +2 -1
  77. package/2x/es/components/dropdown/item.js +1 -1
  78. package/2x/es/components/ellipsis/ellipsis.d.ts +2 -0
  79. package/2x/es/components/ellipsis/ellipsis.js +7 -5
  80. package/2x/es/components/form/context.d.ts +2 -1
  81. package/2x/es/components/form/context.js +4 -3
  82. package/2x/es/components/form/form-item.css +27 -1
  83. package/2x/es/components/form/form-item.d.ts +1 -0
  84. package/2x/es/components/form/form-item.js +43 -13
  85. package/2x/es/components/form/form.d.ts +2 -2
  86. package/2x/es/components/form/form.js +18 -11
  87. package/2x/es/components/form/index.css +27 -1
  88. package/2x/es/components/form/index.d.ts +2 -2
  89. package/2x/es/components/image-viewer/image-viewer.d.ts +1 -1
  90. package/2x/es/components/image-viewer/index.d.ts +1 -1
  91. package/2x/es/components/input/input.d.ts +2 -2
  92. package/2x/es/components/input/input.js +2 -2
  93. package/2x/es/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
  94. package/2x/es/components/jumbo-tabs/jumbo-tabs.js +13 -17
  95. package/2x/es/components/mask/mask.js +1 -1
  96. package/2x/es/components/modal/modal.css +27 -21
  97. package/2x/es/components/modal/modal.js +37 -36
  98. package/2x/es/components/passcode-input/passcode-input.d.ts +1 -1
  99. package/2x/es/components/picker/prompt.d.ts +2 -2
  100. package/2x/es/components/popover/arrow.js +1 -2
  101. package/2x/es/components/popover/index.d.ts +3 -3
  102. package/2x/es/components/popover/popover-menu.d.ts +1 -1
  103. package/2x/es/components/popover/popover.d.ts +1 -1
  104. package/2x/es/components/popup/popup.js +1 -1
  105. package/2x/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
  106. package/2x/es/components/search-bar/search-bar.js +1 -0
  107. package/2x/es/components/selector/selector.d.ts +3 -1
  108. package/2x/es/components/stepper/stepper.d.ts +11 -2
  109. package/2x/es/components/swiper/index.d.ts +3 -3
  110. package/2x/es/components/swiper/swiper.d.ts +3 -3
  111. package/2x/es/components/switch/spin-icon.d.ts +3 -0
  112. package/2x/es/components/switch/spin-icon.js +23 -0
  113. package/2x/es/components/switch/switch.css +1 -1
  114. package/2x/es/components/switch/switch.js +3 -5
  115. package/2x/es/components/tabs/tabs.d.ts +1 -0
  116. package/2x/es/components/tabs/tabs.js +16 -20
  117. package/2x/es/components/virtual-input/virtual-input.d.ts +2 -2
  118. package/2x/es/locales/base.d.ts +51 -0
  119. package/2x/es/locales/base.js +52 -0
  120. package/2x/es/locales/en-US.d.ts +51 -0
  121. package/2x/es/locales/zh-CN.d.ts +51 -0
  122. package/2x/es/locales/zh-CN.js +52 -0
  123. package/2x/es/utils/measure-css-length.js +3 -1
  124. package/2x/es/utils/native-props.d.ts +1 -1
  125. package/2x/es/utils/render-to-container.d.ts +1 -1
  126. package/2x/es/utils/should-render.d.ts +10 -0
  127. package/2x/es/utils/{use-should-render.js → should-render.js} +4 -0
  128. package/2x/es/utils/use-drag-and-pinch.d.ts +1 -2
  129. package/2x/es/utils/use-isomorphic-update-layout-effect.js +1 -2
  130. package/2x/es/utils/use-props-value.d.ts +1 -1
  131. package/2x/es/utils/use-tab-list-scroll.js +3 -2
  132. package/2x/es/utils/use-touch.d.ts +0 -1
  133. package/2x/es/utils/validate.js +1 -1
  134. package/2x/es/utils/with-stop-propagation.d.ts +1 -1
  135. package/2x/package.json +6 -6
  136. package/cjs/components/calendar/calendar.d.ts +1 -28
  137. package/cjs/components/capsule-tabs/capsule-tabs.d.ts +1 -0
  138. package/cjs/components/capsule-tabs/capsule-tabs.js +14 -17
  139. package/cjs/components/cascade-picker/prompt.d.ts +2 -1
  140. package/cjs/components/collapse/collapse.js +5 -3
  141. package/cjs/components/date-picker/date-picker.js +7 -1
  142. package/cjs/components/dialog/dialog.css +26 -18
  143. package/cjs/components/dialog/dialog.js +39 -42
  144. package/cjs/components/dropdown/dropdown.css +2 -1
  145. package/cjs/components/dropdown/item.js +2 -2
  146. package/cjs/components/ellipsis/ellipsis.d.ts +2 -0
  147. package/cjs/components/ellipsis/ellipsis.js +8 -5
  148. package/cjs/components/form/context.d.ts +2 -1
  149. package/cjs/components/form/context.js +6 -5
  150. package/cjs/components/form/form-item.css +21 -1
  151. package/cjs/components/form/form-item.d.ts +1 -0
  152. package/cjs/components/form/form-item.js +44 -13
  153. package/cjs/components/form/form.d.ts +2 -2
  154. package/cjs/components/form/form.js +18 -9
  155. package/cjs/components/form/index.css +21 -1
  156. package/cjs/components/form/index.d.ts +2 -2
  157. package/cjs/components/image-viewer/image-viewer.d.ts +1 -1
  158. package/cjs/components/image-viewer/index.d.ts +1 -1
  159. package/cjs/components/input/input.d.ts +2 -2
  160. package/cjs/components/input/input.js +2 -2
  161. package/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
  162. package/cjs/components/jumbo-tabs/jumbo-tabs.js +14 -17
  163. package/cjs/components/mask/mask.js +2 -2
  164. package/cjs/components/modal/modal.css +26 -20
  165. package/cjs/components/modal/modal.js +39 -36
  166. package/cjs/components/passcode-input/passcode-input.d.ts +1 -1
  167. package/cjs/components/picker/prompt.d.ts +2 -2
  168. package/cjs/components/popover/arrow.js +1 -2
  169. package/cjs/components/popover/index.d.ts +3 -3
  170. package/cjs/components/popover/popover-menu.d.ts +1 -1
  171. package/cjs/components/popover/popover.d.ts +1 -1
  172. package/cjs/components/popup/popup.js +2 -2
  173. package/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
  174. package/cjs/components/search-bar/search-bar.js +1 -0
  175. package/cjs/components/selector/selector.d.ts +3 -1
  176. package/cjs/components/stepper/stepper.d.ts +11 -2
  177. package/cjs/components/swiper/index.d.ts +3 -3
  178. package/cjs/components/swiper/swiper.d.ts +3 -3
  179. package/cjs/components/switch/spin-icon.d.ts +3 -0
  180. package/cjs/components/switch/spin-icon.js +37 -0
  181. package/cjs/components/switch/switch.css +1 -1
  182. package/cjs/components/switch/switch.js +4 -6
  183. package/cjs/components/tabs/tabs.d.ts +1 -0
  184. package/cjs/components/tabs/tabs.js +17 -19
  185. package/cjs/components/virtual-input/virtual-input.d.ts +2 -2
  186. package/cjs/locales/base.d.ts +51 -0
  187. package/cjs/locales/base.js +52 -0
  188. package/cjs/locales/en-US.d.ts +51 -0
  189. package/cjs/locales/zh-CN.d.ts +51 -0
  190. package/cjs/locales/zh-CN.js +52 -0
  191. package/cjs/utils/measure-css-length.js +3 -1
  192. package/cjs/utils/native-props.d.ts +1 -1
  193. package/cjs/utils/render-to-container.d.ts +1 -1
  194. package/cjs/utils/should-render.d.ts +10 -0
  195. package/{2x/cjs/utils/use-should-render.js → cjs/utils/should-render.js} +8 -0
  196. package/cjs/utils/use-drag-and-pinch.d.ts +1 -2
  197. package/cjs/utils/use-isomorphic-update-layout-effect.js +1 -3
  198. package/cjs/utils/use-props-value.d.ts +1 -1
  199. package/cjs/utils/use-tab-list-scroll.js +3 -1
  200. package/cjs/utils/use-touch.d.ts +0 -1
  201. package/cjs/utils/validate.js +1 -1
  202. package/cjs/utils/with-stop-propagation.d.ts +1 -1
  203. package/es/components/calendar/calendar.d.ts +1 -28
  204. package/es/components/capsule-tabs/capsule-tabs.d.ts +1 -0
  205. package/es/components/capsule-tabs/capsule-tabs.js +13 -17
  206. package/es/components/cascade-picker/prompt.d.ts +2 -1
  207. package/es/components/collapse/collapse.js +4 -3
  208. package/es/components/date-picker/date-picker.js +6 -1
  209. package/es/components/dialog/dialog.css +26 -18
  210. package/es/components/dialog/dialog.js +37 -41
  211. package/es/components/dropdown/dropdown.css +2 -1
  212. package/es/components/dropdown/item.js +1 -1
  213. package/es/components/ellipsis/ellipsis.d.ts +2 -0
  214. package/es/components/ellipsis/ellipsis.js +7 -5
  215. package/es/components/form/context.d.ts +2 -1
  216. package/es/components/form/context.js +4 -3
  217. package/es/components/form/form-item.css +21 -1
  218. package/es/components/form/form-item.d.ts +1 -0
  219. package/es/components/form/form-item.js +43 -13
  220. package/es/components/form/form.d.ts +2 -2
  221. package/es/components/form/form.js +18 -11
  222. package/es/components/form/index.css +21 -1
  223. package/es/components/form/index.d.ts +2 -2
  224. package/es/components/image-viewer/image-viewer.d.ts +1 -1
  225. package/es/components/image-viewer/index.d.ts +1 -1
  226. package/es/components/input/input.d.ts +2 -2
  227. package/es/components/input/input.js +2 -2
  228. package/es/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
  229. package/es/components/jumbo-tabs/jumbo-tabs.js +13 -17
  230. package/es/components/mask/mask.js +1 -1
  231. package/es/components/modal/modal.css +26 -20
  232. package/es/components/modal/modal.js +37 -36
  233. package/es/components/passcode-input/passcode-input.d.ts +1 -1
  234. package/es/components/picker/prompt.d.ts +2 -2
  235. package/es/components/popover/arrow.js +1 -2
  236. package/es/components/popover/index.d.ts +3 -3
  237. package/es/components/popover/popover-menu.d.ts +1 -1
  238. package/es/components/popover/popover.d.ts +1 -1
  239. package/es/components/popup/popup.js +1 -1
  240. package/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
  241. package/es/components/search-bar/search-bar.js +1 -0
  242. package/es/components/selector/selector.d.ts +3 -1
  243. package/es/components/stepper/stepper.d.ts +11 -2
  244. package/es/components/swiper/index.d.ts +3 -3
  245. package/es/components/swiper/swiper.d.ts +3 -3
  246. package/es/components/switch/spin-icon.d.ts +3 -0
  247. package/es/components/switch/spin-icon.js +23 -0
  248. package/es/components/switch/switch.css +1 -1
  249. package/es/components/switch/switch.js +3 -5
  250. package/es/components/tabs/tabs.d.ts +1 -0
  251. package/es/components/tabs/tabs.js +16 -20
  252. package/es/components/virtual-input/virtual-input.d.ts +2 -2
  253. package/es/locales/base.d.ts +51 -0
  254. package/es/locales/base.js +52 -0
  255. package/es/locales/en-US.d.ts +51 -0
  256. package/es/locales/zh-CN.d.ts +51 -0
  257. package/es/locales/zh-CN.js +52 -0
  258. package/es/utils/measure-css-length.js +3 -1
  259. package/es/utils/native-props.d.ts +1 -1
  260. package/es/utils/render-to-container.d.ts +1 -1
  261. package/es/utils/should-render.d.ts +10 -0
  262. package/es/utils/{use-should-render.js → should-render.js} +4 -0
  263. package/es/utils/use-drag-and-pinch.d.ts +1 -2
  264. package/es/utils/use-isomorphic-update-layout-effect.js +1 -2
  265. package/es/utils/use-props-value.d.ts +1 -1
  266. package/es/utils/use-tab-list-scroll.js +3 -2
  267. package/es/utils/use-touch.d.ts +0 -1
  268. package/es/utils/validate.js +1 -1
  269. package/es/utils/with-stop-propagation.d.ts +1 -1
  270. package/package.json +6 -6
  271. package/umd/antd-mobile.js +1 -1
  272. package/2x/assets/spin.svg +0 -12
  273. package/2x/cjs/assets/spin.svg +0 -12
  274. package/2x/cjs/utils/use-should-render.d.ts +0 -1
  275. package/2x/es/assets/spin.svg +0 -12
  276. package/2x/es/utils/use-should-render.d.ts +0 -1
  277. package/assets/spin.svg +0 -12
  278. package/cjs/assets/spin.svg +0 -12
  279. package/cjs/utils/use-should-render.d.ts +0 -1
  280. package/es/assets/spin.svg +0 -12
  281. package/es/utils/use-should-render.d.ts +0 -1
@@ -28,13 +28,13 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
28
28
  autoplay?: boolean | undefined;
29
29
  autoplayInterval?: number | undefined;
30
30
  loop?: boolean | undefined;
31
- direction?: "horizontal" | "vertical" | undefined;
31
+ direction?: "vertical" | "horizontal" | undefined;
32
32
  onIndexChange?: ((index: number) => void) | undefined;
33
- indicatorProps?: Pick<PageIndicatorProps, "style" | "color" | "className"> | undefined;
33
+ indicatorProps?: Pick<PageIndicatorProps, "style" | "className" | "color"> | undefined;
34
34
  indicator?: ((total: number, current: number) => ReactNode) | undefined;
35
35
  slideSize?: number | undefined;
36
36
  trackOffset?: number | undefined;
37
37
  stuckAtBoundary?: boolean | undefined;
38
38
  rubberband?: boolean | undefined;
39
- children?: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>[] | undefined;
39
+ children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
40
40
  } & NativeProps<"--border-radius" | "--width" | "--height" | "--track-padding"> & React.RefAttributes<SwiperRef>>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { NativeProps } from '../../utils/native-props';
3
+ export declare const SpinIcon: React.NamedExoticComponent<NativeProps<never>>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SpinIcon = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _nativeProps = require("../../utils/native-props");
11
+
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+
16
+ const SpinIcon = (0, _react.memo)(props => {
17
+ return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
18
+ width: '28px',
19
+ height: '28px',
20
+ viewBox: '0 0 28 28'
21
+ }, _react.default.createElement("g", {
22
+ stroke: 'none',
23
+ strokeWidth: '1',
24
+ fill: 'none',
25
+ fillRule: 'evenodd'
26
+ }, _react.default.createElement("g", {
27
+ transform: 'translate(-137.000000, -840.000000)',
28
+ fill: '#1576FE'
29
+ }, _react.default.createElement("g", {
30
+ transform: 'translate(80.000000, 823.000000)'
31
+ }, _react.default.createElement("g", {
32
+ transform: 'translate(53.000000, 13.000000)'
33
+ }, _react.default.createElement("path", {
34
+ d: 'M17.9996753,31.5 C10.5556724,31.5 4.5,25.4443275 4.5,18.0003247 C4.5,10.5563219 10.5556724,4.5 17.9996753,4.5 C18.5355492,4.5 18.9702974,4.93474816 18.9702974,5.47062208 C18.9702974,6.006496 18.5355492,6.44124416 17.9996753,6.44124416 C11.6261524,6.44124416 6.44124416,11.6267709 6.44124416,18.0002938 C6.44124416,24.3738167 11.6261524,29.5587249 17.9996753,29.5587249 C24.3731982,29.5587249 29.5587249,24.3738167 29.5587249,18.0002938 C29.5587249,14.7964616 28.2778291,11.8169616 25.9523687,9.61220279 C25.5637302,9.24317094 25.5473089,8.62893223 25.9157222,8.23967523 C26.2841356,7.84976878 26.8989928,7.83461537 27.2882498,8.20302872 C30.0042351,10.7787368 31.5,14.2580826 31.5,18.0002938 C31.5,25.4443275 25.4436781,31.5 17.9996753,31.5 Z'
35
+ })))))));
36
+ });
37
+ exports.SpinIcon = SpinIcon;
@@ -101,7 +101,7 @@
101
101
  opacity: 0.4;
102
102
  }
103
103
 
104
- .adm-switch-icon {
104
+ .adm-switch-spin-icon {
105
105
  width: 28px;
106
106
  height: 28px;
107
107
  animation: loading-rotate 1s linear infinite;
@@ -11,14 +11,14 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
14
- var _spin = _interopRequireDefault(require("../../assets/spin.svg"));
15
-
16
14
  var _nativeProps = require("../../utils/native-props");
17
15
 
18
16
  var _usePropsValue = require("../../utils/use-props-value");
19
17
 
20
18
  var _withDefaultProps = require("../../utils/with-default-props");
21
19
 
20
+ var _spinIcon = require("./spin-icon");
21
+
22
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
23
 
24
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -75,10 +75,8 @@ const Switch = p => {
75
75
  className: `${classPrefix}-checkbox`
76
76
  }, _react.default.createElement("div", {
77
77
  className: `${classPrefix}-handle`
78
- }, (props.loading || changing) && _react.default.createElement("img", {
79
- src: _spin.default,
80
- className: `${classPrefix}-icon`,
81
- alt: 'switch-handle'
78
+ }, (props.loading || changing) && _react.default.createElement(_spinIcon.SpinIcon, {
79
+ className: `${classPrefix}-spin-icon`
82
80
  })), _react.default.createElement("div", {
83
81
  className: `${classPrefix}-inner`
84
82
  }, checked ? props.checkedText : props.uncheckedText))));
@@ -4,6 +4,7 @@ export declare type TabProps = {
4
4
  title: ReactNode;
5
5
  disabled?: boolean;
6
6
  forceRender?: boolean;
7
+ destroyOnClose?: boolean;
7
8
  } & NativeProps;
8
9
  export declare const Tab: FC<TabProps>;
9
10
  export declare type TabsProps = {
@@ -25,6 +25,10 @@ var _useResizeEffect = require("../../utils/use-resize-effect");
25
25
 
26
26
  var _withDefaultProps = require("../../utils/with-default-props");
27
27
 
28
+ var _useIsomorphicUpdateLayoutEffect = require("../../utils/use-isomorphic-update-layout-effect");
29
+
30
+ var _shouldRender = require("../../utils/should-render");
31
+
28
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
33
 
30
34
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -166,7 +170,7 @@ const Tabs = p => {
166
170
  (0, _ahooks.useIsomorphicLayoutEffect)(() => {
167
171
  animate(!x.isAnimating);
168
172
  }, []);
169
- (0, _ahooks.useUpdateLayoutEffect)(() => {
173
+ (0, _useIsomorphicUpdateLayoutEffect.useIsomorphicUpdateLayoutEffect)(() => {
170
174
  animate();
171
175
  }, [activeKey]);
172
176
  (0, _useResizeEffect.useResizeEffect)(() => {
@@ -253,24 +257,18 @@ const Tabs = p => {
253
257
  return null;
254
258
  }
255
259
 
256
- if (pane.key === activeKey) {
257
- return _react.default.createElement("div", {
258
- key: pane.key,
259
- className: `${classPrefix}-content`
260
- }, pane.props.children);
261
- }
262
-
263
- if (pane.props.forceRender) {
264
- return _react.default.createElement("div", {
265
- key: pane.key,
266
- className: `${classPrefix}-content`,
267
- style: {
268
- display: 'none'
269
- }
270
- }, pane.props.children);
271
- }
272
-
273
- return null;
260
+ const active = pane.key === activeKey;
261
+ return _react.default.createElement(_shouldRender.ShouldRender, {
262
+ key: pane.key,
263
+ active: active,
264
+ forceRender: pane.props.forceRender,
265
+ destroyOnClose: pane.props.destroyOnClose
266
+ }, _react.default.createElement("div", {
267
+ className: `${classPrefix}-content`,
268
+ style: {
269
+ display: active ? 'block' : 'none'
270
+ }
271
+ }, pane.props.children));
274
272
  })));
275
273
  };
276
274
 
@@ -18,7 +18,7 @@ export declare const VirtualInput: React.ForwardRefExoticComponent<{
18
18
  onFocus?: (() => void) | undefined;
19
19
  onBlur?: (() => void) | undefined;
20
20
  onClick?: ((e: React.MouseEvent<HTMLDivElement>) => void) | undefined;
21
- keyboard?: React.ReactElement<NumberKeyboardProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
21
+ keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
22
22
  clearable?: boolean | undefined;
23
23
  onClear?: (() => void) | undefined;
24
- } & Pick<InputProps, "value" | "disabled" | "onChange" | "placeholder"> & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--caret-width" | "--caret-color"> & React.RefAttributes<VirtualInputRef>>;
24
+ } & Pick<InputProps, "value" | "onChange" | "disabled" | "placeholder"> & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--caret-width" | "--caret-color"> & React.RefAttributes<VirtualInputRef>>;
@@ -31,6 +31,57 @@ export declare const base: {
31
31
  description: string;
32
32
  };
33
33
  };
34
+ Form: {
35
+ required: string;
36
+ optional: string;
37
+ defaultValidateMessages: {
38
+ default: string;
39
+ required: string;
40
+ enum: string;
41
+ whitespace: string;
42
+ date: {
43
+ format: string;
44
+ parse: string;
45
+ invalid: string;
46
+ };
47
+ types: {
48
+ string: string;
49
+ method: string;
50
+ array: string;
51
+ object: string;
52
+ number: string;
53
+ date: string;
54
+ boolean: string;
55
+ integer: string;
56
+ float: string;
57
+ regexp: string;
58
+ email: string;
59
+ url: string;
60
+ hex: string;
61
+ };
62
+ string: {
63
+ len: string;
64
+ min: string;
65
+ max: string;
66
+ range: string;
67
+ };
68
+ number: {
69
+ len: string;
70
+ min: string;
71
+ max: string;
72
+ range: string;
73
+ };
74
+ array: {
75
+ len: string;
76
+ min: string;
77
+ max: string;
78
+ range: string;
79
+ };
80
+ pattern: {
81
+ mismatch: string;
82
+ };
83
+ };
84
+ };
34
85
  ImageUploader: {
35
86
  uploading: string;
36
87
  };
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.base = void 0;
7
+ const typeTemplate = '${label} is not a valid ${type}';
7
8
  const base = {
8
9
  common: {
9
10
  confirm: 'Confirm',
@@ -37,6 +38,57 @@ const base = {
37
38
  description: 'Want to try a new search?'
38
39
  }
39
40
  },
41
+ Form: {
42
+ required: 'Required',
43
+ optional: 'Optional',
44
+ defaultValidateMessages: {
45
+ default: 'Field validation error for ${label}',
46
+ required: 'Please enter ${label}',
47
+ enum: '${label} must be one of [${enum}]',
48
+ whitespace: '${label} cannot be a blank character',
49
+ date: {
50
+ format: '${label} date format is invalid',
51
+ parse: '${label} cannot be converted to a date',
52
+ invalid: '${label} is an invalid date'
53
+ },
54
+ types: {
55
+ string: typeTemplate,
56
+ method: typeTemplate,
57
+ array: typeTemplate,
58
+ object: typeTemplate,
59
+ number: typeTemplate,
60
+ date: typeTemplate,
61
+ boolean: typeTemplate,
62
+ integer: typeTemplate,
63
+ float: typeTemplate,
64
+ regexp: typeTemplate,
65
+ email: typeTemplate,
66
+ url: typeTemplate,
67
+ hex: typeTemplate
68
+ },
69
+ string: {
70
+ len: '${label} must be ${len} characters',
71
+ min: '${label} must be at least ${min} characters',
72
+ max: '${label} must be up to ${max} characters',
73
+ range: '${label} must be between ${min}-${max} characters'
74
+ },
75
+ number: {
76
+ len: '${label} must be equal to ${len}',
77
+ min: '${label} must be minimum ${min}',
78
+ max: '${label} must be maximum ${max}',
79
+ range: '${label} must be between ${min}-${max}'
80
+ },
81
+ array: {
82
+ len: 'Must be ${len} ${label}',
83
+ min: 'At least ${min} ${label}',
84
+ max: 'At most ${max} ${label}',
85
+ range: 'The amount of ${label} must be between ${min}-${max}'
86
+ },
87
+ pattern: {
88
+ mismatch: '${label} does not match the pattern ${pattern}'
89
+ }
90
+ }
91
+ },
40
92
  ImageUploader: {
41
93
  uploading: 'Uploading...'
42
94
  },
@@ -31,6 +31,57 @@ declare const enUS: {
31
31
  description: string;
32
32
  };
33
33
  };
34
+ Form: {
35
+ required: string;
36
+ optional: string;
37
+ defaultValidateMessages: {
38
+ default: string;
39
+ required: string;
40
+ enum: string;
41
+ whitespace: string;
42
+ date: {
43
+ format: string;
44
+ parse: string;
45
+ invalid: string;
46
+ };
47
+ types: {
48
+ string: string;
49
+ method: string;
50
+ array: string;
51
+ object: string;
52
+ number: string;
53
+ date: string;
54
+ boolean: string;
55
+ integer: string;
56
+ float: string;
57
+ regexp: string;
58
+ email: string;
59
+ url: string;
60
+ hex: string;
61
+ };
62
+ string: {
63
+ len: string;
64
+ min: string;
65
+ max: string;
66
+ range: string;
67
+ };
68
+ number: {
69
+ len: string;
70
+ min: string;
71
+ max: string;
72
+ range: string;
73
+ };
74
+ array: {
75
+ len: string;
76
+ min: string;
77
+ max: string;
78
+ range: string;
79
+ };
80
+ pattern: {
81
+ mismatch: string;
82
+ };
83
+ };
84
+ };
34
85
  ImageUploader: {
35
86
  uploading: string;
36
87
  };
@@ -31,6 +31,57 @@ declare const zhCN: {
31
31
  description: string;
32
32
  };
33
33
  };
34
+ Form: {
35
+ required: string;
36
+ optional: string;
37
+ defaultValidateMessages: {
38
+ default: string;
39
+ required: string;
40
+ enum: string;
41
+ whitespace: string;
42
+ date: {
43
+ format: string;
44
+ parse: string;
45
+ invalid: string;
46
+ };
47
+ types: {
48
+ string: string;
49
+ method: string;
50
+ array: string;
51
+ object: string;
52
+ number: string;
53
+ date: string;
54
+ boolean: string;
55
+ integer: string;
56
+ float: string;
57
+ regexp: string;
58
+ email: string;
59
+ url: string;
60
+ hex: string;
61
+ };
62
+ string: {
63
+ len: string;
64
+ min: string;
65
+ max: string;
66
+ range: string;
67
+ };
68
+ number: {
69
+ len: string;
70
+ min: string;
71
+ max: string;
72
+ range: string;
73
+ };
74
+ array: {
75
+ len: string;
76
+ min: string;
77
+ max: string;
78
+ range: string;
79
+ };
80
+ pattern: {
81
+ mismatch: string;
82
+ };
83
+ };
84
+ };
34
85
  ImageUploader: {
35
86
  uploading: string;
36
87
  };
@@ -9,6 +9,7 @@ var _mergeLocale = require("../utils/merge-locale");
9
9
 
10
10
  var _base = require("./base");
11
11
 
12
+ const typeTemplate = '${label}不是一个有效的${type}';
12
13
  const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
13
14
  common: {
14
15
  confirm: '确定',
@@ -42,6 +43,57 @@ const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
42
43
  description: '找找其他的吧'
43
44
  }
44
45
  },
46
+ Form: {
47
+ required: '必填',
48
+ optional: '选填',
49
+ defaultValidateMessages: {
50
+ default: '字段验证错误${label}',
51
+ required: '请输入${label}',
52
+ enum: '${label}必须是其中一个[${enum}]',
53
+ whitespace: '${label}不能为空字符',
54
+ date: {
55
+ format: '${label}日期格式无效',
56
+ parse: '${label}不能转换为日期',
57
+ invalid: '${label}是一个无效日期'
58
+ },
59
+ types: {
60
+ string: typeTemplate,
61
+ method: typeTemplate,
62
+ array: typeTemplate,
63
+ object: typeTemplate,
64
+ number: typeTemplate,
65
+ date: typeTemplate,
66
+ boolean: typeTemplate,
67
+ integer: typeTemplate,
68
+ float: typeTemplate,
69
+ regexp: typeTemplate,
70
+ email: typeTemplate,
71
+ url: typeTemplate,
72
+ hex: typeTemplate
73
+ },
74
+ string: {
75
+ len: '${label}须为${len}个字符',
76
+ min: '${label}最少${min}个字符',
77
+ max: '${label}最多${max}个字符',
78
+ range: '${label}须在${min}-${max}字符之间'
79
+ },
80
+ number: {
81
+ len: '${label}必须等于${len}',
82
+ min: '${label}最小值为${min}',
83
+ max: '${label}最大值为${max}',
84
+ range: '${label}须在${min}-${max}之间'
85
+ },
86
+ array: {
87
+ len: '须为${len}个${label}',
88
+ min: '最少${min}个${label}',
89
+ max: '最多${max}个${label}',
90
+ range: '${label}数量须在${min}-${max}之间'
91
+ },
92
+ pattern: {
93
+ mismatch: '${label}与模式不匹配${pattern}'
94
+ }
95
+ }
96
+ },
45
97
  ImageUploader: {
46
98
  uploading: '上传中...'
47
99
  },
@@ -16,9 +16,11 @@ function measureCSSLength(raw) {
16
16
  return parseFloat(withUnit);
17
17
  } else if (withUnit.endsWith('rem')) {
18
18
  return parseFloat(withUnit) * parseFloat(window.getComputedStyle(document.documentElement).fontSize);
19
+ } else if (withUnit.endsWith('vw')) {
20
+ return parseFloat(withUnit) * window.innerWidth / 100;
19
21
  } else {
20
22
  if (_isDev.isDev) {
21
- (0, _devLog.devError)('Global', 'You are using a not supported CSS unit. Only `px` and `rem` are supported.');
23
+ (0, _devLog.devError)('Global', 'You are using a not supported CSS unit. Only `px` `rem` and `vw` are supported.');
22
24
  }
23
25
 
24
26
  return 0;
@@ -5,4 +5,4 @@ export interface NativeProps<S extends string = never> {
5
5
  style?: CSSProperties & Partial<Record<S, string>>;
6
6
  tabIndex?: number;
7
7
  }
8
- export declare function withNativeProps<P extends NativeProps>(props: P, element: ReactElement): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
8
+ export declare function withNativeProps<P extends NativeProps>(props: P, element: ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -1,3 +1,3 @@
1
1
  import { ReactElement } from 'react';
2
2
  export declare type GetContainer = HTMLElement | (() => HTMLElement) | null;
3
- export declare function renderToContainer(getContainer: GetContainer, node: ReactElement): ReactElement<any, string | ((props: any) => ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
3
+ export declare function renderToContainer(getContainer: GetContainer, node: ReactElement): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
@@ -0,0 +1,10 @@
1
+ import { FC, ReactElement } from 'react';
2
+ interface Props {
3
+ active: boolean;
4
+ forceRender?: boolean;
5
+ destroyOnClose?: boolean;
6
+ children: ReactElement;
7
+ }
8
+ export declare const ShouldRender: FC<Props>;
9
+ export declare function useShouldRender(active: boolean, forceRender?: boolean, destroyOnClose?: boolean): boolean;
10
+ export {};
@@ -3,10 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.ShouldRender = void 0;
6
7
  exports.useShouldRender = useShouldRender;
7
8
 
8
9
  var _useInitialized = require("./use-initialized");
9
10
 
11
+ const ShouldRender = props => {
12
+ const shouldRender = useShouldRender(props.active, props.forceRender, props.destroyOnClose);
13
+ return shouldRender ? props.children : null;
14
+ };
15
+
16
+ exports.ShouldRender = ShouldRender;
17
+
10
18
  function useShouldRender(active, forceRender, destroyOnClose) {
11
19
  const initialized = (0, _useInitialized.useInitialized)(active);
12
20
  if (forceRender) return true;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
- export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?: {} | Config | undefined) => Config["target"] extends object ? void : (...args: any[]) => Pick<import("react").DOMAttributes<EventTarget>, "onClick" | "onChange" | "onPause" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">;
1
+ export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?: {} | Config | undefined) => Config["target"] extends object ? void : (...args: any[]) => import("@use-gesture/react").ReactDOMAttributes;
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useIsomorphicUpdateLayoutEffect = void 0;
7
7
 
8
- var _createUpdateEffect = require("ahooks/lib/createUpdateEffect");
9
-
10
8
  var _ahooks = require("ahooks");
11
9
 
12
- const useIsomorphicUpdateLayoutEffect = (0, _createUpdateEffect.createUpdateEffect)(_ahooks.useIsomorphicLayoutEffect);
10
+ const useIsomorphicUpdateLayoutEffect = (0, _ahooks.createUpdateEffect)(_ahooks.useIsomorphicLayoutEffect);
13
11
  exports.useIsomorphicUpdateLayoutEffect = useIsomorphicUpdateLayoutEffect;
@@ -3,5 +3,5 @@ declare type Options<T> = {
3
3
  defaultValue: T;
4
4
  onChange?: (v: T) => void;
5
5
  };
6
- export declare function usePropsValue<T>(options: Options<T>): readonly [T, (v: T) => void];
6
+ export declare function usePropsValue<T>(options: Options<T>): readonly [T, (this: unknown, v: T) => void];
7
7
  export {};
@@ -13,6 +13,8 @@ var _bound = require("./bound");
13
13
 
14
14
  var _ahooks = require("ahooks");
15
15
 
16
+ var _useIsomorphicUpdateLayoutEffect = require("./use-isomorphic-update-layout-effect");
17
+
16
18
  const useTabListScroll = (targetRef, activeIndex) => {
17
19
  const [{
18
20
  scrollLeft
@@ -50,7 +52,7 @@ const useTabListScroll = (targetRef, activeIndex) => {
50
52
  (0, _ahooks.useIsomorphicLayoutEffect)(() => {
51
53
  animate(true);
52
54
  }, []);
53
- (0, _ahooks.useUpdateLayoutEffect)(() => {
55
+ (0, _useIsomorphicUpdateLayoutEffect.useIsomorphicUpdateLayoutEffect)(() => {
54
56
  animate();
55
57
  }, [activeIndex]);
56
58
  (0, _useMutationEffect.useMutationEffect)(() => {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type Direction = '' | 'vertical' | 'horizontal';
3
2
  export declare function useTouch(): {
4
3
  move: EventListener;
@@ -23,7 +23,7 @@ function isObject(val) {
23
23
  }
24
24
 
25
25
  function isPromise(obj) {
26
- return obj && typeof obj === 'object' && typeof obj.then === 'function';
26
+ return !!obj && typeof obj === 'object' && typeof obj.then === 'function';
27
27
  }
28
28
 
29
29
  function isDate(val) {
@@ -1,3 +1,3 @@
1
1
  import React, { ReactElement } from 'react';
2
2
  export declare type PropagationEvent = 'click';
3
- export declare function withStopPropagation(events: PropagationEvent[], element: ReactElement): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
3
+ export declare function withStopPropagation(events: PropagationEvent[], element: ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>>;