@rxap/services 15.0.0 → 16.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/avatar-image.service.mjs +18 -0
- package/esm2022/lib/footer.service.mjs +175 -0
- package/esm2022/lib/header.service.mjs +43 -0
- package/esm2022/lib/image-loader.service.mjs +36 -0
- package/esm2022/lib/loading-indicator.service.mjs +35 -0
- package/esm2022/lib/local-storage.service.mjs +29 -0
- package/esm2022/lib/reset.service.mjs +28 -0
- package/esm2022/lib/theme.service.mjs +75 -0
- package/esm2022/lib/version.service.mjs +24 -0
- package/esm2022/lib/window-container-sidenav.service.mjs +35 -0
- package/esm2022/testing/lib/local-storage.service.helper.spec.mjs +39 -0
- package/{fesm2020 → fesm2022}/rxap-services-testing.mjs +3 -4
- package/fesm2022/rxap-services-testing.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/rxap-services.mjs +59 -60
- package/fesm2022/rxap-services.mjs.map +1 -0
- package/package.json +15 -23
- package/esm2020/lib/avatar-image.service.mjs +0 -17
- package/esm2020/lib/footer.service.mjs +0 -174
- package/esm2020/lib/header.service.mjs +0 -42
- package/esm2020/lib/image-loader.service.mjs +0 -35
- package/esm2020/lib/loading-indicator.service.mjs +0 -34
- package/esm2020/lib/local-storage.service.mjs +0 -28
- package/esm2020/lib/reset.service.mjs +0 -27
- package/esm2020/lib/theme.service.mjs +0 -74
- package/esm2020/lib/version.service.mjs +0 -23
- package/esm2020/lib/window-container-sidenav.service.mjs +0 -34
- package/esm2020/testing/lib/local-storage.service.helper.spec.mjs +0 -38
- package/fesm2015/rxap-services-testing.mjs +0 -47
- package/fesm2015/rxap-services-testing.mjs.map +0 -1
- package/fesm2015/rxap-services.mjs +0 -474
- package/fesm2015/rxap-services.mjs.map +0 -1
- package/fesm2020/rxap-services-testing.mjs.map +0 -1
- package/fesm2020/rxap-services.mjs.map +0 -1
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/rxap-services.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/rxap-services-testing.mjs +0 -0
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
import { LocalStorageService } from '@rxap/services';
|
|
4
|
-
|
|
5
|
-
class LocalStorageServiceFake {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.localStorage = new Map();
|
|
8
|
-
}
|
|
9
|
-
get(key) {
|
|
10
|
-
var _a;
|
|
11
|
-
return (_a = this.localStorage.get(key)) !== null && _a !== void 0 ? _a : null;
|
|
12
|
-
}
|
|
13
|
-
has(key) {
|
|
14
|
-
return this.localStorage.has(key);
|
|
15
|
-
}
|
|
16
|
-
remove(key) {
|
|
17
|
-
this.localStorage.delete(key);
|
|
18
|
-
}
|
|
19
|
-
set(key, value) {
|
|
20
|
-
if (typeof value !== 'string') {
|
|
21
|
-
this.localStorage.set(key, JSON.stringify(value));
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
this.localStorage.set(key, value);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
LocalStorageServiceFake.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: LocalStorageServiceFake, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29
|
-
LocalStorageServiceFake.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: LocalStorageServiceFake });
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: LocalStorageServiceFake, decorators: [{
|
|
31
|
-
type: Injectable
|
|
32
|
-
}] });
|
|
33
|
-
const LOCAL_STORAGE_SERVICE_FAKE_PROVIDER = [
|
|
34
|
-
LocalStorageServiceFake,
|
|
35
|
-
{
|
|
36
|
-
provide: LocalStorageService,
|
|
37
|
-
useExisting: LocalStorageServiceFake,
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Generated bundle index. Do not edit.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
export { LOCAL_STORAGE_SERVICE_FAKE_PROVIDER, LocalStorageServiceFake };
|
|
46
|
-
//# sourceMappingURL=rxap-services-testing.mjs.map
|
|
47
|
-
//# sourceMappingURL=rxap-services-testing.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-services-testing.mjs","sources":["../esm2020/testing/lib/local-storage.service.helper.spec.mjs","../esm2020/testing/rxap-services-testing.mjs"],"sourcesContent":["import { Injectable, } from '@angular/core';\nimport { LocalStorageService } from '@rxap/services';\nimport * as i0 from \"@angular/core\";\nexport class LocalStorageServiceFake {\n constructor() {\n this.localStorage = new Map();\n }\n get(key) {\n return this.localStorage.get(key) ?? null;\n }\n has(key) {\n return this.localStorage.has(key);\n }\n remove(key) {\n this.localStorage.delete(key);\n }\n set(key, value) {\n if (typeof value !== 'string') {\n this.localStorage.set(key, JSON.stringify(value));\n }\n else {\n this.localStorage.set(key, value);\n }\n }\n}\nLocalStorageServiceFake.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"15.0.3\", ngImport: i0, type: LocalStorageServiceFake, deps: [], target: i0.ɵɵFactoryTarget.Injectable });\nLocalStorageServiceFake.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"15.0.3\", ngImport: i0, type: LocalStorageServiceFake });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"15.0.3\", ngImport: i0, type: LocalStorageServiceFake, decorators: [{\n type: Injectable\n }] });\nexport const LOCAL_STORAGE_SERVICE_FAKE_PROVIDER = [\n LocalStorageServiceFake,\n {\n provide: LocalStorageService,\n useExisting: LocalStorage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oaXMubG9jYWxTdG9yYWdlLmRlbGV0ZShrZXkpO1xuICB9XG5cbiAgcHVibGljIHNldChrZXk6IHN0cmluZywgdmFsdWU6IGFueSk6IHZvaWQge1xuICAgIGlmICh0eXBlb2YgdmFsdWUgIT09ICdzdHJpbmcnKSB7XG4gICAgICB0aGlzLmxvY2FsU3RvcmFnZS5zZXQoa2V5LCBKU09OLnN0cmluZ2lmeSh2YWx1ZSkpO1xuICAgIH0gZWxzZSB7XG4gICAgICB0aGlzLmxvY2FsU3RvcmFnZS5zZXQoa2V5LCB2YWx1ZSk7XG4gICAgfVxuICB9XG5cbn1cblxuZXhwb3J0IGNvbnN0IExPQ0FMX1NUT1JBR0VfU0VSVklDRV9GQUtFX1BST1ZJREVSOiBQcm92aWRlcltdID0gW1xuICBMb2NhbFN0b3JhZ2VTZXJ2aWNlRmFrZSxcbiAge1xuICAgIHByb3ZpZGU6ICAgICBMb2NhbFN0b3JhZ2VTZXJ2aWNlLFxuICAgIHVzZUV4aXN0aW5nOiBMb2NhbFN0b3JhZ2VTZXJ2aWNlRmFrZSxcbiAgfSxcbl07XG4iXX0=","/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public_api';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnhhcC1zZXJ2aWNlcy10ZXN0aW5nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9zZXJ2aWNlcy90ZXN0aW5nL3NyYy9yeGFwLXNlcnZpY2VzLXRlc3RpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWNfYXBpJztcbiJdfQ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AAE,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC;AACnJ,EAAE,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE,UAAU,EAAE,CAAC;AACrH,YAAA,IAAI,EAAE,UAAU;SACnB,CAAC,EAAE,CAAC,CAAC;AACD,MAAA,mCAAmC,GAAG;IAC/C,uBAAuB;AACvB,IAAA;AACI,QAAA,OAAO,EAAE,mBAAmB;AAC5B,QAAA,WAAW,EAAE,uBAAuB;AACvC,KAAA;;;ACnCL;;AAEG;;;;"}
|
|
@@ -1,474 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, isDevMode, Injectable, Optional, Inject } from '@angular/core';
|
|
3
|
-
import { Subject, BehaviorSubject, Subscription } from 'rxjs';
|
|
4
|
-
import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
5
|
-
import { map, filter, delay } from 'rxjs/operators';
|
|
6
|
-
import * as i1 from '@angular/router';
|
|
7
|
-
import { NavigationStart, NavigationEnd, NavigationCancel, Router } from '@angular/router';
|
|
8
|
-
import { HttpRequest, HttpParams } from '@angular/common/http';
|
|
9
|
-
import { ToggleSubject } from '@rxap/utilities/rxjs';
|
|
10
|
-
|
|
11
|
-
const RXAP_FOOTER_COMPONENT = new InjectionToken('rxap/services/footer-component');
|
|
12
|
-
function IsFooterTemplate(obj) {
|
|
13
|
-
return obj.hasOwnProperty('template');
|
|
14
|
-
}
|
|
15
|
-
function IsFooterComponent(obj) {
|
|
16
|
-
return obj.hasOwnProperty('component');
|
|
17
|
-
}
|
|
18
|
-
class FooterService {
|
|
19
|
-
constructor(footerComponents = null) {
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated removed
|
|
22
|
-
*/
|
|
23
|
-
this.update$ = new Subject();
|
|
24
|
-
this.components = [];
|
|
25
|
-
this.templates = [];
|
|
26
|
-
this.componentPortalMap = new WeakMap();
|
|
27
|
-
this.templatePortalMap = new WeakMap();
|
|
28
|
-
this.portals$ = new BehaviorSubject([]);
|
|
29
|
-
this.portalCount$ = this.portals$.pipe(map(portals => portals.length));
|
|
30
|
-
if (footerComponents) {
|
|
31
|
-
if (isDevMode()) {
|
|
32
|
-
console.warn('The RXAP_FOOTER_COMPONENT InjectionToken is deprecated and will be removed in the feature!');
|
|
33
|
-
}
|
|
34
|
-
if (Array.isArray(footerComponents)) {
|
|
35
|
-
footerComponents.forEach((comp, index) => this.addComponent(comp, { order: index }, true));
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this.addComponent(footerComponents, { order: 0 }, true);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated removed
|
|
44
|
-
*/
|
|
45
|
-
get countComponent() {
|
|
46
|
-
return this.components.length;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated removed
|
|
50
|
-
*/
|
|
51
|
-
get countComponents() {
|
|
52
|
-
return this.components.length;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated removed
|
|
56
|
-
*/
|
|
57
|
-
get hasComponents() {
|
|
58
|
-
return this.countComponents !== 0;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated removed
|
|
62
|
-
*/
|
|
63
|
-
get hasComponentsOrTemplates() {
|
|
64
|
-
return this.hasComponents || this.hasTemplates;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated removed
|
|
68
|
-
*/
|
|
69
|
-
get countTemplates() {
|
|
70
|
-
return this.templates.length;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* @deprecated removed
|
|
74
|
-
*/
|
|
75
|
-
get hasTemplates() {
|
|
76
|
-
return this.countTemplates !== 0;
|
|
77
|
-
}
|
|
78
|
-
pushPortal(portal) {
|
|
79
|
-
if (!this.portals$.value.includes(portal)) {
|
|
80
|
-
this.portals$.next([...this.portals$.value, portal]);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
if (isDevMode()) {
|
|
84
|
-
console.warn('Can not add the same portal multiple times');
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
removePortal(portal) {
|
|
89
|
-
const index = this.portals$.value.indexOf(portal);
|
|
90
|
-
if (index !== -1) {
|
|
91
|
-
const portals = [...this.portals$.value];
|
|
92
|
-
portals.splice(index, 1);
|
|
93
|
-
this.portals$.next(portals);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated removed
|
|
98
|
-
*/
|
|
99
|
-
addComponent(component, options = { order: 0 }, silent = false) {
|
|
100
|
-
this.components.push(Object.assign(Object.assign({}, options), { component }));
|
|
101
|
-
if (!silent) {
|
|
102
|
-
this.update$.next();
|
|
103
|
-
}
|
|
104
|
-
const portal = new ComponentPortal(component, null, options.injector);
|
|
105
|
-
this.pushPortal(portal);
|
|
106
|
-
this.componentPortalMap.set(component, portal);
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated removed
|
|
110
|
-
*/
|
|
111
|
-
removeComponent(component) {
|
|
112
|
-
this.components = this.components.filter(coi => coi.component !== component);
|
|
113
|
-
this.update$.next();
|
|
114
|
-
const portal = this.componentPortalMap.get(component);
|
|
115
|
-
if (portal) {
|
|
116
|
-
this.componentPortalMap.delete(component);
|
|
117
|
-
this.removePortal(portal);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* @deprecated removed
|
|
122
|
-
*/
|
|
123
|
-
addTemplate(template, viewContainerRef, options = { order: 0 }, silent = false) {
|
|
124
|
-
this.templates.push(Object.assign(Object.assign({}, options), { template }));
|
|
125
|
-
if (!silent) {
|
|
126
|
-
this.update$.next();
|
|
127
|
-
}
|
|
128
|
-
const portal = new TemplatePortal(template, viewContainerRef);
|
|
129
|
-
this.pushPortal(portal);
|
|
130
|
-
this.templatePortalMap.set(template, portal);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* @deprecated removed
|
|
134
|
-
*/
|
|
135
|
-
removeTemplate(template) {
|
|
136
|
-
this.templates = this.templates.filter(temp => temp.template !== template);
|
|
137
|
-
this.update$.next();
|
|
138
|
-
const portal = this.templatePortalMap.get(template);
|
|
139
|
-
if (portal) {
|
|
140
|
-
this.removePortal(portal);
|
|
141
|
-
this.templatePortalMap.delete(template);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* @deprecated removed
|
|
146
|
-
*/
|
|
147
|
-
getComponents() {
|
|
148
|
-
return this
|
|
149
|
-
.components
|
|
150
|
-
.sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* @deprecated removed
|
|
154
|
-
*/
|
|
155
|
-
getTemplates() {
|
|
156
|
-
return this
|
|
157
|
-
.templates
|
|
158
|
-
.sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* @deprecated removed
|
|
162
|
-
*/
|
|
163
|
-
getComponentsAndTemplates() {
|
|
164
|
-
return [...this.templates, ...this.components]
|
|
165
|
-
.sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
FooterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: FooterService, deps: [{ token: RXAP_FOOTER_COMPONENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
169
|
-
FooterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: FooterService, providedIn: 'root' });
|
|
170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: FooterService, decorators: [{
|
|
171
|
-
type: Injectable,
|
|
172
|
-
args: [{ providedIn: 'root' }]
|
|
173
|
-
}], ctorParameters: function () {
|
|
174
|
-
return [{ type: undefined, decorators: [{
|
|
175
|
-
type: Optional
|
|
176
|
-
}, {
|
|
177
|
-
type: Inject,
|
|
178
|
-
args: [RXAP_FOOTER_COMPONENT]
|
|
179
|
-
}] }];
|
|
180
|
-
} });
|
|
181
|
-
|
|
182
|
-
class ResetService {
|
|
183
|
-
constructor() {
|
|
184
|
-
this.view$ = new Subject();
|
|
185
|
-
this.dataSource$ = new Subject();
|
|
186
|
-
}
|
|
187
|
-
resetView() {
|
|
188
|
-
this.view$.next();
|
|
189
|
-
}
|
|
190
|
-
resetDataSource() {
|
|
191
|
-
// TODO : iterate over the list of active DataSources
|
|
192
|
-
this.dataSource$.next();
|
|
193
|
-
}
|
|
194
|
-
resetAll() {
|
|
195
|
-
this.resetDataSource();
|
|
196
|
-
this.resetView();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
ResetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ResetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
200
|
-
ResetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ResetService, providedIn: 'root' });
|
|
201
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ResetService, decorators: [{
|
|
202
|
-
type: Injectable,
|
|
203
|
-
args: [{ providedIn: 'root' }]
|
|
204
|
-
}] });
|
|
205
|
-
|
|
206
|
-
class ThemeService {
|
|
207
|
-
constructor() {
|
|
208
|
-
this.baseFontSize = Number(localStorage.getItem('rxap-base-font-size') || 62.5);
|
|
209
|
-
// this.darkMode$ must be first bc the this.darkMode getter is used in this.toggleDarkTheme method
|
|
210
|
-
this.darkMode$ = new BehaviorSubject(localStorage.getItem('rxap-light-theme') === null);
|
|
211
|
-
this.setBaseFontSize(this.baseFontSize);
|
|
212
|
-
this.toggleDarkTheme(this.darkMode);
|
|
213
|
-
}
|
|
214
|
-
get darkMode() {
|
|
215
|
-
return this.darkMode$.value;
|
|
216
|
-
}
|
|
217
|
-
toggleDarkTheme(checked = !this.darkMode) {
|
|
218
|
-
if (checked) {
|
|
219
|
-
document.body.classList.add('dark-theme');
|
|
220
|
-
localStorage.removeItem('rxap-light-theme');
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
document.body.classList.remove('dark-theme');
|
|
224
|
-
localStorage.setItem('rxap-light-theme', 'true');
|
|
225
|
-
}
|
|
226
|
-
if (checked !== this.darkMode$.value) {
|
|
227
|
-
this.darkMode$.next(checked);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
setBaseFontSize(value) {
|
|
231
|
-
localStorage.setItem('rxap-base-font-size', value.toFixed(3));
|
|
232
|
-
document.documentElement.style.fontSize = `${value}%`;
|
|
233
|
-
this.baseFontSize = value;
|
|
234
|
-
switch (value) {
|
|
235
|
-
case 40:
|
|
236
|
-
document.body.classList.remove('size-xxs', 'size-xs', 'size-s', 'size-m', 'size-l', 'size-xl', 'size-xxl', 'size-xxxl');
|
|
237
|
-
document.body.classList.add('size-xxs');
|
|
238
|
-
break;
|
|
239
|
-
case 45:
|
|
240
|
-
document.body.classList.remove('size-xxs', 'size-xs', 'size-s', 'size-m', 'size-l', 'size-xl', 'size-xxl', 'size-xxxl');
|
|
241
|
-
document.body.classList.add('size-xs');
|
|
242
|
-
break;
|
|
243
|
-
case 55:
|
|
244
|
-
document.body.classList.remove('size-xxs', 'size-xs', 'size-s', 'size-m', 'size-l', 'size-xl', 'size-xxl', 'size-xxxl');
|
|
245
|
-
document.body.classList.add('size-s');
|
|
246
|
-
break;
|
|
247
|
-
case 62.5:
|
|
248
|
-
document.body.classList.remove('size-xxs', 'size-xs', 'size-s', 'size-m', 'size-l', 'size-xl', 'size-xxl', 'size-xxxl');
|
|
249
|
-
document.body.classList.add('size-m');
|
|
250
|
-
break;
|
|
251
|
-
case 70:
|
|
252
|
-
document.body.classList.remove('size-xxs', 'size-xs', 'size-s', 'size-m', 'size-l', 'size-xl', 'size-xxl', 'size-xxxl');
|
|
253
|
-
document.body.classList.add('size-l');
|
|
254
|
-
break;
|
|
255
|
-
case 80:
|
|
256
|
-
document.body.classList.remove('size-xxs', 'size-xs', 'size-s', 'size-m', 'size-l', 'size-xl', 'size-xxl', 'size-xxxl');
|
|
257
|
-
document.body.classList.add('size-xl');
|
|
258
|
-
break;
|
|
259
|
-
case 90:
|
|
260
|
-
document.body.classList.remove('size-xxs', 'size-xs', 'size-s', 'size-m', 'size-l', 'size-xl', 'size-xxl', 'size-xxxl');
|
|
261
|
-
document.body.classList.add('size-xxl');
|
|
262
|
-
break;
|
|
263
|
-
case 100:
|
|
264
|
-
document.body.classList.remove('size-xxs', 'size-xs', 'size-s', 'size-m', 'size-l', 'size-xl', 'size-xxl', 'size-xxxl');
|
|
265
|
-
document.body.classList.add('size-xxxl');
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
ThemeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
271
|
-
ThemeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
272
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ThemeService, decorators: [{
|
|
273
|
-
type: Injectable,
|
|
274
|
-
args: [{ providedIn: 'root' }]
|
|
275
|
-
}], ctorParameters: function () { return []; } });
|
|
276
|
-
|
|
277
|
-
class HeaderService {
|
|
278
|
-
constructor(router) {
|
|
279
|
-
this.router = router;
|
|
280
|
-
this.update$ = new Subject();
|
|
281
|
-
this.components = [];
|
|
282
|
-
this.navigating$ = this.router.events.pipe(filter(event => event instanceof NavigationStart ||
|
|
283
|
-
event instanceof NavigationEnd ||
|
|
284
|
-
event instanceof NavigationCancel), map(event => event instanceof NavigationStart));
|
|
285
|
-
}
|
|
286
|
-
get countComponent() {
|
|
287
|
-
return this.components.length + 1;
|
|
288
|
-
}
|
|
289
|
-
addComponent(component, order = 0) {
|
|
290
|
-
this.components.push({ component, order });
|
|
291
|
-
this.update$.next();
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Returns all added components ordered based on the order property
|
|
295
|
-
*/
|
|
296
|
-
getComponents() {
|
|
297
|
-
return this
|
|
298
|
-
.components
|
|
299
|
-
.sort((a, b) => a.order - b.order)
|
|
300
|
-
.map(item => item.component);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
HeaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: HeaderService, deps: [{ token: Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
304
|
-
HeaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: HeaderService, providedIn: 'root' });
|
|
305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: HeaderService, decorators: [{
|
|
306
|
-
type: Injectable,
|
|
307
|
-
args: [{ providedIn: 'root' }]
|
|
308
|
-
}], ctorParameters: function () {
|
|
309
|
-
return [{ type: i1.Router, decorators: [{
|
|
310
|
-
type: Inject,
|
|
311
|
-
args: [Router]
|
|
312
|
-
}] }];
|
|
313
|
-
} });
|
|
314
|
-
|
|
315
|
-
class VersionService {
|
|
316
|
-
constructor() {
|
|
317
|
-
this.update$ = new Subject();
|
|
318
|
-
this.modules = new Map();
|
|
319
|
-
}
|
|
320
|
-
setModule(moduleId, version) {
|
|
321
|
-
this.modules.set(moduleId, version);
|
|
322
|
-
this.update$.next();
|
|
323
|
-
}
|
|
324
|
-
get() {
|
|
325
|
-
return Array.from(this.modules.entries()).reduce((map, [moduleId, version]) => (Object.assign(Object.assign({}, map), { [moduleId]: version })), {});
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
VersionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: VersionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
329
|
-
VersionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: VersionService, providedIn: 'root' });
|
|
330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: VersionService, decorators: [{
|
|
331
|
-
type: Injectable,
|
|
332
|
-
args: [{ providedIn: 'root' }]
|
|
333
|
-
}] });
|
|
334
|
-
|
|
335
|
-
class LocalStorageService {
|
|
336
|
-
has(key) {
|
|
337
|
-
return localStorage.getItem(key) !== null;
|
|
338
|
-
}
|
|
339
|
-
set(key, value) {
|
|
340
|
-
if (typeof value !== 'string') {
|
|
341
|
-
localStorage.setItem(key, JSON.stringify(value));
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
localStorage.setItem(key, value);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
get(key) {
|
|
348
|
-
return localStorage.getItem(key);
|
|
349
|
-
}
|
|
350
|
-
remove(key) {
|
|
351
|
-
localStorage.removeItem(key);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
LocalStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
355
|
-
LocalStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: LocalStorageService, providedIn: 'root' });
|
|
356
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: LocalStorageService, decorators: [{
|
|
357
|
-
type: Injectable,
|
|
358
|
-
args: [{ providedIn: 'root' }]
|
|
359
|
-
}] });
|
|
360
|
-
|
|
361
|
-
class WindowContainerSidenavService {
|
|
362
|
-
constructor() {
|
|
363
|
-
this.components = new Map();
|
|
364
|
-
this.add$ = new Subject();
|
|
365
|
-
this.remove$ = new Subject();
|
|
366
|
-
}
|
|
367
|
-
add(component) {
|
|
368
|
-
if (this.components.has(component.id)) {
|
|
369
|
-
this.remove$.next(component);
|
|
370
|
-
}
|
|
371
|
-
this.components.set(component.id, component);
|
|
372
|
-
this.add$.next(component);
|
|
373
|
-
}
|
|
374
|
-
remove(componentOrId) {
|
|
375
|
-
const id = typeof componentOrId === 'string' ? componentOrId : componentOrId.id;
|
|
376
|
-
if (this.components.has(id)) {
|
|
377
|
-
this.remove$.next(this.components.get(id));
|
|
378
|
-
this.components.delete(id);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
getAll() {
|
|
382
|
-
return Array.from(this.components.values());
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
WindowContainerSidenavService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: WindowContainerSidenavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
386
|
-
WindowContainerSidenavService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: WindowContainerSidenavService, providedIn: 'root' });
|
|
387
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: WindowContainerSidenavService, decorators: [{
|
|
388
|
-
type: Injectable,
|
|
389
|
-
args: [{ providedIn: 'root' }]
|
|
390
|
-
}] });
|
|
391
|
-
|
|
392
|
-
class ImageLoaderService {
|
|
393
|
-
constructor() {
|
|
394
|
-
this.loading = new Map();
|
|
395
|
-
this.loaded = new Map();
|
|
396
|
-
}
|
|
397
|
-
load(imageSrc) {
|
|
398
|
-
if (this.loaded.has(imageSrc)) {
|
|
399
|
-
return Promise.resolve();
|
|
400
|
-
}
|
|
401
|
-
if (this.loading.has(imageSrc)) {
|
|
402
|
-
return this.loading.get(imageSrc);
|
|
403
|
-
}
|
|
404
|
-
const loading = new Promise((resolve, reject) => {
|
|
405
|
-
const image = new Image();
|
|
406
|
-
image.src = imageSrc;
|
|
407
|
-
image.onerror = reject;
|
|
408
|
-
image.onload = () => resolve();
|
|
409
|
-
}).then(() => {
|
|
410
|
-
this.loaded.set(imageSrc, true);
|
|
411
|
-
}).finally(() => {
|
|
412
|
-
this.loading.delete(imageSrc);
|
|
413
|
-
});
|
|
414
|
-
this.loading.set(imageSrc, loading);
|
|
415
|
-
return loading;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
ImageLoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ImageLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
419
|
-
ImageLoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ImageLoaderService, providedIn: 'root' });
|
|
420
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ImageLoaderService, decorators: [{
|
|
421
|
-
type: Injectable,
|
|
422
|
-
args: [{ providedIn: 'root' }]
|
|
423
|
-
}] });
|
|
424
|
-
|
|
425
|
-
class AvatarImageService {
|
|
426
|
-
get({ name }) {
|
|
427
|
-
return new HttpRequest('GET', 'https://eu.ui-avatars.com/api', {
|
|
428
|
-
params: new HttpParams({ fromObject: { name } })
|
|
429
|
-
}).urlWithParams;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
AvatarImageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: AvatarImageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
433
|
-
AvatarImageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: AvatarImageService, providedIn: 'root' });
|
|
434
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: AvatarImageService, decorators: [{
|
|
435
|
-
type: Injectable,
|
|
436
|
-
args: [{ providedIn: 'root' }]
|
|
437
|
-
}] });
|
|
438
|
-
|
|
439
|
-
class LoadingIndicatorService {
|
|
440
|
-
constructor() {
|
|
441
|
-
this.loading$ = new ToggleSubject(true);
|
|
442
|
-
this._attachedLoadingSubscription = new Subscription();
|
|
443
|
-
this.isLoading$ = this.loading$.asObservable();
|
|
444
|
-
}
|
|
445
|
-
attachLoading(loading$) {
|
|
446
|
-
this._attachedLoadingSubscription.add(loading$.pipe(map(Boolean), delay(0)).subscribe(this.loading$.next));
|
|
447
|
-
}
|
|
448
|
-
ngOnDestroy() {
|
|
449
|
-
this._attachedLoadingSubscription.unsubscribe();
|
|
450
|
-
}
|
|
451
|
-
disable() {
|
|
452
|
-
setTimeout(() => {
|
|
453
|
-
this.loading$.disable();
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
enable() {
|
|
457
|
-
setTimeout(() => {
|
|
458
|
-
this.loading$.enable();
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
LoadingIndicatorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: LoadingIndicatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
463
|
-
LoadingIndicatorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: LoadingIndicatorService });
|
|
464
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: LoadingIndicatorService, decorators: [{
|
|
465
|
-
type: Injectable
|
|
466
|
-
}], ctorParameters: function () { return []; } });
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* Generated bundle index. Do not edit.
|
|
470
|
-
*/
|
|
471
|
-
|
|
472
|
-
export { AvatarImageService, FooterService, HeaderService, ImageLoaderService, IsFooterComponent, IsFooterTemplate, LoadingIndicatorService, LocalStorageService, RXAP_FOOTER_COMPONENT, ResetService, ThemeService, VersionService, WindowContainerSidenavService };
|
|
473
|
-
//# sourceMappingURL=rxap-services.mjs.map
|
|
474
|
-
//# sourceMappingURL=rxap-services.mjs.map
|