@liuzengwei/element-ui 2.15.5-xn.50 → 2.15.5-xn.52
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/affix.js +2 -2
- package/lib/alert.js +2 -2
- package/lib/area-loading.js +2 -2
- package/lib/area-picker.js +4 -4
- package/lib/aside.js +2 -2
- package/lib/autocomplete.js +2 -2
- package/lib/avatar.js +2 -2
- package/lib/backtop.js +2 -2
- package/lib/badge.js +2 -2
- package/lib/breadcrumb-item.js +2 -2
- package/lib/breadcrumb.js +2 -2
- package/lib/button-group.js +2 -2
- package/lib/button.js +2 -2
- package/lib/calendar.js +2 -2
- package/lib/card.js +2 -2
- package/lib/carousel-item.js +2 -2
- package/lib/carousel.js +2 -2
- package/lib/cascader-panel.js +4 -4
- package/lib/cascader.js +11 -11
- package/lib/checkbox-button.js +9 -9
- package/lib/checkbox-group.js +9 -9
- package/lib/checkbox.js +9 -9
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +2 -2
- package/lib/collapse.js +2 -2
- package/lib/color-picker.js +9 -9
- package/lib/container.js +2 -2
- package/lib/date-picker.js +69 -91
- package/lib/descriptions-item.js +2 -2
- package/lib/descriptions.js +2 -2
- package/lib/dialog.js +2 -2
- package/lib/divider.js +2 -2
- package/lib/drawer.js +159 -11
- package/lib/dropdown-item.js +2 -2
- package/lib/dropdown-menu.js +2 -2
- package/lib/dropdown.js +2 -2
- package/lib/element-ui.common.js +884 -41
- package/lib/empty.js +2 -2
- package/lib/file-preview.js +905 -0
- package/lib/footer.js +2 -2
- package/lib/form-item.js +4 -4
- package/lib/form.js +2 -2
- package/lib/header.js +2 -2
- package/lib/icon.js +2 -2
- package/lib/image.js +2 -2
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +2 -2
- package/lib/input-number.js +2 -2
- package/lib/input.js +2 -2
- package/lib/lazy-load.js +2 -2
- package/lib/link.js +2 -2
- package/lib/loading.js +2 -2
- package/lib/main.js +2 -2
- package/lib/menu-item-group.js +2 -2
- package/lib/menu-item.js +2 -2
- package/lib/menu.js +2 -2
- package/lib/message-box.js +4 -4
- package/lib/message.js +2 -2
- package/lib/notification.js +9 -9
- package/lib/option-group.js +9 -9
- package/lib/option.js +2 -2
- package/lib/page-header.js +2 -2
- package/lib/pagination.js +6 -6
- package/lib/popconfirm.js +4 -4
- package/lib/popover.js +2 -2
- package/lib/progress.js +2 -2
- package/lib/radio-button.js +9 -9
- package/lib/radio-group.js +9 -9
- package/lib/radio.js +2 -2
- package/lib/rate.js +2 -2
- package/lib/result.js +2 -2
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +9 -9
- package/lib/segmented.js +2 -2
- package/lib/select.js +2 -2
- package/lib/selectable-tag-group.js +2 -2
- package/lib/selectable-tag.js +2 -2
- package/lib/skeleton-item.js +2 -2
- package/lib/skeleton.js +2 -2
- package/lib/slider.js +4 -4
- package/lib/spinner.js +2 -2
- package/lib/statistic.js +2 -2
- package/lib/step.js +2 -2
- package/lib/steps.js +2 -2
- package/lib/submenu.js +2 -2
- package/lib/switch.js +23 -23
- package/lib/tab-pane.js +2 -2
- package/lib/table-column.js +2 -2
- package/lib/table.js +14 -6
- package/lib/tabs.js +2 -2
- package/lib/tag.js +2 -2
- package/lib/text.js +2 -2
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/drawer.css +1 -1
- package/lib/theme-chalk/file-preview.css +1 -0
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/icon.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/time-picker.js +2 -2
- package/lib/time-select.js +2 -2
- package/lib/timeline-item.js +2 -2
- package/lib/timeline.js +2 -2
- package/lib/tooltip.js +2 -2
- package/lib/transfer.js +2 -2
- package/lib/tree.js +2 -2
- package/lib/trigger.js +11 -11
- package/lib/upload.js +2 -2
- package/package.json +1 -1
- package/packages/drawer/src/main.vue +144 -7
- package/packages/file-preview/index.js +8 -0
- package/packages/file-preview/src/icons/audio.svg +1 -0
- package/packages/file-preview/src/icons/excel.svg +1 -0
- package/packages/file-preview/src/icons/image.svg +1 -0
- package/packages/file-preview/src/icons/pdf.svg +1 -0
- package/packages/file-preview/src/icons/ppt.svg +1 -0
- package/packages/file-preview/src/icons/video.svg +1 -0
- package/packages/file-preview/src/icons/word.svg +1 -0
- package/packages/file-preview/src/icons/zip.svg +1 -0
- package/packages/file-preview/src/main.vue +330 -0
- package/packages/theme-chalk/lib/base.css +1 -1
- package/packages/theme-chalk/lib/drawer.css +1 -1
- package/packages/theme-chalk/lib/file-preview.css +1 -0
- package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/lib/icon.css +1 -1
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/src/drawer.scss +31 -0
- package/packages/theme-chalk/src/file-preview.scss +138 -0
- package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/src/icon.scss +36 -0
- package/packages/theme-chalk/src/index.scss +1 -0
- package/src/index.js +5 -2
- package/types/drawer.d.ts +16 -0
- package/types/element-ui.d.ts +4 -0
- package/types/file-preview.d.ts +32 -0
|
@@ -136,6 +136,16 @@ $directions: rtl, ltr, ttb, btt;
|
|
|
136
136
|
margin: 0;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
&__wrapper-reference {
|
|
140
|
+
position: absolute;
|
|
141
|
+
top: 0;
|
|
142
|
+
right: 0;
|
|
143
|
+
bottom: 0;
|
|
144
|
+
left: 0;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
margin: 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
139
149
|
&__header {
|
|
140
150
|
align-items: center;
|
|
141
151
|
color: rgb(114, 118, 123);
|
|
@@ -198,6 +208,18 @@ $directions: rtl, ltr, ttb, btt;
|
|
|
198
208
|
&.btt {
|
|
199
209
|
bottom: 0;
|
|
200
210
|
}
|
|
211
|
+
|
|
212
|
+
&.is-reference {
|
|
213
|
+
position: absolute;
|
|
214
|
+
&.ltr, &.rtl, &.ttb, &.btt {
|
|
215
|
+
height: auto;
|
|
216
|
+
width: auto;
|
|
217
|
+
top: auto;
|
|
218
|
+
bottom: auto;
|
|
219
|
+
left: auto;
|
|
220
|
+
right: auto;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
201
223
|
}
|
|
202
224
|
|
|
203
225
|
.el-drawer__container {
|
|
@@ -208,6 +230,15 @@ $directions: rtl, ltr, ttb, btt;
|
|
|
208
230
|
bottom: 0;
|
|
209
231
|
height: 100%;
|
|
210
232
|
width: 100%;
|
|
233
|
+
|
|
234
|
+
&.el-drawer__reference-mode {
|
|
235
|
+
position: absolute;
|
|
236
|
+
background-color: transparent;
|
|
237
|
+
pointer-events: none;
|
|
238
|
+
.el-drawer {
|
|
239
|
+
pointer-events: auto;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
211
242
|
}
|
|
212
243
|
|
|
213
244
|
.el-drawer-fade-enter-active {
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
@import "mixins/mixins";
|
|
2
|
+
@import "common/var";
|
|
3
|
+
|
|
4
|
+
@include b(file-preview) {
|
|
5
|
+
@include e(list) {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
margin: -4px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include e(item) {
|
|
12
|
+
width: 80px;
|
|
13
|
+
height: 80px;
|
|
14
|
+
margin: 4px;
|
|
15
|
+
border-radius: $--border-radius-base;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
position: relative;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
|
|
21
|
+
@include m(image) {
|
|
22
|
+
.el-image {
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
border-radius: $--border-radius-base;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@include m(video) {
|
|
30
|
+
.el-image {
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
border-radius: $--border-radius-base;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@include m(file) {
|
|
38
|
+
border: 1px solid $--border-color-base;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
padding: 8px 6px;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
color: $--color-text-secondary;
|
|
46
|
+
transition: all 0.3s;
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
border-color: $--color-primary;
|
|
50
|
+
box-shadow: 0 2px 8px rgba($--color-primary, 0.2);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@include e(image) {
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@include e(error) {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
background-color: $--background-color-base;
|
|
67
|
+
color: $--color-text-placeholder;
|
|
68
|
+
font-size: 24px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@include e(play-icon) {
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: 50%;
|
|
74
|
+
left: 50%;
|
|
75
|
+
transform: translate(-50%, -50%);
|
|
76
|
+
width: 40px;
|
|
77
|
+
height: 40px;
|
|
78
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
color: #fff;
|
|
84
|
+
font-size: 20px;
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
transition: all 0.3s;
|
|
87
|
+
|
|
88
|
+
.el-file-preview__item:hover & {
|
|
89
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
90
|
+
transform: translate(-50%, -50%) scale(1.1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@include e(icon) {
|
|
95
|
+
width: 40px;
|
|
96
|
+
height: 40px;
|
|
97
|
+
object-fit: contain;
|
|
98
|
+
flex-shrink: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@include e(name) {
|
|
102
|
+
width: 100%;
|
|
103
|
+
margin: 6px 0 0;
|
|
104
|
+
padding: 0;
|
|
105
|
+
font-size: $--font-size-extra-small;
|
|
106
|
+
line-height: 1.4;
|
|
107
|
+
word-break: break-all;
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-wrap: wrap;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
text-align: center;
|
|
112
|
+
color: inherit;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@include e(name-main) {
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
text-overflow: ellipsis;
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
flex: 1;
|
|
120
|
+
min-width: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@include e(name-ext) {
|
|
124
|
+
flex-shrink: 0;
|
|
125
|
+
white-space: nowrap;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@include e(video-wrapper) {
|
|
129
|
+
width: 100%;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@include e(video) {
|
|
133
|
+
width: 100%;
|
|
134
|
+
max-height: 480px;
|
|
135
|
+
background-color: #000;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
Binary file
|
|
Binary file
|
|
@@ -1193,3 +1193,39 @@
|
|
|
1193
1193
|
.el-icon-point:before {
|
|
1194
1194
|
content: "\e654";
|
|
1195
1195
|
}
|
|
1196
|
+
|
|
1197
|
+
.el-icon-xianniu:before {
|
|
1198
|
+
content: "\e630";
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
.el-icon-zip:before {
|
|
1202
|
+
content: "\e62f";
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
.el-icon-image:before {
|
|
1206
|
+
content: "\e62e";
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
.el-icon-pdf:before {
|
|
1210
|
+
content: "\e628";
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
.el-icon-audio:before {
|
|
1214
|
+
content: "\e62d";
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
.el-icon-ppt:before {
|
|
1218
|
+
content: "\e62c";
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
.el-icon-video:before {
|
|
1222
|
+
content: "\e62b";
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
.el-icon-word:before {
|
|
1226
|
+
content: "\e62a";
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
.el-icon-excel:before {
|
|
1230
|
+
content: "\e629";
|
|
1231
|
+
}
|
package/src/index.js
CHANGED
|
@@ -98,6 +98,7 @@ import AreaPicker from '../packages/area-picker/index.js';
|
|
|
98
98
|
import Trigger from '../packages/trigger/index.js';
|
|
99
99
|
import LazyLoad from '../packages/lazy-load/index.js';
|
|
100
100
|
import Segmented from '../packages/segmented/index.js';
|
|
101
|
+
import FilePreview from '../packages/file-preview/index.js';
|
|
101
102
|
import locale from 'element-ui/src/locale';
|
|
102
103
|
import CollapseTransition from 'element-ui/src/transitions/collapse-transition';
|
|
103
104
|
|
|
@@ -195,6 +196,7 @@ const components = [
|
|
|
195
196
|
Trigger,
|
|
196
197
|
LazyLoad,
|
|
197
198
|
Segmented,
|
|
199
|
+
FilePreview,
|
|
198
200
|
CollapseTransition
|
|
199
201
|
];
|
|
200
202
|
|
|
@@ -230,7 +232,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
230
232
|
}
|
|
231
233
|
|
|
232
234
|
export default {
|
|
233
|
-
version: '2.15.5-xn.
|
|
235
|
+
version: '2.15.5-xn.52',
|
|
234
236
|
locale: locale.use,
|
|
235
237
|
i18n: locale.i18n,
|
|
236
238
|
install,
|
|
@@ -332,5 +334,6 @@ export default {
|
|
|
332
334
|
AreaPicker,
|
|
333
335
|
Trigger,
|
|
334
336
|
LazyLoad,
|
|
335
|
-
Segmented
|
|
337
|
+
Segmented,
|
|
338
|
+
FilePreview
|
|
336
339
|
};
|
package/types/drawer.d.ts
CHANGED
|
@@ -9,6 +9,13 @@ declare enum Direction {
|
|
|
9
9
|
BTT = 'btt' // bottom to top
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
declare enum Placement {
|
|
13
|
+
TOP = 'top',
|
|
14
|
+
BOTTOM = 'bottom',
|
|
15
|
+
LEFT = 'left',
|
|
16
|
+
RIGHT = 'right'
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
interface DrawerSlots {
|
|
13
20
|
/* Main Content Slots */
|
|
14
21
|
default: VNode[];
|
|
@@ -59,5 +66,14 @@ export declare class ElDrawer extends ElementUIComponent {
|
|
|
59
66
|
/* Flag attribute whi */
|
|
60
67
|
wrapperClosable: boolean
|
|
61
68
|
|
|
69
|
+
/* Reference element for positioning, can be a CSS selector string or an HTMLElement or Vue component instance */
|
|
70
|
+
reference: string | HTMLElement | ElementUIComponent
|
|
71
|
+
|
|
72
|
+
/* Placement of the drawer relative to the reference element */
|
|
73
|
+
placement: Placement
|
|
74
|
+
|
|
75
|
+
/* Offset distance from the reference element in pixels */
|
|
76
|
+
offset: number
|
|
77
|
+
|
|
62
78
|
$slots: DrawerSlots
|
|
63
79
|
}
|
package/types/element-ui.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { ElTrigger } from './trigger'
|
|
5
5
|
import { ElLazyLoad } from './lazy-load'
|
|
6
6
|
import { ElSegmented } from './segmented'
|
|
7
|
+
import { ElFilePreview } from './file-preview'
|
|
7
8
|
|
|
8
9
|
export class SelectableTag extends ElSelectableTag {}
|
|
9
10
|
|
|
@@ -18,3 +19,6 @@ export class LazyLoad extends ElLazyLoad {}
|
|
|
18
19
|
|
|
19
20
|
/** Segmented Component */
|
|
20
21
|
export class Segmented extends ElSegmented {}
|
|
22
|
+
|
|
23
|
+
/** FilePreview Component */
|
|
24
|
+
export class FilePreview extends ElFilePreview {}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ElementUIComponent } from './component'
|
|
2
|
+
|
|
3
|
+
/** 文件对象类型 */
|
|
4
|
+
export interface FileItem {
|
|
5
|
+
/** 文件 URL */
|
|
6
|
+
url?: string
|
|
7
|
+
/** 文件名称 */
|
|
8
|
+
name?: string
|
|
9
|
+
[key: string]: any
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** FilePreview Component */
|
|
13
|
+
export declare class ElFilePreview extends ElementUIComponent {
|
|
14
|
+
/** 文件列表 */
|
|
15
|
+
fileList: FileItem[] | string[]
|
|
16
|
+
|
|
17
|
+
/** URL 字段名 */
|
|
18
|
+
urlKey: string
|
|
19
|
+
|
|
20
|
+
/** 文件名字段名 */
|
|
21
|
+
nameKey: string
|
|
22
|
+
|
|
23
|
+
/** 是否启用图片预览 */
|
|
24
|
+
previewEnabled: boolean
|
|
25
|
+
|
|
26
|
+
/** 视频快照处理函数 */
|
|
27
|
+
videoSnapshotHandler: ((url: string) => string) | null
|
|
28
|
+
|
|
29
|
+
/** 视频对话框标题 */
|
|
30
|
+
videoDialogTitle: string
|
|
31
|
+
}
|
|
32
|
+
|