antd-mobile 5.32.0 → 5.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/2x/bundle/antd-mobile.cjs.development.js +385 -302
  2. package/2x/bundle/antd-mobile.cjs.js +9 -9
  3. package/2x/bundle/antd-mobile.es.development.js +385 -302
  4. package/2x/bundle/antd-mobile.es.js +5266 -5213
  5. package/2x/bundle/antd-mobile.umd.development.js +385 -302
  6. package/2x/bundle/antd-mobile.umd.js +9 -9
  7. package/2x/bundle/style.css +15 -15
  8. package/2x/cjs/components/action-sheet/action-sheet.css +1 -1
  9. package/2x/cjs/components/button/button.css +2 -2
  10. package/2x/cjs/components/calendar/calendar.js +5 -1
  11. package/2x/cjs/components/center-popup/center-popup.js +6 -5
  12. package/2x/cjs/components/collapse/collapse.js +27 -12
  13. package/2x/cjs/components/ellipsis/ellipsis.js +4 -4
  14. package/2x/cjs/components/error-block/create-error-block.js +4 -4
  15. package/2x/cjs/components/error-block/error-block.css +1 -1
  16. package/2x/cjs/components/floating-panel/floating-panel.js +8 -7
  17. package/2x/cjs/components/form/form-item.d.ts +1 -1
  18. package/2x/cjs/components/form/form-item.js +6 -9
  19. package/2x/cjs/components/form/form.css +1 -1
  20. package/2x/cjs/components/form/index.css +1 -1
  21. package/2x/cjs/components/image-uploader/image-uploader.css +1 -1
  22. package/2x/cjs/components/input/input.d.ts +2 -8
  23. package/2x/cjs/components/notice-bar/notice-bar.css +2 -2
  24. package/2x/cjs/components/number-keyboard/number-keyboard.css +2 -2
  25. package/2x/cjs/components/picker-view/wheel.js +61 -14
  26. package/2x/cjs/components/popover/popover-menu.css +2 -2
  27. package/2x/cjs/components/progress-bar/progress-bar.css +1 -1
  28. package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
  29. package/2x/cjs/components/rate/rate.d.ts +1 -1
  30. package/2x/cjs/components/steps/steps.js +5 -5
  31. package/2x/cjs/components/swipe-action/swipe-action.d.ts +4 -3
  32. package/2x/cjs/components/tag/tag.js +1 -1
  33. package/2x/cjs/components/text-area/text-area.js +11 -2
  34. package/2x/cjs/components/toast/toast.css +2 -2
  35. package/2x/cjs/components/water-mark/water-mark.js +1 -1
  36. package/2x/cjs/locales/base.d.ts +1 -1
  37. package/2x/cjs/locales/base.js +1 -1
  38. package/2x/cjs/locales/da-DK.d.ts +1 -1
  39. package/2x/cjs/locales/da-DK.js +1 -1
  40. package/2x/cjs/locales/en-US.d.ts +1 -1
  41. package/2x/cjs/locales/es-ES.d.ts +1 -1
  42. package/2x/cjs/locales/es-ES.js +1 -1
  43. package/2x/cjs/locales/fa-IR.d.ts +1 -1
  44. package/2x/cjs/locales/fa-IR.js +1 -1
  45. package/2x/cjs/locales/fr-FR.d.ts +1 -1
  46. package/2x/cjs/locales/fr-FR.js +1 -1
  47. package/2x/cjs/locales/id-ID.d.ts +1 -1
  48. package/2x/cjs/locales/id-ID.js +1 -1
  49. package/2x/cjs/locales/it-IT.d.ts +1 -1
  50. package/2x/cjs/locales/it-IT.js +1 -1
  51. package/2x/cjs/locales/ja-JP.d.ts +1 -1
  52. package/2x/cjs/locales/ja-JP.js +1 -1
  53. package/2x/cjs/locales/kk-KZ.d.ts +1 -1
  54. package/2x/cjs/locales/kk-KZ.js +1 -1
  55. package/2x/cjs/locales/ko-KR.d.ts +1 -1
  56. package/2x/cjs/locales/ko-KR.js +1 -1
  57. package/2x/cjs/locales/nb-NO.d.ts +1 -1
  58. package/2x/cjs/locales/nb-NO.js +1 -1
  59. package/2x/cjs/locales/nl-NL.d.ts +1 -1
  60. package/2x/cjs/locales/nl-NL.js +1 -1
  61. package/2x/cjs/locales/ru-RU.d.ts +1 -1
  62. package/2x/cjs/locales/ru-RU.js +1 -1
  63. package/2x/cjs/locales/zh-CN.d.ts +1 -1
  64. package/2x/cjs/locales/zh-CN.js +1 -1
  65. package/2x/cjs/locales/zh-HK.d.ts +1 -1
  66. package/2x/cjs/locales/zh-HK.js +1 -1
  67. package/2x/cjs/locales/zh-TW.d.ts +1 -1
  68. package/2x/cjs/locales/zh-TW.js +1 -1
  69. package/2x/cjs/utils/replace-message.d.ts +1 -0
  70. package/2x/cjs/utils/replace-message.js +13 -0
  71. package/2x/cjs/utils/use-lock-scroll.js +6 -2
  72. package/2x/es/components/action-sheet/action-sheet.css +1 -1
  73. package/2x/es/components/button/button.css +2 -2
  74. package/2x/es/components/calendar/calendar.js +5 -1
  75. package/2x/es/components/center-popup/center-popup.js +6 -5
  76. package/2x/es/components/collapse/collapse.js +27 -12
  77. package/2x/es/components/ellipsis/ellipsis.js +4 -4
  78. package/2x/es/components/error-block/create-error-block.js +4 -4
  79. package/2x/es/components/error-block/error-block.css +1 -1
  80. package/2x/es/components/floating-panel/floating-panel.js +8 -7
  81. package/2x/es/components/form/form-item.d.ts +1 -1
  82. package/2x/es/components/form/form-item.js +6 -9
  83. package/2x/es/components/form/form.css +1 -1
  84. package/2x/es/components/form/index.css +1 -1
  85. package/2x/es/components/image-uploader/image-uploader.css +1 -1
  86. package/2x/es/components/input/input.d.ts +2 -8
  87. package/2x/es/components/notice-bar/notice-bar.css +2 -2
  88. package/2x/es/components/number-keyboard/number-keyboard.css +2 -2
  89. package/2x/es/components/picker-view/wheel.js +61 -14
  90. package/2x/es/components/popover/popover-menu.css +2 -2
  91. package/2x/es/components/progress-bar/progress-bar.css +1 -1
  92. package/2x/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
  93. package/2x/es/components/rate/rate.d.ts +1 -1
  94. package/2x/es/components/steps/steps.js +5 -5
  95. package/2x/es/components/swipe-action/swipe-action.d.ts +4 -3
  96. package/2x/es/components/tag/tag.js +1 -1
  97. package/2x/es/components/text-area/text-area.js +11 -2
  98. package/2x/es/components/toast/toast.css +2 -2
  99. package/2x/es/components/water-mark/water-mark.js +1 -1
  100. package/2x/es/locales/base.d.ts +1 -1
  101. package/2x/es/locales/base.js +1 -1
  102. package/2x/es/locales/da-DK.d.ts +1 -1
  103. package/2x/es/locales/da-DK.js +1 -1
  104. package/2x/es/locales/en-US.d.ts +1 -1
  105. package/2x/es/locales/es-ES.d.ts +1 -1
  106. package/2x/es/locales/es-ES.js +1 -1
  107. package/2x/es/locales/fa-IR.d.ts +1 -1
  108. package/2x/es/locales/fa-IR.js +1 -1
  109. package/2x/es/locales/fr-FR.d.ts +1 -1
  110. package/2x/es/locales/fr-FR.js +1 -1
  111. package/2x/es/locales/id-ID.d.ts +1 -1
  112. package/2x/es/locales/id-ID.js +1 -1
  113. package/2x/es/locales/it-IT.d.ts +1 -1
  114. package/2x/es/locales/it-IT.js +1 -1
  115. package/2x/es/locales/ja-JP.d.ts +1 -1
  116. package/2x/es/locales/ja-JP.js +1 -1
  117. package/2x/es/locales/kk-KZ.d.ts +1 -1
  118. package/2x/es/locales/kk-KZ.js +1 -1
  119. package/2x/es/locales/ko-KR.d.ts +1 -1
  120. package/2x/es/locales/ko-KR.js +1 -1
  121. package/2x/es/locales/nb-NO.d.ts +1 -1
  122. package/2x/es/locales/nb-NO.js +1 -1
  123. package/2x/es/locales/nl-NL.d.ts +1 -1
  124. package/2x/es/locales/nl-NL.js +1 -1
  125. package/2x/es/locales/ru-RU.d.ts +1 -1
  126. package/2x/es/locales/ru-RU.js +1 -1
  127. package/2x/es/locales/zh-CN.d.ts +1 -1
  128. package/2x/es/locales/zh-CN.js +1 -1
  129. package/2x/es/locales/zh-HK.d.ts +1 -1
  130. package/2x/es/locales/zh-HK.js +1 -1
  131. package/2x/es/locales/zh-TW.d.ts +1 -1
  132. package/2x/es/locales/zh-TW.js +1 -1
  133. package/2x/es/utils/replace-message.d.ts +1 -0
  134. package/2x/es/utils/replace-message.js +7 -0
  135. package/2x/es/utils/use-lock-scroll.js +6 -2
  136. package/2x/package.json +1 -1
  137. package/bundle/antd-mobile.cjs.development.js +385 -302
  138. package/bundle/antd-mobile.cjs.js +9 -9
  139. package/bundle/antd-mobile.compatible.umd.js +1 -1
  140. package/bundle/antd-mobile.es.development.js +385 -302
  141. package/bundle/antd-mobile.es.js +5266 -5213
  142. package/bundle/antd-mobile.umd.development.js +385 -302
  143. package/bundle/antd-mobile.umd.js +9 -9
  144. package/bundle/style.css +1 -1
  145. package/cjs/components/action-sheet/action-sheet.css +1 -1
  146. package/cjs/components/button/button.css +2 -2
  147. package/cjs/components/calendar/calendar.js +5 -1
  148. package/cjs/components/center-popup/center-popup.js +6 -5
  149. package/cjs/components/collapse/collapse.js +27 -12
  150. package/cjs/components/ellipsis/ellipsis.js +4 -4
  151. package/cjs/components/error-block/create-error-block.js +4 -4
  152. package/cjs/components/error-block/error-block.css +1 -1
  153. package/cjs/components/floating-panel/floating-panel.js +8 -7
  154. package/cjs/components/form/form-item.d.ts +1 -1
  155. package/cjs/components/form/form-item.js +6 -9
  156. package/cjs/components/form/form.css +1 -1
  157. package/cjs/components/form/index.css +1 -1
  158. package/cjs/components/image-uploader/image-uploader.css +1 -1
  159. package/cjs/components/input/input.d.ts +2 -8
  160. package/cjs/components/notice-bar/notice-bar.css +2 -2
  161. package/cjs/components/number-keyboard/number-keyboard.css +2 -2
  162. package/cjs/components/picker-view/wheel.js +61 -14
  163. package/cjs/components/popover/popover-menu.css +2 -2
  164. package/cjs/components/progress-bar/progress-bar.css +1 -1
  165. package/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
  166. package/cjs/components/rate/rate.d.ts +1 -1
  167. package/cjs/components/steps/steps.js +5 -5
  168. package/cjs/components/swipe-action/swipe-action.d.ts +4 -3
  169. package/cjs/components/tag/tag.js +1 -1
  170. package/cjs/components/text-area/text-area.js +11 -2
  171. package/cjs/components/toast/toast.css +2 -2
  172. package/cjs/components/water-mark/water-mark.js +1 -1
  173. package/cjs/locales/base.d.ts +1 -1
  174. package/cjs/locales/base.js +1 -1
  175. package/cjs/locales/da-DK.d.ts +1 -1
  176. package/cjs/locales/da-DK.js +1 -1
  177. package/cjs/locales/en-US.d.ts +1 -1
  178. package/cjs/locales/es-ES.d.ts +1 -1
  179. package/cjs/locales/es-ES.js +1 -1
  180. package/cjs/locales/fa-IR.d.ts +1 -1
  181. package/cjs/locales/fa-IR.js +1 -1
  182. package/cjs/locales/fr-FR.d.ts +1 -1
  183. package/cjs/locales/fr-FR.js +1 -1
  184. package/cjs/locales/id-ID.d.ts +1 -1
  185. package/cjs/locales/id-ID.js +1 -1
  186. package/cjs/locales/it-IT.d.ts +1 -1
  187. package/cjs/locales/it-IT.js +1 -1
  188. package/cjs/locales/ja-JP.d.ts +1 -1
  189. package/cjs/locales/ja-JP.js +1 -1
  190. package/cjs/locales/kk-KZ.d.ts +1 -1
  191. package/cjs/locales/kk-KZ.js +1 -1
  192. package/cjs/locales/ko-KR.d.ts +1 -1
  193. package/cjs/locales/ko-KR.js +1 -1
  194. package/cjs/locales/nb-NO.d.ts +1 -1
  195. package/cjs/locales/nb-NO.js +1 -1
  196. package/cjs/locales/nl-NL.d.ts +1 -1
  197. package/cjs/locales/nl-NL.js +1 -1
  198. package/cjs/locales/ru-RU.d.ts +1 -1
  199. package/cjs/locales/ru-RU.js +1 -1
  200. package/cjs/locales/zh-CN.d.ts +1 -1
  201. package/cjs/locales/zh-CN.js +1 -1
  202. package/cjs/locales/zh-HK.d.ts +1 -1
  203. package/cjs/locales/zh-HK.js +1 -1
  204. package/cjs/locales/zh-TW.d.ts +1 -1
  205. package/cjs/locales/zh-TW.js +1 -1
  206. package/cjs/utils/replace-message.d.ts +1 -0
  207. package/cjs/utils/replace-message.js +13 -0
  208. package/cjs/utils/use-lock-scroll.js +6 -2
  209. package/es/components/action-sheet/action-sheet.css +1 -1
  210. package/es/components/button/button.css +2 -2
  211. package/es/components/calendar/calendar.js +5 -1
  212. package/es/components/center-popup/center-popup.js +6 -5
  213. package/es/components/collapse/collapse.js +27 -12
  214. package/es/components/ellipsis/ellipsis.js +4 -4
  215. package/es/components/error-block/create-error-block.js +4 -4
  216. package/es/components/error-block/error-block.css +1 -1
  217. package/es/components/floating-panel/floating-panel.js +8 -7
  218. package/es/components/form/form-item.d.ts +1 -1
  219. package/es/components/form/form-item.js +6 -9
  220. package/es/components/form/form.css +1 -1
  221. package/es/components/form/index.css +1 -1
  222. package/es/components/image-uploader/image-uploader.css +1 -1
  223. package/es/components/input/input.d.ts +2 -8
  224. package/es/components/notice-bar/notice-bar.css +2 -2
  225. package/es/components/number-keyboard/number-keyboard.css +2 -2
  226. package/es/components/picker-view/wheel.js +61 -14
  227. package/es/components/popover/popover-menu.css +2 -2
  228. package/es/components/progress-bar/progress-bar.css +1 -1
  229. package/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
  230. package/es/components/rate/rate.d.ts +1 -1
  231. package/es/components/steps/steps.js +5 -5
  232. package/es/components/swipe-action/swipe-action.d.ts +4 -3
  233. package/es/components/tag/tag.js +1 -1
  234. package/es/components/text-area/text-area.js +11 -2
  235. package/es/components/toast/toast.css +2 -2
  236. package/es/components/water-mark/water-mark.js +1 -1
  237. package/es/locales/base.d.ts +1 -1
  238. package/es/locales/base.js +1 -1
  239. package/es/locales/da-DK.d.ts +1 -1
  240. package/es/locales/da-DK.js +1 -1
  241. package/es/locales/en-US.d.ts +1 -1
  242. package/es/locales/es-ES.d.ts +1 -1
  243. package/es/locales/es-ES.js +1 -1
  244. package/es/locales/fa-IR.d.ts +1 -1
  245. package/es/locales/fa-IR.js +1 -1
  246. package/es/locales/fr-FR.d.ts +1 -1
  247. package/es/locales/fr-FR.js +1 -1
  248. package/es/locales/id-ID.d.ts +1 -1
  249. package/es/locales/id-ID.js +1 -1
  250. package/es/locales/it-IT.d.ts +1 -1
  251. package/es/locales/it-IT.js +1 -1
  252. package/es/locales/ja-JP.d.ts +1 -1
  253. package/es/locales/ja-JP.js +1 -1
  254. package/es/locales/kk-KZ.d.ts +1 -1
  255. package/es/locales/kk-KZ.js +1 -1
  256. package/es/locales/ko-KR.d.ts +1 -1
  257. package/es/locales/ko-KR.js +1 -1
  258. package/es/locales/nb-NO.d.ts +1 -1
  259. package/es/locales/nb-NO.js +1 -1
  260. package/es/locales/nl-NL.d.ts +1 -1
  261. package/es/locales/nl-NL.js +1 -1
  262. package/es/locales/ru-RU.d.ts +1 -1
  263. package/es/locales/ru-RU.js +1 -1
  264. package/es/locales/zh-CN.d.ts +1 -1
  265. package/es/locales/zh-CN.js +1 -1
  266. package/es/locales/zh-HK.d.ts +1 -1
  267. package/es/locales/zh-HK.js +1 -1
  268. package/es/locales/zh-TW.d.ts +1 -1
  269. package/es/locales/zh-TW.js +1 -1
  270. package/es/utils/replace-message.d.ts +1 -0
  271. package/es/utils/replace-message.js +7 -0
  272. package/es/utils/use-lock-scroll.js +6 -2
  273. package/package.json +1 -1
  274. package/umd/antd-mobile.js +1 -1
@@ -15,6 +15,7 @@ var _useLockScroll = require("../../utils/use-lock-scroll");
15
15
  var _ahooks = require("ahooks");
16
16
  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
17
  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; }
18
+ const classPrefix = 'adm-floating-panel';
18
19
  const defaultProps = {
19
20
  handleDraggingOfContent: true
20
21
  };
@@ -73,7 +74,7 @@ const FloatingPanel = (0, _react.forwardRef)((p, ref) => {
73
74
  const {
74
75
  event
75
76
  } = state;
76
- if (event.cancelable) {
77
+ if (event.cancelable && _supportsPassive.supportsPassive) {
77
78
  event.preventDefault();
78
79
  }
79
80
  event.stopPropagation();
@@ -97,7 +98,7 @@ const FloatingPanel = (0, _react.forwardRef)((p, ref) => {
97
98
  target: elementRef,
98
99
  eventOptions: _supportsPassive.supportsPassive ? {
99
100
  passive: false
100
- } : false
101
+ } : undefined
101
102
  });
102
103
  (0, _react.useImperativeHandle)(ref, () => ({
103
104
  setHeight: (height, options) => {
@@ -110,23 +111,23 @@ const FloatingPanel = (0, _react.forwardRef)((p, ref) => {
110
111
  (0, _useLockScroll.useLockScroll)(elementRef, true);
111
112
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement(_web.animated.div, {
112
113
  ref: elementRef,
113
- className: 'adm-floating-panel',
114
+ className: classPrefix,
114
115
  style: {
115
116
  height: Math.round(maxHeight),
116
117
  translateY: y.to(y => `calc(100% + (${Math.round(y)}px))`)
117
118
  }
118
119
  }, _react.default.createElement("div", {
119
- className: 'adm-floating-panel-mask',
120
+ className: `${classPrefix}-mask`,
120
121
  style: {
121
122
  display: pulling ? 'block' : 'none'
122
123
  }
123
124
  }), _react.default.createElement("div", {
124
- className: 'adm-floating-panel-header',
125
+ className: `${classPrefix}-header`,
125
126
  ref: headerRef
126
127
  }, _react.default.createElement("div", {
127
- className: 'adm-floating-panel-bar'
128
+ className: `${classPrefix}-bar`
128
129
  })), _react.default.createElement("div", {
129
- className: 'adm-floating-panel-content',
130
+ className: `${classPrefix}-content`,
130
131
  ref: contentRef
131
132
  }, props.children)));
132
133
  });
@@ -2,8 +2,8 @@ import React, { FC } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  import { FormInstance } from 'rc-field-form';
4
4
  import type { FieldProps } from 'rc-field-form/lib/Field';
5
- import { ListItemProps } from '../list';
6
5
  import type { FormLayout } from './index';
6
+ import { ListItemProps } from '../list';
7
7
  declare type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;
8
8
  declare type ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode;
9
9
  declare type RcFieldProps = Omit<FieldProps, 'children'>;
@@ -29,7 +29,6 @@ const MemoInput = _react.default.memo(({
29
29
  const FormItemLayout = props => {
30
30
  var _a;
31
31
  const {
32
- className,
33
32
  style,
34
33
  extra,
35
34
  label,
@@ -71,7 +70,7 @@ const FormItemLayout = props => {
71
70
  return null;
72
71
  }
73
72
  })();
74
- const labelElement = label ? _react.default.createElement("label", {
73
+ const labelElement = !!label && _react.default.createElement("label", {
75
74
  className: `${classPrefix}-label`,
76
75
  htmlFor: htmlFor
77
76
  }, label, requiredMark, help && _react.default.createElement(_popover.default, {
@@ -83,21 +82,21 @@ const FormItemLayout = props => {
83
82
  onClick: e => {
84
83
  e.preventDefault();
85
84
  }
86
- }, _react.default.createElement(_antdMobileIcons.QuestionCircleOutline, null)))) : null;
87
- const description = props.description || hasFeedback ? _react.default.createElement(_react.default.Fragment, null, props.description, hasFeedback && _react.default.createElement(_react.default.Fragment, null, props.errors.map((error, index) => _react.default.createElement("div", {
85
+ }, _react.default.createElement(_antdMobileIcons.QuestionCircleOutline, null))));
86
+ const description = (!!props.description || hasFeedback) && _react.default.createElement(_react.default.Fragment, null, props.description, hasFeedback && _react.default.createElement(_react.default.Fragment, null, props.errors.map((error, index) => _react.default.createElement("div", {
88
87
  key: `error-${index}`,
89
88
  className: `${classPrefix}-feedback-error`
90
89
  }, error)), props.warnings.map((warning, index) => _react.default.createElement("div", {
91
90
  key: `warning-${index}`,
92
91
  className: `${classPrefix}-feedback-warning`
93
- }, warning)))) : null;
92
+ }, warning))));
94
93
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement(_list.default.Item, {
95
94
  style: style,
96
95
  title: layout === 'vertical' && labelElement,
97
96
  prefix: layout === 'horizontal' && labelElement,
98
97
  extra: extra,
99
98
  description: description,
100
- className: (0, _classnames.default)(classPrefix, className, `${classPrefix}-${layout}`, {
99
+ className: (0, _classnames.default)(classPrefix, `${classPrefix}-${layout}`, {
101
100
  [`${classPrefix}-hidden`]: hidden,
102
101
  [`${classPrefix}-has-error`]: props.errors.length
103
102
  }),
@@ -114,7 +113,6 @@ const FormItemLayout = props => {
114
113
  const FormItem = props => {
115
114
  const {
116
115
  // 样式相关
117
- className,
118
116
  style,
119
117
  // FormItem 相关
120
118
  label,
@@ -141,7 +139,7 @@ const FormItem = props => {
141
139
  clickable,
142
140
  arrow
143
141
  } = props,
144
- fieldProps = (0, _tslib.__rest)(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "childElementPosition", "description", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "clickable", "arrow"]);
142
+ fieldProps = (0, _tslib.__rest)(props, ["style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "childElementPosition", "description", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "clickable", "arrow"]);
145
143
  const {
146
144
  name: formName
147
145
  } = (0, _react.useContext)(_context.FormContext);
@@ -189,7 +187,6 @@ const FormItem = props => {
189
187
  return subWarnings;
190
188
  }, curWarnings);
191
189
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement(FormItemLayout, {
192
- className: className,
193
190
  style: style,
194
191
  label: label,
195
192
  extra: extra,
@@ -23,5 +23,5 @@
23
23
  }
24
24
  .adm-form-list-operation {
25
25
  text-align: center;
26
- color: #1677ff;
26
+ color: var(--adm-color-primary);
27
27
  }
@@ -23,7 +23,7 @@
23
23
  }
24
24
  .adm-form-list-operation {
25
25
  text-align: center;
26
- color: #1677ff;
26
+ color: var(--adm-color-primary);
27
27
  }
28
28
  .adm-form-item + .adm-form-item {
29
29
  border-top: none;
@@ -76,7 +76,7 @@
76
76
  display: block;
77
77
  }
78
78
  .adm-image-uploader-upload-button-wrap .adm-image-uploader-upload-button-icon {
79
- color: #999999;
79
+ color: var(--adm-color-weak);
80
80
  font-size: 32px;
81
81
  }
82
82
  .adm-image-uploader-upload-button-wrap .adm-image-uploader-input {
@@ -4,13 +4,10 @@ declare type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttribute
4
4
  declare type AriaProps = {
5
5
  role?: string;
6
6
  };
7
- export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'name' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'step' | 'id'> & {
7
+ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'name' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'step' | 'id' | 'placeholder' | 'readOnly' | 'disabled'> & {
8
8
  value?: string;
9
9
  defaultValue?: string;
10
10
  onChange?: (val: string) => void;
11
- placeholder?: string;
12
- disabled?: boolean;
13
- readOnly?: boolean;
14
11
  clearable?: boolean;
15
12
  onlyShowClearWhenFocus?: boolean;
16
13
  onClear?: () => void;
@@ -25,13 +22,10 @@ export declare type InputRef = {
25
22
  blur: () => void;
26
23
  nativeElement: HTMLInputElement | null;
27
24
  };
28
- export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "id" | "onClick" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "type" | "step" | "autoFocus" | "autoCapitalize" | "autoCorrect" | "inputMode" | "name" | "autoComplete" | "maxLength" | "minLength"> & {
25
+ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "id" | "onClick" | "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "type" | "step" | "autoFocus" | "placeholder" | "autoCapitalize" | "autoCorrect" | "inputMode" | "name" | "readOnly" | "autoComplete" | "maxLength" | "minLength"> & {
29
26
  value?: string | undefined;
30
27
  defaultValue?: string | undefined;
31
28
  onChange?: ((val: string) => void) | undefined;
32
- placeholder?: string | undefined;
33
- disabled?: boolean | undefined;
34
- readOnly?: boolean | undefined;
35
29
  clearable?: boolean | undefined;
36
30
  onlyShowClearWhenFocus?: boolean | undefined;
37
31
  onClear?: (() => void) | undefined;
@@ -1,6 +1,6 @@
1
1
  .adm-notice-bar {
2
2
  --background-color: #ababab;
3
- --border-color: #999999;
3
+ --border-color: var(--adm-color-weak);
4
4
  --text-color: var(--adm-color-text-light-solid);
5
5
  --font-size: var(--adm-font-size-7);
6
6
  --icon-font-size: var(--adm-font-size-10);
@@ -34,7 +34,7 @@
34
34
  .adm-notice-bar.adm-notice-bar-info {
35
35
  --background-color: #d0e4ff;
36
36
  --border-color: #bcd8ff;
37
- --text-color: #1677ff;
37
+ --text-color: var(--adm-color-primary);
38
38
  }
39
39
  .adm-notice-bar .adm-notice-bar-left {
40
40
  flex-shrink: 0;
@@ -73,9 +73,9 @@
73
73
  left: 50%;
74
74
  width: 100%;
75
75
  height: 100%;
76
- background-color: #000;
76
+ background-color: var(--adm-color-text-dark-solid);
77
77
  border: inherit;
78
- border-color: #000;
78
+ border-color: var(--adm-color-text-dark-solid);
79
79
  border-radius: inherit;
80
80
  transform: translate(-50%, -50%);
81
81
  opacity: 0;
@@ -78,17 +78,66 @@ const Wheel = (0, _react.memo)(props => {
78
78
  if (!item) return;
79
79
  onSelect(item.value);
80
80
  }
81
+ const handleGestureState = state => {
82
+ const {
83
+ direction: [, direction],
84
+ distance: [, distance],
85
+ velocity: [, velocity],
86
+ offset: [, offset],
87
+ last
88
+ } = state;
89
+ return {
90
+ direction,
91
+ distance,
92
+ velocity,
93
+ offset,
94
+ last
95
+ };
96
+ };
81
97
  const handleDrag = state => {
82
98
  draggingRef.current = true;
83
99
  const min = -((column.length - 1) * itemHeight.current);
84
100
  const max = 0;
85
- if (state.last) {
101
+ const {
102
+ direction,
103
+ last,
104
+ velocity,
105
+ offset
106
+ } = handleGestureState(state);
107
+ if (last) {
108
+ draggingRef.current = false;
109
+ const position = offset + velocity * direction * 50;
110
+ const boundNum = (0, _bound.bound)(position, min, max);
111
+ const targetIndex = -Math.round(boundNum / itemHeight.current);
112
+ scrollSelect(targetIndex);
113
+ } else {
114
+ const position = offset;
115
+ api.start({
116
+ y: (0, _rubberband.rubberbandIfOutOfBounds)(position, min, max, itemHeight.current * 50, 0.2)
117
+ });
118
+ }
119
+ };
120
+ const handleWheel = state => {
121
+ draggingRef.current = true;
122
+ const min = -((column.length - 1) * itemHeight.current);
123
+ const max = 0;
124
+ const {
125
+ direction,
126
+ last,
127
+ velocity,
128
+ distance
129
+ } = handleGestureState(state);
130
+ const whellDir = -direction; // 取反
131
+ const scrollY = y.get();
132
+ if (last) {
86
133
  draggingRef.current = false;
87
- const position = state.offset[1] + state.velocity[1] * state.direction[1] * 50;
88
- const targetIndex = min < max ? -Math.round((0, _bound.bound)(position, min, max) / itemHeight.current) : 0;
134
+ const speed = velocity * whellDir * 50;
135
+ const position = scrollY + distance * whellDir + speed;
136
+ const boundNum = (0, _bound.bound)(position, min, max);
137
+ const targetIndex = -Math.round(boundNum / itemHeight.current);
89
138
  scrollSelect(targetIndex);
90
139
  } else {
91
- const position = state.offset[1];
140
+ const position = scrollY + distance * whellDir;
92
141
  api.start({
93
142
  y: (0, _rubberband.rubberbandIfOutOfBounds)(position, min, max, itemHeight.current * 50, 0.2)
94
143
  });
@@ -108,15 +157,15 @@ const Wheel = (0, _react.memo)(props => {
108
157
  });
109
158
  (0, _react2.useWheel)(state => {
110
159
  state.event.stopPropagation();
111
- handleDrag(state);
160
+ handleWheel(state);
112
161
  }, {
162
+ target: props.mouseWheel ? rootRef : undefined,
113
163
  axis: 'y',
114
164
  from: () => [0, y.get()],
115
165
  preventDefault: true,
116
- target: props.mouseWheel ? rootRef : undefined,
117
166
  eventOptions: _supportsPassive.supportsPassive ? {
118
167
  passive: false
119
- } : false
168
+ } : undefined
120
169
  });
121
170
  let selectedIndex = null;
122
171
  function renderAccessible() {
@@ -129,13 +178,13 @@ const Wheel = (0, _react.memo)(props => {
129
178
  const previous = column[previousIndex];
130
179
  const next = column[nextIndex];
131
180
  return _react.default.createElement("div", {
132
- className: 'adm-picker-view-column-accessible'
181
+ className: `${classPrefix}-column-accessible`
133
182
  }, _react.default.createElement("div", {
134
- className: 'adm-picker-view-column-accessible-current',
183
+ className: `${classPrefix}-column-accessible-current`,
135
184
  role: 'button',
136
185
  "aria-label": current ? `当前选择的是:${current.label}` : '当前未选择'
137
186
  }, "-"), _react.default.createElement("div", {
138
- className: 'adm-picker-view-column-accessible-button',
187
+ className: `${classPrefix}-column-accessible-button`,
139
188
  onClick: () => {
140
189
  if (!previous) return;
141
190
  scrollSelect(previousIndex);
@@ -143,7 +192,7 @@ const Wheel = (0, _react.memo)(props => {
143
192
  role: previous ? 'button' : 'text',
144
193
  "aria-label": !previous ? '没有上一项' : `选择上一项:${previous.label}`
145
194
  }, "-"), _react.default.createElement("div", {
146
- className: 'adm-picker-view-column-accessible-button',
195
+ className: `${classPrefix}-column-accessible-button`,
147
196
  onClick: () => {
148
197
  if (!next) return;
149
198
  scrollSelect(nextIndex);
@@ -189,9 +238,7 @@ const Wheel = (0, _react.memo)(props => {
189
238
  if (prev.onSelect !== next.onSelect) return false;
190
239
  if (prev.renderLabel !== next.renderLabel) return false;
191
240
  if (prev.mouseWheel !== next.mouseWheel) return false;
192
- if (!(0, _isEqual.default)(prev.column, next.column)) {
193
- return false;
194
- }
241
+ if (!(0, _isEqual.default)(prev.column, next.column)) return false;
195
242
  return true;
196
243
  });
197
244
  exports.Wheel = Wheel;
@@ -1,5 +1,5 @@
1
1
  .adm-popover-menu {
2
- --border-color: #eeeeee;
2
+ --border-color: var(--adm-color-border);
3
3
  }
4
4
  .adm-popover-menu.adm-popover {
5
5
  --content-padding: 0;
@@ -47,6 +47,6 @@
47
47
  border-bottom: solid 1px var(--border-color);
48
48
  }
49
49
  .adm-popover.adm-popover-dark.adm-popover-menu {
50
- --border-color: #333333;
50
+ --border-color: var(--adm-color-text);
51
51
  --background: rgba(0, 0, 0, 0.9);
52
52
  }
@@ -21,7 +21,7 @@
21
21
  flex: none;
22
22
  width: calc(var(--text-width) + 8px);
23
23
  padding-left: 8px;
24
- color: #999999;
24
+ color: var(--adm-color-weak);
25
25
  }
26
26
  .adm-progress-bar-rounded .adm-progress-bar-trail,
27
27
  .adm-progress-bar-rounded .adm-progress-bar-fill {
@@ -149,7 +149,7 @@ const PullToRefresh = p => {
149
149
  enabled: !props.disabled,
150
150
  eventOptions: _supportsPassive.supportsPassive ? {
151
151
  passive: false
152
- } : false
152
+ } : undefined
153
153
  });
154
154
  const renderStatusText = () => {
155
155
  var _a;
@@ -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' | '--inactive-color'>;
12
+ } & NativeProps<'--star-size' | '--active-color' | '--inactive-color' | '--inactive-color-half'>;
13
13
  export declare const Rate: FC<RateProps>;
@@ -32,14 +32,14 @@ const Steps = p => {
32
32
  if (!_react.default.isValidElement(child)) {
33
33
  return child;
34
34
  }
35
- const props = child.props;
36
- let status = props.status || 'wait';
35
+ const childProps = child.props;
36
+ let status = childProps.status || 'wait';
37
37
  if (index < current) {
38
- status = props.status || 'finish';
38
+ status = childProps.status || 'finish';
39
39
  } else if (index === current) {
40
- status = props.status || 'process';
40
+ status = childProps.status || 'process';
41
41
  }
42
- const icon = (_a = props.icon) !== null && _a !== void 0 ? _a : defaultIcon;
42
+ const icon = (_a = childProps.icon) !== null && _a !== void 0 ? _a : defaultIcon;
43
43
  return _react.default.cloneElement(child, {
44
44
  status,
45
45
  icon
@@ -1,9 +1,10 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  import { PropagationEvent } from '../../utils/with-stop-propagation';
4
+ declare type SideType = 'left' | 'right';
4
5
  export declare type SwipeActionRef = {
5
6
  close: () => void;
6
- show: (side?: 'left' | 'right') => void;
7
+ show: (side?: SideType) => void;
7
8
  };
8
9
  declare type ActionColor = 'light' | 'weak' | 'primary' | 'success' | 'warning' | 'danger';
9
10
  export declare type Action = {
@@ -20,7 +21,7 @@ export declare type SwipeActionProps = {
20
21
  closeOnAction?: boolean;
21
22
  children: ReactNode;
22
23
  stopPropagation?: PropagationEvent[];
23
- onActionsReveal?: (side: 'left' | 'right') => void;
24
+ onActionsReveal?: (side: SideType) => void;
24
25
  } & NativeProps<'--background'>;
25
26
  export declare const SwipeAction: React.ForwardRefExoticComponent<{
26
27
  rightActions?: Action[] | undefined;
@@ -30,7 +31,7 @@ export declare const SwipeAction: React.ForwardRefExoticComponent<{
30
31
  closeOnAction?: boolean | undefined;
31
32
  children: ReactNode;
32
33
  stopPropagation?: "click"[] | undefined;
33
- onActionsReveal?: ((side: 'left' | 'right') => void) | undefined;
34
+ onActionsReveal?: ((side: SideType) => void) | undefined;
34
35
  } & {
35
36
  className?: string | undefined;
36
37
  style?: (React.CSSProperties & Partial<Record<"--background", string>>) | undefined;
@@ -11,7 +11,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  const classPrefix = `adm-tag`;
13
13
  const colorRecord = {
14
- default: '#666666',
14
+ default: 'var(--adm-color-text-secondary, #666666)',
15
15
  primary: 'var(--adm-color-primary, #1677ff)',
16
16
  success: 'var(--adm-color-success, #00b578)',
17
17
  warning: 'var(--adm-color-warning, #ff8f1f)',
@@ -86,12 +86,21 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
86
86
  className: `${classPrefix}-count`
87
87
  }, maxLength === undefined ? valueLength : valueLength + '/' + maxLength);
88
88
  }
89
+ let rows = props.rows;
90
+ if (typeof autoSize === 'object') {
91
+ if (autoSize.maxRows && rows > autoSize.maxRows) {
92
+ rows = autoSize.maxRows;
93
+ }
94
+ if (autoSize.minRows && rows < autoSize.minRows) {
95
+ rows = autoSize.minRows;
96
+ }
97
+ }
89
98
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
90
99
  className: classPrefix
91
100
  }, _react.default.createElement("textarea", {
92
101
  ref: nativeTextAreaRef,
93
102
  className: `${classPrefix}-element`,
94
- rows: props.rows,
103
+ rows: rows,
95
104
  value: value,
96
105
  placeholder: props.placeholder,
97
106
  onChange: e => {
@@ -128,7 +137,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
128
137
  ref: hiddenTextAreaRef,
129
138
  className: `${classPrefix}-element ${classPrefix}-element-hidden`,
130
139
  value: value,
131
- rows: props.rows,
140
+ rows: rows,
132
141
  "aria-hidden": true,
133
142
  readOnly: true
134
143
  })));
@@ -4,13 +4,13 @@
4
4
  left: 0;
5
5
  width: 100%;
6
6
  height: 100%;
7
+ text-align: center;
7
8
  }
8
9
  .adm-toast-mask .adm-toast-main {
9
10
  display: inline-block;
10
11
  position: relative;
11
12
  top: 50%;
12
- left: 50%;
13
- transform: translate(-50%, -50%);
13
+ transform: translateY(-50%);
14
14
  width: auto;
15
15
  max-width: 204px;
16
16
  max-height: 70%;
@@ -18,7 +18,7 @@ const defaultProps = {
18
18
  const WaterMark = p => {
19
19
  const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
20
20
  const {
21
- zIndex = 2000,
21
+ zIndex,
22
22
  gapX = 24,
23
23
  gapY = 48,
24
24
  width = 120,
@@ -8,7 +8,7 @@ export declare const base: {
8
8
  };
9
9
  Calendar: {
10
10
  markItems: string[];
11
- renderYearAndMonth: (year: number, month: number) => string;
11
+ yearAndMonth: string;
12
12
  };
13
13
  Cascader: {
14
14
  placeholder: string;
@@ -15,7 +15,7 @@ const base = {
15
15
  },
16
16
  Calendar: {
17
17
  markItems: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
18
- renderYearAndMonth: (year, month) => `${year}/${month}`
18
+ yearAndMonth: '${year}/${month}'
19
19
  },
20
20
  Cascader: {
21
21
  placeholder: 'Selecting'
@@ -8,7 +8,7 @@ declare const daDK: {
8
8
  };
9
9
  Calendar: {
10
10
  markItems: string[];
11
- renderYearAndMonth: (year: number, month: number) => string;
11
+ yearAndMonth: string;
12
12
  };
13
13
  Cascader: {
14
14
  placeholder: string;
@@ -17,7 +17,7 @@ const daDK = (0, _mergeLocale.mergeLocale)(_base.base, {
17
17
  },
18
18
  Calendar: {
19
19
  markItems: ['ma', 'ti', 'on', 'to', 'fr', 'lø', 'sø'],
20
- renderYearAndMonth: (year, month) => `${month}.${year}`
20
+ yearAndMonth: '${month}.${year}'
21
21
  },
22
22
  Cascader: {
23
23
  placeholder: 'Vælger'
@@ -8,7 +8,7 @@ declare const enUS: {
8
8
  };
9
9
  Calendar: {
10
10
  markItems: string[];
11
- renderYearAndMonth: (year: number, month: number) => string;
11
+ yearAndMonth: string;
12
12
  };
13
13
  Cascader: {
14
14
  placeholder: string;
@@ -8,7 +8,7 @@ declare const esES: {
8
8
  };
9
9
  Calendar: {
10
10
  markItems: string[];
11
- renderYearAndMonth: (year: number, month: number) => string;
11
+ yearAndMonth: string;
12
12
  };
13
13
  Cascader: {
14
14
  placeholder: string;
@@ -16,7 +16,7 @@ const esES = (0, _mergeLocale.mergeLocale)(_base.base, {
16
16
  },
17
17
  Calendar: {
18
18
  markItems: ['Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab', 'Dom'],
19
- renderYearAndMonth: (year, month) => `${year}/${month}`
19
+ yearAndMonth: '${year}/${month}'
20
20
  },
21
21
  Cascader: {
22
22
  placeholder: 'Seleccionando'
@@ -8,7 +8,7 @@ declare const faIR: {
8
8
  };
9
9
  Calendar: {
10
10
  markItems: string[];
11
- renderYearAndMonth: (year: number, month: number) => string;
11
+ yearAndMonth: string;
12
12
  };
13
13
  Cascader: {
14
14
  placeholder: string;
@@ -15,7 +15,7 @@ const faIR = (0, _mergeLocale.mergeLocale)(_base.base, {
15
15
  },
16
16
  Calendar: {
17
17
  markItems: ['شنبه', 'یک‌شنبه', 'دو‌شنبه', 'سه‌شنبه', 'چهار‌شنبه', 'پنج‌نشبه', 'جمعه'],
18
- renderYearAndMonth: (year, month) => `${year}/${month}`
18
+ yearAndMonth: '${year}/${month}'
19
19
  },
20
20
  Cascader: {
21
21
  placeholder: 'انتخاب کنید'
@@ -8,7 +8,7 @@ declare const frFR: {
8
8
  };
9
9
  Calendar: {
10
10
  markItems: string[];
11
- renderYearAndMonth: (year: number, month: number) => string;
11
+ yearAndMonth: string;
12
12
  };
13
13
  Cascader: {
14
14
  placeholder: string;
@@ -16,7 +16,7 @@ const frFR = (0, _mergeLocale.mergeLocale)(_base.base, {
16
16
  },
17
17
  Calendar: {
18
18
  markItems: ['un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept'],
19
- renderYearAndMonth: (year, month) => `${year}Année ${month}Mois`
19
+ yearAndMonth: '${year}Année ${month}Mois'
20
20
  },
21
21
  Cascader: {
22
22
  placeholder: 'Veuillez sélectionner'
@@ -8,7 +8,7 @@ declare const idID: {
8
8
  };
9
9
  Calendar: {
10
10
  markItems: string[];
11
- renderYearAndMonth: (year: number, month: number) => string;
11
+ yearAndMonth: string;
12
12
  };
13
13
  Cascader: {
14
14
  placeholder: string;
@@ -16,7 +16,7 @@ const idID = (0, _mergeLocale.mergeLocale)(_base.base, {
16
16
  },
17
17
  Calendar: {
18
18
  markItems: ['Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu', 'Minggu'],
19
- renderYearAndMonth: (year, month) => `${year} Tahun ${month} Bulan`
19
+ yearAndMonth: '${year} Tahun ${month} Bulan'
20
20
  },
21
21
  Cascader: {
22
22
  placeholder: 'Silahkan Pilih'