@arco-design/mobile-react 2.28.1 → 2.29.0
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 +29 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/hooks.d.ts +7 -1
- package/cjs/_helpers/hooks.js +9 -5
- package/cjs/form/form-item.js +109 -108
- package/cjs/grid/style/css/index.css +4 -0
- package/cjs/grid/style/index.less +6 -0
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +5 -1
- package/cjs/nav-bar/index.d.ts +3 -3
- package/cjs/picker-view/components/picker-cell.js +20 -6
- package/cjs/skeleton/demo/style/css/mobile.css +7 -0
- package/cjs/skeleton/demo/style/mobile.less +13 -0
- package/cjs/skeleton/elements.d.ts +7 -0
- package/cjs/skeleton/elements.js +302 -0
- package/cjs/skeleton/index.d.ts +18 -0
- package/cjs/skeleton/index.js +100 -0
- package/cjs/skeleton/skeleton-context.d.ts +3 -0
- package/cjs/skeleton/skeleton-context.js +15 -0
- package/cjs/skeleton/style/css/index.css +180 -0
- package/cjs/skeleton/style/css/index.d.ts +3 -0
- package/cjs/skeleton/style/css/index.js +7 -0
- package/cjs/skeleton/style/index.d.ts +3 -0
- package/cjs/skeleton/style/index.js +7 -0
- package/cjs/skeleton/style/index.less +147 -0
- package/cjs/skeleton/type.d.ts +104 -0
- package/cjs/skeleton/type.js +3 -0
- package/cjs/style.d.ts +1 -0
- package/cjs/style.js +2 -0
- package/cjs/tabs/index.js +8 -2
- package/dist/index.js +532 -147
- package/dist/index.min.js +5 -5
- package/dist/style.css +123 -0
- package/dist/style.min.css +1 -1
- package/esm/_helpers/hooks.d.ts +7 -1
- package/esm/_helpers/hooks.js +8 -2
- package/esm/form/form-item.js +109 -108
- package/esm/grid/style/css/index.css +4 -0
- package/esm/grid/style/index.less +6 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/nav-bar/index.d.ts +3 -3
- package/esm/picker-view/components/picker-cell.js +20 -6
- package/esm/skeleton/demo/style/css/mobile.css +7 -0
- package/esm/skeleton/demo/style/mobile.less +13 -0
- package/esm/skeleton/elements.d.ts +7 -0
- package/esm/skeleton/elements.js +281 -0
- package/esm/skeleton/index.d.ts +18 -0
- package/esm/skeleton/index.js +82 -0
- package/esm/skeleton/skeleton-context.d.ts +3 -0
- package/esm/skeleton/skeleton-context.js +5 -0
- package/esm/skeleton/style/css/index.css +180 -0
- package/esm/skeleton/style/css/index.d.ts +3 -0
- package/esm/skeleton/style/css/index.js +3 -0
- package/esm/skeleton/style/index.d.ts +3 -0
- package/esm/skeleton/style/index.js +3 -0
- package/esm/skeleton/style/index.less +147 -0
- package/esm/skeleton/type.d.ts +104 -0
- package/esm/skeleton/type.js +1 -0
- package/esm/style.d.ts +1 -0
- package/esm/style.js +1 -0
- package/esm/tabs/index.js +9 -3
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +16 -0
- package/tokens/app/arcodesign/default/index.d.ts +16 -0
- package/tokens/app/arcodesign/default/index.js +17 -1
- package/tokens/app/arcodesign/default/index.json +190 -0
- package/tokens/app/arcodesign/default/index.less +16 -0
- package/umd/_helpers/hooks.d.ts +7 -1
- package/umd/_helpers/hooks.js +9 -5
- package/umd/form/form-item.js +109 -108
- package/umd/grid/style/css/index.css +4 -0
- package/umd/grid/style/index.less +6 -0
- package/umd/index.d.ts +1 -0
- package/umd/index.js +7 -5
- package/umd/nav-bar/index.d.ts +3 -3
- package/umd/picker-view/components/picker-cell.js +20 -6
- package/umd/skeleton/demo/style/css/mobile.css +7 -0
- package/umd/skeleton/demo/style/mobile.less +13 -0
- package/umd/skeleton/elements.d.ts +7 -0
- package/umd/skeleton/elements.js +306 -0
- package/umd/skeleton/index.d.ts +18 -0
- package/umd/skeleton/index.js +104 -0
- package/umd/skeleton/skeleton-context.d.ts +3 -0
- package/umd/skeleton/skeleton-context.js +28 -0
- package/umd/skeleton/style/css/index.css +180 -0
- package/umd/skeleton/style/css/index.d.ts +3 -0
- package/umd/skeleton/style/css/index.js +15 -0
- package/umd/skeleton/style/index.d.ts +3 -0
- package/umd/skeleton/style/index.js +15 -0
- package/umd/skeleton/style/index.less +147 -0
- package/umd/skeleton/type.d.ts +104 -0
- package/umd/skeleton/type.js +17 -0
- package/umd/style.d.ts +1 -0
- package/umd/style.js +4 -4
- package/umd/tabs/index.js +8 -2
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { SkeletonProps, SkeletonRef } from './type';
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<SkeletonRef>> & {
|
4
|
+
Node: React.ForwardRefExoticComponent<import("./type").SkeletonNodeProps & React.RefAttributes<SkeletonRef>>;
|
5
|
+
Title: React.ForwardRefExoticComponent<import("./type").SkeletonTitleProps & React.RefAttributes<SkeletonRef>>;
|
6
|
+
Paragraph: React.ForwardRefExoticComponent<import("./type").SkeletonParagraphProps & React.RefAttributes<SkeletonRef>>;
|
7
|
+
Avatar: React.ForwardRefExoticComponent<import("./type").SkeletonAvatarProps & React.RefAttributes<SkeletonRef>>;
|
8
|
+
Grid: React.ForwardRefExoticComponent<import("./type").SkeletonGridProps & React.RefAttributes<SkeletonRef>>;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* 在内容加载过程中展示一组占位图形。
|
12
|
+
* @en Display a set of placeholder graphics during content loading
|
13
|
+
* @type 信息展示
|
14
|
+
* @type_en Data Display
|
15
|
+
* @name 骨架屏
|
16
|
+
* @name_en Skeleton
|
17
|
+
*/
|
18
|
+
export default _default;
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import React, { useRef, forwardRef, useImperativeHandle, useContext } from 'react';
|
3
|
+
import { cls, componentWrapper } from '@arco-design/mobile-utils';
|
4
|
+
import { GlobalContext } from '../context-provider';
|
5
|
+
import { SkeletonAvatar as Avatar, SkeletonGrid as Grid, SkeletonNode as Node, SkeletonParagraph as Paragraph, SkeletonTitle as Title } from './elements';
|
6
|
+
import { SkeletonContext } from './skeleton-context';
|
7
|
+
|
8
|
+
function getComponentProps(prop) {
|
9
|
+
if (prop && typeof prop === 'object') {
|
10
|
+
return prop;
|
11
|
+
}
|
12
|
+
|
13
|
+
return {};
|
14
|
+
}
|
15
|
+
|
16
|
+
var Skeleton = /*#__PURE__*/forwardRef(function (props, ref) {
|
17
|
+
var _cls;
|
18
|
+
|
19
|
+
var _props$className = props.className,
|
20
|
+
className = _props$className === void 0 ? '' : _props$className,
|
21
|
+
style = props.style,
|
22
|
+
children = props.children,
|
23
|
+
_props$title = props.title,
|
24
|
+
title = _props$title === void 0 ? true : _props$title,
|
25
|
+
_props$paragraph = props.paragraph,
|
26
|
+
paragraph = _props$paragraph === void 0 ? true : _props$paragraph,
|
27
|
+
_props$avatar = props.avatar,
|
28
|
+
avatar = _props$avatar === void 0 ? false : _props$avatar,
|
29
|
+
grid = props.grid,
|
30
|
+
_props$showAnimation = props.showAnimation,
|
31
|
+
showAnimation = _props$showAnimation === void 0 ? true : _props$showAnimation,
|
32
|
+
_props$animation = props.animation,
|
33
|
+
animation = _props$animation === void 0 ? 'gradient' : _props$animation,
|
34
|
+
animationGradientColor = props.animationGradientColor,
|
35
|
+
backgroundColor = props.backgroundColor;
|
36
|
+
var domRef = useRef(null);
|
37
|
+
|
38
|
+
var _useContext = useContext(GlobalContext),
|
39
|
+
prefixCls = _useContext.prefixCls;
|
40
|
+
|
41
|
+
useImperativeHandle(ref, function () {
|
42
|
+
return {
|
43
|
+
dom: domRef.current
|
44
|
+
};
|
45
|
+
});
|
46
|
+
var isGrid = !!grid;
|
47
|
+
var hasTitle = !!title;
|
48
|
+
var hasParagraph = !!paragraph;
|
49
|
+
var hasAvatar = !!avatar;
|
50
|
+
var content = isGrid ? /*#__PURE__*/React.createElement(Grid, getComponentProps(grid)) : /*#__PURE__*/React.createElement(React.Fragment, null, hasAvatar && /*#__PURE__*/React.createElement(Avatar, getComponentProps(avatar)), (hasTitle || hasParagraph) && /*#__PURE__*/React.createElement("div", {
|
51
|
+
className: prefixCls + "-skeleton-content"
|
52
|
+
}, hasTitle && /*#__PURE__*/React.createElement(Title, getComponentProps(title)), hasParagraph && /*#__PURE__*/React.createElement(Paragraph, getComponentProps(paragraph))));
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
54
|
+
className: cls(prefixCls + "-skeleton", (_cls = {}, _cls[prefixCls + "-skeleton-with-avatar"] = hasAvatar, _cls), className),
|
55
|
+
style: _extends({
|
56
|
+
color: animationGradientColor
|
57
|
+
}, style),
|
58
|
+
ref: domRef
|
59
|
+
}, /*#__PURE__*/React.createElement(SkeletonContext.Provider, {
|
60
|
+
value: {
|
61
|
+
showAnimation: showAnimation,
|
62
|
+
animation: animation,
|
63
|
+
backgroundColor: backgroundColor
|
64
|
+
}
|
65
|
+
}, content, children));
|
66
|
+
});
|
67
|
+
/**
|
68
|
+
* 在内容加载过程中展示一组占位图形。
|
69
|
+
* @en Display a set of placeholder graphics during content loading
|
70
|
+
* @type 信息展示
|
71
|
+
* @type_en Data Display
|
72
|
+
* @name 骨架屏
|
73
|
+
* @name_en Skeleton
|
74
|
+
*/
|
75
|
+
|
76
|
+
export default componentWrapper(Skeleton, {
|
77
|
+
Node: Node,
|
78
|
+
Title: Title,
|
79
|
+
Paragraph: Paragraph,
|
80
|
+
Avatar: Avatar,
|
81
|
+
Grid: Grid
|
82
|
+
});
|
@@ -0,0 +1,180 @@
|
|
1
|
+
.arco-skeleton {
|
2
|
+
position: relative;
|
3
|
+
color: rgba(255, 255, 255, 0.6) ;
|
4
|
+
}
|
5
|
+
.arco-skeleton-title {
|
6
|
+
height: 0.32rem ;
|
7
|
+
}
|
8
|
+
.arco-skeleton-paragraph-line {
|
9
|
+
width: 100%;
|
10
|
+
height: 0.32rem ;
|
11
|
+
}
|
12
|
+
.arco-skeleton-paragraph-line + .arco-skeleton-paragraph-line {
|
13
|
+
margin-top: 0.24rem ;
|
14
|
+
}
|
15
|
+
.arco-skeleton-avatar.arco-skeleton-item {
|
16
|
+
width: 0.64rem ;
|
17
|
+
height: 0.64rem ;
|
18
|
+
border-radius: 100%;
|
19
|
+
-webkit-transform: translateZ(0);
|
20
|
+
transform: translateZ(0);
|
21
|
+
}
|
22
|
+
.arco-skeleton-content {
|
23
|
+
width: 100%;
|
24
|
+
}
|
25
|
+
.arco-skeleton-content .arco-skeleton-title + .arco-skeleton-paragraph {
|
26
|
+
margin-top: 0.4rem ;
|
27
|
+
}
|
28
|
+
.arco-skeleton-with-avatar {
|
29
|
+
display: -webkit-box;
|
30
|
+
display: -webkit-flex;
|
31
|
+
display: flex;
|
32
|
+
-webkit-box-align: start;
|
33
|
+
-webkit-align-items: flex-start;
|
34
|
+
align-items: flex-start;
|
35
|
+
}
|
36
|
+
.arco-skeleton-with-avatar .arco-skeleton-avatar {
|
37
|
+
-webkit-box-flex: 0;
|
38
|
+
-webkit-flex: none;
|
39
|
+
flex: none;
|
40
|
+
}
|
41
|
+
.arco-skeleton-with-avatar .arco-skeleton-content .arco-skeleton-title {
|
42
|
+
margin-top: 0.16rem ;
|
43
|
+
}
|
44
|
+
.arco-skeleton-with-avatar .arco-skeleton-avatar + .arco-skeleton-content {
|
45
|
+
margin-left: 0.16rem ;
|
46
|
+
}
|
47
|
+
[dir="rtl"] .arco-skeleton-with-avatar .arco-skeleton-avatar + .arco-skeleton-content {
|
48
|
+
margin-left: initial;
|
49
|
+
margin-right: 0.16rem ;
|
50
|
+
}
|
51
|
+
.arco-skeleton-grid {
|
52
|
+
display: -webkit-box;
|
53
|
+
display: -webkit-flex;
|
54
|
+
display: flex;
|
55
|
+
-webkit-box-pack: justify;
|
56
|
+
-webkit-justify-content: space-between;
|
57
|
+
justify-content: space-between;
|
58
|
+
width: 100%;
|
59
|
+
}
|
60
|
+
.arco-skeleton-grid-item {
|
61
|
+
display: -webkit-box;
|
62
|
+
display: -webkit-flex;
|
63
|
+
display: flex;
|
64
|
+
-webkit-box-orient: vertical;
|
65
|
+
-webkit-box-direction: normal;
|
66
|
+
-webkit-flex-direction: column;
|
67
|
+
flex-direction: column;
|
68
|
+
-webkit-box-align: center;
|
69
|
+
-webkit-align-items: center;
|
70
|
+
align-items: center;
|
71
|
+
}
|
72
|
+
.arco-skeleton-grid-icon {
|
73
|
+
width: 0.64rem ;
|
74
|
+
height: 0.64rem ;
|
75
|
+
}
|
76
|
+
.arco-skeleton-grid-text {
|
77
|
+
margin-top: 0.16rem ;
|
78
|
+
width: 1.28rem ;
|
79
|
+
height: 0.32rem ;
|
80
|
+
}
|
81
|
+
.arco-skeleton-node {
|
82
|
+
display: inline-block;
|
83
|
+
}
|
84
|
+
.arco-skeleton-item {
|
85
|
+
position: relative;
|
86
|
+
overflow: hidden;
|
87
|
+
border-radius: 0 ;
|
88
|
+
background-color: #F2F3F5 ;
|
89
|
+
}
|
90
|
+
.arco-skeleton-animation-item {
|
91
|
+
position: absolute;
|
92
|
+
width: 100vw;
|
93
|
+
height: 100%;
|
94
|
+
top: 0;
|
95
|
+
left: 0;
|
96
|
+
background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 35%, currentColor 50%, rgba(255, 255, 255, 0) 65%);
|
97
|
+
background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 35%, currentColor 50%, rgba(255, 255, 255, 0) 65%);
|
98
|
+
-webkit-transform-origin: top left;
|
99
|
+
transform-origin: top left;
|
100
|
+
-webkit-animation-name: skeleton-gradient;
|
101
|
+
animation-name: skeleton-gradient;
|
102
|
+
-webkit-animation-iteration-count: infinite;
|
103
|
+
animation-iteration-count: infinite;
|
104
|
+
-webkit-animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1) ;
|
105
|
+
animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1) ;
|
106
|
+
-webkit-animation-duration: 1.5s ;
|
107
|
+
animation-duration: 1.5s ;
|
108
|
+
}
|
109
|
+
[dir="rtl"] .arco-skeleton-animation-item {
|
110
|
+
-webkit-animation-name: skeleton-gradient-reverse;
|
111
|
+
animation-name: skeleton-gradient-reverse;
|
112
|
+
}
|
113
|
+
.arco-skeleton-animation-breath {
|
114
|
+
-webkit-animation: skeleton-breath linear infinite;
|
115
|
+
animation: skeleton-breath linear infinite;
|
116
|
+
-webkit-animation-duration: 1.5s ;
|
117
|
+
animation-duration: 1.5s ;
|
118
|
+
}
|
119
|
+
@-webkit-keyframes skeleton-gradient {
|
120
|
+
0% {
|
121
|
+
-webkit-transform: translateX(-65%) skewX(-45deg);
|
122
|
+
transform: translateX(-65%) skewX(-45deg);
|
123
|
+
}
|
124
|
+
100% {
|
125
|
+
-webkit-transform: translateX(135%) skewX(-45deg);
|
126
|
+
transform: translateX(135%) skewX(-45deg);
|
127
|
+
}
|
128
|
+
}
|
129
|
+
@keyframes skeleton-gradient {
|
130
|
+
0% {
|
131
|
+
-webkit-transform: translateX(-65%) skewX(-45deg);
|
132
|
+
transform: translateX(-65%) skewX(-45deg);
|
133
|
+
}
|
134
|
+
100% {
|
135
|
+
-webkit-transform: translateX(135%) skewX(-45deg);
|
136
|
+
transform: translateX(135%) skewX(-45deg);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
@-webkit-keyframes skeleton-gradient-reverse {
|
140
|
+
0% {
|
141
|
+
-webkit-transform: translateX(65%) skewX(45deg);
|
142
|
+
transform: translateX(65%) skewX(45deg);
|
143
|
+
}
|
144
|
+
100% {
|
145
|
+
-webkit-transform: translateX(-135%) skewX(45deg);
|
146
|
+
transform: translateX(-135%) skewX(45deg);
|
147
|
+
}
|
148
|
+
}
|
149
|
+
@keyframes skeleton-gradient-reverse {
|
150
|
+
0% {
|
151
|
+
-webkit-transform: translateX(65%) skewX(45deg);
|
152
|
+
transform: translateX(65%) skewX(45deg);
|
153
|
+
}
|
154
|
+
100% {
|
155
|
+
-webkit-transform: translateX(-135%) skewX(45deg);
|
156
|
+
transform: translateX(-135%) skewX(45deg);
|
157
|
+
}
|
158
|
+
}
|
159
|
+
@-webkit-keyframes skeleton-breath {
|
160
|
+
0% {
|
161
|
+
opacity: 1;
|
162
|
+
}
|
163
|
+
50% {
|
164
|
+
opacity: 0.4 ;
|
165
|
+
}
|
166
|
+
100% {
|
167
|
+
opacity: 1;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
@keyframes skeleton-breath {
|
171
|
+
0% {
|
172
|
+
opacity: 1;
|
173
|
+
}
|
174
|
+
50% {
|
175
|
+
opacity: 0.4 ;
|
176
|
+
}
|
177
|
+
100% {
|
178
|
+
opacity: 1;
|
179
|
+
}
|
180
|
+
}
|
@@ -0,0 +1,147 @@
|
|
1
|
+
@import '../../../style/mixin.less';
|
2
|
+
|
3
|
+
.@{prefix}-skeleton {
|
4
|
+
position: relative;
|
5
|
+
.use-var(color, skeleton-gradient-animation-color);
|
6
|
+
}
|
7
|
+
|
8
|
+
.@{prefix}-skeleton-title {
|
9
|
+
.use-var(height, skeleton-title-height);
|
10
|
+
}
|
11
|
+
|
12
|
+
.@{prefix}-skeleton-paragraph {
|
13
|
+
&-line {
|
14
|
+
width: 100%;
|
15
|
+
.use-var(height, skeleton-paragraph-height);
|
16
|
+
}
|
17
|
+
|
18
|
+
&-line + &-line {
|
19
|
+
.use-var(margin-top, skeleton-paragraph-margin-top);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
.@{prefix}-skeleton-avatar.@{prefix}-skeleton-item {
|
24
|
+
.use-var(width, skeleton-avatar-size);
|
25
|
+
.use-var(height, skeleton-avatar-size);
|
26
|
+
border-radius: 100%;
|
27
|
+
transform: translateZ(0);
|
28
|
+
}
|
29
|
+
|
30
|
+
.@{prefix}-skeleton-content {
|
31
|
+
width: 100%;
|
32
|
+
|
33
|
+
.@{prefix}-skeleton-title + .@{prefix}-skeleton-paragraph {
|
34
|
+
.use-var(margin-top, skeleton-large-gutter);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
.@{prefix}-skeleton-with-avatar {
|
39
|
+
display: flex;
|
40
|
+
align-items: flex-start;
|
41
|
+
|
42
|
+
.@{prefix}-skeleton-avatar {
|
43
|
+
flex: none;
|
44
|
+
}
|
45
|
+
|
46
|
+
.@{prefix}-skeleton-content {
|
47
|
+
.@{prefix}-skeleton-title {
|
48
|
+
.use-var(margin-top, skeleton-medium-gutter);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
.@{prefix}-skeleton-avatar + .@{prefix}-skeleton-content {
|
53
|
+
.use-var-with-rtl(margin-left, skeleton-medium-gutter);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
.@{prefix}-skeleton-grid {
|
58
|
+
display: flex;
|
59
|
+
justify-content: space-between;
|
60
|
+
width: 100%;
|
61
|
+
|
62
|
+
&-item {
|
63
|
+
display: flex;
|
64
|
+
flex-direction: column;
|
65
|
+
align-items: center;
|
66
|
+
}
|
67
|
+
&-icon {
|
68
|
+
.use-var(width, skeleton-grid-icon-size);
|
69
|
+
.use-var(height, skeleton-grid-icon-size);
|
70
|
+
}
|
71
|
+
&-text {
|
72
|
+
.use-var(margin-top, skeleton-medium-gutter);
|
73
|
+
.use-var(width, skeleton-grid-text-width);
|
74
|
+
.use-var(height, skeleton-grid-text-height);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
.@{prefix}-skeleton-node {
|
79
|
+
display: inline-block;
|
80
|
+
}
|
81
|
+
|
82
|
+
.@{prefix}-skeleton-item {
|
83
|
+
position: relative;
|
84
|
+
overflow: hidden;
|
85
|
+
.use-var(border-radius, skeleton-border-radius);
|
86
|
+
.use-var(background-color, skeleton-background-color);
|
87
|
+
}
|
88
|
+
|
89
|
+
.@{prefix}-skeleton-animation-item {
|
90
|
+
position: absolute;
|
91
|
+
width: 100vw;
|
92
|
+
height: 100%;
|
93
|
+
top: 0;
|
94
|
+
left: 0;
|
95
|
+
background-image: linear-gradient(
|
96
|
+
90deg,
|
97
|
+
rgba(255, 255, 255, 0) 35%,
|
98
|
+
currentColor 50%,
|
99
|
+
rgba(255, 255, 255, 0) 65%
|
100
|
+
);
|
101
|
+
transform-origin: top left;
|
102
|
+
animation-name: skeleton-gradient;
|
103
|
+
animation-iteration-count: infinite;
|
104
|
+
.use-var(animation-timing-function, skeleton-gradient-animation-timing-function);
|
105
|
+
.use-var(animation-duration, skeleton-gradient-animation-duration);
|
106
|
+
[dir="rtl"] & {
|
107
|
+
animation-name: skeleton-gradient-reverse;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
.@{prefix}-skeleton-animation-breath {
|
111
|
+
animation: skeleton-breath linear infinite;
|
112
|
+
.use-var(animation-duration, skeleton-breath-animation-duration);
|
113
|
+
}
|
114
|
+
|
115
|
+
@keyframes skeleton-gradient {
|
116
|
+
0% {
|
117
|
+
transform: translateX(-65%) skewX(-45deg);
|
118
|
+
}
|
119
|
+
|
120
|
+
100% {
|
121
|
+
transform: translateX(135%) skewX(-45deg);
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
@keyframes skeleton-gradient-reverse {
|
126
|
+
0% {
|
127
|
+
transform: translateX(65%) skewX(45deg);
|
128
|
+
}
|
129
|
+
|
130
|
+
100% {
|
131
|
+
transform: translateX(-135%) skewX(45deg);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
@keyframes skeleton-breath {
|
136
|
+
0% {
|
137
|
+
opacity: 1;
|
138
|
+
}
|
139
|
+
|
140
|
+
50% {
|
141
|
+
.use-var(opacity, skeleton-breath-opacity);
|
142
|
+
}
|
143
|
+
|
144
|
+
100% {
|
145
|
+
opacity: 1;
|
146
|
+
}
|
147
|
+
}
|
@@ -0,0 +1,104 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { BaseProps, SimpleBaseProps } from '../_helpers';
|
3
|
+
export interface SkeletonProps extends SimpleBaseProps {
|
4
|
+
/**
|
5
|
+
* 是否显示标题占位图
|
6
|
+
* @en Show title placeholder
|
7
|
+
* @default true
|
8
|
+
*/
|
9
|
+
title?: boolean | SkeletonTitleProps;
|
10
|
+
/**
|
11
|
+
* 是否显示段落占位图
|
12
|
+
* @en Show paragraph placeholder
|
13
|
+
* @default true
|
14
|
+
*/
|
15
|
+
paragraph?: boolean | SkeletonParagraphProps;
|
16
|
+
/**
|
17
|
+
* 是否显示头像占位图
|
18
|
+
* @en Show Avatar placeholder
|
19
|
+
* @default false
|
20
|
+
*/
|
21
|
+
avatar?: boolean | SkeletonAvatarProps;
|
22
|
+
/**
|
23
|
+
* 是否显示金刚位占位图(如该参数非空时,默认展示四列金刚位,且不展示标题/段落/头像占位符)
|
24
|
+
* @en Show Grid placeholder. When it's value is present, the paragraph, avatar or title placeholder will not be displayed, and four columns will be displayed by default
|
25
|
+
* @default false
|
26
|
+
*/
|
27
|
+
grid?: boolean | SkeletonGridProps;
|
28
|
+
/**
|
29
|
+
* 是否展示动画效果
|
30
|
+
* @en Show loading effect
|
31
|
+
* @default true
|
32
|
+
*/
|
33
|
+
showAnimation?: boolean;
|
34
|
+
/**
|
35
|
+
* 加载动画效果,可选“扫光”、“呼吸”两种效果
|
36
|
+
* @en Animation of loading effect, 'gradient' and 'breath' effects are optional
|
37
|
+
* @default "gradient"
|
38
|
+
*/
|
39
|
+
animation?: 'gradient' | 'breath';
|
40
|
+
/**
|
41
|
+
* 扫光动效高光颜色
|
42
|
+
* @en Highlight color of gradient animation
|
43
|
+
* @default "rgba(0, 0, 0, 0.04)"
|
44
|
+
*/
|
45
|
+
animationGradientColor?: string;
|
46
|
+
/**
|
47
|
+
* 占位块背景色
|
48
|
+
* @en Background color of skeleton item
|
49
|
+
* @default "#F7F8FA"
|
50
|
+
*/
|
51
|
+
backgroundColor?: string;
|
52
|
+
/**
|
53
|
+
* 子元素
|
54
|
+
* @en Children element
|
55
|
+
* @default null
|
56
|
+
*/
|
57
|
+
children?: React.ReactNode;
|
58
|
+
}
|
59
|
+
export interface SkeletonTitleProps extends SimpleBaseProps {
|
60
|
+
/**
|
61
|
+
* 标题占位图宽度
|
62
|
+
* @en The width of title
|
63
|
+
* @default "40%"
|
64
|
+
*/
|
65
|
+
width?: number | string;
|
66
|
+
}
|
67
|
+
export interface SkeletonParagraphProps extends SimpleBaseProps {
|
68
|
+
/**
|
69
|
+
* 段落占位图的行数
|
70
|
+
* @en Number of lines for paragraph
|
71
|
+
* @default 3
|
72
|
+
*/
|
73
|
+
rows?: number;
|
74
|
+
/**
|
75
|
+
* 段落占位图宽度,若为数组格式对应每行宽度,否则表示最后一行的宽度
|
76
|
+
* @en The width of paragraph. If width is an Array, it corresponds to the width of each line, otherwise it indicates the width of the last line
|
77
|
+
* @default "60%"
|
78
|
+
*/
|
79
|
+
width?: number | string | Array<number | string>;
|
80
|
+
}
|
81
|
+
export interface SkeletonAvatarProps extends SimpleBaseProps {
|
82
|
+
}
|
83
|
+
export interface SkeletonGridProps extends SimpleBaseProps {
|
84
|
+
/**
|
85
|
+
* 金刚位列数
|
86
|
+
* @en columns of grid
|
87
|
+
* @default 4
|
88
|
+
*/
|
89
|
+
columns?: number;
|
90
|
+
}
|
91
|
+
export interface SkeletonNodeProps extends BaseProps {
|
92
|
+
}
|
93
|
+
export interface SkeletonRef {
|
94
|
+
/**
|
95
|
+
* 最外层 DOM 元素
|
96
|
+
* @en The outer DOM element of the component
|
97
|
+
*/
|
98
|
+
dom: HTMLDivElement | null;
|
99
|
+
}
|
100
|
+
export interface SkeletonContextParams {
|
101
|
+
backgroundColor?: string;
|
102
|
+
showAnimation: boolean;
|
103
|
+
animation: SkeletonProps['animation'];
|
104
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/esm/style.d.ts
CHANGED
package/esm/style.js
CHANGED
package/esm/tabs/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import React, { useRef, forwardRef, useImperativeHandle, useState, useEffect, useCallback, useContext } from 'react';
|
3
|
-
import { cls, nextTick } from '@arco-design/mobile-utils';
|
3
|
+
import { cls, nextTick, getOffset } from '@arco-design/mobile-utils';
|
4
4
|
import { ContextLayout, GlobalContext } from '../context-provider';
|
5
5
|
import TabCell from './tab-cell';
|
6
6
|
import TabPane from './tab-pane';
|
@@ -401,9 +401,15 @@ var Tabs = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
401
401
|
}
|
402
402
|
|
403
403
|
function updateLayout() {
|
404
|
+
var _domRef$current, _domRef$current2;
|
405
|
+
|
406
|
+
var _getOffset = getOffset(domRef.current),
|
407
|
+
width = _getOffset.width,
|
408
|
+
height = _getOffset.height;
|
409
|
+
|
404
410
|
cellRef.current && cellRef.current.resetUnderlineStyle();
|
405
|
-
setWrapWidth(domRef.current ?
|
406
|
-
setWrapHeight(domRef.current ?
|
411
|
+
setWrapWidth(width || ((_domRef$current = domRef.current) == null ? void 0 : _domRef$current.offsetWidth) || 0);
|
412
|
+
setWrapHeight(height || ((_domRef$current2 = domRef.current) == null ? void 0 : _domRef$current2.offsetHeight) || 0);
|
407
413
|
paneRef.current && paneRef.current.setCurrentHeight();
|
408
414
|
}
|
409
415
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arco-design/mobile-react",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.29.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "esm/index.js",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
"author": "taoyiyue@bytedance.com",
|
16
16
|
"license": "ISC",
|
17
17
|
"dependencies": {
|
18
|
-
"@arco-design/mobile-utils": "2.16.
|
18
|
+
"@arco-design/mobile-utils": "2.16.3",
|
19
19
|
"@arco-design/transformable": "^1.0.0",
|
20
20
|
"lodash.throttle": "^4.1.1",
|
21
21
|
"resize-observer-polyfill": "^1.5.1"
|
@@ -49,5 +49,5 @@
|
|
49
49
|
"publishConfig": {
|
50
50
|
"access": "public"
|
51
51
|
},
|
52
|
-
"gitHead": "
|
52
|
+
"gitHead": "8fbc59117b0d240f4faeee45daca1489803ab78a"
|
53
53
|
}
|
@@ -793,4 +793,20 @@
|
|
793
793
|
--divider-right-width: ~`pxtorem(28)`;
|
794
794
|
--divider-content-padding: ~`pxtorem(12)`;
|
795
795
|
--divider-padding: ~`pxtorem(16)`;
|
796
|
+
--skeleton-border-radius: ~`pxtorem(0)`;
|
797
|
+
--skeleton-background-color: #F2F3F5;
|
798
|
+
--skeleton-gradient-animation-color: rgba(255, 255, 255, 0.6);
|
799
|
+
--skeleton-breath-opacity: 0.4;
|
800
|
+
--skeleton-gradient-animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
|
801
|
+
--skeleton-gradient-animation-duration: 1.5s;
|
802
|
+
--skeleton-breath-animation-duration: 1.5s;
|
803
|
+
--skeleton-title-height: ~`pxtorem(16)`;
|
804
|
+
--skeleton-paragraph-height: ~`pxtorem(16)`;
|
805
|
+
--skeleton-paragraph-margin-top: ~`pxtorem(12)`;
|
806
|
+
--skeleton-avatar-size: ~`pxtorem(32)`;
|
807
|
+
--skeleton-grid-icon-size: ~`pxtorem(32)`;
|
808
|
+
--skeleton-grid-text-width: ~`pxtorem(64)`;
|
809
|
+
--skeleton-grid-text-height: ~`pxtorem(16)`;
|
810
|
+
--skeleton-medium-gutter: ~`pxtorem(8)`;
|
811
|
+
--skeleton-large-gutter: ~`pxtorem(20)`;
|
796
812
|
}
|
@@ -792,6 +792,22 @@ export interface ArcodesignToken extends Record<string, string> {
|
|
792
792
|
'divider-right-width': string;
|
793
793
|
'divider-content-padding': string;
|
794
794
|
'divider-padding': string;
|
795
|
+
'skeleton-border-radius': string;
|
796
|
+
'skeleton-background-color': string;
|
797
|
+
'skeleton-gradient-animation-color': string;
|
798
|
+
'skeleton-breath-opacity': string;
|
799
|
+
'skeleton-gradient-animation-timing-function': string;
|
800
|
+
'skeleton-gradient-animation-duration': string;
|
801
|
+
'skeleton-breath-animation-duration': string;
|
802
|
+
'skeleton-title-height': string;
|
803
|
+
'skeleton-paragraph-height': string;
|
804
|
+
'skeleton-paragraph-margin-top': string;
|
805
|
+
'skeleton-avatar-size': string;
|
806
|
+
'skeleton-grid-icon-size': string;
|
807
|
+
'skeleton-grid-text-width': string;
|
808
|
+
'skeleton-grid-text-height': string;
|
809
|
+
'skeleton-medium-gutter': string;
|
810
|
+
'skeleton-large-gutter': string;
|
795
811
|
}
|
796
812
|
declare const tokens: ArcodesignToken;
|
797
813
|
export default tokens;
|