@memberjunction/ng-shared-generic 6.2.0-edge.0 → 6.2.0-edge.2
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/dist/lib/loading/loading.component.d.ts +41 -9
- package/dist/lib/loading/loading.component.d.ts.map +1 -1
- package/dist/lib/loading/loading.component.js +97 -17
- package/dist/lib/loading/loading.component.js.map +1 -1
- package/dist/lib/recent-access.service.d.ts +8 -0
- package/dist/lib/recent-access.service.d.ts.map +1 -1
- package/dist/lib/recent-access.service.js +21 -5
- package/dist/lib/recent-access.service.js.map +1 -1
- package/package.json +7 -7
|
@@ -52,17 +52,29 @@ export declare class LoadingComponent {
|
|
|
52
52
|
* Text to display below the loading animation.
|
|
53
53
|
* Set to empty string or use showText=false to hide text.
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
Text: string;
|
|
56
|
+
/** @deprecated Use {@link Text}. */
|
|
57
|
+
set text(value: LoadingComponent['Text']);
|
|
58
|
+
/** @deprecated Use {@link Text}. */
|
|
59
|
+
get text(): LoadingComponent['Text'];
|
|
56
60
|
/**
|
|
57
61
|
* Whether to show the text below the logo.
|
|
58
62
|
* When false, only the animated logo is shown.
|
|
59
63
|
*/
|
|
60
|
-
|
|
64
|
+
ShowText: boolean;
|
|
65
|
+
/** @deprecated Use {@link ShowText}. */
|
|
66
|
+
set showText(value: LoadingComponent['ShowText']);
|
|
67
|
+
/** @deprecated Use {@link ShowText}. */
|
|
68
|
+
get showText(): LoadingComponent['ShowText'];
|
|
61
69
|
/**
|
|
62
70
|
* Animation duration in seconds.
|
|
63
71
|
* Default is 1.5 seconds for the pulse animation.
|
|
64
72
|
*/
|
|
65
|
-
|
|
73
|
+
AnimationDuration: number;
|
|
74
|
+
/** @deprecated Use {@link AnimationDuration}. */
|
|
75
|
+
set animationDuration(value: LoadingComponent['AnimationDuration']);
|
|
76
|
+
/** @deprecated Use {@link AnimationDuration}. */
|
|
77
|
+
get animationDuration(): LoadingComponent['AnimationDuration'];
|
|
66
78
|
/**
|
|
67
79
|
* Size preset for quick sizing.
|
|
68
80
|
* - 'small': 40x22px logo
|
|
@@ -70,25 +82,41 @@ export declare class LoadingComponent {
|
|
|
70
82
|
* - 'large': 120x67px logo
|
|
71
83
|
* - 'auto': fills container
|
|
72
84
|
*/
|
|
73
|
-
|
|
85
|
+
Size: 'small' | 'medium' | 'large' | 'auto';
|
|
86
|
+
/** @deprecated Use {@link Size}. */
|
|
87
|
+
set size(value: 'small' | 'medium' | 'large' | 'auto');
|
|
88
|
+
/** @deprecated Use {@link Size}. */
|
|
89
|
+
get size(): 'small' | 'medium' | 'large' | 'auto';
|
|
74
90
|
/**
|
|
75
91
|
* CSS color for the loading text.
|
|
76
92
|
* Accepts any valid CSS color value.
|
|
77
93
|
*/
|
|
78
|
-
|
|
94
|
+
TextColor: string;
|
|
95
|
+
/** @deprecated Use {@link TextColor}. */
|
|
96
|
+
set textColor(value: LoadingComponent['TextColor']);
|
|
97
|
+
/** @deprecated Use {@link TextColor}. */
|
|
98
|
+
get textColor(): LoadingComponent['TextColor'];
|
|
79
99
|
/**
|
|
80
100
|
* CSS color for the logo (solid color).
|
|
81
101
|
* Accepts any valid CSS color value.
|
|
82
102
|
* When empty, uses --mj-logo-color CSS variable (adapts to light/dark theme).
|
|
83
103
|
* Ignored if logoGradient is provided.
|
|
84
104
|
*/
|
|
85
|
-
|
|
105
|
+
LogoColor: string;
|
|
106
|
+
/** @deprecated Use {@link LogoColor}. */
|
|
107
|
+
set logoColor(value: LoadingComponent['LogoColor']);
|
|
108
|
+
/** @deprecated Use {@link LogoColor}. */
|
|
109
|
+
get logoColor(): LoadingComponent['LogoColor'];
|
|
86
110
|
/**
|
|
87
111
|
* Gradient configuration for the logo.
|
|
88
112
|
* When provided, creates a linear gradient fill instead of solid color.
|
|
89
113
|
* Takes precedence over logoColor.
|
|
90
114
|
*/
|
|
91
|
-
|
|
115
|
+
LogoGradient: LogoGradient | null;
|
|
116
|
+
/** @deprecated Use {@link LogoGradient}. */
|
|
117
|
+
set logoGradient(value: LogoGradient | null);
|
|
118
|
+
/** @deprecated Use {@link LogoGradient}. */
|
|
119
|
+
get logoGradient(): LogoGradient | null;
|
|
92
120
|
/**
|
|
93
121
|
* Animation type for the logo.
|
|
94
122
|
* - 'pulse': Fade in/out with subtle scale (default)
|
|
@@ -96,7 +124,11 @@ export declare class LoadingComponent {
|
|
|
96
124
|
* - 'bounce': Bounce up and down
|
|
97
125
|
* - 'pulse-spin': Pulse while slowly spinning
|
|
98
126
|
*/
|
|
99
|
-
|
|
127
|
+
Animation: 'pulse' | 'spin' | 'bounce' | 'pulse-spin';
|
|
128
|
+
/** @deprecated Use {@link Animation}. */
|
|
129
|
+
set animation(value: 'pulse' | 'spin' | 'bounce' | 'pulse-spin');
|
|
130
|
+
/** @deprecated Use {@link Animation}. */
|
|
131
|
+
get animation(): 'pulse' | 'spin' | 'bounce' | 'pulse-spin';
|
|
100
132
|
/** Unique ID for the gradient definition to avoid conflicts */
|
|
101
133
|
readonly gradientId: string;
|
|
102
134
|
get logoClass(): string;
|
|
@@ -119,6 +151,6 @@ export declare class LoadingComponent {
|
|
|
119
151
|
y2: string;
|
|
120
152
|
};
|
|
121
153
|
static ɵfac: i0.ɵɵFactoryDeclaration<LoadingComponent, never>;
|
|
122
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LoadingComponent, "mj-loading", never, { "text": { "alias": "text"; "required": false; }; "showText": { "alias": "showText"; "required": false; }; "animationDuration": { "alias": "animationDuration"; "required": false; }; "size": { "alias": "size"; "required": false; }; "textColor": { "alias": "textColor"; "required": false; }; "logoColor": { "alias": "logoColor"; "required": false; }; "logoGradient": { "alias": "logoGradient"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; }, {}, never, never, false, never>;
|
|
154
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LoadingComponent, "mj-loading", never, { "Text": { "alias": "Text"; "required": false; }; "text": { "alias": "text"; "required": false; }; "ShowText": { "alias": "ShowText"; "required": false; }; "showText": { "alias": "showText"; "required": false; }; "AnimationDuration": { "alias": "AnimationDuration"; "required": false; }; "animationDuration": { "alias": "animationDuration"; "required": false; }; "Size": { "alias": "Size"; "required": false; }; "size": { "alias": "size"; "required": false; }; "TextColor": { "alias": "TextColor"; "required": false; }; "textColor": { "alias": "textColor"; "required": false; }; "LogoColor": { "alias": "LogoColor"; "required": false; }; "logoColor": { "alias": "logoColor"; "required": false; }; "LogoGradient": { "alias": "LogoGradient"; "required": false; }; "logoGradient": { "alias": "logoGradient"; "required": false; }; "Animation": { "alias": "Animation"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; }, {}, never, never, false, never>;
|
|
123
155
|
}
|
|
124
156
|
//# sourceMappingURL=loading.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.component.d.ts","sourceRoot":"","sources":["../../../src/lib/loading/loading.component.ts"],"names":[],"mappings":";AAEA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAMa,gBAAgB;IAC3B;;;OAGG;IACM,IAAI,SAAgB;IAE7B;;;OAGG;IACM,QAAQ,UAAQ;IAEzB;;;OAGG;IACM,iBAAiB,SAAO;IAEjC;;;;;;OAMG;IACM,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAU;IAE9D;;;OAGG;IACM,SAAS,SAAM;IAExB;;;;;OAKG;IACM,SAAS,SAAM;IAExB;;;;OAIG;IACM,YAAY,EAAE,YAAY,GAAG,IAAI,CAAQ;IAElD;;;;;;OAMG;IACM,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAW;IAEzE,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,SAAqE;IAExF,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,MAAM,GAAG,IAAI,CAK5B;IAED;;;OAGG;IACH,IAAI,cAAc,IAAI;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAgBvE;
|
|
1
|
+
{"version":3,"file":"loading.component.d.ts","sourceRoot":"","sources":["../../../src/lib/loading/loading.component.ts"],"names":[],"mappings":";AAEA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAMa,gBAAgB;IAC3B;;;OAGG;IACM,IAAI,SAAgB;IAE7B,oCAAoC;IACpC,IAAa,IAAI,CAAC,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAEhD;IACD,oCAAoC;IACpC,IAAI,IAAI,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAEnC;IAED;;;OAGG;IACM,QAAQ,UAAQ;IAEzB,wCAAwC;IACxC,IAAa,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAExD;IACD,wCAAwC;IACxC,IAAI,QAAQ,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAE3C;IAED;;;OAGG;IACM,iBAAiB,SAAO;IAEjC,iDAAiD;IACjD,IAAa,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,CAA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C/D,QAAQ,CAAC,UAAU,SAAqE;IAExF,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,MAAM,GAAG,IAAI,CAK5B;IAED;;;OAGG;IACH,IAAI,cAAc,IAAI;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAgBvE;yCAjLU,gBAAgB;2CAAhB,gBAAgB;CAkL5B"}
|
|
@@ -65,17 +65,41 @@ export class LoadingComponent {
|
|
|
65
65
|
* Text to display below the loading animation.
|
|
66
66
|
* Set to empty string or use showText=false to hide text.
|
|
67
67
|
*/
|
|
68
|
-
|
|
68
|
+
Text = 'Loading...';
|
|
69
|
+
/** @deprecated Use {@link Text}. */
|
|
70
|
+
set text(value) {
|
|
71
|
+
this.Text = value;
|
|
72
|
+
}
|
|
73
|
+
/** @deprecated Use {@link Text}. */
|
|
74
|
+
get text() {
|
|
75
|
+
return this.Text;
|
|
76
|
+
}
|
|
69
77
|
/**
|
|
70
78
|
* Whether to show the text below the logo.
|
|
71
79
|
* When false, only the animated logo is shown.
|
|
72
80
|
*/
|
|
73
|
-
|
|
81
|
+
ShowText = true;
|
|
82
|
+
/** @deprecated Use {@link ShowText}. */
|
|
83
|
+
set showText(value) {
|
|
84
|
+
this.ShowText = value;
|
|
85
|
+
}
|
|
86
|
+
/** @deprecated Use {@link ShowText}. */
|
|
87
|
+
get showText() {
|
|
88
|
+
return this.ShowText;
|
|
89
|
+
}
|
|
74
90
|
/**
|
|
75
91
|
* Animation duration in seconds.
|
|
76
92
|
* Default is 1.5 seconds for the pulse animation.
|
|
77
93
|
*/
|
|
78
|
-
|
|
94
|
+
AnimationDuration = 1.5;
|
|
95
|
+
/** @deprecated Use {@link AnimationDuration}. */
|
|
96
|
+
set animationDuration(value) {
|
|
97
|
+
this.AnimationDuration = value;
|
|
98
|
+
}
|
|
99
|
+
/** @deprecated Use {@link AnimationDuration}. */
|
|
100
|
+
get animationDuration() {
|
|
101
|
+
return this.AnimationDuration;
|
|
102
|
+
}
|
|
79
103
|
/**
|
|
80
104
|
* Size preset for quick sizing.
|
|
81
105
|
* - 'small': 40x22px logo
|
|
@@ -83,25 +107,57 @@ export class LoadingComponent {
|
|
|
83
107
|
* - 'large': 120x67px logo
|
|
84
108
|
* - 'auto': fills container
|
|
85
109
|
*/
|
|
86
|
-
|
|
110
|
+
Size = 'auto';
|
|
111
|
+
/** @deprecated Use {@link Size}. */
|
|
112
|
+
set size(value) {
|
|
113
|
+
this.Size = value;
|
|
114
|
+
}
|
|
115
|
+
/** @deprecated Use {@link Size}. */
|
|
116
|
+
get size() {
|
|
117
|
+
return this.Size;
|
|
118
|
+
}
|
|
87
119
|
/**
|
|
88
120
|
* CSS color for the loading text.
|
|
89
121
|
* Accepts any valid CSS color value.
|
|
90
122
|
*/
|
|
91
|
-
|
|
123
|
+
TextColor = '';
|
|
124
|
+
/** @deprecated Use {@link TextColor}. */
|
|
125
|
+
set textColor(value) {
|
|
126
|
+
this.TextColor = value;
|
|
127
|
+
}
|
|
128
|
+
/** @deprecated Use {@link TextColor}. */
|
|
129
|
+
get textColor() {
|
|
130
|
+
return this.TextColor;
|
|
131
|
+
}
|
|
92
132
|
/**
|
|
93
133
|
* CSS color for the logo (solid color).
|
|
94
134
|
* Accepts any valid CSS color value.
|
|
95
135
|
* When empty, uses --mj-logo-color CSS variable (adapts to light/dark theme).
|
|
96
136
|
* Ignored if logoGradient is provided.
|
|
97
137
|
*/
|
|
98
|
-
|
|
138
|
+
LogoColor = '';
|
|
139
|
+
/** @deprecated Use {@link LogoColor}. */
|
|
140
|
+
set logoColor(value) {
|
|
141
|
+
this.LogoColor = value;
|
|
142
|
+
}
|
|
143
|
+
/** @deprecated Use {@link LogoColor}. */
|
|
144
|
+
get logoColor() {
|
|
145
|
+
return this.LogoColor;
|
|
146
|
+
}
|
|
99
147
|
/**
|
|
100
148
|
* Gradient configuration for the logo.
|
|
101
149
|
* When provided, creates a linear gradient fill instead of solid color.
|
|
102
150
|
* Takes precedence over logoColor.
|
|
103
151
|
*/
|
|
104
|
-
|
|
152
|
+
LogoGradient = null;
|
|
153
|
+
/** @deprecated Use {@link LogoGradient}. */
|
|
154
|
+
set logoGradient(value) {
|
|
155
|
+
this.LogoGradient = value;
|
|
156
|
+
}
|
|
157
|
+
/** @deprecated Use {@link LogoGradient}. */
|
|
158
|
+
get logoGradient() {
|
|
159
|
+
return this.LogoGradient;
|
|
160
|
+
}
|
|
105
161
|
/**
|
|
106
162
|
* Animation type for the logo.
|
|
107
163
|
* - 'pulse': Fade in/out with subtle scale (default)
|
|
@@ -109,17 +165,25 @@ export class LoadingComponent {
|
|
|
109
165
|
* - 'bounce': Bounce up and down
|
|
110
166
|
* - 'pulse-spin': Pulse while slowly spinning
|
|
111
167
|
*/
|
|
112
|
-
|
|
168
|
+
Animation = 'pulse';
|
|
169
|
+
/** @deprecated Use {@link Animation}. */
|
|
170
|
+
set animation(value) {
|
|
171
|
+
this.Animation = value;
|
|
172
|
+
}
|
|
173
|
+
/** @deprecated Use {@link Animation}. */
|
|
174
|
+
get animation() {
|
|
175
|
+
return this.Animation;
|
|
176
|
+
}
|
|
113
177
|
/** Unique ID for the gradient definition to avoid conflicts */
|
|
114
|
-
gradientId = `mj-logo-gradient-${Math.random().toString(36).substring(2, 11)}`;
|
|
178
|
+
gradientId = `mj-logo-gradient-${Math.random().toString(36).substring(2, 11)}`; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
115
179
|
get logoClass() {
|
|
116
|
-
return `mj-loading-logo size-${this.
|
|
180
|
+
return `mj-loading-logo size-${this.Size} animation-${this.Animation}`;
|
|
117
181
|
}
|
|
118
182
|
get logoStyle() {
|
|
119
|
-
return `animation-duration: ${this.
|
|
183
|
+
return `animation-duration: ${this.AnimationDuration}s`;
|
|
120
184
|
}
|
|
121
185
|
get textStyle() {
|
|
122
|
-
return this.
|
|
186
|
+
return this.TextColor ? `color: ${this.TextColor}` : '';
|
|
123
187
|
}
|
|
124
188
|
/**
|
|
125
189
|
* Get the fill value for the SVG paths.
|
|
@@ -127,17 +191,17 @@ export class LoadingComponent {
|
|
|
127
191
|
* or null to let the CSS variable (--mj-logo-color) take effect.
|
|
128
192
|
*/
|
|
129
193
|
get logoFill() {
|
|
130
|
-
if (this.
|
|
194
|
+
if (this.LogoGradient) {
|
|
131
195
|
return `url(#${this.gradientId})`;
|
|
132
196
|
}
|
|
133
|
-
return this.
|
|
197
|
+
return this.LogoColor || null;
|
|
134
198
|
}
|
|
135
199
|
/**
|
|
136
200
|
* Calculate gradient transform based on angle.
|
|
137
201
|
* Converts angle to x1, y1, x2, y2 coordinates for SVG linearGradient.
|
|
138
202
|
*/
|
|
139
203
|
get gradientCoords() {
|
|
140
|
-
const angle = this.
|
|
204
|
+
const angle = this.LogoGradient?.angle ?? 45;
|
|
141
205
|
// Convert angle to radians and calculate coordinates
|
|
142
206
|
// SVG gradientUnits="objectBoundingBox" uses 0-1 range
|
|
143
207
|
const radians = (angle * Math.PI) / 180;
|
|
@@ -153,7 +217,7 @@ export class LoadingComponent {
|
|
|
153
217
|
};
|
|
154
218
|
}
|
|
155
219
|
static ɵfac = function LoadingComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LoadingComponent)(); };
|
|
156
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LoadingComponent, selectors: [["mj-loading"]], inputs: { text: "text", showText: "showText", animationDuration: "animationDuration", size: "size", textColor: "textColor", logoColor: "logoColor", logoGradient: "logoGradient", animation: "animation" }, standalone: false, decls: 7, vars: 10, consts: [[1, "mj-loading-container"], ["xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 230 128", 1, "mj-logo-svg"], ["d", "M0 0 C1.197 0.668 2.394 1.336 3.592 2.004 C12.234 6.837 20.792 11.805 29.327 16.824 C37.26 21.476 45.269 25.98 53.312 30.438 C53.91 30.769 54.507 31.1 55.122 31.441 C61.234 34.87 61.234 34.87 67.438 38.125 C69.709 37.16 69.709 37.16 72.258 35.652 C73.255 35.09 74.253 34.527 75.281 33.948 C76.364 33.325 77.447 32.703 78.562 32.062 C79.685 31.426 80.808 30.789 81.965 30.133 C90.435 25.322 98.84 20.401 107.239 15.469 C118.242 9.027 129.394 2.857 140.566 -3.286 C142.41 -4.306 144.248 -5.338 146.079 -6.382 C146.869 -6.832 147.659 -7.282 148.473 -7.746 C149.148 -8.136 149.824 -8.526 150.52 -8.927 C156.448 -11.856 163.036 -11.676 169.188 -9.625 C175.638 -6.152 178.915 -2.712 181.438 4.125 C181.951 7.259 181.946 10.308 181.892 13.479 C181.892 14.377 181.893 15.276 181.893 16.201 C181.891 19.145 181.86 22.088 181.828 25.031 C181.821 27.082 181.815 29.134 181.811 31.185 C181.796 36.564 181.757 41.943 181.712 47.322 C181.671 52.819 181.653 58.316 181.633 63.812 C181.59 74.584 181.522 85.354 181.438 96.125 C178.573 94.739 175.729 93.326 172.901 91.867 C170.644 90.732 168.349 89.671 166.018 88.7 C162.628 87.127 160.12 85.736 157.438 83.125 C155.741 78.082 155.893 73.244 156.047 68.004 C156.047 66.534 156.041 65.064 156.031 63.595 C156.018 59.745 156.076 55.899 156.15 52.049 C156.213 48.114 156.207 44.18 156.207 40.244 C156.217 32.536 156.303 24.832 156.438 17.125 C152.485 19.335 148.534 21.546 144.582 23.758 C143.476 24.376 142.37 24.995 141.231 25.632 C131.895 30.857 122.601 36.151 113.321 41.472 C107.737 44.673 102.15 47.868 96.562 51.062 C95.965 51.404 95.367 51.746 94.751 52.098 C86.826 56.629 78.889 61.14 70.938 65.625 C62.527 70.37 54.133 75.144 45.75 79.938 C45.166 80.271 44.581 80.605 43.979 80.95 C37.987 84.375 31.996 87.803 26.011 91.241 C14.366 97.93 2.707 104.594 -9.062 111.062 C-9.97 111.565 -10.878 112.067 -11.814 112.585 C-12.649 113.04 -13.484 113.496 -14.344 113.965 C-15.066 114.36 -15.789 114.756 -16.533 115.164 C-22.269 117.881 -28.602 117.949 -34.625 116.125 C-39.398 114.15 -42.881 110.491 -45.562 106.125 C-45.562 104.805 -45.562 103.485 -45.562 102.125 C-45.022 101.835 -44.481 101.545 -43.924 101.246 C-32.122 94.897 -20.456 88.363 -8.907 81.566 C-0.017 76.35 8.975 71.333 18.003 66.362 C24.427 62.82 30.777 59.186 37.065 55.408 C39.438 54.125 39.438 54.125 41.438 54.125 C41.438 53.465 41.438 52.805 41.438 52.125 C40.704 51.843 39.971 51.561 39.216 51.271 C36.702 50.234 34.368 49.093 31.98 47.797 C30.7 47.102 30.7 47.102 29.395 46.394 C28.481 45.892 27.567 45.391 26.625 44.875 C25.666 44.351 24.707 43.826 23.719 43.286 C14.477 38.202 5.37 32.897 -3.719 27.547 C-8.103 24.968 -12.509 22.431 -16.928 19.911 C-17.89 19.362 -17.89 19.362 -18.871 18.802 C-20.435 17.909 -21.999 17.017 -23.562 16.125 C-23.525 16.942 -23.487 17.759 -23.448 18.601 C-23.106 26.338 -22.848 34.071 -22.682 41.814 C-22.593 45.794 -22.474 49.768 -22.28 53.745 C-21.06 79.461 -21.06 79.461 -25.205 85.53 C-29.148 89.11 -33.517 90.996 -38.581 92.49 C-41.159 93.316 -43.282 94.688 -45.562 96.125 C-46.222 96.125 -46.882 96.125 -47.562 96.125 C-47.655 84.546 -47.726 72.967 -47.77 61.388 C-47.791 56.01 -47.819 50.633 -47.864 45.256 C-47.908 40.062 -47.932 34.869 -47.942 29.675 C-47.949 27.698 -47.964 25.721 -47.985 23.744 C-48.015 20.965 -48.018 18.187 -48.017 15.408 C-48.031 14.599 -48.045 13.79 -48.06 12.956 C-48.013 6.348 -46.391 0.196 -41.823 -4.764 C-27.895 -17.466 -13.817 -7.747 0 0 Z", "transform", "translate(47.5625,10.875)"], ["d", "M0 0 C2.051 0.961 2.051 0.961 4.098 2.16 C5.278 2.843 5.278 2.843 6.481 3.541 C7.333 4.043 8.185 4.545 9.062 5.062 C10.954 6.16 12.846 7.258 14.738 8.355 C16.255 9.24 16.255 9.24 17.803 10.142 C22.848 13.074 27.913 15.969 32.979 18.863 C34.753 19.877 36.525 20.892 38.297 21.907 C44.243 25.311 50.205 28.681 56.203 31.992 C57.347 32.625 58.491 33.258 59.669 33.911 C61.837 35.108 64.008 36.299 66.183 37.484 C67.154 38.02 68.125 38.557 69.125 39.109 C69.973 39.573 70.821 40.037 71.695 40.515 C74.149 42.096 76.015 43.87 78 46 C74.984 51.808 72.395 55.457 66.25 58.25 C54.159 61.04 44.857 55.778 34.625 49.75 C32.781 48.681 30.938 47.612 29.094 46.543 C28.114 45.972 27.134 45.402 26.125 44.814 C21.068 41.878 15.989 38.98 10.91 36.082 C9.13 35.065 7.35 34.048 5.57 33.03 C-5.598 26.648 -16.794 20.315 -28 14 C-28 13.34 -28 12.68 -28 12 C-24.284 9.789 -20.551 7.61 -16.812 5.438 C-15.757 4.809 -14.702 4.181 -13.615 3.533 C-12.083 2.649 -12.083 2.649 -10.52 1.746 C-9.582 1.196 -8.645 0.646 -7.679 0.08 C-4.518 -1.194 -3.196 -1.069 0 0 Z", "transform", "translate(150,69)"], [1, "mj-loading-text", 3, "style"], ["offset", "0%"], ["offset", "100%"], [1, "mj-loading-text"]], template: function LoadingComponent_Template(rf, ctx) { if (rf & 1) {
|
|
220
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LoadingComponent, selectors: [["mj-loading"]], inputs: { Text: "Text", text: "text", ShowText: "ShowText", showText: "showText", AnimationDuration: "AnimationDuration", animationDuration: "animationDuration", Size: "Size", size: "size", TextColor: "TextColor", textColor: "textColor", LogoColor: "LogoColor", logoColor: "logoColor", LogoGradient: "LogoGradient", logoGradient: "logoGradient", Animation: "Animation", animation: "animation" }, standalone: false, decls: 7, vars: 10, consts: [[1, "mj-loading-container"], ["xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 230 128", 1, "mj-logo-svg"], ["d", "M0 0 C1.197 0.668 2.394 1.336 3.592 2.004 C12.234 6.837 20.792 11.805 29.327 16.824 C37.26 21.476 45.269 25.98 53.312 30.438 C53.91 30.769 54.507 31.1 55.122 31.441 C61.234 34.87 61.234 34.87 67.438 38.125 C69.709 37.16 69.709 37.16 72.258 35.652 C73.255 35.09 74.253 34.527 75.281 33.948 C76.364 33.325 77.447 32.703 78.562 32.062 C79.685 31.426 80.808 30.789 81.965 30.133 C90.435 25.322 98.84 20.401 107.239 15.469 C118.242 9.027 129.394 2.857 140.566 -3.286 C142.41 -4.306 144.248 -5.338 146.079 -6.382 C146.869 -6.832 147.659 -7.282 148.473 -7.746 C149.148 -8.136 149.824 -8.526 150.52 -8.927 C156.448 -11.856 163.036 -11.676 169.188 -9.625 C175.638 -6.152 178.915 -2.712 181.438 4.125 C181.951 7.259 181.946 10.308 181.892 13.479 C181.892 14.377 181.893 15.276 181.893 16.201 C181.891 19.145 181.86 22.088 181.828 25.031 C181.821 27.082 181.815 29.134 181.811 31.185 C181.796 36.564 181.757 41.943 181.712 47.322 C181.671 52.819 181.653 58.316 181.633 63.812 C181.59 74.584 181.522 85.354 181.438 96.125 C178.573 94.739 175.729 93.326 172.901 91.867 C170.644 90.732 168.349 89.671 166.018 88.7 C162.628 87.127 160.12 85.736 157.438 83.125 C155.741 78.082 155.893 73.244 156.047 68.004 C156.047 66.534 156.041 65.064 156.031 63.595 C156.018 59.745 156.076 55.899 156.15 52.049 C156.213 48.114 156.207 44.18 156.207 40.244 C156.217 32.536 156.303 24.832 156.438 17.125 C152.485 19.335 148.534 21.546 144.582 23.758 C143.476 24.376 142.37 24.995 141.231 25.632 C131.895 30.857 122.601 36.151 113.321 41.472 C107.737 44.673 102.15 47.868 96.562 51.062 C95.965 51.404 95.367 51.746 94.751 52.098 C86.826 56.629 78.889 61.14 70.938 65.625 C62.527 70.37 54.133 75.144 45.75 79.938 C45.166 80.271 44.581 80.605 43.979 80.95 C37.987 84.375 31.996 87.803 26.011 91.241 C14.366 97.93 2.707 104.594 -9.062 111.062 C-9.97 111.565 -10.878 112.067 -11.814 112.585 C-12.649 113.04 -13.484 113.496 -14.344 113.965 C-15.066 114.36 -15.789 114.756 -16.533 115.164 C-22.269 117.881 -28.602 117.949 -34.625 116.125 C-39.398 114.15 -42.881 110.491 -45.562 106.125 C-45.562 104.805 -45.562 103.485 -45.562 102.125 C-45.022 101.835 -44.481 101.545 -43.924 101.246 C-32.122 94.897 -20.456 88.363 -8.907 81.566 C-0.017 76.35 8.975 71.333 18.003 66.362 C24.427 62.82 30.777 59.186 37.065 55.408 C39.438 54.125 39.438 54.125 41.438 54.125 C41.438 53.465 41.438 52.805 41.438 52.125 C40.704 51.843 39.971 51.561 39.216 51.271 C36.702 50.234 34.368 49.093 31.98 47.797 C30.7 47.102 30.7 47.102 29.395 46.394 C28.481 45.892 27.567 45.391 26.625 44.875 C25.666 44.351 24.707 43.826 23.719 43.286 C14.477 38.202 5.37 32.897 -3.719 27.547 C-8.103 24.968 -12.509 22.431 -16.928 19.911 C-17.89 19.362 -17.89 19.362 -18.871 18.802 C-20.435 17.909 -21.999 17.017 -23.562 16.125 C-23.525 16.942 -23.487 17.759 -23.448 18.601 C-23.106 26.338 -22.848 34.071 -22.682 41.814 C-22.593 45.794 -22.474 49.768 -22.28 53.745 C-21.06 79.461 -21.06 79.461 -25.205 85.53 C-29.148 89.11 -33.517 90.996 -38.581 92.49 C-41.159 93.316 -43.282 94.688 -45.562 96.125 C-46.222 96.125 -46.882 96.125 -47.562 96.125 C-47.655 84.546 -47.726 72.967 -47.77 61.388 C-47.791 56.01 -47.819 50.633 -47.864 45.256 C-47.908 40.062 -47.932 34.869 -47.942 29.675 C-47.949 27.698 -47.964 25.721 -47.985 23.744 C-48.015 20.965 -48.018 18.187 -48.017 15.408 C-48.031 14.599 -48.045 13.79 -48.06 12.956 C-48.013 6.348 -46.391 0.196 -41.823 -4.764 C-27.895 -17.466 -13.817 -7.747 0 0 Z", "transform", "translate(47.5625,10.875)"], ["d", "M0 0 C2.051 0.961 2.051 0.961 4.098 2.16 C5.278 2.843 5.278 2.843 6.481 3.541 C7.333 4.043 8.185 4.545 9.062 5.062 C10.954 6.16 12.846 7.258 14.738 8.355 C16.255 9.24 16.255 9.24 17.803 10.142 C22.848 13.074 27.913 15.969 32.979 18.863 C34.753 19.877 36.525 20.892 38.297 21.907 C44.243 25.311 50.205 28.681 56.203 31.992 C57.347 32.625 58.491 33.258 59.669 33.911 C61.837 35.108 64.008 36.299 66.183 37.484 C67.154 38.02 68.125 38.557 69.125 39.109 C69.973 39.573 70.821 40.037 71.695 40.515 C74.149 42.096 76.015 43.87 78 46 C74.984 51.808 72.395 55.457 66.25 58.25 C54.159 61.04 44.857 55.778 34.625 49.75 C32.781 48.681 30.938 47.612 29.094 46.543 C28.114 45.972 27.134 45.402 26.125 44.814 C21.068 41.878 15.989 38.98 10.91 36.082 C9.13 35.065 7.35 34.048 5.57 33.03 C-5.598 26.648 -16.794 20.315 -28 14 C-28 13.34 -28 12.68 -28 12 C-24.284 9.789 -20.551 7.61 -16.812 5.438 C-15.757 4.809 -14.702 4.181 -13.615 3.533 C-12.083 2.649 -12.083 2.649 -10.52 1.746 C-9.582 1.196 -8.645 0.646 -7.679 0.08 C-4.518 -1.194 -3.196 -1.069 0 0 Z", "transform", "translate(150,69)"], [1, "mj-loading-text", 3, "style"], ["offset", "0%"], ["offset", "100%"], [1, "mj-loading-text"]], template: function LoadingComponent_Template(rf, ctx) { if (rf & 1) {
|
|
157
221
|
i0.ɵɵelementStart(0, "div", 0)(1, "div");
|
|
158
222
|
i0.ɵɵnamespaceSVG();
|
|
159
223
|
i0.ɵɵelementStart(2, "svg", 1);
|
|
@@ -179,20 +243,36 @@ export class LoadingComponent {
|
|
|
179
243
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingComponent, [{
|
|
180
244
|
type: Component,
|
|
181
245
|
args: [{ standalone: false, selector: 'mj-loading', template: "<div class=\"mj-loading-container\">\n <div [class]=\"logoClass\" [style]=\"logoStyle\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 230 128\" class=\"mj-logo-svg\">\n <!-- Gradient definition (only rendered when logoGradient is set) -->\n @if (logoGradient) {\n <defs>\n <linearGradient [attr.id]=\"gradientId\"\n [attr.x1]=\"gradientCoords.x1\"\n [attr.y1]=\"gradientCoords.y1\"\n [attr.x2]=\"gradientCoords.x2\"\n [attr.y2]=\"gradientCoords.y2\">\n <stop offset=\"0%\" [attr.stop-color]=\"logoGradient.startColor\" />\n <stop offset=\"100%\" [attr.stop-color]=\"logoGradient.endColor\" />\n </linearGradient>\n </defs>\n }\n <path d=\"M0 0 C1.197 0.668 2.394 1.336 3.592 2.004 C12.234 6.837 20.792 11.805 29.327 16.824 C37.26 21.476 45.269 25.98 53.312 30.438 C53.91 30.769 54.507 31.1 55.122 31.441 C61.234 34.87 61.234 34.87 67.438 38.125 C69.709 37.16 69.709 37.16 72.258 35.652 C73.255 35.09 74.253 34.527 75.281 33.948 C76.364 33.325 77.447 32.703 78.562 32.062 C79.685 31.426 80.808 30.789 81.965 30.133 C90.435 25.322 98.84 20.401 107.239 15.469 C118.242 9.027 129.394 2.857 140.566 -3.286 C142.41 -4.306 144.248 -5.338 146.079 -6.382 C146.869 -6.832 147.659 -7.282 148.473 -7.746 C149.148 -8.136 149.824 -8.526 150.52 -8.927 C156.448 -11.856 163.036 -11.676 169.188 -9.625 C175.638 -6.152 178.915 -2.712 181.438 4.125 C181.951 7.259 181.946 10.308 181.892 13.479 C181.892 14.377 181.893 15.276 181.893 16.201 C181.891 19.145 181.86 22.088 181.828 25.031 C181.821 27.082 181.815 29.134 181.811 31.185 C181.796 36.564 181.757 41.943 181.712 47.322 C181.671 52.819 181.653 58.316 181.633 63.812 C181.59 74.584 181.522 85.354 181.438 96.125 C178.573 94.739 175.729 93.326 172.901 91.867 C170.644 90.732 168.349 89.671 166.018 88.7 C162.628 87.127 160.12 85.736 157.438 83.125 C155.741 78.082 155.893 73.244 156.047 68.004 C156.047 66.534 156.041 65.064 156.031 63.595 C156.018 59.745 156.076 55.899 156.15 52.049 C156.213 48.114 156.207 44.18 156.207 40.244 C156.217 32.536 156.303 24.832 156.438 17.125 C152.485 19.335 148.534 21.546 144.582 23.758 C143.476 24.376 142.37 24.995 141.231 25.632 C131.895 30.857 122.601 36.151 113.321 41.472 C107.737 44.673 102.15 47.868 96.562 51.062 C95.965 51.404 95.367 51.746 94.751 52.098 C86.826 56.629 78.889 61.14 70.938 65.625 C62.527 70.37 54.133 75.144 45.75 79.938 C45.166 80.271 44.581 80.605 43.979 80.95 C37.987 84.375 31.996 87.803 26.011 91.241 C14.366 97.93 2.707 104.594 -9.062 111.062 C-9.97 111.565 -10.878 112.067 -11.814 112.585 C-12.649 113.04 -13.484 113.496 -14.344 113.965 C-15.066 114.36 -15.789 114.756 -16.533 115.164 C-22.269 117.881 -28.602 117.949 -34.625 116.125 C-39.398 114.15 -42.881 110.491 -45.562 106.125 C-45.562 104.805 -45.562 103.485 -45.562 102.125 C-45.022 101.835 -44.481 101.545 -43.924 101.246 C-32.122 94.897 -20.456 88.363 -8.907 81.566 C-0.017 76.35 8.975 71.333 18.003 66.362 C24.427 62.82 30.777 59.186 37.065 55.408 C39.438 54.125 39.438 54.125 41.438 54.125 C41.438 53.465 41.438 52.805 41.438 52.125 C40.704 51.843 39.971 51.561 39.216 51.271 C36.702 50.234 34.368 49.093 31.98 47.797 C30.7 47.102 30.7 47.102 29.395 46.394 C28.481 45.892 27.567 45.391 26.625 44.875 C25.666 44.351 24.707 43.826 23.719 43.286 C14.477 38.202 5.37 32.897 -3.719 27.547 C-8.103 24.968 -12.509 22.431 -16.928 19.911 C-17.89 19.362 -17.89 19.362 -18.871 18.802 C-20.435 17.909 -21.999 17.017 -23.562 16.125 C-23.525 16.942 -23.487 17.759 -23.448 18.601 C-23.106 26.338 -22.848 34.071 -22.682 41.814 C-22.593 45.794 -22.474 49.768 -22.28 53.745 C-21.06 79.461 -21.06 79.461 -25.205 85.53 C-29.148 89.11 -33.517 90.996 -38.581 92.49 C-41.159 93.316 -43.282 94.688 -45.562 96.125 C-46.222 96.125 -46.882 96.125 -47.562 96.125 C-47.655 84.546 -47.726 72.967 -47.77 61.388 C-47.791 56.01 -47.819 50.633 -47.864 45.256 C-47.908 40.062 -47.932 34.869 -47.942 29.675 C-47.949 27.698 -47.964 25.721 -47.985 23.744 C-48.015 20.965 -48.018 18.187 -48.017 15.408 C-48.031 14.599 -48.045 13.79 -48.06 12.956 C-48.013 6.348 -46.391 0.196 -41.823 -4.764 C-27.895 -17.466 -13.817 -7.747 0 0 Z\" [style.fill]=\"logoFill\" transform=\"translate(47.5625,10.875)\"/>\n <path d=\"M0 0 C2.051 0.961 2.051 0.961 4.098 2.16 C5.278 2.843 5.278 2.843 6.481 3.541 C7.333 4.043 8.185 4.545 9.062 5.062 C10.954 6.16 12.846 7.258 14.738 8.355 C16.255 9.24 16.255 9.24 17.803 10.142 C22.848 13.074 27.913 15.969 32.979 18.863 C34.753 19.877 36.525 20.892 38.297 21.907 C44.243 25.311 50.205 28.681 56.203 31.992 C57.347 32.625 58.491 33.258 59.669 33.911 C61.837 35.108 64.008 36.299 66.183 37.484 C67.154 38.02 68.125 38.557 69.125 39.109 C69.973 39.573 70.821 40.037 71.695 40.515 C74.149 42.096 76.015 43.87 78 46 C74.984 51.808 72.395 55.457 66.25 58.25 C54.159 61.04 44.857 55.778 34.625 49.75 C32.781 48.681 30.938 47.612 29.094 46.543 C28.114 45.972 27.134 45.402 26.125 44.814 C21.068 41.878 15.989 38.98 10.91 36.082 C9.13 35.065 7.35 34.048 5.57 33.03 C-5.598 26.648 -16.794 20.315 -28 14 C-28 13.34 -28 12.68 -28 12 C-24.284 9.789 -20.551 7.61 -16.812 5.438 C-15.757 4.809 -14.702 4.181 -13.615 3.533 C-12.083 2.649 -12.083 2.649 -10.52 1.746 C-9.582 1.196 -8.645 0.646 -7.679 0.08 C-4.518 -1.194 -3.196 -1.069 0 0 Z\" [style.fill]=\"logoFill\" transform=\"translate(150,69)\"/>\n </svg>\n </div>\n @if (showText && text) {\n <p class=\"mj-loading-text\" [style]=\"textStyle\">{{ text }}</p>\n }\n</div>\n", styles: [":host {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n}\n\n.mj-loading-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 16px;\n width: 100%;\n height: 100%;\n}\n\n/* MJ Logo container */\n.mj-loading-logo {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n\n/* SVG inside the logo container */\n.mj-logo-svg {\n width: 100%;\n height: 100%;\n}\n\n.mj-logo-svg path {\n fill: var(--mj-logo-color);\n}\n\n/* Size presets */\n.mj-loading-logo.size-small {\n width: 40px;\n height: 22px;\n}\n\n.mj-loading-logo.size-medium {\n width: 80px;\n height: 45px;\n}\n\n.mj-loading-logo.size-large {\n width: 120px;\n height: 67px;\n}\n\n.mj-loading-logo.size-auto {\n /* Auto size - takes up available space while maintaining aspect ratio */\n width: 100%;\n height: 100%;\n max-width: 200px;\n max-height: 112px;\n min-width: 40px;\n min-height: 22px;\n}\n\n/* Loading text */\n.mj-loading-text {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n color: var(--mj-text-muted);\n text-align: center;\n transition: color 0.3s ease;\n}\n\n/* Animation: Pulse (default) */\n.mj-loading-logo.animation-pulse {\n animation: mj-loading-pulse 1.5s ease-in-out infinite;\n}\n\n@keyframes mj-loading-pulse {\n 0%, 100% {\n opacity: 0.4;\n transform: scale(0.95);\n }\n 50% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n/* Animation: Spin */\n.mj-loading-logo.animation-spin {\n animation: mj-loading-spin 3s linear infinite;\n}\n\n@keyframes mj-loading-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/* Animation: Bounce */\n.mj-loading-logo.animation-bounce {\n animation: mj-loading-bounce 1s ease-in-out infinite;\n}\n\n@keyframes mj-loading-bounce {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-15px);\n }\n}\n\n/* Animation: Pulse-Spin (combines pulse with slow rotation) */\n.mj-loading-logo.animation-pulse-spin {\n animation: mj-loading-pulse-spin 3s ease-in-out infinite;\n}\n\n@keyframes mj-loading-pulse-spin {\n 0% {\n opacity: 0.4;\n transform: scale(0.95) rotate(0deg);\n }\n 50% {\n opacity: 1;\n transform: scale(1) rotate(180deg);\n }\n 100% {\n opacity: 0.4;\n transform: scale(0.95) rotate(360deg);\n }\n}\n"] }]
|
|
182
|
-
}], null, {
|
|
246
|
+
}], null, { Text: [{
|
|
247
|
+
type: Input
|
|
248
|
+
}], text: [{
|
|
249
|
+
type: Input
|
|
250
|
+
}], ShowText: [{
|
|
183
251
|
type: Input
|
|
184
252
|
}], showText: [{
|
|
185
253
|
type: Input
|
|
254
|
+
}], AnimationDuration: [{
|
|
255
|
+
type: Input
|
|
186
256
|
}], animationDuration: [{
|
|
187
257
|
type: Input
|
|
258
|
+
}], Size: [{
|
|
259
|
+
type: Input
|
|
188
260
|
}], size: [{
|
|
189
261
|
type: Input
|
|
262
|
+
}], TextColor: [{
|
|
263
|
+
type: Input
|
|
190
264
|
}], textColor: [{
|
|
191
265
|
type: Input
|
|
266
|
+
}], LogoColor: [{
|
|
267
|
+
type: Input
|
|
192
268
|
}], logoColor: [{
|
|
193
269
|
type: Input
|
|
270
|
+
}], LogoGradient: [{
|
|
271
|
+
type: Input
|
|
194
272
|
}], logoGradient: [{
|
|
195
273
|
type: Input
|
|
274
|
+
}], Animation: [{
|
|
275
|
+
type: Input
|
|
196
276
|
}], animation: [{
|
|
197
277
|
type: Input
|
|
198
278
|
}] }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.component.js","sourceRoot":"","sources":["../../../src/lib/loading/loading.component.ts","../../../src/lib/loading/loading.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;ICMvC,AADF,4BAAM,qBAK4B;IAE9B,AADA,0BAAgE,cACA;IAEpE,AADE,iBAAiB,EACZ;;;IARW,cAAsB;;IAKlB,cAA2C;;IACzC,cAAyC;;;;IASrE,4BAA+C;IAAA,YAAU;IAAA,iBAAI;;;IAAlC,+BAAmB;IAAC,cAAU;IAAV,iCAAU;;ADN7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAOH,MAAM,OAAO,gBAAgB;IAC3B;;;OAGG;IACM,IAAI,GAAG,YAAY,CAAC;IAE7B;;;OAGG;IACM,QAAQ,GAAG,IAAI,CAAC;IAEzB;;;OAGG;IACM,iBAAiB,GAAG,GAAG,CAAC;IAEjC;;;;;;OAMG;IACM,IAAI,GAA0C,MAAM,CAAC;IAE9D;;;OAGG;IACM,SAAS,GAAG,EAAE,CAAC;IAExB;;;;;OAKG;IACM,SAAS,GAAG,EAAE,CAAC;IAExB;;;;OAIG;IACM,YAAY,GAAwB,IAAI,CAAC;IAElD;;;;;;OAMG;IACM,SAAS,GAA+C,OAAO,CAAC;IAEzE,+DAA+D;IACtD,UAAU,GAAG,oBAAoB,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IAExF,IAAI,SAAS;QACX,OAAO,wBAAwB,IAAI,CAAC,IAAI,cAAc,IAAI,CAAC,SAAS,EAAE,CAAC;IACzE,CAAC;IAED,IAAI,SAAS;QACX,OAAO,uBAAuB,IAAI,CAAC,iBAAiB,GAAG,CAAC;IAC1D,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC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AADE,iBAAM,EACF;YACN,gFAAwB;YAG1B,iBAAM;;YAtBqB,cAAmB;YAAnB,4BAAmB;YAAvC,4BAAmB;YAGpB,eAWC;YAXD,2CAWC;YACi2G,cAAuB;YAAvB,oCAAuB;YACj2E,cAAuB;YAAvB,oCAAuB;YAGnjC,cAEC;YAFD,mDAEC;;;iFDmCU,gBAAgB;cAN5B,SAAS;6BACI,KAAK,YACP,YAAY;;kBASrB,KAAK;;kBAML,KAAK;;kBAML,KAAK;;kBASL,KAAK;;kBAML,KAAK;;kBAQL,KAAK;;kBAOL,KAAK;;kBASL,KAAK;;kFAxDK,gBAAgB","sourcesContent":["import { Component, Input } from '@angular/core';\n\n/**\n * Gradient configuration for the logo.\n * When provided, creates a linear gradient fill instead of solid color.\n */\nexport interface LogoGradient {\n /** Starting color of the gradient */\n startColor: string;\n /** Ending color of the gradient */\n endColor: string;\n /** Gradient angle in degrees (0 = left to right, 90 = top to bottom). Default: 45 */\n angle?: number;\n}\n\n/**\n * MJ Loading Component - Displays an animated MJ logo with optional text.\n *\n * Features:\n * - SVG logo with customizable animations (pulse, spin, bounce)\n * - Sizes to fit container (use CSS on host element)\n * - Optional loading text\n * - Customizable text and logo colors\n * - Gradient support for logo fill\n *\n * @example\n * ```html\n * <!-- Basic usage (fills container) -->\n * <mj-loading></mj-loading>\n *\n * <!-- With custom text -->\n * <mj-loading text=\"Loading data...\"></mj-loading>\n *\n * <!-- No text -->\n * <mj-loading [showText]=\"false\"></mj-loading>\n *\n * <!-- With custom colors -->\n * <mj-loading text=\"Loading...\" textColor=\"#4CAF50\" logoColor=\"#4CAF50\"></mj-loading>\n *\n * <!-- With gradient colors (holiday theme) -->\n * <mj-loading [logoGradient]=\"{startColor: '#228B22', endColor: '#C41E3A'}\"></mj-loading>\n *\n * <!-- With spinning animation -->\n * <mj-loading animation=\"spin\"></mj-loading>\n *\n * <!-- Fixed size container -->\n * <div style=\"width: 200px; height: 150px;\">\n * <mj-loading text=\"Please wait...\"></mj-loading>\n * </div>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-loading',\n templateUrl: './loading.component.html',\n styleUrls: ['./loading.component.css']\n})\nexport class LoadingComponent {\n /**\n * Text to display below the loading animation.\n * Set to empty string or use showText=false to hide text.\n */\n @Input() text = 'Loading...';\n\n /**\n * Whether to show the text below the logo.\n * When false, only the animated logo is shown.\n */\n @Input() showText = true;\n\n /**\n * Animation duration in seconds.\n * Default is 1.5 seconds for the pulse animation.\n */\n @Input() animationDuration = 1.5;\n\n /**\n * Size preset for quick sizing.\n * - 'small': 40x22px logo\n * - 'medium': 80x45px logo (default)\n * - 'large': 120x67px logo\n * - 'auto': fills container\n */\n @Input() size: 'small' | 'medium' | 'large' | 'auto' = 'auto';\n\n /**\n * CSS color for the loading text.\n * Accepts any valid CSS color value.\n */\n @Input() textColor = '';\n\n /**\n * CSS color for the logo (solid color).\n * Accepts any valid CSS color value.\n * When empty, uses --mj-logo-color CSS variable (adapts to light/dark theme).\n * Ignored if logoGradient is provided.\n */\n @Input() logoColor = '';\n\n /**\n * Gradient configuration for the logo.\n * When provided, creates a linear gradient fill instead of solid color.\n * Takes precedence over logoColor.\n */\n @Input() logoGradient: LogoGradient | null = null;\n\n /**\n * Animation type for the logo.\n * - 'pulse': Fade in/out with subtle scale (default)\n * - 'spin': Rotate continuously\n * - 'bounce': Bounce up and down\n * - 'pulse-spin': Pulse while slowly spinning\n */\n @Input() animation: 'pulse' | 'spin' | 'bounce' | 'pulse-spin' = 'pulse';\n\n /** Unique ID for the gradient definition to avoid conflicts */\n readonly gradientId = `mj-logo-gradient-${Math.random().toString(36).substring(2, 11)}`;\n\n get logoClass(): string {\n return `mj-loading-logo size-${this.size} animation-${this.animation}`;\n }\n\n get logoStyle(): string {\n return `animation-duration: ${this.animationDuration}s`;\n }\n\n get textStyle(): string {\n return this.textColor ? `color: ${this.textColor}` : '';\n }\n\n /**\n * Get the fill value for the SVG paths.\n * Returns a gradient URL reference if gradient is set, the explicit logoColor if provided,\n * or null to let the CSS variable (--mj-logo-color) take effect.\n */\n get logoFill(): string | null {\n if (this.logoGradient) {\n return `url(#${this.gradientId})`;\n }\n return this.logoColor || null;\n }\n\n /**\n * Calculate gradient transform based on angle.\n * Converts angle to x1, y1, x2, y2 coordinates for SVG linearGradient.\n */\n get gradientCoords(): { x1: string; y1: string; x2: string; y2: string } {\n const angle = this.logoGradient?.angle ?? 45;\n // Convert angle to radians and calculate coordinates\n // SVG gradientUnits=\"objectBoundingBox\" uses 0-1 range\n const radians = (angle * Math.PI) / 180;\n const x1 = Math.round(50 - Math.cos(radians) * 50);\n const y1 = Math.round(50 + Math.sin(radians) * 50);\n const x2 = Math.round(50 + Math.cos(radians) * 50);\n const y2 = Math.round(50 - Math.sin(radians) * 50);\n\n return {\n x1: `${x1}%`,\n y1: `${y1}%`,\n x2: `${x2}%`,\n y2: `${y2}%`\n };\n }\n}\n","<div class=\"mj-loading-container\">\n <div [class]=\"logoClass\" [style]=\"logoStyle\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 230 128\" class=\"mj-logo-svg\">\n <!-- Gradient definition (only rendered when logoGradient is set) -->\n @if (logoGradient) {\n <defs>\n <linearGradient [attr.id]=\"gradientId\"\n [attr.x1]=\"gradientCoords.x1\"\n [attr.y1]=\"gradientCoords.y1\"\n [attr.x2]=\"gradientCoords.x2\"\n [attr.y2]=\"gradientCoords.y2\">\n <stop offset=\"0%\" [attr.stop-color]=\"logoGradient.startColor\" />\n <stop offset=\"100%\" [attr.stop-color]=\"logoGradient.endColor\" />\n </linearGradient>\n </defs>\n }\n <path d=\"M0 0 C1.197 0.668 2.394 1.336 3.592 2.004 C12.234 6.837 20.792 11.805 29.327 16.824 C37.26 21.476 45.269 25.98 53.312 30.438 C53.91 30.769 54.507 31.1 55.122 31.441 C61.234 34.87 61.234 34.87 67.438 38.125 C69.709 37.16 69.709 37.16 72.258 35.652 C73.255 35.09 74.253 34.527 75.281 33.948 C76.364 33.325 77.447 32.703 78.562 32.062 C79.685 31.426 80.808 30.789 81.965 30.133 C90.435 25.322 98.84 20.401 107.239 15.469 C118.242 9.027 129.394 2.857 140.566 -3.286 C142.41 -4.306 144.248 -5.338 146.079 -6.382 C146.869 -6.832 147.659 -7.282 148.473 -7.746 C149.148 -8.136 149.824 -8.526 150.52 -8.927 C156.448 -11.856 163.036 -11.676 169.188 -9.625 C175.638 -6.152 178.915 -2.712 181.438 4.125 C181.951 7.259 181.946 10.308 181.892 13.479 C181.892 14.377 181.893 15.276 181.893 16.201 C181.891 19.145 181.86 22.088 181.828 25.031 C181.821 27.082 181.815 29.134 181.811 31.185 C181.796 36.564 181.757 41.943 181.712 47.322 C181.671 52.819 181.653 58.316 181.633 63.812 C181.59 74.584 181.522 85.354 181.438 96.125 C178.573 94.739 175.729 93.326 172.901 91.867 C170.644 90.732 168.349 89.671 166.018 88.7 C162.628 87.127 160.12 85.736 157.438 83.125 C155.741 78.082 155.893 73.244 156.047 68.004 C156.047 66.534 156.041 65.064 156.031 63.595 C156.018 59.745 156.076 55.899 156.15 52.049 C156.213 48.114 156.207 44.18 156.207 40.244 C156.217 32.536 156.303 24.832 156.438 17.125 C152.485 19.335 148.534 21.546 144.582 23.758 C143.476 24.376 142.37 24.995 141.231 25.632 C131.895 30.857 122.601 36.151 113.321 41.472 C107.737 44.673 102.15 47.868 96.562 51.062 C95.965 51.404 95.367 51.746 94.751 52.098 C86.826 56.629 78.889 61.14 70.938 65.625 C62.527 70.37 54.133 75.144 45.75 79.938 C45.166 80.271 44.581 80.605 43.979 80.95 C37.987 84.375 31.996 87.803 26.011 91.241 C14.366 97.93 2.707 104.594 -9.062 111.062 C-9.97 111.565 -10.878 112.067 -11.814 112.585 C-12.649 113.04 -13.484 113.496 -14.344 113.965 C-15.066 114.36 -15.789 114.756 -16.533 115.164 C-22.269 117.881 -28.602 117.949 -34.625 116.125 C-39.398 114.15 -42.881 110.491 -45.562 106.125 C-45.562 104.805 -45.562 103.485 -45.562 102.125 C-45.022 101.835 -44.481 101.545 -43.924 101.246 C-32.122 94.897 -20.456 88.363 -8.907 81.566 C-0.017 76.35 8.975 71.333 18.003 66.362 C24.427 62.82 30.777 59.186 37.065 55.408 C39.438 54.125 39.438 54.125 41.438 54.125 C41.438 53.465 41.438 52.805 41.438 52.125 C40.704 51.843 39.971 51.561 39.216 51.271 C36.702 50.234 34.368 49.093 31.98 47.797 C30.7 47.102 30.7 47.102 29.395 46.394 C28.481 45.892 27.567 45.391 26.625 44.875 C25.666 44.351 24.707 43.826 23.719 43.286 C14.477 38.202 5.37 32.897 -3.719 27.547 C-8.103 24.968 -12.509 22.431 -16.928 19.911 C-17.89 19.362 -17.89 19.362 -18.871 18.802 C-20.435 17.909 -21.999 17.017 -23.562 16.125 C-23.525 16.942 -23.487 17.759 -23.448 18.601 C-23.106 26.338 -22.848 34.071 -22.682 41.814 C-22.593 45.794 -22.474 49.768 -22.28 53.745 C-21.06 79.461 -21.06 79.461 -25.205 85.53 C-29.148 89.11 -33.517 90.996 -38.581 92.49 C-41.159 93.316 -43.282 94.688 -45.562 96.125 C-46.222 96.125 -46.882 96.125 -47.562 96.125 C-47.655 84.546 -47.726 72.967 -47.77 61.388 C-47.791 56.01 -47.819 50.633 -47.864 45.256 C-47.908 40.062 -47.932 34.869 -47.942 29.675 C-47.949 27.698 -47.964 25.721 -47.985 23.744 C-48.015 20.965 -48.018 18.187 -48.017 15.408 C-48.031 14.599 -48.045 13.79 -48.06 12.956 C-48.013 6.348 -46.391 0.196 -41.823 -4.764 C-27.895 -17.466 -13.817 -7.747 0 0 Z\" [style.fill]=\"logoFill\" transform=\"translate(47.5625,10.875)\"/>\n <path d=\"M0 0 C2.051 0.961 2.051 0.961 4.098 2.16 C5.278 2.843 5.278 2.843 6.481 3.541 C7.333 4.043 8.185 4.545 9.062 5.062 C10.954 6.16 12.846 7.258 14.738 8.355 C16.255 9.24 16.255 9.24 17.803 10.142 C22.848 13.074 27.913 15.969 32.979 18.863 C34.753 19.877 36.525 20.892 38.297 21.907 C44.243 25.311 50.205 28.681 56.203 31.992 C57.347 32.625 58.491 33.258 59.669 33.911 C61.837 35.108 64.008 36.299 66.183 37.484 C67.154 38.02 68.125 38.557 69.125 39.109 C69.973 39.573 70.821 40.037 71.695 40.515 C74.149 42.096 76.015 43.87 78 46 C74.984 51.808 72.395 55.457 66.25 58.25 C54.159 61.04 44.857 55.778 34.625 49.75 C32.781 48.681 30.938 47.612 29.094 46.543 C28.114 45.972 27.134 45.402 26.125 44.814 C21.068 41.878 15.989 38.98 10.91 36.082 C9.13 35.065 7.35 34.048 5.57 33.03 C-5.598 26.648 -16.794 20.315 -28 14 C-28 13.34 -28 12.68 -28 12 C-24.284 9.789 -20.551 7.61 -16.812 5.438 C-15.757 4.809 -14.702 4.181 -13.615 3.533 C-12.083 2.649 -12.083 2.649 -10.52 1.746 C-9.582 1.196 -8.645 0.646 -7.679 0.08 C-4.518 -1.194 -3.196 -1.069 0 0 Z\" [style.fill]=\"logoFill\" transform=\"translate(150,69)\"/>\n </svg>\n </div>\n @if (showText && text) {\n <p class=\"mj-loading-text\" [style]=\"textStyle\">{{ text }}</p>\n }\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"loading.component.js","sourceRoot":"","sources":["../../../src/lib/loading/loading.component.ts","../../../src/lib/loading/loading.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;ICMvC,AADF,4BAAM,qBAK4B;IAE9B,AADA,0BAAgE,cACA;IAEpE,AADE,iBAAiB,EACZ;;;IARW,cAAsB;;IAKlB,cAA2C;;IACzC,cAAyC;;;;IASrE,4BAA+C;IAAA,YAAU;IAAA,iBAAI;;;IAAlC,+BAAmB;IAAC,cAAU;IAAV,iCAAU;;ADN7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAOH,MAAM,OAAO,gBAAgB;IAC3B;;;OAGG;IACM,IAAI,GAAG,YAAY,CAAC;IAE7B,oCAAoC;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AY;;kBASrB,KAAK;;kBAGL,KAAK;;kBAYL,KAAK;;kBAGL,KAAK;;kBAYL,KAAK;;kBAGL,KAAK;;kBAeL,KAAK;;kBAGL,KAAK;;kBAYL,KAAK;;kBAGL,KAAK;;kBAcL,KAAK;;kBAGL,KAAK;;kBAaL,KAAK;;kBAGL,KAAK;;kBAeL,KAAK;;kBAGL,KAAK;;kFA1HK,gBAAgB","sourcesContent":["import { Component, Input } from '@angular/core';\n\n/**\n * Gradient configuration for the logo.\n * When provided, creates a linear gradient fill instead of solid color.\n */\nexport interface LogoGradient {\n /** Starting color of the gradient */\n startColor: string;\n /** Ending color of the gradient */\n endColor: string;\n /** Gradient angle in degrees (0 = left to right, 90 = top to bottom). Default: 45 */\n angle?: number;\n}\n\n/**\n * MJ Loading Component - Displays an animated MJ logo with optional text.\n *\n * Features:\n * - SVG logo with customizable animations (pulse, spin, bounce)\n * - Sizes to fit container (use CSS on host element)\n * - Optional loading text\n * - Customizable text and logo colors\n * - Gradient support for logo fill\n *\n * @example\n * ```html\n * <!-- Basic usage (fills container) -->\n * <mj-loading></mj-loading>\n *\n * <!-- With custom text -->\n * <mj-loading text=\"Loading data...\"></mj-loading>\n *\n * <!-- No text -->\n * <mj-loading [showText]=\"false\"></mj-loading>\n *\n * <!-- With custom colors -->\n * <mj-loading text=\"Loading...\" textColor=\"#4CAF50\" logoColor=\"#4CAF50\"></mj-loading>\n *\n * <!-- With gradient colors (holiday theme) -->\n * <mj-loading [logoGradient]=\"{startColor: '#228B22', endColor: '#C41E3A'}\"></mj-loading>\n *\n * <!-- With spinning animation -->\n * <mj-loading animation=\"spin\"></mj-loading>\n *\n * <!-- Fixed size container -->\n * <div style=\"width: 200px; height: 150px;\">\n * <mj-loading text=\"Please wait...\"></mj-loading>\n * </div>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-loading',\n templateUrl: './loading.component.html',\n styleUrls: ['./loading.component.css']\n})\nexport class LoadingComponent {\n /**\n * Text to display below the loading animation.\n * Set to empty string or use showText=false to hide text.\n */\n @Input() Text = 'Loading...';\n\n /** @deprecated Use {@link Text}. */\n @Input() set text(value: LoadingComponent['Text']) {\n this.Text = value;\n }\n /** @deprecated Use {@link Text}. */\n get text(): LoadingComponent['Text'] {\n return this.Text;\n }\n\n /**\n * Whether to show the text below the logo.\n * When false, only the animated logo is shown.\n */\n @Input() ShowText = true;\n\n /** @deprecated Use {@link ShowText}. */\n @Input() set showText(value: LoadingComponent['ShowText']) {\n this.ShowText = value;\n }\n /** @deprecated Use {@link ShowText}. */\n get showText(): LoadingComponent['ShowText'] {\n return this.ShowText;\n }\n\n /**\n * Animation duration in seconds.\n * Default is 1.5 seconds for the pulse animation.\n */\n @Input() AnimationDuration = 1.5;\n\n /** @deprecated Use {@link AnimationDuration}. */\n @Input() set animationDuration(value: LoadingComponent['AnimationDuration']) {\n this.AnimationDuration = value;\n }\n /** @deprecated Use {@link AnimationDuration}. */\n get animationDuration(): LoadingComponent['AnimationDuration'] {\n return this.AnimationDuration;\n }\n\n /**\n * Size preset for quick sizing.\n * - 'small': 40x22px logo\n * - 'medium': 80x45px logo (default)\n * - 'large': 120x67px logo\n * - 'auto': fills container\n */\n @Input() Size: 'small' | 'medium' | 'large' | 'auto' = 'auto';\n\n /** @deprecated Use {@link Size}. */\n @Input() set size(value: 'small' | 'medium' | 'large' | 'auto') {\n this.Size = value;\n }\n /** @deprecated Use {@link Size}. */\n get size(): 'small' | 'medium' | 'large' | 'auto' {\n return this.Size;\n }\n\n /**\n * CSS color for the loading text.\n * Accepts any valid CSS color value.\n */\n @Input() TextColor = '';\n\n /** @deprecated Use {@link TextColor}. */\n @Input() set textColor(value: LoadingComponent['TextColor']) {\n this.TextColor = value;\n }\n /** @deprecated Use {@link TextColor}. */\n get textColor(): LoadingComponent['TextColor'] {\n return this.TextColor;\n }\n\n /**\n * CSS color for the logo (solid color).\n * Accepts any valid CSS color value.\n * When empty, uses --mj-logo-color CSS variable (adapts to light/dark theme).\n * Ignored if logoGradient is provided.\n */\n @Input() LogoColor = '';\n\n /** @deprecated Use {@link LogoColor}. */\n @Input() set logoColor(value: LoadingComponent['LogoColor']) {\n this.LogoColor = value;\n }\n /** @deprecated Use {@link LogoColor}. */\n get logoColor(): LoadingComponent['LogoColor'] {\n return this.LogoColor;\n }\n\n /**\n * Gradient configuration for the logo.\n * When provided, creates a linear gradient fill instead of solid color.\n * Takes precedence over logoColor.\n */\n @Input() LogoGradient: LogoGradient | null = null;\n\n /** @deprecated Use {@link LogoGradient}. */\n @Input() set logoGradient(value: LogoGradient | null) {\n this.LogoGradient = value;\n }\n /** @deprecated Use {@link LogoGradient}. */\n get logoGradient(): LogoGradient | null {\n return this.LogoGradient;\n }\n\n /**\n * Animation type for the logo.\n * - 'pulse': Fade in/out with subtle scale (default)\n * - 'spin': Rotate continuously\n * - 'bounce': Bounce up and down\n * - 'pulse-spin': Pulse while slowly spinning\n */\n @Input() Animation: 'pulse' | 'spin' | 'bounce' | 'pulse-spin' = 'pulse';\n\n /** @deprecated Use {@link Animation}. */\n @Input() set animation(value: 'pulse' | 'spin' | 'bounce' | 'pulse-spin') {\n this.Animation = value;\n }\n /** @deprecated Use {@link Animation}. */\n get animation(): 'pulse' | 'spin' | 'bounce' | 'pulse-spin' {\n return this.Animation;\n }\n\n /** Unique ID for the gradient definition to avoid conflicts */\n readonly gradientId = `mj-logo-gradient-${Math.random().toString(36).substring(2, 11)}`; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n\n get logoClass(): string { // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n return `mj-loading-logo size-${this.Size} animation-${this.Animation}`;\n }\n\n get logoStyle(): string { // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n return `animation-duration: ${this.AnimationDuration}s`;\n }\n\n get textStyle(): string { // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n return this.TextColor ? `color: ${this.TextColor}` : '';\n }\n\n /**\n * Get the fill value for the SVG paths.\n * Returns a gradient URL reference if gradient is set, the explicit logoColor if provided,\n * or null to let the CSS variable (--mj-logo-color) take effect.\n */\n get logoFill(): string | null { // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n if (this.LogoGradient) {\n return `url(#${this.gradientId})`;\n }\n return this.LogoColor || null;\n }\n\n /**\n * Calculate gradient transform based on angle.\n * Converts angle to x1, y1, x2, y2 coordinates for SVG linearGradient.\n */\n get gradientCoords(): { x1: string; y1: string; x2: string; y2: string } { // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n const angle = this.LogoGradient?.angle ?? 45;\n // Convert angle to radians and calculate coordinates\n // SVG gradientUnits=\"objectBoundingBox\" uses 0-1 range\n const radians = (angle * Math.PI) / 180;\n const x1 = Math.round(50 - Math.cos(radians) * 50);\n const y1 = Math.round(50 + Math.sin(radians) * 50);\n const x2 = Math.round(50 + Math.cos(radians) * 50);\n const y2 = Math.round(50 - Math.sin(radians) * 50);\n\n return {\n x1: `${x1}%`,\n y1: `${y1}%`,\n x2: `${x2}%`,\n y2: `${y2}%`\n };\n }\n}\n","<div class=\"mj-loading-container\">\n <div [class]=\"logoClass\" [style]=\"logoStyle\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 230 128\" class=\"mj-logo-svg\">\n <!-- Gradient definition (only rendered when logoGradient is set) -->\n @if (logoGradient) {\n <defs>\n <linearGradient [attr.id]=\"gradientId\"\n [attr.x1]=\"gradientCoords.x1\"\n [attr.y1]=\"gradientCoords.y1\"\n [attr.x2]=\"gradientCoords.x2\"\n [attr.y2]=\"gradientCoords.y2\">\n <stop offset=\"0%\" [attr.stop-color]=\"logoGradient.startColor\" />\n <stop offset=\"100%\" [attr.stop-color]=\"logoGradient.endColor\" />\n </linearGradient>\n </defs>\n }\n <path d=\"M0 0 C1.197 0.668 2.394 1.336 3.592 2.004 C12.234 6.837 20.792 11.805 29.327 16.824 C37.26 21.476 45.269 25.98 53.312 30.438 C53.91 30.769 54.507 31.1 55.122 31.441 C61.234 34.87 61.234 34.87 67.438 38.125 C69.709 37.16 69.709 37.16 72.258 35.652 C73.255 35.09 74.253 34.527 75.281 33.948 C76.364 33.325 77.447 32.703 78.562 32.062 C79.685 31.426 80.808 30.789 81.965 30.133 C90.435 25.322 98.84 20.401 107.239 15.469 C118.242 9.027 129.394 2.857 140.566 -3.286 C142.41 -4.306 144.248 -5.338 146.079 -6.382 C146.869 -6.832 147.659 -7.282 148.473 -7.746 C149.148 -8.136 149.824 -8.526 150.52 -8.927 C156.448 -11.856 163.036 -11.676 169.188 -9.625 C175.638 -6.152 178.915 -2.712 181.438 4.125 C181.951 7.259 181.946 10.308 181.892 13.479 C181.892 14.377 181.893 15.276 181.893 16.201 C181.891 19.145 181.86 22.088 181.828 25.031 C181.821 27.082 181.815 29.134 181.811 31.185 C181.796 36.564 181.757 41.943 181.712 47.322 C181.671 52.819 181.653 58.316 181.633 63.812 C181.59 74.584 181.522 85.354 181.438 96.125 C178.573 94.739 175.729 93.326 172.901 91.867 C170.644 90.732 168.349 89.671 166.018 88.7 C162.628 87.127 160.12 85.736 157.438 83.125 C155.741 78.082 155.893 73.244 156.047 68.004 C156.047 66.534 156.041 65.064 156.031 63.595 C156.018 59.745 156.076 55.899 156.15 52.049 C156.213 48.114 156.207 44.18 156.207 40.244 C156.217 32.536 156.303 24.832 156.438 17.125 C152.485 19.335 148.534 21.546 144.582 23.758 C143.476 24.376 142.37 24.995 141.231 25.632 C131.895 30.857 122.601 36.151 113.321 41.472 C107.737 44.673 102.15 47.868 96.562 51.062 C95.965 51.404 95.367 51.746 94.751 52.098 C86.826 56.629 78.889 61.14 70.938 65.625 C62.527 70.37 54.133 75.144 45.75 79.938 C45.166 80.271 44.581 80.605 43.979 80.95 C37.987 84.375 31.996 87.803 26.011 91.241 C14.366 97.93 2.707 104.594 -9.062 111.062 C-9.97 111.565 -10.878 112.067 -11.814 112.585 C-12.649 113.04 -13.484 113.496 -14.344 113.965 C-15.066 114.36 -15.789 114.756 -16.533 115.164 C-22.269 117.881 -28.602 117.949 -34.625 116.125 C-39.398 114.15 -42.881 110.491 -45.562 106.125 C-45.562 104.805 -45.562 103.485 -45.562 102.125 C-45.022 101.835 -44.481 101.545 -43.924 101.246 C-32.122 94.897 -20.456 88.363 -8.907 81.566 C-0.017 76.35 8.975 71.333 18.003 66.362 C24.427 62.82 30.777 59.186 37.065 55.408 C39.438 54.125 39.438 54.125 41.438 54.125 C41.438 53.465 41.438 52.805 41.438 52.125 C40.704 51.843 39.971 51.561 39.216 51.271 C36.702 50.234 34.368 49.093 31.98 47.797 C30.7 47.102 30.7 47.102 29.395 46.394 C28.481 45.892 27.567 45.391 26.625 44.875 C25.666 44.351 24.707 43.826 23.719 43.286 C14.477 38.202 5.37 32.897 -3.719 27.547 C-8.103 24.968 -12.509 22.431 -16.928 19.911 C-17.89 19.362 -17.89 19.362 -18.871 18.802 C-20.435 17.909 -21.999 17.017 -23.562 16.125 C-23.525 16.942 -23.487 17.759 -23.448 18.601 C-23.106 26.338 -22.848 34.071 -22.682 41.814 C-22.593 45.794 -22.474 49.768 -22.28 53.745 C-21.06 79.461 -21.06 79.461 -25.205 85.53 C-29.148 89.11 -33.517 90.996 -38.581 92.49 C-41.159 93.316 -43.282 94.688 -45.562 96.125 C-46.222 96.125 -46.882 96.125 -47.562 96.125 C-47.655 84.546 -47.726 72.967 -47.77 61.388 C-47.791 56.01 -47.819 50.633 -47.864 45.256 C-47.908 40.062 -47.932 34.869 -47.942 29.675 C-47.949 27.698 -47.964 25.721 -47.985 23.744 C-48.015 20.965 -48.018 18.187 -48.017 15.408 C-48.031 14.599 -48.045 13.79 -48.06 12.956 C-48.013 6.348 -46.391 0.196 -41.823 -4.764 C-27.895 -17.466 -13.817 -7.747 0 0 Z\" [style.fill]=\"logoFill\" transform=\"translate(47.5625,10.875)\"/>\n <path d=\"M0 0 C2.051 0.961 2.051 0.961 4.098 2.16 C5.278 2.843 5.278 2.843 6.481 3.541 C7.333 4.043 8.185 4.545 9.062 5.062 C10.954 6.16 12.846 7.258 14.738 8.355 C16.255 9.24 16.255 9.24 17.803 10.142 C22.848 13.074 27.913 15.969 32.979 18.863 C34.753 19.877 36.525 20.892 38.297 21.907 C44.243 25.311 50.205 28.681 56.203 31.992 C57.347 32.625 58.491 33.258 59.669 33.911 C61.837 35.108 64.008 36.299 66.183 37.484 C67.154 38.02 68.125 38.557 69.125 39.109 C69.973 39.573 70.821 40.037 71.695 40.515 C74.149 42.096 76.015 43.87 78 46 C74.984 51.808 72.395 55.457 66.25 58.25 C54.159 61.04 44.857 55.778 34.625 49.75 C32.781 48.681 30.938 47.612 29.094 46.543 C28.114 45.972 27.134 45.402 26.125 44.814 C21.068 41.878 15.989 38.98 10.91 36.082 C9.13 35.065 7.35 34.048 5.57 33.03 C-5.598 26.648 -16.794 20.315 -28 14 C-28 13.34 -28 12.68 -28 12 C-24.284 9.789 -20.551 7.61 -16.812 5.438 C-15.757 4.809 -14.702 4.181 -13.615 3.533 C-12.083 2.649 -12.083 2.649 -10.52 1.746 C-9.582 1.196 -8.645 0.646 -7.679 0.08 C-4.518 -1.194 -3.196 -1.069 0 0 Z\" [style.fill]=\"logoFill\" transform=\"translate(150,69)\"/>\n </svg>\n </div>\n @if (showText && text) {\n <p class=\"mj-loading-text\" [style]=\"textStyle\">{{ text }}</p>\n }\n</div>\n"]}
|
|
@@ -53,16 +53,22 @@ export declare class RecentAccessService {
|
|
|
53
53
|
* @param recordId - The record ID (single value or CompositeKey string)
|
|
54
54
|
* @param resourceType - The type of resource being accessed
|
|
55
55
|
*/
|
|
56
|
+
LogAccess(entityName: string, recordId: string | CompositeKey, resourceType?: 'record' | 'view' | 'dashboard' | 'artifact' | 'report'): Promise<void>;
|
|
57
|
+
/** @deprecated Use {@link LogAccess}. */
|
|
56
58
|
logAccess(entityName: string, recordId: string | CompositeKey, resourceType?: 'record' | 'view' | 'dashboard' | 'artifact' | 'report'): Promise<void>;
|
|
57
59
|
/**
|
|
58
60
|
* Loads recent access items for the current user using UserInfoEngine (cached).
|
|
59
61
|
* @param maxItems - Maximum number of items to return (default 15)
|
|
60
62
|
* @param forceRefresh - Force refresh even if already loaded
|
|
61
63
|
*/
|
|
64
|
+
LoadRecentItems(maxItems?: number, forceRefresh?: boolean): Promise<RecentAccessItem[]>;
|
|
65
|
+
/** @deprecated Use {@link LoadRecentItems}. */
|
|
62
66
|
loadRecentItems(maxItems?: number, forceRefresh?: boolean): Promise<RecentAccessItem[]>;
|
|
63
67
|
/**
|
|
64
68
|
* Refresh recent items in background
|
|
65
69
|
*/
|
|
70
|
+
RefreshRecentItems(): Promise<void>;
|
|
71
|
+
/** @deprecated Use {@link RefreshRecentItems}. */
|
|
66
72
|
refreshRecentItems(): Promise<void>;
|
|
67
73
|
/**
|
|
68
74
|
* Batch-resolve record names for a list of recent access items using GetEntityRecordNames().
|
|
@@ -83,6 +89,8 @@ export declare class RecentAccessService {
|
|
|
83
89
|
/**
|
|
84
90
|
* Clears the cached recent items (useful for logout)
|
|
85
91
|
*/
|
|
92
|
+
ClearCache(): void;
|
|
93
|
+
/** @deprecated Use {@link ClearCache}. */
|
|
86
94
|
clearCache(): void;
|
|
87
95
|
static ɵfac: i0.ɵɵFactoryDeclaration<RecentAccessService, never>;
|
|
88
96
|
static ɵprov: i0.ɵɵInjectableDeclaration<RecentAccessService>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recent-access.service.d.ts","sourceRoot":"","sources":["../../src/lib/recent-access.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAqB,YAAY,EAAmC,MAAM,sBAAsB,CAAC;AAI3H,OAAO,EAAmB,UAAU,EAAE,MAAM,MAAM,CAAC;;AAEnD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAA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,CAAC,OAAO,CAAC,CAE1C;IAED;;;;;;;OAOG;IACU,SAAS,CACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,YAAY,EAC/B,YAAY,GAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAmB,GAC/E,OAAO,CAAC,IAAI,CAAC;IAiEhB,yCAAyC;IAC5B,SAAS,CACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,YAAY,EAC/B,YAAY,GAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAmB,GAC/E,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;OAIG;IACU,eAAe,CAAC,QAAQ,GAAE,MAAW,EAAE,YAAY,GAAE,OAAe,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAgD/G,+CAA+C;IAClC,eAAe,CAAC,QAAQ,GAAE,MAAW,EAAE,YAAY,GAAE,OAAe,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI/G;;OAEG;IACU,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhD,kDAAkD;IACrC,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhD;;;OAGG;YACW,kBAAkB;IA+BhC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAsBlC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAmB7B;;OAEG;IACI,UAAU,IAAI,IAAI;IAKzB,0CAA0C;IACnC,UAAU,IAAI,IAAI;yCAzSd,mBAAmB;6CAAnB,mBAAmB;CA4S/B"}
|
|
@@ -61,7 +61,7 @@ export class RecentAccessService {
|
|
|
61
61
|
* @param recordId - The record ID (single value or CompositeKey string)
|
|
62
62
|
* @param resourceType - The type of resource being accessed
|
|
63
63
|
*/
|
|
64
|
-
async
|
|
64
|
+
async LogAccess(entityName, recordId, resourceType = 'record') {
|
|
65
65
|
try {
|
|
66
66
|
const md = this.Provider;
|
|
67
67
|
const entityInfo = md.Entities.find(e => e.Name === entityName);
|
|
@@ -113,19 +113,23 @@ export class RecentAccessService {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
// Refresh the recent items list in background
|
|
116
|
-
this.
|
|
116
|
+
this.RefreshRecentItems();
|
|
117
117
|
}
|
|
118
118
|
catch (error) {
|
|
119
119
|
// Don't throw - this is non-critical functionality
|
|
120
120
|
console.error('RecentAccessService: Error logging access', error);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
+
/** @deprecated Use {@link LogAccess}. */
|
|
124
|
+
async logAccess(entityName, recordId, resourceType = 'record') {
|
|
125
|
+
return this.LogAccess(entityName, recordId, resourceType);
|
|
126
|
+
}
|
|
123
127
|
/**
|
|
124
128
|
* Loads recent access items for the current user using UserInfoEngine (cached).
|
|
125
129
|
* @param maxItems - Maximum number of items to return (default 15)
|
|
126
130
|
* @param forceRefresh - Force refresh even if already loaded
|
|
127
131
|
*/
|
|
128
|
-
async
|
|
132
|
+
async LoadRecentItems(maxItems = 15, forceRefresh = false) {
|
|
129
133
|
if (this._isLoaded && !forceRefresh) {
|
|
130
134
|
return this._recentItems$.value;
|
|
131
135
|
}
|
|
@@ -165,11 +169,19 @@ export class RecentAccessService {
|
|
|
165
169
|
this._isLoading$.next(false);
|
|
166
170
|
}
|
|
167
171
|
}
|
|
172
|
+
/** @deprecated Use {@link LoadRecentItems}. */
|
|
173
|
+
async loadRecentItems(maxItems = 15, forceRefresh = false) {
|
|
174
|
+
return this.LoadRecentItems(maxItems, forceRefresh);
|
|
175
|
+
}
|
|
168
176
|
/**
|
|
169
177
|
* Refresh recent items in background
|
|
170
178
|
*/
|
|
179
|
+
async RefreshRecentItems() {
|
|
180
|
+
await this.LoadRecentItems(15, true);
|
|
181
|
+
}
|
|
182
|
+
/** @deprecated Use {@link RefreshRecentItems}. */
|
|
171
183
|
async refreshRecentItems() {
|
|
172
|
-
|
|
184
|
+
return this.RefreshRecentItems();
|
|
173
185
|
}
|
|
174
186
|
/**
|
|
175
187
|
* Batch-resolve record names for a list of recent access items using GetEntityRecordNames().
|
|
@@ -254,10 +266,14 @@ export class RecentAccessService {
|
|
|
254
266
|
/**
|
|
255
267
|
* Clears the cached recent items (useful for logout)
|
|
256
268
|
*/
|
|
257
|
-
|
|
269
|
+
ClearCache() {
|
|
258
270
|
this._recentItems$.next([]);
|
|
259
271
|
this._isLoaded = false;
|
|
260
272
|
}
|
|
273
|
+
/** @deprecated Use {@link ClearCache}. */
|
|
274
|
+
clearCache() {
|
|
275
|
+
return this.ClearCache();
|
|
276
|
+
}
|
|
261
277
|
static ɵfac = function RecentAccessService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RecentAccessService)(); };
|
|
262
278
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RecentAccessService, factory: RecentAccessService.ɵfac, providedIn: 'root' });
|
|
263
279
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recent-access.service.js","sourceRoot":"","sources":["../../src/lib/recent-access.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAqB,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAyB,MAAM,sBAAsB,CAAC;AAC3H,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAyB,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAc,MAAM,MAAM,CAAC;;AAiBnD;;;GAGG;AACH;;;GAGG;AAIH,MAAM,OAAO,mBAAmB;IACtB,MAAM,CAAU,eAAe,GAAG,mCAAmC,CAAC;IACtE,aAAa,GAAG,IAAI,eAAe,CAAqB,EAAE,CAAC,CAAC;IAC5D,WAAW,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,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AAC;QACrB,CAAC;QACD,IAAI,cAAc,KAAK,4BAA4B,IAAI,cAAc,KAAK,wBAAwB,EAAE,CAAC;YACnG,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,UAAU;QACf,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;6GAnRU,mBAAmB;gEAAnB,mBAAmB,WAAnB,mBAAmB,mBAFlB,MAAM;;iFAEP,mBAAmB;cAH/B,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { IMetadataProvider, Metadata, RunView, CompositeKey, LogError, EntityRecordNameInput } from '@memberjunction/core';\nimport { GetGlobalObjectStore } from '@memberjunction/global';\nimport { MJUserRecordLogEntity, UserInfoEngine } from '@memberjunction/core-entities';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n/**\n * Represents a recently accessed resource\n */\nexport interface RecentAccessItem {\n id: string;\n entityId: string;\n entityName: string;\n recordId: string;\n recordName?: string;\n latestAt: Date;\n totalCount: number;\n /** Resource type for special handling (record, view, dashboard, artifact) */\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report';\n}\n\n/**\n * Service for tracking and retrieving recently accessed resources.\n * Uses the User Record Logs entity to persist access history.\n */\n/**\n * Multi-provider note: callers under a non-default provider should set\n * `service.Provider = component.ProviderToUse` before invoking any methods.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class RecentAccessService {\n private static readonly _globalStoreKey = '___SINGLETON__RecentAccessService';\n private _recentItems$ = new BehaviorSubject<RecentAccessItem[]>([]);\n private _isLoading$ = new BehaviorSubject<boolean>(false);\n private _isLoaded = false;\n\n private _provider: IMetadataProvider | null = null;\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n constructor() {\n const g = GetGlobalObjectStore()!;\n if (g[RecentAccessService._globalStoreKey]) {\n return g[RecentAccessService._globalStoreKey] as RecentAccessService;\n }\n g[RecentAccessService._globalStoreKey] = this;\n }\n\n public static get Instance(): RecentAccessService {\n return GetGlobalObjectStore()![RecentAccessService._globalStoreKey] as RecentAccessService;\n }\n\n /**\n * Observable of recent access items, sorted by most recent first\n */\n public get RecentItems(): Observable<RecentAccessItem[]> {\n return this._recentItems$.asObservable();\n }\n\n /**\n * Current value of recent items\n */\n public get RecentItemsValue(): RecentAccessItem[] {\n return this._recentItems$.value;\n }\n\n /**\n * Observable loading state\n */\n public get IsLoading(): Observable<boolean> {\n return this._isLoading$.asObservable();\n }\n\n /**\n * Logs access to a record. Creates or updates the User Record Log entry.\n * This is a fire-and-forget operation - errors are logged but don't interrupt the user.\n *\n * @param entityName - The name of the entity being accessed\n * @param recordId - The record ID (single value or CompositeKey string)\n * @param resourceType - The type of resource being accessed\n */\n public async logAccess(\n entityName: string,\n recordId: string | CompositeKey,\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report' = 'record'\n ): Promise<void> {\n try {\n const md = this.Provider;\n const entityInfo = md.Entities.find(e => e.Name === entityName);\n if (!entityInfo) {\n console.warn(`RecentAccessService: Entity \"${entityName}\" not found in metadata`);\n return;\n }\n\n // Persist the key in the compact CompositeKey segment form — the bare value for a single-column\n // primary key (so existing rows and lookups are unchanged), \"F1|v1||F2|v2\" for a composite one.\n // That is the form CompositeKey.FromURLSegment reads back; the previous Values(',') dropped\n // the field names, so a composite key written here could never be re-opened.\n const recordIdString = recordId instanceof CompositeKey\n ? recordId.ToCompactURLSegment()\n : recordId;\n\n // Check if we already have a log entry for this user/entity/record combination\n const rv = RunView.FromMetadataProvider(this.Provider);\n const existingResult = await rv.RunView<MJUserRecordLogEntity>({\n EntityName: 'MJ: User Record Logs',\n ExtraFilter: `UserID='${md.CurrentUser.ID}' AND EntityID='${entityInfo.ID}' AND RecordID='${recordIdString}'`,\n ResultType: 'entity_object',\n MaxRows: 1\n });\n\n if (!existingResult.Success) {\n console.error('RecentAccessService: Failed to check existing log', existingResult.ErrorMessage);\n return;\n }\n\n if (existingResult.Results && existingResult.Results.length > 0) {\n // Update existing entry\n const existing = existingResult.Results[0];\n existing.LatestAt = new Date();\n existing.TotalCount = (existing.TotalCount || 0) + 1;\n\n const saveResult = await existing.Save();\n if (!saveResult) {\n console.error('RecentAccessService: Failed to update log entry');\n }\n } else {\n // Create new entry\n const newLog = await md.GetEntityObject<MJUserRecordLogEntity>('MJ: User Record Logs', md.CurrentUser);\n newLog.UserID = md.CurrentUser.ID;\n newLog.EntityID = entityInfo.ID;\n newLog.RecordID = recordIdString;\n // EarliestAt and LatestAt have default values of getdate() in the DB\n // TotalCount defaults to 0, so we set it to 1\n newLog.TotalCount = 1;\n\n const saveResult = await newLog.Save();\n if (!saveResult) {\n console.error('RecentAccessService: Failed to create log entry');\n }\n }\n\n // Refresh the recent items list in background\n this.refreshRecentItems();\n } catch (error) {\n // Don't throw - this is non-critical functionality\n console.error('RecentAccessService: Error logging access', error);\n }\n }\n\n /**\n * Loads recent access items for the current user using UserInfoEngine (cached).\n * @param maxItems - Maximum number of items to return (default 15)\n * @param forceRefresh - Force refresh even if already loaded\n */\n public async loadRecentItems(maxItems: number = 15, forceRefresh: boolean = false): Promise<RecentAccessItem[]> {\n if (this._isLoaded && !forceRefresh) {\n return this._recentItems$.value;\n }\n\n try {\n this._isLoading$.next(true);\n\n const md = this.Provider;\n\n // Get recent records, limited to maxItems (already ordered by LatestAt DESC in engine)\n const userRecordLogs = UserInfoEngine.Instance.UserRecordLogs.slice(0, maxItems);\n\n const items: RecentAccessItem[] = [];\n\n for (const log of userRecordLogs) {\n const entityInfo = md.Entities.find(e => UUIDsEqual(e.ID, log.EntityID));\n if (!entityInfo) continue;\n\n // Determine resource type based on entity name\n const resourceType = this.determineResourceType(entityInfo.Name);\n\n items.push({\n id: log.ID,\n entityId: log.EntityID,\n entityName: entityInfo.Name,\n recordId: log.RecordID,\n latestAt: log.LatestAt,\n totalCount: log.TotalCount,\n resourceType\n });\n }\n\n // Batch-resolve record names for all items\n await this.resolveRecordNames(items, md);\n\n this._recentItems$.next(items);\n this._isLoaded = true;\n\n return items;\n } catch (error) {\n LogError('RecentAccessService: Error loading recent items', undefined, error);\n return [];\n } finally {\n this._isLoading$.next(false);\n }\n }\n\n /**\n * Refresh recent items in background\n */\n public async refreshRecentItems(): Promise<void> {\n await this.loadRecentItems(15, true);\n }\n\n /**\n * Batch-resolve record names for a list of recent access items using GetEntityRecordNames().\n * Mutates the items in-place to set recordName where resolved.\n */\n private async resolveRecordNames(items: RecentAccessItem[], md: IMetadataProvider): Promise<void> {\n const nameInputs: EntityRecordNameInput[] = [];\n const indexMap = new Map<string, number>();\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const compositeKey = this.buildCompositeKeyForRecord(item.entityName, item.recordId, md);\n if (!compositeKey) continue;\n\n nameInputs.push({ EntityName: item.entityName, CompositeKey: compositeKey });\n indexMap.set(`${item.entityName}||${compositeKey.ToConcatenatedString()}`, i);\n }\n\n if (nameInputs.length === 0) return;\n\n try {\n const nameResults = await md.GetEntityRecordNames(nameInputs);\n for (const result of nameResults) {\n if (result.Success && result.RecordName) {\n const key = `${result.EntityName}||${result.CompositeKey.ToConcatenatedString()}`;\n const index = indexMap.get(key);\n if (index !== undefined) {\n items[index].recordName = result.RecordName;\n }\n }\n }\n } catch (error) {\n console.warn('RecentAccessService: Failed to resolve record names', error);\n }\n }\n\n /**\n * Build a CompositeKey for a record. RecordID may be stored as either:\n * - Concatenated format: \"FieldName|Value\" or \"Field1|Val1||Field2|Val2\"\n * - Plain value: just the raw value (e.g. a GUID)\n * Detects the format and constructs the key accordingly.\n */\n private buildCompositeKeyForRecord(entityName: string, recordId: string, md: IMetadataProvider): CompositeKey | null {\n if (!recordId) return null;\n\n // If recordId contains '|', it's in concatenated format\n if (recordId.includes('|')) {\n try {\n const compositeKey = new CompositeKey();\n compositeKey.LoadFromConcatenatedString(recordId);\n if (compositeKey.KeyValuePairs.length > 0) return compositeKey;\n } catch {\n // Fall through to entity-based lookup\n }\n }\n\n // Plain value — map it onto the entity's real primary key column (whatever it is called).\n // FromURLSegment also re-parses a delimited segment, covering the case where the try above failed.\n const entityInfo = md.Entities.find(e => e.Name === entityName);\n if (!entityInfo || entityInfo.PrimaryKeys.length === 0) return null;\n\n return CompositeKey.FromURLSegment(entityInfo, recordId);\n }\n\n /**\n * Determines the resource type based on entity name\n */\n private determineResourceType(entityName: string): 'record' | 'view' | 'dashboard' | 'artifact' | 'report' {\n const normalizedName = entityName.toLowerCase();\n\n if (normalizedName === 'user views') {\n return 'view';\n }\n if (normalizedName === 'dashboards') {\n return 'dashboard';\n }\n if (normalizedName === 'mj: conversation artifacts' || normalizedName === 'conversation artifacts') {\n return 'artifact';\n }\n if (normalizedName === 'reports') {\n return 'report';\n }\n\n return 'record';\n }\n\n /**\n * Clears the cached recent items (useful for logout)\n */\n public clearCache(): void {\n this._recentItems$.next([]);\n this._isLoaded = false;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"recent-access.service.js","sourceRoot":"","sources":["../../src/lib/recent-access.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAqB,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAyB,MAAM,sBAAsB,CAAC;AAC3H,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAyB,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAc,MAAM,MAAM,CA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esContent":["import { Injectable } from '@angular/core';\nimport { IMetadataProvider, Metadata, RunView, CompositeKey, LogError, EntityRecordNameInput } from '@memberjunction/core';\nimport { GetGlobalObjectStore } from '@memberjunction/global';\nimport { MJUserRecordLogEntity, UserInfoEngine } from '@memberjunction/core-entities';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n/**\n * Represents a recently accessed resource\n */\nexport interface RecentAccessItem {\n id: string;\n entityId: string;\n entityName: string;\n recordId: string;\n recordName?: string;\n latestAt: Date;\n totalCount: number;\n /** Resource type for special handling (record, view, dashboard, artifact) */\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report';\n}\n\n/**\n * Service for tracking and retrieving recently accessed resources.\n * Uses the User Record Logs entity to persist access history.\n */\n/**\n * Multi-provider note: callers under a non-default provider should set\n * `service.Provider = component.ProviderToUse` before invoking any methods.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class RecentAccessService {\n private static readonly _globalStoreKey = '___SINGLETON__RecentAccessService';\n private _recentItems$ = new BehaviorSubject<RecentAccessItem[]>([]);\n private _isLoading$ = new BehaviorSubject<boolean>(false);\n private _isLoaded = false;\n\n private _provider: IMetadataProvider | null = null;\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n constructor() {\n const g = GetGlobalObjectStore()!;\n if (g[RecentAccessService._globalStoreKey]) {\n return g[RecentAccessService._globalStoreKey] as RecentAccessService;\n }\n g[RecentAccessService._globalStoreKey] = this;\n }\n\n public static get Instance(): RecentAccessService {\n return GetGlobalObjectStore()![RecentAccessService._globalStoreKey] as RecentAccessService;\n }\n\n /**\n * Observable of recent access items, sorted by most recent first\n */\n public get RecentItems(): Observable<RecentAccessItem[]> {\n return this._recentItems$.asObservable();\n }\n\n /**\n * Current value of recent items\n */\n public get RecentItemsValue(): RecentAccessItem[] {\n return this._recentItems$.value;\n }\n\n /**\n * Observable loading state\n */\n public get IsLoading(): Observable<boolean> {\n return this._isLoading$.asObservable();\n }\n\n /**\n * Logs access to a record. Creates or updates the User Record Log entry.\n * This is a fire-and-forget operation - errors are logged but don't interrupt the user.\n *\n * @param entityName - The name of the entity being accessed\n * @param recordId - The record ID (single value or CompositeKey string)\n * @param resourceType - The type of resource being accessed\n */\n public async LogAccess(\n entityName: string,\n recordId: string | CompositeKey,\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report' = 'record'\n ): Promise<void> {\n try {\n const md = this.Provider;\n const entityInfo = md.Entities.find(e => e.Name === entityName);\n if (!entityInfo) {\n console.warn(`RecentAccessService: Entity \"${entityName}\" not found in metadata`);\n return;\n }\n\n // Persist the key in the compact CompositeKey segment form — the bare value for a single-column\n // primary key (so existing rows and lookups are unchanged), \"F1|v1||F2|v2\" for a composite one.\n // That is the form CompositeKey.FromURLSegment reads back; the previous Values(',') dropped\n // the field names, so a composite key written here could never be re-opened.\n const recordIdString = recordId instanceof CompositeKey\n ? recordId.ToCompactURLSegment()\n : recordId;\n\n // Check if we already have a log entry for this user/entity/record combination\n const rv = RunView.FromMetadataProvider(this.Provider);\n const existingResult = await rv.RunView<MJUserRecordLogEntity>({\n EntityName: 'MJ: User Record Logs',\n ExtraFilter: `UserID='${md.CurrentUser.ID}' AND EntityID='${entityInfo.ID}' AND RecordID='${recordIdString}'`,\n ResultType: 'entity_object',\n MaxRows: 1\n });\n\n if (!existingResult.Success) {\n console.error('RecentAccessService: Failed to check existing log', existingResult.ErrorMessage);\n return;\n }\n\n if (existingResult.Results && existingResult.Results.length > 0) {\n // Update existing entry\n const existing = existingResult.Results[0];\n existing.LatestAt = new Date();\n existing.TotalCount = (existing.TotalCount || 0) + 1;\n\n const saveResult = await existing.Save();\n if (!saveResult) {\n console.error('RecentAccessService: Failed to update log entry');\n }\n } else {\n // Create new entry\n const newLog = await md.GetEntityObject<MJUserRecordLogEntity>('MJ: User Record Logs', md.CurrentUser);\n newLog.UserID = md.CurrentUser.ID;\n newLog.EntityID = entityInfo.ID;\n newLog.RecordID = recordIdString;\n // EarliestAt and LatestAt have default values of getdate() in the DB\n // TotalCount defaults to 0, so we set it to 1\n newLog.TotalCount = 1;\n\n const saveResult = await newLog.Save();\n if (!saveResult) {\n console.error('RecentAccessService: Failed to create log entry');\n }\n }\n\n // Refresh the recent items list in background\n this.RefreshRecentItems();\n } catch (error) {\n // Don't throw - this is non-critical functionality\n console.error('RecentAccessService: Error logging access', error);\n }\n }\n\n /** @deprecated Use {@link LogAccess}. */\n public async logAccess(\n entityName: string,\n recordId: string | CompositeKey,\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report' = 'record'\n ): Promise<void> {\n return this.LogAccess(entityName, recordId, resourceType);\n }\n\n /**\n * Loads recent access items for the current user using UserInfoEngine (cached).\n * @param maxItems - Maximum number of items to return (default 15)\n * @param forceRefresh - Force refresh even if already loaded\n */\n public async LoadRecentItems(maxItems: number = 15, forceRefresh: boolean = false): Promise<RecentAccessItem[]> {\n if (this._isLoaded && !forceRefresh) {\n return this._recentItems$.value;\n }\n\n try {\n this._isLoading$.next(true);\n\n const md = this.Provider;\n\n // Get recent records, limited to maxItems (already ordered by LatestAt DESC in engine)\n const userRecordLogs = UserInfoEngine.Instance.UserRecordLogs.slice(0, maxItems);\n\n const items: RecentAccessItem[] = [];\n\n for (const log of userRecordLogs) {\n const entityInfo = md.Entities.find(e => UUIDsEqual(e.ID, log.EntityID));\n if (!entityInfo) continue;\n\n // Determine resource type based on entity name\n const resourceType = this.determineResourceType(entityInfo.Name);\n\n items.push({\n id: log.ID,\n entityId: log.EntityID,\n entityName: entityInfo.Name,\n recordId: log.RecordID,\n latestAt: log.LatestAt,\n totalCount: log.TotalCount,\n resourceType\n });\n }\n\n // Batch-resolve record names for all items\n await this.resolveRecordNames(items, md);\n\n this._recentItems$.next(items);\n this._isLoaded = true;\n\n return items;\n } catch (error) {\n LogError('RecentAccessService: Error loading recent items', undefined, error);\n return [];\n } finally {\n this._isLoading$.next(false);\n }\n }\n\n /** @deprecated Use {@link LoadRecentItems}. */\n public async loadRecentItems(maxItems: number = 15, forceRefresh: boolean = false): Promise<RecentAccessItem[]> {\n return this.LoadRecentItems(maxItems, forceRefresh);\n }\n\n /**\n * Refresh recent items in background\n */\n public async RefreshRecentItems(): Promise<void> {\n await this.LoadRecentItems(15, true);\n }\n\n /** @deprecated Use {@link RefreshRecentItems}. */\n public async refreshRecentItems(): Promise<void> {\n return this.RefreshRecentItems();\n }\n\n /**\n * Batch-resolve record names for a list of recent access items using GetEntityRecordNames().\n * Mutates the items in-place to set recordName where resolved.\n */\n private async resolveRecordNames(items: RecentAccessItem[], md: IMetadataProvider): Promise<void> {\n const nameInputs: EntityRecordNameInput[] = [];\n const indexMap = new Map<string, number>();\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const compositeKey = this.buildCompositeKeyForRecord(item.entityName, item.recordId, md);\n if (!compositeKey) continue;\n\n nameInputs.push({ EntityName: item.entityName, CompositeKey: compositeKey });\n indexMap.set(`${item.entityName}||${compositeKey.ToConcatenatedString()}`, i);\n }\n\n if (nameInputs.length === 0) return;\n\n try {\n const nameResults = await md.GetEntityRecordNames(nameInputs);\n for (const result of nameResults) {\n if (result.Success && result.RecordName) {\n const key = `${result.EntityName}||${result.CompositeKey.ToConcatenatedString()}`;\n const index = indexMap.get(key);\n if (index !== undefined) {\n items[index].recordName = result.RecordName;\n }\n }\n }\n } catch (error) {\n console.warn('RecentAccessService: Failed to resolve record names', error);\n }\n }\n\n /**\n * Build a CompositeKey for a record. RecordID may be stored as either:\n * - Concatenated format: \"FieldName|Value\" or \"Field1|Val1||Field2|Val2\"\n * - Plain value: just the raw value (e.g. a GUID)\n * Detects the format and constructs the key accordingly.\n */\n private buildCompositeKeyForRecord(entityName: string, recordId: string, md: IMetadataProvider): CompositeKey | null {\n if (!recordId) return null;\n\n // If recordId contains '|', it's in concatenated format\n if (recordId.includes('|')) {\n try {\n const compositeKey = new CompositeKey();\n compositeKey.LoadFromConcatenatedString(recordId);\n if (compositeKey.KeyValuePairs.length > 0) return compositeKey;\n } catch {\n // Fall through to entity-based lookup\n }\n }\n\n // Plain value — map it onto the entity's real primary key column (whatever it is called).\n // FromURLSegment also re-parses a delimited segment, covering the case where the try above failed.\n const entityInfo = md.Entities.find(e => e.Name === entityName);\n if (!entityInfo || entityInfo.PrimaryKeys.length === 0) return null;\n\n return CompositeKey.FromURLSegment(entityInfo, recordId);\n }\n\n /**\n * Determines the resource type based on entity name\n */\n private determineResourceType(entityName: string): 'record' | 'view' | 'dashboard' | 'artifact' | 'report' {\n const normalizedName = entityName.toLowerCase();\n\n if (normalizedName === 'user views') {\n return 'view';\n }\n if (normalizedName === 'dashboards') {\n return 'dashboard';\n }\n if (normalizedName === 'mj: conversation artifacts' || normalizedName === 'conversation artifacts') {\n return 'artifact';\n }\n if (normalizedName === 'reports') {\n return 'report';\n }\n\n return 'record';\n }\n\n /**\n * Clears the cached recent items (useful for logout)\n */\n public ClearCache(): void {\n this._recentItems$.next([]);\n this._isLoaded = false;\n }\n\n /** @deprecated Use {@link ClearCache}. */\n public clearCache(): void {\n return this.ClearCache();\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-shared-generic",
|
|
3
|
-
"version": "6.2.0-edge.
|
|
3
|
+
"version": "6.2.0-edge.2",
|
|
4
4
|
"description": "MemberJunction: Generic Angular Shared Package - utility services and reusable elements used in any Angular application.",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@angular/compiler": "21.2.22",
|
|
18
18
|
"@angular/compiler-cli": "21.2.22",
|
|
19
|
-
"@memberjunction/ng-test-utils": "6.2.0-edge.
|
|
19
|
+
"@memberjunction/ng-test-utils": "6.2.0-edge.2",
|
|
20
20
|
"vitest": "^4.0.18"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"rxjs": "^7.8.2"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@memberjunction/core": "6.2.0-edge.
|
|
30
|
-
"@memberjunction/ng-base-types": "6.2.0-edge.
|
|
31
|
-
"@memberjunction/core-entities": "6.2.0-edge.
|
|
32
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
33
|
-
"@memberjunction/theme-engine": "6.2.0-edge.
|
|
29
|
+
"@memberjunction/core": "6.2.0-edge.2",
|
|
30
|
+
"@memberjunction/ng-base-types": "6.2.0-edge.2",
|
|
31
|
+
"@memberjunction/core-entities": "6.2.0-edge.2",
|
|
32
|
+
"@memberjunction/global": "6.2.0-edge.2",
|
|
33
|
+
"@memberjunction/theme-engine": "6.2.0-edge.2",
|
|
34
34
|
"dompurify": "^3.3.0",
|
|
35
35
|
"tslib": "^2.8.1"
|
|
36
36
|
},
|