Giter Club home page Giter Club logo

office-ui-fabric-js's Introduction

Note: Microsoft no longer supports this content and will not be responding to bugs or issues. We recommend that you use the newer version, Office UI Fabric, with React as your front-end framework. If you still need assistance with Fabric.js, visit Stack Overflow/office-ui-fabric.

The JavaScript front-end framework for building experiences for Office and Office 365.

Fabric JS is a JavaScript front-end framework which provides visuals-focused components to extend, re-work and use in your Office and Office 365 experiences. Fabric JS uses styles from the Office UI Fabric Core project. Fabric JS is a collection of responsive, mobile-first styles and tools designed to make it quick and simple for you to create web experiences using the Office Design Language.

Latest version: Fabric JS 1.4.0, which uses Fabric Core 5.0.1.

Contents

What's included

This repository contains simple, visuals-focused components that don't require a framework. For the entire list of components available in Fabric JS, see the component list.

Note: For more information on Office UI Fabric version 2.6.1, which combined Fabric core and Fabric’s components together, see Get started with Fabric 2.6.1.

Get started

For a quick start, you can reference the latest release of Fabric from a CDN or clone and build locally. Once you've got Fabric JS added to your project, look at the component list for documentation pertaining to each available component.

If you'd like to get Fabric through a package manager such as Bower, npm, or NuGet, check out the package manager docs.

Referencing the CDN

Include the following references in the <head> of your page:

<link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.2.0/css/fabric.min.css">
<link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.2.0/css/fabric.components.min.css">
<script src="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.2.0/js/fabric.min.js"></script>

Note: You may notice an additional reference to the Fabric Core. The components of Fabric JS use styles from Fabric Core.

All releases of Fabric JS are available on the CDN, with new versions typically added within a week of the release. To reference a specific version, update the version number in the URL to match the one you want.

If you want to reference previous versions, please see this get started guide (located in the Core repo).

Clone, build, and view the docs

Before you get started, make sure you have node.js, gulp, and git installed. To build Fabric:

  1. Clone the repo
  2. Navigate to the folder that contains the gulpfile.js file (Fabric JS's root).
  3. npm install
  4. gulp watch

The built files will be in the /dist/ folder. You can then add these built files directly to your project.

You can also navigate to http://localhost:2020 to see the local docs site where you can test out the components' responsive behavior and see the samples.

For more information, check out the documentation on building Fabric JS locally.

Learn more

New to Fabric? Although the project's site contains lots of great info about its purpose and what's included, most of Fabric JS's documentation is contained in this repository.

To see a full component list, you can check out the component list here or build the project locally to use the fully interactive docs site.

When you're ready to create an Office Add-in with Fabric, take a look at the Use Office UI Fabric with Office Add-ins on MSDN article.

For more information about the React components, check out the Office UI Fabric React repository.

Trello board

Fabric JS contains a variety of components that are a part of the Office / Office 365 design language. If you're not seeing a component here that you'd like, first check out the Office UI Fabric JS Requests board and upvote it there (if it exists), or file an issue on Fabric JS's issue tracker to kick off a new request.

Contribute to Fabric JS

Bug reports, feature requests, and questions are posted on the issue tracker. For details on our contribution process and how we label issues, see our contributing page.

If you have any style issues - icons, typography, fonts, colors, the grid, etc. - please file them in the Office UI Fabric Core repository.

Licenses

All files in this GitHub repository are subject to the MIT license. This project also references fonts and icons from a CDN, which are subject to a separate asset license.

Changelog

We use GitHub Releases to manage our releases, including the changelog between every release. View a complete list of additions, fixes, and changes since 1.0 on the releases page.


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

office-ui-fabric-js's People

Contributors

andrewconnell avatar aremes avatar atneik avatar brakmic avatar chriswbarrett avatar dammittom avatar ericivarsson avatar estruyf avatar gageames avatar gokunymbus avatar greenkeeperio-bot avatar jahnp avatar jonahkirangi avatar lauragra avatar leddie24 avatar lezamax avatar micahgodbolt avatar michaelmainer avatar philworthington avatar primetss avatar reezaali avatar rickyuu avatar rolandoldengarm avatar s-kainet avatar sebazzz avatar stfbauer avatar wdo3650 avatar wdodx avatar williamado avatar zkoehne 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

office-ui-fabric-js's Issues

CheckBox and ChoiceFieldGroup: Titles and select all options

From @mikewheaton on June 5, 2016 22:5

An accessibility review turned up the following:

Usually a checkbox appears either as a toggle, as part of a "Select items on this list", or contains a Select all option. Both case 2 and 3 are issues customers have repeatedly logged QFEs on so if we can provide proper guidance we can help a lot.

For tying the checkboxes to a title, follow this example:
http://oaa-accessibility.org/example/5/

For tying the "Select items on this list" to checkbox since its something we screwed up in SharePoint before. So basically properly naming the group of checkboxes. Check out the following example, where they use role = group, followed by role = checkbox:
http://oaa-accessibility.org/example/6/

For tying radio buttons, use the following examples:
http://oaa-accessibility.org/example/31/

Copied from original issue: OfficeDev/office-ui-fabric-core#646

Add version number as comment to JS files

From @manndave on July 15, 2016 1:26

The css files have a comment at the top /** * Office UI Fabric 3.0.0 *. Please consider adding this to the JS (and conceivably the hbs, scss and json ) files so that automated tooling can check version numbers. It could be done via a Gulp task to streamline it.

Thanks.

Copied from original issue: OfficeDev/office-ui-fabric-core#725

Callout [2.6.1]: Invalid CSS calc

From @Etheryte on July 13, 2016 14:48

The latest stable release, 2.6.1, has a bug in the Callout component.
Line 280 in Callout.scss:

top: calc('50% - 10px');

Both the line above and the generated CSS (which is identical), are naturally invalid CSS.
The fix would be to remove the unnecessary apostrophe:

top: calc(50% - 10px);

The component isn't unusably broken as a different (static) value is inherited from elsewhere, but it never functions as intended.

Copied from original issue: OfficeDev/office-ui-fabric-core#722

Office theme in Fabric best practice

From @cut2run on July 20, 2016 14:51

Hello,

Would you mind to clarify on best practice to use "Office.context.officeTheme" object to set appropriate theme in the Fabric.

There are 3 Office themes:

  1. Colorful
  2. Dark Gray
  3. White

There are 4 object properties:

  1. bodyBackgroundColor (colorful: e6e6e6; dark: 6a6a6a; white: ffffff)
  2. bodyForegroundColor (colorful: 444444; dark: f0f0f0; white: 444444)
  3. controlBackgroundColor (colorful: fdfdfd; dark: d4d4d4; white: fdfdfd)
  4. controlForegroundColor (colorful: 444444; dark: 262626; white: 444444)

Is there any corresponding CSS classes in Fabric I can use to set those colors/themes? Can I set the theme per page once or I need to set each color for every single control I use on the page? Basically I'd like to know I you have some "Colorful" class corresponding to Office properties or I have to set those colors manually, when retrieved?

This particular way I don't like as I have to take care about every element I use:

`function applyOfficeTheme(){
// Get office theme colors.
var bodyBackgroundColor = Office.context.officeTheme.bodyBackgroundColor;
var bodyForegroundColor = Office.context.officeTheme.bodyForegroundColor;
var controlBackgroundColor = Office.context.officeTheme.controlBackgroundColor
var controlForegroundColor = Office.context.officeTheme.controlForegroundColor;

// Apply body background color to a CSS class.
$('.body').css('background-color', bodyBackgroundColor);

}`

Please let me know.
Thank you.

Copied from original issue: OfficeDev/office-ui-fabric-core#732

Add consistent :focus styling

From @dzearing on February 10, 2016 3:1

To be clear; most of the components in Fabric use a specific blue rectangle around the cell to indicate focus. However many, including Link, Dropdown, ContextualMenu, are missing the blue rectangle and leave it up to the browser to render the default focus styling which looks really bad on Mac in particular. Let's fix this.

Copied from original issue: OfficeDev/office-ui-fabric-core#339

CommandBar: Event handlers lost when moved into overflow

From @MJZawacki on June 24, 2016 22:19

I'm seeing issues in an Office add-in on Mac where the event is not fired when the command is hidden in the overflow menu.

What is the intended way to link up click events so that they work while inside the overflow menu? The element id's from the original ms-CommandBarItem's are not persisted by createMenuItem so it's unclear to me how you intended to hook up the event.

Copied from original issue: OfficeDev/office-ui-fabric-core#691

Question: v3 Snippet Generation

From @manndave on July 14, 2016 20:11

I'm looking at v3 beta 2 to determine how best to generate snippets from the .hbs files in the src folder for each component. I think I've come up with a way to make this work but have a few questions before I go too far.

Will it be a problem for me to:

  • modify the build process and add another gulp task which generates the snippet files?
  • add a new context file (.json) to each component that contains the data necessary for generating the snippets?
  • Add a small amount of Handlebars markup and/or comments to the .hbs files for some components (probably just the more complex ones) to add information necessary for the snippet generation task? In all likelihood, this will mean modifying the existing build task to ignore this information and then the snippet build task will ignore some of the information used by the regular build.

I can develop a POC and provide more information if these are all OK. If these won't be acceptable then I'll try to come up with a different approach, but I'm not sure how that will work out. I spent some time trying to work around these issues already but can't see any way to do so.

The goal is to be able to automatically generate snippet files for VS and VSCode directly from the source files as part of the automated build so they don't have to be created manually.

Please let me know the team's thoughts.

Thanks,

Dave

Copied from original issue: OfficeDev/office-ui-fabric-core#724

@keyframes animation doesn't contain prefixed version

From @s-KaiNet on July 27, 2016 7:49

All CSS3 key frame animation doesn't contain prefix version for Chrome, i.e.
@-webkit-keyframes fadeIn. Chrome still requires prefix according to this.
You have ready to use animation such as .ms-u-fadeIn400 which is prefixed, but sometimes it's useful to create your own using key frame animation name.
For example angular 1.x adds its own classes for animation [class-name]-add, [class-name]-remove, etc. so it's not possible to use classes such as .ms-u-fadeIn400. But it's possible to provide your own animation rule using key frame from fabric.css:

.is-open-add{
    animation: 0.367s cubic-bezier(0.1, 0.9, 0.2, 1) fadeIn, slideRightIn40;
    -webkit-animation: 0.367s cubic-bezier(0.1, 0.9, 0.2, 1) fadeIn, slideRightIn40;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}

But currently this is broken in Chrome because of missing prefix for @keyframe.
Sorry, accidentally mentioned user with name @keyframe :)

Copied from original issue: OfficeDev/office-ui-fabric-core#745

CheckBox and ChoiceFieldGroup: Incorrect state read by JAWS

From @mikewheaton on June 5, 2016 22:3

Here is the bug report:

Navigate to this page: Components/ChoiceField/index.html
Using TAB navigate to the third checkbox
It reads "Checkbox selected, checkboxes unchecked"
It should have read "Checkbox selected, checkbox checked".

Once I pressed spacebar to uncheck and recheck it fixed itself but not on first load.

Same behavior happens for radio buttons

Copied from original issue: OfficeDev/office-ui-fabric-core#645

DropDown: Initialize with a selected option

From @cut2run on February 5, 2016 21:15

Request:
I need to initialize Dropdown control with certain pre-selected value. The control doesn't looks like have documentation on how to properly do that.

Try and fail:

  1. If control initialized first $('.ms-Dropdown').Dropdown(); and after select a value $('#select_language').val('en-us').change(); nothing happen at all from UI point of view. Query back value from select and it will return proper "changed" value.
  2. If set the value first and after initialize control as "Dropdown" the control appear with pre-selected value. This is good sign. When you click on dropdown to see the options, pre-selected option doesn't have "blue" highlights as it happen when you click on the option. Another thing I have to care of double initialization of control and this will lead to remove and re-insert it. This is not good at all.

Suggestion:
Would it be possible to have initialization with a value at any time with some method? At this point I assume control should look exactly the same as it would look when user choose an option from dropdown manually. As such: option preselected and when dropdown open the same option highlighted in the list.

Thanks.

Copied from original issue: OfficeDev/office-ui-fabric-core#321

Callout: Screen reader and keyboard accessibility

From @mikewheaton on June 5, 2016 19:27

A few accessibility issues with the Callout:

  1. When focusing on any of the callout variants, we'd expect the screen reader to automatically start reading its contents but it doesn't. Perhaps we should tag with ARIA Role = dialog or alert so that it does this behavior.
  2. For the callout with the commands, focus is not trapping.
  3. Learn more link default callout is not keyboard tabbable

Copied from original issue: OfficeDev/office-ui-fabric-core#631

Documentation: DatePicker JS has a bug

From @Fensterbank on June 13, 2016 11:59

I implemented DatePicker with your sample code in my application and got an infinite loop when using the month picker to change the selected month.

The problem occured in your example function changeHighlightedDate where the undefined checks don't work.

loop

The picker highlight function was called with two undefined values in the array which resulted in an infinite loop.

Why did you use such unusual undefined checks?
when foo is undefined, typeof(foo) would return a string 'undefined'.
I don't think the typeof function would ever return an empty string.

I would have just used if (newYear == undefined) or if (typeof(newYear) == 'undefined').
Also if (isNaN(newYear)) could be a nice solution to prevent bad parameters for the picker's highlight function.

Copied from original issue: OfficeDev/office-ui-fabric-core#661

NavBar context menu alignment

From @cut2run on February 24, 2016 20:36

When NavBar item ("ms-NavBar-item") has right alignment ("ms-NavBar-item--right") and context menu ("ms-NavBar-item--hasMenu") would it be appropriate to align this context menu to the right? Currently if context menu added its position will start from beginning of the NavBar item and will be out of screen boundaries that produce horizontal scroll bar. You probably can read style of NavBar item and if it has class "ms-NavBar-item--right" add context menu style "right:0px" to make menu appear aligned to the right window boundary. Screenshots before and after as follow ...

image

image

Copied from original issue: OfficeDev/office-ui-fabric-core#384

MessageBanner: Document/implement showing and hiding

From @Rick-Kirkham on June 22, 2016 0:11

The JS version of MessageBanner exposes a hideBanner() method. This is not exposed in the TypeScript verson. As a result the only way that the MessageBanner can be hidden on startup, which is normally what a developer would want, is to add the class "is-hidden" to the

with ms-MessageBanner class. But the MessageBanner.hbs file that is included does NOT do this. Also, there could be scenarios, other than startup, when calling code will need to hide a MessageBanner. I think you just have to change
private _hideBanner():
to
public hideBanner():

Copied from original issue: OfficeDev/office-ui-fabric-core#680

CommandBar:Layout problem

From @brian-ding on June 16, 2016 15:14

i am playing with newly released 3.0.0 beta, it is great that navbar and commandbar are merged into a single component.

i found some html code like this in ./documentation/Components/CommandBar/index.html

         <!-- Overflow Command -->
            <!-- Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. -->
            <div class="ms-CommandButton ms-CommandBar-overflowButton ms-CommandButton--noLabel">
                <button class="ms-CommandButton-button">
                    <span class="ms-CommandButton-icon "><i class="ms-Icon ms-Icon--ellipsis"></i></span><span class="ms-CommandButton-label"></span>
                </button>
                <ul class="ms-ContextualMenu  is-opened ms-ContextualMenu--hasIcons">
                    <li class="ms-ContextualMenu-item ">
                        <a class="ms-ContextualMenu-link " tabindex="1">Folder</a>
                        <i class="ms-Icon ms-Icon--folder "></i>
                    </li>
                    <li class="ms-ContextualMenu-item ms-ContextualMenu-item--divider"></li>
                    <li class="ms-ContextualMenu-item ">
                        <a class="ms-ContextualMenu-link " tabindex="1">Plain Text Document</a>
                        <i class="ms-Icon ms-Icon--document "></i>
                    </li>
                    <li class="ms-ContextualMenu-item ">
                        <a class="ms-ContextualMenu-link " tabindex="1">A Dog</a>
                        <i class="ms-Icon ms-Icon--dogAlt "></i>
                    </li>
                    <li class="ms-ContextualMenu-item ">
                        <a class="ms-ContextualMenu-link " tabindex="1">The Sun</a>
                        <i class="ms-Icon ms-Icon--sun "></i>
                    </li>
                    <li class="ms-ContextualMenu-item ">
                        <a class="ms-ContextualMenu-link " tabindex="1">Money</a>
                        <i class="ms-Icon ms-Icon--money "></i>
                    </li>
                </ul>
            </div>
            <!-- End Overflow Command -->
  1. the weired thing is, if i delete any of those li inside ul label, seems has no effect. Everything is still the way it was. Could anyone help me the logic here?
  2. if i comment out the whole ul section, "..." will always be showing in the commandbar, no matter what size of my browser is
  3. if l leave the code the way it is, in a large screen, everything works fine. but when i adjust browser(Edge) to be a smaller size, click on "..." does popup the list of buttons, but clicking on these buttons has no effect, no navigation, nothing happens

i referen these js files

fabric.js
fabric.templates.js
PickaDate.js

and add the js code like below

 var CommandBarElements = document.querySelectorAll(".ms-CommandBar");
    for (var i = 0; i < CommandBarElements.length; i++) {
        new fabric['CommandBar'](CommandBarElements[i]);
    }

Any help is appreciated, thank you!

Copied from original issue: OfficeDev/office-ui-fabric-core#668

Question: Best practice for a ContextualMenu used for filtering and sorting?

From @schott12521 on July 27, 2016 15:21

I'm trying to make a ContextualMenu for filtering and sorting lists and tables and such, and I'm wondering what the best way to achieve something like the menu used in Office 365's Outlook app, seen here: contextualmenu

It seems that all the ContextualMenu javascript doesn't do that much, and if I have the ContextualMenu inside a CommandBar or NavBar, then I can't have submenus and the is-selected doesn't persist, it only can take me to an href. Any suggestions would be awesome, thanks.

Copied from original issue: OfficeDev/office-ui-fabric-core#746

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.