diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 266b7cbb20..a9b05a187f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,7 +14,7 @@ }, "ghcr.io/devcontainers/features/node:1": { "version": "24" } }, - "image": "mcr.microsoft.com/dotnet/nightly/sdk:10.0.102", + "image": "mcr.microsoft.com/dotnet/sdk:10.0.201", "postStartCommand": "dotnet workload install wasm-tools && dotnet dev-certs https --trust", "waitFor": "onCreateCommand", "customizations": { diff --git a/.github/workflows/admin-sample.cd.yml b/.github/workflows/admin-sample.cd.yml index f400d527b2..b4e696aa3a 100644 --- a/.github/workflows/admin-sample.cd.yml +++ b/.github/workflows/admin-sample.cd.yml @@ -82,14 +82,14 @@ jobs: run: dotnet publish AdminPanel/src/Server/AdminPanel.Server.Api/AdminPanel.Server.Api.csproj -c Release -o server-api -p:Version="${{ vars.APP_VERSION}}" - name: Upload server web artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: AdminPanel path: server-web include-hidden-files: true # Required for wwwroot/.well-known folder - name: Upload server api artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: AdminPanelApi path: server-api @@ -197,7 +197,7 @@ jobs: dotnet vpk pack -u AdminPanel.Client.Windows -v "${{ vars.APP_VERSION }}" -p .\publish-result -e AdminPanel.Client.Windows.exe -r win-x64 --framework webview2 --icon .\wwwroot\favicon.ico --packTitle 'AdminPanel' - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: WinAdminPanel path: AdminPanel\src\Client\AdminPanel.Client.Windows\Releases @@ -272,7 +272,7 @@ jobs: run: dotnet publish AdminPanel/src/Client/AdminPanel.Client.Maui/AdminPanel.Client.Maui.csproj -c Release -p:EnableLLVM=true -p:AndroidEnableProfiledAot=false -p:AndroidPackageFormat=aab -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="AdminPanel.keystore" -p:AndroidSigningKeyAlias=bitplatform -p:AndroidSigningKeyPass="${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}" -p:AndroidSigningStorePass="${{ secrets.ANDROID_RELEASE_SIGNING_PASSWORD }}" -p:Version="${{ vars.APP_VERSION }}" -p:ApplicationTitle="AdminPanel" -p:ApplicationId="com.bitplatform.AdminPanel.Template" -f net10.0-android - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: android-bundle path: AdminPanel/src/Client/AdminPanel.Client.Maui/bin/Release/net10.0-android/*-Signed.* @@ -291,7 +291,7 @@ jobs: with: global-json-file: src/global.json - - uses: maxim-lobanov/setup-xcode@v1.6.0 + - uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '26.2' @@ -348,7 +348,7 @@ jobs: run: dotnet publish AdminPanel/src/Client/AdminPanel.Client.Maui/AdminPanel.Client.Maui.csproj -p:RuntimeIdentifier=ios-arm64 -c Release -p:ArchiveOnBuild=true -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="AdminPanel" -p:Version="${{ vars.APP_VERSION }}" -p:ApplicationTitle="AdminPanel" -p:ApplicationId="com.bitplatform.AdminPanel.Template" -f net10.0-ios - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: ios-bundle path: AdminPanel/src/Client/AdminPanel.Client.Maui/bin/release/net10.0-ios/ios-arm64/publish/*.ipa diff --git a/.github/workflows/bit.ci.release.yml b/.github/workflows/bit.ci.release.yml index 602331f849..f56f9c341c 100644 --- a/.github/workflows/bit.ci.release.yml +++ b/.github/workflows/bit.ci.release.yml @@ -43,7 +43,7 @@ jobs: - name: InstallNodejsDependencies continue-on-error: true # Error MSB4057, not all csproj files have InstallNodejsDependencies target. - run: dotnet build src/bit.ci.release.slnx -t:InstallNodejsDependencies -m:1 -f net10.0 + run: dotnet build src/Bit.CI.Release.slnx -t:InstallNodejsDependencies -m:1 -f net10.0 - name: dotnet build - run: dotnet build src/bit.ci.release.slnx -c Release + run: dotnet build src/Bit.CI.Release.slnx -c Release diff --git a/.github/workflows/bit.full.ci.yml b/.github/workflows/bit.full.ci.yml index 83d49a7845..55381e0f9b 100644 --- a/.github/workflows/bit.full.ci.yml +++ b/.github/workflows/bit.full.ci.yml @@ -98,7 +98,7 @@ jobs: WebAppRender__BlazorMode=BlazorWebAssembly WebAppRender__PrerenderEnabled=true ResponseCaching__EnableOutputCaching=true dotnet test -p:InvariantGlobalization=true --filter "TestCategory=UITest" - name: Upload Test Results on Failure - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 if: failure() && steps.run-test-postgresql.conclusion == 'failure' with: name: postgres-tests-artifact @@ -170,7 +170,7 @@ jobs: WebAppRender__BlazorMode=BlazorWebAssembly WebAppRender__PrerenderEnabled=true ResponseCaching__EnableOutputCaching=true BROWSER=firefox dotnet test --filter "TestCategory=UITest" --no-build - name: Upload Test Results on Failure - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 if: failure() && steps.run-test-mssql.conclusion == 'failure' with: name: sqlserver-tests-artifact @@ -412,7 +412,7 @@ jobs: run: dotnet pack src/Templates/BlazorEmpty/Bit.BlazorEmpty.ProjectTemplate.csproj --output ./packages --configuration Release - name: Upload NuGet packages artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: nuget-packages path: ./packages/*.nupkg diff --git a/.github/workflows/blazorui.demo.cd.yml b/.github/workflows/blazorui.demo.cd.yml index bdef14165a..315dae8e55 100644 --- a/.github/workflows/blazorui.demo.cd.yml +++ b/.github/workflows/blazorui.demo.cd.yml @@ -50,7 +50,7 @@ jobs: run: dotnet publish src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Bit.BlazorUI.Demo.Server.csproj -c Release -p:Version="${{ vars.APP_VERSION}}" -o server - name: Upload server artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: BlazorUIDemo path: server @@ -93,7 +93,7 @@ jobs: dotnet vpk pack -u Bit.BlazorUI.Demo.Client.Windows -v "${{ vars.APP_VERSION }}" -p .\publish-result -e Bit.BlazorUI.Demo.Client.Windows.exe -r win-x86 --framework webview2 --icon .\wwwroot\favicon.ico --packTitle 'Bit Blazor UI' - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: WinBlazorUIDemo path: src\BlazorUI\Demo\Client\Bit.BlazorUI.Demo.Client.Windows\Releases @@ -143,7 +143,7 @@ jobs: run: dotnet publish src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj -c Release -p:AndroidPackageFormat=aab -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="BitBlazorUIDemo.keystore" -p:AndroidSigningKeyAlias=bitplatform -p:AndroidSigningKeyPass="${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}" -p:AndroidSigningStorePass="${{ secrets.ANDROID_RELEASE_SIGNING_PASSWORD }}" -p:Version="${{ vars.APP_VERSION }}" -p:CompressionEnabled=false -f net10.0-android - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: android-bundle path: src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/bin/Release/net10.0-android/*-Signed.* @@ -162,7 +162,7 @@ jobs: with: global-json-file: src/global.json - - uses: maxim-lobanov/setup-xcode@v1.6.0 + - uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '26.2' @@ -201,7 +201,7 @@ jobs: run: dotnet publish src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj -p:RuntimeIdentifier=ios-arm64 -c Release -p:ArchiveOnBuild=true -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="Bit Blazor UI Demo" -p:Version="${{ vars.APP_VERSION }}" -p:CompressionEnabled=false -f net10.0-ios - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: ios-bundle path: src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/bin/release/net10.0-ios/ios-arm64/publish/*.ipa \ No newline at end of file diff --git a/.github/workflows/nuget.org.yml b/.github/workflows/nuget.org.yml index 6f3f85e5bb..63cffa858f 100644 --- a/.github/workflows/nuget.org.yml +++ b/.github/workflows/nuget.org.yml @@ -149,7 +149,7 @@ jobs: run: dotnet pack src/Templates/BlazorEmpty/Bit.BlazorEmpty.ProjectTemplate.csproj --output . --configuration Release - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: nupkg-files path: ./*.nupkg diff --git a/.github/workflows/platform.website.cd.yml b/.github/workflows/platform.website.cd.yml index e4505dd254..ed2a00e569 100644 --- a/.github/workflows/platform.website.cd.yml +++ b/.github/workflows/platform.website.cd.yml @@ -35,7 +35,7 @@ jobs: run: dotnet publish src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj -c Release -o server -p:Version="${{ vars.APP_VERSION}}" - name: Upload server artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: PlatformWebsite path: server diff --git a/.github/workflows/prerelease.nuget.org.yml b/.github/workflows/prerelease.nuget.org.yml index 73ba87b96b..6311f0a8d9 100644 --- a/.github/workflows/prerelease.nuget.org.yml +++ b/.github/workflows/prerelease.nuget.org.yml @@ -140,7 +140,7 @@ jobs: run: dotnet pack src/Templates/BlazorEmpty/Bit.BlazorEmpty.ProjectTemplate.csproj --output . --configuration Release - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: nupkg-files path: ./*.nupkg diff --git a/.github/workflows/sales-module-demo.cd.yml b/.github/workflows/sales-module-demo.cd.yml index 72bb4e3251..67b42ea97c 100644 --- a/.github/workflows/sales-module-demo.cd.yml +++ b/.github/workflows/sales-module-demo.cd.yml @@ -76,7 +76,7 @@ jobs: run: dotnet publish SalesModule/src/Server/SalesModule.Server.Web/SalesModule.Server.Web.csproj -c Release -o server -p:Version="${{ vars.APP_VERSION}}" -p:InvariantGlobalization=true - name: Upload server artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: SalesModule path: server @@ -135,7 +135,7 @@ jobs: dotnet vpk pack -u SalesModule.Client.Windows -v "${{ vars.APP_VERSION }}" -p .\publish-result -e SalesModule.Client.Windows.exe -r win-x64 --framework webview2 --icon .\wwwroot\favicon.ico --packTitle 'SalesModule' - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: WinSalesModule path: SalesModule\src\Client\SalesModule.Client.Windows\Releases \ No newline at end of file diff --git a/.github/workflows/sales.website.cd.yml b/.github/workflows/sales.website.cd.yml index 9fe18dc909..a139481c28 100644 --- a/.github/workflows/sales.website.cd.yml +++ b/.github/workflows/sales.website.cd.yml @@ -35,7 +35,7 @@ jobs: run: dotnet publish src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj -c Release -o server -p:Version="${{ vars.APP_VERSION}}" - name: Upload server artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: BitServices path: server diff --git a/.github/workflows/todo-sample.cd.yml b/.github/workflows/todo-sample.cd.yml index b4a57ec2e5..e4efec7f35 100644 --- a/.github/workflows/todo-sample.cd.yml +++ b/.github/workflows/todo-sample.cd.yml @@ -65,7 +65,7 @@ jobs: run: dotnet publish TodoSample/src/Server/TodoSample.Server.Api/TodoSample.Server.Api.csproj -c Release -o server-api -p:Version="${{ vars.APP_VERSION}}" - name: Upload server api artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: TodoApi path: server-api @@ -130,7 +130,7 @@ jobs: run: dotnet publish TodoSample/src/Server/TodoSample.Server.Web/TodoSample.Server.Web.csproj -c Release -o server-web -p:Version="${{ vars.APP_VERSION}}" - name: Upload server web artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: Todo path: server-web @@ -338,7 +338,7 @@ jobs: dotnet vpk pack -u TodoSample.Client.Windows -v "${{ vars.APP_VERSION }}" -p .\publish-result -e TodoSample.Client.Windows.exe -r win-x86 --framework webview2 --icon .\wwwroot\favicon.ico --packTitle TodoSample - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: WinTodo path: TodoSample\src\Client\TodoSample.Client.Windows\Releases @@ -433,7 +433,7 @@ jobs: run: dotnet publish TodoSample/src/Client/TodoSample.Client.Maui/TodoSample.Client.Maui.csproj -c Release -p:AndroidPackageFormat=aab -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="TodoSample.keystore" -p:AndroidSigningKeyAlias=bitplatform -p:AndroidSigningKeyPass="${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}" -p:AndroidSigningStorePass="${{ secrets.ANDROID_RELEASE_SIGNING_PASSWORD }}" -p:Version="${{ vars.APP_VERSION }}" -p:ApplicationTitle="TodoSample" -p:ApplicationId="com.bitplatform.Todo.Template" -f net10.0-android - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: android-bundle path: TodoSample/src/Client/TodoSample.Client.Maui/bin/Release/net10.0-android/*-Signed.* @@ -456,7 +456,7 @@ jobs: with: node-version: 24 - - uses: maxim-lobanov/setup-xcode@v1.6.0 + - uses: maxim-lobanov/setup-xcode@v1.7.0 with: xcode-version: '26.2' @@ -529,7 +529,7 @@ jobs: run: dotnet publish TodoSample/src/Client/TodoSample.Client.Maui/TodoSample.Client.Maui.csproj -p:RuntimeIdentifier=ios-arm64 -c Release -p:ArchiveOnBuild=true -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="TodoTemplate" -p:Version="${{ vars.APP_VERSION }}" -p:ApplicationTitle="Todo" -p:ApplicationId="com.bitplatform.Todo.Template" -f net10.0-ios - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: ios-bundle path: TodoSample/src/Client/TodoSample.Client.Maui/bin/release/net10.0-ios/ios-arm64/publish/*.ipa diff --git a/src/Besql/Bit.Besql/wwwroot/bit-besql.js b/src/Besql/Bit.Besql/wwwroot/bit-besql.js index 4bcc3d7bc6..5209c41bac 100644 --- a/src/Besql/Bit.Besql/wwwroot/bit-besql.js +++ b/src/Besql/Bit.Besql/wwwroot/bit-besql.js @@ -1,5 +1,5 @@ var BitBesql = window.BitBesql || {}; -BitBesql.version = window['bit-besql version'] = '10.4.2'; +BitBesql.version = window['bit-besql version'] = '10.4.3'; BitBesql.persist = async function besqlPersist(fileName) { diff --git a/src/Besql/Demo/Bit.Besql.Demo.Client/Bit.Besql.Demo.Client.csproj b/src/Besql/Demo/Bit.Besql.Demo.Client/Bit.Besql.Demo.Client.csproj index 3aa2fcaeab..396f0b5636 100644 --- a/src/Besql/Demo/Bit.Besql.Demo.Client/Bit.Besql.Demo.Client.csproj +++ b/src/Besql/Demo/Bit.Besql.Demo.Client/Bit.Besql.Demo.Client.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/Besql/Demo/Bit.Besql.Demo/Bit.Besql.Demo.csproj b/src/Besql/Demo/Bit.Besql.Demo/Bit.Besql.Demo.csproj index 5036530f2d..3a3523cfa1 100644 --- a/src/Besql/Demo/Bit.Besql.Demo/Bit.Besql.Demo.csproj +++ b/src/Besql/Demo/Bit.Besql.Demo/Bit.Besql.Demo.csproj @@ -8,7 +8,7 @@ - + @@ -17,11 +17,11 @@ and open Nuget Package Manager Console, and select `Bit.Besql.Demo.Client` project as default project Then run either Add-Migration MigrationName -OutputDir Data\Migrations or Optimize-DbContext -OutputDir Data\CompiledModel commands. --> - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Bit.Build.props b/src/Bit.Build.props index 1a06617a3b..6c291d5ab1 100644 --- a/src/Bit.Build.props +++ b/src/Bit.Build.props @@ -27,7 +27,7 @@ https://github.com/bitfoundation/bitplatform - 10.4.2 + 10.4.3 $(ReleaseVersion) https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion) $([System.String]::Copy($(ReleaseVersion)).Replace('-pre-', '.')) diff --git a/src/bit.ci.release.slnx b/src/Bit.CI.Release.slnx similarity index 100% rename from src/bit.ci.release.slnx rename to src/Bit.CI.Release.slnx diff --git a/src/BlazorES2019/Bit.BlazorES2019/buildTransitive/Bit.BlazorES2019.targets b/src/BlazorES2019/Bit.BlazorES2019/buildTransitive/Bit.BlazorES2019.targets index a5f4c51749..583f0f413a 100644 --- a/src/BlazorES2019/Bit.BlazorES2019/buildTransitive/Bit.BlazorES2019.targets +++ b/src/BlazorES2019/Bit.BlazorES2019/buildTransitive/Bit.BlazorES2019.targets @@ -1,13 +1,13 @@ - - + + PreserveNewest PreserveNewest wwwroot\_framework\%(Filename)%(Extension) - - + + PreserveNewest PreserveNewest wwwroot\_framework\%(Filename)%(Extension) diff --git a/src/BlazorUI/Bit.BlazorUI.Assets/package-lock.json b/src/BlazorUI/Bit.BlazorUI.Assets/package-lock.json index 5ade51c860..fc7beb7080 100644 --- a/src/BlazorUI/Bit.BlazorUI.Assets/package-lock.json +++ b/src/BlazorUI/Bit.BlazorUI.Assets/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "devDependencies": { - "sass": "1.97.3" + "sass": "1.98.0" } }, "node_modules/@parcel/watcher": { @@ -354,9 +354,9 @@ } }, "node_modules/immutable": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.0.3.tgz", - "integrity": "sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.5.tgz", + "integrity": "sha512-t7xcm2siw+hlUM68I+UEOK+z84RzmN59as9DZ7P1l0994DKUWV7UXBMQZVxaoMSRQ+PBZbHCOoBt7a2wxOMt+A==", "dev": true, "license": "MIT" }, @@ -448,14 +448,14 @@ } }, "node_modules/sass": { - "version": "1.97.3", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.97.3.tgz", - "integrity": "sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==", + "version": "1.98.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.98.0.tgz", + "integrity": "sha512-+4N/u9dZ4PrgzGgPlKnaaRQx64RO0JBKs9sDhQ2pLgN6JQZ25uPQZKQYaBJU48Kd5BxgXoJ4e09Dq7nMcOUW3A==", "dev": true, "license": "MIT", "dependencies": { "chokidar": "^4.0.0", - "immutable": "^5.0.2", + "immutable": "^5.1.5", "source-map-js": ">=0.6.2 <2.0.0" }, "bin": { diff --git a/src/BlazorUI/Bit.BlazorUI.Assets/package.json b/src/BlazorUI/Bit.BlazorUI.Assets/package.json index e14395e62d..20580eb644 100644 --- a/src/BlazorUI/Bit.BlazorUI.Assets/package.json +++ b/src/BlazorUI/Bit.BlazorUI.Assets/package.json @@ -1,5 +1,5 @@ { "devDependencies": { - "sass": "1.97.3" + "sass": "1.98.0" } } diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Bit.BlazorUI.Extras.csproj b/src/BlazorUI/Bit.BlazorUI.Extras/Bit.BlazorUI.Extras.csproj index effcab97e6..c61cb73f6b 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Bit.BlazorUI.Extras.csproj +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Bit.BlazorUI.Extras.csproj @@ -25,7 +25,7 @@ - + diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewer.razor.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewer.razor.cs index c8e7f48f51..3cea62fb85 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewer.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewer.razor.cs @@ -17,12 +17,35 @@ public partial class BitMarkdownViewer : BitComponentBase + /// + /// The fully qualified JavaScript function identifier to invoke as JavaScript middleware after parsing. + /// The string should reference a global JS function (e.g. "myApp.sanitizeHtml") that accepts + /// an HTML string and returns the processed HTML string. + /// JavaScript middleware is skipped during server-side prerendering. + /// + [Parameter, CallOnSet(nameof(OnMarkdownOrMiddlewareSet))] + public string? JsMiddlewareIdentifier { get; set; } + /// /// The Markdown string value to render as an html element. /// - [Parameter, CallOnSet(nameof(OnMarkdownSet))] + [Parameter, CallOnSet(nameof(OnMarkdownOrMiddlewareSet))] public string? Markdown { get; set; } + /// + /// The C# function to run after parsing markdown and before rendering HTML. + /// The middleware receives the parsed HTML string and returns the processed HTML string. + /// C# middleware is applied after JavaScript middleware. + /// + [Parameter, CallOnSet(nameof(OnMarkdownOrMiddlewareSet))] + public Func>? Middleware { get; set; } + + /// + /// Disables parse and render of the markdown content in the prerendering phase. + /// + [Parameter] + public bool NoPrerender { get; set; } + /// /// A callback that is called before starting to parse the markdown. /// @@ -63,7 +86,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) - private void OnMarkdownSet() + private void OnMarkdownOrMiddlewareSet() { if (IsRendered is false) return; @@ -76,7 +99,7 @@ private async Task ParseAndRender() try { - _html = await _markdownService.Parse(Markdown, _cts.Token); + _html = await _markdownService.Parse(Markdown, JsMiddlewareIdentifier, Middleware, NoPrerender, _cts.Token); } catch { diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewer.ts b/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewer.ts index 54a0c7eae3..1249277d6e 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewer.ts +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewer.ts @@ -5,12 +5,22 @@ namespace BitBlazorUI { } public static parse(md: string) { - const html = marked.parse(md, { async: false }); + let html = marked.parse(md, { async: false }); + return html; } - public static async parseAsync(md: string) { - const html = await marked.parse(md, { async: true }); + public static async parseAsync(md: string, middleware?: string) { + let html = await marked.parse(md, { async: true }); + + if (middleware) { + try { + html = await Extras.invokeJs(middleware, html); + } catch (err) { + console.error(err); + } + } + return html; } } diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewerJsRuntimeExtensions.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewerJsRuntimeExtensions.cs index 6d7a1ca506..1a6accf590 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewerJsRuntimeExtensions.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/MarkdownViewer/BitMarkdownViewerJsRuntimeExtensions.cs @@ -7,10 +7,10 @@ public static ValueTask BitMarkdownViewerCheckScriptLoaded(this IJSRuntime return jsRuntime.FastInvoke("BitBlazorUI.MarkdownViewer.checkScriptLoaded", script); } - public static ValueTask BitMarkdownViewerParse(this IJSRuntime jsRuntime, string markdown) + public static ValueTask BitMarkdownViewerParse(this IJSRuntime jsRuntime, string markdown, string? middleware) { - return OperatingSystem.IsBrowser() + return OperatingSystem.IsBrowser() && middleware.HasNoValue() ? jsRuntime.FastInvoke("BitBlazorUI.MarkdownViewer.parse", markdown) - : jsRuntime.Invoke("BitBlazorUI.MarkdownViewer.parseAsync", markdown); + : jsRuntime.Invoke("BitBlazorUI.MarkdownViewer.parseAsync", markdown, middleware); } } diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Scripts/Extras.ts b/src/BlazorUI/Bit.BlazorUI.Extras/Scripts/Extras.ts index 0a5457f3bc..55601f6233 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Scripts/Extras.ts +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Scripts/Extras.ts @@ -92,5 +92,38 @@ namespace BitBlazorUI { }) } } + + + public static invokeJs(identifier: string, ...args: unknown[]): Promise { + identifier ??= ''; + identifier = identifier.trim(); + + if (!identifier || identifier.length === 0) { + throw new Error("Identifier must not be empty."); + } + + const parts = identifier.split("."); + + let target = globalThis as unknown; + + const startIndex = parts[0] === "window" ? 1 : 0; + + for (let i = startIndex; i < parts.length - 1; i++) { + const part = parts[i]; + if (target == null || typeof target !== "object") { + throw new Error(`Cannot read property '${part}' of ${target}`); + } + target = (target as Record)[part]; + } + + const fnName = parts[parts.length - 1]; + const fn = (target as Record)[fnName]; + + if (typeof fn !== "function") { + throw new Error(`'${identifier}' is not a function.`); + } + + return Promise.resolve(fn.apply(target, args) as T); + } } } \ No newline at end of file diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Services/BitMarkdownService.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Services/BitMarkdownService.cs index 43e73710ae..a75f432931 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Services/BitMarkdownService.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Services/BitMarkdownService.cs @@ -18,7 +18,36 @@ public class BitMarkdownService(IJSRuntime js, IServiceProvider serviceProvider) - public async Task Parse(string? markdown, CancellationToken cancellationToken) + /// + /// Parses the given markdown string into an HTML string. + /// + /// The markdown string to parse. + /// A token to cancel the operation. + public Task Parse(string? markdown, CancellationToken cancellationToken) + { + return Parse(markdown, null, null, false, cancellationToken); + } + + /// + /// Parses the given markdown string into an HTML string, then applies JavaScript and C# middlewares in order. + /// JavaScript middleware is invoked via JS interop and is skipped during server-side prerendering. + /// C# middleware is applied to the generated HTML when rendering occurs, + /// but is not invoked when prerendering is skipped via . + /// + /// The markdown string to parse. + /// Optional JavaScript middleware identifier (fully qualified JS function path) to invoke via JS interop after parsing. + /// Optional C# middleware to apply after the JavaScript middleware. + /// + /// When , parsing and JavaScript middleware execution are skipped during server-side prerendering, + /// and C# middleware will not be invoked on that prerendering pass. + /// + /// A token to cancel the operation. + public async Task Parse( + string? markdown, + string? jsMiddleware, + Func>? csMiddleware, + bool noPrerender, + CancellationToken cancellationToken) { if (markdown.HasNoValue()) return string.Empty; @@ -26,9 +55,13 @@ public async Task Parse(string? markdown, CancellationToken cancellation if (js.IsRuntimeInvalid()) // server (prerendering) { + if (noPrerender) return string.Empty; + try { html = await Task.Run(async () => await RunJint(markdown, cancellationToken), cancellationToken); + + // js middlewares can't be executed on the server (for now)! } catch (FileNotFoundException ex) when (ex.FileName?.StartsWith("Jint") is true) { @@ -38,6 +71,7 @@ public async Task Parse(string? markdown, CancellationToken cancellation { Console.Error.WriteLine(ex.Message); } + } else // client { @@ -46,7 +80,19 @@ public async Task Parse(string? markdown, CancellationToken cancellation await js.BitExtrasInitScripts([MARKED_FILE]); } - html = await js.BitMarkdownViewerParse(markdown!); + html = await js.BitMarkdownViewerParse(markdown!, jsMiddleware); + } + + if (csMiddleware is not null) + { + try + { + html = await csMiddleware(html); + } + catch (Exception ex) + { + Console.Error.WriteLine(ex.Message); + } } return html; diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/package-lock.json b/src/BlazorUI/Bit.BlazorUI.Extras/package-lock.json index 6508d3a5d0..fd006347ba 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/package-lock.json +++ b/src/BlazorUI/Bit.BlazorUI.Extras/package-lock.json @@ -5,15 +5,15 @@ "packages": { "": { "devDependencies": { - "esbuild": "0.27.3", - "sass": "1.97.3", + "esbuild": "0.27.4", + "sass": "1.98.0", "typescript": "5.9.3" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", - "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.4.tgz", + "integrity": "sha512-cQPwL2mp2nSmHHJlCyoXgHGhbEPMrEEU5xhkcy3Hs/O7nGZqEpZ2sUtLaL9MORLtDfRvVl2/3PAuEkYZH0Ty8Q==", "cpu": [ "ppc64" ], @@ -28,9 +28,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", - "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.4.tgz", + "integrity": "sha512-X9bUgvxiC8CHAGKYufLIHGXPJWnr0OCdR0anD2e21vdvgCI8lIfqFbnoeOz7lBjdrAGUhqLZLcQo6MLhTO2DKQ==", "cpu": [ "arm" ], @@ -45,9 +45,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", - "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.4.tgz", + "integrity": "sha512-gdLscB7v75wRfu7QSm/zg6Rx29VLdy9eTr2t44sfTW7CxwAtQghZ4ZnqHk3/ogz7xao0QAgrkradbBzcqFPasw==", "cpu": [ "arm64" ], @@ -62,9 +62,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", - "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.4.tgz", + "integrity": "sha512-PzPFnBNVF292sfpfhiyiXCGSn9HZg5BcAz+ivBuSsl6Rk4ga1oEXAamhOXRFyMcjwr2DVtm40G65N3GLeH1Lvw==", "cpu": [ "x64" ], @@ -79,9 +79,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", - "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.4.tgz", + "integrity": "sha512-b7xaGIwdJlht8ZFCvMkpDN6uiSmnxxK56N2GDTMYPr2/gzvfdQN8rTfBsvVKmIVY/X7EM+/hJKEIbbHs9oA4tQ==", "cpu": [ "arm64" ], @@ -96,9 +96,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", - "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.4.tgz", + "integrity": "sha512-sR+OiKLwd15nmCdqpXMnuJ9W2kpy0KigzqScqHI3Hqwr7IXxBp3Yva+yJwoqh7rE8V77tdoheRYataNKL4QrPw==", "cpu": [ "x64" ], @@ -113,9 +113,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", - "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.4.tgz", + "integrity": "sha512-jnfpKe+p79tCnm4GVav68A7tUFeKQwQyLgESwEAUzyxk/TJr4QdGog9sqWNcUbr/bZt/O/HXouspuQDd9JxFSw==", "cpu": [ "arm64" ], @@ -130,9 +130,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", - "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.4.tgz", + "integrity": "sha512-2kb4ceA/CpfUrIcTUl1wrP/9ad9Atrp5J94Lq69w7UwOMolPIGrfLSvAKJp0RTvkPPyn6CIWrNy13kyLikZRZQ==", "cpu": [ "x64" ], @@ -147,9 +147,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", - "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.4.tgz", + "integrity": "sha512-aBYgcIxX/wd5n2ys0yESGeYMGF+pv6g0DhZr3G1ZG4jMfruU9Tl1i2Z+Wnj9/KjGz1lTLCcorqE2viePZqj4Eg==", "cpu": [ "arm" ], @@ -164,9 +164,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", - "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.4.tgz", + "integrity": "sha512-7nQOttdzVGth1iz57kxg9uCz57dxQLHWxopL6mYuYthohPKEK0vU0C3O21CcBK6KDlkYVcnDXY099HcCDXd9dA==", "cpu": [ "arm64" ], @@ -181,9 +181,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", - "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.4.tgz", + "integrity": "sha512-oPtixtAIzgvzYcKBQM/qZ3R+9TEUd1aNJQu0HhGyqtx6oS7qTpvjheIWBbes4+qu1bNlo2V4cbkISr8q6gRBFA==", "cpu": [ "ia32" ], @@ -198,9 +198,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", - "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.4.tgz", + "integrity": "sha512-8mL/vh8qeCoRcFH2nM8wm5uJP+ZcVYGGayMavi8GmRJjuI3g1v6Z7Ni0JJKAJW+m0EtUuARb6Lmp4hMjzCBWzA==", "cpu": [ "loong64" ], @@ -215,9 +215,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", - "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.4.tgz", + "integrity": "sha512-1RdrWFFiiLIW7LQq9Q2NES+HiD4NyT8Itj9AUeCl0IVCA459WnPhREKgwrpaIfTOe+/2rdntisegiPWn/r/aAw==", "cpu": [ "mips64el" ], @@ -232,9 +232,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", - "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.4.tgz", + "integrity": "sha512-tLCwNG47l3sd9lpfyx9LAGEGItCUeRCWeAx6x2Jmbav65nAwoPXfewtAdtbtit/pJFLUWOhpv0FpS6GQAmPrHA==", "cpu": [ "ppc64" ], @@ -249,9 +249,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", - "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.4.tgz", + "integrity": "sha512-BnASypppbUWyqjd1KIpU4AUBiIhVr6YlHx/cnPgqEkNoVOhHg+YiSVxM1RLfiy4t9cAulbRGTNCKOcqHrEQLIw==", "cpu": [ "riscv64" ], @@ -266,9 +266,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", - "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.4.tgz", + "integrity": "sha512-+eUqgb/Z7vxVLezG8bVB9SfBie89gMueS+I0xYh2tJdw3vqA/0ImZJ2ROeWwVJN59ihBeZ7Tu92dF/5dy5FttA==", "cpu": [ "s390x" ], @@ -283,9 +283,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", - "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.4.tgz", + "integrity": "sha512-S5qOXrKV8BQEzJPVxAwnryi2+Iq5pB40gTEIT69BQONqR7JH1EPIcQ/Uiv9mCnn05jff9umq/5nqzxlqTOg9NA==", "cpu": [ "x64" ], @@ -300,9 +300,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", - "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.4.tgz", + "integrity": "sha512-xHT8X4sb0GS8qTqiwzHqpY00C95DPAq7nAwX35Ie/s+LO9830hrMd3oX0ZMKLvy7vsonee73x0lmcdOVXFzd6Q==", "cpu": [ "arm64" ], @@ -317,9 +317,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", - "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.4.tgz", + "integrity": "sha512-RugOvOdXfdyi5Tyv40kgQnI0byv66BFgAqjdgtAKqHoZTbTF2QqfQrFwa7cHEORJf6X2ht+l9ABLMP0dnKYsgg==", "cpu": [ "x64" ], @@ -334,9 +334,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", - "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.4.tgz", + "integrity": "sha512-2MyL3IAaTX+1/qP0O1SwskwcwCoOI4kV2IBX1xYnDDqthmq5ArrW94qSIKCAuRraMgPOmG0RDTA74mzYNQA9ow==", "cpu": [ "arm64" ], @@ -351,9 +351,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", - "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.4.tgz", + "integrity": "sha512-u8fg/jQ5aQDfsnIV6+KwLOf1CmJnfu1ShpwqdwC0uA7ZPwFws55Ngc12vBdeUdnuWoQYx/SOQLGDcdlfXhYmXQ==", "cpu": [ "x64" ], @@ -368,9 +368,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", - "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.4.tgz", + "integrity": "sha512-JkTZrl6VbyO8lDQO3yv26nNr2RM2yZzNrNHEsj9bm6dOwwu9OYN28CjzZkH57bh4w0I2F7IodpQvUAEd1mbWXg==", "cpu": [ "arm64" ], @@ -385,9 +385,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", - "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.4.tgz", + "integrity": "sha512-/gOzgaewZJfeJTlsWhvUEmUG4tWEY2Spp5M20INYRg2ZKl9QPO3QEEgPeRtLjEWSW8FilRNacPOg8R1uaYkA6g==", "cpu": [ "x64" ], @@ -402,9 +402,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", - "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.4.tgz", + "integrity": "sha512-Z9SExBg2y32smoDQdf1HRwHRt6vAHLXcxD2uGgO/v2jK7Y718Ix4ndsbNMU/+1Qiem9OiOdaqitioZwxivhXYg==", "cpu": [ "arm64" ], @@ -419,9 +419,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", - "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.4.tgz", + "integrity": "sha512-DAyGLS0Jz5G5iixEbMHi5KdiApqHBWMGzTtMiJ72ZOLhbu/bzxgAe8Ue8CTS3n3HbIUHQz/L51yMdGMeoxXNJw==", "cpu": [ "ia32" ], @@ -436,9 +436,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", - "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.4.tgz", + "integrity": "sha512-+knoa0BDoeXgkNvvV1vvbZX4+hizelrkwmGJBdT17t8FNPwG2lKemmuMZlmaNQ3ws3DKKCxpb4zRZEIp3UxFCg==", "cpu": [ "x64" ], @@ -784,9 +784,9 @@ } }, "node_modules/esbuild": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", - "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.4.tgz", + "integrity": "sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -797,32 +797,32 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.3", - "@esbuild/android-arm": "0.27.3", - "@esbuild/android-arm64": "0.27.3", - "@esbuild/android-x64": "0.27.3", - "@esbuild/darwin-arm64": "0.27.3", - "@esbuild/darwin-x64": "0.27.3", - "@esbuild/freebsd-arm64": "0.27.3", - "@esbuild/freebsd-x64": "0.27.3", - "@esbuild/linux-arm": "0.27.3", - "@esbuild/linux-arm64": "0.27.3", - "@esbuild/linux-ia32": "0.27.3", - "@esbuild/linux-loong64": "0.27.3", - "@esbuild/linux-mips64el": "0.27.3", - "@esbuild/linux-ppc64": "0.27.3", - "@esbuild/linux-riscv64": "0.27.3", - "@esbuild/linux-s390x": "0.27.3", - "@esbuild/linux-x64": "0.27.3", - "@esbuild/netbsd-arm64": "0.27.3", - "@esbuild/netbsd-x64": "0.27.3", - "@esbuild/openbsd-arm64": "0.27.3", - "@esbuild/openbsd-x64": "0.27.3", - "@esbuild/openharmony-arm64": "0.27.3", - "@esbuild/sunos-x64": "0.27.3", - "@esbuild/win32-arm64": "0.27.3", - "@esbuild/win32-ia32": "0.27.3", - "@esbuild/win32-x64": "0.27.3" + "@esbuild/aix-ppc64": "0.27.4", + "@esbuild/android-arm": "0.27.4", + "@esbuild/android-arm64": "0.27.4", + "@esbuild/android-x64": "0.27.4", + "@esbuild/darwin-arm64": "0.27.4", + "@esbuild/darwin-x64": "0.27.4", + "@esbuild/freebsd-arm64": "0.27.4", + "@esbuild/freebsd-x64": "0.27.4", + "@esbuild/linux-arm": "0.27.4", + "@esbuild/linux-arm64": "0.27.4", + "@esbuild/linux-ia32": "0.27.4", + "@esbuild/linux-loong64": "0.27.4", + "@esbuild/linux-mips64el": "0.27.4", + "@esbuild/linux-ppc64": "0.27.4", + "@esbuild/linux-riscv64": "0.27.4", + "@esbuild/linux-s390x": "0.27.4", + "@esbuild/linux-x64": "0.27.4", + "@esbuild/netbsd-arm64": "0.27.4", + "@esbuild/netbsd-x64": "0.27.4", + "@esbuild/openbsd-arm64": "0.27.4", + "@esbuild/openbsd-x64": "0.27.4", + "@esbuild/openharmony-arm64": "0.27.4", + "@esbuild/sunos-x64": "0.27.4", + "@esbuild/win32-arm64": "0.27.4", + "@esbuild/win32-ia32": "0.27.4", + "@esbuild/win32-x64": "0.27.4" } }, "node_modules/fill-range": { @@ -840,9 +840,9 @@ } }, "node_modules/immutable": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.0.3.tgz", - "integrity": "sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.5.tgz", + "integrity": "sha512-t7xcm2siw+hlUM68I+UEOK+z84RzmN59as9DZ7P1l0994DKUWV7UXBMQZVxaoMSRQ+PBZbHCOoBt7a2wxOMt+A==", "dev": true, "license": "MIT" }, @@ -934,14 +934,14 @@ } }, "node_modules/sass": { - "version": "1.97.3", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.97.3.tgz", - "integrity": "sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==", + "version": "1.98.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.98.0.tgz", + "integrity": "sha512-+4N/u9dZ4PrgzGgPlKnaaRQx64RO0JBKs9sDhQ2pLgN6JQZ25uPQZKQYaBJU48Kd5BxgXoJ4e09Dq7nMcOUW3A==", "dev": true, "license": "MIT", "dependencies": { "chokidar": "^4.0.0", - "immutable": "^5.0.2", + "immutable": "^5.1.5", "source-map-js": ">=0.6.2 <2.0.0" }, "bin": { diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/package.json b/src/BlazorUI/Bit.BlazorUI.Extras/package.json index 5e8810bec4..3e161a8a41 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/package.json +++ b/src/BlazorUI/Bit.BlazorUI.Extras/package.json @@ -1,7 +1,7 @@ { "devDependencies": { - "esbuild": "0.27.3", - "sass": "1.97.3", + "esbuild": "0.27.4", + "sass": "1.98.0", "typescript": "5.9.3" } } diff --git a/src/BlazorUI/Bit.BlazorUI.Icons/package-lock.json b/src/BlazorUI/Bit.BlazorUI.Icons/package-lock.json index c5ac7a013c..510ee2d40b 100644 --- a/src/BlazorUI/Bit.BlazorUI.Icons/package-lock.json +++ b/src/BlazorUI/Bit.BlazorUI.Icons/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "devDependencies": { - "sass": "1.97.3" + "sass": "1.98.0" } }, "node_modules/@parcel/watcher": { @@ -354,9 +354,9 @@ } }, "node_modules/immutable": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.0.3.tgz", - "integrity": "sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.5.tgz", + "integrity": "sha512-t7xcm2siw+hlUM68I+UEOK+z84RzmN59as9DZ7P1l0994DKUWV7UXBMQZVxaoMSRQ+PBZbHCOoBt7a2wxOMt+A==", "dev": true, "license": "MIT" }, @@ -448,14 +448,14 @@ } }, "node_modules/sass": { - "version": "1.97.3", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.97.3.tgz", - "integrity": "sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==", + "version": "1.98.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.98.0.tgz", + "integrity": "sha512-+4N/u9dZ4PrgzGgPlKnaaRQx64RO0JBKs9sDhQ2pLgN6JQZ25uPQZKQYaBJU48Kd5BxgXoJ4e09Dq7nMcOUW3A==", "dev": true, "license": "MIT", "dependencies": { "chokidar": "^4.0.0", - "immutable": "^5.0.2", + "immutable": "^5.1.5", "source-map-js": ">=0.6.2 <2.0.0" }, "bin": { diff --git a/src/BlazorUI/Bit.BlazorUI.Icons/package.json b/src/BlazorUI/Bit.BlazorUI.Icons/package.json index e14395e62d..20580eb644 100644 --- a/src/BlazorUI/Bit.BlazorUI.Icons/package.json +++ b/src/BlazorUI/Bit.BlazorUI.Icons/package.json @@ -1,5 +1,5 @@ { "devDependencies": { - "sass": "1.97.3" + "sass": "1.98.0" } } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButton.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButton.razor.cs index baf556a38d..6b07a478bf 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButton.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButton.razor.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components.Forms; namespace Bit.BlazorUI; @@ -8,7 +8,7 @@ namespace Bit.BlazorUI; public partial class BitButton : BitComponentBase { private string? _rel; - private int? _tabIndex; + private string? _tabIndex; private bool _dragging; private BitButtonType _buttonType; private DotNetObjectReference? _dotnetObj; @@ -21,23 +21,24 @@ public partial class BitButton : BitComponentBase /// /// The EditContext, which is set if the button is inside an . + /// The value is coming from the cascading value provided by the EditForm. /// [CascadingParameter] public EditContext? EditContext { get; set; } /// - /// Whether the button can have focus in disabled mode. + /// Keeps the disabled button focusable by not forcing a negative tabindex when is false. /// [Parameter] public bool AllowDisabledFocus { get; set; } = true; /// - /// Detailed description of the button for the benefit of screen readers. + /// Detailed description of the button for the benefit of screen readers (rendered into aria-describedby). /// [Parameter] public string? AriaDescription { get; set; } /// - /// If true, adds an aria-hidden attribute instructing screen readers to ignore the element. + /// If true, adds an aria-hidden attribute instructing screen readers to ignore the button. /// [Parameter] public bool AriaHidden { get; set; } @@ -47,7 +48,7 @@ public partial class BitButton : BitComponentBase [Parameter] public bool AutoLoading { get; set; } /// - /// The value of the type attribute of the button. + /// The type of the button element; defaults to submit inside an otherwise button. /// [Parameter] public BitButtonType? ButtonType { get; set; } @@ -132,8 +133,16 @@ public partial class BitButton : BitComponentBase [Parameter] public BitIconInfo? Icon { get; set; } /// - /// The name of the icon to render inside the button. + /// Gets or sets the name of the icon to display from the built-in Fluent UI icons. /// + /// + /// The icon name should be from the Fluent UI icon set (e.g., BitIconName.Emoji). + ///
+ /// Browse available names in BitIconName of the Bit.BlazorUI.Icons nuget package or the gallery: + /// . + ///
+ /// For external icon libraries, use instead. + ///
[Parameter] public string? IconName { get; set; } /// @@ -142,6 +151,12 @@ public partial class BitButton : BitComponentBase [Parameter, ResetClassBuilder] public bool IconOnly { get; set; } + /// + /// Gets or sets the position of the icon relative to the component's content. + /// + [Parameter, ResetClassBuilder] + public BitIconPosition? IconPosition { get; set; } + /// /// The url of the custom icon to render inside the button. /// @@ -169,7 +184,7 @@ public partial class BitButton : BitComponentBase [Parameter] public RenderFragment? LoadingTemplate { get; set; } /// - /// The callback for the click event of the button with a bool argument passing the current loading state. + /// Raised when the button is clicked; receives a bool indicating the current loading state. /// [Parameter] public EventCallback OnClick { get; set; } @@ -185,13 +200,8 @@ public partial class BitButton : BitComponentBase [Parameter] public bool Reclickable { get; set; } /// - /// Reverses the positions of the icon and the main content of the button. - /// - [Parameter, ResetClassBuilder] - public bool ReversedIcon { get; set; } - - /// - /// If Href provided, specifies the relationship between the current document and the linked document. + /// Sets the rel attribute for link-rendered buttons when is a non-anchor URL; ignored for empty or hash-only hrefs. + /// The rel attribute specifies the relationship between the current document and the linked document. /// [Parameter] [CallOnSet(nameof(OnSetHrefAndRel))] @@ -210,13 +220,13 @@ public partial class BitButton : BitComponentBase public RenderFragment? SecondaryTemplate { get; set; } /// - /// The size of the button. + /// Sets the preset size for typography and padding of the button. /// [Parameter, ResetClassBuilder] public BitSize? Size { get; set; } /// - /// Custom CSS styles for different parts of the button. + /// Custom inline styles for different parts of the button. /// [Parameter] public BitButtonClassStyles? Styles { get; set; } @@ -311,7 +321,7 @@ protected override void RegisterCssClasses() _ => "bit-btn-md" }); - ClassBuilder.Register(() => ReversedIcon ? "bit-btn-rvi" : string.Empty); + ClassBuilder.Register(() => IconPosition is BitIconPosition.End ? "bit-btn-eni" : string.Empty); ClassBuilder.Register(() => FixedColor ? "bit-btn-fxc" : string.Empty); @@ -352,7 +362,11 @@ protected override void OnParametersSet() { if (IsEnabled is false) { - _tabIndex = AllowDisabledFocus ? null : -1; + _tabIndex = AllowDisabledFocus ? null : "-1"; + } + else + { + _tabIndex = TabIndex ?? _tabIndex; } _buttonType = ButtonType ?? (EditContext is null ? BitButtonType.Button : BitButtonType.Submit); diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButton.scss b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButton.scss index 0a514d8af6..706393d462 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButton.scss +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButton.scss @@ -1,4 +1,4 @@ -@import "../../../Styles/functions.scss"; +@import "../../../Styles/functions.scss"; .bit-btn { cursor: pointer; @@ -68,7 +68,7 @@ height: var(--bit-btn-icn-size); } -.bit-btn-rvi { +.bit-btn-eni { flex-direction: row-reverse; } @@ -100,7 +100,6 @@ .bit-btn-flw { width: 100%; - z-index: $zindex-base; } .bit-btn-fab { diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButtonClassStyles.cs b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButtonClassStyles.cs index 2167cebd6a..bcb1a6330d 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButtonClassStyles.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/Button/BitButtonClassStyles.cs @@ -1,44 +1,47 @@ -namespace Bit.BlazorUI; +namespace Bit.BlazorUI; +/// +/// Defines per-part CSS class/style values for . +/// public class BitButtonClassStyles { /// - /// Custom CSS classes/styles for the root element of the BitButton. + /// Custom class or style applied to the root element. /// public string? Root { get; set; } /// - /// Custom CSS classes/styles for the icon of the BitButton. + /// Custom class or style applied to the icon element. /// public string? Icon { get; set; } /// - /// Custom CSS classes/styles for the internal container of the BitButton. + /// Custom class or style applied to the internal container. /// public string? Container { get; set; } /// - /// Custom CSS classes/styles for the primary section of the BitButton. + /// Custom class or style applied to the primary section. /// public string? Primary { get; set; } /// - /// Custom CSS classes/styles for the secondary section of the BitButton. + /// Custom class or style applied to the secondary section. /// public string? Secondary { get; set; } /// - /// Custom CSS classes/styles for the loading container of the BitButton. + /// Custom class or style applied to the loading container. /// public string? LoadingContainer { get; set; } /// - /// Custom CSS classes/styles for the spinner of the BitButton. + /// Custom class or style applied to the spinner element. /// public string? Spinner { get; set; } /// - /// Custom CSS classes/styles for the loading label of the BitButton. + /// Custom class or style applied to the loading label. /// public string? LoadingLabel { get; set; } } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Calendar/BitCalendar.razor b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Calendar/BitCalendar.razor index ca293841f5..6268617932 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Calendar/BitCalendar.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Calendar/BitCalendar.razor @@ -1,6 +1,27 @@ -@namespace Bit.BlazorUI +@namespace Bit.BlazorUI @inherits BitInputBase +@{ + var todayYear = _culture.Calendar.GetYear(DateTime.Now); + var todayMonth = _culture.Calendar.GetMonth(DateTime.Now); + var todayDay = _culture.Calendar.GetDayOfMonth(DateTime.Now); + + var prevMonthNavIconCss = BitIconInfo.From(PrevMonthNavIcon, PrevMonthNavIconName ?? "Up")?.GetCssClasses(); + var nextMonthNavIconCss = BitIconInfo.From(NextMonthNavIcon, NextMonthNavIconName ?? "Up bit-ico-r180")?.GetCssClasses(); + var goToTodayIconCss = BitIconInfo.From(GoToTodayIcon, GoToTodayIconName ?? "GotoToday")?.GetCssClasses(); + var showTimePickerIconCss = BitIconInfo.From(ShowTimePickerIcon, ShowTimePickerIconName ?? "Clock")?.GetCssClasses(); + var prevYearNavIconCss = BitIconInfo.From(PrevYearNavIcon, PrevYearNavIconName ?? "Up")?.GetCssClasses(); + var nextYearNavIconCss = BitIconInfo.From(NextYearNavIcon, NextYearNavIconName ?? "Up bit-ico-r180")?.GetCssClasses(); + var prevYearRangeNavIconCss = BitIconInfo.From(PrevYearRangeNavIcon, PrevYearRangeNavIconName ?? "Up")?.GetCssClasses(); + var nextYearRangeNavIconCss = BitIconInfo.From(NextYearRangeNavIcon, NextYearRangeNavIconName ?? "Up bit-ico-r180")?.GetCssClasses(); + var goToNowIconCss = BitIconInfo.From(GoToNowIcon, GoToNowIconName ?? "Clock")?.GetCssClasses(); + var hideTimePickerIconCss = BitIconInfo.From(HideTimePickerIcon, HideTimePickerIconName ?? "CalendarMirrored")?.GetCssClasses(); + var increaseHourIconCss = BitIconInfo.From(TimePickerIncreaseHourIcon, TimePickerIncreaseHourIconName ?? "ChevronDownSmall bit-ico-r180")?.GetCssClasses(); + var decreaseHourIconCss = BitIconInfo.From(TimePickerDecreaseHourIcon, TimePickerDecreaseHourIconName ?? "ChevronDownSmall")?.GetCssClasses(); + var increaseMinuteIconCss = BitIconInfo.From(TimePickerIncreaseMinuteIcon, TimePickerIncreaseMinuteIconName ?? "ChevronDownSmall bit-ico-r180")?.GetCssClasses(); + var decreaseMinuteIconCss = BitIconInfo.From(TimePickerDecreaseMinuteIcon, TimePickerDecreaseMinuteIconName ?? "ChevronDownSmall")?.GetCssClasses(); +} +
- @{ - var todayYear = _culture.Calendar.GetYear(DateTime.Now); - var todayMonth = _culture.Calendar.GetMonth(DateTime.Now); - var todayDay = _culture.Calendar.GetDayOfMonth(DateTime.Now); - } - @if (DayPickerIsVisible()) {
@@ -63,7 +78,7 @@ aria-disabled="@prevDisabled">