Skip to content

Commit 491782f

Browse files
committed
remove expansion data layer
1 parent 9ff640d commit 491782f

File tree

1 file changed

+2
-77
lines changed
  • client/packages/lowcoder/src/comps/comps/tableLiteComp

1 file changed

+2
-77
lines changed

client/packages/lowcoder/src/comps/comps/tableLiteComp/tableComp.tsx

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ import {
5353
import { saveDataAsFile } from "util/fileUtils";
5454
import { JSONObject, JSONValue } from "util/jsonTypes";
5555
import { lastValueIfEqual, shallowEqual } from "util/objectUtils";
56-
import { IContainer } from "../containerBase";
56+
5757
import { getSelectedRowKeys } from "./selectionControl";
5858
import { compTablePropertyView } from "./tablePropertyView";
5959
import { RowColorComp, RowHeightComp, SortValue, TableChildrenView, TableInitComp } from "./tableTypes";
6060

6161
import { useContext, useState } from "react";
6262
import { EditorContext } from "comps/editorState";
6363

64-
export class TableImplComp extends TableInitComp implements IContainer {
64+
export class TableImplComp extends TableInitComp {
6565
private prevUnevaledValue?: string;
6666
readonly filterData: RecordType[] = [];
6767
readonly columnAggrData: ColumnsAggrData = {};
@@ -73,29 +73,6 @@ export class TableImplComp extends TableInitComp implements IContainer {
7373
getTableAutoHeight() {
7474
return this.children.autoHeight.getView();
7575
}
76-
77-
private getSlotContainer() {
78-
return this.children.expansion.children.slot.getSelectedComp().getComp().children.container;
79-
}
80-
81-
findContainer(key: string) {
82-
return this.getSlotContainer().findContainer(key);
83-
}
84-
85-
getCompTree() {
86-
return this.getSlotContainer().getCompTree();
87-
}
88-
89-
getPasteValue(nameGenerator: NameGenerator) {
90-
return {
91-
...this.toJsonValue(),
92-
expansion: this.children.expansion.getPasteValue(nameGenerator),
93-
};
94-
}
95-
96-
realSimpleContainer(key?: string) {
97-
return this.getSlotContainer().realSimpleContainer(key);
98-
}
9976

10077
downloadData(fileName: string) {
10178
saveDataAsFile({
@@ -256,21 +233,6 @@ export class TableImplComp extends TableInitComp implements IContainer {
256233
);
257234
needMoreEval = true;
258235
}
259-
260-
let params = comp.children.expansion.children.slot.getCachedParams(newSelection);
261-
if (selectionChanged || _.isNil(params) || dataChanged) {
262-
params =
263-
_.isNil(params) || dataChanged
264-
? genSelectionParams(comp.filterData, newSelection)
265-
: undefined;
266-
comp = comp.setChild(
267-
"expansion",
268-
comp.children.expansion.reduce(
269-
comp.children.expansion.setSelectionAction(newSelection, params)
270-
)
271-
);
272-
needMoreEval = true;
273-
}
274236
if (action.type === CompActionTypes.UPDATE_NODES_V2 && needMoreEval) {
275237
setTimeout(() => comp.dispatch(onlyEvalAction()));
276238
}
@@ -724,24 +686,6 @@ TableTmpComp = withMethodExposing(TableTmpComp, [
724686
comp.children.columns.dispatchClearInsertSet();
725687
},
726688
},
727-
{
728-
method: {
729-
name: "setExpandedRows",
730-
description: "",
731-
params: [
732-
{ name: "expandedRows", type: "arrayString"},
733-
],
734-
},
735-
execute: (comp, values) => {
736-
const expandedRows = values[0];
737-
if (!isArray(expandedRows)) {
738-
return Promise.reject("setExpandedRows function only accepts array of string i.e. ['1', '2', '3']")
739-
}
740-
if (expandedRows && isArray(expandedRows)) {
741-
comp.children.currentExpandedRows.dispatchChangeValueAction(expandedRows as string[]);
742-
}
743-
},
744-
}
745689
]);
746690

747691
// exposing data
@@ -996,24 +940,5 @@ export const TableLiteComp = withExposingConfigs(TableTmpComp, [
996940
},
997941
trans("table.selectedCellDesc")
998942
),
999-
depsConfig({
1000-
name: "currentExpandedRow",
1001-
desc: trans("table.sortDesc"),
1002-
depKeys: ["currentExpandedRows"],
1003-
func: (input) => {
1004-
if (input.currentExpandedRows.length > 0) {
1005-
return input.currentExpandedRows[input.currentExpandedRows.length - 1];
1006-
}
1007-
return "";
1008-
},
1009-
}),
1010-
depsConfig({
1011-
name: "currentExpandedRows",
1012-
desc: trans("table.sortDesc"),
1013-
depKeys: ["currentExpandedRows"],
1014-
func: (input) => {
1015-
return input.currentExpandedRows;
1016-
},
1017-
}),
1018943
new NameConfig("data", trans("table.dataDesc")),
1019944
]);

0 commit comments

Comments
 (0)