Skip to content

Commit

Permalink
add inlineUseTooltips options prop but not working fully yet
Browse files Browse the repository at this point in the history
  • Loading branch information
bobular committed Jun 19, 2024
1 parent e6904a1 commit 06f4959
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default function TreeTable<RowType>(props: TreeTableProps<RowType>) {
...props.tableProps.options,
deriveRowClassName: (_) => rowStyleClassName,
inline: true,
inlineUseTooltips: true,
inlineMaxHeight: `${rowHeight}px`,
inlineMaxWidth: `${maxColumnWidth}px`,
},
Expand Down
11 changes: 6 additions & 5 deletions packages/libs/coreui/src/components/Mesa/Ui/DataRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,23 @@ class DataRow extends React.PureComponent {

expandRow() {
const { options } = this.props;
if (!options.inline) return;
if (!options.inline || options.inlineUseTooltips) return;
this.setState({ expanded: true });
}

collapseRow() {
const { options } = this.props;
if (!options.inline) return;
if (!options.inline || options.inlineUseTooltips) return;
this.setState({ expanded: false });
}

handleRowClick() {
const { row, rowIndex, options } = this.props;
const { inline, onRowClick } = options;
const { inline, onRowClick, inlineUseTooltips } = options;
if (!inline && !onRowClick) return;

if (inline) this.setState({ expanded: !this.state.expanded });
console.log({ options });
if (inline && !inlineUseTooltips)
this.setState({ expanded: !this.state.expanded });
if (typeof onRowClick === 'function') onRowClick(row, rowIndex);
}

Expand Down
1 change: 1 addition & 0 deletions packages/libs/coreui/src/components/Mesa/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface MesaStateProps<
inline?: boolean;
inlineMaxWidth?: string;
inlineMaxHeight?: string;
inlineUseTooltips?: boolean; // on clicking on a row, don't expand the row height-wise to show the full contents, use a tooltip instead
className?: string;
errOnOverflow?: boolean;
editableColumns?: boolean;
Expand Down

0 comments on commit 06f4959

Please sign in to comment.