@rolatech/angular-services 17.2.1 → 18.0.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.
Files changed (29) hide show
  1. package/esm2022/lib/components/dialog/dialog.component.mjs +6 -9
  2. package/esm2022/lib/directive/back-button.directive.mjs +3 -3
  3. package/esm2022/lib/interceptor/loading.interceptor.mjs +3 -3
  4. package/esm2022/lib/services/base.service.mjs +3 -3
  5. package/esm2022/lib/services/breadcrumb.service.mjs +3 -3
  6. package/esm2022/lib/services/cart.service.mjs +76 -0
  7. package/esm2022/lib/services/dialog.service.mjs +3 -3
  8. package/esm2022/lib/services/index.mjs +5 -2
  9. package/esm2022/lib/services/layout.service.mjs +3 -3
  10. package/esm2022/lib/services/loading.service.mjs +3 -3
  11. package/esm2022/lib/services/media.service.mjs +7 -4
  12. package/esm2022/lib/services/navigation.service.mjs +3 -3
  13. package/esm2022/lib/services/order.service.mjs +83 -0
  14. package/esm2022/lib/services/product.service.mjs +178 -0
  15. package/esm2022/lib/services/sidenav.service.mjs +3 -3
  16. package/esm2022/lib/services/snack-bar.service.mjs +3 -3
  17. package/esm2022/lib/services/support.service.mjs +3 -3
  18. package/esm2022/lib/services/theme.service.mjs +3 -3
  19. package/esm2022/provider.mjs +5 -2
  20. package/fesm2022/rolatech-angular-services.mjs +378 -49
  21. package/fesm2022/rolatech-angular-services.mjs.map +1 -1
  22. package/lib/components/dialog/dialog.component.d.ts +1 -2
  23. package/lib/services/cart.service.d.ts +17 -0
  24. package/lib/services/index.d.ts +4 -1
  25. package/lib/services/media.service.d.ts +1 -0
  26. package/lib/services/order.service.d.ts +20 -0
  27. package/lib/services/product.service.d.ts +41 -0
  28. package/package.json +1 -1
  29. package/themes/_default.scss +1 -1
@@ -3,7 +3,7 @@ import { inject, Injectable, viewChild, ViewContainerRef, OutputEmitterRef, Even
3
3
  import { Location, isPlatformBrowser } from '@angular/common';
4
4
  import { Router, NavigationEnd } from '@angular/router';
5
5
  import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions, MatDialogTitle, MatDialogContent, MatDialogClose, MatDialog } from '@angular/material/dialog';
6
- import { take, map, BehaviorSubject } from 'rxjs';
6
+ import { take, map, BehaviorSubject, switchMap } from 'rxjs';
7
7
  import * as i1 from '@angular/material/button';
8
8
  import { MatButtonModule } from '@angular/material/button';
9
9
  import { HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
@@ -12,6 +12,7 @@ import * as i1$1 from '@angular/cdk/layout';
12
12
  import { Breakpoints, MediaMatcher } from '@angular/cdk/layout';
13
13
  import { map as map$1, shareReplay, finalize } from 'rxjs/operators';
14
14
  import { MatSnackBar } from '@angular/material/snack-bar';
15
+ import _ from 'lodash';
15
16
 
16
17
  class NavigationService {
17
18
  history = [];
@@ -49,10 +50,10 @@ class NavigationService {
49
50
  }
50
51
  return '';
51
52
  }
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' });
53
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: NavigationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
54
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: NavigationService, providedIn: 'root' });
54
55
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: NavigationService, decorators: [{
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: NavigationService, decorators: [{
56
57
  type: Injectable,
57
58
  args: [{
58
59
  providedIn: 'root',
@@ -111,21 +112,18 @@ class DialogComponent {
111
112
  }
112
113
  });
113
114
  }
114
- cancel() {
115
- this.close(false);
116
- }
117
- close(value) {
115
+ close(value = false) {
118
116
  this.dialogRef.close(value);
119
117
  }
120
118
  confirm() {
121
119
  this.close(this.result || true);
122
120
  }
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]" }] });
121
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
122
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.4", 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)=\"close()\">{{ 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]" }] });
125
123
  }
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DialogComponent, decorators: [{
124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: DialogComponent, decorators: [{
127
125
  type: Component,
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" }]
126
+ 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)=\"close()\">{{ 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
127
  }], propDecorators: { onEsc: [{
130
128
  type: HostListener,
131
129
  args: ['keydown.esc']
@@ -147,10 +145,10 @@ class DialogService {
147
145
  confirmed() {
148
146
  return this.dialogRef.afterClosed().pipe(take(1), map((res) => res));
149
147
  }
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 });
148
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
149
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: DialogService });
152
150
  }
153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DialogService, decorators: [{
151
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: DialogService, decorators: [{
154
152
  type: Injectable
155
153
  }] });
156
154
 
@@ -202,10 +200,10 @@ class BaseService {
202
200
  withCredentials: true,
203
201
  });
204
202
  }
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' });
203
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: BaseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
204
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: BaseService, providedIn: 'root' });
207
205
  }
208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BaseService, decorators: [{
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: BaseService, decorators: [{
209
207
  type: Injectable,
210
208
  args: [{
211
209
  providedIn: 'root',
@@ -229,10 +227,10 @@ class LoadingService {
229
227
  async dismiss() {
230
228
  this.isLoading = false;
231
229
  }
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' });
230
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: LoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
231
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: LoadingService, providedIn: 'root' });
234
232
  }
235
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LoadingService, decorators: [{
233
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: LoadingService, decorators: [{
236
234
  type: Injectable,
237
235
  args: [{
238
236
  providedIn: 'root',
@@ -277,10 +275,13 @@ class MediaService extends BaseService {
277
275
  findGroups(options) {
278
276
  return this.http.get(`${this.actionUrl}/groups`, { withCredentials: true });
279
277
  }
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' });
278
+ getImageInfo(url) {
279
+ return this.http.get(`${url}?imageInfo`);
280
+ }
281
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: MediaService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
282
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: MediaService, providedIn: 'root' });
282
283
  }
283
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: MediaService, decorators: [{
284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: MediaService, decorators: [{
284
285
  type: Injectable,
285
286
  args: [{
286
287
  providedIn: 'root',
@@ -296,10 +297,10 @@ class LayoutService {
296
297
  .observe([Breakpoints.Small, Breakpoints.HandsetPortrait])
297
298
  .pipe(map$1((result) => result.matches), shareReplay());
298
299
  }
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 });
300
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: LayoutService, deps: [{ token: i1$1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
301
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: LayoutService });
301
302
  }
302
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LayoutService, decorators: [{
303
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: LayoutService, decorators: [{
303
304
  type: Injectable
304
305
  }], ctorParameters: () => [{ type: i1$1.BreakpointObserver }] });
305
306
 
@@ -311,10 +312,10 @@ class SnackBarService {
311
312
  dismiss() {
312
313
  this.snackBar.dismiss();
313
314
  }
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 });
315
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SnackBarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
316
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SnackBarService });
316
317
  }
317
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SnackBarService, decorators: [{
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SnackBarService, decorators: [{
318
319
  type: Injectable
319
320
  }] });
320
321
 
@@ -379,10 +380,10 @@ class SupportService {
379
380
  withCredentials: true,
380
381
  });
381
382
  }
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' });
383
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SupportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
384
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SupportService, providedIn: 'root' });
384
385
  }
385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SupportService, decorators: [{
386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SupportService, decorators: [{
386
387
  type: Injectable,
387
388
  args: [{
388
389
  providedIn: 'root',
@@ -410,10 +411,10 @@ class BreadcrumbService {
410
411
  relativeTo: route,
411
412
  });
412
413
  }
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' });
414
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
415
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
415
416
  }
416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BreadcrumbService, decorators: [{
417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: BreadcrumbService, decorators: [{
417
418
  type: Injectable,
418
419
  args: [{
419
420
  providedIn: 'root',
@@ -445,10 +446,10 @@ class SidenavService {
445
446
  this.isCollaped = !this.isMobile && !this.sidenav?.opened;
446
447
  }
447
448
  lists() { }
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 });
449
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SidenavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
450
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SidenavService });
450
451
  }
451
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavService, decorators: [{
452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: SidenavService, decorators: [{
452
453
  type: Injectable
453
454
  }], ctorParameters: () => [] });
454
455
 
@@ -486,16 +487,341 @@ class ThemeService {
486
487
  setDarkTheme(isDarkTheme) {
487
488
  this.darkTheme.next(isDarkTheme);
488
489
  }
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' });
490
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
491
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ThemeService, providedIn: 'root' });
491
492
  }
492
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeService, decorators: [{
493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ThemeService, decorators: [{
493
494
  type: Injectable,
494
495
  args: [{
495
496
  providedIn: 'root',
496
497
  }]
497
498
  }], ctorParameters: () => [] });
498
499
 
500
+ class ProductService extends BaseService {
501
+ init() {
502
+ this.endpoint = 'products';
503
+ super.init();
504
+ }
505
+ me(options) {
506
+ return this.http.get(`${this.actionUrl}/me`, {
507
+ params: options,
508
+ withCredentials: true,
509
+ });
510
+ }
511
+ findByIds(ids) {
512
+ const params = { ids: ids.join(',') };
513
+ return this.http.get(`${this.actionUrl}/by`, {
514
+ params: params,
515
+ withCredentials: true,
516
+ });
517
+ }
518
+ publish(productId) {
519
+ return this.http.post(`${this.actionUrl}/${productId}/publish`, {}, {
520
+ withCredentials: true,
521
+ });
522
+ }
523
+ archived(productId) {
524
+ return this.http.post(`${this.actionUrl}/${productId}/archived`, {}, {
525
+ withCredentials: true,
526
+ });
527
+ }
528
+ findWishlist(options) {
529
+ return this.http.get(`${this.actionUrl}/wishlist`, { params: options, withCredentials: true });
530
+ }
531
+ addToWishlist(productId) {
532
+ return this.http.post(`${this.actionUrl}/${productId}/wishlist`, {}, { withCredentials: true });
533
+ }
534
+ removeFromWishlist(productId) {
535
+ return this.http.delete(`${this.actionUrl}/${productId}/wishlist`, { withCredentials: true });
536
+ }
537
+ findWishlistBy(productId) {
538
+ return this.http.get(`${this.actionUrl}/${productId}/wishlist/by`, { withCredentials: true });
539
+ }
540
+ findPurchasedByProductId(productId) {
541
+ return this.http.get(`${this.actionUrl}/users/me/by?productId=${productId}`, {
542
+ withCredentials: true,
543
+ });
544
+ }
545
+ // Media
546
+ uploadMedia(productId, data) {
547
+ return this.http.post(`${this.actionUrl}/${productId}/media`, data, {
548
+ withCredentials: true,
549
+ });
550
+ }
551
+ deleteMedia(id, mediaId) {
552
+ return this.http.delete(`${this.actionUrl}/${id}/media/${mediaId}`, {
553
+ withCredentials: true,
554
+ });
555
+ }
556
+ // Pricing
557
+ addPricing(productId, data) {
558
+ return this.http.post(`${this.actionUrl}/${productId}/pricing`, data, {
559
+ withCredentials: true,
560
+ });
561
+ }
562
+ updatePricing(pricingId, data) {
563
+ return this.http.put(`${this.actionUrl}/pricing/${pricingId}`, data, {
564
+ withCredentials: true,
565
+ });
566
+ }
567
+ deletePricing(pricingId) {
568
+ return this.http.delete(`${this.actionUrl}/pricing/${pricingId}`, {
569
+ withCredentials: true,
570
+ });
571
+ }
572
+ // Section
573
+ addSection(productId, data) {
574
+ return this.http.post(`${this.actionUrl}/${productId}/sections`, data, {
575
+ withCredentials: true,
576
+ });
577
+ }
578
+ addBatchSections(productId, data) {
579
+ return this.http.post(`${this.actionUrl}/${productId}/sections/batch`, data, {
580
+ withCredentials: true,
581
+ });
582
+ }
583
+ findSections(productId) {
584
+ return this.http.get(`${this.actionUrl}/${productId}/sections`, {
585
+ withCredentials: true,
586
+ });
587
+ }
588
+ updateSection(sectionId, data) {
589
+ return this.http.put(`${this.actionUrl}/sections/${sectionId}`, data, {
590
+ withCredentials: true,
591
+ });
592
+ }
593
+ deleteSection(sectionId) {
594
+ return this.http.delete(`${this.actionUrl}/sections/${sectionId}`, {
595
+ withCredentials: true,
596
+ });
597
+ }
598
+ uploadSectionMedia(sectionId, data) {
599
+ return this.http.post(`${this.actionUrl}/sections/${sectionId}/media`, data, {
600
+ withCredentials: true,
601
+ });
602
+ }
603
+ deleteSectionMedia(sectionId, mediaId) {
604
+ return this.http.delete(`${this.actionUrl}/sections/${sectionId}/media/${mediaId}`, {
605
+ withCredentials: true,
606
+ });
607
+ }
608
+ addOption(productId, data) {
609
+ return this.http.post(`${this.actionUrl}/${productId}/options`, data, {
610
+ withCredentials: true,
611
+ });
612
+ }
613
+ findOptions(productId) {
614
+ return this.http.get(`${this.actionUrl}/${productId}/options`);
615
+ }
616
+ updateOption(optionId, data) {
617
+ return this.http.put(`${this.actionUrl}/options/${optionId}`, data, {
618
+ withCredentials: true,
619
+ });
620
+ }
621
+ deleteOption(optionId) {
622
+ return this.http.delete(`${this.actionUrl}/options/${optionId}`, {
623
+ withCredentials: true,
624
+ });
625
+ }
626
+ // variants
627
+ updateVariantPrice(productId, status) {
628
+ return this.http.put(`${this.actionUrl}/${productId}/variants/by?status=${status}`, {}, {
629
+ withCredentials: true,
630
+ });
631
+ }
632
+ createVariants(productId, data) {
633
+ return this.http.post(`${this.actionUrl}/${productId}/variants`, data, {
634
+ withCredentials: true,
635
+ });
636
+ }
637
+ getVariant(variantId) {
638
+ return this.http.get(`${this.actionUrl}/variants/${variantId}`);
639
+ }
640
+ findVariants(productId) {
641
+ return this.http.get(`${this.actionUrl}/${productId}/variants`);
642
+ }
643
+ findVariantsByIds(ids) {
644
+ const params = { ids: ids.join(',') };
645
+ return this.http.get(`${this.actionUrl}/variants/by`, {
646
+ params: params,
647
+ withCredentials: true,
648
+ });
649
+ }
650
+ updateVariants(productId, data) {
651
+ return this.http.put(`${this.actionUrl}/${productId}/variants`, data, {
652
+ withCredentials: true,
653
+ });
654
+ }
655
+ uploadVariantMedia(variantId, data) {
656
+ return this.http.post(`${this.actionUrl}/variants/${variantId}/media`, data, {
657
+ withCredentials: true,
658
+ });
659
+ }
660
+ deleteVariantMedia(variantId, mediaId) {
661
+ return this.http.delete(`${this.actionUrl}/variants/${variantId}/media/${mediaId}`, {
662
+ withCredentials: true,
663
+ });
664
+ }
665
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ProductService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
666
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ProductService, providedIn: 'root' });
667
+ }
668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: ProductService, decorators: [{
669
+ type: Injectable,
670
+ args: [{
671
+ providedIn: 'root',
672
+ }]
673
+ }] });
674
+
675
+ class CartService extends BaseService {
676
+ productService = inject(ProductService);
677
+ init() {
678
+ this.endpoint = 'carts';
679
+ super.init();
680
+ }
681
+ findDetails(options) {
682
+ return this.http
683
+ .get(`${this.actionUrl}`, {
684
+ params: options,
685
+ withCredentials: true,
686
+ })
687
+ .pipe(switchMap((res) => {
688
+ const productIds = _.uniq(_.map(res.data, 'productId')); // [12, 14, 16, 18]
689
+ return this.findProductsByIds(productIds).pipe(map((products) => {
690
+ res.data?.forEach((item) => {
691
+ const matchingProduct = _.find(products.data, { id: item.productId });
692
+ item.product = matchingProduct;
693
+ });
694
+ return res;
695
+ }));
696
+ }), switchMap((res) => {
697
+ const variantIds = _.uniq(_.map(res.data, 'variantId')); // [12, 14, 16, 18]
698
+ return this.findVariantsByIds(variantIds).pipe(map((variants) => {
699
+ res.data?.forEach((item) => {
700
+ const matchingVariant = _.find(variants.data, { id: item.variantId });
701
+ item.variant = matchingVariant;
702
+ });
703
+ return res;
704
+ }));
705
+ }));
706
+ }
707
+ findProductsByIds(ids) {
708
+ return this.productService.findByIds(ids);
709
+ }
710
+ findVariantsByIds(ids) {
711
+ return this.productService.findVariantsByIds(ids);
712
+ }
713
+ by(options) {
714
+ return this.http.get(`${this.actionUrl}/items/by`, {
715
+ params: options,
716
+ withCredentials: true,
717
+ });
718
+ }
719
+ me(options) {
720
+ return this.http.get(`${this.actionUrl}/me`, {
721
+ params: options,
722
+ withCredentials: true,
723
+ });
724
+ }
725
+ deleteByIds(ids) {
726
+ return this.http.delete(`${this.actionUrl}/me`, {
727
+ withCredentials: true,
728
+ });
729
+ }
730
+ deleteAll() {
731
+ return this.http.delete(`${this.actionUrl}/me`, {
732
+ withCredentials: true,
733
+ });
734
+ }
735
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: CartService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
736
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: CartService, providedIn: 'root' });
737
+ }
738
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: CartService, decorators: [{
739
+ type: Injectable,
740
+ args: [{
741
+ providedIn: 'root',
742
+ }]
743
+ }] });
744
+
745
+ class OrderService extends BaseService {
746
+ init() {
747
+ this.endpoint = 'orders';
748
+ super.init();
749
+ }
750
+ by(options) {
751
+ return this.http.get(`${this.actionUrl}/items/by`, {
752
+ params: options,
753
+ withCredentials: true,
754
+ });
755
+ }
756
+ me(options) {
757
+ return this.http.get(`${this.actionUrl}/me`, {
758
+ params: options,
759
+ withCredentials: true,
760
+ });
761
+ }
762
+ timeline(id) {
763
+ return this.http.get(`${this.actionUrl}/${id}/timeline`, {
764
+ withCredentials: true,
765
+ });
766
+ }
767
+ pay(id) {
768
+ return this.http.post(`${this.actionUrl}/${id}/pay`, {}, {
769
+ withCredentials: true,
770
+ });
771
+ }
772
+ refund(id, data) {
773
+ return this.http.post(`${this.actionUrl}/${id}/refund`, data, {
774
+ withCredentials: true,
775
+ });
776
+ }
777
+ findAllReturns(options) {
778
+ return this.http.get(`${this.actionUrl}/returns`, {
779
+ params: options,
780
+ withCredentials: true,
781
+ });
782
+ }
783
+ findAllReturnsByInstructor(options) {
784
+ return this.http.get(`${this.actionUrl}/returns/instructor`, {
785
+ params: options,
786
+ withCredentials: true,
787
+ });
788
+ }
789
+ getReturn(id) {
790
+ return this.http.get(`${this.actionUrl}/returns/${id}`, {
791
+ withCredentials: true,
792
+ });
793
+ }
794
+ returnApprove(id) {
795
+ return this.http.post(`${this.actionUrl}/returns/${id}/approve`, {}, {
796
+ withCredentials: true,
797
+ });
798
+ }
799
+ returnReject(id, data) {
800
+ return this.http.post(`${this.actionUrl}/returns/${id}/reject`, data, {
801
+ withCredentials: true,
802
+ });
803
+ }
804
+ cancel(id) {
805
+ return this.http.post(`${this.actionUrl}/${id}/cancel`, {}, {
806
+ withCredentials: true,
807
+ });
808
+ }
809
+ countMeByStatus(options) {
810
+ return this.http.get(`${this.actionUrl}/count/me/by`, {
811
+ params: options,
812
+ withCredentials: true,
813
+ });
814
+ }
815
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: OrderService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
816
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: OrderService, providedIn: 'root' });
817
+ }
818
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: OrderService, decorators: [{
819
+ type: Injectable,
820
+ args: [{
821
+ providedIn: 'root',
822
+ }]
823
+ }] });
824
+
499
825
  class LoadingInterceptor {
500
826
  loadingService;
501
827
  activeRequests = 0;
@@ -514,10 +840,10 @@ class LoadingInterceptor {
514
840
  }
515
841
  }));
516
842
  }
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' });
843
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: LoadingInterceptor, deps: [{ token: LoadingService }], target: i0.ɵɵFactoryTarget.Injectable });
844
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: LoadingInterceptor, providedIn: 'root' });
519
845
  }
520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: LoadingInterceptor, decorators: [{
846
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: LoadingInterceptor, decorators: [{
521
847
  type: Injectable,
522
848
  args: [{
523
849
  providedIn: 'root',
@@ -530,10 +856,10 @@ class BackButtonDirective {
530
856
  onClick() {
531
857
  this.navigation.back();
532
858
  }
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 });
859
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: BackButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
860
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.4", type: BackButtonDirective, isStandalone: true, selector: "[rolatechBackButton]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
535
861
  }
536
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: BackButtonDirective, decorators: [{
862
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: BackButtonDirective, decorators: [{
537
863
  type: Directive,
538
864
  args: [{
539
865
  selector: '[rolatechBackButton]',
@@ -559,6 +885,9 @@ function provideAngularServices() {
559
885
  BreadcrumbService,
560
886
  SidenavService,
561
887
  BackButtonDirective,
888
+ CartService,
889
+ ProductService,
890
+ OrderService,
562
891
  { provide: HTTP_INTERCEPTORS, useClass: LoadingInterceptor, multi: true },
563
892
  {
564
893
  provide: APP_INITIALIZER,
@@ -574,5 +903,5 @@ function provideAngularServices() {
574
903
  * Generated bundle index. Do not edit.
575
904
  */
576
905
 
577
- export { BackButtonDirective, BaseService, BreadcrumbService, DialogService, LayoutService, LoadingInterceptor, LoadingService, MediaService, NavigationService, SERVICE_DIRECTIVES, SidenavService, SnackBarService, SupportService, ThemeService, provideAngularServices };
906
+ export { BackButtonDirective, BaseService, BreadcrumbService, CartService, DialogService, LayoutService, LoadingInterceptor, LoadingService, MediaService, NavigationService, OrderService, ProductService, SERVICE_DIRECTIVES, SidenavService, SnackBarService, SupportService, ThemeService, provideAngularServices };
578
907
  //# sourceMappingURL=rolatech-angular-services.mjs.map