From 9d9a818adbf54ac2e5b8b4969711622886e7c261 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Fri, 19 Jul 2024 16:44:33 +0200 Subject: [PATCH 1/6] Testing fix for #2356 --- ...crosoft.FluentUI.AspNetCore.Components.xml | 4 +-- .../Demo/Shared/Pages/Lab/CheckboxBug.razor | 23 ++++++++++++++++ examples/Demo/Shared/Pages/Lab/Dummy.cs | 7 +++++ .../Demo/Shared/Pages/Lab/IssueTester.razor | 14 ++++++++++ .../Components/Stack/FluentStack.razor.cs | 26 +++++++++++++++++-- 5 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 examples/Demo/Shared/Pages/Lab/CheckboxBug.razor create mode 100644 examples/Demo/Shared/Pages/Lab/Dummy.cs diff --git a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml index 0909ad64d5..8e88e0f1c0 100644 --- a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml +++ b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml @@ -8371,7 +8371,7 @@ - Gets or sets the horizontal alignment of the components in the stack. + Gets or sets the horizontal alignment of the components in the stack. @@ -8381,7 +8381,7 @@ - Gets or sets the orientation of the stacked components. + Gets or sets the orientation of the stacked components. diff --git a/examples/Demo/Shared/Pages/Lab/CheckboxBug.razor b/examples/Demo/Shared/Pages/Lab/CheckboxBug.razor new file mode 100644 index 0000000000..b82a91b87f --- /dev/null +++ b/examples/Demo/Shared/Pages/Lab/CheckboxBug.razor @@ -0,0 +1,23 @@ +@using Microsoft.FluentUI.AspNetCore.Components + + Checkbox + + + + + +@code { + + [Parameter, EditorRequired] + public required Dummy Value { get; set; } + + [Parameter] + public EventCallback ValueChanged { get; set; } + + private Task ChangeDummyAsync(Dummy dummy) + { + return ValueChanged.InvokeAsync(dummy); + } + +} diff --git a/examples/Demo/Shared/Pages/Lab/Dummy.cs b/examples/Demo/Shared/Pages/Lab/Dummy.cs new file mode 100644 index 0000000000..174517be83 --- /dev/null +++ b/examples/Demo/Shared/Pages/Lab/Dummy.cs @@ -0,0 +1,7 @@ +// ------------------------------------------------------------------------ +// MIT License - Copyright (c) Microsoft Corporation. All rights reserved. +// ------------------------------------------------------------------------ + + +namespace FluentUI.Demo.Shared.Pages.Lab; +public record Dummy(bool IsChecked); diff --git a/examples/Demo/Shared/Pages/Lab/IssueTester.razor b/examples/Demo/Shared/Pages/Lab/IssueTester.razor index 0e8d03c85c..c5f7f2eb43 100644 --- a/examples/Demo/Shared/Pages/Lab/IssueTester.razor +++ b/examples/Demo/Shared/Pages/Lab/IssueTester.razor @@ -1 +1,15 @@ @page "/issue-tester" + + + + + + + + +@code { + + private Dummy dummy = new Dummy(false); + + +} diff --git a/src/Core/Components/Stack/FluentStack.razor.cs b/src/Core/Components/Stack/FluentStack.razor.cs index 74ce1c7ecb..3f5c9c3680 100644 --- a/src/Core/Components/Stack/FluentStack.razor.cs +++ b/src/Core/Components/Stack/FluentStack.razor.cs @@ -5,6 +5,9 @@ namespace Microsoft.FluentUI.AspNetCore.Components; public partial class FluentStack : FluentComponentBase { + private RenderFragment? _cachedContent; + private bool _shouldRender; + protected string? ClassValue => new CssBuilder(Class) .AddClass("stack-horizontal", () => Orientation == Orientation.Horizontal) .AddClass("stack-vertical", () => Orientation == Orientation.Vertical) @@ -25,7 +28,7 @@ public partial class FluentStack : FluentComponentBase .Build(); /// - /// Gets or sets the horizontal alignment of the components in the stack. + /// Gets or sets the horizontal alignment of the components in the stack. /// [Parameter] public HorizontalAlignment HorizontalAlignment { get; set; } = HorizontalAlignment.Left; @@ -37,7 +40,7 @@ public partial class FluentStack : FluentComponentBase public VerticalAlignment VerticalAlignment { get; set; } = VerticalAlignment.Top; /// - /// Gets or sets the orientation of the stacked components. + /// Gets or sets the orientation of the stacked components. /// [Parameter] public Orientation Orientation { get; set; } = Orientation.Horizontal; @@ -74,6 +77,25 @@ public partial class FluentStack : FluentComponentBase [Parameter] public RenderFragment? ChildContent { get; set; } + protected override void OnParametersSet() + { + if (ChildContent != _cachedContent) + { + _cachedContent = ChildContent; + _shouldRender = true; + } + else + { + _shouldRender = false; + } + } + + + protected override bool ShouldRender() + { + return _shouldRender; + } + private string GetHorizontalAlignment() { return HorizontalAlignment switch From e5780741948cbdf3b444c939f3a152f6fbb6979f Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Fri, 19 Jul 2024 17:19:56 +0200 Subject: [PATCH 2/6] Change bool logic --- src/Core/Components/Stack/FluentStack.razor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Core/Components/Stack/FluentStack.razor.cs b/src/Core/Components/Stack/FluentStack.razor.cs index 3f5c9c3680..12ebf8258d 100644 --- a/src/Core/Components/Stack/FluentStack.razor.cs +++ b/src/Core/Components/Stack/FluentStack.razor.cs @@ -6,7 +6,7 @@ namespace Microsoft.FluentUI.AspNetCore.Components; public partial class FluentStack : FluentComponentBase { private RenderFragment? _cachedContent; - private bool _shouldRender; + private bool _shouldRender = true; protected string? ClassValue => new CssBuilder(Class) .AddClass("stack-horizontal", () => Orientation == Orientation.Horizontal) @@ -82,7 +82,6 @@ protected override void OnParametersSet() if (ChildContent != _cachedContent) { _cachedContent = ChildContent; - _shouldRender = true; } else { From 1497ccaacc99dc49dfe56e4a58d8e037df75243d Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Sun, 21 Jul 2024 22:44:36 +0200 Subject: [PATCH 3/6] Store --- .../Checkbox/FluentCheckbox.razor.cs | 2 +- .../Components/Stack/FluentStack.razor.cs | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Core/Components/Checkbox/FluentCheckbox.razor.cs b/src/Core/Components/Checkbox/FluentCheckbox.razor.cs index 0911e08b4b..f4f9d4f66d 100644 --- a/src/Core/Components/Checkbox/FluentCheckbox.razor.cs +++ b/src/Core/Components/Checkbox/FluentCheckbox.razor.cs @@ -211,7 +211,7 @@ private async Task OnCheckedChangeHandlerAsync(CheckboxChangeEventArgs e) else { await SetCurrentValueAsync(e.Checked ?? false); - await SetIntermediateAsync(false); + //await SetIntermediateAsync(false); await UpdateAndRaiseCheckStateEventAsync(e.Checked ?? false); } } diff --git a/src/Core/Components/Stack/FluentStack.razor.cs b/src/Core/Components/Stack/FluentStack.razor.cs index 12ebf8258d..5c4df9fbf4 100644 --- a/src/Core/Components/Stack/FluentStack.razor.cs +++ b/src/Core/Components/Stack/FluentStack.razor.cs @@ -77,17 +77,18 @@ public partial class FluentStack : FluentComponentBase [Parameter] public RenderFragment? ChildContent { get; set; } - protected override void OnParametersSet() - { - if (ChildContent != _cachedContent) - { - _cachedContent = ChildContent; - } - else - { - _shouldRender = false; - } - } + //protected override void OnParametersSet() + //{ + // if (ChildContent != _cachedContent) + // { + // _cachedContent = ChildContent; + // _shouldRender = true; + // } + // else + // { + // _shouldRender = false; + // } + //} protected override bool ShouldRender() From 52caf8c1d866998207961187ec9ab3e4c10f8f35 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Tue, 20 Aug 2024 15:25:31 +0200 Subject: [PATCH 4/6] Update JavaScript SDK Revert assert->with replacement Undo shouldRender trial --- examples/Demo/Shared/Pages/Lab/Dummy.cs | 1 - ...uentUI.AspNetCore.Components.Assets.esproj | 2 +- src/Core.Assets/esbuild.config.mjs | 2 +- src/Core.Assets/package-lock.json | 282 ++++++++++-------- src/Core.Assets/package.json | 2 +- .../Components/Stack/FluentStack.razor.cs | 22 -- 6 files changed, 165 insertions(+), 146 deletions(-) diff --git a/examples/Demo/Shared/Pages/Lab/Dummy.cs b/examples/Demo/Shared/Pages/Lab/Dummy.cs index 174517be83..25531e9fe0 100644 --- a/examples/Demo/Shared/Pages/Lab/Dummy.cs +++ b/examples/Demo/Shared/Pages/Lab/Dummy.cs @@ -2,6 +2,5 @@ // MIT License - Copyright (c) Microsoft Corporation. All rights reserved. // ------------------------------------------------------------------------ - namespace FluentUI.Demo.Shared.Pages.Lab; public record Dummy(bool IsChecked); diff --git a/src/Core.Assets/Microsoft.FluentUI.AspNetCore.Components.Assets.esproj b/src/Core.Assets/Microsoft.FluentUI.AspNetCore.Components.Assets.esproj index a1f5870d9a..22c6c82b2b 100644 --- a/src/Core.Assets/Microsoft.FluentUI.AspNetCore.Components.Assets.esproj +++ b/src/Core.Assets/Microsoft.FluentUI.AspNetCore.Components.Assets.esproj @@ -1,4 +1,4 @@ - + dist\ Microsoft.FluentUI.AspNetCore.Components diff --git a/src/Core.Assets/esbuild.config.mjs b/src/Core.Assets/esbuild.config.mjs index 759a9b8bd0..c9b0ba2531 100644 --- a/src/Core.Assets/esbuild.config.mjs +++ b/src/Core.Assets/esbuild.config.mjs @@ -1,5 +1,5 @@ import * as esbuild from 'esbuild' -import pkg from './package.json' with { type: 'json' } +import pkg from './package.json' assert { type: 'json' } await esbuild.build({ entryPoints: [ pkg.source ], diff --git a/src/Core.Assets/package-lock.json b/src/Core.Assets/package-lock.json index 85ea9a157e..6305a137b9 100644 --- a/src/Core.Assets/package-lock.json +++ b/src/Core.Assets/package-lock.json @@ -15,7 +15,7 @@ "@microsoft/fast-foundation": "2.49.6", "@typescript-eslint/eslint-plugin": "^7.6.0", "@typescript-eslint/parser": "^7.6.0", - "esbuild": "^0.20.2", + "esbuild": "0.23.1", "esbuild-plugin-inline-css": "^0.0.1", "eslint": "8.57.0", "rimraf": "^5.0.5", @@ -32,371 +32,411 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha1-USmTdN4XHb2Au32Djhz86a8281M=", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha1-XrjGUtTIKiQh4zlbgI5tnELIYu4=", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha1-WFZSkaH+VIY4rbnFhCN0SeXhQBg=", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha1-rhnWZdLwbw9IpqyaIks/Zy5l1Rc=", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha1-BbF/kah+VXtGipx16dhasQwSGxY=", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha1-xYNTuYL04E8NAiKEuLonM/X/CTE=", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha1-+SINxl+A8DY14e+Wz61dofRG87w=", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha1-ab2FEfoBO1nwIm0WCaxD985IlzA=", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha1-7Kq9HCO3AQcEhJkNuagvOC+Z53E=", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha1-gFCvbVHds4jHVlPvmHH1zNjxI4M=", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha1-PtInMhQXgQl0HAm9BocJigJDszM=", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha1-oP30QLVIXIGw+7MWsIkz0hf106w=", "cpu": [ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha1-4RooBjRtuDdbGPXhBMWp1OgYB/Y=", "cpu": [ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha1-BqJ0TF6vVisakJN4VbTWz3x17JY=", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha1-ZbRqKJL8DRr0ujQq8/4PpKj+COc=", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha1-5x6hjHDD9gTiQdFuTlqxk6l4XW8=", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha1-1H+XOR6AaQ1N/oEaLn1pJ62e7SQ=", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha1-ROdDyXeNV6is5LcvPGuDmjt0plM=", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha1-BcWh+vZ7mIGDR1jGnz5Rt97gFdc=", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha1-LliuURus9n0Z+fLc2ejFqT8AwnM=", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha1-rbAiuVnRjTOJrHB2nO9aA9Or1AM=", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha1-hJBvUMISty7DYPSEYdQyAvTIuaI=", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha1-Xj6sxRWCD/cp6Q0MtGMYMSjoL6w=", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha1-gf1Q0R4sMrLWJBRw4xhbcMezBpk=", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@eslint-community/eslint-utils": { @@ -1114,41 +1154,43 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.23.1", + "resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha1-QP3D+SZewL6ub1mCSt4b09PS2rg=", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" } }, "node_modules/esbuild-plugin-inline-css": { diff --git a/src/Core.Assets/package.json b/src/Core.Assets/package.json index 5e8b5654da..319e831e79 100644 --- a/src/Core.Assets/package.json +++ b/src/Core.Assets/package.json @@ -16,7 +16,7 @@ "@microsoft/fast-foundation": "2.49.6", "@typescript-eslint/eslint-plugin": "^7.6.0", "@typescript-eslint/parser": "^7.6.0", - "esbuild": "^0.20.2", + "esbuild": "0.23.1", "esbuild-plugin-inline-css": "^0.0.1", "eslint": "8.57.0", "rimraf": "^5.0.5", diff --git a/src/Core/Components/Stack/FluentStack.razor.cs b/src/Core/Components/Stack/FluentStack.razor.cs index 5c4df9fbf4..1d553e80ee 100644 --- a/src/Core/Components/Stack/FluentStack.razor.cs +++ b/src/Core/Components/Stack/FluentStack.razor.cs @@ -5,9 +5,6 @@ namespace Microsoft.FluentUI.AspNetCore.Components; public partial class FluentStack : FluentComponentBase { - private RenderFragment? _cachedContent; - private bool _shouldRender = true; - protected string? ClassValue => new CssBuilder(Class) .AddClass("stack-horizontal", () => Orientation == Orientation.Horizontal) .AddClass("stack-vertical", () => Orientation == Orientation.Vertical) @@ -77,25 +74,6 @@ public partial class FluentStack : FluentComponentBase [Parameter] public RenderFragment? ChildContent { get; set; } - //protected override void OnParametersSet() - //{ - // if (ChildContent != _cachedContent) - // { - // _cachedContent = ChildContent; - // _shouldRender = true; - // } - // else - // { - // _shouldRender = false; - // } - //} - - - protected override bool ShouldRender() - { - return _shouldRender; - } - private string GetHorizontalAlignment() { return HorizontalAlignment switch From caab663983822916e9a99a299887d5af878ff032 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Tue, 20 Aug 2024 16:18:40 +0200 Subject: [PATCH 5/6] Add short delay --- src/Core/Components/Checkbox/FluentCheckbox.razor.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Core/Components/Checkbox/FluentCheckbox.razor.cs b/src/Core/Components/Checkbox/FluentCheckbox.razor.cs index f4f9d4f66d..4bb61ffabb 100644 --- a/src/Core/Components/Checkbox/FluentCheckbox.razor.cs +++ b/src/Core/Components/Checkbox/FluentCheckbox.razor.cs @@ -199,6 +199,7 @@ private async Task SetCurrentCheckStateAsync(bool newChecked) /// private async Task OnCheckedChangeHandlerAsync(CheckboxChangeEventArgs e) { + await Task.Delay(1); if (e.Checked == null && e.Indeterminate == null) { return; From 5785edc48820194208f42053de5418e16470be9e Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Tue, 20 Aug 2024 20:04:13 +0200 Subject: [PATCH 6/6] Fix tests --- src/Core/Components/Checkbox/FluentCheckbox.razor.cs | 7 +++++-- tests/Core/Checkbox/FluentCheckboxThreeStatesTests.razor | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Core/Components/Checkbox/FluentCheckbox.razor.cs b/src/Core/Components/Checkbox/FluentCheckbox.razor.cs index 4bb61ffabb..1ed21d2391 100644 --- a/src/Core/Components/Checkbox/FluentCheckbox.razor.cs +++ b/src/Core/Components/Checkbox/FluentCheckbox.razor.cs @@ -199,7 +199,10 @@ private async Task SetCurrentCheckStateAsync(bool newChecked) /// private async Task OnCheckedChangeHandlerAsync(CheckboxChangeEventArgs e) { - await Task.Delay(1); + if (!ThreeState) + { + await Task.Delay(1); + } if (e.Checked == null && e.Indeterminate == null) { return; @@ -212,7 +215,7 @@ private async Task OnCheckedChangeHandlerAsync(CheckboxChangeEventArgs e) else { await SetCurrentValueAsync(e.Checked ?? false); - //await SetIntermediateAsync(false); + await SetIntermediateAsync(false); await UpdateAndRaiseCheckStateEventAsync(e.Checked ?? false); } } diff --git a/tests/Core/Checkbox/FluentCheckboxThreeStatesTests.razor b/tests/Core/Checkbox/FluentCheckboxThreeStatesTests.razor index e59058f3fa..a01977586d 100644 --- a/tests/Core/Checkbox/FluentCheckboxThreeStatesTests.razor +++ b/tests/Core/Checkbox/FluentCheckboxThreeStatesTests.razor @@ -26,6 +26,7 @@ var component = cut.Find("fluent-checkbox"); component.TriggerEvent("oncheckedchange", new CheckboxChangeEventArgs() { Checked = !myValue }); + // Assert Assert.Equal(assertState, myState); Assert.Equal(assertValue, myValue); @@ -84,7 +85,7 @@ [Theory] [InlineData(true, false)] // Unchecked => Checked [InlineData(false, true)] // Checked => Unchecked - public void FluentCheckbox_ThreeStatesFalse(bool initialValue, bool assertValue) + public async Task FluentCheckbox_ThreeStatesFalseAsync(bool initialValue, bool assertValue) { bool myValue = initialValue; @@ -92,11 +93,14 @@ var cut = Render(@ - ); + ); + var component = cut.Find("fluent-checkbox"); component.TriggerEvent("oncheckedchange", new CheckboxChangeEventArgs() { Checked = !myValue }); + await Task.Delay(1); + // Assert Assert.Equal(assertValue, myValue); }