@king-design/intact 3.0.0-beta.2 → 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/group.md +7 -0
- 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 +18 -3
- package/components/checkbox/styles.ts +6 -10
- package/components/collapse/styles.ts +0 -2
- package/components/dropdown/dropdown.ts +1 -0
- package/components/form/index.spec.ts +21 -0
- package/components/icon/index.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/styles.ts +1 -4
- package/components/popover/styles.ts +1 -1
- package/components/radio/styles.ts +4 -1
- package/components/scrollSelect/styles.ts +1 -1
- package/components/select/base.vdt +7 -4
- package/components/select/styles.ts +1 -1
- package/components/switch/styles.ts +17 -1
- package/components/table/column.vdt +3 -2
- package/components/table/demos/showIndeterminate.md +2 -2
- package/components/table/index.md +1 -1
- package/components/table/styles.ts +1 -0
- package/components/table/table.ts +1 -0
- package/components/table/useGroup.ts +2 -1
- package/components/tabs/demos/closable.md +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/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.js +11 -4
- package/es/components/checkbox/styles.js +4 -8
- package/es/components/collapse/styles.js +2 -2
- package/es/components/dropdown/dropdown.js +2 -1
- package/es/components/form/index.spec.js +45 -0
- package/es/components/icon/index.vdt.js +3 -2
- package/es/components/message/message.js +1 -1
- package/es/components/pagination/styles.js +2 -5
- package/es/components/popover/styles.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 +4 -1
- package/es/components/select/styles.js +1 -1
- package/es/components/switch/styles.js +10 -2
- package/es/components/table/column.vdt.js +4 -2
- package/es/components/table/styles.js +1 -1
- package/es/components/table/table.js +2 -1
- package/es/components/table/useGroup.d.ts +1 -1
- package/es/components/table/useGroup.js +2 -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/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/button/demos/group/react.js +17 -0
- 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/table/demos/showIndeterminate/react.js +1 -1
- package/es/site/data/components/tabs/demos/closable/react.js +2 -1
- package/es/site/src/pages/layout.js +1 -3
- package/es/styles/fonts/iconfont.eot +0 -0
- package/es/styles/fonts/iconfont.js +1 -1
- package/es/styles/fonts/iconfont.svg +1 -1
- package/es/styles/fonts/iconfont.ttf +0 -0
- package/es/styles/fonts/iconfont.woff +0 -0
- package/es/styles/theme.js +1 -1
- package/index.ts +2 -2
- package/package.json +2 -2
- package/styles/fonts/demo_index.html +6 -6
- package/styles/fonts/iconfont.css +6 -6
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +1 -1
- package/styles/fonts/iconfont.svg +1 -1
- package/styles/fonts/iconfont.ts +1 -1
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/iconfont.woff2 +0 -0
- package/styles/theme.ts +1 -1
|
@@ -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
|
|
|
@@ -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
|
|
@@ -32,7 +32,7 @@ const btnStyles = {
|
|
|
32
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});
|
|
@@ -412,7 +417,9 @@ export function makeButtonStyles({iconSide}: {iconSide?: string}) {
|
|
|
412
417
|
|
|
413
418
|
export function makeButtonGroupStyles() {
|
|
414
419
|
return css`
|
|
415
|
-
display: inline-
|
|
420
|
+
display: inline-flex;
|
|
421
|
+
align-items: center;
|
|
422
|
+
flex-wrap: wrap;
|
|
416
423
|
vertical-align: middle;
|
|
417
424
|
.k-btn {
|
|
418
425
|
margin: 0;
|
|
@@ -470,8 +477,8 @@ export function makeButtonGroupStyles() {
|
|
|
470
477
|
|
|
471
478
|
// vertical
|
|
472
479
|
&.k-vertical {
|
|
480
|
+
flex-direction: column;
|
|
473
481
|
> .k-btn {
|
|
474
|
-
display: block;
|
|
475
482
|
&:not(.k-btn-icon) {
|
|
476
483
|
width: 100%;
|
|
477
484
|
}
|
|
@@ -503,5 +510,13 @@ export function makeButtonGroupStyles() {
|
|
|
503
510
|
})}
|
|
504
511
|
}
|
|
505
512
|
}
|
|
513
|
+
|
|
514
|
+
// seperate
|
|
515
|
+
&.k-seperate {
|
|
516
|
+
gap: 8px;
|
|
517
|
+
> .k-btn {
|
|
518
|
+
border-radius: ${button.borderRadius} !important;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
506
521
|
`;
|
|
507
522
|
}
|
|
@@ -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
|
|
|
@@ -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) {
|
|
@@ -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
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: 隐藏Icon
|
|
2
|
+
title: 隐藏Icon或展示关闭按钮
|
|
3
3
|
order: 1.1
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -32,7 +32,7 @@ export default class extends Component {
|
|
|
32
32
|
Message[type]({
|
|
33
33
|
content: type,
|
|
34
34
|
duration: 3000,
|
|
35
|
-
closable:
|
|
35
|
+
closable: true,
|
|
36
36
|
hideIcon: true,
|
|
37
37
|
});
|
|
38
38
|
}
|
|
@@ -15,7 +15,7 @@ sidebar: doc
|
|
|
15
15
|
| content | 提示内容 | `string` | `VNode` | `undefined` |
|
|
16
16
|
| duration | 提示展示多长时间后自动关闭,当传入0时,提示将会一直展示。单位ms | `number` | `5000` |
|
|
17
17
|
| type | 提示类型 | `"info"` | `"error"` | `"success"` | `"warning"`|
|
|
18
|
-
| closable | 是否展示关闭按钮 | `boolean` | `
|
|
18
|
+
| closable | 是否展示关闭按钮 | `boolean` | `false` |
|
|
19
19
|
| hideIcon | 是否隐藏文字前面的icon | `boolean` | `false` |
|
|
20
20
|
|
|
21
21
|
# 静态方法
|
|
@@ -32,7 +32,7 @@ const defaults = deepDefaults(
|
|
|
32
32
|
gap: '6px',
|
|
33
33
|
padding: '0 3px',
|
|
34
34
|
get borderRadius() { return theme.borderRadius },
|
|
35
|
-
get hoverBgColor() { return theme.color.hoverBg }
|
|
35
|
+
// get hoverBgColor() { return theme.color.hoverBg }
|
|
36
36
|
},
|
|
37
37
|
// goto
|
|
38
38
|
goto: {
|
|
@@ -82,9 +82,6 @@ export function makeStyles() {
|
|
|
82
82
|
&:last-of-type {
|
|
83
83
|
margin: 0 !important;
|
|
84
84
|
}
|
|
85
|
-
&:hover {
|
|
86
|
-
background: ${pagination.btn.hoverBgColor};
|
|
87
|
-
}
|
|
88
85
|
}
|
|
89
86
|
.k-icon {
|
|
90
87
|
font-size: 18px;
|
|
@@ -67,10 +67,13 @@ export function makeStyles() {
|
|
|
67
67
|
transform: scale(0);
|
|
68
68
|
transition: all ${radio.transition};
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
}
|
|
71
|
+
&:hover {
|
|
72
|
+
.k-radio-wrapper {
|
|
71
73
|
border: 1px solid ${radio.hoverBorderColor};
|
|
72
74
|
}
|
|
73
75
|
}
|
|
76
|
+
|
|
74
77
|
input {
|
|
75
78
|
width: 100%;
|
|
76
79
|
height: 100%;
|
|
@@ -19,7 +19,7 @@ const defaults = {
|
|
|
19
19
|
get color() { return theme.color.text },
|
|
20
20
|
get activeColor() { return theme.color.primary },
|
|
21
21
|
get hoverBgColor() { return theme.color.bg },
|
|
22
|
-
activeFontSize: `1.
|
|
22
|
+
activeFontSize: `1.3em`,
|
|
23
23
|
get disabledColor() { return theme.color.disabled },
|
|
24
24
|
border: `1px solid #e5e5e5`,
|
|
25
25
|
}
|
|
@@ -148,10 +148,13 @@ const filterInput = <Input v-if={filterable}
|
|
|
148
148
|
<span class="k-select-suffix-icon">
|
|
149
149
|
<b:suffix>
|
|
150
150
|
<Icon class="ion-load-c" rotate v-if={loading} />
|
|
151
|
-
<
|
|
152
|
-
class="k-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
<template v-else-if={!hideIcon}>
|
|
152
|
+
<Icon class="k-icon-search" v-if={filterable && show} />
|
|
153
|
+
<Icon v-else
|
|
154
|
+
class="k-select-arrow k-icon-down"
|
|
155
|
+
disabled={$props.isDisableArrow}
|
|
156
|
+
/>
|
|
157
|
+
</template>
|
|
155
158
|
</b:suffix>
|
|
156
159
|
</span>
|
|
157
160
|
</span>
|
|
@@ -11,7 +11,7 @@ type SizeStyles = {
|
|
|
11
11
|
|
|
12
12
|
const defaults = deepDefaults(
|
|
13
13
|
{
|
|
14
|
-
get transition() { return theme.transition.
|
|
14
|
+
get transition() { return theme.transition.large },
|
|
15
15
|
width: `300px`,
|
|
16
16
|
get height() { return theme.default.height },
|
|
17
17
|
bgColor: '#fff',
|
|
@@ -6,6 +6,7 @@ import '../../styles/global';
|
|
|
6
6
|
const defaults = {
|
|
7
7
|
get transition() { return theme.transition.middle },
|
|
8
8
|
get bgColor() { return theme.color.border },
|
|
9
|
+
get hoverBgColor() { return theme.color.placeholder },
|
|
9
10
|
fontSize: `12px`,
|
|
10
11
|
color: '#fff',
|
|
11
12
|
handleBorderRadius: `100%`,
|
|
@@ -16,7 +17,8 @@ const defaults = {
|
|
|
16
17
|
get bgColor() { return theme.color.primary },
|
|
17
18
|
get disabledBgColor() {
|
|
18
19
|
return palette(theme.color.primary, -3);
|
|
19
|
-
}
|
|
20
|
+
},
|
|
21
|
+
get hoverBgColor() { return theme.color.linkHover },
|
|
20
22
|
},
|
|
21
23
|
|
|
22
24
|
// default
|
|
@@ -66,6 +68,7 @@ export function makeStyles() {
|
|
|
66
68
|
user-select: none;
|
|
67
69
|
overflow: hidden;
|
|
68
70
|
box-sizing: content-box;
|
|
71
|
+
transition: background ${kswitch.transition};
|
|
69
72
|
input {
|
|
70
73
|
opacity: 0;
|
|
71
74
|
position: absolute;
|
|
@@ -91,6 +94,13 @@ export function makeStyles() {
|
|
|
91
94
|
background: ${kswitch.bgColor};
|
|
92
95
|
transition: all ${kswitch.transition};
|
|
93
96
|
}
|
|
97
|
+
&:hover {
|
|
98
|
+
&,
|
|
99
|
+
.k-switch-bar,
|
|
100
|
+
.k-switch-wrapper {
|
|
101
|
+
background: ${kswitch.hoverBgColor};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
94
104
|
.k-switch-handle {
|
|
95
105
|
border-radius: ${kswitch.handleBorderRadius};
|
|
96
106
|
background: ${kswitch.handleBgColor};
|
|
@@ -168,6 +178,12 @@ export function makeStyles() {
|
|
|
168
178
|
.k-switch-bar {
|
|
169
179
|
width: 100%;
|
|
170
180
|
}
|
|
181
|
+
&:hover {
|
|
182
|
+
.k-switch-bar,
|
|
183
|
+
.k-switch-wrapper {
|
|
184
|
+
background: ${kswitch.checked.hoverBgColor};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
171
187
|
}
|
|
172
188
|
|
|
173
189
|
// disabled
|
|
@@ -95,9 +95,10 @@ const {
|
|
|
95
95
|
</DropdownItem>
|
|
96
96
|
</div>
|
|
97
97
|
<div class="k-table-group-footer" v-if={multiple}>
|
|
98
|
-
<Button
|
|
98
|
+
<Button size="small"
|
|
99
99
|
disabled={isEmptyValue(localGroupValue.value)}
|
|
100
|
-
|
|
100
|
+
type="secondary"
|
|
101
|
+
ev-click={() => reset(onChange)}
|
|
101
102
|
>重置</Button>
|
|
102
103
|
<Button type="primary" size="small"
|
|
103
104
|
ev-click={() => confirm(onChange)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: 取消表头半选中状态
|
|
3
3
|
order: 28
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ import {Table, TableColumn} from 'kpc';
|
|
|
13
13
|
data={this.get('data')}
|
|
14
14
|
resizable
|
|
15
15
|
ref="__test"
|
|
16
|
-
showIndeterminate={
|
|
16
|
+
showIndeterminate={false}
|
|
17
17
|
checkedKeys={[0]}
|
|
18
18
|
>
|
|
19
19
|
<TableColumn key="a" title="表头1" />
|
|
@@ -37,7 +37,7 @@ sidebar: doc
|
|
|
37
37
|
| tooltipPosition | 行提示的位置 | `"left"` | `"bottom"` | `"right"` | `"top"` | `Position` | `"top"` |
|
|
38
38
|
| tooltipContainer | 指定行提示弹层追加的位置,默认:`Dialog`类型的组件会追加到`Dialog`中,其他会追加到`body`中。你可以传入函数返回一个DOM用来作为插入的容器,或者传入字符串用来给`querySelector`进行查询 | `Container` | `undefined` |
|
|
39
39
|
| keepStatus | 是否在行销毁的时候,保持该行在`checkedKeys` | `selectedKeys` | `spreadKeys` | `expandedKeys`中的`key`值,默认会同步删除(仅在销毁行的时候有效,如果整个`Table`被销毁,则不会执行该逻辑) | `boolean` | `false` |
|
|
40
|
-
| showIndeterminate | 表头的`Checkbox`是否支持展示半选中状态 | `boolean` | `
|
|
40
|
+
| showIndeterminate | 表头的`Checkbox`是否支持展示半选中状态 | `boolean` | `true` |
|
|
41
41
|
| resizable | 是否可以表头拖动 | `boolean` | `false` |
|
|
42
42
|
| minColWidth | 指定所有列拖动时的最小宽度 | `number` | `40` |
|
|
43
43
|
| widthStoreKey | 如果要保存表格拖动后的列宽信息,可以通过该属性设置保存到`localStorage`中的`key` | `string` | `undefined` |
|
|
@@ -30,7 +30,7 @@ import {Tabs, Tab, Button, ButtonGroup, Icon} from 'kpc';
|
|
|
30
30
|
key={$value.value}
|
|
31
31
|
closable={$value.value !== 10}
|
|
32
32
|
>
|
|
33
|
-
<Icon class="k-icon-paper" size={this.get('size')} style="margin-right: 8px;" />
|
|
33
|
+
<Icon class="k-icon-paper" size={this.get('size')} style="margin-right: 8px;" color="inherit" />
|
|
34
34
|
{$value.label}
|
|
35
35
|
</Tab>
|
|
36
36
|
</Tabs>
|
package/components/tip/styles.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {Tooltip} from './';
|
|
|
8
8
|
import {Dialog} from '../dialog';
|
|
9
9
|
import {mount, unmount, dispatchEvent, getElement, wait} from '../../test/utils';
|
|
10
10
|
import { tooltip as tooltipTheme } from './styles';
|
|
11
|
+
import { Select, Option } from '../select';
|
|
11
12
|
|
|
12
13
|
describe('Tooltip', () => {
|
|
13
14
|
afterEach((done) => {
|
|
@@ -378,4 +379,33 @@ describe('Tooltip', () => {
|
|
|
378
379
|
const newWidth = content.offsetWidth;
|
|
379
380
|
expect(newWidth).to.eql(width);
|
|
380
381
|
});
|
|
382
|
+
|
|
383
|
+
it('should not impact select when wrap select with tooltip', async () => {
|
|
384
|
+
class Demo extends Component {
|
|
385
|
+
static template = `
|
|
386
|
+
const {Tooltip, Select, Option} = this;
|
|
387
|
+
<Tooltip>
|
|
388
|
+
<Select>
|
|
389
|
+
<Option value="1">Option 1</Option>
|
|
390
|
+
<Option value="2">Option 2</Option>
|
|
391
|
+
</Select>
|
|
392
|
+
</Tooltip>
|
|
393
|
+
`
|
|
394
|
+
private Tooltip = Tooltip;
|
|
395
|
+
private Select = Select;
|
|
396
|
+
private Option = Option;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const [instance, element] = mount(Demo);
|
|
400
|
+
dispatchEvent(element, 'mouseenter');
|
|
401
|
+
await wait();
|
|
402
|
+
dispatchEvent(element, 'click');
|
|
403
|
+
await wait();
|
|
404
|
+
|
|
405
|
+
const menu = getElement(".k-select-menu")!;
|
|
406
|
+
dispatchEvent(element, 'mouseleave');
|
|
407
|
+
await wait(500);
|
|
408
|
+
|
|
409
|
+
expect(menu.style.display).to.eql('');
|
|
410
|
+
});
|
|
381
411
|
});
|
|
@@ -22,5 +22,5 @@ setDefault(function () {
|
|
|
22
22
|
}).badge;
|
|
23
23
|
});
|
|
24
24
|
export default function makeStyles() {
|
|
25
|
-
return /*#__PURE__*/css("display:inline-block;position:relative;vertical-align:middle;>.k-badge-text{display:inline-block;position:absolute;width:", badge.width, ";height:", badge.height, ";border-radius:50%;top:0;right:0;transform:translate(50%, -50%);background:", badge.bgColor, ";font-size:
|
|
25
|
+
return /*#__PURE__*/css("display:inline-block;position:relative;vertical-align:middle;>.k-badge-text{display:inline-block;position:absolute;width:", badge.width, ";height:", badge.height, ";border-radius:50%;top:0;right:0;transform:translate(50%, -50%);background:", badge.bgColor, ";font-size:85%;vertical-align:baseline;}&.k-has-text>.k-badge-text{width:auto;height:", badge.textHeight, ";line-height:", badge.textHeight, ";border-radius:calc(", badge.textHeight, " / 2);padding:0 ", badge.textPadding, ";color:", badge.textColor, ";}&.k-alone>.k-badge-text{position:static;transform:none;}");
|
|
26
26
|
}
|
|
@@ -4,6 +4,7 @@ export interface ButtonGroupProps {
|
|
|
4
4
|
value?: any;
|
|
5
5
|
checkType?: 'none' | 'radio' | 'checkbox';
|
|
6
6
|
fluid?: boolean;
|
|
7
|
+
seperate?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare class ButtonGroup extends Component<ButtonGroupProps> {
|
|
9
10
|
static template: string | import("intact").Template<any>;
|
|
@@ -13,12 +13,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
13
13
|
className = _this$get.className,
|
|
14
14
|
vertical = _this$get.vertical,
|
|
15
15
|
children = _this$get.children,
|
|
16
|
-
fluid = _this$get.fluid
|
|
16
|
+
fluid = _this$get.fluid,
|
|
17
|
+
seperate = _this$get.seperate;
|
|
17
18
|
|
|
18
19
|
var classNameObj = (_classNameObj = {
|
|
19
20
|
'k-btns': true,
|
|
20
21
|
'k-vertical': vertical,
|
|
21
|
-
'k-fluid': fluid
|
|
22
|
+
'k-fluid': fluid,
|
|
23
|
+
'k-seperate': seperate
|
|
22
24
|
}, _classNameObj[className] = className, _classNameObj[makeButtonGroupStyles()] = true, _classNameObj);
|
|
23
25
|
return _$cv('div', _extends({
|
|
24
26
|
'className': _$cn(classNameObj)
|
|
@@ -78,7 +78,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
78
78
|
var waveColor = typeStyles && typeStyles.borderColor || theme.primary.borderColor;
|
|
79
79
|
return _$cc(Wave, {
|
|
80
80
|
'disabled': loading || disabled || type === 'none' || type === 'link',
|
|
81
|
-
'inset': '-2px',
|
|
81
|
+
'inset': type === 'flat' ? '-1px' : '-2px',
|
|
82
82
|
'color': waveColor,
|
|
83
83
|
'children': _$cc(DynamicButton, _extends({
|
|
84
84
|
'className': _$cn(classNameObj),
|