@king-design/intact 3.0.0-beta.1 → 3.0.0
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/badge/styles.ts +1 -1
- package/components/breadcrumb/demos/separator.md +1 -1
- package/components/button/demos/basic.md +1 -1
- package/components/button/demos/disabled.md +2 -1
- package/components/button/demos/group.md +9 -2
- package/components/button/demos/icon.md +7 -7
- package/components/button/demos/loading.md +4 -4
- package/components/button/demos/size.md +4 -4
- package/components/button/group.ts +3 -1
- package/components/button/group.vdt +2 -1
- package/components/button/index.md +1 -0
- package/components/button/index.vdt +1 -1
- package/components/button/styles.ts +37 -16
- package/components/carousel/index.vdt +2 -2
- package/components/cascader/index.vdt +1 -1
- package/components/checkbox/demos/basic.md +1 -1
- package/components/checkbox/demos/group.md +1 -1
- package/components/checkbox/demos/indeterminate.md +1 -1
- package/components/checkbox/demos/value.md +1 -1
- package/components/checkbox/styles.ts +6 -10
- package/components/collapse/item.vdt +1 -1
- package/components/collapse/styles.ts +0 -2
- package/components/copy/index.vdt +1 -1
- package/components/datepicker/calendar.vdt +6 -6
- package/components/datepicker/demos/datetime.md +5 -4
- package/components/datepicker/index.spec.ts +11 -1
- package/components/datepicker/styles.ts +6 -1
- package/components/datepicker/useValue.ts +35 -10
- package/components/dialog/styles.ts +1 -1
- package/components/dropdown/demos/basic.md +1 -1
- package/components/dropdown/demos/checkbox.md +1 -1
- package/components/dropdown/demos/disabled.md +2 -2
- package/components/dropdown/demos/nested.md +6 -6
- package/components/dropdown/demos/position.md +3 -3
- package/components/dropdown/demos/trigger.md +2 -2
- package/components/dropdown/dropdown.ts +1 -0
- package/components/form/demos/basic.md +2 -2
- package/components/form/demos/custom.md +2 -4
- package/components/form/index.spec.ts +21 -0
- package/components/form/styles.ts +2 -2
- package/components/icon/demos/icons.md +130 -97
- package/components/icon/index.vdt +1 -1
- package/components/icon/styles.ts +6 -2
- package/components/input/demos/blocks.md +7 -2
- package/components/input/demos/clearable.md +2 -2
- package/components/input/demos/showCount.md +18 -0
- package/components/input/demos/size.md +6 -4
- package/components/input/index.md +1 -0
- package/components/input/index.ts +5 -0
- package/components/input/index.vdt +22 -14
- package/components/input/search.vdt +2 -5
- package/components/input/styles.ts +81 -77
- package/components/input/useFocus.ts +17 -0
- package/components/menu/item.vdt +1 -1
- package/components/message/demos/config.md +2 -2
- package/components/message/index.md +1 -1
- package/components/message/message.ts +1 -1
- package/components/pagination/index.vdt +2 -2
- package/components/pagination/styles.ts +1 -4
- package/components/popover/styles.ts +1 -1
- package/components/progress/index.vdt +1 -1
- package/components/radio/demos/basic.md +1 -1
- package/components/radio/demos/group.md +1 -1
- package/components/radio/demos/value.md +1 -1
- package/components/radio/styles.ts +4 -1
- package/components/scrollSelect/styles.ts +1 -1
- package/components/select/base.vdt +25 -20
- package/components/select/demos/customMenu.md +2 -2
- package/components/select/index.spec.ts +4 -1
- package/components/select/menu.vdt +2 -2
- package/components/select/option.vdt +1 -0
- package/components/select/styles.ts +6 -2
- package/components/spinner/index.vdt +4 -4
- package/components/spinner/styles.ts +9 -6
- package/components/steps/step.vdt +2 -2
- package/components/steps/styles.ts +5 -1
- package/components/switch/styles.ts +17 -1
- package/components/table/cell.vdt +1 -1
- package/components/table/column.vdt +28 -16
- package/components/table/demos/group.md +4 -3
- package/components/table/demos/showIndeterminate.md +2 -2
- package/components/table/demos/title.md +3 -5
- package/components/table/index.md +1 -1
- package/components/table/index.spec.ts +18 -1
- package/components/table/styles.ts +22 -28
- package/components/table/table.ts +1 -0
- package/components/table/useGroup.ts +42 -23
- package/components/tabs/demos/closable.md +1 -1
- package/components/tabs/index.vdt +3 -2
- package/components/tag/index.md +31 -0
- package/components/tag/styles.ts +6 -6
- package/components/tag/tags.vdt +1 -0
- package/components/tag/useNowrap.ts +1 -1
- package/components/tip/styles.ts +1 -1
- package/components/tooltip/index.spec.ts +30 -0
- package/components/tooltip/tooltip.ts +3 -0
- package/components/transfer/index.vdt +4 -3
- package/components/types.ts +1 -0
- package/components/upload/index.vdt +4 -4
- package/es/components/badge/styles.js +1 -1
- package/es/components/button/group.d.ts +1 -0
- package/es/components/button/group.js +2 -1
- package/es/components/button/group.vdt.js +4 -2
- package/es/components/button/index.vdt.js +1 -1
- package/es/components/button/styles.d.ts +1 -1
- package/es/components/button/styles.js +14 -9
- package/es/components/carousel/index.vdt.js +2 -2
- package/es/components/cascader/index.vdt.js +1 -1
- package/es/components/checkbox/styles.js +4 -8
- package/es/components/collapse/item.vdt.js +1 -1
- package/es/components/collapse/styles.js +2 -2
- package/es/components/copy/index.vdt.js +1 -1
- package/es/components/datepicker/calendar.vdt.js +6 -6
- package/es/components/datepicker/index.spec.js +170 -152
- package/es/components/datepicker/styles.js +1 -1
- package/es/components/datepicker/useValue.d.ts +3 -3
- package/es/components/datepicker/useValue.js +38 -9
- package/es/components/dialog/styles.js +1 -1
- package/es/components/dropdown/dropdown.js +2 -1
- package/es/components/form/index.spec.js +45 -0
- package/es/components/form/styles.js +1 -1
- package/es/components/icon/index.vdt.js +3 -2
- package/es/components/icon/styles.js +1 -1
- package/es/components/input/index.d.ts +3 -1
- package/es/components/input/index.js +4 -1
- package/es/components/input/index.vdt.js +21 -10
- package/es/components/input/search.vdt.js +2 -4
- package/es/components/input/styles.js +13 -6
- package/es/components/input/useFocus.d.ts +4 -0
- package/es/components/input/useFocus.js +21 -0
- package/es/components/menu/item.vdt.js +4 -1
- package/es/components/message/message.js +1 -1
- package/es/components/pagination/index.vdt.js +2 -2
- package/es/components/pagination/styles.js +2 -5
- package/es/components/popover/styles.js +1 -1
- package/es/components/progress/index.vdt.js +1 -1
- package/es/components/radio/styles.js +1 -1
- package/es/components/scrollSelect/styles.js +1 -1
- package/es/components/select/base.vdt.js +40 -20
- package/es/components/select/index.spec.js +23 -11
- package/es/components/select/menu.vdt.js +5 -5
- package/es/components/select/option.vdt.js +2 -1
- package/es/components/select/styles.js +2 -2
- package/es/components/spinner/index.vdt.js +4 -4
- package/es/components/spinner/styles.js +2 -2
- package/es/components/steps/step.vdt.js +2 -2
- package/es/components/steps/styles.js +6 -2
- package/es/components/switch/styles.js +10 -2
- package/es/components/table/cell.vdt.js +1 -1
- package/es/components/table/column.vdt.js +42 -24
- package/es/components/table/index.spec.js +37 -6
- package/es/components/table/styles.js +15 -8
- package/es/components/table/table.js +2 -1
- package/es/components/table/useGroup.d.ts +9 -3
- package/es/components/table/useGroup.js +46 -37
- package/es/components/tabs/index.vdt.js +7 -2
- package/es/components/tag/styles.js +1 -1
- package/es/components/tag/tags.vdt.js +14 -2
- package/es/components/tag/useNowrap.js +1 -1
- package/es/components/tip/styles.js +1 -1
- package/es/components/tooltip/index.spec.js +57 -0
- package/es/components/tooltip/tooltip.js +5 -1
- package/es/components/transfer/index.vdt.js +14 -3
- package/es/components/types.d.ts +1 -0
- package/es/components/upload/index.vdt.js +4 -4
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/button/demos/disabled/react.js +5 -2
- package/es/site/data/components/button/demos/group/react.js +19 -2
- package/es/site/data/components/button/demos/icon/react.js +7 -7
- package/es/site/data/components/button/demos/loading/react.js +4 -4
- package/es/site/data/components/button/demos/size/react.js +4 -4
- package/es/site/data/components/datepicker/demos/datetime/index.d.ts +1 -0
- package/es/site/data/components/datepicker/demos/datetime/index.js +1 -0
- package/es/site/data/components/dropdown/demos/basic/react.js +1 -1
- package/es/site/data/components/dropdown/demos/checkbox/react.js +1 -1
- package/es/site/data/components/dropdown/demos/disabled/react.js +2 -2
- package/es/site/data/components/dropdown/demos/nested/react.js +9 -9
- package/es/site/data/components/dropdown/demos/position/react.js +3 -3
- package/es/site/data/components/dropdown/demos/trigger/react.js +2 -2
- package/es/site/data/components/form/demos/basic/react.js +1 -1
- package/es/site/data/components/icon/demos/icons/index.d.ts +8 -4
- package/es/site/data/components/icon/demos/icons/index.js +35 -1
- package/es/site/data/components/icon/demos/icons/react.d.ts +9 -4
- package/es/site/data/components/icon/demos/icons/react.js +51 -9
- package/es/site/data/components/input/demos/blocks/react.js +7 -7
- package/es/site/data/components/input/demos/clearable/react.js +2 -2
- package/es/site/data/components/input/demos/showCount/index.d.ts +5 -0
- package/es/site/data/components/input/demos/showCount/index.js +17 -0
- package/es/site/data/components/input/demos/showCount/react.d.ts +4 -0
- package/es/site/data/components/input/demos/showCount/react.js +33 -0
- package/es/site/data/components/input/demos/size/react.js +8 -8
- package/es/site/data/components/message/demos/config/index.js +1 -1
- package/es/site/data/components/message/demos/config/react.js +1 -1
- package/es/site/data/components/select/demos/customMenu/react.js +5 -5
- package/es/site/data/components/table/demos/showIndeterminate/react.js +1 -1
- package/es/site/data/components/table/demos/title/react.js +4 -4
- package/es/site/data/components/tabs/demos/closable/react.js +2 -1
- package/es/site/src/pages/layout.js +1 -3
- package/es/site/src/pages/styles.js +1 -1
- package/es/site/src/router/index.js +1 -1
- package/es/styles/fonts/iconfont.eot +0 -0
- package/es/styles/fonts/iconfont.js +1 -1
- package/es/styles/fonts/iconfont.svg +36 -36
- package/es/styles/fonts/iconfont.ttf +0 -0
- package/es/styles/fonts/iconfont.woff +0 -0
- package/es/styles/global.js +1 -1
- package/es/styles/theme.js +1 -1
- package/index.ts +2 -2
- package/package.json +2 -2
- package/styles/fonts/demo.css +277 -108
- package/styles/fonts/demo_index.html +2169 -0
- package/styles/fonts/iconfont.css +52 -50
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +1 -0
- package/styles/fonts/iconfont.json +611 -0
- package/styles/fonts/iconfont.svg +36 -36
- package/styles/fonts/iconfont.ts +123 -124
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/iconfont.woff2 +0 -0
- package/styles/global.ts +4 -4
- package/styles/theme.ts +1 -1
- package/components/select/useNowrap.ts +0 -24
- package/es/components/select/useNowrap.d.ts +0 -3
- package/es/components/select/useNowrap.js +0 -19
|
@@ -10,7 +10,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Checkbox, Button, Icon} from 'kpc'
|
|
|
10
10
|
|
|
11
11
|
<div>
|
|
12
12
|
<Dropdown>
|
|
13
|
-
<Button>More<Icon class="
|
|
13
|
+
<Button>More<Icon class="k-icon-right" /></Button>
|
|
14
14
|
<DropdownMenu class="checkbox-menu">
|
|
15
15
|
<DropdownItem hideOnSelect={false}>
|
|
16
16
|
<Checkbox v-model="checked"
|
|
@@ -13,7 +13,7 @@ import {Icon} from 'kpc';
|
|
|
13
13
|
<div>
|
|
14
14
|
<Dropdown disabled>
|
|
15
15
|
<Button type="primary">
|
|
16
|
-
disabled <Icon class="
|
|
16
|
+
disabled <Icon class="k-icon-down" />
|
|
17
17
|
</Button>
|
|
18
18
|
<DropdownMenu>
|
|
19
19
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -24,7 +24,7 @@ import {Icon} from 'kpc';
|
|
|
24
24
|
|
|
25
25
|
<Dropdown>
|
|
26
26
|
<Button type="primary">
|
|
27
|
-
disabled item <Icon class="
|
|
27
|
+
disabled item <Icon class="k-icon-down" />
|
|
28
28
|
</Button>
|
|
29
29
|
<DropdownMenu>
|
|
30
30
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -12,7 +12,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
|
|
|
12
12
|
<div>
|
|
13
13
|
<Dropdown trigger="click">
|
|
14
14
|
<Button type="primary">
|
|
15
|
-
click <Icon class="
|
|
15
|
+
click <Icon class="k-icon-down" />
|
|
16
16
|
</Button>
|
|
17
17
|
<DropdownMenu class="dropdown-demo">
|
|
18
18
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -21,13 +21,13 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
|
|
|
21
21
|
<Dropdown position={{my: 'left top', at: 'right top'}} class="dropdown-demo">
|
|
22
22
|
<DropdownItem>
|
|
23
23
|
<span>hover</span>
|
|
24
|
-
<
|
|
24
|
+
<Icon class="k-icon-right" />
|
|
25
25
|
</DropdownItem>
|
|
26
26
|
<DropdownMenu class="dropdown-demo">
|
|
27
27
|
<Dropdown position={{my: 'left top', at: 'right top'}}>
|
|
28
28
|
<DropdownItem>
|
|
29
29
|
<span>hover</span>
|
|
30
|
-
<
|
|
30
|
+
<Icon class="k-icon-right" />
|
|
31
31
|
</DropdownItem>
|
|
32
32
|
<DropdownMenu class="dropdown-demo">
|
|
33
33
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -40,13 +40,13 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
|
|
|
40
40
|
<Dropdown trigger="click" position={{my: 'left top', at: 'right top'}}>
|
|
41
41
|
<DropdownItem>
|
|
42
42
|
<span>click</span>
|
|
43
|
-
<
|
|
43
|
+
<Icon class="k-icon-right" />
|
|
44
44
|
</DropdownItem>
|
|
45
45
|
<DropdownMenu class="dropdown-demo">
|
|
46
46
|
<Dropdown trigger="click" position={{my: 'left top', at: 'right top'}}>
|
|
47
47
|
<DropdownItem>
|
|
48
48
|
<span>click</span>
|
|
49
|
-
<
|
|
49
|
+
<Icon class="k-icon-right" />
|
|
50
50
|
</DropdownItem>
|
|
51
51
|
<DropdownMenu class="dropdown-demo">
|
|
52
52
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -64,7 +64,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
|
|
|
64
64
|
|
|
65
65
|
```styl
|
|
66
66
|
/.dropdown-demo.k-dropdown-menu
|
|
67
|
-
.
|
|
67
|
+
.k-icon
|
|
68
68
|
float right
|
|
69
69
|
height 32px
|
|
70
70
|
&:before
|
|
@@ -12,7 +12,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
|
|
|
12
12
|
<div>
|
|
13
13
|
<Dropdown position={{my: 'left top', at: 'left bottom+5'}}>
|
|
14
14
|
<Button type="primary">
|
|
15
|
-
left <Icon class="
|
|
15
|
+
left <Icon class="k-icon-down" />
|
|
16
16
|
</Button>
|
|
17
17
|
<DropdownMenu>
|
|
18
18
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -23,7 +23,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
|
|
|
23
23
|
|
|
24
24
|
<Dropdown position={{my: 'right top', at: 'right bottom+5'}}>
|
|
25
25
|
<Button type="primary">
|
|
26
|
-
right <Icon class="
|
|
26
|
+
right <Icon class="k-icon-down" />
|
|
27
27
|
</Button>
|
|
28
28
|
<DropdownMenu>
|
|
29
29
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -34,7 +34,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
|
|
|
34
34
|
|
|
35
35
|
<Dropdown position="top">
|
|
36
36
|
<Button type="primary">
|
|
37
|
-
top center <Icon class="
|
|
37
|
+
top center <Icon class="k-icon-down" />
|
|
38
38
|
</Button>
|
|
39
39
|
<DropdownMenu>
|
|
40
40
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -14,7 +14,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon, Input} from 'kpc';
|
|
|
14
14
|
<div>
|
|
15
15
|
<Dropdown>
|
|
16
16
|
<Button type="primary">
|
|
17
|
-
hover <Icon class="
|
|
17
|
+
hover <Icon class="k-icon-down" />
|
|
18
18
|
</Button>
|
|
19
19
|
<DropdownMenu>
|
|
20
20
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -25,7 +25,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon, Input} from 'kpc';
|
|
|
25
25
|
|
|
26
26
|
<Dropdown trigger="click">
|
|
27
27
|
<Button type="primary">
|
|
28
|
-
click <Icon class="
|
|
28
|
+
click <Icon class="k-icon-down" />
|
|
29
29
|
</Button>
|
|
30
30
|
<DropdownMenu>
|
|
31
31
|
<DropdownItem>item 1</DropdownItem>
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
</FormItem>
|
|
111
111
|
<FormItem>
|
|
112
112
|
<Button type="primary" htmlType="submit" ev-click={this.handleSubmit}>提交</Button>
|
|
113
|
-
<Button style="margin-left:
|
|
113
|
+
<Button style="margin-left: 8px" ev-click={this.reset}>重置</Button>
|
|
114
114
|
</FormItem>
|
|
115
115
|
</Form>
|
|
116
116
|
```
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
width 300px
|
|
122
122
|
.k-radio
|
|
123
123
|
.k-checkbox
|
|
124
|
-
margin-right
|
|
124
|
+
margin-right 24px
|
|
125
125
|
|
|
126
126
|
@media (max-width: 768px)
|
|
127
127
|
.k-form-item
|
|
@@ -36,16 +36,14 @@ import {Form, FormItem, Input, Button} from 'kpc';
|
|
|
36
36
|
<Button ev-click={this.remove.bind(self, $key)}>删除</Button>
|
|
37
37
|
</b:append>
|
|
38
38
|
</FormItem>
|
|
39
|
+
</FormItem>
|
|
40
|
+
<FormItem>
|
|
39
41
|
<Button ev-click={this.add}>添加</Button>
|
|
40
42
|
</FormItem>
|
|
41
43
|
</Form>
|
|
42
44
|
```
|
|
43
45
|
|
|
44
46
|
```styl
|
|
45
|
-
.k-form-item
|
|
46
|
-
.k-form-item
|
|
47
|
-
margin-bottom 20px
|
|
48
|
-
|
|
49
47
|
@media (max-width: 768px)
|
|
50
48
|
.k-form-item
|
|
51
49
|
width 100%
|
|
@@ -6,6 +6,7 @@ import {mount, unmount, dispatchEvent, wait} from '../../test/utils';
|
|
|
6
6
|
import {Component, findDomFromVNode} from 'intact';
|
|
7
7
|
import {Form, FormItem} from './';
|
|
8
8
|
import {Input} from '../input';
|
|
9
|
+
import { Select } from '../select';
|
|
9
10
|
|
|
10
11
|
RemoteDemo.prototype.validateUserName = function(value) {
|
|
11
12
|
// mock api
|
|
@@ -440,4 +441,24 @@ describe('Form', () => {
|
|
|
440
441
|
await wait();
|
|
441
442
|
expect(classList.contains('k-ellipsis')).to.be.true;
|
|
442
443
|
});
|
|
444
|
+
|
|
445
|
+
it('should not validate when select is disabled on init', async () => {
|
|
446
|
+
class Demo extends Component {
|
|
447
|
+
static template = `
|
|
448
|
+
const {Form, FormItem, Select} = this;
|
|
449
|
+
<Form ref="form">
|
|
450
|
+
<FormItem rules={{required: true}}>
|
|
451
|
+
<Select disabled />
|
|
452
|
+
</FormItem>
|
|
453
|
+
</Form>
|
|
454
|
+
`;
|
|
455
|
+
Form = Form;
|
|
456
|
+
FormItem = FormItem;
|
|
457
|
+
Select = Select;
|
|
458
|
+
}
|
|
459
|
+
const [instance, element] = mount(Demo);
|
|
460
|
+
|
|
461
|
+
await wait(500);
|
|
462
|
+
expect(element.querySelector('.k-form-error')).to.be.null;
|
|
463
|
+
});
|
|
443
464
|
});
|
|
@@ -86,7 +86,7 @@ export function makeItemStyles() {
|
|
|
86
86
|
&.k-invalid {
|
|
87
87
|
// input
|
|
88
88
|
.k-input {
|
|
89
|
-
.k-input-
|
|
89
|
+
.k-input-wrapper {
|
|
90
90
|
border: ${form.item.invalidBorder};
|
|
91
91
|
position: relative;
|
|
92
92
|
z-index: 1
|
|
@@ -98,7 +98,7 @@ export function makeItemStyles() {
|
|
|
98
98
|
.k-radio-wrapper {
|
|
99
99
|
border: ${form.item.invalidBorder} !important;
|
|
100
100
|
}
|
|
101
|
-
.k-select .k-input .k-input-
|
|
101
|
+
.k-select .k-input .k-input-wrapper {
|
|
102
102
|
border: none;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -6,20 +6,25 @@ order: 3
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
```vdt
|
|
9
|
-
import {Icon} from 'kpc';
|
|
9
|
+
import {Icon, Input} from 'kpc';
|
|
10
10
|
|
|
11
|
-
<div
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
<div>
|
|
12
|
+
<Input v-model="keywords" placeholder="Search icon" clearable />
|
|
13
|
+
<div class="icons">
|
|
14
|
+
<div class="icon" v-for={this.filter()}>
|
|
15
|
+
<Icon
|
|
16
|
+
class={'k-icon-' + $value[0]}
|
|
17
|
+
size="large"
|
|
18
|
+
/>
|
|
19
|
+
<div>{'k-icon-' + $value[0]}</div>
|
|
20
|
+
</div>
|
|
18
21
|
</div>
|
|
19
22
|
</div>
|
|
20
23
|
```
|
|
21
24
|
|
|
22
25
|
```styl
|
|
26
|
+
.k-input
|
|
27
|
+
margin-bottom 16px
|
|
23
28
|
.icons
|
|
24
29
|
display flex
|
|
25
30
|
flex-wrap wrap
|
|
@@ -30,100 +35,128 @@ import {Icon} from 'kpc';
|
|
|
30
35
|
```
|
|
31
36
|
|
|
32
37
|
```ts
|
|
33
|
-
|
|
38
|
+
interface Props {
|
|
39
|
+
keywords?: string
|
|
40
|
+
fonts: string[][]
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default class extends Component<Props> {
|
|
34
44
|
static template = template;
|
|
35
45
|
|
|
36
46
|
static defaults() {
|
|
37
47
|
return {
|
|
48
|
+
keywords: '',
|
|
38
49
|
fonts: [
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
]
|
|
126
|
-
}
|
|
50
|
+
["information-fill"],
|
|
51
|
+
["warning-fill"],
|
|
52
|
+
["success-fill"],
|
|
53
|
+
["error-fill"],
|
|
54
|
+
["question-fill"],
|
|
55
|
+
["heart-fill"],
|
|
56
|
+
['heart'],
|
|
57
|
+
['notification-fill'],
|
|
58
|
+
['notification'],
|
|
59
|
+
["information"],
|
|
60
|
+
["alert"],
|
|
61
|
+
["question"],
|
|
62
|
+
["zoom-in"],
|
|
63
|
+
["zoom-out"],
|
|
64
|
+
["close-outline"],
|
|
65
|
+
["check-outline"],
|
|
66
|
+
["time"],
|
|
67
|
+
['right-circled', 'arrow'],
|
|
68
|
+
['down-circled', 'arrow'],
|
|
69
|
+
['right-circled', 'arrow'],
|
|
70
|
+
['up-circled', 'arrow'],
|
|
71
|
+
['right-squared', 'arrow'],
|
|
72
|
+
['down-squared', 'arrow'],
|
|
73
|
+
['left-squared', 'arrow'],
|
|
74
|
+
['up-squared', 'arrow'],
|
|
75
|
+
['right', 'arrow'],
|
|
76
|
+
['down', 'arrow'],
|
|
77
|
+
['left', 'arrow'],
|
|
78
|
+
['up', 'arrow'],
|
|
79
|
+
['right-bold', 'arrow'],
|
|
80
|
+
['down-bold', 'arrow'],
|
|
81
|
+
['left-bold', 'arrow'],
|
|
82
|
+
['up-bold', 'arrow'],
|
|
83
|
+
['sort'],
|
|
84
|
+
['sort-bold'],
|
|
85
|
+
['close'],
|
|
86
|
+
['close-bold'],
|
|
87
|
+
['check'],
|
|
88
|
+
['check-bold'],
|
|
89
|
+
['add'],
|
|
90
|
+
['add-bold'],
|
|
91
|
+
['minus'],
|
|
92
|
+
['minus-bold'],
|
|
93
|
+
['share'],
|
|
94
|
+
['tag'],
|
|
95
|
+
['clone'],
|
|
96
|
+
['cloud'],
|
|
97
|
+
['pin'],
|
|
98
|
+
['home'],
|
|
99
|
+
['cut'],
|
|
100
|
+
['server'],
|
|
101
|
+
['internet'],
|
|
102
|
+
['mail'],
|
|
103
|
+
['paper'],
|
|
104
|
+
['phone'],
|
|
105
|
+
['panel'],
|
|
106
|
+
['alarm'],
|
|
107
|
+
['earphone'],
|
|
108
|
+
['settings-horizontal'],
|
|
109
|
+
['settings-vertical'],
|
|
110
|
+
['settings'],
|
|
111
|
+
['message'],
|
|
112
|
+
['return-right'],
|
|
113
|
+
['picture'],
|
|
114
|
+
['logout'],
|
|
115
|
+
['all'],
|
|
116
|
+
['drag'],
|
|
117
|
+
['more'],
|
|
118
|
+
['more-circled'],
|
|
119
|
+
['folder'],
|
|
120
|
+
['folder-open'],
|
|
121
|
+
['lock'],
|
|
122
|
+
['unlock'],
|
|
123
|
+
['user'],
|
|
124
|
+
['users'],
|
|
125
|
+
['edit'],
|
|
126
|
+
['location'],
|
|
127
|
+
['delete'],
|
|
128
|
+
['calendar'],
|
|
129
|
+
['search'],
|
|
130
|
+
['batchsearch'],
|
|
131
|
+
['hidden'],
|
|
132
|
+
['visible'],
|
|
133
|
+
['refresh'],
|
|
134
|
+
['upload'],
|
|
135
|
+
['download'],
|
|
136
|
+
],
|
|
137
|
+
} as Props
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
init() {
|
|
141
|
+
const fonts = this.get('fonts');
|
|
142
|
+
const map: Record<string, boolean> = {};
|
|
143
|
+
fonts.forEach(([font]) => {
|
|
144
|
+
if (map[font]) {
|
|
145
|
+
console.log('duplicated', font);
|
|
146
|
+
}
|
|
147
|
+
map[font] = true;
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
filter() {
|
|
152
|
+
const keywords = this.get('keywords')!.trim().toLowerCase();
|
|
153
|
+
const fonts = this.get('fonts');
|
|
154
|
+
|
|
155
|
+
if (!keywords) return fonts;
|
|
156
|
+
|
|
157
|
+
return fonts.filter((font) => {
|
|
158
|
+
return font[0].includes(keywords) || font[1] && font[1].includes(keywords);
|
|
159
|
+
});
|
|
127
160
|
}
|
|
128
161
|
}
|
|
129
162
|
```
|
|
@@ -57,9 +57,13 @@ export default function makeStyles(color?: string) {
|
|
|
57
57
|
animation: ${rotate} 1s infinite linear;
|
|
58
58
|
}
|
|
59
59
|
&:before {
|
|
60
|
-
position: relative;
|
|
61
60
|
font-size: inherit;
|
|
62
|
-
|
|
61
|
+
/**
|
|
62
|
+
* FIXME: Why add bellow two styles?
|
|
63
|
+
* https://github.com/ksc-fe/kpc/issues/876
|
|
64
|
+
*/
|
|
65
|
+
// position: relative;
|
|
66
|
+
// z-index: 1;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
// hoverable
|
|
@@ -13,6 +13,7 @@ import {Input, Button, Icon} from 'kpc';
|
|
|
13
13
|
<b:prepend>http://</b:prepend>
|
|
14
14
|
<b:append>.com</b:append>
|
|
15
15
|
</Input>
|
|
16
|
+
<br />
|
|
16
17
|
<Input placeholder="please enter">
|
|
17
18
|
<b:append>
|
|
18
19
|
<Button icon type="none">
|
|
@@ -20,6 +21,7 @@ import {Input, Button, Icon} from 'kpc';
|
|
|
20
21
|
</Button>
|
|
21
22
|
</b:append>
|
|
22
23
|
</Input>
|
|
24
|
+
<br />
|
|
23
25
|
<Input placeholder="please enter">
|
|
24
26
|
<b:append>
|
|
25
27
|
<Button icon type="primary">
|
|
@@ -27,18 +29,21 @@ import {Input, Button, Icon} from 'kpc';
|
|
|
27
29
|
</Button>
|
|
28
30
|
</b:append>
|
|
29
31
|
</Input>
|
|
32
|
+
<br />
|
|
30
33
|
<Input placeholder="please enter">
|
|
31
34
|
<b:append><Button type="primary">搜索</Button></b:append>
|
|
32
35
|
</Input>
|
|
36
|
+
<br />
|
|
33
37
|
<Input placeholder="please enter">
|
|
34
38
|
<b:prefix><Icon class="k-icon-internet" /></b:prefix>
|
|
35
|
-
<b:suffix><Icon class="
|
|
39
|
+
<b:suffix><Icon class="k-icon-search" hoverable /></b:suffix>
|
|
36
40
|
</Input>
|
|
41
|
+
<br />
|
|
37
42
|
<Input placeholder="please enter">
|
|
38
43
|
<b:prepend>http://</b:prepend>
|
|
39
44
|
<b:append>.com</b:append>
|
|
40
45
|
<b:prefix><Icon class="k-icon-internet" /></b:prefix>
|
|
41
|
-
<b:suffix><Icon class="
|
|
46
|
+
<b:suffix><Icon class="k-icon-search" hoverable /></b:suffix>
|
|
42
47
|
</Input>
|
|
43
48
|
</div>
|
|
44
49
|
```
|
|
@@ -14,11 +14,11 @@ import {Input, Icon} from 'kpc';
|
|
|
14
14
|
<Input value="disabled" clearable disabled />
|
|
15
15
|
<br />
|
|
16
16
|
<Input clearable placeholder="please enter">
|
|
17
|
-
<b:suffix><Icon class="
|
|
17
|
+
<b:suffix><Icon class="k-icon-search" hoverable /></b:suffix>
|
|
18
18
|
</Input>
|
|
19
19
|
<br />
|
|
20
20
|
<Input clearable stackClearIcon placeholder="please enter">
|
|
21
|
-
<b:suffix><Icon class="
|
|
21
|
+
<b:suffix><Icon class="k-icon-search" hoverable /></b:suffix>
|
|
22
22
|
</Input>
|
|
23
23
|
</div>
|
|
24
24
|
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 展示提示数字
|
|
3
|
+
order: 11
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
添加`showCount`属性,展示字符长度提示数字
|
|
7
|
+
|
|
8
|
+
```vdt
|
|
9
|
+
import {Input} from 'kpc';
|
|
10
|
+
|
|
11
|
+
<div>
|
|
12
|
+
<Input placeholder="Please enter" showCount />
|
|
13
|
+
<br /><br />
|
|
14
|
+
<Input placeholder="Please enter" showCount maxlength="10" />
|
|
15
|
+
<br /><br />
|
|
16
|
+
<Input type="textarea" placeholder="please enter" showCount maxlength="100" />
|
|
17
|
+
</div>
|
|
18
|
+
```
|
|
@@ -6,8 +6,7 @@ order: 2
|
|
|
6
6
|
添加`size`属性,定义如下尺寸:`large`, `default`,`small`,`mini`
|
|
7
7
|
|
|
8
8
|
```vdt
|
|
9
|
-
import {Input} from 'kpc';
|
|
10
|
-
import {Button} from 'kpc';
|
|
9
|
+
import {Input, Button, Icon} from 'kpc';
|
|
11
10
|
|
|
12
11
|
<div>
|
|
13
12
|
<Input size="large" value="large" />
|
|
@@ -15,18 +14,21 @@ import {Button} from 'kpc';
|
|
|
15
14
|
<Input value="default" />
|
|
16
15
|
<br />
|
|
17
16
|
<Input value="small" size="small" />
|
|
17
|
+
<br />
|
|
18
18
|
<Input size="small" placeholder="please enter">
|
|
19
19
|
<b:prepend>http://</b:prepend>
|
|
20
20
|
<b:append>.com</b:append>
|
|
21
21
|
</Input>
|
|
22
|
+
<br />
|
|
22
23
|
<Input size="small" placeholder="please enter">
|
|
23
24
|
<b:prefix><i class="ion-earth"></i></b:prefix>
|
|
24
|
-
<b:append><Button size="small" icon type="primary"><
|
|
25
|
+
<b:append><Button size="small" icon type="primary"><Icon class="k-icon k-icon-search" size="small" /></Button></b:append>
|
|
25
26
|
</Input>
|
|
27
|
+
<br />
|
|
26
28
|
<Input size="small" placeholder="please enter" clearable>
|
|
27
29
|
<b:append><Button type="primary" size="small">Search</Button></b:append>
|
|
28
30
|
</Input>
|
|
29
|
-
|
|
31
|
+
<br />
|
|
30
32
|
<Input value="mini" size="mini" />
|
|
31
33
|
</div>
|
|
32
34
|
```
|
|
@@ -29,6 +29,7 @@ sidebar: doc
|
|
|
29
29
|
| inline | 是否展示内联模式 | `boolean` | `flase` |
|
|
30
30
|
| resize | 指定textarea输入框拖动调整大小的方向,默认只能垂直方向调整 | `"none"` | `"vertical"` | `"horizontal"` | `"both"`' | `"vertical"` |
|
|
31
31
|
| flat | 是否展示扁平样式 | `boolean` | `false` |
|
|
32
|
+
| showCount | 是否展示字符长度提示数字 | `boolean` | `false` |
|
|
32
33
|
|
|
33
34
|
## Search
|
|
34
35
|
|