antd-mobile 5.0.0-rc.24 → 5.0.0-rc.28

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 (243) hide show
  1. package/2x/README.md +1 -1
  2. package/2x/cjs/components/button/button.css +2 -2
  3. package/2x/cjs/components/calendar/calendar.d.ts +1 -0
  4. package/2x/cjs/components/calendar/calendar.js +8 -1
  5. package/2x/cjs/components/checkbox/checkbox.js +12 -12
  6. package/2x/cjs/components/date-picker/date-picker.d.ts +1 -1
  7. package/2x/cjs/components/dialog/dialog.css +4 -0
  8. package/2x/cjs/components/dropdown/dropdown.css +0 -4
  9. package/2x/cjs/components/dropdown/item.js +3 -1
  10. package/2x/cjs/components/ellipsis/ellipsis.js +3 -1
  11. package/2x/cjs/components/empty/empty.css +1 -1
  12. package/2x/cjs/components/floating-bubble/floating-bubble.css +1 -0
  13. package/2x/cjs/components/floating-panel/floating-panel.d.ts +7 -5
  14. package/2x/cjs/components/floating-panel/floating-panel.js +11 -1
  15. package/2x/cjs/components/form/form-item.css +17 -10
  16. package/2x/cjs/components/form/form-item.d.ts +1 -1
  17. package/2x/cjs/components/form/form-item.js +17 -8
  18. package/2x/cjs/components/form/form.css +0 -9
  19. package/2x/cjs/components/form/form.js +1 -1
  20. package/2x/cjs/components/form/index.css +17 -19
  21. package/2x/cjs/components/image-uploader/image-uploader.d.ts +1 -1
  22. package/2x/cjs/components/image-uploader/image-uploader.js +2 -2
  23. package/2x/cjs/components/image-viewer/image-viewer.css +2 -0
  24. package/2x/cjs/components/image-viewer/image-viewer.js +12 -2
  25. package/2x/cjs/components/image-viewer/slide.js +11 -7
  26. package/2x/cjs/components/image-viewer/slides.d.ts +1 -1
  27. package/2x/cjs/components/index-bar/index-bar.css +2 -1
  28. package/2x/cjs/components/input/input.css +1 -0
  29. package/2x/cjs/components/input/input.d.ts +6 -2
  30. package/2x/cjs/components/input/input.js +20 -2
  31. package/2x/cjs/components/list/list.css +6 -4
  32. package/2x/cjs/components/picker/picker.d.ts +1 -0
  33. package/2x/cjs/components/picker/picker.js +3 -1
  34. package/2x/cjs/components/picker-view/wheel.js +4 -2
  35. package/2x/cjs/components/popover/index.d.ts +4 -6
  36. package/2x/cjs/components/popover/popover-menu.d.ts +9 -12
  37. package/2x/cjs/components/progress-bar/progress-bar.css +1 -1
  38. package/2x/cjs/components/progress-circle/progress-circle.css +4 -4
  39. package/2x/cjs/components/progress-circle/progress-circle.js +1 -2
  40. package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +7 -1
  41. package/2x/cjs/components/radio/radio.js +16 -3
  42. package/2x/cjs/components/rate/rate.css +2 -1
  43. package/2x/cjs/components/rate/rate.d.ts +1 -1
  44. package/2x/cjs/components/selector/selector.css +14 -6
  45. package/2x/cjs/components/selector/selector.d.ts +2 -1
  46. package/2x/cjs/components/selector/selector.js +3 -2
  47. package/2x/cjs/components/slider/slider.css +12 -7
  48. package/2x/cjs/components/slider/thumb-icon.d.ts +3 -0
  49. package/2x/cjs/components/slider/thumb-icon.js +38 -0
  50. package/2x/cjs/components/slider/thumb.js +5 -1
  51. package/2x/cjs/components/swiper/swiper.js +1 -1
  52. package/2x/cjs/components/tabs/tabs.js +5 -5
  53. package/2x/cjs/components/text-area/text-area.js +11 -1
  54. package/2x/cjs/components/virtual-input/virtual-input.js +3 -1
  55. package/2x/cjs/utils/get-scroll-parent.js +1 -1
  56. package/2x/cjs/utils/is-dev.js +1 -1
  57. package/2x/cjs/utils/use-ref-state.js +1 -1
  58. package/2x/cjs/utils/use-resize-effect.js +1 -3
  59. package/2x/cjs/utils/use-tab-list-scroll.js +1 -3
  60. package/2x/es/components/button/button.css +2 -2
  61. package/2x/es/components/calendar/calendar.d.ts +1 -0
  62. package/2x/es/components/calendar/calendar.js +8 -2
  63. package/2x/es/components/checkbox/checkbox.js +11 -12
  64. package/2x/es/components/date-picker/date-picker.d.ts +1 -1
  65. package/2x/es/components/dialog/dialog.css +4 -0
  66. package/2x/es/components/dropdown/dropdown.css +0 -4
  67. package/2x/es/components/dropdown/item.js +3 -1
  68. package/2x/es/components/ellipsis/ellipsis.js +3 -2
  69. package/2x/es/components/empty/empty.css +1 -1
  70. package/2x/es/components/floating-bubble/floating-bubble.css +1 -0
  71. package/2x/es/components/floating-panel/floating-panel.d.ts +7 -5
  72. package/2x/es/components/floating-panel/floating-panel.js +9 -1
  73. package/2x/es/components/form/form-item.css +17 -10
  74. package/2x/es/components/form/form-item.d.ts +1 -1
  75. package/2x/es/components/form/form-item.js +15 -6
  76. package/2x/es/components/form/form.css +0 -9
  77. package/2x/es/components/form/form.js +1 -1
  78. package/2x/es/components/form/index.css +17 -19
  79. package/2x/es/components/image-uploader/image-uploader.d.ts +1 -1
  80. package/2x/es/components/image-uploader/image-uploader.js +4 -4
  81. package/2x/es/components/image-viewer/image-viewer.css +2 -0
  82. package/2x/es/components/image-viewer/image-viewer.js +13 -3
  83. package/2x/es/components/image-viewer/slide.js +11 -7
  84. package/2x/es/components/image-viewer/slides.d.ts +1 -1
  85. package/2x/es/components/index-bar/index-bar.css +2 -1
  86. package/2x/es/components/input/input.css +1 -0
  87. package/2x/es/components/input/input.d.ts +6 -2
  88. package/2x/es/components/input/input.js +19 -3
  89. package/2x/es/components/list/list.css +6 -4
  90. package/2x/es/components/picker/picker.d.ts +1 -0
  91. package/2x/es/components/picker/picker.js +3 -1
  92. package/2x/es/components/picker-view/wheel.js +4 -3
  93. package/2x/es/components/popover/index.d.ts +4 -6
  94. package/2x/es/components/popover/popover-menu.d.ts +9 -12
  95. package/2x/es/components/progress-bar/progress-bar.css +1 -1
  96. package/2x/es/components/progress-circle/progress-circle.css +4 -4
  97. package/2x/es/components/progress-circle/progress-circle.js +1 -2
  98. package/2x/es/components/pull-to-refresh/pull-to-refresh.js +8 -2
  99. package/2x/es/components/radio/radio.js +14 -3
  100. package/2x/es/components/rate/rate.css +2 -1
  101. package/2x/es/components/rate/rate.d.ts +1 -1
  102. package/2x/es/components/selector/selector.css +14 -6
  103. package/2x/es/components/selector/selector.d.ts +2 -1
  104. package/2x/es/components/selector/selector.js +3 -2
  105. package/2x/es/components/slider/slider.css +12 -7
  106. package/2x/es/components/slider/thumb-icon.d.ts +3 -0
  107. package/2x/es/components/slider/thumb-icon.js +25 -0
  108. package/2x/es/components/slider/thumb.js +4 -1
  109. package/2x/es/components/swiper/swiper.js +3 -3
  110. package/2x/es/components/tabs/tabs.js +7 -7
  111. package/2x/es/components/text-area/text-area.js +10 -1
  112. package/2x/es/components/virtual-input/virtual-input.js +3 -2
  113. package/2x/es/utils/get-scroll-parent.js +1 -1
  114. package/2x/es/utils/is-dev.js +1 -1
  115. package/2x/es/utils/use-ref-state.js +2 -2
  116. package/2x/es/utils/use-resize-effect.js +2 -3
  117. package/2x/es/utils/use-tab-list-scroll.js +2 -3
  118. package/2x/package.json +7 -6
  119. package/README.md +1 -1
  120. package/cjs/components/button/button.css +2 -2
  121. package/cjs/components/calendar/calendar.d.ts +1 -0
  122. package/cjs/components/calendar/calendar.js +8 -1
  123. package/cjs/components/checkbox/checkbox.js +12 -12
  124. package/cjs/components/date-picker/date-picker.d.ts +1 -1
  125. package/cjs/components/dialog/dialog.css +3 -0
  126. package/cjs/components/dropdown/dropdown.css +0 -3
  127. package/cjs/components/dropdown/item.js +3 -1
  128. package/cjs/components/ellipsis/ellipsis.js +3 -1
  129. package/cjs/components/empty/empty.css +1 -1
  130. package/cjs/components/floating-bubble/floating-bubble.css +1 -0
  131. package/cjs/components/floating-panel/floating-panel.d.ts +7 -5
  132. package/cjs/components/floating-panel/floating-panel.js +11 -1
  133. package/cjs/components/form/form-item.css +15 -9
  134. package/cjs/components/form/form-item.d.ts +1 -1
  135. package/cjs/components/form/form-item.js +17 -8
  136. package/cjs/components/form/form.css +0 -7
  137. package/cjs/components/form/form.js +1 -1
  138. package/cjs/components/form/index.css +15 -16
  139. package/cjs/components/image-uploader/image-uploader.d.ts +1 -1
  140. package/cjs/components/image-uploader/image-uploader.js +2 -2
  141. package/cjs/components/image-viewer/image-viewer.css +2 -0
  142. package/cjs/components/image-viewer/image-viewer.js +12 -2
  143. package/cjs/components/image-viewer/slide.js +11 -7
  144. package/cjs/components/image-viewer/slides.d.ts +1 -1
  145. package/cjs/components/index-bar/index-bar.css +2 -1
  146. package/cjs/components/input/input.css +1 -0
  147. package/cjs/components/input/input.d.ts +6 -2
  148. package/cjs/components/input/input.js +20 -2
  149. package/cjs/components/list/list.css +5 -4
  150. package/cjs/components/picker/picker.d.ts +1 -0
  151. package/cjs/components/picker/picker.js +3 -1
  152. package/cjs/components/picker-view/wheel.js +4 -2
  153. package/cjs/components/popover/index.d.ts +4 -6
  154. package/cjs/components/popover/popover-menu.d.ts +9 -12
  155. package/cjs/components/progress-bar/progress-bar.css +1 -1
  156. package/cjs/components/progress-circle/progress-circle.css +4 -4
  157. package/cjs/components/progress-circle/progress-circle.js +1 -2
  158. package/cjs/components/pull-to-refresh/pull-to-refresh.js +7 -1
  159. package/cjs/components/radio/radio.js +16 -3
  160. package/cjs/components/rate/rate.css +2 -1
  161. package/cjs/components/rate/rate.d.ts +1 -1
  162. package/cjs/components/selector/selector.css +14 -6
  163. package/cjs/components/selector/selector.d.ts +2 -1
  164. package/cjs/components/selector/selector.js +3 -2
  165. package/cjs/components/slider/slider.css +11 -7
  166. package/cjs/components/slider/thumb-icon.d.ts +3 -0
  167. package/cjs/components/slider/thumb-icon.js +38 -0
  168. package/cjs/components/slider/thumb.js +5 -1
  169. package/cjs/components/swiper/swiper.js +1 -1
  170. package/cjs/components/tabs/tabs.js +5 -5
  171. package/cjs/components/text-area/text-area.js +11 -1
  172. package/cjs/components/virtual-input/virtual-input.js +3 -1
  173. package/cjs/utils/get-scroll-parent.js +1 -1
  174. package/cjs/utils/is-dev.js +1 -1
  175. package/cjs/utils/use-ref-state.js +1 -1
  176. package/cjs/utils/use-resize-effect.js +1 -3
  177. package/cjs/utils/use-tab-list-scroll.js +1 -3
  178. package/es/components/button/button.css +2 -2
  179. package/es/components/calendar/calendar.d.ts +1 -0
  180. package/es/components/calendar/calendar.js +8 -2
  181. package/es/components/checkbox/checkbox.js +11 -12
  182. package/es/components/date-picker/date-picker.d.ts +1 -1
  183. package/es/components/dialog/dialog.css +3 -0
  184. package/es/components/dropdown/dropdown.css +0 -3
  185. package/es/components/dropdown/item.js +3 -1
  186. package/es/components/ellipsis/ellipsis.js +3 -2
  187. package/es/components/empty/empty.css +1 -1
  188. package/es/components/floating-bubble/floating-bubble.css +1 -0
  189. package/es/components/floating-panel/floating-panel.d.ts +7 -5
  190. package/es/components/floating-panel/floating-panel.js +9 -1
  191. package/es/components/form/form-item.css +15 -9
  192. package/es/components/form/form-item.d.ts +1 -1
  193. package/es/components/form/form-item.js +15 -6
  194. package/es/components/form/form.css +0 -7
  195. package/es/components/form/form.js +1 -1
  196. package/es/components/form/index.css +15 -16
  197. package/es/components/image-uploader/image-uploader.d.ts +1 -1
  198. package/es/components/image-uploader/image-uploader.js +4 -4
  199. package/es/components/image-viewer/image-viewer.css +2 -0
  200. package/es/components/image-viewer/image-viewer.js +13 -3
  201. package/es/components/image-viewer/slide.js +11 -7
  202. package/es/components/image-viewer/slides.d.ts +1 -1
  203. package/es/components/index-bar/index-bar.css +2 -1
  204. package/es/components/input/input.css +1 -0
  205. package/es/components/input/input.d.ts +6 -2
  206. package/es/components/input/input.js +19 -3
  207. package/es/components/list/list.css +5 -4
  208. package/es/components/picker/picker.d.ts +1 -0
  209. package/es/components/picker/picker.js +3 -1
  210. package/es/components/picker-view/wheel.js +4 -3
  211. package/es/components/popover/index.d.ts +4 -6
  212. package/es/components/popover/popover-menu.d.ts +9 -12
  213. package/es/components/progress-bar/progress-bar.css +1 -1
  214. package/es/components/progress-circle/progress-circle.css +4 -4
  215. package/es/components/progress-circle/progress-circle.js +1 -2
  216. package/es/components/pull-to-refresh/pull-to-refresh.js +8 -2
  217. package/es/components/radio/radio.js +14 -3
  218. package/es/components/rate/rate.css +2 -1
  219. package/es/components/rate/rate.d.ts +1 -1
  220. package/es/components/selector/selector.css +14 -6
  221. package/es/components/selector/selector.d.ts +2 -1
  222. package/es/components/selector/selector.js +3 -2
  223. package/es/components/slider/slider.css +11 -7
  224. package/es/components/slider/thumb-icon.d.ts +3 -0
  225. package/es/components/slider/thumb-icon.js +25 -0
  226. package/es/components/slider/thumb.js +4 -1
  227. package/es/components/swiper/swiper.js +3 -3
  228. package/es/components/tabs/tabs.js +7 -7
  229. package/es/components/text-area/text-area.js +10 -1
  230. package/es/components/virtual-input/virtual-input.js +3 -2
  231. package/es/utils/get-scroll-parent.js +1 -1
  232. package/es/utils/is-dev.js +1 -1
  233. package/es/utils/use-ref-state.js +2 -2
  234. package/es/utils/use-resize-effect.js +2 -3
  235. package/es/utils/use-tab-list-scroll.js +2 -3
  236. package/package.json +7 -6
  237. package/umd/antd-mobile.js +1 -1
  238. package/2x/assets/slider-thumb.svg +0 -14
  239. package/2x/cjs/assets/slider-thumb.svg +0 -14
  240. package/2x/es/assets/slider-thumb.svg +0 -14
  241. package/assets/slider-thumb.svg +0 -14
  242. package/cjs/assets/slider-thumb.svg +0 -14
  243. package/es/assets/slider-thumb.svg +0 -14
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  declare type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
4
- export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'max' | 'min' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd'> & {
4
+ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd'> & {
5
5
  value?: string;
6
6
  defaultValue?: string;
7
7
  onChange?: (val: string) => void;
@@ -13,13 +13,15 @@ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength
13
13
  id?: string;
14
14
  onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
15
15
  enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
16
+ min?: number;
17
+ max?: number;
16
18
  } & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'>;
17
19
  export declare type InputRef = {
18
20
  clear: () => void;
19
21
  focus: () => void;
20
22
  blur: () => void;
21
23
  };
22
- export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "max" | "min" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
24
+ export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
23
25
  value?: string | undefined;
24
26
  defaultValue?: string | undefined;
25
27
  onChange?: ((val: string) => void) | undefined;
@@ -31,5 +33,7 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedH
31
33
  id?: string | undefined;
32
34
  onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
33
35
  enterKeyHint?: "enter" | "search" | "done" | "go" | "next" | "previous" | "send" | undefined;
36
+ min?: number | undefined;
37
+ max?: number | undefined;
34
38
  } & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align"> & React.RefAttributes<InputRef>>;
35
39
  export {};
@@ -17,6 +17,10 @@ var _withDefaultProps = require("../../utils/with-default-props");
17
17
 
18
18
  var _classnames = _interopRequireDefault(require("classnames"));
19
19
 
20
+ var _ahooks = require("ahooks");
21
+
22
+ var _bound = require("../../utils/bound");
23
+
20
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
25
 
22
26
  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); }
@@ -58,7 +62,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
58
62
  (_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
59
63
  };
60
64
 
61
- (0, _react.useLayoutEffect)(() => {
65
+ (0, _ahooks.useIsomorphicLayoutEffect)(() => {
62
66
  var _a;
63
67
 
64
68
  if (!props.enterKeyHint) return;
@@ -69,6 +73,19 @@ const Input = (0, _react.forwardRef)((p, ref) => {
69
73
  (_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.removeAttribute('enterkeyhint');
70
74
  };
71
75
  }, [props.enterKeyHint]);
76
+
77
+ function checkValue() {
78
+ let nextValue = value;
79
+
80
+ if (props.type === 'number') {
81
+ nextValue = (0, _bound.bound)(parseFloat(nextValue), props.min, props.max).toString();
82
+ }
83
+
84
+ if (nextValue !== value) {
85
+ setValue(nextValue);
86
+ }
87
+ }
88
+
72
89
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
73
90
  className: (0, _classnames.default)(`${classPrefix}`, props.disabled && `${classPrefix}-disabled`)
74
91
  }, _react.default.createElement("input", {
@@ -88,6 +105,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
88
105
  var _a;
89
106
 
90
107
  setHasFocus(false);
108
+ checkValue();
91
109
  (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
92
110
  },
93
111
  id: props.id,
@@ -108,7 +126,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
108
126
  onKeyUp: props.onKeyUp,
109
127
  onCompositionStart: props.onCompositionStart,
110
128
  onCompositionEnd: props.onCompositionEnd
111
- }), props.clearable && !!value && _react.default.createElement("div", {
129
+ }), props.clearable && !!value && !props.readOnly && _react.default.createElement("div", {
112
130
  className: `${classPrefix}-clear`,
113
131
  onMouseDown: e => {
114
132
  e.preventDefault();
@@ -1,5 +1,5 @@
1
1
  .adm-list {
2
- --header-font-size: 28px;
2
+ --header-font-size: 30px;
3
3
  --prefix-width: 'auto';
4
4
  --prefix-padding-right: 24px;
5
5
  --align-items: center;
@@ -15,9 +15,7 @@
15
15
  .adm-list-header {
16
16
  color: var(--adm-color-weak);
17
17
  font-size: var(--header-font-size);
18
- padding-left: var(--padding-left);
19
- padding-right: var(--padding-right);
20
- margin: 32px 0 8px;
18
+ padding: 16px var(--padding-right) 16px var(--padding-left);
21
19
  }
22
20
 
23
21
  .adm-list-body {
@@ -43,6 +41,10 @@
43
41
  border-radius: 16px;
44
42
  }
45
43
 
44
+ .adm-list-card .adm-list-header {
45
+ padding-left: 0;
46
+ }
47
+
46
48
  .adm-list-item {
47
49
  display: block;
48
50
  padding-left: var(--padding-left);
@@ -10,6 +10,7 @@ export declare type PickerProps = {
10
10
  onConfirm?: (value: PickerValue[], extend: PickerValueExtend) => void;
11
11
  onCancel?: () => void;
12
12
  onClose?: () => void;
13
+ closeOnMaskClick?: boolean;
13
14
  visible?: boolean;
14
15
  title?: ReactNode;
15
16
  confirmText?: ReactNode;
@@ -35,7 +35,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
35
35
 
36
36
  const classPrefix = `adm-picker`;
37
37
  const defaultProps = {
38
- defaultValue: []
38
+ defaultValue: [],
39
+ closeOnMaskClick: true
39
40
  };
40
41
  const Picker = (0, _react.memo)(p => {
41
42
  var _a;
@@ -114,6 +115,7 @@ const Picker = (0, _react.memo)(p => {
114
115
  onMaskClick: () => {
115
116
  var _a, _b;
116
117
 
118
+ if (!props.closeOnMaskClick) return;
117
119
  (_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
118
120
  (_b = props.onClose) === null || _b === void 0 ? void 0 : _b.call(props);
119
121
  },
@@ -19,6 +19,8 @@ var _bound = require("../../utils/bound");
19
19
 
20
20
  var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
21
21
 
22
+ var _ahooks = require("ahooks");
23
+
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
25
 
24
26
  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); }
@@ -49,7 +51,7 @@ const Wheel = (0, _react.memo)(props => {
49
51
  }
50
52
  }));
51
53
  const draggingRef = (0, _react.useRef)(false);
52
- (0, _react.useLayoutEffect)(() => {
54
+ (0, _ahooks.useIsomorphicLayoutEffect)(() => {
53
55
  if (draggingRef.current) return;
54
56
  if (!value) return;
55
57
  const targetIndex = column.findIndex(item => item.value === value);
@@ -60,7 +62,7 @@ const Wheel = (0, _react.memo)(props => {
60
62
  immediate: y.goal !== finalPosition
61
63
  });
62
64
  }, [value, column]);
63
- (0, _react.useLayoutEffect)(() => {
65
+ (0, _ahooks.useIsomorphicLayoutEffect)(() => {
64
66
  if (column.length === 0) {
65
67
  if (value !== null) {
66
68
  onSelect(null);
@@ -13,11 +13,9 @@ declare const _default: import("react").ForwardRefExoticComponent<{
13
13
  stopPropagation?: "click"[] | undefined;
14
14
  content: import("react").ReactNode;
15
15
  } & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "align" | "defaultVisible" | "onVisibleChange"> & import("../../utils/native-props").NativeProps<"--z-index"> & import("react").RefAttributes<import("./popover").PopoverRef>> & {
16
- Menu: <T extends import("./popover-menu").Action = import("./popover-menu").Action>(props: Pick<import("./popover").PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "trigger" | "defaultVisible" | "onVisibleChange" | "placement" | "destroyOnHide"> & {
17
- actions: T[];
18
- onAction?: ((text: T) => void) | undefined;
19
- } & {
20
- ref?: ((instance: import("./popover").PopoverRef | null) => void) | import("react").RefObject<import("./popover").PopoverRef> | null | undefined;
21
- }) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
16
+ Menu: import("react").ForwardRefExoticComponent<Pick<import("./popover").PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
17
+ actions: import("./popover-menu").Action[];
18
+ onAction?: ((item: import("./popover-menu").Action) => void) | undefined;
19
+ } & import("react").RefAttributes<import("./popover").PopoverRef>>;
22
20
  };
23
21
  export default _default;
@@ -1,20 +1,17 @@
1
- import React, { ReactElement, Ref } from 'react';
1
+ import React from 'react';
2
2
  import { PopoverProps, PopoverRef } from './popover';
3
3
  export declare type Action = {
4
4
  text: React.ReactNode;
5
5
  icon?: React.ReactNode;
6
6
  disabled?: boolean;
7
- key?: string;
7
+ key?: string | number;
8
8
  onClick?: () => void;
9
- [key: string]: any;
10
9
  };
11
- export declare type PopoverMenuProps<T> = Omit<PopoverProps, 'content'> & {
12
- actions: T[];
13
- onAction?: (text: T) => void;
10
+ export declare type PopoverMenuProps = Omit<PopoverProps, 'content'> & {
11
+ actions: Action[];
12
+ onAction?: (item: Action) => void;
14
13
  };
15
- export declare const PopoverMenu: <T extends Action = Action>(props: Pick<PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "trigger" | "defaultVisible" | "onVisibleChange" | "placement" | "destroyOnHide"> & {
16
- actions: T[];
17
- onAction?: ((text: T) => void) | undefined;
18
- } & {
19
- ref?: ((instance: PopoverRef | null) => void) | React.RefObject<PopoverRef> | null | undefined;
20
- }) => ReactElement;
14
+ export declare const PopoverMenu: React.ForwardRefExoticComponent<Pick<PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
15
+ actions: Action[];
16
+ onAction?: ((item: Action) => void) | undefined;
17
+ } & React.RefAttributes<PopoverRef>>;
@@ -1,7 +1,7 @@
1
1
  .adm-progress-bar {
2
2
  --track-width: var(--adm-progress-bar-track-width, 6px);
3
3
  --track-color: var(--adm-progress-bar-track-color, #e5e5e5);
4
- --fill-color: var(--adm-progress-bar-fill-color, #1677ff);
4
+ --fill-color: var(--adm-progress-bar-fill-color, var(--adm-color-primary));
5
5
  }
6
6
 
7
7
  .adm-progress-bar-trail {
@@ -1,10 +1,10 @@
1
1
  /*进度圈*/
2
2
 
3
3
  .adm-progress-circle {
4
- --track-width: 6px;
5
- --size: 100px;
6
- --track-color: #e5e5e5;
7
- --fill-color: #1677ff;
4
+ --track-width: var(--adm-progress-circle-track-width, 6px);
5
+ --size: var(--adm-progress-circle-size, 100px);
6
+ --track-color: var(--adm-progress-circle-track-color, #e5e5e5);
7
+ --fill-color: var(--adm-progress-circle-fill-color, var(--adm-color-primary));
8
8
  --percent: 0;
9
9
  --pi: 3.14159265;
10
10
  --radius: calc(var(--size) / 2 - var(--track-width) / 2);
@@ -17,8 +17,7 @@ const classPrefix = `adm-progress-circle`;
17
17
 
18
18
  const ProgressCircle = p => {
19
19
  const props = (0, _withDefaultProps.mergeProps)({
20
- percent: 0,
21
- strokeColor: '#1677FF'
20
+ percent: 0
22
21
  }, p);
23
22
  const style = {
24
23
  '--percent': props.percent.toString()
@@ -59,7 +59,13 @@ const PullToRefresh = p => {
59
59
  }
60
60
  }));
61
61
  const elementRef = (0, _react2.useRef)(null);
62
- const pullingRef = (0, _react2.useRef)(false);
62
+ const pullingRef = (0, _react2.useRef)(false); //防止下拉时抖动
63
+
64
+ (0, _react2.useEffect)(() => {
65
+ var _a;
66
+
67
+ (_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('touchmove', () => {});
68
+ }, []);
63
69
 
64
70
  function doRefresh() {
65
71
  return (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
@@ -19,6 +19,10 @@ var _withDefaultProps = require("../../utils/with-default-props");
19
19
 
20
20
  var _checkIcon = require("../checkbox/check-icon");
21
21
 
22
+ var _devLog = require("../../utils/dev-log");
23
+
24
+ var _isDev = require("../../utils/is-dev");
25
+
22
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
27
 
24
28
  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); }
@@ -44,6 +48,16 @@ const Radio = p => {
44
48
  } = props;
45
49
 
46
50
  if (groupContext && value !== undefined) {
51
+ if (_isDev.isDev) {
52
+ if (p.checked !== undefined) {
53
+ (0, _devLog.devWarning)('Radio', 'When used within `Radio.Group`, the `checked` prop of `Radio` will not work.');
54
+ }
55
+
56
+ if (p.defaultChecked !== undefined) {
57
+ (0, _devLog.devWarning)('Radio', 'When used within `Radio.Group`, the `defaultChecked` prop of `Radio` will not work.');
58
+ }
59
+ }
60
+
47
61
  checked = groupContext.value.includes(value);
48
62
 
49
63
  setChecked = checked => {
@@ -74,12 +88,11 @@ const Radio = p => {
74
88
  };
75
89
 
76
90
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("label", {
77
- className: (0, _classnames.default)(classPrefix, props.className, {
91
+ className: (0, _classnames.default)(classPrefix, {
78
92
  [`${classPrefix}-checked`]: checked,
79
93
  [`${classPrefix}-disabled`]: disabled,
80
94
  [`${classPrefix}-block`]: props.block
81
- }),
82
- style: props.style
95
+ })
83
96
  }, _react.default.createElement("input", {
84
97
  type: 'radio',
85
98
  checked: checked,
@@ -1,6 +1,7 @@
1
1
  .adm-rate {
2
2
  --star-size: 48px;
3
3
  --active-color: #ffd21e;
4
+ --inactive-color: var(--adm-color-light);
4
5
  display: inline-flex;
5
6
  }
6
7
 
@@ -12,7 +13,7 @@
12
13
  padding: calc(var(--star-size) / 8);
13
14
  line-height: var(--star-size);
14
15
  font-size: var(--star-size);
15
- color: var(--adm-color-light);
16
+ color: var(--inactive-color);
16
17
  text-align: center;
17
18
  overflow: hidden;
18
19
  cursor: pointer;
@@ -9,5 +9,5 @@ export declare type RateProps = {
9
9
  readOnly?: boolean;
10
10
  value?: number;
11
11
  onChange?: (value: number) => void;
12
- } & NativeProps<'--star-size' | '--active-color'>;
12
+ } & NativeProps<'--star-size' | '--active-color' | '--inactive-color'>;
13
13
  export declare const Rate: FC<RateProps>;
@@ -1,6 +1,12 @@
1
1
  .adm-selector {
2
- --color: var(--adm-color-text);
2
+ --color: #f5f5f5;
3
3
  --checked-color: #e7f1ff;
4
+ --text-color: var(--adm-color-text);
5
+ --checked-text-color: var(--adm-color-primary);
6
+ --border: none;
7
+ --checked-border: none;
8
+ --border-radius: 4px;
9
+ --padding: 16px 32px;
4
10
  overflow: hidden;
5
11
  font-size: 30px;
6
12
  line-height: 1.4;
@@ -11,11 +17,12 @@
11
17
  }
12
18
 
13
19
  .adm-selector-item {
14
- padding: 16px 32px;
20
+ padding: var(--padding);
15
21
  position: relative;
16
- background-color: #f5f5f5;
17
- border-radius: 4px;
18
- color: #333;
22
+ background-color: var(--color);
23
+ border: var(--border);
24
+ border-radius: var(--border-radius);
25
+ color: var(--text-color);
19
26
  opacity: 1;
20
27
  cursor: pointer;
21
28
  display: inline-block;
@@ -31,8 +38,9 @@
31
38
 
32
39
  .adm-selector-item-active,
33
40
  .adm-selector-item-multiple-active {
34
- color: var(--adm-color-primary);
41
+ color: var(--checked-text-color);
35
42
  background-color: var(--checked-color);
43
+ border: var(--checked-border);
36
44
  }
37
45
 
38
46
  .adm-selector-item .adm-selector-check-mark-wrapper {
@@ -16,5 +16,6 @@ export declare type SelectorProps<V> = {
16
16
  onChange?: (v: V[], extend: {
17
17
  items: SelectorOption<V>[];
18
18
  }) => void;
19
- } & NativeProps<'--checked-color'>;
19
+ showCheckMark?: boolean;
20
+ } & NativeProps<'--color' | '--checked-color' | '--text-color' | '--checked-text-color' | '--border' | '--checked-border' | '--border-radius' | '--padding'>;
20
21
  export declare const Selector: <V extends string | number>(p: SelectorProps<V>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
@@ -28,7 +28,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
28
28
  const classPrefix = `adm-selector`;
29
29
  const defaultProps = {
30
30
  multiple: false,
31
- defaultValue: []
31
+ defaultValue: [],
32
+ showCheckMark: true
32
33
  };
33
34
 
34
35
  const Selector = p => {
@@ -74,7 +75,7 @@ const Selector = p => {
74
75
  }
75
76
  }, option.label, option.description && _react.default.createElement("div", {
76
77
  className: `${classPrefix}-item-description`
77
- }, option.description), active && _react.default.createElement("div", {
78
+ }, option.description), active && props.showCheckMark && _react.default.createElement("div", {
78
79
  className: `${classPrefix}-check-mark-wrapper`
79
80
  }, _react.default.createElement(_checkMark.CheckMark, null)));
80
81
  });
@@ -18,6 +18,7 @@
18
18
 
19
19
  .adm-slider-fill {
20
20
  position: absolute;
21
+ z-index: 1;
21
22
  height: 8px;
22
23
  background-color: var(--fill-color);
23
24
  }
@@ -44,16 +45,11 @@
44
45
  }
45
46
 
46
47
  .adm-slider-thumb {
47
- touch-action: none;
48
- position: absolute;
49
48
  width: 44px;
50
49
  height: 44px;
50
+ margin: 10px;
51
51
  border-radius: 50%;
52
- left: 50%;
53
- top: 50%;
54
- transform: translate(-50%, -50%);
55
- background: #fff url('../../assets/slider-thumb.svg') no-repeat center center;
56
- background-size: 20px 20px;
52
+ background: var(--adm-color-white);
57
53
  box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.12), 0 3px 6px -4px rgba(0, 0, 0, 0.25);
58
54
  }
59
55
 
@@ -61,9 +57,18 @@
61
57
  outline: none;
62
58
  }
63
59
 
60
+ .adm-slider-thumb-icon {
61
+ width: 20px;
62
+ height: 20px;
63
+ margin: 12px;
64
+ user-select: none;
65
+ }
66
+
64
67
  .adm-slider-thumb-container {
68
+ cursor: grab;
65
69
  touch-action: none;
66
70
  position: absolute;
71
+ z-index: 2;
67
72
  width: 64px;
68
73
  height: 64px;
69
74
  border-radius: 50%;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { NativeProps } from '../../utils/native-props';
3
+ export declare const ThumbIcon: FC<NativeProps>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ThumbIcon = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _nativeProps = require("../../utils/native-props");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const ThumbIcon = props => {
15
+ return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
16
+ viewBox: '0 0 20 20'
17
+ }, _react.default.createElement("g", {
18
+ stroke: 'none',
19
+ strokeWidth: '1',
20
+ fill: 'none',
21
+ fillRule: 'evenodd'
22
+ }, _react.default.createElement("g", {
23
+ transform: 'translate(-604.000000, -656.000000)',
24
+ fill: '#999999'
25
+ }, _react.default.createElement("g", {
26
+ transform: 'translate(592.000000, 644.000000)'
27
+ }, _react.default.createElement("g", {
28
+ transform: 'translate(12.000000, 12.000000)'
29
+ }, _react.default.createElement("polygon", {
30
+ points: '0 3.33333333 2.22222222 3.33333333 2.22222222 17.7777778 0 17.7777778'
31
+ }), _react.default.createElement("polygon", {
32
+ points: '17.7777778 3.33333333 20 3.33333333 20 17.7777778 17.7777778 17.7777778'
33
+ }), _react.default.createElement("path", {
34
+ d: 'M10.8888889,0 L9.11111111,0 C8.98888889,0 8.88888889,0.107142857 8.88888889,0.238095238 L8.88888889,19.7619048 C8.88888889,19.8928571 8.98888889,20 9.11111111,20 L10.8888889,20 C11.0111111,20 11.1111111,19.8928571 11.1111111,19.7619048 L11.1111111,0.238095238 C11.1111111,0.107142857 11.0111111,0 10.8888889,0 Z'
35
+ })))))));
36
+ };
37
+
38
+ exports.ThumbIcon = ThumbIcon;
@@ -9,6 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _react2 = require("@use-gesture/react");
11
11
 
12
+ var _thumbIcon = require("./thumb-icon");
13
+
12
14
  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
15
 
14
16
  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; }
@@ -57,7 +59,9 @@ const Thumb = props => {
57
59
  style: currentPosition()
58
60
  }, bind()), _react.default.createElement("div", {
59
61
  className: `${classPrefix}-thumb`
60
- }));
62
+ }, _react.default.createElement(_thumbIcon.ThumbIcon, {
63
+ className: `${classPrefix}-thumb-icon`
64
+ })));
61
65
  };
62
66
 
63
67
  var _default = Thumb;
@@ -212,7 +212,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
212
212
  swipeNext,
213
213
  swipePrev
214
214
  }));
215
- (0, _react.useLayoutEffect)(() => {
215
+ (0, _ahooks.useIsomorphicLayoutEffect)(() => {
216
216
  const maxIndex = validChildren.length - 1;
217
217
 
218
218
  if (current > maxIndex) {
@@ -163,17 +163,17 @@ const Tabs = p => {
163
163
  });
164
164
  }
165
165
 
166
- (0, _react.useLayoutEffect)(() => {
167
- animate(true);
166
+ (0, _ahooks.useIsomorphicLayoutEffect)(() => {
167
+ animate(!x.isAnimating);
168
168
  }, []);
169
169
  (0, _ahooks.useUpdateLayoutEffect)(() => {
170
170
  animate();
171
171
  }, [activeKey]);
172
172
  (0, _useResizeEffect.useResizeEffect)(() => {
173
- animate(true);
173
+ animate(!x.isAnimating);
174
174
  }, tabListContainerRef);
175
175
  (0, _useMutationEffect.useMutationEffect)(() => {
176
- animate(true);
176
+ animate(!x.isAnimating);
177
177
  }, tabListContainerRef, {
178
178
  subtree: true,
179
179
  childList: true,
@@ -197,7 +197,7 @@ const Tabs = p => {
197
197
  trailing: true,
198
198
  leading: true
199
199
  });
200
- (0, _react.useLayoutEffect)(() => {
200
+ (0, _ahooks.useIsomorphicLayoutEffect)(() => {
201
201
  updateMask(true);
202
202
  }, []);
203
203
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
@@ -13,6 +13,8 @@ var _usePropsValue = require("../../utils/use-props-value");
13
13
 
14
14
  var _withDefaultProps = require("../../utils/with-default-props");
15
15
 
16
+ var _devLog = require("../../utils/dev-log");
17
+
16
18
  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); }
17
19
 
18
20
  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; }
@@ -31,7 +33,14 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
31
33
  showCount,
32
34
  maxLength
33
35
  } = props;
34
- const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
36
+ const [value, setValue] = (0, _usePropsValue.usePropsValue)(Object.assign(Object.assign({}, props), {
37
+ value: props.value === null ? '' : props.value
38
+ }));
39
+
40
+ if (props.value === null) {
41
+ (0, _devLog.devError)('TextArea', '`value` prop on `TextArea` should not be `null`. Consider using an empty string to clear the component.');
42
+ }
43
+
35
44
  const nativeTextAreaRef = (0, _react.useRef)(null);
36
45
  (0, _react.useImperativeHandle)(ref, () => ({
37
46
  clear: () => {
@@ -89,6 +98,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
89
98
  className: `${classPrefix}-element`,
90
99
  rows: props.rows,
91
100
  value: value,
101
+ placeholder: props.placeholder,
92
102
  onChange: e => {
93
103
  let v = e.target.value;
94
104
 
@@ -17,6 +17,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
17
17
 
18
18
  var _antdMobileIcons = require("antd-mobile-icons");
19
19
 
20
+ var _ahooks = require("ahooks");
21
+
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
22
24
  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); }
@@ -47,7 +49,7 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
47
49
  content.scrollLeft = content.clientWidth;
48
50
  }
49
51
 
50
- (0, _react.useLayoutEffect)(() => {
52
+ (0, _ahooks.useIsomorphicLayoutEffect)(() => {
51
53
  scrollToEnd();
52
54
  }, [value]);
53
55
  (0, _react.useEffect)(() => {
@@ -12,7 +12,7 @@ const defaultRoot = _canUseDom.canUseDom ? window : undefined;
12
12
 
13
13
  function isElement(node) {
14
14
  const ELEMENT_NODE_TYPE = 1;
15
- return node.tagName !== 'HTML' && node.tagName !== 'BODY' && node.nodeType === ELEMENT_NODE_TYPE;
15
+ return node.nodeType === ELEMENT_NODE_TYPE;
16
16
  } // https://github.com/youzan/vant/issues/3823
17
17
 
18
18
 
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isDev = void 0;
7
- const isDev = process.env.NODE_ENV === 'development';
7
+ const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
8
8
  exports.isDev = isDev;