@sunbird-cb/resolver 0.0.3 → 1.0.0-ang-13-16
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/esm2022/lib/invalid-permission/invalid-permission.component.mjs +29 -0
- package/esm2022/lib/invalid-registration/invalid-registration.component.mjs +23 -0
- package/esm2022/lib/restricted/restricted.component.mjs +23 -0
- package/esm2022/lib/unresolved/unresolved.component.mjs +30 -0
- package/esm2022/lib/widget-base.component.mjs +60 -0
- package/esm2022/lib/widget-resolver.constant.mjs +4 -0
- package/esm2022/lib/widget-resolver.directive.mjs +35 -0
- package/esm2022/lib/widget-resolver.model.mjs +2 -0
- package/esm2022/lib/widget-resolver.module.mjs +70 -0
- package/esm2022/lib/widget-resolver.permissions.mjs +74 -0
- package/esm2022/lib/widget-resolver.service.mjs +96 -0
- package/esm2022/public-api.mjs +7 -0
- package/esm2022/sunbird-cb-resolver.mjs +2 -0
- package/fesm2022/sunbird-cb-resolver.mjs +401 -0
- package/fesm2022/sunbird-cb-resolver.mjs.map +1 -0
- package/index.d.ts +3 -0
- package/lib/invalid-permission/invalid-permission.component.d.ts +15 -11
- package/lib/invalid-permission/invalid-permission.component.d.ts.map +1 -0
- package/lib/invalid-registration/invalid-registration.component.d.ts +12 -8
- package/lib/invalid-registration/invalid-registration.component.d.ts.map +1 -0
- package/lib/restricted/restricted.component.d.ts +12 -8
- package/lib/restricted/restricted.component.d.ts.map +1 -0
- package/lib/unresolved/unresolved.component.d.ts +14 -10
- package/lib/unresolved/unresolved.component.d.ts.map +1 -0
- package/lib/widget-base.component.d.ts +19 -15
- package/lib/widget-base.component.d.ts.map +1 -0
- package/lib/widget-resolver.constant.d.ts +5 -4
- package/lib/widget-resolver.constant.d.ts.map +1 -0
- package/lib/widget-resolver.directive.d.ts +16 -12
- package/lib/widget-resolver.directive.d.ts.map +1 -0
- package/lib/widget-resolver.model.d.ts +49 -48
- package/lib/widget-resolver.model.d.ts.map +1 -0
- package/lib/widget-resolver.module.d.ts +21 -6
- package/lib/widget-resolver.module.d.ts.map +1 -0
- package/lib/widget-resolver.permissions.d.ts +4 -3
- package/lib/widget-resolver.permissions.d.ts.map +1 -0
- package/lib/widget-resolver.service.d.ts +24 -22
- package/lib/widget-resolver.service.d.ts.map +1 -0
- package/package.json +30 -25
- package/public-api.d.ts +7 -5
- package/public-api.d.ts.map +1 -0
- package/sunbird-cb-resolver-1.0.0-ang-13-16.tgz +0 -0
- package/sunbird-cb-resolver.d.ts.map +1 -0
- package/bundles/sunbird-cb-resolver.umd.js +0 -750
- package/bundles/sunbird-cb-resolver.umd.js.map +0 -1
- package/bundles/sunbird-cb-resolver.umd.min.js +0 -16
- package/bundles/sunbird-cb-resolver.umd.min.js.map +0 -1
- package/esm2015/lib/invalid-permission/invalid-permission.component.js +0 -30
- package/esm2015/lib/invalid-registration/invalid-registration.component.js +0 -24
- package/esm2015/lib/restricted/restricted.component.js +0 -24
- package/esm2015/lib/unresolved/unresolved.component.js +0 -33
- package/esm2015/lib/widget-base.component.js +0 -51
- package/esm2015/lib/widget-resolver.constant.js +0 -4
- package/esm2015/lib/widget-resolver.directive.js +0 -43
- package/esm2015/lib/widget-resolver.model.js +0 -57
- package/esm2015/lib/widget-resolver.module.js +0 -65
- package/esm2015/lib/widget-resolver.permissions.js +0 -74
- package/esm2015/lib/widget-resolver.service.js +0 -114
- package/esm2015/public-api.js +0 -6
- package/esm2015/sunbird-cb-resolver.js +0 -8
- package/esm5/lib/invalid-permission/invalid-permission.component.js +0 -35
- package/esm5/lib/invalid-registration/invalid-registration.component.js +0 -29
- package/esm5/lib/restricted/restricted.component.js +0 -29
- package/esm5/lib/unresolved/unresolved.component.js +0 -38
- package/esm5/lib/widget-base.component.js +0 -54
- package/esm5/lib/widget-resolver.constant.js +0 -4
- package/esm5/lib/widget-resolver.directive.js +0 -45
- package/esm5/lib/widget-resolver.model.js +0 -57
- package/esm5/lib/widget-resolver.module.js +0 -69
- package/esm5/lib/widget-resolver.permissions.js +0 -79
- package/esm5/lib/widget-resolver.service.js +0 -120
- package/esm5/public-api.js +0 -6
- package/esm5/sunbird-cb-resolver.js +0 -8
- package/fesm2015/sunbird-cb-resolver.js +0 -489
- package/fesm2015/sunbird-cb-resolver.js.map +0 -1
- package/fesm5/sunbird-cb-resolver.js +0 -517
- package/fesm5/sunbird-cb-resolver.js.map +0 -1
- package/sunbird-cb-resolver.d.ts +0 -8
- package/sunbird-cb-resolver.metadata.json +0 -1
|
@@ -1,750 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@sunbird-cb/utils'), require('@angular/platform-browser'), require('@angular/material')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@sunbird-cb/resolver', ['exports', '@angular/core', '@angular/common', '@sunbird-cb/utils', '@angular/platform-browser', '@angular/material'], factory) :
|
|
4
|
-
(global = global || self, factory((global['sunbird-cb'] = global['sunbird-cb'] || {}, global['sunbird-cb'].resolver = {}), global.ng.core, global.ng.common, global['@sunbird-cb/utils'], global.ng.platformBrowser, global.ng.material));
|
|
5
|
-
}(this, (function (exports, core, common, utils, platformBrowser, material) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation.
|
|
9
|
-
|
|
10
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
-
purpose with or without fee is hereby granted.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
|
|
23
|
-
var extendStatics = function(d, b) {
|
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics(d, b);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
function __extends(d, b) {
|
|
31
|
-
extendStatics(d, b);
|
|
32
|
-
function __() { this.constructor = d; }
|
|
33
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var __assign = function() {
|
|
37
|
-
__assign = Object.assign || function __assign(t) {
|
|
38
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
39
|
-
s = arguments[i];
|
|
40
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
41
|
-
}
|
|
42
|
-
return t;
|
|
43
|
-
};
|
|
44
|
-
return __assign.apply(this, arguments);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
function __rest(s, e) {
|
|
48
|
-
var t = {};
|
|
49
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
50
|
-
t[p] = s[p];
|
|
51
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
52
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
53
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
54
|
-
t[p[i]] = s[p[i]];
|
|
55
|
-
}
|
|
56
|
-
return t;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function __decorate(decorators, target, key, desc) {
|
|
60
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
61
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
62
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
63
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function __param(paramIndex, decorator) {
|
|
67
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function __metadata(metadataKey, metadataValue) {
|
|
71
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
75
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
76
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
77
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
78
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
79
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
80
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function __generator(thisArg, body) {
|
|
85
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
86
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
87
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
88
|
-
function step(op) {
|
|
89
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
90
|
-
while (_) try {
|
|
91
|
-
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) return t;
|
|
92
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
93
|
-
switch (op[0]) {
|
|
94
|
-
case 0: case 1: t = op; break;
|
|
95
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
96
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
97
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
98
|
-
default:
|
|
99
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
100
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
101
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
102
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
103
|
-
if (t[2]) _.ops.pop();
|
|
104
|
-
_.trys.pop(); continue;
|
|
105
|
-
}
|
|
106
|
-
op = body.call(thisArg, _);
|
|
107
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
108
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function __createBinding(o, m, k, k2) {
|
|
113
|
-
if (k2 === undefined) k2 = k;
|
|
114
|
-
o[k2] = m[k];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function __exportStar(m, exports) {
|
|
118
|
-
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function __values(o) {
|
|
122
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
123
|
-
if (m) return m.call(o);
|
|
124
|
-
if (o && typeof o.length === "number") return {
|
|
125
|
-
next: function () {
|
|
126
|
-
if (o && i >= o.length) o = void 0;
|
|
127
|
-
return { value: o && o[i++], done: !o };
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function __read(o, n) {
|
|
134
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
135
|
-
if (!m) return o;
|
|
136
|
-
var i = m.call(o), r, ar = [], e;
|
|
137
|
-
try {
|
|
138
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
139
|
-
}
|
|
140
|
-
catch (error) { e = { error: error }; }
|
|
141
|
-
finally {
|
|
142
|
-
try {
|
|
143
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
144
|
-
}
|
|
145
|
-
finally { if (e) throw e.error; }
|
|
146
|
-
}
|
|
147
|
-
return ar;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function __spread() {
|
|
151
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
152
|
-
ar = ar.concat(__read(arguments[i]));
|
|
153
|
-
return ar;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function __spreadArrays() {
|
|
157
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
158
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
159
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
160
|
-
r[k] = a[j];
|
|
161
|
-
return r;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
function __await(v) {
|
|
165
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
169
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
170
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
171
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
172
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
173
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
174
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
175
|
-
function fulfill(value) { resume("next", value); }
|
|
176
|
-
function reject(value) { resume("throw", value); }
|
|
177
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function __asyncDelegator(o) {
|
|
181
|
-
var i, p;
|
|
182
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
183
|
-
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; }
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function __asyncValues(o) {
|
|
187
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
188
|
-
var m = o[Symbol.asyncIterator], i;
|
|
189
|
-
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);
|
|
190
|
-
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); }); }; }
|
|
191
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function __makeTemplateObject(cooked, raw) {
|
|
195
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
196
|
-
return cooked;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
function __importStar(mod) {
|
|
200
|
-
if (mod && mod.__esModule) return mod;
|
|
201
|
-
var result = {};
|
|
202
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
203
|
-
result.default = mod;
|
|
204
|
-
return result;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
function __importDefault(mod) {
|
|
208
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function __classPrivateFieldGet(receiver, privateMap) {
|
|
212
|
-
if (!privateMap.has(receiver)) {
|
|
213
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
214
|
-
}
|
|
215
|
-
return privateMap.get(receiver);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
219
|
-
if (!privateMap.has(receiver)) {
|
|
220
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
221
|
-
}
|
|
222
|
-
privateMap.set(receiver, value);
|
|
223
|
-
return value;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
var WIDGET_RESOLVER_GLOBAL_CONFIG = new core.InjectionToken('Global Registration Configuration for Widget Resolvers');
|
|
227
|
-
var WIDGET_RESOLVER_SCOPED_CONFIG = new core.InjectionToken('Scoped Registration Configuration for Widget Resolvers');
|
|
228
|
-
|
|
229
|
-
function isStringArray(strArr) {
|
|
230
|
-
return Array.isArray(strArr) && strArr.every((function (u) { return typeof u === 'string'; }));
|
|
231
|
-
}
|
|
232
|
-
function isCheckRequired(requiredPermission) {
|
|
233
|
-
if (requiredPermission === undefined ||
|
|
234
|
-
requiredPermission === null ||
|
|
235
|
-
requiredPermission === '' ||
|
|
236
|
-
(Array.isArray(requiredPermission) && requiredPermission.length === 0)) {
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
return true;
|
|
240
|
-
}
|
|
241
|
-
function flipBoolean(value, flip) {
|
|
242
|
-
if (flip === void 0) { flip = false; }
|
|
243
|
-
return flip ? !value : value;
|
|
244
|
-
}
|
|
245
|
-
function permissionTest(testFor, requiredPermission, matchAgainst, isRestrictive) {
|
|
246
|
-
if (isRestrictive === void 0) { isRestrictive = false; }
|
|
247
|
-
if (!isCheckRequired(requiredPermission)) {
|
|
248
|
-
return true;
|
|
249
|
-
}
|
|
250
|
-
if (typeof requiredPermission === 'string') {
|
|
251
|
-
switch (testFor) {
|
|
252
|
-
case 'all':
|
|
253
|
-
case 'some':
|
|
254
|
-
return flipBoolean(matchAgainst.has(requiredPermission), isRestrictive);
|
|
255
|
-
case 'none':
|
|
256
|
-
return flipBoolean(!matchAgainst.has(requiredPermission), isRestrictive);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
if (Array.isArray(requiredPermission)) {
|
|
260
|
-
var matcher = (function (u) {
|
|
261
|
-
return typeof u === 'string' && flipBoolean(matchAgainst.has(u), isRestrictive);
|
|
262
|
-
});
|
|
263
|
-
switch (testFor) {
|
|
264
|
-
case 'all':
|
|
265
|
-
return requiredPermission.every(matcher);
|
|
266
|
-
case 'some':
|
|
267
|
-
return requiredPermission.some(matcher);
|
|
268
|
-
case 'none':
|
|
269
|
-
return !requiredPermission.every(matcher);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return false;
|
|
273
|
-
}
|
|
274
|
-
function hasUnitPermission(requiredPermission, matchAgainst, isRestrictive) {
|
|
275
|
-
if (isRestrictive === void 0) { isRestrictive = false; }
|
|
276
|
-
if (!isCheckRequired(requiredPermission)) {
|
|
277
|
-
return true;
|
|
278
|
-
}
|
|
279
|
-
var accessValues = matchAgainst instanceof Set
|
|
280
|
-
? matchAgainst
|
|
281
|
-
: Array.isArray(matchAgainst) && isStringArray(matchAgainst)
|
|
282
|
-
? new Set(matchAgainst)
|
|
283
|
-
: typeof matchAgainst === 'string'
|
|
284
|
-
? new Set([matchAgainst])
|
|
285
|
-
: new Set();
|
|
286
|
-
if (typeof requiredPermission === 'object' && requiredPermission !== null) {
|
|
287
|
-
if (Array.isArray(requiredPermission)) {
|
|
288
|
-
return permissionTest('all', requiredPermission, accessValues, isRestrictive);
|
|
289
|
-
}
|
|
290
|
-
return (permissionTest('all', 'all' in requiredPermission ? requiredPermission.all : null, accessValues, isRestrictive) &&
|
|
291
|
-
permissionTest('some', 'some' in requiredPermission ? requiredPermission.some : null, accessValues, isRestrictive) &&
|
|
292
|
-
permissionTest('none', 'none' in requiredPermission ? requiredPermission.none : null, accessValues, isRestrictive));
|
|
293
|
-
}
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
function hasPermissions(requiredPermission, availableRoles, availableGroups, restrictedFeatures) {
|
|
297
|
-
if (!requiredPermission) {
|
|
298
|
-
return true;
|
|
299
|
-
}
|
|
300
|
-
if (!requiredPermission.available || !requiredPermission.enabled) {
|
|
301
|
-
return false;
|
|
302
|
-
}
|
|
303
|
-
return (hasUnitPermission(requiredPermission.groups, availableGroups) &&
|
|
304
|
-
hasUnitPermission(requiredPermission.roles, availableRoles) &&
|
|
305
|
-
hasUnitPermission(requiredPermission.features, restrictedFeatures, true));
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
var WidgetBaseComponent = (function () {
|
|
309
|
-
function WidgetBaseComponent() {
|
|
310
|
-
this.widgetType = '';
|
|
311
|
-
this.widgetSubType = '';
|
|
312
|
-
}
|
|
313
|
-
WidgetBaseComponent.prototype.updateBaseComponent = function (widgetType, widgetSubType, widgetInstanceId, widgetHostClass, widgetSafeStyle) {
|
|
314
|
-
this.widgetType = widgetType;
|
|
315
|
-
this.widgetSubType = widgetSubType;
|
|
316
|
-
this.widgetInstanceId = widgetInstanceId;
|
|
317
|
-
this.widgetHostClass = widgetHostClass;
|
|
318
|
-
this.widgetSafeStyle = widgetSafeStyle;
|
|
319
|
-
if (this.widgetHostClass) {
|
|
320
|
-
this.className = this.className + " " + this.widgetHostClass;
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
WidgetBaseComponent.prototype.ngAfterViewInit = function () {
|
|
324
|
-
var _this = this;
|
|
325
|
-
var hash = window.location.hash ? window.location.hash.split('#')[1] : '';
|
|
326
|
-
if (hash && !isNaN(hash) && hash === this.widgetInstanceId) {
|
|
327
|
-
setTimeout((function () {
|
|
328
|
-
var element = document.getElementById(_this.widgetInstanceId || '');
|
|
329
|
-
if (element) {
|
|
330
|
-
element.scrollIntoView();
|
|
331
|
-
}
|
|
332
|
-
}), 200);
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
WidgetBaseComponent.decorators = [
|
|
336
|
-
{ type: core.Component, args: [{
|
|
337
|
-
selector: 'ws-resolver-base',
|
|
338
|
-
template: 'Base Component'
|
|
339
|
-
}] }
|
|
340
|
-
];
|
|
341
|
-
WidgetBaseComponent.propDecorators = {
|
|
342
|
-
widgetType: [{ type: core.Input }],
|
|
343
|
-
widgetSubType: [{ type: core.Input }],
|
|
344
|
-
widgetHostClass: [{ type: core.Input }],
|
|
345
|
-
widgetInstanceId: [{ type: core.Input }, { type: core.HostBinding, args: ['id',] }],
|
|
346
|
-
widgetSafeStyle: [{ type: core.Input }, { type: core.HostBinding, args: ['style',] }],
|
|
347
|
-
className: [{ type: core.Input }, { type: core.HostBinding, args: ['class',] }]
|
|
348
|
-
};
|
|
349
|
-
return WidgetBaseComponent;
|
|
350
|
-
}());
|
|
351
|
-
if (false) {
|
|
352
|
-
WidgetBaseComponent.prototype.widgetType;
|
|
353
|
-
WidgetBaseComponent.prototype.widgetSubType;
|
|
354
|
-
WidgetBaseComponent.prototype.widgetHostClass;
|
|
355
|
-
WidgetBaseComponent.prototype.widgetInstanceId;
|
|
356
|
-
WidgetBaseComponent.prototype.widgetSafeStyle;
|
|
357
|
-
WidgetBaseComponent.prototype.className;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
var RestrictedComponent = (function (_super) {
|
|
361
|
-
__extends(RestrictedComponent, _super);
|
|
362
|
-
function RestrictedComponent() {
|
|
363
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
364
|
-
_this.showData = true;
|
|
365
|
-
return _this;
|
|
366
|
-
}
|
|
367
|
-
RestrictedComponent.prototype.ngOnInit = function () { };
|
|
368
|
-
RestrictedComponent.decorators = [
|
|
369
|
-
{ type: core.Component, args: [{
|
|
370
|
-
selector: 'ws-resolver-restricted',
|
|
371
|
-
template: "<mat-card class=\"margin-m\">\r\n <mat-card-header>\r\n <div mat-card-avatar class=\"mat-card-avatar-override\">\r\n <mat-icon color=\"warn\">report_problem</mat-icon>\r\n </div>\r\n <mat-card-title>\r\n <ng-container i18n>\r\n Error as Restricted Widget\r\n </ng-container>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <div class=\"flex flex-wrap flex-between\">\r\n <div>\r\n <div class=\"margin-top-s\">\r\n <span class=\"mat-body-2 font-bold\" i18n>\r\n Widget Type :\r\n </span>\r\n {{ widgetType }}\r\n </div>\r\n <div class=\"margin-top-s\">\r\n <span class=\"mat-body-2 font-bold\" i18n>\r\n Widget Sub Type :\r\n </span>\r\n {{ widgetSubType }}\r\n </div>\r\n </div>\r\n <div>\r\n <ng-container *ngIf=\"widgetData\">\r\n <button mat-raised-button class=\"margin-top-m\" color=\"primary\" *ngIf=\"!showData\" (click)=\"showData = true\">\r\n <ng-container i18n>See Details</ng-container>\r\n <mat-icon>arrow_drop_down</mat-icon>\r\n </button>\r\n <button mat-raised-button class=\"margin-top-m\" color=\"primary\" *ngIf=\"showData\" (click)=\"showData = false\">\r\n <ng-container i18n>Hide Details</ng-container>\r\n <mat-icon>arrow_drop_up</mat-icon>\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"widgetData\">\r\n <pre *ngIf=\"showData\" class=\"margin-top-s \"><span i18n class=\"mat-body-2 font-bold\">Widget Data :</span>\r\n{{ widgetData | json }}\r\n </pre>\r\n </ng-container>\r\n</mat-card>",
|
|
372
|
-
styles: [".mat-card-avatar-override{height:24px!important;width:24px!important}"]
|
|
373
|
-
}] }
|
|
374
|
-
];
|
|
375
|
-
RestrictedComponent.propDecorators = {
|
|
376
|
-
widgetData: [{ type: core.Input }]
|
|
377
|
-
};
|
|
378
|
-
return RestrictedComponent;
|
|
379
|
-
}(WidgetBaseComponent));
|
|
380
|
-
if (false) {
|
|
381
|
-
RestrictedComponent.prototype.widgetData;
|
|
382
|
-
RestrictedComponent.prototype.showData;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
var InvalidRegistrationComponent = (function (_super) {
|
|
386
|
-
__extends(InvalidRegistrationComponent, _super);
|
|
387
|
-
function InvalidRegistrationComponent() {
|
|
388
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
389
|
-
_this.showData = true;
|
|
390
|
-
return _this;
|
|
391
|
-
}
|
|
392
|
-
InvalidRegistrationComponent.prototype.ngOnInit = function () { };
|
|
393
|
-
InvalidRegistrationComponent.decorators = [
|
|
394
|
-
{ type: core.Component, args: [{
|
|
395
|
-
selector: 'ws-resolver-invalid-registration',
|
|
396
|
-
template: "<mat-card class=\"margin-m\">\r\n <mat-card-header>\r\n <div mat-card-avatar class=\"mat-card-avatar-override\">\r\n <mat-icon color=\"warn\">report_problem</mat-icon>\r\n </div>\r\n <mat-card-title>\r\n <ng-container i18n>\r\n Error as Invalid Registration for Widget\r\n </ng-container>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <div class=\"flex flex-wrap flex-between\">\r\n <div>\r\n <div class=\"margin-top-s\">\r\n <span class=\"mat-body-2 font-bold\" i18n>\r\n Widget Type :\r\n </span>\r\n {{ widgetType }}\r\n </div>\r\n <div class=\"margin-top-s\">\r\n <span class=\"mat-body-2 font-bold\" i18n>\r\n Widget Sub Type :\r\n </span>\r\n {{ widgetSubType }}\r\n </div>\r\n </div>\r\n <div>\r\n <ng-container *ngIf=\"widgetData\">\r\n <button mat-raised-button class=\"margin-top-m\" color=\"primary\" *ngIf=\"!showData\" (click)=\"showData = true\">\r\n <ng-container i18n>See Details</ng-container>\r\n <mat-icon>arrow_drop_down</mat-icon>\r\n </button>\r\n <button mat-raised-button class=\"margin-top-m\" color=\"primary\" *ngIf=\"showData\" (click)=\"showData = false\">\r\n <ng-container i18n>Hide Details</ng-container>\r\n <mat-icon>arrow_drop_up</mat-icon>\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"widgetData\">\r\n <pre *ngIf=\"showData\" class=\"margin-top-s \"><span i18n class=\"mat-body-2 font-bold\">Widget Data :</span>\r\n{{ widgetData | json }}\r\n </pre>\r\n </ng-container>\r\n</mat-card>",
|
|
397
|
-
styles: [".mat-card-avatar-override{height:24px!important;width:24px!important}"]
|
|
398
|
-
}] }
|
|
399
|
-
];
|
|
400
|
-
InvalidRegistrationComponent.propDecorators = {
|
|
401
|
-
widgetData: [{ type: core.Input }]
|
|
402
|
-
};
|
|
403
|
-
return InvalidRegistrationComponent;
|
|
404
|
-
}(WidgetBaseComponent));
|
|
405
|
-
if (false) {
|
|
406
|
-
InvalidRegistrationComponent.prototype.widgetData;
|
|
407
|
-
InvalidRegistrationComponent.prototype.showData;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
var InvalidPermissionComponent = (function (_super) {
|
|
411
|
-
__extends(InvalidPermissionComponent, _super);
|
|
412
|
-
function InvalidPermissionComponent() {
|
|
413
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
414
|
-
_this.showData = true;
|
|
415
|
-
return _this;
|
|
416
|
-
}
|
|
417
|
-
InvalidPermissionComponent.prototype.ngOnInit = function () { };
|
|
418
|
-
InvalidPermissionComponent.decorators = [
|
|
419
|
-
{ type: core.Component, args: [{
|
|
420
|
-
selector: 'ws-resolver-invalid-permission',
|
|
421
|
-
template: "<mat-card class=\"margin-m\">\r\n <mat-card-header>\r\n <div mat-card-avatar class=\"mat-card-avatar-override\">\r\n <mat-icon color=\"warn\">report_problem</mat-icon>\r\n </div>\r\n <mat-card-title>\r\n <ng-container i18n>\r\n Error as Invalid Permission for Widget\r\n </ng-container>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <div class=\"flex flex-wrap flex-between\">\r\n <div>\r\n <div class=\"margin-top-s\">\r\n <span class=\"mat-body-2 font-bold\" i18n>\r\n Widget Type :\r\n </span>\r\n {{ widgetType }}\r\n </div>\r\n <div class=\"margin-top-s\">\r\n <span class=\"mat-body-2 font-bold\" i18n>\r\n Widget Sub Type :\r\n </span>\r\n {{ widgetSubType }}\r\n </div>\r\n </div>\r\n <div>\r\n <ng-container *ngIf=\"widgetData\">\r\n <button mat-raised-button class=\"margin-top-m\" color=\"primary\" *ngIf=\"!showData\" (click)=\"showData = true\">\r\n <ng-container i18n>See Details</ng-container>\r\n <mat-icon>arrow_drop_down</mat-icon>\r\n </button>\r\n <button mat-raised-button class=\"margin-top-m\" color=\"primary\" *ngIf=\"showData\" (click)=\"showData = false\">\r\n <ng-container i18n>Hide Details</ng-container>\r\n <mat-icon>arrow_drop_up</mat-icon>\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"widgetData\">\r\n <pre *ngIf=\"showData\" class=\"margin-top-s \"><span i18n class=\"mat-body-2 font-bold\">Widget Data :</span>\r\n{{ widgetData | json }}\r\n </pre>\r\n </ng-container>\r\n</mat-card>",
|
|
422
|
-
styles: [".mat-card-avatar-override{height:24px!important;width:24px!important}"]
|
|
423
|
-
}] }
|
|
424
|
-
];
|
|
425
|
-
InvalidPermissionComponent.propDecorators = {
|
|
426
|
-
widgetType: [{ type: core.Input }],
|
|
427
|
-
widgetSubType: [{ type: core.Input }],
|
|
428
|
-
widgetInstanceId: [{ type: core.Input }],
|
|
429
|
-
widgetData: [{ type: core.Input }]
|
|
430
|
-
};
|
|
431
|
-
return InvalidPermissionComponent;
|
|
432
|
-
}(WidgetBaseComponent));
|
|
433
|
-
if (false) {
|
|
434
|
-
InvalidPermissionComponent.prototype.widgetType;
|
|
435
|
-
InvalidPermissionComponent.prototype.widgetSubType;
|
|
436
|
-
InvalidPermissionComponent.prototype.widgetInstanceId;
|
|
437
|
-
InvalidPermissionComponent.prototype.widgetData;
|
|
438
|
-
InvalidPermissionComponent.prototype.showData;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
var UnresolvedComponent = (function (_super) {
|
|
442
|
-
__extends(UnresolvedComponent, _super);
|
|
443
|
-
function UnresolvedComponent() {
|
|
444
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
445
|
-
_this.showData = true;
|
|
446
|
-
_this.previewMode = false;
|
|
447
|
-
_this.searchArray = ['preview', 'channel'];
|
|
448
|
-
return _this;
|
|
449
|
-
}
|
|
450
|
-
UnresolvedComponent.prototype.ngOnInit = function () {
|
|
451
|
-
var url = window.location.href;
|
|
452
|
-
this.previewMode = this.searchArray.some((function (word) {
|
|
453
|
-
return url.indexOf(word) > -1;
|
|
454
|
-
}));
|
|
455
|
-
};
|
|
456
|
-
UnresolvedComponent.decorators = [
|
|
457
|
-
{ type: core.Component, args: [{
|
|
458
|
-
selector: 'ws-resolver-unresolved',
|
|
459
|
-
template: "<ng-container *ngIf=\"previewMode\" [ngTemplateOutlet]=\"previewCardTemplate\"></ng-container>\r\n<ng-container *ngIf=\"!previewMode\" [ngTemplateOutlet]=\"unresolvedTemplate\"></ng-container>\r\n\r\n<ng-template #unresolvedTemplate>\r\n <mat-card class=\"margin-m\">\r\n <mat-card-header>\r\n <div mat-card-avatar class=\"mat-card-avatar-override\">\r\n <mat-icon color=\"warn\">report_problem</mat-icon>\r\n </div>\r\n <mat-card-title>\r\n <ng-container i18n>\r\n Error in Resolving Json for Widget\r\n </ng-container>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <div class=\"flex flex-wrap flex-between\">\r\n <div>\r\n <div class=\"margin-top-s\">\r\n <span class=\"mat-body-2 font-bold\" i18n>\r\n Widget Type :\r\n </span>\r\n {{ widgetType }}\r\n </div>\r\n <div class=\"margin-top-s\">\r\n <span class=\"mat-body-2 font-bold\" i18n>\r\n Widget Sub Type :\r\n </span>\r\n {{ widgetSubType }}\r\n </div>\r\n </div>\r\n <div>\r\n <ng-container *ngIf=\"widgetData\">\r\n <button mat-raised-button class=\"margin-top-m\" color=\"primary\" *ngIf=\"!showData\" (click)=\"showData = true\">\r\n <ng-container i18n>See Details</ng-container>\r\n <mat-icon>arrow_drop_down</mat-icon>\r\n </button>\r\n <button mat-raised-button class=\"margin-top-m\" color=\"primary\" *ngIf=\"showData\" (click)=\"showData = false\">\r\n <ng-container i18n>Hide Details</ng-container>\r\n <mat-icon>arrow_drop_up</mat-icon>\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"widgetData\">\r\n <pre *ngIf=\"showData\" class=\"margin-top-s\"><span i18n class=\"mat-body-2 font-bold\">Widget Data :</span>\r\n{{ widgetData | json }}\r\n </pre>\r\n </ng-container>\r\n </mat-card>\r\n</ng-template>\r\n<ng-template #previewCardTemplate>\r\n <mat-card>\r\n <div class=\"w-full\">\r\n <div class=\"p-4\">\r\n <div class=\"text-3xl font-semibold text-center leading-tight\" i18n>\r\n Content not available\r\n </div>\r\n <br />\r\n <div class=\"text-base font-medium text-center leading-normal\" i18n>\r\n Please add widget or provide data to widget template\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card>\r\n</ng-template>",
|
|
460
|
-
styles: [".mat-card-avatar-override{height:24px!important;width:24px!important}"]
|
|
461
|
-
}] }
|
|
462
|
-
];
|
|
463
|
-
UnresolvedComponent.propDecorators = {
|
|
464
|
-
widgetData: [{ type: core.Input }]
|
|
465
|
-
};
|
|
466
|
-
return UnresolvedComponent;
|
|
467
|
-
}(WidgetBaseComponent));
|
|
468
|
-
if (false) {
|
|
469
|
-
UnresolvedComponent.prototype.widgetData;
|
|
470
|
-
UnresolvedComponent.prototype.showData;
|
|
471
|
-
UnresolvedComponent.prototype.previewMode;
|
|
472
|
-
UnresolvedComponent.prototype.searchArray;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
var WidgetResolverService = (function () {
|
|
476
|
-
function WidgetResolverService(domSanitizer, componentFactoryResolver, loggerSvc, globalConfig, scopedConfig) {
|
|
477
|
-
this.domSanitizer = domSanitizer;
|
|
478
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
479
|
-
this.loggerSvc = loggerSvc;
|
|
480
|
-
this.globalConfig = globalConfig;
|
|
481
|
-
this.scopedConfig = scopedConfig;
|
|
482
|
-
this.roles = null;
|
|
483
|
-
this.groups = null;
|
|
484
|
-
this.restrictedFeatures = null;
|
|
485
|
-
this.isInitialized = false;
|
|
486
|
-
this.availableRegisteredWidgets = null;
|
|
487
|
-
this.restrictedWidgetKeys = null;
|
|
488
|
-
}
|
|
489
|
-
WidgetResolverService.getWidgetKey = function (config) {
|
|
490
|
-
return "widget:" + config.widgetType + "::" + config.widgetSubType;
|
|
491
|
-
};
|
|
492
|
-
WidgetResolverService.prototype.initialize = function (restrictedWidgetKeys, roles, groups, restrictedFeatures) {
|
|
493
|
-
this.roles = roles;
|
|
494
|
-
this.groups = groups;
|
|
495
|
-
this.restrictedFeatures = restrictedFeatures;
|
|
496
|
-
var restrictedWidgetKeysSet = restrictedWidgetKeys
|
|
497
|
-
? restrictedWidgetKeys
|
|
498
|
-
: new Set();
|
|
499
|
-
var registrationConfig = new Map();
|
|
500
|
-
var allWidgetsConfigurations = [];
|
|
501
|
-
if (this.globalConfig && Array.isArray(this.globalConfig)) {
|
|
502
|
-
allWidgetsConfigurations.push.apply(allWidgetsConfigurations, __spread(this.globalConfig));
|
|
503
|
-
}
|
|
504
|
-
if (this.scopedConfig && Array.isArray(this.scopedConfig)) {
|
|
505
|
-
allWidgetsConfigurations.push.apply(allWidgetsConfigurations, __spread(this.scopedConfig));
|
|
506
|
-
}
|
|
507
|
-
allWidgetsConfigurations.forEach((function (u) {
|
|
508
|
-
var key = WidgetResolverService.getWidgetKey(u);
|
|
509
|
-
if (!restrictedWidgetKeysSet.has(key)) {
|
|
510
|
-
registrationConfig.set(key, u);
|
|
511
|
-
}
|
|
512
|
-
}));
|
|
513
|
-
this.restrictedWidgetKeys = restrictedWidgetKeysSet;
|
|
514
|
-
this.availableRegisteredWidgets = registrationConfig;
|
|
515
|
-
this.isInitialized = true;
|
|
516
|
-
this.loggerSvc.log("Widget Configurations", this.globalConfig, this.scopedConfig, this.availableRegisteredWidgets);
|
|
517
|
-
};
|
|
518
|
-
WidgetResolverService.prototype.resolveWidget = function (receivedConfig, containerRef) {
|
|
519
|
-
var key = WidgetResolverService.getWidgetKey(receivedConfig);
|
|
520
|
-
if (this.restrictedWidgetKeys && this.restrictedWidgetKeys.has(key)) {
|
|
521
|
-
return this.widgetResolved(containerRef, receivedConfig, RestrictedComponent);
|
|
522
|
-
}
|
|
523
|
-
if (this.availableRegisteredWidgets && this.availableRegisteredWidgets.has(key)) {
|
|
524
|
-
if (hasPermissions(receivedConfig.widgetPermission, this.roles, this.groups, this.restrictedFeatures)) {
|
|
525
|
-
var config = this.availableRegisteredWidgets.get(key);
|
|
526
|
-
if (config && config.component) {
|
|
527
|
-
return this.widgetResolved(containerRef, receivedConfig, config.component);
|
|
528
|
-
}
|
|
529
|
-
return this.widgetResolved(containerRef, receivedConfig, InvalidRegistrationComponent);
|
|
530
|
-
}
|
|
531
|
-
return this.widgetResolved(containerRef, receivedConfig, InvalidPermissionComponent);
|
|
532
|
-
}
|
|
533
|
-
return this.widgetResolved(containerRef, receivedConfig, UnresolvedComponent);
|
|
534
|
-
};
|
|
535
|
-
WidgetResolverService.prototype.widgetResolved = function (containerRef, compData, component) {
|
|
536
|
-
var factory = this.componentFactoryResolver.resolveComponentFactory(component);
|
|
537
|
-
containerRef.clear();
|
|
538
|
-
var compRef = containerRef.createComponent(factory);
|
|
539
|
-
compRef.instance.widgetData = compData.widgetData;
|
|
540
|
-
if (compRef.instance.updateBaseComponent) {
|
|
541
|
-
var widgetSafeStyle = compData.widgetHostStyle
|
|
542
|
-
? this.domSanitizer.bypassSecurityTrustStyle(Object.entries(compData.widgetHostStyle).reduce((function (s, _a) {
|
|
543
|
-
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
|
544
|
-
return "" + s + k + ":" + v + ";";
|
|
545
|
-
}), ''))
|
|
546
|
-
: undefined;
|
|
547
|
-
compRef.instance.updateBaseComponent(compData.widgetType, compData.widgetSubType, compData.widgetInstanceId, compData.widgetHostClass, widgetSafeStyle);
|
|
548
|
-
}
|
|
549
|
-
return compRef;
|
|
550
|
-
};
|
|
551
|
-
WidgetResolverService.decorators = [
|
|
552
|
-
{ type: core.Injectable, args: [{
|
|
553
|
-
providedIn: 'root',
|
|
554
|
-
},] }
|
|
555
|
-
];
|
|
556
|
-
WidgetResolverService.ctorParameters = function () { return [
|
|
557
|
-
{ type: platformBrowser.DomSanitizer },
|
|
558
|
-
{ type: core.ComponentFactoryResolver },
|
|
559
|
-
{ type: utils.LoggerService },
|
|
560
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [WIDGET_RESOLVER_GLOBAL_CONFIG,] }] },
|
|
561
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [WIDGET_RESOLVER_SCOPED_CONFIG,] }] }
|
|
562
|
-
]; };
|
|
563
|
-
/** @nocollapse */ WidgetResolverService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function WidgetResolverService_Factory() { return new WidgetResolverService(core.ɵɵinject(platformBrowser.DomSanitizer), core.ɵɵinject(core.ComponentFactoryResolver), core.ɵɵinject(utils.LoggerService), core.ɵɵinject(WIDGET_RESOLVER_GLOBAL_CONFIG), core.ɵɵinject(WIDGET_RESOLVER_SCOPED_CONFIG)); }, token: WidgetResolverService, providedIn: "root" });
|
|
564
|
-
return WidgetResolverService;
|
|
565
|
-
}());
|
|
566
|
-
if (false) {
|
|
567
|
-
WidgetResolverService.prototype.roles;
|
|
568
|
-
WidgetResolverService.prototype.groups;
|
|
569
|
-
WidgetResolverService.prototype.restrictedFeatures;
|
|
570
|
-
WidgetResolverService.prototype.isInitialized;
|
|
571
|
-
WidgetResolverService.prototype.availableRegisteredWidgets;
|
|
572
|
-
WidgetResolverService.prototype.restrictedWidgetKeys;
|
|
573
|
-
WidgetResolverService.prototype.domSanitizer;
|
|
574
|
-
WidgetResolverService.prototype.componentFactoryResolver;
|
|
575
|
-
WidgetResolverService.prototype.loggerSvc;
|
|
576
|
-
WidgetResolverService.prototype.globalConfig;
|
|
577
|
-
WidgetResolverService.prototype.scopedConfig;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
var WidgetResolverDirective = (function () {
|
|
581
|
-
function WidgetResolverDirective(viewContainerRef, widgetResolverSvc, logger) {
|
|
582
|
-
this.viewContainerRef = viewContainerRef;
|
|
583
|
-
this.widgetResolverSvc = widgetResolverSvc;
|
|
584
|
-
this.logger = logger;
|
|
585
|
-
this.wsResolverWidget = null;
|
|
586
|
-
}
|
|
587
|
-
WidgetResolverDirective.prototype.ngOnChanges = function () {
|
|
588
|
-
if (!this.widgetResolverSvc.isInitialized) {
|
|
589
|
-
this.logger.error('Widgets Registration Not Done. Used Before Initialization.', this.wsResolverWidget);
|
|
590
|
-
return;
|
|
591
|
-
}
|
|
592
|
-
if (this.wsResolverWidget) {
|
|
593
|
-
var compRef = this.widgetResolverSvc.resolveWidget(this.wsResolverWidget, this.viewContainerRef);
|
|
594
|
-
if (compRef) {
|
|
595
|
-
compRef.changeDetectorRef.detectChanges();
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
};
|
|
599
|
-
WidgetResolverDirective.decorators = [
|
|
600
|
-
{ type: core.Directive, args: [{
|
|
601
|
-
selector: '[wsResolverWidget]',
|
|
602
|
-
},] }
|
|
603
|
-
];
|
|
604
|
-
WidgetResolverDirective.ctorParameters = function () { return [
|
|
605
|
-
{ type: core.ViewContainerRef },
|
|
606
|
-
{ type: WidgetResolverService },
|
|
607
|
-
{ type: utils.LoggerService }
|
|
608
|
-
]; };
|
|
609
|
-
WidgetResolverDirective.propDecorators = {
|
|
610
|
-
wsResolverWidget: [{ type: core.Input }]
|
|
611
|
-
};
|
|
612
|
-
return WidgetResolverDirective;
|
|
613
|
-
}());
|
|
614
|
-
if (false) {
|
|
615
|
-
WidgetResolverDirective.prototype.wsResolverWidget;
|
|
616
|
-
WidgetResolverDirective.prototype.viewContainerRef;
|
|
617
|
-
WidgetResolverDirective.prototype.widgetResolverSvc;
|
|
618
|
-
WidgetResolverDirective.prototype.logger;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
var WidgetResolverModule = (function () {
|
|
622
|
-
function WidgetResolverModule() {
|
|
623
|
-
}
|
|
624
|
-
WidgetResolverModule.forRoot = function (config) {
|
|
625
|
-
return {
|
|
626
|
-
ngModule: WidgetResolverModule,
|
|
627
|
-
providers: [
|
|
628
|
-
WidgetResolverService,
|
|
629
|
-
{
|
|
630
|
-
provide: WIDGET_RESOLVER_GLOBAL_CONFIG,
|
|
631
|
-
useValue: config,
|
|
632
|
-
},
|
|
633
|
-
{
|
|
634
|
-
provide: WIDGET_RESOLVER_SCOPED_CONFIG,
|
|
635
|
-
useValue: [],
|
|
636
|
-
},
|
|
637
|
-
],
|
|
638
|
-
};
|
|
639
|
-
};
|
|
640
|
-
WidgetResolverModule.forChild = function (config) {
|
|
641
|
-
return {
|
|
642
|
-
ngModule: WidgetResolverModule,
|
|
643
|
-
providers: [
|
|
644
|
-
WidgetResolverService,
|
|
645
|
-
{
|
|
646
|
-
provide: WIDGET_RESOLVER_SCOPED_CONFIG,
|
|
647
|
-
useValue: config,
|
|
648
|
-
},
|
|
649
|
-
],
|
|
650
|
-
};
|
|
651
|
-
};
|
|
652
|
-
WidgetResolverModule.decorators = [
|
|
653
|
-
{ type: core.NgModule, args: [{
|
|
654
|
-
declarations: [
|
|
655
|
-
WidgetBaseComponent,
|
|
656
|
-
WidgetResolverDirective,
|
|
657
|
-
RestrictedComponent,
|
|
658
|
-
InvalidRegistrationComponent,
|
|
659
|
-
InvalidPermissionComponent,
|
|
660
|
-
UnresolvedComponent,
|
|
661
|
-
],
|
|
662
|
-
imports: [common.CommonModule, material.MatButtonModule, material.MatIconModule, material.MatCardModule],
|
|
663
|
-
exports: [WidgetResolverDirective, WidgetBaseComponent],
|
|
664
|
-
entryComponents: [
|
|
665
|
-
RestrictedComponent,
|
|
666
|
-
InvalidRegistrationComponent,
|
|
667
|
-
InvalidPermissionComponent,
|
|
668
|
-
UnresolvedComponent,
|
|
669
|
-
WidgetBaseComponent,
|
|
670
|
-
],
|
|
671
|
-
providers: [utils.ConfigurationsService],
|
|
672
|
-
},] }
|
|
673
|
-
];
|
|
674
|
-
return WidgetResolverModule;
|
|
675
|
-
}());
|
|
676
|
-
|
|
677
|
-
var NsWidgetResolver;
|
|
678
|
-
(function (NsWidgetResolver) {
|
|
679
|
-
function IUnitPermissionObject() { }
|
|
680
|
-
NsWidgetResolver.IUnitPermissionObject = IUnitPermissionObject;
|
|
681
|
-
if (false) {
|
|
682
|
-
IUnitPermissionObject.prototype.all;
|
|
683
|
-
IUnitPermissionObject.prototype.none;
|
|
684
|
-
IUnitPermissionObject.prototype.some;
|
|
685
|
-
}
|
|
686
|
-
function IPermissions() { }
|
|
687
|
-
NsWidgetResolver.IPermissions = IPermissions;
|
|
688
|
-
if (false) {
|
|
689
|
-
IPermissions.prototype.enabled;
|
|
690
|
-
IPermissions.prototype.available;
|
|
691
|
-
IPermissions.prototype.roles;
|
|
692
|
-
IPermissions.prototype.features;
|
|
693
|
-
IPermissions.prototype.groups;
|
|
694
|
-
}
|
|
695
|
-
function IBaseConfig() { }
|
|
696
|
-
NsWidgetResolver.IBaseConfig = IBaseConfig;
|
|
697
|
-
if (false) {
|
|
698
|
-
IBaseConfig.prototype.widgetType;
|
|
699
|
-
IBaseConfig.prototype.widgetSubType;
|
|
700
|
-
}
|
|
701
|
-
function IRegistrationConfig() { }
|
|
702
|
-
NsWidgetResolver.IRegistrationConfig = IRegistrationConfig;
|
|
703
|
-
if (false) {
|
|
704
|
-
IRegistrationConfig.prototype.component;
|
|
705
|
-
}
|
|
706
|
-
function IRegistrationsPermissionConfig() { }
|
|
707
|
-
NsWidgetResolver.IRegistrationsPermissionConfig = IRegistrationsPermissionConfig;
|
|
708
|
-
if (false) {
|
|
709
|
-
IRegistrationsPermissionConfig.prototype.widgetPermission;
|
|
710
|
-
}
|
|
711
|
-
function IRenderConfigWithTypedData() { }
|
|
712
|
-
NsWidgetResolver.IRenderConfigWithTypedData = IRenderConfigWithTypedData;
|
|
713
|
-
if (false) {
|
|
714
|
-
IRenderConfigWithTypedData.prototype.widgetData;
|
|
715
|
-
IRenderConfigWithTypedData.prototype.widgetInstanceId;
|
|
716
|
-
IRenderConfigWithTypedData.prototype.widgetHostClass;
|
|
717
|
-
IRenderConfigWithTypedData.prototype.widgetHostStyle;
|
|
718
|
-
}
|
|
719
|
-
function IWidgetData() { }
|
|
720
|
-
NsWidgetResolver.IWidgetData = IWidgetData;
|
|
721
|
-
if (false) {
|
|
722
|
-
IWidgetData.prototype.widgetSafeStyle;
|
|
723
|
-
IWidgetData.prototype.updateBaseComponent;
|
|
724
|
-
}
|
|
725
|
-
function ITitle() { }
|
|
726
|
-
NsWidgetResolver.ITitle = ITitle;
|
|
727
|
-
if (false) {
|
|
728
|
-
ITitle.prototype.title;
|
|
729
|
-
ITitle.prototype.url;
|
|
730
|
-
ITitle.prototype.icon;
|
|
731
|
-
}
|
|
732
|
-
})(NsWidgetResolver || (NsWidgetResolver = {}));
|
|
733
|
-
|
|
734
|
-
exports.WidgetBaseComponent = WidgetBaseComponent;
|
|
735
|
-
exports.WidgetResolverModule = WidgetResolverModule;
|
|
736
|
-
exports.WidgetResolverService = WidgetResolverService;
|
|
737
|
-
exports.hasPermissions = hasPermissions;
|
|
738
|
-
exports.hasUnitPermission = hasUnitPermission;
|
|
739
|
-
exports.ɵa = WidgetResolverDirective;
|
|
740
|
-
exports.ɵb = WIDGET_RESOLVER_GLOBAL_CONFIG;
|
|
741
|
-
exports.ɵc = WIDGET_RESOLVER_SCOPED_CONFIG;
|
|
742
|
-
exports.ɵe = RestrictedComponent;
|
|
743
|
-
exports.ɵf = InvalidRegistrationComponent;
|
|
744
|
-
exports.ɵg = InvalidPermissionComponent;
|
|
745
|
-
exports.ɵh = UnresolvedComponent;
|
|
746
|
-
|
|
747
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
748
|
-
|
|
749
|
-
})));
|
|
750
|
-
//# sourceMappingURL=sunbird-cb-resolver.umd.js.map
|