Skip to content

[In Progress] [Feat] Table Lite Component #1939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: dev
Choose a base branch
from
Prev Previous commit
Next Next commit
remove search filter and fix css issue
  • Loading branch information
iamfaran committed Aug 11, 2025
commit d03a02d1e127b5e2f03e35c7cb53a32d502494fe
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const ColumnDropdown = styled(Dropdown)`
const ColumnBatchOptionWrapper = styled.div`
display: flex;
align-items: center;
color: ${GreyTextColor}
color: ${GreyTextColor};
line-height: 16px;
font-size: 13px;
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,32 +307,19 @@ export class TableImplComp extends TableInitComp {
)[0];
}

// handle hide/search/filter: sortedData->filteredData
// handle filter: sortedData -> filteredData (pass-through for now)
filterNode() {
const nodes = {
data: this.sortDataNode(),
searchValue: this.children.searchText.node(),
};
let context = this;

const filteredDataNode = withFunction(fromRecord(nodes), (input) => {
const { data, searchValue } = input;
const filteredData = filterData(data, searchValue.value, { filters: [], stackType: "and" }, false);

if (Boolean(searchValue.value) && data.length !== filteredData.length) {
const onEvent = context.children.onEvent.getView();
setTimeout(() => {
onEvent("dataSearch");
});
}

return filteredData.map((row) => tranToTableRecord(row, row[OB_ROW_ORI_INDEX]));
const filteredDataNode = withFunction(fromRecord(nodes), ({ data }) => {
return data.map((row) => tranToTableRecord(row, row[OB_ROW_ORI_INDEX]));
});

return lastValueIfEqual(this, "filteredDataNode", [filteredDataNode, nodes] as const, (a, b) =>
shallowEqual(a[1], b[1])
)[0];
}



oriDisplayDataNode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const ColumnDropdown = styled(Dropdown)`
const ColumnBatchOptionWrapper = styled.div`
display: flex;
align-items: center;
color: ${GreyTextColor}
color: ${GreyTextColor};
line-height: 16px;
font-size: 13px;
`;
Expand Down Expand Up @@ -517,11 +517,6 @@ export function compTablePropertyView<T extends MultiBaseComp<TableChildrenType>
{hiddenPropertyView(comp.children)}
{loadingPropertyView(comp.children)}
{comp.children.selection.getPropertyView()}
{comp.children.searchText.propertyView({
label: trans("table.searchText"),
tooltip: trans("table.searchTextTooltip"),
placeholder: "{{input1.value}}",
})}
</Section>

<Section name={"Summary"}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {
ColorOrBoolCodeControl,
HeightOrBoolCodeControl,
JSONObjectArrayControl,
RadiusControl,
StringControl,
} from "comps/controls/codeControl";
import { dropdownControl } from "comps/controls/dropdownControl";
import { eventHandlerControl } from "comps/controls/eventHandlerControl";
Expand Down Expand Up @@ -79,12 +77,6 @@ export const TableEventOptions = [
value: "rowClick",
description: trans("table.rowClick"),
},

{
label: trans("table.search"),
value: "dataSearch",
description: trans("table.search"),
},
{
label: trans("table.download"),
value: "download",
Expand Down Expand Up @@ -211,7 +203,6 @@ const tableChildrenMap = {
toolbarStyle: styleControl(TableToolbarStyle, 'toolbarStyle'),
hideToolbar: withDefault(BoolControl,false),
headerStyle: styleControl(TableHeaderStyle, 'headerStyle'),
searchText: StringControl,
columnsStyle: styleControl(TableColumnStyle, 'columnsStyle'),
viewModeResizable: BoolControl,
visibleResizables: BoolControl,
Expand Down