@kolektor/nucleus-material 0.0.8-pre.5352 → 0.0.9-pre.5702

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 (32) hide show
  1. package/{esm2015/kolektor-nucleus-material.js → esm2020/kolektor-nucleus-material.mjs} +0 -0
  2. package/{esm2015/lib/dialog/dialog.component.js → esm2020/lib/dialog/dialog.component.mjs} +5 -10
  3. package/{esm2015/lib/dialog/dialog.module.js → esm2020/lib/dialog/dialog.module.mjs} +4 -4
  4. package/esm2020/lib/dialog/dialog.service.mjs +40 -0
  5. package/{esm2015/lib/dialog/models.js → esm2020/lib/dialog/models.mjs} +0 -0
  6. package/esm2020/lib/loaded-content/loaded-content-component.mjs +71 -0
  7. package/{esm2015/lib/loaded-content/loaded-content-directive.js → esm2020/lib/loaded-content/loaded-content-directive.mjs} +3 -3
  8. package/{esm2015/lib/loaded-content/loaded-content-module.js → esm2020/lib/loaded-content/loaded-content-module.mjs} +4 -4
  9. package/esm2020/lib/loaded-content/loading-state.mjs +93 -0
  10. package/{esm2015/lib/native-styling/models.js → esm2020/lib/native-styling/models.mjs} +0 -0
  11. package/{esm2015/lib/native-styling/native-styling.service.js → esm2020/lib/native-styling/native-styling.service.mjs} +3 -3
  12. package/{esm2015/lib/snackbar/models.js → esm2020/lib/snackbar/models.mjs} +0 -0
  13. package/{esm2015/lib/snackbar/snackbar.module.js → esm2020/lib/snackbar/snackbar.module.mjs} +4 -4
  14. package/{esm2015/lib/snackbar/snackbar.service.js → esm2020/lib/snackbar/snackbar.service.mjs} +3 -3
  15. package/{esm2015/lib/swipe-tabs/swipe-tabs-directive.js → esm2020/lib/swipe-tabs/swipe-tabs-directive.mjs} +3 -3
  16. package/{esm2015/lib/swipe-tabs/swipe-tabs-module.js → esm2020/lib/swipe-tabs/swipe-tabs-module.mjs} +4 -4
  17. package/esm2020/lib/user-avatar/user-avatar-component.mjs +50 -0
  18. package/{esm2015/lib/user-avatar/user-avatar-module.js → esm2020/lib/user-avatar/user-avatar-module.mjs} +4 -4
  19. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  20. package/fesm2015/{kolektor-nucleus-material.js → kolektor-nucleus-material.mjs} +105 -79
  21. package/fesm2015/kolektor-nucleus-material.mjs.map +1 -0
  22. package/fesm2020/kolektor-nucleus-material.mjs +663 -0
  23. package/fesm2020/kolektor-nucleus-material.mjs.map +1 -0
  24. package/lib/loaded-content/loading-state.d.ts +7 -1
  25. package/package.json +22 -9
  26. package/bundles/kolektor-nucleus-material.umd.js +0 -1095
  27. package/bundles/kolektor-nucleus-material.umd.js.map +0 -1
  28. package/esm2015/lib/dialog/dialog.service.js +0 -43
  29. package/esm2015/lib/loaded-content/loaded-content-component.js +0 -76
  30. package/esm2015/lib/loaded-content/loading-state.js +0 -53
  31. package/esm2015/lib/user-avatar/user-avatar-component.js +0 -55
  32. package/fesm2015/kolektor-nucleus-material.js.map +0 -1
@@ -1,1095 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/dialog'), require('@angular/material/button'), require('@angular/common'), require('rxjs/operators'), require('@angular/material/progress-spinner'), require('@angular/material/icon'), require('@angular/router'), require('hammerjs'), require('@angular/material/tabs'), require('@angular/material/snack-bar')) :
3
- typeof define === 'function' && define.amd ? define('@kolektor/nucleus-material', ['exports', '@angular/core', '@angular/material/dialog', '@angular/material/button', '@angular/common', 'rxjs/operators', '@angular/material/progress-spinner', '@angular/material/icon', '@angular/router', 'hammerjs', '@angular/material/tabs', '@angular/material/snack-bar'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.kolektor = global.kolektor || {}, global.kolektor['nucleus-material'] = {}), global.ng.core, global.ng.material.dialog, global.ng.material.button, global.ng.common, global.rxjs.operators, global.ng.material.progressSpinner, global.ng.material.icon, global.ng.router, global.Hammer, global.ng.material.tabs, global.ng.material.snackBar));
5
- }(this, (function (exports, i0, i1, i2, i3, operators, i1$1, i3$1, i1$2, Hammer, i1$3, i1$4) { '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 () {
17
- return e[k];
18
- }
19
- });
20
- }
21
- });
22
- }
23
- n['default'] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
29
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
30
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
31
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
32
- var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
33
- var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
34
- var Hammer__namespace = /*#__PURE__*/_interopNamespace(Hammer);
35
- var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
36
- var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$4);
37
-
38
- /*! *****************************************************************************
39
- Copyright (c) Microsoft Corporation.
40
-
41
- Permission to use, copy, modify, and/or distribute this software for any
42
- purpose with or without fee is hereby granted.
43
-
44
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
45
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
46
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
47
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
48
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
49
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
50
- PERFORMANCE OF THIS SOFTWARE.
51
- ***************************************************************************** */
52
- /* global Reflect, Promise */
53
- var extendStatics = function (d, b) {
54
- extendStatics = Object.setPrototypeOf ||
55
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
56
- function (d, b) { for (var p in b)
57
- if (Object.prototype.hasOwnProperty.call(b, p))
58
- d[p] = b[p]; };
59
- return extendStatics(d, b);
60
- };
61
- function __extends(d, b) {
62
- if (typeof b !== "function" && b !== null)
63
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
64
- extendStatics(d, b);
65
- function __() { this.constructor = d; }
66
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
67
- }
68
- var __assign = function () {
69
- __assign = Object.assign || function __assign(t) {
70
- for (var s, i = 1, n = arguments.length; i < n; i++) {
71
- s = arguments[i];
72
- for (var p in s)
73
- if (Object.prototype.hasOwnProperty.call(s, p))
74
- t[p] = s[p];
75
- }
76
- return t;
77
- };
78
- return __assign.apply(this, arguments);
79
- };
80
- function __rest(s, e) {
81
- var t = {};
82
- for (var p in s)
83
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
84
- t[p] = s[p];
85
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
86
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
87
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
88
- t[p[i]] = s[p[i]];
89
- }
90
- return t;
91
- }
92
- function __decorate(decorators, target, key, desc) {
93
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
94
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
95
- r = Reflect.decorate(decorators, target, key, desc);
96
- else
97
- for (var i = decorators.length - 1; i >= 0; i--)
98
- if (d = decorators[i])
99
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
100
- return c > 3 && r && Object.defineProperty(target, key, r), r;
101
- }
102
- function __param(paramIndex, decorator) {
103
- return function (target, key) { decorator(target, key, paramIndex); };
104
- }
105
- function __metadata(metadataKey, metadataValue) {
106
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
107
- return Reflect.metadata(metadataKey, metadataValue);
108
- }
109
- function __awaiter(thisArg, _arguments, P, generator) {
110
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
111
- return new (P || (P = Promise))(function (resolve, reject) {
112
- function fulfilled(value) { try {
113
- step(generator.next(value));
114
- }
115
- catch (e) {
116
- reject(e);
117
- } }
118
- function rejected(value) { try {
119
- step(generator["throw"](value));
120
- }
121
- catch (e) {
122
- reject(e);
123
- } }
124
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
125
- step((generator = generator.apply(thisArg, _arguments || [])).next());
126
- });
127
- }
128
- function __generator(thisArg, body) {
129
- var _ = { label: 0, sent: function () { if (t[0] & 1)
130
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
131
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
132
- function verb(n) { return function (v) { return step([n, v]); }; }
133
- function step(op) {
134
- if (f)
135
- throw new TypeError("Generator is already executing.");
136
- while (_)
137
- try {
138
- 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)
139
- return t;
140
- if (y = 0, t)
141
- op = [op[0] & 2, t.value];
142
- switch (op[0]) {
143
- case 0:
144
- case 1:
145
- t = op;
146
- break;
147
- case 4:
148
- _.label++;
149
- return { value: op[1], done: false };
150
- case 5:
151
- _.label++;
152
- y = op[1];
153
- op = [0];
154
- continue;
155
- case 7:
156
- op = _.ops.pop();
157
- _.trys.pop();
158
- continue;
159
- default:
160
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
161
- _ = 0;
162
- continue;
163
- }
164
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
165
- _.label = op[1];
166
- break;
167
- }
168
- if (op[0] === 6 && _.label < t[1]) {
169
- _.label = t[1];
170
- t = op;
171
- break;
172
- }
173
- if (t && _.label < t[2]) {
174
- _.label = t[2];
175
- _.ops.push(op);
176
- break;
177
- }
178
- if (t[2])
179
- _.ops.pop();
180
- _.trys.pop();
181
- continue;
182
- }
183
- op = body.call(thisArg, _);
184
- }
185
- catch (e) {
186
- op = [6, e];
187
- y = 0;
188
- }
189
- finally {
190
- f = t = 0;
191
- }
192
- if (op[0] & 5)
193
- throw op[1];
194
- return { value: op[0] ? op[1] : void 0, done: true };
195
- }
196
- }
197
- var __createBinding = Object.create ? (function (o, m, k, k2) {
198
- if (k2 === undefined)
199
- k2 = k;
200
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
201
- }) : (function (o, m, k, k2) {
202
- if (k2 === undefined)
203
- k2 = k;
204
- o[k2] = m[k];
205
- });
206
- function __exportStar(m, o) {
207
- for (var p in m)
208
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
209
- __createBinding(o, m, p);
210
- }
211
- function __values(o) {
212
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
213
- if (m)
214
- return m.call(o);
215
- if (o && typeof o.length === "number")
216
- return {
217
- next: function () {
218
- if (o && i >= o.length)
219
- o = void 0;
220
- return { value: o && o[i++], done: !o };
221
- }
222
- };
223
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
224
- }
225
- function __read(o, n) {
226
- var m = typeof Symbol === "function" && o[Symbol.iterator];
227
- if (!m)
228
- return o;
229
- var i = m.call(o), r, ar = [], e;
230
- try {
231
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
232
- ar.push(r.value);
233
- }
234
- catch (error) {
235
- e = { error: error };
236
- }
237
- finally {
238
- try {
239
- if (r && !r.done && (m = i["return"]))
240
- m.call(i);
241
- }
242
- finally {
243
- if (e)
244
- throw e.error;
245
- }
246
- }
247
- return ar;
248
- }
249
- /** @deprecated */
250
- function __spread() {
251
- for (var ar = [], i = 0; i < arguments.length; i++)
252
- ar = ar.concat(__read(arguments[i]));
253
- return ar;
254
- }
255
- /** @deprecated */
256
- function __spreadArrays() {
257
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
258
- s += arguments[i].length;
259
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
260
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
261
- r[k] = a[j];
262
- return r;
263
- }
264
- function __spreadArray(to, from, pack) {
265
- if (pack || arguments.length === 2)
266
- for (var i = 0, l = from.length, ar; i < l; i++) {
267
- if (ar || !(i in from)) {
268
- if (!ar)
269
- ar = Array.prototype.slice.call(from, 0, i);
270
- ar[i] = from[i];
271
- }
272
- }
273
- return to.concat(ar || Array.prototype.slice.call(from));
274
- }
275
- function __await(v) {
276
- return this instanceof __await ? (this.v = v, this) : new __await(v);
277
- }
278
- function __asyncGenerator(thisArg, _arguments, generator) {
279
- if (!Symbol.asyncIterator)
280
- throw new TypeError("Symbol.asyncIterator is not defined.");
281
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
282
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
283
- function verb(n) { if (g[n])
284
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
285
- function resume(n, v) { try {
286
- step(g[n](v));
287
- }
288
- catch (e) {
289
- settle(q[0][3], e);
290
- } }
291
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
292
- function fulfill(value) { resume("next", value); }
293
- function reject(value) { resume("throw", value); }
294
- function settle(f, v) { if (f(v), q.shift(), q.length)
295
- resume(q[0][0], q[0][1]); }
296
- }
297
- function __asyncDelegator(o) {
298
- var i, p;
299
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
300
- 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; }
301
- }
302
- function __asyncValues(o) {
303
- if (!Symbol.asyncIterator)
304
- throw new TypeError("Symbol.asyncIterator is not defined.");
305
- var m = o[Symbol.asyncIterator], i;
306
- 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);
307
- 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); }); }; }
308
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
309
- }
310
- function __makeTemplateObject(cooked, raw) {
311
- if (Object.defineProperty) {
312
- Object.defineProperty(cooked, "raw", { value: raw });
313
- }
314
- else {
315
- cooked.raw = raw;
316
- }
317
- return cooked;
318
- }
319
- ;
320
- var __setModuleDefault = Object.create ? (function (o, v) {
321
- Object.defineProperty(o, "default", { enumerable: true, value: v });
322
- }) : function (o, v) {
323
- o["default"] = v;
324
- };
325
- function __importStar(mod) {
326
- if (mod && mod.__esModule)
327
- return mod;
328
- var result = {};
329
- if (mod != null)
330
- for (var k in mod)
331
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
332
- __createBinding(result, mod, k);
333
- __setModuleDefault(result, mod);
334
- return result;
335
- }
336
- function __importDefault(mod) {
337
- return (mod && mod.__esModule) ? mod : { default: mod };
338
- }
339
- function __classPrivateFieldGet(receiver, state, kind, f) {
340
- if (kind === "a" && !f)
341
- throw new TypeError("Private accessor was defined without a getter");
342
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
343
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
344
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
345
- }
346
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
347
- if (kind === "m")
348
- throw new TypeError("Private method is not writable");
349
- if (kind === "a" && !f)
350
- throw new TypeError("Private accessor was defined without a setter");
351
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
352
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
353
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
354
- }
355
-
356
- var NucDialogComponent = /** @class */ (function () {
357
- function NucDialogComponent(dialogRef, dialogData) {
358
- this.dialogRef = dialogRef;
359
- this.dialogData = dialogData;
360
- }
361
- return NucDialogComponent;
362
- }());
363
- NucDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucDialogComponent, deps: [{ token: i1__namespace.MatDialogRef }, { token: i1.MAT_DIALOG_DATA }], target: i0__namespace.ɵɵFactoryTarget.Component });
364
- NucDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: NucDialogComponent, selector: "nuc-dialog", ngImport: i0__namespace, template: "<ng-container *ngIf=\"dialogData\">\r\n <h2 mat-dialog-title *ngIf=\"dialogData.title\">\r\n {{dialogData.title}}\r\n </h2>\r\n <mat-dialog-content>{{dialogData.message}}</mat-dialog-content>\r\n <mat-dialog-actions>\r\n <ng-container *ngFor=\"let action of dialogData.actions\">\r\n <button color=\"{{action.color || 'primary'}}\" *ngIf=\"action.value === undefined\" mat-button mat-dialog-close>{{action.text}}</button>\r\n <button color=\"{{action.color || 'primary'}}\" *ngIf=\"action.value !== undefined\" mat-button [mat-dialog-close]=\"action.value\">{{action.text}}</button>\r\n </ng-container>\r\n </mat-dialog-actions>\r\n</ng-container>\r\n", styles: ["mat-dialog-actions{justify-content:flex-end}mat-dialog-content{white-space:pre-wrap}button{text-transform:uppercase;font-weight:700}\n"], components: [{ type: i2__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }] });
365
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucDialogComponent, decorators: [{
366
- type: i0.Component,
367
- args: [{
368
- // eslint-disable-next-line @angular-eslint/component-selector
369
- selector: 'nuc-dialog',
370
- templateUrl: './dialog.component.html',
371
- styleUrls: ['./dialog.component.scss']
372
- }]
373
- }], ctorParameters: function () {
374
- return [{ type: i1__namespace.MatDialogRef }, { type: undefined, decorators: [{
375
- type: i0.Inject,
376
- args: [i1.MAT_DIALOG_DATA]
377
- }] }];
378
- } });
379
-
380
- var NucDialogService = /** @class */ (function () {
381
- function NucDialogService(_matDialog) {
382
- this._matDialog = _matDialog;
383
- }
384
- /**
385
- * Opens a NucDialog with content from dialogData.
386
- *
387
- * @param dialogData NucDialogData containing title, message and possible actions.
388
- * @param dialogConfig Extra configuration options. Data property is ignored, since it will be set to dialogData.
389
- * @returns a promise with value that was specified inside pressed Nucleus action.
390
- */
391
- NucDialogService.prototype.open = function (dialogData, dialogConfig) {
392
- return __awaiter(this, void 0, void 0, function () {
393
- return __generator(this, function (_a) {
394
- switch (_a.label) {
395
- case 0:
396
- if (!(dialogData.actions && dialogData.actions.length > 0)) return [3 /*break*/, 2];
397
- if (dialogConfig) {
398
- dialogConfig.data = dialogData;
399
- }
400
- else {
401
- dialogConfig = { data: dialogData };
402
- }
403
- return [4 /*yield*/, this._matDialog.open(NucDialogComponent, dialogConfig).beforeClosed().toPromise()];
404
- case 1: return [2 /*return*/, _a.sent()];
405
- case 2:
406
- console.error('Nucleus.AppCore: NucDialogData requires at least one action.');
407
- _a.label = 3;
408
- case 3: return [2 /*return*/];
409
- }
410
- });
411
- });
412
- };
413
- return NucDialogService;
414
- }());
415
- NucDialogService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucDialogService, deps: [{ token: i1__namespace.MatDialog }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
416
- NucDialogService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucDialogService, providedIn: 'root' });
417
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucDialogService, decorators: [{
418
- type: i0.Injectable,
419
- args: [{
420
- providedIn: 'root'
421
- }]
422
- }], ctorParameters: function () { return [{ type: i1__namespace.MatDialog }]; } });
423
-
424
- var NucDialogModule = /** @class */ (function () {
425
- function NucDialogModule() {
426
- }
427
- return NucDialogModule;
428
- }());
429
- NucDialogModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucDialogModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
430
- NucDialogModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucDialogModule, declarations: [NucDialogComponent], imports: [i3.CommonModule,
431
- i1.MatDialogModule,
432
- i2.MatButtonModule] });
433
- NucDialogModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucDialogModule, imports: [[
434
- i3.CommonModule,
435
- i1.MatDialogModule,
436
- i2.MatButtonModule
437
- ]] });
438
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucDialogModule, decorators: [{
439
- type: i0.NgModule,
440
- args: [{
441
- declarations: [
442
- NucDialogComponent
443
- ],
444
- imports: [
445
- i3.CommonModule,
446
- i1.MatDialogModule,
447
- i2.MatButtonModule
448
- ],
449
- entryComponents: [
450
- NucDialogComponent
451
- ]
452
- }]
453
- }] });
454
-
455
- exports.NucColor = void 0;
456
- (function (NucColor) {
457
- /** Primary color of the theme. */
458
- NucColor["primary"] = "primary";
459
- /** Accent color of the theme. */
460
- NucColor["accent"] = "accent";
461
- /** Warning color of the theme. */
462
- NucColor["warn"] = "warn";
463
- })(exports.NucColor || (exports.NucColor = {}));
464
-
465
- exports.LoadingStatus = void 0;
466
- (function (LoadingStatus) {
467
- LoadingStatus[LoadingStatus["completed"] = 0] = "completed";
468
- LoadingStatus[LoadingStatus["inProgress"] = 1] = "inProgress";
469
- LoadingStatus[LoadingStatus["failed"] = 2] = "failed";
470
- LoadingStatus[LoadingStatus["undefined"] = 3] = "undefined";
471
- })(exports.LoadingStatus || (exports.LoadingStatus = {}));
472
- var LoadingState = /** @class */ (function () {
473
- function LoadingState() {
474
- this._status = exports.LoadingStatus.undefined;
475
- this._message = null;
476
- this._errorDetails = null;
477
- }
478
- Object.defineProperty(LoadingState.prototype, "status", {
479
- get: function () {
480
- return this._status;
481
- },
482
- enumerable: false,
483
- configurable: true
484
- });
485
- Object.defineProperty(LoadingState.prototype, "message", {
486
- get: function () {
487
- return this._message;
488
- },
489
- enumerable: false,
490
- configurable: true
491
- });
492
- Object.defineProperty(LoadingState.prototype, "errorDetails", {
493
- get: function () {
494
- return this._errorDetails;
495
- },
496
- enumerable: false,
497
- configurable: true
498
- });
499
- LoadingState.prototype.load = function (observable, resultFunction, errorFunction, completeFunction) {
500
- var _this = this;
501
- this.setInProgress();
502
- this._resultFunction = resultFunction;
503
- this._errorFunction = errorFunction;
504
- this._completeFunction = completeFunction;
505
- this._loadObservable = observable.pipe(operators.tap(function () {
506
- _this.setCompleted();
507
- }, function () {
508
- _this.setFailed();
509
- }));
510
- return this._loadObservable.subscribe(this._resultFunction, this._errorFunction, this._completeFunction);
511
- };
512
- LoadingState.prototype.retry = function () {
513
- this.setInProgress();
514
- this._loadObservable.subscribe(this._resultFunction, this._errorFunction, this._completeFunction);
515
- };
516
- LoadingState.prototype.setInProgress = function (message) {
517
- if (message === void 0) { message = null; }
518
- this._status = exports.LoadingStatus.inProgress;
519
- this._message = message;
520
- };
521
- LoadingState.prototype.setCompleted = function () {
522
- this._status = exports.LoadingStatus.completed;
523
- };
524
- LoadingState.prototype.setFailed = function (message, error) {
525
- if (message === void 0) { message = null; }
526
- if (error === void 0) { error = null; }
527
- this._status = exports.LoadingStatus.failed;
528
- this._message = message;
529
- this._errorDetails = error;
530
- };
531
- return LoadingState;
532
- }());
533
-
534
- var NucLoadedContentComponent = /** @class */ (function () {
535
- function NucLoadedContentComponent() {
536
- this._errorDetailsVisible = false;
537
- this.errorMessage = 'We are having trouble loading the data.';
538
- this.showRetry = true;
539
- }
540
- Object.defineProperty(NucLoadedContentComponent.prototype, "message", {
541
- get: function () {
542
- if (this.state.message != null) {
543
- return this.state.message;
544
- }
545
- else {
546
- if (this.state.status === exports.LoadingStatus.failed) {
547
- return this.errorMessage;
548
- }
549
- else if (this.state.status === exports.LoadingStatus.inProgress) {
550
- return this.inProgressMessage;
551
- }
552
- }
553
- return null;
554
- },
555
- enumerable: false,
556
- configurable: true
557
- });
558
- Object.defineProperty(NucLoadedContentComponent.prototype, "showRetryButton", {
559
- get: function () {
560
- return this.showRetry;
561
- },
562
- enumerable: false,
563
- configurable: true
564
- });
565
- Object.defineProperty(NucLoadedContentComponent.prototype, "inProgress", {
566
- get: function () {
567
- var inProgress = this.state.status === exports.LoadingStatus.inProgress;
568
- if (inProgress) {
569
- this._errorDetailsVisible = false;
570
- }
571
- return inProgress;
572
- },
573
- enumerable: false,
574
- configurable: true
575
- });
576
- Object.defineProperty(NucLoadedContentComponent.prototype, "failed", {
577
- get: function () {
578
- return this.state.status === exports.LoadingStatus.failed;
579
- },
580
- enumerable: false,
581
- configurable: true
582
- });
583
- Object.defineProperty(NucLoadedContentComponent.prototype, "completed", {
584
- get: function () {
585
- return this.state.status === exports.LoadingStatus.completed;
586
- },
587
- enumerable: false,
588
- configurable: true
589
- });
590
- Object.defineProperty(NucLoadedContentComponent.prototype, "errorDetailsVisible", {
591
- get: function () {
592
- return this._errorDetailsVisible;
593
- },
594
- enumerable: false,
595
- configurable: true
596
- });
597
- NucLoadedContentComponent.prototype.showErrorDetails = function () {
598
- this._errorDetailsVisible = true;
599
- };
600
- return NucLoadedContentComponent;
601
- }());
602
- NucLoadedContentComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucLoadedContentComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
603
- NucLoadedContentComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: NucLoadedContentComponent, selector: "nuc-loaded-content-component", inputs: { completedTemplate: "completedTemplate", errorTemplate: "errorTemplate", inProgressTemplate: "inProgressTemplate", state: "state", inProgressMessage: "inProgressMessage", errorMessage: "errorMessage", showRetry: "showRetry" }, ngImport: i0__namespace, template: "<ng-container *ngIf=\"completed\">\r\n <ng-container *ngTemplateOutlet=\"completedTemplate\"></ng-container>\r\n</ng-container>\r\n\r\n<div class=\"indicators-container\" *ngIf=\"inProgress || failed\">\r\n <ng-container *ngIf=\"inProgress\">\r\n <ng-container *ngTemplateOutlet=\"inProgressTemplate ? inProgressTemplate: defaultInProgressTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"failed\">\r\n <ng-container *ngTemplateOutlet=\"errorTemplate ? errorTemplate: defaultErrorTemplate\"></ng-container>\r\n </ng-container>\r\n</div>\r\n\r\n<ng-template #defaultInProgressTemplate>\r\n <div class=\"spinner\">\r\n <mat-spinner [diameter]=\"45\"></mat-spinner>\r\n </div>\r\n <p>\r\n {{message}}\r\n </p>\r\n</ng-template>\r\n\r\n<ng-template #defaultErrorTemplate>\r\n <div>\r\n <p>\r\n {{message}}\r\n </p>\r\n\r\n <!--<div *ngIf=\"state.errorDetails\">\r\n <button *ngIf=\"!errorDetailsVisible\" mat-button color=\"warn\" (click)=\"showErrorDetails()\">show details</button>\r\n\r\n <div *ngIf=\"errorDetailsVisible\" class=\"error-details mat-small\">\r\n <strong>details:</strong><br />\r\n <p>{{state.errorDetails}}</p>\r\n </div>\r\n </div>-->\r\n\r\n <p *ngIf=\"showRetryButton\">\r\n <button mat-mini-fab color=\"primary\" (click)=\"state.retry()\">\r\n <mat-icon>refresh</mat-icon>\r\n </button>\r\n </p>\r\n\r\n </div>\r\n</ng-template>\r\n", styles: [".indicators-container{text-align:center;margin:0 auto;padding-top:4rem}.error-details{margin-top:1rem}.spinner{display:flex;justify-content:center;align-items:center;margin-bottom:.3rem}\n"], components: [{ type: i1__namespace$1.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i2__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
604
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucLoadedContentComponent, decorators: [{
605
- type: i0.Component,
606
- args: [{
607
- // eslint-disable-next-line @angular-eslint/component-selector
608
- selector: 'nuc-loaded-content-component',
609
- templateUrl: './loaded-content-component.html',
610
- styleUrls: ['./loaded-content-component.scss']
611
- }]
612
- }], propDecorators: { completedTemplate: [{
613
- type: i0.Input
614
- }], errorTemplate: [{
615
- type: i0.Input
616
- }], inProgressTemplate: [{
617
- type: i0.Input
618
- }], state: [{
619
- type: i0.Input
620
- }], inProgressMessage: [{
621
- type: i0.Input
622
- }], errorMessage: [{
623
- type: i0.Input
624
- }], showRetry: [{
625
- type: i0.Input
626
- }] } });
627
-
628
- // eslint-disable-next-line @angular-eslint/directive-selector
629
- var NucLoadedContentDirective = /** @class */ (function () {
630
- function NucLoadedContentDirective(_viewContainer, templateRef, _componentResolver) {
631
- this._viewContainer = _viewContainer;
632
- this.templateRef = templateRef;
633
- this._componentResolver = _componentResolver;
634
- this._completedTemplateRef = null;
635
- this._errorTemplateRef = null;
636
- this._inProgressTemplateRef = null;
637
- this._component = null;
638
- this._completedTemplateRef = templateRef;
639
- }
640
- Object.defineProperty(NucLoadedContentDirective.prototype, "nucLoadedContent", {
641
- set: function (state) {
642
- // add some error handling if state is null, etc.
643
- this._state = state;
644
- this._updateView();
645
- },
646
- enumerable: false,
647
- configurable: true
648
- });
649
- Object.defineProperty(NucLoadedContentDirective.prototype, "errorTemplate", {
650
- // eslint-disable-next-line @angular-eslint/no-input-rename
651
- set: function (templateRef) {
652
- this._errorTemplateRef = templateRef;
653
- this._updateView();
654
- },
655
- enumerable: false,
656
- configurable: true
657
- });
658
- Object.defineProperty(NucLoadedContentDirective.prototype, "inProgressTemplate", {
659
- // eslint-disable-next-line @angular-eslint/no-input-rename
660
- set: function (templateRef) {
661
- this._inProgressTemplateRef = templateRef;
662
- this._updateView();
663
- },
664
- enumerable: false,
665
- configurable: true
666
- });
667
- Object.defineProperty(NucLoadedContentDirective.prototype, "inProgressMessage", {
668
- set: function (inProgressMessage) {
669
- this._component.instance.inProgressMessage = inProgressMessage;
670
- },
671
- enumerable: false,
672
- configurable: true
673
- });
674
- Object.defineProperty(NucLoadedContentDirective.prototype, "errorMessage", {
675
- set: function (errorMessage) {
676
- this._component.instance.errorMessage = errorMessage;
677
- },
678
- enumerable: false,
679
- configurable: true
680
- });
681
- Object.defineProperty(NucLoadedContentDirective.prototype, "showRetry", {
682
- set: function (showRetry) {
683
- this._component.instance.showRetry = showRetry;
684
- },
685
- enumerable: false,
686
- configurable: true
687
- });
688
- NucLoadedContentDirective.prototype._updateView = function () {
689
- if (this._component == null) {
690
- var fac = this._componentResolver.resolveComponentFactory(NucLoadedContentComponent);
691
- this._component = this._viewContainer.createComponent(fac);
692
- }
693
- this._component.instance.state = this._state;
694
- this._component.instance.completedTemplate = this._completedTemplateRef;
695
- if (this._inProgressTemplateRef) {
696
- this._component.instance.inProgressTemplate = this._inProgressTemplateRef;
697
- }
698
- if (this._errorTemplateRef) {
699
- this._component.instance.errorTemplate = this._errorTemplateRef;
700
- }
701
- };
702
- return NucLoadedContentDirective;
703
- }());
704
- NucLoadedContentDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucLoadedContentDirective, deps: [{ token: i0__namespace.ViewContainerRef }, { token: i0__namespace.TemplateRef }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Directive });
705
- NucLoadedContentDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.3", type: NucLoadedContentDirective, selector: "[nucLoadedContent]", inputs: { nucLoadedContent: "nucLoadedContent", errorTemplate: ["nucLoadedContentError", "errorTemplate"], inProgressTemplate: ["nucLoadedContentInProgress", "inProgressTemplate"], inProgressMessage: ["nucLoadedContentInProgressMessage", "inProgressMessage"], errorMessage: ["nucLoadedContentErrorMessage", "errorMessage"], showRetry: ["nucLoadedContentShowRetry", "showRetry"] }, ngImport: i0__namespace });
706
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucLoadedContentDirective, decorators: [{
707
- type: i0.Directive,
708
- args: [{ selector: '[nucLoadedContent]' }]
709
- }], ctorParameters: function () { return [{ type: i0__namespace.ViewContainerRef }, { type: i0__namespace.TemplateRef }, { type: i0__namespace.ComponentFactoryResolver }]; }, propDecorators: { nucLoadedContent: [{
710
- type: i0.Input
711
- }], errorTemplate: [{
712
- type: i0.Input,
713
- args: ['nucLoadedContentError']
714
- }], inProgressTemplate: [{
715
- type: i0.Input,
716
- args: ['nucLoadedContentInProgress']
717
- }], inProgressMessage: [{
718
- type: i0.Input,
719
- args: ['nucLoadedContentInProgressMessage']
720
- }], errorMessage: [{
721
- type: i0.Input,
722
- args: ['nucLoadedContentErrorMessage']
723
- }], showRetry: [{
724
- type: i0.Input,
725
- args: ['nucLoadedContentShowRetry']
726
- }] } });
727
-
728
- var NucLoadedContentModule = /** @class */ (function () {
729
- function NucLoadedContentModule() {
730
- }
731
- return NucLoadedContentModule;
732
- }());
733
- NucLoadedContentModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucLoadedContentModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
734
- NucLoadedContentModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucLoadedContentModule, declarations: [NucLoadedContentDirective,
735
- NucLoadedContentComponent], imports: [i3.CommonModule,
736
- i1$1.MatProgressSpinnerModule,
737
- i2.MatButtonModule,
738
- i3$1.MatIconModule], exports: [NucLoadedContentDirective] });
739
- NucLoadedContentModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucLoadedContentModule, imports: [[
740
- i3.CommonModule,
741
- i1$1.MatProgressSpinnerModule,
742
- i2.MatButtonModule,
743
- i3$1.MatIconModule
744
- ]] });
745
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucLoadedContentModule, decorators: [{
746
- type: i0.NgModule,
747
- args: [{
748
- declarations: [
749
- NucLoadedContentDirective,
750
- NucLoadedContentComponent
751
- ],
752
- imports: [
753
- i3.CommonModule,
754
- i1$1.MatProgressSpinnerModule,
755
- i2.MatButtonModule,
756
- i3$1.MatIconModule
757
- ],
758
- exports: [
759
- NucLoadedContentDirective
760
- ],
761
- entryComponents: [
762
- NucLoadedContentComponent
763
- ]
764
- }]
765
- }] });
766
-
767
- /// <reference path="../../../../../node_modules/@types/winrt-uwp/index.d.ts" />
768
- var NativeStylingService = /** @class */ (function () {
769
- function NativeStylingService(router) {
770
- this.router = router;
771
- }
772
- NativeStylingService.prototype.styleWindowsTitleBar = function (style) {
773
- var _this = this;
774
- if (window.Windows) {
775
- var accentColor = this.convertColor(style.backgroundColor);
776
- var hoverColor = style.hoverBackgroundColor ? this.convertColor(style.hoverBackgroundColor) : this.makeDarker(accentColor);
777
- var foregroundColor = style.foreground === 'light' ? Windows.UI.Colors.white : Windows.UI.Colors.black;
778
- var titleColor = style.hideTitle ? accentColor : foregroundColor;
779
- var appView = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
780
- var titleBar = appView.titleBar;
781
- titleBar.foregroundColor = titleColor;
782
- titleBar.inactiveForegroundColor = titleColor;
783
- titleBar.buttonHoverBackgroundColor = hoverColor;
784
- titleBar.buttonBackgroundColor = accentColor;
785
- titleBar.buttonInactiveBackgroundColor = accentColor;
786
- titleBar.buttonHoverForegroundColor = foregroundColor;
787
- titleBar.buttonForegroundColor = foregroundColor;
788
- titleBar.buttonInactiveForegroundColor = foregroundColor;
789
- titleBar.backgroundColor = accentColor;
790
- titleBar.inactiveBackgroundColor = accentColor;
791
- if (style.hideBackButton) {
792
- this.hideBackButton();
793
- var subscription_1 = this.router.events.subscribe(function (event) {
794
- if (event instanceof i1$2.NavigationEnd && event.id > 1) {
795
- _this.hideBackButton();
796
- subscription_1.unsubscribe();
797
- }
798
- });
799
- }
800
- }
801
- };
802
- NativeStylingService.prototype.hideBackButton = function () {
803
- var systemNavigation = Windows.UI.Core.SystemNavigationManager.getForCurrentView();
804
- systemNavigation.appViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.collapsed;
805
- };
806
- NativeStylingService.prototype.convertColor = function (colorStr) {
807
- var regEx = new RegExp('^#([A-Fa-f0-9]{6})$');
808
- if (!regEx.test(colorStr)) {
809
- throw new Error('Color is not in the right format. Should be #RRGGBB.');
810
- }
811
- var r = parseInt(colorStr.substr(1, 2), 16);
812
- var g = parseInt(colorStr.substr(3, 2), 16);
813
- var b = parseInt(colorStr.substr(5, 2), 16);
814
- return Windows.UI.ColorHelper.fromArgb(255, r, g, b);
815
- };
816
- NativeStylingService.prototype.makeDarker = function (color, factor) {
817
- if (factor === void 0) { factor = 0.80; }
818
- return Windows.UI.ColorHelper.fromArgb(color.a, color.r * factor, color.g * factor, color.b * factor);
819
- };
820
- return NativeStylingService;
821
- }());
822
- NativeStylingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NativeStylingService, deps: [{ token: i1__namespace$2.Router }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
823
- NativeStylingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NativeStylingService, providedIn: 'root' });
824
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NativeStylingService, decorators: [{
825
- type: i0.Injectable,
826
- args: [{
827
- providedIn: 'root'
828
- }]
829
- }], ctorParameters: function () { return [{ type: i1__namespace$2.Router }]; } });
830
-
831
- var WindowsTitleBarSyle = /** @class */ (function () {
832
- function WindowsTitleBarSyle() {
833
- this.hoverBackgroundColor = null;
834
- this.foreground = 'dark';
835
- this.hideTitle = false;
836
- this.hideBackButton = false;
837
- }
838
- return WindowsTitleBarSyle;
839
- }());
840
-
841
- // eslint-disable-next-line @angular-eslint/directive-selector
842
- var NucSwipeTabsDirective = /** @class */ (function () {
843
- function NucSwipeTabsDirective(element, // ElementRef<MatTabGroup> causes errors.
844
- tabGroup) {
845
- this.element = element;
846
- this.tabGroup = tabGroup;
847
- }
848
- NucSwipeTabsDirective.prototype.ngOnInit = function () {
849
- var _this = this;
850
- var hammerJs = new Hammer__namespace.Manager(this.element.nativeElement, {
851
- inputClass: Hammer__namespace.TouchInput
852
- });
853
- hammerJs.add(new Hammer__namespace.Pan({
854
- direction: Hammer__namespace.DIRECTION_HORIZONTAL,
855
- threshold: 30
856
- }));
857
- hammerJs.on('panleft panright', function (event) {
858
- if (event.isFinal) {
859
- // Check if any of the tabs are set to disabled
860
- var tabs = _this.tabGroup._tabs.map(function (x) { return x.disabled; });
861
- var anyTabDisabled = tabs.some(function (disabled) { return disabled; });
862
- if (event.type === 'panleft' && event.direction === 2 && _this.tabGroup.selectedIndex < (_this.tabGroup._tabs.length - 1)) {
863
- // Go to next tab
864
- if (anyTabDisabled) {
865
- var tabsToRight = tabs.slice(_this.tabGroup.selectedIndex + 1);
866
- _this.tabGroup.selectedIndex += _this.getOffset(tabsToRight);
867
- }
868
- else {
869
- _this.tabGroup.selectedIndex++;
870
- }
871
- }
872
- else if (event.type === 'panright' && event.direction === 4 && _this.tabGroup.selectedIndex > 0) {
873
- // Go to previous tab
874
- if (anyTabDisabled) {
875
- var tabsToLeft = tabs.slice().reverse().slice(-_this.tabGroup.selectedIndex);
876
- _this.tabGroup.selectedIndex -= _this.getOffset(tabsToLeft);
877
- }
878
- else {
879
- _this.tabGroup.selectedIndex--;
880
- }
881
- }
882
- }
883
- });
884
- };
885
- NucSwipeTabsDirective.prototype.getOffset = function (tabs) {
886
- // Find offset to the first enabled tab
887
- var offset = tabs.indexOf(tabs.find(function (disabled) { return !disabled; })) + 1;
888
- return offset;
889
- };
890
- return NucSwipeTabsDirective;
891
- }());
892
- NucSwipeTabsDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSwipeTabsDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.MatTabGroup }], target: i0__namespace.ɵɵFactoryTarget.Directive });
893
- NucSwipeTabsDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.3", type: NucSwipeTabsDirective, selector: "[nucSwipe]", ngImport: i0__namespace });
894
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSwipeTabsDirective, decorators: [{
895
- type: i0.Directive,
896
- args: [{ selector: '[nucSwipe]' }]
897
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i1__namespace$3.MatTabGroup }]; } });
898
-
899
- var NucSwipeTabsModule = /** @class */ (function () {
900
- function NucSwipeTabsModule() {
901
- }
902
- return NucSwipeTabsModule;
903
- }());
904
- NucSwipeTabsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSwipeTabsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
905
- NucSwipeTabsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSwipeTabsModule, declarations: [NucSwipeTabsDirective], imports: [i3.CommonModule], exports: [NucSwipeTabsDirective] });
906
- NucSwipeTabsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSwipeTabsModule, imports: [[
907
- i3.CommonModule
908
- ]] });
909
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSwipeTabsModule, decorators: [{
910
- type: i0.NgModule,
911
- args: [{
912
- declarations: [
913
- NucSwipeTabsDirective
914
- ],
915
- imports: [
916
- i3.CommonModule
917
- ],
918
- exports: [
919
- NucSwipeTabsDirective
920
- ]
921
- }]
922
- }] });
923
-
924
- var NucSnackbarService = /** @class */ (function () {
925
- function NucSnackbarService(_matSnackBar, _zone) {
926
- this._matSnackBar = _matSnackBar;
927
- this._zone = _zone;
928
- }
929
- NucSnackbarService.prototype.openSnackbar = function (type, message, action, duration) {
930
- var _this = this;
931
- var snackbarRef;
932
- this._zone.run(function () {
933
- snackbarRef = _this._matSnackBar.open(message, action, {
934
- duration: duration,
935
- panelClass: type + "-snackbar"
936
- });
937
- });
938
- return snackbarRef;
939
- };
940
- NucSnackbarService.prototype.openSnackbarWithConfig = function (message, action, config) {
941
- var _this = this;
942
- var snackbarRef;
943
- this._zone.run(function () {
944
- snackbarRef = _this._matSnackBar.open(message, action, config);
945
- });
946
- return snackbarRef;
947
- };
948
- return NucSnackbarService;
949
- }());
950
- NucSnackbarService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSnackbarService, deps: [{ token: i1__namespace$4.MatSnackBar }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
951
- NucSnackbarService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSnackbarService, providedIn: 'root' });
952
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSnackbarService, decorators: [{
953
- type: i0.Injectable,
954
- args: [{
955
- providedIn: 'root'
956
- }]
957
- }], ctorParameters: function () { return [{ type: i1__namespace$4.MatSnackBar }, { type: i0__namespace.NgZone }]; } });
958
-
959
- var NucSnackbarModule = /** @class */ (function () {
960
- function NucSnackbarModule() {
961
- }
962
- return NucSnackbarModule;
963
- }());
964
- NucSnackbarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSnackbarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
965
- NucSnackbarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSnackbarModule, imports: [i3.CommonModule,
966
- i1$4.MatSnackBarModule] });
967
- NucSnackbarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSnackbarModule, imports: [[
968
- i3.CommonModule,
969
- i1$4.MatSnackBarModule
970
- ]] });
971
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucSnackbarModule, decorators: [{
972
- type: i0.NgModule,
973
- args: [{
974
- declarations: [],
975
- imports: [
976
- i3.CommonModule,
977
- i1$4.MatSnackBarModule
978
- ],
979
- exports: []
980
- }]
981
- }] });
982
-
983
- exports.NucSnackbarType = void 0;
984
- (function (NucSnackbarType) {
985
- NucSnackbarType["Info"] = "info";
986
- NucSnackbarType["Warning"] = "warning";
987
- NucSnackbarType["Danger"] = "danger";
988
- NucSnackbarType["Success"] = "success";
989
- })(exports.NucSnackbarType || (exports.NucSnackbarType = {}));
990
-
991
- var NucUserAvatarComponent = /** @class */ (function () {
992
- function NucUserAvatarComponent() {
993
- this.size = 'medium';
994
- this.background = false;
995
- }
996
- NucUserAvatarComponent.prototype.getUserInitials = function () {
997
- var nameParts = this.name.split(' ');
998
- return nameParts[0].charAt(0).toUpperCase() + '' + nameParts[nameParts.length - 1].charAt(0).toUpperCase();
999
- };
1000
- NucUserAvatarComponent.prototype.getHslString = function () {
1001
- if (!this.background) {
1002
- return "hsl(" + 0 + "," + 0 + "%," + 100 + "%)";
1003
- }
1004
- var hash = 0;
1005
- for (var i = 0; i < this.name.length; i++) {
1006
- /*
1007
- * Javascript uses double precision floating-point format for all numerical datatypes.
1008
- * Except when using bitwise operations, where operators are converted to 32-bit signed integers.
1009
- * Result of bitwise operations are then converted back to double precision floating-point format.
1010
- *
1011
- * We make a bitwise OR operation between the new hash and 0.
1012
- * This keeps only the lower 32 bits in the new hash value.
1013
- */
1014
- // eslint-disable-next-line no-bitwise
1015
- hash = (this.name.charCodeAt(i) + ((hash << 15) - hash)) | 0;
1016
- }
1017
- var hue = Math.abs(hash % 360);
1018
- var lightness = 49.2;
1019
- var saturation = 42.6;
1020
- return "hsl(" + hue + "," + saturation + "%," + lightness + "%)";
1021
- };
1022
- return NucUserAvatarComponent;
1023
- }());
1024
- NucUserAvatarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucUserAvatarComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1025
- NucUserAvatarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: NucUserAvatarComponent, selector: "nuc-user-avatar", inputs: { name: "name", image: "image", size: "size", background: "background" }, ngImport: i0__namespace, template: "<ng-container *ngIf=\"image\">\r\n <div class=\"user-avatar size-{{size}}\">\r\n <img src=\"{{image}}\" />\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!image\">\r\n <div class=\"user-avatar size-{{size}} unselectable\" [style.background-color]=\"getHslString()\" [ngClass]=\"{'white-text': background, 'black-text border': !background}\">\r\n {{getUserInitials()}}\r\n </div>\r\n</ng-container>\r\n", styles: [".user-avatar{display:flex;align-items:center;justify-content:center;border-radius:50%;position:relative;text-align:center;font-weight:400}.user-avatar img{-o-object-fit:contain;object-fit:contain;width:inherit;height:inherit;border-radius:50%}.white-text{color:#fff}.black-text{color:#333}.unselectable{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.border{border:2px solid #333333}.user-avatar.size-small{height:24px;width:24px;font-size:.8em;line-height:24px}.user-avatar.size-medium{height:40px;width:40px;font-size:1.2em;line-height:40px}.user-avatar.size-large{height:64px;width:64px;font-size:2em;line-height:64px}.user-avatar.size-xlarge{height:90px;width:90px;font-size:3em;line-height:90px}\n"], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1026
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucUserAvatarComponent, decorators: [{
1027
- type: i0.Component,
1028
- args: [{
1029
- // eslint-disable-next-line @angular-eslint/component-selector
1030
- selector: 'nuc-user-avatar',
1031
- templateUrl: './user-avatar-component.html',
1032
- styleUrls: ['./user-avatar-component.scss']
1033
- }]
1034
- }], ctorParameters: function () { return []; }, propDecorators: { name: [{
1035
- type: i0.Input
1036
- }], image: [{
1037
- type: i0.Input
1038
- }], size: [{
1039
- type: i0.Input
1040
- }], background: [{
1041
- type: i0.Input
1042
- }] } });
1043
-
1044
- var NucUserAvatarModule = /** @class */ (function () {
1045
- function NucUserAvatarModule() {
1046
- }
1047
- return NucUserAvatarModule;
1048
- }());
1049
- NucUserAvatarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucUserAvatarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1050
- NucUserAvatarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucUserAvatarModule, declarations: [NucUserAvatarComponent], imports: [i3.CommonModule], exports: [NucUserAvatarComponent] });
1051
- NucUserAvatarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucUserAvatarModule, imports: [[
1052
- i3.CommonModule,
1053
- ]] });
1054
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: NucUserAvatarModule, decorators: [{
1055
- type: i0.NgModule,
1056
- args: [{
1057
- declarations: [
1058
- NucUserAvatarComponent
1059
- ],
1060
- imports: [
1061
- i3.CommonModule,
1062
- ],
1063
- exports: [
1064
- NucUserAvatarComponent
1065
- ]
1066
- }]
1067
- }] });
1068
-
1069
- /*
1070
- * Public API Surface of nucleus-material
1071
- */
1072
-
1073
- /**
1074
- * Generated bundle index. Do not edit.
1075
- */
1076
-
1077
- exports.LoadingState = LoadingState;
1078
- exports.NativeStylingService = NativeStylingService;
1079
- exports.NucDialogModule = NucDialogModule;
1080
- exports.NucDialogService = NucDialogService;
1081
- exports.NucLoadedContentComponent = NucLoadedContentComponent;
1082
- exports.NucLoadedContentDirective = NucLoadedContentDirective;
1083
- exports.NucLoadedContentModule = NucLoadedContentModule;
1084
- exports.NucSnackbarModule = NucSnackbarModule;
1085
- exports.NucSnackbarService = NucSnackbarService;
1086
- exports.NucSwipeTabsDirective = NucSwipeTabsDirective;
1087
- exports.NucSwipeTabsModule = NucSwipeTabsModule;
1088
- exports.NucUserAvatarComponent = NucUserAvatarComponent;
1089
- exports.NucUserAvatarModule = NucUserAvatarModule;
1090
- exports.WindowsTitleBarSyle = WindowsTitleBarSyle;
1091
-
1092
- Object.defineProperty(exports, '__esModule', { value: true });
1093
-
1094
- })));
1095
- //# sourceMappingURL=kolektor-nucleus-material.umd.js.map