Code Monkey home page Code Monkey logo

microsoft / fluentui-blazor Goto Github PK

View Code? Open in Web Editor NEW
3.1K 56.0 284.0 141.64 MB

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications

Home Page: https://www.fluentui-blazor.net

License: MIT License

C# 98.76% HTML 1.03% JavaScript 0.04% CSS 0.14% Shell 0.01% Batchfile 0.01% TypeScript 0.02% PowerShell 0.01%
components design-systems web-components web-standards component-library front-end-framework component-architecture development-tools adaptive-ui fluent

fluentui-blazor's Introduction

Microsoft Fluent UI Blazor components

License: MIT .NET C# NuGet NuGet

Validate Security Gitter Discord

⭐ We appreciate your star, it helps!

This package is for use in .NET 8 Blazor projects. If you are using .NET 6 or 7, please use the v3 version of the package which is named Microsoft.Fast.Components.FluentUI

Introduction

The Microsoft.FluentUI.AspNetCore.Components package provides a set of Blazor components which are used to build applications that have a Fluent design (i.e. have the look and feel or modern Microsoft applications).

Some of the components in the library are wrappers around Microsoft's official Fluent UI Web Components. Others are components that leverage the Fluent Design System or make it easier to work with Fluent UI. To get up and running with the library, see the Getting Started section below.

The source for the library is hosted in the fluentui-blazor repository at GitHub. Documentation on the components is available at the demo site.

Upgrading from an earlier version

If you are upgrading from an earlier version of the library, please see the what's new for information on (breaking) changes.

Getting Started

Using our dotnet templates

The easiest way to get started is by using our Templates. These mimic the regular Blazor templates and come with the design and components pre-configured. You install them with this command:

dotnet new install Microsoft.FluentUI.AspNetCore.Templates

Navigate to a folder where you want to create your new project and run the following command to create a new project.

dotnet new fluentblazor --name MyApplication

If you want to create a new standalone WebAssembly project, you can use the following command:

dotnet new fluentblazorwasm --name MyApplication

When using Visual Studio, you can also use the New Project dialog to create a new project. The templates will be available under the Blazor category.

Manual Install

To start using the Fluent UI Blazor components from scratch, you first need to install the main Nuget package in the project you want to use the library and its components. You can use the NuGet package manager in your IDE or use the following command when using a CLI:

dotnet add package Microsoft.FluentUI.AspNetCore.Components

If you want to extend the functionality of the library with icons or emoji, you can install additional packages for that:

dotnet add package Microsoft.FluentUI.AspNetCore.Components.Icons
dotnet add package Microsoft.FluentUI.AspNetCore.Components.Emoji

Script

As mentioned, we wrap the Fluent UI Web Components which are implemented in a script file. This file is included in the library itself and does not have to be downloaded or pulled from a CDN.

By including the script in the library we can safeguard that you are always using the best matching script version.

Even when using SSR (Static Server Rendering), the script will be included and loaded automatically. If you want the script to be loaded before Blazor starts, add it to your App.razor file like this:

<script src="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js" type="module" async></script>

If you add interactivity later, the Blazor script will kick in and try to load the web component script again but JavaScript will handle that gracefully by design.

Reboot (optional)

Reboot is a collection of element-specific CSS changes in a single file to help kick-start building a site with the Fluent UI Blazor components. It provides an elegant, consistent, and simple baseline to build upon.

If you want to use Reboot, you'll need to add to your app.razor, index.html or _Layout.cshtml file a line that includes the stylesheet (.css file). This can be done by adding the following line to the <head> section:

<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />

When using the templates to create your application, Reboot is already set-up for you.

Register Services

Add the following in Program.cs

builder.Services.AddFluentUIComponents();

If you're running your application on Blazor Server, make sure a default HttpClient is registered before the AddFluentUIComponents method.

builder.Services.AddHttpClient();

Add Component Providers

Add the following components at the end of your MainLayout.razor file.
These providers are used by associated services to display Toasts, Dialog boxes, Tooltips or Message Bars correctly.

<FluentToastProvider />
<FluentDialogProvider />
<FluentTooltipProvider />
<FluentMessageBarProvider />

note: You can remove providers that are not used in your application.

Working with Icons and Emoji

We have additional packages available that include the complete Fluent UI System icons and Fluent UI Emoji collections. Please refer to the Icons and Emoji page for more information.

Usage

With the package installed, you can begin using the Fluent UI Blazor components in the same way as any other Blazor component.

Add Imports

After the package is added, you need to add the following in your _Imports.razor

@using Microsoft.FluentUI.AspNetCore.Components

Quick Start

This is literally all you need in your views to use Fluent UI Blazor components.

<FluentCard>
  <h2>Hello World!</h2>
  <FluentButton Appearance="@Appearance.Accent">Click Me</FluentButton>
</FluentCard>

Configuring the Design System

The Fluent UI Blazor components are built on FAST's (Adaptive UI) technology, which enables design customization and personalization, while automatically maintaining accessibility. This is accomplished through setting various "design tokens". The library exposes all design tokens, which you can use both from code as in a declarative way in your .razor pages. The different ways of working with design tokens are described in the design tokens page.

Blazor Hybrid

You can use this library in Blazor Hybrid (MAUI/WPF/Windows Forms) projects. Setup is almost the same as described in the "Getting started" section above, but to get everything to work you'll need to take one extra steps (for now) described below.

Temporary workaround for MAUI/WPF/Windows Forms issues

Currently when using the WebView to run Blazor (so all Hybrid variants) the web-components script is not imported automatically (see #404). There is also an issue with loading the custom event handlers that are being configured by the web-components script. Until these are fixed on the WebView side, there is a workaround available, namely to intercept '_framework/blazor.modules.json' and provide proper JS initializers file (created by build). The needed initializersLoader.webview.js has been added to the library and needs to be included with a script tag before the _framework/blazor.webview.js script tag:

<script app-name="{NAME OF YOUR APP}" src="./_content/Microsoft.FluentUI.AspNetCore.Components/js/initializersLoader.webview.js"></script>
<script src="_framework/blazor.webview.js"></script>

The app-name attribute needs to match your app's assembly name - initializersLoader uses 'app-name' to resolve name of the file with initializers. initializersLoader replaces standard fetch function with one which provides the correct file in place of the empty blazor.modules.json. fetch is restored to its original state once _framework/blazor.modules.json request is intercepted.

For more information regarding the bug, see issue 15234 in the MAUI repo.

Use the DataGrid component with EF Core

If you want to use the <FluentDataGrid> with data provided through EF Core, you need to install an additional package so the grid knows how to resolve queries asynchronously for efficiency.

Installation

Install the package by running the command:

dotnet add package Microsoft.FluentUI.AspNetCore.Components.DataGrid.EntityFrameworkAdapter

Usage

In your Program.cs file, you need to add the following after the builder.Services.AddFluentUIComponents(...); lines:

builder.Services.AddDataGridEntityFrameworkAdapter();

Additional resources

Support

The Microsoft Fluent UI Blazor library is an open source project and is not an official part of ASP.NET Core, which means it’s not officially supported and isn’t committed to ship updates as part of any official .NET updates. It is built and maintained by Microsoft employees (and other contributors) and offers support, like most other open source projects, on a best effort base through the GitHub repository only.

Contributing to the project

We offer some guidelines on how you can get started contributing to the project. We also have a document that explains and shows how to write and develop unit tests

Joining the Community

Looking to get answers to questions or engage with us in real-time? Our community is active on Gitter and Discord. Submit requests and issues on GitHub, or join us by contributing on some good first issues via GitHub.

We look forward to building an amazing open source community with you!

Contact

  • Join the community and chat with us in real-time on Gitter or Discord.
  • Submit requests and issues (only) on GitHub.
  • Contribute by helping out on some of our recommended first issues on GitHub.

fluentui-blazor's People

Contributors

agriffard avatar andras-csanyi avatar awentzel avatar c0g1t8 avatar cupsos avatar digitaldirk avatar dvoituron avatar dvoituron-msft avatar ehsangfl avatar eisenbergeffect avatar emimontesdeoca avatar gillestourreau avatar hksalessio avatar hona avatar ibrahimmaga avatar joriverm avatar luohuarain avatar martinbu avatar narvalex avatar nicholasrice avatar nickhirras avatar ogglas avatar proh4ck avatar shreyasjejurkar avatar ssccinng avatar stevenrasmussen avatar tlmii avatar tossnet avatar vnbaaij avatar williamw2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fluentui-blazor's Issues

fix: [bind-Value not working] in [FluentNumberField]

🐛 Bug Report

At the moment it seems it is not possible to bind to a FluentNumberField via @bind-Value=....

💻 Repro or Code Sample

Go to example page -> Blazor component bindings -> enter a number into the 'Number field Value' input box. The value is not being updated.
The FluentTextField above (Text field Value) is being updated properly.

🤔 Expected Behavior

The component should bind to the value and update it.

😯 Current Behavior

The bound value is not being updated.
image
[FluentTextField binds correctly while FluentNumberField does not]

🌍 Your Environment

Windows 10, Chrome, fast-blazor (version 0.4)

Improve NuGet package

The NuGet package should have a few tweaks to make it improved and increase integrity:

  • Adding SourceLink
  • Specifying source repo/license
  • Including readme file for nuget product page

chore: move static web app to FAST infastructure

Description

Migrate the Azure Static Web App currently hosted on a contributor's Azure Subscription to the FAST subscription.

  1. Create new SWA.
  2. Issue PR to update existing yml file name, new SWA name, and secret.
  3. Test and refine as needed.

🔦 Context

This feature supports adding links in PRs for the new demo site and branch.

💻 Examples

feat: manipulate design tokens from C#

🙋 Feature Request

Design tokens are very powerful but it's hard to access the full features of the system today without writing JavaScript. We should look into a way to create a C# API that can set token values on arbitrary components.

🤔 Expected Behavior

I should be able to set any token to a value on any component.

😯 Current Behavior

Tokens can only be set through the design system provider.

💁 Possible Solution

We'll need to be able to get tokens by name globally most likely. Then we'll need some JS interop from the C# side to find the token and set the value, using some sort of element reference.

rfc: upgrade projects to .NET 6

💬 RFC

Propose to upgrade the projects to .NET 6.

🔦 Context

.NET 6 will be out in November, is going to be a Long Term Support (LTS) release and brings numerous improvements to Blazor. As this library is now only at a 0.3 version, it makes sense to upgrade to .NET 6 before doing a 1.0 release as .NET 6 will be out long before that. Also, .NET 6 is at RC1 stage now and comes with Go Live-support.

With moving to .NET 6 we can remove the custom FluentInputBase implementation and instead inherit from the standard ASP.NET Core InputBase and thereby rely on a robust and thoroughly tested implementation, current enhancements (use input components without EditContext) and future improvements (solving #58)
This won't be possible until .NET 7

As a final part of this change I propose to enable Nullability checks for the projects. With .NET 6 a larger part of the base classes (including ASP.NET Core) have this enabled now. Enabling this allows to get rid of a number of compile time warnings we are getting now.

docs: Please consider adding XML documentation for Fluent razor components

🙋 Documentation Request

Please consider adding XML documentation for C# blazor component API.
Consider the following scenario, how come newcomers know what needs to be used for rendering anchor tags, as they see two components here.

image

If we compare this with inbuilt blazor components, at least we get some component information while typing itself.

image

💁 Possible Solution

We should consider adding XML documentation for these components and as well as their individual properties, as these comments can be inferred by Visual Studio and Visual Studio Code and provide a great experience for developers!

I am ready to help with this task to get it complete😅. But filling issue first so that we can track progress and I can know other people's thoughts on it if I miss anything here!

Skeleton sample error: Cannot read property 'querySelectorAll' of null

Repro steps:

  • Run the FluentUIServerSample
  • Select the web components
  • Select the Skeleton link

Error in the browser console:

onloadwff.js:71 Uncaught (in promise) TypeError: Cannot read property 'querySelectorAll' of null
    at s.<anonymous> (onloadwff.js:71)
    at l (onloadwff.js:71)
    at Object.next (onloadwff.js:71)
    at n (onloadwff.js:71)

Question: why FluentInputBase.cs and not Blazor's InputBase.cs?

Just found out about the existence of this package today. I think it's pretty cool as it makes it simpler to adopt the FAST Fluent components in a Blazor project 😃.

Navigating through the code it came to my attention the fact that all input-like components (for ex. FluentTextField) derive from a FluentInputBase.cs (link), which is almost an exact, line-by-line duplicate of Blazor's InputBase.cs (link) base class for input elements. I was wondering what was the reason for this divergence? Is the plan to eventually make all input components in this package derive from the latter?

feat: update names for better consistency

🙋 Feature Request

Names should be consistently applied throughout the library.

🤔 Expected Behavior

Better consistency

😯 Current Behavior

lacks consistency as in some places naming conventions are used with Pascal casing and in other cases with Camel casing.

💁 Context / Possible Solution/Examples

See this comment for details: #53 (comment)

fix: FluentUI Razor web components do not work with Blazor CSS isolation

🐛 Bug Report

Because the terminology in the docs is a bit hard to keep track of, I'll use the following terms:

  • FAST Razor components: Refers to the Razor components exported in this repo wrapping the Fluent web components.
  • FAST web components: Refers to using the Fluent web components directly.

When using the FAST Razor components you cannot style them like you would expect with Blazor CSS isolation.

This seems to be related to dotnet/razor#7606

TL;DR: I expect the following FAST web component usage and FAST Razor component usage to render the same but the Razor component renders without the margin:

Example.razor.css:

.awesome-margin { margin: 16px; }

Example.razor:

<!-- ✔ Using the FAST web component works and we see the margin, but I'd like to use the typing given by FAST Razor components -->
<fluent-button class="awesome-margin">FAST Web component</fluent-button>

<!-- ❌ Swapping and using the FAST Razor component does not work as the margin is missing 😢 -->
<FluentButton class="awesome-margin">FAST Razor component</FluentButton>

💻 Repro or Code Sample

Using the following Counter.razor.css file:

.button-container { display:flex; flex-direction: column; border: 1px solid red; width: 500px;}
.my-web-component-button-scoped-css { margin: 16px; }
.my-razor-button-scoped-css { margin: 16px; }
::deep .my-razor-button-deep { margin: 16px; }

For the following Counter.razor file:

<div class="button-container">
<!-- ✔ Using the FAST web component with CSS isolation works, but I'd like to use the typing given by FAST Razor components -->
    <fluent-button class="my-web-component-button-scoped-css" @onclick="IncrementCount">Click me - web component scoped css</fluent-button>

<!-- ❌ Swapping and using the FAST Razor component with CSS isolation does not work 😢 -->
    <FluentButton class="my-razor-button-scoped-css" @onclick="IncrementCount">Click me - scoped css</FluentButton>

<!-- The following are different workarounds -->

<!-- ⚠ Using the FAST Razor component by moving the css into a style tag "works" but is cheating. Those do not participate in CSS isolation and are effectively global styles -->
    <style>
        .my-razor-button-local-css {
            margin: 16px;
        }
    </style>
    <FluentButton class="my-razor-button-local-css" @onclick="IncrementCount">Click me - local css</FluentButton>

<!-- ⚠ Using a FAST Razor component with inline styles works but does not let us use CSS files as expected -->
    <FluentButton style="margin: 16px;" @onclick="IncrementCount">Click me - inline css</FluentButton>

<!-- ✔⚠ Using a FAST Razor component with deep style selector has the fewest tradeoffs -->
    <FluentButton class="my-razor-button-deep" @onclick="IncrementCount">Click me - deep css</FluentButton>
</div>

Gives the following output:

image

Notice how the FAST Razor component with the label "Click me - scoped css" does not receive the margin that was set in the corresponding CSS file.

Example repo: https://github.com/rajsite/fast-blazor-issue-template/tree/fast-blazor-scoped-css-margin

🤔 Expected Behavior

I expect to be able to target the FAST Razor components with classes from CSS files like I would the corresponding Fast web component. In the screenshot above I would expect all the buttons to have the same margin.

😯 Current Behavior

See screenshot above.

💁 Possible Solution

Wait for dotnet/razor#7606 to be resolved?

Some workarounds:

  • Use the Blazor-specific ::deep selector as shown in the last example above. The Blazor docs explicitly describe this as Child component support. This allows you to place component styles in a stylesheet participating in Blazor CSS isolation. Probably the best workaround so far.
  • Modify CSS that does not participate in Blazor CSS isolation:
    • Add <style> tags in the Razor HTML
    • Add styles to wwwroot/css
    • Use inline style="" attributes

🔦 Context

Trying to switch from using the FAST web components to using the FAST Razor components.

🌍 Your Environment

$ dotnet --version
5.0.400
<script type="module" src="https://unpkg.com/@fluentui/[email protected]/dist/web-components.min.js"></script>
<PackageReference Include="Microsoft.Fast.Components.FluentUI" Version="0.4.0" />

feat: expose .show() and .hide() functionality. in FluentDialog

🙋 Feature Request

expose .show() and .hide() functionality. in FluentDialog

🤔 Expected Behavior

being able to call .show() and .hide() methods in FluentDialog blazor control

😯 Current Behavior

today you have to play around with the hidden attribute to get the dialog to pop. That's OK, but it would be handy to call the underlying web component.

💁 Possible Solution

use JS INterop to call the underlying .show() and .hide() functionality. in FluentDialog

🔦 Context

I have a load dialog I'm trying to pop when a button is pressed.

💻 Examples

https://gist.github.com/EddyHaigh/639a2b28d542a7e416bd484e7187867a

Resolve all Warnings and Errors prior to publishing

There are 57 warnings related to warning CS1591: Missing XML comment for the publicly visible type or member which must be resolved prior to publication to follow best practices and improve visibility and exploration of the classes when being used.

SyntaxError: Identifier 'darkTheme' has already been declared

Repro steps:

  • Run the FluentUIServerSample
  • Select the web components
  • Select the TreeView or Switch links

Error in the browser console:

VM410:1 Uncaught SyntaxError: Identifier 'darkTheme' has already been declared
    at h (blazor.server.js:8)
    at h (blazor.server.js:8)
    at Object.s [as insertLogicalChild] (blazor.server.js:8)
    at e.insertMarkup (blazor.server.js:8)
    at e.insertFrame (blazor.server.js:8)
    at e.insertFrameRange (blazor.server.js:8)
    at e.insertElement (blazor.server.js:8)
    at e.insertFrame (blazor.server.js:8)
    at e.insertFrameRange (blazor.server.js:8)
    at e.insertElement (blazor.server.js:8)

rfc: fast-blazor absent from blazor.net UI Component section

💬 RFC

There's a number of commercial UI and Component libraries listed on blazor.net while there's no mention of microsoft/fast-blazor. Surely just an oversight, I thought I'd mention.

🔦 Context

See the UI component ecosystem section of blazor.net -> Seem's like a lot of people new to Blazor are not finding their way here and are instead lead astray since there's no mention of this great free alternative for base components in their applications.

💻 Examples

image

InvalidOperationException when using web component menu item bindings in sample app

Repro steps:

  • Run the FluentUIServerSample
  • Browse to the web component bindings
  • Try out the menu item bindings

Error in browser console:

Error: System.InvalidOperationException: There was an error parsing the event arguments. EventId: '9'.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNetCore.Components.Web.WebEventData.DeserializeChangeEventArgs(String eventArgsJson)
   at Microsoft.AspNetCore.Components.Web.WebEventData.ParseEventArgsJson(UInt64 eventHandlerId, String eventArgsType, String eventArgsJson)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Components.Web.WebEventData.ParseEventArgsJson(UInt64 eventHandlerId, String eventArgsType, String eventArgsJson)
   at Microsoft.AspNetCore.Components.Web.WebEventData.Parse(WebEventDescriptor eventDescriptor, String eventArgsJson)
   at Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost.DispatchEvent(String eventDescriptorJson, String eventArgsJson)

feat: improve project structure

🙋 Feature Request

I'd like to work on a PR to improve the project structure, it would make the development process easier for other developers. Also this will help to add more features like fluent-data-grid which needs JS Interop that needs a javascript file attached to that component.

Overall changes proposed would be to have each component to have its folder, a bundlconfig.json file, Enums, Extensions and other utilities to be located in separated folders.

🤔 Expected Behavior

The expected behavior would be to have a better experience as a developer when working in this project, with everything separated.

😯 Current Behavior

Right now the project has all the componentes under the Components folder, each component has its code in the same razor file. It also has all the extensions, enums, utilities, etc under the same folder, which could end up being a mess.

💁 Possible Solution

I'd gathered a couple of ideas on how it could be improved.

Each components to have its folder

In order to have better separation between the components, I'd suggest we have a folder inside Components folder, that contains the components name. This will allow the developers to add isolated Javascript and CSS, instead of maybe adding it under a wwwroot folder.

This is an example on how it would for the component FluentDialog:

Microsoft.Fast.Components.FluentUI/
├── Components/
	├── FluentDialog/
	     ├── FluentDialog.razor
	     ├── FluentDialog.razor.cs
	     ├── FluentDialog.razor.js
	     ├── FluentDialog.razor.css

Include @fluentui/web-components in the wwwroot folder

Create the new wwwroot folder and add the @fluentui/web-components javascript file in there to keep what version is there instead of always having the latest one, it could introduce breaking changes that this project components do not support.

Bundling and minification with bundleconfig.json file

Also after the project start to have javascript files, it should be added a bundleconfig.json that links all the components javascript files into one place.

This is an example of bundleconfig.json file that would generate minified and bundled js and css file that would be stored at wwwroot/*:

[
  {
    "outputFileName": "wwwroot/css/fluent-ui-blazor.bundle.min.css",
    "inputFiles": [
      "Components/FluentDialog/FluentDialog.razor.cs.css"
    ]
  },
  {
    "outputFileName": "wwwroot/js/fluent-ui-blazor.bundle.min.js",
    "inputFiles": [
      "wwwroot/lib/fluentui/web-components.min.js",
      "Components/FluentDialog/FluentDialog.razor.cs.js"
    ],
    "minify": {
      "enabled": true,
      "renameLocals": true
    }
  }
]

Create Enums folder

Move all the Enums that there's in the project inside a Enums folder, it would help to have everything in one place.

Microsoft.Fast.Components.FluentUI/
├── Enums/
	├── Appearance.cs
	├── Autocomplete.cs
	├── Position.cs
	├── Direction
	├── ExpandMode
	├── Orientation
	├── Resize
	├── Shape

Create Extensions folder

Move all the Enums that there's in the project inside a Enums folder, it would help to have everything in one place.

Microsoft.Fast.Components.FluentUI/
├── Extensions/
	├── Appearance.cs
	├── Autocomplete.cs
	├── Position.cs
	├── Direction
	├── ExpandMode
	├── Orientation
	├── Resize
	├── Shape

Update README.md

With these new changes, the Getting Started would become obsolete, since we now have files, we would have to update the guide to reference them.

🔦 Context

I think improving the overall project structure will help the developers.

💻 Examples

Examples have been aded on the possible solution part.

Checklist

I'd say that this is the checklist this request to be completely done:

  • Each component on its folder with all extra files
  • Enums on different folder
  • Extensions on different folder
  • Bundling and minification
  • Add @fluentui/web-components files in the project
  • Update all references on FluenUIServerSample
  • Update documentation

Unable to set property 'orientation' on object of type Microsoft.Fast.Components.FluentUI.FluentTabs

Repro steps:

  • Run the FluentUIServerSample
  • Select the web components
  • Select the Tabs link

Error in the browser console:

[2021-05-06T05:49:01.699Z] Error: System.InvalidOperationException: Unable to set property 'orientation' on object of type 'Microsoft.Fast.Components.FluentUI.FluentTabs'. The error was: Unable to cast object of type 'System.String' to type 'System.Nullable`1[Microsoft.Fast.Components.FluentUI.Orientation]'.
 ---> System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Nullable`1[Microsoft.Fast.Components.FluentUI.Orientation]'.
   at Microsoft.AspNetCore.Components.Reflection.PropertySetter.CallPropertySetter[TTarget,TValue](Action`2 setter, Object target, Object value)
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.<SetProperties>g__SetProperty|2_0(Object target, PropertySetter writer, String parameterName, Object value)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.<SetProperties>g__SetProperty|2_0(Object target, PropertySetter writer, String parameterName, Object value)
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.SetProperties(ParameterView& parameters, Object target)
   at Microsoft.AspNetCore.Components.ComponentBase.SetParametersAsync(ParameterView parameters)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

feat: add [culture specific formatting and thousand separator] to/in [FluentNumberField]

🙋 Feature Request

I'd like to be able to set a culture specific format for FluentNumberField as a parameter in the component.
The components should also take into account the settings of the app. -> app.UseRequestLocalization("de-DE");

🤔 Expected Behavior

After the culture info is set to (de-DE), the component should have a point as a thousand separator and a comma as a comma separator.

image
[CultureInfo.CreateSpecificCulture("de-DE")]

😯 Current Behavior

At the moment there is neither the thousands separator nor the option to set the culture info.
image
[CultureInfo.InvariantCulture]

🔦 Context

I would like to use the NumberTextField component in German localization. Long numbers difficult to read without the thousand separator.

NavLinkFluentAnchor forces to reload the page as if it were a regular anchor tag

🐛 Bug Report

When using the NavLinkFluentAnchor the Href forces to reload the page as if it were a regular anchor tag. Breadcrumb item links work fine but NavLinkFluentAnchor doesn't?

💻 Repro or Code Sample

Have two routable pages and have a NavLinkFluentAnchor linking between the pages.

🤔 Expected Behavior

Clicking a NavLinkFluentAnchor changes page without with a SPA like transition.

😯 Current Behavior

Clicking a NavLinkFluentAnchor performs a network request to the linked page.

💁 Possible Solution

Could be related to the shadow DOM used by the fluent-anchor.

🔦 Context

Can't provide the best UX when using NavLinkFluentAnchor and have to style own NavLink.

🌍 Your Environment

  • Windows 10
  • Microsoft Edge and Chrome
  • .Net 5.0.6 and Microsoft.Fast.Components.FluentUI 0.2.0

Add Demo site

There is need for a demo website for the components. This website may be included in the get started section.

Add fluent-number-field wrapper to fast-blazor

🙋 Feature Request

In the set of Fluent Web Components there is a fluent implementation available for the Number field component. A wrapper for this fluent-number-field is missing from this fast-blazor library

🤔 Expected Behavior

There should be a <FluentNumberField> wrapper for the <fluent-number-field> component

fix: Tooltips not being displayed in 'FluentTooltip'

🐛 Bug Report

Tooltips don't show up on hovering over elements.

💻 Repro or Code Sample

<FluentButton id="anchor1" Appearance=Appearance.Accent>Tooltip at the bottom</FluentButton> <FluentTooltip Anchor="anchor1" Position=TooltipPosition.Bottom>I'm helping!</FluentTooltip>

[From FluentUIServerSample -> FluentTooltipTest.razor]

🤔 Expected Behavior

Tooltips are being displayed on hovering over buttons.

😯 Current Behavior

image
Here I am hovering with my mouse over the button (you can't see the mouse in the screenshot), but the tooltip is not being displayed. Try it yourself in the FluentUIServerSample blazor project on page 'Tooltip'.

🌍 Your Environment

Windows, Chrome (Version 94.0.4606.81)

docs: fix/add @usng statement to/in main set up instructions.

🙋 Documentation Request

On this page:
https://github.com/microsoft/fast-blazor
there is no indication that an @using statement needs to be added to the .razor pages in a Blazor component.

💁 Possible Solution

On this page: https://www.fast.design/docs/integrations/blazor/#setting-up-the-blazor-project the missing @using statement is referenced. Can you add this to the original pages instructions?

@using Microsoft.Fast.Components.FluentUI

thanks.

docs: add in-depth getting started or introduction

🙋 Documentation Request

As a developer who has been doing back-end work for the last 6 years I am completely out of the loop regarding modules, css, etc. What I want is to be able to adopt these controls and know enough to minimally style and bind data.

💁 Possible Solution

I believe the examples do a decent job at showing the controls and data-binding, but styling and setup requires me to understand more about web development than I currently do.

fix: NavLinks don't work in menu items

🐛 Bug Report

When I put a navlink or navlinkFluentAnchor in a menuitem I can see it on the page, but clicking it does nothing.

        <FluentMenuItem>
            <NavLinkFluentAnchor Href="/fetchdata" Appearance="Appearance.Stealth">Fetch Data</NavLinkFluentAnchor>
        </FluentMenuItem>
    </FluentMenu>  ```
    
## 💻 Repro or Code Sample
sorry, It's a private repo.  I just made a new blazor wasm project and added the above code to the NavMenu.razor

## 🤔 Expected Behavior
I would expect the link to work

## 😯 Current Behavior

curently, the link is there, it shows up on the screen, I can inspect it, but nothing happend on a click and there is no error message.  
![image](https://user-images.githubusercontent.com/311063/121834840-9c99b300-cc84-11eb-9778-31ceabc7e13e.png)
 

## 💁 Possible Solution

unclear... 

## 🔦 Context

I'm just getting to know the controls and thought replacing the menu would be a nice start.

## 🌍 Your Environment

* OS & Device: Windows PC
* Browser : Microsoft Edge or Google Chrome
* .NET and FAST Version both latest as of June 13th

Add DetailsList control from Fluent UI to Blazor

Hello,
We are using ASP.NET 5 with Blazor WASM for frontend and internal business applications.
We are missing Fluent UI controls, especially some grid control like - DetailsList - https://developer.microsoft.com/en-us/fluentui#/controls/web/detailslist

I hope this fast-blazor GitHub will develop this control as soon as possible. So we can put data in DetailsList and sort it, filter etc., everything that Fluent UI web control already has, but we need it in Blazor WASM.

Maybe this will be the biggest and most complex control of having in FATS-Blazor , (due to futures) but this is what is needed and commonly used.

Data-binding with Checked in FluentCheckbox and FluentSwitch doesn't work.

I assumed that you could do a two-way binding to the Checked property (@bind-Checked) in FluentCheckbox and FluentSwitch. That seemed the most logical - but it did not work. So I tried @bind-Value instead, and then all good.

What is the reason for this? Is it just because of the shared base using Value instead.

docs: fix instructions to differentiate between Blazor Server and Blazor WASM in the setup instructions.

🙋 Documentation Request

On this page https://github.com/microsoft/fast-blazor in the Getting started section it provides the following instructions:

Next, add a script tag to your index or main layout to reference the web components:

This is only correct for Blazor WASM projects. Blazor Server projects use a Blazor Component for the Index and MainLayout portions. Script tags aren't allowed there.

💁 Possible Solution

Differentiate between the two types of Blazor projects and provide an additional instruction to place the script tag in the _Host.cshtml file.

FluentNumberField not working in WASM

🐛 Bug Report

I have a wasm project where I am testing fast-blazor components. The page breaks when containing FluentNumberField component.

💻 Repro or Code Sample

I have copied the code from the data grid example

<h2>Grid with RowItemTemplate</h2>
<Microsoft.Fast.Components.FluentUI.FluentDataGrid id="defaultGrid3" RowsData=RowsGrid1 ColumnDefinitions=ColumnsGrid1 GridTemplateColumns="1fr 1fr">
    <RowItemTemplate>
        <Microsoft.Fast.Components.FluentUI.FluentDataGridRow TItem=SampleGrid1Data>
            <Microsoft.Fast.Components.FluentUI.FluentDataGridCell GridColumn=1>
                <Microsoft.Fast.Components.FluentUI.FluentTextField @[email protected]></Microsoft.Fast.Components.FluentUI.FluentTextField>
            </Microsoft.Fast.Components.FluentUI.FluentDataGridCell>
             <Microsoft.Fast.Components.FluentUI.FluentDataGridCell GridColumn=2>
                <Microsoft.Fast.Components.FluentUI.FluentNumberField @[email protected]></Microsoft.Fast.Components.FluentUI.FluentNumberField>
            </Microsoft.Fast.Components.FluentUI.FluentDataGridCell>           

        </Microsoft.Fast.Components.FluentUI.FluentDataGridRow>
    </RowItemTemplate>
</Microsoft.Fast.Components.FluentUI.FluentDataGrid>

🤔 Expected Behavior

I should be able to display the value and change it.

😯 Current Behavior

The column is not showing,
It breaks with the error message: crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: no idea on how to unbox value types
Error: no idea on how to unbox value types

💁 Possible Solution

I do not have a suggestion how to fix it.

🔦 Context

We are testing this nuget package with the intention to change our frontend application to use it.

🌍 Your Environment

I am working on Windows 10 PC.
The browser I am using is Microsoft Edge Version 94.0.992.38.
The nuget package version I am using is 0.4.0.
The project is net5.0 blazor Wasm.

Update naming

Update names across the project

  1. Component library to be named "Microsoft.Fast.Components.FluentUI"
  2. Project to be named "FAST Blazor"
  3. Update all aspects throughout the project.

feat: Missing lot of components from Fluent UI

🙋 Feature Request

Hi! So this "fast.design" is more of a generic frontend web framework, which also includes some components from Fluent UI?
I'm having problems understanding the difference between fast.design and fluent UI.

https://developer.microsoft.com/en-us/fluentui#/

I noticed in the examples, a lot of components are missing in fast.design, for instance, Avatar component, Rating, Command Bar, Ribbon Menu, etc. So I don't know what are we supposed to do with those components? I am using "BlazorFluentUI" and it does work quite well (although it has bugs), with all controls from Fluent UI supported, but I would really prefer to go with the official MS framework.

Can we expect to have additional (all!) components in the future, or shall we treat fast.design framework as something not entirely focused on the Fluent UI (more like a separate, generic "one size fits them all" framework)?

Thank you.

feat: add support for netstandard2.1

🙋 Feature Request

we are building a blazor wasm app in netcore31 and are interested in fast-blazor that is currently targeted net50. I made a fork that compiles and targets the earlier framework, but when I run it, it silently fails to render the controls, and messes up the page layout. I'm not sure its worth the trouble to support this edge-case, but we should would appreciate it.

🤔 Expected Behavior

support for netsttandard2.1 WASM net core 3.1 would be exactly like net50 support

😯 Current Behavior

The controls don't render with style applied and the page payout gets borked. (see image in comments below)

💁 Possible Solution

check out my fork and see that simply downgrading the framework is not enough. to get it to render. I've added a new sample to this fork as well.

🔦 Context

We are looking at white-label solutions for our apps and think building fast design systems might be a good solution.

💻 Examples

see image in Comments

feat: add automated publishing with Beachball for package versions

🙋 Feature Request

Packages should be automated, generate release changelogs, and publish with auto bumping.

🤔 Expected Behavior

Improved publishing autonomy.

😯 Current Behavior

N/A

💁 Possible Solution

Beachball could be used and would be consistent with other FAST repositories.

🔦 Context

💻 Examples

fix: Invalid JS call result type '3' in pageload

🐛 Bug Report

Blazor Page does not load after updating to version 0.5.0 in Blazor WASM

💻 Repro or Code Sample

Create new project, add the repo version 0.5.0 via NuGet and add the javascript snippet in index.html. Fluent components not yet used, only installed the package

🤔 Expected Behavior

Running the application should open the page

😯 Current Behavior

Page does not load. Instead, the console output says:
blazor.webassembly.js:1 Uncaught (in promise) Error: Invalid JS call result type '3'.
at _ (blazor.webassembly.js:1)
at blazor.webassembly.js:1

💁 Possible Solution

🔦 Context

🌍 Your Environment

  • OS & Device: Windows
  • Browser Microsoft Edge, Google Chrome
  • .NET 6 preview and FAST Version 0.5.0

feat: improve `FluentDesignSystemProvider` interface

🙋 Feature Request

The FluentDesignSystemProvider should express the attributes available to the component (enumerated here) as component parameters.

Doing so makes the component more idiomatic and allows feature-discovery via intellisense for developers. As-is, developers must be aware of the HTML attributes used by the web-component to use the DesignSystemProvider features.

💻 Examples

<FluentDesignSystemProvider
    Density=1 
    ControlCornerRadius=4
>
    // ...
</FluentDesignSystemProvider>

fix: rows attribute in all textArea controls

🐛 Bug Report

None of the text-area controls; fast-text-area, fluent-text-area, FluentTextArea honor the rows attribute.

💻 Repro or Code Sample

Use your own code or try the online version here: https://explore.fast.design/components/fast-text-area. Change the value of the row attribute to anything you like.

🤔 Expected Behavior

The size of the TextArea changes in response to the value of the rows attribute.

😯 Current Behavior

Absolutely nothing.

🔦 Context

Trying to set up a text area to hold the response containing a large amount of text from a rest call. Unless, until this gets fixed I'll have to try CSS styles (hopefully it will work).

🌍 Your Environment

Windows 10 Pro x64
All Browsers; Firefox, Chrome, Vivaldi, Brave, Edge.
.Net 5, Microsoft.Fast.Components.FluentUI 0.3.0
JetBrains Rider 2021.2
Microsoft Visual Studio 2019 Pro.
Blazor Server

Radio Group sample page in FluentUIServerSample app is broken

Repro steps:

  • Run the FluentUIServerSample
  • Click on Web components
  • Click on the Radio Group link

Error in the browser console:

blazor.server.js:21 [2021-05-06T05:40:30.692Z] Error: System.InvalidOperationException: Unable to set property 'required' on object of type 'Microsoft.Fast.Components.FluentUI.FluentRadioGroup'. The error was: Unable to cast object of type 'System.String' to type 'System.Nullable`1[System.Boolean]'.
 ---> System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Nullable`1[System.Boolean]'.
   at Microsoft.AspNetCore.Components.Reflection.PropertySetter.CallPropertySetter[TTarget,TValue](Action`2 setter, Object target, Object value)
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.<SetProperties>g__SetProperty|2_0(Object target, PropertySetter writer, String parameterName, Object value)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.<SetProperties>g__SetProperty|2_0(Object target, PropertySetter writer, String parameterName, Object value)
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.SetProperties(ParameterView& parameters, Object target)
   at Microsoft.Fast.Components.FluentUI.FluentInputBase`1.SetParametersAsync(ParameterView parameters) in C:\Users\daroth\Documents\GitHub\microsoft\fast-blazor\src\Microsoft.Fast.Components.FluentUI\FluentInputBase.cs:line 140
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange`1 oldTree, ArrayRange`1 newTree)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.