@king-design/vue 3.4.3-beta.0 → 3.4.3-beta.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/__tests__/__snapshots__/Vue Next Demos.md +177 -215
- package/__tests__/components/editable.spec.ts +1 -1
- package/components/button/index.vdt.js +1 -1
- package/components/button/styles.js +3 -3
- package/components/diagram/shapes/callout.d.ts +1 -1
- package/components/diagram/shapes/circle.d.ts +1 -1
- package/components/diagram/shapes/document.d.ts +1 -1
- package/components/diagram/shapes/ellipse.d.ts +1 -1
- package/components/diagram/shapes/hexagon.d.ts +1 -1
- package/components/diagram/shapes/image.d.ts +1 -1
- package/components/diagram/shapes/parallelogram.d.ts +1 -1
- package/components/diagram/shapes/rectangle.d.ts +1 -1
- package/components/diagram/shapes/square.d.ts +1 -1
- package/components/diagram/shapes/text.d.ts +1 -1
- package/components/dialog/styles.js +3 -3
- package/components/dropdown/item.js +2 -5
- package/components/editable/index.spec.js +8 -8
- package/components/editable/index.vdt.js +1 -3
- package/components/editable/styles.d.ts +0 -1
- package/components/editable/styles.js +1 -4
- package/components/ellipsis/index.vdt.js +0 -1
- package/components/menu/styles.js +1 -1
- package/components/select/useImmutable.js +1 -2
- package/components/switch/index.js +1 -1
- package/components/table/cell.d.ts +0 -1
- package/components/table/cell.vdt.js +3 -13
- package/components/table/column.d.ts +0 -1
- package/components/table/column.js +0 -1
- package/components/table/row.d.ts +1 -2
- package/components/table/row.js +2 -3
- package/components/table/row.vdt.js +1 -3
- package/components/table/styles.js +1 -1
- package/components/table/table.d.ts +0 -2
- package/components/table/table.js +1 -2
- package/components/table/table.vdt.js +0 -14
- package/components/table/useGroup.js +1 -1
- package/components/table/useTree.d.ts +1 -1
- package/components/table/useTree.js +2 -30
- package/components/tooltip/tooltip.d.ts +0 -1
- package/components/tooltip/tooltip.js +1 -9
- package/components/treeSelect/index.vdt.js +0 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
|
@@ -35,7 +35,7 @@ describe('Editable', () => {
|
|
|
35
35
|
container.querySelector<HTMLDivElement>('.k-icon')!.click();
|
|
36
36
|
await wait();
|
|
37
37
|
|
|
38
|
-
const input = container.querySelector('.k-input
|
|
38
|
+
const input = container.querySelector('.k-input input') as HTMLInputElement;
|
|
39
39
|
expect(input.selectionStart).to.eql(0);
|
|
40
40
|
expect(input.selectionEnd).to.eql(1);
|
|
41
41
|
|
|
@@ -55,7 +55,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
var classNameObj = (_classNameObj = {}, _classNameObj[cls('btn')] = true, _classNameObj[cls(size)] = size !== 'default', _classNameObj[cls(type)] = !color, _classNameObj[cls("btn-icon")] = icon, _classNameObj[className] = className, _classNameObj[cls('circle')] = circle, _classNameObj[cls('loading')] = loading, _classNameObj[cls('fluid')] = fluid, _classNameObj[cls('active')] = checked, _classNameObj[cls('
|
|
58
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[cls('btn')] = true, _classNameObj[cls(size)] = size !== 'default', _classNameObj[cls(type)] = !color, _classNameObj[cls("btn-icon")] = icon, _classNameObj[className] = className, _classNameObj[cls('circle')] = circle, _classNameObj[cls('loading')] = loading, _classNameObj[cls('fluid')] = fluid, _classNameObj[cls('active')] = checked, _classNameObj[cls('disabled')] = disabled || loading, _classNameObj[cls('ghost')] = ghost, _classNameObj[cls('custom')] = color, _classNameObj[makeButtonStyles(k, iconSide, color)] = true, _classNameObj);
|
|
59
59
|
var loadingIcon = _$cc(Icon, {
|
|
60
60
|
'className': _$cn("ion-load-c " + k + "-icon-loading"),
|
|
61
61
|
'size': size /*loadingSizeMap[size]*/,
|
|
@@ -11,7 +11,7 @@ var btnStyles = {
|
|
|
11
11
|
return theme.color.text;
|
|
12
12
|
},
|
|
13
13
|
bgColor: '#fff',
|
|
14
|
-
lineHeight: '1',
|
|
14
|
+
lineHeight: '1.15',
|
|
15
15
|
get padding() {
|
|
16
16
|
return "0 16px";
|
|
17
17
|
},
|
|
@@ -199,8 +199,8 @@ export var makeButtonStyles = cache(function makeButtonStyles(k, iconSide, color
|
|
|
199
199
|
// extract static styles to individual css method for performance
|
|
200
200
|
css("display:inline-flex;align-items:center;justify-content:center;cursor:pointer;height:", button.height, ";padding:", button.padding, ";outline:none;vertical-align:middle;color:", button.color, ";background:", button.bgColor, ";border-radius:", button.borderRadius, ";border:1px solid ", button.borderColor, ";font-size:", button.fontSize, ";white-space:nowrap;transition:all ", button.transition, ";line-height:", button.lineHeight, ";.", k, "-icon{color:inherit;}&.", k, "-default,&.", k, "-none,&.", k, "-flat{.", k, "-icon{color:", theme.color.lightBlack, ";}&:hover{.", k, "-icon{color:inherit;}}}&:hover,&:focus{border-color:", button.hoverBorderColor, ";color:", button.hoverColor, ";}&:active{background:", palette(theme.color.primary, -4), ";}.", k, "-button-input{position:absolute;opacity:0;width:0;height:0;}", _mapInstanceProperty(types).call(types, function (type) {
|
|
201
201
|
var typeStyles = button[type];
|
|
202
|
-
return /*#__PURE__*/css("&.", k, "-", type, "{background:", typeStyles.bgColor, ";color:", typeStyles.color, ";border-color:", typeStyles.borderColor, ";&:hover,&:focus{background:", palette(typeStyles.bgColor, -1), ";border-color:", typeStyles.hoverBorderColor, ";color:", typeStyles.color, ";}&:active{background:", palette(typeStyles.bgColor, 1), ";border-color:", palette(typeStyles.borderColor, 1), ";}
|
|
203
|
-
}), "&.", k, "-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}
|
|
202
|
+
return /*#__PURE__*/css("&.", k, "-", type, "{background:", typeStyles.bgColor, ";color:", typeStyles.color, ";border-color:", typeStyles.borderColor, ";&:hover,&:focus{background:", palette(typeStyles.bgColor, -1), ";border-color:", typeStyles.hoverBorderColor, ";color:", typeStyles.color, ";}&:active{background:", palette(typeStyles.bgColor, 1), ";border-color:", palette(typeStyles.borderColor, 1), ";}}");
|
|
203
|
+
}), "&.", k, "-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}}", color && /*#__PURE__*/css("&.", k, "-custom{color:", color, ";border-color:", color, ";&:hover,&:focus{background:", palette(color, -4), ";}&:active{background:", palette(color, -3), ";}}"), " &.", k, "-link{color:", link.color, ";&:hover{color:", link.hoverColor, ";background:", link.hoverBgColor, ";}}&.", k, "-none,&.", k, "-link,&.", k, "-flat{background:transparent;&,&:hover{border:none;}&.", k, "-active{color:", theme.color.primary, ";}}&.", k, "-none:hover{background:", button.none.hoverBgColor, ";}&.", k, "-flat{background:", button.none.hoverBgColor, ";}&.", k, "-disabled{.", k, "-icon{color:inherit;}&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.", k, "-none.", k, "-disabled,&.", k, "-link.", k, "-disabled{&,&:hover{background:transparent;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
204
204
|
var styles = button[size];
|
|
205
205
|
return /*#__PURE__*/css("&.", k, "-", size, "{font-size:", styles.fontSize, ";height:", styles.height, ";padding:", styles.padding, ";&.", k, "-btn-icon{width:", styles.height, ";}}");
|
|
206
206
|
}), "&.", k, "-btn-icon{width:", button.height, ";padding:0;.", k, "-icon{margin:0;}}&.", k, "-fluid{width:100%;padding:0;}&.", k, "-circle{border-radius:calc(", button.large.height, " / 2);}&.", k, "-loading{", _mapInstanceProperty(types).call(types, function (type) {
|
|
@@ -12,7 +12,7 @@ export declare class DCallout extends DShape {
|
|
|
12
12
|
rotatable?: boolean | undefined;
|
|
13
13
|
editable?: boolean | undefined;
|
|
14
14
|
connectable?: boolean | undefined;
|
|
15
|
-
strokeStyle?: "
|
|
15
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
16
16
|
label?: string | number | undefined;
|
|
17
17
|
style?: Record<string, string | number> | undefined;
|
|
18
18
|
data?: any;
|
|
@@ -12,7 +12,7 @@ export declare class DCircle extends DShape {
|
|
|
12
12
|
rotatable?: boolean | undefined;
|
|
13
13
|
editable?: boolean | undefined;
|
|
14
14
|
connectable?: boolean | undefined;
|
|
15
|
-
strokeStyle?: "
|
|
15
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
16
16
|
label?: string | number | undefined;
|
|
17
17
|
style?: Record<string, string | number> | undefined;
|
|
18
18
|
data?: any;
|
|
@@ -12,7 +12,7 @@ export declare class DDocument extends DShape {
|
|
|
12
12
|
rotatable?: boolean | undefined;
|
|
13
13
|
editable?: boolean | undefined;
|
|
14
14
|
connectable?: boolean | undefined;
|
|
15
|
-
strokeStyle?: "
|
|
15
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
16
16
|
label?: string | number | undefined;
|
|
17
17
|
style?: Record<string, string | number> | undefined;
|
|
18
18
|
data?: any;
|
|
@@ -12,7 +12,7 @@ export declare class DEllipse extends DShape {
|
|
|
12
12
|
rotatable?: boolean | undefined;
|
|
13
13
|
editable?: boolean | undefined;
|
|
14
14
|
connectable?: boolean | undefined;
|
|
15
|
-
strokeStyle?: "
|
|
15
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
16
16
|
label?: string | number | undefined;
|
|
17
17
|
style?: Record<string, string | number> | undefined;
|
|
18
18
|
data?: any;
|
|
@@ -12,7 +12,7 @@ export declare class DHexagon extends DShape {
|
|
|
12
12
|
rotatable?: boolean | undefined;
|
|
13
13
|
editable?: boolean | undefined;
|
|
14
14
|
connectable?: boolean | undefined;
|
|
15
|
-
strokeStyle?: "
|
|
15
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
16
16
|
label?: string | number | undefined;
|
|
17
17
|
style?: Record<string, string | number> | undefined;
|
|
18
18
|
data?: any;
|
|
@@ -18,7 +18,7 @@ export declare class DImage extends DShape<DImageProps> {
|
|
|
18
18
|
rotatable?: boolean | undefined;
|
|
19
19
|
editable?: boolean | undefined;
|
|
20
20
|
connectable?: boolean | undefined;
|
|
21
|
-
strokeStyle?: "
|
|
21
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
22
22
|
label?: string | number | undefined;
|
|
23
23
|
style?: Record<string, string | number> | undefined;
|
|
24
24
|
data?: any;
|
|
@@ -12,7 +12,7 @@ export declare class DParallelogram extends DShape {
|
|
|
12
12
|
rotatable?: boolean | undefined;
|
|
13
13
|
editable?: boolean | undefined;
|
|
14
14
|
connectable?: boolean | undefined;
|
|
15
|
-
strokeStyle?: "
|
|
15
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
16
16
|
label?: string | number | undefined;
|
|
17
17
|
style?: Record<string, string | number> | undefined;
|
|
18
18
|
data?: any;
|
|
@@ -18,7 +18,7 @@ export declare class DRectangle extends DShape<DRectangleProps> {
|
|
|
18
18
|
rotatable?: boolean | undefined;
|
|
19
19
|
editable?: boolean | undefined;
|
|
20
20
|
connectable?: boolean | undefined;
|
|
21
|
-
strokeStyle?: "
|
|
21
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
22
22
|
label?: string | number | undefined;
|
|
23
23
|
style?: Record<string, string | number> | undefined;
|
|
24
24
|
data?: any;
|
|
@@ -13,7 +13,7 @@ export declare class DSquare extends DRectangle {
|
|
|
13
13
|
rotatable?: boolean | undefined;
|
|
14
14
|
editable?: boolean | undefined;
|
|
15
15
|
connectable?: boolean | undefined;
|
|
16
|
-
strokeStyle?: "
|
|
16
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
17
17
|
label?: string | number | undefined;
|
|
18
18
|
style?: Record<string, string | number> | undefined;
|
|
19
19
|
data?: any;
|
|
@@ -12,7 +12,7 @@ export declare class DText extends DShape {
|
|
|
12
12
|
rotatable?: boolean | undefined;
|
|
13
13
|
editable?: boolean | undefined;
|
|
14
14
|
connectable?: boolean | undefined;
|
|
15
|
-
strokeStyle?: "
|
|
15
|
+
strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
|
|
16
16
|
label?: string | number | undefined;
|
|
17
17
|
style?: Record<string, string | number> | undefined;
|
|
18
18
|
data?: any;
|
|
@@ -58,11 +58,11 @@ var defaults = {
|
|
|
58
58
|
padding: "0 24px",
|
|
59
59
|
bodyMarginTop: "-25px",
|
|
60
60
|
tipIconMarginBottom: '10px',
|
|
61
|
-
tipIconFontSize: '
|
|
62
|
-
tipIconLineHeight: '
|
|
61
|
+
tipIconFontSize: '37px',
|
|
62
|
+
tipIconLineHeight: '37px',
|
|
63
63
|
// with title
|
|
64
64
|
titleFontWeight: '500',
|
|
65
|
-
titleTipIconFontSize: '
|
|
65
|
+
titleTipIconFontSize: '37px',
|
|
66
66
|
titleFontSize: '14px',
|
|
67
67
|
wrapperPaddingLeft: '8px',
|
|
68
68
|
titleBodyMarginTop: '-36px'
|
|
@@ -50,11 +50,8 @@ export var DropdownItem = /*#__PURE__*/function (_Component) {
|
|
|
50
50
|
// hide all dropdowns
|
|
51
51
|
var dropdown = this.dropdown;
|
|
52
52
|
do {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
dropdown = dropdown.dropdown;
|
|
57
|
-
} while (dropdown);
|
|
53
|
+
dropdown.hide(true);
|
|
54
|
+
} while (dropdown = dropdown.dropdown);
|
|
58
55
|
}
|
|
59
56
|
};
|
|
60
57
|
_proto.hasSubMenu = function hasSubMenu() {
|
|
@@ -24,7 +24,7 @@ describe('Editable', function () {
|
|
|
24
24
|
case 5:
|
|
25
25
|
expect(element.innerHTML).to.matchSnapshot();
|
|
26
26
|
// input
|
|
27
|
-
input = element.querySelector('
|
|
27
|
+
input = element.querySelector('input');
|
|
28
28
|
input.value = 'test';
|
|
29
29
|
dispatchEvent(input, 'blur');
|
|
30
30
|
_context.next = 11;
|
|
@@ -39,7 +39,7 @@ describe('Editable', function () {
|
|
|
39
39
|
return wait();
|
|
40
40
|
case 16:
|
|
41
41
|
expect(element.innerHTML).to.matchSnapshot();
|
|
42
|
-
input = element.querySelector('
|
|
42
|
+
input = element.querySelector('input');
|
|
43
43
|
input.value = 'new';
|
|
44
44
|
dispatchEvent(input, 'keydown', {
|
|
45
45
|
keyCode: 27
|
|
@@ -56,7 +56,7 @@ describe('Editable', function () {
|
|
|
56
56
|
return wait();
|
|
57
57
|
case 27:
|
|
58
58
|
expect(element.innerHTML).to.matchSnapshot();
|
|
59
|
-
input = element.querySelector('
|
|
59
|
+
input = element.querySelector('input');
|
|
60
60
|
input.value = 'new';
|
|
61
61
|
dispatchEvent(input, 'keydown', {
|
|
62
62
|
keyCode: 13
|
|
@@ -84,7 +84,7 @@ describe('Editable', function () {
|
|
|
84
84
|
_context2.next = 5;
|
|
85
85
|
return wait();
|
|
86
86
|
case 5:
|
|
87
|
-
input = findDomFromVNode(first.$lastInput, true).querySelector('
|
|
87
|
+
input = findDomFromVNode(first.$lastInput, true).querySelector('input');
|
|
88
88
|
dispatchEvent(input, 'focus');
|
|
89
89
|
input.value = 'a';
|
|
90
90
|
dispatchEvent(input, 'input');
|
|
@@ -98,7 +98,7 @@ describe('Editable', function () {
|
|
|
98
98
|
_context2.next = 16;
|
|
99
99
|
return wait();
|
|
100
100
|
case 16:
|
|
101
|
-
input = findDomFromVNode(second.$lastInput, true).querySelector('
|
|
101
|
+
input = findDomFromVNode(second.$lastInput, true).querySelector('input');
|
|
102
102
|
input.value = 'a';
|
|
103
103
|
dispatchEvent(input, 'input');
|
|
104
104
|
dispatchEvent(input, 'blur');
|
|
@@ -111,7 +111,7 @@ describe('Editable', function () {
|
|
|
111
111
|
_context2.next = 26;
|
|
112
112
|
return wait();
|
|
113
113
|
case 26:
|
|
114
|
-
input = findDomFromVNode(third.$lastInput, true).querySelector('
|
|
114
|
+
input = findDomFromVNode(third.$lastInput, true).querySelector('input');
|
|
115
115
|
input.value = 'a';
|
|
116
116
|
dispatchEvent(input, 'input');
|
|
117
117
|
dispatchEvent(input, 'blur');
|
|
@@ -164,7 +164,7 @@ describe('Editable', function () {
|
|
|
164
164
|
_context4.next = 7;
|
|
165
165
|
return wait();
|
|
166
166
|
case 7:
|
|
167
|
-
input = element.querySelector("
|
|
167
|
+
input = element.querySelector("input");
|
|
168
168
|
input.value = 'aa';
|
|
169
169
|
dispatchEvent(input, 'blur');
|
|
170
170
|
_context4.next = 12;
|
|
@@ -175,7 +175,7 @@ describe('Editable', function () {
|
|
|
175
175
|
_context4.next = 16;
|
|
176
176
|
return wait();
|
|
177
177
|
case 16:
|
|
178
|
-
input = element.querySelector("
|
|
178
|
+
input = element.querySelector("input");
|
|
179
179
|
expect(input.value).to.eql('aa');
|
|
180
180
|
case 18:
|
|
181
181
|
case "end":
|
|
@@ -31,9 +31,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
31
31
|
'ref': this.inputRef,
|
|
32
32
|
'frozenOnInput': true,
|
|
33
33
|
'ev-$mounted': this.select,
|
|
34
|
-
'
|
|
35
|
-
'type': 'textarea',
|
|
36
|
-
'rows': 'auto'
|
|
34
|
+
'autoWidth': true
|
|
37
35
|
}, null, this.inputRef), 0, 'c-ellipsis'), !disabled && !editing ? _$cc(Tooltip, {
|
|
38
36
|
'content': tip,
|
|
39
37
|
'children': _$cc(Icon, {
|
|
@@ -5,9 +5,6 @@ import '../../styles/global';
|
|
|
5
5
|
import { cache } from '../utils';
|
|
6
6
|
var defaults = {
|
|
7
7
|
iconGap: '0 0 0 8px',
|
|
8
|
-
get smallPadding() {
|
|
9
|
-
return theme.small.padding;
|
|
10
|
-
},
|
|
11
8
|
// invalid
|
|
12
9
|
invalid: {
|
|
13
10
|
get border() {
|
|
@@ -24,5 +21,5 @@ setDefault(function () {
|
|
|
24
21
|
});
|
|
25
22
|
export { editable };
|
|
26
23
|
export var makeStyles = cache(function makeStyles(k) {
|
|
27
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;.", k, "-editable-icon{margin:", editable.iconGap, ";}&.", k, "-invalid{.", k, "-input-wrapper{border:", editable.invalid.border, "!important;}}
|
|
24
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;.", k, "-editable-icon{margin:", editable.iconGap, ";}&.", k, "-invalid{.", k, "-input-wrapper{border:", editable.invalid.border, "!important;}}");
|
|
28
25
|
});
|
|
@@ -115,7 +115,7 @@ export var makeMenuStyles = cache(function makeMenuStyles(k) {
|
|
|
115
115
|
return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";position:relative;}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";padding:0 16px;color:", menu.header.color, ";font-size:", menu.header.fontSize, ";font-weight:bold;}.", k, "-menu-body{padding:", menu.item.bodyPadding, ";max-height:calc(100% - ", menu.header.height, ");overflow-y:auto;overflow-x:hidden;scrollbar-width:none;}.", k, "-menu-title{height:", menu.title.height, ";border-top:", menu.border, ";margin-top:4px;.", k, "-menu-name{transition:all ", menu.transition, ";height:", menu.title.height, ";color:", menu.title.color, ";font-weight:bold;}}.", k, "-menu-arrow-box{width:14px;height:60px;cursor:pointer;background:", menu.bgColor, ";border-radius:0 8px 8px 0;position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:calc(", menu.width, " - 2px);transition:left ", menu.transition, ";transform:translateY(-50%);border:", menu.border, ";border-left:none;.", k, "-icon{margin-right:0;}&:hover{.", k, "-menu-arrow:before{color:", menu.item.activeBgColor, ";}}}&.", k, "-light{border-right:1px solid ", theme.color.disabledBg, ";background:", menu.light.bgColor, ";.", k, "-menu-header{color:", menu.light.title.color, ";}.", k, "-menu-item{.", k, "-menu-item-title{color:", menu.light.item.color, ";&:hover{background:", menu.light.item.hoverBg, ";}}.", k, "-menu-item-arrow{color:", menu.light.item.color, ";}&.", k, "-highlighted{>.", k, "-menu-item-title{color:", menu.light.item.hoverColor, ";}}&.", k, "-disabled{>.", k, "-menu-item-title{color:", menu.light.item.disabledColor, "!important;}}}.", k, "-menu-title{border-top:", menu.light.border, ";.", k, "-menu-name{color:", menu.light.title.color, ";}}.", k, "-menu-arrow-box{background:", menu.light.bgColor, ";border:", menu.light.border, ";border-left:none;&:hover{.", k, "-menu-arrow:before{color:", menu.light.active.color, ";}}}.", k, "-menu:not(.", k, "-dropdown-menu){background:", menu.light.bgColor, ";}&.", k, "-horizontal{.", k, "-menu-header{border-right:", menu.light.border, ";}.", k, "-menu-body>.", k, "-menu-title{border-right:", menu.light.border, ";}}.", k, "-menu-item.", k, "-active{>.", k, "-menu-item-title{color:", menu.light.active.color, "!important;background:", menu.light.active.bgColor, ";}}.", k, "-sub-menu{.", k, "-menu-item-title,.", k, "-menu-item-arrow{color:", menu.light.item.subTitleColor, "!important;}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
116
116
|
var styles = menu[size];
|
|
117
117
|
return /*#__PURE__*/css("&.", k, "-", size, "{width:", styles.width, ";font-size:", styles.fontSize, ";.", k, "-menu{font-size:", styles.fontSize, ";}.", k, "-menu-arrow-box{left:calc(", styles.width, " - 2px);}}");
|
|
118
|
-
}), "&.", k, "-collapsed{width:calc(", menu.icon.width, " + (", getLeft(menu.item.padding), " + ", getLeft(menu.item.bodyPadding), ") * 2);.", k, "-icon{margin-right:0;}.", k, "-menu-item-arrow{display:none;}}&.", k, "-collapsed-arrow{width:0px;border-left:none;.", k, "-menu-header{padding:0;}.", k, "-menu-body{overflow:hidden;padding:0;}.", k, "-menu-arrow-box{left:0;.", k, "-menu-arrow:before{transform:rotateY(180deg);}}}&.", k, "-dropdown-menu{width:fit-content;min-width:", menu.dropdown.minWidth, ";.", k, "-menu-item-arrow{transform:rotate(-90deg);}}&.", k, "-horizontal{width:auto;display:flex;.", k, "-menu-body{display:flex;align-items:center;.", k, "-menu-title{border-top:none;border-right:", menu.border, ";}}}");
|
|
118
|
+
}), "&.", k, "-collapsed{width:calc(", menu.icon.width, " + (", getLeft(menu.item.padding), " + ", getLeft(menu.item.bodyPadding), ") * 2);.", k, "-icon{margin-right:0;}.", k, "-menu-item-arrow{display:none;}}&.", k, "-collapsed-arrow{width:0px;border-left:none;.", k, "-menu-header{padding:0;}.", k, "-menu-header{padding:0;}.", k, "-menu-body{overflow:hidden;padding:0;}.", k, "-menu-arrow-box{left:0;.", k, "-menu-arrow:before{transform:rotateY(180deg);}}}&.", k, "-dropdown-menu{width:fit-content;min-width:", menu.dropdown.minWidth, ";.", k, "-menu-item-arrow{transform:rotate(-90deg);}}&.", k, "-horizontal{width:auto;display:flex;.", k, "-menu-body{display:flex;align-items:center;.", k, "-menu-title{border-top:none;border-right:", menu.border, ";}}}");
|
|
119
119
|
});
|
|
120
120
|
export var makeTitleStyles = cache(function makeTitleStyles(k) {
|
|
121
121
|
var item = menu.item;
|
|
@@ -37,8 +37,7 @@ export function useImmutable() {
|
|
|
37
37
|
var _context;
|
|
38
38
|
return !_includesInstanceProperty(_context = immutableValues.value).call(_context, key);
|
|
39
39
|
}
|
|
40
|
-
setImmutableValues
|
|
41
|
-
// instance.on('$receive:children', setImmutableValues);
|
|
40
|
+
instance.on('$receive:children', setImmutableValues);
|
|
42
41
|
return {
|
|
43
42
|
immutableValues: immutableValues,
|
|
44
43
|
isClosable: isClosable
|
|
@@ -15,7 +15,6 @@ export interface TableCellProps {
|
|
|
15
15
|
rowspan: number;
|
|
16
16
|
onClickArrow: (e: MouseEvent) => void;
|
|
17
17
|
hasChildren: boolean;
|
|
18
|
-
loaded: boolean;
|
|
19
18
|
}
|
|
20
19
|
export declare class TableCell extends Component<TableCellProps> {
|
|
21
20
|
static template: string | import('intact-vue-next').Template<any>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, className as _$cn } from 'intact-vue-next';
|
|
2
2
|
import { getClassAndStyleForFixed } from './useFixedColumns';
|
|
3
3
|
import { get, noop } from 'intact-shared';
|
|
4
4
|
import { Button } from '../button';
|
|
5
5
|
import { Icon } from '../icon';
|
|
6
6
|
import { getTextByChildren } from '../utils';
|
|
7
|
-
import { Ellipsis } from '../ellipsis';
|
|
8
7
|
export default function ($props, $blocks, $__proto__) {
|
|
9
8
|
var _classNameObj;
|
|
10
9
|
$blocks || ($blocks = {});
|
|
@@ -22,8 +21,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
22
21
|
colspan = _this$get.colspan,
|
|
23
22
|
rowspan = _this$get.rowspan,
|
|
24
23
|
onClickArrow = _this$get.onClickArrow,
|
|
25
|
-
hasChildren = _this$get.hasChildren
|
|
26
|
-
loaded = _this$get.loaded;
|
|
24
|
+
hasChildren = _this$get.hasChildren;
|
|
27
25
|
var k = this.config.k;
|
|
28
26
|
var blocks = props.$blocks;
|
|
29
27
|
var children = get(data, props.key);
|
|
@@ -33,11 +31,6 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
33
31
|
children = template(noop, [data, rowIndex]);
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
|
-
if (props.ellipsis) {
|
|
37
|
-
children = _$cc(Ellipsis, {
|
|
38
|
-
'children': children
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
34
|
var _getClassAndStyleForF = getClassAndStyleForFixed(props, offset, k, checkType),
|
|
42
35
|
className = _getClassAndStyleForF.className,
|
|
43
36
|
style = _getClassAndStyleForF.style;
|
|
@@ -53,12 +46,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
53
46
|
'size': 'mini',
|
|
54
47
|
'className': _$cn(k + "-table-arrow"),
|
|
55
48
|
'ev-click': onClickArrow,
|
|
56
|
-
'children':
|
|
49
|
+
'children': _$cc(Icon, {
|
|
57
50
|
'className': _$cn(k + "-icon-right"),
|
|
58
51
|
'size': 'small'
|
|
59
|
-
}) : _$cc(Icon, {
|
|
60
|
-
'className': _$cn(k + "-tree-icon ion-load-c"),
|
|
61
|
-
'rotate': true
|
|
62
52
|
})
|
|
63
53
|
}) : undefined, children], 0, _$cn(classNameObj), {
|
|
64
54
|
'style': style,
|
|
@@ -20,11 +20,10 @@ export interface TableRowProps {
|
|
|
20
20
|
spreaded: boolean;
|
|
21
21
|
hasChildren: boolean;
|
|
22
22
|
indent: number;
|
|
23
|
-
onToggleSpreadRow: (key: TableRowKey
|
|
23
|
+
onToggleSpreadRow: (key: TableRowKey) => void;
|
|
24
24
|
onBeforeUnmount: (key: TableRowKey) => void;
|
|
25
25
|
offsetMap: Record<Key, number>;
|
|
26
26
|
animation: boolean;
|
|
27
|
-
loaded: boolean;
|
|
28
27
|
draggable: boolean;
|
|
29
28
|
draggingKey: TableRowKey | null;
|
|
30
29
|
onRowDragStart: DragCallback;
|
package/components/table/row.js
CHANGED
|
@@ -70,9 +70,8 @@ export var TableRow = /*#__PURE__*/function (_Component) {
|
|
|
70
70
|
e.stopPropagation();
|
|
71
71
|
var _this$get3 = this.get(),
|
|
72
72
|
onToggleSpreadRow = _this$get3.onToggleSpreadRow,
|
|
73
|
-
key = _this$get3.key
|
|
74
|
-
|
|
75
|
-
onToggleSpreadRow(key, data);
|
|
73
|
+
key = _this$get3.key;
|
|
74
|
+
onToggleSpreadRow(key);
|
|
76
75
|
};
|
|
77
76
|
_proto.onMouseEnter = function onMouseEnter(e) {
|
|
78
77
|
// for tooltip
|
|
@@ -33,8 +33,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
33
33
|
offsetMap = _this$get.offsetMap,
|
|
34
34
|
draggable = _this$get.draggable,
|
|
35
35
|
draggingKey = _this$get.draggingKey,
|
|
36
|
-
animation = _this$get.animation
|
|
37
|
-
loaded = _this$get.loaded;
|
|
36
|
+
animation = _this$get.animation;
|
|
38
37
|
var k = this.config.k;
|
|
39
38
|
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-checked"] = checked, _classNameObj[k + "-selected"] = selected, _classNameObj[k + "-spreaded"] = spreaded, _classNameObj[k + "-dragging"] = draggingKey === key, _classNameObj[className] = className, _classNameObj);
|
|
40
39
|
var getGridItem = function getGridItem(columnIndex) {
|
|
@@ -83,7 +82,6 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
83
82
|
'columnIndex': columnIndex,
|
|
84
83
|
'rowIndex': rowIndex,
|
|
85
84
|
'data': data,
|
|
86
|
-
'loaded': loaded,
|
|
87
85
|
'offset': offsetMap[columnKey],
|
|
88
86
|
'checkType': checkType,
|
|
89
87
|
'indent': indent,
|
|
@@ -90,7 +90,7 @@ setDefault(function () {
|
|
|
90
90
|
makeGroupMenuStyles == null || makeGroupMenuStyles.clearCache();
|
|
91
91
|
});
|
|
92
92
|
export var makeStyles = cache(function makeStyles(k) {
|
|
93
|
-
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-
|
|
93
|
+
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&.", k, "-fixed-right:before{left:-2px;}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-hidden{display:none;}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
|
|
94
94
|
return /*#__PURE__*/css(".", k, "-align-", type, "{text-align:", type, ";}");
|
|
95
95
|
}), ">.", k, "-pagination{margin:16px 0;}&.", k, "-fix-header{min-height:0;.", k, "-table-wrapper{height:100%;}}");
|
|
96
96
|
});
|
|
@@ -38,7 +38,6 @@ export interface TableProps<T = any, K extends TableRowKey = TableRowKey, C exte
|
|
|
38
38
|
animation?: boolean | [boolean, boolean];
|
|
39
39
|
hideHeader?: boolean;
|
|
40
40
|
pagination?: boolean | PaginationProps;
|
|
41
|
-
load?: (value: T) => Promise<void> | void;
|
|
42
41
|
}
|
|
43
42
|
export interface TableEvents<T = any, K extends TableRowKey = number> {
|
|
44
43
|
clickRow: [T, number, K];
|
|
@@ -61,7 +60,6 @@ export interface TableBlocks<T = unknown> {
|
|
|
61
60
|
empty: null;
|
|
62
61
|
tooltip: [T, number];
|
|
63
62
|
expand: [T, number];
|
|
64
|
-
footer: null;
|
|
65
63
|
}
|
|
66
64
|
type CheckType = 'checkbox' | 'radio' | 'none';
|
|
67
65
|
export type TableCheckType = CheckType;
|
|
@@ -183,7 +183,6 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
183
183
|
'key': key,
|
|
184
184
|
'cols': cols,
|
|
185
185
|
'data': value,
|
|
186
|
-
'loaded': value.loaded,
|
|
187
186
|
'checkType': checkType,
|
|
188
187
|
'hasFixedLeft': hasFixedLeft,
|
|
189
188
|
'onClick': _this.clickRow,
|
|
@@ -260,19 +259,6 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
260
259
|
}
|
|
261
260
|
return hidden || !spreaded;
|
|
262
261
|
});
|
|
263
|
-
if ($blocks.footer) {
|
|
264
|
-
rows.push(_$ce(2, 'tr', _$ce(2, 'td', (_$blocks['footer'] = function ($super) {
|
|
265
|
-
return null;
|
|
266
|
-
}, __$blocks['footer'] = function ($super, data) {
|
|
267
|
-
var block = $blocks['footer'];
|
|
268
|
-
var callBlock = function callBlock() {
|
|
269
|
-
return _$blocks['footer'].call($this, $super, data);
|
|
270
|
-
};
|
|
271
|
-
return block ? block.call($this, callBlock, data) : callBlock();
|
|
272
|
-
}, __$blocks['footer'](_$no)), 0, _$cn(k + "-table-footer"), {
|
|
273
|
-
'colspan': colCount
|
|
274
|
-
}), 2, null, null, 'table-footer'));
|
|
275
|
-
}
|
|
276
262
|
return animation[0] ? _$cc(TransitionGroup, {
|
|
277
263
|
'name': 'k-fade-in-left',
|
|
278
264
|
'move': !draggingKey.value,
|
|
@@ -61,7 +61,7 @@ export function useGroup() {
|
|
|
61
61
|
function isEmptyValue(groupValue) {
|
|
62
62
|
var _instance$get4 = instance.get(),
|
|
63
63
|
multiple = _instance$get4.multiple;
|
|
64
|
-
return !groupValue || multiple && (!isArray(groupValue) || groupValue.every(function (value) {
|
|
64
|
+
return !groupValue && groupValue !== 0 || multiple && (!isArray(groupValue) || groupValue.every(function (value) {
|
|
65
65
|
return !value;
|
|
66
66
|
}));
|
|
67
67
|
}
|
|
@@ -2,7 +2,7 @@ import type { TableRowKey } from './table';
|
|
|
2
2
|
import { State } from '../../hooks/useState';
|
|
3
3
|
export declare function useTree(data: State<any[] | undefined>): {
|
|
4
4
|
isSpreaded: (key: TableRowKey) => boolean;
|
|
5
|
-
toggleSpreadRow: (key: TableRowKey
|
|
5
|
+
toggleSpreadRow: (key: TableRowKey) => void;
|
|
6
6
|
loopData: <T>(cb: (value: any, index: number, level: number, meta: T | null) => T, shouldBreak?: boolean) => void;
|
|
7
7
|
};
|
|
8
8
|
export declare function loopDataWithChildrenKey<T>(data: any[] | undefined, childrenKey: string | undefined, cb: (value: any, index: number, level: number, meta: T | null) => T, shouldBreak: boolean): void;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
3
1
|
import { useInstance } from 'intact-vue-next';
|
|
4
2
|
import { inArray } from './useChecked';
|
|
5
3
|
import { toggleArray } from '../utils';
|
|
@@ -8,34 +6,8 @@ export function useTree(data) {
|
|
|
8
6
|
function isSpreaded(key) {
|
|
9
7
|
return inArray(instance.get('spreadKeys'), key);
|
|
10
8
|
}
|
|
11
|
-
function toggleSpreadRow(
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
function _toggleSpreadRow() {
|
|
15
|
-
_toggleSpreadRow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(key, rowData) {
|
|
16
|
-
var _instance$get2, spreadKeys, load;
|
|
17
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
18
|
-
while (1) switch (_context.prev = _context.next) {
|
|
19
|
-
case 0:
|
|
20
|
-
_instance$get2 = instance.get(), spreadKeys = _instance$get2.spreadKeys, load = _instance$get2.load;
|
|
21
|
-
instance.set('spreadKeys', toggleArray(spreadKeys, key));
|
|
22
|
-
if (!(load && data.value && !rowData.loaded)) {
|
|
23
|
-
_context.next = 8;
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
rowData.loaded = false;
|
|
27
|
-
_context.next = 6;
|
|
28
|
-
return load(rowData);
|
|
29
|
-
case 6:
|
|
30
|
-
rowData.loaded = true;
|
|
31
|
-
instance.forceUpdate();
|
|
32
|
-
case 8:
|
|
33
|
-
case "end":
|
|
34
|
-
return _context.stop();
|
|
35
|
-
}
|
|
36
|
-
}, _callee);
|
|
37
|
-
}));
|
|
38
|
-
return _toggleSpreadRow.apply(this, arguments);
|
|
9
|
+
function toggleSpreadRow(key) {
|
|
10
|
+
instance.set('spreadKeys', toggleArray(instance.get('spreadKeys'), key));
|
|
39
11
|
}
|
|
40
12
|
function loopData(cb, shouldBreak) {
|
|
41
13
|
if (shouldBreak === void 0) {
|
|
@@ -23,7 +23,6 @@ export declare class Tooltip<T extends TooltipProps = TooltipProps, E extends To
|
|
|
23
23
|
static typeDefs: Required<TypeDefs<TooltipProps>>;
|
|
24
24
|
static defaults: () => Partial<TooltipProps>;
|
|
25
25
|
static events: Events<TooltipEvents>;
|
|
26
|
-
$isTooltip: boolean;
|
|
27
26
|
show(shouldFocus?: boolean): void;
|
|
28
27
|
hide(immediately: boolean): void;
|
|
29
28
|
}
|