kui-vue 3.2.8 → 3.2.9
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 +23 -9
- 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/locale/lang/de.js +1 -1
- package/components/locale/lang/el.js +1 -1
- package/components/locale/lang/en.js +1 -1
- package/components/locale/lang/fr.js +1 -1
- package/components/locale/lang/it.js +1 -1
- package/components/locale/lang/ja.js +1 -1
- package/components/locale/lang/ko.js +1 -1
- package/components/locale/lang/ru.js +1 -1
- package/components/locale/lang/th.js +2 -2
- package/components/locale/lang/ua.js +1 -1
- package/components/locale/lang/vi.js +1 -1
- package/components/locale/lang/zh-CN.js +1 -1
- package/components/locale/lang/zh-TW.js +1 -1
- package/components/page/page.jsx +14 -1
- package/components/radio/demo/options.md +6 -1
- package/components/select/demo/base.md +1 -1
- package/components/select/select.jsx +2 -2
- package/components/spin/demo/mode.md +2 -2
- package/dist/k-ui.css +1 -1
- package/dist/k-ui.js +2 -2
- package/dist/locale/de.js +2 -2
- package/dist/locale/el.js +2 -2
- package/dist/locale/en.js +2 -2
- package/dist/locale/fr.js +2 -2
- package/dist/locale/it.js +2 -2
- package/dist/locale/ja.js +2 -2
- package/dist/locale/ko.js +2 -2
- package/dist/locale/ru.js +2 -2
- package/dist/locale/th.js +2 -2
- package/dist/locale/ua.js +2 -2
- package/dist/locale/vi.js +2 -2
- package/dist/locale/zhCN.js +2 -2
- package/dist/locale/zhTW.js +2 -2
- 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`
|
|
@@ -93,8 +106,9 @@ export default {
|
|
|
93
106
|
},
|
|
94
107
|
},
|
|
95
108
|
render() {
|
|
109
|
+
if (this.$isServer) return null;
|
|
96
110
|
const { title, visible, cancelText, okText, ok,
|
|
97
|
-
placement, cancel, $slots,
|
|
111
|
+
placement, cancel, $slots, width, height, open,
|
|
98
112
|
closable, close, } = this
|
|
99
113
|
const hasFooter = this.footer || $slots.footer
|
|
100
114
|
const canelBtn = <Button onClick={cancel}>{cancelText || t('k.drawer.cancel')}</Button>
|
|
@@ -112,14 +126,14 @@ export default {
|
|
|
112
126
|
const target = this.target()
|
|
113
127
|
const inbody = target == document.body
|
|
114
128
|
const classes = ['k-drawer', `k-drawer-${placement}`,
|
|
115
|
-
{ 'k-drawer-open':
|
|
129
|
+
{ 'k-drawer-open': open },
|
|
116
130
|
{ 'k-drawer-has-footer': hasFooter },
|
|
117
131
|
{ 'k-drawer-nobody': !inbody },
|
|
118
132
|
{ 'k-drawer-nomask': !this.mask },
|
|
119
133
|
]
|
|
120
134
|
let styles = {}
|
|
121
|
-
if (placement == 'left' || placement == 'right') styles.width =
|
|
122
|
-
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'
|
|
123
137
|
// const wrapCls =
|
|
124
138
|
let maskNode = null
|
|
125
139
|
if (this.mask) {
|
|
@@ -130,11 +144,11 @@ export default {
|
|
|
130
144
|
return (
|
|
131
145
|
this.rendered ? <div class={classes} v-transfer={target}>
|
|
132
146
|
{maskNode}
|
|
133
|
-
<transition name={transitionName} time={
|
|
147
|
+
<transition name={transitionName} time={3500000}>
|
|
134
148
|
<div class="k-drawer-box" v-show={visible} style={styles}>
|
|
135
149
|
<div class="k-drawer-content">
|
|
136
150
|
{closeNode}
|
|
137
|
-
{title!==null&&title!==false
|
|
151
|
+
{title !== null && title !== false && <div class="k-drawer-header"><div class="k-drawer-header-inner">{title}</div></div>}
|
|
138
152
|
<div class="k-drawer-body">
|
|
139
153
|
{$slots.default}
|
|
140
154
|
</div>
|
|
@@ -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 | 取消 |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
module.exports = {
|
|
2
2
|
k: {
|
|
3
3
|
datePicker: {
|
|
4
4
|
startDate: 'วันที่เริ่มต้น',
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
ok: 'ตกลง',
|
|
32
32
|
selectDate: 'เลือกวันที่',
|
|
33
33
|
selectTime: 'เลือกเวลา',
|
|
34
|
-
back:'เบื้องหลัง'
|
|
34
|
+
back: 'เบื้องหลัง'
|
|
35
35
|
},
|
|
36
36
|
drawer: {
|
|
37
37
|
ok: 'ตกลง',
|
package/components/page/page.jsx
CHANGED
|
@@ -28,14 +28,27 @@ export default {
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
watch: {
|
|
31
|
+
pageSize(v) {
|
|
32
|
+
this.defaultPageSize = v
|
|
33
|
+
this.resetPage()
|
|
34
|
+
},
|
|
35
|
+
current(v) {
|
|
36
|
+
this.resetPage()
|
|
37
|
+
},
|
|
31
38
|
total(v) {
|
|
32
|
-
this.
|
|
39
|
+
this.resetPage()
|
|
33
40
|
}
|
|
34
41
|
},
|
|
35
42
|
mounted() {
|
|
36
43
|
this.pageCount = Math.ceil(this.total / this.defaultPageSize) || 1;
|
|
37
44
|
},
|
|
38
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
|
+
},
|
|
39
52
|
renderPage() {
|
|
40
53
|
const groupCount = 7,
|
|
41
54
|
page = Number(this.page),
|
|
@@ -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/>
|
|
@@ -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