@rolatech/angular-services 17.1.0 → 17.2.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.
@@ -0,0 +1,48 @@
1
+ import { isPlatformBrowser } from '@angular/common';
2
+ import { Injectable, PLATFORM_ID, inject } from '@angular/core';
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export class ThemeService {
6
+ platformId = inject(PLATFORM_ID);
7
+ darkTheme = new BehaviorSubject(false);
8
+ isDarkTheme = this.darkTheme.asObservable();
9
+ constructor() {
10
+ if (isPlatformBrowser(this.platformId)) {
11
+ if (window.matchMedia) {
12
+ // Check if the dark-mode Media-Query matches
13
+ if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
14
+ this.setDarkTheme(true);
15
+ // Dark
16
+ }
17
+ else {
18
+ // Light
19
+ this.setDarkTheme(false);
20
+ }
21
+ }
22
+ else {
23
+ // Default (when Media-Queries are not supported)
24
+ }
25
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
26
+ const newColorScheme = e.matches ? 'dark' : 'light';
27
+ if (newColorScheme === 'dark') {
28
+ this.setDarkTheme(true);
29
+ }
30
+ else {
31
+ this.setDarkTheme(false);
32
+ }
33
+ });
34
+ }
35
+ }
36
+ setDarkTheme(isDarkTheme) {
37
+ this.darkTheme.next(isDarkTheme);
38
+ }
39
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
40
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeService, providedIn: 'root' });
41
+ }
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeService, decorators: [{
43
+ type: Injectable,
44
+ args: [{
45
+ providedIn: 'root',
46
+ }]
47
+ }], ctorPar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zID8gJ2RhcmsnIDogJ2xpZ2h0JztcbiAgICAgICAgaWYgKG5ld0NvbG9yU2NoZW1lID09PSAnZGFyaycpIHtcbiAgICAgICAgICB0aGlzLnNldERhcmtUaGVtZSh0cnVlKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aGlzLnNldERhcmtUaGVtZShmYWxzZSk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH1cbiAgfVxuXG4gIHNldERhcmtUaGVtZShpc0RhcmtUaGVtZTogYm9vbGVhbikge1xuICAgIHRoaXMuZGFya1RoZW1lLm5leHQoaXNEYXJrVGhlbWUpO1xuICB9XG59XG4iXX0=
@@ -1,12 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Injectable, EventEmitter, ViewContainerRef, Component, ViewChild, HostListener, Directive, APP_INITIALIZER, makeEnvironmentProviders } from '@angular/core';
3
- import { Location } from '@angular/common';
2
+ import { inject, Injectable, viewChild, ViewContainerRef, OutputEmitterRef, EventEmitter, Component, HostListener, PLATFORM_ID, Directive, APP_INITIALIZER, makeEnvironmentProviders } from '@angular/core';
3
+ import { Location, isPlatformBrowser } from '@angular/common';
4
4
  import { Router, NavigationEnd } from '@angular/router';
5
- import { MAT_DIALOG_DATA, MatDialogRef, MatDialog } from '@angular/material/dialog';
6
- import { take, map, BehaviorSubject, catchError } from 'rxjs';
5
+ import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions, MatDialogTitle, MatDialogContent, MatDialogClose, MatDialog } from '@angular/material/dialog';
6
+ import { take, map, BehaviorSubject } from 'rxjs';
7
+ import * as i1 from '@angular/material/button';
8
+ import { MatButtonModule } from '@angular/material/button';
7
9
  import { HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
8
10
  import { APP_CONFIG } from '@rolatech/angular-common';
9
- import * as i1 from '@angular/cdk/layout';
11
+ import * as i1$1 from '@angular/cdk/layout';
10
12
  import { Breakpoints, MediaMatcher } from '@angular/cdk/layout';
11
13
  import { map as map$1, shareReplay, finalize } from 'rxjs/operators';
12
14
  import { MatSnackBar } from '@angular/material/snack-bar';
@@ -47,10 +49,10 @@ class NavigationService {
47
49
  }
48
50
  return '';
49
51
  }
50
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: NavigationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
51
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: NavigationService, providedIn: 'root' });
52
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: NavigationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
53
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: NavigationService, providedIn: 'root' });
52
54
  }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: NavigationService, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: NavigationService, decorators: [{
54
56
  type: Injectable,
55
57
  args: [{
56
58
  providedIn: 'root',
@@ -58,29 +60,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
58
60
  }], ctorParameters: () => [] });
59
61
 
60
62
  class DialogComponent {
63
+ onEsc() {
64
+ this.close(false);
65
+ }
61
66
  data = inject(MAT_DIALOG_DATA);
62
67
  result;
63
68
  dialogRef = inject((MatDialogRef));
64
- componentRef;
69
+ componentRef = viewChild.required('container', { read: ViewContainerRef });
65
70
  ngOnInit() {
66
71
  this.createComponent();
67
72
  }
73
+ ngOnDestroy() {
74
+ this.componentRef().clear();
75
+ }
68
76
  createComponent() {
69
- this.componentRef.clear();
77
+ this.componentRef().clear();
70
78
  if (this.data.component) {
71
- const componentRef = this.componentRef.createComponent(this.data.component);
79
+ const componentRef = this.componentRef().createComponent(this.data.component);
72
80
  const hostedComponent = componentRef.instance;
73
81
  if (this.data.data) {
74
82
  Object.keys(this.data.data).forEach((inputName) => {
75
- hostedComponent[inputName] = this.data.data[inputName];
83
+ // hostedComponent[inputName] = this.data.data[inputName];
84
+ const signalInput = typeof hostedComponent[inputName] === 'function';
85
+ if (signalInput) {
86
+ // hostedComponent[inputName] = input(this.data.data[inputName]);
87
+ hostedComponent[inputName].set(this.data.data[inputName]);
88
+ }
89
+ else {
90
+ hostedComponent[inputName] = this.data.data[inputName];
91
+ }
92
+ // hostedComponent[inputName] = signalInput ? input<any>(this.data.data[inputName]) : this.data.data[inputName];
76
93
  });
77
94
  }
78
95
  Object.keys(hostedComponent)
79
- .filter((prop) => hostedComponent[prop] instanceof EventEmitter)
80
- .forEach((output) => {
81
- this[output] = new EventEmitter();
82
- hostedComponent[output].subscribe((data) => {
83
- this[output].emit(data);
96
+ .filter((prop) => {
97
+ return hostedComponent[prop] instanceof OutputEmitterRef;
98
+ })
99
+ .forEach((event) => {
100
+ this[event] = new EventEmitter();
101
+ hostedComponent[event].subscribe((data) => {
102
+ this[event].emit(data);
84
103
  });
85
104
  });
86
105
  }
@@ -92,9 +111,6 @@ class DialogComponent {
92
111
  }
93
112
  });
94
113
  }
95
- ngOnDestroy() {
96
- this.componentRef.clear();
97
- }
98
114
  cancel() {
99
115
  this.close(false);
100
116
  }
@@ -104,19 +120,13 @@ class DialogComponent {
104
120
  confirm() {
105
121
  this.close(this.result || true);
106
122
  }
107
- onEsc() {
108
- this.close(false);
109
- }
110
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
111
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: DialogComponent, isStandalone: true, selector: "rolatech-dialog", host: { listeners: { "keydown.esc": "onEsc()" } }, viewQueries: [{ propertyName: "componentRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div class=\"p-3 flex flex-col min-w-[320px]\" style=\"width: {{ data.width }};height: {{ data.height }}\">\n <div class=\"p-2\">\n <h1 class=\"text-xl\">{{ data.title }}</h1>\n </div>\n <div class=\"p-2\">\n <p class=\"\">{{ data.message }}</p>\n <ng-template #container></ng-template>\n <!-- <ng-container #container></ng-container> -->\n </div>\n <div class=\"flex-1\"></div>\n <div class=\"flex justify-end items-center p-2 mt-3\">\n <a class=\"mr-3 cursor-pointer\" (click)=\"cancel()\">{{ data.cancelText ? data.cancelText : 'Cancel' }}</a>\n <a class=\"w-20 text-center hover:bg-black bg-black cursor-pointer p-2 text-white rounded\" (click)=\"confirm()\">{{\n data.confirmText ? data.confirmText : 'Ok'\n }}</a>\n </div>\n</div>\n", styles: [""] });
123
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
124
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.0.1", type: DialogComponent, isStandalone: true, selector: "rolatech-dialog", host: { listeners: { "keydown.esc": "onEsc()" } }, viewQueries: [{ propertyName: "componentRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<div class=\"min-w-[320px]\">\n <h1 class=\"text-xl\" mat-dialog-title>{{ data.title }}</h1>\n <mat-dialog-content>\n <div>\n <p>{{ data.message }}</p>\n <ng-template #container></ng-template>\n <!-- <ng-container #container></ng-container> -->\n </div>\n </mat-dialog-content>\n <div class=\"flex-1\"></div>\n <mat-dialog-actions>\n <button mat-button (click)=\"cancel()\">{{ data.cancelText ? data.cancelText : 'Cancel' }}</button>\n <button mat-flat-button class=\"w-20\" (click)=\"confirm()\">{{ data.confirmText ? data.confirmText : 'Ok' }}</button>\n </mat-dialog-actions>\n <!-- <div class=\"flex justify-end items-center p-2 gap-3\">\n <a mat-button (click)=\"cancel()\">{{ data.cancelText ? data.cancelText : 'Cancel' }}</a>\n <a mat-flat-button class=\"w-20\" (click)=\"confirm()\">{{ data.confirmText ? data.confirmText : 'Ok' }}</a>\n </div> -->\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] });
112
125
  }
113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DialogComponent, decorators: [{
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DialogComponent, decorators: [{
114
127
  type: Component,
115
- args: [{ selector: 'rolatech-dialog', standalone: true, template: "<div class=\"p-3 flex flex-col min-w-[320px]\" style=\"width: {{ data.width }};height: {{ data.height }}\">\n <div class=\"p-2\">\n <h1 class=\"text-xl\">{{ data.title }}</h1>\n </div>\n <div class=\"p-2\">\n <p class=\"\">{{ data.message }}</p>\n <ng-template #container></ng-template>\n <!-- <ng-container #container></ng-container> -->\n </div>\n <div class=\"flex-1\"></div>\n <div class=\"flex justify-end items-center p-2 mt-3\">\n <a class=\"mr-3 cursor-pointer\" (click)=\"cancel()\">{{ data.cancelText ? data.cancelText : 'Cancel' }}</a>\n <a class=\"w-20 text-center hover:bg-black bg-black cursor-pointer p-2 text-white rounded\" (click)=\"confirm()\">{{\n data.confirmText ? data.confirmText : 'Ok'\n }}</a>\n </div>\n</div>\n" }]
116
- }], propDecorators: { componentRef: [{
117
- type: ViewChild,
118
- args: ['container', { read: ViewContainerRef, static: true }]
119
- }], onEsc: [{
128
+ args: [{ selector: 'rolatech-dialog', standalone: true, imports: [MatButtonModule, MatDialogActions, MatDialogClose, MatDialogTitle, MatDialogContent], template: "<div class=\"min-w-[320px]\">\n <h1 class=\"text-xl\" mat-dialog-title>{{ data.title }}</h1>\n <mat-dialog-content>\n <div>\n <p>{{ data.message }}</p>\n <ng-template #container></ng-template>\n <!-- <ng-container #container></ng-container> -->\n </div>\n </mat-dialog-content>\n <div class=\"flex-1\"></div>\n <mat-dialog-actions>\n <button mat-button (click)=\"cancel()\">{{ data.cancelText ? data.cancelText : 'Cancel' }}</button>\n <button mat-flat-button class=\"w-20\" (click)=\"confirm()\">{{ data.confirmText ? data.confirmText : 'Ok' }}</button>\n </mat-dialog-actions>\n <!-- <div class=\"flex justify-end items-center p-2 gap-3\">\n <a mat-button (click)=\"cancel()\">{{ data.cancelText ? data.cancelText : 'Cancel' }}</a>\n <a mat-flat-button class=\"w-20\" (click)=\"confirm()\">{{ data.confirmText ? data.confirmText : 'Ok' }}</a>\n </div> -->\n</div>\n" }]
129
+ }], propDecorators: { onEsc: [{
120
130
  type: HostListener,
121
131
  args: ['keydown.esc']
122
132
  }] } });
@@ -137,10 +147,10 @@ class DialogService {
137
147
  confirmed() {
138
148
  return this.dialogRef.afterClosed().pipe(take(1), map((res) => res));
139
149
  }
140
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
141
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DialogService });
150
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
151
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DialogService });
142
152
  }
143
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DialogService, decorators: [{
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DialogService, decorators: [{
144
154
  type: Injectable
145
155
  }] });
146
156
 
@@ -188,16 +198,14 @@ class BaseService {
188
198
  });
189
199
  }
190
200
  search(word) {
191
- return this.http
192
- .get(`${this.actionUrl}?search=${word}`, {
201
+ return this.http.get(`${this.actionUrl}?search=${word}`, {
193
202
  withCredentials: true,
194
- })
195
- .pipe(map((result) => result));
203
+ });
196
204
  }
197
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: BaseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
198
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: BaseService, providedIn: 'root' });
205
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BaseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
206
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BaseService, providedIn: 'root' });
199
207
  }
200
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: BaseService, decorators: [{
208
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BaseService, decorators: [{
201
209
  type: Injectable,
202
210
  args: [{
203
211
  providedIn: 'root',
@@ -221,10 +229,10 @@ class LoadingService {
221
229
  async dismiss() {
222
230
  this.isLoading = false;
223
231
  }
224
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: LoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
225
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: LoadingService, providedIn: 'root' });
232
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
233
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LoadingService, providedIn: 'root' });
226
234
  }
227
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: LoadingService, decorators: [{
235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LoadingService, decorators: [{
228
236
  type: Injectable,
229
237
  args: [{
230
238
  providedIn: 'root',
@@ -237,58 +245,42 @@ class MediaService extends BaseService {
237
245
  super.init();
238
246
  }
239
247
  upload(data) {
240
- return this.http
241
- .post(`${this.actionUrl}/upload`, data, {
248
+ return this.http.post(`${this.actionUrl}/upload`, data, {
242
249
  reportProgress: false,
243
250
  withCredentials: true,
244
251
  // headers: new HttpHeaders({
245
252
  // 'Content-Type': 'multipart/form-data',
246
253
  // }),
247
- })
248
- .pipe(map((result) => result));
254
+ });
249
255
  }
250
256
  uploadAndSave(data) {
251
- return this.http
252
- .post(`${this.actionUrl}/save`, data, {
257
+ return this.http.post(`${this.actionUrl}/save`, data, {
253
258
  reportProgress: false,
254
259
  withCredentials: true,
255
- })
256
- .pipe(map((result) => result));
260
+ });
257
261
  }
258
262
  deleteBy(filename) {
259
- return this.http
260
- .delete(`${this.actionUrl}/${filename}`, {})
261
- .pipe(map((result) => result));
263
+ return this.http.delete(`${this.actionUrl}/${filename}`, {});
262
264
  }
263
265
  batchDelete(data) {
264
- return this.http
265
- .post(`${this.actionUrl}/batch`, data, { withCredentials: true })
266
- .pipe(map((result) => result));
266
+ return this.http.post(`${this.actionUrl}/batch`, data, { withCredentials: true });
267
267
  }
268
268
  moveToGroup(data) {
269
- return this.http
270
- .post(`${this.actionUrl}/move`, data, { withCredentials: true })
271
- .pipe(map((result) => result));
269
+ return this.http.post(`${this.actionUrl}/move`, data, { withCredentials: true });
272
270
  }
273
271
  addGroup(data) {
274
- return this.http
275
- .post(`${this.actionUrl}/groups`, data, { withCredentials: true })
276
- .pipe(map((result) => result));
272
+ return this.http.post(`${this.actionUrl}/groups`, data, { withCredentials: true });
277
273
  }
278
274
  findGroup(id) {
279
- return this.http
280
- .get(`${this.actionUrl}/groups/${id}`, { withCredentials: true })
281
- .pipe(map((result) => result));
275
+ return this.http.get(`${this.actionUrl}/groups/${id}`, { withCredentials: true });
282
276
  }
283
277
  findGroups(options) {
284
- return this.http
285
- .get(`${this.actionUrl}/groups`, { withCredentials: true })
286
- .pipe(map((result) => result));
278
+ return this.http.get(`${this.actionUrl}/groups`, { withCredentials: true });
287
279
  }
288
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MediaService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
289
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MediaService, providedIn: 'root' });
280
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: MediaService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
281
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: MediaService, providedIn: 'root' });
290
282
  }
291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MediaService, decorators: [{
283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: MediaService, decorators: [{
292
284
  type: Injectable,
293
285
  args: [{
294
286
  providedIn: 'root',
@@ -304,12 +296,12 @@ class LayoutService {
304
296
  .observe([Breakpoints.Small, Breakpoints.HandsetPortrait])
305
297
  .pipe(map$1((result) => result.matches), shareReplay());
306
298
  }
307
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: LayoutService, deps: [{ token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
308
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: LayoutService });
299
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LayoutService, deps: [{ token: i1$1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
300
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LayoutService });
309
301
  }
310
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: LayoutService, decorators: [{
302
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LayoutService, decorators: [{
311
303
  type: Injectable
312
- }], ctorParameters: () => [{ type: i1.BreakpointObserver }] });
304
+ }], ctorParameters: () => [{ type: i1$1.BreakpointObserver }] });
313
305
 
314
306
  class SnackBarService {
315
307
  snackBar = inject(MatSnackBar);
@@ -319,10 +311,10 @@ class SnackBarService {
319
311
  dismiss() {
320
312
  this.snackBar.dismiss();
321
313
  }
322
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: SnackBarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
323
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: SnackBarService });
314
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SnackBarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
315
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SnackBarService });
324
316
  }
325
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: SnackBarService, decorators: [{
317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SnackBarService, decorators: [{
326
318
  type: Injectable
327
319
  }] });
328
320
 
@@ -330,52 +322,32 @@ class SupportService {
330
322
  environment = inject(APP_CONFIG);
331
323
  http = inject(HttpClient);
332
324
  findAllBuckets(options) {
333
- return this.http
334
- .get(`${this.environment.baseUrl}/support/buckets`, {
325
+ return this.http.get(`${this.environment.baseUrl}/support/buckets`, {
335
326
  params: options,
336
327
  withCredentials: false,
337
- })
338
- .pipe(catchError((error) => {
339
- throw error;
340
- }));
328
+ });
341
329
  }
342
330
  findAll(options) {
343
- return this.http
344
- .get(`${this.environment.baseUrl}/support/folders`, {
331
+ return this.http.get(`${this.environment.baseUrl}/support/folders`, {
345
332
  params: options,
346
333
  withCredentials: false,
347
- })
348
- .pipe(catchError((error) => {
349
- throw error;
350
- }));
334
+ });
351
335
  }
352
336
  findFolderBySlug(slug) {
353
- return this.http
354
- .get(`${this.environment.baseUrl}/support/folders/slug/${slug}`, {
337
+ return this.http.get(`${this.environment.baseUrl}/support/folders/slug/${slug}`, {
355
338
  withCredentials: false,
356
- })
357
- .pipe(catchError((error) => {
358
- throw error;
359
- }));
339
+ });
360
340
  }
361
341
  findByPath(path) {
362
- return this.http
363
- .get(`${this.environment.baseUrl}/support/folders/by?path=${path}`, {
342
+ return this.http.get(`${this.environment.baseUrl}/support/folders/by?path=${path}`, {
364
343
  withCredentials: false,
365
- })
366
- .pipe(catchError((error) => {
367
- throw error;
368
- }));
344
+ });
369
345
  }
370
346
  findAllFiles(options) {
371
- return this.http
372
- .get(`${this.environment.baseUrl}/support/files`, {
347
+ return this.http.get(`${this.environment.baseUrl}/support/files`, {
373
348
  params: options,
374
349
  withCredentials: false,
375
- })
376
- .pipe(catchError((error) => {
377
- throw error;
378
- }));
350
+ });
379
351
  }
380
352
  findFileByFolder(folder) {
381
353
  return this.http.get(`${this.environment.baseUrl}/support/files/by?folder=${folder}`, {
@@ -407,10 +379,10 @@ class SupportService {
407
379
  withCredentials: true,
408
380
  });
409
381
  }
410
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: SupportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
411
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: SupportService, providedIn: 'root' });
382
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SupportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
383
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SupportService, providedIn: 'root' });
412
384
  }
413
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: SupportService, decorators: [{
385
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SupportService, decorators: [{
414
386
  type: Injectable,
415
387
  args: [{
416
388
  providedIn: 'root',
@@ -438,10 +410,10 @@ class BreadcrumbService {
438
410
  relativeTo: route,
439
411
  });
440
412
  }
441
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
442
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
413
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
414
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
443
415
  }
444
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: BreadcrumbService, decorators: [{
416
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BreadcrumbService, decorators: [{
445
417
  type: Injectable,
446
418
  args: [{
447
419
  providedIn: 'root',
@@ -473,13 +445,57 @@ class SidenavService {
473
445
  this.isCollaped = !this.isMobile && !this.sidenav?.opened;
474
446
  }
475
447
  lists() { }
476
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: SidenavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
477
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: SidenavService });
448
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
449
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavService });
478
450
  }
479
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: SidenavService, decorators: [{
451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavService, decorators: [{
480
452
  type: Injectable
481
453
  }], ctorParameters: () => [] });
482
454
 
455
+ class ThemeService {
456
+ platformId = inject(PLATFORM_ID);
457
+ darkTheme = new BehaviorSubject(false);
458
+ isDarkTheme = this.darkTheme.asObservable();
459
+ constructor() {
460
+ if (isPlatformBrowser(this.platformId)) {
461
+ if (window.matchMedia) {
462
+ // Check if the dark-mode Media-Query matches
463
+ if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
464
+ this.setDarkTheme(true);
465
+ // Dark
466
+ }
467
+ else {
468
+ // Light
469
+ this.setDarkTheme(false);
470
+ }
471
+ }
472
+ else {
473
+ // Default (when Media-Queries are not supported)
474
+ }
475
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
476
+ const newColorScheme = e.matches ? 'dark' : 'light';
477
+ if (newColorScheme === 'dark') {
478
+ this.setDarkTheme(true);
479
+ }
480
+ else {
481
+ this.setDarkTheme(false);
482
+ }
483
+ });
484
+ }
485
+ }
486
+ setDarkTheme(isDarkTheme) {
487
+ this.darkTheme.next(isDarkTheme);
488
+ }
489
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
490
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeService, providedIn: 'root' });
491
+ }
492
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeService, decorators: [{
493
+ type: Injectable,
494
+ args: [{
495
+ providedIn: 'root',
496
+ }]
497
+ }], ctorParameters: () => [] });
498
+
483
499
  class LoadingInterceptor {
484
500
  loadingService;
485
501
  activeRequests = 0;
@@ -498,10 +514,10 @@ class LoadingInterceptor {
498
514
  }
499
515
  }));
500
516
  }
501
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: LoadingInterceptor, deps: [{ token: LoadingService }], target: i0.ɵɵFactoryTarget.Injectable });
502
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: LoadingInterceptor, providedIn: 'root' });
517
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LoadingInterceptor, deps: [{ token: LoadingService }], target: i0.ɵɵFactoryTarget.Injectable });
518
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LoadingInterceptor, providedIn: 'root' });
503
519
  }
504
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: LoadingInterceptor, decorators: [{
520
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LoadingInterceptor, decorators: [{
505
521
  type: Injectable,
506
522
  args: [{
507
523
  providedIn: 'root',
@@ -514,10 +530,10 @@ class BackButtonDirective {
514
530
  onClick() {
515
531
  this.navigation.back();
516
532
  }
517
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: BackButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
518
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: BackButtonDirective, isStandalone: true, selector: "[rolatechBackButton]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
533
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BackButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
534
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: BackButtonDirective, isStandalone: true, selector: "[rolatechBackButton]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
519
535
  }
520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: BackButtonDirective, decorators: [{
536
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BackButtonDirective, decorators: [{
521
537
  type: Directive,
522
538
  args: [{
523
539
  selector: '[rolatechBackButton]',
@@ -558,5 +574,5 @@ function provideAngularServices() {
558
574
  * Generated bundle index. Do not edit.
559
575
  */
560
576
 
561
- export { BackButtonDirective, BaseService, BreadcrumbService, DialogService, LayoutService, LoadingInterceptor, LoadingService, MediaService, NavigationService, SERVICE_DIRECTIVES, SidenavService, SnackBarService, SupportService, provideAngularServices };
577
+ export { BackButtonDirective, BaseService, BreadcrumbService, DialogService, LayoutService, LoadingInterceptor, LoadingService, MediaService, NavigationService, SERVICE_DIRECTIVES, SidenavService, SnackBarService, SupportService, ThemeService, provideAngularServices };
562
578
  //# sourceMappingURL=rolatech-angular-services.mjs.map