@unipin/angular-applet 21.1.3 → 21.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/assets/styles/theme.css +8 -0
- package/fesm2022/unipin-angular-applet-accordion.mjs +12 -12
- package/fesm2022/unipin-angular-applet-alert-dialog.mjs +10 -7
- package/fesm2022/unipin-angular-applet-alert-dialog.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-alert.mjs +9 -9
- package/fesm2022/unipin-angular-applet-approval.mjs +6 -6
- package/fesm2022/unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs +280 -0
- package/fesm2022/unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs.map +1 -0
- package/fesm2022/unipin-angular-applet-audit.mjs +220 -0
- package/fesm2022/unipin-angular-applet-audit.mjs.map +1 -0
- package/fesm2022/unipin-angular-applet-auth.mjs +21 -21
- package/fesm2022/unipin-angular-applet-avatar.mjs +25 -8
- package/fesm2022/unipin-angular-applet-avatar.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-badge.mjs +3 -3
- package/fesm2022/unipin-angular-applet-buttons.mjs +6 -6
- package/fesm2022/unipin-angular-applet-calendar.mjs +26 -12
- package/fesm2022/unipin-angular-applet-calendar.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-collapsible.mjs +9 -9
- package/fesm2022/unipin-angular-applet-common.mjs +24 -24
- package/fesm2022/unipin-angular-applet-containers.mjs +12 -12
- package/fesm2022/unipin-angular-applet-dialog.mjs +30 -45
- package/fesm2022/unipin-angular-applet-dialog.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-forms.mjs +960 -311
- package/fesm2022/unipin-angular-applet-forms.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-froala.mjs +4 -4
- package/fesm2022/unipin-angular-applet-froala.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-grids.mjs +17 -1
- package/fesm2022/unipin-angular-applet-grids.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-infinite-scroll.mjs +3 -3
- package/fesm2022/unipin-angular-applet-json-viewer.mjs +3 -3
- package/fesm2022/unipin-angular-applet-kbd.mjs +3 -3
- package/fesm2022/unipin-angular-applet-loading-dialog.mjs +6 -6
- package/fesm2022/unipin-angular-applet-markdown.mjs +10 -10
- package/fesm2022/unipin-angular-applet-markdown.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-popover.mjs +18 -18
- package/fesm2022/unipin-angular-applet-popover.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-progress-bar.mjs +3 -3
- package/fesm2022/unipin-angular-applet-skeleton.mjs +3 -3
- package/fesm2022/unipin-angular-applet-spinner.mjs +3 -3
- package/fesm2022/unipin-angular-applet-stepper.mjs +6 -6
- package/fesm2022/unipin-angular-applet-swipeable.mjs +12 -12
- package/fesm2022/unipin-angular-applet-tabs.mjs +9 -9
- package/fesm2022/unipin-angular-applet-tooltip.mjs +3 -3
- package/package.json +5 -1
- package/types/unipin-angular-applet-audit.d.ts +49 -0
- package/types/unipin-angular-applet-avatar.d.ts +3 -2
- package/types/unipin-angular-applet-containers.d.ts +1 -1
- package/types/unipin-angular-applet-dialog.d.ts +13 -13
- package/types/unipin-angular-applet-forms.d.ts +133 -51
- package/types/unipin-angular-applet-grids.d.ts +17 -1
- package/types/unipin-angular-applet-popover.d.ts +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs","sources":["../../../projects/unipin-angular/audit/components/modal/audit-modal.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, input, output } from '@angular/core';\nimport { DatePipe } from '@angular/common';\nimport { AuditTrail } from '@unipin/graphql-schema';\nimport { UpContentContainerComponent } from '@unipin/angular-applet/containers';\nimport { UpFormFieldComponent, UpInputDirective } from '@unipin/angular-applet/forms';\nimport { UpDialogWrapperComponent, UpDialogContentDirective, UpDialogContentRefDirective } from '@unipin/angular-applet/dialog';\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-modal',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DatePipe,\n UpInputDirective,\n UpFormFieldComponent,\n UpDialogWrapperComponent,\n UpDialogContentDirective,\n UpDialogContentRefDirective,\n UpContentContainerComponent\n ],\n template: `\n <up-dialog-wrapper\n [isOpen]=\"audit() !== null\"\n (dismissed)=\"dismissed.emit()\"\n >\n <div\n upDialogContent\n class=\"max-w-200\"\n *upDialogContentRef\n >\n <up-content-container\n [header]=\"audit()?.user?.name + ' ' + audit()?.action + ' • ' + (audit()?.createdAt | date: 'dd LLL yyyy HH:mm')\"\n (closed)=\"dismissed.emit()\"\n >\n <div class=\"p-4 space-y-6\">\n <up-form-field label=\"Username\">\n <input \n upInput \n readonly\n type=\"text\"\n tabindex=\"-1\"\n [value]=\"audit()?.user?.name\" \n />\n </up-form-field>\n\n <up-form-field label=\"Description\">\n <textarea \n upInput\n readonly\n tabindex=\"-1\"\n class=\"h-25 w-full\"\n [value]=\"audit()?.description\"\n ></textarea>\n </up-form-field>\n\n <div class=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n <up-form-field label=\"Source IP\">\n <input \n upInput \n readonly\n type=\"text\"\n tabindex=\"-1\"\n [value]=\"audit()?.sourceIp\" \n />\n </up-form-field>\n\n <up-form-field label=\"Source Platform\">\n <input \n upInput \n readonly\n type=\"text\"\n tabindex=\"-1\"\n [value]=\"audit()?.user?.sourcePlatform\" \n />\n </up-form-field>\n\n <up-form-field label=\"MS Source\">\n <input \n upInput \n readonly\n type=\"text\"\n tabindex=\"-1\"\n [value]=\"audit()?.msSource\" \n />\n </up-form-field>\n\n <up-form-field label=\"Function\">\n <input \n upInput \n readonly\n type=\"text\"\n tabindex=\"-1\"\n [value]=\"audit()?.function\" \n />\n </up-form-field>\n </div>\n\n @if (\n audit() &&\n audit()!.changedData &&\n audit()!.changedData!.length > 0\n ) {\n <div class=\"space-y-2\">\n <label class=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 select-none\">\n Changed Data\n </label>\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 {{ data.oldValue }}\n </td>\n\n <td class=\"p-2 text-left border border-border capitalize\">\n {{ data.newValue }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n </div>\n </up-content-container>\n </div>\n </up-dialog-wrapper> \n `\n})\nexport class UpAuditModalComponent {\n\n public readonly audit = input.required<AuditTrailData | null>();\n public readonly dismissed = output<void>();\n}\n"],"names":[],"mappings":";;;;;;;MAuJa,qBAAqB,CAAA;AAzIlC,IAAA,WAAA,GAAA;AA2IkB,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAyB;QAC/C,IAAA,CAAA,SAAS,GAAG,MAAM,EAAQ;AAC3C,IAAA;8GAJY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,Q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,iBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACxB,2BAA2B,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,QAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC3B,2BAA2B,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,UAAA,EAAA,iBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAN3B,QAAQ,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAoIC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAzIjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE;wBACP,QAAQ;wBACR,gBAAgB;wBAChB,oBAAoB;wBACpB,wBAAwB;wBACxB,wBAAwB;wBACxB,2BAA2B;wBAC3B;AACD,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0HT,EAAA;AACF,iBAAA;;;;;"}
|
|
@@ -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\"> {{ audit.action }} <i class=\"text-muted-foreground\">\u2022</i></span>\n <span class=\"text-muted-foreground text-xs\"> {{ 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\"> {{ audit.action }} <i class=\"text-muted-foreground\">\u2022</i></span>\n <span class=\"text-muted-foreground text-xs\"> {{ 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\"> {{ audit.action }} <i class=\"text-muted-foreground\">•</i></span>\n <span class=\"text-muted-foreground text-xs\"> {{ 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":";;;;;;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A,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.
|
|
112
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
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.
|
|
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'
|
|
@@ -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.
|
|
246
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
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.
|
|
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.
|
|
382
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
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.
|
|
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'
|
|
@@ -456,10 +456,10 @@ class PermissionService {
|
|
|
456
456
|
`
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
460
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
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.
|
|
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.
|
|
586
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.
|
|
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.
|
|
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.6", ngImpor
|
|
|
597
597
|
}] } });
|
|
598
598
|
|
|
599
599
|
class UnauthorizedPage {
|
|
600
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
601
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.
|
|
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.
|
|
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.
|
|
688
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.
|
|
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.
|
|
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,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, effect, Directive } from '@angular/core';
|
|
2
|
+
import { input, computed, effect, HostListener, Directive } from '@angular/core';
|
|
3
3
|
import { up, formatInitial } from '@unipin/angular-applet/common';
|
|
4
4
|
|
|
5
5
|
class UpAvatarDirective {
|
|
@@ -9,19 +9,33 @@ class UpAvatarDirective {
|
|
|
9
9
|
this.initialText = input('', { ...(ngDevMode ? { debugName: "initialText" } : {}), alias: 'initial' });
|
|
10
10
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
11
11
|
this._computedClass = computed(() => {
|
|
12
|
-
return up('inline-flex items-center justify-center rounded-full overflow-hidden select-none size-16', this.initialText() ? 'bg-gray-400 text-white font-semibold text-3xl' : 'object-cover', this.inlineClass());
|
|
12
|
+
return up('inline-flex items-center justify-center rounded-full overflow-hidden select-none size-16 relative', this.initialText() ? 'bg-gray-400 text-white font-semibold text-3xl' : 'object-cover', this.inlineClass());
|
|
13
13
|
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
14
14
|
effect(() => {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const el = this.el.nativeElement;
|
|
16
|
+
if (this.initialText() &&
|
|
17
|
+
!el.getAttribute('src')) {
|
|
17
18
|
this.renderer.setProperty(el, 'textContent', formatInitial(this.initialText()));
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
setFallback() {
|
|
23
|
+
const el = this.el.nativeElement;
|
|
24
|
+
const parent = el.parentNode;
|
|
25
|
+
if (!parent) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const t = this.initialText;
|
|
29
|
+
const div = this.renderer.createElement('div');
|
|
30
|
+
this.renderer.setAttribute(div, 'class', el.className);
|
|
31
|
+
this.renderer.setProperty(div, 'textContent', formatInitial(t));
|
|
32
|
+
this.renderer.insertBefore(parent, div, el);
|
|
33
|
+
this.renderer.removeChild(parent, el);
|
|
34
|
+
}
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpAvatarDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
36
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: UpAvatarDirective, isStandalone: true, selector: "[upAvatar]", inputs: { initialText: { classPropertyName: "initialText", publicName: "initial", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "error": "setFallback()" }, properties: { "class": "_computedClass()" } }, exportAs: ["upAvatar"], ngImport: i0 }); }
|
|
23
37
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpAvatarDirective, decorators: [{
|
|
25
39
|
type: Directive,
|
|
26
40
|
args: [{
|
|
27
41
|
standalone: true,
|
|
@@ -31,7 +45,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
31
45
|
'[class]': '_computedClass()',
|
|
32
46
|
},
|
|
33
47
|
}]
|
|
34
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { initialText: [{ type: i0.Input, args: [{ isSignal: true, alias: "initial", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }]
|
|
48
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { initialText: [{ type: i0.Input, args: [{ isSignal: true, alias: "initial", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], setFallback: [{
|
|
49
|
+
type: HostListener,
|
|
50
|
+
args: ['error']
|
|
51
|
+
}] } });
|
|
35
52
|
|
|
36
53
|
/**
|
|
37
54
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unipin-angular-applet-avatar.mjs","sources":["../../../projects/unipin-angular/avatar/avatar.directive.ts","../../../projects/unipin-angular/avatar/unipin-angular-applet-avatar.ts"],"sourcesContent":["import { Directive, ElementRef, Renderer2, effect, computed, input } from '@angular/core';\nimport { ClassValue } from 'clsx';\nimport {
|
|
1
|
+
{"version":3,"file":"unipin-angular-applet-avatar.mjs","sources":["../../../projects/unipin-angular/avatar/avatar.directive.ts","../../../projects/unipin-angular/avatar/unipin-angular-applet-avatar.ts"],"sourcesContent":["import { Directive, ElementRef, Renderer2, effect, computed, input, HostListener } from '@angular/core';\nimport { ClassValue } from 'clsx';\nimport { formatInitial, up } from '@unipin/angular-applet/common';\n\n\n@Directive({\n standalone: true,\n exportAs: 'upAvatar',\n selector: '[upAvatar]',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class UpAvatarDirective {\n\n public readonly initialText = input<string>('', { alias: 'initial' });\n public readonly inlineClass = input<ClassValue>('', { alias: 'class' });\n \n protected readonly _computedClass = computed(\n () => {\n return up(\n 'inline-flex items-center justify-center rounded-full overflow-hidden select-none size-16 relative',\n this.initialText()? 'bg-gray-400 text-white font-semibold text-3xl' : 'object-cover',\n this.inlineClass()\n );\n }\n );\n\n constructor(\n protected readonly el: ElementRef<HTMLElement>,\n protected readonly renderer: Renderer2\n ) {\n effect(\n () => {\n const el = this.el.nativeElement;\n \n if (\n this.initialText() &&\n !el.getAttribute('src')\n ) {\n this.renderer.setProperty(\n el, \n 'textContent', \n formatInitial(this.initialText())\n );\n }\n }\n );\n }\n\n @HostListener('error')\n public setFallback(): void{ \n const el = this.el.nativeElement;\n\n const parent = el.parentNode;\n if (!parent) {\n return;\n }\n\n const t: any = this.initialText;\n const div = this.renderer.createElement('div');\n\n this.renderer.setAttribute(div, 'class', el.className);\n this.renderer.setProperty(div, 'textContent', formatInitial(t));\n\n this.renderer.insertBefore(parent, div, el);\n this.renderer.removeChild(parent, el);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAaa,iBAAiB,CAAA;IAe5B,WAAA,CACqB,EAA2B,EAC3B,QAAmB,EAAA;QADnB,IAAA,CAAA,EAAE,GAAF,EAAE;QACF,IAAA,CAAA,QAAQ,GAAR,QAAQ;QAfb,IAAA,CAAA,WAAW,GAAG,KAAK,CAAS,EAAE,wDAAI,KAAK,EAAE,SAAS,EAAA,CAAG;QACrD,IAAA,CAAA,WAAW,GAAG,KAAK,CAAa,EAAE,wDAAI,KAAK,EAAE,OAAO,EAAA,CAAG;AAEpD,QAAA,IAAA,CAAA,cAAc,GAAG,QAAQ,CAC1C,MAAK;YACH,OAAO,EAAE,CACP,mGAAmG,EACnG,IAAI,CAAC,WAAW,EAAE,GAAE,+CAA+C,GAAG,cAAc,EACpF,IAAI,CAAC,WAAW,EAAE,CACnB;AACH,QAAA,CAAC,0DACF;QAMC,MAAM,CACJ,MAAK;AACH,YAAA,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa;YAEhC,IACE,IAAI,CAAC,WAAW,EAAE;AAClB,gBAAA,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EACvB;AACA,gBAAA,IAAI,CAAC,QAAQ,CAAC,WAAW,CACvB,EAAE,EACF,aAAa,EACb,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAClC;YACH;AACF,QAAA,CAAC,CACF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AA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,eAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,kBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAR7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,kBAAkB;AAC9B,qBAAA;AACF,iBAAA;;sBAsCE,YAAY;uBAAC,OAAO;;;AClDvB;;AAEG;;;;"}
|
|
@@ -27,10 +27,10 @@ class UpBadgeDirective {
|
|
|
27
27
|
}), this.inlineClass());
|
|
28
28
|
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
29
29
|
}
|
|
30
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
31
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
30
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpBadgeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
31
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: UpBadgeDirective, isStandalone: true, selector: "[upBadge]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, exportAs: ["upBadge"], ngImport: i0 }); }
|
|
32
32
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpBadgeDirective, decorators: [{
|
|
34
34
|
type: Directive,
|
|
35
35
|
args: [{
|
|
36
36
|
standalone: true,
|
|
@@ -41,10 +41,10 @@ class UpButtonDirective {
|
|
|
41
41
|
}), this.inlineClass());
|
|
42
42
|
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
43
43
|
}
|
|
44
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
45
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
45
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: UpButtonDirective, isStandalone: true, selector: "[upButton]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, exportAs: ["upButton"], ngImport: i0 }); }
|
|
46
46
|
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpButtonDirective, decorators: [{
|
|
48
48
|
type: Directive,
|
|
49
49
|
args: [{
|
|
50
50
|
standalone: true,
|
|
@@ -91,8 +91,8 @@ class UpSplitButtonComponent {
|
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
95
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
94
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpSplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
95
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: UpSplitButtonComponent, isStandalone: true, selector: "up-split-button", inputs: { activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeIndex: "activeIndexChange" }, host: { classAttribute: "flex" }, providers: [
|
|
96
96
|
provideIcons({
|
|
97
97
|
matCheckRound,
|
|
98
98
|
matArrowDropDownRound
|
|
@@ -159,7 +159,7 @@ class UpSplitButtonComponent {
|
|
|
159
159
|
}
|
|
160
160
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpButtonDirective, selector: "[upButton]", inputs: ["size", "variant", "class"], exportAs: ["upButton"] }, { kind: "component", type: UpPopoverComponent, selector: "up-popover", inputs: ["placement", "alignment", "placementOffset", "alignmentOffset"] }, { kind: "directive", type: UpPopoverCloseDirective, selector: "[upPopoverClose]", exportAs: ["upPopoverClose"] }, { kind: "directive", type: UpPopoverTriggerDirective, selector: "[upPopoverTrigger]", exportAs: ["upPopoverTrigger"] }, { kind: "directive", type: UpPopoverContentDirective, selector: "[upPopoverContent]", inputs: ["class"], exportAs: ["upPopoverContent"] }, { kind: "directive", type: UpPopoverContentRefDirective, selector: "[upPopoverContentRef]", exportAs: ["upPopoverContentRef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
161
161
|
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpSplitButtonComponent, decorators: [{
|
|
163
163
|
type: Component,
|
|
164
164
|
args: [{
|
|
165
165
|
standalone: true,
|