@skyux/config 5.0.0 → 5.5.0-beta.0
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/README.md +6 -4
- package/bundles/skyux-config.umd.js +38 -39
- package/esm2015/index.js +9 -0
- package/esm2015/index.js.map +1 -0
- package/esm2015/lib/app-config-host.js +26 -0
- package/esm2015/lib/app-config-host.js.map +1 -0
- package/esm2015/lib/app-config-module-for-root-args.js +2 -0
- package/esm2015/lib/app-config-module-for-root-args.js.map +1 -0
- package/esm2015/lib/app-config-params.js +32 -0
- package/esm2015/lib/app-config-params.js.map +1 -0
- package/esm2015/lib/app-config.module.js +40 -0
- package/esm2015/lib/app-config.module.js.map +1 -0
- package/esm2015/lib/config-params.js +2 -0
- package/esm2015/lib/config-params.js.map +1 -0
- package/esm2015/lib/config.js +12 -0
- package/esm2015/lib/config.js.map +1 -0
- package/esm2015/lib/params-provider.js +28 -0
- package/esm2015/lib/params-provider.js.map +1 -0
- package/esm2015/lib/params.js +134 -0
- package/esm2015/lib/params.js.map +1 -0
- package/esm2015/skyux-config.js +2 -2
- package/esm2015/skyux-config.js.map +1 -0
- package/fesm2015/skyux-config.js +37 -36
- package/fesm2015/skyux-config.js.map +1 -1
- package/index.d.ts +8 -0
- package/{app-config-host.d.ts → lib/app-config-host.d.ts} +0 -0
- package/{app-config-module-for-root-args.d.ts → lib/app-config-module-for-root-args.d.ts} +0 -0
- package/{app-config-params.d.ts → lib/app-config-params.d.ts} +0 -0
- package/{app-config.module.d.ts → lib/app-config.module.d.ts} +0 -0
- package/{config-params.d.ts → lib/config-params.d.ts} +0 -0
- package/{config.d.ts → lib/config.d.ts} +0 -0
- package/{params-provider.d.ts → lib/params-provider.d.ts} +0 -0
- package/{params.d.ts → lib/params.d.ts} +0 -0
- package/package.json +18 -4
- package/skyux-config.d.ts +1 -1
- package/LICENSE +0 -21
- package/bundles/skyux-config.umd.js.map +0 -1
- package/documentation.json +0 -4160
- package/esm2015/app-config-host.js +0 -26
- package/esm2015/app-config-module-for-root-args.js +0 -2
- package/esm2015/app-config-params.js +0 -32
- package/esm2015/app-config.module.js +0 -40
- package/esm2015/config-params.js +0 -2
- package/esm2015/config.js +0 -12
- package/esm2015/params-provider.js +0 -27
- package/esm2015/params.js +0 -133
- package/esm2015/public-api.js +0 -9
- package/public-api.d.ts +0 -8
package/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
#
|
1
|
+
# config
|
2
2
|
|
3
|
-
[
|
4
|
-
|
5
|
-
|
3
|
+
This library was generated with [Nx](https://nx.dev).
|
4
|
+
|
5
|
+
## Running unit tests
|
6
|
+
|
7
|
+
Run `nx test config` to execute the unit tests.
|
@@ -2,7 +2,7 @@
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http')) :
|
3
3
|
typeof define === 'function' && define.amd ? define('@skyux/config', ['exports', '@angular/core', '@angular/common/http'], factory) :
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.config = {}), global.ng.core, global.ng.common.http));
|
5
|
-
}(this, (function (exports, i0, http) { 'use strict';
|
5
|
+
})(this, (function (exports, i0, http) { 'use strict';
|
6
6
|
|
7
7
|
function _interopNamespace(e) {
|
8
8
|
if (e && e.__esModule) return e;
|
@@ -13,14 +13,12 @@
|
|
13
13
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
14
14
|
Object.defineProperty(n, k, d.get ? d : {
|
15
15
|
enumerable: true,
|
16
|
-
get: function () {
|
17
|
-
return e[k];
|
18
|
-
}
|
16
|
+
get: function () { return e[k]; }
|
19
17
|
});
|
20
18
|
}
|
21
19
|
});
|
22
20
|
}
|
23
|
-
n[
|
21
|
+
n["default"] = e;
|
24
22
|
return Object.freeze(n);
|
25
23
|
}
|
26
24
|
|
@@ -28,9 +26,9 @@
|
|
28
26
|
|
29
27
|
var DEFAULTS$1 = {
|
30
28
|
frameOptions: {
|
31
|
-
none: true
|
29
|
+
none: true,
|
32
30
|
},
|
33
|
-
url: 'https://host.nxt.blackbaud.com/'
|
31
|
+
url: 'https://host.nxt.blackbaud.com/',
|
34
32
|
};
|
35
33
|
/**
|
36
34
|
* Provides host configuration to components and applications.
|
@@ -47,28 +45,28 @@
|
|
47
45
|
configurable: true
|
48
46
|
});
|
49
47
|
SkyAppConfigHost.prototype.init = function (config) {
|
50
|
-
this._host = Object.assign(Object.assign({}, DEFAULTS$1), config || {});
|
48
|
+
this._host = Object.assign(Object.assign({}, DEFAULTS$1), (config || {}));
|
51
49
|
};
|
52
50
|
return SkyAppConfigHost;
|
53
51
|
}());
|
54
|
-
SkyAppConfigHost.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
55
|
-
SkyAppConfigHost.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
56
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
52
|
+
SkyAppConfigHost.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigHost, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
53
|
+
SkyAppConfigHost.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigHost });
|
54
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigHost, decorators: [{
|
57
55
|
type: i0.Injectable
|
58
56
|
}] });
|
59
57
|
|
60
58
|
var DEFAULTS = {
|
61
59
|
params: {
|
62
60
|
envid: {
|
63
|
-
required: false
|
61
|
+
required: false,
|
64
62
|
},
|
65
63
|
leid: {
|
66
|
-
required: false
|
64
|
+
required: false,
|
67
65
|
},
|
68
66
|
svcid: {
|
69
|
-
required: false
|
70
|
-
}
|
71
|
-
}
|
67
|
+
required: false,
|
68
|
+
},
|
69
|
+
},
|
72
70
|
};
|
73
71
|
/**
|
74
72
|
* @deprecated Use `SkyAppConfig.skyux.params` instead.
|
@@ -84,13 +82,13 @@
|
|
84
82
|
configurable: true
|
85
83
|
});
|
86
84
|
SkyAppConfigParams.prototype.init = function (params) {
|
87
|
-
this._params = Object.assign(Object.assign({}, DEFAULTS.params), params || {});
|
85
|
+
this._params = Object.assign(Object.assign({}, DEFAULTS.params), (params || {}));
|
88
86
|
};
|
89
87
|
return SkyAppConfigParams;
|
90
88
|
}());
|
91
|
-
SkyAppConfigParams.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
92
|
-
SkyAppConfigParams.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
93
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
89
|
+
SkyAppConfigParams.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigParams, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
90
|
+
SkyAppConfigParams.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigParams });
|
91
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigParams, decorators: [{
|
94
92
|
type: i0.Injectable
|
95
93
|
}] });
|
96
94
|
|
@@ -111,7 +109,7 @@
|
|
111
109
|
var appConfigParams = new SkyAppConfigParams();
|
112
110
|
appConfigParams.init(config.params);
|
113
111
|
return appConfigParams;
|
114
|
-
}
|
112
|
+
},
|
115
113
|
},
|
116
114
|
{
|
117
115
|
provide: SkyAppConfigHost,
|
@@ -119,17 +117,17 @@
|
|
119
117
|
var appConfigHost = new SkyAppConfigHost();
|
120
118
|
appConfigHost.init(config.host);
|
121
119
|
return appConfigHost;
|
122
|
-
}
|
123
|
-
}
|
124
|
-
]
|
120
|
+
},
|
121
|
+
},
|
122
|
+
],
|
125
123
|
};
|
126
124
|
};
|
127
125
|
return SkyAppConfigModule;
|
128
126
|
}());
|
129
|
-
SkyAppConfigModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
130
|
-
SkyAppConfigModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
131
|
-
SkyAppConfigModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
132
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
127
|
+
SkyAppConfigModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
128
|
+
SkyAppConfigModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigModule });
|
129
|
+
SkyAppConfigModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigModule });
|
130
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfigModule, decorators: [{
|
133
131
|
type: i0.NgModule,
|
134
132
|
args: [{}]
|
135
133
|
}] });
|
@@ -144,9 +142,9 @@
|
|
144
142
|
}
|
145
143
|
return SkyAppConfig;
|
146
144
|
}());
|
147
|
-
SkyAppConfig.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
148
|
-
SkyAppConfig.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
149
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
145
|
+
SkyAppConfig.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfig, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
146
|
+
SkyAppConfig.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfig });
|
147
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppConfig, decorators: [{
|
150
148
|
type: i0.Injectable
|
151
149
|
}] });
|
152
150
|
|
@@ -385,7 +383,7 @@
|
|
385
383
|
ar[i] = from[i];
|
386
384
|
}
|
387
385
|
}
|
388
|
-
return to.concat(ar || from);
|
386
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
389
387
|
}
|
390
388
|
function __await(v) {
|
391
389
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
@@ -479,7 +477,7 @@
|
|
479
477
|
qs = qs.split('#')[0];
|
480
478
|
}
|
481
479
|
return new http.HttpParams({
|
482
|
-
fromString: qs
|
480
|
+
fromString: qs,
|
483
481
|
});
|
484
482
|
}
|
485
483
|
var SkyAppRuntimeConfigParams = /** @class */ (function () {
|
@@ -585,7 +583,8 @@
|
|
585
583
|
var _this = this;
|
586
584
|
var filteredParams = {};
|
587
585
|
this.getAllKeys().forEach(function (key) {
|
588
|
-
if (!excludeDefaults ||
|
586
|
+
if (!excludeDefaults ||
|
587
|
+
_this.params[key] !== _this.defaultParamValues[key]) {
|
589
588
|
filteredParams[key] = _this.params[key];
|
590
589
|
}
|
591
590
|
});
|
@@ -633,12 +632,12 @@
|
|
633
632
|
});
|
634
633
|
return SkyAppRuntimeConfigParamsProvider;
|
635
634
|
}());
|
636
|
-
SkyAppRuntimeConfigParamsProvider.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
637
|
-
SkyAppRuntimeConfigParamsProvider.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
638
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
635
|
+
SkyAppRuntimeConfigParamsProvider.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppRuntimeConfigParamsProvider, deps: [{ token: SkyAppConfigParams, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
636
|
+
SkyAppRuntimeConfigParamsProvider.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppRuntimeConfigParamsProvider, providedIn: 'root' });
|
637
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyAppRuntimeConfigParamsProvider, decorators: [{
|
639
638
|
type: i0.Injectable,
|
640
639
|
args: [{
|
641
|
-
providedIn: 'root'
|
640
|
+
providedIn: 'root',
|
642
641
|
}]
|
643
642
|
}], ctorParameters: function () {
|
644
643
|
return [{ type: SkyAppConfigParams, decorators: [{
|
@@ -660,5 +659,5 @@
|
|
660
659
|
|
661
660
|
Object.defineProperty(exports, '__esModule', { value: true });
|
662
661
|
|
663
|
-
}))
|
662
|
+
}));
|
664
663
|
//# sourceMappingURL=skyux-config.umd.js.map
|
package/esm2015/index.js
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
export * from './lib/app-config-host';
|
2
|
+
export * from './lib/app-config-params';
|
3
|
+
export * from './lib/app-config-module-for-root-args';
|
4
|
+
export * from './lib/app-config.module';
|
5
|
+
export * from './lib/config-params';
|
6
|
+
export * from './lib/config';
|
7
|
+
export * from './lib/params-provider';
|
8
|
+
export * from './lib/params';
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/config/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,yBAAyB,CAAC;AAExC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAE7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC","sourcesContent":["export * from './lib/app-config-host';\nexport * from './lib/app-config-params';\nexport * from './lib/app-config-module-for-root-args';\nexport * from './lib/app-config.module';\n\nexport * from './lib/config-params';\nexport * from './lib/config';\n\nexport * from './lib/params-provider';\nexport * from './lib/params';\n"]}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
const DEFAULTS = {
|
4
|
+
frameOptions: {
|
5
|
+
none: true,
|
6
|
+
},
|
7
|
+
url: 'https://host.nxt.blackbaud.com/',
|
8
|
+
};
|
9
|
+
/**
|
10
|
+
* Provides host configuration to components and applications.
|
11
|
+
* @deprecated Use `SkyAppConfig.skyux.host` instead.
|
12
|
+
*/
|
13
|
+
export class SkyAppConfigHost {
|
14
|
+
get host() {
|
15
|
+
return this._host;
|
16
|
+
}
|
17
|
+
init(config) {
|
18
|
+
this._host = Object.assign(Object.assign({}, DEFAULTS), (config || {}));
|
19
|
+
}
|
20
|
+
}
|
21
|
+
SkyAppConfigHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigHost, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
22
|
+
SkyAppConfigHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigHost });
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigHost, decorators: [{
|
24
|
+
type: Injectable
|
25
|
+
}] });
|
26
|
+
//# sourceMappingURL=app-config-host.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"app-config-host.js","sourceRoot":"","sources":["../../../../../../libs/components/config/src/lib/app-config-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAI3C,MAAM,QAAQ,GAAoB;IAChC,YAAY,EAAE;QACZ,IAAI,EAAE,IAAI;KACX;IACD,GAAG,EAAE,iCAAiC;CACvC,CAAC;AAEF;;;GAGG;AAEH,MAAM,OAAO,gBAAgB;IAC3B,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAIM,IAAI,CAAC,MAAwB;QAClC,IAAI,CAAC,KAAK,mCACL,QAAQ,GACR,CAAC,MAAM,IAAI,EAAE,CAAC,CAClB,CAAC;IACJ,CAAC;;8GAZU,gBAAgB;kHAAhB,gBAAgB;4FAAhB,gBAAgB;kBAD5B,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { SkyuxConfigHost } from './config';\n\nconst DEFAULTS: SkyuxConfigHost = {\n frameOptions: {\n none: true,\n },\n url: 'https://host.nxt.blackbaud.com/',\n};\n\n/**\n * Provides host configuration to components and applications.\n * @deprecated Use `SkyAppConfig.skyux.host` instead.\n */\n@Injectable()\nexport class SkyAppConfigHost {\n public get host(): SkyuxConfigHost {\n return this._host;\n }\n\n private _host: SkyuxConfigHost;\n\n public init(config?: SkyuxConfigHost): void {\n this._host = {\n ...DEFAULTS,\n ...(config || {}),\n };\n }\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"app-config-module-for-root-args.js","sourceRoot":"","sources":["../../../../../../libs/components/config/src/lib/app-config-module-for-root-args.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyuxConfigHost } from './config';\n\nimport { SkyuxConfigParams } from './config-params';\n\nexport interface SkyAppConfigModuleForRootArgs {\n host?: SkyuxConfigHost;\n\n params?: SkyuxConfigParams;\n}\n"]}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
const DEFAULTS = {
|
4
|
+
params: {
|
5
|
+
envid: {
|
6
|
+
required: false,
|
7
|
+
},
|
8
|
+
leid: {
|
9
|
+
required: false,
|
10
|
+
},
|
11
|
+
svcid: {
|
12
|
+
required: false,
|
13
|
+
},
|
14
|
+
},
|
15
|
+
};
|
16
|
+
/**
|
17
|
+
* @deprecated Use `SkyAppConfig.skyux.params` instead.
|
18
|
+
*/
|
19
|
+
export class SkyAppConfigParams {
|
20
|
+
get params() {
|
21
|
+
return this._params;
|
22
|
+
}
|
23
|
+
init(params) {
|
24
|
+
this._params = Object.assign(Object.assign({}, DEFAULTS.params), (params || {}));
|
25
|
+
}
|
26
|
+
}
|
27
|
+
SkyAppConfigParams.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigParams, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
28
|
+
SkyAppConfigParams.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigParams });
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigParams, decorators: [{
|
30
|
+
type: Injectable
|
31
|
+
}] });
|
32
|
+
//# sourceMappingURL=app-config-params.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"app-config-params.js","sourceRoot":"","sources":["../../../../../../libs/components/config/src/lib/app-config-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAI3C,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE;QACN,KAAK,EAAE;YACL,QAAQ,EAAE,KAAK;SAChB;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,KAAK;SAChB;QACD,KAAK,EAAE;YACL,QAAQ,EAAE,KAAK;SAChB;KACF;CACF,CAAC;AAEF;;GAEG;AAEH,MAAM,OAAO,kBAAkB;IAC7B,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAIM,IAAI,CAAC,MAA0B;QACpC,IAAI,CAAC,OAAO,mCACP,QAAQ,CAAC,MAAM,GACf,CAAC,MAAM,IAAI,EAAE,CAAC,CAClB,CAAC;IACJ,CAAC;;gHAZU,kBAAkB;oHAAlB,kBAAkB;4FAAlB,kBAAkB;kBAD9B,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { SkyuxConfigParams } from './config-params';\n\nconst DEFAULTS = {\n params: {\n envid: {\n required: false,\n },\n leid: {\n required: false,\n },\n svcid: {\n required: false,\n },\n },\n};\n\n/**\n * @deprecated Use `SkyAppConfig.skyux.params` instead.\n */\n@Injectable()\nexport class SkyAppConfigParams {\n public get params(): SkyuxConfigParams {\n return this._params;\n }\n\n private _params: SkyuxConfigParams;\n\n public init(params?: SkyuxConfigParams): void {\n this._params = {\n ...DEFAULTS.params,\n ...(params || {}),\n };\n }\n}\n"]}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { NgModule } from '@angular/core';
|
2
|
+
import { SkyAppConfigHost } from './app-config-host';
|
3
|
+
import { SkyAppConfigParams } from './app-config-params';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
/**
|
6
|
+
* @deprecated Provide `SkyAppConfig` at the root instead.
|
7
|
+
*/
|
8
|
+
export class SkyAppConfigModule {
|
9
|
+
static forRoot(config = {}) {
|
10
|
+
return {
|
11
|
+
ngModule: SkyAppConfigModule,
|
12
|
+
providers: [
|
13
|
+
{
|
14
|
+
provide: SkyAppConfigParams,
|
15
|
+
useFactory() {
|
16
|
+
const appConfigParams = new SkyAppConfigParams();
|
17
|
+
appConfigParams.init(config.params);
|
18
|
+
return appConfigParams;
|
19
|
+
},
|
20
|
+
},
|
21
|
+
{
|
22
|
+
provide: SkyAppConfigHost,
|
23
|
+
useFactory() {
|
24
|
+
const appConfigHost = new SkyAppConfigHost();
|
25
|
+
appConfigHost.init(config.host);
|
26
|
+
return appConfigHost;
|
27
|
+
},
|
28
|
+
},
|
29
|
+
],
|
30
|
+
};
|
31
|
+
}
|
32
|
+
}
|
33
|
+
SkyAppConfigModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
34
|
+
SkyAppConfigModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigModule });
|
35
|
+
SkyAppConfigModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigModule });
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigModule, decorators: [{
|
37
|
+
type: NgModule,
|
38
|
+
args: [{}]
|
39
|
+
}] });
|
40
|
+
//# sourceMappingURL=app-config.module.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"app-config.module.js","sourceRoot":"","sources":["../../../../../../libs/components/config/src/lib/app-config.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;AAEzD;;GAEG;AAEH,MAAM,OAAO,kBAAkB;IACtB,MAAM,CAAC,OAAO,CACnB,SAAwC,EAAE;QAE1C,OAAO;YACL,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,kBAAkB;oBAC3B,UAAU;wBACR,MAAM,eAAe,GAAG,IAAI,kBAAkB,EAAE,CAAC;wBACjD,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;wBACpC,OAAO,eAAe,CAAC;oBACzB,CAAC;iBACF;gBACD;oBACE,OAAO,EAAE,gBAAgB;oBACzB,UAAU;wBACR,MAAM,aAAa,GAAG,IAAI,gBAAgB,EAAE,CAAC;wBAC7C,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;wBAChC,OAAO,aAAa,CAAC;oBACvB,CAAC;iBACF;aACF;SACF,CAAC;IACJ,CAAC;;gHAzBU,kBAAkB;iHAAlB,kBAAkB;iHAAlB,kBAAkB;4FAAlB,kBAAkB;kBAD9B,QAAQ;mBAAC,EAAE","sourcesContent":["import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { SkyAppConfigModuleForRootArgs } from './app-config-module-for-root-args';\n\nimport { SkyAppConfigHost } from './app-config-host';\n\nimport { SkyAppConfigParams } from './app-config-params';\n\n/**\n * @deprecated Provide `SkyAppConfig` at the root instead.\n */\n@NgModule({})\nexport class SkyAppConfigModule {\n public static forRoot(\n config: SkyAppConfigModuleForRootArgs = {}\n ): ModuleWithProviders<SkyAppConfigModule> {\n return {\n ngModule: SkyAppConfigModule,\n providers: [\n {\n provide: SkyAppConfigParams,\n useFactory() {\n const appConfigParams = new SkyAppConfigParams();\n appConfigParams.init(config.params);\n return appConfigParams;\n },\n },\n {\n provide: SkyAppConfigHost,\n useFactory() {\n const appConfigHost = new SkyAppConfigHost();\n appConfigHost.init(config.host);\n return appConfigHost;\n },\n },\n ],\n };\n }\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"config-params.js","sourceRoot":"","sources":["../../../../../../libs/components/config/src/lib/config-params.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Specifies a list of parameters that are allowed at runtime.\n */\nexport type SkyuxConfigParams = {\n [key: string]:\n | boolean\n | {\n value?: any;\n required?: boolean;\n excludeFromRequests?: boolean;\n };\n};\n"]}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export class SkyuxPactConfig {
|
4
|
+
}
|
5
|
+
export class SkyAppConfig {
|
6
|
+
}
|
7
|
+
SkyAppConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
8
|
+
SkyAppConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfig });
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfig, decorators: [{
|
10
|
+
type: Injectable
|
11
|
+
}] });
|
12
|
+
//# sourceMappingURL=config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../../libs/components/config/src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAW3C,MAAM,OAAO,eAAe;CAS3B;AAqJD,MAAM,OAAO,YAAY;;0GAAZ,YAAY;8GAAZ,YAAY;4FAAZ,YAAY;kBADxB,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\nimport { SkyAppRuntimeConfigParams } from './params';\nimport { SkyuxConfigParams } from './config-params';\n\nexport interface RuntimeConfigApp {\n base: string;\n inject: boolean;\n name?: string;\n template: string;\n}\n\nexport class SkyuxPactConfig {\n public providers?: {\n [provider: string]: {\n host?: string;\n port?: string;\n fullUrl?: string;\n };\n };\n public pactProxyServer?: string;\n}\n\nexport interface SkyuxConfigE2ETestSettings {\n browserSet?: 'speedy';\n}\n\nexport interface SkyuxConfigUnitTestSettings {\n browserSet?: 'speedy' | 'quirky' | 'paranoid';\n}\n\nexport interface SkyuxConfigTestSettings {\n e2e?: SkyuxConfigE2ETestSettings;\n unit?: SkyuxConfigUnitTestSettings;\n}\n\nexport interface SkyuxConfigLibrarySettings {\n whitelistedNonPeerDependencies?: string[];\n}\n\nexport interface RuntimeConfig {\n app: RuntimeConfigApp;\n command?: string; // Dynamically added in \"higher up\" webpacks\n componentsPattern: string;\n componentsIgnorePattern: string;\n handle404?: boolean; // Dynamically added in sky-pages-module-generator.js\n includeRouteModule: boolean;\n pactConfig?: SkyuxPactConfig;\n params: SkyAppRuntimeConfigParams;\n routes?: Object[]; // Dynamically added in sky-pages-module-generator.js\n routesPattern: string;\n runtimeAlias: string;\n spaPathAlias: string;\n skyPagesOutAlias: string;\n skyuxPathAlias: string;\n srcPath: string;\n useTemplateUrl: boolean;\n}\n\nexport interface SkyuxConfigA11y {\n rules?: any;\n}\n\nexport type SkyuxConfigAppSupportedTheme = 'default' | 'modern';\n\nexport interface SkyuxConfigAppTheming {\n supportedThemes: SkyuxConfigAppSupportedTheme[];\n theme: SkyuxConfigAppSupportedTheme;\n}\n\nexport interface SkyuxConfigApp {\n base?: string;\n externals?: Object;\n port?: string;\n styles?: string[];\n theming?: SkyuxConfigAppTheming;\n title?: string;\n}\n\nexport interface SkyuxConfigAuthSettings {\n blackbaudEmployee?: boolean;\n}\n\nexport interface SkyuxConfigHostBBCheckout {\n version: '2';\n}\n\nexport interface SkyuxConfigHostFrameOptionsNone {\n blackbaud?: false;\n none: true;\n self?: false;\n urls?: [];\n}\n\nexport interface SkyuxConfigHostFrameOptionsOthers {\n blackbaud?: boolean;\n none?: false;\n self?: boolean;\n urls?: string[];\n}\n\n/**\n * Blackbaud Only - Specifies configuration options for communication with SKY UX Host.\n */\nexport interface SkyuxConfigHost {\n bbCheckout?: SkyuxConfigHostBBCheckout;\n frameOptions?:\n | SkyuxConfigHostFrameOptionsNone\n | SkyuxConfigHostFrameOptionsOthers;\n url?: string;\n}\n\nexport interface SkyuxConfigAnyAllSet {\n any?: string[];\n all?: string[];\n}\n\nexport interface SkyuxConfig {\n $schema?: string;\n a11y?: SkyuxConfigA11y | boolean;\n app?: SkyuxConfigApp;\n appSettings?: any;\n auth?: boolean;\n authSettings?: SkyuxConfigAuthSettings;\n codeCoverageThreshold?: 'none' | 'standard' | 'strict';\n command?: string;\n compileMode?: string;\n cssPath?: string;\n dependenciesForTranspilation?: string[];\n enableIvy?: boolean;\n help?: any;\n host?: SkyuxConfigHost;\n importPath?: string;\n librarySettings?: SkyuxConfigLibrarySettings;\n mode?: string;\n moduleAliases?: { [key: string]: string };\n name?: string;\n pacts?: any[];\n params?: SkyuxConfigParams; // List of allowed params\n pipelineSettings?: any;\n plugins?: string[];\n redirects?: { [from: string]: string };\n routes?: {\n public?: {\n title?: string;\n description?: string;\n global?: boolean;\n route: string;\n claims?: SkyuxConfigAnyAllSet;\n entitlementType?: string;\n entitlements?: SkyuxConfigAnyAllSet;\n permissionId?: string;\n permissions?: {\n admin?: boolean;\n legalEntityAdmin?: boolean;\n permissionIds?: SkyuxConfigAnyAllSet;\n };\n }[];\n referenced?: {\n app: string;\n route: string;\n }[];\n };\n testSettings?: SkyuxConfigTestSettings;\n omnibar?: any;\n useHashRouting?: boolean;\n skyuxModules?: string[];\n}\n\n@Injectable()\nexport class SkyAppConfig {\n // Any properties dynamically added via code\n public runtime: RuntimeConfig;\n\n // Any properties defined in or inherited from skyuxconfig.json / skyuxconfig.command.json\n public skyux: SkyuxConfig;\n}\n"]}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Injectable, Optional } from '@angular/core';
|
2
|
+
import { SkyAppConfigParams } from './app-config-params';
|
3
|
+
import { SkyAppRuntimeConfigParams } from './params';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
import * as i1 from "./app-config-params";
|
6
|
+
/**
|
7
|
+
* Provides methods to interact with runtime config query parameters.
|
8
|
+
* @deprecated Use `SkyAppConfig.runtime.params` instead.
|
9
|
+
*/
|
10
|
+
export class SkyAppRuntimeConfigParamsProvider {
|
11
|
+
constructor(configParams) {
|
12
|
+
this._params = new SkyAppRuntimeConfigParams(window.location.href, (configParams === null || configParams === void 0 ? void 0 : configParams.params) || {});
|
13
|
+
}
|
14
|
+
get params() {
|
15
|
+
return this._params;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
SkyAppRuntimeConfigParamsProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppRuntimeConfigParamsProvider, deps: [{ token: i1.SkyAppConfigParams, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
19
|
+
SkyAppRuntimeConfigParamsProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppRuntimeConfigParamsProvider, providedIn: 'root' });
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppRuntimeConfigParamsProvider, decorators: [{
|
21
|
+
type: Injectable,
|
22
|
+
args: [{
|
23
|
+
providedIn: 'root',
|
24
|
+
}]
|
25
|
+
}], ctorParameters: function () { return [{ type: i1.SkyAppConfigParams, decorators: [{
|
26
|
+
type: Optional
|
27
|
+
}] }]; } });
|
28
|
+
//# sourceMappingURL=params-provider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"params-provider.js","sourceRoot":"","sources":["../../../../../../libs/components/config/src/lib/params-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;;;AAErD;;;GAGG;AAIH,MAAM,OAAO,iCAAiC;IAO5C,YAAwB,YAAiC;QACvD,IAAI,CAAC,OAAO,GAAG,IAAI,yBAAyB,CAC1C,MAAM,CAAC,QAAQ,CAAC,IAAI,EACpB,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,KAAI,EAAE,CAC3B,CAAC;IACJ,CAAC;IAXD,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;;+HAHU,iCAAiC;mIAAjC,iCAAiC,cAFhC,MAAM;4FAEP,iCAAiC;kBAH7C,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;0BAQc,QAAQ","sourcesContent":["import { Injectable, Optional } from '@angular/core';\n\nimport { SkyAppConfigParams } from './app-config-params';\n\nimport { SkyAppRuntimeConfigParams } from './params';\n\n/**\n * Provides methods to interact with runtime config query parameters.\n * @deprecated Use `SkyAppConfig.runtime.params` instead.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyAppRuntimeConfigParamsProvider {\n public get params(): SkyAppRuntimeConfigParams {\n return this._params;\n }\n\n private _params: SkyAppRuntimeConfigParams;\n\n constructor(@Optional() configParams?: SkyAppConfigParams) {\n this._params = new SkyAppRuntimeConfigParams(\n window.location.href,\n configParams?.params || {}\n );\n }\n}\n"]}
|
@@ -0,0 +1,134 @@
|
|
1
|
+
import { HttpParams } from '@angular/common/http';
|
2
|
+
/**
|
3
|
+
* Given a "url" (could be just querystring, or fully qualified),
|
4
|
+
* Returns the extracted HttpParams.
|
5
|
+
*/
|
6
|
+
function getUrlSearchParams(url) {
|
7
|
+
let qs = '';
|
8
|
+
if (url.indexOf('?') > -1) {
|
9
|
+
qs = url.split('?')[1];
|
10
|
+
qs = qs.split('#')[0];
|
11
|
+
}
|
12
|
+
return new HttpParams({
|
13
|
+
fromString: qs,
|
14
|
+
});
|
15
|
+
}
|
16
|
+
export class SkyAppRuntimeConfigParams {
|
17
|
+
constructor(url, configParams) {
|
18
|
+
this.params = {};
|
19
|
+
this.defaultParamValues = {};
|
20
|
+
this.requiredParams = [];
|
21
|
+
this.encodedParams = [];
|
22
|
+
this.excludeFromRequestsParams = [];
|
23
|
+
const allowed = [];
|
24
|
+
for (const paramName of Object.keys(configParams)) {
|
25
|
+
const configParam = configParams[paramName];
|
26
|
+
// The config param could be present but be set to false/undefined indicating
|
27
|
+
// an override of the default parameter.
|
28
|
+
if (configParam) {
|
29
|
+
allowed.push(paramName);
|
30
|
+
// A boolean value may be present to simply indicate that a parameter is allowed.
|
31
|
+
// If the type is object, look for additional config properties.
|
32
|
+
if (typeof configParam === 'object') {
|
33
|
+
const paramValue = configParam.value;
|
34
|
+
if (configParam.required) {
|
35
|
+
this.requiredParams.push(paramName);
|
36
|
+
}
|
37
|
+
if (paramValue) {
|
38
|
+
this.params[paramName] = paramValue;
|
39
|
+
this.defaultParamValues[paramName] = paramValue;
|
40
|
+
}
|
41
|
+
if (configParam.excludeFromRequests) {
|
42
|
+
this.excludeFromRequestsParams.push(paramName);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
const httpParams = getUrlSearchParams(url);
|
48
|
+
// Get uppercase keys.
|
49
|
+
const allowedKeysUC = allowed.map((key) => key.toUpperCase());
|
50
|
+
const urlSearchParamKeys = Array.from(httpParams.keys());
|
51
|
+
// Filter to allowed params and override default values.
|
52
|
+
urlSearchParamKeys.forEach((givenKey) => {
|
53
|
+
const givenKeyUC = givenKey.toUpperCase();
|
54
|
+
allowedKeysUC.forEach((allowedKeyUC, index) => {
|
55
|
+
if (givenKeyUC === allowedKeyUC) {
|
56
|
+
// To avoid breaking changes, we must encode the parameter value since
|
57
|
+
// this was the default behavior of the previously used UrlSearchParams utility.
|
58
|
+
// TODO: Remove encoding in favor of HttpParams' default behavior.
|
59
|
+
const value = encodeURIComponent(httpParams.get(givenKey));
|
60
|
+
this.params[allowed[index]] = value;
|
61
|
+
this.encodedParams.push(givenKey);
|
62
|
+
}
|
63
|
+
});
|
64
|
+
});
|
65
|
+
}
|
66
|
+
/**
|
67
|
+
* Does the key exist
|
68
|
+
*/
|
69
|
+
has(key) {
|
70
|
+
return this.params && this.params.hasOwnProperty(key);
|
71
|
+
}
|
72
|
+
/**
|
73
|
+
* Are all the required params defined?
|
74
|
+
*/
|
75
|
+
hasAllRequiredParams() {
|
76
|
+
if (this.requiredParams.length === 0) {
|
77
|
+
return true;
|
78
|
+
}
|
79
|
+
return this.requiredParams.every((param) => {
|
80
|
+
return this.params[param] !== undefined;
|
81
|
+
});
|
82
|
+
}
|
83
|
+
/**
|
84
|
+
* Returns a flag indicating whether a parameter is required.
|
85
|
+
*/
|
86
|
+
isRequired(key) {
|
87
|
+
return this.requiredParams.indexOf(key) >= 0;
|
88
|
+
}
|
89
|
+
/**
|
90
|
+
* Returns the decoded value of the requested param.
|
91
|
+
* @param key The parameter's key.
|
92
|
+
*/
|
93
|
+
get(key) {
|
94
|
+
if (this.has(key)) {
|
95
|
+
return decodeURIComponent(this.params[key]);
|
96
|
+
}
|
97
|
+
}
|
98
|
+
/**
|
99
|
+
* Returns the params object.
|
100
|
+
* @param excludeDefaults Exclude params that have default values
|
101
|
+
*/
|
102
|
+
getAll(excludeDefaults) {
|
103
|
+
const filteredParams = {};
|
104
|
+
this.getAllKeys().forEach((key) => {
|
105
|
+
if (!excludeDefaults ||
|
106
|
+
this.params[key] !== this.defaultParamValues[key]) {
|
107
|
+
filteredParams[key] = this.params[key];
|
108
|
+
}
|
109
|
+
});
|
110
|
+
return filteredParams;
|
111
|
+
}
|
112
|
+
/**
|
113
|
+
* Returns all keys for current params.
|
114
|
+
*/
|
115
|
+
getAllKeys() {
|
116
|
+
return Object.keys(this.params);
|
117
|
+
}
|
118
|
+
/**
|
119
|
+
* Adds the current params to the supplied url.
|
120
|
+
*/
|
121
|
+
getUrl(url) {
|
122
|
+
const httpParams = getUrlSearchParams(url);
|
123
|
+
const delimiter = url.indexOf('?') === -1 ? '?' : '&';
|
124
|
+
const joined = [];
|
125
|
+
this.getAllKeys().forEach((key) => {
|
126
|
+
if (this.excludeFromRequestsParams.indexOf(key) === -1 &&
|
127
|
+
!httpParams.has(key)) {
|
128
|
+
joined.push(`${key}=${encodeURIComponent(this.get(key))}`);
|
129
|
+
}
|
130
|
+
});
|
131
|
+
return joined.length === 0 ? url : `${url}${delimiter}${joined.join('&')}`;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
//# sourceMappingURL=params.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../../../../../libs/components/config/src/lib/params.ts"],"names":[],"mappings":"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","sourcesContent":["import { HttpParams } from '@angular/common/http';\n\nimport { SkyuxConfigParams } from './config-params';\n\n/**\n * Given a \"url\" (could be just querystring, or fully qualified),\n * Returns the extracted HttpParams.\n */\nfunction getUrlSearchParams(url: string): HttpParams {\n let qs = '';\n\n if (url.indexOf('?') > -1) {\n qs = url.split('?')[1];\n qs = qs.split('#')[0];\n }\n\n return new HttpParams({\n fromString: qs,\n });\n}\n\nexport class SkyAppRuntimeConfigParams {\n private params: { [key: string]: string } = {};\n\n private defaultParamValues: { [key: string]: string } = {};\n\n private requiredParams: string[] = [];\n\n private encodedParams: string[] = [];\n\n private excludeFromRequestsParams: string[] = [];\n\n constructor(url: string, configParams: SkyuxConfigParams) {\n const allowed: string[] = [];\n\n for (const paramName of Object.keys(configParams)) {\n const configParam = configParams[paramName];\n\n // The config param could be present but be set to false/undefined indicating\n // an override of the default parameter.\n if (configParam) {\n allowed.push(paramName);\n\n // A boolean value may be present to simply indicate that a parameter is allowed.\n // If the type is object, look for additional config properties.\n if (typeof configParam === 'object') {\n const paramValue = configParam.value;\n\n if (configParam.required) {\n this.requiredParams.push(paramName);\n }\n\n if (paramValue) {\n this.params[paramName] = paramValue;\n this.defaultParamValues[paramName] = paramValue;\n }\n\n if (configParam.excludeFromRequests) {\n this.excludeFromRequestsParams.push(paramName);\n }\n }\n }\n }\n\n const httpParams = getUrlSearchParams(url);\n\n // Get uppercase keys.\n const allowedKeysUC = allowed.map((key) => key.toUpperCase());\n const urlSearchParamKeys = Array.from(httpParams.keys());\n\n // Filter to allowed params and override default values.\n urlSearchParamKeys.forEach((givenKey) => {\n const givenKeyUC = givenKey.toUpperCase();\n allowedKeysUC.forEach((allowedKeyUC, index) => {\n if (givenKeyUC === allowedKeyUC) {\n // To avoid breaking changes, we must encode the parameter value since\n // this was the default behavior of the previously used UrlSearchParams utility.\n // TODO: Remove encoding in favor of HttpParams' default behavior.\n const value = encodeURIComponent(httpParams.get(givenKey));\n\n this.params[allowed[index]] = value;\n this.encodedParams.push(givenKey);\n }\n });\n });\n }\n\n /**\n * Does the key exist\n */\n public has(key: string): boolean {\n return this.params && this.params.hasOwnProperty(key);\n }\n\n /**\n * Are all the required params defined?\n */\n public hasAllRequiredParams(): boolean {\n if (this.requiredParams.length === 0) {\n return true;\n }\n\n return this.requiredParams.every((param: string) => {\n return this.params[param] !== undefined;\n });\n }\n\n /**\n * Returns a flag indicating whether a parameter is required.\n */\n public isRequired(key: string): boolean {\n return this.requiredParams.indexOf(key) >= 0;\n }\n\n /**\n * Returns the decoded value of the requested param.\n * @param key The parameter's key.\n */\n public get(key: string): string {\n if (this.has(key)) {\n return decodeURIComponent(this.params[key]);\n }\n }\n\n /**\n * Returns the params object.\n * @param excludeDefaults Exclude params that have default values\n */\n public getAll(excludeDefaults?: boolean): Object {\n const filteredParams: { [key: string]: string } = {};\n\n this.getAllKeys().forEach((key) => {\n if (\n !excludeDefaults ||\n this.params[key] !== this.defaultParamValues[key]\n ) {\n filteredParams[key] = this.params[key];\n }\n });\n\n return filteredParams;\n }\n\n /**\n * Returns all keys for current params.\n */\n public getAllKeys(): string[] {\n return Object.keys(this.params);\n }\n\n /**\n * Adds the current params to the supplied url.\n */\n public getUrl(url: string): string {\n const httpParams = getUrlSearchParams(url);\n const delimiter = url.indexOf('?') === -1 ? '?' : '&';\n const joined: string[] = [];\n\n this.getAllKeys().forEach((key) => {\n if (\n this.excludeFromRequestsParams.indexOf(key) === -1 &&\n !httpParams.has(key)\n ) {\n joined.push(`${key}=${encodeURIComponent(this.get(key))}`);\n }\n });\n\n return joined.length === 0 ? url : `${url}${delimiter}${joined.join('&')}`;\n }\n}\n"]}
|
package/esm2015/skyux-config.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
2
|
* Generated bundle index. Do not edit.
|
3
3
|
*/
|
4
|
-
export * from './
|
5
|
-
//# sourceMappingURL=
|
4
|
+
export * from './index';
|
5
|
+
//# sourceMappingURL=skyux-config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"skyux-config.js","sourceRoot":"","sources":["../../../../../libs/components/config/src/skyux-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"]}
|