@main-class/template 1.19.3 → 2.0.4

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 (40) hide show
  1. package/acesso/acesso.component.d.ts +3 -0
  2. package/base/base.component.d.ts +3 -0
  3. package/base/base.service.d.ts +3 -0
  4. package/esm2020/acesso/acesso.component.mjs +21 -0
  5. package/esm2020/base/base.component.mjs +138 -0
  6. package/esm2020/base/base.service.mjs +22 -0
  7. package/esm2020/footer/footer.component.mjs +21 -0
  8. package/esm2020/header/header.component.mjs +34 -0
  9. package/esm2020/menu/menu.component.mjs +50 -0
  10. package/esm2020/menu/menu.service.mjs +25 -0
  11. package/esm2020/template.module.mjs +137 -0
  12. package/fesm2015/main-class-template.mjs +414 -0
  13. package/fesm2015/main-class-template.mjs.map +1 -0
  14. package/fesm2020/main-class-template.mjs +419 -0
  15. package/fesm2020/main-class-template.mjs.map +1 -0
  16. package/footer/footer.component.d.ts +3 -0
  17. package/header/header.component.d.ts +3 -0
  18. package/{main-class-template.d.ts → index.d.ts} +1 -0
  19. package/menu/menu.component.d.ts +3 -0
  20. package/menu/menu.service.d.ts +3 -0
  21. package/package.json +20 -8
  22. package/template.module.d.ts +21 -0
  23. package/theming.scss +16 -16
  24. package/bundles/main-class-template.umd.js +0 -780
  25. package/bundles/main-class-template.umd.js.map +0 -1
  26. package/bundles/main-class-template.umd.min.js +0 -16
  27. package/bundles/main-class-template.umd.min.js.map +0 -1
  28. package/esm2015/acesso/acesso.component.js +0 -23
  29. package/esm2015/base/base.component.js +0 -142
  30. package/esm2015/base/base.service.js +0 -21
  31. package/esm2015/footer/footer.component.js +0 -23
  32. package/esm2015/header/header.component.js +0 -40
  33. package/esm2015/menu/menu.component.js +0 -45
  34. package/esm2015/menu/menu.service.js +0 -24
  35. package/esm2015/template.module.js +0 -101
  36. package/fesm2015/main-class-template.js +0 -403
  37. package/fesm2015/main-class-template.js.map +0 -1
  38. package/main-class-template.metadata.json +0 -1
  39. /package/{esm2015/main-class-template.js → esm2020/main-class-template.mjs} +0 -0
  40. /package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
@@ -1,780 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/router'), require('rxjs'), require('@main-class/componentes/core'), require('@angular/material/sidenav'), require('@angular/material/button'), require('@angular/material/icon'), require('@main-class/componentes/dialog'), require('@angular/material/badge'), require('@angular/material/tabs'), require('@angular/material/menu'), require('@angular/material/divider'), require('@angular/material/chips'), require('@angular/material/tooltip'), require('@ngx-translate/core')) :
3
- typeof define === 'function' && define.amd ? define('@main-class/template', ['exports', '@angular/core', '@angular/common', '@angular/router', 'rxjs', '@main-class/componentes/core', '@angular/material/sidenav', '@angular/material/button', '@angular/material/icon', '@main-class/componentes/dialog', '@angular/material/badge', '@angular/material/tabs', '@angular/material/menu', '@angular/material/divider', '@angular/material/chips', '@angular/material/tooltip', '@ngx-translate/core'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['main-class'] = global['main-class'] || {}, global['main-class'].template = {}), global.ng.core, global.ng.common, global.ng.router, global.rxjs, global.core, global.ng.material.sidenav, global.ng.material.button, global.ng.material.icon, global.dialog, global.ng.material.badge, global.ng.material.tabs, global.ng.material.menu, global.ng.material.divider, global.ng.material.chips, global.ng.material.tooltip, global.core$1));
5
- }(this, (function (exports, i0, common, router, rxjs, core, sidenav, button, icon, dialog, badge, tabs, menu, divider, chips, tooltip, core$1) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation. All rights reserved.
9
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
10
- this file except in compliance with the License. You may obtain a copy of the
11
- License at http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16
- MERCHANTABLITY OR NON-INFRINGEMENT.
17
-
18
- See the Apache Version 2.0 License for specific language governing permissions
19
- and limitations under the License.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (b.hasOwnProperty(p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
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
- var __assign = function () {
36
- __assign = Object.assign || function __assign(t) {
37
- for (var s, i = 1, n = arguments.length; i < n; i++) {
38
- s = arguments[i];
39
- for (var p in s)
40
- if (Object.prototype.hasOwnProperty.call(s, p))
41
- t[p] = s[p];
42
- }
43
- return t;
44
- };
45
- return __assign.apply(this, arguments);
46
- };
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s)
50
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
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")
62
- r = Reflect.decorate(decorators, target, key, desc);
63
- else
64
- for (var i = decorators.length - 1; i >= 0; i--)
65
- if (d = decorators[i])
66
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
- return c > 3 && r && Object.defineProperty(target, key, r), r;
68
- }
69
- function __param(paramIndex, decorator) {
70
- return function (target, key) { decorator(target, key, paramIndex); };
71
- }
72
- function __metadata(metadataKey, metadataValue) {
73
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
74
- return Reflect.metadata(metadataKey, metadataValue);
75
- }
76
- function __awaiter(thisArg, _arguments, P, generator) {
77
- return new (P || (P = Promise))(function (resolve, reject) {
78
- function fulfilled(value) { try {
79
- step(generator.next(value));
80
- }
81
- catch (e) {
82
- reject(e);
83
- } }
84
- function rejected(value) { try {
85
- step(generator["throw"](value));
86
- }
87
- catch (e) {
88
- reject(e);
89
- } }
90
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
91
- step((generator = generator.apply(thisArg, _arguments || [])).next());
92
- });
93
- }
94
- function __generator(thisArg, body) {
95
- var _ = { label: 0, sent: function () { if (t[0] & 1)
96
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
97
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
98
- function verb(n) { return function (v) { return step([n, v]); }; }
99
- function step(op) {
100
- if (f)
101
- throw new TypeError("Generator is already executing.");
102
- while (_)
103
- try {
104
- 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)
105
- return t;
106
- if (y = 0, t)
107
- op = [op[0] & 2, t.value];
108
- switch (op[0]) {
109
- case 0:
110
- case 1:
111
- t = op;
112
- break;
113
- case 4:
114
- _.label++;
115
- return { value: op[1], done: false };
116
- case 5:
117
- _.label++;
118
- y = op[1];
119
- op = [0];
120
- continue;
121
- case 7:
122
- op = _.ops.pop();
123
- _.trys.pop();
124
- continue;
125
- default:
126
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
127
- _ = 0;
128
- continue;
129
- }
130
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
131
- _.label = op[1];
132
- break;
133
- }
134
- if (op[0] === 6 && _.label < t[1]) {
135
- _.label = t[1];
136
- t = op;
137
- break;
138
- }
139
- if (t && _.label < t[2]) {
140
- _.label = t[2];
141
- _.ops.push(op);
142
- break;
143
- }
144
- if (t[2])
145
- _.ops.pop();
146
- _.trys.pop();
147
- continue;
148
- }
149
- op = body.call(thisArg, _);
150
- }
151
- catch (e) {
152
- op = [6, e];
153
- y = 0;
154
- }
155
- finally {
156
- f = t = 0;
157
- }
158
- if (op[0] & 5)
159
- throw op[1];
160
- return { value: op[0] ? op[1] : void 0, done: true };
161
- }
162
- }
163
- function __exportStar(m, exports) {
164
- for (var p in m)
165
- if (!exports.hasOwnProperty(p))
166
- exports[p] = m[p];
167
- }
168
- function __values(o) {
169
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
170
- if (m)
171
- return m.call(o);
172
- return {
173
- next: function () {
174
- if (o && i >= o.length)
175
- o = void 0;
176
- return { value: o && o[i++], done: !o };
177
- }
178
- };
179
- }
180
- function __read(o, n) {
181
- var m = typeof Symbol === "function" && o[Symbol.iterator];
182
- if (!m)
183
- return o;
184
- var i = m.call(o), r, ar = [], e;
185
- try {
186
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
187
- ar.push(r.value);
188
- }
189
- catch (error) {
190
- e = { error: error };
191
- }
192
- finally {
193
- try {
194
- if (r && !r.done && (m = i["return"]))
195
- m.call(i);
196
- }
197
- finally {
198
- if (e)
199
- throw e.error;
200
- }
201
- }
202
- return ar;
203
- }
204
- function __spread() {
205
- for (var ar = [], i = 0; i < arguments.length; i++)
206
- ar = ar.concat(__read(arguments[i]));
207
- return ar;
208
- }
209
- function __spreadArrays() {
210
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
211
- s += arguments[i].length;
212
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
213
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
214
- r[k] = a[j];
215
- return r;
216
- }
217
- ;
218
- function __await(v) {
219
- return this instanceof __await ? (this.v = v, this) : new __await(v);
220
- }
221
- function __asyncGenerator(thisArg, _arguments, generator) {
222
- if (!Symbol.asyncIterator)
223
- throw new TypeError("Symbol.asyncIterator is not defined.");
224
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
225
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
226
- function verb(n) { if (g[n])
227
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
228
- function resume(n, v) { try {
229
- step(g[n](v));
230
- }
231
- catch (e) {
232
- settle(q[0][3], e);
233
- } }
234
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
235
- function fulfill(value) { resume("next", value); }
236
- function reject(value) { resume("throw", value); }
237
- function settle(f, v) { if (f(v), q.shift(), q.length)
238
- resume(q[0][0], q[0][1]); }
239
- }
240
- function __asyncDelegator(o) {
241
- var i, p;
242
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
243
- 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; }
244
- }
245
- function __asyncValues(o) {
246
- if (!Symbol.asyncIterator)
247
- throw new TypeError("Symbol.asyncIterator is not defined.");
248
- var m = o[Symbol.asyncIterator], i;
249
- 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);
250
- 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); }); }; }
251
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
252
- }
253
- function __makeTemplateObject(cooked, raw) {
254
- if (Object.defineProperty) {
255
- Object.defineProperty(cooked, "raw", { value: raw });
256
- }
257
- else {
258
- cooked.raw = raw;
259
- }
260
- return cooked;
261
- }
262
- ;
263
- function __importStar(mod) {
264
- if (mod && mod.__esModule)
265
- return mod;
266
- var result = {};
267
- if (mod != null)
268
- for (var k in mod)
269
- if (Object.hasOwnProperty.call(mod, k))
270
- result[k] = mod[k];
271
- result.default = mod;
272
- return result;
273
- }
274
- function __importDefault(mod) {
275
- return (mod && mod.__esModule) ? mod : { default: mod };
276
- }
277
-
278
- var MenuService = /** @class */ (function () {
279
- function MenuService() {
280
- this.delegates = [];
281
- }
282
- MenuService.prototype.register = function (delegate) {
283
- this.delegates.push(delegate);
284
- };
285
- MenuService.prototype.unregister = function (delegate) {
286
- this.delegates.splice(this.delegates.indexOf(delegate), 1);
287
- };
288
- MenuService.prototype.toggle = function () {
289
- this.delegates.forEach(function (d) { return d.toggle(); });
290
- };
291
- return MenuService;
292
- }());
293
- MenuService.ɵprov = i0.ɵɵdefineInjectable({ factory: function MenuService_Factory() { return new MenuService(); }, token: MenuService, providedIn: "root" });
294
- MenuService.decorators = [
295
- { type: i0.Injectable, args: [{
296
- providedIn: 'root'
297
- },] }
298
- ];
299
- MenuService.ctorParameters = function () { return []; };
300
-
301
- var BaseService = /** @class */ (function () {
302
- function BaseService() {
303
- }
304
- BaseService.prototype.init = function () {
305
- };
306
- BaseService.prototype.flush = function () {
307
- if (this.entidadesSubscription) {
308
- this.entidadesSubscription.unsubscribe();
309
- }
310
- };
311
- return BaseService;
312
- }());
313
- BaseService.ɵprov = i0.ɵɵdefineInjectable({ factory: function BaseService_Factory() { return new BaseService(); }, token: BaseService, providedIn: "root" });
314
- BaseService.decorators = [
315
- { type: i0.Injectable, args: [{
316
- providedIn: 'root'
317
- },] }
318
- ];
319
- BaseService.ctorParameters = function () { return []; };
320
-
321
- var BaseComponent = /** @class */ (function () {
322
- function BaseComponent(router, injector, activatedRoute, mobileService, menuService, baseService, application) {
323
- var _this = this;
324
- this.router = router;
325
- this.injector = injector;
326
- this.activatedRoute = activatedRoute;
327
- this.mobileService = mobileService;
328
- this.menuService = menuService;
329
- this.baseService = baseService;
330
- this.application = application;
331
- this.hasTabs = true;
332
- this.mode = 'default';
333
- this.badges = {};
334
- this.mobieListener = function (mobile) { return _this.mobile = mobile; };
335
- this.listener = function (label, badge) { return _this.change(label, badge); };
336
- this.activatedRoute.data.subscribe(function (data) {
337
- if (data.badgeProvider) {
338
- if (_this.badgeProvider != null) {
339
- _this.badgeProvider.unsubscribe(_this.listener);
340
- }
341
- _this.badgeProvider = _this.injector.get(data.badgeProvider);
342
- _this.badgeProvider.subscribe(_this.listener);
343
- }
344
- });
345
- this.activatedRoute.queryParams.subscribe(function (qp) {
346
- if (qp.mode === 'dialog') {
347
- _this.mode = 'dialog';
348
- }
349
- else {
350
- _this.mode = 'default';
351
- }
352
- });
353
- }
354
- BaseComponent.prototype.change = function (label, badge) {
355
- var _this = this;
356
- this.tabs
357
- .forEach(function (tab) {
358
- if (tab.label === label) {
359
- _this.badges[tab.label] = badge;
360
- }
361
- });
362
- };
363
- BaseComponent.prototype.ngOnDestroy = function () {
364
- this.baseService.flush();
365
- this.menuService.unregister(this);
366
- this.mobileService.removeListener(this.mobieListener);
367
- if (this.badgeProvider != null) {
368
- this.badgeProvider.unsubscribe(this.listener);
369
- }
370
- };
371
- BaseComponent.prototype.ngAfterViewInit = function () {
372
- var _this = this;
373
- if (this.badgeProvider != null) {
374
- this.tabs.forEach(function (tab) { return __awaiter(_this, void 0, void 0, function () {
375
- return __generator(this, function (_a) {
376
- this.badges[tab.label] = this.badgeProvider.getBadget(tab.label).toPromise();
377
- return [2 /*return*/];
378
- });
379
- }); });
380
- }
381
- };
382
- BaseComponent.prototype.ngOnInit = function () {
383
- return __awaiter(this, void 0, void 0, function () {
384
- var updateState, _a;
385
- var _this = this;
386
- return __generator(this, function (_b) {
387
- switch (_b.label) {
388
- case 0:
389
- this.baseService.init();
390
- this.mobile = this.mobileService.mobile;
391
- this.menuService.register(this);
392
- this.mobileService.addListener(this.mobieListener);
393
- updateState = function (tabs, activatedRoute) {
394
- if (tabs === void 0) { tabs = []; }
395
- if (activatedRoute === void 0) { activatedRoute = _this.activatedRoute; }
396
- return __awaiter(_this, void 0, void 0, function () {
397
- var _loop_1, this_1, _a, _b, tab, e_1_1;
398
- var e_1, _c;
399
- return __generator(this, function (_d) {
400
- switch (_d.label) {
401
- case 0:
402
- if (!(activatedRoute.snapshot.data.hasTabs !== null &&
403
- activatedRoute.snapshot.data.hasTabs !== undefined && !activatedRoute.snapshot.data.hasTabs)) return [3 /*break*/, 1];
404
- this.hasTabs = false;
405
- return [3 /*break*/, 11];
406
- case 1:
407
- this.hasTabs = true;
408
- if (!(activatedRoute.snapshot.data &&
409
- activatedRoute.snapshot.data.tabs)) return [3 /*break*/, 9];
410
- _loop_1 = function (tab) {
411
- var permission, route, t;
412
- return __generator(this, function (_a) {
413
- switch (_a.label) {
414
- case 0: return [4 /*yield*/, this_1.checkPermission(tab)];
415
- case 1:
416
- permission = _a.sent();
417
- if (permission) {
418
- route = !!tab.route ? this_1.router.createUrlTree(tab.route.split('/'), {
419
- relativeTo: activatedRoute,
420
- }).toString() : undefined;
421
- t = tabs.find(function (t0) { return t0.label === tab.label; });
422
- if (t) {
423
- t.route = route;
424
- }
425
- else {
426
- tabs.push(Object.assign(Object.assign({}, tab), { route: route }));
427
- }
428
- }
429
- return [2 /*return*/];
430
- }
431
- });
432
- };
433
- this_1 = this;
434
- _d.label = 2;
435
- case 2:
436
- _d.trys.push([2, 7, 8, 9]);
437
- _a = __values(activatedRoute.snapshot.data.tabs), _b = _a.next();
438
- _d.label = 3;
439
- case 3:
440
- if (!!_b.done) return [3 /*break*/, 6];
441
- tab = _b.value;
442
- return [5 /*yield**/, _loop_1(tab)];
443
- case 4:
444
- _d.sent();
445
- _d.label = 5;
446
- case 5:
447
- _b = _a.next();
448
- return [3 /*break*/, 3];
449
- case 6: return [3 /*break*/, 9];
450
- case 7:
451
- e_1_1 = _d.sent();
452
- e_1 = { error: e_1_1 };
453
- return [3 /*break*/, 9];
454
- case 8:
455
- try {
456
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
457
- }
458
- finally { if (e_1) throw e_1.error; }
459
- return [7 /*endfinally*/];
460
- case 9:
461
- if (!activatedRoute.firstChild) return [3 /*break*/, 11];
462
- return [4 /*yield*/, updateState(tabs, activatedRoute.firstChild)];
463
- case 10: return [2 /*return*/, _d.sent()];
464
- case 11: return [2 /*return*/, tabs];
465
- }
466
- });
467
- });
468
- };
469
- this.router.events.subscribe(function (event) { return __awaiter(_this, void 0, void 0, function () {
470
- var _a;
471
- return __generator(this, function (_b) {
472
- switch (_b.label) {
473
- case 0:
474
- if (!(event instanceof router.NavigationEnd)) return [3 /*break*/, 2];
475
- _a = this;
476
- return [4 /*yield*/, updateState()];
477
- case 1:
478
- _a.tabs = _b.sent();
479
- this.application.tick();
480
- _b.label = 2;
481
- case 2: return [2 /*return*/];
482
- }
483
- });
484
- }); });
485
- _a = this;
486
- return [4 /*yield*/, updateState()];
487
- case 1:
488
- _a.tabs = _b.sent();
489
- this.application.tick();
490
- return [2 /*return*/];
491
- }
492
- });
493
- });
494
- };
495
- BaseComponent.prototype.toggle = function () {
496
- this.sidenav.toggle();
497
- };
498
- BaseComponent.prototype.checkPermission = function (tab) {
499
- return __awaiter(this, void 0, void 0, function () {
500
- var deps;
501
- var _a;
502
- var _this = this;
503
- return __generator(this, function (_b) {
504
- switch (_b.label) {
505
- case 0:
506
- if (!(tab.permission && tab.permission.condition)) return [3 /*break*/, 2];
507
- deps = tab.permission.deps ? tab.permission.deps.map(function (dep) { return _this.injector.get(dep); }) : [];
508
- return [4 /*yield*/, rxjs.from((_a = tab.permission).condition.apply(_a, __spread(deps))).toPromise()];
509
- case 1: return [2 /*return*/, _b.sent()];
510
- case 2: return [2 /*return*/, true];
511
- }
512
- });
513
- });
514
- };
515
- return BaseComponent;
516
- }());
517
- BaseComponent.decorators = [
518
- { type: i0.Component, args: [{
519
- selector: 'mcl-base',
520
- template: "<mcl-header *ngIf=\"mode !== 'dialog'\"></mcl-header>\n\n<mat-sidenav-container [ngClass]=\"{'dialog': mode === 'dialog'}\">\n <mat-sidenav [mode]=\"mobile ? 'over' : 'side'\"\n *ngIf=\"mode !== 'dialog'\"\n [opened]=\"!mobile\" #sidenav>\n <mcl-menu></mcl-menu>\n </mat-sidenav>\n <mat-sidenav-content>\n <div class=\"content\">\n <nav mat-tab-nav-bar *ngIf=\"hasTabs && mode !== 'dialog'\"\n [color]=\"'accent'\">\n <a mat-tab-link\n *ngFor=\"let tab of tabs\"\n [routerLink]=\"tab.route\"\n queryParamsHandling=\"preserve\"\n [active]=\"!tab.route\"\n >\n {{tab.label}}\n <span class=\"badge\" *ngIf=\"badges[tab.label]\">{{badges[tab.label]}}</span>\n </a>\n </nav>\n\n <router-outlet></router-outlet>\n </div>\n </mat-sidenav-content>\n</mat-sidenav-container>\n\n<mcl-footer *ngIf=\"mode !== 'dialog'\"></mcl-footer>\n",
521
- styles: [":host{display:flex;flex-direction:column;min-height:100%}:host mat-sidenav-container{background-color:transparent;flex:1 1 auto}:host mat-sidenav-container .dialog{top:0;bottom:0}:host mat-sidenav-container mat-sidenav{width:250px;background-color:#fff;display:flex;border:none;border-top-right-radius:8px;margin-top:25px;transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform,margin-left,margin-right}:host mat-sidenav-container.dialog mat-sidenav-content{margin-left:0;padding-right:30px}:host mat-sidenav-container mat-sidenav-content{display:flex;flex-direction:column;padding-left:30px;padding-top:25px}:host mat-sidenav-container mat-sidenav-content .content{flex:1 1 auto}:host mat-sidenav-container mat-sidenav-content .content [mat-tab-nav-bar]{margin-bottom:20px;border-bottom:0;border-top-left-radius:8px;border-bottom-left-radius:8px;background:#fff}:host mat-sidenav-container mat-sidenav-content .content [mat-tab-nav-bar] [mat-tab-link]{text-transform:uppercase;color:rgba(0,0,0,.5);min-width:100px;height:60px}:host mat-sidenav-container mat-sidenav-content .content [mat-tab-nav-bar] [mat-tab-link].mat-tab-label-active{color:rgba(0,0,0,.8);font-weight:700}:host mat-sidenav-container mat-sidenav-content .content .inner-content{padding:20px}:host mcl-header{height:80px;animation:.2s}:host mcl-footer{height:40px;animation:.2s}@media (max-width:600px){mat-sidenav-container mat-sidenav-content{margin-left:0}}"]
522
- },] }
523
- ];
524
- BaseComponent.ctorParameters = function () { return [
525
- { type: router.Router },
526
- { type: i0.Injector },
527
- { type: router.ActivatedRoute },
528
- { type: core.MobileService },
529
- { type: MenuService },
530
- { type: BaseService },
531
- { type: i0.ApplicationRef }
532
- ]; };
533
- BaseComponent.propDecorators = {
534
- sidenav: [{ type: i0.ViewChild, args: ['sidenav',] }]
535
- };
536
-
537
- var MENU_PROVIDER = new i0.InjectionToken('MENU_PROVIDER');
538
- var MenuComponent = /** @class */ (function () {
539
- function MenuComponent(mobileService, menuService, baseService, menuProvider) {
540
- this.mobileService = mobileService;
541
- this.menuService = menuService;
542
- this.baseService = baseService;
543
- this.menuProvider = menuProvider;
544
- }
545
- MenuComponent.prototype.ngOnInit = function () {
546
- var _this = this;
547
- if (this.menuProvider) {
548
- this.menuSubscription = this.menuProvider.menus()
549
- .subscribe(function (menus) {
550
- _this.menus = menus;
551
- });
552
- }
553
- };
554
- MenuComponent.prototype.ngOnDestroy = function () {
555
- if (this.menuSubscription) {
556
- this.menuSubscription.unsubscribe();
557
- }
558
- };
559
- MenuComponent.prototype.menuClicked = function (menu) {
560
- if (this.mobileService.mobile) {
561
- this.menuService.toggle();
562
- }
563
- };
564
- return MenuComponent;
565
- }());
566
- MenuComponent.decorators = [
567
- { type: i0.Component, args: [{
568
- selector: 'mcl-menu',
569
- template: "<div class=\"menu\">\n\n <ng-container *ngFor=\"let menu of menus\">\n <button mat-button\n *ngIf=\"!menu.children?.length\"\n (click)=\"menuClicked(menu)\"\n [routerLink]=\"menu.route\" [routerLinkActive]=\"['active']\">\n <mat-icon class=\"left\">{{menu.icon}}</mat-icon>\n <span class=\"text\">{{menu.label | translate}}</span>\n </button>\n\n <ng-container *ngIf=\"menu.children?.length\">\n <button mat-button [matMenuTriggerFor]=\"submenu\">\n <mat-icon class=\"left\" *ngIf=\"menu.icon\">{{menu.icon}}</mat-icon>\n <span class=\"text\">{{menu.label | translate}}</span>\n <mat-icon class=\"right\" >chevron_right</mat-icon>\n </button>\n\n <mat-menu #submenu=\"matMenu\" xPosition=\"before\">\n <button mat-menu-item\n *ngFor=\"let sub of menu.children\"\n (click)=\"menuClicked(sub)\"\n [routerLink]=\"sub.route\" [routerLinkActive]=\"['active']\">\n <mat-icon class=\"left\" *ngIf=\"sub.icon\">{{sub.icon}}</mat-icon>\n <span class=\"text\">{{sub.label | translate}}</span>\n </button>\n </mat-menu>\n </ng-container>\n </ng-container>\n\n <div class=\"spacer\"></div>\n\n <router-outlet name=\"menu-bottom\"></router-outlet>\n</div>\n",
570
- styles: [":host{display:flex;flex-direction:column;height:100%}.top{background-color:rgba(0,0,0,.35);height:100px;border-bottom:1px solid rgba(0,0,0,.15)}.menu{flex:1 1 auto;display:flex;flex-flow:column nowrap;border-top:1px solid hsla(0,0%,100%,.15);padding:30px 8px 20px 40px}.menu button{transition:.3s;width:100%;color:#333;text-align:left;height:60px;padding-left:15px;padding-right:15px;border-radius:4px;margin-bottom:8px}.menu button mat-icon.left{margin-right:10px;float:left;line-height:40px}.menu button mat-icon.right{margin-left:10px;float:right;line-height:40px}.menu .spacer{flex:1 1 auto}@media (max-width:1200px){.menu{padding-left:8px}}"]
571
- },] }
572
- ];
573
- MenuComponent.ctorParameters = function () { return [
574
- { type: core.MobileService },
575
- { type: MenuService },
576
- { type: BaseService },
577
- { type: undefined, decorators: [{ type: i0.Inject, args: [MENU_PROVIDER,] }, { type: i0.Optional }] }
578
- ]; };
579
-
580
- var HeaderComponent = /** @class */ (function () {
581
- function HeaderComponent(menuService, dialogService, mensageria, mobileService, activatedRoute) {
582
- this.menuService = menuService;
583
- this.dialogService = dialogService;
584
- this.mensageria = mensageria;
585
- this.mobileService = mobileService;
586
- this.activatedRoute = activatedRoute;
587
- }
588
- HeaderComponent.prototype.ngOnInit = function () {
589
- };
590
- Object.defineProperty(HeaderComponent.prototype, "logo", {
591
- get: function () {
592
- return this.activatedRoute.snapshot.data.logo;
593
- },
594
- enumerable: false,
595
- configurable: true
596
- });
597
- Object.defineProperty(HeaderComponent.prototype, "mobile", {
598
- get: function () {
599
- return this.mobileService.mobile;
600
- },
601
- enumerable: false,
602
- configurable: true
603
- });
604
- HeaderComponent.prototype.toggleMenu = function () {
605
- this.menuService.toggle();
606
- };
607
- return HeaderComponent;
608
- }());
609
- HeaderComponent.decorators = [
610
- { type: i0.Component, args: [{
611
- selector: 'mcl-header',
612
- template: "<a class=\"logo\" href=\"javascript:void(0)\" routerLink=\"/\">\n <img *ngIf=\"logo\" [src]=\"logo\"/>\n <ng-content select=\"logo\"></ng-content>\n</a>\n\n<div class=\"spacer\"></div>\n\n<router-outlet name=\"header-actions\"></router-outlet>\n",
613
- styles: [":host{background-color:#fff;display:flex;padding:0 80px;align-items:center;height:80px}:host a.logo img{height:50px;transition:.2s}:host h2{flex:1;margin:auto 10px;color:rgba(0,0,0,.54)}:host .spacer{flex:1 1 auto}:host button{color:rgba(0,0,0,.35);margin:auto 15px}:host button mat-icon{vertical-align:middle}@media (max-width:750px){:host{padding:0;flex-direction:column-reverse}}"]
614
- },] }
615
- ];
616
- HeaderComponent.ctorParameters = function () { return [
617
- { type: MenuService },
618
- { type: dialog.DialogService },
619
- { type: core.MensageriaService },
620
- { type: core.MobileService },
621
- { type: router.ActivatedRoute }
622
- ]; };
623
-
624
- var FooterComponent = /** @class */ (function () {
625
- function FooterComponent(activatedRoute) {
626
- this.activatedRoute = activatedRoute;
627
- }
628
- FooterComponent.prototype.ngOnInit = function () {
629
- };
630
- Object.defineProperty(FooterComponent.prototype, "direitos", {
631
- get: function () {
632
- return this.activatedRoute.snapshot.data.direitos;
633
- },
634
- enumerable: false,
635
- configurable: true
636
- });
637
- return FooterComponent;
638
- }());
639
- FooterComponent.decorators = [
640
- { type: i0.Component, args: [{
641
- selector: 'mcl-footer',
642
- template: "{{direitos | translate}}\n",
643
- styles: [":host{display:flex;justify-items:center;align-items:center;justify-content:center;color:#fff;text-align:center}"]
644
- },] }
645
- ];
646
- FooterComponent.ctorParameters = function () { return [
647
- { type: router.ActivatedRoute }
648
- ]; };
649
-
650
- var AcessoComponent = /** @class */ (function () {
651
- function AcessoComponent(activatedRoute) {
652
- this.activatedRoute = activatedRoute;
653
- }
654
- Object.defineProperty(AcessoComponent.prototype, "logo", {
655
- get: function () {
656
- return this.activatedRoute.snapshot.data.logo;
657
- },
658
- enumerable: false,
659
- configurable: true
660
- });
661
- AcessoComponent.prototype.ngOnInit = function () {
662
- };
663
- return AcessoComponent;
664
- }());
665
- AcessoComponent.decorators = [
666
- { type: i0.Component, args: [{
667
- selector: 'mcl-acesso',
668
- template: "<div class=\"form\">\n <div class=\"logo\">\n <img *ngIf=\"!!logo\" [src]=\"logo\" />\n <ng-content select=\"logo\"></ng-content>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n",
669
- styles: [":host{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;min-width:520px;min-height:700px;background-color:#f9f9f9;display:flex;justify-content:center;align-content:center;align-items:center}.form{padding:56px 48px 36px;width:301px;box-shadow:0 4px 4px #8fa4ad;border-radius:20px;text-align:center;font-size:16px;background-color:#fff}.form img{margin:-10% auto 0;width:90%}.form::ng-deep h2{width:100%;text-align:center;font-weight:400;font-size:22px;line-height:42px;margin:4px 0 36px}.form::ng-deep button{text-transform:uppercase}.form::ng-deep button[mat-flat-button]{margin-top:28px;height:40px;line-height:40px;width:100%;border-radius:30px;margin-bottom:16px}@media (max-width:750px){.form{margin-top:280px}}"]
670
- },] }
671
- ];
672
- AcessoComponent.ctorParameters = function () { return [
673
- { type: router.ActivatedRoute }
674
- ]; };
675
-
676
- var TemplateModule = /** @class */ (function () {
677
- function TemplateModule() {
678
- }
679
- TemplateModule.forRoot = function () {
680
- return {
681
- ngModule: TemplateModule,
682
- providers: [
683
- MenuService,
684
- BaseService,
685
- ]
686
- };
687
- };
688
- TemplateModule.forCrud = function (config) {
689
- return router.RouterModule.forChild([
690
- {
691
- path: '',
692
- data: {
693
- tabs: [
694
- {
695
- label: config.consultaLabel || 'Consulta',
696
- route: "" + config.routeBase
697
- },
698
- {
699
- label: config.cadastroLabel || 'Cadastro',
700
- route: config.routeBase + "/" + (config.cadastroPath || 'cadastro')
701
- }
702
- ]
703
- },
704
- children: __spread([
705
- {
706
- path: '',
707
- component: config.consultaComponent,
708
- data: Object.assign(Object.assign({}, (config.consultaExtraData || {})), { tabs: [
709
- {
710
- label: config.consultaLabel || 'Consulta',
711
- },
712
- ] }),
713
- },
714
- {
715
- path: config.cadastroPath || 'cadastro',
716
- component: config.cadastroComponent || config.edicaoComponent,
717
- data: Object.assign(Object.assign({}, (config.cadastroExtraData || {})), { tabs: [
718
- {
719
- label: config.cadastroLabel || 'Cadastro',
720
- }
721
- ] })
722
- },
723
- {
724
- path: ':id',
725
- component: config.edicaoComponent,
726
- data: Object.assign(Object.assign({}, (config.edicaoExtraData || {})), { tabs: [
727
- {
728
- label: config.edicaoLabel || 'Edição'
729
- }
730
- ] })
731
- }
732
- ], (config.extraRoutes || []))
733
- }
734
- ]);
735
- };
736
- return TemplateModule;
737
- }());
738
- TemplateModule.decorators = [
739
- { type: i0.NgModule, args: [{
740
- declarations: [BaseComponent, MenuComponent, HeaderComponent, FooterComponent, AcessoComponent],
741
- exports: [BaseComponent, AcessoComponent],
742
- imports: [
743
- common.CommonModule,
744
- router.RouterModule,
745
- sidenav.MatSidenavModule,
746
- button.MatButtonModule,
747
- icon.MatIconModule,
748
- badge.MatBadgeModule,
749
- tabs.MatTabsModule,
750
- menu.MatMenuModule,
751
- divider.MatDividerModule,
752
- chips.MatChipsModule,
753
- tooltip.MatTooltipModule,
754
- core$1.TranslateModule,
755
- ],
756
- },] }
757
- ];
758
-
759
- /*
760
- * Public API Surface of template
761
- */
762
-
763
- /**
764
- * Generated bundle index. Do not edit.
765
- */
766
-
767
- exports.AcessoComponent = AcessoComponent;
768
- exports.BaseComponent = BaseComponent;
769
- exports.BaseService = BaseService;
770
- exports.FooterComponent = FooterComponent;
771
- exports.HeaderComponent = HeaderComponent;
772
- exports.MENU_PROVIDER = MENU_PROVIDER;
773
- exports.MenuComponent = MenuComponent;
774
- exports.MenuService = MenuService;
775
- exports.TemplateModule = TemplateModule;
776
-
777
- Object.defineProperty(exports, '__esModule', { value: true });
778
-
779
- })));
780
- //# sourceMappingURL=main-class-template.umd.js.map