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

refactor: rename header slot to header content #7896

Merged
merged 2 commits into from
Oct 1, 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
6 changes: 3 additions & 3 deletions dev/dashboard-layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
<body>
<vaadin-dashboard-layout>
<vaadin-dashboard-widget widget-title="Total cost">
<span slot="header">2023-2024</span>
<span slot="header-content">2023-2024</span>
<div class="kpi-number">+203%</div>
</vaadin-dashboard-widget>

<vaadin-dashboard-widget style="--vaadin-dashboard-item-colspan: 2" widget-title="Sales">
<span slot="header">2023-2024</span>
<span slot="header-content">2023-2024</span>
<div class="chart"></div>
</vaadin-dashboard-widget>

Expand All @@ -64,7 +64,7 @@
</vaadin-dashboard-widget>

<vaadin-dashboard-widget widget-title="Just some number">
<span slot="header">2014-2024</span>
<span slot="header-content">2014-2024</span>
<div class="kpi-number">1234</div>
</vaadin-dashboard-widget>
</vaadin-dashboard-section>
Expand Down
2 changes: 1 addition & 1 deletion dev/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
}
root.firstElementChild.widgetTitle = item.title;
root.firstElementChild.innerHTML = `
<span slot="header">${item.header || ''}</span>
<span slot="header-content">${item.header || ''}</span>
${item.type === 'chart' ? '<div class="chart"></div>' : `<div class="kpi-number">${item.content}</div>`}
`;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/dashboard/src/vaadin-dashboard-widget.js
tomivirkki marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class DashboardWidget extends DashboardItemMixin(ControllerMixin(ElementMixin(Po
<header>
${this.__renderDragHandle()}
<slot name="title" id="title" @slotchange="${this.__onTitleSlotChange}"></slot>
<slot name="header"></slot>
<slot name="header-content"></slot>
${this.__renderRemoveButton()}
</header>

Expand Down
Loading