Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue committed Oct 25, 2024
1 parent 09dea05 commit f55ac76
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/columnresizing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export type ColumnResizingOptions = {
* Minimum width of a cell /column. The column cannot be resized smaller than this.
*/
cellMinWidth?: number;
/**
* The default minWidth of a cell / column when it doesn't have an explicit width (i.e.: it has not been resized manually)
*/
/**
* The default minWidth of a cell / column when it doesn't have an explicit width (i.e.: it has not been resized manually)
*/
defaultCellMinWidth?: number;
lastColumnResizable?: boolean;
/**
Expand Down Expand Up @@ -88,12 +88,7 @@ export function columnResizing({

handleDOMEvents: {
mousemove: (view, event) => {
handleMouseMove(
view,
event,
handleWidth,
lastColumnResizable,
);
handleMouseMove(view, event, handleWidth, lastColumnResizable);
},
mouseleave: (view) => {
handleMouseLeave(view);
Expand Down Expand Up @@ -230,7 +225,12 @@ function handleMouseDown(
if (!pluginState) return;
if (pluginState.dragging) {
const dragged = draggedWidth(pluginState.dragging, event, cellMinWidth);
displayColumnWidth(view, pluginState.activeHandle, dragged, defaultCellMinWidth);
displayColumnWidth(
view,
pluginState.activeHandle,
dragged,
defaultCellMinWidth,
);
}
}

Expand Down
11 changes: 9 additions & 2 deletions src/tableview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ export class TableView implements NodeView {
update(node: Node): boolean {
if (node.type != this.node.type) return false;
this.node = node;
updateColumnsOnResize(node, this.colgroup, this.table, this.defaultCellMinWidth);
updateColumnsOnResize(
node,
this.colgroup,
this.table,
this.defaultCellMinWidth,
);
return true;
}

Expand Down Expand Up @@ -68,7 +73,9 @@ export function updateColumnsOnResize(
} else {
if (nextDOM.style.width != cssWidth) {
nextDOM.style.width = cssWidth;
nextDOM.style.minWidth = cssWidth.length ? '' : defaultCellMinWidth + 'px';
nextDOM.style.minWidth = cssWidth.length
? ''
: defaultCellMinWidth + 'px';
}
nextDOM = nextDOM.nextSibling as HTMLElement;
}
Expand Down

0 comments on commit f55ac76

Please sign in to comment.