@one-paragon/angular-utilities 2.0.11 → 2.0.13
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/one-paragon-angular-utilities.mjs +53 -53
- package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -1
- package/package.json +1 -1
- package/table-builder/components/column-builder/column-builder.component.d.ts +1 -1
- package/table-builder/interfaces/report-def.d.ts +8 -13
- package/utilities/directives/conditional-classes.directive.d.ts +4 -5
- package/utilities/directives/styler.d.ts +6 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, inject, Injector, TemplateRef, ViewContainerRef, NgModule, assertInInjectionContext, DestroyRef, computed, isSignal, Injectable, Pipe, input, signal, Renderer2, ElementRef, booleanAttribute, InjectionToken, makeEnvironmentProviders, Component, ChangeDetectionStrategy, HostListener, EventEmitter, untracked, Output, ContentChildren, ChangeDetectorRef, output, ViewChild, EnvironmentInjector, createComponent, viewChild, linkedSignal,
|
|
2
|
+
import { Directive, Input, inject, Injector, TemplateRef, ViewContainerRef, NgModule, assertInInjectionContext, DestroyRef, computed, isSignal, Injectable, Pipe, input, signal, Renderer2, ElementRef, booleanAttribute, InjectionToken, makeEnvironmentProviders, Component, ChangeDetectionStrategy, HostListener, EventEmitter, untracked, Output, effect, ContentChildren, ChangeDetectorRef, output, ViewChild, EnvironmentInjector, createComponent, viewChild, linkedSignal, contentChild, forwardRef, contentChildren, model, runInInjectionContext, provideAppInitializer } from '@angular/core';
|
|
3
3
|
import { shareReplay, switchAll, map, filter, tap, catchError, startWith, switchMap, mergeMap, concatMap as concatMap$1, takeUntil, distinctUntilChanged, observeOn, debounceTime, scan as scan$1, timestamp as timestamp$1, first as first$1 } from 'rxjs/operators';
|
|
4
4
|
import * as i1 from 'rxjs';
|
|
5
5
|
import { Subject, isObservable, of, ReplaySubject, filter as filter$1, first, map as map$1, Observable, combineLatest, Subscription, startWith as startWith$1, pairwise, concatMap, merge, delay, fromEvent, takeUntil as takeUntil$1, tap as tap$1, switchMap as switchMap$1, scan, timestamp, animationFrameScheduler, debounceTime as debounceTime$1, BehaviorSubject } from 'rxjs';
|
|
@@ -2554,40 +2554,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
2554
2554
|
class StylerDirective {
|
|
2555
2555
|
el = inject(ElementRef);
|
|
2556
2556
|
renderer = inject(Renderer2);
|
|
2557
|
-
stylesApplied = {};
|
|
2558
|
-
element;
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
}
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2557
|
+
$stylesApplied = signal({});
|
|
2558
|
+
$element = input.required({ alias: 'element' });
|
|
2559
|
+
$styler = input.required({ alias: 'styler' });
|
|
2560
|
+
#stylerEffect = effect(() => {
|
|
2561
|
+
const styles = this.$styler();
|
|
2562
|
+
untracked(() => {
|
|
2563
|
+
const element = this.$element();
|
|
2564
|
+
const toApply = Object.entries(styles ?? {}).reduce((acc, [key, val]) => {
|
|
2565
|
+
if (!val)
|
|
2566
|
+
return acc;
|
|
2567
|
+
if (typeof (val) === 'string') {
|
|
2568
|
+
acc[key] = val;
|
|
2569
|
+
this.el.nativeElement.style[key] = val;
|
|
2570
|
+
}
|
|
2571
|
+
else if (!val?.condition || val?.condition === true || val?.condition(element)) {
|
|
2572
|
+
const value = typeof (val.value) === 'string' ? val.value : val?.value(element);
|
|
2573
|
+
acc[key] = value;
|
|
2574
|
+
this.el.nativeElement.style[key] = value;
|
|
2575
|
+
}
|
|
2576
|
+
return acc;
|
|
2577
|
+
}, {});
|
|
2578
|
+
Object.keys(this.$stylesApplied()).filter(key => !Object.keys(toApply).includes(key)).forEach(key => {
|
|
2579
|
+
this.renderer.removeStyle(this.el.nativeElement, key);
|
|
2580
|
+
});
|
|
2581
|
+
this.$stylesApplied.set(toApply);
|
|
2574
2582
|
});
|
|
2575
|
-
|
|
2576
|
-
}
|
|
2577
|
-
;
|
|
2583
|
+
});
|
|
2578
2584
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: StylerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2579
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
2585
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: StylerDirective, isStandalone: true, selector: "[styler]", inputs: { $element: { classPropertyName: "$element", publicName: "element", isSignal: true, isRequired: true, transformFunction: null }, $styler: { classPropertyName: "$styler", publicName: "styler", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
2580
2586
|
}
|
|
2581
2587
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: StylerDirective, decorators: [{
|
|
2582
2588
|
type: Directive,
|
|
2583
|
-
args: [{
|
|
2584
|
-
|
|
2585
|
-
}]
|
|
2586
|
-
}], propDecorators: { element: [{
|
|
2587
|
-
type: Input
|
|
2588
|
-
}], styler: [{
|
|
2589
|
-
type: Input
|
|
2590
|
-
}] } });
|
|
2589
|
+
args: [{ selector: '[styler]' }]
|
|
2590
|
+
}] });
|
|
2591
2591
|
|
|
2592
2592
|
class MatSlideToggleGroupDirective {
|
|
2593
2593
|
allowMultiple = false;
|
|
@@ -2690,35 +2690,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
2690
2690
|
class ConditionalClassesDirective {
|
|
2691
2691
|
el = inject(ElementRef);
|
|
2692
2692
|
renderer = inject(Renderer2);
|
|
2693
|
-
element;
|
|
2694
|
-
classes;
|
|
2693
|
+
$element = input.required({ alias: 'element' });
|
|
2694
|
+
$classes = input(undefined, { alias: 'conditionalClasses' });
|
|
2695
2695
|
classesApplied = [];
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2696
|
+
#onClasses = effect(() => {
|
|
2697
|
+
const classes = this.$classes();
|
|
2698
|
+
untracked(() => {
|
|
2699
|
+
const element = this.$element();
|
|
2700
|
+
let toApply = [];
|
|
2701
|
+
if (classes) {
|
|
2702
|
+
toApply = Object.keys(classes)
|
|
2703
|
+
.filter(key => (classes[key] === true) || classes[key](element));
|
|
2704
|
+
}
|
|
2705
|
+
var classesNotYetApplied = toApply.filter(c => !this.classesApplied.includes(c));
|
|
2706
|
+
var classesToRemove = this.classesApplied.filter(c => !toApply.includes(c));
|
|
2707
|
+
classesToRemove.forEach(c => this.renderer.removeClass(this.el.nativeElement, c));
|
|
2708
|
+
classesNotYetApplied.forEach(c => this.renderer.addClass(this.el.nativeElement, c));
|
|
2709
|
+
this.classesApplied = toApply;
|
|
2710
|
+
});
|
|
2711
|
+
});
|
|
2708
2712
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ConditionalClassesDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2709
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
2713
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: ConditionalClassesDirective, isStandalone: true, selector: "[conditionalClasses]", inputs: { $element: { classPropertyName: "$element", publicName: "element", isSignal: true, isRequired: true, transformFunction: null }, $classes: { classPropertyName: "$classes", publicName: "conditionalClasses", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
2710
2714
|
}
|
|
2711
2715
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ConditionalClassesDirective, decorators: [{
|
|
2712
2716
|
type: Directive,
|
|
2713
2717
|
args: [{
|
|
2714
2718
|
selector: '[conditionalClasses]',
|
|
2715
2719
|
}]
|
|
2716
|
-
}]
|
|
2717
|
-
type: Input
|
|
2718
|
-
}], classes: [{
|
|
2719
|
-
type: Input,
|
|
2720
|
-
args: ['conditionalClasses']
|
|
2721
|
-
}] } });
|
|
2720
|
+
}] });
|
|
2722
2721
|
|
|
2723
2722
|
class UtilitiesModule {
|
|
2724
2723
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UtilitiesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -4152,7 +4151,7 @@ function createLinkCreator(metaData) {
|
|
|
4152
4151
|
const hasRoute = !!metaData.additional?.link?.interpolatedRoute;
|
|
4153
4152
|
const routerLinkOptions = useRouterLink ? {
|
|
4154
4153
|
queryParams: (element) => metaData.additional.link.routerLinkOptions?.queryParams?.reduce((map, [key, value]) => {
|
|
4155
|
-
map[key] = parseInterpolated(value, element);
|
|
4154
|
+
map[key] = typeof value === 'function' ? value(element) : parseInterpolated(value, element);
|
|
4156
4155
|
return map;
|
|
4157
4156
|
}, {}) ?? null,
|
|
4158
4157
|
fragment: metaData.additional.link?.routerLinkOptions?.fragment,
|
|
@@ -4161,8 +4160,9 @@ function createLinkCreator(metaData) {
|
|
|
4161
4160
|
}
|
|
4162
4161
|
: undefined;
|
|
4163
4162
|
if (hasRoute) {
|
|
4163
|
+
const value = metaData.additional.link.interpolatedRoute;
|
|
4164
4164
|
return ({
|
|
4165
|
-
link: (element) => parseInterpolated(
|
|
4165
|
+
link: (element) => typeof value === 'function' ? value(element) : parseInterpolated(value, element),
|
|
4166
4166
|
target,
|
|
4167
4167
|
useRouterLink,
|
|
4168
4168
|
routerLinkOptions,
|