dolfo-angular 1.210.0 → 1.212.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,14 +1,15 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Input, ChangeDetectionStrategy, Component, InjectionToken, Injectable, inject, Inject, signal, Pipe, EventEmitter, Output, ViewChild, forwardRef, booleanAttribute, ChangeDetectorRef, ViewChildren, TemplateRef, ContentChild, EnvironmentInjector, createComponent, Injector, NgModule } from '@angular/core';
2
+ import { Directive, Input, ChangeDetectionStrategy, Component, InjectionToken, Injectable, inject, Inject, signal, Pipe, EventEmitter, Output, ViewChild, forwardRef, booleanAttribute, Injector, ChangeDetectorRef, ViewChildren, TemplateRef, ContentChild, EnvironmentInjector, createComponent, NgModule } from '@angular/core';
3
3
  import * as i1$1 from '@angular/forms';
4
4
  import { ControlContainer, FormControl, Validators, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormGroupDirective, FormGroup, ReactiveFormsModule } from '@angular/forms';
5
- import { BehaviorSubject, map, tap, distinctUntilChanged, filter, mergeMap, of, delay, catchError, throwError, zip, fromEvent, race } from 'rxjs';
5
+ import { BehaviorSubject, map, tap, distinctUntilChanged, filter, mergeMap, of, delay, catchError, throwError, zip, fromEvent, from, concatAll, race } from 'rxjs';
6
6
  import * as i1 from '@angular/common';
7
7
  import { formatDate, DecimalPipe, APP_BASE_HREF, CommonModule } from '@angular/common';
8
8
  import { HttpClient, HttpErrorResponse } from '@angular/common/http';
9
+ import * as i2 from '@angular/router';
10
+ import { Router } from '@angular/router';
9
11
  import * as i1$2 from '@angular/platform-browser';
10
12
  import { DomSanitizer } from '@angular/platform-browser';
11
- import * as i2 from '@angular/router';
12
13
 
13
14
  class Subscriptable {
14
15
  subs = [];
@@ -1086,6 +1087,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
1086
1087
  args: [{ transform: booleanAttribute }]
1087
1088
  }] } });
1088
1089
 
1090
+ class BaseAppComponent extends Subscriptable {
1091
+ injector = inject(Injector);
1092
+ router = inject(Router);
1093
+ storeService = inject(StoreService);
1094
+ loading = signal(0, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
1095
+ loadingMessage = signal("...", ...(ngDevMode ? [{ debugName: "loadingMessage" }] : /* istanbul ignore next */ []));
1096
+ ngOnInit() {
1097
+ from(Object.values(this.streams)).pipe(concatAll(), tap(desc => {
1098
+ this.loading.update(item => item + 1);
1099
+ this.loadingMessage.set(desc + "...");
1100
+ })).subscribe(() => {
1101
+ if (this.loading() === Object.keys(this.streams).length) {
1102
+ setTimeout(() => {
1103
+ this.loadingMessage.set(null);
1104
+ this.storeService.initialize();
1105
+ this.router.initialNavigation();
1106
+ }, 500);
1107
+ }
1108
+ });
1109
+ }
1110
+ ngAfterViewInit() {
1111
+ new OverlayManager(this.injector, this.container).init().forEach(s => this.addSubscription(s));
1112
+ }
1113
+ get percentage() {
1114
+ return (this.loading() * 100) / Object.keys(this.streams).length;
1115
+ }
1116
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: BaseAppComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1117
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: BaseAppComponent, isStandalone: true, usesInheritance: true, ngImport: i0 });
1118
+ }
1119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: BaseAppComponent, decorators: [{
1120
+ type: Directive
1121
+ }] });
1122
+
1089
1123
  class Formable extends Subscriptable {
1090
1124
  formRef;
1091
1125
  inputs;
@@ -2126,6 +2160,47 @@ class OverlayManager {
2126
2160
  };
2127
2161
  }
2128
2162
 
2163
+ class RouteConfig {
2164
+ path;
2165
+ loadComponent;
2166
+ redirectTo;
2167
+ pathMatch = "full";
2168
+ title;
2169
+ canActivate = [];
2170
+ constructor(path, withRouteCheck = true) {
2171
+ this.path = path;
2172
+ if (withRouteCheck)
2173
+ this.canActivate.push(RouteCheckService);
2174
+ }
2175
+ withTitle = (title) => {
2176
+ this.title = title;
2177
+ return this;
2178
+ };
2179
+ loadUrl = (imp) => {
2180
+ this.loadComponent = () => imp.then(t => Object.values(t)[0]);
2181
+ return this;
2182
+ };
2183
+ withRedirect = (url) => {
2184
+ this.redirectTo = url;
2185
+ return this;
2186
+ };
2187
+ addGuard = (guard) => {
2188
+ if (Array.isArray(guard))
2189
+ this.canActivate.push(...guard);
2190
+ else
2191
+ this.canActivate.push(guard);
2192
+ return this;
2193
+ };
2194
+ toRoute = () => ({
2195
+ loadComponent: this.loadComponent,
2196
+ path: this.path,
2197
+ pathMatch: this.pathMatch,
2198
+ title: this.title,
2199
+ redirectTo: this.redirectTo,
2200
+ canActivate: this.canActivate
2201
+ });
2202
+ }
2203
+
2129
2204
  class ContextMenuDirective extends Subscriptable {
2130
2205
  contextMenuService;
2131
2206
  elRef;
@@ -2513,5 +2588,5 @@ const errorInterceptor = (req, next) => {
2513
2588
  * Generated bundle index. Do not edit.
2514
2589
  */
2515
2590
 
2516
- export { AutocompleteComponent, BaseFormInput, ButtonComponent, CONTEXT_MENU_DESTROY_TOKEN, ColumnAlign, ColumnDataType, ComboboxComponent, ContextMenuComponent, ContextMenuDirective, ContextMenuService, DatepickerComponent, DialogActionType, DialogComponent, DialogContentComponent, DialogFooterComponent, DialogHeaderComponent, DialogLayoutComponent, DialogLayoutModule, DialogService, DialogUtilsService, DirectivesModule, FormComponent, FormModule, Formable, GridComponent, GridConfig, GridModule, ICON_COMPONENT, IconComponent, IconWrapperComponent, InputCheckboxComponent, InputContainerComponent, InputRadioComponent, InputTextComponent, LANGUAGE_TOKEN, LayoutModule, LoaderComponent, MAX_DEVICE_SIZE, MAX_SMALL_DEVICE, NavigateDirective, NotificationComponent, NotificationService, OverlayManager, POPOVER_DESTROY_TOKEN, PopoverComponent, PopoverDirective, PopoverService, ROUTE_CHECK_SERVICE, RouteCheckService, ScrollDragDirective, StorageValues, StoreLists, StoreService, Subscriptable, TOOLTIP_DESTROY_TOKEN, TRANSLATE_STORAGE_KEY, TooltipComponent, TooltipDirective, TooltipService, TranslatePipe, TranslateService, authInterceptor, errorInterceptor, isDeepEqual, passwordValidator, provideDolfoLanguages };
2591
+ export { AutocompleteComponent, BaseAppComponent, BaseFormInput, ButtonComponent, CONTEXT_MENU_DESTROY_TOKEN, ColumnAlign, ColumnDataType, ComboboxComponent, ContextMenuComponent, ContextMenuDirective, ContextMenuService, DatepickerComponent, DialogActionType, DialogComponent, DialogContentComponent, DialogFooterComponent, DialogHeaderComponent, DialogLayoutComponent, DialogLayoutModule, DialogService, DialogUtilsService, DirectivesModule, FormComponent, FormModule, Formable, GridComponent, GridConfig, GridModule, ICON_COMPONENT, IconComponent, IconWrapperComponent, InputCheckboxComponent, InputContainerComponent, InputRadioComponent, InputTextComponent, LANGUAGE_TOKEN, LayoutModule, LoaderComponent, MAX_DEVICE_SIZE, MAX_SMALL_DEVICE, NavigateDirective, NotificationComponent, NotificationService, OverlayManager, POPOVER_DESTROY_TOKEN, PopoverComponent, PopoverDirective, PopoverService, ROUTE_CHECK_SERVICE, RouteCheckService, RouteConfig, ScrollDragDirective, StorageValues, StoreLists, StoreService, Subscriptable, TOOLTIP_DESTROY_TOKEN, TRANSLATE_STORAGE_KEY, TooltipComponent, TooltipDirective, TooltipService, TranslatePipe, TranslateService, authInterceptor, errorInterceptor, isDeepEqual, passwordValidator, provideDolfoLanguages };
2517
2592
  //# sourceMappingURL=dolfo-angular.mjs.map