@skyux/config 5.0.1 → 5.5.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.
Files changed (48) hide show
  1. package/README.md +6 -4
  2. package/bundles/skyux-config.umd.js +16 -16
  3. package/esm2015/index.js +9 -0
  4. package/esm2015/index.js.map +1 -0
  5. package/esm2015/lib/app-config-host.js +26 -0
  6. package/esm2015/lib/app-config-host.js.map +1 -0
  7. package/esm2015/lib/app-config-module-for-root-args.js +2 -0
  8. package/esm2015/lib/app-config-module-for-root-args.js.map +1 -0
  9. package/esm2015/lib/app-config-params.js +32 -0
  10. package/esm2015/lib/app-config-params.js.map +1 -0
  11. package/esm2015/lib/app-config.module.js +40 -0
  12. package/esm2015/lib/app-config.module.js.map +1 -0
  13. package/esm2015/lib/config-params.js +2 -0
  14. package/esm2015/lib/config-params.js.map +1 -0
  15. package/esm2015/lib/config.js +12 -0
  16. package/esm2015/lib/config.js.map +1 -0
  17. package/esm2015/lib/params-provider.js +28 -0
  18. package/esm2015/lib/params-provider.js.map +1 -0
  19. package/esm2015/lib/params.js +134 -0
  20. package/esm2015/lib/params.js.map +1 -0
  21. package/esm2015/skyux-config.js +2 -2
  22. package/esm2015/skyux-config.js.map +1 -0
  23. package/fesm2015/skyux-config.js +16 -16
  24. package/fesm2015/skyux-config.js.map +1 -1
  25. package/index.d.ts +8 -0
  26. package/{app-config-host.d.ts → lib/app-config-host.d.ts} +0 -0
  27. package/{app-config-module-for-root-args.d.ts → lib/app-config-module-for-root-args.d.ts} +0 -0
  28. package/{app-config-params.d.ts → lib/app-config-params.d.ts} +0 -0
  29. package/{app-config.module.d.ts → lib/app-config.module.d.ts} +0 -0
  30. package/{config-params.d.ts → lib/config-params.d.ts} +0 -0
  31. package/{config.d.ts → lib/config.d.ts} +0 -0
  32. package/{params-provider.d.ts → lib/params-provider.d.ts} +0 -0
  33. package/{params.d.ts → lib/params.d.ts} +0 -0
  34. package/package.json +17 -3
  35. package/skyux-config.d.ts +1 -1
  36. package/LICENSE +0 -21
  37. package/bundles/skyux-config.umd.js.map +0 -1
  38. package/documentation.json +0 -4160
  39. package/esm2015/app-config-host.js +0 -26
  40. package/esm2015/app-config-module-for-root-args.js +0 -2
  41. package/esm2015/app-config-params.js +0 -32
  42. package/esm2015/app-config.module.js +0 -40
  43. package/esm2015/config-params.js +0 -2
  44. package/esm2015/config.js +0 -12
  45. package/esm2015/params-provider.js +0 -27
  46. package/esm2015/params.js +0 -134
  47. package/esm2015/public-api.js +0 -9
  48. package/public-api.d.ts +0 -8
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
- # @skyux/config
1
+ # config
2
2
 
3
- [![npm](https://img.shields.io/npm/v/@skyux/config.svg)](https://www.npmjs.com/package/@skyux/config)
4
- ![SKY UX CI](https://github.com/blackbaud/skyux-config/workflows/SKY%20UX%20CI/badge.svg)
5
- [![coverage](https://codecov.io/gh/blackbaud/skyux-config/branch/master/graphs/badge.svg?branch=master)](https://codecov.io/gh/blackbaud/skyux-config/branch/master)
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.
@@ -49,9 +49,9 @@
49
49
  };
50
50
  return SkyAppConfigHost;
51
51
  }());
52
- SkyAppConfigHost.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigHost, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
53
- SkyAppConfigHost.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigHost });
54
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigHost, decorators: [{
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: [{
55
55
  type: i0.Injectable
56
56
  }] });
57
57
 
@@ -86,9 +86,9 @@
86
86
  };
87
87
  return SkyAppConfigParams;
88
88
  }());
89
- SkyAppConfigParams.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigParams, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
90
- SkyAppConfigParams.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigParams });
91
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigParams, decorators: [{
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: [{
92
92
  type: i0.Injectable
93
93
  }] });
94
94
 
@@ -124,10 +124,10 @@
124
124
  };
125
125
  return SkyAppConfigModule;
126
126
  }());
127
- SkyAppConfigModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
128
- SkyAppConfigModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigModule });
129
- SkyAppConfigModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigModule });
130
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfigModule, decorators: [{
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: [{
131
131
  type: i0.NgModule,
132
132
  args: [{}]
133
133
  }] });
@@ -142,9 +142,9 @@
142
142
  }
143
143
  return SkyAppConfig;
144
144
  }());
145
- SkyAppConfig.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfig, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
146
- SkyAppConfig.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfig });
147
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppConfig, decorators: [{
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: [{
148
148
  type: i0.Injectable
149
149
  }] });
150
150
 
@@ -632,9 +632,9 @@
632
632
  });
633
633
  return SkyAppRuntimeConfigParamsProvider;
634
634
  }());
635
- SkyAppRuntimeConfigParamsProvider.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", 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.13", ngImport: i0__namespace, type: SkyAppRuntimeConfigParamsProvider, providedIn: 'root' });
637
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: SkyAppRuntimeConfigParamsProvider, decorators: [{
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: [{
638
638
  type: i0.Injectable,
639
639
  args: [{
640
640
  providedIn: 'root',
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=app-config-module-for-root-args.js.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config-params.js.map
@@ -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":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIlD;;;GAGG;AACH,SAAS,kBAAkB,CAAC,GAAW;IACrC,IAAI,EAAE,GAAG,EAAE,CAAC;IAEZ,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;QACzB,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACvB;IAED,OAAO,IAAI,UAAU,CAAC;QACpB,UAAU,EAAE,EAAE;KACf,CAAC,CAAC;AACL,CAAC;AAED,MAAM,OAAO,yBAAyB;IAWpC,YAAY,GAAW,EAAE,YAA+B;QAVhD,WAAM,GAA8B,EAAE,CAAC;QAEvC,uBAAkB,GAA8B,EAAE,CAAC;QAEnD,mBAAc,GAAa,EAAE,CAAC;QAE9B,kBAAa,GAAa,E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,CAAC;IAC7E,CAAC;CACF","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"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
- export * from './public-api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2t5dXgtY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvY29uZmlnL3NyYy9za3l1eC1jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
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"]}
@@ -20,9 +20,9 @@ class SkyAppConfigHost {
20
20
  this._host = Object.assign(Object.assign({}, DEFAULTS$1), (config || {}));
21
21
  }
22
22
  }
23
- SkyAppConfigHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigHost, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
24
- SkyAppConfigHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigHost });
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigHost, decorators: [{
23
+ SkyAppConfigHost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigHost, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
24
+ SkyAppConfigHost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigHost });
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigHost, decorators: [{
26
26
  type: Injectable
27
27
  }] });
28
28
 
@@ -50,9 +50,9 @@ class SkyAppConfigParams {
50
50
  this._params = Object.assign(Object.assign({}, DEFAULTS.params), (params || {}));
51
51
  }
52
52
  }
53
- SkyAppConfigParams.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigParams, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
54
- SkyAppConfigParams.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigParams });
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigParams, decorators: [{
53
+ SkyAppConfigParams.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigParams, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
54
+ SkyAppConfigParams.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigParams });
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigParams, decorators: [{
56
56
  type: Injectable
57
57
  }] });
58
58
 
@@ -84,10 +84,10 @@ class SkyAppConfigModule {
84
84
  };
85
85
  }
86
86
  }
87
- SkyAppConfigModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
88
- SkyAppConfigModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigModule });
89
- SkyAppConfigModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigModule });
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfigModule, decorators: [{
87
+ SkyAppConfigModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
88
+ SkyAppConfigModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigModule });
89
+ SkyAppConfigModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigModule });
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfigModule, decorators: [{
91
91
  type: NgModule,
92
92
  args: [{}]
93
93
  }] });
@@ -96,9 +96,9 @@ class SkyuxPactConfig {
96
96
  }
97
97
  class SkyAppConfig {
98
98
  }
99
- SkyAppConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
100
- SkyAppConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfig });
101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppConfig, decorators: [{
99
+ SkyAppConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
100
+ SkyAppConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfig });
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppConfig, decorators: [{
102
102
  type: Injectable
103
103
  }] });
104
104
 
@@ -247,9 +247,9 @@ class SkyAppRuntimeConfigParamsProvider {
247
247
  return this._params;
248
248
  }
249
249
  }
250
- SkyAppRuntimeConfigParamsProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppRuntimeConfigParamsProvider, deps: [{ token: SkyAppConfigParams, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
251
- SkyAppRuntimeConfigParamsProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppRuntimeConfigParamsProvider, providedIn: 'root' });
252
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyAppRuntimeConfigParamsProvider, decorators: [{
250
+ SkyAppRuntimeConfigParamsProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppRuntimeConfigParamsProvider, deps: [{ token: SkyAppConfigParams, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
251
+ SkyAppRuntimeConfigParamsProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppRuntimeConfigParamsProvider, providedIn: 'root' });
252
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppRuntimeConfigParamsProvider, decorators: [{
253
253
  type: Injectable,
254
254
  args: [{
255
255
  providedIn: 'root',