@arco-design/mobile-react 2.24.0 → 2.24.1
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 +11 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/dialog/index.d.ts +2 -2
- package/cjs/ellipsis/components/js-ellipsis.d.ts +4 -2
- package/cjs/ellipsis/components/js-ellipsis.js +14 -1
- package/cjs/ellipsis/components/native-ellipsis.d.ts +1 -1
- package/cjs/ellipsis/components/native-ellipsis.js +6 -1
- package/cjs/ellipsis/demo/style/css/mobile.css +1 -1
- package/cjs/ellipsis/demo/style/mobile.less +3 -1
- package/cjs/ellipsis/index.js +6 -2
- package/cjs/ellipsis/style/css/index.css +14 -1
- package/cjs/ellipsis/style/index.less +15 -1
- package/cjs/ellipsis/type.d.ts +22 -76
- package/cjs/masking/index.d.ts +2 -2
- package/cjs/popup/index.d.ts +2 -2
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/dist/index.js +26 -4
- package/dist/index.min.js +3 -3
- package/dist/style.css +13 -1
- package/dist/style.min.css +1 -1
- package/esm/dialog/index.d.ts +2 -2
- package/esm/ellipsis/components/js-ellipsis.d.ts +4 -2
- package/esm/ellipsis/components/js-ellipsis.js +14 -1
- package/esm/ellipsis/components/native-ellipsis.d.ts +1 -1
- package/esm/ellipsis/components/native-ellipsis.js +6 -1
- package/esm/ellipsis/demo/style/css/mobile.css +1 -1
- package/esm/ellipsis/demo/style/mobile.less +3 -1
- package/esm/ellipsis/index.js +6 -2
- package/esm/ellipsis/style/css/index.css +14 -1
- package/esm/ellipsis/style/index.less +15 -1
- package/esm/ellipsis/type.d.ts +22 -76
- package/esm/masking/index.d.ts +2 -2
- package/esm/popup/index.d.ts +2 -2
- package/esm/popup-swiper/index.d.ts +2 -2
- 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 +127 -125
- package/tokens/app/arcodesign/default/index.json +24 -0
- package/tokens/app/arcodesign/default/index.less +2 -0
- package/umd/dialog/index.d.ts +2 -2
- package/umd/ellipsis/components/js-ellipsis.d.ts +4 -2
- package/umd/ellipsis/components/js-ellipsis.js +14 -1
- package/umd/ellipsis/components/native-ellipsis.d.ts +1 -1
- package/umd/ellipsis/components/native-ellipsis.js +6 -1
- package/umd/ellipsis/demo/style/css/mobile.css +1 -1
- package/umd/ellipsis/demo/style/mobile.less +3 -1
- package/umd/ellipsis/index.js +6 -2
- package/umd/ellipsis/style/css/index.css +14 -1
- package/umd/ellipsis/style/index.less +15 -1
- package/umd/ellipsis/type.d.ts +22 -76
- package/umd/masking/index.d.ts +2 -2
- package/umd/popup/index.d.ts +2 -2
- package/umd/popup-swiper/index.d.ts +2 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,17 @@
|
|
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.24.1](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.24.0...@arco-design/mobile-react@2.24.1) (2023-01-04)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* `Ellipsis` support floatEllipsisNode ([#76](https://github.com/arco-design/arco-design-mobile/issues/76)) ([cc8e3d6](https://github.com/arco-design/arco-design-mobile/commit/cc8e3d6df1eec5a528a47c255c49ca94a326ca18))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
6
17
|
# [2.24.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.23.0...@arco-design/mobile-react@2.24.0) (2022-12-20)
|
7
18
|
|
8
19
|
|
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.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.24.0/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.24.0/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.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.24.0/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.24.0/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
package/cjs/dialog/index.d.ts
CHANGED
@@ -193,11 +193,11 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
|
|
193
193
|
* @param {DialogProps} config Configuration
|
194
194
|
* @returns {{ close: () => void; update: (newConfig: DialogProps) => void; }}
|
195
195
|
*/
|
196
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "
|
196
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
|
197
197
|
key?: string | undefined;
|
198
198
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
199
199
|
close: () => void;
|
200
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "
|
200
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
|
201
201
|
key?: string | undefined;
|
202
202
|
}) => void;
|
203
203
|
};
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
3
|
-
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<
|
2
|
+
import { JsEllipsisRef } from '../type';
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("../type").EllipsisBaseProps & {
|
4
|
+
prefixCls: string;
|
5
|
+
} & Pick<import("../type").EllipsisProps, "maxHeight" | "endExcludes" | "reflowOnResize" | "onReflow"> & React.RefAttributes<JsEllipsisRef>>>;
|
4
6
|
export default _default;
|
@@ -220,7 +220,20 @@ var JsEllipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
220
220
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
221
221
|
ref: textRef,
|
222
222
|
className: prefixCls + "-js-content"
|
223
|
-
}
|
223
|
+
}, dangerouslyUseInnerHTML ? /*#__PURE__*/_react.default.createElement("span", {
|
224
|
+
className: prefixCls + "-js-content-initial",
|
225
|
+
style: {
|
226
|
+
WebkitLineClamp: maxLine
|
227
|
+
},
|
228
|
+
dangerouslySetInnerHTML: {
|
229
|
+
__html: text
|
230
|
+
}
|
231
|
+
}) : /*#__PURE__*/_react.default.createElement("span", {
|
232
|
+
className: prefixCls + "-js-content-initial",
|
233
|
+
style: {
|
234
|
+
WebkitLineClamp: maxLine
|
235
|
+
}
|
236
|
+
}, text)), /*#__PURE__*/_react.default.createElement("span", {
|
224
237
|
ref: ellipsisRef,
|
225
238
|
className: prefixCls + "-js-content-ellipsis",
|
226
239
|
onClick: onEllipsisNodeClick
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { NativeEllipsisProps } from '../type';
|
3
|
-
declare function NativeEllipsis({ prefixCls, ellipsis, dangerouslyUseInnerHTML, text, maxLine, collapseNode, onCollapseNodeClick, }: NativeEllipsisProps): JSX.Element;
|
3
|
+
declare function NativeEllipsis({ prefixCls, ellipsis, dangerouslyUseInnerHTML, text, maxLine, ellipsisNode, collapseNode, onEllipsisNodeClick, onCollapseNodeClick, }: NativeEllipsisProps): JSX.Element;
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof NativeEllipsis>;
|
5
5
|
export default _default;
|
@@ -15,8 +15,10 @@ function NativeEllipsis(_ref) {
|
|
15
15
|
dangerouslyUseInnerHTML = _ref.dangerouslyUseInnerHTML,
|
16
16
|
text = _ref.text,
|
17
17
|
maxLine = _ref.maxLine,
|
18
|
+
ellipsisNode = _ref.ellipsisNode,
|
18
19
|
_ref$collapseNode = _ref.collapseNode,
|
19
20
|
collapseNode = _ref$collapseNode === void 0 ? '' : _ref$collapseNode,
|
21
|
+
onEllipsisNodeClick = _ref.onEllipsisNodeClick,
|
20
22
|
onCollapseNodeClick = _ref.onCollapseNodeClick;
|
21
23
|
return /*#__PURE__*/_react.default.createElement("div", {
|
22
24
|
className: (0, _mobileUtils.cls)(prefixCls + "-native", {
|
@@ -35,7 +37,10 @@ function NativeEllipsis(_ref) {
|
|
35
37
|
}) : /*#__PURE__*/_react.default.createElement("span", null, text), !ellipsis && collapseNode && /*#__PURE__*/_react.default.createElement("span", {
|
36
38
|
onClick: onCollapseNodeClick,
|
37
39
|
className: (0, _mobileUtils.cls)(prefixCls + "-native-collapse")
|
38
|
-
}, collapseNode))
|
40
|
+
}, collapseNode), ellipsis && (ellipsisNode !== '...' || onEllipsisNodeClick) ? /*#__PURE__*/_react.default.createElement("span", {
|
41
|
+
onClick: onEllipsisNodeClick,
|
42
|
+
className: (0, _mobileUtils.cls)(prefixCls + "-native-ellipsis-node")
|
43
|
+
}, ellipsisNode) : null);
|
39
44
|
}
|
40
45
|
|
41
46
|
var _default = /*#__PURE__*/_react.default.memo(NativeEllipsis);
|
package/cjs/ellipsis/index.js
CHANGED
@@ -52,15 +52,17 @@ var Ellipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
52
52
|
ellipsisNode = _props$ellipsisNode === void 0 ? '...' : _props$ellipsisNode,
|
53
53
|
_props$collapseNode = props.collapseNode,
|
54
54
|
collapseNode = _props$collapseNode === void 0 ? '' : _props$collapseNode,
|
55
|
-
onCollapseNodeClick = props.onCollapseNodeClick,
|
56
55
|
endExcludes = props.endExcludes,
|
57
56
|
_props$reflowOnResize = props.reflowOnResize,
|
58
57
|
reflowOnResize = _props$reflowOnResize === void 0 ? false : _props$reflowOnResize,
|
58
|
+
_props$floatEllipsisN = props.floatEllipsisNode,
|
59
|
+
floatEllipsisNode = _props$floatEllipsisN === void 0 ? false : _props$floatEllipsisN,
|
59
60
|
onReflow = props.onReflow,
|
61
|
+
onCollapseNodeClick = props.onCollapseNodeClick,
|
60
62
|
onEllipsisNodeClick = props.onEllipsisNodeClick;
|
61
63
|
var domRef = (0, _react.useRef)(null);
|
62
64
|
var jsEllipsisRef = (0, _react.useRef)(null);
|
63
|
-
var useNativeEllipsis = (0, _is.isSupportWebkitLineClamp)() && maxHeight === void 0 &&
|
65
|
+
var useNativeEllipsis = (0, _is.isSupportWebkitLineClamp)() && maxHeight === void 0 && (!endExcludes || endExcludes.length === 0) && !onReflow && (floatEllipsisNode || ellipsisNode === '...' && !onEllipsisNodeClick);
|
64
66
|
(0, _react.useImperativeHandle)(ref, function () {
|
65
67
|
var _jsEllipsisRef$curren;
|
66
68
|
|
@@ -80,7 +82,9 @@ var Ellipsis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
80
82
|
dangerouslyUseInnerHTML: dangerouslyUseInnerHTML,
|
81
83
|
text: text,
|
82
84
|
maxLine: maxLine,
|
85
|
+
ellipsisNode: ellipsisNode,
|
83
86
|
collapseNode: collapseNode,
|
87
|
+
onEllipsisNodeClick: onEllipsisNodeClick,
|
84
88
|
onCollapseNodeClick: onCollapseNodeClick
|
85
89
|
}) : /*#__PURE__*/_react.default.createElement(_jsEllipsis.default, {
|
86
90
|
ref: jsEllipsisRef,
|
@@ -1,10 +1,23 @@
|
|
1
1
|
.arco-ellipsis {
|
2
2
|
font-size: 0.32rem ;
|
3
3
|
}
|
4
|
-
.arco-ellipsis-native.ellipsis
|
4
|
+
.arco-ellipsis-native.ellipsis,
|
5
|
+
.arco-ellipsis-js-content-initial {
|
5
6
|
display: -webkit-box;
|
6
7
|
overflow: hidden;
|
7
8
|
text-overflow: ellipsis;
|
8
9
|
word-break: break-word;
|
9
10
|
-webkit-box-orient: vertical;
|
11
|
+
position: relative;
|
12
|
+
}
|
13
|
+
.arco-ellipsis-native-ellipsis-node {
|
14
|
+
position: absolute;
|
15
|
+
right: 0;
|
16
|
+
bottom: 0;
|
17
|
+
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0), #ffffff 20PX, #ffffff) ;
|
18
|
+
background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ffffff 20PX, #ffffff) ;
|
19
|
+
padding-left: 20PX ;
|
20
|
+
}
|
21
|
+
.arco-ellipsis-js-content-ellipsis {
|
22
|
+
display: none;
|
10
23
|
}
|
@@ -3,11 +3,25 @@
|
|
3
3
|
.@{prefix}-ellipsis {
|
4
4
|
.use-var(font-size, ellipsis-default-text-size);
|
5
5
|
|
6
|
-
&-native.ellipsis
|
6
|
+
&-native.ellipsis,
|
7
|
+
&-js-content-initial {
|
7
8
|
display: -webkit-box;
|
8
9
|
overflow: hidden;
|
9
10
|
text-overflow: ellipsis;
|
10
11
|
word-break: break-word;
|
11
12
|
-webkit-box-orient: vertical;
|
13
|
+
position: relative;
|
14
|
+
}
|
15
|
+
|
16
|
+
&-native-ellipsis-node {
|
17
|
+
position: absolute;
|
18
|
+
right: 0;
|
19
|
+
bottom: 0;
|
20
|
+
.use-var(background, ellipsis-float-ellipsis-node-background);
|
21
|
+
.use-var(padding-left, ellipsis-float-ellipsis-node-padding-left);
|
22
|
+
}
|
23
|
+
|
24
|
+
&-js-content-ellipsis {
|
25
|
+
display: none;
|
12
26
|
}
|
13
27
|
}
|
package/cjs/ellipsis/type.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ReactNode
|
2
|
-
interface
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
export interface EllipsisBaseProps {
|
3
3
|
/**
|
4
4
|
* 需要缩略的文本内容
|
5
5
|
* @en Text content to be omitted
|
@@ -23,68 +23,17 @@ interface BaseProps {
|
|
23
23
|
* @default false
|
24
24
|
*/
|
25
25
|
dangerouslyUseInnerHTML?: boolean;
|
26
|
-
}
|
27
|
-
export interface NativeEllipsisProps extends BaseProps {
|
28
|
-
/**
|
29
|
-
* className 前缀
|
30
|
-
* @en Prefix classname
|
31
|
-
*/
|
32
|
-
prefixCls: string;
|
33
|
-
/**
|
34
|
-
* 自定义收起节点,不为空时文本展开插入文本尾部
|
35
|
-
* @en Customize the collapsed node, when the text is not empty, the text expand Text expand content inserts the end of the text
|
36
|
-
*/
|
37
|
-
collapseNode?: ReactNode;
|
38
|
-
/**
|
39
|
-
* 收起节点点击事件
|
40
|
-
* @en Collapse node click event
|
41
|
-
*/
|
42
|
-
onCollapseNodeClick?: () => void;
|
43
|
-
}
|
44
|
-
export interface JsEllipsisRef {
|
45
|
-
dom: HTMLDivElement | null;
|
46
|
-
reflow: () => void;
|
47
|
-
}
|
48
|
-
export interface JsEllipsisProps extends BaseProps {
|
49
|
-
ref: Ref<HTMLDivElement | null>;
|
50
|
-
/**
|
51
|
-
* className 前缀
|
52
|
-
* @en Prefix classname
|
53
|
-
*/
|
54
|
-
prefixCls: string;
|
55
|
-
/**
|
56
|
-
* 最大显示高度,单位 px,优先级高于 maxLine
|
57
|
-
* @en Maximum display height, unit px, priority higher than maxLine
|
58
|
-
*/
|
59
|
-
maxHeight?: number;
|
60
26
|
/**
|
61
27
|
* 自定义缩略符节点,文本缩略时插入文本尾部
|
62
|
-
* @en Customize the ellipsis node, insert the end of the text when the text is omitted
|
28
|
+
* @en Customize the ellipsis node, insert at the end of the text when the text is omitted
|
63
29
|
* @default "..."
|
64
30
|
*/
|
65
31
|
ellipsisNode?: ReactNode;
|
66
32
|
/**
|
67
33
|
* 自定义收起符节点,不为空且文本展开时插入文本尾部
|
68
|
-
* @en Customize the collapse node,
|
34
|
+
* @en Customize the collapse node, when the value is not empty and the text is expanded, the node is inserted at the end of the text
|
69
35
|
*/
|
70
36
|
collapseNode?: ReactNode;
|
71
|
-
/**
|
72
|
-
* 文本结尾处(缩略符之前)需要过滤掉的字符
|
73
|
-
* @en Characters that need to be filtered out at the end of the text (before abbreviations)
|
74
|
-
* @default []
|
75
|
-
*/
|
76
|
-
endExcludes?: string[];
|
77
|
-
/**
|
78
|
-
* 容器大小变化时是否自适应,使用原生缩略时默认为 true
|
79
|
-
* @en Whether to adapt when the container size changes, the default is true when using native ellipsis
|
80
|
-
* @default false
|
81
|
-
*/
|
82
|
-
reflowOnResize?: boolean;
|
83
|
-
/**
|
84
|
-
* 文本缩略处理的完成回调
|
85
|
-
* @en Callback when text omission processing is complete
|
86
|
-
*/
|
87
|
-
onReflow?: (ellipsis: boolean, text: string) => void;
|
88
37
|
/**
|
89
38
|
* 缩略节点点击事件
|
90
39
|
* @en Ellipsis node click event
|
@@ -108,7 +57,7 @@ export interface EllipsisRef {
|
|
108
57
|
*/
|
109
58
|
reflow: (() => void) | undefined;
|
110
59
|
}
|
111
|
-
export interface EllipsisProps extends
|
60
|
+
export interface EllipsisProps extends EllipsisBaseProps {
|
112
61
|
/**
|
113
62
|
* 自定义类名
|
114
63
|
* @en Custom classname
|
@@ -119,17 +68,6 @@ export interface EllipsisProps extends BaseProps {
|
|
119
68
|
* @en Maximum display height(unit: px), priority higher than maxLine
|
120
69
|
*/
|
121
70
|
maxHeight?: number;
|
122
|
-
/**
|
123
|
-
* 自定义缩略符节点,文本缩略时插入文本尾部
|
124
|
-
* @en Customize the ellipsis node, insert at the end of the text when the text is omitted
|
125
|
-
* @default "..."
|
126
|
-
*/
|
127
|
-
ellipsisNode?: ReactNode;
|
128
|
-
/**
|
129
|
-
* 自定义收起符节点,不为空且文本展开时插入文本尾部
|
130
|
-
* @en Customize the collapse node, when the value is not empty and the text is expanded, the node is inserted at the end of the text
|
131
|
-
*/
|
132
|
-
collapseNode?: ReactNode;
|
133
71
|
/**
|
134
72
|
* 文本结尾处(缩略符之前)需要过滤掉的字符
|
135
73
|
* @en Characters to filter out at the end of the text (before the ellipsis)
|
@@ -142,20 +80,28 @@ export interface EllipsisProps extends BaseProps {
|
|
142
80
|
* @default false
|
143
81
|
*/
|
144
82
|
reflowOnResize?: boolean;
|
83
|
+
/**
|
84
|
+
* 文本缩略时,缩略符节点是否浮在文本右下角(默认加渐变色背景)
|
85
|
+
* @en Whether the abbreviation node is floating in the lower right corner of the text (with a gradient background by default)
|
86
|
+
* @default false
|
87
|
+
*/
|
88
|
+
floatEllipsisNode?: boolean;
|
145
89
|
/**
|
146
90
|
* 文本缩略处理的完成回调
|
147
91
|
* @en Callback when text omission processing is complete
|
148
92
|
*/
|
149
93
|
onReflow?: (ellipsis: boolean, text: string) => void;
|
94
|
+
}
|
95
|
+
export declare type EllipsisCommonProps = EllipsisBaseProps & {
|
150
96
|
/**
|
151
|
-
*
|
152
|
-
* @en
|
153
|
-
*/
|
154
|
-
onEllipsisNodeClick?: () => void;
|
155
|
-
/**
|
156
|
-
* 收起节点点击事件
|
157
|
-
* @en Collapse node click event
|
97
|
+
* className 前缀
|
98
|
+
* @en Prefix classname
|
158
99
|
*/
|
159
|
-
|
100
|
+
prefixCls: string;
|
101
|
+
};
|
102
|
+
export declare type NativeEllipsisProps = EllipsisCommonProps;
|
103
|
+
export interface JsEllipsisRef {
|
104
|
+
dom: HTMLDivElement | null;
|
105
|
+
reflow: () => void;
|
160
106
|
}
|
161
|
-
export
|
107
|
+
export declare type JsEllipsisProps = EllipsisCommonProps & Pick<EllipsisProps, 'maxHeight' | 'endExcludes' | 'reflowOnResize' | 'onReflow'>;
|
package/cjs/masking/index.d.ts
CHANGED
@@ -205,11 +205,11 @@ declare const _default: React.ForwardRefExoticComponent<MaskingProps & React.Ref
|
|
205
205
|
* @param {MaskingProps} config Configuration
|
206
206
|
* @returns {{ close: () => void; update: (newConfig: MaskingProps) => void; }}
|
207
207
|
*/
|
208
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "
|
208
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
|
209
209
|
key?: string | undefined;
|
210
210
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
211
211
|
close: () => void;
|
212
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "
|
212
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
|
213
213
|
key?: string | undefined;
|
214
214
|
}) => void;
|
215
215
|
};
|
package/cjs/popup/index.d.ts
CHANGED
@@ -66,11 +66,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupProps & React.RefAt
|
|
66
66
|
* @param {PopupProps} config Configuration
|
67
67
|
* @returns {{ close: () => void; update: (newConfig: PopupProps) => void; }}
|
68
68
|
*/
|
69
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "
|
69
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ"> & {
|
70
70
|
key?: string | undefined;
|
71
71
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
72
72
|
close: () => void;
|
73
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "
|
73
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ"> & {
|
74
74
|
key?: string | undefined;
|
75
75
|
}) => void;
|
76
76
|
};
|
@@ -76,11 +76,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React
|
|
76
76
|
* @param {string | PopupSwiperProps} config Configuration
|
77
77
|
* @returns {{ close: () => void; update: (newConfig: PopupSwiperProps) => void; }}
|
78
78
|
*/
|
79
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "
|
79
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ" | "onTouchEnd" | "onTouchStart" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
|
80
80
|
key?: string | undefined;
|
81
81
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
82
82
|
close: () => void;
|
83
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "
|
83
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ" | "onTouchEnd" | "onTouchStart" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
|
84
84
|
key?: string | undefined;
|
85
85
|
}) => void; /**
|
86
86
|
* 内容面板 touchstart 事件,返回true时表示阻止本组件内部处理事件
|
package/dist/index.js
CHANGED
@@ -12370,7 +12370,20 @@
|
|
12370
12370
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
12371
12371
|
ref: textRef,
|
12372
12372
|
className: prefixCls + "-js-content"
|
12373
|
-
}
|
12373
|
+
}, dangerouslyUseInnerHTML ? /*#__PURE__*/React__default["default"].createElement("span", {
|
12374
|
+
className: prefixCls + "-js-content-initial",
|
12375
|
+
style: {
|
12376
|
+
WebkitLineClamp: maxLine
|
12377
|
+
},
|
12378
|
+
dangerouslySetInnerHTML: {
|
12379
|
+
__html: text
|
12380
|
+
}
|
12381
|
+
}) : /*#__PURE__*/React__default["default"].createElement("span", {
|
12382
|
+
className: prefixCls + "-js-content-initial",
|
12383
|
+
style: {
|
12384
|
+
WebkitLineClamp: maxLine
|
12385
|
+
}
|
12386
|
+
}, text)), /*#__PURE__*/React__default["default"].createElement("span", {
|
12374
12387
|
ref: ellipsisRef,
|
12375
12388
|
className: prefixCls + "-js-content-ellipsis",
|
12376
12389
|
onClick: onEllipsisNodeClick
|
@@ -12387,8 +12400,10 @@
|
|
12387
12400
|
dangerouslyUseInnerHTML = _a.dangerouslyUseInnerHTML,
|
12388
12401
|
text = _a.text,
|
12389
12402
|
maxLine = _a.maxLine,
|
12403
|
+
ellipsisNode = _a.ellipsisNode,
|
12390
12404
|
_b = _a.collapseNode,
|
12391
12405
|
collapseNode = _b === void 0 ? '' : _b,
|
12406
|
+
onEllipsisNodeClick = _a.onEllipsisNodeClick,
|
12392
12407
|
onCollapseNodeClick = _a.onCollapseNodeClick;
|
12393
12408
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
12394
12409
|
className: cls(prefixCls + "-native", {
|
@@ -12407,7 +12422,10 @@
|
|
12407
12422
|
}) : /*#__PURE__*/React__default["default"].createElement("span", null, text), !ellipsis && collapseNode && /*#__PURE__*/React__default["default"].createElement("span", {
|
12408
12423
|
onClick: onCollapseNodeClick,
|
12409
12424
|
className: cls(prefixCls + "-native-collapse")
|
12410
|
-
}, collapseNode))
|
12425
|
+
}, collapseNode), ellipsis && (ellipsisNode !== '...' || onEllipsisNodeClick) ? /*#__PURE__*/React__default["default"].createElement("span", {
|
12426
|
+
onClick: onEllipsisNodeClick,
|
12427
|
+
className: cls(prefixCls + "-native-ellipsis-node")
|
12428
|
+
}, ellipsisNode) : null);
|
12411
12429
|
}
|
12412
12430
|
|
12413
12431
|
var NativeEllipsis$1 = /*#__PURE__*/React__default["default"].memo(NativeEllipsis);
|
@@ -12434,15 +12452,17 @@
|
|
12434
12452
|
ellipsisNode = _c === void 0 ? '...' : _c,
|
12435
12453
|
_d = props.collapseNode,
|
12436
12454
|
collapseNode = _d === void 0 ? '' : _d,
|
12437
|
-
onCollapseNodeClick = props.onCollapseNodeClick,
|
12438
12455
|
endExcludes = props.endExcludes,
|
12439
12456
|
_e = props.reflowOnResize,
|
12440
12457
|
reflowOnResize = _e === void 0 ? false : _e,
|
12458
|
+
_f = props.floatEllipsisNode,
|
12459
|
+
floatEllipsisNode = _f === void 0 ? false : _f,
|
12441
12460
|
onReflow = props.onReflow,
|
12461
|
+
onCollapseNodeClick = props.onCollapseNodeClick,
|
12442
12462
|
onEllipsisNodeClick = props.onEllipsisNodeClick;
|
12443
12463
|
var domRef = React.useRef(null);
|
12444
12464
|
var jsEllipsisRef = React.useRef(null);
|
12445
|
-
var useNativeEllipsis = isSupportWebkitLineClamp() && maxHeight === void 0 &&
|
12465
|
+
var useNativeEllipsis = isSupportWebkitLineClamp() && maxHeight === void 0 && (!endExcludes || endExcludes.length === 0) && !onReflow && (floatEllipsisNode || ellipsisNode === '...' && !onEllipsisNodeClick);
|
12446
12466
|
React.useImperativeHandle(ref, function () {
|
12447
12467
|
var _a;
|
12448
12468
|
|
@@ -12462,7 +12482,9 @@
|
|
12462
12482
|
dangerouslyUseInnerHTML: dangerouslyUseInnerHTML,
|
12463
12483
|
text: text,
|
12464
12484
|
maxLine: maxLine,
|
12485
|
+
ellipsisNode: ellipsisNode,
|
12465
12486
|
collapseNode: collapseNode,
|
12487
|
+
onEllipsisNodeClick: onEllipsisNodeClick,
|
12466
12488
|
onCollapseNodeClick: onCollapseNodeClick
|
12467
12489
|
}) : /*#__PURE__*/React__default["default"].createElement(JsEllipsis$1, {
|
12468
12490
|
ref: jsEllipsisRef,
|