@v2coding/ui 0.1.4 → 0.1.8

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/v2coding-ui.esm.js +1452 -679
  3. package/dist/v2coding-ui.min.js +1 -1
  4. package/dist/v2coding-ui.ssr.js +1469 -679
  5. package/package.json +2 -3
  6. package/src/components/dialog/dialog.vue +0 -179
  7. package/src/components/drawer/drawer.vue +0 -523
  8. package/src/components/exports/index.vue +0 -53
  9. package/src/components/exports/remote-exports-dialog.vue +0 -202
  10. package/src/components/field/field.autocomplete.vue +0 -21
  11. package/src/components/field/field.calendar.vue +0 -117
  12. package/src/components/field/field.cascade.vue +0 -233
  13. package/src/components/field/field.checkbox.vue +0 -134
  14. package/src/components/field/field.color.vue +0 -24
  15. package/src/components/field/field.date.vue +0 -145
  16. package/src/components/field/field.icons.vue +0 -123
  17. package/src/components/field/field.number.vue +0 -43
  18. package/src/components/field/field.radio.vue +0 -100
  19. package/src/components/field/field.rate.vue +0 -37
  20. package/src/components/field/field.rich.vue +0 -155
  21. package/src/components/field/field.select.vue +0 -210
  22. package/src/components/field/field.slider.vue +0 -66
  23. package/src/components/field/field.switch.vue +0 -14
  24. package/src/components/field/field.text.vue +0 -66
  25. package/src/components/field/field.timepicker.vue +0 -70
  26. package/src/components/field/field.timeselect.vue +0 -24
  27. package/src/components/field/field.trigger.dialog.vue +0 -50
  28. package/src/components/field/field.trigger.popover.vue +0 -63
  29. package/src/components/field/field.upload.file.vue +0 -241
  30. package/src/components/field/field.upload.image.vue +0 -125
  31. package/src/components/fill-view/fill-view.vue +0 -43
  32. package/src/components/form/form.dialog.vue +0 -174
  33. package/src/components/form/form.drawer.vue +0 -246
  34. package/src/components/form/form.fieldset.vue +0 -110
  35. package/src/components/form/form.item.vue +0 -210
  36. package/src/components/form/form.vue +0 -302
  37. package/src/components/head-menu/head-menu.vue +0 -188
  38. package/src/components/head-menu/menu-item.vue +0 -80
  39. package/src/components/history/history.vue +0 -361
  40. package/src/components/icon/icon.vue +0 -63
  41. package/src/components/minimize/minimize.vue +0 -342
  42. package/src/components/page/page.vue +0 -43
  43. package/src/components/page/search-page.vue +0 -202
  44. package/src/components/provider/provider.vue +0 -15
  45. package/src/components/scroll-view/scroll-view.vue +0 -384
  46. package/src/components/table/column.vue +0 -262
  47. package/src/components/table/table.pagination.vue +0 -71
  48. package/src/components/table/table.select.vue +0 -165
  49. package/src/components/table/table.vue +0 -807
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v2coding/ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.8",
4
4
  "description": "",
5
5
 
6
6
  "main": "dist/v2coding-ui.ssr.js",
@@ -9,8 +9,7 @@
9
9
  "unpkg": "dist/v2coding-ui.min.js",
10
10
 
11
11
  "files": [
12
- "dist/*",
13
- "src/**/*.vue"
12
+ "dist/*"
14
13
  ],
15
14
  "sideEffects": false,
16
15
 
@@ -1,179 +0,0 @@
1
- <template>
2
- <el-dialog v-dialogDrag v-bind="$attrs" :visible="visible" @update:visible="updateVisible" :width="width" :close-on-click-modal="closeOnClickModal" :destroy-on-close="destroyOnClose" @open="onOpen" :show-close="false" @opened="onOpened" @close="onClose" @closed="onClosed" ref="_dialog" class="ui-dialog">
3
- <div v-if="title" slot="title" class="title">
4
- {{ title }}
5
- <span class="close" @click="close">
6
- <i class="el-icon-close"></i>
7
- </span>
8
- </div>
9
- <slot></slot>
10
- <div v-if="buttons && buttons.length" slot="footer">
11
- <el-button v-for="(button, index) in buttons" :key="index" size="medium" v-bind="button" @click="button.handle(close)">{{ button.text }}</el-button>
12
- </div>
13
- </el-dialog>
14
- </template>
15
-
16
- <script>
17
- export default {
18
- name: 'ui-dialog',
19
- props: {
20
- title: String,
21
- visible: Boolean,
22
- width: {
23
- type: String,
24
- default: '600px',
25
- },
26
- // 默认取消按钮点击触发函数
27
- cancel: {
28
- type: Function,
29
- default: (hide) => hide(),
30
- },
31
- closeOnClickModal: {
32
- type: Boolean,
33
- default: false,
34
- },
35
- destroyOnClose: {
36
- type: Boolean,
37
- default: true,
38
- },
39
- autoFocus: {
40
- type: Boolean,
41
- default: false,
42
- },
43
- // 默认确定按钮点击触发函数
44
- confirm: {
45
- type: Function,
46
- default: (hide) => hide(),
47
- },
48
- /**
49
- * {
50
- * text: '', // required
51
- * handle: () => {}, // required
52
- * icon: '', // optional
53
- * ... el-button`s options
54
- * }
55
- */
56
- buttons: {
57
- type: null,
58
- default() {
59
- return [
60
- {text: '取消', icon: 'el-icon-error', handle: this.cancel},
61
- {text: '确定', icon: 'el-icon-success', type: 'primary', handle: this.confirm},
62
- ];
63
- },
64
- },
65
- },
66
- deactivated() {
67
- this.close();
68
- },
69
- beforeDestroy() {
70
- this.close();
71
- },
72
- methods: {
73
- close() {
74
- this.updateVisible(false);
75
- },
76
- updateVisible(visible) {
77
- this.$emit('update:visible', visible);
78
- },
79
- onOpen() {
80
- this.$emit('open');
81
- },
82
- onOpened() {
83
- if (this.autoFocus) {
84
- const input = this.$el.querySelector('input');
85
- input && input.focus();
86
- }
87
- this.$emit('opened');
88
- },
89
- onClose() {
90
- this.$emit('close');
91
- },
92
- onClosed() {
93
- this.$emit('closed');
94
- },
95
- },
96
- };
97
- </script>
98
-
99
- <style lang="scss" scoped>
100
-
101
- .ui-dialog {
102
-
103
- ::v-deep .el-dialog {
104
- margin-bottom: 0;
105
-
106
- .title {
107
- position: relative;
108
- line-height: 28px;
109
- padding: 12px 48px 12px 24px;
110
- word-break: keep-all;
111
- overflow: hidden;
112
- text-overflow: ellipsis;
113
- white-space: nowrap;
114
- border-bottom: 1px solid #e8e8e8;
115
- color: #202124;
116
- font-weight: 500;
117
- font-size: 16px;
118
-
119
- .close {
120
- position: absolute;
121
- right: 0;
122
- top: 0;
123
- bottom: 0;
124
- width: 53px;
125
- height: 53px;
126
- display: inline-block;
127
- text-align: center;
128
- cursor: pointer;
129
- transition: all 0.3s;
130
- user-select: none;
131
-
132
- &:hover {
133
- color: var(--color-primary);
134
- }
135
-
136
- & > i {
137
- font-size: 20px;
138
- line-height: 53px;
139
- }
140
- }
141
- }
142
- }
143
- }
144
-
145
- ::v-deep .el-form .ui-form-fieldset:first-child {
146
- margin-top: 0;
147
- }
148
-
149
- ::v-deep .el-form .ui-form-fieldset:last-child {
150
- margin-bottom: 0;
151
- }
152
-
153
- ::v-deep .el-dialog__header {
154
- padding: 0;
155
- user-select: none;
156
- }
157
-
158
- ::v-deep .el-dialog__body {
159
- padding-bottom: 20px;
160
- }
161
-
162
- ::v-deep .el-dialog__footer {
163
- padding: 10px 20px;
164
- border-top: 1px solid #dcdfe6;
165
- }
166
-
167
- .el-dialog__footer .el-button {
168
- border-radius: 2px;
169
- }
170
-
171
- @keyframes rotate {
172
- from {
173
- transform: rotate(0deg);
174
- }
175
- to {
176
- transform: rotate(360deg);
177
- }
178
- }
179
- </style>
@@ -1,523 +0,0 @@
1
- <template>
2
- <div v-transfer-dom :data-transfer="transfer">
3
- <transition name="fade">
4
- <div :class="maskClasses" :style="maskStyle" v-show="visible" v-if="mask" @click="handleMask"></div>
5
- </transition>
6
- <div :class="wrapClasses" @click="handleWrapClick">
7
- <transition :name="'move-' + placement">
8
- <div :class="classes" :style="mainStyles" v-show="visible">
9
- <div :class="contentClasses" ref="content">
10
- <a class="ui-drawer-close" v-if="closable" @click="close">
11
- <slot name="close">
12
- <i class="el-icon-close"></i>
13
- </slot>
14
- </a>
15
- <div :class="[prefixCls + '-header']" v-if="showHead"><slot name="header"><div :class="[prefixCls + '-header-inner']">{{ title }}</div></slot></div>
16
- <div :class="[prefixCls + '-body']" :style="styles"><slot></slot></div>
17
- </div>
18
- <div class="ui-drawer-drag" :class="{ 'ui-drawer-drag-left': placement === 'left' }" v-if="draggable" @mousedown="handleTriggerMousedown">
19
- <slot name="trigger">
20
- <div class="ui-drawer-drag-move-trigger">
21
- <div class="ui-drawer-drag-move-trigger-point">
22
- <i></i><i></i><i></i><i></i><i></i>
23
- </div>
24
- </div>
25
- </slot>
26
- </div>
27
- </div>
28
- </transition>
29
- </div>
30
- </div>
31
- </template>
32
- <script>
33
- import { oneOf} from './assist';
34
- import TransferDom from './transfer-dom';
35
- import { on, off } from './dom';
36
-
37
- const prefixCls = 'ui-drawer';
38
-
39
- export default {
40
- name: 'UiDrawer',
41
- directives: { TransferDom },
42
- props: {
43
- value: {
44
- type: Boolean,
45
- default: false
46
- },
47
- title: {
48
- type: String
49
- },
50
- width: {
51
- type: [Number, String],
52
- default: 256
53
- },
54
- closable: {
55
- type: Boolean,
56
- default: true
57
- },
58
- maskClosable: {
59
- type: Boolean,
60
- default: true
61
- },
62
- mask: {
63
- type: Boolean,
64
- default: true
65
- },
66
- maskStyle: {
67
- type: Object
68
- },
69
- styles: {
70
- type: Object
71
- },
72
- scrollable: {
73
- type: Boolean,
74
- default: false
75
- },
76
- placement: {
77
- validator (value) {
78
- return oneOf(value, ['left', 'right']);
79
- },
80
- default: 'right'
81
- },
82
- zIndex: {
83
- type: Number,
84
- default: 1000
85
- },
86
- transfer: {
87
- type: Boolean,
88
- default: true,
89
- },
90
- className: {
91
- type: String
92
- },
93
- inner: {
94
- type: Boolean,
95
- default: false
96
- },
97
- // Whether drag and drop is allowed to adjust width
98
- draggable: {
99
- type: Boolean,
100
- default: false
101
- },
102
- beforeClose: Function,
103
- },
104
- data () {
105
- return {
106
- prefixCls: prefixCls,
107
- visible: this.value,
108
- wrapShow: false,
109
- showHead: true,
110
- canMove: false,
111
- dragWidth: this.width,
112
- wrapperWidth: this.width,
113
- wrapperLeft: 0,
114
- minWidth: 256
115
- };
116
- },
117
- computed: {
118
- wrapClasses () {
119
- return [
120
- `${prefixCls}-wrap`,
121
- {
122
- [`${prefixCls}-hidden`]: !this.wrapShow,
123
- [`${this.className}`]: !!this.className,
124
- [`${prefixCls}-no-mask`]: !this.mask,
125
- [`${prefixCls}-wrap-inner`]: this.inner,
126
- [`${prefixCls}-wrap-dragging`]: this.canMove
127
- }
128
- ];
129
- },
130
- mainStyles () {
131
- let style = {};
132
- const width = parseInt(this.dragWidth);
133
- const styleWidth = {
134
- width: width <= 100 ? `${width}%` : `${width}px`
135
- };
136
- Object.assign(style, styleWidth);
137
- return style;
138
- },
139
- contentClasses () {
140
- return [
141
- `${prefixCls}-content`,
142
- {
143
- [`${prefixCls}-content-no-mask`]: !this.mask
144
- }
145
- ];
146
- },
147
- classes () {
148
- return [
149
- `${prefixCls}`,
150
- `${prefixCls}-${this.placement}`,
151
- {
152
- [`${prefixCls}-no-header`]: !this.showHead,
153
- [`${prefixCls}-inner`]: this.inner
154
- }
155
- ];
156
- },
157
- maskClasses () {
158
- return [
159
- `${prefixCls}-mask`,
160
- {
161
- [`${prefixCls}-mask-inner`]: this.inner
162
- }
163
- ];
164
- }
165
- },
166
- methods: {
167
- close () {
168
- if (!this.beforeClose) {
169
- return this.handleClose();
170
- }
171
- const before = this.beforeClose();
172
- if (before && before.then) {
173
- before.then(() => {
174
- this.handleClose();
175
- });
176
- } else {
177
- this.handleClose();
178
- }
179
- },
180
- handleClose () {
181
- this.visible = false;
182
- this.$emit('input', false);
183
- this.$emit('on-close');
184
- },
185
- handleMask () {
186
- if (this.maskClosable && this.mask) {
187
- this.close();
188
- }
189
- },
190
- handleWrapClick (event) {
191
- // use indexOf,do not use === ,because ivu-modal-wrap can have other custom className
192
- const className = event.target.getAttribute('class');
193
- if (className && className.indexOf(`${prefixCls}-wrap`) > -1) this.handleMask();
194
- },
195
- handleMousemove (event) {
196
- if (!this.canMove || !this.draggable) return;
197
- // 更新容器宽度和距离左侧页面距离,如果是window则距左侧距离为0
198
- this.handleSetWrapperWidth();
199
- const left = event.pageX - this.wrapperLeft;
200
- // 如果抽屉方向为右边,宽度计算需用容器宽度减去left
201
- let width = this.placement === 'right' ? this.wrapperWidth - left : left;
202
- // 限定最小宽度
203
- width = Math.max(width, parseFloat(this.minWidth));
204
- event.atMin = width === parseFloat(this.minWidth);
205
- // 如果当前width不大于100,视为百分比
206
- if (width <= 100) width = (width / this.wrapperWidth) * 100;
207
- this.dragWidth = width;
208
- this.$emit('on-resize-width', parseInt(this.dragWidth));
209
- },
210
- handleSetWrapperWidth () {
211
- const {
212
- width,
213
- left
214
- } = this.$el.getBoundingClientRect();
215
- this.wrapperWidth = width;
216
- this.wrapperLeft = left;
217
- },
218
- handleMouseup () {
219
- if (!this.draggable) return;
220
- this.canMove = false;
221
- },
222
- handleTriggerMousedown () {
223
- this.canMove = true;
224
- // 防止鼠标选中抽屉中文字,造成拖动trigger触发浏览器原生拖动行为
225
- window.getSelection().removeAllRanges();
226
- },
227
- },
228
- mounted () {
229
- if (this.visible) {
230
- this.wrapShow = true;
231
- }
232
- let showHead = true;
233
- if (this.$slots.header === undefined && !this.title) {
234
- showHead = false;
235
- }
236
- this.showHead = showHead;
237
- on(document, 'mousemove', this.handleMousemove);
238
- on(document, 'mouseup', this.handleMouseup);
239
- this.handleSetWrapperWidth();
240
- },
241
- beforeDestroy () {
242
- off(document, 'mousemove', this.handleMousemove);
243
- off(document, 'mouseup', this.handleMouseup);
244
- },
245
- watch: {
246
- value (val) {
247
- this.visible = val;
248
- },
249
- visible (val) {
250
- if (val === false) {
251
- this.timer = setTimeout(() => {
252
- this.wrapShow = false;
253
- }, 300);
254
- } else {
255
- if (this.timer) clearTimeout(this.timer);
256
- this.wrapShow = true;
257
- }
258
- this.$emit('on-visible-change', val);
259
- },
260
- title (val) {
261
- if (this.$slots.header === undefined) {
262
- this.showHead = !!val;
263
- }
264
- },
265
- width (val) {
266
- this.dragWidth = val;
267
- }
268
- }
269
- };
270
- </script>
271
-
272
- <style lang="less">
273
- @drawer-prefix-cls: ~"ui-drawer";
274
-
275
- .content-header() {
276
- border-bottom: 1px solid #e8eaec;
277
- padding: 14px 16px;
278
- line-height: 1;
279
-
280
- p,
281
- &-inner
282
- {
283
- display: inline-block;
284
- width: 100%;
285
- height: 20px;
286
- line-height: 20px;
287
- font-size: 16px;
288
- color: #17233d;
289
- font-weight: 500;
290
- overflow: hidden;
291
- text-overflow: ellipsis;
292
- white-space: nowrap;
293
- }
294
- p i, p span{
295
- //vertical-align: middle;
296
- }
297
- }
298
-
299
- .content-close(@top: 0, @icon-font-size: 22px) {
300
- font-size: 12px;
301
- position: absolute;
302
- right: 15px;
303
- top: 15px;
304
- overflow: hidden;
305
- cursor: pointer;
306
-
307
- .el-icon-close {
308
- font-size: @icon-font-size;
309
- color: #999;
310
- transition: color .2s ease;
311
- position: relative;
312
- top: @top;
313
- &:hover {
314
- color: #444;
315
- }
316
- }
317
- }
318
-
319
- .mask() {
320
- position: fixed;
321
- top: 0;
322
- bottom: 0;
323
- left: 0;
324
- right: 0;
325
- background-color: rgba(55, 55, 55, 0.6);
326
- height: 100%;
327
- z-index: 1000;
328
-
329
- &-hidden {
330
- display: none;
331
- }
332
- }
333
-
334
- .@{drawer-prefix-cls} {
335
- width: auto;
336
- height: 100%;
337
- position: fixed;
338
- top: 0;
339
-
340
- &-inner{
341
- position: absolute;
342
- }
343
-
344
- &-left{
345
- left: 0;
346
- }
347
- &-right{
348
- right: 0;
349
- }
350
-
351
- &-hidden {
352
- display: none !important;
353
- }
354
-
355
- &-wrap {
356
- position: fixed;
357
- overflow: auto;
358
- top: 0;
359
- right: 0;
360
- bottom: 0;
361
- left: 0;
362
- z-index: 1000;
363
- -webkit-overflow-scrolling: touch;
364
- outline: 0;
365
-
366
- &-inner{
367
- position: absolute;
368
- overflow: hidden;
369
- }
370
-
371
- &-dragging{
372
- user-select: none;
373
- }
374
- }
375
-
376
- &-wrap * {
377
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
378
- }
379
-
380
- &-mask {
381
- .mask;
382
- &-inner{
383
- position: absolute;
384
- }
385
- }
386
-
387
- &-content {
388
- width: 100%;
389
- height: 100%;
390
- position: absolute;
391
- top: 0;
392
- bottom: 0;
393
- background-color: #fff;
394
- border: 0;
395
- background-clip: padding-box;
396
- box-shadow: 0 4px 12px rgba(0,0,0,.15);
397
-
398
- &-no-mask{
399
- pointer-events: auto;
400
- }
401
- }
402
-
403
- &-header {
404
- .content-header;
405
- }
406
-
407
- &-close {
408
- z-index: 1;
409
- .content-close(1px, 20px);
410
- }
411
-
412
- &-body {
413
- width: 100%;
414
- height: calc(~'100% - 51px');
415
- padding: 16px;
416
- font-size: 14px;
417
- line-height: 1.5;
418
- word-wrap: break-word;
419
- position: absolute;
420
- overflow: auto;
421
- box-sizing: border-box;
422
- }
423
-
424
- &-no-header &-body{
425
- height: 100%;
426
- }
427
-
428
- &-no-mask{
429
- pointer-events: none;
430
-
431
- .@{drawer-prefix-cls}-drag{
432
- pointer-events: auto;
433
- }
434
- }
435
-
436
- &-drag{
437
- top: 0;
438
- height: 100%;
439
- width: 0;
440
- position: absolute;
441
- &-left{
442
- right: 0;
443
- }
444
- &-move-trigger{
445
- width: 8px;
446
- height: 100px;
447
- line-height: 100px;
448
- position: absolute;
449
- top: 50%;
450
- background: rgb(243, 243, 243);
451
- transform: translate(-50%, -50%);
452
- border-radius: ~"4px / 6px";
453
- box-shadow: 0 0 1px 1px rgba(0, 0, 0, .2);
454
- cursor: col-resize;
455
- &-point{
456
- display: inline-block;
457
- width: 50%;
458
- transform: translateX(50%);
459
- i{
460
- display: block;
461
- border-bottom: 1px solid rgb(192, 192, 192);
462
- padding-bottom: 2px;
463
- }
464
- }
465
- }
466
- }
467
- }
468
-
469
- .motion-common(@time) {
470
- animation-duration: @time;
471
- animation-fill-mode: both;
472
- }
473
-
474
- .make-motion(@className, @keyframeName, @time: .3s) {
475
- .@{className}-enter-active, .@{className}-appear {
476
- .motion-common(@time);
477
- animation-play-state: paused;
478
- }
479
- .@{className}-leave-active {
480
- .motion-common(@time);
481
- animation-play-state: paused;
482
- }
483
- .@{className}-enter-active, .@{className}-appear {
484
- animation-name: ~"@{keyframeName}In";
485
- animation-play-state: running;
486
- }
487
- .@{className}-leave-active {
488
- animation-name: ~"@{keyframeName}Out";
489
- animation-play-state: running;
490
- }
491
- }
492
-
493
- .fade-motion(@className, @keyframeName) {
494
- .make-motion(@className, @keyframeName, .15s);
495
- .@{className}-enter-active, .@{className}-appear {
496
- opacity: 0;
497
- animation-timing-function: linear;
498
- }
499
- .@{className}-leave-active {
500
- animation-timing-function: linear;
501
- }
502
- }
503
-
504
- .fade-motion(fade, uiFadeIn);
505
-
506
- @keyframes uiFadeIn {
507
- 0% {
508
- opacity: 0;
509
- }
510
- 100% {
511
- opacity: 1;
512
- }
513
- }
514
-
515
- @keyframes ivuFadeOut {
516
- 0% {
517
- opacity: 1;
518
- }
519
- 100% {
520
- opacity: 0;
521
- }
522
- }
523
- </style>