@lenne.tech/ng-base 13.25.0 → 13.26.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.
@@ -1,16 +1,17 @@
1
1
  import { GraphQLInputObjectType, GraphQLNonNull, GraphQLList, buildClientSchema, getIntrospectionQuery } from 'graphql';
2
2
  import { cloneDeep } from '@apollo/client/utilities';
3
3
  import * as i0 from '@angular/core';
4
- import { Directive, Inject, Input, HostListener, InjectionToken, Injectable } from '@angular/core';
4
+ import { Directive, Inject, Input, HostListener, Injectable, InjectionToken } from '@angular/core';
5
+ import * as i2 from '@angular/common';
5
6
  import { DOCUMENT } from '@angular/common';
7
+ import * as i1 from '@angular/router';
8
+ import { NavigationEnd } from '@angular/router';
6
9
  import { BehaviorSubject, of, throwError, Observable, map as map$1, filter } from 'rxjs';
7
- import * as i1 from 'apollo-angular';
10
+ import * as i1$1 from 'apollo-angular';
8
11
  import { gql } from 'apollo-angular';
9
12
  import { sha256 } from 'js-sha256';
10
13
  import { map } from 'rxjs/operators';
11
14
  import { FormControl, FormGroup } from '@angular/forms';
12
- import * as i1$1 from '@angular/router';
13
- import { NavigationEnd } from '@angular/router';
14
15
  import { createClient } from 'graphql-ws';
15
16
 
16
17
  /**
@@ -814,6 +815,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
814
815
  args: ['click']
815
816
  }] } });
816
817
 
818
+ class NavigationService {
819
+ constructor(router, location) {
820
+ this.router = router;
821
+ this.location = location;
822
+ this.history = [];
823
+ this.router.events.subscribe((event) => {
824
+ if (event instanceof NavigationEnd) {
825
+ this.history.push(event.urlAfterRedirects);
826
+ }
827
+ });
828
+ }
829
+ /**
830
+ * If the history stack is empty, navigate to the home page, otherwise go back to the previous page
831
+ */
832
+ back() {
833
+ this.history.pop();
834
+ if (this.history.length > 0) {
835
+ this.location.back();
836
+ }
837
+ else {
838
+ this.router.navigateByUrl('/');
839
+ }
840
+ }
841
+ }
842
+ NavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NavigationService, deps: [{ token: i1.Router }, { token: i2.Location }], target: i0.ɵɵFactoryTarget.Injectable });
843
+ NavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NavigationService, providedIn: 'root' });
844
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NavigationService, decorators: [{
845
+ type: Injectable,
846
+ args: [{ providedIn: 'root' }]
847
+ }], ctorParameters: function () { return [{ type: i1.Router }, { type: i2.Location }]; } });
848
+
849
+ class BackButtonDirective {
850
+ constructor(navigation) {
851
+ this.navigation = navigation;
852
+ }
853
+ onClick() {
854
+ this.navigation.back();
855
+ }
856
+ }
857
+ BackButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: BackButtonDirective, deps: [{ token: NavigationService }], target: i0.ɵɵFactoryTarget.Directive });
858
+ BackButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.3", type: BackButtonDirective, selector: "[baseBackButton]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
859
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: BackButtonDirective, decorators: [{
860
+ type: Directive,
861
+ args: [{
862
+ selector: '[baseBackButton]',
863
+ }]
864
+ }], ctorParameters: function () { return [{ type: NavigationService }]; }, propDecorators: { onClick: [{
865
+ type: HostListener,
866
+ args: ['click']
867
+ }] } });
868
+
817
869
  const BASE_MODULE_CONFIG = new InjectionToken('BASE_MODULE_CONFIG');
818
870
 
819
871
  /**
@@ -1139,14 +1191,14 @@ class GraphQLMetaService {
1139
1191
  return observable;
1140
1192
  }
1141
1193
  }
1142
- GraphQLMetaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLMetaService, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
1194
+ GraphQLMetaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLMetaService, deps: [{ token: i1$1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
1143
1195
  GraphQLMetaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLMetaService, providedIn: 'root' });
1144
1196
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLMetaService, decorators: [{
1145
1197
  type: Injectable,
1146
1198
  args: [{
1147
1199
  providedIn: 'root',
1148
1200
  }]
1149
- }], ctorParameters: function () { return [{ type: i1.Apollo }]; } });
1201
+ }], ctorParameters: function () { return [{ type: i1$1.Apollo }]; } });
1150
1202
 
1151
1203
  /**
1152
1204
  * GraphQL service
@@ -1575,14 +1627,14 @@ class GraphQLService {
1575
1627
  return { fieldsString, schemaFields, usedFields };
1576
1628
  }
1577
1629
  }
1578
- GraphQLService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLService, deps: [{ token: i1.Apollo }, { token: GraphQLMetaService }], target: i0.ɵɵFactoryTarget.Injectable });
1630
+ GraphQLService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLService, deps: [{ token: i1$1.Apollo }, { token: GraphQLMetaService }], target: i0.ɵɵFactoryTarget.Injectable });
1579
1631
  GraphQLService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLService, providedIn: 'root' });
1580
1632
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLService, decorators: [{
1581
1633
  type: Injectable,
1582
1634
  args: [{
1583
1635
  providedIn: 'root',
1584
1636
  }]
1585
- }], ctorParameters: function () { return [{ type: i1.Apollo }, { type: GraphQLMetaService }]; } });
1637
+ }], ctorParameters: function () { return [{ type: i1$1.Apollo }, { type: GraphQLMetaService }]; } });
1586
1638
 
1587
1639
  /**
1588
1640
  * Loader service for loading indication
@@ -1677,14 +1729,14 @@ class GraphQLPlusService extends GraphQLService {
1677
1729
  console.error(error);
1678
1730
  }
1679
1731
  }
1680
- GraphQLPlusService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLPlusService, deps: [{ token: i1.Apollo }, { token: GraphQLMetaService }, { token: LoaderService }], target: i0.ɵɵFactoryTarget.Injectable });
1732
+ GraphQLPlusService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLPlusService, deps: [{ token: i1$1.Apollo }, { token: GraphQLMetaService }, { token: LoaderService }], target: i0.ɵɵFactoryTarget.Injectable });
1681
1733
  GraphQLPlusService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLPlusService, providedIn: 'root' });
1682
1734
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: GraphQLPlusService, decorators: [{
1683
1735
  type: Injectable,
1684
1736
  args: [{
1685
1737
  providedIn: 'root',
1686
1738
  }]
1687
- }], ctorParameters: function () { return [{ type: i1.Apollo }, { type: GraphQLMetaService }, { type: LoaderService }]; } });
1739
+ }], ctorParameters: function () { return [{ type: i1$1.Apollo }, { type: GraphQLMetaService }, { type: LoaderService }]; } });
1688
1740
 
1689
1741
  class FormsService {
1690
1742
  validateAllFormFields(formGroup) {
@@ -1770,14 +1822,14 @@ class UserService extends GraphQLPlusService {
1770
1822
  });
1771
1823
  }
1772
1824
  }
1773
- UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: UserService, deps: [{ token: i1.Apollo }, { token: GraphQLMetaService }, { token: LoaderService }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
1825
+ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: UserService, deps: [{ token: i1$1.Apollo }, { token: GraphQLMetaService }, { token: LoaderService }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
1774
1826
  UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: UserService, providedIn: 'root' });
1775
1827
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: UserService, decorators: [{
1776
1828
  type: Injectable,
1777
1829
  args: [{
1778
1830
  providedIn: 'root',
1779
1831
  }]
1780
- }], ctorParameters: function () { return [{ type: i1.Apollo }, { type: GraphQLMetaService }, { type: LoaderService }, { type: AuthService }]; } });
1832
+ }], ctorParameters: function () { return [{ type: i1$1.Apollo }, { type: GraphQLMetaService }, { type: LoaderService }, { type: AuthService }]; } });
1781
1833
 
1782
1834
  /**
1783
1835
  * Image service
@@ -2040,14 +2092,14 @@ class ScrollService {
2040
2092
  return this.scrollPromise;
2041
2093
  }
2042
2094
  }
2043
- ScrollService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ScrollService, deps: [{ token: i1$1.Router }, { token: BASE_MODULE_CONFIG }, { token: ImageService }], target: i0.ɵɵFactoryTarget.Injectable });
2095
+ ScrollService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ScrollService, deps: [{ token: i1.Router }, { token: BASE_MODULE_CONFIG }, { token: ImageService }], target: i0.ɵɵFactoryTarget.Injectable });
2044
2096
  ScrollService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ScrollService, providedIn: 'root' });
2045
2097
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ScrollService, decorators: [{
2046
2098
  type: Injectable,
2047
2099
  args: [{
2048
2100
  providedIn: 'root',
2049
2101
  }]
2050
- }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: undefined, decorators: [{
2102
+ }], ctorParameters: function () { return [{ type: i1.Router }, { type: undefined, decorators: [{
2051
2103
  type: Inject,
2052
2104
  args: [BASE_MODULE_CONFIG]
2053
2105
  }] }, { type: ImageService }]; } });
@@ -2144,14 +2196,14 @@ class BreadcrumbService {
2144
2196
  return typeof data.breadcrumb === 'function' ? data.breadcrumb(data) : data.breadcrumb;
2145
2197
  }
2146
2198
  }
2147
- BreadcrumbService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: BreadcrumbService, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
2199
+ BreadcrumbService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: BreadcrumbService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
2148
2200
  BreadcrumbService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
2149
2201
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: BreadcrumbService, decorators: [{
2150
2202
  type: Injectable,
2151
2203
  args: [{
2152
2204
  providedIn: 'root',
2153
2205
  }]
2154
- }], ctorParameters: function () { return [{ type: i1$1.Router }]; } });
2206
+ }], ctorParameters: function () { return [{ type: i1.Router }]; } });
2155
2207
 
2156
2208
  /**
2157
2209
  * Comparison operator enum
@@ -2265,5 +2317,5 @@ function createRestartableClient(options) {
2265
2317
  * Generated bundle index. Do not edit.
2266
2318
  */
2267
2319
 
2268
- export { Auth, AuthService, BASE_MODULE_CONFIG, BasicUser, BreadcrumbService, ComparisonOperatorEnum, FormsService, GraphQLEnum, GraphQLMeta, GraphQLMetaService, GraphQLPlusService, GraphQLRequestType, GraphQLService, GraphQLType, Helper, ImageService, LoaderService, LogicalOperatorEnum, ScrollService, SkeletonType, Sort, SortDirective, SortOrderEnum, Standard, StorageService, ToastService, ToastType, UserService, Validation, WsService, createRestartableClient };
2320
+ export { Auth, AuthService, BASE_MODULE_CONFIG, BackButtonDirective, BasicUser, BreadcrumbService, ComparisonOperatorEnum, FormsService, GraphQLEnum, GraphQLMeta, GraphQLMetaService, GraphQLPlusService, GraphQLRequestType, GraphQLService, GraphQLType, Helper, ImageService, LoaderService, LogicalOperatorEnum, NavigationService, ScrollService, SkeletonType, Sort, SortDirective, SortOrderEnum, Standard, StorageService, ToastService, ToastType, UserService, Validation, WsService, createRestartableClient };
2269
2321
  //# sourceMappingURL=lenne.tech-ng-base-shared.mjs.map