@arco-design/mobile-react 2.38.1 → 2.38.3
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.
- package/CHANGELOG.md +20 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/action-sheet/index.d.ts +11 -10
- package/cjs/action-sheet/index.js +6 -2
- package/cjs/action-sheet/methods.d.ts +2 -2
- package/cjs/cell/cell.d.ts +1 -1
- package/cjs/cell/cell.js +36 -7
- package/cjs/cell/style/css/index.css +46 -16
- package/cjs/cell/style/index.less +52 -11
- package/cjs/cell/type.d.ts +8 -1
- package/dist/index.js +42 -9
- package/dist/index.min.js +1 -1
- package/dist/style.css +33 -8
- package/dist/style.min.css +1 -1
- package/esm/action-sheet/index.d.ts +11 -10
- package/esm/action-sheet/index.js +6 -2
- package/esm/action-sheet/methods.d.ts +2 -2
- package/esm/cell/cell.d.ts +1 -1
- package/esm/cell/cell.js +37 -8
- package/esm/cell/style/css/index.css +46 -16
- package/esm/cell/style/index.less +52 -11
- package/esm/cell/type.d.ts +8 -1
- package/esnext/action-sheet/index.d.ts +11 -10
- package/esnext/action-sheet/index.js +7 -3
- package/esnext/action-sheet/methods.d.ts +2 -2
- package/esnext/cell/cell.d.ts +1 -1
- package/esnext/cell/cell.js +19 -3
- package/esnext/cell/style/css/index.css +46 -16
- package/esnext/cell/style/index.less +52 -11
- package/esnext/cell/type.d.ts +8 -1
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +2 -0
- package/tokens/app/arcodesign/default/index.d.ts +2 -0
- package/tokens/app/arcodesign/default/index.js +2 -0
- package/tokens/app/arcodesign/default/index.json +20 -0
- package/tokens/app/arcodesign/default/index.less +2 -0
- package/umd/action-sheet/index.d.ts +11 -10
- package/umd/action-sheet/index.js +6 -2
- package/umd/action-sheet/methods.d.ts +2 -2
- package/umd/cell/cell.d.ts +1 -1
- package/umd/cell/cell.js +36 -7
- package/umd/cell/style/css/index.css +46 -16
- package/umd/cell/style/index.less +52 -11
- package/umd/cell/type.d.ts +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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.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
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* `ActionSheet` support "getScrollContainer" ([8681a94](https://github.com/arco-design/arco-design-mobile/commit/8681a94490dc9fde0992aad15b07c0693e3a4f4b))
|
|
12
|
+
* `Cell` support prop "clickable" for clickable effect ([b4d6f57](https://github.com/arco-design/arco-design-mobile/commit/b4d6f57baa99c01d661feb1d85df958ce1abf023))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [2.38.2](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.38.1...@arco-design/mobile-react@2.38.2) (2025-09-22)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @arco-design/mobile-react
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [2.38.1](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.38.0...@arco-design/mobile-react@2.38.1) (2025-09-15)
|
|
7
27
|
|
|
8
28
|
|
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.
|
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.38.
|
|
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>
|
|
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.
|
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.38.
|
|
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>
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## 引入全部
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { Promise } from 'es6-promise';
|
|
4
|
+
import type { PopupProps, PopupRef } from '../popup';
|
|
5
|
+
import type { OpenBaseProps } from '../masking';
|
|
5
6
|
export interface ActionSheetItemOptions {
|
|
6
7
|
/**
|
|
7
8
|
* 选项文字内容
|
|
@@ -29,7 +30,7 @@ export interface ActionSheetItemOptions {
|
|
|
29
30
|
*/
|
|
30
31
|
onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => (void | boolean) | Promise<void | boolean>;
|
|
31
32
|
}
|
|
32
|
-
export interface ActionSheetProps extends Omit<PopupProps, 'children' | '
|
|
33
|
+
export interface ActionSheetProps extends Omit<PopupProps, 'children' | 'orientationDirection' | 'direction'> {
|
|
33
34
|
/**
|
|
34
35
|
* 选项配置,详情见 ActionSheetItemOptions
|
|
35
36
|
* @en Option setting, see ActionSheetItemOptions for details
|
|
@@ -57,12 +58,12 @@ export interface ActionSheetProps extends Omit<PopupProps, 'children' | 'getScro
|
|
|
57
58
|
*/
|
|
58
59
|
needBottomOffset?: boolean;
|
|
59
60
|
}
|
|
60
|
-
export interface ActionSheetRef {
|
|
61
|
+
export interface ActionSheetRef extends PopupRef {
|
|
61
62
|
/**
|
|
62
|
-
*
|
|
63
|
+
* 菜单列表元素 DOM
|
|
63
64
|
* @en The outermost element DOM
|
|
64
65
|
*/
|
|
65
|
-
|
|
66
|
+
actionList: HTMLDivElement | null;
|
|
66
67
|
}
|
|
67
68
|
export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.FunctionComponent<P>): {
|
|
68
69
|
/**
|
|
@@ -87,11 +88,11 @@ declare const _default: React.ForwardRefExoticComponent<ActionSheetProps & React
|
|
|
87
88
|
* @param {ActionSheetProps} config setting
|
|
88
89
|
* @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => void; }}
|
|
89
90
|
*/
|
|
90
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "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"> & {
|
|
91
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "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
92
|
key?: string | undefined;
|
|
92
93
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
|
93
94
|
close: () => void;
|
|
94
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "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"> & {
|
|
95
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "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
96
|
key?: string | undefined;
|
|
96
97
|
}) => void;
|
|
97
98
|
};
|
|
@@ -38,8 +38,11 @@ var ActionSheet = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
38
38
|
needBottomOffset = _props$needBottomOffs === void 0 ? true : _props$needBottomOffs,
|
|
39
39
|
otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
40
40
|
var popupRef = (0, _react.useRef)(null);
|
|
41
|
+
var listRef = (0, _react.useRef)(null);
|
|
41
42
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
42
|
-
return popupRef.current
|
|
43
|
+
return (0, _extends2.default)({}, popupRef.current, {
|
|
44
|
+
actionList: listRef.current
|
|
45
|
+
});
|
|
43
46
|
});
|
|
44
47
|
|
|
45
48
|
function handleItemClick(e, item) {
|
|
@@ -76,7 +79,8 @@ var ActionSheet = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
76
79
|
}, title) : null, subTitle ? /*#__PURE__*/_react.default.createElement("div", {
|
|
77
80
|
className: prefixCls + "-action-sheet-sub-title"
|
|
78
81
|
}, subTitle) : null) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
-
className: prefixCls + "-action-sheet-list"
|
|
82
|
+
className: prefixCls + "-action-sheet-list",
|
|
83
|
+
ref: listRef
|
|
80
84
|
}, (items || []).map(function (item, index) {
|
|
81
85
|
return item.content ? /*#__PURE__*/_react.default.createElement("div", {
|
|
82
86
|
className: (0, _mobileUtils.cls)(prefixCls + "-action-sheet-item", item.className, item.status || 'normal'),
|
|
@@ -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) => {
|
package/cjs/cell/cell.d.ts
CHANGED
package/cjs/cell/cell.js
CHANGED
|
@@ -34,28 +34,57 @@ var Cell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
34
34
|
append = props.append,
|
|
35
35
|
_props$bordered = props.bordered,
|
|
36
36
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
37
|
-
|
|
37
|
+
onClick = props.onClick,
|
|
38
|
+
_props$clickable = props.clickable,
|
|
39
|
+
clickable = _props$clickable === void 0 ? false : _props$clickable;
|
|
38
40
|
var domRef = (0, _react.useRef)(null);
|
|
41
|
+
|
|
42
|
+
var _useState = (0, _react.useState)(false),
|
|
43
|
+
isPressed = _useState[0],
|
|
44
|
+
setIsPressed = _useState[1];
|
|
45
|
+
|
|
39
46
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
40
47
|
return {
|
|
41
48
|
dom: domRef.current
|
|
42
49
|
};
|
|
43
50
|
});
|
|
51
|
+
|
|
52
|
+
var handleTouchStart = function handleTouchStart() {
|
|
53
|
+
if (clickable) {
|
|
54
|
+
setIsPressed(true);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var handleTouchEnd = function handleTouchEnd() {
|
|
59
|
+
if (clickable) {
|
|
60
|
+
setIsPressed(false);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var handleClick = function handleClick(e) {
|
|
65
|
+
if (onClick) {
|
|
66
|
+
onClick(e);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
44
70
|
return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
|
|
45
71
|
var prefixCls = _ref.prefixCls;
|
|
46
72
|
return /*#__PURE__*/_react.default.createElement(_group.GroupContext.Consumer, null, function (_ref2) {
|
|
73
|
+
var _cls, _cls2, _cls3;
|
|
74
|
+
|
|
47
75
|
var isFromGroup = _ref2.isFromGroup;
|
|
48
76
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
77
|
className: (0, _mobileUtils.cls)(prefixCls + "-cell", 'all-border-box', {
|
|
50
|
-
'without-group': !isFromGroup
|
|
51
|
-
}, {
|
|
52
78
|
bordered: bordered
|
|
53
|
-
},
|
|
79
|
+
}, {
|
|
80
|
+
'without-group': !isFromGroup
|
|
81
|
+
}, (_cls = {}, _cls[prefixCls + "-cell-without-group"] = !isFromGroup, _cls), (_cls2 = {}, _cls2[prefixCls + "-cell-clickable"] = clickable, _cls2), (_cls3 = {}, _cls3[prefixCls + "-cell-pressed"] = isPressed, _cls3), className),
|
|
54
82
|
style: style,
|
|
55
83
|
ref: domRef,
|
|
56
|
-
onClick:
|
|
57
|
-
|
|
58
|
-
|
|
84
|
+
onClick: handleClick,
|
|
85
|
+
onTouchStart: handleTouchStart,
|
|
86
|
+
onTouchEnd: handleTouchEnd,
|
|
87
|
+
onTouchCancel: handleTouchEnd
|
|
59
88
|
}, prepend, /*#__PURE__*/_react.default.createElement("div", {
|
|
60
89
|
className: (0, _mobileUtils.cls)(prefixCls + "-cell-inner", {
|
|
61
90
|
'has-desc': desc
|
|
@@ -569,16 +569,40 @@
|
|
|
569
569
|
border-radius: 0;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
.arco-cell
|
|
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
|
|
601
|
+
.arco-cell-without-group.bordered {
|
|
578
602
|
position: relative;
|
|
579
603
|
border-width: 0;
|
|
580
604
|
}
|
|
581
|
-
.arco-cell
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
186
|
+
&.@{prefix}-cell-pressed::after {
|
|
156
187
|
@{arco-dark-mode-selector} & {
|
|
157
|
-
.
|
|
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);
|
package/cjs/cell/type.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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
|
package/dist/index.js
CHANGED
|
@@ -9220,8 +9220,11 @@
|
|
|
9220
9220
|
otherProps = __rest$1(props, ["className", "items", "cancelText", "close", "title", "subTitle", "needBottomOffset"]);
|
|
9221
9221
|
|
|
9222
9222
|
var popupRef = React.useRef(null);
|
|
9223
|
+
var listRef = React.useRef(null);
|
|
9223
9224
|
React.useImperativeHandle(ref, function () {
|
|
9224
|
-
return popupRef.current
|
|
9225
|
+
return __assign$3(__assign$3({}, popupRef.current), {
|
|
9226
|
+
actionList: listRef.current
|
|
9227
|
+
});
|
|
9225
9228
|
});
|
|
9226
9229
|
|
|
9227
9230
|
function handleItemClick(e, item) {
|
|
@@ -9258,7 +9261,8 @@
|
|
|
9258
9261
|
}, title) : null, subTitle ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
9259
9262
|
className: prefixCls + "-action-sheet-sub-title"
|
|
9260
9263
|
}, subTitle) : null) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
9261
|
-
className: prefixCls + "-action-sheet-list"
|
|
9264
|
+
className: prefixCls + "-action-sheet-list",
|
|
9265
|
+
ref: listRef
|
|
9262
9266
|
}, (items || []).map(function (item, index) {
|
|
9263
9267
|
return item.content ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
9264
9268
|
className: cls(prefixCls + "-action-sheet-item", item.className, item.status || 'normal'),
|
|
@@ -11466,28 +11470,57 @@
|
|
|
11466
11470
|
append = props.append,
|
|
11467
11471
|
_b = props.bordered,
|
|
11468
11472
|
bordered = _b === void 0 ? true : _b,
|
|
11469
|
-
|
|
11473
|
+
onClick = props.onClick,
|
|
11474
|
+
_c = props.clickable,
|
|
11475
|
+
clickable = _c === void 0 ? false : _c;
|
|
11470
11476
|
var domRef = React.useRef(null);
|
|
11477
|
+
|
|
11478
|
+
var _d = React.useState(false),
|
|
11479
|
+
isPressed = _d[0],
|
|
11480
|
+
setIsPressed = _d[1];
|
|
11481
|
+
|
|
11471
11482
|
React.useImperativeHandle(ref, function () {
|
|
11472
11483
|
return {
|
|
11473
11484
|
dom: domRef.current
|
|
11474
11485
|
};
|
|
11475
11486
|
});
|
|
11487
|
+
|
|
11488
|
+
var handleTouchStart = function handleTouchStart() {
|
|
11489
|
+
if (clickable) {
|
|
11490
|
+
setIsPressed(true);
|
|
11491
|
+
}
|
|
11492
|
+
};
|
|
11493
|
+
|
|
11494
|
+
var handleTouchEnd = function handleTouchEnd() {
|
|
11495
|
+
if (clickable) {
|
|
11496
|
+
setIsPressed(false);
|
|
11497
|
+
}
|
|
11498
|
+
};
|
|
11499
|
+
|
|
11500
|
+
var handleClick = function handleClick(e) {
|
|
11501
|
+
if (onClick) {
|
|
11502
|
+
onClick(e);
|
|
11503
|
+
}
|
|
11504
|
+
};
|
|
11505
|
+
|
|
11476
11506
|
return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
|
|
11477
11507
|
var prefixCls = _a.prefixCls;
|
|
11478
11508
|
return /*#__PURE__*/React__default["default"].createElement(GroupContext.Consumer, null, function (_a) {
|
|
11509
|
+
var _b, _c, _d;
|
|
11510
|
+
|
|
11479
11511
|
var isFromGroup = _a.isFromGroup;
|
|
11480
11512
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
11481
11513
|
className: cls(prefixCls + "-cell", 'all-border-box', {
|
|
11482
|
-
'without-group': !isFromGroup
|
|
11483
|
-
}, {
|
|
11484
11514
|
bordered: bordered
|
|
11485
|
-
},
|
|
11515
|
+
}, {
|
|
11516
|
+
'without-group': !isFromGroup
|
|
11517
|
+
}, (_b = {}, _b[prefixCls + "-cell-without-group"] = !isFromGroup, _b), (_c = {}, _c[prefixCls + "-cell-clickable"] = clickable, _c), (_d = {}, _d[prefixCls + "-cell-pressed"] = isPressed, _d), className),
|
|
11486
11518
|
style: style,
|
|
11487
11519
|
ref: domRef,
|
|
11488
|
-
onClick:
|
|
11489
|
-
|
|
11490
|
-
|
|
11520
|
+
onClick: handleClick,
|
|
11521
|
+
onTouchStart: handleTouchStart,
|
|
11522
|
+
onTouchEnd: handleTouchEnd,
|
|
11523
|
+
onTouchCancel: handleTouchEnd
|
|
11491
11524
|
}, prepend, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
11492
11525
|
className: cls(prefixCls + "-cell-inner", {
|
|
11493
11526
|
'has-desc': desc
|