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
@@ -12,6 +12,6 @@ export declare type FormProps = Pick<RcFormProps, 'form' | 'initialValues' | 'na
12
12
  };
13
13
  export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & NativeProps<"--border-inner" | "--border-top" | "--border-bottom"> & Partial<FormContextType> & {
14
14
  footer?: ReactNode;
15
- layout?: "horizontal" | "vertical" | undefined;
15
+ layout?: FormLayout | undefined;
16
16
  mode?: ListProps['mode'];
17
- } & React.RefAttributes<Pick<RCFormInstance<any>, "submit" | "getFieldValue" | "getFieldsValue" | "getFieldError" | "getFieldsError" | "isFieldTouched" | "isFieldsTouched" | "resetFields" | "setFields" | "setFieldsValue" | "validateFields">>>;
17
+ } & React.RefAttributes<FormInstance>>;
@@ -21,6 +21,10 @@ var _withDefaultProps = require("../../utils/with-default-props");
21
21
 
22
22
  var _header = require("./header");
23
23
 
24
+ var _configProvider = require("../config-provider");
25
+
26
+ var _merge = _interopRequireDefault(require("lodash/merge"));
27
+
24
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
29
 
26
30
  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); }
@@ -28,10 +32,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
28
32
  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; }
29
33
 
30
34
  const classPrefix = 'adm-form';
31
- const defaultProps = {
32
- hasFeedback: true,
33
- layout: 'vertical'
34
- };
35
+ const defaultProps = _context.defaultFormContext;
35
36
  const Form = (0, _react.forwardRef)((p, ref) => {
36
37
  const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
37
38
  const {
@@ -41,9 +42,14 @@ const Form = (0, _react.forwardRef)((p, ref) => {
41
42
  children,
42
43
  layout,
43
44
  footer,
44
- mode
45
+ mode,
46
+ requiredMarkStyle
45
47
  } = props,
46
- formProps = (0, _tslib.__rest)(props, ["className", "style", "hasFeedback", "children", "layout", "footer", "mode"]);
48
+ formProps = (0, _tslib.__rest)(props, ["className", "style", "hasFeedback", "children", "layout", "footer", "mode", "requiredMarkStyle"]);
49
+ const {
50
+ locale
51
+ } = (0, _configProvider.useConfig)();
52
+ const validateMessages = (0, _react.useMemo)(() => (0, _merge.default)({}, locale.Form.defaultValidateMessages, formProps.validateMessages), [locale.Form.defaultValidateMessages, formProps.validateMessages]);
47
53
  const lists = [];
48
54
  let currentHeader = null;
49
55
  let items = [];
@@ -74,10 +80,13 @@ const Form = (0, _react.forwardRef)((p, ref) => {
74
80
  className: (0, _classnames.default)(classPrefix, className),
75
81
  style: style,
76
82
  ref: ref
77
- }, formProps), _react.default.createElement(_context.FormContext.Provider, {
83
+ }, formProps, {
84
+ validateMessages: validateMessages
85
+ }), _react.default.createElement(_context.FormContext.Provider, {
78
86
  value: {
79
- hasFeedback: hasFeedback,
80
- layout
87
+ hasFeedback,
88
+ layout,
89
+ requiredMarkStyle
81
90
  }
82
91
  }, lists), footer && _react.default.createElement("div", {
83
92
  className: `${classPrefix}-footer`
@@ -32,7 +32,7 @@
32
32
  color: #666666;
33
33
  }
34
34
 
35
- .adm-form-item-label-required {
35
+ .adm-form-item-label .adm-form-item-required-asterisk {
36
36
  position: absolute;
37
37
  left: -0.6em;
38
38
  top: 0;
@@ -41,8 +41,34 @@
41
41
  user-select: none;
42
42
  }
43
43
 
44
+ .adm-form-item-label .adm-form-item-required-text {
45
+ margin-left: 8px;
46
+ color: var(--adm-color-weak);
47
+ }
48
+
44
49
  .adm-form-item-label-help {
45
50
  margin-left: 8px;
51
+ cursor: pointer;
52
+ }
53
+
54
+ .adm-form-item-child {
55
+ display: flex;
56
+ }
57
+
58
+ .adm-form-item-child-position-normal {
59
+ justify-content: normal;
60
+ }
61
+
62
+ .adm-form-item-child-position-normal > * {
63
+ flex: auto;
64
+ }
65
+
66
+ .adm-form-item-child-position-right {
67
+ justify-content: right;
68
+ }
69
+
70
+ .adm-form-item-child-position-right > * {
71
+ flex: none;
46
72
  }
47
73
 
48
74
  .adm-form-item-footer {
@@ -8,9 +8,9 @@ export type { FormSubscribeProps } from './form-subscribe';
8
8
  export type { ValidateMessages, FieldData, NamePath, } from 'rc-field-form/es/interface';
9
9
  declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & import("../../utils/native-props").NativeProps<"--border-inner" | "--border-top" | "--border-bottom"> & Partial<import("./context").FormContextType> & {
10
10
  footer?: import("react").ReactNode;
11
- layout?: "horizontal" | "vertical" | undefined;
11
+ layout?: FormLayout | undefined;
12
12
  mode?: "default" | "card" | undefined;
13
- } & import("react").RefAttributes<Pick<import("rc-field-form").FormInstance<any>, "submit" | "getFieldValue" | "getFieldsValue" | "getFieldError" | "getFieldsError" | "isFieldTouched" | "isFieldsTouched" | "resetFields" | "setFields" | "setFieldsValue" | "validateFields">>> & {
13
+ } & import("react").RefAttributes<import("./form").FormInstance>> & {
14
14
  Item: import("react").FC<import("./form-item").FormItemProps>;
15
15
  Subscribe: import("react").VFC<import("./form-subscribe").FormSubscribeProps>;
16
16
  Header: import("react").FC<{}>;
@@ -16,7 +16,7 @@ export declare type MultiImageViewerProps = Omit<ImageViewerProps, 'image'> & {
16
16
  defaultIndex?: number;
17
17
  onIndexChange?: (index: number) => void;
18
18
  };
19
- export declare const MultiImageViewer: React.ForwardRefExoticComponent<Pick<ImageViewerProps, "visible" | "onClose" | "afterClose" | "getContainer" | "maxZoom"> & {
19
+ export declare const MultiImageViewer: React.ForwardRefExoticComponent<Omit<ImageViewerProps, "image"> & {
20
20
  images?: string[] | undefined;
21
21
  defaultIndex?: number | undefined;
22
22
  onIndexChange?: ((index: number) => void) | undefined;
@@ -4,7 +4,7 @@ import { showMultiImageViewer, showImageViewer, clearImageViewer } from './metho
4
4
  export type { ImageViewerProps, MultiImageViewerProps, MultiImageViewerRef, } from './image-viewer';
5
5
  export type { ImageViewerHandler } from './methods';
6
6
  declare const _default: import("react").FC<import("./image-viewer").ImageViewerProps> & {
7
- Multi: import("react").ForwardRefExoticComponent<Pick<import("./image-viewer").ImageViewerProps, "visible" | "onClose" | "afterClose" | "getContainer" | "maxZoom"> & {
7
+ Multi: import("react").ForwardRefExoticComponent<Omit<import("./image-viewer").ImageViewerProps, "image"> & {
8
8
  images?: string[] | undefined;
9
9
  defaultIndex?: number | undefined;
10
10
  onIndexChange?: ((index: number) => void) | undefined;
@@ -21,7 +21,7 @@ export declare type InputRef = {
21
21
  focus: () => void;
22
22
  blur: () => void;
23
23
  };
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"> & {
24
+ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
25
25
  value?: string | undefined;
26
26
  defaultValue?: string | undefined;
27
27
  onChange?: ((val: string) => void) | undefined;
@@ -32,7 +32,7 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedH
32
32
  onClear?: (() => void) | undefined;
33
33
  id?: string | undefined;
34
34
  onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
35
- enterKeyHint?: "enter" | "search" | "done" | "go" | "next" | "previous" | "send" | undefined;
35
+ enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
36
36
  min?: number | undefined;
37
37
  max?: number | undefined;
38
38
  } & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align"> & React.RefAttributes<InputRef>>;
@@ -78,7 +78,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
78
78
  let nextValue = value;
79
79
 
80
80
  if (props.type === 'number') {
81
- nextValue = (0, _bound.bound)(parseFloat(nextValue), props.min, props.max).toString();
81
+ nextValue = nextValue && (0, _bound.bound)(parseFloat(nextValue), props.min, props.max).toString();
82
82
  }
83
83
 
84
84
  if (nextValue !== value) {
@@ -126,7 +126,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
126
126
  onKeyUp: props.onKeyUp,
127
127
  onCompositionStart: props.onCompositionStart,
128
128
  onCompositionEnd: props.onCompositionEnd
129
- }), props.clearable && !!value && !props.readOnly && _react.default.createElement("div", {
129
+ }), props.clearable && !!value && !props.readOnly && hasFocus && _react.default.createElement("div", {
130
130
  className: `${classPrefix}-clear`,
131
131
  onMouseDown: e => {
132
132
  e.preventDefault();
@@ -5,6 +5,7 @@ export declare type JumboTabProps = {
5
5
  description: ReactNode;
6
6
  disabled?: boolean;
7
7
  forceRender?: boolean;
8
+ destroyOnClose?: boolean;
8
9
  } & NativeProps;
9
10
  export declare const JumboTab: FC<JumboTabProps>;
10
11
  export declare type JumboTabsProps = {
@@ -21,6 +21,8 @@ var _useTabListScroll = require("../../utils/use-tab-list-scroll");
21
21
 
22
22
  var _scrollMask = _interopRequireDefault(require("../scroll-mask"));
23
23
 
24
+ var _shouldRender = require("../../utils/should-render");
25
+
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
 
26
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); }
@@ -114,23 +116,18 @@ const JumboTabs = props => {
114
116
  return null;
115
117
  }
116
118
 
117
- if (pane.key === activeKey) {
118
- return _react.default.createElement("div", {
119
- key: pane.key,
120
- className: `${classPrefix}-content`
121
- }, pane.props.children);
122
- }
123
-
124
- if (pane.props.forceRender) {
125
- return _react.default.createElement("div", {
126
- key: pane.key,
127
- style: {
128
- display: 'none'
129
- }
130
- }, pane.props.children);
131
- }
132
-
133
- return null;
119
+ const active = pane.key === activeKey;
120
+ return _react.default.createElement(_shouldRender.ShouldRender, {
121
+ key: pane.key,
122
+ active: active,
123
+ forceRender: pane.props.forceRender,
124
+ destroyOnClose: pane.props.destroyOnClose
125
+ }, _react.default.createElement("div", {
126
+ className: `${classPrefix}-content`,
127
+ style: {
128
+ display: active ? 'block' : 'none'
129
+ }
130
+ }, pane.props.children));
134
131
  })));
135
132
  };
136
133
 
@@ -21,7 +21,7 @@ var _withDefaultProps = require("../../utils/with-default-props");
21
21
 
22
22
  var _configProvider = require("../config-provider");
23
23
 
24
- var _useShouldRender = require("../../utils/use-should-render");
24
+ var _shouldRender = require("../../utils/should-render");
25
25
 
26
26
  var _withStopPropagation = require("../../utils/with-stop-propagation");
27
27
 
@@ -89,7 +89,7 @@ const Mask = p => {
89
89
  }
90
90
  }
91
91
  });
92
- const shouldRender = (0, _useShouldRender.useShouldRender)(active, props.forceRender, props.destroyOnClose);
92
+ const shouldRender = (0, _shouldRender.useShouldRender)(active, props.forceRender, props.destroyOnClose);
93
93
  const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, _react.default.createElement(_web.animated.div, {
94
94
  className: classPrefix,
95
95
  ref: ref,
@@ -19,56 +19,61 @@
19
19
  transform: translate(-50%, -50%);
20
20
  }
21
21
 
22
- .adm-modal-main {
22
+ .adm-modal-body {
23
23
  width: 100%;
24
24
  max-height: 70vh;
25
25
  box-sizing: border-box;
26
26
  font-size: 28px;
27
27
  background-color: white;
28
28
  border-radius: 16px;
29
- overflow-x: hidden;
30
- overflow-y: auto;
29
+ overflow: hidden;
31
30
  display: flex;
32
31
  flex-direction: column;
33
32
  }
34
33
 
35
- .adm-modal-main > * {
34
+ .adm-modal-body > * {
36
35
  flex: none;
37
36
  }
38
37
 
39
- .adm-modal-main > .adm-modal-image-container {
38
+ .adm-modal-body > .adm-modal-content {
40
39
  flex: auto;
41
40
  }
42
41
 
43
- .adm-modal-main .adm-modal-body {
44
- padding: 40px 24px 24px;
45
- display: flex;
46
- flex-direction: column;
42
+ .adm-modal-body:not(.adm-modal-with-image) {
43
+ padding-top: 40px;
47
44
  }
48
45
 
49
- .adm-modal-main .adm-modal-body > * + * {
50
- margin-top: 16px;
46
+ .adm-modal-body .adm-modal-image-container {
47
+ margin-bottom: 24px;
48
+ max-height: 40vh;
49
+ overflow-y: scroll;
51
50
  }
52
51
 
53
- .adm-modal-main .adm-modal-body-header-wrapper {
54
- display: flex;
55
- justify-content: center;
52
+ .adm-modal-body .adm-modal-header {
53
+ margin-bottom: 16px;
54
+ padding: 0 24px;
56
55
  }
57
56
 
58
- .adm-modal-main .adm-modal-body-title {
57
+ .adm-modal-body .adm-modal-title {
58
+ margin-bottom: 16px;
59
+ padding: 0 24px;
59
60
  font-weight: bold;
60
61
  font-size: 36px;
61
62
  line-height: 50px;
62
63
  text-align: center;
63
64
  }
64
65
 
65
- .adm-modal-main .adm-modal-body-content {
66
+ .adm-modal-body .adm-modal-content {
67
+ padding: 0 24px 24px;
68
+ max-height: 70vh;
69
+ overflow-x: hidden;
70
+ overflow-y: auto;
66
71
  font-size: 30px;
67
72
  line-height: 1.4;
68
73
  color: #333;
69
74
  }
70
75
 
71
- .adm-modal-main .adm-modal-close {
76
+ .adm-modal-body .adm-modal-close {
72
77
  position: absolute;
73
78
  right: 16px;
74
79
  top: 16px;
@@ -82,6 +87,11 @@
82
87
  padding: 16px 24px 24px;
83
88
  }
84
89
 
90
+ .adm-modal-footer-empty {
91
+ padding: 0;
92
+ height: 16px;
93
+ }
94
+
85
95
  .adm-modal-footer.adm-space {
86
96
  --gap-vertical: 40px;
87
97
  }
@@ -102,8 +112,4 @@
102
112
 
103
113
  .adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary):active {
104
114
  opacity: 0.7;
105
- }
106
-
107
- .adm-modal-image-container {
108
- overflow-y: auto;
109
115
  }
@@ -81,49 +81,29 @@ const Modal = p => {
81
81
  }
82
82
  });
83
83
  const [active, setActive] = (0, _react.useState)(props.visible);
84
- const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
85
- className: classPrefix,
86
- style: {
87
- display: active ? 'unset' : 'none'
88
- }
89
- }, _react.default.createElement(_mask.default, {
90
- visible: props.visible,
91
- onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
92
- style: props.maskStyle,
93
- className: (0, _classnames.default)(`${classPrefix}-mask`, props.maskClassName)
94
- }), _react.default.createElement("div", {
95
- className: `${classPrefix}-wrap`,
96
- style: {
97
- pointerEvents: props.visible ? 'unset' : 'none'
98
- }
99
- }, _react.default.createElement(_web.animated.div, {
100
- style: Object.assign({}, style),
101
- onClick: e => e.stopPropagation(),
102
- className: `${classPrefix}-main`
84
+
85
+ const body = _react.default.createElement("div", {
86
+ className: (0, _classnames.default)(cls('body'), props.image && cls('with-image'), props.bodyClassName),
87
+ style: props.bodyStyle
103
88
  }, props.showCloseButton && _react.default.createElement("a", {
104
- className: (0, _classnames.default)(`${classPrefix}-close`, 'adm-plain-anchor'),
89
+ className: (0, _classnames.default)(cls('close'), 'adm-plain-anchor'),
105
90
  onClick: props.onClose
106
91
  }, _react.default.createElement(_antdMobileIcons.CloseOutline, null)), !!props.image && _react.default.createElement("div", {
107
- className: `${classPrefix}-image-container`
92
+ className: cls('image-container')
108
93
  }, _react.default.createElement(_image.default, {
109
94
  src: props.image,
110
95
  alt: 'modal header image',
111
96
  width: '100%'
112
- })), _react.default.createElement("div", {
113
- style: props.bodyStyle,
114
- className: (0, _classnames.default)(`${classPrefix}-body`, props.bodyClassName)
115
- }, !!props.header && _react.default.createElement("div", {
116
- className: `${classPrefix}-body-header-wrapper`
117
- }, _react.default.createElement("div", {
118
- className: `${classPrefix}-body-header`
119
- }, props.header)), !!props.title && _react.default.createElement("div", {
120
- className: `${classPrefix}-body-title`
121
- }, props.title), !!props.content && _react.default.createElement("div", {
122
- className: `${classPrefix}-body-content`
123
- }, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content)), _react.default.createElement(_space.default, {
97
+ })), !!props.header && _react.default.createElement("div", {
98
+ className: cls('header')
99
+ }, _react.default.createElement(_autoCenter.default, null, props.header)), !!props.title && _react.default.createElement("div", {
100
+ className: cls('title')
101
+ }, props.title), _react.default.createElement("div", {
102
+ className: cls('content')
103
+ }, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content), _react.default.createElement(_space.default, {
124
104
  direction: 'vertical',
125
105
  block: true,
126
- className: `${classPrefix}-footer`
106
+ className: (0, _classnames.default)(cls('footer'), props.actions.length === 0 && cls('footer-empty'))
127
107
  }, props.actions.map((action, index) => {
128
108
  return _react.default.createElement(_modalActionButton.ModalActionButton, {
129
109
  key: action.key,
@@ -138,8 +118,31 @@ const Modal = p => {
138
118
  }
139
119
  })
140
120
  });
141
- })))))));
121
+ })));
122
+
123
+ const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
124
+ className: cls(),
125
+ style: {
126
+ display: active ? 'unset' : 'none'
127
+ }
128
+ }, _react.default.createElement(_mask.default, {
129
+ visible: props.visible,
130
+ onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
131
+ style: props.maskStyle,
132
+ className: (0, _classnames.default)(cls('mask'), props.maskClassName)
133
+ }), _react.default.createElement("div", {
134
+ className: cls('wrap'),
135
+ style: {
136
+ pointerEvents: props.visible ? 'unset' : 'none'
137
+ }
138
+ }, _react.default.createElement(_web.animated.div, {
139
+ style: style
140
+ }, body)))));
142
141
  return (0, _renderToContainer.renderToContainer)(props.getContainer, node);
143
142
  };
144
143
 
145
- exports.Modal = Modal;
144
+ exports.Modal = Modal;
145
+
146
+ function cls(name = '') {
147
+ return 'adm-modal' + (name && '-') + name;
148
+ }
@@ -30,6 +30,6 @@ export declare const PasscodeInput: React.ForwardRefExoticComponent<{
30
30
  seperated?: boolean | undefined;
31
31
  onBlur?: (() => void) | undefined;
32
32
  onFocus?: (() => void) | undefined;
33
- keyboard?: React.ReactElement<NumberKeyboardProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
33
+ keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
34
34
  onFill?: ((val: string) => void) | undefined;
35
35
  } & NativeProps<"--border-radius" | "--border-color" | "--cell-size" | "--dot-size" | "--cell-gap"> & React.RefAttributes<PasscodeInputRef>>;
@@ -1,2 +1,2 @@
1
- import type { PickerProps } from './index';
2
- export declare function prompt(props: Omit<PickerProps, 'value' | 'visible' | 'children'>): Promise<(string | null)[] | null>;
1
+ import type { PickerProps, PickerValue } from './index';
2
+ export declare function prompt(props: Omit<PickerProps, 'value' | 'visible' | 'children'>): Promise<PickerValue[] | null>;
@@ -17,10 +17,9 @@ const Arrow = (0, _react.memo)(props => {
17
17
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
18
18
  viewBox: '0 0 30 16'
19
19
  }, _react.default.createElement("g", {
20
- transform: 'translate(-1300.000000, -841.000000)',
21
20
  fill: 'currentColor'
22
21
  }, _react.default.createElement("path", {
23
- d: 'M1300,841 L1330,841 L1318.07289,855.312538 C1316.65863,857.009645 1314.13637,857.238942 1312.43926,855.824685 C1312.25341,855.669808 1312.08199,855.49839 1311.92711,855.312538 L1300,841 L1300,841 Z'
22
+ d: 'M0,0 L30,0 L18.07289,14.312538 C16.65863,16.009645 14.13637,16.238942 12.43926,14.824685 C12.25341,14.669808 12.08199,14.49839 11.92711,14.312538 L0,0 L0,0 Z'
24
23
  }))));
25
24
  });
26
25
  exports.Arrow = Arrow;
@@ -4,16 +4,16 @@ import './popover-menu.less';
4
4
  export type { PopoverProps, PopoverRef } from './popover';
5
5
  export type { PopoverMenuProps, Action } from './popover-menu';
6
6
  declare const _default: import("react").ForwardRefExoticComponent<{
7
- getContainer?: HTMLElement | (() => HTMLElement) | null | undefined;
7
+ getContainer?: import("../../utils/render-to-container").GetContainer | undefined;
8
8
  destroyOnHide?: boolean | undefined;
9
- children: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
9
+ children: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
10
10
  mode?: "dark" | "light" | undefined;
11
11
  trigger?: "click" | undefined;
12
12
  placement?: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | undefined;
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: import("react").ForwardRefExoticComponent<Pick<import("./popover").PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
16
+ Menu: import("react").ForwardRefExoticComponent<Omit<import("./popover").PopoverProps, "content"> & {
17
17
  actions: import("./popover-menu").Action[];
18
18
  onAction?: ((item: import("./popover-menu").Action) => void) | undefined;
19
19
  } & import("react").RefAttributes<import("./popover").PopoverRef>>;
@@ -11,7 +11,7 @@ export declare type PopoverMenuProps = Omit<PopoverProps, 'content'> & {
11
11
  actions: Action[];
12
12
  onAction?: (item: Action) => void;
13
13
  };
14
- export declare const PopoverMenu: React.ForwardRefExoticComponent<Pick<PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
14
+ export declare const PopoverMenu: React.ForwardRefExoticComponent<Omit<PopoverProps, "content"> & {
15
15
  actions: Action[];
16
16
  onAction?: ((item: Action) => void) | undefined;
17
17
  } & React.RefAttributes<PopoverRef>>;
@@ -19,7 +19,7 @@ export declare type PopoverRef = {
19
19
  visible: boolean;
20
20
  };
21
21
  export declare const Popover: React.ForwardRefExoticComponent<{
22
- getContainer?: HTMLElement | (() => HTMLElement) | null | undefined;
22
+ getContainer?: GetContainer | undefined;
23
23
  destroyOnHide?: boolean | undefined;
24
24
  children: ReactElement;
25
25
  mode?: "dark" | "light" | undefined;
@@ -23,7 +23,7 @@ var _renderToContainer = require("../../utils/render-to-container");
23
23
 
24
24
  var _web = require("@react-spring/web");
25
25
 
26
- var _useShouldRender = require("../../utils/use-should-render");
26
+ var _shouldRender = require("../../utils/should-render");
27
27
 
28
28
  var _withStopPropagation = require("../../utils/with-stop-propagation");
29
29
 
@@ -48,7 +48,7 @@ const Popup = p => {
48
48
  const ref = (0, _react.useRef)(null);
49
49
  const [active, setActive] = (0, _react.useState)(props.visible);
50
50
  (0, _useLockScroll.useLockScroll)(ref, active);
51
- const shouldRender = (0, _useShouldRender.useShouldRender)(active, props.forceRender, props.destroyOnClose);
51
+ const shouldRender = (0, _shouldRender.useShouldRender)(active, props.forceRender, props.destroyOnClose);
52
52
  const unmountedRef = (0, _ahooks.useUnmountedRef)();
53
53
  const {
54
54
  percent
@@ -131,7 +131,7 @@ const PullToRefresh = p => {
131
131
  if (!element) return;
132
132
  const scrollParent = (0, _getScrollParent.getScrollParent)(element);
133
133
  if (!scrollParent) return;
134
- const top = 'scrollTop' in scrollParent ? scrollParent.scrollTop : scrollParent.pageYOffset;
134
+ const top = 'scrollTop' in scrollParent ? scrollParent.scrollTop : scrollParent.scrollY;
135
135
 
136
136
  if (top <= 0 && y > 0) {
137
137
  pullingRef.current = true;
@@ -67,6 +67,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
67
67
 
68
68
  const renderCancelButton = () => {
69
69
  let isShowCancel = false;
70
+ const showCancelButton = props.showCancelButton;
70
71
 
71
72
  if (typeof props.showCancelButton === 'function') {
72
73
  isShowCancel = props.showCancelButton(hasFocus, value);
@@ -1,5 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
+ declare type SelectorValue = string | number;
3
4
  export interface SelectorOption<V> {
4
5
  label: ReactNode;
5
6
  description?: ReactNode;
@@ -18,4 +19,5 @@ export declare type SelectorProps<V> = {
18
19
  }) => void;
19
20
  showCheckMark?: boolean;
20
21
  } & NativeProps<'--color' | '--checked-color' | '--text-color' | '--checked-text-color' | '--border' | '--checked-border' | '--border-radius' | '--padding'>;
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>)>;
22
+ export declare const Selector: <V extends SelectorValue>(p: SelectorProps<V>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
23
+ export {};
@@ -1,16 +1,25 @@
1
1
  import { FC } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  import { InputProps } from '../input';
4
- export declare type StepperProps = Pick<InputProps, 'onFocus' | 'onBlur'> & {
4
+ declare type ValueProps = {
5
+ allowEmpty: true;
5
6
  value?: number | null;
6
7
  defaultValue?: number | null;
7
8
  onChange?: (value: number | null) => void;
9
+ };
10
+ declare type ValuePropsWithNull = {
11
+ allowEmpty?: false;
12
+ value?: number;
13
+ defaultValue?: number;
14
+ onChange?: (value: number) => void;
15
+ };
16
+ export declare type StepperProps = Pick<InputProps, 'onFocus' | 'onBlur'> & (ValuePropsWithNull | ValueProps) & {
8
17
  min?: number;
9
18
  max?: number;
10
19
  step?: number;
11
20
  digits?: number;
12
21
  disabled?: boolean;
13
22
  inputReadOnly?: boolean;
14
- allowEmpty?: boolean;
15
23
  } & NativeProps<'--height' | '--input-width' | '--input-font-size' | '--input-background-color' | '--border-radius' | '--border' | '--border-inner' | '--active-border' | '--button-font-size' | '--button-background-color' | '--button-width' | '--input-font-color' | '--button-text-color'>;
16
24
  export declare const Stepper: FC<StepperProps>;
25
+ export {};
@@ -7,15 +7,15 @@ declare const _default: import("react").ForwardRefExoticComponent<{
7
7
  autoplay?: boolean | undefined;
8
8
  autoplayInterval?: number | undefined;
9
9
  loop?: boolean | undefined;
10
- direction?: "horizontal" | "vertical" | undefined;
10
+ direction?: "vertical" | "horizontal" | undefined;
11
11
  onIndexChange?: ((index: number) => void) | undefined;
12
- indicatorProps?: Pick<import("../page-indicator").PageIndicatorProps, "style" | "color" | "className"> | undefined;
12
+ indicatorProps?: Pick<import("../page-indicator").PageIndicatorProps, "style" | "className" | "color"> | undefined;
13
13
  indicator?: ((total: number, current: number) => import("react").ReactNode) | undefined;
14
14
  slideSize?: number | undefined;
15
15
  trackOffset?: number | undefined;
16
16
  stuckAtBoundary?: boolean | undefined;
17
17
  rubberband?: boolean | undefined;
18
- children?: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>[] | undefined;
18
+ children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
19
19
  } & import("../../utils/native-props").NativeProps<"--border-radius" | "--width" | "--height" | "--track-padding"> & import("react").RefAttributes<import("./swiper").SwiperRef>> & {
20
20
  Item: import("react").FC<{
21
21
  onClick?: ((e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;