Skip to content

refactor!: move default vaadin-crud-grid to light DOM - #4948

Merged
web-padawan merged 2 commits into
masterfrom
refactor/crud-grid-light-dom
Nov 9, 2022
Merged

web-padawan merged 2 commits into
masterfrom
refactor/crud-grid-light-dom

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

Fixes #4294

Moved the default vaadin-crud-grid to light DOM of vaadin-crud to align with the way how Flow counterpart works.
This makes it possible to style vaadin-crud-edit element and vaadin-text-field elements in header cells directly.

Type of change

  • Breaking change

@web-padawan
web-padawan force-pushed the refactor/crud-grid-light-dom branch from 4698bf8 to e5ba39e Compare November 7, 2022 14:43
Comment on lines -101 to -106
vaadin-text-field[theme~='small'] {
height: 24px;
font-size: var(--material-small-font-size);
margin: 0;
padding: 0;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These styles don't work anymore, and can't be preserved due to ::slotted() limitations.

Adding registerStyles for other component, e.g. vaadin-grid-filter here isn't an option, because there is a chance that this component would be imported elsewhere, so a warning would be shown.

I'd say we can just remove this CSS completely, as Material theme is not our main priority.
Also, Flow counterpart is not using these styles because it always creates a slotted grid.

Comment thread packages/crud/src/vaadin-crud.js Resolved
@web-padawan

Copy link
Copy Markdown
Member Author

Converting the PR back to draft, please check out #4955 first, then I will rebase to also use controller for grid.

@web-padawan
web-padawan marked this pull request as draft November 8, 2022 14:29
@web-padawan
web-padawan force-pushed the refactor/crud-grid-light-dom branch from e5ba39e to 7c2fc28 Compare November 9, 2022 10:12
@web-padawan
web-padawan marked this pull request as ready for review November 9, 2022 10:12
@web-padawan
web-padawan force-pushed the refactor/crud-grid-light-dom branch from 7c2fc28 to 410600d Compare November 9, 2022 10:13
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2022

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Comment on lines +958 to +962
if (theme) {
grid.setAttribute('theme', theme);
} else {
grid.removeAttribute('theme');
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the theme was not propagated to the slotted grid before? I think it makes sense to propagate it, but want to make sure I'm getting this right.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sounds like it wasn't. I could create a separate PR for 23.3 branch to fix that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPD: actually, we have ITs in Flow counterpart to ensure theme is not propagated. Created #4999 to fix.

@web-padawan
web-padawan removed the request for review from vursen November 9, 2022 11:26
@web-padawan
web-padawan merged commit 879a5f2 into master Nov 9, 2022
@web-padawan
web-padawan deleted the refactor/crud-grid-light-dom branch November 9, 2022 11:26
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move vaadin-crud's default grid to light dom

3 participants