@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,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,5 +1,5 @@
1
1
  import { useState } from 'react';
2
- import { Promise } from 'es6-promise';
2
+ import { Promise as ES6Promise } from 'es6-promise';
3
3
  export default function useValue(params) {
4
4
  var defaultValue = params.defaultValue,
5
5
  formatter = params.formatter,
@@ -16,7 +16,7 @@ export default function useValue(params) {
16
16
  var tempValue = typeof updater === 'function' ? updater(innerValue) : updater;
17
17
 
18
18
  if (formatter) {
19
- new Promise(function (resolve) {
19
+ new ES6Promise(function (resolve) {
20
20
  resolve(formatter(Number(tempValue)));
21
21
  }).then(function (result) {
22
22
  var res = Math.max(min, Math.min(max, result));
@@ -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>;
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import { Promise } from 'es6-promise';
2
+ import { Promise as ES6Promise } from 'es6-promise';
3
3
  export var Upload = /*#__PURE__*/function () {
4
4
  // click && longPress
5
5
  function Upload(props, fileRef, cacheRef) {
@@ -11,7 +11,7 @@ export var Upload = /*#__PURE__*/function () {
11
11
  this.timeOutEvent = void 0;
12
12
 
13
13
  this.handleFile = function (newFiles) {
14
- Promise.all(newFiles.map(function (file) {
14
+ ES6Promise.all(newFiles.map(function (file) {
15
15
  return parseFile(file);
16
16
  })).then(function (parseFiles) {
17
17
  var res = parseFiles.map(function (url, index) {
@@ -147,7 +147,7 @@ export var Upload = /*#__PURE__*/function () {
147
147
  return Upload;
148
148
  }();
149
149
  export var parseFile = function parseFile(file) {
150
- return new Promise(function (resolve, reject) {
150
+ return new ES6Promise(function (resolve, reject) {
151
151
  if (file.url) {
152
152
  resolve(file.url);
153
153
  } else {
@@ -1,7 +1,7 @@
1
- import React, { ReactNode, CSSProperties } from 'react';
2
- import { Promise } from 'es6-promise';
3
- import { PopupProps } from '../popup';
4
- import { OpenBaseProps } from '../masking';
1
+ import type { ReactNode, CSSProperties } from 'react';
2
+ import React from 'react';
3
+ import type { PopupProps, PopupRef } from '../popup';
4
+ import type { OpenBaseProps } from '../masking';
5
5
  export interface ActionSheetItemOptions {
6
6
  /**
7
7
  * 选项文字内容
@@ -29,7 +29,7 @@ export interface ActionSheetItemOptions {
29
29
  */
30
30
  onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => (void | boolean) | Promise<void | boolean>;
31
31
  }
32
- export interface ActionSheetProps extends Omit<PopupProps, 'children' | 'getScrollContainer' | 'orientationDirection' | 'direction'> {
32
+ export interface ActionSheetProps extends Omit<PopupProps, 'children' | 'orientationDirection' | 'direction'> {
33
33
  /**
34
34
  * 选项配置,详情见 ActionSheetItemOptions
35
35
  * @en Option setting, see ActionSheetItemOptions for details
@@ -57,12 +57,12 @@ export interface ActionSheetProps extends Omit<PopupProps, 'children' | 'getScro
57
57
  */
58
58
  needBottomOffset?: boolean;
59
59
  }
60
- export interface ActionSheetRef {
60
+ export interface ActionSheetRef extends PopupRef {
61
61
  /**
62
- * 最外层元素 DOM
62
+ * 菜单列表元素 DOM
63
63
  * @en The outermost element DOM
64
64
  */
65
- dom: HTMLDivElement | null;
65
+ actionList: HTMLDivElement | null;
66
66
  }
67
67
  export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.FunctionComponent<P>): {
68
68
  /**
@@ -87,11 +87,11 @@ declare const _default: React.ForwardRefExoticComponent<ActionSheetProps & React
87
87
  * @param {ActionSheetProps} config setting
88
88
  * @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => void; }}
89
89
  */
90
- open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "className" | "context" | "translateZ" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
90
+ open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "className" | "context" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
91
91
  key?: string | undefined;
92
92
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
93
93
  close: () => void;
94
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "className" | "context" | "translateZ" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
94
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "className" | "context" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
95
95
  key?: string | undefined;
96
96
  }) => void;
97
97
  };
@@ -1,4 +1,4 @@
1
- import React, { useRef, forwardRef, useImperativeHandle, } from 'react';
1
+ import React, { useRef, forwardRef, useImperativeHandle } from 'react';
2
2
  import { cls, componentWrapper } from '@arco-design/mobile-utils';
3
3
  import { ContextLayout, CompWithGlobalContext } from '../context-provider';
4
4
  import Popup from '../popup';
@@ -6,7 +6,11 @@ import { open } from './methods';
6
6
  const ActionSheet = forwardRef((props, ref) => {
7
7
  const { className = '', items, cancelText, close, title, subTitle, needBottomOffset = true, ...otherProps } = props;
8
8
  const popupRef = useRef(null);
9
- useImperativeHandle(ref, () => popupRef.current);
9
+ const listRef = useRef(null);
10
+ useImperativeHandle(ref, () => ({
11
+ ...popupRef.current,
12
+ actionList: listRef.current,
13
+ }));
10
14
  function handleItemClick(e, item) {
11
15
  e.stopPropagation();
12
16
  if (item.status === 'disabled') {
@@ -24,7 +28,7 @@ const ActionSheet = forwardRef((props, ref) => {
24
28
  title || subTitle ? (React.createElement("div", { className: `${prefixCls}-action-sheet-header` },
25
29
  title ? (React.createElement("div", { className: `${prefixCls}-action-sheet-title` }, title)) : null,
26
30
  subTitle ? (React.createElement("div", { className: `${prefixCls}-action-sheet-sub-title` }, subTitle)) : null)) : null,
27
- React.createElement("div", { className: `${prefixCls}-action-sheet-list` }, (items || []).map((item, index) => item.content ? (React.createElement("div", { className: cls(`${prefixCls}-action-sheet-item`, item.className, item.status || 'normal'), key: index, style: item.style, onClick: e => handleItemClick(e, item) }, item.content)) : null)),
31
+ React.createElement("div", { className: `${prefixCls}-action-sheet-list`, ref: listRef }, (items || []).map((item, index) => item.content ? (React.createElement("div", { className: cls(`${prefixCls}-action-sheet-item`, item.className, item.status || 'normal'), key: index, style: item.style, onClick: e => handleItemClick(e, item) }, item.content)) : null)),
28
32
  cancelText ? (React.createElement("div", { className: `${prefixCls}-action-sheet-item cancel-item`, onClick: e => {
29
33
  e.stopPropagation();
30
34
  close?.(e);
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { OpenBaseProps } from '../masking/methods';
1
+ import type React from 'react';
2
+ import type { OpenBaseProps } from '../masking/methods';
3
3
  export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
4
4
  key?: string | undefined;
5
5
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { CellProps, CellRef } from './type';
2
+ import type { CellProps, CellRef } from './type';
3
3
  export declare const Cell: React.ForwardRefExoticComponent<CellProps & React.RefAttributes<CellRef>>;
@@ -1,15 +1,31 @@
1
- import React, { useRef, forwardRef, useImperativeHandle } from 'react';
1
+ import React, { useRef, forwardRef, useImperativeHandle, useState } from 'react';
2
2
  import { cls } from '@arco-design/mobile-utils';
3
3
  import { ContextLayout } from '../context-provider';
4
4
  import Arrow from './arrow';
5
5
  import { GroupContext } from './group';
6
6
  export const Cell = forwardRef((props, ref) => {
7
- const { className = '', style, icon, label, desc, text, children, showArrow, arrow, prepend, append, bordered = true, onClick, } = props;
7
+ const { className = '', style, icon, label, desc, text, children, showArrow, arrow, prepend, append, bordered = true, onClick, clickable = false, } = props;
8
8
  const domRef = useRef(null);
9
+ const [isPressed, setIsPressed] = useState(false);
9
10
  useImperativeHandle(ref, () => ({
10
11
  dom: domRef.current,
11
12
  }));
12
- return (React.createElement(ContextLayout, null, ({ prefixCls }) => (React.createElement(GroupContext.Consumer, null, ({ isFromGroup }) => (React.createElement("div", { className: cls(`${prefixCls}-cell`, 'all-border-box', { 'without-group': !isFromGroup }, { bordered }, className), style: style, ref: domRef, onClick: e => onClick && onClick(e) },
13
+ const handleTouchStart = () => {
14
+ if (clickable) {
15
+ setIsPressed(true);
16
+ }
17
+ };
18
+ const handleTouchEnd = () => {
19
+ if (clickable) {
20
+ setIsPressed(false);
21
+ }
22
+ };
23
+ const handleClick = (e) => {
24
+ if (onClick) {
25
+ onClick(e);
26
+ }
27
+ };
28
+ return (React.createElement(ContextLayout, null, ({ prefixCls }) => (React.createElement(GroupContext.Consumer, null, ({ isFromGroup }) => (React.createElement("div", { className: cls(`${prefixCls}-cell`, 'all-border-box', { bordered }, { 'without-group': !isFromGroup }, { [`${prefixCls}-cell-without-group`]: !isFromGroup }, { [`${prefixCls}-cell-clickable`]: clickable }, { [`${prefixCls}-cell-pressed`]: isPressed }, className), style: style, ref: domRef, onClick: handleClick, onTouchStart: handleTouchStart, onTouchEnd: handleTouchEnd, onTouchCancel: handleTouchEnd },
13
29
  prepend,
14
30
  React.createElement("div", { className: cls(`${prefixCls}-cell-inner`, { 'has-desc': desc }) },
15
31
  icon ? React.createElement("div", { className: "cell-label-icon" }, icon) : null,
@@ -569,16 +569,40 @@
569
569
  border-radius: 0;
570
570
  }
571
571
  }
572
- .arco-cell.without-group {
572
+ .arco-cell-clickable {
573
+ -webkit-user-select: none;
574
+ user-select: none;
575
+ -webkit-tap-highlight-color: transparent;
576
+ -webkit-touch-callout: none;
577
+ touch-action: manipulation;
578
+ position: relative;
579
+ }
580
+ .arco-cell-clickable.arco-cell-pressed {
581
+ background-color: #F7F8FA ;
582
+ }
583
+ .arco-cell-clickable::after {
584
+ content: '';
585
+ position: absolute;
586
+ top: 0;
587
+ right: 100%;
588
+ width: 0.32rem ;
589
+ height: 100%;
590
+ background-color: inherit;
591
+ pointer-events: none;
592
+ }
593
+ .arco-cell-clickable.arco-cell-pressed::after {
594
+ background-color: #F7F8FA ;
595
+ }
596
+ .arco-cell-without-group {
573
597
  background-color: #FFFFFF ;
574
598
  padding-left: 0.32rem ;
575
599
  margin-left: 0;
576
600
  }
577
- .arco-cell.without-group.bordered {
601
+ .arco-cell-without-group.bordered {
578
602
  position: relative;
579
603
  border-width: 0;
580
604
  }
581
- .arco-cell.without-group.bordered::before {
605
+ .arco-cell-without-group.bordered::before {
582
606
  content: '';
583
607
  width: 100%;
584
608
  height: 1PX;
@@ -596,20 +620,20 @@
596
620
  border-radius: 0;
597
621
  }
598
622
  @media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
599
- .arco-cell.without-group.bordered::before {
623
+ .arco-cell-without-group.bordered::before {
600
624
  transform: scaleY(0.5);
601
625
  -webkit-transform: scaleY(0.5);
602
626
  border-radius: 0;
603
627
  }
604
628
  }
605
629
  @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
606
- .arco-cell.without-group.bordered::before {
630
+ .arco-cell-without-group.bordered::before {
607
631
  transform: scaleY(0.33333333);
608
632
  -webkit-transform: scaleY(0.33333333);
609
633
  border-radius: 0;
610
634
  }
611
635
  }
612
- .arco-cell.without-group.bordered::after {
636
+ .arco-cell-without-group.bordered::after {
613
637
  content: '';
614
638
  width: 100%;
615
639
  height: 1PX;
@@ -627,14 +651,14 @@
627
651
  border-radius: 0;
628
652
  }
629
653
  @media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
630
- .arco-cell.without-group.bordered::after {
654
+ .arco-cell-without-group.bordered::after {
631
655
  transform: scaleY(0.5);
632
656
  -webkit-transform: scaleY(0.5);
633
657
  border-radius: 0;
634
658
  }
635
659
  }
636
660
  @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
637
- .arco-cell.without-group.bordered::after {
661
+ .arco-cell-without-group.bordered::after {
638
662
  transform: scaleY(0.33333333);
639
663
  -webkit-transform: scaleY(0.33333333);
640
664
  border-radius: 0;
@@ -866,14 +890,20 @@
866
890
  border-radius: 0;
867
891
  }
868
892
  }
869
- .arco-theme-dark .arco-cell.without-group {
893
+ .arco-theme-dark .arco-cell-clickable.arco-cell-pressed {
894
+ background-color: hsla(0, 0%, 100%, 0.08) ;
895
+ }
896
+ .arco-theme-dark .arco-cell-clickable.arco-cell-pressed::after {
897
+ background-color: hsla(0, 0%, 100%, 0.08) ;
898
+ }
899
+ .arco-theme-dark .arco-cell-without-group {
870
900
  background-color: #232324 ;
871
901
  }
872
- .arco-theme-dark .arco-cell.without-group.bordered {
902
+ .arco-theme-dark .arco-cell-without-group.bordered {
873
903
  position: relative;
874
904
  border-width: 0;
875
905
  }
876
- .arco-theme-dark .arco-cell.without-group.bordered::before {
906
+ .arco-theme-dark .arco-cell-without-group.bordered::before {
877
907
  content: '';
878
908
  width: 100%;
879
909
  height: 1PX;
@@ -891,20 +921,20 @@
891
921
  border-radius: 0;
892
922
  }
893
923
  @media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
894
- .arco-theme-dark .arco-cell.without-group.bordered::before {
924
+ .arco-theme-dark .arco-cell-without-group.bordered::before {
895
925
  transform: scaleY(0.5);
896
926
  -webkit-transform: scaleY(0.5);
897
927
  border-radius: 0;
898
928
  }
899
929
  }
900
930
  @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
901
- .arco-theme-dark .arco-cell.without-group.bordered::before {
931
+ .arco-theme-dark .arco-cell-without-group.bordered::before {
902
932
  transform: scaleY(0.33333333);
903
933
  -webkit-transform: scaleY(0.33333333);
904
934
  border-radius: 0;
905
935
  }
906
936
  }
907
- .arco-theme-dark .arco-cell.without-group.bordered::after {
937
+ .arco-theme-dark .arco-cell-without-group.bordered::after {
908
938
  content: '';
909
939
  width: 100%;
910
940
  height: 1PX;
@@ -922,14 +952,14 @@
922
952
  border-radius: 0;
923
953
  }
924
954
  @media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
925
- .arco-theme-dark .arco-cell.without-group.bordered::after {
955
+ .arco-theme-dark .arco-cell-without-group.bordered::after {
926
956
  transform: scaleY(0.5);
927
957
  -webkit-transform: scaleY(0.5);
928
958
  border-radius: 0;
929
959
  }
930
960
  }
931
961
  @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
932
- .arco-theme-dark .arco-cell.without-group.bordered::after {
962
+ .arco-theme-dark .arco-cell-without-group.bordered::after {
933
963
  transform: scaleY(0.33333333);
934
964
  -webkit-transform: scaleY(0.33333333);
935
965
  border-radius: 0;
@@ -10,15 +10,42 @@
10
10
  .onepx-border-var(top, line-color);
11
11
  }
12
12
 
13
- &.without-group {
13
+ &-clickable {
14
+ user-select: none;
15
+ -webkit-tap-highlight-color: transparent;
16
+ -webkit-touch-callout: none;
17
+ touch-action: manipulation;
18
+ position: relative;
19
+
20
+ &.@{prefix}-cell-pressed {
21
+ .use-var(background-color, cell-clickable-background-color);
22
+ }
23
+
24
+ &::after {
25
+ content: '';
26
+ position: absolute;
27
+ top: 0;
28
+ right: 100%;
29
+ .use-var(width, cell-horizontal-padding);
30
+ height: 100%;
31
+ background-color: inherit;
32
+ pointer-events: none;
33
+ }
34
+
35
+ &.@{prefix}-cell-pressed::after {
36
+ .use-var(background-color, cell-clickable-background-color);
37
+ }
38
+ }
39
+
40
+ &-without-group {
14
41
  .use-var(background-color, cell-background-color);
15
42
  .use-var(padding-left, cell-horizontal-padding);
16
43
  margin-left: 0;
44
+ }
17
45
 
18
- &.bordered {
19
- .onepx-border-var(top, line-color);
20
- .onepx-border-var(bottom, line-color);
21
- }
46
+ &-without-group.bordered {
47
+ .onepx-border-var(top, line-color);
48
+ .onepx-border-var(bottom, line-color);
22
49
  }
23
50
 
24
51
  &-inner {
@@ -63,6 +90,7 @@
63
90
  .cell-label-icon {
64
91
  .use-var-with-rtl(margin-right, cell-label-icon-gutter);
65
92
  font-size: 0;
93
+
66
94
  .@{prefix}-icon {
67
95
  line-height: initial;
68
96
  .use-var(font-size, cell-label-icon-font-size);
@@ -76,6 +104,7 @@
76
104
  });
77
105
  .use-var-with-rtl(margin-left, cell-arrow-gutter);
78
106
  font-size: 0;
107
+
79
108
  .@{prefix}-icon {
80
109
  .use-var(font-size, cell-arrow-font-size);
81
110
  .use-var(color, cell-arrow-color);
@@ -148,17 +177,29 @@
148
177
  .onepx-border-var(top, dark-line-color);
149
178
  }
150
179
  }
151
- &.without-group {
152
- @{arco-dark-mode-selector} & {
153
- .use-var(background-color, dark-cell-background-color);
180
+ &-clickable {
181
+ &.@{prefix}-cell-pressed {
182
+ @{arco-dark-mode-selector} & {
183
+ .use-var(background-color, dark-cell-clickable-background-color);
184
+ }
154
185
  }
155
- &.bordered {
186
+ &.@{prefix}-cell-pressed::after {
156
187
  @{arco-dark-mode-selector} & {
157
- .onepx-border-var(top, dark-line-color);
158
- .onepx-border-var(bottom, dark-line-color);
188
+ .use-var(background-color, dark-cell-clickable-background-color);
159
189
  }
160
190
  }
161
191
  }
192
+ &-without-group {
193
+ @{arco-dark-mode-selector} & {
194
+ .use-var(background-color, dark-cell-background-color);
195
+ }
196
+ }
197
+ &-without-group.bordered {
198
+ @{arco-dark-mode-selector} & {
199
+ .onepx-border-var(top, dark-line-color);
200
+ .onepx-border-var(bottom, dark-line-color);
201
+ }
202
+ }
162
203
  .cell-label {
163
204
  @{arco-dark-mode-selector} & {
164
205
  .use-var(color, dark-cell-label-color);
@@ -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 {
@@ -329,6 +329,11 @@ const DatePicker = forwardRef((props, ref) => {
329
329
  useEffect(() => {
330
330
  _updateRangeValue(currentTs);
331
331
  }, [currentTs]);
332
+ useEffect(() => {
333
+ setCurrentTs(isRange
334
+ ? Math.min(maxTs, Math.max(minTs, userSetCurrentTs[0]))
335
+ : Math.min(maxTs, Math.max(minTs, userSetCurrentTs)));
336
+ }, [userSetCurrentTs, maxTs, minTs, isRange]);
332
337
  useEffect(() => {
333
338
  if (visible) {
334
339
  // 初始化当前时间
@@ -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>;
@@ -1,10 +1,9 @@
1
- /* eslint-disable react/no-unused-class-component-methods */
2
1
  import React, { forwardRef, PureComponent, useContext, useImperativeHandle, useRef, useState, } from 'react';
3
2
  import { cls, Validator, ValidatorType } from '@arco-design/mobile-utils';
4
- import { Promise } from 'es6-promise';
3
+ import { Promise as ES6Promise } from 'es6-promise';
5
4
  import { FormItemContext } from './form-item-context';
6
5
  import { GlobalContext } from '../context-provider';
7
- import { FormInternalComponentType, ValueChangeType, } from './type';
6
+ import { ValueChangeType, FormInternalComponentType } from './type';
8
7
  import { getDefaultValueForInterComponent, getErrorAndWarnings, isFieldRequired } from './utils';
9
8
  import { DefaultDatePickerLinkedContainer, DefaultPickerLinkedContainer } from './linked-container';
10
9
  class FormItemInner extends PureComponent {
@@ -64,7 +63,7 @@ class FormItemInner extends PureComponent {
64
63
  if (curRules?.length && field) {
65
64
  const fieldDom = this.props.getFormItemRef();
66
65
  const fieldValidator = new Validator({ [field]: curRules }, { validateMessages });
67
- return new Promise(resolve => {
66
+ return new ES6Promise(resolve => {
68
67
  fieldValidator.validate({ [field]: value }, (errorsMap) => {
69
68
  const { errors, warnings, errorTypes } = getErrorAndWarnings(errorsMap?.[field] || []);
70
69
  this._errors = errors;
@@ -73,7 +72,7 @@ class FormItemInner extends PureComponent {
73
72
  warnings,
74
73
  errorTypes,
75
74
  });
76
- return resolve({
75
+ resolve({
77
76
  errors: this._errors,
78
77
  warnings,
79
78
  value,
@@ -83,7 +82,13 @@ class FormItemInner extends PureComponent {
83
82
  });
84
83
  });
85
84
  }
86
- return Promise.resolve({ errors: [], warnings: [], value, field, dom: null });
85
+ return ES6Promise.resolve({
86
+ errors: [],
87
+ warnings: [],
88
+ value,
89
+ field,
90
+ dom: null,
91
+ });
87
92
  };
88
93
  this.setFieldData = (value) => {
89
94
  const { field, trigger = 'onChange' } = this.props;
@@ -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,7 +1,6 @@
1
- /* eslint-disable no-console */
2
1
  import { useRef } from 'react';
3
- import { Promise } from 'es6-promise';
4
- import { ValueChangeType, } from './type';
2
+ import { Promise as ES6Promise } from 'es6-promise';
3
+ import { ValueChangeType } from './type';
5
4
  import { deepClone } from './utils';
6
5
  const defaultFunc = () => { };
7
6
  export const defaultFormDataMethods = {
@@ -186,8 +185,8 @@ class FormData {
186
185
  const promise = entity.validateField();
187
186
  promiseList.push(promise.then(errors => errors));
188
187
  });
189
- const summaryPromise = new Promise((resolve, reject) => {
190
- Promise.all(promiseList).then(res => {
188
+ const summaryPromise = new ES6Promise((resolve, reject) => {
189
+ ES6Promise.all(promiseList).then((res) => {
191
190
  const errorResults = res.filter(item => item?.errors?.length);
192
191
  if (errorResults.length) {
193
192
  reject(errorResults);
@@ -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,6 +1,6 @@
1
1
  import React, { useRef, forwardRef, useCallback, useMemo, useContext, useEffect, useImperativeHandle, } from 'react';
2
2
  import { cls, nextTick, defaultLocale } from '@arco-design/mobile-utils';
3
- import { Promise } from 'es6-promise';
3
+ import { Promise as ES6Promise } from 'es6-promise';
4
4
  import Loading from '../loading';
5
5
  import { GlobalContext } from '../context-provider';
6
6
  import { PullRefreshStatus } from './model';
@@ -78,7 +78,7 @@ export const PullRefresh = forwardRef((props, ref) => {
78
78
  }
79
79
  setStatus(PullRefreshStatus.Pulling);
80
80
  }, [disabled, ifShouldHandle]);
81
- const refresh = () => new Promise(resolve => {
81
+ const refresh = () => new ES6Promise(resolve => {
82
82
  setStatus(PullRefreshStatus.Loading);
83
83
  nextTick(() => {
84
84
  scroll(tipsHeight, 300);