@v2coding/ui 0.1.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/README.md +6 -0
- package/dist/v2coding-ui.esm.js +10840 -0
- package/dist/v2coding-ui.min.js +1 -0
- package/dist/v2coding-ui.ssr.js +10747 -0
- package/package.json +54 -0
- package/src/components/dialog/dialog.vue +179 -0
- package/src/components/drawer/drawer.vue +523 -0
- package/src/components/exports/index.vue +53 -0
- package/src/components/exports/remote-exports-dialog.vue +202 -0
- package/src/components/field/field.autocomplete.vue +21 -0
- package/src/components/field/field.calendar.vue +117 -0
- package/src/components/field/field.cascade.vue +233 -0
- package/src/components/field/field.checkbox.vue +134 -0
- package/src/components/field/field.color.vue +24 -0
- package/src/components/field/field.date.vue +145 -0
- package/src/components/field/field.icons.vue +123 -0
- package/src/components/field/field.number.vue +43 -0
- package/src/components/field/field.radio.vue +100 -0
- package/src/components/field/field.rate.vue +37 -0
- package/src/components/field/field.rich.vue +165 -0
- package/src/components/field/field.select.vue +210 -0
- package/src/components/field/field.slider.vue +66 -0
- package/src/components/field/field.switch.vue +14 -0
- package/src/components/field/field.text.vue +66 -0
- package/src/components/field/field.timepicker.vue +70 -0
- package/src/components/field/field.timeselect.vue +24 -0
- package/src/components/field/field.trigger.dialog.vue +50 -0
- package/src/components/field/field.trigger.popover.vue +63 -0
- package/src/components/field/field.upload.file.vue +241 -0
- package/src/components/field/field.upload.image.vue +125 -0
- package/src/components/field/field.upload.portrait.vue +304 -0
- package/src/components/fill-view/index.vue +43 -0
- package/src/components/form/form.dialog.vue +174 -0
- package/src/components/form/form.drawer.vue +246 -0
- package/src/components/form/form.fieldset.vue +110 -0
- package/src/components/form/form.item.vue +213 -0
- package/src/components/form/form.vue +293 -0
- package/src/components/head-menu/index.vue +188 -0
- package/src/components/head-menu/menu-item.vue +84 -0
- package/src/components/history/index.vue +360 -0
- package/src/components/icon/icon.vue +63 -0
- package/src/components/minimize/index.vue +342 -0
- package/src/components/page/page.vue +43 -0
- package/src/components/provider/provider.vue +15 -0
- package/src/components/scroll-view/scroll-view.vue +384 -0
- package/src/components/table/column.vue +262 -0
- package/src/components/table/table.pagination.vue +71 -0
- package/src/components/table/table.select.vue +165 -0
- package/src/components/table/table.vue +805 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['minimize', direction, theme, {collapse: value, hover}]" @click="handleToggle">
|
|
3
|
+
<div class="line"></div>
|
|
4
|
+
<div class="indicator">
|
|
5
|
+
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'minimize',
|
|
13
|
+
props: {
|
|
14
|
+
direction: {
|
|
15
|
+
validator: (val) => ['top', 'right', 'bottom', 'left'].indexOf(val) !== -1,
|
|
16
|
+
},
|
|
17
|
+
value: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
theme: String,
|
|
22
|
+
},
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
hover: false,
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
isVertical() {
|
|
30
|
+
return ['left', 'right'].includes(this.direction);
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
watch: {
|
|
34
|
+
value (v) {
|
|
35
|
+
this.doCollapse(v);
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
mounted() {
|
|
39
|
+
this.init();
|
|
40
|
+
this.doCollapse(this.value);
|
|
41
|
+
},
|
|
42
|
+
beforeDestroy() {
|
|
43
|
+
const parent = this.$el.parentElement;
|
|
44
|
+
parent && parent.removeEventListener('mouseenter', this.onMouseEnter);
|
|
45
|
+
parent && parent.removeEventListener('mouseleave', this.onMouseLeave);
|
|
46
|
+
},
|
|
47
|
+
methods: {
|
|
48
|
+
init() {
|
|
49
|
+
const parent = this.$el.parentElement;
|
|
50
|
+
const style = parent.style;
|
|
51
|
+
// init style
|
|
52
|
+
style.position = 'relative';
|
|
53
|
+
style.transitionProperty = 'width, height';
|
|
54
|
+
style.transitionDuration = '300ms';
|
|
55
|
+
style.transitionTimingFunction = 'ease-in-out';
|
|
56
|
+
// init mouse event
|
|
57
|
+
parent.addEventListener('mouseenter', this.onMouseEnter);
|
|
58
|
+
parent.addEventListener('mouseleave', this.onMouseLeave);
|
|
59
|
+
},
|
|
60
|
+
onMouseEnter() {
|
|
61
|
+
this.hover = true;
|
|
62
|
+
},
|
|
63
|
+
onMouseLeave() {
|
|
64
|
+
this.hover = false;
|
|
65
|
+
},
|
|
66
|
+
handleToggle() {
|
|
67
|
+
this.$emit('input', !this.value);
|
|
68
|
+
this.$emit('change', !this.value);
|
|
69
|
+
},
|
|
70
|
+
doCollapse(collapse) {
|
|
71
|
+
const parent = this.$el.parentElement;
|
|
72
|
+
const style = parent.style;
|
|
73
|
+
if (collapse) { // 收起
|
|
74
|
+
if (this.isVertical) {
|
|
75
|
+
parent.childNodes.forEach((node) => {
|
|
76
|
+
if (node !== this.$el) {
|
|
77
|
+
node.style && node.style.setProperty('transform', 'scaleX(0)');
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
style && style.setProperty('width', '0');
|
|
81
|
+
} else {
|
|
82
|
+
parent.childNodes.forEach((node) => {
|
|
83
|
+
if (node !== this.$el) {
|
|
84
|
+
node.style && node.style.setProperty('transform', 'scaleY(0)');
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
style && style.setProperty('height', '0');
|
|
88
|
+
}
|
|
89
|
+
} else { // 展开
|
|
90
|
+
if (this.isVertical) {
|
|
91
|
+
style && style.removeProperty('width');
|
|
92
|
+
} else {
|
|
93
|
+
style && style.removeProperty('height');
|
|
94
|
+
}
|
|
95
|
+
parent.childNodes.forEach((node) => {
|
|
96
|
+
if (node !== this.$el && node.style) {
|
|
97
|
+
node.style && node.style.removeProperty('transform');
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<style lang="less" scoped>
|
|
107
|
+
@visibleWidth: 14px;
|
|
108
|
+
@indicatorWidth: 36px;
|
|
109
|
+
|
|
110
|
+
.minimize {
|
|
111
|
+
position: absolute;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
.line {
|
|
116
|
+
position: absolute;
|
|
117
|
+
background-color: #ccc;
|
|
118
|
+
transition-duration: 200ms;
|
|
119
|
+
transition-property: background-color, width, height;
|
|
120
|
+
transition-timing-function: ease-in-out;
|
|
121
|
+
}
|
|
122
|
+
.indicator {
|
|
123
|
+
opacity: 0.6;
|
|
124
|
+
background-color: #ccc;
|
|
125
|
+
transition-duration: 200ms;
|
|
126
|
+
transition-property: background-color, opacity;
|
|
127
|
+
transition-timing-function: ease-in-out;
|
|
128
|
+
}
|
|
129
|
+
&.hover .indicator {
|
|
130
|
+
opacity: 1;
|
|
131
|
+
}
|
|
132
|
+
&.top,
|
|
133
|
+
&.bottom {
|
|
134
|
+
left: 0;
|
|
135
|
+
right: 0;
|
|
136
|
+
height: @visibleWidth;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
.line {
|
|
139
|
+
height: 1px;
|
|
140
|
+
width: 100%;
|
|
141
|
+
}
|
|
142
|
+
.indicator {
|
|
143
|
+
width: @indicatorWidth;
|
|
144
|
+
height: 100%;
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
flex-direction: row;
|
|
149
|
+
&::before,
|
|
150
|
+
&::after {
|
|
151
|
+
content: '';
|
|
152
|
+
display: block;
|
|
153
|
+
position: relative;
|
|
154
|
+
width: 10px;
|
|
155
|
+
height: 2px;
|
|
156
|
+
background-color: #fff;
|
|
157
|
+
transition: all 300ms ease-in-out;
|
|
158
|
+
}
|
|
159
|
+
&::before {
|
|
160
|
+
left: 1px;
|
|
161
|
+
}
|
|
162
|
+
&::after {
|
|
163
|
+
right: 1px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
&:hover {
|
|
167
|
+
.line {
|
|
168
|
+
height: 2px;
|
|
169
|
+
background-color: #3da8f5;
|
|
170
|
+
}
|
|
171
|
+
.indicator {
|
|
172
|
+
opacity: 1;
|
|
173
|
+
background-color: #3da8f5;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
&.left,
|
|
178
|
+
&.right {
|
|
179
|
+
width: @visibleWidth;
|
|
180
|
+
top: 0;
|
|
181
|
+
bottom: 0;
|
|
182
|
+
flex-direction: row;
|
|
183
|
+
.line {
|
|
184
|
+
width: 1px;
|
|
185
|
+
height: 100%;
|
|
186
|
+
}
|
|
187
|
+
.indicator {
|
|
188
|
+
width: 100%;
|
|
189
|
+
height: @indicatorWidth;
|
|
190
|
+
display: flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
&::before,
|
|
195
|
+
&::after {
|
|
196
|
+
content: '';
|
|
197
|
+
display: block;
|
|
198
|
+
position: relative;
|
|
199
|
+
width: 2px;
|
|
200
|
+
height: 10px;
|
|
201
|
+
background-color: #fff;
|
|
202
|
+
transition: all 300ms ease-in-out;
|
|
203
|
+
}
|
|
204
|
+
&::before {
|
|
205
|
+
bottom: -1px;
|
|
206
|
+
}
|
|
207
|
+
&::after {
|
|
208
|
+
top: -1px;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
&:hover {
|
|
212
|
+
.line {
|
|
213
|
+
width: 2px;
|
|
214
|
+
background-color: #3da8f5;
|
|
215
|
+
}
|
|
216
|
+
.indicator {
|
|
217
|
+
opacity: 1;
|
|
218
|
+
background-color: #3da8f5;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
&.top {
|
|
223
|
+
bottom: -(@visibleWidth);
|
|
224
|
+
.line {
|
|
225
|
+
top: 0;
|
|
226
|
+
}
|
|
227
|
+
.indicator {
|
|
228
|
+
border-radius: 0 0 4px 4px;
|
|
229
|
+
}
|
|
230
|
+
&:hover {
|
|
231
|
+
.indicator::before {
|
|
232
|
+
transform: rotate(-24deg);
|
|
233
|
+
}
|
|
234
|
+
.indicator::after {
|
|
235
|
+
transform: rotate(24deg);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
&.collapse:hover {
|
|
239
|
+
.indicator {
|
|
240
|
+
opacity: 1;
|
|
241
|
+
|
|
242
|
+
&::before {
|
|
243
|
+
transform: rotate(24deg);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&::after {
|
|
247
|
+
transform: rotate(-24deg);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
&.right {
|
|
253
|
+
left: -(@visibleWidth);
|
|
254
|
+
.line {
|
|
255
|
+
right: 0;
|
|
256
|
+
}
|
|
257
|
+
.indicator {
|
|
258
|
+
border-radius: 4px 0 0 4px;
|
|
259
|
+
}
|
|
260
|
+
&:hover {
|
|
261
|
+
.indicator::before {
|
|
262
|
+
transform: rotate(-24deg);
|
|
263
|
+
}
|
|
264
|
+
.indicator::after {
|
|
265
|
+
transform: rotate(24deg);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
&.collapse {
|
|
269
|
+
.indicator {
|
|
270
|
+
opacity: 1;
|
|
271
|
+
|
|
272
|
+
&::before {
|
|
273
|
+
transform: rotate(24deg);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
&::after {
|
|
277
|
+
transform: rotate(-24deg);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
&.bottom {
|
|
283
|
+
top: -(@visibleWidth);
|
|
284
|
+
.line {
|
|
285
|
+
bottom: 0;
|
|
286
|
+
}
|
|
287
|
+
.indicator {
|
|
288
|
+
border-radius: 4px 4px 0 0;
|
|
289
|
+
}
|
|
290
|
+
&:hover {
|
|
291
|
+
.indicator::before {
|
|
292
|
+
transform: rotate(24deg);
|
|
293
|
+
}
|
|
294
|
+
.indicator::after {
|
|
295
|
+
transform: rotate(-24deg);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
&.collapse {
|
|
299
|
+
.indicator {
|
|
300
|
+
opacity: 1;
|
|
301
|
+
|
|
302
|
+
&::before {
|
|
303
|
+
transform: rotate(-24deg);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
&::after {
|
|
307
|
+
transform: rotate(24deg);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
&.left {
|
|
313
|
+
right: -(@visibleWidth);
|
|
314
|
+
.line {
|
|
315
|
+
left: 0;
|
|
316
|
+
}
|
|
317
|
+
.indicator {
|
|
318
|
+
border-radius: 0 4px 4px 0;
|
|
319
|
+
}
|
|
320
|
+
&:hover {
|
|
321
|
+
.indicator::before {
|
|
322
|
+
transform: rotate(24deg);
|
|
323
|
+
}
|
|
324
|
+
.indicator::after {
|
|
325
|
+
transform: rotate(-24deg);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
&.collapse {
|
|
329
|
+
.indicator {
|
|
330
|
+
opacity: 1;
|
|
331
|
+
|
|
332
|
+
&::before {
|
|
333
|
+
transform: rotate(-24deg);
|
|
334
|
+
}
|
|
335
|
+
&::after {
|
|
336
|
+
transform: rotate(24deg);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<document-title :title="titleReal">
|
|
3
|
+
<div class="ui-page" :class="{'ui-page-direction-row': direction === 'row'}">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
6
|
+
</document-title>
|
|
7
|
+
</template>
|
|
8
|
+
<script>
|
|
9
|
+
import DocumentTitle from '../document-title';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: 'ui-page',
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
components: {DocumentTitle},
|
|
15
|
+
props: {
|
|
16
|
+
direction: {
|
|
17
|
+
type: String,
|
|
18
|
+
validator: (val) => ['row', 'column'].includes(val),
|
|
19
|
+
default: 'column',
|
|
20
|
+
},
|
|
21
|
+
title: {
|
|
22
|
+
type: String,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
titleReal() {
|
|
27
|
+
return this.title || this.$route.meta.name || '';
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
<style lang="less">
|
|
33
|
+
.ui-page {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
overflow: auto;
|
|
37
|
+
position: relative;
|
|
38
|
+
|
|
39
|
+
&.ui-page-direction-row {
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</style>
|