coer-elements 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. package/components/index.d.ts +2 -2
  2. package/esm2022/coer-elements.mjs +2 -2
  3. package/esm2022/components/index.mjs +3 -3
  4. package/esm2022/components/lib/coer-alert/coer-alert.component.mjs +227 -0
  5. package/esm2022/components/lib/components.module.mjs +92 -0
  6. package/esm2022/public_api.mjs +2 -0
  7. package/fesm2022/coer-elements.mjs +6 -697
  8. package/fesm2022/coer-elements.mjs.map +1 -1
  9. package/index.d.ts +5 -1
  10. package/package.json +1 -1
  11. package/public_api.d.ts +1 -0
  12. package/src/styles/bootstrap.scss +15 -0
  13. package/src/styles/coer-elements.scss +29 -0
  14. package/{styles → src/styles}/colors.scss +27 -1
  15. package/src/styles/containers.scss +34 -0
  16. package/src/styles/cursores.scss +11 -0
  17. package/src/styles/layout.scss +21 -0
  18. package/src/styles/scroll-bar.scss +20 -0
  19. package/styles/{index.css → coer-elements.css} +268 -26
  20. package/components/index.ts +0 -2
  21. package/components/src/coer-alert/coer-alert.component.html +0 -56
  22. package/components/src/coer-alert/coer-alert.component.scss +0 -100
  23. package/components/src/coer-alert/coer-alert.component.ts +0 -249
  24. package/components/src/components.module.ts +0 -97
  25. package/esm2022/components/src/coer-alert/coer-alert.component.mjs +0 -227
  26. package/esm2022/components/src/components.module.mjs +0 -92
  27. package/esm2022/index.mjs +0 -2
  28. package/esm2022/interfaces/index.mjs +0 -7
  29. package/esm2022/interfaces/src/IAppSource.interface.mjs +0 -2
  30. package/esm2022/interfaces/src/IBreadcrumb.interface.mjs +0 -2
  31. package/esm2022/interfaces/src/ICoerRef.interface.mjs +0 -2
  32. package/esm2022/interfaces/src/IGoBack.interface.mjs +0 -2
  33. package/esm2022/interfaces/src/IPatch.interface.mjs +0 -2
  34. package/esm2022/interfaces/src/IScreenSize.interface.mjs +0 -2
  35. package/esm2022/tools/index.mjs +0 -9
  36. package/esm2022/tools/src/Breadcrumbs.class.mjs +0 -63
  37. package/esm2022/tools/src/ControlValue.mjs +0 -44
  38. package/esm2022/tools/src/DateTime.class.mjs +0 -22
  39. package/esm2022/tools/src/Files.class.mjs +0 -93
  40. package/esm2022/tools/src/Page.class.mjs +0 -162
  41. package/esm2022/tools/src/Screen.class.mjs +0 -43
  42. package/esm2022/tools/src/Source.class.mjs +0 -80
  43. package/esm2022/tools/src/Tools.mjs +0 -200
  44. package/interfaces/index.d.ts +0 -6
  45. package/interfaces/index.ts +0 -6
  46. package/interfaces/src/IAppSource.interface.d.ts +0 -4
  47. package/interfaces/src/IAppSource.interface.ts +0 -4
  48. package/interfaces/src/IBreadcrumb.interface.d.ts +0 -6
  49. package/interfaces/src/IBreadcrumb.interface.ts +0 -6
  50. package/interfaces/src/ICoerRef.interface.d.ts +0 -10
  51. package/interfaces/src/ICoerRef.interface.ts +0 -11
  52. package/interfaces/src/IGoBack.interface.d.ts +0 -6
  53. package/interfaces/src/IGoBack.interface.ts +0 -6
  54. package/interfaces/src/IPatch.interface.d.ts +0 -5
  55. package/interfaces/src/IPatch.interface.ts +0 -5
  56. package/interfaces/src/IScreenSize.interface.d.ts +0 -5
  57. package/interfaces/src/IScreenSize.interface.ts +0 -5
  58. package/styles/index.scss +0 -98
  59. package/tools/index.d.ts +0 -8
  60. package/tools/index.ts +0 -8
  61. package/tools/src/Breadcrumbs.class.d.ts +0 -18
  62. package/tools/src/Breadcrumbs.class.ts +0 -84
  63. package/tools/src/ControlValue.d.ts +0 -23
  64. package/tools/src/ControlValue.ts +0 -63
  65. package/tools/src/DateTime.class.d.ts +0 -11
  66. package/tools/src/DateTime.class.ts +0 -27
  67. package/tools/src/Files.class.d.ts +0 -16
  68. package/tools/src/Files.class.ts +0 -119
  69. package/tools/src/Page.class.d.ts +0 -66
  70. package/tools/src/Page.class.ts +0 -197
  71. package/tools/src/Screen.class.d.ts +0 -11
  72. package/tools/src/Screen.class.ts +0 -50
  73. package/tools/src/Source.class.d.ts +0 -20
  74. package/tools/src/Source.class.ts +0 -107
  75. package/tools/src/Tools.d.ts +0 -33
  76. package/tools/src/Tools.ts +0 -217
  77. /package/components/{src → lib}/coer-alert/coer-alert.component.d.ts +0 -0
  78. /package/components/{src → lib}/components.module.d.ts +0 -0
@@ -1,428 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, forwardRef, Component, NgModule, inject, Inject } from '@angular/core';
3
- import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
4
- import moment from 'moment';
5
- import * as XLSX from 'xlsx';
6
- import { RouterModule, Router, ActivatedRoute } from '@angular/router';
2
+ import { Component, NgModule } from '@angular/core';
7
3
  import { CommonModule } from '@angular/common';
4
+ import { RouterModule } from '@angular/router';
5
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
8
6
  import * as bootstrap from 'bootstrap';
9
7
  import Swal from 'sweetalert2';
10
- import { Observable } from 'rxjs';
11
-
12
- const reference_signal = signal({});
13
- const Tools = {
14
- /** Generate a Guid */
15
- GetGuid: (seed = 'coer-system') => {
16
- let time = new Date().getTime();
17
- seed = seed.toString().trim();
18
- return seed + `-xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g, (c) => {
19
- const random = (time + Math.random() * 16) % 16 | 0;
20
- time = Math.floor(time / 16);
21
- return (c == 'x' ? random : (random & 0x3 | 0x8)).toString(16);
22
- });
23
- },
24
- /** Returns true if the value is null or undefined, false otherwise */
25
- IsNull: (value) => {
26
- if (value === undefined)
27
- return true;
28
- if (value === null)
29
- return true;
30
- return false;
31
- },
32
- /** Returns true if the value is not null or undefined, false otherwise */
33
- IsNotNull: (value) => {
34
- if (value === undefined)
35
- return false;
36
- if (value === null)
37
- return false;
38
- return true;
39
- },
40
- /** Returns true if the value is null or undefined or contains only whitespace, false otherwise */
41
- IsOnlyWhiteSpace: (value) => {
42
- if (value === undefined)
43
- return true;
44
- if (value === null)
45
- return true;
46
- if (value.toString().trim() === '')
47
- return true;
48
- return false;
49
- },
50
- /** Break reference of a object or array */
51
- BreakReference: (object) => {
52
- if (object === undefined)
53
- return undefined;
54
- if (object === null)
55
- return null;
56
- const OBJECT = JSON.parse(JSON.stringify(object));
57
- return (Array.isArray(OBJECT)) ? [...OBJECT] : { ...OBJECT };
58
- },
59
- /** Clean extra whitespaces */
60
- CleanUpBlanks: (text) => {
61
- if (Tools.IsNull(text))
62
- return '';
63
- let worlds = String(text).split(' ');
64
- worlds = worlds.filter(x => x.length > 0);
65
- return worlds.join(' ');
66
- },
67
- /** Get properties of an object */
68
- GetObjectProperties: (obj) => {
69
- const properties = [];
70
- if (Tools.IsNull(obj))
71
- return properties;
72
- for (const property in obj)
73
- properties.push(String(property));
74
- return properties;
75
- },
76
- /**
77
- * Set an index and merge more arrays of the same type
78
- * @returns A new array
79
- * */
80
- SetIndex: (array, ...args) => {
81
- let index = 0;
82
- for (const arg of args) {
83
- array = Tools.BreakReference(array).concat(Tools.BreakReference(arg));
84
- }
85
- return Tools.BreakReference(array).map(item => Object.assign({ index: index++ }, item));
86
- },
87
- /** Set First Char To Lower */
88
- FirstCharToLower: (text) => {
89
- if (Tools.IsNull(text))
90
- return '';
91
- const textArray = [];
92
- for (let i = 0; i < text.length; i++) {
93
- if (i === 0)
94
- textArray.push(text[i].toLowerCase());
95
- else
96
- textArray.push(text[i]);
97
- }
98
- return textArray.join('');
99
- },
100
- /** Set First Char To Upper */
101
- FirstCharToUpper: (text) => {
102
- if (Tools.IsNull(text))
103
- return '';
104
- const textArray = [];
105
- for (let i = 0; i < text.length; i++) {
106
- if (i === 0)
107
- textArray.push(text[i].toUpperCase());
108
- else
109
- textArray.push(text[i]);
110
- }
111
- return textArray.join('');
112
- },
113
- /** Sort an array in ascending order by property */
114
- SortBy: (array, property, propertyType = 'string') => {
115
- switch (propertyType) {
116
- case 'string': {
117
- return array.sort((x, y) => {
118
- if (String(x[property]).toUpperCase().trim() < String(y[property]).toUpperCase().trim())
119
- return -1;
120
- else if (String(x[property]).toUpperCase().trim() > String(y[property]).toUpperCase().trim())
121
- return 1;
122
- else
123
- return 0;
124
- });
125
- }
126
- case 'number': {
127
- return array.sort((x, y) => Number(x[property] - Number(y[property])));
128
- }
129
- }
130
- },
131
- /** Sort an array in descending order by property */
132
- SortByDesc: (array, property, propertyType = 'string') => {
133
- switch (propertyType) {
134
- case 'string': {
135
- return array.sort((x, y) => {
136
- if (String(x[property]).toUpperCase().trim() < String(y[property]).toUpperCase().trim())
137
- return 1;
138
- else if (String(x[property]).toUpperCase().trim() > String(y[property]).toUpperCase().trim())
139
- return -1;
140
- else
141
- return 0;
142
- });
143
- }
144
- case 'number': {
145
- return array.sort((x, y) => Number(Number(y[property])) - x[property]);
146
- }
147
- }
148
- },
149
- /** Return a string with forman numeric */
150
- GetNumericFormat: (value, decimals = 0) => {
151
- if (value == undefined
152
- || value == null
153
- || value.toString().trim() == ''
154
- || isNaN(Number(value))) {
155
- return '0';
156
- }
157
- let valueInteger = '';
158
- let valueDecimal = '';
159
- value = value.toString().replaceAll(' ', '');
160
- if (value.includes('.') || (decimals > 0)) {
161
- valueInteger = value.includes('.') ? value.split('.')[0] : value;
162
- if (decimals > 0) {
163
- const PADDING = decimals - valueDecimal.length;
164
- valueDecimal = value.includes('.') ? value.split('.')[1] : '';
165
- for (let i = 0; i < PADDING; i++)
166
- valueDecimal += '0';
167
- valueDecimal = valueDecimal.substring(0, decimals);
168
- valueDecimal = `.${valueDecimal}`;
169
- }
170
- }
171
- else {
172
- valueInteger = value;
173
- }
174
- let counter = 0;
175
- const VALUE_INTEGER_ARRAY = [];
176
- for (const char of valueInteger.split('').reverse()) {
177
- if (counter == 3) {
178
- VALUE_INTEGER_ARRAY.push(',');
179
- counter = 0;
180
- }
181
- VALUE_INTEGER_ARRAY.push(char);
182
- ++counter;
183
- }
184
- valueInteger = VALUE_INTEGER_ARRAY.reverse().join('');
185
- return `${valueInteger}${valueDecimal}`;
186
- },
187
- /** Wait the time indicated */
188
- Sleep: (milliseconds = 0, reference = null) => {
189
- if (Tools.IsNull(reference)) {
190
- return new Promise(Resolve => setTimeout(Resolve, milliseconds));
191
- }
192
- else
193
- return new Promise(Resolve => {
194
- reference = reference.replaceAll(' ', '_').toLowerCase();
195
- if (reference_signal().hasOwnProperty(reference)) {
196
- clearInterval(reference_signal()[reference]);
197
- }
198
- reference_signal.set(Object.assign(reference_signal(), {
199
- [reference]: setTimeout(() => {
200
- Resolve();
201
- clearInterval(reference_signal()[reference]);
202
- const _reference = { ...reference_signal() };
203
- delete _reference[reference];
204
- reference_signal.set({ ..._reference });
205
- }, milliseconds)
206
- }));
207
- });
208
- }
209
- };
210
-
211
- class Breadcrumbs {
212
- static { this.storage = 'COER-System'; }
213
- /** */
214
- static Add(page, path) {
215
- const breadcrumbs = this.Get();
216
- const paths = breadcrumbs.map(item => item.path);
217
- if (!paths.includes(path)) {
218
- breadcrumbs.push({ page, path });
219
- this.Save(breadcrumbs);
220
- }
221
- }
222
- /** */
223
- static Get() {
224
- let storage = sessionStorage.getItem(this.storage);
225
- if (storage) {
226
- storage = JSON.parse(storage);
227
- if (storage.hasOwnProperty('breadcrumbs')) {
228
- return Tools.BreakReference(storage.breadcrumbs);
229
- }
230
- }
231
- return [];
232
- }
233
- /** Source */
234
- static GetFirst() {
235
- const breadcrumbs = this.Get();
236
- return (breadcrumbs.length > 0) ? breadcrumbs.shift() : null;
237
- }
238
- /** */
239
- static Save(breadcrumbs) {
240
- let storage = sessionStorage.getItem(this.storage);
241
- if (storage)
242
- storage = JSON.parse(storage);
243
- storage = Object.assign({}, storage, { breadcrumbs });
244
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
245
- }
246
- /** */
247
- static Remove(path) {
248
- let breadcrumbs = this.Get();
249
- const index = breadcrumbs.findIndex(x => x.path.toLowerCase().trim() === path.toLowerCase().trim());
250
- if (index >= 0) {
251
- breadcrumbs = Tools.BreakReference(breadcrumbs).splice(0, index + 1);
252
- this.Save(breadcrumbs);
253
- }
254
- }
255
- /** */
256
- static SetLast(page, path) {
257
- const breadcrumbs = this.Get();
258
- if (breadcrumbs.length > 0) {
259
- breadcrumbs[breadcrumbs.length - 1] = { page, path };
260
- this.Save(breadcrumbs);
261
- }
262
- }
263
- /** */
264
- static RemoveLast() {
265
- const breadcrumbs = this.Get();
266
- if (breadcrumbs.length > 0) {
267
- breadcrumbs.pop();
268
- this.Save(breadcrumbs);
269
- }
270
- }
271
- }
272
-
273
- const CONTROL_VALUE = (component) => {
274
- return {
275
- provide: NG_VALUE_ACCESSOR,
276
- useExisting: forwardRef(() => component),
277
- multi: true
278
- };
279
- };
280
- class ControlValue {
281
- constructor() {
282
- this._isTouched = false;
283
- }
284
- get isTouched() {
285
- return this._isTouched;
286
- }
287
- /** */
288
- SetValue(value) {
289
- if (typeof this._UpdateValue === 'function') {
290
- this._UpdateValue(value);
291
- }
292
- this._value = value;
293
- }
294
- /** */
295
- SetTouched(isTouched) {
296
- if (typeof this._IsTouched === 'function') {
297
- this._IsTouched(isTouched);
298
- }
299
- this._isTouched = isTouched;
300
- }
301
- /** */
302
- writeValue(value) {
303
- this._value = value;
304
- }
305
- /** */
306
- registerOnChange(callback) {
307
- this._UpdateValue = callback;
308
- }
309
- /** */
310
- registerOnTouched(callback) {
311
- this._IsTouched = callback;
312
- }
313
- }
314
-
315
- class DateTime {
316
- /** Get UTC Offset */
317
- static GetUTCOffset() {
318
- return moment().utcOffset();
319
- }
320
- /** Convert UTC Date to Local Zone */
321
- static ToLocalZone(utcDate) {
322
- return moment(utcDate).add(DateTime.GetUTCOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
323
- }
324
- /** Convert Local Zone Date to UTC */
325
- static ToUTC(utcDate) {
326
- return moment(utcDate).subtract(DateTime.GetUTCOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
327
- }
328
- /** DD MMM YYYY */
329
- static GetDateFormat(date) {
330
- if ((typeof date === 'string'))
331
- date = date.replaceAll('/', '-');
332
- return moment(date).parseZone().local(true).format('DD MMM YYYY');
333
- }
334
- }
335
-
336
- class Files {
337
- static { this.EXCEL_EXTENSIONS = ['xls', 'xlsx', 'csv']; }
338
- /** Get Extension File */
339
- static GetExtension(file) {
340
- const fileName = file.name;
341
- if (fileName.includes('.')) {
342
- let worlds = fileName.split('.');
343
- if (worlds.length > 0) {
344
- let extension = worlds.pop();
345
- extension = extension.trim().toLowerCase();
346
- if (extension.length > 0)
347
- return extension;
348
- }
349
- }
350
- return null;
351
- }
352
- /** Is Excel File */
353
- static IsExcel(file) {
354
- const EXTENSION = Files.GetExtension(file);
355
- return Tools.IsNotNull(EXTENSION)
356
- ? this.EXCEL_EXTENSIONS.includes(EXTENSION)
357
- : false;
358
- }
359
- /** Read excel file */
360
- static ReadExcel(file) {
361
- return new Promise(Resolve => {
362
- let columns = [];
363
- let rows = [];
364
- const reader = new FileReader();
365
- reader.readAsArrayBuffer(file);
366
- reader.onload = () => {
367
- const dataBytes = new Uint8Array(reader.result);
368
- if (dataBytes) {
369
- const workbook = XLSX.read(dataBytes, {});
370
- const sheet = workbook.Sheets[workbook.SheetNames[0]];
371
- let dataSheet = XLSX.utils.sheet_to_json(sheet, {
372
- header: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
373
- });
374
- //Get Headers
375
- for (const column in dataSheet[0]) {
376
- columns.push(Tools.FirstCharToLower(String(dataSheet[0][column]).replaceAll(' ', '')));
377
- }
378
- //Get Rows
379
- rows = XLSX.utils.sheet_to_json(sheet, { header: columns });
380
- rows.shift();
381
- rows = rows.map(row => {
382
- const item = Tools.BreakReference(row);
383
- delete item['__rowNum__'];
384
- return item;
385
- });
386
- }
387
- Resolve({ columns, rows });
388
- };
389
- reader.onerror = () => { Resolve({ columns, rows }); };
390
- });
391
- }
392
- /** Export to excel file */
393
- static ExportExcel(data, fileName = 'coer_report', sheetName = 'Sheet1') {
394
- sheetName = Tools.CleanUpBlanks(sheetName);
395
- fileName = Tools.CleanUpBlanks(fileName);
396
- if (fileName.endsWith('.xls') || fileName.endsWith('.xlsx') || fileName.endsWith('.csv')) {
397
- if (fileName.includes('.xls')) {
398
- fileName = fileName.replaceAll('.xls', '.xlsx');
399
- }
400
- if (fileName.includes('.csv')) {
401
- fileName = fileName.replaceAll('.csv', '.xlsx');
402
- }
403
- }
404
- else {
405
- fileName += '.xlsx';
406
- }
407
- const WORK_SHEET = XLSX.utils.json_to_sheet(data);
408
- const WORK_BOOK = XLSX.utils.book_new();
409
- XLSX.utils.book_append_sheet(WORK_BOOK, WORK_SHEET, 'Sheet1');
410
- XLSX.writeFile(WORK_BOOK, fileName);
411
- }
412
- /** Convert file to string base64 */
413
- static ConvertToBase64(file) {
414
- return new Promise(Resolve => {
415
- const reader = new FileReader();
416
- reader.readAsDataURL(file);
417
- reader.onload = () => {
418
- Resolve(reader.result?.toString() || '');
419
- };
420
- reader.onerror = () => {
421
- Resolve('');
422
- };
423
- });
424
- }
425
- }
426
8
 
427
9
  class CoerAlert {
428
10
  /** */
@@ -640,11 +222,11 @@ class CoerAlert {
640
222
  return icon;
641
223
  }
642
224
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerAlert, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
643
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CoerAlert, selector: "coer-alert", ngImport: i0, template: "<aside class=\"toast-container coer-alert\">\r\n <!-- Success -->\r\n <div id=\"alert-success\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-success-icon\"></i>\r\n <strong id=\"alert-success-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-success')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-success-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Error -->\r\n <div id=\"alert-error\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-error-icon\"></i>\r\n <strong id=\"alert-error-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-error')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-error-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Info -->\r\n <div id=\"alert-info\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-info-icon\"></i>\r\n <strong id=\"alert-info-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-info')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-info-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Warning -->\r\n <div id=\"alert-warning\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-warning-icon\"></i>\r\n <strong id=\"alert-warning-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-warning')\" class=\"btn-close\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-warning-message\"></pre>\r\n </div>\r\n </div>\r\n</aside>", styles: [".text-blue{color:#0d6efd!important}.text-blue-bold{color:#0d6efd!important;font-weight:700!important}.background-blue{background-color:#0d6efd!important}.background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}.text-gray{color:#6c757d!important}.text-gray-bold{color:#6c757d!important;font-weight:700!important}.background-gray{background-color:#6c757d!important}.background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}.text-green{color:#198754!important}.text-green-bold{color:#198754!important;font-weight:700!important}.background-green{background-color:#198754!important}.background-border-green{background-color:#198754!important;border-color:#198754!important}.text-yellow{color:#ffc107!important}.text-yellow-bold{color:#ffc107!important;font-weight:700!important}.background-yellow{background-color:#ffc107!important}.background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}.text-red{color:#dc3545!important}.text-red-bold{color:#dc3545!important;font-weight:700!important}.background-red{background-color:#dc3545!important}.background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}.text-white{color:#f5f5f5!important}.text-white-bold{color:#f5f5f5!important;font-weight:700!important}.background-white{background-color:#f5f5f5!important}.background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}.text-black{color:#252525!important}.text-black-bold{color:#252525!important;font-weight:700!important}.background-black{background-color:#252525!important}.background-border-black{background-color:#252525!important;border-color:#252525!important}.text-orange{color:#fd6031!important}.text-orange-bold{color:#fd6031!important;font-weight:700!important}.background-orange{background-color:#fd6031!important}.background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}aside.toast-container{position:fixed;bottom:0;right:0;padding:15px!important;z-index:2000!important}aside.toast-container i,aside.toast-container svg{display:flex;align-items:center}aside.toast-container strong{margin:0 auto 0 5px}aside.toast-container div.toast,aside.toast-container div.toast-header{border-top-left-radius:10px;border-top-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast,aside.toast-container div.toast-body{border-bottom-left-radius:10px;border-bottom-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast-body{min-height:36px}aside.toast-container pre{font-family:Roboto,RobotoFallback,Noto Kufi Arabic,Helvetica,Arial,sans-serif;white-space:pre-wrap;font-size:medium}aside.toast-container button{margin:0 2px!important;width:10px!important;height:10px!important;box-shadow:none!important;outline:none!important;border:none!important}aside.toast-container div#alert-success div.toast-header,aside.toast-container div#alert-success div.toast-body{background-color:#198754}aside.toast-container div#alert-info div.toast-header,aside.toast-container div#alert-info div.toast-body{background-color:#0d6efd}aside.toast-container div#alert-error div.toast-header,aside.toast-container div#alert-error div.toast-body{background-color:#dc3545}aside.toast-container div#alert-warning div.toast-header,aside.toast-container div#alert-warning div.toast-body{background-color:#ffc107;border-color:#252525;color:#252525}aside.toast-container div#alert-success:hover,aside.toast-container div#alert-info:hover,aside.toast-container div#alert-error:hover,aside.toast-container div#alert-warning:hover{transform:scale(1.01);box-shadow:2px 2px 10px #789;cursor:default}button.sweet-alert-button{width:100px!important;height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0 5px!important;outline:none!important;border:none!important;box-shadow:none!important}aside.toast-container>*{border:none!important;z-index:2000!important;margin:15px 0 0!important}\n"] }); }
225
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CoerAlert, selector: "coer-alert", ngImport: i0, template: "<aside class=\"toast-container coer-alert\">\r\n <!-- Success -->\r\n <div id=\"alert-success\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-success-icon\"></i>\r\n <strong id=\"alert-success-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-success')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-success-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Error -->\r\n <div id=\"alert-error\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-error-icon\"></i>\r\n <strong id=\"alert-error-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-error')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-error-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Info -->\r\n <div id=\"alert-info\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-info-icon\"></i>\r\n <strong id=\"alert-info-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-info')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-info-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Warning -->\r\n <div id=\"alert-warning\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-warning-icon\"></i>\r\n <strong id=\"alert-warning-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-warning')\" class=\"btn-close\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-warning-message\"></pre>\r\n </div>\r\n </div>\r\n</aside>", styles: [".text-blue{color:#0d6efd!important}.text-blue-bold{color:#0d6efd!important;font-weight:700!important}.background-blue{background-color:#0d6efd!important}.background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}.border-blue{border-color:#0d6efd!important}.text-gray{color:#6c757d!important}.text-gray-bold{color:#6c757d!important;font-weight:700!important}.background-gray{background-color:#6c757d!important}.background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}.border-gray{border-color:#6c757d!important}.text-green{color:#198754!important}.text-green-bold{color:#198754!important;font-weight:700!important}.background-green{background-color:#198754!important}.background-border-green{background-color:#198754!important;border-color:#198754!important}.border-green{border-color:#198754!important}.text-yellow{color:#ffc107!important}.text-yellow-bold{color:#ffc107!important;font-weight:700!important}.background-yellow{background-color:#ffc107!important}.background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}.border-yellow{border-color:#ffc107!important}.text-red{color:#dc3545!important}.text-red-bold{color:#dc3545!important;font-weight:700!important}.background-red{background-color:#dc3545!important}.background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}.border-red{border-color:#dc3545!important}.text-white{color:#f5f5f5!important}.text-white-bold{color:#f5f5f5!important;font-weight:700!important}.background-white{background-color:#f5f5f5!important}.background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}.border-white{border-color:#f5f5f5!important}.text-black{color:#252525!important}.text-black-bold{color:#252525!important;font-weight:700!important}.background-black{background-color:#252525!important}.background-border-black{background-color:#252525!important;border-color:#252525!important}.border-black{border-color:#252525!important}.text-orange{color:#fd6031!important}.text-orange-bold{color:#fd6031!important;font-weight:700!important}.background-orange{background-color:#fd6031!important}.background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}.border-orange{border-color:#fd6031!important}aside.toast-container{position:fixed;bottom:0;right:0;padding:15px!important;z-index:2000!important}aside.toast-container i,aside.toast-container svg{display:flex;align-items:center}aside.toast-container strong{margin:0 auto 0 5px}aside.toast-container div.toast,aside.toast-container div.toast-header{border-top-left-radius:10px;border-top-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast,aside.toast-container div.toast-body{border-bottom-left-radius:10px;border-bottom-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast-body{min-height:36px}aside.toast-container pre{font-family:Roboto,RobotoFallback,Noto Kufi Arabic,Helvetica,Arial,sans-serif;white-space:pre-wrap;font-size:medium}aside.toast-container button{margin:0 2px!important;width:10px!important;height:10px!important;box-shadow:none!important;outline:none!important;border:none!important}aside.toast-container div#alert-success div.toast-header,aside.toast-container div#alert-success div.toast-body{background-color:#198754}aside.toast-container div#alert-info div.toast-header,aside.toast-container div#alert-info div.toast-body{background-color:#0d6efd}aside.toast-container div#alert-error div.toast-header,aside.toast-container div#alert-error div.toast-body{background-color:#dc3545}aside.toast-container div#alert-warning div.toast-header,aside.toast-container div#alert-warning div.toast-body{background-color:#ffc107;border-color:#252525;color:#252525}aside.toast-container div#alert-success:hover,aside.toast-container div#alert-info:hover,aside.toast-container div#alert-error:hover,aside.toast-container div#alert-warning:hover{transform:scale(1.01);box-shadow:2px 2px 10px #789;cursor:default}button.sweet-alert-button{width:100px!important;height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0 5px!important;outline:none!important;border:none!important;box-shadow:none!important}aside.toast-container>*{border:none!important;z-index:2000!important;margin:15px 0 0!important}\n"] }); }
644
226
  }
645
227
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerAlert, decorators: [{
646
228
  type: Component,
647
- args: [{ selector: 'coer-alert', template: "<aside class=\"toast-container coer-alert\">\r\n <!-- Success -->\r\n <div id=\"alert-success\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-success-icon\"></i>\r\n <strong id=\"alert-success-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-success')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-success-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Error -->\r\n <div id=\"alert-error\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-error-icon\"></i>\r\n <strong id=\"alert-error-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-error')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-error-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Info -->\r\n <div id=\"alert-info\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-info-icon\"></i>\r\n <strong id=\"alert-info-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-info')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-info-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Warning -->\r\n <div id=\"alert-warning\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-warning-icon\"></i>\r\n <strong id=\"alert-warning-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-warning')\" class=\"btn-close\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-warning-message\"></pre>\r\n </div>\r\n </div>\r\n</aside>", styles: [".text-blue{color:#0d6efd!important}.text-blue-bold{color:#0d6efd!important;font-weight:700!important}.background-blue{background-color:#0d6efd!important}.background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}.text-gray{color:#6c757d!important}.text-gray-bold{color:#6c757d!important;font-weight:700!important}.background-gray{background-color:#6c757d!important}.background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}.text-green{color:#198754!important}.text-green-bold{color:#198754!important;font-weight:700!important}.background-green{background-color:#198754!important}.background-border-green{background-color:#198754!important;border-color:#198754!important}.text-yellow{color:#ffc107!important}.text-yellow-bold{color:#ffc107!important;font-weight:700!important}.background-yellow{background-color:#ffc107!important}.background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}.text-red{color:#dc3545!important}.text-red-bold{color:#dc3545!important;font-weight:700!important}.background-red{background-color:#dc3545!important}.background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}.text-white{color:#f5f5f5!important}.text-white-bold{color:#f5f5f5!important;font-weight:700!important}.background-white{background-color:#f5f5f5!important}.background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}.text-black{color:#252525!important}.text-black-bold{color:#252525!important;font-weight:700!important}.background-black{background-color:#252525!important}.background-border-black{background-color:#252525!important;border-color:#252525!important}.text-orange{color:#fd6031!important}.text-orange-bold{color:#fd6031!important;font-weight:700!important}.background-orange{background-color:#fd6031!important}.background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}aside.toast-container{position:fixed;bottom:0;right:0;padding:15px!important;z-index:2000!important}aside.toast-container i,aside.toast-container svg{display:flex;align-items:center}aside.toast-container strong{margin:0 auto 0 5px}aside.toast-container div.toast,aside.toast-container div.toast-header{border-top-left-radius:10px;border-top-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast,aside.toast-container div.toast-body{border-bottom-left-radius:10px;border-bottom-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast-body{min-height:36px}aside.toast-container pre{font-family:Roboto,RobotoFallback,Noto Kufi Arabic,Helvetica,Arial,sans-serif;white-space:pre-wrap;font-size:medium}aside.toast-container button{margin:0 2px!important;width:10px!important;height:10px!important;box-shadow:none!important;outline:none!important;border:none!important}aside.toast-container div#alert-success div.toast-header,aside.toast-container div#alert-success div.toast-body{background-color:#198754}aside.toast-container div#alert-info div.toast-header,aside.toast-container div#alert-info div.toast-body{background-color:#0d6efd}aside.toast-container div#alert-error div.toast-header,aside.toast-container div#alert-error div.toast-body{background-color:#dc3545}aside.toast-container div#alert-warning div.toast-header,aside.toast-container div#alert-warning div.toast-body{background-color:#ffc107;border-color:#252525;color:#252525}aside.toast-container div#alert-success:hover,aside.toast-container div#alert-info:hover,aside.toast-container div#alert-error:hover,aside.toast-container div#alert-warning:hover{transform:scale(1.01);box-shadow:2px 2px 10px #789;cursor:default}button.sweet-alert-button{width:100px!important;height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0 5px!important;outline:none!important;border:none!important;box-shadow:none!important}aside.toast-container>*{border:none!important;z-index:2000!important;margin:15px 0 0!important}\n"] }]
229
+ args: [{ selector: 'coer-alert', template: "<aside class=\"toast-container coer-alert\">\r\n <!-- Success -->\r\n <div id=\"alert-success\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-success-icon\"></i>\r\n <strong id=\"alert-success-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-success')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-success-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Error -->\r\n <div id=\"alert-error\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-error-icon\"></i>\r\n <strong id=\"alert-error-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-error')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-error-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Info -->\r\n <div id=\"alert-info\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-info-icon\"></i>\r\n <strong id=\"alert-info-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-info')\" class=\"btn-close btn-close-white\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-info-message\"></pre>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Warning -->\r\n <div id=\"alert-warning\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"toast\">\r\n <div class=\"toast-header\">\r\n <i id=\"alert-warning-icon\"></i>\r\n <strong id=\"alert-warning-title\"></strong>\r\n <button type=\"button\" (click)=\"Close('alert-warning')\" class=\"btn-close\"></button>\r\n </div>\r\n\r\n <div class=\"toast-body\">\r\n <pre id=\"alert-warning-message\"></pre>\r\n </div>\r\n </div>\r\n</aside>", styles: [".text-blue{color:#0d6efd!important}.text-blue-bold{color:#0d6efd!important;font-weight:700!important}.background-blue{background-color:#0d6efd!important}.background-border-blue{background-color:#0d6efd!important;border-color:#0d6efd!important}.border-blue{border-color:#0d6efd!important}.text-gray{color:#6c757d!important}.text-gray-bold{color:#6c757d!important;font-weight:700!important}.background-gray{background-color:#6c757d!important}.background-border-gray{background-color:#6c757d!important;border-color:#6c757d!important}.border-gray{border-color:#6c757d!important}.text-green{color:#198754!important}.text-green-bold{color:#198754!important;font-weight:700!important}.background-green{background-color:#198754!important}.background-border-green{background-color:#198754!important;border-color:#198754!important}.border-green{border-color:#198754!important}.text-yellow{color:#ffc107!important}.text-yellow-bold{color:#ffc107!important;font-weight:700!important}.background-yellow{background-color:#ffc107!important}.background-border-yellow{background-color:#ffc107!important;border-color:#ffc107!important}.border-yellow{border-color:#ffc107!important}.text-red{color:#dc3545!important}.text-red-bold{color:#dc3545!important;font-weight:700!important}.background-red{background-color:#dc3545!important}.background-border-red{background-color:#dc3545!important;border-color:#dc3545!important}.border-red{border-color:#dc3545!important}.text-white{color:#f5f5f5!important}.text-white-bold{color:#f5f5f5!important;font-weight:700!important}.background-white{background-color:#f5f5f5!important}.background-border-white{background-color:#f5f5f5!important;border-color:#f5f5f5!important}.border-white{border-color:#f5f5f5!important}.text-black{color:#252525!important}.text-black-bold{color:#252525!important;font-weight:700!important}.background-black{background-color:#252525!important}.background-border-black{background-color:#252525!important;border-color:#252525!important}.border-black{border-color:#252525!important}.text-orange{color:#fd6031!important}.text-orange-bold{color:#fd6031!important;font-weight:700!important}.background-orange{background-color:#fd6031!important}.background-border-orange{background-color:#fd6031!important;border-color:#fd6031!important}.border-orange{border-color:#fd6031!important}aside.toast-container{position:fixed;bottom:0;right:0;padding:15px!important;z-index:2000!important}aside.toast-container i,aside.toast-container svg{display:flex;align-items:center}aside.toast-container strong{margin:0 auto 0 5px}aside.toast-container div.toast,aside.toast-container div.toast-header{border-top-left-radius:10px;border-top-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast,aside.toast-container div.toast-body{border-bottom-left-radius:10px;border-bottom-right-radius:10px;color:#f5f5f5}aside.toast-container div.toast-body{min-height:36px}aside.toast-container pre{font-family:Roboto,RobotoFallback,Noto Kufi Arabic,Helvetica,Arial,sans-serif;white-space:pre-wrap;font-size:medium}aside.toast-container button{margin:0 2px!important;width:10px!important;height:10px!important;box-shadow:none!important;outline:none!important;border:none!important}aside.toast-container div#alert-success div.toast-header,aside.toast-container div#alert-success div.toast-body{background-color:#198754}aside.toast-container div#alert-info div.toast-header,aside.toast-container div#alert-info div.toast-body{background-color:#0d6efd}aside.toast-container div#alert-error div.toast-header,aside.toast-container div#alert-error div.toast-body{background-color:#dc3545}aside.toast-container div#alert-warning div.toast-header,aside.toast-container div#alert-warning div.toast-body{background-color:#ffc107;border-color:#252525;color:#252525}aside.toast-container div#alert-success:hover,aside.toast-container div#alert-info:hover,aside.toast-container div#alert-error:hover,aside.toast-container div#alert-warning:hover{transform:scale(1.01);box-shadow:2px 2px 10px #789;cursor:default}button.sweet-alert-button{width:100px!important;height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0 5px!important;outline:none!important;border:none!important;box-shadow:none!important}aside.toast-container>*{border:none!important;z-index:2000!important;margin:15px 0 0!important}\n"] }]
648
230
  }] });
649
231
 
650
232
  //import { CoerButton } from './coer-button/coer-button.component';
@@ -723,282 +305,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
723
305
  }]
724
306
  }] });
725
307
 
726
- class Source {
727
- static { this.storage = 'COER-System'; }
728
- /** */
729
- static Set(page) {
730
- const ROUTER = inject(Router);
731
- let path = ROUTER.url;
732
- if (path.includes('?'))
733
- path = path.split('?')[0];
734
- Breadcrumbs.Add(page, path);
735
- const breadcrumbs = Breadcrumbs.Get();
736
- if (breadcrumbs.length >= 2) {
737
- breadcrumbs.pop();
738
- const breadcrumb = breadcrumbs.pop();
739
- this.Save({ page: breadcrumb.page, path: breadcrumb.path });
740
- }
741
- else
742
- this.Save(null);
743
- }
744
- /** */
745
- static Save(source) {
746
- let storage = sessionStorage.getItem(this.storage);
747
- if (storage)
748
- storage = JSON.parse(storage);
749
- storage = Object.assign({}, storage, { source });
750
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
751
- }
752
- /** */
753
- static Get() {
754
- let storage = sessionStorage.getItem(this.storage);
755
- if (storage) {
756
- storage = JSON.parse(storage);
757
- if (storage.hasOwnProperty('source')) {
758
- return storage.source;
759
- }
760
- }
761
- return null;
762
- }
763
- /** */
764
- static GetRoot() {
765
- const breadcrumbs = Breadcrumbs.Get();
766
- return (breadcrumbs.length > 0) ? breadcrumbs.shift() : null;
767
- }
768
- /** */
769
- static SetPageResponse(pageResponse) {
770
- let storage = sessionStorage.getItem(this.storage);
771
- storage = JSON.parse(storage);
772
- storage = Object.assign({}, storage, { pageResponse });
773
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
774
- }
775
- /** */
776
- static GetPageResponse() {
777
- let storage = sessionStorage.getItem(this.storage);
778
- if (storage) {
779
- storage = JSON.parse(storage);
780
- if (storage.hasOwnProperty('pageResponse')) {
781
- return Tools.BreakReference(storage.pageResponse);
782
- }
783
- }
784
- return null;
785
- }
786
- /** */
787
- static ClearPageResponse() {
788
- let storage = sessionStorage.getItem(this.storage);
789
- storage = JSON.parse(storage);
790
- if (storage.hasOwnProperty('pageResponse')) {
791
- delete storage.pageResponse;
792
- }
793
- storage = Object.assign({}, storage);
794
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
795
- }
796
- /** Clear Source */
797
- static Reset() {
798
- sessionStorage.removeItem(this.storage);
799
- }
800
- }
801
-
802
- class Page {
803
- constructor(page) {
804
- //Injection
805
- this.alert = inject(CoerAlert);
806
- this.router = inject(Router);
807
- this.activatedRoute = inject(ActivatedRoute);
808
- /** */
809
- this.isUpdate = false;
810
- /** */
811
- this.isLoading = false;
812
- /** */
813
- this.isReady = false;
814
- /** */
815
- this.enableAnimations = false;
816
- /** */
817
- this.breadcrumbs = [];
818
- /** */
819
- this.pageResponse = null;
820
- /** */
821
- this.goBack = { show: false };
822
- //Private Variables
823
- this._page = '';
824
- this._source = null;
825
- this._preventDestroy = false;
826
- /** */
827
- this.GoBack = (path) => (() => {
828
- if (path)
829
- Breadcrumbs.Remove(path);
830
- else
831
- Breadcrumbs.RemoveLast();
832
- });
833
- /** Returns true if the value is null or undefined, false otherwise */
834
- this.IsNotNull = Tools.IsNotNull;
835
- /** Returns true if the value is null or undefined, false otherwise */
836
- this.IsNull = Tools.IsNull;
837
- /** Returns true if the value is null or undefined or contains only whitespace, false otherwise */
838
- this.IsOnlyWhiteSpace = Tools.IsOnlyWhiteSpace;
839
- this.SetPageName(page);
840
- this.SetSource();
841
- this.GetSource();
842
- this.GetNavigation();
843
- this.SetGoBack();
844
- this.GetPageResponse();
845
- }
846
- ngAfterViewInit() {
847
- this.routeParams = this.activatedRoute.snapshot.params;
848
- this.queryParams = this.activatedRoute.snapshot.queryParams;
849
- setTimeout(() => {
850
- this.isReady = true;
851
- this.RunPage();
852
- setTimeout(() => { this.enableAnimations = true; }, 1000);
853
- });
854
- }
855
- ngOnDestroy() {
856
- if (!this._preventDestroy)
857
- Source.ClearPageResponse();
858
- }
859
- /** Main method. Starts after ngAfterViewInit() */
860
- RunPage() { }
861
- ;
862
- /** Rename the last breadcrumb and update the url id */
863
- SetPageName(name, id = null) {
864
- this._page = name;
865
- let path = this.router.url;
866
- if (path.includes('?'))
867
- path = path.split('?')[0];
868
- if (id) {
869
- const PATH_ARRAY = path.split('/');
870
- const PATH_ID = Tools.BreakReference(PATH_ARRAY).pop();
871
- if (PATH_ID) {
872
- PATH_ARRAY[PATH_ARRAY.length - 1] = String(id);
873
- path = PATH_ARRAY.join('/');
874
- }
875
- }
876
- if (this.breadcrumbs.length > 0) {
877
- this.breadcrumbs[this.breadcrumbs.length - 1].page = name;
878
- this.breadcrumbs[this.breadcrumbs.length - 1].path = path;
879
- Breadcrumbs.SetLast(name, path);
880
- }
881
- this.router.navigateByUrl(path);
882
- }
883
- /** */
884
- SetSource() {
885
- Source.Set(this._page);
886
- }
887
- /** */
888
- GetSource() {
889
- this._source = Source.Get();
890
- }
891
- /** */
892
- GetPageResponse() {
893
- this.pageResponse = Source.GetPageResponse();
894
- }
895
- /** */
896
- GetNavigation() {
897
- if (this._source) {
898
- this.breadcrumbs = Breadcrumbs.Get().map(item => Object.assign({
899
- page: item.page,
900
- path: item.path,
901
- click: this.GoBack(item.path)
902
- }));
903
- }
904
- else
905
- this.breadcrumbs = [{ page: this._page }];
906
- }
907
- /** */
908
- SetGoBack() {
909
- if (this._source) {
910
- this.goBack = {
911
- show: true,
912
- path: this._source.path,
913
- click: this.GoBack()
914
- };
915
- }
916
- }
917
- /** Navigate to previous page */
918
- GoToSource(pageResponse = null) {
919
- if (this._source) {
920
- Breadcrumbs.RemoveLast();
921
- this.SetPageResponse(pageResponse);
922
- Tools.Sleep().then(_ => this.router.navigateByUrl(this._source.path));
923
- }
924
- }
925
- ;
926
- /** */
927
- SetPageResponse(pageResponse = null) {
928
- if (Tools.IsNotNull(pageResponse)) {
929
- this._preventDestroy = true;
930
- Source.SetPageResponse(pageResponse);
931
- }
932
- }
933
- ;
934
- /** */
935
- ReloadPage() {
936
- Breadcrumbs.RemoveLast();
937
- Tools.Sleep().then(_ => window.location.reload());
938
- }
939
- /** */
940
- Log(value, log = null) {
941
- if (Tools.IsNotNull(log))
942
- console.log({ log, value });
943
- else
944
- console.log(value);
945
- }
946
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: Page, deps: [{ token: String }], target: i0.ɵɵFactoryTarget.Component }); }
947
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: Page, selector: "ng-component", ngImport: i0, template: '', isInline: true }); }
948
- }
949
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: Page, decorators: [{
950
- type: Component,
951
- args: [{ template: '' }]
952
- }], ctorParameters: () => [{ type: undefined, decorators: [{
953
- type: Inject,
954
- args: [String]
955
- }] }] });
956
-
957
- class Screen {
958
- static get WINDOW_WIDTH() {
959
- return window.innerWidth;
960
- }
961
- static get WINDOW_HEIGHT() {
962
- return window.innerHeight;
963
- }
964
- static get DEVICE_WIDTH() {
965
- return window.screen.width;
966
- }
967
- static get DEVICE_HEIGHT() {
968
- return window.screen.height;
969
- }
970
- static get BREAKPOINT() {
971
- if (window.innerWidth < 576)
972
- return 'xs';
973
- else if (window.innerWidth >= 576 && window.innerWidth < 768)
974
- return 'sm';
975
- else if (window.innerWidth >= 768 && window.innerWidth < 992)
976
- return 'md';
977
- else if (window.innerWidth >= 992 && window.innerWidth < 1200)
978
- return 'lg';
979
- else if (window.innerWidth >= 1200 && window.innerWidth < 1400)
980
- return 'xl';
981
- else
982
- return 'xxl';
983
- }
984
- /** */
985
- static { this.Resize = new Observable(subscriber => {
986
- window.addEventListener("load", () => {
987
- window.dispatchEvent(new Event('resize'));
988
- });
989
- window.onresize = () => {
990
- subscriber.next({
991
- width: window.innerWidth,
992
- height: window.innerHeight,
993
- breakpoin: this.BREAKPOINT
994
- });
995
- };
996
- }); }
997
- }
998
-
999
308
  /**
1000
309
  * Generated bundle index. Do not edit.
1001
310
  */
1002
311
 
1003
- export { Breadcrumbs, CONTROL_VALUE, ControlValue, DateTime, Files, Page, Screen, Source, Tools };
312
+ export { CoerAlert, ComponentsModule };
1004
313
  //# sourceMappingURL=coer-elements.mjs.map