kui-vue 3.3.11 → 3.3.12
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/components/_tool/clone.js +1 -2
- package/components/_tool/utils.js +3 -3
- package/components/alert/styles/index.less +2 -2
- package/components/avatar/AvatarGroup.jsx +2 -2
- package/components/backtop/styles/index.less +44 -47
- package/components/base/drop.jsx +3 -2
- package/components/base/pop.jsx +34 -20
- package/components/button/button.jsx +5 -11
- package/components/button/index.js +1 -8
- package/components/collapse/styles/index.less +3 -16
- package/components/colorPicker/colorpicker.jsx +1 -1
- package/components/colorPicker/styles/index.less +6 -18
- package/components/datePicker/datecalendar.jsx +1 -1
- package/components/datePicker/styles/datepicker.less +4 -14
- package/components/drawer/drawer.jsx +1 -1
- package/components/dropdown/demo/base.md +1 -1
- package/components/dropdown/demo/rightmenu.md +5 -5
- package/components/dropdown/dropdown.jsx +11 -3
- package/components/dropdown/styles/index.less +31 -13
- package/components/form/form.jsx +1 -1
- package/components/form/styles/index.less +3 -14
- package/components/fragment/component.js +98 -0
- package/components/fragment/frag.js +362 -0
- package/components/fragment/fragment.js +19 -0
- package/components/fragment/index.js +104 -0
- package/components/fragment/ssr.js +4 -0
- package/components/icon/demo/search.vue +1 -1
- package/components/image/styles/index.less +41 -17
- package/components/index.js +2 -2
- package/components/menu/menuitem.jsx +12 -7
- package/components/menu/styles/index.less +189 -202
- package/components/menu/submenu.jsx +106 -37
- package/components/message/styles/index.less +11 -14
- package/components/modal/index.js +1 -1
- package/components/modal/modal.jsx +2 -2
- package/components/modal/styles/index.less +227 -221
- package/components/notice/styles/index.less +19 -5
- package/components/popconfirm/styles/index.less +33 -14
- package/components/poptip/styles/index.less +3 -14
- package/components/radio/button.jsx +1 -1
- package/components/select/styles/index.less +8 -31
- package/components/table/table.jsx +1 -1
- package/components/tabs/styles/index.less +3 -2
- package/components/tag/styles/index.less +3 -15
- package/components/tooltip/styles/index.less +45 -16
- package/components/tooltip/tooltip.jsx +3 -3
- package/components/tree/node.jsx +1 -1
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.js +2 -2
- package/package.json +3 -3
- package/components/menu/styles/dropmenu.less +0 -119
|
@@ -55,6 +55,7 @@ function extractData(vnode, isComp) {
|
|
|
55
55
|
return data
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
|
|
58
59
|
export default function cloneVNode(vnode, options = {}, child) {
|
|
59
60
|
if (!vnode) return vnode
|
|
60
61
|
// use the context that the original vnode was created in.
|
|
@@ -93,10 +94,8 @@ export default function cloneVNode(vnode, options = {}, child) {
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
data.on = { ...oEven, ...nEven }
|
|
96
|
-
// console.log(data, oEven, nEven)
|
|
97
97
|
const tag = isComp
|
|
98
98
|
? vnode.componentOptions.Ctor
|
|
99
99
|
: vnode.tag
|
|
100
|
-
// const childNodes = children ? children.map(c => cloneVNode(c)) : undefined
|
|
101
100
|
return h(tag, data, children)
|
|
102
101
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export function isEmptyNode(vnode = {}) {
|
|
2
2
|
return !(vnode.eml || vnode.tag || (vnode.text && vnode.text.trim() !== ''))
|
|
3
3
|
}
|
|
4
|
+
|
|
4
5
|
export function getChild(child = [], name) {
|
|
5
6
|
// return child.filter(c => !isEmptyNode(c, name) )
|
|
6
7
|
return child.filter(c => {
|
|
@@ -63,7 +64,6 @@ export function getElementPos(element) {
|
|
|
63
64
|
/*
|
|
64
65
|
see: https://github.com/vuejs/vue/blob/dev/src/core/vdom/vnode.js
|
|
65
66
|
*/
|
|
66
|
-
|
|
67
67
|
export function cloneVNode(vnode, options = {}, childs) {
|
|
68
68
|
let { componentOptions, data = {}, children } = vnode
|
|
69
69
|
if (childs && children) {
|
|
@@ -76,7 +76,7 @@ export function cloneVNode(vnode, options = {}, childs) {
|
|
|
76
76
|
componentOptions.children = componentOptions.children.concat(childs)
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
let ndata = JSON.parse(JSON.stringify(data))
|
|
79
|
+
// let ndata = JSON.parse(JSON.stringify(data))
|
|
80
80
|
let { attrs = {}, on = {}, style = {} } = data
|
|
81
81
|
|
|
82
82
|
data.attrs = Object.assign(attrs, options.attrs)
|
|
@@ -151,7 +151,7 @@ export function getPosition(selection, picker, transfer, placement = 'bottom-lef
|
|
|
151
151
|
let showInRight = clientWidth - selectionRect.right > pickerWidth
|
|
152
152
|
|
|
153
153
|
// console.log(showInRight, selectionRect.left > pickerWidth, selectionRect.right, pickerWidth)
|
|
154
|
-
console.log('bottom:', showInBottom, 'top:', showInTop, 'left:', showInLeft, 'right:', showInRight)
|
|
154
|
+
// console.log('bottom:', showInBottom, 'top:', showInTop, 'left:', showInLeft, 'right:', showInRight)
|
|
155
155
|
// console.log(placement, 'showInTop:', showInTop, 'showInBottom:', showInBottom, clientHeight, scrollTop, selectionRect.top, pickerHeight)
|
|
156
156
|
|
|
157
157
|
let hasBottom = placement.slice(0, 6) == 'bottom'
|
|
@@ -89,10 +89,10 @@
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
&-slide-leave-to {
|
|
92
|
-
animation: k-alert-slide
|
|
92
|
+
animation: k-alert-slide 0.3s ease-in-out;
|
|
93
93
|
animation-fill-mode: both;
|
|
94
94
|
}
|
|
95
|
-
@keyframes k-alert-slide
|
|
95
|
+
@keyframes k-alert-slide {
|
|
96
96
|
0% {
|
|
97
97
|
transform: scaleY(1);
|
|
98
98
|
transform-origin: 0% 0%;
|
|
@@ -1,59 +1,56 @@
|
|
|
1
1
|
@import '../../styles/var.less';
|
|
2
|
+
|
|
2
3
|
.k-backtop {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
opacity: 1;
|
|
27
|
-
}
|
|
28
|
-
.k-ion {
|
|
29
|
-
font-size: 20px;
|
|
30
|
-
color: #fff;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
list-style: none;
|
|
8
|
+
z-index: 10;
|
|
9
|
+
position: fixed;
|
|
10
|
+
right: 50px;
|
|
11
|
+
bottom: 50px;
|
|
12
|
+
height: 40px;
|
|
13
|
+
width: 40px;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
display: block;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
border-radius: var(--kui-border-radius);
|
|
18
|
+
|
|
19
|
+
&-content {
|
|
20
|
+
background-color: rgba(0, 0, 0, .45);
|
|
21
|
+
opacity: .5;
|
|
22
|
+
height: 40px;
|
|
23
|
+
transition: opacity .3s ease-in-out;
|
|
24
|
+
text-align: center;
|
|
25
|
+
line-height: 40px;
|
|
26
|
+
color: #fff;
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
&:hover {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.k-ion {
|
|
33
|
+
font-size: 20px;
|
|
34
|
+
color: #fff;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
42
37
|
}
|
|
43
38
|
|
|
44
|
-
@keyframes k-backtop-fade
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
@keyframes k-backtop-fade {
|
|
40
|
+
from {
|
|
41
|
+
opacity: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
to {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
51
47
|
}
|
|
52
48
|
|
|
49
|
+
|
|
53
50
|
.k-backtop-fade-enter-active {
|
|
54
|
-
|
|
51
|
+
animation: k-backtop-fade .4s;
|
|
55
52
|
}
|
|
56
53
|
|
|
57
54
|
.k-backtop-fade-leave-active {
|
|
58
|
-
|
|
55
|
+
animation: k-backtop-fade .4s reverse;
|
|
59
56
|
}
|
package/components/base/drop.jsx
CHANGED
|
@@ -16,7 +16,8 @@ export default {
|
|
|
16
16
|
trigger: { type: String, default: "click" },
|
|
17
17
|
transitionName: { type: String, default: 'dropdown' },
|
|
18
18
|
selection: { validator: v => true },
|
|
19
|
-
updateKey: [String, Object, Array]
|
|
19
|
+
updateKey: [String, Object, Array],
|
|
20
|
+
offsetLeft: { type: Number, default: 0 }
|
|
20
21
|
},
|
|
21
22
|
|
|
22
23
|
watch: {
|
|
@@ -121,7 +122,7 @@ export default {
|
|
|
121
122
|
let { selection, transfer, placement } = this
|
|
122
123
|
getPosition(selection, this.$el, transfer, placement, (top, left, origin, placement) => {
|
|
123
124
|
this.top = top
|
|
124
|
-
this.left = left
|
|
125
|
+
this.left = left + (placement.includes('right') ? this.offsetLeft : -this.offsetLeft)
|
|
125
126
|
// this.minWidth = this.selection.offsetWidth
|
|
126
127
|
this.transformOrigin = origin
|
|
127
128
|
this.currentPlacement = placement
|
package/components/base/pop.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Button from "../button";
|
|
1
|
+
import { Button } from "../button";
|
|
2
2
|
import Icon from "../icon";
|
|
3
3
|
import { getChild } from "../_tool/utils";
|
|
4
4
|
import cloneVNode from '../_tool/clone'
|
|
@@ -18,6 +18,7 @@ export default {
|
|
|
18
18
|
title: String,
|
|
19
19
|
showPlacementArrow: { type: Boolean, default: true },
|
|
20
20
|
width: [Number, String],
|
|
21
|
+
offsetLeft: { type: Number, default: 0 },
|
|
21
22
|
placement: {
|
|
22
23
|
validator(value) {
|
|
23
24
|
return (
|
|
@@ -29,7 +30,8 @@ export default {
|
|
|
29
30
|
okText: String,
|
|
30
31
|
cancelText: String,
|
|
31
32
|
updateKey: [String, Object, Array],
|
|
32
|
-
show: Boolean
|
|
33
|
+
show: Boolean,
|
|
34
|
+
isMenu: { type: Boolean, default: false }
|
|
33
35
|
},
|
|
34
36
|
data() {
|
|
35
37
|
return {
|
|
@@ -65,6 +67,7 @@ export default {
|
|
|
65
67
|
if (this.trigger == "hover" && !this.confirm && !this.opened) {
|
|
66
68
|
this.toggle(true)
|
|
67
69
|
}
|
|
70
|
+
this.$emit('mouseenter', e)
|
|
68
71
|
},
|
|
69
72
|
mouseLeave(e) {
|
|
70
73
|
if (this.trigger == 'hover' &&
|
|
@@ -98,16 +101,16 @@ export default {
|
|
|
98
101
|
this.toggle(true)
|
|
99
102
|
}
|
|
100
103
|
}
|
|
104
|
+
this.$emit('click', e)
|
|
101
105
|
|
|
102
106
|
},
|
|
103
107
|
renderPopup() {
|
|
104
108
|
let { placement, trigger, title, preCls, $slots, transfer, color, updateKey } = this, childNode;
|
|
105
109
|
|
|
106
|
-
title = title || getChild($slots.title)
|
|
107
|
-
// console.log(title)
|
|
108
110
|
let okText = this.okText || t('k.pop.ok')
|
|
109
111
|
let cancelText = this.cancelText || t('k.pop.cancel')
|
|
110
112
|
if (this.showPlacementArrow) {
|
|
113
|
+
title = title || getChild($slots.title)
|
|
111
114
|
let titleNode, contentNode, footerNode;
|
|
112
115
|
if (this.confirm) {
|
|
113
116
|
contentNode = [<Icon type={HelpCircle} />, <div class={`k-${preCls}-title`}>{title}</div>]
|
|
@@ -121,25 +124,32 @@ export default {
|
|
|
121
124
|
contentNode = $slots.content
|
|
122
125
|
}
|
|
123
126
|
contentNode = contentNode ? <div class={`k-${preCls}-body`}>{contentNode}</div> : null;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<div class={`k-${preCls}-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
if (!titleNode && !contentNode && !footerNode) {
|
|
128
|
+
childNode = null
|
|
129
|
+
} else {
|
|
130
|
+
childNode = [
|
|
131
|
+
<div class={`k-${preCls}-content`} style={{ backgroundColor: /^#/.test(color) ? color : null }}>
|
|
132
|
+
{[titleNode, contentNode, footerNode]}
|
|
133
|
+
<div class={`k-${preCls}-arrow`}>
|
|
134
|
+
<svg style={{ fill: /^#/.test(color) ? color : 'currentcolor' }} viewBox="0 0 24 7">
|
|
135
|
+
<path d="M24 0V1C20 1 18.5 2 16.5 4C14.5 6 14 7 12 7C10 7 9.5 6 7.5 4C5.5 2 4 1 0 1V0H24Z"></path>
|
|
136
|
+
</svg>
|
|
137
|
+
</div>
|
|
138
|
+
</div>]
|
|
139
|
+
}
|
|
135
140
|
} else {
|
|
136
141
|
childNode = $slots.content
|
|
137
142
|
}
|
|
143
|
+
if (!childNode) {
|
|
144
|
+
return null
|
|
145
|
+
}
|
|
146
|
+
// console.log(childNode)
|
|
138
147
|
const props = {
|
|
139
148
|
ref: 'overlay',
|
|
140
149
|
key: this.$vnode.key,
|
|
141
150
|
props: {
|
|
142
151
|
transfer,
|
|
152
|
+
offsetLeft: this.offsetLeft,
|
|
143
153
|
value: this.opened,
|
|
144
154
|
className: [`k-${preCls}`, {
|
|
145
155
|
[`k-${preCls}-${color}`]: color && !/^#/.test(color),
|
|
@@ -158,11 +168,15 @@ export default {
|
|
|
158
168
|
mouseenter: e => {
|
|
159
169
|
if (this.$refs.overlay.$el.contains(e.target)) {
|
|
160
170
|
clearTimeout(this.timer)
|
|
171
|
+
this.$emit('mouseenter', e)
|
|
161
172
|
}
|
|
162
173
|
},
|
|
163
174
|
mouseleave: e => {
|
|
175
|
+
this.$emit('mouseleave', e)
|
|
164
176
|
if (this.trigger == 'hover') {
|
|
165
|
-
this.
|
|
177
|
+
this.timer = setTimeout(() => {
|
|
178
|
+
this.toggle(false);
|
|
179
|
+
}, 200);
|
|
166
180
|
}
|
|
167
181
|
},
|
|
168
182
|
hide: () => {
|
|
@@ -181,15 +195,15 @@ export default {
|
|
|
181
195
|
let { $slots } = this
|
|
182
196
|
let vNode = getChild($slots.default)[0]
|
|
183
197
|
let popup = this.renderPopup()
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
on
|
|
198
|
+
let props = {}
|
|
199
|
+
if (!this.isMenu) {
|
|
200
|
+
props.on = {
|
|
187
201
|
'contextmenu': e => this.contextMenu(e),
|
|
188
202
|
'mouseenter': e => this.mouseEnter(e),
|
|
189
203
|
'mouseleave': e => this.mouseLeave(e),
|
|
190
204
|
'click': e => this.onClick(e)
|
|
191
205
|
}
|
|
192
206
|
}
|
|
193
|
-
return cloneVNode(vNode, props, popup)
|
|
207
|
+
return cloneVNode(vNode, props, [popup])
|
|
194
208
|
}
|
|
195
209
|
};
|
|
@@ -74,17 +74,11 @@ export default {
|
|
|
74
74
|
const iconNode = iconType ? <Icon type={iconType} spin={loading} /> : null
|
|
75
75
|
const child = getChild($slots.default)
|
|
76
76
|
const childs = child.map(c => {
|
|
77
|
-
|
|
78
|
-
return <span>{c.text.trim()}</span>
|
|
79
|
-
}
|
|
80
|
-
return c
|
|
77
|
+
return typeof c.text == 'string' ? <span>{c.text.trim()}</span> : c
|
|
81
78
|
})
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
</button >
|
|
87
|
-
)
|
|
88
|
-
return button
|
|
79
|
+
return <button {...props} >
|
|
80
|
+
{iconNode}
|
|
81
|
+
{childs}
|
|
82
|
+
</button >
|
|
89
83
|
}
|
|
90
84
|
};
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
// import './button.less'
|
|
2
2
|
import Button from './button'
|
|
3
3
|
import ButtonGroup from './buttonGroup'
|
|
4
|
-
|
|
5
|
-
Button.Group = ButtonGroup
|
|
6
|
-
|
|
7
|
-
Button.install = function (vue) {
|
|
8
|
-
vue.component(Button.name, Button)
|
|
9
|
-
vue.component(ButtonGroup.name, ButtonGroup)
|
|
10
|
-
}
|
|
11
|
-
export default Button
|
|
4
|
+
export { Button, ButtonGroup }
|
|
@@ -65,16 +65,16 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.k-collaplse-slide-enter-active {
|
|
68
|
-
animation:
|
|
68
|
+
animation: slide 0.3s ease-in-out;
|
|
69
69
|
animation-fill-mode: both;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.k-collaplse-slide-leave-active {
|
|
73
|
-
animation:
|
|
73
|
+
animation: slide 0.3s ease-in-out reverse;
|
|
74
74
|
animation-fill-mode: both;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
@keyframes
|
|
77
|
+
@keyframes slide {
|
|
78
78
|
0% {
|
|
79
79
|
transform: scaleY(0);
|
|
80
80
|
transform-origin: 0% 0%;
|
|
@@ -86,16 +86,3 @@
|
|
|
86
86
|
opacity: 1;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
@keyframes slideOut {
|
|
91
|
-
0% {
|
|
92
|
-
transform: scaleY(1);
|
|
93
|
-
transform-origin: 0% 0%;
|
|
94
|
-
opacity: 1;
|
|
95
|
-
}
|
|
96
|
-
100% {
|
|
97
|
-
transform: scaleY(0);
|
|
98
|
-
transform-origin: 0% 0%;
|
|
99
|
-
opacity: 0;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { canvasHelper, limit, hslToRgb, rgbToHsl, parseColor, rgbToHex, cssColorToRgba } from './canvasHelper'
|
|
2
2
|
import { Input } from '../input'
|
|
3
|
-
import Button from '../button'
|
|
3
|
+
import {Button} from '../button'
|
|
4
4
|
import Icon from '../icon'
|
|
5
5
|
import Drop from '../base/drop'
|
|
6
6
|
import { ChevronDown, CaretHor } from 'kui-icons'
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
|
|
63
63
|
.k-color-picker-opened {
|
|
64
64
|
border: 1px solid var(--kui-color-main);
|
|
65
|
-
box-shadow: 0 0
|
|
65
|
+
box-shadow: 0 0 0 2px var(--kui-color-main-90);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.k-color-picker-disabled {
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
position: absolute;
|
|
136
136
|
background: var(--kui-color-back);
|
|
137
137
|
border: 1px solid var(--kui-color-border);
|
|
138
|
-
box-shadow: 0 0
|
|
138
|
+
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
|
|
139
139
|
border-radius: 50%;
|
|
140
140
|
top: 10px;
|
|
141
141
|
left: 10px;
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
position: absolute;
|
|
195
195
|
background: var(--kui-color-back);
|
|
196
196
|
border: 1px solid var(--kui-color-border);
|
|
197
|
-
box-shadow: 0 0
|
|
197
|
+
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
|
|
198
198
|
border-radius: 50%;
|
|
199
199
|
pointer-events: none;
|
|
200
200
|
}
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
@keyframes
|
|
306
|
+
@keyframes drop-down {
|
|
307
307
|
0% {
|
|
308
308
|
opacity: 0;
|
|
309
309
|
transform: scaleY(0)
|
|
@@ -315,24 +315,12 @@
|
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
@keyframes dropDownOut {
|
|
319
|
-
0% {
|
|
320
|
-
opacity: 1;
|
|
321
|
-
transform: scaleY(1)
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
to {
|
|
325
|
-
opacity: 0;
|
|
326
|
-
transform: scaleY(0)
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
318
|
.k-color-picker-enter-active {
|
|
331
319
|
transform-origin: 0 0;
|
|
332
|
-
animation:
|
|
320
|
+
animation: drop-down .3s;
|
|
333
321
|
}
|
|
334
322
|
|
|
335
323
|
.k-color-picker-leave-active {
|
|
336
324
|
transform-origin: 0 0;
|
|
337
|
-
animation:
|
|
325
|
+
animation: drop-down .3s reverse;
|
|
338
326
|
}
|
|
@@ -182,6 +182,7 @@
|
|
|
182
182
|
white-space: nowrap;
|
|
183
183
|
line-height: 0;
|
|
184
184
|
}
|
|
185
|
+
|
|
185
186
|
&.k-datepicker-with-time {
|
|
186
187
|
|
|
187
188
|
.k-datepicker-placeholder,
|
|
@@ -250,7 +251,7 @@
|
|
|
250
251
|
}
|
|
251
252
|
|
|
252
253
|
|
|
253
|
-
@keyframes
|
|
254
|
+
@keyframes drop-down {
|
|
254
255
|
0% {
|
|
255
256
|
opacity: 0;
|
|
256
257
|
transform: scaleY(0)
|
|
@@ -262,24 +263,13 @@
|
|
|
262
263
|
}
|
|
263
264
|
}
|
|
264
265
|
|
|
265
|
-
@keyframes dropDownOut {
|
|
266
|
-
0% {
|
|
267
|
-
opacity: 1;
|
|
268
|
-
transform: scaleY(1)
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
to {
|
|
272
|
-
opacity: 0;
|
|
273
|
-
transform: scaleY(0)
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
266
|
|
|
277
267
|
.k-date-picker-enter-active {
|
|
278
268
|
transform-origin: 0 0;
|
|
279
|
-
animation:
|
|
269
|
+
animation: drop-down .3s;
|
|
280
270
|
}
|
|
281
271
|
|
|
282
272
|
.k-date-picker-leave-active {
|
|
283
273
|
transform-origin: 0 0;
|
|
284
|
-
animation:
|
|
274
|
+
animation: drop-down .3s reverse
|
|
285
275
|
}
|
|
@@ -13,22 +13,22 @@
|
|
|
13
13
|
color: '#999',
|
|
14
14
|
}" class="demo-back">Right Click on here</div>
|
|
15
15
|
<Menu slot="content">
|
|
16
|
-
<MenuItem key="news">New file</MenuItem>
|
|
17
|
-
<MenuItem key="edit">Edit</MenuItem>
|
|
16
|
+
<MenuItem key="news" :icon="Document">New file</MenuItem>
|
|
17
|
+
<MenuItem key="edit" :icon="IconEdit">Edit</MenuItem>
|
|
18
18
|
<MenuItem key="save" :icon="Save">Save</MenuItem>
|
|
19
19
|
<MenuItem key="cut" :icon="Cut">Cut</MenuItem>
|
|
20
20
|
<MenuDivider />
|
|
21
|
-
<MenuItem key="exit">Exit</MenuItem>
|
|
21
|
+
<MenuItem key="exit" :icon="Exit">Exit</MenuItem>
|
|
22
22
|
</Menu>
|
|
23
23
|
</Dropdown>
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
|
-
import { Save, Cut } from 'kui-icons'
|
|
27
|
+
import { Save, Cut, Document, IconEdit, Exit } from 'kui-icons'
|
|
28
28
|
export default {
|
|
29
29
|
data() {
|
|
30
30
|
return {
|
|
31
|
-
Save, Cut
|
|
31
|
+
Save, Cut, Document, IconEdit, Exit
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
methods:{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BasePop from '../base/pop'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
name: 'Dropdown',
|
|
@@ -24,6 +24,7 @@ export default {
|
|
|
24
24
|
},
|
|
25
25
|
data() {
|
|
26
26
|
return {
|
|
27
|
+
timer: null,
|
|
27
28
|
visible: this.value || false
|
|
28
29
|
}
|
|
29
30
|
},
|
|
@@ -48,13 +49,20 @@ export default {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
return (
|
|
51
|
-
<
|
|
52
|
+
<BasePop {...props} ref="pop">
|
|
52
53
|
{this.$slots.default}
|
|
53
54
|
<template slot="content">{this.$slots.content}</template>
|
|
54
|
-
</
|
|
55
|
+
</BasePop >
|
|
55
56
|
)
|
|
56
57
|
},
|
|
57
58
|
methods: {
|
|
59
|
+
hidePopup() {
|
|
60
|
+
clearTimeout(this.timer)
|
|
61
|
+
this.timer = setTimeout(() => {
|
|
62
|
+
this.visible = false
|
|
63
|
+
this.$emit('input', false)
|
|
64
|
+
}, 200);
|
|
65
|
+
},
|
|
58
66
|
handleClick(options) {
|
|
59
67
|
this.$emit('click', options)
|
|
60
68
|
this.visible = false
|