@arco-design/mobile-react 2.38.2 → 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 (119) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/action-sheet/index.d.ts +10 -10
  5. package/cjs/action-sheet/index.js +6 -2
  6. package/cjs/action-sheet/methods.d.ts +2 -2
  7. package/cjs/cell/cell.d.ts +1 -1
  8. package/cjs/cell/cell.js +36 -7
  9. package/cjs/cell/style/css/index.css +46 -16
  10. package/cjs/cell/style/index.less +52 -11
  11. package/cjs/cell/type.d.ts +8 -1
  12. package/cjs/date-picker/index.d.ts +1 -1
  13. package/cjs/date-picker/index.js +3 -0
  14. package/cjs/dialog/index.d.ts +0 -1
  15. package/cjs/form/form-item.d.ts +5 -4
  16. package/cjs/form/form-item.js +1 -1
  17. package/cjs/form/type.d.ts +2 -3
  18. package/cjs/form/useForm.d.ts +1 -1
  19. package/cjs/pull-refresh/android-pull-refresh.d.ts +1 -1
  20. package/cjs/pull-refresh/hooks.d.ts +2 -2
  21. package/cjs/pull-refresh/ios-pull-refresh.d.ts +1 -1
  22. package/cjs/pull-refresh/ios-pull-refresh.js +3 -1
  23. package/cjs/pull-refresh/model.d.ts +0 -1
  24. package/cjs/stepper/hooks/useValue.d.ts +1 -1
  25. package/cjs/stepper/type.d.ts +1 -1
  26. package/cjs/swipe-action/type.d.ts +1 -1
  27. package/cjs/uploader/upload/upload.d.ts +4 -4
  28. package/dist/index.js +1337 -1301
  29. package/dist/index.min.js +4 -4
  30. package/dist/style.css +33 -8
  31. package/dist/style.min.css +1 -1
  32. package/esm/action-sheet/index.d.ts +10 -10
  33. package/esm/action-sheet/index.js +6 -2
  34. package/esm/action-sheet/methods.d.ts +2 -2
  35. package/esm/cell/cell.d.ts +1 -1
  36. package/esm/cell/cell.js +37 -8
  37. package/esm/cell/style/css/index.css +46 -16
  38. package/esm/cell/style/index.less +52 -11
  39. package/esm/cell/type.d.ts +8 -1
  40. package/esm/date-picker/index.d.ts +1 -1
  41. package/esm/date-picker/index.js +3 -0
  42. package/esm/dialog/index.d.ts +0 -1
  43. package/esm/form/form-item.d.ts +5 -4
  44. package/esm/form/form-item.js +5 -5
  45. package/esm/form/type.d.ts +2 -3
  46. package/esm/form/useForm.d.ts +1 -1
  47. package/esm/form/useForm.js +3 -3
  48. package/esm/pull-refresh/android-pull-refresh.d.ts +1 -1
  49. package/esm/pull-refresh/android-pull-refresh.js +2 -2
  50. package/esm/pull-refresh/hooks.d.ts +2 -2
  51. package/esm/pull-refresh/hooks.js +2 -2
  52. package/esm/pull-refresh/ios-pull-refresh.d.ts +1 -1
  53. package/esm/pull-refresh/ios-pull-refresh.js +2 -1
  54. package/esm/pull-refresh/model.d.ts +0 -1
  55. package/esm/stepper/hooks/useValue.d.ts +1 -1
  56. package/esm/stepper/hooks/useValue.js +2 -2
  57. package/esm/stepper/type.d.ts +1 -1
  58. package/esm/swipe-action/type.d.ts +1 -1
  59. package/esm/uploader/upload/upload.d.ts +4 -4
  60. package/esm/uploader/upload/upload.js +3 -3
  61. package/esnext/action-sheet/index.d.ts +10 -10
  62. package/esnext/action-sheet/index.js +7 -3
  63. package/esnext/action-sheet/methods.d.ts +2 -2
  64. package/esnext/cell/cell.d.ts +1 -1
  65. package/esnext/cell/cell.js +19 -3
  66. package/esnext/cell/style/css/index.css +46 -16
  67. package/esnext/cell/style/index.less +52 -11
  68. package/esnext/cell/type.d.ts +8 -1
  69. package/esnext/date-picker/index.d.ts +1 -1
  70. package/esnext/date-picker/index.js +5 -0
  71. package/esnext/dialog/index.d.ts +0 -1
  72. package/esnext/form/form-item.d.ts +5 -4
  73. package/esnext/form/form-item.js +11 -6
  74. package/esnext/form/type.d.ts +2 -3
  75. package/esnext/form/useForm.d.ts +1 -1
  76. package/esnext/form/useForm.js +4 -5
  77. package/esnext/pull-refresh/android-pull-refresh.d.ts +1 -1
  78. package/esnext/pull-refresh/android-pull-refresh.js +2 -2
  79. package/esnext/pull-refresh/hooks.d.ts +2 -2
  80. package/esnext/pull-refresh/hooks.js +3 -3
  81. package/esnext/pull-refresh/ios-pull-refresh.d.ts +1 -1
  82. package/esnext/pull-refresh/ios-pull-refresh.js +2 -1
  83. package/esnext/pull-refresh/model.d.ts +0 -1
  84. package/esnext/stepper/hooks/useValue.d.ts +1 -1
  85. package/esnext/stepper/hooks/useValue.js +2 -2
  86. package/esnext/stepper/type.d.ts +1 -1
  87. package/esnext/swipe-action/type.d.ts +1 -1
  88. package/esnext/uploader/upload/upload.d.ts +4 -4
  89. package/esnext/uploader/upload/upload.js +3 -3
  90. package/package.json +3 -3
  91. package/tokens/app/arcodesign/default/css-variables.less +2 -0
  92. package/tokens/app/arcodesign/default/index.d.ts +2 -0
  93. package/tokens/app/arcodesign/default/index.js +2 -0
  94. package/tokens/app/arcodesign/default/index.json +20 -0
  95. package/tokens/app/arcodesign/default/index.less +2 -0
  96. package/umd/action-sheet/index.d.ts +10 -10
  97. package/umd/action-sheet/index.js +6 -2
  98. package/umd/action-sheet/methods.d.ts +2 -2
  99. package/umd/cell/cell.d.ts +1 -1
  100. package/umd/cell/cell.js +36 -7
  101. package/umd/cell/style/css/index.css +46 -16
  102. package/umd/cell/style/index.less +52 -11
  103. package/umd/cell/type.d.ts +8 -1
  104. package/umd/date-picker/index.d.ts +1 -1
  105. package/umd/date-picker/index.js +3 -0
  106. package/umd/dialog/index.d.ts +0 -1
  107. package/umd/form/form-item.d.ts +5 -4
  108. package/umd/form/form-item.js +1 -1
  109. package/umd/form/type.d.ts +2 -3
  110. package/umd/form/useForm.d.ts +1 -1
  111. package/umd/pull-refresh/android-pull-refresh.d.ts +1 -1
  112. package/umd/pull-refresh/hooks.d.ts +2 -2
  113. package/umd/pull-refresh/ios-pull-refresh.d.ts +1 -1
  114. package/umd/pull-refresh/ios-pull-refresh.js +5 -5
  115. package/umd/pull-refresh/model.d.ts +0 -1
  116. package/umd/stepper/hooks/useValue.d.ts +1 -1
  117. package/umd/stepper/type.d.ts +1 -1
  118. package/umd/swipe-action/type.d.ts +1 -1
  119. package/umd/uploader/upload/upload.d.ts +4 -4
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import type React from 'react';
2
3
  export interface CellProps {
3
4
  /**
4
5
  * 自定义样式
@@ -60,6 +61,12 @@ export interface CellProps {
60
61
  * @default true
61
62
  */
62
63
  bordered?: boolean;
64
+ /**
65
+ * 是否启用点击态效果
66
+ * @en Whether to enable click effect
67
+ * @default false
68
+ */
69
+ clickable?: boolean;
63
70
  /**
64
71
  * 点击单元格事件回调
65
72
  * @en Callback for cell click event
@@ -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 @@
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>;
@@ -136,7 +136,7 @@
136
136
  warnings: warnings,
137
137
  errorTypes: errorTypes
138
138
  });
139
- return resolve({
139
+ resolve({
140
140
  errors: _this._errors,
141
141
  warnings: warnings,
142
142
  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>>;
@@ -1,16 +1,16 @@
1
1
  (function (global, factory) {
2
2
  if (typeof define === "function" && define.amd) {
3
- define(["exports", "@babel/runtime/helpers/extends", "react", "@arco-design/mobile-utils", "../loading", "../context-provider", "./model", "./hooks", "../_helpers"], factory);
3
+ define(["exports", "@babel/runtime/helpers/extends", "react", "@arco-design/mobile-utils", "es6-promise", "../loading", "../context-provider", "./model", "./hooks", "../_helpers"], factory);
4
4
  } else if (typeof exports !== "undefined") {
5
- factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("@arco-design/mobile-utils"), require("../loading"), require("../context-provider"), require("./model"), require("./hooks"), require("../_helpers"));
5
+ factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("@arco-design/mobile-utils"), require("es6-promise"), require("../loading"), require("../context-provider"), require("./model"), require("./hooks"), require("../_helpers"));
6
6
  } else {
7
7
  var mod = {
8
8
  exports: {}
9
9
  };
10
- factory(mod.exports, global._extends, global.react, global.mobileUtils, global.loading, global.contextProvider, global.model, global.hooks, global._helpers);
10
+ factory(mod.exports, global._extends, global.react, global.mobileUtils, global.es6Promise, global.loading, global.contextProvider, global.model, global.hooks, global._helpers);
11
11
  global.iosPullRefresh = mod.exports;
12
12
  }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _react, _mobileUtils, _loading, _contextProvider, _model, _hooks, _helpers) {
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _react, _mobileUtils, _es6Promise, _loading, _contextProvider, _model, _hooks, _helpers) {
14
14
  "use strict";
15
15
 
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -143,7 +143,7 @@
143
143
  }, [disabled, ifShouldHandle]);
144
144
 
145
145
  var refresh = function refresh() {
146
- return new Promise(function (resolve) {
146
+ return new _es6Promise.Promise(function (resolve) {
147
147
  if (domRef.current) {
148
148
  domRef.current.style.overflow = 'hidden';
149
149
  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>;