@arco-design/mobile-react 2.38.3 → 2.38.4

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 (84) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/action-sheet/index.d.ts +0 -1
  5. package/cjs/date-picker/index.d.ts +1 -1
  6. package/cjs/date-picker/index.js +3 -0
  7. package/cjs/dialog/index.d.ts +0 -1
  8. package/cjs/form/form-item.d.ts +5 -4
  9. package/cjs/form/form-item.js +1 -1
  10. package/cjs/form/type.d.ts +2 -3
  11. package/cjs/form/useForm.d.ts +1 -1
  12. package/cjs/pull-refresh/android-pull-refresh.d.ts +1 -1
  13. package/cjs/pull-refresh/hooks.d.ts +2 -2
  14. package/cjs/pull-refresh/ios-pull-refresh.d.ts +1 -1
  15. package/cjs/pull-refresh/ios-pull-refresh.js +3 -1
  16. package/cjs/pull-refresh/model.d.ts +0 -1
  17. package/cjs/stepper/hooks/useValue.d.ts +1 -1
  18. package/cjs/stepper/type.d.ts +1 -1
  19. package/cjs/swipe-action/type.d.ts +1 -1
  20. package/cjs/uploader/upload/upload.d.ts +4 -4
  21. package/dist/index.js +1299 -1296
  22. package/dist/index.min.js +4 -4
  23. package/esm/action-sheet/index.d.ts +0 -1
  24. package/esm/date-picker/index.d.ts +1 -1
  25. package/esm/date-picker/index.js +3 -0
  26. package/esm/dialog/index.d.ts +0 -1
  27. package/esm/form/form-item.d.ts +5 -4
  28. package/esm/form/form-item.js +5 -5
  29. package/esm/form/type.d.ts +2 -3
  30. package/esm/form/useForm.d.ts +1 -1
  31. package/esm/form/useForm.js +3 -3
  32. package/esm/pull-refresh/android-pull-refresh.d.ts +1 -1
  33. package/esm/pull-refresh/android-pull-refresh.js +2 -2
  34. package/esm/pull-refresh/hooks.d.ts +2 -2
  35. package/esm/pull-refresh/hooks.js +2 -2
  36. package/esm/pull-refresh/ios-pull-refresh.d.ts +1 -1
  37. package/esm/pull-refresh/ios-pull-refresh.js +2 -1
  38. package/esm/pull-refresh/model.d.ts +0 -1
  39. package/esm/stepper/hooks/useValue.d.ts +1 -1
  40. package/esm/stepper/hooks/useValue.js +2 -2
  41. package/esm/stepper/type.d.ts +1 -1
  42. package/esm/swipe-action/type.d.ts +1 -1
  43. package/esm/uploader/upload/upload.d.ts +4 -4
  44. package/esm/uploader/upload/upload.js +3 -3
  45. package/esnext/action-sheet/index.d.ts +0 -1
  46. package/esnext/date-picker/index.d.ts +1 -1
  47. package/esnext/date-picker/index.js +5 -0
  48. package/esnext/dialog/index.d.ts +0 -1
  49. package/esnext/form/form-item.d.ts +5 -4
  50. package/esnext/form/form-item.js +11 -6
  51. package/esnext/form/type.d.ts +2 -3
  52. package/esnext/form/useForm.d.ts +1 -1
  53. package/esnext/form/useForm.js +4 -5
  54. package/esnext/pull-refresh/android-pull-refresh.d.ts +1 -1
  55. package/esnext/pull-refresh/android-pull-refresh.js +2 -2
  56. package/esnext/pull-refresh/hooks.d.ts +2 -2
  57. package/esnext/pull-refresh/hooks.js +3 -3
  58. package/esnext/pull-refresh/ios-pull-refresh.d.ts +1 -1
  59. package/esnext/pull-refresh/ios-pull-refresh.js +2 -1
  60. package/esnext/pull-refresh/model.d.ts +0 -1
  61. package/esnext/stepper/hooks/useValue.d.ts +1 -1
  62. package/esnext/stepper/hooks/useValue.js +2 -2
  63. package/esnext/stepper/type.d.ts +1 -1
  64. package/esnext/swipe-action/type.d.ts +1 -1
  65. package/esnext/uploader/upload/upload.d.ts +4 -4
  66. package/esnext/uploader/upload/upload.js +3 -3
  67. package/package.json +3 -3
  68. package/umd/action-sheet/index.d.ts +0 -1
  69. package/umd/date-picker/index.d.ts +1 -1
  70. package/umd/date-picker/index.js +3 -0
  71. package/umd/dialog/index.d.ts +0 -1
  72. package/umd/form/form-item.d.ts +5 -4
  73. package/umd/form/form-item.js +1 -1
  74. package/umd/form/type.d.ts +2 -3
  75. package/umd/form/useForm.d.ts +1 -1
  76. package/umd/pull-refresh/android-pull-refresh.d.ts +1 -1
  77. package/umd/pull-refresh/hooks.d.ts +2 -2
  78. package/umd/pull-refresh/ios-pull-refresh.d.ts +1 -1
  79. package/umd/pull-refresh/ios-pull-refresh.js +5 -5
  80. package/umd/pull-refresh/model.d.ts +0 -1
  81. package/umd/stepper/hooks/useValue.d.ts +1 -1
  82. package/umd/stepper/type.d.ts +1 -1
  83. package/umd/swipe-action/type.d.ts +1 -1
  84. package/umd/uploader/upload/upload.d.ts +4 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.38.4](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.38.3...@arco-design/mobile-react@2.38.4) (2025-12-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * `DatePicker` update data when currentTs change ([#360](https://github.com/arco-design/arco-design-mobile/issues/360)) ([fd9f6ed](https://github.com/arco-design/arco-design-mobile/commit/fd9f6eda15d49f9c9d5215f388b87ea45b9612f6))
12
+ * promise type ([#361](https://github.com/arco-design/arco-design-mobile/issues/361)) ([4409667](https://github.com/arco-design/arco-design-mobile/commit/4409667bad7e6dc7d8793bc2250814da55baeb68))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [2.38.3](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.38.2...@arco-design/mobile-react@2.38.3) (2025-12-05)
7
19
 
8
20
 
package/README.en-US.md CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="_b
59
59
  React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">Click here</a>**
60
60
 
61
61
  ```
62
- <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.38.2/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.38.2/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.38.3/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.38.3/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## Full import
package/README.md CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="
59
59
  React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">戳这里获取</a>**
60
60
 
61
61
  ```
62
- <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.38.2/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.38.2/dist/index.min.js"></script>
62
+ <link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.38.3/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.38.3/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## 引入全部
@@ -1,6 +1,5 @@
1
1
  import type { ReactNode, CSSProperties } from 'react';
2
2
  import React from 'react';
3
- import type { Promise } from 'es6-promise';
4
3
  import type { PopupProps, PopupRef } from '../popup';
5
4
  import type { OpenBaseProps } from '../masking';
6
5
  export interface ActionSheetItemOptions {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DatePickerProps } from './type';
2
+ import type { DatePickerProps } from './type';
3
3
  export * from './type';
4
4
  export declare const YEAR: number;
5
5
  export interface DatePickerRef {
@@ -490,6 +490,9 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
490
490
  (0, _react.useEffect)(function () {
491
491
  _updateRangeValue(currentTs);
492
492
  }, [currentTs]);
493
+ (0, _react.useEffect)(function () {
494
+ setCurrentTs(isRange ? Math.min(maxTs, Math.max(minTs, userSetCurrentTs[0])) : Math.min(maxTs, Math.max(minTs, userSetCurrentTs)));
495
+ }, [userSetCurrentTs, maxTs, minTs, isRange]);
493
496
  (0, _react.useEffect)(function () {
494
497
  if (visible) {
495
498
  // 初始化当前时间
@@ -1,7 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import React from 'react';
3
3
  import type { ILocale } from '@arco-design/mobile-utils';
4
- import type { Promise } from 'es6-promise';
5
4
  import type { MaskingCommonProps, MaskingRef, OpenBaseProps } from '../masking';
6
5
  export * from './methods';
7
6
  export interface FooterButtonOptions {
@@ -1,7 +1,8 @@
1
- import React, { PureComponent, ReactNode } from 'react';
2
- import { Promise } from 'es6-promise';
1
+ import type { ReactNode } from 'react';
2
+ import React, { PureComponent } from 'react';
3
3
  import { FormItemContext } from './form-item-context';
4
- import { IFieldError, FieldValue, IFormItemInnerProps, FormItemProps, ValidateStatus, FormItemRef, ValueChangeType, IFormItemContext } from './type';
4
+ import type { IFieldError, FieldValue, IFormItemInnerProps, FormItemProps, ValidateStatus, FormItemRef, IFormItemContext } from './type';
5
+ import { ValueChangeType } from './type';
5
6
  interface IFormItemInnerState {
6
7
  validateStatus: ValidateStatus;
7
8
  errors?: ReactNode[];
@@ -19,7 +20,7 @@ declare class FormItemInner extends PureComponent<IFormItemInnerProps, IFormItem
19
20
  changeType: ValueChangeType;
20
21
  } | undefined) => void;
21
22
  getInitialValue: () => any;
22
- getFieldError: () => React.ReactNode[];
23
+ getFieldError: () => ReactNode[];
23
24
  isFieldTouched: () => boolean;
24
25
  getAllRuleValidateTriggers: () => string[];
25
26
  validateField: (validateTrigger?: string | undefined) => Promise<IFieldError>;
@@ -142,7 +142,7 @@ var FormItemInner = /*#__PURE__*/function (_PureComponent) {
142
142
  warnings: warnings,
143
143
  errorTypes: errorTypes
144
144
  });
145
- return resolve({
145
+ resolve({
146
146
  errors: _this._errors,
147
147
  warnings: warnings,
148
148
  value: value,
@@ -1,6 +1,5 @@
1
- import { IRules } from '@arco-design/mobile-utils';
2
- import { ReactElement, ReactNode } from 'react';
3
- import { Promise } from 'es6-promise';
1
+ import type { IRules } from '@arco-design/mobile-utils';
2
+ import type { ReactElement, ReactNode } from 'react';
4
3
  export declare type FieldValue = any;
5
4
  export declare type FieldItem = Record<string, FieldValue>;
6
5
  export declare type ILayout = 'horizontal' | 'vertical' | 'inline';
@@ -1,3 +1,3 @@
1
- import { IFormInstance, InternalFormInstance } from './type';
1
+ import type { IFormInstance, InternalFormInstance } from './type';
2
2
  export declare const defaultFormDataMethods: InternalFormInstance;
3
3
  export default function useForm(form?: IFormInstance): IFormInstance[];
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { PullRefreshRef, PullRefreshBasicProps } from './model';
2
+ import type { PullRefreshRef, PullRefreshBasicProps } from './model';
3
3
  export declare const PullRefresh: React.ForwardRefExoticComponent<PullRefreshBasicProps & React.RefAttributes<PullRefreshRef>>;
@@ -1,5 +1,5 @@
1
1
  import type { RefObject } from 'react';
2
- import { Promise } from 'es6-promise';
2
+ import { Promise as ES6Promise } from 'es6-promise';
3
3
  import { PullRefreshStatus } from './model';
4
4
  export declare const useCommonState: ({ onRefresh, loosingMinHeight, }: {
5
5
  onRefresh?: (() => Promise<void>) | undefined;
@@ -13,7 +13,7 @@ export declare const useCommonState: ({ onRefresh, loosingMinHeight, }: {
13
13
  labelRef: RefObject<HTMLDivElement>;
14
14
  domRef: RefObject<HTMLDivElement>;
15
15
  loosingHeight: number;
16
- handleRefresh: () => Promise<[void | undefined, unknown]>;
16
+ handleRefresh: () => ES6Promise<[void | undefined, unknown]>;
17
17
  tipsHeight: number;
18
18
  };
19
19
  export declare const useAddScrollEvents: ({ domRef, handleTouchStart, handleTouchMove, handleTouchEnd, }: {
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { PullRefreshRef, PullRefreshBasicProps } from './model';
2
+ import type { PullRefreshRef, PullRefreshBasicProps } from './model';
3
3
  export declare const PullRefresh: React.ForwardRefExoticComponent<PullRefreshBasicProps & React.RefAttributes<PullRefreshRef>>;
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _mobileUtils = require("@arco-design/mobile-utils");
13
13
 
14
+ var _es6Promise = require("es6-promise");
15
+
14
16
  var _loading = _interopRequireDefault(require("../loading"));
15
17
 
16
18
  var _contextProvider = require("../context-provider");
@@ -143,7 +145,7 @@ var PullRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
143
145
  }, [disabled, ifShouldHandle]);
144
146
 
145
147
  var refresh = function refresh() {
146
- return new Promise(function (resolve) {
148
+ return new _es6Promise.Promise(function (resolve) {
147
149
  if (domRef.current) {
148
150
  domRef.current.style.overflow = 'hidden';
149
151
  var animationKey = new Date().getTime();
@@ -1,5 +1,4 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
- import { Promise } from 'es6-promise';
3
2
  export interface PullRefreshRef {
4
3
  /**
5
4
  * 最外层元素 DOM
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { StepperProps } from '..';
2
+ import type { StepperProps } from '..';
3
3
  export default function useValue(params: Required<Pick<StepperProps, 'defaultValue' | 'min' | 'max' | 'digits'>> & Pick<StepperProps, 'formatter' | 'value'>): {
4
4
  updateValue: (updater: number | ((oldValue: number) => number)) => void;
5
5
  actualInputValue: number;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  export interface StepperProps {
3
3
  /**
4
4
  * 自定义类名
@@ -1,4 +1,4 @@
1
- import { CSSProperties, ReactNode } from 'react';
1
+ import type { CSSProperties, ReactNode } from 'react';
2
2
  export interface SwipeActionProps {
3
3
  /**
4
4
  * 自定义类名
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
- import React from 'react';
3
- import { Promise } from 'es6-promise';
4
- import { AdapterFile, CommonFileItem, UploadCommonProps } from './type';
2
+ import type React from 'react';
3
+ import { Promise as ES6Promise } from 'es6-promise';
4
+ import type { AdapterFile, CommonFileItem, UploadCommonProps } from './type';
5
5
  export declare class Upload<FileItem extends CommonFileItem = CommonFileItem> {
6
6
  props: UploadCommonProps<FileItem>;
7
7
  fileRef: React.MutableRefObject<HTMLInputElement | null>;
@@ -17,4 +17,4 @@ export declare class Upload<FileItem extends CommonFileItem = CommonFileItem> {
17
17
  handleClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, file: FileItem, index: number) => void;
18
18
  handleTouchStart: (e: React.TouchEvent<HTMLDivElement>, image: FileItem, index: number) => void;
19
19
  }
20
- export declare const parseFile: (file: AdapterFile) => Promise<unknown>;
20
+ export declare const parseFile: (file: AdapterFile) => ES6Promise<unknown>;