Files
outline/shared/editor/styles/utils.ts
Tom Moor da19054555 Table improvements (#6958)
* Header toggling, resizable columns

* Allow all blocks in table cells, disable column resizing in read-only

* Fixed dynamic scroll shadows

* Refactor, scroll styling

* fix scrolling, tweaks

* fix: Table layout lost on sort

* fix: Caching of grip decorators

* refactor

* stash

* fix first render shadows

* stash

* First add column grip, styles

* Just add column/row click handlers left

* fix: isTableSelected for single cell table

* Refactor mousedown handlers

* fix: 'Add row before' command missing on first row

* fix overflow on rhs

* fix: Error clicking column grip when menu is open

* Hide table controls when printing

* Restore table header background

* fix: Header behavior when adding columns and rows at the edges

* Tweak header styling

* fix: Serialize and parsing of column attributes when copy/pasting
fix: Column width is lost when changing column alignment
2024-05-31 14:52:39 -07:00

24 lines
602 B
TypeScript

/**
* Combines class names into a single string. If the value is an object, it will only include keys
* with a truthy value.
*
* @param classNames An array of class names
* @returns A single string of class names
*/
export function cn(
...classNames: (string | number | Record<string, boolean> | undefined)[]
) {
return classNames
.filter(Boolean)
.map((item) => {
if (typeof item === "object") {
return Object.entries(item)
.filter(([, value]) => value)
.map(([key]) => key)
.join(" ");
}
return item;
})
.join(" ");
}