@unipin/angular-applet 21.1.2 → 21.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/common/assets/styles/theme.css +8 -0
  3. package/fesm2022/unipin-angular-applet-accordion.mjs +23 -23
  4. package/fesm2022/unipin-angular-applet-accordion.mjs.map +1 -1
  5. package/fesm2022/unipin-angular-applet-alert-dialog.mjs +31 -11
  6. package/fesm2022/unipin-angular-applet-alert-dialog.mjs.map +1 -1
  7. package/fesm2022/unipin-angular-applet-alert.mjs +13 -13
  8. package/fesm2022/unipin-angular-applet-alert.mjs.map +1 -1
  9. package/fesm2022/unipin-angular-applet-approval.mjs +10 -10
  10. package/fesm2022/unipin-angular-applet-approval.mjs.map +1 -1
  11. package/fesm2022/unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs +280 -0
  12. package/fesm2022/unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs.map +1 -0
  13. package/fesm2022/unipin-angular-applet-audit.mjs +220 -0
  14. package/fesm2022/unipin-angular-applet-audit.mjs.map +1 -0
  15. package/fesm2022/unipin-angular-applet-auth.mjs +23 -23
  16. package/fesm2022/unipin-angular-applet-auth.mjs.map +1 -1
  17. package/fesm2022/unipin-angular-applet-avatar.mjs +26 -9
  18. package/fesm2022/unipin-angular-applet-avatar.mjs.map +1 -1
  19. package/fesm2022/unipin-angular-applet-badge.mjs +5 -5
  20. package/fesm2022/unipin-angular-applet-badge.mjs.map +1 -1
  21. package/fesm2022/unipin-angular-applet-buttons.mjs +10 -10
  22. package/fesm2022/unipin-angular-applet-buttons.mjs.map +1 -1
  23. package/fesm2022/unipin-angular-applet-calendar.mjs +37 -23
  24. package/fesm2022/unipin-angular-applet-calendar.mjs.map +1 -1
  25. package/fesm2022/unipin-angular-applet-collapsible.mjs +14 -14
  26. package/fesm2022/unipin-angular-applet-collapsible.mjs.map +1 -1
  27. package/fesm2022/unipin-angular-applet-common.mjs +25 -25
  28. package/fesm2022/unipin-angular-applet-common.mjs.map +1 -1
  29. package/fesm2022/unipin-angular-applet-containers.mjs +20 -20
  30. package/fesm2022/unipin-angular-applet-containers.mjs.map +1 -1
  31. package/fesm2022/unipin-angular-applet-dialog.mjs +62 -58
  32. package/fesm2022/unipin-angular-applet-dialog.mjs.map +1 -1
  33. package/fesm2022/unipin-angular-applet-forms.mjs +1113 -294
  34. package/fesm2022/unipin-angular-applet-forms.mjs.map +1 -1
  35. package/fesm2022/unipin-angular-applet-froala.mjs +9 -9
  36. package/fesm2022/unipin-angular-applet-froala.mjs.map +1 -1
  37. package/fesm2022/unipin-angular-applet-grids.mjs +17 -1
  38. package/fesm2022/unipin-angular-applet-grids.mjs.map +1 -1
  39. package/fesm2022/unipin-angular-applet-infinite-scroll.mjs +5 -5
  40. package/fesm2022/unipin-angular-applet-infinite-scroll.mjs.map +1 -1
  41. package/fesm2022/unipin-angular-applet-json-viewer.mjs +7 -7
  42. package/fesm2022/unipin-angular-applet-json-viewer.mjs.map +1 -1
  43. package/fesm2022/unipin-angular-applet-kbd.mjs +4 -4
  44. package/fesm2022/unipin-angular-applet-kbd.mjs.map +1 -1
  45. package/fesm2022/unipin-angular-applet-loading-dialog.mjs +8 -8
  46. package/fesm2022/unipin-angular-applet-loading-dialog.mjs.map +1 -1
  47. package/fesm2022/unipin-angular-applet-markdown.mjs +18 -18
  48. package/fesm2022/unipin-angular-applet-markdown.mjs.map +1 -1
  49. package/fesm2022/unipin-angular-applet-popover.mjs +21 -21
  50. package/fesm2022/unipin-angular-applet-popover.mjs.map +1 -1
  51. package/fesm2022/unipin-angular-applet-progress-bar.mjs +7 -7
  52. package/fesm2022/unipin-angular-applet-progress-bar.mjs.map +1 -1
  53. package/fesm2022/unipin-angular-applet-skeleton.mjs +4 -4
  54. package/fesm2022/unipin-angular-applet-skeleton.mjs.map +1 -1
  55. package/fesm2022/unipin-angular-applet-spinner.mjs +5 -5
  56. package/fesm2022/unipin-angular-applet-spinner.mjs.map +1 -1
  57. package/fesm2022/unipin-angular-applet-stepper.mjs +288 -0
  58. package/fesm2022/unipin-angular-applet-stepper.mjs.map +1 -0
  59. package/fesm2022/unipin-angular-applet-swipeable.mjs +24 -24
  60. package/fesm2022/unipin-angular-applet-swipeable.mjs.map +1 -1
  61. package/fesm2022/unipin-angular-applet-tabs.mjs +19 -19
  62. package/fesm2022/unipin-angular-applet-tabs.mjs.map +1 -1
  63. package/fesm2022/unipin-angular-applet-tooltip.mjs +5 -5
  64. package/fesm2022/unipin-angular-applet-tooltip.mjs.map +1 -1
  65. package/package.json +9 -1
  66. package/types/unipin-angular-applet-alert-dialog.d.ts +12 -1
  67. package/types/unipin-angular-applet-audit.d.ts +49 -0
  68. package/types/unipin-angular-applet-avatar.d.ts +3 -2
  69. package/types/unipin-angular-applet-containers.d.ts +1 -1
  70. package/types/unipin-angular-applet-dialog.d.ts +11 -8
  71. package/types/unipin-angular-applet-forms.d.ts +168 -45
  72. package/types/unipin-angular-applet-grids.d.ts +17 -1
  73. package/types/unipin-angular-applet-popover.d.ts +2 -2
  74. package/types/unipin-angular-applet-stepper.d.ts +43 -0
@@ -0,0 +1,220 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, input, signal, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { of } from 'rxjs';
4
+ import { map, catchError } from 'rxjs/operators';
5
+ import * as i1 from '@unipin/angular-gql';
6
+ import { DatePipe } from '@angular/common';
7
+ import { NgIcon, provideIcons } from '@ng-icons/core';
8
+ import { matKeyboardArrowDownRound, matHourglassEmptyRound, matAddCircleRound, matErrorRound, matEditRound } from '@ng-icons/material-icons/round';
9
+ import { UpSpinnerComponent } from '@unipin/angular-applet/spinner';
10
+ import { UpInfiniteScrollDirective } from '@unipin/angular-applet/infinite-scroll';
11
+
12
+ class AuditService {
13
+ constructor(gql) {
14
+ this.gql = gql;
15
+ }
16
+ query(input) {
17
+ return this.gql.query({
18
+ operationName: 'QueryAuditTrail',
19
+ variables: {
20
+ input
21
+ },
22
+ query: `
23
+ query QueryAuditTrail($input: AuditTrailCriteria) {
24
+ auditMsAuditTrail(input: $input) {
25
+ action
26
+ createdAt
27
+ description
28
+ function
29
+ guid
30
+ msSource
31
+ sourceIp
32
+ data
33
+ user {
34
+ name
35
+ sourcePlatform
36
+ status
37
+ appLoginPrincipal {
38
+ principalId
39
+ principalType
40
+ }
41
+ }
42
+ }
43
+ }
44
+ `,
45
+ }).pipe(map((res) => {
46
+ return {
47
+ data: res.data ?? null,
48
+ errors: res.errors ?? []
49
+ };
50
+ }), catchError((err) => {
51
+ return of({
52
+ data: null,
53
+ errors: Array.isArray(err) ? err : [err]
54
+ });
55
+ }));
56
+ }
57
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: AuditService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
58
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: AuditService, providedIn: 'root' }); }
59
+ }
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: AuditService, decorators: [{
61
+ type: Injectable,
62
+ args: [{
63
+ providedIn: 'root'
64
+ }]
65
+ }], ctorParameters: () => [{ type: i1.GqlParser }] });
66
+
67
+ class UpAuditListComponent {
68
+ constructor(service) {
69
+ this.service = service;
70
+ this.tagValues = input(...(ngDevMode ? [undefined, { debugName: "tagValues" }] : []));
71
+ this.relatedEntities = input(...(ngDevMode ? [undefined, { debugName: "relatedEntities" }] : []));
72
+ this.hasMore = signal(true, ...(ngDevMode ? [{ debugName: "hasMore" }] : []));
73
+ this.isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
74
+ this.auditTrails = signal([], ...(ngDevMode ? [{ debugName: "auditTrails" }] : []));
75
+ this.selectedTrail = signal(null, ...(ngDevMode ? [{ debugName: "selectedTrail" }] : []));
76
+ this.criteria = {
77
+ page: 0,
78
+ pageSize: 20,
79
+ sortBy: 'createdAt',
80
+ sortDirection: 'desc'
81
+ };
82
+ effect(() => {
83
+ this.criteria.page = 0;
84
+ this.criteria.tagValues = undefined;
85
+ this.criteria.relatedEntities = undefined;
86
+ if (this.tagValues()) {
87
+ this.criteria.tagValues = this.tagValues();
88
+ }
89
+ if (this.relatedEntities()) {
90
+ this.criteria.relatedEntities = this.relatedEntities();
91
+ }
92
+ untracked(() => {
93
+ this.hasMore.set(true);
94
+ this.auditTrails.set([]);
95
+ this.isLoading.set(false);
96
+ this.sub?.unsubscribe();
97
+ this.loadData();
98
+ });
99
+ });
100
+ }
101
+ ngOnDestroy() {
102
+ this.sub?.unsubscribe();
103
+ }
104
+ loadData() {
105
+ if (this.isLoading() ||
106
+ !this.hasMore()) {
107
+ return;
108
+ }
109
+ this.isLoading.set(true);
110
+ this.sub = this.service.query(this.criteria).subscribe({
111
+ error: () => {
112
+ this.isLoading.set(false);
113
+ },
114
+ next: ({ data: { auditMsAuditTrail: data } }) => {
115
+ const formattedData = data.reduce((acc, curr) => {
116
+ if (!curr) {
117
+ return acc;
118
+ }
119
+ acc.push({
120
+ ...curr,
121
+ icon: this.getAuditIcon(curr),
122
+ changedData: this.getChangedData(curr.data),
123
+ });
124
+ return acc;
125
+ }, []);
126
+ this.hasMore.set(formattedData.length >= this.criteria.pageSize);
127
+ this.auditTrails.update((curr) => {
128
+ return [
129
+ ...curr,
130
+ ...formattedData
131
+ ];
132
+ });
133
+ this.criteria.page++;
134
+ this.isLoading.set(false);
135
+ }
136
+ });
137
+ }
138
+ getAuditIcon(audit) {
139
+ const actionLower = audit.action?.toLowerCase() || '';
140
+ const descLower = audit.description?.toLowerCase() || '';
141
+ if (actionLower.includes('waiting') ||
142
+ descLower.includes('waiting')) {
143
+ return 'matHourglassEmptyRound';
144
+ }
145
+ if (actionLower.includes('creation') ||
146
+ descLower.includes('creation')) {
147
+ return 'matAddCircleRound';
148
+ }
149
+ if (actionLower.includes('update') ||
150
+ descLower.includes('update')) {
151
+ return 'matEditRound';
152
+ }
153
+ return 'matErrorRound';
154
+ }
155
+ getChangedData(data) {
156
+ if (!data ||
157
+ !data.oldData ||
158
+ !data.newData) {
159
+ return [];
160
+ }
161
+ try {
162
+ const oldData = JSON.parse(data.oldData);
163
+ const newData = JSON.parse(data.newData);
164
+ return Object.keys(newData).filter((key) => {
165
+ return JSON.stringify(oldData[key]) !== JSON.stringify(newData[key]) && !key.match(/update|created/);
166
+ }).map((key) => {
167
+ return {
168
+ field: key,
169
+ oldValue: this.formatValue(oldData[key]),
170
+ newValue: this.formatValue(newData[key])
171
+ };
172
+ });
173
+ }
174
+ catch (error) {
175
+ return [];
176
+ }
177
+ }
178
+ formatValue(value) {
179
+ if (value === null || value === undefined)
180
+ return '-';
181
+ if (typeof value === 'object')
182
+ return JSON.stringify(value);
183
+ return String(value);
184
+ }
185
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpAuditListComponent, deps: [{ token: AuditService }], target: i0.ɵɵFactoryTarget.Component }); }
186
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: UpAuditListComponent, isStandalone: true, selector: "up-audit-list", inputs: { tagValues: { classPropertyName: "tagValues", publicName: "tagValues", isSignal: true, isRequired: false, transformFunction: null }, relatedEntities: { classPropertyName: "relatedEntities", publicName: "relatedEntities", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
187
+ provideIcons({
188
+ matEditRound,
189
+ matErrorRound,
190
+ matAddCircleRound,
191
+ matHourglassEmptyRound,
192
+ matKeyboardArrowDownRound,
193
+ })
194
+ ], ngImport: i0, template: "<div class=\"w-full pb-5 pl-5 border-l-2 border-border\">\n @for (audit of auditTrails(); track audit.guid) {\n <div class=\"relative flex items-start first:pt-2.5 not-first:pt-4 not-last:pb-4 not-last:border-b not-last:border-border\">\n <div class=\"absolute border border-border rounded-full p-2 flex items-center bg-[#f5f7f6] -left-9.25\">\n <ng-icon\n size=\"14\"\n [name]=\"audit.icon\"\n />\n </div>\n\n <div class=\"px-2 pt-1.25 w-full\">\n <div class=\"flex items-center justify-between gap-3 select-none\">\n <div class=\"text-sm grow\">\n <b>{{ audit.user?.name }}</b> <span class=\"lowercase\">&nbsp;{{ audit.action }} <i class=\"text-muted-foreground\">\u2022</i></span>\n <span class=\"text-muted-foreground text-xs\">&nbsp;{{ audit.createdAt | date: 'dd LLL yyyy HH:mm' }}</span>\n </div>\n\n <button\n type=\"button\"\n class=\"text-sm text-primary font-medium hover:underline shrink-0 cursor-pointer\"\n (click)=\"selectedTrail.set(audit)\"\n >\n Detail\n </button>\n </div>\n\n @if (\n audit.changedData && \n audit.changedData.length > 0\n ) {\n <table class=\"w-full my-2 table-fixed border-collapse rounded-md select-none\">\n <thead class=\"border-inherit border-solid border-0\">\n <tr>\n <th class=\"w-[30%] p-2 text-left border border-border bg-[#f2f2f2] text-base border-tl-2\">Field</th>\n <th class=\"w-[35%] p-2 text-left border border-border bg-[#f2f2f2] text-base\">Old Value</th>\n <th class=\"w-[35%] p-2 text-left border border-border bg-[#f2f2f2] text-base border-tr-2\">New Value</th>\n </tr>\n </thead>\n\n <tbody class=\"border-inherit border-solid border-0\">\n @for (data of audit.changedData; track data.field; let even = $even) {\n <tr \n [class]=\"even? 'bg-white': 'bg-[#f9f9f9]'\"\n >\n <td class=\"p-2 text-left border border-border capitalize\">\n {{ data.field }}\n </td>\n\n <td class=\"p-2 text-left border border-border capitalize\">\n <div class=\"line-clamp-5 wrap-break-word\">{{ data.oldValue }}</div>\n </td>\n\n <td class=\"p-2 text-left border border-border capitalize\">\n <div class=\"line-clamp-5 wrap-break-word\">{{ data.newValue }}</div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n </div>\n }\n</div>\n\n\n@if (hasMore()) {\n <div \n upInfiniteScroll\n class=\"flex justify-center py-4\"\n (scrolled)=\"loadData()\"\n >\n <up-spinner />\n </div>\n}\n\n@defer (when selectedTrail()) {\n <up-audit-modal\n [audit]=\"selectedTrail()\"\n (dismissed)=\"selectedTrail.set(null)\"\n />\n}\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "component", type: UpSpinnerComponent, selector: "up-spinner", inputs: ["stokeWidth", "inlineClass"] }, { kind: "directive", type: UpInfiniteScrollDirective, selector: "[upInfiniteScroll]", inputs: ["threshold", "rootMargin"], outputs: ["scrolled"], exportAs: ["upInfiniteScroll"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [import('./unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs').then(m => m.UpAuditModalComponent)]] }); }
195
+ }
196
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.1.5", ngImport: i0, type: UpAuditListComponent, resolveDeferredDeps: () => [import('./unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs').then(m => m.UpAuditModalComponent)], resolveMetadata: UpAuditModalComponent => ({ decorators: [{
197
+ type: Component,
198
+ args: [{ standalone: true, selector: 'up-audit-list', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
199
+ NgIcon,
200
+ DatePipe,
201
+ UpSpinnerComponent,
202
+ UpInfiniteScrollDirective,
203
+ UpAuditModalComponent
204
+ ], providers: [
205
+ provideIcons({
206
+ matEditRound,
207
+ matErrorRound,
208
+ matAddCircleRound,
209
+ matHourglassEmptyRound,
210
+ matKeyboardArrowDownRound,
211
+ })
212
+ ], template: "<div class=\"w-full pb-5 pl-5 border-l-2 border-border\">\n @for (audit of auditTrails(); track audit.guid) {\n <div class=\"relative flex items-start first:pt-2.5 not-first:pt-4 not-last:pb-4 not-last:border-b not-last:border-border\">\n <div class=\"absolute border border-border rounded-full p-2 flex items-center bg-[#f5f7f6] -left-9.25\">\n <ng-icon\n size=\"14\"\n [name]=\"audit.icon\"\n />\n </div>\n\n <div class=\"px-2 pt-1.25 w-full\">\n <div class=\"flex items-center justify-between gap-3 select-none\">\n <div class=\"text-sm grow\">\n <b>{{ audit.user?.name }}</b> <span class=\"lowercase\">&nbsp;{{ audit.action }} <i class=\"text-muted-foreground\">\u2022</i></span>\n <span class=\"text-muted-foreground text-xs\">&nbsp;{{ audit.createdAt | date: 'dd LLL yyyy HH:mm' }}</span>\n </div>\n\n <button\n type=\"button\"\n class=\"text-sm text-primary font-medium hover:underline shrink-0 cursor-pointer\"\n (click)=\"selectedTrail.set(audit)\"\n >\n Detail\n </button>\n </div>\n\n @if (\n audit.changedData && \n audit.changedData.length > 0\n ) {\n <table class=\"w-full my-2 table-fixed border-collapse rounded-md select-none\">\n <thead class=\"border-inherit border-solid border-0\">\n <tr>\n <th class=\"w-[30%] p-2 text-left border border-border bg-[#f2f2f2] text-base border-tl-2\">Field</th>\n <th class=\"w-[35%] p-2 text-left border border-border bg-[#f2f2f2] text-base\">Old Value</th>\n <th class=\"w-[35%] p-2 text-left border border-border bg-[#f2f2f2] text-base border-tr-2\">New Value</th>\n </tr>\n </thead>\n\n <tbody class=\"border-inherit border-solid border-0\">\n @for (data of audit.changedData; track data.field; let even = $even) {\n <tr \n [class]=\"even? 'bg-white': 'bg-[#f9f9f9]'\"\n >\n <td class=\"p-2 text-left border border-border capitalize\">\n {{ data.field }}\n </td>\n\n <td class=\"p-2 text-left border border-border capitalize\">\n <div class=\"line-clamp-5 wrap-break-word\">{{ data.oldValue }}</div>\n </td>\n\n <td class=\"p-2 text-left border border-border capitalize\">\n <div class=\"line-clamp-5 wrap-break-word\">{{ data.newValue }}</div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n </div>\n }\n</div>\n\n\n@if (hasMore()) {\n <div \n upInfiniteScroll\n class=\"flex justify-center py-4\"\n (scrolled)=\"loadData()\"\n >\n <up-spinner />\n </div>\n}\n\n@defer (when selectedTrail()) {\n <up-audit-modal\n [audit]=\"selectedTrail()\"\n (dismissed)=\"selectedTrail.set(null)\"\n />\n}\n" }]
213
+ }], ctorParameters: () => [{ type: AuditService }], propDecorators: { tagValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagValues", required: false }] }], relatedEntities: [{ type: i0.Input, args: [{ isSignal: true, alias: "relatedEntities", required: false }] }] } }) });
214
+
215
+ /**
216
+ * Generated bundle index. Do not edit.
217
+ */
218
+
219
+ export { AuditService, UpAuditListComponent };
220
+ //# sourceMappingURL=unipin-angular-applet-audit.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unipin-angular-applet-audit.mjs","sources":["../../../projects/unipin-angular/audit/services/audit.service.ts","../../../projects/unipin-angular/audit/components/list/audit-list.component.ts","../../../projects/unipin-angular/audit/components/list/audit-list.component.html","../../../projects/unipin-angular/audit/unipin-angular-applet-audit.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { catchError, map } from 'rxjs/operators';\nimport { GqlParser, QueryResult } from '@unipin/angular-gql';\nimport { AuditTrail, AuditTrailCriteria } from '@unipin/graphql-schema';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuditService {\n\n constructor(\n protected readonly gql: GqlParser\n ) { }\n\n public query(input: AuditTrailCriteria): Observable<QueryResult<{ auditMsAuditTrail: AuditTrail[] }>>{\n return this.gql.query<{ auditMsAuditTrail: AuditTrail[] }>({\n operationName: 'QueryAuditTrail',\n variables: {\n input\n },\n query: `\n query QueryAuditTrail($input: AuditTrailCriteria) {\n auditMsAuditTrail(input: $input) {\n action\n createdAt\n description\n function\n guid\n msSource\n sourceIp\n data\n user {\n name\n sourcePlatform\n status\n appLoginPrincipal {\n principalId\n principalType\n }\n }\n }\n }\n `,\n }).pipe(\n map(\n (res) => {\n return {\n data: res.data?? null,\n errors: res.errors?? []\n };\n }\n ),\n catchError(\n (err) => {\n return of(\n {\n data: null as any,\n errors: Array.isArray(err)? err : [err]\n }\n );\n }\n )\n );\n }\n}\n","import { Component, ChangeDetectionStrategy, signal, OnDestroy, input, effect, untracked } from '@angular/core';\nimport { DatePipe } from '@angular/common';\nimport { Subscription } from 'rxjs';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { matAddCircleRound, matKeyboardArrowDownRound, matEditRound, matHourglassEmptyRound, matErrorRound } from '@ng-icons/material-icons/round';\nimport { AuditTrail, AuditTrailCriteria } from '@unipin/graphql-schema';\nimport { UpSpinnerComponent } from '@unipin/angular-applet/spinner';\nimport { UpInfiniteScrollDirective } from '@unipin/angular-applet/infinite-scroll';\nimport { AuditService } from './../../services/audit.service';\nimport { UpAuditModalComponent } from '../modal/audit-modal.component';\n\n\ntype AuditTrailData = AuditTrail & {\n icon: string;\n changedData?: Array<{ field: string; oldValue: any; newValue: any }>;\n}\n\n\n@Component({\n standalone: true,\n selector: 'up-audit-list',\n templateUrl: './audit-list.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgIcon,\n DatePipe,\n UpSpinnerComponent,\n UpInfiniteScrollDirective,\n UpAuditModalComponent\n ],\n providers: [\n provideIcons(\n { \n matEditRound,\n matErrorRound,\n matAddCircleRound,\n matHourglassEmptyRound,\n matKeyboardArrowDownRound,\n }\n ) \n ]\n})\nexport class UpAuditListComponent implements OnDestroy {\n\n public readonly tagValues = input<string[] | undefined>();\n public readonly relatedEntities = input<string[] | undefined>();\n\n public readonly hasMore = signal<boolean>(true);\n public readonly isLoading = signal<boolean>(false);\n public readonly auditTrails = signal<AuditTrailData[]>([]);\n public readonly selectedTrail = signal<AuditTrailData | null>(null);\n\n protected sub?: Subscription;\n protected readonly criteria: AuditTrailCriteria = { \n page: 0, \n pageSize: 20,\n sortBy: 'createdAt', \n sortDirection: 'desc'\n };\n\n constructor(\n protected readonly service: AuditService\n ) {\n effect(\n () => {\n this.criteria.page = 0;\n this.criteria.tagValues = undefined;\n this.criteria.relatedEntities = undefined;\n \n if (this.tagValues()) {\n this.criteria.tagValues = this.tagValues();\n }\n \n if (this.relatedEntities()) {\n this.criteria.relatedEntities = this.relatedEntities();\n }\n\n untracked(\n () => {\n this.hasMore.set(true);\n this.auditTrails.set([]);\n this.isLoading.set(false);\n\n this.sub?.unsubscribe();\n this.loadData();\n }\n );\n }\n );\n }\n\n public ngOnDestroy(): void{\n this.sub?.unsubscribe();\n }\n\n public loadData(): void{\n if (\n this.isLoading() || \n !this.hasMore()\n ) {\n return;\n }\n this.isLoading.set(true);\n\n this.sub = this.service.query(this.criteria).subscribe(\n {\n error: () => {\n this.isLoading.set(false);\n },\n next: ({ data: { auditMsAuditTrail: data }}) => {\n const formattedData = data.reduce(\n (acc, curr) => {\n if (!curr) {\n return acc;\n }\n\n acc.push(\n {\n ...curr,\n icon: this.getAuditIcon(curr),\n changedData: this.getChangedData(curr.data),\n }\n );\n return acc;\n },\n [] as AuditTrailData[]\n );\n this.hasMore.set(formattedData.length >= this.criteria.pageSize!);\n\n this.auditTrails.update(\n (curr) => {\n return [\n ...curr,\n ...formattedData\n ]\n }\n );\n \n this.criteria.page!++;\n this.isLoading.set(false);\n }\n }\n );\n }\n\n protected getAuditIcon(audit: AuditTrail): string{\n const actionLower = audit.action?.toLowerCase() || '';\n const descLower = audit.description?.toLowerCase() || '';\n \n if (\n actionLower.includes('waiting') || \n descLower.includes('waiting')\n ) {\n return 'matHourglassEmptyRound';\n }\n \n if (\n actionLower.includes('creation') || \n descLower.includes('creation')\n ) {\n return 'matAddCircleRound';\n }\n \n if (\n actionLower.includes('update') || \n descLower.includes('update')\n ) {\n return 'matEditRound';\n }\n return 'matErrorRound';\n }\n\n protected getChangedData(data: any): Array<{ field: string; oldValue: any; newValue: any }>{\n if (\n !data || \n !data.oldData || \n !data.newData\n ) {\n return [];\n }\n\n try {\n const oldData = JSON.parse(data.oldData);\n const newData = JSON.parse(data.newData);\n\n return Object.keys(newData).filter(\n (key) => {\n return JSON.stringify(oldData[key]) !== JSON.stringify(newData[key]) && !key.match(/update|created/);\n }\n ).map(\n (key) => {\n return {\n field: key,\n oldValue: this.formatValue(oldData[key]),\n newValue: this.formatValue(newData[key])\n };\n }\n );\n } \n catch (error) {\n return [];\n }\n }\n\n protected formatValue(value: any): string{\n if (value === null || value === undefined) return '-';\n if (typeof value === 'object') return JSON.stringify(value);\n return String(value);\n }\n}\n","<div class=\"w-full pb-5 pl-5 border-l-2 border-border\">\n @for (audit of auditTrails(); track audit.guid) {\n <div class=\"relative flex items-start first:pt-2.5 not-first:pt-4 not-last:pb-4 not-last:border-b not-last:border-border\">\n <div class=\"absolute border border-border rounded-full p-2 flex items-center bg-[#f5f7f6] -left-9.25\">\n <ng-icon\n size=\"14\"\n [name]=\"audit.icon\"\n />\n </div>\n\n <div class=\"px-2 pt-1.25 w-full\">\n <div class=\"flex items-center justify-between gap-3 select-none\">\n <div class=\"text-sm grow\">\n <b>{{ audit.user?.name }}</b> <span class=\"lowercase\">&nbsp;{{ audit.action }} <i class=\"text-muted-foreground\">•</i></span>\n <span class=\"text-muted-foreground text-xs\">&nbsp;{{ audit.createdAt | date: 'dd LLL yyyy HH:mm' }}</span>\n </div>\n\n <button\n type=\"button\"\n class=\"text-sm text-primary font-medium hover:underline shrink-0 cursor-pointer\"\n (click)=\"selectedTrail.set(audit)\"\n >\n Detail\n </button>\n </div>\n\n @if (\n audit.changedData && \n audit.changedData.length > 0\n ) {\n <table class=\"w-full my-2 table-fixed border-collapse rounded-md select-none\">\n <thead class=\"border-inherit border-solid border-0\">\n <tr>\n <th class=\"w-[30%] p-2 text-left border border-border bg-[#f2f2f2] text-base border-tl-2\">Field</th>\n <th class=\"w-[35%] p-2 text-left border border-border bg-[#f2f2f2] text-base\">Old Value</th>\n <th class=\"w-[35%] p-2 text-left border border-border bg-[#f2f2f2] text-base border-tr-2\">New Value</th>\n </tr>\n </thead>\n\n <tbody class=\"border-inherit border-solid border-0\">\n @for (data of audit.changedData; track data.field; let even = $even) {\n <tr \n [class]=\"even? 'bg-white': 'bg-[#f9f9f9]'\"\n >\n <td class=\"p-2 text-left border border-border capitalize\">\n {{ data.field }}\n </td>\n\n <td class=\"p-2 text-left border border-border capitalize\">\n <div class=\"line-clamp-5 wrap-break-word\">{{ data.oldValue }}</div>\n </td>\n\n <td class=\"p-2 text-left border border-border capitalize\">\n <div class=\"line-clamp-5 wrap-break-word\">{{ data.newValue }}</div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n </div>\n }\n</div>\n\n\n@if (hasMore()) {\n <div \n upInfiniteScroll\n class=\"flex justify-center py-4\"\n (scrolled)=\"loadData()\"\n >\n <up-spinner />\n </div>\n}\n\n@defer (when selectedTrail()) {\n <up-audit-modal\n [audit]=\"selectedTrail()\"\n (dismissed)=\"selectedTrail.set(null)\"\n />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.AuditService"],"mappings":";;;;;;;;;;;MAUa,YAAY,CAAA;AAEvB,IAAA,WAAA,CACqB,GAAc,EAAA;QAAd,IAAA,CAAA,GAAG,GAAH,GAAG;IACpB;AAEG,IAAA,KAAK,CAAC,KAAyB,EAAA;AACpC,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAsC;AACzD,YAAA,aAAa,EAAE,iBAAiB;AAChC,YAAA,SAAS,EAAE;gBACT;AACD,aAAA;AACD,YAAA,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;AAsBN,MAAA,CAAA;SACF,CAAC,CAAC,IAAI,CACL,GAAG,CACD,CAAC,GAAG,KAAI;YACN,OAAO;AACL,gBAAA,IAAI,EAAE,GAAG,CAAC,IAAI,IAAG,IAAI;AACrB,gBAAA,MAAM,EAAE,GAAG,CAAC,MAAM,IAAG;aACtB;AACH,QAAA,CAAC,CACF,EACD,UAAU,CACR,CAAC,GAAG,KAAI;AACN,YAAA,OAAO,EAAE,CACP;AACE,gBAAA,IAAI,EAAE,IAAW;AACjB,gBAAA,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,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A,MAAA,EAAA,CAAA,MAAA,EAAA,KAAA,EAAA,MAAA,EAAA,aAAA,EAAA,OAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAEN,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAClB,yBAAyB,sJAFzB,QAAQ,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,sBAAA,EAAA,CAAA,MAAA,CAAA,OAAA,kEAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,CAAA,qBAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA;;gGAiBC,oBAAoB,EAAA,mBAAA,EAAA,MAAA,CAAA,OAAA,kEAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,CAAA,qBAAA,CAAA,CAAA,EAAA,eAAA,EAAA,qBAAA,KAAA,EAAA,UAAA,EAAA,CAAA;sBAxBhC,SAAS;AACI,gBAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,YACN,eAAe,EAAA,eAAA,EAER,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;4BACP,MAAM;4BACN,QAAQ;4BACR,kBAAkB;4BAClB,yBAAyB;4BACzB;yBACD,EAAA,SAAA,EACU;AACT,4BAAA,YAAY,CACV;gCACE,YAAY;gCACZ,aAAa;gCACb,iBAAiB;gCACjB,sBAAsB;gCACtB,yBAAyB;6BAC1B;AAEJ,yBAAA,EAAA,QAAA,EAAA,usHAAA,EAAA;;;AExCH;;AAEG;;;;"}
@@ -108,10 +108,10 @@ class ProfileService {
108
108
  `,
109
109
  });
110
110
  }
111
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: ProfileService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
112
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: ProfileService, providedIn: 'root' }); }
111
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: ProfileService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
112
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: ProfileService, providedIn: 'root' }); }
113
113
  }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: ProfileService, decorators: [{
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: ProfileService, decorators: [{
115
115
  type: Injectable,
116
116
  args: [{
117
117
  providedIn: 'root'
@@ -136,7 +136,7 @@ class AuthService {
136
136
  * @type {User} An interface contain user information.
137
137
  * @default {} as User
138
138
  */
139
- this.user = signal({}, { ...(ngDevMode ? { debugName: "user" } : {}) });
139
+ this.user = signal({}, ...(ngDevMode ? [{ debugName: "user" }] : []));
140
140
  }
141
141
  static logout() {
142
142
  AuthService.authToken = '';
@@ -242,10 +242,10 @@ class AuthService {
242
242
  localStorage.setItem('refreshToken', AuthService.refreshToken);
243
243
  }));
244
244
  }
245
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthService, deps: [{ token: i1.GqlParser }, { token: ProfileService }], target: i0.ɵɵFactoryTarget.Injectable }); }
246
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthService, providedIn: 'root' }); }
245
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: AuthService, deps: [{ token: i1.GqlParser }, { token: ProfileService }], target: i0.ɵɵFactoryTarget.Injectable }); }
246
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: AuthService, providedIn: 'root' }); }
247
247
  }
248
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthService, decorators: [{
248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: AuthService, decorators: [{
249
249
  type: Injectable,
250
250
  args: [{
251
251
  providedIn: 'root'
@@ -378,10 +378,10 @@ class AuthResolver {
378
378
  buffer = chars.indexOf(buffer);
379
379
  return output;
380
380
  }
381
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
382
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthResolver, providedIn: 'root' }); }
381
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: AuthResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
382
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: AuthResolver, providedIn: 'root' }); }
383
383
  }
384
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthResolver, decorators: [{
384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: AuthResolver, decorators: [{
385
385
  type: Injectable,
386
386
  args: [{
387
387
  providedIn: 'root'
@@ -401,7 +401,7 @@ const authGuard = () => {
401
401
  class PermissionService {
402
402
  constructor(gql) {
403
403
  this.gql = gql;
404
- this.permissions = signal(new Map(), { ...(ngDevMode ? { debugName: "permissions" } : {}) });
404
+ this.permissions = signal(new Map(), ...(ngDevMode ? [{ debugName: "permissions" }] : []));
405
405
  /**
406
406
  * A boolean value that tells the permission service is initiated (permissions list is retrieved from Backend) or not.
407
407
  * @default false
@@ -456,10 +456,10 @@ class PermissionService {
456
456
  `
457
457
  });
458
458
  }
459
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
460
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionService, providedIn: 'root' }); }
459
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: PermissionService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
460
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: PermissionService, providedIn: 'root' }); }
461
461
  }
462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionService, decorators: [{
462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: PermissionService, decorators: [{
463
463
  type: Injectable,
464
464
  args: [{
465
465
  providedIn: 'root'
@@ -582,10 +582,10 @@ class PermissionDirective {
582
582
  }
583
583
  this.viewContainer.clear();
584
584
  }
585
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionDirective, deps: [{ token: PermissionService }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
586
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.2", type: PermissionDirective, isStandalone: true, selector: "[hasPermission]", inputs: { hasPermission: "hasPermission" }, exportAs: ["hasPermission"], ngImport: i0 }); }
585
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: PermissionDirective, deps: [{ token: PermissionService }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
586
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: PermissionDirective, isStandalone: true, selector: "[hasPermission]", inputs: { hasPermission: "hasPermission" }, exportAs: ["hasPermission"], ngImport: i0 }); }
587
587
  }
588
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionDirective, decorators: [{
588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: PermissionDirective, decorators: [{
589
589
  type: Directive,
590
590
  args: [{
591
591
  standalone: true,
@@ -597,8 +597,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
597
597
  }] } });
598
598
 
599
599
  class UnauthorizedPage {
600
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: UnauthorizedPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
601
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.2", type: UnauthorizedPage, isStandalone: true, selector: "up-unauthorized", host: { classAttribute: "flex flex-col items-center justify-center size-full gap-4 p-5 select-none" }, providers: [
600
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UnauthorizedPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
601
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: UnauthorizedPage, isStandalone: true, selector: "up-unauthorized", host: { classAttribute: "flex flex-col items-center justify-center size-full gap-4 p-5 select-none" }, providers: [
602
602
  provideIcons({
603
603
  matLockRound
604
604
  })
@@ -614,7 +614,7 @@ class UnauthorizedPage {
614
614
  <p class="text-center">Please log in or re-check your permissions.</p>
615
615
  `, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
616
616
  }
617
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: UnauthorizedPage, decorators: [{
617
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UnauthorizedPage, decorators: [{
618
618
  type: Component,
619
619
  args: [{
620
620
  standalone: true,
@@ -684,8 +684,8 @@ class LoadingPage {
684
684
  ngOnDestroy() {
685
685
  this.sub?.unsubscribe();
686
686
  }
687
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: LoadingPage, deps: [{ token: LOADING_CONFIG }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
688
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.2", type: LoadingPage, isStandalone: true, selector: "up-loading", host: { classAttribute: "flex flex-col items-center gap-6 p-5 justify-center size-full select-none" }, ngImport: i0, template: `
687
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LoadingPage, deps: [{ token: LOADING_CONFIG }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
688
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: LoadingPage, isStandalone: true, selector: "up-loading", host: { classAttribute: "flex flex-col items-center gap-6 p-5 justify-center size-full select-none" }, ngImport: i0, template: `
689
689
  <up-spinner class="size-10" />
690
690
 
691
691
  <h3 class="text-center text-lg lg:text-2xl font-bold">
@@ -693,7 +693,7 @@ class LoadingPage {
693
693
  </h3>
694
694
  `, isInline: true, dependencies: [{ kind: "component", type: UpSpinnerComponent, selector: "up-spinner", inputs: ["stokeWidth", "inlineClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
695
695
  }
696
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: LoadingPage, decorators: [{
696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LoadingPage, decorators: [{
697
697
  type: Component,
698
698
  args: [{
699
699
  standalone: true,