@wolkabout/commons 0.0.5 → 0.0.6
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/fesm2022/wolkabout-commons.mjs +27 -3
- package/fesm2022/wolkabout-commons.mjs.map +1 -1
- package/index.d.ts +28 -12
- package/package.json +1 -1
|
@@ -65,9 +65,10 @@ import { MatTabsModule } from '@angular/material/tabs';
|
|
|
65
65
|
import * as i32 from '@angular/cdk/drag-drop';
|
|
66
66
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
67
67
|
import * as i0 from '@angular/core';
|
|
68
|
-
import { InjectionToken, inject, Injectable, DOCUMENT, Inject, Input, Directive, forwardRef, HostListener, TemplateRef, PLATFORM_ID, Pipe, ViewChild, ContentChild, Optional, Self, Component, input, computed, untracked, signal, viewChild, afterNextRender, effect, output, afterRenderEffect, contentChild } from '@angular/core';
|
|
69
|
-
import { BehaviorSubject, catchError, of, switchMap, EMPTY, tap, filter, map, combineLatestWith, distinctUntilChanged, shareReplay, merge, Subject, takeUntil, combineLatest,
|
|
68
|
+
import { InjectionToken, inject, Injectable, Injector, runInInjectionContext, DOCUMENT, Inject, Input, Directive, forwardRef, HostListener, TemplateRef, PLATFORM_ID, Pipe, ViewChild, ContentChild, Optional, Self, Component, input, computed, untracked, signal, viewChild, afterNextRender, effect, output, afterRenderEffect, contentChild } from '@angular/core';
|
|
69
|
+
import { BehaviorSubject, catchError, of, switchMap, EMPTY, tap, filter, map, combineLatestWith, forkJoin, from, distinctUntilChanged, shareReplay, merge, Subject, takeUntil, combineLatest, take, first } from 'rxjs';
|
|
70
70
|
import { jwtDecode } from 'jwt-decode';
|
|
71
|
+
import { loadRemoteModule } from '@angular-architects/native-federation';
|
|
71
72
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
72
73
|
import * as i1 from '@angular/material/snack-bar';
|
|
73
74
|
import { TonalPalette, Hct, argbFromHex, hexFromArgb } from '@material/material-color-utilities';
|
|
@@ -421,6 +422,29 @@ const createGlobalPermissionsGuard = (availableRoutesGetter, fallbackRoute, pare
|
|
|
421
422
|
return permissionsGuard;
|
|
422
423
|
};
|
|
423
424
|
|
|
425
|
+
class FeatureRegistry {
|
|
426
|
+
injector = inject(Injector);
|
|
427
|
+
_features = new BehaviorSubject([]);
|
|
428
|
+
registerFeature(feature) {
|
|
429
|
+
runInInjectionContext(this.injector, () => feature.init?.());
|
|
430
|
+
this._features.next([...this._features.value, feature]);
|
|
431
|
+
}
|
|
432
|
+
loadExternalFeatures(features) {
|
|
433
|
+
forkJoin(features.map(externalFeature => from(loadRemoteModule(externalFeature.remote, externalFeature.exposedModule)).pipe(map(module => module.feature), catchError(() => of(null))))).pipe(map(list => list.filter((x) => x !== null))).subscribe((externalFeatures) => {
|
|
434
|
+
externalFeatures.forEach(feature => this.registerFeature(feature));
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
get features() {
|
|
438
|
+
return this._features.pipe(map(features => [...features].sort((a, b) => a.order - b.order)));
|
|
439
|
+
}
|
|
440
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FeatureRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
441
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FeatureRegistry, providedIn: 'root' });
|
|
442
|
+
}
|
|
443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FeatureRegistry, decorators: [{
|
|
444
|
+
type: Injectable,
|
|
445
|
+
args: [{ providedIn: 'root' }]
|
|
446
|
+
}] });
|
|
447
|
+
|
|
424
448
|
class MapsLoaderService {
|
|
425
449
|
scriptSrc = 'https://maps.googleapis.com/maps/api/js?key=GOOGLE_MAPS_API_KEY&libraries=marker&callback=initMap';
|
|
426
450
|
elementId = 'google-maps-script';
|
|
@@ -6878,5 +6902,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
6878
6902
|
* Generated bundle index. Do not edit.
|
|
6879
6903
|
*/
|
|
6880
6904
|
|
|
6881
|
-
export { AUTHENTICATION_CLIENT, AuthenticationService, AutocompleteChipsComponent, AutocompleteComponent, BasicTimeSeriesGraphComponent, COLORS, CUSTOM_PERIOD, CardLabeledValueComponent, ConfirmationDialogComponent, DEFAULT_LOCALE, DEFAULT_TIMEZONES, DEFAULT_TIME_ZONE, DataType, DateRangeInputComponent, DateTimeFormFieldComponent, DragDropFileUploadComponent, DurationPipe, GoogleMapComponent, ImageDisplayComponent, ImagePreviewComponent, LAST_ACTIVE_TAB_KEY, LOCALES, LabeledValueComponent, LoadedIconComponent, LoadingIndicatorDirective, LocalSortTableComponent, Locale, LocalizedNumberPipe, LocalizedNumericInputDirective, MILLISECONDS_IN_DAY, MapsLoaderService, MasterDetailsViewComponent, MessageTooltipDirective, MissingTranslationHelper, NestedListDataControl, NestedListDataSource, NestedListViewComponent, NgTemplateContentDirective, NotificationService, OverflowClassDirective, PdfViewerComponent, PeriodErrorStateMatcher, Permission, PermissionsService, RELATIVE_TIME_PERIODS, RelativeTimePeriod, RequiresAllGlobalOrAssetPermissionsDirective, RequiresAllPermissionDirective, RequiresGlobalOrAsserPermissionDirective, RequiresPermissionDirective, ScrollIntoViewDirective, SimpleDatePipe, SimpleDateTimePipe, SimpleTimePipe, SortPipe, StandardListDataControl, StandardListDataSource, StandardListViewComponent, TIMEZONES, TabulatedChipViewComponent, TabulatedViewComponent, TenantPropertiesService, ThemeService, TreeComponent, TreeNodeComponent, USERS_TIME_ZONE, ValueDisplayComponent, ValueInputBooleanComponent, ValueInputColorComponent, ValueInputComponent, ValueInputDateComponent, ValueInputDurationComponent, ValueInputEnumComponent, ValueInputHexadecimalComponent, ValueInputLinkComponent, ValueInputLocationComponent, ValueInputNumericComponent, ValueInputStringComponent, ValueInputVectorComponent, angularComponents, arrayToObject, chartThemeDark, chartThemeLight, createGlobalPermissionsGuard, daysAway, determineMagnitude, determineMinMaxValues, endOfPeriod, equalsByValue, fileSizeValidator, flatMap, flatten, format, formatDuration, generateRandomString, groupBy, hoursAway, isContextAccessible, lookUpPathPart, lookUpQueryParam, parseDateRangeInputPeriod, parseTimeInput, saveFile, scale, shared, startOfMonth, startOfPeriod, startOfTheDay, startOfWeek, startOfYear, toDate, toEndOfMonth, toEndOfYear, toJsDate, toOffset, toStartOfMonth, toStartOfTheDay, toStartOfWeek, toStartOfYear, toTime, uniqueBy, uniqueFrom, validateAssetName, validateTypeAssetName };
|
|
6905
|
+
export { AUTHENTICATION_CLIENT, AuthenticationService, AutocompleteChipsComponent, AutocompleteComponent, BasicTimeSeriesGraphComponent, COLORS, CUSTOM_PERIOD, CardLabeledValueComponent, ConfirmationDialogComponent, DEFAULT_LOCALE, DEFAULT_TIMEZONES, DEFAULT_TIME_ZONE, DataType, DateRangeInputComponent, DateTimeFormFieldComponent, DragDropFileUploadComponent, DurationPipe, FeatureRegistry, GoogleMapComponent, ImageDisplayComponent, ImagePreviewComponent, LAST_ACTIVE_TAB_KEY, LOCALES, LabeledValueComponent, LoadedIconComponent, LoadingIndicatorDirective, LocalSortTableComponent, Locale, LocalizedNumberPipe, LocalizedNumericInputDirective, MILLISECONDS_IN_DAY, MapsLoaderService, MasterDetailsViewComponent, MessageTooltipDirective, MissingTranslationHelper, NestedListDataControl, NestedListDataSource, NestedListViewComponent, NgTemplateContentDirective, NotificationService, OverflowClassDirective, PdfViewerComponent, PeriodErrorStateMatcher, Permission, PermissionsService, RELATIVE_TIME_PERIODS, RelativeTimePeriod, RequiresAllGlobalOrAssetPermissionsDirective, RequiresAllPermissionDirective, RequiresGlobalOrAsserPermissionDirective, RequiresPermissionDirective, ScrollIntoViewDirective, SimpleDatePipe, SimpleDateTimePipe, SimpleTimePipe, SortPipe, StandardListDataControl, StandardListDataSource, StandardListViewComponent, TIMEZONES, TabulatedChipViewComponent, TabulatedViewComponent, TenantPropertiesService, ThemeService, TreeComponent, TreeNodeComponent, USERS_TIME_ZONE, ValueDisplayComponent, ValueInputBooleanComponent, ValueInputColorComponent, ValueInputComponent, ValueInputDateComponent, ValueInputDurationComponent, ValueInputEnumComponent, ValueInputHexadecimalComponent, ValueInputLinkComponent, ValueInputLocationComponent, ValueInputNumericComponent, ValueInputStringComponent, ValueInputVectorComponent, angularComponents, arrayToObject, chartThemeDark, chartThemeLight, createGlobalPermissionsGuard, daysAway, determineMagnitude, determineMinMaxValues, endOfPeriod, equalsByValue, fileSizeValidator, flatMap, flatten, format, formatDuration, generateRandomString, groupBy, hoursAway, isContextAccessible, lookUpPathPart, lookUpQueryParam, parseDateRangeInputPeriod, parseTimeInput, saveFile, scale, shared, startOfMonth, startOfPeriod, startOfTheDay, startOfWeek, startOfYear, toDate, toEndOfMonth, toEndOfYear, toJsDate, toOffset, toStartOfMonth, toStartOfTheDay, toStartOfWeek, toStartOfYear, toTime, uniqueBy, uniqueFrom, validateAssetName, validateTypeAssetName };
|
|
6882
6906
|
//# sourceMappingURL=wolkabout-commons.mjs.map
|