Skip to content
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
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.0] - 2026-11-17

### Changed

- **Bundled AdminLTE updated to 4.10.2** (from 4.8.4) and **Bootstrap to 5.3.9**
(from 5.3.8), with Bootstrap Icons 1.13.2 and OverlayScrollbars 2.17.0. The
refreshed bundle brings the 4.9 print defaults (the app shell no longer
prints; `data-lte-print="plain"` opts a page into document-style printing),
`data-lte-contrast="aa"`, `data-lte-primary` theming and the other fixes from
AdminLTE 4.9.0 to 4.10.2.
- **The demo draws its charts with Chart.js instead of ApexCharts.** From
ApexCharts 5.2 the library is no longer MIT-licensed, and the demo is a
template that gets copied into products. The dashboards now follow the core
AdminLTE demo: Chart.js 4.6.1 plus the shared theme preset
(`wwwroot/js/chart-theme.js`), which follows the colour mode live.
- Demo: FullCalendar 6.1.20 to 7.1.5 (new stylesheets, Bootstrap 5 theme
plugin, `Interaction.Draggable`, `color`/`contrastColor` event options) and
jsVectorMap 1.5.3 to 1.7.0, matching the core demo. The logo pin moves to
AdminLTE 4.10.2.

## [0.3.1] - 2026-08-19

### Fixed
Expand Down Expand Up @@ -47,7 +67,8 @@ First public release on NuGet: Blazor components, Tag Helpers and the bundled
AdminLTE 4 static web assets. Tagged retroactively — the release was packed and
pushed without step 4 of `RELEASING.md`, so no tag existed until now.

[Unreleased]: https://github.com/ColorlibHQ/adminlte-aspnet/compare/v0.3.1...HEAD
[Unreleased]: https://github.com/ColorlibHQ/adminlte-aspnet/compare/v0.4.0...HEAD
[0.4.0]: https://github.com/ColorlibHQ/adminlte-aspnet/compare/v0.3.1...v0.4.0
[0.3.1]: https://github.com/ColorlibHQ/adminlte-aspnet/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/ColorlibHQ/adminlte-aspnet/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/ColorlibHQ/adminlte-aspnet/releases/tag/v0.2.0
2 changes: 1 addition & 1 deletion NUGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Reference the bundled CSS/JS in `App.razor` and wrap pages in `DashboardLayout`:
- **Config-driven sidebar menu** — a strongly-typed `MenuItem` model bound from `appsettings.json`, with authorization policy/role support and automatic active-item highlighting.
- **Light / dark / auto colour mode** — persisted to `localStorage`, with a blocking script so there is no flash of the wrong theme.
- **Command palette** — searches your authorized menu, opens with Cmd/Ctrl+K.
- **Bundled static web assets** — AdminLTE 4, Bootstrap 5.3.8 and Bootstrap Icons served from `/_content/ColorlibHQ.AdminLTE.AspNetCore/…`.
- **Bundled static web assets** — AdminLTE 4, Bootstrap 5.3.9 and Bootstrap Icons served from `/_content/ColorlibHQ.AdminLTE.AspNetCore/…`.

## Requirements

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The same AdminLTE 4 dashboard, in the framework you know best — you're looking
- **Config-driven sidebar menu** — a strongly-typed `MenuItem` model bound from `appsettings.json` via the Options pattern (text, route/href, icon, badge, submenu, **authorization policy / role**), with automatic active-item highlighting.
- **Light / dark / auto color mode** — persisted to `localStorage`, with a server-respecting blocking script so there's **no flash of the wrong theme** on first paint.
- **⌘K command palette** — searches your (authorized) menu; opens via the topbar pill or Cmd/Ctrl+K.
- **Bundled static web assets** — compiled AdminLTE 4, Bootstrap 5.3.8 and Bootstrap Icons served from `/_content/ColorlibHQ.AdminLTE.AspNetCore/…`. No npm build step required by consumers.
- **Bundled static web assets** — compiled AdminLTE 4, Bootstrap 5.3.9 and Bootstrap Icons served from `/_content/ColorlibHQ.AdminLTE.AspNetCore/…`. No npm build step required by consumers.

## Requirements

Expand Down
14 changes: 9 additions & 5 deletions samples/AdminLte.Demo/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

@* Plugin CSS for the JS-plugin demo pages (FullCalendar ships its CSS in its JS bundle). *@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.snow.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jsvectormap@1.5.3/dist/css/jsvectormap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jsvectormap@1.7.0/dist/jsvectormap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fullcalendar@7.1.5/skeleton.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@@fullcalendar/bootstrap5@7.1.5/theme.css">

<ImportMap />
<HeadOutlet @rendermode="InteractiveServer" />
Expand All @@ -29,12 +31,14 @@
<AdminLteScripts />

@* CDN plugin libraries + the demo interop module for the JS-plugin pages. *@
<script src="https://cdn.jsdelivr.net/npm/apexcharts@3.37.1/dist/apexcharts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.20/index.global.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.6.1/dist/chart.umd.min.js" integrity="sha256-hzZMwrKnamaEkp59a4Cxiol3lNs4QAyv8fzxeRxpJdI=" crossorigin="anonymous"></script>
<script src="js/chart-theme.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@7.1.5/all/global.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@@fullcalendar/bootstrap5@7.1.5/global.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.7/Sortable.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsvectormap@1.5.3/dist/js/jsvectormap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsvectormap@1.5.3/dist/maps/world.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsvectormap@1.7.0/dist/jsvectormap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsvectormap@1.7.0/dist/maps/world.js"></script>
<script src="js/demo-interop.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion samples/AdminLte.Demo/Components/Pages/Calendar.razor
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<FooterContent>
<span class="text-secondary small">
Powered by
<a href="https://fullcalendar.io/" target="_blank" rel="noopener">FullCalendar 6</a>
<a href="https://fullcalendar.io/" target="_blank" rel="noopener">FullCalendar 7</a>
&mdash; MIT licensed, jQuery-free.
</span>
</FooterContent>
Expand Down
12 changes: 7 additions & 5 deletions samples/AdminLte.Demo/Components/Pages/Dashboard.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page "/"
@inject IJSRuntime JS
@* Dashboard — 1:1 port of the core dist/index.html. Sales area chart renders via
ApexCharts and the world map via jsvectormap, both through JS interop. *@
Chart.js and the world map via jsvectormap, both through JS interop. *@

<PageTitle>AdminLTE v4 | Dashboard · AdminLTE 4 for ASP.NET Core</PageTitle>

Expand All @@ -28,7 +28,9 @@
@* Sales Value area chart *@
<Card Title="Sales Value" BodyClass="">
<ChildContent>
<div @ref="_chartRef"></div>
<div class="position-relative" style="height: 300px">
<canvas @ref="_chartRef" role="img" aria-label="Area chart of digital goods and electronics sales, January to July 2023"></canvas>
</div>
</ChildContent>
</Card>

Expand Down Expand Up @@ -67,15 +69,15 @@
<div class="card-footer border-0">
<div class="row">
<div class="col-4 text-center">
<div id="sparkline-1" class="text-dark"></div>
<div class="position-relative" style="height: 50px"><canvas id="sparkline-1" role="img" aria-label="Visitors trend"></canvas></div>
<div class="text-white">Visitors</div>
</div>
<div class="col-4 text-center">
<div id="sparkline-2" class="text-dark"></div>
<div class="position-relative" style="height: 50px"><canvas id="sparkline-2" role="img" aria-label="Online trend"></canvas></div>
<div class="text-white">Online</div>
</div>
<div class="col-4 text-center">
<div id="sparkline-3" class="text-dark"></div>
<div class="position-relative" style="height: 50px"><canvas id="sparkline-3" role="img" aria-label="Sales trend"></canvas></div>
<div class="text-white">Sales</div>
</div>
</div>
Expand Down
10 changes: 7 additions & 3 deletions samples/AdminLte.Demo/Components/Pages/Dashboard2.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/dashboard/v2"
@inject IJSRuntime JS
@* Dashboard v2 — port of the core dist/index2.html. Charts render via ApexCharts JS interop. *@
@* Dashboard v2 — port of the core dist/index2.html. Charts render via Chart.js JS interop. *@

<PageTitle>Dashboard v2 · AdminLTE 4 for ASP.NET Core</PageTitle>

Expand Down Expand Up @@ -29,7 +29,9 @@
<div class="row">
<div class="col-md-8">
<p class="text-center"><strong>Sales: 1 Jan, 2023 - 30 Jul, 2023</strong></p>
<div @ref="_salesChart"></div>
<div class="position-relative" style="height: 180px">
<canvas @ref="_salesChart" role="img" aria-label="Area chart of digital goods and electronics sales, January to July 2023"></canvas>
</div>
</div>
<div class="col-md-4">
<p class="text-center"><strong>Goal Completion</strong></p>
Expand Down Expand Up @@ -166,7 +168,9 @@
<ChildContent>
<div class="row">
<div class="col-12">
<div @ref="_donut"></div>
<div class="position-relative" style="height: 350px">
<canvas @ref="_donut" role="img" aria-label="Donut chart of browser usage"></canvas>
</div>
</div>
</div>
</ChildContent>
Expand Down
10 changes: 5 additions & 5 deletions samples/AdminLte.Demo/Components/Pages/Dashboard3.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/dashboard/v3"
@inject IJSRuntime JS
@* Dashboard v3 — port of the core dist/index3.html. Charts render via ApexCharts JS interop. *@
@* Dashboard v3 — port of the core dist/index3.html. Charts render via Chart.js JS interop. *@

<PageTitle>Dashboard v3 · AdminLTE 4 for ASP.NET Core</PageTitle>

Expand All @@ -26,8 +26,8 @@
<span class="text-secondary">Since last week</span>
</p>
</div>
<div class="position-relative mb-4">
<div @ref="_visitorsChart"></div>
<div class="position-relative mb-4" style="height: 200px">
<canvas @ref="_visitorsChart" role="img" aria-label="Line chart of online store visitors this week and last week"></canvas>
</div>
<div class="d-flex flex-row justify-content-end">
<span class="me-2"><i class="bi bi-square-fill text-primary"></i> This Week</span>
Expand Down Expand Up @@ -102,8 +102,8 @@
<span class="text-secondary">Since Past Year</span>
</p>
</div>
<div class="position-relative mb-4">
<div @ref="_salesBar"></div>
<div class="position-relative mb-4" style="height: 200px">
<canvas @ref="_salesBar" role="img" aria-label="Column chart of net profit, revenue and free cash flow, February to October"></canvas>
</div>
<div class="d-flex flex-row justify-content-end">
<span class="me-2"><i class="bi bi-square-fill text-primary"></i> This year</span>
Expand Down
2 changes: 1 addition & 1 deletion samples/AdminLte.Demo/Components/Pages/Kanban.razor
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
Id = "done", Title = "Done", BadgeClass = "text-bg-success",
Cards =
[
new TaskCard { Label = "feature", LabelClass = "text-bg-primary", Title = "Upgrade to Bootstrap 5.3.8", Assignees = ["DM"] },
new TaskCard { Label = "feature", LabelClass = "text-bg-primary", Title = "Upgrade to Bootstrap 5.3.9", Assignees = ["DM"] },
new TaskCard { Label = "feature", LabelClass = "text-bg-primary", Title = "Ship 8 Tier-1 page templates", Body = "Profile, settings, invoice, pricing, FAQ, 404/500/maintenance.", Assignees = ["JD", "OB"] },
new TaskCard { Label = "tech debt", LabelClass = "text-bg-secondary", Title = "Drop dead eslint-config-xo deps", Assignees = ["DM"] },
],
Expand Down
2 changes: 1 addition & 1 deletion samples/AdminLte.Demo/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"AdminLte": {
"BrandText": "AdminLTE 4",
"BrandUrl": "/",
"LogoImage": "https://cdn.jsdelivr.net/npm/admin-lte@4.8.4/dist/assets/img/AdminLTELogo.png",
"LogoImage": "https://cdn.jsdelivr.net/npm/admin-lte@4.10.2/dist/assets/img/AdminLTELogo.png",
"SidebarTheme": "dark",
"DefaultColorMode": "auto",
"ColorModeToggle": true,
Expand Down
10 changes: 10 additions & 0 deletions samples/AdminLte.Demo/wwwroot/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ pre {
white-space: pre-wrap;
word-break: break-word;
}

/* Calendar: keep adjacent-month dates readable in both colour modes (FullCalendar 7). */
#calendar .text-body-tertiary {
color: var(--bs-secondary-color) !important;
}

.draggable-event {
cursor: grab;
user-select: none;
}
153 changes: 153 additions & 0 deletions samples/AdminLte.Demo/wwwroot/js/chart-theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
// AdminLTE chart theme preset (copied from the core AdminLTE 4.10 demo pages).
// Styles every Chart.js chart from AdminLTE's CSS variables and keeps them in step with
// the colour mode. Loaded after Chart.js and before demo-interop.js.
// Styles every Chart.js chart on the page from AdminLTE's CSS variables —
// font, text, gridlines, tooltip and legend — and keeps them in step with the
// colour mode (ColorMode, the OS in auto mode, or your own code) and with
// `dir="rtl"`. Canvas can't read CSS, so the values are resolved here and
// re-applied to every chart whenever <html data-bs-theme> or dir changes.
(() => {
'use strict';
const { Chart } = globalThis;
if (!Chart) {
return;
}

const root = document.documentElement;
const cssVar = (name, fallback = '') =>
getComputedStyle(root).getPropertyValue(name).trim() || fallback;

// "#0d6efd" (or "#06f") + 0.3 -> "rgba(13, 110, 253, 0.3)"; anything else is returned as is.
const alpha = (color, opacity) => {
let hex = String(color).trim().replace(/^#/, '');
if (!/^[\da-f]{3}([\da-f]{3})?$/i.test(hex)) {
return color;
}

if (hex.length === 3) {
hex = [...hex].map((c) => c + c).join('');
}

const [r, g, b] = [0, 2, 4].map((i) => Number.parseInt(hex.slice(i, i + 2), 16));
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
};

// Scriptable backgroundColor for area charts: the line colour fading to transparent.
const areaFill =
(color, from = 0.35, to = 0) =>
(context) => {
const { ctx, chartArea } = context.chart;
if (!chartArea) {
return alpha(color, from);
}

const gradient = ctx.createLinearGradient(0, chartArea.top, 0, chartArea.bottom);
gradient.addColorStop(0, alpha(color, from));
gradient.addColorStop(1, alpha(color, to));
return gradient;
};

// The theme colours currently in Chart.defaults.
let applied = [];

const apply = () => {
const text = cssVar('--bs-secondary-color', '#6c757d');
const body = cssVar('--bs-body-color', '#212529');
const surface = cssVar('--bs-body-bg', '#fff');
const grid = `rgba(${cssVar('--bs-emphasis-color-rgb', '0, 0, 0')}, 0.08)`;
const rtl = root.getAttribute('dir') === 'rtl';
const d = Chart.defaults;
applied = [text, grid];

d.font.family = cssVar('--bs-body-font-family', d.font.family);
d.font.size = 12;
d.color = text;
d.borderColor = grid;
d.maintainAspectRatio = false;

d.scale.grid.color = grid;
d.scale.border.color = grid;
d.scale.ticks.padding = 8;
// Value axes float, category axes keep only their baseline.
d.set('scales.linear', { border: { display: false } });
d.set('scales.category', { grid: { display: false } });

d.elements.line.borderWidth = 2;
d.elements.point.radius = 0;
d.elements.point.hoverRadius = 5;
d.elements.point.hitRadius = 8;
d.elements.point.hoverBorderWidth = 2;
d.elements.point.borderColor = surface;
d.elements.bar.borderRadius = 4;
d.elements.arc.borderColor = surface;
d.elements.arc.borderWidth = 2;

const { legend, tooltip } = d.plugins;
legend.position = 'bottom';
legend.rtl = rtl;
Object.assign(legend.labels, {
color: body,
usePointStyle: true,
pointStyle: 'circle',
boxWidth: 8,
boxHeight: 8,
padding: 16,
});

Object.assign(tooltip, {
rtl,
backgroundColor: surface,
borderColor: cssVar('--bs-border-color', '#dee2e6'),
borderWidth: 1,
titleColor: cssVar('--bs-emphasis-color', '#000'),
bodyColor: body,
titleFont: { weight: '600' },
padding: 10,
cornerRadius: 6,
caretSize: 5,
boxPadding: 4,
usePointStyle: true,
});

// Line and bar charts share one tooltip per x value, like a dashboard should.
for (const type of ['line', 'bar']) {
Chart.overrides[type].interaction = { mode: 'index', intersect: false };
}
};

// Chart.js copies the scale defaults (tick, grid, border and title colours)
// into each chart's config when the chart is created, so new defaults alone
// never reach an existing chart's axes. Drop the copies that still hold the
// previous theme's colours; update() then copies the new ones in. Colours a
// chart set for itself are left alone.
const forgetThemeColors = (options, stale) => {
for (const [key, value] of Object.entries(options)) {
if (value && typeof value === 'object' && !Array.isArray(value)) {
forgetThemeColors(value, stale);
} else if (/color$/i.test(key) && stale.includes(value)) {
delete options[key];
}
}
};

const refresh = () => {
const stale = applied;
apply();
for (const chart of Object.values(Chart.instances)) {
forgetThemeColors(chart.config.options.scales || {}, stale);
chart.update('none');
}
};

apply();
new MutationObserver(refresh).observe(root, {
attributes: true,
attributeFilter: ['data-bs-theme', 'dir'],
});
// The web font may arrive after the first draw; redraw so labels use it.
document.fonts?.addEventListener('loadingdone', refresh);

// Helpers for the page's own chart code.
// eslint-disable-next-line unicorn/no-global-object-property-assignment
globalThis.lteChartTheme = { cssVar, alpha, areaFill, refresh };
})();
Loading
Loading