@abp/ng.core 9.2.0-rc.2 → 9.2.0-rc.4

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,17 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, Input, Component, Injectable, InjectionToken, NgModuleFactory, Injector, Compiler, Inject, signal, computed, effect, Optional, isDevMode, SkipSelf, Directive, EventEmitter, Output, Self, Pipe, NgModule, LOCALE_ID, SecurityContext, provideAppInitializer, makeEnvironmentProviders, ElementRef, HostListener, ComponentFactoryResolver, ApplicationRef } from '@angular/core';
3
- import { of, BehaviorSubject, Subject, throwError, firstValueFrom, lastValueFrom, Observable, timer, pipe, concat, ReplaySubject, EMPTY, map as map$1, Subscription, combineLatest, from, fromEvent } from 'rxjs';
2
+ import { inject, ChangeDetectorRef, Input, Component, Injectable, InjectionToken, NgModuleFactory, Injector, Compiler, Inject, signal, computed, effect, LOCALE_ID, Optional, isDevMode, SkipSelf, Directive, EventEmitter, Output, Self, Pipe, SecurityContext, NgModule, provideAppInitializer, makeEnvironmentProviders, ElementRef, HostListener, ComponentFactoryResolver, ApplicationRef } from '@angular/core';
3
+ import { of, BehaviorSubject, Subject, throwError, firstValueFrom, lastValueFrom, Observable, timer, pipe, concat, ReplaySubject, EMPTY, map as map$1, Subscription, combineLatest, from, fromEvent, filter as filter$1, take as take$1, switchMap as switchMap$1, startWith, distinctUntilChanged as distinctUntilChanged$1 } from 'rxjs';
4
4
  import * as i1$1 from '@angular/router';
5
5
  import { PRIMARY_OUTLET, NavigationStart, NavigationError, NavigationEnd, NavigationCancel, Router, TitleStrategy, ActivatedRoute, RouterModule } from '@angular/router';
6
6
  import * as i1$2 from '@angular/common';
7
7
  import { DOCUMENT, registerLocaleData, DatePipe, DATE_PIPE_DEFAULT_TIMEZONE, CommonModule } from '@angular/common';
8
8
  import { map, distinctUntilChanged, filter, catchError, tap, take, switchMap, mapTo, takeUntil, delay, retryWhen, shareReplay, debounceTime, finalize } from 'rxjs/operators';
9
9
  import * as i1 from '@angular/common/http';
10
- import { HttpClient, HttpContextToken, HttpContext, HttpParams, HttpErrorResponse, provideHttpClient, withInterceptorsFromDi, withXsrfConfiguration, HttpHeaders } from '@angular/common/http';
10
+ import { HttpClient, HttpContextToken, HttpContext, HttpParams, HttpErrorResponse, HttpHeaders, provideHttpClient, HTTP_INTERCEPTORS, withInterceptorsFromDi, withXsrfConfiguration } from '@angular/common/http';
11
11
  import compare from 'just-compare';
12
12
  import clone from 'just-clone';
13
13
  import { toSignal } from '@angular/core/rxjs-interop';
14
14
  import { Title, DomSanitizer } from '@angular/platform-browser';
15
+ import { DateTime } from 'luxon';
15
16
  import * as i1$3 from '@angular/forms';
16
17
  import { FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
17
18
 
@@ -2165,6 +2166,164 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
2165
2166
  }]
2166
2167
  }], ctorParameters: () => [] });
2167
2168
 
2169
+ class TimezoneService {
2170
+ constructor() {
2171
+ this.configState = inject(ConfigStateService);
2172
+ this.document = inject(DOCUMENT);
2173
+ this.cookieKey = '__timezone';
2174
+ this.configState.getOne$('setting').subscribe(settings => {
2175
+ this.timeZoneNameFromSettings = settings?.values?.['Abp.Timing.TimeZone'];
2176
+ });
2177
+ this.configState.getOne$('clock').subscribe(clock => {
2178
+ this.isUtcClockEnabled = clock?.kind === 'Utc';
2179
+ });
2180
+ }
2181
+ /**
2182
+ * Returns the effective timezone to be used across the application.
2183
+ *
2184
+ * This value is determined based on the clock kind setting in the configuration:
2185
+ * - If clock kind is not equal to Utc, the browser's local timezone is returned.
2186
+ * - If clock kind is equal to Utc, the configured timezone (`timeZoneNameFromSettings`) is returned if available;
2187
+ * otherwise, the browser's timezone is used as a fallback.
2188
+ *
2189
+ * @returns The IANA timezone name (e.g., 'Europe/Istanbul', 'America/New_York').
2190
+ */
2191
+ get timezone() {
2192
+ if (!this.isUtcClockEnabled) {
2193
+ return this.getBrowserTimezone();
2194
+ }
2195
+ return this.timeZoneNameFromSettings || this.getBrowserTimezone();
2196
+ }
2197
+ /**
2198
+ * Retrieves the browser's local timezone based on the user's system settings.
2199
+ *
2200
+ * @returns The IANA timezone name (e.g., 'Europe/Istanbul', 'America/New_York').
2201
+ */
2202
+ getBrowserTimezone() {
2203
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
2204
+ }
2205
+ /**
2206
+ * Sets the application's timezone in a cookie to persist the user's selected timezone.
2207
+ *
2208
+ * This method sets the cookie only if the clock kind setting is set to UTC.
2209
+ * The cookie is stored using the key defined by `this.cookieKey` and applied to the root path (`/`).
2210
+ *
2211
+ * @param timezone - The IANA timezone name to be stored (e.g., 'Europe/Istanbul').
2212
+ */
2213
+ setTimezone(timezone) {
2214
+ if (this.isUtcClockEnabled) {
2215
+ this.document.cookie = `${this.cookieKey}=${timezone}; path=/`;
2216
+ }
2217
+ }
2218
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TimezoneService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2219
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TimezoneService, providedIn: 'root' }); }
2220
+ }
2221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TimezoneService, decorators: [{
2222
+ type: Injectable,
2223
+ args: [{
2224
+ providedIn: 'root',
2225
+ }]
2226
+ }], ctorParameters: () => [] });
2227
+
2228
+ class TimeService {
2229
+ constructor() {
2230
+ this.locale = inject(LOCALE_ID);
2231
+ }
2232
+ /**
2233
+ * Returns the current date and time in the specified timezone.
2234
+ *
2235
+ * @param zone - An IANA timezone name (e.g., 'Europe/Istanbul', 'UTC'); defaults to the system's local timezone.
2236
+ * @returns A Luxon DateTime instance representing the current time in the given timezone.
2237
+ */
2238
+ now(zone = 'local') {
2239
+ return DateTime.now().setZone(zone);
2240
+ }
2241
+ /**
2242
+ * Converts the input date to the specified timezone, applying any timezone and daylight saving time (DST) adjustments.
2243
+ *
2244
+ * This method:
2245
+ * 1. Parses the input value into a Luxon DateTime object.
2246
+ * 2. Applies the specified IANA timezone, including any DST shifts based on the given date.
2247
+ *
2248
+ * @param value - The ISO string or Date object to convert.
2249
+ * @param zone - An IANA timezone name (e.g., 'America/New_York').
2250
+ * @returns A Luxon DateTime instance adjusted to the specified timezone and DST rules.
2251
+ */
2252
+ toZone(value, zone) {
2253
+ return DateTime.fromISO(value instanceof Date ? value.toISOString() : value, {
2254
+ zone,
2255
+ });
2256
+ }
2257
+ /**
2258
+ * Formats the input date by applying timezone and daylight saving time (DST) adjustments.
2259
+ *
2260
+ * This method:
2261
+ * 1. Converts the input date to the specified timezone.
2262
+ * 2. Formats the result using the given format and locale, reflecting any timezone or DST shifts.
2263
+ *
2264
+ * @param value - The ISO string or Date object to format.
2265
+ * @param format - The format string (default: 'ff').
2266
+ * @param zone - Optional IANA timezone name (e.g., 'America/New_York'); defaults to the system's local timezone.
2267
+ * @returns A formatted date string adjusted for the given timezone and DST rules.
2268
+ */
2269
+ format(value, format = 'ff', zone = 'local') {
2270
+ return this.toZone(value, zone).setLocale(this.locale).toFormat(format);
2271
+ }
2272
+ /**
2273
+ * Formats a date using the standard time offset (ignoring daylight saving time) for the specified timezone.
2274
+ *
2275
+ * This method:
2276
+ * 1. Converts the input date to UTC.
2277
+ * 2. Calculates the standard UTC offset for the given timezone (based on January 1st to avoid DST).
2278
+ * 3. Applies the standard offset manually to the UTC time.
2279
+ * 4. Formats the result using the specified format and locale, without applying additional timezone shifts.
2280
+ *
2281
+ * @param value - The ISO string or Date object to format.
2282
+ * @param format - The Luxon format string (default: 'ff').
2283
+ * @param zone - Optional IANA timezone name (e.g., 'America/New_York'); if omitted, system local timezone is used.
2284
+ * @returns A formatted date string adjusted by standard time (non-DST).
2285
+ */
2286
+ formatDateWithStandardOffset(value, format = 'ff', zone) {
2287
+ const utcDate = typeof value === 'string'
2288
+ ? DateTime.fromISO(value, { zone: 'UTC' })
2289
+ : DateTime.fromJSDate(value, { zone: 'UTC' });
2290
+ if (!utcDate.isValid)
2291
+ return '';
2292
+ const targetZone = zone ?? DateTime.local().zoneName;
2293
+ const januaryDate = DateTime.fromObject({ year: utcDate.year, month: 1, day: 1 }, { zone: targetZone });
2294
+ const standardOffset = januaryDate.offset;
2295
+ const dateWithStandardOffset = utcDate.plus({ minutes: standardOffset });
2296
+ return dateWithStandardOffset.setZone('UTC').setLocale(this.locale).toFormat(format);
2297
+ }
2298
+ /**
2299
+ * Formats the input date using its original clock time, without converting based on timezone or DST
2300
+ *
2301
+ * This method:
2302
+ * 1. Converts the input date to ISO string.
2303
+ * 2. Calculates the date time in UTC, keeping the local time.
2304
+ * 3. Formats the result using the specified format and locale, without shifting timezones.
2305
+ *
2306
+ * @param value - The ISO string or Date object to format.
2307
+ * @param format - The format string (default: 'ff').
2308
+ * @returns A formatted date string without applying timezone.
2309
+ */
2310
+ formatWithoutTimeZone(value, format = 'ff') {
2311
+ const isoString = value instanceof Date ? value.toISOString() : value;
2312
+ const dateTime = DateTime.fromISO(isoString)
2313
+ .setZone('utc', { keepLocalTime: true })
2314
+ .setLocale(this.locale);
2315
+ return dateTime.toFormat(format);
2316
+ }
2317
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TimeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2318
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TimeService, providedIn: 'root' }); }
2319
+ }
2320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TimeService, decorators: [{
2321
+ type: Injectable,
2322
+ args: [{
2323
+ providedIn: 'root',
2324
+ }]
2325
+ }] });
2326
+
2168
2327
  class AbpApplicationConfigurationService {
2169
2328
  constructor(restService) {
2170
2329
  this.restService = restService;
@@ -3637,16 +3796,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
3637
3796
  }]
3638
3797
  }], ctorParameters: () => [{ type: LocalizationService }] });
3639
3798
 
3640
- class LocalizationModule {
3641
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LocalizationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3642
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: LocalizationModule, declarations: [LocalizationPipe], exports: [LocalizationPipe] }); }
3643
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LocalizationModule }); }
3799
+ class SafeHtmlPipe {
3800
+ constructor() {
3801
+ this.sanitizer = inject(DomSanitizer);
3802
+ }
3803
+ transform(value) {
3804
+ if (typeof value !== 'string')
3805
+ return '';
3806
+ return this.sanitizer.sanitize(SecurityContext.HTML, value);
3807
+ }
3808
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: SafeHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3809
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: SafeHtmlPipe, isStandalone: false, name: "abpSafeHtml" }); }
3810
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: SafeHtmlPipe }); }
3644
3811
  }
3645
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LocalizationModule, decorators: [{
3646
- type: NgModule,
3812
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: SafeHtmlPipe, decorators: [{
3813
+ type: Injectable
3814
+ }, {
3815
+ type: Pipe,
3647
3816
  args: [{
3648
- exports: [LocalizationPipe],
3649
- declarations: [LocalizationPipe],
3817
+ standalone: false,
3818
+ name: 'abpSafeHtml',
3650
3819
  }]
3651
3820
  }] });
3652
3821
 
@@ -3726,28 +3895,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
3726
3895
  }]
3727
3896
  }], ctorParameters: () => [{ type: i0.Injector }] });
3728
3897
 
3729
- Date.prototype.toLocalISOString = function () {
3730
- const timezoneOffset = this.getTimezoneOffset();
3731
- return new Date(this.getTime() - timezoneOffset * 60000).toISOString();
3732
- };
3733
-
3734
- class ShortDateTimePipe extends DatePipe {
3898
+ class ShortDatePipe extends DatePipe {
3735
3899
  constructor(configStateService, locale, defaultTimezone) {
3736
3900
  super(locale, defaultTimezone);
3737
3901
  this.configStateService = configStateService;
3738
3902
  }
3739
3903
  transform(value, timezone, locale) {
3740
- const format = getShortDateShortTimeFormat(this.configStateService);
3904
+ const format = getShortDateFormat(this.configStateService);
3741
3905
  return super.transform(value, format, timezone, locale);
3742
3906
  }
3743
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ShortDateTimePipe, deps: [{ token: ConfigStateService }, { token: LOCALE_ID }, { token: DATE_PIPE_DEFAULT_TIMEZONE, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
3744
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: ShortDateTimePipe, isStandalone: false, name: "shortDateTime" }); }
3907
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ShortDatePipe, deps: [{ token: ConfigStateService }, { token: LOCALE_ID }, { token: DATE_PIPE_DEFAULT_TIMEZONE, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
3908
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: ShortDatePipe, isStandalone: false, name: "shortDate" }); }
3745
3909
  }
3746
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ShortDateTimePipe, decorators: [{
3910
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ShortDatePipe, decorators: [{
3747
3911
  type: Pipe,
3748
3912
  args: [{
3749
3913
  standalone: false,
3750
- name: 'shortDateTime',
3914
+ name: 'shortDate',
3751
3915
  pure: true,
3752
3916
  }]
3753
3917
  }], ctorParameters: () => [{ type: ConfigStateService }, { type: undefined, decorators: [{
@@ -3789,23 +3953,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
3789
3953
  type: Optional
3790
3954
  }] }] });
3791
3955
 
3792
- class ShortDatePipe extends DatePipe {
3956
+ class ShortDateTimePipe extends DatePipe {
3793
3957
  constructor(configStateService, locale, defaultTimezone) {
3794
3958
  super(locale, defaultTimezone);
3795
3959
  this.configStateService = configStateService;
3796
3960
  }
3797
3961
  transform(value, timezone, locale) {
3798
- const format = getShortDateFormat(this.configStateService);
3962
+ const format = getShortDateShortTimeFormat(this.configStateService);
3799
3963
  return super.transform(value, format, timezone, locale);
3800
3964
  }
3801
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ShortDatePipe, deps: [{ token: ConfigStateService }, { token: LOCALE_ID }, { token: DATE_PIPE_DEFAULT_TIMEZONE, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
3802
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: ShortDatePipe, isStandalone: false, name: "shortDate" }); }
3965
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ShortDateTimePipe, deps: [{ token: ConfigStateService }, { token: LOCALE_ID }, { token: DATE_PIPE_DEFAULT_TIMEZONE, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
3966
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: ShortDateTimePipe, isStandalone: false, name: "shortDateTime" }); }
3803
3967
  }
3804
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ShortDatePipe, decorators: [{
3968
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ShortDateTimePipe, decorators: [{
3805
3969
  type: Pipe,
3806
3970
  args: [{
3807
3971
  standalone: false,
3808
- name: 'shortDate',
3972
+ name: 'shortDateTime',
3809
3973
  pure: true,
3810
3974
  }]
3811
3975
  }], ctorParameters: () => [{ type: ConfigStateService }, { type: undefined, decorators: [{
@@ -3818,29 +3982,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
3818
3982
  type: Optional
3819
3983
  }] }] });
3820
3984
 
3821
- class SafeHtmlPipe {
3985
+ class UtcToLocalPipe {
3822
3986
  constructor() {
3823
- this.sanitizer = inject(DomSanitizer);
3987
+ this.timezoneService = inject(TimezoneService);
3988
+ this.timeService = inject(TimeService);
3989
+ this.configState = inject(ConfigStateService);
3990
+ this.localizationService = inject(LocalizationService);
3991
+ this.locale = inject(LOCALE_ID);
3824
3992
  }
3825
- transform(value) {
3826
- if (typeof value !== 'string')
3993
+ transform(value, type) {
3994
+ if (!value)
3827
3995
  return '';
3828
- return this.sanitizer.sanitize(SecurityContext.HTML, value);
3996
+ const date = new Date(value);
3997
+ if (isNaN(date.getTime()))
3998
+ return '';
3999
+ const format = this.getFormat(type);
4000
+ try {
4001
+ if (this.timezoneService.isUtcClockEnabled) {
4002
+ const timeZone = this.timezoneService.timezone;
4003
+ return this.timeService.formatDateWithStandardOffset(date, format, timeZone);
4004
+ }
4005
+ else {
4006
+ return this.timeService.formatWithoutTimeZone(date, format);
4007
+ }
4008
+ }
4009
+ catch (err) {
4010
+ return value;
4011
+ }
3829
4012
  }
3830
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: SafeHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3831
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: SafeHtmlPipe, isStandalone: false, name: "abpSafeHtml" }); }
3832
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: SafeHtmlPipe }); }
4013
+ getFormat(propType) {
4014
+ switch (propType) {
4015
+ case 'date':
4016
+ return getShortDateFormat(this.configState);
4017
+ case 'time':
4018
+ return getShortTimeFormat(this.configState);
4019
+ case 'datetime':
4020
+ default:
4021
+ return getShortDateShortTimeFormat(this.configState);
4022
+ }
4023
+ }
4024
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: UtcToLocalPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
4025
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: UtcToLocalPipe, isStandalone: true, name: "abpUtcToLocal" }); }
4026
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: UtcToLocalPipe }); }
3833
4027
  }
3834
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: SafeHtmlPipe, decorators: [{
4028
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: UtcToLocalPipe, decorators: [{
3835
4029
  type: Injectable
3836
4030
  }, {
3837
4031
  type: Pipe,
3838
4032
  args: [{
3839
- standalone: false,
3840
- name: 'abpSafeHtml',
4033
+ name: 'abpUtcToLocal',
4034
+ }]
4035
+ }] });
4036
+
4037
+ class LazyLocalizationPipe {
4038
+ constructor() {
4039
+ this.localizationService = inject(LocalizationService);
4040
+ this.configStateService = inject(ConfigStateService);
4041
+ }
4042
+ transform(key, ...params) {
4043
+ if (!key) {
4044
+ return of('');
4045
+ }
4046
+ const flatParams = params.reduce((acc, val) => (Array.isArray(val) ? acc.concat(val) : [...acc, val]), []);
4047
+ return this.configStateService.getAll$().pipe(filter$1(config => !!config.localization), take$1(1), switchMap$1(() => this.localizationService.get(key, ...flatParams)), map$1(translation => (translation && translation !== key ? translation : '')), startWith(''), distinctUntilChanged$1());
4048
+ }
4049
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LazyLocalizationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
4050
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: LazyLocalizationPipe, isStandalone: true, name: "abpLazyLocalization" }); }
4051
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LazyLocalizationPipe }); }
4052
+ }
4053
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LazyLocalizationPipe, decorators: [{
4054
+ type: Injectable
4055
+ }, {
4056
+ type: Pipe,
4057
+ args: [{
4058
+ name: 'abpLazyLocalization',
3841
4059
  }]
3842
4060
  }] });
3843
4061
 
4062
+ class LocalizationModule {
4063
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LocalizationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4064
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: LocalizationModule, declarations: [LocalizationPipe], imports: [LazyLocalizationPipe], exports: [LocalizationPipe, LazyLocalizationPipe] }); }
4065
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LocalizationModule }); }
4066
+ }
4067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LocalizationModule, decorators: [{
4068
+ type: NgModule,
4069
+ args: [{
4070
+ imports: [LazyLocalizationPipe],
4071
+ exports: [LocalizationPipe, LazyLocalizationPipe],
4072
+ declarations: [LocalizationPipe],
4073
+ }]
4074
+ }] });
4075
+
4076
+ Date.prototype.toLocalISOString = function () {
4077
+ const timezoneOffset = this.getTimezoneOffset();
4078
+ return new Date(this.getTime() - timezoneOffset * 60000).toISOString();
4079
+ };
4080
+
3844
4081
  function setLanguageToCookie() {
3845
4082
  const injector = inject(Injector);
3846
4083
  const sessionState = injector.get(SessionStateService);
@@ -3927,6 +4164,55 @@ function flatRoutes(routes, parent) {
3927
4164
  }, []);
3928
4165
  }
3929
4166
 
4167
+ class ApiInterceptor {
4168
+ constructor(httpWaitService) {
4169
+ this.httpWaitService = httpWaitService;
4170
+ }
4171
+ getAdditionalHeaders(existingHeaders) {
4172
+ return existingHeaders || new HttpHeaders();
4173
+ }
4174
+ intercept(request, next) {
4175
+ this.httpWaitService.addRequest(request);
4176
+ return next.handle(request).pipe(finalize(() => this.httpWaitService.deleteRequest(request)));
4177
+ }
4178
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ApiInterceptor, deps: [{ token: HttpWaitService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4179
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ApiInterceptor, providedIn: 'root' }); }
4180
+ }
4181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ApiInterceptor, decorators: [{
4182
+ type: Injectable,
4183
+ args: [{
4184
+ providedIn: 'root',
4185
+ }]
4186
+ }], ctorParameters: () => [{ type: HttpWaitService }] });
4187
+
4188
+ class TimezoneInterceptor {
4189
+ constructor() {
4190
+ this.timezoneService = inject(TimezoneService);
4191
+ }
4192
+ intercept(req, next) {
4193
+ if (!this.timezoneService.isUtcClockEnabled) {
4194
+ return next.handle(req);
4195
+ }
4196
+ const timezone = this.timezoneService.timezone;
4197
+ if (timezone) {
4198
+ req = req.clone({
4199
+ setHeaders: {
4200
+ __timezone: timezone,
4201
+ },
4202
+ });
4203
+ }
4204
+ return next.handle(req);
4205
+ }
4206
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TimezoneInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4207
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TimezoneInterceptor, providedIn: 'root' }); }
4208
+ }
4209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TimezoneInterceptor, decorators: [{
4210
+ type: Injectable,
4211
+ args: [{
4212
+ providedIn: 'root',
4213
+ }]
4214
+ }] });
4215
+
3930
4216
  var CoreFeatureKind;
3931
4217
  (function (CoreFeatureKind) {
3932
4218
  CoreFeatureKind[CoreFeatureKind["Options"] = 0] = "Options";
@@ -4012,6 +4298,11 @@ function provideAbpCore(...features) {
4012
4298
  provide: TitleStrategy,
4013
4299
  useExisting: AbpTitleStrategy,
4014
4300
  },
4301
+ {
4302
+ provide: HTTP_INTERCEPTORS,
4303
+ useClass: TimezoneInterceptor,
4304
+ multi: true,
4305
+ },
4015
4306
  ];
4016
4307
  for (const feature of features) {
4017
4308
  providers.push(...feature.ɵproviders);
@@ -4060,7 +4351,8 @@ class BaseCoreModule {
4060
4351
  FormsModule,
4061
4352
  ReactiveFormsModule,
4062
4353
  RouterModule,
4063
- LocalizationModule, AutofocusDirective,
4354
+ LocalizationModule,
4355
+ UtcToLocalPipe, AutofocusDirective,
4064
4356
  InputEventDebounceDirective,
4065
4357
  ForDirective,
4066
4358
  FormSubmitDirective,
@@ -4126,6 +4418,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
4126
4418
  ReactiveFormsModule,
4127
4419
  RouterModule,
4128
4420
  LocalizationModule,
4421
+ UtcToLocalPipe,
4129
4422
  ...standaloneDirectives,
4130
4423
  ],
4131
4424
  declarations: [
@@ -4928,32 +5221,11 @@ const AbpValidators = {
4928
5221
  uniqueCharacter: validateUniqueCharacter,
4929
5222
  };
4930
5223
 
4931
- class ApiInterceptor {
4932
- constructor(httpWaitService) {
4933
- this.httpWaitService = httpWaitService;
4934
- }
4935
- getAdditionalHeaders(existingHeaders) {
4936
- return existingHeaders || new HttpHeaders();
4937
- }
4938
- intercept(request, next) {
4939
- this.httpWaitService.addRequest(request);
4940
- return next.handle(request).pipe(finalize(() => this.httpWaitService.deleteRequest(request)));
4941
- }
4942
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ApiInterceptor, deps: [{ token: HttpWaitService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4943
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ApiInterceptor, providedIn: 'root' }); }
4944
- }
4945
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: ApiInterceptor, decorators: [{
4946
- type: Injectable,
4947
- args: [{
4948
- providedIn: 'root',
4949
- }]
4950
- }], ctorParameters: () => [{ type: HttpWaitService }] });
4951
-
4952
5224
  // export * from './lib/handlers';
4953
5225
 
4954
5226
  /**
4955
5227
  * Generated bundle index. Do not edit.
4956
5228
  */
4957
5229
 
4958
- export { APP_INIT_ERROR_HANDLERS, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpApplicationLocalizationService, AbpLocalStorageService, AbpTenantService, AbpTitleStrategy, AbpValidators, AbpWindowService, AbstractAuthErrorFilter, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, 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, DynamicLayoutComponent, EntityDto, EnvironmentService, ExtensibleAuditedEntityDto, ExtensibleAuditedEntityWithUserDto, ExtensibleCreationAuditedEntityDto, ExtensibleCreationAuditedEntityWithUserDto, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleFullAuditedEntityWithUserDto, ExtensibleLimitedResultRequestDto, ExtensibleObject, ExtensiblePagedAndSortedResultRequestDto, ExtensiblePagedResultRequestDto, ExternalHttpClient, ForDirective, FormSubmitDirective, FullAuditedEntityDto, FullAuditedEntityWithUserDto, 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, 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, SafeHtmlPipe, ScriptContentStrategy, ScriptLoadingStrategy, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, ShowPasswordDirective, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TENANT_NOT_FOUND_BY_NAME, TemplateContextStrategy, TemplateProjectionStrategy, ToInjectorPipe, TrackByService, TrackCapsLockDirective, WebHttpUrlEncodingCodec, authGuard, checkHasProp, compareFuncFactory, coreOptionsFactory, createGroupMap, createLocalizationPipeKeyGenerator, createLocalizer, createLocalizerWithFallback, createMapFromList, createTokenParser, createTreeFromList, createTreeNodeFilterCreator, deepMerge, differentLocales, downloadBlob, escapeHtmlChars, exists, featuresFactory, findRoute, fromLazyLoad, generateHash, generatePassword, 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, trackBy, trackByDeep, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUniqueCharacter, validateUrl, withCompareFuncFactory, withOptions, withTitleStrategy };
5230
+ export { APP_INIT_ERROR_HANDLERS, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpApplicationLocalizationService, AbpLocalStorageService, AbpTenantService, AbpTitleStrategy, AbpValidators, AbpWindowService, AbstractAuthErrorFilter, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, 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, DynamicLayoutComponent, EntityDto, EnvironmentService, ExtensibleAuditedEntityDto, ExtensibleAuditedEntityWithUserDto, ExtensibleCreationAuditedEntityDto, ExtensibleCreationAuditedEntityWithUserDto, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleFullAuditedEntityWithUserDto, ExtensibleLimitedResultRequestDto, ExtensibleObject, ExtensiblePagedAndSortedResultRequestDto, ExtensiblePagedResultRequestDto, ExternalHttpClient, ForDirective, FormSubmitDirective, FullAuditedEntityDto, FullAuditedEntityWithUserDto, 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, SafeHtmlPipe, ScriptContentStrategy, ScriptLoadingStrategy, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, ShowPasswordDirective, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TENANT_NOT_FOUND_BY_NAME, TemplateContextStrategy, TemplateProjectionStrategy, TimeService, TimezoneInterceptor, TimezoneService, ToInjectorPipe, TrackByService, TrackCapsLockDirective, UtcToLocalPipe, WebHttpUrlEncodingCodec, authGuard, checkHasProp, compareFuncFactory, coreOptionsFactory, createGroupMap, createLocalizationPipeKeyGenerator, createLocalizer, createLocalizerWithFallback, createMapFromList, createTokenParser, createTreeFromList, createTreeNodeFilterCreator, deepMerge, differentLocales, downloadBlob, escapeHtmlChars, exists, featuresFactory, findRoute, fromLazyLoad, generateHash, generatePassword, 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, trackBy, trackByDeep, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUniqueCharacter, validateUrl, withCompareFuncFactory, withOptions, withTitleStrategy };
4959
5231
  //# sourceMappingURL=abp-ng.core.mjs.map