kui-vue 3.2.4 → 3.2.5

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.
Files changed (162) hide show
  1. package/components/_tool/utils.js +2 -2
  2. package/components/alert/styles/index.less +19 -19
  3. package/components/avatar/styles/index.less +3 -3
  4. package/components/backtop/styles/index.less +2 -2
  5. package/components/badge/demo/dot.md +1 -1
  6. package/components/badge/demo/dynamic.md +1 -1
  7. package/components/badge/demo/max.md +1 -1
  8. package/components/badge/styles/index.less +21 -21
  9. package/components/base/input.jsx +16 -10
  10. package/components/breadcrumb/styles/index.less +4 -4
  11. package/components/button/button.jsx +14 -8
  12. package/components/button/buttonGroup.jsx +6 -6
  13. package/components/button/demo/base.md +2 -1
  14. package/components/button/demo/disabled.md +14 -16
  15. package/components/button/demo/group.md +2 -2
  16. package/components/button/demo/index.vue +6 -2
  17. package/components/button/demo/light.md +26 -0
  18. package/components/button/demo/loading.md +1 -1
  19. package/components/button/demo/normal.md +25 -0
  20. package/components/button/demo/size.md +2 -2
  21. package/components/button/demo/solid.md +16 -0
  22. package/components/button/demo/with-icon.md +4 -3
  23. package/components/button/index.md +3 -3
  24. package/components/button/styles/index.less +106 -45
  25. package/components/card/demo/base.md +1 -1
  26. package/components/card/demo/border.md +2 -2
  27. package/components/card/styles/index.less +6 -6
  28. package/components/carousel/styles/index.less +1 -1
  29. package/components/checkbox/demo/group-vertical.md +47 -0
  30. package/components/checkbox/demo/index.vue +4 -0
  31. package/components/checkbox/demo/options.md +46 -0
  32. package/components/checkbox/group.jsx +9 -3
  33. package/components/checkbox/index.md +8 -7
  34. package/components/checkbox/styles/index.less +30 -20
  35. package/components/collapse/styles/index.less +10 -10
  36. package/components/colorPicker/styles/index.less +14 -14
  37. package/components/datePicker/datepicker.jsx +11 -3
  38. package/components/datePicker/demo/index.vue +2 -0
  39. package/components/datePicker/demo/theme.md +34 -0
  40. package/components/datePicker/index.md +4 -1
  41. package/components/datePicker/styles/calendar.less +39 -38
  42. package/components/datePicker/styles/datepicker.less +37 -20
  43. package/components/divider/styles/index.less +6 -6
  44. package/components/drawer/styles/index.less +12 -10
  45. package/components/dropdown/demo/base.md +4 -4
  46. package/components/dropdown/demo/cascading.md +3 -3
  47. package/components/dropdown/demo/divider.md +3 -3
  48. package/components/dropdown/styles/index.less +4 -4
  49. package/components/empty/styles/index.less +2 -2
  50. package/components/form/demo/base.md +25 -2
  51. package/components/form/demo/index.vue +1 -1
  52. package/components/form/demo/valid.md +9 -0
  53. package/components/form/form.jsx +2 -0
  54. package/components/form/formitem.jsx +18 -10
  55. package/components/form/styles/index.less +17 -13
  56. package/components/grid/styles/index.less +1 -1
  57. package/components/icon/demo/base.md +4 -4
  58. package/components/icon/demo/search.vue +6 -9
  59. package/components/image/styles/index.less +18 -18
  60. package/components/index.js +3 -1
  61. package/components/input/demo/index.vue +3 -1
  62. package/components/input/demo/theme.md +39 -0
  63. package/components/input/index.md +9 -6
  64. package/components/input/input.jsx +10 -3
  65. package/components/input/styles/index.less +120 -78
  66. package/components/input/textarea.jsx +1 -0
  67. package/components/layout/demo/base.md +5 -3
  68. package/components/layout/demo/index.vue +0 -2
  69. package/components/layout/demo/info.md +0 -2
  70. package/components/layout/demo/layout1.md +40 -47
  71. package/components/layout/demo/layout2.md +42 -49
  72. package/components/layout/demo/layout3.md +44 -22
  73. package/components/layout/demo/layout4.md +19 -18
  74. package/components/layout/demo/layout5.md +47 -44
  75. package/components/layout/styles/index.less +1 -6
  76. package/components/loading/styles/index.less +4 -4
  77. package/components/menu/demo/accrodion.md +2 -2
  78. package/components/menu/demo/base.md +5 -13
  79. package/components/menu/demo/collapsed.md +2 -2
  80. package/components/menu/demo/index.vue +0 -2
  81. package/components/menu/demo/inline.md +6 -10
  82. package/components/menu/demo/mode.md +2 -2
  83. package/components/menu/demo/theme.md +2 -2
  84. package/components/menu/demo/vertical.md +2 -2
  85. package/components/menu/index.md +0 -3
  86. package/components/menu/menu.jsx +4 -4
  87. package/components/menu/menuitem.jsx +1 -13
  88. package/components/menu/styles/dropmenu.less +28 -20
  89. package/components/menu/styles/index.less +148 -251
  90. package/components/menu/submenu.jsx +4 -64
  91. package/components/message/group.jsx +1 -1
  92. package/components/message/styles/index.less +13 -8
  93. package/components/modal/demo/base.md +15 -2
  94. package/components/modal/demo/custom.md +2 -2
  95. package/components/modal/demo/more.md +6 -6
  96. package/components/modal/modal.jsx +11 -5
  97. package/components/modal/styles/index.less +24 -17
  98. package/components/notice/styles/index.less +14 -13
  99. package/components/page/styles/index.less +16 -16
  100. package/components/popconfirm/styles/index.less +6 -6
  101. package/components/poptip/styles/index.less +10 -9
  102. package/components/progress/styles/index.less +13 -13
  103. package/components/radio/button.jsx +2 -2
  104. package/components/radio/demo/button.md +3 -3
  105. package/components/radio/demo/group-vertical.md +46 -0
  106. package/components/radio/demo/index.vue +4 -0
  107. package/components/radio/demo/options.md +43 -0
  108. package/components/radio/group.jsx +14 -8
  109. package/components/radio/index.md +11 -9
  110. package/components/radio/styles/index.less +33 -22
  111. package/components/rate/styles/index.less +2 -2
  112. package/components/select/demo/icon.md +40 -0
  113. package/components/select/demo/index.vue +4 -0
  114. package/components/select/demo/size.md +5 -5
  115. package/components/select/demo/theme.md +46 -0
  116. package/components/select/index.md +5 -2
  117. package/components/select/select.jsx +20 -13
  118. package/components/select/styles/index.less +113 -49
  119. package/components/slider/slider.jsx +9 -4
  120. package/components/slider/styles/index.less +7 -7
  121. package/components/space/demo/align.md +1 -1
  122. package/components/spin/styles/index.less +7 -11
  123. package/components/steps/styles/index.less +11 -11
  124. package/components/styles/color.less +158 -0
  125. package/components/styles/index.less +3 -1
  126. package/components/styles/sys.less +34 -0
  127. package/components/styles/var.less +150 -0
  128. package/components/switch/styles/index.less +11 -11
  129. package/components/table/styles/index.less +29 -32
  130. package/components/tabs/styles/index.less +20 -19
  131. package/components/tag/styles/index.less +45 -45
  132. package/components/timeline/styles/index.less +5 -5
  133. package/components/tooltip/styles/index.less +19 -18
  134. package/components/tree/styles/index.less +15 -15
  135. package/components/treeselect/styles/index.less +5 -5
  136. package/components/upload/demo/accept.md +68 -0
  137. package/components/upload/demo/avatar.md +40 -0
  138. package/components/upload/demo/base.md +40 -0
  139. package/components/upload/demo/custom.md +47 -0
  140. package/components/upload/demo/directory.md +36 -0
  141. package/components/upload/demo/drag.md +0 -0
  142. package/components/upload/demo/draggable.md +45 -0
  143. package/components/upload/demo/exceed.md +42 -0
  144. package/components/upload/demo/file-list.md +42 -0
  145. package/components/upload/demo/form.md +120 -0
  146. package/components/upload/demo/index.vue +37 -0
  147. package/components/upload/demo/info.md +10 -0
  148. package/components/upload/demo/picture.md +54 -0
  149. package/components/upload/index.md +26 -0
  150. package/components/upload/styles/index.less +258 -0
  151. package/components/upload/upload.jsx +336 -0
  152. package/dist/k-ui.css +1 -1
  153. package/dist/k-ui.js +2 -2
  154. package/package.json +9 -4
  155. package/components/button/demo/hollow.md +0 -15
  156. package/components/layout/demo/layout6.md +0 -142
  157. package/components/menu/demo/vertical-affix.md +0 -69
  158. package/components/styles/dark.less +0 -70
  159. package/components/styles/global-dark.less +0 -36
  160. package/components/styles/global.less +0 -44
  161. package/components/upload/upload.vue +0 -137
  162. package/dist/k-ui-dark.css +0 -1
@@ -237,10 +237,10 @@ export function getPosition(selection, picker, transfer, placement = 'bottom-lef
237
237
  }
238
238
  export function getOffset(el) {
239
239
  // const rect = el.getBoundingClientRect();
240
- const pos = {
240
+ const pos = el ? {
241
241
  left: el.offsetLeft,//rect.left,
242
242
  top: el.offsetTop,
243
- };
243
+ } : { left: 0, top: 0 }
244
244
  return pos;
245
245
  }
246
246
 
@@ -1,6 +1,6 @@
1
- @import '../../styles/global.less';
1
+ @import '../../styles/var.less';
2
2
  .k-alert {
3
- border-radius: @radius;
3
+ border-radius: var(--kui-border-radius);
4
4
  margin-bottom: 16px;
5
5
  padding: 8px 15px;
6
6
  box-sizing: border-box;
@@ -9,17 +9,17 @@
9
9
  font-size: 12px;
10
10
  transition: all .3s;
11
11
  overflow: hidden;
12
- background: fadeout(@warning, 90%);
13
- border: 1px solid fadeout(@warning, 70%);
12
+ background: var(--kui-color-warning-90);
13
+ border: 1px solid var(--kui-color-warning-80);
14
14
  &-icon {
15
- color: @warning;
15
+ color: var(--kui-color-warning);
16
16
  position: absolute;
17
17
  top: 8px;
18
18
  left: 10px;
19
19
  font-size: 20px;
20
20
  }
21
21
  &-message {
22
- color: @color;
22
+ color: var(--kui-color-font);
23
23
  }
24
24
  &-has-icon {
25
25
  padding-left: 38px;
@@ -40,11 +40,11 @@
40
40
  font-size: 14px;
41
41
  font-weight: 500;
42
42
  margin-bottom: 5px;
43
- color: @color;
43
+ color: var(--kui-color-font);
44
44
  }
45
45
  .k-alert-description {
46
46
  font-size: 14px;
47
- color: @color;
47
+ color: var(--kui-color-font);
48
48
  }
49
49
  &.k-alert-has-icon {
50
50
  padding-left: 50px;
@@ -60,32 +60,32 @@
60
60
  top: 8px;
61
61
  cursor: pointer;
62
62
  text-decoration: none;
63
- color: @color;
63
+ color: var(--kui-color-font);
64
64
  padding: 0px 5px;
65
65
  &:hover {
66
66
  text-decoration: none;
67
- color: @danger;
67
+ color: var(--kui-color-danger);
68
68
  }
69
69
  }
70
70
  &-success {
71
- background: fadeout(@success, 90%);
72
- border-color: fadeout(@success, 70%);
71
+ background: var(--kui-color-success-90);
72
+ border-color: var(--kui-color-success-80);
73
73
  .k-alert-icon {
74
- color: @success;
74
+ color: var(--kui-color-success);
75
75
  }
76
76
  }
77
77
  &-error {
78
- background: fadeout(@danger, 90%);
79
- border-color: fadeout(@danger, 70%);
78
+ background: var(--kui-color-danger-90);
79
+ border-color: var(--kui-color-danger-80);
80
80
  .k-alert-icon {
81
- color: @danger;
81
+ color: var(--kui-color-danger);
82
82
  }
83
83
  }
84
84
  &-info {
85
- background: fadeout(@main, 90%);
86
- border-color: fadeout(@main, 70%);
85
+ background: var(--kui-color-main-90);
86
+ border-color: var(--kui-color-main-80);
87
87
  .k-alert-icon {
88
- color: @main;
88
+ color: var(--kui-color-main);
89
89
  }
90
90
  }
91
91
  &-slide-leave-to {
@@ -1,9 +1,9 @@
1
- @import '../../styles/global.less';
1
+ @import '../../styles/var.less';
2
2
  .k-avatar {
3
3
  margin: 0;
4
4
  padding: 0;
5
- color: @back-color;
6
- background-color: @border-color;
5
+ color: var(--kui-color-back);
6
+ background-color: var(--kui-color-border);
7
7
  border-radius: 50%;
8
8
  height: 32px;
9
9
  width: 32px;
@@ -1,4 +1,4 @@
1
- @import '../../styles/global.less';
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: @radius;
16
+ border-radius: var(--kui-border-radius);
17
17
  &-content {
18
18
  background-color: rgba(0, 0, 0, .45);
19
19
  opacity: .5;
@@ -21,7 +21,7 @@
21
21
  .demo-dot .box{
22
22
  width:50px;
23
23
  height:50px;
24
- background:#ddd;
24
+ background:#7f7f7f55;
25
25
  border-radius:5px;
26
26
  }
27
27
  .demo-dot .k-badge{
@@ -41,7 +41,7 @@ export default{
41
41
  .demo-dot .box{
42
42
  width:50px;
43
43
  height:50px;
44
- background:#ddd;
44
+ background:#7f7f7f55;
45
45
  border-radius:5px;
46
46
  }
47
47
  .demo-dot .k-badge{
@@ -30,7 +30,7 @@
30
30
  .demo-dot .box{
31
31
  width:50px;
32
32
  height:50px;
33
- background:#ddd;
33
+ background:#7f7f7f55;
34
34
  border-radius:5px;
35
35
  }
36
36
  .demo-dot .k-badge{
@@ -1,4 +1,4 @@
1
- @import '../../styles/global.less';
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: 18px;
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 @back-color;
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: @danger;
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: @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: @success;
76
+ background-color: var(--kui-color-success);
77
77
  }
78
78
  &-status-error {
79
- background-color: @danger;
79
+ background-color: var(--kui-color-danger);
80
80
  }
81
81
  &-status-warning {
82
- background-color: @warning;
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: @pink;
90
+ background-color: var(--kui-color-pink);
91
91
  }
92
92
  &-status-red {
93
- background-color: @red;
93
+ background-color: var(--kui-color-red);
94
94
  }
95
95
  &-status-yellow {
96
- background-color: @yellow;
96
+ background-color: var(--kui-color-yellow);
97
97
  }
98
98
  &-status-orange {
99
- background-color: @orange;
99
+ background-color: var(--kui-color-orange);
100
100
  }
101
101
  &-status-cyan {
102
- background-color: @cyan;
102
+ background-color: var(--kui-color-cyan);
103
103
  }
104
104
  &-status-green {
105
- background-color: @green;
105
+ background-color: var(--kui-color-green);
106
106
  }
107
107
  &-status-blue {
108
- background-color: @blue;
108
+ background-color: var(--kui-color-blue);
109
109
  }
110
110
  &-status-purple {
111
- background-color: @purple;
111
+ background-color: var(--kui-color-purple);
112
112
  }
113
113
  &-status-geekblue {
114
- background-color: @geekblue;
114
+ background-color: var(--kui-color-geekblue);
115
115
  }
116
116
  &-status-magenta {
117
- background-color: @magenta;
117
+ background-color: var(--kui-color-magenta);
118
118
  }
119
119
  &-status-volcano {
120
- background-color: @volcano;
120
+ background-color: var(--kui-color-volcano);
121
121
  }
122
122
  &-status-gold {
123
- background-color: @gold;
123
+ background-color: var(--kui-color-gold);
124
124
  }
125
125
  &-status-lime {
126
- background-color: @lime;
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
- iconAlign: String,
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
- const clearableShow = clearable && (isFocus || isEnter) && isNotEmpty(currentValue)
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
  }
@@ -1,18 +1,18 @@
1
- @import '../../styles/global.less';
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: @disable-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: @main;
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: @title-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
- circle, hollow, htmlType, icon, loading, $listeners, type, block } = this
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"]: !!circle,
55
- ["k-btn-hollow"]: !!hollow
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
- circle: Boolean
11
+ shape: String
12
12
  },
13
13
  data() {
14
14
  return {};
15
15
  },
16
16
  computed: {
17
17
  classes() {
18
- const { size, circle } = this
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`、`hollow`、`circle` 属性来定义 `Button` 的样式。
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
- <div>
9
- <Button type="primary">Primary</Button>
10
- <Button disabled type="primary">disabled</Button>
11
- <br/>
12
- <Button>Default</Button>
13
- <Button disabled>Default</Button>
14
- <br/>
15
- <Button type="dashed">Dashed</Button>
16
- <Button disabled type="dashed">Dashed</Button>
17
- <br/>
18
- <Button type="link">Link</Button>
19
- <Button disabled type="link">Link</Button>
20
- <br/>
21
- <Button type="danger" hollow>Danger</Button>
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 Hollow from './hollow'
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
+ ```