@valo/extensibility
Advanced tools
Comparing version 1.1.0-fb910911b568fcac90cfc3643002b93a20f19886 to 1.1.1-2642a6cd091ddae98f3bb4818cf76f7280af3fb7
@@ -1,37 +0,17 @@ | ||
import { IPropertyPaneGroup, WebPartContext } from "@microsoft/sp-webpart-base"; | ||
import { ApplicationCustomizerContext } from "@microsoft/sp-application-base"; | ||
import { IBaseDataSourceProvider, PagingType, DataSourceData } from '..'; | ||
export declare abstract class BaseDataSourceProvider implements IBaseDataSourceProvider { | ||
protected ctx: WebPartContext | ApplicationCustomizerContext; | ||
protected properties: any; | ||
protected updateTriggerFnc: () => void; | ||
init(ctx: WebPartContext | ApplicationCustomizerContext, properties: {}, updateTriggerFnc?: () => void): void; | ||
/** | ||
* Retrieves the web part configuration properties | ||
* | ||
* @returns {IPropertyPaneGroup[]} Return the property pane group + fields you want to load in the web part panel. | ||
*/ | ||
import { IBaseDataSourceProvider, IDataSourceData } from '..'; | ||
import { IPagingSettings } from '../models/IPagingSettings'; | ||
import { WebPartContext, IPropertyPaneGroup } from '@microsoft/sp-webpart-base'; | ||
export declare abstract class BaseDataSourceProvider<T> implements IBaseDataSourceProvider<T> { | ||
ctx: WebPartContext | ApplicationCustomizerContext; | ||
properties: T; | ||
updateTriggerFnc: () => void; | ||
init(ctx: WebPartContext | ApplicationCustomizerContext, properties: T, updateTriggerFnc?: () => void): void; | ||
getConfigProperties(): IPropertyPaneGroup[]; | ||
/** | ||
* Returns the data source data | ||
* | ||
* @param {string} lastUpdated Timestamp from when the property pane was last updated | ||
* @returns {any} The data from your data source | ||
*/ | ||
getData(lastUpdated: string): Promise<DataSourceData>; | ||
/** | ||
* Returns the data source data for the current page | ||
* | ||
* @param {number} pageNr The number of the page | ||
* @returns {any} The data from your data source | ||
*/ | ||
getPagedData(pageNr: number): Promise<any>; | ||
/** | ||
* Initializes source properties (your default property values) | ||
*/ | ||
getData(): Promise<IDataSourceData>; | ||
getPagedData(pageNr: number): Promise<IDataSourceData>; | ||
onPropertyUpdate(propertyPath: string, oldValue: any, newValue: any): void; | ||
initProperties(): Promise<void>; | ||
/** | ||
* Initializes the paging option (no paging by default) | ||
*/ | ||
getPagingType(): PagingType; | ||
getPagingSettings(): IPagingSettings; | ||
getPageCount(): number; | ||
} |
@@ -14,17 +14,6 @@ "use strict"; | ||
}; | ||
/** | ||
* Retrieves the web part configuration properties | ||
* | ||
* @returns {IPropertyPaneGroup[]} Return the property pane group + fields you want to load in the web part panel. | ||
*/ | ||
BaseDataSourceProvider.prototype.getConfigProperties = function () { | ||
return []; | ||
}; | ||
/** | ||
* Returns the data source data | ||
* | ||
* @param {string} lastUpdated Timestamp from when the property pane was last updated | ||
* @returns {any} The data from your data source | ||
*/ | ||
BaseDataSourceProvider.prototype.getData = function (lastUpdated) { | ||
BaseDataSourceProvider.prototype.getData = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
@@ -36,8 +25,2 @@ return tslib_1.__generator(this, function (_a) { | ||
}; | ||
/** | ||
* Returns the data source data for the current page | ||
* | ||
* @param {number} pageNr The number of the page | ||
* @returns {any} The data from your data source | ||
*/ | ||
BaseDataSourceProvider.prototype.getPagedData = function (pageNr) { | ||
@@ -50,18 +33,23 @@ return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
}; | ||
/** | ||
* Initializes source properties (your default property values) | ||
*/ | ||
BaseDataSourceProvider.prototype.onPropertyUpdate = function (propertyPath, oldValue, newValue) { | ||
return; | ||
}; | ||
BaseDataSourceProvider.prototype.initProperties = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { | ||
return [2 /*return*/]; | ||
}); }); | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return [2 /*return*/, null]; | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Initializes the paging option (no paging by default) | ||
*/ | ||
BaseDataSourceProvider.prototype.getPagingType = function () { | ||
return __1.PagingType.none; | ||
BaseDataSourceProvider.prototype.getPagingSettings = function () { | ||
return { | ||
pagingOptions: [], | ||
pagingType: __1.PagingType.none | ||
}; | ||
}; | ||
BaseDataSourceProvider.prototype.getPageCount = function () { | ||
return 1; | ||
}; | ||
return BaseDataSourceProvider; | ||
}()); | ||
exports.BaseDataSourceProvider = BaseDataSourceProvider; |
@@ -8,3 +8,4 @@ export declare enum IntranetTrigger { | ||
OpenMultilingualCreationPanel = 6, | ||
OpenSiteCreationPanel = 7 | ||
OpenSiteCreationPanel = 7, | ||
OpenSiteConfigurationPanel = 8 | ||
} |
@@ -12,2 +12,3 @@ "use strict"; | ||
IntranetTrigger[IntranetTrigger["OpenSiteCreationPanel"] = 7] = "OpenSiteCreationPanel"; | ||
IntranetTrigger[IntranetTrigger["OpenSiteConfigurationPanel"] = 8] = "OpenSiteConfigurationPanel"; | ||
})(IntranetTrigger = exports.IntranetTrigger || (exports.IntranetTrigger = {})); |
@@ -5,3 +5,3 @@ import { IBaseDataSourceProvider } from '.'; | ||
name: string; | ||
dataSource: IBaseDataSourceProvider; | ||
dataSource: IBaseDataSourceProvider<any>; | ||
} |
import { IntranetTrigger } from '../enums'; | ||
import { ContextData } from '.'; | ||
export interface ExtensionTrigger { | ||
id: string; | ||
trigger: IntranetTrigger; | ||
invokeTrigger: () => void; | ||
invokeTrigger: (data?: ContextData) => void; | ||
} |
import { WebPartContext, IPropertyPaneGroup } from '@microsoft/sp-webpart-base'; | ||
import { ApplicationCustomizerContext } from '@microsoft/sp-application-base'; | ||
import { PagingType } from '..'; | ||
export interface IBaseDataSourceProvider { | ||
import { IPagingSettings } from './IPagingSettings'; | ||
import { IDataSourceData } from './IDataSourceData'; | ||
export interface IBaseDataSourceProvider<T> { | ||
/** | ||
* Initialize the provider | ||
* | ||
* @param {WebPartContext | ApplicationCustomizerContext} ctx | ||
* @param properties | ||
* @param updateTriggerFnc | ||
* Initializes the data source provider with Web Part context values | ||
* @param ctx the current context | ||
* @param properties the current properties | ||
* @param updateTriggerFnc the update trigger function | ||
*/ | ||
init(ctx: WebPartContext | ApplicationCustomizerContext, properties: {}, updateTriggerFnc?: () => void): any; | ||
init(ctx: WebPartContext | ApplicationCustomizerContext, properties: T, updateTriggerFnc?: () => void): any; | ||
/** | ||
* Retrieves the web part configuration properties | ||
* Retrieves the data source properties to display in the Web Partproperty pane | ||
* | ||
@@ -22,25 +22,38 @@ * @returns {IPropertyPaneGroup[]} Return the property pane group + fields you want to load in the web part panel. | ||
* | ||
* @param {string} lastUpdated Timestamp from when the property pane was last updated | ||
* @returns {any} The data from your data source | ||
* @returns {IDataSourceData} The data from your data source | ||
*/ | ||
getData(dateStamp: string): Promise<any>; | ||
getData(): Promise<IDataSourceData>; | ||
/** | ||
* Returns the data source data for the current page | ||
* | ||
* @param {number} pageNr The number of the page | ||
* @returns {any} The data from your data source | ||
* @param {number} pageNr The page number | ||
* @returns {IDataSourceData} The data from your data source | ||
*/ | ||
getPagedData(pageNr: number): Promise<any>; | ||
getPagedData(pageNr: number): Promise<IDataSourceData>; | ||
/** | ||
* Initializes source properties (your default property values) | ||
* Initializes data source properties (i.e your default property values in the property pane) | ||
*/ | ||
initProperties?(): Promise<void>; | ||
initProperties(): Promise<void>; | ||
/** | ||
* Specifies the paging type (no paging by default). | ||
* Gets the paging settings for your data source | ||
* @returns {IPagingSettings} The paging settings | ||
*/ | ||
getPagingType?(): PagingType; | ||
getPagingSettings(): IPagingSettings; | ||
/** | ||
* Used when the dynamic data type is used | ||
* Returns the current page count for this data source | ||
* @returns {number} The total page count for the current data source results set | ||
*/ | ||
getNumberOfPages?(): number; | ||
getPageCount(): number; | ||
/** | ||
* Initiates the dynamic data | ||
*/ | ||
initDynamicData?(): void; | ||
/** | ||
* Handler when a data source property is updated in the property pane | ||
* Use this method to fetch or refresh data based on the new property values. | ||
* @param propertyPath the property name | ||
* @param oldValue the old value | ||
* @param newValue the new value | ||
*/ | ||
onPropertyUpdate(propertyPath: string, oldValue: any, newValue: any): void; | ||
} |
export * from './DataSource'; | ||
export * from './DataSourceData'; | ||
export * from './IDataSourceData'; | ||
export * from './ExtensibilityWindow'; | ||
@@ -7,2 +7,3 @@ export * from './ExtensionPoint'; | ||
export * from './ExtensionTrigger'; | ||
export * from './ContextData'; | ||
export * from './IBaseDataSourceProvider'; | ||
@@ -15,2 +16,5 @@ export * from './IUserProperties'; | ||
export * from './UnbindedExtensionTrigger'; | ||
export * from './IUserProperties'; | ||
export * from './IBaseDataSourceProvider'; | ||
export * from './IPagingSettings'; | ||
export * from './UnbindedTriggerDefer'; |
@@ -8,3 +8,3 @@ import { ExtensionProvider, IntranetProvider } from '..'; | ||
*/ | ||
static getInstance(): any; | ||
static getInstance(): ProviderService; | ||
/** | ||
@@ -11,0 +11,0 @@ * Register the extension provider {internal} that implements interface T |
{ | ||
"name": "@valo/extensibility", | ||
"version": "1.1.0-fb910911b568fcac90cfc3643002b93a20f19886", | ||
"version": "1.1.1-2642a6cd091ddae98f3bb4818cf76f7280af3fb7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
40530
71
1032