npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jitz-office-fabric-sharepoint-react-controls

v2.0.69

Published

Office Fabric UI React Controls extended to work on SharePoint Add-In and SPFx

Downloads

88

Readme

JitzOfficeFabricSharePointReactControls

Office fabric UI React controls for SharePoint Framework(SPFx) extended to connect to SharePoint

Getting Started

The package depends on the packages generated by Yoeman generator for SPFx template

Prerequisites

Create the SPFx project according to Microsoft's documentation

How to use

Install the package using the command below

npm i jitz-office-fabric-sharepoint-react-controls

Import the package in your React component

import {JitzPeoplePicker} from 'jitz-office-fabric-sharepoint-react-controls/lib/controls/JitzPeoplePicker';
import {JitzDatePicker} from 'jitz-office-fabric-sharepoint-react-controls/lib/controls/JitzDatePicker';
import { JitzGrid } from 'jitz-office-fabric-sharepoint-react-controls/lib/controls/JitzGrid';

People picker usage

<JitzPeoplePicker description={""} spHttpClient={this.props.context.spHttpClient}
       siteUrl={this.props.context.pageContext.site.absoluteUrl} typePicker={"Normal"} 
       errorMessage={this.state.errorMessage}
       principalTypeUser={true} principalTypeSharePointGroup={false}   
       disabled={false}                                             
       principalTypeSecurityGroup={false}
       multiSelect={false}
       principalTypeDistributionList={false} 
       onChange={ (vals) => this.changeEvent(vals)} 
       numberOfItems={10} 
       prePopulatedItems={[this.state.arrayOfLoginNames]} 
       >
</JitzPeoplePicker>

Date Picker Usage

<JitzDatePicker value={session.startDate}     
disabled={false}                                                           
onSelectDate={(date)=>{this.sessionProperty<Date>(date,"startDate",index);}} /> 

Grid Usage

<JitzGrid key='Title' items={this.state.items} 
    renderCustomColumns={(fieldContent,fieldName)=>{ return this.renderCustomColumns(fieldContent,fieldName);}}
    modifyColumns={(col)=>{return this.modifyColumns(col);}}
    onItemSelect={(items)=>{this.setSelectedItems(items);}} 
    onItemInvoked={(item,index)=>{this.itemInvoked(item,index);}}/>

    renderCustomColumns=(fieldContent:any,fieldName:string)=>{
              if(fieldName === 'date'){     
                    return <span>{this.formatDate(fieldContent)}</span>;
                }
              else {
                  return <span>{fieldContent}</span>;
                }
        }
    
    modifyColumns = (columns: IColumn[]) =>{
           columns.map((column,index)=>{
              switch(column.key){
                  case "fieldName":{
                      column.name = "Coulmn Name";
                      break;
                  }
                  default:{
                      break;
                  }
              }
           });
           return columns;
         }
    
    setSelectedItems = (items:IGridItem[])=>{
             if(items.length> 0){
                 this.setState({selectedItemId:items[0].id});
             }
             else{
                 this.setState({selectedItemId:undefined});
             }
           }

    itemInvoked = (item:any, index:number|undefined) => {
            this.setState({selectedItemId:item.id});
         }

Keywords

SPFx Office Fabric UI React SharePoint