Skip to content
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

feat(styling): expose more parts #614

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 10 additions & 7 deletions cosmoz-omnitable-header-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const /* eslint-disable-next-line max-lines-per-function */
(column) => [
html`<div
class="cell ${column.headerCellClass} header-cell"
part="cell header-cell cell-${column.name} header-cell-${column.name}"
?hidden=${column === groupOnColumn}
title=${column.title}
name=${column.name}
Expand All @@ -27,7 +28,7 @@ const /* eslint-disable-next-line max-lines-per-function */
column,
filters[column.name] ?? {},
(state) => setFilterState(column.name, state),
column.source(column, data)
column.source(column, data),
),
html` <sort-and-group-consumer
style="display:contents"
Expand All @@ -52,21 +53,23 @@ const /* eslint-disable-next-line max-lines-per-function */
.column=${column}
name=${column.name}
></cosmoz-omnitable-resize-nub>`,
]
],
),
HeaderRow = ({ columns, settingsConfig, hideSelectAll, ...thru }) => [
columns &&
renderHeaderRow({
columns,
...thru,
}),
html`${when(!hideSelectAll, () => html`
<cosmoz-omnitable-settings
.config=${settingsConfig}>
</cosmoz-omnitable-settings>`)}`,
when(
!hideSelectAll,
() =>
html` <cosmoz-omnitable-settings .config=${settingsConfig}>
</cosmoz-omnitable-settings>`,
),
];

customElements.define(
'cosmoz-omnitable-header-row',
component(HeaderRow, { useShadowDOM: false })
component(HeaderRow, { useShadowDOM: false }),
);
1 change: 1 addition & 0 deletions cosmoz-omnitable-item-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const ItemRow = ({
(column) => {
return html`<div
class="cell itemRow-cell ${column.cellClass ?? ''}"
part="cell itemRow-cell cell-${column.name} itemRow-cell-${column.name}"
?hidden="${column === groupOnColumn}"
?editable="${column.editable}"
title="${column.cellTitleFn(column, item)}"
Expand Down