bkui-vue 1.0.3-beta.29 → 1.0.3-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 +37 -37
- package/dist/index.esm.js +2917 -2901
- package/dist/index.umd.js +37 -37
- package/lib/table/cache.d.ts +11 -3
- package/lib/table/components/table-column.d.ts +4 -4
- package/lib/table/index.d.ts +4 -4
- package/lib/table/index.js +66 -32
- package/lib/table/props.d.ts +2 -2
- package/lib/table-column/index.d.ts +10 -10
- package/lib/table-column/index.js +40 -26
- package/package.json +1 -1
package/lib/table/cache.d.ts
CHANGED
@@ -1,6 +1,14 @@
|
|
1
|
+
type StackStorageFnType = {
|
2
|
+
[name: string]: {
|
3
|
+
timerId?: number;
|
4
|
+
fn?: () => void;
|
5
|
+
};
|
6
|
+
};
|
1
7
|
export default class BkTableCache {
|
2
|
-
storage:
|
8
|
+
storage: WeakMap<Object, StackStorageFnType>;
|
9
|
+
defKey: symbol;
|
3
10
|
constructor();
|
4
|
-
queueStack(methodName: any, fn?: () => void): void;
|
5
|
-
clearQueueStack(methodName: any): void;
|
11
|
+
queueStack(methodName: any, fn?: () => void, key?: Object): void;
|
12
|
+
clearQueueStack(methodName: any, key?: Object): void;
|
6
13
|
}
|
14
|
+
export {};
|
@@ -14,7 +14,7 @@ declare const TableColumnProp: {
|
|
14
14
|
default: string;
|
15
15
|
};
|
16
16
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../props").IOverflowTooltipProp>;
|
17
|
-
type: import("vue-types").VueTypeDef<"
|
17
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
18
18
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
19
19
|
default: boolean;
|
20
20
|
} & {
|
@@ -65,7 +65,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
65
65
|
default: string;
|
66
66
|
};
|
67
67
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../props").IOverflowTooltipProp>;
|
68
|
-
type: import("vue-types").VueTypeDef<"
|
68
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
69
69
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
70
70
|
default: boolean;
|
71
71
|
} & {
|
@@ -162,7 +162,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
162
162
|
height?: number;
|
163
163
|
maxHeight?: number;
|
164
164
|
};
|
165
|
-
type?: "
|
165
|
+
type?: "index" | "selection" | "expand" | "__COL_TYPE_NONE";
|
166
166
|
label?: import("../props").LabelFunctionString;
|
167
167
|
width?: string | number;
|
168
168
|
className?: import("../props").RowClassFunctionString;
|
@@ -199,7 +199,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
199
199
|
default: string;
|
200
200
|
};
|
201
201
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../props").IOverflowTooltipProp>;
|
202
|
-
type: import("vue-types").VueTypeDef<"
|
202
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
203
203
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
204
204
|
default: boolean;
|
205
205
|
} & {
|
package/lib/table/index.d.ts
CHANGED
@@ -1289,7 +1289,7 @@ declare const BkTable: {
|
|
1289
1289
|
default: string;
|
1290
1290
|
};
|
1291
1291
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("./props").IOverflowTooltipProp>;
|
1292
|
-
type: import("vue-types").VueTypeDef<"
|
1292
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
1293
1293
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
1294
1294
|
default: boolean;
|
1295
1295
|
} & {
|
@@ -1386,7 +1386,7 @@ declare const BkTable: {
|
|
1386
1386
|
height?: number;
|
1387
1387
|
maxHeight?: number;
|
1388
1388
|
};
|
1389
|
-
type?: "
|
1389
|
+
type?: "index" | "selection" | "expand" | "__COL_TYPE_NONE";
|
1390
1390
|
label?: import("./props").LabelFunctionString;
|
1391
1391
|
width?: string | number;
|
1392
1392
|
className?: import("./props").RowClassFunctionString;
|
@@ -1419,7 +1419,7 @@ declare const BkTable: {
|
|
1419
1419
|
default: string;
|
1420
1420
|
};
|
1421
1421
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("./props").IOverflowTooltipProp>;
|
1422
|
-
type: import("vue-types").VueTypeDef<"
|
1422
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
1423
1423
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
1424
1424
|
default: boolean;
|
1425
1425
|
} & {
|
@@ -1472,7 +1472,7 @@ declare const BkTable: {
|
|
1472
1472
|
default: string;
|
1473
1473
|
};
|
1474
1474
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("./props").IOverflowTooltipProp>;
|
1475
|
-
type: import("vue-types").VueTypeDef<"
|
1475
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
1476
1476
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
1477
1477
|
default: boolean;
|
1478
1478
|
} & {
|
package/lib/table/index.js
CHANGED
@@ -302,7 +302,7 @@ var ColumnTypeEnum;
|
|
302
302
|
ColumnTypeEnum["SELECTION"] = "selection";
|
303
303
|
ColumnTypeEnum["INDEX"] = "index";
|
304
304
|
ColumnTypeEnum["EXPAND"] = "expand";
|
305
|
-
ColumnTypeEnum["NONE"] = "
|
305
|
+
ColumnTypeEnum["NONE"] = "__COL_TYPE_NONE";
|
306
306
|
})(ColumnTypeEnum || (ColumnTypeEnum = {}));
|
307
307
|
var TableAlignEnum;
|
308
308
|
(function (TableAlignEnum) {
|
@@ -640,6 +640,7 @@ var tableProps = {
|
|
640
640
|
;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
|
641
641
|
|
642
642
|
|
643
|
+
|
643
644
|
/*
|
644
645
|
* Tencent is pleased to support the open source community by making
|
645
646
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
@@ -788,38 +789,51 @@ var TableColumnProp = {
|
|
788
789
|
if (!tableNode) {
|
789
790
|
return;
|
790
791
|
}
|
791
|
-
var colList = tableNode.children["default"]() || [];
|
792
792
|
var sortColumns = [];
|
793
793
|
var index = 0;
|
794
|
+
var resolveChildNode = function resolveChildNode(node) {
|
795
|
+
var _node$type;
|
796
|
+
if (!node) {
|
797
|
+
return null;
|
798
|
+
}
|
799
|
+
if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
|
800
|
+
var _node$children;
|
801
|
+
var resolveProp = Object.assign({
|
802
|
+
index: index
|
803
|
+
}, _this.copyProps(node.props), {
|
804
|
+
field: node.props.prop || node.props.field,
|
805
|
+
render: (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"]
|
806
|
+
});
|
807
|
+
sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
|
808
|
+
index = index + 1;
|
809
|
+
return null;
|
810
|
+
}
|
811
|
+
if (Array.isArray(node.children)) {
|
812
|
+
return node.children;
|
813
|
+
}
|
814
|
+
if ((0,external_vue_namespaceObject.isVNode)(node) && typeof_typeof(node.children) === 'object') {
|
815
|
+
return Object.keys(node.children).map(function (key) {
|
816
|
+
return node.children[key];
|
817
|
+
});
|
818
|
+
}
|
819
|
+
if (typeof node === 'function') {
|
820
|
+
return node();
|
821
|
+
}
|
822
|
+
return null;
|
823
|
+
};
|
794
824
|
var reduceColumns = function reduceColumns(nodes) {
|
795
825
|
if (!Array.isArray(nodes)) {
|
826
|
+
var children = resolveChildNode(nodes);
|
827
|
+
if (children) {
|
828
|
+
reduceColumns(children);
|
829
|
+
}
|
796
830
|
return;
|
797
831
|
}
|
798
|
-
nodes.forEach(function (node) {
|
799
|
-
|
800
|
-
if (Array.isArray(node)) {
|
801
|
-
reduceColumns(node);
|
802
|
-
return;
|
803
|
-
}
|
804
|
-
var skipValidateKey0 = true;
|
805
|
-
if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
|
806
|
-
var _node$children;
|
807
|
-
skipValidateKey0 = Object.hasOwnProperty.call(node.props || {}, 'key');
|
808
|
-
var resolveProp = Object.assign({
|
809
|
-
index: index
|
810
|
-
}, _this.copyProps(node.props), {
|
811
|
-
field: node.props.prop || node.props.field,
|
812
|
-
render: (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"]
|
813
|
-
});
|
814
|
-
sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
|
815
|
-
index = index + 1;
|
816
|
-
}
|
817
|
-
if ((_node$children2 = node.children) !== null && _node$children2 !== void 0 && _node$children2.length && skipValidateKey0 && ((_node$type2 = node.type) === null || _node$type2 === void 0 ? void 0 : _node$type2.name) !== 'Table') {
|
818
|
-
reduceColumns(node.children);
|
819
|
-
}
|
832
|
+
nodes === null || nodes === void 0 || nodes.forEach(function (node) {
|
833
|
+
return reduceColumns(node);
|
820
834
|
});
|
821
835
|
};
|
822
|
-
reduceColumns(
|
836
|
+
reduceColumns(tableNode);
|
823
837
|
_this.initColumns(sortColumns);
|
824
838
|
};
|
825
839
|
if (typeof this.bkTableCache.queueStack === 'function') {
|
@@ -911,21 +925,41 @@ var BkTableCache = /*#__PURE__*/function () {
|
|
911
925
|
function BkTableCache() {
|
912
926
|
_classCallCheck(this, BkTableCache);
|
913
927
|
defineProperty_defineProperty(this, "storage", undefined);
|
914
|
-
this
|
928
|
+
defineProperty_defineProperty(this, "defKey", Symbol('bk-table-cache-def-key'));
|
929
|
+
this.storage = new WeakMap();
|
915
930
|
}
|
916
931
|
_createClass(BkTableCache, [{
|
917
932
|
key: "queueStack",
|
918
933
|
value: function queueStack(methodName) {
|
934
|
+
var _target$methodName;
|
919
935
|
var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
936
|
+
var key = arguments.length > 2 ? arguments[2] : undefined;
|
937
|
+
var stackKey = key !== null && key !== void 0 ? key : this.defKey;
|
938
|
+
if (!this.storage.has(stackKey)) {
|
939
|
+
this.storage.set(stackKey, {});
|
940
|
+
}
|
941
|
+
var target = this.storage.get(stackKey);
|
942
|
+
if ((_target$methodName = target[methodName]) !== null && _target$methodName !== void 0 && _target$methodName.timerId) {
|
943
|
+
var _target$methodName2;
|
944
|
+
clearTimeout((_target$methodName2 = target[methodName]) === null || _target$methodName2 === void 0 ? void 0 : _target$methodName2.timerId);
|
945
|
+
}
|
946
|
+
Object.assign(target, defineProperty_defineProperty({}, methodName, {
|
947
|
+
timerId: setTimeout(fn),
|
948
|
+
fn: fn
|
949
|
+
}));
|
924
950
|
}
|
925
951
|
}, {
|
926
952
|
key: "clearQueueStack",
|
927
|
-
value: function clearQueueStack(methodName) {
|
928
|
-
|
953
|
+
value: function clearQueueStack(methodName, key) {
|
954
|
+
var stackKey = key !== null && key !== void 0 ? key : this.defKey;
|
955
|
+
if (this.storage.has(stackKey)) {
|
956
|
+
var _target$methodName3;
|
957
|
+
var target = this.storage.get(stackKey);
|
958
|
+
if ((_target$methodName3 = target[methodName]) !== null && _target$methodName3 !== void 0 && _target$methodName3.timerId) {
|
959
|
+
var _target$methodName4;
|
960
|
+
clearTimeout((_target$methodName4 = target[methodName]) === null || _target$methodName4 === void 0 ? void 0 : _target$methodName4.timerId);
|
961
|
+
}
|
962
|
+
}
|
929
963
|
}
|
930
964
|
}]);
|
931
965
|
return BkTableCache;
|
package/lib/table/props.d.ts
CHANGED
@@ -17,7 +17,7 @@ export declare enum ColumnTypeEnum {
|
|
17
17
|
SELECTION = "selection",
|
18
18
|
INDEX = "index",
|
19
19
|
EXPAND = "expand",
|
20
|
-
NONE = "
|
20
|
+
NONE = "__COL_TYPE_NONE"
|
21
21
|
}
|
22
22
|
export declare enum TableAlignEnum {
|
23
23
|
LEFT = "left",
|
@@ -25,7 +25,7 @@ export declare enum TableAlignEnum {
|
|
25
25
|
CENTER = "center",
|
26
26
|
NONE = ""
|
27
27
|
}
|
28
|
-
export declare const columnType: import("vue-types").VueTypeDef<"
|
28
|
+
export declare const columnType: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
29
29
|
export declare const TableAlign: import("vue-types").VueTypeDef<"" | "right" | "left" | "center">;
|
30
30
|
export declare enum FullEnum {
|
31
31
|
FULL = "full",
|
@@ -13,7 +13,7 @@ declare const BkTableColumn: {
|
|
13
13
|
default: string;
|
14
14
|
};
|
15
15
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../table/props").IOverflowTooltipProp>;
|
16
|
-
type: import("vue-types").VueTypeDef<"
|
16
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
17
17
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
18
18
|
default: boolean;
|
19
19
|
} & {
|
@@ -110,7 +110,7 @@ declare const BkTableColumn: {
|
|
110
110
|
height?: number;
|
111
111
|
maxHeight?: number;
|
112
112
|
};
|
113
|
-
type?: "
|
113
|
+
type?: "index" | "selection" | "expand" | "__COL_TYPE_NONE";
|
114
114
|
label?: import("../table/props").LabelFunctionString;
|
115
115
|
width?: string | number;
|
116
116
|
className?: import("../table/props").RowClassFunctionString;
|
@@ -143,7 +143,7 @@ declare const BkTableColumn: {
|
|
143
143
|
default: string;
|
144
144
|
};
|
145
145
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../table/props").IOverflowTooltipProp>;
|
146
|
-
type: import("vue-types").VueTypeDef<"
|
146
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
147
147
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
148
148
|
default: boolean;
|
149
149
|
} & {
|
@@ -196,7 +196,7 @@ declare const BkTableColumn: {
|
|
196
196
|
default: string;
|
197
197
|
};
|
198
198
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../table/props").IOverflowTooltipProp>;
|
199
|
-
type: import("vue-types").VueTypeDef<"
|
199
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
200
200
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
201
201
|
default: boolean;
|
202
202
|
} & {
|
@@ -260,7 +260,7 @@ declare const BkTableColumn: {
|
|
260
260
|
default: string;
|
261
261
|
};
|
262
262
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../table/props").IOverflowTooltipProp>;
|
263
|
-
type: import("vue-types").VueTypeDef<"
|
263
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
264
264
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
265
265
|
default: boolean;
|
266
266
|
} & {
|
@@ -357,7 +357,7 @@ declare const BkTableColumn: {
|
|
357
357
|
height?: number;
|
358
358
|
maxHeight?: number;
|
359
359
|
};
|
360
|
-
type?: "
|
360
|
+
type?: "index" | "selection" | "expand" | "__COL_TYPE_NONE";
|
361
361
|
label?: import("../table/props").LabelFunctionString;
|
362
362
|
width?: string | number;
|
363
363
|
className?: import("../table/props").RowClassFunctionString;
|
@@ -390,7 +390,7 @@ declare const BkTableColumn: {
|
|
390
390
|
default: string;
|
391
391
|
};
|
392
392
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../table/props").IOverflowTooltipProp>;
|
393
|
-
type: import("vue-types").VueTypeDef<"
|
393
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
394
394
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
395
395
|
default: boolean;
|
396
396
|
} & {
|
@@ -455,7 +455,7 @@ declare const BkTableColumn: {
|
|
455
455
|
default: string;
|
456
456
|
};
|
457
457
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../table/props").IOverflowTooltipProp>;
|
458
|
-
type: import("vue-types").VueTypeDef<"
|
458
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
459
459
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
460
460
|
default: boolean;
|
461
461
|
} & {
|
@@ -552,7 +552,7 @@ declare const BkTableColumn: {
|
|
552
552
|
height?: number;
|
553
553
|
maxHeight?: number;
|
554
554
|
};
|
555
|
-
type?: "
|
555
|
+
type?: "index" | "selection" | "expand" | "__COL_TYPE_NONE";
|
556
556
|
label?: import("../table/props").LabelFunctionString;
|
557
557
|
width?: string | number;
|
558
558
|
className?: import("../table/props").RowClassFunctionString;
|
@@ -585,7 +585,7 @@ declare const BkTableColumn: {
|
|
585
585
|
default: string;
|
586
586
|
};
|
587
587
|
showOverflowTooltip: import("vue-types").VueTypeDef<import("../table/props").IOverflowTooltipProp>;
|
588
|
-
type: import("vue-types").VueTypeDef<"
|
588
|
+
type: import("vue-types").VueTypeDef<"index" | "selection" | "expand" | "__COL_TYPE_NONE">;
|
589
589
|
resizable: import("vue-types").VueTypeValidableDef<boolean> & {
|
590
590
|
default: boolean;
|
591
591
|
} & {
|
@@ -83,7 +83,7 @@ function _defineProperty(obj, key, value) {
|
|
83
83
|
;// CONCATENATED MODULE: external "vue"
|
84
84
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
85
85
|
var external_vue_y = x => () => x
|
86
|
-
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref });
|
86
|
+
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref });
|
87
87
|
;// CONCATENATED MODULE: ../../packages/table/src/const.ts
|
88
88
|
|
89
89
|
/*
|
@@ -263,7 +263,7 @@ var ColumnTypeEnum;
|
|
263
263
|
ColumnTypeEnum["SELECTION"] = "selection";
|
264
264
|
ColumnTypeEnum["INDEX"] = "index";
|
265
265
|
ColumnTypeEnum["EXPAND"] = "expand";
|
266
|
-
ColumnTypeEnum["NONE"] = "
|
266
|
+
ColumnTypeEnum["NONE"] = "__COL_TYPE_NONE";
|
267
267
|
})(ColumnTypeEnum || (ColumnTypeEnum = {}));
|
268
268
|
var TableAlignEnum;
|
269
269
|
(function (TableAlignEnum) {
|
@@ -601,6 +601,7 @@ var tableProps = {
|
|
601
601
|
;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
|
602
602
|
|
603
603
|
|
604
|
+
|
604
605
|
/*
|
605
606
|
* Tencent is pleased to support the open source community by making
|
606
607
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
@@ -749,38 +750,51 @@ var TableColumnProp = {
|
|
749
750
|
if (!tableNode) {
|
750
751
|
return;
|
751
752
|
}
|
752
|
-
var colList = tableNode.children["default"]() || [];
|
753
753
|
var sortColumns = [];
|
754
754
|
var index = 0;
|
755
|
+
var resolveChildNode = function resolveChildNode(node) {
|
756
|
+
var _node$type;
|
757
|
+
if (!node) {
|
758
|
+
return null;
|
759
|
+
}
|
760
|
+
if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
|
761
|
+
var _node$children;
|
762
|
+
var resolveProp = Object.assign({
|
763
|
+
index: index
|
764
|
+
}, _this.copyProps(node.props), {
|
765
|
+
field: node.props.prop || node.props.field,
|
766
|
+
render: (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"]
|
767
|
+
});
|
768
|
+
sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
|
769
|
+
index = index + 1;
|
770
|
+
return null;
|
771
|
+
}
|
772
|
+
if (Array.isArray(node.children)) {
|
773
|
+
return node.children;
|
774
|
+
}
|
775
|
+
if ((0,external_vue_namespaceObject.isVNode)(node) && _typeof(node.children) === 'object') {
|
776
|
+
return Object.keys(node.children).map(function (key) {
|
777
|
+
return node.children[key];
|
778
|
+
});
|
779
|
+
}
|
780
|
+
if (typeof node === 'function') {
|
781
|
+
return node();
|
782
|
+
}
|
783
|
+
return null;
|
784
|
+
};
|
755
785
|
var reduceColumns = function reduceColumns(nodes) {
|
756
786
|
if (!Array.isArray(nodes)) {
|
787
|
+
var children = resolveChildNode(nodes);
|
788
|
+
if (children) {
|
789
|
+
reduceColumns(children);
|
790
|
+
}
|
757
791
|
return;
|
758
792
|
}
|
759
|
-
nodes.forEach(function (node) {
|
760
|
-
|
761
|
-
if (Array.isArray(node)) {
|
762
|
-
reduceColumns(node);
|
763
|
-
return;
|
764
|
-
}
|
765
|
-
var skipValidateKey0 = true;
|
766
|
-
if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
|
767
|
-
var _node$children;
|
768
|
-
skipValidateKey0 = Object.hasOwnProperty.call(node.props || {}, 'key');
|
769
|
-
var resolveProp = Object.assign({
|
770
|
-
index: index
|
771
|
-
}, _this.copyProps(node.props), {
|
772
|
-
field: node.props.prop || node.props.field,
|
773
|
-
render: (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"]
|
774
|
-
});
|
775
|
-
sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
|
776
|
-
index = index + 1;
|
777
|
-
}
|
778
|
-
if ((_node$children2 = node.children) !== null && _node$children2 !== void 0 && _node$children2.length && skipValidateKey0 && ((_node$type2 = node.type) === null || _node$type2 === void 0 ? void 0 : _node$type2.name) !== 'Table') {
|
779
|
-
reduceColumns(node.children);
|
780
|
-
}
|
793
|
+
nodes === null || nodes === void 0 || nodes.forEach(function (node) {
|
794
|
+
return reduceColumns(node);
|
781
795
|
});
|
782
796
|
};
|
783
|
-
reduceColumns(
|
797
|
+
reduceColumns(tableNode);
|
784
798
|
_this.initColumns(sortColumns);
|
785
799
|
};
|
786
800
|
if (typeof this.bkTableCache.queueStack === 'function') {
|