kui-vue 3.4.0 → 3.4.2
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/base/input.jsx +6 -5
- package/components/button/demo/group.md +22 -17
- package/components/button/styles/index.less +1 -0
- package/components/checkbox/demo/base.md +3 -5
- package/components/checkbox/demo/group-vertical.md +10 -10
- package/components/checkbox/demo/group.md +9 -7
- package/components/checkbox/demo/options.md +2 -2
- package/components/checkbox/styles/index.less +7 -3
- package/components/colorPicker/styles/index.less +8 -0
- package/components/datePicker/datepicker.jsx +78 -62
- package/components/datePicker/demo/theme.md +1 -1
- package/components/datePicker/index.md +0 -1
- package/components/datePicker/styles/datepicker.less +1 -0
- package/components/descriptions/styles/index.less +41 -6
- package/components/drawer/demo/custom.md +2 -2
- package/components/drawer/demo/form.md +4 -2
- package/components/drawer/demo/target.md +1 -1
- package/components/drawer/styles/index.less +10 -3
- package/components/dropdown/index.md +0 -1
- package/components/form/demo/base.md +1 -1
- package/components/form/demo/info.md +23 -1
- package/components/image/demo/errors.md +2 -2
- package/components/image/demo/globle.md +2 -2
- package/components/image/demo/index.vue +1 -0
- package/components/image/image.jsx +3 -1
- package/components/image/preview.jsx +12 -2
- package/components/image/styles/index.less +25 -0
- package/components/input/demo/theme.md +1 -1
- package/components/input/styles/index.less +30 -18
- package/components/inputNumber/demo/format.md +1 -1
- package/components/inputNumber/inputNumber.jsx +2 -1
- package/components/inputNumber/styles/index.less +4 -3
- package/components/locale/lang/de.js +3 -0
- package/components/locale/lang/el.js +3 -0
- package/components/locale/lang/en.js +3 -0
- package/components/locale/lang/fr.js +3 -0
- package/components/locale/lang/it.js +3 -0
- package/components/locale/lang/ja.js +3 -0
- package/components/locale/lang/ko.js +3 -0
- package/components/locale/lang/ru.js +3 -0
- package/components/locale/lang/th.js +3 -0
- package/components/locale/lang/ua.js +3 -0
- package/components/locale/lang/vi.js +3 -0
- package/components/locale/lang/zh-CN.js +3 -0
- package/components/locale/lang/zh-TW.js +3 -0
- package/components/menu/demo/inline.md +4 -4
- package/components/menu/styles/index.less +9 -2
- package/components/modal/styles/index.less +3 -0
- package/components/page/demo/base.md +10 -1
- package/components/page/demo/elevator.md +10 -1
- package/components/page/demo/more.md +10 -1
- package/components/page/demo/size.md +13 -4
- package/components/page/demo/sizer.md +4 -3
- package/components/page/page.jsx +13 -0
- package/components/popconfirm/index.md +0 -1
- package/components/popconfirm/styles/index.less +4 -2
- package/components/poptip/index.md +1 -2
- package/components/poptip/styles/index.less +10 -5
- package/components/radio/demo/base.md +3 -5
- package/components/radio/demo/disabled.md +2 -4
- package/components/radio/demo/group-vertical.md +8 -11
- package/components/radio/demo/group.md +10 -9
- package/components/radio/demo/options.md +2 -2
- package/components/radio/styles/index.less +23 -4
- package/components/select/demo/clearable.md +30 -22
- package/components/select/demo/icon.md +6 -4
- package/components/select/demo/theme.md +4 -4
- package/components/select/index.md +0 -1
- package/components/select/select.jsx +1 -1
- package/components/select/styles/index.less +15 -90
- package/components/styles/color.less +17 -12
- package/components/styles/var.less +7 -0
- package/components/switch/demo/base.md +4 -4
- package/components/switch/demo/disabled.md +7 -9
- package/components/switch/demo/index.vue +1 -6
- package/components/switch/demo/text.md +2 -8
- package/components/table/demo/base-render.md +3 -3
- package/components/table/demo/base.md +3 -1
- package/components/table/demo/custom-header.md +5 -1
- package/components/table/demo/edit.md +34 -12
- package/components/table/demo/expand.md +3 -1
- package/components/table/demo/selection.md +9 -5
- package/components/table/demo/size.md +3 -1
- package/components/table/styles/index.less +100 -51
- package/components/table/table.jsx +1 -1
- package/components/tooltip/index.md +1 -4
- package/components/tooltip/styles/index.less +4 -2
- package/components/tree/styles/index.less +2 -1
- package/components/upload/demo/accept.md +2 -2
- package/components/upload/demo/custom.md +3 -3
- package/components/upload/demo/transform.md +3 -1
- package/components/upload/upload.jsx +12 -1
- package/dist/k-ui.css +2 -2
- 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
|
@@ -40,6 +40,7 @@ export default {
|
|
|
40
40
|
inject: {
|
|
41
41
|
Input: { default: null },
|
|
42
42
|
TextArea: { default: null },
|
|
43
|
+
InputNumber: { default: null },
|
|
43
44
|
},
|
|
44
45
|
watch: {
|
|
45
46
|
value(value) {
|
|
@@ -47,7 +48,7 @@ export default {
|
|
|
47
48
|
}
|
|
48
49
|
},
|
|
49
50
|
mounted() {
|
|
50
|
-
let textInput = (this.Input || this.TextArea) || {}
|
|
51
|
+
let textInput = (this.Input || this.TextArea || this.InputNumber) || {}
|
|
51
52
|
textInput.focus = (e) => {
|
|
52
53
|
this.$nextTick(() => this.$refs.input.focus(e))
|
|
53
54
|
}
|
|
@@ -65,14 +66,14 @@ export default {
|
|
|
65
66
|
},
|
|
66
67
|
handleFocus(e) {
|
|
67
68
|
this.isFocus = true
|
|
68
|
-
let intput = this.Input || this.TextArea
|
|
69
|
+
let intput = this.Input || this.TextArea || this.InputNumber
|
|
69
70
|
intput && intput.$emit('focus', e)
|
|
70
71
|
},
|
|
71
72
|
handleBlur(e) {
|
|
72
|
-
let intput = this.Input || this.TextArea
|
|
73
|
+
let intput = this.Input || this.TextArea || this.InputNumber
|
|
73
74
|
// console.log('base blur')
|
|
74
|
-
|
|
75
|
-
intput && intput.$emit('blur', e)
|
|
75
|
+
this.$emit('blur', e);
|
|
76
|
+
// intput && intput.$emit('blur', e)
|
|
76
77
|
this.isFocus = false
|
|
77
78
|
},
|
|
78
79
|
handleInput(e) {
|
|
@@ -5,31 +5,36 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
9
|
-
<ButtonGroup
|
|
8
|
+
<Space>
|
|
9
|
+
<ButtonGroup>
|
|
10
10
|
<Button>待发货</Button>
|
|
11
|
-
<
|
|
12
|
-
|
|
11
|
+
<Dropdown placement="bottom-right">
|
|
12
|
+
<Button :icon="ChevronDown"></Button>
|
|
13
|
+
<Menu slot="content">
|
|
14
|
+
<MenuItem>
|
|
15
|
+
<a href="javascript:;">1st menu item</a>
|
|
16
|
+
</MenuItem>
|
|
17
|
+
<MenuItem>
|
|
18
|
+
<a href="javascript:;">2nd menu item</a>
|
|
19
|
+
</MenuItem>
|
|
20
|
+
<MenuItem>
|
|
21
|
+
<a href="javascript:;">3rd menu item</a>
|
|
22
|
+
</MenuItem>
|
|
23
|
+
</Menu>
|
|
24
|
+
</Dropdown>
|
|
13
25
|
</ButtonGroup>
|
|
14
|
-
<ButtonGroup
|
|
15
|
-
<Button
|
|
16
|
-
<Button
|
|
17
|
-
<Button>已签收</Button>
|
|
18
|
-
</ButtonGroup>
|
|
19
|
-
<br />
|
|
20
|
-
<br />
|
|
21
|
-
<ButtonGroup size="small" shape="circle">
|
|
22
|
-
<Button ><Icon :type="ChevronBack"/> Backward</Button>
|
|
23
|
-
<Button>Forward <Icon :type="ChevronForward"/></Button>
|
|
26
|
+
<ButtonGroup>
|
|
27
|
+
<Button>通讯录</Button>
|
|
28
|
+
<Button :icon="PersonOutline"></Button>
|
|
24
29
|
</ButtonGroup>
|
|
25
|
-
</
|
|
30
|
+
</Space>
|
|
26
31
|
</template>
|
|
27
32
|
<script>
|
|
28
|
-
import {
|
|
33
|
+
import { ChevronDown ,PersonOutline } from 'kui-icons'
|
|
29
34
|
export default{
|
|
30
35
|
data() {
|
|
31
36
|
return {
|
|
32
|
-
|
|
37
|
+
PersonOutline ,ChevronDown
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
40
|
}
|
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
9
|
-
|
|
8
|
+
<Space>
|
|
9
|
+
{{checked}}
|
|
10
10
|
<Checkbox v-model="checked">Checkbox</Checkbox>
|
|
11
11
|
<Button @click="checked=!checked" size="small">{{checked?'Uncheck':'Check'}}</Button>
|
|
12
|
-
<br/>
|
|
13
|
-
<br/>
|
|
14
12
|
<Checkbox label="Checkbox"/>
|
|
15
|
-
</
|
|
13
|
+
</Space>
|
|
16
14
|
</template>
|
|
17
15
|
<script>
|
|
18
16
|
export default{
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<br/>
|
|
8
|
+
<Space vertical align="start">
|
|
9
|
+
<Space>
|
|
10
|
+
<Button @click="data=[]" size="small">Clear</Button>
|
|
11
|
+
<Button @click="data=['apple']" size="small">Select apple</Button>
|
|
12
|
+
{{data}}
|
|
13
|
+
</Space>
|
|
15
14
|
<CheckboxGroup v-model="data" direction="vertical">
|
|
16
15
|
<Checkbox label="Apple" value="apple" />
|
|
17
16
|
<Checkbox label="Orange" value="orange" />
|
|
@@ -19,11 +18,12 @@
|
|
|
19
18
|
<Checkbox label="Grape" value="grape" disabled/>
|
|
20
19
|
<Checkbox label="Pear" value="pear" disabled/>
|
|
21
20
|
</CheckboxGroup>
|
|
22
|
-
|
|
21
|
+
</Space>
|
|
22
|
+
<br/>
|
|
23
|
+
<Space vertical align="start">
|
|
23
24
|
<p>{{cities}}</p>
|
|
24
|
-
<br/>
|
|
25
25
|
<CheckboxGroup :options="options" v-model="cities" direction="vertical"/>
|
|
26
|
-
</
|
|
26
|
+
</Space>
|
|
27
27
|
</template>
|
|
28
28
|
<script>
|
|
29
29
|
export default {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<cn>
|
|
2
2
|
#### 组合使用
|
|
3
3
|
组合使用可以直接使用 `CheckboxGroup` 的 `options` 来赋值,或者结合 `Checkbox` 来组合使用,通过 `disabled` 可以设置组件是否被禁用
|
|
4
|
-
|
|
4
|
+
> `CheckboxGroup` 可以直接使用 `options` 来组合,3.0版本增加
|
|
5
5
|
</cn>
|
|
6
6
|
|
|
7
7
|
```vue
|
|
8
8
|
<template>
|
|
9
|
-
<
|
|
10
|
-
|
|
9
|
+
<Space>
|
|
10
|
+
{{data}}
|
|
11
11
|
<CheckboxGroup v-model="data">
|
|
12
12
|
<Checkbox label="Apple" value="apple" />
|
|
13
13
|
<Checkbox label="Orange" value="orange" />
|
|
@@ -17,11 +17,13 @@
|
|
|
17
17
|
</CheckboxGroup>
|
|
18
18
|
<Button @click="data=[]" size="small">Clear</Button>
|
|
19
19
|
<Button @click="data=['apple']" size="small">Select apple</Button>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
</Space>
|
|
21
|
+
<br/>
|
|
22
|
+
<br/>
|
|
23
|
+
<Space vertical align="start">
|
|
24
|
+
{{cities}}
|
|
23
25
|
<CheckboxGroup :options="options" v-model="cities"/>
|
|
24
|
-
</
|
|
26
|
+
</Space>
|
|
25
27
|
</template>
|
|
26
28
|
<script>
|
|
27
29
|
export default {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.k-checkbox-inner {
|
|
26
|
-
box-sizing:
|
|
26
|
+
box-sizing: border-box;
|
|
27
27
|
display: inline-block;
|
|
28
|
-
width:
|
|
29
|
-
height:
|
|
28
|
+
width: 16px;
|
|
29
|
+
height: 16px;
|
|
30
30
|
position: relative;
|
|
31
31
|
top: 0;
|
|
32
32
|
left: 0;
|
|
@@ -109,6 +109,10 @@
|
|
|
109
109
|
.k-checkbox-label {
|
|
110
110
|
font-size: 16px;
|
|
111
111
|
}
|
|
112
|
+
.k-checkbox-inner{
|
|
113
|
+
width: 18px;
|
|
114
|
+
height: 18px;
|
|
115
|
+
}
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
.k-checkbox-light {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
align-items: center;
|
|
12
12
|
padding: 0 2px;
|
|
13
|
+
|
|
13
14
|
&:hover,
|
|
14
15
|
&:focus {
|
|
15
16
|
border-color: var(--kui-color-main-hover);
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
.k-color-picker-selection {
|
|
24
|
+
line-height: 1.571;
|
|
23
25
|
display: flex;
|
|
24
26
|
align-items: center;
|
|
25
27
|
// padding: 2px;
|
|
@@ -266,6 +268,8 @@
|
|
|
266
268
|
margin-top: 13px;
|
|
267
269
|
min-height: 62px;
|
|
268
270
|
border-top: 1px solid var(--kui-color-border);
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-wrap: wrap;
|
|
269
273
|
|
|
270
274
|
>span {
|
|
271
275
|
display: inline-block;
|
|
@@ -274,6 +278,10 @@
|
|
|
274
278
|
border-radius: 2px;
|
|
275
279
|
margin: 0 6px 6px 0;
|
|
276
280
|
cursor: pointer;
|
|
281
|
+
|
|
282
|
+
&:hover {
|
|
283
|
+
transform: scale(1.3);
|
|
284
|
+
}
|
|
277
285
|
}
|
|
278
286
|
|
|
279
287
|
.k-btn {
|
|
@@ -5,10 +5,15 @@ import dayjs from 'dayjs'
|
|
|
5
5
|
import Drop from '../base/drop'
|
|
6
6
|
import { t } from '../locale'
|
|
7
7
|
import { CloseCircle, CalendarOutline, TimeOutline } from 'kui-icons'
|
|
8
|
+
const duration = require('dayjs/plugin/duration');
|
|
9
|
+
const isBetween = require('dayjs/plugin/isBetween');
|
|
10
|
+
|
|
11
|
+
dayjs.extend(duration);
|
|
12
|
+
dayjs.extend(isBetween);
|
|
8
13
|
export default {
|
|
9
14
|
name: 'DatePicker',
|
|
10
15
|
props: {
|
|
11
|
-
value: [String, Date, Number, Array],
|
|
16
|
+
value: [String, Date, Number, Array, Object],
|
|
12
17
|
mode: {
|
|
13
18
|
type: String, default: 'date', validator(value) {
|
|
14
19
|
return ["year", "month", "date", 'time', 'dateTime', "dateRange", 'dateTimeRange'].indexOf(value) >= 0;
|
|
@@ -99,14 +104,33 @@ export default {
|
|
|
99
104
|
let { currentValue, isRange } = this
|
|
100
105
|
if (isRange) {
|
|
101
106
|
let [a, b] = currentValue || []
|
|
107
|
+
// if (!this.v1 && a) {
|
|
108
|
+
// this.v1 = dayjs(a)
|
|
109
|
+
// }
|
|
110
|
+
// if (!this.v2 && b) {
|
|
111
|
+
// this.v2 = dayjs(b)
|
|
112
|
+
// }
|
|
102
113
|
this.d1 = a ? dayjs(a) : dayjs()
|
|
103
114
|
this.d2 = b ? dayjs(b) : dayjs().add(1, 'month')
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
|
|
116
|
+
const oneMonth = dayjs.duration(1, 'month').asDays();
|
|
117
|
+
const diff = this.d2.diff(this.d1, 'day');
|
|
118
|
+
if (diff < oneMonth) {
|
|
119
|
+
this.d2 = dayjs(this.d1).add(1, 'month')
|
|
120
|
+
}
|
|
121
|
+
if (!this.v1 && a) {
|
|
122
|
+
this.v1 = dayjs(a)
|
|
123
|
+
}
|
|
124
|
+
if (!this.v2 && b) {
|
|
125
|
+
this.v2 = dayjs(b)
|
|
106
126
|
}
|
|
127
|
+
|
|
107
128
|
// this.currentValue = [dayjs(this.d1), dayjs(this.d2)]
|
|
108
129
|
} else {
|
|
109
130
|
this.d1 = currentValue ? dayjs(currentValue) : dayjs()
|
|
131
|
+
if (!this.v1 && currentValue) {
|
|
132
|
+
this.v1 = dayjs(currentValue)
|
|
133
|
+
}
|
|
110
134
|
}
|
|
111
135
|
},
|
|
112
136
|
clear(e) {
|
|
@@ -140,94 +164,86 @@ export default {
|
|
|
140
164
|
}
|
|
141
165
|
},
|
|
142
166
|
picker1Update(value, type) {
|
|
143
|
-
let {
|
|
144
|
-
if (
|
|
145
|
-
if (!type) { //
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this.d1 = this.d1[type](value)
|
|
150
|
-
this.v1 = (this.v1 || dayjs())[type](value)
|
|
151
|
-
|
|
152
|
-
if (type == 'second' && mode == 'time') {
|
|
153
|
-
this.opened = false
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
let ft = format || fmt[mode]
|
|
157
|
-
let dateStr = this.v1.format(ft)
|
|
158
|
-
this.currentValue = dayjs(this.v1)
|
|
159
|
-
this.$emit('input', dateStr)
|
|
160
|
-
this.$emit('change', this.currentValue, dateStr)
|
|
161
|
-
|
|
162
|
-
} else {
|
|
163
|
-
let { v1, v2, withTime } = this
|
|
164
|
-
if (!type) { //for day
|
|
165
|
-
this.d1 = dayjs(value)
|
|
166
|
-
if (!v1 && !v2) {
|
|
167
|
-
this.v1 = dayjs(value)
|
|
167
|
+
let { v1, v2, withTime, format, fmt, mode, isRange } = this
|
|
168
|
+
if (isRange) {
|
|
169
|
+
if (!type) { //day
|
|
170
|
+
let result = dayjs(value)
|
|
171
|
+
if (!v1) {
|
|
172
|
+
this.v1 = result
|
|
168
173
|
this.currentValue = [dayjs(value), v2]
|
|
169
174
|
} else if (v1 && !v2) {
|
|
170
|
-
this.v2 =
|
|
175
|
+
this.v2 = result
|
|
171
176
|
this.currentValue = [v1, this.v2]
|
|
172
|
-
|
|
173
|
-
this.updateStr()
|
|
174
|
-
|
|
175
177
|
if (!withTime) {
|
|
176
178
|
this.opened = false
|
|
177
179
|
}
|
|
178
180
|
} else if (v1 && v2) {
|
|
179
|
-
this.v1 =
|
|
181
|
+
this.v1 = result
|
|
180
182
|
this.v2 = null
|
|
181
|
-
this.currentValue = [dayjs(value),
|
|
183
|
+
this.currentValue = [dayjs(value), null]
|
|
182
184
|
}
|
|
183
|
-
|
|
184
|
-
this.v1 = (this.v1 || dayjs(this.d1))[type](value)
|
|
185
|
-
this.currentValue = [this.v1, v2]
|
|
186
|
-
this.d1 = this.d1[type](value)
|
|
185
|
+
this.updateStr()
|
|
187
186
|
|
|
187
|
+
} else {
|
|
188
|
+
let _v1 = (v1 || dayjs(this.d1))[type](value)
|
|
189
|
+
this.v1 = _v1
|
|
190
|
+
if (v2) {
|
|
191
|
+
const oneMonth = dayjs.duration(1, 'month').asDays();
|
|
192
|
+
const diff = v2.diff(_v1, 'day');
|
|
193
|
+
// console.log('diff', diff)
|
|
194
|
+
if (diff < oneMonth) {
|
|
195
|
+
v2 = dayjs(_v1).add(1, 'month')
|
|
196
|
+
}
|
|
197
|
+
this.v2 = v2
|
|
198
|
+
}
|
|
199
|
+
this.currentValue = [_v1, v2]
|
|
188
200
|
this.updateStr()
|
|
189
201
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
202
|
+
} else {
|
|
203
|
+
let result = !type ? dayjs(value) : (this.v1 || dayjs())[type](value)
|
|
204
|
+
this.v1 = dayjs(result)
|
|
205
|
+
this.currentValue = dayjs(result)
|
|
206
|
+
this.updateStr()
|
|
193
207
|
}
|
|
194
208
|
},
|
|
195
|
-
|
|
196
209
|
picker2Update(value, type) {
|
|
197
210
|
let { v1, v2, withTime, format, fmt, mode } = this
|
|
198
|
-
if (!type) { //
|
|
199
|
-
|
|
211
|
+
if (!type) { //day
|
|
212
|
+
let result = dayjs(value)
|
|
200
213
|
if (!v1) {
|
|
201
|
-
this.v1 =
|
|
214
|
+
this.v1 = result
|
|
202
215
|
this.currentValue = [dayjs(value), v2]
|
|
203
216
|
} else if (v1 && !v2) {
|
|
204
|
-
this.v2 =
|
|
217
|
+
this.v2 = result
|
|
205
218
|
this.currentValue = [v1, this.v2]
|
|
206
|
-
|
|
207
|
-
this.updateStr()
|
|
208
219
|
if (!withTime) {
|
|
209
220
|
this.opened = false
|
|
210
221
|
}
|
|
211
222
|
} else if (v1 && v2) {
|
|
212
|
-
this.v1 =
|
|
223
|
+
this.v1 = result
|
|
213
224
|
this.v2 = null
|
|
214
|
-
this.currentValue = [dayjs(value),
|
|
225
|
+
this.currentValue = [dayjs(value), null]
|
|
215
226
|
}
|
|
216
|
-
} else { //for year , month , datetime
|
|
217
|
-
|
|
218
|
-
this.v2 = (this.v2 || dayjs(this.d2))[type](value)
|
|
219
|
-
this.d2 = this.d2[type](value)
|
|
220
|
-
this.currentValue = [v1, this.v2]
|
|
221
227
|
this.updateStr()
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
this.
|
|
228
|
+
} else {
|
|
229
|
+
let _v2 = (v2 || dayjs(this.d2))[type](value)
|
|
230
|
+
this.v2 = _v2
|
|
231
|
+
if (v1) {
|
|
232
|
+
const oneMonth = dayjs.duration(1, 'month').asDays();
|
|
233
|
+
const diff = this.v2.diff(v1, 'day');
|
|
234
|
+
if (diff < oneMonth) {
|
|
235
|
+
v1 = dayjs(_v2).subtract(1, 'month')
|
|
236
|
+
}
|
|
237
|
+
this.v1 = v1
|
|
238
|
+
}
|
|
239
|
+
this.currentValue = [v1, _v2]
|
|
240
|
+
this.updateStr()
|
|
225
241
|
}
|
|
226
242
|
},
|
|
227
243
|
updateStr() {
|
|
228
|
-
let { v1, v2,
|
|
244
|
+
let { v1, v2, isRange, format, fmt, mode } = this
|
|
229
245
|
let ft = format || fmt[mode]
|
|
230
|
-
let dateStr = [v1 ? v1.format(ft) : null, v2 ? v2.format(ft) : null]
|
|
246
|
+
let dateStr = isRange ? [v1 ? v1.format(ft) : null, v2 ? v2.format(ft) : null] : v1.format(ft)
|
|
231
247
|
this.$emit('input', dateStr)
|
|
232
248
|
this.$emit('change', this.currentValue, dateStr)
|
|
233
249
|
this.updateCalendDate()
|
|
@@ -236,7 +252,7 @@ export default {
|
|
|
236
252
|
// 只有一个值的时候, 直接置空
|
|
237
253
|
if (this.isRange) {
|
|
238
254
|
let [a, b] = this.currentValue || []
|
|
239
|
-
if (a && !b) {
|
|
255
|
+
if ((a && !b) || (!a && b)) {
|
|
240
256
|
this.clear(e)
|
|
241
257
|
}
|
|
242
258
|
}
|
|
@@ -403,7 +419,7 @@ export default {
|
|
|
403
419
|
}
|
|
404
420
|
let overlay = <Drop {...props}>{calendar}</Drop >
|
|
405
421
|
|
|
406
|
-
let showClear = !disabled && clearable && ((isRange &&
|
|
422
|
+
let showClear = !disabled && clearable && ((isRange && v1 && v2) || (!isRange && v1))
|
|
407
423
|
showClear && childNode.push(<Icon class="k-datepicker-clearable" type={CloseCircle} onClick={this.clear} />)
|
|
408
424
|
const selectCls = [
|
|
409
425
|
"k-datepicker-selection", {
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
| pickerSize | 值Ï为`small`时日期呈现小尺寸 | String | - |
|
|
9
9
|
| clearable | 是否显示清除图标 | Boolean | true |
|
|
10
10
|
| placeholder | 提示语 | String, Array | - |
|
|
11
|
-
| transfer | 默认渲染到body 上,如定位有问题,请尝试修改为 false | Boolean | true |
|
|
12
11
|
| disabledDate | 不可选择的日期 | Function | - |
|
|
13
12
|
| disabledTime | 不可选择的时间 | Function | - |
|
|
14
13
|
| format | 设置日期格式,为数组时支持多格式匹配,展示以第一个为准。配置参考 [dayjs](http://day.js.org/) | String | YYYY-MM-DD |
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
align-items: center;
|
|
5
5
|
margin-bottom: 20px;
|
|
6
6
|
}
|
|
7
|
+
|
|
7
8
|
.k-descriptions-title {
|
|
8
9
|
flex: auto;
|
|
9
10
|
overflow: hidden;
|
|
@@ -14,27 +15,35 @@
|
|
|
14
15
|
white-space: nowrap;
|
|
15
16
|
text-overflow: ellipsis;
|
|
16
17
|
}
|
|
18
|
+
|
|
17
19
|
.k-descriptions-view {
|
|
18
20
|
width: 100%;
|
|
19
21
|
border-radius: 2px;
|
|
22
|
+
|
|
20
23
|
table {
|
|
21
24
|
width: 100%;
|
|
22
25
|
border-collapse: collapse;
|
|
23
26
|
border-spacing: 0;
|
|
24
27
|
table-layout: auto;
|
|
28
|
+
margin: 0;
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
|
|
32
|
+
.k-descriptions-row {
|
|
28
33
|
border: none;
|
|
29
34
|
background: none;
|
|
30
35
|
}
|
|
36
|
+
|
|
31
37
|
.k-descriptions-row>.k-descripts-item {
|
|
32
38
|
padding-bottom: 16px;
|
|
33
|
-
|
|
39
|
+
|
|
40
|
+
.k-descriptions-item-label,
|
|
41
|
+
.k-descriptions-item-content {
|
|
34
42
|
display: inline-flex;
|
|
35
43
|
font-size: 14px;
|
|
36
44
|
line-height: 1.5;
|
|
37
45
|
}
|
|
46
|
+
|
|
38
47
|
.k-descriptions-item-label {
|
|
39
48
|
&::after {
|
|
40
49
|
content: ":";
|
|
@@ -47,12 +56,32 @@
|
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
.k-descriptions-bordered {
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
|
|
60
|
+
.k-descriptions-view {
|
|
52
61
|
border: 1px solid var(--kui-color-gray-80);
|
|
62
|
+
border-radius: @radius;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.k-descriptions-row {
|
|
66
|
+
border-bottom: 1px solid var(--kui-color-gray-80);
|
|
67
|
+
|
|
68
|
+
&:last-child {
|
|
69
|
+
border-bottom: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.k-descriptions-item-label,
|
|
74
|
+
.k-descriptions-item-content {
|
|
75
|
+
padding: 16px 24px;
|
|
53
76
|
font-size: 14px;
|
|
54
77
|
line-height: 1.5;
|
|
78
|
+
border-left: 1px solid var(--kui-color-gray-80);
|
|
79
|
+
|
|
80
|
+
&:first-child {
|
|
81
|
+
border: none;
|
|
82
|
+
}
|
|
55
83
|
}
|
|
84
|
+
|
|
56
85
|
.k-descriptions-item-label {
|
|
57
86
|
background: var(--kui-color-gray-90);
|
|
58
87
|
font-weight: 400;
|
|
@@ -74,8 +103,11 @@
|
|
|
74
103
|
.k-descriptions-row>.k-descripts-item {
|
|
75
104
|
padding-bottom: 12px;
|
|
76
105
|
}
|
|
106
|
+
|
|
77
107
|
&.k-descriptions-bordered {
|
|
78
|
-
|
|
108
|
+
|
|
109
|
+
.k-descriptions-item-label,
|
|
110
|
+
.k-descriptions-item-content {
|
|
79
111
|
padding: 12px 24px;
|
|
80
112
|
}
|
|
81
113
|
}
|
|
@@ -85,8 +117,11 @@
|
|
|
85
117
|
.k-descriptions-row>.k-descripts-item {
|
|
86
118
|
padding-bottom: 8px;
|
|
87
119
|
}
|
|
120
|
+
|
|
88
121
|
&.k-descriptions-bordered {
|
|
89
|
-
|
|
122
|
+
|
|
123
|
+
.k-descriptions-item-label,
|
|
124
|
+
.k-descriptions-item-content {
|
|
90
125
|
padding: 8px 16px;
|
|
91
126
|
}
|
|
92
127
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
8
|
+
<Space>
|
|
9
9
|
<RadioGroup v-model="placement">
|
|
10
10
|
<Radio label="left" value="left"/>
|
|
11
11
|
<Radio label="top" value="top"/>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</RadioGroup>
|
|
15
15
|
<Button @click="show=true" >Open</Button>
|
|
16
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
|
+
</Space>
|
|
18
18
|
</template>
|
|
19
19
|
<script>
|
|
20
20
|
export default{
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
<Drawer v-model="show1" title="表单验证" @ok="submitForm" @cancel="resetForm" footer>
|
|
12
12
|
<Form ref="form" :model="form" :rules="rules" label-align="left" :labelCol="{span:5}" :wrapperCol="{span:19}">
|
|
13
13
|
<FormItem label="Input" prop="input">
|
|
14
|
-
<Input clearable icon="
|
|
14
|
+
<Input clearable :icon="Home"></Input>
|
|
15
15
|
</FormItem>
|
|
16
16
|
<FormItem label="Number" prop="number">
|
|
17
17
|
<Input number clearable></Input>
|
|
18
18
|
</FormItem>
|
|
19
19
|
<FormItem label="DatePicker" prop="datepicker">
|
|
20
|
-
<DatePicker clearable format="YYYY/MM/DD hh:mm:ss"></DatePicker>
|
|
20
|
+
<DatePicker clearable format="YYYY/MM/DD hh:mm:ss" style="width:210px"></DatePicker>
|
|
21
21
|
</FormItem>
|
|
22
22
|
<FormItem label="Radio" prop="radio">
|
|
23
23
|
<Radio >男</Radio>
|
|
@@ -56,9 +56,11 @@
|
|
|
56
56
|
</div>
|
|
57
57
|
</template>
|
|
58
58
|
<script>
|
|
59
|
+
import { Home } from 'kui-icons'
|
|
59
60
|
export default {
|
|
60
61
|
data() {
|
|
61
62
|
return {
|
|
63
|
+
Home,
|
|
62
64
|
show1: false, show2: false,
|
|
63
65
|
form: {
|
|
64
66
|
switch: true,
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
```vue
|
|
8
8
|
<template>
|
|
9
9
|
<div ref="drawer-box" style="height:300px;position:relative;overflow:hidden">
|
|
10
|
-
<Button @click="show=!show">普通抽屉</Button>
|
|
11
10
|
<RadioGroup v-model="placement">
|
|
12
11
|
<Radio label="left" value="left"/>
|
|
13
12
|
<Radio label="top" value="top"/>
|
|
@@ -22,6 +21,7 @@
|
|
|
22
21
|
<p>something ...</p>
|
|
23
22
|
<p>something ...</p>
|
|
24
23
|
</Drawer>
|
|
24
|
+
<Button @click="show=!show">Open</Button>
|
|
25
25
|
</div>
|
|
26
26
|
</template>
|
|
27
27
|
<script>
|