kui-vue 3.4.4-a → 3.4.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 (49) hide show
  1. package/components/avatar/AvatarGroup.jsx +1 -1
  2. package/components/base/input.jsx +2 -2
  3. package/components/button/button.jsx +6 -3
  4. package/components/button/demo/disabled.md +5 -5
  5. package/components/button/demo/light.md +0 -1
  6. package/components/button/demo/size.md +12 -13
  7. package/components/button/index.md +12 -9
  8. package/components/button/styles/index.less +5 -2
  9. package/components/datePicker/styles/datepicker.less +2 -0
  10. package/components/flex/demo/align.md +37 -0
  11. package/components/flex/demo/base.md +27 -0
  12. package/components/flex/demo/index.vue +23 -0
  13. package/components/flex/demo/info.md +14 -0
  14. package/components/flex/demo/size.md +46 -0
  15. package/components/flex/demo/wrap.md +26 -0
  16. package/components/flex/flex.jsx +50 -0
  17. package/components/flex/index.js +2 -0
  18. package/components/flex/index.md +8 -0
  19. package/components/flex/styles/index.less +54 -0
  20. package/components/form/styles/index.less +2 -4
  21. package/components/icon/demo/search.vue +18 -27
  22. package/components/index.js +4 -2
  23. package/components/input/demo/group.md +106 -0
  24. package/components/input/demo/index.vue +2 -0
  25. package/components/input/demo/suffix.md +5 -10
  26. package/components/input/index.js +2 -1
  27. package/components/input/inputGroup.jsx +63 -0
  28. package/components/input/styles/index.less +59 -5
  29. package/components/inputNumber/styles/index.less +0 -1
  30. package/components/radio/group.jsx +12 -0
  31. package/components/select/styles/index.less +2 -2
  32. package/components/slider/slider.jsx +6 -2
  33. package/components/space/demo/align.md +25 -23
  34. package/components/space/demo/compact-button-vertical.md +56 -0
  35. package/components/space/demo/compact-button.md +60 -0
  36. package/components/space/demo/compact.md +106 -0
  37. package/components/space/demo/custom-size.md +0 -2
  38. package/components/space/demo/index.vue +11 -3
  39. package/components/space/demo/split.md +15 -0
  40. package/components/space/demo/wrap.md +2 -2
  41. package/components/space/index.md +9 -6
  42. package/components/space/space.jsx +57 -35
  43. package/components/space/styles/index.less +67 -9
  44. package/components/styles/index.less +1 -0
  45. package/components/styles/sys.less +11 -1
  46. package/components/tooltip/styles/index.less +0 -1
  47. package/dist/k-ui.css +2 -2
  48. package/dist/k-ui.js +2 -2
  49. package/package.json +1 -1
@@ -0,0 +1,106 @@
1
+ <cn>
2
+ #### 输入框组合
3
+ 使用 compact 让组件之间紧凑连接且合并边框。默认 true
4
+ </cn>
5
+
6
+ ```vue
7
+ <template>
8
+ <Space vertical size="middle">
9
+ <InputGroup>
10
+ <Input style="width:20%" value="027" />
11
+ <Input style="width:30%" value="28398987" />
12
+ </InputGroup>
13
+ <InputGroup size="small">
14
+ <Input :style="{ width: 'calc(100% - 200px)' }" value="https://k-ui.cn" />
15
+ <Button type="primary">Submit</Button>
16
+ </InputGroup>
17
+ <InputGroup>
18
+ <Input :style="{ width: 'calc(100% - 200px)' }" value="https://k-ui.cn" />
19
+ <Button type="primary">Submit</Button>
20
+ </InputGroup>
21
+ <InputGroup>
22
+ <Input :style="{ width: 'calc(100% - 200px)' }" value="git@gitee.com:chuchur/kui-vue.git" />
23
+ <Tooltip title="copy git url">
24
+ <Button :icon="Copy"></Button>
25
+ </Tooltip>
26
+ </InputGroup>
27
+ <InputGroup>
28
+ <Select value="Shenzheng" clearable>
29
+ <Option value="Wuhan">Wuhan001</Option>
30
+ <Option value="Shenzheng">Shenzheng</Option>
31
+ </Select>
32
+ <Input :style="{ width: '50%' }" value="Nanshan District, Shenzheng" />
33
+ </InputGroup>
34
+ <InputGroup>
35
+ <Select clearable multiple :value="['Wuhan001']" :style="{ width: '50%' }">
36
+ <Option value="Wuhan001">Wuhan001</Option>
37
+ <Option value="Shenzheng">Shenzheng</Option>
38
+ </Select>
39
+ <Input :style="{ width: '50%' }" value="Nanshan District, Shenzheng" />
40
+ </InputGroup>
41
+ <InputGroup>
42
+ <Input :style="{ width: '30%' }" value="0755" />
43
+ <Input clearable :style="{ width: '50%' }" value="28398987" />
44
+ <Input :style="{ width: '20%' }" value="+1" />
45
+ </InputGroup>
46
+ <InputGroup>
47
+ <Select value="Option1">
48
+ <Option value="Option1">Option1</Option>
49
+ <Option value="Option2">Option2</Option>
50
+ </Select>
51
+ <Input :style="{ width: '50%' }" value="input content" />
52
+ <InputNumber :value="12" />
53
+ </InputGroup>
54
+ <InputGroup>
55
+ <Input :style="{ width: '50%' }" value="input content" />
56
+ <DatePicker />
57
+ </InputGroup>
58
+ <InputGroup>
59
+ <DatePicker mode="dateRange"/>
60
+ <Input :style="{ width: '30%' }" value="input content" />
61
+ <Button type="primary">查询</Button>
62
+ </InputGroup>
63
+ <InputGroup>
64
+ <Input :style="{ width: '30%' }" value="input content" />
65
+ <DatePicker mdoe="dateRange"/>
66
+ </InputGroup>
67
+ <InputGroup>
68
+ <Select value="Option1-1">
69
+ <Option value="Option1-1">Option1-1</Option>
70
+ <Option value="Option1-2">Option1-2</Option>
71
+ </Select>
72
+ <Select value="Option2-2">
73
+ <Option value="Option2-1">Option2-1</Option>
74
+ <Option value="Option2-2">Option2-2</Option>
75
+ </Select>
76
+ </InputGroup>
77
+ <InputGroup>
78
+ <Select value="1">
79
+ <Option value="1">Between</Option>
80
+ <Option value="2">Except</Option>
81
+ </Select>
82
+ <Input :style="{ width: '100px', textAlig: 'center' }" placeholder="Minimum" />
83
+ <Input :style="{
84
+ width: '30px',
85
+ borderLef: 0,
86
+ borderRight: 0,
87
+ pointerEvents: 'none',
88
+ }" placeholder="~" disabled />
89
+ <Input :style="{
90
+ width: '100px',
91
+ textAlig: 'center',
92
+ }" placeholder="Maximum" />
93
+ </InputGroup>
94
+ </Space>
95
+ </template>
96
+ <script>
97
+ import { Copy } from 'kui-icons'
98
+ export default{
99
+ data(){
100
+ return{
101
+ Copy
102
+ }
103
+ }
104
+ }
105
+ </script>
106
+ ```
@@ -4,6 +4,7 @@ import Base from "./base.md";
4
4
  import Theme from "./theme.md";
5
5
  import Icon from "./icon.md";
6
6
  import Suffix from "./suffix.md";
7
+ import Group from "./group.md";
7
8
  import Clearable from "./clearable.md";
8
9
  import Size from "./size.md";
9
10
  import Event from "./event.md";
@@ -18,6 +19,7 @@ export default {
18
19
  <Theme />
19
20
  <Icon />
20
21
  <Suffix />
22
+ <Group />
21
23
  <Clearable />
22
24
  <Size />
23
25
  <Event />
@@ -6,6 +6,7 @@ suffix,prefix 扩展
6
6
  ```vue
7
7
  <template>
8
8
  <div style="width:256px;">
9
+ <Input placeholder="请输入用户名" :icon="PersonOutline"/>
9
10
  <Input placeholder="请输入验证码" :icon="ShieldCheckmark" :maxlength="8">
10
11
  <template slot="suffix">
11
12
  <Button size="small" type="primary" v-if="time==60" @click="sendCode">获取验证码</Button>
@@ -14,28 +15,22 @@ suffix,prefix 扩展
14
15
  </Input>
15
16
  <Input placeholder="请填写你要喝的Coffee" :icon="Gift">
16
17
  <template slot="suffix">
17
- <Tooltip title="此处如果不知道怎么填,请咨询管理员">
18
+ <Tooltip title="请咨询管理员">
18
19
  <Icon :type="InformationCircleOutline" color="orange"/>
19
20
  </Tooltip>
20
21
  </template>
21
22
  </Input>
22
- <Input placeholder="请输入手机号码">
23
- <Select :bordered="false"style="width:80px;" slot="prefix" value="0">
24
- <Option value="0" label="+86"/>
25
- <Option value="1" label="+52"/>
26
- </Select>
27
- </Input>
28
- <Input placeholder="请输入金额" suffix="元" prefix="$"/>
23
+ <Input placeholder="请输入金额" suffix="RMB" prefix="¥"/>
29
24
  <Input placeholder="请输入域名" suffix=".com" prefix="https://"/>
30
25
  <Input placeholder="请输入金额" suffix=".00"/>
31
26
  </div>
32
27
  </template>
33
28
  <script>
34
- import { InformationCircleOutline, Gift, ShieldCheckmark } from 'kui-icons'
29
+ import { InformationCircleOutline, Gift, ShieldCheckmark ,PersonOutline } from 'kui-icons'
35
30
  export default {
36
31
  data() {
37
32
  return {
38
- InformationCircleOutline, Gift, ShieldCheckmark ,
33
+ InformationCircleOutline, Gift, ShieldCheckmark , PersonOutline ,
39
34
  time:60,
40
35
  timer:null
41
36
  }
@@ -1,3 +1,4 @@
1
1
  import Input from './input.jsx'
2
2
  import TextArea from './textarea.jsx'
3
- export { Input, TextArea }
3
+ import InputGroup from './inputGroup.jsx'
4
+ export { Input, TextArea, InputGroup }
@@ -0,0 +1,63 @@
1
+ import { getChild } from '../_tool/utils'
2
+ import cloneVNode from '../_tool/clone'
3
+ export default {
4
+ name: 'InputGroup',
5
+ props: {
6
+ block: Boolean,
7
+ compact: {
8
+ type: Boolean,
9
+ default: true
10
+ },
11
+ size: {
12
+ type: [String, Number, Array],
13
+ // default: 'small',
14
+ validator(value) {
15
+ return (typeof value == 'number' || Array.isArray(value)) ? true : ["small", "middle", "large"].indexOf(value) >= 0;
16
+ }
17
+ }
18
+ },
19
+ render() {
20
+ let { $slots, size, compact, block } = this
21
+ const props = {
22
+ style: {},
23
+ class: ['k-input-group', {
24
+ [`k-input-group-compact`]: compact,
25
+ [`k-input-group-block`]: block,
26
+ }]
27
+ }
28
+ if (!size && !compact) {
29
+ props.style.gap = '8px'
30
+ }
31
+ if (!compact) {
32
+ if (Array.isArray(size)) {
33
+ props.style = { gap: `${size[1]}px ${size[0]}px` }
34
+ } else if (/small|middle|large/.test(size)) {
35
+ let sizes = { small: 8, middle: 16, large: 24 }
36
+ props.style.gap = sizes[size] + 'px'
37
+ } else if (size !== undefined && size !== null) {
38
+ props.style.gap = `${size}px`
39
+ }
40
+ }
41
+ let childs = $slots.default
42
+ if (compact) {
43
+ childs = getChild(this.$slots.default)
44
+ let newChilds = []
45
+ for (let i = 0; i < childs.length; i++) {
46
+ let child = cloneVNode(childs[i], {
47
+ props: {
48
+ size
49
+ },
50
+ class: {
51
+ [`k-input-group-first-item`]: i == 0,
52
+ [`k-input-group-item`]: i > 0 && i < childs.length - 1,
53
+ [`k-input-group-last-item`]: i == childs.length - 1,
54
+ }
55
+ })
56
+ newChilds.push(child)
57
+ }
58
+ childs = newChilds
59
+
60
+ }
61
+ return <div {...props}>{childs}</div>
62
+ }
63
+ }
@@ -33,10 +33,20 @@
33
33
  color: var(--kui-color-icon);
34
34
  }
35
35
 
36
- .k-input-icon-search {
36
+ .k-input-search-icon {
37
37
  cursor: pointer;
38
38
  }
39
39
 
40
+ .k-input-password-icon {
41
+ color: var(--kui-color-icon);
42
+ cursor: pointer;
43
+ transition: all .2s ease-in-out;
44
+
45
+ &:hover {
46
+ color: var(--kui-color-title);
47
+ }
48
+ }
49
+
40
50
  .k-input-text {
41
51
  padding-left: 0;
42
52
  border: none;
@@ -69,10 +79,10 @@
69
79
 
70
80
  .k-input-suffix,
71
81
  .k-input-prefix {
72
- font-size: 12px;
82
+ // font-size: 12px;
73
83
  white-space: nowrap;
74
84
  line-height: 1;
75
- cursor: pointer;
85
+ // cursor: pointer;
76
86
  user-select: none;
77
87
  transition: all .2s ease-in-out;
78
88
  display: flex;
@@ -230,12 +240,12 @@ select:-webkit-autofill:focus {
230
240
 
231
241
  .k-input-lg[single] {
232
242
  padding: 2px 10px;
233
- height: 38px;
243
+ height: 40px;
234
244
  font-size: 16px;
235
245
  }
236
246
 
237
247
  .k-input-lg[mult] {
238
- height: 38px;
248
+ height: 40px;
239
249
 
240
250
  .k-input-text {
241
251
  padding: 2px 0;
@@ -296,4 +306,48 @@ select:-webkit-autofill:focus {
296
306
  & * {
297
307
  cursor: not-allowed;
298
308
  }
309
+ }
310
+
311
+ .k-input-group-compact {
312
+ box-sizing: border-box;
313
+ margin: 0;
314
+ padding: 0;
315
+ list-style: none;
316
+ display: inline-flex;
317
+ border-collapse: separate;
318
+ border-spacing: 0;
319
+ align-items: self-start;
320
+
321
+ .k-input-group-first-item {
322
+ border-top-right-radius: 0;
323
+ border-bottom-right-radius: 0;
324
+ margin-right: -1px;
325
+
326
+ &:hover {
327
+ z-index: 1;
328
+ }
329
+ }
330
+
331
+ .k-input-group-item {
332
+ border-radius: 0;
333
+ margin-right: -1px;
334
+
335
+ &:hover {
336
+ z-index: 1;
337
+ }
338
+ }
339
+
340
+ .k-select-open,
341
+ .k-datepicker-open {
342
+ z-index: 1;
343
+ }
344
+
345
+ .k-input-group-last-item {
346
+ border-top-left-radius: 0;
347
+ border-bottom-left-radius: 0;
348
+
349
+ &:hover {
350
+ z-index: 1;
351
+ }
352
+ }
299
353
  }
@@ -4,7 +4,6 @@
4
4
  position: relative;
5
5
  display: inline-flex;
6
6
  flex-shrink: 0;
7
- width: 100%;
8
7
  max-width: 100%;
9
8
  color: var(--kui-color-font);
10
9
  align-items: center;
@@ -1,6 +1,7 @@
1
1
  import { getChild } from '../_tool/utils'
2
2
  import Radio from './radio.jsx';
3
3
  import Button from './button.jsx';
4
+ import cloneVNode from '../_tool/clone'
4
5
  export default {
5
6
  name: "RadioGroup",
6
7
  props: {
@@ -70,6 +71,17 @@ export default {
70
71
  disabled={option.disabled}
71
72
  />
72
73
  })
74
+ } else {
75
+ // let newChilds = []
76
+ // for (let i = 0; i < childs.length; i++) {
77
+ // let child = cloneVNode(childs[i], {
78
+ // props: {
79
+ // size, theme, shape,
80
+ // },
81
+ // })
82
+ // newChilds.push(child)
83
+ // }
84
+ // childs = newChilds
73
85
  }
74
86
  const classes = [
75
87
  'k-radio-group',
@@ -173,7 +173,7 @@
173
173
 
174
174
  &-clearable {
175
175
  display: none;
176
- font-size: 15px;
176
+ font-size: 14px;
177
177
  color: var(--kui-color-icon);
178
178
  margin: 0 8px;
179
179
 
@@ -236,7 +236,7 @@
236
236
  }
237
237
  }
238
238
 
239
- &:focus .k-select-selection {
239
+ &:focus .k-select {
240
240
  box-shadow: none;
241
241
  border-color: transparent;
242
242
  }
@@ -113,6 +113,7 @@ export default {
113
113
 
114
114
  this.defaultValue = value
115
115
  this.$emit('input', value)
116
+ this.$emit('change', value)
116
117
  },
117
118
  isActice(a) {
118
119
  let { defaultValue, reverse, max, min, vertical } = this
@@ -214,8 +215,11 @@ export default {
214
215
  },
215
216
  on: {
216
217
  input: (value) => {
217
- this.defaultValue = value
218
- this.$emit('input', value)
218
+ if (value !== defaultValue) {
219
+ this.defaultValue = value
220
+ this.$emit('input', value)
221
+ this.$emit('change', value)
222
+ }
219
223
  }
220
224
  }
221
225
  }
@@ -5,43 +5,45 @@
5
5
 
6
6
  ```vue
7
7
  <template>
8
- <div class="demo-space">
8
+ <div class="demo-space-align">
9
9
  <Space align="start">
10
- <div class="demo-space-align">Start</div>
11
- <Button>Start</Button>
10
+ <div class="block">block</div>
11
+ <Button>button</Button>
12
12
  <Tag color="blue">Start</Tag>
13
13
  </Space>
14
- <br/>
15
- <br/>
16
14
  <Space align="end">
17
- <div class="demo-space-align" >end</div>
18
- <Button>end</Button>
15
+ <div class="block">block</div>
16
+ <Button>button</Button>
19
17
  <Tag color="blue">end</Tag>
20
18
  </Space>
21
- <br/>
22
- <br/>
23
19
  <Space align="center">
24
- <div class="demo-space-align" >center</div>
25
- <Button>center</Button>
20
+ <div class="block">block</div>
21
+ <Button>button</Button>
26
22
  <Tag color="blue">center</Tag>
27
23
  </Space>
28
- <br/>
29
- <br/>
30
24
  <Space align="baseline">
31
- <div class="demo-space-align">baseline</div>
32
- <Button>baseline</Button>
25
+ <div class="block">block</div>
26
+ <Button>button</Button>
33
27
  <Tag color="blue">baseline</Tag>
34
28
  </Space>
35
29
  </div>
36
30
  </template>
37
31
  <style lang=less>
38
- .demo-space-align{
39
- border:1px solid var(--kui-color-border);
40
- height:120px;
41
- display:flex;
42
- align-items:center;
43
- justify-content:center;
44
- width:100px;
45
- }
32
+ .demo-space-align{
33
+ .k-space{
34
+ border:1px solid #0022ff50;
35
+ padding:5px;
36
+ margin:0 5px;
37
+ }
38
+ .block {
39
+ border: 1px solid var(--kui-color-border);
40
+ background:#eee;
41
+ height: 60px;
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ width: 80px;
46
+ }
47
+ }
46
48
  </style>
47
49
  ```
@@ -0,0 +1,56 @@
1
+ <cn>
2
+ #### 垂直方向紧凑布局
3
+ 垂直方向的紧凑布局,目前仅支持 Button 组合。
4
+ </cn>
5
+
6
+ ```vue
7
+ <template>
8
+ <Space size="middle">
9
+ <space compact vertical>
10
+ <Button :icon="CloudDownloadOutline"></Button>
11
+ <Button :icon="GameControllerOutline"></Button>
12
+ <Button :icon="HeartOutline"></Button>
13
+ <Button :icon="MailOutline"></Button>
14
+ <Button :icon="ShirtOutline"></Button>
15
+ <Dropdown placement="bottom-right">
16
+ <Button :icon="Ellipsis"></Button>
17
+ <Menu slot="content">
18
+ <MenuItem>
19
+ <a href="javascript:;">1st menu item</a>
20
+ </MenuItem>
21
+ <MenuItem>
22
+ <a href="javascript:;">2nd menu item</a>
23
+ </MenuItem>
24
+ <MenuItem>
25
+ <a href="javascript:;">3rd menu item</a>
26
+ </MenuItem>
27
+ </Menu>
28
+ </Dropdown>
29
+ </space>
30
+ <space compact vertical>
31
+ <Button type="dashed">Button1</Button>
32
+ <Button type="dashed">Button2</Button>
33
+ <Button type="dashed">Button3</Button>
34
+ <Button type="dashed">Button4</Button>
35
+ </space>
36
+ <space compact vertical>
37
+ <Button>Button1</Button>
38
+ <Button>Button2</Button>
39
+ <Button>Button3</Button>
40
+ <Button>Button4</Button>
41
+ </space>
42
+
43
+ </Space>
44
+ </template>
45
+ <script>
46
+ import { Copy ,CloudDownloadOutline,Ellipsis,GameControllerOutline,HeartOutline,MailOutline,ShirtOutline} from 'kui-icons'
47
+ export default{
48
+ data(){
49
+ return{
50
+ Copy ,CloudDownloadOutline,GameControllerOutline,
51
+ HeartOutline,MailOutline,ShirtOutline,Ellipsis
52
+ }
53
+ }
54
+ }
55
+ </script>
56
+ ```
@@ -0,0 +1,60 @@
1
+ <cn>
2
+ #### Button 紧凑布局
3
+ Button 组件紧凑排列的示例。
4
+ </cn>
5
+
6
+ ```vue
7
+ <template>
8
+ <Space vertical size="middle">
9
+ <space compact>
10
+ <Tooltip placement="top" title="Copy">
11
+ <Button :icon="CloudDownloadOutline"></Button>
12
+ </Tooltip>
13
+ <Button :icon="GameControllerOutline"></Button>
14
+ <Button :icon="HeartOutline"></Button>
15
+ <Button :icon="MailOutline"></Button>
16
+ <Button :icon="ShirtOutline"></Button>
17
+ <Dropdown placement="bottom-right">
18
+ <Button :icon="Ellipsis"></Button>
19
+ <Menu slot="content">
20
+ <MenuItem>
21
+ <a href="javascript:;">1st menu item</a>
22
+ </MenuItem>
23
+ <MenuItem>
24
+ <a href="javascript:;">2nd menu item</a>
25
+ </MenuItem>
26
+ <MenuItem>
27
+ <a href="javascript:;">3rd menu item</a>
28
+ </MenuItem>
29
+ </Menu>
30
+ </Dropdown>
31
+ </space>
32
+ <space compact>
33
+ <Button type="primary">Button1</Button>
34
+ <Button type="primary">Button2</Button>
35
+ <Button type="primary">Button3</Button>
36
+ <Button type="primary">Button4</Button>
37
+ </space>
38
+ <space compact>
39
+ <Button>Button1</Button>
40
+ <Button>Button2</Button>
41
+ <Button>Button3</Button>
42
+ <Button :icon="ShirtOutline" disabled></Button>
43
+ <Button :icon="ShirtOutline"></Button>
44
+ <Button>Button4</Button>
45
+ </space>
46
+
47
+ </Space>
48
+ </template>
49
+ <script>
50
+ import { Copy ,CloudDownloadOutline,Ellipsis,GameControllerOutline,HeartOutline,MailOutline,ShirtOutline} from 'kui-icons'
51
+ export default{
52
+ data(){
53
+ return{
54
+ Copy ,CloudDownloadOutline,GameControllerOutline,
55
+ HeartOutline,MailOutline,ShirtOutline,Ellipsis
56
+ }
57
+ }
58
+ }
59
+ </script>
60
+ ```