kui-vue 3.2.3-rc3 → 3.2.6
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/utils.js +11 -5
- package/components/affix/affix.jsx +20 -7
- package/components/affix/index.md +6 -5
- package/components/alert/styles/index.less +19 -19
- package/components/avatar/avatar.jsx +63 -0
- package/components/avatar/demo/base.md +24 -0
- package/components/avatar/demo/change.md +40 -0
- package/components/avatar/demo/index.vue +20 -0
- package/components/avatar/demo/info.md +7 -0
- package/components/avatar/demo/types.md +23 -0
- package/components/avatar/index.js +2 -0
- package/components/avatar/index.md +7 -0
- package/components/avatar/styles/index.less +61 -0
- package/components/backtop/styles/index.less +2 -2
- package/components/badge/demo/dot.md +1 -1
- package/components/badge/demo/dynamic.md +1 -1
- package/components/badge/demo/max.md +1 -1
- package/components/badge/styles/index.less +21 -21
- package/components/base/input.jsx +16 -10
- package/components/base/pop.jsx +7 -4
- package/components/breadcrumb/styles/index.less +4 -4
- package/components/button/button.jsx +14 -8
- package/components/button/buttonGroup.jsx +6 -6
- package/components/button/demo/base.md +2 -1
- package/components/button/demo/disabled.md +14 -16
- package/components/button/demo/group.md +2 -2
- package/components/button/demo/index.vue +6 -2
- package/components/button/demo/light.md +26 -0
- package/components/button/demo/loading.md +1 -1
- package/components/button/demo/normal.md +25 -0
- package/components/button/demo/size.md +2 -2
- package/components/button/demo/solid.md +16 -0
- package/components/button/demo/with-icon.md +4 -3
- package/components/button/index.md +3 -3
- package/components/button/styles/index.less +113 -51
- package/components/card/demo/base.md +1 -1
- package/components/card/demo/border.md +2 -2
- package/components/card/styles/index.less +6 -6
- package/components/carousel/styles/index.less +1 -1
- package/components/checkbox/demo/group-vertical.md +47 -0
- package/components/checkbox/demo/index.vue +4 -0
- package/components/checkbox/demo/options.md +46 -0
- package/components/checkbox/group.jsx +9 -3
- package/components/checkbox/index.md +8 -7
- package/components/checkbox/styles/index.less +35 -21
- package/components/collapse/styles/index.less +10 -10
- package/components/colorPicker/colorpicker.jsx +27 -15
- package/components/colorPicker/demo/base.md +1 -1
- package/components/colorPicker/demo/index.vue +2 -0
- package/components/colorPicker/demo/shape.md +33 -0
- package/components/colorPicker/index.md +10 -7
- package/components/colorPicker/styles/index.less +42 -25
- package/components/datePicker/datecalendar.jsx +14 -12
- package/components/datePicker/datepicker.jsx +17 -6
- package/components/datePicker/demo/index.vue +2 -0
- package/components/datePicker/demo/theme.md +34 -0
- package/components/datePicker/index.md +4 -1
- package/components/datePicker/styles/calendar.less +39 -38
- package/components/datePicker/styles/datepicker.less +39 -22
- package/components/divider/styles/index.less +6 -6
- package/components/drawer/demo/custom.md +1 -1
- package/components/drawer/demo/form.md +1 -1
- package/components/drawer/drawer.jsx +5 -4
- package/components/drawer/styles/index.less +12 -10
- package/components/dropdown/demo/base.md +4 -4
- package/components/dropdown/demo/cascading.md +3 -3
- package/components/dropdown/demo/divider.md +3 -3
- package/components/dropdown/dropdown.jsx +0 -1
- package/components/dropdown/styles/index.less +4 -4
- package/components/empty/empty.jsx +2 -1
- package/components/empty/styles/index.less +2 -2
- package/components/form/demo/base.md +25 -2
- package/components/form/demo/index.vue +1 -1
- package/components/form/demo/valid.md +9 -0
- package/components/form/form.jsx +3 -1
- package/components/form/formitem.jsx +18 -10
- package/components/form/styles/index.less +17 -13
- package/components/grid/styles/index.less +1 -1
- package/components/icon/demo/base.md +4 -4
- package/components/icon/demo/search.vue +7 -10
- package/components/icon/index.md +1 -1
- package/components/image/styles/index.less +18 -18
- package/components/index.js +19 -3
- package/components/input/demo/index.vue +3 -1
- package/components/input/demo/size.md +3 -3
- package/components/input/demo/theme.md +39 -0
- package/components/input/index.md +9 -6
- package/components/input/input.jsx +10 -3
- package/components/input/styles/index.less +124 -82
- package/components/input/textarea.jsx +1 -0
- package/components/layout/demo/base.md +5 -3
- package/components/layout/demo/index.vue +0 -2
- package/components/layout/demo/info.md +0 -2
- package/components/layout/demo/layout1.md +40 -47
- package/components/layout/demo/layout2.md +42 -49
- package/components/layout/demo/layout3.md +44 -22
- package/components/layout/demo/layout4.md +19 -18
- package/components/layout/demo/layout5.md +47 -44
- package/components/layout/styles/index.less +1 -6
- package/components/loading/styles/index.less +4 -4
- package/components/locale/index.js +74 -0
- package/components/locale/lang/de.js +54 -0
- package/components/locale/lang/el.js +71 -0
- package/components/locale/lang/en.js +54 -0
- package/components/locale/lang/fr.js +71 -0
- package/components/locale/lang/it.js +71 -0
- package/components/locale/lang/ja.js +71 -0
- package/components/locale/lang/ko.js +71 -0
- package/components/locale/lang/ru.js +54 -0
- package/components/locale/lang/th.js +71 -0
- package/components/locale/lang/ua.js +54 -0
- package/components/locale/lang/vi.js +54 -0
- package/components/locale/lang/zh-CN.js +54 -0
- package/components/locale/lang/zh-TW.js +54 -0
- package/components/menu/demo/accrodion.md +2 -2
- package/components/menu/demo/base.md +5 -13
- package/components/menu/demo/collapsed.md +2 -2
- package/components/menu/demo/index.vue +0 -2
- package/components/menu/demo/inline.md +6 -10
- package/components/menu/demo/mode.md +2 -2
- package/components/menu/demo/theme.md +2 -2
- package/components/menu/demo/vertical.md +2 -2
- package/components/menu/index.md +0 -3
- package/components/menu/menu.jsx +4 -4
- package/components/menu/menuitem.jsx +1 -13
- package/components/menu/styles/dropmenu.less +28 -20
- package/components/menu/styles/index.less +148 -251
- package/components/menu/submenu.jsx +4 -64
- package/components/message/group.jsx +1 -1
- package/components/message/styles/index.less +13 -8
- package/components/modal/demo/base.md +15 -2
- package/components/modal/demo/custom.md +3 -3
- package/components/modal/demo/more.md +6 -6
- package/components/modal/index.js +3 -3
- package/components/modal/modal.jsx +17 -10
- package/components/modal/styles/index.less +24 -17
- package/components/notice/styles/index.less +14 -13
- package/components/page/page.jsx +4 -3
- package/components/page/styles/index.less +29 -29
- package/components/popconfirm/popconfirm.jsx +2 -2
- package/components/popconfirm/styles/index.less +6 -6
- package/components/poptip/styles/index.less +10 -9
- package/components/progress/styles/index.less +13 -13
- package/components/radio/button.jsx +2 -2
- package/components/radio/demo/button.md +3 -3
- package/components/radio/demo/group-vertical.md +46 -0
- package/components/radio/demo/index.vue +4 -0
- package/components/radio/demo/options.md +43 -0
- package/components/radio/group.jsx +14 -8
- package/components/radio/index.md +11 -9
- package/components/radio/styles/index.less +37 -23
- package/components/rate/styles/index.less +2 -2
- package/components/select/demo/filterable.md +6 -14
- package/components/select/demo/icon.md +40 -0
- package/components/select/demo/index.vue +4 -0
- package/components/select/demo/search.md +6 -4
- package/components/select/demo/size.md +5 -5
- package/components/select/demo/theme.md +46 -0
- package/components/select/index.md +21 -17
- package/components/select/select.jsx +26 -16
- package/components/select/styles/index.less +125 -51
- package/components/slider/demo/base.md +35 -0
- package/components/slider/demo/index.vue +18 -0
- package/components/slider/demo/info.md +7 -0
- package/components/slider/demo/vertical.md +13 -0
- package/components/slider/index.md +7 -0
- package/components/slider/slider.jsx +65 -0
- package/components/slider/styles/index.less +60 -32
- package/components/space/demo/align.md +46 -0
- package/components/space/demo/base.md +20 -0
- package/components/space/demo/custom-size.md +35 -0
- package/components/space/demo/index.vue +25 -0
- package/components/space/demo/info.md +11 -0
- package/components/space/demo/size.md +35 -0
- package/components/space/demo/vertical.md +19 -0
- package/components/space/index.js +2 -0
- package/components/space/index.md +6 -0
- package/components/space/space.jsx +57 -0
- package/components/space/styles/index.less +23 -0
- package/components/spin/styles/index.less +7 -11
- package/components/steps/styles/index.less +11 -11
- package/components/styles/color.less +158 -0
- package/components/styles/index.less +6 -1
- package/components/styles/sys.less +34 -0
- package/components/styles/var.less +150 -0
- package/components/switch/styles/index.less +11 -11
- package/components/table/index.md +4 -3
- package/components/table/styles/index.less +29 -32
- package/components/table/table.jsx +2 -1
- package/components/tabs/styles/index.less +20 -19
- package/components/tabs/tabs.jsx +1 -1
- package/components/tag/styles/index.less +45 -45
- package/components/timeline/demo/base.md +3 -3
- package/components/timeline/demo/icon.md +5 -5
- package/components/timeline/demo/mode.md +12 -6
- package/components/timeline/index.md +7 -6
- package/components/timeline/styles/index.less +43 -16
- package/components/timeline/timeline.jsx +5 -1
- package/components/timeline/timelineitem.jsx +9 -5
- package/components/tooltip/styles/index.less +19 -18
- package/components/tree/styles/index.less +15 -15
- package/components/treeselect/styles/index.less +5 -5
- package/components/upload/demo/accept.md +68 -0
- package/components/upload/demo/avatar.md +40 -0
- package/components/upload/demo/base.md +40 -0
- package/components/upload/demo/custom.md +47 -0
- package/components/upload/demo/directory.md +36 -0
- package/components/upload/demo/drag.md +0 -0
- package/components/upload/demo/draggable.md +45 -0
- package/components/upload/demo/exceed.md +42 -0
- package/components/upload/demo/file-list.md +42 -0
- package/components/upload/demo/form.md +120 -0
- package/components/upload/demo/index.vue +37 -0
- package/components/upload/demo/info.md +10 -0
- package/components/upload/demo/picture.md +54 -0
- package/components/upload/index.md +26 -0
- package/components/upload/styles/index.less +258 -0
- package/components/upload/upload.jsx +337 -0
- package/dist/k-ui.css +7 -1
- package/dist/k-ui.js +2 -2
- package/package.json +11 -5
- package/components/button/demo/hollow.md +0 -15
- package/components/layout/demo/layout6.md +0 -142
- package/components/menu/demo/vertical-affix.md +0 -69
- package/components/slider/demo/slider.js +0 -5
- package/components/slider/slider.vue +0 -21
- package/components/slider/sliderButton.vue +0 -76
- package/components/styles/dark.less +0 -67
- package/components/styles/global-dark.less +0 -36
- package/components/styles/global.less +0 -44
- package/components/upload/upload.vue +0 -137
- package/dist/k-ui-dark.css +0 -1
|
@@ -24,19 +24,22 @@ export default {
|
|
|
24
24
|
return modes.indexOf(value) !== -1
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
+
shape: String,
|
|
28
|
+
icon: String,
|
|
29
|
+
showArrow: { type: Boolean, default: true },
|
|
27
30
|
defalutColors: {
|
|
28
31
|
type: Array, default: () => ['#f44336', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3', '#03a9f4', '#00bcd4', '#009688', '#4caf50', '#8bc34a', '#cddc39', '#ffeb3b', '#ffc107', '#ff9800', '#ff5722', '#795548', '#9e9e9e', '#607d8b', '#000'],
|
|
29
32
|
validator: function (value) { return value.length <= 20 }
|
|
30
33
|
}
|
|
31
34
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
watch: {
|
|
36
|
+
value(v1) {
|
|
37
|
+
// console.log(v1, v2, this.currentColor)
|
|
38
|
+
if (v1 != this.currentColor) {
|
|
39
|
+
this.valueChange('COLOR', v1)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
40
43
|
data() {
|
|
41
44
|
return {
|
|
42
45
|
currentMode: this.mode,
|
|
@@ -95,22 +98,28 @@ export default {
|
|
|
95
98
|
case 'COLOR':
|
|
96
99
|
[this.R, this.G, this.B, this.A] = parseColor(value, 'rgba') || [0, 0, 0, 1];
|
|
97
100
|
[this.H, this.S, this.L] = rgbToHsl(this.R, this.G, this.B);
|
|
98
|
-
this.paintHelper
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
if (this.paintHelper) {
|
|
102
|
+
this.paintHelper.setHue(this.H);
|
|
103
|
+
this.updatePostion()
|
|
104
|
+
this.alphaCanvsSetHue(this.$refs.alpha)
|
|
105
|
+
}
|
|
101
106
|
break;
|
|
102
107
|
case 'HUE':
|
|
103
108
|
this.H = value;
|
|
104
109
|
[this.R, this.G, this.B] = hslToRgb(this.H, this.S, this.L);
|
|
105
|
-
this.paintHelper
|
|
106
|
-
|
|
110
|
+
if (this.paintHelper) {
|
|
111
|
+
this.paintHelper.setHue(value);
|
|
112
|
+
this.alphaCanvsSetHue(this.$refs.alpha);
|
|
113
|
+
}
|
|
107
114
|
break;
|
|
108
115
|
case 'RGB':
|
|
109
116
|
[this.R, this.G, this.B] = value;
|
|
110
117
|
[this.H, this.S, this.L] = rgbToHsl(this.R, this.G, this.B);
|
|
111
118
|
// let colors = rgbToHsl(this.R, this.G, this.B);
|
|
112
119
|
// [this.H, this.S, this.L] = colors
|
|
113
|
-
|
|
120
|
+
if (this.paintHelper) {
|
|
121
|
+
this.alphaCanvsSetHue(this.$refs.alpha)
|
|
122
|
+
}
|
|
114
123
|
break;
|
|
115
124
|
case 'ALPHA':
|
|
116
125
|
this.A = value;
|
|
@@ -404,20 +413,23 @@ export default {
|
|
|
404
413
|
|
|
405
414
|
render() {
|
|
406
415
|
let drop = this.renderDrop()
|
|
416
|
+
let { showArrow, icon } = this
|
|
407
417
|
let style = [
|
|
408
418
|
'k-color-picker',
|
|
409
419
|
{
|
|
410
420
|
'k-color-picker-disabled': this.disabled,
|
|
411
421
|
'k-color-picker-sm': this.size == 'small',
|
|
422
|
+
'k-color-picker-circle': this.shape == 'circle' && !showArrow,
|
|
412
423
|
'k-color-picker-lg': this.size == 'large'
|
|
413
424
|
},
|
|
414
425
|
]
|
|
426
|
+
|
|
415
427
|
return (<div class={style}>
|
|
416
428
|
<div class="k-color-picker-selection" onClick={this.toggleDrop}>
|
|
417
429
|
<div class="k-color-picker-color">
|
|
418
430
|
<div class="k-color-picker-color-inner" style={`background-color:${this.currentColor}`}></div>
|
|
419
431
|
</div>
|
|
420
|
-
<Icon type=
|
|
432
|
+
{showArrow && <Icon type={icon || 'chevron-down'} />}
|
|
421
433
|
</div>
|
|
422
434
|
{drop}
|
|
423
435
|
</div >)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import Info from './info'
|
|
3
3
|
import Base from './base'
|
|
4
|
+
import Shape from './shape.md'
|
|
4
5
|
import Mode from './mode.md'
|
|
5
6
|
import Size from './size.md'
|
|
6
7
|
import Colors from './colors.md'
|
|
@@ -11,6 +12,7 @@ export default {
|
|
|
11
12
|
<div>
|
|
12
13
|
<Info class="typo" />
|
|
13
14
|
<Base />
|
|
15
|
+
<Shape />
|
|
14
16
|
<Mode />
|
|
15
17
|
<Size />
|
|
16
18
|
<Colors />
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 自定义
|
|
3
|
+
可通过 icon 定义图标和 shape='circle' 呈现外型
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div class="demo-color-picker">
|
|
9
|
+
<Form>
|
|
10
|
+
<FormItem label="没有下拉箭头">
|
|
11
|
+
<ColorPicker showMode v-model="color1" :showArrow="false"/>
|
|
12
|
+
</FormItem>
|
|
13
|
+
<FormItem label="自定义下拉箭头">
|
|
14
|
+
<ColorPicker showMode v-model="color2" mode="rgba" icon="caret-down-outline"/>
|
|
15
|
+
</FormItem>
|
|
16
|
+
<FormItem label="圆形">
|
|
17
|
+
<ColorPicker showMode v-model="color3" mode="hsla" shape="circle" :showArrow="false"/>
|
|
18
|
+
</FormItem>
|
|
19
|
+
</Form>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
<script>
|
|
23
|
+
export default {
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
color1: '#f44336',
|
|
27
|
+
color2: '#9c27b0',
|
|
28
|
+
color3: '#03a9f4',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
```
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
### API
|
|
2
|
-
| 属性
|
|
3
|
-
|
|
4
|
-
| value | 当前激活的面板的 `name`,可以使用 `v-model` 双向绑定
|
|
5
|
-
| mode | 颜色展示类型,提供3种模式(`hex` 、 `rgba` 、`hsla`)
|
|
6
|
-
| default-colors | 自定义颜色盘,最多20种
|
|
7
|
-
| show-mode | 是否展示颜色模式
|
|
8
|
-
|
|
|
2
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
+
| -------------- | ---------------------------------------------------- | -------- | ------ |
|
|
4
|
+
| value | 当前激活的面板的 `name`,可以使用 `v-model` 双向绑定 | String | - |
|
|
5
|
+
| mode | 颜色展示类型,提供3种模式(`hex` 、 `rgba` 、`hsla`) | String | 'hex' |
|
|
6
|
+
| default-colors | 自定义颜色盘,最多20种 | Array | [...] |
|
|
7
|
+
| show-mode | 是否展示颜色模式 | Boolean | false |
|
|
8
|
+
| show-arrow | 是否展示下拉箭头 | Boolean | true |
|
|
9
|
+
| icon | 自定义下拉箭头 | Boolean | true |
|
|
10
|
+
| shape | shape='circle' 呈现圆形 | String | - |
|
|
11
|
+
| change | 颜色值改变的时候触发,返回颜色的值 | Function | - |
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
@import '../../styles/
|
|
1
|
+
@import '../../styles/var.less';
|
|
2
2
|
.k-color-picker {
|
|
3
|
-
width: 55px;
|
|
3
|
+
// width: 55px;
|
|
4
4
|
height: 30px;
|
|
5
|
-
border: 1px solid
|
|
6
|
-
border-radius:
|
|
5
|
+
border: 1px solid var(--kui-color-border);
|
|
6
|
+
border-radius: var(--kui-border-radius);
|
|
7
7
|
position: relative;
|
|
8
8
|
display: inline-block;
|
|
9
|
+
.k-color-picker-selection {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding: 2px;
|
|
13
|
+
}
|
|
9
14
|
.k-color-picker-color {
|
|
10
15
|
height: 26px;
|
|
11
16
|
width: 26px;
|
|
12
|
-
border-radius:
|
|
13
|
-
margin: 2px;
|
|
17
|
+
border-radius: var(--kui-border-radius);
|
|
18
|
+
// margin: 2px;
|
|
14
19
|
overflow: hidden;
|
|
15
20
|
background-image: linear-gradient(-45deg, #cdcdcd 25%, transparent 0), linear-gradient(45deg, #cdcdcd 25%, transparent 0), linear-gradient(-45deg, transparent 75%, #cdcdcd 0), linear-gradient(45deg, transparent 75%, #cdcdcd 0);
|
|
16
21
|
background-size: 11px 11px;
|
|
@@ -21,19 +26,20 @@
|
|
|
21
26
|
}
|
|
22
27
|
}
|
|
23
28
|
.k-icon {
|
|
24
|
-
position: absolute;
|
|
25
|
-
right: 5px;
|
|
26
|
-
top: 50%;
|
|
27
|
-
transform: translateY(-50%);
|
|
29
|
+
// position: absolute;
|
|
30
|
+
// right: 5px;
|
|
31
|
+
// top: 50%;
|
|
32
|
+
// transform: translateY(-50%);
|
|
33
|
+
margin: 0 5px;
|
|
28
34
|
font-size: 16px;
|
|
29
|
-
color:
|
|
35
|
+
color: var(--kui-color-icon);
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
.k-color-picker-disabled {
|
|
34
40
|
cursor: not-allowed;
|
|
35
|
-
background:
|
|
36
|
-
border-color:
|
|
41
|
+
background: var(--kui-color-disable-back);
|
|
42
|
+
border-color: var(--kui-color-disable-border);
|
|
37
43
|
cursor: not-allowed;
|
|
38
44
|
.k-color-picker-color {
|
|
39
45
|
opacity: .5;
|
|
@@ -41,7 +47,7 @@
|
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
.k-color-picker-lg {
|
|
44
|
-
width: 70px;
|
|
50
|
+
// width: 70px;
|
|
45
51
|
height: 40px;
|
|
46
52
|
.k-color-picker-color {
|
|
47
53
|
width: 35.5px;
|
|
@@ -53,11 +59,14 @@
|
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
.k-color-picker-sm {
|
|
56
|
-
width: 45px;
|
|
57
|
-
height:
|
|
62
|
+
// width: 45px;
|
|
63
|
+
height: 22px;
|
|
64
|
+
.k-color-picker-selection {
|
|
65
|
+
padding: 3px;
|
|
66
|
+
}
|
|
58
67
|
.k-color-picker-color {
|
|
59
|
-
width:
|
|
60
|
-
height:
|
|
68
|
+
width: 16px;
|
|
69
|
+
height: 16px;
|
|
61
70
|
}
|
|
62
71
|
.k-icon {
|
|
63
72
|
font-size: 14px;
|
|
@@ -69,15 +78,16 @@
|
|
|
69
78
|
font-size: 0;
|
|
70
79
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
71
80
|
position: absolute;
|
|
72
|
-
border-radius:
|
|
73
|
-
background:
|
|
81
|
+
border-radius: var(--kui-border-radius);
|
|
82
|
+
background: var(--kui-color-back);
|
|
83
|
+
z-index: 1001;
|
|
74
84
|
.k-color-picker-paint-dot {
|
|
75
85
|
width: 15px;
|
|
76
86
|
height: 15px;
|
|
77
87
|
display: block;
|
|
78
88
|
position: absolute;
|
|
79
|
-
background:
|
|
80
|
-
border:1px solid
|
|
89
|
+
background: var(--kui-color-back);
|
|
90
|
+
border: 1px solid var(--kui-color-border);
|
|
81
91
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
|
|
82
92
|
border-radius: 50%;
|
|
83
93
|
top: 10px;
|
|
@@ -127,8 +137,8 @@
|
|
|
127
137
|
height: 15px;
|
|
128
138
|
display: block;
|
|
129
139
|
position: absolute;
|
|
130
|
-
background:
|
|
131
|
-
border:1px solid
|
|
140
|
+
background: var(--kui-color-back);
|
|
141
|
+
border: 1px solid var(--kui-color-border);
|
|
132
142
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
|
|
133
143
|
border-radius: 50%;
|
|
134
144
|
pointer-events: none;
|
|
@@ -191,7 +201,7 @@
|
|
|
191
201
|
padding: 13px 40px 10px 16px;
|
|
192
202
|
margin-top: 13px;
|
|
193
203
|
min-height: 62px;
|
|
194
|
-
border-top: 1px solid
|
|
204
|
+
border-top: 1px solid var(--kui-color-border);
|
|
195
205
|
span {
|
|
196
206
|
display: inline-block;
|
|
197
207
|
width: 13px;
|
|
@@ -208,6 +218,13 @@
|
|
|
208
218
|
}
|
|
209
219
|
}
|
|
210
220
|
|
|
221
|
+
.k-color-picker-circle {
|
|
222
|
+
border-radius: 50%;
|
|
223
|
+
.k-color-picker-color {
|
|
224
|
+
border-radius: 50%;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
211
228
|
@keyframes dropDownIn {
|
|
212
229
|
0% {
|
|
213
230
|
opacity: 0;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import Button from '../button'
|
|
3
3
|
import moment from 'moment'
|
|
4
4
|
import animate from '../_tool/animate'
|
|
5
|
+
import { t } from '../locale'
|
|
5
6
|
export default {
|
|
6
7
|
name: "Calendar",
|
|
7
8
|
props: {
|
|
@@ -28,8 +29,8 @@ export default {
|
|
|
28
29
|
second: null,
|
|
29
30
|
|
|
30
31
|
monthsHead: "1.2.3.4.5.6.7.8.9.10.11.12".split("."),
|
|
31
|
-
months:
|
|
32
|
-
weeks:
|
|
32
|
+
// months: t('k.datePicker.months'), // months of panel
|
|
33
|
+
// weeks: t('k.datePicker.weeks'), // weeks
|
|
33
34
|
years: [],
|
|
34
35
|
|
|
35
36
|
};
|
|
@@ -403,7 +404,8 @@ export default {
|
|
|
403
404
|
|
|
404
405
|
showMonths = showMonths || mode == 'month'
|
|
405
406
|
showYears = showYears || mode == 'year'
|
|
406
|
-
|
|
407
|
+
let months = t('k.datePicker.months');
|
|
408
|
+
let weeks = t('k.datePicker.weeks');
|
|
407
409
|
let showArrow = true
|
|
408
410
|
//header
|
|
409
411
|
let headNode = []
|
|
@@ -411,13 +413,13 @@ export default {
|
|
|
411
413
|
headNode.push(<span class="k-calendar-prev-year-btn" onClick={this.prevYear}>«</span>)
|
|
412
414
|
if ((!showYears && !showMonths && !showTimes))
|
|
413
415
|
headNode.push(<span class="k-calendar-prev-month-btn" onClick={this.prevMonth}>‹</span>)
|
|
414
|
-
headNode.push(<span class="k-calendar-year-select" onClick={this.setShowYear}>{year}
|
|
416
|
+
headNode.push(<span class="k-calendar-year-select" onClick={this.setShowYear}>{year}{t('k.datePicker.year')}</span>)
|
|
415
417
|
if (!showYears && !showMonths) {
|
|
416
|
-
headNode.push(<span class="k-calendar-month-select" onClick={this.setShowMonth}>{month
|
|
418
|
+
headNode.push(<span class="k-calendar-month-select" onClick={this.setShowMonth}>{months[month]}</span>)
|
|
417
419
|
if (!showTimes)
|
|
418
420
|
headNode.push(<span class="k-calendar-next-month-btn" onClick={this.nextMonth}>›</span>)
|
|
419
421
|
else
|
|
420
|
-
headNode.push(<span class="k-calendar-day-select">{day}
|
|
422
|
+
headNode.push(<span class="k-calendar-day-select">{day}{t('k.datePicker.day')}</span>)
|
|
421
423
|
}
|
|
422
424
|
if (!showTimes)
|
|
423
425
|
headNode.push(<span class="k-calendar-next-year-btn" onClick={this.nextYear}>»</span>)
|
|
@@ -425,7 +427,7 @@ export default {
|
|
|
425
427
|
//body
|
|
426
428
|
const bodyNode = []
|
|
427
429
|
if (mode == 'date' || isRange) {
|
|
428
|
-
let weekNode =
|
|
430
|
+
let weekNode = weeks.map(w => <span class="k-calendar-week" key={w}>{w}</span>)
|
|
429
431
|
const getDay = (j, x) => {
|
|
430
432
|
const props = {
|
|
431
433
|
domProps: { innerHTML: j.d },
|
|
@@ -443,7 +445,7 @@ export default {
|
|
|
443
445
|
bodyNode.push(daysNode)
|
|
444
446
|
}
|
|
445
447
|
if (showMonths) {
|
|
446
|
-
const m =
|
|
448
|
+
const m = months.map((i, j) => <span key={i} class={classes(year, j, day, null, 'YYYYMM')} onClick={(e) => this.setMonth(e, j)}>{i}</span >)
|
|
447
449
|
const mouthNode = <div class="k-calendar-months">{m}</div>
|
|
448
450
|
bodyNode.push(mouthNode)
|
|
449
451
|
}
|
|
@@ -479,12 +481,12 @@ export default {
|
|
|
479
481
|
let disabled = disabledDate(new Date())
|
|
480
482
|
let time_disabled = isRange ? !(temp_left && temp_right) : (!currentValue);
|
|
481
483
|
|
|
482
|
-
!isRange && footerNode.push(<Button type="link" size='small' disabled={disabled} class="k-calendar-btn-today" onClick={this.setToday}
|
|
483
|
-
footerNode.push(<Button type="link" size="small" disabled={time_disabled} onClick={this.setShowTime}>{showTimes ? '
|
|
484
|
-
footerNode.push(<Button type="primary" size='small' disabled={time_disabled} onClick={this.setDate}
|
|
484
|
+
!isRange && footerNode.push(<Button type="link" size='small' disabled={disabled} class="k-calendar-btn-today" onClick={this.setToday}>{t('k.datePicker.now')}</Button>)
|
|
485
|
+
footerNode.push(<Button type="link" size="small" disabled={time_disabled} onClick={this.setShowTime}>{showTimes ? t('k.datePicker.selectDate') : t('k.datePicker.selectTime')}</Button>)
|
|
486
|
+
footerNode.push(<Button type="primary" size='small' disabled={time_disabled} onClick={this.setDate}>{t('k.datePicker.ok')}</Button>)
|
|
485
487
|
} else if (mode == 'date') {
|
|
486
488
|
let disabled = disabledDate(new Date())
|
|
487
|
-
footerNode.push(<Button type="link" disabled={disabled} block size='small' onClick={this.setToday}
|
|
489
|
+
footerNode.push(<Button type="link" disabled={disabled} block size='small' onClick={this.setToday}>{t('k.datePicker.today')}</Button>)
|
|
488
490
|
}
|
|
489
491
|
footerNode = footerNode.length || (isRange && this.showTime) ? <div class="k-calendar-footer">{footerNode}</div> : null
|
|
490
492
|
return (
|
|
@@ -3,7 +3,7 @@ import Icon from "../icon";
|
|
|
3
3
|
import { isNotEmpty } from '../_tool/utils'
|
|
4
4
|
import moment from 'moment'
|
|
5
5
|
import Drop from '../base/drop'
|
|
6
|
-
|
|
6
|
+
import { t } from '../locale'
|
|
7
7
|
export default {
|
|
8
8
|
name: 'DatePicker',
|
|
9
9
|
props: {
|
|
@@ -23,7 +23,14 @@ export default {
|
|
|
23
23
|
return ["small", "large", "default"].indexOf(value) >= 0;
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
placement: String,
|
|
27
|
+
theme: String,
|
|
28
|
+
shape: String,
|
|
29
|
+
placeholder: [String, Array],
|
|
30
|
+
dateIcon: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'calendar-outline'
|
|
33
|
+
}
|
|
27
34
|
},
|
|
28
35
|
provide() {
|
|
29
36
|
return {
|
|
@@ -121,20 +128,21 @@ export default {
|
|
|
121
128
|
},
|
|
122
129
|
},
|
|
123
130
|
render() {
|
|
131
|
+
// console.log(t('k.datePicker'))
|
|
124
132
|
let { currentValue, placeholder, disabled, clearable,
|
|
125
|
-
opened, size, label, transfer, bordered,
|
|
133
|
+
opened, size, label, transfer, bordered, theme, shape, dateIcon,
|
|
126
134
|
format, mode, disabledTime, disabledDate, showTime
|
|
127
135
|
} = this
|
|
128
136
|
let childNode = [], isRange = mode == 'range';
|
|
129
137
|
|
|
130
|
-
childNode.push(<Icon type=
|
|
138
|
+
dateIcon && childNode.push(<Icon type={dateIcon} class="k-icon-calendar" />)
|
|
131
139
|
if (isRange) {
|
|
132
140
|
placeholder = placeholder || []
|
|
133
141
|
if (placeholder && !Array.isArray(placeholder)) {
|
|
134
142
|
console.error('Please set placeholder as array !')
|
|
135
143
|
placeholder = []
|
|
136
144
|
}
|
|
137
|
-
let p1 = placeholder[0] || '
|
|
145
|
+
let p1 = placeholder[0] || t('k.datePicker.startDate'), p2 = placeholder[1] || t('k.datePicker.endDate')
|
|
138
146
|
let v1 = label[0], v2 = label[1]
|
|
139
147
|
if (v1) {
|
|
140
148
|
childNode.push(<div class="k-datepicker-value">{v1}</div>)
|
|
@@ -148,7 +156,7 @@ export default {
|
|
|
148
156
|
childNode.push(<div class="k-datepicker-placeholder">{p2}</div>)
|
|
149
157
|
}
|
|
150
158
|
} else {
|
|
151
|
-
placeholder = placeholder || '
|
|
159
|
+
placeholder = placeholder || t('k.datePicker.placeholder')
|
|
152
160
|
if (label) {
|
|
153
161
|
childNode.push(<div class="k-datepicker-value">{label}</div>)
|
|
154
162
|
} else if (placeholder) {
|
|
@@ -193,6 +201,7 @@ export default {
|
|
|
193
201
|
transfer: transfer,
|
|
194
202
|
selection: this.$el,
|
|
195
203
|
value: this.opened,
|
|
204
|
+
placement:'bottom-left',
|
|
196
205
|
transitionName: 'k-date-picker'
|
|
197
206
|
},
|
|
198
207
|
on: {
|
|
@@ -232,6 +241,8 @@ export default {
|
|
|
232
241
|
{ 'k-datepicker-sm': size == 'small' },
|
|
233
242
|
{ 'k-datepicker-lg': size == 'large' },
|
|
234
243
|
{ 'k-datepicker-disabled': disabled },
|
|
244
|
+
{ 'k-datepicker-light': theme == 'light' },
|
|
245
|
+
{ 'k-datepicker-circle': shape == 'circle' },
|
|
235
246
|
]
|
|
236
247
|
return (
|
|
237
248
|
<div tabIndex="0" class={classes}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import Info from './info'
|
|
3
3
|
import Base from './base.md'
|
|
4
|
+
import Theme from './theme.md'
|
|
4
5
|
import Disabled from './disabled.md'
|
|
5
6
|
import NoBorder from './noborder.md'
|
|
6
7
|
import DisabledDate from './disabled-date.md'
|
|
@@ -14,6 +15,7 @@ export default {
|
|
|
14
15
|
<div class="demo-datepicker">
|
|
15
16
|
<Info class="typo" />
|
|
16
17
|
<Base />
|
|
18
|
+
<Theme />
|
|
17
19
|
<Disabled />
|
|
18
20
|
<NoBorder />
|
|
19
21
|
<Format />
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 主题和自定义
|
|
3
|
+
theme=light 呈现浅色主题, shape=circle 呈现圆角, dateIcon 可自定义图标
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<Checkbox v-model="shape" label="Shape" />
|
|
10
|
+
<br/>
|
|
11
|
+
<br/>
|
|
12
|
+
<DatePicker theme="light" :shape="shape?'circle':''"/>
|
|
13
|
+
<br/>
|
|
14
|
+
<DatePicker theme="light" :shape="shape?'circle':''" dateIcon="calendar-number-outline"/>
|
|
15
|
+
<br/>
|
|
16
|
+
<DatePicker theme="light" :shape="shape?'circle':''" dateIcon="caret-down-outline"/>
|
|
17
|
+
<br/>
|
|
18
|
+
<DatePicker theme="light" :shape="shape?'circle':''" :dateIcon="null" placeholder="没有icon"/>
|
|
19
|
+
<br/>
|
|
20
|
+
<DatePicker mode="month" placeholder="请选择月份" theme="light" :shape="shape?'circle':''"/>
|
|
21
|
+
<br/>
|
|
22
|
+
<DatePicker mode="range" theme="light" :shape="shape?'circle':''"/>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
<script>
|
|
26
|
+
export default{
|
|
27
|
+
data(){
|
|
28
|
+
return{
|
|
29
|
+
shape : false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## API
|
|
2
2
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
-
|
|
3
|
+
| ------------ | -------------------------------------------------------------------------------------------------- | ------------------- | ---------- |
|
|
4
4
|
| value | 默认时间值 | Date, Array, String | - |
|
|
5
5
|
| mode | 使用 `mode` 属性,可以自定义日期显示类型,提供 `year` `month` `date` `range`。 | String | date |
|
|
6
6
|
| disabled | 是否禁用组件 | Boolen | false |
|
|
@@ -12,3 +12,6 @@
|
|
|
12
12
|
| disabledTime | 不可选择的时间 | Function | - |
|
|
13
13
|
| format | 设置日期格式,为数组时支持多格式匹配,展示以第一个为准。配置参考 [moment.js](http://momentjs.com/) | String | YYYY-MM-DD |
|
|
14
14
|
| change | 默认值改变之后的回调,返回当前选择的时间,字符串 | Function | - |
|
|
15
|
+
| theme | theme='light' 时呈现浅色主题 | String | - |
|
|
16
|
+
| dateIcon | 自定义图标 | String | - |
|
|
17
|
+
| shape | shape='circle' 时呈现圆角 | String | - |
|