bkui-vue 2.0.1-beta.29 → 2.0.1-beta.30
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/dist/index.cjs.js +62 -62
- package/dist/index.esm.js +9577 -9514
- package/dist/index.umd.js +62 -62
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/alert/alert.d.ts +0 -7
- package/lib/alert/index.d.ts +0 -15
- package/lib/alert/index.js +0 -1
- package/lib/checkbox/checkbox-group.d.ts +0 -16
- package/lib/checkbox/index.d.ts +0 -11
- package/lib/checkbox/index.js +0 -1
- package/lib/date-picker/date-picker.d.ts +0 -9
- package/lib/date-picker/index.d.ts +0 -19
- package/lib/date-picker/index.js +0 -4
- package/lib/date-picker/panel/time-range.d.ts +0 -9
- package/lib/date-picker/panel/time.d.ts +0 -9
- package/lib/date-picker/props.d.ts +0 -4
- package/lib/date-picker/time-picker.d.ts +0 -9
- package/lib/dialog/dialog.d.ts +11 -0
- package/lib/dialog/index.d.ts +23 -0
- package/lib/dialog/props.d.ts +5 -0
- package/lib/dropdown/dropdown-item.d.ts +1 -1
- package/lib/dropdown/dropdown-menu.d.ts +1 -1
- package/lib/dropdown/index.d.ts +2 -2
- package/lib/form/form-item.d.ts +0 -16
- package/lib/form/index.d.ts +0 -11
- package/lib/form/index.js +0 -1
- package/lib/index.js +1 -1
- package/lib/modal/index.d.ts +28 -0
- package/lib/modal/index.js +33 -18
- package/lib/modal/modal.d.ts +11 -0
- package/lib/modal/props.mixin.d.ts +5 -0
- package/lib/pagination/index.d.ts +0 -19
- package/lib/pagination/index.js +29 -8
- package/lib/pagination/pagination.css +8 -8
- package/lib/pagination/pagination.d.ts +0 -13
- package/lib/pagination/pagination.less +14 -13
- package/lib/pagination/pagination.variable.css +8 -8
- package/lib/pop-confirm/index.d.ts +0 -32
- package/lib/pop-confirm/index.js +16 -18
- package/lib/pop-confirm/pop-confirm.css +3 -1
- package/lib/pop-confirm/pop-confirm.d.ts +0 -14
- package/lib/pop-confirm/pop-confirm.less +3 -1
- package/lib/pop-confirm/pop-confirm.variable.css +3 -1
- package/lib/pop-confirm/props.d.ts +1 -7
- package/lib/radio/radio-button.d.ts +2 -2
- package/lib/radio/radio-group.d.ts +2 -2
- package/lib/scrollbar/index.js +1 -1
- package/lib/select/index.js +1 -1
- package/lib/sideslider/index.d.ts +23 -0
- package/lib/sideslider/index.js +1 -0
- package/lib/sideslider/sideslider.css +7 -8
- package/lib/sideslider/sideslider.d.ts +11 -0
- package/lib/sideslider/sideslider.less +7 -8
- package/lib/sideslider/sideslider.variable.css +7 -8
- package/lib/steps/index.d.ts +0 -15
- package/lib/steps/index.js +0 -1
- package/lib/steps/steps.d.ts +0 -10
- package/lib/table/hooks/use-columns.d.ts +7 -2
- package/lib/table/hooks/use-head.d.ts +1 -0
- package/lib/table/hooks/use-layout.d.ts +1 -0
- package/lib/table/index.js +208 -62
- package/lib/table/props.d.ts +11 -2
- package/lib/table/table.css +20 -8
- package/lib/table/table.less +17 -0
- package/lib/table/table.variable.css +20 -8
- package/lib/table/utils.d.ts +2 -2
- package/lib/table-column/index.js +2 -2
- package/lib/time-picker/index.d.ts +0 -19
- package/lib/tree/index.js +3 -0
- package/lib/tree/props.d.ts +3 -0
- package/package.json +1 -1
package/lib/steps/index.d.ts
CHANGED
@@ -23,9 +23,6 @@ declare const BkSteps: {
|
|
23
23
|
lineType: import("vue-types").VueTypeDef<"dashed" | "solid"> & {
|
24
24
|
default: "dashed" | "solid";
|
25
25
|
};
|
26
|
-
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
27
|
-
default: boolean;
|
28
|
-
};
|
29
26
|
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
30
27
|
default: string;
|
31
28
|
};
|
@@ -68,9 +65,6 @@ declare const BkSteps: {
|
|
68
65
|
lineType: import("vue-types").VueTypeDef<"dashed" | "solid"> & {
|
69
66
|
default: "dashed" | "solid";
|
70
67
|
};
|
71
|
-
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
72
|
-
default: boolean;
|
73
|
-
};
|
74
68
|
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
75
69
|
default: string;
|
76
70
|
};
|
@@ -86,7 +80,6 @@ declare const BkSteps: {
|
|
86
80
|
onClick?: (...args: any[]) => any;
|
87
81
|
"onUpdate:curStep"?: (...args: any[]) => any;
|
88
82
|
}, {
|
89
|
-
text: boolean;
|
90
83
|
extCls: string;
|
91
84
|
theme: "success" | "danger" | "warning" | "primary";
|
92
85
|
steps: unknown[];
|
@@ -127,9 +120,6 @@ declare const BkSteps: {
|
|
127
120
|
lineType: import("vue-types").VueTypeDef<"dashed" | "solid"> & {
|
128
121
|
default: "dashed" | "solid";
|
129
122
|
};
|
130
|
-
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
131
|
-
default: boolean;
|
132
|
-
};
|
133
123
|
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
134
124
|
default: string;
|
135
125
|
};
|
@@ -149,7 +139,6 @@ declare const BkSteps: {
|
|
149
139
|
jumpTo: (index: any) => Promise<void>;
|
150
140
|
resolveClassName: (cls: string) => string;
|
151
141
|
}, {}, {}, {}, {
|
152
|
-
text: boolean;
|
153
142
|
extCls: string;
|
154
143
|
theme: "success" | "danger" | "warning" | "primary";
|
155
144
|
steps: unknown[];
|
@@ -187,9 +176,6 @@ declare const BkSteps: {
|
|
187
176
|
lineType: import("vue-types").VueTypeDef<"dashed" | "solid"> & {
|
188
177
|
default: "dashed" | "solid";
|
189
178
|
};
|
190
|
-
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
191
|
-
default: boolean;
|
192
|
-
};
|
193
179
|
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
194
180
|
default: string;
|
195
181
|
};
|
@@ -209,7 +195,6 @@ declare const BkSteps: {
|
|
209
195
|
jumpTo: (index: any) => Promise<void>;
|
210
196
|
resolveClassName: (cls: string) => string;
|
211
197
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:curStep")[], "click" | "update:curStep", {
|
212
|
-
text: boolean;
|
213
198
|
extCls: string;
|
214
199
|
theme: "success" | "danger" | "warning" | "primary";
|
215
200
|
steps: unknown[];
|
package/lib/steps/index.js
CHANGED
@@ -569,7 +569,6 @@ var stepsProps = {
|
|
569
569
|
direction: (0,shared_namespaceObject.directionType)(),
|
570
570
|
status: (0,external_vue_types_namespaceObject.toType)('status', {}).def(StatusEnum.UNKNOWN),
|
571
571
|
lineType: (0,shared_namespaceObject.lineStyleType)(),
|
572
|
-
text: shared_namespaceObject.PropTypes.bool,
|
573
572
|
extCls: shared_namespaceObject.PropTypes.string,
|
574
573
|
steps: shared_namespaceObject.PropTypes.array.def([]),
|
575
574
|
beforeChange: shared_namespaceObject.PropTypes.func
|
package/lib/steps/steps.d.ts
CHANGED
@@ -48,9 +48,6 @@ declare const stepsProps: {
|
|
48
48
|
lineType: import("vue-types").VueTypeDef<"dashed" | "solid"> & {
|
49
49
|
default: "dashed" | "solid";
|
50
50
|
};
|
51
|
-
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
52
|
-
default: boolean;
|
53
|
-
};
|
54
51
|
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
55
52
|
default: string;
|
56
53
|
};
|
@@ -88,9 +85,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
88
85
|
lineType: import("vue-types").VueTypeDef<"dashed" | "solid"> & {
|
89
86
|
default: "dashed" | "solid";
|
90
87
|
};
|
91
|
-
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
92
|
-
default: boolean;
|
93
|
-
};
|
94
88
|
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
95
89
|
default: string;
|
96
90
|
};
|
@@ -130,9 +124,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
130
124
|
lineType: import("vue-types").VueTypeDef<"dashed" | "solid"> & {
|
131
125
|
default: "dashed" | "solid";
|
132
126
|
};
|
133
|
-
text: import("vue-types").VueTypeValidableDef<boolean> & {
|
134
|
-
default: boolean;
|
135
|
-
};
|
136
127
|
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
137
128
|
default: string;
|
138
129
|
};
|
@@ -148,7 +139,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
148
139
|
onClick?: (...args: any[]) => any;
|
149
140
|
"onUpdate:curStep"?: (...args: any[]) => any;
|
150
141
|
}, {
|
151
|
-
text: boolean;
|
152
142
|
extCls: string;
|
153
143
|
theme: "success" | "danger" | "warning" | "primary";
|
154
144
|
steps: unknown[];
|
@@ -1,16 +1,20 @@
|
|
1
1
|
import { IEmptyObject } from '../const';
|
2
|
-
import { Column, Settings, TablePropTypes } from '../props';
|
2
|
+
import { Column, IHeadGroup, Settings, TablePropTypes } from '../props';
|
3
3
|
declare const useColumns: (props: TablePropTypes) => {
|
4
4
|
needColSpan: import("vue").ComputedRef<boolean>;
|
5
5
|
needRowSpan: import("vue").ComputedRef<boolean>;
|
6
6
|
tableColumnSchema: WeakMap<object, any> & Omit<WeakMap<object, any>, keyof WeakMap<any, any>>;
|
7
7
|
tableColumnList: any[];
|
8
8
|
visibleColumns: Column[];
|
9
|
-
debounceUpdateColumns: import("lodash").DebouncedFunc<(columns: any) => void>;
|
9
|
+
debounceUpdateColumns: import("lodash").DebouncedFunc<(columns: any, onComplete?: any) => void>;
|
10
10
|
sortColumns: any[];
|
11
11
|
filterColumns: any[];
|
12
|
+
columnGroup: Column[][];
|
13
|
+
columnGroupMap: WeakMap<Column, IHeadGroup>;
|
12
14
|
clearColumnSort: () => void;
|
15
|
+
clearSelectionAll: () => void;
|
13
16
|
formatColumns: () => void;
|
17
|
+
flatColumnTemplate: (cols: Column[]) => any[];
|
14
18
|
isHiddenColumn: (col: Column) => any;
|
15
19
|
getColumnId: (col: Column) => any;
|
16
20
|
getColumnOrderWidth: (col: Column, orders?: string[]) => number;
|
@@ -33,6 +37,7 @@ declare const useColumns: (props: TablePropTypes) => {
|
|
33
37
|
getColumnRefAttribute: (col: Column | IEmptyObject, attributeName: string) => any;
|
34
38
|
getColumnCalcWidth: (column: Column) => any;
|
35
39
|
getColumnWidth: (column: Column) => any;
|
40
|
+
getGroupAttribute: (group: Column) => IHeadGroup;
|
36
41
|
resolveEventListener: (col: Column) => Record<string, (...args: any[]) => void> & {
|
37
42
|
[x: string]: (e: MouseEvent) => void;
|
38
43
|
};
|
@@ -13,6 +13,7 @@ declare const _default: (props: TablePropTypes, ctx: any) => {
|
|
13
13
|
setFixedColumns: (values: Column[]) => void;
|
14
14
|
setOffsetRight: () => void;
|
15
15
|
setLineHeight: (val: number) => void;
|
16
|
+
setHeaderRowCount: (val: number) => void;
|
16
17
|
initRootStyleVars: () => void;
|
17
18
|
refRoot: Ref<HTMLElement>;
|
18
19
|
refHead: Ref<HTMLElement>;
|
package/lib/table/index.js
CHANGED
@@ -17693,9 +17693,9 @@ var tableProps = {
|
|
17693
17693
|
stripe: shared_namespaceObject.PropTypes.bool.def(false),
|
17694
17694
|
/**
|
17695
17695
|
* 设置表格最小高度
|
17696
|
-
* 默认:LINE_HEIGHT *
|
17696
|
+
* 默认:LINE_HEIGHT * 2
|
17697
17697
|
*/
|
17698
|
-
minHeight: StringNumberType(LINE_HEIGHT
|
17698
|
+
minHeight: StringNumberType(LINE_HEIGHT),
|
17699
17699
|
/**
|
17700
17700
|
* 设置表格最d大高度
|
17701
17701
|
* 默认:auto,依赖外层高度
|
@@ -18423,51 +18423,65 @@ function v4(options, buf, offset) {
|
|
18423
18423
|
}
|
18424
18424
|
return columnCache.get(ctx);
|
18425
18425
|
};
|
18426
|
-
var
|
18427
|
-
var _node$
|
18428
|
-
if (!node || ((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'Table') {
|
18429
|
-
return;
|
18430
|
-
}
|
18431
|
-
if (((_node$type2 = node.type) === null || _node$type2 === void 0 ? void 0 : _node$type2.name) === 'TableColumn') {
|
18432
|
-
var _node$props$render, _node$children;
|
18433
|
-
var resolveProp = Object.assign({
|
18434
|
-
index: columnIndex
|
18435
|
-
}, copyProps(node.props), {
|
18436
|
-
field: node.props.prop || node.props.field,
|
18437
|
-
render: (_node$props$render = node.props.render) !== null && _node$props$render !== void 0 ? _node$props$render : (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"],
|
18438
|
-
uniqueId: getNodeCtxUid(node)
|
18439
|
-
});
|
18440
|
-
if (!columns.some(function (col) {
|
18441
|
-
return col.uniqueId === resolveProp.uniqueId;
|
18442
|
-
})) {
|
18443
|
-
columns.push((0,external_vue_namespaceObject.unref)(resolveProp));
|
18444
|
-
columnIndex = columnIndex + 1;
|
18445
|
-
}
|
18446
|
-
return;
|
18447
|
-
}
|
18426
|
+
var resolveNodeChilren = function resolveNodeChilren(node, rootNode, isColumnRoot) {
|
18427
|
+
var _node$component;
|
18448
18428
|
if (node !== null && node !== void 0 && (_node$component = node.component) !== null && _node$component !== void 0 && _node$component.subTree) {
|
18449
18429
|
var _node$component2;
|
18450
|
-
resolveChildNode(node === null || node === void 0 || (_node$component2 = node.component) === null || _node$component2 === void 0 ? void 0 : _node$component2.subTree);
|
18430
|
+
resolveChildNode(node === null || node === void 0 || (_node$component2 = node.component) === null || _node$component2 === void 0 ? void 0 : _node$component2.subTree, rootNode);
|
18451
18431
|
return;
|
18452
18432
|
}
|
18453
18433
|
if (typeof node === 'function') {
|
18454
18434
|
return node();
|
18455
18435
|
}
|
18456
18436
|
if (Array.isArray(node)) {
|
18457
|
-
node.forEach(
|
18437
|
+
node.forEach(function (c) {
|
18438
|
+
return resolveChildNode(c, rootNode);
|
18439
|
+
});
|
18458
18440
|
return;
|
18459
18441
|
}
|
18460
18442
|
if (Array.isArray(node === null || node === void 0 ? void 0 : node.children)) {
|
18461
|
-
node.children.forEach(
|
18443
|
+
node.children.forEach(function (c) {
|
18444
|
+
return resolveChildNode(c, rootNode);
|
18445
|
+
});
|
18462
18446
|
return;
|
18463
18447
|
}
|
18464
|
-
if ((0,external_vue_namespaceObject.isVNode)(node) && node !== null && node !== void 0 && node.children && typeof_typeof(node === null || node === void 0 ? void 0 : node.children) === 'object') {
|
18448
|
+
if (!isColumnRoot && (0,external_vue_namespaceObject.isVNode)(node) && node !== null && node !== void 0 && node.children && typeof_typeof(node === null || node === void 0 ? void 0 : node.children) === 'object') {
|
18465
18449
|
Object.keys(node.children).forEach(function (key) {
|
18466
|
-
return resolveChildNode(node.children[key]);
|
18450
|
+
return resolveChildNode(node.children[key], rootNode);
|
18467
18451
|
});
|
18468
18452
|
return;
|
18469
18453
|
}
|
18470
18454
|
};
|
18455
|
+
var resolveChildNode = function resolveChildNode(node, parent) {
|
18456
|
+
var _node$type, _node$type2;
|
18457
|
+
var rootNode = parent;
|
18458
|
+
if (!node || ((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'Table') {
|
18459
|
+
return;
|
18460
|
+
}
|
18461
|
+
if (((_node$type2 = node.type) === null || _node$type2 === void 0 ? void 0 : _node$type2.name) === 'TableColumn') {
|
18462
|
+
var _node$props$render, _node$children, _parent$children;
|
18463
|
+
var resolveProp = Object.assign({
|
18464
|
+
index: columnIndex
|
18465
|
+
}, copyProps(node.props), {
|
18466
|
+
field: node.props.prop || node.props.field,
|
18467
|
+
render: (_node$props$render = node.props.render) !== null && _node$props$render !== void 0 ? _node$props$render : (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"],
|
18468
|
+
uniqueId: getNodeCtxUid(node),
|
18469
|
+
children: []
|
18470
|
+
});
|
18471
|
+
var targetColumns = (_parent$children = parent === null || parent === void 0 ? void 0 : parent.children) !== null && _parent$children !== void 0 ? _parent$children : columns;
|
18472
|
+
if (!targetColumns.some(function (col) {
|
18473
|
+
return col.uniqueId === resolveProp.uniqueId;
|
18474
|
+
})) {
|
18475
|
+
targetColumns.push(resolveProp);
|
18476
|
+
columnIndex = columnIndex + 1;
|
18477
|
+
if (node.children) {
|
18478
|
+
resolveNodeChilren(node, resolveProp, true);
|
18479
|
+
}
|
18480
|
+
}
|
18481
|
+
return;
|
18482
|
+
}
|
18483
|
+
resolveNodeChilren(node, rootNode);
|
18484
|
+
};
|
18471
18485
|
var resolveColumns = function resolveColumns(children) {
|
18472
18486
|
columns.length = 0;
|
18473
18487
|
columnIndex = 0;
|
@@ -18482,7 +18496,9 @@ function v4(options, buf, offset) {
|
|
18482
18496
|
resolveChildNode((_ghostBody$component2 = ghostBody.component) === null || _ghostBody$component2 === void 0 ? void 0 : _ghostBody$component2.subTree);
|
18483
18497
|
} else {
|
18484
18498
|
var _ghostBody$children$d, _ghostBody$children, _ghostBody$children$d2;
|
18485
|
-
((_ghostBody$children$d = (_ghostBody$children = ghostBody.children) === null || _ghostBody$children === void 0 || (_ghostBody$children$d2 = _ghostBody$children["default"]) === null || _ghostBody$children$d2 === void 0 ? void 0 : _ghostBody$children$d2.call(_ghostBody$children)) !== null && _ghostBody$children$d !== void 0 ? _ghostBody$children$d : []).forEach(
|
18499
|
+
((_ghostBody$children$d = (_ghostBody$children = ghostBody.children) === null || _ghostBody$children === void 0 || (_ghostBody$children$d2 = _ghostBody$children["default"]) === null || _ghostBody$children$d2 === void 0 ? void 0 : _ghostBody$children$d2.call(_ghostBody$children)) !== null && _ghostBody$children$d !== void 0 ? _ghostBody$children$d : []).forEach(function (c) {
|
18500
|
+
return resolveChildNode(c);
|
18501
|
+
});
|
18486
18502
|
}
|
18487
18503
|
}
|
18488
18504
|
columns.sort(function (col1, col2) {
|
@@ -20043,6 +20059,8 @@ var useColumns = function useColumns(props) {
|
|
20043
20059
|
var uuid = esm_browser_v4();
|
20044
20060
|
var sortColumns = (0,external_vue_namespaceObject.reactive)([]);
|
20045
20061
|
var filterColumns = (0,external_vue_namespaceObject.reactive)([]);
|
20062
|
+
var columnGroup = (0,external_vue_namespaceObject.reactive)([]);
|
20063
|
+
var columnGroupMap = new WeakMap();
|
20046
20064
|
/**
|
20047
20065
|
* 用来记录列的排序状态
|
20048
20066
|
* @param col
|
@@ -20252,6 +20270,81 @@ var useColumns = function useColumns(props) {
|
|
20252
20270
|
};
|
20253
20271
|
return filterFn;
|
20254
20272
|
};
|
20273
|
+
/**
|
20274
|
+
* 格式化Column嵌套配置,支持多表头设置
|
20275
|
+
* @param cols
|
20276
|
+
*/
|
20277
|
+
var flatColumnTemplate = function flatColumnTemplate(cols) {
|
20278
|
+
columnGroup.length = 0;
|
20279
|
+
var maxDepth = 0;
|
20280
|
+
var targetColumns = [];
|
20281
|
+
var getMaxDepth = function getMaxDepth(root) {
|
20282
|
+
var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
20283
|
+
if (root.length && maxDepth < depth) {
|
20284
|
+
maxDepth = depth;
|
20285
|
+
}
|
20286
|
+
root.forEach(function (col) {
|
20287
|
+
var _col$children;
|
20288
|
+
return getMaxDepth((_col$children = col.children) !== null && _col$children !== void 0 ? _col$children : [], depth + 1);
|
20289
|
+
});
|
20290
|
+
};
|
20291
|
+
getMaxDepth(cols);
|
20292
|
+
var updateParentThColspan = function updateParentThColspan(col, count) {
|
20293
|
+
if (col) {
|
20294
|
+
var colMap = columnGroupMap.get(col);
|
20295
|
+
colMap.thColspan = colMap.thColspan + count;
|
20296
|
+
colMap.offsetLeft = colMap.offsetLeft + count;
|
20297
|
+
updateParentThColspan(colMap.parent, count);
|
20298
|
+
}
|
20299
|
+
};
|
20300
|
+
var foreachAllColumns = function foreachAllColumns(column, depth, parent, left) {
|
20301
|
+
var _col$children$length, _col$children2, _col$children$length2, _col$children3, _col$children$length3, _col$children4, _col$children$length4, _col$children5, _col$children6;
|
20302
|
+
var col = (0,external_vue_namespaceObject.toRaw)(column);
|
20303
|
+
var leftColumnCount = left;
|
20304
|
+
if (columnGroup[depth] === undefined) {
|
20305
|
+
columnGroup[depth] = [];
|
20306
|
+
}
|
20307
|
+
var isGroup = !!((_col$children$length = (_col$children2 = col.children) === null || _col$children2 === void 0 ? void 0 : _col$children2.length) !== null && _col$children$length !== void 0 ? _col$children$length : false);
|
20308
|
+
if (!((_col$children$length2 = (_col$children3 = col.children) === null || _col$children3 === void 0 ? void 0 : _col$children3.length) !== null && _col$children$length2 !== void 0 ? _col$children$length2 : false)) {
|
20309
|
+
targetColumns.push(col);
|
20310
|
+
}
|
20311
|
+
if (!columnGroupMap.has(col)) {
|
20312
|
+
columnGroupMap.set(col, {
|
20313
|
+
thColspan: 1,
|
20314
|
+
thRowspan: 1,
|
20315
|
+
isGroup: isGroup,
|
20316
|
+
offsetLeft: left
|
20317
|
+
});
|
20318
|
+
}
|
20319
|
+
var colMap = columnGroupMap.get(col);
|
20320
|
+
var childLength = (_col$children$length3 = (_col$children4 = col.children) === null || _col$children4 === void 0 ? void 0 : _col$children4.length) !== null && _col$children$length3 !== void 0 ? _col$children$length3 : 0;
|
20321
|
+
var thColspan = (_col$children$length4 = (_col$children5 = col.children) === null || _col$children5 === void 0 ? void 0 : _col$children5.length) !== null && _col$children$length4 !== void 0 ? _col$children$length4 : 1;
|
20322
|
+
var thRowspan = childLength > 0 ? 1 : maxDepth - depth;
|
20323
|
+
var offsetLeft = leftColumnCount + (childLength > 0 ? childLength - 1 : 0);
|
20324
|
+
Object.assign(colMap, {
|
20325
|
+
thColspan: thColspan > 0 ? thColspan : 1,
|
20326
|
+
parent: parent,
|
20327
|
+
thRowspan: thRowspan,
|
20328
|
+
offsetLeft: offsetLeft
|
20329
|
+
});
|
20330
|
+
columnGroup[depth].push(col);
|
20331
|
+
if (thColspan > 1) {
|
20332
|
+
updateParentThColspan(parent, thColspan - 1);
|
20333
|
+
}
|
20334
|
+
(_col$children6 = col.children) === null || _col$children6 === void 0 || _col$children6.forEach(function (c, index) {
|
20335
|
+
leftColumnCount = leftColumnCount + foreachAllColumns(c, depth + 1, col, leftColumnCount + index);
|
20336
|
+
});
|
20337
|
+
return childLength > 0 ? childLength - 1 : 0;
|
20338
|
+
};
|
20339
|
+
var leftColumnCount = 0;
|
20340
|
+
cols.forEach(function (col, index) {
|
20341
|
+
leftColumnCount = leftColumnCount + foreachAllColumns(col, 0, null, leftColumnCount + index);
|
20342
|
+
});
|
20343
|
+
return targetColumns;
|
20344
|
+
};
|
20345
|
+
var getGroupAttribute = function getGroupAttribute(group) {
|
20346
|
+
return columnGroupMap.get(group);
|
20347
|
+
};
|
20255
20348
|
/**
|
20256
20349
|
* Format columns
|
20257
20350
|
* @param columns
|
@@ -20336,11 +20429,12 @@ var useColumns = function useColumns(props) {
|
|
20336
20429
|
};
|
20337
20430
|
setColumnAttribute(col, COLUMN_ATTRIBUTE.COL_RECT, target);
|
20338
20431
|
};
|
20339
|
-
var debounceUpdateColumns = (0,lodash.debounce)(function (columns) {
|
20432
|
+
var debounceUpdateColumns = (0,lodash.debounce)(function (columns, onComplete) {
|
20340
20433
|
tableColumnList.length = 0;
|
20341
|
-
tableColumnList.push.apply(tableColumnList, _toConsumableArray(columns));
|
20434
|
+
tableColumnList.push.apply(tableColumnList, _toConsumableArray(flatColumnTemplate(columns)));
|
20342
20435
|
formatColumns();
|
20343
20436
|
setVisibleColumns();
|
20437
|
+
onComplete === null || onComplete === void 0 || onComplete();
|
20344
20438
|
});
|
20345
20439
|
var setColumnIsHidden = function setColumnIsHidden(column) {
|
20346
20440
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
@@ -20494,13 +20588,6 @@ var useColumns = function useColumns(props) {
|
|
20494
20588
|
}
|
20495
20589
|
setColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_ACTIVE, active);
|
20496
20590
|
};
|
20497
|
-
(0,external_vue_namespaceObject.watch)(function () {
|
20498
|
-
return [props.columns];
|
20499
|
-
}, function () {
|
20500
|
-
debounceUpdateColumns(props.columns);
|
20501
|
-
}, {
|
20502
|
-
immediate: true
|
20503
|
-
});
|
20504
20591
|
/**
|
20505
20592
|
* 清理列排序
|
20506
20593
|
* @param reset 是否重置表格数据
|
@@ -20511,6 +20598,18 @@ var useColumns = function useColumns(props) {
|
|
20511
20598
|
setColumnAttribute(col, COLUMN_ATTRIBUTE.COL_FILTER_FN, undefined);
|
20512
20599
|
});
|
20513
20600
|
};
|
20601
|
+
/**
|
20602
|
+
* 清理表头全选操作
|
20603
|
+
*/
|
20604
|
+
var clearSelectionAll = function clearSelectionAll() {
|
20605
|
+
var col = visibleColumns.find(function (item) {
|
20606
|
+
return item.type === 'selection';
|
20607
|
+
});
|
20608
|
+
if (col) {
|
20609
|
+
setColumnAttribute(col, COLUMN_ATTRIBUTE.SELECTION_VAL, false);
|
20610
|
+
setColumnAttribute(col, COLUMN_ATTRIBUTE.SELECTION_INDETERMINATE, false);
|
20611
|
+
}
|
20612
|
+
};
|
20514
20613
|
return {
|
20515
20614
|
needColSpan: needColSpan,
|
20516
20615
|
needRowSpan: needRowSpan,
|
@@ -20520,8 +20619,12 @@ var useColumns = function useColumns(props) {
|
|
20520
20619
|
debounceUpdateColumns: debounceUpdateColumns,
|
20521
20620
|
sortColumns: sortColumns,
|
20522
20621
|
filterColumns: filterColumns,
|
20622
|
+
columnGroup: columnGroup,
|
20623
|
+
columnGroupMap: columnGroupMap,
|
20523
20624
|
clearColumnSort: clearColumnSort,
|
20625
|
+
clearSelectionAll: clearSelectionAll,
|
20524
20626
|
formatColumns: formatColumns,
|
20627
|
+
flatColumnTemplate: flatColumnTemplate,
|
20525
20628
|
isHiddenColumn: isHiddenColumn,
|
20526
20629
|
getColumnId: getColumnId,
|
20527
20630
|
getColumnOrderWidth: getColumnOrderWidth,
|
@@ -20534,6 +20637,7 @@ var useColumns = function useColumns(props) {
|
|
20534
20637
|
getColumnRefAttribute: getColumnRefAttribute,
|
20535
20638
|
getColumnCalcWidth: getColumnCalcWidth,
|
20536
20639
|
getColumnWidth: getColumnWidth,
|
20640
|
+
getGroupAttribute: getGroupAttribute,
|
20537
20641
|
resolveEventListener: resolveEventListener,
|
20538
20642
|
setColumnIsHidden: setColumnIsHidden,
|
20539
20643
|
setColumnResizeWidth: setColumnResizeWidth,
|
@@ -20997,6 +21101,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
20997
21101
|
var layout = (0,external_vue_namespaceObject.reactive)({});
|
20998
21102
|
var fixedColumns = (0,external_vue_namespaceObject.reactive)([]);
|
20999
21103
|
var lineHeight = (0,external_vue_namespaceObject.ref)((_props$rowHeight = props.rowHeight) !== null && _props$rowHeight !== void 0 ? _props$rowHeight : LINE_HEIGHT);
|
21104
|
+
var headerRowCount = (0,external_vue_namespaceObject.ref)(1);
|
21000
21105
|
var fixedBottomHeight = (0,external_vue_namespaceObject.computed)(function () {
|
21001
21106
|
var _props$fixedBottom, _props$fixedBottom$he, _props$fixedBottom2, _props$fixedBottom$he2, _props$fixedBottom3;
|
21002
21107
|
return ((_props$fixedBottom = props.fixedBottom) === null || _props$fixedBottom === void 0 ? void 0 : _props$fixedBottom.position) === 'relative' ? (_props$fixedBottom$he = (_props$fixedBottom2 = props.fixedBottom) === null || _props$fixedBottom2 === void 0 ? void 0 : _props$fixedBottom2.height) !== null && _props$fixedBottom$he !== void 0 ? _props$fixedBottom$he : LINE_HEIGHT : (_props$fixedBottom$he2 = (_props$fixedBottom3 = props.fixedBottom) === null || _props$fixedBottom3 === void 0 ? void 0 : _props$fixedBottom3.height) !== null && _props$fixedBottom$he2 !== void 0 ? _props$fixedBottom$he2 : 0;
|
@@ -21016,7 +21121,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21016
21121
|
};
|
21017
21122
|
});
|
21018
21123
|
var headClass = (0,external_vue_namespaceObject.computed)(function () {
|
21019
|
-
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-head'), true), 'has-settings', !!props.settings));
|
21124
|
+
return (0,shared_namespaceObject.classes)(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, resolveClassName('table-head'), true), 'has-settings', !!props.settings), 'has-group', headerRowCount.value > 1));
|
21020
21125
|
});
|
21021
21126
|
var setFixedColumnShawdow = function setFixedColumnShawdow() {
|
21022
21127
|
var _refRoot$value, _refRoot$value2;
|
@@ -21038,6 +21143,9 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21038
21143
|
translateX.value = val;
|
21039
21144
|
setRootStyleVars();
|
21040
21145
|
};
|
21146
|
+
var setHeaderRowCount = function setHeaderRowCount(val) {
|
21147
|
+
headerRowCount.value = val;
|
21148
|
+
};
|
21041
21149
|
var setTranslateY = function setTranslateY(val) {
|
21042
21150
|
translateY.value = val;
|
21043
21151
|
setRootStyleVars();
|
@@ -21056,7 +21164,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21056
21164
|
};
|
21057
21165
|
var config = resolveHeadConfig(props);
|
21058
21166
|
var headHeight = (0,external_vue_namespaceObject.computed)(function () {
|
21059
|
-
return resolvePropVal(config, 'height', ['thead']);
|
21167
|
+
return resolvePropVal(config, 'height', ['thead']) * headerRowCount.value;
|
21060
21168
|
});
|
21061
21169
|
var headStyle = (0,external_vue_namespaceObject.computed)(function () {
|
21062
21170
|
var _props$thead$color, _props$thead;
|
@@ -21262,6 +21370,7 @@ function use_layout_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
21262
21370
|
setFixedColumns: setFixedColumns,
|
21263
21371
|
setOffsetRight: setOffsetRight,
|
21264
21372
|
setLineHeight: setLineHeight,
|
21373
|
+
setHeaderRowCount: setHeaderRowCount,
|
21265
21374
|
initRootStyleVars: initRootStyleVars,
|
21266
21375
|
refRoot: refRoot,
|
21267
21376
|
refHead: refHead,
|
@@ -22556,6 +22665,7 @@ function use_head_isSlot(s) {
|
|
22556
22665
|
index = _ref.index;
|
22557
22666
|
var sortType = (0,external_vue_namespaceObject.ref)(columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE));
|
22558
22667
|
var sortActive = (0,external_vue_namespaceObject.ref)(columns.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_ACTIVE));
|
22668
|
+
var rawColumn = (0,external_vue_namespaceObject.toRaw)(column);
|
22559
22669
|
/**
|
22560
22670
|
* 点击排序事件
|
22561
22671
|
* @param sortFn 排序函数
|
@@ -22732,14 +22842,36 @@ function use_head_isSlot(s) {
|
|
22732
22842
|
var headStyle = Object.assign(columns.getFixedStlye(column), {
|
22733
22843
|
'--background-color': DEF_COLOR[(_props$thead$color = (_props$thead = props.thead) === null || _props$thead === void 0 ? void 0 : _props$thead.color) !== null && _props$thead$color !== void 0 ? _props$thead$color : IHeadColor.DEF1]
|
22734
22844
|
});
|
22735
|
-
var
|
22845
|
+
var group = columns.getGroupAttribute(rawColumn);
|
22846
|
+
var classList = (0,external_vue_namespaceObject.computed)(function () {
|
22847
|
+
return [columns.getHeadColumnClass(column, index), columns.getColumnCustomClass(column), column.align || props.headerAlign || props.align, {
|
22848
|
+
'is-last-child': (group === null || group === void 0 ? void 0 : group.offsetLeft) + 1 === columns.visibleColumns.length
|
22849
|
+
}];
|
22850
|
+
});
|
22851
|
+
var groupClass = (0,external_vue_namespaceObject.computed)(function () {
|
22852
|
+
return classList.value.concat([{
|
22853
|
+
'is-head-group': group === null || group === void 0 ? void 0 : group.isGroup,
|
22854
|
+
'is-head-group-child': !!(group !== null && group !== void 0 && group.parent)
|
22855
|
+
}]);
|
22856
|
+
});
|
22857
|
+
var getGroupRender = function getGroupRender() {
|
22858
|
+
return resolvePropVal(column, 'label', [index, column]);
|
22859
|
+
};
|
22736
22860
|
var getTH = function getTH() {
|
22861
|
+
if (group !== null && group !== void 0 && group.isGroup) {
|
22862
|
+
return (0,external_vue_namespaceObject.createVNode)("th", {
|
22863
|
+
"style": headStyle,
|
22864
|
+
"class": groupClass.value,
|
22865
|
+
"colspan": group === null || group === void 0 ? void 0 : group.thColspan,
|
22866
|
+
"rowspan": group === null || group === void 0 ? void 0 : group.thRowspan
|
22867
|
+
}, [getGroupRender()]);
|
22868
|
+
}
|
22737
22869
|
return (0,external_vue_namespaceObject.createVNode)("th", (0,external_vue_namespaceObject.mergeProps)({
|
22738
22870
|
"style": headStyle,
|
22739
|
-
"class": classList,
|
22740
|
-
"colspan":
|
22871
|
+
"class": classList.value,
|
22872
|
+
"colspan": group === null || group === void 0 ? void 0 : group.thColspan,
|
22741
22873
|
"data-id": columns.getColumnId(column),
|
22742
|
-
"rowspan":
|
22874
|
+
"rowspan": group === null || group === void 0 ? void 0 : group.thRowspan,
|
22743
22875
|
"onClick": function onClick() {
|
22744
22876
|
return handleColumnHeadClick();
|
22745
22877
|
}
|
@@ -22930,21 +23062,20 @@ function use_render_isSlot(s) {
|
|
22930
23062
|
};
|
22931
23063
|
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)("thead", {
|
22932
23064
|
"style": rowStyle
|
22933
|
-
}, [
|
22934
|
-
"
|
22935
|
-
|
22936
|
-
|
22937
|
-
|
22938
|
-
|
22939
|
-
|
22940
|
-
|
22941
|
-
|
22942
|
-
|
22943
|
-
|
22944
|
-
|
22945
|
-
|
22946
|
-
|
22947
|
-
}
|
23065
|
+
}, [columns.columnGroup.map(function (cols, rowIndex) {
|
23066
|
+
return (0,external_vue_namespaceObject.createVNode)("tr", null, [cols.map(function (column, index) {
|
23067
|
+
var _useHead = use_head({
|
23068
|
+
props: props,
|
23069
|
+
ctx: ctx,
|
23070
|
+
columns: columns,
|
23071
|
+
column: column,
|
23072
|
+
index: index,
|
23073
|
+
rows: rows,
|
23074
|
+
rowIndex: rowIndex
|
23075
|
+
}),
|
23076
|
+
getTH = _useHead.getTH;
|
23077
|
+
return getTH();
|
23078
|
+
})]);
|
22948
23079
|
})])]);
|
22949
23080
|
};
|
22950
23081
|
var renderColumns = function renderColumns() {
|
@@ -23950,6 +24081,7 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
23950
24081
|
setFootHeight = _useLayout.setFootHeight,
|
23951
24082
|
setDragOffsetX = _useLayout.setDragOffsetX,
|
23952
24083
|
setOffsetRight = _useLayout.setOffsetRight,
|
24084
|
+
setHeaderRowCount = _useLayout.setHeaderRowCount,
|
23953
24085
|
refBody = _useLayout.refBody,
|
23954
24086
|
refRoot = _useLayout.refRoot;
|
23955
24087
|
/**
|
@@ -23984,7 +24116,9 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
23984
24116
|
var initTableColumns = function initTableColumns() {
|
23985
24117
|
var _instance$subTree$chi, _instance$subTree;
|
23986
24118
|
var children = (_instance$subTree$chi = (_instance$subTree = instance.subTree) === null || _instance$subTree === void 0 ? void 0 : _instance$subTree.children) !== null && _instance$subTree$chi !== void 0 ? _instance$subTree$chi : [];
|
23987
|
-
columns.debounceUpdateColumns(resolveColumns(children))
|
24119
|
+
columns.debounceUpdateColumns(resolveColumns(children), function () {
|
24120
|
+
setHeaderRowCount(columns.columnGroup.length);
|
24121
|
+
});
|
23988
24122
|
};
|
23989
24123
|
(0,external_vue_namespaceObject.provide)(PROVIDE_KEY_INIT_COL, initTableColumns);
|
23990
24124
|
var _useFixedColumn = use_fixed_column(props, columns),
|
@@ -24093,6 +24227,15 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24093
24227
|
observerResizing.value = false;
|
24094
24228
|
});
|
24095
24229
|
});
|
24230
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
24231
|
+
return [props.columns];
|
24232
|
+
}, function () {
|
24233
|
+
columns.debounceUpdateColumns(props.columns, function () {
|
24234
|
+
setHeaderRowCount(columns.columnGroup.length);
|
24235
|
+
});
|
24236
|
+
}, {
|
24237
|
+
immediate: true
|
24238
|
+
});
|
24096
24239
|
(0,external_vue_namespaceObject.watch)(function () {
|
24097
24240
|
return [dragOffsetX.value];
|
24098
24241
|
}, function () {
|
@@ -24141,7 +24284,10 @@ var useSettings = function useSettings(props, ctx, columns, afterSetting) {
|
|
24141
24284
|
ctx.expose({
|
24142
24285
|
setRowExpand: rows.setRowExpand,
|
24143
24286
|
setAllRowExpand: rows.setAllRowExpand,
|
24144
|
-
clearSelection:
|
24287
|
+
clearSelection: function clearSelection() {
|
24288
|
+
rows.clearSelection();
|
24289
|
+
columns.clearSelectionAll();
|
24290
|
+
},
|
24145
24291
|
toggleAllSelection: rows.toggleAllSelection,
|
24146
24292
|
toggleRowSelection: rows.toggleRowSelection,
|
24147
24293
|
getSelection: rows.getRowSelection,
|
package/lib/table/props.d.ts
CHANGED
@@ -162,8 +162,16 @@ export type IDraggableRowOption = {
|
|
162
162
|
icon?: JSX.Element;
|
163
163
|
width?: number;
|
164
164
|
};
|
165
|
+
export type IHeadGroup = {
|
166
|
+
thColspan: number;
|
167
|
+
thRowspan: number;
|
168
|
+
isGroup: boolean;
|
169
|
+
parent?: IHeadGroup;
|
170
|
+
label?: string;
|
171
|
+
offsetLeft?: number;
|
172
|
+
};
|
165
173
|
export type Column = {
|
166
|
-
label
|
174
|
+
label?: LabelFunctionString;
|
167
175
|
field?: LabelFunctionString;
|
168
176
|
render?: RenderFunctionString;
|
169
177
|
renderHead?: RenderFunctionString;
|
@@ -184,6 +192,7 @@ export type Column = {
|
|
184
192
|
prop?: LabelFunctionString;
|
185
193
|
index?: number;
|
186
194
|
explain?: IColumnExplain;
|
195
|
+
children?: Column[];
|
187
196
|
};
|
188
197
|
export declare const IColumnProp: import("vue-types").VueTypeDef<Column>;
|
189
198
|
export type Thead = {
|
@@ -281,7 +290,7 @@ export declare const tableProps: {
|
|
281
290
|
};
|
282
291
|
/**
|
283
292
|
* 设置表格最小高度
|
284
|
-
* 默认:LINE_HEIGHT *
|
293
|
+
* 默认:LINE_HEIGHT * 2
|
285
294
|
*/
|
286
295
|
minHeight: import("vue-types").VueTypeDef<StringNumber> & {
|
287
296
|
default: StringNumber;
|