@rolatech/angular-services 0.2.1 → 16.1.0
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/angular-services.module.mjs +23 -0
- package/esm2022/lib/components/dialog/dialog.component.mjs +64 -0
- package/esm2022/lib/directive/back-button.directive.mjs +24 -0
- package/esm2022/lib/directive/index.mjs +4 -0
- package/esm2022/lib/interceptor/loading.interceptor.mjs +34 -0
- package/esm2022/lib/services/base.service.mjs +68 -0
- package/esm2022/lib/services/breadcrumb.service.mjs +35 -0
- package/esm2022/lib/services/dialog.service.mjs +29 -0
- package/esm2022/lib/services/index.mjs +22 -0
- package/esm2022/lib/services/layout.service.mjs +22 -0
- package/esm2022/lib/services/loading.service.mjs +31 -0
- package/esm2022/lib/services/media.service.mjs +69 -0
- package/esm2022/lib/services/navigation.service.mjs +53 -0
- package/esm2022/lib/services/snack-bar.service.mjs +19 -0
- package/esm2022/lib/services/support.service.mjs +97 -0
- package/fesm2022/rolatech-angular-services.mjs +533 -0
- package/fesm2022/rolatech-angular-services.mjs.map +1 -0
- package/lib/angular-services.module.d.ts +3 -3
- package/lib/directive/back-button.directive.d.ts +1 -1
- package/lib/directive/index.d.ts +2 -0
- package/lib/services/base.service.d.ts +1 -2
- package/lib/services/breadcrumb.service.d.ts +15 -0
- package/lib/services/index.d.ts +3 -1
- package/lib/services/navigation.service.d.ts +1 -0
- package/lib/services/support.service.d.ts +20 -0
- package/package.json +10 -16
- package/esm2020/lib/angular-services.module.mjs +0 -21
- package/esm2020/lib/components/dialog/dialog.component.mjs +0 -74
- package/esm2020/lib/directive/back-button.directive.mjs +0 -25
- package/esm2020/lib/directive/index.mjs +0 -2
- package/esm2020/lib/interceptor/loading.interceptor.mjs +0 -32
- package/esm2020/lib/services/base.service.mjs +0 -64
- package/esm2020/lib/services/dialog.service.mjs +0 -29
- package/esm2020/lib/services/index.mjs +0 -18
- package/esm2020/lib/services/layout.service.mjs +0 -19
- package/esm2020/lib/services/loading.service.mjs +0 -31
- package/esm2020/lib/services/media.service.mjs +0 -68
- package/esm2020/lib/services/navigation.service.mjs +0 -42
- package/esm2020/lib/services/snack-bar.service.mjs +0 -20
- package/fesm2015/rolatech-angular-services.mjs +0 -410
- package/fesm2015/rolatech-angular-services.mjs.map +0 -1
- package/fesm2020/rolatech-angular-services.mjs +0 -407
- package/fesm2020/rolatech-angular-services.mjs.map +0 -1
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/interceptor/index.mjs +0 -0
- /package/{esm2020 → esm2022}/rolatech-angular-services.mjs +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Injectable, inject } from '@angular/core';
|
|
3
|
+
import { APP_CONFIG } from '@rolatech/angular-common';
|
|
4
|
+
import { catchError } from 'rxjs';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
class SupportService {
|
|
7
|
+
environment = inject(APP_CONFIG);
|
|
8
|
+
http = inject(HttpClient);
|
|
9
|
+
findAllBuckets(options) {
|
|
10
|
+
return this.http
|
|
11
|
+
.get(`${this.environment.baseUrl}/support/buckets`, {
|
|
12
|
+
params: options,
|
|
13
|
+
withCredentials: false,
|
|
14
|
+
})
|
|
15
|
+
.pipe(catchError((error) => {
|
|
16
|
+
throw error;
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
findAll(options) {
|
|
20
|
+
return this.http
|
|
21
|
+
.get(`${this.environment.baseUrl}/support/folders`, {
|
|
22
|
+
params: options,
|
|
23
|
+
withCredentials: false,
|
|
24
|
+
})
|
|
25
|
+
.pipe(catchError((error) => {
|
|
26
|
+
throw error;
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
findFolderBySlug(slug) {
|
|
30
|
+
return this.http
|
|
31
|
+
.get(`${this.environment.baseUrl}/support/folders/slug/${slug}`, {
|
|
32
|
+
withCredentials: false,
|
|
33
|
+
})
|
|
34
|
+
.pipe(catchError((error) => {
|
|
35
|
+
throw error;
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
findByPath(path) {
|
|
39
|
+
return this.http
|
|
40
|
+
.get(`${this.environment.baseUrl}/support/folders/by?path=${path}`, {
|
|
41
|
+
withCredentials: false,
|
|
42
|
+
})
|
|
43
|
+
.pipe(catchError((error) => {
|
|
44
|
+
throw error;
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
findAllFiles(options) {
|
|
48
|
+
return this.http
|
|
49
|
+
.get(`${this.environment.baseUrl}/support/files`, {
|
|
50
|
+
params: options,
|
|
51
|
+
withCredentials: false,
|
|
52
|
+
})
|
|
53
|
+
.pipe(catchError((error) => {
|
|
54
|
+
throw error;
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
findFileByFolder(folder) {
|
|
58
|
+
return this.http.get(`${this.environment.baseUrl}/support/files/by?folder=${folder}`, {
|
|
59
|
+
withCredentials: false,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
findFileBySlug(slug) {
|
|
63
|
+
return this.http.get(`${this.environment.baseUrl}/support/files/slug/${slug}`, {
|
|
64
|
+
withCredentials: false,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
uploadFile(data) {
|
|
68
|
+
return this.http.post(`${this.environment.baseUrl}/support/files`, data, {
|
|
69
|
+
withCredentials: true,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
createBucket(data) {
|
|
73
|
+
return this.http.post(`${this.environment.baseUrl}/support/buckets`, data, {
|
|
74
|
+
withCredentials: true,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
createFolderBySlug(slug, data) {
|
|
78
|
+
return this.http.post(`${this.environment.baseUrl}/support/folders/slug/${slug}`, data, {
|
|
79
|
+
withCredentials: true,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
uploadFileBySlug(slug, data) {
|
|
83
|
+
return this.http.post(`${this.environment.baseUrl}/support/files/slug/${slug}`, data, {
|
|
84
|
+
withCredentials: true,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SupportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
88
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SupportService, providedIn: 'root' });
|
|
89
|
+
}
|
|
90
|
+
export { SupportService };
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SupportService, decorators: [{
|
|
92
|
+
type: Injectable,
|
|
93
|
+
args: [{
|
|
94
|
+
providedIn: 'root',
|
|
95
|
+
}]
|
|
96
|
+
}] });
|
|
97
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3VwcG9ydC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyLXNlcnZpY2VzL3NyYy9saWIvc2VydmljZXMvc3VwcG9ydC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNuRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFFdEQsT0FBTyxFQUFjLFVBQVUsRUFBRSxNQUFNLE1BQU0sQ0FBQzs7QUFFOUMsTUFHYSxjQUFjO0lBQ3pCLFdBQVcsR0FBRyxNQUFNLENBQUMsVUFBVSxDQUFDLENBQUM7SUFDakMsSUFBSSxHQUFHLE1BQU0sQ0FB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oQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgfSk7XG4gIH1cbiAgY3JlYXRlRm9sZGVyQnlTbHVnKHNsdWc6IHN0cmluZywgZGF0YTogYW55KSB7XG4gICAgcmV0dXJuIHRoaXMuaHR0cC5wb3N0PGFueT4oYCR7dGhpcy5lbnZpcm9ubWVudC5iYXNlVXJsfS9zdXBwb3J0L2ZvbGRlcnMvc2x1Zy8ke3NsdWd9YCwgZGF0YSwge1xuICAgICAgd2l0aENyZWRlbnRpYWxzOiB0cnVlLFxuICAgIH0pO1xuICB9XG4gIHVwbG9hZEZpbGVCeVNsdWcoc2x1Zzogc3RyaW5nLCBkYXRhOiBGb3JtRGF0YSkge1xuICAgIHJldHVybiB0aGlzLmh0dHAucG9zdDxhbnk+KGAke3RoaXMuZW52aXJvbm1lbnQuYmFzZVVybH0vc3VwcG9ydC9maWxlcy9zbHVnLyR7c2x1Z31gLCBkYXRhLCB7XG4gICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable, EventEmitter, ViewContainerRef, Component, ViewChild, HostListener, Directive, NgModule } from '@angular/core';
|
|
3
|
+
import { Location } from '@angular/common';
|
|
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';
|
|
7
|
+
import * as i1 from '@angular/common/http';
|
|
8
|
+
import { HttpClient } from '@angular/common/http';
|
|
9
|
+
import { APP_CONFIG, AngularCommonModule } from '@rolatech/angular-common';
|
|
10
|
+
import * as i1$1 from '@angular/cdk/layout';
|
|
11
|
+
import { Breakpoints } from '@angular/cdk/layout';
|
|
12
|
+
import { map as map$1, shareReplay, finalize } from 'rxjs/operators';
|
|
13
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
14
|
+
|
|
15
|
+
class NavigationService {
|
|
16
|
+
history = [];
|
|
17
|
+
router = inject(Router);
|
|
18
|
+
location = inject(Location);
|
|
19
|
+
constructor() {
|
|
20
|
+
this.router.events.subscribe((event) => {
|
|
21
|
+
if (event instanceof NavigationEnd) {
|
|
22
|
+
this.history.push(event.urlAfterRedirects);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
start() {
|
|
27
|
+
// this.router.events.subscribe((event) => {
|
|
28
|
+
// if (event instanceof NavigationEnd) {
|
|
29
|
+
// this.history.push(event.urlAfterRedirects);
|
|
30
|
+
// console.log(this.history);
|
|
31
|
+
// }
|
|
32
|
+
// });
|
|
33
|
+
}
|
|
34
|
+
getHistory() {
|
|
35
|
+
return this.history;
|
|
36
|
+
}
|
|
37
|
+
back() {
|
|
38
|
+
console.log(this.history);
|
|
39
|
+
this.history.pop();
|
|
40
|
+
if (this.history.length > 0) {
|
|
41
|
+
this.location.back();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.router.navigateByUrl('/');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
next() {
|
|
48
|
+
if (this.history.length > 0) {
|
|
49
|
+
return this.history[this.history.length - 2];
|
|
50
|
+
}
|
|
51
|
+
return '';
|
|
52
|
+
}
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: NavigationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
54
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: NavigationService, providedIn: 'root' });
|
|
55
|
+
}
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: NavigationService, decorators: [{
|
|
57
|
+
type: Injectable,
|
|
58
|
+
args: [{
|
|
59
|
+
providedIn: 'root',
|
|
60
|
+
}]
|
|
61
|
+
}], ctorParameters: function () { return []; } });
|
|
62
|
+
|
|
63
|
+
class DialogComponent {
|
|
64
|
+
data = inject(MAT_DIALOG_DATA);
|
|
65
|
+
result;
|
|
66
|
+
dialogRef = inject((MatDialogRef));
|
|
67
|
+
componentRef;
|
|
68
|
+
ngOnInit() {
|
|
69
|
+
this.createComponent();
|
|
70
|
+
}
|
|
71
|
+
createComponent() {
|
|
72
|
+
this.componentRef.clear();
|
|
73
|
+
const componentRef = this.componentRef.createComponent(this.data.component);
|
|
74
|
+
const hostedComponent = componentRef.instance;
|
|
75
|
+
if (this.data.data) {
|
|
76
|
+
Object.keys(this.data.data).forEach((inputName) => {
|
|
77
|
+
hostedComponent[inputName] = this.data.data[inputName];
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
Object.keys(hostedComponent)
|
|
81
|
+
.filter((prop) => hostedComponent[prop] instanceof EventEmitter)
|
|
82
|
+
.forEach((output) => {
|
|
83
|
+
this[output] = new EventEmitter();
|
|
84
|
+
hostedComponent[output].subscribe((data) => {
|
|
85
|
+
this[output].emit(data);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
this.dialogRef.afterOpened().subscribe(() => {
|
|
89
|
+
this.dialogRef.componentInstance['output'].subscribe((res) => {
|
|
90
|
+
this.result = res;
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
ngOnDestroy() {
|
|
95
|
+
this.componentRef.clear();
|
|
96
|
+
}
|
|
97
|
+
cancel() {
|
|
98
|
+
this.close(false);
|
|
99
|
+
}
|
|
100
|
+
close(value) {
|
|
101
|
+
this.dialogRef.close(value);
|
|
102
|
+
}
|
|
103
|
+
confirm() {
|
|
104
|
+
this.close(this.result);
|
|
105
|
+
}
|
|
106
|
+
onEsc() {
|
|
107
|
+
this.close(false);
|
|
108
|
+
}
|
|
109
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
110
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.1", type: DialogComponent, 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: [""] });
|
|
111
|
+
}
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: DialogComponent, decorators: [{
|
|
113
|
+
type: Component,
|
|
114
|
+
args: [{ selector: 'rolatech-dialog', 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" }]
|
|
115
|
+
}], propDecorators: { componentRef: [{
|
|
116
|
+
type: ViewChild,
|
|
117
|
+
args: ['container', { read: ViewContainerRef, static: true }]
|
|
118
|
+
}], onEsc: [{
|
|
119
|
+
type: HostListener,
|
|
120
|
+
args: ['keydown.esc']
|
|
121
|
+
}] } });
|
|
122
|
+
|
|
123
|
+
class DialogService {
|
|
124
|
+
dialog = inject(MatDialog);
|
|
125
|
+
dialogRef;
|
|
126
|
+
open(options) {
|
|
127
|
+
this.dialogRef = this.dialog.open(DialogComponent, {
|
|
128
|
+
data: {
|
|
129
|
+
...options,
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
cancelled() {
|
|
134
|
+
return this.dialogRef.beforeClosed().pipe(take(1), map((res) => res));
|
|
135
|
+
}
|
|
136
|
+
confirmed() {
|
|
137
|
+
return this.dialogRef.afterClosed().pipe(take(1), map((res) => res));
|
|
138
|
+
}
|
|
139
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
140
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: DialogService });
|
|
141
|
+
}
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: DialogService, decorators: [{
|
|
143
|
+
type: Injectable
|
|
144
|
+
}] });
|
|
145
|
+
|
|
146
|
+
class BaseService {
|
|
147
|
+
http;
|
|
148
|
+
actionUrl;
|
|
149
|
+
endpoint;
|
|
150
|
+
environment = inject(APP_CONFIG);
|
|
151
|
+
constructor(http) {
|
|
152
|
+
this.http = http;
|
|
153
|
+
this.init();
|
|
154
|
+
}
|
|
155
|
+
init() {
|
|
156
|
+
this.actionUrl = `${this.environment.baseUrl}/${this.endpoint}`;
|
|
157
|
+
}
|
|
158
|
+
find(options) {
|
|
159
|
+
return this.http.get(this.actionUrl, {
|
|
160
|
+
params: options,
|
|
161
|
+
withCredentials: true,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
get(id, options) {
|
|
165
|
+
return this.http.get(`${this.actionUrl}/${id}`, {
|
|
166
|
+
params: options,
|
|
167
|
+
withCredentials: true,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
create(item) {
|
|
171
|
+
return this.http.post(`${this.actionUrl}`, item, {
|
|
172
|
+
withCredentials: true,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
update(id, data) {
|
|
176
|
+
return this.http.put(`${this.actionUrl}/${id}`, data, {
|
|
177
|
+
withCredentials: true,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
delete(id) {
|
|
181
|
+
return this.http.delete(`${this.actionUrl}/${id}`, {
|
|
182
|
+
withCredentials: true,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
updateStatus(id, data) {
|
|
186
|
+
return this.http.put(`${this.actionUrl}/${id}/status`, data, {
|
|
187
|
+
withCredentials: true,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
search(word) {
|
|
191
|
+
return this.http
|
|
192
|
+
.get(`${this.actionUrl}?search=${word}`, {
|
|
193
|
+
withCredentials: true,
|
|
194
|
+
})
|
|
195
|
+
.pipe(map((result) => result));
|
|
196
|
+
}
|
|
197
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: BaseService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
198
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: BaseService, providedIn: 'root' });
|
|
199
|
+
}
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: BaseService, decorators: [{
|
|
201
|
+
type: Injectable,
|
|
202
|
+
args: [{
|
|
203
|
+
providedIn: 'root',
|
|
204
|
+
}]
|
|
205
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
206
|
+
|
|
207
|
+
class LoadingService {
|
|
208
|
+
loading$ = new BehaviorSubject(false);
|
|
209
|
+
ratio$ = new BehaviorSubject(0);
|
|
210
|
+
isLoading = false;
|
|
211
|
+
constructor() { }
|
|
212
|
+
start() {
|
|
213
|
+
this.loading$.next(true);
|
|
214
|
+
}
|
|
215
|
+
stop() {
|
|
216
|
+
this.loading$.next(false);
|
|
217
|
+
}
|
|
218
|
+
async present(text) {
|
|
219
|
+
this.isLoading = true;
|
|
220
|
+
}
|
|
221
|
+
async dismiss() {
|
|
222
|
+
this.isLoading = false;
|
|
223
|
+
}
|
|
224
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: LoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
225
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: LoadingService, providedIn: 'root' });
|
|
226
|
+
}
|
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: LoadingService, decorators: [{
|
|
228
|
+
type: Injectable,
|
|
229
|
+
args: [{
|
|
230
|
+
providedIn: 'root',
|
|
231
|
+
}]
|
|
232
|
+
}], ctorParameters: function () { return []; } });
|
|
233
|
+
|
|
234
|
+
class MediaService extends BaseService {
|
|
235
|
+
init() {
|
|
236
|
+
this.endpoint = 'media';
|
|
237
|
+
super.init();
|
|
238
|
+
}
|
|
239
|
+
upload(data) {
|
|
240
|
+
return this.http
|
|
241
|
+
.post(`${this.actionUrl}/upload`, data, {
|
|
242
|
+
reportProgress: false,
|
|
243
|
+
withCredentials: true,
|
|
244
|
+
// headers: new HttpHeaders({
|
|
245
|
+
// 'Content-Type': 'multipart/form-data',
|
|
246
|
+
// }),
|
|
247
|
+
})
|
|
248
|
+
.pipe(map((result) => result));
|
|
249
|
+
}
|
|
250
|
+
uploadAndSave(data) {
|
|
251
|
+
return this.http
|
|
252
|
+
.post(`${this.actionUrl}/save`, data, {
|
|
253
|
+
reportProgress: false,
|
|
254
|
+
withCredentials: true,
|
|
255
|
+
})
|
|
256
|
+
.pipe(map((result) => result));
|
|
257
|
+
}
|
|
258
|
+
deleteBy(filename) {
|
|
259
|
+
return this.http
|
|
260
|
+
.delete(`${this.actionUrl}/${filename}`, {})
|
|
261
|
+
.pipe(map((result) => result));
|
|
262
|
+
}
|
|
263
|
+
batchDelete(data) {
|
|
264
|
+
return this.http
|
|
265
|
+
.post(`${this.actionUrl}/batch`, data, { withCredentials: true })
|
|
266
|
+
.pipe(map((result) => result));
|
|
267
|
+
}
|
|
268
|
+
moveToGroup(data) {
|
|
269
|
+
return this.http
|
|
270
|
+
.post(`${this.actionUrl}/move`, data, { withCredentials: true })
|
|
271
|
+
.pipe(map((result) => result));
|
|
272
|
+
}
|
|
273
|
+
addGroup(data) {
|
|
274
|
+
return this.http
|
|
275
|
+
.post(`${this.actionUrl}/groups`, data, { withCredentials: true })
|
|
276
|
+
.pipe(map((result) => result));
|
|
277
|
+
}
|
|
278
|
+
findGroup(id) {
|
|
279
|
+
return this.http
|
|
280
|
+
.get(`${this.actionUrl}/groups/${id}`, { withCredentials: true })
|
|
281
|
+
.pipe(map((result) => result));
|
|
282
|
+
}
|
|
283
|
+
findGroups(options) {
|
|
284
|
+
return this.http
|
|
285
|
+
.get(`${this.actionUrl}/groups`, { withCredentials: true })
|
|
286
|
+
.pipe(map((result) => result));
|
|
287
|
+
}
|
|
288
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: MediaService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
289
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: MediaService, providedIn: 'root' });
|
|
290
|
+
}
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: MediaService, decorators: [{
|
|
292
|
+
type: Injectable,
|
|
293
|
+
args: [{
|
|
294
|
+
providedIn: 'root',
|
|
295
|
+
}]
|
|
296
|
+
}] });
|
|
297
|
+
|
|
298
|
+
class LayoutService {
|
|
299
|
+
breakpointObserver;
|
|
300
|
+
isHandset$;
|
|
301
|
+
constructor(breakpointObserver) {
|
|
302
|
+
this.breakpointObserver = breakpointObserver;
|
|
303
|
+
this.isHandset$ = this.breakpointObserver
|
|
304
|
+
.observe([Breakpoints.Small, Breakpoints.HandsetPortrait])
|
|
305
|
+
.pipe(map$1((result) => result.matches), shareReplay());
|
|
306
|
+
}
|
|
307
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: LayoutService, deps: [{ token: i1$1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
308
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: LayoutService });
|
|
309
|
+
}
|
|
310
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: LayoutService, decorators: [{
|
|
311
|
+
type: Injectable
|
|
312
|
+
}], ctorParameters: function () { return [{ type: i1$1.BreakpointObserver }]; } });
|
|
313
|
+
|
|
314
|
+
class SnackBarService {
|
|
315
|
+
snackBar = inject(MatSnackBar);
|
|
316
|
+
open(message) {
|
|
317
|
+
this.snackBar.open(message);
|
|
318
|
+
}
|
|
319
|
+
dismiss() {
|
|
320
|
+
this.snackBar.dismiss();
|
|
321
|
+
}
|
|
322
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SnackBarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
323
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SnackBarService });
|
|
324
|
+
}
|
|
325
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SnackBarService, decorators: [{
|
|
326
|
+
type: Injectable
|
|
327
|
+
}] });
|
|
328
|
+
|
|
329
|
+
class SupportService {
|
|
330
|
+
environment = inject(APP_CONFIG);
|
|
331
|
+
http = inject(HttpClient);
|
|
332
|
+
findAllBuckets(options) {
|
|
333
|
+
return this.http
|
|
334
|
+
.get(`${this.environment.baseUrl}/support/buckets`, {
|
|
335
|
+
params: options,
|
|
336
|
+
withCredentials: false,
|
|
337
|
+
})
|
|
338
|
+
.pipe(catchError((error) => {
|
|
339
|
+
throw error;
|
|
340
|
+
}));
|
|
341
|
+
}
|
|
342
|
+
findAll(options) {
|
|
343
|
+
return this.http
|
|
344
|
+
.get(`${this.environment.baseUrl}/support/folders`, {
|
|
345
|
+
params: options,
|
|
346
|
+
withCredentials: false,
|
|
347
|
+
})
|
|
348
|
+
.pipe(catchError((error) => {
|
|
349
|
+
throw error;
|
|
350
|
+
}));
|
|
351
|
+
}
|
|
352
|
+
findFolderBySlug(slug) {
|
|
353
|
+
return this.http
|
|
354
|
+
.get(`${this.environment.baseUrl}/support/folders/slug/${slug}`, {
|
|
355
|
+
withCredentials: false,
|
|
356
|
+
})
|
|
357
|
+
.pipe(catchError((error) => {
|
|
358
|
+
throw error;
|
|
359
|
+
}));
|
|
360
|
+
}
|
|
361
|
+
findByPath(path) {
|
|
362
|
+
return this.http
|
|
363
|
+
.get(`${this.environment.baseUrl}/support/folders/by?path=${path}`, {
|
|
364
|
+
withCredentials: false,
|
|
365
|
+
})
|
|
366
|
+
.pipe(catchError((error) => {
|
|
367
|
+
throw error;
|
|
368
|
+
}));
|
|
369
|
+
}
|
|
370
|
+
findAllFiles(options) {
|
|
371
|
+
return this.http
|
|
372
|
+
.get(`${this.environment.baseUrl}/support/files`, {
|
|
373
|
+
params: options,
|
|
374
|
+
withCredentials: false,
|
|
375
|
+
})
|
|
376
|
+
.pipe(catchError((error) => {
|
|
377
|
+
throw error;
|
|
378
|
+
}));
|
|
379
|
+
}
|
|
380
|
+
findFileByFolder(folder) {
|
|
381
|
+
return this.http.get(`${this.environment.baseUrl}/support/files/by?folder=${folder}`, {
|
|
382
|
+
withCredentials: false,
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
findFileBySlug(slug) {
|
|
386
|
+
return this.http.get(`${this.environment.baseUrl}/support/files/slug/${slug}`, {
|
|
387
|
+
withCredentials: false,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
uploadFile(data) {
|
|
391
|
+
return this.http.post(`${this.environment.baseUrl}/support/files`, data, {
|
|
392
|
+
withCredentials: true,
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
createBucket(data) {
|
|
396
|
+
return this.http.post(`${this.environment.baseUrl}/support/buckets`, data, {
|
|
397
|
+
withCredentials: true,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
createFolderBySlug(slug, data) {
|
|
401
|
+
return this.http.post(`${this.environment.baseUrl}/support/folders/slug/${slug}`, data, {
|
|
402
|
+
withCredentials: true,
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
uploadFileBySlug(slug, data) {
|
|
406
|
+
return this.http.post(`${this.environment.baseUrl}/support/files/slug/${slug}`, data, {
|
|
407
|
+
withCredentials: true,
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SupportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
411
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SupportService, providedIn: 'root' });
|
|
412
|
+
}
|
|
413
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: SupportService, decorators: [{
|
|
414
|
+
type: Injectable,
|
|
415
|
+
args: [{
|
|
416
|
+
providedIn: 'root',
|
|
417
|
+
}]
|
|
418
|
+
}] });
|
|
419
|
+
|
|
420
|
+
class BreadcrumbService {
|
|
421
|
+
router = inject(Router);
|
|
422
|
+
breadcrumbs = [];
|
|
423
|
+
add(label, slug) {
|
|
424
|
+
const breadcrumb = {
|
|
425
|
+
label: label,
|
|
426
|
+
slug: slug,
|
|
427
|
+
};
|
|
428
|
+
this.breadcrumbs.push(breadcrumb);
|
|
429
|
+
return this.breadcrumbs;
|
|
430
|
+
}
|
|
431
|
+
goTo(slug, route) {
|
|
432
|
+
if (this.breadcrumbs.length === 1) {
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
const index = this.breadcrumbs.findIndex((item) => item.slug === slug);
|
|
436
|
+
this.breadcrumbs.length = index;
|
|
437
|
+
this.router.navigate([`${slug}`], {
|
|
438
|
+
relativeTo: route,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
442
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
|
|
443
|
+
}
|
|
444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: BreadcrumbService, decorators: [{
|
|
445
|
+
type: Injectable,
|
|
446
|
+
args: [{
|
|
447
|
+
providedIn: 'root',
|
|
448
|
+
}]
|
|
449
|
+
}] });
|
|
450
|
+
|
|
451
|
+
const services = [
|
|
452
|
+
BaseService,
|
|
453
|
+
LoadingService,
|
|
454
|
+
MediaService,
|
|
455
|
+
LayoutService,
|
|
456
|
+
DialogService,
|
|
457
|
+
SnackBarService,
|
|
458
|
+
NavigationService,
|
|
459
|
+
SupportService,
|
|
460
|
+
BreadcrumbService,
|
|
461
|
+
];
|
|
462
|
+
|
|
463
|
+
class BackButtonDirective {
|
|
464
|
+
navigation = inject(NavigationService);
|
|
465
|
+
constructor() { }
|
|
466
|
+
onClick() {
|
|
467
|
+
this.navigation.back();
|
|
468
|
+
}
|
|
469
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: BackButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
470
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.1", type: BackButtonDirective, isStandalone: true, selector: "[rolatechBackButton]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
471
|
+
}
|
|
472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: BackButtonDirective, decorators: [{
|
|
473
|
+
type: Directive,
|
|
474
|
+
args: [{
|
|
475
|
+
selector: '[rolatechBackButton]',
|
|
476
|
+
standalone: true,
|
|
477
|
+
}]
|
|
478
|
+
}], ctorParameters: function () { return []; }, propDecorators: { onClick: [{
|
|
479
|
+
type: HostListener,
|
|
480
|
+
args: ['click']
|
|
481
|
+
}] } });
|
|
482
|
+
|
|
483
|
+
const SERVICE_DIRECTIVES = [BackButtonDirective];
|
|
484
|
+
|
|
485
|
+
class AngularServicesModule {
|
|
486
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AngularServicesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
487
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.1", ngImport: i0, type: AngularServicesModule, declarations: [DialogComponent], imports: [AngularCommonModule, BackButtonDirective], exports: [BackButtonDirective] });
|
|
488
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AngularServicesModule, providers: [...services], imports: [AngularCommonModule] });
|
|
489
|
+
}
|
|
490
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AngularServicesModule, decorators: [{
|
|
491
|
+
type: NgModule,
|
|
492
|
+
args: [{
|
|
493
|
+
imports: [AngularCommonModule, SERVICE_DIRECTIVES],
|
|
494
|
+
providers: [...services],
|
|
495
|
+
declarations: [DialogComponent],
|
|
496
|
+
exports: [SERVICE_DIRECTIVES],
|
|
497
|
+
}]
|
|
498
|
+
}] });
|
|
499
|
+
|
|
500
|
+
class LoadingInterceptor {
|
|
501
|
+
loadingService;
|
|
502
|
+
activeRequests = 0;
|
|
503
|
+
constructor(loadingService) {
|
|
504
|
+
this.loadingService = loadingService;
|
|
505
|
+
}
|
|
506
|
+
intercept(request, next) {
|
|
507
|
+
if (this.activeRequests === 0) {
|
|
508
|
+
this.loadingService.start();
|
|
509
|
+
}
|
|
510
|
+
this.activeRequests++;
|
|
511
|
+
return next.handle(request).pipe(finalize(() => {
|
|
512
|
+
this.activeRequests--;
|
|
513
|
+
if (this.activeRequests === 0) {
|
|
514
|
+
this.loadingService.stop();
|
|
515
|
+
}
|
|
516
|
+
}));
|
|
517
|
+
}
|
|
518
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: LoadingInterceptor, deps: [{ token: LoadingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
519
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: LoadingInterceptor, providedIn: 'root' });
|
|
520
|
+
}
|
|
521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: LoadingInterceptor, decorators: [{
|
|
522
|
+
type: Injectable,
|
|
523
|
+
args: [{
|
|
524
|
+
providedIn: 'root',
|
|
525
|
+
}]
|
|
526
|
+
}], ctorParameters: function () { return [{ type: LoadingService }]; } });
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Generated bundle index. Do not edit.
|
|
530
|
+
*/
|
|
531
|
+
|
|
532
|
+
export { AngularServicesModule, BackButtonDirective, BaseService, BreadcrumbService, DialogService, LayoutService, LoadingInterceptor, LoadingService, MediaService, NavigationService, SERVICE_DIRECTIVES, SnackBarService, SupportService, services };
|
|
533
|
+
//# sourceMappingURL=rolatech-angular-services.mjs.map
|