@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
|
@@ -11,7 +11,8 @@ import {Button} from 'kpc';
|
|
|
11
11
|
<div>
|
|
12
12
|
<Button disabled>disabled</Button>
|
|
13
13
|
<Button disabled type="none">disabled text</Button>
|
|
14
|
-
<Button disabled icon circle><i class="k-icon
|
|
14
|
+
<Button disabled icon circle><i class="k-icon k-icon-search"></i></Button>
|
|
15
15
|
<Button disabled type="link">link</Button>
|
|
16
|
+
<Button disabled type="flat">flat</Button>
|
|
16
17
|
</div>
|
|
17
18
|
```
|
|
@@ -27,10 +27,10 @@ import {Button, ButtonGroup} from 'kpc';
|
|
|
27
27
|
</ButtonGroup>
|
|
28
28
|
<ButtonGroup>
|
|
29
29
|
<Button type="primary">
|
|
30
|
-
<i class="k-icon
|
|
30
|
+
<i class="k-icon k-icon-left"></i>上一页
|
|
31
31
|
</Button>
|
|
32
32
|
<Button type="primary">
|
|
33
|
-
下一页<i class="k-icon
|
|
33
|
+
下一页<i class="k-icon k-icon-right"></i>
|
|
34
34
|
</Button>
|
|
35
35
|
</ButtonGroup>
|
|
36
36
|
<br /><br />
|
|
@@ -61,6 +61,13 @@ import {Button, ButtonGroup} from 'kpc';
|
|
|
61
61
|
<Button value="guangzhou" size="small">广州</Button>
|
|
62
62
|
<Button value="shenzhen" size="small">深圳</Button>
|
|
63
63
|
</ButtonGroup>
|
|
64
|
+
<p>有间隔的按钮组</p>
|
|
65
|
+
<ButtonGroup checkType="radio" v-model="city" seperate>
|
|
66
|
+
<Button value="beijing">北京</Button>
|
|
67
|
+
<Button value="shanghai">上海</Button>
|
|
68
|
+
<Button value="guangzhou">广州</Button>
|
|
69
|
+
<Button value="shenzhen">深圳</Button>
|
|
70
|
+
</ButtonGroup>
|
|
64
71
|
</div>
|
|
65
72
|
```
|
|
66
73
|
|
|
@@ -11,13 +11,13 @@ order: 1
|
|
|
11
11
|
import {Button, Icon} from 'kpc';
|
|
12
12
|
|
|
13
13
|
<div>
|
|
14
|
-
<Button icon><Icon class="
|
|
15
|
-
<Button icon circle><Icon class="
|
|
16
|
-
<Button icon circle type="none"><Icon class="
|
|
17
|
-
<Button icon circle type="flat"><Icon class="
|
|
18
|
-
<Button type="danger" size="large" icon circle><Icon class="
|
|
19
|
-
<Button type="primary"><Icon class="
|
|
20
|
-
<Button circle type='primary'><Icon class="
|
|
14
|
+
<Button icon><Icon class="k-icon-search" /></Button>
|
|
15
|
+
<Button icon circle><Icon class="k-icon-search" /></Button>
|
|
16
|
+
<Button icon circle type="none"><Icon class="k-icon-search" /></Button>
|
|
17
|
+
<Button icon circle type="flat"><Icon class="k-icon-search" /></Button>
|
|
18
|
+
<Button type="danger" size="large" icon circle><Icon class="k-icon-search" size="large" /></Button>
|
|
19
|
+
<Button type="primary"><Icon class="k-icon-search" size="small" />搜索</Button>
|
|
20
|
+
<Button circle type='primary'><Icon class="k-icon-search" size="small" />搜索</Button>
|
|
21
21
|
</div>
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -13,7 +13,7 @@ import {Button, Icon} from 'kpc';
|
|
|
13
13
|
|
|
14
14
|
<div>
|
|
15
15
|
<Button type="primary" loading>确认</Button>
|
|
16
|
-
<Button icon circle loading><i class="k-icon
|
|
16
|
+
<Button icon circle loading><i class="k-icon k-icon-search"></i></Button>
|
|
17
17
|
<br /> <br />
|
|
18
18
|
<Button type="primary"
|
|
19
19
|
loading={this.get('loading1')}
|
|
@@ -22,15 +22,15 @@ import {Button, Icon} from 'kpc';
|
|
|
22
22
|
<Button type="primary"
|
|
23
23
|
loading={this.get('loading2')}
|
|
24
24
|
ev-click={this.onClick.bind(this, 'loading2')}
|
|
25
|
-
><Icon class="
|
|
25
|
+
><Icon class="k-icon-search" />点击加载</Button>
|
|
26
26
|
<Button icon circle
|
|
27
27
|
loading={this.get('loading3')}
|
|
28
28
|
ev-click={this.onClick.bind(this, 'loading3')}
|
|
29
|
-
><Icon class="
|
|
29
|
+
><Icon class="k-icon-search" /></Button>
|
|
30
30
|
<Button type="primary"
|
|
31
31
|
loading={this.get('loading4')}
|
|
32
32
|
ev-click={this.onClick.bind(this, 'loading4')}
|
|
33
|
-
>图标在右侧<Icon class="
|
|
33
|
+
>图标在右侧<Icon class="k-icon-search" /></Button>
|
|
34
34
|
</div>
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -14,10 +14,10 @@ import {Button, Icon} from 'kpc';
|
|
|
14
14
|
<Button size="small">small</Button>
|
|
15
15
|
<Button size="mini">mini</Button>
|
|
16
16
|
<br /><br />
|
|
17
|
-
<Button icon circle size="large"><Icon class="
|
|
18
|
-
<Button icon circle><Icon class="
|
|
19
|
-
<Button icon circle size="small"><Icon class="
|
|
20
|
-
<Button icon circle size="mini"><Icon class="
|
|
17
|
+
<Button icon circle size="large"><Icon class="k-icon-search" size="large" /></Button>
|
|
18
|
+
<Button icon circle><Icon class="k-icon-search" /></Button>
|
|
19
|
+
<Button icon circle size="small"><Icon class="k-icon-search" size="small" /></Button>
|
|
20
|
+
<Button icon circle size="mini"><Icon class="k-icon-search" size="mini" /></Button>
|
|
21
21
|
</div>
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -8,13 +8,15 @@ export interface ButtonGroupProps {
|
|
|
8
8
|
value?: any
|
|
9
9
|
checkType?: 'none' | 'radio' | 'checkbox'
|
|
10
10
|
fluid?: boolean
|
|
11
|
+
seperate?: boolean
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
const typeDefs: Required<TypeDefs<ButtonGroupProps>> = {
|
|
14
15
|
vertical: Boolean,
|
|
15
16
|
value: null,
|
|
16
17
|
fluid: Boolean,
|
|
17
|
-
checkType: ['none', 'radio', 'checkbox']
|
|
18
|
+
checkType: ['none', 'radio', 'checkbox'],
|
|
19
|
+
seperate: Boolean,
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
const defaults = (): Partial<ButtonGroupProps> => ({
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {getRestProps} from '../utils';
|
|
2
2
|
import {makeButtonGroupStyles} from './styles';
|
|
3
3
|
|
|
4
|
-
const {className, vertical, children, fluid} = this.get();
|
|
4
|
+
const {className, vertical, children, fluid, seperate} = this.get();
|
|
5
5
|
|
|
6
6
|
const classNameObj = {
|
|
7
7
|
'k-btns': true,
|
|
8
8
|
'k-vertical': vertical,
|
|
9
9
|
'k-fluid': fluid,
|
|
10
|
+
'k-seperate': seperate,
|
|
10
11
|
[className]: className,
|
|
11
12
|
[makeButtonGroupStyles()]: true,
|
|
12
13
|
};
|
|
@@ -32,6 +32,7 @@ sidebar: doc
|
|
|
32
32
|
| checkType | 指定按钮组为单选或复选类型,此时需要给每个按钮指定`value`来作为选中的值 | `"radio"` | `"checkbox"` | `"none"` | `"none"` |
|
|
33
33
|
| value | 对于`radio`和`checkbox`类型按钮组,该值表示选中的按钮的值,可以使用`v-model`进行双向绑定 | `*` | `undefined` |
|
|
34
34
|
| fluid | 是否宽度100% | `boolean` | `false` |
|
|
35
|
+
| seperate | 是否展示间隔 | `boolean` | `false` |
|
|
35
36
|
|
|
36
37
|
# 方法
|
|
37
38
|
|
|
@@ -67,7 +67,7 @@ const typeStyles = theme[type];
|
|
|
67
67
|
const waveColor = typeStyles && typeStyles.borderColor || theme.primary.borderColor;
|
|
68
68
|
|
|
69
69
|
<Wave disabled={loading || disabled || type === 'none' || type === 'link'}
|
|
70
|
-
inset=
|
|
70
|
+
inset={type === 'flat' ? '-1px' : '-2px'}
|
|
71
71
|
color={waveColor}
|
|
72
72
|
>
|
|
73
73
|
<DynamicButton
|
|
@@ -29,10 +29,10 @@ export const types = ['primary', 'warning', 'danger', 'active', 'success'] as co
|
|
|
29
29
|
const sizes = ['large', 'small', 'mini'] as const;
|
|
30
30
|
|
|
31
31
|
const btnStyles = {
|
|
32
|
-
get color() { return theme.color.
|
|
32
|
+
get color() { return theme.color.text },
|
|
33
33
|
bgColor: '#fff',
|
|
34
34
|
lineHeight: '1.15',
|
|
35
|
-
get padding() { return `0
|
|
35
|
+
get padding() { return `0 16px` },
|
|
36
36
|
get borderColor() { return theme.color.border },
|
|
37
37
|
get borderRadius() { return theme.borderRadius },
|
|
38
38
|
get fontSize() { return theme.default.fontSize },
|
|
@@ -97,6 +97,11 @@ const btnSizeStyles = sizes.reduce((memo, size) => {
|
|
|
97
97
|
get height() { return theme[size].height },
|
|
98
98
|
get padding() { return `0 ${theme[size].padding}` },
|
|
99
99
|
};
|
|
100
|
+
if (size === 'large') {
|
|
101
|
+
Object.defineProperty(memo[size], 'padding', {
|
|
102
|
+
value: `0 24px`,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
100
105
|
|
|
101
106
|
return memo;
|
|
102
107
|
}, {} as {[key in Sizes]: SizeStyles});
|
|
@@ -114,7 +119,8 @@ const defaults = deepDefaults(
|
|
|
114
119
|
link: {
|
|
115
120
|
get color() { return theme.color.link },
|
|
116
121
|
get hoverColor() { return theme.color.linkHover },
|
|
117
|
-
|
|
122
|
+
hoverBgColor: 'transparent',
|
|
123
|
+
// get hoverBgColor() { return theme.color.hoverBg },
|
|
118
124
|
},
|
|
119
125
|
|
|
120
126
|
none: {
|
|
@@ -234,16 +240,6 @@ export function makeButtonStyles({iconSide}: {iconSide?: string}) {
|
|
|
234
240
|
}
|
|
235
241
|
}
|
|
236
242
|
|
|
237
|
-
// disabled
|
|
238
|
-
&.k-disabled {
|
|
239
|
-
&, &:hover {
|
|
240
|
-
color: ${button.disabled.color};
|
|
241
|
-
background: ${button.disabled.bgColor};
|
|
242
|
-
border-color: ${button.disabled.borderColor};
|
|
243
|
-
cursor: not-allowed
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
243
|
&.k-none,
|
|
248
244
|
&.k-link,
|
|
249
245
|
&.k-flat {
|
|
@@ -258,11 +254,26 @@ export function makeButtonStyles({iconSide}: {iconSide?: string}) {
|
|
|
258
254
|
&.k-none:hover {
|
|
259
255
|
background: ${button.none.hoverBgColor};
|
|
260
256
|
}
|
|
261
|
-
|
|
262
257
|
&.k-flat {
|
|
263
258
|
background: ${button.none.hoverBgColor};
|
|
264
259
|
}
|
|
265
260
|
|
|
261
|
+
// disabled
|
|
262
|
+
&.k-disabled {
|
|
263
|
+
&, &:hover {
|
|
264
|
+
color: ${button.disabled.color};
|
|
265
|
+
background: ${button.disabled.bgColor};
|
|
266
|
+
border-color: ${button.disabled.borderColor};
|
|
267
|
+
cursor: not-allowed
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
&.k-none.k-disabled,
|
|
271
|
+
&.k-link.k-disabled {
|
|
272
|
+
&, &:hover {
|
|
273
|
+
background: transparent;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
266
277
|
${sizes.map(size => {
|
|
267
278
|
const styles = button[size];
|
|
268
279
|
|
|
@@ -406,7 +417,9 @@ export function makeButtonStyles({iconSide}: {iconSide?: string}) {
|
|
|
406
417
|
|
|
407
418
|
export function makeButtonGroupStyles() {
|
|
408
419
|
return css`
|
|
409
|
-
display: inline-
|
|
420
|
+
display: inline-flex;
|
|
421
|
+
align-items: center;
|
|
422
|
+
flex-wrap: wrap;
|
|
410
423
|
vertical-align: middle;
|
|
411
424
|
.k-btn {
|
|
412
425
|
margin: 0;
|
|
@@ -464,8 +477,8 @@ export function makeButtonGroupStyles() {
|
|
|
464
477
|
|
|
465
478
|
// vertical
|
|
466
479
|
&.k-vertical {
|
|
480
|
+
flex-direction: column;
|
|
467
481
|
> .k-btn {
|
|
468
|
-
display: block;
|
|
469
482
|
&:not(.k-btn-icon) {
|
|
470
483
|
width: 100%;
|
|
471
484
|
}
|
|
@@ -497,5 +510,13 @@ export function makeButtonGroupStyles() {
|
|
|
497
510
|
})}
|
|
498
511
|
}
|
|
499
512
|
}
|
|
513
|
+
|
|
514
|
+
// seperate
|
|
515
|
+
&.k-seperate {
|
|
516
|
+
gap: 8px;
|
|
517
|
+
> .k-btn {
|
|
518
|
+
border-radius: ${button.borderRadius} !important;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
500
521
|
`;
|
|
501
522
|
}
|
|
@@ -36,12 +36,12 @@ const {stop, play} = this.autoplay;
|
|
|
36
36
|
<Button icon circle type="none" size="large" class="k-carousel-btn k-prev"
|
|
37
37
|
ev-click={this.prev}
|
|
38
38
|
>
|
|
39
|
-
<Icon class="
|
|
39
|
+
<Icon class="k-icon-left" />
|
|
40
40
|
</Button>
|
|
41
41
|
<Button icon circle type="none" size="large" class="k-carousel-btn k-next"
|
|
42
42
|
ev-click={this.next}
|
|
43
43
|
>
|
|
44
|
-
<Icon class="
|
|
44
|
+
<Icon class="k-icon-right" />
|
|
45
45
|
</Button>
|
|
46
46
|
<div class="k-carousel-indicator c-clearfix">
|
|
47
47
|
<div v-for={getItems()}
|
|
@@ -26,11 +26,11 @@ const defaults = {
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
inner: {
|
|
29
|
-
width: '
|
|
29
|
+
width: '6px',
|
|
30
30
|
height: '10px',
|
|
31
31
|
top: '0px',
|
|
32
|
-
left: '
|
|
33
|
-
border: '
|
|
32
|
+
left: '4px',
|
|
33
|
+
border: '2px solid #fff',
|
|
34
34
|
},
|
|
35
35
|
|
|
36
36
|
// disabled
|
|
@@ -48,11 +48,6 @@ const defaults = {
|
|
|
48
48
|
},
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
|
|
52
|
-
// indeterminate
|
|
53
|
-
indeterminate: {
|
|
54
|
-
innerLeft: '4px',
|
|
55
|
-
}
|
|
56
51
|
};
|
|
57
52
|
|
|
58
53
|
let checkbox: typeof defaults;
|
|
@@ -91,7 +86,9 @@ export default function makeStyles() {
|
|
|
91
86
|
transform: rotate(45deg) scale(0);
|
|
92
87
|
transition: all ${checkbox.transition};
|
|
93
88
|
}
|
|
94
|
-
|
|
89
|
+
}
|
|
90
|
+
&:hover {
|
|
91
|
+
.k-checkbox-wrapper {
|
|
95
92
|
border: ${checkbox.hoverBorder}
|
|
96
93
|
}
|
|
97
94
|
}
|
|
@@ -125,7 +122,6 @@ export default function makeStyles() {
|
|
|
125
122
|
&:before {
|
|
126
123
|
transform: rotate(90deg) scale(1);
|
|
127
124
|
border-bottom: 0;
|
|
128
|
-
left: ${checkbox.indeterminate.innerLeft};
|
|
129
125
|
}
|
|
130
126
|
}
|
|
131
127
|
|
|
@@ -21,7 +21,7 @@ const classNameObj = {
|
|
|
21
21
|
<div class={classNameObj} {...getRestProps(this)}>
|
|
22
22
|
<div class={kls('title')} ev-click={this.toggle}>
|
|
23
23
|
<b:title>{title}</b:title>
|
|
24
|
-
<Icon class={{[kls('arrow')]: true, '
|
|
24
|
+
<Icon class={{[kls('arrow')]: true, 'k-icon-right': true}} hoverable={!disabled}></Icon>
|
|
25
25
|
</div>
|
|
26
26
|
<Transition
|
|
27
27
|
show={isActive}
|
|
@@ -35,7 +35,6 @@ export function makeStyles() {
|
|
|
35
35
|
.${kls('arrow')} {
|
|
36
36
|
float: left;
|
|
37
37
|
margin-right: ${collapse.titleMarginRight};
|
|
38
|
-
transform-origin: center center 0;
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
|
|
@@ -69,7 +68,6 @@ export function makeItemStyles() {
|
|
|
69
68
|
transition: transform ${collapse.transition};
|
|
70
69
|
line-height: ${collapseItem.titleHeight};
|
|
71
70
|
height: ${collapseItem.titleHeight};
|
|
72
|
-
transform-origin: left center 0;
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
&:not(.k-disabled) {
|
|
@@ -18,6 +18,6 @@ const classNameObj = {
|
|
|
18
18
|
<Virtual ev-click={startCopy} class={classNameObj} {...getRestProps(this)}>
|
|
19
19
|
<template v-if={children}>{children}</template>
|
|
20
20
|
<Icon key="1" v-else-if={!success.value} class="k-icon-clone" hoverable title={_$('复制')} />
|
|
21
|
-
<Icon key="2" v-else class="k-icon-
|
|
21
|
+
<Icon key="2" v-else class="k-icon-check" hoverable color="success" />
|
|
22
22
|
</Virtual>
|
|
23
23
|
</Transition>
|
|
@@ -52,15 +52,15 @@ const {
|
|
|
52
52
|
tagName="div"
|
|
53
53
|
ev-click={isYear ? prevTenYears : prevYear}
|
|
54
54
|
>
|
|
55
|
-
<Icon class="
|
|
56
|
-
<Icon class="
|
|
55
|
+
<Icon class="k-icon-left" size="small" />
|
|
56
|
+
<Icon class="k-icon-left" size="small" />
|
|
57
57
|
</Button>
|
|
58
58
|
<Button icon type="none" size="small" class="k-prev"
|
|
59
59
|
tagName="div"
|
|
60
60
|
ev-click={prevMonth}
|
|
61
61
|
v-if={!isYearOrMonth}
|
|
62
62
|
>
|
|
63
|
-
<Icon class="
|
|
63
|
+
<Icon class="k-icon-left" size="small" />
|
|
64
64
|
</Button>
|
|
65
65
|
</div>
|
|
66
66
|
<div class="k-month-values">
|
|
@@ -80,14 +80,14 @@ const {
|
|
|
80
80
|
ev-click={nextMonth}
|
|
81
81
|
v-if={!isYearOrMonth}
|
|
82
82
|
>
|
|
83
|
-
<Icon class="
|
|
83
|
+
<Icon class="k-icon-right" size="small" />
|
|
84
84
|
</Button>
|
|
85
85
|
<Button icon type="none" size="small" class="k-next"
|
|
86
86
|
tagName="div"
|
|
87
87
|
ev-click={isYear ? nextTenYears : nextYear}
|
|
88
88
|
>
|
|
89
|
-
<Icon class="
|
|
90
|
-
<Icon class="
|
|
89
|
+
<Icon class="k-icon-right" size="small" />
|
|
90
|
+
<Icon class="k-icon-right" size="small" />
|
|
91
91
|
</Button>
|
|
92
92
|
</div>
|
|
93
93
|
</div>
|
|
@@ -18,6 +18,11 @@ import {Datepicker} from 'kpc';
|
|
|
18
18
|
</div>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
```styl
|
|
22
|
+
.k-datepicker
|
|
23
|
+
margin-right 20px
|
|
24
|
+
```
|
|
25
|
+
|
|
21
26
|
```ts
|
|
22
27
|
interface Props {
|
|
23
28
|
datetime1?: string | null
|
|
@@ -35,7 +40,3 @@ export default class extends Component<Props> {
|
|
|
35
40
|
}
|
|
36
41
|
```
|
|
37
42
|
|
|
38
|
-
```styl
|
|
39
|
-
.k-datepicker
|
|
40
|
-
margin-right 20px
|
|
41
|
-
```
|
|
@@ -448,6 +448,16 @@ describe('Datepicker', () => {
|
|
|
448
448
|
content.querySelector<HTMLElement>('.k-btn')!.click();
|
|
449
449
|
await wait();
|
|
450
450
|
expect(instance.get('datetimeRange')).have.lengthOf(1);
|
|
451
|
+
|
|
452
|
+
// select the first value in end panel
|
|
453
|
+
calendar2.querySelectorAll<HTMLElement>('.k-calendar-item')[17].click();
|
|
454
|
+
calendar2.querySelectorAll<HTMLElement>('.k-calendar-item')[17].click();
|
|
455
|
+
await wait();
|
|
456
|
+
content.querySelector<HTMLElement>('.k-btn')!.click();
|
|
457
|
+
await wait();
|
|
458
|
+
const values = instance.get('datetimeRange')!;
|
|
459
|
+
expect(values).have.lengthOf(2);
|
|
460
|
+
expect(values[1][1].includes('23:59:59')).to.be.true;
|
|
451
461
|
});
|
|
452
462
|
});
|
|
453
463
|
|
|
@@ -531,7 +541,7 @@ describe('Datepicker', () => {
|
|
|
531
541
|
await wait();
|
|
532
542
|
const value2 = instance.get('time')!;
|
|
533
543
|
expect(value2).have.lengthOf(2);
|
|
534
|
-
expect(value2.map(item => item.split(' ')[1])).eql(['01:00:00', '
|
|
544
|
+
expect(value2.map(item => item.split(' ')[1])).eql(['01:00:00', '22:59:59']);
|
|
535
545
|
});
|
|
536
546
|
|
|
537
547
|
it('year', async () => {
|
|
@@ -117,6 +117,10 @@ export function makeCalendarStyles() {
|
|
|
117
117
|
display: flex;
|
|
118
118
|
padding: ${datepicker.month.padding};
|
|
119
119
|
}
|
|
120
|
+
.k-prev .k-icon,
|
|
121
|
+
.k-next .k-icon {
|
|
122
|
+
margin: 0 -5px !important;
|
|
123
|
+
}
|
|
120
124
|
.k-month-values {
|
|
121
125
|
flex: 1;
|
|
122
126
|
font-size: 14px;
|
|
@@ -149,10 +153,11 @@ export function makeCalendarStyles() {
|
|
|
149
153
|
align-items: center;
|
|
150
154
|
cursor: pointer;
|
|
151
155
|
position: relative;
|
|
156
|
+
border-radius: ${datepicker.item.borderRadius};
|
|
152
157
|
.k-value {
|
|
153
158
|
border-radius: ${datepicker.item.borderRadius};
|
|
154
159
|
}
|
|
155
|
-
&.k-hover
|
|
160
|
+
&.k-hover {
|
|
156
161
|
background: ${datepicker.item.hoverBgColor};
|
|
157
162
|
}
|
|
158
163
|
&.k-exceed {
|
|
@@ -7,11 +7,12 @@ import {
|
|
|
7
7
|
DayjsValueRange,
|
|
8
8
|
DayjsValue,
|
|
9
9
|
} from './basepicker';
|
|
10
|
-
import {Dayjs} from 'dayjs';
|
|
10
|
+
import dayjs, {Dayjs} from 'dayjs';
|
|
11
11
|
import {Datepicker} from './index';
|
|
12
12
|
import type {useFormats} from './useFormats';
|
|
13
13
|
import type {useDisabled} from './useDisabled';
|
|
14
14
|
import {last} from '../utils';
|
|
15
|
+
import { endTime } from './helpers';
|
|
15
16
|
import {PanelTypes, PanelFlags, usePanel} from './usePanel';
|
|
16
17
|
|
|
17
18
|
export function useValue(
|
|
@@ -50,23 +51,25 @@ export function useValue(
|
|
|
50
51
|
|
|
51
52
|
function onChangeDate(v: Dayjs, flag: PanelFlags) {
|
|
52
53
|
const {multiple, type, range} = instance.get();
|
|
53
|
-
let _value: StateValueItem
|
|
54
|
-
|
|
55
|
-
// the datetime must be greater than minDate, #406
|
|
56
|
-
const minDate = disabled.minDate.value;
|
|
57
|
-
if (minDate && _value.isBefore(minDate)) {
|
|
58
|
-
_value = minDate;
|
|
59
|
-
}
|
|
54
|
+
let _value: StateValueItem;
|
|
60
55
|
|
|
61
56
|
if (range) {
|
|
62
57
|
const oldValue = last(value.value as StateValueRange[]);
|
|
63
58
|
if (!oldValue || oldValue.length === 2) {
|
|
64
|
-
|
|
59
|
+
/**
|
|
60
|
+
* if we select the first value or re-select the value
|
|
61
|
+
* no matter what the flag is, we should set flag to start panel
|
|
62
|
+
* #877
|
|
63
|
+
*/
|
|
64
|
+
flag = PanelFlags.Start;
|
|
65
|
+
_value = [fixDatetimeWithMinDate(v)];
|
|
65
66
|
} else {
|
|
66
|
-
_value = [oldValue[0], v];
|
|
67
|
+
_value = [oldValue[0], fixDatetimeWithMaxDate(v)];
|
|
67
68
|
(_value as DayjsValueRange).sort((a, b) => a.isAfter(b) ? 1 : -1);
|
|
68
69
|
}
|
|
69
70
|
instance.trigger('selecting', _value);
|
|
71
|
+
} else {
|
|
72
|
+
_value = fixDatetimeWithMinDate(v);
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
setValue(_value, false);
|
|
@@ -78,5 +81,27 @@ export function useValue(
|
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
|
|
84
|
+
function fixDatetimeWithMinDate(v: Dayjs) {
|
|
85
|
+
// the datetime must be greater than minDate, #406
|
|
86
|
+
const minDate = disabled.minDate.value;
|
|
87
|
+
if (minDate && v.isBefore(minDate)) {
|
|
88
|
+
return minDate;
|
|
89
|
+
}
|
|
90
|
+
return v;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function fixDatetimeWithMaxDate(v: Dayjs) {
|
|
94
|
+
// the tiem of end datetime should be set to 23:59:59, #878
|
|
95
|
+
const maxDate = disabled.maxDate.value;
|
|
96
|
+
const date = v.toDate();
|
|
97
|
+
|
|
98
|
+
endTime(date);
|
|
99
|
+
v = dayjs(date);
|
|
100
|
+
if (maxDate && v.isAfter(maxDate)) {
|
|
101
|
+
return maxDate;
|
|
102
|
+
}
|
|
103
|
+
return v;
|
|
104
|
+
}
|
|
105
|
+
|
|
81
106
|
return {value, setValue, onChangeDate, ...rest};
|
|
82
107
|
}
|
|
@@ -16,7 +16,7 @@ import {Dropdown, DropdownMenu, DropdownItem, Button, Icon} from 'kpc';
|
|
|
16
16
|
<div>
|
|
17
17
|
<Dropdown>
|
|
18
18
|
<Button type="primary">
|
|
19
|
-
hover <Icon class="
|
|
19
|
+
hover <Icon class="k-icon-down" />
|
|
20
20
|
</Button>
|
|
21
21
|
<DropdownMenu>
|
|
22
22
|
<DropdownItem>item 1</DropdownItem>
|