antd-mobile 5.7.0 → 5.8.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 (143) hide show
  1. package/2x/cjs/components/collapse/collapse.js +7 -0
  2. package/2x/cjs/components/dialog/confirm.js +9 -1
  3. package/2x/cjs/components/dialog/dialog.js +2 -2
  4. package/2x/cjs/components/form/form-item.d.ts +1 -1
  5. package/2x/cjs/components/form/form-item.js +6 -3
  6. package/2x/cjs/components/input/input.d.ts +3 -2
  7. package/2x/cjs/components/input/input.js +6 -0
  8. package/2x/cjs/components/modal/confirm.js +9 -1
  9. package/2x/cjs/components/modal/modal.js +2 -2
  10. package/2x/cjs/components/passcode-input/passcode-input.js +1 -1
  11. package/2x/cjs/components/popover/popover.js +6 -6
  12. package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +11 -1
  13. package/2x/cjs/components/result/result.d.ts +2 -2
  14. package/2x/cjs/components/search-bar/search-bar.js +7 -0
  15. package/2x/cjs/components/slider/slider.css +2 -0
  16. package/2x/cjs/components/slider/slider.d.ts +2 -1
  17. package/2x/cjs/components/slider/slider.js +3 -1
  18. package/2x/cjs/components/slider/thumb.d.ts +2 -1
  19. package/2x/cjs/components/slider/thumb.js +3 -2
  20. package/2x/cjs/components/text-area/text-area.d.ts +2 -2
  21. package/2x/cjs/components/text-area/text-area.js +1 -0
  22. package/2x/cjs/components/virtual-input/virtual-input.js +25 -14
  23. package/2x/cjs/locales/base.d.ts +7 -0
  24. package/2x/cjs/locales/base.js +8 -1
  25. package/2x/cjs/locales/en-US.d.ts +7 -0
  26. package/2x/cjs/locales/fa-IR.d.ts +102 -0
  27. package/2x/cjs/locales/fa-IR.js +109 -0
  28. package/2x/cjs/locales/zh-CN.d.ts +7 -0
  29. package/2x/cjs/locales/zh-CN.js +8 -1
  30. package/2x/cjs/locales/zh-HK.d.ts +102 -0
  31. package/2x/cjs/locales/zh-HK.js +59 -0
  32. package/2x/cjs/locales/zh-TW.d.ts +102 -0
  33. package/2x/cjs/locales/zh-TW.js +59 -0
  34. package/2x/es/components/collapse/collapse.js +7 -0
  35. package/2x/es/components/dialog/confirm.js +8 -1
  36. package/2x/es/components/dialog/dialog.js +2 -2
  37. package/2x/es/components/form/form-item.d.ts +1 -1
  38. package/2x/es/components/form/form-item.js +6 -3
  39. package/2x/es/components/input/input.d.ts +3 -2
  40. package/2x/es/components/input/input.js +6 -0
  41. package/2x/es/components/modal/confirm.js +8 -1
  42. package/2x/es/components/modal/modal.js +2 -2
  43. package/2x/es/components/passcode-input/passcode-input.js +1 -1
  44. package/2x/es/components/popover/popover.js +1 -1
  45. package/2x/es/components/pull-to-refresh/pull-to-refresh.js +10 -1
  46. package/2x/es/components/result/result.d.ts +2 -2
  47. package/2x/es/components/search-bar/search-bar.js +7 -0
  48. package/2x/es/components/slider/slider.css +2 -0
  49. package/2x/es/components/slider/slider.d.ts +2 -1
  50. package/2x/es/components/slider/slider.js +3 -1
  51. package/2x/es/components/slider/thumb.d.ts +2 -1
  52. package/2x/es/components/slider/thumb.js +3 -2
  53. package/2x/es/components/text-area/text-area.d.ts +2 -2
  54. package/2x/es/components/text-area/text-area.js +1 -0
  55. package/2x/es/components/virtual-input/virtual-input.js +23 -14
  56. package/2x/es/locales/base.d.ts +7 -0
  57. package/2x/es/locales/base.js +8 -1
  58. package/2x/es/locales/en-US.d.ts +7 -0
  59. package/2x/es/locales/fa-IR.d.ts +102 -0
  60. package/2x/es/locales/fa-IR.js +99 -0
  61. package/2x/es/locales/zh-CN.d.ts +7 -0
  62. package/2x/es/locales/zh-CN.js +8 -1
  63. package/2x/es/locales/zh-HK.d.ts +102 -0
  64. package/2x/es/locales/zh-HK.js +49 -0
  65. package/2x/es/locales/zh-TW.d.ts +102 -0
  66. package/2x/es/locales/zh-TW.js +49 -0
  67. package/2x/package.json +1 -1
  68. package/cjs/components/collapse/collapse.js +7 -0
  69. package/cjs/components/dialog/confirm.js +9 -1
  70. package/cjs/components/dialog/dialog.js +2 -2
  71. package/cjs/components/form/form-item.d.ts +1 -1
  72. package/cjs/components/form/form-item.js +6 -3
  73. package/cjs/components/input/input.d.ts +3 -2
  74. package/cjs/components/input/input.js +6 -0
  75. package/cjs/components/modal/confirm.js +9 -1
  76. package/cjs/components/modal/modal.js +2 -2
  77. package/cjs/components/passcode-input/passcode-input.js +1 -1
  78. package/cjs/components/popover/popover.js +6 -6
  79. package/cjs/components/pull-to-refresh/pull-to-refresh.js +11 -1
  80. package/cjs/components/result/result.d.ts +2 -2
  81. package/cjs/components/search-bar/search-bar.js +7 -0
  82. package/cjs/components/slider/slider.css +2 -0
  83. package/cjs/components/slider/slider.d.ts +2 -1
  84. package/cjs/components/slider/slider.js +3 -1
  85. package/cjs/components/slider/thumb.d.ts +2 -1
  86. package/cjs/components/slider/thumb.js +3 -2
  87. package/cjs/components/text-area/text-area.d.ts +2 -2
  88. package/cjs/components/text-area/text-area.js +1 -0
  89. package/cjs/components/virtual-input/virtual-input.js +25 -14
  90. package/cjs/locales/base.d.ts +7 -0
  91. package/cjs/locales/base.js +8 -1
  92. package/cjs/locales/en-US.d.ts +7 -0
  93. package/cjs/locales/fa-IR.d.ts +102 -0
  94. package/cjs/locales/fa-IR.js +109 -0
  95. package/cjs/locales/zh-CN.d.ts +7 -0
  96. package/cjs/locales/zh-CN.js +8 -1
  97. package/cjs/locales/zh-HK.d.ts +102 -0
  98. package/cjs/locales/zh-HK.js +59 -0
  99. package/cjs/locales/zh-TW.d.ts +102 -0
  100. package/cjs/locales/zh-TW.js +59 -0
  101. package/es/components/collapse/collapse.js +7 -0
  102. package/es/components/dialog/confirm.js +8 -1
  103. package/es/components/dialog/dialog.js +2 -2
  104. package/es/components/form/form-item.d.ts +1 -1
  105. package/es/components/form/form-item.js +6 -3
  106. package/es/components/input/input.d.ts +3 -2
  107. package/es/components/input/input.js +6 -0
  108. package/es/components/modal/confirm.js +8 -1
  109. package/es/components/modal/modal.js +2 -2
  110. package/es/components/passcode-input/passcode-input.js +1 -1
  111. package/es/components/popover/popover.js +1 -1
  112. package/es/components/pull-to-refresh/pull-to-refresh.js +10 -1
  113. package/es/components/result/result.d.ts +2 -2
  114. package/es/components/search-bar/search-bar.js +7 -0
  115. package/es/components/slider/slider.css +2 -0
  116. package/es/components/slider/slider.d.ts +2 -1
  117. package/es/components/slider/slider.js +3 -1
  118. package/es/components/slider/thumb.d.ts +2 -1
  119. package/es/components/slider/thumb.js +3 -2
  120. package/es/components/text-area/text-area.d.ts +2 -2
  121. package/es/components/text-area/text-area.js +1 -0
  122. package/es/components/virtual-input/virtual-input.js +23 -14
  123. package/es/locales/base.d.ts +7 -0
  124. package/es/locales/base.js +8 -1
  125. package/es/locales/en-US.d.ts +7 -0
  126. package/es/locales/fa-IR.d.ts +102 -0
  127. package/es/locales/fa-IR.js +99 -0
  128. package/es/locales/zh-CN.d.ts +7 -0
  129. package/es/locales/zh-CN.js +8 -1
  130. package/es/locales/zh-HK.d.ts +102 -0
  131. package/es/locales/zh-HK.js +49 -0
  132. package/es/locales/zh-TW.d.ts +102 -0
  133. package/es/locales/zh-TW.js +49 -0
  134. package/package.json +1 -1
  135. package/umd/antd-mobile.js +1 -1
  136. package/2x/cjs/components/popover/temp-floating-ui.min.d.ts +0 -1
  137. package/2x/cjs/components/popover/temp-floating-ui.min.js +0 -1
  138. package/2x/es/components/popover/temp-floating-ui.min.d.ts +0 -1
  139. package/2x/es/components/popover/temp-floating-ui.min.js +0 -1
  140. package/cjs/components/popover/temp-floating-ui.min.d.ts +0 -1
  141. package/cjs/components/popover/temp-floating-ui.min.js +0 -1
  142. package/es/components/popover/temp-floating-ui.min.d.ts +0 -1
  143. package/es/components/popover/temp-floating-ui.min.js +0 -1
@@ -50,6 +50,13 @@ const CollapsePanelContent = props => {
50
50
  }, api] = (0, _web.useSpring)(() => ({
51
51
  from: {
52
52
  height: 0
53
+ },
54
+ config: {
55
+ precision: 0.01,
56
+ mass: 1,
57
+ tension: 200,
58
+ friction: 25,
59
+ clamp: true
53
60
  }
54
61
  }));
55
62
  (0, _ahooks.useMount)(() => {
@@ -11,13 +11,21 @@ var _show = require("./show");
11
11
 
12
12
  var _withDefaultProps = require("../../utils/with-default-props");
13
13
 
14
+ var _configProvider = require("../config-provider");
15
+
14
16
  const defaultProps = {
15
17
  confirmText: '确认',
16
18
  cancelText: '取消'
17
19
  };
18
20
 
19
21
  function confirm(p) {
20
- const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
22
+ const {
23
+ locale
24
+ } = (0, _configProvider.getDefaultConfig)();
25
+ const props = (0, _withDefaultProps.mergeProps)(defaultProps, {
26
+ confirmText: locale.common.confirm,
27
+ cancelText: locale.common.cancel
28
+ }, p);
21
29
  return new Promise(resolve => {
22
30
  (0, _show.show)(Object.assign(Object.assign({}, props), {
23
31
  closeOnAction: true,
@@ -53,9 +53,9 @@ const Dialog = p => {
53
53
  scale: props.visible ? 1 : 0.8,
54
54
  opacity: props.visible ? 1 : 0,
55
55
  config: {
56
- mass: 1,
56
+ mass: 1.2,
57
57
  tension: 200,
58
- friction: 30,
58
+ friction: 25,
59
59
  clamp: true
60
60
  },
61
61
  onStart: () => {
@@ -17,7 +17,7 @@ export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePr
17
17
  hidden?: boolean;
18
18
  layout?: FormLayout;
19
19
  childElementPosition?: 'normal' | 'right';
20
- children: ChildrenType;
20
+ children?: ChildrenType;
21
21
  } & NativeProps;
22
22
  export declare const FormItem: FC<FormItemProps>;
23
23
  export {};
@@ -93,12 +93,15 @@ const FormItemLayout = props => {
93
93
  const labelElement = label ? _react.default.createElement("label", {
94
94
  className: `${classPrefix}-label`,
95
95
  htmlFor: htmlFor
96
- }, label, requiredMark, help && _react.default.createElement("span", {
97
- className: `${classPrefix}-label-help`
98
- }, _react.default.createElement(_popover.default, {
96
+ }, label, requiredMark, help && _react.default.createElement(_popover.default, {
99
97
  content: help,
100
98
  mode: 'dark',
101
99
  trigger: 'click'
100
+ }, _react.default.createElement("span", {
101
+ className: `${classPrefix}-label-help`,
102
+ onClick: e => {
103
+ e.preventDefault();
104
+ }
102
105
  }, _react.default.createElement(_antdMobileIcons.QuestionCircleOutline, null)))) : null;
103
106
 
104
107
  const description = _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", {
@@ -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' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd'> & {
4
+ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | '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;
@@ -20,8 +20,9 @@ export declare type InputRef = {
20
20
  clear: () => void;
21
21
  focus: () => void;
22
22
  blur: () => void;
23
+ nativeElement: HTMLInputElement | null;
23
24
  };
24
- export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
25
+ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength"> & {
25
26
  value?: string | undefined;
26
27
  defaultValue?: string | undefined;
27
28
  onChange?: ((val: string) => void) | undefined;
@@ -49,7 +49,12 @@ const Input = (0, _react.forwardRef)((p, ref) => {
49
49
  var _a;
50
50
 
51
51
  (_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
52
+ },
53
+
54
+ get nativeElement() {
55
+ return nativeInputRef.current;
52
56
  }
57
+
53
58
  }));
54
59
 
55
60
  const handleKeydown = e => {
@@ -117,6 +122,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
117
122
  max: props.max,
118
123
  min: props.min,
119
124
  autoComplete: props.autoComplete,
125
+ autoFocus: props.autoFocus,
120
126
  pattern: props.pattern,
121
127
  inputMode: props.inputMode,
122
128
  type: props.type,
@@ -11,13 +11,21 @@ var _show = require("./show");
11
11
 
12
12
  var _withDefaultProps = require("../../utils/with-default-props");
13
13
 
14
+ var _configProvider = require("../config-provider");
15
+
14
16
  const defaultProps = {
15
17
  confirmText: '确认',
16
18
  cancelText: '取消'
17
19
  };
18
20
 
19
21
  function confirm(p) {
20
- const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
22
+ const {
23
+ locale
24
+ } = (0, _configProvider.getDefaultConfig)();
25
+ const props = (0, _withDefaultProps.mergeProps)(defaultProps, {
26
+ confirmText: locale.common.confirm,
27
+ cancelText: locale.common.cancel
28
+ }, p);
21
29
  return new Promise(resolve => {
22
30
  (0, _show.show)(Object.assign(Object.assign({}, props), {
23
31
  closeOnAction: true,
@@ -58,9 +58,9 @@ const Modal = p => {
58
58
  scale: props.visible ? 1 : 0.8,
59
59
  opacity: props.visible ? 1 : 0,
60
60
  config: {
61
- mass: 1,
61
+ mass: 1.2,
62
62
  tension: 200,
63
- friction: 30,
63
+ friction: 25,
64
64
  clamp: true
65
65
  },
66
66
  onStart: () => {
@@ -46,7 +46,7 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
46
46
  if (value.length >= cellLength) {
47
47
  (_a = props.onFill) === null || _a === void 0 ? void 0 : _a.call(props, value);
48
48
  }
49
- }, [props.onFill, value, cellLength]);
49
+ }, [value, cellLength]);
50
50
 
51
51
  const onFocus = () => {
52
52
  var _a, _b;
@@ -23,7 +23,7 @@ var _arrow = require("./arrow");
23
23
 
24
24
  var _renderToContainer = require("../../utils/render-to-container");
25
25
 
26
- var _tempFloatingUiMin = require("./temp-floating-ui.min.js");
26
+ var _dom = require("@floating-ui/dom");
27
27
 
28
28
  var _wrapper = require("./wrapper");
29
29
 
@@ -98,13 +98,13 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
98
98
  y,
99
99
  placement: realPlacement,
100
100
  middlewareData
101
- } = yield (0, _tempFloatingUiMin.computePosition)(target, floating, {
101
+ } = yield (0, _dom.computePosition)(target, floating, {
102
102
  placement,
103
- middleware: [(0, _tempFloatingUiMin.offset)((0, _convertPx.convertPx)(12)), (0, _tempFloatingUiMin.shift)({
103
+ middleware: [(0, _dom.offset)((0, _convertPx.convertPx)(12)), (0, _dom.shift)({
104
104
  padding: (0, _convertPx.convertPx)(4),
105
105
  crossAxis: false,
106
- limiter: (0, _tempFloatingUiMin.limitShift)()
107
- }), (0, _tempFloatingUiMin.flip)(), (0, _tempFloatingUiMin.hide)(), (0, _tempFloatingUiMin.arrow)({
106
+ limiter: (0, _dom.limitShift)()
107
+ }), (0, _dom.flip)(), (0, _dom.hide)(), (0, _dom.arrow)({
108
108
  element: arrowElement,
109
109
  padding: (0, _convertPx.convertPx)(12)
110
110
  })]
@@ -161,7 +161,7 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
161
161
  (0, _react.useEffect)(() => {
162
162
  const floatingElement = floatingRef.current;
163
163
  if (!targetElement || !floatingElement) return;
164
- return (0, _tempFloatingUiMin.autoUpdate)(targetElement, floatingElement, update);
164
+ return (0, _dom.autoUpdate)(targetElement, floatingElement, update);
165
165
  }, [targetElement]);
166
166
  (0, _ahooks.useClickAway)(() => {
167
167
  if (!props.trigger) return;
@@ -23,6 +23,8 @@ var _convertPx = require("../../utils/convert-px");
23
23
 
24
24
  var _rubberband = require("../../utils/rubberband");
25
25
 
26
+ var _configProvider = require("../config-provider");
27
+
26
28
  var _sleep = require("../../utils/sleep");
27
29
 
28
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); }
@@ -44,7 +46,15 @@ exports.defaultProps = defaultProps;
44
46
  const PullToRefresh = p => {
45
47
  var _a, _b;
46
48
 
47
- const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
49
+ const {
50
+ locale
51
+ } = (0, _configProvider.useConfig)();
52
+ const props = (0, _withDefaultProps.mergeProps)(defaultProps, {
53
+ refreshingText: locale.common.loading,
54
+ pullingText: locale.PullToRefresh.pulling,
55
+ canReleaseText: locale.PullToRefresh.canRelease,
56
+ completeText: locale.PullToRefresh.complete
57
+ }, p);
48
58
  const headHeight = (_a = props.headHeight) !== null && _a !== void 0 ? _a : (0, _convertPx.convertPx)(40);
49
59
  const threshold = (_b = props.threshold) !== null && _b !== void 0 ? _b : (0, _convertPx.convertPx)(60);
50
60
  const [status, setStatus] = (0, _react2.useState)('pulling');
@@ -2,8 +2,8 @@ import { FC, ReactNode } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  export declare type ResultProps = {
4
4
  status: 'success' | 'error' | 'info' | 'waiting' | 'warning';
5
- title: string;
6
- description?: string;
5
+ title: ReactNode;
6
+ description?: ReactNode;
7
7
  icon?: ReactNode;
8
8
  } & NativeProps;
9
9
  export declare const Result: FC<ResultProps>;
@@ -62,7 +62,14 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
62
62
  var _a;
63
63
 
64
64
  return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
65
+ },
66
+
67
+ get nativeElement() {
68
+ var _a, _b;
69
+
70
+ return (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement) !== null && _b !== void 0 ? _b : null;
65
71
  }
72
+
66
73
  }));
67
74
 
68
75
  const renderCancelButton = () => {
@@ -50,6 +50,8 @@
50
50
  height: 44px;
51
51
  margin: 10px;
52
52
  border-radius: 50%;
53
+ text-align: center;
54
+ line-height: 44px;
53
55
  background: var(--adm-color-white);
54
56
  box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.12), 0 3px 6px -4px rgba(0, 0, 0, 0.25);
55
57
  }
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import React, { FC } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  import { SliderMarks } from './marks';
4
4
  export declare type SliderValue = number | [number, number];
@@ -12,6 +12,7 @@ export declare type SliderProps = {
12
12
  ticks?: boolean;
13
13
  disabled?: boolean;
14
14
  range?: boolean;
15
+ icon?: React.ReactNode;
15
16
  onChange?: (value: SliderValue) => void;
16
17
  onAfterChange?: (value: SliderValue) => void;
17
18
  } & NativeProps<'--fill-color'>;
@@ -49,7 +49,8 @@ const Slider = p => {
49
49
  disabled,
50
50
  marks,
51
51
  ticks,
52
- step
52
+ step,
53
+ icon
53
54
  } = props;
54
55
 
55
56
  function sortValue(val) {
@@ -149,6 +150,7 @@ const Slider = p => {
149
150
 
150
151
  const renderThumb = index => {
151
152
  return _react.default.createElement(_thumb.default, {
153
+ icon: icon,
152
154
  key: index,
153
155
  value: sliderValue[index],
154
156
  min: min,
@@ -1,4 +1,4 @@
1
- import { FC, RefObject } from 'react';
1
+ import React, { FC, RefObject } from 'react';
2
2
  declare type ThumbProps = {
3
3
  value: number;
4
4
  min: number;
@@ -6,6 +6,7 @@ declare type ThumbProps = {
6
6
  disabled: boolean;
7
7
  onDrag: (value: number, first: boolean, last: boolean) => void;
8
8
  trackRef: RefObject<HTMLDivElement>;
9
+ icon?: React.ReactNode;
9
10
  };
10
11
  declare const Thumb: FC<ThumbProps>;
11
12
  export default Thumb;
@@ -23,7 +23,8 @@ const Thumb = props => {
23
23
  min,
24
24
  max,
25
25
  disabled,
26
- onDrag
26
+ onDrag,
27
+ icon
27
28
  } = props;
28
29
  const prevValue = (0, _react.useRef)(value);
29
30
 
@@ -59,7 +60,7 @@ const Thumb = props => {
59
60
  style: currentPosition()
60
61
  }, bind()), _react.default.createElement("div", {
61
62
  className: `${classPrefix}-thumb`
62
- }, _react.default.createElement(_thumbIcon.ThumbIcon, {
63
+ }, icon ? icon : _react.default.createElement(_thumbIcon.ThumbIcon, {
63
64
  className: `${classPrefix}-thumb-icon`
64
65
  })));
65
66
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { ReactNode } from 'react';
3
3
  import { NativeProps } from '../../utils/native-props';
4
- export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd'> & {
4
+ export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd'> & {
5
5
  onChange?: (val: string) => void;
6
6
  value?: string;
7
7
  defaultValue?: string;
@@ -20,7 +20,7 @@ export declare type TextAreaRef = {
20
20
  focus: () => void;
21
21
  blur: () => void;
22
22
  };
23
- export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
23
+ export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
24
24
  onChange?: ((val: string) => void) | undefined;
25
25
  value?: string | undefined;
26
26
  defaultValue?: string | undefined;
@@ -127,6 +127,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
127
127
  (_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
128
128
  },
129
129
  autoComplete: props.autoComplete,
130
+ autoFocus: props.autoFocus,
130
131
  disabled: props.disabled,
131
132
  readOnly: props.readOnly,
132
133
  onFocus: props.onFocus,
@@ -84,6 +84,30 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
84
84
  (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props);
85
85
  }
86
86
 
87
+ const keyboard = props.keyboard;
88
+
89
+ const keyboardElement = keyboard && _react.default.cloneElement(keyboard, {
90
+ onInput: v => {
91
+ var _a, _b;
92
+
93
+ setValue(value + v);
94
+ (_b = (_a = keyboard.props).onInput) === null || _b === void 0 ? void 0 : _b.call(_a, v);
95
+ },
96
+ onDelete: () => {
97
+ var _a, _b;
98
+
99
+ setValue(value.slice(0, -1));
100
+ (_b = (_a = keyboard.props).onDelete) === null || _b === void 0 ? void 0 : _b.call(_a);
101
+ },
102
+ visible: hasFocus,
103
+ onClose: () => {
104
+ var _a, _b, _c;
105
+
106
+ (_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.blur();
107
+ (_c = (_b = keyboard.props).onClose) === null || _c === void 0 ? void 0 : _c.call(_b);
108
+ }
109
+ });
110
+
87
111
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
88
112
  ref: rootRef,
89
113
  className: (0, _classnames.default)(classPrefix, {
@@ -111,19 +135,6 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
111
135
  }
112
136
  }, _react.default.createElement(_antdMobileIcons.CloseCircleFill, null)), !value && _react.default.createElement("div", {
113
137
  className: `${classPrefix}-placeholder`
114
- }, props.placeholder), props.keyboard && _react.default.cloneElement(props.keyboard, {
115
- onInput: v => {
116
- setValue(value + v);
117
- },
118
- onDelete: () => {
119
- setValue(value.slice(0, -1));
120
- },
121
- visible: hasFocus,
122
- onClose: () => {
123
- var _a;
124
-
125
- (_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.blur();
126
- }
127
- })));
138
+ }, props.placeholder), keyboardElement));
128
139
  });
129
140
  exports.VirtualInput = VirtualInput;
@@ -1,7 +1,9 @@
1
1
  export declare const base: {
2
+ locale: string;
2
3
  common: {
3
4
  confirm: string;
4
5
  cancel: string;
6
+ loading: string;
5
7
  };
6
8
  Calendar: {
7
9
  markItems: string[];
@@ -91,5 +93,10 @@ export declare const base: {
91
93
  Modal: {
92
94
  ok: string;
93
95
  };
96
+ PullToRefresh: {
97
+ pulling: string;
98
+ canRelease: string;
99
+ complete: string;
100
+ };
94
101
  };
95
102
  export declare type Locale = typeof base;
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.base = void 0;
7
7
  const typeTemplate = '${label} is not a valid ${type}';
8
8
  const base = {
9
+ locale: 'en',
9
10
  common: {
10
11
  confirm: 'Confirm',
11
- cancel: 'Cancel'
12
+ cancel: 'Cancel',
13
+ loading: 'Loading...'
12
14
  },
13
15
  Calendar: {
14
16
  markItems: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
@@ -97,6 +99,11 @@ const base = {
97
99
  },
98
100
  Modal: {
99
101
  ok: 'OK'
102
+ },
103
+ PullToRefresh: {
104
+ pulling: 'Scroll down to refresh',
105
+ canRelease: 'Release to refresh immediately',
106
+ complete: 'Refresh successful'
100
107
  }
101
108
  };
102
109
  exports.base = base;
@@ -1,7 +1,9 @@
1
1
  declare const enUS: {
2
+ locale: string;
2
3
  common: {
3
4
  confirm: string;
4
5
  cancel: string;
6
+ loading: string;
5
7
  };
6
8
  Calendar: {
7
9
  markItems: string[];
@@ -91,5 +93,10 @@ declare const enUS: {
91
93
  Modal: {
92
94
  ok: string;
93
95
  };
96
+ PullToRefresh: {
97
+ pulling: string;
98
+ canRelease: string;
99
+ complete: string;
100
+ };
94
101
  };
95
102
  export default enUS;
@@ -0,0 +1,102 @@
1
+ declare const faIR: {
2
+ locale: string;
3
+ common: {
4
+ confirm: string;
5
+ cancel: string;
6
+ loading: string;
7
+ };
8
+ Calendar: {
9
+ markItems: string[];
10
+ renderYearAndMonth: (year: number, month: number) => string;
11
+ };
12
+ Cascader: {
13
+ placeholder: string;
14
+ };
15
+ Dialog: {
16
+ ok: string;
17
+ };
18
+ ErrorBlock: {
19
+ default: {
20
+ title: string;
21
+ description: string;
22
+ };
23
+ busy: {
24
+ title: string;
25
+ description: string;
26
+ };
27
+ disconnected: {
28
+ title: string;
29
+ description: string;
30
+ };
31
+ empty: {
32
+ title: string;
33
+ description: string;
34
+ };
35
+ };
36
+ Form: {
37
+ required: string;
38
+ optional: string;
39
+ defaultValidateMessages: {
40
+ default: string;
41
+ required: string;
42
+ enum: string;
43
+ whitespace: string;
44
+ date: {
45
+ format: string;
46
+ parse: string;
47
+ invalid: string;
48
+ };
49
+ types: {
50
+ string: string;
51
+ method: string;
52
+ array: string;
53
+ object: string;
54
+ number: string;
55
+ date: string;
56
+ boolean: string;
57
+ integer: string;
58
+ float: string;
59
+ regexp: string;
60
+ email: string;
61
+ url: string;
62
+ hex: string;
63
+ };
64
+ string: {
65
+ len: string;
66
+ min: string;
67
+ max: string;
68
+ range: string;
69
+ };
70
+ number: {
71
+ len: string;
72
+ min: string;
73
+ max: string;
74
+ range: string;
75
+ };
76
+ array: {
77
+ len: string;
78
+ min: string;
79
+ max: string;
80
+ range: string;
81
+ };
82
+ pattern: {
83
+ mismatch: string;
84
+ };
85
+ };
86
+ };
87
+ ImageUploader: {
88
+ uploading: string;
89
+ };
90
+ Mask: {
91
+ name: string;
92
+ };
93
+ Modal: {
94
+ ok: string;
95
+ };
96
+ PullToRefresh: {
97
+ pulling: string;
98
+ canRelease: string;
99
+ complete: string;
100
+ };
101
+ };
102
+ export default faIR;