@skyux/config 5.7.1 → 6.0.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/esm2020/index.mjs +9 -0
- package/esm2020/lib/app-config-host.mjs +29 -0
- package/esm2020/lib/app-config-module-for-root-args.mjs +2 -0
- package/esm2020/lib/app-config-params.mjs +35 -0
- package/esm2020/lib/app-config.module.mjs +40 -0
- package/esm2020/lib/config-params.mjs +2 -0
- package/esm2020/lib/config.mjs +12 -0
- package/esm2020/lib/params-provider.mjs +28 -0
- package/esm2020/lib/params.mjs +134 -0
- package/esm2020/skyux-config.mjs +5 -0
- package/fesm2015/{skyux-config.js → skyux-config.mjs} +22 -20
- package/fesm2015/skyux-config.mjs.map +1 -0
- package/fesm2020/skyux-config.mjs +272 -0
- package/fesm2020/skyux-config.mjs.map +1 -0
- package/package.json +21 -8
- package/bundles/skyux-config.umd.js +0 -663
- package/esm2015/index.js +0 -9
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/app-config-host.js +0 -26
- package/esm2015/lib/app-config-host.js.map +0 -1
- package/esm2015/lib/app-config-module-for-root-args.js +0 -2
- package/esm2015/lib/app-config-module-for-root-args.js.map +0 -1
- package/esm2015/lib/app-config-params.js +0 -32
- package/esm2015/lib/app-config-params.js.map +0 -1
- package/esm2015/lib/app-config.module.js +0 -40
- package/esm2015/lib/app-config.module.js.map +0 -1
- package/esm2015/lib/config-params.js +0 -2
- package/esm2015/lib/config-params.js.map +0 -1
- package/esm2015/lib/config.js +0 -12
- package/esm2015/lib/config.js.map +0 -1
- package/esm2015/lib/params-provider.js +0 -28
- package/esm2015/lib/params-provider.js.map +0 -1
- package/esm2015/lib/params.js +0 -134
- package/esm2015/lib/params.js.map +0 -1
- package/esm2015/skyux-config.js +0 -5
- package/esm2015/skyux-config.js.map +0 -1
- package/fesm2015/skyux-config.js.map +0 -1
@@ -1,663 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http')) :
|
3
|
-
typeof define === 'function' && define.amd ? define('@skyux/config', ['exports', '@angular/core', '@angular/common/http'], factory) :
|
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';
|
6
|
-
|
7
|
-
function _interopNamespace(e) {
|
8
|
-
if (e && e.__esModule) return e;
|
9
|
-
var n = Object.create(null);
|
10
|
-
if (e) {
|
11
|
-
Object.keys(e).forEach(function (k) {
|
12
|
-
if (k !== 'default') {
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
15
|
-
enumerable: true,
|
16
|
-
get: function () { return e[k]; }
|
17
|
-
});
|
18
|
-
}
|
19
|
-
});
|
20
|
-
}
|
21
|
-
n["default"] = e;
|
22
|
-
return Object.freeze(n);
|
23
|
-
}
|
24
|
-
|
25
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
26
|
-
|
27
|
-
var DEFAULTS$1 = {
|
28
|
-
frameOptions: {
|
29
|
-
none: true,
|
30
|
-
},
|
31
|
-
url: 'https://host.nxt.blackbaud.com/',
|
32
|
-
};
|
33
|
-
/**
|
34
|
-
* Provides host configuration to components and applications.
|
35
|
-
* @deprecated Use `SkyAppConfig.skyux.host` instead.
|
36
|
-
*/
|
37
|
-
var SkyAppConfigHost = /** @class */ (function () {
|
38
|
-
function SkyAppConfigHost() {
|
39
|
-
}
|
40
|
-
Object.defineProperty(SkyAppConfigHost.prototype, "host", {
|
41
|
-
get: function () {
|
42
|
-
return this._host;
|
43
|
-
},
|
44
|
-
enumerable: false,
|
45
|
-
configurable: true
|
46
|
-
});
|
47
|
-
SkyAppConfigHost.prototype.init = function (config) {
|
48
|
-
this._host = Object.assign(Object.assign({}, DEFAULTS$1), (config || {}));
|
49
|
-
};
|
50
|
-
return SkyAppConfigHost;
|
51
|
-
}());
|
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
|
-
type: i0.Injectable
|
56
|
-
}] });
|
57
|
-
|
58
|
-
var DEFAULTS = {
|
59
|
-
params: {
|
60
|
-
envid: {
|
61
|
-
required: false,
|
62
|
-
},
|
63
|
-
leid: {
|
64
|
-
required: false,
|
65
|
-
},
|
66
|
-
svcid: {
|
67
|
-
required: false,
|
68
|
-
},
|
69
|
-
},
|
70
|
-
};
|
71
|
-
/**
|
72
|
-
* @deprecated Use `SkyAppConfig.skyux.params` instead.
|
73
|
-
*/
|
74
|
-
var SkyAppConfigParams = /** @class */ (function () {
|
75
|
-
function SkyAppConfigParams() {
|
76
|
-
}
|
77
|
-
Object.defineProperty(SkyAppConfigParams.prototype, "params", {
|
78
|
-
get: function () {
|
79
|
-
return this._params;
|
80
|
-
},
|
81
|
-
enumerable: false,
|
82
|
-
configurable: true
|
83
|
-
});
|
84
|
-
SkyAppConfigParams.prototype.init = function (params) {
|
85
|
-
this._params = Object.assign(Object.assign({}, DEFAULTS.params), (params || {}));
|
86
|
-
};
|
87
|
-
return SkyAppConfigParams;
|
88
|
-
}());
|
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
|
-
type: i0.Injectable
|
93
|
-
}] });
|
94
|
-
|
95
|
-
/**
|
96
|
-
* @deprecated Provide `SkyAppConfig` at the root instead.
|
97
|
-
*/
|
98
|
-
var SkyAppConfigModule = /** @class */ (function () {
|
99
|
-
function SkyAppConfigModule() {
|
100
|
-
}
|
101
|
-
SkyAppConfigModule.forRoot = function (config) {
|
102
|
-
if (config === void 0) { config = {}; }
|
103
|
-
return {
|
104
|
-
ngModule: SkyAppConfigModule,
|
105
|
-
providers: [
|
106
|
-
{
|
107
|
-
provide: SkyAppConfigParams,
|
108
|
-
useFactory: function () {
|
109
|
-
var appConfigParams = new SkyAppConfigParams();
|
110
|
-
appConfigParams.init(config.params);
|
111
|
-
return appConfigParams;
|
112
|
-
},
|
113
|
-
},
|
114
|
-
{
|
115
|
-
provide: SkyAppConfigHost,
|
116
|
-
useFactory: function () {
|
117
|
-
var appConfigHost = new SkyAppConfigHost();
|
118
|
-
appConfigHost.init(config.host);
|
119
|
-
return appConfigHost;
|
120
|
-
},
|
121
|
-
},
|
122
|
-
],
|
123
|
-
};
|
124
|
-
};
|
125
|
-
return SkyAppConfigModule;
|
126
|
-
}());
|
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
|
-
type: i0.NgModule,
|
132
|
-
args: [{}]
|
133
|
-
}] });
|
134
|
-
|
135
|
-
var SkyuxPactConfig = /** @class */ (function () {
|
136
|
-
function SkyuxPactConfig() {
|
137
|
-
}
|
138
|
-
return SkyuxPactConfig;
|
139
|
-
}());
|
140
|
-
var SkyAppConfig = /** @class */ (function () {
|
141
|
-
function SkyAppConfig() {
|
142
|
-
}
|
143
|
-
return SkyAppConfig;
|
144
|
-
}());
|
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
|
-
type: i0.Injectable
|
149
|
-
}] });
|
150
|
-
|
151
|
-
/*! *****************************************************************************
|
152
|
-
Copyright (c) Microsoft Corporation.
|
153
|
-
|
154
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
155
|
-
purpose with or without fee is hereby granted.
|
156
|
-
|
157
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
158
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
159
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
160
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
161
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
162
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
163
|
-
PERFORMANCE OF THIS SOFTWARE.
|
164
|
-
***************************************************************************** */
|
165
|
-
/* global Reflect, Promise */
|
166
|
-
var extendStatics = function (d, b) {
|
167
|
-
extendStatics = Object.setPrototypeOf ||
|
168
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
169
|
-
function (d, b) { for (var p in b)
|
170
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
171
|
-
d[p] = b[p]; };
|
172
|
-
return extendStatics(d, b);
|
173
|
-
};
|
174
|
-
function __extends(d, b) {
|
175
|
-
if (typeof b !== "function" && b !== null)
|
176
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
177
|
-
extendStatics(d, b);
|
178
|
-
function __() { this.constructor = d; }
|
179
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
180
|
-
}
|
181
|
-
var __assign = function () {
|
182
|
-
__assign = Object.assign || function __assign(t) {
|
183
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
184
|
-
s = arguments[i];
|
185
|
-
for (var p in s)
|
186
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
187
|
-
t[p] = s[p];
|
188
|
-
}
|
189
|
-
return t;
|
190
|
-
};
|
191
|
-
return __assign.apply(this, arguments);
|
192
|
-
};
|
193
|
-
function __rest(s, e) {
|
194
|
-
var t = {};
|
195
|
-
for (var p in s)
|
196
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
197
|
-
t[p] = s[p];
|
198
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
199
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
200
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
201
|
-
t[p[i]] = s[p[i]];
|
202
|
-
}
|
203
|
-
return t;
|
204
|
-
}
|
205
|
-
function __decorate(decorators, target, key, desc) {
|
206
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
207
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
208
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
209
|
-
else
|
210
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
211
|
-
if (d = decorators[i])
|
212
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
213
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
214
|
-
}
|
215
|
-
function __param(paramIndex, decorator) {
|
216
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
217
|
-
}
|
218
|
-
function __metadata(metadataKey, metadataValue) {
|
219
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
220
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
221
|
-
}
|
222
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
223
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
224
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
225
|
-
function fulfilled(value) { try {
|
226
|
-
step(generator.next(value));
|
227
|
-
}
|
228
|
-
catch (e) {
|
229
|
-
reject(e);
|
230
|
-
} }
|
231
|
-
function rejected(value) { try {
|
232
|
-
step(generator["throw"](value));
|
233
|
-
}
|
234
|
-
catch (e) {
|
235
|
-
reject(e);
|
236
|
-
} }
|
237
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
238
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
239
|
-
});
|
240
|
-
}
|
241
|
-
function __generator(thisArg, body) {
|
242
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
243
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
244
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
245
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
246
|
-
function step(op) {
|
247
|
-
if (f)
|
248
|
-
throw new TypeError("Generator is already executing.");
|
249
|
-
while (_)
|
250
|
-
try {
|
251
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
252
|
-
return t;
|
253
|
-
if (y = 0, t)
|
254
|
-
op = [op[0] & 2, t.value];
|
255
|
-
switch (op[0]) {
|
256
|
-
case 0:
|
257
|
-
case 1:
|
258
|
-
t = op;
|
259
|
-
break;
|
260
|
-
case 4:
|
261
|
-
_.label++;
|
262
|
-
return { value: op[1], done: false };
|
263
|
-
case 5:
|
264
|
-
_.label++;
|
265
|
-
y = op[1];
|
266
|
-
op = [0];
|
267
|
-
continue;
|
268
|
-
case 7:
|
269
|
-
op = _.ops.pop();
|
270
|
-
_.trys.pop();
|
271
|
-
continue;
|
272
|
-
default:
|
273
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
274
|
-
_ = 0;
|
275
|
-
continue;
|
276
|
-
}
|
277
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
278
|
-
_.label = op[1];
|
279
|
-
break;
|
280
|
-
}
|
281
|
-
if (op[0] === 6 && _.label < t[1]) {
|
282
|
-
_.label = t[1];
|
283
|
-
t = op;
|
284
|
-
break;
|
285
|
-
}
|
286
|
-
if (t && _.label < t[2]) {
|
287
|
-
_.label = t[2];
|
288
|
-
_.ops.push(op);
|
289
|
-
break;
|
290
|
-
}
|
291
|
-
if (t[2])
|
292
|
-
_.ops.pop();
|
293
|
-
_.trys.pop();
|
294
|
-
continue;
|
295
|
-
}
|
296
|
-
op = body.call(thisArg, _);
|
297
|
-
}
|
298
|
-
catch (e) {
|
299
|
-
op = [6, e];
|
300
|
-
y = 0;
|
301
|
-
}
|
302
|
-
finally {
|
303
|
-
f = t = 0;
|
304
|
-
}
|
305
|
-
if (op[0] & 5)
|
306
|
-
throw op[1];
|
307
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
308
|
-
}
|
309
|
-
}
|
310
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
311
|
-
if (k2 === undefined)
|
312
|
-
k2 = k;
|
313
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
314
|
-
}) : (function (o, m, k, k2) {
|
315
|
-
if (k2 === undefined)
|
316
|
-
k2 = k;
|
317
|
-
o[k2] = m[k];
|
318
|
-
});
|
319
|
-
function __exportStar(m, o) {
|
320
|
-
for (var p in m)
|
321
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
322
|
-
__createBinding(o, m, p);
|
323
|
-
}
|
324
|
-
function __values(o) {
|
325
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
326
|
-
if (m)
|
327
|
-
return m.call(o);
|
328
|
-
if (o && typeof o.length === "number")
|
329
|
-
return {
|
330
|
-
next: function () {
|
331
|
-
if (o && i >= o.length)
|
332
|
-
o = void 0;
|
333
|
-
return { value: o && o[i++], done: !o };
|
334
|
-
}
|
335
|
-
};
|
336
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
337
|
-
}
|
338
|
-
function __read(o, n) {
|
339
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
340
|
-
if (!m)
|
341
|
-
return o;
|
342
|
-
var i = m.call(o), r, ar = [], e;
|
343
|
-
try {
|
344
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
345
|
-
ar.push(r.value);
|
346
|
-
}
|
347
|
-
catch (error) {
|
348
|
-
e = { error: error };
|
349
|
-
}
|
350
|
-
finally {
|
351
|
-
try {
|
352
|
-
if (r && !r.done && (m = i["return"]))
|
353
|
-
m.call(i);
|
354
|
-
}
|
355
|
-
finally {
|
356
|
-
if (e)
|
357
|
-
throw e.error;
|
358
|
-
}
|
359
|
-
}
|
360
|
-
return ar;
|
361
|
-
}
|
362
|
-
/** @deprecated */
|
363
|
-
function __spread() {
|
364
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
365
|
-
ar = ar.concat(__read(arguments[i]));
|
366
|
-
return ar;
|
367
|
-
}
|
368
|
-
/** @deprecated */
|
369
|
-
function __spreadArrays() {
|
370
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
371
|
-
s += arguments[i].length;
|
372
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
373
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
374
|
-
r[k] = a[j];
|
375
|
-
return r;
|
376
|
-
}
|
377
|
-
function __spreadArray(to, from, pack) {
|
378
|
-
if (pack || arguments.length === 2)
|
379
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
380
|
-
if (ar || !(i in from)) {
|
381
|
-
if (!ar)
|
382
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
383
|
-
ar[i] = from[i];
|
384
|
-
}
|
385
|
-
}
|
386
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
387
|
-
}
|
388
|
-
function __await(v) {
|
389
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
390
|
-
}
|
391
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
392
|
-
if (!Symbol.asyncIterator)
|
393
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
394
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
395
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
396
|
-
function verb(n) { if (g[n])
|
397
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
398
|
-
function resume(n, v) { try {
|
399
|
-
step(g[n](v));
|
400
|
-
}
|
401
|
-
catch (e) {
|
402
|
-
settle(q[0][3], e);
|
403
|
-
} }
|
404
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
405
|
-
function fulfill(value) { resume("next", value); }
|
406
|
-
function reject(value) { resume("throw", value); }
|
407
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
408
|
-
resume(q[0][0], q[0][1]); }
|
409
|
-
}
|
410
|
-
function __asyncDelegator(o) {
|
411
|
-
var i, p;
|
412
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
413
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
414
|
-
}
|
415
|
-
function __asyncValues(o) {
|
416
|
-
if (!Symbol.asyncIterator)
|
417
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
418
|
-
var m = o[Symbol.asyncIterator], i;
|
419
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
420
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
421
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
422
|
-
}
|
423
|
-
function __makeTemplateObject(cooked, raw) {
|
424
|
-
if (Object.defineProperty) {
|
425
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
426
|
-
}
|
427
|
-
else {
|
428
|
-
cooked.raw = raw;
|
429
|
-
}
|
430
|
-
return cooked;
|
431
|
-
}
|
432
|
-
;
|
433
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
434
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
435
|
-
}) : function (o, v) {
|
436
|
-
o["default"] = v;
|
437
|
-
};
|
438
|
-
function __importStar(mod) {
|
439
|
-
if (mod && mod.__esModule)
|
440
|
-
return mod;
|
441
|
-
var result = {};
|
442
|
-
if (mod != null)
|
443
|
-
for (var k in mod)
|
444
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
445
|
-
__createBinding(result, mod, k);
|
446
|
-
__setModuleDefault(result, mod);
|
447
|
-
return result;
|
448
|
-
}
|
449
|
-
function __importDefault(mod) {
|
450
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
451
|
-
}
|
452
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
453
|
-
if (kind === "a" && !f)
|
454
|
-
throw new TypeError("Private accessor was defined without a getter");
|
455
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
456
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
457
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
458
|
-
}
|
459
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
460
|
-
if (kind === "m")
|
461
|
-
throw new TypeError("Private method is not writable");
|
462
|
-
if (kind === "a" && !f)
|
463
|
-
throw new TypeError("Private accessor was defined without a setter");
|
464
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
465
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
466
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
467
|
-
}
|
468
|
-
|
469
|
-
/**
|
470
|
-
* Given a "url" (could be just querystring, or fully qualified),
|
471
|
-
* Returns the extracted HttpParams.
|
472
|
-
*/
|
473
|
-
function getUrlSearchParams(url) {
|
474
|
-
var qs = '';
|
475
|
-
if (url.indexOf('?') > -1) {
|
476
|
-
qs = url.split('?')[1];
|
477
|
-
qs = qs.split('#')[0];
|
478
|
-
}
|
479
|
-
return new http.HttpParams({
|
480
|
-
fromString: qs,
|
481
|
-
});
|
482
|
-
}
|
483
|
-
var SkyAppRuntimeConfigParams = /** @class */ (function () {
|
484
|
-
function SkyAppRuntimeConfigParams(url, configParams) {
|
485
|
-
var e_1, _a;
|
486
|
-
var _this = this;
|
487
|
-
this.params = {};
|
488
|
-
this.defaultParamValues = {};
|
489
|
-
this.requiredParams = [];
|
490
|
-
this.encodedParams = [];
|
491
|
-
this.excludeFromRequestsParams = [];
|
492
|
-
var allowed = [];
|
493
|
-
try {
|
494
|
-
for (var _b = __values(Object.keys(configParams)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
495
|
-
var paramName = _c.value;
|
496
|
-
var configParam = configParams[paramName];
|
497
|
-
// The config param could be present but be set to false/undefined indicating
|
498
|
-
// an override of the default parameter.
|
499
|
-
if (configParam) {
|
500
|
-
allowed.push(paramName);
|
501
|
-
// A boolean value may be present to simply indicate that a parameter is allowed.
|
502
|
-
// If the type is object, look for additional config properties.
|
503
|
-
if (typeof configParam === 'object') {
|
504
|
-
var paramValue = configParam.value;
|
505
|
-
if (configParam.required) {
|
506
|
-
this.requiredParams.push(paramName);
|
507
|
-
}
|
508
|
-
if (paramValue) {
|
509
|
-
this.params[paramName] = paramValue;
|
510
|
-
this.defaultParamValues[paramName] = paramValue;
|
511
|
-
}
|
512
|
-
if (configParam.excludeFromRequests) {
|
513
|
-
this.excludeFromRequestsParams.push(paramName);
|
514
|
-
}
|
515
|
-
}
|
516
|
-
}
|
517
|
-
}
|
518
|
-
}
|
519
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
520
|
-
finally {
|
521
|
-
try {
|
522
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
523
|
-
}
|
524
|
-
finally { if (e_1) throw e_1.error; }
|
525
|
-
}
|
526
|
-
var httpParams = getUrlSearchParams(url);
|
527
|
-
// Get uppercase keys.
|
528
|
-
var allowedKeysUC = allowed.map(function (key) { return key.toUpperCase(); });
|
529
|
-
var urlSearchParamKeys = Array.from(httpParams.keys());
|
530
|
-
// Filter to allowed params and override default values.
|
531
|
-
urlSearchParamKeys.forEach(function (givenKey) {
|
532
|
-
var givenKeyUC = givenKey.toUpperCase();
|
533
|
-
allowedKeysUC.forEach(function (allowedKeyUC, index) {
|
534
|
-
if (givenKeyUC === allowedKeyUC) {
|
535
|
-
// To avoid breaking changes, we must encode the parameter value since
|
536
|
-
// this was the default behavior of the previously used UrlSearchParams utility.
|
537
|
-
// TODO: Remove encoding in favor of HttpParams' default behavior.
|
538
|
-
var value = encodeURIComponent(httpParams.get(givenKey));
|
539
|
-
_this.params[allowed[index]] = value;
|
540
|
-
_this.encodedParams.push(givenKey);
|
541
|
-
}
|
542
|
-
});
|
543
|
-
});
|
544
|
-
}
|
545
|
-
/**
|
546
|
-
* Does the key exist
|
547
|
-
*/
|
548
|
-
SkyAppRuntimeConfigParams.prototype.has = function (key) {
|
549
|
-
return (this.params && Object.prototype.hasOwnProperty.call(this.params, key));
|
550
|
-
};
|
551
|
-
/**
|
552
|
-
* Are all the required params defined?
|
553
|
-
*/
|
554
|
-
SkyAppRuntimeConfigParams.prototype.hasAllRequiredParams = function () {
|
555
|
-
var _this = this;
|
556
|
-
if (this.requiredParams.length === 0) {
|
557
|
-
return true;
|
558
|
-
}
|
559
|
-
return this.requiredParams.every(function (param) {
|
560
|
-
return _this.params[param] !== undefined;
|
561
|
-
});
|
562
|
-
};
|
563
|
-
/**
|
564
|
-
* Returns a flag indicating whether a parameter is required.
|
565
|
-
*/
|
566
|
-
SkyAppRuntimeConfigParams.prototype.isRequired = function (key) {
|
567
|
-
return this.requiredParams.indexOf(key) >= 0;
|
568
|
-
};
|
569
|
-
/**
|
570
|
-
* Returns the decoded value of the requested param.
|
571
|
-
* @param key The parameter's key.
|
572
|
-
*/
|
573
|
-
SkyAppRuntimeConfigParams.prototype.get = function (key) {
|
574
|
-
if (this.has(key)) {
|
575
|
-
return decodeURIComponent(this.params[key]);
|
576
|
-
}
|
577
|
-
};
|
578
|
-
/**
|
579
|
-
* Returns the params object.
|
580
|
-
* @param excludeDefaults Exclude params that have default values
|
581
|
-
*/
|
582
|
-
SkyAppRuntimeConfigParams.prototype.getAll = function (excludeDefaults) {
|
583
|
-
var _this = this;
|
584
|
-
var filteredParams = {};
|
585
|
-
this.getAllKeys().forEach(function (key) {
|
586
|
-
if (!excludeDefaults ||
|
587
|
-
_this.params[key] !== _this.defaultParamValues[key]) {
|
588
|
-
filteredParams[key] = _this.params[key];
|
589
|
-
}
|
590
|
-
});
|
591
|
-
return filteredParams;
|
592
|
-
};
|
593
|
-
/**
|
594
|
-
* Returns all keys for current params.
|
595
|
-
*/
|
596
|
-
SkyAppRuntimeConfigParams.prototype.getAllKeys = function () {
|
597
|
-
return Object.keys(this.params);
|
598
|
-
};
|
599
|
-
/**
|
600
|
-
* Adds the current params to the supplied url.
|
601
|
-
*/
|
602
|
-
SkyAppRuntimeConfigParams.prototype.getUrl = function (url) {
|
603
|
-
var _this = this;
|
604
|
-
var httpParams = getUrlSearchParams(url);
|
605
|
-
var delimiter = url.indexOf('?') === -1 ? '?' : '&';
|
606
|
-
var joined = [];
|
607
|
-
this.getAllKeys().forEach(function (key) {
|
608
|
-
if (_this.excludeFromRequestsParams.indexOf(key) === -1 &&
|
609
|
-
!httpParams.has(key)) {
|
610
|
-
joined.push(key + "=" + encodeURIComponent(_this.get(key)));
|
611
|
-
}
|
612
|
-
});
|
613
|
-
return joined.length === 0 ? url : "" + url + delimiter + joined.join('&');
|
614
|
-
};
|
615
|
-
return SkyAppRuntimeConfigParams;
|
616
|
-
}());
|
617
|
-
|
618
|
-
/**
|
619
|
-
* Provides methods to interact with runtime config query parameters.
|
620
|
-
* @deprecated Use `SkyAppConfig.runtime.params` instead.
|
621
|
-
*/
|
622
|
-
var SkyAppRuntimeConfigParamsProvider = /** @class */ (function () {
|
623
|
-
function SkyAppRuntimeConfigParamsProvider(configParams) {
|
624
|
-
this._params = new SkyAppRuntimeConfigParams(window.location.href, (configParams === null || configParams === void 0 ? void 0 : configParams.params) || {});
|
625
|
-
}
|
626
|
-
Object.defineProperty(SkyAppRuntimeConfigParamsProvider.prototype, "params", {
|
627
|
-
get: function () {
|
628
|
-
return this._params;
|
629
|
-
},
|
630
|
-
enumerable: false,
|
631
|
-
configurable: true
|
632
|
-
});
|
633
|
-
return SkyAppRuntimeConfigParamsProvider;
|
634
|
-
}());
|
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
|
-
type: i0.Injectable,
|
639
|
-
args: [{
|
640
|
-
providedIn: 'root',
|
641
|
-
}]
|
642
|
-
}], ctorParameters: function () {
|
643
|
-
return [{ type: SkyAppConfigParams, decorators: [{
|
644
|
-
type: i0.Optional
|
645
|
-
}] }];
|
646
|
-
} });
|
647
|
-
|
648
|
-
/**
|
649
|
-
* Generated bundle index. Do not edit.
|
650
|
-
*/
|
651
|
-
|
652
|
-
exports.SkyAppConfig = SkyAppConfig;
|
653
|
-
exports.SkyAppConfigHost = SkyAppConfigHost;
|
654
|
-
exports.SkyAppConfigModule = SkyAppConfigModule;
|
655
|
-
exports.SkyAppConfigParams = SkyAppConfigParams;
|
656
|
-
exports.SkyAppRuntimeConfigParams = SkyAppRuntimeConfigParams;
|
657
|
-
exports.SkyAppRuntimeConfigParamsProvider = SkyAppRuntimeConfigParamsProvider;
|
658
|
-
exports.SkyuxPactConfig = SkyuxPactConfig;
|
659
|
-
|
660
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
661
|
-
|
662
|
-
}));
|
663
|
-
//# sourceMappingURL=skyux-config.umd.js.map
|
package/esm2015/index.js
DELETED
@@ -1,9 +0,0 @@
|
|
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
|
package/esm2015/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
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"]}
|