@king-design/intact 3.1.1-beta.3 → 3.1.2
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/affix/styles.ts +4 -2
- package/components/badge/index.vdt +1 -1
- package/components/badge/styles.ts +4 -3
- package/components/breadcrumb/index.vdt +1 -1
- package/components/breadcrumb/styles.ts +4 -2
- package/components/button/styles.ts +7 -5
- package/components/card/styles.ts +4 -2
- package/components/carousel/styles.ts +7 -4
- package/components/cascader/index.vdt +2 -1
- package/components/cascader/styles.ts +7 -4
- package/components/checkbox/index.vdt +1 -1
- package/components/checkbox/styles.ts +4 -2
- package/components/code/styles.ts +3 -2
- package/components/collapse/index.spec.ts +1 -1
- package/components/collapse/styles.ts +7 -4
- package/components/colorpicker/styles.ts +7 -4
- package/components/copy/styles.ts +3 -2
- package/components/datepicker/styles.ts +10 -6
- package/components/diagram/styles.ts +3 -2
- package/components/dialog/styles.ts +10 -6
- package/components/drawer/styles.ts +4 -2
- package/components/dropdown/styles.ts +7 -4
- package/components/editable/styles.ts +4 -2
- package/components/form/index.md +1 -0
- package/components/form/index.spec.ts +17 -0
- package/components/form/item.ts +2 -0
- package/components/form/styles.ts +7 -4
- package/components/form/useDirty.ts +4 -0
- package/components/grid/styles.ts +12 -9
- package/components/icon/index.vdt +1 -1
- package/components/icon/styles.ts +4 -2
- package/components/input/styles.ts +8 -5
- package/components/layout/styles.ts +13 -9
- package/components/menu/demos/recursive.md +340 -0
- package/components/menu/styles.ts +21 -16
- package/components/message/styles.ts +7 -5
- package/components/pagination/styles.ts +4 -2
- package/components/popover/content.vdt +1 -1
- package/components/popover/demos/basic.md +1 -0
- package/components/popover/styles.ts +12 -2
- package/components/progress/styles.ts +4 -4
- package/components/radio/styles.ts +4 -2
- package/components/rate/styles.ts +4 -2
- package/components/scrollSelect/styles.ts +4 -2
- package/components/select/base.ts +3 -2
- package/components/select/base.vdt +1 -1
- package/components/select/styles.ts +10 -6
- package/components/skeleton/styles.ts +7 -4
- package/components/slider/styles.ts +4 -2
- package/components/spin/styles.ts +4 -4
- package/components/spinner/styles.ts +4 -3
- package/components/split/styles.ts +4 -2
- package/components/steps/index.vdt +2 -2
- package/components/steps/styles.ts +7 -5
- package/components/switch/styles.ts +4 -2
- package/components/table/column.ts +2 -0
- package/components/table/column.vdt +7 -3
- package/components/table/demos/basic.md +2 -2
- package/components/table/demos/fixColumn.md +3 -1
- package/components/table/demos/groupHeader.md +11 -11
- package/components/table/demos/scheme.md +1 -1
- package/components/table/index.spec.ts +8 -3
- package/components/table/styles.ts +11 -8
- package/components/table/table.vdt +3 -4
- package/components/table/useColumns.ts +1 -0
- package/components/table/useFixedColumns.ts +27 -49
- package/components/table/useGroup.ts +5 -0
- package/components/table/useResizable.ts +38 -10
- package/components/table/useWidth.ts +3 -0
- package/components/tabs/styles.ts +4 -2
- package/components/tag/styles.ts +7 -4
- package/components/timeline/styles.ts +7 -5
- package/components/timepicker/styles.ts +4 -2
- package/components/tip/styles.ts +4 -2
- package/components/tooltip/content.vdt +1 -1
- package/components/tooltip/styles.ts +4 -2
- package/components/transfer/styles.ts +4 -2
- package/components/tree/demos/checkbox.md +1 -0
- package/components/tree/demos/contextmenu.md +10 -1
- package/components/tree/index.spec.ts +7 -0
- package/components/tree/styles.ts +4 -2
- package/components/tree/useChecked.ts +3 -0
- package/components/treeSelect/styles.ts +4 -2
- package/components/upload/styles.ts +7 -4
- package/components/utils.ts +10 -4
- package/components/wave/styles.ts +4 -2
- package/es/components/affix/styles.d.ts +4 -1
- package/es/components/affix/styles.js +4 -2
- package/es/components/badge/index.vdt.js +1 -1
- package/es/components/badge/styles.d.ts +4 -1
- package/es/components/badge/styles.js +4 -2
- package/es/components/breadcrumb/index.vdt.js +1 -1
- package/es/components/breadcrumb/styles.d.ts +4 -1
- package/es/components/breadcrumb/styles.js +4 -2
- package/es/components/button/styles.d.ts +8 -2
- package/es/components/button/styles.js +7 -4
- package/es/components/card/styles.d.ts +4 -1
- package/es/components/card/styles.js +4 -2
- package/es/components/carousel/styles.d.ts +8 -2
- package/es/components/carousel/styles.js +7 -4
- package/es/components/cascader/index.vdt.js +3 -1
- package/es/components/cascader/styles.d.ts +8 -2
- package/es/components/cascader/styles.js +7 -4
- package/es/components/checkbox/index.vdt.js +1 -1
- package/es/components/checkbox/styles.d.ts +4 -1
- package/es/components/checkbox/styles.js +4 -2
- package/es/components/code/styles.d.ts +4 -1
- package/es/components/code/styles.js +3 -2
- package/es/components/collapse/index.spec.js +1 -1
- package/es/components/collapse/styles.d.ts +8 -2
- package/es/components/collapse/styles.js +7 -4
- package/es/components/colorpicker/styles.d.ts +8 -2
- package/es/components/colorpicker/styles.js +7 -4
- package/es/components/copy/styles.d.ts +4 -1
- package/es/components/copy/styles.js +3 -2
- package/es/components/datepicker/styles.d.ts +12 -3
- package/es/components/datepicker/styles.js +10 -6
- package/es/components/diagram/styles.d.ts +4 -1
- package/es/components/diagram/styles.js +3 -2
- package/es/components/dialog/styles.d.ts +12 -3
- package/es/components/dialog/styles.js +10 -6
- package/es/components/drawer/styles.d.ts +4 -1
- package/es/components/drawer/styles.js +4 -2
- package/es/components/dropdown/styles.d.ts +8 -2
- package/es/components/dropdown/styles.js +7 -4
- package/es/components/editable/styles.d.ts +4 -1
- package/es/components/editable/styles.js +4 -2
- package/es/components/form/index.spec.js +43 -0
- package/es/components/form/item.d.ts +1 -0
- package/es/components/form/item.js +2 -1
- package/es/components/form/styles.d.ts +8 -2
- package/es/components/form/styles.js +7 -4
- package/es/components/form/useDirty.js +4 -0
- package/es/components/grid/styles.d.ts +8 -2
- package/es/components/grid/styles.js +12 -13
- package/es/components/icon/index.vdt.js +1 -1
- package/es/components/icon/styles.d.ts +4 -1
- package/es/components/icon/styles.js +4 -2
- package/es/components/input/styles.d.ts +8 -2
- package/es/components/input/styles.js +7 -4
- package/es/components/layout/styles.d.ts +16 -4
- package/es/components/layout/styles.js +13 -8
- package/es/components/menu/styles.d.ts +16 -4
- package/es/components/menu/styles.js +14 -9
- package/es/components/message/styles.d.ts +8 -2
- package/es/components/message/styles.js +7 -4
- package/es/components/pagination/styles.d.ts +4 -1
- package/es/components/pagination/styles.js +4 -2
- package/es/components/popover/content.vdt.js +1 -1
- package/es/components/popover/styles.d.ts +4 -1
- package/es/components/popover/styles.js +8 -3
- package/es/components/progress/styles.d.ts +4 -1
- package/es/components/progress/styles.js +4 -2
- package/es/components/radio/styles.d.ts +4 -1
- package/es/components/radio/styles.js +4 -2
- package/es/components/rate/styles.d.ts +4 -1
- package/es/components/rate/styles.js +4 -2
- package/es/components/scrollSelect/styles.d.ts +4 -1
- package/es/components/scrollSelect/styles.js +4 -2
- package/es/components/select/base.js +3 -1
- package/es/components/select/base.vdt.js +1 -1
- package/es/components/select/styles.d.ts +12 -3
- package/es/components/select/styles.js +10 -6
- package/es/components/skeleton/styles.d.ts +8 -2
- package/es/components/skeleton/styles.js +7 -4
- package/es/components/slider/styles.d.ts +4 -1
- package/es/components/slider/styles.js +4 -2
- package/es/components/spin/styles.d.ts +4 -1
- package/es/components/spin/styles.js +4 -2
- package/es/components/spinner/styles.d.ts +4 -1
- package/es/components/spinner/styles.js +4 -2
- package/es/components/split/styles.d.ts +4 -1
- package/es/components/split/styles.js +4 -2
- package/es/components/steps/index.vdt.js +2 -2
- package/es/components/steps/styles.d.ts +4 -3
- package/es/components/steps/styles.js +9 -4
- package/es/components/switch/styles.d.ts +4 -1
- package/es/components/switch/styles.js +4 -2
- package/es/components/table/column.d.ts +1 -0
- package/es/components/table/column.js +2 -1
- package/es/components/table/column.vdt.js +9 -3
- package/es/components/table/index.spec.js +18 -11
- package/es/components/table/styles.d.ts +8 -2
- package/es/components/table/styles.js +8 -5
- package/es/components/table/table.vdt.js +3 -4
- package/es/components/table/useColumns.js +1 -0
- package/es/components/table/useFixedColumns.d.ts +3 -3
- package/es/components/table/useFixedColumns.js +27 -46
- package/es/components/table/useGroup.d.ts +1 -0
- package/es/components/table/useGroup.js +11 -1
- package/es/components/table/useResizable.js +41 -5
- package/es/components/table/useWidth.js +3 -0
- package/es/components/tabs/styles.d.ts +4 -1
- package/es/components/tabs/styles.js +4 -2
- package/es/components/tag/styles.d.ts +8 -2
- package/es/components/tag/styles.js +7 -4
- package/es/components/timeline/styles.d.ts +8 -2
- package/es/components/timeline/styles.js +7 -5
- package/es/components/timepicker/styles.d.ts +4 -1
- package/es/components/timepicker/styles.js +4 -2
- package/es/components/tip/styles.d.ts +4 -1
- package/es/components/tip/styles.js +4 -2
- package/es/components/tooltip/content.vdt.js +1 -1
- package/es/components/tooltip/styles.d.ts +4 -1
- package/es/components/tooltip/styles.js +4 -2
- package/es/components/transfer/styles.d.ts +4 -1
- package/es/components/transfer/styles.js +4 -2
- package/es/components/tree/index.spec.js +13 -1
- package/es/components/tree/styles.d.ts +4 -1
- package/es/components/tree/styles.js +4 -2
- package/es/components/tree/useChecked.js +4 -0
- package/es/components/treeSelect/styles.d.ts +4 -1
- package/es/components/treeSelect/styles.js +4 -2
- package/es/components/upload/styles.d.ts +8 -2
- package/es/components/upload/styles.js +7 -4
- package/es/components/utils.d.ts +10 -2
- package/es/components/utils.js +9 -2
- package/es/components/wave/styles.d.ts +4 -1
- package/es/components/wave/styles.js +4 -2
- package/es/i18n/en-US.d.ts +1 -0
- package/es/i18n/en-US.js +1 -0
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/menu/demos/recursive/index.d.ts +29 -0
- package/es/site/data/components/menu/demos/recursive/index.js +57 -0
- package/es/site/data/components/menu/demos/recursive/react.d.ts +2 -0
- package/es/site/data/components/menu/demos/recursive/react.js +69 -0
- package/es/site/data/components/popover/demos/basic/react.js +2 -1
- package/es/site/data/components/table/demos/basic/react.js +4 -2
- package/es/site/data/components/table/demos/fixColumn/react.js +2 -1
- package/es/site/data/components/table/demos/groupHeader/react.js +11 -20
- package/es/site/data/components/table/demos/scheme/react.js +2 -1
- package/es/site/data/components/tree/demos/checkbox/index.d.ts +12 -2
- package/es/site/data/components/tree/demos/checkbox/index.js +1 -0
- package/es/site/data/components/tree/demos/checkbox/react.d.ts +12 -2
- package/es/site/data/components/tree/demos/checkbox/react.js +1 -0
- package/es/site/data/components/tree/demos/contextmenu/index.d.ts +1 -0
- package/es/site/data/components/tree/demos/contextmenu/index.js +1 -0
- package/es/site/data/components/tree/demos/contextmenu/react.d.ts +1 -0
- package/es/site/data/components/tree/demos/contextmenu/react.js +1 -0
- package/es/site/src/components/article/index.js +6 -2
- package/es/styles/fonts/iconfont.d.ts +4 -1
- package/es/styles/fonts/iconfont.js +1 -1
- package/es/styles/global.js +1 -1
- package/i18n/en-US.ts +1 -0
- package/index.ts +2 -2
- package/package.json +3 -3
- package/styles/fonts/iconfont.ts +2 -2
- package/styles/global.ts +22 -0
|
@@ -2,6 +2,7 @@ import {css} from '@emotion/css';
|
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults, palette} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
const defaults = {
|
|
7
8
|
get transition() { return theme.transition.middle },
|
|
@@ -32,9 +33,11 @@ const defaults = {
|
|
|
32
33
|
let message: typeof defaults;
|
|
33
34
|
setDefault(() => {
|
|
34
35
|
message = deepDefaults(theme, {message: defaults}).message;
|
|
36
|
+
makeMessagesStyles?.clearCache();
|
|
37
|
+
makeMessageStyles?.clearCache();
|
|
35
38
|
});
|
|
36
39
|
|
|
37
|
-
export function makeMessagesStyles(k: string) {
|
|
40
|
+
export const makeMessagesStyles = cache(function makeMessagesStyles(k: string) {
|
|
38
41
|
return css`
|
|
39
42
|
position: fixed;
|
|
40
43
|
top: ${message.top};
|
|
@@ -43,9 +46,9 @@ export function makeMessagesStyles(k: string) {
|
|
|
43
46
|
pointer-events: none;
|
|
44
47
|
z-index: ${theme.maxZIndex + 1};
|
|
45
48
|
`;
|
|
46
|
-
}
|
|
49
|
+
});
|
|
47
50
|
|
|
48
|
-
export function makeMessageStyles(k: string) {
|
|
51
|
+
export const makeMessageStyles = cache(function makeMessageStyles(k: string) {
|
|
49
52
|
return css`
|
|
50
53
|
text-align: center;
|
|
51
54
|
width: 100%;
|
|
@@ -121,5 +124,4 @@ export function makeMessageStyles(k: string) {
|
|
|
121
124
|
transition: transform ${message.transition};
|
|
122
125
|
}
|
|
123
126
|
`;
|
|
124
|
-
}
|
|
125
|
-
|
|
127
|
+
});
|
|
@@ -3,6 +3,7 @@ import {theme, setDefault} from '../../styles/theme';
|
|
|
3
3
|
import {deepDefaults, Sizes} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
5
|
import {button} from '../button/styles';
|
|
6
|
+
import { cache } from '../utils';
|
|
6
7
|
|
|
7
8
|
type SizeStyles = {
|
|
8
9
|
fontSize: string,
|
|
@@ -55,9 +56,10 @@ const defaults = deepDefaults(
|
|
|
55
56
|
let pagination: typeof defaults;
|
|
56
57
|
setDefault(() => {
|
|
57
58
|
pagination = deepDefaults(theme, {pagination: defaults}).pagination;
|
|
59
|
+
makeStyles?.clearCache();
|
|
58
60
|
});
|
|
59
61
|
|
|
60
|
-
export function makeStyles(k: string) {
|
|
62
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
61
63
|
return css`
|
|
62
64
|
font-size: ${pagination.fontSize};
|
|
63
65
|
> * {
|
|
@@ -145,4 +147,4 @@ export function makeStyles(k: string) {
|
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
149
|
`;
|
|
148
|
-
}
|
|
150
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {css} from '@emotion/css';
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults} from '../../styles/utils';
|
|
4
|
+
import { cache } from '../utils';
|
|
4
5
|
|
|
5
6
|
const defaults = {
|
|
6
7
|
width: '320px',
|
|
@@ -10,16 +11,20 @@ const defaults = {
|
|
|
10
11
|
fontSize: '14px',
|
|
11
12
|
lineHeight: '20px',
|
|
12
13
|
fontWeight: 500,
|
|
14
|
+
},
|
|
15
|
+
small: {
|
|
16
|
+
width: '240px',
|
|
13
17
|
}
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
let popover: typeof defaults;
|
|
17
21
|
setDefault(() => {
|
|
18
22
|
popover = deepDefaults(theme, {popover: defaults}).popover;
|
|
23
|
+
makeStyles?.clearCache();
|
|
19
24
|
});
|
|
20
25
|
|
|
21
26
|
|
|
22
|
-
export
|
|
27
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
23
28
|
return css`
|
|
24
29
|
// increase priority
|
|
25
30
|
&.${k}-tooltip-content.${k}-popover {
|
|
@@ -41,5 +46,10 @@ export default function makeStyles(k: string) {
|
|
|
41
46
|
.${k}-tooltip-footer {
|
|
42
47
|
text-align: right;
|
|
43
48
|
}
|
|
49
|
+
&.${k}-small {
|
|
50
|
+
padding: ${popover.padding};
|
|
51
|
+
width: ${popover.small.width};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
44
54
|
`;
|
|
45
|
-
}
|
|
55
|
+
});
|
|
@@ -2,6 +2,7 @@ import {css, keyframes} from '@emotion/css';
|
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
export const types = ['active', 'normal', 'error', 'success', 'warning'] as const;
|
|
7
8
|
|
|
@@ -70,9 +71,10 @@ const defaults = {
|
|
|
70
71
|
let progress: typeof defaults;
|
|
71
72
|
setDefault(() => {
|
|
72
73
|
progress = deepDefaults(theme, {progress: defaults}).progress;
|
|
74
|
+
makeStyles?.clearCache();
|
|
73
75
|
});
|
|
74
76
|
|
|
75
|
-
export function makeStyles(k: string) {
|
|
77
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
76
78
|
return css`
|
|
77
79
|
position: relative;
|
|
78
80
|
line-height: 1;
|
|
@@ -234,6 +236,4 @@ export function makeStyles(k: string) {
|
|
|
234
236
|
})}
|
|
235
237
|
}
|
|
236
238
|
`
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
239
|
+
});
|
|
@@ -2,6 +2,7 @@ import {css} from '@emotion/css';
|
|
|
2
2
|
import {deepDefaults, darken, palette} from '../../styles/utils';
|
|
3
3
|
import {theme, setDefault} from '../../styles/theme';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
const defaults = {
|
|
7
8
|
width: '16px',
|
|
@@ -34,9 +35,10 @@ const defaults = {
|
|
|
34
35
|
let radio: typeof defaults;
|
|
35
36
|
setDefault(() => {
|
|
36
37
|
radio = deepDefaults(theme, {radio: defaults}).radio;
|
|
38
|
+
makeStyles?.clearCache();
|
|
37
39
|
});
|
|
38
40
|
|
|
39
|
-
export function makeStyles(k: string) {
|
|
41
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
40
42
|
return css`
|
|
41
43
|
display: inline-flex;
|
|
42
44
|
align-items: center;
|
|
@@ -126,4 +128,4 @@ export function makeStyles(k: string) {
|
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
`;
|
|
129
|
-
}
|
|
131
|
+
});
|
|
@@ -2,6 +2,7 @@ import {css} from '@emotion/css';
|
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults, palette} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
const defaults = {
|
|
7
8
|
color: '#ccc',
|
|
@@ -18,9 +19,10 @@ const defaults = {
|
|
|
18
19
|
let rate: typeof defaults;
|
|
19
20
|
setDefault(() => {
|
|
20
21
|
rate = deepDefaults(theme, {rate: defaults}).rate;
|
|
22
|
+
makeStyles?.clearCache();
|
|
21
23
|
});
|
|
22
24
|
|
|
23
|
-
export function makeStyles(k: string) {
|
|
25
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
24
26
|
return css`
|
|
25
27
|
display: inline-block;
|
|
26
28
|
.${k}-rate-item {
|
|
@@ -65,4 +67,4 @@ export function makeStyles(k: string) {
|
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
`;
|
|
68
|
-
}
|
|
70
|
+
});
|
|
@@ -2,6 +2,7 @@ import {css} from '@emotion/css';
|
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults, sizes, Sizes, getRight, getLeft} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
type SizeStyles = {
|
|
7
8
|
padding?: string,
|
|
@@ -28,11 +29,12 @@ const defaults = {
|
|
|
28
29
|
let scrollSelect: typeof defaults;
|
|
29
30
|
setDefault(() => {
|
|
30
31
|
scrollSelect = deepDefaults(theme, {scrollSelect: defaults}).scrollSelect;
|
|
32
|
+
makeStyles?.clearCache();
|
|
31
33
|
});
|
|
32
34
|
|
|
33
35
|
export {scrollSelect};
|
|
34
36
|
|
|
35
|
-
export function makeStyles(k: string) {
|
|
37
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
36
38
|
return css`
|
|
37
39
|
text-align: center;
|
|
38
40
|
overflow: hidden;
|
|
@@ -91,4 +93,4 @@ export function makeStyles(k: string) {
|
|
|
91
93
|
pointer-events: none;
|
|
92
94
|
}
|
|
93
95
|
`;
|
|
94
|
-
}
|
|
96
|
+
});
|
|
@@ -121,9 +121,10 @@ export abstract class BaseSelect<
|
|
|
121
121
|
|
|
122
122
|
@bind
|
|
123
123
|
position() {
|
|
124
|
-
|
|
124
|
+
let dropdown = this.dropdownRef.value!;
|
|
125
125
|
if (dropdown.get('value')) {
|
|
126
|
-
dropdown.position()
|
|
126
|
+
do { dropdown.position() }
|
|
127
|
+
while (dropdown = dropdown.showedDropdown!)
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
|
|
@@ -2,7 +2,7 @@ import {TransitionGroup, Transition} from 'intact';
|
|
|
2
2
|
import {Input} from '../input';
|
|
3
3
|
import {Icon} from '../icon';
|
|
4
4
|
import {isNullOrUndefined, isStringOrNumber} from 'intact-shared';
|
|
5
|
-
import makeStyles from './styles';
|
|
5
|
+
import {makeStyles} from './styles';
|
|
6
6
|
import {Dropdown} from '../dropdown';
|
|
7
7
|
import {getRestProps, addStyle} from '../utils';
|
|
8
8
|
import {Wave} from '../wave';
|
|
@@ -2,6 +2,7 @@ import {css} from '@emotion/css';
|
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults, sizes, Sizes, getRight, getLeft} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
type SizeStyles = {
|
|
7
8
|
padding?: string,
|
|
@@ -112,9 +113,12 @@ const defaults = deepDefaults(
|
|
|
112
113
|
let select: typeof defaults;
|
|
113
114
|
setDefault(() => {
|
|
114
115
|
select = deepDefaults(theme, {select: defaults}).select;
|
|
116
|
+
makeStyles?.clearCache();
|
|
117
|
+
makeMenuStyles?.clearCache();
|
|
118
|
+
makeGroupStyles?.clearCache();
|
|
115
119
|
});
|
|
116
120
|
|
|
117
|
-
export
|
|
121
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
118
122
|
return css`
|
|
119
123
|
display: inline-flex;
|
|
120
124
|
align-items: center;
|
|
@@ -275,9 +279,9 @@ export default function makeStyles(k: string) {
|
|
|
275
279
|
}
|
|
276
280
|
}
|
|
277
281
|
`;
|
|
278
|
-
}
|
|
282
|
+
});
|
|
279
283
|
|
|
280
|
-
export function makeMenuStyles(k: string) {
|
|
284
|
+
export const makeMenuStyles = cache(function makeMenuStyles(k: string) {
|
|
281
285
|
const searchable = select.searchable;
|
|
282
286
|
|
|
283
287
|
return css`
|
|
@@ -367,13 +371,13 @@ export function makeMenuStyles(k: string) {
|
|
|
367
371
|
font-size: ${select.multiple.checkmark.fontSize};
|
|
368
372
|
}
|
|
369
373
|
`;
|
|
370
|
-
}
|
|
374
|
+
});
|
|
371
375
|
|
|
372
|
-
export function makeGroupStyles(k: string) {
|
|
376
|
+
export const makeGroupStyles = cache(function makeGroupStyles(k: string) {
|
|
373
377
|
return css`
|
|
374
378
|
.${k}-select-group-label {
|
|
375
379
|
color: ${select.group.labelColor};
|
|
376
380
|
padding: ${select.group.labelPadding};
|
|
377
381
|
}
|
|
378
382
|
`
|
|
379
|
-
}
|
|
383
|
+
});
|
|
@@ -2,6 +2,7 @@ import {deepDefaults} from '../../styles/utils';
|
|
|
2
2
|
import { theme, setDefault } from '../../styles/theme';
|
|
3
3
|
import {css, keyframes} from '@emotion/css';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
export const kls = (className: string, k: string) => `${k}-skeleton-${className}`;
|
|
7
8
|
|
|
@@ -16,9 +17,11 @@ const defaults = {
|
|
|
16
17
|
let skeleton: typeof defaults;
|
|
17
18
|
setDefault(() => {
|
|
18
19
|
skeleton = deepDefaults(theme, {skeleton: defaults}).skeleton;
|
|
20
|
+
makeStyles?.clearCache();
|
|
21
|
+
makeItemStyles?.clearCache();
|
|
19
22
|
});
|
|
20
23
|
|
|
21
|
-
export function makeStyles(k: string, size: ItemSize) {
|
|
24
|
+
export const makeStyles = cache(function makeStyles(k: string, size: ItemSize) {
|
|
22
25
|
return css`
|
|
23
26
|
&.${k}-animated {
|
|
24
27
|
.${kls('item', k)} {
|
|
@@ -53,7 +56,7 @@ export function makeStyles(k: string, size: ItemSize) {
|
|
|
53
56
|
height: ${theme[size].height}
|
|
54
57
|
}
|
|
55
58
|
`;
|
|
56
|
-
}
|
|
59
|
+
});
|
|
57
60
|
|
|
58
61
|
const skeletonLoading = keyframes`
|
|
59
62
|
0% {
|
|
@@ -64,7 +67,7 @@ const skeletonLoading = keyframes`
|
|
|
64
67
|
}
|
|
65
68
|
`;
|
|
66
69
|
|
|
67
|
-
export function makeItemStyles(k: string) {
|
|
70
|
+
export const makeItemStyles = cache(function makeItemStyles(k: string) {
|
|
68
71
|
const skeletonItem = skeleton.item;
|
|
69
72
|
return css`
|
|
70
73
|
& > div {
|
|
@@ -102,4 +105,4 @@ export function makeItemStyles(k: string) {
|
|
|
102
105
|
background: ${skeletonItem.bgColor};
|
|
103
106
|
}
|
|
104
107
|
`;
|
|
105
|
-
}
|
|
108
|
+
});
|
|
@@ -2,6 +2,7 @@ import {css} from '@emotion/css';
|
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
const defaults = {
|
|
7
8
|
get transition() { return theme.transition.middle },
|
|
@@ -51,9 +52,10 @@ const defaults = {
|
|
|
51
52
|
let slider: typeof defaults;
|
|
52
53
|
setDefault(() => {
|
|
53
54
|
slider = deepDefaults(theme, {slider: defaults}).slider;
|
|
55
|
+
makeStyles?.clearCache();
|
|
54
56
|
});
|
|
55
57
|
|
|
56
|
-
export function makeStyles(k: string) {
|
|
58
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
57
59
|
return css`
|
|
58
60
|
position: relative;
|
|
59
61
|
outline: none;
|
|
@@ -197,4 +199,4 @@ export function makeStyles(k: string) {
|
|
|
197
199
|
white-space: nowrap;
|
|
198
200
|
}
|
|
199
201
|
`;
|
|
200
|
-
}
|
|
202
|
+
});
|
|
@@ -2,6 +2,7 @@ import {css, keyframes} from '@emotion/css';
|
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults, sizes, Sizes} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
const defaults = {
|
|
7
8
|
width: `40px`,
|
|
@@ -16,9 +17,10 @@ const defaults = {
|
|
|
16
17
|
let spin: typeof defaults;
|
|
17
18
|
setDefault(() => {
|
|
18
19
|
spin = deepDefaults(theme, {spin: defaults}).spin;
|
|
20
|
+
makeStyles?.clearCache();
|
|
19
21
|
});
|
|
20
22
|
|
|
21
|
-
export function makeStyles(k: string) {
|
|
23
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
22
24
|
const width = spin.strokeWidth;
|
|
23
25
|
const r = 120 - 60 - (width / 2);
|
|
24
26
|
const c = Math.round(2 * 3.14 * r);
|
|
@@ -89,6 +91,4 @@ export function makeStyles(k: string) {
|
|
|
89
91
|
background: rgba(255, 255, 255, .5);
|
|
90
92
|
}
|
|
91
93
|
`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
});
|
|
@@ -2,7 +2,7 @@ import {css} from '@emotion/css';
|
|
|
2
2
|
import {deepDefaults, sizes, palette} from '../../styles/utils';
|
|
3
3
|
import {theme, setDefault} from '../../styles/theme';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
-
import
|
|
5
|
+
import { cache } from '../utils';
|
|
6
6
|
|
|
7
7
|
const defaults = {
|
|
8
8
|
get borderRadius() { return theme.borderRadius },
|
|
@@ -49,9 +49,10 @@ const defaults = {
|
|
|
49
49
|
let spinner: typeof defaults;
|
|
50
50
|
setDefault(() => {
|
|
51
51
|
spinner = deepDefaults(theme, {spinner: defaults}).spinner;
|
|
52
|
+
makeStyles?.clearCache();
|
|
52
53
|
});
|
|
53
54
|
|
|
54
|
-
export function makeStyles(k: string) {
|
|
55
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
55
56
|
return css`
|
|
56
57
|
display: inline-block;
|
|
57
58
|
vertical-align: middle;
|
|
@@ -159,4 +160,4 @@ export function makeStyles(k: string) {
|
|
|
159
160
|
}
|
|
160
161
|
})}
|
|
161
162
|
`;
|
|
162
|
-
}
|
|
163
|
+
});
|
|
@@ -2,6 +2,7 @@ import {theme, setDefault} from '../../styles/theme';
|
|
|
2
2
|
import {css} from '@emotion/css';
|
|
3
3
|
import '../../styles/global';
|
|
4
4
|
import {deepDefaults} from '../../styles/utils';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
export type Mode = 'horizontal' | 'vertical';
|
|
7
8
|
|
|
@@ -37,9 +38,10 @@ const defaults = {
|
|
|
37
38
|
let split: typeof defaults;
|
|
38
39
|
setDefault(() => {
|
|
39
40
|
split = deepDefaults(theme, {split: defaults}).split;
|
|
41
|
+
makeStyles?.clearCache();
|
|
40
42
|
});
|
|
41
43
|
|
|
42
|
-
export function makeStyles(k: string) {
|
|
44
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
43
45
|
return css`
|
|
44
46
|
display: flex;
|
|
45
47
|
height: 100%;
|
|
@@ -126,4 +128,4 @@ export function makeStyles(k: string) {
|
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
`;
|
|
129
|
-
}
|
|
131
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {getRestProps, eachChildren} from '../utils';
|
|
2
2
|
import {Step} from './step';
|
|
3
|
-
import {
|
|
3
|
+
import {makeStyles} from './styles';
|
|
4
4
|
import {context as StepsContext} from './context';
|
|
5
5
|
|
|
6
6
|
const {
|
|
@@ -16,7 +16,7 @@ const classNameObj = {
|
|
|
16
16
|
[`${k}-${type}`]: true,
|
|
17
17
|
[`${k}-clickable`]: clickable,
|
|
18
18
|
[`${k}-vertical`]: vertical,
|
|
19
|
-
[
|
|
19
|
+
[makeStyles(k)]: true,
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
let stepIndex = 0;
|
|
@@ -2,6 +2,7 @@ import {css, cx} from '@emotion/css';
|
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults, palette} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
const defaults = {
|
|
7
8
|
gap: '10px',
|
|
@@ -78,11 +79,12 @@ const defaults = {
|
|
|
78
79
|
let steps: typeof defaults;
|
|
79
80
|
setDefault(() => {
|
|
80
81
|
steps = deepDefaults(theme, {steps: defaults}).steps;
|
|
82
|
+
makeStyles?.clearCache();
|
|
81
83
|
});
|
|
82
84
|
|
|
83
85
|
const stepStatus = ['done', 'active', 'error'] as const;
|
|
84
86
|
|
|
85
|
-
export function
|
|
87
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
86
88
|
return css`
|
|
87
89
|
display: flex;
|
|
88
90
|
|
|
@@ -118,7 +120,7 @@ export function makeStepsStyles(k: string) {
|
|
|
118
120
|
|
|
119
121
|
${makeVerticalStyles(k)};
|
|
120
122
|
`;
|
|
121
|
-
}
|
|
123
|
+
});
|
|
122
124
|
|
|
123
125
|
function makeDefaultStyles(k: string) {
|
|
124
126
|
const defaults = steps.default;
|
|
@@ -383,7 +385,7 @@ function makeSimpleStyles(k: string) {
|
|
|
383
385
|
}
|
|
384
386
|
}
|
|
385
387
|
`;
|
|
386
|
-
}
|
|
388
|
+
};
|
|
387
389
|
|
|
388
390
|
function center(flex: 'flex' | 'inline-flex' = 'flex') {
|
|
389
391
|
return css`
|
|
@@ -393,7 +395,7 @@ function center(flex: 'flex' | 'inline-flex' = 'flex') {
|
|
|
393
395
|
`;
|
|
394
396
|
}
|
|
395
397
|
|
|
396
|
-
|
|
398
|
+
function makeCommonStyles(k: string) {
|
|
397
399
|
return css`
|
|
398
400
|
.${k}-step {
|
|
399
401
|
position: relative;
|
|
@@ -427,7 +429,7 @@ export function makeCommonStyles(k: string) {
|
|
|
427
429
|
`;
|
|
428
430
|
}
|
|
429
431
|
|
|
430
|
-
|
|
432
|
+
function makeVerticalStyles(k: string) {
|
|
431
433
|
const verticalLine = steps.vertical.line;
|
|
432
434
|
|
|
433
435
|
return css`
|
|
@@ -2,6 +2,7 @@ import {css} from '@emotion/css';
|
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
3
|
import {deepDefaults, sizes, palette} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
5
6
|
|
|
6
7
|
const defaults = {
|
|
7
8
|
get transition() { return theme.transition.middle },
|
|
@@ -56,9 +57,10 @@ const defaults = {
|
|
|
56
57
|
let kswitch: typeof defaults;
|
|
57
58
|
setDefault(() => {
|
|
58
59
|
kswitch = deepDefaults(theme, {switch: defaults}).switch;
|
|
60
|
+
makeStyles?.clearCache();
|
|
59
61
|
});
|
|
60
62
|
|
|
61
|
-
export function makeStyles(k: string) {
|
|
63
|
+
export const makeStyles = cache(function makeStyles(k: string) {
|
|
62
64
|
return css`
|
|
63
65
|
display: inline-block;
|
|
64
66
|
vertical-align: middle;
|
|
@@ -206,4 +208,4 @@ export function makeStyles(k: string) {
|
|
|
206
208
|
}
|
|
207
209
|
}
|
|
208
210
|
`;
|
|
209
|
-
}
|
|
211
|
+
});
|
|
@@ -22,6 +22,7 @@ export interface TableColumnProps {
|
|
|
22
22
|
cols?: number
|
|
23
23
|
rows?: number
|
|
24
24
|
prevVNode?: VNodeComponentClass<TableColumn> | null
|
|
25
|
+
nextVNode?: VNodeComponentClass<TableColumn> | null
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export interface TableColumnEvents { }
|
|
@@ -58,6 +59,7 @@ const typeDefs: Required<TypeDefs<TableColumnProps>> = {
|
|
|
58
59
|
cols: null,
|
|
59
60
|
rows: null,
|
|
60
61
|
prevVNode: null,
|
|
62
|
+
nextVNode: null,
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
export class TableColumn<T = any> extends Component<TableColumnProps, TableColumnEvents, TableColumnBlocks<T>> {
|
|
@@ -19,7 +19,7 @@ const {title, fixed, group, multiple, key, sortable, cols, rows} = this.get();
|
|
|
19
19
|
const {
|
|
20
20
|
onSelect, isChecked, keywords, filteredGroup,
|
|
21
21
|
onShow, reset, confirm, dropdownRef,
|
|
22
|
-
localGroupValue, isEmptyValue,
|
|
22
|
+
localGroupValue, isEmptyValue, checkAll,
|
|
23
23
|
} = this.group;
|
|
24
24
|
const { k } = this.config;
|
|
25
25
|
|
|
@@ -96,14 +96,18 @@ const { k } = this.config;
|
|
|
96
96
|
</DropdownItem>
|
|
97
97
|
</div>
|
|
98
98
|
<div class={`${k}-table-group-footer`} v-if={multiple}>
|
|
99
|
+
<Button size="mini"
|
|
100
|
+
type="link"
|
|
101
|
+
ev-click={checkAll}
|
|
102
|
+
>{_$('全选')}</Button>
|
|
99
103
|
<Button size="small"
|
|
100
104
|
disabled={isEmptyValue(localGroupValue.value)}
|
|
101
105
|
type="secondary"
|
|
102
106
|
ev-click={() => reset(onChange)}
|
|
103
|
-
|
|
107
|
+
>{_$('重置')}</Button>
|
|
104
108
|
<Button type="primary" size="small"
|
|
105
109
|
ev-click={() => confirm(onChange)}
|
|
106
|
-
|
|
110
|
+
>{_$('确定')}</Button>
|
|
107
111
|
</div>
|
|
108
112
|
</DropdownMenu>
|
|
109
113
|
</Dropdown>
|
|
@@ -10,8 +10,8 @@ order: 0
|
|
|
10
10
|
import {Table, TableColumn} from 'kpc';
|
|
11
11
|
|
|
12
12
|
<Table data={this.get('data')} resizable>
|
|
13
|
-
<TableColumn key="a" title="Title 1" />
|
|
14
|
-
<TableColumn key="b" title="Title 2" />
|
|
13
|
+
<TableColumn key="a" title="Title 1" minWidth={200}/>
|
|
14
|
+
<TableColumn key="b" title="Title 2" minWidth={300} />
|
|
15
15
|
</Table>
|
|
16
16
|
```
|
|
17
17
|
|
|
@@ -9,6 +9,8 @@ order: 14
|
|
|
9
9
|
> 固定列通过`position: sticky`来实现,所以对于非首/尾列,需要指定它们之前或之后的列的固定宽度`width`来
|
|
10
10
|
> 帮助该列来确定固定的位置
|
|
11
11
|
|
|
12
|
+
> @since 3.1.2 `width`属性不再是必须的
|
|
13
|
+
|
|
12
14
|
```vdt
|
|
13
15
|
import {Table, TableColumn} from 'kpc';
|
|
14
16
|
|
|
@@ -34,7 +36,7 @@ import {Table, TableColumn} from 'kpc';
|
|
|
34
36
|
<TableColumn key="column1" title="Column1" width="300" />
|
|
35
37
|
<TableColumn key="column2" title="Column2" width="300" />
|
|
36
38
|
<TableColumn key="column3" title="Column3" width="300" />
|
|
37
|
-
<TableColumn key="column4" title="Column4" width="300" />
|
|
39
|
+
<TableColumn key="column4" title="Column4" width="300" fixed="right" />
|
|
38
40
|
<TableColumn fixed="right" key="action" title="Action" width="200">
|
|
39
41
|
<b:template args="data">
|
|
40
42
|
<a>action</a>
|