@nutui/nutui-react 3.0.0-beta.6 → 3.0.0-beta.7
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/README.md +39 -9
- package/dist/cjs/packages/address/style/style.css +56 -89
- package/dist/cjs/packages/animate/style/animate.scss +0 -3
- package/dist/cjs/packages/animate/style/style.css +0 -3
- package/dist/cjs/packages/cascader/style/style.css +49 -85
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/countdown/style/countdown.scss +21 -2
- package/dist/cjs/packages/countdown/style/style.css +20 -2
- package/dist/cjs/packages/elevator/style/elevator.scss +7 -4
- package/dist/cjs/packages/elevator/style/style.css +7 -4
- package/dist/cjs/packages/inputnumber/style/inputnumber.scss +19 -16
- package/dist/cjs/packages/inputnumber/style/style.css +21 -19
- package/dist/cjs/packages/numberkeyboard/style/numberkeyboard.scss +10 -1
- package/dist/cjs/packages/numberkeyboard/style/style.css +12 -0
- package/dist/cjs/packages/popover/style/popover.scss +16 -11
- package/dist/cjs/packages/popover/style/style.css +14 -2
- package/dist/cjs/packages/tabs/style/style.css +49 -85
- package/dist/cjs/packages/tabs/style/tabs.scss +68 -106
- package/dist/cjs/packages/tour/style/style.css +14 -2
- package/dist/cjs/packages/video/video.d.ts +6 -2
- package/dist/cjs/packages/video/video.js +16 -2
- package/dist/es/packages/address/style/style.css +56 -89
- package/dist/es/packages/animate/style/animate.scss +0 -3
- package/dist/es/packages/animate/style/style.css +0 -3
- package/dist/es/packages/cascader/style/style.css +49 -85
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/countdown/style/countdown.scss +21 -2
- package/dist/es/packages/countdown/style/style.css +20 -2
- package/dist/es/packages/elevator/style/elevator.scss +7 -4
- package/dist/es/packages/elevator/style/style.css +7 -4
- package/dist/es/packages/inputnumber/style/inputnumber.scss +19 -16
- package/dist/es/packages/inputnumber/style/style.css +21 -19
- package/dist/es/packages/numberkeyboard/numberkeyboard.d.ts +10 -50
- package/dist/es/packages/numberkeyboard/style/numberkeyboard.scss +10 -1
- package/dist/es/packages/numberkeyboard/style/style.css +12 -0
- package/dist/es/packages/popover/style/popover.scss +16 -11
- package/dist/es/packages/popover/style/style.css +14 -2
- package/dist/es/packages/tabpane/tabpane.d.ts +3 -15
- package/dist/es/packages/tabs/style/style.css +49 -85
- package/dist/es/packages/tabs/style/tabs.scss +68 -106
- package/dist/es/packages/tabs/tabs.d.ts +12 -60
- package/dist/es/packages/tour/style/style.css +14 -2
- package/dist/es/packages/video/video.d.ts +6 -2
- package/dist/es/packages/video/video.js +16 -2
- package/dist/nutui.react.umd.js +67 -67
- package/dist/style.css +1 -1
- package/dist/styles/theme-dark.scss +2 -0
- package/dist/styles/theme-default.scss +2 -0
- package/dist/styles/variables.scss +14 -13
- package/package.json +2 -2
|
@@ -4,12 +4,17 @@
|
|
|
4
4
|
display: flex;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
.nut-tabs-horizontal {
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
.nut-tabs-titles {
|
|
8
12
|
display: flex;
|
|
9
13
|
box-sizing: border-box;
|
|
10
14
|
height: $tabs-titles-height;
|
|
11
15
|
user-select: none;
|
|
12
|
-
overflow:
|
|
16
|
+
overflow-x: auto;
|
|
17
|
+
overflow-y: hidden;
|
|
13
18
|
background: $tabs-titles-background-color;
|
|
14
19
|
scrollbar-width: none;
|
|
15
20
|
|
|
@@ -21,7 +26,6 @@
|
|
|
21
26
|
|
|
22
27
|
.nut-tabs-list {
|
|
23
28
|
width: 100%;
|
|
24
|
-
height: auto;
|
|
25
29
|
display: flex;
|
|
26
30
|
flex-shrink: 0;
|
|
27
31
|
}
|
|
@@ -40,11 +44,6 @@
|
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
&-scrollable {
|
|
44
|
-
overflow-x: auto;
|
|
45
|
-
overflow-y: hidden;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
47
|
&-item {
|
|
49
48
|
position: relative;
|
|
50
49
|
display: flex;
|
|
@@ -60,13 +59,17 @@
|
|
|
60
59
|
text-overflow: ellipsis;
|
|
61
60
|
white-space: nowrap;
|
|
62
61
|
|
|
62
|
+
.nut-icon {
|
|
63
|
+
color: $tabs-titles-item-color;
|
|
64
|
+
}
|
|
65
|
+
|
|
63
66
|
&-left,
|
|
64
67
|
&-right {
|
|
65
68
|
flex: none;
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
&-text {
|
|
69
|
-
|
|
72
|
+
color: $tabs-titles-item-color;
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
&-smile,
|
|
@@ -76,9 +79,9 @@
|
|
|
76
79
|
width: 0;
|
|
77
80
|
height: 0;
|
|
78
81
|
content: ' ';
|
|
79
|
-
bottom: $tabs-tab-line-bottom;
|
|
80
82
|
left: 50%;
|
|
81
83
|
transform: translate(-50%, 0);
|
|
84
|
+
bottom: $tabs-tab-line-bottom;
|
|
82
85
|
border-radius: $tabs-tab-line-border-radius;
|
|
83
86
|
opacity: $tabs-tab-line-opacity;
|
|
84
87
|
overflow: hidden;
|
|
@@ -92,13 +95,18 @@
|
|
|
92
95
|
font-size: 20px;
|
|
93
96
|
width: 100%;
|
|
94
97
|
height: 100%;
|
|
95
|
-
color: $color-primary;
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
&-active {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
.nut-icon {
|
|
103
|
+
color: $tabs-titles-item-active-color;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.nut-tabs-titles-item-text {
|
|
107
|
+
color: $tabs-titles-item-active-color;
|
|
108
|
+
font-weight: $tabs-titles-item-active-font-weight;
|
|
109
|
+
}
|
|
102
110
|
|
|
103
111
|
.nut-tabs-titles-item-line {
|
|
104
112
|
overflow: unset;
|
|
@@ -112,18 +120,33 @@
|
|
|
112
120
|
overflow: unset;
|
|
113
121
|
width: 40px;
|
|
114
122
|
height: 20px;
|
|
123
|
+
|
|
124
|
+
.nut-icon {
|
|
125
|
+
color: $tabs-titles-item-active-color;
|
|
126
|
+
}
|
|
115
127
|
}
|
|
116
128
|
}
|
|
117
129
|
|
|
118
130
|
&-disabled {
|
|
119
131
|
color: $color-text-disabled;
|
|
132
|
+
.nut-icon {
|
|
133
|
+
color: $color-text-disabled;
|
|
134
|
+
}
|
|
135
|
+
.nut-tabs-titles-item-text {
|
|
136
|
+
color: $color-text-disabled;
|
|
137
|
+
}
|
|
120
138
|
}
|
|
121
139
|
}
|
|
122
140
|
|
|
123
141
|
&-simple {
|
|
124
|
-
.nut-tabs-titles-item
|
|
125
|
-
|
|
126
|
-
|
|
142
|
+
.nut-tabs-titles-item {
|
|
143
|
+
&-active {
|
|
144
|
+
.nut-tabs-titles-item-text,
|
|
145
|
+
.nut-icon {
|
|
146
|
+
color: $color-title;
|
|
147
|
+
font-size: $tabs-titles-item-active-font-size;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
127
150
|
}
|
|
128
151
|
}
|
|
129
152
|
|
|
@@ -133,7 +156,6 @@
|
|
|
133
156
|
|
|
134
157
|
.nut-tabs-titles-item {
|
|
135
158
|
padding: 0;
|
|
136
|
-
|
|
137
159
|
&-active {
|
|
138
160
|
font-weight: $font-weight-bold;
|
|
139
161
|
background-color: $white;
|
|
@@ -157,11 +179,10 @@
|
|
|
157
179
|
.nut-tabs-titles-item-active {
|
|
158
180
|
.nut-tabs-titles-item-text {
|
|
159
181
|
background: $color-default-light;
|
|
160
|
-
color: $color
|
|
182
|
+
color: $tabs-titles-item-active-color;
|
|
161
183
|
border-radius: $tabs-tab-button-border-radius;
|
|
162
184
|
font-weight: $font-weight-bold;
|
|
163
185
|
background-color: $tabs-tab-button-active-background-color;
|
|
164
|
-
color: $color-primary;
|
|
165
186
|
border: $tabs-tab-button-active-border;
|
|
166
187
|
}
|
|
167
188
|
}
|
|
@@ -195,35 +216,7 @@
|
|
|
195
216
|
}
|
|
196
217
|
}
|
|
197
218
|
|
|
198
|
-
[dir='rtl'] .nut-tabs-titles,
|
|
199
|
-
.nut-rtl .nut-tabs-titles {
|
|
200
|
-
&-item {
|
|
201
|
-
&-smile,
|
|
202
|
-
&-line {
|
|
203
|
-
left: auto;
|
|
204
|
-
right: 50%;
|
|
205
|
-
transform: translate(50%, 0);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
&-divider {
|
|
209
|
-
.nut-tabs-titles-item {
|
|
210
|
-
&::after {
|
|
211
|
-
right: auto;
|
|
212
|
-
left: 0;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.nut-tabs-horizontal {
|
|
219
|
-
flex-direction: column;
|
|
220
|
-
position: relative;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
219
|
.nut-tabs-vertical {
|
|
224
|
-
flex-direction: row;
|
|
225
|
-
width: 100%;
|
|
226
|
-
|
|
227
220
|
.nut-tabs-ellipsis {
|
|
228
221
|
text-overflow: ellipsis;
|
|
229
222
|
white-space: nowrap;
|
|
@@ -231,47 +224,26 @@
|
|
|
231
224
|
}
|
|
232
225
|
|
|
233
226
|
.nut-tabs-titles {
|
|
234
|
-
box-sizing: border-box;
|
|
235
227
|
flex-direction: column;
|
|
236
228
|
height: 100%;
|
|
237
|
-
padding: 0;
|
|
238
229
|
width: $tabs-vertical-titles-width;
|
|
239
230
|
flex-shrink: 0;
|
|
240
231
|
|
|
241
232
|
.nut-tabs-list {
|
|
242
|
-
width: 100%;
|
|
243
|
-
display: flex;
|
|
244
233
|
flex-direction: column;
|
|
245
|
-
flex-shrink: 0;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
&-line {
|
|
249
|
-
.nut-tabs-titles-item {
|
|
250
|
-
padding-left: 14px;
|
|
251
|
-
}
|
|
252
234
|
}
|
|
253
235
|
}
|
|
254
236
|
|
|
255
|
-
.nut-tabs-titles-scrollable {
|
|
256
|
-
overflow-x: hidden;
|
|
257
|
-
overflow-y: auto;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
237
|
.nut-tabs-titles-item {
|
|
261
238
|
height: $tabs-vertical-titles-item-height;
|
|
262
|
-
margin: 0;
|
|
263
239
|
flex: none;
|
|
264
240
|
|
|
265
241
|
&-smile {
|
|
266
|
-
width: 0;
|
|
267
|
-
height: 0;
|
|
268
242
|
overflow: hidden;
|
|
269
243
|
transition: width 0.3s ease;
|
|
270
244
|
}
|
|
271
245
|
|
|
272
246
|
&-line {
|
|
273
|
-
width: 0;
|
|
274
|
-
height: 0;
|
|
275
247
|
transform: translate(0, -50%);
|
|
276
248
|
transition: height 0.3s ease;
|
|
277
249
|
|
|
@@ -293,8 +265,6 @@
|
|
|
293
265
|
right: -12px;
|
|
294
266
|
bottom: -2%;
|
|
295
267
|
left: auto;
|
|
296
|
-
width: 40px;
|
|
297
|
-
height: 20px;
|
|
298
268
|
transform: rotate(320deg);
|
|
299
269
|
}
|
|
300
270
|
}
|
|
@@ -303,15 +273,13 @@
|
|
|
303
273
|
.nut-tabs-horizontal {
|
|
304
274
|
.nut-tabs-titles {
|
|
305
275
|
flex-direction: row;
|
|
306
|
-
overflow-x: auto;
|
|
307
|
-
overflow-y: hidden;
|
|
308
276
|
height: $tabs-titles-height;
|
|
277
|
+
width: 100%;
|
|
278
|
+
padding: 0 !important;
|
|
309
279
|
|
|
310
280
|
.nut-tabs-list {
|
|
311
|
-
width: 100%;
|
|
312
|
-
display: flex;
|
|
313
281
|
flex-direction: row;
|
|
314
|
-
|
|
282
|
+
height: auto;
|
|
315
283
|
}
|
|
316
284
|
}
|
|
317
285
|
|
|
@@ -325,6 +293,9 @@
|
|
|
325
293
|
.nut-tabs-titles-item-line {
|
|
326
294
|
left: 50%;
|
|
327
295
|
transform: translate(-50%, 0);
|
|
296
|
+
width: $tabs-tab-line-width;
|
|
297
|
+
height: $tabs-tab-line-height;
|
|
298
|
+
background: $tabs-tab-line-color;
|
|
328
299
|
}
|
|
329
300
|
|
|
330
301
|
.nut-tabs-titles-item-smile {
|
|
@@ -348,32 +319,32 @@
|
|
|
348
319
|
height: 100%;
|
|
349
320
|
}
|
|
350
321
|
}
|
|
322
|
+
}
|
|
351
323
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
flex-direction: row;
|
|
356
|
-
padding: 0 !important;
|
|
357
|
-
width: 100%;
|
|
358
|
-
|
|
359
|
-
.nut-tabs-titles-item {
|
|
360
|
-
display: flex;
|
|
361
|
-
align-items: center;
|
|
362
|
-
justify-content: center;
|
|
363
|
-
flex: 1 0 auto;
|
|
324
|
+
.nut-tabs-content {
|
|
325
|
+
display: flex;
|
|
326
|
+
box-sizing: border-box;
|
|
364
327
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
328
|
+
&-wrap {
|
|
329
|
+
overflow: hidden;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
369
332
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
333
|
+
[dir='rtl'] .nut-tabs-titles,
|
|
334
|
+
.nut-rtl .nut-tabs-titles {
|
|
335
|
+
&-item {
|
|
336
|
+
&-smile,
|
|
337
|
+
&-line {
|
|
338
|
+
left: auto;
|
|
339
|
+
right: 50%;
|
|
340
|
+
transform: translate(50%, 0);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
&-divider {
|
|
344
|
+
.nut-tabs-titles-item {
|
|
345
|
+
&::after {
|
|
346
|
+
right: auto;
|
|
347
|
+
left: 0;
|
|
377
348
|
}
|
|
378
349
|
}
|
|
379
350
|
}
|
|
@@ -421,12 +392,3 @@
|
|
|
421
392
|
}
|
|
422
393
|
}
|
|
423
394
|
}
|
|
424
|
-
|
|
425
|
-
.nut-tabs-content {
|
|
426
|
-
display: flex;
|
|
427
|
-
box-sizing: border-box;
|
|
428
|
-
|
|
429
|
-
&-wrap {
|
|
430
|
-
overflow: hidden;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
@@ -8,66 +8,18 @@ export type TabsTitle = {
|
|
|
8
8
|
value: string | number;
|
|
9
9
|
};
|
|
10
10
|
export interface TabsProps extends BasicComponent {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* @default 0
|
|
24
|
-
*/
|
|
25
|
-
defaultValue: string | number
|
|
26
|
-
/**
|
|
27
|
-
* 标签选中色
|
|
28
|
-
* @default #1A1A1A
|
|
29
|
-
*/
|
|
30
|
-
activeColor: string
|
|
31
|
-
/**
|
|
32
|
-
* 使用横纵方向
|
|
33
|
-
* @default horizontal
|
|
34
|
-
*/
|
|
35
|
-
direction: 'horizontal' | 'vertical'
|
|
36
|
-
/**
|
|
37
|
-
* 选中底部展示样式 可选值 line、smile、simple、card、button、divider
|
|
38
|
-
* @default line
|
|
39
|
-
*/
|
|
40
|
-
activeType: 'line' | 'smile' | 'simple' | 'card' | 'button' | 'divider'
|
|
41
|
-
/**
|
|
42
|
-
* 切换动画时长,单位 ms 0 代表无动画
|
|
43
|
-
* @default 300
|
|
44
|
-
*/
|
|
45
|
-
duration: number | string
|
|
46
|
-
/**
|
|
47
|
-
* 标题对齐方式
|
|
48
|
-
* @default -
|
|
49
|
-
*/
|
|
50
|
-
align: 'left' | 'right'
|
|
51
|
-
/**
|
|
52
|
-
* 自定义导航区域
|
|
53
|
-
* @default -
|
|
54
|
-
*/
|
|
55
|
-
title: () => JSX.Element[]
|
|
56
|
-
/**
|
|
57
|
-
* 当前激活的标签改变时触发
|
|
58
|
-
* @default -
|
|
59
|
-
*/
|
|
60
|
-
onChange: (index: string | number) => void
|
|
61
|
-
/**
|
|
62
|
-
* 点击标签时触发
|
|
63
|
-
* @default -
|
|
64
|
-
*/
|
|
65
|
-
onClick: (index: string | number) => void
|
|
66
|
-
/**
|
|
67
|
-
* 自动高度。设置为 true 时,nut-tabs 和 nut-tabs\_\_content 会随着当前 nut-tabpane 的高度而发生变化。
|
|
68
|
-
* @default false
|
|
69
|
-
*/
|
|
70
|
-
autoHeight: boolean
|
|
11
|
+
tabStyle: React.CSSProperties;
|
|
12
|
+
value: string | number;
|
|
13
|
+
defaultValue: string | number;
|
|
14
|
+
activeColor: string;
|
|
15
|
+
direction: 'horizontal' | 'vertical';
|
|
16
|
+
activeType: 'line' | 'smile' | 'simple' | 'card' | 'button' | 'divider';
|
|
17
|
+
duration: number | string;
|
|
18
|
+
align: 'left' | 'right';
|
|
19
|
+
title: () => JSX.Element[];
|
|
20
|
+
onChange: (index: string | number) => void;
|
|
21
|
+
onClick: (index: string | number) => void;
|
|
22
|
+
autoHeight: boolean;
|
|
71
23
|
children?: React.ReactNode;
|
|
72
24
|
}
|
|
73
25
|
export declare const Tabs: FunctionComponent<Partial<TabsProps>> & {
|
|
@@ -493,6 +493,8 @@
|
|
|
493
493
|
justify-content: center;
|
|
494
494
|
padding: var(--nutui-popover-menu-item-padding, 8px);
|
|
495
495
|
border-bottom: 1px solid var(--nutui-popover-divider-color, var(--nutui-color-border, rgba(0, 0, 0, 0.06)));
|
|
496
|
+
max-width: var(--nutui-popover-menu-item-width, 160px);
|
|
497
|
+
word-wrap: break-word;
|
|
496
498
|
}
|
|
497
499
|
.nut-popover .nut-popover-content .nut-popover-menu-item:last-child {
|
|
498
500
|
margin-bottom: 0px;
|
|
@@ -518,9 +520,10 @@
|
|
|
518
520
|
font-size: 12px;
|
|
519
521
|
}
|
|
520
522
|
.nut-popover .nut-popover-content .nut-popover-menu-item-name {
|
|
521
|
-
width: 100
|
|
523
|
+
width: calc(100% - 34px);
|
|
522
524
|
word-break: keep-all;
|
|
523
525
|
margin: 0 6px 0 4px;
|
|
526
|
+
flex: 1;
|
|
524
527
|
}
|
|
525
528
|
.nut-popover .nut-popover-content .nut-popover-menu-item-action-icon {
|
|
526
529
|
display: flex;
|
|
@@ -591,9 +594,18 @@
|
|
|
591
594
|
background: var(--nutui-popover-text-color, #1a1a1a);
|
|
592
595
|
color: var(--nutui-popover-content-background-color, #ffffff);
|
|
593
596
|
}
|
|
594
|
-
.nut-popover-dark .nut-popover-arrow {
|
|
597
|
+
.nut-popover-dark .nut-popover-arrow-top {
|
|
598
|
+
border-top-color: var(--nutui-popover-text-color, #1a1a1a);
|
|
599
|
+
}
|
|
600
|
+
.nut-popover-dark .nut-popover-arrow-bottom {
|
|
595
601
|
border-bottom-color: var(--nutui-popover-text-color, #1a1a1a);
|
|
596
602
|
}
|
|
603
|
+
.nut-popover-dark .nut-popover-arrow-left {
|
|
604
|
+
border-left-color: var(--nutui-popover-text-color, #1a1a1a);
|
|
605
|
+
}
|
|
606
|
+
.nut-popover-dark .nut-popover-arrow-right {
|
|
607
|
+
border-right-color: var(--nutui-popover-text-color, #1a1a1a);
|
|
608
|
+
}
|
|
597
609
|
.nut-popover-dark .nut-popover-content {
|
|
598
610
|
background: var(--nutui-popover-text-color, #1a1a1a) !important;
|
|
599
611
|
color: var(--nutui-popover-content-background-color, #ffffff) !important;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { BasicComponent } from "../../utils/typings";
|
|
3
3
|
export interface VideoProps extends BasicComponent {
|
|
4
4
|
source: {
|
|
@@ -17,4 +17,8 @@ export interface VideoProps extends BasicComponent {
|
|
|
17
17
|
onPause: (element: HTMLVideoElement) => void;
|
|
18
18
|
onPlayEnd: (element: HTMLVideoElement) => void;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export type VideoRef = {
|
|
21
|
+
pause: () => void;
|
|
22
|
+
play: () => void;
|
|
23
|
+
};
|
|
24
|
+
export declare const Video: React.ForwardRefExoticComponent<Partial<VideoProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onPause" | "onPlay"> & React.RefAttributes<VideoRef>>;
|
|
@@ -19,7 +19,7 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
var classPrefix = "nut-video";
|
|
22
|
-
export var Video = function(props) {
|
|
22
|
+
export var Video = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
23
23
|
var _ref = _object_spread({}, defaultProps, props), children = _ref.children, source = _ref.source, options = _ref.options, className = _ref.className, onPlay = _ref.onPlay, onPause = _ref.onPause, onPlayEnd = _ref.onPlayEnd, restProps = _object_without_properties(_ref, [
|
|
24
24
|
"children",
|
|
25
25
|
"source",
|
|
@@ -60,6 +60,20 @@ export var Video = function(props) {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
+
var pause = function() {
|
|
64
|
+
var _rootRef_current;
|
|
65
|
+
rootRef === null || rootRef === void 0 ? void 0 : (_rootRef_current = rootRef.current) === null || _rootRef_current === void 0 ? void 0 : _rootRef_current.pause();
|
|
66
|
+
};
|
|
67
|
+
var play = function() {
|
|
68
|
+
var _rootRef_current;
|
|
69
|
+
rootRef === null || rootRef === void 0 ? void 0 : (_rootRef_current = rootRef.current) === null || _rootRef_current === void 0 ? void 0 : _rootRef_current.play();
|
|
70
|
+
};
|
|
71
|
+
React.useImperativeHandle(ref, function() {
|
|
72
|
+
return {
|
|
73
|
+
pause: pause,
|
|
74
|
+
play: play
|
|
75
|
+
};
|
|
76
|
+
});
|
|
63
77
|
return /*#__PURE__*/ React.createElement("div", _object_spread({
|
|
64
78
|
className: classes
|
|
65
79
|
}, restProps), /*#__PURE__*/ React.createElement("video", {
|
|
@@ -77,5 +91,5 @@ export var Video = function(props) {
|
|
|
77
91
|
}), /*#__PURE__*/ React.createElement("track", {
|
|
78
92
|
kind: "captions"
|
|
79
93
|
})));
|
|
80
|
-
};
|
|
94
|
+
});
|
|
81
95
|
Video.displayName = 'NutVideo';
|