Skip to content

Commit

Permalink
refactor: rename dense to dense layout (#7884)
Browse files Browse the repository at this point in the history
  • Loading branch information
ugur-vaadin authored Sep 30, 2024
1 parent c801860 commit 462a19f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/dashboard/src/vaadin-dashboard-layout-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export declare class DashboardLayoutMixinClass {
/**
* Whether the dashboard layout is dense.
*/
dense: boolean;
denseLayout: boolean;
}
4 changes: 2 additions & 2 deletions packages/dashboard/src/vaadin-dashboard-layout-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const DashboardLayoutMixin = (superClass) =>
display: none !important;
}
:host([dense]) #grid {
:host([dense-layout]) #grid {
grid-auto-flow: dense;
}
Expand Down Expand Up @@ -101,7 +101,7 @@ export const DashboardLayoutMixin = (superClass) =>
* Whether the dashboard layout is dense.
* @type {boolean}
*/
dense: {
denseLayout: {
type: Boolean,
value: false,
reflectToAttribute: true,
Expand Down
6 changes: 3 additions & 3 deletions packages/dashboard/test/dashboard-layout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,12 @@ describe('dashboard layout', () => {
});
});

describe('dense', () => {
describe('dense layout', () => {
beforeEach(async () => {
dashboard.appendChild(fixtureSync('<div id="2">Item 2</div>'));
childElements = [...dashboard.querySelectorAll('div')];
setColspan(childElements[1], 2);
dashboard.dense = true;
dashboard.denseLayout = true;
await nextFrame();
});

Expand All @@ -572,7 +572,7 @@ describe('dashboard layout', () => {
});

it('should retain the order of items', async () => {
dashboard.dense = false;
dashboard.denseLayout = false;
await nextFrame();
/* prettier-ignore */
expectLayout(dashboard, [
Expand Down
4 changes: 2 additions & 2 deletions packages/dashboard/test/typings/dashboard.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ assertType<ElementMixinClass>(genericDashboard);
assertType<DashboardLayoutMixinClass>(genericDashboard);
assertType<Array<DashboardItem | DashboardSectionItem<DashboardItem>> | null | undefined>(genericDashboard.items);
assertType<boolean>(genericDashboard.editable);
assertType<boolean>(genericDashboard.dense);
assertType<boolean>(genericDashboard.denseLayout);

assertType<{
selectWidget: string;
Expand Down Expand Up @@ -113,7 +113,7 @@ narrowedDashboard.addEventListener('dashboard-item-resize-mode-changed', (event)
/* DashboardLayout */
const layout = document.createElement('vaadin-dashboard-layout');
assertType<DashboardLayout>(layout);
assertType<boolean>(layout.dense);
assertType<boolean>(layout.denseLayout);

assertType<ElementMixinClass>(layout);
assertType<DashboardLayoutMixinClass>(layout);
Expand Down

0 comments on commit 462a19f

Please sign in to comment.