Skip to content

Commit 5924e38

Browse files
committed
Deploying to gh-pages from @ 5ff42ba 🚀
1 parent fceee34 commit 5924e38

290 files changed

Lines changed: 421 additions & 223 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ScratchcardStatistics.styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
@import '_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.b6pgxrrsua.bundle.scp.css';
1+
@import '_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.wuc5ioiakb.bundle.scp.css';
22

-5 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

_content/Microsoft.FluentUI.AspNetCore.Components/Components/AnchoredRegion/FluentAnchoredRegion.razor.js

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ export function goToNextFocusableElement(forContainer, toOriginal, delay) {
3636
/**
3737
* Focusable Element
3838
*/
39-
class FocusableElement {
40-
39+
export class FocusableElement {
4140
FOCUSABLE_SELECTORS = "input, select, textarea, button, object, a[href], area[href], [tabindex]";
4241
_originalActiveElement;
4342
_container;
@@ -64,11 +63,32 @@ class FocusableElement {
6463
* @returns
6564
*/
6665
findNextFocusableElement(currentElement) {
67-
// Get all focusable elements
68-
const focusableElements = this._container.querySelectorAll(this.FOCUSABLE_SELECTORS);
66+
// Fluent web components may have children that are focusable, but they are not
67+
// focusable themselves. Thus, we unfortunately need to query every element or provide
68+
// a list of all fluent elements that have focusable children.
69+
const queriedElements = Array.from(this._container.querySelectorAll("*")).filter(el => {
70+
return el.matches(this.FOCUSABLE_SELECTORS) || el.tagName.toLowerCase().startsWith("fluent-");
71+
});
72+
73+
const focusableElements = [];
74+
75+
// If an element is a fluent web component and is not focusable, replace with its inner focusable element
76+
// if one exists.
77+
queriedElements.forEach((el, index) => {
78+
if (el.tagName.toLowerCase().startsWith("fluent-") && el.tabIndex === -1 && !!el.shadowRoot) {
79+
Array.from(el.shadowRoot.children).forEach(child => {
80+
if (child.tabIndex !== -1 && child.checkVisibility()) {
81+
focusableElements.push(child);
82+
}
83+
});
84+
}
85+
else {
86+
focusableElements.push(el);
87+
}
88+
});
6989

70-
// Filter out elements with tabindex="-1"
71-
const filteredElements = Array.from(focusableElements).filter(el => el?.tabIndex !== -1);
90+
// Filter out elements with tabindex="-1" and elements that are not visible
91+
const filteredElements = focusableElements.filter(el => !!el && el.tabIndex !== -1 && el.checkVisibility());
7292

7393
// Find the index of the current element
7494
const current = currentElement ?? document.activeElement;

_content/Microsoft.FluentUI.AspNetCore.Components/Components/DataGrid/FluentDataGrid.razor.js

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
let grids = [];
2-
const minWidth = 100;
32

43
export function init(gridElement, autoFocus) {
54
if (gridElement === undefined || gridElement === null) {
@@ -220,11 +219,13 @@ export function enableColumnResizing(gridElement, resizeColumnOnAllRows = true)
220219
}
221220

222221
const id = gridElement.id;
223-
grids.push({
224-
id,
225-
columns,
226-
initialWidths,
227-
});
222+
if (!grids.find(grid => grid.id === id)) {
223+
grids.push({
224+
id,
225+
columns,
226+
initialWidths,
227+
});
228+
}
228229

229230
function setListeners(div, isRTL) {
230231
let pageX, curCol, curColWidth;
@@ -255,7 +256,7 @@ export function enableColumnResizing(gridElement, resizeColumnOnAllRows = true)
255256
const diffX = isRTL ? pageX - e.pageX : e.pageX - pageX;
256257
const column = columns.find(({ header }) => header === curCol);
257258

258-
column.size = parseInt(Math.max(minWidth, curColWidth + diffX), 10) + 'px';
259+
column.size = parseInt(Math.max(parseInt(column.header.style.minWidth), curColWidth + diffX), 10) + 'px';
259260

260261
columns.forEach((col) => {
261262
if (col.size.startsWith('minmax')) {
@@ -352,7 +353,7 @@ export function resetColumnWidths(gridElement) {
352353
}
353354

354355
export function resizeColumnDiscrete(gridElement, column, change) {
355-
356+
const isGrid = gridElement.classList.contains('grid');
356357
const columns = [];
357358
let headerBeingResized;
358359

@@ -370,27 +371,32 @@ export function resizeColumnDiscrete(gridElement, column, change) {
370371

371372
grids.find(({ id }) => id === gridElement.id).columns.forEach(column => {
372373
if (column.header === headerBeingResized) {
373-
const width = headerBeingResized.getBoundingClientRect().width + change;
374+
const width = headerBeingResized.offsetWidth + change; //.getBoundingClientRect().width + change;
374375

375376
if (change < 0) {
376-
column.size = Math.max(minWidth, width) + 'px';
377+
column.size = Math.max(parseInt(column.header.style.minWidth), width) + 'px';
377378
}
378379
else {
379380
column.size = width + 'px';
380381
}
382+
column.header.style.width = column.size;
381383
}
382-
else {
384+
if (isGrid) {
385+
// for grid we need to recalculate all columns that are minmax
383386
if (column.size.startsWith('minmax')) {
384387
column.size = parseInt(column.header.clientWidth, 10) + 'px';
385388
}
389+
columns.push(column.size);
386390
}
387-
columns.push(column.size);
388391
});
389392

390-
gridElement.style.gridTemplateColumns = columns.join(' ');
393+
if (isGrid) {
394+
gridElement.style.gridTemplateColumns = columns.join(' ');
395+
}
391396
}
392397

393398
export function resizeColumnExact(gridElement, column, width) {
399+
const isGrid = gridElement.classList.contains('grid');
394400
const columns = [];
395401
let headerBeingResized = gridElement.querySelector('.column-header[col-index="' + column + '"]');
396402

@@ -400,17 +406,22 @@ export function resizeColumnExact(gridElement, column, width) {
400406

401407
grids.find(({ id }) => id === gridElement.id).columns.forEach(column => {
402408
if (column.header === headerBeingResized) {
403-
column.size = Math.max(minWidth, width) + 'px';
409+
column.size = Math.max(parseInt(column.header.style.minWidth), width) + 'px';
410+
column.header.style.width = column.size;
404411
}
405-
else {
412+
if (isGrid) {
413+
// for grid we need to recalculate all columns that are minmax
406414
if (column.size.startsWith('minmax')) {
407415
column.size = parseInt(column.header.clientWidth, 10) + 'px';
408416
}
417+
column.header.style.width = column.size;
418+
columns.push(column.size);
409419
}
410-
columns.push(column.size);
411420
});
412421

413-
gridElement.style.gridTemplateColumns = columns.join(' ');
422+
if (isGrid) {
423+
gridElement.style.gridTemplateColumns = columns.join(' ');
424+
}
414425

415426
gridElement.dispatchEvent(new CustomEvent('closecolumnresize', { bubbles: true }));
416427
gridElement.focus();
Binary file not shown.
Binary file not shown.

_content/Microsoft.FluentUI.AspNetCore.Components/Components/DesignSystemProvider/FluentDesignTheme.razor.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ export function addThemeChangeEvent(dotNetHelper, id) {
33

44
if (element) {
55
element.addEventListener("onchange", (e) => {
6-
UpdateBodyDataSetTheme(e.detail.newValue);
6+
if (e.detail.name === "mode") {
7+
UpdateBodyDataSetTheme(e.detail.newValue);
8+
}
79
try {
810
// setTimeout: https://github.com/dotnet/aspnetcore/issues/26809
911
setTimeout(() => {
@@ -28,7 +30,7 @@ export function addThemeChangeEvent(dotNetHelper, id) {
2830
ClearLocalStorage(id);
2931
console.error(`FluentDesignTheme: failing to load theme from localStorage.`, error);
3032
}
31-
33+
3234
}
3335

3436
return null;

0 commit comments

Comments
 (0)