@microsoft/sp-component-base 1.23.1 → 1.24.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/467dc675-7cc5-4709-8aac-78e3b71bd2f6.manifest.json +136 -141
- package/dist/{chunk.legacy-third-party-fabric-core-localfont_none_9e84ea19c68fdc8b9094.js → chunk.legacy-third-party-fabric-core-localfont_none_b7f7978a3e90166c361b.js} +1 -1
- package/dist/chunk.teams-apps-client_none_27d3c7c1d01080e4f131.js +2 -0
- package/dist/index-internal-beta.d.ts +30 -8
- package/dist/index-internal-public.d.ts +30 -8
- package/dist/index-internal.d.ts +30 -8
- package/dist/sp-component-base_default_8d535b51fa18aa47002b.js +22 -0
- package/dist/sp-component-base_en-us_8ce25dfb69a7786caece.js +22 -0
- package/dist/sp-component-base_qps-ploc_4fec831895d90df8aa7a.js +22 -0
- package/dist/sp-component-base_qps-ploca_b80610c8dff04dcec755.js +22 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/BaseComponent.js +110 -145
- package/lib-commonjs/BaseComponentContext.js +126 -183
- package/lib-commonjs/DynamicDataProvider.js +251 -268
- package/lib-commonjs/DynamicDataSourceManager.js +218 -241
- package/lib-commonjs/DynamicProperty.js +232 -280
- package/lib-commonjs/EnsureIsolatedDomainUrl.js +14 -14
- package/lib-commonjs/IComponentPosition.js +8 -3
- package/lib-commonjs/IComponentPropertyMetadata.js +10 -3
- package/lib-commonjs/ISerializedServerProcessedData.js +24 -21
- package/lib-commonjs/LegacyThirdPartyFabricCoreLoader.js +53 -87
- package/lib-commonjs/PropertyMetadataProcessor.js +117 -150
- package/lib-commonjs/RenderableComponentContext.js +37 -0
- package/lib-commonjs/ShimmerFactory.js +66 -51
- package/lib-commonjs/chunks/legacy-third-party-fabric-core/FabricLocalFont.js +6 -4
- package/lib-commonjs/common/Flights.js +22 -10
- package/lib-commonjs/common/KillSwitches.js +13 -6
- package/lib-commonjs/dataCollector/IWebPartLoadData.js +35 -30
- package/lib-commonjs/dataCollector/WebPartLoadDataCollector.js +82 -91
- package/lib-commonjs/index.js +78 -38
- package/lib-commonjs/teams/DeferredTeamsAppsClient.js +30 -52
- package/lib-commonjs/teams/ITeamsAppCatalog.js +10 -3
- package/lib-commonjs/teams/TeamsAppsClient.js +189 -231
- package/lib-commonjs/test-api/MockComponent.js +38 -23
- package/lib-commonjs/test-api/MockComponentContext.js +21 -14
- package/lib-commonjs/test-api/index.js +21 -7
- package/lib-commonjs/themeProvider/ThemeProvider.js +68 -82
- package/lib-commonjs/themeProvider/themeInterfaces/IFontStyles.js +5 -2
- package/lib-commonjs/themeProvider/themeInterfaces/IPalette.js +10 -3
- package/lib-commonjs/themeProvider/themeInterfaces/ISemanticColors.js +59 -3
- package/lib-commonjs/themeProvider/themeInterfaces/ISemanticTextColors.js +10 -3
- package/lib-commonjs/themeProvider/themeInterfaces/ITheme.js +5 -2
- package/{lib → lib-dts}/BaseComponent.d.ts +8 -8
- package/{lib → lib-dts}/BaseComponentContext.d.ts +5 -5
- package/lib-dts/RenderableComponentContext.d.ts +35 -0
- package/{lib → lib-dts}/index.d.ts +1 -0
- package/lib-esm/BaseComponent.js +123 -0
- package/lib-esm/BaseComponentContext.js +157 -0
- package/lib-esm/DynamicDataProvider.js +401 -0
- package/lib-esm/DynamicDataSourceManager.js +358 -0
- package/lib-esm/DynamicProperty.js +344 -0
- package/{lib → lib-esm}/EnsureIsolatedDomainUrl.js +6 -6
- package/lib-esm/IComponentPosition.js +5 -0
- package/lib-esm/IComponentPropertyMetadata.js +7 -0
- package/lib-esm/ISerializedServerProcessedData.js +24 -0
- package/lib-esm/LegacyThirdPartyFabricCoreLoader.js +76 -0
- package/{lib → lib-esm}/PropertyMetadataProcessor.js +92 -127
- package/lib-esm/RenderableComponentContext.js +26 -0
- package/lib-esm/ShimmerFactory.js +74 -0
- package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/FabricLocalFont.js +3 -3
- package/{lib → lib-esm}/common/Flights.js +4 -3
- package/{lib → lib-esm}/common/KillSwitches.js +3 -2
- package/lib-esm/dataCollector/IWebPartLoadData.js +33 -0
- package/lib-esm/dataCollector/WebPartLoadDataCollector.js +125 -0
- package/{lib → lib-esm}/index.js +4 -3
- package/lib-esm/teams/DeferredTeamsAppsClient.js +32 -0
- package/lib-esm/teams/ITeamsAppCatalog.js +9 -0
- package/lib-esm/teams/TeamsAppsClient.js +395 -0
- package/lib-esm/test-api/MockComponent.js +38 -0
- package/{lib → lib-esm}/test-api/MockComponentContext.js +10 -11
- package/{lib → lib-esm}/test-api/index.js +2 -1
- package/lib-esm/themeProvider/ThemeProvider.js +79 -0
- package/lib-esm/themeProvider/themeInterfaces/IFontStyles.js +7 -0
- package/lib-esm/themeProvider/themeInterfaces/IPalette.js +7 -0
- package/lib-esm/themeProvider/themeInterfaces/ISemanticColors.js +56 -0
- package/lib-esm/themeProvider/themeInterfaces/ISemanticTextColors.js +7 -0
- package/lib-esm/themeProvider/themeInterfaces/ITheme.js +7 -0
- package/package.json +41 -14
- package/dist/chunk.teams-apps-client_none_f9872389cb6ea9ad28e2.js +0 -2
- package/dist/sp-component-base_default_5ba07be39b0dc8968f7b.js +0 -2
- package/dist/sp-component-base_en-us_eb9bebb3acce0ae83f1c.js +0 -2
- package/dist/sp-component-base_qps-ploc_45f37623d87c3d848f2a.js +0 -2
- package/dist/sp-component-base_qps-ploca_b3f3b7bf97c4185b0fd6.js +0 -2
- package/lib/BaseComponent.d.ts.map +0 -1
- package/lib/BaseComponent.js +0 -161
- package/lib/BaseComponentContext.d.ts.map +0 -1
- package/lib/BaseComponentContext.js +0 -222
- package/lib/DynamicDataProvider.d.ts.map +0 -1
- package/lib/DynamicDataProvider.js +0 -420
- package/lib/DynamicDataSourceManager.d.ts.map +0 -1
- package/lib/DynamicDataSourceManager.js +0 -382
- package/lib/DynamicProperty.d.ts.map +0 -1
- package/lib/DynamicProperty.js +0 -390
- package/lib/EnsureIsolatedDomainUrl.d.ts.map +0 -1
- package/lib/IComponentPosition.d.ts.map +0 -1
- package/lib/IComponentPosition.js +0 -2
- package/lib/IComponentPropertyMetadata.d.ts.map +0 -1
- package/lib/IComponentPropertyMetadata.js +0 -2
- package/lib/ISerializedServerProcessedData.d.ts.map +0 -1
- package/lib/ISerializedServerProcessedData.js +0 -28
- package/lib/LegacyThirdPartyFabricCoreLoader.d.ts.map +0 -1
- package/lib/LegacyThirdPartyFabricCoreLoader.js +0 -90
- package/lib/PropertyMetadataProcessor.d.ts.map +0 -1
- package/lib/ShimmerFactory.d.ts.map +0 -1
- package/lib/ShimmerFactory.js +0 -62
- package/lib/chunks/legacy-third-party-fabric-core/FabricLocalFont.d.ts.map +0 -1
- package/lib/common/Flights.d.ts.map +0 -1
- package/lib/common/KillSwitches.d.ts.map +0 -1
- package/lib/dataCollector/IWebPartLoadData.d.ts.map +0 -1
- package/lib/dataCollector/IWebPartLoadData.js +0 -40
- package/lib/dataCollector/WebPartLoadDataCollector.d.ts.map +0 -1
- package/lib/dataCollector/WebPartLoadDataCollector.js +0 -137
- package/lib/index.d.ts.map +0 -1
- package/lib/teams/DeferredTeamsAppsClient.d.ts.map +0 -1
- package/lib/teams/DeferredTeamsAppsClient.js +0 -39
- package/lib/teams/ITeamsAppCatalog.d.ts.map +0 -1
- package/lib/teams/ITeamsAppCatalog.js +0 -2
- package/lib/teams/TeamsAppsClient.d.ts.map +0 -1
- package/lib/teams/TeamsAppsClient.js +0 -440
- package/lib/test-api/MockComponent.d.ts.map +0 -1
- package/lib/test-api/MockComponent.js +0 -31
- package/lib/test-api/MockComponentContext.d.ts.map +0 -1
- package/lib/test-api/index.d.ts.map +0 -1
- package/lib/themeProvider/ThemeProvider.d.ts.map +0 -1
- package/lib/themeProvider/ThemeProvider.js +0 -99
- package/lib/themeProvider/themeInterfaces/IFontStyles.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/IFontStyles.js +0 -2
- package/lib/themeProvider/themeInterfaces/IPalette.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/IPalette.js +0 -2
- package/lib/themeProvider/themeInterfaces/ISemanticColors.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/ISemanticColors.js +0 -2
- package/lib/themeProvider/themeInterfaces/ISemanticTextColors.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/ISemanticTextColors.js +0 -2
- package/lib/themeProvider/themeInterfaces/ITheme.d.ts.map +0 -1
- package/lib/themeProvider/themeInterfaces/ITheme.js +0 -2
- /package/{lib → lib-dts}/DynamicDataProvider.d.ts +0 -0
- /package/{lib → lib-dts}/DynamicDataSourceManager.d.ts +0 -0
- /package/{lib → lib-dts}/DynamicProperty.d.ts +0 -0
- /package/{lib → lib-dts}/EnsureIsolatedDomainUrl.d.ts +0 -0
- /package/{lib → lib-dts}/IComponentPosition.d.ts +0 -0
- /package/{lib → lib-dts}/IComponentPropertyMetadata.d.ts +0 -0
- /package/{lib → lib-dts}/ISerializedServerProcessedData.d.ts +0 -0
- /package/{lib → lib-dts}/LegacyThirdPartyFabricCoreLoader.d.ts +0 -0
- /package/{lib → lib-dts}/PropertyMetadataProcessor.d.ts +0 -0
- /package/{lib → lib-dts}/ShimmerFactory.d.ts +0 -0
- /package/{lib → lib-dts}/chunks/legacy-third-party-fabric-core/FabricLocalFont.d.ts +0 -0
- /package/{lib → lib-dts}/common/Flights.d.ts +0 -0
- /package/{lib → lib-dts}/common/KillSwitches.d.ts +0 -0
- /package/{lib → lib-dts}/dataCollector/IWebPartLoadData.d.ts +0 -0
- /package/{lib → lib-dts}/dataCollector/WebPartLoadDataCollector.d.ts +0 -0
- /package/{lib → lib-dts}/loc/Strings.resx.d.ts +0 -0
- /package/{lib → lib-dts}/teams/DeferredTeamsAppsClient.d.ts +0 -0
- /package/{lib → lib-dts}/teams/ITeamsAppCatalog.d.ts +0 -0
- /package/{lib → lib-dts}/teams/TeamsAppsClient.d.ts +0 -0
- /package/{lib → lib-dts}/test-api/MockComponent.d.ts +0 -0
- /package/{lib → lib-dts}/test-api/MockComponentContext.d.ts +0 -0
- /package/{lib → lib-dts}/test-api/index.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/ThemeProvider.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/IFontStyles.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/IPalette.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/ISemanticColors.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/ISemanticTextColors.d.ts +0 -0
- /package/{lib → lib-dts}/themeProvider/themeInterfaces/ITheme.d.ts +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-sass/Fabric.LocalFont.global.scss.css +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-sass/Fabric.LocalFontKillSwitchActivated.scss.css +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-shim.global.scss.css +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/fabric-core-shimKillSwitchActivated.scss.css +0 -0
- /package/{lib → lib-esm}/chunks/legacy-third-party-fabric-core/iconDefinitions.css +0 -0
- /package/{lib → lib-esm}/loc/Strings.resx.json +0 -0
- /package/{lib → lib-esm}/sp-component-base.manifest.json +0 -0
- /package/{lib → lib-esm}/styles/shimmer.module.scss.css +0 -0
|
@@ -1,34 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "MockComponent", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return MockComponent;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _BaseComponent = /*#__PURE__*/ _interop_require_default._(require("../BaseComponent"));
|
|
13
|
+
const _MockComponentContext = require("./MockComponentContext");
|
|
14
|
+
class MockComponent extends _BaseComponent.default {
|
|
15
|
+
constructor(mockScope){
|
|
16
|
+
super();
|
|
17
|
+
this.mockIDynamicData = {
|
|
18
|
+
getPropertyDefinitions: ()=>{
|
|
13
19
|
return [
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
{
|
|
21
|
+
id: 'test1',
|
|
22
|
+
title: 'Test One'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'test2',
|
|
26
|
+
title: 'Test Two'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'test3',
|
|
30
|
+
title: 'Test Three'
|
|
31
|
+
}
|
|
17
32
|
];
|
|
18
33
|
},
|
|
19
|
-
getPropertyValue:
|
|
20
|
-
return {
|
|
34
|
+
getPropertyValue: ()=>{
|
|
35
|
+
return {
|
|
36
|
+
'mock-key': 'mock-value'
|
|
37
|
+
};
|
|
21
38
|
},
|
|
22
|
-
getAnnotatedPropertyValue:
|
|
39
|
+
getAnnotatedPropertyValue: ()=>{
|
|
23
40
|
return {
|
|
24
41
|
sampleValue: {}
|
|
25
42
|
};
|
|
26
43
|
}
|
|
27
44
|
};
|
|
28
|
-
|
|
29
|
-
return _this;
|
|
45
|
+
this._initializeContext(new _MockComponentContext.MockComponentContext(mockScope));
|
|
30
46
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=MockComponent.js.map
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=./MockComponent.js.map
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "MockComponentContext", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return MockComponentContext;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _BaseComponentContext = /*#__PURE__*/ _interop_require_default._(require("../BaseComponentContext"));
|
|
13
|
+
class MockComponentContext extends _BaseComponentContext.default {
|
|
14
|
+
constructor(mockRootScope){
|
|
15
|
+
super({
|
|
10
16
|
parentServiceScope: mockRootScope,
|
|
11
17
|
manifest: {
|
|
12
18
|
componentType: 'Application',
|
|
13
19
|
alias: 'alias',
|
|
14
20
|
version: '1.0',
|
|
15
21
|
loaderConfig: {
|
|
16
|
-
internalModuleBaseUrls: [
|
|
22
|
+
internalModuleBaseUrls: [
|
|
23
|
+
'mock info'
|
|
24
|
+
],
|
|
17
25
|
entryModuleId: 'eId',
|
|
18
26
|
scriptResources: {}
|
|
19
27
|
},
|
|
@@ -22,9 +30,8 @@ var MockComponentContext = /** @class */ (function (_super) {
|
|
|
22
30
|
},
|
|
23
31
|
loggingTag: 'logtag',
|
|
24
32
|
instanceId: 'iId'
|
|
25
|
-
})
|
|
33
|
+
});
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=MockComponentContext.js.map
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=./MockComponentContext.js.map
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
MockComponent: function() {
|
|
13
|
+
return _MockComponent.MockComponent;
|
|
14
|
+
},
|
|
15
|
+
MockComponentContext: function() {
|
|
16
|
+
return _MockComponentContext.MockComponentContext;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _MockComponent = require("./MockComponent");
|
|
20
|
+
const _MockComponentContext = require("./MockComponentContext");
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=./index.js.map
|
|
@@ -1,102 +1,88 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
ThemeChangedEventArgs: function() {
|
|
13
|
+
return ThemeChangedEventArgs;
|
|
14
|
+
},
|
|
15
|
+
ThemeProvider: function() {
|
|
16
|
+
return ThemeProvider;
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
var ThemeProvider = /** @class */ (function () {
|
|
26
|
-
/**
|
|
27
|
-
* Construct a new instance of the ThemeProvider class.
|
|
28
|
-
*
|
|
29
|
-
* @param serviceScope - The current service scope.
|
|
30
|
-
* @param theme - Theme to provide.
|
|
31
|
-
*/
|
|
32
|
-
function ThemeProvider(serviceScope, theme, themeV2) {
|
|
33
|
-
this._id = ThemeProvider._instanceCount++;
|
|
34
|
-
this.themeChangedEvent = new sp_core_library_1.SPEvent(this._themeChangedEventName);
|
|
35
|
-
if (theme) {
|
|
36
|
-
this._theme = Object.freeze(theme);
|
|
37
|
-
}
|
|
38
|
-
if (themeV2) {
|
|
39
|
-
this._themeV2 = Object.freeze(themeV2);
|
|
40
|
-
}
|
|
18
|
+
});
|
|
19
|
+
const _spcorelibrary = require("@microsoft/sp-core-library");
|
|
20
|
+
class ThemeChangedEventArgs extends _spcorelibrary.SPEventArgs {
|
|
21
|
+
}
|
|
22
|
+
class ThemeProvider {
|
|
23
|
+
get _themeChangedEventName() {
|
|
24
|
+
return ThemeProvider._themeChangedEventNameLiteral + this._id;
|
|
41
25
|
}
|
|
42
|
-
Object.defineProperty(ThemeProvider.prototype, "_themeChangedEventName", {
|
|
43
|
-
get: function () {
|
|
44
|
-
return ThemeProvider._themeChangedEventNameLiteral + this._id;
|
|
45
|
-
},
|
|
46
|
-
enumerable: false,
|
|
47
|
-
configurable: true
|
|
48
|
-
});
|
|
49
26
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
ThemeProvider.prototype._clearTheme = function () {
|
|
27
|
+
* Clear the currently set theme and raise the themeChangedEvent.
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
*/ _clearTheme() {
|
|
55
31
|
this._theme = undefined;
|
|
56
32
|
this._themeV2 = undefined;
|
|
57
33
|
this._raiseEvent();
|
|
58
|
-
}
|
|
34
|
+
}
|
|
59
35
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
sp_core_library_1.Validate.isNotNullOrUndefined(theme, 'theme');
|
|
36
|
+
* Change the theme and raise the themeChangedEvent.
|
|
37
|
+
*
|
|
38
|
+
* @param theme - The new theme.
|
|
39
|
+
*
|
|
40
|
+
* @internal
|
|
41
|
+
*/ _setTheme(theme, themeV2) {
|
|
42
|
+
_spcorelibrary.Validate.isNotNullOrUndefined(theme, 'theme');
|
|
68
43
|
this._theme = Object.freeze(theme);
|
|
69
44
|
if (themeV2) {
|
|
70
45
|
this._themeV2 = Object.freeze(themeV2);
|
|
71
46
|
}
|
|
72
47
|
this._raiseEvent();
|
|
73
|
-
}
|
|
48
|
+
}
|
|
74
49
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
ThemeProvider.prototype.tryGetTheme = function () {
|
|
50
|
+
* If set, get the current scoped theme.
|
|
51
|
+
*/ tryGetTheme() {
|
|
78
52
|
return this._theme;
|
|
79
|
-
}
|
|
80
|
-
|
|
53
|
+
}
|
|
54
|
+
tryGetThemeV2() {
|
|
81
55
|
return this._themeV2;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
56
|
+
}
|
|
57
|
+
_raiseEvent() {
|
|
58
|
+
_spcorelibrary._SPEventManager.instance.raiseEvent(this._themeChangedEventName, {
|
|
85
59
|
theme: this._theme,
|
|
86
60
|
themeV2: this._themeV2
|
|
87
61
|
});
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* The service key for ThemeProvider.
|
|
91
|
-
*/
|
|
92
|
-
ThemeProvider.serviceKey = sp_core_library_1.ServiceKey.create('sp-component-base.ThemeProvider', ThemeProvider);
|
|
93
|
-
ThemeProvider._themeChangedEventNameLiteral = 'ThemeProvider.themeChangedEvent';
|
|
62
|
+
}
|
|
94
63
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
64
|
+
* Construct a new instance of the ThemeProvider class.
|
|
65
|
+
*
|
|
66
|
+
* @param serviceScope - The current service scope.
|
|
67
|
+
* @param theme - Theme to provide.
|
|
68
|
+
*/ constructor(serviceScope, theme, themeV2){
|
|
69
|
+
this._id = ThemeProvider._instanceCount++;
|
|
70
|
+
this.themeChangedEvent = new _spcorelibrary.SPEvent(this._themeChangedEventName);
|
|
71
|
+
if (theme) {
|
|
72
|
+
this._theme = Object.freeze(theme);
|
|
73
|
+
}
|
|
74
|
+
if (themeV2) {
|
|
75
|
+
this._themeV2 = Object.freeze(themeV2);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The service key for ThemeProvider.
|
|
81
|
+
*/ ThemeProvider.serviceKey = _spcorelibrary.ServiceKey.create('sp-component-base.ThemeProvider', ThemeProvider);
|
|
82
|
+
ThemeProvider._themeChangedEventNameLiteral = 'ThemeProvider.themeChangedEvent';
|
|
83
|
+
/**
|
|
84
|
+
* Used to register a unique event for each ThemeProvider instance by appending
|
|
85
|
+
* the instance count to themeChangedEventNameLiteral.
|
|
86
|
+
*/ ThemeProvider._instanceCount = 0;
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=./ThemeProvider.js.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Color palette.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=./IPalette.js.map
|
|
@@ -1,3 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The collection of all semantic slots for colors used in themes.
|
|
3
|
+
*
|
|
4
|
+
* Note: text colors are defined in ISemanticTextColors.ts.
|
|
5
|
+
*
|
|
6
|
+
* ## Naming Convention
|
|
7
|
+
*
|
|
8
|
+
* The name of a semantic slot can quickly tell you how it's meant to be used. It generally follows this format:
|
|
9
|
+
*
|
|
10
|
+
* [category name][element name][checked state][hovered/pressed/disabled state]
|
|
11
|
+
* [category name] - The “family” that this slot belongs to.
|
|
12
|
+
* [element name] - The name of the thing being targeted, such as the background or border.
|
|
13
|
+
* [checked state] - Whether the thing is checked. We assume things are unchecked by default, so no need to
|
|
14
|
+
* specify the unchecked state.
|
|
15
|
+
* (We used “checked” to refer to anything that is on, selected, toggled, highlighted, emphasized, etc.)
|
|
16
|
+
* [hovered/pressed/disabled state] - One of these states, if applicable. Each of these states are mutually exclusive.
|
|
17
|
+
* Pressed styles overwrite hovered styles, and disabled elements cannot be hovered or pressed.
|
|
18
|
+
*
|
|
19
|
+
* ## Base Slots
|
|
20
|
+
*
|
|
21
|
+
* A basic set of slots that provide many default body styles, such as text, subtext, disabled colors, and so on.
|
|
22
|
+
* If a category doesn't provide the slot you're looking for, use one from this category.
|
|
23
|
+
* For example, the placeholder text on a text input field has no corresponding slot in its category,
|
|
24
|
+
* so you'd use the bodySubtextColor from this category.
|
|
25
|
+
*
|
|
26
|
+
* ## Invariants
|
|
27
|
+
*
|
|
28
|
+
* When color has meaning, we do not want to change the color much theme to theme. For example, we
|
|
29
|
+
* will always want errors to be some shade of red, but we will need to tweak the exact shade so it's
|
|
30
|
+
* legible depending on whether it's an inverted theme or not.
|
|
31
|
+
* Invariant colors should almost never be changed by the theme, the defaults should suffice.
|
|
32
|
+
*
|
|
33
|
+
* ## Input Controls
|
|
34
|
+
*
|
|
35
|
+
* This category contains input components commonly used to denote state, including radio buttons,
|
|
36
|
+
* check boxes, toggle switches, sliders, progress bars, and more.
|
|
37
|
+
*
|
|
38
|
+
* ## Buttons
|
|
39
|
+
*
|
|
40
|
+
* Buttons! And all the flavors thereof.
|
|
41
|
+
*
|
|
42
|
+
* ## Menus
|
|
43
|
+
*
|
|
44
|
+
* Any kind of popup menus uses this category.
|
|
45
|
+
*
|
|
46
|
+
* ## Lists
|
|
47
|
+
*
|
|
48
|
+
* Lists differ from menus in that they are designed to show infinite amounts of items, often scroll,
|
|
49
|
+
* and have a large and complex interaction surface.
|
|
50
|
+
* This category covers all kinds of lists, whether they're typical one-item-per-row lists (like DetailsList)
|
|
51
|
+
* or ones with a tiled layout.
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/ "use strict";
|
|
55
|
+
Object.defineProperty(exports, "__esModule", {
|
|
56
|
+
value: true
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=./ISemanticColors.js.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Collection of semantic text colors.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=./ISemanticTextColors.js.map
|
|
@@ -6,7 +6,7 @@ import type BaseComponentContext from './BaseComponentContext';
|
|
|
6
6
|
*
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export default abstract class BaseComponent implements ISPEventObserver {
|
|
9
|
+
export default abstract class BaseComponent<TClientSideComponentManifest extends IClientSideComponentManifest = IClientSideComponentManifest> implements ISPEventObserver {
|
|
10
10
|
/**
|
|
11
11
|
* Use the context object to access common services and state associated with the component.
|
|
12
12
|
*
|
|
@@ -23,7 +23,7 @@ export default abstract class BaseComponent implements ISPEventObserver {
|
|
|
23
23
|
* then we can convert "context" to an ordinary property getter.
|
|
24
24
|
* https://github.com/Microsoft/TypeScript/issues/338
|
|
25
25
|
*/
|
|
26
|
-
protected context?: BaseComponentContext
|
|
26
|
+
protected context?: BaseComponentContext<TClientSideComponentManifest>;
|
|
27
27
|
/**
|
|
28
28
|
* Stores whether or not this component has a dynamic data source.
|
|
29
29
|
* @internal
|
|
@@ -60,16 +60,16 @@ export default abstract class BaseComponent implements ISPEventObserver {
|
|
|
60
60
|
get isDisposed(): boolean;
|
|
61
61
|
/**
|
|
62
62
|
* Provides access to the manifest for the client-side component.
|
|
63
|
-
*
|
|
63
|
+
*
|
|
64
64
|
* @remarks
|
|
65
|
-
*
|
|
65
|
+
* The manifest type is determined by the `TClientSideComponentManifest` generic parameter.
|
|
66
66
|
*/
|
|
67
|
-
get manifest():
|
|
67
|
+
get manifest(): TClientSideComponentManifest;
|
|
68
68
|
/**
|
|
69
69
|
* This event method is called at the end of the component's lifecycle.
|
|
70
70
|
* It provides an opportunity to release any associated resources, cancel any
|
|
71
71
|
* outstanding requests, etc.
|
|
72
|
-
* virtual
|
|
72
|
+
* @virtual
|
|
73
73
|
*/
|
|
74
74
|
protected onDispose(): void;
|
|
75
75
|
/**
|
|
@@ -94,7 +94,7 @@ export default abstract class BaseComponent implements ISPEventObserver {
|
|
|
94
94
|
/**
|
|
95
95
|
* @internal
|
|
96
96
|
*/
|
|
97
|
-
protected _initializeContext(context: BaseComponentContext): void;
|
|
97
|
+
protected _initializeContext(context: BaseComponentContext<TClientSideComponentManifest>): void;
|
|
98
98
|
/**
|
|
99
99
|
* This event method allows a component to add custom services to its
|
|
100
100
|
* {@link @microsoft/sp-core-library#ServiceScope}.
|
|
@@ -103,7 +103,7 @@ export default abstract class BaseComponent implements ISPEventObserver {
|
|
|
103
103
|
* This event method is fired before {@link @microsoft/sp-core-library#ServiceScope | ServiceScope.finish()}
|
|
104
104
|
* is called, allowing the component to provide custom services.
|
|
105
105
|
*
|
|
106
|
-
* virtual
|
|
106
|
+
* @virtual
|
|
107
107
|
*
|
|
108
108
|
* @alpha
|
|
109
109
|
*/
|
|
@@ -10,7 +10,7 @@ import DynamicDataSourceManager from './DynamicDataSourceManager';
|
|
|
10
10
|
*
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
export interface IComponentContextParameters {
|
|
13
|
+
export interface IComponentContextParameters<TClientSideComponentManifest extends IClientSideComponentManifest = IClientSideComponentManifest> {
|
|
14
14
|
/**
|
|
15
15
|
* The manager's ServiceScope, which will be used to create the child
|
|
16
16
|
* ServiceScope for the associated context.
|
|
@@ -19,7 +19,7 @@ export interface IComponentContextParameters {
|
|
|
19
19
|
/**
|
|
20
20
|
* The client-side component manifest.
|
|
21
21
|
*/
|
|
22
|
-
readonly manifest:
|
|
22
|
+
readonly manifest: TClientSideComponentManifest;
|
|
23
23
|
/**
|
|
24
24
|
* Logging service tag
|
|
25
25
|
*/
|
|
@@ -54,11 +54,11 @@ export interface IComponentContextParameters {
|
|
|
54
54
|
*
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
|
-
declare abstract class BaseComponentContext implements IDisposable {
|
|
57
|
+
declare abstract class BaseComponentContext<TClientSideComponentManifest extends IClientSideComponentManifest = IClientSideComponentManifest> implements IDisposable {
|
|
58
58
|
/**
|
|
59
59
|
* Manifest for the client-side component.
|
|
60
60
|
*/
|
|
61
|
-
readonly manifest:
|
|
61
|
+
readonly manifest: TClientSideComponentManifest;
|
|
62
62
|
private _serviceScope;
|
|
63
63
|
private _instanceId;
|
|
64
64
|
private _pageContext;
|
|
@@ -72,7 +72,7 @@ declare abstract class BaseComponentContext implements IDisposable {
|
|
|
72
72
|
private _msGraphClientFactory;
|
|
73
73
|
private _isServedFromLocalhost;
|
|
74
74
|
/** @internal */
|
|
75
|
-
constructor(parameters: IComponentContextParameters);
|
|
75
|
+
constructor(parameters: IComponentContextParameters<TClientSideComponentManifest>);
|
|
76
76
|
/**
|
|
77
77
|
* Returns true if the context is disposed.
|
|
78
78
|
*/
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IClientSideComponentManifest } from '@microsoft/sp-module-interfaces';
|
|
2
|
+
import BaseComponentContext from './BaseComponentContext';
|
|
3
|
+
import type { IComponentContextParameters } from './BaseComponentContext';
|
|
4
|
+
/**
|
|
5
|
+
* Constructor parameters for a {@link RenderableComponentContext}.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface IRenderableComponentContextParameters<TClientSideComponentManifest extends IClientSideComponentManifest = IClientSideComponentManifest> extends IComponentContextParameters<TClientSideComponentManifest> {
|
|
10
|
+
/** DOM element the component renders into. */
|
|
11
|
+
readonly domElement: HTMLElement;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Base context for component types that render into a DOM element — web parts,
|
|
15
|
+
* Copilot Components, and any future renderable component type.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Extends {@link @microsoft/sp-component-base#BaseComponentContext} with a
|
|
19
|
+
* {@link RenderableComponentContext.domElement | domElement} property. Component
|
|
20
|
+
* types that do not have a dedicated render target (e.g. application
|
|
21
|
+
* customizers, extensions) should continue to extend `BaseComponentContext`
|
|
22
|
+
* directly.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
declare class RenderableComponentContext<TClientSideComponentManifest extends IClientSideComponentManifest = IClientSideComponentManifest> extends BaseComponentContext<TClientSideComponentManifest> {
|
|
27
|
+
/**
|
|
28
|
+
* Reference to the DOM element that hosts this client-side component.
|
|
29
|
+
*/
|
|
30
|
+
readonly domElement: HTMLElement;
|
|
31
|
+
/** @internal */
|
|
32
|
+
constructor(parameters: IRenderableComponentContextParameters<TClientSideComponentManifest>);
|
|
33
|
+
}
|
|
34
|
+
export default RenderableComponentContext;
|
|
35
|
+
//# sourceMappingURL=RenderableComponentContext.d.ts.map
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { default as BaseComponent } from './BaseComponent';
|
|
13
13
|
export { default as BaseComponentContext, type IComponentContextParameters as _IComponentContextParameters } from './BaseComponentContext';
|
|
14
|
+
export { default as RenderableComponentContext, type IRenderableComponentContextParameters as _IRenderableComponentContextParameters } from './RenderableComponentContext';
|
|
14
15
|
export { default as DynamicDataProvider } from './DynamicDataProvider';
|
|
15
16
|
export { default as DynamicDataSourceManager } from './DynamicDataSourceManager';
|
|
16
17
|
export { default as DynamicProperty } from './DynamicProperty';
|