kui-vue 3.2.3 → 3.2.6-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/LICENSE +0 -0
- package/components/_tool/resize.js +2 -3
- package/components/_tool/scroll.js +2 -3
- package/components/_tool/utils.js +11 -5
- package/components/affix/affix.jsx +35 -74
- package/components/affix/demo/container.md +14 -7
- package/components/affix/index.md +6 -5
- package/components/alert/styles/index.less +19 -19
- package/components/anchor/demo/base.md +11 -11
- package/components/anchor/demo/index.vue +16 -16
- package/components/anchor/demo/info.md +6 -6
- package/components/anchor/index.js +2 -2
- package/components/anchor/index.md +3 -3
- 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 +149 -83
- package/components/datePicker/datepicker.jsx +22 -10
- package/components/datePicker/demo/base.md +2 -0
- package/components/datePicker/demo/index.vue +4 -0
- package/components/datePicker/demo/inside.md +76 -0
- package/components/datePicker/demo/size.md +3 -3
- package/components/datePicker/demo/theme.md +34 -0
- package/components/datePicker/index.js +2 -1
- package/components/datePicker/index.md +5 -1
- package/components/datePicker/styles/calendar.less +184 -83
- package/components/datePicker/styles/datepicker.less +40 -23
- package/components/divider/styles/index.less +6 -6
- package/components/drawer/demo/base.md +2 -2
- package/components/drawer/demo/custom.md +2 -2
- package/components/drawer/demo/form.md +1 -1
- package/components/drawer/demo/target.md +14 -3
- package/components/drawer/drawer.jsx +11 -10
- package/components/drawer/index.md +1 -1
- package/components/drawer/styles/animal.less +2 -1
- package/components/drawer/styles/index.less +37 -19
- 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 +9 -12
- package/components/icon/index.md +1 -1
- package/components/icon/lib/dist.json +0 -0
- package/components/icon/lib/kui-icons.js +0 -0
- package/components/image/preview.jsx +4 -4
- package/components/image/styles/index.less +18 -18
- package/components/index.js +21 -5
- 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/demo/index.vue +17 -17
- package/components/loading/demo/info.md +54 -54
- package/components/loading/index.md +7 -7
- package/components/loading/styles/index.less +4 -4
- package/components/locale/index.js +74 -0
- package/components/locale/lang/de.js +55 -0
- package/components/locale/lang/el.js +72 -0
- package/components/locale/lang/en.js +55 -0
- package/components/locale/lang/fr.js +72 -0
- package/components/locale/lang/it.js +72 -0
- package/components/locale/lang/ja.js +72 -0
- package/components/locale/lang/ko.js +72 -0
- package/components/locale/lang/ru.js +55 -0
- package/components/locale/lang/th.js +72 -0
- package/components/locale/lang/ua.js +55 -0
- package/components/locale/lang/vi.js +55 -0
- package/components/locale/lang/zh-CN.js +55 -0
- package/components/locale/lang/zh-TW.js +55 -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 +17 -11
- 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 +21 -14
- 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/demo/base.md +11 -11
- package/components/rate/demo/index.vue +29 -29
- package/components/rate/demo/info.md +7 -7
- package/components/rate/index.js +1 -1
- package/components/rate/index.md +11 -11
- package/components/rate/rate.jsx +93 -93
- 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/demo/base-render.md +1 -1
- package/components/table/demo/base.md +5 -2
- package/components/table/index.md +4 -3
- package/components/table/styles/index.less +29 -32
- package/components/table/table.jsx +14 -10
- package/components/tabs/styles/index.less +20 -19
- package/components/tabs/tabs.jsx +3 -3
- 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/dist/locale/de.js +8 -0
- package/dist/locale/el.js +8 -0
- package/dist/locale/en.js +8 -0
- package/dist/locale/fr.js +8 -0
- package/dist/locale/it.js +8 -0
- package/dist/locale/ja.js +8 -0
- package/dist/locale/ko.js +8 -0
- package/dist/locale/ru.js +8 -0
- package/dist/locale/th.js +8 -0
- package/dist/locale/ua.js +8 -0
- package/dist/locale/vi.js +8 -0
- package/dist/locale/zhCN.js +8 -0
- package/dist/locale/zhTW.js +8 -0
- package/package.json +12 -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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## API
|
|
2
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
|
+
| ----- | ---------------------------- | -------------------------- | ------- |
|
|
4
|
+
| icon | 设置头像的图标类型 | String,Number | 400 |
|
|
5
|
+
| shape | 指定头像的形状 circle,square | String | circle |
|
|
6
|
+
| size | 设置头像的大小 | large,small,default,Number | default |
|
|
7
|
+
| src | 图片类头像的资源地址 | String | - |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@import '../../styles/var.less';
|
|
2
|
+
.k-avatar {
|
|
3
|
+
margin: 0;
|
|
4
|
+
padding: 0;
|
|
5
|
+
color: #fff;
|
|
6
|
+
background-color: var(--kui-color-border);
|
|
7
|
+
border-radius: 50%;
|
|
8
|
+
height: 32px;
|
|
9
|
+
width: 32px;
|
|
10
|
+
line-height: 32px;
|
|
11
|
+
text-align: center;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
vertical-align: middle;
|
|
17
|
+
position: relative;
|
|
18
|
+
zoom: 1;
|
|
19
|
+
&>img {
|
|
20
|
+
display: block;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
-o-object-fit: cover;
|
|
24
|
+
object-fit: cover;
|
|
25
|
+
}
|
|
26
|
+
&.k-avatar-icon {
|
|
27
|
+
font-size: 18px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.k-avatar-lg {
|
|
32
|
+
width: 40px;
|
|
33
|
+
height: 40px;
|
|
34
|
+
line-height: 40px;
|
|
35
|
+
&.k-avatar-icon {
|
|
36
|
+
font-size: 24px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.k-avatar-sm {
|
|
41
|
+
width: 24px;
|
|
42
|
+
height: 24px;
|
|
43
|
+
line-height: 24px;
|
|
44
|
+
&.k-avatar-icon {
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.k-avatar-square {
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.k-avatar-image {
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.k-avatar-string {
|
|
58
|
+
position: absolute;
|
|
59
|
+
left: 50%;
|
|
60
|
+
transform-origin: 0 center;
|
|
61
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '../../styles/
|
|
1
|
+
@import '../../styles/var.less';
|
|
2
2
|
.k-backtop {
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
margin: 0;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
cursor: pointer;
|
|
14
14
|
display: block;
|
|
15
15
|
overflow: hidden;
|
|
16
|
-
border-radius:
|
|
16
|
+
border-radius: var(--kui-border-radius);
|
|
17
17
|
&-content {
|
|
18
18
|
background-color: rgba(0, 0, 0, .45);
|
|
19
19
|
opacity: .5;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '../../styles/
|
|
1
|
+
@import '../../styles/var.less';
|
|
2
2
|
.k-badge {
|
|
3
3
|
position: relative;
|
|
4
4
|
display: inline-block;
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
min-width: 20px;
|
|
16
16
|
background: #ed3f14;
|
|
17
17
|
color: #fff;
|
|
18
|
-
line-height:
|
|
18
|
+
line-height: 20px;
|
|
19
19
|
text-align: center;
|
|
20
20
|
padding: 0 6px;
|
|
21
21
|
font-size: 12px;
|
|
22
22
|
white-space: nowrap;
|
|
23
23
|
z-index: 10;
|
|
24
|
-
box-shadow: 0 0 0 1px
|
|
24
|
+
box-shadow: 0 0 0 1px var(--kui-color-back);
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
}
|
|
27
27
|
&-mark {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
height: 6px;
|
|
55
55
|
width: 6px;
|
|
56
56
|
border-radius: 50%;
|
|
57
|
-
background:
|
|
57
|
+
background: var(--kui-color-danger);
|
|
58
58
|
z-index: 10;
|
|
59
59
|
box-shadow: 0 0 0 1px #fff;
|
|
60
60
|
}
|
|
@@ -68,18 +68,18 @@
|
|
|
68
68
|
border-radius: 50%;
|
|
69
69
|
}
|
|
70
70
|
&-status-text {
|
|
71
|
-
color:
|
|
71
|
+
color: var(--kui-color-font);
|
|
72
72
|
font-size: 14px;
|
|
73
73
|
margin-left: 8px;
|
|
74
74
|
}
|
|
75
75
|
&-status-success {
|
|
76
|
-
background-color:
|
|
76
|
+
background-color: var(--kui-color-success);
|
|
77
77
|
}
|
|
78
78
|
&-status-error {
|
|
79
|
-
background-color:
|
|
79
|
+
background-color: var(--kui-color-danger);
|
|
80
80
|
}
|
|
81
81
|
&-status-warning {
|
|
82
|
-
background-color:
|
|
82
|
+
background-color: var(--kui-color-warning);
|
|
83
83
|
}
|
|
84
84
|
&-status-default {
|
|
85
85
|
background-color: #ddd;
|
|
@@ -87,42 +87,42 @@
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
&-status-pink {
|
|
90
|
-
background-color:
|
|
90
|
+
background-color: var(--kui-color-pink);
|
|
91
91
|
}
|
|
92
92
|
&-status-red {
|
|
93
|
-
background-color:
|
|
93
|
+
background-color: var(--kui-color-red);
|
|
94
94
|
}
|
|
95
95
|
&-status-yellow {
|
|
96
|
-
background-color:
|
|
96
|
+
background-color: var(--kui-color-yellow);
|
|
97
97
|
}
|
|
98
98
|
&-status-orange {
|
|
99
|
-
background-color:
|
|
99
|
+
background-color: var(--kui-color-orange);
|
|
100
100
|
}
|
|
101
101
|
&-status-cyan {
|
|
102
|
-
background-color:
|
|
102
|
+
background-color: var(--kui-color-cyan);
|
|
103
103
|
}
|
|
104
104
|
&-status-green {
|
|
105
|
-
background-color:
|
|
105
|
+
background-color: var(--kui-color-green);
|
|
106
106
|
}
|
|
107
107
|
&-status-blue {
|
|
108
|
-
background-color:
|
|
108
|
+
background-color: var(--kui-color-blue);
|
|
109
109
|
}
|
|
110
110
|
&-status-purple {
|
|
111
|
-
background-color:
|
|
111
|
+
background-color: var(--kui-color-purple);
|
|
112
112
|
}
|
|
113
113
|
&-status-geekblue {
|
|
114
|
-
background-color:
|
|
114
|
+
background-color: var(--kui-color-geekblue);
|
|
115
115
|
}
|
|
116
116
|
&-status-magenta {
|
|
117
|
-
background-color:
|
|
117
|
+
background-color: var(--kui-color-magenta);
|
|
118
118
|
}
|
|
119
119
|
&-status-volcano {
|
|
120
|
-
background-color:
|
|
120
|
+
background-color: var(--kui-color-volcano);
|
|
121
121
|
}
|
|
122
122
|
&-status-gold {
|
|
123
|
-
background-color:
|
|
123
|
+
background-color: var(--kui-color-gold);
|
|
124
124
|
}
|
|
125
125
|
&-status-lime {
|
|
126
|
-
background-color:
|
|
126
|
+
background-color: var(--kui-color-lime);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -12,17 +12,18 @@ export default {
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
inputType: { type: String, default: "input" },
|
|
15
|
-
value: [String, Number],
|
|
15
|
+
value: [String, Number, Array, Object],
|
|
16
16
|
disabled: Boolean,
|
|
17
17
|
type: {
|
|
18
18
|
validator(value) {
|
|
19
|
-
return (["text", "textarea", "password", "url", "email", "date", "search"].indexOf(value) >= 0);
|
|
19
|
+
return (["text", "textarea", "password", "url", "email", "date", "search", "hidden"].indexOf(value) >= 0);
|
|
20
20
|
},
|
|
21
21
|
default: 'text'
|
|
22
22
|
},
|
|
23
23
|
icon: String,
|
|
24
24
|
suffix: String,
|
|
25
|
-
|
|
25
|
+
theme: String,
|
|
26
|
+
shape: String
|
|
26
27
|
},
|
|
27
28
|
data() {
|
|
28
29
|
return {
|
|
@@ -92,8 +93,8 @@ export default {
|
|
|
92
93
|
|
|
93
94
|
return Password || Search || this.$slots.suffix || this.suffix
|
|
94
95
|
},
|
|
95
|
-
getTextInput() {
|
|
96
|
-
const { disabled, size, type, inputType, currentValue, id } = this
|
|
96
|
+
getTextInput(hasChild) {
|
|
97
|
+
const { disabled, size, type, inputType, currentValue, id, theme, shape } = this
|
|
97
98
|
let isTextArea = inputType == 'textarea'
|
|
98
99
|
// console.log(this.props)
|
|
99
100
|
const props = {
|
|
@@ -105,7 +106,9 @@ export default {
|
|
|
105
106
|
{
|
|
106
107
|
[`k-${inputType}-disabled`]: disabled,
|
|
107
108
|
["k-input-sm"]: size == 'small' && !isTextArea,
|
|
108
|
-
["k-input-lg"]: size == 'large' && !isTextArea
|
|
109
|
+
["k-input-lg"]: size == 'large' && !isTextArea,
|
|
110
|
+
[`k-input-${theme}`]: theme != 'solid' && !hasChild,
|
|
111
|
+
'k-input-circle': shape == 'circle' && !isTextArea,
|
|
109
112
|
}
|
|
110
113
|
],
|
|
111
114
|
ref: 'input',
|
|
@@ -126,27 +129,30 @@ export default {
|
|
|
126
129
|
},
|
|
127
130
|
},
|
|
128
131
|
render() {
|
|
129
|
-
const { inputType, icon, $slots, size, type, $listeners, clearable, suffix } = this
|
|
132
|
+
const { inputType, icon, $slots, size, type, $listeners, clearable, suffix, theme, shape } = this
|
|
130
133
|
|
|
131
134
|
let isTextArea = inputType == 'textarea'
|
|
132
135
|
let hasChild = icon || ('search' in $listeners) || $slots.suffix || suffix || type == 'password' || clearable
|
|
133
136
|
|
|
134
|
-
let textInput = this.getTextInput()
|
|
137
|
+
let textInput = this.getTextInput(hasChild)
|
|
135
138
|
|
|
136
139
|
if (isTextArea || !hasChild) {
|
|
137
140
|
return textInput
|
|
138
141
|
} else {
|
|
139
142
|
let { isFocus, isEnter, currentValue } = this
|
|
140
|
-
|
|
143
|
+
let clearableShow = clearable && (isFocus || isEnter) && isNotEmpty(currentValue)
|
|
141
144
|
let hasSuffix = ('search' in $listeners) || $slots.suffix || suffix || type == 'password'
|
|
142
145
|
const props = {
|
|
143
146
|
class: [
|
|
144
147
|
'k-input-wrapper',
|
|
145
148
|
{
|
|
149
|
+
'k-input-focus': isFocus,
|
|
146
150
|
["k-input-has-suffix"]: hasSuffix,
|
|
147
151
|
["k-input-sm"]: size == 'small',
|
|
148
152
|
["k-input-lg"]: size == 'large',
|
|
149
153
|
["k-input-has-clear"]: clearable,
|
|
154
|
+
[`k-input-${theme}`]: theme != 'solid',
|
|
155
|
+
'k-input-circle': shape == 'circle' && !isTextArea,
|
|
150
156
|
}
|
|
151
157
|
],
|
|
152
158
|
on: {
|
|
@@ -158,8 +164,8 @@ export default {
|
|
|
158
164
|
return <div {...props}>
|
|
159
165
|
{icon ? <Icon type={icon} class="k-input-icon" onClick={this.iconClick} /> : null}
|
|
160
166
|
{textInput}
|
|
161
|
-
{suffixNode ? <div class="k-input-suffix">{suffixNode}</div> : null}
|
|
162
167
|
{clearableShow ? <Icon type="close-circle" class="k-input-clearable" onClick={this.clear} /> : null}
|
|
168
|
+
{suffixNode ? <div class="k-input-suffix">{suffixNode}</div> : null}
|
|
163
169
|
</div>
|
|
164
170
|
}
|
|
165
171
|
}
|
package/components/base/pop.jsx
CHANGED
|
@@ -3,6 +3,7 @@ import Icon from "../icon";
|
|
|
3
3
|
import { getChild } from "../_tool/utils";
|
|
4
4
|
import cloneVNode from '../_tool/clone'
|
|
5
5
|
import Drop from './drop'
|
|
6
|
+
import { t } from "../locale";
|
|
6
7
|
export default {
|
|
7
8
|
name: 'BasePop',
|
|
8
9
|
props: {
|
|
@@ -24,8 +25,8 @@ export default {
|
|
|
24
25
|
},
|
|
25
26
|
default: "top"
|
|
26
27
|
},
|
|
27
|
-
okText:
|
|
28
|
-
cancelText:
|
|
28
|
+
okText: String,
|
|
29
|
+
cancelText: String,
|
|
29
30
|
updateKey: [String, Object, Array]
|
|
30
31
|
},
|
|
31
32
|
data() {
|
|
@@ -100,14 +101,16 @@ export default {
|
|
|
100
101
|
let { placement, trigger, title, preCls, $slots, transfer, color, updateKey } = this, childNode;
|
|
101
102
|
|
|
102
103
|
title = title || getChild($slots.title)
|
|
104
|
+
let okText = this.okText || t('k.pop.ok')
|
|
105
|
+
let cancelText = this.cancelText || t('k.pop.cancel')
|
|
103
106
|
if (this.showPlacementArrow) {
|
|
104
107
|
let titleNode, contentNode, footerNode;
|
|
105
108
|
if (this.confirm) {
|
|
106
109
|
contentNode = [<Icon type="help-circle" />, <div class={`k-${preCls}-title`}>{title}</div>]
|
|
107
110
|
|
|
108
111
|
footerNode = <div class={`k-${preCls}-footer`}>
|
|
109
|
-
<Button size="small" onClick={this.cancel}>{
|
|
110
|
-
<Button type="primary" size="small" onClick={this.ok}>{
|
|
112
|
+
<Button size="small" onClick={this.cancel}>{cancelText}</Button>
|
|
113
|
+
<Button type="primary" size="small" onClick={this.ok}>{okText}</Button>
|
|
111
114
|
</div>
|
|
112
115
|
} else {
|
|
113
116
|
titleNode = title ? <div class={`k-${preCls}-title`}>{title}</div> : null
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
@import '../../styles/
|
|
1
|
+
@import '../../styles/var.less';
|
|
2
2
|
.k-breadcrumb {
|
|
3
3
|
line-height: 1.5;
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
margin: 0;
|
|
6
6
|
padding: 0;
|
|
7
7
|
list-style: none;
|
|
8
|
-
color:
|
|
8
|
+
color: var(--kui-color-disable-color);
|
|
9
9
|
font-size: 14px;
|
|
10
10
|
&-item {
|
|
11
11
|
.k-icon {
|
|
12
12
|
margin-right: 4px;
|
|
13
13
|
}
|
|
14
14
|
&:hover {
|
|
15
|
-
color:
|
|
15
|
+
color: var(--kui-color-main);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
&-link {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
>span {
|
|
22
22
|
&:last-child {
|
|
23
|
-
color:
|
|
23
|
+
color: var(--kui-color-title);
|
|
24
24
|
.k-breadcrumb-separator {
|
|
25
25
|
display: none;
|
|
26
26
|
}
|
|
@@ -18,17 +18,23 @@ export default {
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
loading: Boolean,
|
|
21
|
-
circle: Boolean,
|
|
22
|
-
hollow: Boolean,
|
|
23
21
|
type: {
|
|
24
22
|
validator(value) {
|
|
25
23
|
return (
|
|
26
|
-
["danger", "primary", "link", "default", "dashed"].indexOf(value) >= 0
|
|
24
|
+
["danger", "primary", 'warning', "link", "default", "dashed"].indexOf(value) >= 0
|
|
27
25
|
);
|
|
28
26
|
},
|
|
29
27
|
default: 'default'
|
|
30
28
|
},
|
|
31
|
-
disabled: Boolean
|
|
29
|
+
disabled: Boolean,
|
|
30
|
+
theme: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'default',
|
|
33
|
+
validator(value) {
|
|
34
|
+
return ['default', 'light', 'solid', 'normal'].indexOf(value) > -1
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
shape: String
|
|
32
38
|
},
|
|
33
39
|
methods: {
|
|
34
40
|
click(e) {
|
|
@@ -39,8 +45,8 @@ export default {
|
|
|
39
45
|
},
|
|
40
46
|
|
|
41
47
|
render() {
|
|
42
|
-
const { $slots, $attrs, size, disabled, click,
|
|
43
|
-
|
|
48
|
+
const { $slots, $attrs, size, disabled, click, theme,
|
|
49
|
+
shape, htmlType, icon, loading, $listeners, type, block } = this
|
|
44
50
|
const onlyIcon = !getChild($slots.default).length && icon
|
|
45
51
|
const classes = [
|
|
46
52
|
"k-btn",
|
|
@@ -51,8 +57,8 @@ export default {
|
|
|
51
57
|
["k-btn-loading"]: loading,
|
|
52
58
|
["k-btn-icon-only"]: onlyIcon,
|
|
53
59
|
["k-btn-lg"]: size == 'large',
|
|
54
|
-
["k-btn-circle"]:
|
|
55
|
-
[
|
|
60
|
+
["k-btn-circle"]: shape == 'circle',
|
|
61
|
+
[`k-btn-${theme}`]: !!theme && theme != 'default',
|
|
56
62
|
}
|
|
57
63
|
]
|
|
58
64
|
const props = {
|
|
@@ -5,23 +5,23 @@ export default {
|
|
|
5
5
|
size: {
|
|
6
6
|
default: 'default',
|
|
7
7
|
validator(value) {
|
|
8
|
-
return ["small", "large","default"].indexOf(value) >= 0;
|
|
8
|
+
return ["small", "large", "default"].indexOf(value) >= 0;
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
shape: String
|
|
12
12
|
},
|
|
13
13
|
data() {
|
|
14
14
|
return {};
|
|
15
15
|
},
|
|
16
16
|
computed: {
|
|
17
17
|
classes() {
|
|
18
|
-
const { size,
|
|
18
|
+
const { size, shape } = this
|
|
19
19
|
return [
|
|
20
20
|
"k-btn-group",
|
|
21
21
|
{
|
|
22
|
-
["k-btn-group-sm"]: size=='small',
|
|
23
|
-
["k-btn-group-lg"]: size=='large',
|
|
24
|
-
["k-btn-group-circle"]: circle
|
|
22
|
+
["k-btn-group-sm"]: size == 'small',
|
|
23
|
+
["k-btn-group-lg"]: size == 'large',
|
|
24
|
+
["k-btn-group-circle"]: shape == 'circle'
|
|
25
25
|
}
|
|
26
26
|
];
|
|
27
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<cn>
|
|
2
2
|
#### 基本用法
|
|
3
|
-
使用 `type`、`
|
|
3
|
+
使用 `type`、`theme`、`shape` 属性来定义 `Button` 的样式。
|
|
4
4
|
</cn>
|
|
5
5
|
|
|
6
6
|
```vue
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
<div>
|
|
9
9
|
<Button type="primary">Primary</Button>
|
|
10
10
|
<Button type="danger">Danger</Button>
|
|
11
|
+
<Button type="warning">Warning</Button>
|
|
11
12
|
<Button>Default</Button>
|
|
12
13
|
<Button type="dashed">Dashed</Button>
|
|
13
14
|
<Button type="link">Link</Button>
|
|
@@ -5,21 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<Button type="danger" disabled hollow>Danger</Button>
|
|
23
|
-
</div>
|
|
8
|
+
<Button type="primary">Primary</Button>
|
|
9
|
+
<Button disabled type="primary">disabled</Button>
|
|
10
|
+
<br/>
|
|
11
|
+
<Button type="danger">Danger</Button>
|
|
12
|
+
<Button type="danger" disabled>Danger</Button>
|
|
13
|
+
<br/>
|
|
14
|
+
<Button>Default</Button>
|
|
15
|
+
<Button disabled>Default</Button>
|
|
16
|
+
<br/>
|
|
17
|
+
<Button type="dashed">Dashed</Button>
|
|
18
|
+
<Button disabled type="dashed">Dashed</Button>
|
|
19
|
+
<br/>
|
|
20
|
+
<Button type="link">Link</Button>
|
|
21
|
+
<Button disabled type="link">Link</Button>
|
|
24
22
|
</template>
|
|
25
23
|
```
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
<Button>已发货</Button>
|
|
12
12
|
<Button>已签收</Button>
|
|
13
13
|
</ButtonGroup>
|
|
14
|
-
<ButtonGroup circle>
|
|
14
|
+
<ButtonGroup shape="circle">
|
|
15
15
|
<Button>待发货</Button>
|
|
16
16
|
<Button>已发货</Button>
|
|
17
17
|
<Button>已签收</Button>
|
|
18
18
|
</ButtonGroup>
|
|
19
19
|
<br />
|
|
20
20
|
<br />
|
|
21
|
-
<ButtonGroup size="small" circle>
|
|
21
|
+
<ButtonGroup size="small" shape="circle">
|
|
22
22
|
<Button ><Icon type="chevron-back"/> Backward</Button>
|
|
23
23
|
<Button>Forward <Icon type="chevron-forward"/></Button>
|
|
24
24
|
</ButtonGroup>
|
|
@@ -3,7 +3,9 @@ import Info from './info'
|
|
|
3
3
|
import Base from './base'
|
|
4
4
|
import Disabled from './disabled'
|
|
5
5
|
import Size from './size'
|
|
6
|
-
import
|
|
6
|
+
import Solid from './solid'
|
|
7
|
+
import Normal from './normal'
|
|
8
|
+
import Light from './light'
|
|
7
9
|
import WithIcon from './with-icon.md'
|
|
8
10
|
import Loading from './loading.md'
|
|
9
11
|
import Block from './block.md'
|
|
@@ -15,10 +17,12 @@ export default {
|
|
|
15
17
|
<div class="demo-button">
|
|
16
18
|
<Info class="typo" />
|
|
17
19
|
<Base />
|
|
20
|
+
<Solid />
|
|
21
|
+
<Light />
|
|
22
|
+
<Normal />
|
|
18
23
|
<WithIcon />
|
|
19
24
|
<Size />
|
|
20
25
|
<Disabled />
|
|
21
|
-
<Hollow />
|
|
22
26
|
<Loading />
|
|
23
27
|
<Block />
|
|
24
28
|
<Group />
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 浅色主题
|
|
3
|
+
浅色主题
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<Button type="primary" theme="light">Primary</Button>
|
|
9
|
+
<Button type="danger" theme="light">Danger</Button>
|
|
10
|
+
<Button type="warning" theme="light">Warning</Button>
|
|
11
|
+
<Button theme="light">Default</Button>
|
|
12
|
+
<Button theme="light">Default</Button>
|
|
13
|
+
<br/>
|
|
14
|
+
<br/>
|
|
15
|
+
<Button type="primary" theme="light" icon="camera" />
|
|
16
|
+
<Button type="danger" theme="light" icon="camera" />
|
|
17
|
+
<Button type="warning" theme="light" icon="camera" />
|
|
18
|
+
<Button theme="light" icon="camera" />
|
|
19
|
+
<br/>
|
|
20
|
+
<br/>
|
|
21
|
+
<Button type="primary" theme="light" icon="camera" shape="circle" />
|
|
22
|
+
<Button type="danger" theme="light" icon="camera" shape="circle" />
|
|
23
|
+
<Button type="warning" theme="light" icon="camera" shape="circle" />
|
|
24
|
+
<Button theme="light" icon="camera" shape="circle" />
|
|
25
|
+
</template>
|
|
26
|
+
```
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<div>
|
|
9
9
|
<Button type="primary" icon="search" loading>Loading</Button>
|
|
10
10
|
<Button type="primary" icon="search" loading size="small">Loading</Button>
|
|
11
|
-
<Button icon="search" loading circle/>
|
|
11
|
+
<Button icon="search" loading shape="circle"/>
|
|
12
12
|
<Button type="primary" :loading="loading" @click="loading=true">Clike me</Button>
|
|
13
13
|
<br/>
|
|
14
14
|
<Button type="primary" icon="search" :loading="delayLoading" @click="handleDelay">延迟1s加载</Button>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 无边框无背景
|
|
3
|
+
无边框无背景
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<Button type="primary" theme="normal">主要</Button>
|
|
9
|
+
<Button type="danger" theme="normal">危险</Button>
|
|
10
|
+
<Button type="warning" theme="normal">警告</Button>
|
|
11
|
+
<Button theme="normal">默认</Button>
|
|
12
|
+
<br/>
|
|
13
|
+
<br/>
|
|
14
|
+
<Button type="primary" theme="normal" icon="notifications" />
|
|
15
|
+
<Button type="danger" theme="normal" icon="mail" />
|
|
16
|
+
<Button type="warning" theme="normal" icon="notifications" />
|
|
17
|
+
<Button theme="normal" icon="notifications" />
|
|
18
|
+
<br/>
|
|
19
|
+
<br/>
|
|
20
|
+
<Button type="primary" theme="normal" icon="notifications" shape="circle" />
|
|
21
|
+
<Button type="danger" theme="normal" icon="mail" shape="circle" />
|
|
22
|
+
<Button type="warning" theme="normal" icon="notifications" shape="circle" />
|
|
23
|
+
<Button theme="normal" icon="notifications" shape="circle" />
|
|
24
|
+
</template>
|
|
25
|
+
```
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
<Button type="link" :size="size">Link</Button>
|
|
20
20
|
<br/>
|
|
21
21
|
<Button type="primary" :size="size" icon="cloud-download"></Button>
|
|
22
|
-
<Button type="primary" circle :size="size" icon="cloud-download"></Button>
|
|
23
|
-
<Button type="primary" circle :size="size" icon="cloud-download">Download</Button>
|
|
22
|
+
<Button type="primary" shape="circle" :size="size" icon="cloud-download"></Button>
|
|
23
|
+
<Button type="primary" shape="circle" :size="size" icon="cloud-download">Download</Button>
|
|
24
24
|
<Button type="primary" :size="size" icon="cloud-download">Download</Button>
|
|
25
25
|
|
|
26
26
|
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
#### 边框主题
|
|
3
|
+
只呈现边框
|
|
4
|
+
</cn>
|
|
5
|
+
|
|
6
|
+
```vue
|
|
7
|
+
<template>
|
|
8
|
+
<div style="padding:10px;" class="demo-back">
|
|
9
|
+
<Button type="primary" theme="solid">Primary</Button>
|
|
10
|
+
<Button type="danger" theme="solid">Danger</Button>
|
|
11
|
+
<Button type="warning" theme="solid">Warning</Button>
|
|
12
|
+
<Button theme="solid">Default</Button>
|
|
13
|
+
<Button type="dashed" theme="solid">Dashed</Button>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
```
|