Skip to content

Fixed table header + Handle editor's right panel foldable section in search #535

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

Merged
merged 5 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: fixed header option
  • Loading branch information
raheeliftikhar5 committed Nov 30, 2023
commit 38fe46fa253ef57968a818cbf5f1a344f9c5934c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ const TableTd = styled.td<{
border-color: ${(props) => props.$style.border} !important;
border-width: ${(props) => props.$style.borderWidth} !important;
border-radius: ${(props) => props.$style.radius};
padding: 0 !important;

> div > div {
color: ${(props) => props.$style.text};
Expand Down Expand Up @@ -362,6 +363,8 @@ type CustomTableProps<RecordType> = Omit<TableProps<RecordType>, "components" |
viewModeResizable: boolean;
rowColorFn: RowColorViewType;
columnsStyle: TableColumnStyleType;
fixedHeader: boolean;
maxHeight: string;
};

function TableCellView(props: {
Expand Down Expand Up @@ -533,7 +536,10 @@ function ResizeableTable<RecordType extends object>(props: CustomTableProps<Reco
{...props}
pagination={false}
columns={columns}
scroll={{ x: COL_MIN_WIDTH * columns.length }}
scroll={{
x: COL_MIN_WIDTH * columns.length,
y: props.fixedHeader ? props.maxHeight : undefined,
}}
></Table>
);
}
Expand Down Expand Up @@ -690,6 +696,8 @@ export function TableCompView(props: {
onTableChange(pagination, filters, sorter, extra, comp.dispatch, onEvent);
}}
showHeader={!compChildren.hideHeader.getView()}
fixedHeader={compChildren.fixedHeader.getView()}
maxHeight={compChildren.maxHeight.getView()}
columns={antdColumns}
columnsStyle={columnsStyle}
viewModeResizable={compChildren.viewModeResizable.getView()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,22 @@ export function compTablePropertyView<T extends MultiBaseComp<TableChildrenType>
label: trans("table.tableSize"),
radioButton: true,
})}
{comp.children.hideBordered.propertyView({
label: trans("table.hideBordered"),
})}
{comp.children.hideHeader.propertyView({
label: trans("table.hideHeader"),
})}
{comp.children.hideBordered.propertyView({
label: trans("table.hideBordered"),
{comp.children.fixedHeader.propertyView({
label: trans("table.fixedHeader"),
tooltip: trans("table.fixedHeaderTooltip")
})}
{comp.children.fixedHeader.getView() &&
comp.children.maxHeight.propertyView({
label: trans("table.maxHeight"),
tooltip: trans("table.maxHeightTooltip")
})
}
</Section>
<Section name={"Row Style"}>
{comp.children.rowStyle.getPropertyView()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
BoolCodeControl,
ColorOrBoolCodeControl,
JSONObjectArrayControl,
RadiusControl,
} from "comps/controls/codeControl";
import { dropdownControl } from "comps/controls/dropdownControl";
import { eventHandlerControl } from "comps/controls/eventHandlerControl";
Expand Down Expand Up @@ -134,6 +135,8 @@ export type RowColorViewType = (param: {
const tableChildrenMap = {
hideBordered: BoolControl,
hideHeader: BoolControl,
fixedHeader: BoolControl,
maxHeight: withDefault(RadiusControl, '300px'),
data: withIsLoadingMethod(JSONObjectArrayControl),
showDataLoadSpinner: withDefault(BoolPureControl, true),
columns: ColumnListComp,
Expand Down
4 changes: 4 additions & 0 deletions client/packages/lowcoder/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,10 @@ export const en = {
type: "Type",
tableSize: "Table size",
hideHeader: "Hide table header",
fixedHeader: "Fixed table header",
fixedHeaderTooltip: "Header will be fixed for vertically scrollable table",
maxHeight: "Max. Height",
maxHeightTooltip: "Set max. height to make table scrollable",
hideBordered: "Hide column border",
deleteColumn: "Delete column",
confirmDeleteColumn: "Confirm delete column: ",
Expand Down
4 changes: 4 additions & 0 deletions client/packages/lowcoder/src/i18n/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,10 @@ table: {
type: "类型",
tableSize: "表格尺寸",
hideHeader: "隐藏表头",
fixedHeader: "固定表头",
fixedHeaderTooltip: "垂直滚动表格的标题将被固定",
maxHeight: "最大限度。高度",
maxHeightTooltip: "设置最大值使表格可滚动的高度",
hideBordered: "隐藏列边框",
deleteColumn: "删除列",
confirmDeleteColumn: "确认删除列:",
Expand Down