@acorex-platform/module-auth-client 0.0.15
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/fesm2022/acorex-platform-module-auth-client-acorex-platform-module-auth-client-B7tIKOw6.mjs +3174 -0
- package/fesm2022/acorex-platform-module-auth-client-acorex-platform-module-auth-client-B7tIKOw6.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-Cm2ZagaI.mjs +67 -0
- package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-Cm2ZagaI.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-blank.layout-BRGgntib.mjs +18 -0
- package/fesm2022/acorex-platform-module-auth-client-blank.layout-BRGgntib.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-change-password.command-ZyXAjUKw.mjs +168 -0
- package/fesm2022/acorex-platform-module-auth-client-change-password.command-ZyXAjUKw.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-change-photo.command-BC8lw--F.mjs +192 -0
- package/fesm2022/acorex-platform-module-auth-client-change-photo.command-BC8lw--F.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-contracts.mjs +80 -0
- package/fesm2022/acorex-platform-module-auth-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-edit-account-info.command-B-mVlXxg.mjs +129 -0
- package/fesm2022/acorex-platform-module-auth-client-edit-account-info.command-B-mVlXxg.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-edit-signature.command-CcTJJwAX.mjs +32 -0
- package/fesm2022/acorex-platform-module-auth-client-edit-signature.command-CcTJJwAX.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-lock-screen.command-41QnG1TQ.mjs +30 -0
- package/fesm2022/acorex-platform-module-auth-client-lock-screen.command-41QnG1TQ.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-login.module-DYtNYzF6.mjs +57 -0
- package/fesm2022/acorex-platform-module-auth-client-login.module-DYtNYzF6.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-master.layout-DpdD9kgk.mjs +24 -0
- package/fesm2022/acorex-platform-module-auth-client-master.layout-DpdD9kgk.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-menu.provider-Bz-kRip4.mjs +19 -0
- package/fesm2022/acorex-platform-module-auth-client-menu.provider-Bz-kRip4.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-oauth-callback.component-BspBH4Ul.mjs +105 -0
- package/fesm2022/acorex-platform-module-auth-client-oauth-callback.component-BspBH4Ul.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-CXSGuqYp.mjs +196 -0
- package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-CXSGuqYp.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-password.component-BuqUhET7.mjs +59 -0
- package/fesm2022/acorex-platform-module-auth-client-password.component-BuqUhET7.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-password.component-Cihg82vM.mjs +529 -0
- package/fesm2022/acorex-platform-module-auth-client-password.component-Cihg82vM.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-pin-code.constants-CRsFG7fg.mjs +7 -0
- package/fesm2022/acorex-platform-module-auth-client-pin-code.constants-CRsFG7fg.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-activity-chart.component-B8lBvZsA.mjs +158 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-activity-chart.component-B8lBvZsA.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-coming-soon.command-DBbFbzAx.mjs +31 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-coming-soon.command-DBbFbzAx.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-CtJho4ab.mjs +79 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-CtJho4ab.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-page-component.provider-B-Qtd4_j.mjs +27 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-page-component.provider-B-Qtd4_j.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-page.component-tbhf7K0V.mjs +446 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-page.component-tbhf7K0V.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-register-password.component-hSJyEA6Q.mjs +145 -0
- package/fesm2022/acorex-platform-module-auth-client-register-password.component-hSJyEA6Q.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-register.module-DXm6AQpo.mjs +62 -0
- package/fesm2022/acorex-platform-module-auth-client-register.module-DXm6AQpo.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-remove-pin-code.command-zUZooOtv.mjs +91 -0
- package/fesm2022/acorex-platform-module-auth-client-remove-pin-code.command-zUZooOtv.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-result.component-DYJaB-FD.mjs +36 -0
- package/fesm2022/acorex-platform-module-auth-client-result.component-DYJaB-FD.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-routes-REjaWcqY.mjs +9 -0
- package/fesm2022/acorex-platform-module-auth-client-routes-REjaWcqY.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-DqXGuIgN.mjs +346 -0
- package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-DqXGuIgN.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-DXTVbrS0.mjs +33 -0
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-DXTVbrS0.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.component-5TxB6aFi.mjs +188 -0
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.component-5TxB6aFi.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-settings.provider-n1qbs6e1.mjs +177 -0
- package/fesm2022/acorex-platform-module-auth-client-settings.provider-n1qbs6e1.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-show-profile-command-CxMz1yy-.mjs +70 -0
- package/fesm2022/acorex-platform-module-auth-client-show-profile-command-CxMz1yy-.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-signout-command-DqqrP5pk.mjs +24 -0
- package/fesm2022/acorex-platform-module-auth-client-signout-command-DqqrP5pk.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-ihsqCJKN.mjs +59 -0
- package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-ihsqCJKN.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-CiENsIEh.mjs +40 -0
- package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-CiENsIEh.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-two-factor.module-BJqdeuAz.mjs +45 -0
- package/fesm2022/acorex-platform-module-auth-client-two-factor.module-BJqdeuAz.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-view-login-history.command-Dl0os5lD.mjs +108 -0
- package/fesm2022/acorex-platform-module-auth-client-view-login-history.command-Dl0os5lD.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client.mjs +2 -0
- package/fesm2022/acorex-platform-module-auth-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-auth-client-contracts.d.ts +67 -0
- package/types/acorex-platform-module-auth-client.d.ts +390 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region ---- PIN code constants ----
|
|
2
|
+
const AXP_AUTH_PIN_CODE_LENGTH = 4;
|
|
3
|
+
const AXP_AUTH_PIN_CODE_PATTERN = /^\d{4}$/;
|
|
4
|
+
//#endregion
|
|
5
|
+
|
|
6
|
+
export { AXP_AUTH_PIN_CODE_LENGTH as A, AXP_AUTH_PIN_CODE_PATTERN as a };
|
|
7
|
+
//# sourceMappingURL=acorex-platform-module-auth-client-pin-code.constants-CRsFG7fg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-auth-client-pin-code.constants-CRsFG7fg.mjs","sources":["../../../../libs/modules/auth/client/src/lib/shared/constants/pin-code.constants.ts"],"sourcesContent":["//#region ---- PIN code constants ----\n\nexport const AXP_AUTH_PIN_CODE_LENGTH = 4;\n\nexport const AXP_AUTH_PIN_CODE_PATTERN = /^\\d{4}$/;\n\n//#endregion\n"],"names":[],"mappings":"AAAA;AAEO,MAAM,wBAAwB,GAAG;AAEjC,MAAM,yBAAyB,GAAG;AAEzC;;;;"}
|
package/fesm2022/acorex-platform-module-auth-client-profile-activity-chart.component-B8lBvZsA.mjs
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { AXPDataSourceDefinitionProviderService } from '@acorex-platform/framework-client/core';
|
|
2
|
+
import * as i3 from '@acorex/components/decorators';
|
|
3
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
4
|
+
import * as i2 from '@acorex/core/translation';
|
|
5
|
+
import { AXTranslationModule } from '@acorex/core/translation';
|
|
6
|
+
import { AXPPageLayoutBaseComponent, AXPPageLayoutBase } from '@acorex-platform/framework-client/layout/views';
|
|
7
|
+
import * as i4 from '@angular/common';
|
|
8
|
+
import { CommonModule, AsyncPipe } from '@angular/common';
|
|
9
|
+
import * as i0 from '@angular/core';
|
|
10
|
+
import { input, inject, signal, computed, effect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
11
|
+
import { isEmpty } from 'lodash';
|
|
12
|
+
import { AXMAuthDataSourceKeys } from '@acorex-platform/module-auth-client/contracts';
|
|
13
|
+
import { u as resolveDefaultUserActivityDateRange, w as formatCompactActivityCount } from './acorex-platform-module-auth-client-acorex-platform-module-auth-client-B7tIKOw6.mjs';
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region ---- Component ----
|
|
17
|
+
/** Contribution-style activity heatmap for the profile Activity tab. */
|
|
18
|
+
class AXMProfileActivityChartComponent extends AXPPageLayoutBaseComponent {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
//#region ---- Inputs ----
|
|
22
|
+
this.rootContext = input({}, ...(ngDevMode ? [{ debugName: "rootContext" }] : /* istanbul ignore next */ []));
|
|
23
|
+
this.pageConfig = input(...(ngDevMode ? [undefined, { debugName: "pageConfig" }] : /* istanbul ignore next */ []));
|
|
24
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region ---- Services & Dependencies ----
|
|
27
|
+
this.dataSourceDefinitionService = inject(AXPDataSourceDefinitionProviderService);
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ---- State ----
|
|
30
|
+
this.weeks = signal([], ...(ngDevMode ? [{ debugName: "weeks" }] : /* istanbul ignore next */ []));
|
|
31
|
+
this.stats = signal({
|
|
32
|
+
longestStreak: 0,
|
|
33
|
+
avgPerDay: 0,
|
|
34
|
+
avgPerWeek: 0,
|
|
35
|
+
total: 0,
|
|
36
|
+
}, ...(ngDevMode ? [{ debugName: "stats" }] : /* istanbul ignore next */ []));
|
|
37
|
+
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
38
|
+
this.weekdayLabels = ['M', 'W', 'F'];
|
|
39
|
+
this.intensityLevels = [0, 1, 2, 3, 4];
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region ---- Derived state ----
|
|
42
|
+
this.dataSourceName = computed(() => this.options()['dataSource'] ?? AXMAuthDataSourceKeys.UserActivity, ...(ngDevMode ? [{ debugName: "dataSourceName" }] : /* istanbul ignore next */ []));
|
|
43
|
+
this.monthLabels = computed(() => {
|
|
44
|
+
const labels = [];
|
|
45
|
+
let lastMonth = -1;
|
|
46
|
+
this.weeks().forEach((week, weekIndex) => {
|
|
47
|
+
const firstDay = week.days[0];
|
|
48
|
+
const month = firstDay.date.getMonth();
|
|
49
|
+
if (month !== lastMonth) {
|
|
50
|
+
labels.push({
|
|
51
|
+
key: `${firstDay.date.getFullYear()}-${month}`,
|
|
52
|
+
label: firstDay.date.toLocaleString('en-US', { month: 'short' }),
|
|
53
|
+
weekIndex,
|
|
54
|
+
});
|
|
55
|
+
lastMonth = month;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return labels;
|
|
59
|
+
}, ...(ngDevMode ? [{ debugName: "monthLabels" }] : /* istanbul ignore next */ []));
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region ---- Effects ----
|
|
62
|
+
this.#loadActivityEffect = effect(() => {
|
|
63
|
+
const userId = this.sessionService.user?.id;
|
|
64
|
+
const dataSourceName = this.dataSourceName();
|
|
65
|
+
void this.loadActivity(userId, dataSourceName);
|
|
66
|
+
}, ...(ngDevMode ? [{ debugName: "#loadActivityEffect" }] : /* istanbul ignore next */ []));
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region ---- Effects ----
|
|
70
|
+
#loadActivityEffect;
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region ---- Data loading ----
|
|
73
|
+
async loadActivity(userId, dataSourceName) {
|
|
74
|
+
this.isLoading.set(true);
|
|
75
|
+
try {
|
|
76
|
+
if (isEmpty(userId)) {
|
|
77
|
+
this.weeks.set([]);
|
|
78
|
+
this.stats.set({ longestStreak: 0, avgPerDay: 0, avgPerWeek: 0, total: 0 });
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const definition = await this.dataSourceDefinitionService.get(dataSourceName);
|
|
82
|
+
if (!definition) {
|
|
83
|
+
this.weeks.set([]);
|
|
84
|
+
this.stats.set({ longestStreak: 0, avgPerDay: 0, avgPerWeek: 0, total: 0 });
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const { startDate, endDate } = resolveDefaultUserActivityDateRange();
|
|
88
|
+
const sourceResult = definition.source();
|
|
89
|
+
const dataSource = sourceResult instanceof Promise ? await sourceResult : sourceResult;
|
|
90
|
+
const page = await dataSource.config.load({
|
|
91
|
+
take: 1,
|
|
92
|
+
skip: 0,
|
|
93
|
+
sort: [],
|
|
94
|
+
filter: {
|
|
95
|
+
logic: 'and',
|
|
96
|
+
filters: [
|
|
97
|
+
{ field: 'userId', operator: { type: 'equal' }, value: userId },
|
|
98
|
+
{ field: 'startDate', operator: { type: 'gte' }, value: startDate },
|
|
99
|
+
{ field: 'endDate', operator: { type: 'lte' }, value: endDate },
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
const item = page.items?.[0];
|
|
104
|
+
if (!item) {
|
|
105
|
+
this.weeks.set([]);
|
|
106
|
+
this.stats.set({ longestStreak: 0, avgPerDay: 0, avgPerWeek: 0, total: 0 });
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.weeks.set(item.weeks.map((week) => ({
|
|
110
|
+
days: week.days.map((day) => ({
|
|
111
|
+
date: new Date(day.date),
|
|
112
|
+
count: day.count,
|
|
113
|
+
level: day.level,
|
|
114
|
+
})),
|
|
115
|
+
})));
|
|
116
|
+
this.stats.set(item.stats);
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
this.isLoading.set(false);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region ---- UI helpers ----
|
|
124
|
+
formatCount(value) {
|
|
125
|
+
return formatCompactActivityCount(value);
|
|
126
|
+
}
|
|
127
|
+
weekdayRowIndex(label) {
|
|
128
|
+
if (label === 'M') {
|
|
129
|
+
return 1;
|
|
130
|
+
}
|
|
131
|
+
if (label === 'W') {
|
|
132
|
+
return 3;
|
|
133
|
+
}
|
|
134
|
+
return 5;
|
|
135
|
+
}
|
|
136
|
+
cellTitle(day) {
|
|
137
|
+
return `${day.date.toLocaleDateString()} — ${day.count}`;
|
|
138
|
+
}
|
|
139
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMProfileActivityChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
140
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXMProfileActivityChartComponent, isStandalone: true, selector: "axm-profile-activity-chart", inputs: { rootContext: { classPropertyName: "rootContext", publicName: "rootContext", isSignal: true, isRequired: false, transformFunction: null }, pageConfig: { classPropertyName: "pageConfig", publicName: "pageConfig", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "axm-profile-activity-chart" }, providers: [
|
|
141
|
+
{
|
|
142
|
+
provide: AXPPageLayoutBase,
|
|
143
|
+
useExisting: AXMProfileActivityChartComponent,
|
|
144
|
+
},
|
|
145
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"__panel\" *translate=\"let t\">\n <header class=\"__header\">\n <div class=\"__title-row\">\n <h3 class=\"__title\">{{ '@auth:profile-page.components.activity-chart.title' | translate | async }}</h3>\n <ax-icon icon=\"fa-light fa-circle-info\" class=\"__info-icon\"></ax-icon>\n </div>\n <span class=\"__context\">{{ '@auth:profile-page.components.activity-chart.context' | translate | async }}</span>\n </header>\n\n <dl class=\"__stats\">\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.longest-streak' | translate | async }}</dt>\n <dd>\n <strong>{{ stats().longestStreak }}</strong>\n {{ '@auth:profile-page.components.activity-chart.stats.days' | translate | async }}\n </dd>\n </div>\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.avg-day' | translate | async }}</dt>\n <dd>{{ formatCount(stats().avgPerDay) }}</dd>\n </div>\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.avg-week' | translate | async }}</dt>\n <dd>{{ formatCount(stats().avgPerWeek) }}</dd>\n </div>\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.total' | translate | async }}</dt>\n <dd>{{ formatCount(stats().total) }}</dd>\n </div>\n </dl>\n\n <div class=\"__heatmap-wrap\">\n <div class=\"__month-labels\" aria-hidden=\"true\">\n @for (month of monthLabels(); track month.key) {\n <span class=\"__month-label\" [style.grid-column-start]=\"month.weekIndex + 2\">{{ month.label }}</span>\n }\n </div>\n\n <div class=\"__heatmap\">\n <div class=\"__weekday-labels\" aria-hidden=\"true\">\n @for (label of weekdayLabels; track label) {\n <span class=\"__weekday-label\" [style.grid-row]=\"weekdayRowIndex(label)\">{{ label }}</span>\n }\n </div>\n\n <div class=\"__grid\" role=\"img\" [attr.aria-label]=\"'@auth:profile-page.components.activity-chart.aria-label' | translate | async\">\n @for (week of weeks(); track $index) {\n @for (day of week.days; track day.date.getTime()) {\n <span\n class=\"__cell\"\n [class.--level-0]=\"day.level === 0\"\n [class.--level-1]=\"day.level === 1\"\n [class.--level-2]=\"day.level === 2\"\n [class.--level-3]=\"day.level === 3\"\n [class.--level-4]=\"day.level === 4\"\n [attr.title]=\"cellTitle(day)\"\n ></span>\n }\n }\n </div>\n </div>\n </div>\n\n <footer class=\"__legend\" aria-hidden=\"true\">\n <span class=\"__legend-label\">{{ '@auth:profile-page.components.activity-chart.legend.less' | translate | async }}</span>\n @for (level of intensityLevels; track level) {\n <span class=\"__legend-cell\" [class]=\"'--level-' + level\"></span>\n }\n <span class=\"__legend-label\">{{ '@auth:profile-page.components.activity-chart.legend.more' | translate | async }}</span>\n </footer>\n</div>\n", styles: ["@layer properties;.axm-profile-activity-chart{display:block;width:100%}.axm-profile-activity-chart .__panel{width:100%;border-radius:var(--radius-2xl, 1rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lightest);color:var(--color-on-lightest);border-color:var(--color-border-lightest);padding:calc(var(--spacing, .25rem) * 6);--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:rgb(var(--ax-sys-color-border-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface))}.axm-profile-activity-chart .__header{margin-bottom:calc(var(--spacing, .25rem) * 5);display:flex;align-items:flex-start;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 4)}.axm-profile-activity-chart .__title-row{display:inline-flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2)}.axm-profile-activity-chart .__title{margin:0;font-size:var(--text-lg, 1.125rem);line-height:var(--tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);color:rgb(var(--ax-sys-color-on-lightest-surface))}.axm-profile-activity-chart .__info-icon{opacity:50%;color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__context{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__stats{margin-bottom:calc(var(--spacing, .25rem) * 6);display:grid;gap:calc(var(--spacing, .25rem) * 4);grid-template-columns:repeat(2,minmax(0,1fr))}@media(min-width:768px){.axm-profile-activity-chart .__stats{grid-template-columns:repeat(4,minmax(0,1fr))}}.axm-profile-activity-chart .__stat{min-width:0}.axm-profile-activity-chart .__stat dt{margin-bottom:var(--spacing, .25rem);font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__stat dd{margin:0;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:rgb(var(--ax-sys-color-on-lightest-surface))}.axm-profile-activity-chart .__stat dd strong{--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700)}.axm-profile-activity-chart .__heatmap-wrap{width:100%;overflow-x:auto;padding-bottom:calc(var(--spacing, .25rem) * 2)}.axm-profile-activity-chart .__month-labels{margin-bottom:calc(var(--spacing, .25rem) * 2);display:grid;width:100%;gap:var(--spacing, .25rem);grid-template-columns:1.75rem repeat(53,minmax(0,1fr))}.axm-profile-activity-chart .__month-label{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__heatmap{display:grid;width:100%;gap:calc(var(--spacing, .25rem) * 2);grid-template-columns:1.75rem 1fr;align-items:stretch}.axm-profile-activity-chart .__weekday-labels{display:grid;gap:var(--spacing, .25rem);align-self:stretch;grid-template-rows:repeat(7,1fr)}.axm-profile-activity-chart .__weekday-label{display:flex;align-items:center;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__grid{display:grid;width:100%;gap:var(--spacing, .25rem);grid-template-rows:repeat(7,auto);grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}.axm-profile-activity-chart .__cell{width:100%;border-radius:var(--radius-sm, .25rem);aspect-ratio:1}.axm-profile-activity-chart .__cell.--level-0{background:rgb(var(--ax-sys-color-dark-surface))}.axm-profile-activity-chart .__cell.--level-1{background:rgb(var(--ax-sys-color-primary-200))}.axm-profile-activity-chart .__cell.--level-2{background:rgb(var(--ax-sys-color-primary-400))}.axm-profile-activity-chart .__cell.--level-3{background:rgb(var(--ax-sys-color-primary-600))}.axm-profile-activity-chart .__cell.--level-4{background:rgb(var(--ax-sys-color-primary-800))}.axm-profile-activity-chart .__legend{margin-top:calc(var(--spacing, .25rem) * 4);display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1.5)}.axm-profile-activity-chart .__legend-label{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__legend-cell{width:calc(var(--spacing, .25rem) * 3);height:calc(var(--spacing, .25rem) * 3);border-radius:var(--radius-sm, .25rem)}.axm-profile-activity-chart .__legend-cell.--level-0{background:rgb(var(--ax-sys-color-dark-surface))}.axm-profile-activity-chart .__legend-cell.--level-1{background:rgb(var(--ax-sys-color-primary-200))}.axm-profile-activity-chart .__legend-cell.--level-2{background:rgb(var(--ax-sys-color-primary-400))}.axm-profile-activity-chart .__legend-cell.--level-3{background:rgb(var(--ax-sys-color-primary-600))}.axm-profile-activity-chart .__legend-cell.--level-4{background:rgb(var(--ax-sys-color-primary-800))}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i2.AXTranslatorDirective, selector: "[translate]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
146
|
+
}
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMProfileActivityChartComponent, decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{ selector: 'axm-profile-activity-chart', imports: [CommonModule, AsyncPipe, AXDecoratorModule, AXTranslationModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { class: 'axm-profile-activity-chart' }, providers: [
|
|
150
|
+
{
|
|
151
|
+
provide: AXPPageLayoutBase,
|
|
152
|
+
useExisting: AXMProfileActivityChartComponent,
|
|
153
|
+
},
|
|
154
|
+
], template: "<div class=\"__panel\" *translate=\"let t\">\n <header class=\"__header\">\n <div class=\"__title-row\">\n <h3 class=\"__title\">{{ '@auth:profile-page.components.activity-chart.title' | translate | async }}</h3>\n <ax-icon icon=\"fa-light fa-circle-info\" class=\"__info-icon\"></ax-icon>\n </div>\n <span class=\"__context\">{{ '@auth:profile-page.components.activity-chart.context' | translate | async }}</span>\n </header>\n\n <dl class=\"__stats\">\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.longest-streak' | translate | async }}</dt>\n <dd>\n <strong>{{ stats().longestStreak }}</strong>\n {{ '@auth:profile-page.components.activity-chart.stats.days' | translate | async }}\n </dd>\n </div>\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.avg-day' | translate | async }}</dt>\n <dd>{{ formatCount(stats().avgPerDay) }}</dd>\n </div>\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.avg-week' | translate | async }}</dt>\n <dd>{{ formatCount(stats().avgPerWeek) }}</dd>\n </div>\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.total' | translate | async }}</dt>\n <dd>{{ formatCount(stats().total) }}</dd>\n </div>\n </dl>\n\n <div class=\"__heatmap-wrap\">\n <div class=\"__month-labels\" aria-hidden=\"true\">\n @for (month of monthLabels(); track month.key) {\n <span class=\"__month-label\" [style.grid-column-start]=\"month.weekIndex + 2\">{{ month.label }}</span>\n }\n </div>\n\n <div class=\"__heatmap\">\n <div class=\"__weekday-labels\" aria-hidden=\"true\">\n @for (label of weekdayLabels; track label) {\n <span class=\"__weekday-label\" [style.grid-row]=\"weekdayRowIndex(label)\">{{ label }}</span>\n }\n </div>\n\n <div class=\"__grid\" role=\"img\" [attr.aria-label]=\"'@auth:profile-page.components.activity-chart.aria-label' | translate | async\">\n @for (week of weeks(); track $index) {\n @for (day of week.days; track day.date.getTime()) {\n <span\n class=\"__cell\"\n [class.--level-0]=\"day.level === 0\"\n [class.--level-1]=\"day.level === 1\"\n [class.--level-2]=\"day.level === 2\"\n [class.--level-3]=\"day.level === 3\"\n [class.--level-4]=\"day.level === 4\"\n [attr.title]=\"cellTitle(day)\"\n ></span>\n }\n }\n </div>\n </div>\n </div>\n\n <footer class=\"__legend\" aria-hidden=\"true\">\n <span class=\"__legend-label\">{{ '@auth:profile-page.components.activity-chart.legend.less' | translate | async }}</span>\n @for (level of intensityLevels; track level) {\n <span class=\"__legend-cell\" [class]=\"'--level-' + level\"></span>\n }\n <span class=\"__legend-label\">{{ '@auth:profile-page.components.activity-chart.legend.more' | translate | async }}</span>\n </footer>\n</div>\n", styles: ["@layer properties;.axm-profile-activity-chart{display:block;width:100%}.axm-profile-activity-chart .__panel{width:100%;border-radius:var(--radius-2xl, 1rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-lightest);color:var(--color-on-lightest);border-color:var(--color-border-lightest);padding:calc(var(--spacing, .25rem) * 6);--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:rgb(var(--ax-sys-color-border-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface))}.axm-profile-activity-chart .__header{margin-bottom:calc(var(--spacing, .25rem) * 5);display:flex;align-items:flex-start;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 4)}.axm-profile-activity-chart .__title-row{display:inline-flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2)}.axm-profile-activity-chart .__title{margin:0;font-size:var(--text-lg, 1.125rem);line-height:var(--tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);color:rgb(var(--ax-sys-color-on-lightest-surface))}.axm-profile-activity-chart .__info-icon{opacity:50%;color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__context{font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__stats{margin-bottom:calc(var(--spacing, .25rem) * 6);display:grid;gap:calc(var(--spacing, .25rem) * 4);grid-template-columns:repeat(2,minmax(0,1fr))}@media(min-width:768px){.axm-profile-activity-chart .__stats{grid-template-columns:repeat(4,minmax(0,1fr))}}.axm-profile-activity-chart .__stat{min-width:0}.axm-profile-activity-chart .__stat dt{margin-bottom:var(--spacing, .25rem);font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__stat dd{margin:0;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:rgb(var(--ax-sys-color-on-lightest-surface))}.axm-profile-activity-chart .__stat dd strong{--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700)}.axm-profile-activity-chart .__heatmap-wrap{width:100%;overflow-x:auto;padding-bottom:calc(var(--spacing, .25rem) * 2)}.axm-profile-activity-chart .__month-labels{margin-bottom:calc(var(--spacing, .25rem) * 2);display:grid;width:100%;gap:var(--spacing, .25rem);grid-template-columns:1.75rem repeat(53,minmax(0,1fr))}.axm-profile-activity-chart .__month-label{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__heatmap{display:grid;width:100%;gap:calc(var(--spacing, .25rem) * 2);grid-template-columns:1.75rem 1fr;align-items:stretch}.axm-profile-activity-chart .__weekday-labels{display:grid;gap:var(--spacing, .25rem);align-self:stretch;grid-template-rows:repeat(7,1fr)}.axm-profile-activity-chart .__weekday-label{display:flex;align-items:center;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__grid{display:grid;width:100%;gap:var(--spacing, .25rem);grid-template-rows:repeat(7,auto);grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}.axm-profile-activity-chart .__cell{width:100%;border-radius:var(--radius-sm, .25rem);aspect-ratio:1}.axm-profile-activity-chart .__cell.--level-0{background:rgb(var(--ax-sys-color-dark-surface))}.axm-profile-activity-chart .__cell.--level-1{background:rgb(var(--ax-sys-color-primary-200))}.axm-profile-activity-chart .__cell.--level-2{background:rgb(var(--ax-sys-color-primary-400))}.axm-profile-activity-chart .__cell.--level-3{background:rgb(var(--ax-sys-color-primary-600))}.axm-profile-activity-chart .__cell.--level-4{background:rgb(var(--ax-sys-color-primary-800))}.axm-profile-activity-chart .__legend{margin-top:calc(var(--spacing, .25rem) * 4);display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 1.5)}.axm-profile-activity-chart .__legend-label{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));color:rgb(var(--ax-sys-color-on-light-surface))}.axm-profile-activity-chart .__legend-cell{width:calc(var(--spacing, .25rem) * 3);height:calc(var(--spacing, .25rem) * 3);border-radius:var(--radius-sm, .25rem)}.axm-profile-activity-chart .__legend-cell.--level-0{background:rgb(var(--ax-sys-color-dark-surface))}.axm-profile-activity-chart .__legend-cell.--level-1{background:rgb(var(--ax-sys-color-primary-200))}.axm-profile-activity-chart .__legend-cell.--level-2{background:rgb(var(--ax-sys-color-primary-400))}.axm-profile-activity-chart .__legend-cell.--level-3{background:rgb(var(--ax-sys-color-primary-600))}.axm-profile-activity-chart .__legend-cell.--level-4{background:rgb(var(--ax-sys-color-primary-800))}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
155
|
+
}], propDecorators: { rootContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootContext", required: false }] }], pageConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageConfig", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
156
|
+
|
|
157
|
+
export { AXMProfileActivityChartComponent };
|
|
158
|
+
//# sourceMappingURL=acorex-platform-module-auth-client-profile-activity-chart.component-B8lBvZsA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-auth-client-profile-activity-chart.component-B8lBvZsA.mjs","sources":["../../../../libs/modules/auth/client/src/lib/pages/account/profile-page/components/profile-activity-chart/profile-activity-chart.component.ts","../../../../libs/modules/auth/client/src/lib/pages/account/profile-page/components/profile-activity-chart/profile-activity-chart.component.html"],"sourcesContent":["import { AXDataSourceFilterOption } from '@acorex/cdk/common';\nimport { AXPDataSourceDefinitionProviderService } from '@acorex-platform/framework-client/core';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPPageLayoutBase, AXPPageLayoutBaseComponent } from '@acorex-platform/framework-client/layout/views';\nimport { AsyncPipe, CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { isEmpty } from 'lodash';\nimport { AXMAuthDataSourceKeys } from '@acorex-platform/module-auth-client/contracts';\nimport {\n AXPUserActivityLevel,\n AXPUserActivityStats,\n AXPUserActivityWeek,\n formatCompactActivityCount,\n resolveDefaultUserActivityDateRange,\n} from '../../../../../shared/datasources/user-activity';\n\n//#region ---- View types ----\n\ninterface ActivityDay {\n date: Date;\n count: number;\n level: AXPUserActivityLevel;\n}\n\ninterface ActivityWeek {\n days: ActivityDay[];\n}\n\n//#endregion\n\n//#region ---- Component ----\n\n/** Contribution-style activity heatmap for the profile Activity tab. */\n@Component({\n selector: 'axm-profile-activity-chart',\n imports: [CommonModule, AsyncPipe, AXDecoratorModule, AXTranslationModule],\n templateUrl: './profile-activity-chart.component.html',\n styleUrl: './profile-activity-chart.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'axm-profile-activity-chart' },\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMProfileActivityChartComponent,\n },\n ],\n})\nexport class AXMProfileActivityChartComponent extends AXPPageLayoutBaseComponent {\n //#region ---- Inputs ----\n\n rootContext = input<Record<string, unknown>>({});\n pageConfig = input<Record<string, unknown>>();\n options = input<Record<string, unknown>>({});\n\n //#endregion\n\n //#region ---- Services & Dependencies ----\n\n private readonly dataSourceDefinitionService = inject(AXPDataSourceDefinitionProviderService);\n\n //#endregion\n\n //#region ---- State ----\n\n protected readonly weeks = signal<ActivityWeek[]>([]);\n protected readonly stats = signal<AXPUserActivityStats>({\n longestStreak: 0,\n avgPerDay: 0,\n avgPerWeek: 0,\n total: 0,\n });\n protected readonly isLoading = signal(true);\n\n protected readonly weekdayLabels = ['M', 'W', 'F'];\n protected readonly intensityLevels: Array<AXPUserActivityLevel> = [0, 1, 2, 3, 4];\n\n //#endregion\n\n //#region ---- Derived state ----\n\n protected readonly dataSourceName = computed(\n () => (this.options()['dataSource'] as string | undefined) ?? AXMAuthDataSourceKeys.UserActivity,\n );\n\n protected readonly monthLabels = computed(() => {\n const labels: { key: string; label: string; weekIndex: number }[] = [];\n let lastMonth = -1;\n\n this.weeks().forEach((week, weekIndex) => {\n const firstDay = week.days[0];\n const month = firstDay.date.getMonth();\n if (month !== lastMonth) {\n labels.push({\n key: `${firstDay.date.getFullYear()}-${month}`,\n label: firstDay.date.toLocaleString('en-US', { month: 'short' }),\n weekIndex,\n });\n lastMonth = month;\n }\n });\n\n return labels;\n });\n\n //#endregion\n\n //#region ---- Effects ----\n\n #loadActivityEffect = effect(() => {\n const userId = this.sessionService.user?.id;\n const dataSourceName = this.dataSourceName();\n void this.loadActivity(userId, dataSourceName);\n });\n\n //#endregion\n\n //#region ---- Data loading ----\n\n private async loadActivity(userId: string | undefined, dataSourceName: string): Promise<void> {\n this.isLoading.set(true);\n\n try {\n if (isEmpty(userId)) {\n this.weeks.set([]);\n this.stats.set({ longestStreak: 0, avgPerDay: 0, avgPerWeek: 0, total: 0 });\n return;\n }\n\n const definition = await this.dataSourceDefinitionService.get(dataSourceName);\n if (!definition) {\n this.weeks.set([]);\n this.stats.set({ longestStreak: 0, avgPerDay: 0, avgPerWeek: 0, total: 0 });\n return;\n }\n\n const { startDate, endDate } = resolveDefaultUserActivityDateRange();\n const sourceResult = definition.source();\n const dataSource = sourceResult instanceof Promise ? await sourceResult : sourceResult;\n const page = await dataSource.config.load({\n take: 1,\n skip: 0,\n sort: [],\n filter: {\n logic: 'and',\n filters: [\n { field: 'userId', operator: { type: 'equal' }, value: userId },\n { field: 'startDate', operator: { type: 'gte' }, value: startDate },\n { field: 'endDate', operator: { type: 'lte' }, value: endDate },\n ],\n } as AXDataSourceFilterOption,\n });\n\n const item = page.items?.[0];\n if (!item) {\n this.weeks.set([]);\n this.stats.set({ longestStreak: 0, avgPerDay: 0, avgPerWeek: 0, total: 0 });\n return;\n }\n\n this.weeks.set(\n item.weeks.map((week: AXPUserActivityWeek) => ({\n days: week.days.map((day) => ({\n date: new Date(day.date),\n count: day.count,\n level: day.level,\n })),\n })),\n );\n this.stats.set(item.stats);\n } finally {\n this.isLoading.set(false);\n }\n }\n\n //#endregion\n\n //#region ---- UI helpers ----\n\n protected formatCount(value: number): string {\n return formatCompactActivityCount(value);\n }\n\n protected weekdayRowIndex(label: string): number {\n if (label === 'M') {\n return 1;\n }\n if (label === 'W') {\n return 3;\n }\n return 5;\n }\n\n protected cellTitle(day: ActivityDay): string {\n return `${day.date.toLocaleDateString()} — ${day.count}`;\n }\n\n //#endregion\n}\n\n//#endregion\n","<div class=\"__panel\" *translate=\"let t\">\n <header class=\"__header\">\n <div class=\"__title-row\">\n <h3 class=\"__title\">{{ '@auth:profile-page.components.activity-chart.title' | translate | async }}</h3>\n <ax-icon icon=\"fa-light fa-circle-info\" class=\"__info-icon\"></ax-icon>\n </div>\n <span class=\"__context\">{{ '@auth:profile-page.components.activity-chart.context' | translate | async }}</span>\n </header>\n\n <dl class=\"__stats\">\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.longest-streak' | translate | async }}</dt>\n <dd>\n <strong>{{ stats().longestStreak }}</strong>\n {{ '@auth:profile-page.components.activity-chart.stats.days' | translate | async }}\n </dd>\n </div>\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.avg-day' | translate | async }}</dt>\n <dd>{{ formatCount(stats().avgPerDay) }}</dd>\n </div>\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.avg-week' | translate | async }}</dt>\n <dd>{{ formatCount(stats().avgPerWeek) }}</dd>\n </div>\n <div class=\"__stat\">\n <dt>{{ '@auth:profile-page.components.activity-chart.stats.total' | translate | async }}</dt>\n <dd>{{ formatCount(stats().total) }}</dd>\n </div>\n </dl>\n\n <div class=\"__heatmap-wrap\">\n <div class=\"__month-labels\" aria-hidden=\"true\">\n @for (month of monthLabels(); track month.key) {\n <span class=\"__month-label\" [style.grid-column-start]=\"month.weekIndex + 2\">{{ month.label }}</span>\n }\n </div>\n\n <div class=\"__heatmap\">\n <div class=\"__weekday-labels\" aria-hidden=\"true\">\n @for (label of weekdayLabels; track label) {\n <span class=\"__weekday-label\" [style.grid-row]=\"weekdayRowIndex(label)\">{{ label }}</span>\n }\n </div>\n\n <div class=\"__grid\" role=\"img\" [attr.aria-label]=\"'@auth:profile-page.components.activity-chart.aria-label' | translate | async\">\n @for (week of weeks(); track $index) {\n @for (day of week.days; track day.date.getTime()) {\n <span\n class=\"__cell\"\n [class.--level-0]=\"day.level === 0\"\n [class.--level-1]=\"day.level === 1\"\n [class.--level-2]=\"day.level === 2\"\n [class.--level-3]=\"day.level === 3\"\n [class.--level-4]=\"day.level === 4\"\n [attr.title]=\"cellTitle(day)\"\n ></span>\n }\n }\n </div>\n </div>\n </div>\n\n <footer class=\"__legend\" aria-hidden=\"true\">\n <span class=\"__legend-label\">{{ '@auth:profile-page.components.activity-chart.legend.less' | translate | async }}</span>\n @for (level of intensityLevels; track level) {\n <span class=\"__legend-cell\" [class]=\"'--level-' + level\"></span>\n }\n <span class=\"__legend-label\">{{ '@auth:profile-page.components.activity-chart.legend.more' | translate | async }}</span>\n </footer>\n</div>\n"],"names":["i3"],"mappings":";;;;;;;;;;;;;;AAsCA;AAEA;AAEA;AAgBM,MAAO,gCAAiC,SAAQ,0BAA0B,CAAA;AAfhF,IAAA,WAAA,GAAA;;;AAkBE,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAA0B,EAAE,kFAAC;QAChD,IAAA,CAAA,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA2B;AAC7C,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA0B,EAAE,8EAAC;;;AAM3B,QAAA,IAAA,CAAA,2BAA2B,GAAG,MAAM,CAAC,sCAAsC,CAAC;;;AAM1E,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAiB,EAAE,4EAAC;QAClC,IAAA,CAAA,KAAK,GAAG,MAAM,CAAuB;AACtD,YAAA,aAAa,EAAE,CAAC;AAChB,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,UAAU,EAAE,CAAC;AACb,YAAA,KAAK,EAAE,CAAC;AACT,SAAA,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;AACiB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,IAAI,gFAAC;QAExB,IAAA,CAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAC/B,QAAA,IAAA,CAAA,eAAe,GAAgC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC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AA,2uOAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AXToastService } from '@acorex/components/toast';
|
|
2
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, Injectable } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ---- Profile coming-soon command ----
|
|
8
|
+
/** Shows a translated toast for profile actions that are not implemented yet. */
|
|
9
|
+
class AXPProfileComingSoonCommand {
|
|
10
|
+
constructor() {
|
|
11
|
+
//#region ---- Services & Dependencies ----
|
|
12
|
+
this.toastService = inject(AXToastService);
|
|
13
|
+
this.translateService = inject(AXTranslationService);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region ---- Command ----
|
|
17
|
+
async execute(input) {
|
|
18
|
+
const text = await this.translateService.translateAsync(input.messageKey);
|
|
19
|
+
this.toastService.show({ color: 'primary', title: text });
|
|
20
|
+
return { success: true };
|
|
21
|
+
}
|
|
22
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPProfileComingSoonCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
23
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPProfileComingSoonCommand, providedIn: 'root' }); }
|
|
24
|
+
}
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPProfileComingSoonCommand, decorators: [{
|
|
26
|
+
type: Injectable,
|
|
27
|
+
args: [{ providedIn: 'root' }]
|
|
28
|
+
}] });
|
|
29
|
+
|
|
30
|
+
export { AXPProfileComingSoonCommand };
|
|
31
|
+
//# sourceMappingURL=acorex-platform-module-auth-client-profile-coming-soon.command-DBbFbzAx.mjs.map
|
package/fesm2022/acorex-platform-module-auth-client-profile-coming-soon.command-DBbFbzAx.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-auth-client-profile-coming-soon.command-DBbFbzAx.mjs","sources":["../../../../libs/modules/auth/client/src/lib/commands/profile-coming-soon.command.ts"],"sourcesContent":["import { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPExecuteCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { inject, Injectable } from '@angular/core';\n\n//#region ---- Types ----\n\nexport interface AXPProfileComingSoonInput {\n messageKey: string;\n}\n\n//#endregion\n\n//#region ---- Profile coming-soon command ----\n\n/** Shows a translated toast for profile actions that are not implemented yet. */\n@Injectable({ providedIn: 'root' })\nexport class AXPProfileComingSoonCommand implements AXPCommand<AXPProfileComingSoonInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly toastService = inject(AXToastService);\n private readonly translateService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(input: AXPProfileComingSoonInput): Promise<AXPExecuteCommandResult<void>> {\n const text = await this.translateService.translateAsync(input.messageKey);\n this.toastService.show({ color: 'primary', title: text });\n return { success: true };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAaA;AAEA;AAEA;MAEa,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAajE,IAAA;;;IAPC,MAAM,OAAO,CAAC,KAAgC,EAAA;AAC5C,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC;AACzE,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzD,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;IAC1B;8GAdW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as i1$1 from '@acorex/components/button';
|
|
2
|
+
import { AXButtonModule } from '@acorex/components/button';
|
|
3
|
+
import * as i7 from '@acorex/components/check-box';
|
|
4
|
+
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
|
5
|
+
import * as i3 from '@acorex/components/decorators';
|
|
6
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
7
|
+
import * as i2 from '@acorex/core/translation';
|
|
8
|
+
import { AXTranslationModule } from '@acorex/core/translation';
|
|
9
|
+
import { AXPPageLayoutBaseComponent, AXPPageLayoutBase } from '@acorex-platform/framework-client/layout/views';
|
|
10
|
+
import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
|
|
11
|
+
import * as i4 from '@angular/common';
|
|
12
|
+
import { CommonModule, AsyncPipe } from '@angular/common';
|
|
13
|
+
import * as i0 from '@angular/core';
|
|
14
|
+
import { input, inject, signal, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
15
|
+
import * as i1 from '@angular/forms';
|
|
16
|
+
import { FormsModule } from '@angular/forms';
|
|
17
|
+
import { AXMAuthCommandKeys } from '@acorex-platform/module-auth-client/contracts';
|
|
18
|
+
|
|
19
|
+
//#region ---- Component ----
|
|
20
|
+
/** Danger-zone UI for permanently deleting the current user's account. */
|
|
21
|
+
class AXMProfileDeleteAccountDangerZoneComponent extends AXPPageLayoutBaseComponent {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
//#region ---- Inputs ----
|
|
25
|
+
this.rootContext = input({}, ...(ngDevMode ? [{ debugName: "rootContext" }] : /* istanbul ignore next */ []));
|
|
26
|
+
this.pageConfig = input(...(ngDevMode ? [undefined, { debugName: "pageConfig" }] : /* istanbul ignore next */ []));
|
|
27
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ---- Services & Dependencies ----
|
|
30
|
+
this.commandService = inject(AXPCommandService);
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region ---- State ----
|
|
33
|
+
this.acknowledged = signal(false, ...(ngDevMode ? [{ debugName: "acknowledged" }] : /* istanbul ignore next */ []));
|
|
34
|
+
this.isDeleting = signal(false, ...(ngDevMode ? [{ debugName: "isDeleting" }] : /* istanbul ignore next */ []));
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region ---- UI Handlers ----
|
|
38
|
+
async handleDeleteAccount() {
|
|
39
|
+
if (!this.acknowledged() || this.isDeleting()) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.isDeleting.set(true);
|
|
43
|
+
try {
|
|
44
|
+
await this.commandService.execute(AXMAuthCommandKeys.Profile.ComingSoon, {
|
|
45
|
+
messageKey: '@auth:profile-page.commands.delete-my-account.coming-soon',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
this.isDeleting.set(false);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMProfileDeleteAccountDangerZoneComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
53
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: AXMProfileDeleteAccountDangerZoneComponent, isStandalone: true, selector: "axm-profile-delete-account-danger-zone", inputs: { rootContext: { classPropertyName: "rootContext", publicName: "rootContext", isSignal: true, isRequired: false, transformFunction: null }, pageConfig: { classPropertyName: "pageConfig", publicName: "pageConfig", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "axm-profile-delete-account-danger-zone" }, providers: [
|
|
54
|
+
{
|
|
55
|
+
provide: AXPPageLayoutBase,
|
|
56
|
+
useExisting: AXMProfileDeleteAccountDangerZoneComponent,
|
|
57
|
+
},
|
|
58
|
+
], usesInheritance: true, ngImport: i0, template: "<section class=\"__zone\" *translate=\"let t\">\n <header class=\"__header\">\n <div class=\"__icon\">\n <ax-icon icon=\"fa-light fa-triangle-exclamation\"></ax-icon>\n </div>\n <div class=\"__copy\">\n <h3 class=\"__title\">{{ '@auth:profile-page.components.delete-account.title' | translate | async }}</h3>\n <p class=\"__description\">{{ '@auth:profile-page.components.delete-account.description' | translate | async }}</p>\n </div>\n </header>\n\n <ul class=\"__warnings\">\n <li>{{ '@auth:profile-page.components.delete-account.warnings.data' | translate | async }}</li>\n <li>{{ '@auth:profile-page.components.delete-account.warnings.access' | translate | async }}</li>\n <li>{{ '@auth:profile-page.components.delete-account.warnings.irreversible' | translate | async }}</li>\n </ul>\n\n <label class=\"__acknowledge\">\n <ax-check-box [ngModel]=\"acknowledged()\" (ngModelChange)=\"acknowledged.set($event)\"></ax-check-box>\n <span>{{ '@auth:profile-page.components.delete-account.acknowledge' | translate | async }}</span>\n </label>\n\n <div class=\"__actions\">\n <ax-button\n color=\"danger\"\n [disabled]=\"!acknowledged() || isDeleting()\"\n [text]=\"'@auth:profile-page.components.delete-account.actions.delete' | translate | async\"\n (onClick)=\"handleDeleteAccount()\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-trash\"></ax-icon>\n </ax-prefix>\n </ax-button>\n </div>\n</section>\n", styles: ["@layer properties;.axm-profile-delete-account-danger-zone .__zone{display:flex;height:100%;flex-direction:column;gap:calc(var(--spacing, .25rem) * 5);border-radius:var(--radius-2xl, 1rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-danger-lightest);color:var(--color-on-danger-lightest);border-color:var(--color-border-danger-lightest);padding:calc(var(--spacing, .25rem) * 6);--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:rgba(var(--ax-sys-color-danger-50))}.axm-profile-delete-account-danger-zone .__header{display:flex;align-items:flex-start;gap:calc(var(--spacing, .25rem) * 4)}.axm-profile-delete-account-danger-zone .__icon{display:flex;width:calc(var(--spacing, .25rem) * 12);height:calc(var(--spacing, .25rem) * 12);flex-shrink:0;align-items:center;justify-content:center;border-radius:var(--radius-xl, .75rem);background:rgb(var(--ax-sys-color-danger-lighter-surface));color:rgb(var(--ax-sys-color-danger-600));border:1px solid rgb(var(--ax-sys-color-border-danger-lighter-surface))}.axm-profile-delete-account-danger-zone .__title{margin:0;font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);color:rgb(var(--ax-sys-color-on-danger-lightest-surface))}.axm-profile-delete-account-danger-zone .__description{margin-top:calc(var(--spacing, .25rem) * 1.5);margin-bottom:0;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: var(--leading-relaxed, 1.625);line-height:var(--leading-relaxed, 1.625);color:rgb(var(--ax-sys-color-on-danger-lightest-surface) / .88)}.axm-profile-delete-account-danger-zone .__warnings{margin:0;margin-inline-start:calc(var(--spacing, .25rem) * 5);list-style-type:disc;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgb(var(--ax-sys-color-on-danger-lightest-surface) / .92)}:where(.axm-profile-delete-account-danger-zone .__warnings>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(var(--spacing, .25rem) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing, .25rem) * calc(1 - var(--tw-space-y-reverse)))}.axm-profile-delete-account-danger-zone .__acknowledge{display:inline-flex;cursor:pointer;align-items:center;gap:calc(var(--spacing, .25rem) * 3);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgb(var(--ax-sys-color-on-danger-lightest-surface))}.axm-profile-delete-account-danger-zone .__actions{margin-top:auto}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-leading{syntax: \"*\"; inherits: false;}@property --tw-space-y-reverse{syntax: \"*\"; inherits: false; initial-value: 0;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-font-weight: initial;--tw-leading: initial;--tw-space-y-reverse: 0}}}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "component", type: i7.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "isLoading", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i2.AXTranslatorDirective, selector: "[translate]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
59
|
+
}
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMProfileDeleteAccountDangerZoneComponent, decorators: [{
|
|
61
|
+
type: Component,
|
|
62
|
+
args: [{ selector: 'axm-profile-delete-account-danger-zone', imports: [
|
|
63
|
+
CommonModule,
|
|
64
|
+
AsyncPipe,
|
|
65
|
+
FormsModule,
|
|
66
|
+
AXButtonModule,
|
|
67
|
+
AXCheckBoxModule,
|
|
68
|
+
AXDecoratorModule,
|
|
69
|
+
AXTranslationModule,
|
|
70
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { class: 'axm-profile-delete-account-danger-zone' }, providers: [
|
|
71
|
+
{
|
|
72
|
+
provide: AXPPageLayoutBase,
|
|
73
|
+
useExisting: AXMProfileDeleteAccountDangerZoneComponent,
|
|
74
|
+
},
|
|
75
|
+
], template: "<section class=\"__zone\" *translate=\"let t\">\n <header class=\"__header\">\n <div class=\"__icon\">\n <ax-icon icon=\"fa-light fa-triangle-exclamation\"></ax-icon>\n </div>\n <div class=\"__copy\">\n <h3 class=\"__title\">{{ '@auth:profile-page.components.delete-account.title' | translate | async }}</h3>\n <p class=\"__description\">{{ '@auth:profile-page.components.delete-account.description' | translate | async }}</p>\n </div>\n </header>\n\n <ul class=\"__warnings\">\n <li>{{ '@auth:profile-page.components.delete-account.warnings.data' | translate | async }}</li>\n <li>{{ '@auth:profile-page.components.delete-account.warnings.access' | translate | async }}</li>\n <li>{{ '@auth:profile-page.components.delete-account.warnings.irreversible' | translate | async }}</li>\n </ul>\n\n <label class=\"__acknowledge\">\n <ax-check-box [ngModel]=\"acknowledged()\" (ngModelChange)=\"acknowledged.set($event)\"></ax-check-box>\n <span>{{ '@auth:profile-page.components.delete-account.acknowledge' | translate | async }}</span>\n </label>\n\n <div class=\"__actions\">\n <ax-button\n color=\"danger\"\n [disabled]=\"!acknowledged() || isDeleting()\"\n [text]=\"'@auth:profile-page.components.delete-account.actions.delete' | translate | async\"\n (onClick)=\"handleDeleteAccount()\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-trash\"></ax-icon>\n </ax-prefix>\n </ax-button>\n </div>\n</section>\n", styles: ["@layer properties;.axm-profile-delete-account-danger-zone .__zone{display:flex;height:100%;flex-direction:column;gap:calc(var(--spacing, .25rem) * 5);border-radius:var(--radius-2xl, 1rem);border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-danger-lightest);color:var(--color-on-danger-lightest);border-color:var(--color-border-danger-lightest);padding:calc(var(--spacing, .25rem) * 6);--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:rgba(var(--ax-sys-color-danger-50))}.axm-profile-delete-account-danger-zone .__header{display:flex;align-items:flex-start;gap:calc(var(--spacing, .25rem) * 4)}.axm-profile-delete-account-danger-zone .__icon{display:flex;width:calc(var(--spacing, .25rem) * 12);height:calc(var(--spacing, .25rem) * 12);flex-shrink:0;align-items:center;justify-content:center;border-radius:var(--radius-xl, .75rem);background:rgb(var(--ax-sys-color-danger-lighter-surface));color:rgb(var(--ax-sys-color-danger-600));border:1px solid rgb(var(--ax-sys-color-border-danger-lighter-surface))}.axm-profile-delete-account-danger-zone .__title{margin:0;font-size:var(--text-base, 1rem);line-height:var(--tw-leading, var(--text-base--line-height, 1.5 ));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);color:rgb(var(--ax-sys-color-on-danger-lightest-surface))}.axm-profile-delete-account-danger-zone .__description{margin-top:calc(var(--spacing, .25rem) * 1.5);margin-bottom:0;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-leading: var(--leading-relaxed, 1.625);line-height:var(--leading-relaxed, 1.625);color:rgb(var(--ax-sys-color-on-danger-lightest-surface) / .88)}.axm-profile-delete-account-danger-zone .__warnings{margin:0;margin-inline-start:calc(var(--spacing, .25rem) * 5);list-style-type:disc;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgb(var(--ax-sys-color-on-danger-lightest-surface) / .92)}:where(.axm-profile-delete-account-danger-zone .__warnings>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(var(--spacing, .25rem) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing, .25rem) * calc(1 - var(--tw-space-y-reverse)))}.axm-profile-delete-account-danger-zone .__acknowledge{display:inline-flex;cursor:pointer;align-items:center;gap:calc(var(--spacing, .25rem) * 3);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:rgb(var(--ax-sys-color-on-danger-lightest-surface))}.axm-profile-delete-account-danger-zone .__actions{margin-top:auto}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-leading{syntax: \"*\"; inherits: false;}@property --tw-space-y-reverse{syntax: \"*\"; inherits: false; initial-value: 0;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-font-weight: initial;--tw-leading: initial;--tw-space-y-reverse: 0}}}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
76
|
+
}], propDecorators: { rootContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootContext", required: false }] }], pageConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageConfig", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
77
|
+
|
|
78
|
+
export { AXMProfileDeleteAccountDangerZoneComponent };
|
|
79
|
+
//# sourceMappingURL=acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-CtJho4ab.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-CtJho4ab.mjs","sources":["../../../../libs/modules/auth/client/src/lib/pages/account/profile-page/components/profile-delete-account-danger-zone/profile-delete-account-danger-zone.component.ts","../../../../libs/modules/auth/client/src/lib/pages/account/profile-page/components/profile-delete-account-danger-zone/profile-delete-account-danger-zone.component.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXCheckBoxModule } from '@acorex/components/check-box';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPPageLayoutBase, AXPPageLayoutBaseComponent } from '@acorex-platform/framework-client/layout/views';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { AsyncPipe, CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AXMAuthCommandKeys } from '@acorex-platform/module-auth-client/contracts';\n\n//#region ---- Component ----\n\n/** Danger-zone UI for permanently deleting the current user's account. */\n@Component({\n selector: 'axm-profile-delete-account-danger-zone',\n imports: [\n CommonModule,\n AsyncPipe,\n FormsModule,\n AXButtonModule,\n AXCheckBoxModule,\n AXDecoratorModule,\n AXTranslationModule,\n ],\n templateUrl: './profile-delete-account-danger-zone.component.html',\n styleUrl: './profile-delete-account-danger-zone.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'axm-profile-delete-account-danger-zone' },\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMProfileDeleteAccountDangerZoneComponent,\n },\n ],\n})\nexport class AXMProfileDeleteAccountDangerZoneComponent extends AXPPageLayoutBaseComponent {\n //#region ---- Inputs ----\n\n rootContext = input<Record<string, unknown>>({});\n pageConfig = input<Record<string, unknown>>();\n options = input<Record<string, unknown>>({});\n\n //#endregion\n\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n\n //#endregion\n\n //#region ---- State ----\n\n protected readonly acknowledged = signal(false);\n protected readonly isDeleting = signal(false);\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n protected async handleDeleteAccount(): Promise<void> {\n if (!this.acknowledged() || this.isDeleting()) {\n return;\n }\n\n this.isDeleting.set(true);\n try {\n await this.commandService.execute(AXMAuthCommandKeys.Profile.ComingSoon, {\n messageKey: '@auth:profile-page.commands.delete-my-account.coming-soon',\n });\n } finally {\n this.isDeleting.set(false);\n }\n }\n\n //#endregion\n}\n\n//#endregion\n","<section class=\"__zone\" *translate=\"let t\">\n <header class=\"__header\">\n <div class=\"__icon\">\n <ax-icon icon=\"fa-light fa-triangle-exclamation\"></ax-icon>\n </div>\n <div class=\"__copy\">\n <h3 class=\"__title\">{{ '@auth:profile-page.components.delete-account.title' | translate | async }}</h3>\n <p class=\"__description\">{{ '@auth:profile-page.components.delete-account.description' | translate | async }}</p>\n </div>\n </header>\n\n <ul class=\"__warnings\">\n <li>{{ '@auth:profile-page.components.delete-account.warnings.data' | translate | async }}</li>\n <li>{{ '@auth:profile-page.components.delete-account.warnings.access' | translate | async }}</li>\n <li>{{ '@auth:profile-page.components.delete-account.warnings.irreversible' | translate | async }}</li>\n </ul>\n\n <label class=\"__acknowledge\">\n <ax-check-box [ngModel]=\"acknowledged()\" (ngModelChange)=\"acknowledged.set($event)\"></ax-check-box>\n <span>{{ '@auth:profile-page.components.delete-account.acknowledge' | translate | async }}</span>\n </label>\n\n <div class=\"__actions\">\n <ax-button\n color=\"danger\"\n [disabled]=\"!acknowledged() || isDeleting()\"\n [text]=\"'@auth:profile-page.components.delete-account.actions.delete' | translate | async\"\n (onClick)=\"handleDeleteAccount()\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-trash\"></ax-icon>\n </ax-prefix>\n </ax-button>\n </div>\n</section>\n"],"names":["i2","i3","i4","i5","i6"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA;AAEA;AAwBM,MAAO,0CAA2C,SAAQ,0BAA0B,CAAA;AAvB1F,IAAA,WAAA,GAAA;;;AA0BE,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAA0B,EAAE,kFAAC;QAChD,IAAA,CAAA,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA2B;AAC7C,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA0B,EAAE,8EAAC;;;AAM3B,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;;AAMxC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,KAAK,mFAAC;AAC5B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,KAAK,iFAAC;AAsB9C,IAAA;;;AAhBW,IAAA,MAAM,mBAAmB,GAAA;QACjC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE;YAC7C;QACF;AAEA,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;AACzB,QAAA,IAAI;YACF,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAAE;AACvE,gBAAA,UAAU,EAAE,2DAA2D;AACxE,aAAA,CA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AAA,EAAA,QAAA,EAAA,g+CAAA,EAAA,MAAA,EAAA,CAAA,66JAAA,CAAA,EAAA;;;;;"}
|
package/fesm2022/acorex-platform-module-auth-client-profile-page-component.provider-B-Qtd4_j.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import { d as PROFILE_ACTIVITY_CHART_COMPONENT_KEY, e as PROFILE_DELETE_ACCOUNT_DANGER_ZONE_COMPONENT_KEY } from './acorex-platform-module-auth-client-acorex-platform-module-auth-client-B7tIKOw6.mjs';
|
|
4
|
+
|
|
5
|
+
//#region ---- Profile page component provider ----
|
|
6
|
+
class AXMProfilePageComponentProvider {
|
|
7
|
+
async components() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
key: PROFILE_ACTIVITY_CHART_COMPONENT_KEY,
|
|
11
|
+
loader: () => import('./acorex-platform-module-auth-client-profile-activity-chart.component-B8lBvZsA.mjs').then((module) => module.AXMProfileActivityChartComponent),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
key: PROFILE_DELETE_ACCOUNT_DANGER_ZONE_COMPONENT_KEY,
|
|
15
|
+
loader: () => import('./acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-CtJho4ab.mjs').then((module) => module.AXMProfileDeleteAccountDangerZoneComponent),
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMProfilePageComponentProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
20
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMProfilePageComponentProvider }); }
|
|
21
|
+
}
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMProfilePageComponentProvider, decorators: [{
|
|
23
|
+
type: Injectable
|
|
24
|
+
}] });
|
|
25
|
+
|
|
26
|
+
export { AXMProfilePageComponentProvider };
|
|
27
|
+
//# sourceMappingURL=acorex-platform-module-auth-client-profile-page-component.provider-B-Qtd4_j.mjs.map
|
package/fesm2022/acorex-platform-module-auth-client-profile-page-component.provider-B-Qtd4_j.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-auth-client-profile-page-component.provider-B-Qtd4_j.mjs","sources":["../../../../libs/modules/auth/client/src/lib/pages/account/profile-page/profile-page-component.provider.ts"],"sourcesContent":["import {\n AXPPageComponentDefinition,\n AXPPageComponentProvider,\n} from '@acorex-platform/framework-client/layout/components';\nimport { Injectable } from '@angular/core';\nimport {\n PROFILE_ACTIVITY_CHART_COMPONENT_KEY,\n PROFILE_DELETE_ACCOUNT_DANGER_ZONE_COMPONENT_KEY,\n} from './profile-page.component-keys';\n\n//#region ---- Profile page component provider ----\n\n@Injectable()\nexport class AXMProfilePageComponentProvider implements AXPPageComponentProvider {\n async components(): Promise<AXPPageComponentDefinition[]> {\n return [\n {\n key: PROFILE_ACTIVITY_CHART_COMPONENT_KEY,\n loader: () =>\n import('./components/profile-activity-chart/profile-activity-chart.component').then(\n (module) => module.AXMProfileActivityChartComponent,\n ),\n },\n {\n key: PROFILE_DELETE_ACCOUNT_DANGER_ZONE_COMPONENT_KEY,\n loader: () =>\n import('./components/profile-delete-account-danger-zone/profile-delete-account-danger-zone.component').then(\n (module) => module.AXMProfileDeleteAccountDangerZoneComponent,\n ),\n },\n ];\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAUA;MAGa,+BAA+B,CAAA;AAC1C,IAAA,MAAM,UAAU,GAAA;QACd,OAAO;AACL,YAAA;AACE,gBAAA,GAAG,EAAE,oCAAoC;AACzC,gBAAA,MAAM,EAAE,MACN,OAAO,oFAAsE,CAAC,CAAC,IAAI,CACjF,CAAC,MAAM,KAAK,MAAM,CAAC,gCAAgC,CACpD;AACJ,aAAA;AACD,YAAA;AACE,gBAAA,GAAG,EAAE,gDAAgD;AACrD,gBAAA,MAAM,EAAE,MACN,OAAO,gGAA8F,CAAC,CAAC,IAAI,CACzG,CAAC,MAAM,KAAK,MAAM,CAAC,0CAA0C,CAC9D;AACJ,aAAA;SACF;IACH;8GAlBW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA/B,+BAA+B,EAAA,CAAA,CAAA;;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C;;;;;"}
|