@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
package/lib/DynamicProperty.js
DELETED
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
import * as lodash from '@microsoft/sp-lodash-subset';
|
|
2
|
-
import { _SPKillSwitch, Validate } from '@microsoft/sp-core-library';
|
|
3
|
-
import { DynamicDataReference } from '@microsoft/sp-dynamic-data';
|
|
4
|
-
import DynamicDataProvider from './DynamicDataProvider';
|
|
5
|
-
import { _LogEntry, _EngagementLogger, _LogType } from '@microsoft/sp-diagnostics';
|
|
6
|
-
/**
|
|
7
|
-
* Serializable object that simplifies usage of a DynamicProperty.
|
|
8
|
-
*
|
|
9
|
-
* @remarks
|
|
10
|
-
* This is built for usage in web part properties, and modified through the property pane.
|
|
11
|
-
* Can be initialized with a default callback.
|
|
12
|
-
* Web parts initialize with the render method so if the 3rd party developer does nothing, a change in the
|
|
13
|
-
* DynamicProperty will re-render the web part automatically.
|
|
14
|
-
*
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
var DynamicProperty = /** @class */ (function () {
|
|
18
|
-
/**
|
|
19
|
-
* Create a new DynamicProperty object.
|
|
20
|
-
* @param provider - DynamicDataProvider.
|
|
21
|
-
* @param callback - Optional. Default callback to be registered for updates in the DynamicDataSource.
|
|
22
|
-
*/
|
|
23
|
-
function DynamicProperty(provider, callback) {
|
|
24
|
-
this._hasValue = false;
|
|
25
|
-
this._isDisposed = false;
|
|
26
|
-
Validate.isNotNullOrUndefined(provider, 'provider');
|
|
27
|
-
this['__type'] = DynamicProperty._TYPE_NAME;
|
|
28
|
-
this._provider = provider;
|
|
29
|
-
this._callbacks = new Set();
|
|
30
|
-
this._pendingCallbacks = new Set();
|
|
31
|
-
if (callback) {
|
|
32
|
-
// The default callback will be added once a source is configured
|
|
33
|
-
this._pendingCallbacks.add(callback);
|
|
34
|
-
this._defaultCallback = callback;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
this._defaultCallback = undefined;
|
|
38
|
-
}
|
|
39
|
-
this._onSourcesChanged = this._onSourcesChangedCallback.bind(this);
|
|
40
|
-
this._cloneDeep = this._cloneDeep.bind(this);
|
|
41
|
-
this._provider.registerAvailableSourcesChanged(this._onSourcesChanged);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Sets the value of the DynamicProperty to be a reference to a DynamicDynamicSource
|
|
45
|
-
* and property. The reference is of the form `<source>:<property>:<path>`.
|
|
46
|
-
* @param reference - Id of the DynamicDataSource and property.
|
|
47
|
-
*/
|
|
48
|
-
DynamicProperty.prototype.setReference = function (reference) {
|
|
49
|
-
var _this = this;
|
|
50
|
-
Validate.isNonemptyString(reference, 'id');
|
|
51
|
-
this._value = undefined;
|
|
52
|
-
this._hasValue = false;
|
|
53
|
-
// Potentially changing the source. Remove all callbacks, change the source, and add callbacks again.
|
|
54
|
-
var callbacks = new Set();
|
|
55
|
-
this._callbacks.forEach(function (callback) { return callbacks.add(callback); });
|
|
56
|
-
this._callbacks.forEach(function (callback) { return _this.unregister(callback); });
|
|
57
|
-
this._reference = new DynamicDataReference(reference);
|
|
58
|
-
this._sourceId = this._getSourceId();
|
|
59
|
-
callbacks.forEach(function (callback) { return _this.register(callback); });
|
|
60
|
-
// The source has changed, so act if a new source was added
|
|
61
|
-
this._onSourcesChangedCallback();
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Sets a static value in the DynamicProperty.
|
|
65
|
-
* @param value - Value for the DynamicProperty.
|
|
66
|
-
*/
|
|
67
|
-
DynamicProperty.prototype.setValue = function (value) {
|
|
68
|
-
var _this = this;
|
|
69
|
-
// Removing the source. Remove all callback, set the value, and add the callback again so they are not lost.
|
|
70
|
-
// Callbacks will be stored in the pending callbacks list.
|
|
71
|
-
var callbacks = this._callbacks;
|
|
72
|
-
callbacks.forEach(function (callback) { return _this.unregister(callback); });
|
|
73
|
-
this._value = value;
|
|
74
|
-
this._reference = undefined;
|
|
75
|
-
this._sourceId = undefined;
|
|
76
|
-
this._hasValue = true;
|
|
77
|
-
callbacks.forEach(function (callback) { return _this.register(callback); });
|
|
78
|
-
};
|
|
79
|
-
Object.defineProperty(DynamicProperty.prototype, "isDisposed", {
|
|
80
|
-
/**
|
|
81
|
-
* {@inheritDoc @microsoft/sp-core-library#IDisposable.isDisposed}
|
|
82
|
-
*/
|
|
83
|
-
get: function () {
|
|
84
|
-
return this._isDisposed;
|
|
85
|
-
},
|
|
86
|
-
enumerable: false,
|
|
87
|
-
configurable: true
|
|
88
|
-
});
|
|
89
|
-
/**
|
|
90
|
-
* {@inheritDoc @microsoft/sp-core-library#IDisposable.dispose}
|
|
91
|
-
*/
|
|
92
|
-
DynamicProperty.prototype.dispose = function () {
|
|
93
|
-
var _this = this;
|
|
94
|
-
if (!this._isDisposed) {
|
|
95
|
-
this._provider.unregisterAvailableSourcesChanged(this._onSourcesChanged);
|
|
96
|
-
if (this._defaultCallback) {
|
|
97
|
-
this.unregister(this._defaultCallback);
|
|
98
|
-
delete this._defaultCallback;
|
|
99
|
-
}
|
|
100
|
-
this._callbacks.forEach(function (callback) { return _this.unregister(callback); });
|
|
101
|
-
delete this._callbacks;
|
|
102
|
-
delete this._onSourcesChanged;
|
|
103
|
-
delete this._pendingCallbacks;
|
|
104
|
-
delete this._provider;
|
|
105
|
-
delete this._reference;
|
|
106
|
-
delete this._sourceId;
|
|
107
|
-
this._isDisposed = true;
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Returns a serializable version of the object.
|
|
112
|
-
* To be used when `JSON.stringify()` is called on the object (i.e. during Web Part serialization)
|
|
113
|
-
*
|
|
114
|
-
* @remarks
|
|
115
|
-
* This doesn't follow the naming rule for internal methods because the JavaScript engine needs this exact name.
|
|
116
|
-
*
|
|
117
|
-
* @internal
|
|
118
|
-
*/
|
|
119
|
-
DynamicProperty.prototype.toJSON = function () {
|
|
120
|
-
if (this._hasValue) {
|
|
121
|
-
return {
|
|
122
|
-
__type: DynamicProperty._TYPE_NAME,
|
|
123
|
-
value: this._value
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
return {
|
|
128
|
-
__type: DynamicProperty._TYPE_NAME,
|
|
129
|
-
reference: this._reference
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
Object.defineProperty(DynamicProperty.prototype, "reference", {
|
|
134
|
-
/**
|
|
135
|
-
* DynamicDataReference string that the DynamicProperty object points to.
|
|
136
|
-
* The reference is of the form `<source>:<property>:<path>`.
|
|
137
|
-
*
|
|
138
|
-
* @remarks
|
|
139
|
-
* If the DynamicProperty is set up with static data, this returns undefined.
|
|
140
|
-
*/
|
|
141
|
-
get: function () {
|
|
142
|
-
return this._hasValue ? undefined : this._reference.reference;
|
|
143
|
-
},
|
|
144
|
-
enumerable: false,
|
|
145
|
-
configurable: true
|
|
146
|
-
});
|
|
147
|
-
Object.defineProperty(DynamicProperty.prototype, "value", {
|
|
148
|
-
/**
|
|
149
|
-
* Returns the value of the DynamicProperty object, if it has a non-dynamic value.
|
|
150
|
-
* Used for serialization purposes. The proper API to access the value of the object is `tryGetValue()`
|
|
151
|
-
*
|
|
152
|
-
* @internal
|
|
153
|
-
*/
|
|
154
|
-
get: function () {
|
|
155
|
-
return this._value;
|
|
156
|
-
},
|
|
157
|
-
enumerable: false,
|
|
158
|
-
configurable: true
|
|
159
|
-
});
|
|
160
|
-
/**
|
|
161
|
-
* Returns the value of the object.
|
|
162
|
-
*
|
|
163
|
-
* @remarks
|
|
164
|
-
* If the value is an array, then the first element of the array is returned;
|
|
165
|
-
* otherwise, the value itself is returned.
|
|
166
|
-
*
|
|
167
|
-
* NOTE: This api will never return an array. To retrieve an array value,
|
|
168
|
-
* use the {@link DynamicProperty.tryGetValues} API.
|
|
169
|
-
*
|
|
170
|
-
* @returns the value associated with the dynamic property or
|
|
171
|
-
* undefined if the source or the data doesn't exist.
|
|
172
|
-
*/
|
|
173
|
-
DynamicProperty.prototype.tryGetValue = function () {
|
|
174
|
-
if (this.isDisposed &&
|
|
175
|
-
!_SPKillSwitch.isActivated('413769dc-5e0c-4609-9c86-bdf099fe84e3' /*, '12/02/2021', 'DisposedUndefinedNotException'*/)) {
|
|
176
|
-
return undefined;
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
Validate.isNotDisposed(this, 'DynamicData');
|
|
180
|
-
}
|
|
181
|
-
var value = this._getData();
|
|
182
|
-
if (Array.isArray(value)) {
|
|
183
|
-
value = value[0];
|
|
184
|
-
}
|
|
185
|
-
return value;
|
|
186
|
-
};
|
|
187
|
-
/**
|
|
188
|
-
* Returns the value of the object.
|
|
189
|
-
*
|
|
190
|
-
* @remarks
|
|
191
|
-
* If the value is NOT an array, then an array is returned with the value being the single entry;
|
|
192
|
-
* otherwise, the value itself is returned. If the property is undefined or cannot be found,
|
|
193
|
-
* an empty array will be returned.
|
|
194
|
-
*
|
|
195
|
-
* NOTE: This api will always return an array and it assumes that the array is homogeneous.
|
|
196
|
-
* To retrieve a non-array value, use the {@link DynamicProperty.tryGetValue} API.
|
|
197
|
-
*
|
|
198
|
-
* @returns the value associated with the dynamic property or
|
|
199
|
-
* an empty array if the source or the data doesn't exist.
|
|
200
|
-
*/
|
|
201
|
-
DynamicProperty.prototype.tryGetValues = function () {
|
|
202
|
-
var value = this._getData();
|
|
203
|
-
// OK, time for some massaging of the return.
|
|
204
|
-
if (value) {
|
|
205
|
-
// If there is a value returned, but it isn't an array, create an array and
|
|
206
|
-
// make this the return value the sole contents of the array
|
|
207
|
-
if (!Array.isArray(value)) {
|
|
208
|
-
value = [value];
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
// In this case, we are saying that there is no value. For this scenario
|
|
213
|
-
// we simply return an empty array.
|
|
214
|
-
value = [];
|
|
215
|
-
}
|
|
216
|
-
return value;
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* Returns the DynamicDataSource that the DynamicProperty object refers to.
|
|
220
|
-
* Returns undefined if the source doesn't exist.
|
|
221
|
-
*/
|
|
222
|
-
DynamicProperty.prototype.tryGetSource = function () {
|
|
223
|
-
if (this.isDisposed &&
|
|
224
|
-
!_SPKillSwitch.isActivated('413769dc-5e0c-4609-9c86-bdf099fe84e3' /*, '12/02/2021', 'DisposedUndefinedNotException'*/)) {
|
|
225
|
-
return undefined;
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
Validate.isNotDisposed(this, 'DynamicData');
|
|
229
|
-
}
|
|
230
|
-
return this._hasValue ? undefined : this._provider.tryGetSource(this._sourceId);
|
|
231
|
-
};
|
|
232
|
-
/**
|
|
233
|
-
* Registers a callback function for updates on the associated DynamicDataSource.
|
|
234
|
-
* @param callback - Callback function to register.
|
|
235
|
-
*/
|
|
236
|
-
DynamicProperty.prototype.register = function (callback) {
|
|
237
|
-
Validate.isNotDisposed(this, 'DynamicData');
|
|
238
|
-
if (!this._hasValue && this._sourceId && !!this._provider.tryGetSource(this._sourceId)) {
|
|
239
|
-
this._provider.registerPropertyChanged(this._sourceId, this._getPropertyToRegister(), callback);
|
|
240
|
-
this._callbacks.add(callback);
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
this._pendingCallbacks.add(callback);
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
/**
|
|
247
|
-
* Unregisters a callback function for updates on the associated DynamicDataSource.
|
|
248
|
-
* The callback function must be the same it was registered with.
|
|
249
|
-
* @param callback - Callback function to unregister.
|
|
250
|
-
*/
|
|
251
|
-
DynamicProperty.prototype.unregister = function (callback) {
|
|
252
|
-
Validate.isNotDisposed(this, 'DynamicData');
|
|
253
|
-
if (!this._hasValue && this._sourceId && !!this._provider.tryGetSource(this._sourceId)) {
|
|
254
|
-
this._provider.unregisterPropertyChanged(this._sourceId, this._getPropertyToRegister(), callback);
|
|
255
|
-
}
|
|
256
|
-
this._pendingCallbacks.delete(callback);
|
|
257
|
-
this._callbacks.delete(callback);
|
|
258
|
-
};
|
|
259
|
-
/**
|
|
260
|
-
* Returns true if the object has a default callback.
|
|
261
|
-
*/
|
|
262
|
-
DynamicProperty.prototype.hasDefaultCallback = function () {
|
|
263
|
-
return !!this._defaultCallback;
|
|
264
|
-
};
|
|
265
|
-
/**
|
|
266
|
-
* Removes the registration for the default callback.
|
|
267
|
-
*
|
|
268
|
-
* @remarks
|
|
269
|
-
* This can be useful for advanced users who only want their custom callbacks.
|
|
270
|
-
*/
|
|
271
|
-
DynamicProperty.prototype.removeDefaultCallback = function () {
|
|
272
|
-
if (this._defaultCallback) {
|
|
273
|
-
this.unregister(this._defaultCallback);
|
|
274
|
-
this._defaultCallback = undefined;
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
/**
|
|
278
|
-
* Returns the id of the DynamicDataSource if the DynamicProperty has a reference set.
|
|
279
|
-
*
|
|
280
|
-
* @internal
|
|
281
|
-
*/
|
|
282
|
-
DynamicProperty.prototype._getSourceId = function () {
|
|
283
|
-
Validate.isNotDisposed(this, 'DynamicData');
|
|
284
|
-
return this._hasValue ? '' : this._reference.sourceId;
|
|
285
|
-
};
|
|
286
|
-
/**
|
|
287
|
-
* Returns the property name of the DynamicDataSource that the DynamicProperty points to.
|
|
288
|
-
*
|
|
289
|
-
* NOTE: This is accessed from the property pane code while building the DynamicDataWidget.
|
|
290
|
-
* @internal
|
|
291
|
-
*/
|
|
292
|
-
DynamicProperty.prototype._getProperty = function () {
|
|
293
|
-
Validate.isNotDisposed(this, 'DynamicData');
|
|
294
|
-
return this._hasValue ? '' : this._reference.property;
|
|
295
|
-
};
|
|
296
|
-
/**
|
|
297
|
-
* Returns the path from the property that the object points to, if applicable.
|
|
298
|
-
* If not applicable, returns an empty string.
|
|
299
|
-
*
|
|
300
|
-
* @internal
|
|
301
|
-
*/
|
|
302
|
-
DynamicProperty.prototype._getPropertyPath = function () {
|
|
303
|
-
Validate.isNotDisposed(this, 'DynamicData');
|
|
304
|
-
return this._hasValue ? '' : this._reference.propertyPath || '';
|
|
305
|
-
};
|
|
306
|
-
/**
|
|
307
|
-
* Returns a deep cloned version of the current instance.
|
|
308
|
-
*
|
|
309
|
-
* @remarks
|
|
310
|
-
* Since the dynamic property is maintaining an instance of the DynamicDataProvider,
|
|
311
|
-
* which which when serialized will result in 'Maximum call stack size exceeded' based
|
|
312
|
-
* on what kind of sources they hold references to.
|
|
313
|
-
*
|
|
314
|
-
* For example, if the dynamicDataProvider is holding PageContext source, which internally
|
|
315
|
-
* has serviceScope in its state. Deep cloning this source would result in the above mentioned
|
|
316
|
-
* error.
|
|
317
|
-
*
|
|
318
|
-
* Hence we would want to just clone the dynamicDataProvider not deep clone it.
|
|
319
|
-
*
|
|
320
|
-
* @returns - Custom deep Cloned version of the current instance.
|
|
321
|
-
*
|
|
322
|
-
* @internal
|
|
323
|
-
*/
|
|
324
|
-
DynamicProperty.prototype._cloneDeep = function (instance) {
|
|
325
|
-
return lodash.cloneDeepWith(instance, function (prop) {
|
|
326
|
-
if (prop instanceof DynamicDataProvider) {
|
|
327
|
-
return prop;
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
};
|
|
331
|
-
/**
|
|
332
|
-
* Returns the property name of the DynamicDataSource that the DynamicProperty points to.
|
|
333
|
-
*
|
|
334
|
-
* @remarks
|
|
335
|
-
* Removes the array notation from the property name, if any, before it is being registered.
|
|
336
|
-
* This is to avoid any mismatch between the strings passed by the source when it notifies
|
|
337
|
-
* a property change, as the source doesn't pass any array notation with the property name.
|
|
338
|
-
* Array notation is only for internal representation, for a property whose value is an array type.
|
|
339
|
-
*/
|
|
340
|
-
DynamicProperty.prototype._getPropertyToRegister = function () {
|
|
341
|
-
Validate.isNotDisposed(this, 'DynamicData');
|
|
342
|
-
// Split the property string on the array notation to get
|
|
343
|
-
// the property name. If the array notation is not present,
|
|
344
|
-
// then the original string is returned in the array.
|
|
345
|
-
return this._getProperty().split(DynamicProperty._arrayRegex)[0];
|
|
346
|
-
};
|
|
347
|
-
/**
|
|
348
|
-
* Callback when the DynamicDataSources list changes.
|
|
349
|
-
* It registers the pending callbacks into the DynamicDataProvidere.
|
|
350
|
-
*/
|
|
351
|
-
DynamicProperty.prototype._onSourcesChangedCallback = function () {
|
|
352
|
-
var _this = this;
|
|
353
|
-
if (!this._hasValue && this._sourceId && !!this._provider.tryGetSource(this._sourceId)) {
|
|
354
|
-
var callbacksToAdd = this._pendingCallbacks;
|
|
355
|
-
this._pendingCallbacks = new Set();
|
|
356
|
-
callbacksToAdd.forEach(function (callback) {
|
|
357
|
-
_this.register(callback);
|
|
358
|
-
callback();
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
};
|
|
362
|
-
DynamicProperty.prototype._getData = function () {
|
|
363
|
-
if (this.isDisposed &&
|
|
364
|
-
!_SPKillSwitch.isActivated('413769dc-5e0c-4609-9c86-bdf099fe84e3' /*, '12/02/2021', 'DisposedUndefinedNotException'*/)) {
|
|
365
|
-
return undefined;
|
|
366
|
-
}
|
|
367
|
-
else {
|
|
368
|
-
Validate.isNotDisposed(this, 'DynamicData');
|
|
369
|
-
}
|
|
370
|
-
var value;
|
|
371
|
-
try {
|
|
372
|
-
value = this._hasValue ? this._value : this._provider._getData(this._reference);
|
|
373
|
-
}
|
|
374
|
-
catch (error) {
|
|
375
|
-
_EngagementLogger.logEventWithLogEntry(error);
|
|
376
|
-
throw error;
|
|
377
|
-
}
|
|
378
|
-
_EngagementLogger.logEventWithLogEntry(new _LogEntry('DynamicData', 'getData', _LogType.Event, { value: JSON.stringify(this.value) }));
|
|
379
|
-
return value;
|
|
380
|
-
};
|
|
381
|
-
/**
|
|
382
|
-
* Constant with the type name of the DynamicProperty.
|
|
383
|
-
* @internal
|
|
384
|
-
*/
|
|
385
|
-
DynamicProperty._TYPE_NAME = 'DynamicProperty';
|
|
386
|
-
DynamicProperty._arrayRegex = new RegExp(/\[\*\]$/);
|
|
387
|
-
return DynamicProperty;
|
|
388
|
-
}());
|
|
389
|
-
export default DynamicProperty;
|
|
390
|
-
//# sourceMappingURL=DynamicProperty.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnsureIsolatedDomainUrl.d.ts","sourceRoot":"","sources":["../src/EnsureIsolatedDomainUrl.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAoBvG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IComponentPosition.d.ts","sourceRoot":"","sources":["../src/IComponentPosition.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAEjC;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,GAAG,MAAM,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,GAAG,MAAM,CAAC;IAE1C;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAGhC;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,GAAG,MAAM,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,yBAAyB,EAAE,SAAS,GAAG,MAAM,CAAC;IAEvD;;OAEG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;CAC7C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IComponentPropertyMetadata.d.ts","sourceRoot":"","sources":["../src/IComponentPropertyMetadata.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;;;;;OAUG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;;;;;;;;OAYG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ISerializedServerProcessedData.d.ts","sourceRoot":"","sources":["../src/ISerializedServerProcessedData.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,eAAO,MAAM,uBAAuB;IAClC;;OAEG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;OAEG;;CAEK,CAAC;AACX;;;GAGG;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAE7G;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAExC;;;;;;;;;;;;;;OAcG;IACH,oBAAoB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAEjD;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAElC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAEzC;;;;;;;;;;;;;;;OAeG;IACH,qBAAqB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAA;SAAE,CAAA;KAAE,CAAC;CAC3D"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft. All rights reserved.
|
|
2
|
-
/**
|
|
3
|
-
* Server processed data type.
|
|
4
|
-
*
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/typedef
|
|
8
|
-
export var ServerProcessedDataType = {
|
|
9
|
-
/**
|
|
10
|
-
* The date type is valid html string.
|
|
11
|
-
*/
|
|
12
|
-
htmlString: 1,
|
|
13
|
-
/**
|
|
14
|
-
* The date type is a link to a resource.
|
|
15
|
-
* The link can be a SharePoint content link or non-SharePoint link.
|
|
16
|
-
*/
|
|
17
|
-
link: 2,
|
|
18
|
-
/**
|
|
19
|
-
* The date type is a link to a image.
|
|
20
|
-
* The link can be a SharePoint content link or non-SharePoint link.
|
|
21
|
-
*/
|
|
22
|
-
imageSource: 3,
|
|
23
|
-
/**
|
|
24
|
-
* The data type is a string that should be search indexed.
|
|
25
|
-
*/
|
|
26
|
-
searchablePlainText: 4
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=ISerializedServerProcessedData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyThirdPartyFabricCoreLoader.d.ts","sourceRoot":"","sources":["../src/LegacyThirdPartyFabricCoreLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAIpF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gCAAgC;IACnD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS,CAAkB;IAE1C;;;;;;;;;OASG;WACW,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAa3E;;;;;;;;OAQG;WACW,SAAS,CAAC,QAAQ,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB9E;;;OAGG;WACW,mBAAmB,CAAC,QAAQ,EAAE,4BAA4B,GAAG,OAAO;IAmBlF,OAAO,CAAC,MAAM,CAAC,WAAW;CAM3B"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Version } from '@microsoft/sp-core-library';
|
|
2
|
-
// Copyright (c) Microsoft. All rights reserved.
|
|
3
|
-
/**
|
|
4
|
-
* Class to load async chunks.
|
|
5
|
-
*
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
var LegacyThirdPartyFabricCoreLoader = /** @class */ (function () {
|
|
9
|
-
function LegacyThirdPartyFabricCoreLoader() {
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Method to dynamically load the legacy third-party fabric core styles.
|
|
13
|
-
* This method should be called only when a third-party component(web part or extension)
|
|
14
|
-
* is being loaded on to the page.
|
|
15
|
-
*
|
|
16
|
-
* NOTE: Remove this method when the below killswitch is graduated from \@microsoft/sp-webpart-base.
|
|
17
|
-
* 'isStopLoadingLegacyFabricCSSKillSwitchActivated' - '57b771ed-2b57-41c2-aaaa-0e21c587c6dc'
|
|
18
|
-
*
|
|
19
|
-
* @param isComponentInternal - indicates whether the requesting component is internal to Microsoft or not.
|
|
20
|
-
*/
|
|
21
|
-
LegacyThirdPartyFabricCoreLoader.load = function (isComponentInternal) {
|
|
22
|
-
if (!isComponentInternal && !LegacyThirdPartyFabricCoreLoader._isLoaded) {
|
|
23
|
-
return import(
|
|
24
|
-
/* webpackChunkName: 'legacy-third-party-fabric-core-localfont' */ './chunks/legacy-third-party-fabric-core/FabricLocalFont').then(function () {
|
|
25
|
-
LegacyThirdPartyFabricCoreLoader._isLoaded = true;
|
|
26
|
-
return;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
return Promise.resolve();
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Method to dynamically force load the legacy third-party fabric core styles.
|
|
35
|
-
* All the below conditions are checked and needs to be true to force load the legacy css:
|
|
36
|
-
* 1. Should be third party component (web part or extension)
|
|
37
|
-
* 2. Should not be already loaded
|
|
38
|
-
* 3. Component should ask to load the legacy css or if the component is built version \< 1.8
|
|
39
|
-
*
|
|
40
|
-
* @param manifest - component's manifest
|
|
41
|
-
*/
|
|
42
|
-
LegacyThirdPartyFabricCoreLoader.forceLoad = function (manifest) {
|
|
43
|
-
try {
|
|
44
|
-
if (LegacyThirdPartyFabricCoreLoader._shouldLoad(manifest)) {
|
|
45
|
-
return import(
|
|
46
|
-
/* webpackChunkName: 'legacy-third-party-fabric-core-localfont' */ './chunks/legacy-third-party-fabric-core/FabricLocalFont').then(function () {
|
|
47
|
-
LegacyThirdPartyFabricCoreLoader._isLoaded = true;
|
|
48
|
-
return;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return Promise.resolve();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
return Promise.reject(error);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Method to check if the web part need to load the legacy css.
|
|
61
|
-
* @param manifest - component's manifest
|
|
62
|
-
*/
|
|
63
|
-
LegacyThirdPartyFabricCoreLoader.needLegacyFabricCss = function (manifest) {
|
|
64
|
-
if (manifest.isInternal) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
/*
|
|
68
|
-
* If loadLegacyFabricCss is not specified by the component, then load the css
|
|
69
|
-
* if the component is built before SPFx 1.8.2 or in some cases when we cannot get
|
|
70
|
-
* the version of the SPFx.
|
|
71
|
-
*/
|
|
72
|
-
if (manifest.loadLegacyFabricCss === undefined) {
|
|
73
|
-
var version = Version._tryParseSPFxVersion(manifest);
|
|
74
|
-
return !version || version.lessThan(Version.parse('1.8.2'));
|
|
75
|
-
}
|
|
76
|
-
// Respect 'loadLegacyFabricCss' if a real value is provided.
|
|
77
|
-
return manifest.loadLegacyFabricCss;
|
|
78
|
-
};
|
|
79
|
-
LegacyThirdPartyFabricCoreLoader._shouldLoad = function (manifest) {
|
|
80
|
-
return (!LegacyThirdPartyFabricCoreLoader._isLoaded &&
|
|
81
|
-
LegacyThirdPartyFabricCoreLoader.needLegacyFabricCss(manifest));
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Indicates whether the fabric-core styles are loaded on the page or not.
|
|
85
|
-
*/
|
|
86
|
-
LegacyThirdPartyFabricCoreLoader._isLoaded = false;
|
|
87
|
-
return LegacyThirdPartyFabricCoreLoader;
|
|
88
|
-
}());
|
|
89
|
-
export default LegacyThirdPartyFabricCoreLoader;
|
|
90
|
-
//# sourceMappingURL=LegacyThirdPartyFabricCoreLoader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMetadataProcessor.d.ts","sourceRoot":"","sources":["../src/PropertyMetadataProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAEpF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAKvF;;;;;GAKG;AACH,qBAAa,yBAAyB;IACpC;;;;;;OAMG;WACW,4BAA4B,CAAC,WAAW,SAAS,EAAE,EAC/D,kBAAkB,EAAE,SAAS,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,0BAA0B,CAAA;KAAE,EAC7E,UAAU,EAAE,WAAW,EACvB,sBAAsB,EAAE,8BAA8B,GACrD,IAAI;IAoFP;;;;;;;;OAQG;WACW,4BAA4B,CAAC,WAAW,SAAS,EAAE,EAC/D,kBAAkB,EAAE,SAAS,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,0BAA0B,CAAA;KAAE,EAC7E,UAAU,EAAE,WAAW,EACvB,sBAAsB,EAAE,SAAS,GAAG,8BAA8B,EAClE,QAAQ,CAAC,EAAE,4BAA4B,GACtC,IAAI;IAsHP,OAAO,CAAC,MAAM,CAAC,WAAW;IAc1B,OAAO,CAAC,MAAM,CAAC,YAAY;IAI3B;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAkB3C;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAyCvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShimmerFactory.d.ts","sourceRoot":"","sources":["../src/ShimmerFactory.ts"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC;;;;;;OAMG;WACW,aAAa,CACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,eAAe,GAAE,MAAM,GAAG,SAAqB,GAC9C,cAAc;IAwEjB,OAAO,CAAC,MAAM,CAAC,YAAY;CAiB5B"}
|
package/lib/ShimmerFactory.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import styles from './styles/shimmer.module.scss';
|
|
2
|
-
// These constants are taken from generic shimmer design.
|
|
3
|
-
var SHIMMER_WIDTH_DEFAULT = 100;
|
|
4
|
-
var SHIMMER_HEIGHT_DEFAULT = 100;
|
|
5
|
-
var SHIMMER_RECTANGLE_HEIGHT_MAX = 16;
|
|
6
|
-
var SHIMMER_RECTANGLE_COUNT = 4;
|
|
7
|
-
var SHIMMER_ELEMENT_COUNT = 2 * SHIMMER_RECTANGLE_COUNT + 1;
|
|
8
|
-
var RECTANGLE_X = 8;
|
|
9
|
-
var SHIMMER_MAIN_RECTANGLE_SIZE_RATIO = 0.9;
|
|
10
|
-
var RECTANGLE_1_LENGTH = 20;
|
|
11
|
-
var RECTANGLE_2_LENGTH = 40;
|
|
12
|
-
var RECTANGLE_3_LENGTH = 90;
|
|
13
|
-
var RECTANGLE_4_LENGTH = 80;
|
|
14
|
-
/**
|
|
15
|
-
* Class to create shimmers for applications.
|
|
16
|
-
*
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
var ShimmerFactory = /** @class */ (function () {
|
|
20
|
-
function ShimmerFactory() {
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Method that creates a shimmer for applications using an svg.
|
|
24
|
-
* @param width - Width of the shimmer
|
|
25
|
-
* @param height - Height of the shimmer
|
|
26
|
-
* @param componentTag - ID for the shimmer
|
|
27
|
-
* @param loadingMessage - Displays message when the shimmer loads
|
|
28
|
-
*/
|
|
29
|
-
ShimmerFactory.createShimmer = function (width, height, componentTag, loadingMessage, containerMargin) {
|
|
30
|
-
if (containerMargin === void 0) { containerMargin = undefined; }
|
|
31
|
-
width = width || SHIMMER_WIDTH_DEFAULT;
|
|
32
|
-
height = height || SHIMMER_HEIGHT_DEFAULT;
|
|
33
|
-
var shimmerContainerDiv = document.createElement('div');
|
|
34
|
-
shimmerContainerDiv.className = styles.shimmerContainer;
|
|
35
|
-
var shimmerDiv = document.createElement('div');
|
|
36
|
-
var mainRectangleHeight = height * SHIMMER_MAIN_RECTANGLE_SIZE_RATIO;
|
|
37
|
-
var rectangleHeight = mainRectangleHeight / SHIMMER_ELEMENT_COUNT;
|
|
38
|
-
rectangleHeight = Math.min(SHIMMER_RECTANGLE_HEIGHT_MAX, rectangleHeight);
|
|
39
|
-
var gap = 2 * rectangleHeight;
|
|
40
|
-
var rectangle1Y = rectangleHeight;
|
|
41
|
-
var rectangle2Y = rectangle1Y + gap;
|
|
42
|
-
var rectangle3Y = rectangle2Y + gap;
|
|
43
|
-
var rectangle4Y = rectangle3Y + gap;
|
|
44
|
-
var className = styles.shimmerElementFill;
|
|
45
|
-
shimmerDiv.innerHTML = "<svg width=".concat(width, " height=").concat(height, " viewBox=\"0 0 ").concat(width, " ").concat(height, "\" version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <title>").concat(loadingMessage, "</title>\n <g id=").concat(componentTag, "_Shimmer stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <rect x=\"0\" y=\"0\" width=").concat(width, " height=").concat(height, "></rect>\n ").concat(ShimmerFactory._shimmerRect(componentTag + '_1', className, RECTANGLE_X, rectangle1Y, RECTANGLE_1_LENGTH, rectangleHeight), "\n ").concat(ShimmerFactory._shimmerRect(componentTag + '_2', className, RECTANGLE_X, rectangle2Y, RECTANGLE_2_LENGTH, rectangleHeight), "\n ").concat(ShimmerFactory._shimmerRect(componentTag + '_3', className, RECTANGLE_X, rectangle3Y, RECTANGLE_3_LENGTH, rectangleHeight), "\n ").concat(ShimmerFactory._shimmerRect(componentTag + '_4', className, RECTANGLE_X, rectangle4Y, RECTANGLE_4_LENGTH, rectangleHeight), "\n </g>\n </svg>");
|
|
46
|
-
if (containerMargin !== undefined) {
|
|
47
|
-
shimmerContainerDiv.style.margin = containerMargin + '';
|
|
48
|
-
}
|
|
49
|
-
shimmerContainerDiv.appendChild(shimmerDiv);
|
|
50
|
-
var shimmerAccessibilityContainerDiv = document.createElement('div');
|
|
51
|
-
shimmerAccessibilityContainerDiv.setAttribute('role', 'status');
|
|
52
|
-
shimmerAccessibilityContainerDiv.setAttribute('aria-live', 'polite');
|
|
53
|
-
shimmerContainerDiv.appendChild(shimmerAccessibilityContainerDiv);
|
|
54
|
-
return shimmerContainerDiv;
|
|
55
|
-
};
|
|
56
|
-
ShimmerFactory._shimmerRect = function (id, className, x, y, width, height) {
|
|
57
|
-
return "<rect id=".concat(id, " class=").concat(className, " x=").concat(x, " y=").concat(y, " width=\"").concat(width, "%\" height=").concat(height, ">\n <animate\n attributeName=\"opacity\"\n dur=\"1s\"\n values=\"0.2;0.5;0.9\"\n repeatCount=\"indefinite\"\n begin=\"0\"/>\n </rect>");
|
|
58
|
-
};
|
|
59
|
-
return ShimmerFactory;
|
|
60
|
-
}());
|
|
61
|
-
export default ShimmerFactory;
|
|
62
|
-
//# sourceMappingURL=ShimmerFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FabricLocalFont.d.ts","sourceRoot":"","sources":["../../../src/chunks/legacy-third-party-fabric-core/FabricLocalFont.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,iDAAiD,CAAC;AACzD,OAAO,gCAAgC,CAAC;AAExC,OAAO,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Flights.d.ts","sourceRoot":"","sources":["../../src/common/Flights.ts"],"names":[],"mappings":"AAGA,wBAAgB,yBAAyB,IAAI,OAAO,CAEnD;AAGD,wBAAgB,kCAAkC,IAAI,OAAO,CAE5D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KillSwitches.d.ts","sourceRoot":"","sources":["../../src/common/KillSwitches.ts"],"names":[],"mappings":"AAEA,wBAAgB,qDAAqD,IAAI,OAAO,CAI/E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IWebPartLoadData.d.ts","sourceRoot":"","sources":["../../src/dataCollector/IWebPartLoadData.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,WAAW;;;;CAId,CAAC;AACX;;;GAGG;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE;;GAEG;AAEH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAC;AACX;;;GAGG;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAExF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;IAE1C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/typedef
|
|
5
|
-
export var CacheStatus = {
|
|
6
|
-
True: 'true',
|
|
7
|
-
False: 'false',
|
|
8
|
-
NotAvailable: 'N/A'
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/typedef
|
|
14
|
-
export var _CacheMissReason = {
|
|
15
|
-
/**
|
|
16
|
-
* Cache was available but config requested has changed.
|
|
17
|
-
*/
|
|
18
|
-
CacheConfigMissmatch: 'CacheConfigMissmatch',
|
|
19
|
-
/**
|
|
20
|
-
* Cache did not arrvie by the time web part requested it.
|
|
21
|
-
*/
|
|
22
|
-
LateFlush: 'LateFlush',
|
|
23
|
-
/**
|
|
24
|
-
* Cache is available but there is no cache entry for the web part.
|
|
25
|
-
*/
|
|
26
|
-
CachedItemNotFound: 'CachedItemNotFound',
|
|
27
|
-
/**
|
|
28
|
-
* Cache is available, config is also good but is too stale for use.
|
|
29
|
-
*/
|
|
30
|
-
CacheExpired: 'CacheExpired',
|
|
31
|
-
/**
|
|
32
|
-
* Cache miss happened but reason is not specified.
|
|
33
|
-
*/
|
|
34
|
-
NotSpecified: 'NotSpecified',
|
|
35
|
-
/**
|
|
36
|
-
* Not Applicable if there was cache hit.
|
|
37
|
-
*/
|
|
38
|
-
NotApplicable: 'N/A'
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=IWebPartLoadData.js.map
|