Skip to content

Commit a739e2e

Browse files
added tooltip option for table header
1 parent 4cd85cc commit a739e2e

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

client/packages/lowcoder/src/comps/comps/tableComp/column/columnTypeComps/columnDropdownComp.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ export const ColumnDropdownComp = (function () {
5252
);
5353

5454
return (
55-
5655
<Dropdown
5756
trigger={["click"]}
58-
placement="bottom"
57+
placement="bottomRight"
5958
menu={{items}}
6059
dropdownRender={() => menu}
6160
>

client/packages/lowcoder/src/comps/comps/tableComp/column/tableColumnComp.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export type CellColorViewType = (param: {
8686
export const columnChildrenMap = {
8787
// column title
8888
title: StringControl,
89+
tooltip: StringControl,
8990
showTitle: withDefault(BoolControl, true),
9091
// a custom column or a data column
9192
isCustom: valueComp<boolean>(false),
@@ -207,6 +208,9 @@ export class ColumnComp extends ColumnInitComp {
207208
label: trans("table.columnTitle"),
208209
placeholder: this.children.dataIndex.getView(),
209210
})}
211+
{this.children.tooltip.propertyView({
212+
label: trans("labelProp.tooltip"),
213+
})}
210214
<Dropdown
211215
showSearch={true}
212216
defaultValue={columnValue}

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import { JSONObject, JSONValue } from "util/jsonTypes";
1818
import { StatusType } from "./column/columnTypeComps/columnStatusComp";
1919
import { ColumnListComp, tableDataRowExample } from "./column/tableColumnListComp";
2020
import { TableColumnLinkStyleType, TableColumnStyleType } from "comps/controls/styleControlConstants";
21+
import Tooltip from "antd/es/tooltip";
22+
import InfoCircleOutlined from "@ant-design/icons/InfoCircleOutlined";
2123

2224
export const COLUMN_CHILDREN_KEY = "children";
2325
export const OB_ROW_ORI_INDEX = "__ob_origin_index";
@@ -240,11 +242,15 @@ export function getColumnsAggr(
240242
});
241243
}
242244

243-
function renderTitle(props: { title: string; editable: boolean }) {
244-
const { title, editable } = props;
245+
function renderTitle(props: { title: string; tooltip: string; editable: boolean }) {
246+
const { title, tooltip, editable } = props;
245247
return (
246248
<div>
247-
{title}
249+
<Tooltip title={tooltip}>
250+
<span style={{borderBottom: tooltip ? '1px dotted' : ''}}>
251+
{title}
252+
</span>
253+
</Tooltip>
248254
{editable && <EditableIcon style={{ verticalAlign: "baseline", marginLeft: "4px" }} />}
249255
</div>
250256
);
@@ -331,7 +337,7 @@ export function columnsToAntdFormat(
331337
text: string;
332338
status: StatusType;
333339
}[];
334-
const title = renderTitle({ title: column.title, editable: column.editable });
340+
const title = renderTitle({ title: column.title, tooltip: column.tooltip, editable: column.editable });
335341

336342
return {
337343
title: column.showTitle ? title : '',

0 commit comments

Comments
 (0)