From 462a19f4d852c391bc94d2e2ad4dbbb6764da0b8 Mon Sep 17 00:00:00 2001 From: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:25:56 +0300 Subject: [PATCH] refactor: rename dense to dense layout (#7884) --- packages/dashboard/src/vaadin-dashboard-layout-mixin.d.ts | 2 +- packages/dashboard/src/vaadin-dashboard-layout-mixin.js | 4 ++-- packages/dashboard/test/dashboard-layout.test.ts | 6 +++--- packages/dashboard/test/typings/dashboard.types.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/dashboard/src/vaadin-dashboard-layout-mixin.d.ts b/packages/dashboard/src/vaadin-dashboard-layout-mixin.d.ts index 8ff76e23f5..167f257522 100644 --- a/packages/dashboard/src/vaadin-dashboard-layout-mixin.d.ts +++ b/packages/dashboard/src/vaadin-dashboard-layout-mixin.d.ts @@ -22,5 +22,5 @@ export declare class DashboardLayoutMixinClass { /** * Whether the dashboard layout is dense. */ - dense: boolean; + denseLayout: boolean; } diff --git a/packages/dashboard/src/vaadin-dashboard-layout-mixin.js b/packages/dashboard/src/vaadin-dashboard-layout-mixin.js index 77939a0977..7e5aa7a2c0 100644 --- a/packages/dashboard/src/vaadin-dashboard-layout-mixin.js +++ b/packages/dashboard/src/vaadin-dashboard-layout-mixin.js @@ -30,7 +30,7 @@ export const DashboardLayoutMixin = (superClass) => display: none !important; } - :host([dense]) #grid { + :host([dense-layout]) #grid { grid-auto-flow: dense; } @@ -101,7 +101,7 @@ export const DashboardLayoutMixin = (superClass) => * Whether the dashboard layout is dense. * @type {boolean} */ - dense: { + denseLayout: { type: Boolean, value: false, reflectToAttribute: true, diff --git a/packages/dashboard/test/dashboard-layout.test.ts b/packages/dashboard/test/dashboard-layout.test.ts index f4b812d43f..2e9fb6181a 100644 --- a/packages/dashboard/test/dashboard-layout.test.ts +++ b/packages/dashboard/test/dashboard-layout.test.ts @@ -554,12 +554,12 @@ describe('dashboard layout', () => { }); }); - describe('dense', () => { + describe('dense layout', () => { beforeEach(async () => { dashboard.appendChild(fixtureSync('
Item 2
')); childElements = [...dashboard.querySelectorAll('div')]; setColspan(childElements[1], 2); - dashboard.dense = true; + dashboard.denseLayout = true; await nextFrame(); }); @@ -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, [ diff --git a/packages/dashboard/test/typings/dashboard.types.ts b/packages/dashboard/test/typings/dashboard.types.ts index 239f022abf..97d88bddcd 100644 --- a/packages/dashboard/test/typings/dashboard.types.ts +++ b/packages/dashboard/test/typings/dashboard.types.ts @@ -35,7 +35,7 @@ assertType(genericDashboard); assertType(genericDashboard); assertType> | null | undefined>(genericDashboard.items); assertType(genericDashboard.editable); -assertType(genericDashboard.dense); +assertType(genericDashboard.denseLayout); assertType<{ selectWidget: string; @@ -113,7 +113,7 @@ narrowedDashboard.addEventListener('dashboard-item-resize-mode-changed', (event) /* DashboardLayout */ const layout = document.createElement('vaadin-dashboard-layout'); assertType(layout); -assertType(layout.dense); +assertType(layout.denseLayout); assertType(layout); assertType(layout);