Skip to content

Commit f2a4dd2

Browse files
Merge pull request #94 from Community-Toolkit-for-Fluent-UI-Blazor/fluentcx-observers
Add an observer provider
2 parents 5dfcd4a + a247044 commit f2a4dd2

39 files changed

Lines changed: 2813 additions & 412 deletions

FluentUI.Blazor.Community.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3+
34
# Visual Studio Version 18
45
VisualStudioVersion = 18.0.11018.127
6+
57
MinimumVisualStudioVersion = 10.0.40219.1
68
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
79
EndProject

examples/demo/FluentUI.Demo.Shared/FluentUI.Blazor.Community.Components.xml

Lines changed: 964 additions & 65 deletions
Large diffs are not rendered by default.

examples/demo/FluentUI.Demo.Shared/Layout/DemoMainLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<FluentDialogProvider />
3939
<FluentToastProvider />
4040
<FluentCxLottieProvider />
41-
<FluentCxObserversProvider />
41+
<FluentCxObserverProvider />
4242

4343
<FluentTooltipProvider />
4444
</FluentLayout>

src/Community.Components/Components/ColorPalette/FluentCxColorPalette.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,9 @@ private async Task OnGridKeyDownAsync(FluentKeyCodeEventArgs e)
628628
return;
629629
}
630630

631-
next = (next + _colors.Count) % _colors.Count;
631+
next = (_focusIndex + _colors.Count) % _colors.Count;
632632

633-
await SetFocusAsync(next);
633+
await SetFocusAsync(_focusIndex);
634634
}
635635

636636
/// <summary>

src/Community.Components/Components/Lottie/FluentCxLottiePlayer.razor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function dispose(id) {
8585
}
8686

8787
export const fluentcxLottiePlayer = {
88-
load: (id, path, loop, autoplay, speed, renderer) => load(id, path, loop, autoplay, speed, renderer),
88+
load: (id, dotnetRef, path, loop, autoplay, speed, renderer) => load(id, dotnetRef, path, loop, autoplay, speed, renderer),
8989
play: (id) => play(id),
9090
pause: (id) => pause(id),
9191
stop: (id) => stop(id),

src/Community.Components/Components/Lottie/FluentCxLottieProvider.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@implements IAsyncDisposable
33

44
<HeadContent>
5-
<script src="https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.12.0/lottie.min.js"></script>
5+
<script src="https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.13.0/lottie.min.js"></script>
66
</HeadContent>
77

88
@code {
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
namespace FluentUI.Blazor.Community.Components;
2+
3+
/// <summary>
4+
/// Represents the dimensions and position of a rectangle, typically used to describe the bounding box of an element in
5+
/// a coordinate space.
6+
/// </summary>
7+
/// <remarks>The rectangle is defined by its top, left, bottom, and right edges, as well as its width and height.
8+
/// All values are expressed in the same coordinate system, and may be fractional. This type is commonly used in
9+
/// scenarios such as layout calculations, collision detection, or graphical rendering.</remarks>
10+
public record DomRect
11+
{
12+
/// <summary>
13+
/// Gets the top coordinate value.
14+
/// </summary>
15+
public double Top { get; init; }
16+
17+
/// <summary>
18+
/// Gets the left coordinate value.
19+
/// </summary>
20+
public double Left { get; init; }
21+
22+
/// <summary>
23+
/// Gets the bottom coordinate value.
24+
/// </summary>
25+
public double Bottom { get; init; }
26+
27+
/// <summary>
28+
/// Gets the right coordinate value.
29+
/// </summary>
30+
public double Right { get; init; }
31+
32+
/// <summary>
33+
/// Gets the width of the element.
34+
/// </summary>
35+
public double Width { get; init; }
36+
37+
/// <summary>
38+
/// Gets the height of the element.
39+
/// </summary>
40+
public double Height { get; init; }
41+
}

src/Community.Components/Components/Observers/FluentCxObserversProvider.razor renamed to src/Community.Components/Components/Observers/FluentCxObserverProvider.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
@namespace FluentUI.Blazor.Community.Components
22
@inherits FluentComponentBase
3-
4-
<span />

0 commit comments

Comments
 (0)