Merge pull request #1174 from muges01/upgrade-react-modern-charts

Upgrade react modern charts
This commit is contained in:
Hugo Bernier 2020-04-06 11:06:58 -04:00 committed by GitHub
commit e4e1a044b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 10281 additions and 10235 deletions

View File

@ -1,8 +1,13 @@
{
"@microsoft/generator-sharepoint": {
"libraryName": "modern-charts",
"framework": "react",
"version": "1.0.0",
"framework": "",
"version": "1.10.0",
"componentType": "webpart",
"isDomainIsolated": false,
"isCreatingSolution": true,
"environment": "spo",
"packageManager": "npm",
"libraryId": "f8a78a9a-a93e-4843-89e5-7b871d9b9fa2"
}
}

View File

@ -49,7 +49,7 @@ Built with SharePoint Framework GA, Office Graph, React and Chart.JS
## Used SharePoint Framework Version
![version](https://img.shields.io/badge/version-1.4.1-green.svg)
![version](https://img.shields.io/badge/version-1.10.0-green.svg)
## Applies to
@ -66,6 +66,7 @@ react-modern-charts|Jeremy Coleman (MCP, PC Professional, Inc.)
Version|Date|Comments
-------|----|--------
1.0.0.2|February 09, 2020| Upgrade to SPFx 1.10.0
1.0.0.1|April 25, 2018|Update to SPFx 1.4.1
1.0.0.0|February 11, 2017|Initial release

View File

@ -1,5 +1,5 @@
{
"$schema": "https://dev.office.com/json-schemas/spfx-build/config.2.0.schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": {
"modern-charts-bundle": {

View File

@ -1,4 +1,4 @@
{
"$schema": "https://dev.office.com/json-schemas/spfx-build/copy-assets.schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json",
"deployCdnPath": "temp/deploy"
}

View File

@ -1,5 +1,5 @@
{
"$schema": "https://dev.office.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./temp/deploy/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "modern-charts",

View File

@ -1,9 +1,11 @@
{
"$schema": "https://dev.office.com/json-schemas/spfx-build/package-solution.schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "modern-charts-client-side-solution",
"id": "f8a78a9a-a93e-4843-89e5-7b871d9b9fa2",
"version": "1.0.0.1"
"version": "1.0.0.2",
"isDomainIsolated": false,
"includeClientSideAssets": true
},
"paths": {
"zippedPackage": "solution/modern-charts.sppkg"

View File

@ -1,5 +1,5 @@
{
"$schema": "https://dev.office.com/json-schemas/core-build/serve.schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
"port": 4321,
"initialPage": "https://localhost:5432/workbench",
"https": true,

View File

@ -1,4 +1,4 @@
{
"$schema": "https://dev.office.com/json-schemas/spfx-build/write-manifests.schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json",
"cdnBasePath": "<!-- PATH TO CDN -->"
}

File diff suppressed because it is too large Load Diff

View File

@ -2,33 +2,41 @@
"name": "modern-charts",
"version": "0.0.1",
"private": true,
"main": "lib/index.js",
"engines": {
"node": ">=0.10.0"
},
"dependencies": {
"@microsoft/sp-core-library": "~1.4.1",
"@microsoft/sp-webpart-base": "~1.4.1",
"@microsoft/sp-office-ui-fabric-core": "~1.4.1",
"@microsoft/sp-core-library": "1.10.0",
"@microsoft/sp-office-ui-fabric-core": "1.10.0",
"@microsoft/sp-property-pane": "1.10.0",
"@microsoft/sp-webpart-base": "1.10.0",
"@types/chart.js": "0.0.14",
"@types/react": "0.14.46",
"@types/react-addons-shallow-compare": "0.14.17",
"@types/react-addons-test-utils": "0.14.15",
"@types/react-addons-update": "0.14.14",
"@types/react-dom": "0.14.18",
"@types/webpack-env": ">=1.12.1 <1.14.0",
"chart.js": "^2.5.0",
"@types/es6-promise": "0.0.33",
"@types/react": "16.8.8",
"@types/react-dom": "16.8.3",
"@types/webpack-env": "1.13.1",
"chart.js": "^2.9.3",
"color-scheme": "0.0.5",
"react": "15.4.2",
"office-ui-fabric-react": "6.189.2",
"react": "16.8.5",
"react-chartjs-2": "^2.0.5",
"react-dom": "15.4.2"
"react-dom": "16.8.5"
},
"resolutions": {
"@types/react": "16.8.8"
},
"devDependencies": {
"@microsoft/sp-build-web": "~1.4.1",
"@microsoft/sp-module-interfaces": "~1.4.1",
"@microsoft/sp-webpart-workbench": "~1.4.1",
"@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.10.0",
"@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0",
"@types/chai": "3.4.34",
"@types/mocha": "2.2.38",
"ajv": "5.2.2",
"gulp": "~3.9.1",
"@types/chai": ">=3.4.34 <3.6.0",
"@types/mocha": ">=2.2.33 <2.6.0"
"tslint-microsoft-contrib": "5.0.0"
},
"scripts": {
"build": "gulp bundle",

View File

@ -0,0 +1 @@
// A file is required to be in the root of the /src directory by the TypeScript compiler

View File

@ -1,17 +1,26 @@
{
"$schema": "../../../node_modules/@microsoft/sp-module-interfaces/lib/manifestSchemas/jsonSchemas/clientSideComponentManifestSchema.json",
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
"id": "50dbeca0-48ed-4459-800f-b75b13159b21",
"alias": "ModernChartsWebPart",
"componentType": "WebPart",
"version": "0.0.1",
"version": "*",
"manifestVersion": 2,
"preconfiguredEntries": [{
"safeWithCustomScriptDisabled": false,
"supportedHosts": [
"SharePointWebPart"
],
"preconfiguredEntries": [
{
"groupId": "50dbeca0-48ed-4459-800f-b75b13159b21",
"group": { "default": "Modern Web Parts" },
"title": { "default": "ModernCharts" },
"description": { "default": "Modern Charts Sample" },
"group": {
"default": "Modern Web Parts"
},
"title": {
"default": "ModernCharts"
},
"description": {
"default": "Modern Charts Sample"
},
"officeFabricIconFontName": "Chart",
"properties": {
"description": "ModernCharts",
@ -20,5 +29,6 @@
"maxResults": 25,
"listOptions": []
}
}]
}
]
}

View File

@ -1,16 +1,15 @@
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library';
import { BaseClientSideWebPart, IWebPartContext } from "@microsoft/sp-webpart-base";
import {
BaseClientSideWebPart,
IPropertyPaneConfiguration,
PropertyPaneTextField,
IWebPartContext,
PropertyPaneSlider,
PropertyPaneDropdown,
PropertyPaneButton,
IPropertyPaneDropdownOption,
PropertyPaneButton
} from '@microsoft/sp-webpart-base';
PropertyPaneDropdown,
PropertyPaneSlider,
PropertyPaneTextField
} from "@microsoft/sp-property-pane";
import * as strings from 'modernChartsStrings';
import ModernCharts from './components/ModernCharts';
import { IModernChartsProps } from './IModernChartsWebPartProps';
@ -48,24 +47,24 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
private _columnOptions: IPropertyPaneDropdownOption[] = [];
private _ListColumnOptions: Array<IPropertyPaneDropdownOption> = [];
private _chartSizeOptions: IPropertyPaneDropdownOption[] = [
{key: 3, text:'Small'},
{key: 6, text:'Medium'},
{key: 9, text: 'Medium-Large'},
{key: 12, text: 'Large'}
{ key: 3, text: 'Small' },
{ key: 6, text: 'Medium' },
{ key: 9, text: 'Medium-Large' },
{ key: 12, text: 'Large' }
];
private _chartTypeOptions: IPropertyPaneDropdownOption[] = [
{key: 'bar', text:'Bar'},
{key: 'horizontalbar', text:'Horizontal Bar'},
{key: 'doughnut', text: 'Doughnut'},
{key: 'line', text: 'Line'},
{key: 'pie', text: 'Pie'},
{key: 'polar', text:'Polar'},
{key: 'radar', text:'Radar'}
{ key: 'bar', text: 'Bar' },
{ key: 'horizontalbar', text: 'Horizontal Bar' },
{ key: 'doughnut', text: 'Doughnut' },
{ key: 'line', text: 'Line' },
{ key: 'pie', text: 'Pie' },
{ key: 'polar', text: 'Polar' },
{ key: 'radar', text: 'Radar' }
];
private _chartColActions: IPropertyPaneDropdownOption[] = [
{key: 'average', text: 'Average'},
{key: 'count', text: 'Count'},
{key: 'sum', text: 'Sum'}
{ key: 'average', text: 'Average' },
{ key: 'count', text: 'Count' },
{ key: 'sum', text: 'Sum' }
];
public constructor(context: IWebPartContext) {
@ -116,7 +115,7 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
public render(): void {
//Initialize first demo chart
if (!this.properties.state){
if (!this.properties.state) {
this.properties.state = true;
this.properties.firstLoad = true;
this.properties.numCharts = 1;
@ -131,27 +130,28 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
return Version.parse('1.0');
}
private getChartData(): void{
private getChartData(): void {
const _chartData: Array<MChart> = [];
var _count = 0;
this.properties.chartConfig.forEach((cfg,i) => {
if (cfg.list != null){
this.properties.chartConfig.forEach((cfg, i) => {
if (cfg.list != null) {
this.getData(cfg).then((response) => {
const chart = this.calculateData(response.value, cfg);
const _chart: MChart = {data:chart['data'],labels:chart['labels'],config:cfg,key: i};
const _chart: MChart = { data: chart['data'], labels: chart['labels'], config: cfg, key: i };
_chartData[i] = _chart;
if (++_count == this.properties.chartConfig.length){ this.getCharts(_chartData); }
if (++_count == this.properties.chartConfig.length) { this.getCharts(_chartData); }
});
} else {
const _chart: MChart = {data:ChartOptions._sampleData,labels:ChartOptions._sampleCols,config:cfg,key: i};
const _chart: MChart = { data: ChartOptions._sampleData, labels: ChartOptions._sampleCols, config: cfg, key: i };
_chartData[i] = _chart;
if (++_count == this.properties.chartConfig.length){ this.getCharts(_chartData); }
if (++_count == this.properties.chartConfig.length) { this.getCharts(_chartData); }
}
});
}
private getCharts(charts: Array<MChart>): void{
const chartArea: React.ReactElement<IModernChartsProps> = React.createElement(ModernCharts,{
private getCharts(charts: Array<MChart>): void {
const chartArea: React.ReactElement<IModernChartsProps> = React.createElement(
ModernCharts, {
description: this.properties.description,
title: this.properties.description,
state: this.properties.state,
@ -160,28 +160,28 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
data: {},
charts: charts
});
ReactDom.render(chartArea,this.domElement);
ReactDom.render(chartArea, this.domElement);
}
private calculateData(data: Array<Object>,config:ChartConfiguration): Object {
private calculateData(data: Array<Object>, config: ChartConfiguration): Object {
var values: Array<number> = [];
var labels: Object = this.getUnique(data, config);
var dataVal: Array<Array<any>> = this.getValues(data,labels['unique'],config);
var dataVal: Array<Array<any>> = this.getValues(data, labels['unique'], config);
switch(config.act) {
switch (config.act) {
case 'sum':
dataVal.forEach((vals,i) => {
dataVal.forEach((vals, i) => {
values[i] = 0;
vals.forEach((val) => {
values[i]+=parseFloat(val);
values[i] += parseFloat(val);
});
});
break;
case 'average':
dataVal.forEach((vals,i) => {
dataVal.forEach((vals, i) => {
values[i] = 0;
vals.forEach((val) => {
values[i]+=parseFloat(val);
values[i] += parseFloat(val);
});
if (values[i] != 0) {
values[i] = values[i] / vals.length;
@ -194,16 +194,16 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
});
break;
default:
values = [100,250,90,300];
values = [100, 250, 90, 300];
break;
}
return { data:values, labels:labels['labels'] };
return { data: values, labels: labels['labels'] };
}
private getUnique(data: Array<Object>,config:ChartConfiguration): Object {
const chLabels: Object = { unique:[], labels:[] };
private getUnique(data: Array<Object>, config: ChartConfiguration): Object {
const chLabels: Object = { unique: [], labels: [] };
data.forEach((item) => {
if (chLabels['unique'].indexOf(item[config.unique]) == -1 && item[config.unique] != null && item[config.unique] != ""){
if (chLabels['unique'].indexOf(item[config.unique]) == -1 && item[config.unique] != null && item[config.unique] != "") {
chLabels['unique'].push(item[config.unique]);
chLabels['labels'].push(item[config.col1]);
}
@ -211,15 +211,15 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
return chLabels;
}
private getValues(data: Array<Object>,unique: Array<string>, config: ChartConfiguration): Array<Array<any>>{
private getValues(data: Array<Object>, unique: Array<string>, config: ChartConfiguration): Array<Array<any>> {
const values: Object = {};
const vals: Array<Array<any>> = [[]];
unique.forEach((col,i) => {
unique.forEach((col, i) => {
values[col] = [];
vals[i] = [];
data.forEach((item, _i) => {
if (item[config.unique] == col){
if (item[config.unique] == col) {
vals[i].push(item[config.col2]);
}
});
@ -232,7 +232,7 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
var pPathInd = propertyPath[12];
if (pPath === 'numCharts' && oldValue != newValue) {
if (this.properties.chartConfig.length < newValue){
if (this.properties.chartConfig.length < newValue) {
while (this.properties.chartConfig.length < newValue) {
this.properties.chartConfig.push(this.defaultChartConfig('Chart Description'));
}
@ -244,28 +244,28 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
}
if (propertyPath.indexOf('[') != -1) {
pPath = propertyPath.substring(16).replace('\"]','');
pPath = propertyPath.substring(16).replace('\"]', '');
}
if (pPath === 'url' && newValue == 'other' && (oldValue != newValue)){
if (pPath === 'url' && newValue == 'other' && (oldValue != newValue)) {
this.urlTextDisabled = false;
this.properties.chartConfig[pPathInd].dataUrlDisabled = false;
this.properties.chartConfig[pPathInd].dataurl = oldValue;
}
if (pPath === 'url' && newValue != 'other' && (oldValue != newValue)){
if (pPath === 'url' && newValue != 'other' && (oldValue != newValue)) {
this.properties.chartConfig[pPathInd].dataurl = newValue;
this.properties.chartConfig[pPathInd].dataUrlDisabled = true;
}
if ( (pPath === 'url' && (newValue != oldValue)) || (pPath === 'dataurl' && (newValue != oldValue)) ){
this._updateListTitles(newValue,this.properties.chartConfig[pPathInd]);
if ((pPath === 'url' && (newValue != oldValue)) || (pPath === 'dataurl' && (newValue != oldValue))) {
this._updateListTitles(newValue, this.properties.chartConfig[pPathInd]);
this.properties.chartConfig[pPathInd]['other'] = true;
this.properties.state = true;
}
if (pPath === 'list' && (newValue != oldValue)){
if (pPath === 'list' && (newValue != oldValue)) {
var siteUrl = this.properties.chartConfig[pPathInd]['dataurl'];
this._updateListColumns(siteUrl,newValue,this.properties.chartConfig[pPathInd]);
this._updateListColumns(siteUrl, newValue, this.properties.chartConfig[pPathInd]);
this.properties.chartConfig[pPathInd].colsDisabled = false;
}
if (pPath === 'theme' && (newValue != oldValue)){
if (pPath === 'theme' && (newValue != oldValue)) {
const newTheme = ChartOptions.RandomColors();
this.properties.chartConfig[pPathInd].bgColors = newTheme['bgColors'];
this.properties.chartConfig[pPathInd].hoverColors = newTheme['hoverColors'];
@ -276,7 +276,7 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
protected onPropertyPaneConfigurationStart(): void {
if (this.properties.firstLoad || this.properties.chartConfig[0].columns.length <= 0 || this.properties.chartConfig[0].list.length <= 0){
if (this.properties.firstLoad || this.properties.chartConfig[0].columns.length <= 0 || this.properties.chartConfig[0].list.length <= 0) {
this.context.statusRenderer.displayLoadingIndicator(this.domElement, 'First Time Configuration');
this.properties.firstLoad = false;
@ -285,11 +285,11 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
this._getSites(response0['Url'])
.then((response) => {
var sites: IPropertyPaneDropdownOption[] = [];
sites.push({key:this.context.pageContext.web.absoluteUrl, text:'This Site'});
sites.push({key:'other', text:'Other Site (Specify Url)'});
sites.push({ key: this.context.pageContext.web.absoluteUrl, text: 'This Site' });
sites.push({ key: 'other', text: 'Other Site (Specify Url)' });
for (var _key in response.value) {
if (this.context.pageContext.web.absoluteUrl != response.value[_key]['Url']){
sites.push({key: response.value[_key]['Url'], text: response.value[_key]['Title']});
if (this.context.pageContext.web.absoluteUrl != response.value[_key]['Url']) {
sites.push({ key: response.value[_key]['Url'], text: response.value[_key]['Title'] });
}
}
this._siteOptions = sites;
@ -304,11 +304,11 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
};
});
this.properties.chartConfig[0].lists = this.properties.listOptions;
this._getListColumns(this.properties.chartConfig[0].list,this.properties.chartConfig[0].url)
this._getListColumns(this.properties.chartConfig[0].list, this.properties.chartConfig[0].url)
.then((response3) => {
var col: IPropertyPaneDropdownOption[] = [];
for (var __key in response3.value) {
col.push({key: response3.value[__key]['InternalName'], text: response3.value[__key]['Title']});
col.push({ key: response3.value[__key]['InternalName'], text: response3.value[__key]['Title'] });
}
this._columnOptions = col;
this.colsDisabled = false;
@ -351,7 +351,7 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
columnPropertyOptions.push(
{
groupName: "Chart " + (_i + 1) + " Configuration",
groupFields:[
groupFields: [
PropertyPaneTextField('chartConfig[' + _i + ']["title"]', {
label: "Chart Title"
}),
@ -423,7 +423,7 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
};
}
protected onPropertyPaneConfigurationComplete(){
protected onPropertyPaneConfigurationComplete() {
this.render();
}
@ -449,48 +449,48 @@ export default class ModernChartsWebPart extends BaseClientSideWebPart<IModernCh
});
}
private _getListColumns(listName: string,listsite: string): Promise<any> {
private _getListColumns(listName: string, listsite: string): Promise<any> {
return this.context.spHttpClient.get(listsite + `/_api/web/lists/GetByTitle('${listName}')/Fields?$filter=Hidden eq false and ReadOnlyField eq false and TypeAsString ne 'User' and TypeAsString ne 'Lookup'`, SPHttpClient.configurations.v1)
.then((response: SPHttpClientResponse) => {
return response.json();
});
}
public getData(chartConfig: Object){
public getData(chartConfig: Object) {
return this.context.spHttpClient.get(chartConfig['dataurl'] + `/_api/web/lists/GetByTitle(\'${chartConfig['list']}\')/items?$orderby=Id desc&$limit=10&$top=${this.properties.maxResults}`, SPHttpClient.configurations.v1)
.then((response: SPHttpClientResponse) => {
return response.json();
});
}
private _updateListTitles(siteUrl: string,_chartConfig: ChartConfiguration): void {
private _updateListTitles(siteUrl: string, _chartConfig: ChartConfiguration): void {
this._getListTitles(siteUrl).then((response) => {
var respLists: IPropertyPaneDropdownOption[] = [];
for (var _key in response.value) {
respLists.push({key: response.value[_key]['Title'], text: response.value[_key]['Title']});
respLists.push({ key: response.value[_key]['Title'], text: response.value[_key]['Title'] });
}
this._dropdownOptions = respLists;
_chartConfig.lists = respLists;
this.context.propertyPane.refresh();
}).catch((err) => {
this.context.statusRenderer.clearLoadingIndicator(this.domElement);
this.context.statusRenderer.renderError(this.domElement,"There was an error loading your list, please verify the selected list has Calendar Events or choose a new list.");
this.context.statusRenderer.renderError(this.domElement, "There was an error loading your list, please verify the selected list has Calendar Events or choose a new list.");
});
}
private _updateListColumns(siteUrl: string, listName: string, _chartConfig: ChartConfiguration): void {
this._getListColumns(listName,siteUrl).then((response) => {
this._getListColumns(listName, siteUrl).then((response) => {
var respLists: IPropertyPaneDropdownOption[] = [];
console.log(response.value);
for (var _key in response.value) {
respLists.push({key: response.value[_key]['InternalName'], text: response.value[_key]['Title']});
respLists.push({ key: response.value[_key]['InternalName'], text: response.value[_key]['Title'] });
}
this._columnOptions = respLists;
_chartConfig.columns = respLists;
this.context.propertyPane.refresh();
}).catch((err) => {
this.context.statusRenderer.clearLoadingIndicator(this.domElement);
this.context.statusRenderer.renderError(this.domElement,"There was an error loading your list, please verify the selected list has Calendar Events or choose a new list.");
this.context.statusRenderer.renderError(this.domElement, "There was an error loading your list, please verify the selected list has Calendar Events or choose a new list.");
});
}

View File

@ -1,3 +1,5 @@
@import '~office-ui-fabric-react/dist/sass/References.scss';
.charts {
.container {
max-width: 700px;

View File

@ -19,17 +19,17 @@ import {
IDocumentCardPreviewProps
} from 'office-ui-fabric-react/lib/DocumentCard';
export default class ModernCharts extends React.Component<IModernChartsProps, void> {
export default class ModernCharts extends React.Component<IModernChartsProps, {}> {
public render(): JSX.Element {
const charts: JSX.Element[] = this.props.charts.map((chart: MChart, i: number) => {
return (
<DocumentCard onClickHref='#' className={styles.docContainer + ' ms-Grid-col ms-u-sm12 ms-u-md12 ms-u-lg' + chart.config.size} key={chart.key}>
<div className={styles.chartCard}>
{this.chart(ChartOptions.Data(chart),ChartOptions.Options(),chart.config.type)}
{this.chart(ChartOptions.Data(chart), ChartOptions.Options(), chart.config.type)}
</div>
<DocumentCardLocation location={chart.config.description}/>
<DocumentCardTitle title={chart.config.title}/>
<DocumentCardLocation location={chart.config.description} />
<DocumentCardTitle title={chart.config.title} />
</DocumentCard>
);
});
@ -39,7 +39,7 @@ export default class ModernCharts extends React.Component<IModernChartsProps, vo
<div className={'ms-Grid-row'}>
{charts}
</div>
<div style={{clear: 'both'}}/>
<div style={{ clear: 'both' }} />
</div>
);

View File

@ -0,0 +1,47 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.2/MicrosoftTeams.schema.json",
"manifestVersion": "1.2",
"packageName": "ModernCharts",
"id": "50dbeca0-48ed-4459-800f-b75b13159b21",
"version": "0.1",
"developer": {
"name": "SPFx + Teams Dev",
"websiteUrl": "https://products.office.com/en-us/sharepoint/collaboration",
"privacyUrl": "https://privacy.microsoft.com/en-us/privacystatement",
"termsOfUseUrl": "https://www.microsoft.com/en-us/servicesagreement"
},
"name": {
"short": "ModernCharts"
},
"description": {
"short": "Modern Charts Sample",
"full": "Modern Charts Sample"
},
"icons": {
"outline": "tab20x20.png",
"color": "tab96x96.png"
},
"accentColor": "#004578",
"configurableTabs": [
{
"configurationUrl": "https://{teamSiteDomain}{teamSitePath}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest={teamSitePath}/_layouts/15/teamshostedapp.aspx%3FopenPropertyPane=true%26teams%26componentId=50dbeca0-48ed-4459-800f-b75b13159b21",
"canUpdateConfiguration": true,
"scopes": [
"team"
]
}
],
"validDomains": [
"*.login.microsoftonline.com",
"*.sharepoint.com",
"*.sharepoint-df.com",
"spoppe-a.akamaihd.net",
"spoprod-a.akamaihd.net",
"resourceseng.blob.core.windows.net",
"msft.spoppe.com"
],
"webApplicationInfo": {
"resource": "https://{teamSiteDomain}",
"id": "00000003-0000-0ff1-ce00-000000000000"
}
}

View File

@ -1,13 +1,19 @@
{
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.3/includes/tsconfig-web.json",
"compilerOptions": {
"target": "es5",
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"module": "esnext",
"moduleResolution": "node",
"jsx": "react",
"declaration": true,
"sourceMap": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"inlineSources": false,
"strictNullChecks": false,
"noUnusedLocals": false,
"outDir": "lib",
"typeRoots": [
"./node_modules/@types",
"./node_modules/@microsoft"
@ -21,5 +27,12 @@
"dom",
"es2015.collection"
]
}
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"lib"
]
}

View File

@ -1,3 +1,31 @@
{
"rulesDirectory": "./config"
"rulesDirectory": [],
"extends": "@microsoft/sp-tslint-rules/base-tslint.json",
"rules": {
"class-name": false,
"export-name": false,
"forin": false,
"label-position": false,
"member-access": true,
"no-arg": false,
"no-console": false,
"no-construct": false,
"no-duplicate-variable": true,
"no-eval": false,
"no-function-expression": true,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-unnecessary-semicolons": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-with-statement": true,
"semicolon": true,
"trailing-comma": false,
"typedef": false,
"typedef-whitespace": false,
"use-named-parameter": true,
"variable-name": false,
"whitespace": false
}
}