dtable-ui-component 6.0.24-beta.1 → 6.0.24-beta.2
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/lib/List/index.css +381 -0
- package/lib/List/index.js +41 -0
- package/lib/List/list-item.js +169 -0
- package/lib/index.js +8 -1
- package/package.json +3 -2
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
.am-list-header {
|
|
2
|
+
padding: 15px 15px 9px 15px;
|
|
3
|
+
font-size: 14px;
|
|
4
|
+
color: #888;
|
|
5
|
+
width: 100%;
|
|
6
|
+
-webkit-box-sizing: border-box;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.am-list-footer {
|
|
11
|
+
padding: 9px 15px 15px 15px;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
color: #888;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.am-list-body {
|
|
17
|
+
position: relative;
|
|
18
|
+
background-color: #fff;
|
|
19
|
+
border-top: 1PX solid #ddd;
|
|
20
|
+
border-bottom: 1PX solid #ddd;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
|
|
24
|
+
html:not([data-scale]) .am-list-body {
|
|
25
|
+
border-top: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
html:not([data-scale]) .am-list-body::before {
|
|
29
|
+
content: '';
|
|
30
|
+
position: absolute;
|
|
31
|
+
background-color: #ddd;
|
|
32
|
+
display: block;
|
|
33
|
+
z-index: 1;
|
|
34
|
+
top: 0;
|
|
35
|
+
right: auto;
|
|
36
|
+
bottom: auto;
|
|
37
|
+
left: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 1PX;
|
|
40
|
+
-webkit-transform-origin: 50% 50%;
|
|
41
|
+
-ms-transform-origin: 50% 50%;
|
|
42
|
+
transform-origin: 50% 50%;
|
|
43
|
+
-webkit-transform: scaleY(0.5);
|
|
44
|
+
-ms-transform: scaleY(0.5);
|
|
45
|
+
transform: scaleY(0.5);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@media (-webkit-min-device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 3), (min-resolution: 2dppx) and (min-resolution: 3dppx) {
|
|
50
|
+
html:not([data-scale]) .am-list-body::before {
|
|
51
|
+
-webkit-transform: scaleY(0.33);
|
|
52
|
+
-ms-transform: scaleY(0.33);
|
|
53
|
+
transform: scaleY(0.33);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
|
|
58
|
+
html:not([data-scale]) .am-list-body {
|
|
59
|
+
border-bottom: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
html:not([data-scale]) .am-list-body::after {
|
|
63
|
+
content: '';
|
|
64
|
+
position: absolute;
|
|
65
|
+
background-color: #ddd;
|
|
66
|
+
display: block;
|
|
67
|
+
z-index: 1;
|
|
68
|
+
top: auto;
|
|
69
|
+
right: auto;
|
|
70
|
+
bottom: 0;
|
|
71
|
+
left: 0;
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 1PX;
|
|
74
|
+
-webkit-transform-origin: 50% 100%;
|
|
75
|
+
-ms-transform-origin: 50% 100%;
|
|
76
|
+
transform-origin: 50% 100%;
|
|
77
|
+
-webkit-transform: scaleY(0.5);
|
|
78
|
+
-ms-transform: scaleY(0.5);
|
|
79
|
+
transform: scaleY(0.5);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@media (-webkit-min-device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 3), (min-resolution: 2dppx) and (min-resolution: 3dppx) {
|
|
84
|
+
html:not([data-scale]) .am-list-body::after {
|
|
85
|
+
-webkit-transform: scaleY(0.33);
|
|
86
|
+
-ms-transform: scaleY(0.33);
|
|
87
|
+
transform: scaleY(0.33);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.am-list-body div:not(:last-child) .am-list-line {
|
|
92
|
+
border-bottom: 1PX solid #ddd;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
|
|
96
|
+
html:not([data-scale]) .am-list-body div:not(:last-child) .am-list-line {
|
|
97
|
+
border-bottom: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
html:not([data-scale]) .am-list-body div:not(:last-child) .am-list-line::after {
|
|
101
|
+
content: '';
|
|
102
|
+
position: absolute;
|
|
103
|
+
background-color: #ddd;
|
|
104
|
+
display: block;
|
|
105
|
+
z-index: 1;
|
|
106
|
+
top: auto;
|
|
107
|
+
right: auto;
|
|
108
|
+
bottom: 0;
|
|
109
|
+
left: 0;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 1PX;
|
|
112
|
+
-webkit-transform-origin: 50% 100%;
|
|
113
|
+
-ms-transform-origin: 50% 100%;
|
|
114
|
+
transform-origin: 50% 100%;
|
|
115
|
+
-webkit-transform: scaleY(0.5);
|
|
116
|
+
-ms-transform: scaleY(0.5);
|
|
117
|
+
transform: scaleY(0.5);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@media (-webkit-min-device-pixel-ratio: 2) and (-webkit-min-device-pixel-ratio: 3), (min-resolution: 2dppx) and (min-resolution: 3dppx) {
|
|
122
|
+
html:not([data-scale]) .am-list-body div:not(:last-child) .am-list-line::after {
|
|
123
|
+
-webkit-transform: scaleY(0.33);
|
|
124
|
+
-ms-transform: scaleY(0.33);
|
|
125
|
+
transform: scaleY(0.33);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.am-list-item {
|
|
130
|
+
position: relative;
|
|
131
|
+
display: -webkit-box;
|
|
132
|
+
display: -webkit-flex;
|
|
133
|
+
display: -ms-flexbox;
|
|
134
|
+
display: flex;
|
|
135
|
+
padding-left: 15px;
|
|
136
|
+
min-height: 44px;
|
|
137
|
+
background-color: #fff;
|
|
138
|
+
vertical-align: middle;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
-webkit-transition: background-color 200ms;
|
|
141
|
+
transition: background-color 200ms;
|
|
142
|
+
-webkit-box-align: center;
|
|
143
|
+
-webkit-align-items: center;
|
|
144
|
+
-ms-flex-align: center;
|
|
145
|
+
align-items: center;
|
|
146
|
+
/* list左图片显示*/
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.am-list-item .am-list-ripple {
|
|
150
|
+
position: absolute;
|
|
151
|
+
background: transparent;
|
|
152
|
+
display: inline-block;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
will-change: box-shadow, transform;
|
|
155
|
+
-webkit-transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);
|
|
156
|
+
transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);
|
|
157
|
+
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
158
|
+
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1);
|
|
159
|
+
outline: none;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
border-radius: 100%;
|
|
162
|
+
-webkit-transform: scale(0);
|
|
163
|
+
-ms-transform: scale(0);
|
|
164
|
+
transform: scale(0);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.am-list-item .am-list-ripple.am-list-ripple-animate {
|
|
168
|
+
background-color: rgba(158, 158, 158, 0.2);
|
|
169
|
+
-webkit-animation: ripple 1s linear;
|
|
170
|
+
animation: ripple 1s linear;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.am-list-item.am-list-item-top .am-list-line {
|
|
174
|
+
-webkit-box-align: start;
|
|
175
|
+
-webkit-align-items: flex-start;
|
|
176
|
+
-ms-flex-align: start;
|
|
177
|
+
align-items: flex-start;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.am-list-item.am-list-item-top .am-list-line .am-list-arrow {
|
|
181
|
+
margin-top: 2px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.am-list-item.am-list-item-middle .am-list-line {
|
|
185
|
+
-webkit-box-align: center;
|
|
186
|
+
-webkit-align-items: center;
|
|
187
|
+
-ms-flex-align: center;
|
|
188
|
+
align-items: center;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.am-list-item.am-list-item-bottom .am-list-line {
|
|
192
|
+
-webkit-box-align: end;
|
|
193
|
+
-webkit-align-items: flex-end;
|
|
194
|
+
-ms-flex-align: end;
|
|
195
|
+
align-items: flex-end;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.am-list-item.am-list-item-error .am-list-line .am-list-extra {
|
|
199
|
+
color: #f50;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.am-list-item.am-list-item-error .am-list-line .am-list-extra .am-list-brief {
|
|
203
|
+
color: #f50;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.am-list-item.am-list-item-active {
|
|
207
|
+
background-color: #ddd;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.am-list-item.am-list-item-disabled .am-list-line .am-list-content,
|
|
211
|
+
.am-list-item.am-list-item-disabled .am-list-line .am-list-extra {
|
|
212
|
+
color: #bbb;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.am-list-item img {
|
|
216
|
+
width: 22px;
|
|
217
|
+
height: 22px;
|
|
218
|
+
vertical-align: middle;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.am-list-item .am-list-thumb:first-child {
|
|
222
|
+
margin-right: 15px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.am-list-item .am-list-thumb:last-child {
|
|
226
|
+
margin-left: 8px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.am-list-item .am-list-line {
|
|
230
|
+
position: relative;
|
|
231
|
+
display: -webkit-box;
|
|
232
|
+
display: -webkit-flex;
|
|
233
|
+
display: -ms-flexbox;
|
|
234
|
+
display: flex;
|
|
235
|
+
-webkit-box-flex: 1;
|
|
236
|
+
-webkit-flex: 1;
|
|
237
|
+
-ms-flex: 1;
|
|
238
|
+
flex: 1;
|
|
239
|
+
-webkit-align-self: stretch;
|
|
240
|
+
-ms-flex-item-align: stretch;
|
|
241
|
+
align-self: stretch;
|
|
242
|
+
padding-right: 15px;
|
|
243
|
+
overflow: hidden;
|
|
244
|
+
/* list左侧主内容*/
|
|
245
|
+
/* list右补充内容*/
|
|
246
|
+
/* 辅助性文字*/
|
|
247
|
+
/* list右侧箭头*/
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.am-list-item .am-list-line .am-list-content {
|
|
251
|
+
-webkit-box-flex: 1;
|
|
252
|
+
-webkit-flex: 1;
|
|
253
|
+
-ms-flex: 1;
|
|
254
|
+
flex: 1;
|
|
255
|
+
color: #000;
|
|
256
|
+
font-size: 17px;
|
|
257
|
+
line-height: 1.5;
|
|
258
|
+
text-align: left;
|
|
259
|
+
width: auto;
|
|
260
|
+
overflow: hidden;
|
|
261
|
+
text-overflow: ellipsis;
|
|
262
|
+
white-space: nowrap;
|
|
263
|
+
padding-top: 7px;
|
|
264
|
+
padding-bottom: 7px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.am-list-item .am-list-line .am-list-extra {
|
|
268
|
+
-webkit-flex-basis: 36%;
|
|
269
|
+
-ms-flex-preferred-size: 36%;
|
|
270
|
+
flex-basis: 36%;
|
|
271
|
+
color: #888;
|
|
272
|
+
font-size: 16px;
|
|
273
|
+
line-height: 1.5;
|
|
274
|
+
text-align: right;
|
|
275
|
+
width: auto;
|
|
276
|
+
overflow: hidden;
|
|
277
|
+
text-overflow: ellipsis;
|
|
278
|
+
white-space: nowrap;
|
|
279
|
+
padding-top: 7px;
|
|
280
|
+
padding-bottom: 7px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.am-list-item .am-list-line .am-list-title {
|
|
284
|
+
width: auto;
|
|
285
|
+
overflow: hidden;
|
|
286
|
+
text-overflow: ellipsis;
|
|
287
|
+
white-space: nowrap;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.am-list-item .am-list-line .am-list-brief {
|
|
291
|
+
color: #888;
|
|
292
|
+
font-size: 15px;
|
|
293
|
+
line-height: 1.5;
|
|
294
|
+
margin-top: 6px;
|
|
295
|
+
width: auto;
|
|
296
|
+
overflow: hidden;
|
|
297
|
+
text-overflow: ellipsis;
|
|
298
|
+
white-space: nowrap;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.am-list-item .am-list-line .am-list-arrow {
|
|
302
|
+
display: block;
|
|
303
|
+
width: 15px;
|
|
304
|
+
height: 15px;
|
|
305
|
+
margin-left: 8px;
|
|
306
|
+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2216%22%20height%3D%2226%22%20viewBox%3D%220%200%2016%2026%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cg%20id%3D%22UI-KIT_%E5%9F%BA%E7%A1%80%E5%85%83%E4%BB%B6%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cg%20id%3D%229.9%E5%9F%BA%E7%A1%80%E5%85%83%E4%BB%B6%22%20transform%3D%22translate(-5809.000000%2C%20-8482.000000)%22%20fill%3D%22%23C7C7CC%22%3E%3Cpolygon%20id%3D%22Disclosure-Indicator%22%20points%3D%225811%208482%205809%208484%205820.5%208495%205809%208506%205811%208508%205825%208495%22%3E%3C%2Fpolygon%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E");
|
|
307
|
+
background-size: contain;
|
|
308
|
+
background-repeat: no-repeat;
|
|
309
|
+
background-position: 50% 50%;
|
|
310
|
+
visibility: hidden;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.am-list-item .am-list-line .am-list-arrow-horizontal {
|
|
314
|
+
visibility: visible;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.am-list-item .am-list-line .am-list-arrow-vertical {
|
|
318
|
+
visibility: visible;
|
|
319
|
+
-webkit-transform: rotate(90deg);
|
|
320
|
+
-ms-transform: rotate(90deg);
|
|
321
|
+
transform: rotate(90deg);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.am-list-item .am-list-line .am-list-arrow-vertical-up {
|
|
325
|
+
visibility: visible;
|
|
326
|
+
-webkit-transform: rotate(270deg);
|
|
327
|
+
-ms-transform: rotate(270deg);
|
|
328
|
+
transform: rotate(270deg);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.am-list-item .am-list-line-multiple {
|
|
332
|
+
padding: 12.5px 15px 12.5px 0;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.am-list-item .am-list-line-multiple .am-list-content {
|
|
336
|
+
padding-top: 0;
|
|
337
|
+
padding-bottom: 0;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.am-list-item .am-list-line-multiple .am-list-extra {
|
|
341
|
+
padding-top: 0;
|
|
342
|
+
padding-bottom: 0;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.am-list-item .am-list-line-wrap .am-list-content {
|
|
346
|
+
white-space: normal;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.am-list-item .am-list-line-wrap .am-list-extra {
|
|
350
|
+
white-space: normal;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.am-list-item select {
|
|
354
|
+
position: relative;
|
|
355
|
+
display: block;
|
|
356
|
+
width: 100%;
|
|
357
|
+
height: 100%;
|
|
358
|
+
padding: 0;
|
|
359
|
+
border: 0;
|
|
360
|
+
font-size: 17px;
|
|
361
|
+
-webkit-appearance: none;
|
|
362
|
+
-moz-appearance: none;
|
|
363
|
+
appearance: none;
|
|
364
|
+
background-color: transparent;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
@-webkit-keyframes ripple {
|
|
368
|
+
100% {
|
|
369
|
+
opacity: 0;
|
|
370
|
+
-webkit-transform: scale(2.5);
|
|
371
|
+
transform: scale(2.5);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
@keyframes ripple {
|
|
376
|
+
100% {
|
|
377
|
+
opacity: 0;
|
|
378
|
+
-webkit-transform: scale(2.5);
|
|
379
|
+
transform: scale(2.5);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _listItem = _interopRequireDefault(require("./list-item"));
|
|
12
|
+
require("./index.css");
|
|
13
|
+
class List extends React.Component {
|
|
14
|
+
render() {
|
|
15
|
+
const {
|
|
16
|
+
prefixCls,
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
style,
|
|
20
|
+
renderHeader,
|
|
21
|
+
renderFooter,
|
|
22
|
+
...restProps
|
|
23
|
+
} = this.props;
|
|
24
|
+
const wrapCls = (0, _classnames.default)(prefixCls, className);
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
26
|
+
className: wrapCls,
|
|
27
|
+
style: style
|
|
28
|
+
}, restProps), renderHeader ? /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: "".concat(prefixCls, "-header")
|
|
30
|
+
}, typeof renderHeader === 'function' ? renderHeader() : renderHeader) : null, children ? /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "".concat(prefixCls, "-body")
|
|
32
|
+
}, children) : null, renderFooter ? /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "".concat(prefixCls, "-footer")
|
|
34
|
+
}, typeof renderFooter === 'function' ? renderFooter() : renderFooter) : null);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
List.defaultProps = {
|
|
38
|
+
prefixCls: 'am-list'
|
|
39
|
+
};
|
|
40
|
+
List.Item = _listItem.default;
|
|
41
|
+
var _default = exports.default = List;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.Brief = void 0;
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _rmcFeedback = _interopRequireDefault(require("rmc-feedback"));
|
|
12
|
+
/* tslint:disable:jsx-no-multiline-js */
|
|
13
|
+
|
|
14
|
+
class Brief extends React.Component {
|
|
15
|
+
render() {
|
|
16
|
+
return /*#__PURE__*/React.createElement('div', {
|
|
17
|
+
className: 'am-list-brief',
|
|
18
|
+
style: this.props.style
|
|
19
|
+
}, this.props.children);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.Brief = Brief;
|
|
23
|
+
class ListItem extends React.Component {
|
|
24
|
+
constructor(props) {
|
|
25
|
+
super(props);
|
|
26
|
+
this.onClick = ev => {
|
|
27
|
+
const {
|
|
28
|
+
onClick,
|
|
29
|
+
platform
|
|
30
|
+
} = this.props;
|
|
31
|
+
const isAndroid = platform === 'android';
|
|
32
|
+
if (!!onClick && isAndroid) {
|
|
33
|
+
if (this.debounceTimeout) {
|
|
34
|
+
clearTimeout(this.debounceTimeout);
|
|
35
|
+
this.debounceTimeout = null;
|
|
36
|
+
}
|
|
37
|
+
const Item = ev.currentTarget;
|
|
38
|
+
const RippleWidth = Math.max(Item.offsetHeight, Item.offsetWidth);
|
|
39
|
+
const ClientRect = ev.currentTarget.getBoundingClientRect();
|
|
40
|
+
const pointX = ev.clientX - ClientRect.left - Item.offsetWidth / 2;
|
|
41
|
+
const pointY = ev.clientY - ClientRect.top - Item.offsetWidth / 2;
|
|
42
|
+
const coverRippleStyle = {
|
|
43
|
+
width: "".concat(RippleWidth, "px"),
|
|
44
|
+
height: "".concat(RippleWidth, "px"),
|
|
45
|
+
left: "".concat(pointX, "px"),
|
|
46
|
+
top: "".concat(pointY, "px")
|
|
47
|
+
};
|
|
48
|
+
this.setState({
|
|
49
|
+
coverRippleStyle,
|
|
50
|
+
RippleClicked: true
|
|
51
|
+
}, () => {
|
|
52
|
+
this.debounceTimeout = setTimeout(() => {
|
|
53
|
+
this.setState({
|
|
54
|
+
coverRippleStyle: {
|
|
55
|
+
display: 'none'
|
|
56
|
+
},
|
|
57
|
+
RippleClicked: false
|
|
58
|
+
});
|
|
59
|
+
}, 1000);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (onClick) {
|
|
63
|
+
onClick(ev);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
this.state = {
|
|
67
|
+
coverRippleStyle: {
|
|
68
|
+
display: 'none'
|
|
69
|
+
},
|
|
70
|
+
RippleClicked: false
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
componentWillUnmount() {
|
|
74
|
+
if (this.debounceTimeout) {
|
|
75
|
+
clearTimeout(this.debounceTimeout);
|
|
76
|
+
this.debounceTimeout = null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
render() {
|
|
80
|
+
const {
|
|
81
|
+
prefixCls,
|
|
82
|
+
className,
|
|
83
|
+
activeStyle,
|
|
84
|
+
error,
|
|
85
|
+
align,
|
|
86
|
+
wrap,
|
|
87
|
+
disabled,
|
|
88
|
+
children,
|
|
89
|
+
multipleLine,
|
|
90
|
+
thumb,
|
|
91
|
+
extra,
|
|
92
|
+
arrow,
|
|
93
|
+
onClick,
|
|
94
|
+
...restProps
|
|
95
|
+
} = this.props;
|
|
96
|
+
const {
|
|
97
|
+
platform,
|
|
98
|
+
...otherProps
|
|
99
|
+
} = restProps;
|
|
100
|
+
const {
|
|
101
|
+
coverRippleStyle,
|
|
102
|
+
RippleClicked
|
|
103
|
+
} = this.state;
|
|
104
|
+
const wrapCls = (0, _classnames.default)("".concat(prefixCls, "-item"), className, {
|
|
105
|
+
["".concat(prefixCls, "-item-disabled")]: disabled,
|
|
106
|
+
["".concat(prefixCls, "-item-error")]: error,
|
|
107
|
+
["".concat(prefixCls, "-item-top")]: align === 'top',
|
|
108
|
+
["".concat(prefixCls, "-item-middle")]: align === 'middle',
|
|
109
|
+
["".concat(prefixCls, "-item-bottom")]: align === 'bottom'
|
|
110
|
+
});
|
|
111
|
+
const rippleCls = (0, _classnames.default)("".concat(prefixCls, "-ripple"), {
|
|
112
|
+
["".concat(prefixCls, "-ripple-animate")]: RippleClicked
|
|
113
|
+
});
|
|
114
|
+
const lineCls = (0, _classnames.default)("".concat(prefixCls, "-line"), {
|
|
115
|
+
["".concat(prefixCls, "-line-multiple")]: multipleLine,
|
|
116
|
+
["".concat(prefixCls, "-line-wrap")]: wrap
|
|
117
|
+
});
|
|
118
|
+
const arrowCls = (0, _classnames.default)("".concat(prefixCls, "-arrow"), {
|
|
119
|
+
["".concat(prefixCls, "-arrow-horizontal")]: arrow === 'horizontal',
|
|
120
|
+
["".concat(prefixCls, "-arrow-vertical")]: arrow === 'down' || arrow === 'up',
|
|
121
|
+
["".concat(prefixCls, "-arrow-vertical-up")]: arrow === 'up'
|
|
122
|
+
});
|
|
123
|
+
const content = /*#__PURE__*/React.createElement("div", Object.assign({}, otherProps, {
|
|
124
|
+
onClick: ev => {
|
|
125
|
+
this.onClick(ev);
|
|
126
|
+
},
|
|
127
|
+
className: wrapCls
|
|
128
|
+
}), thumb ? /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
className: "".concat(prefixCls, "-thumb")
|
|
130
|
+
}, typeof thumb === 'string' ? /*#__PURE__*/React.createElement("img", {
|
|
131
|
+
src: thumb,
|
|
132
|
+
alt: ""
|
|
133
|
+
}) : thumb) : null, /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: lineCls
|
|
135
|
+
}, children !== undefined && /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: "".concat(prefixCls, "-content")
|
|
137
|
+
}, children), extra !== undefined && /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
className: "".concat(prefixCls, "-extra")
|
|
139
|
+
}, extra), arrow && /*#__PURE__*/React.createElement("div", {
|
|
140
|
+
className: arrowCls,
|
|
141
|
+
"aria-hidden": "true"
|
|
142
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
style: coverRippleStyle,
|
|
144
|
+
className: rippleCls
|
|
145
|
+
}));
|
|
146
|
+
let touchProps = {};
|
|
147
|
+
Object.keys(otherProps).forEach(key => {
|
|
148
|
+
if (/onTouch/i.test(key)) {
|
|
149
|
+
touchProps[key] = otherProps[key];
|
|
150
|
+
delete otherProps[key];
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
return /*#__PURE__*/React.createElement(_rmcFeedback.default, Object.assign({}, touchProps, {
|
|
154
|
+
disabled: disabled || !onClick,
|
|
155
|
+
activeStyle: activeStyle,
|
|
156
|
+
activeClassName: "".concat(prefixCls, "-item-active")
|
|
157
|
+
}), content);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
ListItem.defaultProps = {
|
|
161
|
+
prefixCls: 'am-list',
|
|
162
|
+
align: 'middle',
|
|
163
|
+
error: false,
|
|
164
|
+
multipleLine: false,
|
|
165
|
+
wrap: false,
|
|
166
|
+
platform: 'ios'
|
|
167
|
+
};
|
|
168
|
+
ListItem.Brief = Brief;
|
|
169
|
+
var _default = exports.default = ListItem;
|
package/lib/index.js
CHANGED
|
@@ -322,6 +322,12 @@ Object.defineProperty(exports, "LinkFormatter", {
|
|
|
322
322
|
return _LinkFormatter.default;
|
|
323
323
|
}
|
|
324
324
|
});
|
|
325
|
+
Object.defineProperty(exports, "List", {
|
|
326
|
+
enumerable: true,
|
|
327
|
+
get: function () {
|
|
328
|
+
return _List.default;
|
|
329
|
+
}
|
|
330
|
+
});
|
|
325
331
|
Object.defineProperty(exports, "Loading", {
|
|
326
332
|
enumerable: true,
|
|
327
333
|
get: function () {
|
|
@@ -556,4 +562,5 @@ var _DTableEmptyTip = _interopRequireDefault(require("./DTableEmptyTip"));
|
|
|
556
562
|
var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
557
563
|
var _UploadProgress = _interopRequireDefault(require("./UploadProgress"));
|
|
558
564
|
var _SvgIcon = _interopRequireDefault(require("./SvgIcon"));
|
|
559
|
-
var _DatePicker = _interopRequireDefault(require("./DatePicker"));
|
|
565
|
+
var _DatePicker = _interopRequireDefault(require("./DatePicker"));
|
|
566
|
+
var _List = _interopRequireDefault(require("./List"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-ui-component",
|
|
3
|
-
"version": "6.0.24-beta.
|
|
3
|
+
"version": "6.0.24-beta.2",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@seafile/react-image-lightbox": "4.0.2",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"react-sweet-progress": "^1.1.2",
|
|
17
17
|
"react-transition-group": "4.4.5",
|
|
18
18
|
"reactstrap": "9.2.3",
|
|
19
|
-
"rmc-date-picker": "6.0.10"
|
|
19
|
+
"rmc-date-picker": "6.0.10",
|
|
20
|
+
"rmc-feedback": "2.0.0"
|
|
20
21
|
},
|
|
21
22
|
"scripts": {
|
|
22
23
|
"lint": "./node_modules/.bin/eslint ./src/ --fix",
|