kui-vue 3.2.8-rc3 → 3.2.9-rc1
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/drawer/demo/base.md +8 -1
- package/components/drawer/demo/custom.md +1 -1
- package/components/drawer/drawer.jsx +21 -8
- package/components/drawer/index.md +5 -5
- package/components/drawer/styles/animal.less +1 -0
- package/components/drawer/styles/index.less +1 -0
- package/components/page/page.jsx +9 -2
- package/components/radio/demo/options.md +6 -1
- package/components/rate/rate.jsx +8 -3
- package/components/select/demo/base.md +1 -1
- package/components/select/select.jsx +3 -3
- package/dist/k-ui.css +1 -1
- package/dist/k-ui.js +2 -2
- package/dist/locale/de.js +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/ua.js +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/zhCN.js +1 -1
- package/dist/locale/zhTW.js +1 -1
- package/package.json +1 -1
|
@@ -8,18 +8,25 @@
|
|
|
8
8
|
<template>
|
|
9
9
|
<div>
|
|
10
10
|
<Button @click="show=!show">普通抽屉</Button>
|
|
11
|
+
<Button @click="show2=!show2">Width 30%</Button>
|
|
11
12
|
<Drawer v-model="show" :closable="false" :footer="null" :title="null">
|
|
12
13
|
<p>something ...</p>
|
|
13
14
|
<p>something ...</p>
|
|
14
15
|
<p>something ...</p>
|
|
15
16
|
</Drawer>
|
|
17
|
+
<Drawer v-model="show2" width="30%" title="Width 30%">
|
|
18
|
+
<p>something ...</p>
|
|
19
|
+
<p>something ...</p>
|
|
20
|
+
<p>something ...</p>
|
|
21
|
+
</Drawer>
|
|
16
22
|
</div>
|
|
17
23
|
</template>
|
|
18
24
|
<script>
|
|
19
25
|
export default{
|
|
20
26
|
data(){
|
|
21
27
|
return{
|
|
22
|
-
show:false
|
|
28
|
+
show:false,
|
|
29
|
+
show2:false
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
32
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<Radio label="bottom" value="bottom"/>
|
|
14
14
|
</RadioGroup>
|
|
15
15
|
<Button @click="show=true" >Open</Button>
|
|
16
|
-
<Drawer v-model="show"
|
|
16
|
+
<Drawer v-model="show" height="300" :placement="placement" title="What's your name? " cancelText="Cancel" okText="Ok">My name is chuchur.</Drawer>
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
<script>
|
|
@@ -28,6 +28,7 @@ export default {
|
|
|
28
28
|
this.rendered = true
|
|
29
29
|
this.$nextTick(e => {
|
|
30
30
|
this.visible = v
|
|
31
|
+
this.openHandle()
|
|
31
32
|
this.resetBodyStyle(v)
|
|
32
33
|
})
|
|
33
34
|
},
|
|
@@ -35,7 +36,8 @@ export default {
|
|
|
35
36
|
data() {
|
|
36
37
|
return {
|
|
37
38
|
visible: this.value,
|
|
38
|
-
rendered: this.value
|
|
39
|
+
rendered: this.value,
|
|
40
|
+
open: this.value
|
|
39
41
|
};
|
|
40
42
|
},
|
|
41
43
|
beforeDestroy() {
|
|
@@ -54,11 +56,21 @@ export default {
|
|
|
54
56
|
this.$emit("cancel");
|
|
55
57
|
this.close();
|
|
56
58
|
},
|
|
59
|
+
openHandle() {
|
|
60
|
+
if (this.visible) {
|
|
61
|
+
this.open = true
|
|
62
|
+
} else {
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
this.open = false
|
|
65
|
+
}, 300);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
57
68
|
close() {
|
|
58
69
|
this.visible = false;
|
|
59
70
|
this.$emit("input", false);
|
|
60
71
|
this.$emit("cancel");
|
|
61
72
|
this.$emit("close");
|
|
73
|
+
this.openHandle()
|
|
62
74
|
},
|
|
63
75
|
maskToClose() {
|
|
64
76
|
if (this.maskClosable) {
|
|
@@ -67,7 +79,7 @@ export default {
|
|
|
67
79
|
},
|
|
68
80
|
resetBodyStyle(opened) {
|
|
69
81
|
let target = this.target();
|
|
70
|
-
if (
|
|
82
|
+
if (opened && !cacheBodyOverflow.hasOwnProperty('overflow')) {
|
|
71
83
|
cacheBodyOverflow = {
|
|
72
84
|
width: target.style.width,
|
|
73
85
|
overflow: target.style.overflow,
|
|
@@ -77,7 +89,8 @@ export default {
|
|
|
77
89
|
}
|
|
78
90
|
if (opened) {
|
|
79
91
|
let barWidth = measureScrollBar(true)
|
|
80
|
-
let
|
|
92
|
+
let el = target == document.body ? document.documentElement : target
|
|
93
|
+
let hasBar = el.scrollHeight > el.clientHeight || el.offsetHeight > el.clientHeight
|
|
81
94
|
if (barWidth && hasBar) {
|
|
82
95
|
target.style.width = `calc(100% - ${barWidth}px)`
|
|
83
96
|
target.style.overflow = `hidden`
|
|
@@ -95,7 +108,7 @@ export default {
|
|
|
95
108
|
render() {
|
|
96
109
|
if (this.$isServer) return null;
|
|
97
110
|
const { title, visible, cancelText, okText, ok,
|
|
98
|
-
placement, cancel, $slots,
|
|
111
|
+
placement, cancel, $slots, width, height, open,
|
|
99
112
|
closable, close, } = this
|
|
100
113
|
const hasFooter = this.footer || $slots.footer
|
|
101
114
|
const canelBtn = <Button onClick={cancel}>{cancelText || t('k.drawer.cancel')}</Button>
|
|
@@ -113,14 +126,14 @@ export default {
|
|
|
113
126
|
const target = this.target()
|
|
114
127
|
const inbody = target == document.body
|
|
115
128
|
const classes = ['k-drawer', `k-drawer-${placement}`,
|
|
116
|
-
{ 'k-drawer-open':
|
|
129
|
+
{ 'k-drawer-open': open },
|
|
117
130
|
{ 'k-drawer-has-footer': hasFooter },
|
|
118
131
|
{ 'k-drawer-nobody': !inbody },
|
|
119
132
|
{ 'k-drawer-nomask': !this.mask },
|
|
120
133
|
]
|
|
121
134
|
let styles = {}
|
|
122
|
-
if (placement == 'left' || placement == 'right') styles.width =
|
|
123
|
-
if (placement == 'top' || placement == 'bottom') styles.height =
|
|
135
|
+
if (placement == 'left' || placement == 'right') styles.width = /%/.test(width) ? width : width + 'px'
|
|
136
|
+
if (placement == 'top' || placement == 'bottom') styles.height = /%/.test(height) ? height : height + 'px'
|
|
124
137
|
// const wrapCls =
|
|
125
138
|
let maskNode = null
|
|
126
139
|
if (this.mask) {
|
|
@@ -131,7 +144,7 @@ export default {
|
|
|
131
144
|
return (
|
|
132
145
|
this.rendered ? <div class={classes} v-transfer={target}>
|
|
133
146
|
{maskNode}
|
|
134
|
-
<transition name={transitionName} time={
|
|
147
|
+
<transition name={transitionName} time={3500000}>
|
|
135
148
|
<div class="k-drawer-box" v-show={visible} style={styles}>
|
|
136
149
|
<div class="k-drawer-content">
|
|
137
150
|
{closeNode}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#### API
|
|
2
2
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
-
|
|
4
|
-
| title | 抽屉标题,为null或false时不显示标题
|
|
5
|
-
| width | 抽屉宽度 `placement`为 `left` 或 `right`
|
|
6
|
-
| height | 抽屉高度 `placement`为 `top` 或 `bottom`
|
|
3
|
+
| ------------ | ------------------------------------------------------------------ | ------------- | ------ |
|
|
4
|
+
| title | 抽屉标题,为null或false时不显示标题 | String | - |
|
|
5
|
+
| width | 抽屉宽度 `placement`为 `left` 或 `right` 时使用,支持百分比 | Number,String | 520 |
|
|
6
|
+
| height | 抽屉高度 `placement`为 `top` 或 `bottom` 时使用,支持百分比 | Number,String | 256 |
|
|
7
7
|
| placement | 抽屉显示方向,提供 `left` , `top` , `right` , `bottom` 4种展示方式 | String | right |
|
|
8
8
|
| footer | 页脚内容,不显示页脚设置`footer=null`即可 | slot | true |
|
|
9
9
|
| closable | 是否显示关闭按钮 | Boolean | true |
|
|
10
|
-
| target | 展示的父元素 | Function | -
|
|
10
|
+
| target | 展示的父元素 | Function | - |
|
|
11
11
|
| mas-closable | 点击蒙层是否允许关闭 | Boolean | true |
|
|
12
12
|
| okText | 确定按钮文字 | String | 确定 |
|
|
13
13
|
| cancelText | 取消按钮文字 | String | 取消 |
|
package/components/page/page.jsx
CHANGED
|
@@ -30,18 +30,25 @@ export default {
|
|
|
30
30
|
watch: {
|
|
31
31
|
pageSize(v) {
|
|
32
32
|
this.defaultPageSize = v
|
|
33
|
+
this.resetPage()
|
|
33
34
|
},
|
|
34
35
|
current(v) {
|
|
35
|
-
this.
|
|
36
|
+
this.resetPage()
|
|
36
37
|
},
|
|
37
38
|
total(v) {
|
|
38
|
-
this.
|
|
39
|
+
this.resetPage()
|
|
39
40
|
}
|
|
40
41
|
},
|
|
41
42
|
mounted() {
|
|
42
43
|
this.pageCount = Math.ceil(this.total / this.defaultPageSize) || 1;
|
|
43
44
|
},
|
|
44
45
|
methods: {
|
|
46
|
+
resetPage() {
|
|
47
|
+
this.pageCount = Math.ceil(this.total / this.defaultPageSize) || 1;
|
|
48
|
+
if (this.page > this.pageCount) {
|
|
49
|
+
this.page = this.pageCount
|
|
50
|
+
}
|
|
51
|
+
},
|
|
45
52
|
renderPage() {
|
|
46
53
|
const groupCount = 7,
|
|
47
54
|
page = Number(this.page),
|
package/components/rate/rate.jsx
CHANGED
|
@@ -19,7 +19,12 @@ export default {
|
|
|
19
19
|
tempValue: this.value,
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
|
|
22
|
+
watch: {
|
|
23
|
+
value(v) {
|
|
24
|
+
this.defaultValue = v
|
|
25
|
+
this.tempValue = v
|
|
26
|
+
}
|
|
27
|
+
},
|
|
23
28
|
render() {
|
|
24
29
|
let { count, tempValue, allowHalf, character, disabled, tooltips = [], icon, showScore } = this
|
|
25
30
|
const stars = []
|
|
@@ -32,12 +37,12 @@ export default {
|
|
|
32
37
|
let v = parseInt(tempValue * 100 - i * 100)
|
|
33
38
|
let percent = tempValue > i && tempValue < i + 1 ? v : 0
|
|
34
39
|
// let show_percent = percent != 50 && disabled && percent > 0
|
|
35
|
-
let half = (tempValue > i && tempValue < i + 1 && allowHalf) || (percent == 50
|
|
40
|
+
let half = (tempValue > i && tempValue < i + 1 && allowHalf) || (percent == 50)
|
|
36
41
|
// console.log(i, percent, show_percent, half)
|
|
37
42
|
let props = {
|
|
38
43
|
props: {
|
|
39
44
|
allowHalf,
|
|
40
|
-
full: tempValue > i && !half
|
|
45
|
+
full: tempValue > i && !half,
|
|
41
46
|
half,
|
|
42
47
|
icon, character,
|
|
43
48
|
disabled,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<Button @click="select=''" size="small">Clear</Button>
|
|
13
13
|
<Button @click="select=1" size="small">Choose orange</Button>
|
|
14
14
|
<br />
|
|
15
|
-
<Select :width="200">
|
|
15
|
+
<Select :width="200" placeholder="Please Choose">
|
|
16
16
|
<Option :value="1" label="Apple" />
|
|
17
17
|
<Option :value="2" label="Orange" />
|
|
18
18
|
<Option :value="3" label="Banana" disabled/>
|
|
@@ -78,7 +78,7 @@ export default {
|
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
})
|
|
81
|
-
return Label;
|
|
81
|
+
return Label || labelValue;
|
|
82
82
|
},
|
|
83
83
|
setLabel() {
|
|
84
84
|
let { currentValue, multiple, label } = this
|
|
@@ -328,10 +328,10 @@ export default {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
let overlay = <Drop {...props}>{this.loading ? loadingNode : (!childs.length ? <Empty onClick={this.emptyClick} description={this.emptyText}/> : <ul>{childs}</ul>)}</Drop>
|
|
331
|
+
let overlay = <Drop {...props}>{this.loading ? loadingNode : (!childs.length ? <Empty onClick={this.emptyClick} description={this.emptyText} /> : <ul>{childs}</ul>)}</Drop>
|
|
332
332
|
|
|
333
333
|
label = multiple ? (label || []) : label
|
|
334
|
-
placeholder = t('k.select.placeholder')
|
|
334
|
+
placeholder = placeholder || t('k.select.placeholder')
|
|
335
335
|
const placeNode = ((placeholder && ((!label || !label.length) && !queryKey))
|
|
336
336
|
? <div class="k-select-placeholder">{placeholder}</div>
|
|
337
337
|
: null
|
package/dist/k-ui.css
CHANGED