@king-design/intact 3.1.0-beta.1 → 3.1.0-beta.3
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/colorpicker/styles.ts +4 -4
- package/components/copy/index.spec.ts +28 -0
- package/components/copy/index.ts +2 -0
- package/components/copy/useCopy.ts +9 -4
- package/components/dialog/base.ts +1 -1
- package/components/dialog/base.vdt +2 -2
- package/components/dialog/styles.ts +1 -0
- package/components/editable/index.vdt +7 -5
- package/components/layout/aside.ts +4 -2
- package/components/layout/body.ts +2 -0
- package/components/layout/index.md +1 -0
- package/components/layout/styles.ts +10 -2
- package/components/layout/useParse.ts +1 -1
- package/components/menu/demos/basic.md +1 -1
- package/components/menu/item.vdt +17 -2
- package/components/menu/menu.ts +4 -0
- package/components/menu/menu.vdt +1 -1
- package/components/menu/styles.ts +20 -16
- package/components/menu/useDropdown.ts +3 -6
- package/components/message/styles.ts +2 -2
- package/components/select/styles.ts +1 -1
- package/components/table/cell.vdt +1 -1
- package/components/table/column.vdt +1 -1
- package/components/table/row.vdt +2 -2
- package/components/table/styles.ts +2 -2
- package/components/table/table.vdt +1 -1
- package/components/table/useFixedColumns.ts +3 -2
- package/components/tooltip/styles.ts +1 -1
- package/components/tree/demos/draggable.md +63 -48
- package/components/tree/index.md +4 -3
- package/components/tree/index.spec.ts +39 -40
- package/components/tree/index.ts +8 -3
- package/components/tree/styles.ts +2 -0
- package/components/tree/useDraggable.ts +5 -5
- package/components/tree/useExpanded.ts +1 -1
- package/components/tree/useNodes.ts +1 -0
- package/components/treeSelect/index.md +7 -1
- package/components/treeSelect/index.ts +4 -0
- package/es/components/colorpicker/styles.js +2 -2
- package/es/components/copy/index.d.ts +1 -0
- package/es/components/copy/index.js +2 -1
- package/es/components/copy/index.spec.js +64 -1
- package/es/components/copy/useCopy.d.ts +1 -1
- package/es/components/copy/useCopy.js +11 -5
- package/es/components/dialog/base.js +1 -1
- package/es/components/dialog/base.vdt.js +3 -3
- package/es/components/dialog/styles.js +1 -1
- package/es/components/editable/index.vdt.js +8 -5
- package/es/components/layout/aside.d.ts +1 -0
- package/es/components/layout/aside.js +5 -3
- package/es/components/layout/body.js +2 -1
- package/es/components/layout/styles.d.ts +2 -1
- package/es/components/layout/styles.js +7 -2
- package/es/components/layout/useParse.js +1 -1
- package/es/components/menu/item.vdt.js +22 -2
- package/es/components/menu/menu.d.ts +1 -0
- package/es/components/menu/menu.js +2 -1
- package/es/components/menu/menu.vdt.js +1 -1
- package/es/components/menu/styles.d.ts +1 -0
- package/es/components/menu/styles.js +10 -2
- package/es/components/menu/useDropdown.js +3 -6
- package/es/components/message/styles.js +1 -1
- package/es/components/select/styles.js +1 -1
- package/es/components/table/cell.vdt.js +1 -1
- package/es/components/table/column.vdt.js +1 -1
- package/es/components/table/row.vdt.js +1 -1
- package/es/components/table/styles.js +1 -1
- package/es/components/table/table.vdt.js +1 -1
- package/es/components/table/useFixedColumns.d.ts +1 -1
- package/es/components/table/useFixedColumns.js +2 -2
- package/es/components/tooltip/styles.js +1 -1
- package/es/components/tree/index.d.ts +5 -3
- package/es/components/tree/index.js +5 -0
- package/es/components/tree/index.spec.js +60 -39
- package/es/components/tree/styles.js +1 -1
- package/es/components/tree/useDraggable.js +12 -12
- package/es/components/tree/useExpanded.d.ts +1 -0
- package/es/components/tree/useExpanded.js +2 -1
- package/es/components/tree/useNodes.d.ts +1 -0
- package/es/components/treeSelect/index.d.ts +1 -0
- package/es/components/treeSelect/index.js +4 -0
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/menu/demos/basic/react.js +2 -2
- package/es/site/data/components/tree/demos/draggable/index.d.ts +23 -17
- package/es/site/data/components/tree/demos/draggable/index.js +45 -35
- package/es/site/data/components/tree/demos/draggable/react.d.ts +23 -17
- package/es/site/data/components/tree/demos/draggable/react.js +54 -35
- package/index.ts +2 -2
- package/package.json +2 -2
|
@@ -176,11 +176,11 @@ export function makePanelStyles(k: string) {
|
|
|
176
176
|
.${k}-slider {
|
|
177
177
|
margin-bottom: ${colorpicker.panel.gutter};
|
|
178
178
|
}
|
|
179
|
-
.${k}-slider-
|
|
179
|
+
.${k}-slider-track-wrapper,
|
|
180
180
|
.${k}-slider-track {
|
|
181
181
|
height: ${colorpicker.slider.height};
|
|
182
182
|
}
|
|
183
|
-
.${k}-slider-
|
|
183
|
+
.${k}-slider-track-wrapper {
|
|
184
184
|
cursor: ${colorpicker.slider.cursor};
|
|
185
185
|
}
|
|
186
186
|
.${k}-slider-track {
|
|
@@ -206,7 +206,7 @@ export function makePanelStyles(k: string) {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
.${k}-colorpicker-hue {
|
|
209
|
-
.${k}-slider-
|
|
209
|
+
.${k}-slider-track-wrapper {
|
|
210
210
|
background: linear-gradient(90deg, red 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, red);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
@@ -271,7 +271,7 @@ export function makePanelStyles(k: string) {
|
|
|
271
271
|
|
|
272
272
|
export function makeAlphaBgColor({r, g, b}: ColorFormats.RGBA, k: string) {
|
|
273
273
|
return css`
|
|
274
|
-
.${k}-slider-
|
|
274
|
+
.${k}-slider-track-wrapper {
|
|
275
275
|
background: linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0) 0%, rgb(${r}, ${g}, ${b}) 100%);
|
|
276
276
|
}
|
|
277
277
|
`;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import BasicDemo from '~/components/copy/demos/basic';
|
|
2
2
|
import {mount, unmount, dispatchEvent, wait, getElement} from '../../test/utils';
|
|
3
|
+
import { Tooltip } from '../tooltip';
|
|
4
|
+
import { Component } from 'intact';
|
|
5
|
+
import { Copy } from '.';
|
|
3
6
|
|
|
4
7
|
describe('Copy', () => {
|
|
5
8
|
afterEach(async () => {
|
|
@@ -18,4 +21,29 @@ describe('Copy', () => {
|
|
|
18
21
|
console.log(e);
|
|
19
22
|
}
|
|
20
23
|
});
|
|
24
|
+
|
|
25
|
+
it('wrap copy with tooltip', async () => {
|
|
26
|
+
class Demo extends Component {
|
|
27
|
+
static template = `
|
|
28
|
+
const { Tooltip, Copy } = this;
|
|
29
|
+
<Tooltip content="test">
|
|
30
|
+
<Copy text="test" />
|
|
31
|
+
</Tooltip>
|
|
32
|
+
`;
|
|
33
|
+
Tooltip = Tooltip;
|
|
34
|
+
Copy = Copy;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const [instance, element] = mount(Demo);
|
|
38
|
+
|
|
39
|
+
element.click();
|
|
40
|
+
await wait();
|
|
41
|
+
try {
|
|
42
|
+
const text = await navigator.clipboard.readText();
|
|
43
|
+
expect(text).to.eql('test');
|
|
44
|
+
} catch (e) {
|
|
45
|
+
// Read permisson denied
|
|
46
|
+
console.log(e);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
21
49
|
});
|
package/components/copy/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface CopyProps {
|
|
|
12
12
|
export interface CopyEvents {
|
|
13
13
|
success: [string]
|
|
14
14
|
error: []
|
|
15
|
+
click: [MouseEvent]
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const typeDefs: Required<TypeDefs<CopyProps>> = {
|
|
@@ -26,6 +27,7 @@ const defaults = (): Partial<CopyProps> => ({
|
|
|
26
27
|
const events: Events<CopyEvents> = {
|
|
27
28
|
success: true,
|
|
28
29
|
error: true,
|
|
30
|
+
click: true,
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
export class Copy extends Component<CopyProps, CopyEvents> {
|
|
@@ -11,7 +11,7 @@ export function useCopy() {
|
|
|
11
11
|
let timer: number;
|
|
12
12
|
|
|
13
13
|
return {
|
|
14
|
-
startCopy: () => {
|
|
14
|
+
startCopy: (e: MouseEvent) => {
|
|
15
15
|
const { text, showMessage } = instance.get();
|
|
16
16
|
|
|
17
17
|
if (clipboardCopy(text) || commandCopy(text)) {
|
|
@@ -27,6 +27,8 @@ export function useCopy() {
|
|
|
27
27
|
success.set(false);
|
|
28
28
|
instance.trigger('error');
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
instance.trigger('click', e);
|
|
30
32
|
},
|
|
31
33
|
success,
|
|
32
34
|
};
|
|
@@ -57,15 +59,18 @@ function createFakeElement(value: string) {
|
|
|
57
59
|
|
|
58
60
|
function clipboardCopy(text: string) {
|
|
59
61
|
try {
|
|
60
|
-
navigator.clipboard.
|
|
62
|
+
if (navigator.clipboard/* && window.isSecureContext */) {
|
|
63
|
+
navigator.clipboard.writeText(text);
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
63
67
|
} catch (e) {
|
|
64
68
|
if (process.env.NODE_ENV !== 'production') {
|
|
65
69
|
console.log(e);
|
|
66
70
|
}
|
|
67
|
-
return false;
|
|
68
71
|
}
|
|
72
|
+
|
|
73
|
+
return false;
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
function commandCopy(text: string) {
|
|
@@ -2,6 +2,7 @@ import {getRestProps} from '../utils';
|
|
|
2
2
|
import {Input} from '../input';
|
|
3
3
|
import {Icon} from '../icon';
|
|
4
4
|
import {makeStyles} from './styles';
|
|
5
|
+
import { Tooltip } from '../tooltip';
|
|
5
6
|
|
|
6
7
|
const {
|
|
7
8
|
children, className, editing,
|
|
@@ -20,11 +21,12 @@ const classNameObj = {
|
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
<div {...getRestProps(this)} class={classNameObj}>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
<Tooltip v-if={!disabled && !editing} content={tip}>
|
|
25
|
+
<Icon class={`${k}-icon-edit ${k}-editable-icon`}
|
|
26
|
+
ev-click={this.edit}
|
|
27
|
+
hoverable
|
|
28
|
+
/>
|
|
29
|
+
</Tooltip>
|
|
28
30
|
<div class="c-ellipsis">
|
|
29
31
|
<template v-if={!editing}>{children}</template>
|
|
30
32
|
<Input v-else
|
|
@@ -12,6 +12,7 @@ export interface AsideProps {
|
|
|
12
12
|
fixed?: boolean
|
|
13
13
|
theme?: MenuProps['theme']
|
|
14
14
|
width?: number | string
|
|
15
|
+
collapsedWidth?: number | string
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const typeDefs: Required<TypeDefs<AsideProps>> = {
|
|
@@ -19,6 +20,7 @@ const typeDefs: Required<TypeDefs<AsideProps>> = {
|
|
|
19
20
|
fixed: Boolean,
|
|
20
21
|
theme: themes,
|
|
21
22
|
width: [Number, String],
|
|
23
|
+
collapsedWidth: [Number, String],
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
const defaults = (): Partial<AsideProps> => ({
|
|
@@ -35,9 +37,9 @@ export class Aside extends Component<AsideProps> {
|
|
|
35
37
|
private config = useConfigContext();
|
|
36
38
|
|
|
37
39
|
private getStyles() {
|
|
38
|
-
const {fixed, width, collapse} = this.get();
|
|
40
|
+
const {fixed, width, collapse, collapsedWidth} = this.get();
|
|
39
41
|
const style = addStyle(this.get<string>('style'), {
|
|
40
|
-
width: !collapse ? getStyle(width!) : getCollapseWidth(),
|
|
42
|
+
width: !collapse ? getStyle(width!) : getCollapseWidth(collapsedWidth),
|
|
41
43
|
});
|
|
42
44
|
|
|
43
45
|
if (!fixed) return style;
|
|
@@ -4,6 +4,7 @@ import {LAYOUT, getStyle, BODY} from './helpers';
|
|
|
4
4
|
import type {Layout} from './layout';
|
|
5
5
|
import {addStyle} from '../utils';
|
|
6
6
|
import { useConfigContext } from '../config';
|
|
7
|
+
import { makeBodyStyles } from './styles';
|
|
7
8
|
|
|
8
9
|
export class Body extends Component {
|
|
9
10
|
static template = template;
|
|
@@ -21,6 +22,7 @@ export class Body extends Component {
|
|
|
21
22
|
return {
|
|
22
23
|
[`${k}-layout-body`]: true,
|
|
23
24
|
[className as string]: className,
|
|
25
|
+
[makeBodyStyles(k)]: true,
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
|
|
@@ -3,6 +3,8 @@ import {theme, setDefault} from '../../styles/theme';
|
|
|
3
3
|
import {deepDefaults, getLeft, setAlpha} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
5
|
import {menu} from '../menu/styles';
|
|
6
|
+
import { isNullOrUndefined } from 'intact-shared';
|
|
7
|
+
import { getStyle } from './helpers';
|
|
6
8
|
|
|
7
9
|
const sizes = ['small', 'large'] as const;
|
|
8
10
|
export const themes = ['light', 'dark', 'white'] as const;
|
|
@@ -32,8 +34,8 @@ setDefault(() => {
|
|
|
32
34
|
layout = deepDefaults(theme, {layout: defaults}).layout;
|
|
33
35
|
});
|
|
34
36
|
|
|
35
|
-
export function getCollapseWidth() {
|
|
36
|
-
return layout.collapsedWidth;
|
|
37
|
+
export function getCollapseWidth(collapsedWidth?: string | number) {
|
|
38
|
+
return isNullOrUndefined(collapsedWidth) ? layout.collapsedWidth : getStyle(collapsedWidth);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export function makeLayoutStyles(k: string) {
|
|
@@ -131,3 +133,9 @@ export function makeAsideStyles(k: string) {
|
|
|
131
133
|
`
|
|
132
134
|
}
|
|
133
135
|
|
|
136
|
+
export function makeBodyStyles(k: string) {
|
|
137
|
+
return css`
|
|
138
|
+
transition: padding-left ${layout.transition};
|
|
139
|
+
`
|
|
140
|
+
}
|
|
141
|
+
|
|
@@ -26,7 +26,7 @@ import {Menu, MenuItem, Icon} from 'kpc';
|
|
|
26
26
|
</MenuItem>
|
|
27
27
|
<MenuItem key="2" disabled><Icon class="ion-star" />menu 2</MenuItem>
|
|
28
28
|
<MenuItem key="3">
|
|
29
|
-
<
|
|
29
|
+
<Icon class="ion-heart" />menu 3
|
|
30
30
|
<Menu>
|
|
31
31
|
<MenuItem key="3-1">sub menu 1</MenuItem>
|
|
32
32
|
<MenuItem key="3-2">sub menu 2</MenuItem>
|
package/components/menu/item.vdt
CHANGED
|
@@ -5,7 +5,7 @@ import {Icon} from '../icon';
|
|
|
5
5
|
import {Menu} from './menu';
|
|
6
6
|
import {getRestProps, expandAnimationCallbacks} from '../utils';
|
|
7
7
|
import {isNullOrUndefined} from 'intact-shared';
|
|
8
|
-
import {makeItemStyles, makeTitleStyles} from './styles';
|
|
8
|
+
import {makeItemStyles, makeTitleStyles, makeNestedMenuStyles} from './styles';
|
|
9
9
|
|
|
10
10
|
const rootMenu = this.rootMenu;
|
|
11
11
|
const {theme, type, dot: rootDot} = rootMenu.get();
|
|
@@ -18,6 +18,7 @@ const {
|
|
|
18
18
|
tooltipContents, iconVNode, titleVNodes,
|
|
19
19
|
position, isCollapse,
|
|
20
20
|
} = this.dropdown();
|
|
21
|
+
|
|
21
22
|
const { k } = this.config;
|
|
22
23
|
const classNameObj = {
|
|
23
24
|
[`${k}-menu-item`]: true,
|
|
@@ -48,7 +49,21 @@ const title = (children) => (
|
|
|
48
49
|
key="subMenu"
|
|
49
50
|
{...expandAnimationCallbacks}
|
|
50
51
|
>
|
|
51
|
-
{
|
|
52
|
+
{(() => {
|
|
53
|
+
if (subMenuVNode) {
|
|
54
|
+
const paddingLeft = this.parentMenu.get('_paddingLeft');
|
|
55
|
+
const [_classname, _paddingLeft] = makeNestedMenuStyles(k, showDot || !!iconVNode, paddingLeft);
|
|
56
|
+
const className = _$cn({
|
|
57
|
+
[_classname]: true,
|
|
58
|
+
[subMenuVNode.className]: subMenuVNode.className,
|
|
59
|
+
});
|
|
60
|
+
const clonedVNode = directClone(subMenuVNode);
|
|
61
|
+
clonedVNode.props = { ...clonedVNode.props, className, _paddingLeft };
|
|
62
|
+
clonedVNode.className = className;
|
|
63
|
+
|
|
64
|
+
return clonedVNode;
|
|
65
|
+
}
|
|
66
|
+
})()}
|
|
52
67
|
</Transition>
|
|
53
68
|
</template>
|
|
54
69
|
|
package/components/menu/menu.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface MenuProps<K extends Key = Key> {
|
|
|
12
12
|
size?: 'large' | 'default' | 'small'
|
|
13
13
|
accordion?: boolean
|
|
14
14
|
dot?: boolean
|
|
15
|
+
|
|
16
|
+
_paddingLeft?: string
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export interface MenuEvents { }
|
|
@@ -29,6 +31,8 @@ const typeDefs: Required<TypeDefs<MenuProps>> = {
|
|
|
29
31
|
size: ['large', 'default', 'small'],
|
|
30
32
|
accordion: Boolean,
|
|
31
33
|
dot: Boolean,
|
|
34
|
+
|
|
35
|
+
_paddingLeft: String,
|
|
32
36
|
};
|
|
33
37
|
|
|
34
38
|
const defaults = (): Partial<MenuProps> => ({
|
package/components/menu/menu.vdt
CHANGED
|
@@ -96,20 +96,6 @@ export function makeMenuStyles(k: string) {
|
|
|
96
96
|
font-size: ${menu.fontSize};
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
// nested menu
|
|
100
|
-
&:not(.${k}-dropdown-menu) &:not(.${k}-dropdown-menu) {
|
|
101
|
-
width: auto;
|
|
102
|
-
background: ${menu.subBgColor};
|
|
103
|
-
.${k}-menu-title {
|
|
104
|
-
padding-left: calc(${getLeft(menu.item.padding)} + ${menu.icon.width} + ${menu.icon.gap});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
&:not(.${k}-dropdown-menu) &:not(.${k}-dropdown-menu) &:not(.${k}-dropdown-menu) {
|
|
108
|
-
.${k}-menu-title {
|
|
109
|
-
padding-left: calc(${getLeft(menu.item.padding)} + ${menu.icon.width} * 2 + ${menu.icon.gap});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
99
|
.${k}-icon {
|
|
114
100
|
width: ${menu.icon.width};
|
|
115
101
|
margin-right: ${menu.icon.gap};
|
|
@@ -244,7 +230,6 @@ export function makeItemStyles(k: string) {
|
|
|
244
230
|
.${k}-menu-title {
|
|
245
231
|
cursor: pointer;
|
|
246
232
|
height: ${menu.item.height};
|
|
247
|
-
transition: all ${menu.transition};
|
|
248
233
|
&:hover {
|
|
249
234
|
color: ${menu.item.hoverColor};
|
|
250
235
|
}
|
|
@@ -259,10 +244,13 @@ export function makeItemStyles(k: string) {
|
|
|
259
244
|
text-overflow: ellipsis;
|
|
260
245
|
min-width: 0;
|
|
261
246
|
}
|
|
247
|
+
.${k}-icon {
|
|
248
|
+
color: inherit;
|
|
249
|
+
}
|
|
262
250
|
}
|
|
263
251
|
.${k}-menu-arrow {
|
|
264
252
|
transition: transform ${menu.transition};
|
|
265
|
-
margin
|
|
253
|
+
margin: 0 0 0 ${menu.icon.gap};
|
|
266
254
|
}
|
|
267
255
|
|
|
268
256
|
// expanded
|
|
@@ -305,3 +293,19 @@ export function makeItemStyles(k: string) {
|
|
|
305
293
|
}
|
|
306
294
|
`
|
|
307
295
|
}
|
|
296
|
+
|
|
297
|
+
export function makeNestedMenuStyles(k: string, hasIcon: boolean, parentPaddingLeft: string = getLeft(menu.item.padding)) {
|
|
298
|
+
const paddingLeft = `${parentPaddingLeft}${hasIcon ? ' + ' + menu.icon.width : ''} + ${menu.icon.gap}`;
|
|
299
|
+
return [
|
|
300
|
+
css`
|
|
301
|
+
&.${k}-menu {
|
|
302
|
+
width: auto;
|
|
303
|
+
background: ${menu.subBgColor};
|
|
304
|
+
.${k}-menu-title {
|
|
305
|
+
padding-left: calc(${paddingLeft});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
`,
|
|
309
|
+
paddingLeft,
|
|
310
|
+
]
|
|
311
|
+
}
|
|
@@ -45,16 +45,13 @@ export function useDropdown(rootMenu: Menu, parentMenu: Menu) {
|
|
|
45
45
|
eachChildren(children, vNode => {
|
|
46
46
|
if (isComponentVNode(vNode, Menu)) {
|
|
47
47
|
subMenuVNode = vNode;
|
|
48
|
-
} else if (isTopItem && isCollapse) {
|
|
49
|
-
if (isStringOrNumberNotEmpty(vNode) || isTextVNode(vNode)) {
|
|
50
|
-
tooltipContents.push(vNode);
|
|
51
|
-
} else if (!iconVNode && isComponentVNode(vNode, Icon)) {
|
|
52
|
-
iconVNode = vNode;
|
|
53
|
-
}
|
|
54
48
|
} else {
|
|
55
49
|
if (isStringOrNumberNotEmpty(vNode) || isTextVNode(vNode)) {
|
|
56
50
|
// wrap with span for showing text ellipsis
|
|
57
51
|
vNode = createVNode('span', null, vNode);
|
|
52
|
+
tooltipContents.push(vNode);
|
|
53
|
+
} else if (!iconVNode && isComponentVNode(vNode, Icon)) {
|
|
54
|
+
iconVNode = vNode;
|
|
58
55
|
}
|
|
59
56
|
titleVNodes.push(vNode);
|
|
60
57
|
}
|
|
@@ -74,8 +74,8 @@ export function makeMessageStyles(k: string) {
|
|
|
74
74
|
display: inline-block;
|
|
75
75
|
padding: ${message.padding};
|
|
76
76
|
vertical-align: middle;
|
|
77
|
-
word-break:
|
|
78
|
-
word-wrap:
|
|
77
|
+
word-break: break-word;
|
|
78
|
+
word-wrap: break-word;
|
|
79
79
|
}
|
|
80
80
|
.${k}-message-close {
|
|
81
81
|
vertical-align: middle;
|
|
@@ -20,7 +20,7 @@ if (blocks) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
let {className, style} = getClassAndStyleForFixed(props, offset, checkType);
|
|
23
|
+
let {className, style} = getClassAndStyleForFixed(props, offset, k, checkType);
|
|
24
24
|
if (columnIndex === 0 && indent) {
|
|
25
25
|
style || (style = {});
|
|
26
26
|
style.paddingLeft = `${indent}px`;
|
|
@@ -33,7 +33,7 @@ const { k } = this.config;
|
|
|
33
33
|
{({resizable, onStart}) => {
|
|
34
34
|
return <FixedColumnsContext.Consumer>
|
|
35
35
|
{(offsetMap) => {
|
|
36
|
-
const {className, style} = getClassAndStyleForFixed(this.get(), offsetMap[key], checkType);
|
|
36
|
+
const {className, style} = getClassAndStyleForFixed(this.get(), offsetMap[key], k, checkType);
|
|
37
37
|
const classNameObj = {
|
|
38
38
|
[`${k}-column-sortable`]: sortable,
|
|
39
39
|
[className]: className,
|
package/components/table/row.vdt
CHANGED
|
@@ -39,8 +39,8 @@ const pushCheckTypeVNode = (children) => {
|
|
|
39
39
|
<td key="$checktype"
|
|
40
40
|
{...getClassAndStyleForFixed({
|
|
41
41
|
fixed: hasFixedLeft ? 'left' : false,
|
|
42
|
-
className: [`${k}-table-check`]
|
|
43
|
-
}, 0)}
|
|
42
|
+
className: [`${k}-table-check`],
|
|
43
|
+
}, 0, k)}
|
|
44
44
|
{...spans}
|
|
45
45
|
>{children}</td>
|
|
46
46
|
)
|
|
@@ -90,7 +90,7 @@ export function makeStyles(k: string) {
|
|
|
90
90
|
border-spacing: 0;
|
|
91
91
|
table-layout: fixed;
|
|
92
92
|
td,
|
|
93
|
-
th{
|
|
93
|
+
th {
|
|
94
94
|
transition: all ${table.transition};
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -157,7 +157,7 @@ export function makeStyles(k: string) {
|
|
|
157
157
|
padding: ${table.tbody.padding};
|
|
158
158
|
border-bottom: ${table.border};
|
|
159
159
|
background: ${table.bgColor};
|
|
160
|
-
word-wrap:
|
|
160
|
+
word-wrap: break-word;
|
|
161
161
|
// overflow: hidden;
|
|
162
162
|
// text-overflow: ellipsis;
|
|
163
163
|
}
|
|
@@ -146,14 +146,15 @@ export function useFixedColumns(
|
|
|
146
146
|
export function getClassAndStyleForFixed(
|
|
147
147
|
{className, fixed, align}: Props<TableColumnProps>,
|
|
148
148
|
offset: number,
|
|
149
|
+
k: string,
|
|
149
150
|
checkType?: TableProps['checkType'],
|
|
150
151
|
) {
|
|
151
152
|
const extraOffset = checkType && checkType !== 'none' && fixed === 'left' ? 40 : 0;
|
|
152
153
|
return {
|
|
153
154
|
className: cx({
|
|
154
155
|
[className as string]: !!className,
|
|
155
|
-
[
|
|
156
|
-
[
|
|
156
|
+
[`${k}-fixed-${fixed}`]: !!fixed,
|
|
157
|
+
[`${k}-align-${align}`]: !!align,
|
|
157
158
|
}),
|
|
158
159
|
style: fixed ? {[fixed]: `${offset + extraOffset}px`} : null,
|
|
159
160
|
};
|