@abp/ng.core 10.1.1 → 10.2.0-rc.2
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/abp-ng.core.mjs +236 -170
- package/fesm2022/abp-ng.core.mjs.map +1 -1
- package/package.json +2 -2
- package/types/abp-ng.core.d.ts +81 -37
package/fesm2022/abp-ng.core.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef,
|
|
3
|
-
import { of, BehaviorSubject, Subject, firstValueFrom, throwError, timeout, lastValueFrom, Observable, timer, pipe, concat, ReplaySubject, defer, EMPTY, map as map$1, Subscription, combineLatest, from, take as take$1, filter as filter$1, fromEvent,
|
|
2
|
+
import { inject, ChangeDetectorRef, input, Component, Injectable, InjectionToken, Injector, isDevMode, NgModuleFactory, Compiler, PLATFORM_ID, makeStateKey, TransferState, REQUEST, NgZone, signal, computed, effect, LOCALE_ID, ComponentFactoryResolver, ApplicationRef, ElementRef, Directive, output, TemplateRef, ViewContainerRef, IterableDiffers, HostListener, provideAppInitializer, makeEnvironmentProviders, Pipe, SecurityContext, NgModule } from '@angular/core';
|
|
3
|
+
import { of, BehaviorSubject, Subject, firstValueFrom, throwError, timeout, lastValueFrom, Observable, timer, pipe, concat, ReplaySubject, defer, EMPTY, distinctUntilChanged as distinctUntilChanged$1, switchMap as switchMap$1, map as map$1, Subscription, combineLatest, from, take as take$1, filter as filter$1, fromEvent, startWith } from 'rxjs';
|
|
4
4
|
import { PRIMARY_OUTLET, Router, NavigationStart, NavigationError, NavigationEnd, NavigationCancel, TitleStrategy, ActivatedRoute, RouterOutlet, RouterModule } from '@angular/router';
|
|
5
5
|
import { isPlatformBrowser, DOCUMENT, registerLocaleData, NgComponentOutlet, isPlatformServer, DatePipe, DATE_PIPE_DEFAULT_TIMEZONE, CommonModule } from '@angular/common';
|
|
6
6
|
import { map, distinctUntilChanged, filter, catchError, tap, take, switchMap, mapTo, takeUntil, delay, retryWhen, shareReplay, debounceTime, finalize } from 'rxjs/operators';
|
|
@@ -18,12 +18,14 @@ import { FormGroupDirective, FormsModule, ReactiveFormsModule, Validators } from
|
|
|
18
18
|
class AbstractNgModelComponent {
|
|
19
19
|
constructor() {
|
|
20
20
|
this.cdRef = inject(ChangeDetectorRef);
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
21
|
+
this.readonly = input(undefined, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
|
|
22
|
+
this.valueFn = input(value => value, ...(ngDevMode ? [{ debugName: "valueFn" }] : []));
|
|
23
|
+
this.valueLimitFn = input(value => false, ...(ngDevMode ? [{ debugName: "valueLimitFn" }] : []));
|
|
23
24
|
}
|
|
25
|
+
// Note: value needs getter/setter for ControlValueAccessor and two-way binding
|
|
24
26
|
set value(value) {
|
|
25
|
-
value = this.valueFn(value, this._value);
|
|
26
|
-
if (this.valueLimitFn(value, this._value) !== false || this.readonly)
|
|
27
|
+
value = this.valueFn()(value, this._value);
|
|
28
|
+
if (this.valueLimitFn()(value, this._value) !== false || this.readonly())
|
|
27
29
|
return;
|
|
28
30
|
this._value = value;
|
|
29
31
|
this.notifyValueChange();
|
|
@@ -40,7 +42,7 @@ class AbstractNgModelComponent {
|
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
writeValue(value) {
|
|
43
|
-
this._value = this.valueLimitFn(value, this._value) || value;
|
|
45
|
+
this._value = this.valueLimitFn()(value, this._value) || value;
|
|
44
46
|
this.cdRef.markForCheck();
|
|
45
47
|
}
|
|
46
48
|
registerOnChange(fn) {
|
|
@@ -53,24 +55,14 @@ class AbstractNgModelComponent {
|
|
|
53
55
|
this.disabled = isDisabled;
|
|
54
56
|
}
|
|
55
57
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: AbstractNgModelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
56
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
58
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.9", type: AbstractNgModelComponent, isStandalone: true, selector: "ng-component", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, valueFn: { classPropertyName: "valueFn", publicName: "valueFn", isSignal: true, isRequired: false, transformFunction: null }, valueLimitFn: { classPropertyName: "valueLimitFn", publicName: "valueLimitFn", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: '', isInline: true }); }
|
|
57
59
|
}
|
|
58
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: AbstractNgModelComponent, decorators: [{
|
|
59
61
|
type: Component,
|
|
60
62
|
args: [{
|
|
61
63
|
template: '',
|
|
62
64
|
}]
|
|
63
|
-
}], propDecorators: {
|
|
64
|
-
type: Input
|
|
65
|
-
}], readonly: [{
|
|
66
|
-
type: Input
|
|
67
|
-
}], valueFn: [{
|
|
68
|
-
type: Input
|
|
69
|
-
}], valueLimitFn: [{
|
|
70
|
-
type: Input
|
|
71
|
-
}], value: [{
|
|
72
|
-
type: Input
|
|
73
|
-
}] } });
|
|
65
|
+
}], propDecorators: { readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], valueFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFn", required: false }] }], valueLimitFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueLimitFn", required: false }] }] } });
|
|
74
66
|
|
|
75
67
|
/**
|
|
76
68
|
* @deprecated Use `authGuard` *function* instead.
|
|
@@ -1744,6 +1736,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
1744
1736
|
type: Injectable
|
|
1745
1737
|
}], ctorParameters: () => [] });
|
|
1746
1738
|
|
|
1739
|
+
/**
|
|
1740
|
+
* Service for managing UI localizations in ABP Angular applications.
|
|
1741
|
+
* Automatically loads localization files based on selected language
|
|
1742
|
+
* Merges with backend localizations (UI > Backend priority)
|
|
1743
|
+
*/
|
|
1744
|
+
class UILocalizationService {
|
|
1745
|
+
constructor() {
|
|
1746
|
+
this.http = inject(HttpClient);
|
|
1747
|
+
this.localizationService = inject(LocalizationService);
|
|
1748
|
+
this.sessionState = inject(SessionStateService);
|
|
1749
|
+
this.options = inject(CORE_OPTIONS);
|
|
1750
|
+
this.loadedLocalizations$ = new BehaviorSubject({});
|
|
1751
|
+
this.currentLanguage$ = this.sessionState.getLanguage$();
|
|
1752
|
+
const uiLocalization = this.options.uiLocalization;
|
|
1753
|
+
if (uiLocalization?.enabled) {
|
|
1754
|
+
this.subscribeToLanguageChanges();
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
subscribeToLanguageChanges() {
|
|
1758
|
+
this.currentLanguage$
|
|
1759
|
+
.pipe(distinctUntilChanged$1(), switchMap$1(culture => this.loadLocalizationFile(culture)))
|
|
1760
|
+
.subscribe();
|
|
1761
|
+
}
|
|
1762
|
+
loadLocalizationFile(culture) {
|
|
1763
|
+
const config = this.options.uiLocalization;
|
|
1764
|
+
if (!config?.enabled)
|
|
1765
|
+
return of(null);
|
|
1766
|
+
const basePath = config.basePath || '/assets/localization';
|
|
1767
|
+
const url = `${basePath}/${culture}.json`;
|
|
1768
|
+
return this.http.get(url).pipe(catchError(() => {
|
|
1769
|
+
// If file not found or error occurs, return null
|
|
1770
|
+
return of(null);
|
|
1771
|
+
}), tap(data => {
|
|
1772
|
+
if (data) {
|
|
1773
|
+
this.processLocalizationData(culture, data);
|
|
1774
|
+
}
|
|
1775
|
+
}));
|
|
1776
|
+
}
|
|
1777
|
+
processLocalizationData(culture, data) {
|
|
1778
|
+
const abpFormat = [
|
|
1779
|
+
{
|
|
1780
|
+
culture,
|
|
1781
|
+
resources: Object.entries(data).map(([resourceName, texts]) => ({
|
|
1782
|
+
resourceName,
|
|
1783
|
+
texts,
|
|
1784
|
+
})),
|
|
1785
|
+
},
|
|
1786
|
+
];
|
|
1787
|
+
this.localizationService.addLocalization(abpFormat);
|
|
1788
|
+
const current = this.loadedLocalizations$.value;
|
|
1789
|
+
current[culture] = data;
|
|
1790
|
+
this.loadedLocalizations$.next(current);
|
|
1791
|
+
}
|
|
1792
|
+
addAngularLocalizeLocalization(culture, resourceName, translations) {
|
|
1793
|
+
const abpFormat = [
|
|
1794
|
+
{
|
|
1795
|
+
culture,
|
|
1796
|
+
resources: [
|
|
1797
|
+
{
|
|
1798
|
+
resourceName,
|
|
1799
|
+
texts: translations,
|
|
1800
|
+
},
|
|
1801
|
+
],
|
|
1802
|
+
},
|
|
1803
|
+
];
|
|
1804
|
+
this.localizationService.addLocalization(abpFormat);
|
|
1805
|
+
const current = this.loadedLocalizations$.value;
|
|
1806
|
+
if (!current[culture]) {
|
|
1807
|
+
current[culture] = {};
|
|
1808
|
+
}
|
|
1809
|
+
if (!current[culture][resourceName]) {
|
|
1810
|
+
current[culture][resourceName] = {};
|
|
1811
|
+
}
|
|
1812
|
+
current[culture][resourceName] = {
|
|
1813
|
+
...current[culture][resourceName],
|
|
1814
|
+
...translations,
|
|
1815
|
+
};
|
|
1816
|
+
this.loadedLocalizations$.next(current);
|
|
1817
|
+
}
|
|
1818
|
+
getLoadedLocalizations(culture) {
|
|
1819
|
+
const lang = culture || this.sessionState.getLanguage();
|
|
1820
|
+
return this.loadedLocalizations$.value[lang] || {};
|
|
1821
|
+
}
|
|
1822
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: UILocalizationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1823
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: UILocalizationService, providedIn: 'root' }); }
|
|
1824
|
+
}
|
|
1825
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: UILocalizationService, decorators: [{
|
|
1826
|
+
type: Injectable,
|
|
1827
|
+
args: [{ providedIn: 'root' }]
|
|
1828
|
+
}], ctorParameters: () => [] });
|
|
1829
|
+
|
|
1747
1830
|
class PermissionService {
|
|
1748
1831
|
constructor() {
|
|
1749
1832
|
this.configState = inject(ConfigStateService);
|
|
@@ -2918,6 +3001,7 @@ class ConfigStateService {
|
|
|
2918
3001
|
constructor() {
|
|
2919
3002
|
this.abpConfigService = inject(AbpApplicationConfigurationService);
|
|
2920
3003
|
this.abpApplicationLocalizationService = inject(AbpApplicationLocalizationService);
|
|
3004
|
+
this.environmentService = inject(EnvironmentService);
|
|
2921
3005
|
this.includeLocalizationResources = inject(INCUDE_LOCALIZATION_RESOURCES_TOKEN, { optional: true });
|
|
2922
3006
|
this.updateSubject = new Subject();
|
|
2923
3007
|
this.store = new InternalStore({});
|
|
@@ -2936,7 +3020,17 @@ class ConfigStateService {
|
|
|
2936
3020
|
throw new Error('culture name should defined');
|
|
2937
3021
|
}
|
|
2938
3022
|
const cultureName = this.uiCultureFromAuthCodeFlow ?? appState.localization.currentCulture.cultureName;
|
|
2939
|
-
return this.getlocalizationResource(cultureName).pipe(map(result =>
|
|
3023
|
+
return this.getlocalizationResource(cultureName).pipe(map(result => {
|
|
3024
|
+
const envLocalization = this.environmentService.getEnvironment()?.localization;
|
|
3025
|
+
return {
|
|
3026
|
+
...appState,
|
|
3027
|
+
localization: {
|
|
3028
|
+
...appState.localization,
|
|
3029
|
+
...result,
|
|
3030
|
+
defaultResourceName: appState.localization?.defaultResourceName ?? envLocalization?.defaultResourceName,
|
|
3031
|
+
},
|
|
3032
|
+
};
|
|
3033
|
+
}), tap(() => (this.uiCultureFromAuthCodeFlow = undefined)));
|
|
2940
3034
|
}
|
|
2941
3035
|
getlocalizationResource(cultureName) {
|
|
2942
3036
|
return this.abpApplicationLocalizationService.get({
|
|
@@ -2953,7 +3047,17 @@ class ConfigStateService {
|
|
|
2953
3047
|
return this.refreshAppState().pipe(map(() => null));
|
|
2954
3048
|
}
|
|
2955
3049
|
return this.getlocalizationResource(lang)
|
|
2956
|
-
.pipe(tap(result =>
|
|
3050
|
+
.pipe(tap(result => {
|
|
3051
|
+
const envLocalization = this.environmentService.getEnvironment()?.localization;
|
|
3052
|
+
this.store.patch({
|
|
3053
|
+
localization: {
|
|
3054
|
+
...this.store.state.localization,
|
|
3055
|
+
...result,
|
|
3056
|
+
defaultResourceName: this.store.state.localization?.defaultResourceName ??
|
|
3057
|
+
envLocalization?.defaultResourceName,
|
|
3058
|
+
},
|
|
3059
|
+
});
|
|
3060
|
+
}))
|
|
2957
3061
|
.pipe(map(() => null));
|
|
2958
3062
|
}
|
|
2959
3063
|
getOne$(key) {
|
|
@@ -3114,6 +3218,8 @@ class LocalizationService {
|
|
|
3114
3218
|
}
|
|
3115
3219
|
initLocalizationValues() {
|
|
3116
3220
|
localizations$.subscribe(val => this.addLocalization(val));
|
|
3221
|
+
// Backend-based localization loading (always enabled)
|
|
3222
|
+
// UI localizations are merged via addLocalization() (UI > Backend priority)
|
|
3117
3223
|
const legacyResources$ = this.configState.getDeep$('localization.values');
|
|
3118
3224
|
const remoteLocalizations$ = this.configState.getDeep$('localization.resources');
|
|
3119
3225
|
const currentLanguage$ = this.sessionState.getLanguage$();
|
|
@@ -3132,7 +3238,8 @@ class LocalizationService {
|
|
|
3132
3238
|
const resourceName = entry[0];
|
|
3133
3239
|
const remoteTexts = entry[1];
|
|
3134
3240
|
let resource = local?.get(resourceName) || {};
|
|
3135
|
-
|
|
3241
|
+
// UI > Backend priority: local texts override remote texts
|
|
3242
|
+
resource = { ...remoteTexts, ...resource };
|
|
3136
3243
|
local?.set(resourceName, resource);
|
|
3137
3244
|
});
|
|
3138
3245
|
}
|
|
@@ -3781,45 +3888,37 @@ const DEFAULT_DYNAMIC_LAYOUTS = new Map([
|
|
|
3781
3888
|
class AutofocusDirective {
|
|
3782
3889
|
constructor() {
|
|
3783
3890
|
this.elRef = inject(ElementRef);
|
|
3784
|
-
this.
|
|
3785
|
-
|
|
3786
|
-
set delay(val) {
|
|
3787
|
-
this._delay = Number(val) || 0;
|
|
3788
|
-
}
|
|
3789
|
-
get delay() {
|
|
3790
|
-
return this._delay;
|
|
3891
|
+
this.delay = input(0, { ...(ngDevMode ? { debugName: "delay" } : {}), alias: 'autofocus',
|
|
3892
|
+
transform: (v) => Number(v) || 0 });
|
|
3791
3893
|
}
|
|
3792
3894
|
ngAfterViewInit() {
|
|
3793
|
-
setTimeout(() => this.elRef.nativeElement.focus(), this.delay);
|
|
3895
|
+
setTimeout(() => this.elRef.nativeElement.focus(), this.delay());
|
|
3794
3896
|
}
|
|
3795
3897
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: AutofocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3796
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
3898
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.9", type: AutofocusDirective, isStandalone: true, selector: "[autofocus]", inputs: { delay: { classPropertyName: "delay", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
3797
3899
|
}
|
|
3798
3900
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: AutofocusDirective, decorators: [{
|
|
3799
3901
|
type: Directive,
|
|
3800
3902
|
args: [{
|
|
3801
3903
|
selector: '[autofocus]',
|
|
3802
3904
|
}]
|
|
3803
|
-
}], propDecorators: { delay: [{
|
|
3804
|
-
type: Input,
|
|
3805
|
-
args: ['autofocus']
|
|
3806
|
-
}] } });
|
|
3905
|
+
}], propDecorators: { delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }] } });
|
|
3807
3906
|
|
|
3808
3907
|
class InputEventDebounceDirective {
|
|
3809
3908
|
constructor() {
|
|
3810
3909
|
this.el = inject(ElementRef);
|
|
3811
3910
|
this.subscription = inject(SubscriptionService);
|
|
3812
|
-
this.debounce = 300;
|
|
3813
|
-
this.debounceEvent =
|
|
3911
|
+
this.debounce = input(300, ...(ngDevMode ? [{ debugName: "debounce" }] : []));
|
|
3912
|
+
this.debounceEvent = output({ alias: 'input.debounce' });
|
|
3814
3913
|
}
|
|
3815
3914
|
ngOnInit() {
|
|
3816
|
-
const input$ = fromEvent(this.el.nativeElement, 'input').pipe(debounceTime(this.debounce));
|
|
3915
|
+
const input$ = fromEvent(this.el.nativeElement, 'input').pipe(debounceTime(this.debounce()));
|
|
3817
3916
|
this.subscription.addOne(input$, (event) => {
|
|
3818
3917
|
this.debounceEvent.emit(event);
|
|
3819
3918
|
});
|
|
3820
3919
|
}
|
|
3821
3920
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: InputEventDebounceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3822
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
3921
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.9", type: InputEventDebounceDirective, isStandalone: true, selector: "[input.debounce]", inputs: { debounce: { classPropertyName: "debounce", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { debounceEvent: "input.debounce" }, providers: [SubscriptionService], ngImport: i0 }); }
|
|
3823
3922
|
}
|
|
3824
3923
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: InputEventDebounceDirective, decorators: [{
|
|
3825
3924
|
type: Directive,
|
|
@@ -3827,12 +3926,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
3827
3926
|
selector: '[input.debounce]',
|
|
3828
3927
|
providers: [SubscriptionService],
|
|
3829
3928
|
}]
|
|
3830
|
-
}], propDecorators: { debounce: [{
|
|
3831
|
-
type: Input
|
|
3832
|
-
}], debounceEvent: [{
|
|
3833
|
-
type: Output,
|
|
3834
|
-
args: ['input.debounce']
|
|
3835
|
-
}] } });
|
|
3929
|
+
}], propDecorators: { debounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounce", required: false }] }], debounceEvent: [{ type: i0.Output, args: ["input.debounce"] }] } });
|
|
3836
3930
|
|
|
3837
3931
|
class AbpForContext {
|
|
3838
3932
|
constructor($implicit, index, count, list) {
|
|
@@ -3853,19 +3947,28 @@ class ForDirective {
|
|
|
3853
3947
|
this.tempRef = inject(TemplateRef);
|
|
3854
3948
|
this.vcRef = inject(ViewContainerRef);
|
|
3855
3949
|
this.differs = inject(IterableDiffers);
|
|
3950
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
3951
|
+
this.items = input.required({ ...(ngDevMode ? { debugName: "items" } : {}), alias: 'abpForOf' });
|
|
3952
|
+
this.orderBy = input(undefined, { ...(ngDevMode ? { debugName: "orderBy" } : {}), alias: 'abpForOrderBy' });
|
|
3953
|
+
this.orderDir = input(undefined, { ...(ngDevMode ? { debugName: "orderDir" } : {}), alias: 'abpForOrderDir' });
|
|
3954
|
+
this.filterBy = input(undefined, { ...(ngDevMode ? { debugName: "filterBy" } : {}), alias: 'abpForFilterBy' });
|
|
3955
|
+
this.filterVal = input(undefined, { ...(ngDevMode ? { debugName: "filterVal" } : {}), alias: 'abpForFilterVal' });
|
|
3956
|
+
this.trackBy = input(undefined, { ...(ngDevMode ? { debugName: "trackBy" } : {}), alias: 'abpForTrackBy' });
|
|
3957
|
+
this.compareBy = input(undefined, { ...(ngDevMode ? { debugName: "compareBy" } : {}), alias: 'abpForCompareBy' });
|
|
3958
|
+
this.emptyRef = input(undefined, { ...(ngDevMode ? { debugName: "emptyRef" } : {}), alias: 'abpForEmptyRef' });
|
|
3856
3959
|
this.lastItemsRef = null;
|
|
3857
3960
|
}
|
|
3858
3961
|
get compareFn() {
|
|
3859
|
-
return this.compareBy || compare;
|
|
3962
|
+
return this.compareBy() || compare;
|
|
3860
3963
|
}
|
|
3861
3964
|
get trackByFn() {
|
|
3862
|
-
return this.trackBy || ((index, item) => item.id || index);
|
|
3965
|
+
return this.trackBy() || ((index, item) => item.id || index);
|
|
3863
3966
|
}
|
|
3864
3967
|
iterateOverAppliedOperations(changes) {
|
|
3865
3968
|
const rw = [];
|
|
3866
3969
|
changes.forEachOperation((record, previousIndex, currentIndex) => {
|
|
3867
3970
|
if (record.previousIndex == null) {
|
|
3868
|
-
const view = this.vcRef.createEmbeddedView(this.tempRef, new AbpForContext(null, -1, -1, this.items), currentIndex || 0);
|
|
3971
|
+
const view = this.vcRef.createEmbeddedView(this.tempRef, new AbpForContext(null, -1, -1, this.items()), currentIndex || 0);
|
|
3869
3972
|
rw.push(new RecordView(record, view));
|
|
3870
3973
|
}
|
|
3871
3974
|
else if (currentIndex == null && previousIndex !== null) {
|
|
@@ -3890,7 +3993,7 @@ class ForDirective {
|
|
|
3890
3993
|
const viewRef = this.vcRef.get(i);
|
|
3891
3994
|
viewRef.context.index = i;
|
|
3892
3995
|
viewRef.context.count = l;
|
|
3893
|
-
viewRef.context.list = this.items;
|
|
3996
|
+
viewRef.context.list = this.items();
|
|
3894
3997
|
}
|
|
3895
3998
|
changes.forEachIdentityChange((record) => {
|
|
3896
3999
|
if (record.currentIndex !== null) {
|
|
@@ -3900,15 +4003,16 @@ class ForDirective {
|
|
|
3900
4003
|
});
|
|
3901
4004
|
}
|
|
3902
4005
|
projectItems(items) {
|
|
3903
|
-
|
|
4006
|
+
const emptyRef = this.emptyRef();
|
|
4007
|
+
if (!items.length && emptyRef) {
|
|
3904
4008
|
this.vcRef.clear();
|
|
3905
|
-
this.vcRef.createEmbeddedView(
|
|
4009
|
+
this.vcRef.createEmbeddedView(emptyRef).rootNodes;
|
|
3906
4010
|
this.isShowEmptyRef = true;
|
|
3907
4011
|
this.differ = null;
|
|
3908
4012
|
this.lastItemsRef = null;
|
|
3909
4013
|
return;
|
|
3910
4014
|
}
|
|
3911
|
-
if (
|
|
4015
|
+
if (emptyRef && this.isShowEmptyRef) {
|
|
3912
4016
|
this.vcRef.clear();
|
|
3913
4017
|
this.isShowEmptyRef = false;
|
|
3914
4018
|
}
|
|
@@ -3924,7 +4028,7 @@ class ForDirective {
|
|
|
3924
4028
|
}
|
|
3925
4029
|
}
|
|
3926
4030
|
sortItems(items) {
|
|
3927
|
-
const orderBy = this.orderBy;
|
|
4031
|
+
const orderBy = this.orderBy();
|
|
3928
4032
|
if (orderBy) {
|
|
3929
4033
|
items.sort((a, b) => (a[orderBy] > b[orderBy] ? 1 : a[orderBy] < b[orderBy] ? -1 : 0));
|
|
3930
4034
|
}
|
|
@@ -3933,25 +4037,19 @@ class ForDirective {
|
|
|
3933
4037
|
}
|
|
3934
4038
|
}
|
|
3935
4039
|
ngOnChanges() {
|
|
3936
|
-
|
|
4040
|
+
const itemsValue = this.items();
|
|
4041
|
+
if (!itemsValue)
|
|
3937
4042
|
return;
|
|
3938
|
-
|
|
3939
|
-
if (this.lastItemsRef !== this.items) {
|
|
3940
|
-
this.vcRef.clear();
|
|
3941
|
-
this.differ = null;
|
|
3942
|
-
this.lastItemsRef = this.items;
|
|
3943
|
-
}
|
|
3944
|
-
let items = clone(this.items);
|
|
4043
|
+
let items = clone(itemsValue);
|
|
3945
4044
|
if (!Array.isArray(items))
|
|
3946
4045
|
return;
|
|
3947
4046
|
const compareFn = this.compareFn;
|
|
3948
|
-
const filterBy = this.filterBy;
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
this.filterVal
|
|
3952
|
-
items = items.filter(item => compareFn(item[filterBy], this.filterVal));
|
|
4047
|
+
const filterBy = this.filterBy();
|
|
4048
|
+
const filterVal = this.filterVal();
|
|
4049
|
+
if (typeof filterBy !== 'undefined' && typeof filterVal !== 'undefined' && filterVal !== '') {
|
|
4050
|
+
items = items.filter(item => compareFn(item[filterBy], this.filterVal()));
|
|
3953
4051
|
}
|
|
3954
|
-
switch (this.orderDir) {
|
|
4052
|
+
switch (this.orderDir()) {
|
|
3955
4053
|
case 'ASC':
|
|
3956
4054
|
this.sortItems(items);
|
|
3957
4055
|
this.projectItems(items);
|
|
@@ -3966,38 +4064,14 @@ class ForDirective {
|
|
|
3966
4064
|
}
|
|
3967
4065
|
}
|
|
3968
4066
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ForDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3969
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
4067
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.9", type: ForDirective, isStandalone: true, selector: "[abpFor]", inputs: { items: { classPropertyName: "items", publicName: "abpForOf", isSignal: true, isRequired: true, transformFunction: null }, orderBy: { classPropertyName: "orderBy", publicName: "abpForOrderBy", isSignal: true, isRequired: false, transformFunction: null }, orderDir: { classPropertyName: "orderDir", publicName: "abpForOrderDir", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "abpForFilterBy", isSignal: true, isRequired: false, transformFunction: null }, filterVal: { classPropertyName: "filterVal", publicName: "abpForFilterVal", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "abpForTrackBy", isSignal: true, isRequired: false, transformFunction: null }, compareBy: { classPropertyName: "compareBy", publicName: "abpForCompareBy", isSignal: true, isRequired: false, transformFunction: null }, emptyRef: { classPropertyName: "emptyRef", publicName: "abpForEmptyRef", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0 }); }
|
|
3970
4068
|
}
|
|
3971
4069
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ForDirective, decorators: [{
|
|
3972
4070
|
type: Directive,
|
|
3973
4071
|
args: [{
|
|
3974
4072
|
selector: '[abpFor]',
|
|
3975
4073
|
}]
|
|
3976
|
-
}], propDecorators: { items: [{
|
|
3977
|
-
type: Input,
|
|
3978
|
-
args: ['abpForOf']
|
|
3979
|
-
}], orderBy: [{
|
|
3980
|
-
type: Input,
|
|
3981
|
-
args: ['abpForOrderBy']
|
|
3982
|
-
}], orderDir: [{
|
|
3983
|
-
type: Input,
|
|
3984
|
-
args: ['abpForOrderDir']
|
|
3985
|
-
}], filterBy: [{
|
|
3986
|
-
type: Input,
|
|
3987
|
-
args: ['abpForFilterBy']
|
|
3988
|
-
}], filterVal: [{
|
|
3989
|
-
type: Input,
|
|
3990
|
-
args: ['abpForFilterVal']
|
|
3991
|
-
}], trackBy: [{
|
|
3992
|
-
type: Input,
|
|
3993
|
-
args: ['abpForTrackBy']
|
|
3994
|
-
}], compareBy: [{
|
|
3995
|
-
type: Input,
|
|
3996
|
-
args: ['abpForCompareBy']
|
|
3997
|
-
}], emptyRef: [{
|
|
3998
|
-
type: Input,
|
|
3999
|
-
args: ['abpForEmptyRef']
|
|
4000
|
-
}] } });
|
|
4074
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpForOf", required: true }] }], orderBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpForOrderBy", required: false }] }], orderDir: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpForOrderDir", required: false }] }], filterBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpForFilterBy", required: false }] }], filterVal: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpForFilterVal", required: false }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpForTrackBy", required: false }] }], compareBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpForCompareBy", required: false }] }], emptyRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpForEmptyRef", required: false }] }] } });
|
|
4001
4075
|
|
|
4002
4076
|
/**
|
|
4003
4077
|
* @deprecated FormSubmitDirective will be removed in V7.0.0. Use `ngSubmit` instead.
|
|
@@ -4008,19 +4082,21 @@ class FormSubmitDirective {
|
|
|
4008
4082
|
this.host = inject(ElementRef);
|
|
4009
4083
|
this.cdRef = inject(ChangeDetectorRef);
|
|
4010
4084
|
this.subscription = inject(SubscriptionService);
|
|
4011
|
-
this.debounce = 200;
|
|
4012
|
-
|
|
4013
|
-
this.
|
|
4085
|
+
this.debounce = input(200, ...(ngDevMode ? [{ debugName: "debounce" }] : []));
|
|
4086
|
+
// TODO: Remove unused input
|
|
4087
|
+
this.notValidateOnSubmit = input(undefined, ...(ngDevMode ? [{ debugName: "notValidateOnSubmit" }] : []));
|
|
4088
|
+
this.markAsDirtyWhenSubmit = input(true, ...(ngDevMode ? [{ debugName: "markAsDirtyWhenSubmit" }] : []));
|
|
4089
|
+
this.ngSubmit = output();
|
|
4014
4090
|
this.executedNgSubmit = false;
|
|
4015
4091
|
}
|
|
4016
4092
|
ngOnInit() {
|
|
4017
4093
|
this.subscription.addOne(this.formGroupDirective.ngSubmit, () => {
|
|
4018
|
-
if (this.markAsDirtyWhenSubmit) {
|
|
4094
|
+
if (this.markAsDirtyWhenSubmit()) {
|
|
4019
4095
|
this.markAsDirty();
|
|
4020
4096
|
}
|
|
4021
4097
|
this.executedNgSubmit = true;
|
|
4022
4098
|
});
|
|
4023
|
-
const keyup$ = fromEvent(this.host.nativeElement, 'keyup').pipe(debounceTime(this.debounce), filter(event => !(event.target instanceof HTMLTextAreaElement)), filter(event => event && event.key === 'Enter'));
|
|
4099
|
+
const keyup$ = fromEvent(this.host.nativeElement, 'keyup').pipe(debounceTime(this.debounce()), filter(event => !(event.target instanceof HTMLTextAreaElement)), filter(event => event && event.key === 'Enter'));
|
|
4024
4100
|
this.subscription.addOne(keyup$, () => {
|
|
4025
4101
|
if (!this.executedNgSubmit) {
|
|
4026
4102
|
this.host.nativeElement.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }));
|
|
@@ -4035,7 +4111,7 @@ class FormSubmitDirective {
|
|
|
4035
4111
|
this.cdRef.detectChanges();
|
|
4036
4112
|
}
|
|
4037
4113
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: FormSubmitDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4038
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
4114
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.9", type: FormSubmitDirective, isStandalone: true, selector: "form[ngSubmit][formGroup]", inputs: { debounce: { classPropertyName: "debounce", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null }, notValidateOnSubmit: { classPropertyName: "notValidateOnSubmit", publicName: "notValidateOnSubmit", isSignal: true, isRequired: false, transformFunction: null }, markAsDirtyWhenSubmit: { classPropertyName: "markAsDirtyWhenSubmit", publicName: "markAsDirtyWhenSubmit", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ngSubmit: "ngSubmit" }, providers: [SubscriptionService], ngImport: i0 }); }
|
|
4039
4115
|
}
|
|
4040
4116
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: FormSubmitDirective, decorators: [{
|
|
4041
4117
|
type: Directive,
|
|
@@ -4043,15 +4119,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
4043
4119
|
selector: 'form[ngSubmit][formGroup]',
|
|
4044
4120
|
providers: [SubscriptionService],
|
|
4045
4121
|
}]
|
|
4046
|
-
}], propDecorators: { debounce: [{
|
|
4047
|
-
type: Input
|
|
4048
|
-
}], notValidateOnSubmit: [{
|
|
4049
|
-
type: Input
|
|
4050
|
-
}], markAsDirtyWhenSubmit: [{
|
|
4051
|
-
type: Input
|
|
4052
|
-
}], ngSubmit: [{
|
|
4053
|
-
type: Output
|
|
4054
|
-
}] } });
|
|
4122
|
+
}], propDecorators: { debounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounce", required: false }] }], notValidateOnSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "notValidateOnSubmit", required: false }] }], markAsDirtyWhenSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "markAsDirtyWhenSubmit", required: false }] }], ngSubmit: [{ type: i0.Output, args: ["ngSubmit"] }] } });
|
|
4055
4123
|
function setDirty(controls) {
|
|
4056
4124
|
if (Array.isArray(controls)) {
|
|
4057
4125
|
controls.forEach(group => {
|
|
@@ -4068,7 +4136,7 @@ function setDirty(controls) {
|
|
|
4068
4136
|
class InitDirective {
|
|
4069
4137
|
constructor() {
|
|
4070
4138
|
this.elRef = inject(ElementRef);
|
|
4071
|
-
this.init =
|
|
4139
|
+
this.init = output({ alias: 'abpInit' });
|
|
4072
4140
|
}
|
|
4073
4141
|
ngAfterViewInit() {
|
|
4074
4142
|
this.init.emit(this.elRef);
|
|
@@ -4081,10 +4149,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
4081
4149
|
args: [{
|
|
4082
4150
|
selector: '[abpInit]',
|
|
4083
4151
|
}]
|
|
4084
|
-
}], propDecorators: { init: [{
|
|
4085
|
-
type: Output,
|
|
4086
|
-
args: ['abpInit']
|
|
4087
|
-
}] } });
|
|
4152
|
+
}], propDecorators: { init: [{ type: i0.Output, args: ["abpInit"] }] } });
|
|
4088
4153
|
|
|
4089
4154
|
class PermissionDirective {
|
|
4090
4155
|
constructor() {
|
|
@@ -4093,7 +4158,8 @@ class PermissionDirective {
|
|
|
4093
4158
|
this.permissionService = inject(PermissionService);
|
|
4094
4159
|
this.cdRef = inject(ChangeDetectorRef);
|
|
4095
4160
|
this.queue = inject(QUEUE_MANAGER);
|
|
4096
|
-
this.
|
|
4161
|
+
this.condition = input(undefined, { ...(ngDevMode ? { debugName: "condition" } : {}), alias: "abpPermission" });
|
|
4162
|
+
this.runChangeDetection = input(true, { ...(ngDevMode ? { debugName: "runChangeDetection" } : {}), alias: "abpPermissionRunChangeDetection" });
|
|
4097
4163
|
this.cdrSubject = new ReplaySubject();
|
|
4098
4164
|
this.rendered = false;
|
|
4099
4165
|
}
|
|
@@ -4102,14 +4168,14 @@ class PermissionDirective {
|
|
|
4102
4168
|
this.subscription.unsubscribe();
|
|
4103
4169
|
}
|
|
4104
4170
|
this.subscription = this.permissionService
|
|
4105
|
-
.getGrantedPolicy$(this.condition || '')
|
|
4171
|
+
.getGrantedPolicy$(this.condition() || '')
|
|
4106
4172
|
.pipe(distinctUntilChanged())
|
|
4107
4173
|
.subscribe(isGranted => {
|
|
4108
4174
|
this.vcRef.clear();
|
|
4109
4175
|
if (isGranted && this.templateRef) {
|
|
4110
4176
|
this.vcRef.createEmbeddedView(this.templateRef);
|
|
4111
4177
|
}
|
|
4112
|
-
if (this.runChangeDetection) {
|
|
4178
|
+
if (this.runChangeDetection()) {
|
|
4113
4179
|
if (!this.rendered) {
|
|
4114
4180
|
this.cdrSubject.next();
|
|
4115
4181
|
}
|
|
@@ -4134,20 +4200,14 @@ class PermissionDirective {
|
|
|
4134
4200
|
this.rendered = true;
|
|
4135
4201
|
}
|
|
4136
4202
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: PermissionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4137
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
4203
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.9", type: PermissionDirective, isStandalone: true, selector: "[abpPermission]", inputs: { condition: { classPropertyName: "condition", publicName: "abpPermission", isSignal: true, isRequired: false, transformFunction: null }, runChangeDetection: { classPropertyName: "runChangeDetection", publicName: "abpPermissionRunChangeDetection", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0 }); }
|
|
4138
4204
|
}
|
|
4139
4205
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: PermissionDirective, decorators: [{
|
|
4140
4206
|
type: Directive,
|
|
4141
4207
|
args: [{
|
|
4142
4208
|
selector: '[abpPermission]',
|
|
4143
4209
|
}]
|
|
4144
|
-
}], propDecorators: { condition: [{
|
|
4145
|
-
type: Input,
|
|
4146
|
-
args: ['abpPermission']
|
|
4147
|
-
}], runChangeDetection: [{
|
|
4148
|
-
type: Input,
|
|
4149
|
-
args: ['abpPermissionRunChangeDetection']
|
|
4150
|
-
}] } });
|
|
4210
|
+
}], propDecorators: { condition: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpPermission", required: false }] }], runChangeDetection: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpPermissionRunChangeDetection", required: false }] }] } });
|
|
4151
4211
|
|
|
4152
4212
|
class ReplaceableTemplateDirective {
|
|
4153
4213
|
constructor() {
|
|
@@ -4156,6 +4216,7 @@ class ReplaceableTemplateDirective {
|
|
|
4156
4216
|
this.vcRef = inject(ViewContainerRef);
|
|
4157
4217
|
this.replaceableComponents = inject(ReplaceableComponentsService);
|
|
4158
4218
|
this.subscription = inject(SubscriptionService);
|
|
4219
|
+
this.data = input.required({ ...(ngDevMode ? { debugName: "data" } : {}), alias: "abpReplaceableTemplate" });
|
|
4159
4220
|
this.providedData = {
|
|
4160
4221
|
inputs: {},
|
|
4161
4222
|
outputs: {},
|
|
@@ -4170,10 +4231,16 @@ class ReplaceableTemplateDirective {
|
|
|
4170
4231
|
this.setDefaultComponentInputs();
|
|
4171
4232
|
},
|
|
4172
4233
|
};
|
|
4234
|
+
effect(() => {
|
|
4235
|
+
const data = this.data();
|
|
4236
|
+
if (data?.inputs && this.defaultComponentRef) {
|
|
4237
|
+
this.setDefaultComponentInputs();
|
|
4238
|
+
}
|
|
4239
|
+
});
|
|
4173
4240
|
}
|
|
4174
4241
|
ngOnInit() {
|
|
4175
4242
|
const component$ = this.replaceableComponents
|
|
4176
|
-
.get$(this.data.componentKey)
|
|
4243
|
+
.get$(this.data().componentKey)
|
|
4177
4244
|
.pipe(filter((res = {}) => !this.initialized || !compare(res.component, this.externalComponent)));
|
|
4178
4245
|
this.subscription.addOne(component$, (res = {}) => {
|
|
4179
4246
|
this.vcRef.clear();
|
|
@@ -4204,23 +4271,24 @@ class ReplaceableTemplateDirective {
|
|
|
4204
4271
|
}
|
|
4205
4272
|
}
|
|
4206
4273
|
setDefaultComponentInputs() {
|
|
4207
|
-
|
|
4274
|
+
const data = this.data();
|
|
4275
|
+
if (!this.defaultComponentRef || (!data.inputs && !data.outputs))
|
|
4208
4276
|
return;
|
|
4209
|
-
if (
|
|
4210
|
-
for (const key in
|
|
4211
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
4212
|
-
if (!compare(this.defaultComponentRef[key],
|
|
4213
|
-
this.defaultComponentRef[key] =
|
|
4277
|
+
if (data.inputs) {
|
|
4278
|
+
for (const key in data.inputs) {
|
|
4279
|
+
if (Object.prototype.hasOwnProperty.call(data.inputs, key)) {
|
|
4280
|
+
if (!compare(this.defaultComponentRef[key], data.inputs[key].value)) {
|
|
4281
|
+
this.defaultComponentRef[key] = data.inputs[key].value;
|
|
4214
4282
|
}
|
|
4215
4283
|
}
|
|
4216
4284
|
}
|
|
4217
4285
|
}
|
|
4218
|
-
if (
|
|
4219
|
-
for (const key in
|
|
4220
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
4286
|
+
if (data.outputs) {
|
|
4287
|
+
for (const key in data.outputs) {
|
|
4288
|
+
if (Object.prototype.hasOwnProperty.call(data.outputs, key)) {
|
|
4221
4289
|
if (!this.defaultComponentSubscriptions[key]) {
|
|
4222
4290
|
this.defaultComponentSubscriptions[key] = this.defaultComponentRef[key].subscribe((value) => {
|
|
4223
|
-
this.data.outputs?.[key](value);
|
|
4291
|
+
this.data().outputs?.[key](value);
|
|
4224
4292
|
});
|
|
4225
4293
|
}
|
|
4226
4294
|
}
|
|
@@ -4228,23 +4296,25 @@ class ReplaceableTemplateDirective {
|
|
|
4228
4296
|
}
|
|
4229
4297
|
}
|
|
4230
4298
|
setProvidedData() {
|
|
4231
|
-
this.providedData = { outputs: {}, ...this.data, inputs: {} };
|
|
4232
|
-
|
|
4299
|
+
this.providedData = { outputs: {}, ...this.data(), inputs: {} };
|
|
4300
|
+
const data = this.data();
|
|
4301
|
+
if (!data.inputs)
|
|
4233
4302
|
return;
|
|
4234
4303
|
Object.defineProperties(this.providedData.inputs, {
|
|
4235
|
-
...Object.keys(
|
|
4304
|
+
...Object.keys(data.inputs).reduce((acc, key) => ({
|
|
4236
4305
|
...acc,
|
|
4237
4306
|
[key]: {
|
|
4238
4307
|
enumerable: true,
|
|
4239
4308
|
configurable: true,
|
|
4240
|
-
get: () => this.data.inputs?.[key]?.value,
|
|
4241
|
-
...(this.data.inputs?.[key]?.twoWay && {
|
|
4309
|
+
get: () => this.data().inputs?.[key]?.value,
|
|
4310
|
+
...(this.data().inputs?.[key]?.twoWay && {
|
|
4242
4311
|
set: (newValue) => {
|
|
4243
|
-
|
|
4244
|
-
|
|
4312
|
+
const dataValue = this.data();
|
|
4313
|
+
if (dataValue.inputs?.[key]) {
|
|
4314
|
+
dataValue.inputs[key].value = newValue;
|
|
4245
4315
|
}
|
|
4246
|
-
if (
|
|
4247
|
-
|
|
4316
|
+
if (dataValue.outputs?.[`${key}Change`]) {
|
|
4317
|
+
dataValue.outputs[`${key}Change`](newValue);
|
|
4248
4318
|
}
|
|
4249
4319
|
},
|
|
4250
4320
|
}),
|
|
@@ -4260,7 +4330,7 @@ class ReplaceableTemplateDirective {
|
|
|
4260
4330
|
this.defaultComponentRef = null;
|
|
4261
4331
|
}
|
|
4262
4332
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ReplaceableTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4263
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
4333
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.9", type: ReplaceableTemplateDirective, isStandalone: true, selector: "[abpReplaceableTemplate]", inputs: { data: { classPropertyName: "data", publicName: "abpReplaceableTemplate", isSignal: true, isRequired: true, transformFunction: null } }, providers: [SubscriptionService], usesOnChanges: true, ngImport: i0 }); }
|
|
4264
4334
|
}
|
|
4265
4335
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ReplaceableTemplateDirective, decorators: [{
|
|
4266
4336
|
type: Directive,
|
|
@@ -4268,16 +4338,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
4268
4338
|
selector: '[abpReplaceableTemplate]',
|
|
4269
4339
|
providers: [SubscriptionService],
|
|
4270
4340
|
}]
|
|
4271
|
-
}], ctorParameters: () => [], propDecorators: { data: [{
|
|
4272
|
-
type: Input,
|
|
4273
|
-
args: ['abpReplaceableTemplate']
|
|
4274
|
-
}] } });
|
|
4341
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpReplaceableTemplate", required: true }] }] } });
|
|
4275
4342
|
|
|
4276
4343
|
class StopPropagationDirective {
|
|
4277
4344
|
constructor() {
|
|
4278
4345
|
this.el = inject(ElementRef);
|
|
4279
4346
|
this.subscription = inject(SubscriptionService);
|
|
4280
|
-
this.stopPropEvent =
|
|
4347
|
+
this.stopPropEvent = output({ alias: 'click.stop' });
|
|
4281
4348
|
}
|
|
4282
4349
|
ngOnInit() {
|
|
4283
4350
|
this.subscription.addOne(fromEvent(this.el.nativeElement, 'click'), event => {
|
|
@@ -4294,36 +4361,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
4294
4361
|
selector: '[click.stop]',
|
|
4295
4362
|
providers: [SubscriptionService],
|
|
4296
4363
|
}]
|
|
4297
|
-
}], propDecorators: { stopPropEvent: [{
|
|
4298
|
-
type: Output,
|
|
4299
|
-
args: ['click.stop']
|
|
4300
|
-
}] } });
|
|
4364
|
+
}], propDecorators: { stopPropEvent: [{ type: i0.Output, args: ["click.stop"] }] } });
|
|
4301
4365
|
|
|
4302
4366
|
class ShowPasswordDirective {
|
|
4303
4367
|
constructor() {
|
|
4304
4368
|
this.elementRef = inject(ElementRef);
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4369
|
+
this.abpShowPassword = input(false, ...(ngDevMode ? [{ debugName: "abpShowPassword" }] : []));
|
|
4370
|
+
effect(() => {
|
|
4371
|
+
const visible = this.abpShowPassword();
|
|
4372
|
+
const element = this.elementRef.nativeElement;
|
|
4373
|
+
if (!element)
|
|
4374
|
+
return;
|
|
4375
|
+
element.type = visible ? 'text' : 'password';
|
|
4376
|
+
});
|
|
4311
4377
|
}
|
|
4312
4378
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ShowPasswordDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4313
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
4379
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.9", type: ShowPasswordDirective, isStandalone: true, selector: "[abpShowPassword]", inputs: { abpShowPassword: { classPropertyName: "abpShowPassword", publicName: "abpShowPassword", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
4314
4380
|
}
|
|
4315
4381
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ShowPasswordDirective, decorators: [{
|
|
4316
4382
|
type: Directive,
|
|
4317
4383
|
args: [{
|
|
4318
4384
|
selector: '[abpShowPassword]',
|
|
4319
4385
|
}]
|
|
4320
|
-
}], propDecorators: { abpShowPassword: [{
|
|
4321
|
-
type: Input
|
|
4322
|
-
}] } });
|
|
4386
|
+
}], ctorParameters: () => [], propDecorators: { abpShowPassword: [{ type: i0.Input, args: [{ isSignal: true, alias: "abpShowPassword", required: false }] }] } });
|
|
4323
4387
|
|
|
4324
4388
|
class TrackCapsLockDirective {
|
|
4325
4389
|
constructor() {
|
|
4326
|
-
this.capsLock =
|
|
4390
|
+
this.capsLock = output({ alias: 'abpCapsLock' });
|
|
4327
4391
|
}
|
|
4328
4392
|
onKeyDown(event) {
|
|
4329
4393
|
this.capsLock.emit(this.isCapsLockOpen(event));
|
|
@@ -4348,10 +4412,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
4348
4412
|
args: [{
|
|
4349
4413
|
selector: '[abpCapsLock]',
|
|
4350
4414
|
}]
|
|
4351
|
-
}], propDecorators: { capsLock: [{
|
|
4352
|
-
type: Output,
|
|
4353
|
-
args: ['abpCapsLock']
|
|
4354
|
-
}], onKeyDown: [{
|
|
4415
|
+
}], propDecorators: { capsLock: [{ type: i0.Output, args: ["abpCapsLock"] }], onKeyDown: [{
|
|
4355
4416
|
type: HostListener,
|
|
4356
4417
|
args: ['window:keydown', ['$event']]
|
|
4357
4418
|
}], onKeyUp: [{
|
|
@@ -4575,6 +4636,11 @@ function provideAbpCore(...features) {
|
|
|
4575
4636
|
inject(LocalizationService);
|
|
4576
4637
|
inject(LocalStorageListenerService);
|
|
4577
4638
|
inject(RoutesHandler);
|
|
4639
|
+
// Initialize UILocalizationService if UI-only mode is enabled
|
|
4640
|
+
const options = inject(CORE_OPTIONS);
|
|
4641
|
+
if (options?.uiLocalization?.enabled) {
|
|
4642
|
+
inject(UILocalizationService);
|
|
4643
|
+
}
|
|
4578
4644
|
await getInitialData();
|
|
4579
4645
|
}),
|
|
4580
4646
|
LocaleProvider,
|
|
@@ -5519,5 +5585,5 @@ const AbpValidators = {
|
|
|
5519
5585
|
* Generated bundle index. Do not edit.
|
|
5520
5586
|
*/
|
|
5521
5587
|
|
|
5522
|
-
export { APP_INIT_ERROR_HANDLERS, APP_STARTED_WITH_SSR, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpApplicationLocalizationService, AbpCookieStorageService, AbpLocalStorageService, AbpTenantService, AbpTitleStrategy, AbpValidators, AbpWindowService, AbstractAuthErrorFilter, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, AsyncLocalizationPipe, AuditedEntityDto, AuditedEntityWithUserDto, AuthErrorEvent, AuthErrorFilterService, AuthEvent, AuthGuard, AuthInfoEvent, AuthService, AuthSuccessEvent, AutofocusDirective, BaseCoreModule, BaseTreeNode, CHECK_AUTHENTICATION_STATE_FN_KEY, CONTAINER_STRATEGY, CONTENT_SECURITY_STRATEGY, CONTENT_STRATEGY, CONTEXT_STRATEGY, COOKIE_LANGUAGE_KEY, CORE_OPTIONS, CROSS_ORIGIN_STRATEGY, ClearContainerStrategy, ComponentContextStrategy, ComponentProjectionStrategy, ConfigStateService, ContainerStrategy, ContentProjectionService, ContentSecurityStrategy, ContentStrategy, ContextStrategy, CookieLanguageProvider, CoreFeatureKind, CoreModule, CreationAuditedEntityDto, CreationAuditedEntityWithUserDto, CrossOriginStrategy, DEFAULT_DYNAMIC_LAYOUTS, DISABLE_PROJECT_NAME, DOM_STRATEGY, DYNAMIC_LAYOUTS_TOKEN, DefaultQueueManager, DomInsertionService, DomStrategy, DomStrategyService, DynamicLayoutComponent, EntityDto, EnvironmentService, ExtensibleAuditedEntityDto, ExtensibleAuditedEntityWithUserDto, ExtensibleCreationAuditedEntityDto, ExtensibleCreationAuditedEntityWithUserDto, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleFullAuditedEntityWithUserDto, ExtensibleLimitedResultRequestDto, ExtensibleObject, ExtensiblePagedAndSortedResultRequestDto, ExtensiblePagedResultRequestDto, ExternalHttpClient, ForDirective, FormSubmitDirective, FullAuditedEntityDto, FullAuditedEntityWithUserDto, HtmlEncodePipe, HtmlEncodingService, HttpErrorReporterService, HttpWaitService, INCUDE_LOCALIZATION_RESOURCES_TOKEN, INJECTOR_PIPE_DATA_TOKEN, IS_EXTERNAL_REQUEST, IncludeLocalizationResourcesProvider, InitDirective, InputEventDebounceDirective, InsertIntoContainerStrategy, InternalStore, InternetConnectionService, LIST_QUERY_DEBOUNCE_TIME, LOADER_DELAY, LOADING_STRATEGY, LOCALIZATIONS, LazyLoadService, LazyLocalizationPipe, LazyModuleFactory, LimitedResultRequestDto, ListResultDto, ListService, LoadingStrategy, LocalStorageListenerService, LocaleId, LocaleProvider, LocalizationModule, LocalizationPipe, LocalizationService, LooseContentSecurityStrategy, MultiTenancyService, NAVIGATE_TO_MANAGE_PROFILE, NavigationEvent, NoContentSecurityStrategy, NoContextStrategy, NoCrossOriginStrategy, OTHERS_GROUP, index as ObjectExtending, PIPE_TO_LOGIN_FN_KEY, PROJECTION_STRATEGY, PagedAndSortedResultRequestDto, PagedResultDto, PagedResultRequestDto, PermissionDirective, PermissionGuard, PermissionService, ProjectionStrategy, QUEUE_MANAGER, ReplaceableComponentsService, ReplaceableRouteContainerComponent, ReplaceableTemplateDirective, ResourceWaitService, RestService, RootComponentProjectionStrategy, RootCoreModule, RouterEvents, RouterOutletComponent, RouterWaitService, RoutesService, SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY, SORT_COMPARE_FUNC, SSR_FLAG, SafeHtmlPipe, ScriptContentStrategy, ScriptLoadingStrategy, ServerCookieParser, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, ShowPasswordDirective, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TENANT_NOT_FOUND_BY_NAME, TemplateContextStrategy, TemplateProjectionStrategy, TimeService, TimezoneService, ToInjectorPipe, TrackByService, TrackCapsLockDirective, UtcToLocalPipe, WebHttpUrlEncodingCodec, asyncAuthGuard, authGuard, checkHasProp, compareFuncFactory, coreOptionsFactory, createGroupMap, createLocalizationPipeKeyGenerator, createLocalizer, createLocalizerWithFallback, createMapFromList, createTokenParser, createTreeFromList, createTreeNodeFilterCreator, deepMerge, differentLocales, downloadBlob, escapeHtmlChars, exists, featuresFactory, findRoute, fromLazyLoad, generateHash, generatePassword, getCurrentTenancyNameFromUrl, getInitialData, getLocaleDirection, getPathName, getRemoteEnv, getRoutePath, getShortDateFormat, getShortDateShortTimeFormat, getShortTimeFormat, interpolate, isArray, isNode, isNullOrEmpty, isNullOrUndefined, isNumber, isObject, isObjectAndNotArray, isObjectAndNotArrayNotNode, isUndefinedOrEmptyString, localeInitializer, localizationContributor, localizations$, mapEnumToOptions, noop, parseTenantFromUrl, permissionGuard, provideAbpCore, provideAbpCoreChild, pushValueTo, reloadRoute, setLanguageToCookie, timezoneInterceptor, trackBy, trackByDeep, transferStateInterceptor, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUniqueCharacter, validateUrl, withCompareFuncFactory, withOptions, withTitleStrategy };
|
|
5588
|
+
export { APP_INIT_ERROR_HANDLERS, APP_STARTED_WITH_SSR, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpApplicationLocalizationService, AbpCookieStorageService, AbpLocalStorageService, AbpTenantService, AbpTitleStrategy, AbpValidators, AbpWindowService, AbstractAuthErrorFilter, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, AsyncLocalizationPipe, AuditedEntityDto, AuditedEntityWithUserDto, AuthErrorEvent, AuthErrorFilterService, AuthEvent, AuthGuard, AuthInfoEvent, AuthService, AuthSuccessEvent, AutofocusDirective, BaseCoreModule, BaseTreeNode, CHECK_AUTHENTICATION_STATE_FN_KEY, CONTAINER_STRATEGY, CONTENT_SECURITY_STRATEGY, CONTENT_STRATEGY, CONTEXT_STRATEGY, COOKIE_LANGUAGE_KEY, CORE_OPTIONS, CROSS_ORIGIN_STRATEGY, ClearContainerStrategy, ComponentContextStrategy, ComponentProjectionStrategy, ConfigStateService, ContainerStrategy, ContentProjectionService, ContentSecurityStrategy, ContentStrategy, ContextStrategy, CookieLanguageProvider, CoreFeatureKind, CoreModule, CreationAuditedEntityDto, CreationAuditedEntityWithUserDto, CrossOriginStrategy, DEFAULT_DYNAMIC_LAYOUTS, DISABLE_PROJECT_NAME, DOM_STRATEGY, DYNAMIC_LAYOUTS_TOKEN, DefaultQueueManager, DomInsertionService, DomStrategy, DomStrategyService, DynamicLayoutComponent, EntityDto, EnvironmentService, ExtensibleAuditedEntityDto, ExtensibleAuditedEntityWithUserDto, ExtensibleCreationAuditedEntityDto, ExtensibleCreationAuditedEntityWithUserDto, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleFullAuditedEntityWithUserDto, ExtensibleLimitedResultRequestDto, ExtensibleObject, ExtensiblePagedAndSortedResultRequestDto, ExtensiblePagedResultRequestDto, ExternalHttpClient, ForDirective, FormSubmitDirective, FullAuditedEntityDto, FullAuditedEntityWithUserDto, HtmlEncodePipe, HtmlEncodingService, HttpErrorReporterService, HttpWaitService, INCUDE_LOCALIZATION_RESOURCES_TOKEN, INJECTOR_PIPE_DATA_TOKEN, IS_EXTERNAL_REQUEST, IncludeLocalizationResourcesProvider, InitDirective, InputEventDebounceDirective, InsertIntoContainerStrategy, InternalStore, InternetConnectionService, LIST_QUERY_DEBOUNCE_TIME, LOADER_DELAY, LOADING_STRATEGY, LOCALIZATIONS, LazyLoadService, LazyLocalizationPipe, LazyModuleFactory, LimitedResultRequestDto, ListResultDto, ListService, LoadingStrategy, LocalStorageListenerService, LocaleId, LocaleProvider, LocalizationModule, LocalizationPipe, LocalizationService, LooseContentSecurityStrategy, MultiTenancyService, NAVIGATE_TO_MANAGE_PROFILE, NavigationEvent, NoContentSecurityStrategy, NoContextStrategy, NoCrossOriginStrategy, OTHERS_GROUP, index as ObjectExtending, PIPE_TO_LOGIN_FN_KEY, PROJECTION_STRATEGY, PagedAndSortedResultRequestDto, PagedResultDto, PagedResultRequestDto, PermissionDirective, PermissionGuard, PermissionService, ProjectionStrategy, QUEUE_MANAGER, ReplaceableComponentsService, ReplaceableRouteContainerComponent, ReplaceableTemplateDirective, ResourceWaitService, RestService, RootComponentProjectionStrategy, RootCoreModule, RouterEvents, RouterOutletComponent, RouterWaitService, RoutesService, SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY, SORT_COMPARE_FUNC, SSR_FLAG, SafeHtmlPipe, ScriptContentStrategy, ScriptLoadingStrategy, ServerCookieParser, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, ShowPasswordDirective, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TENANT_NOT_FOUND_BY_NAME, TemplateContextStrategy, TemplateProjectionStrategy, TimeService, TimezoneService, ToInjectorPipe, TrackByService, TrackCapsLockDirective, UILocalizationService, UtcToLocalPipe, WebHttpUrlEncodingCodec, asyncAuthGuard, authGuard, checkHasProp, compareFuncFactory, coreOptionsFactory, createGroupMap, createLocalizationPipeKeyGenerator, createLocalizer, createLocalizerWithFallback, createMapFromList, createTokenParser, createTreeFromList, createTreeNodeFilterCreator, deepMerge, differentLocales, downloadBlob, escapeHtmlChars, exists, featuresFactory, findRoute, fromLazyLoad, generateHash, generatePassword, getCurrentTenancyNameFromUrl, getInitialData, getLocaleDirection, getPathName, getRemoteEnv, getRoutePath, getShortDateFormat, getShortDateShortTimeFormat, getShortTimeFormat, interpolate, isArray, isNode, isNullOrEmpty, isNullOrUndefined, isNumber, isObject, isObjectAndNotArray, isObjectAndNotArrayNotNode, isUndefinedOrEmptyString, localeInitializer, localizationContributor, localizations$, mapEnumToOptions, noop, parseTenantFromUrl, permissionGuard, provideAbpCore, provideAbpCoreChild, pushValueTo, reloadRoute, setLanguageToCookie, timezoneInterceptor, trackBy, trackByDeep, transferStateInterceptor, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUniqueCharacter, validateUrl, withCompareFuncFactory, withOptions, withTitleStrategy };
|
|
5523
5589
|
//# sourceMappingURL=abp-ng.core.mjs.map
|